Section 1
//AGLogo (armorgames.logo.AGLogo)
package armorgames.logo {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class AGLogo extends MovieClip {
private var onCompleteCall:Function;
private var onCompleteParamsCall:Array;
public function AGLogo(){
stop();
buttonMode = true;
}
public function init(_arg1:Function=null, _arg2:Array=null):void{
onCompleteCall = _arg1;
onCompleteParamsCall = _arg2;
}
public function start():void{
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
addEventListener(MouseEvent.CLICK, handleClick);
play();
}
private function handleClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.armorgames.com/"));
}
private function handleEnterFrame(_arg1:Event):void{
if (currentFrame == totalFrames){
stop();
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
removeEventListener(MouseEvent.CLICK, handleClick);
if (onCompleteCall != null){
onCompleteCall.apply(this, onCompleteParamsCall);
};
};
}
}
}//package armorgames.logo
Section 2
//DebugOutput (betz.debug.DebugOutput)
package betz.debug {
public class DebugOutput {
protected var className:String;// = ""
protected var on:Boolean;// = true
protected static var ON_SCREEN:Boolean = false;
protected static var ALL_ON:Boolean = true;
protected static var filter:String = "";
public function DebugOutput(_arg1:Object){
var _local6:int;
super();
var _local2:RegExp = /\[object |\]/g;
var _local3:String = _arg1.toString().replace(_local2, "");
className = _local3;
var _local4:Error = new Error();
var _local5:String = _local4.getStackTrace();
if (_local5){
_local6 = _local5.indexOf("[");
ALL_ON = (on = !((_local6 == -1)));
} else {
ALL_ON = (on = false);
};
}
protected function output(_arg1:String, _arg2:uint=3):void{
var _local10:Array;
var _local3:Error = new Error();
var _local4:String = _local3.getStackTrace();
var _local5:Array = _local4.split("\n");
var _local6:Array = _local5[_arg2].split("[");
var _local7 = "";
if (_local6[1] != null){
_local10 = _local6[1].split(":");
_local7 = _local6[1].split(":")[(_local10.length - 1)].substr(0, (_local10.length - 1));
};
var _local8:String = _local6[0].substring(4);
var _local9 = ((("[ " + _local8) + ((_local7)!="") ? (" : " + _local7) : "") + " ] -> ");
if (!ON_SCREEN){
trace((_local9 + _arg1));
} else {
OnScreenTracer.trace((_local9 + _arg1));
};
}
public function outEx(_arg1:String, ... _args):void{
if (!canOutput){
return;
};
var _local3:String = _arg1;
var _local4:int;
while (_local4 < _args.length) {
_local3 = (_local3 + (_args[_local4].toString() + " "));
_local4++;
};
output(_local3);
}
public function turnOff():void{
on = false;
}
public function set setFilter(_arg1:Boolean):void{
if (_arg1){
filter = className;
trace((("[ DebugOutput ]: FILTER SET TO: < " + filter) + " >"));
} else {
filter = "";
};
}
protected function get canOutput():Boolean{
return (((((on) && (ALL_ON))) && ((((filter == className)) || ((filter == ""))))));
}
public function turnOn():void{
on = true;
}
public function out(... _args):void{
if (!canOutput){
return;
};
var _local2 = "";
var _local3:int;
while (_local3 < _args.length) {
_local2 = (_local2 + (_args[_local3].toString() + " "));
_local3++;
};
output(_local2);
}
public static function turnOnAll():void{
ALL_ON = true;
}
public static function turnOffAll():void{
ALL_ON = false;
}
public static function showOnScreen():void{
ON_SCREEN = OnScreenTracer.exists();
if (!ON_SCREEN){
trace("[ DebugOutput/showOnScreen() ] ERROR -> \n\tAn instance of OnScreenTracer does not exist. Please declare an instance of OnScreenTracer before using this option.");
};
}
public static function showOffScreen():void{
ON_SCREEN = false;
}
}
}//package betz.debug
Section 3
//DebugOutputType (betz.debug.DebugOutputType)
package betz.debug {
public class DebugOutputType {
public static const IOERROR:String = "IOERROR:";
public static const RANGE_ERROR:String = "OUT OF RANGE ERROR:";
public static const NULL:String = "NULL ERROR:";
public static const ERROR:String = "ERROR:";
}
}//package betz.debug
Section 4
//DebugSystemUtil (betz.debug.DebugSystemUtil)
package betz.debug {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.system.*;
public class DebugSystemUtil extends Sprite {
private var _textOn:Boolean;// = true
private var _text:TextField;
private var _graphOn:Boolean;// = true
private var _fpsTime:int;// = 0
private var _version:String;// = ""
private var _fps:int;// = 0
private var _bmd:BitmapData;
private var _ms:int;// = 0
private var _bmp:Bitmap;
private var _fpsLastTime:int;// = 0
private var _fpsMax:int;// = 12
private var _lastTime:int;// = 0
private var _curTime:int;// = 0
private var _fpsCntr:int;// = 0
private var _memMax:int;// = 100000000
public function DebugSystemUtil(){
_bmd = new BitmapData(100, 50, true, 4278190080);
_bmp = new Bitmap(_bmd);
_text = new TextField();
super();
this.addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
}
public function get fpsStr():String{
return (("FPS: " + _fps.toString()));
}
public function get dt():int{
return ((_ms * 0.001));
}
public function set showText(_arg1:Boolean):void{
if (_arg1){
_text.visible = true;
} else {
_text.visible = false;
};
_textOn = _arg1;
if (!_arg1){
_bmp.y = 0;
} else {
_bmp.y = 50;
};
}
public function minimize():void{
if (maximized){
_text.visible = false;
_bmp.visible = false;
graphics.beginFill(0);
graphics.drawRect(0, 0, 10, 10);
graphics.endFill();
};
}
public function get maximized():Boolean{
return (((_text.visible) || (_bmp.visible)));
}
public function set showGraph(_arg1:Boolean):void{
if (_arg1){
_bmp.visible = true;
} else {
_bmp.visible = false;
};
_graphOn = _arg1;
}
public function get memStr():String{
return ((("MEM: " + (System.totalMemory / 1000000).toFixed(3)) + "MB"));
}
public function set memMax(_arg1:int):void{
_memMax = _arg1;
}
public function get ms():int{
return (_ms);
}
public function get msStr():String{
return (("MS: " + _ms.toString()));
}
public function set version(_arg1:String):void{
_version = _arg1;
}
public function get fpsMax():int{
return (_fpsMax);
}
private function handleClick(_arg1:MouseEvent):void{
if (maximized){
minimize();
} else {
maximize();
};
}
public function update():void{
_curTime = getTimer();
_ms = (_curTime - _lastTime);
_lastTime = _curTime;
_fpsTime = (_curTime - _fpsLastTime);
_fpsCntr++;
if (_fpsTime >= 1000){
_fpsLastTime = _curTime;
_fps = _fpsCntr;
_fpsCntr = 0;
};
if (stage){
if (_text.visible){
_text.text = ((((_version + "\n") + fpsStr) + "\n") + memStr);
};
if (_fps > fpsMax){
_fpsMax = _fps;
};
if (mem > _memMax){
_memMax = mem;
};
if (_bmp.visible){
_bmd.scroll(1, 0);
_bmd.setPixel(1, (Math.abs(((_fps / _fpsMax) - 1)) * _bmp.height), 0xFF00);
_bmd.setPixel(1, (Math.abs(((mem / _memMax) - 1)) * _bmp.height), 0xFF0000);
};
};
}
public function get showText():Boolean{
return (_text.visible);
}
public function maximize():void{
if (!maximized){
graphics.clear();
if (_textOn){
_text.visible = true;
};
if (_graphOn){
_bmp.visible = true;
};
};
}
public function get memMax():int{
return (_memMax);
}
public function get showGraph():Boolean{
return (_bmp.visible);
}
public function get mem():uint{
return (System.totalMemory);
}
public function get version():String{
return (_version);
}
public function get fps():int{
return (_fps);
}
private function handleAddedToStage(_arg1:Event):void{
var _local2:Date;
_bmp.x = 0;
_bmp.y = 50;
_bmp.width = 100;
_bmp.height = 50;
if (_graphOn){
addChild(_bmp);
};
_text.x = 0;
_text.height = 50;
_text.textColor = 0xFF00;
_text.mouseEnabled = false;
_text.backgroundColor = 0;
_text.background = true;
if (_textOn){
addChild(_text);
};
this.addEventListener(MouseEvent.CLICK, handleClick);
this.buttonMode = true;
if (_version == ""){
_local2 = new Date();
_version = _local2.toDateString();
};
}
public function set fpsMax(_arg1:int):void{
_fpsMax = _arg1;
}
public function get elapsed():int{
return (_curTime);
}
}
}//package betz.debug
Section 5
//OnScreenTracer (betz.debug.OnScreenTracer)
package betz.debug {
import flash.display.*;
import flash.text.*;
public class OnScreenTracer extends Sprite {
private var tf:TextField;
protected static var instance:TextField;
private static var onTop:Boolean = true;
public function OnScreenTracer(_arg1:Boolean=false, _arg2:Boolean=true){
tf = new TextField();
super();
addChild(tf);
tf.width = 500;
tf.background = true;
tf.backgroundColor = 0x111111;
tf.textColor = 0xFFFFFF;
tf.mouseEnabled = _arg1;
tf.autoSize = TextFieldAutoSize.NONE;
instance = tf;
this.maxLines = 20;
onTop = _arg2;
}
public function set maxLines(_arg1:uint):void{
tf.height = (20 * _arg1);
}
public static function trace(... _args):void{
if (!instance){
return;
};
if (((instance.parent) && (onTop))){
instance.parent.addChild(instance);
};
var _local2:int;
while (_local2 < _args.length) {
instance.appendText((_args[_local2].toString() + " "));
_local2++;
};
instance.appendText("\n");
instance.scrollV = instance.maxScrollV;
}
public static function exists():Boolean{
return (Boolean(instance));
}
public static function clear():void{
if (!instance){
return;
};
instance.text = "";
}
}
}//package betz.debug
Section 6
//FSM (betz.fsm.FSM)
package betz.fsm {
import flash.utils.*;
import betz.debug.*;
public class FSM {
private var _states:Dictionary;
private var _curState:String;// = ""
private var db:DebugOutput;
public function FSM(){
db = new DebugOutput(this);
_states = new Dictionary();
super();
}
public function addStateObj(_arg1:String, _arg2:Object):FSMState{
if (_states[_arg1]){
db.outEx(DebugOutputType.ERROR, "State id must be unique");
return (null);
};
_states[_arg1] = new FSMState(_arg1, _arg2);
return (_states[_arg1]);
}
public function changeState(_arg1:String):FSMState{
if (_curState == _arg1){
return (_states[_curState]);
};
endState(_curState);
if (_states[_arg1]){
_curState = _arg1;
_states[_curState].callOnStart();
return (_states[_curState]);
};
return (null);
}
public function update():void{
if (_states[_curState]){
_states[_curState].callOnUpdate();
};
}
public function get curStateId():String{
return (_curState);
}
public function getStatebyId(_arg1:String):FSMState{
return (_states[_arg1]);
}
public function startState(_arg1:String):void{
changeState(_arg1);
}
public function get curState():String{
return (_states[_curState]);
}
public function endState(_arg1:String):void{
if (((_states[_arg1]) && ((_curState == _arg1)))){
_states[_arg1].callOnComplete();
};
_curState = "";
}
public function addState(_arg1:FSMState):String{
if (_states[_arg1.id]){
db.outEx(DebugOutputType.ERROR, "State id must be unique");
return (null);
};
_states[_arg1.id] = _arg1;
return (_arg1.id);
}
}
}//package betz.fsm
Section 7
//FSMState (betz.fsm.FSMState)
package betz.fsm {
public class FSMState {
public var onStart:Function;
public var onUpdate:Function;
public var onStartParams:Array;
public var onUpdateParams:Array;
public var onComplete:Function;
public var id:String;// = ""
public var onCompleteParams:Array;
public function FSMState(_arg1:String, _arg2:Object){
id = _arg1;
if (_arg2.onStart != null){
onStart = _arg2.onStart;
};
if (_arg2.onStartParams != null){
onStartParams = _arg2.onStartParams;
};
if (_arg2.onUpdate != null){
onUpdate = _arg2.onUpdate;
};
if (_arg2.onUpdateParams != null){
onUpdateParams = _arg2.onUpdateParams;
};
if (_arg2.onComplete != null){
onComplete = _arg2.onComplete;
};
if (_arg2.onCompleteParams != null){
onCompleteParams = _arg2.onCompleteParams;
};
}
public function callOnStart():void{
if (onStart != null){
onStart.apply(this, onStartParams);
};
}
public function callOnUpdate():void{
if (onUpdate != null){
onUpdate.apply(this, onUpdateParams);
};
}
public function callOnComplete():void{
if (onComplete != null){
onComplete.apply(this, onCompleteParams);
};
}
}
}//package betz.fsm
Section 8
//JBLogo (betz.logo.JBLogo)
package betz.logo {
import flash.events.*;
import flash.display.*;
public class JBLogo extends MovieClip {
private var onCompleteCall:Function;
private var onCompleteParamsCall:Array;
public function JBLogo(){
stop();
buttonMode = true;
}
public function init(_arg1:Function=null, _arg2:Array=null):void{
onCompleteCall = _arg1;
onCompleteParamsCall = _arg2;
}
public function start():void{
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
play();
}
private function handleEnterFrame(_arg1:Event):void{
if (currentFrame == totalFrames){
stop();
removeEventListener(Event.ENTER_FRAME, handleEnterFrame);
if (onCompleteCall != null){
onCompleteCall.apply(this, onCompleteParamsCall);
};
};
}
}
}//package betz.logo
Section 9
//Caller (betz.utils.Caller)
package betz.utils {
import flash.events.*;
import flash.utils.*;
public class Caller {
private static var timer:Timer;
private static var ids:uint = 0;
private static var calls:Dictionary = new Dictionary(true);
public static function removeCalls():void{
var _local1:*;
for (_local1 in calls) {
calls[_local1] = null;
delete calls[_local1];
};
}
public static function removeCall(_arg1):void{
if (calls[_arg1.name]){
calls[_arg1.name] = null;
delete calls[_arg1.name];
};
}
public static function update(_arg1:TimerEvent):void{
var _local3:*;
var _local4:Object;
var _local2:int = getTimer();
for (_local3 in calls) {
_local4 = calls[_local3];
_local4.elapsed = (_local2 - _local4.last);
if (_local4.elapsed >= _local4.maxTime){
_local4.func.apply(_local3, _local4.funcParams);
_local4.last = _local2;
_local4.loops++;
if ((((_local4.loops >= _local4.maxLoops)) && (!((_local4.maxLoops == 0))))){
_local4 = null;
delete calls[_local3];
};
};
};
}
public static function addCall(_arg1, _arg2:uint, _arg3:Function, _arg4:Array=null, _arg5:uint=0):void{
if (!timer){
timer = new Timer(10);
timer.addEventListener(TimerEvent.TIMER, update);
timer.start();
};
var _local6:Object = {maxTime:_arg2, elasped:0, last:getTimer(), func:_arg3, funcParams:_arg4, loops:0, maxLoops:_arg5};
calls[_arg1.name] = _local6;
}
}
}//package betz.utils
Section 10
//FrameTimeUtil (betz.utils.FrameTimeUtil)
package betz.utils {
import flash.utils.*;
public class FrameTimeUtil {
private var _lastTime:uint;// = 0
private var _curTime:uint;// = 0
private var _dt:Number;// = 0
public function get dt():Number{
return (_dt);
}
public function update():void{
_curTime = getTimer();
_dt = ((_curTime - _lastTime) * 0.001);
_lastTime = _curTime;
}
public function get elapsed():uint{
return (_curTime);
}
}
}//package betz.utils
Section 11
//GameInput (betz.utils.GameInput)
package betz.utils {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public class GameInput {
private static var keyCodes:Array = new Array();
private static var keyFocus:DisplayObject;
private static function handleKeyDown(_arg1:KeyboardEvent):void{
keyCodes[_arg1.keyCode] = true;
}
public static function rightKey():Boolean{
return (((keyCodes[Keyboard.RIGHT]) || (keyCodes[68])));
}
public static function upKey():Boolean{
return (((keyCodes[Keyboard.UP]) || (keyCodes[87])));
}
public static function pauseKey():Boolean{
return (((keyCodes[Keyboard.ESCAPE]) || (keyCodes[80])));
}
public static function keyIsDown(_arg1:uint):Boolean{
return (keyCodes[_arg1]);
}
public static function init(_arg1:DisplayObject):void{
destroy();
keyFocus = _arg1;
keyFocus.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
keyFocus.addEventListener(KeyboardEvent.KEY_UP, handleKeyUp);
var _local2:int;
while (_local2 < 0x0100) {
keyCodes[_local2] = false;
_local2++;
};
}
public static function spaceKey():Boolean{
return (keyCodes[Keyboard.SPACE]);
}
public static function toKeyCode(_arg1:String):uint{
var _local2:uint = _arg1.charCodeAt();
if ((((_local2 >= 65)) && ((_local2 <= 90)))){
return (_local2);
};
if ((((_local2 >= 48)) && ((_local2 <= 57)))){
return (_local2);
};
if ((((_local2 >= 97)) && ((_local2 <= 122)))){
return ((_local2 - 32));
};
return (0);
}
public static function leftKey():Boolean{
return (((keyCodes[Keyboard.LEFT]) || (keyCodes[65])));
}
private static function handleKeyUp(_arg1:KeyboardEvent):void{
keyCodes[_arg1.keyCode] = false;
}
public static function destroy():void{
if (keyFocus){
keyFocus.removeEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
keyFocus.removeEventListener(KeyboardEvent.KEY_UP, handleKeyUp);
};
while (keyCodes.length > 0) {
keyCodes.pop();
};
}
public static function downKey():Boolean{
return (((keyCodes[Keyboard.DOWN]) || (keyCodes[83])));
}
}
}//package betz.utils
Section 12
//SoundEngine (betz.utils.SoundEngine)
package betz.utils {
import flash.events.*;
import caurina.transitions.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
public class SoundEngine extends EventDispatcher {
private static var timer:Timer = new Timer(50);
private static var plays:Object = new Object();
private static var effect:SoundChannel;
private static var loader:Loader;
private static var music:SoundChannel;
private static var isOff:Boolean = false;
private static var ticks:uint = 0;
public function SoundEngine(){
timer.addEventListener(TimerEvent.TIMER, updateTicks);
timer.start();
}
private function loaderFailed(_arg1:IOErrorEvent):void{
dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR));
}
public function loadBytes(_arg1):void{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loaderProgress, false, 0, true);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderFailed, false, 0, true);
loader.loadBytes(_arg1);
}
public function load(_arg1:String):void{
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loaderProgress, false, 0, true);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderFailed, false, 0, true);
loader.load(new URLRequest(_arg1));
}
private function loaderProgress(_arg1:ProgressEvent):void{
dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS));
}
public function destroy():void{
effect.stop();
music.stop();
loader = null;
music = null;
effect = null;
}
private function loadedHandler(_arg1:Event):void{
dispatchEvent(new Event(Event.COMPLETE));
}
private static function getClass(_arg1:String):Class{
if (loader == null){
trace("[ SoundEngine ] >> ERROR -> Engine swf not loaded");
return (null);
};
var _local2:Class = (loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1) as Class);
if (_local2 == null){
trace((("[ SoundEngine ] >> ERROR -> '" + _arg1) + "' not found in Engine swf"));
return (null);
};
return (_local2);
}
public static function musicFadeOut(_arg1:Number, _arg2:Number=0):void{
if (isOff){
return;
};
Tweener.addTween(music, {_sound_volume:0, delay:_arg2, time:_arg1, transition:"linear"});
}
public static function loopFadeTo(_arg1:String, _arg2:Number, _arg3:Number=0, _arg4:Number=1, _arg5:Number=0):void{
if (isOff){
return;
};
var _local6:Class = getClass(_arg1);
if ((((_local6 == null)) || ((plays[_arg1] == ticks)))){
return;
};
plays[_arg1] = ticks;
var _local7:Sound = new (_local6);
music = _local7.play(0, int.MAX_VALUE, new SoundTransform(_arg3));
Tweener.addTween(music, {_sound_volume:_arg4, delay:_arg5, time:_arg2, transition:"linear"});
}
public static function loop(_arg1:String, _arg2:Number=1):void{
if (isOff){
return;
};
var _local3:Class = getClass(_arg1);
if ((((_local3 == null)) || ((plays[_arg1] == ticks)))){
return;
};
plays[_arg1] = ticks;
var _local4:Sound = new (_local3);
effect = _local4.play(0, int.MAX_VALUE, new SoundTransform(_arg2));
}
public static function shutOff():void{
if (isOff){
return;
};
isOff = true;
stopAll();
}
public static function playFadeTo(_arg1:String, _arg2:Number, _arg3:Number=0, _arg4:Number=1, _arg5:Number=0):void{
if (isOff){
return;
};
var _local6:Class = getClass(_arg1);
if ((((_local6 == null)) || ((plays[_arg1] == ticks)))){
return;
};
plays[_arg1] = ticks;
var _local7:Sound = new (_local6);
music = _local7.play(0, 1, new SoundTransform(_arg3));
Tweener.addTween(music, {_sound_volume:_arg4, delay:_arg5, time:_arg2, transition:"linear"});
}
private static function updateTicks(_arg1:TimerEvent):void{
ticks++;
}
public static function isOn():Boolean{
return (!(isOff));
}
public static function play(_arg1:String, _arg2:Number=1):void{
if (isOff){
return;
};
var _local3:Class = getClass(_arg1);
if ((((_local3 == null)) || ((plays[_arg1] == ticks)))){
return;
};
plays[_arg1] = ticks;
var _local4:Sound = new (_local3);
effect = _local4.play(0, 0, new SoundTransform(_arg2));
}
public static function turnOn():void{
if (!isOff){
return;
};
isOff = false;
}
public static function stopAll():void{
SoundMixer.stopAll();
}
}
}//package betz.utils
Section 13
//SWFResources (betz.utils.SWFResources)
package betz.utils {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class SWFResources extends EventDispatcher {
protected static var loader:Loader;
private function progressHandler(_arg1:ProgressEvent):void{
dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, _arg1.bytesLoaded, _arg1.bytesTotal));
}
public function loadBytes(_arg1):void{
if (loader){
dispatchEvent(new Event(Event.COMPLETE));
return;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.loadBytes(_arg1);
}
public function load(_arg1:String):void{
if (loader){
dispatchEvent(new Event(Event.COMPLETE));
return;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.load(new URLRequest(_arg1));
}
private function loadedHandler(_arg1:Event):void{
dispatchEvent(new Event(Event.COMPLETE));
}
public static function get(_arg1:String, ... _args){
if ((((loader == null)) || ((_arg1 == "")))){
return (null);
};
var _local3:Class = (loader.contentLoaderInfo.applicationDomain.getDefinition(_arg1) as Class);
if (_local3 == null){
return (null);
};
switch (_args.length){
case 0:
return (new (_local3));
case 1:
return (new _local3(_args[0]));
case 2:
return (new _local3(_args[0], _args[1]));
};
}
}
}//package betz.utils
Section 14
//ColorShortcuts (caurina.transitions.properties.ColorShortcuts)
package caurina.transitions.properties {
import caurina.transitions.*;
import flash.geom.*;
import flash.filters.*;
public class ColorShortcuts {
private static var LUMINANCE_B:Number = 0.072169;
private static var LUMINANCE_G:Number = 0.71516;
private static var LUMINANCE_R:Number = 0.212671;
public function ColorShortcuts(){
trace("This is an static class and should not be instantiated.");
}
public static function _color_splitter(_arg1, _arg2:Array):Array{
var _local3:Array = new Array();
if (_arg1 == null){
_local3.push({name:"_color_redMultiplier", value:1});
_local3.push({name:"_color_redOffset", value:0});
_local3.push({name:"_color_greenMultiplier", value:1});
_local3.push({name:"_color_greenOffset", value:0});
_local3.push({name:"_color_blueMultiplier", value:1});
_local3.push({name:"_color_blueOffset", value:0});
} else {
_local3.push({name:"_color_redMultiplier", value:0});
_local3.push({name:"_color_redOffset", value:AuxFunctions.numberToR(_arg1)});
_local3.push({name:"_color_greenMultiplier", value:0});
_local3.push({name:"_color_greenOffset", value:AuxFunctions.numberToG(_arg1)});
_local3.push({name:"_color_blueMultiplier", value:0});
_local3.push({name:"_color_blueOffset", value:AuxFunctions.numberToB(_arg1)});
};
return (_local3);
}
public static function _contrast_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:Number;
var _local6:Number;
_local5 = (_arg2 + 1);
_local6 = Math.round((_arg2 * -128));
var _local7:ColorTransform = new ColorTransform(_local5, _local5, _local5, 1, _local6, _local6, _local6, 0);
_arg1.transform.colorTransform = _local7;
}
public static function _brightness_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
var _local4:Boolean = _arg2[0];
var _local5:ColorTransform = _arg1.transform.colorTransform;
var _local6:Number = (1 - (((_local5.redMultiplier + _local5.greenMultiplier) + _local5.blueMultiplier) / 3));
var _local7:Number = (((_local5.redOffset + _local5.greenOffset) + _local5.blueOffset) / 3);
if (_local4){
return (((_local7 > 0)) ? (_local7 / 0xFF) : -(_local6));
//unresolved jump
};
return ((_local7 / 100));
}
public static function _saturation_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
var _local4:Array = getObjectMatrix(_arg1);
var _local5:Boolean = _arg2[0];
var _local6:Number = (_local5) ? (1 / 3) : LUMINANCE_R;
var _local7:Number = (_local5) ? (1 / 3) : LUMINANCE_G;
var _local8:Number = (_local5) ? (1 / 3) : LUMINANCE_B;
var _local9:Number = (((((_local4[0] - _local6) / (1 - _local6)) + ((_local4[6] - _local7) / (1 - _local7))) + ((_local4[12] - _local8) / (1 - _local8))) / 3);
var _local10:Number = (1 - (((((((_local4[1] / _local7) + (_local4[2] / _local8)) + (_local4[5] / _local6)) + (_local4[7] / _local8)) + (_local4[10] / _local6)) + (_local4[11] / _local7)) / 6));
return (((_local9 + _local10) / 2));
}
public static function _oldColor_property_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return ((_arg1.transform.colorTransform[_arg2[0]] * 100));
}
public static function _brightness_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local6:Number;
var _local7:Number;
var _local5:Boolean = _arg3[0];
if (_local5){
_local6 = (1 - Math.abs(_arg2));
_local7 = ((_arg2 > 0)) ? Math.round((_arg2 * 0xFF)) : 0;
} else {
_local6 = 1;
_local7 = Math.round((_arg2 * 100));
};
var _local8:ColorTransform = new ColorTransform(_local6, _local6, _local6, 1, _local7, _local7, _local7, 0);
_arg1.transform.colorTransform = _local8;
}
public static function _saturation_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:Boolean = _arg3[0];
var _local6:Number = (_local5) ? (1 / 3) : LUMINANCE_R;
var _local7:Number = (_local5) ? (1 / 3) : LUMINANCE_G;
var _local8:Number = (_local5) ? (1 / 3) : LUMINANCE_B;
var _local9:Number = _arg2;
var _local10:Number = (1 - _local9);
var _local11:Number = (_local6 * _local10);
var _local12:Number = (_local7 * _local10);
var _local13:Number = (_local8 * _local10);
var _local14:Array = [(_local11 + _local9), _local12, _local13, 0, 0, _local11, (_local12 + _local9), _local13, 0, 0, _local11, _local12, (_local13 + _local9), 0, 0, 0, 0, 0, 1, 0];
setObjectMatrix(_arg1, _local14);
}
private static function getObjectMatrix(_arg1:Object):Array{
var _local2:Number = 0;
while (_local2 < _arg1.filters.length) {
if ((_arg1.filters[_local2] is ColorMatrixFilter)){
return (_arg1.filters[_local2].matrix.concat());
};
_local2++;
};
return ([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]);
}
public static function getHueDistance(_arg1:Array, _arg2:Array):Number{
return (((Math.abs((_arg1[0] - _arg2[0])) + Math.abs((_arg1[1] - _arg2[1]))) + Math.abs((_arg1[2] - _arg2[2]))));
}
public static function _hue_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
setObjectMatrix(_arg1, getHueMatrix(_arg2));
}
public static function _hue_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
var _local6:Number;
var _local8:Number;
var _local4:Array = getObjectMatrix(_arg1);
var _local5:Array = [];
_local5[0] = {angle:-179.9, matrix:getHueMatrix(-179.9)};
_local5[1] = {angle:180, matrix:getHueMatrix(180)};
_local6 = 0;
while (_local6 < _local5.length) {
_local5[_local6].distance = getHueDistance(_local4, _local5[_local6].matrix);
_local6++;
};
var _local7:Number = 15;
_local6 = 0;
while (_local6 < _local7) {
if (_local5[0].distance < _local5[1].distance){
_local8 = 1;
} else {
_local8 = 0;
};
_local5[_local8].angle = ((_local5[0].angle + _local5[1].angle) / 2);
_local5[_local8].matrix = getHueMatrix(_local5[_local8].angle);
_local5[_local8].distance = getHueDistance(_local4, _local5[_local8].matrix);
_local6++;
};
return (_local5[_local8].angle);
}
public static function getHueMatrix(_arg1:Number):Array{
var _local2:Number = ((_arg1 * Math.PI) / 180);
var _local3:Number = LUMINANCE_R;
var _local4:Number = LUMINANCE_G;
var _local5:Number = LUMINANCE_B;
var _local6:Number = Math.cos(_local2);
var _local7:Number = Math.sin(_local2);
var _local8:Array = [((_local3 + (_local6 * (1 - _local3))) + (_local7 * -(_local3))), ((_local4 + (_local6 * -(_local4))) + (_local7 * -(_local4))), ((_local5 + (_local6 * -(_local5))) + (_local7 * (1 - _local5))), 0, 0, ((_local3 + (_local6 * -(_local3))) + (_local7 * 0.143)), ((_local4 + (_local6 * (1 - _local4))) + (_local7 * 0.14)), ((_local5 + (_local6 * -(_local5))) + (_local7 * -0.283)), 0, 0, ((_local3 + (_local6 * -(_local3))) + (_local7 * -((1 - _local3)))), ((_local4 + (_local6 * -(_local4))) + (_local7 * _local4)), ((_local5 + (_local6 * (1 - _local5))) + (_local7 * _local5)), 0, 0, 0, 0, 0, 1, 0];
return (_local8);
}
public static function _color_property_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.transform.colorTransform[_arg2[0]]);
}
public static function init():void{
Tweener.registerSpecialProperty("_color_ra", _oldColor_property_get, _oldColor_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_ga", _oldColor_property_get, _oldColor_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_ba", _oldColor_property_get, _oldColor_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_aa", _oldColor_property_get, _oldColor_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialProperty("_color_redMultiplier", _color_property_get, _color_property_set, ["redMultiplier"]);
Tweener.registerSpecialProperty("_color_redOffset", _color_property_get, _color_property_set, ["redOffset"]);
Tweener.registerSpecialProperty("_color_greenMultiplier", _color_property_get, _color_property_set, ["greenMultiplier"]);
Tweener.registerSpecialProperty("_color_greenOffset", _color_property_get, _color_property_set, ["greenOffset"]);
Tweener.registerSpecialProperty("_color_blueMultiplier", _color_property_get, _color_property_set, ["blueMultiplier"]);
Tweener.registerSpecialProperty("_color_blueOffset", _color_property_get, _color_property_set, ["blueOffset"]);
Tweener.registerSpecialProperty("_color_alphaMultiplier", _color_property_get, _color_property_set, ["alphaMultiplier"]);
Tweener.registerSpecialProperty("_color_alphaOffset", _color_property_get, _color_property_set, ["alphaOffset"]);
Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
Tweener.registerSpecialProperty("_brightness", _brightness_get, _brightness_set, [false]);
Tweener.registerSpecialProperty("_tintBrightness", _brightness_get, _brightness_set, [true]);
Tweener.registerSpecialProperty("_contrast", _contrast_get, _contrast_set);
Tweener.registerSpecialProperty("_hue", _hue_get, _hue_set);
Tweener.registerSpecialProperty("_saturation", _saturation_get, _saturation_set, [false]);
Tweener.registerSpecialProperty("_dumbSaturation", _saturation_get, _saturation_set, [true]);
}
private static function setObjectMatrix(_arg1:Object, _arg2:Array):void{
var _local6:ColorMatrixFilter;
var _local3:Array = _arg1.filters.concat();
var _local4:Boolean;
var _local5:Number = 0;
while (_local5 < _local3.length) {
if ((_local3[_local5] is ColorMatrixFilter)){
_local3[_local5].matrix = _arg2.concat();
_local4 = true;
};
_local5++;
};
if (!_local4){
_local6 = new ColorMatrixFilter(_arg2);
_local3[_local3.length] = _local6;
};
_arg1.filters = _local3;
}
public static function _color_property_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:ColorTransform = _arg1.transform.colorTransform;
_local5[_arg3[0]] = _arg2;
_arg1.transform.colorTransform = _local5;
}
public static function _oldColor_property_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:ColorTransform = _arg1.transform.colorTransform;
_local5[_arg3[0]] = (_arg2 / 100);
_arg1.transform.colorTransform = _local5;
}
public static function _contrast_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
var _local5:Number;
var _local6:Number;
var _local4:ColorTransform = _arg1.transform.colorTransform;
_local5 = ((((_local4.redMultiplier + _local4.greenMultiplier) + _local4.blueMultiplier) / 3) - 1);
_local6 = ((((_local4.redOffset + _local4.greenOffset) + _local4.blueOffset) / 3) / -128);
return (((_local5 + _local6) / 2));
}
public static function _colorTransform_splitter(_arg1:Object, _arg2:Array):Array{
var _local3:Array = new Array();
if (_arg1 == null){
_local3.push({name:"_color_redMultiplier", value:1});
_local3.push({name:"_color_redOffset", value:0});
_local3.push({name:"_color_greenMultiplier", value:1});
_local3.push({name:"_color_greenOffset", value:0});
_local3.push({name:"_color_blueMultiplier", value:1});
_local3.push({name:"_color_blueOffset", value:0});
} else {
if (_arg1.ra != undefined){
_local3.push({name:"_color_ra", value:_arg1.ra});
};
if (_arg1.rb != undefined){
_local3.push({name:"_color_rb", value:_arg1.rb});
};
if (_arg1.ga != undefined){
_local3.push({name:"_color_ba", value:_arg1.ba});
};
if (_arg1.gb != undefined){
_local3.push({name:"_color_bb", value:_arg1.bb});
};
if (_arg1.ba != undefined){
_local3.push({name:"_color_ga", value:_arg1.ga});
};
if (_arg1.bb != undefined){
_local3.push({name:"_color_gb", value:_arg1.gb});
};
if (_arg1.aa != undefined){
_local3.push({name:"_color_aa", value:_arg1.aa});
};
if (_arg1.ab != undefined){
_local3.push({name:"_color_ab", value:_arg1.ab});
};
if (_arg1.redMultiplier != undefined){
_local3.push({name:"_color_redMultiplier", value:_arg1.redMultiplier});
};
if (_arg1.redOffset != undefined){
_local3.push({name:"_color_redOffset", value:_arg1.redOffset});
};
if (_arg1.blueMultiplier != undefined){
_local3.push({name:"_color_blueMultiplier", value:_arg1.blueMultiplier});
};
if (_arg1.blueOffset != undefined){
_local3.push({name:"_color_blueOffset", value:_arg1.blueOffset});
};
if (_arg1.greenMultiplier != undefined){
_local3.push({name:"_color_greenMultiplier", value:_arg1.greenMultiplier});
};
if (_arg1.greenOffset != undefined){
_local3.push({name:"_color_greenOffset", value:_arg1.greenOffset});
};
if (_arg1.alphaMultiplier != undefined){
_local3.push({name:"_color_alphaMultiplier", value:_arg1.alphaMultiplier});
};
if (_arg1.alphaOffset != undefined){
_local3.push({name:"_color_alphaOffset", value:_arg1.alphaOffset});
};
};
return (_local3);
}
}
}//package caurina.transitions.properties
Section 15
//DisplayShortcuts (caurina.transitions.properties.DisplayShortcuts)
package caurina.transitions.properties {
import caurina.transitions.*;
import flash.geom.*;
public class DisplayShortcuts {
public function DisplayShortcuts(){
trace("This is an static class and should not be instantiated.");
}
public static function init():void{
Tweener.registerSpecialProperty("_frame", _frame_get, _frame_set);
Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
Tweener.registerSpecialPropertySplitter("_scrollRect", _scrollRect_splitter);
Tweener.registerSpecialProperty("_scrollRect_x", _scrollRect_property_get, _scrollRect_property_set, ["x"]);
Tweener.registerSpecialProperty("_scrollRect_y", _scrollRect_property_get, _scrollRect_property_set, ["y"]);
Tweener.registerSpecialProperty("_scrollRect_left", _scrollRect_property_get, _scrollRect_property_set, ["left"]);
Tweener.registerSpecialProperty("_scrollRect_right", _scrollRect_property_get, _scrollRect_property_set, ["right"]);
Tweener.registerSpecialProperty("_scrollRect_top", _scrollRect_property_get, _scrollRect_property_set, ["top"]);
Tweener.registerSpecialProperty("_scrollRect_bottom", _scrollRect_property_get, _scrollRect_property_set, ["bottom"]);
Tweener.registerSpecialProperty("_scrollRect_width", _scrollRect_property_get, _scrollRect_property_set, ["width"]);
Tweener.registerSpecialProperty("_scrollRect_height", _scrollRect_property_get, _scrollRect_property_set, ["height"]);
}
public static function _frame_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
_arg1.gotoAndStop(Math.round(_arg2));
}
public static function _autoAlpha_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
_arg1.alpha = _arg2;
_arg1.visible = (_arg2 > 0);
}
public static function _frame_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.currentFrame);
}
public static function _scrollRect_splitter(_arg1:Rectangle, _arg2:Array, _arg3:Object=null):Array{
var _local4:Array = new Array();
if (_arg1 == null){
_local4.push({name:"_scrollRect_x", value:0});
_local4.push({name:"_scrollRect_y", value:0});
_local4.push({name:"_scrollRect_width", value:100});
_local4.push({name:"_scrollRect_height", value:100});
} else {
_local4.push({name:"_scrollRect_x", value:_arg1.x});
_local4.push({name:"_scrollRect_y", value:_arg1.y});
_local4.push({name:"_scrollRect_width", value:_arg1.width});
_local4.push({name:"_scrollRect_height", value:_arg1.height});
};
return (_local4);
}
public static function _autoAlpha_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.alpha);
}
public static function _scrollRect_property_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.scrollRect[_arg2[0]]);
}
public static function _scale_splitter(_arg1:Number, _arg2:Array):Array{
var _local3:Array = new Array();
_local3.push({name:"scaleX", value:_arg1});
_local3.push({name:"scaleY", value:_arg1});
return (_local3);
}
public static function _scrollRect_property_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:Rectangle = _arg1.scrollRect;
_local5[_arg3[0]] = Math.round(_arg2);
_arg1.scrollRect = _local5;
}
}
}//package caurina.transitions.properties
Section 16
//SoundShortcuts (caurina.transitions.properties.SoundShortcuts)
package caurina.transitions.properties {
import caurina.transitions.*;
import flash.media.*;
public class SoundShortcuts {
public function SoundShortcuts(){
trace("This is an static class and should not be instantiated.");
}
public static function init():void{
Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
}
public static function _sound_pan_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:SoundTransform = _arg1.soundTransform;
_local5.pan = _arg2;
_arg1.soundTransform = _local5;
}
public static function _sound_volume_set(_arg1:Object, _arg2:Number, _arg3:Array, _arg4:Object=null):void{
var _local5:SoundTransform = _arg1.soundTransform;
_local5.volume = _arg2;
_arg1.soundTransform = _local5;
}
public static function _sound_pan_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.soundTransform.pan);
}
public static function _sound_volume_get(_arg1:Object, _arg2:Array, _arg3:Object=null):Number{
return (_arg1.soundTransform.volume);
}
}
}//package caurina.transitions.properties
Section 17
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function concatObjects(... _args):Object{
var _local3:Object;
var _local5:String;
var _local2:Object = {};
var _local4:int;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint = _arg2.length;
var _local4:uint;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package caurina.transitions
Section 18
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 19
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 20
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 21
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 22
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 23
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!_inited){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
if (!_inited){
init();
};
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
var _local5:Object = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time;
var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local5:uint;
var _local6:String;
var _local7:Boolean;
var _local3:TweenListObj = _tweenList[_arg1];
var _local4:TweenListObj = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
var _local3:Number = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.71");
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
var _local7:Object = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local8:Number = (isNaN(_local7.time)) ? 0 : _local7.time;
var _local9:Number = (isNaN(_local7.delay)) ? 0 : _local7.delay;
var _local10:Array = new Array();
var _local11:Object = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
var _local12:Object = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local4:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
if (!Boolean(_tweenList)){
return ([]);
};
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
if (!Boolean(_tweenList)){
return (0);
};
var _local3:Number = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
if (!_inited){
init();
};
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 24
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local3:String;
var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local3:String;
var _local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
var _local2:Boolean;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local2:Object = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 25
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 26
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 27
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 28
//Block (Block)
package {
import caurina.transitions.*;
import flash.geom.*;
import flash.display.*;
public class Block extends IsoWorldSquare {
private var connections:Array;
private var mc:MovieClip;
private var _type:uint;// = 0
private var connectionsSpt:Sprite;
public static const START:uint = 1;
public static const ENEMY_UD:uint = 16;
public static const GATE_RIGHT:uint = 12;
public static const END:uint = 2;
public static const COLUMN_TOP:uint = 9;
public static const OBSTACLE:uint = 4;
public static const PUSHBLOCK:uint = 5;
public static const ENEMY_LR:uint = 15;
public static const SHIFT_GATE:uint = 14;
public static const GATE_LEFT:uint = 13;
public static const BLOCK:uint = 3;
public static const BUTTON:uint = 6;
public static const PLATFORM:uint = 10;
public static const SWITCH:uint = 7;
public static const COLUMN_BOTTOM:uint = 8;
public static const NOTHING:uint = 0;
public static const FIRE:uint = 11;
public function Block(_arg1:MovieClip, _arg2:uint=0){
connections = new Array();
super();
mc = _arg1;
addChild(mc);
mc.x = 0;
mc.y = 0;
_type = _arg2;
mc.stop();
if (((((((((((!((_type == FIRE))) && (!((_type == START))))) && (!((_type == END))))) && (!((_type == GATE_RIGHT))))) && (!((_type == GATE_LEFT))))) && (!((_type == SHIFT_GATE))))){
this.cacheAsBitmap = true;
};
}
public function destroy():void{
if (mc){
if (contains(mc)){
removeChild(mc);
};
mc = null;
};
_type = 0;
this.clearData();
}
public function isThemed():Boolean{
return ((((((((((((_type == BLOCK)) || ((_type == OBSTACLE)))) || ((_type == PUSHBLOCK)))) || ((_type == COLUMN_TOP)))) || ((_type == COLUMN_BOTTOM)))) || ((_type == PLATFORM))));
}
public function setTheme(_arg1:uint):void{
if (((mc) && (isThemed()))){
mc.gotoAndStop(_arg1);
};
}
protected function endMove(_arg1:uint, _arg2:uint, _arg3:int=-1):void{
this.setPos(_arg1, _arg2, ((_arg3 == -1)) ? this.depth : _arg3);
}
public function connectionsFromString(_arg1:String):void{
var _local2:Array = _arg1.split(",");
var _local3:int;
while (_local3 < _local2.length) {
addConnection(_local2[_local3], _local2[(_local3 + 1)], _local2[(_local3 + 2)]);
_local3 = (_local3 + 3);
};
}
public function move(_arg1:String):void{
var _local2:Point = new Point(this.col, this.row);
if (_arg1 == "u"){
_local2.x--;
};
if (_arg1 == "d"){
_local2.x++;
};
if (_arg1 == "l"){
_local2.y++;
};
if (_arg1 == "r"){
_local2.y--;
};
moveTo(_local2.y, _local2.x, this.depth);
}
public function getTheme():uint{
if (((mc) && (isThemed()))){
return (mc.currentFrame);
};
return (0);
}
public function isInteractive():Boolean{
return ((((((((((((_type == SWITCH)) || ((_type == BUTTON)))) || ((_type == GATE_RIGHT)))) || ((_type == GATE_LEFT)))) || ((_type == FIRE)))) || ((_type == SHIFT_GATE))));
}
public function interactWith(_arg1:Boolean):void{
if (((mc) && (isInteractive()))){
mc.gotoAndStop((_arg1) ? 2 : 1);
};
}
public function getConnections():Array{
return (connections);
}
public function renderConnections():void{
var _local2:Point;
if (!isInteractive()){
return;
};
if (!connectionsSpt){
connectionsSpt = new Sprite();
};
addChild(connectionsSpt);
connectionsSpt.graphics.clear();
connectionsSpt.graphics.lineStyle(2, 0xFFFFFF, 1);
var _local1:int;
while (_local1 < connections.length) {
connectionsSpt.graphics.moveTo(23, 0);
_local2 = IsoWorld.gridToXY(connections[_local1].r, connections[_local1].c, connections[_local1].d);
connectionsSpt.graphics.lineTo(((_local2.x - this.x) + 23), (_local2.y - this.y));
_local1++;
};
connectionsSpt.mouseChildren = false;
connectionsSpt.mouseEnabled = false;
}
public function isOn():Boolean{
if (((mc) && (isInteractive()))){
return ((mc.currentFrame == 2));
};
return (false);
}
override public function toString():String{
var _local2:int;
var _local1:String = ((((_row + ",") + _col) + ",") + _depth);
if (connections.length > 0){
_local1 = (_local1 + ">");
_local2 = 0;
while (_local2 < connections.length) {
_local1 = (_local1 + (((((connections[_local2].r + ",") + connections[_local2].c) + ",") + connections[_local2].d) + ((_local2 < (connections.length - 1))) ? "," : ""));
_local2++;
};
};
return (_local1);
}
public function addConnection(_arg1:uint, _arg2:uint, _arg3:uint):void{
if (!isInteractive()){
return;
};
var _local4:Object = {r:_arg1, c:_arg2, d:_arg3};
var _local5 = -1;
var _local6:int;
while (_local6 < connections.length) {
if ((((((_local4.r == connections[_local6].r)) && ((_local4.c == connections[_local6].c)))) && ((_local4.d == connections[_local6].d)))){
_local5 = _local6;
};
_local6++;
};
if (_local5 == -1){
connections.push(_local4);
} else {
connections.splice(_local5, 1);
};
}
public function moveTo(_arg1:uint, _arg2:Number, _arg3:int=-1):void{
if (Tweener.isTweening(this)){
return;
};
var _local4:Point = IsoWorld.gridToXY(_arg1, _arg2, ((_arg3 == -1)) ? this.depth : _arg3);
Tweener.addTween(this, {x:_local4.x, y:_local4.y, time:0.33, transition:"linear", onComplete:endMove, onCompleteParams:[_arg1, _arg2, _arg3]});
}
public function get type():uint{
return (_type);
}
public static function getClassFromType(_arg1:uint):String{
switch (_arg1){
case Block.NOTHING:
return ("HighlightMC");
case Block.BLOCK:
return ("BlockMC");
case Block.OBSTACLE:
return ("ObstacleMC");
case Block.START:
return ("StartBlockMC");
case Block.END:
return ("EndBlockMC");
case Block.BUTTON:
return ("ButtonMC");
case Block.SWITCH:
return ("SwitchMC");
case Block.COLUMN_TOP:
return ("ColumnTopMC");
case Block.COLUMN_BOTTOM:
return ("ColumnBottomMC");
case Block.PLATFORM:
return ("PlatformMC");
case Block.FIRE:
return ("FireMC");
case Block.PUSHBLOCK:
return ("PushBlockMC");
case Block.GATE_RIGHT:
return ("GateRightMC");
case Block.GATE_LEFT:
return ("GateLeftMC");
case Block.SHIFT_GATE:
return ("ShiftGateMC");
};
return ("");
}
}
}//package
Section 29
//Character (Character)
package {
import caurina.transitions.*;
import flash.geom.*;
import flash.display.*;
import betz.debug.*;
public class Character extends IsoWorldSquare {
protected var level:Level;
protected var moveTime:Number;// = 0.33
protected var endMoveCall:Function;
protected var mc:MovieClip;
private var newPos:Object;
private var oldPos:Object;
protected var _isMoving:Boolean;// = false
private var db:DebugOutput;
public function Character(_arg1:MovieClip){
db = new DebugOutput(this);
oldPos = new Object();
newPos = new Object();
super();
mc = _arg1;
addChild(mc);
mc.stop();
}
protected function stopMove():void{
Tweener.removeTweens(this);
_isMoving = false;
this.setPos(newPos.row, newPos.col, newPos.depth);
if (endMoveCall != null){
endMoveCall(newPos.row, newPos.col, newPos.depth, oldPos.row, oldPos.col, oldPos.depth);
};
}
public function update(_arg1:Level):void{
level = _arg1;
}
protected function endMove():void{
_isMoving = false;
mc.gotoAndStop((mc.currentFrame - 4));
this.setPos(newPos.row, newPos.col, newPos.depth);
if (endMoveCall != null){
endMoveCall(newPos.row, newPos.col, newPos.depth, oldPos.row, oldPos.col, oldPos.depth);
};
}
public function move(_arg1:String):void{
if (_arg1 == ""){
return;
};
var _local2:Point = new Point(this.col, this.row);
if (_arg1 == "u"){
_local2.x--;
};
if (_arg1 == "d"){
_local2.x++;
};
if (_arg1 == "l"){
_local2.y++;
};
if (_arg1 == "r"){
_local2.y--;
};
moveTo(_local2.y, _local2.x, this.depth, _arg1);
}
public function addCallBackFunctions(_arg1:Function):void{
endMoveCall = _arg1;
}
public function isMoving():Boolean{
return (_isMoving);
}
public function getFacingBlock():Point{
var _local1:Point = new Point(this.col, this.row);
var _local2:int = this.direction;
if (_local2 == 0){
_local1.x--;
};
if (_local2 == 1){
_local1.x++;
};
if (_local2 == 2){
_local1.y++;
};
if (_local2 == 3){
_local1.y--;
};
return (_local1);
}
public function faceDir(_arg1:String, _arg2:Boolean=true):void{
var _local3:uint;
if (_arg1 == "u"){
_local3 = 8;
};
if (_arg1 == "d"){
_local3 = 5;
};
if (_arg1 == "r"){
_local3 = 7;
};
if (_arg1 == "l"){
_local3 = 6;
};
if (_local3 != 0){
mc.gotoAndStop((_arg2) ? _local3 : (_local3 - 4));
};
}
public function get directionStr():String{
var _local1:int = this.direction;
var _local2 = "";
if (_local1 == 0){
_local2 = "u";
};
if (_local1 == 1){
_local2 = "d";
};
if (_local1 == 2){
_local2 = "l";
};
if (_local1 == 3){
_local2 = "r";
};
return (_local2);
}
public function destroy():void{
Tweener.removeTweens(this);
if (mc){
if (contains(mc)){
removeChild(mc);
};
mc = null;
};
endMoveCall = null;
}
public function moveTo(_arg1:uint, _arg2:uint, _arg3:int=-1, _arg4:String=""):void{
if (_isMoving){
return;
};
var _local5:int = ((_arg3 == -1)) ? this.depth : _arg3;
var _local6:Point = IsoWorld.gridToXY(_arg1, _arg2, _local5);
Tweener.addTween(this, {x:_local6.x, y:_local6.y, time:moveTime, transition:"linear", onComplete:endMove});
if (_arg4 != ""){
faceDir(_arg4);
};
oldPos = {row:this.row, col:this.col, depth:this.depth};
newPos = {row:_arg1, col:_arg2, depth:_arg3};
_isMoving = true;
}
public function get direction():int{
if (mc){
return ((mc.currentFrame % 4));
};
return (-1);
}
}
}//package
Section 30
//Enemy (Enemy)
package {
import flash.events.*;
import flash.display.*;
import betz.utils.*;
public class Enemy extends Character {
private var _theme:uint;// = 0
private var rotateCount:uint;// = 0
public function Enemy(_arg1:MovieClip){
super(_arg1);
}
public function endAI(_arg1:uint, _arg2:uint, _arg3:int, _arg4:uint, _arg5:uint, _arg6:uint):void{
var _local7:Block = level.getBlockAt(_arg3, _arg1, _arg2);
var _local8:Block = level.getBlockAt((_arg3 + 1), _arg1, _arg2);
var _local9:Block = level.getBlockAt((_arg6 + 1), _arg4, _arg5);
var _local10:Block = level.getBlockAt(_arg6, _arg4, _arg5);
if (((((((!(_local7)) || (!(_local10)))) || (!(_local9)))) || (!(_local8)))){
return;
};
if (_local8.type == Block.BUTTON){
if (!_local8.isOn()){
level.runConnections(_local8.depth, _local8.row, _local8.col);
};
_local8.interactWith(true);
};
if (_local9.type == Block.BUTTON){
if (_local9.isOn()){
level.runConnections(_local9.depth, _local9.row, _local9.col);
};
_local9.interactWith(false);
};
}
public function playFallingAnim():void{
stopMove();
Caller.removeCall(this);
makeFall();
}
public function setTheme(_arg1:uint):void{
_theme = _arg1;
if (((mc.enemy_mc) && (mc.enemy_mc.layer_mc))){
if (mc.enemy_mc.layer_mc.currentFrame != _theme){
mc.enemy_mc.layer_mc.gotoAndStop(_theme);
};
};
if (((((mc.enemy_mc) && (mc.enemy_mc.layer1_mc))) && (mc.enemy_mc.layer1_mc.layer2_mc))){
if (mc.enemy_mc.layer1_mc.layer2_mc.currentFrame != _theme){
mc.enemy_mc.layer1_mc.layer2_mc.gotoAndStop(_theme);
};
};
}
private function makeFall():void{
var _local1:String = directionStr;
var _local2:uint;
if (_local1 == "u"){
_local2 = 12;
};
if (_local1 == "d"){
_local2 = 9;
};
if (_local1 == "r"){
_local2 = 11;
};
if (_local1 == "l"){
_local2 = 10;
};
if (_local2 != 0){
mc.gotoAndStop(_local2);
};
}
private function handleFrameEnter(_arg1:Event):void{
setTheme(_theme);
}
public function canWalkOver(_arg1:uint, _arg2:uint):Boolean{
var _local3:uint = level.getBlockTypeAt((depth + 1), _arg1, _arg2);
return ((((((((((((_local3 == Block.BLOCK)) || ((_local3 == Block.START)))) || ((_local3 == Block.BUTTON)))) || ((_local3 == Block.COLUMN_BOTTOM)))) || ((_local3 == Block.COLUMN_TOP)))) || ((_local3 == Block.END))));
}
public function init(_arg1:uint, _arg2:String):void{
Caller.removeCall(this);
Caller.addCall(this, 2000, doAI);
addCallBackFunctions(endAI);
moveTime = 0.66;
faceDir(_arg2, false);
rotateCount = 0;
}
public function doAI():void{
var _local11:Object;
var _local1:String = directionStr;
if ((((_local1 == "")) || (isMoving()))){
return;
};
var _local2:int;
var _local3:int;
if (_local1 == "u"){
_local3 = -1;
} else {
if (_local1 == "d"){
_local3 = 1;
} else {
if (_local1 == "r"){
_local2 = -1;
} else {
if (_local1 == "l"){
_local2 = 1;
};
};
};
};
var _local4:Array = level.getCharacters();
var _local5:Block = level.getBlockAt(depth, row, col);
var _local6:Block = level.getBlockAt((depth + 1), row, col);
var _local7:Block = level.getBlockAt((depth + 1), (row + _local2), (col + _local3));
var _local8:Block = level.getBlockAt(depth, (row + _local2), (col + _local3));
if (((((((!(_local5)) || (!(_local6)))) || (!(_local7)))) || (!(_local8)))){
reverseDirection();
return;
};
var _local9:Boolean;
if (canWalkOver(_local7.row, _local7.col)){
if (_local5.type == Block.SHIFT_GATE){
trace("On Shift Gate");
if (_local5.isOn()){
if ((((_local1 == "r")) || ((_local1 == "l")))){
rightTurn();
_local9 = false;
};
} else {
if ((((_local1 == "u")) || ((_local1 == "d")))){
rightTurn();
_local9 = false;
};
};
};
if (_local8.type == Block.SHIFT_GATE){
if (_local8.isOn()){
if ((((_local1 == "r")) || ((_local1 == "l")))){
reverseDirection();
rotateCount++;
_local9 = false;
};
} else {
if ((((_local1 == "u")) || ((_local1 == "d")))){
reverseDirection();
rotateCount++;
_local9 = false;
};
};
} else {
if ((((_local8.type == Block.GATE_LEFT)) || ((_local8.type == Block.GATE_RIGHT)))){
if (!_local8.isOn()){
reverseDirection();
rotateCount++;
_local9 = false;
};
} else {
if (_local8.type == Block.FIRE){
if (!_local8.isOn()){
reverseDirection();
rotateCount++;
_local9 = false;
};
} else {
if (_local8.type != Block.NOTHING){
reverseDirection();
rotateCount++;
_local9 = false;
};
};
};
};
} else {
reverseDirection();
rotateCount++;
_local9 = false;
};
var _local10:int;
while (_local10 < _local4.length) {
if (_local4[_local10] != this){
_local11 = _local4[_local10].getPos();
if ((((((depth == _local11.depth)) && (((row + _local2) == _local11.row)))) && (((col + _local3) == _local11.col)))){
reverseDirection();
rotateCount++;
_local9 = false;
break;
};
};
_local10++;
};
if (_local9){
rotateCount = 0;
move(_local1);
row = _local8.row;
col = _local8.col;
} else {
if (rotateCount >= 2){
rightTurn();
rotateCount = 0;
};
};
}
override public function update(_arg1:Level):void{
super.update(_arg1);
}
public function rightTurn():void{
var _local1:String = directionStr;
if (_local1 == "u"){
_local1 = "r";
} else {
if (_local1 == "d"){
_local1 = "l";
} else {
if (_local1 == "r"){
_local1 = "d";
} else {
if (_local1 == "l"){
_local1 = "u";
};
};
};
};
faceDir(_local1, false);
}
override public function destroy():void{
super.destroy();
}
public function reverseDirection():void{
var _local1:String = directionStr;
if (_local1 == "u"){
_local1 = "d";
} else {
if (_local1 == "d"){
_local1 = "u";
} else {
if (_local1 == "r"){
_local1 = "l";
} else {
if (_local1 == "l"){
_local1 = "r";
};
};
};
};
faceDir(_local1, false);
}
}
}//package
Section 31
//Game (Game)
package {
import flash.events.*;
import caurina.transitions.*;
import flash.geom.*;
import flash.display.*;
import betz.utils.*;
import betz.debug.*;
import caurina.transitions.properties.*;
import flash.ui.*;
public class Game extends Sprite {
private var curLevelNum:int;// = 0
private var isoWorld:IsoWorld;
private var ui:MovieClip;
private var player:Player;
private var playerDepth:int;// = 1
private var curLevel:Level;
private var paused:Boolean;// = true
private var ticks:uint;// = 0
private var db:DebugOutput;
public function Game(){
db = new DebugOutput(this);
isoWorld = new IsoWorld(47, 28);
super();
}
public function init(_arg1:uint=0):void{
curLevelNum = _arg1;
if (player){
player.destroy();
player = null;
};
player = new Player((SWFResources.get("MonkeyMC") as MovieClip));
player.addCallBackFunctions(playerDoneMoving);
player.setPos(5, 5, -20);
GameInput.destroy();
stage.focus = stage;
GameInput.init(stage);
if (ui){
if (contains(ui)){
removeChild(ui);
};
ui = null;
};
ui = (SWFResources.get("GameUIMC") as MovieClip);
ui.back_btn.addEventListener(MouseEvent.CLICK, handleBackClicked, false, 0, true);
ui.reset_btn.addEventListener(MouseEvent.CLICK, handleResetClicked, false, 0, true);
ui.sound_mc.addEventListener(MouseEvent.CLICK, handleSoundClicked, false, 0, true);
ui.sound_mc.buttonMode = true;
ui.sound_mc.gotoAndStop((SoundEngine.isOn()) ? 1 : 2);
addChild(ui);
ui.y = -30;
var _local2:String = LevelsData.names[curLevelNum];
if (_local2.charAt() == "\n"){
_local2 = _local2.substr(1);
};
ui.level_txt.text = _local2;
Tweener.addTween(ui, {y:0, time:0.5, transition:Equations.easeOutBack});
initLevel(LevelsData.data[curLevelNum]);
stage.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
}
public function nextLevel():void{
dispatchEvent(new GameEvent(GameEvent.LEVEL_COMPLETE, {success:true, level:curLevelNum}));
}
public function update(_arg1:uint, _arg2:Number):void{
var _local9:Block;
var _local10:Boolean;
if (((paused) || (!(curLevel)))){
return;
};
curLevel.update();
if (((player.isMoving()) || (!(curLevel.isReady())))){
return;
};
var _local3:int;
var _local4:int;
var _local5 = "";
if (GameInput.upKey()){
_local5 = "u";
_local4 = -1;
} else {
if (GameInput.downKey()){
_local5 = "d";
_local4 = 1;
} else {
if (GameInput.rightKey()){
_local5 = "r";
_local3 = -1;
} else {
if (GameInput.leftKey()){
_local5 = "l";
_local3 = 1;
} else {
return;
};
};
};
};
var _local6:Block = curLevel.getBlockAt(playerDepth, player.row, player.col);
var _local7:Block = curLevel.getBlockAt(playerDepth, (player.row + _local3), (player.col + _local4));
if (((!(_local7)) || (!(_local6)))){
return;
};
var _local8:Boolean;
if (player.isValidMove(_local7.row, _local7.col)){
if (_local7.type == Block.PUSHBLOCK){
_local9 = curLevel.getBlockAt(playerDepth, (_local7.row + _local3), (_local7.col + _local4));
if (((_local9) && (player.canWalkOver((_local7.row + _local3), (_local7.col + _local4))))){
_local10 = false;
if ((((((_local9.type == Block.GATE_RIGHT)) || ((_local9.type == Block.GATE_LEFT)))) || ((_local9.type == Block.FIRE)))){
if (_local9.isOn()){
_local10 = true;
};
} else {
if (_local9.type == Block.SHIFT_GATE){
if (_local9.isOn()){
if ((((_local5 == "u")) || ((_local5 == "d")))){
_local10 = true;
};
} else {
if ((((_local5 == "l")) || ((_local5 == "r")))){
_local10 = true;
};
};
} else {
if (_local9.type == Block.NOTHING){
_local10 = true;
};
};
};
if (curLevel.isCharacter(_local9.depth, _local9.row, _local9.col)){
_local10 = false;
};
if (_local10){
SoundEngine.play("PushBlockSnd");
_local8 = true;
curLevel.swapBlocks(_local7.depth, _local7.row, _local7.col, _local9.depth, _local9.row, _local9.col);
};
};
} else {
if ((((_local7.type == Block.GATE_RIGHT)) || ((_local7.type == Block.GATE_LEFT)))){
if (_local7.isOn()){
_local8 = true;
};
} else {
if (_local7.type == Block.SHIFT_GATE){
if (_local7.isOn()){
if ((((_local5 == "u")) || ((_local5 == "d")))){
_local8 = true;
};
} else {
if ((((_local5 == "l")) || ((_local5 == "r")))){
_local8 = true;
};
};
} else {
if (_local6.type == Block.SHIFT_GATE){
if (_local6.isOn()){
if ((((_local5 == "u")) || ((_local5 == "d")))){
_local8 = true;
};
} else {
if ((((_local5 == "l")) || ((_local5 == "r")))){
_local8 = true;
};
};
} else {
_local8 = true;
};
};
};
};
};
if (curLevel.isCharacter(player.depth, (player.row + _local3), (player.col + _local4))){
_local8 = false;
};
if (_local8){
player.move(_local5);
if ((((_local5 == "l")) || ((_local5 == "d")))){
if (_local7.type != Block.PUSHBLOCK){
player.row = _local7.row;
player.col = _local7.col;
};
};
} else {
player.faceDir(_local5, false);
};
}
private function handleKeyDown(_arg1:KeyboardEvent):void{
if (paused){
return;
};
if (_arg1.keyCode == 82){
handleResetClicked(null);
return;
};
if (_arg1.keyCode == Keyboard.BACKSPACE){
handleBackClicked(null);
return;
};
var _local2:Point = player.getFacingBlock();
var _local3:Block = curLevel.getBlockAt(playerDepth, _local2.y, _local2.x);
if (_arg1.keyCode == Keyboard.SPACE){
if (_local3.type == Block.SWITCH){
SoundEngine.play("SwitchSnd");
_local3.interactWith(!(_local3.isOn()));
curLevel.runConnections(_local3.depth, _local3.row, _local3.col);
};
};
}
public function initLevel(_arg1:String, _arg2:Boolean=true):void{
SoundEngine.play("StartSnd");
if (curLevel){
if (contains(curLevel)){
removeChild(curLevel);
};
curLevel.destroy();
curLevel = null;
};
db.out(("New Level: " + curLevelNum));
var _local3:Array = _arg1.split("|");
var _local4:Array = _local3[0].split(",");
var _local5:uint = uint(_local4[0]);
var _local6:uint = uint(_local4[1]);
var _local7:Array = _local3[1].split("~");
var _local8 = 3;
var _local9:Array = _local3[2].split("~");
var _local10:Array = _local3[3].split(",");
var _local11:Level = new Level();
_local11.init(_local8, 15, 15, _local6, _local7, _local9, _local10, _arg2);
_local11.x = 325;
_local11.y = 30;
unPause();
Tweener.addTween(this, {_dumbSaturation:1, delay:0.5, time:0.3});
var _local12:Point = _local11.getStartPos();
player.setPos(_local12.y, _local12.x, playerDepth);
player.unwarp();
_local11.addCharacter(playerDepth, (player as Character));
trace(_local11.width, _local11.height);
curLevel = _local11;
addChild(curLevel);
}
public function unPause():void{
paused = false;
}
private function killPlayer():void{
if (paused){
return;
};
pause();
SoundEngine.play("DeathSnd");
db.out("FIRE! Ouch.");
Tweener.addTween(this, {_dumbSaturation:0, time:0.7, onComplete:resetLevel});
player.playDeathAnim();
}
private function handleResetClicked(_arg1:MouseEvent):void{
if (paused){
return;
};
pause();
player.playDeathAnim();
Tweener.addTween(this, {time:0.5, onComplete:resetLevel});
}
public function startMusic():void{
SoundEngine.stopAll();
switch (curLevel.getTheme()){
case Theme.GRASS:
SoundEngine.loopFadeTo("GrassSnd", 0.3, 0, 0.5, 0.3);
break;
case Theme.WATER:
SoundEngine.loopFadeTo("WaterSnd", 0.3, 0, 0.5, 0.3);
break;
case Theme.ICE:
SoundEngine.loopFadeTo("IceSnd", 0.3, 0, 0.5, 0.3);
break;
case Theme.METAL:
SoundEngine.loopFadeTo("MetalSnd", 0.3, 0, 0.5, 0.3);
break;
case Theme.LAVA:
SoundEngine.loopFadeTo("LavaSnd", 0.3, 0, 0.5, 0.3);
break;
case Theme.CAKE:
SoundEngine.loopFadeTo("CakeSnd", 0.3, 0, 0.5, 0.3);
break;
};
}
private function handleSoundClicked(_arg1:MouseEvent):void{
if (SoundEngine.isOn()){
SoundEngine.shutOff();
ui.sound_mc.gotoAndStop(2);
} else {
SoundEngine.turnOn();
ui.sound_mc.gotoAndStop(1);
startMusic();
};
}
public function endLevel():void{
dispatchEvent(new GameEvent(GameEvent.LEVEL_COMPLETE, {success:false, level:curLevelNum}));
}
private function playerDoneMoving(_arg1:uint, _arg2:uint, _arg3:int, _arg4:uint, _arg5:uint, _arg6:uint):void{
var _local13:Block;
var _local7:Block = curLevel.getBlockAt(_arg3, _arg1, _arg2);
var _local8:Block = curLevel.getBlockAt((_arg3 + 1), _arg1, _arg2);
var _local9:Block = curLevel.getBlockAt((_arg6 + 1), _arg4, _arg5);
var _local10:Block = curLevel.getBlockAt(_arg6, _arg4, _arg5);
var _local11:Point = player.getFacingBlock();
var _local12:Block = curLevel.getBlockAt(_arg3, _local11.y, _local11.x);
if (((((((!(_local7)) || (!(_local10)))) || (!(_local9)))) || (!(_local8)))){
return;
};
if (((_local12) && ((_local12.type == Block.PUSHBLOCK)))){
_local13 = curLevel.getBlockAt((_arg3 + 1), _local11.y, _local11.x);
if (_local13){
if (_local13.type == Block.BUTTON){
SoundEngine.play("ButtonSnd");
if (!_local13.isOn()){
curLevel.runConnections(_local13.depth, _local13.row, _local13.col);
};
_local13.interactWith(true);
};
};
};
if ((((_local7.type == Block.FIRE)) && (!(_local7.isOn())))){
killPlayer();
};
if (_local8.type == Block.BUTTON){
SoundEngine.play("ButtonSnd");
if (!_local8.isOn()){
curLevel.runConnections(_local8.depth, _local8.row, _local8.col);
};
_local8.interactWith(true);
};
if (_local9.type == Block.BUTTON){
SoundEngine.play("ButtonSnd");
if (_local9.isOn()){
curLevel.runConnections(_local9.depth, _local9.row, _local9.col);
};
_local9.interactWith(false);
};
if ((((_local7.type == Block.FIRE)) && (!(_local7.isOn())))){
killPlayer();
};
if (_local8.type == Block.END){
SoundEngine.play("MonkeySnd", 2);
SoundEngine.play("StartSnd", 0.5);
db.out("End of Level");
curLevel.end();
player.warp();
pause();
Tweener.addTween(this, {delay:2, time:0.3, onStart:nextLevel, onComplete:unPause});
return;
};
}
public function resetLevel():void{
initLevel(LevelsData.data[curLevelNum], false);
}
private function handleBackClicked(_arg1:MouseEvent):void{
if (paused){
return;
};
curLevel.end();
player.warp();
pause();
GameInput.destroy();
Tweener.addTween(this, {delay:2, time:0.3, onStart:endLevel});
}
public function destroy():void{
if (curLevel){
if (contains(curLevel)){
removeChild(curLevel);
};
curLevel.destroy();
curLevel = null;
};
if (player){
player.destroy();
player = null;
};
}
public function pause():void{
paused = true;
}
}
}//package
Section 32
//GameEvent (GameEvent)
package {
import flash.events.*;
public class GameEvent extends Event {
public var params:Object;
public static const LEVEL_COMPLETE:String = "gameEventLevelComplete";
public function GameEvent(_arg1:String, _arg2:Object, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
params = _arg2;
}
override public function toString():String{
return (formatToString("GameEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
return (new GameEvent(type, params, bubbles, cancelable));
}
}
}//package
Section 33
//IsoWorld (IsoWorld)
package {
import flash.geom.*;
public class IsoWorld {
private static var cWidth:Number = 0;
private static var cHeight:Number = 0;
public function IsoWorld(_arg1:Number, _arg2:Number){
cWidth = (_arg1 / 2);
cHeight = (_arg2 / 2);
}
public static function get squareWidth():Number{
return (cWidth);
}
public static function gridToXY(_arg1:uint, _arg2:uint, _arg3:int=0):Point{
var _local4:Point = new Point();
_local4.x = ((_arg2 - _arg1) * cWidth);
_local4.y = (((_arg2 + _arg1) * cHeight) + ((_arg3 * cHeight) * 2));
return (_local4);
}
public static function xyToGrid(_arg1:Number, _arg2:Number, _arg3:int=0):Point{
var _local4:Point = new Point();
var _local5:Number = (_arg2 - ((_arg3 * cHeight) * 2));
_local4.y = ((_arg2 - _arg1) / 2);
_local4.x = (_arg1 + _local4.y);
var _local6:Point = new Point();
_local6.x = Math.round((_local4.x / cWidth));
_local6.y = Math.round((_local4.y / cHeight));
return (_local6);
}
public static function get squareHeight():Number{
return (cHeight);
}
}
}//package
Section 34
//IsoWorldSquare (IsoWorldSquare)
package {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
public class IsoWorldSquare extends Sprite {
protected var _col:uint;// = 0
protected var _depth:int;// = 0
private var tf:TextField;
protected var _row:uint;// = 0
public function IsoWorldSquare(){
tf = new TextField();
super();
tf.textColor = 0xFFFFFF;
tf.mouseEnabled = false;
tf.x = 10;
tf.y = -10;
addChild(tf);
tf.visible = false;
}
public function get col():uint{
return (_col);
}
public function setXY(_arg1:Point):void{
this.x = _arg1.x;
this.y = _arg1.y;
}
public function set depth(_arg1:int):void{
_depth = _arg1;
}
protected function showData(_arg1:Boolean=true):void{
tf.visible = _arg1;
}
public function get depth():int{
return (_depth);
}
public function set col(_arg1:uint):void{
_col = _arg1;
}
public function set row(_arg1:uint):void{
_row = _arg1;
}
protected function clearData():void{
_row = 0;
_col = 0;
_depth = 0;
}
public function setPos(_arg1:uint, _arg2:uint, _arg3:int=0):void{
setXY(IsoWorld.gridToXY(_arg1, _arg2, _arg3));
_row = _arg1;
_col = _arg2;
_depth = _arg3;
tf.text = ((_arg1 + " ") + _arg2);
}
public function get row():uint{
return (_row);
}
public function getPos():Object{
return ({row:row, col:col, depth:depth});
}
}
}//package
Section 35
//Level (Level)
package {
import caurina.transitions.*;
import flash.geom.*;
import flash.display.*;
import betz.utils.*;
public class Level extends Sprite {
private var totalRows:uint;// = 0
private var blocks:Array;
private var startPos:Point;
private var dataArr:Array;
private var totalCols:uint;// = 0
private var containers:Array;
private var ready:Boolean;// = false
private var totalLayers:uint;// = 0
private var curTheme:uint;// = 1
private var characters:Array;
private var blockDelay:Number;// = 0.003
private var ticks:uint;// = 0
public function Level(){
dataArr = new Array();
blocks = new Array();
containers = new Array();
characters = new Array();
startPos = new Point();
super();
}
public function changeTheme(_arg1:uint):void{
var _local3:int;
var _local4:int;
curTheme = _arg1;
var _local2:int;
while (_local2 < totalLayers) {
_local3 = 0;
while (_local3 < totalRows) {
_local4 = 0;
while (_local4 < totalCols) {
blocks[_local2][_local3][_local4].setTheme(curTheme);
_local4++;
};
_local3++;
};
_local2++;
};
}
public function destroy():void{
var _local2:int;
var _local3:int;
var _local1:int;
while (_local1 < totalLayers) {
_local2 = 0;
while (_local2 < totalRows) {
_local3 = 0;
while (_local3 < totalCols) {
if (blocks[_local1][_local2][_local3]){
if (containers[_local1].contains(blocks[_local1][_local2][_local3])){
containers[_local1].removeChild(blocks[_local1][_local2][_local3]);
};
if (contains(containers[_local1])){
removeChild(containers[_local1]);
};
blocks[_local1][_local2][_local3].destroy();
blocks[_local1][_local2][_local3] = null;
};
_local3++;
};
_local2++;
};
_local1++;
};
}
public function addCharacter(_arg1:uint, _arg2:Character):void{
if ((((_arg1 < 0)) || ((_arg1 >= totalLayers)))){
return;
};
characters.push(_arg2);
containers[_arg1].addChild(_arg2);
}
public function update():void{
if (!ready){
return;
};
ticks++;
if ((ticks % 10) == 0){
redraw();
};
var _local1:int;
while (_local1 < characters.length) {
characters[_local1].update(this);
_local1++;
};
}
public function runConnections(_arg1:uint, _arg2:uint, _arg3:uint):void{
var _local8:Block;
var _local4:Block = getBlockAt(_arg1, _arg2, _arg3);
if (!_local4){
return;
};
var _local5:Boolean;
var _local6:Array = _local4.getConnections();
var _local7:int;
while (_local7 < _local6.length) {
_local8 = getBlockAt(_local6[_local7].d, _local6[_local7].r, _local6[_local7].c);
getBlockAt(_local6[_local7].d, _local6[_local7].r, _local6[_local7].c).interactWith(!(_local8.isOn()));
if ((((((_local8.type == Block.GATE_LEFT)) || ((_local8.type == Block.GATE_RIGHT)))) || ((_local8.type == Block.SHIFT_GATE)))){
SoundEngine.play("GateSnd", 0.5);
};
runConnections(_local8.depth, _local8.row, _local8.col);
_local7++;
};
}
public function getBlockTypeAt(_arg1:uint, _arg2:uint, _arg3:uint):uint{
if ((((((((((((_arg1 < 0)) || ((_arg1 >= totalLayers)))) || ((_arg2 < 0)))) || ((_arg2 >= totalRows)))) || ((_arg3 < 0)))) || ((_arg3 >= totalCols)))){
return (Block.NOTHING);
};
return (dataArr[_arg1][_arg2][_arg3]);
}
public function getStartPos():Point{
return (startPos);
}
public function init(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:Array, _arg7:Array, _arg8:Boolean=true):void{
var _local19:Block;
var _local20:Enemy;
var _local21:String;
var _local22:Point;
var _local23:Array;
var _local24:Array;
var _local25:Block;
totalLayers = _arg1;
totalRows = _arg2;
totalCols = _arg3;
curTheme = _arg4;
ready = false;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
_local9 = 0;
while (_local9 < totalLayers) {
dataArr[_local9] = new Array();
blocks[_local9] = new Array();
_local10 = 0;
while (_local10 < totalRows) {
dataArr[_local9][_local10] = new Array();
blocks[_local9][_local10] = new Array();
_local10++;
};
_local9++;
};
var _local14:Array = _arg5[0].split(",");
var _local15:Array = _arg5[1].split(",");
var _local16:int;
var _local17:int;
var _local18:int;
_local9 = 0;
while (_local9 < totalLayers) {
containers.push(new Sprite());
addChildAt(containers[_local9], 0);
_local17 = 0;
_local12 = ((_local9 * totalRows) * totalCols);
while (_local12 < (((_local9 + 1) * totalRows) * totalCols)) {
_local11 = (_local17 % totalCols);
_local10 = Math.floor((_local17 / totalCols));
dataArr[_local9][_local10][_local11] = Block.NOTHING;
_local20 = null;
_local21 = "";
_local22 = IsoWorld.gridToXY(_local10, _local11, _local9);
if (_local14[_local16] == _local12){
if ((((_local15[_local16] == Block.ENEMY_LR)) || ((_local15[_local16] == Block.ENEMY_UD)))){
_local19 = new Block(new MovieClip());
_local20 = new Enemy(SWFResources.get((("Enemy" + _arg4) + "MC")));
_local20.setPos(_local10, _local11, _local9);
if (_local15[_local16] == Block.ENEMY_LR){
_local21 = "l";
} else {
_local21 = "d";
};
} else {
_local19 = new Block((SWFResources.get(Block.getClassFromType(_local15[_local16])) as MovieClip), _local15[_local16]);
dataArr[_local9][_local10][_local11] = _local15[_local16];
};
_local16++;
} else {
_local19 = new Block(new MovieClip());
};
if (_local19.type == Block.START){
startPos.x = _local11;
startPos.y = _local10;
_local19.setPos(_local10, _local11, _local9);
} else {
if (((!((_local19.type == Block.NOTHING))) && (_arg8))){
_local19.setPos(_local10, _local11, -20);
_local19.depth = _local9;
Tweener.addTween(_local19, {x:_local22.x, y:_local22.y, delay:(_local18 * blockDelay), time:0.7, transition:Equations.easeOutCubic});
_local18++;
} else {
_local19.setPos(_local10, _local11, _local9);
};
};
if (_local12 == _arg7[_local13]){
_local19.interactWith(true);
if (_local21 == "l"){
_local21 = "r";
} else {
if (_local21 == "d"){
_local21 = "u";
};
};
_local13++;
};
_local19.setTheme(curTheme);
blocks[_local9][_local10][_local11] = _local19;
containers[_local9].addChild(blocks[_local9][_local10][_local11]);
if (_local20){
_local20.init(_arg4, _local21);
if (_arg8){
_local20.setPos(_local10, _local11, -20);
_local20.depth = _local9;
Tweener.addTween(_local20, {x:_local22.x, y:_local22.y, delay:(_local18 * blockDelay), time:0.7, transition:Equations.easeOutCubic});
};
addCharacter(_local9, (_local20 as Character));
};
_local17++;
_local12++;
};
_local9++;
};
_local12 = 0;
while (_local12 < (_arg6.length - 1)) {
_local23 = _arg6[_local12].split(">");
_local24 = _local23[0].split(",");
_local25 = getBlockAt(_local24[2], _local24[0], _local24[1]);
if (_local25){
_local25.connectionsFromString(_local23[1]);
};
_local12++;
};
Tweener.addTween(this, {time:(_local18 * blockDelay), onComplete:finishedInit});
}
public function getTheme():uint{
return (curTheme);
}
public function end():void{
var _local4:int;
var _local5:int;
var _local6:Point;
var _local1:int;
var _local2:int = (totalLayers - 1);
while (_local2 >= 0) {
_local4 = (totalRows - 1);
while (_local4 >= 0) {
_local5 = (totalCols - 1);
while (_local5 >= 0) {
_local6 = IsoWorld.gridToXY(_local4, _local5, 20);
if (blocks[_local2][_local4][_local5].type != Block.NOTHING){
Tweener.addTween(blocks[_local2][_local4][_local5], {x:_local6.x, y:_local6.y, delay:(_local1 * 0.004), time:0.7, transition:Equations.easeInQuad});
_local1++;
};
_local5--;
};
_local4--;
};
_local2--;
};
var _local3:int;
while (_local3 < characters.length) {
if ((characters[_local3] is Enemy)){
characters[_local3].playFallingAnim();
};
_local3++;
};
}
public function isCharacter(_arg1:uint, _arg2:uint, _arg3:uint):Boolean{
var _local5:Object;
var _local4:int;
while (_local4 < characters.length) {
_local5 = characters[_local4].getPos();
if ((((((_arg1 == _local5.depth)) && ((_arg2 == _local5.row)))) && ((_arg3 == _local5.col)))){
return (true);
};
_local4++;
};
return (false);
}
public function isReady():Boolean{
return (ready);
}
private function finishedInit():void{
ready = true;
}
public function getLayerData(_arg1:uint):Array{
if ((((_arg1 < 0)) || ((_arg1 >= totalLayers)))){
return (null);
};
return (dataArr[_arg1]);
}
public function getCharacters():Array{
return (characters);
}
public function getBlockAt(_arg1:uint, _arg2:uint, _arg3:uint):Block{
if ((((((((((((_arg1 < 0)) || ((_arg1 >= totalLayers)))) || ((_arg2 < 0)))) || ((_arg2 >= totalRows)))) || ((_arg3 < 0)))) || ((_arg3 >= totalCols)))){
return (null);
};
return (blocks[_arg1][_arg2][_arg3]);
}
public function redraw():void{
var _local3:int;
var _local4:Array;
var _local5:Sprite;
var _local6:Block;
var _local7:int;
var _local8:int;
var _local1:int;
var _local2:int = (totalLayers - 1);
while (_local2 >= 0) {
addChild(containers[_local2]);
_local3 = 0;
_local4 = new Array();
_local1 = 0;
while (_local1 < containers[_local2].numChildren) {
_local5 = (containers[_local2].getChildAt(_local1) as Sprite);
_local4.push({val:(_local5.x + (_local5.y * IsoWorld.squareHeight)), mc:_local5});
_local1++;
};
_local4.sortOn("val", (Array.DESCENDING | Array.NUMERIC));
_local1 = (_local4.length - 1);
_local3 = 0;
while (_local1 >= 0) {
containers[_local2].setChildIndex(_local4[_local1].mc, _local3);
_local1--;
_local3++;
};
_local2--;
};
_local1 = 0;
while (_local1 < characters.length) {
_local6 = getBlockAt(characters[_local1].depth, characters[_local1].row, characters[_local1].col);
_local7 = containers[characters[_local1].depth].getChildIndex(characters[_local1]);
_local8 = containers[characters[_local1].depth].getChildIndex(_local6);
if (_local8 > _local7){
containers[characters[_local1].depth].swapChildren(_local6, characters[_local1]);
};
_local1++;
};
}
public function swapBlocks(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint):void{
var _local7:Block = getBlockAt(_arg1, _arg2, _arg3);
if (!_local7){
return;
};
var _local8:Block = getBlockAt(_arg4, _arg5, _arg6);
if (!_local8){
return;
};
dataArr[_arg1][_arg2][_arg3] = _local8.type;
dataArr[_arg4][_arg5][_arg6] = _local7.type;
_local8.setPos(_arg2, _arg3, _arg1);
_local7.moveTo(_arg5, _arg6, _arg4);
containers[_arg1].removeChild(blocks[_arg1][_arg2][_arg3]);
containers[_arg4].removeChild(blocks[_arg4][_arg5][_arg6]);
blocks[_arg1][_arg2][_arg3] = _local8;
blocks[_arg4][_arg5][_arg6] = _local7;
containers[_arg1].addChild(_local8);
containers[_arg4].addChild(_local7);
ticks = (ticks - 10);
redraw();
}
}
}//package
Section 36
//LevelsData (LevelsData)
package {
public class LevelsData {
public static var names:Array = new Array();
public static var data:Array = new Array();
public function randomLevel():String{
return (data[Math.floor((Math.random() * data.length))]);
}
public static function init():void{
data[0] = "15,1|246,247,261,262,276,291,306,321,337,339,457,471,472,486,487,501,502,512,513,514,515,516,517,518,519,520,521,522,527,528,529,530,531,532,533,534,535,536,537,542,543,544,545,546,547,548,549,550,551,552,557,558,559,560,561,562,563,564,565,566,567,572,573,574,575,576,577,578,579,580,581,582,587,588,589,590,591,592,593,594,595,596,597,602,603,604,605,606,607,608,609,610,611,612,~9,12,9,12,9,9,9,9,5,5,2,8,3,8,3,8,3,4,4,4,4,8,3,4,6,3,3,3,4,4,4,4,8,3,4,4,4,3,3,4,3,3,4,8,3,4,4,4,3,4,4,3,3,3,3,3,3,3,3,3,4,4,3,4,4,4,4,3,4,3,3,4,3,3,4,4,4,4,3,4,4,4,4,3,3,3,6,4,4,1,4,4,4,4,|4,9,2>2,7,1~10,5,2>1,7,1~|";
data[1] = "15,1|265,283,295,313,325,343,355,373,385,403,415,433,460,475,478,490,493,505,508,520,523,535,538,550,553,565,568,580,583,595,598,610,613,625,628,640,643,655,658,670,~12,12,12,12,12,12,12,12,12,12,12,15,2,3,3,3,6,6,3,3,6,6,3,3,6,6,3,3,6,6,3,3,6,6,3,3,6,3,3,1,|2,13,2>2,10,1~3,10,2>3,13,1~4,13,2>4,10,1~5,10,2>5,13,1~6,13,2>6,10,1~7,10,2>7,13,1~8,13,2>8,10,1~9,10,2>9,13,1~10,13,2>10,10,1~11,10,2>11,13,1~12,13,2>12,10,1~|433,";
data[2] = "15,1|273,278,279,288,292,303,307,315,316,317,319,325,326,327,333,337,348,363,368,369,498,502,503,504,513,517,518,519,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,558,559,560,561,562,563,564,565,566,567,568,569,573,577,578,579,588,592,593,594,~7,7,7,14,7,14,7,7,14,14,14,13,13,13,14,7,14,7,7,7,3,5,3,3,3,3,3,3,3,4,4,4,3,3,3,4,4,4,4,4,3,3,3,3,3,3,3,3,3,1,3,3,3,2,4,3,4,4,4,3,3,3,4,4,4,4,4,3,3,3,3,3,5,3,3,|3,3,1>6,10,1~3,8,1>7,3,1~3,9,1>8,3,1~4,7,1>4,3,1~5,7,1>5,3,1~6,0,1>6,11,1~7,7,1>6,1,1~9,3,1>6,12,1~9,8,1>6,3,1,6,2,1~9,9,1>6,4,1~|348,";
data[3] = "15,1|306,316,317,318,319,320,330,331,332,333,334,337,339,515,516,517,518,519,520,530,531,532,533,534,535,540,541,542,543,544,545,546,547,548,549,550,555,556,557,558,559,560,561,562,563,564,565,575,576,577,578,579,580,~5,13,13,13,13,5,9,9,9,9,9,5,5,6,3,3,3,3,6,3,3,4,4,4,4,2,3,3,3,3,3,3,3,1,3,4,8,8,8,8,8,3,3,3,3,3,4,6,4,4,3,3,6,|4,5,2>6,4,1~4,10,2>6,3,1~8,5,2>6,1,1~8,10,2>6,2,1~|";
data[4] = "15,1|245,247,249,306,308,310,467,468,469,470,471,472,473,474,475,476,482,483,484,485,486,487,488,489,490,491,497,498,499,500,501,502,503,504,505,506,512,513,514,515,516,517,518,519,520,521,527,528,529,530,531,532,533,534,535,536,542,543,544,557,558,559,573,~15,15,15,15,15,15,4,4,4,9,4,9,4,9,4,4,4,4,4,3,9,3,9,3,9,4,4,3,3,3,3,3,3,3,3,2,4,3,4,4,3,9,3,9,3,4,4,3,4,4,9,4,9,4,9,4,4,3,4,4,3,4,1,||306,308,310,";
data[5] = "15,2|278,280,308,310,338,340,368,370,398,400,425,455,458,459,460,470,473,474,475,485,488,489,490,500,503,505,515,518,519,520,530,533,535,545,548,549,550,560,563,565,575,578,579,580,590,593,595,605,608,609,610,620,623,625,635,638,639,640,650,653,654,655,665,668,669,670,~12,12,12,12,12,12,12,12,12,12,15,3,3,3,3,3,3,2,3,3,3,3,3,6,3,3,3,3,3,3,6,3,3,3,3,3,3,6,3,3,3,3,3,3,6,3,3,3,3,3,3,6,3,3,3,3,3,3,3,3,1,3,3,3,3,3,|3,5,2>3,10,1~5,5,2>5,8,1~7,5,2>7,8,1~9,5,2>9,10,1~11,5,2>11,8,1~|425,";
data[6] = "15,2|337,370,500,501,502,503,504,505,506,515,516,517,518,519,520,521,530,531,532,533,534,535,536,545,546,547,548,549,550,551,560,561,562,563,564,565,566,575,576,577,578,579,580,581,590,591,592,593,594,595,596,605,606,607,608,609,610,611,~13,5,3,3,3,4,4,3,3,3,3,3,9,9,3,3,4,9,4,4,4,3,3,4,9,4,4,4,9,4,4,9,3,2,4,9,4,4,9,4,4,3,3,4,4,6,4,1,3,3,4,4,4,4,4,3,3,4,|9,6,2>7,7,1~|";
data[7] = "15,2|293,294,295,296,297,309,310,311,319,320,321,322,354,355,356,368,369,370,371,372,513,514,515,516,517,518,519,520,521,522,528,529,530,531,532,533,534,535,536,537,543,544,545,546,547,548,549,550,551,552,558,559,560,561,562,563,564,565,566,567,573,574,575,576,577,578,579,580,581,582,588,589,590,591,592,593,594,595,596,597,~9,9,9,9,9,13,13,13,7,7,7,7,13,13,13,9,9,9,9,9,3,3,3,3,3,8,8,8,8,8,3,3,3,3,3,3,3,3,3,4,3,3,3,3,3,3,4,4,3,2,3,3,3,3,3,3,4,4,3,4,3,3,3,3,3,3,3,3,3,4,1,3,3,3,3,8,8,8,8,8,|6,4,1>8,9,1,5,9,1~6,5,1>8,9,1,8,11,1,5,11,1~6,6,1>8,11,1,8,9,1,5,10,1~6,7,1>5,11,1~|";
data[8] = "15,2|293,353,356,502,503,504,505,506,507,517,518,519,520,521,522,532,533,534,535,536,537,547,548,549,550,551,552,562,563,564,565,566,567,568,569,577,578,579,580,581,582,583,584,592,593,594,595,596,597,598,599,607,608,609,610,611,612,622,623,624,625,626,627,637,638,639,640,641,642,652,653,654,655,656,657,~7,16,14,4,4,4,4,4,4,4,3,4,4,9,4,4,3,4,4,3,4,4,3,4,4,9,4,4,3,4,4,3,4,4,4,4,3,3,3,3,3,2,4,4,3,4,4,3,4,4,4,4,3,4,4,9,4,4,3,4,4,3,4,4,1,4,4,9,4,4,4,4,4,4,4,|4,8,1>8,11,1~|356,";
data[9] = "15,2|8,11,14,23,26,29,38,41,44,53,56,59,68,71,74,83,86,89,98,101,104,113,116,119,128,131,134,233,236,239,345,353,356,359,375,377,379,380,405,407,409,410,437,439,440,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,600,601,602,603,604,605,606,607,615,616,617,618,619,620,621,622,630,631,632,633,634,635,636,637,645,646,647,648,649,650,651,652,660,661,662,663,664,665,666,667,~3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,9,9,9,12,9,9,9,12,16,13,13,12,16,13,13,16,13,13,8,4,4,8,4,4,8,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,6,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,3,3,6,3,3,3,3,3,3,3,3,3,3,3,6,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,4,4,4,4,8,4,4,8,4,4,8,3,4,4,4,4,4,4,4,3,4,3,3,3,3,6,4,3,4,4,4,4,4,4,4,3,4,3,3,3,3,6,4,3,4,4,4,4,4,4,4,2,4,3,3,3,3,6,4,|3,7,2>10,4,1~4,13,2>14,4,1~5,10,2>12,4,1~10,6,2>10,5,1,12,0,1~12,6,2>12,5,1,10,0,1~14,6,2>14,5,1,8,0,1~|380,410,440,";
data[10] = "15,4|287,301,316,319,331,347,512,526,527,528,529,530,531,540,541,542,543,544,545,546,547,548,549,556,557,558,559,560,561,572,~7,13,13,13,13,7,3,3,6,9,4,4,9,2,3,6,9,3,6,9,1,8,8,3,6,9,4,4,9,3,|4,2,1>5,1,1,6,1,1~8,2,1>7,1,1,6,1,1~5,2,2>5,1,1,7,1,1~6,2,2>6,1,1~6,5,2>6,4,1~7,2,2>7,1,1,5,1,1~|301,316,331,";
data[11] = "15,4|336,337,338,339,340,351,355,367,368,369,370,516,517,518,519,520,531,532,533,534,535,544,545,546,547,548,549,550,551,552,559,560,561,562,563,564,565,566,567,574,575,576,577,578,579,580,581,582,589,590,591,592,593,594,595,596,597,604,605,606,607,608,609,610,611,612,621,622,623,624,625,636,637,638,639,640,~11,11,11,11,11,11,11,11,11,11,11,5,4,4,4,5,4,4,4,4,4,5,4,4,4,4,4,4,4,5,4,4,6,6,6,6,6,4,4,4,4,6,6,1,6,6,4,4,4,4,2,6,6,6,6,4,4,5,4,4,4,4,4,4,4,5,4,4,4,4,4,5,4,4,4,5,|7,6,2>7,6,1~7,7,2>7,7,1,7,6,1,7,8,1~7,8,2>7,8,1,7,9,1~7,9,2>7,9,1,7,10,1~7,10,2>7,10,1,8,10,1~8,6,2>8,6,1~8,7,2>7,7,1~8,9,2>9,7,1,8,6,1,7,6,1,7,7,1,7,8,1,9,8,1~8,10,2>8,10,1,9,10,1~9,7,2>9,7,1~9,8,2>9,8,1,9,7,1~9,9,2>9,9,1,9,8,1~9,10,2>9,10,1,9,9,1~|";
data[12] = "15,4|298,305,310,324,340,347,354,368,386,395,416,428,488,489,490,491,503,504,505,506,516,517,518,519,520,521,522,523,530,531,532,533,534,535,536,537,538,543,544,545,546,547,548,549,550,551,552,553,558,559,560,561,562,563,564,565,566,567,568,572,573,574,575,576,577,578,579,580,581,582,583,587,588,589,590,591,592,593,594,595,596,597,598,602,603,604,605,606,607,608,609,610,611,612,613,617,618,619,620,621,622,623,624,625,626,627,628,632,633,634,635,636,637,638,639,640,641,642,643,653,~16,15,16,16,16,12,16,16,16,15,7,15,3,3,3,3,3,4,4,3,3,3,3,4,3,3,3,3,3,3,4,4,4,3,3,4,4,3,3,3,4,4,4,3,3,3,3,4,3,4,3,4,4,4,4,3,3,3,4,3,3,4,4,4,4,4,3,3,3,3,4,2,4,4,4,4,3,3,3,3,3,3,3,4,4,4,4,4,3,4,3,3,3,4,3,4,4,4,3,4,4,4,3,3,4,3,3,1,3,3,3,3,3,3,3,4,3,3,3,3,|12,11,1>8,2,1~|298,386,428,";
data[13] = "15,4|255,258,261,263,266,269,270,273,276,278,281,284,285,288,291,293,296,299,300,303,306,308,311,314,315,318,321,323,326,329,330,333,336,338,341,344,405,408,411,413,419,450,451,452,453,454,455,456,458,459,460,461,462,463,464,465,468,471,473,476,479,480,483,486,488,491,494,495,498,501,503,506,509,510,513,516,518,521,524,525,528,531,533,536,539,540,543,546,548,551,554,555,558,561,563,566,569,570,573,576,578,581,584,585,588,591,593,596,599,600,603,606,608,611,614,615,616,617,618,619,620,621,623,624,625,626,627,628,629,630,631,632,633,634,635,636,638,639,640,641,642,643,644,~12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,15,15,15,7,7,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,|12,8,1>4,0,1,4,3,1,4,6,1,4,8,1,4,11,1,4,14,1~12,14,1>6,14,1,6,11,1,6,8,1,6,6,1,6,3,1,6,0,1~2,6,2>2,6,1~2,14,2>2,14,1~3,0,2>3,0,1~3,6,2>3,6,1,2,6,1~3,8,2>3,8,1~3,14,2>3,14,1,2,14,1~4,0,2>3,0,1~4,6,2>3,6,1~4,8,2>3,8,1~4,14,2>3,14,1~5,0,2>5,0,1~5,6,2>5,6,1~5,14,2>5,14,1~6,0,2>5,0,1~6,3,2>5,3,1~6,6,2>5,6,1~6,8,2>5,8,1~6,11,2>5,11,1~6,14,2>5,14,1~7,3,2>7,3,1~7,6,2>7,6,1~7,8,2>7,8,1~7,14,2>7,14,1~8,0,2>8,0,1,7,0,1~8,3,2>8,3,1,7,3,1~8,6,2>8,6,1,7,6,1~8,8,2>8,8,1,7,8,1~8,11,2>8,11,1,7,11,1~8,14,2>8,14,1,7,14,1~|405,408,411,";
data[14] = "15,4|260,262,264,266,276,278,280,296,297,326,327,336,338,340,350,352,354,356,484,485,486,487,488,489,490,491,499,500,501,502,503,504,505,506,514,515,516,517,518,519,520,521,522,528,529,530,531,532,533,534,535,536,537,544,545,546,547,548,549,550,551,552,559,560,561,562,563,564,565,566,574,575,576,577,578,579,580,581,~7,7,7,7,13,13,13,12,9,12,9,13,13,13,7,7,7,7,9,3,9,3,9,3,9,3,3,3,3,3,3,3,3,3,3,4,4,3,4,3,4,3,8,1,3,4,4,3,4,3,4,3,2,3,4,4,3,4,3,4,3,8,3,3,3,3,3,3,3,3,9,3,9,3,9,3,9,3,|2,5,1>3,8,1,7,8,1~2,7,1>3,8,1,4,11,1,7,8,1~2,9,1>7,8,1,7,6,1~2,11,1>6,11,1,3,6,1,7,8,1~8,5,1>3,6,1,7,8,1,3,10,1~8,7,1>7,6,1,3,6,1,3,10,1~8,9,1>7,8,1,7,10,1,3,8,1~8,11,1>4,11,1,7,8,1,3,8,1,6,11,1~|";
data[15] = "15,3|0,1,15,30,31,45,60,61,75,90,91,105,120,121,135,150,151,165,180,181,195,210,211,225,226,240,253,255,256,270,285,286,300,315,316,325,330,345,346,355,375,376,390,405,406,420,435,436,450,451,452,453,465,466,467,468,469,477,478,479,480,481,482,483,484,485,492,493,494,495,496,497,498,499,500,501,507,508,509,510,511,512,513,514,515,516,517,522,523,524,525,526,527,528,529,530,531,532,533,537,538,539,540,541,542,543,544,545,546,547,548,549,550,552,553,554,555,556,557,558,559,560,561,562,563,564,565,567,568,569,570,571,572,573,574,575,576,577,578,579,580,582,583,584,585,586,587,588,589,590,591,592,593,597,598,599,600,601,602,603,604,605,606,607,612,613,614,615,616,617,618,619,620,621,627,628,629,630,631,632,633,634,635,642,643,644,645,646,647,648,649,657,658,659,660,661,662,663,~3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,11,15,3,3,11,3,3,11,3,3,12,11,3,3,12,3,3,11,3,3,11,3,3,3,3,3,3,3,3,3,3,3,9,6,8,3,3,4,3,3,3,9,3,8,3,3,3,3,3,3,3,9,6,8,3,3,4,3,3,3,3,3,9,3,8,3,3,3,3,3,3,3,3,3,9,6,8,3,3,4,3,3,3,3,3,3,3,3,9,3,8,3,3,3,3,3,3,3,3,3,3,1,9,6,8,3,3,4,3,3,3,3,3,3,3,3,9,3,8,2,3,3,3,3,3,3,3,3,9,6,8,3,3,4,3,3,3,3,3,9,3,8,3,3,3,3,3,3,3,9,6,8,3,3,4,3,3,3,9,3,8,3,3,3,3,3,9,6,8,3,3,3,3,|9,13,2>6,10,1,8,10,1~|355,";
data[16] = "15,3|263,264,265,266,267,268,278,293,308,323,338,353,486,487,488,489,490,491,492,493,494,501,502,503,504,505,506,507,508,509,516,517,518,519,520,521,522,523,524,531,532,533,534,535,536,537,538,539,546,547,548,549,550,551,552,553,554,561,562,563,564,565,566,567,568,569,576,577,578,579,580,581,582,583,584,591,592,593,594,595,596,597,598,599,~13,13,13,13,13,13,5,5,5,5,5,5,4,4,3,3,3,3,3,3,2,4,3,3,6,4,4,4,4,4,4,3,3,6,4,4,4,4,4,4,3,3,6,4,4,4,4,4,4,3,3,6,4,4,4,4,4,4,3,3,6,4,4,4,4,4,4,3,3,6,4,4,4,4,4,4,1,4,4,4,4,4,4,4,|3,9,2>2,13,1~4,9,2>2,12,1~5,9,2>2,11,1~6,9,2>2,10,1~7,9,2>2,9,1~8,9,2>2,8,1~|";
data[17] = "15,3|263,265,267,277,278,281,291,292,296,305,306,311,319,320,326,333,334,341,348,356,385,387,482,483,484,485,486,487,488,489,490,491,492,497,498,499,500,501,502,503,504,505,506,507,512,513,514,515,516,517,518,519,520,521,522,527,528,529,530,531,532,533,534,535,536,537,542,543,544,545,546,547,548,549,550,551,552,557,558,559,560,561,562,563,564,565,566,567,572,573,574,575,576,577,578,579,580,581,582,587,588,589,590,591,592,593,594,595,596,597,602,603,604,605,606,607,608,609,610,611,612,617,618,619,620,621,622,623,624,632,633,634,635,636,637,638,639,647,648,649,650,651,652,653,654,662,663,664,665,666,667,668,669,~9,9,9,9,15,12,9,15,12,9,15,12,9,15,12,9,15,12,15,12,9,9,4,4,4,4,4,4,8,4,8,2,8,4,4,4,4,4,8,3,4,5,3,5,4,4,4,4,8,3,3,4,5,3,5,4,4,4,8,3,3,3,4,5,3,5,4,4,8,3,3,3,3,4,5,3,5,4,8,3,3,3,3,3,4,5,3,5,4,3,3,3,3,3,3,4,5,3,5,4,3,3,3,3,3,3,4,5,3,5,4,6,6,6,6,6,6,4,8,1,8,4,8,8,8,8,8,8,4,4,8,8,4,4,8,8,4,4,8,4,4,4,4,8,4,4,4,4,4,4,4,4,4,|10,3,2>8,11,1~10,4,2>7,11,1~10,5,2>6,11,1~10,6,2>5,11,1~10,7,2>4,11,1~10,8,2>3,11,1~|";
data[18] = "15,3|243,261,279,318,321,324,366,396,426,468,471,474,483,486,489,498,501,504,513,514,515,516,517,518,519,528,529,530,531,532,533,534,543,544,545,546,547,548,549,558,559,560,561,562,563,564,573,574,575,576,577,578,579,588,589,590,591,592,593,594,603,604,605,606,607,608,609,618,619,620,621,622,623,624,633,634,635,636,637,638,639,648,649,650,651,652,653,654,663,664,665,666,667,668,669,~15,15,15,5,5,5,12,12,12,6,6,6,3,3,3,3,3,3,3,4,4,3,4,4,3,3,4,4,3,4,4,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,4,4,4,3,4,4,4,4,4,4,3,4,4,4,4,4,4,3,4,4,4,4,4,4,3,4,4,4,3,4,4,3,4,4,3,3,4,4,3,4,4,3,3,3,4,2,4,3,3,|1,3,2>9,6,1~1,6,2>11,6,1~1,9,2>13,6,1~|";
data[19] = "15,3|263,268,304,318,319,333,334,335,348,349,358,364,488,489,490,491,492,493,494,514,515,516,529,530,531,532,533,534,535,536,537,538,539,543,544,545,546,547,548,549,550,551,552,553,554,558,559,560,561,562,563,564,565,566,567,568,569,573,574,575,576,577,578,579,580,581,582,583,584,589,590,591,592,593,594,595,596,597,598,599,604,605,606,~16,13,7,7,14,7,14,7,7,14,13,7,3,3,3,3,3,3,6,5,5,5,3,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,2,3,4,4,4,4,4,4,4,4,4,4,5,5,5,|5,4,1>6,4,1,7,4,1,8,4,1~6,3,1>6,4,1,7,4,1,8,4,1~7,3,1>8,4,1,7,4,1,6,4,1~7,5,1>6,4,1,7,4,1,8,4,1~8,3,1>8,4,1,7,4,1,6,4,1~9,4,1>8,4,1,7,4,1,6,4,1~2,14,2>2,13,1,8,13,1~|268,358,";
data[20] = "15,5|31,32,33,34,35,36,37,46,47,48,49,50,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,70,71,72,73,74,279,281,282,283,284,294,296,297,299,346,348,350,352,360,375,390,405,420,436,437,438,439,440,441,442,443,444,445,504,505,506,507,508,509,511,513,515,517,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,540,541,542,543,544,545,546,547,548,549,550,551,555,556,557,558,559,560,561,562,563,564,565,566,570,571,572,573,574,575,576,577,578,585,587,589,591,593,600,602,604,606,608,615,617,619,621,623,630,632,634,636,638,645,647,649,651,653,660,661,662,663,664,665,666,667,668,669,670,671,~9,9,9,9,9,9,9,9,9,9,9,9,9,9,3,3,3,3,3,3,3,6,9,6,9,6,9,6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,7,7,7,7,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,3,2,3,3,3,3,6,6,6,6,3,3,3,3,3,3,3,8,8,8,8,8,8,8,3,3,3,3,3,8,4,4,4,4,4,4,3,3,3,3,3,8,8,8,8,8,8,8,3,3,3,1,3,3,4,3,4,3,4,3,4,3,4,4,4,4,3,4,4,4,4,3,4,4,4,4,3,4,4,4,4,3,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,2,||";
data[21] = "15,5|362,363,364,365,366,367,368,369,370,371,372,378,379,380,381,382,383,384,385,386,392,393,394,395,396,397,398,399,400,401,402,497,498,499,500,501,502,503,504,505,506,507,512,513,514,515,516,517,518,519,520,521,522,527,528,529,530,531,532,533,534,535,536,537,587,588,589,590,591,592,593,594,595,596,597,602,603,604,605,606,607,608,609,610,611,612,617,618,619,620,621,622,623,624,625,626,627,~11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,3,3,3,4,4,4,4,3,3,3,3,4,3,4,4,3,3,4,3,4,4,4,4,4,4,3,3,3,4,4,4,3,3,6,6,6,6,6,6,6,6,6,6,6,2,6,6,6,6,6,6,6,6,6,1,6,6,6,6,6,6,6,6,6,6,6,|9,2,2>9,2,1~9,3,2>9,3,1~9,4,2>9,4,1~9,9,2>9,9,1~9,10,2>9,10,1~9,11,2>9,11,1~9,12,2>9,12,1~10,3,2>10,3,1~10,6,2>10,6,1~10,7,2>10,7,1~10,9,2>10,9,1~11,5,2>11,5,1~11,6,2>11,6,1~11,7,2>11,7,1~11,11,2>11,11,1~11,12,2>11,12,1~|362,363,364,365,366,367,368,369,370,371,372,378,379,380,381,382,383,384,385,386,392,393,394,395,396,397,398,399,400,401,402,";
data[22] = "15,5|322,336,338,352,369,370,384,385,386,400,401,402,416,453,459,468,474,483,489,498,501,502,503,504,513,516,517,518,519,528,531,532,533,534,543,544,545,546,547,548,549,550,551,558,559,560,561,562,563,564,565,566,573,574,575,576,577,578,579,591,592,593,594,595,600,601,602,603,604,605,606,607,609,610,611,621,622,625,626,627,641,642,~5,5,5,5,11,11,11,11,11,11,11,11,11,3,3,3,3,3,3,3,4,6,4,3,3,4,6,4,3,3,4,6,4,3,4,4,4,4,3,4,4,4,4,6,6,6,3,1,3,6,6,6,4,4,4,4,3,3,3,4,6,3,3,3,3,3,3,3,3,3,4,6,3,3,3,4,6,3,3,3,3,2,|3,7,2>12,11,1,11,10,1,10,9,1~4,7,2>9,10,1,10,11,1,11,12,1~5,7,2>9,10,1,11,10,1,11,11,1~7,3,2>10,9,1,9,9,1,9,10,1~7,4,2>10,9,1,11,11,1,12,11,1~7,5,2>11,12,1,10,10,1,9,10,1~7,9,2>11,12,1,11,11,1,12,11,1~7,10,2>12,11,1~7,11,2>11,12,1~9,7,2>10,9,1,11,10,1,12,11,1~10,7,2>11,10,1,10,10,1,10,11,1~11,7,2>12,11,1,9,9,1~|";
data[23] = "15,5|129,130,144,145,159,160,174,175,302,304,306,308,310,333,335,337,339,354,355,356,369,370,373,384,385,386,399,400,403,408,410,413,424,427,429,527,528,529,530,531,532,533,534,535,536,541,542,543,544,545,546,547,548,549,550,551,556,557,558,559,560,561,562,563,564,565,566,567,568,571,580,581,582,583,586,595,596,597,598,601,610,611,612,613,616,625,626,627,628,631,632,633,634,635,636,637,638,639,640,641,642,643,646,647,648,649,650,651,652,653,654,655,656,~5,5,5,5,5,5,5,5,15,15,15,15,15,15,15,15,15,3,3,16,3,3,16,3,3,16,3,3,16,15,15,15,15,15,15,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,4,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,4,3,3,3,4,3,3,3,4,3,3,3,2,3,3,3,3,3,3,3,3,3,3,||";
data[24] = "15,5|279,280,309,310,339,340,369,370,375,377,379,381,387,402,417,432,456,471,484,486,499,501,504,505,506,507,512,514,516,521,522,527,529,531,534,535,536,537,540,542,544,546,551,552,555,557,559,561,564,565,566,567,570,572,574,576,581,582,585,587,589,591,594,595,596,597,600,602,604,606,612,615,617,619,621,627,642,657,672,~7,13,7,13,7,13,7,13,15,15,15,15,12,12,12,12,6,3,6,3,3,3,3,3,3,1,6,3,3,3,3,3,3,3,3,3,3,3,6,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,5,5,5,5,3,3,3,2,|3,9,1>10,12,1~5,9,1>11,12,1~7,9,1>12,12,1~9,9,1>13,12,1~0,6,2>5,10,1~2,4,2>3,10,1~4,2,2>9,10,1~6,0,2>7,10,1~|";
data[25] = "15,6|64,65,66,67,68,69,70,79,80,81,82,83,84,85,94,95,96,97,98,99,100,109,110,111,112,113,114,115,289,290,291,292,293,294,295,304,305,307,309,310,319,325,334,340,397,412,427,514,515,516,517,518,519,520,529,530,531,532,533,534,535,544,545,546,547,548,549,550,559,560,561,562,563,564,565,577,592,607,622,637,652,667,~5,3,9,9,9,3,5,9,4,4,4,4,4,9,9,4,4,4,4,4,9,5,3,9,9,9,3,5,3,3,3,3,3,3,5,3,7,7,7,8,3,8,5,5,12,12,12,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,2,|5,5,1>13,7,1~5,7,1>12,7,1~5,9,1>11,7,1~|";
data[26] = "15,6|243,244,246,272,274,276,280,281,282,295,296,297,301,304,306,310,311,312,340,370,400,466,467,468,469,470,471,472,476,487,491,496,497,498,499,500,501,502,505,506,507,508,517,520,521,522,523,526,527,528,529,530,531,532,535,536,537,538,547,550,551,552,553,562,565,566,567,568,577,578,579,580,581,582,583,592,595,596,597,598,607,608,609,610,611,612,613,622,625,626,627,628,637,640,641,642,643,652,655,656,657,658,667,668,669,670,671,672,673,~16,13,13,16,13,13,12,12,12,12,12,12,16,13,13,12,12,12,7,7,7,3,3,3,3,3,3,6,2,4,3,3,3,3,3,3,3,6,3,3,3,4,4,3,3,3,4,3,3,3,3,3,3,6,3,3,3,4,4,3,3,3,4,4,3,3,3,4,4,4,4,4,3,3,4,4,3,3,3,4,4,4,4,4,3,3,4,4,3,3,3,4,4,3,3,3,4,4,3,1,3,4,4,4,4,4,4,4,4,|7,10,1>1,6,1,1,4,1~9,10,1>3,6,1,3,4,1~11,10,1>5,4,1,5,6,1~1,7,2>3,10,1,3,11,1,3,12,1~3,7,2>4,10,1,4,11,1,4,12,1~5,7,2>5,10,1,5,11,1,5,12,1~|244,246,274,276,304,306,";
data[27] = "15,6|274,275,276,277,278,279,280,281,282,283,287,304,305,306,307,308,309,310,311,312,497,498,499,500,501,502,503,504,505,506,507,508,512,513,514,515,516,517,518,519,520,521,522,523,527,528,529,530,531,532,533,534,535,536,537,538,542,543,544,545,546,547,548,549,550,551,552,553,~14,13,14,13,14,13,14,13,14,16,12,7,7,7,7,7,7,7,7,7,6,3,3,3,3,3,3,3,3,3,3,3,2,4,4,4,4,4,4,4,4,4,4,4,1,4,3,3,3,3,3,3,3,3,3,4,3,3,3,3,3,3,3,3,3,3,3,3,|5,4,1>3,4,1,3,8,1,3,12,1~5,5,1>3,5,1,3,9,1~5,6,1>3,6,1,3,10,1~5,7,1>3,7,1,3,11,1~5,8,1>3,8,1,3,12,1,3,4,1~5,9,1>3,9,1,3,5,1~5,10,1>3,10,1,3,6,1~5,11,1>3,11,1,3,7,1~5,12,1>3,12,1,3,8,1,3,4,1~3,2,2>4,2,1~|";
data[28] = "15,6|242,272,302,332,335,337,339,341,343,362,392,422,465,466,467,468,469,483,484,495,496,497,498,499,513,514,525,526,527,528,529,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,603,604,615,616,617,618,619,633,634,645,646,647,648,649,~5,5,5,5,13,13,13,13,13,5,5,5,8,6,8,3,3,3,3,8,6,8,3,3,3,3,8,6,8,3,3,3,3,4,4,4,4,4,4,4,4,4,4,8,6,8,3,1,3,9,3,9,3,9,3,9,3,2,3,3,4,4,4,4,4,4,4,4,4,4,8,6,8,3,3,3,3,8,6,8,3,3,3,3,8,6,8,3,3,|1,1,2>7,5,1~3,1,2>7,13,1,7,11,1~5,1,2>7,5,1,7,7,1~7,1,2>7,13,1,7,11,1,7,9,1,7,7,1~9,1,2>7,13,1,7,11,1~11,1,2>7,5,1,7,9,1~13,1,2>7,13,1,7,7,1~|";
data[29] = "15,6|259,264,301,331,350,351,352,353,354,361,391,480,481,482,483,484,485,486,487,488,489,490,495,496,497,498,499,500,501,502,503,504,505,510,511,512,513,514,520,525,526,527,528,529,534,535,540,541,542,543,544,549,555,556,557,558,559,564,570,571,572,573,574,575,576,577,578,579,580,585,586,587,588,589,600,601,602,603,604,615,616,617,618,619,630,631,632,633,634,~16,13,5,5,11,11,11,11,11,5,5,4,4,4,4,3,3,3,3,3,3,6,4,4,4,4,5,5,5,5,5,5,5,4,4,4,4,4,5,6,3,3,3,4,5,5,3,3,3,3,4,5,6,3,3,3,4,5,3,3,3,1,3,3,3,3,3,3,2,6,3,3,3,4,3,3,3,3,4,6,3,3,3,4,4,4,4,4,4,|2,10,2>2,9,1,8,9,1~5,0,2>8,5,1~7,0,2>8,6,1~9,0,2>8,7,1~11,0,2>8,8,1~|264,354,";
names[0] = "WEIGHT AND SEE";
names[1] = "NO 'I' IN TEAM";
names[2] = "\nPATHWAYS";
names[3] = "LAW AND ORDER";
names[4] = "COMING THROUGH!";
names[5] = "PICK A DOOR";
names[6] = "WEIGHT A LITTLE LONGER";
names[7] = "FLICK-A-SWITCH";
names[8] = "\nCROSSROAD";
names[9] = "UNDER THE SEA";
names[10] = "AUTOMATIC DOOR";
names[11] = "FIRE IN THE LAB!!";
names[12] = "NIGHT OF THE LIVING BATTERY";
names[13] = "\nGUINEA PIGS";
names[14] = "\nLOCK-DOWN";
names[15] = "SHOW ME THE WAY";
names[16] = "\nICE CUBES";
names[17] = "THE MARCH OF THE ICE-MEN";
names[18] = "\nLOCKOFF";
names[19] = "\nDONT SLIP!";
names[20] = "RED HERRINGS";
names[21] = "MAP READING";
names[22] = "\nLAVA SWITCH";
names[23] = "BELLY OF THE BEAST";
names[24] = "ONE CHANCE...";
names[25] = "THE OLD 'FILE-IN-THE-CAKE'";
names[26] = "\nSTEP IN TIME";
names[27] = "\nCAKE WALK";
names[28] = "SO CLOSE YET SO FAR";
names[29] = "BE QUICK ABOUT IT";
}
}
}//package
Section 37
//Main (Main)
package {
import flash.events.*;
import caurina.transitions.*;
import betz.fsm.*;
import flash.display.*;
import betz.utils.*;
import flash.utils.*;
import betz.debug.*;
import betz.logo.*;
import armorgames.logo.*;
import flash.net.*;
import caurina.transitions.properties.*;
import flash.ui.*;
public class Main extends Sprite {
private var MMSounds:Class;
private var playedLevels:uint;// = 0
private var levelPicked:uint;// = 1
private var levelPicker:MovieClip;
private var sounds:SoundEngine;
private var timer:Timer;
private var menu:MovieClip;
private var dbsu:DebugSystemUtil;
private var stars:ScrollingStarField;
private var unlockedAreas:uint;// = 1
private var ftu:FrameTimeUtil;
private var areaPicked:uint;// = 1
private var ticks:uint;// = 0
private var myLogo:JBLogo;
private var db:DebugOutput;
private var started:Boolean;// = false
private var MonkeyMetric:Class;
private var assets:SWFResources;
private var _fsm:FSM;
private var playingAll:Boolean;// = false
private var levelPlays:Array;
private var hasWon:Boolean;// = false
private var wonLevels:uint;// = 0
private var logo:AGLogo;
private var controls:MovieClip;
private var lso:SharedObject;
private var _game:Game;
private var end:MovieClip;
private var story:MovieClip;
private var quality:uint;// = 3
private static const MM_END:String = "mmEnd";
private static const MM_SPLASH:String = "mmSplash";
private static const MM_GAME:String = "mmGame";
private static const MM_MYSPLASH:String = "mmMySplash";
private static const MM_LEVELPICKER:String = "mmLevelPicker";
private static const MM_CONTROLS:String = "mmControls";
private static const MM_STORY:String = "mmStory";
private static const MM_MENU:String = "mmMenu";
public function Main():void{
dbsu = new DebugSystemUtil();
db = new DebugOutput(this);
MonkeyMetric = Main_MonkeyMetric;
MMSounds = Main_MMSounds;
logo = new AGLogo();
myLogo = new JBLogo();
assets = new SWFResources();
sounds = new SoundEngine();
_game = new Game();
levelPlays = new Array();
_fsm = new FSM();
ftu = new FrameTimeUtil();
timer = new Timer(1);
stars = new ScrollingStarField(700, 500, 0, 1);
super();
contextMenu = new ContextMenu();
contextMenu.hideBuiltInItems();
assets.addEventListener(Event.COMPLETE, handleAssetsLoaded);
sounds.addEventListener(Event.COMPLETE, handleSoundsLoaded);
DisplayShortcuts.init();
ColorShortcuts.init();
SoundShortcuts.init();
timer.addEventListener(TimerEvent.TIMER, update);
timer.start();
assets.loadBytes(new MonkeyMetric());
lso = SharedObject.getLocal("MonkeyMetric1-LevelData");
addEventListener(Event.ENTER_FRAME, render);
}
private function endEnd():void{
removeChild(end);
}
private function handlePlayClicked(_arg1:MouseEvent):void{
SoundEngine.play("ButtonSnd");
if (playedLevels > 0){
menu.gotoAndPlay(97);
} else {
_fsm.changeState(MM_STORY);
};
}
private function calcUnlockedAreas():void{
var _local1:uint = unlockedAreas;
var _local2:int;
var _local3:int;
var _local4:int;
while (_local4 < levelPlays.length) {
if (levelPlays[_local4] == 1){
_local2++;
};
if (levelPlays[_local4] >= 0){
_local3++;
};
_local4++;
};
unlockedAreas = (Math.floor((_local2 / 5)) + 1);
if (unlockedAreas > 6){
unlockedAreas = 6;
};
if ((((_local1 < unlockedAreas)) && (started))){
SoundEngine.play("CompleteSnd");
areaPicked = unlockedAreas;
playingAll = false;
};
playedLevels = _local3;
wonLevels = _local2;
}
private function handleStory2PlayClick(_arg1:MouseEvent):void{
SoundEngine.stopAll();
SoundEngine.play("ButtonSnd");
story.play_mc.gotoAndPlay(2);
if (story.currentFrame == 210){
story.gotoAndPlay("plot4");
};
if (story.currentFrame == 270){
story.gotoAndPlay("plot5");
};
if (story.currentFrame == 330){
story.gotoAndPlay("plot6");
Caller.addCall(this, 500, _fsm.changeState, [MM_LEVELPICKER], 1);
};
}
private function startEnd():void{
addChild(end);
end.gotoAndPlay(1);
end.more_btn.addEventListener(MouseEvent.CLICK, handlePlayMoreClicked, false, 0, true);
end.armor_btn.addEventListener(MouseEvent.CLICK, handleArmorClicked, false, 0, true);
end.back_btn.addEventListener(MouseEvent.CLICK, handleBackClicked, false, 0, true);
}
private function endSplash():void{
stage.frameRate = 60;
if (contains(logo)){
removeChild(logo);
};
logo = null;
}
private function endMySplash():void{
stage.frameRate = 60;
if (contains(myLogo)){
removeChild(myLogo);
};
myLogo = null;
}
private function handleArmorClicked(_arg1:MouseEvent):void{
SoundEngine.play("ButtonSnd");
navigateToURL(new URLRequest("http://www.armorgames.com/"));
}
private function startControls():void{
addChild(controls);
controls.play();
controls.continue_mc.addEventListener(MouseEvent.CLICK, handleContinueClick);
}
private function handleQualityChange(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == GameInput.toKeyCode("q")){
if (quality == 3){
stage.quality = StageQuality.HIGH;
quality = 2;
} else {
if (quality == 2){
stage.quality = StageQuality.MEDIUM;
quality = 1;
} else {
if (quality == 1){
stage.quality = StageQuality.LOW;
quality = 0;
} else {
if (quality == 0){
stage.quality = StageQuality.BEST;
quality = 3;
};
};
};
};
trace(stage.quality);
};
}
private function handleControlsClicked(_arg1:MouseEvent):void{
SoundEngine.play("ButtonSnd");
_fsm.changeState(MM_CONTROLS);
}
private function endLevelPicker():void{
var _local2:MovieClip;
var _local3:MovieClip;
SoundEngine.musicFadeOut(0.1);
var _local1:int;
while (_local1 < 6) {
_local2 = (levelPicker.areaPicker_mc.getChildByName((("area" + (_local1 + 1)) + "_mc")) as MovieClip);
_local2.removeEventListener(MouseEvent.CLICK, handleAreaPicked);
_local1++;
};
_local1 = 0;
while (_local1 < 5) {
_local3 = (levelPicker.getChildByName((("level" + (_local1 + 1)) + "_mc")) as MovieClip);
_local3.removeEventListener(MouseEvent.CLICK, handleLevelPicked);
_local1++;
};
removeChild(levelPicker);
}
private function updateGame():void{
_game.update(ftu.elapsed, ftu.dt);
}
public function bounceControls():void{
Tweener.addTween(levelPicker.controls_btn, {y:455, delay:2, time:0.2, transition:Equations.easeOutCubic});
Tweener.addTween(levelPicker.controls_btn, {y:470, delay:2.2, time:0.7, transition:Equations.easeOutBounce, onComplete:bounceControls});
}
private function startSplash():void{
stage.frameRate = 45;
logo.x = 350;
logo.y = 250;
addChild(logo);
logo.init(_fsm.changeState, [MM_MYSPLASH]);
logo.start();
}
private function endGame():void{
SoundEngine.musicFadeOut(0.1);
removeChild(_game);
playingAll = false;
}
private function startLevelPicker():void{
var _local2:MovieClip;
var _local3:MovieClip;
SoundEngine.loopFadeTo("LevelPickerSnd", 0.3, 0, 1, 0.1);
if (((started) && (!(hasWon)))){
levelPicker.gotoAndPlay(1);
} else {
levelPicker.gotoAndPlay(30);
};
started = true;
levelPicker.controls_btn.addEventListener(MouseEvent.CLICK, handleControlsClicked);
bounceControls();
levelPicker.playAll_btn.addEventListener(MouseEvent.CLICK, handlePlayAllClicked);
addChild(levelPicker);
var _local1:int;
while (_local1 < 6) {
_local2 = (levelPicker.areaPicker_mc.getChildByName((("area" + (_local1 + 1)) + "_mc")) as MovieClip);
_local2.addEventListener(MouseEvent.CLICK, handleAreaPicked);
_local2.index = (_local1 + 1);
_local2.buttonMode = true;
_local1++;
};
_local1 = 0;
while (_local1 < 5) {
_local3 = (levelPicker.getChildByName((("level" + (_local1 + 1)) + "_mc")) as MovieClip);
_local3.index = (_local1 + 1);
_local3.label_txt.mouseEnabled = false;
_local3.buttonMode = true;
_local3.addEventListener(MouseEvent.CLICK, handleLevelPicked);
_local1++;
};
calcUnlockedAreas();
selectArea(areaPicked, false);
}
private function startGame():void{
_game.addEventListener(GameEvent.LEVEL_COMPLETE, handleLevelComplete);
addChild(_game);
_game.init(levelPicked);
_game.startMusic();
}
private function handleFlashBrosClicked(_arg1:MouseEvent):void{
SoundEngine.play("ButtonSnd");
navigateToURL(new URLRequest("http://superflashbros.net/"));
}
private function handleLevelComplete(_arg1:GameEvent):void{
if (_arg1.params.success){
levelPlays[_arg1.params.level] = 1;
} else {
if (levelPlays[_arg1.params.level] < 0){
levelPlays[_arg1.params.level] = 0;
};
};
calcUnlockedAreas();
saveData();
trace(areaPicked, unlockedAreas, wonLevels, playingAll, hasWon);
if (!playingAll){
if (!hasWon){
if ((((((areaPicked == 6)) && ((unlockedAreas == 6)))) && ((wonLevels >= 30)))){
hasWon = true;
_fsm.changeState(MM_END);
} else {
if ((((((areaPicked == 6)) && ((unlockedAreas == 6)))) && ((wonLevels <= 25)))){
_fsm.changeState(MM_STORY);
} else {
_fsm.changeState(MM_LEVELPICKER);
};
};
} else {
_fsm.changeState(MM_LEVELPICKER);
};
} else {
if (((_arg1.params.success) && (!(hasWon)))){
if ((((((areaPicked == 6)) && ((unlockedAreas == 6)))) && ((wonLevels >= 30)))){
hasWon = true;
_fsm.changeState(MM_END);
} else {
if ((((((areaPicked == 6)) && ((unlockedAreas == 6)))) && ((wonLevels <= 25)))){
_fsm.changeState(MM_STORY);
} else {
levelPicked++;
if (levelPicked <= (((areaPicked - 1) * 5) + 4)){
_game.init(levelPicked);
};
};
};
} else {
_fsm.changeState(MM_LEVELPICKER);
};
};
}
private function render(_arg1:Event):void{
ticks++;
if ((ticks % 3) == 0){
stars.update();
};
}
private function updateControls():void{
if (controls.currentFrame == controls.totalFrames){
_fsm.changeState(MM_LEVELPICKER);
};
}
private function selectArea(_arg1:uint, _arg2:Boolean=true):void{
var _local5:MovieClip;
var _local6:MovieClip;
var _local7:uint;
areaPicked = _arg1;
var _local3:int;
while (_local3 < 6) {
_local5 = (levelPicker.areaPicker_mc.getChildByName((("area" + (_local3 + 1)) + "_mc")) as MovieClip);
if ((_local3 + 1) != _arg1){
if ((_local3 + 1) <= unlockedAreas){
_local5.gotoAndStop(1);
} else {
_local5.gotoAndStop(3);
};
} else {
_local5.gotoAndStop(2);
};
_local3++;
};
levelPicker.flag_mc.gotoAndStop(_arg1);
if (_arg2){
levelPicker.gotoAndPlay(60);
};
var _local4:uint;
_local3 = 0;
while (_local3 < 5) {
_local6 = (levelPicker.getChildByName((("level" + (_local3 + 1)) + "_mc")) as MovieClip);
_local7 = (((areaPicked - 1) * 5) + _local3);
_local6.label_txt.text = LevelsData.names[_local7];
_local6.levelInfo_mc.gotoAndStop(2);
if (levelPlays[_local7] > 0){
_local4++;
};
Tweener.addTween(_local6, {delay:((_arg2) ? 0.5 : 1 + (_local3 * 0.1)), time:0.1, onComplete:_local6.levelInfo_mc.gotoAndStop, onCompleteParams:[(levelPlays[_local7] + 2)]});
_local3++;
};
levelPicker.flag_mc.complete_mc.visible = (_local4 >= 5);
switch (_arg1){
case Theme.GRASS:
Tweener.addTween(stars, {_color_redOffset:0, _color_greenOffset:100, _color_blueOffset:0, time:0.3, transition:"linear"});
break;
case Theme.WATER:
Tweener.addTween(stars, {_color_redOffset:0, _color_greenOffset:100, _color_blueOffset:100, time:0.3, transition:"linear"});
break;
case Theme.ICE:
Tweener.addTween(stars, {_color_redOffset:40, _color_greenOffset:40, _color_blueOffset:40, time:0.3, transition:"linear"});
break;
case Theme.METAL:
Tweener.addTween(stars, {_color_redOffset:150, _color_greenOffset:150, _color_blueOffset:160, time:0.3, transition:"linear"});
break;
case Theme.LAVA:
Tweener.addTween(stars, {_color_redOffset:100, _color_greenOffset:-100, _color_blueOffset:-100, time:0.3, transition:"linear"});
break;
case Theme.CAKE:
Tweener.addTween(stars, {_color_redOffset:50, _color_greenOffset:20, _color_blueOffset:0, time:0.3, transition:"linear"});
break;
};
}
private function updateStory():void{
if (story.currentFrame >= story.totalFrames){
_fsm.changeState(MM_LEVELPICKER);
};
}
private function handleAssetsLoaded(_arg1:Event):void{
menu = (SWFResources.get("MainMenuMC") as MovieClip);
menu.stop();
levelPicker = (SWFResources.get("LevelPickerMC") as MovieClip);
levelPicker.stop();
story = (SWFResources.get("StoryMC") as MovieClip);
story.stop();
controls = (SWFResources.get("ControlsMC") as MovieClip);
controls.stop();
end = (SWFResources.get("EndMC") as MovieClip);
end.stop();
sounds.loadBytes(new MMSounds());
stage.quality = StageQuality.BEST;
quality = 3;
stage.addEventListener(KeyboardEvent.KEY_UP, handleQualityChange);
}
private function handleSoundsLoaded(_arg1:Event):void{
var _local2:uint;
var _local3:int;
var _local4:int;
LevelsData.init();
if (lso.data.levelPlays){
levelPlays = lso.data.levelPlays;
_local2 = 0;
_local3 = 0;
while (_local3 < levelPlays.length) {
if (levelPlays[_local3] == 1){
_local2++;
};
_local3++;
};
if (_local2 >= 30){
hasWon = true;
};
} else {
_local4 = 0;
while (_local4 < 30) {
levelPlays[_local4] = -1;
_local4++;
};
saveData();
};
calcUnlockedAreas();
addChild(stars);
_fsm.addStateObj(MM_SPLASH, {onStart:startSplash, onComplete:endSplash});
_fsm.addStateObj(MM_MYSPLASH, {onStart:startMySplash, onComplete:endMySplash});
_fsm.addStateObj(MM_MENU, {onStart:startMenu, onUpdate:updateMenu, onComplete:endMenu});
_fsm.addStateObj(MM_STORY, {onStart:startStory, onUpdate:updateStory, onComplete:endStory});
_fsm.addStateObj(MM_LEVELPICKER, {onStart:startLevelPicker, onComplete:endLevelPicker});
_fsm.addStateObj(MM_CONTROLS, {onStart:startControls, onUpdate:updateControls, onComplete:endControls});
_fsm.addStateObj(MM_GAME, {onStart:startGame, onUpdate:updateGame, onComplete:endGame});
_fsm.addStateObj(MM_END, {onStart:startEnd, onComplete:endEnd});
_fsm.startState(MM_SPLASH);
}
private function startStory():void{
addChild(story);
story.play_mc.buttonMode = true;
if (unlockedAreas == 1){
story.gotoAndPlay("start1");
story.play_mc.addEventListener(MouseEvent.CLICK, handleStory1PlayClick, false, 0, true);
SoundEngine.play("Story1Snd");
} else {
if ((((unlockedAreas == 6)) && ((playedLevels < 30)))){
story.gotoAndPlay("start2");
story.play_mc.addEventListener(MouseEvent.CLICK, handleStory2PlayClick, false, 0, true);
};
};
}
private function startMySplash():void{
stage.frameRate = 45;
myLogo.x = 350;
myLogo.y = 250;
addChild(myLogo);
myLogo.init(_fsm.changeState, [MM_MENU]);
myLogo.start();
}
private function endControls():void{
removeChild(controls);
controls.stop();
}
private function handleAreaPicked(_arg1:MouseEvent):void{
if ((((_arg1.currentTarget.currentFrame == 2)) || ((_arg1.currentTarget.currentFrame == 3)))){
return;
};
selectArea(_arg1.currentTarget.index);
SoundEngine.play("ButtonSnd");
}
private function saveData():void{
lso.data.levelPlays = levelPlays;
var flushStatus:String;
try {
flushStatus = lso.flush(10000);
} catch(error:Error) {
db.outEx(DebugOutputType.ERROR, "SharedObject failed to save data");
};
if (flushStatus != null){
switch (flushStatus){
case SharedObjectFlushStatus.FLUSHED:
db.out("SharedObject save successful");
break;
};
};
}
private function update(_arg1:TimerEvent):void{
_fsm.update();
dbsu.update();
}
private function updateMenu():void{
if (menu.currentFrame == menu.totalFrames){
_fsm.changeState(MM_LEVELPICKER);
};
}
private function handleVideoWalkthoughClicked(_arg1:MouseEvent):void{
SoundEngine.play("ButtonSnd");
navigateToURL(new URLRequest("http://www.armorgames.com/guide/Monkey-Metric-Video-Walk-through"));
}
private function handleContinueClick(_arg1:MouseEvent):void{
controls.gotoAndPlay(31);
}
private function endStory():void{
removeChild(story);
}
private function handleLevelPicked(_arg1:MouseEvent):void{
SoundEngine.play("ButtonSnd");
levelPicked = (((areaPicked - 1) * 5) + (_arg1.currentTarget.index - 1));
_fsm.changeState(MM_GAME);
}
private function handlePlayAllClicked(_arg1:MouseEvent):void{
SoundEngine.play("ButtonSnd");
levelPicked = ((areaPicked - 1) * 5);
_fsm.changeState(MM_GAME);
playingAll = true;
}
private function startMenu():void{
SoundEngine.loopFadeTo("MenuSnd", 0.3, 0, 1);
menu.gotoAndPlay(1);
addChild(menu);
menu.play_btn.addEventListener(MouseEvent.CLICK, handlePlayClicked, false, 0, true);
menu.playMore_btn.addEventListener(MouseEvent.CLICK, handlePlayMoreClicked, false, 0, true);
menu.armorGames_btn.addEventListener(MouseEvent.CLICK, handleArmorClicked, false, 0, true);
menu.flashBros_btn.addEventListener(MouseEvent.CLICK, handleFlashBrosClicked, false, 0, true);
menu.video_btn.addEventListener(MouseEvent.CLICK, handleVideoWalkthoughClicked, false, 0, true);
}
private function endMenu():void{
SoundEngine.musicFadeOut(0.1);
removeChild(menu);
}
private function handleStory1PlayClick(_arg1:MouseEvent):void{
SoundEngine.stopAll();
SoundEngine.play("ButtonSnd");
story.play_mc.gotoAndPlay(2);
if (story.currentFrame == 30){
SoundEngine.play("Story2Snd");
story.gotoAndPlay("plot1");
};
if (story.currentFrame == 90){
SoundEngine.play("Story3Snd");
story.gotoAndPlay("plot2");
};
if (story.currentFrame == 150){
story.gotoAndPlay("plot3");
Caller.addCall(this, 500, _fsm.changeState, [MM_LEVELPICKER], 1);
};
}
private function handlePlayMoreClicked(_arg1:MouseEvent):void{
SoundEngine.play("ButtonSnd");
navigateToURL(new URLRequest("http://www.armorgames.com/"));
}
private function handleBackClicked(_arg1:MouseEvent):void{
_fsm.changeState(MM_MENU);
}
}
}//package
Section 38
//Main_MMSounds (Main_MMSounds)
package {
import mx.core.*;
public class Main_MMSounds extends ByteArrayAsset {
}
}//package
Section 39
//Main_MonkeyMetric (Main_MonkeyMetric)
package {
import mx.core.*;
public class Main_MonkeyMetric extends ByteArrayAsset {
}
}//package
Section 40
//Player (Player)
package {
import caurina.transitions.*;
import flash.geom.*;
import flash.display.*;
public class Player extends Character {
public function Player(_arg1:MovieClip){
super(_arg1);
moveTime = 0.33;
}
public function unwarp():void{
this.scaleX = 0;
this.scaleY = 1.2;
var _local1:Point = IsoWorld.gridToXY(this.row, this.col, this.depth);
this.x = (_local1.x + 22);
this.y = (_local1.y - 40);
Tweener.addTween(this, {x:_local1.x, y:_local1.y, _brightness:0, scaleX:1, scaleY:1, time:0.5, transition:Equations.easeInOutQuad});
}
public function playDeathAnim():void{
Tweener.addTween(this, {_color:0xFFFFFF, time:0.6, transition:Equations.easeOutBack});
Tweener.addTween(this, {_brightness:0, delay:0.6, time:0.3, transition:"linear"});
}
public function isValidMove(_arg1:uint, _arg2:uint):Boolean{
return (((canWalkOver(_arg1, _arg2)) && (canWalkThrough(_arg1, _arg2))));
}
public function warp():void{
this.scaleX = (this.scaleY = 1);
Tweener.addTween(this, {x:(this.x + 22), y:(this.y - 40), _brightness:1, scaleX:0, scaleY:1.2, time:0.5, transition:Equations.easeInOutQuad});
}
override public function update(_arg1:Level):void{
super.update(_arg1);
}
override public function destroy():void{
super.destroy();
Tweener.removeTweens(this);
}
public function canWalkThrough(_arg1:uint, _arg2:uint):Boolean{
var _local3:uint = level.getBlockTypeAt(depth, _arg1, _arg2);
return ((((((((((((_local3 == Block.NOTHING)) || ((_local3 == Block.FIRE)))) || ((_local3 == Block.PUSHBLOCK)))) || ((_local3 == Block.GATE_RIGHT)))) || ((_local3 == Block.GATE_LEFT)))) || ((_local3 == Block.SHIFT_GATE))));
}
public function canWalkOver(_arg1:uint, _arg2:uint):Boolean{
var _local3:uint = level.getBlockTypeAt((depth + 1), _arg1, _arg2);
return ((((((((((((_local3 == Block.BLOCK)) || ((_local3 == Block.START)))) || ((_local3 == Block.BUTTON)))) || ((_local3 == Block.COLUMN_BOTTOM)))) || ((_local3 == Block.COLUMN_TOP)))) || ((_local3 == Block.END))));
}
}
}//package
Section 41
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Preloader extends MovieClip {
public function Preloader(){
addEventListener(Event.ENTER_FRAME, progress);
loaderInfo.addEventListener(ProgressEvent.PROGRESS, updateLoader);
}
private function updateLoader(_arg1:ProgressEvent):void{
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(0, 0, ((root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal) * stage.stageWidth), stage.stageHeight);
this.graphics.endFill();
}
private function progress(_arg1:Event):void{
if (currentFrame == totalFrames){
loaderInfo.removeEventListener(ProgressEvent.PROGRESS, progress);
removeEventListener(Event.ENTER_FRAME, progress);
startup();
};
}
private function startup():void{
this.graphics.clear();
stop();
var _local1:Class = (getDefinitionByName("Main") as Class);
addChild((new (_local1) as DisplayObject));
}
}
}//package
Section 42
//ScrollingStarField (ScrollingStarField)
package {
import flash.display.*;
public class ScrollingStarField extends Sprite {
private var ySpeed:int;// = 3
private var randStarsMax:uint;// = 2
private var bmd:BitmapData;
private var bm:Bitmap;
private var xSpeed:int;// = 3
public function ScrollingStarField(_arg1:Number, _arg2:Number, _arg3:int=0, _arg4:int=3){
xSpeed = _arg3;
ySpeed = _arg4;
if (xSpeed > ySpeed){
randStarsMax = Math.round((1.5 * xSpeed));
} else {
randStarsMax = Math.round((1.5 * ySpeed));
};
bmd = new BitmapData((_arg1 + (xSpeed * 2)), (_arg2 + (ySpeed * 2)), false, 4278190080);
bm = new Bitmap(bmd);
bm.x = -(xSpeed);
bm.y = -(ySpeed);
addChild(bm);
var _local5:int;
while (_local5 < 500) {
bmd.setPixel((xSpeed + (Math.random() * _arg1)), (ySpeed + (Math.random() * _arg2)), 0xFFFFFF);
_local5++;
};
}
public function update():void{
bmd.scroll(xSpeed, ySpeed);
var _local1:uint;
var _local2:uint;
var _local3:int;
if (xSpeed != 0){
_local3 = 0;
while (_local3 < randStarsMax) {
if (xSpeed > 0){
_local1 = (xSpeed + (Math.random() * xSpeed));
} else {
if (xSpeed < 0){
_local1 = ((bm.width - (Math.random() * xSpeed)) - xSpeed);
};
};
_local2 = (Math.random() * bm.height);
bmd.setPixel(_local1, (_local2 + ySpeed), 0xFFFFFF);
_local3++;
};
};
if (ySpeed != 0){
_local3 = 0;
while (_local3 < randStarsMax) {
if (ySpeed > 0){
_local2 = (ySpeed + (Math.random() * ySpeed));
} else {
if (ySpeed < 0){
_local2 = ((bm.height - (Math.random() * ySpeed)) - ySpeed);
};
};
_local1 = (Math.random() * bm.width);
bmd.setPixel((_local1 + xSpeed), _local2, 0xFFFFFF);
_local3++;
};
};
bm.bitmapData = bmd;
}
}
}//package
Section 43
//Theme (Theme)
package {
public class Theme {
public static const LAVA:uint = 5;
public static const ICE:uint = 3;
public static const GRASS:uint = 1;
public static const WATER:uint = 2;
public static const CAKE:uint = 6;
public static const METAL:uint = 4;
}
}//package