Section 1
//CustomFilters (com.johnsu.CustomFilters)
package com.johnsu {
import flash.display.*;
import flash.filters.*;
public class CustomFilters {
public function CustomFilters(mySprite:DisplayObject=null){
super();
}
public function _innerSelectGlow(mySprite:DisplayObject):void{
var gradientGlow:GradientGlowFilter = new GradientGlowFilter();
gradientGlow.distance = 0;
gradientGlow.angle = 45;
gradientGlow.colors = [0, 11206655];
gradientGlow.alphas = [0, 0.4];
gradientGlow.ratios = [0, 0xFF];
gradientGlow.blurX = 5;
gradientGlow.blurY = 5;
gradientGlow.strength = 5;
gradientGlow.quality = BitmapFilterQuality.HIGH;
gradientGlow.type = BitmapFilterType.INNER;
mySprite.filters = [gradientGlow];
}
public function _dropShadow2(mySprite:DisplayObject):void{
var temp:DropShadowFilter = new DropShadowFilter(1, 100, 0, 0.5, 8, 8, 1);
mySprite.filters = [temp];
}
public function _outlineRed(mySprite:DisplayObject):void{
var temp:GlowFilter = new GlowFilter(0xFF0000, 1, 5, 5, 2, 1, true);
mySprite.filters = [temp];
}
public function _dropShadow4(mySprite:DisplayObject):void{
var temp:DropShadowFilter = new DropShadowFilter(1, 100, 0, 0.5, 80, 8, 1);
mySprite.filters = [temp];
}
public function _photonGlow(mySprite:DisplayObject):void{
var gradientGlow:GradientGlowFilter = new GradientGlowFilter();
gradientGlow.distance = 0;
gradientGlow.angle = 45;
gradientGlow.colors = [0, 0xFF0000];
gradientGlow.alphas = [0, 1];
gradientGlow.ratios = [0, 0xFF];
gradientGlow.blurX = 30;
gradientGlow.blurY = 30;
gradientGlow.strength = 5;
gradientGlow.quality = BitmapFilterQuality.HIGH;
gradientGlow.type = BitmapFilterType.OUTER;
mySprite.filters = [gradientGlow];
}
public function _oxygenBubble(mySprite:DisplayObject):void{
var gradientGlow:GradientGlowFilter = new GradientGlowFilter();
gradientGlow.distance = 0;
gradientGlow.angle = 45;
gradientGlow.colors = [0, 11206655];
gradientGlow.alphas = [0, 1];
gradientGlow.ratios = [0, 0xFF];
gradientGlow.blurX = 25;
gradientGlow.blurY = 25;
gradientGlow.strength = 4;
gradientGlow.quality = BitmapFilterQuality.HIGH;
gradientGlow.type = BitmapFilterType.OUTER;
mySprite.filters = [gradientGlow];
}
public function _dropShadow3(mySprite:DisplayObject):void{
var temp:DropShadowFilter = new DropShadowFilter(1, 100, 0, 0.5, 8, 8, 1);
mySprite.filters = [temp];
}
public function _dropShadow(mySprite:DisplayObject):void{
var temp:DropShadowFilter = new DropShadowFilter(6, 45, 0, 0.5, 3, 3, 1);
mySprite.filters = [temp];
}
public function _blurfilter(mySprite:DisplayObject):void{
var temp:BlurFilter = new BlurFilter(28, 2, 1);
mySprite.filters = [temp];
}
}
}//package com.johnsu
Section 2
//FPSCounter (com.johnsu.FPSCounter)
package com.johnsu {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class FPSCounter extends Sprite {
private var tf:TextField;
private var ticks:uint;// = 0
private var last:uint;
public function FPSCounter(xPos:int=0, yPos:int=0, color:uint=0xFFFFFF, fillBackground:Boolean=false, backgroundColor:uint=0){
last = getTimer();
super();
x = xPos;
y = yPos;
tf = new TextField();
tf.textColor = color;
tf.text = "----- fps";
tf.selectable = false;
tf.background = fillBackground;
tf.backgroundColor = backgroundColor;
tf.autoSize = TextFieldAutoSize.LEFT;
addChild(tf);
width = tf.textWidth;
height = tf.textHeight;
addEventListener(Event.ENTER_FRAME, tick);
}
public function tick(evt:Event):void{
var fps:Number;
ticks++;
var now:uint = getTimer();
var delta:uint = (now - last);
if (delta >= 1000){
fps = ((ticks / delta) * 1000);
tf.text = (fps.toFixed(1) + " fps");
ticks = 0;
last = now;
};
}
}
}//package com.johnsu
Section 3
//PixelCollisionDetection (com.johnsu.PixelCollisionDetection)
package com.johnsu {
import flash.geom.*;
import flash.display.*;
public class PixelCollisionDetection {
public function PixelCollisionDetection(){
super();
}
public static function getCollisionRect(target1:DisplayObject, target2:DisplayObject, commonParent:DisplayObjectContainer, pixelPrecise:Boolean=false, tolerance:Number=0):Rectangle{
var alpha1:BitmapData;
var alpha2:BitmapData;
var searchColor:uint;
var collisionRect:Rectangle;
var byte:int;
var rect1:Rectangle = target1.getBounds(commonParent);
var rect2:Rectangle = target2.getBounds(commonParent);
var intersectionRect:Rectangle = rect1.intersection(rect2);
if (intersectionRect.size.length > 0){
if (pixelPrecise){
intersectionRect.width = Math.ceil(intersectionRect.width);
intersectionRect.height = Math.ceil(intersectionRect.height);
alpha1 = getAlphaMap(target1, intersectionRect, BitmapDataChannel.RED, commonParent);
alpha2 = getAlphaMap(target2, intersectionRect, BitmapDataChannel.GREEN, commonParent);
alpha1.draw(alpha2, null, null, BlendMode.LIGHTEN);
if (tolerance <= 0){
searchColor = 65792;
} else {
if (tolerance > 1){
tolerance = 1;
};
byte = Math.round((tolerance * 0xFF));
searchColor = (((byte << 16) | (byte << 8)) | 0);
};
collisionRect = alpha1.getColorBoundsRect(searchColor, searchColor);
collisionRect.x = (collisionRect.x + intersectionRect.x);
collisionRect.y = (collisionRect.y + intersectionRect.y);
return (collisionRect);
} else {
return (intersectionRect);
};
//unresolved jump
};
return (null);
}
public static function isColliding(target1:DisplayObject, target2:DisplayObject, commonParent:DisplayObjectContainer, pixelPrecise:Boolean=false, tolerance:Number=0):Boolean{
var collisionRect:Rectangle = getCollisionRect(target1, target2, commonParent, pixelPrecise, tolerance);
if (((!((collisionRect == null))) && ((collisionRect.size.length > 0)))){
return (true);
};
return (false);
}
public static function getCollisionPoint(target1:DisplayObject, target2:DisplayObject, commonParent:DisplayObjectContainer, pixelPrecise:Boolean=false, tolerance:Number=0):Point{
var x:Number;
var y:Number;
var collisionRect:Rectangle = getCollisionRect(target1, target2, commonParent, pixelPrecise, tolerance);
if (((!((collisionRect == null))) && ((collisionRect.size.length > 0)))){
x = ((collisionRect.left + collisionRect.right) / 2);
y = ((collisionRect.top + collisionRect.bottom) / 2);
return (new Point(x, y));
};
return (null);
}
private static function getAlphaMap(target:DisplayObject, rect:Rectangle, channel:uint, commonParent:DisplayObjectContainer):BitmapData{
var parentXformInvert:Matrix = commonParent.transform.concatenatedMatrix.clone();
parentXformInvert.invert();
var targetXform:Matrix = target.transform.concatenatedMatrix.clone();
targetXform.concat(parentXformInvert);
targetXform.translate(-(rect.x), -(rect.y));
var bitmapData:BitmapData = new BitmapData(rect.width, rect.height, true, 0);
bitmapData.draw(target, targetXform);
var alphaChannel:BitmapData = new BitmapData(rect.width, rect.height, false, 0);
alphaChannel.copyChannel(bitmapData, bitmapData.rect, new Point(0, 0), BitmapDataChannel.ALPHA, channel);
return (alphaChannel);
}
}
}//package com.johnsu
Section 4
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public function None(){
super();
}
public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
public static function easeNone(t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
}
}
}//package fl.transitions.easing
Section 5
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public function Strong(){
super();
}
public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{
t = ((t / d) - 1);
return (((c * (((((t * t) * t) * t) * t) + 1)) + b));
}
public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / d);
return (((((((c * t) * t) * t) * t) * t) + b));
}
public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{
t = (t / (d / 2));
if (t < 1){
return ((((((((c / 2) * t) * t) * t) * t) * t) + b));
};
t = (t - 2);
return ((((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b));
}
}
}//package fl.transitions.easing
Section 6
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(obj:Object, prop:String, func:Function, begin:Number, finish:Number, duration:Number, useSeconds:Boolean=false){
func = function (t:Number, b:Number, c:Number, d:Number):Number{
return ((((c * t) / d) + b));
};
super();
if (!arguments.length){
return;
};
this.obj = obj;
this.prop = prop;
this.begin = begin;
this.position = begin;
this.duration = duration;
this.useSeconds = useSeconds;
if ((func is Function)){
this.func = func;
};
this.finish = finish;
this._timer = new Timer(100);
this.start();
}
public function continueTo(finish:Number, duration:Number):void{
this.begin = this.position;
this.finish = finish;
if (!isNaN(duration)){
this.duration = duration;
};
this.start();
}
protected function startEnterFrame():void{
var milliseconds:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
milliseconds = (1000 / this._fps);
this._timer.delay = milliseconds;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(fps:Number):void{
var oldIsPlaying:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = fps;
if (oldIsPlaying){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(t:Number):void{
this.prevTime = this._time;
if (t > this.duration){
if (this.looping){
this.rewind((t - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (t < 0){
this.rewind();
this.update();
} else {
this._time = t;
this.update();
};
};
}
public function getPosition(t:Number=NaN):Number{
if (isNaN(t)){
t = this._time;
};
return (this.func(t, this.begin, this.change, this._duration));
}
public function set finish(value:Number):void{
this.change = (value - this.begin);
}
public function set duration(d:Number):void{
this._duration = ((d)<=0) ? Infinity : d;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(p:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = p);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(event:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(timerEvent:TimerEvent):void{
this.nextFrame();
timerEvent.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(t:Number=0):void{
this._time = t;
this.fixTime();
this.update();
}
public function set position(p:Number):void{
this.setPosition(p);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 7
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(type:String, time:Number, position:Number, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
this.time = time;
this.position = position;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 8
//MochiDigits (mochi.MochiDigits)
package mochi {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function reencode():void{
var newEncode:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function set value(v:Number):void{
setValue(v);
}
public function toString():String{
var s:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi
Section 9
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public function MochiScores(){
super();
}
public static function showLeaderboard(options:Object=null):void{
var n:Number;
var options = options;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (_slot1.boardID != null){
options.boardID = _slot1.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
public static function requestList(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
public static function scoresArrayToObjects(scores:Object):Object{
var i:Number;
var j:Number;
var o:Object;
var row_obj:Object;
var item:String;
var param:String;
var so:Object = {};
for (item in scores) {
if (typeof(scores[item]) == "object"){
if (((!((scores[item].cols == null))) && (!((scores[item].rows == null))))){
so[item] = [];
o = scores[item];
j = 0;
while (j < o.rows.length) {
row_obj = {};
i = 0;
while (i < o.cols.length) {
row_obj[o.cols[i]] = o.rows[j][i];
i++;
};
so[item].push(row_obj);
j++;
};
} else {
so[item] = {};
for (param in scores[item]) {
so[item][param] = scores[item][param];
};
};
} else {
so[item] = scores[item];
};
};
return (so);
}
public static function submit(score:Number, name:String, callbackObj:Object=null, callbackMethod:Object=null):void{
score = Number(score);
if (isNaN(score)){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((score == Number.NEGATIVE_INFINITY)) || ((score == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(score) != score){
trace((("WARNING: Submitted score '" + String(score)) + "' will be truncated"));
};
score = Number(score);
};
};
MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
public static function onClose(args:Object=null):void{
if (args != null){
if (args.error != null){
if (args.error == true){
if (onErrorHandler != null){
if (args.errorCode == null){
args.errorCode = "IOError";
};
onErrorHandler(args.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(boardID:String):void{
_slot1.boardID = boardID;
MochiServices.send("scores_setBoardID", {boardID:boardID});
}
}
}//package mochi
Section 10
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__ms_";
private static var _servicesURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
public static var netup:Boolean = true;
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_clip._queue.push({methodName:methodName, args:args, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
request = _clip._queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _clip._callbacks[request.callbackID];
};
delete _clip._callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
};
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var b:int;
var loader:Loader;
var avm1_bytecode:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var header:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var footer:Array = [0, 64, 0, 0, 0];
var mc:MovieClip = new MovieClip();
var lc:LocalConnection = new LocalConnection();
var lc_name:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
var ba:ByteArray = new ByteArray();
var cpool:ByteArray = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
var actionLength:uint = ((avm1_bytecode.length + cpool.length) + 4);
var fileLength:uint = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, _slot1.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
var rect:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_listenChannel.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
};
return (hostname);
}
public static function getVersion():String{
return ("1.43");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, _slot1.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
private static function onStatus(event:StatusEvent):void{
switch (event.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
public static function get id():String{
return (_id);
}
private static function urlOptions(clip:Object):Object{
var pairs:Array;
var i:Number;
var kv:Array;
var opts:Object = {};
var options:String = clip.loaderInfo.parameters.mochiad_options;
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (container != null){
if ((container is Sprite)){
_container = container;
};
};
if (doAdd){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, _slot1.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_listenChannel.addEventListener(StatusEvent.STATUS, _slot1.onStatus);
_clip.onReceive = function (pkg:Object):void{
var methodName:String;
var pkg = pkg;
var cb:String = pkg.callbackID;
var cblst:Object = this.client._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
trace(((("Error invoking callback method '" + methodName) + "': ") + pkg.toString()));
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
trace(("Error invoking method on object: " + pkg.toString()));
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
_slot1.onError("IOError");
};
trace("connected!");
_connecting = false;
_connected = true;
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (args:Object):void{
_slot1.comChannelName = args.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
var id = id;
var clip = clip;
var clipname:String = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!_slot1.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servicesURL != undefined){
_servicesURL = urlOptions(clip).servicesURL;
};
_slot1.allowDomains(_servicesURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
var f:Function = function (ev:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
_slot1.disconnect();
_slot1.onError("IOError");
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor((Math.random() * 99999))));
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var req:URLRequest = new URLRequest(_servicesURL);
var vars:URLVariables = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
req.data = vars;
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function bringToTop(e:Event):void{
var e = e;
if (_slot1.clip != null){
if (_slot1.childClip != null){
if (_slot1.clip.numChildren > 1){
_slot1.clip.setChildIndex(_slot1.childClip, (_slot1.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, _slot1.bringToTop);
};
};
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
_slot1.onError = onError;
} else {
if (_slot1.onError == null){
_slot1.onError = function (errorCode:String):void{
trace(errorCode);
};
};
};
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number, doAdd:Boolean=true):MovieClip{
var parent = parent;
var name = name;
var depth = depth;
var doAdd = doAdd;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
parent[name] = mc;
//unresolved jump
var _slot1 = e;
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
mc["_name"] = name;
return (mc);
}
public static function connectWait(e:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
_slot1.disconnect();
_slot1.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 11
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
super(bitmapData, pixelSnapping, smoothing);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
}
}//package mx.core
Section 12
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
public function ByteArrayAsset(){
super();
}
}
}//package mx.core
Section 13
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(left:Number=0, top:Number=0, right:Number=0, bottom:Number=0){
super();
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 14
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){
var bitmapData = bitmapData;
var pixelSnapping = pixelSnapping;
var smoothing = smoothing;
super(bitmapData, pixelSnapping, smoothing);
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 15
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexMovieClip(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 16
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexSprite(){
super();
name = NameUtil.createUniqueName(this);
//unresolved jump
var _slot1 = e;
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 17
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
public function FontAsset(){
super();
}
}
}//package mx.core
Section 18
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 19
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 20
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(void:Point):Point;
function get name():String;
function set width(flash.display:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(flash.display:String):void;
function set scaleX(flash.display:Number):void;
function set scaleY(flash.display:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(flash.display:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(void:Point):Point;
function get height():Number;
function set blendMode(flash.display:String):void;
function get parent():DisplayObjectContainer;
function getBounds(String:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(flash.display:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(flash.display:Number):void;
function set accessibilityProperties(flash.display:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(flash.display:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(flash.display:Number):void;
function set mask(flash.display:DisplayObject):void;
function getRect(String:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(flash.display:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(mx.core:IFlexDisplayObject/mx.core:IFlexDisplayObject:stage/get:DisplayObject):Boolean;
function set opaqueBackground(flash.display:Object):void;
function set visible(flash.display:Boolean):void;
function get mask():DisplayObject;
function set x(flash.display:Number):void;
function set y(flash.display:Number):void;
function get transform():Transform;
function set filters(flash.display:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(flash.display:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 21
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(E:\dev\3.1.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get isDocument():Boolean;
function set repeaters(E:\dev\3.1.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function initializeRepeaterArrays(E:\dev\3.1.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(E:\dev\3.1.0\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 22
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipAsset(){
super();
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 23
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipLoaderAsset(){
super();
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in loaderContext)){
loaderContext["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, loaderContext);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(value:Number):void{
if (!initialized){
requestedWidth = value;
} else {
loader.width = value;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(event:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(event);
}
override public function set height(value:Number):void{
if (!initialized){
requestedHeight = value;
} else {
loader.height = value;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 24
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 25
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
public function SoundAsset(){
super();
}
}
}//package mx.core
Section 26
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function SpriteAsset(){
super();
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(newWidth:Number, newHeight:Number):void{
width = newWidth;
height = newHeight;
}
public function move(x:Number, y:Number):void{
this.x = x;
this.y = y;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 27
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public function NameUtil(){
super();
}
public static function displayObjectToString(displayObject:DisplayObject):String{
var result:String;
var s:String;
var indices:Array;
var o:DisplayObject = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
return (result);
}
public static function createUniqueName(object:Object):String{
if (!object){
return (null);
};
var name:String = getQualifiedClassName(object);
var index:int = name.indexOf("::");
if (index != -1){
name = name.substr((index + 2));
};
var charCode:int = name.charCodeAt((name.length - 1));
if ((((charCode >= 48)) && ((charCode <= 57)))){
name = (name + "_");
};
return ((name + counter++));
}
}
}//package mx.utils
Section 28
//CampFire (CampFire)
package {
import flash.display.*;
import com.johnsu.*;
public class CampFire extends Sprite {
private var delay:Number;// = 0
private var fire:Class;
private var delay_max:Number;// = 3
public var facing:String;// = "left"
public var frame_number:Number;// = 1
public function CampFire(){
fire = CampFire_fire;
super();
var frame:Sprite = new fire();
frame.width = 60;
frame.height = 50;
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(frame);
addChild(frame);
}
}
}//package
Section 29
//CampFire_fire (CampFire_fire)
package {
import mx.core.*;
import flash.utils.*;
public class CampFire_fire extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function CampFire_fire(){
dataClass = CampFire_fire_dataClass;
super();
initialWidth = (0x5000 / 20);
initialHeight = (0x3C00 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 30
//CampFire_fire_dataClass (CampFire_fire_dataClass)
package {
import mx.core.*;
public class CampFire_fire_dataClass extends ByteArrayAsset {
}
}//package
Section 31
//Character (Character)
package {
import flash.display.*;
import com.johnsu.*;
public class Character extends Sprite {
private const max_frame_number:Number = 24;
public var stunned:Number;// = 0
private var delay:Number;// = 0
private var jungle_falling:Class;
private var image_ladder:MovieClip;
public var before_feet:Sprite;
private var image_jump:MovieClip;
private var LastAction:String;// = "walk"
private var image_rope:MovieClip;
private var image_dying_backward:MovieClip;
public var behind_feet:Sprite;
public var frame_number:Number;// = 5
public var Action:String;// = "walk"
private var image_fall:MovieClip;
private var jungle_climbing_ladder:Class;
private var jungle_climbing_rope:Class;
private var image_run:MovieClip;
private var delay_max:Number;// = 2
public var facing:String;// = "right"
private var jungle_jumping:Class;
public var feet:Sprite;
private var jungle_dying_backward:Class;
private var jungle_running:Class;
public function Character(){
jungle_falling = Character_jungle_falling;
jungle_jumping = Character_jungle_jumping;
jungle_running = Character_jungle_running;
jungle_climbing_rope = Character_jungle_climbing_rope;
jungle_climbing_ladder = Character_jungle_climbing_ladder;
jungle_dying_backward = Character_jungle_dying_backward;
image_run = new jungle_running();
image_ladder = new jungle_climbing_ladder();
image_jump = new jungle_jumping();
image_rope = new jungle_climbing_rope();
image_fall = new jungle_falling();
image_dying_backward = new jungle_dying_backward();
feet = new Sprite();
before_feet = new Sprite();
behind_feet = new Sprite();
super();
respawn();
}
public function Animate():void{
if (LastAction == Action){
switch (Action){
case "fall":
image_fall.gotoAndStop(frame_number);
delay++;
break;
case "jump":
image_jump.gotoAndStop(frame_number);
delay++;
break;
case "walk":
image_run.gotoAndStop(frame_number);
delay++;
break;
case "climb ladder":
image_ladder.gotoAndStop(frame_number);
delay++;
break;
case "climb rope":
image_rope.gotoAndStop(frame_number);
delay++;
break;
case "rope swing":
image_rope.gotoAndStop(frame_number);
break;
case "stunned":
image_run.gotoAndStop(frame_number);
break;
case "dying":
image_dying_backward.gotoAndStop(frame_number);
delay++;
break;
};
if (delay == delay_max){
frame_number++;
delay = 0;
};
if (frame_number == (max_frame_number + 1)){
frame_number = 1;
};
} else {
switch (LastAction){
case "fall":
if (getChildByName("fall")){
removeChild(image_fall);
};
break;
case "jump":
if (getChildByName("jump")){
removeChild(image_jump);
};
break;
case "walk":
if (getChildByName("walk")){
removeChild(image_run);
};
break;
case "climb ladder":
if (getChildByName("climb ladder")){
removeChild(image_ladder);
};
break;
case "climb rope":
if (getChildByName("climb rope")){
removeChild(image_rope);
};
break;
case "rope swing":
if (getChildByName("rope swing")){
removeChild(image_rope);
};
break;
case "stunned":
if (getChildByName("stunned")){
removeChild(image_run);
};
break;
case "dying":
if (getChildByName("dying")){
removeChild(image_dying_backward);
};
break;
};
LastAction = Action;
switch (Action){
case "fall":
image_fall.name = "fall";
addChild(image_fall);
image_fall.stop();
if (facing == "right"){
image_fall.scaleX = (image_fall.scaleX * -1);
};
break;
case "jump":
image_jump.name = "jump";
addChild(image_jump);
image_jump.stop();
if (facing == "right"){
image_jump.scaleX = -1;
};
break;
case "walk":
image_run.name = "walk";
addChild(image_run);
image_run.gotoAndStop(5);
break;
case "climb ladder":
image_ladder.name = "climb ladder";
addChild(image_ladder);
image_ladder.stop();
break;
case "climb rope":
image_rope.name = "climb rope";
addChild(image_rope);
image_rope.stop();
break;
case "rope swing":
image_rope.name = "rope swing";
addChild(image_rope);
image_rope.stop();
break;
case "stunned":
image_run.name = "stunned";
addChild(image_run);
image_run.gotoAndStop(30);
frame_number = 30;
break;
case "dying":
image_dying_backward.name = "dying";
addChild(image_dying_backward);
break;
};
};
}
public function respawn():void{
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(image_run);
imageFill._dropShadow3(image_jump);
imageFill._dropShadow3(image_rope);
imageFill._dropShadow3(image_dying_backward);
imageFill._dropShadow3(image_fall);
imageFill._dropShadow3(image_ladder);
image_run.name = "walk";
addChild(image_run);
image_run.gotoAndStop(5);
image_run.alpha = 1;
if (facing == "right"){
image_run.scaleX = (image_run.scaleX * -1);
};
feet.graphics.beginFill(520050);
feet.graphics.drawRect(0, 100, 20, 10);
feet.graphics.endFill();
feet.alpha = 0;
image_run.addChild(feet);
before_feet.graphics.beginFill(111520050);
before_feet.graphics.drawRect(-100, 100, 80, 10);
before_feet.graphics.endFill();
before_feet.alpha = 0;
image_run.addChild(before_feet);
}
}
}//package
Section 32
//Character_jungle_climbing_ladder (Character_jungle_climbing_ladder)
package {
import mx.core.*;
public class Character_jungle_climbing_ladder extends MovieClipAsset {
}
}//package
Section 33
//Character_jungle_climbing_rope (Character_jungle_climbing_rope)
package {
import mx.core.*;
public class Character_jungle_climbing_rope extends MovieClipAsset {
}
}//package
Section 34
//Character_jungle_dying_backward (Character_jungle_dying_backward)
package {
import mx.core.*;
public class Character_jungle_dying_backward extends MovieClipAsset {
}
}//package
Section 35
//Character_jungle_falling (Character_jungle_falling)
package {
import mx.core.*;
public class Character_jungle_falling extends MovieClipAsset {
}
}//package
Section 36
//Character_jungle_jumping (Character_jungle_jumping)
package {
import mx.core.*;
public class Character_jungle_jumping extends MovieClipAsset {
}
}//package
Section 37
//Character_jungle_running (Character_jungle_running)
package {
import mx.core.*;
public class Character_jungle_running extends MovieClipAsset {
}
}//package
Section 38
//Diamond (Diamond)
package {
import flash.display.*;
import com.johnsu.*;
public class Diamond extends Sprite {
public var points:Number;// = 5000
private var treasure:Class;
public function Diamond(){
treasure = Diamond_treasure;
super();
var frame:Bitmap = new treasure();
frame.width = 35;
frame.height = 30;
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(frame);
addChild(frame);
}
}
}//package
Section 39
//Diamond_treasure (Diamond_treasure)
package {
import mx.core.*;
public class Diamond_treasure extends BitmapAsset {
}
}//package
Section 40
//DisplayLevel1 (DisplayLevel1)
package {
import fl.transitions.*;
import flash.display.*;
import com.johnsu.*;
import fl.transitions.easing.*;
public class DisplayLevel1 extends Sprite {
private const ladder_height:Number = 250;
private const ladder_width:Number = 60;
private const ladder_startY:Number = 460;
public var death_delay:Number;
private var floor:Bitmap;
private var croc1:MovieClip;
public var croc2:MovieClip;
public var croc2b_hitarea:Sprite;
private var vineTween1:Tween;
public var ladder:Sprite;
private var plant2:Class;
private var plant3:Class;
private var plant4:Class;
private var plant5:Class;
private var plant6:Class;
private var plant7:Class;
private var plant1:Class;
public var pit1contactX:Number;
public var pit2contactX:Number;
public var pit3contactX:Number;
public var tarpit_expand:Boolean;// = false
private var plant8:Class;
private var background:Class;
public var tarpit_hitarea:Sprite;
private var background_floor:Class;
private var plant9:Class;
private var fern:Bitmap;
public var background1:Bitmap;
public var background2:Bitmap;
private var croc_delay:Number;// = 0
private var background_underground:Class;
private var background_ladder:Class;
public var tarpit:Sprite;
private var fern_row:Sprite;
private var tunnel:Bitmap;
private var vineTween2:Tween;
public var jungle_vine:vine;
private var background_croc:Class;
public var pit2:Pit;
public var pit3:Pit;
public var croc1b_hitarea:Sprite;
public var pit1:Pit;
public var croc1_hitarea:Sprite;
public var croc2_hitarea:Sprite;
public function DisplayLevel1(){
background = DisplayLevel1_background;
background_floor = DisplayLevel1_background_floor;
background_underground = DisplayLevel1_background_underground;
background_ladder = DisplayLevel1_background_ladder;
background_croc = DisplayLevel1_background_croc;
plant1 = DisplayLevel1_plant1;
plant2 = DisplayLevel1_plant2;
plant3 = DisplayLevel1_plant3;
plant4 = DisplayLevel1_plant4;
plant5 = DisplayLevel1_plant5;
plant6 = DisplayLevel1_plant6;
plant7 = DisplayLevel1_plant7;
plant8 = DisplayLevel1_plant8;
plant9 = DisplayLevel1_plant9;
jungle_vine = new vine();
floor = new background_floor();
tunnel = new background_underground();
ladder = new background_ladder();
pit1 = new Pit();
pit2 = new Pit();
pit3 = new Pit();
tarpit_hitarea = new Sprite();
tarpit = new Sprite();
fern_row = new Sprite();
croc1 = new background_croc();
croc1_hitarea = new Sprite();
croc1b_hitarea = new Sprite();
croc2 = new background_croc();
croc2_hitarea = new Sprite();
croc2b_hitarea = new Sprite();
vineTween1 = new Tween(jungle_vine, "rotation", None.easeOut, 140, 30, 2, true);
vineTween2 = new Tween(jungle_vine, "rotation", None.easeOut, 30, 140, 2, true);
super();
regen();
}
public function regen():void{
var random_num:Number;
death_delay = 0;
if (getChildByName("tarpit")){
removeChild(tarpit);
};
if (getChildByName("ladder")){
removeChild(ladder);
};
if (getChildByName("pit1")){
removeChild(pit1);
};
if (getChildByName("pit2")){
removeChild(pit2);
};
if (getChildByName("pit3")){
removeChild(pit3);
};
if (getChildByName("jungle_vine")){
removeChild(jungle_vine);
};
if (getChildByName("background1")){
removeChild(background1);
};
background1 = new background();
background1.name = "background1";
addChild(background1);
if (getChildByName("background2")){
removeChild(background2);
};
background2 = new background();
background2.name = "background2";
addChild(background2);
if (getChildByName("floor")){
removeChild(floor);
};
floor.name = "floor";
addChild(floor);
if (getChildByName("tunnel")){
removeChild(tunnel);
};
tunnel.name = "tunnel";
addChild(tunnel);
if (getChildByName("fern_row")){
removeChild(fern_row);
fern_row = new Sprite();
};
fern_row.name = "fern_row";
var xx:Number = 0;
while (xx < 40) {
random_num = int(((Math.random() * 9) + 1));
switch (random_num){
case 1:
fern = new plant1();
fern.y = 230;
break;
case 2:
fern = new plant2();
fern.y = 245;
break;
case 3:
fern = new plant3();
fern.y = 210;
break;
case 4:
fern = new plant4();
fern.y = 254;
break;
case 5:
fern = new plant5();
fern.y = 293;
break;
case 6:
fern = new plant6();
fern.y = 303;
break;
case 7:
fern = new plant7();
fern.y = 296;
break;
case 8:
fern = new plant8();
fern.y = 301;
break;
case 9:
fern = new plant9();
fern.y = 299;
break;
};
random_num = int(((Math.random() * 9) + 1));
fern.x = (((xx * 50) - 50) + random_num);
fern.alpha = 0.75;
fern_row.addChild(fern);
xx++;
};
xx = 0;
while (xx < 40) {
random_num = int(((Math.random() * 9) + 1));
switch (random_num){
case 1:
fern = new plant1();
fern.y = 205;
break;
case 2:
fern = new plant2();
fern.y = 220;
break;
case 3:
fern = new plant3();
fern.y = 185;
break;
case 4:
fern = new plant4();
fern.y = 229;
break;
case 5:
fern = new plant5();
fern.y = 268;
break;
case 6:
fern = new plant6();
fern.y = 278;
break;
case 7:
fern = new plant7();
fern.y = 271;
break;
case 8:
fern = new plant8();
fern.y = 276;
break;
case 9:
fern = new plant9();
fern.y = 278;
break;
};
random_num = int(((Math.random() * 20) + 1));
fern.x = ((xx * 50) - random_num);
fern.alpha = 0.55;
fern_row.addChild(fern);
xx++;
};
xx = 0;
while (xx < 40) {
random_num = int(((Math.random() * 9) + 1));
switch (random_num){
case 1:
fern = new plant1();
fern.y = 180;
break;
case 2:
fern = new plant2();
fern.y = 195;
break;
case 3:
fern = new plant3();
fern.y = 160;
break;
case 4:
fern = new plant4();
fern.y = 204;
break;
case 5:
fern = new plant5();
fern.y = 243;
break;
case 6:
fern = new plant6();
fern.y = 253;
break;
case 7:
fern = new plant7();
fern.y = 246;
break;
case 8:
fern = new plant8();
fern.y = 251;
break;
case 9:
fern = new plant9();
fern.y = 249;
break;
};
random_num = int(((Math.random() * 20) + 1));
fern.x = ((xx * 50) + random_num);
fern.alpha = 0.75;
fern_row.addChild(fern);
xx++;
};
addChild(fern_row);
background1.x = -200;
background1.alpha = 0.9;
background2.x = 1142;
background2.alpha = 0.9;
background2.scaleX = -1;
floor.alpha = 1;
floor.y = 260;
floor.x = -200;
floor.width = 1200;
tunnel.x = -200;
tunnel.y = 400;
tunnel.width = 1200;
tunnel.height = 250;
tunnel.alpha = 0.3;
}
public function updateCrocs():void{
croc_delay++;
if (croc_delay > 120){
croc1.gotoAndStop(2);
croc2.gotoAndStop(2);
if (croc1.getChildByName("croc1_hitarea_close")){
croc1.removeChild(croc1_hitarea);
croc1b_hitarea.name = "croc1_hitarea_open";
croc1b_hitarea.graphics.beginFill(1120050);
croc1b_hitarea.graphics.drawRect(175, 0, 15, 40);
croc1b_hitarea.graphics.endFill();
croc1b_hitarea.alpha = 0;
croc1.addChild(croc1b_hitarea);
};
if (croc2.getChildByName("croc2_hitarea_close")){
croc2.removeChild(croc2_hitarea);
croc2b_hitarea.name = "croc2_hitarea_open";
croc2b_hitarea.graphics.beginFill(1520080);
croc2b_hitarea.graphics.drawRect(175, 0, 15, 40);
croc2b_hitarea.graphics.endFill();
croc2b_hitarea.alpha = 0;
croc2.addChild(croc2b_hitarea);
};
if (croc_delay > 240){
croc_delay = 0;
};
} else {
croc1.gotoAndStop(1);
croc2.gotoAndStop(1);
if (croc1.getChildByName("croc1_hitarea_open")){
croc1.removeChild(croc1b_hitarea);
croc1_hitarea.name = "croc1_hitarea_close";
croc1_hitarea.graphics.beginFill(1120050);
croc1_hitarea.graphics.drawRect(140, 0, 50, 40);
croc1_hitarea.graphics.endFill();
croc1.addChild(croc1_hitarea);
};
if (croc2.getChildByName("croc2_hitarea_open")){
croc2.removeChild(croc2b_hitarea);
croc2_hitarea.name = "croc2_hitarea_close";
croc2_hitarea.graphics.beginFill(1520080);
croc2_hitarea.graphics.drawRect(140, 0, 50, 40);
croc2_hitarea.graphics.endFill();
croc2.addChild(croc2_hitarea);
};
};
}
private function vineBack(e:TweenEvent):void{
vineTween1.removeEventListener(TweenEvent.MOTION_STOP, vineBack);
trace("VineBack!");
vineTween2.addEventListener(TweenEvent.MOTION_STOP, vineForth);
vineTween2.rewind();
vineTween2.start();
}
public function addCrocs():void{
if (getChildByName("croc1")){
removeChild(croc1);
};
croc1.name = "croc1";
addChild(croc1);
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(croc1);
croc1.stop();
croc1.x = 180;
croc1.y = 358;
croc1_hitarea.name = "croc1_hitarea_close";
croc1_hitarea.graphics.beginFill(1120050);
croc1_hitarea.graphics.drawRect(140, 0, 50, 40);
croc1_hitarea.graphics.endFill();
croc1_hitarea.alpha = 0;
croc1.addChild(croc1_hitarea);
if (getChildByName("croc2")){
removeChild(croc1);
};
croc1.name = "croc2";
addChild(croc2);
imageFill._dropShadow3(croc2);
croc2.stop();
croc2.x = (croc1.x + 150);
croc2.y = croc1.y;
croc2_hitarea.name = "croc2_hitarea_close";
croc2_hitarea.graphics.beginFill(1180080);
croc2_hitarea.graphics.drawRect(140, 0, 50, 40);
croc2_hitarea.graphics.endFill();
croc2_hitarea.alpha = 0;
croc2.addChild(croc2_hitarea);
}
public function addPit3():void{
pit2.name = "pit2";
addChild(pit2);
pit2.x = 190;
pit2.y = 343;
pit2.height = 70;
pit2.width = 70;
pit2contactX = (pit2.x + (pit2.width / 2));
pit1.name = "pit1";
addChild(pit1);
pit1.x = 363;
pit1.y = 343;
pit1.height = 70;
pit1contactX = (pit1.x + (pit1.width / 2));
pit3.name = "pit3";
addChild(pit3);
pit3.x = 513;
pit3.y = 343;
pit3.height = 70;
pit3.width = 70;
pit3contactX = (pit3.x + (pit3.width / 2));
ladder.name = "ladder";
addChild(ladder);
ladder.x = pit1contactX;
ladder.y = ladder_startY;
ladder.width = ladder_width;
ladder.height = ladder_height;
}
public function addTarPit(type:String="tarpit"):void{
death_delay = 0;
tarpit_hitarea.graphics.beginFill(520050);
tarpit_hitarea.graphics.drawEllipse(310, 360, 240, 10);
tarpit_hitarea.graphics.endFill();
tarpit_hitarea.alpha = 0;
if (getChildByName("tarpit")){
removeChild(tarpit);
};
tarpit.name = "tarpit";
addChild(tarpit);
switch (type){
case "tarpit":
tarpit.graphics.beginFill(50);
break;
case "quicksand":
tarpit.graphics.beginFill(120050);
break;
};
tarpit.graphics.drawEllipse(240, 343, 380, 80);
tarpit.graphics.endFill();
tarpit.alpha = 1;
tarpit.addChild(tarpit_hitarea);
}
public function addPit(facing:String="left"):void{
pit1.name = "pit1";
addChild(pit1);
pit1.x = 363;
pit1.y = 343;
pit1.height = 70;
pit1.width = 50;
pit1contactX = (pit1.x + (pit1.width / 2));
ladder.name = "ladder";
addChild(ladder);
ladder.x = (pit1contactX - 5);
ladder.y = ladder_startY;
ladder.width = ladder_width;
ladder.height = ladder_height;
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow(ladder);
}
public function swingVine():void{
if ((((jungle_vine.rotation <= 30)) && (!(jungle_vine.swing_left)))){
jungle_vine.swing_left = true;
};
if ((((jungle_vine.rotation >= 140)) && (jungle_vine.swing_left))){
jungle_vine.swing_left = false;
};
jungle_vine.contactX = ((Math.cos(((jungle_vine.rotation * Math.PI) / 180)) * jungle_vine.contact_radius) + jungle_vine.x);
jungle_vine.contactY = ((Math.sin(((jungle_vine.rotation * Math.PI) / 180)) * jungle_vine.contact_radius) + jungle_vine.y);
jungle_vine.contact2X = ((Math.cos((((jungle_vine.rotation + 7) * Math.PI) / 180)) * jungle_vine.contact_radius) + jungle_vine.x);
jungle_vine.contact2Y = ((Math.sin((((jungle_vine.rotation + 7) * Math.PI) / 180)) * jungle_vine.contact_radius) + jungle_vine.y);
}
public function removeVine():void{
trace("removing Vines");
if (this.getChildByName("jungle_vine")){
this.removeChild(jungle_vine);
};
}
public function addVine():void{
vineTween1.stop();
vineTween2.stop();
if (!getChildByName("jungle_vine")){
trace("addVine");
jungle_vine.name = "jungle_vine";
addChild(jungle_vine);
};
jungle_vine.rotation = 90;
jungle_vine.x = 400;
jungle_vine.y = -105;
vineTween1.start();
vineTween1.addEventListener(TweenEvent.MOTION_STOP, vineBack);
}
private function vineForth(e:TweenEvent):void{
vineTween2.removeEventListener(TweenEvent.MOTION_STOP, vineForth);
trace("vineForth!");
vineTween1.addEventListener(TweenEvent.MOTION_STOP, vineBack);
vineTween1.rewind();
vineTween1.start();
}
}
}//package
Section 41
//DisplayLevel1_background (DisplayLevel1_background)
package {
import mx.core.*;
public class DisplayLevel1_background extends BitmapAsset {
}
}//package
Section 42
//DisplayLevel1_background_croc (DisplayLevel1_background_croc)
package {
import mx.core.*;
public class DisplayLevel1_background_croc extends MovieClipAsset {
}
}//package
Section 43
//DisplayLevel1_background_floor (DisplayLevel1_background_floor)
package {
import mx.core.*;
public class DisplayLevel1_background_floor extends BitmapAsset {
}
}//package
Section 44
//DisplayLevel1_background_ladder (DisplayLevel1_background_ladder)
package {
import mx.core.*;
public class DisplayLevel1_background_ladder extends SpriteAsset {
}
}//package
Section 45
//DisplayLevel1_background_underground (DisplayLevel1_background_underground)
package {
import mx.core.*;
public class DisplayLevel1_background_underground extends BitmapAsset {
}
}//package
Section 46
//DisplayLevel1_plant1 (DisplayLevel1_plant1)
package {
import mx.core.*;
public class DisplayLevel1_plant1 extends BitmapAsset {
}
}//package
Section 47
//DisplayLevel1_plant2 (DisplayLevel1_plant2)
package {
import mx.core.*;
public class DisplayLevel1_plant2 extends BitmapAsset {
}
}//package
Section 48
//DisplayLevel1_plant3 (DisplayLevel1_plant3)
package {
import mx.core.*;
public class DisplayLevel1_plant3 extends BitmapAsset {
}
}//package
Section 49
//DisplayLevel1_plant4 (DisplayLevel1_plant4)
package {
import mx.core.*;
public class DisplayLevel1_plant4 extends BitmapAsset {
}
}//package
Section 50
//DisplayLevel1_plant5 (DisplayLevel1_plant5)
package {
import mx.core.*;
public class DisplayLevel1_plant5 extends BitmapAsset {
}
}//package
Section 51
//DisplayLevel1_plant6 (DisplayLevel1_plant6)
package {
import mx.core.*;
public class DisplayLevel1_plant6 extends BitmapAsset {
}
}//package
Section 52
//DisplayLevel1_plant7 (DisplayLevel1_plant7)
package {
import mx.core.*;
public class DisplayLevel1_plant7 extends BitmapAsset {
}
}//package
Section 53
//DisplayLevel1_plant8 (DisplayLevel1_plant8)
package {
import mx.core.*;
public class DisplayLevel1_plant8 extends BitmapAsset {
}
}//package
Section 54
//DisplayLevel1_plant9 (DisplayLevel1_plant9)
package {
import mx.core.*;
public class DisplayLevel1_plant9 extends BitmapAsset {
}
}//package
Section 55
//DisplayLevel3 (DisplayLevel3)
package {
import flash.display.*;
public class DisplayLevel3 extends Sprite {
private var background_wall:Class;
private var foreground_border1:Sprite;
public var wall:Sprite;
private var foreground_border3:Sprite;
private var foreground_border2:Sprite;
private var foreground_border4:Sprite;
private var fern_row:Sprite;
private var foreground_underground:Class;
private var plant1:Class;
private var plant2:Class;
private var plant3:Class;
private var plant4:Class;
private var plant5:Class;
private var plant6:Class;
private var plant7:Class;
private var plant8:Class;
private var plant9:Class;
public var wall_collisionX:Number;
private var fern:Bitmap;
public function DisplayLevel3(){
foreground_underground = DisplayLevel3_foreground_underground;
background_wall = DisplayLevel3_background_wall;
plant1 = DisplayLevel3_plant1;
plant2 = DisplayLevel3_plant2;
plant3 = DisplayLevel3_plant3;
plant4 = DisplayLevel3_plant4;
plant5 = DisplayLevel3_plant5;
plant6 = DisplayLevel3_plant6;
plant7 = DisplayLevel3_plant7;
plant8 = DisplayLevel3_plant8;
plant9 = DisplayLevel3_plant9;
fern_row = new Sprite();
wall = new background_wall();
foreground_border1 = new foreground_underground();
foreground_border2 = new foreground_underground();
foreground_border3 = new foreground_underground();
foreground_border4 = new foreground_underground();
super();
foreground_border1.x = 500;
foreground_border1.y = 400;
foreground_border1.width = 400;
foreground_border1.height = 90;
foreground_border2.x = 800;
foreground_border2.y = 390;
foreground_border2.scaleX = -1;
foreground_border2.width = 400;
foreground_border2.height = 90;
foreground_border3.x = 300;
foreground_border3.y = 400;
foreground_border3.width = 400;
foreground_border3.height = 90;
foreground_border4.x = 0;
foreground_border4.y = 400;
foreground_border4.width = 400;
foreground_border4.height = 90;
if (getChildByName("border1")){
removeChild(foreground_border1);
};
foreground_border1.name = "border1";
addChild(foreground_border1);
if (getChildByName("border2")){
removeChild(foreground_border2);
};
foreground_border1.name = "border2";
addChild(foreground_border2);
if (getChildByName("border3")){
removeChild(foreground_border3);
};
foreground_border1.name = "border3";
addChild(foreground_border3);
if (getChildByName("border4")){
removeChild(foreground_border4);
};
foreground_border1.name = "border4";
addChild(foreground_border4);
}
public function AddWall(facing:String="none"):void{
var random_num:Number;
var delta:Number;
if (getChildByName("wall")){
removeChild(wall);
};
if (facing == "right"){
wall.name = "wall";
addChild(wall);
wall.x = 750;
wall.y = 520;
wall.width = 70;
wall.height = 200;
wall_collisionX = wall.x;
};
if (facing == "left"){
wall.name = "wall";
addChild(wall);
wall.x = 80;
wall.y = 520;
wall.width = 70;
wall.height = 200;
wall_collisionX = wall.x;
};
if (getChildByName("border1")){
removeChild(foreground_border1);
};
foreground_border1.name = "border1";
addChild(foreground_border1);
if (getChildByName("border2")){
removeChild(foreground_border2);
};
foreground_border1.name = "border2";
addChild(foreground_border2);
if (getChildByName("border3")){
removeChild(foreground_border3);
};
foreground_border1.name = "border3";
addChild(foreground_border3);
if (getChildByName("border4")){
removeChild(foreground_border4);
};
foreground_border1.name = "border4";
addChild(foreground_border4);
if (getChildByName("fern_row")){
removeChild(fern_row);
fern_row = new Sprite();
};
fern_row.name = "fern_row";
var xx:Number = 0;
while (xx < 40) {
random_num = int(((Math.random() * 9) + 1));
delta = 100;
switch (random_num){
case 5:
fern = new plant5();
fern.y = (268 + delta);
break;
case 6:
fern = new plant6();
fern.y = (268 + delta);
break;
case 7:
fern = new plant7();
fern.y = (261 + delta);
break;
case 8:
fern = new plant8();
fern.y = (266 + delta);
break;
case 9:
fern = new plant9();
fern.y = (268 + delta);
break;
default:
fern = new plant5();
fern.y = (268 + delta);
break;
};
random_num = int(((Math.random() * 20) + 1));
fern.x = ((xx * 50) - random_num);
fern_row.addChild(fern);
xx++;
};
fern_row.scaleY = 1;
fern_row.alpha = 1;
addChild(fern_row);
}
}
}//package
Section 56
//DisplayLevel3_background_wall (DisplayLevel3_background_wall)
package {
import mx.core.*;
public class DisplayLevel3_background_wall extends SpriteAsset {
}
}//package
Section 57
//DisplayLevel3_foreground_underground (DisplayLevel3_foreground_underground)
package {
import mx.core.*;
import flash.utils.*;
public class DisplayLevel3_foreground_underground extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function DisplayLevel3_foreground_underground(){
dataClass = DisplayLevel3_foreground_underground_dataClass;
super();
initialWidth = (1802 / 20);
initialHeight = (391 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 58
//DisplayLevel3_foreground_underground_dataClass (DisplayLevel3_foreground_underground_dataClass)
package {
import mx.core.*;
public class DisplayLevel3_foreground_underground_dataClass extends ByteArrayAsset {
}
}//package
Section 59
//DisplayLevel3_plant1 (DisplayLevel3_plant1)
package {
import mx.core.*;
public class DisplayLevel3_plant1 extends BitmapAsset {
}
}//package
Section 60
//DisplayLevel3_plant2 (DisplayLevel3_plant2)
package {
import mx.core.*;
public class DisplayLevel3_plant2 extends BitmapAsset {
}
}//package
Section 61
//DisplayLevel3_plant3 (DisplayLevel3_plant3)
package {
import mx.core.*;
public class DisplayLevel3_plant3 extends BitmapAsset {
}
}//package
Section 62
//DisplayLevel3_plant4 (DisplayLevel3_plant4)
package {
import mx.core.*;
public class DisplayLevel3_plant4 extends BitmapAsset {
}
}//package
Section 63
//DisplayLevel3_plant5 (DisplayLevel3_plant5)
package {
import mx.core.*;
public class DisplayLevel3_plant5 extends BitmapAsset {
}
}//package
Section 64
//DisplayLevel3_plant6 (DisplayLevel3_plant6)
package {
import mx.core.*;
public class DisplayLevel3_plant6 extends BitmapAsset {
}
}//package
Section 65
//DisplayLevel3_plant7 (DisplayLevel3_plant7)
package {
import mx.core.*;
public class DisplayLevel3_plant7 extends BitmapAsset {
}
}//package
Section 66
//DisplayLevel3_plant8 (DisplayLevel3_plant8)
package {
import mx.core.*;
public class DisplayLevel3_plant8 extends BitmapAsset {
}
}//package
Section 67
//DisplayLevel3_plant9 (DisplayLevel3_plant9)
package {
import mx.core.*;
public class DisplayLevel3_plant9 extends BitmapAsset {
}
}//package
Section 68
//Gold (Gold)
package {
import flash.display.*;
import com.johnsu.*;
public class Gold extends Sprite {
public var points:Number;// = 4000
private var treasure:Class;
public function Gold(){
treasure = Gold_treasure;
super();
var frame:Sprite = new treasure();
frame.width = 70;
frame.height = 60;
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(frame);
addChild(frame);
}
}
}//package
Section 69
//Gold_treasure (Gold_treasure)
package {
import mx.core.*;
public class Gold_treasure extends SpriteAsset {
}
}//package
Section 70
//Logs (Logs)
package {
import flash.display.*;
import com.johnsu.*;
public class Logs extends Sprite {
private const spacing:Number = 200;
public var howmany:int;// = 1
public var is_rolling:Boolean;// = false
public var biter:Class;
public var spriteArray:Array;
public var stun_delay:int;// = 0
public function Logs(){
biter = Logs_biter;
spriteArray = new Array();
super();
}
public function addLogs(logs_total:Number=1, rolling:Boolean=false):void{
var log:MovieClip;
var imageFill:CustomFilters;
if (getChildByName("0")){
removeChild(spriteArray[0]);
};
if (getChildByName("1")){
removeChild(spriteArray[1]);
};
if (getChildByName("2")){
removeChild(spriteArray[2]);
};
stun_delay = 0;
howmany = logs_total;
is_rolling = rolling;
var i:Number = 0;
while (i < howmany) {
log = new biter();
spriteArray.push(log);
spriteArray[i].name = String(i);
spriteArray[i].width = 30;
spriteArray[i].height = 60;
imageFill = new CustomFilters();
imageFill._dropShadow(spriteArray[i]);
if (!rolling){
spriteArray[i].stop();
spriteArray[i].x = (spacing * i);
} else {
spriteArray[i].x = (500 + (spacing * i));
};
addChild(spriteArray[i]);
i++;
};
}
}
}//package
Section 71
//Logs_biter (Logs_biter)
package {
import mx.core.*;
public class Logs_biter extends MovieClipAsset {
}
}//package
Section 72
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public function MochiAd(){
super();
}
public static function getVersion():String{
return ("2.7");
}
public static function showClickAwayAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
var sendHostProgress:Boolean;
mc.regContLC = function (lc_name:String):void{
mc._containerLCName = lc_name;
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
finished = true;
chk.started = getTimer();
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (this.root == null){
finished = true;
};
if (finished){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(server:String):String{
var hostname:String = server.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(hostname);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(hostname);
return (hostname);
}
public static function unload(clip:Object):Boolean{
if (((clip.clip) && (clip.clip._mochiad))){
clip = clip.clip;
};
if (clip.origFrameRate != undefined){
clip.stage.frameRate = clip.origFrameRate;
};
if (!clip._mochiad){
return (false);
};
if (clip._mochiad._containerLCName != undefined){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
};
if (clip._mochiad.onUnload){
clip._mochiad.onUnload();
};
delete clip._mochiad_loaded;
delete clip._mochiad;
return (true);
}
public static function showInterLevelAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = (msec - 250);
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (finished){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(options:Object, defaults:Object):Object{
var k:String;
var pairs:Array;
var i:Number;
var kv:Array;
var optcopy:Object = {};
for (k in defaults) {
optcopy[k] = defaults[k];
};
if (options){
for (k in options) {
optcopy[k] = options[k];
};
};
if (optcopy.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
options = optcopy.clip.loaderInfo.parameters.mochiad_options;
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
optcopy[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
if (optcopy.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (optcopy);
}
public static function _cleanup(mc:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = mc;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
lc.client = null;
lc.close();
//unresolved jump
var _slot1 = e;
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(options:Object):MovieClip{
var clip:Object;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = options;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
//unresolved jump
var _slot1 = e;
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
var depth:Number = options.depth;
delete options.depth;
var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(base:Object, methodName:String, argsArray:Array):Object{
var nameArray:Array = methodName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
if (typeof(base[nameArray[i]]) == "function"){
return (base[nameArray[i]].apply(base, argsArray));
};
return (undefined);
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number):MovieClip{
var mc:MovieClip = new MovieClip();
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
parent[name] = mc;
mc["_name"] = name;
return (mc);
}
public static function _getRes(options:Object, clip:Object):Array{
var xy:Array;
var b:Object = clip.getBounds(clip.root);
var w:Number = 0;
var h:Number = 0;
if (typeof(options.res) != "undefined"){
xy = options.res.split("x");
w = parseFloat(xy[0]);
h = parseFloat(xy[1]);
} else {
w = (b.xMax - b.xMin);
h = (b.yMax - b.yMin);
};
if ((((w == 0)) || ((h == 0)))){
w = clip.stage.stageWidth;
h = clip.stage.stageHeight;
};
return ([w, h]);
}
public static function adShowing(mc:Object):void{
mc.origFrameRate = mc.stage.frameRate;
mc.stage.frameRate = 30;
}
public static function getValue(base:Object, objectName:String):Object{
var nameArray:Array = objectName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
return (base[nameArray[i]]);
}
public static function rpc(clip:Object, callbackID:Number, arg:Object):void{
var _local4:Object;
var _local5:Object;
switch (arg.id){
case "setValue":
MochiAd.setValue(clip, arg.objectName, arg.value);
break;
case "getValue":
_local4 = MochiAd.getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + arg.id));
};
}
public static function setValue(base:Object, objectName:String, value:Object):void{
var nameArray:Array = objectName.split(".");
var i:Number = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return;
};
base = base[nameArray[i]];
i++;
};
base[nameArray[i]] = value;
}
public static function showPreGameAd(options:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = options;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (percent:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var p:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var f:Function = function (ev:Event):void{
ev.target.removeEventListener(ev.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = msec;
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s:String):Object{
trace(("[MOCHIAD rpcTestFn] " + s));
return (s);
};
mc.regContLC = function (lc_name:String):void{
mc._containerLCName = lc_name;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (lc_name:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var total:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _clip:Object = this.parent.parent.root;
var ad_clip:Object = this.parent._mochiad_ctr;
var elapsed:Number = (getTimer() - this.started);
var finished:Boolean;
var clip_total:Number = _clip.loaderInfo.bytesTotal;
var clip_loaded:Number = _clip.loaderInfo.bytesLoaded;
if (complete){
clip_loaded = Math.max(1, clip_loaded);
clip_total = clip_loaded;
};
var clip_pcnt:Number = ((100 * clip_loaded) / clip_total);
var ad_pcnt:Number = ((100 * elapsed) / chk.ad_msec);
var _inside:Object = this._mochiad_bar._inside;
var pcnt:Number = Math.min(100, Math.min(((clip_pcnt) || (0)), ad_pcnt));
pcnt = Math.max(this.last_pcnt, pcnt);
this.last_pcnt = pcnt;
_inside.scaleX = (pcnt * 0.01);
options.ad_progress(pcnt);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:clip_pcnt});
if (clip_pcnt == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((elapsed > chk.ad_timeout)) && ((clip_pcnt == 100)))){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (((complete) && (finished))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(options:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(options);
}
public static function showTimedAd(options:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(options);
}
public static function doOnEnterFrame(mc:MovieClip):void{
var mc = mc;
var f:Function = function (ev:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
ev.target.removeEventListener(ev.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 73
//MochiPreloader (MochiPreloader)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class MochiPreloader extends MovieClip {
private var did_load:Boolean;
public static var GAME_OPTIONS:Object = {id:"41d020ef833a097b", res:"550x500"};
public static var MAIN_CLASS:String = "Pitfall2009";
public function MochiPreloader(){
var k:String;
super();
var f:Function = function (ev:IOErrorEvent):void{
};
loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var opts:Object = {};
for (k in GAME_OPTIONS) {
opts[k] = GAME_OPTIONS[k];
};
opts.ad_started = function ():void{
did_load = true;
};
opts.ad_finished = function ():void{
var mainClass:Class = Class(getDefinitionByName(MAIN_CLASS));
var app:Object = new (mainClass);
addChild((app as DisplayObject));
if (app.init){
app.init(did_load);
};
};
opts.clip = this;
MochiAd.showPreGameAd(opts);
}
}
}//package
Section 74
//Money (Money)
package {
import flash.display.*;
import com.johnsu.*;
public class Money extends Sprite {
public var points:Number;// = 2000
private var treasure:Class;
public function Money(){
treasure = Money_treasure;
super();
var frame:Sprite = new treasure();
frame.width = 70;
frame.height = 60;
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(frame);
addChild(frame);
}
}
}//package
Section 75
//Money_treasure (Money_treasure)
package {
import mx.core.*;
public class Money_treasure extends SpriteAsset {
}
}//package
Section 76
//Music (Music)
package {
import flash.display.*;
import flash.media.*;
public class Music extends MovieClip {
private var st:SoundTransform;
public var track:Number;// = 2
private var PF2_0:Class;
private var PF2_1:Class;
private var PF2_2:Class;
private var PF2_3:Class;
public var Song:Sound;
private var sc:SoundChannel;
public var mute:Boolean;// = false
public function Music(){
PF2_3 = Music_PF2_3;
PF2_2 = Music_PF2_2;
PF2_1 = Music_PF2_1;
PF2_0 = Music_PF2_0;
st = new SoundTransform(0.2);
super();
Song = (new PF2_2() as Sound);
sc = Song.play(0, 10, st);
}
public function ChangeTrack(track:Number=-1):void{
sc.stop();
switch (track){
case 3:
Song = (new PF2_3() as Sound);
break;
case 2:
Song = (new PF2_2() as Sound);
break;
case 1:
Song = (new PF2_1() as Sound);
break;
case 0:
Song = (new PF2_0() as Sound);
};
if (!mute){
sc = Song.play(0, 10, st);
} else {
sc.stop();
};
}
}
}//package
Section 77
//Music_PF2_0 (Music_PF2_0)
package {
import mx.core.*;
public class Music_PF2_0 extends SoundAsset {
}
}//package
Section 78
//Music_PF2_1 (Music_PF2_1)
package {
import mx.core.*;
public class Music_PF2_1 extends SoundAsset {
}
}//package
Section 79
//Music_PF2_2 (Music_PF2_2)
package {
import mx.core.*;
public class Music_PF2_2 extends SoundAsset {
}
}//package
Section 80
//Music_PF2_3 (Music_PF2_3)
package {
import mx.core.*;
public class Music_PF2_3 extends SoundAsset {
}
}//package
Section 81
//Pit (Pit)
package {
import flash.display.*;
public class Pit extends Sprite {
private var background_pit:Class;
private var image:Bitmap;
public var hitzone:Sprite;
public function Pit(){
background_pit = Pit_background_pit;
image = new background_pit();
hitzone = new Sprite();
super();
hitzone.graphics.beginFill(520050);
hitzone.graphics.drawRect(25, 10, 65, 30);
hitzone.graphics.endFill();
hitzone.alpha = 0;
addChild(image);
addChild(hitzone);
}
}
}//package
Section 82
//Pit_background_pit (Pit_background_pit)
package {
import mx.core.*;
public class Pit_background_pit extends BitmapAsset {
}
}//package
Section 83
//Pitfall2009 (Pitfall2009)
package {
import flash.events.*;
import fl.transitions.*;
import flash.display.*;
import flash.utils.*;
import flash.media.*;
import flash.filters.*;
import flash.text.*;
import com.johnsu.*;
import mochi.*;
import fl.transitions.easing.*;
public dynamic class Pitfall2009 extends MovieClip {
private const max_day:int = 7;
private const map_bottom_y:Number = 549;
private const Dakota_width:int = 70;
private const jungle_floor_y:Number = 312;
private const Dakota_height:int = 80;
private var fade_delay:int;// = 0
private var left:Boolean;// = false
private var tw2:Tween;
private var tw3:Tween;
private var right:Boolean;// = false
private var tw1:Tween;
private var debugger:int;// = 0
public var foundtreasure:Class;
private var campfire:CampFire;
private var time_left:Number;
private var MyFont:Class;
private var pits:int;// = 0
public var lastPlayerName:String;
private var smallSound:Sound;
public var deathmarch:Class;
private var sc:SoundChannel;
private var sec:int;
private var min:int;
private var gold:Gold;
private var st:SoundTransform;
private var game_container:Sprite;
private var on_ladder:Boolean;// = false
private var is_tarpit:Boolean;// = false
private var Screen:int;// = 1
private var score:int;// = 1000
private var up:Boolean;// = false
private var scorp:Scorpion;
private var blurfilter:BlurFilter;
private var is_pause:Boolean;// = false
private var spriteArray:Array;
private var text2:TextField;
private var down:Boolean;// = false
private var text1:TextField;
private var new_game_trigger:Boolean;// = true
private var silver_bars:Array;
private var on_top_of_ladder:Boolean;// = false
private var myFormat:TextFormat;
private var money:Money;
private var _startTime:Number;
private var PTW:MovieClip;
public var shockmarch:Class;
private var bonus_myFormat:TextFormat;
private var between_day:Play_Again;
private var smallSound2:Sound;
private var Dakota:Character;
private var is_crocs:Boolean;// = false
private var lives:int;// = 3
public var playerName:String;
private var silver:Silver;
private var _gameTime:Number;
private var gold_bars:Array;
private var snake:Snake;
private var today:Date;
private var tarzan_yell:Boolean;// = false
private var display_level2:Sprite;
private var display_level3:DisplayLevel3;
private var bonus_text:TextField;
private var display_level5:Sprite;
private var display_level6:MovieClip;
private var display_level1:DisplayLevel1;
private var display_sec:String;// = ""
private var display_min:String;// = ""
public var _mochiads_game_id:String;// = "41d020ef833a097b"
private var half_time:Boolean;// = false
private var map:Array;
private var JumpSound:Sound;
private var diamond:Diamond;
private var playagain_logo:Play_Again;
public var partythenwork_logo:Class;
private var jump_request:Boolean;// = false
private var treasure_here:Boolean;
private var scorpions:Array;
private var is_first_frame:Boolean;// = false
private var money_bags:Array;
private var diamond_rings:Array;
public var lastScore:Number;
private var is_vine:Boolean;// = false
public var jumpsound:Class;
private var day:int;// = 0
private var is_logs:Boolean;// = false
public var soundClass:Class;
private var is_campfire:Boolean;// = false
private var logs:Logs;
private var touch_treasure:Boolean;// = false
private var is_scorpion:Boolean;// = false
private var treasures_left:Number;
private var death_request:Boolean;// = false
private var is_shifting_tarpit:Boolean;// = false
private var obstacles:Array;
public var Dakotahead:Class;
private var background_music:Music;
private var is_playagain:Boolean;// = false
private var currentTime:Number;
private var is_leaderboard:Boolean;// = false
private var use_mochi_scoreboard:Boolean;// = true
private var is_snake:Boolean;// = false
private var is_in_tunnel:Boolean;// = false
private var st2:SoundTransform;
private var targetTime:Number;
public function Pitfall2009(){
text1 = new TextField();
text2 = new TextField();
bonus_text = new TextField();
MyFont = Pitfall2009_MyFont;
myFormat = new TextFormat("Tekton Pro", 24, 0);
bonus_myFormat = new TextFormat("Tekton Pro", 30, 0xFFFF00);
st = new SoundTransform(0.5);
st2 = new SoundTransform(0.11);
map = [0, 11, 31, 41, 20, 30, 41, 50, 61, 70, 51, 20, 11, 11, 10, 10, 10, 61, 51, 20, 11, 41, 20, 30, 41, 21, 30, 61, 51, 50, 61, 70, 51, 20, 31, 41, 20, 10, 11, 10, 30, 41, 50, 41, 50, 61, 51, 50, 61, 51, 50, 41, 50, 61, 51, 20, 31, 41, 50, 61, 51, 20, 11, 11, 30, 61, 70, 70, 70, 51, 50, 61, 51, 50, 61, 70, 70, 51, 50, 41, 50, 61, 70, 51, 50, 41, 21, 10, 11, 41, 20, 30, 11, 30, 61, 71, 70, 61, 71, 21, 11, 31, 61, 70, 70, 51, 21, 31, 61, 70, 51, 21, 31, 61, 51, 21, 11, 31, 41, 50, 61, 51, 50, 41, 20, 30, 41, 21, 11, 31, 41, 50, 41, 20, 30, 41, 50, 41, 50, 41, 21, 30, 61, 70, 51, 50, 61, 70, 51, 50, 41, 51, 21, 31, 41, 70, 70, 51, 50, 41, 70, 70, 70, 70, 51, 50, 41, 21, 30, 61, 51, 21, 31, 61, 51, 50, 41, 50, 41, 21, 10, 31, 61, 51, 20, 11, 11, 10, 30, 61, 70, 51, 50, 41, 50, 41, 50, 41, 50, 61, 70, 70, 70, 51, 20, 31, 41, 50, 41, 20, 10, 11, 30, 41, 21, 30, 61, 70, 70, 70, 70, 70, 70, 51, 20, 11, 11, 30, 41, 50, 61, 70, 70, 51, 21, 11, 31, 61, 51, 50, 41, 20, 10, 11, 10, 10, 10, 30, 41, 21, 10, 31, 61, 70, 51, 21];
scorpions = [3, 6, 9, 29, 32, 35, 96, 99, 102, 105, 108, 111, 114, 183, 213, 216, 219, 222, 230, 233, 249, 252, 0xFF];
obstacles = [0, 10, 21, 21, 0, 31, 40, 0, 10, 11, 11, 0, 11, 21, 31, 50, 10, 21, 21, 0, 21, 21, 0, 21, 31, 0, 30, 31, 40, 0, 10, 21, 21, 0, 11, 11, 0, 21, 21, 30, 21, 30, 0, 50, 0, 31, 50, 0, 21, 30, 0, 50, 0, 21, 21, 0, 31, 50, 0, 10, 10, 0, 31, 40, 40, 40, 50, 30, 31, 50, 0, 31, 50, 0, 50, 30, 21, 30, 0, 40, 0, 30, 21, 10, 0, 21, 0, 10, 11, 11, 0, 31, 50, 30, 31, 50, 0, 11, 21, 0, 40, 40, 50, 10, 21, 31, 0, 50, 10, 21, 31, 0, 10, 11, 21, 0, 30, 31, 50, 0, 21, 10, 0, 21, 0, 11, 21, 0, 30, 21, 10, 0, 21, 0, 21, 30, 0, 10, 0, 31, 0, 50, 30, 31, 40, 0, 30, 31, 50, 0, 21, 31, 0, 40, 50, 30, 31, 40, 0, 40, 40, 50, 30, 21, 10, 0, 31, 0, 10, 21, 31, 0, 30, 21, 30, 0, 10, 0, 21, 0, 50, 10, 11, 11, 0, 21, 31, 40, 50, 30, 21, 30, 0, 30, 0, 30, 0, 40, 0, 40, 50, 10, 21, 21, 0, 21, 10, 0, 10, 0, 21, 10, 21, 31, 0, 40, 40, 40, 40, 40, 50, 10, 11, 11, 0, 21, 30, 31, 40, 0, 50, 10, 11, 21, 0, 50, 30, 21, 10, 0, 11, 0, 11, 11, 21, 21, 10, 11, 21, 0, 40, 50, 10, 11, 21, 0];
Dakota = new Character();
game_container = new Sprite();
display_level1 = new DisplayLevel1();
display_level2 = new Sprite();
display_level3 = new DisplayLevel3();
display_level5 = new Sprite();
display_level6 = new MovieClip();
scorp = new Scorpion();
snake = new Snake();
campfire = new CampFire();
logs = new Logs();
gold = new Gold();
silver = new Silver();
money = new Money();
diamond = new Diamond();
soundClass = Pitfall2009_soundClass;
deathmarch = Pitfall2009_deathmarch;
foundtreasure = Pitfall2009_foundtreasure;
shockmarch = Pitfall2009_shockmarch;
jumpsound = Pitfall2009_jumpsound;
Dakotahead = Pitfall2009_Dakotahead;
partythenwork_logo = Pitfall2009_partythenwork_logo;
playagain_logo = new Play_Again();
between_day = new Play_Again();
spriteArray = [];
background_music = new Music();
PTW = new partythenwork_logo();
blurfilter = new BlurFilter(28, 2, 1);
smallSound = (new foundtreasure() as Sound);
JumpSound = (new jumpsound() as Sound);
smallSound2 = (new soundClass() as Sound);
super();
PTW.width = 163;
PTW.height = 66;
PTW.x = 370;
PTW.name = "PTW";
var imageFill:CustomFilters = new CustomFilters(PTW);
imageFill._dropShadow(PTW);
myFormat.size = 24;
myFormat.color = 0xFFFFFF;
addEventListener(Event.ENTER_FRAME, main_process);
}
private function keyUpListener(event:KeyboardEvent):void{
switch (event.keyCode){
case 32:
jump_request = false;
break;
case 37:
left = false;
break;
case 39:
right = false;
break;
case 38:
up = false;
break;
case 40:
down = false;
break;
case 65:
left = false;
break;
case 68:
right = false;
break;
case 87:
up = false;
break;
case 83:
down = false;
break;
};
}
private function goNextScreen(pass_screen:int, direction:String="right"):void{
if (direction == "right"){
game_container.x = 0;
} else {
game_container.x = -300;
};
if (pass_screen > 0xFF){
Screen = (pass_screen - 0xFF);
pass_screen = Screen;
};
if (pass_screen < 1){
Screen = (0xFF + pass_screen);
pass_screen = Screen;
};
if (display_level2.getChildByName("gold")){
display_level2.removeChild(gold);
};
if (display_level2.getChildByName("silver")){
display_level2.removeChild(silver);
};
if (display_level2.getChildByName("diamond")){
display_level2.removeChild(diamond);
};
if (display_level2.getChildByName("money")){
display_level2.removeChild(money);
};
if (display_level2.getChildByName("logs")){
display_level2.removeChild(logs);
};
testScreen(pass_screen);
if (getChildByName("level1")){
removeChild(display_level1);
};
if (getChildByName("level2")){
removeChild(display_level2);
};
if (getChildByName("level3")){
removeChild(display_level3);
};
if (getChildByName("level5")){
removeChild(display_level5);
};
if (getChildByName("level6")){
removeChild(display_level6);
};
display_level1.name = "level1";
display_level2.name = "level2";
display_level3.name = "level3";
display_level5.name = "level5";
display_level6.name = "level6";
game_container.addChild(display_level1);
if (is_logs){
logs.name = "logs";
display_level2.addChild(logs);
logs.y = (jungle_floor_y + 15);
logs.x = 120;
};
if (is_vine){
display_level1.addVine();
};
if (is_scorpion){
if (display_level2.getChildByName("scorp")){
display_level2.removeChild(scorp);
};
scorp.name = "scorp";
display_level2.addChild(scorp);
if (direction == "right"){
scorp.x = 700;
} else {
scorp.x = 80;
};
scorp.y = (map_bottom_y + 40);
} else {
if (display_level2.getChildByName("scorp")){
display_level2.removeChild(scorp);
};
};
if (is_snake){
if (display_level2.getChildByName("snake")){
display_level2.removeChild(snake);
};
snake.name = "snake";
display_level2.addChild(snake);
snake.x = 730;
snake.y = (jungle_floor_y + 50);
} else {
if (display_level2.getChildByName("snake")){
display_level2.removeChild(snake);
};
};
if (is_campfire){
if (display_level2.getChildByName("campfire")){
display_level2.removeChild(campfire);
};
campfire.name = "campfire";
display_level2.addChild(campfire);
campfire.x = 630;
campfire.y = (jungle_floor_y - 20);
} else {
if (display_level2.getChildByName("campfire")){
display_level2.removeChild(campfire);
};
};
if (is_crocs){
display_level1.addCrocs();
};
game_container.addChild(display_level2);
game_container.addChild(display_level3);
if (getChildByName("text1")){
removeChild(text1);
};
text1.name = "text1";
text1.defaultTextFormat = myFormat;
text1.width = 300;
text1.x = 100;
text1.y = 10;
text1.embedFonts = true;
display_level5.addChild(text1);
if (getChildByName("text2")){
removeChild(text2);
};
text2.name = "text2";
text2.defaultTextFormat = myFormat;
text2.width = 300;
text2.x = 100;
text2.y = 40;
text2.embedFonts = true;
display_level5.addChild(text2);
if (getChildByName("bonus_text")){
removeChild(bonus_text);
};
bonus_text.name = "bonus_text";
bonus_text.defaultTextFormat = bonus_myFormat;
bonus_text.width = 300;
bonus_text.x = 340;
bonus_text.y = 100;
bonus_text.text = "";
bonus_text.embedFonts = true;
display_level5.addChild(bonus_text);
if (!display_level5.getChildByName("PTW")){
display_level5.addChild(PTW);
display_level5.addChild(new FPSCounter());
};
game_container.addChild(display_level5);
root.y = -95;
display_level5.y = (root.y * -1);
display_level5.x = (game_container.x * -1);
game_container.addChild(display_level6);
if (getChildByName("Dakota")){
removeChild(Dakota);
};
Dakota.name = "Dakota";
display_level2.addChild(Dakota);
if (direction == "right"){
Dakota.x = -5;
} else {
Dakota.x = 850;
};
if (is_in_tunnel){
Dakota.y = map_bottom_y;
} else {
Dakota.y = jungle_floor_y;
};
if (direction == "right"){
Dakota.facing = "right";
Dakota.width = Dakota_width;
Dakota.height = Dakota_height;
} else {
Dakota.facing = "left";
Dakota.width = Dakota_width;
Dakota.height = Dakota_height;
Dakota.scaleX = (Dakota.scaleX * -1);
};
if (!is_first_frame){
is_first_frame = true;
if (use_mochi_scoreboard){
MochiServices.connect("41d020ef833a097b", display_level6);
MochiScores.setBoardID("ea202d56ff9e9946");
};
};
}
private function gotVine():void{
if (!tarzan_yell){
sc = smallSound2.play(0, 1, st);
tarzan_yell = true;
};
display_level1.jungle_vine.power = 0;
Dakota.Action = "rope swing";
}
private function ContinueListener(event:MouseEvent):void{
if (display_level5.getChildByName("playagain")){
display_level5.removeChild(playagain_logo);
};
new_game_trigger = true;
is_playagain = false;
}
private function resetTime():void{
today = new Date();
display_sec = "";
display_min = "";
currentTime = today.time;
targetTime = (currentTime + 180000);
time_left = (targetTime - currentTime);
if (day == 7){
day = 0;
};
if (time_left != 0){
day++;
trace(("changing day to " + day));
};
var countdownTimer:Timer = new Timer(1000);
countdownTimer.addEventListener(TimerEvent.TIMER, updateTime);
countdownTimer.start();
}
private function show_time():void{
var display_counter:String = ((((("Day " + day) + " ") + display_min) + ":") + display_sec);
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow(text1);
text1.text = String(score);
imageFill._dropShadow(text2);
text2.text = display_counter;
imageFill._dropShadow(bonus_text);
}
private function clearScreen():void{
display_level1.regen();
display_level3.AddWall("none");
}
private function updateTime(event:TimerEvent):void{
var now:Date = new Date();
var random:Number = (int((Math.random() * 2)) + 1);
currentTime = now.time;
time_left = (targetTime - currentTime);
if (currentTime < targetTime){
sec = Math.floor((time_left / 1000));
min = Math.floor((sec / 60));
display_sec = String((sec % 60));
if (display_sec.length < 2){
display_sec = ("0" + display_sec);
};
display_min = String((min % 60));
if (display_min.length < 2){
display_min = ("0" + display_min);
};
score = (score + random);
} else {
display_sec = "00";
display_min = "00";
};
}
private function keyDownListener(event:KeyboardEvent):void{
switch (event.keyCode){
case 32:
jump_request = true;
break;
case 37:
left = true;
break;
case 39:
right = true;
break;
case 38:
up = true;
break;
case 40:
down = true;
break;
case 65:
left = true;
break;
case 68:
right = true;
break;
case 87:
up = true;
break;
case 83:
down = true;
break;
};
}
private function slideScreen():void{
if (right){
if ((((Dakota.x > 250)) && ((game_container.x > -250)))){
game_container.x = (game_container.x - 7);
display_level5.x = (game_container.x * -1);
bonus_text.text = "";
};
} else {
if (left){
if ((((Dakota.x < 620)) && ((game_container.x < -20)))){
game_container.x = (game_container.x + 7);
display_level5.x = (game_container.x * -1);
bonus_text.text = "";
};
};
};
}
private function CollisionDetection():void{
var TempX:Number;
var TempY:Number;
var i:int;
var safe:Boolean;
if (!is_in_tunnel){
if (is_logs){
i = 0;
while (i < logs.howmany) {
if (((PixelCollisionDetection.isColliding(Dakota, logs.spriteArray[i], this, true)) && (!(on_ladder)))){
logs.stun_delay++;
if (logs.stun_delay > 5){
logs.stun_delay = 0;
Dakota.Action = "stunned";
Dakota.stunned = (5 + (Math.random() * 3));
score--;
};
};
i++;
};
};
if (is_campfire){
TempX = ((campfire.x + campfire.width) + 30);
TempY = (jungle_floor_y + (campfire.height * 0.5));
if (((Dakota.feet.hitTestObject(campfire)) && ((Dakota.Action == "walk")))){
death_request = true;
Dakota.Action = "dying";
Dakota.frame_number = 2;
};
};
if (is_snake){
if (Dakota.feet.hitTestObject(snake)){
death_request = true;
Dakota.Action = "dying";
Dakota.frame_number = 2;
};
};
if (is_vine){
if (((PixelCollisionDetection.isColliding(Dakota, display_level1.jungle_vine, this, true)) && ((display_level1.jungle_vine.power == 200)))){
gotVine();
Dakota.Animate();
};
if (display_level1.jungle_vine.power < 200){
display_level1.jungle_vine.power++;
};
};
if (((!(touch_treasure)) && (treasure_here))){
CollisionTreasure();
};
} else {
if (PixelCollisionDetection.isColliding(Dakota, display_level3.wall, this, true)){
if (Dakota.facing == "left"){
Dakota.x = (Dakota.x + 10);
};
if (Dakota.facing == "right"){
Dakota.x = (Dakota.x - 10);
};
};
if (is_scorpion){
if (Dakota.feet.hitTestObject(scorp)){
death_request = true;
Dakota.Action = "dying";
Dakota.frame_number = 2;
};
};
};
if ((((pits > 0)) && ((Dakota.Action == "walk")))){
if ((((Dakota.x >= 363)) && ((Dakota.x <= 414)))){
if (!is_in_tunnel){
if (Dakota.before_feet.hitTestObject(display_level1.ladder)){
on_ladder = true;
} else {
on_ladder = false;
};
} else {
if (Dakota.hitTestObject(display_level1.ladder)){
on_ladder = true;
} else {
on_ladder = false;
};
};
};
switch (pits){
case 3:
if (Dakota.feet.hitTestObject(display_level1.pit1.hitzone)){
Dakota.y = (Dakota.y + 30);
Dakota.Action = "fall";
is_in_tunnel = true;
Dakota.Animate();
} else {
if (Dakota.feet.hitTestObject(display_level1.pit2.hitzone)){
Dakota.y = (Dakota.y + 30);
Dakota.Action = "fall";
is_in_tunnel = true;
Dakota.Animate();
} else {
if (Dakota.feet.hitTestObject(display_level1.pit3.hitzone)){
Dakota.y = (Dakota.y + 30);
Dakota.Action = "fall";
is_in_tunnel = true;
Dakota.Animate();
};
};
};
break;
case 1:
if (Dakota.feet.hitTestObject(display_level1.pit1.hitzone)){
Dakota.y = (Dakota.y + 30);
Dakota.Action = "fall";
Dakota.Animate();
};
break;
};
};
if (is_tarpit){
if (((Dakota.feet.hitTestObject(display_level1.croc1b_hitarea)) || (Dakota.feet.hitTestObject(display_level1.croc2b_hitarea)))){
safe = true;
} else {
if (((Dakota.feet.hitTestObject(display_level1.croc1_hitarea)) || (Dakota.feet.hitTestObject(display_level1.croc2_hitarea)))){
safe = true;
};
};
if (Dakota.facing == "left"){
if (((display_level1.tarpit.hitTestObject(Dakota.feet)) && (!(safe)))){
if (display_level1.tarpit.alpha > 0.3){
death_request = true;
Dakota.Action = "dying";
Dakota.frame_number = 2;
display_level1.death_delay = 0;
};
};
};
if (Dakota.facing == "right"){
if (((display_level1.tarpit.hitTestObject(Dakota.feet)) && (!(safe)))){
if (display_level1.tarpit.alpha > 0.3){
death_request = true;
Dakota.Action = "dying";
Dakota.frame_number = 2;
display_level1.death_delay = 0;
};
};
};
};
}
private function update_objects():void{
if (((is_logs) && (logs.is_rolling))){
logs.x = (logs.x - 4);
if (logs.x < -1000){
logs.x = 1000;
};
};
if (is_crocs){
display_level1.updateCrocs();
};
if (is_vine){
display_level1.swingVine();
};
if (is_shifting_tarpit){
if (display_level1.tarpit_expand == true){
fade_delay++;
if (fade_delay > 50){
fade_delay = 0;
display_level1.tarpit.alpha = (display_level1.tarpit.alpha + 0.1);
};
} else {
fade_delay++;
if (fade_delay > 35){
fade_delay = 0;
display_level1.tarpit.alpha = (display_level1.tarpit.alpha - 0.1);
};
};
if (display_level1.tarpit.alpha >= 1){
display_level1.tarpit_expand = false;
};
if (display_level1.tarpit.alpha <= 0){
display_level1.tarpit_expand = true;
};
};
if (is_scorpion){
if (Dakota.x > scorp.x){
if (scorp.facing == "left"){
scorp.scaleX = (scorp.scaleX * -1);
scorp.facing = "right";
};
scorp.x = (scorp.x + 0.2);
} else {
if (scorp.facing == "right"){
scorp.scaleX = (scorp.scaleX * -1);
scorp.facing = "left";
};
scorp.x = (scorp.x - 0.2);
};
};
}
private function testScreen(screen:Number):void{
pits = 0;
is_vine = false;
is_snake = false;
is_scorpion = false;
is_campfire = false;
is_tarpit = false;
is_shifting_tarpit = false;
is_logs = false;
is_crocs = false;
switch (map[Screen]){
case 10:
pits = 1;
display_level1.addPit();
display_level3.AddWall("left");
break;
case 11:
pits = 1;
display_level1.addPit();
display_level3.AddWall("right");
break;
case 20:
display_level1.addTarPit("quicksand");
is_crocs = true;
is_tarpit = true;
break;
case 21:
display_level1.addTarPit("quicksand");
is_crocs = true;
is_tarpit = true;
is_vine = true;
break;
case 30:
pits = 3;
display_level1.addPit3();
display_level3.AddWall("left");
break;
case 31:
pits = 3;
display_level1.addPit3();
display_level3.AddWall("right");
break;
case 40:
display_level1.addTarPit("tarpit");
is_tarpit = true;
break;
case 41:
display_level1.addTarPit("tarpit");
is_tarpit = true;
is_vine = true;
break;
case 50:
display_level1.addTarPit("tarpit");
is_tarpit = true;
is_shifting_tarpit = true;
break;
case 51:
display_level1.addTarPit("tarpit");
is_tarpit = true;
is_vine = true;
is_shifting_tarpit = true;
break;
case 60:
display_level1.addTarPit("quicksand");
is_tarpit = true;
break;
case 61:
display_level1.addTarPit("quicksand");
is_tarpit = true;
is_vine = true;
break;
case 70:
display_level1.addTarPit("quicksand");
is_tarpit = true;
is_shifting_tarpit = true;
break;
case 71:
display_level1.addTarPit("quicksand");
is_tarpit = true;
is_vine = true;
is_shifting_tarpit = true;
break;
};
if (scorpions.indexOf(Screen) > -1){
is_scorpion = true;
};
if (money_bags.indexOf(Screen) > -1){
treasure_here = true;
money.name = "money";
money.x = 670;
money.y = (jungle_floor_y + 30);
display_level2.addChild(money);
tw3 = new Tween(money, "alpha", Strong.easeOut, 0, 1, 1, false);
} else {
if (silver_bars.indexOf(Screen) > -1){
treasure_here = true;
silver.name = "silver";
silver.x = 670;
silver.y = (jungle_floor_y + 30);
display_level2.addChild(silver);
tw3 = new Tween(silver, "alpha", Strong.easeOut, 0, 1, 1, false);
} else {
if (gold_bars.indexOf(Screen) > -1){
treasure_here = true;
gold.name = "gold";
gold.x = 620;
gold.y = (jungle_floor_y + 30);
display_level2.addChild(gold);
tw3 = new Tween(gold, "alpha", Strong.easeOut, 0, 1, 1, false);
} else {
if (diamond_rings.indexOf(Screen) > -1){
treasure_here = true;
diamond.name = "diamond";
diamond.x = 670;
diamond.y = (jungle_floor_y + 30);
display_level2.addChild(diamond);
tw3 = new Tween(diamond, "alpha", Strong.easeOut, 0, 1, 1, false);
} else {
treasure_here = false;
};
};
};
};
trace(((((("LeveL= " + Screen) + " map=") + map[Screen]) + " :obstacles=") + obstacles[Screen]));
switch (obstacles[Screen]){
case 10:
logs.addLogs(1, false);
is_logs = true;
break;
case 11:
logs.addLogs(1, true);
is_logs = true;
break;
case 20:
logs.addLogs(2, false);
is_logs = true;
break;
case 21:
logs.addLogs(2, true);
is_logs = true;
break;
case 30:
logs.addLogs(3, false);
is_logs = true;
break;
case 31:
logs.addLogs(3, true);
is_logs = true;
break;
case 40:
is_snake = true;
break;
case 50:
is_campfire = true;
break;
};
}
private function newGame():void{
var i:int;
var push_treasure:int;
var j:int;
var head:Sprite;
var imageFill:CustomFilters;
trace("calling Newgame");
treasures_left = 0;
var treasures_each = 200;
var error:int;
gold_bars = [];
silver_bars = [];
diamond_rings = [];
money_bags = [1];
i = 0;
while (i < treasures_each) {
push_treasure = (Math.random() * 0xFF);
trace(push_treasure);
error = 0;
if (silver_bars.indexOf(push_treasure) > -1){
error = 1;
trace(silver_bars.indexOf(push_treasure));
};
if (gold_bars.indexOf(push_treasure) > -1){
error = 1;
};
if (diamond_rings.indexOf(push_treasure) > -1){
error = 1;
};
if (money_bags.indexOf(push_treasure) > -1){
error = 1;
};
if (error == 0){
j = (Math.random() * 4);
switch (j){
case 1:
silver_bars.push(push_treasure);
treasures_left++;
break;
case 2:
gold_bars.push(push_treasure);
treasures_left++;
break;
case 3:
diamond_rings.push(push_treasure);
treasures_left++;
break;
case 0:
money_bags.push(push_treasure);
treasures_left++;
break;
};
} else {
trace("treasure match found can not push into array!");
};
i++;
};
trace(((((((((("TREASURES:\n" + silver_bars) + "\n") + gold_bars) + "\n") + diamond_rings) + "\n") + money_bags) + "\nTREASURES LEFT:") + treasures_left));
lives = 3;
score = 1000;
Screen = 1;
left = false;
right = false;
up = false;
down = false;
jump_request = false;
death_request = false;
tarzan_yell = false;
is_vine = false;
is_pause = false;
pits = 0;
on_ladder = false;
is_in_tunnel = false;
is_scorpion = false;
is_snake = false;
is_campfire = false;
is_tarpit = false;
is_shifting_tarpit = false;
is_logs = false;
is_crocs = false;
is_leaderboard = false;
fade_delay = 0;
day = 0;
i = 0;
while (i < lives) {
head = new Dakotahead();
spriteArray.push(head);
imageFill = new CustomFilters();
imageFill._dropShadow2(spriteArray[i]);
spriteArray[i].name = String(i);
spriteArray[i].width = 50;
spriteArray[i].height = 40;
spriteArray[i].x = (-20 + (i * 40));
spriteArray[i].y = 50;
if (String(i) != "0"){
display_level5.addChild(spriteArray[i]);
};
i++;
};
Dakota.Action = "walk";
resetTime();
clearScreen();
background_music.track = 2;
background_music.ChangeTrack(background_music.track);
}
private function nextDay(e:MouseEvent):void{
is_pause = false;
resetTime();
if (display_level5.getChildByName("betweenday")){
display_level5.removeChild(between_day);
};
display_level1.filters = undefined;
display_level2.filters = undefined;
display_level3.filters = undefined;
goNextScreen(Screen, Dakota.facing);
if (!(background_music.track) == 0){
background_music.track--;
background_music.ChangeTrack(background_music.track);
};
}
private function updateChar():void{
var _local1:Sound;
if (Dakota.y > 354){
is_in_tunnel = true;
if (Dakota.y > map_bottom_y){
Dakota.y = map_bottom_y;
};
} else {
is_in_tunnel = false;
};
switch (Dakota.Action){
case "walk":
if (Dakota.rotation != 0){
Dakota.rotation = 0;
};
tarzan_yell = false;
if (!jump_request){
if (right){
if (Dakota.facing == "left"){
Dakota.x = (Dakota.x + (Dakota.width * 0.5));
Dakota.scaleX = (Dakota.scaleX * -1);
};
Dakota.facing = "right";
Dakota.x = (Dakota.x + 5);
if (((!(is_in_tunnel)) && (((Dakota.frame_number % 12) == 0)))){
display_level1.background1.x--;
display_level1.background2.x--;
};
Dakota.Animate();
if (Dakota.x > 800){
if (is_in_tunnel){
Screen = (Screen + 3);
} else {
Screen = (Screen + 1);
};
clearScreen();
goNextScreen(Screen, "right");
};
} else {
if (left){
if (Dakota.facing == "right"){
Dakota.x = (Dakota.x - (Dakota.width * 0.5));
Dakota.scaleX = (Dakota.scaleX * -1);
};
Dakota.facing = "left";
Dakota.x = (Dakota.x - 5);
if (((!(is_in_tunnel)) && (((Dakota.frame_number % 12) == 0)))){
display_level1.background1.x++;
display_level1.background2.x++;
};
Dakota.Animate();
if (Dakota.x < 0){
if (is_in_tunnel){
Screen = (Screen - 3);
} else {
Screen = (Screen - 1);
};
clearScreen();
goNextScreen(Screen, "left");
};
};
};
} else {
JumpSound.play();
Dakota.frame_number = 2;
Dakota.Action = "jump";
Dakota.Animate();
jump_request = false;
};
if (Dakota.y < jungle_floor_y){
Dakota.Action = "fall";
};
if (on_ladder){
if (up){
Dakota.frame_number = 1;
Dakota.x = display_level1.pit1contactX;
Dakota.Action = "climb ladder";
Dakota.Animate();
} else {
if (((down) && ((Dakota.y < 354)))){
on_top_of_ladder = false;
Dakota.frame_number = 1;
Dakota.x = display_level1.pit1contactX;
Dakota.y = 354;
Dakota.Action = "climb ladder";
Dakota.Animate();
};
};
};
break;
case "jump":
if (Dakota.rotation != 0){
Dakota.rotation = 0;
};
if ((((Dakota.frame_number > 3)) && ((Dakota.frame_number < 14)))){
Dakota.y = (Dakota.y - 4.2);
} else {
if ((((Dakota.frame_number > 13)) && ((Dakota.frame_number < 24)))){
Dakota.y = (Dakota.y + 4.21);
} else {
if ((((Dakota.frame_number == 24)) && ((Dakota.y < jungle_floor_y)))){
Dakota.Action = "fall";
};
};
};
if (((!(right)) && (!(left)))){
Dakota.Animate();
} else {
if (right){
if (Dakota.facing == "left"){
Dakota.x = (Dakota.x + (Dakota.width * 0.5));
Dakota.scaleX = (Dakota.scaleX * -1);
};
Dakota.facing = "right";
Dakota.x = (Dakota.x + 4);
Dakota.Animate();
if (((!(is_in_tunnel)) && (((Dakota.frame_number % 12) == 0)))){
display_level1.background1.x--;
display_level1.background2.x--;
};
} else {
if (left){
if (Dakota.facing == "right"){
Dakota.x = (Dakota.x - (Dakota.width * 0.5));
Dakota.scaleX = (Dakota.scaleX * -1);
};
Dakota.facing = "left";
Dakota.x = (Dakota.x - 4);
Dakota.Animate();
if (((!(is_in_tunnel)) && (((Dakota.frame_number % 12) == 0)))){
display_level1.background1.x++;
display_level1.background2.x++;
};
};
};
};
if (Dakota.frame_number == 1){
Dakota.Action = "walk";
Dakota.Animate();
};
break;
case "stunned":
if (Dakota.rotation != 0){
Dakota.rotation = 0;
};
tarzan_yell = false;
if (Dakota.stunned <= 0){
Dakota.frame_number = 1;
} else {
display_level2.y = (display_level2.y + ((Math.random() * 3) - (Math.random() * 3)));
display_level2.x = (display_level2.x + ((Math.random() * 3) - (Math.random() * 3)));
Dakota.stunned--;
score = (score - int((Math.random() * 3)));
Dakota.frame_number = 30;
};
if (Dakota.frame_number == 1){
Dakota.Action = "walk";
display_level2.y = 0;
display_level2.x = 0;
};
if (left){
Dakota.x--;
};
if (right){
Dakota.x++;
};
Dakota.Animate();
_local1 = (new shockmarch() as Sound);
sc = _local1.play(0, 1, st2);
break;
case "fall":
if (Dakota.rotation != 0){
Dakota.rotation = 0;
};
if (left){
Dakota.x--;
};
if (right){
Dakota.x++;
};
if (Dakota.y < jungle_floor_y){
Dakota.y = (Dakota.y + 4.21);
display_level5.y = (root.y * -1);
};
if ((((Dakota.y > 308)) && ((Dakota.y < 318)))){
Dakota.y = jungle_floor_y;
Dakota.Action = "walk";
if (pits == 0){
root.y = -95;
display_level5.y = (root.y * -1);
};
};
if ((((Dakota.y > jungle_floor_y)) && ((pits > 0)))){
Dakota.y = (Dakota.y + 4.21);
};
if (Dakota.y > map_bottom_y){
Dakota.stunned = (25 + (Math.random() * 15));
Dakota.Action = "stunned";
Dakota.y = map_bottom_y;
};
Dakota.Animate();
break;
case "climb ladder":
if (Dakota.rotation != 0){
Dakota.rotation = 0;
};
tarzan_yell = false;
if (up){
if ((((Dakota.y <= 354)) && (on_ladder))){
on_top_of_ladder = true;
} else {
if (on_ladder){
Dakota.y = (Dakota.y - 3);
Dakota.Action = "climb ladder";
Dakota.Animate();
on_top_of_ladder = false;
};
};
} else {
if (down){
on_top_of_ladder = false;
if ((((Dakota.y < map_bottom_y)) && (on_ladder))){
Dakota.y = (Dakota.y + 3);
Dakota.Action = "climb ladder";
Dakota.Animate();
};
} else {
if (((right) || (left))){
if ((((Dakota.y >= map_bottom_y)) && (on_ladder))){
Dakota.y = map_bottom_y;
Dakota.Action = "walk";
on_top_of_ladder = false;
on_ladder = false;
} else {
if (on_top_of_ladder){
if (right){
Dakota.x = (Dakota.x + 35);
};
if (left){
Dakota.x = (Dakota.x - 35);
};
Dakota.y = jungle_floor_y;
Dakota.Action = "walk";
on_ladder = false;
};
};
};
};
};
break;
case "rope swing":
if (((up) || (down))){
if (display_level1.jungle_vine.power > 70){
Dakota.Action = "walk";
};
tarzan_yell = false;
} else {
if (((jump_request) && ((display_level1.jungle_vine.power > 70)))){
if (Dakota.rotation != 0){
Dakota.rotation = 0;
};
Dakota.frame_number = 21;
Dakota.Action = "jump";
Dakota.Animate();
jump_request = false;
};
};
if (Dakota.facing == "left"){
Dakota.rotation = (display_level1.jungle_vine.rotation - 90);
Dakota.x = display_level1.jungle_vine.contactX;
Dakota.y = display_level1.jungle_vine.contactY;
};
if (Dakota.facing == "right"){
Dakota.rotation = (display_level1.jungle_vine.rotation + 270);
Dakota.x = display_level1.jungle_vine.contact2X;
Dakota.y = display_level1.jungle_vine.contact2Y;
};
if ((((((Dakota.x < 600)) && ((Dakota.x > 400)))) && ((game_container.x > -300)))){
game_container.x = (-(Dakota.x) + 200);
display_level5.x = (game_container.x * -1);
} else {
if ((((((Dakota.x > 200)) && ((Dakota.x < 400)))) && ((game_container.x < 0)))){
game_container.x = (-(Dakota.x) + 300);
display_level5.x = (game_container.x * -1);
};
};
if (game_container.x > 0){
game_container.x = 0;
display_level5.x = 0;
};
break;
};
}
private function MouseClickListener(event:MouseEvent):void{
jump_request = true;
}
private function CollisionTreasure():void{
var doneTrans:Function;
doneTrans = function (e:TweenEvent):void{
tw2.removeEventListener(TweenEvent.MOTION_FINISH, doneTrans);
touch_treasure = false;
};
if (display_level2.getChildByName("diamond")){
if (Dakota.hitTestObject(diamond)){
touch_treasure = true;
treasure_here = false;
diamond_rings[diamond_rings.indexOf(Screen)] = 0;
if (background_music.track != 3){
background_music.track++;
background_music.ChangeTrack(background_music.track);
};
score = (score + diamond.points);
bonus_text.name = "bonus_text";
bonus_text.text = ("$" + diamond.points);
tw1 = new Tween(diamond, "alpha", Strong.easeOut, 1, 0, 0.5, true);
tw2 = new Tween(diamond, "y", Strong.easeOut, diamond.y, (diamond.y - 140), 0.5, true);
tw2.addEventListener(TweenEvent.MOTION_FINISH, doneTrans);
smallSound.play();
treasures_left--;
};
} else {
if (display_level2.getChildByName("gold")){
if (Dakota.hitTestObject(gold)){
touch_treasure = true;
treasure_here = false;
gold_bars[gold_bars.indexOf(Screen)] = 0;
if (background_music.track != 3){
background_music.track++;
background_music.ChangeTrack(background_music.track);
};
score = (score + gold.points);
bonus_text.name = "bonus_text";
bonus_text.text = ("$" + gold.points);
tw1 = new Tween(gold, "alpha", Strong.easeOut, 1, 0, 0.5, true);
tw2 = new Tween(gold, "y", Strong.easeOut, gold.y, (gold.y - 140), 0.5, true);
tw2.addEventListener(TweenEvent.MOTION_FINISH, doneTrans);
smallSound.play();
treasures_left--;
};
} else {
if (display_level2.getChildByName("silver")){
if (Dakota.hitTestObject(silver)){
touch_treasure = true;
treasure_here = false;
silver_bars[silver_bars.indexOf(Screen)] = 0;
if (background_music.track != 3){
background_music.track++;
background_music.ChangeTrack(background_music.track);
};
score = (score + silver.points);
bonus_text.name = "bonus_text";
bonus_text.text = ("$" + silver.points);
tw1 = new Tween(silver, "alpha", Strong.easeOut, 1, 0, 0.5, true);
tw2 = new Tween(silver, "y", Strong.easeOut, silver.y, (silver.y - 140), 0.5, true);
tw2.addEventListener(TweenEvent.MOTION_FINISH, doneTrans);
smallSound.play();
treasures_left--;
};
} else {
if (display_level2.getChildByName("money")){
if (Dakota.hitTestObject(money)){
touch_treasure = true;
treasure_here = false;
money_bags[money_bags.indexOf(Screen)] = 0;
if (background_music.track != 3){
background_music.track++;
background_music.ChangeTrack(background_music.track);
};
score = (score + money.points);
bonus_text.name = "bonus_text";
bonus_text.text = ("$" + money.points);
tw1 = new Tween(money, "alpha", Strong.easeOut, 1, 0, 0.5, true);
tw2 = new Tween(money, "y", Strong.easeOut, money.y, (money.y - 140), 0.5, true);
tw2.addEventListener(TweenEvent.MOTION_FINISH, doneTrans);
smallSound.play();
treasures_left--;
};
};
};
};
};
}
private function main_process(event:Event):void{
var smallSound3:Sound;
var playerscore:int;
if (!is_first_frame){
addChild(game_container);
stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseClickListener);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
graphics.beginFill(0);
graphics.drawRect(0, 0, 800, 600);
graphics.endFill();
};
if (new_game_trigger){
newGame();
Dakota.Animate();
Dakota.height = Dakota_height;
Dakota.width = Dakota_width;
goNextScreen(Screen, "right");
Dakota.x = 60;
new_game_trigger = false;
};
if ((((lives > -2)) && (!(is_pause)))){
show_time();
if (!death_request){
if (score < 1){
death_request = true;
score = 500;
Dakota.Action = "dying";
Dakota.frame_number = 2;
};
updateChar();
if (half_time){
CollisionDetection();
half_time = false;
} else {
half_time = true;
};
slideScreen();
} else {
Dakota.Action = "dying";
Dakota.Animate();
if (Dakota.frame_number == 1){
death_request = false;
Dakota.Action = "walk";
Dakota.Animate();
clearScreen();
goNextScreen(Screen);
Dakota.height = Dakota_height;
Dakota.width = Dakota_width;
if (!(background_music.track) == 0){
background_music.track--;
background_music.ChangeTrack(background_music.track);
};
} else {
if (Dakota.frame_number == 3){
smallSound3 = (new deathmarch() as Sound);
sc = smallSound3.play(0, 1, st);
} else {
if (Dakota.frame_number == 24){
if (display_level5.getChildByName(String(lives))){
display_level5.removeChild(spriteArray[lives]);
};
lives--;
};
};
};
if (score < 500){
score = 500;
};
};
update_objects();
} else {
if (is_playagain == true){
playerscore = score;
if (((!(is_leaderboard)) && (use_mochi_scoreboard))){
display_level6.y = (display_level5.y - 70);
display_level6.x = (display_level5.x - 100);
MochiScores.showLeaderboard({boardID:"ea202d56ff9e9946", score:playerscore});
};
is_leaderboard = true;
is_pause = true;
playagain_logo.name = "playagain";
playagain_logo.changeText("Play Again?");
playagain_logo.addEventListener(MouseEvent.CLICK, ContinueListener);
playagain_logo.x = 350;
playagain_logo.y = 120;
if (fade_delay < 240){
fade_delay++;
};
if (fade_delay > 200){
display_level5.addChild(playagain_logo);
};
};
if ((((lives == -2)) || ((time_left == 0)))){
is_playagain = true;
};
};
if ((((time_left < 0)) && (!(is_pause)))){
is_pause = true;
if (day != 7){
if (display_level5.getChildByName("betweenday")){
display_level5.removeChild(between_day);
};
between_day = new Play_Again();
between_day.scoreboard(("Day " + day));
between_day.width = 600;
between_day.height = 500;
between_day.x = 150;
between_day.y = 250;
between_day.name = "betweenday";
between_day.addEventListener(MouseEvent.CLICK, nextDay);
between_day.click2continue(treasures_left);
score = (score + (3200 - (treasures_left * 10)));
display_level5.addChild(between_day);
display_level1.filters = [blurfilter];
display_level2.filters = [blurfilter];
display_level3.filters = [blurfilter];
} else {
is_pause = true;
};
};
}
}
}//package
Section 84
//Pitfall2009_Dakotahead (Pitfall2009_Dakotahead)
package {
import mx.core.*;
public class Pitfall2009_Dakotahead extends SpriteAsset {
}
}//package
Section 85
//Pitfall2009_deathmarch (Pitfall2009_deathmarch)
package {
import mx.core.*;
public class Pitfall2009_deathmarch extends SoundAsset {
}
}//package
Section 86
//Pitfall2009_foundtreasure (Pitfall2009_foundtreasure)
package {
import mx.core.*;
public class Pitfall2009_foundtreasure extends SoundAsset {
}
}//package
Section 87
//Pitfall2009_jumpsound (Pitfall2009_jumpsound)
package {
import mx.core.*;
public class Pitfall2009_jumpsound extends SoundAsset {
}
}//package
Section 88
//Pitfall2009_MyFont (Pitfall2009_MyFont)
package {
import mx.core.*;
public class Pitfall2009_MyFont extends FontAsset {
}
}//package
Section 89
//Pitfall2009_partythenwork_logo (Pitfall2009_partythenwork_logo)
package {
import mx.core.*;
import flash.utils.*;
public class Pitfall2009_partythenwork_logo extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function Pitfall2009_partythenwork_logo(){
dataClass = Pitfall2009_partythenwork_logo_dataClass;
super();
initialWidth = (8700 / 20);
initialHeight = (4200 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 90
//Pitfall2009_partythenwork_logo_dataClass (Pitfall2009_partythenwork_logo_dataClass)
package {
import mx.core.*;
public class Pitfall2009_partythenwork_logo_dataClass extends ByteArrayAsset {
}
}//package
Section 91
//Pitfall2009_shockmarch (Pitfall2009_shockmarch)
package {
import mx.core.*;
public class Pitfall2009_shockmarch extends SoundAsset {
}
}//package
Section 92
//Pitfall2009_soundClass (Pitfall2009_soundClass)
package {
import mx.core.*;
public class Pitfall2009_soundClass extends SoundAsset {
}
}//package
Section 93
//Play_Again (Play_Again)
package {
import flash.display.*;
import flash.filters.*;
import flash.text.*;
public class Play_Again extends MovieClip {
private var image:Class;
private var display_text:TextField;
private var MyFont:Class;
public function Play_Again(){
image = Play_Again_image;
MyFont = Play_Again_MyFont;
display_text = new TextField();
super();
var play_main:Sprite = new image();
mouseEnabled = true;
buttonMode = true;
var temp_format:TextFormat = new TextFormat("Tekton Pro", 20, 0);
var dropShadow:DropShadowFilter = new DropShadowFilter(6, 100, 0, 0.5, 8, 8, 1);
display_text.defaultTextFormat = temp_format;
display_text.mouseEnabled = false;
display_text.filters = [dropShadow];
display_text.embedFonts = true;
addChild(play_main);
addChild(display_text);
}
public function scoreboard(title:String):void{
var temp_format:TextFormat = new TextFormat("Tekton Pro", 9, 0);
var temp_text:TextField = new TextField();
temp_text.defaultTextFormat = temp_format;
temp_text.mouseEnabled = false;
temp_text.text = title;
temp_text.x = 30;
temp_text.y = -35;
temp_text.embedFonts = true;
addChild(temp_text);
}
public function click2continue(treasures_left:Number=32):void{
var temp_format:TextFormat = new TextFormat("Tekton Pro", 8, 0);
var temp_text:TextField = new TextField();
temp_text.defaultTextFormat = temp_format;
temp_text.mouseEnabled = false;
temp_text.text = ("Treasures Left: " + treasures_left);
temp_text.x = 15;
temp_text.y = 0;
temp_text.embedFonts = true;
addChild(temp_text);
var temp_text2:TextField = new TextField();
temp_text2.defaultTextFormat = temp_format;
temp_text2.mouseEnabled = false;
temp_text2.text = ("Bonus Points: " + (3200 - (treasures_left * 10)));
temp_text2.x = 15;
temp_text2.y = 12;
temp_text2.embedFonts = true;
addChild(temp_text2);
var temp_text3:TextField = new TextField();
temp_text3.defaultTextFormat = temp_format;
temp_text3.mouseEnabled = false;
temp_text3.text = "(click to continue)";
temp_text3.x = 20;
temp_text3.y = 45;
temp_text3.embedFonts = true;
addChild(temp_text3);
}
public function changeText(input:String):void{
display_text.text = input;
}
}
}//package
Section 94
//Play_Again_image (Play_Again_image)
package {
import mx.core.*;
public class Play_Again_image extends SpriteAsset {
}
}//package
Section 95
//Play_Again_MyFont (Play_Again_MyFont)
package {
import mx.core.*;
public class Play_Again_MyFont extends FontAsset {
}
}//package
Section 96
//Scorpion (Scorpion)
package {
import flash.display.*;
public class Scorpion extends Sprite {
public var facing:String;// = "left"
private var delay:Number;// = 0
private var delay_max:Number;// = 3
public var frame_number:Number;// = 1
private var scorp:Class;
public function Scorpion(){
scorp = Scorpion_scorp;
super();
var frame:Sprite = new scorp();
frame.width = 50;
frame.height = 40;
addChild(frame);
}
public function Animate():void{
}
}
}//package
Section 97
//Scorpion_scorp (Scorpion_scorp)
package {
import mx.core.*;
public class Scorpion_scorp extends MovieClipAsset {
}
}//package
Section 98
//Silver (Silver)
package {
import flash.display.*;
import com.johnsu.*;
public class Silver extends Sprite {
public var points:Number;// = 3000
private var treasure:Class;
public function Silver(){
treasure = Silver_treasure;
super();
var frame:Sprite = new treasure();
frame.width = 70;
frame.height = 60;
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(frame);
addChild(frame);
}
}
}//package
Section 99
//Silver_treasure (Silver_treasure)
package {
import mx.core.*;
public class Silver_treasure extends SpriteAsset {
}
}//package
Section 100
//Snake (Snake)
package {
import flash.display.*;
import com.johnsu.*;
public class Snake extends Sprite {
public var facing:String;// = "left"
private var delay:Number;// = 0
private var delay_max:Number;// = 3
private var biter:Class;
public var frame_number:Number;// = 1
public function Snake(){
biter = Snake_biter;
super();
var frame:Sprite = new biter();
frame.width = 45;
frame.height = 45;
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(frame);
addChild(frame);
}
}
}//package
Section 101
//Snake_biter (Snake_biter)
package {
import mx.core.*;
public class Snake_biter extends MovieClipAsset {
}
}//package
Section 102
//vine (vine)
package {
import flash.display.*;
import com.johnsu.*;
public class vine extends Sprite {
public var power:Number;// = 100
public var contact2X:Number;
public var contact2Y:Number;
public var swing_left:Boolean;
private var jungle_vine:Class;
public var contact_radius:Number;// = 348
public var contactX:Number;
public var contactY:Number;
public function vine(){
jungle_vine = vine_jungle_vine;
super();
var rope1:Bitmap = new jungle_vine();
var rope2:Bitmap = new jungle_vine();
var rope3:Bitmap = new jungle_vine();
var rope4:Bitmap = new jungle_vine();
var rope5:Bitmap = new jungle_vine();
var rope6:Bitmap = new jungle_vine();
addChild(rope1);
addChild(rope2);
addChild(rope3);
addChild(rope4);
addChild(rope5);
addChild(rope6);
var imageFill:CustomFilters = new CustomFilters();
imageFill._dropShadow3(rope1);
imageFill._dropShadow3(rope2);
imageFill._dropShadow3(rope3);
imageFill._dropShadow3(rope4);
imageFill._dropShadow3(rope5);
imageFill._dropShadow3(rope6);
rope2.x = 64;
rope3.x = 128;
rope4.x = 192;
rope5.x = 0x0100;
rope6.x = 320;
}
}
}//package
Section 103
//vine_jungle_vine (vine_jungle_vine)
package {
import mx.core.*;
public class vine_jungle_vine extends BitmapAsset {
}
}//package