Section 1
//Character (asfiles.char.Character)
package asfiles.char {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.greensock.*;
import com.nflash.game.world.*;
import flash.geom.*;
import asfiles.*;
import com.nflash.game.model.*;
public class Character extends Collidable {
protected const KEY_DASH:int = 4;
protected const KEY_RETREAT:int = 1;
protected const KEY_JUMP:int = 2;
protected const GRAVITY:Number = 2.2;
protected const KEY_PAUSE:int = 5;
protected const KEY_ADVANCE:int = 0;
protected const KEY_DASH_ALT:int = 6;
protected var basicState:String;// = "idle"
protected var inputSource:Object;
protected var stunned:Boolean;// = false
protected var pollControls:Boolean;
protected var persistentIds:Array;
protected var spritePlaying:Boolean;// = true
protected var xSpeed:Number;// = 0
protected var airborne:Boolean;// = false
protected var spriteCache:Array;
public var spriteIn:MovieClip;
protected var ySpeed:Number;// = 0
protected var lastEval:String;// = ""
protected var stateData:XML;
protected var controlImprint:Object;
protected var persistentActions:Array;
public var dataClass:Class;
protected var useSpriteCaching:Boolean;// = true
protected static const DEFAULT_STATE:String = "idle";
public static var world:World;
public function Character(){
initialize();
}
override public function stop():void{
spriteIn.stop();
spritePlaying = false;
}
public function configureInput(_arg1:Object, _arg2:Boolean=true):void{
inputSource = _arg1;
pollControls = _arg2;
}
protected function checkDependency(_arg1:String, _arg2:Boolean=true):Boolean{
var depend:XML;
var dependKey:int;
var dependAmt:int;
var $dependId = _arg1;
var $changeFrame = _arg2;
depend = XML(dataClass.data.dependencies.dependency.(@id == $dependId));
dependKey = int(depend.@key);
if (controlImprint[dependKey] != undefined){
dependAmt = controlImprint[dependKey];
if ((((dependAmt >= int(depend.@min))) && ((dependAmt <= int(depend.@max))))){
if ($changeFrame){
if (depend.@newFrame.toString().length > 0){
goto(depend.@newState.toString(), int(depend.@newFrame));
} else {
goto(depend.@newState.toString());
};
};
return (true);
};
};
return (false);
}
protected function setSpeed(_arg1:String, _arg2:String):void{
this[(_arg1 + "Speed")] = Number(_arg2);
}
protected function initialize():void{
spriteCache = new Array();
persistentActions = new Array();
persistentIds = new Array();
}
protected function processFrameAction(_arg1:XML):void{
var _local2:int;
var _local3:String;
if (_arg1.@persist.toString().length > 0){
_local3 = ((_arg1.@func.toString() + _arg1.@param1.toString()) + _arg1.@param2.toString());
_local2 = persistentIds.indexOf(_local3);
if (spriteIn.currentFrame == Number(_arg1.@frm)){
persistentActions.push({remaining:Number(_arg1.@persist), node:_arg1});
persistentIds.push(((_arg1.@func.toString() + _arg1.@param1.toString()) + _arg1.@param2.toString()));
};
};
if (_arg1.@func.toString().length > 0){
if (_arg1.@param2.toString().length > 0){
var _local4 = this;
_local4[_arg1.@func.toString()](_arg1.@param1.toString(), _arg1.@param2.toString());
} else {
if (_arg1.@param1.toString().length > 0){
_local4 = this;
_local4[_arg1.@func.toString()](_arg1.@param1.toString());
} else {
_local4 = this;
_local4[_arg1.@func.toString()]();
};
};
};
}
public function resume():void{
if (spritePlaying){
spriteIn.play();
};
}
override public function play():void{
spriteIn.play();
spritePlaying = true;
}
protected function handleFrameChange():void{
persistentActions = [];
persistentIds = [];
}
public function addSprite(_arg1:DisplayObject):void{
addChild(_arg1);
}
protected function updateState(_arg1:String):void{
var $id = _arg1;
stateData = XML(dataClass.data.states.state.(@id == $id));
if (stateData.@base.toString().length > 0){
basicState = stateData.@base.toString();
};
}
public function update():void{
}
protected function destroyCurrentSprite():void{
if (spriteIn){
spriteIn.stop();
if (contains(spriteIn)){
removeChild(spriteIn);
};
TweenMax.killTweensOf(spriteIn);
spriteIn = null;
};
}
protected function get defaultState():String{
return (DEFAULT_STATE);
}
public function initData(_arg1:Class):void{
dataClass = _arg1;
goto(defaultState);
}
public function goto(_arg1:String, _arg2:int=0, _arg3:Boolean=true):void{
var _local4:String;
var _local5:Class;
var _local6:MovieClip;
var _local7:String = (spriteIn) ? ((spriteIn.name + "_") + spriteIn.currentFrame) : "";
_arg2 = Number(_arg2);
if (((!(spriteIn)) || (!((spriteIn.name == _arg1))))){
destroyCurrentSprite();
updateState(_arg1);
if (((useSpriteCaching) && (!((spriteCache[_arg1] == undefined))))){
_local6 = spriteCache[_arg1];
} else {
_local4 = stateData.@className.toString();
_local5 = Class(getDefinitionByName(_local4));
_local6 = new (_local5);
_local6.name = _arg1;
};
if (_arg3){
_local6.gotoAndPlay(_arg2);
} else {
_local6.gotoAndStop(_arg2);
};
spritePlaying = _arg3;
if (useSpriteCaching){
spriteCache[_arg1] = _local6;
};
spriteIn = _local6;
addSprite(spriteIn);
checkFrameActions();
handleFrameChange();
} else {
if (spriteIn){
if ((((((spriteIn.name == _arg1)) && (!((spriteIn.currentFrame == _arg2))))) && (!((_arg2 == 0))))){
if (_arg3){
spriteIn.gotoAndPlay(_arg2);
} else {
spriteIn.gotoAndStop(_arg2);
};
spritePlaying = _arg3;
checkFrameActions();
handleFrameChange();
};
};
};
}
protected function makeRect(_arg1:String):Rectangle{
var _local2:Array = _arg1.split(",");
return (new Rectangle(Number(_local2[0]), Number(_local2[1]), Number(_local2[2]), Number(_local2[3])));
}
public function pause():void{
spriteIn.stop();
}
protected function checkFrameActions():void{
var i:int;
var actionList:XMLList;
actionList = stateData.action.(@frm == String(spriteIn.currentFrame));
i = 0;
while (i < actionList.length()) {
if (actionList[i].@alwaysCheck.toString() == "y"){
processFrameAction(actionList[i]);
};
i = (i + 1);
};
if (((spritePlaying) && (!((((spriteIn.name + "_") + spriteIn.currentFrame) == lastEval))))){
i = 0;
while (i < persistentActions.length) {
persistentActions[i].remaining--;
if (persistentActions[i].remaining > 0){
processFrameAction(persistentActions[i].node);
};
i = (i + 1);
};
if (actionList.length() > 0){
i = 0;
while (i < actionList.length()) {
if (actionList[i].@alwaysCheck.toString() != "y"){
processFrameAction(actionList[i]);
};
i = (i + 1);
};
};
lastEval = ((spriteIn.name + "_") + spriteIn.currentFrame);
};
}
protected function signOf(_arg1:Number):int{
if (_arg1 >= 0){
return (1);
};
return (-1);
}
protected function adjustSpeed(_arg1:String, _arg2:String):void{
this[(_arg1 + "Speed")] = (this[(_arg1 + "Speed")] + Number(_arg2));
}
}
}//package asfiles.char
Section 2
//Dragon (asfiles.char.Dragon)
package asfiles.char {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class Dragon extends MovieClip {
private var _spitWait:Number;// = 0
private var _foregroundShooting:Boolean;// = false
private var _enduranceMode:Boolean;// = false
private var _ySpeed:Number;// = 0
private var _xSpeed:Number;
public var minSpitWait:Number;// = 180
public var maxY:Number;// = 1000
public var squirrelPoint:Point;
public var spriteIn:MovieClip;
private static const MAX_SEP:Number = 200;
private static const FRM_SPIT:int = 2;
public static const SPIT:String = "spitFire";
private static const FRM_SPIT_KEY:int = 19;
private static const MAX_SPEED:Number = 8;
private static const ACCEL:Number = 0.8;
private static const MIN_SEP:Number = 50;
private static const FRM_IDLE:int = 1;
public static const FIRE_OFFSET_X:Number = 230;
public static const FIRE_OFFSET_Y:Number = -60;
private static const FRM_FORE:int = 3;
private static const IDEAL_TRAIL:Number = 410;
public function Dragon(){
_xSpeed = ((Squirrel.MIN_SPEED + Squirrel.MAX_SPEED) / 2);
super();
initialize();
}
public function muzzle():void{
_spitWait = -300;
}
public function advance(_arg1:Number):void{
x = (x + _arg1);
}
public function reset():void{
_spitWait = 0;
gotoAndStop(1);
}
public function update():void{
var _local1:MovieClip;
if (!_foregroundShooting){
if (squirrelPoint.x > (x + IDEAL_TRAIL)){
_xSpeed = Math.min((_xSpeed + ACCEL), (Squirrel.MAX_SPEED * 1.2));
} else {
_xSpeed = Math.max((_xSpeed - ACCEL), -(MAX_SPEED));
};
if (squirrelPoint.y < (y + MIN_SEP)){
_ySpeed = Math.max((_ySpeed - ACCEL), -(MAX_SPEED));
} else {
if (squirrelPoint.y > (y + MAX_SEP)){
_ySpeed = Math.min((_ySpeed + ACCEL), MAX_SPEED);
} else {
_ySpeed = (_ySpeed / 1.08);
};
};
};
x = (x + _xSpeed);
y = Math.min((y + _ySpeed), maxY);
if (currentFrame == FRM_IDLE){
_spitWait++;
if ((((((_spitWait > minSpitWait)) && (((_spitWait % 10) == 0)))) && ((Math.random() < 0.15)))){
_spitWait = 0;
gotoAndStop(FRM_SPIT);
};
} else {
if (currentFrame == FRM_SPIT){
_local1 = (getChildByName("spriteIn") as MovieClip);
if (((_local1) && ((_local1.currentFrame == _local1.totalFrames)))){
gotoAndStop(FRM_IDLE);
} else {
if (((_local1) && ((_local1.currentFrame == FRM_SPIT_KEY)))){
dispatchEvent(new Event(SPIT));
};
};
};
};
}
private function initialize():void{
scaleX = (scaleY = 0.65);
}
public function set enduranceMode(_arg1:Boolean):void{
_enduranceMode = _arg1;
minSpitWait = (_arg1) ? 300 : 180;
}
}
}//package asfiles.char
Section 3
//Squirrel (asfiles.char.Squirrel)
package asfiles.char {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import com.nflash.game.world.*;
import asfiles.*;
import com.nflash.*;
import asfiles.model.*;
import com.nflash.game.model.*;
import asfiles.util.*;
public class Squirrel extends Character {
protected const ACCELERATION:Number = 0.4;
protected const MIN_X:Number = 100;
protected const X_SPEED:Number = 12;
protected const DASH_DURATION_MIN:Number = 1;
protected const MAX_X:Number = 1100;
protected const DASH_DURATION_MAX:Number = 4;
protected const JUMP_SPEED:Number = 30;
protected const MAX_HITS:int = 3;
protected const MAX_ACORNS:int = 4;
protected var _fallSpeed:Number;// = 0
public var spaceHelmet:MovieClip;
protected var _dashCount:int;// = 0
protected var _hp:int;
protected var _returnSpeed:Number;
public var easyMode:Boolean;// = true
protected var _invincibility:Number;// = 0
public var enduranceMode:Boolean;// = false
protected var _tiers:Array;
protected var _runSpeed:Number;// = 22
protected var _dashStep:int;// = 0
private var _muzzled:Boolean;// = false
public static const TERMINAL_VELOCITY:Number = 35;
public static const MIN_SPEED:Number = 18;
public static const DEATH:String = "squirrelDeath";
public static const MAX_SPEED:Number = 26;
public function Squirrel(){
buildInterface();
}
public function advance(_arg1:Number):void{
x = (x + _arg1);
}
protected function locomoteX(_arg1:Number):void{
x = (x + _arg1);
}
public function get isDashing():Boolean{
return ((basicState == "dashing"));
}
public function springUp():void{
locomoteY(-50);
_fallSpeed = -50;
}
public function warnDeath():void{
AudioManager.playSoundFromLibrary("GameOverSound");
if (!enduranceMode){
dispatchEvent(new Event(Constants.EVENT_WARN_DEATH, true));
} else {
dispatchEvent(new Event(Constants.EVENT_WARN_DISTANCE_DEATH, true));
};
}
override protected function initialize():void{
super.initialize();
initData(SquirrelData);
configureInput(KeyboardReader, true);
}
public function get acorns():int{
return (_dashCount);
}
protected function dash():void{
var _local1:DashDust;
_returnSpeed = _runSpeed;
_dashCount--;
_dashStep = 0;
_fallSpeed = 0;
_runSpeed = (MAX_SPEED * 1.2);
goto("dashing");
AudioManager.playSoundFromLibrary("DashSound");
if (((parent) && (!(airborne)))){
_local1 = new DashDust();
parent.addChild(_local1);
_local1.x = x;
_local1.y = y;
_local1.scaleX = (_local1.scaleY = (scaleX * 2));
};
}
public function set tiers(_arg1:Array):void{
_tiers = _arg1;
}
public function signalDeath():void{
if (!enduranceMode){
dispatchEvent(new Event(DEATH));
} else {
dispatchEvent(new Event(Constants.EVENT_PAUSE, true));
dispatchEvent(new Event(Constants.EVENT_DISTANCE_DEATH, true));
};
}
public function hitObstacle(_arg1:String="dying", _arg2:Boolean=false):void{
if (((((!((basicState == "dashing"))) && ((((_invincibility <= 0)) || (_arg2))))) && (!(_muzzled)))){
if (_arg2){
_hp = 0;
} else {
_hp--;
};
if ((((_hp <= 0)) || (!(((enduranceMode) || (easyMode)))))){
goto(_arg1);
} else {
flicker();
};
};
}
public function slowDown():void{
_runSpeed = (_runSpeed / 1.08);
}
public function checkDeathDrift():void{
if (airborne){
goto("dying", 10);
} else {
_runSpeed = 0;
};
}
public function get speed():Number{
return (_runSpeed);
}
override public function update():void{
var _local1:int;
checkFrameActions();
controlImprint = inputSource.getImprint([39, 37, 38, 40, 65, 80, 32]);
_local1 = (_muzzled) ? 0 : Math.max(controlImprint[KEY_DASH], controlImprint[KEY_DASH_ALT]);
if (_invincibility > 0){
_invincibility--;
};
if (spriteIn.name != "burning"){
if ((((_fallSpeed < TERMINAL_VELOCITY)) && (!((basicState == "dashing"))))){
_fallSpeed = (_fallSpeed + ((controlImprint[KEY_JUMP] > 0)) ? GRAVITY : (GRAVITY * 1.5));
};
locomoteY(_fallSpeed);
};
if (controlImprint[KEY_PAUSE]){
dispatchEvent(new Event(Constants.EVENT_PAUSE, true));
};
if (alive){
if (((((((!((basicState == "dashing"))) && ((_local1 > 0)))) && ((_local1 < 12)))) && ((_dashCount > 0)))){
dash();
} else {
if (((!(airborne)) && ((controlImprint[KEY_JUMP] > 0)))){
AudioManager.playSoundFromLibrary("JumpSound");
_fallSpeed = -(JUMP_SPEED);
};
};
if (((controlImprint[KEY_ADVANCE]) && ((x < MAX_X)))){
locomoteX((X_SPEED / 1.25));
} else {
if (((controlImprint[KEY_RETREAT]) && ((x > MIN_X)))){
locomoteX(-(X_SPEED));
} else {
if (x > ((MIN_X * 0.66) + (MAX_X * 0.33))){
locomoteX((-(X_SPEED) / 5));
};
};
};
} else {
_hp = 0;
};
}
public function get alive():Boolean{
return (((!((spriteIn.name == "dying"))) && (!((spriteIn.name == "burning")))));
}
public function reset():void{
goto("landing");
_runSpeed = ((MIN_SPEED + MAX_SPEED) / 2);
_fallSpeed = 0;
_dashCount = 0;
visible = true;
_hp = MAX_HITS;
_muzzled = false;
}
public function halt():void{
_runSpeed = 0;
_fallSpeed = 0;
}
protected function locomoteY(_arg1:Number):void{
var _local2:int;
while (_local2 < _tiers.length) {
if ((((y <= _tiers[_local2])) && (((y + _arg1) >= _tiers[_local2])))){
landAt(_tiers[_local2]);
return;
};
_local2++;
};
y = (y + _arg1);
airborne = true;
if (basicState == "running"){
goto(((_arg1 >= 0)) ? "landing" : "jumping");
} else {
if ((((_fallSpeed > 0)) && ((spriteIn.name == "jumping")))){
goto("landing");
};
};
}
override protected function get defaultState():String{
return ("running");
}
public function muzzle():void{
_muzzled = true;
}
protected function buildInterface():void{
var _local1:Sprite;
_local1 = new HitCore();
_local1.name = Collidable.HITCORE_NAME;
_local1.alpha = 0;
_local1.x = (_local1.x - (_local1.width / 1.2));
_local1.y = (_local1.y - _local1.height);
_local1.width = (_local1.width + 45);
addChild(_local1);
}
public function get hearts():int{
return (_hp);
}
public function dashLoop():void{
_dashStep++;
if ((((_dashStep > DASH_DURATION_MAX)) || ((((((_dashStep > DASH_DURATION_MIN)) && ((!(controlImprint[KEY_DASH]) > 0)))) && ((!(controlImprint[KEY_DASH_ALT]) > 0)))))){
_runSpeed = _returnSpeed;
if (airborne){
goto("landing");
} else {
goto("running");
};
} else {
goto("dashing", 1);
};
}
public function flicker():void{
_invincibility = 20;
TweenMax.killTweensOf(this);
TweenMax.to(this, 0, {alpha:1});
TweenMax.to(this, 0.1, {alpha:0.2, yoyo:true, repeat:5});
}
protected function landAt(_arg1:Number):void{
_fallSpeed = 0;
y = _arg1;
airborne = false;
if (basicState == "jumping"){
GlobalVars.smashes = 0;
goto("running");
};
}
public function collectAcorn(_arg1:Boolean=false):void{
if (_dashCount < MAX_ACORNS){
_dashCount++;
};
if (((((_arg1) && ((_hp < MAX_HITS)))) && (((easyMode) || (enduranceMode))))){
_hp++;
};
}
}
}//package asfiles.char
Section 4
//UFO (asfiles.char.UFO)
package asfiles.char {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import flash.geom.*;
import asfiles.util.*;
public class UFO extends MovieClip {
public var targetClip:MovieClip;
public var minShootWait:Number;// = 270
public var spriteIn:MovieClip;
public var laser:MovieClip;
private var _trackX:Number;// = 0
private var _trackY:Number;// = 0
private var _xSpeed:Number;
public var inner:MovieClip;
private var _tracking:Boolean;// = false
private var _ySpeed:Number;// = 0
public var maxY:Number;// = 1000
public var squirrelPoint:Point;
private var _shootWait:Number;// = 0
private static const TRACKING_END_FRAME:Number = 47;
private static const MAX_SEP:Number = 300;
private static const ACCEL:Number = 1.5;
private static const MAX_SPEED:Number = 12;
private static const MIN_SEP:Number = 120;
private static const IDEAL_TRAIL:Number = 410;
public static const SHOOT:String = "shoot";
public function UFO(){
_xSpeed = ((Squirrel.MIN_SPEED + Squirrel.MAX_SPEED) / 2);
super();
initialize();
}
private function beginTracking():void{
_tracking = true;
targetClip.x = (squirrelPoint.x - x);
targetClip.y = ((squirrelPoint.y - y) - 20);
targetClip.gotoAndPlay(1);
targetClip.visible = true;
_shootWait = 0;
}
public function reset():void{
_shootWait = 0;
_tracking = false;
laser.alpha = 0;
targetClip.visible = false;
}
public function update():void{
if (squirrelPoint.x > (x + IDEAL_TRAIL)){
_xSpeed = Math.min((_xSpeed + ACCEL), (Squirrel.MAX_SPEED * 1.2));
} else {
_xSpeed = Math.max((_xSpeed - ACCEL), -(MAX_SPEED));
};
if (squirrelPoint.y < (y + MIN_SEP)){
_ySpeed = Math.max((_ySpeed - ACCEL), -(MAX_SPEED));
} else {
if (squirrelPoint.y > (y + MAX_SEP)){
_ySpeed = Math.min((_ySpeed + ACCEL), MAX_SPEED);
} else {
_ySpeed = (_ySpeed / 1.08);
};
};
x = (x + _xSpeed);
y = Math.min((y + _ySpeed), maxY);
inner.rotation = (-(_xSpeed) / 3);
if (_tracking){
if (targetClip.currentFrame == TRACKING_END_FRAME){
_trackX = (x + targetClip.x);
_trackY = (y + targetClip.y);
} else {
if (targetClip.currentFrame == targetClip.totalFrames){
fireShot();
};
};
if (targetClip.currentFrame <= TRACKING_END_FRAME){
targetClip.x = (((squirrelPoint.x - x) + targetClip.x) / 2);
targetClip.y = ((((squirrelPoint.y - y) + targetClip.y) / 2) - 20);
} else {
targetClip.x = (_trackX - x);
targetClip.y = (_trackY - y);
};
} else {
_shootWait++;
if (((((((!(_tracking)) && ((_shootWait > minShootWait)))) && (((_shootWait % 10) == 0)))) && ((Math.random() < 0.15)))){
beginTracking();
};
};
}
public function advance(_arg1:Number):void{
x = (x + _arg1);
}
private function initialize():void{
scaleX = (scaleY = 1);
targetClip.visible = false;
targetClip.gotoAndStop(1);
laser.scaleX = 2;
laser.visible = false;
}
private function fireShot():void{
var _local1:Number;
var _local2:Number;
AudioManager.playSoundFromLibrary("LaserSound");
_tracking = false;
laser.rotation = Math.max(5, (Math.atan2(targetClip.y, targetClip.x) * 57.3));
laser.scaleY = 0;
laser.visible = true;
laser.alpha = 1;
TweenMax.to(laser, 0.2, {scaleY:1});
TweenMax.to(laser, 0.2, {scaleY:0.2, autoAlpha:0, delay:0.2});
_local1 = (squirrelPoint.x - x);
_local2 = ((_local1 * (targetClip.y / targetClip.x)) + 30);
targetClip.visible = false;
targetClip.gotoAndStop(1);
dispatchEvent(new Event(Constants.EVENT_SHAKE, true));
if (Math.abs(((squirrelPoint.y - y) - _local2)) < 40){
dispatchEvent(new Event(SHOOT));
};
}
public function muzzle():void{
_shootWait = -300;
_tracking = false;
laser.alpha = 0;
targetClip.visible = false;
}
}
}//package asfiles.char
Section 5
//PlayOnceClip (asfiles.effects.PlayOnceClip)
package asfiles.effects {
import flash.display.*;
import flash.events.*;
public class PlayOnceClip extends MovieClip {
public function PlayOnceClip(){
addEventListener(Event.ENTER_FRAME, onCheckFrame);
}
protected function onCheckFrame(_arg1:Event):void{
if (currentFrame == totalFrames){
stop();
if (parent){
parent.removeChild(this);
};
};
}
}
}//package asfiles.effects
Section 6
//Trashplosion (asfiles.effects.Trashplosion)
package asfiles.effects {
import flash.display.*;
import com.greensock.*;
public class Trashplosion extends Sprite {
private var _trashTypes:Array;
private var _trash:Array;
public function Trashplosion(){
_trashTypes = [Trash1, Trash2, Trash3, Trash4, Trash5, Trash6];
_trash = [];
super();
buildInterface();
}
public function update():void{
var _local1:int;
while (_local1 < _trash.length) {
_trash[_local1].update();
_local1++;
};
}
public function destroy():void{
var _local1:int;
while (_local1 < _trash.length) {
removeChild(_trash[_local1]);
_local1++;
};
_trash = [];
}
private function buildInterface():void{
createTrash();
createTrash();
createTrash();
TweenMax.delayedCall(0.2, createTrash);
TweenMax.delayedCall(0.5, createTrash);
}
private function createTrash():void{
var _local1:int = Math.round((Math.random() * (_trashTypes.length - 0.51)));
var _local2:Class = (_trashTypes.splice(_local1, 1)[0] as Class);
var _local3:MovieClip = (new (_local2) as MovieClip);
_local3.x = (Math.random() * 120);
_local3.y = -30;
_local3.xSpeed = (6 + (Math.random() * 10));
_local3.ySpeed = (-16 - (Math.random() * 15));
addChild(_local3);
_trash.push(_local3);
}
}
}//package asfiles.effects
Section 7
//WeightedObject (asfiles.effects.WeightedObject)
package asfiles.effects {
import flash.display.*;
public class WeightedObject extends MovieClip {
public var ySpeed:Number;
public var xSpeed:Number;
private var _gravity:Number;// = 2
private function locomote():void{
x = (x + xSpeed);
y = (y + ySpeed);
rotation = (rotation + (xSpeed / 3));
}
public function update():void{
ySpeed = (ySpeed + _gravity);
locomote();
}
}
}//package asfiles.effects
Section 8
//ManagedSound (asfiles.media.ManagedSound)
package asfiles.media {
import flash.events.*;
import flash.media.*;
import com.greensock.*;
import flash.net.*;
import asfiles.util.*;
public class ManagedSound extends Sound {
public var channel:SoundChannel;
public var loadCompleted:Boolean;// = false
public var retainedVol:Number;// = 1
public var autoPlay:Boolean;// = true
public var id:String;// = ""
public var loadInitiated:Boolean;// = false
public var paused:Boolean;// = false
public var soundParams:Object;
private var pausePosition:Number;// = 0
public static const DEFAULT_VOLUME:Number = 1;
public static const PLAYBACK_COMPLETE:String = "playbackComplete";
public function ManagedSound(_arg1:Object=null){
soundParams = ((_arg1)!=null) ? setParams(_arg1) : setParams({volume:DEFAULT_VOLUME, autoplay:true, repeat:false, delay:0});
if (soundParams.autoplay != undefined){
autoPlay = soundParams.autoplay;
};
if (soundParams.retainedVol != undefined){
retainedVol = _arg1.retainedVol;
};
super();
}
public function stop():void{
if (channel != null){
pausePosition = 0;
channel.stop();
};
TweenLite.killDelayedCallsTo(startSound);
}
private function setParams(_arg1:Object=null):Object{
var _local2:Object = new Object();
_local2.volume = ((_arg1.volume)!=null) ? _arg1.volume : DEFAULT_VOLUME;
_local2.autoplay = ((_arg1.autoplay)==false) ? false : true;
_local2.repeat = ((_arg1.repeat)==true) ? true : false;
_local2.delay = ((_arg1.delay)>0) ? _arg1.delay : 0;
return (_local2);
}
public function pause():void{
if (!paused){
paused = true;
pausePosition = channel.position;
channel.stop();
};
}
private function startSound(_arg1:int=0):void{
if (AudioManager.isMuted){
return;
};
channel = play(0, _arg1);
TweenLite.to(channel, 0, {volume:soundParams.volume});
if (!soundParams.repeat){
channel.addEventListener(Event.SOUND_COMPLETE, onRewindSound);
};
}
public function get playheadPercentage():Number{
if (channel == null){
return (0);
};
return (Math.max(0, Math.min(1, (channel.position / Sound(this).length))));
}
public function playCached(_arg1:Object=null):SoundChannel{
if (AudioManager.isMuted){
return (channel);
};
soundParams = ((_arg1)!=null) ? setParams(_arg1) : setParams({volume:DEFAULT_VOLUME, autoplay:true, repeat:false, delay:0});
if (soundParams.autoplay){
TweenLite.delayedCall(soundParams.delay, startSound, [(soundParams.repeat) ? 9999 : 0]);
};
return (channel);
}
public function mute(_arg1:Number=0.5):void{
TweenLite.to(channel, _arg1, {volume:0});
}
private function onSoundLoaded(_arg1:Event):void{
trace(((("[ManagedSound] onSoundLoaded - " + soundParams.autoplay) + ", ") + soundParams.repeat));
loadCompleted = true;
if (((autoPlay) && (!(AudioManager.isMuted)))){
if (soundParams.repeat){
TweenLite.delayedCall(soundParams.delay, startSound, [9999]);
} else {
TweenLite.delayedCall(soundParams.delay, startSound);
};
};
}
override public function load(_arg1:URLRequest, _arg2:SoundLoaderContext=null):void{
loadInitiated = true;
addEventListener(Event.COMPLETE, onSoundLoaded);
super.load(_arg1);
}
private function onLoopSound(_arg1:Event):void{
channel = play(0, 9999);
channel.addEventListener(Event.SOUND_COMPLETE, onLoopSound);
}
public function unmute(_arg1:Number=0.5):void{
TweenLite.to(channel, _arg1, {volume:soundParams.volume});
}
private function onRewindSound(_arg1:Event):void{
dispatchEvent(new Event(PLAYBACK_COMPLETE));
channel.stop();
}
public function unpause():void{
if (((paused) || ((pausePosition == 0)))){
paused = false;
if (!soundParams.repeat){
channel = play(pausePosition);
} else {
channel = play(pausePosition, 9999);
};
};
}
}
}//package asfiles.media
Section 9
//LevelData (asfiles.model.LevelData)
package asfiles.model {
public class LevelData {
private static var levels:XML = <levels>
<level id="dragon_intro" type="cutscene" class_ref="DragonIntro" x="388" y="500" music="IntroMusic"/>
<level id="0" index="1" type="level" offsetY="600" deathY="1000" distance="11850" environment="city" music="EarthMusic">
<background>
<layer id="mid" offsetY="280" classRef="CityMidground" speed="0.2" scale="1"/>
<layer id="bg" offsetY="0" classRef="CityBg" speed="0.13" scale="1.5"/>
<layer id="distant" offsetY="-85" classRef="CityDistantBg" speed="0" scale="1.8"/>
</background>
<platforms>
<platform classRef="RedBuilding" x="26" y="364" w="1891" surf="-931"/>
<platform classRef="GreenBuilding" x="725" y="230" w="800" surf="-1047" depth="0"/>
<platform classRef="GreenBuilding" x="1829" y="484" w="800" surf="-1047"/>
<platform classRef="BrownBuilding" x="1479" y="71" w="2248" surf="-807" depth="0"/>
<platform classRef="RedBuilding" x="2739" y="604" w="1891" surf="-931"/>
<platform classRef="GreenBuilding" x="4062" y="324" w="800" surf="-1047" h="963" depth="0"/>
<platform classRef="RedBuilding" x="4929" y="604" w="1891" surf="-931"/>
<platform classRef="BrownBuilding" x="5031" y="-4" w="2248" surf="-807" depth="0"/>
<platform classRef="BrownBuilding" x="6764" y="423" w="2248" surf="-807" depth="7"/>
<platform classRef="GreenBuilding" x="9050" y="565" w="800" surf="-1047" h="963" depth="0"/>
<platform classRef="RedBuilding" x="10012" y="604" w="1891" surf="-931"/>
<platform classRef="BrownBuilding" x="12077" y="463" w="2248" surf="-807"/>
</platforms>
<pickups>
<pickup classRef="Acorn" x="1827" y="-204"/>
<pickup classRef="Acorn" x="3219" y="-460"/>
<pickup classRef="Acorn" x="4556" y="28"/>
<pickup classRef="GoldenAcorn" x="6008" y="-547"/>
<pickup classRef="Acorn" x="7656" y="-116"/>
<pickup classRef="Acorn" x="9613" y="-252"/>
</pickups>
<obstacles>
<obstacle classRef="asfiles.world.Rock" x="2050" y="-442"/>
<obstacle classRef="asfiles.world.Bird" x="2334" y="-56"/>
<obstacle classRef="asfiles.world.Vent" x="3382" y="25"/>
<obstacle classRef="asfiles.world.RightBird" x="5214" y="-530"/>
<obstacle classRef="asfiles.world.RightBird" x="5344" y="37"/>
<obstacle classRef="asfiles.world.Vent" x="6643" y="25"/>
<obstacle classRef="asfiles.world.LeftBird" x="6778" y="-530"/>
<obstacle classRef="asfiles.world.Rock" x="8014" y="-89"/>
<obstacle classRef="asfiles.world.Bird" x="8098" y="-86" scaleX="-1"/>
<obstacle classRef="asfiles.world.Vent" x="10440" y="26"/>
</obstacles>
</level>
<level id="dragon_interim" type="cutscene" class_ref="DragonInterim" x="370" y="470"/>
<level id="1" index="2" type="level" offsetY="650" deathY="1000" distance="11300" environment="city">
<background>
<layer id="mid" offsetY="280" classRef="CityMidground" speed="0.2" scale="1"/>
<layer id="bg" offsetY="0" classRef="CityBg" speed="0.13" scale="1.5"/>
<layer id="distant" offsetY="-85" classRef="CityDistantBg" speed="0" scale="1.8"/>
</background>
<platforms>
<platform classRef="BrownBuilding" x="-48" y="303" w="2248" surf="-807"/>
<platform classRef="GreenBuilding" x="2302" y="240" w="800" surf="-1047"/>
<platform classRef="RedBuilding" x="3168" y="423" w="1891" surf="-931"/>
<platform classRef="GreenBuilding" x="5127" y="346" w="800" surf="-1047"/>
<platform classRef="BrownBuilding" x="5163" y="123" w="2248" surf="-807" depth="0"/>
<platform classRef="RedBuilding" x="6027" y="422" w="1891" surf="-931"/>
<platform classRef="GreenBuilding" x="8200" y="320" w="800" surf="-1047"/>
<platform classRef="BrownBuilding" x="8834" y="189" w="2248" surf="-807" depth="0"/>
<platform classRef="RedBuilding" x="10088" y="363" w="1891" surf="-931"/>
<platform classRef="GreenBuilding" x="11979" y="622" w="800" h="963" surf="-1047"/>
</platforms>
<pickups>
<pickup classRef="Acorn" x="1290" y="-221"/>
<pickup classRef="Acorn" x="3747" y="-137"/>
<pickup classRef="GoldenAcorn" x="11266" y="-193"/>
</pickups>
<obstacles>
<obstacle classRef="asfiles.world.Vent" x="2750" y="-334"/>
<obstacle classRef="asfiles.world.Rock" x="3988" y="-121"/>
<obstacle classRef="asfiles.world.Vent" x="4524" y="-152"/>
<obstacle classRef="asfiles.world.Rock" x="5567" y="-195"/>
<obstacle classRef="asfiles.world.Bird" x="6374" y="-381"/>
<obstacle classRef="asfiles.world.Rock" x="6384" y="-123"/>
<obstacle classRef="asfiles.world.Rock" x="7150" y="-123"/>
<obstacle classRef="asfiles.world.Vent" x="7301" y="-154"/>
<obstacle classRef="asfiles.world.Vent" x="8942" y="-256"/>
<obstacle classRef="asfiles.world.Bird" x="9400" y="-315"/>
<obstacle classRef="asfiles.world.Rock" x="9816" y="-321"/>
<obstacle classRef="asfiles.world.Bird" x="10461" y="-176"/>
<obstacle classRef="asfiles.world.Rock" x="11160" y="-183"/>
</obstacles>
</level>
<level id="dragon_interim_2" type="cutscene" class_ref="DragonInterim" x="370" y="470"/>
<level id="2" index="3" type="level" offsetY="300" deathY="700" distance="17000" environment="city">
<background>
<layer id="mid" offsetY="280" classRef="CityMidground" speed="0.2" scale="1"/>
<layer id="bg" offsetY="0" classRef="CityBg" speed="0.13" scale="1.5"/>
<layer id="distant" offsetY="-85" classRef="CityDistantBg" speed="0" scale="1.8"/>
</background>
<platforms>
<platform classRef="RedBuilding" x="-28" y="704" w="1891" surf="-931"/>
<platform classRef="GreenBuilding" x="427" y="591" w="800" surf="-1047" depth="0"/>
<platform classRef="GreenBuilding" x="1419" y="590" w="800" surf="-1047" depth="0"/>
<platform classRef="BrownBuilding" x="2373" y="482" w="2248" surf="-807" depth="0"/>
<platform classRef="RedBuilding" x="4797" y="534" w="1891" surf="-931"/>
<platform classRef="RedBuilding" x="6862" y="542" w="1891" surf="-931"/>
<platform classRef="GreenBuilding" x="8351" y="760" w="800" surf="-1047"/>
<platform classRef="BrownBuilding" x="8365" y="367" w="2248" surf="-807" depth="0"/>
<platform classRef="RedBuilding" x="9434" y="775" w="1891" surf="-931"/>
<platform classRef="GreenBuilding" x="10489" y="250" w="800" surf="-1047" depth="0"/>
<platform classRef="BrownBuilding" x="11201" y="347" w="2248" surf="-807" depth="1"/>
<platform classRef="GreenBuilding" x="11560" y="760" w="800" surf="-1047"/>
<platform classRef="RedBuilding" x="12179" y="871" w="1891" surf="-931"/>
<platform classRef="RedBuilding" x="14204" y="789" w="1891" surf="-931" depth="0"/>
<platform classRef="GreenBuilding" x="16025" y="710" w="800" surf="-1047" depth="0"/>
<platform classRef="BrownBuilding" x="16289" y="573" w="2248" surf="-807" depth="0"/>
<platform classRef="GreenBuilding" x="17216" y="490" w="800" surf="-1047" depth="0"/>
<platform classRef="BrownBuilding" x="17651" y="345" w="2248" surf="-807" depth="0"/>
</platforms>
<pickups>
<pickup classRef="Acorn" x="2148" y="26"/>
<pickup classRef="Acorn" x="8415" y="-21"/>
<pickup classRef="Acorn" x="9083" y="199"/>
<pickup classRef="Acorn" x="9543" y="-193"/>
<pickup classRef="Acorn" x="11087" y="207"/>
<pickup classRef="Acorn" x="11684" y="-189"/>
<pickup classRef="GoldenAcorn" x="13912" y="221"/>
<pickup classRef="Acorn" x="15685" y="220"/>
</pickups>
<obstacles>
<obstacle classRef="asfiles.world.Bird" x="1626" y="168"/>
<obstacle classRef="asfiles.world.Rock" x="3101" y="-31"/>
<obstacle classRef="asfiles.world.Vent" x="3678" y="-64"/>
<obstacle classRef="asfiles.world.Vent" x="5391" y="-44"/>
<obstacle classRef="asfiles.world.Bird" x="6109" y="-7"/>
<obstacle classRef="asfiles.world.Rock" x="7490" y="-3"/>
<obstacle classRef="asfiles.world.RightBird" x="8682" y="-188"/>
<obstacle classRef="asfiles.world.Vent" x="9940" y="200"/>
<obstacle classRef="asfiles.world.LeftBird" x="10246" y="-188"/>
<obstacle classRef="asfiles.world.LeftBird" x="10938" y="213"/>
<obstacle classRef="asfiles.world.Vent" x="11228" y="-325"/>
<obstacle classRef="asfiles.world.Bird" x="11946" y="-157"/>
<obstacle classRef="asfiles.world.Vent" x="12224" y="184"/>
<obstacle classRef="asfiles.world.Rock" x="12479" y="321"/>
<obstacle classRef="asfiles.world.LeftBird" x="13787" y="300"/>
<obstacle classRef="asfiles.world.Rock" x="14628" y="243"/>
<obstacle classRef="asfiles.world.Vent" x="16682" y="26"/>
</obstacles>
</level>
<level id="space_transition" type="cutscene" class_ref="SpaceTransition" x="350" y="445" music="TransitionMusic"/>
<level id="3" index="4" type="level" offsetY="720" deathY="1350" distance="13900" music="SpaceMusic">
<background>
<layer id="mid" offsetY="80" classRef="AlienMidground" speed="0.2" scale="1"/>
<layer id="bg" offsetY="780" classRef="AlienBg" speed="0.13" scale="1"/>
<layer id="distant" offsetY="-85" classRef="SpaceDistantBg" speed="0" scale="1.8"/>
</background>
<platforms>
<platform classRef="AlienBoosted" x="-153" y="-320" w="1569" surf="-118"/>
<platform classRef="AlienTiered" x="1527" y="-614" w="1688" surf="38" depth="0"/>
<platform classRef="AlienTriangular" x="1531" y="-130" w="396" surf="-151"/>
<platform classRef="AlienSubtier" x="1718" y="-732" w="356" surf="0" depth="0"/>
<platform classRef="AlienDome" x="1950" y="-80" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienSubtier" x="2168" y="-732" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="2869" y="-732" w="356" surf="0" depth="0"/>
<platform classRef="AlienTriangular" x="3431" y="-630" w="396" surf="-151"/>
<platform classRef="AlienTriangular" x="3831" y="-530" w="396" surf="-151"/>
<platform classRef="AlienBoosted" x="3827" y="-20" w="1569" surf="-118"/>
<platform classRef="AlienTiered" x="5471" y="-324" w="1688" surf="38" depth="0"/>
<platform classRef="AlienSubtier" x="5645" y="-440" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="6120" y="-440" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="6700" y="-440" w="356" surf="0" depth="0"/>
<platform classRef="AlienBoosted" x="7212" y="-49" w="1569" surf="-118"/>
<platform classRef="AlienTiny" x="7230" y="-469" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="7650" y="-533" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="8050" y="-601" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTriangular" x="8600" y="-516" w="396" surf="-151"/>
<platform classRef="AlienDome" x="8969" y="-74" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienBoosted" x="10410" y="0" w="1569" surf="-118"/>
<platform classRef="AlienTriangular" x="10963" y="-229" w="396" surf="-151"/>
<platform classRef="AlienSubtier" x="11665" y="-624" w="356" surf="0" depth="0"/>
<platform classRef="AlienTiny" x="12046" y="-526" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="12029" y="-125" w="280" surf="-17" depth="0"/>
<platform classRef="AlienBoosted" x="12361" y="-182" w="1569" surf="-118"/>
<platform classRef="AlienDome" x="13869" y="-220" w="1861" surf="-159" depth="0"/>
</platforms>
<pickups>
<pickup classRef="Acorn" x="1024" y="-456"/>
<pickup classRef="Acorn" x="1624" y="-596"/>
<pickup classRef="Acorn" x="2632" y="-268"/>
<pickup classRef="Acorn" x="4008" y="-760"/>
<pickup classRef="Acorn" x="4754" y="-171"/>
<pickup classRef="Acorn" x="6293" y="-478"/>
<pickup classRef="Acorn" x="6781" y="-322"/>
<pickup classRef="Acorn" x="8700" y="-722"/>
<pickup classRef="Spring" x="11140" y="-385"/>
<pickup classRef="GoldenAcorn" x="11403" y="-850"/>
<pickup classRef="Acorn" x="11700" y="-171"/>
<pickup classRef="Spring" x="12156" y="-144"/>
</pickups>
<obstacles>
<obstacle classRef="asfiles.world.Satellite" x="2138" y="-902"/>
<obstacle classRef="asfiles.world.Shellder" x="2826" y="-622"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="3288" y="-251"/>
<obstacle classRef="asfiles.world.VenusPlant" x="4091" y="-141"/>
<obstacle classRef="asfiles.world.Satellite" x="4397" y="-865"/>
<obstacle classRef="asfiles.world.ElectricPad" x="6157" y="-262"/>
<obstacle classRef="asfiles.world.Shellder" x="8027" y="-207"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="9434" y="-237"/>
<obstacle classRef="asfiles.world.Shellder" x="10500" y="-278"/>
<obstacle classRef="asfiles.world.Satellite" x="11413" y="-649"/>
<obstacle classRef="asfiles.world.VenusPlant" x="13771" y="-301"/>
</obstacles>
</level>
<level id="space_interim" type="cutscene" class_ref="SpaceInterim" x="375" y="470"/>
<level id="4" index="5" type="level" offsetY="300" deathY="900" distance="18000" music="SpaceMusic">
<background>
<layer id="mid" offsetY="80" classRef="AlienMidground" speed="0.2" scale="1"/>
<layer id="bg" offsetY="780" classRef="AlienBg" speed="0.13" scale="1"/>
<layer id="distant" offsetY="-85" classRef="SpaceDistantBg" speed="0" scale="1.8"/>
</background>
<platforms>
<platform classRef="AlienShiplike" x="40" y="306" w="917" surf="-193"/>
<platform classRef="AlienTiered" x="928" y="303" w="1688" surf="38" depth="0"/>
<platform classRef="AlienTiny" x="1116" y="50" w="280" surf="-17" depth="0"/>
<platform classRef="AlienDome" x="1499" y="113" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienBoosted" x="2647" y="481" w="1569" surf="-118"/>
<platform classRef="AlienShiplike" x="3471" y="146" w="917" surf="-193"/>
<platform classRef="AlienDome" x="4307" y="517" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienTriangular" x="4667" y="42" w="396" surf="-151"/>
<platform classRef="AlienTiny" x="5413" y="-26" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiered" x="5778" y="-97" w="1688" surf="38" depth="0"/>
<platform classRef="AlienSubtier" x="5964" y="-213" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="6439" y="-213" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="6939" y="-213" w="356" surf="0" depth="0"/>
<platform classRef="AlienTiny" x="6205" y="405" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="6569" y="338" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="6929" y="270" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="7273" y="190" w="280" surf="-17" depth="0"/>
<platform classRef="AlienDome" x="7570" y="213" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienBoosted" x="9485" y="257" w="1569" surf="-118"/>
<platform classRef="AlienTiered" x="11034" y="187" w="1688" surf="38" depth="0"/>
<platform classRef="AlienSubtier" x="11229" y="70" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="11687" y="70" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="12187" y="70" w="356" surf="0" depth="0"/>
<platform classRef="AlienDome" x="12581" y="529" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienTiny" x="12742" y="89" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="13080" y="-55" w="280" surf="-17" depth="0"/>
<platform classRef="AlienBoosted" x="13369" y="-351" w="1569" surf="-118"/>
<platform classRef="AlienTiered" x="14511" y="343" w="1688" surf="38" depth="0"/>
<platform classRef="AlienSubtier" x="15153" y="221" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="15628" y="221" w="356" surf="0" depth="0"/>
<platform classRef="AlienTiny" x="15014" y="-273" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="15822" y="-163" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="16119" y="-45" w="280" surf="-17" depth="0"/>
<platform classRef="AlienDome" x="16170" y="425" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienBoosted" x="18031" y="290" w="1569" surf="-118"/>
</platforms>
<pickups>
<pickup classRef="Acorn" x="884" y="79"/>
<pickup classRef="Acorn" x="3032" y="316"/>
<pickup classRef="Acorn" x="5129" y="328"/>
<pickup classRef="Acorn" x="6101" y="-248"/>
<pickup classRef="Acorn" x="9618" y="112"/>
<pickup classRef="Acorn" x="11844" y="134"/>
<pickup classRef="Spring" x="13205" y="-74"/>
<pickup classRef="Acorn" x="13443" y="343"/>
<pickup classRef="Acorn" x="13623" y="-500"/>
<pickup classRef="Acorn" x="15808" y="191"/>
<pickup classRef="GoldenAcorn" x="16244" y="-93"/>
<pickup classRef="Acorn" x="17380" y="239"/>
</pickups>
<obstacles>
<obstacle classRef="asfiles.world.ElectricPad" x="1826" y="364"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="3050" y="-40"/>
<obstacle classRef="asfiles.world.Satellite" x="3409" y="164"/>
<obstacle classRef="asfiles.world.ElectricPad" x="3872" y="391"/>
<obstacle classRef="asfiles.world.VenusPlant" x="3980" y="-48"/>
<obstacle classRef="asfiles.world.Satellite" x="4500" y="-160"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="5447" y="355"/>
<obstacle classRef="asfiles.world.Shellder" x="6631" y="-104"/>
<obstacle classRef="asfiles.world.Satellite" x="7556" y="-270"/>
<obstacle classRef="asfiles.world.ElectricPad" x="8236" y="80"/>
<obstacle classRef="asfiles.world.VenusPlant" x="8990" y="52"/>
<obstacle classRef="asfiles.world.Satellite" x="9576" y="-74"/>
<obstacle classRef="asfiles.world.Shellder" x="10252" y="93"/>
<obstacle classRef="asfiles.world.ElectricPad" x="11141" y="250"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="12361" y="71"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="14077" y="370"/>
<obstacle classRef="asfiles.world.VenusPlant" x="14129" y="-472"/>
<obstacle classRef="asfiles.world.ElectricPad" x="14966" y="406"/>
<obstacle classRef="asfiles.world.Satellite" x="15559" y="-250"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="16574" y="258"/>
</obstacles>
</level>
<level id="space_interim_2" type="cutscene" class_ref="SpaceInterim" x="375" y="470"/>
<level id="5" index="6" type="level" offsetY="450" deathY="1100" distance="16300">
<background>
<layer id="mid" offsetY="80" classRef="AlienMidground" speed="0.2" scale="1"/>
<layer id="bg" offsetY="780" classRef="AlienBg" speed="0.13" scale="1"/>
<layer id="distant" offsetY="-85" classRef="SpaceDistantBg" speed="0" scale="1.8"/>
</background>
<platforms>
<platform classRef="AlienBoosted" x="-82" y="27" w="1569" surf="-118"/>
<platform classRef="AlienTriangular" x="1502" y="116" w="396" surf="-151"/>
<platform classRef="AlienTiny" x="1725" y="-164" w="280" surf="-17"/>
<platform classRef="AlienDome" x="2019" y="121" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienTiered" x="2075" y="-317" w="1688" surf="38"/>
<platform classRef="AlienSubtier" x="2272" y="-428" w="356" surf="0"/>
<platform classRef="AlienSubtier" x="2747" y="-428" w="356" surf="0"/>
<platform classRef="AlienSubtier" x="3248" y="-428" w="356" surf="0" depth="0"/>
<platform classRef="AlienShiplike" x="3898" y="-70" w="917" surf="-193"/>
<platform classRef="AlienBoosted" x="3901" y="170" w="1569" surf="-118"/>
<platform classRef="AlienSubtier" x="4748" y="-378" w="356" surf="0" depth="0"/>
<platform classRef="AlienTriangular" x="5097" y="-114" w="396" surf="-151"/>
<platform classRef="AlienTriangular" x="5568" y="212" w="396" surf="-151"/>
<platform classRef="AlienTiered" x="5615" y="-269" w="1688" surf="38" depth="0"/>
<platform classRef="AlienSubtier" x="5808" y="-381" w="356" surf="0" depth="0"/>
<platform classRef="AlienTiny" x="6334" y="99" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiny" x="6858" y="99" w="280" surf="-17" depth="0"/>
<platform classRef="AlienShiplike" x="7279" y="-286" w="917" surf="-193"/>
<platform classRef="AlienTiny" x="7374" y="99" w="280" surf="-17" depth="0"/>
<platform classRef="AlienBoosted" x="7774" y="-35" w="1569" surf="-118"/>
<platform classRef="AlienDome" x="8349" y="-375" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienTriangular" x="9571" y="29" w="396" surf="-151"/>
<platform classRef="AlienTiny" x="10215" y="-86" w="280" surf="-17" depth="0"/>
<platform classRef="AlienTiered" x="10425" y="-581" w="1688" surf="38" depth="0"/>
<platform classRef="AlienSubtier" x="10595" y="-689" w="356" surf="0" depth="0"/>
<platform classRef="AlienShiplike" x="10692" y="89" w="917" surf="-193"/>
<platform classRef="AlienSubtier" x="11095" y="-689" w="356" surf="0" depth="0"/>
<platform classRef="AlienSubtier" x="11570" y="-689" w="356" surf="0" depth="0"/>
<platform classRef="AlienDome" x="11702" y="49" w="1861" surf="-159" depth="0"/>
<platform classRef="AlienTriangular" x="12303" y="-506" w="396" surf="-151"/>
<platform classRef="AlienTriangular" x="13804" y="26" w="396" surf="-151"/>
<platform classRef="AlienTiered" x="14418" y="-153" w="1688" surf="38" depth="0"/>
<platform classRef="AlienSubtier" x="14623" y="-273" w="356" surf="0" depth="0"/>
<platform classRef="AlienBoosted" x="16070" y="54" w="1569" surf="-118"/>
</platforms>
<pickups>
<pickup classRef="Acorn" x="1858" y="-210"/>
<pickup classRef="Acorn" x="2476" y="-476"/>
<pickup classRef="Acorn" x="4189" y="-25"/>
<pickup classRef="Acorn" x="4934" y="-437"/>
<pickup classRef="Spring" x="5407" y="49"/>
<pickup classRef="GoldenAcorn" x="7000" y="49"/>
<pickup classRef="Spring" x="7118" y="-238"/>
<pickup classRef="Spring" x="7553" y="88"/>
<pickup classRef="Acorn" x="7938" y="-164"/>
<pickup classRef="Acorn" x="8582" y="-568"/>
<pickup classRef="Acorn" x="11227" y="-720"/>
<pickup classRef="Acorn" x="12171" y="-124"/>
<pickup classRef="Acorn" x="14788" y="-148"/>
</pickups>
<obstacles>
<obstacle classRef="asfiles.world.Satellite" x="2934" y="-526"/>
<obstacle classRef="asfiles.world.Shellder" x="3664" y="-327"/>
<obstacle classRef="asfiles.world.VenusPlant" x="4941" y="50"/>
<obstacle classRef="asfiles.world.Satellite" x="6144" y="25"/>
<obstacle classRef="asfiles.world.ElectricPad" x="6308" y="-213"/>
<obstacle classRef="asfiles.world.Satellite" x="7906" y="-711"/>
<obstacle classRef="asfiles.world.VenusPlant" x="9284" y="-537"/>
<obstacle classRef="asfiles.world.Shellder" x="11010" y="-589"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="11772" y="-683"/>
<obstacle classRef="asfiles.world.ElectricPad" x="12486" y="-83"/>
<obstacle classRef="asfiles.world.Satellite" x="12881" y="-682"/>
<obstacle classRef="asfiles.world.EyeballEnemy" x="14801" y="-268"/>
<obstacle classRef="asfiles.world.ElectricPad" x="15365" y="-93"/>
</obstacles>
</level>
<level id="ending_video" type="cutscene" class_ref="EndingVideo" x="348" y="206" music="EndingMusic"/>
<level id="credits_video" type="cutscene" class_ref="CreditsVideo" x="360" y="190" music="EarthMusic"/>
<level id="distance" index="0" type="level" offsetY="650" deathY="1050" distance="0" environment="city" music="EarthMusic">
<background>
<layer id="distant" offsetY="-85" classRef="CityDistantBg" speed="0" scale="1.8"/>
</background>
<platforms>
<platform classRef="BrownBuilding" x="-48" y="350" w="2248" surf="-807"/>
</platforms>
<pickups>
</pickups>
<obstacles>
</obstacles>
</level>
</levels>
;
public static function getNextLevelId(_arg1:String):String{
var _local2:XML = getLevel(_arg1);
var _local3:int = _local2.childIndex();
return (levels.level[(_local3 + 1)].@id);
}
public static function getLevel(_arg1:String):XML{
var $id = _arg1;
return (XML(levels.level.(@id == $id)));
}
}
}//package asfiles.model
Section 10
//Platform (asfiles.model.Platform)
package asfiles.model {
import flash.display.*;
public class Platform {
public var clip:MovieClip;
public var surface:Number;// = 0
public function get width():Number{
return (clip.width);
}
public function setContent(_arg1:XML):void{
clip.x = Number(_arg1.@x);
clip.y = Number(_arg1.@y);
if (Math.abs((clip.width - Number(_arg1.@w))) > 5){
clip.width = Number(_arg1.@w);
};
if (_arg1.@h.toString().length > 0){
if (Math.abs((clip.height - Number(_arg1.@h))) > 5){
clip.height = Number(_arg1.@h);
};
} else {
clip.scaleY = clip.scaleX;
};
}
public function get x():Number{
return (clip.x);
}
}
}//package asfiles.model
Section 11
//SquirrelData (asfiles.model.SquirrelData)
package asfiles.model {
public class SquirrelData {
public static const data:XML = <data>
<states>
<state id="running" base="running" className="SquirrelRunning" spaceClass="SpaceRunning">
<action frm="15" func="goto" param1="running" param2="1"/>
</state>
<state id="jumping" base="jumping" className="SquirrelJumping" spaceClass="SpaceJumping">
<action frm="12" func="stop"/>
</state>
<state id="landing" base="jumping" className="SquirrelLanding" spaceClass="SpaceLanding">
<action frm="12" func="stop"/>
</state>
<state id="dashing" base="dashing" className="SquirrelDashing" spaceClass="SpaceDashing">
<action frm="5" func="dashLoop"/>
</state>
<state id="dying" base="dying" className="SquirrelDying" spaceClass="SpaceDying">
<action frm="1" func="slowDown" persist="9"/>
<action frm="11" func="checkDeathDrift"/>
<action frm="12" func="warnDeath"/>
<action frm="69" func="signalDeath"/>
<action frm="70" func="stop"/>
</state>
<state id="burning" base="dying" className="SquirrelBurning" spaceClass="SpaceBurning">
<action frm="1" func="halt"/>
<action frm="12" func="warnDeath"/>
<action frm="69" func="signalDeath"/>
<action frm="70" func="stop"/>
</state>
</states>
<dependencies>
</dependencies>
</data>
;
}
}//package asfiles.model
Section 12
//ControlsMessage (asfiles.ui.ControlsMessage)
package asfiles.ui {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import asfiles.util.*;
public class ControlsMessage extends Sprite {
public function ControlsMessage(){
if (stage){
return;
};
initialize();
}
private function initialize():void{
TweenMax.to(this, 0, {tint:0xFFFFFF});
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
dispatchEvent(new Event(Constants.EVENT_UNPAUSE, true));
if (((parent) && (parent.contains(this)))){
parent.removeChild(this);
};
};
}
private function onAddedToStage(_arg1:Event):void{
TweenMax.to(this, 0.75, {tint:null, delay:0.15});
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
}
}//package asfiles.ui
Section 13
//DifficultyMenu (asfiles.ui.DifficultyMenu)
package asfiles.ui {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import asfiles.util.*;
import com.greensock.easing.*;
public class DifficultyMenu extends Sprite {
public var easyButton:StandardMenuButton;
private var _activeOption:DisplayObject;
public var hardButton:StandardMenuButton;
public var selector:MovieClip;
public function DifficultyMenu(){
if (stage){
return;
};
initialize();
}
public function enableMenu():void{
easyButton.mouseEnabled = true;
hardButton.mouseEnabled = true;
_activeOption = easyButton;
selector.y = _activeOption.y;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function onClickHard(_arg1:Event):void{
startHard();
}
private function startEasy():void{
dispatchEvent(new Event(Constants.EVENT_START_EASY, true));
}
private function onRolloverOption(_arg1:Event):void{
highlightOption((_arg1.target as DisplayObject));
}
public function disableMenu():void{
easyButton.mouseEnabled = false;
hardButton.mouseEnabled = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function toggleOption():void{
switch (_activeOption){
case easyButton:
highlightOption(hardButton);
break;
case hardButton:
highlightOption(easyButton);
break;
};
}
private function onRemovedFromStage(_arg1:Event):void{
disableMenu();
}
private function startHard():void{
dispatchEvent(new Event(Constants.EVENT_START_HARD, true));
}
private function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
TweenMax.killTweensOf(selector);
enableMenu();
}
private function initialize():void{
easyButton.text = "CASUAL";
hardButton.text = "HARDCORE";
easyButton.addEventListener(MouseEvent.CLICK, onClickEasy);
hardButton.addEventListener(MouseEvent.CLICK, onClickHard);
easyButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
hardButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
selector.mouseEnabled = false;
selector.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
}
private function selectOption():void{
disableMenu();
switch (_activeOption){
case easyButton:
startEasy();
break;
case hardButton:
startHard();
break;
};
}
private function onClickEasy(_arg1:Event):void{
startEasy();
}
private function onKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 38){
toggleOption();
} else {
if (_arg1.keyCode == 40){
toggleOption();
};
};
if (_arg1.keyCode == 32){
selectOption();
};
}
private function highlightOption(_arg1:DisplayObject):void{
_activeOption = _arg1;
TweenMax.to(selector, 0.3, {y:_arg1.y, ease:Back.easeOut});
}
}
}//package asfiles.ui
Section 14
//DistanceDeathMenu (asfiles.ui.DistanceDeathMenu)
package asfiles.ui {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import flash.geom.*;
import asfiles.util.*;
import com.greensock.easing.*;
import flash.text.*;
public class DistanceDeathMenu extends Sprite {
public var retryButton:StandardMenuButton;
private var _capture:Bitmap;
public var mainMenuButton:StandardMenuButton;
public var header:MovieClip;
public var scoreboard;
private var _initialButtonX:Number;
public var viewButton:StandardMenuButton;
public var bg:MovieClip;
private var _distance:Number;
public var selector:MovieClip;
private var _initialSelectorX:Number;
public var submitButton:StandardMenuButton;
private var _activeOption:DisplayObject;
private var _submitted:Boolean;// = false
public var distanceLabel:TextField;
public function DistanceDeathMenu(){
if (stage){
return;
};
initialize();
buildInterface();
__setProp_scoreboard_DistanceDeathMenu_selector_0();
}
private function enableMenu():void{
retryButton.mouseEnabled = true;
submitButton.mouseEnabled = true;
viewButton.mouseEnabled = true;
mainMenuButton.mouseEnabled = true;
_activeOption = retryButton;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function showScores():void{
scoreboard.boardName = "Distance Mode";
scoreboard.loadScores();
scoreboard.visible = true;
TweenMax.to(retryButton, 0.4, {x:(_initialButtonX + 150)});
TweenMax.to(submitButton, 0.4, {x:(_initialButtonX + 150)});
TweenMax.to(viewButton, 0.4, {x:(_initialButtonX + 150)});
TweenMax.to(mainMenuButton, 0.4, {x:(_initialButtonX + 150)});
TweenMax.to(selector, 0.4, {x:(_initialSelectorX + 150)});
}
private function prevOption():void{
switch (_activeOption){
case retryButton:
highlightOption(mainMenuButton);
break;
case submitButton:
highlightOption(retryButton);
break;
case viewButton:
highlightOption(submitButton);
break;
case mainMenuButton:
highlightOption(viewButton);
break;
};
}
private function onKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 38){
prevOption();
} else {
if (_arg1.keyCode == 40){
nextOption();
};
};
if (_arg1.keyCode == 32){
selectOption();
};
}
private function initialize():void{
alpha = 0;
retryButton.text = "RETRY";
submitButton.text = "SUBMIT SCORE";
viewButton.text = "VIEW HIGHSCORES";
mainMenuButton.text = "MAIN MENU";
_initialButtonX = retryButton.x;
_initialSelectorX = selector.x;
retryButton.addEventListener(MouseEvent.CLICK, onClickResume);
submitButton.addEventListener(MouseEvent.CLICK, onClickSubmitScore);
viewButton.addEventListener(MouseEvent.CLICK, onClickViewScores);
mainMenuButton.addEventListener(MouseEvent.CLICK, onClickMainMenu);
retryButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
submitButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
viewButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
mainMenuButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
selector.mouseEnabled = false;
selector.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onScorePosted(_arg1:Event):void{
showScores();
}
private function selectOption():void{
switch (_activeOption){
case retryButton:
retry();
break;
case submitButton:
submitScore();
break;
case viewButton:
viewScores();
break;
case mainMenuButton:
mainMenu();
break;
};
}
private function onAddedToStage(_arg1:Event):void{
_capture.bitmapData.draw(stage, new Matrix(1, 0, 0, 1, 20));
_submitted = false;
scoreboard.visible = false;
scoreboard.boardName = "Distance Mode";
submitButton.alpha = (viewButton.alpha = 1);
retryButton.x = (submitButton.x = (viewButton.x = (mainMenuButton.x = _initialButtonX)));
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function viewScores():void{
if (!scoreboard.visible){
viewButton.alpha = 1;
showScores();
};
}
private function retry():void{
animateOut();
TweenMax.delayedCall(1, dispatchEvent, [new Event(Constants.EVENT_LEVEL_RESTART, true)]);
}
public function animateOut():void{
TweenMax.to(selector, 0.2, {alpha:0});
TweenMax.to(header, 0.4, {y:"-300", ease:Expo.easeIn});
TweenMax.to(retryButton, 0.3, {y:"500", delay:0.5, ease:Expo.easeIn});
TweenMax.to(submitButton, 0.3, {y:"500", delay:0.4, ease:Expo.easeIn});
TweenMax.to(viewButton, 0.3, {y:"500", delay:0.3, ease:Expo.easeIn});
TweenMax.to(mainMenuButton, 0.3, {y:"500", delay:0.2, ease:Expo.easeIn});
TweenMax.to(this, 0.4, {alpha:0, delay:0.7});
mouseChildren = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function onClickSubmitScore(_arg1:Event):void{
submitScore();
}
private function mainMenu():void{
animateOut();
TweenMax.delayedCall(1, dispatchEvent, [new Event(Constants.EVENT_MAIN_MENU, true)]);
}
private function onClickMainMenu(_arg1:Event):void{
mainMenu();
}
private function nextOption():void{
switch (_activeOption){
case retryButton:
highlightOption(submitButton);
break;
case submitButton:
highlightOption(viewButton);
break;
case viewButton:
highlightOption(mainMenuButton);
break;
case mainMenuButton:
highlightOption(retryButton);
break;
};
}
private function highlightOption(_arg1:DisplayObject):void{
_activeOption = _arg1;
TweenMax.to(selector, 0.3, {y:_arg1.y, ease:Back.easeOut});
}
private function submitScore():void{
if (!_submitted){
_submitted = true;
submitButton.alpha = (viewButton.alpha = 0.5);
API.postScore("Distance Mode", int(_distance));
API.addEventListener(APIEvent.SCORE_POSTED, onScorePosted);
showScores();
};
}
function __setProp_scoreboard_DistanceDeathMenu_selector_0(){
try {
scoreboard["componentInspectorSetting"] = true;
} catch(e:Error) {
};
scoreboard.boardName = "Distance Mode";
scoreboard.period = "Today";
try {
scoreboard["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
private function onRolloverOption(_arg1:Event):void{
highlightOption((_arg1.target as DisplayObject));
}
public function animateIn():void{
header.scaleX = (header.scaleY = 3);
header.alpha = 0;
selector.alpha = 0;
retryButton.alpha = (submitButton.alpha = (viewButton.alpha = (mainMenuButton.alpha = 0)));
retryButton.mouseEnabled = (submitButton.mouseEnabled = (viewButton.mouseEnabled = (mainMenuButton.mouseEnabled = false)));
TweenMax.to(this, 0.2, {alpha:1});
TweenMax.to(header, 0.4, {scaleX:1, scaleY:1, alpha:1, delay:0.1, ease:Expo.easeIn});
TweenMax.to(retryButton, 0.3, {scaleX:1, scaleY:1, alpha:1, delay:0.2, ease:Expo.easeIn});
TweenMax.to(submitButton, 0.3, {scaleX:1, scaleY:1, alpha:1, delay:0.3, ease:Expo.easeIn});
TweenMax.to(viewButton, 0.3, {scaleX:1, scaleY:1, alpha:1, delay:0.4, ease:Expo.easeIn});
TweenMax.to(mainMenuButton, 0.3, {scaleX:1, scaleY:1, alpha:1, delay:0.5, ease:Expo.easeIn, onComplete:enableMenu});
TweenMax.to(selector, 0.3, {alpha:1, delay:0.6});
}
private function buildInterface():void{
var _local1:Sprite = new Sprite();
_capture = new Bitmap(new BitmapData((Constants.APP_W + 40), Constants.APP_H));
_local1.addChildAt(_capture, 0);
_local1.x = -20;
addChildAt(_local1, 0);
TweenMax.to(_local1, 0, {blurFilter:{blurX:15, blurY:5, quality:1}});
}
private function onClickViewScores(_arg1:Event):void{
viewScores();
}
public function set distance(_arg1:Number):void{
_distance = _arg1;
distanceLabel.text = (("TOTAL DISTANCE: " + _arg1) + "M");
}
private function onClickResume(_arg1:Event):void{
retry();
}
}
}//package asfiles.ui
Section 15
//EndOfLevelMenu (asfiles.ui.EndOfLevelMenu)
package asfiles.ui {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import asfiles.util.*;
import com.greensock.easing.*;
public class EndOfLevelMenu extends Sprite {
private var _level:int;
public var mainMenuButton:StandardMenuButton;
public var header:MovieClip;
public var selector:MovieClip;
public var nextLevelButton:StandardMenuButton;
public var replayLevelButton:StandardMenuButton;
private var _activeOption:DisplayObject;
public static const EVENT_MAIN_MENU:String = "mainMenu";
public static const EVENT_REPLAY_LEVEL:String = "replayLevel";
public static const EVENT_NEXT_LEVEL:String = "nextLevel";
public function EndOfLevelMenu(){
if (stage){
return;
};
initialize();
}
private function onClickMainMenu(_arg1:Event):void{
mainMenu();
}
private function enableMenu():void{
nextLevelButton.mouseEnabled = true;
replayLevelButton.mouseEnabled = true;
mainMenuButton.mouseEnabled = true;
_activeOption = nextLevelButton;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function prevOption():void{
switch (_activeOption){
case nextLevelButton:
highlightOption(mainMenuButton);
break;
case replayLevelButton:
highlightOption(nextLevelButton);
break;
case mainMenuButton:
highlightOption(replayLevelButton);
break;
};
}
private function highlightOption(_arg1:DisplayObject):void{
_activeOption = _arg1;
TweenMax.to(selector, 0.3, {y:_arg1.y, ease:Back.easeOut});
}
public function set level(_arg1:int):void{
_level = _arg1;
header.headerLabel.text = ("YOU HAVE PASSED LEVEL " + _arg1);
if (_level == 6){
nextLevelButton.text = "CONTINUE";
};
}
private function initialize():void{
nextLevelButton.text = "NEXT LEVEL";
replayLevelButton.text = "REPLAY LEVEL";
mainMenuButton.text = "MAIN MENU";
nextLevelButton.addEventListener(MouseEvent.CLICK, onClickNextLevel);
replayLevelButton.addEventListener(MouseEvent.CLICK, onClickReplayLevel);
mainMenuButton.addEventListener(MouseEvent.CLICK, onClickMainMenu);
nextLevelButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
replayLevelButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
mainMenuButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
selector.mouseEnabled = false;
selector.mouseChildren = false;
}
private function nextLevel():void{
animateOut();
TweenMax.delayedCall(1.5, dispatchEvent, [new Event(EVENT_NEXT_LEVEL)]);
}
private function nextOption():void{
switch (_activeOption){
case nextLevelButton:
highlightOption(replayLevelButton);
break;
case replayLevelButton:
highlightOption(mainMenuButton);
break;
case mainMenuButton:
highlightOption(nextLevelButton);
break;
};
}
private function selectOption():void{
switch (_activeOption){
case nextLevelButton:
nextLevel();
break;
case replayLevelButton:
replayLevel();
break;
case mainMenuButton:
mainMenu();
break;
};
}
private function replayLevel():void{
animateOut();
TweenMax.delayedCall(1.5, dispatchEvent, [new Event(EVENT_REPLAY_LEVEL)]);
}
private function onKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 38){
prevOption();
} else {
if (_arg1.keyCode == 40){
nextOption();
};
};
if (_arg1.keyCode == 32){
selectOption();
};
}
private function onRolloverOption(_arg1:Event):void{
highlightOption((_arg1.target as DisplayObject));
}
public function animateIn():void{
header.scaleX = (header.scaleY = 3);
header.alpha = 0;
selector.alpha = 0;
nextLevelButton.alpha = (replayLevelButton.alpha = (mainMenuButton.alpha = 0));
nextLevelButton.mouseEnabled = (replayLevelButton.mouseEnabled = (mainMenuButton.mouseEnabled = false));
nextLevelButton.scaleX = (replayLevelButton.scaleX = (mainMenuButton.scaleX = 4));
nextLevelButton.scaleY = (replayLevelButton.scaleY = (mainMenuButton.scaleY = 4));
TweenMax.to(header, 0.5, {scaleX:1, scaleY:1, alpha:1, delay:1, ease:Expo.easeIn});
TweenMax.to(nextLevelButton, 0.5, {scaleX:1, scaleY:1, alpha:1, delay:1.2, ease:Expo.easeIn});
TweenMax.to(replayLevelButton, 0.5, {scaleX:1, scaleY:1, alpha:1, delay:1.3, ease:Expo.easeIn});
TweenMax.to(mainMenuButton, 0.5, {scaleX:1, scaleY:1, alpha:1, delay:1.4, ease:Expo.easeIn, onComplete:enableMenu});
TweenMax.to(selector, 0.3, {alpha:1, delay:1.8});
}
private function onClickNextLevel(_arg1:Event):void{
nextLevel();
}
public function animateOut():void{
TweenMax.to(selector, 0.2, {alpha:0});
TweenMax.to(header, 0.4, {y:"-300", ease:Expo.easeIn});
TweenMax.to(nextLevelButton, 0.4, {y:"500", delay:0.5, ease:Expo.easeIn});
TweenMax.to(replayLevelButton, 0.4, {y:"500", delay:0.4, ease:Expo.easeIn});
TweenMax.to(mainMenuButton, 0.4, {y:"500", delay:0.3, ease:Expo.easeIn});
mouseChildren = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function mainMenu():void{
animateOut();
TweenMax.delayedCall(1.5, dispatchEvent, [new Event(Constants.EVENT_MAIN_MENU, true)]);
}
private function onClickReplayLevel(_arg1:Event):void{
replayLevel();
}
}
}//package asfiles.ui
Section 16
//IngameUI (asfiles.ui.IngameUI)
package asfiles.ui {
import flash.display.*;
import com.greensock.*;
import flash.text.*;
public class IngameUI extends Sprite {
public var dashLabel:TextField;
public var distanceCounter:DistanceCounter;
public var acorn1:MovieClip;
public var acorn2:MovieClip;
public var acorn4:MovieClip;
private var _hearts:Array;
private var _heartCount:int;// = -1
public var acorn3:MovieClip;
private var _acornCount:int;// = -1
private var _acorns:Array;
public var heart1:MovieClip;
public var heart2:MovieClip;
public var heart3:MovieClip;
public var heartBg:MovieClip;
public function IngameUI(){
if (stage){
return;
};
initialize();
}
public function set acorns(_arg1:int):void{
var _local2:Boolean;
var _local3:int;
if (_arg1 != _acornCount){
_local3 = 0;
while (_local3 < _acorns.length) {
_local2 = (_arg1 > _local3);
if (((_local2) && ((_acorns[_local3].alpha < 1)))){
TweenMax.killTweensOf(_acorns[_local3]);
TweenMax.to(_acorns[_local3], 0, {tint:0xFFFFFF, alpha:1});
TweenMax.to(_acorns[_local3], 0.5, {tint:null});
} else {
if (!_local2){
TweenMax.to(_acorns[_local3], 0.3, {tint:0, alpha:0.7});
};
};
_local3++;
};
};
_acornCount = _arg1;
dashLabel.visible = (_acornCount > 0);
}
public function reset():void{
var _local1:int;
while (_local1 < _acorns.length) {
TweenMax.killTweensOf(_acorns[_local1]);
TweenMax.to(_acorns[_local1], 0, {tint:0, alpha:0.7});
_local1++;
};
_acornCount = 0;
}
public function set hearts(_arg1:int):void{
var _local2:Boolean;
var _local3:int;
if (_arg1 != _heartCount){
_local3 = 0;
while (_local3 < _hearts.length) {
_local2 = (_arg1 > _local3);
TweenMax.killTweensOf(_hearts[_local3]);
if (_local2){
TweenMax.to(_hearts[_local3], 0, {alpha:1});
TweenMax.to(_hearts[_local3], 0, {tint:0xFFFFFF});
TweenMax.to(_hearts[_local3], 0.5, {tint:null});
} else {
if (!_local2){
TweenMax.to(_hearts[_local3], 0.3, {tint:0, alpha:0.7});
};
};
_local3++;
};
};
_heartCount = _arg1;
}
public function set easyMode(_arg1:Boolean):void{
heartBg.visible = _arg1;
heart1.visible = _arg1;
heart2.visible = _arg1;
heart3.visible = _arg1;
}
private function initialize():void{
_acorns = [acorn1, acorn2, acorn3, acorn4];
_hearts = [heart1, heart2, heart3];
}
public function set distance(_arg1:int):void{
distanceCounter.label.text = (String(_arg1) + " m");
}
public function set distanceMode(_arg1:Boolean):void{
distanceCounter.visible = _arg1;
}
}
}//package asfiles.ui
Section 17
//MainMenu (asfiles.ui.MainMenu)
package asfiles.ui {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import flash.net.*;
import asfiles.util.*;
import com.greensock.easing.*;
public class MainMenu extends Sprite {
private var _activeOption:DisplayObject;
public var moreGamesButton:MovieClip;
public var endlessButton:MovieClip;
public var storyButton:MovieClip;
public var selector:MovieClip;
public function MainMenu(){
if (stage){
return;
};
initialize();
}
public function enableMenu():void{
storyButton.mouseEnabled = true;
endlessButton.mouseEnabled = true;
_activeOption = storyButton;
selector.y = _activeOption.y;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function onClickMoreGames(_arg1:MouseEvent):void{
visitSponsor();
}
private function highlightOption(_arg1:DisplayObject):void{
_activeOption = _arg1;
TweenMax.to(selector, 0.3, {y:_arg1.y, ease:Back.easeOut});
}
private function onClickEndless(_arg1:Event):void{
startEndless();
}
private function visitSponsor():void{
navigateToURL(new URLRequest("http://www.newgrounds.com"));
}
private function initialize():void{
storyButton.buttonMode = true;
endlessButton.buttonMode = true;
moreGamesButton.buttonMode = true;
storyButton.addEventListener(MouseEvent.CLICK, onClickStory);
endlessButton.addEventListener(MouseEvent.CLICK, onClickEndless);
moreGamesButton.addEventListener(MouseEvent.CLICK, onClickMoreGames);
storyButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
endlessButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
moreGamesButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
selector.mouseEnabled = false;
selector.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage);
}
private function selectOption():void{
switch (_activeOption){
case storyButton:
disableMenu();
startStory();
break;
case endlessButton:
disableMenu();
startEndless();
break;
case moreGamesButton:
visitSponsor();
break;
};
}
private function onClickStory(_arg1:Event):void{
startStory();
}
private function onRemovedFromStage(_arg1:Event):void{
disableMenu();
}
private function toggleUp():void{
switch (_activeOption){
case endlessButton:
highlightOption(storyButton);
break;
case storyButton:
highlightOption(moreGamesButton);
break;
case moreGamesButton:
highlightOption(endlessButton);
break;
};
}
private function onKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 38){
toggleUp();
} else {
if (_arg1.keyCode == 40){
toggleDown();
};
};
if (_arg1.keyCode == 32){
selectOption();
};
}
private function toggleDown():void{
switch (_activeOption){
case storyButton:
highlightOption(endlessButton);
break;
case endlessButton:
highlightOption(moreGamesButton);
break;
case moreGamesButton:
highlightOption(storyButton);
break;
};
}
private function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
TweenMax.killTweensOf(selector);
enableMenu();
}
private function onRolloverOption(_arg1:Event):void{
highlightOption((_arg1.target as DisplayObject));
}
public function disableMenu():void{
storyButton.mouseEnabled = false;
endlessButton.mouseEnabled = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function startEndless():void{
dispatchEvent(new Event(Constants.EVENT_START_ENDLESS, true));
}
private function startStory():void{
dispatchEvent(new Event(Constants.EVENT_START_GAME, true));
}
}
}//package asfiles.ui
Section 18
//PauseMenu (asfiles.ui.PauseMenu)
package asfiles.ui {
import flash.display.*;
import flash.events.*;
import com.greensock.*;
import flash.geom.*;
import asfiles.util.*;
import com.greensock.easing.*;
public class PauseMenu extends Sprite {
public var toggleMusicButton:StandardMenuButton;
public var bg:MovieClip;
private var _capture:Bitmap;
public var mainMenuButton:StandardMenuButton;
public var header:MovieClip;
public var selector:MovieClip;
public var toggleSfxButton:StandardMenuButton;
public var controls:MovieClip;
private var _activeOption:DisplayObject;
public var resumeButton:StandardMenuButton;
public function PauseMenu(){
if (stage){
return;
};
initialize();
buildInterface();
}
private function onClickMainMenu(_arg1:Event):void{
mainMenu();
}
private function enableMenu():void{
resumeButton.mouseEnabled = true;
toggleMusicButton.mouseEnabled = true;
toggleSfxButton.mouseEnabled = true;
mainMenuButton.mouseEnabled = true;
_activeOption = resumeButton;
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function prevOption():void{
switch (_activeOption){
case resumeButton:
highlightOption(mainMenuButton);
break;
case toggleMusicButton:
highlightOption(resumeButton);
break;
case toggleSfxButton:
highlightOption(toggleMusicButton);
break;
case mainMenuButton:
highlightOption(toggleSfxButton);
break;
};
}
private function highlightOption(_arg1:DisplayObject):void{
_activeOption = _arg1;
TweenMax.to(selector, 0.3, {y:_arg1.y, ease:Back.easeOut});
}
private function nextOption():void{
switch (_activeOption){
case resumeButton:
highlightOption(toggleMusicButton);
break;
case toggleMusicButton:
highlightOption(toggleSfxButton);
break;
case toggleSfxButton:
highlightOption(mainMenuButton);
break;
case mainMenuButton:
highlightOption(resumeButton);
break;
};
}
private function initialize():void{
alpha = 0;
resumeButton.text = "RESUME";
toggleMusicButton.text = "TOGGLE MUSIC";
toggleSfxButton.text = "TOGGLE SOUND";
mainMenuButton.text = "MAIN MENU";
resumeButton.addEventListener(MouseEvent.CLICK, onClickResume);
toggleMusicButton.addEventListener(MouseEvent.CLICK, onClickToggleMusic);
toggleSfxButton.addEventListener(MouseEvent.CLICK, onClickToggleSfx);
mainMenuButton.addEventListener(MouseEvent.CLICK, onClickMainMenu);
resumeButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
toggleMusicButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
toggleSfxButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
mainMenuButton.addEventListener(MouseEvent.ROLL_OVER, onRolloverOption);
selector.mouseEnabled = false;
selector.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onClickToggleMusic(_arg1:Event):void{
toggleMusic();
}
private function selectOption():void{
switch (_activeOption){
case resumeButton:
resume();
break;
case toggleMusicButton:
toggleMusic();
break;
case toggleSfxButton:
toggleSfx();
break;
case mainMenuButton:
mainMenu();
break;
};
}
private function toggleSfx():void{
dispatchEvent(new Event(Constants.EVENT_TOGGLE_SOUND, true));
}
private function onAddedToStage(_arg1:Event):void{
_capture.bitmapData.draw(stage, new Matrix(1, 0, 0, 1, 20));
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onKeyPressed(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 38){
prevOption();
} else {
if (_arg1.keyCode == 40){
nextOption();
};
};
if (_arg1.keyCode == 32){
selectOption();
};
}
private function onRolloverOption(_arg1:Event):void{
highlightOption((_arg1.target as DisplayObject));
}
public function animateIn():void{
header.scaleX = (header.scaleY = 3);
header.alpha = 0;
selector.alpha = 0;
resumeButton.alpha = (toggleMusicButton.alpha = (toggleSfxButton.alpha = (mainMenuButton.alpha = 0)));
resumeButton.mouseEnabled = (toggleMusicButton.mouseEnabled = (toggleSfxButton.mouseEnabled = (mainMenuButton.mouseEnabled = false)));
TweenMax.to(this, 0.2, {alpha:1});
TweenMax.to(header, 0.4, {scaleX:1, scaleY:1, alpha:1, delay:0.1, ease:Expo.easeIn});
TweenMax.to(resumeButton, 0.3, {scaleX:1, scaleY:1, alpha:1, delay:0.2, ease:Expo.easeIn});
TweenMax.to(toggleMusicButton, 0.3, {scaleX:1, scaleY:1, alpha:1, delay:0.3, ease:Expo.easeIn});
TweenMax.to(toggleSfxButton, 0.3, {scaleX:1, scaleY:1, alpha:1, delay:0.4, ease:Expo.easeIn});
TweenMax.to(mainMenuButton, 0.3, {scaleX:1, scaleY:1, alpha:1, delay:0.5, ease:Expo.easeIn, onComplete:enableMenu});
TweenMax.to(selector, 0.3, {alpha:1, delay:0.6});
}
private function onClickToggleSfx(_arg1:Event):void{
toggleSfx();
}
private function buildInterface():void{
var _local1:Sprite;
_local1 = new Sprite();
_capture = new Bitmap(new BitmapData((Constants.APP_W + 40), Constants.APP_H));
_local1.addChildAt(_capture, 0);
_local1.x = -20;
addChildAt(_local1, 0);
TweenMax.to(_local1, 0, {blurFilter:{blurX:15, blurY:5, quality:1}});
}
public function animateOut():void{
TweenMax.to(selector, 0.2, {alpha:0});
TweenMax.to(header, 0.4, {y:"-300", ease:Expo.easeIn});
TweenMax.to(resumeButton, 0.3, {y:"500", delay:0.5, ease:Expo.easeIn});
TweenMax.to(toggleMusicButton, 0.3, {y:"500", delay:0.4, ease:Expo.easeIn});
TweenMax.to(toggleSfxButton, 0.3, {y:"500", delay:0.3, ease:Expo.easeIn});
TweenMax.to(mainMenuButton, 0.3, {y:"500", delay:0.2, ease:Expo.easeIn});
TweenMax.to(this, 0.4, {alpha:0, delay:0.7});
mouseChildren = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
private function toggleMusic():void{
dispatchEvent(new Event(Constants.EVENT_TOGGLE_MUSIC, true));
}
private function mainMenu():void{
animateOut();
TweenMax.delayedCall(1, dispatchEvent, [new Event(Constants.EVENT_MAIN_MENU, true)]);
}
private function resume():void{
animateOut();
TweenMax.delayedCall(1, dispatchEvent, [new Event(Constants.EVENT_UNPAUSE, true)]);
}
private function onClickResume(_arg1:Event):void{
resume();
}
}
}//package asfiles.ui
Section 19
//PreloaderCredits (asfiles.ui.PreloaderCredits)
package asfiles.ui {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class PreloaderCredits extends Sprite {
public var rollJordan:MovieClip;
public var rollNewgrounds:MovieClip;
public var rollAaron:MovieClip;
public function PreloaderCredits(){
initialize();
}
private function onRolloutButton(_arg1:MouseEvent):void{
(_arg1.target as MovieClip).gotoAndStop(1);
}
private function onClickJordan(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://jordand.newgrounds.com"), "_blank");
}
private function onClickAaron(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://negativeone.newgrounds.com"), "_blank");
}
private function initialize():void{
initButton(rollJordan);
initButton(rollAaron);
initButton(rollNewgrounds);
rollJordan.addEventListener(MouseEvent.CLICK, onClickJordan);
rollAaron.addEventListener(MouseEvent.CLICK, onClickAaron);
rollNewgrounds.addEventListener(MouseEvent.CLICK, onClickNewgrounds);
}
private function onRolloverButton(_arg1:MouseEvent):void{
(_arg1.target as MovieClip).gotoAndStop(2);
}
private function onClickNewgrounds(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.newgrounds.com"), "_blank");
}
private function initButton(_arg1:MovieClip):void{
_arg1.gotoAndStop(1);
_arg1.buttonMode = true;
_arg1.mouseChildren = false;
_arg1.addEventListener(MouseEvent.ROLL_OVER, onRolloverButton);
_arg1.addEventListener(MouseEvent.ROLL_OUT, onRolloutButton);
}
}
}//package asfiles.ui
Section 20
//StandardMenuButton (asfiles.ui.StandardMenuButton)
package asfiles.ui {
import flash.display.*;
import flash.text.*;
public class StandardMenuButton extends Sprite {
public var label:TextField;
public function StandardMenuButton(){
if (stage){
return;
};
initialize();
}
public function set text(_arg1:String):void{
label.text = _arg1;
}
public function get text():String{
return (label.text);
}
private function initialize():void{
label.mouseEnabled = false;
buttonMode = true;
}
}
}//package asfiles.ui
Section 21
//AudioManager (asfiles.util.AudioManager)
package asfiles.util {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import com.greensock.*;
import flash.net.*;
import com.greensock.easing.*;
import asfiles.media.*;
public class AudioManager {
private static var allSounds:Array;
private static var cachedSounds:Array;
private static var activeSounds:Array;
public static var muted:Boolean = false;
private static var useCaching:Boolean;
public static function killSounds(_arg1:Array):void{
var _local2:int;
while (_local2 < _arg1.length) {
killSound(_arg1[_local2]);
_local2++;
};
}
private static function getCachingId(_arg1:String):String{
return (_arg1.split(".").join(""));
}
public static function pauseAll():void{
var _local1:int;
while (_local1 < allSounds.length) {
if (allSounds[_local1] != null){
allSounds[_local1].pause();
};
_local1++;
};
}
public static function init(_arg1:Boolean=true):void{
useCaching = _arg1;
activeSounds = new Array();
cachedSounds = new Array();
allSounds = new Array();
}
public static function killSound(_arg1:String):void{
var _local2:String = getCachingId(_arg1);
if (((!((cachedSounds[_local2] == null))) && (!((cachedSounds[_local2] == undefined))))){
if (cachedSounds[_local2].loadCompleted){
cachedSounds[_local2].stop();
};
};
}
private static function onSoundLoaded(_arg1:Event):void{
}
public static function toggleMuting(_arg1:Boolean):void{
muted = _arg1;
if (muted){
muteAllSounds();
} else {
unmuteAllSounds();
};
}
public static function get isMuted():Boolean{
return (muted);
}
public static function unpauseAll():void{
var _local1:int;
while (_local1 < allSounds.length) {
if (allSounds[_local1] != null){
allSounds[_local1].unpause();
};
_local1++;
};
}
public static function muteAllSounds(_arg1:Boolean=false):void{
var _local2:int;
while (_local2 < allSounds.length) {
if (allSounds[_local2] != null){
if (!_arg1){
allSounds[_local2].stop();
};
if (allSounds[_local2].channel){
TweenMax.to(allSounds[_local2].channel, 0, {volume:0});
};
};
_local2++;
};
}
public static function batchPreload(_arg1:Array, _arg2:int=10):void{
var _local3:int;
while ((((_local3 < _arg1.length)) && ((_local3 < _arg2)))) {
_local3++;
};
}
public static function changeVolume(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false){
var _local5:String = getCachingId(_arg1);
if (((!((cachedSounds[_local5] == null))) && (!((cachedSounds[_local5] == undefined))))){
cachedSounds[_local5].retainedVol = _arg2;
if (!muted){
if (((((!((cachedSounds[_local5] == undefined))) && (!((cachedSounds[_local5] == null))))) && ((cachedSounds[_local5].channel is SoundChannel)))){
if (_arg4){
TweenMax.to(cachedSounds[_local5].channel, _arg3, {volume:_arg2, onComplete:killSound, onCompleteParams:[_arg1]});
} else {
TweenMax.to(cachedSounds[_local5].channel, _arg3, {volume:_arg2});
};
};
};
};
}
public static function destroyAllSounds():void{
var _local1:int;
while (_local1 < allSounds.length) {
if (allSounds[_local1] != null){
allSounds[_local1].stop();
allSounds[_local1] = null;
};
_local1++;
};
allSounds = [];
}
public static function unmuteAllSounds():void{
trace("[AudioManager] unmuteAllSounds");
var _local1:int;
while (_local1 < allSounds.length) {
if (allSounds[_local1] != null){
if (allSounds[_local1].channel){
if (allSounds[_local1].soundParams.repeat){
allSounds[_local1].channel = allSounds[_local1].play(0, 9999);
};
TweenMax.to(allSounds[_local1].channel, 0, {volume:allSounds[_local1].retainedVol});
};
};
_local1++;
};
}
public static function playSoundFromLibrary(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false):SoundChannel{
var _local4:Class;
var _local5:SoundChannel;
var _local6:Sound;
if (((muted) && (!(_arg3)))){
return (null);
};
_local4 = (getDefinitionByName(_arg1) as Class);
_local6 = (new (_local4) as Sound);
if (_arg2){
_local5 = _local6.play(0, 9999);
} else {
_local5 = _local6.play();
};
if ((_local6 is ManagedSound)){
(_local6 as ManagedSound).channel = _local5;
activeSounds.push(_local6);
};
if (!_arg3){
allSounds.push(_local5);
};
return (_local5);
}
private static function onSoundCompleted(_arg1:Event):void{
}
}
}//package asfiles.util
Section 22
//Constants (asfiles.util.Constants)
package asfiles.util {
public class Constants {
public static const MEDAL_SQUIRRICANE:String = "Here Comes the Story of the Squirricane";
public static const MEDAL_100:String = "Hundred Meter Dash";
public static const APP_H:Number = 480;
public static const EVENT_LEVEL_RESTART:String = "levelRestart";
public static const EVENT_UNPAUSE:String = "unpause";
public static const APP_W:Number = 720;
public static const DISTANCE_LEVEL:String = "distance";
public static const EVENT_MAIN_MENU:String = "gotoMainMenu";
public static const MEDAL_JAY:String = "Firing Up a Jay";
public static const EVENT_WARN_DISTANCE_DEATH:String = "warnDistanceDeath";
public static const EVENT_START_HARD:String = "startHard";
public static const EVENT_SHOW_CONTROLS:String = "showControls";
public static const EVENT_START_GAME:String = "startGame";
public static const MEDAL_WINTER:String = "A Harsh Winter Coming On";
public static const EVENT_WARN_DEATH:String = "warnDeath";
public static const MEDAL_CRAFTY:String = "Crafty as a Fox";
public static const EVENT_START_EASY:String = "startEasy";
public static const EVENT_PAUSE:String = "pause";
public static const EVENT_START_ENDLESS:String = "startEndless";
public static const MEDAL_CASUAL:String = "Fly Me To the Moon";
public static const EVENT_CHANGE_MUSIC:String = "changeMusic";
public static const EVENT_LEVEL_WIN:String = "levelWin";
public static const EVENT_SHOW_INGAME_UI:String = "showIngameUI";
public static const MEDAL_250:String = "Quarter Kilometer";
public static const EVENT_SHAKE:String = "shake";
public static const EVENT_TOGGLE_SOUND:String = "toggleSound";
public static const MEDAL_HARDCORE:String = "Brass Nuts";
public static const EVENT_LEVEL_LOSE:String = "levelLose";
public static const EVENT_DISTANCE_DEATH:String = "distanceDeath";
public static const MEDAL_GOLDEN:String = "The Golden Path";
public static const FIRST_LEVEL:String = "dragon_intro";
public static const EVENT_TOGGLE_MUSIC:String = "toggleMusic";
}
}//package asfiles.util
Section 23
//GlobalVars (asfiles.util.GlobalVars)
package asfiles.util {
public class GlobalVars {
public static var golden:Array;
public static var hardcore:Boolean = false;
public static var smashes:uint = 0;
public static var deaths:uint = 0;
}
}//package asfiles.util
Section 24
//BackgroundLayer (asfiles.world.BackgroundLayer)
package asfiles.world {
import flash.display.*;
public class BackgroundLayer extends Sprite {
public var baseY:Number;// = 0
public var speedFactor:Number;// = 1
}
}//package asfiles.world
Section 25
//Bird (asfiles.world.Bird)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class Bird extends Obstacle {
private var _xSpeed:Number;// = -1
private var _ySpeed:Number;// = -5
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
var _local3:BirdFluff;
super.gotoAndStop(_arg1, _arg2);
AudioManager.playSoundFromLibrary("BirdEscapeSound");
if (parent){
_local3 = new BirdFluff();
parent.addChild(_local3);
_local3.x = x;
_local3.y = y;
_local3.scaleX = (_local3.scaleY = scaleX);
};
}
override public function update():void{
if (currentFrame != 2){
return;
};
x = (x + _xSpeed);
y = (y + _ySpeed);
if ((((y > -800)) && ((_ySpeed > -30)))){
_xSpeed = (_xSpeed * 1.2);
_ySpeed = (_ySpeed * 1.2);
};
}
}
}//package asfiles.world
Section 26
//DistanceLevel (asfiles.world.DistanceLevel)
package asfiles.world {
import flash.display.*;
import flash.utils.*;
import com.greensock.*;
import asfiles.model.*;
public class DistanceLevel extends SquirrelLevel {
protected var _currentWidth:Number;// = 0
private var _lastUpper:Platform;
private var _difficulty:Number;// = 0
private var _lastLower:Platform;
protected static const UPPER_SEP:Number = 195;
protected static const MIN_SPACING:Number = 90;
protected static const FIRST_PLATFORM:String = "BrownBuilding";
protected static const NUM_UNIQUE:int = 3;
protected static const MAX_PLAT_Y:Number = 550;
protected static const MAX_SPACING:Number = 1000;
protected static const MAX_JUMP:Number = 110;
protected static const SECTION_WIDTH:Number = 10000;
protected static const SECTION_PREEMPT:Number = 6500;
protected static const MIN_PLAT_Y:Number = 0;
protected static const MAX_DIFFICULTY:Number = 9;
protected static const SAFE_ZONE:Number = 200;
public function DistanceLevel(){
initialize();
}
protected function getPlatformData(_arg1:int):XML{
switch (_arg1){
case 0:
return (<platform classRef="BrownBuilding" w="2248" surf="-807"/>
);
case 1:
return (<platform classRef="GreenBuilding" w="800" surf="-1047"/>
);
case 2:
return (<platform classRef="RedBuilding" w="1891" surf="-931"/>
);
};
return (<platform classRef="BrownBuilding" w="2248" surf="-807"/>
);
}
override public function advance(_arg1:Number):Boolean{
var _local2:Boolean = super.advance((_arg1 * (1 + (_difficulty / 20))));
if (-(_platformHolder.x) > (_currentWidth - SECTION_PREEMPT)){
buildSection();
};
_difficulty = Math.min(MAX_DIFFICULTY, (-(_platformHolder.x) / (SECTION_WIDTH * 1.5)));
return (_local2);
}
protected function getRandomPlatform():Platform{
var _local1:XML;
var _local2:Class;
var _local3:MovieClip;
var _local4:Platform;
_local1 = getPlatformData(Math.floor((Math.random() * 3)));
_local2 = (getDefinitionByName(_local1.@classRef.toString()) as Class);
_local3 = (new (_local2) as MovieClip);
_local4 = new Platform();
_local4.clip = _local3;
_local4.setContent(_local1);
_local4.surface = ((Number(_local1.@surf) * _local3.scaleY) + _offsetY);
return (_local4);
}
protected function getRandomObstacle():Obstacle{
var _local1:XML;
var _local2:Class;
var _local3:Obstacle;
var _local4:int = (((Math.random() * _difficulty) > 4)) ? 5 : 3;
_local1 = getObstacleData(Math.floor((Math.random() * _local4)));
_local2 = (getDefinitionByName(_local1.@classRef.toString()) as Class);
_local3 = (new (_local2) as Obstacle);
_local3.y = (_local3.y + Number(_local1.@y.toString()));
return (_local3);
}
override protected function buildInterface():void{
super.buildInterface();
}
protected function getObstacleData(_arg1:int):XML{
switch (_arg1){
case 0:
return (<obstacle classRef="asfiles.world.Vent" y="-32"/>
);
case 1:
return (<obstacle classRef="asfiles.world.Rock" y="3"/>
);
case 2:
return (<obstacle classRef="asfiles.world.Bird" y="6"/>
);
case 3:
return (<obstacle classRef="asfiles.world.LeftBird" y="-35"/>
);
case 4:
return (<obstacle classRef="asfiles.world.RightBird" y="-35"/>
);
};
return (<obstacle classRef="Vent"/>
);
}
protected function initialize():void{
}
protected function placeSequentially(_arg1:Platform, _arg2:Platform, _arg3:Number, _arg4:Number=0):Boolean{
var _local5:Number = Math.max(MIN_PLAT_Y, (_arg1.clip.y - MAX_JUMP));
var _local6:Number = Math.min(_arg3, Math.min(MAX_PLAT_Y, (_arg1.clip.y + 250)));
var _local7:Number = (((_arg1.clip.x + _arg1.width) + 80) + (Math.random() * 240));
if ((((_local6 <= _local5)) || ((((_arg4 > 0)) && ((Math.abs((_arg4 - _local7)) > 400)))))){
return (false);
};
_arg2.clip.x = Math.max(_arg4, _local7);
_arg2.clip.y = (_local5 + (Math.random() * (_local6 - _local5)));
return (true);
}
override public function buildLevel(_arg1:XML):void{
super.buildLevel(_arg1);
_distance = Number.MAX_VALUE;
_lastLower = _platforms[0];
buildSection();
}
protected function buildSection():void{
var _local1:Platform;
var _local2:MovieClip;
var _local3:MovieClip;
var _local5:Number;
var _local6:*;
var _local4:Number = 0;
while (_currentWidth < (-(_platformHolder.x) + SECTION_WIDTH)) {
_local6 = _lastLower;
_local1 = getRandomPlatform();
if (_lastLower.clip.y > (MAX_PLAT_Y - 180)){
_local5 = _lastLower.clip.y;
} else {
_local5 = MAX_PLAT_Y;
};
placeSequentially(_lastLower, _local1, _local5);
_local1.surface = (_local1.surface + _local1.clip.y);
_platformHolder.addChild(_local1.clip);
_platforms.push(_local1);
populatePlatform(_local1);
_lastLower = _local1;
_currentWidth = Math.max(_currentWidth, (_local1.x + _local1.width));
_local1 = getRandomPlatform();
if (_lastUpper){
if (((((_lastUpper.clip.x + _lastUpper.width) < ((_lastLower.x + _lastLower.width) + 100))) && ((Math.random() > 0.1)))){
if (_lastUpper.clip.y > (MAX_PLAT_Y - 250)){
_local5 = _lastUpper.clip.y;
} else {
_local5 = MAX_PLAT_Y;
};
if (placeSequentially(_lastUpper, _local1, Math.min(_local5, Math.max((_lastLower.clip.y - UPPER_SEP), (_lastUpper.clip.y - MAX_JUMP))), (_lastLower.clip.x + 51))){
_local1.surface = (_local1.surface + _local1.clip.y);
_platformHolder.addChildAt(_local1.clip, 0);
_platforms.push(_local1);
_lastUpper = _local1;
populatePlatform(_local1);
} else {
_lastUpper = null;
};
} else {
_lastUpper = null;
};
} else {
if (_local6.clip.y > ((MIN_PLAT_Y * 0.66) + (MAX_PLAT_Y * 0.33))){
if (placeSequentially(_local6, _local1, (_lastLower.clip.y - UPPER_SEP), (_lastLower.clip.x + 51))){
_local1.surface = (_local1.surface + _local1.clip.y);
_platformHolder.addChildAt(_local1.clip, 0);
_platforms.push(_local1);
_lastUpper = _local1;
populatePlatform(_local1);
} else {
_lastUpper = null;
};
};
};
_currentWidth = Math.max(_currentWidth, (_local1.x + _local1.width));
};
while ((_platforms[0].x + _platformHolder.x) < -(SECTION_WIDTH)) {
_platformHolder.removeChild(_platforms[0].clip);
_platforms.splice(0, 1);
};
while ((((((_platforms.length > 0)) && ((_obstacles.length > 0)))) && ((((_obstacles[0].x < _platforms[0].x)) || ((Math.abs(_obstacles[0].y) > 3000)))))) {
_obstacleHolder.removeChild(_obstacles[0]);
_obstacles.splice(0, 1);
};
while ((((((_platforms.length > 0)) && ((_pickups.length > 0)))) && ((_pickups[0].x < _platforms[0].x)))) {
_pickupHolder.removeChild(_pickups[0]);
_pickups.splice(0, 1);
};
}
protected function populatePlatform(_arg1:Platform):void{
var _local2:MovieClip;
var _local3:Acorn;
var _local4:Class;
var _local5:Number = (_arg1.width - (SAFE_ZONE / 2));
var _local6:Array = [];
var _local7:Number = 0;
_local5 = (_local5 - (MIN_SPACING + (MIN_SPACING * Math.random())));
while (_local5 > (SAFE_ZONE / (1 + (_difficulty / 10)))) {
if (Math.random() < ((_difficulty / 15) + 1)){
_local2 = getRandomObstacle();
_local2.x = (_arg1.clip.x + _local5);
_obstacleHolder.addChild(_local2);
_local2.y = (_local2.y + (_arg1.surface - _offsetY));
_local2.components = [_obstacleHolder, _local2];
_local7 = (_local7 / 3);
_local7 = (_local7 + (_local6.length * 150));
if (_local6.length > 0){
_local7 = (_local7 + ((MAX_SPACING - Math.abs((_local2.x - _local6[(_local6.length - 1)].x))) / 4));
};
_local6.push(_local2);
_obstacles.push(_local2);
};
_local5 = (_local5 - ((MIN_SPACING + _local7) + ((MAX_SPACING - MIN_SPACING) * Math.random())));
};
var _local8:int = int((Math.random() * 2.5));
for (;_local8 < _local6.length;_local8++) {
if (((((Math.random() * 11) > _difficulty)) && ((Math.random() > 0.5)))){
_local3 = new Acorn();
_local3.components = [_pickupHolder, _local3];
_local3.stop();
if ((((((_local8 > 0)) && ((Math.abs((_local6[int(_local8)].x - _local6[int((_local8 - 1))].x)) > 250)))) && ((Math.random() > 0.5)))){
_local3.x = ((_local6[int(_local8)].x + _local6[int((_local8 - 1))].x) / 2);
_local3.y = ((_arg1.surface - _offsetY) - 40);
} else {
if (Math.random() > (_difficulty / 10)){
_local3.x = _local6[int(_local8)].x;
_local3.y = ((_arg1.surface - _offsetY) - 165);
} else {
if (((((_local6[0].x - _arg1.x) > 320)) && ((Math.random() > (_difficulty / 10))))){
_local3.x = (_arg1.x + 150);
_local3.y = ((_arg1.surface - _offsetY) - 40);
} else {
continue;
};
};
};
TweenMax.to(_local3, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:4, blurY:4, strength:3}});
_pickupHolder.addChild(_local3);
_pickups.push(_local3);
_local8 = (_local8 + ((1 + Math.round(Math.random())) + int((Math.random() * (_difficulty / 3)))));
};
};
}
}
}//package asfiles.world
Section 27
//ElectricPad (asfiles.world.ElectricPad)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class ElectricPad extends Obstacle {
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
if (Number(_arg1) == 2){
AudioManager.playSoundFromLibrary("ShockSound");
};
}
}
}//package asfiles.world
Section 28
//EyeballEnemy (asfiles.world.EyeballEnemy)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class EyeballEnemy extends Obstacle {
public var spriteIn:MovieClip;
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
if (Number(_arg1) == 2){
AudioManager.playSoundFromLibrary("SloppyHitSound");
};
}
}
}//package asfiles.world
Section 29
//Fireball (asfiles.world.Fireball)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class Fireball extends Obstacle {
public var originY:Number;
private var _ySpeed:Number;// = 20
private var _xSpeed:Number;// = 30
public var hitCoreInternal:MovieClip;
private static const STD_SPEED:Number = 20;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
AudioManager.playSoundFromLibrary("FireballHitSound");
}
override public function update():void{
if (currentFrame == 1){
x = (x + _xSpeed);
y = (y + _ySpeed);
};
}
}
}//package asfiles.world
Section 30
//LeftBird (asfiles.world.LeftBird)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class LeftBird extends Obstacle {
private var _xSpeed:Number;// = -5
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
AudioManager.playSoundFromLibrary("BirdHitSound");
}
override public function update():void{
if (((((!((currentFrame == 1))) || (!(parent)))) || ((Math.abs((parent.x + x)) > 1300)))){
return;
};
x = (x + _xSpeed);
}
}
}//package asfiles.world
Section 31
//Obstacle (asfiles.world.Obstacle)
package asfiles.world {
import asfiles.*;
public class Obstacle extends Collidable {
public static const FRM_IDLE:int = 1;
public static const FRM_BROKEN:int = 2;
public static const FRM_RUINED:int = 3;
public function Obstacle(){
initialize();
}
private function initialize():void{
stop();
}
public function update():void{
}
public function strike(_arg1:Boolean=false):void{
if (currentFrame == FRM_IDLE){
if (_arg1){
gotoAndStop(FRM_RUINED);
} else {
gotoAndStop(FRM_BROKEN);
};
};
}
}
}//package asfiles.world
Section 32
//RightBird (asfiles.world.RightBird)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class RightBird extends Obstacle {
private var _xSpeed:Number;// = 5
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
AudioManager.playSoundFromLibrary("BirdHitSound");
}
override public function update():void{
if (((((!((currentFrame == 1))) || (!(parent)))) || ((Math.abs((parent.x + x)) > 1300)))){
return;
};
x = (x + _xSpeed);
}
}
}//package asfiles.world
Section 33
//Rock (asfiles.world.Rock)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class Rock extends Obstacle {
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
if (Number(_arg1) == 2){
AudioManager.playSoundFromLibrary("BluntHitSound");
};
}
}
}//package asfiles.world
Section 34
//Satellite (asfiles.world.Satellite)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class Satellite extends Obstacle {
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
if (Number(_arg1) == 2){
AudioManager.playSoundFromLibrary("MetalHitSound");
};
}
}
}//package asfiles.world
Section 35
//Shellder (asfiles.world.Shellder)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class Shellder extends Obstacle {
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
if (Number(_arg1) == 2){
AudioManager.playSoundFromLibrary("SloppyHitSound");
};
}
}
}//package asfiles.world
Section 36
//SquirrelLevel (asfiles.world.SquirrelLevel)
package asfiles.world {
import flash.display.*;
import flash.utils.*;
import com.greensock.*;
import asfiles.model.*;
import asfiles.util.*;
import asfiles.effects.*;
public class SquirrelLevel extends Sprite {
protected var _deathY:Number;
public var state:int;// = 0
public var id:String;
protected var _platformHolder:Sprite;
protected var _pickupHolder:Sprite;
protected var _pickups:Array;
protected var _content:XML;
protected var _obstacleHolder:Sprite;
protected var _obstacles:Array;
protected var _trashplosion:Trashplosion;
protected var _distance:Number;
protected var _platforms:Array;
public var extendPlatforms:Boolean;// = true
protected var _offsetY:Number;
protected var _backgroundLayers:Array;
public static const STATE_RUNNING:int = 1;
public static const STATE_COMPLETE:int = 2;
public static const STATE_FAILED:int = 3;
public static const STATE_STARTING:int = 0;
public function SquirrelLevel(){
buildInterface();
}
public function advance(_arg1:Number):Boolean{
var _local2:int;
if (x > -(Number(_distance))){
_platformHolder.x = (_platformHolder.x - _arg1);
_obstacleHolder.x = (_obstacleHolder.x - _arg1);
_pickupHolder.x = (_pickupHolder.x - _arg1);
_local2 = 0;
while (_local2 < _backgroundLayers.length) {
_backgroundLayers[_local2].x = (_platformHolder.x * _backgroundLayers[_local2].speedFactor);
_local2++;
};
return (true);
};
return (!((((state == STATE_RUNNING)) || ((state == STATE_COMPLETE)))));
}
public function addCharacter(_arg1:DisplayObject):void{
addChildAt(_arg1, (getChildIndex(_obstacleHolder) + 1));
}
protected function destroyChildren(_arg1:DisplayObject):void{
var _local2:int;
if (!_arg1){
return;
};
if ((_arg1 is DisplayObjectContainer)){
_local2 = 0;
while (_local2 < DisplayObjectContainer(_arg1).numChildren) {
destroyChildren(DisplayObjectContainer(_arg1).getChildAt(_local2));
_local2++;
};
};
if (_arg1.parent){
_arg1.parent.removeChild(_arg1);
};
if ((_arg1 is MovieClip)){
MovieClip(_arg1).stop();
};
}
public function get offsetY():Number{
return (_offsetY);
}
public function getTiersAt(_arg1:Number):Array{
var _local2:Array = [];
var _local3:int;
while (_local3 < _platforms.length) {
if ((_arg1 + Constants.APP_W) < _platforms[_local3].x){
break;
};
if ((((_arg1 >= _platforms[_local3].x)) && ((_arg1 <= ((_platforms[_local3].x + _platforms[_local3].width) + (extendPlatforms) ? 40 : 0))))){
_local2.push(_platforms[_local3].surface);
};
_local3++;
};
return (_local2);
}
public function addTrashplosion(_arg1:Number):Boolean{
if (!_trashplosion){
_trashplosion = new Trashplosion();
_trashplosion.x = _arg1;
_trashplosion.y = ((_deathY - y) + 400);
addChild(_trashplosion);
return (true);
};
_trashplosion.update();
return (false);
}
public function get isCity():Boolean{
return ((_content.@environment.toString() == "city"));
}
public function buildLevel(_arg1:XML):void{
var _local2:Class;
var _local3:MovieClip;
var _local4:MovieClip;
var _local5:MovieClip;
var _local6:BackgroundLayer;
var _local7:Platform;
var _local8:XML;
var _local9:XML;
var _local10:XML;
var _local11:XML;
_content = _arg1;
_offsetY = Number(_arg1.@offsetY);
_deathY = Number(_arg1.@deathY);
_distance = Number(_arg1.@distance);
id = _arg1.@id;
extendPlatforms = true;
_platforms = [];
for each (_local8 in _arg1.platforms.platform) {
_local2 = (getDefinitionByName(_local8.@classRef.toString()) as Class);
_local3 = (new (_local2) as MovieClip);
_local7 = new Platform();
_local7.clip = _local3;
_local7.setContent(_local8);
if (!(_local8.@depth.toString().length > 0)){
_platformHolder.addChild(_local3);
} else {
_platformHolder.addChildAt(_local3, Number(_local8.@depth));
};
_local7.surface = (((Number(_local8.@surf) * _local3.scaleY) + _local3.y) + Number(_arg1.@offsetY));
_platforms.push(_local7);
};
_platformHolder.y = Number(_arg1.@offsetY);
_obstacles = [];
for each (_local9 in _arg1.obstacles.obstacle) {
_local2 = (getDefinitionByName(_local9.@classRef.toString()) as Class);
_local5 = (new (_local2) as MovieClip);
_local5.x = Number(_local9.@x);
_local5.y = Number(_local9.@y);
_local5.scaleX = ((_local9.@scaleX.toString().length > 0)) ? Number(_local9.@scaleX) : 1;
_local5.components = [_obstacleHolder, _local5];
_obstacleHolder.addChild(_local5);
_obstacles.push(_local5);
};
_obstacleHolder.y = Number(_arg1.@offsetY);
_pickups = [];
for each (_local10 in _arg1.pickups.pickup) {
_local2 = (getDefinitionByName(_local10.@classRef.toString()) as Class);
_local4 = (new (_local2) as MovieClip);
_local4.x = Number(_local10.@x);
_local4.y = Number(_local10.@y);
_local4.stop();
_local4.components = [_pickupHolder, _local4];
if (_local10.@classRef.toString() == "Acorn"){
TweenMax.to(_local4, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:4, blurY:4, strength:3}});
};
_pickupHolder.addChild(_local4);
_pickups.push(_local4);
};
_pickupHolder.y = Number(_arg1.@offsetY);
_backgroundLayers = [];
for each (_local11 in _arg1.background.layer) {
_local2 = (getDefinitionByName(_local11.@classRef.toString()) as Class);
_local6 = (new (_local2) as BackgroundLayer);
_local6.speedFactor = Number(_local11.@speed.toString());
_local6.y = Number(_local11.@offsetY.toString());
_local6.baseY = _local6.y;
_local6.scaleX = (_local6.scaleY = Number(_local11.@scale.toString()));
addChildAt(_local6, 0);
_backgroundLayers.push(_local6);
};
}
public function get obstacles():Array{
return (_obstacles);
}
public function update():void{
var _local1:int;
_local1 = 0;
while (_local1 < _obstacles.length) {
_obstacles[_local1].update();
_local1++;
};
if (isCity){
checkDarkness();
};
}
public function destroyFire():void{
var _local1:int;
while (_local1 < _obstacles.length) {
if ((_obstacles[_local1] is Fireball)){
_obstacles[_local1].strike(true);
};
_local1++;
};
}
public function start():void{
state = STATE_RUNNING;
}
public function get deathY():Number{
return (_deathY);
}
protected function buildInterface():void{
_platformHolder = new Sprite();
_platformHolder.cacheAsBitmap = true;
addChild(_platformHolder);
_obstacleHolder = new Sprite();
_obstacleHolder.cacheAsBitmap = true;
addChild(_obstacleHolder);
_pickupHolder = new Sprite();
_pickupHolder.cacheAsBitmap = true;
addChild(_pickupHolder);
}
override public function set y(_arg1:Number):void{
super.y = _arg1;
var _local2:int;
while (_local2 < _backgroundLayers.length) {
_backgroundLayers[_local2].y = (_backgroundLayers[_local2].baseY - (super.y * (1 - _backgroundLayers[_local2].speedFactor)));
_local2++;
};
}
protected function checkDarkness():void{
}
public function addFire(_arg1:Number, _arg2:Number):void{
var _local3:Fireball = new Fireball();
_obstacleHolder.addChild(_local3);
_local3.x = (_arg1 - _obstacleHolder.x);
_local3.y = (_arg2 - _obstacleHolder.y);
_local3.originY = _local3.y;
_local3.components = [_obstacleHolder, _local3];
_obstacles.push(_local3);
}
override public function get x():Number{
return (_platformHolder.x);
}
override public function get y():Number{
return (_obstacleHolder.y);
}
public function destroy():void{
var _local1:int;
if (_platforms){
_local1 = 0;
while (_local1 < _obstacles.length) {
destroyChildren(_obstacles[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < _pickups.length) {
destroyChildren(_pickups[_local1]);
_local1++;
};
_local1 = 0;
while (_local1 < _platforms.length) {
destroyChildren(_platforms[_local1].clip);
_local1++;
};
_local1 = 0;
while (_local1 < _backgroundLayers.length) {
removeChild(_backgroundLayers[_local1]);
_local1++;
};
};
_platformHolder.x = 0;
_obstacleHolder.x = 0;
_pickupHolder.x = 0;
if (_trashplosion){
_trashplosion.destroy();
removeChild(_trashplosion);
_trashplosion = null;
};
}
public function cleanPast():void{
var _local1:int;
while (_local1 < _platforms.length) {
if (_platforms[_local1].x < ((-(_platformHolder.x) + _platforms[_local1].width) + 100)){
_platforms[_local1].visible = false;
_platforms.splice(_local1, 1);
_local1--;
};
_local1++;
};
}
public function get pickups():Array{
return (_pickups);
}
}
}//package asfiles.world
Section 37
//SquirrelWorld (asfiles.world.SquirrelWorld)
package asfiles.world {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.greensock.*;
import flash.geom.*;
import com.relish.events.*;
import asfiles.model.*;
import asfiles.util.*;
import asfiles.char.*;
public class SquirrelWorld extends Sprite {
public var easyMode:Boolean;// = true
private var _shakeAmount:int;// = 0
private var _firstPlay:Boolean;// = true
private var _paused:Boolean;// = false
private var _isCity:Boolean;
private var _level:SquirrelLevel;
private var _cutscene:MovieClip;
private var _currentLevel:String;
private var _dragon:Dragon;
private var _squirrel:Squirrel;
private var _ufo:UFO;
private static const LEVEL_END_WAIT:Number = 3;
private static const LEVEL_START_WAIT:Number = 1.2;
private static const SKIP_KEY:Number = 32;
public function SquirrelWorld(){
initialize();
buildInterface();
}
private function onUFOShoot(_arg1:Event):void{
_squirrel.hitObstacle();
}
private function onWarnDistanceDeath(_arg1:Event):void{
_arg1.stopPropagation();
_level.extendPlatforms = false;
}
private function onSquirrelDeath(_arg1:Event):void{
restartLevel();
dispatchEvent(new Event(Constants.EVENT_LEVEL_LOSE, true));
}
private function onPressKey(_arg1:KeyboardEvent):void{
if ((((((_arg1.keyCode == SKIP_KEY)) && (_cutscene))) && ((_cutscene.currentFrame < (_cutscene.totalFrames - 10))))){
_cutscene.gotoAndStop(_cutscene.totalFrames);
};
}
private function onDragonSpit(_arg1:Event):void{
AudioManager.playSoundFromLibrary("DragonSpitSound");
_level.addFire((_dragon.x + Dragon.FIRE_OFFSET_X), (_dragon.y + Dragon.FIRE_OFFSET_Y));
}
private function completeLevel():void{
trace("[SquirrelWorld] completeLevel");
if (_squirrel.acorns >= 4){
API.unlockMedal(Constants.MEDAL_WINTER);
};
_level.state = SquirrelLevel.STATE_COMPLETE;
_level.destroyFire();
_dragon.muzzle();
_ufo.muzzle();
_squirrel.muzzle();
dispatchEvent(new Event(Constants.EVENT_LEVEL_WIN, true));
TweenMax.delayedCall(4, pause);
}
private function initialize():void{
addEventListener(Constants.EVENT_SHAKE, onShake);
addEventListener(Constants.EVENT_WARN_DISTANCE_DEATH, onWarnDistanceDeath);
}
public function get canPause():Boolean{
return (((!(_paused)) && ((_level.state == SquirrelLevel.STATE_RUNNING))));
}
public function nextLevel():void{
if (_currentLevel == "credits_video"){
dispatchEvent(new Event(Constants.EVENT_MAIN_MENU, true));
} else {
loadLevel(LevelData.getNextLevelId(_currentLevel));
};
}
private function checkObstacleCollisions():void{
var _local2:Array;
var _local4:int;
var _local1:Array = _level.obstacles;
var _local3:int;
while (_local3 < _local1.length) {
if ((((_local1[_local3].currentFrame <= 2)) && (_squirrel.checkCollision(_local1[_local3])))){
if ((((_local1[_local3] is VenusPlant)) && (!(_squirrel.isDashing)))){
_squirrel.visible = false;
};
if ((((_local1[_local3] is Fireball)) || ((_local1[_local3] is ElectricPad)))){
_squirrel.hitObstacle("burning");
} else {
_squirrel.hitObstacle("dying", (_local1[_local3] is VenusPlant));
};
_local1[_local3].strike(_squirrel.isDashing);
_shakeAmount = 8;
if (_squirrel.isDashing){
GlobalVars.smashes++;
if (GlobalVars.smashes == 3){
API.unlockMedal(Constants.MEDAL_SQUIRRICANE);
};
};
} else {
if ((_local1[_local3] is Fireball)){
_local2 = _level.getTiersAt(((-(_level.x) + _local1[_local3].x) + _local1[_local3].parent.x));
_local4 = 0;
while (_local4 < _local2.length) {
if (((((_local1[_local3].y + _local1[_local3].parent.y) > _local2[_local4])) && ((_local2[_local4] > ((_local1[_local3].originY + _local1[_local3].parent.y) + 100))))){
if (_local1[_local3].currentFrame == 1){
dispatchEvent(new Event(Constants.EVENT_SHAKE, true));
};
_local1[_local3].strike(true);
};
_local4++;
};
_local4 = 0;
while (_local4 < _local1.length) {
if (((!((_local3 == _local4))) && ((_local1[_local3].checkCollision(_local1[_local4]) > 0)))){
if (_local1[_local3].currentFrame == 1){
dispatchEvent(new Event(Constants.EVENT_SHAKE, true));
};
if ((_local1[_local4] is Bird)){
API.unlockMedal(Constants.MEDAL_JAY);
};
_local1[_local3].strike(true);
_local1[_local4].strike(true);
};
_local4++;
};
};
};
_local3++;
};
}
public function loadLevel(_arg1:String):void{
var _local2:XML;
TweenMax.killDelayedCallsTo(loadLevel);
if (_cutscene){
_cutscene.stop();
if (contains(_cutscene)){
removeChild(_cutscene);
};
_cutscene = null;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onPressKey);
} else {
if (_level){
if (contains(_level)){
removeChild(_level);
};
_level.destroy();
};
};
if (_arg1 == Constants.DISTANCE_LEVEL){
_level = new DistanceLevel();
_squirrel.enduranceMode = true;
_dragon.enduranceMode = true;
} else {
_level = new SquirrelLevel();
_squirrel.easyMode = easyMode;
_squirrel.enduranceMode = false;
_dragon.enduranceMode = false;
};
_local2 = LevelData.getLevel(_arg1);
_currentLevel = _arg1;
if (_local2.@music.toString().length > 0){
dispatchEvent(new InfoEvent(Constants.EVENT_CHANGE_MUSIC, {id:_local2.@music.toString()}, true));
};
if (_local2.@type.toString() == "level"){
dispatchEvent(new InfoEvent(Constants.EVENT_SHOW_INGAME_UI, {state:true}, true));
TweenMax.to(_level, 0, {tint:0xFFFFFF});
TweenMax.to(_level, 0.5, {tint:null});
_level.buildLevel(_local2);
_isCity = _level.isCity;
addChild(_level);
_squirrel.reset();
_squirrel.x = 440;
_squirrel.y = 260;
_level.addCharacter(_squirrel);
_dragon.reset();
_dragon.x = -230;
_dragon.y = 130;
_dragon.maxY = (_level.deathY - 500);
_level.addCharacter(_dragon);
_ufo.reset();
_ufo.x = -230;
_ufo.y = 130;
_ufo.maxY = (_level.deathY - 500);
_level.addCharacter(_ufo);
_level.y = Math.max(0, Math.max(0, (250 - _squirrel.y)));
if (_firstPlay){
_firstPlay = false;
pause(true);
dispatchEvent(new Event(Constants.EVENT_SHOW_CONTROLS, true));
} else {
TweenMax.delayedCall(LEVEL_START_WAIT, _level.start);
pause(true, LEVEL_START_WAIT);
};
} else {
createCutscene(_local2);
};
}
public function get acorns():int{
return (_squirrel.acorns);
}
public function get squirrelHearts():int{
return ((((_level) && ((_level.state == SquirrelLevel.STATE_FAILED)))) ? 0 : _squirrel.hearts);
}
private function checkPickupCollisions():void{
var _local1:Array = _level.pickups;
var _local2:int;
while (_local2 < _local1.length) {
if (_squirrel.checkCollision(_local1[_local2])){
if ((_local1[_local2] is Spring)){
_squirrel.springUp();
AudioManager.playSoundFromLibrary("SpringSound");
} else {
if ((_local1[_local2] is GoldenAcorn)){
AudioManager.playSoundFromLibrary("GoldenAcornSound");
GlobalVars.golden[(levelIndex - 1)] = true;
checkAllGolden();
} else {
AudioManager.playSoundFromLibrary("AcornSound");
};
_squirrel.collectAcorn((_local1[_local2] is GoldenAcorn));
};
_local1[_local2].gotoAndStop(2);
};
_local2++;
};
}
private function buildInterface():void{
_level = new SquirrelLevel();
_squirrel = new Squirrel();
_squirrel.addEventListener(Squirrel.DEATH, onSquirrelDeath);
_squirrel.components = [_squirrel];
_dragon = new Dragon();
_dragon.addEventListener(Dragon.SPIT, onDragonSpit);
_ufo = new UFO();
_ufo.addEventListener(UFO.SHOOT, onUFOShoot);
}
private function createCutscene(_arg1:XML):void{
var _local2:Class = (getDefinitionByName(_arg1.@class_ref.toString()) as Class);
_cutscene = (new (_local2) as MovieClip);
_cutscene.scaleX = (_cutscene.scaleY = (1 / scaleY));
_cutscene.x = (Number(_arg1.@x.toString()) / scaleX);
_cutscene.y = (Number(_arg1.@y.toString()) / scaleX);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onPressKey);
addChild(_cutscene);
dispatchEvent(new InfoEvent(Constants.EVENT_SHOW_INGAME_UI, {state:false}, true));
if (_arg1.@id.toString() == "ending_video"){
API.unlockMedal(Constants.MEDAL_CASUAL);
if (GlobalVars.deaths <= 0){
API.unlockMedal(Constants.MEDAL_CRAFTY);
};
if (GlobalVars.hardcore){
API.unlockMedal(Constants.MEDAL_HARDCORE);
};
};
}
public function get levelIndex():int{
return ((Number(_level.id) + 1));
}
private function checkAllGolden():void{
var _local1:int;
while (_local1 < 6) {
if (GlobalVars.golden[_local1] == false){
return;
};
_local1++;
};
trace(GlobalVars.golden);
API.unlockMedal(Constants.MEDAL_GOLDEN);
}
public function get distance():int{
return (int((_level.x / -450)));
}
public function pause(_arg1:Boolean=true, _arg2:Number=0):void{
TweenMax.killDelayedCallsTo(pause);
_paused = _arg1;
if (_arg1){
_squirrel.pause();
} else {
_squirrel.resume();
if (_level.state == SquirrelLevel.STATE_STARTING){
_level.start();
};
};
if (_arg2 > 0){
TweenMax.delayedCall(_arg2, pause, [!(_arg1)]);
};
}
private function onShake(_arg1:Event):void{
_arg1.stopPropagation();
_shakeAmount = 10;
}
private function updateCutscene():void{
if (_cutscene.currentFrame == _cutscene.totalFrames){
nextLevel();
};
}
private function updateLevel():void{
if ((((_level.state == SquirrelLevel.STATE_STARTING)) || (_paused))){
return;
};
if (_level.state != SquirrelLevel.STATE_COMPLETE){
if (((!(_level.advance(_squirrel.speed))) && ((_level.state == SquirrelLevel.STATE_RUNNING)))){
completeLevel();
};
_level.y = Math.max(0, Math.max(0, (250 - _squirrel.y)));
};
_level.update();
_squirrel.tiers = _level.getTiersAt((-(_level.x) + _squirrel.x));
_squirrel.update();
if (_level.state == SquirrelLevel.STATE_COMPLETE){
_squirrel.advance((_squirrel.speed * 1.4));
} else {
if (_squirrel.y > _level.deathY){
if (_level.addTrashplosion(_squirrel.x)){
AudioManager.playSoundFromLibrary("JunkCrashSound");
AudioManager.playSoundFromLibrary("GameOverSound");
_shakeAmount = 12;
if ((_level is DistanceLevel)){
if (_level.state != SquirrelLevel.STATE_FAILED){
TweenMax.delayedCall(2, dispatchEvent, [new Event(Constants.EVENT_DISTANCE_DEATH, true)]);
_level.extendPlatforms = false;
_level.state = SquirrelLevel.STATE_FAILED;
};
} else {
_level.state = SquirrelLevel.STATE_FAILED;
TweenMax.delayedCall(2, restartLevel);
dispatchEvent(new Event(Constants.EVENT_WARN_DEATH, true));
};
};
};
};
if (_isCity){
_dragon.squirrelPoint = new Point(_squirrel.x, _squirrel.y);
_dragon.x = (_dragon.x - _squirrel.speed);
_dragon.update();
if (_level.state == SquirrelLevel.STATE_COMPLETE){
_dragon.advance((_squirrel.speed * 1.2));
};
} else {
_ufo.squirrelPoint = new Point(_squirrel.x, _squirrel.y);
_ufo.x = (_ufo.x - _squirrel.speed);
_ufo.update();
if (_level.state == SquirrelLevel.STATE_COMPLETE){
_ufo.advance((_squirrel.speed * 1.2));
};
};
checkObstacleCollisions();
checkPickupCollisions();
if (_shakeAmount > 0){
_shakeAmount--;
x = (((_shakeAmount % 2) == 0)) ? _shakeAmount : -(_shakeAmount);
};
}
public function restartLevel():void{
loadLevel(_currentLevel);
pause(true, LEVEL_START_WAIT);
}
public function mainLoop():void{
if (_cutscene){
updateCutscene();
} else {
updateLevel();
};
}
}
}//package asfiles.world
Section 38
//Vent (asfiles.world.Vent)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class Vent extends Obstacle {
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
if (Number(_arg1) == 2){
AudioManager.playSoundFromLibrary("MetalHitSound");
};
}
}
}//package asfiles.world
Section 39
//VenusPlant (asfiles.world.VenusPlant)
package asfiles.world {
import flash.display.*;
import asfiles.util.*;
public class VenusPlant extends Obstacle {
public var hitCoreInternal:MovieClip;
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
super.gotoAndStop(_arg1, _arg2);
if (Number(_arg1) == 2){
AudioManager.playSoundFromLibrary("PlantEatSound");
};
}
}
}//package asfiles.world
Section 40
//Collidable (asfiles.Collidable)
package asfiles {
import flash.display.*;
import flash.geom.*;
public class Collidable extends MovieClip {
public var components:Array;
public static const HITCORE_NAME:String = "hitCoreInternal";
public function Collidable(){
components = [];
super();
}
public function get hitCore():DisplayObject{
return (getChildByName(HITCORE_NAME));
}
public function checkCollision(_arg1:Collidable):int{
var _local2:Rectangle;
var _local3:Rectangle;
if ((((hitCore == null)) || ((_arg1.hitCore == null)))){
return (0);
};
_local2 = rectangle;
_local3 = _arg1.rectangle;
if ((((((((_local2.x < (_local3.x + _local3.width))) && (((_local2.x + _local2.width) > _local3.x)))) && ((_local2.y < (_local3.y + _local3.height))))) && (((_local2.y + _local2.height) > _local3.y)))){
return (1);
};
return (0);
}
public function get rectangle():Rectangle{
var _local1:Number = 0;
var _local2:Number = 0;
var _local3:int;
while (_local3 < components.length) {
_local1 = (_local1 + components[_local3].x);
_local2 = (_local2 + components[_local3].y);
_local3++;
};
_local1 = (_local1 + hitCore.x);
_local2 = (_local2 + hitCore.y);
return (new Rectangle(_local1, _local2, hitCore.width, hitCore.height));
}
}
}//package asfiles
Section 41
//PreloadBar (asfiles.PreloadBar)
package asfiles {
import flash.display.*;
import flash.events.*;
public class PreloadBar extends Sprite {
public static const EVENT_GAME_LOADED:String = "gameLoaded";
public function PreloadBar(){
initialize();
}
private function initialize():void{
scaleX = 0;
addEventListener(Event.ENTER_FRAME, onCheckProgress);
}
private function onCheckProgress(_arg1:Event):void{
trace(((Math.floor((root.loaderInfo.bytesLoaded / 1000)) + " / ") + Math.floor((root.loaderInfo.bytesTotal / 1000))));
if (root.loaderInfo.bytesTotal > 8){
if (root.loaderInfo.bytesLoaded >= root.loaderInfo.bytesTotal){
buttonMode = true;
scaleX = 1;
removeEventListener(Event.ENTER_FRAME, onCheckProgress);
dispatchEvent(new Event(EVENT_GAME_LOADED));
} else {
scaleX = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
};
};
}
}
}//package asfiles
Section 42
//SquirrelGame (asfiles.SquirrelGame)
package asfiles {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import com.newgrounds.components.*;
import flash.media.*;
import com.greensock.*;
import com.relish.events.*;
import com.nflash.*;
import asfiles.world.*;
import asfiles.util.*;
import asfiles.ui.*;
import flash.text.*;
import flash.ui.*;
public class SquirrelGame extends MovieClip {
public var __id1_:APIConnector;
private var _muteMusic:Boolean;// = false
private var _world:SquirrelWorld;
private var _mainMenu:MainMenu;
public var loadingLabel:TextField;
private var _music:SoundChannel;
public var __id2_:MedalPopup;
private var _endOfLevelMenu:EndOfLevelMenu;
private var _controlsMessage:ControlsMessage;
public var preloadBar:PreloadBar;
private var _ingameUI:IngameUI;
private var _deathMessage:DeathMessage;
private var _difficultyMenu:DifficultyMenu;
private var _musicId:String;
private var _pauseMenu:PauseMenu;
private var _muteSound:Boolean;// = false
private var _distanceDeathMenu:DistanceDeathMenu;
public function SquirrelGame(){
addFrameScript(0, frame1, 1, frame2, 8, frame9);
SoundMixer.soundTransform = new SoundTransform(0);
preloadBar.addEventListener(PreloadBar.EVENT_GAME_LOADED, onGameLoaded);
__setProp___id1__Scene1_newgrounds_0();
__setProp___id2__Scene1_newgrounds_0();
}
private function onChangeMusic(_arg1:InfoEvent):void{
changeMusic(_arg1.data.id);
}
private function onShowIngameUI(_arg1:InfoEvent):void{
_ingameUI.visible = _arg1.data.state;
}
private function onShowControls(_arg1:Event):void{
_controlsMessage = new ControlsMessage();
addChild(_controlsMessage);
}
private function initialize():void{
var _local1:ContextMenu = new ContextMenu();
_local1.hideBuiltInItems();
this.contextMenu = _local1;
stop();
AudioManager.init(false);
addEventListener(Constants.EVENT_LEVEL_WIN, onLevelWin);
addEventListener(Constants.EVENT_WARN_DEATH, onLevelLose);
addEventListener(Constants.EVENT_DISTANCE_DEATH, onDistanceDeath);
addEventListener(Constants.EVENT_LEVEL_RESTART, onLevelRestart);
addEventListener(Constants.EVENT_START_GAME, onStartGame);
addEventListener(Constants.EVENT_START_ENDLESS, onStartEndless);
addEventListener(Constants.EVENT_START_EASY, onStartEasy);
addEventListener(Constants.EVENT_START_HARD, onStartHard);
addEventListener(Constants.EVENT_PAUSE, onPauseGame);
addEventListener(Constants.EVENT_UNPAUSE, onUnpauseGame);
addEventListener(Constants.EVENT_MAIN_MENU, onSelectMainMenu);
addEventListener(Constants.EVENT_SHOW_CONTROLS, onShowControls);
addEventListener(Constants.EVENT_SHOW_INGAME_UI, onShowIngameUI);
addEventListener(Constants.EVENT_CHANGE_MUSIC, onChangeMusic);
addEventListener(Constants.EVENT_TOGGLE_MUSIC, onToggleMusic);
addEventListener(Constants.EVENT_TOGGLE_SOUND, onToggleSound);
}
function frame2(){
gotoAndStop(1);
}
private function onLevelLose(_arg1:Event):void{
if (_deathMessage.currentFrame == 1){
GlobalVars.deaths++;
addChild(_deathMessage);
_deathMessage.gotoAndPlay(2);
};
}
private function initGame():void{
initialize();
buildInterface();
addChild(_mainMenu);
SoundMixer.stopAll();
SoundMixer.soundTransform = new SoundTransform(1);
changeMusic("MenuMusic");
KeyboardReader.init(stage);
}
private function onSelectReplayLevel(_arg1:Event):void{
AudioManager.destroyAllSounds();
removeChild(_endOfLevelMenu);
_endOfLevelMenu = null;
_world.restartLevel();
stage.focus = this;
}
private function destroyEndOfLevelMenu():void{
if (_endOfLevelMenu){
_endOfLevelMenu.removeEventListener(EndOfLevelMenu.EVENT_NEXT_LEVEL, onSelectNextLevel);
_endOfLevelMenu.removeEventListener(EndOfLevelMenu.EVENT_REPLAY_LEVEL, onSelectReplayLevel);
if (contains(_endOfLevelMenu)){
removeChild(_endOfLevelMenu);
};
_endOfLevelMenu = null;
};
}
private function onStartEndless(_arg1:Event):void{
startGame(true);
}
private function onSelectMainMenu(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, onEnter);
AudioManager.destroyAllSounds();
destroyEndOfLevelMenu();
if (contains(_world)){
removeChild(_world);
};
if (((_distanceDeathMenu) && (contains(_distanceDeathMenu)))){
removeChild(_distanceDeathMenu);
};
addChild(_mainMenu);
_mainMenu.enableMenu();
if (contains(_ingameUI)){
removeChild(_ingameUI);
};
changeMusic("MenuMusic");
}
private function onLevelWin(_arg1:Event):void{
if (!_endOfLevelMenu){
_endOfLevelMenu = new EndOfLevelMenu();
_endOfLevelMenu.x = ((Constants.APP_W - _endOfLevelMenu.width) / 2);
_endOfLevelMenu.y = ((Constants.APP_H - _endOfLevelMenu.height) / 2);
_endOfLevelMenu.addEventListener(EndOfLevelMenu.EVENT_NEXT_LEVEL, onSelectNextLevel);
_endOfLevelMenu.addEventListener(EndOfLevelMenu.EVENT_REPLAY_LEVEL, onSelectReplayLevel);
_endOfLevelMenu.level = _world.levelIndex;
_endOfLevelMenu.animateIn();
addChild(_endOfLevelMenu);
};
}
private function onEnter(_arg1:Event):void{
mainLoop();
}
private function onToggleSound(_arg1:Event):void{
_muteSound = !(_muteSound);
if (_muteSound){
AudioManager.destroyAllSounds();
AudioManager.playSoundFromLibrary("SoundOffSound", false, true);
} else {
AudioManager.playSoundFromLibrary("SoundOnSound", false, true);
};
AudioManager.muted = _muteSound;
}
private function onClickToBegin(_arg1:MouseEvent):void{
preloadBar.removeEventListener(MouseEvent.CLICK, onClickToBegin);
gotoAndPlay(3);
}
private function onUnpauseGame(_arg1:Event):void{
if (_pauseMenu){
if (contains(_pauseMenu)){
removeChild(_pauseMenu);
};
_pauseMenu = null;
};
_world.pause(false);
}
private function onStartHard(_arg1:Event):void{
startGame(false, false);
}
private function changeMusic(_arg1:String):void{
var _local2:Array;
trace(("[SquirrelGame] changeMusic - " + _arg1));
_local2 = ["IntroMusic", "TransitionMusic", "EndingMusic"];
if ((((((_music == null)) || (!((_musicId == _arg1))))) && (!(_muteMusic)))){
if (_music != null){
_music.stop();
};
_music = AudioManager.playSoundFromLibrary(_arg1, (_local2.indexOf(_arg1) < 0), true);
};
_musicId = _arg1;
}
private function onGameLoaded(_arg1:Event):void{
preloadBar.removeEventListener(PreloadBar.EVENT_GAME_LOADED, onGameLoaded);
preloadBar.addEventListener(MouseEvent.CLICK, onClickToBegin);
loadingLabel.text = "CLICK HERE TO BEGIN!";
}
function __setProp___id1__Scene1_newgrounds_0(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.movieId = "17407:I2gbkKu6";
__id1_.debugMode = true;
__id1_.encryptionKey = "ZfUk2o6afJzFS9jbS4YISDglGF1yTusb";
__id1_.movieVersion = "1.0";
__id1_.showConnectingPopup = false;
__id1_.useErrorPopup = true;
__id1_.useMedalPopup = true;
__id1_.useFakeSession = true;
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
private function onStartGame(_arg1:Event):void{
_mainMenu.disableMenu();
addChild(_difficultyMenu);
_difficultyMenu.enableMenu();
}
private function onSelectNextLevel(_arg1:Event):void{
AudioManager.destroyAllSounds();
destroyEndOfLevelMenu();
_world.nextLevel();
stage.focus = this;
}
private function onStartEasy(_arg1:Event):void{
startGame(false, true);
}
private function onDistanceDeath(_arg1:Event):void{
if (((!(_distanceDeathMenu)) || (!(contains(_distanceDeathMenu))))){
_distanceDeathMenu = new DistanceDeathMenu();
_distanceDeathMenu.distance = _world.distance;
addChild(_distanceDeathMenu);
_distanceDeathMenu.animateIn();
_world.pause(true);
if (_world.distance >= 100){
API.unlockMedal(Constants.MEDAL_100);
};
if (_world.distance >= 250){
API.unlockMedal(Constants.MEDAL_250);
};
};
}
private function onToggleMusic(_arg1:Event):void{
_muteMusic = !(_muteMusic);
if (((_muteMusic) && (_music))){
_music.stop();
_music = null;
AudioManager.playSoundFromLibrary("SoundOffSound", false, true);
} else {
if (_musicId.length > 0){
changeMusic(_musicId);
};
};
}
private function onPauseGame(_arg1:Event):void{
if (_world.canPause){
_world.pause(true);
_deathMessage.gotoAndStop(1);
_pauseMenu = new PauseMenu();
_pauseMenu.animateIn();
addChild(_pauseMenu);
};
}
private function onLevelRestart(_arg1:Event):void{
if (((_distanceDeathMenu) && (contains(_distanceDeathMenu)))){
removeChild(_distanceDeathMenu);
};
_world.restartLevel();
}
private function buildInterface():void{
if (((preloadBar) && (contains(preloadBar)))){
removeChild(preloadBar);
};
_world = new SquirrelWorld();
_world.scaleX = (_world.scaleY = 0.6);
_world.y = (_world.y + 50);
_deathMessage = new DeathMessage();
_deathMessage.y = -60;
_deathMessage.stop();
TweenMax.to(_deathMessage, 0, {glowFilter:{color:0xFFFFFF, alpha:1, blurX:5, blurY:5, strength:5}});
addChild(_deathMessage);
_mainMenu = new MainMenu();
_difficultyMenu = new DifficultyMenu();
_ingameUI = new IngameUI();
}
function frame1(){
stop();
}
private function startGame(_arg1:Boolean, _arg2:Boolean=true):void{
addEventListener(Event.ENTER_FRAME, onEnter);
addChild(_world);
_world.easyMode = _arg2;
_ingameUI.distanceMode = _arg1;
_ingameUI.easyMode = ((_arg1) || (_arg2));
GlobalVars.golden = [false, false, false, false, false, false];
GlobalVars.hardcore = !(_arg2);
GlobalVars.deaths = 0;
if (contains(_difficultyMenu)){
_difficultyMenu.disableMenu();
removeChild(_difficultyMenu);
};
addChild(_ingameUI);
_world.loadLevel((_arg1) ? Constants.DISTANCE_LEVEL : Constants.FIRST_LEVEL);
removeChild(_mainMenu);
}
function __setProp___id2__Scene1_newgrounds_0(){
try {
__id2_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id2_.popupTime = 4;
try {
__id2_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame9(){
stop();
initGame();
}
private function mainLoop():void{
_world.mainLoop();
stage.focus = stage;
_ingameUI.distance = _world.distance;
_ingameUI.acorns = _world.acorns;
_ingameUI.hearts = _world.squirrelHearts;
}
}
}//package asfiles
Section 43
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import flash.utils.*;
import com.adobe.utils.*;
public class MD5 {
public static var digest:ByteArray;
public static function hash(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (hashBinary(_local2));
}
public static function hashBytes(_arg1:ByteArray):String{
return (hashBinary(_arg1));
}
public static function hashBinary(_arg1:ByteArray):String{
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local2 = 1732584193;
var _local3 = -271733879;
var _local4 = -1732584194;
var _local5 = 271733878;
var _local10:Array = createBlocks(_arg1);
var _local11:int = _local10.length;
var _local12:int;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
digest = new ByteArray();
digest.writeInt(_local2);
digest.writeInt(_local3);
digest.writeInt(_local4);
digest.writeInt(_local5);
digest.position = 0;
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:ByteArray):Array{
var _local2:Array = new Array();
var _local3:int = (_arg1.length * 8);
var _local4 = 0xFF;
var _local5:int;
while (_local5 < _local3) {
_local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32)));
_local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3;
return (_local2);
}
}
}//package com.adobe.crypto
Section 44
//PNGEncoder (com.adobe.images.PNGEncoder)
package com.adobe.images {
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class PNGEncoder {
private static var crcTable:Array;
private static var crcTableComputed:Boolean = false;
public static function encode(_arg1:BitmapData):ByteArray{
var _local6:uint;
var _local7:int;
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(2303741511);
_local2.writeUnsignedInt(218765834);
var _local3:ByteArray = new ByteArray();
_local3.writeInt(_arg1.width);
_local3.writeInt(_arg1.height);
_local3.writeUnsignedInt(134610944);
_local3.writeByte(0);
writeChunk(_local2, 1229472850, _local3);
var _local4:ByteArray = new ByteArray();
var _local5:int;
while (_local5 < _arg1.height) {
_local4.writeByte(0);
if (!_arg1.transparent){
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | 0xFF)));
_local7++;
};
} else {
_local7 = 0;
while (_local7 < _arg1.width) {
_local6 = _arg1.getPixel32(_local7, _local5);
_local4.writeUnsignedInt(uint((((_local6 & 0xFFFFFF) << 8) | (_local6 >>> 24))));
_local7++;
};
};
_local5++;
};
_local4.compress();
writeChunk(_local2, 1229209940, _local4);
writeChunk(_local2, 1229278788, null);
return (_local2);
}
private static function writeChunk(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray):void{
var _local8:uint;
var _local9:uint;
var _local10:uint;
if (!crcTableComputed){
crcTableComputed = true;
crcTable = [];
_local9 = 0;
while (_local9 < 0x0100) {
_local8 = _local9;
_local10 = 0;
while (_local10 < 8) {
if ((_local8 & 1)){
_local8 = uint((uint(3988292384) ^ uint((_local8 >>> 1))));
} else {
_local8 = uint((_local8 >>> 1));
};
_local10++;
};
crcTable[_local9] = _local8;
_local9++;
};
};
var _local4:uint;
if (_arg3 != null){
_local4 = _arg3.length;
};
_arg1.writeUnsignedInt(_local4);
var _local5:uint = _arg1.position;
_arg1.writeUnsignedInt(_arg2);
if (_arg3 != null){
_arg1.writeBytes(_arg3);
};
var _local6:uint = _arg1.position;
_arg1.position = _local5;
_local8 = 4294967295;
var _local7:int;
while (_local7 < (_local6 - _local5)) {
_local8 = uint((crcTable[((_local8 ^ _arg1.readUnsignedByte()) & uint(0xFF))] ^ uint((_local8 >>> 8))));
_local7++;
};
_local8 = uint((_local8 ^ uint(4294967295)));
_arg1.position = _local6;
_arg1.writeUnsignedInt(_local8);
}
}
}//package com.adobe.images
Section 45
//JSON (com.adobe.serialization.json.JSON)
package com.adobe.serialization.json {
public class JSON {
public static function encode(_arg1:Object):String{
var _local2:JSONEncoder = new JSONEncoder(_arg1);
return (_local2.getString());
}
public static function decode(_arg1:String){
var _local2:JSONDecoder = new JSONDecoder(_arg1);
return (_local2.getValue());
}
}
}//package com.adobe.serialization.json
Section 46
//JSONDecoder (com.adobe.serialization.json.JSONDecoder)
package com.adobe.serialization.json {
public class JSONDecoder {
private var value;
private var tokenizer:JSONTokenizer;
private var token:JSONToken;
public function JSONDecoder(_arg1:String){
this.tokenizer = new JSONTokenizer(_arg1);
this.nextToken();
this.value = this.parseValue();
}
public function getValue(){
return (this.value);
}
private function nextToken():JSONToken{
return ((this.token = this.tokenizer.getNextToken()));
}
private function parseArray():Array{
var _local1:Array = new Array();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
while (true) {
_local1.push(this.parseValue());
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACKET){
return (_local1);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting ] or , but found " + this.token.value));
};
};
return (null);
}
private function parseObject():Object{
var _local2:String;
var _local1:Object = new Object();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
while (true) {
if (this.token.type == JSONTokenType.STRING){
_local2 = String(this.token.value);
this.nextToken();
if (this.token.type == JSONTokenType.COLON){
this.nextToken();
_local1[_local2] = this.parseValue();
this.nextToken();
if (this.token.type == JSONTokenType.RIGHT_BRACE){
return (_local1);
};
if (this.token.type == JSONTokenType.COMMA){
this.nextToken();
} else {
this.tokenizer.parseError(("Expecting } or , but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting : but found " + this.token.value));
};
} else {
this.tokenizer.parseError(("Expecting string but found " + this.token.value));
};
};
return (null);
}
private function parseValue():Object{
if (this.token == null){
this.tokenizer.parseError("Unexpected end of input");
};
switch (this.token.type){
case JSONTokenType.LEFT_BRACE:
return (this.parseObject());
case JSONTokenType.LEFT_BRACKET:
return (this.parseArray());
case JSONTokenType.STRING:
case JSONTokenType.NUMBER:
case JSONTokenType.TRUE:
case JSONTokenType.FALSE:
case JSONTokenType.NULL:
return (this.token.value);
default:
this.tokenizer.parseError(("Unexpected " + this.token.value));
};
return (null);
}
}
}//package com.adobe.serialization.json
Section 47
//JSONEncoder (com.adobe.serialization.json.JSONEncoder)
package com.adobe.serialization.json {
import flash.utils.*;
public class JSONEncoder {
private var jsonString:String;
public function JSONEncoder(_arg1){
this.jsonString = this.convertToString(_arg1);
}
public function getString():String{
return (this.jsonString);
}
private function convertToString(_arg1):String{
if ((_arg1 is String)){
return (this.escapeString((_arg1 as String)));
};
if ((_arg1 is Number)){
return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null");
} else {
if ((_arg1 is Boolean)){
return ((_arg1) ? "true" : "false");
} else {
if ((_arg1 is Array)){
return (this.arrayToString((_arg1 as Array)));
};
if ((((_arg1 is Object)) && (!((_arg1 == null))))){
return (this.objectToString(_arg1));
};
};
};
return ("null");
}
private function escapeString(_arg1:String):String{
var _local3:String;
var _local6:String;
var _local7:String;
var _local2 = "";
var _local4:Number = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local3 = _arg1.charAt(_local5);
switch (_local3){
case "\"":
_local2 = (_local2 + "\\\"");
break;
case "\\":
_local2 = (_local2 + "\\\\");
break;
case "\b":
_local2 = (_local2 + "\\b");
break;
case "\f":
_local2 = (_local2 + "\\f");
break;
case "\n":
_local2 = (_local2 + "\\n");
break;
case "\r":
_local2 = (_local2 + "\\r");
break;
case "\t":
_local2 = (_local2 + "\\t");
break;
default:
if (_local3 < " "){
_local6 = _local3.charCodeAt(0).toString(16);
_local7 = ((_local6.length == 2)) ? "00" : "000";
_local2 = (_local2 + (("\\u" + _local7) + _local6));
} else {
_local2 = (_local2 + _local3);
};
};
_local5++;
};
return ((("\"" + _local2) + "\""));
}
private function arrayToString(_arg1:Array):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1.length) {
if (_local2.length > 0){
_local2 = (_local2 + ",");
};
_local2 = (_local2 + this.convertToString(_arg1[_local3]));
_local3++;
};
return ((("[" + _local2) + "]"));
}
private function objectToString(_arg1:Object):String{
var value:Object;
var key:String;
var v:XML;
var o = _arg1;
var s = "";
var classInfo:XML = describeType(o);
if (classInfo.@name.toString() == "Object"){
for (key in o) {
value = o[key];
if ((value is Function)){
} else {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(key) + ":") + this.convertToString(value)));
};
};
} else {
for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) {
if (s.length > 0){
s = (s + ",");
};
s = (s + ((this.escapeString(v.@name.toString()) + ":") + this.convertToString(o[v.@name])));
};
};
return ((("{" + s) + "}"));
}
}
}//package com.adobe.serialization.json
Section 48
//JSONParseError (com.adobe.serialization.json.JSONParseError)
package com.adobe.serialization.json {
public class JSONParseError extends Error {
private var _location:int;
private var _text:String;
public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){
super(_arg1);
name = "JSONParseError";
this._location = _arg2;
this._text = _arg3;
}
public function get location():int{
return (this._location);
}
public function get text():String{
return (this._text);
}
}
}//package com.adobe.serialization.json
Section 49
//JSONToken (com.adobe.serialization.json.JSONToken)
package com.adobe.serialization.json {
public class JSONToken {
private var _type:int;
private var _value:Object;
public function JSONToken(_arg1:int=-1, _arg2:Object=null){
this._type = _arg1;
this._value = _arg2;
}
public function get type():int{
return (this._type);
}
public function set type(_arg1:int):void{
this._type = _arg1;
}
public function get value():Object{
return (this._value);
}
public function set value(_arg1:Object):void{
this._value = _arg1;
}
}
}//package com.adobe.serialization.json
Section 50
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer)
package com.adobe.serialization.json {
public class JSONTokenizer {
private var obj:Object;
private var jsonString:String;
private var loc:int;
private var ch:String;
public function JSONTokenizer(_arg1:String){
this.jsonString = _arg1;
this.loc = 0;
this.nextChar();
}
public function getNextToken():JSONToken{
var _local2:String;
var _local3:String;
var _local4:String;
var _local1:JSONToken = new JSONToken();
this.skipIgnored();
switch (this.ch){
case "{":
_local1.type = JSONTokenType.LEFT_BRACE;
_local1.value = "{";
this.nextChar();
break;
case "}":
_local1.type = JSONTokenType.RIGHT_BRACE;
_local1.value = "}";
this.nextChar();
break;
case "[":
_local1.type = JSONTokenType.LEFT_BRACKET;
_local1.value = "[";
this.nextChar();
break;
case "]":
_local1.type = JSONTokenType.RIGHT_BRACKET;
_local1.value = "]";
this.nextChar();
break;
case ",":
_local1.type = JSONTokenType.COMMA;
_local1.value = ",";
this.nextChar();
break;
case ":":
_local1.type = JSONTokenType.COLON;
_local1.value = ":";
this.nextChar();
break;
case "t":
_local2 = ((("t" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local2 == "true"){
_local1.type = JSONTokenType.TRUE;
_local1.value = true;
this.nextChar();
} else {
this.parseError(("Expecting 'true' but found " + _local2));
};
break;
case "f":
_local3 = (((("f" + this.nextChar()) + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local3 == "false"){
_local1.type = JSONTokenType.FALSE;
_local1.value = false;
this.nextChar();
} else {
this.parseError(("Expecting 'false' but found " + _local3));
};
break;
case "n":
_local4 = ((("n" + this.nextChar()) + this.nextChar()) + this.nextChar());
if (_local4 == "null"){
_local1.type = JSONTokenType.NULL;
_local1.value = null;
this.nextChar();
} else {
this.parseError(("Expecting 'null' but found " + _local4));
};
break;
case "\"":
_local1 = this.readString();
break;
default:
if (((this.isDigit(this.ch)) || ((this.ch == "-")))){
_local1 = this.readNumber();
} else {
if (this.ch == ""){
return (null);
};
this.parseError((("Unexpected " + this.ch) + " encountered"));
};
};
return (_local1);
}
private function readString():JSONToken{
var _local3:String;
var _local4:int;
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.STRING;
var _local2 = "";
this.nextChar();
while (((!((this.ch == "\""))) && (!((this.ch == ""))))) {
if (this.ch == "\\"){
this.nextChar();
switch (this.ch){
case "\"":
_local2 = (_local2 + "\"");
break;
case "/":
_local2 = (_local2 + "/");
break;
case "\\":
_local2 = (_local2 + "\\");
break;
case "b":
_local2 = (_local2 + "\b");
break;
case "f":
_local2 = (_local2 + "\f");
break;
case "n":
_local2 = (_local2 + "\n");
break;
case "r":
_local2 = (_local2 + "\r");
break;
case "t":
_local2 = (_local2 + "\t");
break;
case "u":
_local3 = "";
_local4 = 0;
while (_local4 < 4) {
if (!this.isHexDigit(this.nextChar())){
this.parseError((" Excepted a hex digit, but found: " + this.ch));
};
_local3 = (_local3 + this.ch);
_local4++;
};
_local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16)));
break;
default:
_local2 = (_local2 + ("\\" + this.ch));
};
} else {
_local2 = (_local2 + this.ch);
};
this.nextChar();
};
if (this.ch == ""){
this.parseError("Unterminated string literal");
};
this.nextChar();
_local1.value = _local2;
return (_local1);
}
private function readNumber():JSONToken{
var _local1:JSONToken = new JSONToken();
_local1.type = JSONTokenType.NUMBER;
var _local2 = "";
if (this.ch == "-"){
_local2 = (_local2 + "-");
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
if (this.ch == "0"){
_local2 = (_local2 + this.ch);
this.nextChar();
if (this.isDigit(this.ch)){
this.parseError("A digit cannot immediately follow 0");
};
} else {
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
if (this.ch == "."){
_local2 = (_local2 + ".");
this.nextChar();
if (!this.isDigit(this.ch)){
this.parseError("Expecting a digit");
};
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
if ((((this.ch == "e")) || ((this.ch == "E")))){
_local2 = (_local2 + "e");
this.nextChar();
if ((((this.ch == "+")) || ((this.ch == "-")))){
_local2 = (_local2 + this.ch);
this.nextChar();
};
if (!this.isDigit(this.ch)){
this.parseError("Scientific notation number needs exponent value");
};
while (this.isDigit(this.ch)) {
_local2 = (_local2 + this.ch);
this.nextChar();
};
};
var _local3:Number = Number(_local2);
if (((isFinite(_local3)) && (!(isNaN(_local3))))){
_local1.value = _local3;
return (_local1);
};
this.parseError((("Number " + _local3) + " is not valid!"));
return (null);
}
private function nextChar():String{
return ((this.ch = this.jsonString.charAt(this.loc++)));
}
private function skipIgnored():void{
var _local1:int;
do {
_local1 = this.loc;
this.skipWhite();
this.skipComments();
} while (_local1 != this.loc);
}
private function skipComments():void{
if (this.ch == "/"){
this.nextChar();
switch (this.ch){
case "/":
do {
this.nextChar();
} while (((!((this.ch == "\n"))) && (!((this.ch == "")))));
this.nextChar();
break;
case "*":
this.nextChar();
while (true) {
if (this.ch == "*"){
this.nextChar();
if (this.ch == "/"){
this.nextChar();
break;
};
} else {
this.nextChar();
};
if (this.ch == ""){
this.parseError("Multi-line comment not closed");
};
};
break;
default:
this.parseError((("Unexpected " + this.ch) + " encountered (expecting '/' or '*' )"));
};
};
}
private function skipWhite():void{
while (this.isWhiteSpace(this.ch)) {
this.nextChar();
};
}
private function isWhiteSpace(_arg1:String):Boolean{
return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r"))));
}
private function isDigit(_arg1:String):Boolean{
return ((((_arg1 >= "0")) && ((_arg1 <= "9"))));
}
private function isHexDigit(_arg1:String):Boolean{
var _local2:String = _arg1.toUpperCase();
return (((this.isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F"))))));
}
public function parseError(_arg1:String):void{
throw (new JSONParseError(_arg1, this.loc, this.jsonString));
}
}
}//package com.adobe.serialization.json
Section 51
//JSONTokenType (com.adobe.serialization.json.JSONTokenType)
package com.adobe.serialization.json {
public class JSONTokenType {
public static const UNKNOWN:int = -1;
public static const COMMA:int = 0;
public static const LEFT_BRACE:int = 1;
public static const RIGHT_BRACE:int = 2;
public static const LEFT_BRACKET:int = 3;
public static const RIGHT_BRACKET:int = 4;
public static const COLON:int = 6;
public static const TRUE:int = 7;
public static const FALSE:int = 8;
public static const NULL:int = 9;
public static const STRING:int = 10;
public static const NUMBER:int = 11;
}
}//package com.adobe.serialization.json
Section 52
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local4:int;
var _local5:int;
var _local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
}
}//package com.adobe.utils
Section 53
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public class PropTween {
public var priority:int;
public var start:Number;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var name:String;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
if (_arg7){
_arg7.prevNode = this;
this.nextNode = _arg7;
};
this.priority = _arg8;
}
}
}//package com.greensock.core
Section 54
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local5:Number;
var _local6:TweenCore;
var _local4:TweenCore = _firstChild;
this.cachedTotalTime = _arg1;
this.cachedTime = _arg1;
while (_local4) {
_local6 = _local4.nextNode;
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){
if (!_local4.cachedReversed){
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration;
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false);
};
};
_local4 = _local6;
};
}
public function addChild(_arg1:TweenCore):void{
if (((!(_arg1.cachedOrphan)) && (_arg1.timeline))){
_arg1.timeline.remove(_arg1, true);
};
_arg1.timeline = this;
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (_firstChild){
_firstChild.prevNode = _arg1;
};
_arg1.nextNode = _firstChild;
_firstChild = _arg1;
_arg1.prevNode = null;
_arg1.cachedOrphan = false;
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.cachedOrphan){
return;
};
if (!_arg2){
_arg1.setEnabled(false, true);
};
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_lastChild == _arg1){
_lastChild = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_firstChild == _arg1){
_firstChild = _arg1.nextNode;
};
};
_arg1.cachedOrphan = true;
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
}
}//package com.greensock.core
Section 55
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
public var cachedTime:Number;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var data;
public var timeline:SimpleTimeline;
public var cachedOrphan:Boolean;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
public var cachedPauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.392;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
this.vars = ((_arg2)!=null) ? _arg2 : {};
this.cachedDuration = (this.cachedTotalDuration = _arg1);
_delay = (this.vars.delay) ? Number(this.vars.delay) : 0;
this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1;
this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
this.cachedStartTime = (_local3.cachedTotalTime + _delay);
_local3.addChild(this);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(_arg1:Number):void{
var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc)))));
this.cachedStartTime = _arg1;
if (_local2){
this.timeline.addChild(this);
};
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(_arg1:Number):void{
this.cachedDuration = (this.cachedTotalDuration = _arg1);
setDirtyCache(false);
}
public function invalidate():void{
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.totalDuration, _arg2, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!_arg2){
if (((((this.vars.onComplete) && ((this.cachedTotalTime >= this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
public function reverse(_arg1:Boolean=true):void{
this.reversed = true;
if (_arg1){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
this.cachedPauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - this.cachedPauseTime));
this.cachedPauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = _arg1;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(_arg1)) && (this.gc))){
this.setTotalTime(this.cachedTotalTime, false);
this.setEnabled(true, false);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (((this.cachedPauseTime) || ((this.cachedPauseTime == 0)))) ? this.cachedPauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale));
} else {
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != _arg1){
renderTime(_arg1, _arg2, false);
};
};
}
public function pause():void{
this.paused = true;
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
this.gc = !(_arg1);
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.cachedOrphan))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (((!(_arg2)) && (!(this.cachedOrphan)))){
this.timeline.remove(this, true);
};
};
return (false);
}
}
}//package com.greensock.core
Section 56
//Back (com.greensock.easing.Back)
package com.greensock.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 * 0.5) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package com.greensock.easing
Section 57
//Expo (com.greensock.easing.Expo)
package com.greensock.easing {
public class Expo {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 * 0.5));
if (_arg1 < 1){
return ((((_arg3 * 0.5) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2));
};
--_arg1;
return ((((_arg3 * 0.5) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
}
}//package com.greensock.easing
Section 58
//TweenEvent (com.greensock.events.TweenEvent)
package com.greensock.events {
import flash.events.*;
public class TweenEvent extends Event {
public static const COMPLETE:String = "complete";
public static const START:String = "start";
public static const UPDATE:String = "change";
public static const REVERSE_COMPLETE:String = "reverseComplete";
public static const INIT:String = "init";
public static const VERSION:Number = 1.1;
public static const REPEAT:String = "repeat";
public function TweenEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function clone():Event{
return (new TweenEvent(this.type, this.bubbles, this.cancelable));
}
}
}//package com.greensock.events
Section 59
//AutoAlphaPlugin (com.greensock.plugins.AutoAlphaPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _target:Object;
protected var _ignoreVisible:Boolean;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_ignoreVisible = Boolean(("visible" in _arg1));
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (!_ignoreVisible){
_target.visible = Boolean(!((_target.alpha == 0)));
};
}
}
}//package com.greensock.plugins
Section 60
//BevelFilterPlugin (com.greensock.plugins.BevelFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["distance", "angle", "highlightColor", "highlightAlpha", "shadowColor", "shadowAlpha", "blurX", "blurY", "strength", "quality"];
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 61
//BezierPlugin (com.greensock.plugins.BezierPlugin)
package com.greensock.plugins {
import com.greensock.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
public static const API:Number = 1;
protected static const _RAD2DEG:Number = 57.2957795130823;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local6:int;
var _local7:String;
var _local8:Object;
_target = _arg1.target;
var _local4:Object = ((_arg1.vars.isTV)==true) ? _arg1.vars.exposedVars : _arg1.vars;
if (_local4.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0, 0.01]];
_orient = true;
} else {
if ((_local4.orientToBezier is Array)){
_orientData = _local4.orientToBezier;
_orient = true;
};
};
var _local5:Object = {};
_local6 = 0;
while (_local6 < _arg2.length) {
for (_local7 in _arg2[_local6]) {
if (_local5[_local7] == undefined){
_local5[_local7] = [_arg1.target[_local7]];
};
if (typeof(_arg2[_local6][_local7]) == "number"){
_local5[_local7].push(_arg2[_local6][_local7]);
} else {
_local5[_local7].push((_arg1.target[_local7] + Number(_arg2[_local6][_local7])));
};
};
_local6 = (_local6 + 1);
};
for (_local7 in _local5) {
this.overwriteProps[this.overwriteProps.length] = _local7;
if (_local4[_local7] != undefined){
if (typeof(_local4[_local7]) == "number"){
_local5[_local7].push(_local4[_local7]);
} else {
_local5[_local7].push((_arg1.target[_local7] + Number(_local4[_local7])));
};
_local8 = {};
_local8[_local7] = true;
_arg1.killVars(_local8, false);
delete _local4[_local7];
};
};
_beziers = parseBeziers(_local5, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:int;
var _local7:Number;
var _local8:Object;
var _local9:Number;
var _local10:Number;
var _local11:Array;
var _local12:Number;
var _local13:Object;
var _local14:Boolean;
_changeFactor = _arg1;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = ((_local6 * _arg1) >> 0);
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
if (_local7 > 0){
_target[_local3] = ((_local7 + 0.5) >> 0);
} else {
_target[_local3] = ((_local7 - 0.5) >> 0);
};
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local2 = _orientData.length;
_local8 = {};
while (_local2--) {
_local11 = _orientData[_local2];
_local8[_local11[0]] = _target[_local11[0]];
_local8[_local11[1]] = _target[_local11[1]];
};
_local13 = _target;
_local14 = this.round;
_target = _future;
this.round = false;
_orient = false;
_local2 = _orientData.length;
while (_local2--) {
_local11 = _orientData[_local2];
this.changeFactor = (_arg1 + ((_local11[4]) || (0.01)));
_local12 = ((_local11[3]) || (0));
_local9 = (_future[_local11[0]] - _local8[_local11[0]]);
_local10 = (_future[_local11[1]] - _local8[_local11[1]]);
_local13[_local11[2]] = ((Math.atan2(_local10, _local9) * _RAD2DEG) + _local12);
};
_target = _local13;
this.round = _local14;
_orient = true;
};
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3 = (_local3 + 1);
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3 = (_local3 + 1);
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package com.greensock.plugins
Section 62
//BezierThroughPlugin (com.greensock.plugins.BezierThroughPlugin)
package com.greensock.plugins {
import com.greensock.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const API:Number = 1;
public function BezierThroughPlugin(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package com.greensock.plugins
Section 63
//BlurFilterPlugin (com.greensock.plugins.BlurFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["blurX", "blurY", "quality"];
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 64
//ColorMatrixFilterPlugin (com.greensock.plugins.ColorMatrixFilterPlugin)
package com.greensock.plugins {
import com.greensock.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
private static var _propNames:Array = [];
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = ColorMatrixFilter;
var _local4:Object = _arg2;
initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice()), _propNames);
_matrix = ColorMatrixFilter(_filter).matrix;
var _local5:Array = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7 = (_local7 + 1);
};
_local4 = (_local4 + 5);
_local6 = (_local6 + 1);
};
return (_local3);
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
}
}//package com.greensock.plugins
Section 65
//ColorTransformPlugin (com.greensock.plugins.ColorTransformPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.geom.*;
public class ColorTransformPlugin extends TintPlugin {
public static const API:Number = 1;
public function ColorTransformPlugin(){
this.propName = "colorTransform";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local5:String;
var _local6:Number;
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = _arg1.transform.colorTransform;
for (_local5 in _arg2) {
if ((((_local5 == "tint")) || ((_local5 == "color")))){
if (_arg2[_local5] != null){
_local4.color = int(_arg2[_local5]);
};
} else {
if ((((((_local5 == "tintAmount")) || ((_local5 == "exposure")))) || ((_local5 == "brightness")))){
} else {
_local4[_local5] = _arg2[_local5];
};
};
};
if (!isNaN(_arg2.tintAmount)){
_local6 = (_arg2.tintAmount / (1 - (((_local4.redMultiplier + _local4.greenMultiplier) + _local4.blueMultiplier) / 3)));
_local4.redOffset = (_local4.redOffset * _local6);
_local4.greenOffset = (_local4.greenOffset * _local6);
_local4.blueOffset = (_local4.blueOffset * _local6);
_local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = (1 - _arg2.tintAmount)));
} else {
if (!isNaN(_arg2.exposure)){
_local4.redOffset = (_local4.greenOffset = (_local4.blueOffset = (0xFF * (_arg2.exposure - 1))));
_local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = 1));
} else {
if (!isNaN(_arg2.brightness)){
_local4.redOffset = (_local4.greenOffset = (_local4.blueOffset = Math.max(0, ((_arg2.brightness - 1) * 0xFF))));
_local4.redMultiplier = (_local4.greenMultiplier = (_local4.blueMultiplier = (1 - Math.abs((_arg2.brightness - 1)))));
};
};
};
_ignoreAlpha = Boolean(((!((_arg3.vars.alpha == undefined))) && ((_arg2.alphaMultiplier == undefined))));
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package com.greensock.plugins
Section 66
//DropShadowFilterPlugin (com.greensock.plugins.DropShadowFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["distance", "angle", "color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout", "hideObject"];
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 67
//EndArrayPlugin (com.greensock.plugins.EndArrayPlugin)
package com.greensock.plugins {
import com.greensock.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = _arg2.length;
while (_local3--) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local2:int = _info.length;
if (this.round){
while (_local2--) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
if (_local4 > 0){
_a[_local3.index] = ((_local4 + 0.5) >> 0);
} else {
_a[_local3.index] = ((_local4 - 0.5) >> 0);
};
};
} else {
while (_local2--) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
};
};
}
}
}//package com.greensock.plugins
class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
private function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
Section 68
//FilterPlugin (com.greensock.plugins.FilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.core.*;
import com.greensock.*;
import flash.filters.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 2.03;
public static const API:Number = 1;
public function onCompleteTween():void{
var _local1:Array;
var _local2:int;
if (_remove){
_local1 = _target.filters;
if (!(_local1[_index] is _type)){
_local2 = _local1.length;
while (_local2--) {
if ((_local1[_local2] is _type)){
_local1.splice(_local2, 1);
break;
};
};
} else {
_local1.splice(_index, 1);
};
_target.filters = _local1;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter, _arg3:Array):void{
var _local5:String;
var _local6:int;
var _local7:HexColorsPlugin;
var _local4:Array = _target.filters;
var _local8:Object = ((_arg1 is BitmapFilter)) ? {} : _arg1;
_index = -1;
if (_local8.index != null){
_index = _local8.index;
} else {
_local6 = _local4.length;
while (_local6--) {
if ((_local4[_local6] is _type)){
_index = _local6;
break;
};
};
};
if ((((((_index == -1)) || ((_local4[_index] == null)))) || ((_local8.addFilter == true)))){
_index = ((_local8.index)!=null) ? _local8.index : _local4.length;
_local4[_index] = _arg2;
_target.filters = _local4;
};
_filter = _local4[_index];
if (_local8.remove == true){
_remove = true;
this.onComplete = onCompleteTween;
};
_local6 = _arg3.length;
while (_local6--) {
_local5 = _arg3[_local6];
if ((((_local5 in _arg1)) && (!((_filter[_local5] == _arg1[_local5]))))){
if ((((((_local5 == "color")) || ((_local5 == "highlightColor")))) || ((_local5 == "shadowColor")))){
_local7 = new HexColorsPlugin();
_local7.initColor(_filter, _local5, _filter[_local5], _arg1[_local5]);
_tweens[_tweens.length] = new PropTween(_local7, "changeFactor", 0, 1, _local5, false);
} else {
if ((((((((_local5 == "quality")) || ((_local5 == "inner")))) || ((_local5 == "knockout")))) || ((_local5 == "hideObject")))){
_filter[_local5] = _arg1[_local5];
} else {
addTween(_filter, _local5, _filter[_local5], _arg1[_local5], _local5);
};
};
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local3:PropTween;
var _local2:int = _tweens.length;
var _local4:Array = _target.filters;
while (_local2--) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
};
if (!(_local4[_index] is _type)){
_local2 = (_index = _local4.length);
while (_local2--) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
}
}//package com.greensock.plugins
Section 69
//FrameLabelPlugin (com.greensock.plugins.FrameLabelPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class FrameLabelPlugin extends FramePlugin {
public static const API:Number = 1;
public function FrameLabelPlugin(){
this.propName = "frameLabel";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if ((!(_arg3.target) is MovieClip)){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
var _local4:Array = _target.currentLabels;
var _local5:String = _arg2;
var _local6:int = _target.currentFrame;
var _local7:int = _local4.length;
while (_local7--) {
if (_local4[_local7].name == _local5){
_local6 = _local4[_local7].frame;
break;
};
};
if (this.frame != _local6){
addTween(this, "frame", this.frame, _local6, "frame");
};
return (true);
}
}
}//package com.greensock.plugins
Section 70
//FramePlugin (com.greensock.plugins.FramePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame", "frameLabel"];
this.round = true;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package com.greensock.plugins
Section 71
//GlowFilterPlugin (com.greensock.plugins.GlowFilterPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const API:Number = 1;
private static var _propNames:Array = ["color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout"];
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout), _propNames);
return (true);
}
}
}//package com.greensock.plugins
Section 72
//HexColorsPlugin (com.greensock.plugins.HexColorsPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(_arg1:Object):void{
var _local2:int = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
}
}//package com.greensock.plugins
Section 73
//RemoveTintPlugin (com.greensock.plugins.RemoveTintPlugin)
package com.greensock.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package com.greensock.plugins
Section 74
//RoundPropsPlugin (com.greensock.plugins.RoundPropsPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const API:Number = 1;
public function RoundPropsPlugin(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package com.greensock.plugins
Section 75
//ShortRotationPlugin (com.greensock.plugins.ShortRotationPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const API:Number = 1;
public function ShortRotationPlugin(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "number"){
return (false);
};
for (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], ((typeof(_arg2[_local4]))=="number") ? Number(_arg2[_local4]) : (_arg1[_local4] + Number(_arg2[_local4])));
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package com.greensock.plugins
Section 76
//TintPlugin (com.greensock.plugins.TintPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.core.*;
import com.greensock.*;
import flash.geom.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _transform:Transform;
protected var _ignoreAlpha:Boolean;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.vars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local4:String;
_transform = _arg1.transform;
_ct = _transform.colorTransform;
var _local3:int = _props.length;
while (_local3--) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new PropTween(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
};
}
}
}//package com.greensock.plugins
Section 77
//TweenPlugin (com.greensock.plugins.TweenPlugin)
package com.greensock.plugins {
import com.greensock.core.*;
import com.greensock.*;
public class TweenPlugin {
public var activeDisable:Boolean;
protected var _changeFactor:Number;// = 0
protected var _tweens:Array;
public var onDisable:Function;
public var propName:String;
public var round:Boolean;
public var onEnable:Function;
public var priority:int;// = 0
public var overwriteProps:Array;
public var onComplete:Function;
public static const VERSION:Number = 1.32;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local3:PropTween;
var _local4:Number;
var _local2:int = _tweens.length;
if (this.round){
while (--_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
if (_local4 > 0){
_local3.target[_local3.property] = ((_local4 + 0.5) >> 0);
} else {
_local3.target[_local3.property] = ((_local4 - 0.5) >> 0);
};
};
} else {
while (--_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
};
};
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (Number(_arg4) - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new PropTween(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function get changeFactor():Number{
return (_changeFactor);
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function killProps(_arg1:Object):void{
var _local2:int = this.overwriteProps.length;
while (--_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
};
_local2 = _tweens.length;
while (--_local2 > -1) {
if ((PropTween(_tweens[_local2]).name in _arg1)){
_tweens.splice(_local2, 1);
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
public static function activate(_arg1:Array):Boolean{
var _local3:Object;
TweenLite.onPluginEvent = TweenPlugin.onTweenEvent;
var _local2:int = _arg1.length;
while (_local2--) {
if (_arg1[_local2].hasOwnProperty("API")){
_local3 = new ((_arg1[_local2] as Class));
TweenLite.plugins[_local3.propName] = _arg1[_local2];
};
};
return (true);
}
private static function onTweenEvent(_arg1:String, _arg2:TweenLite):Boolean{
var _local4:Boolean;
var _local5:Array;
var _local6:int;
var _local3:PropTween = _arg2.cachedPT1;
if (_arg1 == "onInit"){
_local5 = [];
while (_local3) {
_local5[_local5.length] = _local3;
_local3 = _local3.nextNode;
};
_local5.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
_local6 = _local5.length;
while (_local6--) {
PropTween(_local5[_local6]).nextNode = _local5[(_local6 + 1)];
PropTween(_local5[_local6]).prevNode = _local5[(_local6 - 1)];
};
_arg2.cachedPT1 = _local5[0];
} else {
while (_local3) {
if (((_local3.isPlugin) && (_local3.target[_arg1]))){
if (_local3.target.activeDisable){
_local4 = true;
};
var _local7 = _local3.target;
_local7[_arg1]();
};
_local3 = _local3.nextNode;
};
};
return (_local4);
}
}
}//package com.greensock.plugins
Section 78
//VisiblePlugin (com.greensock.plugins.VisiblePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _initVal:Boolean;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_initVal = _target.visible;
_visible = Boolean(_arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
if ((((_arg1 == 1)) && ((((_tween.cachedDuration == _tween.cachedTime)) || ((_tween.cachedTime == 0)))))){
_target.visible = _visible;
} else {
_target.visible = _initVal;
};
}
}
}//package com.greensock.plugins
Section 79
//VolumePlugin (com.greensock.plugins.VolumePlugin)
package com.greensock.plugins {
import flash.media.*;
import com.greensock.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((((isNaN(_arg2)) || (_arg1.hasOwnProperty("volume")))) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
}
}//package com.greensock.plugins
Section 80
//OverwriteManager (com.greensock.OverwriteManager)
package com.greensock {
import com.greensock.core.*;
public class OverwriteManager {
public static const ALL_ONSTART:int = 4;
public static const CONCURRENT:int = 3;
public static const ALL_IMMEDIATE:int = 1;
public static const PREEXISTING:int = 5;
public static const AUTO:int = 2;
public static const version:Number = 6.03;
public static const NONE:int = 0;
public static var enabled:Boolean;
public static var mode:int;
public static function getGlobalPaused(_arg1:TweenCore):Boolean{
var _local2:Boolean;
while (_arg1) {
if (_arg1.cachedPaused){
_local2 = true;
break;
};
_arg1 = _arg1.timeline;
};
return (_local2);
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 11.1){
throw (new Error("Warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com."));
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Object, _arg3:Array, _arg4:uint):Boolean{
var _local5:int;
var _local6:Boolean;
var _local7:TweenLite;
var _local13:uint;
var _local14:Number;
var _local15:Number;
var _local16:TweenCore;
var _local17:Number;
var _local18:SimpleTimeline;
if (_arg4 >= 4){
_local13 = _arg3.length;
_local5 = 0;
while (_local5 < _local13) {
_local7 = _arg3[_local5];
if (_local7 != _arg1){
if (_local7.setEnabled(false, false)){
_local6 = true;
};
} else {
if (_arg4 == 5){
break;
};
};
_local5++;
};
return (_local6);
};
var _local8:Number = (_arg1.cachedStartTime + 1E-10);
var _local9:Array = [];
var _local10:Array = [];
var _local11:uint;
var _local12:uint;
_local5 = _arg3.length;
while (--_local5 > -1) {
_local7 = _arg3[_local5];
if ((((_local7 == _arg1)) || (_local7.gc))){
} else {
if (_local7.timeline != _arg1.timeline){
if (!getGlobalPaused(_local7)){
var _temp1 = _local11;
_local11 = (_local11 + 1);
var _local19 = _temp1;
_local10[_local19] = _local7;
};
} else {
if ((((((_local7.cachedStartTime <= _local8)) && ((((_local7.cachedStartTime + _local7.totalDuration) + 1E-10) > _local8)))) && (!(getGlobalPaused(_local7))))){
var _temp2 = _local12;
_local12 = (_local12 + 1);
_local19 = _temp2;
_local9[_local19] = _local7;
};
};
};
};
if (_local11 != 0){
_local14 = _arg1.cachedTimeScale;
_local15 = _local8;
_local18 = _arg1.timeline;
while (_local18) {
_local14 = (_local14 * _local18.cachedTimeScale);
_local15 = (_local15 + _local18.cachedStartTime);
_local18 = _local18.timeline;
};
_local8 = (_local14 * _local15);
_local5 = _local11;
while (--_local5 > -1) {
_local16 = _local10[_local5];
_local14 = _local16.cachedTimeScale;
_local15 = _local16.cachedStartTime;
_local18 = _local16.timeline;
while (_local18) {
_local14 = (_local14 * _local18.cachedTimeScale);
_local15 = (_local15 + _local18.cachedStartTime);
_local18 = _local18.timeline;
};
_local17 = (_local14 * _local15);
if ((((_local17 <= _local8)) && ((((((_local17 + (_local16.totalDuration * _local14)) + 1E-10) > _local8)) || ((_local16.cachedDuration == 0)))))){
var _temp3 = _local12;
_local12 = (_local12 + 1);
_local19 = _temp3;
_local9[_local19] = _local16;
};
};
};
if (_local12 == 0){
return (_local6);
};
_local5 = _local12;
if (_arg4 == 2){
while (--_local5 > -1) {
_local7 = _local9[_local5];
if (_local7.killVars(_arg2)){
_local6 = true;
};
if ((((_local7.cachedPT1 == null)) && (_local7.initted))){
_local7.setEnabled(false, false);
};
};
} else {
while (--_local5 > -1) {
if (TweenLite(_local9[_local5]).setEnabled(false, false)){
_local6 = true;
};
};
};
return (_local6);
}
}
}//package com.greensock
Section 81
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.greensock.core.*;
import com.greensock.plugins.*;
public class TweenLite extends TweenCore {
protected var _hasPlugins:Boolean;
public var propTweenLookup:Object;
public var cachedPT1:PropTween;
protected var _overwrite:int;
protected var _ease:Function;
public var target:Object;
public var ratio:Number;// = 0
protected var _overwrittenProps:Object;
protected var _notifyPluginsOfEnabled:Boolean;
public static const version:Number = 11.39;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1};
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:TweenLite;
super(_arg2, _arg3);
this.target = _arg1;
if ((((this.target is TweenCore)) && (this.vars.timeScale))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
var _local4:Array = masterList[_arg1];
if (!_local4){
masterList[_arg1] = [this];
} else {
if (_overwrite == 1){
for each (_local5 in _local4) {
if (!_local5.gc){
_local5.setEnabled(false, false);
};
};
masterList[_arg1] = [this];
} else {
_local4[_local4.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Boolean;
var _local5:Number = this.cachedTime;
if (_arg1 >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
_local4 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
_arg3 = true;
_local4 = true;
};
_rawPrevTime = _arg1;
};
};
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local4 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
this.ratio = _ease(_arg1, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
if (((!(_local4)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
var _local6:PropTween = this.cachedPT1;
while (_local6) {
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change));
_local6 = _local6.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local4){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:Array;
if (_arg1){
_local3 = TweenLite.masterList[this.target];
if (!_local3){
TweenLite.masterList[this.target] = [this];
} else {
_local3[_local3.length] = this;
};
};
super.setEnabled(_arg1, _arg2);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this));
};
return (false);
}
protected function init():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:Boolean;
var _local5:Array;
var _local6:PropTween;
if (this.vars.onInit){
this.vars.onInit.apply(null, this.vars.onInitParams);
};
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (_local1 in this.vars) {
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
_local2 = _local3.overwriteProps.length;
while (--_local2 > -1) {
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (_local3.priority){
this.cachedPT1.priority = _local3.priority;
_local4 = true;
};
if (((_local3.onDisable) || (_local3.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1);
this.propTweenLookup[_local1] = this.cachedPT1;
};
};
};
if (_local4){
onPluginEvent("onInit", this);
};
if (this.vars.runBackwards){
_local6 = this.cachedPT1;
while (_local6) {
_local6.start = (_local6.start + _local6.change);
_local6.change = -(_local6.change);
_local6 = _local6.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){
init();
};
};
this.initted = true;
}
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{
var _local3:String;
var _local4:PropTween;
var _local5:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (_local3 in _arg1) {
if ((_local3 in propTweenLookup)){
_local4 = propTweenLookup[_local3];
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){
_local4.target.killProps(_arg1);
if (_local4.target.overwriteProps.length == 0){
_local4.name = "";
};
};
if (_local4.name != "_MULTIPLE_"){
if (_local4.nextNode){
_local4.nextNode.prevNode = _local4.prevNode;
};
if (_local4.prevNode){
_local4.prevNode.nextNode = _local4.nextNode;
} else {
if (this.cachedPT1 == _local4){
this.cachedPT1 = _local4.nextNode;
};
};
if (((_local4.isPlugin) && (_local4.target.onDisable))){
_local4.target.onDisable();
if (_local4.target.activeDisable){
_local5 = true;
};
};
delete propTweenLookup[_local3];
};
};
if (((_arg2) && (!((_arg1 == _overwrittenProps))))){
_overwrittenProps[_local3] = 1;
};
};
return (_local5);
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false, _arg3:Object=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
if ((_arg1 in masterList)){
_local4 = masterList[_arg1];
_local5 = _local4.length;
while (--_local5 > -1) {
_local6 = _local4[_local5];
if (!_local6.gc){
if (_arg2){
_local6.complete(false, false);
};
if (_arg3 != null){
_local6.killVars(_arg3);
};
if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){
_local6.setEnabled(false, false);
};
};
};
if (_arg3 == null){
delete masterList[_arg1];
};
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
protected static function updateAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame = (rootFrame + 1);
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = _local4.length;
while (--_local5 > -1) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.greensock
Section 82
//TweenMax (com.greensock.TweenMax)
package com.greensock {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.greensock.core.*;
import com.greensock.plugins.*;
import com.greensock.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _cyclesComplete:int;// = 0
protected var _dispatcher:EventDispatcher;
protected var _hasUpdateListener:Boolean;
protected var _easeType:int;
protected var _repeatDelay:Number;// = 0
public var yoyo:Boolean;
protected var _easePower:int;
protected var _repeat:int;// = 0
public static const version:Number = 11.391;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(2);
;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (TweenLite.version < 11.2){
throw (new Error("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com."));
};
this.yoyo = Boolean(this.vars.yoyo);
_repeat = uint(this.vars.repeat);
_repeatDelay = (this.vars.repeatDelay) ? Number(this.vars.repeatDelay) : 0;
this.cacheIsDirty = true;
if (((((((((((this.vars.onCompleteListener) || (this.vars.onInitListener))) || (this.vars.onUpdateListener))) || (this.vars.onStartListener))) || (this.vars.onRepeatListener))) || (this.vars.onReverseCompleteListener))){
initDispatcher();
if ((((_arg2 == 0)) && ((_delay == 0)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
};
};
if (((this.vars.timeScale) && (!((this.target is TweenCore))))){
this.cachedTimeScale = this.vars.timeScale;
};
}
public function dispatchEvent(_arg1:Event):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(_arg1));
}
public function set timeScale(_arg1:Number):void{
if (_arg1 == 0){
_arg1 = 0.0001;
};
var _local2:Number = (((this.cachedPauseTime) || ((this.cachedPauseTime == 0)))) ? this.cachedPauseTime : this.timeline.cachedTotalTime;
this.cachedStartTime = (_local2 - (((_local2 - this.cachedStartTime) * this.cachedTimeScale) / _arg1));
this.cachedTimeScale = _arg1;
setDirtyCache(false);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Number;
var _local4:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
var _local5:Number = this.cachedTime;
if (_arg1 >= _local4){
this.cachedTotalTime = _local4;
this.cachedTime = this.cachedDuration;
this.ratio = 1;
_local6 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
_arg3 = true;
_local6 = true;
};
_rawPrevTime = _arg1;
};
};
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local6 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
_local8 = true;
};
};
if (_repeat != 0){
_local10 = (this.cachedDuration + _repeatDelay);
if (_local6){
if (((this.yoyo) && ((_repeat % 2)))){
this.cachedTime = (this.ratio = 0);
};
} else {
if (_arg1 > 0){
_local11 = _cyclesComplete;
_cyclesComplete = ((this.cachedTotalTime / _local10) >> 0);
if (_cyclesComplete == (this.cachedTotalTime / _local10)){
_cyclesComplete--;
};
if (_local11 != _cyclesComplete){
_local7 = true;
};
this.cachedTime = (((this.cachedTotalTime / _local10) - _cyclesComplete) * _local10);
if (((this.yoyo) && ((_cyclesComplete % 2)))){
this.cachedTime = (this.cachedDuration - this.cachedTime);
} else {
if (this.cachedTime >= this.cachedDuration){
this.cachedTime = this.cachedDuration;
this.ratio = 1;
_local8 = false;
};
};
if (this.cachedTime <= 0){
this.cachedTime = (this.ratio = 0);
_local8 = false;
};
};
};
};
if ((((_local5 == this.cachedTime)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if (_local8){
if (_easeType){
_local12 = _easePower;
_local13 = (this.cachedTime / this.cachedDuration);
if (_easeType == 2){
_local13 = (1 - _local13);
this.ratio = _local13;
while (--_local12 > -1) {
this.ratio = (_local13 * this.ratio);
};
this.ratio = (1 - this.ratio);
} else {
if (_easeType == 1){
this.ratio = _local13;
while (--_local12 > -1) {
this.ratio = (_local13 * this.ratio);
};
} else {
if (_local13 < 0.5){
_local13 = (_local13 * 2);
this.ratio = _local13;
while (--_local12 > -1) {
this.ratio = (_local13 * this.ratio);
};
this.ratio = (this.ratio * 0.5);
} else {
_local13 = ((1 - _local13) * 2);
this.ratio = _local13;
while (--_local12 > -1) {
this.ratio = (_local13 * this.ratio);
};
this.ratio = (1 - (0.5 * this.ratio));
};
};
};
} else {
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if ((((((_local5 == 0)) && (!((this.cachedTotalTime == 0))))) && (!(_arg2)))){
if (this.vars.onStart){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
};
};
var _local9:PropTween = this.cachedPT1;
while (_local9) {
_local9.target[_local9.property] = (_local9.start + (this.ratio * _local9.change));
_local9 = _local9.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (((_hasUpdateListener) && (!(_arg2)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
};
if (_local6){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
} else {
if (((_local7) && (!(_arg2)))){
if (this.vars.onRepeat){
this.vars.onRepeat.apply(null, this.vars.onRepeatParams);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT));
};
};
};
}
override public function set totalDuration(_arg1:Number):void{
if (_repeat == -1){
return;
};
this.duration = ((_arg1 - (_repeat * _repeatDelay)) / (_repeat + 1));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if (_arg1 == TweenEvent.UPDATE){
_hasUpdateListener = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
protected function insertPropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String, _arg6:Boolean, _arg7:PropTween):PropTween{
var _local9:Array;
var _local10:int;
var _local8:PropTween = new PropTween(_arg1, _arg2, _arg3, ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4), _arg5, _arg6, _arg7);
if (((_arg6) && ((_arg5 == "_MULTIPLE_")))){
_local9 = _arg1.overwriteProps;
_local10 = _local9.length;
while (--_local10 > -1) {
this.propTweenLookup[_local9[_local10]] = _local8;
};
} else {
this.propTweenLookup[_arg5] = _local8;
};
return (_local8);
}
override protected function init():void{
var _local1:TweenMax;
var _local2:String;
var _local3:String;
var _local4:Array;
var _local5:Object;
var _local6:PropTween;
var _local7:PropTween;
var _local8:int;
if (this.vars.startAt){
this.vars.startAt.overwrite = 0;
this.vars.startAt.immediateRender = true;
_local1 = new TweenMax(this.target, 0, this.vars.startAt);
};
if (_dispatcher){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.INIT));
};
super.init();
if ((_ease in fastEaseLookup)){
_easeType = fastEaseLookup[_ease][0];
_easePower = fastEaseLookup[_ease][1];
};
if (((!((this.vars.roundProps == null))) && (("roundProps" in TweenLite.plugins)))){
_local4 = this.vars.roundProps;
_local8 = _local4.length;
while (--_local8 > -1) {
_local2 = _local4[_local8];
_local7 = this.cachedPT1;
while (_local7) {
if (_local7.name == _local2){
if (_local7.isPlugin){
_local7.target.round = true;
} else {
if (_local5 == null){
_local5 = new TweenLite.plugins.roundProps();
_local5.add(_local7.target, _local2, _local7.start, _local7.change);
_hasPlugins = true;
_local6 = insertPropTween(_local5, "changeFactor", 0, 1, "_MULTIPLE_", true, this.cachedPT1);
this.cachedPT1 = _local6;
} else {
_local5.add(_local7.target, _local2, _local7.start, _local7.change);
};
this.removePropTween(_local7);
this.propTweenLookup[_local2] = _local6;
};
} else {
if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){
_local3 = ((" " + _local7.target.overwriteProps.join(" ")) + " ");
if (_local3.indexOf(((" " + _local2) + " ")) != -1){
_local7.target.round = true;
};
};
};
_local7 = _local7.nextNode;
};
};
};
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local4:Object = {};
_local4[_arg1] = _arg2;
updateTo(_local4, !(_arg3));
}
public function willTrigger(_arg1:String):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(_arg1));
}
public function hasEventListener(_arg1:String):Boolean{
return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(_arg1));
}
protected function initDispatcher():void{
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
};
if ((this.vars.onInitListener is Function)){
_dispatcher.addEventListener(TweenEvent.INIT, this.vars.onInitListener, false, 0, true);
};
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
_hasUpdateListener = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
if ((this.vars.onRepeatListener is Function)){
_dispatcher.addEventListener(TweenEvent.REPEAT, this.vars.onRepeatListener, false, 0, true);
};
if ((this.vars.onReverseCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE, this.vars.onReverseCompleteListener, false, 0, true);
};
}
public function set currentProgress(_arg1:Number):void{
if (_cyclesComplete == 0){
setTotalTime((this.duration * _arg1), false);
} else {
setTotalTime(((this.duration * _arg1) + (_cyclesComplete * this.cachedDuration)), false);
};
}
public function get totalProgress():Number{
return ((this.cachedTotalTime / this.totalDuration));
}
public function set totalProgress(_arg1:Number):void{
setTotalTime((this.totalDuration * _arg1), false);
}
protected function removePropTween(_arg1:PropTween):Boolean{
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (this.cachedPT1 == _arg1){
this.cachedPT1 = _arg1.nextNode;
};
};
if (((_arg1.isPlugin) && (_arg1.target.onDisable))){
_arg1.target.onDisable();
if (_arg1.target.activeDisable){
return (true);
};
};
return (false);
}
public function get currentProgress():Number{
return ((this.cachedTime / this.duration));
}
public function get repeat():int{
return (_repeat);
}
public function updateTo(_arg1:Object, _arg2:Boolean=false):void{
var _local4:String;
var _local5:Number;
var _local6:PropTween;
var _local7:Number;
var _local3:Number = this.ratio;
if (((((_arg2) && (!((this.timeline == null))))) && ((this.cachedStartTime < this.timeline.cachedTime)))){
this.cachedStartTime = this.timeline.cachedTime;
this.setDirtyCache(false);
if (this.gc){
this.setEnabled(true, false);
} else {
this.timeline.addChild(this);
};
};
for (_local4 in _arg1) {
this.vars[_local4] = _arg1[_local4];
};
if (this.initted){
this.initted = false;
if (!_arg2){
init();
if (((((!(_arg2)) && ((this.cachedTime > 0)))) && ((this.cachedTime < this.cachedDuration)))){
_local5 = (1 / (1 - _local3));
_local6 = this.cachedPT1;
while (_local6) {
_local7 = (_local6.start + _local6.change);
_local6.change = (_local6.change * _local5);
_local6.start = (_local7 - _local6.change);
_local6 = _local6.nextNode;
};
};
};
};
}
override public function set currentTime(_arg1:Number):void{
if (_cyclesComplete == 0){
} else {
if (((this.yoyo) && (((_cyclesComplete % 2) == 1)))){
_arg1 = ((this.duration - _arg1) + (_cyclesComplete * (this.cachedDuration + _repeatDelay)));
} else {
_arg1 = (_arg1 + (_cyclesComplete * (this.duration + _repeatDelay)));
};
};
setTotalTime(_arg1, false);
}
public function get repeatDelay():Number{
return (_repeatDelay);
}
public function killProperties(_arg1:Array):void{
var _local2:Object = {};
var _local3:int = _arg1.length;
while (--_local3 > -1) {
_local2[_arg1[_local3]] = true;
};
killVars(_local2);
}
public function set repeatDelay(_arg1:Number):void{
_repeatDelay = _arg1;
setDirtyCache(true);
}
public function set repeat(_arg1:int):void{
_repeat = _arg1;
setDirtyCache(true);
}
override public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
super.complete(_arg1, _arg2);
if (((!(_arg2)) && (_dispatcher))){
if ((((this.cachedTotalTime == this.cachedTotalDuration)) && (!(this.cachedReversed)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
} else {
if (((this.cachedReversed) && ((this.cachedTotalTime == 0)))){
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE));
};
};
};
}
override public function invalidate():void{
this.yoyo = Boolean((this.vars.yoyo == true));
_repeat = (this.vars.repeat) ? Number(this.vars.repeat) : 0;
_repeatDelay = (this.vars.repeatDelay) ? Number(this.vars.repeatDelay) : 0;
_hasUpdateListener = false;
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
};
setDirtyCache(true);
super.invalidate();
}
public function get timeScale():Number{
return (this.cachedTimeScale);
}
override public function get totalDuration():Number{
if (this.cacheIsDirty){
this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat));
this.cacheIsDirty = false;
};
return (this.cachedTotalDuration);
}
public static function set globalTimeScale(_arg1:Number):void{
if (_arg1 == 0){
_arg1 = 0.0001;
};
if (TweenLite.rootTimeline == null){
TweenLite.to({}, 0, {});
};
var _local2:SimpleTimeline = TweenLite.rootTimeline;
var _local3:Number = (getTimer() * 0.001);
_local2.cachedStartTime = (_local3 - (((_local3 - _local2.cachedStartTime) * _local2.cachedTimeScale) / _arg1));
_local2 = TweenLite.rootFramesTimeline;
_local3 = TweenLite.rootFrame;
_local2.cachedStartTime = (_local3 - (((_local3 - _local2.cachedStartTime) * _local2.cachedTimeScale) / _arg1));
TweenLite.rootFramesTimeline.cachedTimeScale = (TweenLite.rootTimeline.cachedTimeScale = _arg1);
}
public static function fromTo(_arg1:Object, _arg2:Number, _arg3:Object, _arg4:Object):TweenMax{
_arg4.startAt = _arg3;
if (_arg3.immediateRender){
_arg4.immediateRender = true;
};
return (new TweenMax(_arg1, _arg2, _arg4));
}
public static function allFromTo(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Object, _arg5:Number=0, _arg6:Function=null, _arg7:Array=null):Array{
_arg4.startAt = _arg3;
if (_arg3.immediateRender){
_arg4.immediateRender = true;
};
return (allTo(_arg1, _arg2, _arg4, _arg5, _arg6, _arg7));
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=true):void{
changePause(true, _arg1, _arg2);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:int;
var _local5:int;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2){
_local4 = _local2.length;
_local5 = 0;
while (--_local4 > -1) {
if (!TweenLite(_local2[_local4]).gc){
var _temp1 = _local5;
_local5 = (_local5 + 1);
var _local6 = _temp1;
_local3[_local6] = _local2[_local4];
};
};
};
return (_local3);
}
public static function get globalTimeScale():Number{
return (((TweenLite.rootTimeline)==null) ? 1 : TweenLite.rootTimeline.cachedTimeScale);
}
public static function killChildTweensOf(_arg1:DisplayObjectContainer, _arg2:Boolean=false):void{
var _local4:Object;
var _local5:DisplayObjectContainer;
var _local3:Array = getAllTweens();
var _local6:int = _local3.length;
while (--_local6 > -1) {
_local4 = _local3[_local6].target;
if ((_local4 is DisplayObject)){
_local5 = _local4.parent;
while (_local5) {
if (_local5 == _arg1){
if (_arg2){
_local3[_local6].complete(false);
} else {
_local3[_local6].setEnabled(false, false);
};
};
_local5 = _local5.parent;
};
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local4:TweenLite;
var _local2:Array = getTweensOf(_arg1);
var _local3:int = _local2.length;
while (--_local3 > -1) {
_local4 = _local2[_local3];
if (((_local4.active) || ((((_local4.cachedStartTime == _local4.timeline.cachedTime)) && (_local4.timeline.active))))){
return (true);
};
};
return (false);
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = _local4.length;
while (--_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
} else {
_local4[_local6].setEnabled(false, false);
};
};
};
}
private static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = _local4.length;
while (--_local6 > -1) {
_local5 = (TweenLite(_local4[_local6]).target == TweenLite(_local4[_local6]).vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
TweenCore(_local4[_local6]).paused = _arg1;
};
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function allFrom(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null):Array{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (allTo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6));
}
public static function getAllTweens():Array{
var _local4:Array;
var _local5:int;
var _local1:Dictionary = masterList;
var _local2:int;
var _local3:Array = [];
for each (_local4 in _local1) {
_local5 = _local4.length;
while (--_local5 > -1) {
if (!TweenLite(_local4[_local5]).gc){
var _temp1 = _local2;
_local2 = (_local2 + 1);
var _local8 = _temp1;
_local3[_local8] = _local4[_local5];
};
};
};
return (_local3);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=true):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function allTo(_arg1:Array, _arg2:Number, _arg3:Object, _arg4:Number=0, _arg5:Function=null, _arg6:Array=null):Array{
var i:int;
var varsDup:Object;
var p:String;
var onCompleteProxy:Function;
var onCompleteParamsProxy:Array;
var targets = _arg1;
var duration = _arg2;
var vars = _arg3;
var stagger = _arg4;
var onCompleteAll = _arg5;
var onCompleteAllParams = _arg6;
var l:int = targets.length;
var a:Array = [];
var curDelay:Number = (("delay" in vars)) ? Number(vars.delay) : 0;
onCompleteProxy = vars.onComplete;
onCompleteParamsProxy = vars.onCompleteParams;
var lastIndex:int = ((stagger)<=0) ? 0 : (l - 1);
i = 0;
while (i < l) {
varsDup = {};
for (p in vars) {
varsDup[p] = vars[p];
};
varsDup.delay = curDelay;
if ((((i == lastIndex)) && (!((onCompleteAll == null))))){
varsDup.onComplete = function ():void{
if (onCompleteProxy != null){
onCompleteProxy.apply(null, onCompleteParamsProxy);
};
onCompleteAll.apply(null, onCompleteAllParams);
};
};
a[a.length] = new TweenMax(targets[i], duration, varsDup);
curDelay = (curDelay + stagger);
i = (i + 1);
};
return (a);
}
TweenPlugin.activate([AutoAlphaPlugin, EndArrayPlugin, FramePlugin, RemoveTintPlugin, TintPlugin, VisiblePlugin, VolumePlugin, BevelFilterPlugin, BezierPlugin, BezierThroughPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, ColorTransformPlugin, DropShadowFilterPlugin, FrameLabelPlugin, GlowFilterPlugin, HexColorsPlugin, RoundPropsPlugin, ShortRotationPlugin, {}]);
}
}//package com.greensock
Section 83
//APIConnector (com.newgrounds.components.APIConnector)
package com.newgrounds.components {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class APIConnector extends MovieClip {
public var errorDialog:MovieClip;
public var background:MovieClip;
public var viewLatestButton:SimpleButton;
public var closeButton:SimpleButton;
public var viewAuthorizedButton:SimpleButton;
private var _initialized:Boolean;
private var _movieId:String;
private var _encryptionKey:String;
private var _movieVersion:String;
private var _showConnectingPopup:Boolean;// = true
private var _useErrorPopup:Boolean;// = true
private var _medalPopup:MedalPopup;
private var _popDelay:Timer;
public function APIConnector(){
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 6, this.frame7, 7, this.frame8);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
this.useErrorPopup = true;
this.useMedalPopup = true;
this._popDelay.addEventListener(TimerEvent.TIMER, this.errorTimerHandler);
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
if (stage){
addEventListener(Event.RENDER, this.renderHandler);
stage.invalidate();
} else {
this.clear();
};
}
public function get movieId():String{
return (this._movieId);
}
public function set movieId(_arg1:String):void{
this._movieId = _arg1;
}
public function get encryptionKey():String{
return (this._encryptionKey);
}
public function set encryptionKey(_arg1:String):void{
this._encryptionKey = _arg1;
}
public function get movieVersion():String{
return (this._movieVersion);
}
public function set movieVersion(_arg1:String):void{
this._movieVersion = _arg1;
}
public function get debugMode():Boolean{
return (API.debugMode);
}
public function set debugMode(_arg1:Boolean):void{
API.debugMode = true;
}
public function get useFakeSession():Boolean{
return (API.getFakeSession());
}
public function set useFakeSession(_arg1:Boolean):void{
API.setFakeSession(true);
}
public function get useMedalPopup():Boolean{
return (!((this._medalPopup == null)));
}
public function set useMedalPopup(_arg1:Boolean):void{
if (((_arg1) && (!(this._medalPopup)))){
this._medalPopup = new MedalPopup();
addChild(this._medalPopup);
} else {
if (((!(_arg1)) && (this._medalPopup))){
removeChild(this._medalPopup);
this._medalPopup = null;
};
};
}
public function get useErrorPopup():Boolean{
return (this._useErrorPopup);
}
public function set useErrorPopup(_arg1:Boolean):void{
this._useErrorPopup = _arg1;
API.addEventListener(APIEvent.API_CONNECTED, this.movieConnectedHandler);
if (this._useErrorPopup){
API.addEventListener(APIEvent.NEW_VERSION_AVAILABLE, this.newVersionAvailableHandler);
API.addEventListener(APIEvent.HOST_BLOCKED, this.hostBlockedHandler);
} else {
API.removeEventListener(APIEvent.NEW_VERSION_AVAILABLE, this.newVersionAvailableHandler);
API.removeEventListener(APIEvent.HOST_BLOCKED, this.hostBlockedHandler);
};
}
public function get showConnectingPopup():Boolean{
return (this._showConnectingPopup);
}
public function set showConnectingPopup(_arg1:Boolean):void{
this._showConnectingPopup = _arg1;
if (((!(_arg1)) && ((((currentLabel == "connecting")) || ((currentLabel == "connected")))))){
this.clear();
};
}
public function clear():void{
gotoAndStop("idle");
}
public function connect():void{
API.setVersion(this._movieVersion);
API.connect(root.loaderInfo, this._movieId, this._encryptionKey);
visible = true;
if (this.showConnectingPopup){
gotoAndStop("connecting");
};
}
private function renderHandler(_arg1:Event):void{
removeEventListener(Event.RENDER, this.renderHandler);
this.clear();
this.connect();
}
private function movieConnectedHandler(_arg1:APIEvent):void{
if (_arg1.success){
if (((((((API.isPublishedHost()) && (API.hostIsCompatible()))) && (!(API.hasUserSession())))) && (!(API.debugMode)))){
gotoAndStop("no_login");
this._popDelay.start();
visible = true;
} else {
if (this.showConnectingPopup){
gotoAndStop("connected");
};
};
} else {
gotoAndStop("no_connect");
this._popDelay.start();
visible = true;
};
}
private function newVersionAvailableHandler(_arg1:APIEvent):void{
gotoAndStop("new_version");
visible = true;
this.centerOnStage();
}
private function hostBlockedHandler(_arg1:APIEvent):void{
gotoAndStop("bad_host");
visible = true;
this.centerOnStage();
}
private function closeButtonClickHandler(_arg1:Event):void{
this.clear();
}
private function officialVersionClickHandler(_arg1:Event):void{
API.loadOfficialURL();
}
private function enterFrameHandler(_arg1:Event):void{
this.forceAlwaysOnTop();
}
private function initButtons():void{
if (this.viewLatestButton){
this.viewLatestButton.addEventListener(MouseEvent.CLICK, this.officialVersionClickHandler);
};
if (this.viewAuthorizedButton){
this.viewAuthorizedButton.addEventListener(MouseEvent.CLICK, this.officialVersionClickHandler);
};
if (this.closeButton){
this.closeButton.addEventListener(MouseEvent.CLICK, this.closeButtonClickHandler);
};
}
private function forceAlwaysOnTop():void{
var myIndex:uint;
var topIndex:uint;
if (((parent) && (visible))){
try {
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
} catch(e:Error) {
};
};
}
private function centerOnStage():void{
if (stage){
x = (stage.stageWidth / 2);
y = (stage.stageHeight / 2);
};
}
private function errorTimerHandler(_arg1:TimerEvent):void{
if (this.errorDialog){
this.errorDialog.gotoAndPlay("closeme");
} else {
this.clear();
};
}
function frame1(){
stop();
}
function frame7(){
this.initButtons();
}
function frame8(){
this.initButtons();
}
}
}//package com.newgrounds.components
Section 84
//FlashAd (com.newgrounds.components.FlashAd)
package com.newgrounds.components {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class FlashAd extends Sprite {
public var background:MovieClip;
private var _showBackground:Boolean;
private var _adURLLoader:URLLoader;
private var _adRect:Sprite;
private var _mask:Shape;
private var _ad:Loader;
private static const DEBUG_AD_URL:String = "http://www.ngads.com/adtest.php";
private static const REMOVED_FROM_STAGE:String = "removedFromStage";
private static var _adResetTime:uint = 0;
private static var _adURL:URLRequest;
public function FlashAd(_arg1:Boolean=true){
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
Security.allowDomain("server.cpmstar.com");
this._adRect = new Sprite();
this._adRect.graphics.beginFill(0);
this._adRect.graphics.moveTo(0, 0);
this._adRect.graphics.lineTo(300, 0);
this._adRect.graphics.lineTo(300, 250);
this._adRect.graphics.lineTo(0, 250);
this._adRect.graphics.lineTo(0, 0);
this._adRect.graphics.endFill();
this._mask = new Shape();
this._mask.graphics.beginFill(0);
this._mask.graphics.moveTo(0, 0);
this._mask.graphics.lineTo(300, 0);
this._mask.graphics.lineTo(300, 250);
this._mask.graphics.lineTo(0, 250);
this._mask.graphics.lineTo(0, 0);
this._mask.graphics.endFill();
addChild(this._adRect);
this._adRect.addChild(this._mask);
this._adRect.visible = false;
x = Math.round(x);
y = Math.round(y);
scaleX = 1;
scaleY = 1;
if (this.background){
if (this.background.ngLinkButton){
this.background.ngLinkButton.addEventListener(MouseEvent.CLICK, this.linkClickHandler);
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
if (API.isFlashVersion(9, 0, 28)){
addEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
};
if (API.adsApproved){
this.loadAdFeed(API.adFeedURL);
} else {
API.addEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false, 0, true);
};
this.showBackground = _arg1;
}
public function get showBackground():Boolean{
return (this._showBackground);
}
public function set showBackground(_arg1:Boolean):void{
this._showBackground = _arg1;
if (this.background){
this.background.visible = _arg1;
this._adRect.mask = (_arg1) ? this.background.adMask : null;
};
}
public function removeAd():void{
removeEventListener(REMOVED_FROM_STAGE, this.onRemovedFromStage);
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
if (this._adURLLoader){
try {
this._adURLLoader.close();
} catch(e:Error) {
};
};
if (this._adRect){
this._adRect.visible = false;
};
if (this._ad){
trace("[NewgroundsAPI] :: Ad removed");
try {
this._ad.close();
} catch(e:Error) {
};
try {
Object(this._ad).unloadAndStop(true);
} catch(e:Error) {
_ad.unload();
};
if (this._ad.parent){
this._ad.parent.removeChild(this._ad);
};
};
this._ad = null;
}
private function onAdsApproved(_arg1:APIEvent):void{
API.removeEventListener(APIEvent.ADS_APPROVED, this.onAdsApproved, false);
if (_arg1.success){
this.loadAdFeed(API.adFeedURL);
} else {
trace("[NewgroundsAPI] :: No ad feed URL supplied to Newgrounds API ad!");
};
}
private function loadAdFeed(_arg1:String):void{
var adFeedURL = _arg1;
this._adURLLoader = new URLLoader();
this._adURLLoader.addEventListener(Event.COMPLETE, this.onAdFeedLoaded);
this._adURLLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
this._adURLLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onAdError);
if (!adFeedURL){
trace("[Newgrounds API] :: Invalid feed URL!");
return;
};
if (this.hasAdElapsed){
if (adFeedURL.indexOf("?") > -1){
_adURL = new URLRequest(((adFeedURL + "&random=") + Math.random()));
} else {
_adURL = new URLRequest(((adFeedURL + "?random=") + Math.random()));
};
};
try {
this._adURLLoader.load(_adURL);
} catch(e:Error) {
onAdError(null);
};
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function loadAd(_arg1:String):void{
var url = _arg1;
if (this._ad){
this.removeAd();
};
this._ad = new Loader();
this._ad.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onAdLoaded);
this._ad.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onAdError);
try {
Object(this._ad.contentLoaderInfo).uncaughtErrorEvents.addEventListener("uncaughtError", function (_arg1:Event):void{
});
} catch(error:Error) {
};
this._ad.load(new URLRequest(url), new LoaderContext(false, new ApplicationDomain(null)));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = true;
};
}
private function onAdFeedLoaded(_arg1:Event):void{
var _local2:URLLoader = URLLoader(_arg1.target);
if (((_local2.data) && (!((_local2.data == ""))))){
this.loadAd((_local2.data as String));
} else {
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
};
}
private function onAdFeedError(_arg1:Event):void{
trace("[NewgroundsAPI] :: Unable to load ad feed!");
if (((this.background) && (this.background.loadingClip))){
this.background.loadingClip.visible = false;
};
}
private function onAdError(_arg1:Event):void{
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, false, new APIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad")));
this.removeAd();
}
private function onAdLoaded(_arg1:Event):void{
this._adRect.addChild(this._ad);
this._ad.mask = this._mask;
this._adRect.visible = true;
if (this.background){
if (this._showBackground){
this._adRect.mask = this.background.adMask;
};
if (this.background.loadingClip){
this.background.loadingClip.visible = false;
};
};
trace("[NewgroundsAPI] :: Ad loaded!");
dispatchEvent(new APIEvent(APIEvent.AD_ATTACHED, true));
}
private function onRemovedFromStage(_arg1:Event):void{
this.removeAd();
}
private function get hasAdElapsed():Boolean{
if (getTimer() >= _adResetTime){
_adResetTime = (getTimer() + ((1000 * 60) * 5));
return (true);
};
return (false);
}
private function linkClickHandler(_arg1:MouseEvent):void{
API.loadNewgrounds();
}
}
}//package com.newgrounds.components
Section 85
//MedalPopup (com.newgrounds.components.MedalPopup)
package com.newgrounds.components {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public class MedalPopup extends MovieClip {
public var medalNameText:TextField;
public var medalValueText:TextField;
public var medalContainer:Sprite;
private var _initialized:Boolean;
private var _medal:Medal;
private var _medalIcon:Bitmap;
private var _medalQueue:Array;
private var _popDelay:Timer;
public function MedalPopup(){
this._medalQueue = [];
this._popDelay = new Timer(3000, 1);
super();
addFrameScript(0, this.frame1, 9, this.frame10, 18, this.frame19);
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
visible = false;
addEventListener(Event.ENTER_FRAME, this.enterFrameHandler);
stop();
API.addEventListener(APIEvent.MEDAL_UNLOCKED, this.onMedalUnlocked, false, 0, true);
this._popDelay.addEventListener(TimerEvent.TIMER, this.timerHandler);
}
public function get popupTime():Number{
return ((this._popDelay.delay / 1000));
}
public function set popupTime(_arg1:Number):void{
if (isNaN(_arg1)){
_arg1 = 3;
};
this._popDelay.delay = (_arg1 * 1000);
}
private function enterFrameHandler(_arg1:Event):void{
var myIndex:uint;
var topIndex:uint;
var event = _arg1;
if (((this._medalQueue.length) && (!(visible)))){
this._medal = this._medalQueue.pop();
this._popDelay.start();
gotoAndPlay("medal_show");
visible = true;
};
if (((visible) && (parent))){
try {
myIndex = parent.getChildIndex(this);
topIndex = (parent.numChildren - 1);
if (myIndex != topIndex){
parent.setChildIndex(this, topIndex);
};
} catch(error:Error) {
};
};
}
private function onMedalUnlocked(_arg1:APIEvent):void{
if (((((_arg1.success) && (_arg1.data))) && ((_arg1.data.medal is Medal)))){
this._medalQueue.push(Medal(_arg1.data.medal));
};
}
private function showMedalInfo():void{
if (!this._medal){
return;
};
if (this.medalContainer){
this._medalIcon = this._medal.createIconBitmap();
this.medalContainer.addChild(this._medalIcon);
};
if (this.medalNameText){
this.medalNameText.text = this._medal.name;
};
if (this.medalValueText){
this.medalValueText.text = (this._medal.value.toString() + "pts");
};
this._popDelay.start();
stop();
}
private function timerHandler(_arg1:TimerEvent):void{
if (((this._medalIcon) && (this._medalIcon.parent))){
this._medalIcon.parent.removeChild(this._medalIcon);
this._medalIcon = null;
};
gotoAndPlay("medal_hide");
this._popDelay.stop();
}
function frame1(){
stop();
}
function frame10(){
this.showMedalInfo();
stop();
}
function frame19(){
stop();
visible = false;
}
}
}//package com.newgrounds.components
Section 86
//ScoreTable (com.newgrounds.components.ScoreTable)
package com.newgrounds.components {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public class ScoreTable extends MovieClip {
public var boardNameText:TextField;
public var ngLinkButton:DisplayObject;
public var scoreRows:Sprite;
public var periodList:MovieClip;
private var _period:String;// = "Today"
private var _boardName:String;// = "High Scores"
public static const RESULTS_PER_PAGE:uint = 10;
public function ScoreTable(_arg1:String="High Scores", _arg2:String="Today"){
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return;
};
stop();
if (((_arg1) && (!((_arg1 == ""))))){
this._boardName = _arg1;
};
if (stage){
addEventListener(Event.RENDER, this.renderHandler);
stage.invalidate();
} else {
this.init();
this.loadScores();
};
}
public function get boardName():String{
return (this._boardName);
}
public function set boardName(_arg1:String):void{
if (((this.boardName) && (!((this.boardName == ""))))){
this._boardName = _arg1;
} else {
this.boardName = "High Scores";
};
}
public function get period():String{
return (this._period);
}
public function set period(_arg1:String):void{
this._period = _arg1;
}
private function init():void{
stop();
this.clearBoard();
this._period = this.period;
if (this.periodList){
this.periodList.buttonMode = true;
this.periodList.useHandCursor = true;
this.periodList.gotoAndStop("listIdle");
this.periodList.addEventListener(MouseEvent.CLICK, this.periodListClickHandler);
};
if (this.ngLinkButton){
this.ngLinkButton.addEventListener(MouseEvent.CLICK, this.onNgLinkClicked);
};
}
private function onNgLinkClicked(_arg1:MouseEvent):void{
API.loadNewgrounds();
}
private function renderHandler(_arg1:Event):void{
removeEventListener(Event.RENDER, this.renderHandler);
this.init();
this.loadScores();
}
private function periodListClickHandler(_arg1:MouseEvent):void{
if (!this.periodList){
return;
};
if (this.periodList.currentLabel == "listIdle"){
this.periodList.gotoAndStop("listSelecting");
} else {
if (_arg1.target == this.periodList.period0){
this.period = ScoreBoardPeriod.TODAY;
this.loadScores();
} else {
if (_arg1.target == this.periodList.period1){
this.period = ScoreBoardPeriod.WEEK;
this.loadScores();
} else {
if (_arg1.target == this.periodList.period2){
this.period = ScoreBoardPeriod.MONTH;
this.loadScores();
} else {
if (_arg1.target == this.periodList.period3){
this.period = ScoreBoardPeriod.YEAR;
this.loadScores();
} else {
if (_arg1.target == this.periodList.period4){
this.period = ScoreBoardPeriod.ALL_TIME;
this.loadScores();
};
};
};
};
};
this.periodList.gotoAndStop("listIdle");
};
}
private function clearBoard():void{
var _local2:MovieClip;
if (!this.scoreRows){
return;
};
var _local1:uint;
while (_local1 < RESULTS_PER_PAGE) {
_local2 = this.scoreRows[("score_row_" + _local1)];
if (_local2){
_local2.gotoAndStop(((_local1 % 2) + 1));
if (_local2.positionText){
_local2.positionText.text = "";
};
if (_local2.usernameText){
_local2.usernameText.text = "";
};
if (_local2.scoreText){
_local2.scoreText.text = "";
};
};
_local1++;
};
}
public function loadScores(_arg1:uint=1):void{
this.clearBoard();
if (((this.periodList) && (this.periodList.periodText))){
this.periodList.periodText.text = this._period;
};
if (this.boardNameText){
this.boardNameText.text = this._boardName;
};
var _local2:ScoreBoard = API.getScoreBoard(this._boardName);
if (!_local2){
trace((("[WARNING] :: Could not initialize the scoreboard for '" + this._boardName) + "'"));
return;
};
API.addEventListener(APIEvent.SCORES_LOADED, this.onScoresLoaded, false, 0, true);
_local2.loadScores(this._period, _arg1, RESULTS_PER_PAGE);
}
private function onScoresLoaded(_arg1:APIEvent):void{
var _local4:MovieClip;
API.removeEventListener(APIEvent.SCORES_LOADED, this.onScoresLoaded);
var _local2:ScoreBoard = (_arg1.data.board as ScoreBoard);
if (((((!(_arg1.success)) || (!(_local2)))) || (!(_local2.scores)))){
this.clearBoard();
return;
};
if (!this.scoreRows){
return;
};
var _local3:uint;
while (_local3 < RESULTS_PER_PAGE) {
_local4 = this.scoreRows[("score_row_" + _local3)];
if (((_local4) && (_local2.scores[_local3]))){
if (_local4.positionText){
_local4.positionText.text = (_local2.scores[_local3].position.toString() + ":");
};
if (_local4.usernameText){
_local4.usernameText.text = _local2.scores[_local3].username;
};
if (_local4.scoreText){
_local4.scoreText.text = _local2.scores[_local3].value.toString();
};
};
_local3++;
};
}
}
}//package com.newgrounds.components
Section 87
//API (com.newgrounds.API)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import com.newgrounds.components.*;
import flash.utils.*;
import com.adobe.serialization.json.*;
import flash.net.*;
import com.adobe.crypto.*;
import com.adobe.images.*;
import flash.system.*;
public class API {
public static const VERSION:String = "2.4.18";
private static const GATEWAY_URL:String = "http://www.ngads.com/gateway_v2.php";
private static const AD_TERMS_URL:String = "http://www.newgrounds.com/wiki/flashads/terms/";
private static const COMMANDS_WIKI_URL:String = "http://www.newgrounds.com/wiki/flashapi/commands/";
private static var do_echo:Boolean = false;
private static var _debug:Boolean = true;
private static var _connected:Boolean = false;
private static var _isMetadataLoaded:Boolean = false;
private static var _preloadComplete:Boolean = false;
private static var _adsApproved:Boolean = false;
private static var _saveGroupId:uint;
private static var _saveFileId:uint;
private static var _trackerId:uint;
private static var _movieId:String;
private static var _encryptionKey:String;
private static var _url:String;
private static var _host:String;
private static var connected:Boolean;
private static var version:String;
private static var ad_url:String;
private static var _fakeSession:Boolean = false;
private static var publisher_id:uint;
private static var session_id:String;
private static var user_email:String;
private static var user_name:String;
private static var user_id:uint;
private static var userpage_format:String;
private static var _medals:Array;
private static var timeoutTimer:Timer = new Timer(8000, 1);
private static var _userpageFormat:String;
private static var _scoreboards:Array = new Array();
private static var _bridge:Bridge;
private static var save_file:SaveFile;
private static var _imageFilePath:String;
private static var _saveFilePath:String;
private static var _saveGroups:Array = [];
private static var root:DisplayObject;
private static var _eventDispatcher:EventDispatcher = new EventDispatcher();
private static var score_page_counts:Object = new Object();
private static var compression_radix:String = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
private static var compressor:BaseN = new BaseN(compression_radix);
public static var errors:Dictionary = APIError.init_codes();
private static var sharedObjects:Dictionary = new Dictionary();
private static var _preloadAssets:Array = [];
public static var periods:Object = getPeriodAliases();
private static var period_aliases:Object = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
private static var secureCommand:String;
public static function get adFeedURL():String{
return (ad_url);
}
public static function get preloadComplete():Boolean{
return (_preloadComplete);
}
private static function assertConnected():Boolean{
if (!_connected){
return (false);
};
return (true);
}
public static function setVersion(_arg1:String):void{
if (((_arg1) && (!((_arg1 == ""))))){
version = _arg1;
};
}
public static function setUserEmail(_arg1:String):void{
user_email = _arg1;
}
public static function setFakeSession(_arg1:Boolean):void{
_fakeSession = _arg1;
}
public static function getFakeSession():Boolean{
return (_fakeSession);
}
public static function get debugMode():Boolean{
return (_debug);
}
public static function set debugMode(_arg1:Boolean):void{
_debug = _arg1;
}
public static function getTrackerID():uint{
return (_trackerId);
}
public static function getUserID():uint{
return (user_id);
}
public static function getUserName():String{
return (user_name);
}
public static function isConnected():Boolean{
return (_connected);
}
public static function getID():uint{
return (_trackerId);
}
public static function getOfficialURL():String{
var _local1:String = ((((((GATEWAY_URL + "?tracker_id=") + _movieId) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random());
if (debugMode){
_local1 = (_local1 + "&debug=1");
};
return (_local1);
}
public static function get adsApproved():Boolean{
return (_adsApproved);
}
public static function hasUserSession():Boolean{
return (((((!((session_id == null))) && (!((session_id == ""))))) && (!((publisher_id == 0)))));
}
public static function isNewgrounds():Boolean{
return ((((publisher_id == 1)) || (((_host) && ((_host.toLowerCase().indexOf("ungrounded.net") > -1))))));
}
public static function hostIsCompatible():Boolean{
return (!((publisher_id == 0)));
}
public static function hasUserEmail():Boolean{
return (((!((user_email == null))) && (!((user_email == "")))));
}
public static function connectionTimeOut(_arg1:Event=null):void{
dispatchEvent(new APIEvent(APIEvent.API_CONNECTED, false, new APIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out.")));
}
public static function connect(_arg1:LoaderInfo, _arg2:String, _arg3:String=null):void{
var loaderInfo = _arg1;
var m_id = _arg2;
var encrypt_key = _arg3;
if (!loaderInfo){
fatalError("Null loaderInfo paremeter passed in to connectMovie!", "");
return;
};
try {
if (loaderInfo.loader){
loaderInfo = loaderInfo.loader.loaderInfo;
};
} catch(error:Error) {
};
_url = loaderInfo.url;
_host = _url;
if ((((_host.indexOf("http://") > -1)) || ((_host.indexOf("https://") > -1)))){
_host = _host.split("/")[2].toLowerCase();
} else {
_host = "localhost";
};
var flashVars:Object = loaderInfo.parameters;
if (isPublishedHost()){
debugMode = false;
};
if (((!(debugMode)) && (flashVars))){
if (flashVars.NewgroundsAPI_UserName){
user_name = flashVars.NewgroundsAPI_UserName;
};
if (flashVars.NewgroundsAPI_UserID){
user_id = flashVars.NewgroundsAPI_UserID;
};
if (flashVars.NewgroundsAPI_PublisherID){
publisher_id = flashVars.NewgroundsAPI_PublisherID;
} else {
publisher_id = 0;
};
if (flashVars.NewgroundsAPI_UserpageFormat){
_userpageFormat = flashVars.NewgroundsAPI_UserpageFormat;
};
if (flashVars.NewgroundsAPI_SessionID){
session_id = flashVars.NewgroundsAPI_SessionID;
};
if (flashVars.NewgroundsAPI_SaveGroupID){
_saveGroupId = flashVars.NewgroundsAPI_SaveGroupID;
};
if (flashVars.NewgroundsAPI_SaveFileID){
_saveFileId = flashVars.NewgroundsAPI_SaveFileID;
};
if (flashVars.NewgroundsAPI_SandboxID){
_bridge = new Bridge(flashVars.NewgroundsAPI_SandboxID);
};
} else {
publisher_id = 1;
if (_fakeSession){
session_id = "D3bu64p1U53R";
user_id = 10;
user_name = "API-Debugger";
};
};
if (connected){
fatalError("NewgroundsAPI.connect() - connection already in progress", "connect");
return;
};
timeoutTimer.start();
if (!m_id){
fatalError("NewgroundsAPI.connectMovie() - missing required movieId parameter", "connectMovie");
};
_movieId = String(m_id);
_trackerId = uint(_movieId.substring(0, _movieId.indexOf(":")));
_encryptionKey = encrypt_key;
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
private static function getHost():String{
return (_host);
}
public static function isPublishedHost():Boolean{
return (((!((getHost() == "localhost"))) && ((getHost().indexOf("file://") == -1))));
}
public static function loadUserPage(_arg1:uint=0, _arg2:String=null):Boolean{
var _local3:String;
if ((((_arg1 == 0)) && ((_arg2 == null)))){
if (hasUserSession()){
_arg1 = user_id;
_arg2 = user_name;
} else {
return (false);
};
};
if (publisher_id == 1){
_local3 = (("http://" + _arg2.toLowerCase()) + ".newgrounds.com");
navigateToURL(new URLRequest(_local3), "_blank");
return (true);
};
if (userpage_format){
_local3 = userpage_format;
_local3 = _local3.split(":user_id:").join(_arg1.toString());
_local3 = _local3.split(":user_name:").join(escape(_arg2));
navigateToURL(new URLRequest(_local3), "_blank");
return (true);
};
return (false);
}
public static function loadNewgrounds():void{
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
public static function loadOfficialURL():void{
navigateToURL(new URLRequest(getOfficialURL()));
}
public static function loadMySite():void{
sendCommand("loadMySite", {host:getHost()}, true);
}
public static function loadCustomLink(_arg1:String):void{
sendCommand("loadCustomLink", {host:getHost(), link:_arg1}, true);
}
public static function logCustomEvent(_arg1:String):void{
sendCommand("logCustomEvent", {host:getHost(), event:_arg1});
}
public static function getScoreBoard(_arg1:String):ScoreBoard{
var _local2:ScoreBoard;
for each (_local2 in _scoreboards) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function getScoreBoardById(_arg1:uint):ScoreBoard{
var _local2:ScoreBoard;
for each (_local2 in _scoreboards) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function postScore(_arg1:String, _arg2:uint, _arg3:String=""):void{
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
if (_arg3 == null){
_arg3 = "";
};
sendSecureCommand("postScore", {user_name:user_name, board:_arg1, value:_arg2, publisher_id:publisher_id, tag:_arg3});
}
public static function loadScores(_arg1:String, _arg2:String=null, _arg3:String=null):void{
var _local4 = "loadScores";
var _local5:ScoreBoard = getScoreBoard(_arg1);
if (((!(_local5)) || (!(_local5.id)))){
sendError({command_id:getCommandID(_local4)}, new APIError("MISSING_PARAM", "missing required ScoreBoard instance"));
return;
};
var _local6:Object = {};
_local6.publisher_id = publisher_id;
if (_arg2){
_local6.period = _arg2;
} else {
_local6.period = _local5.period;
};
_local6.board = _local5.id;
_local6.num_results = _local5.num_results;
_local6.page = _local5.page;
if (((!(_arg3)) || ((_arg3 == "")))){
_local6.tag = _local5.tag;
} else {
_local6.tag = _arg3;
};
sendCommand(_local4, _local6);
}
public static function loadScoresInRange(_arg1:String, _arg2:String="All-Time", _arg3:uint=1, _arg4:uint=10):void{
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("postScore")}, new APIError("MISSING_PARAM", "missing required parameter(s)"));
return;
};
var _local5:ScoreBoard = getScoreBoard(_arg1);
if (_local5){
_local5.loadScoresInRange(_arg2, _arg3, _arg4);
} else {
sendWarning((("loadScoresInRange: Scoreboard " + _arg1) + " could not be found."));
};
}
private static function populateMedals(_arg1:Array):void{
var _local2:uint;
var _local3:Object;
if (_medals === null){
_medals = new Array();
_local2 = 0;
while (_local2 < _arg1.length) {
_local3 = _arg1[_local2];
_medals.push(Medal.createFromObject(_local3));
_local2++;
};
};
sendMessage("Medals loaded!");
}
private static function populateSaveGroups(_arg1:Array):void{
var _local3:SaveGroup;
_saveGroups = [];
var _local2:uint;
while (_local2 < _arg1.length) {
_local3 = SaveGroup.createFromObject(_arg1[_local2]);
_saveGroups.push(_local3);
_local2++;
};
}
private static function populateScoreBoards(_arg1:Array):void{
_scoreboards = [];
var _local2:uint;
while (_local2 < _arg1.length) {
_scoreboards.push(new ScoreBoard(_arg1[_local2].id, _arg1[_local2].name, ""));
_local2++;
};
}
public static function getMedals():Array{
return (_medals);
}
public static function getMedalById(_arg1:uint):Medal{
var _local2:Medal;
for each (_local2 in _medals) {
if (_local2.id == _arg1){
return (_local2);
};
};
return (null);
}
public static function getMedal(_arg1:String):Medal{
var _local2:Medal;
for each (_local2 in _medals) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
public static function unlockMedal(_arg1:String):void{
var _local3:Object;
var _local4:Object;
if (((!(_arg1)) || ((_arg1 == "")))){
sendError({command_id:getCommandID("unlockMedal")}, new APIError("MISSING_PARAM", "missing required medal name"));
return;
};
var _local2:Medal = getMedal(_arg1);
if (!_local2){
sendMessage(("No medal with name: " + _arg1));
return;
};
if (((hasUserSession()) || (debugMode))){
sendMessage((("Attempting to unlock '" + _local2.name) + "'"));
if (_local2.unlocked){
sendWarning((("Medal '" + _local2.name) + "' is already unlocked!"));
return;
};
_local3 = new Object();
_local3.medal_id = _local2.id;
sendSecureCommand("unlockMedal", _local3);
} else {
sendMessage(("Locally unlocking " + _local2.name));
if (_local2.unlocked){
sendWarning((("Medal '" + _local2.name) + "' is already unlocked!"));
return;
};
_local2.unlocked = true;
_local4 = loadLocal("medals_unlocked");
if (!_local4){
_local4 = new Object();
};
_local4[_local2.id.toString()] = true;
saveLocal("medals_unlocked", _local4);
callListener(APIEvent.UNLOCK_MEDAL, true, {medal:_local2});
};
}
public static function loadMedals():void{
if (_medals){
dispatchEvent(new APIEvent(APIEvent.MEDALS_LOADED, true, {medals:getMedals()}));
return;
};
var _local1:Object = new Object();
if (hasUserSession()){
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
};
sendCommand("getMedals", _local1);
}
public static function saveLocal(_arg1:String, _arg2:Object, _arg3:uint=0):void{
var sharedObj:SharedObject;
var save_id = _arg1;
var save_data = _arg2;
var size_allocation = _arg3;
try {
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
sharedObj.data[save_id] = encodeData(save_data);
sharedObj.flush();
} catch(e:Error) {
sendWarning(("saveLocal ERROR: " + e));
};
}
public static function loadLocal(_arg1:String):Object{
var sharedObj:SharedObject;
var save_id = _arg1;
try {
if (!sharedObjects[save_id]){
sharedObjects[save_id] = SharedObject.getLocal(((("ng_ap_secure_" + _trackerId) + "_") + save_id));
};
sharedObj = sharedObjects[save_id];
if (((((sharedObj) && (sharedObj.data))) && (sharedObj.data[save_id]))){
return (decodeData(sharedObj.data[save_id]));
} else {
return (null);
};
} catch(e:Error) {
sendWarning(("loadLocal ERROR: " + e));
};
return (null);
}
public static function encodeData(_arg1:Object):String{
return (compressHex(RC4.encrypt(JSON.encode(_arg1), _encryptionKey)));
}
public static function decodeData(_arg1:String){
return (JSON.decode(RC4.decrypt(uncompressHex(_arg1), _encryptionKey)));
}
private static function compressHex(_arg1:String):String{
var _local2:uint = (_arg1.length % 6);
var _local3 = "";
var _local4:uint;
while (_local4 < _arg1.length) {
_local3 = (_local3 + compressor.encode(uint(("0x" + _arg1.substr(_local4, 6))), 4));
_local4 = (_local4 + 6);
};
return ((_local2.toString() + _local3));
}
private static function uncompressHex(_arg1:String):String{
var _local4:uint;
var _local6:String;
var _local7:uint;
var _local8:String;
var _local2:uint = uint(_arg1.charAt(0));
var _local3 = "";
var _local5:uint = 1;
while (_local5 < _arg1.length) {
_local6 = _arg1.substr(_local5, 4);
_local7 = uint(compressor.decode(_local6));
_local8 = _local7.toString(16);
if ((_local5 + 4) < _arg1.length){
_local4 = 6;
} else {
_local4 = _local2;
};
while (_local8.length < _local4) {
_local8 = ("0" + _local8);
};
_local3 = (_local3 + _local8);
_local5 = (_local5 + 4);
};
return (_local3);
}
public static function getSaveGroupById(_arg1:uint):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var _local2:uint;
while (_local2 < _saveGroups.length) {
if (_saveGroups[_local2].id == _arg1){
return (_saveGroups[_local2]);
};
_local2++;
};
return (null);
}
public static function getSaveGroup(_arg1:String):SaveGroup{
if (((!(_saveGroups)) || ((_saveGroups.length < 1)))){
sendWarning("No save groups found");
return (null);
};
var _local2:uint;
while (_local2 < _saveGroups.length) {
if (_saveGroups[_local2].name == _arg1){
return (_saveGroups[_local2]);
};
_local2++;
};
return (null);
}
public static function getCurrentSaveFile(){
return (save_file);
}
public static function setCurrentSaveFile(_arg1:SaveFile){
save_file = _arg1;
}
public static function newSaveQuery(_arg1:String):SaveGroupQuery{
var _local2:SaveGroup = getSaveGroup(_arg1);
if (_local2){
return (_local2.newQuery());
};
return (null);
}
public static function executeSaveQuery(_arg1:SaveGroupQuery):void{
sendCommand("lookupSaveFiles", {publisher_id:publisher_id, group_id:_arg1.groupId, query:JSON.encode(_arg1.toObject())}, false, null, _arg1);
}
public static function lookupSaveFiles(_arg1:SaveGroup):void{
var _local2:SaveGroupQuery = _arg1.getQuery(false);
sendCommand("lookupSaveFiles", {publisher_id:publisher_id, group_id:_arg1.id, query:_local2.toObject()}, false, null, _local2);
}
public static function checkFilePrivledges(_arg1:SaveFile):void{
sendCommand("checkFilePrivs", {group:_arg1.groupId, filename:_arg1.name, user_id:(user_id) ? user_id : 0, publisher_id:publisher_id});
}
public static function newSaveFile(_arg1:String):SaveFile{
var _local2:SaveGroup = getSaveGroup(_arg1);
if (_local2){
return (new SaveFile(_local2));
};
sendError({command_id:"newSaveFile"}, new APIError("INVALID_SAVE_GROUP", (("'" + _local2) + "' is not a valid save group.")));
return (null);
}
public static function saveFile(_arg1:SaveFile, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Object = _arg1.toObject();
_local4.user_name = user_name;
if (_arg1.id){
_local4.save_id = _arg1.id;
};
_local4.overwrite = (_arg2) ? 1 : 0;
if (_arg3){
_local4.draft = 1;
};
var _local5:ByteArray = new ByteArray();
if ((_arg1.contents is ByteArray)){
_local5.writeByte(0);
_local5.writeBytes(_arg1.contents);
} else {
_local5.writeByte(1);
_local5.writeObject(_arg1.contents);
};
_local5.compress();
var _local6:Object = new Object();
_local6.file = _local5;
if (_arg1.thumbnail){
_local6.thumbnail = PNGEncoder.encode(_arg1.thumbnail);
};
save_file = _arg1;
sendSecureCommand("saveFile", _local4, null, _local6, _arg1);
}
public static function rateSaveFile(_arg1:SaveFile, _arg2:SaveRating, _arg3:Number):void{
sendSecureCommand("rateSaveFile", {group:_arg1.groupId, save_id:_arg1.id, rating_id:_arg2.id, vote:_arg3, user_id:user_id}, null, null, _arg1);
}
public static function loadSaveFile(_arg1:Number, _arg2:Boolean=true){
var _local3:Object = {publisher_id:publisher_id, save_id:_arg1, get_contents:_arg2};
save_file = null;
sendCommand("loadSaveFile", _local3);
}
public static function loadFilesByDate(_arg1:String, _arg2:Boolean=true, _arg3:String=null, _arg4=null):void{
var _local7:*;
var _local5:SaveGroup = getSaveGroup(_arg1);
if (!_local5){
_local7 = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByDate"}, _local7);
return;
};
var _local6:SaveGroupQuery = _local5.newQuery();
if (_arg3){
_local6.addKeyCondition(_arg3, "=", _arg4);
};
_local6.sortOn(SaveGroupQuery.CREATED_ON, _arg2);
_local6.execute();
}
public static function loadFilesByViews(_arg1:String, _arg2:Boolean=true, _arg3:String=null, _arg4=null):void{
var _local7:*;
var _local5:SaveGroup = getSaveGroup(_arg1);
if (!_local5){
_local7 = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByViews"}, _local7);
return;
};
var _local6:SaveGroupQuery = _local5.newQuery();
if (_arg3){
_local6.addKeyCondition(_arg3, "=", _arg4);
};
_local6.sortOn(SaveGroupQuery.TOTAL_VIEWS, _arg2);
_local6.execute();
}
public static function loadFilesByRating(_arg1:String, _arg2:String, _arg3:Boolean=true, _arg4:String=null, _arg5=null):void{
var _local8:*;
var _local6:SaveGroup = getSaveGroup(_arg1);
if (!_local6){
_local8 = new APIError("QUERY_INCOMPLETE", "The query could not be preformed, check the spelling of your save group name.");
sendError({command_id:"loadFilesByDate"}, _local8);
return;
};
var _local7:SaveGroupQuery = _local6.newQuery();
if (_arg4){
_local7.addKeyCondition(_arg4, "=", _arg5);
};
_local7.sortOnRating(_arg2, _arg3);
_local7.execute();
}
public static function onRemoteAuthentication(_arg1:String){
var _local2:Object = JSON.decode(RC4.decrypt(_arg1, _encryptionKey));
user_id = _local2.NewgroundsAPI_UserID;
user_name = _local2.NewgroundsAPI_UserName;
session_id = _local2.NewgroundsAPI_SessionID;
publisher_id = _local2.NewgroundsAPI_PublisherID;
}
private static function doEvent(_arg1:Object):void{
var _local2:String;
var _local3:Object;
var _local4:String;
var _local5:Boolean;
var _local6:ScoreBoard;
var _local7:Array;
var _local8:*;
var _local9:String;
var _local10:Medal;
var _local11:SaveGroup;
var _local12:Object;
var _local13:Object;
var _local14:Object;
var _local15:SaveFile;
var _local16:uint;
var _local17:Object;
var _local18:uint;
var _local19:APIError;
var _local20:Object;
switch (getCommandName(_arg1.command_id)){
case "connectMovie":
timeoutTimer.stop();
if (_arg1.success){
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage((("Movie identified as \"" + _arg1.movie_name) + "\""));
callListener(APIEvent.API_CONNECTED, _arg1.success, {title:_arg1.movie_name});
} else {
callListener(APIEvent.API_CONNECTED, _arg1.success, {});
return;
};
_local5 = false;
if (_arg1.ad_status === -1){
_local2 = "This movie was not approved to run Flash Ads.";
sendWarning(_local2);
sendWarning((("visit " + AD_TERMS_URL) + " to view our approval guidelines"));
if (!_arg1.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", _local2));
} else {
_local5 = true;
};
} else {
if (_arg1.ad_status === 0){
_local2 = "Flash Ads are currently awaiting approval.";
sendNotice(_local2);
if (!_arg1.ad_url){
callListener(APIEvent.ADS_APPROVED, false, new APIError("FLASH_ADS_NOT_APPROVED", _local2));
} else {
_local5 = true;
};
};
};
if (_arg1.ad_url){
ad_url = unescape(_arg1.ad_url);
if (!_local5){
sendMessage("This movie has been approved to run Flash Ads!");
};
_adsApproved = true;
callListener(APIEvent.ADS_APPROVED, true);
};
if (_arg1.deny_host){
_local2 = (getHost() + " does not have permission to run this movie!");
sendWarning(_local2);
sendWarning(("\tUpdate your API configuration to unblock " + getHost()));
callListener(APIEvent.HOST_BLOCKED, true, {real_url:unescape(_arg1.movie_url), url:getOfficialURL()});
};
if (_arg1.movie_version){
sendWarning("According to your API Configuration, this version is out of date.");
if (version){
sendWarning(("\tThe this movie is version " + version));
};
sendWarning(("\tThe most current version is " + _arg1.movie_version));
callListener(APIEvent.NEW_VERSION_AVAILABLE, true, {version:_arg1.movie_version, real_url:unescape(_arg1.movie_url), url:getOfficialURL()});
};
if (_arg1.request_portal_url){
sendCommand("setPortalID", {portal_url:_url});
};
sendCommand("preloadSettings", {publisher_id:publisher_id, user_id:user_id});
break;
case "preloadSettings":
if (_arg1.medals){
populateMedals(_arg1.medals);
if (((!(hasUserSession())) && (!(debugMode)))){
echo("Checking for SharedObject Medals...");
_local8 = loadLocal("medals_unlocked");
if (_local8){
for (_local9 in _local8) {
if (_local8[_local9]){
_local10 = getMedalById(uint(_local9));
echo(("Now unlocking " + _local10.name));
_local10.unlocked = true;
};
};
};
};
};
if (_arg1.save_groups){
populateSaveGroups(_arg1.save_groups);
};
if (_arg1.save_file_path){
_saveFilePath = (_arg1.save_file_path + "/");
};
if (_arg1.image_file_path){
_imageFilePath = (_arg1.image_file_path + "/");
};
if (_arg1.score_boards){
populateScoreBoards(_arg1.score_boards);
};
sendMessage("Metadata loaded!");
callListener(APIEvent.METADATA_LOADED, _arg1.success);
if (((_saveFileId) && (_saveGroupId))){
_local11 = getSaveGroupById(_saveGroupId);
if (_local11){
callListener(APIEvent.FILE_REQUESTED, true, {save_id:_saveFileId, group:_local11});
};
};
_preloadComplete = true;
break;
case "logCustomEvent":
if (_arg1.success){
sendMessage((("Event '" + _arg1.event) + "' was logged."));
};
callListener(APIEvent.EVENT_LOGGED, _arg1.success, {event:_arg1.event});
break;
case "postScore":
if (_arg1.success){
_local4 = "User";
if (user_email){
_local4 = user_email;
} else {
if (user_name){
_local4 = user_name;
};
};
_local6 = getScoreBoardById(_arg1.board);
if (_local6){
sendMessage((((((_local4 + " posted ") + _arg1.value) + " to '") + _local6.name) + "'"));
};
if (_arg1.best_scores){
_local12 = {today:_arg1.best_scores.D, yesterday:_arg1.best_scores.P, week:_arg1.best_scores.W, year:_arg1.best_scores.Y, all_time:_arg1.best_scores.A};
} else {
_local12 = {};
};
if (_arg1.best_ranks){
_local13 = {today:_arg1.best_ranks.D, yesterday:_arg1.best_ranks.P, week:_arg1.best_ranks.W, year:_arg1.best_ranks.Y, all_time:_arg1.best_ranks.A};
} else {
_local13 = {};
};
if (_arg1.num_scores){
_local14 = {today:_arg1.num_scores.D, yesterday:_arg1.num_scores.P, week:_arg1.num_scores.W, year:_arg1.num_scores.Y, all_time:_arg1.num_scores.A};
} else {
_local14 = {};
};
_local3 = {score:_arg1.score, value:_arg1.value, username:_local4, best_scores:_local12, best_ranks:_local13, num_scores:_local14};
};
callListener(APIEvent.SCORE_POSTED, _arg1.success, _local3);
break;
case "loadScores":
_local3 = new Object();
_local6 = getScoreBoardById(_arg1.board);
if (_local6){
_local6.setScores(_arg1.scores, _arg1.period, _arg1.page, _arg1.num_results, _arg1.num_scores);
};
callListener(APIEvent.SCORES_LOADED, _arg1.success, {board:_local6});
break;
case "unlockMedal":
if (_medals){
_local10 = getMedal(_arg1.medal_name);
if (_local10.unlocked){
return;
};
_local10.unlocked = true;
callListener(APIEvent.MEDAL_UNLOCKED, _arg1.success, {medal_id:_local10.id, medal:_local10});
};
break;
case "getMedals":
if (_arg1.success){
populateMedals(_arg1.medals);
};
callListener(APIEvent.MEDALS_LOADED, _arg1.success, _local3);
break;
case "loadSaveFile":
if (_arg1.success){
_local11 = getSaveGroupById(_arg1.group_id);
_local15 = new SaveFile(_local11);
_local15.id = _arg1.file.save_id;
_local15.name = _arg1.file.filename;
_local15.fileUrl = (_saveFilePath + _arg1.file.file);
_local15.thumbnailUrl = (_imageFilePath + _arg1.file.thumb);
_local15.authorName = _arg1.file.user_name;
_local15.authorId = _arg1.file.user_id;
_local15.setStatus(_arg1.file.status);
_local15.description = _arg1.file.description;
_local15.setFileSize(_arg1.file.file_size);
if (((_arg1.file.keys) && (_arg1.file.keys.length))){
_local16 = 0;
while (_local16 < _arg1.file.keys.length) {
_local15.setKey(_arg1.file.keys[_local16].id, _arg1.file.keys[_local16].value);
_local16++;
};
};
if (((_arg1.file.ratings) && (_arg1.file.ratings.length))){
_local16 = 0;
while (_local16 < _arg1.file.ratings.length) {
_local15.setRating(_arg1.file.ratings[_local16].id, _arg1.file.ratings[_local16].votes, _arg1.file.ratings[_local16].score);
_local16++;
};
};
if (_arg1.get_contents){
_local15.loadContents();
};
};
save_file = _local15;
callListener(APIEvent.FILE_INITIALIZED, _arg1.success, {save_id:_local15.id, file:_local15});
break;
case "lookupSaveFiles":
_local7 = [];
if (((_arg1.success) && (_arg1.files))){
_local16 = 0;
while (_local16 < _arg1.files.length) {
_local17 = _arg1.files[_local16];
_local15 = new SaveFile(getSaveGroupById(_arg1.group_id));
_local15.name = _local17.filename;
_local15.id = _local17.save_id;
_local15.description = _local17.description;
_local15.thumbnailUrl = (_imageFilePath + _local17.thumb);
_local15.fileUrl = (_saveFilePath + _local17.file);
_local15.authorName = _local17.user_name;
_local15.authorId = _local17.user_id;
_local15.setStatus(_local17.status);
_local15.setFileSize(_local17.file_size);
if (((_local17.keys) && (_local17.keys.length))){
_local18 = 0;
while (_local18 < _local17.keys.length) {
_local15.setKey(_local17.keys[_local18].id, _local17.keys[_local18].value);
_local18++;
};
};
if (((_local17.ratings) && (_local17.ratings.length))){
_local18 = 0;
while (_local18 < _local17.ratings.length) {
_local15.setRating(_local17.ratings[_local18].id, _local17.ratings[_local18].votes, _local17.ratings[_local18].score);
_local18++;
};
};
_local7.push(_local15);
_local16++;
};
};
_arg1.owner.setResults(_local7);
_arg1.owner.dispatchEvent(new APIEvent(APIEvent.QUERY_COMPLETE, _arg1.success, {query:_arg1.owner}));
callListener(APIEvent.QUERY_COMPLETE, _arg1.success, {query:_arg1.owner});
break;
case "rateSaveFile":
_local15 = _arg1.owner;
_arg1.success = ((_arg1.success) && (!(_arg1.already_voted)));
if (_arg1.success){
_local15.setRating(_arg1.rating_id, _arg1.votes, _arg1.score);
};
_arg1.file = _local15;
if (_arg1.already_voted){
_local19 = new APIError("PERMISSION_DENIED", "You have already voted on this item today");
_local15.dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, _arg1.success, {error:_local19, file:_local15, save_id:_local15.id}));
callListener(APIEvent.VOTE_COMPLETE, _arg1.success, _arg1);
} else {
_local20 = _local15.getRating(_arg1.rating_id);
_local15.dispatchEvent(new APIEvent(APIEvent.VOTE_COMPLETE, _arg1.success, {rating:_local20, file:_local15, save_id:_local15.id}));
API.callListener(APIEvent.VOTE_COMPLETE, _arg1.success, {rating:_local20, file:_local15, save_id:_local15.id});
};
break;
case "saveFile":
_local3 = {};
if (_arg1.success){
_local3 = {save_id:_arg1.save_id, filename:_arg1.filename, file_url:_arg1.file_url, thumbnail:_arg1.thumbnail, icon:_arg1.icon};
SaveFile(_arg1.owner).fileSaved(_local3);
};
_arg1.owner.dispatchEvent(new APIEvent(APIEvent.FILE_SAVED, _arg1.success, {save_id:save_file.id, file:save_file}));
callListener(APIEvent.FILE_SAVED, _arg1.success, {save_id:save_file.id, file:save_file});
save_file = null;
break;
case "checkFilePrivs":
_local3 = {filename:_arg1.filename, folder:_arg1.folder, can_read:_arg1.can_read, can_write:_arg1.can_write};
callListener(APIEvent.FILE_PRIVS_LOADED, _arg1.success, _local3);
break;
};
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:uint=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public static function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
private static function dispatchEvent(_arg1:Event):void{
_eventDispatcher.dispatchEvent(_arg1);
echo(("Fired Event: " + _arg1.type));
}
static function callListener(_arg1:String, _arg2:Boolean=true, _arg3=undefined):void{
dispatchEvent(new APIEvent(_arg1, _arg2, _arg3));
if (_bridge){
_bridge.sendEvent(_arg1, {success:_arg2, data:_arg3});
};
}
private static function getCommandName(_arg1:String):String{
return (_arg1);
}
private static function getCommandID(_arg1:String):String{
return (_arg1);
}
private static function getPeriodAliases():Object{
var _local2:String;
var _local1:Object = new Object();
for (_local2 in period_aliases) {
_local1[period_aliases[_local2].alias] = _local2;
};
return (_local1);
}
public static function getPeriodName(_arg1:String):String{
var _local2:String;
for (_local2 in period_aliases) {
if (_local2 == _arg1){
return (period_aliases[_local2].name);
};
};
return (null);
}
public static function getPeriodAlias(_arg1:String):String{
var _local2:String;
for (_local2 in period_aliases) {
if (_local2 == _arg1){
return (period_aliases[_local2].alias);
};
};
return (null);
}
private static function sendError(_arg1:Object, _arg2:APIError):void{
var _local3:String = ((((("[NewgroundsAPI ERROR] :: " + getCommandName(_arg1.command_id)) + "() - ") + _arg2.name) + ":\n\t\t\t\t") + _arg2.message);
trace(_local3);
if (_bridge){
_bridge.sendEvent("trace", {data:_local3});
};
}
private static function sendWarning(_arg1:String, _arg2:String=null):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(_arg1);
if (_bridge){
_bridge.sendEvent("trace", {data:_arg1});
};
}
private static function sendNotice(_arg1:String, _arg2:String=null):void{
var _local3:String;
if (_arg2){
_arg1 = (_arg1 + ((("\n[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(_arg1);
if (_bridge){
_bridge.sendEvent("trace", {data:_arg1});
};
}
private static function fatalError(_arg1:String, _arg2:String):void{
if (_arg2){
_arg1 = (_arg1 + ((("\n\tSee " + COMMANDS_WIKI_URL) + _arg2.toLowerCase()) + " for additional information."));
};
trace(("***ERROR*** class=API\n\n" + _arg1));
}
public static function openLoginPage(){
if (hasUserSession()){
return;
};
}
public static function sendSecureCommand(_arg1:String, _arg2:Object, _arg3:Object=null, _arg4:Object=null, _arg5=null):void{
if (((((!(debugMode)) && (!(hasUserSession())))) && (!(hasUserEmail())))){
sendError({command_id:getCommandID(_arg1)}, new APIError("IDENTIFICATION_REQUIRED", (("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + _arg1) + "().")));
return;
};
if (!_arg1){
fatalError("Missing command", "sendSecureCommand");
};
if (!_arg2){
fatalError("Missing secure_params", "sendSecureCommand");
};
if (!_arg3){
_arg3 = new Object();
};
var _local6 = "";
var _local7:uint;
while (_local7 < 16) {
_local6 = (_local6 + compression_radix.charAt(Math.floor((Math.random() * compression_radix.length))));
_local7++;
};
if (((debugMode) && (!(session_id)))){
_arg2.session_id = "";
} else {
_arg2.session_id = session_id;
};
_arg2.as_version = 3;
_arg2.user_email = user_email;
_arg2.publisher_id = publisher_id;
_arg2.seed = _local6;
_arg2.command_id = getCommandID(_arg1);
var _local8:String = MD5.hash(_local6);
var _local9:String = RC4.encrypt(JSON.encode(_arg2), _encryptionKey);
var _local10:String = (_local8 + _local9);
_arg3.secure = compressHex(_local10);
secureCommand = _arg1;
sendCommand("securePacket", _arg3, false, _arg4, _arg5);
}
public static function stopPendingCommands():void{
SmartURLLoader.closeAll();
}
private static function onCommandComplete(_arg1:Event):void{
var response:Object;
var error:APIError;
var e = _arg1;
var loader:SmartURLLoader = SmartURLLoader(e.target);
echo((("INPUT: \n" + loader.response) + "\n"));
var i:uint;
while (i < _preloadAssets.length) {
if (_preloadAssets[i] == loader){
_preloadAssets.splice(i, 1);
break;
};
i = (i + 1);
};
try {
response = JSON.decode(loader.response);
} catch(error:Error) {
};
if (!response){
response = {command_id:loader._command, success:false};
};
response.owner = loader.owner;
if (((!(response)) || (!(response.success)))){
if (response.command_id == "connectMovie"){
connected = false;
};
error = new APIError(response.error_code, response.error_msg);
sendError(response, error);
if (response.command_id){
doEvent(response);
};
} else {
doEvent(response);
};
}
private static function onCommandError(_arg1:Event):void{
var _local2:Object = {success:false};
var _local3:SmartURLLoader = SmartURLLoader(_arg1.target);
_local2.owner = _local3.owner;
var _local4:uint;
while (_local4 < _preloadAssets.length) {
if (_preloadAssets[_local4] == _local3){
_preloadAssets.splice(_local4, 1);
break;
};
_local4++;
};
if (_local3._command){
_local2.command_id = _local3._command;
if (_local2.command_id == "connectMovie"){
connected = false;
};
doEvent(_local2);
};
}
private static function sendCommand(_arg1:String, _arg2:Object, _arg3:Boolean=false, _arg4:Object=null, _arg5=null):void{
var _local7:String;
var _local8:String;
var _local9:String;
if (((!(connected)) && (!((_arg1 == "connectMovie"))))){
_local7 = (("NewgroundsAPI." + _arg1) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called\n");
fatalError(_local7, "connectMovie");
};
var _local6:SmartURLLoader = new SmartURLLoader();
_local6.addVariable("command_id", getCommandID(_arg1));
_local6.addVariable("tracker_id", _movieId);
if (debugMode){
_local6.addVariable("debug", 1);
};
if (_arg2){
for (_local8 in _arg2) {
_local6.addVariable(_local8, _arg2[_local8]);
};
};
if (_arg4){
for (_local9 in _arg4) {
_local6.addFile(_local9, _arg4[_local9], _local9);
};
};
if (_arg3){
_local6.method = URLRequestMethod.GET;
} else {
_local6.method = URLRequestMethod.POST;
};
_local6.preventCache = true;
if (_arg3){
_local6.openBrowser = true;
_local6.method = URLRequestMethod.GET;
} else {
_local6.addEventListener(Event.COMPLETE, onCommandComplete);
_local6.addEventListener(IOErrorEvent.IO_ERROR, onCommandError);
_local6.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onCommandError);
_local6.method = URLRequestMethod.POST;
};
if (_arg2.secure){
_local6._command = secureCommand;
} else {
_local6._command = getCommandID(_arg1);
};
_local6.owner = _arg5;
_local6.load(GATEWAY_URL);
}
public static function isFlashVersion(_arg1:uint, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0):Boolean{
var _local6:Array = Capabilities.version.split(" ")[1].split(",");
var _local7:Array = arguments;
var _local8:uint;
while (_local8 < _local7.length) {
_local6[_local8] = uint(_local6[_local8]);
_local8++;
};
_local8 = 0;
while (_local8 < _local7.length) {
if (_local6[_local8] > _local7[_local8]){
return (true);
};
if (_local6[_local8] < _local7[_local8]){
return (false);
};
_local8++;
};
return (true);
}
public static function createAd():FlashAd{
sendMessage("You may see a security sandbox violation. This is normal!");
return (new FlashAd());
}
public static function sendMessage(_arg1:String, _arg2:Boolean=false):void{
var _local3:String = ("[NewgroundsAPI] :: " + _arg1);
trace(_local3);
if (_bridge){
_bridge.sendEvent("trace", {data:_local3});
};
}
private static function echo(_arg1:String):void{
if (do_echo){
trace(_arg1);
};
}
}
}//package com.newgrounds
Section 88
//APIError (com.newgrounds.APIError)
package com.newgrounds {
import flash.utils.*;
public class APIError {
public var code:Number;// = 0
public var message:String;
public var name:String;
public var alias:String;
public static const aliases:Array = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
private static const always_caps:Array = new Array("API", "URL", "ID");
public static const error_codes:Object = init_codes();
public static const error_names:Object = init_names();
public function APIError(_arg1, _arg2:String){
if ((_arg1 is String)){
_arg1 = error_codes[_arg1];
} else {
if (!(_arg1 is uint)){
_arg1 = 0;
};
};
this.code = _arg1;
this.message = _arg2;
this.name = error_names[_arg1];
this.alias = aliases[_arg1];
}
public function isError():Boolean{
return (true);
}
public static function init_codes():Dictionary{
var _local1:Dictionary = new Dictionary();
var _local2:uint;
while (_local2 < aliases.length) {
_local1[aliases[_local2]] = _local2;
_local2++;
};
return (_local1);
}
private static function init_names():Array{
var _local3:Array;
var _local4:uint;
var _local5:String;
var _local1:Array = new Array();
var _local2:uint;
while (_local2 < aliases.length) {
_local3 = aliases[_local2].toLowerCase().split("_");
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4] = (_local3[_local4].substr(0, 1).toUpperCase() + _local3[_local4].substr(1, _local3[_local4].length));
for each (_local5 in always_caps) {
if (_local3[_local4].toUpperCase() == _local5){
_local3[_local4] = _local3[_local4].toUpperCase();
};
};
_local4++;
};
_local1[_local2] = _local3.join(" ");
_local2++;
};
return (_local1);
}
}
}//package com.newgrounds
Section 89
//APIEvent (com.newgrounds.APIEvent)
package com.newgrounds {
import flash.events.*;
public class APIEvent extends Event {
private var _data;
private var _success:Boolean;
private var _target;
private var _error:APIError;
public static const API_CONNECTED:String = "movieConnected";
public static const ADS_APPROVED:String = "adsApproved";
public static const AD_ATTACHED:String = "adAttached";
public static const HOST_BLOCKED:String = "hostBlocked";
public static const NEW_VERSION_AVAILABLE:String = "newVersionAvailable";
public static const EVENT_LOGGED:String = "eventLogged";
public static const SCORE_POSTED:String = "scorePosted";
public static const SCORES_LOADED:String = "scoresLoaded";
public static const UNLOCK_MEDAL:String = "unlockMedal";
public static const MEDAL_UNLOCKED:String = "medalUnlocked";
public static const MEDALS_LOADED:String = "medalsLoaded";
public static const METADATA_LOADED:String = "metadataLoaded";
public static const FILE_PRIVS_LOADED:String = "filePrivsLoaded";
public static const FILE_SAVED:String = "fileSaved";
public static const FILE_LOADED:String = "fileLoaded";
public static const FILE_INITIALIZED:String = "fileInitialized";
public static const FILE_REQUESTED:String = "fileRequested";
public static const QUERY_COMPLETE:String = "queryComplete";
public static const VOTE_COMPLETE:String = "voteComplete";
public function APIEvent(_arg1:String, _arg2:Boolean=true, _arg3=undefined){
super(_arg1);
this._data = _arg3;
this._success = _arg2;
}
public function get success():Boolean{
return (this._success);
}
public function get data(){
return (this._data);
}
}
}//package com.newgrounds
Section 90
//BaseN (com.newgrounds.BaseN)
package com.newgrounds {
import flash.utils.*;
public class BaseN {
private var _hashIndex:String;
private var _hashVal:Dictionary;
private var _base:Number;
public function BaseN(_arg1:String=null){
if (_arg1){
this._hashIndex = _arg1;
} else {
this._hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
};
this._base = this._hashIndex.length;
this._hashVal = new Dictionary();
var _local2:uint;
while (_local2 < this._base) {
this._hashVal[this._hashIndex.charAt(_local2)] = _local2;
_local2++;
};
}
public function encode(_arg1:Number, _arg2:uint=1):String{
var _local3:String = _arg1.toString();
var _local4 = "";
if (_local3.charAt(0) == "-"){
_local4 = "-";
_local3 = _local3.substring(1);
};
var _local5:Array = _local3.split(".", 2);
_local4 = (_local4 + this.baseNEncoder(_local5[0], _arg2));
if (_local5.length > 1){
_local4 = (_local4 + ("." + this.baseNEncoder(_local5[1])));
};
return (_local4);
}
public function decode(_arg1:String):Number{
var _local2 = "";
if (_arg1.charAt(0) == "-"){
_local2 = "-";
_arg1 = _arg1.substring(1);
};
var _local3:Array = _arg1.split(".", 2);
_local2 = (_local2 + this.baseNDecoder(_local3[0]));
if (_local3.length > 1){
_local2 = (_local2 + ".");
_local2 = (_local2 + this.baseNDecoder(_local3[1]));
};
return (Number(_local2));
}
private function baseNEncoder(_arg1:uint, _arg2:uint=1):String{
var _local3 = "";
var _local4:uint = _arg1;
while (_local4 != 0) {
_local3 = (this._hashIndex.charAt((_local4 % this._base)) + _local3);
_local4 = (_local4 / this._base);
};
if (_arg2){
while (_local3.length < _arg2) {
_local3 = (this._hashIndex.charAt(0) + _local3);
};
};
return (_local3);
}
private function baseNDecoder(_arg1:String):uint{
var _local2:uint;
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 * this._base);
_local2 = (_local2 + this._hashVal[_arg1.charAt(_local3)]);
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 91
//Bridge (com.newgrounds.Bridge)
package com.newgrounds {
import flash.events.*;
import flash.net.*;
public class Bridge {
private var _inConnection:LocalConnection;
private var _outConnection:LocalConnection;
private var _widgetId:String;
public function Bridge(_arg1:String){
this._widgetId = _arg1;
this._inConnection = new LocalConnection();
this._outConnection = new LocalConnection();
this._inConnection.client = this;
this._inConnection.connect(("rec_" + this._widgetId));
this._outConnection.addEventListener(StatusEvent.STATUS, this.onStatus);
}
public function sendCommand(_arg1:String, _arg2:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendCommand", _arg1, this.scrubParameters(_arg2));
};
}
public function sendEvent(_arg1:String, _arg2:Object):void{
if (this._outConnection){
this._outConnection.send(this._widgetId, "sendEvent", _arg1, this.scrubParameters(_arg2));
};
}
public function receiveEvent(_arg1:String, _arg2:Object):void{
API.callListener(_arg1, _arg2.success, _arg2.data);
}
public function scrubParameters(_arg1:Object):Object{
var _local3:String;
var _local2:Object = new Object();
for (_local3 in _arg1) {
if ((((((((((_arg1[_local3] is String)) || ((_arg1[_local3] is Number)))) || ((_arg1[_local3] is uint)))) || ((_arg1[_local3] is int)))) || ((_arg1[_local3] is Boolean)))){
_local2[_local3] = _arg1[_local3];
};
};
return (_local2);
}
private function onStatus(_arg1:Event):void{
}
}
}//package com.newgrounds
Section 92
//Medal (com.newgrounds.Medal)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class Medal {
private var _id:uint;
private var _name:String;
private var _value:uint;
private var _difficultyId:uint;
private var _unlocked:Boolean;// = false
private var _iconUrl:URLRequest;
private var _iconLoader:Loader;
private var _icon:BitmapData;
private static const DEFAULT_ICON:BitmapData = new BitmapData(50, 50, false, 0);
private static const DIFFICULT_NAMES:Array = [null, "Easy", "Moderate", "Challenging", "Difficult", "Brutal"];
public function Medal(_arg1:uint, _arg2:String, _arg3:uint, _arg4:uint, _arg5:Boolean, _arg6:String){
var id = _arg1;
var name = _arg2;
var value = _arg3;
var difficulty = _arg4;
var unlocked = _arg5;
var iconUrl = _arg6;
this._icon = DEFAULT_ICON;
super();
this._id = id;
this._name = name;
this._value = value;
this._difficultyId = difficulty;
this._unlocked = unlocked;
if (iconUrl){
this._iconUrl = new URLRequest(iconUrl);
this._iconLoader = new Loader();
this._iconLoader.contentLoaderInfo.addEventListener(Event.INIT, this.onIconLoaderInit);
this._iconLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onIconLoaderError);
this._iconLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onIconLoaderComplete);
try {
this._iconLoader.load(this._iconUrl, new LoaderContext(true));
} catch(e:Error) {
onIconLoaderError(null);
};
};
}
public function get difficulty():String{
return (DIFFICULT_NAMES[this._difficultyId]);
}
public function get difficultyId():uint{
return (this._difficultyId);
}
public function get icon():BitmapData{
return (this._icon);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get unlocked():Boolean{
return (this._unlocked);
}
public function isUnlocked():Boolean{
return (this._unlocked);
}
public function set unlocked(_arg1:Boolean):void{
this._unlocked = _arg1;
}
public function get value():uint{
return (this._value);
}
public function get bytesLoaded():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._iconLoader) ? this._iconLoader.contentLoaderInfo.bytesTotal : 0);
}
public function getID():uint{
return (this._id);
}
public function getName():String{
return (this._name);
}
public function getValue():uint{
return (this._value);
}
public function getDifficulty():String{
return (DIFFICULT_NAMES[this._difficultyId]);
}
private function onIconLoaderInit(_arg1:Event):void{
}
private function onIconLoaderError(_arg1:IOErrorEvent):void{
trace((((("[NewgroundsAPI WARNING] :: Failed to load medal icon for " + this.name) + " (") + this._iconUrl.url.split("/").pop()) + ")"));
this._iconLoader.unload();
this._iconLoader = null;
}
private function onIconLoaderComplete(_arg1:Event):void{
var _local2:Bitmap = (this._iconLoader.content as Bitmap);
this._icon = _local2.bitmapData;
this._iconLoader.unload();
this._iconLoader = null;
}
public function unlock():void{
if (!this._unlocked){
API.unlockMedal(this._name);
};
}
public function createIconBitmap():Bitmap{
return (new Bitmap(this.icon));
}
public function toString():String{
return (this._name);
}
public static function createFromObject(_arg1:Object):Medal{
return (new Medal(_arg1.medal_id, _arg1.medal_name, _arg1.medal_value, _arg1.medal_difficulty, _arg1.medal_unlocked, _arg1.medal_icon));
}
}
}//package com.newgrounds
Section 93
//RC4 (com.newgrounds.RC4)
package com.newgrounds {
public class RC4 {
private static var sbox:Array = new Array(0xFF);
private static var mykey:Array = new Array(0xFF);
public static function encrypt(_arg1:String, _arg2:String):String{
var _local3:Array = strToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (charsToHex(_local5));
}
public static function encryptbin(_arg1:String, _arg2:String):Array{
var _local3:Array = strToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (_local5);
}
public static function decrypt(_arg1:String, _arg2:String):String{
var _local3:Array = hexToChars(_arg1);
var _local4:Array = strToChars(_arg2);
var _local5:Array = calculate(_local3, _local4);
return (charsToStr(_local5));
}
private static function initialize(_arg1:Array):void{
var _local3:uint;
var _local2:uint;
var _local4:uint = _arg1.length;
var _local5:uint;
while (_local5 <= 0xFF) {
mykey[_local5] = _arg1[(_local5 % _local4)];
sbox[_local5] = _local5;
_local5++;
};
_local5 = 0;
while (_local5 <= 0xFF) {
_local2 = (((_local2 + sbox[_local5]) + mykey[_local5]) % 0x0100);
_local3 = sbox[_local5];
sbox[_local5] = sbox[_local2];
sbox[_local2] = _local3;
_local5++;
};
}
private static function calculate(_arg1:Array, _arg2:Array):Array{
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local10:uint;
initialize(_arg2);
var _local3:uint;
var _local4:uint;
var _local5:Array = new Array();
var _local9:uint;
while (_local9 < _arg1.length) {
_local3 = ((_local3 + 1) % 0x0100);
_local4 = ((_local4 + sbox[_local3]) % 0x0100);
_local7 = sbox[_local3];
sbox[_local3] = sbox[_local4];
sbox[_local4] = _local7;
_local10 = ((sbox[_local3] + sbox[_local4]) % 0x0100);
_local6 = sbox[_local10];
_local8 = (_arg1[_local9] ^ _local6);
_local5.push(_local8);
_local9++;
};
return (_local5);
}
private static function charsToHex(_arg1:Array):String{
var _local2:String = new String("");
var _local3:Array = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local4:uint;
while (_local4 < _arg1.length) {
_local2 = (_local2 + (_local3[(_arg1[_local4] >> 4)] + _local3[(_arg1[_local4] & 15)]));
_local4++;
};
return (_local2);
}
private static function hexToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint = ((_arg1.substr(0, 2))=="0x") ? 2 : 0;
while (_local3 < _arg1.length) {
_local2.push(parseInt(_arg1.substr(_local3, 2), 16));
_local3 = (_local3 + 2);
};
return (_local2);
}
private static function charsToStr(_arg1:Array):String{
var _local2:String = new String("");
var _local3:uint;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(_arg1[_local3]));
_local3++;
};
return (_local2);
}
private static function strToChars(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:uint;
while (_local3 < _arg1.length) {
_local2.push(_arg1.charCodeAt(_local3));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 94
//SaveFile (com.newgrounds.SaveFile)
package com.newgrounds {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class SaveFile extends EventDispatcher {
private var _filename:String;
private var _id:uint;
private var _description:String;
private var _contents;
private var _loader:SmartURLLoader;
private var _group:SaveGroup;
private var _keys:Dictionary;
private var _ratings:Dictionary;
private var _fileUrl:String;
private var _thumbnail:BitmapData;
private var _thumbnailUrl:String;
private var _authorId:uint;
private var _authorName:String;
private var _contentSize:uint;
private var _locked:Boolean;
private var _status:uint;
private var duplicate_id:uint;
private var _draft:Boolean;
public static const STATUS_PRIVATE = 1;
public static const STATUS_SHARED = 2;
public static const STATUS_UNAPPROVED = 3;
public static const STATUS_APPROVED = 4;
public function SaveFile(_arg1:SaveGroup){
this._keys = new Dictionary();
this._ratings = new Dictionary();
this._group = _arg1;
this._description = "";
}
public function get name():String{
return (this._filename);
}
public function set name(_arg1:String):void{
this._filename = _arg1;
}
public function get id():uint{
return (this._id);
}
public function set id(_arg1:uint):void{
this._id = _arg1;
}
public function get description():String{
return (this._description);
}
public function set description(_arg1:String):void{
this._description = _arg1;
}
public function get contents(){
return (this._contents);
}
public function set contents(_arg1):void{
this._contents = _arg1;
this._contentSize = 0;
}
public function get thumbnailUrl():String{
return (this._thumbnailUrl);
}
public function set thumbnailUrl(_arg1:String):void{
this._thumbnailUrl = _arg1;
}
public function get fileUrl():String{
return (this._fileUrl);
}
public function set fileUrl(_arg1:String):void{
this._fileUrl = _arg1;
}
public function get thumbnail():BitmapData{
return (this._thumbnail);
}
public function set thumbnail(_arg1:BitmapData):void{
if (this._thumbnail){
this._thumbnail.dispose();
};
this._thumbnail = _arg1.clone();
}
public function loadThumbnail():Loader{
var _local1:Loader = new Loader();
if (this._thumbnailUrl){
_local1.load(new URLRequest(this._thumbnailUrl));
};
return (_local1);
}
public function get bytesLoaded():uint{
return ((this._loader) ? this._loader.bytesLoaded : this._contentSize);
}
public function get bytesTotal():uint{
return (this._contentSize);
}
public function get status():uint{
return (this._status);
}
function setStatus(_arg1:uint):void{
this._status = _arg1;
}
public function get groupId():uint{
return (this._group.id);
}
public function get groupName():String{
return (this._group.name);
}
public function get groupType():uint{
return (this._group.type);
}
public function get authorName():String{
return (this._authorName);
}
public function set authorName(_arg1:String):void{
this._authorName = _arg1;
}
public function get authorId():uint{
return (this._authorId);
}
public function set authorId(_arg1:uint):void{
this._authorId = _arg1;
}
public function get draft():Boolean{
return (this._draft);
}
public function set draft(_arg1:Boolean):void{
this._draft = _arg1;
}
public function get locked():Boolean{
return (this._locked);
}
public function get shared():Boolean{
return ((this._status == STATUS_SHARED));
}
public function get isPrivate():Boolean{
return ((this._status == STATUS_PRIVATE));
}
public function get isPublic():Boolean{
if (this.isPrivate){
return (false);
};
if (((this._group.isType("SYSTEM")) || (this._group.isType("PRIVATE")))){
return (false);
};
if (this._group.isType("PUBLIC")){
return (true);
};
if (this.approved){
return (true);
};
return (false);
}
public function get approved():Boolean{
return ((this._status > STATUS_UNAPPROVED));
}
public function get keys():Dictionary{
return (this._keys);
}
public function get ratings():Dictionary{
return (this._ratings);
}
function setPermissions(_arg1:uint, _arg2:Boolean){
_arg2 = this._locked;
this._status = _arg1;
}
function setFileSize(_arg1:uint):void{
this._contentSize = _arg1;
}
public function isLocked():Boolean{
return (this._locked);
}
public function getDescription():String{
return (this._description);
}
public function getShared():Boolean{
return (this._draft);
}
public function getDuplicateID():uint{
return (this.duplicate_id);
}
public function getKeys():Dictionary{
return (this._keys);
}
public function getRatings():Dictionary{
return (this._ratings);
}
public function setKey(_arg1, _arg2):void{
var _local3:SaveKey;
if ((_arg1 is String)){
_local3 = this._group.getKeyName(_arg1);
} else {
_local3 = this._group.getKeyID(_arg1);
};
if (_local3){
switch (_local3.type){
case SaveKey.TYPE_BOOLEAN:
this._keys[_local3] = {id:_local3.id, value:Boolean(int(_arg2))};
break;
case SaveKey.TYPE_FLOAT:
this._keys[_local3] = {id:_local3.id, value:Number(_arg2)};
break;
case SaveKey.TYPE_INTEGER:
this._keys[_local3] = {id:_local3.id, value:int(_arg2)};
break;
case SaveKey.TYPE_STRING:
default:
this._keys[_local3] = {id:_local3.id, value:_arg2.toString()};
break;
};
};
}
public function getKey(_arg1){
var _local2:SaveKey;
if ((_arg1 is String)){
_local2 = this._group.getKeyName(_arg1);
} else {
_local2 = this._group.getKeyID(_arg1);
};
if (_local2){
return (this._keys[_local2]);
};
return (null);
}
public function setRating(_arg1, _arg2:Number, _arg3:Number):void{
var _local4:SaveRating;
if ((_arg1 is String)){
_local4 = this._group.getRatingName(_arg1);
} else {
_local4 = this._group.getRatingID(_arg1);
};
if (_local4){
this._ratings[_local4] = {id:_local4.id, name:_local4.name, votes:_arg2, score:_arg3};
};
}
public function getRating(_arg1):Object{
var _local2:SaveRating;
if ((_arg1 is String)){
_local2 = this._group.getRatingName(_arg1);
} else {
_local2 = this._group.getRatingID(_arg1);
};
if (_local2){
return (this._ratings[_local2]);
};
return (null);
}
public function sendRating(_arg1:String, _arg2:Number):void{
var _local3:SaveRating = this._group.getRatingName(_arg1);
if (!_local3){
trace((("[NewgroundsAPISaveFile] " + _arg1) + " is not a recognized save file"));
return;
};
if ((((_arg2 < _local3.minValue)) || ((_arg2 > _local3.maxValue)))){
trace(((("[NewgroundsAPISaveFile] Vote must be between " + _local3.minValue) + " and ") + _local3.maxValue));
return;
};
_local3.voted = true;
API.rateSaveFile(this, _local3, _arg2);
}
override public function toString():String{
var _local2:Object;
var _local3:Object;
var _local1 = (((((("Save File " + this._filename) + " ID: ") + this._id) + "\n ") + this._description) + "\n");
for each (_local2 in this._keys) {
_local1 = (_local1 + ((((" " + this._group.getKeyID(_local2.id).name) + ": ") + _local2.val) + "\n"));
};
for each (_local3 in this._ratings) {
_local1 = (_local1 + ((((((" " + this._group.getRatingID(_local3.id).name) + "\n Score: ") + _local3.score) + " Votes: ") + _local3.votes) + "\n"));
};
return (_local1);
}
public function toObject():Object{
var _local2:Object;
var _local1:Object = {group:this.groupId, filename:this.name, description:this.description, shared:true};
_local1.keys = [];
for each (_local2 in this._keys) {
_local1.keys.push({id:_local2.id, value:_local2.val});
};
return (_local1);
}
public function save(_arg1:Boolean=false, _arg2:Boolean=false):void{
API.saveFile(this, _arg1, _arg2);
}
public function loadContents():void{
if (this._fileUrl){
this._loader = new SmartURLLoader();
this._loader.responseFormat = URLLoaderDataFormat.BINARY;
this._loader.addEventListener(Event.COMPLETE, this.onContentsLoaded);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.onContentsError);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onContentsError);
this._loader.load(this._fileUrl);
};
}
private function onContentsError(_arg1:Event):void{
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, false));
API.callListener(APIEvent.FILE_LOADED, false);
}
private function onContentsLoaded(_arg1:Event):void{
var _local2:ByteArray = _arg1.target.response;
this._contentSize = _local2.length;
_local2.uncompress();
var _local3:uint = _local2.readUnsignedByte();
if (_local3 == 0){
this._contents = new ByteArray();
this._contents.writeBytes(_local2, 1);
} else {
this._contents = _local2.readObject();
};
this._loader = null;
dispatchEvent(new APIEvent(APIEvent.FILE_LOADED, true, {file:this}));
API.callListener(APIEvent.FILE_LOADED, true, {file:this});
}
public function loadAuthorPage(){
API.loadUserPage(this._authorId, this._authorName);
}
function fileSaved(_arg1:Object):void{
this._id = _arg1.save_id;
this._thumbnailUrl = _arg1.thumbnail;
this._fileUrl = _arg1.file_url;
}
}
}//package com.newgrounds
Section 95
//SaveGroup (com.newgrounds.SaveGroup)
package com.newgrounds {
public class SaveGroup {
private var _name:String;
private var _id:uint;
private var _type:uint;
private var _keys:Array;
private var _ratings:Array;
private var _files:Array;
private var _query:SaveGroupQuery;
public static const TYPE_SYSTEM:uint = 0;
public static const TYPE_PRIVATE:uint = 1;
public static const TYPE_PUBLIC:uint = 2;
public static const TYPE_MODERATED:uint = 3;
public static const KEY_TYPES:Array = [null, "float", "integer", "string", "boolean"];
public static const TYPES:Object = {SYSTEM:0, PRIVATE:1, PUBLIC:2, MODERATED:3};
public function SaveGroup(_arg1:uint, _arg2:String, _arg3:uint){
this._name = _arg2;
this._id = _arg1;
this._type = _arg3;
this._ratings = [];
this._keys = [];
this._files = [];
this._query = new SaveGroupQuery(this);
}
public function get name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get type():uint{
return (this._type);
}
public function get keys():Array{
return (this._keys);
}
public function get ratings():Array{
return (this._ratings);
}
public function get group_id():uint{
return (this._id);
}
public function get group_name():String{
return (this._name);
}
public function addRating(_arg1:SaveRating):void{
this._ratings.push(_arg1);
}
function getRating(_arg1):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if ((((((((_arg1 is uint)) || ((_arg1 is int)))) || ((_arg1 is Number)))) && ((this._ratings[_local2].rating_id == _arg1)))){
return (this._ratings[_local2]);
};
if (this._ratings[_local2].name == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function getRatingID(_arg1:uint):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if (this._ratings[_local2].id == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function getRatingName(_arg1:String):SaveRating{
var _local2:uint;
while (_local2 < this._ratings.length) {
if (this._ratings[_local2].name == _arg1){
return (this._ratings[_local2]);
};
_local2++;
};
return (null);
}
public function addKey(_arg1:SaveKey):void{
this._keys.push(_arg1);
}
public function getKey(_arg1):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if ((((((((_arg1 is Number)) || ((_arg1 is uint)))) || ((_arg1 is int)))) && ((this._keys[_local2].key_id == _arg1)))){
return (this._keys[_local2]);
};
if (this._keys[_local2].key_name == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function getKeyID(_arg1:uint):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if (this._keys[_local2].id == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function getKeyType(_arg1:String, _arg2:Boolean=false){
var _local3:SaveKey = this.getKey(_arg1);
if (_local3){
return ((_arg2) ? KEY_TYPES[_local3.key_type] : _local3.key_type);
};
return (null);
}
public function getKeyName(_arg1:String):SaveKey{
var _local2:uint;
while (_local2 < this._keys.length) {
if (this._keys[_local2].name == _arg1){
return (this._keys[_local2]);
};
_local2++;
};
return (null);
}
public function isType(_arg1:String):Boolean{
return ((TYPES[this._type] == _arg1));
}
public function getID():uint{
return (this._id);
}
public function getName():String{
return (this._name);
}
public function getQuery(_arg1:Boolean=false){
return ((_arg1) ? this._query.toObject() : this._query);
}
public function newQuery():SaveGroupQuery{
return (new SaveGroupQuery(this));
}
public function newFile():SaveFile{
return (new SaveFile(this));
}
public function toString():String{
return ((((((("SaveGroup { name: " + this._name) + ", id: ") + this._id) + ", keys: ") + this._keys) + "}"));
}
public static function createFromObject(_arg1:Object):SaveGroup{
var _local4:Object;
var _local5:Object;
var _local2:SaveGroup = new SaveGroup(_arg1.group_id, _arg1.group_name, _arg1.group_type);
var _local3:uint;
while (_local3 < _arg1.keys.length) {
_local4 = _arg1.keys[_local3];
_local2.addKey(new SaveKey(_local4.id, _local4.name, _local4.type));
_local3++;
};
_local3 = 0;
while (_local3 < _arg1.ratings.length) {
_local5 = _arg1.ratings[_local3];
_local2.addRating(new SaveRating(_local5.id, _local5.name, _local5.float, _local5.min, _local5.max));
_local3++;
};
return (_local2);
}
}
}//package com.newgrounds
Section 96
//SaveGroupQuery (com.newgrounds.SaveGroupQuery)
package com.newgrounds {
import flash.events.*;
public class SaveGroupQuery extends EventDispatcher {
private var _group:SaveGroup;
private var _groupBy:Array;
private var _lookupKeys:Array;
private var _lookupRatings:Array;
private var _fileConditions:Array;
private var _keyConditions:Array;
private var _ratingConditions:Array;
private var _sortConditions:Array;
private var _page:uint;
private var _resultsPerPage:uint;
private var _randomizeResults:Boolean;
private var _results:Array;
public static const TABLE_FILES:uint = 1;
public static const TABLE_KEYS:uint = 2;
public static const TABLE_RATINGS:uint = 3;
public static const FILE_ID:uint = 0;
public static const AUTHOR_ID:uint = 1;
public static const AUTHOR_NAME:uint = 2;
public static const FILE_NAME:uint = 3;
public static const CREATED_ON:uint = 4;
public static const UPDATED_ON:uint = 5;
public static const TOTAL_VIEWS:uint = 6;
public static const FILE_STATUS:uint = 7;
public static const SCORE:String = "score";
public static const TOTAL_VOTES:String = "votes";
public function SaveGroupQuery(_arg1:SaveGroup){
this._results = [];
super();
this._group = _arg1;
this.reset();
}
public function clearCache():void{
this._results = [];
}
public function get group():SaveGroup{
return (this._group);
}
public function get groupId():uint{
return (this._group.id);
}
public function get resultsPerPage():uint{
return (this._resultsPerPage);
}
public function set resultsPerPage(_arg1:uint):void{
this._resultsPerPage = _arg1;
}
public function get page():uint{
return (this._page);
}
public function set page(_arg1:uint):void{
this._page = _arg1;
}
public function get randomized():Boolean{
return (this._randomizeResults);
}
public function set randomized(_arg1:Boolean):void{
this._randomizeResults = _arg1;
}
public function get results():Array{
return (this._results);
}
public function reset():void{
this._fileConditions = [];
this._keyConditions = [];
this._ratingConditions = [];
this._sortConditions = [];
this._groupBy = [];
this._lookupKeys = [];
this._lookupRatings = [];
this._randomizeResults = false;
this._resultsPerPage = 20;
this._page = 1;
this.clearCache();
}
function getGroup():SaveGroup{
return (this._group);
}
function getGroupID():uint{
return (this._group.getID());
}
public function includeKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyName(_arg1);
if (_local2){
this._lookupKeys.push(_local2.id);
};
}
public function isRandomized():Boolean{
return (this._randomizeResults);
}
public function includeRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingName(_arg1);
if (_local2){
this._lookupRatings.push(_local2.id);
};
}
public function excludeKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyName(_arg1);
var _local3:uint;
while (_local3 < this._lookupKeys.length) {
if (this._lookupKeys[_local3] == _local2.id){
this._lookupKeys.splice(_local3, 1);
return;
};
_local3++;
};
}
public function excludeRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingName(_arg1);
var _local3:uint;
while (_local3 < this._lookupRatings.length) {
if (this._lookupRatings[_local3] == _local2.id){
this._lookupRatings.splice(_local3, 1);
return;
};
_local3++;
};
}
public function groupBy(_arg1:uint):void{
this._groupBy.push({table:TABLE_FILES, field:_arg1});
}
public function groupByRating(_arg1:String):void{
var _local2:SaveRating = this._group.getRatingName(_arg1);
if (!_local2){
return;
};
this._groupBy.push({table:TABLE_RATINGS, field:_local2.id});
}
public function groupByKey(_arg1:String):void{
var _local2:SaveKey = this._group.getKeyName(_arg1);
if (!_local2){
return;
};
this._groupBy.push({table:TABLE_KEYS, field:_local2.id});
}
public function addFileCondition(_arg1:uint, _arg2:String, _arg3):void{
this._fileConditions.push({field:_arg1, operator:_arg2, value:_arg3});
}
public function addKeyCondition(_arg1:String, _arg2:String, _arg3):void{
var _local4:SaveKey = this._group.getKeyName(_arg1);
if (!_local4){
return;
};
if (!this.checkValue(_arg3, _local4.type)){
return;
};
this._keyConditions.push({key_id:_local4.id, operator:_arg2, value:_arg3});
}
public function addRatingCondition(_arg1:String, _arg2:String, _arg3, _arg4:String="score"):void{
var _local5:SaveRating = this._group.getRatingName(_arg1);
if (!_local5){
return;
};
this._ratingConditions.push({rating_id:_local5.id, operator:_arg2, value:_arg3, column:_arg4});
}
private function addSortCondition(_arg1:uint, _arg2:uint, _arg3:Boolean=false, _arg4=null):void{
var _local5:Object = {table:_arg1, field:_arg2, desc:_arg3};
if (_arg4){
_local5.extra = _arg4;
};
this._sortConditions.push(_local5);
}
public function sortOn(_arg1:uint, _arg2:Boolean=false):void{
this.addSortCondition(TABLE_FILES, _arg1, _arg2);
}
public function sortOnKey(_arg1:String, _arg2:Boolean=false):void{
this.addSortCondition(TABLE_KEYS, this._group.getKeyName(_arg1).id, _arg2);
}
public function sortOnRating(_arg1:String, _arg2:Boolean=false, _arg3:String="score"):void{
this.addSortCondition(TABLE_RATINGS, this._group.getRatingName(_arg1).id, _arg2, _arg3);
}
public function sortOnRatingScore(_arg1:String, _arg2:Boolean){
this.sortOnRating(_arg1, _arg2, SCORE);
}
public function sortOnRatingVotes(_arg1:String, _arg2:Boolean){
this.sortOnRating(_arg1, _arg2, TOTAL_VOTES);
}
public function setResultsPerPage(_arg1:uint){
this._resultsPerPage = _arg1;
this.clearCache();
}
public function setPage(_arg1:Number){
this._page = _arg1;
this.clearCache();
}
public function setRandomize(_arg1:Boolean):void{
this._randomizeResults = _arg1;
}
public function execute():void{
API.executeSaveQuery(this);
}
private function checkValue(_arg1, _arg2:uint):Boolean{
return (true);
}
function setResults(_arg1:Array):void{
this._results = _arg1;
}
override public function toString():String{
return ("");
}
public function toObject():Object{
var _local1:Object = {page:this._page, num_results:this._resultsPerPage};
if (this.isRandomized()){
_local1.randomize = 1;
};
if (((this._fileConditions) && ((this._fileConditions.length > 0)))){
_local1.file_conditions = this._fileConditions;
};
if (((this._keyConditions) && ((this._keyConditions.length > 0)))){
_local1.key_conditions = this._keyConditions;
};
if (((this._ratingConditions) && ((this._ratingConditions.length > 0)))){
_local1.rating_conditions = this._ratingConditions;
};
if (((this._sortConditions) && ((this._sortConditions.length > 0)))){
_local1.sort_conditions = this._sortConditions;
};
if (((this._lookupKeys) && ((this._lookupKeys.length > 0)))){
_local1.lookup_keys = this._lookupKeys;
};
if (((this._lookupRatings) && ((this._lookupRatings.length > 0)))){
_local1.lookup_ratings = this._lookupRatings;
};
if (((this._groupBy) && ((this._groupBy.length > 0)))){
_local1.group_by = this._groupBy;
};
return (_local1);
}
}
}//package com.newgrounds
Section 97
//SaveKey (com.newgrounds.SaveKey)
package com.newgrounds {
public class SaveKey {
private var _id:uint;
private var _name:String;
private var _type:uint;
public static const TYPE_FLOAT:uint = 1;
public static const TYPE_INTEGER:uint = 2;
public static const TYPE_STRING:uint = 3;
public static const TYPE_BOOLEAN:uint = 4;
public function SaveKey(_arg1:uint, _arg2:String, _arg3:uint){
this._id = _arg1;
this._name = _arg2;
this._type = _arg3;
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get type():uint{
return (this._type);
}
public function get key_id():uint{
return (this._id);
}
public function get key_name():String{
return (this._name);
}
public function get key_type():uint{
return (this._type);
}
public function isValueValid(_arg1):Boolean{
if (this._type == TYPE_INTEGER){
return ((((_arg1 is int)) || ((_arg1 is uint))));
};
if (this._type == TYPE_FLOAT){
return ((((((_arg1 is int)) || ((_arg1 is uint)))) || ((_arg1 is Number))));
};
if (this._type == TYPE_STRING){
return ((_arg1 is String));
};
if (this._type == TYPE_BOOLEAN){
return ((((((((_arg1 is Boolean)) || ((_arg1 === 0)))) || ((_arg1 === 1)))) || ((_arg1 == ""))));
};
return (false);
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 98
//SaveRating (com.newgrounds.SaveRating)
package com.newgrounds {
public class SaveRating {
private var _id:uint;
private var _name:String;
private var _minValue:Number;
private var _maxValue:Number;
private var _isFloat:Boolean;
private var _voted:Boolean;
public function SaveRating(_arg1:uint, _arg2:String, _arg3:Boolean, _arg4:Number=-INF, _arg5:Number=INF){
this._id = _arg1;
this._name = _arg2;
this._isFloat = _arg3;
this._minValue = _arg4;
this._maxValue = _arg5;
}
public function get rating_id():uint{
return (this._id);
}
public function get rating_name():String{
return (this._name);
}
public function get id():uint{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get minValue():Number{
return (this._minValue);
}
public function get maxValue():Number{
return (this._maxValue);
}
public function get isFloat():Boolean{
return (this._isFloat);
}
public function get voted():Boolean{
return (this._voted);
}
public function set voted(_arg1:Boolean):void{
this._voted = _arg1;
}
public function toString():String{
return (this._name);
}
}
}//package com.newgrounds
Section 99
//Score (com.newgrounds.Score)
package com.newgrounds {
public class Score {
private var _board:ScoreBoard;
private var _position:uint;
private var _username:String;
private var _value:String;
private var _numeric_value:uint;
private var _tag:String;
public function Score(_arg1:ScoreBoard, _arg2:Number, _arg3:String, _arg4:String, _arg5:uint, _arg6:String){
this._board = _arg1;
this._position = _arg2;
this._username = _arg3;
this._value = _arg4;
this._numeric_value = _arg5;
this._tag = _arg6;
}
public function get board():ScoreBoard{
return (this._board);
}
public function get position():uint{
return (this._position);
}
public function get username():String{
return (this._username);
}
public function get value():String{
return (this._value);
}
public function get numeric_value():uint{
return (this._numeric_value);
}
public function get tag():String{
return (this._tag);
}
}
}//package com.newgrounds
Section 100
//ScoreBoard (com.newgrounds.ScoreBoard)
package com.newgrounds {
import flash.events.*;
public class ScoreBoard extends EventDispatcher {
private var _name:String;
private var _id:uint;
private var _scores:Array;
private var _period:String;// = "Today"
private var _num_results:uint;// = 10
private var _numScores:uint;
private var _desiredNumResults:uint;
private var _startRank:uint;
private var _endRank:uint;
private var _page:uint;// = 1
private var _tag:String;
public function ScoreBoard(_arg1:uint, _arg2:String, _arg3:String){
this._name = _arg2;
this._id = _arg1;
this._scores = [];
this._tag = _arg3;
}
public function exists():Boolean{
return ((this._id > 0));
}
public function get id():Number{
return (this._id);
}
public function get name():String{
return (this._name);
}
public function get period():String{
return (this._period);
}
public function get page():uint{
return (this._page);
}
public function get num_results():uint{
return (this._num_results);
}
public function get scores():Array{
return (this._scores);
}
public function get tag():String{
return (this._tag);
}
public function get num_scores():uint{
return (this._numScores);
}
public function postScore(_arg1:uint, _arg2:String=null):void{
if (_arg2){
this._tag = _arg2;
};
API.postScore(this._name, _arg1);
}
public function loadScores(_arg1:String="Today", _arg2:uint=1, _arg3:uint=10):void{
this._period = _arg1;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._page = _arg2;
this._num_results = _arg3;
this._desiredNumResults = 0;
API.loadScores(this.name);
}
public function loadScoresInRange(_arg1:String="Today", _arg2:uint=1, _arg3:uint=10):void{
if (_arg2 == 0){
_arg2 = 1;
};
if (_arg3 < _arg2){
_arg3 = _arg2;
};
this._period = _arg1;
if (((!(this._period)) || ((this._period == "")))){
this._period = ScoreBoardPeriod.TODAY;
};
this._desiredNumResults = ((_arg3 - _arg2) + 1);
this._num_results = this._desiredNumResults;
while (int(((_arg2 - 1) / this._num_results)) != int(((_arg3 - 1) / this._num_results))) {
this._num_results++;
};
this._page = ((_arg2 - 1) / this._num_results);
this._startRank = _arg2;
this._endRank = _arg3;
this._page++;
API.loadScores(this.name);
}
function setScores(_arg1:Array, _arg2:String, _arg3:Number, _arg4:Number, _arg5:uint):void{
var _local7:uint;
this._period = _arg2;
this._page = _arg3;
this._num_results = _arg4;
this._numScores = _arg5;
this._scores = [];
var _local6:uint;
while (_local6 < _arg1.length) {
_local7 = (((this._num_results * (this._page - 1)) + 1) + _local6);
if (((!(this._desiredNumResults)) || ((((_local7 >= this._startRank)) && ((_local7 <= this._endRank)))))){
this._scores.push(new Score(this, _local7, _arg1[_local6].username, _arg1[_local6].value, _arg1[_local6].numeric_value, _arg1[_local6].tag));
};
_local6++;
};
this._num_results = this._scores.length;
}
}
}//package com.newgrounds
Section 101
//ScoreBoardPeriod (com.newgrounds.ScoreBoardPeriod)
package com.newgrounds {
public class ScoreBoardPeriod {
public static const TODAY:String = "Today";
public static const WEEK:String = "This Week";
public static const MONTH:String = "This Month";
public static const YEAR:String = "This Year";
public static const ALL_TIME:String = "All-Time";
}
}//package com.newgrounds
Section 102
//SmartURLLoader (com.newgrounds.SmartURLLoader)
package com.newgrounds {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.errors.*;
public class SmartURLLoader extends EventDispatcher {
private var _variables:Dictionary;
private var _files:Dictionary;
private var _hasVariables:Boolean;
private var _method:String;// = "GET"
private var _urlRequest:URLRequest;
private var _urlLoader:URLLoader;
private var _dataFormat:String;// = "text"
private var _openBrowser:Boolean;// = false
private var _preventCache:Boolean;// = false
var _command:String;
public var owner;
private static const CRLF:String = "
";
private static var _loaders:Dictionary = new Dictionary();
public function SmartURLLoader(){
this._urlRequest = new URLRequest();
this._variables = new Dictionary();
}
public function get responseFormat():String{
return (this._dataFormat);
}
public function set responseFormat(_arg1:String):void{
this._dataFormat = _arg1;
}
public function get response(){
return (this._urlLoader.data);
}
public function get hasFiles():Boolean{
return (Boolean(this._files));
}
public function get method():String{
return (this._method);
}
public function set method(_arg1:String):void{
if (((this.hasFiles) && ((_arg1 == URLRequestMethod.GET)))){
throw (new IllegalOperationError("GET cannot be used to upload files."));
};
this._method = _arg1;
}
public function get openBrowser():Boolean{
return (this._openBrowser);
}
public function set openBrowser(_arg1:Boolean):void{
this._openBrowser = _arg1;
}
public function get preventCache():Boolean{
return (this._preventCache);
}
public function set preventCache(_arg1:Boolean):void{
this._preventCache = _arg1;
}
public function get bytesLoaded():uint{
return ((this._urlLoader) ? this._urlLoader.bytesLoaded : 0);
}
public function get bytesTotal():uint{
return ((this._urlLoader) ? this._urlLoader.bytesTotal : 0);
}
public function addVariable(_arg1:String, _arg2=""):void{
this._variables[_arg1] = _arg2;
if (_arg2){
this._hasVariables = true;
};
}
public function addFile(_arg1:String, _arg2:ByteArray, _arg3:String, _arg4:String="application/octet-stream"):void{
this.method = URLRequestMethod.POST;
if (!this._files){
this._files = new Dictionary();
};
this._files[_arg1] = new File(_arg1, _arg2, _arg3, _arg4);
}
public function clearVariables():void{
this._variables = new Dictionary();
}
public function clearFiles():void{
this._files = null;
}
public function load(_arg1:String):void{
var urlVariables:URLVariables;
var key:String;
var boundary:String;
var i:uint;
var event:SecurityErrorEvent;
var url = _arg1;
this._urlRequest.url = url;
if (this._preventCache){
url = (url + ("?seed=" + Math.random()));
if (this._hasVariables){
url = (url + "&");
};
};
this._urlRequest.method = this._method;
if ((((this._urlRequest.method == URLRequestMethod.GET)) || (!(this.hasFiles)))){
this._urlRequest.contentType = "application/x-www-form-urlencoded";
if (this._hasVariables){
urlVariables = new URLVariables();
for (key in this._variables) {
urlVariables[key] = this._variables[key];
};
this._urlRequest.data = urlVariables;
};
} else {
boundary = "";
i = 0;
while (i < 32) {
boundary = (boundary + String.fromCharCode(uint((97 + (Math.random() * 25)))));
i = (i + 1);
};
this._urlRequest.contentType = (("multipart/form-data; boundary=\"" + boundary) + "\"");
this._urlRequest.data = this.buildMultipartData(boundary);
};
if (this.openBrowser){
navigateToURL(this._urlRequest, "_blank");
} else {
this._urlLoader = new URLLoader();
this._urlLoader.dataFormat = this._dataFormat;
this._urlLoader.addEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.addEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
_loaders[this._urlLoader] = this;
try {
this._urlLoader.load(this._urlRequest);
} catch(error:Error) {
event = new SecurityErrorEvent(SecurityErrorEvent.SECURITY_ERROR, false, false, error.message);
onSecurityError(event);
};
};
}
public function close():void{
try {
this._urlLoader.close();
} catch(e:Error) {
};
}
public function dispose():void{
this.close();
this._files = null;
this._variables = null;
if (this._urlLoader){
this._urlLoader.removeEventListener(Event.COMPLETE, this.onComplete);
this._urlLoader.removeEventListener(ProgressEvent.PROGRESS, this.onProgress);
this._urlLoader.removeEventListener(IOErrorEvent.IO_ERROR, this.onIOError);
this._urlLoader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, this.onHTTPStatus);
this._urlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onSecurityError);
this._urlLoader = null;
};
this._urlRequest = null;
delete _loaders[this];
}
private function buildMultipartData(_arg1:String):ByteArray{
var _local3:String;
var _local4:File;
var _local2:ByteArray = new ByteArray();
_local2.endian = Endian.BIG_ENDIAN;
_arg1 = ("--" + _arg1);
for (_local3 in this._variables) {
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(((("Content-Disposition: form-data; name=\"" + _local3) + "\"") + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes((this._variables[_local3] + CRLF));
};
if (this.hasFiles){
for each (_local4 in this._files) {
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(("Content-Disposition: form-data; name=\"Filename\"" + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes((_local4.fileName + CRLF));
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(((((("Content-Disposition: form-data; name=\"" + _local4.dataField) + "\"; filename=\"") + _local4.fileName) + "\"") + CRLF));
_local2.writeUTFBytes((("Content-Type: " + _local4.contentType) + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeBytes(_local4.data);
_local2.writeUTFBytes(CRLF);
};
_local2.writeUTFBytes((_arg1 + CRLF));
_local2.writeUTFBytes(("Content-Disposition: form-data; name=\"Upload\"" + CRLF));
_local2.writeUTFBytes(CRLF);
_local2.writeUTFBytes(("Submit Query" + CRLF));
};
_local2.writeUTFBytes((_arg1 + "--"));
_local2.position = 0;
_local2.position = 0;
return (_local2);
}
private function onComplete(_arg1:Event):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onProgress(_arg1:ProgressEvent):void{
dispatchEvent(_arg1);
}
private function onIOError(_arg1:IOErrorEvent):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onSecurityError(_arg1:SecurityErrorEvent):void{
dispatchEvent(_arg1);
this.dispose();
}
private function onHTTPStatus(_arg1:HTTPStatusEvent):void{
dispatchEvent(_arg1);
}
public static function closeAll():void{
var _local1:SmartURLLoader;
for each (_local1 in _loaders) {
if (_local1){
_local1.dispose();
};
};
_loaders = new Dictionary();
}
}
}//package com.newgrounds
import flash.utils.*;
class File {
private var fileName:String;
private var data:ByteArray;
private var dataField:String;
private var contentType:String;
private function File(_arg1:String, _arg2:ByteArray, _arg3:String="Filedata", _arg4:String="application/octet-stream"){
this.fileName = _arg1;
this.data = _arg2;
this.dataField = _arg3;
this.contentType = _arg4;
}
}
Section 103
//Attack (com.nflash.game.model.Attack)
package com.nflash.game.model {
import flash.display.*;
import flash.geom.*;
public class Attack {
public var frcX:int;
public var traits:String;// = ""
public var frcY:int;
public var area:Rectangle;
public var node:XML;
public var source:MovieClip;
public var dmg:int;
public function Attack(_arg1:Rectangle, _arg2:int, _arg3:int=0, _arg4:int=0, _arg5:XML=null, _arg6:MovieClip=null){
area = _arg1;
dmg = _arg2;
frcX = _arg3;
frcY = _arg4;
node = _arg5;
source = _arg6;
if (((_arg5) && ((_arg5.@traits.toString().length > 0)))){
traits = _arg5.@traits.toString();
};
}
}
}//package com.nflash.game.model
Section 104
//Hivemind (com.nflash.game.util.Hivemind)
package com.nflash.game.util {
import com.nflash.game.world.*;
public class Hivemind {
protected var _occupiedRoles:Array;
protected var _occupants:Array;
public static const ROLE_ATTACK_DIRECT:String = "attackDirect";
protected static var _instance:Hivemind;
public function Hivemind(){
if (!_instance){
_instance = this;
};
initialize();
}
protected function roleTaken(_arg1:String):Boolean{
return ((_occupiedRoles.indexOf(_arg1) >= 0));
}
protected function initialize():void{
_occupiedRoles = [];
_occupants = [];
}
public function assignRole(_arg1:Character):String{
var _local2:String = requestRole(_arg1);
if (_occupants.indexOf(_arg1) >= 0){
_occupiedRoles[_occupants.indexOf(_arg1)] = _local2;
} else {
_occupiedRoles.push(_local2);
_occupants.push(_arg1);
};
_arg1.role = _local2;
return (_local2);
}
protected function reassignRole(_arg1:String, _arg2:Boolean=false):String{
var _local3:int = _occupiedRoles.indexOf(_arg1);
if (_local3 >= 0){
return (assignRole(_occupants[_local3]));
};
return ("");
}
public function removeRole(_arg1:Character):String{
var _local2:String;
if (_occupants.indexOf(_arg1) >= 0){
_arg1.role = "";
_local2 = _occupiedRoles.splice(_occupants.indexOf(_arg1), 1);
_occupants.splice(_occupants.indexOf(_arg1), 1);
};
return (_local2);
}
protected function requestRole(_arg1:Character):String{
return (ROLE_ATTACK_DIRECT);
}
public static function getInstance():Hivemind{
return (_instance);
}
}
}//package com.nflash.game.util
Section 105
//Character (com.nflash.game.world.Character)
package com.nflash.game.world {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import com.greensock.*;
import flash.geom.*;
import com.nflash.*;
import com.nflash.game.model.*;
public class Character extends EventNode {
protected var basicState:String;// = "idle"
protected var inputSource:Object;
protected var stunned:Boolean;// = false
protected var pollControls:Boolean;
protected var persistentIds:Array;
protected var spritePlaying:Boolean;// = true
protected var xSpeed:Number;// = 0
protected var airborne:Boolean;// = false
protected var spriteCache:Array;
public var spriteIn:MovieClip;
protected var ySpeed:Number;// = 0
protected var hitCore:Rectangle;
protected var stateData:XML;
protected var lastEval:String;// = ""
protected var persistentActions:Array;
public var dataClass:Class;
protected var useSpriteCaching:Boolean;// = true
protected var controlImprint:Object;
public var role:String;// = ""
protected static const DEFAULT_STATE:String = "idle";
public static var world:World;
public function Character(){
initialize();
}
override public function stop():void{
spriteIn.stop();
spritePlaying = false;
}
public function configureInput(_arg1:Object, _arg2:Boolean=true):void{
inputSource = _arg1;
pollControls = _arg2;
}
protected function checkDependency(_arg1:String, _arg2:Boolean=true):Boolean{
var depend:XML;
var dependKey:int;
var dependAmt:int;
var $dependId = _arg1;
var $changeFrame = _arg2;
depend = XML(dataClass.data.dependencies.dependency.(@id == $dependId));
dependKey = int(depend.@key);
if (controlImprint[dependKey] != undefined){
dependAmt = controlImprint[dependKey];
if ((((dependAmt >= int(depend.@min))) && ((dependAmt <= int(depend.@max))))){
if ($changeFrame){
if (depend.@newFrame.toString().length > 0){
goto(depend.@newState.toString(), int(depend.@newFrame));
} else {
goto(depend.@newState.toString());
};
};
return (true);
};
};
return (false);
}
protected function setSpeed(_arg1:String, _arg2:String):void{
this[(_arg1 + "Speed")] = Number(_arg2);
}
protected function initialize():void{
spriteCache = new Array();
persistentActions = new Array();
persistentIds = new Array();
hitCore = defaultHitCore;
}
protected function processFrameAction(_arg1:XML):void{
var _local2:int;
var _local3:String;
if (_arg1.@persist.toString().length > 0){
_local3 = ((_arg1.@func.toString() + _arg1.@param1.toString()) + _arg1.@param2.toString());
_local2 = persistentIds.indexOf(_local3);
if (spriteIn.currentFrame == Number(_arg1.@frm)){
persistentActions.push({remaining:Number(_arg1.@persist), node:_arg1});
persistentIds.push(((_arg1.@func.toString() + _arg1.@param1.toString()) + _arg1.@param2.toString()));
};
};
if (_arg1.@func.toString().length > 0){
if (_arg1.@param2.toString().length > 0){
var _local4 = this;
_local4[_arg1.@func.toString()](_arg1.@param1.toString(), _arg1.@param2.toString());
} else {
if (_arg1.@param1.toString().length > 0){
_local4 = this;
_local4[_arg1.@func.toString()](_arg1.@param1.toString());
} else {
_local4 = this;
_local4[_arg1.@func.toString()]();
};
};
};
}
public function resume():void{
if (spritePlaying){
spriteIn.play();
};
}
override public function play():void{
spriteIn.play();
spritePlaying = true;
}
protected function handleFrameChange():void{
persistentActions = [];
persistentIds = [];
}
public function hasCollision(_arg1:Rectangle):Boolean{
return ((((((((_arg1.x < ((x + hitCore.x) + hitCore.width))) && (((_arg1.x + _arg1.width) > (x + hitCore.x))))) && ((_arg1.y < ((y + hitCore.y) + hitCore.height))))) && (((_arg1.y + _arg1.height) > (y + hitCore.y)))));
}
protected function destroyCurrentSprite():void{
if (spriteIn){
spriteIn.stop();
if (contains(spriteIn)){
removeChild(spriteIn);
};
TweenMax.killTweensOf(spriteIn);
spriteIn = null;
};
}
public function addSprite(_arg1:DisplayObject):void{
addChild(_arg1);
hitCore = defaultHitCore;
}
protected function createAttackBox(_arg1:String):void{
var attack:Attack;
var attackXml:XML;
var rect:Rectangle;
var damage:Number;
var forceX:Number;
var forceY:Number;
var $attackId = _arg1;
attackXml = XML(dataClass.data.attack_boxes.box.(@id == $attackId));
rect = makeRect(attackXml.@area.toString());
damage = Number(attackXml.@dmg);
forceX = Number(attackXml.@forceX);
forceY = Number(attackXml.@forceY);
if (scaleX < 0){
rect.x = (-(rect.x) - rect.width);
};
rect.x = (rect.x + x);
rect.y = (rect.y + y);
attack = new Attack(rect, damage, (forceX * (scaleX / Math.abs(scaleX))), forceY, attackXml, this);
world.checkAttack(attack);
}
protected function updateState(_arg1:String):void{
var $id = _arg1;
stateData = XML(dataClass.data.states.state.(@id == $id));
if (stateData.@base.toString().length > 0){
basicState = stateData.@base.toString();
};
}
public function update():void{
}
protected function updateHitCore(_arg1:String):void{
hitCore = makeRect(_arg1);
}
protected function get defaultHitCore():Rectangle{
return (new Rectangle(0, 0, 1, 1));
}
protected function createDirectedAttack(_arg1:String):Attack{
var attack:Attack;
var attackXml:XML;
var damage:Number;
var forceX:Number;
var forceY:Number;
var $attackId = _arg1;
attackXml = XML(dataClass.data.attack_boxes.box.(@id == $attackId));
damage = Number(attackXml.@dmg);
forceX = Number(attackXml.@forceX);
forceY = Number(attackXml.@forceY);
attack = new Attack(null, damage, (forceX * (scaleX / Math.abs(scaleX))), forceY, attackXml, this);
return (attack);
}
protected function get defaultState():String{
return (DEFAULT_STATE);
}
public function initData(_arg1:Class):void{
dataClass = _arg1;
goto(defaultState);
}
public function goto(_arg1:String, _arg2:int=0, _arg3:Boolean=true):void{
var _local4:String;
var _local5:Class;
var _local6:MovieClip;
var _local7:String = (spriteIn) ? ((spriteIn.name + "_") + spriteIn.currentFrame) : "";
_arg2 = Number(_arg2);
if (((!(spriteIn)) || (!((spriteIn.name == _arg1))))){
destroyCurrentSprite();
updateState(_arg1);
if (((useSpriteCaching) && (!((spriteCache[_arg1] == undefined))))){
_local6 = spriteCache[_arg1];
} else {
_local4 = stateData.@className.toString();
_local5 = Class(getDefinitionByName(_local4));
_local6 = new (_local5);
_local6.name = _arg1;
};
if (_arg3){
_local6.gotoAndPlay(_arg2);
} else {
_local6.gotoAndStop(_arg2);
};
spritePlaying = _arg3;
if (useSpriteCaching){
spriteCache[_arg1] = _local6;
};
spriteIn = _local6;
addSprite(spriteIn);
checkFrameActions();
handleFrameChange();
} else {
if (spriteIn){
if ((((((spriteIn.name == _arg1)) && (!((spriteIn.currentFrame == _arg2))))) && (!((_arg2 == 0))))){
if (_arg3){
spriteIn.gotoAndPlay(_arg2);
} else {
spriteIn.gotoAndStop(_arg2);
};
spritePlaying = _arg3;
checkFrameActions();
handleFrameChange();
};
};
};
}
protected function makeRect(_arg1:String):Rectangle{
var _local2:Array = _arg1.split(",");
return (new Rectangle(Number(_local2[0]), Number(_local2[1]), Number(_local2[2]), Number(_local2[3])));
}
protected function signOf(_arg1:Number):int{
if (_arg1 >= 0){
return (1);
};
return (-1);
}
public function pause():void{
spriteIn.stop();
}
protected function checkFrameActions():void{
var i:int;
var actionList:XMLList;
actionList = stateData.action.(@frm == String(spriteIn.currentFrame));
i = 0;
while (i < actionList.length()) {
if (actionList[i].@alwaysCheck.toString() == "y"){
processFrameAction(actionList[i]);
};
i = (i + 1);
};
if (((spritePlaying) && (!((((spriteIn.name + "_") + spriteIn.currentFrame) == lastEval))))){
i = 0;
while (i < persistentActions.length) {
persistentActions[i].remaining--;
if (persistentActions[i].remaining > 0){
processFrameAction(persistentActions[i].node);
};
i = (i + 1);
};
if (actionList.length() > 0){
i = 0;
while (i < actionList.length()) {
if (actionList[i].@alwaysCheck.toString() != "y"){
processFrameAction(actionList[i]);
};
i = (i + 1);
};
};
lastEval = ((spriteIn.name + "_") + spriteIn.currentFrame);
};
}
protected function adjustSpeed(_arg1:String, _arg2:String):void{
this[(_arg1 + "Speed")] = (this[(_arg1 + "Speed")] + Number(_arg2));
}
}
}//package com.nflash.game.world
Section 106
//Level (com.nflash.game.world.Level)
package com.nflash.game.world {
import flash.display.*;
import flash.events.*;
import com.nflash.*;
public class Level extends EventNode {
protected var boundsHolder:Sprite;
protected static var boundingClipClass:Class;
protected static var currentLevelData:XML;
public static var levelData:XML;
public function Level(){
initialize();
buildInterface();
}
protected function initialize():void{
}
public function setContent(_arg1:XML):void{
if (_arg1.platforms.children().length() > 0){
buildPlatforms(XML(_arg1.platforms));
};
}
protected function buildPlatforms(_arg1:XML):void{
var _local3:MovieClip;
var _local4:XML;
var _local2:int;
for each (_local4 in _arg1.platform) {
_local3 = new boundingClipClass();
_local3.gotoAndStop(_local4.@id.toString());
_local3.gotoAndStop((_local3.currentFrame + _local2));
addChild(_local3);
_local2++;
};
}
protected function buildInterface():void{
}
public static function initClass(_arg1:XML, _arg2:Class=null):void{
levelData = _arg1;
boundingClipClass = _arg2;
}
}
}//package com.nflash.game.world
Section 107
//World (com.nflash.game.world.World)
package com.nflash.game.world {
import flash.display.*;
import flash.events.*;
import com.nflash.game.util.*;
import flash.geom.*;
import com.nflash.*;
import com.nflash.game.model.*;
public class World extends EventNode {
protected var _hivemind:Hivemind;
protected var level:Level;
protected var char:Character;
public function World(){
initialize();
}
public function checkAttack(_arg1:Attack):void{
}
protected function initialize():void{
}
public function update():void{
}
public function populateLevel():void{
}
public function loadLevel(_arg1:String):void{
var $levelId = _arg1;
level = new Level();
level.name = "level";
level.setContent(XML(Level.levelData.level.(@id == $levelId)));
addChild(level);
}
}
}//package com.nflash.game.world
Section 108
//EventNode (com.nflash.EventNode)
package com.nflash {
import flash.display.*;
import flash.events.*;
import com.relish.events.*;
public class EventNode extends MovieClip {
protected var eventChildren:Array;
public static const NODE_SPEAK:String = "nodeSpeak";
public function EventNode(){
eventChildren = new Array();
}
protected function onNodeSpeak(_arg1:InfoEvent):void{
var _local2:String = _arg1.data.path;
var _local3:String = _local2.split(".")[0];
if (containsNode(_local3)){
if (_local2.split(".").length > 0){
_arg1.data.path = _local2.substring((_local2.indexOf(".") + 1), _local2.length);
trace(("[EventNode] onNodeSpeak - new path = " + _arg1.data.path));
passEventDown(_arg1);
} else {
handleFinal(_arg1.data);
};
} else {
dispatchEvent(_arg1);
};
}
public function containsNode(_arg1:String):Boolean{
return (Boolean(!((getChildByName(_arg1) == null))));
}
public function removeEventChild(_arg1:EventNode):void{
if (eventChildren.indexOf(_arg1) >= 0){
_arg1.removeEventListener(EventNode.NODE_SPEAK, onNodeSpeak);
eventChildren.splice(eventChildren.indexOf(_arg1), 1);
};
}
public function processFinal(_arg1:Object):void{
switch (_arg1.type){
case "func":
if (_arg1.param){
var _local2 = this;
_local2[_arg1.value](_arg1.param);
} else {
_local2 = this;
_local2[_arg1.value]();
};
break;
case "property":
this[_arg1.value] = _arg1.param;
break;
default:
trace("[EventNode] processFinal - ERROR: no behaviour found");
break;
};
}
override public function removeChild(_arg1:DisplayObject):DisplayObject{
if ((_arg1 is EventNode)){
removeEventChild(EventNode(_arg1));
};
return (super.removeChild(_arg1));
}
public function addEventChild(_arg1:EventNode):void{
if (eventChildren.indexOf(_arg1) < 0){
eventChildren.push(_arg1);
_arg1.addEventListener(EventNode.NODE_SPEAK, onNodeSpeak);
};
}
override public function addChild(_arg1:DisplayObject):DisplayObject{
if ((_arg1 is EventNode)){
addEventChild(EventNode(_arg1));
};
return (super.addChild(_arg1));
}
public function passEventDown(_arg1:InfoEvent):void{
var _local2:String = _arg1.data.path;
var _local3:String = _local2.split(".")[0];
if (_local2.split(".").length > 0){
if (containsNode(_local3)){
_arg1.data.path = _local2.substring((_local2.indexOf(".") + 1), _local2.length);
trace(("[EventNode] passEventDown - new path = " + _arg1.data.path));
passEventDown(_arg1);
} else {
trace((("[EventNode] passEventDown - ERROR: failed to pass event down at '" + _local3) + "'"));
};
} else {
if (containsNode(_local3)){
handleFinal(_arg1.data);
} else {
trace((("[EventNode] passEventDown - ERROR: failed to finalize event at '" + _local3) + "'"));
};
};
}
protected function handleFinal(_arg1:Object):void{
var _local2:EventNode = EventNode(getChildByName(_arg1.path.split(".")[0]));
_local2.processFinal(_arg1);
}
}
}//package com.nflash
Section 109
//KeyboardReader (com.nflash.KeyboardReader)
package com.nflash {
import flash.display.*;
import flash.events.*;
public class KeyboardReader {
protected static var redundant:MovieClip;
protected static var monitoredKeys:Array;
protected static var stageRef:Stage;
protected static var controlMap:Array;
protected static function onCheckKeyHolds(_arg1:Event):void{
var _local2:int;
while (_local2 < monitoredKeys.length) {
if (controlMap[monitoredKeys[_local2]] > 0){
var _local3 = controlMap;
var _local4 = monitoredKeys[_local2];
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
};
_local2++;
};
}
public static function init(_arg1:Stage):void{
stageRef = _arg1;
stageRef.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPushed);
stageRef.addEventListener(KeyboardEvent.KEY_UP, onKeyReleased);
controlMap = new Array();
monitoredKeys = new Array();
redundant = new MovieClip();
redundant.addEventListener(Event.ENTER_FRAME, onCheckKeyHolds);
}
public static function getImprint(_arg1:Array):Array{
var _local2:Array = new Array();
var _local3:int;
while (_local3 < _arg1.length) {
_local2.push(((controlMap[String(_arg1[_local3])] == undefined)) ? 0 : controlMap[String(_arg1[_local3])]);
_local3++;
};
return (_local2);
}
protected static function onKeyPushed(_arg1:KeyboardEvent):void{
if ((((controlMap[String(_arg1.keyCode)] == undefined)) || ((controlMap[String(_arg1.keyCode)] == 0)))){
controlMap[String(_arg1.keyCode)] = 1;
};
if (monitoredKeys.indexOf(String(_arg1.keyCode)) < 0){
monitoredKeys.push(String(_arg1.keyCode));
};
}
protected static function onKeyReleased(_arg1:KeyboardEvent):void{
controlMap[String(_arg1.keyCode)] = 0;
}
}
}//package com.nflash
Section 110
//InfoEvent (com.relish.events.InfoEvent)
package com.relish.events {
import flash.events.*;
public class InfoEvent extends Event {
public var data:Object;
public static const INFO:String = "info";
public function InfoEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.data = _arg2;
}
override public function clone():Event{
return (new InfoEvent(this.type, this.data, this.bubbles, this.cancelable));
}
}
}//package com.relish.events
Section 111
//NewgroundsAPIAsset_API_Conencted_15 (ScoreBoard_fla.NewgroundsAPIAsset_API_Conencted_15)
package ScoreBoard_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_API_Conencted_15 extends MovieClip {
public function NewgroundsAPIAsset_API_Conencted_15(){
addFrameScript(36, this.frame37);
}
function frame37(){
APIConnector(parent).clear();
}
}
}//package ScoreBoard_fla
Section 112
//NewgroundsAPIAsset_ConnectingAPI_13 (ScoreBoard_fla.NewgroundsAPIAsset_ConnectingAPI_13)
package ScoreBoard_fla {
import flash.display.*;
public dynamic class NewgroundsAPIAsset_ConnectingAPI_13 extends MovieClip {
public function NewgroundsAPIAsset_ConnectingAPI_13(){
addFrameScript(9, this.frame10);
}
function frame10(){
stop();
}
}
}//package ScoreBoard_fla
Section 113
//NewgroundsAPIAsset_Connection_Error_18 (ScoreBoard_fla.NewgroundsAPIAsset_Connection_Error_18)
package ScoreBoard_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_Connection_Error_18 extends MovieClip {
public function NewgroundsAPIAsset_Connection_Error_18(){
addFrameScript(9, this.frame10, 20, this.frame21);
}
function frame10(){
stop();
}
function frame21(){
APIConnector(parent).clear();
}
}
}//package ScoreBoard_fla
Section 114
//NewgroundsAPIAsset_FlashAd_Container_34 (ScoreBoard_fla.NewgroundsAPIAsset_FlashAd_Container_34)
package ScoreBoard_fla {
import com.newgrounds.*;
import flash.display.*;
import flash.events.*;
public dynamic class NewgroundsAPIAsset_FlashAd_Container_34 extends MovieClip {
public var adMask:MovieClip;
public var ngLinkButton:SimpleButton;
public function NewgroundsAPIAsset_FlashAd_Container_34(){
addFrameScript(0, this.frame1, 10, this.frame11);
}
public function onNGLinkClicked(_arg1:MouseEvent):void{
API.loadNewgrounds();
}
function frame1(){
this.ngLinkButton.addEventListener(MouseEvent.CLICK, this.onNGLinkClicked);
}
function frame11(){
gotoAndPlay(1);
}
}
}//package ScoreBoard_fla
Section 115
//NewgroundsAPIAsset_Load_Indicator_14 (ScoreBoard_fla.NewgroundsAPIAsset_Load_Indicator_14)
package ScoreBoard_fla {
import flash.display.*;
import flash.events.*;
public dynamic class NewgroundsAPIAsset_Load_Indicator_14 extends MovieClip {
public function NewgroundsAPIAsset_Load_Indicator_14(){
addFrameScript(0, this.frame1);
}
public function onEnterFrame(_arg1:Event):void{
if (((visible) && (stage))){
rotation = (rotation + 30);
} else {
removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
};
}
function frame1(){
addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
}
}
}//package ScoreBoard_fla
Section 116
//NewgroundsAPIAsset_Login_Warning_16 (ScoreBoard_fla.NewgroundsAPIAsset_Login_Warning_16)
package ScoreBoard_fla {
import flash.display.*;
import com.newgrounds.components.*;
public dynamic class NewgroundsAPIAsset_Login_Warning_16 extends MovieClip {
public function NewgroundsAPIAsset_Login_Warning_16(){
addFrameScript(9, this.frame10, 20, this.frame21);
}
function frame10(){
stop();
}
function frame21(){
APIConnector(parent).clear();
}
}
}//package ScoreBoard_fla
Section 117
//score_period_dropdown_5 (ScoreBoard_fla.score_period_dropdown_5)
package ScoreBoard_fla {
import flash.display.*;
import flash.text.*;
public dynamic class score_period_dropdown_5 extends MovieClip {
public var periodListButton:SimpleButton;
public var periodText:TextField;
public var period0:SimpleButton;
public var period1:SimpleButton;
public var period2:SimpleButton;
public var period3:SimpleButton;
public var period4:SimpleButton;
public var periodListUpButton:SimpleButton;
public function score_period_dropdown_5(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package ScoreBoard_fla
Section 118
//acornget_128 (squirrel_fla.acornget_128)
package squirrel_fla {
import flash.display.*;
public dynamic class acornget_128 extends MovieClip {
public function acornget_128(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package squirrel_fla
Section 119
//alienlevel_plant_destroyed_101 (squirrel_fla.alienlevel_plant_destroyed_101)
package squirrel_fla {
import flash.display.*;
public dynamic class alienlevel_plant_destroyed_101 extends MovieClip {
public function alienlevel_plant_destroyed_101(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package squirrel_fla
Section 120
//alienlevel_plant_eat_99 (squirrel_fla.alienlevel_plant_eat_99)
package squirrel_fla {
import flash.display.*;
public dynamic class alienlevel_plant_eat_99 extends MovieClip {
public function alienlevel_plant_eat_99(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package squirrel_fla
Section 121
//alienobstacle1dashed_94 (squirrel_fla.alienobstacle1dashed_94)
package squirrel_fla {
import flash.display.*;
public dynamic class alienobstacle1dashed_94 extends MovieClip {
public function alienobstacle1dashed_94(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package squirrel_fla
Section 122
//brokenventanimating_96 (squirrel_fla.brokenventanimating_96)
package squirrel_fla {
import flash.display.*;
public dynamic class brokenventanimating_96 extends MovieClip {
public function brokenventanimating_96(){
addFrameScript(13, frame14);
}
function frame14(){
stop();
}
}
}//package squirrel_fla
Section 123
//BusinessPOOF_86 (squirrel_fla.BusinessPOOF_86)
package squirrel_fla {
import flash.display.*;
public dynamic class BusinessPOOF_86 extends MovieClip {
public function BusinessPOOF_86(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package squirrel_fla
Section 124
//enemy_eyeballbitchslap_82 (squirrel_fla.enemy_eyeballbitchslap_82)
package squirrel_fla {
import flash.display.*;
public dynamic class enemy_eyeballbitchslap_82 extends MovieClip {
public function enemy_eyeballbitchslap_82(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package squirrel_fla
Section 125
//enemy_eyeballblowup_83 (squirrel_fla.enemy_eyeballblowup_83)
package squirrel_fla {
import flash.display.*;
public dynamic class enemy_eyeballblowup_83 extends MovieClip {
public function enemy_eyeballblowup_83(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package squirrel_fla
Section 126
//game_Explosion_74 (squirrel_fla.game_Explosion_74)
package squirrel_fla {
import flash.display.*;
public dynamic class game_Explosion_74 extends MovieClip {
public function game_Explosion_74(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package squirrel_fla
Section 127
//goldenacornget_193 (squirrel_fla.goldenacornget_193)
package squirrel_fla {
import flash.display.*;
public dynamic class goldenacornget_193 extends MovieClip {
public function goldenacornget_193(){
addFrameScript(26, frame27);
}
function frame27(){
stop();
}
}
}//package squirrel_fla
Section 128
//rockbreak_90 (squirrel_fla.rockbreak_90)
package squirrel_fla {
import flash.display.*;
public dynamic class rockbreak_90 extends MovieClip {
public function rockbreak_90(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package squirrel_fla
Section 129
//springbounce_197 (squirrel_fla.springbounce_197)
package squirrel_fla {
import flash.display.*;
public dynamic class springbounce_197 extends MovieClip {
public function springbounce_197(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package squirrel_fla
Section 130
//Acorn (Acorn)
package {
import asfiles.*;
public dynamic class Acorn extends Collidable {
}
}//package
Section 131
//AcornSound (AcornSound)
package {
import flash.media.*;
public dynamic class AcornSound extends Sound {
}
}//package
Section 132
//AlienBg (AlienBg)
package {
import asfiles.world.*;
public dynamic class AlienBg extends BackgroundLayer {
}
}//package
Section 133
//AlienBoosted (AlienBoosted)
package {
import flash.display.*;
public dynamic class AlienBoosted extends MovieClip {
}
}//package
Section 134
//AlienDome (AlienDome)
package {
import flash.display.*;
public dynamic class AlienDome extends MovieClip {
}
}//package
Section 135
//AlienElectrified (AlienElectrified)
package {
import flash.display.*;
public dynamic class AlienElectrified extends MovieClip {
}
}//package
Section 136
//AlienMidground (AlienMidground)
package {
import asfiles.world.*;
public dynamic class AlienMidground extends BackgroundLayer {
}
}//package
Section 137
//AlienShiplike (AlienShiplike)
package {
import flash.display.*;
public dynamic class AlienShiplike extends MovieClip {
}
}//package
Section 138
//AlienSubtier (AlienSubtier)
package {
import flash.display.*;
public dynamic class AlienSubtier extends MovieClip {
}
}//package
Section 139
//AlienTiered (AlienTiered)
package {
import flash.display.*;
public dynamic class AlienTiered extends MovieClip {
}
}//package
Section 140
//AlienTiny (AlienTiny)
package {
import flash.display.*;
public dynamic class AlienTiny extends MovieClip {
}
}//package
Section 141
//AlienTriangular (AlienTriangular)
package {
import flash.display.*;
public dynamic class AlienTriangular extends MovieClip {
}
}//package
Section 142
//BirdEscapeSound (BirdEscapeSound)
package {
import flash.media.*;
public dynamic class BirdEscapeSound extends Sound {
}
}//package
Section 143
//BirdFluff (BirdFluff)
package {
import asfiles.effects.*;
public dynamic class BirdFluff extends PlayOnceClip {
}
}//package
Section 144
//BirdHitSound (BirdHitSound)
package {
import flash.media.*;
public dynamic class BirdHitSound extends Sound {
}
}//package
Section 145
//BluntHitSound (BluntHitSound)
package {
import flash.media.*;
public dynamic class BluntHitSound extends Sound {
}
}//package
Section 146
//BrownBuilding (BrownBuilding)
package {
import flash.display.*;
public dynamic class BrownBuilding extends MovieClip {
}
}//package
Section 147
//CityBg (CityBg)
package {
import asfiles.world.*;
public dynamic class CityBg extends BackgroundLayer {
}
}//package
Section 148
//CityDistantBg (CityDistantBg)
package {
import asfiles.world.*;
public dynamic class CityDistantBg extends BackgroundLayer {
}
}//package
Section 149
//CityMidground (CityMidground)
package {
import asfiles.world.*;
public dynamic class CityMidground extends BackgroundLayer {
}
}//package
Section 150
//CreditsVideo (CreditsVideo)
package {
import flash.display.*;
public dynamic class CreditsVideo extends MovieClip {
}
}//package
Section 151
//DashDust (DashDust)
package {
import asfiles.effects.*;
public dynamic class DashDust extends PlayOnceClip {
}
}//package
Section 152
//DashSound (DashSound)
package {
import flash.media.*;
public dynamic class DashSound extends Sound {
}
}//package
Section 153
//DeathMessage (DeathMessage)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DeathMessage extends MovieClip {
public var deathLabel:MovieClip;
public var label:TextField;
public var restartClip:MovieClip;
public function DeathMessage(){
addFrameScript(0, frame1, 1, frame2);
}
function frame2(){
}
function frame1(){
stop();
}
}
}//package
Section 154
//DistanceCounter (DistanceCounter)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DistanceCounter extends MovieClip {
public var label:TextField;
}
}//package
Section 155
//DragonInterim (DragonInterim)
package {
import flash.display.*;
import asfiles.util.*;
public dynamic class DragonInterim extends MovieClip {
public function DragonInterim(){
addFrameScript(60, frame61);
}
function frame61(){
AudioManager.playSoundFromLibrary("DragonSpitSound");
}
}
}//package
Section 156
//DragonIntro (DragonIntro)
package {
import flash.display.*;
public dynamic class DragonIntro extends MovieClip {
}
}//package
Section 157
//DragonSpitSound (DragonSpitSound)
package {
import flash.media.*;
public dynamic class DragonSpitSound extends Sound {
}
}//package
Section 158
//EarthMusic (EarthMusic)
package {
import flash.media.*;
public dynamic class EarthMusic extends Sound {
}
}//package
Section 159
//EndingMusic (EndingMusic)
package {
import flash.media.*;
public dynamic class EndingMusic extends Sound {
}
}//package
Section 160
//EndingVideo (EndingVideo)
package {
import flash.display.*;
public dynamic class EndingVideo extends MovieClip {
}
}//package
Section 161
//FireballHitSound (FireballHitSound)
package {
import flash.media.*;
public dynamic class FireballHitSound extends Sound {
}
}//package
Section 162
//GameOverSound (GameOverSound)
package {
import flash.media.*;
public dynamic class GameOverSound extends Sound {
}
}//package
Section 163
//GoldenAcorn (GoldenAcorn)
package {
import asfiles.*;
public dynamic class GoldenAcorn extends Collidable {
}
}//package
Section 164
//GoldenAcornSound (GoldenAcornSound)
package {
import flash.media.*;
public dynamic class GoldenAcornSound extends Sound {
}
}//package
Section 165
//GreenBuilding (GreenBuilding)
package {
import flash.display.*;
public dynamic class GreenBuilding extends MovieClip {
}
}//package
Section 166
//HitCore (HitCore)
package {
import flash.display.*;
public dynamic class HitCore extends MovieClip {
}
}//package
Section 167
//IntroMusic (IntroMusic)
package {
import flash.media.*;
public dynamic class IntroMusic extends Sound {
}
}//package
Section 168
//JumpSound (JumpSound)
package {
import flash.media.*;
public dynamic class JumpSound extends Sound {
}
}//package
Section 169
//JunkCrashSound (JunkCrashSound)
package {
import flash.media.*;
public dynamic class JunkCrashSound extends Sound {
}
}//package
Section 170
//LaserSound (LaserSound)
package {
import flash.media.*;
public dynamic class LaserSound extends Sound {
}
}//package
Section 171
//MenuMusic (MenuMusic)
package {
import flash.media.*;
public dynamic class MenuMusic extends Sound {
}
}//package
Section 172
//MetalHitSound (MetalHitSound)
package {
import flash.media.*;
public dynamic class MetalHitSound extends Sound {
}
}//package
Section 173
//NewgroundsAPIAsset_big_popup_background (NewgroundsAPIAsset_big_popup_background)
package {
import flash.display.*;
public dynamic class NewgroundsAPIAsset_big_popup_background extends MovieClip {
public var tl:MovieClip;
public var br:MovieClip;
public var tr:MovieClip;
public var l:MovieClip;
public var shadow:MovieClip;
public var r:MovieClip;
public var b:MovieClip;
public var bl:MovieClip;
public var t:MovieClip;
public var c:MovieClip;
}
}//package
Section 174
//PlantEatSound (PlantEatSound)
package {
import flash.media.*;
public dynamic class PlantEatSound extends Sound {
}
}//package
Section 175
//RedBuilding (RedBuilding)
package {
import flash.display.*;
public dynamic class RedBuilding extends MovieClip {
}
}//package
Section 176
//ShockSound (ShockSound)
package {
import flash.media.*;
public dynamic class ShockSound extends Sound {
}
}//package
Section 177
//SloppyHitSound (SloppyHitSound)
package {
import flash.media.*;
public dynamic class SloppyHitSound extends Sound {
}
}//package
Section 178
//SoundOffSound (SoundOffSound)
package {
import flash.media.*;
public dynamic class SoundOffSound extends Sound {
}
}//package
Section 179
//SoundOnSound (SoundOnSound)
package {
import flash.media.*;
public dynamic class SoundOnSound extends Sound {
}
}//package
Section 180
//SpaceDashing (SpaceDashing)
package {
import flash.display.*;
public dynamic class SpaceDashing extends MovieClip {
}
}//package
Section 181
//SpaceDistantBg (SpaceDistantBg)
package {
import asfiles.world.*;
public dynamic class SpaceDistantBg extends BackgroundLayer {
}
}//package
Section 182
//SpaceDying (SpaceDying)
package {
import flash.display.*;
public dynamic class SpaceDying extends MovieClip {
}
}//package
Section 183
//SpaceInterim (SpaceInterim)
package {
import flash.display.*;
import asfiles.util.*;
public dynamic class SpaceInterim extends MovieClip {
public function SpaceInterim(){
addFrameScript(24, frame25, 35, frame36, 56, frame57);
}
function frame25(){
AudioManager.playSoundFromLibrary("LaserSound");
}
function frame57(){
AudioManager.playSoundFromLibrary("LaserSound");
}
function frame36(){
AudioManager.playSoundFromLibrary("LaserSound");
}
}
}//package
Section 184
//SpaceJumping (SpaceJumping)
package {
import flash.display.*;
public dynamic class SpaceJumping extends MovieClip {
}
}//package
Section 185
//SpaceLanding (SpaceLanding)
package {
import flash.display.*;
public dynamic class SpaceLanding extends MovieClip {
}
}//package
Section 186
//SpaceMusic (SpaceMusic)
package {
import flash.media.*;
public dynamic class SpaceMusic extends Sound {
}
}//package
Section 187
//SpaceRunning (SpaceRunning)
package {
import flash.display.*;
public dynamic class SpaceRunning extends MovieClip {
}
}//package
Section 188
//SpaceTransition (SpaceTransition)
package {
import flash.display.*;
public dynamic class SpaceTransition extends MovieClip {
}
}//package
Section 189
//SpaceTripping (SpaceTripping)
package {
import flash.display.*;
public dynamic class SpaceTripping extends MovieClip {
}
}//package
Section 190
//Spring (Spring)
package {
import asfiles.*;
public dynamic class Spring extends Collidable {
}
}//package
Section 191
//SpringSound (SpringSound)
package {
import flash.media.*;
public dynamic class SpringSound extends Sound {
}
}//package
Section 192
//SquirrelBurning (SquirrelBurning)
package {
import flash.display.*;
public dynamic class SquirrelBurning extends MovieClip {
}
}//package
Section 193
//SquirrelDashing (SquirrelDashing)
package {
import flash.display.*;
public dynamic class SquirrelDashing extends MovieClip {
}
}//package
Section 194
//SquirrelDying (SquirrelDying)
package {
import flash.display.*;
public dynamic class SquirrelDying extends MovieClip {
}
}//package
Section 195
//SquirrelJumping (SquirrelJumping)
package {
import flash.display.*;
public dynamic class SquirrelJumping extends MovieClip {
}
}//package
Section 196
//SquirrelLanding (SquirrelLanding)
package {
import flash.display.*;
public dynamic class SquirrelLanding extends MovieClip {
}
}//package
Section 197
//SquirrelRunning (SquirrelRunning)
package {
import flash.display.*;
public dynamic class SquirrelRunning extends MovieClip {
}
}//package
Section 198
//TransitionMusic (TransitionMusic)
package {
import flash.media.*;
public dynamic class TransitionMusic extends Sound {
}
}//package
Section 199
//Trash1 (Trash1)
package {
import asfiles.effects.*;
public dynamic class Trash1 extends WeightedObject {
}
}//package
Section 200
//Trash2 (Trash2)
package {
import asfiles.effects.*;
public dynamic class Trash2 extends WeightedObject {
}
}//package
Section 201
//Trash3 (Trash3)
package {
import asfiles.effects.*;
public dynamic class Trash3 extends WeightedObject {
}
}//package
Section 202
//Trash4 (Trash4)
package {
import asfiles.effects.*;
public dynamic class Trash4 extends WeightedObject {
}
}//package
Section 203
//Trash5 (Trash5)
package {
import asfiles.effects.*;
public dynamic class Trash5 extends WeightedObject {
}
}//package
Section 204
//Trash6 (Trash6)
package {
import asfiles.effects.*;
public dynamic class Trash6 extends WeightedObject {
}
}//package