STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
229494
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2575 · P5149

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/89244518?noj=FRM89244518-14DC" width="1" height="1"></div>

Big Battle Tanks - side-scrolling turn-based heavy metal carnage.swf

This is the info page for
Flash #90641

(Click the ID number above for more basic data on this flash file.)


Text
MISSION FAILED

DEATHMATCH RESULT

PLAYER

SCORE

KILLS

WINS

DAMAGE

Weapon name

00

000000

00

?

MISSION ACCOMPLISHED

000

0

000

Weapon name

ActionScript [AS3]

Section 1
//MD5 (com.adobe.crypto.MD5) package com.adobe.crypto { import flash.utils.*; import com.adobe.utils.*; public class MD5 { public static var digest:ByteArray; private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function f(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 & _arg2) | (~(_arg1) & _arg3))); } private static function g(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 & _arg3) | (_arg2 & ~(_arg3)))); } private static function h(_arg1:int, _arg2:int, _arg3:int):int{ return (((_arg1 ^ _arg2) ^ _arg3)); } private static function i(_arg1:int, _arg2:int, _arg3:int):int{ return ((_arg2 ^ (_arg1 | ~(_arg3)))); } private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{ var _local9:int = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8); return ((IntUtil.rol(_local9, _arg7) + _arg3)); } private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } public static function hash(_arg1:String):String{ var _local2:ByteArray = new ByteArray(); _local2.writeUTFBytes(_arg1); return (hashBinary(_local2)); } private static function createBlocks(_arg1:ByteArray):Array{ var _local2:Array = new Array(); var _local3:int = (_arg1.length * 8); var _local4 = 0xFF; var _local5:int; while (_local5 < _local3) { _local2[int((_local5 >> 5))] = (_local2[int((_local5 >> 5))] | ((_arg1[(_local5 / 8)] & _local4) << (_local5 % 32))); _local5 = (_local5 + 8); }; _local2[int((_local3 >> 5))] = (_local2[int((_local3 >> 5))] | (128 << (_local3 % 32))); _local2[int(((((_local3 + 64) >>> 9) << 4) + 14))] = _local3; return (_local2); } public static function hashBinary(_arg1:ByteArray):String{ var _local6:int; var _local7:int; var _local8:int; var _local9:int; var _local2 = 1732584193; var _local3 = -271733879; var _local4 = -1732584194; var _local5 = 271733878; var _local10:Array = createBlocks(_arg1); var _local11:int = _local10.length; var _local12:int; while (_local12 < _local11) { _local6 = _local2; _local7 = _local3; _local8 = _local4; _local9 = _local5; _local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 7, -680876936); _local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 1))], 12, -389564586); _local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 17, 606105819); _local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 3))], 22, -1044525330); _local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 7, -176418897); _local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 5))], 12, 1200080426); _local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 17, -1473231341); _local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 7))], 22, -45705983); _local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 7, 1770035416); _local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 9))], 12, -1958414417); _local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 17, -42063); _local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 11))], 22, -1990404162); _local2 = ff(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 7, 1804603682); _local5 = ff(_local5, _local2, _local3, _local4, _local10[int((_local12 + 13))], 12, -40341101); _local4 = ff(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 17, -1502002290); _local3 = ff(_local3, _local4, _local5, _local2, _local10[int((_local12 + 15))], 22, 1236535329); _local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 5, -165796510); _local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 6))], 9, -1069501632); _local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 14, 643717713); _local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 0))], 20, -373897302); _local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 5, -701558691); _local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 10))], 9, 38016083); _local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 14, -660478335); _local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 4))], 20, -405537848); _local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 5, 568446438); _local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 14))], 9, -1019803690); _local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 14, -187363961); _local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 8))], 20, 1163531501); _local2 = gg(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 5, -1444681467); _local5 = gg(_local5, _local2, _local3, _local4, _local10[int((_local12 + 2))], 9, -51403784); _local4 = gg(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 14, 1735328473); _local3 = gg(_local3, _local4, _local5, _local2, _local10[int((_local12 + 12))], 20, -1926607734); _local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 5))], 4, -378558); _local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 8))], 11, -2022574463); _local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 11))], 16, 1839030562); _local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 14))], 23, -35309556); _local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 1))], 4, -1530992060); _local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 4))], 11, 1272893353); _local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 7))], 16, -155497632); _local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 10))], 23, -1094730640); _local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 13))], 4, 681279174); _local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 0))], 11, -358537222); _local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 3))], 16, -722521979); _local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 6))], 23, 76029189); _local2 = hh(_local2, _local3, _local4, _local5, _local10[int((_local12 + 9))], 4, -640364487); _local5 = hh(_local5, _local2, _local3, _local4, _local10[int((_local12 + 12))], 11, -421815835); _local4 = hh(_local4, _local5, _local2, _local3, _local10[int((_local12 + 15))], 16, 530742520); _local3 = hh(_local3, _local4, _local5, _local2, _local10[int((_local12 + 2))], 23, -995338651); _local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 0))], 6, -198630844); _local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 7))], 10, 1126891415); _local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 14))], 15, -1416354905); _local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 5))], 21, -57434055); _local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 12))], 6, 1700485571); _local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 3))], 10, -1894986606); _local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 10))], 15, -1051523); _local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 1))], 21, -2054922799); _local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 8))], 6, 1873313359); _local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 15))], 10, -30611744); _local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 6))], 15, -1560198380); _local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 13))], 21, 1309151649); _local2 = ii(_local2, _local3, _local4, _local5, _local10[int((_local12 + 4))], 6, -145523070); _local5 = ii(_local5, _local2, _local3, _local4, _local10[int((_local12 + 11))], 10, -1120210379); _local4 = ii(_local4, _local5, _local2, _local3, _local10[int((_local12 + 2))], 15, 718787259); _local3 = ii(_local3, _local4, _local5, _local2, _local10[int((_local12 + 9))], 21, -343485551); _local2 = (_local2 + _local6); _local3 = (_local3 + _local7); _local4 = (_local4 + _local8); _local5 = (_local5 + _local9); _local12 = (_local12 + 16); }; digest = new ByteArray(); digest.writeInt(_local2); digest.writeInt(_local3); digest.writeInt(_local4); digest.writeInt(_local5); digest.position = 0; return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5))); } private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{ return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)); } public static function hashBytes(_arg1:ByteArray):String{ return (hashBinary(_arg1)); } } }//package com.adobe.crypto
Section 2
//IntUtil (com.adobe.utils.IntUtil) package com.adobe.utils { public class IntUtil { private static var hexChars:String = "0123456789abcdef"; public static function toHex(_arg1:int, _arg2:Boolean=false):String{ var _local4:int; var _local5:int; var _local3 = ""; if (_arg2){ _local4 = 0; while (_local4 < 4) { _local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15)))); _local4++; }; } else { _local5 = 0; while (_local5 < 4) { _local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15)))); _local5++; }; }; return (_local3); } public static function ror(_arg1:int, _arg2:int):uint{ var _local3:int = (32 - _arg2); return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3)))); } public static function rol(_arg1:int, _arg2:int):int{ return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2)))); } } }//package com.adobe.utils
Section 3
//AbstractApplication (com.bigwigmedia.application.AbstractApplication) package com.bigwigmedia.application { import flash.display.*; import com.bigwigmedia.effects.*; import flash.events.*; import com.bigwigmedia.preloaders.*; import com.bigwigmedia.events.*; import com.bigwigmedia.core.*; import com.bigwigmedia.utils.*; import flash.system.*; public class AbstractApplication extends MovieClip implements IApplication { protected var _cursorHolder:Sprite; private var _info:ApplicationInfo; protected var _overlay:AbstractOverlay; protected var _mask:Sprite; protected var _background:Sprite; protected var _mainView:DisplayObjectContainer; protected var _preloader:AbstractPreloader; public function AbstractApplication(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String=null){ ApplicationGlobals.bigwigmedia_ns::_application = this; _info = new ApplicationInfo(_arg1, _arg2, _arg3, _arg4, _arg5); stop(); if (((root) && (root.loaderInfo))){ root.loaderInfo.addEventListener(Event.INIT, onRootInitHandler); }; } protected function createMask(_arg1:uint=0):void{ if (_mask){ return; }; _mask = new Sprite(); var _local2:Graphics = _mask.graphics; _local2.lineStyle(); _local2.beginFill(_arg1, 1); var _local3:int = nominalWidth; var _local4:int = nominalHeight; _local2.moveTo(0, 0); _local2.lineTo(_local3, 0); _local2.lineTo(_local3, _local4); _local2.lineTo(0, _local4); _local2.lineTo(0, 0); var _local5:int = ((maxScreenWidth - _local3) / 2); var _local6:int = ((maxScreenHeight - _local4) / 2); _local2.moveTo(-(_local5), -(_local6)); _local2.lineTo((_local3 + _local5), -(_local6)); _local2.lineTo((_local3 + _local5), (_local4 + _local6)); _local2.lineTo(-(_local5), (_local4 + _local6)); _local2.lineTo(-(_local5), -(_local6)); _local2.endFill(); addChild(_mask); sortChildren(); } private function initialize():void{ stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = ""; dispatchEvent(new ApplicationEvent(ApplicationEvent.INIT)); } protected function fillBackground(_arg1:uint=0):void{ if (!_background){ _background = new Sprite(); addChild(_background); sortChildren(); }; var _local2:Graphics = _background.graphics; _local2.clear(); _local2.lineStyle(); _local2.beginFill(_arg1, 1); _local2.drawRect(0, 0, nominalWidth, nominalHeight); _local2.endFill(); } protected function loadingComplete():void{ dispatchEvent(new ApplicationEvent(ApplicationEvent.READY)); } protected function removeMask():void{ if (_mask){ removeChild(_mask); _mask = null; }; } protected function createMainView(_arg1:Object, ... _args):void{ if (_mainView){ return; }; if ((_arg1 is Class)){ _mainView = new2((_arg1 as Class), _args); } else { if ((_arg1 is DisplayObjectContainer)){ _mainView = (_arg1 as DisplayObjectContainer); } else { throw (new ArgumentError("Parameter view must be Class or DisplayObjectContainer object.")); }; }; addChild(_mainView); sortChildren(); } private function onOverlayCompleteHandler(_arg1:Event):void{ removeOverlay(); } public function get nominalHeight():int{ return (loaderInfo.height); } public function get cursorHolder():Sprite{ if (!_cursorHolder){ _cursorHolder = new Sprite(); _cursorHolder.mouseEnabled = false; _cursorHolder.mouseChildren = false; addChild(_cursorHolder); sortChildren(); }; return (_cursorHolder); } public function removeOverlay():void{ if (_overlay){ _overlay.removeEventListener(Event.COMPLETE, onOverlayCompleteHandler); removeChild(_overlay); _overlay.dispose(); _overlay = null; }; } public function get info():ApplicationInfo{ return (_info); } protected function get maxScreenWidth():int{ return (Capabilities.screenResolutionX); } protected function get maxScreenHeight():int{ return (Capabilities.screenResolutionY); } public function createOverlay(_arg1:AbstractOverlay):void{ if (_overlay){ return; }; _overlay = _arg1; _overlay.addEventListener(Event.COMPLETE, onOverlayCompleteHandler); addChild(_overlay); sortChildren(); _overlay.start(); } protected function sortChildren():void{ var _local4:DisplayObject; var _local1:Array = []; if (_background){ _local1.push(_background); }; if (_mainView){ _local1.push(_mainView); }; if (_preloader){ _local1.push(_preloader); }; if (_overlay){ _local1.push(_overlay); }; if (_mask){ _local1.push(_mask); }; if (_cursorHolder){ _local1.push(_cursorHolder); }; var _local2:int = _local1.length; var _local3:int; while (_local3 < _local2) { _local4 = _local1[_local3]; if (getChildIndex(_local4) != _local3){ setChildIndex(_local4, _local3); }; _local3++; }; } protected function startPreloading(_arg1:AbstractPreloader=null):void{ if (_preloader){ return; }; _preloader = ((_arg1) || (new EmptyPreloader())); addChild(_preloader); _preloader.addEventListener(PreloaderEvent.COMPLETE, preloadingCompleteHandler); } private function onAddedToStageHandler(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onAddedToStageHandler); initialize(); } public function get nominalWidth():int{ return (loaderInfo.width); } public function getURLVariable(_arg1:String, _arg2:Boolean=false):String{ var _local4:String; var _local5:String; var _local3:Object = loaderInfo.parameters; if (_arg2){ return (_local3[_arg1]); }; _local4 = _arg1.toLowerCase(); for (_local5 in _local3) { if (_local5.toLowerCase() == _local4){ return (_local3[_local5]); }; }; return (null); } private function preloadingCompleteHandler(_arg1:PreloaderEvent):void{ _preloader.removeEventListener(PreloaderEvent.COMPLETE, preloadingCompleteHandler); nextFrame(); dispatchEvent(new ApplicationEvent(ApplicationEvent.LOAD_COMPLETE)); loadingComplete(); } protected function clearBackground():void{ if (_background){ _background.graphics.clear(); }; } public function getClassByName(_arg1:String):Class{ var _local2:ApplicationDomain = loaderInfo.applicationDomain; if (_local2.hasDefinition(_arg1)){ return ((_local2.getDefinition(_arg1) as Class)); }; return (null); } public function get nominalFrameRate():Number{ return (loaderInfo.frameRate); } private function onRootInitHandler(_arg1:Event):void{ root.loaderInfo.removeEventListener(Event.INIT, onRootInitHandler); if (stage){ initialize(); } else { addEventListener(Event.ADDED_TO_STAGE, onAddedToStageHandler); }; } public function get mainView():DisplayObjectContainer{ return (_mainView); } } }//package com.bigwigmedia.application
Section 4
//AbstractApplication_2DPLay (com.bigwigmedia.application.AbstractApplication_2DPLay) package com.bigwigmedia.application { public class AbstractApplication_2DPLay extends AbstractApplication { public function AbstractApplication_2DPLay(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String=null){ super(_arg1, _arg2, _arg3, _arg4, _arg5); } final public function getBigWigWrappedGameData():Object{ var _local1:Object = {url:loaderInfo.url, gameid:info.id, affid:loaderInfo.parameters.affid}; return (_local1); } } }//package com.bigwigmedia.application
Section 5
//ApplicationGlobals (com.bigwigmedia.application.ApplicationGlobals) package com.bigwigmedia.application { import com.bigwigmedia.core.*; public class ApplicationGlobals { bigwigmedia_ns static var _application:IApplication; public static function get application():IApplication{ return (bigwigmedia_ns::_application); } } }//package com.bigwigmedia.application
Section 6
//ApplicationInfo (com.bigwigmedia.application.ApplicationInfo) package com.bigwigmedia.application { public class ApplicationInfo { private var _sharedObjectPath:String; private var _name:String; private var _sharedObjectName:String; private var _version:String; private var _id:String; public function ApplicationInfo(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String){ _name = _arg1; _id = _arg2; _version = _arg3; _sharedObjectName = _arg4; _sharedObjectPath = _arg5; } public function get id():String{ return (_id); } public function get sharedObjectPath():String{ return (_sharedObjectPath); } public function get name():String{ return (_name); } public function get sharedObjectName():String{ return (_sharedObjectName); } public function get version():String{ return (_version); } } }//package com.bigwigmedia.application
Section 7
//IApplication (com.bigwigmedia.application.IApplication) package com.bigwigmedia.application { import flash.display.*; import com.bigwigmedia.effects.*; import flash.events.*; public interface IApplication extends IEventDispatcher { function get cursorHolder():Sprite; function get nominalHeight():int; function getClassByName(_arg1:String):Class; function get mainView():DisplayObjectContainer; function get nominalWidth():int; function removeOverlay():void; function get info():ApplicationInfo; function get nominalFrameRate():Number; function createOverlay(_arg1:AbstractOverlay):void; function getURLVariable(_arg1:String, _arg2:Boolean=false):String; function get stage():Stage; } }//package com.bigwigmedia.application
Section 8
//bigwigmedia_ns (com.bigwigmedia.core.bigwigmedia_ns) package com.bigwigmedia.core { public namespace bigwigmedia_ns = "http://www.bigwigmedia.com/flash/as3/namespace"; }//package com.bigwigmedia.core
Section 9
//IDisposable (com.bigwigmedia.core.IDisposable) package com.bigwigmedia.core { public interface IDisposable { function dispose():void; } }//package com.bigwigmedia.core
Section 10
//IUpdatable (com.bigwigmedia.core.IUpdatable) package com.bigwigmedia.core { public interface IUpdatable { function update():void; } }//package com.bigwigmedia.core
Section 11
//Singleton (com.bigwigmedia.core.Singleton) package com.bigwigmedia.core { public class Singleton { private static var interfaceToClassHash:Object = {}; private static var interfaceToInstanceHash:Object = {}; public static function getClass(_arg1:String):Class{ return (interfaceToClassHash[_arg1]); } public static function registerClass(_arg1:String, _arg2:Class):void{ var _local3:Class = interfaceToClassHash[_arg1]; if (!_local3){ interfaceToClassHash[_arg1] = _arg2; }; } public static function getInstance(_arg1:String):Object{ var _local3:Class; var _local4:*; var _local2:* = interfaceToInstanceHash[_arg1]; if (_local2){ return (_local2); }; _local3 = interfaceToClassHash[_arg1]; if (!_local3){ throw (new Error((("No class registered for interface \"" + _arg1) + "\"."))); }; _local3.bigwigmedia_ns::singletonAccessor = true; _local4 = new (_local3); _local3.bigwigmedia_ns::singletonAccessor = true; interfaceToInstanceHash[_arg1] = _local4; return (_local4); } } }//package com.bigwigmedia.core
Section 12
//AlphaDecoration (com.bigwigmedia.display.AlphaDecoration) package com.bigwigmedia.display { import flash.display.*; public class AlphaDecoration implements IDecoration { private var _alpha:Number; public function AlphaDecoration(_arg1:Number){ _alpha = _arg1; } public function remove(_arg1:DisplayObject):void{ _arg1.alpha = 1; } public function apply(_arg1:DisplayObject):void{ _arg1.alpha = _alpha; } } }//package com.bigwigmedia.display
Section 13
//ColorDecoration (com.bigwigmedia.display.ColorDecoration) package com.bigwigmedia.display { import flash.display.*; import flash.geom.*; public class ColorDecoration implements IDecoration { private var _colorTransform:ColorTransform; public function ColorDecoration(_arg1:ColorTransform){ _colorTransform = _arg1; } public function remove(_arg1:DisplayObject):void{ _arg1.transform.colorTransform = new ColorTransform(); } public function apply(_arg1:DisplayObject):void{ _arg1.transform.colorTransform = _colorTransform; } } }//package com.bigwigmedia.display
Section 14
//FilterDecoration (com.bigwigmedia.display.FilterDecoration) package com.bigwigmedia.display { import flash.display.*; import flash.filters.*; public class FilterDecoration implements IDecoration { private var _filters:Array; public function FilterDecoration(... _args){ var _local4:BitmapFilter; _filters = []; super(); var _local2:int = _args.length; var _local3:int; while (_local3 < _local2) { _local4 = _args[_local3]; _filters.push(_local4.clone()); _local3++; }; } public function remove(_arg1:DisplayObject):void{ _arg1.filters = []; } public function apply(_arg1:DisplayObject):void{ _arg1.filters = _filters; } } }//package com.bigwigmedia.display
Section 15
//IDecoration (com.bigwigmedia.display.IDecoration) package com.bigwigmedia.display { import flash.display.*; public interface IDecoration { function remove(_arg1:DisplayObject):void; function apply(_arg1:DisplayObject):void; } }//package com.bigwigmedia.display
Section 16
//TintDecoration (com.bigwigmedia.display.TintDecoration) package com.bigwigmedia.display { import fl.motion.*; public class TintDecoration extends ColorDecoration implements IDecoration { public function TintDecoration(_arg1:uint, _arg2:Number){ var _local3:Color = new Color(); _local3.setTint(_arg1, _arg2); super(_local3); } } }//package com.bigwigmedia.display
Section 17
//AbstractOverlay (com.bigwigmedia.effects.AbstractOverlay) package com.bigwigmedia.effects { import flash.display.*; import com.bigwigmedia.application.*; import flash.events.*; import com.bigwigmedia.core.*; public class AbstractOverlay extends Sprite implements IDisposable { protected var appWidth:int; protected var appHeight:int; private var mouseBlocker:Sprite; public function AbstractOverlay(_arg1:Boolean=true){ appWidth = ApplicationGlobals.application.nominalWidth; appHeight = ApplicationGlobals.application.nominalHeight; mouseChildren = false; addEventListener(MouseEvent.CLICK, onMouseEventHandler, false, 100); addEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler, false, 100); if (_arg1){ mouseBlocker = new Sprite(); mouseBlocker.graphics.lineStyle(0, 0, 0); mouseBlocker.graphics.beginFill(0, 0); mouseBlocker.graphics.drawRect(0, 0, appWidth, appHeight); mouseBlocker.graphics.endFill(); addChild(mouseBlocker); }; } public function start():void{ } private function onMouseEventHandler(_arg1:MouseEvent):void{ _arg1.stopImmediatePropagation(); } public function dispose():void{ removeEventListener(MouseEvent.CLICK, onMouseEventHandler); removeEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); if (mouseBlocker){ removeChild(mouseBlocker); mouseBlocker = null; }; } } }//package com.bigwigmedia.effects
Section 18
//IBeacon (com.bigwigmedia.effects.IBeacon) package com.bigwigmedia.effects { import flash.display.*; import com.bigwigmedia.core.*; public interface IBeacon extends IDisposable { function apply(_arg1:DisplayObject):void; } }//package com.bigwigmedia.effects
Section 19
//ApplicationEvent (com.bigwigmedia.events.ApplicationEvent) package com.bigwigmedia.events { import flash.events.*; public class ApplicationEvent extends Event { public static const INIT:String = "ApplicationEvent.init"; public static const LOAD_COMPLETE:String = "ApplicationEvent.loadComplete"; public static const READY:String = "ApplicationEvent.ready"; public function ApplicationEvent(_arg1:String){ super(_arg1, false, false); } override public function toString():String{ return (formatToString("ApplicationEvent", "type")); } override public function clone():Event{ return (new ApplicationEvent(type)); } } }//package com.bigwigmedia.events
Section 20
//ComponentEvent (com.bigwigmedia.events.ComponentEvent) package com.bigwigmedia.events { import flash.events.*; public class ComponentEvent extends Event { public static const CHANGE:String = "ComponentEvent.change"; public static const MOVE:String = "ComponentEvent.move"; public static const RESIZE:String = "ComponentEvent.resize"; public static const CLOSE:String = "ComponentEvent.close"; public static const SELECT:String = "ComponentEvent.select"; public function ComponentEvent(_arg1:String, _arg2:Boolean=false){ super(_arg1, _arg2, false); } override public function toString():String{ return (formatToString("ComponentEvent", "type", "bubbles", "cancelable", "target")); } override public function clone():Event{ return (new ComponentEvent(type, bubbles)); } } }//package com.bigwigmedia.events
Section 21
//EventPriority (com.bigwigmedia.events.EventPriority) package com.bigwigmedia.events { public class EventPriority { public static const DEFAULT:int = 0; public static const HIGH:int = 100; public static const LOW:int = -100; public static const LOWEST:int = -500; public static const HIGHEST:int = 500; } }//package com.bigwigmedia.events
Section 22
//KeyInputEvent (com.bigwigmedia.events.KeyInputEvent) package com.bigwigmedia.events { import flash.events.*; public class KeyInputEvent extends KeyboardEvent { private var _keyAction:String; public static const SEQUENCE:String = "KeyInputEvent.sequence"; public static const KEY_DOWN:String = "KeyInputEvent.keyInputDown"; public static const KEY_UP:String = "KeyInputEvent.keyInputUp"; public function KeyInputEvent(_arg1:String, _arg2:String, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:Boolean, _arg7:Boolean, _arg8:Boolean){ super(_arg1, false, false, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8); _keyAction = _arg2; } override public function toString():String{ return (formatToString("KeyInputEvent", "type", "keyAction", "keyCode")); } public function get keyAction():String{ return (_keyAction); } override public function clone():Event{ return (new KeyInputEvent(type, keyAction, charCode, keyCode, keyLocation, ctrlKey, altKey, shiftKey)); } } }//package com.bigwigmedia.events
Section 23
//PreloaderEvent (com.bigwigmedia.events.PreloaderEvent) package com.bigwigmedia.events { import flash.events.*; public class PreloaderEvent extends Event { private var _percentLoaded:Number; public static const COMPLETE:String = "PreloaderEvent.complete"; public static const PROGRESS:String = "PreloaderEvent.progress"; public function PreloaderEvent(_arg1:String, _arg2:Number){ super(_arg1, false, false); _percentLoaded = _arg2; } public function get percentLoaded():Number{ return (_percentLoaded); } override public function toString():String{ return (formatToString("PreloaderEvent", "type", "percentLoaded", "target")); } override public function clone():Event{ return (new PreloaderEvent(type, _percentLoaded)); } } }//package com.bigwigmedia.events
Section 24
//SliderEvent (com.bigwigmedia.events.SliderEvent) package com.bigwigmedia.events { import flash.events.*; public class SliderEvent extends Event { private var _value:int; public static const CHANGE:String = "SliderEvent.change"; public static const KNOB_PRESS:String = "SliderEvent.knobPress"; public static const KNOB_RELEASE:String = "SliderEvent.knobRelease"; public function SliderEvent(_arg1:String, _arg2:int, _arg3:Boolean=true, _arg4:Boolean=false){ super(_arg1, _arg3, _arg4); _value = _arg2; } public function get value():int{ return (_value); } override public function toString():String{ return (formatToString("SliderEvent", "type", "bubbles", "cancelable", "target")); } override public function clone():Event{ return (new SliderEvent(type, _value, bubbles, cancelable)); } } }//package com.bigwigmedia.events
Section 25
//FontManager (com.bigwigmedia.font.FontManager) package com.bigwigmedia.font { import flash.system.*; import flash.text.*; import com.bigwigmedia.core.*; import flash.errors.*; public class FontManager implements IFontManager { private var _domain:ApplicationDomain; bigwigmedia_ns static var singletonAccessor:Boolean = false; public function FontManager(){ if (!bigwigmedia_ns::singletonAccessor){ throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of FontManager.")); }; _domain = ApplicationDomain.currentDomain; } public function registerFonts(... _args):void{ var _local2:uint; while (_local2 < _args.length) { Font.registerFont(getFontClass(_args[_local2])); _local2++; }; } public function getFontNameByID(_arg1:String):String{ return (getFont(_arg1).fontName); } private function getFontClass(_arg1:String):Class{ if (_domain){ return ((_domain.getDefinition(_arg1) as Class)); }; return ((ApplicationDomain.currentDomain.getDefinition(_arg1) as Class)); } private function getFont(_arg1:String):Font{ var _local2:Class = getFontClass(_arg1); return ((new (_local2) as Font)); } public function setDomain(_arg1:ApplicationDomain):void{ _domain = _arg1; } } }//package com.bigwigmedia.font
Section 26
//IFontManager (com.bigwigmedia.font.IFontManager) package com.bigwigmedia.font { import flash.system.*; public interface IFontManager { function registerFonts(... _args):void; function getFontNameByID(_arg1:String):String; function setDomain(_arg1:ApplicationDomain):void; } }//package com.bigwigmedia.font
Section 27
//KeyInputManager (com.bigwigmedia.input.KeyInputManager) package com.bigwigmedia.input { import flash.display.*; import flash.events.*; import com.bigwigmedia.events.*; import com.bigwigmedia.core.*; public class KeyInputManager extends EventDispatcher implements IDisposable { private var actionToMapperHash:Object; private var target:InteractiveObject; private var keySequences:Object; private var keycodeToMapperHash:Object; public function KeyInputManager(_arg1:InteractiveObject){ actionToMapperHash = {}; keycodeToMapperHash = {}; keySequences = {}; super(); this.target = _arg1; this.target.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler); this.target.addEventListener(KeyboardEvent.KEY_UP, onKeyUpHandler); } public function mapKey(_arg1:String, _arg2:uint):void{ var _local3:KeyMapper; _local3 = keycodeToMapperHash[_arg2]; if (_local3){ unmapKey(_local3.keyAction); }; _local3 = actionToMapperHash[_arg1]; if (_local3){ unmapKey(_arg1); }; _local3 = new KeyMapper(_arg1, _arg2); actionToMapperHash[_arg1] = _local3; keycodeToMapperHash[_arg2] = _local3; } public function unmapSequence(_arg1:String):void{ var _local2:KeySequence = keySequences[_arg1]; if (_local2){ delete keySequences[_arg1]; }; } private function onKeyDownHandler(_arg1:KeyboardEvent):void{ var _local4:KeySequence; var _local2:uint = _arg1.keyCode; var _local3:KeyMapper = keycodeToMapperHash[_local2]; if (_local3){ if (!_local3.isDown){ dispatchEvent(new KeyInputEvent(KeyInputEvent.KEY_DOWN, _local3.keyAction, _arg1.charCode, _local2, _arg1.keyLocation, _arg1.ctrlKey, _arg1.altKey, _arg1.shiftKey)); }; _local3.isDown = true; }; for each (_local4 in keySequences) { if (_local4.checkNext(_local2)){ dispatchEvent(new KeyInputEvent(KeyInputEvent.SEQUENCE, _local4.keyAction, _arg1.charCode, _local2, _arg1.keyLocation, _arg1.ctrlKey, _arg1.altKey, _arg1.shiftKey)); }; }; } public function dispose():void{ unmapAll(); target.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler); target.removeEventListener(KeyboardEvent.KEY_UP, onKeyUpHandler); target = null; } private function onKeyUpHandler(_arg1:KeyboardEvent):void{ var _local2:KeyMapper = keycodeToMapperHash[_arg1.keyCode]; if (_local2){ if (_local2.isDown){ dispatchEvent(new KeyInputEvent(KeyInputEvent.KEY_UP, _local2.keyAction, _arg1.charCode, _arg1.keyCode, _arg1.keyLocation, _arg1.ctrlKey, _arg1.altKey, _arg1.shiftKey)); }; _local2.isDown = false; }; } public function isKeyDown(_arg1:String):Boolean{ var _local2:KeyMapper = actionToMapperHash[_arg1]; return (((_local2) && (_local2.isDown))); } public function unmapKey(_arg1:String):void{ var _local2:KeyMapper = actionToMapperHash[_arg1]; if (_local2){ delete actionToMapperHash[_arg1]; delete keycodeToMapperHash[_local2.keyCode]; }; } public function mapSequence(_arg1:String, _arg2:Array):void{ if (keySequences[_arg1]){ delete keySequences[_arg1]; }; keySequences[_arg1] = new KeySequence(_arg1, _arg2.slice()); } public function unmapAll():void{ actionToMapperHash = {}; keycodeToMapperHash = {}; keySequences = {}; } public function depressAll():void{ var _local1:KeyMapper; for each (_local1 in actionToMapperHash) { _local1.isDown = false; }; } } }//package com.bigwigmedia.input
Section 28
//KeyMapper (com.bigwigmedia.input.KeyMapper) package com.bigwigmedia.input { class KeyMapper { private var _keyAction:String; var isDown:Boolean;// = false private var _keyCode:uint; function KeyMapper(_arg1:String, _arg2:uint){ _keyAction = _arg1; _keyCode = _arg2; } function get keyAction():String{ return (_keyAction); } function get keyCode():uint{ return (_keyCode); } } }//package com.bigwigmedia.input
Section 29
//KeySequence (com.bigwigmedia.input.KeySequence) package com.bigwigmedia.input { public class KeySequence { private var _sequence:Array; private var nextKeyIndex:int;// = 0 private var _keyAction:String; public function KeySequence(_arg1:String, _arg2:Array){ _keyAction = _arg1; _sequence = _arg2; } public function get keyAction():String{ return (_keyAction); } public function checkNext(_arg1:uint):Boolean{ if (_sequence[nextKeyIndex++] == _arg1){ if (nextKeyIndex == _sequence.length){ nextKeyIndex = 0; return (true); }; } else { nextKeyIndex = 0; }; return (false); } } }//package com.bigwigmedia.input
Section 30
//Vector2D (com.bigwigmedia.math.Vector2D) package com.bigwigmedia.math { public class Vector2D { public var x:Number; public var y:Number; public function Vector2D(_arg1:Number=0, _arg2:Number=0){ this.x = _arg1; this.y = _arg2; } public function negate():void{ x = -(x); y = -(y); } public function equals(_arg1:Vector2D):Boolean{ return ((((x == _arg1.x)) && ((y == _arg1.y)))); } public function getReflect(_arg1:Vector2D):Vector2D{ var _local2:Number = (2 * dotProduct(_arg1)); return (new Vector2D((x - (_arg1.x * _local2)), (y - (_arg1.y * _local2)))); } public function getRotateBy(_arg1:Number):Vector2D{ var _local2:Number = Math.cos(_arg1); var _local3:Number = Math.sin(_arg1); var _local4:Number = ((x * _local2) - (y * _local3)); return (new Vector2D(_local4, ((x * _local3) + (y * _local2)))); } public function getSubtract(_arg1:Vector2D):Vector2D{ return (new Vector2D((x - _arg1.x), (y - _arg1.y))); } public function set length(_arg1:Number):void{ var _local2:Number = (this.length / _arg1); x = (x / _local2); y = (y / _local2); } public function getOrth():Vector2D{ return (new Vector2D(-(y), x)); } public function nearEquals(_arg1:Vector2D, _arg2:Number=1E-5):Boolean{ if (_arg2 < 0){ _arg2 = -(_arg2); }; var _local3:Number = (x - _arg1.x); if (_local3 < 0){ _local3 = -(_local3); }; var _local4:Number = (y - _arg1.y); if (_local4 < 0){ _local4 = -(_local4); }; return ((((_local3 < _arg2)) && ((_local4 < _arg2)))); } public function crossProduct(_arg1:Vector2D):Number{ return (((x * _arg1.y) - (y * _arg1.x))); } public function orientation(_arg1:Vector2D, _arg2:Vector2D):Number{ var _local3:Number = (((_arg1.x - x) * (_arg1.y - y)) - ((_arg1.y - y) * (_arg2.x - x))); return (_local3); } public function rotateBy(_arg1:Number):void{ var _local2:Number = Math.cos(_arg1); var _local3:Number = Math.sin(_arg1); var _local4:Number = ((x * _local2) - (y * _local3)); y = ((x * _local3) + (y * _local2)); x = _local4; } public function get angle():Number{ return (Math.atan2(y, x)); } public function normalize():void{ var _local1:Number = this.length; x = (x / _local1); y = (y / _local1); } public function clone():Vector2D{ return (new Vector2D(x, y)); } public function orth():void{ var _local1:Number = -(y); y = x; x = _local1; } public function getMultiply(_arg1:Number):Vector2D{ return (new Vector2D((x * _arg1), (y * _arg1))); } public function subtract(_arg1:Vector2D):void{ x = (x - _arg1.x); y = (y - _arg1.y); } public function getNormal():Vector2D{ var _local1:Number = this.length; return (new Vector2D((-(y) / _local1), (x / _local1))); } public function getNormalize():Vector2D{ var _local1:Number = this.length; return (new Vector2D((x / _local1), (y / _local1))); } public function get lengthSquared():Number{ return (((x * x) + (y * y))); } public function multiply(_arg1:Number):void{ x = (x * _arg1); y = (y * _arg1); } public function get length():Number{ return (Math.sqrt(((x * x) + (y * y)))); } public function normal():void{ var _local1:Number = this.length; var _local2:Number = (-(y) / _local1); y = (x / _local1); x = _local2; } public function add(_arg1:Vector2D):void{ x = (x + _arg1.x); y = (y + _arg1.y); } public function getAdd(_arg1:Vector2D):Vector2D{ return (new Vector2D((x + _arg1.x), (y + _arg1.y))); } public function getRotateTo(_arg1:Number):Vector2D{ var _local2:Number = this.length; return (new Vector2D((Math.cos(_arg1) * _local2), (Math.sin(_arg1) * _local2))); } public function dotProduct(_arg1:Vector2D):Number{ return (((x * _arg1.x) + (y * _arg1.y))); } public function angleBetween(_arg1:Vector2D):Number{ var _local2:Number = Math.acos((dotProduct(_arg1) / (this.length * _arg1.length))); return (_local2); } public function rotateTo(_arg1:Number):void{ var _local2:Number = this.length; x = (Math.cos(_arg1) * _local2); y = (Math.sin(_arg1) * _local2); } public function getNewLength(_arg1:Number):Vector2D{ var _local2:Number = (this.length / _arg1); return (new Vector2D((x / _local2), (y / _local2))); } public function toString():String{ return ((((("[Vector2D x:" + x) + " y:") + y) + "]")); } public function distance(_arg1:Vector2D):Number{ var _local2:Vector2D = this.getSubtract(_arg1); return (_local2.length); } public function reflect(_arg1:Vector2D):void{ var _local2:Number = (2 * dotProduct(_arg1)); x = (x - (_arg1.x * _local2)); y = (y - (_arg1.y * _local2)); } public function getNegate():Vector2D{ return (new Vector2D(-(x), -(y))); } public static function get Y_UNIT():Vector2D{ return (new Vector2D(0, 1)); } public static function get X_UNIT():Vector2D{ return (new Vector2D(1, 0)); } } }//package com.bigwigmedia.math
Section 31
//ISOManager (com.bigwigmedia.net.ISOManager) package com.bigwigmedia.net { public interface ISOManager { function flush(_arg1:int=0):String; function get dataEmpty():Boolean; function getValue(_arg1:String):Object; function clear():void; function setValue(_arg1:String, _arg2:Object):void; } }//package com.bigwigmedia.net
Section 32
//IURLCaller (com.bigwigmedia.net.IURLCaller) package com.bigwigmedia.net { public interface IURLCaller { function submitScore(_arg1:Object):void; function mainLink():void; function viewScores():void; function playMoreGames():void; function getURL(_arg1:String, _arg2:String="_blank"):void; function downloadGame():void; function getGame():void; } }//package com.bigwigmedia.net
Section 33
//SOManager (com.bigwigmedia.net.SOManager) package com.bigwigmedia.net { import com.bigwigmedia.core.*; import com.bigwigmedia.utils.*; import flash.net.*; import com.bigwigmedia.application.*; import flash.errors.*; public class SOManager implements ISOManager { private var dataObject:Object; private var so:SharedObject; bigwigmedia_ns static var singletonAccessor:Boolean = false; public function SOManager(){ super(); if (!bigwigmedia_ns::singletonAccessor){ throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of SOManager.")); }; try { so = SharedObject.getLocal(ApplicationGlobals.application.info.sharedObjectName, ApplicationGlobals.application.info.sharedObjectPath); } catch(e:Error) { }; dataObject = (so) ? so.data : new Object(); } public function getValue(_arg1:String):Object{ if (!dataObject.hasOwnProperty(_arg1)){ return (undefined); }; return (dataObject[_arg1]); } public function flush(_arg1:int=0):String{ var status:String; var minDiskSpace = _arg1; try { status = so.flush(minDiskSpace); } catch(e:Error) { }; return (status); } public function get dataEmpty():Boolean{ var _local1:Boolean = ObjectUtil.hasProperties(dataObject); return (!(_local1)); } public function clear():void{ var _local1:String; for (_local1 in dataObject) { delete dataObject[_local1]; }; so.clear(); } public function setValue(_arg1:String, _arg2:Object):void{ dataObject[_arg1] = _arg2; } } }//package com.bigwigmedia.net
Section 34
//URLCaller_2DPlay (com.bigwigmedia.net.URLCaller_2DPlay) package com.bigwigmedia.net { import com.bigwigmedia.application.*; import com.bigwigmedia.core.*; import com.adobe.crypto.*; import flash.net.*; import flash.errors.*; public class URLCaller_2DPlay implements IURLCaller { private var applicationID:String; bigwigmedia_ns static var singletonAccessor:Boolean = false; public function URLCaller_2DPlay(){ if (!bigwigmedia_ns::singletonAccessor){ throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of URLCaller_2DPlay.")); }; applicationID = ApplicationGlobals.application.info.id; } public function submitScore(_arg1:Object):void{ var _local2:String = MD5.hash((((("gameid=" + applicationID) + "&hiscore=") + _arg1.toString()) + "2DPlay.com/")); var _local3:String = ((((("http://www.2DPlay.com/highscores.php?gameid=" + applicationID) + "&hiscore=") + _arg1.toString()) + "&hash=") + _local2); getURL(_local3); } public function viewScores():void{ getURL(("http://www.2Dplay.com/showscores.php?gameid=" + applicationID)); } public function getGame():void{ getURL("http://www.2DPlay.com/freecontent.htm"); } public function mainLink():void{ getURL(("http://www.2DPlay.com/index.php?gameid=" + applicationID)); } public function playMoreGames():void{ getURL(("http://www.2DPlay.com/index.php?gameid=" + applicationID)); } public function getURL(_arg1:String, _arg2:String="_blank"):void{ navigateToURL(new URLRequest(_arg1), _arg2); } public function downloadGame():void{ getURL(("http://www.2DPlay.com/downloadgame.php?gameid=" + applicationID)); } } }//package com.bigwigmedia.net
Section 35
//AbstractPreloader (com.bigwigmedia.preloaders.AbstractPreloader) package com.bigwigmedia.preloaders { import flash.display.*; public class AbstractPreloader extends Sprite { public function get percentLoaded():Number{ if (!root){ return (0); }; var _local1:uint = root.loaderInfo.bytesLoaded; var _local2:uint = root.loaderInfo.bytesTotal; if (_local2 == 0){ return (((_local1 > 0)) ? 1 : 0); }; return ((_local1 / _local2)); } } }//package com.bigwigmedia.preloaders
Section 36
//EmptyPreloader (com.bigwigmedia.preloaders.EmptyPreloader) package com.bigwigmedia.preloaders { import flash.events.*; import com.bigwigmedia.events.*; import flash.utils.*; public class EmptyPreloader extends AbstractPreloader { private var timer:Timer; public function EmptyPreloader(){ timer = new Timer(100); timer.addEventListener(TimerEvent.TIMER, onTimerEventHandler); timer.start(); } private function onTimerEventHandler(_arg1:TimerEvent):void{ if (percentLoaded == 1){ timer.stop(); timer.removeEventListener(TimerEvent.TIMER, onTimerEventHandler); timer = null; dispatchEvent(new PreloaderEvent(PreloaderEvent.COMPLETE, 1)); }; } } }//package com.bigwigmedia.preloaders
Section 37
//Preloader_2DPlay (com.bigwigmedia.preloaders.Preloader_2DPlay) package com.bigwigmedia.preloaders { import flash.display.*; import com.bigwigmedia.application.*; import flash.events.*; import com.bigwigmedia.events.*; import flash.utils.*; import flash.system.*; import flash.net.*; public class Preloader_2DPlay extends AbstractPreloader { private var ad:Sprite; private var adLoader:Loader; private var logoAnimationCompleted:Boolean;// = false private var timer:Timer; private var animation:MovieClip; private var barCompleted:Boolean;// = false public var _logo:MovieClip; private var progressBar:MovieClip; private var progressBarMask:MovieClip; public static const AD_WIDTH:Number = 400; public static const NOMINAL_WIDTH:Number = 468; public static const AD_HEIGHT:Number = 350; public static const NOMINAL_HEIGHT:Number = 117; public function Preloader_2DPlay(_arg1:Boolean=true){ var _local2:int; var _local3:int; logoAnimationCompleted = false; barCompleted = false; super(); _logo.visible = false; animation = _logo.animation; progressBar = _logo.progressBar; progressBarMask = progressBar.progressBarMask; animation.stop(); animation.mouseChildren = false; animation.buttonMode = true; animation.addEventListener(MouseEvent.CLICK, onLogoClickHandler); progressBar.alpha = 0; _local2 = ApplicationGlobals.application.nominalWidth; _local3 = ApplicationGlobals.application.nominalHeight; if (NOMINAL_WIDTH > _local2){ _logo.scaleX = (_logo.scaleY = ((_local2 * 0.9) / NOMINAL_WIDTH)); }; _logo.x = ((_local2 - _logo.width) / 2); _logo.y = ((_local3 - _logo.height) / 2); if (((!((Security.sandboxType == Security.LOCAL_WITH_FILE))) && (_arg1))){ loadAd(); } else { startLogoAnimation(); }; } private function onLogoClickHandler(_arg1:MouseEvent):void{ navigateToURL(new URLRequest(("http://www.2DPlay.com/index.php?gameid=" + ApplicationGlobals.application.info.id)), "_blank"); } private function onAdCompleteHandler(_arg1:Event):void{ var event = _arg1; adLoader.contentLoaderInfo.sharedEvents.removeEventListener("BigwigInGameAdComplete", onAdCompleteHandler); try { adLoader.unload(); } catch(error:Error) { }; ad.removeChild(adLoader); adLoader = null; removeChild(ad); ad = null; startLogoAnimation(); } private function onTimerEventHandler(_arg1:TimerEvent):void{ var _local2:Number; _local2 = percentLoaded; progressBarMask.scaleX = _local2; if (!logoAnimationCompleted){ if (animation.currentFrame == animation.totalFrames){ logoAnimationCompleted = true; } else { animation.nextFrame(); }; } else { if (!barCompleted){ if (_local2 == 1){ barCompleted = true; } else { progressBar.alpha = (progressBar.alpha + 0.1); if (progressBar.alpha >= 1){ barCompleted = true; progressBar.alpha = 1; }; }; } else { if (_local2 == 1){ timer.stop(); timer.removeEventListener(TimerEvent.TIMER, onTimerEventHandler); timer = null; animation.removeEventListener(MouseEvent.CLICK, onLogoClickHandler); dispatchEvent(new PreloaderEvent(PreloaderEvent.COMPLETE, 1)); }; }; }; _arg1.updateAfterEvent(); } private function loadAd():void{ var _local1:int; var _local2:int; Security.allowDomain("adserver.bigwigmedia.com"); _local1 = ApplicationGlobals.application.nominalWidth; _local2 = ApplicationGlobals.application.nominalHeight; ad = new Sprite(); ad.graphics.lineStyle(); ad.graphics.beginFill(0xFFFFFF); ad.graphics.drawRect(0, 0, AD_WIDTH, AD_HEIGHT); ad.graphics.endFill(); if (AD_HEIGHT > _local2){ ad.scaleX = (ad.scaleY = ((_local2 * 0.9) / AD_HEIGHT)); }; ad.x = ((_local1 - ad.width) / 2); ad.y = ((_local2 - ad.height) / 2); addChild(ad); adLoader = new Loader(); ad.addChild(adLoader); adLoader.contentLoaderInfo.sharedEvents.addEventListener("BigwigInGameAdComplete", onAdCompleteHandler); adLoader.load(new URLRequest("http://adserver.bigwigmedia.com/ingamead3.swf")); } private function startLogoAnimation():void{ graphics.lineStyle(); graphics.beginFill(2045285, 1); graphics.drawRect(0, 0, ApplicationGlobals.application.nominalWidth, ApplicationGlobals.application.nominalHeight); graphics.endFill(); _logo.visible = true; timer = new Timer(33); timer.addEventListener(TimerEvent.TIMER, onTimerEventHandler); timer.start(); } } }//package com.bigwigmedia.preloaders
Section 38
//ISoundManager (com.bigwigmedia.sound.ISoundManager) package com.bigwigmedia.sound { public interface ISoundManager { function stopChannel(_arg1:String):void; function playSound(_arg1:String, _arg2:int=1):void; function unregisterSoundRecord(_arg1:String):void; function setSoundVolume(_arg1:String, _arg2:Number):void; function playNextSound(_arg1:String, _arg2:String, _arg3:int=1, _arg4:uint=25, _arg5:uint=25):void; function isSoundPlaying(_arg1:String):Boolean; function setChannelsVolume(_arg1:Number):void; function stopSound(_arg1:String):void; function setSoundPan(_arg1:String, _arg2:Number):void; function setChannelVolume(_arg1:String, _arg2:Number):void; function setChannelPan(_arg1:String, _arg2:Number):void; function registerSoundRecord(_arg1:String, _arg2:Class, _arg3:Array):void; function stopAll():void; } }//package com.bigwigmedia.sound
Section 39
//ReplayChannel (com.bigwigmedia.sound.ReplayChannel) package com.bigwigmedia.sound { public class ReplayChannel { private var _name:String; private var recordsHash:Object; private var _volume:Number;// = 1 private var _pan:Number;// = 0 public function ReplayChannel(_arg1:String){ recordsHash = new Object(); super(); _name = _arg1; } public function set pan(_arg1:Number):void{ var _local2:SoundRecord; _pan = _arg1; if (_pan < -1){ _pan = -1; } else { if (_pan > 1){ _pan = 1; }; }; for each (_local2 in recordsHash) { _local2.channelPan = _pan; }; } public function stop():void{ var _local1:SoundRecord; for each (_local1 in recordsHash) { _local1.stop(); }; } function set soundsVolume(_arg1:Number):void{ var _local2:SoundRecord; _volume = _arg1; if (_volume < 0){ _volume = 0; } else { if (_volume > 1){ _volume = 1; }; }; for each (_local2 in recordsHash) { _local2.volume = _volume; }; } public function get name():String{ return (_name); } public function registerSound(_arg1:String, _arg2:SoundRecord):void{ if (!recordsHash[_arg1]){ _arg2.channelVolume = _volume; _arg2.channelPan = _pan; recordsHash[_arg1] = _arg2; }; } public function unregisterSound(_arg1:String):void{ var _local2:SoundRecord = recordsHash[_arg1]; if (_local2){ _local2.dispose(); delete recordsHash[_arg1]; }; } public function set volume(_arg1:Number):void{ var _local2:SoundRecord; _volume = _arg1; if (_volume < 0){ _volume = 0; } else { if (_volume > 1){ _volume = 1; }; }; for each (_local2 in recordsHash) { _local2.channelVolume = _volume; }; } } }//package com.bigwigmedia.sound
Section 40
//SoundManager (com.bigwigmedia.sound.SoundManager) package com.bigwigmedia.sound { import com.boostworthy.events.*; import com.boostworthy.animation.sequence.tweens.*; import com.bigwigmedia.core.*; import com.boostworthy.animation.sequence.*; import com.boostworthy.animation.rendering.*; import flash.errors.*; public class SoundManager implements ISoundManager { private var timeline:Timeline; private var channelsHash:Object; private var transitionChannel:ReplayChannel; private var recordsHash:Object; bigwigmedia_ns static var singletonAccessor:Boolean = false; private static var replayChannelUID:int = 0; public function SoundManager(){ channelsHash = new Object(); recordsHash = new Object(); super(); if (!bigwigmedia_ns::singletonAccessor){ throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of SoundManager.")); }; } public function stopAll():void{ var _local1:SoundRecord; for each (_local1 in recordsHash) { _local1.stop(); }; } public function setSoundVolume(_arg1:String, _arg2:Number):void{ var _local3:SoundRecord = recordsHash[_arg1]; _local3.volume = _arg2; } public function playNextSound(_arg1:String, _arg2:String, _arg3:int=1, _arg4:uint=25, _arg5:uint=25):void{ if (timeline){ timeline.stop(); timeline.removeEventListener(AnimationEvent.FINISH, onTimelineFinishHandler); timeline.dispose(); timeline = null; } else { transitionChannel = channelsHash[_arg1]; if (transitionChannel){ timeline = new Timeline(RenderMethod.ENTER_FRAME); timeline.addTween(new Tween(this, "allSoundsVolume", 0, 1, (_arg4 + 1))); timeline.addTween(new Action(playSound, [_arg2, _arg3], null, [], (_arg4 + 1))); timeline.addTween(new Tween(this, "allSoundsVolume", 1, (_arg4 + 2), ((_arg4 + _arg5) + 3))); timeline.addEventListener(AnimationEvent.FINISH, onTimelineFinishHandler); timeline.play(); }; }; } public function playSound(_arg1:String, _arg2:int=1):void{ var _local3:SoundRecord = recordsHash[_arg1]; _local3.play(_arg2); } public function setChannelsVolume(_arg1:Number):void{ var _local2:ReplayChannel; for each (_local2 in channelsHash) { _local2.volume = _arg1; }; } public function setSoundPan(_arg1:String, _arg2:Number):void{ var _local3:SoundRecord = recordsHash[_arg1]; _local3.pan = _arg2; } public function setChannelVolume(_arg1:String, _arg2:Number):void{ var _local3:ReplayChannel = channelsHash[_arg1]; if (_local3){ _local3.volume = _arg2; }; } private function onTimelineFinishHandler(_arg1:AnimationEvent):void{ timeline.removeEventListener(AnimationEvent.FINISH, onTimelineFinishHandler); timeline.dispose(); timeline = null; } public function registerSoundRecord(_arg1:String, _arg2:Class, _arg3:Array):void{ var _local4:String; var _local5:SoundRecord; var _local6:String; var _local7:ReplayChannel; if (recordsHash[_arg1]){ throw (new ArgumentError((("SoundRecord with \"" + _arg1) + "\" identifier already exists."))); }; if (_arg3.length == 0){ _local4 = ("internal.replay_channel_" + String(replayChannelUID++)); registerSoundRecord(_arg1, _arg2, [_local4]); } else { _local5 = new SoundRecord(new (_arg2)); recordsHash[_arg1] = _local5; for each (_local6 in _arg3) { _local7 = channelsHash[_local6]; if (!_local7){ _local7 = new ReplayChannel(_local6); channelsHash[_local6] = _local7; }; _local7.registerSound(_arg1, _local5); }; }; } public function stopChannel(_arg1:String):void{ var _local2:ReplayChannel = channelsHash[_arg1]; if (_local2){ _local2.stop(); }; } public function setChannelPan(_arg1:String, _arg2:Number):void{ var _local3:ReplayChannel = channelsHash[_arg1]; if (_local3){ _local3.pan = _arg2; }; } public function unregisterSoundRecord(_arg1:String):void{ var _local2:ReplayChannel; for each (_local2 in channelsHash) { _local2.unregisterSound(_arg1); }; } public function isSoundPlaying(_arg1:String):Boolean{ var _local2:SoundRecord = recordsHash[_arg1]; return (_local2.playing); } public function stopSound(_arg1:String):void{ var _local2:SoundRecord = recordsHash[_arg1]; _local2.stop(); } public function set allSoundsVolume(_arg1:Number):void{ transitionChannel.soundsVolume = _arg1; } } }//package com.bigwigmedia.sound
Section 41
//SoundRecord (com.bigwigmedia.sound.SoundRecord) package com.bigwigmedia.sound { import flash.events.*; import flash.media.*; import com.bigwigmedia.core.*; public class SoundRecord implements IDisposable { private var _channelPan:Number;// = 0 private var _volume:Number;// = 1 private var sound:Sound; private var _pan:Number;// = 0 private var transform:SoundTransform; private var _playing:Boolean;// = false private var soundChannel:SoundChannel; private var _channelVolume:Number;// = 1 public function SoundRecord(_arg1:Sound){ transform = new SoundTransform(); super(); this.sound = _arg1; } public function set channelVolume(_arg1:Number):void{ _channelVolume = _arg1; setResultTransform(); } public function stop():void{ if (_playing){ soundChannel.stop(); soundChannel.removeEventListener(Event.SOUND_COMPLETE, onCompleteHandler); _playing = false; }; } public function set volume(_arg1:Number):void{ _volume = _arg1; if (_volume < 0){ _volume = 0; } else { if (_volume > 1){ _volume = 1; }; }; setResultTransform(); } public function play(_arg1:int):void{ stop(); soundChannel = sound.play(0, _arg1, transform); soundChannel.addEventListener(Event.SOUND_COMPLETE, onCompleteHandler); _playing = true; } private function setResultTransform():void{ var _local1:Number = (_pan + _channelPan); if (_local1 < -1){ _local1 = -1; } else { if (_local1 > 1){ _local1 = 1; }; }; transform.pan = _local1; transform.volume = (_volume * _channelVolume); if (_playing){ soundChannel.soundTransform = transform; }; } public function dispose():void{ soundChannel = null; sound = null; transform = null; } public function get playing():Boolean{ return (_playing); } private function onCompleteHandler(_arg1:Event):void{ soundChannel.removeEventListener(Event.SOUND_COMPLETE, onCompleteHandler); _playing = false; } public function set pan(_arg1:Number):void{ _pan = _arg1; if (_pan < -1){ _pan = -1; } else { if (_pan > 1){ _pan = 1; }; }; setResultTransform(); } public function set channelPan(_arg1:Number):void{ _channelPan = _arg1; setResultTransform(); } } }//package com.bigwigmedia.sound
Section 42
//HSMError (com.bigwigmedia.statemachine.hsm.errors.HSMError) package com.bigwigmedia.statemachine.hsm.errors { public class HSMError extends Error { public function HSMError(_arg1:String=""){ super(_arg1); } } }//package com.bigwigmedia.statemachine.hsm.errors
Section 43
//HSMEvent (com.bigwigmedia.statemachine.hsm.events.HSMEvent) package com.bigwigmedia.statemachine.hsm.events { import flash.events.*; public class HSMEvent extends Event { private var _eventType:String; private var _stateName:String; public static const CHANGE_STATE:String = "HSMEvent.changeState"; public static const START:String = "HSMEvent.start"; public static const SIGNAL_EVENT:String = "HSMEvent.signalEvent"; public static const TIME_EVENT:String = "HSMEvent.timeEvent"; public function HSMEvent(_arg1:String, _arg2:String=null, _arg3:String=null){ super(_arg1); _stateName = _arg2; _eventType = _arg3; } override public function clone():Event{ return (new HSMEvent(type, _stateName, _eventType)); } public function get eventType():String{ return (_eventType); } public function get stateName():String{ return (_stateName); } override public function toString():String{ return (formatToString("HSMEvent", "type", "stateName", "eventType")); } } }//package com.bigwigmedia.statemachine.hsm.events
Section 44
//StateEvent (com.bigwigmedia.statemachine.hsm.events.StateEvent) package com.bigwigmedia.statemachine.hsm.events { import flash.events.*; public class StateEvent extends Event { private var _data; public static const ADDED:String = "StateEvent.added"; public static const TIME:String = "StateEvent.time"; public function StateEvent(_arg1:String, _arg2){ super(_arg1); _data = _arg2; } public function get data(){ return (_data); } override public function clone():Event{ return (new StateEvent(type, _data)); } override public function toString():String{ return (formatToString("StateEvent", "type", "data")); } } }//package com.bigwigmedia.statemachine.hsm.events
Section 45
//Debugger (com.bigwigmedia.statemachine.hsm.utils.Debugger) package com.bigwigmedia.statemachine.hsm.utils { import com.bigwigmedia.statemachine.hsm.*; import flash.events.*; import com.bigwigmedia.statemachine.hsm.events.*; import flash.net.*; public class Debugger { public static const LC_NAME:String = "HSM_Debugger"; private static var hsmHash:Object = new Object(); private static var localConnect:LocalConnection; public static function registerHSM(_arg1:IHSM):void{ if (!localConnect){ localConnect = new LocalConnection(); localConnect.addEventListener(StatusEvent.STATUS, onStatusHandler); }; if (!hsmHash[_arg1.name]){ _arg1.addEventListener(HSMEvent.CHANGE_STATE, onHSMEventHandler); _arg1.addEventListener(HSMEvent.SIGNAL_EVENT, onHSMEventHandler); _arg1.addEventListener(HSMEvent.TIME_EVENT, onHSMEventHandler); hsmHash[_arg1.name] = _arg1; localConnect.send(LC_NAME, "recieveEvent", {config:_arg1.getConfiguration()}); }; } private static function onStatusHandler(_arg1:StatusEvent):void{ if (_arg1.level == "error"){ }; } private static function onHSMEventHandler(_arg1:HSMEvent):void{ var _local2:IHSM = (_arg1.target as IHSM); if (_arg1.type == HSMEvent.CHANGE_STATE){ localConnect.send(LC_NAME, "recieveEvent", {state:_arg1.stateName, hsm:_local2.name}); } else { localConnect.send(LC_NAME, "recieveEvent", {event:_arg1.eventType, state:_arg1.stateName, hsm:_local2.name}); }; } public static function unregisterHSM(_arg1:IHSM):void{ if (hsmHash[_arg1.name]){ _arg1.removeEventListener(HSMEvent.CHANGE_STATE, onHSMEventHandler); _arg1.removeEventListener(HSMEvent.SIGNAL_EVENT, onHSMEventHandler); _arg1.removeEventListener(HSMEvent.TIME_EVENT, onHSMEventHandler); delete hsmHash[_arg1.name]; }; } } }//package com.bigwigmedia.statemachine.hsm.utils
Section 46
//AbstractEvent (com.bigwigmedia.statemachine.hsm.AbstractEvent) package com.bigwigmedia.statemachine.hsm { import com.bigwigmedia.utils.*; public class AbstractEvent { protected var _type:String; protected var _data:Object; public function AbstractEvent(_arg1:String, _arg2:Object=null){ _type = _arg1; } public function get data():Object{ return (_data); } public function get type():String{ return (_type); } public function toString():String{ return (ObjectUtil.formatToString(this, "type", "data")); } } }//package com.bigwigmedia.statemachine.hsm
Section 47
//ChoicePointState (com.bigwigmedia.statemachine.hsm.ChoicePointState) package com.bigwigmedia.statemachine.hsm { public class ChoicePointState extends SimpleState { public function ChoicePointState(_arg1:String){ super(_arg1); } override function registerTransition(_arg1:Transition):void{ _transitions.push(_arg1); } override public function getTransition(_arg1:String):Transition{ var _local4:Transition; var _local2:int = _transitions.length; var _local3:int; while (_local3 < _local2) { _local4 = _transitions[_local3]; if (_local4.checkGuardCondition()){ return (_local4); }; _local3++; }; return (null); } } }//package com.bigwigmedia.statemachine.hsm
Section 48
//CompositeState (com.bigwigmedia.statemachine.hsm.CompositeState) package com.bigwigmedia.statemachine.hsm { import com.bigwigmedia.statemachine.hsm.events.*; import com.bigwigmedia.core.*; import com.bigwigmedia.statemachine.hsm.errors.*; public class CompositeState extends SimpleState { protected var _initialChild:SimpleState;// = null protected var _children:Array; public function CompositeState(_arg1:String, _arg2:Function=null, _arg3:Function=null, _arg4:Function=null){ _children = []; super(_arg1, _arg2, _arg3, _arg4); } override public function dispose():void{ var _local1:IDisposable; super.dispose(); for each (_local1 in _children) { _local1.dispose(); }; _children = []; if (_initialChild){ _initialChild.dispose(); _initialChild = null; }; } public function get children():Array{ return (_children); } public function addSubstate(_arg1:SimpleState):SimpleState{ _arg1.setParent(this); if ((_arg1 is InitialState)){ if (_initialChild){ throw (new HSMError((((("State \"" + name) + "\" already has initial substate \"") + _initialChild.name) + "\""))); }; _initialChild = _arg1; }; _children.push(_arg1); dispatchEvent(new StateEvent(StateEvent.ADDED, _arg1)); return (_arg1); } public function hasDescendant(_arg1:SimpleState):Boolean{ return (_arg1.hasAncestor(this)); } public function get initialChild():SimpleState{ return (_initialChild); } override public function getTransitionLevel(_arg1:SimpleState):String{ var _local2:String; if (this == _arg1){ _local2 = TransitionLevel.TO_SELF; } else { if (hasAncestor(_arg1)){ _local2 = TransitionLevel.TO_ANCESTOR; } else { if (hasDescendant(_arg1)){ _local2 = TransitionLevel.TO_DESCENDANT; } else { if (_arg1.parent == parent){ if ((_arg1 is CompositeState)){ _local2 = (CompositeState(_arg1).initialChild) ? TransitionLevel.TO_IRRELATIVE : TransitionLevel.TO_SIBLING; } else { _local2 = TransitionLevel.TO_SIBLING; }; } else { _local2 = TransitionLevel.TO_IRRELATIVE; }; }; }; }; return (_local2); } } }//package com.bigwigmedia.statemachine.hsm
Section 49
//FinalState (com.bigwigmedia.statemachine.hsm.FinalState) package com.bigwigmedia.statemachine.hsm { public final class FinalState extends SimpleState { public function FinalState(_arg1:String, _arg2:Function=null, _arg3:Function=null){ super(_arg1, _arg2, _arg3, null); } } }//package com.bigwigmedia.statemachine.hsm
Section 50
//HSM (com.bigwigmedia.statemachine.hsm.HSM) package com.bigwigmedia.statemachine.hsm { import flash.events.*; import com.bigwigmedia.statemachine.hsm.events.*; import com.bigwigmedia.statemachine.hsm.errors.*; public class HSM extends EventDispatcher implements IHSM { private var started:Boolean;// = false private var _initialState:SimpleState;// = null private var routeFinder:RouteFinder; private var pendingEvents:Array; private var transitionInProgress:Boolean;// = false private var _name:String; private var statesHash:Object; private var _currentState:SimpleState;// = null public function HSM(_arg1:String){ routeFinder = new RouteFinder(); statesHash = {}; pendingEvents = []; super(); _name = _arg1; } public function getConfiguration():XML{ var s:SimpleState; var i:int; var state:SimpleState; var parent:XMLList; var config:XML = new XML((("<stateMachine name=\"" + ??esc_xattr ) + "\"/>")); var states:XML = <states/> ; var transitions:XML = <transitions/> ; var statesList:Array = new Array(); for each (s in statesHash) { statesList.push(s); }; while (statesList.length > 0) { i = 0; for (;i < statesList.length;(i = (i + 1))) { state = statesList[i]; if (!state.parent){ states.appendChild(new XML((((("<state type=\"" + ??esc_xattr ) + "\" name=\"") + ??esc_xattr ) + "\"/>"))); addTransitionConfiguration(transitions, state); statesList.splice(i, 1); continue; } else { if (states..state.(@name == state.parent.name).length() > 0){ parent = states..state.(@name == state.parent.name); parent.appendChild(new XML((((("<state type=\"" + ??esc_xattr ) + "\" name=\"") + ??esc_xattr ) + "\"/>"))); addTransitionConfiguration(transitions, state); statesList.splice(i, 1); continue; }; }; }; }; config.appendChild(states); config.appendChild(transitions); return (config); } public function update():void{ if (_currentState){ _currentState.invokeDoAction(new SignalEvent(SignalEvent.DO_ACTION)); }; } public function get name():String{ return (_name); } public function sendSignal(_arg1:SignalEvent):Boolean{ var _local5:Transition; var _local6:Array; var _local7:Array; if (!started){ throw (new HSMError("State machine is not started")); }; dispatchEvent(new HSMEvent(HSMEvent.SIGNAL_EVENT, _currentState.name, _arg1.type)); if (((!(_currentState.parent)) && ((_currentState is FinalState)))){ return (false); }; var _local2:Array = routeFinder.getStack(_currentState); var _local3:int = _local2.length; var _local4:int; while (_local4 < _local3) { _local5 = _local2[_local4].getTransition(_arg1.type); if (((_local5) && (_local5.checkGuardCondition()))){ _local6 = routeFinder.getExit(_currentState, _local5.targetState); _local7 = routeFinder.getEntry(_currentState, _local5.targetState); startTransition(_local6, _local7, _local5, _arg1); return (true); }; _local4++; }; return (false); } private function onSubstateAddedHandler(_arg1:StateEvent):void{ _addState((_arg1.data as SimpleState)); } public function addTransition(_arg1:String, _arg2:String, _arg3:Object=null, _arg4:Function=null, _arg5:Function=null):void{ var _local8:AbstractEvent; if (!hasState(_arg1)){ throw (new HSMError((("State \"" + _arg1) + "\" doesn't exist"))); }; if (!hasState(_arg2)){ throw (new HSMError((("State \"" + _arg2) + "\" doesn't exist"))); }; var _local6:SimpleState = statesHash[_arg1]; var _local7:SimpleState = statesHash[_arg2]; if ((((_local6 is ChoicePointState)) && (!((_arg3 === null))))){ throw (new HSMError((("Transition from ChoicePointState \"" + _arg1) + "\" can't be initiated by event"))); }; if (_arg3 === null){ _local8 = new SignalEvent(SignalEvent.ON_STATE_COMPLETE); } else { if ((_arg3 is Number)){ _local8 = new TimeEvent((((_arg2 + "(delay=") + String(_arg3)) + ")"), Number(_arg3)); _local6.addEventListener(StateEvent.TIME, onStateTimeHandler); } else { if ((_arg3 is String)){ _local8 = new SignalEvent(String(_arg3)); } else { throw (new ArgumentError("Supplied event is not valid.")); }; }; }; _local6.registerTransition(new Transition(_local7, _local8, _arg4, _arg5)); } private function _addState(_arg1:SimpleState):void{ var _local3:Array; var _local4:SimpleState; if (hasState(_arg1.name)){ throw (new HSMError((("State \"" + _arg1.name) + "\" exists already"))); }; var _local2:CompositeState = (_arg1 as CompositeState); if (_local2){ _local3 = _local2.children; for each (_local4 in _local3) { _addState(_local4); }; _local2.addEventListener(StateEvent.ADDED, onSubstateAddedHandler); }; statesHash[_arg1.name] = _arg1; } public function start(_arg1:String=null):void{ if (started){ return; }; var _local2:SimpleState = ((_arg1 == null)) ? _initialState : statesHash[_arg1]; if (!_local2){ throw (new HSMError("Initial state doesn't exist")); }; var _local3:Array = routeFinder.getStack(_local2); _currentState = _local3[0]; started = true; dispatchEvent(new HSMEvent(HSMEvent.START, _local2.name)); startTransition([], _local3, null, new SignalEvent(SignalEvent.HSM_START)); } public function dispose():void{ var _local1:SimpleState; started = false; routeFinder.dispose(); routeFinder = null; for each (_local1 in statesHash) { _local1.deactivate(); _local1.removeEventListener(StateEvent.ADDED, onSubstateAddedHandler); _local1.removeEventListener(StateEvent.TIME, onStateTimeHandler); _local1.dispose(); }; statesHash = {}; pendingEvents = []; } private function startTransition(_arg1:Array, _arg2:Array, _arg3:Transition=null, _arg4:SignalEvent=null):void{ var _local5:SimpleState; var _local7:int; var _local8:int; var _local11:Transition; var _local12:int; var _local13:int; var _local14:SignalEvent; if (transitionInProgress){ pendingEvents.push(_arg4); return; }; transitionInProgress = true; var _local6:Array = routeFinder.getStack(_currentState); for each (_local5 in _local6) { _local5.deactivate(); }; _local7 = _arg1.length; _local8 = 0; while (_local8 < _local7) { _local5 = _arg1[_local8]; _local5.invokeExitAction(_arg4); _local8++; }; if (_arg3){ _arg3.invokeEffect(_arg4); }; var _local9:int = _arg2.length; var _local10:int = (_local9 - 1); while (_local10 >= 0) { _local5 = _arg2[_local10]; _local5.invokeEntryAction(_arg4); _local10--; }; _local6 = routeFinder.getStack(_arg2[0]); _currentState = _local6[0]; if ((_currentState is ChoicePointState)){ _local11 = _currentState.getTransition(null); if (_local11){ _arg1 = routeFinder.getExit(_currentState, _local11.targetState); _arg2 = routeFinder.getEntry(_currentState, _local11.targetState); transitionInProgress = false; startTransition(_arg1, _arg2, _local11, _arg4); }; }; for each (_local5 in _local6) { _local5.activate(); }; transitionInProgress = false; dispatchEvent(new HSMEvent(HSMEvent.CHANGE_STATE, _currentState.name)); if (sendSignal(new SignalEvent(SignalEvent.ON_STATE_COMPLETE))){ if (pendingEvents.length > 0){ pendingEvents = []; }; } else { _local12 = pendingEvents.length; _local13 = 0; while (_local13 < _local12) { _local14 = pendingEvents[_local13]; if (sendSignal(_local14)){ if (pendingEvents.length > 0){ pendingEvents = []; }; break; }; _local13++; }; }; } private function onStateTimeHandler(_arg1:StateEvent):void{ var _local2:String = (_arg1.data as String); dispatchEvent(new HSMEvent(HSMEvent.TIME_EVENT, _currentState.name, _local2)); sendSignal(new SignalEvent(_local2)); } private function addTransitionConfiguration(_arg1:XML, _arg2:SimpleState):void{ var _local4:Transition; var _local5:String; var _local3:Array = _arg2.transitions; for each (_local4 in _local3) { if ((_local4.event is TimeEvent)){ _local5 = ((_local4.event as TimeEvent).delay + " ms"); _arg1.appendChild(new XML((((((("<transition source=\"" + ??esc_xattr ) + "\" target=\"") + ??esc_xattr ) + "\" timeEvent=\"") + ??esc_xattr ) + "\"/>"))); } else { _local5 = _local4.event.type; _arg1.appendChild(new XML((((((("<transition source=\"" + ??esc_xattr ) + "\" target=\"") + ??esc_xattr ) + "\" signalEvent=\"") + ??esc_xattr ) + "\"/>"))); }; }; } public function addState(_arg1:SimpleState):SimpleState{ _addState(_arg1); if ((_arg1 is InitialState)){ if (_initialState){ throw (new HSMError((("Initial state \"" + _arg1.name) + "\" exists already"))); }; _initialState = _arg1; }; return (_arg1); } public function hasState(_arg1:String):Boolean{ return (!((statesHash[_arg1] == null))); } public function get currentState():SimpleState{ return (_currentState); } } }//package com.bigwigmedia.statemachine.hsm
Section 51
//IHSM (com.bigwigmedia.statemachine.hsm.IHSM) package com.bigwigmedia.statemachine.hsm { import flash.events.*; import com.bigwigmedia.core.*; public interface IHSM extends IEventDispatcher, IDisposable, IUpdatable { function addState(_arg1:SimpleState):SimpleState; function start(_arg1:String=null):void; function addTransition(_arg1:String, _arg2:String, _arg3:Object=null, _arg4:Function=null, _arg5:Function=null):void; function hasState(_arg1:String):Boolean; function get currentState():SimpleState; function get name():String; function getConfiguration():XML; function sendSignal(_arg1:SignalEvent):Boolean; } }//package com.bigwigmedia.statemachine.hsm
Section 52
//InitialState (com.bigwigmedia.statemachine.hsm.InitialState) package com.bigwigmedia.statemachine.hsm { public final class InitialState extends SimpleState { public function InitialState(_arg1:String, _arg2:Function=null, _arg3:Function=null, _arg4:Function=null){ super(_arg1, _arg2, _arg3, _arg4); } } }//package com.bigwigmedia.statemachine.hsm
Section 53
//RouteFinder (com.bigwigmedia.statemachine.hsm.RouteFinder) package com.bigwigmedia.statemachine.hsm { import com.bigwigmedia.core.*; public class RouteFinder implements IDisposable { private var entryCache:Object; private var stackCache:Object; private var exitCache:Object; public function RouteFinder(){ exitCache = {}; entryCache = {}; stackCache = {}; super(); } public function getStack(_arg1:SimpleState):Array{ var _local2:String = ("stack-->" + _arg1.name); var _local3:Array = stackCache[_local2]; if (_local3){ return (_local3); }; var _local4:SimpleState = _arg1; if ((_local4 is CompositeState)){ _local4 = ((CompositeState(_local4).initialChild) || (_local4)); }; _local3 = [_local4]; while (_local4.parent) { _local3.push(_local4.parent); _local4 = _local4.parent; }; stackCache[_local2] = _local3; return (_local3); } public function getExit(_arg1:SimpleState, _arg2:SimpleState):Array{ var _local3:String = ((_arg1.name + "-->") + _arg2.name); var _local4:Array = exitCache[_local3]; if (_local4){ return (_local4); }; var _local5:String = _arg1.getTransitionLevel(_arg2); var _local6:SimpleState = _arg1; switch (_local5){ case TransitionLevel.TO_SELF: case TransitionLevel.TO_SIBLING: _local4 = [_local6]; break; case TransitionLevel.TO_ANCESTOR: _local4 = [_local6]; while (_local6 != _arg2) { _local4.push(_local6.parent); _local6 = _local6.parent; }; break; case TransitionLevel.TO_DESCENDANT: _local4 = []; break; case TransitionLevel.TO_IRRELATIVE: _local4 = [_local6]; while (true) { if (((!(_local6.parent)) || ((_local6.parent == _arg2.parent)))){ break; }; _local4.push(_local6.parent); _local6 = _local6.parent; }; break; }; exitCache[_local3] = _local4; return (_local4); } public function getEntry(_arg1:SimpleState, _arg2:SimpleState):Array{ var _local3:String = ((_arg1.name + "-->") + _arg2.name); var _local4:Array = entryCache[_local3]; if (_local4){ return (_local4); }; var _local5:String = _arg1.getTransitionLevel(_arg2); var _local6:SimpleState = _arg2; switch (_local5){ case TransitionLevel.TO_SELF: case TransitionLevel.TO_SIBLING: _local4 = [_local6]; break; case TransitionLevel.TO_ANCESTOR: case TransitionLevel.TO_IRRELATIVE: if ((_local6 is CompositeState)){ _local6 = ((CompositeState(_local6).initialChild) || (_local6)); }; _local4 = [_local6]; while (true) { if (((!(_local6.parent)) || ((_local6.parent == _arg2.parent)))){ break; }; _local4.push(_local6.parent); _local6 = _local6.parent; }; break; case TransitionLevel.TO_DESCENDANT: _local4 = []; while (_local6 != _arg1) { _local4.push(_local6); _local6 = _local6.parent; }; break; }; entryCache[_local3] = _local4; return (_local4); } public function dispose():void{ exitCache = {}; entryCache = {}; stackCache = {}; } } }//package com.bigwigmedia.statemachine.hsm
Section 54
//SignalEvent (com.bigwigmedia.statemachine.hsm.SignalEvent) package com.bigwigmedia.statemachine.hsm { public class SignalEvent extends AbstractEvent { public static const DO_ACTION:String = "SignalEvent.doAction"; public static const HSM_START:String = "SignalEvent.hsmStart"; public static const ON_STATE_COMPLETE:String = "SignalEvent.onStateComplete"; public function SignalEvent(_arg1:String, _arg2:Object=null){ super(_arg1, _arg2); } } }//package com.bigwigmedia.statemachine.hsm
Section 55
//SimpleState (com.bigwigmedia.statemachine.hsm.SimpleState) package com.bigwigmedia.statemachine.hsm { import flash.events.*; import com.bigwigmedia.statemachine.hsm.events.*; import com.bigwigmedia.core.*; import flash.utils.*; import com.bigwigmedia.statemachine.hsm.errors.*; import com.bigwigmedia.utils.*; public class SimpleState extends EventDispatcher implements IDisposable { protected var _doAction:Function;// = null protected var _entryAction:Function;// = null protected var _parent:CompositeState;// = null protected var _exitAction:Function;// = null protected var _timersHash:Object; protected var _active:Boolean;// = false private var _name:String; protected var _timers:Array; protected var _transitions:Array; public function SimpleState(_arg1:String, _arg2:Function=null, _arg3:Function=null, _arg4:Function=null){ _timersHash = {}; _timers = []; _transitions = []; super(); _name = _arg1; _entryAction = _arg2; _doAction = _arg3; _exitAction = _arg4; } private function onTimerHandler(_arg1:TimerEvent):void{ var _local2:String; if (!_active){ return; }; for (_local2 in _timersHash) { if (_timersHash[_local2] == _arg1.target){ dispatchEvent(new StateEvent(StateEvent.TIME, _local2)); break; }; }; } function get transitions():Array{ return (_transitions); } public function get active():Boolean{ return (_active); } public function invokeDoAction(_arg1:SignalEvent):void{ if (_doAction != null){ _doAction(_arg1); }; } public function getTransition(_arg1:String):Transition{ var _local4:AbstractEvent; var _local2:int = _transitions.length; var _local3:int; while (_local3 < _local2) { _local4 = _transitions[_local3].event; if (_local4.type == _arg1){ return (_transitions[_local3]); }; _local3++; }; return (null); } public function invokeExitAction(_arg1:SignalEvent):void{ if (_exitAction != null){ _exitAction(_arg1); }; } public function hasAncestor(_arg1:SimpleState):Boolean{ var _local2:SimpleState = _parent; while (_local2) { if (_local2 == _arg1){ return (true); }; _local2 = _local2.parent; }; return (false); } public function hasTransition(_arg1:Transition):Boolean{ var _local4:Transition; var _local2:int = _transitions.length; var _local3:int; while (_local3 < _local2) { _local4 = _transitions[_local3]; if ((((_local4.targetState == _arg1.targetState)) && ((_local4.event.type == _arg1.event.type)))){ return (true); }; _local3++; }; return (false); } function registerTransition(_arg1:Transition):void{ var _local3:Timer; if (hasTransition(_arg1)){ throw (new HSMError((("Transition " + _arg1.toString()) + " exists already"))); }; var _local2:TimeEvent = (_arg1.event as TimeEvent); if (_local2){ _local3 = new Timer(_local2.delay, 1); _timersHash[_local2.type] = _local3; _local3.addEventListener(TimerEvent.TIMER, onTimerHandler); }; _transitions.push(_arg1); } public function dispose():void{ var _local1:Timer; var _local2:IDisposable; if (_timersHash){ for each (_local1 in _timersHash) { _local1.reset(); _local1.removeEventListener(TimerEvent.TIMER, onTimerHandler); }; _timersHash = null; }; if (_transitions){ for each (_local2 in _transitions) { _local2.dispose(); }; _transitions = null; }; _entryAction = null; _doAction = null; _exitAction = null; } public function get name():String{ return (_name); } function setParent(_arg1:CompositeState):void{ if (_parent){ throw (new HSMError((((("State \"" + _name) + "\" already has parent \"") + _parent.name) + "\""))); }; _parent = _arg1; } public function invokeEntryAction(_arg1:SignalEvent):void{ if (_entryAction != null){ _entryAction(_arg1); }; } public function get parent():CompositeState{ return (_parent); } function deactivate():void{ var _local1:Timer; _active = false; for each (_local1 in _timersHash) { _local1.reset(); }; } public function getTransitionLevel(_arg1:SimpleState):String{ var _local2:String; if (this == _arg1){ _local2 = TransitionLevel.TO_SELF; } else { if (hasAncestor(_arg1)){ _local2 = TransitionLevel.TO_ANCESTOR; } else { if (_arg1.parent == parent){ if ((_arg1 is CompositeState)){ _local2 = (CompositeState(_arg1).initialChild) ? TransitionLevel.TO_IRRELATIVE : TransitionLevel.TO_SIBLING; } else { _local2 = TransitionLevel.TO_SIBLING; }; } else { _local2 = TransitionLevel.TO_IRRELATIVE; }; }; }; return (_local2); } function activate():void{ var _local1:Timer; for each (_local1 in _timersHash) { _local1.start(); }; _active = true; } override public function toString():String{ return (ObjectUtil.formatToString(this, "name", "active")); } } }//package com.bigwigmedia.statemachine.hsm
Section 56
//TimeEvent (com.bigwigmedia.statemachine.hsm.TimeEvent) package com.bigwigmedia.statemachine.hsm { import com.bigwigmedia.utils.*; public class TimeEvent extends AbstractEvent { private var _delay:Number; public function TimeEvent(_arg1:String, _arg2:Number){ super(_arg1); _delay = _arg2; } public function get delay():Number{ return (_delay); } override public function toString():String{ return (ObjectUtil.formatToString(this, "type", "delay")); } } }//package com.bigwigmedia.statemachine.hsm
Section 57
//Transition (com.bigwigmedia.statemachine.hsm.Transition) package com.bigwigmedia.statemachine.hsm { import com.bigwigmedia.core.*; import com.bigwigmedia.utils.*; public class Transition implements IDisposable { private var _targetState:SimpleState; private var _effect:Function; private var _guardCondition:Function; private var _event:AbstractEvent; public function Transition(_arg1:SimpleState, _arg2:AbstractEvent, _arg3:Function, _arg4:Function):void{ _event = _arg2; _targetState = _arg1; _effect = _arg3; _guardCondition = _arg4; } public function get targetState():SimpleState{ return (_targetState); } public function invokeEffect(_arg1:SignalEvent):void{ if (_effect != null){ _effect(_arg1); }; } public function toString():String{ return (ObjectUtil.formatToString(this, "targetState", "event")); } public function get event():AbstractEvent{ return (_event); } public function checkGuardCondition():Boolean{ if (_guardCondition == null){ return (true); }; return (_guardCondition()); } public function dispose():void{ _event = null; _targetState = null; _guardCondition = null; _effect = null; } } }//package com.bigwigmedia.statemachine.hsm
Section 58
//TransitionLevel (com.bigwigmedia.statemachine.hsm.TransitionLevel) package com.bigwigmedia.statemachine.hsm { public class TransitionLevel { public static const TO_SELF:String = "to_self"; public static const TO_DESCENDANT:String = "to_descendant"; public static const TO_ANCESTOR:String = "to_ancestor"; public static const TO_IRRELATIVE:String = "to_irrelative"; public static const TO_SIBLING:String = "to_sibling"; } }//package com.bigwigmedia.statemachine.hsm
Section 59
//AbstractBox (com.bigwigmedia.ui.containers.AbstractBox) package com.bigwigmedia.ui.containers { import flash.display.*; import com.bigwigmedia.ui.*; public class AbstractBox extends LayoutContainer { protected var _gap:Number;// = 0 protected var _autoSize:Boolean;// = true public function get autoSize():Boolean{ return (_autoSize); } public function set autoSize(_arg1:Boolean):void{ _autoSize = _arg1; invalidate(InvalidationType.LAYOUT); invalidate(InvalidationType.SIZE); } protected function get maxChildHeight():Number{ var _local2:DisplayObject; var _local1:Number = 0; for each (_local2 in _layoutChildren) { if (_local2.height > _local1){ _local1 = _local2.height; }; }; return (_local1); } public function get gap():Number{ return (_gap); } public function set gap(_arg1:Number):void{ _gap = _arg1; invalidate(InvalidationType.LAYOUT); invalidate(InvalidationType.SIZE); } protected function get maxChildWidth():Number{ var _local2:DisplayObject; var _local1:Number = 0; for each (_local2 in _layoutChildren) { if (_local2.width > _local1){ _local1 = _local2.width; }; }; return (_local1); } } }//package com.bigwigmedia.ui.containers
Section 60
//HBox (com.bigwigmedia.ui.containers.HBox) package com.bigwigmedia.ui.containers { import flash.display.*; import com.bigwigmedia.ui.*; public class HBox extends AbstractBox { override protected function drawLayout():void{ var _local4:DisplayObject; var _local5:PositionConstraint; if (_autoSize){ this.height = maxChildHeight; }; var _local1:Number = 0; var _local2:int = _layoutChildren.length; var _local3:int; while (_local3 < _local2) { _local4 = _layoutChildren[_local3]; _local5 = _childToPosConstraint[_local4]; if (_local5){ _local5.apply(_local4); }; _local4.x = _local1; if (_local3 < (_local2 - 1)){ _local1 = (_local1 + (_local4.width + _gap)); } else { _local1 = (_local1 + _local4.width); }; _local3++; }; this.width = _local1; } } }//package com.bigwigmedia.ui.containers
Section 61
//LayoutContainer (com.bigwigmedia.ui.containers.LayoutContainer) package com.bigwigmedia.ui.containers { import flash.display.*; import com.bigwigmedia.ui.*; import flash.geom.*; import com.bigwigmedia.events.*; import flash.utils.*; import com.bigwigmedia.utils.*; public class LayoutContainer extends AbstractComponent { protected var _explicitWidth:Number;// = 100 private var rendering:Boolean;// = false protected var _childToSizeConstraint:Dictionary; protected var _explicitHeight:Number;// = 100 protected var _maxWidth:Number;// = 1.79769313486232E308 protected var _layoutChildren:Array; protected var _minHeight:Number;// = 0 protected var _maxHeight:Number;// = 1.79769313486232E308 protected var _minWidth:Number;// = 0 protected var _components:Object; protected var _childToPosConstraint:Dictionary; public function LayoutContainer(){ _components = {}; _layoutChildren = []; _childToPosConstraint = new Dictionary(); _childToSizeConstraint = new Dictionary(); super(); } public function getComponentById(_arg1:String):AbstractComponent{ if (!_components[_arg1]){ throw (new ArgumentError((("Container doesn't have child component with id=\"" + _arg1) + "\""))); }; return (_components[_arg1]); } public function set minHeight(_arg1:Number):void{ _minHeight = _arg1; setSize(_explicitWidth, _explicitHeight); } override public function setSize(_arg1:Number, _arg2:Number):void{ var _local3:Number = Math.round(_arg1); var _local4:Number = Math.round(_arg2); if (_local3 < _minWidth){ _local3 = _minWidth; } else { if (_local3 > _maxWidth){ _local3 = _maxWidth; }; }; if (_local4 < _minHeight){ _local4 = _minHeight; } else { if (_local4 > _maxHeight){ _local4 = _maxHeight; }; }; var _local5:Boolean; if (!MathUtil.nearEquals(_explicitWidth, _local3)){ _explicitWidth = _local3; _local5 = true; }; if (!MathUtil.nearEquals(_explicitHeight, _local4)){ _explicitHeight = _local4; _local5 = true; }; if (_local5){ invalidate(InvalidationType.LAYOUT); invalidate(InvalidationType.SIZE); }; } override protected function draw():void{ if (rendering){ return; }; rendering = true; if (isInvalid(InvalidationType.LAYOUT)){ drawLayout(); }; super.draw(); rendering = false; } override public function get width():Number{ return (_explicitWidth); } public function addChildToLayoutAt(_arg1:DisplayObject, _arg2:int, _arg3:Object=null):DisplayObject{ var _local4:PositionConstraint = new PositionConstraint(); mapConstraintProperty(_arg3, _local4); if (!_local4.isEmpty()){ _childToPosConstraint[_arg1] = _local4; }; var _local5:SizeConstraint = new SizeConstraint(); mapConstraintProperty(_arg3, _local5); if (!_local5.isEmpty()){ _childToSizeConstraint[_arg1] = _local5; }; _layoutChildren.splice(_arg2, 0, _arg1); invalidate(InvalidationType.LAYOUT); return (addChildAt(_arg1, _arg2)); } override public function set enabled(_arg1:Boolean):void{ var _local2:AbstractComponent; for each (_local2 in _components) { _local2.enabled = _arg1; }; } override public function addChild(_arg1:DisplayObject):DisplayObject{ return (addChildAt(_arg1, numChildren)); } public function get maxHeight():Number{ return (_maxHeight); } override public function set height(_arg1:Number):void{ setSize(_explicitWidth, _arg1); } public function get maxWidth():Number{ return (_maxWidth); } override public function removeChildAt(_arg1:int):DisplayObject{ var _local2:AbstractComponent = (getChildAt(_arg1) as AbstractComponent); if (((_local2) && (_components[_local2.id]))){ delete _components[_local2.id]; invalidate(InvalidationType.LAYOUT); }; var _local3:DisplayObject = getChildAt(_arg1); _local3.removeEventListener(ComponentEvent.RESIZE, onComponentEventHandler); _local3.removeEventListener(ComponentEvent.MOVE, onComponentEventHandler); delete _childToPosConstraint[_local3]; delete _childToSizeConstraint[_local3]; var _local4:int = _layoutChildren.indexOf(_local3); if (_local4 != -1){ _layoutChildren.splice(_local4, 1); }; return (super.removeChildAt(_arg1)); } override public function set width(_arg1:Number):void{ setSize(_arg1, _explicitHeight); } private function onComponentEventHandler(_arg1:ComponentEvent):void{ invalidate(InvalidationType.LAYOUT); draw(); } protected function drawLayout():void{ var _local1:DisplayObject; var _local2:SizeConstraint; var _local3:PositionConstraint; for each (_local1 in _layoutChildren) { _local2 = _childToSizeConstraint[_local1]; if (_local2){ _local2.apply(_local1); }; _local3 = _childToPosConstraint[_local1]; if (_local3){ _local3.apply(_local1); }; }; } public function get minHeight():Number{ return (_minHeight); } public function get minWidth():Number{ return (_minWidth); } public function set maxWidth(_arg1:Number):void{ _maxWidth = _arg1; setSize(_explicitWidth, _explicitHeight); } override public function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject{ var _local3:AbstractComponent = (_arg1 as AbstractComponent); if (((_local3) && (!(_components[_local3.id])))){ _components[_local3.id] = _local3; invalidate(InvalidationType.LAYOUT); }; _arg1.addEventListener(ComponentEvent.RESIZE, onComponentEventHandler); _arg1.addEventListener(ComponentEvent.MOVE, onComponentEventHandler); return (super.addChildAt(_arg1, _arg2)); } public function addChildToLayout(_arg1:DisplayObject, _arg2:Object=null):DisplayObject{ return (addChildToLayoutAt(_arg1, numChildren, _arg2)); } public function set maxHeight(_arg1:Number):void{ _maxHeight = _arg1; setSize(_explicitWidth, _explicitHeight); } override public function get height():Number{ return (_explicitHeight); } override public function getBounds(_arg1:DisplayObject):Rectangle{ return (new Rectangle(x, y, _explicitWidth, _explicitHeight)); } override public function dispose():void{ var _local1:AbstractComponent; var _local2:DisplayObject; for each (_local1 in _components) { _local1.dispose(); }; _components = {}; for each (_local2 in _layoutChildren) { _local2.removeEventListener(ComponentEvent.RESIZE, onComponentEventHandler); _local2.removeEventListener(ComponentEvent.MOVE, onComponentEventHandler); }; _layoutChildren = []; _childToPosConstraint = new Dictionary(); _childToSizeConstraint = new Dictionary(); super.dispose(); } public function set minWidth(_arg1:Number):void{ _minWidth = _arg1; setSize(_explicitWidth, _explicitHeight); } private function mapConstraintProperty(_arg1:Object, _arg2:Object):void{ var _local3:String; if (!_arg1){ return; }; for (_local3 in _arg1) { if ((_local3 in _arg2)){ _arg2[_local3] = _arg1[_local3]; }; }; } override public function removeChild(_arg1:DisplayObject):DisplayObject{ var _local2:int = this.getChildIndex(_arg1); return (removeChildAt(_local2)); } } }//package com.bigwigmedia.ui.containers
Section 62
//VBox (com.bigwigmedia.ui.containers.VBox) package com.bigwigmedia.ui.containers { import flash.display.*; import com.bigwigmedia.ui.*; public class VBox extends AbstractBox { override protected function drawLayout():void{ var _local4:DisplayObject; var _local5:PositionConstraint; if (_autoSize){ this.width = maxChildWidth; }; var _local1:Number = 0; var _local2:int = _layoutChildren.length; var _local3:int; while (_local3 < _local2) { _local4 = _layoutChildren[_local3]; _local5 = _childToPosConstraint[_local4]; if (_local5){ _local5.apply(_local4); }; _local4.y = _local1; if (_local3 < (_local2 - 1)){ _local1 = (_local1 + (_local4.height + _gap)); } else { _local1 = (_local1 + _local4.height); }; _local3++; }; this.height = _local1; } } }//package com.bigwigmedia.ui.containers
Section 63
//AbstractButtonStyle (com.bigwigmedia.ui.styles.AbstractButtonStyle) package com.bigwigmedia.ui.styles { public class AbstractButtonStyle { public static const ROLL_OVER_HANDLER:String = "rollOverHandler"; public static const ROLL_OUT_HANDLER:String = "rollOutHandler"; public static const MOUSE_DOWN_HANDLER:String = "mouseDownHandler"; } }//package com.bigwigmedia.ui.styles
Section 64
//AbstractComponentStyle (com.bigwigmedia.ui.styles.AbstractComponentStyle) package com.bigwigmedia.ui.styles { public class AbstractComponentStyle { public static const DECORATION:String = "decoration"; public static const DISABLED_DECORATION:String = "disabledDecoration"; public static const TEXT_FORMAT:String = "textFormat"; public static const EMBED_FONTS:String = "embedFonts"; } }//package com.bigwigmedia.ui.styles
Section 65
//CheckBoxStyle (com.bigwigmedia.ui.styles.CheckBoxStyle) package com.bigwigmedia.ui.styles { public class CheckBoxStyle { public static const ICON:String = "icon"; public static const SELECTED_ICON:String = "selectedIcon"; public static const TEXT_PADDING:String = "textPadding"; } }//package com.bigwigmedia.ui.styles
Section 66
//DecoratedIconicButtonStyle (com.bigwigmedia.ui.styles.DecoratedIconicButtonStyle) package com.bigwigmedia.ui.styles { public class DecoratedIconicButtonStyle { public static const UP_DECORATION:String = "upDecoration"; public static const OVER_DECORATION:String = "overDecoration"; public static const DOWN_DECORATION:String = "downDecoration"; } }//package com.bigwigmedia.ui.styles
Section 67
//HSliderStyle (com.bigwigmedia.ui.styles.HSliderStyle) package com.bigwigmedia.ui.styles { public class HSliderStyle { public static const TRACK_SKIN:String = "HSliderTrackSkin"; public static const THUMB:String = "HSliderThumb"; } }//package com.bigwigmedia.ui.styles
Section 68
//LabelButtonStyle (com.bigwigmedia.ui.styles.LabelButtonStyle) package com.bigwigmedia.ui.styles { public class LabelButtonStyle { public static const UP_STATE_COLOR:String = "upStateColor"; public static const DOWN_STATE_COLOR:String = "downStateColor"; public static const OVER_STATE_COLOR:String = "overStateColor"; } }//package com.bigwigmedia.ui.styles
Section 69
//VSliderStyle (com.bigwigmedia.ui.styles.VSliderStyle) package com.bigwigmedia.ui.styles { public class VSliderStyle { public static const TRACK_SKIN:String = "VSliderTrackSkin"; public static const THUMB:String = "VSliderThumb"; } }//package com.bigwigmedia.ui.styles
Section 70
//AbstractButton (com.bigwigmedia.ui.AbstractButton) package com.bigwigmedia.ui { import flash.display.*; import flash.events.*; import com.bigwigmedia.effects.*; import com.bigwigmedia.ui.styles.*; public class AbstractButton extends AbstractComponent { protected var _state:String; private var _beacon:IBeacon; public function AbstractButton(){ _state = ButtonState.UP; super(); buttonMode = true; mouseChildren = false; tabEnabled = false; addEventListener(MouseEvent.MOUSE_UP, onMouseEventHandler); addEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); addEventListener(MouseEvent.ROLL_OVER, onMouseEventHandler); addEventListener(MouseEvent.ROLL_OUT, onMouseEventHandler); } public function get state():String{ return (_state); } protected function get beaconTarget():DisplayObject{ return (this); } private function onMouseEventHandler(_arg1:MouseEvent):void{ var _local2:Function; var _local3:Function; var _local4:Function; switch (_arg1.type){ case MouseEvent.ROLL_OUT: _local2 = (getStyle(AbstractButtonStyle.ROLL_OUT_HANDLER) as Function); if (_local2 != null){ _local2(this); }; _state = ButtonState.UP; break; case MouseEvent.MOUSE_DOWN: _local3 = (getStyle(AbstractButtonStyle.MOUSE_DOWN_HANDLER) as Function); if (_local3 != null){ _local3(this); }; _state = ButtonState.DOWN; break; case MouseEvent.MOUSE_UP: if (_state == ButtonState.DOWN){ _state = ButtonState.OVER; } else { return; }; break; case MouseEvent.ROLL_OVER: _local4 = (getStyle(AbstractButtonStyle.ROLL_OVER_HANDLER) as Function); if (_local4 != null){ _local4(this); }; _state = ButtonState.OVER; break; }; invalidate(InvalidationType.STATE); } public function set beacon(_arg1:IBeacon):void{ if (_arg1 === null){ if (_beacon){ _beacon.dispose(); _beacon = null; }; } else { _beacon = _arg1; _beacon.apply(beaconTarget); }; } override public function set enabled(_arg1:Boolean):void{ super.enabled = _arg1; _state = ButtonState.UP; invalidate(InvalidationType.STATE); } override public function dispose():void{ removeEventListener(MouseEvent.MOUSE_UP, onMouseEventHandler); removeEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); removeEventListener(MouseEvent.ROLL_OVER, onMouseEventHandler); removeEventListener(MouseEvent.ROLL_OUT, onMouseEventHandler); beacon = null; super.dispose(); } public static function get defaultStyles():Object{ var _local1:Object = {rollOverHandler:null, rollOutHandler:null, mouseDownHandler:null}; return (_local1); } } }//package com.bigwigmedia.ui
Section 71
//AbstractComponent (com.bigwigmedia.ui.AbstractComponent) package com.bigwigmedia.ui { import flash.display.*; import flash.events.*; import flash.geom.*; import com.bigwigmedia.events.*; import flash.text.*; import com.bigwigmedia.core.*; import com.bigwigmedia.display.*; import com.bigwigmedia.utils.*; import com.bigwigmedia.ui.styles.*; public class AbstractComponent extends Sprite implements IDisposable { bigwigmedia_ns var _id:String; protected var _enabled:Boolean;// = true protected var _sharedStyles:Object; protected var invalidHash:Object; private var decoration:IDecoration; protected var _instanceStyles:Object; protected var _visible:Boolean;// = true private static var idCount:int = 0; public function AbstractComponent(){ _instanceStyles = {}; _sharedStyles = {}; invalidHash = {}; super(); super.visible = false; bigwigmedia_ns::_id = ((NameUtil.getClassName(this) + "_") + String(AbstractComponent.idCount++)); IStyleManager(Singleton.getInstance("com.bigwigmedia.ui::IStyleManager")).registerComponent(this); createChildren(); invalidate(); } public function setSize(_arg1:Number, _arg2:Number):void{ } public function get enabled():Boolean{ return (_enabled); } public function set enabled(_arg1:Boolean):void{ _enabled = _arg1; mouseEnabled = _arg1; invalidate(InvalidationType.STATE); } protected function draw():void{ var _local1:Boolean; var _local2:Number = this.width; var _local3:Number = this.height; if (isInvalid(InvalidationType.STYLES)){ drawStyles(); decoration = (getStyle(AbstractComponentStyle.DECORATION) as IDecoration); if (decoration){ decoration.apply(this); }; }; if (isInvalid(InvalidationType.STATE)){ drawState(); }; if (isInvalid(InvalidationType.SIZE)){ _local1 = true; } else { if (((!(MathUtil.nearEquals(_local2, this.width))) || (!(MathUtil.nearEquals(_local3, this.height))))){ _local1 = true; }; }; validate(); if (_local1){ dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE)); }; if (_visible){ visible = true; }; } protected function drawStyles():void{ } override public function set height(_arg1:Number):void{ } bigwigmedia_ns function setSharedStyle(_arg1:String, _arg2:Object):void{ _sharedStyles[_arg1] = _arg2; invalidate(); } bigwigmedia_ns function get $height():Number{ return (super.height); } public function getStyle(_arg1:String):Object{ var _local2:Object = (_instanceStyles.hasOwnProperty(_arg1)) ? _instanceStyles[_arg1] : _sharedStyles[_arg1]; if ((_local2 is TextFormat)){ return (TextFormatUtil.clone((_local2 as TextFormat))); }; return (_local2); } public function set scale(_arg1:Number):void{ this.scaleX = (this.scaleY = _arg1); } protected function validate():void{ invalidHash = {}; } public function move(_arg1:Number, _arg2:Number):void{ var _local3:Number = Math.round(_arg1); var _local4:Number = Math.round(_arg2); var _local5:Boolean; if (!MathUtil.nearEquals(super.x, _local3)){ super.x = _local3; _local5 = true; }; if (!MathUtil.nearEquals(super.y, _local4)){ super.y = _local4; _local5 = true; }; if (_local5){ dispatchEvent(new ComponentEvent(ComponentEvent.MOVE)); }; } protected function createChildren():void{ } bigwigmedia_ns function set $width(_arg1:Number):void{ super.width = _arg1; } bigwigmedia_ns function set $height(_arg1:Number):void{ super.height = _arg1; } override public function get width():Number{ return (super.width); } override public function get visible():Boolean{ return (_visible); } bigwigmedia_ns function get $width():Number{ return (super.width); } public function dispose():void{ removeEventListener(Event.ENTER_FRAME, invalidateOnNextFrame); invalidHash = {}; IStyleManager(Singleton.getInstance("com.bigwigmedia.ui::IStyleManager")).unregisterComponent(this); if (decoration){ decoration.remove(this); decoration = null; }; _instanceStyles = {}; _sharedStyles = {}; } override public function set visible(_arg1:Boolean):void{ _visible = _arg1; super.visible = _arg1; } private function invalidateOnNextFrame(_arg1:Event):void{ removeEventListener(Event.ENTER_FRAME, invalidateOnNextFrame); draw(); } public function get id():String{ return (bigwigmedia_ns::_id); } override public function getBounds(_arg1:DisplayObject):Rectangle{ if (_arg1){ return (super.getBounds(_arg1)); }; return (new Rectangle(x, y, width, height)); } protected function drawState():void{ var _local1:IDecoration = (getStyle(AbstractComponentStyle.DISABLED_DECORATION) as IDecoration); if (_local1){ if (_enabled){ _local1.remove(this); } else { _local1.apply(this); }; }; } override public function set width(_arg1:Number):void{ } public function setStyle(_arg1:String, _arg2:Object):void{ if (_arg2 === null){ delete _instanceStyles[_arg1]; }; _instanceStyles[_arg1] = _arg2; invalidate(); } public function drawNow():void{ removeEventListener(Event.ENTER_FRAME, invalidateOnNextFrame); draw(); } override public function set x(_arg1:Number):void{ move(_arg1, super.y); } override public function set y(_arg1:Number):void{ move(super.x, _arg1); } protected function invalidate(_arg1:String="all"):void{ invalidHash[_arg1] = true; addEventListener(Event.ENTER_FRAME, invalidateOnNextFrame); } public function isInvalid(_arg1:String=null):Boolean{ if (!_arg1){ return (ObjectUtil.hasProperties(invalidHash)); }; return (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))); } override public function get height():Number{ return (super.height); } public static function get defaultStyles():Object{ var _local1:Object = {textFormat:new TextFormat(), embedFonts:false, disabledDecoration:null, decoration:null}; return (_local1); } } }//package com.bigwigmedia.ui
Section 72
//AbstractSlider (com.bigwigmedia.ui.AbstractSlider) package com.bigwigmedia.ui { import flash.display.*; import flash.events.*; import com.bigwigmedia.events.*; import com.bigwigmedia.ui.containers.*; import flash.utils.*; import com.bigwigmedia.ui.styles.*; import com.bigwigmedia.application.*; public class AbstractSlider extends LayoutContainer { private var _track:DisplayObject; protected var _minimum:int;// = 0 private var _drag:Boolean;// = false protected var _thumb:AbstractButton; protected var _maximum:int;// = 100 protected var _value:int;// = 0 private var isHorizontal:Boolean; protected var _thumbClickDisp:Number;// = 0 public function AbstractSlider(_arg1:Boolean){ this.isHorizontal = _arg1; super(); } public function set maximum(_arg1:int):void{ _maximum = _arg1; invalidate(InvalidationType.STATE); } override protected function draw():void{ moveKnob(); super.draw(); } override protected function drawStyles():void{ var _local1:Class = Class(getStyle((isHorizontal) ? HSliderStyle.TRACK_SKIN : VSliderStyle.TRACK_SKIN)); if (getQualifiedClassName(_local1) != getQualifiedClassName(_track)){ if (_track){ removeChild(_track); }; _track = new (_local1); _track.width = _explicitWidth; addChildAt(_track, 0); }; var _local2:Class = Class(getStyle((isHorizontal) ? HSliderStyle.THUMB : VSliderStyle.THUMB)); if (getQualifiedClassName(_local2) != getQualifiedClassName(_thumb)){ removeThumb(); _thumb = new (_local2); addChild(_thumb); _thumb.addEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); }; } protected function mouseMoved():void{ } override protected function createChildren():void{ var _local2:Class; if (!_thumb){ _local2 = Class(getStyle((isHorizontal) ? HSliderStyle.THUMB : VSliderStyle.THUMB)); _thumb = new (_local2); addChild(_thumb); _thumb.addEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); }; var _local1:Stage = ApplicationGlobals.application.stage; _local1.addEventListener(MouseEvent.MOUSE_UP, onMouseEventHandler); _local1.addEventListener(MouseEvent.MOUSE_MOVE, onMouseEventHandler); } public function set minimum(_arg1:int):void{ _minimum = _arg1; invalidate(InvalidationType.STATE); } override public function dispose():void{ var _local1:Stage = ApplicationGlobals.application.stage; _local1.removeEventListener(MouseEvent.MOUSE_UP, onMouseEventHandler); _local1.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseEventHandler); removeThumb(); super.dispose(); } public function set value(_arg1:int):void{ _value = _arg1; draw(); } protected function moveKnob():void{ if (("label" in _thumb)){ _thumb["label"] = String(_value); }; } public function get value():int{ return (_value); } private function onMouseEventHandler(_arg1:MouseEvent):void{ switch (_arg1.type){ case MouseEvent.MOUSE_UP: if (_drag){ _drag = false; dispatchEvent(new SliderEvent(SliderEvent.KNOB_RELEASE, _value, true)); }; break; case MouseEvent.MOUSE_DOWN: _drag = true; _thumbClickDisp = (isHorizontal) ? _thumb.mouseX : _thumb.mouseY; moveKnob(); dispatchEvent(new SliderEvent(SliderEvent.KNOB_PRESS, _value, true)); break; case MouseEvent.MOUSE_MOVE: if (_drag){ mouseMoved(); }; break; }; } private function removeThumb():void{ if (_thumb){ _thumb.dispose(); _thumb.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); removeChild(_thumb); _thumb = null; }; } public static function get defaultStyles():Object{ var _local1:Object = {HSliderTrackSkin:Shape, HSliderThumb:LabelButton, VSliderTrackSkin:Shape, VSliderThumb:LabelButton}; return (_local1); } } }//package com.bigwigmedia.ui
Section 73
//ButtonState (com.bigwigmedia.ui.ButtonState) package com.bigwigmedia.ui { public class ButtonState { public static const DOWN:String = "down"; public static const OVER:String = "over"; public static const UP:String = "up"; } }//package com.bigwigmedia.ui
Section 74
//CheckBox (com.bigwigmedia.ui.CheckBox) package com.bigwigmedia.ui { import flash.display.*; import flash.events.*; import flash.geom.*; import com.bigwigmedia.events.*; import flash.utils.*; import com.bigwigmedia.ui.styles.*; public class CheckBox extends LabelButton { protected var _icon:DisplayObject; protected var _selected:Boolean;// = false public function CheckBox(){ addEventListener(MouseEvent.CLICK, onClickHandler, false, EventPriority.HIGH); } private function onClickHandler(_arg1:MouseEvent):void{ selected = !(selected); } public function set selected(_arg1:Boolean):void{ if (_selected != _arg1){ _selected = _arg1; invalidate(); dispatchEvent(new ComponentEvent(ComponentEvent.CHANGE, true)); }; } public function get selected():Boolean{ return (_selected); } override protected function drawState():void{ var _local1:Class = Class(getStyle((_selected) ? CheckBoxStyle.SELECTED_ICON : CheckBoxStyle.ICON)); if (getQualifiedClassName(_local1) != getQualifiedClassName(_icon)){ if (_icon){ removeChild(_icon); }; _icon = new (_local1); addChild(_icon); }; var _local2:Rectangle = _icon.getBounds(this); _icon.x = (_icon.x - _local2.left); _icon.y = ((_labelField.height - _local2.height) / 2); _labelField.x = ((_local2.right + getStyle(CheckBoxStyle.TEXT_PADDING)) as Number); super.drawState(); } override public function dispose():void{ removeEventListener(MouseEvent.CLICK, onClickHandler, false); removeChild(_icon); _icon = null; super.dispose(); } public static function get defaultStyles():Object{ var _local1:Object = {icon:Shape, selectedIcon:Shape, textPadding:4}; return (_local1); } } }//package com.bigwigmedia.ui
Section 75
//Console (com.bigwigmedia.ui.Console) package com.bigwigmedia.ui { import flash.display.*; import com.bigwigmedia.application.*; import flash.events.*; import com.bigwigmedia.events.*; import com.bigwigmedia.input.*; public class Console { private static var _active:Boolean = false; private static var _stage:Stage; private static var keyInputMan:KeyInputManager; private static var toggleKeyCode:uint; private static var _console:ConsoleView; private static function onKeyDownHandler(_arg1:KeyboardEvent):void{ if (toggleKeyCode > 0){ if (_arg1.keyCode == toggleKeyCode){ toggle(); }; }; } private static function onKeySequenceHandler(_arg1:KeyInputEvent):void{ if (_arg1.keyAction == "toggle_console"){ toggle(); }; } private static function toggle():void{ _active = !(_active); if (_active){ _stage.addChild(_console); _stage.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler); } else { _stage.removeChild(_console); _stage.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); }; } private static function onEnterFrameHandler(_arg1:Event):void{ _console.update(); } public static function initialize(_arg1:Array=null):void{ _console = new ConsoleView(); _stage = ApplicationGlobals.application.stage; if (!_arg1){ toggleKeyCode = 67; _stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler); } else { if (_arg1.length == 1){ toggleKeyCode = _arg1[0]; _stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler); } else { keyInputMan = new KeyInputManager(_stage); keyInputMan.mapSequence("toggle_console", _arg1); keyInputMan.addEventListener(KeyInputEvent.SEQUENCE, onKeySequenceHandler); }; }; } } }//package com.bigwigmedia.ui import flash.display.*; import com.bigwigmedia.application.*; import flash.events.*; import flash.utils.*; import com.bigwigmedia.core.*; import flash.text.*; import flash.system.*; class ConsoleView extends Sprite implements IUpdatable { private var maxMemory:int; private var infoField:TextField; private var viewMode:int;// = 0 private var tfDelay:int;// = 0 private var minMemory:int; private var firstDraw:Boolean;// = true private var tfTimer:int; public static const CURRENT_ONLY:int = 1; public static const UPDATE_DELAY:int = 10; public static const INFO:int = 2; public static const FULL:int = 0; private function ConsoleView(){ infoField = new TextField(); infoField.defaultTextFormat = new TextFormat("_sans", 10); infoField.autoSize = TextFieldAutoSize.LEFT; infoField.selectable = false; infoField.x = 1; infoField.y = 0; infoField.multiline = true; addChild(infoField); this.mouseChildren = false; addEventListener(MouseEvent.CLICK, onMouseClickHandler); minMemory = (maxMemory = System.totalMemory); tfTimer = getTimer(); draw(); } private function draw():void{ var _local1:ApplicationInfo; graphics.clear(); graphics.lineStyle(0, 0, 1, true); graphics.beginFill(0x666666, 1); switch (viewMode){ case ConsoleView.FULL: graphics.drawRect(0, 0, 80, 56); infoField.htmlText = ""; break; case ConsoleView.CURRENT_ONLY: graphics.drawRect(0, 0, 80, 30); infoField.htmlText = ""; break; case ConsoleView.INFO: _local1 = ApplicationGlobals.application.info; infoField.htmlText = (((((((((((((("<font color='#FFFFFF'>" + "APP: ") + _local1.name) + "\nID: ") + _local1.id) + "\nVER: ") + _local1.version) + "\nFP: ") + Capabilities.version) + " ") + Capabilities.playerType) + (Capabilities.isDebugger) ? " DEBUG" : " RELEASE") + "\nSANDBOX: ") + Security.sandboxType) + "</font>"); graphics.drawRect(0, 0, (infoField.width + 4), 68); break; }; graphics.endFill(); } public function update():void{ var _local1:int; var _local2:Number; if (++tfDelay >= UPDATE_DELAY){ tfDelay = 0; _local1 = System.totalMemory; if (_local1 > maxMemory){ maxMemory = _local1; }; if (_local1 < minMemory){ minMemory = _local1; }; _local2 = ((1000 * UPDATE_DELAY) / (getTimer() - tfTimer)); tfTimer = getTimer(); switch (viewMode){ case ConsoleView.FULL: infoField.htmlText = ((((((((((("<font color='#FFFFFF'>FPS: " + _local2.toFixed(2)) + "</font>\n") + "<font color='#9FCFFF'>MEM: ") + bytesToString(_local1)) + "</font>\n") + "<font color='#FFCC00'>MAX: ") + bytesToString(maxMemory)) + "</font>\n") + "<font color='#00FF00'>MIN: ") + bytesToString(minMemory)) + "</font>"); break; case ConsoleView.CURRENT_ONLY: infoField.htmlText = ((((("<font color='#FFFFFF'>FPS: " + _local2.toFixed(2)) + "</font>\n") + "<font color='#9FCFFF'>MEM: ") + bytesToString(_local1)) + "</font>"); break; }; }; } private function onMouseClickHandler(_arg1:MouseEvent):void{ viewMode++; if (viewMode > ConsoleView.INFO){ viewMode = ConsoleView.FULL; }; draw(); } private function bytesToString(_arg1:uint):String{ var _local2:String; if (_arg1 < 0x0400){ _local2 = (String(_arg1) + "b"); } else { if (_arg1 < 0x2800){ _local2 = (Number((_arg1 / 0x0400)).toFixed(2) + "kb"); } else { if (_arg1 < 102400){ _local2 = (Number((_arg1 / 0x0400)).toFixed(1) + "kb"); } else { if (_arg1 < 0x100000){ _local2 = ((_arg1 >> 10) + "kb"); } else { if (_arg1 < 0xA00000){ _local2 = (Number((_arg1 / 0x100000)).toFixed(2) + "mb"); } else { if (_arg1 < 104857600){ _local2 = (Number((_arg1 / 0x100000)).toFixed(1) + "mb"); } else { _local2 = ((_arg1 >> 20) + "mb"); }; }; }; }; }; }; return (_local2); } }
Section 76
//ContextMenu_2DPlay (com.bigwigmedia.ui.ContextMenu_2DPlay) package com.bigwigmedia.ui { import flash.events.*; import flash.ui.*; import com.bigwigmedia.core.*; import com.bigwigmedia.net.*; public class ContextMenu_2DPlay { private static var moreGamesItem:ContextMenuItem = new ContextMenuItem("Play more games"); private static var getGameItem:ContextMenuItem = new ContextMenuItem("Get game for your site"); private static var scoresItem:ContextMenuItem = new ContextMenuItem("High scores"); private static var downloadItem:ContextMenuItem = new ContextMenuItem("Download this game"); private static var menu:ContextMenu; private static function onMenuItemSelect(_arg1:ContextMenuEvent):void{ var _local2:IURLCaller = IURLCaller(Singleton.getInstance("com.bigwigmedia.net::IURLCaller")); switch (_arg1.target){ case scoresItem: _local2.viewScores(); break; case moreGamesItem: _local2.playMoreGames(); break; case getGameItem: _local2.getGame(); break; case downloadItem: _local2.downloadGame(); break; }; } public static function getEmptyMenu():ContextMenu{ var _local1:ContextMenu = new ContextMenu(); _local1.hideBuiltInItems(); return (_local1); } public static function getMenu():ContextMenu{ Singleton.registerClass("com.bigwigmedia.net::IURLCaller", URLCaller_2DPlay); if (!menu){ menu = getEmptyMenu(); scoresItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect); moreGamesItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect); getGameItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect); downloadItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect); menu.customItems.push(scoresItem); menu.customItems.push(moreGamesItem); menu.customItems.push(getGameItem); menu.customItems.push(downloadItem); }; return (menu); } } }//package com.bigwigmedia.ui
Section 77
//CursorManager (com.bigwigmedia.ui.CursorManager) package com.bigwigmedia.ui { import flash.display.*; import flash.events.*; import flash.text.*; import com.bigwigmedia.core.*; import com.bigwigmedia.application.*; import flash.errors.*; import flash.ui.*; public class CursorManager implements ICursorManager { private var cursorLeftStage:Boolean; private var nextCursorID:int;// = 1 private var _currentCursorID:int;// = 0 private var cursorQueue:Array; private var cursorHolder:Sprite; private var _currentCursor:DisplayObject; private var stage:Stage; bigwigmedia_ns static var singletonAccessor:Boolean = true; public function CursorManager(){ cursorQueue = []; super(); if (!bigwigmedia_ns::singletonAccessor){ throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of CursorManager.")); }; stage = ApplicationGlobals.application.stage; cursorHolder = ApplicationGlobals.application.cursorHolder; } public function get currentCursor():DisplayObject{ return (_currentCursor); } public function removeCursor(_arg1:int):void{ var _local2:int = cursorQueue.length; var _local3:int; while (_local3 < _local2) { if (cursorQueue[_local3].cursorID == _arg1){ cursorQueue.splice(_local3, 1); showCurrentCursor(); break; }; _local3++; }; } public function get currentCursorID():int{ return (_currentCursorID); } private function removeCustomEventHandlers():void{ stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler, true); stage.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler, true); var _local1:ContextMenu = InteractiveObject(ApplicationGlobals.application).contextMenu; if (_local1){ _local1.removeEventListener(ContextMenuEvent.MENU_SELECT, onContextMenuSelectHandler); }; } private function addCustomEventHandlers():void{ stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler, true); stage.addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler, true); var _local1:ContextMenu = InteractiveObject(ApplicationGlobals.application).contextMenu; if (_local1){ _local1.addEventListener(ContextMenuEvent.MENU_SELECT, onContextMenuSelectHandler); }; } private function onMouseMoveHandler(_arg1:MouseEvent):void{ cursorHolder.x = stage.mouseX; cursorHolder.y = stage.mouseY; var _local2:Object = _arg1.target; if ((((_local2 is TextField)) && ((_local2.type == TextFieldType.INPUT)))){ cursorVisible = false; Mouse.show(); } else { cursorVisible = true; }; if (cursorLeftStage){ cursorLeftStage = false; cursorVisible = true; }; if (cursorQueue.length > 0){ Mouse.hide(); }; } public function setCursor(_arg1:Class, _arg2:int=2):int{ var _local3:int = nextCursorID++; cursorQueue.push({cursorClass:_arg1, cursorID:_local3, priority:_arg2}); cursorQueue.sortOn("priority", (Array.NUMERIC | Array.DESCENDING)); showCurrentCursor(); return (_local3); } private function onMouseOutHandler(_arg1:MouseEvent):void{ if ((((_arg1.relatedObject == null)) && ((cursorQueue.length > 0)))){ stage.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler); }; } private function onContextMenuSelectHandler(_arg1:ContextMenuEvent):void{ stage.addEventListener(MouseEvent.MOUSE_OVER, contextMenuMouseOverHandler, true); } public function removeAllCursors():void{ cursorQueue = []; showCurrentCursor(); } private function showCurrentCursor():void{ var _local1:Object; if (cursorQueue.length > 0){ _local1 = cursorQueue[0]; if (_local1.cursorID != _currentCursorID){ if (_currentCursor){ cursorHolder.removeChild(_currentCursor); }; _currentCursor = new _local1.cursorClass(); if (_currentCursor){ if ((_currentCursor is InteractiveObject)){ InteractiveObject(_currentCursor).mouseEnabled = false; }; cursorHolder.x = stage.mouseX; cursorHolder.y = stage.mouseY; cursorHolder.addChild(_currentCursor); _currentCursorID = _local1.cursorID; addCustomEventHandlers(); }; }; Mouse.hide(); } else { if (_currentCursorID != 0){ _currentCursorID = 0; cursorHolder.removeChild(_currentCursor); _currentCursor = null; removeCustomEventHandlers(); }; Mouse.show(); }; } public function set cursorVisible(_arg1:Boolean):void{ if (cursorHolder){ cursorHolder.visible = _arg1; }; } private function onEnterFrameHandler(_arg1:Event):void{ stage.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); cursorLeftStage = true; cursorVisible = false; Mouse.show(); } private function contextMenuMouseOverHandler(_arg1:MouseEvent):void{ stage.removeEventListener(MouseEvent.MOUSE_OVER, contextMenuMouseOverHandler, true); onMouseMoveHandler(_arg1); } } }//package com.bigwigmedia.ui
Section 78
//DecoratedIconicButton (com.bigwigmedia.ui.DecoratedIconicButton) package com.bigwigmedia.ui { import com.bigwigmedia.display.*; import com.bigwigmedia.ui.styles.*; public class DecoratedIconicButton extends IconicButton { override protected function drawState():void{ var _local1:IDecoration; super.drawState(); switch (_state){ case ButtonState.UP: _local1 = (getStyle(DecoratedIconicButtonStyle.UP_DECORATION) as IDecoration); break; case ButtonState.OVER: _local1 = (getStyle(DecoratedIconicButtonStyle.OVER_DECORATION) as IDecoration); break; case ButtonState.DOWN: _local1 = (getStyle(DecoratedIconicButtonStyle.DOWN_DECORATION) as IDecoration); break; }; if (_local1){ _local1.apply(_icon); }; } public static function get defaultStyles():Object{ var _local1:Object = {upDecoration:null, overDecoration:null, downDecoration:null}; return (_local1); } } }//package com.bigwigmedia.ui
Section 79
//HSlider (com.bigwigmedia.ui.HSlider) package com.bigwigmedia.ui { import com.bigwigmedia.events.*; public class HSlider extends AbstractSlider { public function HSlider(){ super(true); } override protected function mouseMoved():void{ var _local1:Number = (this.mouseX - _thumbClickDisp); if (_local1 < 0){ _local1 = 0; } else { if (_local1 > (_explicitWidth - _thumb.width)){ _local1 = (_explicitWidth - _thumb.width); }; }; var _local2:Number = Math.round((((_local1 / (_explicitWidth - _thumb.width)) * (_maximum - _minimum)) + _minimum)); if (_local2 > _maximum){ _local2 = _maximum; } else { if (_local2 < _minimum){ _local2 = _minimum; }; }; if (_local2 != _value){ _value = _local2; moveKnob(); dispatchEvent(new SliderEvent(SliderEvent.CHANGE, _value, true)); }; } override protected function moveKnob():void{ super.moveKnob(); var _local1:Number = (((_value - _minimum) / (_maximum - _minimum)) * (_explicitWidth - _thumb.width)); var _local2:Number = ((_explicitHeight - _thumb.height) / 2); _thumb.move(_local1, _local2); } } }//package com.bigwigmedia.ui
Section 80
//IconicButton (com.bigwigmedia.ui.IconicButton) package com.bigwigmedia.ui { import flash.display.*; public class IconicButton extends AbstractButton { private var _downIcon:DisplayObject;// = null private var _upIcon:DisplayObject;// = null private var _overIcon:DisplayObject;// = null protected var _icon:DisplayObject; public function set upIcon(_arg1:Class):void{ _upIcon = new (_arg1); invalidate(); } override protected function drawState():void{ switch (_state){ case ButtonState.UP: setNewIcon(_upIcon); break; case ButtonState.OVER: setNewIcon(((_overIcon) || (_upIcon))); break; case ButtonState.DOWN: setNewIcon(((_downIcon) || (((_overIcon) || (_upIcon))))); break; }; super.drawState(); } override protected function get beaconTarget():DisplayObject{ return (_icon); } public function set downIcon(_arg1:Class):void{ _downIcon = new (_arg1); invalidate(); } private function setNewIcon(_arg1:DisplayObject):void{ if (_icon == _arg1){ return; }; if (_icon){ removeChild(_icon); }; _icon = _arg1; addChild(_icon); } public function set overIcon(_arg1:Class):void{ _overIcon = new (_arg1); invalidate(); } override protected function createChildren():void{ upIcon = Shape; } } }//package com.bigwigmedia.ui
Section 81
//ICursorManager (com.bigwigmedia.ui.ICursorManager) package com.bigwigmedia.ui { import flash.display.*; public interface ICursorManager { function removeAllCursors():void; function removeCursor(_arg1:int):void; function get currentCursor():DisplayObject; function setCursor(_arg1:Class, _arg2:int=2):int; function get currentCursorID():int; function set cursorVisible(_arg1:Boolean):void; } }//package com.bigwigmedia.ui
Section 82
//InvalidationType (com.bigwigmedia.ui.InvalidationType) package com.bigwigmedia.ui { public class InvalidationType { public static const SIZE:String = "size"; public static const ALL:String = "all"; public static const STYLES:String = "styles"; public static const STATE:String = "state"; public static const LAYOUT:String = "layout"; } }//package com.bigwigmedia.ui
Section 83
//IStyleManager (com.bigwigmedia.ui.IStyleManager) package com.bigwigmedia.ui { public interface IStyleManager { function unregisterComponent(_arg1:AbstractComponent):void; function registerComponent(_arg1:AbstractComponent):void; function setSharedStyle(_arg1:Class, _arg2:String, _arg3:Object):void; } }//package com.bigwigmedia.ui
Section 84
//Label (com.bigwigmedia.ui.Label) package com.bigwigmedia.ui { import flash.text.*; import com.bigwigmedia.ui.styles.*; public class Label extends AbstractComponent { protected var _text:String; protected var _textField:TextField; override protected function createChildren():void{ mouseChildren = false; mouseEnabled = false; _textField = new TextField(); _textField.wordWrap = false; _textField.autoSize = TextFieldAutoSize.LEFT; addChild(_textField); text = ""; } override protected function drawStyles():void{ _textField.embedFonts = (getStyle(AbstractComponentStyle.EMBED_FONTS) as Boolean); var _local1:TextFormat = (getStyle(AbstractComponentStyle.TEXT_FORMAT) as TextFormat); if (_local1){ _textField.setTextFormat(_local1); _textField.defaultTextFormat = _local1; }; } public function set text(_arg1:String):void{ if (_text != _arg1){ _textField.htmlText = (_text = _arg1); invalidate(InvalidationType.SIZE); }; } public function get text():String{ return (_text); } } }//package com.bigwigmedia.ui
Section 85
//LabelButton (com.bigwigmedia.ui.LabelButton) package com.bigwigmedia.ui { import flash.display.*; import com.bigwigmedia.events.*; import flash.text.*; import com.bigwigmedia.ui.styles.*; public class LabelButton extends AbstractButton { protected var _labelField:TextField; protected var _label:String; public function LabelButton(){ addEventListener(ComponentEvent.RESIZE, onResizeHandler); } override protected function drawStyles():void{ _labelField.embedFonts = (getStyle(AbstractComponentStyle.EMBED_FONTS) as Boolean); var _local1:TextFormat = (getStyle(AbstractComponentStyle.TEXT_FORMAT) as TextFormat); if (_local1){ _labelField.setTextFormat(_local1); _labelField.defaultTextFormat = _local1; }; } public function set label(_arg1:String):void{ if (_label != _arg1){ _labelField.text = (_label = _arg1); invalidate(InvalidationType.SIZE); }; } override protected function drawState():void{ switch (_state){ case ButtonState.UP: _labelField.textColor = (getStyle(LabelButtonStyle.UP_STATE_COLOR) as uint); break; case ButtonState.OVER: _labelField.textColor = (getStyle(LabelButtonStyle.OVER_STATE_COLOR) as uint); break; case ButtonState.DOWN: _labelField.textColor = (getStyle(LabelButtonStyle.DOWN_STATE_COLOR) as uint); break; }; super.drawState(); } public function get label():String{ return (_label); } override protected function get beaconTarget():DisplayObject{ return (_labelField); } private function onResizeHandler(_arg1:ComponentEvent):void{ graphics.clear(); graphics.lineStyle(); graphics.beginFill(0xFFFFFF, 0); graphics.drawRect(0, 0, (this.width / scaleX), (this.height / scaleY)); } override protected function createChildren():void{ if (!_labelField){ _labelField = new TextField(); _labelField.type = TextFieldType.DYNAMIC; _labelField.selectable = false; _labelField.autoSize = TextFieldAutoSize.LEFT; addChild(_labelField); }; } public static function get defaultStyles():Object{ var _local1:Object = {upStateColor:0xFFFFFF, overStateColor:0xFF0000, downStateColor:0x880000}; return (_local1); } } }//package com.bigwigmedia.ui
Section 86
//PositionConstraint (com.bigwigmedia.ui.PositionConstraint) package com.bigwigmedia.ui { import flash.display.*; import flash.geom.*; public class PositionConstraint { public var left:Number;// = NAN public var verticalCenter:Number;// = NAN public var top:Number;// = NAN public var horizontalCenter:Number;// = NAN public var bottom:Number;// = NAN public var right:Number;// = NAN public static const LEFT:String = "left"; public static const BOTTOM:String = "bottom"; public static const HORIZONTAL_CENTER:String = "horizontalCenter"; public static const TOP:String = "top"; public static const RIGHT:String = "right"; public static const VERTICAL_CENTER:String = "verticalCenter"; public function isEmpty():Boolean{ return (((((((((((isNaN(left)) && (isNaN(right)))) && (isNaN(horizontalCenter)))) && (isNaN(top)))) && (isNaN(bottom)))) && (isNaN(verticalCenter)))); } public function apply(_arg1:DisplayObject):void{ var _local6:Number; var _local7:Number; var _local2:DisplayObject = _arg1.parent; if (!_local2){ return; }; var _local3:Rectangle = _arg1.getBounds(_arg1.parent); var _local4:Number = 0; if (!isNaN(left)){ _local4 = (left - _local3.left); } else { if (!isNaN(right)){ _local4 = ((_local2.width - _local3.right) - right); } else { if (!isNaN(horizontalCenter)){ _local6 = ((_local2.width / 2) - (_local3.left + (_local3.width / 2))); _local4 = (_local6 + horizontalCenter); }; }; }; if (_local4 != 0){ _arg1.x = (_arg1.x + _local4); }; var _local5:Number = 0; if (!isNaN(top)){ _local5 = (top - _local3.top); } else { if (!isNaN(bottom)){ _local5 = ((_local2.height - _local3.bottom) - bottom); } else { if (!isNaN(verticalCenter)){ _local7 = ((_local2.height / 2) - (_local3.top + (_local3.height / 2))); _local5 = (_local7 + verticalCenter); }; }; }; if (_local5 != 0){ _arg1.y = (_arg1.y + _local5); }; } } }//package com.bigwigmedia.ui
Section 87
//RadioButton (com.bigwigmedia.ui.RadioButton) package com.bigwigmedia.ui { import com.bigwigmedia.events.*; public class RadioButton extends CheckBox { private var _group:RadioButtonGroup; private var _groupName:String; public var value:Object;// = null public function RadioButton(){ groupName = "RadioButtonGroup_01"; } function deselect():void{ if (_selected){ _selected = false; invalidate(); }; } override public function dispose():void{ _group.unregisterRadioButton(this); _group = null; super.dispose(); } public function get groupName():String{ return (_groupName); } public function set groupName(_arg1:String):void{ _groupName = _arg1; if (_group){ _group.unregisterRadioButton(this); }; _group = RadioButtonGroup.registerRadioButton(this); } override public function set selected(_arg1:Boolean):void{ if (_selected){ return; }; if (_selected != _arg1){ _selected = _arg1; if (((_group) && (_selected))){ _group.selectButton(this); }; invalidate(); dispatchEvent(new ComponentEvent(ComponentEvent.CHANGE, true)); }; } override public function get selected():Boolean{ return (_selected); } public function get group():RadioButtonGroup{ return (_group); } } }//package com.bigwigmedia.ui
Section 88
//RadioButtonGroup (com.bigwigmedia.ui.RadioButtonGroup) package com.bigwigmedia.ui { import flash.events.*; import com.bigwigmedia.events.*; import flash.utils.*; public class RadioButtonGroup extends EventDispatcher { private var _buttons:Dictionary; private var _name:String; private var _selection:RadioButton; private var _numButtons:int;// = 0 private static var radioButtonGroupsHash:Object = new Object(); public function RadioButtonGroup(_arg1:String){ _buttons = new Dictionary(); super(); _name = _arg1; } public function get selection():RadioButton{ return (_selection); } public function selectButton(_arg1:RadioButton):void{ var _local2:RadioButton; for each (_local2 in _buttons) { if (_local2 != _arg1){ _local2.deselect(); } else { _selection = _arg1; }; }; dispatchEvent(new ComponentEvent(ComponentEvent.CHANGE)); } public function unregisterRadioButton(_arg1:RadioButton):void{ delete _buttons[_arg1]; _numButtons--; if (_numButtons == 0){ delete RadioButtonGroup.radioButtonGroupsHash[_name]; }; } private function registerButton(_arg1:RadioButton):void{ if (!_buttons[_arg1]){ _buttons[_arg1] = _arg1; if (_arg1.selected){ selectButton(_arg1); }; _numButtons++; }; } public static function registerRadioButton(_arg1:RadioButton):RadioButtonGroup{ var _local2:String = _arg1.groupName; var _local3:RadioButtonGroup = RadioButtonGroup.radioButtonGroupsHash[_local2]; if (!_local3){ _local3 = new RadioButtonGroup(_local2); RadioButtonGroup.radioButtonGroupsHash[_local2] = _local3; }; _local3.registerButton(_arg1); return (_local3); } } }//package com.bigwigmedia.ui
Section 89
//SizeConstraint (com.bigwigmedia.ui.SizeConstraint) package com.bigwigmedia.ui { import flash.display.*; public class SizeConstraint { public var percentWidth:Number;// = NAN public var percentHeight:Number;// = NAN public static const PERCENTAGE_WIDTH:String = "percentWidth"; public static const PERCENTAGE_HEIGHT:String = "percentHeight"; public function isEmpty():Boolean{ return (((isNaN(percentWidth)) && (isNaN(percentHeight)))); } public function apply(_arg1:DisplayObject):void{ var _local2:DisplayObject = _arg1.parent; if (!_local2){ return; }; var _local3:Number = (isNaN(percentWidth)) ? _arg1.width : ((_local2.width * percentWidth) / 100); var _local4:Number = (isNaN(percentHeight)) ? _arg1.height : ((_local2.height * percentHeight) / 100); _arg1.width = _local3; _arg1.height = _local4; } } }//package com.bigwigmedia.ui
Section 90
//StyleManager (com.bigwigmedia.ui.StyleManager) package com.bigwigmedia.ui { import com.bigwigmedia.core.*; import flash.utils.*; import flash.errors.*; public class StyleManager implements IStyleManager { private var cachedStylesHash:Dictionary; private var sharedStylesHash:Dictionary; private var _components:Dictionary; bigwigmedia_ns static var singletonAccessor:Boolean = false; public function StyleManager(){ sharedStylesHash = new Dictionary(); cachedStylesHash = new Dictionary(); _components = new Dictionary(); super(); if (!bigwigmedia_ns::singletonAccessor){ throw (new IllegalOperationError("Use method getInstance of Singleton class to get instance of StyleManager.")); }; } public function unregisterComponent(_arg1:AbstractComponent):void{ if (_components[_arg1]){ delete _components[_arg1]; }; } public function registerComponent(_arg1:AbstractComponent):void{ var _local2:Object; var _local3:String; if (!_components[_arg1]){ _components[_arg1] = true; _local2 = getMergedSharedStyles(_arg1); for (_local3 in _local2) { var _local6 = _arg1; _local6.bigwigmedia_ns::setSharedStyle(_local3, _local2[_local3]); }; }; } private function invalidateSharedStyles(_arg1:Class):void{ var _local2:Object; var _local3:AbstractComponent; var _local4:Object; var _local5:String; for each (_local2 in _components) { _local3 = (_local2 as AbstractComponent); if ((_local3 is _arg1)){ _local4 = getMergedSharedStyles(_local3); for (_local5 in _local4) { var _local10 = _local3; _local10.bigwigmedia_ns::setSharedStyle(_local5, _local4[_local5]); }; }; }; } private function getMergedSharedStyles(_arg1:AbstractComponent):Object{ var _local5:String; var _local6:Class; var _local7:Object; var _local8:String; var _local2:Class = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class); if (cachedStylesHash[_local2]){ return (cachedStylesHash[_local2]); }; var _local3:Object = getSharedStyle(_local2); var _local4:Object = {}; for (_local5 in _local3) { _local4[_local5] = _local3[_local5]; }; _local6 = (getDefinitionByName(getQualifiedClassName(_arg1)) as Class); while (true) { _local7 = getSharedStyle(_local6); for (_local8 in _local7) { if (_local4[_local8] === undefined){ _local4[_local8] = _local7[_local8]; }; }; if (getQualifiedClassName(_local6) == "com.bigwigmedia.ui::AbstractComponent"){ break; } else { _local6 = (getDefinitionByName(getQualifiedSuperclassName(_local6)) as Class); }; }; cachedStylesHash[_local2] = _local4; return (_local4); } private function getSharedStyle(_arg1:Class):Object{ var _local2:Object; if (!sharedStylesHash[_arg1]){ _local2 = _arg1["defaultStyles"]; sharedStylesHash[_arg1] = ((_local2) || (new Object())); }; return (sharedStylesHash[_arg1]); } public function setSharedStyle(_arg1:Class, _arg2:String, _arg3:Object):void{ var _local4:Object = getSharedStyle(_arg1); _local4[_arg2] = _arg3; cachedStylesHash = new Dictionary(); invalidateSharedStyles(_arg1); } } }//package com.bigwigmedia.ui
Section 91
//TextInput (com.bigwigmedia.ui.TextInput) package com.bigwigmedia.ui { import flash.text.*; import com.bigwigmedia.ui.styles.*; public class TextInput extends AbstractComponent { protected var _textField:TextField; public function set backgroundColor(_arg1:uint):void{ _textField.backgroundColor = _arg1; } public function set maxChars(_arg1:int):void{ _textField.maxChars = _arg1; } override public function setSize(_arg1:Number, _arg2:Number):void{ _textField.width = _arg1; _textField.height = _arg2; } public function set background(_arg1:Boolean):void{ _textField.background = _arg1; } override protected function drawStyles():void{ _textField.embedFonts = (getStyle(AbstractComponentStyle.EMBED_FONTS) as Boolean); var _local1:TextFormat = (getStyle(AbstractComponentStyle.TEXT_FORMAT) as TextFormat); if (_local1){ _textField.setTextFormat(_local1); _textField.defaultTextFormat = _local1; }; } public function set text(_arg1:String):void{ _textField.text = _arg1; } override protected function createChildren():void{ _textField = new TextField(); _textField.multiline = false; _textField.type = TextFieldType.INPUT; background = true; text = ""; addChild(_textField); } public function get text():String{ return (_textField.text); } } }//package com.bigwigmedia.ui
Section 92
//VSlider (com.bigwigmedia.ui.VSlider) package com.bigwigmedia.ui { import com.bigwigmedia.events.*; public class VSlider extends AbstractSlider { public function VSlider(){ super(false); } override protected function mouseMoved():void{ var _local1:Number = (this.mouseY - _thumbClickDisp); if (_local1 < 0){ _local1 = 0; } else { if (_local1 > (_explicitHeight - _thumb.height)){ _local1 = (_explicitHeight - _thumb.height); }; }; var _local2:Number = Math.round((((_local1 / (_explicitHeight - _thumb.height)) * (_maximum - _minimum)) + _minimum)); if (_local2 > _maximum){ _local2 = _maximum; } else { if (_local2 < _minimum){ _local2 = _minimum; }; }; if (_local2 != _value){ _value = _local2; moveKnob(); dispatchEvent(new SliderEvent(SliderEvent.CHANGE, _value, true)); }; } override protected function moveKnob():void{ super.moveKnob(); var _local1:Number = ((_explicitWidth - _thumb.width) / 2); var _local2:Number = (((_value - _minimum) / (_maximum - _minimum)) * (_explicitHeight - _thumb.height)); _thumb.move(_local1, _local2); } } }//package com.bigwigmedia.ui
Section 93
//Message (com.bigwigmedia.utils.messages.Message) package com.bigwigmedia.utils.messages { import com.bigwigmedia.utils.*; public class Message { private var _priority:int; private var _data:Object; private var _removeDuplicates:Boolean; private var _cancelQueue:Boolean; private var _type:String; public function Message(_arg1:String, _arg2:int, _arg3:Boolean, _arg4:Boolean, _arg5:Object){ _type = _arg1; _priority = _arg2; _cancelQueue = _arg3; _removeDuplicates = _arg4; _data = _arg5; } public function get priority():int{ return (_priority); } public function get data():Object{ return (_data); } public function toString():String{ return (ObjectUtil.formatToString(this, "type", "priority", "data")); } function cloneWithData(_arg1:Object):Message{ return (new Message(_type, _priority, _cancelQueue, _removeDuplicates, _arg1)); } public function get cancelQueue():Boolean{ return (_cancelQueue); } public function get type():String{ return (_type); } public function get removeDuplicates():Boolean{ return (_removeDuplicates); } } }//package com.bigwigmedia.utils.messages
Section 94
//MessageQueue (com.bigwigmedia.utils.messages.MessageQueue) package com.bigwigmedia.utils.messages { import com.bigwigmedia.core.*; public class MessageQueue implements IDisposable { private var pendingMessages:Array; private var locked:Boolean;// = false private var pendingMessagesWhileLocked:Array; private var messagePrototypes:Object; public function MessageQueue(){ pendingMessages = []; pendingMessagesWhileLocked = []; messagePrototypes = {}; super(); } public function registerMessage(_arg1:String, _arg2:int, _arg3:Boolean=false, _arg4:Boolean=false):void{ if (messagePrototypes[_arg1] != undefined){ throw (new ArgumentError((("Message of type \"" + _arg1) + "\" is registered already."))); }; messagePrototypes[_arg1] = new Message(_arg1, _arg2, _arg4, _arg3, null); } public function getNext():Message{ var _local1:Message = pendingMessages.pop(); if (_local1.cancelQueue){ pendingMessages = []; }; return (_local1); } public function lock():void{ locked = true; } public function clear():void{ if (pendingMessages.length > 0){ pendingMessages = []; }; if (pendingMessagesWhileLocked.length > 0){ pendingMessagesWhileLocked = []; }; } public function dispose():void{ pendingMessages = []; pendingMessagesWhileLocked = []; messagePrototypes = {}; } public function unlock():void{ while (pendingMessagesWhileLocked.length > 0) { _append(pendingMessagesWhileLocked.pop()); }; locked = false; } private function _append(_arg1:Message):void{ var _local2:Message; var _local3:int; if (_arg1.removeDuplicates){ for each (_local2 in pendingMessages) { if (_arg1.type == _local2.type){ _local3 = pendingMessages.indexOf(_local2); pendingMessages.splice(_local3, 1); }; }; }; pendingMessages.push(_arg1); pendingMessages.sortOn("priority", Array.NUMERIC); } public function append(_arg1:String, _arg2:Object=null):void{ if (messagePrototypes[_arg1] == undefined){ throw (new ArgumentError((("There's no message of type \"" + _arg1) + "\" registered."))); }; var _local3:Message = messagePrototypes[_arg1]; var _local4:Message = _local3.cloneWithData(_arg2); if (locked){ pendingMessagesWhileLocked.push(_local4); } else { _append(_local4); }; } public function hasNext():Boolean{ return ((pendingMessages.length > 0)); } } }//package com.bigwigmedia.utils.messages
Section 95
//ArrayUtil (com.bigwigmedia.utils.ArrayUtil) package com.bigwigmedia.utils { public class ArrayUtil { public static function shuffle(_arg1:Array):Array{ var _local5:int; var _local6:*; var _local2:Array = _arg1.slice(); var _local3:int = _local2.length; if (_local3 <= 1){ return (_local2); }; var _local4:int; while (_local4 < _local3) { _local5 = Math.floor((Math.random() * _local3)); _local6 = _local2[_local4]; _local2[_local4] = _local2[_local5]; _local2[_local5] = _local6; _local4++; }; return (_local2); } } }//package com.bigwigmedia.utils
Section 96
//MathUtil (com.bigwigmedia.utils.MathUtil) package com.bigwigmedia.utils { public class MathUtil { public static const RADIANS_TO_DEGREES:Number = 57.2957795130823; public static const DEGREES_TO_RADIANS:Number = 0.0174532925199433; public static function nearEquals(_arg1:Number, _arg2:Number, _arg3:Number=0.001):Boolean{ var _local4:Number = (_arg1 - _arg2); return ((((_local4 < _arg3)) && ((_local4 > -(_arg3))))); } } }//package com.bigwigmedia.utils
Section 97
//NameUtil (com.bigwigmedia.utils.NameUtil) package com.bigwigmedia.utils { import flash.display.*; import flash.utils.*; public class NameUtil { public static function getClassName(_arg1):String{ var _local2:String = getQualifiedClassName(_arg1); var _local3:int = _local2.indexOf("::"); if (_local3 != -1){ _local2 = _local2.substr((_local3 + 2)); }; return (_local2); } public static function toDisplayObjectString(_arg1:Object):String{ var _local2:String; var _local3:DisplayObject; var _local4:String; if ((_arg1 is DisplayObject)){ _local3 = (_arg1 as DisplayObject); while (_local3 != null) { if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){ break; }; _local4 = _local3.name; _local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2); _local3 = _local3.parent; }; } else { _local2 = "Not a DisplayObject"; }; return (_local2); } } }//package com.bigwigmedia.utils
Section 98
//new2 (com.bigwigmedia.utils.new2) package com.bigwigmedia.utils { public function new2(_arg1:Class, _arg2:Array){ switch (_arg2.length){ case 0: return (new (_arg1)); case 1: return (new _arg1(_arg2[0])); case 2: return (new _arg1(_arg2[0], _arg2[1])); case 3: return (new _arg1(_arg2[0], _arg2[1], _arg2[2])); case 4: return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3])); case 5: return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4])); case 6: return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5])); case 7: return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6])); case 8: return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7])); case 9: return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8])); case 10: return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8], _arg2[9])); default: return (null); }; } }//package com.bigwigmedia.utils
Section 99
//NumberFormatter (com.bigwigmedia.utils.NumberFormatter) package com.bigwigmedia.utils { public class NumberFormatter { public static function formatNumber(_arg1:Object, _arg2:String=","):String{ var _local3:String = String(_arg1); var _local4 = ""; var _local5:Number = _local3.length; var _local6:int; while (_local6 < _local5) { if (((((_local6 % 3) == 0)) && ((_local6 > 0)))){ _local4 = (_arg2 + _local4); }; _local4 = (_local3.substr((_local5 - (_local6 + 1)), 1) + _local4); _local6++; }; return (_local4); } public static function addLeadingZeros(_arg1:Object, _arg2:int=2):String{ var _local3:String = String(_arg1); while (_local3.length < _arg2) { _local3 = ("0" + _local3); }; return (_local3); } } }//package com.bigwigmedia.utils
Section 100
//ObjectUtil (com.bigwigmedia.utils.ObjectUtil) package com.bigwigmedia.utils { public class ObjectUtil { public static function formatToString(_arg1, ... _args):String{ var _local6:String; var _local7:Object; var _local3:String = ("[" + NameUtil.getClassName(_arg1)); var _local4:int = _args.length; var _local5:int; while (_local5 < _local4) { _local6 = _args[_local5]; if (_arg1.hasOwnProperty(_local6)){ _local7 = _arg1[_local6]; if ((_local7 is String)){ _local3 = (_local3 + ((((" " + _local6) + "=\"") + _local7) + "\"")); } else { _local3 = (_local3 + (((" " + _local6) + "=") + _local7)); }; }; _local5++; }; return ((_local3 + "]")); } public static function hasProperties(_arg1:Object):Boolean{ var _local2:String; for (_local2 in _arg1) { return (true); }; return (false); } } }//package com.bigwigmedia.utils
Section 101
//TextFormatUtil (com.bigwigmedia.utils.TextFormatUtil) package com.bigwigmedia.utils { import flash.text.*; public class TextFormatUtil { public static function clone(_arg1:TextFormat):TextFormat{ return (new TextFormat(_arg1.font, _arg1.size, _arg1.color, _arg1.bold, _arg1.italic, _arg1.underline, _arg1.url, _arg1.target, _arg1.align, _arg1.leftMargin, _arg1.rightMargin, _arg1.indent, _arg1.leading)); } } }//package com.bigwigmedia.utils
Section 102
//Transitions (com.boostworthy.animation.easing.Transitions) package com.boostworthy.animation.easing { public final class Transitions { public static const SINE_OUT:String = "sineOut"; public static const QUAD_IN_AND_OUT:String = "quadInAndOut"; private static const ELASTIC_PERIOD:Number = 400; public static const QUART_OUT:String = "quartOut"; public static const BOUNCE:String = "bounce"; public static const EXPO_IN:String = "expoIn"; public static const SINE_IN:String = "sineIn"; public static const CUBIC_OUT:String = "cubicOut"; public static const QUINT_OUT:String = "quintOut"; public static const QUAD_IN:String = "quadIn"; public static const QUINT_IN_AND_OUT:String = "quintInAndOut"; public static const ELASTIC_OUT:String = "elasticOut"; public static const LINEAR:String = "linear"; public static const QUART_IN_AND_OUT:String = "quartInAndOut"; public static const QUAD_OUT:String = "quadOut"; public static const QUINT_IN:String = "quintIn"; public static const CUBIC_IN_AND_OUT:String = "cubicInAndOut"; public static const QUART_IN:String = "quartIn"; public static const DEFAULT_TRANSITION:String = "linear"; private static const BACK_OVERSHOOT:Number = 1.70158; public static const BACK_OUT:String = "backOut"; private static const ELASTIC_AMPLITUDE:Number = undefined; public static const CUBIC_IN:String = "cubicIn"; public static const ELASTIC_IN_AND_OUT:String = "elasticInAndOut"; public static const EXPO_OUT:String = "expoOut"; public static const BACK_IN_AND_OUT:String = "backInAndOut"; public static const ELASTIC_IN:String = "elasticIn"; public static const EXPO_IN_AND_OUT:String = "expoInAndOut"; public static const BACK_IN:String = "backIn"; public static const SINE_IN_AND_OUT:String = "sineInAndOut"; public static function quadOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2)); } public static function expoOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (((_arg1)==_arg4) ? (_arg2 + _arg3) : ((_arg3 * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2)); } public static function expoInAndOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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)); }; --_arg1; return ((((_arg3 / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2)); } public static function quintOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2)); } public static function cubicIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2)); } public static function sineIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2) + _arg3)); } public static function sineOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2)); } public static function quartOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2)); } public static function sineInAndOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((-(_arg3) / 2) * (Math.cos(((_arg1 / _arg4) * Math.PI)) - 1)) + _arg2)); } public static function bounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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 backInAndOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local5:Number = BACK_OVERSHOOT; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 < 1){ _local5 = (_local5 * 1.525); return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local5 + 1) * _arg1) - _local5))) + _arg2)); }; _arg1 = (_arg1 - 2); _local5 = (_local5 * 1.525); return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local5 + 1) * _arg1) + _local5)) + 2)) + _arg2)); } public static function expoIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (((_arg1)==0) ? _arg2 : ((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2)); } public static function cubicOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2)); } public static function linear(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return ((((_arg3 * _arg1) / _arg4) + _arg2)); } public static function quadIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((_arg3 * _arg1) * _arg1) + _arg2)); } public static function quintIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); } public static function elasticOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local7:Number; var _local5:Number = ELASTIC_AMPLITUDE; var _local6:Number = ELASTIC_PERIOD; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 == 1){ return ((_arg2 + _arg3)); }; if (!_local6){ _local6 = (_arg4 * 0.3); }; if (((!(_local5)) || ((_local5 < Math.abs(_arg3))))){ _local5 = _arg3; _local7 = (_local6 / 4); } else { _local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local5))); }; return (((((_local5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2)); } public static function quartInAndOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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 quartIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (_arg1 / _arg4); return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2)); } public static function quadInAndOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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 quintInAndOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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 elasticIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local7:Number; var _local5:Number = ELASTIC_AMPLITUDE; var _local6:Number = ELASTIC_PERIOD; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / _arg4); if (_arg1 == 1){ return ((_arg2 + _arg3)); }; if (!_local6){ _local6 = (_arg4 * 0.3); }; if (((!(_local5)) || ((_local5 < Math.abs(_arg3))))){ _local5 = _arg3; _local7 = (_local6 / 4); } else { _local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local5))); }; --_arg1; return ((-(((_local5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2)); } public static function cubicInAndOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):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 backOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local5:Number = BACK_OVERSHOOT; _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((_arg1 * _arg1) * (((_local5 + 1) * _arg1) + _local5)) + 1)) + _arg2)); } public static function elasticInAndOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local7:Number; var _local5:Number = ELASTIC_AMPLITUDE; var _local6:Number = ELASTIC_PERIOD; if (_arg1 == 0){ return (_arg2); }; _arg1 = (_arg1 / (_arg4 / 2)); if (_arg1 == 2){ return ((_arg2 + _arg3)); }; if (!_local6){ _local6 = (_arg4 * (0.3 * 1.5)); }; if (((!(_local5)) || ((_local5 < Math.abs(_arg3))))){ _local5 = _arg3; _local7 = (_local6 / 4); } else { _local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local5))); }; if (_arg1 < 1){ --_arg1; return (((-0.5 * ((_local5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2)); }; --_arg1; return ((((((_local5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2)); } public static function backIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ var _local5:Number = BACK_OVERSHOOT; _arg1 = (_arg1 / _arg4); return (((((_arg3 * _arg1) * _arg1) * (((_local5 + 1) * _arg1) - _local5)) + _arg2)); } } }//package com.boostworthy.animation.easing
Section 103
//Renderer (com.boostworthy.animation.rendering.Renderer) package com.boostworthy.animation.rendering { import flash.display.*; import flash.events.*; import com.boostworthy.utils.logger.*; import flash.utils.*; import com.boostworthy.core.*; public class Renderer extends EventDispatcher implements IDisposable { protected var m_objTimer:Timer; protected var m_fncOnTimer:Function; protected var m_objStage:Stage; protected var m_fncOnEnterFrame:Function; protected var m_objLog:ILog; public function Renderer(_arg1:Function, _arg2:Function, _arg3:Number){ if (_arg1 != null){ m_fncOnEnterFrame = _arg1; m_objStage = Global.stage; }; if (_arg2 != null){ m_fncOnTimer = _arg2; m_objTimer = new Timer(_arg3, 0); m_objTimer.addEventListener(TimerEvent.TIMER, m_fncOnTimer); }; m_objLog = LogFactory.getInstance().getLog("Renderer"); } public function start(_arg1:Number):void{ if (_arg1 == RenderMethod.ENTER_FRAME){ startEnterFrame(); } else { if (_arg1 == RenderMethod.TIMER){ startTimer(); }; }; } protected function startTimer():void{ m_objTimer.start(); } public function startAll():void{ startEnterFrame(); startTimer(); } public function stop(_arg1:Number):void{ if (_arg1 == RenderMethod.ENTER_FRAME){ stopEnterFrame(); } else { if (_arg1 == RenderMethod.TIMER){ stopTimer(); }; }; } protected function stopTimer():void{ m_objTimer.stop(); } public function stopAll():void{ stopEnterFrame(); stopTimer(); } protected function startEnterFrame():void{ if (!m_objStage){ m_objStage = Global.stage; }; if (m_objStage){ m_objStage.addEventListener(Event.ENTER_FRAME, m_fncOnEnterFrame); } else { m_objLog.warning("startEnterFrame :: Unable to add a listener to the enter frame event because a global stage reference does not exist."); }; } protected function stopEnterFrame():void{ if (m_objStage){ m_objStage.removeEventListener(Event.ENTER_FRAME, m_fncOnEnterFrame); }; } public function dispose():void{ if (((!((m_fncOnEnterFrame == null))) && (!((m_objStage == null))))){ m_objStage.removeEventListener(Event.ENTER_FRAME, m_fncOnEnterFrame); }; if (m_objTimer != null){ m_objTimer.removeEventListener(TimerEvent.TIMER, m_fncOnTimer); }; m_fncOnEnterFrame = null; m_objTimer = null; m_fncOnTimer = null; m_objStage = null; } } }//package com.boostworthy.animation.rendering
Section 104
//RenderMethod (com.boostworthy.animation.rendering.RenderMethod) package com.boostworthy.animation.rendering { public final class RenderMethod { public static const TIMER:uint = 2; public static const ENTER_FRAME:uint = 1; } }//package com.boostworthy.animation.rendering
Section 105
//Action (com.boostworthy.animation.sequence.tweens.Action) package com.boostworthy.animation.sequence.tweens { public class Action implements ITween { protected const PROPERTY:String = "action"; protected var m_aParamsForward:Array; protected var m_uPreviousFrame:uint; protected var m_uLastFrame:uint; protected var m_fncReverse:Function; protected var m_uFirstFrame:uint; protected var m_aParamsReverse:Array; protected var m_fncForward:Function; public function Action(_arg1:Function, _arg2:Array, _arg3:Function, _arg4:Array, _arg5:uint){ m_fncForward = _arg1; m_aParamsForward = _arg2; m_fncReverse = _arg3; m_aParamsReverse = _arg4; m_uFirstFrame = _arg5; m_uLastFrame = _arg5; m_uPreviousFrame = 1; } public function get target():Object{ return (null); } public function get property():String{ return (PROPERTY); } public function get firstFrame():uint{ return (m_uFirstFrame); } public function clone():ITween{ return (new Action(m_fncForward, m_aParamsForward, m_fncReverse, m_aParamsReverse, m_uFirstFrame)); } public function get lastFrame():uint{ return (m_uLastFrame); } public function renderFrame(_arg1:uint):void{ if (_arg1 == m_uFirstFrame){ if (m_uPreviousFrame > _arg1){ m_fncReverse.apply(null, m_aParamsReverse); } else { m_fncForward.apply(null, m_aParamsForward); }; }; m_uPreviousFrame = _arg1; } } }//package com.boostworthy.animation.sequence.tweens
Section 106
//ITween (com.boostworthy.animation.sequence.tweens.ITween) package com.boostworthy.animation.sequence.tweens { public interface ITween { function get target():Object; function clone():ITween; function get property():String; function get lastFrame():uint; function get firstFrame():uint; function renderFrame(_arg1:uint):void; } }//package com.boostworthy.animation.sequence.tweens
Section 107
//Tween (com.boostworthy.animation.sequence.tweens.Tween) package com.boostworthy.animation.sequence.tweens { import com.boostworthy.animation.easing.*; public class Tween implements ITween { protected const DEFAULT_TRANSITION:String = "linear"; protected var m_objToTween:Object; protected var m_strTransition:String; protected var m_bIsDirty:Boolean; protected var m_strProperty:String; protected var m_uFirstFrame:uint; protected var m_uLastFrame:uint; protected var m_nTargetValue:Number; protected var m_nChangeValue:Number; protected var m_nStartValue:Number; protected var m_fncTransition:Function; public function Tween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:uint, _arg5:uint, _arg6:String="linear"){ m_objToTween = _arg1; m_strProperty = _arg2; m_nTargetValue = _arg3; m_uFirstFrame = _arg4; m_uLastFrame = _arg5; m_strTransition = _arg6; m_fncTransition = Transitions[m_strTransition]; } public function renderFrame(_arg1:uint):void{ var _local2:Number; if ((((_arg1 < m_uFirstFrame)) && (!(isNaN(m_nStartValue))))){ m_objToTween[m_strProperty] = m_nStartValue; m_bIsDirty = true; } else { if ((((_arg1 >= m_uFirstFrame)) && ((_arg1 <= m_uLastFrame)))){ _local2 = ((_arg1 - m_uFirstFrame) / (m_uLastFrame - m_uFirstFrame)); if (((isNaN(m_nStartValue)) && ((_arg1 == m_uFirstFrame)))){ m_nStartValue = m_objToTween[m_strProperty]; m_nChangeValue = (m_nTargetValue - m_nStartValue); }; m_objToTween[m_strProperty] = m_fncTransition(_local2, m_nStartValue, m_nChangeValue, 1); m_bIsDirty = true; } else { if ((((_arg1 > m_uLastFrame)) && (m_bIsDirty))){ m_objToTween[m_strProperty] = m_nTargetValue; m_bIsDirty = false; }; }; }; } public function get target():Object{ return (m_objToTween); } public function get property():String{ return (m_strProperty); } public function get lastFrame():uint{ return (m_uLastFrame); } public function clone():ITween{ return (new Tween(m_objToTween, m_strProperty, m_nTargetValue, m_uFirstFrame, m_uLastFrame, m_strTransition)); } public function get firstFrame():uint{ return (m_uFirstFrame); } } }//package com.boostworthy.animation.sequence.tweens
Section 108
//Timeline (com.boostworthy.animation.sequence.Timeline) package com.boostworthy.animation.sequence { import flash.events.*; import com.boostworthy.events.*; import com.boostworthy.animation.sequence.tweens.*; import com.boostworthy.collections.iterators.*; import com.boostworthy.core.*; import com.boostworthy.animation.rendering.*; import com.boostworthy.animation.*; public class Timeline extends EventDispatcher implements IDisposable { protected const DEFAULT_LOOP:Boolean = false; protected const DEFAULT_RENDER_METHOD:uint = 2; protected const DEFAULT_FRAME_RATE:Number = 60; protected var m_uFrameRate:uint; protected var m_uFrame:uint; protected var m_uRenderMethod:uint; protected var m_nRefreshRate:Number; protected var m_objTweenStack:TweenStack; protected var m_bLoop:Boolean; protected var m_uLength:uint; protected var m_objRendererPrev:Renderer; protected var m_objRendererNext:Renderer; public function Timeline(_arg1:uint=2, _arg2:Number=60){ init(_arg1, _arg2); } protected function computeFrameData(_arg1:uint, _arg2:uint):void{ var _local5:ITween; var _local3:IIterator = m_objTweenStack.getIterator(IteratorType.ARRAY_REVERSE); var _local4:int = _arg1; while (_local4 <= _arg2) { while (_local3.hasNext()) { _local5 = (_local3.next() as ITween); if (!(_local5 is Action)){ _local5.renderFrame(_local4); }; }; _local3.reset(); _local4++; }; render(); } public function prevFrame():void{ setFrame((m_uFrame - 1)); } protected function onNextFrameEF(_arg1:Event):void{ nextFrame(); } public function gotoAndPlay(_arg1:uint):void{ stop(); setFrame(_arg1); play(); } public function stop():void{ m_objRendererPrev.stop(m_uRenderMethod); m_objRendererNext.stop(m_uRenderMethod); dispatchEvent(new AnimationEvent(AnimationEvent.STOP)); } public function playReverse():void{ stop(); dispatchEvent(new AnimationEvent(AnimationEvent.START)); m_objRendererPrev.start(m_uRenderMethod); } public function set loop(_arg1:Boolean):void{ m_bLoop = _arg1; } protected function init(_arg1:uint, _arg2:Number):void{ BoostworthyAnimation.log(); setFrameRate(_arg2); m_uRenderMethod = _arg1; m_objRendererPrev = new Renderer(onPrevFrameEF, onPrevFrameT, m_nRefreshRate); m_objRendererNext = new Renderer(onNextFrameEF, onNextFrameT, m_nRefreshRate); m_objTweenStack = new TweenStack(); m_uFrame = (m_uLength = 1); loop = DEFAULT_LOOP; } public function gotoAndStop(_arg1:uint):void{ stop(); setFrame(_arg1); } protected function onPrevFrameT(_arg1:TimerEvent):void{ prevFrame(); _arg1.updateAfterEvent(); } public function nextFrame():void{ setFrame((m_uFrame + 1)); } protected function render(_arg1:Boolean=false):void{ var _local2:IIterator = m_objTweenStack.getIterator((_arg1) ? IteratorType.ARRAY_REVERSE : IteratorType.ARRAY_FORWARD); while (_local2.hasNext()) { _local2.next().renderFrame(m_uFrame); }; } public function get loop():Boolean{ return (m_bLoop); } public function get length():Number{ return (m_uLength); } public function setFrameRate(_arg1:Number):void{ m_uFrameRate = ((_arg1)>0) ? _arg1 : DEFAULT_FRAME_RATE; m_nRefreshRate = Math.floor((1000 / m_uFrameRate)); } public function addTween(_arg1:ITween):void{ var _local2:ITween = _arg1.clone(); m_uLength = ((_local2.lastFrame)>m_uLength) ? _local2.lastFrame : m_uLength; m_objTweenStack.addElement(_local2); computeFrameData(_local2.firstFrame, _local2.lastFrame); } public function dispose():void{ stop(); m_objRendererPrev.dispose(); m_objRendererNext.dispose(); m_objTweenStack.dispose(); m_uRenderMethod = NaN; m_uFrameRate = NaN; m_nRefreshRate = NaN; m_uFrame = NaN; m_uLength = NaN; m_bLoop = false; } protected function onNextFrameT(_arg1:TimerEvent):void{ nextFrame(); _arg1.updateAfterEvent(); } protected function setFrame(_arg1:Number):void{ var _local2:Boolean; var _local3:Boolean; if (_arg1 > m_uLength){ if (m_bLoop){ _arg1 = 1; } else { _local3 = true; }; }; if (_arg1 < 1){ if (m_bLoop){ _arg1 = m_uLength; _local2 = true; } else { _local3 = true; }; }; m_uFrame = Math.min(Math.max(1, _arg1), m_uLength); if (!_local3){ render(_local2); }; dispatchEvent(new AnimationEvent(AnimationEvent.CHANGE)); if (_local3){ stop(); dispatchEvent(new AnimationEvent(AnimationEvent.FINISH)); }; } public function gotoAndPlayReverse(_arg1:uint):void{ stop(); setFrame(_arg1); playReverse(); } public function play():void{ stop(); dispatchEvent(new AnimationEvent(AnimationEvent.START)); m_objRendererNext.start(m_uRenderMethod); } protected function onPrevFrameEF(_arg1:Event):void{ prevFrame(); } } }//package com.boostworthy.animation.sequence
Section 109
//TweenStack (com.boostworthy.animation.sequence.TweenStack) package com.boostworthy.animation.sequence { import com.boostworthy.animation.sequence.tweens.*; import com.boostworthy.collections.iterators.*; import com.boostworthy.collections.*; public class TweenStack extends Stack { override public function addElement(_arg1:Object):void{ var _local7:ITween; var _local2:ITween = (_arg1 as ITween); var _local3:Array = new Array(); var _local4:IIterator = getIterator(); while (_local4.hasNext()) { _local7 = (_local4.next() as ITween); if ((((_local7.target == _local2.target)) && ((_local7.property == _local2.property)))){ if (_local7.firstFrame > _local2.firstFrame){ _local3.push(_local7.clone()); removeElement(_local7); }; }; }; super.addElement(_local2); var _local5:int = _local3.length; var _local6:int; while (_local6 < _local5) { super.addElement(_local3[_local6]); _local6++; }; } } }//package com.boostworthy.animation.sequence
Section 110
//BoostworthyAnimation (com.boostworthy.animation.BoostworthyAnimation) package com.boostworthy.animation { import com.boostworthy.utils.logger.*; public final class BoostworthyAnimation { public static const VERSION:String = "2.1"; public static const AUTHOR:String = "Copyright (c) 2007 Ryan Taylor | http://www.boostworthy.com"; public static const NAME:String = "Boostworthy Animation System"; public static const DATE:String = "06.07.2007"; private static var c_bIsLogged:Boolean; public static function log():void{ if (!c_bIsLogged){ LogFactory.getInstance().getLog(NAME).info(((("Version " + VERSION) + " :: ") + AUTHOR)); c_bIsLogged = true; }; } } }//package com.boostworthy.animation
Section 111
//ForwardArrayIterator (com.boostworthy.collections.iterators.ForwardArrayIterator) package com.boostworthy.collections.iterators { public class ForwardArrayIterator implements IIterator { private var m_aData:Array; private var m_uIndex:uint; public function ForwardArrayIterator(_arg1:Array){ m_aData = _arg1; reset(); } public function reset():void{ m_uIndex = 0; } public function next():Object{ return (m_aData[m_uIndex++]); } public function hasNext():Boolean{ return ((m_uIndex < m_aData.length)); } } }//package com.boostworthy.collections.iterators
Section 112
//IIterator (com.boostworthy.collections.iterators.IIterator) package com.boostworthy.collections.iterators { public interface IIterator { function next():Object; function hasNext():Boolean; function reset():void; } }//package com.boostworthy.collections.iterators
Section 113
//IteratorType (com.boostworthy.collections.iterators.IteratorType) package com.boostworthy.collections.iterators { public final class IteratorType { public static const NULL:uint = 1; public static const ARRAY_REVERSE:uint = 4; public static const ARRAY_FORWARD:uint = 2; } }//package com.boostworthy.collections.iterators
Section 114
//ReverseArrayIterator (com.boostworthy.collections.iterators.ReverseArrayIterator) package com.boostworthy.collections.iterators { public class ReverseArrayIterator implements IIterator { private var m_aData:Array; private var m_uIndex:uint; public function ReverseArrayIterator(_arg1:Array){ m_aData = _arg1; reset(); } public function reset():void{ m_uIndex = m_aData.length; } public function next():Object{ return (m_aData[--m_uIndex]); } public function hasNext():Boolean{ return ((m_uIndex > 0)); } } }//package com.boostworthy.collections.iterators
Section 115
//HashMap (com.boostworthy.collections.HashMap) package com.boostworthy.collections { import com.boostworthy.collections.iterators.*; import com.boostworthy.core.*; public class HashMap implements ICollection, IDisposable { protected var m_aKeys:Array; protected var m_aValues:Array; public function HashMap(_arg1:Object=null){ init(_arg1); } public function containsKey(_arg1:Object):Boolean{ return (!((searchForKey(_arg1) == Global.NULL_INDEX))); } public function remove(_arg1:Object):void{ var _local2:int = searchForKey(_arg1); if (_local2 != Global.NULL_INDEX){ m_aKeys.splice(_local2, 1); m_aValues.splice(_local2, 1); }; } public function getValueIterator(_arg1:uint=2):IIterator{ if (_arg1 == IteratorType.ARRAY_FORWARD){ return (new ForwardArrayIterator(m_aValues.concat())); }; if (_arg1 == IteratorType.ARRAY_REVERSE){ return (new ReverseArrayIterator(m_aValues.concat())); }; return (new ForwardArrayIterator(m_aValues.concat())); } public function getIterator(_arg1:uint=2):IIterator{ return (getValueIterator(_arg1)); } public function putMap(_arg1:Object):void{ var _local2:String; for (_local2 in _arg1) { put(_local2, _arg1[_local2]); }; } public function put(_arg1:Object, _arg2:Object):void{ remove(_arg1); m_aKeys.push(_arg1); m_aValues.push(_arg2); } protected function init(_arg1:Object):void{ dispose(); if (_arg1 != null){ putMap(_arg1); }; } public function get length():uint{ return (m_aKeys.length); } public function get(_arg1:Object):Object{ var _local2:int = searchForKey(_arg1); if (_local2 != Global.NULL_INDEX){ return (m_aValues[_local2]); }; return (null); } public function getKeyIterator(_arg1:uint=2):IIterator{ if (_arg1 == IteratorType.ARRAY_FORWARD){ return (new ForwardArrayIterator(m_aKeys.concat())); }; if (_arg1 == IteratorType.ARRAY_REVERSE){ return (new ReverseArrayIterator(m_aKeys.concat())); }; return (new ForwardArrayIterator(m_aKeys.concat())); } public function clone():HashMap{ var _local1:HashMap = new HashMap(); var _local2:int = m_aKeys.length; var _local3:int; while (_local3 < _local2) { _local1.put(m_aKeys[_local3], m_aValues[_local3]); _local3++; }; return (_local1); } protected function searchForKey(_arg1:Object):int{ var _local2:int = m_aKeys.length; var _local3:int; while (_local3 < _local2) { if (m_aKeys[_local3] === _arg1){ return (_local3); }; _local3++; }; return (Global.NULL_INDEX); } public function dispose():void{ m_aKeys = new Array(); m_aValues = new Array(); } } }//package com.boostworthy.collections
Section 116
//ICollection (com.boostworthy.collections.ICollection) package com.boostworthy.collections { import com.boostworthy.collections.iterators.*; public interface ICollection { function getIterator(_arg1:uint=2):IIterator; } }//package com.boostworthy.collections
Section 117
//Stack (com.boostworthy.collections.Stack) package com.boostworthy.collections { import com.boostworthy.collections.iterators.*; import com.boostworthy.core.*; public class Stack implements ICollection, IDisposable { protected var m_aData:Array; public function Stack(){ dispose(); } public function getIterator(_arg1:uint=2):IIterator{ if (_arg1 == IteratorType.ARRAY_FORWARD){ return (new ForwardArrayIterator(m_aData.concat())); }; if (_arg1 == IteratorType.ARRAY_REVERSE){ return (new ReverseArrayIterator(m_aData.concat())); }; return (new ForwardArrayIterator(m_aData.concat())); } private function getElementIndex(_arg1:Object):int{ var _local2:int; while (_local2 < m_aData.length) { if (m_aData[_local2] === _arg1){ return (_local2); }; _local2++; }; return (Global.NULL_INDEX); } public function get length():uint{ return (m_aData.length); } public function removeElement(_arg1:Object):void{ var _local2:int = getElementIndex(_arg1); if (_local2 != Global.NULL_INDEX){ m_aData.splice(_local2, 1); }; } public function addElement(_arg1:Object):void{ m_aData.unshift(_arg1); } public function dispose():void{ m_aData = new Array(); } } }//package com.boostworthy.collections
Section 118
//Global (com.boostworthy.core.Global) package com.boostworthy.core { import flash.display.*; public final class Global { private static var c_objStage:Stage; public static var NULL_INDEX:int = -1; public function Global(){ throw (new Error("ERROR -> Global :: Constructor :: The 'Global' class is not meant to be instantiated.")); } public static function set stage(_arg1:Stage):void{ c_objStage = _arg1; } public static function get stage():Stage{ return (c_objStage); } } }//package com.boostworthy.core
Section 119
//IDisposable (com.boostworthy.core.IDisposable) package com.boostworthy.core { public interface IDisposable { function dispose():void; } }//package com.boostworthy.core
Section 120
//AnimationEvent (com.boostworthy.events.AnimationEvent) package com.boostworthy.events { import flash.events.*; public class AnimationEvent extends Event { protected var m_strProperty:String; protected var m_objTarget:Object; public static const CHANGE:String = "animationChange"; public static const STOP:String = "animationStop"; public static const START:String = "animationStart"; public static const FINISH:String = "animationFinish"; public function AnimationEvent(_arg1:String, _arg2:Object=null, _arg3:String=""){ super(_arg1); m_objTarget = _arg2; m_strProperty = _arg3; } public function get animTarget():Object{ return (m_objTarget); } public function get animProperty():String{ return (m_strProperty); } } }//package com.boostworthy.events
Section 121
//ILog (com.boostworthy.utils.logger.ILog) package com.boostworthy.utils.logger { public interface ILog { function getName():String; function setLevel(_arg1:uint):void; function debug(_arg1:String):void; function severe(_arg1:String):void; function getLevel():uint; function warning(_arg1:String):void; function info(_arg1:String):void; } }//package com.boostworthy.utils.logger
Section 122
//Log (com.boostworthy.utils.logger.Log) package com.boostworthy.utils.logger { public class Log implements ILog { protected var m_strName:String; protected var m_uLevel:uint; public function Log(_arg1:String, _arg2:uint){ init(_arg1, _arg2); } protected function output(_arg1:String, _arg2:uint):void{ if (((!((m_uLevel & LogLevel.OFF))) && ((m_uLevel >= _arg2)))){ trace(createOutputMessage(_arg1, _arg2)); }; } public function getName():String{ return (m_strName); } public function setLevel(_arg1:uint):void{ m_uLevel = _arg1; } protected function createOutputMessage(_arg1:String, _arg2:uint):String{ return ((((((m_strName + " (") + getLevelName(_arg2)) + ") :: ") + _arg1) + "\n")); } public function getLevel():uint{ return (m_uLevel); } protected function init(_arg1:String, _arg2:uint):void{ m_strName = _arg1; m_uLevel = _arg2; } protected function getLevelName(_arg1:uint):String{ switch (_arg1){ case LogLevel.OFF: return ("OFF"); case LogLevel.SEVERE: return ("SEVERE"); case LogLevel.WARNING: return ("WARNING"); case LogLevel.INFO: return ("INFO"); case LogLevel.DEBUG: return ("DEBUG"); default: return (""); }; } public function debug(_arg1:String):void{ output(_arg1, LogLevel.DEBUG); } public function severe(_arg1:String):void{ output(_arg1, LogLevel.SEVERE); } public function warning(_arg1:String):void{ output(_arg1, LogLevel.WARNING); } public function info(_arg1:String):void{ output(_arg1, LogLevel.INFO); } } }//package com.boostworthy.utils.logger
Section 123
//LogFactory (com.boostworthy.utils.logger.LogFactory) package com.boostworthy.utils.logger { import com.boostworthy.collections.iterators.*; import com.boostworthy.collections.*; import com.boostworthy.core.*; public class LogFactory implements IDisposable { private var m_uLevel:uint; private var m_objLogHash:HashMap; private static var c_objInstance:LogFactory; public function LogFactory(_arg1:SingletonEnforcer){ init(); } protected function init():void{ m_uLevel = LogSettings.DEFAULT_LOG_LEVEL; m_objLogHash = new HashMap(); } public function getLog(_arg1:String):ILog{ if (m_objLogHash.containsKey(_arg1)){ return ((m_objLogHash.get(_arg1) as ILog)); }; m_objLogHash.put(_arg1, new Log(_arg1, m_uLevel)); return ((m_objLogHash.get(_arg1) as ILog)); } public function setLevel(_arg1:uint):void{ m_uLevel = _arg1; var _local2:IIterator = m_objLogHash.getValueIterator(); while (_local2.hasNext()) { _local2.next().setLevel(m_uLevel); }; } public function getLevel():uint{ return (m_uLevel); } public function dispose():void{ m_objLogHash.dispose(); } public static function getInstance():LogFactory{ if (c_objInstance == null){ c_objInstance = new LogFactory(new SingletonEnforcer()); }; return (c_objInstance); } } }//package com.boostworthy.utils.logger class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 124
//LogLevel (com.boostworthy.utils.logger.LogLevel) package com.boostworthy.utils.logger { public final class LogLevel { public static const SEVERE:uint = 2; public static const INFO:uint = 8; public static const DEBUG:uint = 16; public static const WARNING:uint = 4; public static const OFF:uint = 1; } }//package com.boostworthy.utils.logger
Section 125
//LogSettings (com.boostworthy.utils.logger.LogSettings) package com.boostworthy.utils.logger { public final class LogSettings { public static const DEFAULT_LOG_LEVEL:uint = 16; } }//package com.boostworthy.utils.logger
Section 126
//Color (fl.motion.Color) package fl.motion { import flash.display.*; import flash.geom.*; public class Color extends ColorTransform { private var _tintColor:Number;// = 0 private var _tintMultiplier:Number;// = 0 public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){ super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8); } private function deriveTintColor():uint{ var _local1:Number = (1 / this.tintMultiplier); var _local2:uint = Math.round((this.redOffset * _local1)); var _local3:uint = Math.round((this.greenOffset * _local1)); var _local4:uint = Math.round((this.blueOffset * _local1)); var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4); return (_local5); } public function set brightness(_arg1:Number):void{ if (_arg1 > 1){ _arg1 = 1; } else { if (_arg1 < -1){ _arg1 = -1; }; }; var _local2:Number = (1 - Math.abs(_arg1)); var _local3:Number = 0; if (_arg1 > 0){ _local3 = (_arg1 * 0xFF); }; this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2)); this.redOffset = (this.greenOffset = (this.blueOffset = _local3)); } private function parseXML(_arg1:XML=null):Color{ var _local3:XML; var _local4:String; var _local5:uint; if (!_arg1){ return (this); }; var _local2:XML = _arg1.elements()[0]; if (!_local2){ return (this); }; for each (_local3 in _local2.attributes()) { _local4 = _local3.localName(); if (_local4 == "tintColor"){ _local5 = (Number(_local3.toString()) as uint); this.tintColor = _local5; } else { this[_local4] = Number(_local3.toString()); }; }; return (this); } public function get tintColor():uint{ return (this._tintColor); } public function set tintColor(_arg1:uint):void{ this.setTint(_arg1, this.tintMultiplier); } public function get brightness():Number{ return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1)); } public function set tintMultiplier(_arg1:Number):void{ this.setTint(this.tintColor, _arg1); } public function get tintMultiplier():Number{ return (this._tintMultiplier); } public function setTint(_arg1:uint, _arg2:Number):void{ this._tintColor = _arg1; this._tintMultiplier = _arg2; this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2))); var _local3:uint = ((_arg1 >> 16) & 0xFF); var _local4:uint = ((_arg1 >> 8) & 0xFF); var _local5:uint = (_arg1 & 0xFF); this.redOffset = Math.round((_local3 * _arg2)); this.greenOffset = Math.round((_local4 * _arg2)); this.blueOffset = Math.round((_local5 * _arg2)); } public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{ var _local4:Number = (1 - _arg3); var _local5:uint = ((_arg1 >> 24) & 0xFF); var _local6:uint = ((_arg1 >> 16) & 0xFF); var _local7:uint = ((_arg1 >> 8) & 0xFF); var _local8:uint = (_arg1 & 0xFF); var _local9:uint = ((_arg2 >> 24) & 0xFF); var _local10:uint = ((_arg2 >> 16) & 0xFF); var _local11:uint = ((_arg2 >> 8) & 0xFF); var _local12:uint = (_arg2 & 0xFF); var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3)); var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3)); var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3)); var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3)); var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16); return (_local17); } public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{ var _local4:Number = (1 - _arg3); var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3))); return (_local5); } public static function fromXML(_arg1:XML):Color{ return (Color(new (Color).parseXML(_arg1))); } } }//package fl.motion
Section 127
//MaxFirePowerIndicator_60 (graphics_fla.MaxFirePowerIndicator_60) package graphics_fla { import flash.display.*; public dynamic class MaxFirePowerIndicator_60 extends MovieClip { public var bar:MovieClip; } }//package graphics_fla
Section 128
//ByteArrayAsset (mx.core.ByteArrayAsset) package mx.core { import flash.utils.*; public class ByteArrayAsset extends ByteArray implements IFlexAsset { mx_internal static const VERSION:String = "3.3.0.4852"; } }//package mx.core
Section 129
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 130
//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 131
//logo_2 (Preloader_2DPlay_fla.logo_2) package Preloader_2DPlay_fla { import flash.display.*; public dynamic class logo_2 extends MovieClip { public var animation:MovieClip; public var progressBar:MovieClip; } }//package Preloader_2DPlay_fla
Section 132
//preloader_progress_bar_4 (Preloader_2DPlay_fla.preloader_progress_bar_4) package Preloader_2DPlay_fla { import flash.display.*; public dynamic class preloader_progress_bar_4 extends MovieClip { public var progressBarMask:MovieClip; } }//package Preloader_2DPlay_fla
Section 133
//CampaignLostController (tanks2.core.campaignEndMenu.CampaignLostController) package tanks2.core.campaignEndMenu { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.game.*; import tanks2.managers.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class CampaignLostController extends EventDispatcher implements IController { private var _view:CampaignLostView; public function CampaignLostController(){ var _local1:PlayerInfo = GameInfo.humanPlayersList[0]; _view = new CampaignLostView(this, _local1.score); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function returnToSplashMenu():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.END_GAME)); } public function get view():DisplayObject{ return (_view); } public function dispose():void{ _view.dispose(); _view = null; } public function replayGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.REPLAY)); } public function submitScore():void{ var _local1:PlayerInfo = GameInfo.humanPlayersList[0]; Managers.urlCaller.submitScore(_local1.score); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } } }//package tanks2.core.campaignEndMenu
Section 134
//CampaignLostView (tanks2.core.campaignEndMenu.CampaignLostView) package tanks2.core.campaignEndMenu { import flash.events.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import com.bigwigmedia.ui.containers.*; public class CampaignLostView extends LayoutContainer { private var submitScoreBtn:LabelButton; private var replayGameBtn:LabelButton; private var bigBattleBtn:LabelButton; private var twoDPlayBtn:DecoratedIconicButton; private var splashMenuBtn:LabelButton; private var _controller:CampaignLostController; private var viewScoresBtn:LabelButton; public function CampaignLostView(_arg1:CampaignLostController, _arg2:int){ _controller = _arg1; addChild(new CampaignLostViewBackground()); this.setSize(640, 480); var _local3:Label = new Label(); _local3.text = ("SCORE: $" + String(_arg2)); addChildToLayout(_local3, {horizontalCenter:0, top:80}); submitScoreBtn = new LabelButton(); submitScoreBtn.label = "SUBMIT SCORE"; addChildToLayout(submitScoreBtn, {horizontalCenter:0, bottom:200}); viewScoresBtn = new LabelButton(); viewScoresBtn.label = "VIEW SCORES"; addChildToLayout(viewScoresBtn, {horizontalCenter:0, bottom:170}); bigBattleBtn = new LabelButton(); bigBattleBtn.label = "VISIT Big-Battle.com"; addChildToLayout(bigBattleBtn, {horizontalCenter:0, bottom:140}); replayGameBtn = new LabelButton(); replayGameBtn.label = "TRY AGAIN"; addChildToLayout(replayGameBtn, {horizontalCenter:0, bottom:110}); splashMenuBtn = new LabelButton(); splashMenuBtn.label = "RETURN TO MAIN MENU"; addChildToLayout(splashMenuBtn, {horizontalCenter:0, bottom:80}); twoDPlayBtn = new DecoratedIconicButton(); twoDPlayBtn.upIcon = TwoDPlayButtonIcon; addChildToLayout(twoDPlayBtn, {horizontalCenter:0, bottom:20}); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case submitScoreBtn: _controller.submitScore(); break; case viewScoresBtn: Managers.urlCaller.viewScores(); break; case twoDPlayBtn: Managers.urlCaller.mainLink(); break; case replayGameBtn: _controller.replayGame(); break; case splashMenuBtn: _controller.returnToSplashMenu(); break; case bigBattleBtn: Managers.urlCaller.getURL("http://www.big-battle.com/index.html?ref=tanksgame"); break; }; } override public function dispose():void{ this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); super.dispose(); } } }//package tanks2.core.campaignEndMenu
Section 135
//CampaignWonController (tanks2.core.campaignEndMenu.CampaignWonController) package tanks2.core.campaignEndMenu { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.game.*; import tanks2.managers.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class CampaignWonController extends EventDispatcher implements IController { private var _view:CampaignWonView; public function CampaignWonController(){ var _local1:PlayerInfo = GameInfo.humanPlayersList[0]; _view = new CampaignWonView(this, _local1.score); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function returnToSplashMenu():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.END_GAME)); } public function get view():DisplayObject{ return (_view); } public function dispose():void{ _view.dispose(); _view = null; } public function replayGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.REPLAY)); } public function submitScore():void{ var _local1:PlayerInfo = GameInfo.humanPlayersList[0]; Managers.urlCaller.submitScore(_local1.score); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } } }//package tanks2.core.campaignEndMenu
Section 136
//CampaignWonView (tanks2.core.campaignEndMenu.CampaignWonView) package tanks2.core.campaignEndMenu { import flash.events.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import flash.text.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.ui.styles.*; public class CampaignWonView extends LayoutContainer { private var submitScoreBtn:LabelButton; private var viewScoresBtn:LabelButton; private var twoDPlayBtn:DecoratedIconicButton; private var _controller:CampaignWonController; private var splashMenuBtn:LabelButton; public function CampaignWonView(_arg1:CampaignWonController, _arg2:int){ _controller = _arg1; addChild(new CampaignWonViewBackground()); this.setSize(640, 480); var _local3:Label = new Label(); _local3.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 40, 0xFFFFFF)); _local3.text = ("FINAL SCORE: " + String(_arg2)); addChildToLayout(_local3, {horizontalCenter:0, top:80}); submitScoreBtn = new LabelButton(); submitScoreBtn.label = "SUBMIT SCORE"; addChildToLayout(submitScoreBtn, {horizontalCenter:0, bottom:140}); viewScoresBtn = new LabelButton(); viewScoresBtn.label = "VIEW SCORES"; addChildToLayout(viewScoresBtn, {horizontalCenter:0, bottom:110}); splashMenuBtn = new LabelButton(); splashMenuBtn.label = "RETURN TO MAIN MENU"; addChildToLayout(splashMenuBtn, {horizontalCenter:0, bottom:80}); twoDPlayBtn = new DecoratedIconicButton(); twoDPlayBtn.upIcon = TwoDPlayButtonIcon; addChildToLayout(twoDPlayBtn, {horizontalCenter:0, bottom:20}); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case submitScoreBtn: _controller.submitScore(); break; case viewScoresBtn: Managers.urlCaller.viewScores(); break; case twoDPlayBtn: Managers.urlCaller.mainLink(); break; case splashMenuBtn: _controller.returnToSplashMenu(); break; }; } override public function dispose():void{ this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); super.dispose(); } } }//package tanks2.core.campaignEndMenu
Section 137
//DeathmatchCompletedController (tanks2.core.deathmatchCompleted.DeathmatchCompletedController) package tanks2.core.deathmatchCompleted { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class DeathmatchCompletedController extends EventDispatcher implements IController { private var _view:DeathmatchCompletedView; private var subController:IController; public function DeathmatchCompletedController(){ _view = new DeathmatchCompletedView(this); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function get view():DisplayObject{ return (_view); } public function endGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.END_GAME)); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } public function replayGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.REPLAY)); } public function dispose():void{ _view.dispose(); _view = null; } } }//package tanks2.core.deathmatchCompleted
Section 138
//DeathmatchCompletedView (tanks2.core.deathmatchCompleted.DeathmatchCompletedView) package tanks2.core.deathmatchCompleted { import flash.events.*; import tanks2.core.game.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import flash.text.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.ui.styles.*; public class DeathmatchCompletedView extends LayoutContainer { private var twoDPlayBtn:DecoratedIconicButton; private var replayGameBtn:LabelButton; private var _controller:DeathmatchCompletedController; private var endGameBtn:LabelButton; public function DeathmatchCompletedView(_arg1:DeathmatchCompletedController){ var _local6:PlayerInfo; var _local7:Label; var _local8:TextFormat; var _local9:Label; var _local10:Label; var _local11:Label; var _local12:Label; super(); _controller = _arg1; addChild(new DeathmatchCompletedViewBackground()); this.setSize(640, 480); replayGameBtn = new LabelButton(); replayGameBtn.label = "REPLAY MATCH"; addChildToLayout(replayGameBtn, {right:20, bottom:20}); endGameBtn = new LabelButton(); endGameBtn.label = "MAIN MENU"; addChildToLayout(endGameBtn, {left:20, bottom:20}); twoDPlayBtn = new DecoratedIconicButton(); twoDPlayBtn.upIcon = TwoDPlayButtonIcon; addChildToLayout(twoDPlayBtn, {horizontalCenter:0, bottom:15}); var _local2:Array = GameInfo.deathmatchResultsPlayersSortedList(); var _local3:int = _local2.length; var _local4 = 142; var _local5:int; while (_local5 < _local3) { _local6 = _local2[_local5]; _local7 = new Label(); _local8 = new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 26, _local6.color); _local7.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local8); _local7.setStyle(AbstractComponentStyle.DECORATION, null); _local7.move(0, _local4); _local7.text = _local6.name; addChildToLayout(_local7, {horizontalCenter:-200}); _local9 = new Label(); _local9.setStyle(AbstractComponentStyle.DECORATION, null); _local9.move(0, _local4); _local9.text = String(_local6.numRoundWins); addChildToLayout(_local9, {horizontalCenter:-95}); _local10 = new Label(); _local10.setStyle(AbstractComponentStyle.DECORATION, null); _local10.move(0, _local4); _local10.text = String(_local6.score); addChildToLayout(_local10, {horizontalCenter:5}); _local11 = new Label(); _local11.setStyle(AbstractComponentStyle.DECORATION, null); _local11.move(0, _local4); _local11.text = String(_local6.numKills); addChildToLayout(_local11, {horizontalCenter:105}); _local12 = new Label(); _local12.setStyle(AbstractComponentStyle.DECORATION, null); _local12.move(0, _local4); _local12.text = String(_local6.totalDamage); addChildToLayout(_local12, {horizontalCenter:205}); _local4 = (_local4 + 40); _local5++; }; this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); } override public function dispose():void{ this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); super.dispose(); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case twoDPlayBtn: Managers.urlCaller.mainLink(); break; case replayGameBtn: _controller.replayGame(); break; case endGameBtn: _controller.endGame(); break; }; } } }//package tanks2.core.deathmatchCompleted
Section 139
//ControllerEvent (tanks2.core.events.ControllerEvent) package tanks2.core.events { import flash.events.*; public class ControllerEvent extends Event { private var _data; private var _command:String; public static const READY:String = "ControllerEvent.ready"; public static const FINISH:String = "ControllerEvent.finish"; public function ControllerEvent(_arg1:String, _arg2:String=null, _arg3=null){ super(_arg1); _command = _arg2; _data = _arg3; } public function get data(){ return (_data); } public function get command():String{ return (_command); } override public function clone():Event{ return (new ControllerEvent(type, _command, _data)); } } }//package tanks2.core.events
Section 140
//CPUTankController (tanks2.core.game.ai.CPUTankController) package tanks2.core.game.ai { import com.bigwigmedia.statemachine.hsm.*; import tanks2.core.game.*; import tanks2.managers.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.math.*; import com.bigwigmedia.core.*; import flash.utils.*; import com.bigwigmedia.statemachine.hsm.utils.*; public class CPUTankController implements IUpdatable, IDisposable { private var targetCannonAngle:int; private var _tank:Tank; private var stateMachine:HSM; private var selectedWeapon:String; private var _cpuLevel:int; private var infoToCurrentAccuracyDict:Dictionary; private var targetFirePower:int; private var statePauseCounter:int;// = 0 private var _controller:GameController; public static const FRAMED_PAUSE_BETWEEN_STATES:int = 35; private static var rangedWeapons:Array = [WeaponType.STANDARD_SHELL, WeaponType.ARMOR_PIERCING, WeaponType.POP_CORN_BOMB, WeaponType.CLUSTER, WeaponType.INCENDIARY_CLUSTER, WeaponType.ATOM_BOMB, WeaponType.TACTICAL_NUKE, WeaponType.MINI_ROLLER, WeaponType.BIG_ROLLER, WeaponType.INCENDIARY_ROLLER, WeaponType.HIGH_EXPLOSIVE_ROLLER]; private static var levelBestAccuracy:Array = [1.06, 1.05, 1.03, 1.02, 1]; private static var levelWorstAccuracy:Array = [1.35, 1.3, 1.25, 1.15, 1.1]; private static var levelAdjustAccuracyRate:Array = [2.3, 2.2, 2.1, 2, 1.9]; public function CPUTankController(_arg1:GameController){ infoToCurrentAccuracyDict = new Dictionary(); super(); _controller = _arg1; stateMachine = new HSM("CPUTankController_HSM"); stateMachine.addState(new InitialState("initial")); stateMachine.addState(new SimpleState("thinking", null, doThinking, null)); stateMachine.addState(new SimpleState("selecting_weapon", null, doSelectingWeapon, null)); stateMachine.addState(new SimpleState("moving", null, doMoving, null)); stateMachine.addState(new SimpleState("aiming", null, doAiming, null)); stateMachine.addState(new SimpleState("completed", fire)); stateMachine.addTransition("initial", "thinking", "start_thinking"); stateMachine.addTransition("thinking", "selecting_weapon", "start_selecting_weapon"); stateMachine.addTransition("selecting_weapon", "aiming", "start_aiming"); stateMachine.addTransition("selecting_weapon", "moving", "start_moving"); stateMachine.addTransition("moving", "aiming", "start_aiming"); stateMachine.addTransition("aiming", "selecting_weapon", "start_selecting_weapon"); stateMachine.addTransition("aiming", "completed", "fire"); stateMachine.addTransition("completed", "thinking", "start_thinking"); stateMachine.start(); Debugger.registerHSM(stateMachine); } private function selectCloseRangeWeapon(_arg1:int):void{ var _local3:int; var _local4:String; var _local5:int; var _local2:String = WeaponType.STANDARD_SHELL; _local3 = (rangedWeapons.length - 1); while (_local3 >= 0) { _local4 = rangedWeapons[_local3]; if (_tank.playerInfo.getWeaponAmount(_local4) != 0){ _local5 = Managers.configManager.getWeaponDamageRadius(_local4); switch (_local4){ case WeaponType.ATOM_BOMB: case WeaponType.TACTICAL_NUKE: if (_arg1 > _local5){ _local2 = _local4; break; }; break; case WeaponType.ARMOR_PIERCING: _local2 = _local4; break; }; }; _local3--; }; selectedWeapon = _local2; } private function useUpgrades():void{ if (_tank.playerInfo.healthPercentage <= 0.5){ if (_tank.playerInfo.getUpgradeAmount(UpgradeType.REPAIR_KIT) != 0){ _controller.activateRepair(true); } else { if ((((_tank.playerInfo.shield == 0)) && (!((_tank.playerInfo.getUpgradeAmount(UpgradeType.SHIELD) == 0))))){ _controller.activateShield(true); }; }; }; } public function initialize(_arg1:Tank):void{ _tank = _arg1; _cpuLevel = _tank.playerInfo.cpuLevel; stateMachine.sendSignal(new SignalEvent("start_thinking")); statePauseCounter = FRAMED_PAUSE_BETWEEN_STATES; } private function doSelectingWeapon(_arg1:SignalEvent):void{ if (_tank.playerInfo.selectedWeapon != selectedWeapon){ _controller.selectNextWeapon(); } else { stateMachine.sendSignal(new SignalEvent("start_aiming")); }; } public function update():void{ stateMachine.update(); } private function doThinking(_arg1:SignalEvent):void{ var _local2:Tank; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; if (--statePauseCounter <= 0){ useUpgrades(); _local2 = findTarget(); _local3 = _local2.x; _local4 = _local2.y; _local5 = (_local3 - _tank.x); _local6 = (_local4 - _tank.y); _local7 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6))); if (_local7 < 80){ selectCloseRangeWeapon(_local7); } else { selectWeapon(); }; calculateShootParams(); }; } private function fire(_arg1:SignalEvent):void{ _controller.fire(); } private function doAiming(_arg1:SignalEvent):void{ var _local4:int; var _local5:int; var _local2:int = (targetCannonAngle - _tank.cannonAngle); if (_local2 != 0){ _local4 = (_tank.cannonAngle + ((_local2 > 0)) ? 2 : -2); if (Math.abs((targetCannonAngle - _local4)) <= 2){ _local4 = targetCannonAngle; }; _controller.setCannonAngle(_local4); }; var _local3:int = (targetFirePower - _tank.firePower); if (_local3 != 0){ _local5 = (_tank.firePower + ((_local3 > 0)) ? 1 : -1); _controller.setFirePower(_local5); }; if ((((_local2 == 0)) && ((_local3 == 0)))){ stateMachine.sendSignal(new SignalEvent("fire")); }; } private function findTarget():Tank{ var _local3:Tank; var _local4:Tank; var _local5:Number; var _local6:Number; var _local7:Number; var _local1:Array = GameItem.getTanksList(); var _local2:Number = Number.MAX_VALUE; for each (_local4 in _local1) { if (_local4 != _tank){ _local5 = (_tank.x - _local4.x); _local6 = (_tank.y - _local4.y); _local7 = ((_local5 * _local5) + (_local6 * _local6)); if (_local7 < _local2){ _local2 = _local7; _local3 = _local4; }; }; }; return (_local3); } public function affectAccuracy(_arg1:Tank):void{ var _local3:int; var _local2:PlayerInfo = _arg1.playerInfo; if (infoToCurrentAccuracyDict[_local2] !== undefined){ _local3 = _local2.cpuLevel; infoToCurrentAccuracyDict[_local2] = levelWorstAccuracy[_local3]; }; } public function dispose():void{ infoToCurrentAccuracyDict = new Dictionary(); _tank = null; _controller = null; stateMachine.dispose(); stateMachine = null; } private function selectWeapon():void{ var _local2:String; var _local1:int = (rangedWeapons.length - 1); while (_local1 >= 0) { _local2 = rangedWeapons[_local1]; if (_tank.playerInfo.getWeaponAmount(_local2) != 0){ selectedWeapon = _local2; break; }; _local1--; }; } private function doMoving(_arg1:SignalEvent):void{ } private function calculateShootParams():void{ var _local14:int; var _local15:Number; var _local16:Number; var _local17:Vector2D; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:int; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local1:Tank = findTarget(); var _local2:Number = _local1.x; var _local3:Number = _local1.y; var _local4:Number = (_local2 - _tank.x); var _local5:Number = (_local3 - _tank.y); var _local6:Number = Math.sqrt(((_local4 * _local4) + (_local5 * _local5))); var _local7:Number = (_tank.playerInfo.maxFirePower / 6); var _local8:Number = 5; var _local9:Number = (GameItem.wind * Managers.configManager.getWindMultiplier()); var _local10:Number = GameItem.GRAVITY; var _local11:Number = infoToCurrentAccuracyDict[_tank.playerInfo]; if (isNaN(_local11)){ _local11 = (infoToCurrentAccuracyDict[_tank.playerInfo] = levelWorstAccuracy[_cpuLevel]); }; while (true) { _local14 = Math.abs(((_local8 * _local6) / _local7)); _local15 = (((_local4 * _local11) - (((_local9 * _local14) * _local14) / 2)) / _local14); _local16 = (((_local5 * _local11) - (((_local10 * _local14) * _local14) / 2)) / _local14); _local17 = new Vector2D(_local15, _local16); if (_local16 <= 0){ if (_local17.length < _local7){ _local18 = Math.atan2(_local5, _local4); _local19 = (_local2 - (_tank.x + (19 * Math.cos(_local18)))); _local20 = (_local3 - ((_tank.y + (19 * Math.sin(_local18))) - 12)); _local21 = Math.sqrt(((_local19 * _local19) + (_local20 * _local20))); _local22 = Math.abs(((_local8 * _local21) / _local7)); _local17.x = (((_local19 * _local11) - (((_local9 * _local22) * _local22) / 2)) / _local22); _local17.y = (((_local20 * _local11) - (((_local10 * _local22) * _local22) / 2)) / _local22); break; }; } else { _local23 = Math.atan2(_local5, _local4); _local24 = (_local2 - (_tank.x + (19 * Math.cos(_local23)))); _local25 = (_local3 - ((_tank.y + (19 * Math.sin(_local23))) - 12)); _local26 = Math.sqrt(((Math.abs((_local25 * _local11)) * 2) / _local10)); _local27 = (((_local24 * _local11) - (((_local9 * _local26) * _local26) / 2)) / _local26); _local17.x = _local27; _local17.y = 0; break; }; _local8 = (_local8 - 0.5); if (_local8 <= 0){ selectedWeapon = WeaponType.STANDARD_SHELL; break; }; }; var _local12:Number = ((_local11 - levelBestAccuracy[_cpuLevel]) / (levelWorstAccuracy[_cpuLevel] - levelBestAccuracy[_cpuLevel])); if (Math.abs(_local12) > 0.3){ selectedWeapon = WeaponType.STANDARD_SHELL; }; var _local13:Number = levelBestAccuracy[_cpuLevel]; infoToCurrentAccuracyDict[_tank.playerInfo] = (infoToCurrentAccuracyDict[_tank.playerInfo] + ((_local13 - _local11) / levelAdjustAccuracyRate[_cpuLevel])); targetCannonAngle = ((_local17.angle / Math.PI) * 180); targetFirePower = (_local17.length * 6); if (targetCannonAngle < -180){ targetCannonAngle = -180; } else { if (targetCannonAngle > 0){ if (targetCannonAngle > 90){ targetCannonAngle = -180; } else { targetCannonAngle = 0; }; }; }; if (targetFirePower < 0){ targetFirePower = 0; } else { if (targetFirePower > _tank.playerInfo.maxFirePower){ targetFirePower = _tank.playerInfo.maxFirePower; }; }; stateMachine.sendSignal(new SignalEvent("start_selecting_weapon")); } } }//package tanks2.core.game.ai
Section 141
//GameModelEvent (tanks2.core.game.events.GameModelEvent) package tanks2.core.game.events { import flash.events.*; public class GameModelEvent extends Event { private var _data:Object; public static const GAME_OVER:String = "GAME_OVER"; public static const CPU_PLAYER_SELECTED:String = "CPU_PLAYER_SELECTED"; public static const NEXT_PLAYER_SELECTED:String = "NEXT_PLAYER_SELECTED"; public static const SPRITE_ADDED:String = "SPRITE_ADDED"; public static const ROUND_COMPLETE:String = "ROUND_COMPLETE"; public static const SPRITE_REMOVED:String = "SPRITE_REMOVED"; public static const HUD_CONTROL_CHANGED:String = "HUD_CONTROL_CHANGED"; public static const EXPLOSION_SHAKE:String = "EXPLOSION_SHAKE"; public static const UPDATE_PLAYER_INFO:String = "UPDATE_PLAYER_INFO"; public static const TANK_DAMAGE:String = "TANK_DAMAGE"; public static const UPDATE_WIND:String = "UPDATE_WIND"; public function GameModelEvent(_arg1:String, _arg2:Object=null){ super(_arg1); _data = _arg2; } public function get data():Object{ return (_data); } override public function clone():Event{ return (new GameModelEvent(type, _data)); } } }//package tanks2.core.game.events
Section 142
//HUDEvent (tanks2.core.game.events.HUDEvent) package tanks2.core.game.events { import flash.events.*; public class HUDEvent extends Event { private var _data:Object; public static const ACTIVATE_REPAIR:String = "ACTIVATE_REPAIR"; public static const SELECT_PREV_WEAPON:String = "SELECT_PREV_WEAPON"; public static const SELECT_NEXT_WEAPON:String = "SELECT_NEXT_WEAPON"; public static const FIRE_POWER_CHANGE:String = "FIRE_POWER_CHANGE"; public static const ACTIVATE_SHIELD:String = "ACTIVATE_SHIELD"; public static const FIRE:String = "FIRE"; public static const ACTIVATE_TELEPORT:String = "ACTIVATE_TELEPORT"; public static const PAUSE:String = "PAUSE"; public static const CANNON_ANGLE_CHANGE:String = "CANNON_ANGLE_CHANGE"; public function HUDEvent(_arg1:String, _arg2:Object=null){ super(_arg1); _data = _arg2; } public function get data():Object{ return (_data); } override public function clone():Event{ return (new HUDEvent(type, _data)); } } }//package tanks2.core.game.events
Section 143
//PauseMenuEvent (tanks2.core.game.events.PauseMenuEvent) package tanks2.core.game.events { import flash.events.*; public class PauseMenuEvent extends Event { public static const RESUME:String = "RESUME"; public static const QUIT:String = "QUIT"; public function PauseMenuEvent(_arg1:String){ super(_arg1); } } }//package tanks2.core.game.events
Section 144
//ProjectileEvent (tanks2.core.game.events.ProjectileEvent) package tanks2.core.game.events { import flash.events.*; public class ProjectileEvent extends Event { private var _data:Object; public static const CREATE_FRAGMENTS:String = "CREATE_FRAGMENTS"; public static const EXPLODE:String = "EXPLODE"; public static const OUT_OF_SCREEN:String = "OUT_OF_SCREEN"; public function ProjectileEvent(_arg1:String, _arg2:Object=null){ super(_arg1); _data = _arg2; } public function get data():Object{ return (_data); } override public function clone():Event{ return (new ProjectileEvent(type, _data)); } } }//package tanks2.core.game.events
Section 145
//TankEvent (tanks2.core.game.events.TankEvent) package tanks2.core.game.events { import flash.events.*; public class TankEvent extends Event { private var _data:Object; public static const DAMAGE:String = "DAMAGE"; public function TankEvent(_arg1:String, _arg2:Object=null){ super(_arg1); _data = _arg2; } public function get data():Object{ return (_data); } override public function clone():Event{ return (new TankEvent(type, _data)); } } }//package tanks2.core.game.events
Section 146
//TeleportEvent (tanks2.core.game.events.TeleportEvent) package tanks2.core.game.events { import flash.events.*; public class TeleportEvent extends Event { public static const COMPLETE:String = "TeleportEvent.complete"; public static const PEAK:String = "TeleportEvent.peak"; public function TeleportEvent(_arg1:String){ super(_arg1); } } }//package tanks2.core.game.events
Section 147
//AirStrikeRocket (tanks2.core.game.gameItems.AirStrikeRocket) package tanks2.core.game.gameItems { import tanks2.core.game.events.*; import com.bigwigmedia.math.*; import tanks2.sound.*; public class AirStrikeRocket extends Projectile { public function AirStrikeRocket(_arg1:Vector2D){ super(WeaponType.AIR_STRIKE, AirStrikeRocketSprite, BigExplosionClip, SoundID.EXPLOSN_LRG_01_WAV, _arg1, 7); } override public function update():void{ var _local2:Number; var _local3:Number; var _local5:Tank; var _local6:uint; var _local7:uint; var _local1:int = Math.ceil(_speed.length); _local2 = (_speed.x / _local1); _local3 = (_speed.y / _local1); var _local4:int; while (_local4 < _local1) { x = (x + _local2); y = (y + _local3); _local5 = tankHitTest(); if (_local5){ explode(); return; }; _local6 = terrainBitmapData.getPixel32(int(x), int(y)); _local7 = ((_local6 >> 24) & 0xFF); if (_local7 != 0){ x = (x - _local2); y = (y - _local3); hitTerrain(); return; }; if ((((((x < -100)) || ((x > 740)))) || ((y > (terrainBitmapData.height + 10))))){ dispatchEvent(new ProjectileEvent(ProjectileEvent.OUT_OF_SCREEN)); return; }; _local4++; }; positionSprite(); } } }//package tanks2.core.game.gameItems
Section 148
//AirStrikeShuttle (tanks2.core.game.gameItems.AirStrikeShuttle) package tanks2.core.game.gameItems { import tanks2.core.game.events.*; import com.bigwigmedia.math.*; public class AirStrikeShuttle extends Projectile { private var _strikeX:Number; private var fragmentSpeed:Vector2D; private var _strikeY:Number; public static const SPEED_X:int = 25; public static const STRIKE_ANGLE:Number = 1.30899693899575; public function AirStrikeShuttle(_arg1:String, _arg2:Number, _arg3:Number){ var _local4:Number = ((_arg1 == WeaponDirection.LEFT_TO_RIGHT)) ? SPEED_X : -(SPEED_X); super(WeaponType.AIR_STRIKE, AirStrikeShuttleSprite, null, null, new Vector2D(_local4, 0)); _strikeX = _arg2; _strikeY = _arg3; fragmentSpeed = Vector2D.X_UNIT.getMultiply(15); fragmentSpeed.rotateBy(((_local4 > 0)) ? STRIKE_ANGLE : (Math.PI - STRIKE_ANGLE)); } override public function update():void{ var _local1:Number; var _local2:Projectile; x = (x + _speed.x); if (_numFragments > 0){ _local1 = (_strikeX + (((y - _strikeY) / Math.tan(STRIKE_ANGLE)) * ((_speed.x > 0)) ? 1 : -1)); if ((((((_speed.x > 0)) && ((x > _local1)))) || ((((_speed.x < 0)) && ((x < _local1)))))){ _local2 = new AirStrikeRocket(fragmentSpeed); _local2.x = x; _local2.y = y; _local2.sprite.rotation = ((((_speed.x > 0)) ? STRIKE_ANGLE : (Math.PI - STRIKE_ANGLE) / Math.PI) * 180); dispatchEvent(new ProjectileEvent(ProjectileEvent.CREATE_FRAGMENTS, [_local2])); _numFragments--; }; }; positionSprite(); if ((((((_speed.x > 0)) && ((x > 690)))) || ((((_speed.x < 0)) && ((x < -50)))))){ dispatchEvent(new ProjectileEvent(ProjectileEvent.OUT_OF_SCREEN)); }; } } }//package tanks2.core.game.gameItems
Section 149
//AnimatedEffect (tanks2.core.game.gameItems.AnimatedEffect) package tanks2.core.game.gameItems { import flash.display.*; import flash.events.*; public class AnimatedEffect extends GameItem { private var clip:MovieClip; public function AnimatedEffect(_arg1:MovieClip){ this.clip = _arg1; _arg1.stop(); super(_arg1, null); } override public function update():void{ if (clip.currentFrame == clip.totalFrames){ dispatchEvent(new Event(Event.COMPLETE)); } else { clip.nextFrame(); }; } override public function dispose():void{ super.dispose(); clip = null; } } }//package tanks2.core.game.gameItems
Section 150
//ArmorPiercing (tanks2.core.game.gameItems.ArmorPiercing) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class ArmorPiercing extends Projectile { public function ArmorPiercing(_arg1:Vector2D){ super(WeaponType.ARMOR_PIERCING, PopCornBombSprite, SmallExplosionClip, SoundID.EXPLOSN_SM_01_WAV, _arg1); } } }//package tanks2.core.game.gameItems
Section 151
//AtomBomb (tanks2.core.game.gameItems.AtomBomb) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class AtomBomb extends Projectile { public function AtomBomb(_arg1:Vector2D){ super(WeaponType.ATOM_BOMB, AtomBombSprite, AtomExplosionClip, SoundID.EXPLOSN_ATOMIC_02_WAV, _arg1, 7); } } }//package tanks2.core.game.gameItems
Section 152
//BigRoller (tanks2.core.game.gameItems.BigRoller) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class BigRoller extends RollerBase { public function BigRoller(_arg1:Vector2D){ super(WeaponType.BIG_ROLLER, PopCornBombSprite, MediumExplosionClip, SoundID.EXPLOSN_MED_02_WAV, _arg1); } } }//package tanks2.core.game.gameItems
Section 153
//Cluster (tanks2.core.game.gameItems.Cluster) package tanks2.core.game.gameItems { import tanks2.core.game.events.*; import com.bigwigmedia.math.*; import tanks2.sound.*; public class Cluster extends Projectile { private var pauseBeforeDivision:int;// = 20 private var fragmentsCreated:Boolean;// = false public function Cluster(_arg1:Vector2D){ super(WeaponType.CLUSTER, PopCornBombSprite, MediumExplosionClip, SoundID.EXPLOSN_SM_02_WAV, _arg1); } private function createFragments():void{ var _local1:Array; var _local3:int; var _local4:Vector2D; var _local5:Projectile; if (fragmentsCreated){ return; }; fragmentsCreated = true; _local1 = []; var _local2:int; while (_local2 < _numFragments) { _local3 = ((_local2)<(_numFragments / 2)) ? (_local2 - (_numFragments / 2)) : ((_local2 - (_numFragments / 2)) + 1); _local4 = currentSpeed; currentSpeed.x = (_local4.x + _local3); _local5 = new ClusterFragment(_local4); _local5.x = (x + _local4.x); _local5.y = (y + _local4.y); _local1.push(_local5); _local2++; }; dispatchEvent(new ProjectileEvent(ProjectileEvent.CREATE_FRAGMENTS, _local1)); } override public function update():void{ if (--pauseBeforeDivision == 0){ createFragments(); }; super.update(); } } }//package tanks2.core.game.gameItems
Section 154
//ClusterFragment (tanks2.core.game.gameItems.ClusterFragment) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class ClusterFragment extends Projectile { public function ClusterFragment(_arg1:Vector2D){ super(WeaponType.POP_CORN_BOMB_FRAGMENT, PopCornBombSprite, MediumExplosionClip, SoundID.EXPLOSN_SM_01_WAV, _arg1); } } }//package tanks2.core.game.gameItems
Section 155
//GameItem (tanks2.core.game.gameItems.GameItem) package tanks2.core.game.gameItems { import flash.display.*; import flash.events.*; import com.bigwigmedia.math.*; import com.bigwigmedia.core.*; public class GameItem extends EventDispatcher implements IUpdatable, IDisposable { protected var _sprite:Sprite; protected var _speed:Vector2D; public var x:Number;// = 0 public var y:Number;// = 0 public static const GRAVITY:Number = 0.3; protected static var tanksList:Array; public static var wind:Number; protected static var terrainBitmapData:BitmapData; public function GameItem(_arg1:Sprite, _arg2:Vector2D){ _sprite = _arg1; _speed = _arg2; } public function get sprite():Sprite{ return (_sprite); } public function update():void{ } public function positionSprite():void{ _sprite.x = int(x); _sprite.y = int(y); } public function dispose():void{ _sprite = null; _speed = null; } public static function getTanksList():Array{ return (GameItem.tanksList.slice()); } public static function setTanksList(_arg1:Array):void{ GameItem.tanksList = _arg1; } public static function setTerrainBitmapData(_arg1:BitmapData):void{ GameItem.terrainBitmapData = _arg1; } } }//package tanks2.core.game.gameItems
Section 156
//HighExplosiveRoller (tanks2.core.game.gameItems.HighExplosiveRoller) package tanks2.core.game.gameItems { import tanks2.core.game.events.*; import com.bigwigmedia.math.*; import tanks2.sound.*; public class HighExplosiveRoller extends RollerBase { private var fragmentsCreated:Boolean;// = false public function HighExplosiveRoller(_arg1:Vector2D){ super(WeaponType.HIGH_EXPLOSIVE_ROLLER, AtomBombSprite, MediumExplosionClip, SoundID.EXPLOSN_LRG_01_WAV, _arg1); } override public function explode():void{ createFragments(); super.explode(); } private function createFragments():void{ var _local1:Array; var _local3:Vector2D; var _local4:Projectile; if (fragmentsCreated){ return; }; fragmentsCreated = true; _local1 = []; var _local2:int; while (_local2 < _numFragments) { _local3 = new Vector2D(((Math.random() * 8) - 4), ((Math.random() * 2) - 6)); _local4 = new HighExplosiveRollerFragment(_local3); _local4.x = (x + _local3.x); _local4.y = (y + _local3.y); _local1.push(_local4); _local2++; }; dispatchEvent(new ProjectileEvent(ProjectileEvent.CREATE_FRAGMENTS, _local1)); } } }//package tanks2.core.game.gameItems
Section 157
//HighExplosiveRollerFragment (tanks2.core.game.gameItems.HighExplosiveRollerFragment) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class HighExplosiveRollerFragment extends Projectile { public function HighExplosiveRollerFragment(_arg1:Vector2D){ super(WeaponType.HIGH_EXPLOSIVE_ROLLER_FRAGMENT, PopCornBombSprite, MediumExplosionClip, SoundID.EXPLOSN_SM_02_WAV, _arg1); } } }//package tanks2.core.game.gameItems
Section 158
//IncendiaryCluster (tanks2.core.game.gameItems.IncendiaryCluster) package tanks2.core.game.gameItems { import tanks2.core.game.events.*; import com.bigwigmedia.math.*; import tanks2.sound.*; public class IncendiaryCluster extends Projectile { private var pauseBeforeDivision:int;// = 20 private var fragmentsCreated:Boolean;// = false public function IncendiaryCluster(_arg1:Vector2D){ super(WeaponType.INCENDIARY_CLUSTER, IncendiaryShellSprite, FireExplosionAnimation, SoundID.EXPLOSN_FIRE_BOMB_01_WAV, _arg1); } private function createFragments():void{ var _local1:Array; var _local3:int; var _local4:Vector2D; var _local5:Projectile; if (fragmentsCreated){ return; }; fragmentsCreated = true; _local1 = []; var _local2:int; while (_local2 < _numFragments) { _local3 = ((_local2)<(_numFragments / 2)) ? (_local2 - (_numFragments / 2)) : ((_local2 - (_numFragments / 2)) + 1); _local4 = currentSpeed; currentSpeed.x = (_local4.x + _local3); _local5 = new IncendiaryClusterFragment(_local4); _local5.x = (x + _local4.x); _local5.y = (y + _local4.y); _local1.push(_local5); _local2++; }; dispatchEvent(new ProjectileEvent(ProjectileEvent.CREATE_FRAGMENTS, _local1)); } override public function update():void{ if (--pauseBeforeDivision == 0){ createFragments(); }; super.update(); } } }//package tanks2.core.game.gameItems
Section 159
//IncendiaryClusterFragment (tanks2.core.game.gameItems.IncendiaryClusterFragment) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class IncendiaryClusterFragment extends Projectile { public function IncendiaryClusterFragment(_arg1:Vector2D){ super(WeaponType.INCENDIARY_CLUSTER_FRAGMENT, IncendiaryShellSprite, FireExplosionAnimation, SoundID.EXPLOSN_MED_01_WAV, _arg1); } } }//package tanks2.core.game.gameItems
Section 160
//IncendiaryRoller (tanks2.core.game.gameItems.IncendiaryRoller) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class IncendiaryRoller extends RollerBase { public function IncendiaryRoller(_arg1:Vector2D){ super(WeaponType.INCENDIARY_ROLLER, IncendiaryShellSprite, FireExplosionAnimation, SoundID.EXPLOSN_FIRE_BOMB_01_WAV, _arg1); } } }//package tanks2.core.game.gameItems
Section 161
//MiniRoller (tanks2.core.game.gameItems.MiniRoller) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class MiniRoller extends RollerBase { public function MiniRoller(_arg1:Vector2D){ super(WeaponType.MINI_ROLLER, StandardShellSprite, SmallExplosionClip, SoundID.EXPLOSN_SM_02_WAV, _arg1); } } }//package tanks2.core.game.gameItems
Section 162
//PopCornBomb (tanks2.core.game.gameItems.PopCornBomb) package tanks2.core.game.gameItems { import tanks2.core.game.events.*; import com.bigwigmedia.math.*; import tanks2.sound.*; public class PopCornBomb extends Projectile { public function PopCornBomb(_arg1:Vector2D){ super(WeaponType.POP_CORN_BOMB, PopCornBombSprite, SmallExplosionClip, SoundID.EXPLOSN_SM_01_WAV, _arg1); } override public function explode():void{ var _local3:Vector2D; var _local4:Projectile; var _local1:Array = []; var _local2:int; while (_local2 < _numFragments) { _local3 = new Vector2D(((Math.random() * 8) - 4), ((Math.random() * 2) - 6)); _local4 = new PopCornFragment(_local3); _local4.x = (x + _local3.x); _local4.y = (y + _local3.y); _local1.push(_local4); _local2++; }; dispatchEvent(new ProjectileEvent(ProjectileEvent.CREATE_FRAGMENTS, _local1)); super.explode(); } } }//package tanks2.core.game.gameItems
Section 163
//PopCornFragment (tanks2.core.game.gameItems.PopCornFragment) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class PopCornFragment extends Projectile { public function PopCornFragment(_arg1:Vector2D){ super(WeaponType.POP_CORN_BOMB_FRAGMENT, StandardShellSprite, SmallExplosionClip, SoundID.EXPLOSN_SM_02_WAV, _arg1); } override protected function hitTerrain():void{ explode(); } } }//package tanks2.core.game.gameItems
Section 164
//Projectile (tanks2.core.game.gameItems.Projectile) package tanks2.core.game.gameItems { import flash.display.*; import tanks2.managers.*; import tanks2.core.game.events.*; import com.bigwigmedia.math.*; public class Projectile extends GameItem { protected var _damageRadius:int; protected var _timeCount:int;// = 0 private var _explosionAnimationClass:Class; protected var _damage:int; protected var _x0:Number;// = NAN protected var _numFragments:int; private var _explosionSoundID:String; protected var _y0:Number;// = NAN protected var _shakeAmount:int; public function Projectile(_arg1:String, _arg2:Class, _arg3:Class, _arg4:String, _arg5:Vector2D, _arg6:int=0){ super(new (_arg2), _arg5); _explosionSoundID = _arg4; _explosionAnimationClass = _arg3; _shakeAmount = _arg6; _damageRadius = Managers.configManager.getWeaponDamageRadius(_arg1); _damage = Managers.configManager.getWeaponDamage(_arg1); _numFragments = Managers.configManager.getWeaponNumFragments(_arg1); } public function get shakeAmount():int{ return (_shakeAmount); } override public function update():void{ var _local10:Tank; var _local11:uint; var _local12:uint; if (((isNaN(_x0)) || (isNaN(_y0)))){ _x0 = x; _y0 = y; }; var _local1:Number = ((_timeCount * _timeCount) / 2); var _local2:Number = ((_x0 + (_speed.x * _timeCount)) + ((GameItem.wind * Managers.configManager.getWindMultiplier()) * _local1)); var _local3:Number = ((_y0 + (_speed.y * _timeCount)) + (GameItem.GRAVITY * _local1)); _timeCount++; var _local4:Number = (_local2 - x); var _local5:Number = (_local3 - y); var _local6:Number = Math.ceil(Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))); if (_local6 == 0){ return; }; var _local7:Number = (_local4 / _local6); var _local8:Number = (_local5 / _local6); var _local9:int; while (_local9 < _local6) { x = (x + _local7); y = (y + _local8); _local10 = tankHitTest(); if (_local10){ explode(); return; }; _local11 = terrainBitmapData.getPixel32(int(x), int(y)); _local12 = ((_local11 >> 24) & 0xFF); if (_local12 != 0){ x = (x - _local7); y = (y - _local8); hitTerrain(); return; }; _local9++; }; if ((((((x < -100)) || ((x > 740)))) || ((y > (terrainBitmapData.height + 10))))){ dispatchEvent(new ProjectileEvent(ProjectileEvent.OUT_OF_SCREEN)); return; }; positionSprite(); } protected function get currentSpeed():Vector2D{ var _local1:Vector2D = new Vector2D((_speed.x + ((GameItem.wind * Managers.configManager.getWindMultiplier()) * _timeCount)), (_speed.y + (GameItem.GRAVITY * _timeCount))); return (_local1); } public function get explosionAnimationClass():Class{ return (_explosionAnimationClass); } override public function dispose():void{ super.dispose(); _explosionAnimationClass = null; } public function explode():void{ if (_explosionSoundID){ Managers.soundManager.playSound(_explosionSoundID); }; dispatchEvent(new ProjectileEvent(ProjectileEvent.EXPLODE)); } protected function hitTerrain():void{ explode(); } public function get damage():int{ return (_damage); } public function get damageRadius():int{ return (_damageRadius); } protected function tankHitTest():Tank{ var _local1:Tank; var _local2:DisplayObject; for each (_local1 in tanksList) { _local2 = TankSprite(_local1.sprite).projectileHitTestObject; if (_local2.hitTestObject(this._sprite)){ return (_local1); }; }; return (null); } } }//package tanks2.core.game.gameItems
Section 165
//RollerBase (tanks2.core.game.gameItems.RollerBase) package tanks2.core.game.gameItems { import tanks2.core.game.events.*; import com.bigwigmedia.math.*; public class RollerBase extends Projectile { private var pauseBeforeExplosion:int;// = 45 private var _inAir:Boolean;// = true public function RollerBase(_arg1:String, _arg2:Class, _arg3:Class, _arg4:String, _arg5:Vector2D){ super(_arg1, _arg2, _arg3, _arg4, _arg5); } override protected function hitTerrain():void{ _inAir = false; var _local1:Vector2D = currentSpeed; if (_local1.x < -2){ _speed.x = 2; } else { if (_local1.x > 2){ _speed.x = -2; } else { _speed.x = -(_local1.x); }; }; } override public function update():void{ if (_inAir){ super.update(); } else { updateOnTerrain(); }; } private function updateOnTerrain():void{ var _local6:Tank; var _local7:uint; var _local8:uint; var _local9:int; var _local10:uint; var _local11:uint; if (--pauseBeforeExplosion == 0){ explode(); return; }; _speed.y = (_speed.y + GameItem.GRAVITY); var _local1:int = Math.ceil(Math.abs(_speed.x)); var _local2:int = ((_speed.x == 0)) ? 0 : ((_speed.x < 0)) ? -1 : 1; var _local3:int; while (_local3 < _local1) { x = (x + _local2); _local6 = tankHitTest(); if (_local6){ explode(); return; }; _local7 = terrainBitmapData.getPixel32(int(x), int(y)); _local8 = ((_local7 >> 24) & 0xFF); if (_local8 != 0){ _local9 = findSlopeValue(x, y); if (_local9 != 0){ _speed.x = -(_speed.x); y = (y - _local9); break; }; }; _local3++; }; var _local4:int = Math.ceil(Math.abs(_speed.y)); var _local5:int; while (_local5 < _local4) { y++; _local10 = terrainBitmapData.getPixel32(int(x), int(y)); _local11 = ((_local10 >> 24) & 0xFF); if (_local11 != 0){ y--; _speed.y = 0; break; }; _local5++; }; if ((((((x < -100)) || ((x > 740)))) || ((y > (terrainBitmapData.height + 10))))){ dispatchEvent(new ProjectileEvent(ProjectileEvent.OUT_OF_SCREEN)); return; }; positionSprite(); } private function findSlopeValue(_arg1:int, _arg2:int):int{ var _local5:int; var _local6:uint; var _local7:uint; var _local3:uint = terrainBitmapData.getPixel32(_arg1, _arg2); var _local4:uint = ((_local3 >> 24) & 0xFF); if (_local4 != 0){ _local5 = (_arg2 - 1); while (true) { _local6 = terrainBitmapData.getPixel32(_arg1, _local5); _local7 = ((_local6 >> 24) & 0xFF); if (_local7 == 0){ return ((_arg2 - _local5)); }; _local5--; }; }; return (0); } } }//package tanks2.core.game.gameItems
Section 166
//SatelliteStrike (tanks2.core.game.gameItems.SatelliteStrike) package tanks2.core.game.gameItems { import flash.display.*; import tanks2.sound.*; public class SatelliteStrike extends Projectile { public function SatelliteStrike(){ super(WeaponType.SATELLITE_STRIKE, SatelliteStrikeSprite, BigExplosionClip, SoundID.EXPLOSN_LRG_01_WAV, null, 10); MovieClip(_sprite).stop(); } override public function update():void{ var _local1:MovieClip = MovieClip(_sprite); _local1.nextFrame(); if (_local1.currentFrame == _local1.totalFrames){ explode(); }; } } }//package tanks2.core.game.gameItems
Section 167
//SpiderBomb (tanks2.core.game.gameItems.SpiderBomb) package tanks2.core.game.gameItems { import flash.display.*; import tanks2.core.game.*; import tanks2.managers.*; import tanks2.core.game.events.*; import com.bigwigmedia.math.*; import tanks2.sound.*; public class SpiderBomb extends Projectile { private var clip:MovieClip; private var pauseBeforeDivision:int;// = 200 private var owner:PlayerInfo; public function SpiderBomb(_arg1:Vector2D){ super(WeaponType.SPIDER_BOMB, SpiderBombClip, MediumExplosionClip, SoundID.EXPLOSN_MED_02_WAV, new Vector2D(((_arg1.x < 0)) ? -2 : 2, 0)); owner = GameInfo.currentPlayerInfo; clip = MovieClip(_sprite); clip.scaleX = ((_arg1.x < 0)) ? 1 : -1; clip.stop(); Managers.soundManager.playSound(SoundID.WPN_SPIDR_BOMB_WALK_01_WAV, int.MAX_VALUE); } override public function update():void{ var _local6:Tank; var _local7:uint; var _local8:uint; var _local9:int; var _local10:uint; var _local11:uint; if (clip.currentFrame == clip.totalFrames){ clip.gotoAndStop(1); } else { clip.nextFrame(); }; if (--pauseBeforeDivision == 0){ explode(); return; }; _speed.y = (_speed.y + GameItem.GRAVITY); var _local1:int = Math.ceil(Math.abs(_speed.x)); var _local2:int = ((_speed.x == 0)) ? 0 : ((_speed.x < 0)) ? -1 : 1; var _local3:int; while (_local3 < _local1) { x = (x + _local2); _local6 = tankHitTest(); if (((_local6) && (!((_local6.playerInfo == owner))))){ explode(); return; }; _local7 = terrainBitmapData.getPixel32(int(x), int(y)); _local8 = ((_local7 >> 24) & 0xFF); if (_local8 != 0){ _local9 = findSlopeValue(x, y); if (_local9 < 3){ y = (y - _local9); break; } else { x = (x - _local2); _speed.x = -(_speed.x); clip.scaleX = ((_speed.x < 0)) ? 1 : -1; break; }; }; _local3++; }; var _local4:int = Math.ceil(Math.abs(_speed.y)); var _local5:int; while (_local5 < _local4) { y++; _local10 = terrainBitmapData.getPixel32(int(x), int(y)); _local11 = ((_local10 >> 24) & 0xFF); if (_local11 != 0){ y--; _speed.y = 0; break; }; _local5++; }; if ((((((x < -100)) || ((x > 740)))) || ((y > (terrainBitmapData.height + 10))))){ dispatchEvent(new ProjectileEvent(ProjectileEvent.OUT_OF_SCREEN)); return; }; positionSprite(); } override public function dispose():void{ super.dispose(); clip = null; Managers.soundManager.stopSound(SoundID.WPN_SPIDR_BOMB_WALK_01_WAV); } private function findSlopeValue(_arg1:int, _arg2:int):int{ var _local5:int; var _local6:uint; var _local7:uint; var _local3:uint = terrainBitmapData.getPixel32(_arg1, _arg2); var _local4:uint = ((_local3 >> 24) & 0xFF); if (_local4 != 0){ _local5 = (_arg2 - 1); while (true) { _local6 = terrainBitmapData.getPixel32(_arg1, _local5); _local7 = ((_local6 >> 24) & 0xFF); if (_local7 == 0){ return ((_arg2 - _local5)); }; _local5--; }; }; return (0); } } }//package tanks2.core.game.gameItems
Section 168
//StandardShell (tanks2.core.game.gameItems.StandardShell) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class StandardShell extends Projectile { public function StandardShell(_arg1:Vector2D){ super(WeaponType.STANDARD_SHELL, StandardShellSprite, MediumExplosionClip, SoundID.EXPLOSN_MED_01_WAV, _arg1); } } }//package tanks2.core.game.gameItems
Section 169
//TacticalNuke (tanks2.core.game.gameItems.TacticalNuke) package tanks2.core.game.gameItems { import com.bigwigmedia.math.*; import tanks2.sound.*; public class TacticalNuke extends Projectile { public function TacticalNuke(_arg1:Vector2D){ super(WeaponType.TACTICAL_NUKE, AtomBombSprite, AtomExplosionClip, SoundID.EXPLOSN_ATOMIC_01_WAV, _arg1, 10); } } }//package tanks2.core.game.gameItems
Section 170
//Tank (tanks2.core.game.gameItems.Tank) package tanks2.core.game.gameItems { import flash.display.*; import tanks2.core.game.*; import tanks2.managers.*; import tanks2.core.game.events.*; import flash.geom.*; import com.bigwigmedia.math.*; import tanks2.sound.*; public class Tank extends GameItem { private var _track:MovieClip; private var _playerInfo:PlayerInfo; private var _cannonAngle:int; private var _destroyed:Boolean; private var _cannon:Sprite; private var _parachutesActivated:Boolean;// = false private var _onGround:Boolean; private var _speedYBeforeHitGround:Number; private var _firePower:int; public static const SPEED_Y_DAMAGE_VALUE:Number = 3.5; public function Tank(_arg1:TankSprite, _arg2:PlayerInfo){ super(_arg1, new Vector2D(0, 0)); _playerInfo = _arg2; _cannon = TankSprite(_sprite).cannon; _track = TankSprite(_sprite).track; cannonAngle = _playerInfo.cannonAngle; firePower = _playerInfo.firePower; } public function get parachutesActivated():Boolean{ return (_parachutesActivated); } public function fire():void{ TankSprite(_sprite).fire(); } public function showShield():void{ TankSprite(_sprite).showShield(); } override public function update():void{ var _local3:Tank; var _local4:Rectangle; var _local5:Rectangle; var _local6:Rectangle; var _local8:int; var _local9:uint; var _local10:uint; var _local11:int; var _local12:int; var _local13:uint; var _local14:uint; var _local15:int; var _local16:int; _speed.y = (_speed.y + GameItem.GRAVITY); var _local1:int = Math.ceil(Math.abs(_speed.x)); var _local2:int = ((_speed.x == 0)) ? 0 : ((_speed.x < 0)) ? -1 : 1; _local8 = 0; while (_local8 < _local1) { x = (x + _local2); for each (_local3 in tanksList) { if (_local3 != this){ _local4 = new Rectangle((_local3.x - 12), _local3.y, 24, 12); _local5 = new Rectangle((this.x - 12), this.y, 24, 12); _local6 = _local4.intersection(_local5); if (((!((_local6.width == 0))) && (!((_local6.height == 0))))){ x = (x - _local2); //unresolved jump }; }; }; _local9 = terrainBitmapData.getPixel32(int(x), int(y)); _local10 = ((_local9 >> 24) & 0xFF); if (_local10 != 0){ _local11 = findSlopeValue(x, y); if (_local11 > 4){ x = (x - _local2); } else { for each (_local3 in tanksList) { if (_local3 != this){ _local4 = new Rectangle((_local3.x - 12), _local3.y, 24, 12); _local5 = new Rectangle((this.x - 12), (this.y - _local11), 24, 12); _local6 = _local4.intersection(_local5); if (((!((_local6.width == 0))) && (!((_local6.height == 0))))){ x = (x - _local2); //unresolved jump }; }; }; y = (y - _local11); }; break; }; _local8++; }; if (((_parachutesActivated) && ((_speed.y >= SPEED_Y_DAMAGE_VALUE)))){ _speed.y = SPEED_Y_DAMAGE_VALUE; }; var _local7:int = Math.ceil(Math.abs(_speed.y)); _onGround = false; _speedYBeforeHitGround = _speed.y; _local12 = 0; while (_local12 < _local7) { y++; for each (_local3 in tanksList) { if (_local3 != this){ _local4 = new Rectangle((_local3.x - 12), _local3.y, 24, 12); _local5 = new Rectangle((this.x - 12), this.y, 24, 12); _local6 = _local4.intersection(_local5); if (((!((_local6.width == 0))) && (!((_local6.height == 0))))){ y--; _onGround = true; _speed.y = 0; //unresolved jump }; }; }; _local13 = terrainBitmapData.getPixel32(int(x), int(y)); _local14 = ((_local13 >> 24) & 0xFF); if (_local14 != 0){ y--; _onGround = true; _speed.y = 0; break; }; _local12++; }; positionSprite(); if (_onGround){ if (_parachutesActivated){ _parachutesActivated = false; TankSprite(_sprite).removeParachutes(); } else { if (_speedYBeforeHitGround > Tank.SPEED_Y_DAMAGE_VALUE){ _local15 = (_speedYBeforeHitGround * Managers.configManager.getFallDamageMultiplier()); dispatchEvent(new TankEvent(TankEvent.DAMAGE, _local15)); }; }; } else { if (y > (GameItem.terrainBitmapData.height + 30)){ dispatchEvent(new TankEvent(TankEvent.DAMAGE, int.MAX_VALUE)); } else { if (_speed.y >= Tank.SPEED_Y_DAMAGE_VALUE){ _local16 = _playerInfo.getUpgradeAmount(UpgradeType.PARACHUTES); if (((!(_parachutesActivated)) && ((_local16 > 0)))){ _playerInfo.setUpgradeAmount(UpgradeType.PARACHUTES, (_local16 - 1)); _parachutesActivated = true; TankSprite(_sprite).showParachutes(); Managers.soundManager.playSound(SoundID.EQP_PARACHUTE_00_WAV); }; }; }; }; } public function onGround():Boolean{ return (_onGround); } public function get cannonAngle():int{ return (_cannonAngle); } public function get destroyed():Boolean{ return (_destroyed); } public function set firePower(_arg1:int):void{ if (_arg1 > _playerInfo.maxFirePower){ _arg1 = _playerInfo.maxFirePower; } else { if (_arg1 < 0){ _arg1 = 0; } else { if (_arg1 > 100){ _arg1 = 100; }; }; }; _playerInfo.firePower = (_firePower = _arg1); } private function findSlopeValue(_arg1:int, _arg2:int):int{ var _local5:int; var _local6:uint; var _local7:uint; var _local3:uint = terrainBitmapData.getPixel32(_arg1, _arg2); var _local4:uint = ((_local3 >> 24) & 0xFF); if (_local4 != 0){ _local5 = (_arg2 - 1); while (true) { _local6 = terrainBitmapData.getPixel32(_arg1, _local5); _local7 = ((_local6 >> 24) & 0xFF); if (_local7 == 0){ return ((_arg2 - _local5)); }; _local5--; }; }; return (0); } public function set speedX(_arg1:Number):void{ if (_playerInfo.fuel == 0){ _arg1 = 0; } else { if (_arg1 < -(_playerInfo.maxSpeed)){ _arg1 = -(_playerInfo.maxSpeed); } else { if (_arg1 > _playerInfo.maxSpeed){ _arg1 = _playerInfo.maxSpeed; }; }; }; _speed.x = _arg1; if (_speed.x != 0){ if (!Managers.soundManager.isSoundPlaying(SoundID.TANK_MOVE_01_WAV)){ Managers.soundManager.playSound(SoundID.TANK_MOVE_01_WAV, int.MAX_VALUE); }; _track.play(); } else { if (Managers.soundManager.isSoundPlaying(SoundID.TANK_MOVE_01_WAV)){ Managers.soundManager.stopChannel("tankMoveChannel"); }; _track.stop(); }; } override public function dispose():void{ _playerInfo = null; TankSprite(_sprite).dispose(); super.dispose(); } public function get speedYBeforeHitGround():Number{ return (_speedYBeforeHitGround); } public function set cannonAngle(_arg1:int):void{ if (_arg1 > 0){ _arg1 = 0; } else { if (_arg1 < -180){ _arg1 = -180; }; }; if ((((_arg1 == 0)) || ((((_arg1 == -180)) && (Managers.soundManager.isSoundPlaying(SoundID.TANK_TURRET_MOVE_02_WAV)))))){ Managers.soundManager.stopChannel("tankTurretChannel"); } else { if (!Managers.soundManager.isSoundPlaying(SoundID.TANK_TURRET_MOVE_02_WAV)){ Managers.soundManager.playSound(SoundID.TANK_TURRET_MOVE_02_WAV, int.MAX_VALUE); }; }; _playerInfo.cannonAngle = (_cannonAngle = (_cannon.rotation = _arg1)); } public function damage(_arg1:int):int{ var _local2:int = _playerInfo.health; if (_arg1 == int.MAX_VALUE){ _playerInfo.health = 0; } else { if (_playerInfo.shield > 0){ _playerInfo.shield = (_playerInfo.shield - _arg1); if (_playerInfo.shield <= 0){ _playerInfo.shield = 0; TankSprite(_sprite).removeShield(); }; } else { _playerInfo.health = (_playerInfo.health - _arg1); if (_playerInfo.health < 0){ _playerInfo.health = 0; }; }; showDamageEffect(); }; if (firePower > _playerInfo.maxFirePower){ firePower = _playerInfo.maxFirePower; }; if (_playerInfo.health == 0){ _destroyed = true; }; return ((_local2 - _playerInfo.health)); } public function get speedX():Number{ return (_speed.x); } public function get speedY():Number{ return (_speed.y); } public function get firePower():int{ return (_firePower); } public function showDamageEffect():void{ if (_playerInfo.healthPercentage < 0.33){ TankSprite(_sprite).damageEffect = DamageFireClip; } else { if (_playerInfo.healthPercentage < 0.66){ TankSprite(_sprite).damageEffect = DamageSmokeClip; } else { TankSprite(_sprite).damageEffect = null; }; }; } public function get playerInfo():PlayerInfo{ return (_playerInfo); } } }//package tanks2.core.game.gameItems
Section 171
//TankSprite (tanks2.core.game.gameItems.TankSprite) package tanks2.core.game.gameItems { import flash.display.*; import flash.events.*; import fl.motion.*; import com.bigwigmedia.core.*; public class TankSprite extends Sprite implements IDisposable { private var parachutesClip:MovieClip; private var shieldEffectClip:MovieClip; private var _track:MovieClip; private var damageEffectClip:MovieClip; private var fireEffectClip:MovieClip; private var _cannon:Sprite; private var _hull:Sprite; public function TankSprite(_arg1:uint){ _hull = new TankHull(); _hull.y = 1; _cannon = new TankCannon(); _cannon.y = -12; _track = MovieClip(_hull.getChildByName("_track")); _track.stop(); var _local2:DisplayObject = _hull.getChildByName("_background"); var _local3:DisplayObject = cannon.getChildByName("_background"); var _local4:Color = new Color(); _local4.setTint(_arg1, 1); _local2.transform.colorTransform = (_local3.transform.colorTransform = _local4); addChild(_cannon); addChild(_hull); } public function set damageEffect(_arg1:Class):void{ if (_arg1 == null){ if (damageEffectClip){ removeChild(damageEffectClip); damageEffectClip = null; }; } else { if (!(damageEffectClip is _arg1)){ if (damageEffectClip){ removeChild(damageEffectClip); }; damageEffectClip = new (_arg1); damageEffectClip.y = 1; addChild(damageEffectClip); }; }; } public function fire():void{ if (!fireEffectClip){ fireEffectClip = new FireEffect(); fireEffectClip.x = 21; fireEffectClip.y = 0; addEventListener(Event.ENTER_FRAME, onFireEffectEnterFrameHandler); _cannon.addChild(fireEffectClip); }; } public function showShield():void{ if (!shieldEffectClip){ shieldEffectClip = new ShieldActivatingClip(); shieldEffectClip.y = 1; addEventListener(Event.ENTER_FRAME, onEnterFrameHandler); addChild(shieldEffectClip); }; } public function get track():MovieClip{ return (_track); } public function removeShield():void{ removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); if (shieldEffectClip){ removeChild(shieldEffectClip); shieldEffectClip = null; }; } public function removeParachutes():void{ if (parachutesClip){ removeChild(parachutesClip); parachutesClip = null; }; } private function onFireEffectEnterFrameHandler(_arg1:Event):void{ if (fireEffectClip.currentFrame == fireEffectClip.totalFrames){ removeEventListener(Event.ENTER_FRAME, onFireEffectEnterFrameHandler); _cannon.removeChild(fireEffectClip); fireEffectClip = null; }; } public function dispose():void{ removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); removeEventListener(Event.ENTER_FRAME, onFireEffectEnterFrameHandler); } public function showParachutes():void{ if (!parachutesClip){ parachutesClip = new ParachutesClip(); addChildAt(parachutesClip, 0); }; } private function onEnterFrameHandler(_arg1:Event):void{ if (shieldEffectClip.currentFrame == shieldEffectClip.totalFrames){ removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); removeChild(shieldEffectClip); shieldEffectClip = new ShieldClip(); shieldEffectClip.y = 1; addChild(shieldEffectClip); }; } public function get projectileHitTestObject():DisplayObject{ return (_hull); } public function get cannon():Sprite{ return (_cannon); } } }//package tanks2.core.game.gameItems
Section 172
//Teleport (tanks2.core.game.gameItems.Teleport) package tanks2.core.game.gameItems { import flash.display.*; import tanks2.core.game.events.*; public class Teleport extends AnimatedEffect { private var _targetX:int; private var _targetY:int; public function Teleport(_arg1:int, _arg2:int){ _targetX = _arg1; _targetY = _arg2; super(new TeleportAnimationClip()); } override public function update():void{ var _local1:MovieClip = MovieClip(_sprite); if (_local1.currentFrame == _local1.totalFrames){ dispatchEvent(new TeleportEvent(TeleportEvent.COMPLETE)); } else { if (_local1.currentFrame == 19){ dispatchEvent(new TeleportEvent(TeleportEvent.PEAK)); }; _local1.nextFrame(); }; } public function get targetX():int{ return (_targetX); } public function get targetY():int{ return (_targetY); } } }//package tanks2.core.game.gameItems
Section 173
//UpgradeType (tanks2.core.game.gameItems.UpgradeType) package tanks2.core.game.gameItems { public class UpgradeType { public static const REPAIR_KIT:String = "repair_kit"; public static const namesHash:Object = {parachutes:"Parachutes", repair_kit:"Repair Kit", teleport:"Teleport", shield:"Shield", shield_upgrade:"Upgrade Shield", fuel:"Upgrade Fuel", health:"Upgrade Health", engine_upgrade:"Upgrade Engine"}; public static const SHIELD_UPGRADE:String = "shield_upgrade"; public static const SHIELD:String = "shield"; public static const TELEPORT:String = "teleport"; public static const FUEL:String = "fuel"; public static const PARACHUTES:String = "parachutes"; public static const HEALTH:String = "health"; public static const ENGINE_UPGRADE:String = "engine_upgrade"; public static function getUpgradeName(_arg1:String):String{ if (UpgradeType.namesHash.hasOwnProperty(_arg1)){ return (UpgradeType.namesHash[_arg1]); }; return (WeaponType.namesHash[_arg1]); } } }//package tanks2.core.game.gameItems
Section 174
//WeaponDirection (tanks2.core.game.gameItems.WeaponDirection) package tanks2.core.game.gameItems { public class WeaponDirection { public static const LEFT_TO_RIGHT:String = "LEFT_TO_RIGHT"; public static const RIGHT_TO_LEFT:String = "RIGHT_TO_LEFT"; } }//package tanks2.core.game.gameItems
Section 175
//WeaponType (tanks2.core.game.gameItems.WeaponType) package tanks2.core.game.gameItems { public class WeaponType { public static const SATELLITE_STRIKE:String = "satellite_strike"; public static const POP_CORN_BOMB_FRAGMENT:String = "pop_corn_bomb_fragment"; public static const POP_CORN_BOMB:String = "pop_corn_bomb"; public static const STANDARD_SHELL:String = "standard_shell"; public static const ATOM_BOMB:String = "atom_bomb"; public static const MINI_ROLLER:String = "mini_roller"; public static const CLUSTER_FRAGMENT:String = "cluster_fragment"; public static const INCENDIARY_CLUSTER_FRAGMENT:String = "incendiary_cluster_fragment"; public static const CLUSTER:String = "cluster"; public static const ARMOR_PIERCING:String = "armor_piercing"; public static const AIR_STRIKE:String = "air_strike"; public static const HIGH_EXPLOSIVE_ROLLER:String = "high_explosive_roller"; public static const BIG_ROLLER:String = "big_roller"; public static const INCENDIARY_ROLLER:String = "incendiary_roller"; public static const HIGH_EXPLOSIVE_ROLLER_FRAGMENT:String = "high_explosive_roller_fragment"; public static const namesHash:Object = {standard_shell:"Standard Shell", armor_piercing:"Armor Piercing", pop_corn_bomb:"Pop Corn Bomb", cluster:"Cluster", incendiary_cluster:"Incendiary Cluster", atom_bomb:"Atom Bomb", tactical_nuke:"Tactical Nuke", mini_roller:"Mini Roller", big_roller:"Big Roller", incendiary_roller:"Incendiary Roller", high_explosive_roller:"Pop Corn Roller", spider_bomb:"Spider Bomb", air_strike:"Air Strike", satellite_strike:"Satellite Strike"}; public static const INCENDIARY_CLUSTER:String = "incendiary_cluster"; public static const SPIDER_BOMB:String = "spider_bomb"; public static const TACTICAL_NUKE:String = "tactical_nuke"; public static function isWeaponType(_arg1:String):Boolean{ return (WeaponType.namesHash.hasOwnProperty(_arg1)); } public static function getWeaponClass(_arg1:String):Class{ switch (_arg1){ case WeaponType.STANDARD_SHELL: return (StandardShell); case WeaponType.ARMOR_PIERCING: return (ArmorPiercing); case WeaponType.POP_CORN_BOMB: return (PopCornBomb); case WeaponType.CLUSTER: return (Cluster); case WeaponType.INCENDIARY_CLUSTER: return (IncendiaryCluster); case WeaponType.ATOM_BOMB: return (AtomBomb); case WeaponType.TACTICAL_NUKE: return (TacticalNuke); case WeaponType.MINI_ROLLER: return (MiniRoller); case WeaponType.BIG_ROLLER: return (BigRoller); case WeaponType.INCENDIARY_ROLLER: return (IncendiaryRoller); case WeaponType.HIGH_EXPLOSIVE_ROLLER: return (HighExplosiveRoller); case WeaponType.SPIDER_BOMB: return (SpiderBomb); }; return (null); } public static function getWeaponName(_arg1:String):String{ return (WeaponType.namesHash[_arg1]); } } }//package tanks2.core.game.gameItems
Section 176
//HUD (tanks2.core.game.hud.HUD) package tanks2.core.game.hud { import flash.display.*; import flash.events.*; import tanks2.core.game.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import tanks2.core.game.events.*; import com.bigwigmedia.events.*; import flash.text.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.display.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.utils.*; import com.bigwigmedia.ui.styles.*; import tanks2.ui.*; import flash.filters.*; public class HUD extends LayoutContainer { private var tankIcon:TankSprite; public var pauseBtn:IconicButton; private var moveRightBtn:IconicButton; private var repairBtn:DecoratedIconicButton; private var healthBar:Sprite; private var selectPrevWeaponBtn:IconicButton; private var numShieldsField:TextField; private var windStrengthField:TextField; private var maxFirePowerBar:Sprite; private var scoreField:TextField; private var firePowerSlider:VSlider; private var teleportBtn:DecoratedIconicButton; private var shieldBtn:DecoratedIconicButton; private var nameLabel:Label; private var weaponIcon:MovieClip; private var numRepairsField:TextField; private var fireBtn:IconicButton; private var moveLeftBtn:IconicButton; private var weaponAmountField:TextField; private var selectNextWeaponBtn:IconicButton; private var cannonAngleField:TextField; private var cannonAngleSlider:HSlider; private var numTeleportsField:TextField; private var firePowerField:TextField; private var fuelField:TextField; private var numParachutesField:TextField; private var shieldBar:Sprite; private var cannonAngleIcon:Sprite; private var twoDPlayBtn:DecoratedIconicButton; private var weaponNameField:TextField; private var playersList:PlayersHealthList; private var windArrowIcon:Sprite; public function HUD(){ var _local1:DisplayObjectContainer = (addChild(new HUDBackground()) as DisplayObjectContainer); setSize(640, 480); var _local2:Label = new Label(); _local2.setStyle(AbstractComponentStyle.DECORATION, new FilterDecoration(new GlowFilter(0, 1, 4, 4, 10))); _local2.text = ("Round " + String(GameInfo.currentRound)); addChildToLayout(_local2, {horizontalCenter:0, top:80}); twoDPlayBtn = new DecoratedIconicButton(); twoDPlayBtn.move(5, 87); twoDPlayBtn.upIcon = TwoDPlayButtonIcon; twoDPlayBtn.scale = 0.5; addChild(twoDPlayBtn); healthBar = (_local1.getChildByName("healthBar") as Sprite); shieldBar = (_local1.getChildByName("shieldBar") as Sprite); cannonAngleIcon = (_local1.getChildByName("cannonAngleIcon") as Sprite); cannonAngleField = (_local1.getChildByName("cannonAngleField") as TextField); firePowerField = (_local1.getChildByName("firePowerField") as TextField); fuelField = (_local1.getChildByName("fuelField") as TextField); weaponNameField = (_local1.getChildByName("weaponNameField") as TextField); weaponAmountField = (_local1.getChildByName("weaponAmountField") as TextField); weaponIcon = (_local1.getChildByName("weaponIcon") as MovieClip); windArrowIcon = (_local1.getChildByName("windArrowIcon") as Sprite); windStrengthField = (_local1.getChildByName("windStrengthField") as TextField); scoreField = (_local1.getChildByName("scoreField") as TextField); numShieldsField = (_local1.getChildByName("numShieldsField") as TextField); numParachutesField = (_local1.getChildByName("numParachutesField") as TextField); numRepairsField = (_local1.getChildByName("numRepairsField") as TextField); numTeleportsField = (_local1.getChildByName("numTeleportsField") as TextField); pauseBtn = new IconicButton(); pauseBtn.upIcon = PauseButtonUpIcon; pauseBtn.overIcon = PauseButtonOverIcon; pauseBtn.move(575, 3); addChild(pauseBtn); fireBtn = new IconicButton(); fireBtn.upIcon = FireButtonUpIcon; fireBtn.overIcon = FireButtonOverIcon; fireBtn.move(254, 51); addChild(fireBtn); nameLabel = new Label(); addChildToLayout(nameLabel, {left:10, top:0}); var _local3:Sprite = new ParachuteButtonIcon(); _local3.x = 80; _local3.y = 32; addChild(_local3); repairBtn = new DecoratedIconicButton(); repairBtn.upIcon = RepairButtonIcon; repairBtn.move(106, 32); addChild(repairBtn); teleportBtn = new DecoratedIconicButton(); teleportBtn.upIcon = TeleportButtonIcon; teleportBtn.move(131, 31); addChild(teleportBtn); shieldBtn = new DecoratedIconicButton(); shieldBtn.upIcon = ShieldButtonIcon; shieldBtn.move(155, 31); addChild(shieldBtn); moveLeftBtn = new IconicButton(); moveLeftBtn.upIcon = ArrowLeftUpIcon; moveLeftBtn.overIcon = ArrowLeftOverIcon; moveLeftBtn.move(191, 48); addChild(moveLeftBtn); moveRightBtn = new IconicButton(); moveRightBtn.upIcon = ArrowRightUpIcon; moveRightBtn.overIcon = ArrowRightOverIcon; moveRightBtn.move(233, 48); addChild(moveRightBtn); selectPrevWeaponBtn = new IconicButton(); selectPrevWeaponBtn.upIcon = ArrowLeftUpIcon; selectPrevWeaponBtn.overIcon = ArrowLeftOverIcon; selectPrevWeaponBtn.move(395, 7); addChild(selectPrevWeaponBtn); selectNextWeaponBtn = new IconicButton(); selectNextWeaponBtn.upIcon = ArrowRightUpIcon; selectNextWeaponBtn.overIcon = ArrowRightOverIcon; selectNextWeaponBtn.move(561, 7); addChild(selectNextWeaponBtn); cannonAngleSlider = new HSlider(); cannonAngleSlider.setStyle(HSliderStyle.THUMB, CannonAngleSliderThumb); cannonAngleSlider.minimum = -180; cannonAngleSlider.maximum = 0; cannonAngleSlider.setSize(68, 9); cannonAngleSlider.move(249, 7); addChild(cannonAngleSlider); firePowerSlider = new VSlider(); firePowerSlider.setStyle(VSliderStyle.THUMB, FirePowerSliderThumb); firePowerSlider.minimum = 0; firePowerSlider.maximum = 100; firePowerSlider.setSize(19, 47); firePowerSlider.move(335, 17); addChild(firePowerSlider); playersList = new PlayersHealthList(); playersList.move(510, 85); addChild(playersList); maxFirePowerBar = (MovieClip(_local1.getChildByName("maxFirePowerIndicator")).getChildByName("bar") as Sprite); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); this.addEventListener(SliderEvent.CHANGE, onSliderChangeHandler); } public function showShieldPercentage(_arg1:Number):void{ shieldBar.scaleX = _arg1; } public function showPlayerName(_arg1:PlayerInfo):void{ var _local2:TextFormat = new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 22, _arg1.color); nameLabel.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local2); nameLabel.text = _arg1.name; } public function showFuelAmount(_arg1:int):void{ fuelField.text = NumberFormatter.addLeadingZeros(_arg1, 3); } public function showCannonAngle(_arg1:int):void{ cannonAngleIcon.rotation = _arg1; cannonAngleSlider.value = _arg1; cannonAngleField.text = (NumberFormatter.addLeadingZeros(Math.abs(_arg1), 3) + "°"); } override public function dispose():void{ this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); this.removeEventListener(SliderEvent.CHANGE, onSliderChangeHandler); super.dispose(); } public function showSelectedWeapon(_arg1:String, _arg2:int):void{ weaponNameField.text = WeaponType.getWeaponName(_arg1); weaponAmountField.text = ((_arg2 == -1)) ? "∞" : NumberFormatter.addLeadingZeros(_arg2, 2); weaponIcon.gotoAndStop(_arg1); } public function showPlayerInfo(_arg1:PlayerInfo):void{ showCannonAngle(_arg1.cannonAngle); showFirePower(_arg1.firePower); showMaxFirePower(_arg1.maxFirePower); showFuelAmount(_arg1.fuel); showSelectedWeapon(_arg1.selectedWeapon, _arg1.selectedWeaponAmount); showHealthPercentage(_arg1.healthPercentage); showShieldPercentage(_arg1.shieldPercentage); numShieldsField.text = NumberFormatter.addLeadingZeros(_arg1.getUpgradeAmount(UpgradeType.SHIELD), 2); numParachutesField.text = NumberFormatter.addLeadingZeros(_arg1.getUpgradeAmount(UpgradeType.PARACHUTES), 2); numRepairsField.text = NumberFormatter.addLeadingZeros(_arg1.getUpgradeAmount(UpgradeType.REPAIR_KIT), 2); numTeleportsField.text = NumberFormatter.addLeadingZeros(_arg1.getUpgradeAmount(UpgradeType.TELEPORT), 2); scoreField.text = String(_arg1.score); } public function showWind(_arg1:Number):void{ windArrowIcon.scaleX = ((_arg1 < 0)) ? -1 : 1; windStrengthField.text = String(int((Math.abs(_arg1) * 100))); } public function isMoveRightBtnPressed():Boolean{ return ((moveRightBtn.state == ButtonState.DOWN)); } public function showAllPlayersSortedList(_arg1:Array):void{ playersList.showPlayersList(_arg1); } public function isMoveLeftBtnPressed():Boolean{ return ((moveLeftBtn.state == ButtonState.DOWN)); } public function showHealthPercentage(_arg1:Number):void{ healthBar.scaleX = _arg1; } private function onSliderChangeHandler(_arg1:SliderEvent):void{ switch (_arg1.target){ case cannonAngleSlider: dispatchEvent(new HUDEvent(HUDEvent.CANNON_ANGLE_CHANGE, _arg1.value)); break; case firePowerSlider: dispatchEvent(new HUDEvent(HUDEvent.FIRE_POWER_CHANGE, (100 - _arg1.value))); break; }; } public function showMaxFirePower(_arg1:int):void{ maxFirePowerBar.y = ((-(_arg1) / 100) * 47); } public function showFirePower(_arg1:int):void{ firePowerSlider.value = (100 - _arg1); firePowerField.text = NumberFormatter.addLeadingZeros(Math.abs(_arg1), 3); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case twoDPlayBtn: Managers.urlCaller.mainLink(); break; case fireBtn: dispatchEvent(new HUDEvent(HUDEvent.FIRE)); break; case selectPrevWeaponBtn: dispatchEvent(new HUDEvent(HUDEvent.SELECT_PREV_WEAPON)); break; case selectNextWeaponBtn: dispatchEvent(new HUDEvent(HUDEvent.SELECT_NEXT_WEAPON)); break; case pauseBtn: dispatchEvent(new HUDEvent(HUDEvent.PAUSE)); break; case shieldBtn: dispatchEvent(new HUDEvent(HUDEvent.ACTIVATE_SHIELD)); break; case teleportBtn: dispatchEvent(new HUDEvent(HUDEvent.ACTIVATE_TELEPORT)); break; case repairBtn: dispatchEvent(new HUDEvent(HUDEvent.ACTIVATE_REPAIR)); break; }; } } }//package tanks2.core.game.hud
Section 177
//PauseInstructionsScreen (tanks2.core.game.hud.PauseInstructionsScreen) package tanks2.core.game.hud { import flash.events.*; import com.bigwigmedia.ui.*; import com.bigwigmedia.ui.containers.*; public class PauseInstructionsScreen extends LayoutContainer { private var owner:PauseMenu; private var closeBtn:LabelButton; public function PauseInstructionsScreen(_arg1:PauseMenu){ this.owner = _arg1; setSize(640, 480); addChild(new InstructionsBackground()); closeBtn = new LabelButton(); closeBtn.label = "CLOSE"; addChildToLayout(closeBtn, {horizontalCenter:0, bottom:10}); addEventListener(MouseEvent.CLICK, onMouseClickHandler); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case closeBtn: owner.removeInstructionsScreen(); break; }; } } }//package tanks2.core.game.hud
Section 178
//PauseMenu (tanks2.core.game.hud.PauseMenu) package tanks2.core.game.hud { import flash.display.*; import flash.events.*; import com.bigwigmedia.ui.*; import tanks2.core.game.events.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.application.*; public class PauseMenu extends LayoutContainer { private var quitBtn:LabelButton; private var resumeBtn:LabelButton; private var instructionsScreen:PauseInstructionsScreen; private var instructionsBtn:LabelButton; private var qualityBtn:LabelButton; public function PauseMenu(){ addChild(new PauseMenuBackground()); setSize(640, 480); resumeBtn = new LabelButton(); resumeBtn.label = "RESUME GAME"; addChildToLayout(resumeBtn, {horizontalCenter:0, verticalCenter:-45}); instructionsBtn = new LabelButton(); instructionsBtn.label = "INSTRUCTIONS"; addChildToLayout(instructionsBtn, {horizontalCenter:0, verticalCenter:-15}); qualityBtn = new LabelButton(); qualityBtn.label = currentQualityLabel; addChildToLayout(qualityBtn, {horizontalCenter:0, verticalCenter:15}); quitBtn = new LabelButton(); quitBtn.label = "QUIT GAME"; addChildToLayout(quitBtn, {horizontalCenter:0, verticalCenter:45}); addEventListener(MouseEvent.CLICK, onMouseClickHandler); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case resumeBtn: dispatchEvent(new PauseMenuEvent(PauseMenuEvent.RESUME)); break; case instructionsBtn: instructionsScreen = new PauseInstructionsScreen(this); addChild(instructionsScreen); break; case quitBtn: dispatchEvent(new PauseMenuEvent(PauseMenuEvent.QUIT)); break; case qualityBtn: switchQuality(); qualityBtn.label = currentQualityLabel; break; }; } private function switchQuality():void{ var _local1:String = ApplicationGlobals.application.stage.quality.toLowerCase(); switch (_local1){ case StageQuality.LOW.toLowerCase(): stage.quality = StageQuality.MEDIUM; break; case StageQuality.MEDIUM.toLowerCase(): stage.quality = StageQuality.HIGH; break; default: stage.quality = StageQuality.LOW; break; }; } private function get currentQualityLabel():String{ var _local1:String; var _local2:String = ApplicationGlobals.application.stage.quality.toLowerCase(); switch (_local2){ case StageQuality.LOW.toLowerCase(): _local1 = "SET QUALITY TO MEDIUM"; break; case StageQuality.MEDIUM.toLowerCase(): _local1 = "SET QUALITY TO HIGH"; break; default: _local1 = "SET QUALITY TO LOW"; break; }; return (_local1); } public function removeInstructionsScreen():void{ removeChild(instructionsScreen); instructionsScreen.dispose(); instructionsScreen = null; } } }//package tanks2.core.game.hud
Section 179
//PlayersHealthList (tanks2.core.game.hud.PlayersHealthList) package tanks2.core.game.hud { import tanks2.core.game.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import flash.text.*; import com.bigwigmedia.display.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.ui.styles.*; import flash.filters.*; public class PlayersHealthList extends LayoutContainer { private var nameLabelsList:Array; private var healthLabelsList:Array; public function PlayersHealthList(){ var _local3:Label; var _local4:Label; nameLabelsList = []; healthLabelsList = []; super(); this.setSize(130, 100); var _local1:FilterDecoration = new FilterDecoration(new GlowFilter(0, 1, 2, 2, 10)); var _local2:int; while (_local2 < 5) { _local3 = new Label(); _local3.text = ""; _local3.setStyle(AbstractComponentStyle.DECORATION, _local1); addChildToLayout(_local3, {right:35, top:(_local2 * 20)}); nameLabelsList.push(_local3); _local4 = new Label(); _local4.text = ""; _local4.setStyle(AbstractComponentStyle.DECORATION, _local1); addChildToLayout(_local4, {right:5, top:(_local2 * 20)}); healthLabelsList.push(_local4); _local2++; }; } public function showPlayersList(_arg1:Array):void{ var _local3:Label; var _local4:Label; var _local5:PlayerInfo; var _local6:TextFormat; var _local2:int; while (_local2 < 5) { _local3 = nameLabelsList[_local2]; _local4 = healthLabelsList[_local2]; if (_local2 < _arg1.length){ _local5 = _arg1[_local2]; _local6 = new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 14, _local5.color); _local3.text = _local5.name; _local3.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local6); _local4.text = String(_local5.health); _local4.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local6); } else { _local3.text = ""; _local4.text = ""; }; _local2++; }; } } }//package tanks2.core.game.hud
Section 180
//Terrain (tanks2.core.game.terrain.Terrain) package tanks2.core.game.terrain { import flash.display.*; import flash.geom.*; public class Terrain { public static function generate(_arg1:int, _arg2:String):BitmapData{ var _local10:uint; var _local22:int; var _local23:Rectangle; var _local3:Object = TerrainType.getTextures(_arg2); var _local4:BitmapData = _local3.earthTexture; var _local5:BitmapData = _local3.grassTexture; var _local6:BitmapData = new BitmapData(_arg1, 1, false); var _local7:Number = (100 * ((Math.random() * 2) + 1)); var _local8:uint = (uint((Math.random() * 4)) + 2); var _local9:int = int((Math.random() * 999999)); _local6.perlinNoise(_local7, _local7, _local8, _local9, false, true, BitmapDataChannel.BLUE); var _local11:int = int.MAX_VALUE; var _local12:int = int.MIN_VALUE; var _local13:int; while (_local13 < _arg1) { _local10 = _local6.getPixel(_local13, 0); if (_local10 <= _local11){ _local11 = _local10; }; if (_local10 >= _local12){ _local12 = _local10; }; _local13++; }; var _local14:int = (((_local12 - _local11) + (Math.random() * 120)) + 20); var _local15:BitmapData = new BitmapData(_arg1, _local14, true, 0); var _local16:int = Math.ceil((_arg1 / _local4.width)); var _local17:int = Math.ceil((_local14 / _local4.height)); var _local18:int; while (_local18 < _local17) { _local22 = 0; while (_local22 < _local16) { _local15.copyPixels(_local4, _local4.rect, new Point((_local22 * _local4.width), (_local18 * _local4.height))); _local22++; }; _local18++; }; var _local19:BitmapData = new BitmapData(_arg1, _local14, true, 0xFFFFFF); var _local20:int; var _local21:int; while (_local21 < _arg1) { _local10 = _local6.getPixel(_local21, 0); _local23 = new Rectangle(_local21, (_local10 - _local11), 1, _local14); _local19.fillRect(_local23, 4294967295); _local15.copyPixels(_local5, new Rectangle(_local20, 0, 1, _local5.height), new Point(_local21, (_local10 - _local11)), null, null, true); _local20++; if (_local20 == _local5.width){ _local20 = 0; }; _local21++; }; _local15.copyChannel(_local19, _local19.rect, new Point(0, 0), BitmapDataChannel.ALPHA, BitmapDataChannel.ALPHA); return (_local15); } } }//package tanks2.core.game.terrain
Section 181
//TerrainType (tanks2.core.game.terrain.TerrainType) package tanks2.core.game.terrain { public class TerrainType { public static const RANDOM:String = "RANDOM"; public static const URBAN:String = "URBAN"; public static const ROCKY:String = "ROCKY"; public static const DESERT:String = "DESERT"; public static const ALPINE:String = "ALPINE"; public static const FOREST:String = "FOREST"; public static function getTextures(_arg1:String):Object{ var _local2:Object = {DESERT:DesertTexture, ALPINE:AlpineTexture, ROCKY:RockyTexture, FOREST:ForestTexture, URBAN:UrbanTexture}; var _local3:Object = {DESERT:DesertTopTexture, ALPINE:AlpineTopTexture, ROCKY:RockyTopTexture, FOREST:ForestTopTexture, URBAN:UrbanTopTexture}; var _local4:Class = _local2[_arg1]; var _local5:Class = _local3[_arg1]; return ({earthTexture:new _local4(0, 0), grassTexture:new _local5(0, 0)}); } public static function getRandomType():String{ var _local1:Array = [DESERT, ALPINE, ROCKY, FOREST, URBAN]; return (_local1[int((Math.random() * _local1.length))]); } } }//package tanks2.core.game.terrain
Section 182
//CampaignOpponentInfo (tanks2.core.game.CampaignOpponentInfo) package tanks2.core.game { import tanks2.core.game.gameItems.*; public class CampaignOpponentInfo { private var _upgradesHash:Object; private var _level:int; private var _weaponsHash:Object; public function CampaignOpponentInfo(_arg1:XML){ var _local3:XML; var _local4:String; _weaponsHash = {}; _upgradesHash = {}; super(); _level = int(_arg1.@level); var _local2:XMLList = _arg1..equipment; for each (_local3 in _local2) { _local4 = _local3.@id; if (WeaponType.isWeaponType(_local4)){ _weaponsHash[_local4] = int(_local3); } else { _upgradesHash[_local4] = int(_local3); }; }; } public function get upgradesHash():Object{ return (_upgradesHash); } public function get level():int{ return (_level); } public function get weaponsHash():Object{ return (_weaponsHash); } } }//package tanks2.core.game
Section 183
//ControllerMessage (tanks2.core.game.ControllerMessage) package tanks2.core.game { public class ControllerMessage { public static const ACTIVATE_REPAIR:String = "ACTIVATE_REPAIR"; public static const SELECT_NEXT_WEAPON:String = "SELECT_NEXT_WEAPON"; public static const SELECT_PREV_WEAPON:String = "SELECT_PREV_WEAPON"; public static const SET_CANNON_ANGLE:String = "SET_CANNON_ANGLE"; public static const DOUBLE_TURN_FIRE:String = "DOUBLE_TURN_FIRE"; public static const ACTIVATE_SHIELD:String = "ACTIVATE_SHIELD"; public static const FIRE:String = "FIRE"; public static const ACTIVATE_TELEPORT:String = "ACTIVATE_TELEPORT"; public static const SET_FIRE_POWER:String = "SET_FIRE_POWER"; } }//package tanks2.core.game
Section 184
//GameController (tanks2.core.game.GameController) package tanks2.core.game { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.managers.*; import tanks2.core.game.events.*; import com.bigwigmedia.utils.messages.*; import tanks2.core.game.gameItems.*; import tanks2.core.main.*; import tanks2.core.*; import tanks2.core.game.ai.*; import com.bigwigmedia.application.*; public class GameController extends EventDispatcher implements IController { private var dSpeed:int;// = 0 private var _view:GameView; private var gamePaused:Boolean;// = false private var messageQueue:MessageQueue; private var dFirePower:int;// = 0 private var dCannonAngle:int;// = 0 private var _model:GameModel; private var cpuController:CPUTankController; private var tankControlEnabled:Boolean;// = false private var screenShakeCount:int; private var maxScreenShakeCount:int; public function GameController(){ GameInfo.startNewRound(); _view = new GameView(this); _model = new GameModel(); _model.addEventListener(GameModelEvent.SPRITE_ADDED, onModelEventHandler); _model.addEventListener(GameModelEvent.SPRITE_REMOVED, onModelEventHandler); _model.addEventListener(GameModelEvent.UPDATE_PLAYER_INFO, onModelEventHandler); _model.addEventListener(GameModelEvent.ROUND_COMPLETE, onModelEventHandler); _model.addEventListener(GameModelEvent.GAME_OVER, onModelEventHandler); _model.addEventListener(GameModelEvent.HUD_CONTROL_CHANGED, onModelEventHandler); _model.addEventListener(GameModelEvent.UPDATE_WIND, onModelEventHandler); _model.addEventListener(GameModelEvent.NEXT_PLAYER_SELECTED, onModelEventHandler); _model.addEventListener(GameModelEvent.CPU_PLAYER_SELECTED, onModelEventHandler); _model.addEventListener(GameModelEvent.TANK_DAMAGE, onModelEventHandler); _model.addEventListener(GameModelEvent.EXPLOSION_SHAKE, onModelEventHandler); messageQueue = new MessageQueue(); messageQueue.registerMessage(ControllerMessage.DOUBLE_TURN_FIRE, 2, true, true); messageQueue.registerMessage(ControllerMessage.FIRE, 2, true, true); messageQueue.registerMessage(ControllerMessage.ACTIVATE_SHIELD, 1, true, true); messageQueue.registerMessage(ControllerMessage.ACTIVATE_TELEPORT, 1, true, true); messageQueue.registerMessage(ControllerMessage.ACTIVATE_REPAIR, 1, true, true); messageQueue.registerMessage(ControllerMessage.SET_CANNON_ANGLE, 0, true, false); messageQueue.registerMessage(ControllerMessage.SET_FIRE_POWER, 0, true, false); messageQueue.registerMessage(ControllerMessage.SELECT_NEXT_WEAPON, 0, true, false); messageQueue.registerMessage(ControllerMessage.SELECT_PREV_WEAPON, 0, true, false); cpuController = new CPUTankController(this); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } private function setHUDControlType(_arg1:String):void{ switch (_arg1){ case HUDControlType.ALL_ENABLED: tankControlEnabled = true; _view.controlsEnabled = true; _view.hud.pauseBtn.enabled = true; break; case HUDControlType.ALL_DISABLED: tankControlEnabled = false; _view.controlsEnabled = false; _view.hud.pauseBtn.enabled = false; break; case HUDControlType.HUD_DISABLED_CONTROL_ENABLED: tankControlEnabled = true; _view.controlsEnabled = false; _view.hud.pauseBtn.enabled = true; break; case HUDControlType.LOCATION_CURSOR: tankControlEnabled = true; _view.controlsEnabled = false; _view.hud.pauseBtn.enabled = false; _view.createWeaponCursor(GameInfo.currentPlayerInfo.selectedWeapon); break; case HUDControlType.TELEPORT_CURSOR: tankControlEnabled = true; _view.controlsEnabled = false; _view.hud.pauseBtn.enabled = false; _view.createWeaponCursor(); break; }; } private function onEnterFrameHandler(_arg1:Event):void{ var _local2:Message; var _local3:Object; if (gamePaused){ return; }; if (screenShakeCount != 0){ screenShakeCount--; _view.shakeScreen((screenShakeCount / maxScreenShakeCount)); }; if (tankControlEnabled){ if (GameInfo.currentPlayerInfo.cpuControlled){ cpuController.update(); } else { _view.updateControls(); }; messageQueue.lock(); while (messageQueue.hasNext()) { _local2 = messageQueue.getNext(); switch (_local2.type){ case ControllerMessage.ACTIVATE_SHIELD: _model.activateShield(); break; case ControllerMessage.ACTIVATE_TELEPORT: _model.activateTeleport(); break; case ControllerMessage.ACTIVATE_REPAIR: _model.activateRepair(); break; case ControllerMessage.FIRE: _model.fire(); break; case ControllerMessage.DOUBLE_TURN_FIRE: _local3 = _local2.data; _model.fireDoubleWeapon(_local3.x, _local3.y, _local3.direction); break; case ControllerMessage.SET_CANNON_ANGLE: _model.cannonAngle = (_local2.data as int); _view.hud.showCannonAngle(GameInfo.currentPlayerInfo.cannonAngle); break; case ControllerMessage.SET_FIRE_POWER: _model.firePower = (_local2.data as int); _view.hud.showFirePower(GameInfo.currentPlayerInfo.firePower); break; case ControllerMessage.SELECT_NEXT_WEAPON: GameInfo.currentPlayerInfo.selectNextWeapon(); _view.hud.showSelectedWeapon(GameInfo.currentPlayerInfo.selectedWeapon, GameInfo.currentPlayerInfo.selectedWeaponAmount); break; case ControllerMessage.SELECT_PREV_WEAPON: GameInfo.currentPlayerInfo.selectPrevWeapon(); _view.hud.showSelectedWeapon(GameInfo.currentPlayerInfo.selectedWeapon, GameInfo.currentPlayerInfo.selectedWeaponAmount); break; }; }; messageQueue.unlock(); if (dSpeed == 0){ _model.tankSpeed = 0; } else { _model.tankSpeed = (_model.tankSpeed + dSpeed); _view.hud.showFuelAmount(GameInfo.currentPlayerInfo.fuel); }; if (dCannonAngle != 0){ _model.cannonAngle = (_model.cannonAngle + dCannonAngle); _view.hud.showCannonAngle(GameInfo.currentPlayerInfo.cannonAngle); }; if (dFirePower != 0){ _model.firePower = (_model.firePower + dFirePower); _view.hud.showFirePower(GameInfo.currentPlayerInfo.firePower); }; } else { messageQueue.clear(); }; _model.update(); } public function selectPrevWeapon():void{ messageQueue.append(ControllerMessage.SELECT_PREV_WEAPON); } public function setSpeedDisp(_arg1:int):void{ dSpeed = _arg1; } public function pauseGame():void{ _view.controlsEnabled = false; _view.hud.pauseBtn.enabled = false; Managers.soundManager.stopChannel("tankMoveChannel"); Managers.soundManager.stopChannel("tankTurretChannel"); gamePaused = true; } public function selectNextWeapon():void{ messageQueue.append(ControllerMessage.SELECT_NEXT_WEAPON); } public function setCannonAngleDisp(_arg1:int):void{ if (_arg1 == 0){ Managers.soundManager.stopChannel("tankTurretChannel"); }; dCannonAngle = _arg1; } public function dispose():void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); _model.dispose(); _model = null; _view.dispose(); _view = null; messageQueue.dispose(); messageQueue = null; cpuController.dispose(); cpuController = null; } public function activateRepair(_arg1:Boolean=false):void{ if (_arg1){ _model.activateRepair(); } else { messageQueue.append(ControllerMessage.ACTIVATE_REPAIR); }; } public function quitGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.END_GAME)); } public function setCannonAngle(_arg1:int):void{ messageQueue.append(ControllerMessage.SET_CANNON_ANGLE, _arg1); } public function get view():DisplayObject{ return (_view); } public function setFirePower(_arg1:int):void{ messageQueue.append(ControllerMessage.SET_FIRE_POWER, _arg1); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); _model.initialize(); _view.drawTerrain(_model.terrainBitmapData); _view.hud.showPlayerName(GameInfo.currentPlayerInfo); _view.hud.showPlayerInfo(GameInfo.currentPlayerInfo); _view.hud.showAllPlayersSortedList(GameInfo.allPlayersSortedList()); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } public function setFirePowerDisp(_arg1:int):void{ dFirePower = _arg1; } private function onModelEventHandler(_arg1:GameModelEvent):void{ var _local2:PlayerInfo; var _local3:PlayerInfo; switch (_arg1.type){ case GameModelEvent.TANK_DAMAGE: cpuController.affectAccuracy((_arg1.data as Tank)); break; case GameModelEvent.SPRITE_ADDED: _view.addItemSprite((_arg1.data as Sprite)); break; case GameModelEvent.SPRITE_REMOVED: _view.removeItemSprite((_arg1.data as Sprite)); break; case GameModelEvent.UPDATE_PLAYER_INFO: if (_arg1.data){ _local3 = GameInfo.currentPlayerInfo; if (_arg1.data == _local3){ _view.hud.showPlayerInfo(_local3); }; }; _view.hud.showAllPlayersSortedList(GameInfo.allPlayersSortedList()); break; case GameModelEvent.ROUND_COMPLETE: dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.COMPLETE_ROUND)); break; case GameModelEvent.GAME_OVER: dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.GAME_OVER)); break; case GameModelEvent.HUD_CONTROL_CHANGED: dSpeed = (dCannonAngle = (dFirePower = 0)); setHUDControlType((_arg1.data as String)); break; case GameModelEvent.NEXT_PLAYER_SELECTED: _local2 = (_arg1.data as PlayerInfo); _view.hud.showPlayerName(_local2); _view.hud.showPlayerInfo(_local2); break; case GameModelEvent.CPU_PLAYER_SELECTED: cpuController.initialize((_arg1.data as Tank)); break; case GameModelEvent.UPDATE_WIND: _view.hud.showWind((_arg1.data as Number)); break; case GameModelEvent.EXPLOSION_SHAKE: screenShakeCount = (maxScreenShakeCount = (_arg1.data as int)); break; }; } public function fireDoubleWeapon(_arg1:Number, _arg2:Number, _arg3:String):void{ messageQueue.append(ControllerMessage.DOUBLE_TURN_FIRE, {x:_arg1, y:_arg2, direction:_arg3}); } public function activateShield(_arg1:Boolean=false):void{ if (_arg1){ _model.activateShield(); } else { messageQueue.append(ControllerMessage.ACTIVATE_SHIELD); }; } public function fire():void{ messageQueue.append(ControllerMessage.FIRE); } public function activateTeleport():void{ messageQueue.append(ControllerMessage.ACTIVATE_TELEPORT); } public function resumeGame():void{ _view.controlsEnabled = true; _view.hud.pauseBtn.enabled = true; gamePaused = false; } } }//package tanks2.core.game
Section 185
//GameInfo (tanks2.core.game.GameInfo) package tanks2.core.game { import tanks2.managers.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.utils.*; import tanks2.core.game.terrain.*; import tanks2.utils.*; public class GameInfo { public static const maxPlayers:int = 5; private static var _terrainTypeToRetrieve:String; private static var _terrainType:String; private static var _currentPlayerIndex:int; private static var _numRoundsToWinDeathmatch:int; private static var _deathmatchMode:Boolean; private static var _currentRound:int; private static var _players:Array; public static function deathmatchResultsPlayersSortedList():Array{ var _local1:Array = _players.slice(); _local1.sortOn(["numRoundWins", "score", "numKills", "totalDamage"], (Array.NUMERIC | Array.DESCENDING)); return (_local1); } public static function get humanPlayersList():Array{ var _local2:PlayerInfo; var _local1:Array = []; for each (_local2 in _players) { if (!_local2.cpuControlled){ _local1.push(_local2); }; }; return (_local1); } public static function removePlayerFromOrder(_arg1:PlayerInfo):void{ _arg1.destroyed = true; } public static function get currentPlayerInfo():PlayerInfo{ return (_players[_currentPlayerIndex]); } public static function setNumRoundsToWinDeathmatch(_arg1:int):void{ _numRoundsToWinDeathmatch = _arg1; } public static function get numPlayers():int{ return (_players.length); } public static function get playersList():Array{ return (_players); } public static function get deathmatchMode():Boolean{ return (_deathmatchMode); } public static function reinitializeGame():void{ var _local1:PlayerInfo; var _local2:PlayerInfo; if (_deathmatchMode){ for each (_local1 in _players) { _local1.reset(); }; _currentRound = 0; } else { _local2 = humanPlayersList[0]; _local2.score = 0; _currentRound--; }; } public static function getCurrentTerrainType():String{ return (_terrainTypeToRetrieve); } public static function set terrainType(_arg1:String):void{ _terrainType = _arg1; } public static function startNewRound():void{ _currentPlayerIndex = 0; _currentRound++; if (_deathmatchMode){ startNewDeathmatchRound(); } else { startNewCampaignRound(); }; } public static function get currentRound():int{ return (_currentRound); } private static function startNewCampaignRound():void{ var _local5:PlayerInfo; var _local6:CampaignOpponentInfo; var _local7:String; var _local8:uint; var _local9:PlayerInfo; var _local10:Object; var _local11:String; var _local12:Object; var _local13:String; var _local1:PlayerInfo = humanPlayersList[0]; var _local2:Array = PlayerInfo.COLORS.slice(); _local2.splice(_local2.indexOf(_local1.color), 1); _players = []; var _local3:Array = [_local1.name]; var _local4:Array = Managers.configManager.getOpponentsForCampaignRound(_local1.numRoundWins); while (_local4.length > 0) { _local6 = _local4.pop(); _local7 = NameGenerator.getNextName(_local3); _local8 = (_local2.shift() as uint); _local9 = new PlayerInfo(_local7, _local8, true, _local6.level); _local9.clearAllEquipments(); _local10 = _local6.weaponsHash; for (_local11 in _local10) { _local9.setWeaponAmount(_local11, _local10[_local11]); }; _local12 = _local6.upgradesHash; for (_local13 in _local12) { _local9.setUpgradeAmount(_local13, _local12[_local11]); }; _local9.selectedWeapon = WeaponType.STANDARD_SHELL; _players.push(_local9); }; _players = ArrayUtil.shuffle(_players); _players.unshift(_local1); for each (_local5 in _players) { _local5.destroyed = false; _local5.health = _local5.maxHealth; _local5.fuel = _local5.maxFuel; _local5.cannonAngle = 0; _local5.firePower = 50; _local5.shield = 0; _local5.selectedWeapon = WeaponType.STANDARD_SHELL; }; _terrainTypeToRetrieve = TerrainType.getRandomType(); } public static function addPlayer(_arg1:PlayerInfo):void{ _players.push(_arg1); } public static function allPlayersSortedList(_arg1:String="health"):Array{ var _local3:PlayerInfo; var _local2:Array = []; for each (_local3 in _players) { if (!_local3.destroyed){ _local2.push(_local3); }; }; _local2.sortOn(_arg1, (Array.NUMERIC | Array.DESCENDING)); return (_local2); } public static function isGameCompleted():Boolean{ var _local1:PlayerInfo; var _local2:PlayerInfo; var _local3:int; if (_deathmatchMode){ _local1 = GameInfo.deathmatchWinner; return (Boolean(_local1)); }; _local2 = humanPlayersList[0]; _local3 = Managers.configManager.numCampaignRounds; return ((_local2.numRoundWins == _local3)); } public static function startNewGame(_arg1:Boolean):void{ _deathmatchMode = _arg1; _players = []; _currentRound = 0; } public static function get deathmatchWinner():PlayerInfo{ var _local1:PlayerInfo; for each (_local1 in _players) { if (_local1.numRoundWins == _numRoundsToWinDeathmatch){ return (_local1); }; }; return (null); } public static function selectNextPlayerInOrder():void{ var _local1:PlayerInfo; while (true) { _currentPlayerIndex++; if (_currentPlayerIndex == _players.length){ _currentPlayerIndex = 0; }; _local1 = _players[_currentPlayerIndex]; if (!_local1.destroyed){ return; }; }; } public static function get roundWinner():PlayerInfo{ var _local1:PlayerInfo; for each (_local1 in _players) { if (!_local1.destroyed){ if (_deathmatchMode){ return (_local1); }; if (!_local1.cpuControlled){ return (_local1); }; }; }; return (null); } private static function startNewDeathmatchRound():void{ var _local1:PlayerInfo; for each (_local1 in _players) { _local1.destroyed = false; _local1.health = _local1.maxHealth; _local1.fuel = _local1.maxFuel; _local1.cannonAngle = 0; _local1.firePower = 50; _local1.shield = 0; _local1.selectedWeapon = WeaponType.STANDARD_SHELL; }; _players = ArrayUtil.shuffle(_players); if (_terrainType == TerrainType.RANDOM){ _terrainTypeToRetrieve = TerrainType.getRandomType(); } else { _terrainTypeToRetrieve = _terrainType; }; } } }//package tanks2.core.game
Section 186
//GameModel (tanks2.core.game.GameModel) package tanks2.core.game { import com.bigwigmedia.statemachine.hsm.*; import flash.display.*; import flash.events.*; import tanks2.managers.*; import tanks2.core.game.events.*; import flash.geom.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.math.*; import com.bigwigmedia.core.*; import tanks2.sound.*; import flash.utils.*; import com.bigwigmedia.utils.*; import tanks2.core.game.terrain.*; import com.bigwigmedia.application.*; public class GameModel extends EventDispatcher implements IUpdatable, IDisposable { private var effects:Array; private var currentTank:Tank; private var _terrainBitmapData:BitmapData; private var projectiles:Array; private var tanks:Array; private var playerInfoToTankDict:Dictionary; private var stateMachine:IHSM; public function GameModel(){ playerInfoToTankDict = new Dictionary(); tanks = []; projectiles = []; effects = []; super(); } private function findTerrainUpperPixelPosY(_arg1:int):int{ var _local3:uint; var _local4:uint; var _local2:int = _terrainBitmapData.height; while (true) { --_local2; _local3 = _terrainBitmapData.getPixel32(_arg1, _local2); _local4 = ((_local3 >> 24) & 0xFF); if (_local4 == 0){ break; }; }; return (_local2); } private function onProjectileCreateFragmentsHandler(_arg1:ProjectileEvent):void{ var _local3:Projectile; var _local2:Array = (_arg1.data as Array); for each (_local3 in _local2) { addGameItem(_local3); }; } private function activateDoubleTurnTeleport(_arg1:SignalEvent):void{ dispatchEvent(new GameModelEvent(GameModelEvent.HUD_CONTROL_CHANGED, HUDControlType.TELEPORT_CURSOR)); } public function get terrainBitmapData():BitmapData{ return (_terrainBitmapData); } public function initialize():void{ var _local6:Number; var _local7:int; var _local8:int; var _local9:PlayerInfo; var _local10:Tank; var _local11:Object; var _local1:IApplication = ApplicationGlobals.application; _terrainBitmapData = Terrain.generate(_local1.nominalWidth, GameInfo.getCurrentTerrainType()); var _local2:Array = GameInfo.playersList; var _local3:Array = []; var _local4:Number = (_local1.nominalWidth / _local2.length); var _local5:int; while (_local5 < _local2.length) { _local6 = ((((Math.random() * 2) - 1) * _local4) / 6); _local7 = (((_local4 * _local5) + (_local4 / 2)) + _local6); _local8 = findTerrainUpperPixelPosY(_local7); _local3.push({x:_local7, y:_local8}); _local5++; }; _local3 = ArrayUtil.shuffle(_local3); _local5 = 0; while (_local5 < _local2.length) { _local9 = _local2[_local5]; _local10 = new Tank(new TankSprite(_local9.color), _local9); _local11 = _local3[_local5]; _local10.x = _local11.x; _local10.y = _local11.y; playerInfoToTankDict[_local9] = _local10; addGameItem(_local10); _local5++; }; GameItem.setTerrainBitmapData(_terrainBitmapData); GameItem.setTanksList(tanks.concat()); GameItem.wind = (((Math.random() * 2) - 1) * Managers.configManager.getWindChangeMaxPercentage()); dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_WIND, GameItem.wind)); stateMachine = new HSM("GameModel_HSM"); stateMachine.addState(new InitialState(SMState.INITIAL)); stateMachine.addState(new SimpleState(SMState.TURN_ACTIVATED, activateTurn)); stateMachine.addState(new SimpleState(SMState.DOUBLE_TURN_ACTIVATED, activateDoubleTurn)); stateMachine.addState(new SimpleState(SMState.TELEPORT_ACTIVATED, activateDoubleTurnTeleport)); stateMachine.addState(new SimpleState(SMState.DOING_TURN, deactivateTurn)); stateMachine.addState(new ChoicePointState(SMState.COMPLETE_ROUND_CHOICE)); stateMachine.addState(new SimpleState(SMState.ROUND_COMPLETED)); stateMachine.addState(new FinalState(SMState.FINAL, completeRound)); stateMachine.addTransition(SMState.INITIAL, SMState.TURN_ACTIVATED, null); stateMachine.addTransition(SMState.TURN_ACTIVATED, SMState.DOING_TURN, SMEvent.DO_TURN); stateMachine.addTransition(SMState.TURN_ACTIVATED, SMState.DOUBLE_TURN_ACTIVATED, SMEvent.ACTIVATE_DOUBLE_TURN); stateMachine.addTransition(SMState.TURN_ACTIVATED, SMState.TELEPORT_ACTIVATED, SMEvent.ACTIVATE_TELEPORT); stateMachine.addTransition(SMState.TELEPORT_ACTIVATED, SMState.DOING_TURN, SMEvent.DO_TURN); stateMachine.addTransition(SMState.DOUBLE_TURN_ACTIVATED, SMState.DOING_TURN, SMEvent.DO_TURN); stateMachine.addTransition(SMState.DOING_TURN, SMState.COMPLETE_ROUND_CHOICE, SMEvent.COMPLETE_TURN); stateMachine.addTransition(SMState.COMPLETE_ROUND_CHOICE, SMState.ROUND_COMPLETED, null, null, isRoundCompleted); stateMachine.addTransition(SMState.COMPLETE_ROUND_CHOICE, SMState.TURN_ACTIVATED, null, activateNextTurn, null); stateMachine.addTransition(SMState.ROUND_COMPLETED, SMState.FINAL, 1500); stateMachine.start(); } private function deactivateTurn(_arg1:SignalEvent):void{ Managers.soundManager.stopChannel("tankMoveChannel"); Managers.soundManager.stopChannel("tankTurretChannel"); dispatchEvent(new GameModelEvent(GameModelEvent.HUD_CONTROL_CHANGED, HUDControlType.ALL_DISABLED)); } private function destroyTank(_arg1:Tank):void{ Managers.soundManager.playSound(SoundID.EXPLOSN_MED_01_WAV); if ((((_arg1 == currentTank)) && ((stateMachine.currentState.name == SMState.TURN_ACTIVATED)))){ stateMachine.sendSignal(new SignalEvent(SMEvent.DO_TURN)); }; var _local2:PlayerInfo = GameInfo.currentPlayerInfo; if (_arg1.playerInfo != _local2){ _local2.numKills++; }; var _local3:AnimatedEffect = new AnimatedEffect(new MediumExplosionClip()); _local3.x = _arg1.x; _local3.y = _arg1.y; addGameItem(_local3); removeGameItem(_arg1); dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_PLAYER_INFO, null)); } private function activateTurn(_arg1:SignalEvent):void{ currentTank = playerInfoToTankDict[GameInfo.currentPlayerInfo]; var _local2:AnimatedEffect = new AnimatedEffect(new TankArrowClip()); _local2.x = int(currentTank.x); _local2.y = int(currentTank.y); addGameItem(_local2); var _local3:String = (currentTank.playerInfo.cpuControlled) ? HUDControlType.HUD_DISABLED_CONTROL_ENABLED : HUDControlType.ALL_ENABLED; dispatchEvent(new GameModelEvent(GameModelEvent.HUD_CONTROL_CHANGED, _local3)); dispatchEvent(new GameModelEvent(GameModelEvent.NEXT_PLAYER_SELECTED, currentTank.playerInfo)); if (currentTank.playerInfo.cpuControlled){ dispatchEvent(new GameModelEvent(GameModelEvent.CPU_PLAYER_SELECTED, currentTank)); }; } public function dispose():void{ var _local1:GameItem; stateMachine.dispose(); stateMachine = null; playerInfoToTankDict = new Dictionary(); _terrainBitmapData.dispose(); _terrainBitmapData = null; currentTank = null; GameItem.setTanksList([]); for each (_local1 in effects) { removeGameItem(_local1); }; for each (_local1 in projectiles) { removeGameItem(_local1); }; for each (_local1 in tanks) { removeGameItem(_local1); }; } private function activateNextTurn(_arg1:SignalEvent):void{ var _local2:Number = GameItem.wind; var _local3:Number = (_local2 + ((((Math.random() < 0.5)) ? -1 : 1 * Math.random()) * Managers.configManager.getWindChangeMaxPercentage())); if (_local3 < -1){ _local3 = -1; } else { if (_local3 > 1){ _local3 = 1; }; }; if (Math.random() < Managers.configManager.getWindDirectionChangeProbability()){ _local3 = -(_local3); }; GameItem.wind = _local3; dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_WIND, GameItem.wind)); GameInfo.selectNextPlayerInOrder(); } private function isRoundCompleted():Boolean{ var _local1:PlayerInfo; if (tanks.length <= 1){ return (true); }; if (!GameInfo.deathmatchMode){ _local1 = GameInfo.humanPlayersList[0]; if (_local1.destroyed){ return (true); }; }; return (false); } private function teleport(_arg1:Number, _arg2:Number):void{ var _local6:Tank; var _local7:uint; var _local8:Rectangle; var _local9:Rectangle; var _local10:Teleport; var _local3:int = _arg1; var _local4:int = (_arg2 - (480 - _terrainBitmapData.height)); var _local5:Boolean; for each (_local6 in tanks) { if (_local6 != currentTank){ _local8 = TankSprite(_local6.sprite).projectileHitTestObject.getRect(_local6.sprite.parent); _local9 = TankSprite(currentTank.sprite).projectileHitTestObject.getRect(currentTank.sprite.parent); _local9.x = (_local3 - (_local9.width / 2)); _local9.y = (_local4 - (_local9.height / 2)); if (_local8.intersects(_local9)){ _local5 = true; break; }; }; }; _local7 = ((_terrainBitmapData.getPixel32(_local3, _local4) >> 24) & 0xFF); if (((!((_local7 == 0))) || (_local5))){ dispatchEvent(new GameModelEvent(GameModelEvent.HUD_CONTROL_CHANGED, HUDControlType.TELEPORT_CURSOR)); } else { Managers.soundManager.playSound(SoundID.WPN_TELEPORT_01_WAV); _local10 = new Teleport(_local3, _local4); _local10.x = currentTank.x; _local10.y = currentTank.y; _local10.positionSprite(); _local10.addEventListener(TeleportEvent.COMPLETE, onTeleportCompleteHandler); _local10.addEventListener(TeleportEvent.PEAK, onTeleportPeakHandler); effects.push(_local10); dispatchEvent(new GameModelEvent(GameModelEvent.SPRITE_ADDED, _local10.sprite)); }; } public function set cannonAngle(_arg1:int):void{ currentTank.cannonAngle = _arg1; } private function get isCurrentTankMoving():Boolean{ return (((!(currentTank.onGround())) || (!((currentTank.speedX == 0))))); } private function updateTerrainRect(_arg1:Rectangle):void{ var _local3:int; var _local4:int; var _local5:int; var _local6:int; var _local7:uint; var _local8:int; var _local9:uint; var _local10:uint; var _local11:uint; var _local12:uint; _terrainBitmapData.lock(); var _local2:int; while (_local2 < _arg1.width) { _local3 = (_arg1.x + _local2); _local4 = -1; _local5 = (_arg1.height - 1); while ((((_local4 == -1)) && ((_local5 > 0)))) { _local7 = ((_terrainBitmapData.getPixel32(_local3, _local5) >> 24) & 0xFF); if (_local7 == 0){ _local4 = _local5; }; _local5--; }; _local6 = (_local4 - 1); while (_local6 >= 0) { _local8 = _local6; _local9 = _terrainBitmapData.getPixel32(_local3, _local8); _local10 = ((_local9 >> 24) & 0xFF); _local11 = _terrainBitmapData.getPixel32(_local3, (_local8 + 1)); _local12 = ((_local11 >> 24) & 0xFF); if ((((_local10 > 0)) && ((_local12 == 0)))){ _terrainBitmapData.setPixel32(_local3, _local4, _local9); _terrainBitmapData.setPixel32(_local3, _local8, 0); _local4--; }; _local6--; }; _local2++; }; _terrainBitmapData.unlock(); } public function fireDoubleWeapon(_arg1:Number, _arg2:Number, _arg3:String):void{ var _local4:Projectile; var _local5:Projectile; if (stateMachine.currentState.name == SMState.TELEPORT_ACTIVATED){ teleport(_arg1, _arg2); return; }; switch (currentTank.playerInfo.selectedWeapon){ case WeaponType.AIR_STRIKE: Managers.soundManager.playSound(SoundID.WPN_AIRSTRIKE_01_WAV); _local4 = new AirStrikeShuttle(_arg3, _arg1, ((_arg2 + _terrainBitmapData.height) - 350)); if (_arg3 == WeaponDirection.RIGHT_TO_LEFT){ _local4.sprite.scaleX = -1; _local4.x = 640; }; _local4.y = (_terrainBitmapData.height - 350); _local4.positionSprite(); addGameItem(_local4); break; case WeaponType.SATELLITE_STRIKE: Managers.soundManager.playSound(SoundID.WPN_SAT_STRIKE_01_WAV); _local5 = new SatelliteStrike(); _local5.x = _arg1; _local5.y = findTerrainUpperPixelPosY(_arg1); _local5.positionSprite(); addGameItem(_local5); break; }; stateMachine.sendSignal(new SignalEvent(SMEvent.DO_TURN)); } public function fire():void{ var _local1:Number; var _local2:Vector2D; var _local3:Class; var _local4:Projectile; currentTank.speedX = 0; Managers.soundManager.stopChannel("tankMoveChannel"); Managers.soundManager.stopChannel("tankTurretChannel"); if ((((currentTank.playerInfo.selectedWeaponAmount == 0)) || (isCurrentTankMoving))){ return; }; switch (currentTank.playerInfo.selectedWeapon){ case WeaponType.AIR_STRIKE: Managers.soundManager.playSound(SoundID.WPN_PREDSTRIKE_01_WAV); stateMachine.sendSignal(new SignalEvent(SMEvent.ACTIVATE_DOUBLE_TURN)); break; case WeaponType.SATELLITE_STRIKE: Managers.soundManager.playSound(SoundID.WPN_SAT_COMMUNIC_01_WAV); stateMachine.sendSignal(new SignalEvent(SMEvent.ACTIVATE_DOUBLE_TURN)); break; default: Managers.soundManager.playSound(SoundID.TANK_FIRE_01_WAV); stateMachine.sendSignal(new SignalEvent(SMEvent.DO_TURN)); _local1 = ((currentTank.cannonAngle / 180) * Math.PI); _local2 = Vector2D.X_UNIT.getMultiply((currentTank.firePower / 6)); _local2.rotateTo(_local1); _local3 = WeaponType.getWeaponClass(currentTank.playerInfo.selectedWeapon); _local4 = new2(_local3, [_local2]); _local4.x = (currentTank.x + (19 * Math.cos(_local1))); _local4.y = ((currentTank.y + (19 * Math.sin(_local1))) - 12); addGameItem(_local4); currentTank.fire(); break; }; if (currentTank.playerInfo.selectedWeaponAmount != -1){ currentTank.playerInfo.selectedWeaponAmount--; }; dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_PLAYER_INFO, currentTank.playerInfo)); } public function activateShield():void{ var _local1:PlayerInfo = currentTank.playerInfo; var _local2:int = _local1.getUpgradeAmount(UpgradeType.SHIELD); if (_local2 > 0){ Managers.soundManager.playSound(SoundID.EQP_FORCEFIELD_01_WAV); currentTank.showShield(); _local1.setUpgradeAmount(UpgradeType.SHIELD, (_local2 - 1)); _local1.shield = _local1.maxShield; dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_PLAYER_INFO, _local1)); }; } public function activateTeleport():void{ var _local1:PlayerInfo = currentTank.playerInfo; var _local2:int = _local1.getUpgradeAmount(UpgradeType.TELEPORT); if (_local2 > 0){ currentTank.speedX = 0; stateMachine.sendSignal(new SignalEvent(SMEvent.ACTIVATE_TELEPORT)); _local1.setUpgradeAmount(UpgradeType.TELEPORT, (_local2 - 1)); dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_PLAYER_INFO, _local1)); }; } private function activateDoubleTurn(_arg1:SignalEvent):void{ dispatchEvent(new GameModelEvent(GameModelEvent.HUD_CONTROL_CHANGED, HUDControlType.LOCATION_CURSOR)); } private function onTeleportCompleteHandler(_arg1:TeleportEvent):void{ var _local2:Teleport = (_arg1.target as Teleport); dispatchEvent(new GameModelEvent(GameModelEvent.SPRITE_REMOVED, _local2.sprite)); _local2.addEventListener(TeleportEvent.COMPLETE, onTeleportCompleteHandler); _local2.addEventListener(TeleportEvent.PEAK, onTeleportPeakHandler); effects.splice(effects.indexOf(_local2), 1); _local2.dispose(); } private function onProjectileOutOfScreenHandler(_arg1:ProjectileEvent):void{ var _local2:Projectile = (_arg1.target as Projectile); removeGameItem(_local2); } private function completeRound(_arg1:SignalEvent):void{ var _local2:PlayerInfo = GameInfo.roundWinner; if (_local2){ _local2.numRoundWins++; }; if (GameInfo.deathmatchMode){ dispatchEvent(new GameModelEvent(GameModelEvent.ROUND_COMPLETE)); } else { if (_local2){ dispatchEvent(new GameModelEvent(GameModelEvent.ROUND_COMPLETE)); } else { dispatchEvent(new GameModelEvent(GameModelEvent.GAME_OVER)); }; }; } public function get cannonAngle():int{ return (currentTank.cannonAngle); } private function removeGameItem(_arg1:GameItem):void{ var _local2:PlayerInfo; dispatchEvent(new GameModelEvent(GameModelEvent.SPRITE_REMOVED, _arg1.sprite)); if ((_arg1 is Tank)){ _arg1.removeEventListener(TankEvent.DAMAGE, onTankDamageHandler); _local2 = Tank(_arg1).playerInfo; delete playerInfoToTankDict[_local2]; tanks.splice(tanks.indexOf(_arg1), 1); GameItem.setTanksList(tanks.concat()); GameInfo.removePlayerFromOrder(_local2); } else { if ((_arg1 is Projectile)){ _arg1.removeEventListener(ProjectileEvent.EXPLODE, onProjectileExplodeHandler); _arg1.removeEventListener(ProjectileEvent.OUT_OF_SCREEN, onProjectileOutOfScreenHandler); _arg1.removeEventListener(ProjectileEvent.CREATE_FRAGMENTS, onProjectileCreateFragmentsHandler); projectiles.splice(projectiles.indexOf(_arg1), 1); } else { _arg1.removeEventListener(Event.COMPLETE, onItemCompleteHandler); effects.splice(effects.indexOf(_arg1), 1); }; }; _arg1.dispose(); } public function set firePower(_arg1:int):void{ currentTank.firePower = _arg1; } private function onItemCompleteHandler(_arg1:Event):void{ removeGameItem(GameItem(_arg1.target)); } public function activateRepair():void{ var _local3:int; var _local1:PlayerInfo = currentTank.playerInfo; var _local2:int = _local1.getUpgradeAmount(UpgradeType.REPAIR_KIT); if ((((_local2 > 0)) && ((_local1.health < _local1.maxHealth)))){ Managers.soundManager.playSound(SoundID.EQP_REPAIR_01_WAV); _local3 = (_local1.health + Managers.configManager.getUpgradeValue(UpgradeType.REPAIR_KIT)); if (_local3 > _local1.maxHealth){ _local3 = _local1.maxHealth; }; _local1.health = _local3; currentTank.showDamageEffect(); _local1.setUpgradeAmount(UpgradeType.REPAIR_KIT, (_local2 - 1)); dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_PLAYER_INFO, _local1)); }; } public function update():void{ var _local1:IUpdatable; var _local2:IUpdatable; var _local3:Boolean; var _local4:Tank; for each (_local1 in effects) { _local1.update(); }; for each (_local2 in projectiles) { _local2.update(); }; _local3 = true; for each (_local4 in tanks) { _local4.update(); if (!_local4.onGround()){ _local3 = false; }; }; if (((((_local3) && ((projectiles.length == 0)))) && ((stateMachine.currentState.name == SMState.DOING_TURN)))){ stateMachine.sendSignal(new SignalEvent(SMEvent.COMPLETE_TURN)); }; } private function addGameItem(_arg1:GameItem):void{ if ((_arg1 is Tank)){ _arg1.addEventListener(TankEvent.DAMAGE, onTankDamageHandler); tanks.push(_arg1); } else { if ((_arg1 is Projectile)){ _arg1.addEventListener(ProjectileEvent.EXPLODE, onProjectileExplodeHandler); _arg1.addEventListener(ProjectileEvent.OUT_OF_SCREEN, onProjectileOutOfScreenHandler); _arg1.addEventListener(ProjectileEvent.CREATE_FRAGMENTS, onProjectileCreateFragmentsHandler); projectiles.push(_arg1); } else { _arg1.addEventListener(Event.COMPLETE, onItemCompleteHandler); effects.push(_arg1); }; }; _arg1.positionSprite(); dispatchEvent(new GameModelEvent(GameModelEvent.SPRITE_ADDED, _arg1.sprite)); } private function onTeleportPeakHandler(_arg1:TeleportEvent):void{ Managers.soundManager.playSound(SoundID.WPN_TELEPORT_02_WAV); var _local2:Teleport = (_arg1.target as Teleport); currentTank.x = _local2.targetX; currentTank.y = _local2.targetY; currentTank.positionSprite(); stateMachine.sendSignal(new SignalEvent(SMEvent.DO_TURN)); } public function get firePower():int{ return (currentTank.firePower); } private function explode(_arg1:Projectile):void{ var _local13:Tank; var _local14:Tank; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:int; var _local20:int; var _local21:int; var _local22:int; var _local23:PlayerInfo; var _local2:Number = _arg1.x; var _local3:Number = _arg1.y; var _local4:int = _arg1.damageRadius; var _local5:int = _arg1.damage; var _local6:Class = _arg1.explosionAnimationClass; var _local7:AnimatedEffect = new AnimatedEffect(new (_local6)); _local7.x = _local2; _local7.y = _local3; addGameItem(_local7); var _local8:AnimatedEffect = new AnimatedEffect(new ExplosionEffect()); _local8.x = _local2; _local8.y = _local3; _local8.sprite.width = (_local8.sprite.height = ((84 * _local4) / 100)); addGameItem(_local8); var _local9:int = _arg1.shakeAmount; if (_local9 != 0){ dispatchEvent(new GameModelEvent(GameModelEvent.EXPLOSION_SHAKE, _local9)); }; var _local10:Shape = new Shape(); _local10.graphics.lineStyle(0); _local10.graphics.beginFill(0, 1); _local10.graphics.drawCircle(0, 0, _local4); _local10.graphics.endFill(); var _local11:Matrix = new Matrix(); _local11.translate(_local2, _local3); _terrainBitmapData.draw(_local10, _local11, null, BlendMode.ERASE); var _local12:Rectangle = new Rectangle(((_local2 - _local4) - 1), 0, ((_local4 * 2) + 3), _terrainBitmapData.height); updateTerrainRect(_local12); for each (_local13 in tanks) { _local15 = (_local13.x - _local2); _local16 = ((_local13.y - 7) - _local3); _local17 = Math.sqrt(((_local15 * _local15) + (_local16 * _local16))); _local18 = ((12 + _local4) - _local17); if (_local18 > 0){ _local19 = ((1.2 * _local5) * (_local18 / _local4)); if (_local19 > _local5){ _local19 = _local5; }; _local20 = _local13.playerInfo.health; _local21 = _local13.damage(_local19); _local22 = ((_local20 - _local13.playerInfo.health) * Managers.configManager.getDamageToScoreMultiplier()); if (_local13.destroyed){ _local22 = (_local22 + Managers.configManager.getTankDestroyBonus()); }; _local23 = GameInfo.currentPlayerInfo; if (_local13.playerInfo != _local23){ _local23.score = (_local23.score + _local22); _local23.totalDamage = (_local23.totalDamage + _local21); }; dispatchEvent(new GameModelEvent(GameModelEvent.TANK_DAMAGE, _local13)); dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_PLAYER_INFO, null)); }; }; for each (_local14 in tanks) { if (_local14.destroyed){ destroyTank(_local14); }; }; } private function onProjectileExplodeHandler(_arg1:ProjectileEvent):void{ var _local2:Projectile = (_arg1.target as Projectile); explode(_local2); removeGameItem(_local2); } private function onTankDamageHandler(_arg1:TankEvent):void{ var _local3:int; var _local4:PlayerInfo; var _local2:Tank = (_arg1.target as Tank); if (!_local2.destroyed){ _local3 = _local2.damage((_arg1.data as int)); _local4 = GameInfo.currentPlayerInfo; if (_local2.playerInfo != _local4){ _local4.totalDamage = (_local4.totalDamage + _local3); }; if (_local2.destroyed){ destroyTank(_local2); }; dispatchEvent(new GameModelEvent(GameModelEvent.TANK_DAMAGE, _local2)); dispatchEvent(new GameModelEvent(GameModelEvent.UPDATE_PLAYER_INFO, null)); }; } public function set tankSpeed(_arg1:int):void{ currentTank.speedX = _arg1; if (currentTank.speedX != 0){ currentTank.playerInfo.fuel--; }; } public function get tankSpeed():int{ return (currentTank.speedX); } } }//package tanks2.core.game
Section 187
//GameView (tanks2.core.game.GameView) package tanks2.core.game { import flash.display.*; import flash.events.*; import tanks2.managers.*; import tanks2.core.game.events.*; import com.bigwigmedia.events.*; import tanks2.core.game.gameItems.*; import tanks2.core.game.hud.*; import com.bigwigmedia.core.*; import com.bigwigmedia.input.*; import tanks2.ui.*; import com.bigwigmedia.application.*; import flash.ui.*; public class GameView extends Sprite implements IDisposable { private var terrainBitmap:Bitmap; private var itemsHolder:Sprite; private var tanksHolder:Sprite; private var spritesHolder:Sprite; private var _controlsEnabled:Boolean;// = false private var weaponCursorID:int; private var background:MovieClip; private var keyInputMan:KeyInputManager; private var pauseMenu:PauseMenu; private var _hud:HUD; private var _controller:GameController; public function GameView(_arg1:GameController){ _controller = _arg1; keyInputMan = new KeyInputManager(ApplicationGlobals.application.stage); keyInputMan.mapKey(KeyControlActions.MOVE_LEFT, Keyboard.LEFT); keyInputMan.mapKey(KeyControlActions.MOVE_RIGHT, Keyboard.RIGHT); keyInputMan.mapKey(KeyControlActions.CANNON_CCW, Keyboard.UP); keyInputMan.mapKey(KeyControlActions.CANNON_CW, Keyboard.DOWN); keyInputMan.mapKey(KeyControlActions.FIRE_POWER_UP, Keyboard.PAGE_UP); keyInputMan.mapKey(KeyControlActions.FIRE_POWER_DOWN, Keyboard.PAGE_DOWN); keyInputMan.mapKey(KeyControlActions.FIRE, Keyboard.SPACE); keyInputMan.mapKey(KeyControlActions.SELECT_PREV_WEAPON, 81); keyInputMan.mapKey(KeyControlActions.SELECT_NEXT_WEAPON, 87); keyInputMan.addEventListener(KeyInputEvent.KEY_DOWN, onKeyDownHandler); background = new LevelBackground(); background.gotoAndStop(GameInfo.getCurrentTerrainType()); addChild(background); spritesHolder = new Sprite(); addChild(spritesHolder); terrainBitmap = new Bitmap(); spritesHolder.addChild(terrainBitmap); tanksHolder = new Sprite(); spritesHolder.addChild(tanksHolder); itemsHolder = new Sprite(); spritesHolder.addChild(itemsHolder); _hud = new HUD(); _hud.addEventListener(HUDEvent.CANNON_ANGLE_CHANGE, onHUDEventHandler); _hud.addEventListener(HUDEvent.FIRE_POWER_CHANGE, onHUDEventHandler); _hud.addEventListener(HUDEvent.FIRE, onHUDEventHandler); _hud.addEventListener(HUDEvent.SELECT_NEXT_WEAPON, onHUDEventHandler); _hud.addEventListener(HUDEvent.SELECT_PREV_WEAPON, onHUDEventHandler); _hud.addEventListener(HUDEvent.ACTIVATE_SHIELD, onHUDEventHandler); _hud.addEventListener(HUDEvent.ACTIVATE_TELEPORT, onHUDEventHandler); _hud.addEventListener(HUDEvent.ACTIVATE_REPAIR, onHUDEventHandler); _hud.addEventListener(HUDEvent.PAUSE, onHUDEventHandler); addChild(_hud); } private function onHUDEventHandler(_arg1:HUDEvent):void{ if (_arg1.type == HUDEvent.PAUSE){ pauseMenu = new PauseMenu(); pauseMenu.addEventListener(PauseMenuEvent.RESUME, onPauseMenuEvent); pauseMenu.addEventListener(PauseMenuEvent.QUIT, onPauseMenuEvent); addChild(pauseMenu); _controller.pauseGame(); return; }; if (!_controlsEnabled){ return; }; switch (_arg1.type){ case HUDEvent.CANNON_ANGLE_CHANGE: _controller.setCannonAngle((_arg1.data as int)); break; case HUDEvent.FIRE_POWER_CHANGE: _controller.setFirePower((_arg1.data as int)); break; case HUDEvent.FIRE: _controller.fire(); break; case HUDEvent.SELECT_NEXT_WEAPON: _controller.selectNextWeapon(); break; case HUDEvent.SELECT_PREV_WEAPON: _controller.selectPrevWeapon(); break; case HUDEvent.ACTIVATE_SHIELD: _controller.activateShield(); break; case HUDEvent.ACTIVATE_TELEPORT: _controller.activateTeleport(); break; case HUDEvent.ACTIVATE_REPAIR: _controller.activateRepair(); break; }; } private function removePauseMenu():void{ if (pauseMenu){ pauseMenu.removeEventListener(PauseMenuEvent.RESUME, onPauseMenuEvent); pauseMenu.removeEventListener(PauseMenuEvent.QUIT, onPauseMenuEvent); pauseMenu.dispose(); removeChild(pauseMenu); pauseMenu = null; }; } public function shakeScreen(_arg1:Number):void{ var _local2:DisplayObject = ApplicationGlobals.application.mainView; _local2.x = (_arg1 * ((Math.random() * 6) - 3)); _local2.y = (_arg1 * ((Math.random() * 6) - 3)); } public function set controlsEnabled(_arg1:Boolean):void{ _controlsEnabled = (_hud.enabled = _arg1); } public function drawTerrain(_arg1:BitmapData):void{ terrainBitmap.bitmapData = _arg1; terrainBitmap.y = (itemsHolder.y = (tanksHolder.y = (ApplicationGlobals.application.nominalHeight - _arg1.height))); } private function onStageMouseDownHandler(_arg1:MouseEvent):void{ ApplicationGlobals.application.stage.removeEventListener(MouseEvent.MOUSE_DOWN, onStageMouseDownHandler); var _local2:String; var _local3:IDisposable = (Managers.cursorManager.currentCursor as IDisposable); if ((_local3 is AirStrikeCursor)){ _local2 = AirStrikeCursor(_local3).direction; }; _local3.dispose(); Managers.cursorManager.removeCursor(weaponCursorID); _controller.fireDoubleWeapon(_arg1.stageX, _arg1.stageY, _local2); } public function removeItemSprite(_arg1:Sprite):void{ var _local2:DisplayObjectContainer = _arg1.parent; _local2.removeChild(_arg1); } private function onPauseMenuEvent(_arg1:PauseMenuEvent):void{ switch (_arg1.type){ case PauseMenuEvent.RESUME: removePauseMenu(); _controller.resumeGame(); break; case PauseMenuEvent.QUIT: _controller.quitGame(); break; }; } public function updateControls():void{ if (!_controlsEnabled){ return; }; if (((_hud.isMoveLeftBtnPressed()) || (keyInputMan.isKeyDown(KeyControlActions.MOVE_LEFT)))){ _controller.setSpeedDisp(-1); } else { if (((_hud.isMoveRightBtnPressed()) || (keyInputMan.isKeyDown(KeyControlActions.MOVE_RIGHT)))){ _controller.setSpeedDisp(1); } else { _controller.setSpeedDisp(0); }; }; if (keyInputMan.isKeyDown(KeyControlActions.CANNON_CCW)){ _controller.setCannonAngleDisp(-2); } else { if (keyInputMan.isKeyDown(KeyControlActions.CANNON_CW)){ _controller.setCannonAngleDisp(2); } else { _controller.setCannonAngleDisp(0); }; }; if (keyInputMan.isKeyDown(KeyControlActions.FIRE_POWER_DOWN)){ _controller.setFirePowerDisp(-1); } else { if (keyInputMan.isKeyDown(KeyControlActions.FIRE_POWER_UP)){ _controller.setFirePowerDisp(1); } else { _controller.setFirePowerDisp(0); }; }; } private function onKeyDownHandler(_arg1:KeyInputEvent):void{ if (!_controlsEnabled){ return; }; switch (_arg1.keyAction){ case KeyControlActions.FIRE: _controller.fire(); break; case KeyControlActions.SELECT_PREV_WEAPON: _controller.selectPrevWeapon(); break; case KeyControlActions.SELECT_NEXT_WEAPON: _controller.selectNextWeapon(); break; }; } public function dispose():void{ var _local1:DisplayObject = ApplicationGlobals.application.mainView; _local1.x = 0; _local1.y = 0; _controller = null; keyInputMan.removeEventListener(KeyInputEvent.KEY_DOWN, onKeyDownHandler); keyInputMan.dispose(); keyInputMan = null; removePauseMenu(); removeChild(_hud); _hud.dispose(); _hud = null; } public function addItemSprite(_arg1:Sprite):void{ if ((_arg1 is TankSprite)){ tanksHolder.addChild(_arg1); } else { itemsHolder.addChild(_arg1); }; } public function createWeaponCursor(_arg1:String=null):void{ var _local2:Class; switch (_arg1){ case WeaponType.AIR_STRIKE: _local2 = AirStrikeCursor; break; default: _local2 = SatelliteStrikeCursor; break; }; weaponCursorID = Managers.cursorManager.setCursor(_local2); ApplicationGlobals.application.stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageMouseDownHandler); } public function get hud():HUD{ return (_hud); } } }//package tanks2.core.game
Section 188
//HUDControlType (tanks2.core.game.HUDControlType) package tanks2.core.game { public class HUDControlType { public static const LOCATION_CURSOR:String = "LOCATION_CURSOR"; public static const TELEPORT_CURSOR:String = "TELEPORT_CURSOR"; public static const ALL_ENABLED:String = "ALL_ENABLED"; public static const ALL_DISABLED:String = "ALL_DISABLED"; public static const HUD_DISABLED_CONTROL_ENABLED:String = "HUD_DISABLED_CONTROL_ENABLED"; } }//package tanks2.core.game
Section 189
//KeyControlActions (tanks2.core.game.KeyControlActions) package tanks2.core.game { public class KeyControlActions { public static const FIRE_POWER_DOWN:String = "FIRE_POWER_DOWN"; public static const MOVE_RIGHT:String = "MOVE_RIGHT"; public static const SELECT_NEXT_WEAPON:String = "SELECT_NEXT_WEAPON"; public static const CANNON_CCW:String = "CANNON_CCW"; public static const CANNON_CW:String = "CANNON_CW"; public static const FIRE:String = "FIRE"; public static const MOVE_LEFT:String = "MOVE_LEFT"; public static const SELECT_PREV_WEAPON:String = "SELECT_PREV_WEAPON"; public static const FIRE_POWER_UP:String = "FIRE_POWER_UP"; } }//package tanks2.core.game
Section 190
//PlayerInfo (tanks2.core.game.PlayerInfo) package tanks2.core.game { import tanks2.managers.*; import tanks2.core.game.gameItems.*; public class PlayerInfo { private var upgradesAmount:Object; public var score:int; public var selectedWeapon:String; public var destroyed:Boolean; private var _cpuLevel:int; private var weaponsAmount:Object; public var fuel:int; public var totalDamage:int; public var cannonAngle:int; private var _cpuControlled:Boolean; private var weaponsSelectOrder:Array; public var health:int; public var numRoundWins:int; private var _color:uint; public var shield:int; private var _name:String; public var numKills:int; public var firePower:int; public static const COLORS:Array = [0xFF0000, 0xFF00, 3381759, 0xFFFF00, 0xFF00FF]; public static const AI_LEVELS:Array = ["VERY EASY", "EASY", "NORMAL", "HARD", "VERY HARD"]; public static const MIN_FIRE_POWER_PERCENT:Number = 0.3; public function PlayerInfo(_arg1:String, _arg2:uint, _arg3:Boolean, _arg4:int=0){ upgradesAmount = {}; weaponsAmount = {}; weaponsSelectOrder = ["standard_shell", "armor_piercing", "pop_corn_bomb", "cluster", "incendiary_cluster", "atom_bomb", "tactical_nuke", "mini_roller", "big_roller", "incendiary_roller", "high_explosive_roller", "spider_bomb", "air_strike", "satellite_strike"]; super(); _name = _arg1; _color = _arg2; _cpuControlled = _arg3; _cpuLevel = _arg4; reset(); } public function getWeaponAmount(_arg1:String):int{ return (weaponsAmount[_arg1]); } public function selectNextWeapon():void{ var _local2:String; var _local1:int = weaponsSelectOrder.indexOf(selectedWeapon); while (true) { ++_local1; if (_local1 == weaponsSelectOrder.length){ _local1 = 0; }; _local2 = weaponsSelectOrder[_local1]; if ((((weaponsAmount[_local2] == -1)) || ((weaponsAmount[_local2] > 0)))){ selectedWeapon = _local2; break; }; }; } public function setWeaponAmount(_arg1:String, _arg2:int):void{ weaponsAmount[_arg1] = _arg2; } public function get name():String{ return (_name); } public function get healthPercentage():Number{ return ((health / maxHealth)); } public function set selectedWeaponAmount(_arg1:int):void{ weaponsAmount[selectedWeapon] = _arg1; } public function get maxFuel():int{ var _local1:int = Managers.configManager.getUpgradeValue(UpgradeType.FUEL); var _local2:int = Managers.configManager.getPlayerConfigIntValue("baseFuel"); return ((_local2 + (_local1 * getUpgradeAmount(UpgradeType.FUEL)))); } public function get cpuLevel():int{ return (_cpuLevel); } public function get maxSpeed():int{ return ((1 + getUpgradeAmount(UpgradeType.ENGINE_UPGRADE))); } public function selectPrevWeapon():void{ var _local2:String; var _local1:int = weaponsSelectOrder.indexOf(selectedWeapon); while (true) { --_local1; if (_local1 < 0){ _local1 = (weaponsSelectOrder.length - 1); }; _local2 = weaponsSelectOrder[_local1]; if ((((weaponsAmount[_local2] == -1)) || ((weaponsAmount[_local2] > 0)))){ selectedWeapon = _local2; break; }; }; } public function reset():void{ var _local1:ConfigManager = Managers.configManager; setWeaponAmount(WeaponType.STANDARD_SHELL, _local1.getWeaponInitialAmount(WeaponType.STANDARD_SHELL)); setWeaponAmount(WeaponType.ARMOR_PIERCING, _local1.getWeaponInitialAmount(WeaponType.ARMOR_PIERCING)); setWeaponAmount(WeaponType.POP_CORN_BOMB, _local1.getWeaponInitialAmount(WeaponType.POP_CORN_BOMB)); setWeaponAmount(WeaponType.CLUSTER, _local1.getWeaponInitialAmount(WeaponType.CLUSTER)); setWeaponAmount(WeaponType.INCENDIARY_CLUSTER, _local1.getWeaponInitialAmount(WeaponType.INCENDIARY_CLUSTER)); setWeaponAmount(WeaponType.ATOM_BOMB, _local1.getWeaponInitialAmount(WeaponType.ATOM_BOMB)); setWeaponAmount(WeaponType.TACTICAL_NUKE, _local1.getWeaponInitialAmount(WeaponType.TACTICAL_NUKE)); setWeaponAmount(WeaponType.MINI_ROLLER, _local1.getWeaponInitialAmount(WeaponType.MINI_ROLLER)); setWeaponAmount(WeaponType.BIG_ROLLER, _local1.getWeaponInitialAmount(WeaponType.BIG_ROLLER)); setWeaponAmount(WeaponType.INCENDIARY_ROLLER, _local1.getWeaponInitialAmount(WeaponType.INCENDIARY_ROLLER)); setWeaponAmount(WeaponType.HIGH_EXPLOSIVE_ROLLER, _local1.getWeaponInitialAmount(WeaponType.HIGH_EXPLOSIVE_ROLLER)); setWeaponAmount(WeaponType.SPIDER_BOMB, _local1.getWeaponInitialAmount(WeaponType.SPIDER_BOMB)); setWeaponAmount(WeaponType.AIR_STRIKE, _local1.getWeaponInitialAmount(WeaponType.AIR_STRIKE)); setWeaponAmount(WeaponType.SATELLITE_STRIKE, _local1.getWeaponInitialAmount(WeaponType.SATELLITE_STRIKE)); setUpgradeAmount(UpgradeType.FUEL, 0); setUpgradeAmount(UpgradeType.HEALTH, 0); setUpgradeAmount(UpgradeType.SHIELD_UPGRADE, 0); setUpgradeAmount(UpgradeType.ENGINE_UPGRADE, 0); setUpgradeAmount(UpgradeType.SHIELD, _local1.getPlayerConfigIntValue("numShields")); setUpgradeAmount(UpgradeType.PARACHUTES, _local1.getPlayerConfigIntValue("numParachutes")); setUpgradeAmount(UpgradeType.REPAIR_KIT, _local1.getPlayerConfigIntValue("numRepairs")); setUpgradeAmount(UpgradeType.TELEPORT, _local1.getPlayerConfigIntValue("numTeleports")); numRoundWins = 0; numKills = 0; totalDamage = 0; score = 0; } public function clearAllEquipments():void{ setWeaponAmount(WeaponType.STANDARD_SHELL, 0); setWeaponAmount(WeaponType.ARMOR_PIERCING, 0); setWeaponAmount(WeaponType.POP_CORN_BOMB, 0); setWeaponAmount(WeaponType.CLUSTER, 0); setWeaponAmount(WeaponType.INCENDIARY_CLUSTER, 0); setWeaponAmount(WeaponType.ATOM_BOMB, 0); setWeaponAmount(WeaponType.TACTICAL_NUKE, 0); setWeaponAmount(WeaponType.MINI_ROLLER, 0); setWeaponAmount(WeaponType.BIG_ROLLER, 0); setWeaponAmount(WeaponType.INCENDIARY_ROLLER, 0); setWeaponAmount(WeaponType.HIGH_EXPLOSIVE_ROLLER, 0); setWeaponAmount(WeaponType.SPIDER_BOMB, 0); setWeaponAmount(WeaponType.AIR_STRIKE, 0); setWeaponAmount(WeaponType.SATELLITE_STRIKE, 0); setUpgradeAmount(UpgradeType.FUEL, 0); setUpgradeAmount(UpgradeType.HEALTH, 0); setUpgradeAmount(UpgradeType.SHIELD_UPGRADE, 0); setUpgradeAmount(UpgradeType.ENGINE_UPGRADE, 0); setUpgradeAmount(UpgradeType.SHIELD, 0); setUpgradeAmount(UpgradeType.PARACHUTES, 0); setUpgradeAmount(UpgradeType.REPAIR_KIT, 0); setUpgradeAmount(UpgradeType.TELEPORT, 0); } public function get cpuControlled():Boolean{ return (_cpuControlled); } public function getUpgradeAmount(_arg1:String):int{ return (upgradesAmount[_arg1]); } public function get maxHealth():int{ var _local1:int = Managers.configManager.getUpgradeValue(UpgradeType.HEALTH); var _local2:int = Managers.configManager.getPlayerConfigIntValue("baseHealth"); return ((_local2 + (_local1 * getUpgradeAmount(UpgradeType.HEALTH)))); } public function setUpgradeAmount(_arg1:String, _arg2:int):void{ upgradesAmount[_arg1] = _arg2; } public function get shieldPercentage():Number{ return ((shield / maxShield)); } public function get selectedWeaponAmount():int{ return (weaponsAmount[selectedWeapon]); } public function get maxFirePower():int{ var _local1:int = (100 * (MIN_FIRE_POWER_PERCENT + ((1 - MIN_FIRE_POWER_PERCENT) * healthPercentage))); return (_local1); } public function get maxShield():int{ var _local1:int = Managers.configManager.getUpgradeValue(UpgradeType.SHIELD_UPGRADE); var _local2:int = Managers.configManager.getPlayerConfigIntValue("baseShield"); return ((_local2 + (_local1 * getUpgradeAmount(UpgradeType.SHIELD_UPGRADE)))); } public function get color():uint{ return (_color); } } }//package tanks2.core.game
Section 191
//SMEvent (tanks2.core.game.SMEvent) package tanks2.core.game { public class SMEvent { public static const DO_TURN:String = "DO_TURN"; public static const COMPLETE_TURN:String = "COMPLETE_TURN"; public static const ACTIVATE_TELEPORT:String = "ACTIVATE_TELEPORT"; public static const ACTIVATE_DOUBLE_TURN:String = "ACTIVATE_DOUBLE_TURN"; } }//package tanks2.core.game
Section 192
//SMState (tanks2.core.game.SMState) package tanks2.core.game { public class SMState { public static const INITIAL:String = "INITIAL"; public static const DOING_TURN:String = "DOING_TURN"; public static const ROUND_COMPLETED:String = "ROUND_COMPLETED"; public static const DOUBLE_TURN_ACTIVATED:String = "DOUBLE_TURN_ACTIVATED"; public static const TURN_ACTIVATED:String = "TURN_ACTIVATED"; public static const FINAL:String = "FINAL"; public static const COMPLETE_ROUND_CHOICE:String = "COMPLETE_ROUND_CHOICE"; public static const TELEPORT_ACTIVATED:String = "TELEPORT_ACTIVATED"; } }//package tanks2.core.game
Section 193
//HelpController (tanks2.core.helpScreen.HelpController) package tanks2.core.helpScreen { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class HelpController extends EventDispatcher implements IController { private var _view:HelpView; public function HelpController(){ _view = new HelpView(this); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function get view():DisplayObject{ return (_view); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } public function continueGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.CONTINUE)); } public function dispose():void{ _view.dispose(); _view = null; } } }//package tanks2.core.helpScreen
Section 194
//HelpView (tanks2.core.helpScreen.HelpView) package tanks2.core.helpScreen { import flash.events.*; import com.bigwigmedia.ui.*; import com.bigwigmedia.ui.containers.*; public class HelpView extends LayoutContainer { private var continueBtn:LabelButton; private var _controller:HelpController; public function HelpView(_arg1:HelpController){ _controller = _arg1; this.setSize(640, 480); addChild(new InstructionsBackground()); continueBtn = new LabelButton(); continueBtn.label = "CONTINUE"; addChildToLayout(continueBtn, {horizontalCenter:0, bottom:10}); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case continueBtn: _controller.continueGame(); break; }; } override public function dispose():void{ this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); super.dispose(); } } }//package tanks2.core.helpScreen
Section 195
//InstructionsController (tanks2.core.instructionScreen.InstructionsController) package tanks2.core.instructionScreen { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class InstructionsController extends EventDispatcher implements IController { private var _view:InstructionsView; public function InstructionsController(){ _view = new InstructionsView(this); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function returnToSplashMenu():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.GOTO_SPLASH_SCREEN)); } public function get view():DisplayObject{ return (_view); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } public function dispose():void{ _view.dispose(); _view = null; } } }//package tanks2.core.instructionScreen
Section 196
//InstructionsView (tanks2.core.instructionScreen.InstructionsView) package tanks2.core.instructionScreen { import flash.events.*; import com.bigwigmedia.ui.*; import com.bigwigmedia.ui.containers.*; public class InstructionsView extends LayoutContainer { private var _controller:InstructionsController; private var splashMenuBtn:LabelButton; public function InstructionsView(_arg1:InstructionsController){ _controller = _arg1; this.setSize(640, 480); addChild(new InstructionsBackground()); splashMenuBtn = new LabelButton(); splashMenuBtn.label = "MAIN MENU"; addChildToLayout(splashMenuBtn, {horizontalCenter:0, bottom:10}); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case splashMenuBtn: _controller.returnToSplashMenu(); break; }; } override public function dispose():void{ this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); super.dispose(); } } }//package tanks2.core.instructionScreen
Section 197
//MainController (tanks2.core.main.MainController) package tanks2.core.main { import com.bigwigmedia.statemachine.hsm.*; import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.game.*; import tanks2.managers.*; import tanks2.core.campaignEndMenu.*; import tanks2.core.playerSelectionMenu.*; import tanks2.core.helpScreen.*; import tanks2.core.upgradeScreen.*; import tanks2.core.instructionScreen.*; import tanks2.core.deathmatchCompleted.*; import tanks2.core.splashMenu.*; import tanks2.core.*; import tanks2.effects.*; import com.bigwigmedia.application.*; public class MainController extends EventDispatcher implements IController { private var hsm:IHSM; private var nextHSMState:String; private var _view:Sprite; private var _autoShowHelp:Boolean;// = true private var subController:IController; public function MainController(){ _view = new Sprite(); Managers.initialize(onManagersInitCallback); } private function showDeathmatchGame(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.DEATHMATCH_GAME); } private function showSplashMenu(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.SPLASH_MENU); } private function showCampaignPlayersSelection(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.CAMPAIGN_PLAYERS_SELECTION); } private function showDeathmatchPlayersSelection(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.DEATHMATCH_PLAYERS_SELECTION); } private function startCampaign(_arg1:SignalEvent):void{ GameInfo.startNewGame(false); } private function startDeathmatch(_arg1:SignalEvent):void{ GameInfo.startNewGame(true); } private function beginTransitionEffect(_arg1:String):void{ this.nextHSMState = _arg1; var _local2:PanelsOverlay = new PanelsOverlay(createNextController); ApplicationGlobals.application.createOverlay(_local2); } private function disableAutoHelp(_arg1:SignalEvent):void{ _autoShowHelp = false; } private function createNextController():void{ disposeCurrentController(); switch (nextHSMState){ case MainHSMState.SPLASH_MENU: subController = new SplashMenuController(); break; case MainHSMState.CAMPAIGN_PLAYERS_SELECTION: subController = new CampaignPlayersSelectionController(); break; case MainHSMState.DEATHMATCH_PLAYERS_SELECTION: subController = new DeathmatchPlayerSelectionController(); break; case MainHSMState.DEATHMATCH_GAME: case MainHSMState.CAMPAIGN_GAME: subController = new GameController(); break; case MainHSMState.DEATHMATCH_UPGRADES: case MainHSMState.CAMPAIGN_UPGRADES: subController = new UpgradeScreenController(); break; case MainHSMState.DEATHMATCH_COMPLETED: subController = new DeathmatchCompletedController(); break; case MainHSMState.CAMPAIGN_LOST: subController = new CampaignLostController(); break; case MainHSMState.CAMPAIGN_WON: subController = new CampaignWonController(); break; case MainHSMState.INSTRUCTION_SCREEN: subController = new InstructionsController(); break; case MainHSMState.DEATHMATCH_HELP: subController = new HelpController(); break; }; subController.addEventListener(ControllerEvent.READY, onControllerReadyHandler); subController.addEventListener(ControllerEvent.FINISH, onControllerFinishHandler); } private function showInstructionScreen(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.INSTRUCTION_SCREEN); } private function showHelp(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.DEATHMATCH_HELP); } private function onControllerReadyHandler(_arg1:ControllerEvent):void{ _view.addChild(subController.view); } private function onControllerFinishHandler(_arg1:ControllerEvent):void{ hsm.sendSignal(new SignalEvent(_arg1.command, _arg1.data)); } private function showCampaignUpgrades(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.CAMPAIGN_UPGRADES); } private function showDeathmatchUpgrades(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.DEATHMATCH_UPGRADES); } public function dispose():void{ disposeCurrentController(); } private function showCampaignWon(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.CAMPAIGN_WON); } public function get view():DisplayObject{ return (_view); } private function disposeCurrentController():void{ if (subController){ subController.removeEventListener(ControllerEvent.READY, onControllerReadyHandler); subController.removeEventListener(ControllerEvent.FINISH, onControllerFinishHandler); _view.removeChild(subController.view); subController.dispose(); subController = null; }; } private function isGameCompleted():Boolean{ return (GameInfo.isGameCompleted()); } private function showCampaignLost(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.CAMPAIGN_LOST); } public function isAutoShowHelp():Boolean{ return (_autoShowHelp); } private function replayGame(_arg1:SignalEvent):void{ GameInfo.reinitializeGame(); } private function onManagersInitCallback():void{ hsm = new HSM("main_HSM"); hsm.addState(new InitialState(MainHSMState.INITIAL)); hsm.addState(new SimpleState(MainHSMState.SPLASH_MENU, showSplashMenu)); hsm.addState(new SimpleState(MainHSMState.INSTRUCTION_SCREEN, showInstructionScreen)); hsm.addTransition(MainHSMState.INITIAL, MainHSMState.SPLASH_MENU); hsm.addTransition(MainHSMState.SPLASH_MENU, MainHSMState.INSTRUCTION_SCREEN, MainHSMEvent.SHOW_INSTRUCTIONS); hsm.addTransition(MainHSMState.INSTRUCTION_SCREEN, MainHSMState.SPLASH_MENU, MainHSMEvent.GOTO_SPLASH_SCREEN); var _local1:CompositeState = (hsm.addState(new CompositeState(MainHSMState.DEATHMATCH_COMPOSITE)) as CompositeState); _local1.addSubstate(new InitialState(MainHSMState.DEATHMATCH_INITIAL, startDeathmatch)); _local1.addSubstate(new SimpleState(MainHSMState.DEATHMATCH_PLAYERS_SELECTION, showDeathmatchPlayersSelection)); _local1.addSubstate(new ChoicePointState(MainHSMState.DEATHMATCH_HELP_CHOICE)); _local1.addSubstate(new SimpleState(MainHSMState.DEATHMATCH_HELP, showHelp)); _local1.addSubstate(new SimpleState(MainHSMState.DEATHMATCH_GAME, showDeathmatchGame)); _local1.addSubstate(new ChoicePointState(MainHSMState.DEATHMATCH_ROUND_COMPLETED)); _local1.addSubstate(new SimpleState(MainHSMState.DEATHMATCH_COMPLETED, showDeathmatchCompleted)); _local1.addSubstate(new SimpleState(MainHSMState.DEATHMATCH_UPGRADES, showDeathmatchUpgrades)); hsm.addTransition(MainHSMState.SPLASH_MENU, MainHSMState.DEATHMATCH_COMPOSITE, MainHSMEvent.START_DEATHMATCH); hsm.addTransition(MainHSMState.DEATHMATCH_COMPOSITE, MainHSMState.SPLASH_MENU, MainHSMEvent.END_GAME); hsm.addTransition(MainHSMState.DEATHMATCH_INITIAL, MainHSMState.DEATHMATCH_PLAYERS_SELECTION); hsm.addTransition(MainHSMState.DEATHMATCH_PLAYERS_SELECTION, MainHSMState.DEATHMATCH_HELP_CHOICE, MainHSMEvent.START); hsm.addTransition(MainHSMState.DEATHMATCH_HELP_CHOICE, MainHSMState.DEATHMATCH_HELP, null, disableAutoHelp, isAutoShowHelp); hsm.addTransition(MainHSMState.DEATHMATCH_HELP_CHOICE, MainHSMState.DEATHMATCH_GAME, null); hsm.addTransition(MainHSMState.DEATHMATCH_HELP, MainHSMState.DEATHMATCH_GAME, MainHSMEvent.CONTINUE); hsm.addTransition(MainHSMState.DEATHMATCH_GAME, MainHSMState.DEATHMATCH_ROUND_COMPLETED, MainHSMEvent.COMPLETE_ROUND); hsm.addTransition(MainHSMState.DEATHMATCH_ROUND_COMPLETED, MainHSMState.DEATHMATCH_COMPLETED, null, null, isGameCompleted); hsm.addTransition(MainHSMState.DEATHMATCH_ROUND_COMPLETED, MainHSMState.DEATHMATCH_UPGRADES, null); hsm.addTransition(MainHSMState.DEATHMATCH_UPGRADES, MainHSMState.DEATHMATCH_GAME, MainHSMEvent.START); hsm.addTransition(MainHSMState.DEATHMATCH_COMPLETED, MainHSMState.DEATHMATCH_GAME, MainHSMEvent.REPLAY, replayGame); var _local2:CompositeState = (hsm.addState(new CompositeState(MainHSMState.CAMPAIGN_COMPOSITE)) as CompositeState); _local2.addSubstate(new InitialState(MainHSMState.CAMPAIGN_INITIAL, startCampaign)); _local2.addSubstate(new SimpleState(MainHSMState.CAMPAIGN_PLAYERS_SELECTION, showCampaignPlayersSelection)); _local2.addSubstate(new ChoicePointState(MainHSMState.CAMPAIGN_HELP_CHOICE)); _local2.addSubstate(new SimpleState(MainHSMState.CAMPAIGN_HELP, showHelp)); _local2.addSubstate(new SimpleState(MainHSMState.CAMPAIGN_GAME, showCampaignGame)); _local2.addSubstate(new ChoicePointState(MainHSMState.CAMPAIGN_ROUND_COMPLETED)); _local2.addSubstate(new SimpleState(MainHSMState.CAMPAIGN_WON, showCampaignWon)); _local2.addSubstate(new SimpleState(MainHSMState.CAMPAIGN_UPGRADES, showCampaignUpgrades)); _local2.addSubstate(new SimpleState(MainHSMState.CAMPAIGN_LOST, showCampaignLost)); hsm.addTransition(MainHSMState.SPLASH_MENU, MainHSMState.CAMPAIGN_COMPOSITE, MainHSMEvent.START_CAMPAIGN); hsm.addTransition(MainHSMState.CAMPAIGN_COMPOSITE, MainHSMState.SPLASH_MENU, MainHSMEvent.END_GAME); hsm.addTransition(MainHSMState.CAMPAIGN_INITIAL, MainHSMState.CAMPAIGN_PLAYERS_SELECTION); hsm.addTransition(MainHSMState.CAMPAIGN_PLAYERS_SELECTION, MainHSMState.CAMPAIGN_HELP_CHOICE, MainHSMEvent.START); hsm.addTransition(MainHSMState.CAMPAIGN_HELP_CHOICE, MainHSMState.CAMPAIGN_HELP, null, disableAutoHelp, isAutoShowHelp); hsm.addTransition(MainHSMState.CAMPAIGN_HELP_CHOICE, MainHSMState.CAMPAIGN_GAME, null); hsm.addTransition(MainHSMState.CAMPAIGN_HELP, MainHSMState.CAMPAIGN_GAME, MainHSMEvent.CONTINUE); hsm.addTransition(MainHSMState.CAMPAIGN_GAME, MainHSMState.CAMPAIGN_ROUND_COMPLETED, MainHSMEvent.COMPLETE_ROUND); hsm.addTransition(MainHSMState.CAMPAIGN_GAME, MainHSMState.CAMPAIGN_LOST, MainHSMEvent.GAME_OVER); hsm.addTransition(MainHSMState.CAMPAIGN_ROUND_COMPLETED, MainHSMState.CAMPAIGN_WON, null, null, isGameCompleted); hsm.addTransition(MainHSMState.CAMPAIGN_ROUND_COMPLETED, MainHSMState.CAMPAIGN_UPGRADES, null); hsm.addTransition(MainHSMState.CAMPAIGN_UPGRADES, MainHSMState.CAMPAIGN_GAME, MainHSMEvent.START); hsm.addTransition(MainHSMState.CAMPAIGN_LOST, MainHSMState.CAMPAIGN_GAME, MainHSMEvent.REPLAY, replayGame); hsm.start(); } private function showDeathmatchCompleted(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.DEATHMATCH_COMPLETED); } private function showCampaignGame(_arg1:SignalEvent):void{ beginTransitionEffect(MainHSMState.CAMPAIGN_GAME); } } }//package tanks2.core.main
Section 198
//MainHSMEvent (tanks2.core.main.MainHSMEvent) package tanks2.core.main { public class MainHSMEvent { public static const GAME_OVER:String = "GAME_OVER"; public static const SHOW_INSTRUCTIONS:String = "SHOW_INSTRUCTIONS"; public static const GOTO_SPLASH_SCREEN:String = "GOTO_SPLASH_SCREEN"; public static const START:String = "START"; public static const START_CAMPAIGN:String = "START_CAMPAIGN"; public static const START_DEATHMATCH:String = "START_DEATHMATCH"; public static const COMPLETE_ROUND:String = "COMPLETE_ROUND"; public static const REPLAY:String = "REPLAY"; public static const END_GAME:String = "END_GAME"; public static const CONTINUE:String = "CONTINUE"; } }//package tanks2.core.main
Section 199
//MainHSMState (tanks2.core.main.MainHSMState) package tanks2.core.main { public class MainHSMState { public static const DEATHMATCH_UPGRADES:String = "DEATHMATCH_UPGRADES"; public static const CAMPAIGN_WON:String = "CAMPAIGN_WON"; public static const CAMPAIGN_LOST:String = "CAMPAIGN_LOST"; public static const CAMPAIGN_PLAYERS_SELECTION:String = "CAMPAIGN_PLAYERS_SELECTION"; public static const DEATHMATCH_PLAYERS_SELECTION:String = "DEATHMATCH_PLAYERS_SELECTION"; public static const CAMPAIGN_HELP_CHOICE:String = "CAMPAIGN_HELP_CHOICE"; public static const CAMPAIGN_HELP:String = "CAMPAIGN_HELP"; public static const CAMPAIGN_GAME:String = "CAMPAIGN_GAME"; public static const INSTRUCTION_SCREEN:String = "INSTRUCTION_SCREEN"; public static const DEATHMATCH_GAME:String = "DEATHMATCH_GAME"; public static const INITIAL:String = "INITIAL"; public static const CAMPAIGN_UPGRADES:String = "CAMPAIGN_UPGRADES"; public static const CAMPAIGN_ROUND_COMPLETED:String = "CAMPAIGN_ROUND_COMPLETED"; public static const DEATHMATCH_HELP:String = "DEATHMATCH_HELP"; public static const DEATHMATCH_ROUND_COMPLETED:String = "DEATHMATCH_ROUND_COMPLETED"; public static const CAMPAIGN_INITIAL:String = "CAMPAIGN_INITIAL"; public static const DEATHMATCH_INITIAL:String = "DEATHMATCH_INITIAL"; public static const SPLASH_MENU:String = "SPLASH_MENU"; public static const DEATHMATCH_HELP_CHOICE:String = "DEATHMATCH_HELP_CHOICE"; public static const DEATHMATCH_COMPOSITE:String = "DEATHMATCH_COMPOSITE"; public static const DEATHMATCH_COMPLETED:String = "DEATHMATCH_COMPLETED"; public static const CAMPAIGN_COMPOSITE:String = "CAMPAIGN_COMPOSITE"; } }//package tanks2.core.main
Section 200
//CampaignPlayerSelectionView (tanks2.core.playerSelectionMenu.CampaignPlayerSelectionView) package tanks2.core.playerSelectionMenu { import flash.events.*; import tanks2.core.game.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import com.bigwigmedia.events.*; import flash.text.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.ui.containers.*; import tanks2.core.game.terrain.*; import com.bigwigmedia.ui.styles.*; import tanks2.ui.*; public class CampaignPlayerSelectionView extends LayoutContainer { private var colorRadioBtnGroup:RadioButtonGroup; private var startGameBtn:LabelButton; private var tankSprite:TankSprite; private var controlsBox:VBox; private var _controller:CampaignPlayersSelectionController; private var resetDefaultName:Boolean;// = true private var nameInput:TextInput; public function CampaignPlayerSelectionView(_arg1:CampaignPlayersSelectionController){ var _local7:ColoredRadioButton; super(); _controller = _arg1; addChild(new CampaignPlayerSelectionViewBackground()); this.setSize(640, 480); controlsBox = new VBox(); controlsBox.gap = 8; var _local2:Label = new Label(); _local2.text = "ENTER YOUR NAME:"; controlsBox.addChildToLayout(_local2, {horizontalCenter:0}); nameInput = new TextInput(); nameInput.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 26, 0)); nameInput.setSize(180, 36); nameInput.maxChars = 10; nameInput.text = "Player"; controlsBox.addChildToLayout(nameInput, {horizontalCenter:0}); var _local3:Label = new Label(); _local3.text = "CHOOSE YOUR COLOR:"; controlsBox.addChildToLayout(_local3, {horizontalCenter:0}); var _local4:HBox = new HBox(); _local4.gap = 8; var _local5:Array = PlayerInfo.COLORS; var _local6:int; while (_local6 < _local5.length) { _local7 = new ColoredRadioButton(); _local7.value = _local5[_local6]; _local7.selected = (_local6 == 0); _local7.groupName = "tank_color"; if (!colorRadioBtnGroup){ colorRadioBtnGroup = _local7.group; }; _local4.addChildToLayout(_local7); _local6++; }; controlsBox.addChildToLayout(_local4, {horizontalCenter:0}); startGameBtn = new LabelButton(); startGameBtn.label = "START CAMPAIGN"; addChildToLayout(startGameBtn, {horizontalCenter:0, bottom:20}); addChildToLayout(controlsBox, {horizontalCenter:0, verticalCenter:-20}); showTankSprite((colorRadioBtnGroup.selection.value as uint)); colorRadioBtnGroup.addEventListener(ComponentEvent.CHANGE, onColorChangeHandler); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); this.addEventListener(FocusEvent.FOCUS_IN, onFocusInHandler); } private function showTankSprite(_arg1:uint):void{ if (tankSprite){ this.removeChild(tankSprite); tankSprite = null; }; tankSprite = new TankSprite(_arg1); tankSprite.x = 320; tankSprite.y = 330; this.addChild(tankSprite); } override public function dispose():void{ colorRadioBtnGroup.removeEventListener(ComponentEvent.CHANGE, onColorChangeHandler); this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); this.removeEventListener(FocusEvent.FOCUS_IN, onFocusInHandler); super.dispose(); } private function onFocusInHandler(_arg1:FocusEvent):void{ if ((((_arg1.target.parent == nameInput)) && (resetDefaultName))){ nameInput.text = ""; resetDefaultName = false; }; } private function onColorChangeHandler(_arg1:ComponentEvent):void{ showTankSprite((colorRadioBtnGroup.selection.value as uint)); } private function onMouseClickHandler(_arg1:MouseEvent):void{ var _local2:String; var _local3:uint; switch (_arg1.target){ case startGameBtn: _local2 = ((nameInput.text)!="") ? nameInput.text : "Player"; _local3 = (colorRadioBtnGroup.selection.value as uint); GameInfo.addPlayer(new PlayerInfo(_local2, _local3, false)); GameInfo.terrainType = TerrainType.RANDOM; _controller.startGame(); break; }; } } }//package tanks2.core.playerSelectionMenu
Section 201
//CampaignPlayersSelectionController (tanks2.core.playerSelectionMenu.CampaignPlayersSelectionController) package tanks2.core.playerSelectionMenu { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class CampaignPlayersSelectionController extends EventDispatcher implements IController { private var _view:CampaignPlayerSelectionView; public function CampaignPlayersSelectionController(){ _view = new CampaignPlayerSelectionView(this); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function get view():DisplayObject{ return (_view); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } public function startGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.START)); } public function dispose():void{ _view.dispose(); _view = null; } } }//package tanks2.core.playerSelectionMenu
Section 202
//DeathmatchPlayerSelectionController (tanks2.core.playerSelectionMenu.DeathmatchPlayerSelectionController) package tanks2.core.playerSelectionMenu { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.game.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class DeathmatchPlayerSelectionController extends EventDispatcher implements IController { private var subController:IController; private var _view:DeathmatchPlayerSelectionView; public function DeathmatchPlayerSelectionController(){ NewPlayerPopupController.previousAILevel = 2; NewPlayerPopupController.previousCPUControl = false; _view = new DeathmatchPlayerSelectionView(this); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } private function onControllerReadyHandler(_arg1:ControllerEvent):void{ _view.lockVisible = true; _view.addChild(subController.view); } public function get view():DisplayObject{ return (_view); } public function addPlayer():void{ var _local3:uint; var _local6:uint; var _local7:Boolean; var _local8:PlayerInfo; var _local1:Array = PlayerInfo.COLORS; var _local2:Array = GameInfo.playersList; var _local4:int; while (_local4 < _local1.length) { _local6 = _local1[_local4]; _local7 = true; for each (_local8 in _local2) { if (_local8.color == _local6){ _local7 = false; break; }; }; if (_local7){ _local3 = _local6; break; }; _local4++; }; var _local5 = !((GameInfo.numPlayers == 0)); subController = new NewPlayerPopupController(_local5, _local3); subController.addEventListener(ControllerEvent.READY, onControllerReadyHandler); subController.addEventListener(ControllerEvent.FINISH, onControllerFinishHandler); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } public function gotoSplashMenu():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.END_GAME)); } public function startGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.START)); } private function onControllerFinishHandler(_arg1:ControllerEvent):void{ _view.addPlayerInfoPanel(_arg1.data); if (GameInfo.numPlayers == 2){ _view.enableStartButton(); }; subController.removeEventListener(ControllerEvent.READY, onControllerReadyHandler); subController.removeEventListener(ControllerEvent.FINISH, onControllerFinishHandler); _view.removeChild(subController.view); _view.lockVisible = false; subController.dispose(); subController = null; } public function dispose():void{ _view.dispose(); _view = null; } } }//package tanks2.core.playerSelectionMenu
Section 203
//DeathmatchPlayerSelectionView (tanks2.core.playerSelectionMenu.DeathmatchPlayerSelectionView) package tanks2.core.playerSelectionMenu { import flash.display.*; import flash.events.*; import tanks2.core.game.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import flash.text.*; import com.bigwigmedia.display.*; import com.bigwigmedia.ui.containers.*; import tanks2.core.game.terrain.*; import com.bigwigmedia.ui.styles.*; public class DeathmatchPlayerSelectionView extends LayoutContainer { private var terrainView:MovieClip; private var decreaseRoundsToWinBtn:IconicButton; private var terrainRadioButtonGroup:RadioButtonGroup; private var startGameBtn:LabelButton; private var infoPanelsBox:HBox; private var splashMenuBtn:LabelButton; private var lockSprite:Sprite; private var addPlayerBtn:LabelButton; private var numRoundsToWin:int;// = 2 private var increaseRoundsToWinBtn:IconicButton; private var _controller:DeathmatchPlayerSelectionController; private var numRoundsToWinLabel:Label; public function DeathmatchPlayerSelectionView(_arg1:DeathmatchPlayerSelectionController){ _controller = _arg1; addChild(new DeathmatchPlayerSelectionViewBackground()); this.setSize(640, 480); var _local2:Label = new Label(); _local2.text = "TERRAIN TYPE"; addChildToLayout(_local2, {left:50, top:20}); var _local3:TextFormat = new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 20); var _local4:RadioButton = new RadioButton(); _local4.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local3); _local4.label = TerrainType.DESERT; _local4.value = Object(TerrainType.DESERT); addChildToLayout(_local4, {left:50, top:70}); var _local5:RadioButton = new RadioButton(); _local5.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local3); _local5.label = TerrainType.ALPINE; _local5.value = Object(TerrainType.ALPINE); addChildToLayout(_local5, {left:50, top:100}); var _local6:RadioButton = new RadioButton(); _local6.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local3); _local6.label = TerrainType.ROCKY; _local6.value = Object(TerrainType.ROCKY); addChildToLayout(_local6, {left:50, top:130}); var _local7:RadioButton = new RadioButton(); _local7.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local3); _local7.label = TerrainType.FOREST; _local7.value = Object(TerrainType.FOREST); addChildToLayout(_local7, {left:50, top:160}); var _local8:RadioButton = new RadioButton(); _local8.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local3); _local8.label = TerrainType.URBAN; _local8.value = Object(TerrainType.URBAN); addChildToLayout(_local8, {left:50, top:190}); var _local9:RadioButton = new RadioButton(); _local9.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local3); _local9.label = TerrainType.RANDOM; _local9.value = Object(TerrainType.RANDOM); addChildToLayout(_local9, {left:50, top:220}); _local4.groupName = (_local5.groupName = (_local6.groupName = (_local7.groupName = (_local8.groupName = (_local9.groupName = "terrain_type_group"))))); terrainRadioButtonGroup = _local9.group; _local9.selected = true; terrainView = new TerrainView(); terrainView.gotoAndStop(selectedTerrainType); addChildToLayout(terrainView, {left:180, top:75}); var _local10:Label = new Label(); _local10.text = "ROUNDS TO WIN"; addChildToLayout(_local10, {right:50, top:20}); increaseRoundsToWinBtn = new IconicButton(); increaseRoundsToWinBtn.upIcon = PlusButtonUpIcon; increaseRoundsToWinBtn.overIcon = PlusButtonOverIcon; increaseRoundsToWinBtn.move(570, 140); addChild(increaseRoundsToWinBtn); decreaseRoundsToWinBtn = new IconicButton(); decreaseRoundsToWinBtn.upIcon = MinusButtonUpIcon; decreaseRoundsToWinBtn.overIcon = MinusButtonOverIcon; decreaseRoundsToWinBtn.move(410, 140); addChild(decreaseRoundsToWinBtn); numRoundsToWinLabel = new Label(); numRoundsToWinLabel.text = String(numRoundsToWin); numRoundsToWinLabel.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 40, 0xFFFFFF)); addChildToLayout(numRoundsToWinLabel, {horizontalCenter:190, verticalCenter:-80}); startGameBtn = new LabelButton(); startGameBtn.label = "START"; startGameBtn.setStyle(AbstractComponentStyle.DISABLED_DECORATION, new AlphaDecoration(0.3)); startGameBtn.enabled = false; addChildToLayout(startGameBtn, {right:30, bottom:20}); addPlayerBtn = new LabelButton(); addPlayerBtn.label = "ADD PLAYER"; addPlayerBtn.setStyle(AbstractComponentStyle.DISABLED_DECORATION, new AlphaDecoration(0.3)); addChildToLayout(addPlayerBtn, {left:30, bottom:20}); splashMenuBtn = new LabelButton(); splashMenuBtn.label = "MAIN MENU"; addChildToLayout(splashMenuBtn, {horizontalCenter:0, bottom:20}); infoPanelsBox = new HBox(); infoPanelsBox.gap = 6; addChildToLayout(infoPanelsBox, {horizontalCenter:0, bottom:100}); lockSprite = new Sprite(); lockSprite.visible = false; lockSprite.graphics.lineStyle(0); lockSprite.graphics.beginFill(0, 0.5); lockSprite.graphics.drawRect(0, 0, 640, 480); lockSprite.graphics.endFill(); addChild(lockSprite); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); } public function addPlayerInfoPanel(_arg1:PlayerInfo):void{ var _local2:PlayerInfoPanel = new PlayerInfoPanel(_arg1); infoPanelsBox.addChildToLayout(_local2); } private function onMouseClickHandler(_arg1:MouseEvent):void{ if ((_arg1.target is RadioButton)){ terrainView.gotoAndStop(selectedTerrainType); return; }; switch (_arg1.target){ case startGameBtn: GameInfo.terrainType = selectedTerrainType; GameInfo.setNumRoundsToWinDeathmatch(numRoundsToWin); _controller.startGame(); break; case addPlayerBtn: _controller.addPlayer(); if (GameInfo.numPlayers == (GameInfo.maxPlayers - 1)){ addPlayerBtn.enabled = false; }; break; case splashMenuBtn: _controller.gotoSplashMenu(); break; case increaseRoundsToWinBtn: if (numRoundsToWin < 33){ numRoundsToWin++; numRoundsToWinLabel.text = String(numRoundsToWin); }; break; case decreaseRoundsToWinBtn: if (numRoundsToWin > 1){ numRoundsToWin--; numRoundsToWinLabel.text = String(numRoundsToWin); }; break; }; } override public function dispose():void{ terrainRadioButtonGroup = null; this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); super.dispose(); } private function get selectedTerrainType():String{ var _local1:String = String(terrainRadioButtonGroup.selection.value); return (_local1); } public function set lockVisible(_arg1:Boolean):void{ lockSprite.visible = _arg1; } public function enableStartButton():void{ startGameBtn.enabled = true; } } }//package tanks2.core.playerSelectionMenu
Section 204
//NewPlayerPopup (tanks2.core.playerSelectionMenu.NewPlayerPopup) package tanks2.core.playerSelectionMenu { import flash.events.*; import tanks2.core.game.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import com.bigwigmedia.events.*; import flash.text.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.ui.styles.*; import tanks2.ui.*; public class NewPlayerPopup extends LayoutContainer { private var doneBtn:LabelButton; private var aiLevelRadioBtnGroup:RadioButtonGroup; private var _controller:NewPlayerPopupController; private var tankSprite:TankSprite; private var resetDefaultName:Boolean;// = true private var inputsBox:VBox; private var aiLevelBox:VBox; private var colorRadioBtnGroup:RadioButtonGroup; private var cpuControlBox:CheckBox; private var nameInput:TextInput; public function NewPlayerPopup(_arg1:NewPlayerPopupController, _arg2:Boolean, _arg3:uint){ var _local4:Label; var _local13:ColoredRadioButton; var _local14:RadioButton; super(); _controller = _arg1; setSize(640, 480); inputsBox = new VBox(); inputsBox.setSize(280, 260); inputsBox.gap = 7; inputsBox.autoSize = false; inputsBox.addChild(new NewPlayerPopupBackground()); _local4 = new Label(); _local4.text = "NAME:"; inputsBox.addChildToLayout(_local4, {horizontalCenter:0}); nameInput = new TextInput(); nameInput.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 26, 0)); nameInput.setSize(180, 36); nameInput.maxChars = 10; nameInput.text = ("Player " + String((GameInfo.numPlayers + 1))); inputsBox.addChildToLayout(nameInput, {horizontalCenter:0}); var _local5:Label = new Label(); _local5.text = "COLOR:"; inputsBox.addChildToLayout(_local5, {horizontalCenter:0}); var _local6:HBox = new HBox(); _local6.gap = 7; var _local7:Array = PlayerInfo.COLORS; var _local8:int; while (_local8 < _local7.length) { _local13 = new ColoredRadioButton(); _local13.value = _local7[_local8]; if (_local13.value == _arg3){ _local13.selected = true; }; _local13.groupName = "tank_color"; if (!colorRadioBtnGroup){ colorRadioBtnGroup = _local13.group; }; _local6.addChildToLayout(_local13); _local8++; }; inputsBox.addChildToLayout(_local6, {horizontalCenter:0}); cpuControlBox = new CheckBox(); cpuControlBox.visible = _arg2; cpuControlBox.label = "CPU CONTROL"; inputsBox.addChildToLayout(cpuControlBox, {horizontalCenter:0}); var _local9:LayoutContainer = new LayoutContainer(); _local9.setSize(100, 16); inputsBox.addChildToLayout(_local9, {horizontalCenter:0}); doneBtn = new LabelButton(); doneBtn.label = "DONE"; inputsBox.addChildToLayout(doneBtn, {horizontalCenter:0}); inputsBox.move(180, 0); addChildToLayout(inputsBox, {verticalCenter:0}); aiLevelBox = new VBox(); var _local10:Label = new Label(); _local10.text = "AI LEVEL"; aiLevelBox.addChildToLayout(_local10); var _local11:Array = PlayerInfo.AI_LEVELS; var _local12:int; while (_local12 < _local11.length) { _local14 = new RadioButton(); _local14.value = _local12; _local14.selected = (_local12 == NewPlayerPopupController.previousAILevel); _local14.label = _local11[_local12]; _local14.groupName = "ai_level"; if (!aiLevelRadioBtnGroup){ aiLevelRadioBtnGroup = _local14.group; }; aiLevelBox.addChildToLayout(_local14); _local12++; }; aiLevelBox.visible = false; aiLevelBox.move(390, 0); addChildToLayout(aiLevelBox, {verticalCenter:0}); cpuControlBox.selected = (cpuControlBoxVisibility = NewPlayerPopupController.previousCPUControl); showTankSprite((colorRadioBtnGroup.selection.value as uint)); colorRadioBtnGroup.addEventListener(ComponentEvent.CHANGE, onColorChangeHandler); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); this.addEventListener(FocusEvent.FOCUS_IN, onFocusInHandler); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case doneBtn: createPlayer(); break; case cpuControlBox: cpuControlBoxVisibility = cpuControlBox.selected; break; }; } private function createPlayer():void{ var _local1:String = ((nameInput.text)!="") ? nameInput.text : ("Player " + String((GameInfo.numPlayers + 1))); var _local2:uint = (colorRadioBtnGroup.selection.value as uint); var _local3:Boolean = cpuControlBox.selected; var _local4:int = (aiLevelRadioBtnGroup.selection.value as int); var _local5:PlayerInfo = new PlayerInfo(_local1, _local2, _local3, _local4); GameInfo.addPlayer(_local5); _controller.createPlayer(_local5); } private function onFocusInHandler(_arg1:FocusEvent):void{ if ((((_arg1.target.parent == nameInput)) && (resetDefaultName))){ nameInput.text = ""; resetDefaultName = false; }; } private function set cpuControlBoxVisibility(_arg1:Boolean):void{ if (_arg1){ aiLevelBox.visible = true; inputsBox.move(100, 0); } else { aiLevelBox.visible = false; inputsBox.move(180, 0); }; } private function hideCPUControlBox():void{ aiLevelBox.visible = false; inputsBox.move(180, 0); } private function onColorChangeHandler(_arg1:ComponentEvent):void{ showTankSprite((colorRadioBtnGroup.selection.value as uint)); } override public function dispose():void{ colorRadioBtnGroup.removeEventListener(ComponentEvent.CHANGE, onColorChangeHandler); this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); this.removeEventListener(FocusEvent.FOCUS_IN, onFocusInHandler); super.dispose(); } private function showTankSprite(_arg1:uint):void{ if (tankSprite){ inputsBox.removeChild(tankSprite); tankSprite = null; }; tankSprite = new TankSprite(_arg1); tankSprite.x = 140; tankSprite.y = 215; inputsBox.addChild(tankSprite); } } }//package tanks2.core.playerSelectionMenu
Section 205
//NewPlayerPopupController (tanks2.core.playerSelectionMenu.NewPlayerPopupController) package tanks2.core.playerSelectionMenu { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.game.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class NewPlayerPopupController extends EventDispatcher implements IController { private var _view:NewPlayerPopup; public static var previousCPUControl:Boolean; public static var previousAILevel:int; public function NewPlayerPopupController(_arg1:Boolean, _arg2:uint){ _view = new NewPlayerPopup(this, _arg1, _arg2); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function get view():DisplayObject{ return (_view); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } public function createPlayer(_arg1:PlayerInfo):void{ if (_arg1.cpuControlled){ NewPlayerPopupController.previousAILevel = _arg1.cpuLevel; }; NewPlayerPopupController.previousCPUControl = _arg1.cpuControlled; dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, null, _arg1)); } public function dispose():void{ _view.dispose(); _view = null; } } }//package tanks2.core.playerSelectionMenu
Section 206
//PlayerInfoPanel (tanks2.core.playerSelectionMenu.PlayerInfoPanel) package tanks2.core.playerSelectionMenu { import tanks2.core.game.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import flash.text.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.ui.styles.*; public class PlayerInfoPanel extends LayoutContainer { public function PlayerInfoPanel(_arg1:PlayerInfo){ this.mouseChildren = false; this.mouseEnabled = false; setSize(120, 90); addChild(new PlayerInfoPanelBackground()); var _local2:Label = new Label(); _local2.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 20, 0xFFFFFF)); _local2.text = _arg1.name; addChildToLayout(_local2, {horizontalCenter:0, top:5}); var _local3:Label = new Label(); _local3.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 12, 0xFFFFFF)); if (_arg1.cpuControlled){ _local3.text = (("(CPU " + PlayerInfo.AI_LEVELS[_arg1.cpuLevel]) + ")"); } else { _local3.text = "(HUMAN)"; }; addChildToLayout(_local3, {horizontalCenter:0, top:30}); var _local4:TankSprite = new TankSprite(_arg1.color); addChildToLayout(_local4, {horizontalCenter:5, top:60}); } } }//package tanks2.core.playerSelectionMenu
Section 207
//SplashMenuController (tanks2.core.splashMenu.SplashMenuController) package tanks2.core.splashMenu { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class SplashMenuController extends EventDispatcher implements IController { private var _view:SplashMenuView; public function SplashMenuController(){ _view = new SplashMenuView(this); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function startCampaign():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.START_CAMPAIGN)); } public function startDeathmatch():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.START_DEATHMATCH)); } public function get view():DisplayObject{ return (_view); } public function dispose():void{ _view.dispose(); _view = null; } public function showInstructions():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.SHOW_INSTRUCTIONS)); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } } }//package tanks2.core.splashMenu
Section 208
//SplashMenuView (tanks2.core.splashMenu.SplashMenuView) package tanks2.core.splashMenu { import flash.events.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import flash.text.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.ui.styles.*; public class SplashMenuView extends LayoutContainer { private var bigBattleBtn:LabelButton; private var startDeathmatchBtn:LabelButton; private var startCampaignBtn:LabelButton; private var hintLabel:Label; private var twoDPlayBtn:DecoratedIconicButton; private var instructionsBtn:LabelButton; private var _controller:SplashMenuController; public function SplashMenuView(_arg1:SplashMenuController){ _controller = _arg1; setSize(640, 480); addChild(new SplashMenuViewBackground()); var _local2:Label = new Label(); _local2.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 16, 0xFFFFFF)); _local2.text = "©2DPlay.com"; addChildToLayout(_local2, {right:5, bottom:5}); startCampaignBtn = new LabelButton(); startCampaignBtn.label = "PLAY CAMPAIGN"; addChildToLayout(startCampaignBtn, {horizontalCenter:0, verticalCenter:30}); startDeathmatchBtn = new LabelButton(); startDeathmatchBtn.label = "PLAY DEATHMATCH"; addChildToLayout(startDeathmatchBtn, {horizontalCenter:0, verticalCenter:60}); instructionsBtn = new LabelButton(); instructionsBtn.label = "INSTRUCTIONS"; addChildToLayout(instructionsBtn, {horizontalCenter:0, verticalCenter:90}); bigBattleBtn = new LabelButton(); bigBattleBtn.label = "Big-Battle.com"; addChildToLayout(bigBattleBtn, {horizontalCenter:0, verticalCenter:120}); twoDPlayBtn = new DecoratedIconicButton(); twoDPlayBtn.upIcon = TwoDPlayButtonIcon; addChildToLayout(twoDPlayBtn, {left:5, bottom:5}); hintLabel = new Label(); hintLabel.setStyle(AbstractComponentStyle.TEXT_FORMAT, new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 20, 0xFFFFFF)); hintLabel.text = ""; addChildToLayout(hintLabel, {horizontalCenter:0, verticalCenter:160}); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler); } override public function dispose():void{ this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); super.dispose(); } private function onMouseClickHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case twoDPlayBtn: Managers.urlCaller.mainLink(); break; case startDeathmatchBtn: _controller.startDeathmatch(); break; case startCampaignBtn: _controller.startCampaign(); break; case instructionsBtn: _controller.showInstructions(); break; case bigBattleBtn: Managers.urlCaller.getURL("http://www.big-battle.com/index.html?ref=tanksgame"); break; }; } private function onMouseOverHandler(_arg1:MouseEvent):void{ switch (_arg1.target){ case startDeathmatchBtn: hintLabel.text = "Multiplayer. Free-for-all for up to five human / CPU players."; break; case startCampaignBtn: hintLabel.text = "Single player. Go solo and survive increasing numbers of enemy tanks."; break; case instructionsBtn: hintLabel.text = ""; break; }; } } }//package tanks2.core.splashMenu
Section 209
//UpgradeScreenController (tanks2.core.upgradeScreen.UpgradeScreenController) package tanks2.core.upgradeScreen { import tanks2.core.events.*; import flash.display.*; import flash.events.*; import tanks2.core.game.*; import tanks2.managers.*; import tanks2.core.main.*; import tanks2.core.*; import com.bigwigmedia.application.*; public class UpgradeScreenController extends EventDispatcher implements IController { private var _view:UpgradeScreenView; private var selectedPlayerInfo:PlayerInfo; private var playersList:Array; public function UpgradeScreenController(){ _view = new UpgradeScreenView(this); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrame); } public function buyWeapon(_arg1:String):void{ var _local2:ConfigManager = Managers.configManager; selectedPlayerInfo.score = (selectedPlayerInfo.score - _local2.getUpgradePrice(_arg1)); var _local3:int = _local2.getUpgradeMaxAmount(_arg1); var _local4:int = (selectedPlayerInfo.getWeaponAmount(_arg1) + _local2.getUpgradeBatchAmount(_arg1)); if (_local4 > _local3){ _local4 = _local3; }; selectedPlayerInfo.setWeaponAmount(_arg1, _local4); _view.showUpgrades(selectedPlayerInfo); } public function get view():DisplayObject{ return (_view); } public function gotoSplashMenu():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.END_GAME)); } private function doNextFrame(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrame); playersList = GameInfo.humanPlayersList; selectNextPlayer(); dispatchEvent(new ControllerEvent(ControllerEvent.READY)); } public function selectNextPlayer():void{ selectedPlayerInfo = playersList.shift(); if (playersList.length == 0){ _view.showStartButton(); }; _view.showUpgrades(selectedPlayerInfo); } public function buyUpgrade(_arg1:String):void{ var _local2:ConfigManager = Managers.configManager; selectedPlayerInfo.score = (selectedPlayerInfo.score - _local2.getUpgradePrice(_arg1)); var _local3:int = _local2.getUpgradeMaxAmount(_arg1); var _local4:int = (selectedPlayerInfo.getUpgradeAmount(_arg1) + _local2.getUpgradeBatchAmount(_arg1)); if (_local4 > _local3){ _local4 = _local3; }; selectedPlayerInfo.setUpgradeAmount(_arg1, _local4); _view.showUpgrades(selectedPlayerInfo); } public function startGame():void{ dispatchEvent(new ControllerEvent(ControllerEvent.FINISH, MainHSMEvent.START)); } public function dispose():void{ _view.dispose(); _view = null; } } }//package tanks2.core.upgradeScreen
Section 210
//UpgradeScreenView (tanks2.core.upgradeScreen.UpgradeScreenView) package tanks2.core.upgradeScreen { import flash.events.*; import tanks2.core.game.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import flash.text.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.ui.containers.*; import com.bigwigmedia.ui.styles.*; public class UpgradeScreenView extends LayoutContainer { private var popCornBombSlot:UpgradeSlot; private var armorPiercingSlot:UpgradeSlot; private var mainMenuBtn:LabelButton; private var shieldSlot:UpgradeSlot; private var tacticalNukeSlot:UpgradeSlot; private var shieldUpgradeSlot:UpgradeSlot; private var clusterSlot:UpgradeSlot; private var engineUpgradeSlot:UpgradeSlot; private var startGameOnNextClick:Boolean;// = false private var repairKitSlot:UpgradeSlot; private var bigRollerSlot:UpgradeSlot; private var nameLabel:Label; private var atomBombSlot:UpgradeSlot; private var continueBtn:LabelButton; private var airStrikeSlot:UpgradeSlot; private var _controller:UpgradeScreenController; private var miniRollerSlot:UpgradeSlot; private var spiderBombSlot:UpgradeSlot; private var teleportSlot:UpgradeSlot; private var highExplosiveRollerSlot:UpgradeSlot; private var incendiaryRollerSlot:UpgradeSlot; private var incendiaryClusterSlot:UpgradeSlot; private var fuelSlot:UpgradeSlot; private var upgradesContainer:VBox; private var satelliteStrikeSlot:UpgradeSlot; private var parachutesSlot:UpgradeSlot; private var twoDPlayBtn:DecoratedIconicButton; private var weaponsContainer:VBox; private var healthSlot:UpgradeSlot; public function UpgradeScreenView(_arg1:UpgradeScreenController){ _controller = _arg1; addChild(new UpgradeScreenBackground()); this.setSize(640, 480); twoDPlayBtn = new DecoratedIconicButton(); twoDPlayBtn.upIcon = TwoDPlayButtonIcon; addChildToLayout(twoDPlayBtn, {horizontalCenter:0, bottom:15}); nameLabel = new Label(); addChildToLayout(nameLabel, {horizontalCenter:0, top:20}); mainMenuBtn = new LabelButton(); mainMenuBtn.label = "MAIN MENU"; addChildToLayout(mainMenuBtn, {left:30, bottom:20}); continueBtn = new LabelButton(); continueBtn.label = "CONTINUE"; addChildToLayout(continueBtn, {right:30, bottom:20}); weaponsContainer = new VBox(); weaponsContainer.setSize(320, 400); weaponsContainer.gap = 3; armorPiercingSlot = new UpgradeSlot(WeaponType.ARMOR_PIERCING); weaponsContainer.addChildToLayout(armorPiercingSlot); popCornBombSlot = new UpgradeSlot(WeaponType.POP_CORN_BOMB); weaponsContainer.addChildToLayout(popCornBombSlot); miniRollerSlot = new UpgradeSlot(WeaponType.MINI_ROLLER); weaponsContainer.addChildToLayout(miniRollerSlot); clusterSlot = new UpgradeSlot(WeaponType.CLUSTER); weaponsContainer.addChildToLayout(clusterSlot); incendiaryClusterSlot = new UpgradeSlot(WeaponType.INCENDIARY_CLUSTER); weaponsContainer.addChildToLayout(incendiaryClusterSlot); bigRollerSlot = new UpgradeSlot(WeaponType.BIG_ROLLER); weaponsContainer.addChildToLayout(bigRollerSlot); spiderBombSlot = new UpgradeSlot(WeaponType.SPIDER_BOMB); weaponsContainer.addChildToLayout(spiderBombSlot); atomBombSlot = new UpgradeSlot(WeaponType.ATOM_BOMB); weaponsContainer.addChildToLayout(atomBombSlot); incendiaryRollerSlot = new UpgradeSlot(WeaponType.INCENDIARY_ROLLER); weaponsContainer.addChildToLayout(incendiaryRollerSlot); highExplosiveRollerSlot = new UpgradeSlot(WeaponType.HIGH_EXPLOSIVE_ROLLER); weaponsContainer.addChildToLayout(highExplosiveRollerSlot); tacticalNukeSlot = new UpgradeSlot(WeaponType.TACTICAL_NUKE); weaponsContainer.addChildToLayout(tacticalNukeSlot); airStrikeSlot = new UpgradeSlot(WeaponType.AIR_STRIKE); weaponsContainer.addChildToLayout(airStrikeSlot); satelliteStrikeSlot = new UpgradeSlot(WeaponType.SATELLITE_STRIKE); weaponsContainer.addChildToLayout(satelliteStrikeSlot); addChildToLayout(weaponsContainer, {left:70, top:80}); upgradesContainer = new VBox(); upgradesContainer.setSize(320, 400); upgradesContainer.gap = 3; parachutesSlot = new UpgradeSlot(UpgradeType.PARACHUTES); upgradesContainer.addChildToLayout(parachutesSlot); repairKitSlot = new UpgradeSlot(UpgradeType.REPAIR_KIT); upgradesContainer.addChildToLayout(repairKitSlot); shieldSlot = new UpgradeSlot(UpgradeType.SHIELD); upgradesContainer.addChildToLayout(shieldSlot); engineUpgradeSlot = new UpgradeSlot(UpgradeType.ENGINE_UPGRADE); upgradesContainer.addChildToLayout(engineUpgradeSlot); teleportSlot = new UpgradeSlot(UpgradeType.TELEPORT); upgradesContainer.addChildToLayout(teleportSlot); fuelSlot = new UpgradeSlot(UpgradeType.FUEL); upgradesContainer.addChildToLayout(fuelSlot); shieldUpgradeSlot = new UpgradeSlot(UpgradeType.SHIELD_UPGRADE); upgradesContainer.addChildToLayout(shieldUpgradeSlot); healthSlot = new UpgradeSlot(UpgradeType.HEALTH); upgradesContainer.addChildToLayout(healthSlot); addChildToLayout(upgradesContainer, {right:70, top:80}); this.addEventListener(MouseEvent.CLICK, onMouseClickHandler); } public function showUpgrades(_arg1:PlayerInfo):void{ var _local2:TextFormat = new TextFormat(Managers.fontManager.getFontNameByID("Font_1"), 26, _arg1.color); nameLabel.setStyle(AbstractComponentStyle.TEXT_FORMAT, _local2); nameLabel.text = ((_arg1.name + ": $") + _arg1.score); configureWeaponSlot(armorPiercingSlot, _arg1); configureWeaponSlot(popCornBombSlot, _arg1); configureWeaponSlot(clusterSlot, _arg1); configureWeaponSlot(incendiaryClusterSlot, _arg1); configureWeaponSlot(atomBombSlot, _arg1); configureWeaponSlot(tacticalNukeSlot, _arg1); configureWeaponSlot(miniRollerSlot, _arg1); configureWeaponSlot(bigRollerSlot, _arg1); configureWeaponSlot(incendiaryRollerSlot, _arg1); configureWeaponSlot(highExplosiveRollerSlot, _arg1); configureWeaponSlot(spiderBombSlot, _arg1); configureWeaponSlot(airStrikeSlot, _arg1); configureWeaponSlot(satelliteStrikeSlot, _arg1); configureUpgradeSlot(parachutesSlot, _arg1); configureUpgradeSlot(repairKitSlot, _arg1); configureUpgradeSlot(teleportSlot, _arg1); configureUpgradeSlot(shieldSlot, _arg1); configureUpgradeSlot(shieldUpgradeSlot, _arg1); configureUpgradeSlot(fuelSlot, _arg1); configureUpgradeSlot(healthSlot, _arg1); configureUpgradeSlot(engineUpgradeSlot, _arg1); } public function showStartButton():void{ continueBtn.label = "START"; startGameOnNextClick = true; } private function configureUpgradeSlot(_arg1:UpgradeSlot, _arg2:PlayerInfo):void{ var _local3:ConfigManager = Managers.configManager; var _local4:int = _arg2.getUpgradeAmount(_arg1.type); var _local5:int = _local3.getUpgradePrice(_arg1.type); var _local6:int = _local3.getUpgradeMaxAmount(_arg1.type); _arg1.amount = _local4; var _local7:Boolean = (((_arg2.score >= _local5)) && ((_local4 < _local6))); if (_arg1.enabled != _local7){ _arg1.enabled = _local7; }; } override public function dispose():void{ this.removeEventListener(MouseEvent.CLICK, onMouseClickHandler); super.dispose(); } private function configureWeaponSlot(_arg1:UpgradeSlot, _arg2:PlayerInfo):void{ var _local3:ConfigManager = Managers.configManager; var _local4:int = _arg2.getWeaponAmount(_arg1.type); var _local5:int = _local3.getUpgradePrice(_arg1.type); var _local6:int = _local3.getUpgradeMaxAmount(_arg1.type); _arg1.amount = _local4; var _local7:Boolean = (((_arg2.score >= _local5)) && ((_local4 < _local6))); if (_arg1.enabled != _local7){ _arg1.enabled = _local7; }; } private function onMouseClickHandler(_arg1:MouseEvent):void{ var _local2:UpgradeSlot; var _local3:String; switch (_arg1.target){ case twoDPlayBtn: Managers.urlCaller.mainLink(); break; case continueBtn: if (startGameOnNextClick){ _controller.startGame(); } else { _controller.selectNextPlayer(); }; break; case mainMenuBtn: _controller.gotoSplashMenu(); break; default: _local2 = (_arg1.target as UpgradeSlot); if (_local2){ _local3 = _local2.type; if (WeaponType.isWeaponType(_local3)){ _controller.buyWeapon(_local3); } else { _controller.buyUpgrade(_local3); }; }; break; }; } } }//package tanks2.core.upgradeScreen
Section 211
//UpgradeSlot (tanks2.core.upgradeScreen.UpgradeSlot) package tanks2.core.upgradeScreen { import flash.display.*; import com.bigwigmedia.ui.*; import tanks2.managers.*; import flash.text.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.display.*; import com.bigwigmedia.ui.styles.*; public class UpgradeSlot extends DecoratedIconicButton { private var amountField:TextField; private var batchAmountField:TextField; private var nameField:TextField; private var priceField:TextField; private var upgradeType:String; private var icon:MovieClip; public function UpgradeSlot(_arg1:String){ this.upgradeType = _arg1; super(); } override protected function drawState():void{ var _local1:IDecoration; switch (_state){ case ButtonState.UP: _local1 = (getStyle(DecoratedIconicButtonStyle.UP_DECORATION) as IDecoration); break; case ButtonState.OVER: _local1 = (getStyle(DecoratedIconicButtonStyle.OVER_DECORATION) as IDecoration); break; case ButtonState.DOWN: _local1 = (getStyle(DecoratedIconicButtonStyle.DOWN_DECORATION) as IDecoration); break; }; if (_local1){ _local1.apply(_icon); }; var _local2:IDecoration = (getStyle(AbstractComponentStyle.DISABLED_DECORATION) as IDecoration); if (_local2){ if (_enabled){ _local2.remove(this); } else { _local2.apply(this); }; }; } public function set amount(_arg1:int):void{ amountField.text = String(_arg1); } public function get type():String{ return (upgradeType); } override protected function createChildren():void{ _icon = new UpgradeSlotBackground(); addChild(_icon); var _local1:DisplayObjectContainer = (_icon as DisplayObjectContainer); icon = (_local1.getChildByName("icon") as MovieClip); icon.gotoAndStop(upgradeType); nameField = (_local1.getChildByName("nameField") as TextField); priceField = (_local1.getChildByName("priceField") as TextField); batchAmountField = (_local1.getChildByName("batchAmountField") as TextField); amountField = (_local1.getChildByName("amountField") as TextField); var _local2:ConfigManager = Managers.configManager; nameField.text = UpgradeType.getUpgradeName(upgradeType); priceField.text = ("$" + _local2.getUpgradePrice(upgradeType)); batchAmountField.text = String(_local2.getUpgradeBatchAmount(upgradeType)); } } }//package tanks2.core.upgradeScreen
Section 212
//IController (tanks2.core.IController) package tanks2.core { import flash.display.*; import flash.events.*; import com.bigwigmedia.core.*; public interface IController extends IEventDispatcher, IDisposable { function get view():DisplayObject; } }//package tanks2.core
Section 213
//PanelsOverlay (tanks2.effects.PanelsOverlay) package tanks2.effects { import flash.display.*; import flash.events.*; import tanks2.managers.*; import com.bigwigmedia.effects.*; import tanks2.sound.*; public class PanelsOverlay extends AbstractOverlay { private var _peakCallback:Function; private var animation:MovieClip; private var _completeCallback:Function; public function PanelsOverlay(_arg1:Function, _arg2:Function=null){ super(true); _peakCallback = _arg1; _completeCallback = _arg2; animation = new PanelsOverlayAnimation(); animation.stop(); addChild(animation); } private function onEnterFrameHandler(_arg1:Event):void{ if (animation.currentFrame == 22){ Managers.soundManager.playSound(SoundID.BLAST_DOORS_CLOSE_01_WAV); _peakCallback(); } else { if (animation.currentFrame == 43){ removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); animation.stop(); if (_completeCallback != null){ _completeCallback(); }; dispatchEvent(new Event(Event.COMPLETE)); }; }; } override public function start():void{ Managers.soundManager.playSound(SoundID.BLAST_DOORS_OPEN_01_WAV); addEventListener(Event.ENTER_FRAME, onEnterFrameHandler); animation.play(); } override public function dispose():void{ super.dispose(); removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); _peakCallback = null; _completeCallback = null; removeChild(animation); animation = null; } } }//package tanks2.effects
Section 214
//ConfigManager (tanks2.managers.ConfigManager) package tanks2.managers { import flash.events.*; import tanks2.core.game.*; import com.bigwigmedia.core.*; import com.bigwigmedia.application.*; public class ConfigManager extends EventDispatcher { private var configXMLClass:Class; private var main_config:XML; private var campaign_config:XML; private var weaponsConfig:XML; private var player_config:XML; private var upgrades_config:XML; private var configXML:XML; private static var instance:ConfigManager; public function ConfigManager(){ configXMLClass = ConfigManager_configXMLClass; super(); if (!false){ prepareConfigXML(XML(new configXMLClass())); ApplicationGlobals.application.stage.addEventListener(Event.ENTER_FRAME, doNextFrameHandler); }; } public function getWindDirectionChangeProbability():Number{ return (main_config.value.(@id == "wind_direction_change_probability")); } public function getTankDestroyBonus():int{ return (main_config.value.(@id == "tank_destroy_bonus")); } public function getWeaponInitialAmount(_arg1:String):int{ var numFragments:int; var type = _arg1; numFragments = weaponsConfig.weapon.(@id == type).amount; return (numFragments); } public function get namesList():Array{ var namesStr:String; namesStr = main_config.value.(@id == "names"); return (namesStr.split(",")); } public function getUpgradePrice(_arg1:String):int{ var type = _arg1; return (upgrades_config.upgrade.(@id == type).price); } public function getWeaponDamageRadius(_arg1:String):int{ var radius:int; var type = _arg1; radius = weaponsConfig.weapon.(@id == type).damage_radius; return (radius); } public function getUpgradeMaxAmount(_arg1:String):int{ var type = _arg1; return (upgrades_config.upgrade.(@id == type).max_amount); } public function getDamageToScoreMultiplier():int{ return (main_config.value.(@id == "damage_to_score_multiplier")); } public function getWindMultiplier():Number{ return (main_config.value.(@id == "wind_effect_multiplier")); } public function getWeaponDamage(_arg1:String):int{ var damage:int; var type = _arg1; damage = weaponsConfig.weapon.(@id == type).damage; return (damage); } public function set soundEnabled(_arg1:Boolean):void{ Singleton.getInstance("com.bigwigmedia.net::ISOManager").setValue("soundEnabled", _arg1); } public function getFallDamageMultiplier():Number{ return (main_config.value.(@id == "fall_damage_multiplier")); } public function getUpgradeValue(_arg1:String):int{ var type = _arg1; return (upgrades_config.upgrade.(@id == type).upgrade_value); } public function getUpgradeBatchAmount(_arg1:String):int{ var type = _arg1; return (upgrades_config.upgrade.(@id == type).batch_amount); } private function prepareConfigXML(_arg1:XML):void{ configXML = _arg1; weaponsConfig = configXML.weapons_config[0]; upgrades_config = configXML.upgrades_config[0]; main_config = configXML.main_config[0]; player_config = configXML.player_config[0]; campaign_config = configXML.campaign_config[0]; } public function getWeaponNumFragments(_arg1:String):int{ var numFragments:int; var type = _arg1; numFragments = weaponsConfig.weapon.(@id == type).num_fragments; return (numFragments); } public function getWindChangeMaxPercentage():Number{ return (main_config.value.(@id == "wind_change_max_percentage")); } public function get soundEnabled():Boolean{ return (Singleton.getInstance("com.bigwigmedia.net::ISOManager").getValue("soundEnabled")); } public function get numCampaignRounds():int{ return (campaign_config.round.length()); } public function getOpponentsForCampaignRound(_arg1:int):Array{ var _local5:XML; var _local2:XML = campaign_config.round[_arg1]; var _local3:XMLList = _local2..opponent; var _local4:Array = []; for each (_local5 in _local3) { _local4.push(new CampaignOpponentInfo(_local5)); }; return (_local4); } private function doNextFrameHandler(_arg1:Event):void{ ApplicationGlobals.application.stage.removeEventListener(Event.ENTER_FRAME, doNextFrameHandler); dispatchEvent(new Event(Event.COMPLETE)); } public function getPlayerConfigIntValue(_arg1:String):int{ var name = _arg1; return (player_config.value.(@id == name)); } public static function getInstance():ConfigManager{ if (!instance){ instance = new (ConfigManager); }; return (instance); } } }//package tanks2.managers
Section 215
//ConfigManager_configXMLClass (tanks2.managers.ConfigManager_configXMLClass) package tanks2.managers { import mx.core.*; public class ConfigManager_configXMLClass extends ByteArrayAsset { } }//package tanks2.managers
Section 216
//Managers (tanks2.managers.Managers) package tanks2.managers { import flash.events.*; import com.bigwigmedia.ui.*; import com.bigwigmedia.font.*; import com.bigwigmedia.sound.*; import com.bigwigmedia.net.*; import tanks2.core.upgradeScreen.*; import flash.text.*; import com.bigwigmedia.core.*; import tanks2.sound.*; import com.bigwigmedia.display.*; import com.bigwigmedia.ui.styles.*; import flash.filters.*; public class Managers { private static var _soundManager:ISoundManager; private static var _configManager:ConfigManager; private static var initialized:Boolean = false; private static var _urlCaller:IURLCaller; private static var _fontManager:IFontManager; private static var _styleManager:IStyleManager; private static var _soManager:ISOManager; private static var onInitCallback:Function; private static var _cursorManager:ICursorManager; public static function get configManager():ConfigManager{ return (_configManager); } public static function initialize(_arg1:Function):void{ if (initialized){ return; }; initialized = true; Managers.onInitCallback = _arg1; Singleton.registerClass("com.bigwigmedia.font::IFontManager", FontManager); _fontManager = IFontManager(Singleton.getInstance("com.bigwigmedia.font::IFontManager")); Singleton.registerClass("com.bigwigmedia.ui::ICursorManager", CursorManager); _cursorManager = ICursorManager(Singleton.getInstance("com.bigwigmedia.ui::ICursorManager")); Singleton.registerClass("com.bigwigmedia.sound::ISoundManager", SoundManager); _soundManager = ISoundManager(Singleton.getInstance("com.bigwigmedia.sound::ISoundManager")); Singleton.registerClass("com.bigwigmedia.ui::IStyleManager", StyleManager); _styleManager = IStyleManager(Singleton.getInstance("com.bigwigmedia.ui::IStyleManager")); Singleton.registerClass("com.bigwigmedia.net::ISOManager", SOManager); _soManager = ISOManager(Singleton.getInstance("com.bigwigmedia.net::ISOManager")); Singleton.registerClass("com.bigwigmedia.net::IURLCaller", URLCaller_2DPlay); _urlCaller = IURLCaller(Singleton.getInstance("com.bigwigmedia.net::IURLCaller")); _fontManager.registerFonts("Font_1"); _styleManager.setSharedStyle(AbstractComponent, AbstractComponentStyle.TEXT_FORMAT, new TextFormat(_fontManager.getFontNameByID("Font_1"), 26, 0xFFFFFF)); _styleManager.setSharedStyle(AbstractComponent, AbstractComponentStyle.EMBED_FONTS, true); _styleManager.setSharedStyle(LabelButton, AbstractComponentStyle.DECORATION, new FilterDecoration(new DropShadowFilter())); _styleManager.setSharedStyle(Label, AbstractComponentStyle.DECORATION, new FilterDecoration(new DropShadowFilter())); _styleManager.setSharedStyle(DecoratedIconicButton, DecoratedIconicButtonStyle.UP_DECORATION, new TintDecoration(0xFFFFFF, 0)); _styleManager.setSharedStyle(DecoratedIconicButton, DecoratedIconicButtonStyle.OVER_DECORATION, new TintDecoration(0xFFFFFF, 0.3)); _styleManager.setSharedStyle(LabelButton, LabelButtonStyle.UP_STATE_COLOR, 0xFFFFFF); _styleManager.setSharedStyle(LabelButton, LabelButtonStyle.OVER_STATE_COLOR, 0xCCCCCC); _styleManager.setSharedStyle(LabelButton, LabelButtonStyle.DOWN_STATE_COLOR, 0xCCCCCC); _styleManager.setSharedStyle(CheckBox, CheckBoxStyle.ICON, CheckBoxIcon); _styleManager.setSharedStyle(CheckBox, CheckBoxStyle.SELECTED_ICON, CheckBoxSelectedIcon); _styleManager.setSharedStyle(RadioButton, CheckBoxStyle.ICON, RadioButtonIcon); _styleManager.setSharedStyle(RadioButton, CheckBoxStyle.SELECTED_ICON, RadioButtonSelectedIcon); _styleManager.setSharedStyle(AbstractButton, AbstractButtonStyle.MOUSE_DOWN_HANDLER, Managers.onButtonMouseDownHandler); _styleManager.setSharedStyle(UpgradeSlot, DecoratedIconicButtonStyle.UP_DECORATION, new TintDecoration(0xFFFFFF, 0)); _styleManager.setSharedStyle(UpgradeSlot, DecoratedIconicButtonStyle.OVER_DECORATION, new TintDecoration(0xFFFFFF, 0.3)); _styleManager.setSharedStyle(UpgradeSlot, AbstractComponentStyle.DISABLED_DECORATION, new TintDecoration(0, 0.7)); var _local2:Array = ["sfxChannel"]; var _local3:Array = ["sfxChannel", "tankMoveChannel"]; var _local4:Array = ["sfxChannel", "tankTurretChannel"]; _soundManager.registerSoundRecord(SoundID.BLAST_DOORS_01_WAV, blast_doors_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.BLAST_DOORS_CLOSE_01_WAV, blast_doors_close_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.BLAST_DOORS_OPEN_01_WAV, blast_doors_open_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EMP_FIZZLE_01_WAV, emp_fizzle_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.ENV_WIND_HARD_01_WAV, env_wind_hard_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.ENV_WIND_LIGHT_01_WAV, env_wind_light_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.ENV_WIND_MED_01_WAV, env_wind_med_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EQP_FORCEFIELD_01_WAV, eqp_forcefield_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EQP_PARACHUTE_00_WAV, eqp_parachute_00_wav, _local2); _soundManager.registerSoundRecord(SoundID.EQP_REPAIR_01_WAV, eqp_repair_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_ATOMIC_01_WAV, explosn_atomic_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_ATOMIC_02_WAV, explosn_atomic_02_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_EMP_01_WAV, explosn_emp_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_FIRE_BOMB_01_WAV, explosn_fire_bomb_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_LRG_01_WAV, explosn_lrg_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_MED_01_WAV, explosn_med_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_MED_02_WAV, explosn_med_02_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_SM_01_WAV, explosn_sm_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.EXPLOSN_SM_02_WAV, explosn_sm_02_wav, _local2); _soundManager.registerSoundRecord(SoundID.MENU_CLICK_01_WAV, menu_click_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.MENU_CLICK_02_WAV, menu_click_02_wav, _local2); _soundManager.registerSoundRecord(SoundID.MENU_CLICK_03_WAV, menu_click_03_wav, _local2); _soundManager.registerSoundRecord(SoundID.TANK_FIRE_01_WAV, tank_fire_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.TANK_MG_FIRE_01_WAV, tank_mg_fire_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.TANK_MOVE_01_WAV, tank_move_01_wav, _local3); _soundManager.registerSoundRecord(SoundID.TANK_MOVE_03_WAV, tank_move_03_wav, _local3); _soundManager.registerSoundRecord(SoundID.TANK_MOVE_WOUNDED__02_WAV, tank_move_wounded__02_wav, _local3); _soundManager.registerSoundRecord(SoundID.TANK_MOVE_WOUNDED_01_WAV, tank_move_wounded_01_wav, _local3); _soundManager.registerSoundRecord(SoundID.TANK_TURRET_MOVE_01_WAV, tank_turret_move_01_wav, _local4); _soundManager.registerSoundRecord(SoundID.TANK_TURRET_MOVE_02_WAV, tank_turret_move_02_wav, _local4); _soundManager.registerSoundRecord(SoundID.VO_ENEMY_NEUTRALIZED_01_WAV, vo_enemy_neutralized_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.VO_SHIELDS_ARE_LOW_01_WAV, vo_shields_are_low_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.VO_TAKING_ENEMY_FIRE_01_WAV, vo_taking_enemy_fire_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.VO_TARGET_IDENTIFIED_01_WAV, vo_target_identified_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.WPN_AIRSTRIKE_01_WAV, wpn_airstrike_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.WPN_PREDSTRIKE_01_WAV, wpn_predstrike_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.WPN_SAT_COMMUNIC_01_WAV, wpn_sat_communic_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.WPN_SAT_STRIKE_01_WAV, wpn_sat_strike_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.WPN_SELF_DESTRUCT_01_WAV, wpn_self_destruct_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.WPN_SPIDR_BOMB_WALK_01_WAV, wpn_spidr_bomb_walk_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.WPN_TELEPORT_01_WAV, wpn_teleport_01_wav, _local2); _soundManager.registerSoundRecord(SoundID.WPN_TELEPORT_02_WAV, wpn_teleport_02_wav, _local2); _configManager = ConfigManager.getInstance(); _configManager.addEventListener(Event.COMPLETE, Managers.onConfigManCompleteHandler); } public static function get urlCaller():IURLCaller{ return (_urlCaller); } public static function get soundManager():ISoundManager{ return (_soundManager); } public static function get fontManager():IFontManager{ return (_fontManager); } public static function get soManager():ISOManager{ return (_soManager); } private static function onButtonMouseDownHandler(_arg1:AbstractButton):void{ _soundManager.playSound(SoundID.MENU_CLICK_01_WAV); } public static function get cursorManager():ICursorManager{ return (_cursorManager); } private static function onConfigManCompleteHandler(_arg1:Event):void{ _configManager.removeEventListener(Event.COMPLETE, Managers.onConfigManCompleteHandler); Managers.onInitCallback(); Managers.onInitCallback = null; } public static function get styleManager():IStyleManager{ return (_styleManager); } } }//package tanks2.managers
Section 217
//SoundID (tanks2.sound.SoundID) package tanks2.sound { public class SoundID { public static const EQP_FORCEFIELD_01_WAV:String = "eqp_forcefield_01_wav"; public static const EXPLOSN_ATOMIC_01_WAV:String = "explosn_atomic_01_wav"; public static const TANK_MG_FIRE_01_WAV:String = "tank_mg_fire_01_wav"; public static const TANK_MOVE_WOUNDED__02_WAV:String = "tank_move_wounded__02_wav"; public static const VO_ENEMY_NEUTRALIZED_01_WAV:String = "vo_enemy_neutralized_01_wav"; public static const WPN_SPIDR_BOMB_WALK_01_WAV:String = "wpn_spidr_bomb_walk_01_wav"; public static const VO_SHIELDS_ARE_LOW_01_WAV:String = "vo_shields_are_low_01_wav"; public static const WPN_TELEPORT_01_WAV:String = "wpn_teleport_01_wav"; public static const WPN_PREDSTRIKE_01_WAV:String = "wpn_predstrike_01_wav"; public static const BLAST_DOORS_OPEN_01_WAV:String = "blast_doors_open_01_wav"; public static const EQP_REPAIR_01_WAV:String = "eqp_repair_01_wav"; public static const EXPLOSN_MED_02_WAV:String = "explosn_med_02_wav"; public static const MENU_CLICK_03_WAV:String = "menu_click_03_wav"; public static const VO_TAKING_ENEMY_FIRE_01_WAV:String = "vo_taking_enemy_fire_01_wav"; public static const MENU_CLICK_01_WAV:String = "menu_click_01_wav"; public static const MENU_CLICK_02_WAV:String = "menu_click_02_wav"; public static const BLAST_DOORS_01_WAV:String = "blast_doors_01_wav"; public static const EXPLOSN_EMP_01_WAV:String = "explosn_emp_01_wav"; public static const WPN_SAT_COMMUNIC_01_WAV:String = "wpn_sat_communic_01_wav"; public static const ENV_WIND_MED_01_WAV:String = "env_wind_med_01_wav"; public static const BLAST_DOORS_CLOSE_01_WAV:String = "blast_doors_close_01_wav"; public static const EXPLOSN_LRG_01_WAV:String = "explosn_lrg_01_wav"; public static const WPN_AIRSTRIKE_01_WAV:String = "wpn_airstrike_01_wav"; public static const EXPLOSN_MED_01_WAV:String = "explosn_med_01_wav"; public static const EQP_PARACHUTE_00_WAV:String = "eqp_parachute_00_wav"; public static const WPN_SAT_STRIKE_01_WAV:String = "wpn_sat_strike_01_wav"; public static const EMP_FIZZLE_01_WAV:String = "emp_fizzle_01_wav"; public static const ENV_WIND_LIGHT_01_WAV:String = "env_wind_light_01_wav"; public static const ENV_WIND_HARD_01_WAV:String = "env_wind_hard_01_wav"; public static const TANK_FIRE_01_WAV:String = "tank_fire_01_wav"; public static const TANK_TURRET_MOVE_02_WAV:String = "tank_turret_move_02_wav"; public static const EXPLOSN_FIRE_BOMB_01_WAV:String = "explosn_fire_bomb_01_wav"; public static const TANK_MOVE_01_WAV:String = "tank_move_01_wav"; public static const TANK_MOVE_03_WAV:String = "tank_move_03_wav"; public static const EXPLOSN_SM_01_WAV:String = "explosn_sm_01_wav"; public static const EXPLOSN_SM_02_WAV:String = "explosn_sm_02_wav"; public static const TANK_TURRET_MOVE_01_WAV:String = "tank_turret_move_01_wav"; public static const TANK_MOVE_WOUNDED_01_WAV:String = "tank_move_wounded_01_wav"; public static const VO_TARGET_IDENTIFIED_01_WAV:String = "vo_target_identified_01_wav"; public static const WPN_TELEPORT_02_WAV:String = "wpn_teleport_02_wav"; public static const WPN_SELF_DESTRUCT_01_WAV:String = "wpn_self_destruct_01_wav"; public static const EXPLOSN_ATOMIC_02_WAV:String = "explosn_atomic_02_wav"; } }//package tanks2.sound
Section 218
//AirStrikeCursor (tanks2.ui.AirStrikeCursor) package tanks2.ui { import flash.display.*; import tanks2.core.game.*; import com.bigwigmedia.events.*; import tanks2.core.game.gameItems.*; import com.bigwigmedia.core.*; import com.bigwigmedia.input.*; import com.bigwigmedia.application.*; import flash.ui.*; public class AirStrikeCursor extends Sprite implements IDisposable { private var _direction:String;// = "RIGHT_TO_LEFT" private var keyInputMan:KeyInputManager; private var clip:MovieClip; public function AirStrikeCursor(){ clip = new AirStrikeCursorClip(); clip.gotoAndStop(_direction); addChild(clip); keyInputMan = new KeyInputManager(ApplicationGlobals.application.stage); keyInputMan.mapKey(KeyControlActions.MOVE_LEFT, Keyboard.LEFT); keyInputMan.mapKey(KeyControlActions.MOVE_RIGHT, Keyboard.RIGHT); keyInputMan.addEventListener(KeyInputEvent.KEY_DOWN, onKeyDownHandler); } public function dispose():void{ removeChild(clip); keyInputMan.dispose(); keyInputMan = null; } public function get direction():String{ return (_direction); } private function onKeyDownHandler(_arg1:KeyInputEvent):void{ switch (_arg1.keyAction){ case KeyControlActions.MOVE_LEFT: _direction = WeaponDirection.RIGHT_TO_LEFT; break; case KeyControlActions.MOVE_RIGHT: _direction = WeaponDirection.LEFT_TO_RIGHT; break; }; clip.gotoAndStop(_direction); } } }//package tanks2.ui
Section 219
//CannonAngleSliderThumb (tanks2.ui.CannonAngleSliderThumb) package tanks2.ui { import com.bigwigmedia.ui.*; public class CannonAngleSliderThumb extends IconicButton { public function CannonAngleSliderThumb(){ upIcon = CannonSliderThumbIcon; } } }//package tanks2.ui
Section 220
//ColoredRadioButton (tanks2.ui.ColoredRadioButton) package tanks2.ui { import com.bigwigmedia.ui.*; import fl.motion.*; import flash.utils.*; import com.bigwigmedia.ui.styles.*; public class ColoredRadioButton extends RadioButton { override protected function drawState():void{ var _local2:Color; var _local1:Class = Class(getStyle((_selected) ? CheckBoxStyle.SELECTED_ICON : CheckBoxStyle.ICON)); if (getQualifiedClassName(_local1) != getQualifiedClassName(_icon)){ if (_icon){ removeChild(_icon); }; _icon = new (_local1); _local2 = new Color(); _local2.setTint(uint(value), 0.5); _icon.transform.colorTransform = _local2; addChild(_icon); }; } } }//package tanks2.ui
Section 221
//FirePowerSliderThumb (tanks2.ui.FirePowerSliderThumb) package tanks2.ui { import com.bigwigmedia.ui.*; public class FirePowerSliderThumb extends IconicButton { public function FirePowerSliderThumb(){ upIcon = FirePowerSliderThumbIcon; } } }//package tanks2.ui
Section 222
//SatelliteStrikeCursor (tanks2.ui.SatelliteStrikeCursor) package tanks2.ui { import flash.display.*; import com.bigwigmedia.core.*; public class SatelliteStrikeCursor extends Sprite implements IDisposable { public function SatelliteStrikeCursor(){ addChild(new SatelliteStrikeCursorClip()); } public function dispose():void{ } } }//package tanks2.ui
Section 223
//NameGenerator (tanks2.utils.NameGenerator) package tanks2.utils { import tanks2.managers.*; public class NameGenerator { private static var index:int = 0; private static var namesList:Array; public static function getNextName(_arg1:Array):String{ var _local2:String; var _local3:Boolean; var _local4:String; if (!namesList){ namesList = Managers.configManager.namesList; }; while (true) { _local2 = namesList[index]; if (++index == namesList.length){ index = 0; }; _local3 = false; if (_arg1.length == 0){ break; } else { if (_arg1.length == 1){ if (_arg1[0] == _local2){ _local3 = true; }; } else { for each (_local4 in _arg1) { if (_local2 == _local4){ _local3 = true; break; }; }; }; }; if (!_local3){ break; }; }; return (_local2); } } }//package tanks2.utils
Section 224
//Main (tanks2.Main) package tanks2 { import com.bigwigmedia.application.*; import com.bigwigmedia.preloaders.*; import com.bigwigmedia.events.*; import com.bigwigmedia.ui.*; import tanks2.core.*; public class Main extends AbstractApplication_2DPLay { public static const VERSION:String = "1.0.0.1771"; public function Main(){ super("Tanks 2", "1742", VERSION, "com.bigwigmedia.tanks_2"); addEventListener(ApplicationEvent.INIT, onAppInitHandler); addEventListener(ApplicationEvent.READY, onAppReadyHandler); } private function onAppInitHandler(_arg1:ApplicationEvent):void{ this.contextMenu = ContextMenu_2DPlay.getMenu(); fillBackground(0xFFFFFF); createMask(); startPreloading(new Preloader_2DPlay(false)); } private function onAppReadyHandler(_arg1:ApplicationEvent):void{ fillBackground(0); removeChild(_preloader); _preloader = null; removeEventListener(ApplicationEvent.INIT, onAppInitHandler); removeEventListener(ApplicationEvent.READY, onAppReadyHandler); var _local2:Class = getClassByName("tanks2.core.main.MainController"); var _local3:IController = new (_local2); createMainView(_local3.view); Console.initialize([67, 79, 78, 83, 79, 76, 69]); } } }//package tanks2
Section 225
//AirStrikeCursorClip (AirStrikeCursorClip) package { import flash.display.*; public dynamic class AirStrikeCursorClip extends MovieClip { } }//package
Section 226
//AirStrikeRocketSprite (AirStrikeRocketSprite) package { import flash.display.*; public dynamic class AirStrikeRocketSprite extends Sprite { } }//package
Section 227
//AirStrikeShuttleSprite (AirStrikeShuttleSprite) package { import flash.display.*; public dynamic class AirStrikeShuttleSprite extends Sprite { } }//package
Section 228
//AlpineTexture (AlpineTexture) package { import flash.display.*; public dynamic class AlpineTexture extends BitmapData { public function AlpineTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 229
//AlpineTopTexture (AlpineTopTexture) package { import flash.display.*; public dynamic class AlpineTopTexture extends BitmapData { public function AlpineTopTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 230
//ArrowLeftOverIcon (ArrowLeftOverIcon) package { import flash.display.*; public dynamic class ArrowLeftOverIcon extends Sprite { } }//package
Section 231
//ArrowLeftUpIcon (ArrowLeftUpIcon) package { import flash.display.*; public dynamic class ArrowLeftUpIcon extends Sprite { } }//package
Section 232
//ArrowRightOverIcon (ArrowRightOverIcon) package { import flash.display.*; public dynamic class ArrowRightOverIcon extends Sprite { } }//package
Section 233
//ArrowRightUpIcon (ArrowRightUpIcon) package { import flash.display.*; public dynamic class ArrowRightUpIcon extends Sprite { } }//package
Section 234
//AtomBombSprite (AtomBombSprite) package { import flash.display.*; public dynamic class AtomBombSprite extends Sprite { } }//package
Section 235
//AtomExplosionClip (AtomExplosionClip) package { import flash.display.*; public dynamic class AtomExplosionClip extends MovieClip { } }//package
Section 236
//BigExplosionClip (BigExplosionClip) package { import flash.display.*; public dynamic class BigExplosionClip extends MovieClip { } }//package
Section 237
//blast_doors_01_wav (blast_doors_01_wav) package { import flash.media.*; public dynamic class blast_doors_01_wav extends Sound { } }//package
Section 238
//blast_doors_close_01_wav (blast_doors_close_01_wav) package { import flash.media.*; public dynamic class blast_doors_close_01_wav extends Sound { } }//package
Section 239
//blast_doors_open_01_wav (blast_doors_open_01_wav) package { import flash.media.*; public dynamic class blast_doors_open_01_wav extends Sound { } }//package
Section 240
//CampaignLostViewBackground (CampaignLostViewBackground) package { import flash.display.*; public dynamic class CampaignLostViewBackground extends Sprite { } }//package
Section 241
//CampaignPlayerSelectionViewBackground (CampaignPlayerSelectionViewBackground) package { import flash.display.*; public dynamic class CampaignPlayerSelectionViewBackground extends Sprite { } }//package
Section 242
//CampaignWonViewBackground (CampaignWonViewBackground) package { import flash.display.*; public dynamic class CampaignWonViewBackground extends Sprite { } }//package
Section 243
//CannonSliderThumbIcon (CannonSliderThumbIcon) package { import flash.display.*; public dynamic class CannonSliderThumbIcon extends Sprite { } }//package
Section 244
//CheckBoxIcon (CheckBoxIcon) package { import flash.display.*; public dynamic class CheckBoxIcon extends Sprite { } }//package
Section 245
//CheckBoxSelectedIcon (CheckBoxSelectedIcon) package { import flash.display.*; public dynamic class CheckBoxSelectedIcon extends Sprite { } }//package
Section 246
//DamageFireClip (DamageFireClip) package { import flash.display.*; public dynamic class DamageFireClip extends MovieClip { } }//package
Section 247
//DamageSmokeClip (DamageSmokeClip) package { import flash.display.*; public dynamic class DamageSmokeClip extends MovieClip { } }//package
Section 248
//DeathmatchCompletedViewBackground (DeathmatchCompletedViewBackground) package { import flash.display.*; public dynamic class DeathmatchCompletedViewBackground extends Sprite { } }//package
Section 249
//DeathmatchPlayerSelectionViewBackground (DeathmatchPlayerSelectionViewBackground) package { import flash.display.*; public dynamic class DeathmatchPlayerSelectionViewBackground extends Sprite { } }//package
Section 250
//DesertTexture (DesertTexture) package { import flash.display.*; public dynamic class DesertTexture extends BitmapData { public function DesertTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 251
//DesertTopTexture (DesertTopTexture) package { import flash.display.*; public dynamic class DesertTopTexture extends BitmapData { public function DesertTopTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 252
//emp_fizzle_01_wav (emp_fizzle_01_wav) package { import flash.media.*; public dynamic class emp_fizzle_01_wav extends Sound { } }//package
Section 253
//env_wind_hard_01_wav (env_wind_hard_01_wav) package { import flash.media.*; public dynamic class env_wind_hard_01_wav extends Sound { } }//package
Section 254
//env_wind_light_01_wav (env_wind_light_01_wav) package { import flash.media.*; public dynamic class env_wind_light_01_wav extends Sound { } }//package
Section 255
//env_wind_med_01_wav (env_wind_med_01_wav) package { import flash.media.*; public dynamic class env_wind_med_01_wav extends Sound { } }//package
Section 256
//eqp_forcefield_01_wav (eqp_forcefield_01_wav) package { import flash.media.*; public dynamic class eqp_forcefield_01_wav extends Sound { } }//package
Section 257
//eqp_parachute_00_wav (eqp_parachute_00_wav) package { import flash.media.*; public dynamic class eqp_parachute_00_wav extends Sound { } }//package
Section 258
//eqp_repair_01_wav (eqp_repair_01_wav) package { import flash.media.*; public dynamic class eqp_repair_01_wav extends Sound { } }//package
Section 259
//ExplosionEffect (ExplosionEffect) package { import flash.display.*; public dynamic class ExplosionEffect extends MovieClip { } }//package
Section 260
//explosn_atomic_01_wav (explosn_atomic_01_wav) package { import flash.media.*; public dynamic class explosn_atomic_01_wav extends Sound { } }//package
Section 261
//explosn_atomic_02_wav (explosn_atomic_02_wav) package { import flash.media.*; public dynamic class explosn_atomic_02_wav extends Sound { } }//package
Section 262
//explosn_emp_01_wav (explosn_emp_01_wav) package { import flash.media.*; public dynamic class explosn_emp_01_wav extends Sound { } }//package
Section 263
//explosn_fire_bomb_01_wav (explosn_fire_bomb_01_wav) package { import flash.media.*; public dynamic class explosn_fire_bomb_01_wav extends Sound { } }//package
Section 264
//explosn_lrg_01_wav (explosn_lrg_01_wav) package { import flash.media.*; public dynamic class explosn_lrg_01_wav extends Sound { } }//package
Section 265
//explosn_med_01_wav (explosn_med_01_wav) package { import flash.media.*; public dynamic class explosn_med_01_wav extends Sound { } }//package
Section 266
//explosn_med_02_wav (explosn_med_02_wav) package { import flash.media.*; public dynamic class explosn_med_02_wav extends Sound { } }//package
Section 267
//explosn_sm_01_wav (explosn_sm_01_wav) package { import flash.media.*; public dynamic class explosn_sm_01_wav extends Sound { } }//package
Section 268
//explosn_sm_02_wav (explosn_sm_02_wav) package { import flash.media.*; public dynamic class explosn_sm_02_wav extends Sound { } }//package
Section 269
//FireButtonOverIcon (FireButtonOverIcon) package { import flash.display.*; public dynamic class FireButtonOverIcon extends Sprite { } }//package
Section 270
//FireButtonUpIcon (FireButtonUpIcon) package { import flash.display.*; public dynamic class FireButtonUpIcon extends Sprite { } }//package
Section 271
//FireEffect (FireEffect) package { import flash.display.*; public dynamic class FireEffect extends MovieClip { } }//package
Section 272
//FireExplosionAnimation (FireExplosionAnimation) package { import flash.display.*; public dynamic class FireExplosionAnimation extends MovieClip { } }//package
Section 273
//FirePowerSliderThumbIcon (FirePowerSliderThumbIcon) package { import flash.display.*; public dynamic class FirePowerSliderThumbIcon extends Sprite { } }//package
Section 274
//Font_1 (Font_1) package { import flash.text.*; public dynamic class Font_1 extends Font { } }//package
Section 275
//ForestTexture (ForestTexture) package { import flash.display.*; public dynamic class ForestTexture extends BitmapData { public function ForestTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 276
//ForestTopTexture (ForestTopTexture) package { import flash.display.*; public dynamic class ForestTopTexture extends BitmapData { public function ForestTopTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 277
//HUDBackground (HUDBackground) package { import flash.display.*; import flash.text.*; public dynamic class HUDBackground extends Sprite { public var maxFirePowerIndicator:MovieClip; public var healthBar:MovieClip; public var windStrengthField:TextField; public var numTeleportsField:TextField; public var numParachutesField:TextField; public var cannonAngleIcon:MovieClip; public var weaponNameField:TextField; public var numShieldsField:TextField; public var scoreField:TextField; public var numRepairsField:TextField; public var weaponAmountField:TextField; public var firePowerField:TextField; public var cannonAngleField:TextField; public var weaponIcon:MovieClip; public var fuelField:TextField; public var shieldBar:MovieClip; public var windArrowIcon:MovieClip; } }//package
Section 278
//IncendiaryShellSprite (IncendiaryShellSprite) package { import flash.display.*; public dynamic class IncendiaryShellSprite extends Sprite { } }//package
Section 279
//InstructionsBackground (InstructionsBackground) package { import flash.display.*; public dynamic class InstructionsBackground extends Sprite { } }//package
Section 280
//LevelBackground (LevelBackground) package { import flash.display.*; public dynamic class LevelBackground extends MovieClip { } }//package
Section 281
//MediumExplosionClip (MediumExplosionClip) package { import flash.display.*; public dynamic class MediumExplosionClip extends MovieClip { } }//package
Section 282
//menu_click_01_wav (menu_click_01_wav) package { import flash.media.*; public dynamic class menu_click_01_wav extends Sound { } }//package
Section 283
//menu_click_02_wav (menu_click_02_wav) package { import flash.media.*; public dynamic class menu_click_02_wav extends Sound { } }//package
Section 284
//menu_click_03_wav (menu_click_03_wav) package { import flash.media.*; public dynamic class menu_click_03_wav extends Sound { } }//package
Section 285
//MinusButtonOverIcon (MinusButtonOverIcon) package { import flash.display.*; public dynamic class MinusButtonOverIcon extends Sprite { } }//package
Section 286
//MinusButtonUpIcon (MinusButtonUpIcon) package { import flash.display.*; public dynamic class MinusButtonUpIcon extends Sprite { } }//package
Section 287
//NewPlayerPopupBackground (NewPlayerPopupBackground) package { import flash.display.*; public dynamic class NewPlayerPopupBackground extends Sprite { } }//package
Section 288
//PanelsOverlayAnimation (PanelsOverlayAnimation) package { import flash.display.*; public dynamic class PanelsOverlayAnimation extends MovieClip { } }//package
Section 289
//ParachuteButtonIcon (ParachuteButtonIcon) package { import flash.display.*; public dynamic class ParachuteButtonIcon extends Sprite { } }//package
Section 290
//ParachutesClip (ParachutesClip) package { import flash.display.*; public dynamic class ParachutesClip extends MovieClip { } }//package
Section 291
//PauseButtonOverIcon (PauseButtonOverIcon) package { import flash.display.*; public dynamic class PauseButtonOverIcon extends Sprite { } }//package
Section 292
//PauseButtonUpIcon (PauseButtonUpIcon) package { import flash.display.*; public dynamic class PauseButtonUpIcon extends Sprite { } }//package
Section 293
//PauseMenuBackground (PauseMenuBackground) package { import flash.display.*; public dynamic class PauseMenuBackground extends Sprite { } }//package
Section 294
//PlayerInfoPanelBackground (PlayerInfoPanelBackground) package { import flash.display.*; public dynamic class PlayerInfoPanelBackground extends Sprite { } }//package
Section 295
//PlusButtonOverIcon (PlusButtonOverIcon) package { import flash.display.*; public dynamic class PlusButtonOverIcon extends Sprite { } }//package
Section 296
//PlusButtonUpIcon (PlusButtonUpIcon) package { import flash.display.*; public dynamic class PlusButtonUpIcon extends Sprite { } }//package
Section 297
//PopCornBombSprite (PopCornBombSprite) package { import flash.display.*; public dynamic class PopCornBombSprite extends Sprite { } }//package
Section 298
//RadioButtonIcon (RadioButtonIcon) package { import flash.display.*; public dynamic class RadioButtonIcon extends Sprite { } }//package
Section 299
//RadioButtonSelectedIcon (RadioButtonSelectedIcon) package { import flash.display.*; public dynamic class RadioButtonSelectedIcon extends Sprite { } }//package
Section 300
//RepairButtonIcon (RepairButtonIcon) package { import flash.display.*; public dynamic class RepairButtonIcon extends Sprite { } }//package
Section 301
//RockyTexture (RockyTexture) package { import flash.display.*; public dynamic class RockyTexture extends BitmapData { public function RockyTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 302
//RockyTopTexture (RockyTopTexture) package { import flash.display.*; public dynamic class RockyTopTexture extends BitmapData { public function RockyTopTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 303
//SatelliteStrikeCursorClip (SatelliteStrikeCursorClip) package { import flash.display.*; public dynamic class SatelliteStrikeCursorClip extends Sprite { } }//package
Section 304
//SatelliteStrikeSprite (SatelliteStrikeSprite) package { import flash.display.*; public dynamic class SatelliteStrikeSprite extends MovieClip { } }//package
Section 305
//ShieldActivatingClip (ShieldActivatingClip) package { import flash.display.*; public dynamic class ShieldActivatingClip extends MovieClip { } }//package
Section 306
//ShieldButtonIcon (ShieldButtonIcon) package { import flash.display.*; public dynamic class ShieldButtonIcon extends Sprite { } }//package
Section 307
//ShieldClip (ShieldClip) package { import flash.display.*; public dynamic class ShieldClip extends MovieClip { } }//package
Section 308
//SmallExplosionClip (SmallExplosionClip) package { import flash.display.*; public dynamic class SmallExplosionClip extends MovieClip { } }//package
Section 309
//SpiderBombClip (SpiderBombClip) package { import flash.display.*; public dynamic class SpiderBombClip extends MovieClip { } }//package
Section 310
//SplashMenuViewBackground (SplashMenuViewBackground) package { import flash.display.*; public dynamic class SplashMenuViewBackground extends Sprite { } }//package
Section 311
//StandardShellSprite (StandardShellSprite) package { import flash.display.*; public dynamic class StandardShellSprite extends Sprite { } }//package
Section 312
//tank_fire_01_wav (tank_fire_01_wav) package { import flash.media.*; public dynamic class tank_fire_01_wav extends Sound { } }//package
Section 313
//tank_mg_fire_01_wav (tank_mg_fire_01_wav) package { import flash.media.*; public dynamic class tank_mg_fire_01_wav extends Sound { } }//package
Section 314
//tank_move_01_wav (tank_move_01_wav) package { import flash.media.*; public dynamic class tank_move_01_wav extends Sound { } }//package
Section 315
//tank_move_03_wav (tank_move_03_wav) package { import flash.media.*; public dynamic class tank_move_03_wav extends Sound { } }//package
Section 316
//tank_move_wounded__02_wav (tank_move_wounded__02_wav) package { import flash.media.*; public dynamic class tank_move_wounded__02_wav extends Sound { } }//package
Section 317
//tank_move_wounded_01_wav (tank_move_wounded_01_wav) package { import flash.media.*; public dynamic class tank_move_wounded_01_wav extends Sound { } }//package
Section 318
//tank_turret_move_01_wav (tank_turret_move_01_wav) package { import flash.media.*; public dynamic class tank_turret_move_01_wav extends Sound { } }//package
Section 319
//tank_turret_move_02_wav (tank_turret_move_02_wav) package { import flash.media.*; public dynamic class tank_turret_move_02_wav extends Sound { } }//package
Section 320
//TankArrowClip (TankArrowClip) package { import flash.display.*; public dynamic class TankArrowClip extends MovieClip { } }//package
Section 321
//TankCannon (TankCannon) package { import flash.display.*; public dynamic class TankCannon extends Sprite { public var _background:MovieClip; } }//package
Section 322
//TankHull (TankHull) package { import flash.display.*; public dynamic class TankHull extends Sprite { public var _track:MovieClip; public var _background:MovieClip; } }//package
Section 323
//TeleportAnimationClip (TeleportAnimationClip) package { import flash.display.*; public dynamic class TeleportAnimationClip extends MovieClip { } }//package
Section 324
//TeleportButtonIcon (TeleportButtonIcon) package { import flash.display.*; public dynamic class TeleportButtonIcon extends Sprite { } }//package
Section 325
//TerrainView (TerrainView) package { import flash.display.*; public dynamic class TerrainView extends MovieClip { } }//package
Section 326
//TwoDPlayButtonIcon (TwoDPlayButtonIcon) package { import flash.display.*; public dynamic class TwoDPlayButtonIcon extends Sprite { } }//package
Section 327
//UpgradeScreenBackground (UpgradeScreenBackground) package { import flash.display.*; public dynamic class UpgradeScreenBackground extends Sprite { } }//package
Section 328
//UpgradeSlotBackground (UpgradeSlotBackground) package { import flash.display.*; import flash.text.*; public dynamic class UpgradeSlotBackground extends Sprite { public var priceField:TextField; public var nameField:TextField; public var amountField:TextField; public var icon:MovieClip; public var batchAmountField:TextField; } }//package
Section 329
//UrbanTexture (UrbanTexture) package { import flash.display.*; public dynamic class UrbanTexture extends BitmapData { public function UrbanTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 330
//UrbanTopTexture (UrbanTopTexture) package { import flash.display.*; public dynamic class UrbanTopTexture extends BitmapData { public function UrbanTopTexture(_arg1:Number, _arg2:Number){ super(_arg1, _arg2); } } }//package
Section 331
//vo_enemy_neutralized_01_wav (vo_enemy_neutralized_01_wav) package { import flash.media.*; public dynamic class vo_enemy_neutralized_01_wav extends Sound { } }//package
Section 332
//vo_shields_are_low_01_wav (vo_shields_are_low_01_wav) package { import flash.media.*; public dynamic class vo_shields_are_low_01_wav extends Sound { } }//package
Section 333
//vo_taking_enemy_fire_01_wav (vo_taking_enemy_fire_01_wav) package { import flash.media.*; public dynamic class vo_taking_enemy_fire_01_wav extends Sound { } }//package
Section 334
//vo_target_identified_01_wav (vo_target_identified_01_wav) package { import flash.media.*; public dynamic class vo_target_identified_01_wav extends Sound { } }//package
Section 335
//wpn_airstrike_01_wav (wpn_airstrike_01_wav) package { import flash.media.*; public dynamic class wpn_airstrike_01_wav extends Sound { } }//package
Section 336
//wpn_predstrike_01_wav (wpn_predstrike_01_wav) package { import flash.media.*; public dynamic class wpn_predstrike_01_wav extends Sound { } }//package
Section 337
//wpn_sat_communic_01_wav (wpn_sat_communic_01_wav) package { import flash.media.*; public dynamic class wpn_sat_communic_01_wav extends Sound { } }//package
Section 338
//wpn_sat_strike_01_wav (wpn_sat_strike_01_wav) package { import flash.media.*; public dynamic class wpn_sat_strike_01_wav extends Sound { } }//package
Section 339
//wpn_self_destruct_01_wav (wpn_self_destruct_01_wav) package { import flash.media.*; public dynamic class wpn_self_destruct_01_wav extends Sound { } }//package
Section 340
//wpn_spidr_bomb_walk_01_wav (wpn_spidr_bomb_walk_01_wav) package { import flash.media.*; public dynamic class wpn_spidr_bomb_walk_01_wav extends Sound { } }//package
Section 341
//wpn_teleport_01_wav (wpn_teleport_01_wav) package { import flash.media.*; public dynamic class wpn_teleport_01_wav extends Sound { } }//package
Section 342
//wpn_teleport_02_wav (wpn_teleport_02_wav) package { import flash.media.*; public dynamic class wpn_teleport_02_wav extends Sound { } }//package

Library Items

Symbol 1 ShapeTweeningUsed by:75
Symbol 2 GraphicUsed by:75
Symbol 3 SoundUsed by:75
Symbol 4 GraphicUsed by:75
Symbol 5 GraphicUsed by:75
Symbol 6 GraphicUsed by:75
Symbol 7 GraphicUsed by:75
Symbol 8 GraphicUsed by:75
Symbol 9 GraphicUsed by:75
Symbol 10 GraphicUsed by:75
Symbol 11 GraphicUsed by:75
Symbol 12 GraphicUsed by:75
Symbol 13 GraphicUsed by:75
Symbol 14 GraphicUsed by:75
Symbol 15 GraphicUsed by:75
Symbol 16 GraphicUsed by:75
Symbol 17 GraphicUsed by:75
Symbol 18 GraphicUsed by:75
Symbol 19 GraphicUsed by:75
Symbol 20 GraphicUsed by:75
Symbol 21 GraphicUsed by:75
Symbol 22 GraphicUsed by:75
Symbol 23 GraphicUsed by:75
Symbol 24 GraphicUsed by:75
Symbol 25 GraphicUsed by:75
Symbol 26 GraphicUsed by:75
Symbol 27 GraphicUsed by:75
Symbol 28 GraphicUsed by:75
Symbol 29 GraphicUsed by:75
Symbol 30 GraphicUsed by:75
Symbol 31 GraphicUsed by:75
Symbol 32 GraphicUsed by:75
Symbol 33 GraphicUsed by:75
Symbol 34 GraphicUsed by:75
Symbol 35 GraphicUsed by:75
Symbol 36 GraphicUsed by:75
Symbol 37 GraphicUsed by:75
Symbol 38 GraphicUsed by:75
Symbol 39 GraphicUsed by:75
Symbol 40 GraphicUsed by:75
Symbol 41 GraphicUsed by:75
Symbol 42 GraphicUsed by:75
Symbol 43 GraphicUsed by:75
Symbol 44 GraphicUsed by:75
Symbol 45 GraphicUsed by:75
Symbol 46 GraphicUsed by:75
Symbol 47 GraphicUsed by:75
Symbol 48 GraphicUsed by:75
Symbol 49 GraphicUsed by:75
Symbol 50 GraphicUsed by:75
Symbol 51 GraphicUsed by:75
Symbol 52 GraphicUsed by:75
Symbol 53 GraphicUsed by:75
Symbol 54 GraphicUsed by:75
Symbol 55 GraphicUsed by:75
Symbol 56 GraphicUsed by:75
Symbol 57 GraphicUsed by:75
Symbol 58 GraphicUsed by:75
Symbol 59 SoundUsed by:75
Symbol 60 GraphicUsed by:75
Symbol 61 GraphicUsed by:75
Symbol 62 ShapeTweeningUsed by:75
Symbol 63 GraphicUsed by:75
Symbol 64 GraphicUsed by:75
Symbol 65 SoundUsed by:75
Symbol 66 GraphicUsed by:75
Symbol 67 SoundUsed by:75
Symbol 68 GraphicUsed by:75
Symbol 69 GraphicUsed by:75
Symbol 70 GraphicUsed by:75
Symbol 71 GraphicUsed by:75
Symbol 72 GraphicUsed by:75
Symbol 73 SoundUsed by:75
Symbol 74 GraphicUsed by:75
Symbol 75 MovieClipUses:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74Used by:82
Symbol 76 GraphicUsed by:81
Symbol 77 GraphicUsed by:78
Symbol 78 MovieClipUses:77Used by:81
Symbol 79 GraphicUsed by:81
Symbol 80 GraphicUsed by:81
Symbol 81 MovieClip {Preloader_2DPlay_fla.preloader_progress_bar_4} [Preloader_2DPlay_fla.preloader_progress_bar_4]Uses:76 78 79 80Used by:82
Symbol 82 MovieClip {Preloader_2DPlay_fla.logo_2} [Preloader_2DPlay_fla.logo_2]Uses:75 81Used by:83
Symbol 83 MovieClip {com.bigwigmedia.preloaders.Preloader_2DPlay} [com.bigwigmedia.preloaders.Preloader_2DPlay]Uses:82
Symbol 84 Font {Font_1} [Font_1]
Symbol 85 GraphicUsed by:90
Symbol 86 BitmapUsed by:87
Symbol 87 GraphicUses:86Used by:90
Symbol 88 BitmapUsed by:89
Symbol 89 GraphicUses:88Used by:90
Symbol 90 MovieClip {PanelsOverlayAnimation} [PanelsOverlayAnimation]Uses:85 87 89
Symbol 91 Sound {menu_click_02_wav} [menu_click_02_wav]
Symbol 92 Sound {eqp_forcefield_01_wav} [eqp_forcefield_01_wav]
Symbol 93 Sound {menu_click_01_wav} [menu_click_01_wav]
Symbol 94 Sound {wpn_self_destruct_01_wav} [wpn_self_destruct_01_wav]
Symbol 95 BitmapUsed by:96
Symbol 96 GraphicUses:95Used by:97
Symbol 97 MovieClip {CheckBoxIcon} [CheckBoxIcon]Uses:96
Symbol 98 Sound {blast_doors_open_01_wav} [blast_doors_open_01_wav]
Symbol 99 Sound {env_wind_light_01_wav} [env_wind_light_01_wav]
Symbol 100 Sound {explosn_med_02_wav} [explosn_med_02_wav]
Symbol 101 Sound {explosn_fire_bomb_01_wav} [explosn_fire_bomb_01_wav]
Symbol 102 BitmapUsed by:103
Symbol 103 GraphicUses:102Used by:104
Symbol 104 MovieClip {RadioButtonSelectedIcon} [RadioButtonSelectedIcon]Uses:103
Symbol 105 Sound {wpn_teleport_02_wav} [wpn_teleport_02_wav]
Symbol 106 Sound {vo_shields_are_low_01_wav} [vo_shields_are_low_01_wav]
Symbol 107 BitmapUsed by:108
Symbol 108 GraphicUses:107Used by:109
Symbol 109 MovieClip {RadioButtonIcon} [RadioButtonIcon]Uses:108
Symbol 110 Sound {vo_taking_enemy_fire_01_wav} [vo_taking_enemy_fire_01_wav]
Symbol 111 Sound {wpn_predstrike_01_wav} [wpn_predstrike_01_wav]
Symbol 112 Sound {tank_move_wounded__02_wav} [tank_move_wounded__02_wav]
Symbol 113 Sound {tank_turret_move_02_wav} [tank_turret_move_02_wav]
Symbol 114 Sound {wpn_airstrike_01_wav} [wpn_airstrike_01_wav]
Symbol 115 Sound {wpn_spidr_bomb_walk_01_wav} [wpn_spidr_bomb_walk_01_wav]
Symbol 116 Sound {explosn_lrg_01_wav} [explosn_lrg_01_wav]
Symbol 117 Sound {tank_move_01_wav} [tank_move_01_wav]
Symbol 118 Sound {blast_doors_close_01_wav} [blast_doors_close_01_wav]
Symbol 119 Sound {emp_fizzle_01_wav} [emp_fizzle_01_wav]
Symbol 120 Sound {menu_click_03_wav} [menu_click_03_wav]
Symbol 121 Sound {eqp_repair_01_wav} [eqp_repair_01_wav]
Symbol 122 Sound {wpn_teleport_01_wav} [wpn_teleport_01_wav]
Symbol 123 Sound {explosn_med_01_wav} [explosn_med_01_wav]
Symbol 124 Sound {vo_enemy_neutralized_01_wav} [vo_enemy_neutralized_01_wav]
Symbol 125 Sound {explosn_atomic_01_wav} [explosn_atomic_01_wav]
Symbol 126 Sound {blast_doors_01_wav} [blast_doors_01_wav]
Symbol 127 Sound {eqp_parachute_00_wav} [eqp_parachute_00_wav]
Symbol 128 Sound {tank_mg_fire_01_wav} [tank_mg_fire_01_wav]
Symbol 129 Sound {tank_fire_01_wav} [tank_fire_01_wav]
Symbol 130 Sound {tank_turret_move_01_wav} [tank_turret_move_01_wav]
Symbol 131 Sound {explosn_atomic_02_wav} [explosn_atomic_02_wav]
Symbol 132 Sound {tank_move_wounded_01_wav} [tank_move_wounded_01_wav]
Symbol 133 BitmapUsed by:134
Symbol 134 GraphicUses:133Used by:135
Symbol 135 MovieClip {CheckBoxSelectedIcon} [CheckBoxSelectedIcon]Uses:134
Symbol 136 Sound {explosn_sm_01_wav} [explosn_sm_01_wav]
Symbol 137 Sound {explosn_emp_01_wav} [explosn_emp_01_wav]
Symbol 138 Sound {wpn_sat_strike_01_wav} [wpn_sat_strike_01_wav]
Symbol 139 Sound {tank_move_03_wav} [tank_move_03_wav]
Symbol 140 Sound {env_wind_hard_01_wav} [env_wind_hard_01_wav]
Symbol 141 Sound {vo_target_identified_01_wav} [vo_target_identified_01_wav]
Symbol 142 Sound {explosn_sm_02_wav} [explosn_sm_02_wav]
Symbol 143 Sound {wpn_sat_communic_01_wav} [wpn_sat_communic_01_wav]
Symbol 144 Sound {env_wind_med_01_wav} [env_wind_med_01_wav]
Symbol 145 BitmapUsed by:146
Symbol 146 GraphicUses:145Used by:149
Symbol 147 FontUsed by:148 173 332 350
Symbol 148 TextUses:147Used by:149
Symbol 149 MovieClip {CampaignLostViewBackground} [CampaignLostViewBackground]Uses:146 148
Symbol 150 GraphicUsed by:151
Symbol 151 MovieClip {TwoDPlayButtonIcon} [TwoDPlayButtonIcon]Uses:150
Symbol 152 BitmapUsed by:154
Symbol 153 BitmapUsed by:154 169
Symbol 154 GraphicUses:152 153Used by:155
Symbol 155 MovieClip {CampaignPlayerSelectionViewBackground} [CampaignPlayerSelectionViewBackground]Uses:154
Symbol 156 BitmapUsed by:157
Symbol 157 GraphicUses:156Used by:158
Symbol 158 MovieClip {InstructionsBackground} [InstructionsBackground]Uses:157
Symbol 159 Bitmap {UrbanTexture} [UrbanTexture]
Symbol 160 Bitmap {UrbanTopTexture} [UrbanTopTexture]
Symbol 161 Bitmap {RockyTexture} [RockyTexture]
Symbol 162 Bitmap {AlpineTexture} [AlpineTexture]
Symbol 163 Bitmap {RockyTopTexture} [RockyTopTexture]
Symbol 164 Bitmap {AlpineTopTexture} [AlpineTopTexture]
Symbol 165 Bitmap {DesertTexture} [DesertTexture]
Symbol 166 Bitmap {DesertTopTexture} [DesertTopTexture]
Symbol 167 Bitmap {ForestTopTexture} [ForestTopTexture]
Symbol 168 Bitmap {ForestTexture} [ForestTexture]
Symbol 169 GraphicUses:153Used by:170 238 346
Symbol 170 MovieClip {UpgradeScreenBackground} [UpgradeScreenBackground]Uses:169
Symbol 171 BitmapUsed by:172
Symbol 172 GraphicUses:171Used by:182 351
Symbol 173 TextUses:147Used by:182
Symbol 174 BitmapUsed by:175
Symbol 175 GraphicUses:174Used by:182
Symbol 176 FontUsed by:177 178 179 180 181
Symbol 177 TextUses:176Used by:182
Symbol 178 TextUses:176Used by:182
Symbol 179 TextUses:176Used by:182
Symbol 180 TextUses:176Used by:182
Symbol 181 TextUses:176Used by:182
Symbol 182 MovieClip {DeathmatchCompletedViewBackground} [DeathmatchCompletedViewBackground]Uses:172 173 175 177 178 179 180 181
Symbol 183 BitmapUsed by:184
Symbol 184 GraphicUses:183Used by:237
Symbol 185 BitmapUsed by:186
Symbol 186 GraphicUses:185Used by:231
Symbol 187 BitmapUsed by:188
Symbol 188 GraphicUses:187Used by:231
Symbol 189 BitmapUsed by:190
Symbol 190 GraphicUses:189Used by:231
Symbol 191 BitmapUsed by:192
Symbol 192 GraphicUses:191Used by:231
Symbol 193 BitmapUsed by:194
Symbol 194 GraphicUses:193Used by:231
Symbol 195 BitmapUsed by:196
Symbol 196 GraphicUses:195Used by:231
Symbol 197 BitmapUsed by:198
Symbol 198 GraphicUses:197Used by:231
Symbol 199 BitmapUsed by:200
Symbol 200 GraphicUses:199Used by:231
Symbol 201 BitmapUsed by:202
Symbol 202 GraphicUses:201Used by:231
Symbol 203 BitmapUsed by:204
Symbol 204 GraphicUses:203Used by:231
Symbol 205 BitmapUsed by:206
Symbol 206 GraphicUses:205Used by:231
Symbol 207 BitmapUsed by:208
Symbol 208 GraphicUses:207Used by:231
Symbol 209 BitmapUsed by:210
Symbol 210 GraphicUses:209Used by:231
Symbol 211 BitmapUsed by:212
Symbol 212 GraphicUses:211Used by:231
Symbol 213 BitmapUsed by:214
Symbol 214 GraphicUses:213Used by:231
Symbol 215 BitmapUsed by:216
Symbol 216 GraphicUses:215Used by:231
Symbol 217 BitmapUsed by:218
Symbol 218 GraphicUses:217Used by:231
Symbol 219 BitmapUsed by:220
Symbol 220 GraphicUses:219Used by:231
Symbol 221 BitmapUsed by:222
Symbol 222 GraphicUses:221Used by:231
Symbol 223 BitmapUsed by:224
Symbol 224 GraphicUses:223Used by:231
Symbol 225 BitmapUsed by:226
Symbol 226 GraphicUses:225Used by:231
Symbol 227 BitmapUsed by:228
Symbol 228 GraphicUses:227Used by:231
Symbol 229 BitmapUsed by:230
Symbol 230 GraphicUses:229Used by:231
Symbol 231 MovieClipUses:186 188 190 192 194 196 198 200 202 204 206 208 210 212 214 216 218 220 222 224 226 228 230Used by:237 555
Symbol 232 FontUsed by:233 234 235 236 537 538 549 550
Symbol 233 EditableTextUses:232Used by:237
Symbol 234 EditableTextUses:232Used by:237 555
Symbol 235 EditableTextUses:232Used by:237
Symbol 236 EditableTextUses:232Used by:237
Symbol 237 MovieClip {UpgradeSlotBackground} [UpgradeSlotBackground]Uses:184 231 233 234 235 236
Symbol 238 MovieClip {SplashMenuViewBackground} [SplashMenuViewBackground]Uses:169
Symbol 239 BitmapUsed by:240
Symbol 240 GraphicUses:239Used by:249
Symbol 241 BitmapUsed by:242
Symbol 242 GraphicUses:241Used by:249
Symbol 243 BitmapUsed by:244
Symbol 244 GraphicUses:243Used by:249
Symbol 245 BitmapUsed by:246
Symbol 246 GraphicUses:245Used by:249
Symbol 247 BitmapUsed by:248
Symbol 248 GraphicUses:247Used by:249
Symbol 249 MovieClip {LevelBackground} [LevelBackground]Uses:240 242 244 246 248
Symbol 250 BitmapUsed by:251
Symbol 251 GraphicUses:250Used by:268
Symbol 252 BitmapUsed by:253
Symbol 253 GraphicUses:252Used by:268
Symbol 254 BitmapUsed by:255
Symbol 255 GraphicUses:254Used by:268
Symbol 256 BitmapUsed by:257
Symbol 257 GraphicUses:256Used by:268
Symbol 258 BitmapUsed by:259
Symbol 259 GraphicUses:258Used by:268
Symbol 260 BitmapUsed by:261
Symbol 261 GraphicUses:260Used by:268
Symbol 262 BitmapUsed by:263
Symbol 263 GraphicUses:262Used by:268
Symbol 264 BitmapUsed by:265
Symbol 265 GraphicUses:264Used by:268
Symbol 266 BitmapUsed by:267
Symbol 267 GraphicUses:266Used by:268
Symbol 268 MovieClip {DamageSmokeClip} [DamageSmokeClip]Uses:251 253 255 257 259 261 263 265 267
Symbol 269 BitmapUsed by:270
Symbol 270 GraphicUses:269Used by:279
Symbol 271 BitmapUsed by:272
Symbol 272 GraphicUses:271Used by:279
Symbol 273 BitmapUsed by:274
Symbol 274 GraphicUses:273Used by:279
Symbol 275 BitmapUsed by:276
Symbol 276 GraphicUses:275Used by:279
Symbol 277 BitmapUsed by:278
Symbol 278 GraphicUses:277Used by:279
Symbol 279 MovieClip {DamageFireClip} [DamageFireClip]Uses:270 272 274 276 278
Symbol 280 BitmapUsed by:281
Symbol 281 GraphicUses:280Used by:312
Symbol 282 BitmapUsed by:283
Symbol 283 GraphicUses:282Used by:312
Symbol 284 BitmapUsed by:285
Symbol 285 GraphicUses:284Used by:312
Symbol 286 BitmapUsed by:287
Symbol 287 GraphicUses:286Used by:312
Symbol 288 BitmapUsed by:289
Symbol 289 GraphicUses:288Used by:312
Symbol 290 BitmapUsed by:291
Symbol 291 GraphicUses:290Used by:312
Symbol 292 BitmapUsed by:293
Symbol 293 GraphicUses:292Used by:312
Symbol 294 BitmapUsed by:295
Symbol 295 GraphicUses:294Used by:312
Symbol 296 BitmapUsed by:297
Symbol 297 GraphicUses:296Used by:312
Symbol 298 BitmapUsed by:299
Symbol 299 GraphicUses:298Used by:312
Symbol 300 BitmapUsed by:301
Symbol 301 GraphicUses:300Used by:312
Symbol 302 BitmapUsed by:303
Symbol 303 GraphicUses:302Used by:312
Symbol 304 BitmapUsed by:305
Symbol 305 GraphicUses:304Used by:312
Symbol 306 BitmapUsed by:307
Symbol 307 GraphicUses:306Used by:312
Symbol 308 BitmapUsed by:309
Symbol 309 GraphicUses:308Used by:312
Symbol 310 BitmapUsed by:311
Symbol 311 GraphicUses:310Used by:312
Symbol 312 MovieClip {MediumExplosionClip} [MediumExplosionClip]Uses:281 283 285 287 289 291 293 295 297 299 301 303 305 307 309 311
Symbol 313 GraphicUsed by:316
Symbol 314 GraphicUsed by:316
Symbol 315 GraphicUsed by:316
Symbol 316 MovieClip {ExplosionEffect} [ExplosionEffect]Uses:313 314 315
Symbol 317 BitmapUsed by:318 530
Symbol 318 GraphicUses:317Used by:319
Symbol 319 MovieClip {TankArrowClip} [TankArrowClip]Uses:318
Symbol 320 GraphicUsed by:333
Symbol 321 BitmapUsed by:322
Symbol 322 GraphicUses:321Used by:333
Symbol 323 BitmapUsed by:324
Symbol 324 GraphicUses:323Used by:333
Symbol 325 BitmapUsed by:326
Symbol 326 GraphicUses:325Used by:333
Symbol 327 BitmapUsed by:328
Symbol 328 GraphicUses:327Used by:333
Symbol 329 BitmapUsed by:330
Symbol 330 GraphicUses:329Used by:333
Symbol 331 GraphicUsed by:333
Symbol 332 TextUses:147Used by:333
Symbol 333 MovieClip {TerrainView} [TerrainView]Uses:320 322 324 326 328 330 331 332
Symbol 334 BitmapUsed by:335
Symbol 335 GraphicUses:334Used by:336
Symbol 336 MovieClip {MinusButtonOverIcon} [MinusButtonOverIcon]Uses:335
Symbol 337 BitmapUsed by:338
Symbol 338 GraphicUses:337Used by:339
Symbol 339 MovieClip {MinusButtonUpIcon} [MinusButtonUpIcon]Uses:338
Symbol 340 BitmapUsed by:341
Symbol 341 GraphicUses:340Used by:342
Symbol 342 MovieClip {PlusButtonOverIcon} [PlusButtonOverIcon]Uses:341
Symbol 343 BitmapUsed by:344
Symbol 344 GraphicUses:343Used by:345
Symbol 345 MovieClipUses:344Used by:346
Symbol 346 MovieClip {DeathmatchPlayerSelectionViewBackground} [DeathmatchPlayerSelectionViewBackground]Uses:169 345
Symbol 347 BitmapUsed by:348
Symbol 348 GraphicUses:347Used by:349
Symbol 349 MovieClip {PlusButtonUpIcon} [PlusButtonUpIcon]Uses:348
Symbol 350 TextUses:147Used by:351
Symbol 351 MovieClip {CampaignWonViewBackground} [CampaignWonViewBackground]Uses:172 350
Symbol 352 BitmapUsed by:353
Symbol 353 GraphicUses:352Used by:360
Symbol 354 BitmapUsed by:355
Symbol 355 GraphicUses:354Used by:360
Symbol 356 BitmapUsed by:357
Symbol 357 GraphicUses:356Used by:360
Symbol 358 BitmapUsed by:359
Symbol 359 GraphicUses:358Used by:360
Symbol 360 MovieClip {FireEffect} [FireEffect]Uses:353 355 357 359
Symbol 361 BitmapUsed by:362
Symbol 362 GraphicUses:361Used by:363 388
Symbol 363 MovieClip {ShieldClip} [ShieldClip]Uses:362
Symbol 364 BitmapUsed by:365
Symbol 365 GraphicUses:364Used by:388
Symbol 366 BitmapUsed by:367
Symbol 367 GraphicUses:366Used by:388
Symbol 368 BitmapUsed by:369
Symbol 369 GraphicUses:368Used by:388
Symbol 370 BitmapUsed by:371
Symbol 371 GraphicUses:370Used by:388
Symbol 372 BitmapUsed by:373
Symbol 373 GraphicUses:372Used by:388
Symbol 374 BitmapUsed by:375
Symbol 375 GraphicUses:374Used by:388
Symbol 376 BitmapUsed by:377
Symbol 377 GraphicUses:376Used by:388
Symbol 378 BitmapUsed by:379
Symbol 379 GraphicUses:378Used by:388
Symbol 380 BitmapUsed by:381
Symbol 381 GraphicUses:380Used by:388
Symbol 382 BitmapUsed by:383
Symbol 383 GraphicUses:382Used by:388
Symbol 384 BitmapUsed by:385
Symbol 385 GraphicUses:384Used by:388
Symbol 386 BitmapUsed by:387
Symbol 387 GraphicUses:386Used by:388
Symbol 388 MovieClip {ShieldActivatingClip} [ShieldActivatingClip]Uses:365 367 369 371 373 375 377 379 381 383 385 362 387
Symbol 389 GraphicUsed by:390
Symbol 390 MovieClip {ParachutesClip} [ParachutesClip]Uses:389
Symbol 391 BitmapUsed by:392
Symbol 392 GraphicUses:391Used by:393
Symbol 393 MovieClipUses:392Used by:396
Symbol 394 BitmapUsed by:395
Symbol 395 GraphicUses:394Used by:396
Symbol 396 MovieClip {TankCannon} [TankCannon]Uses:393 395
Symbol 397 BitmapUsed by:398
Symbol 398 GraphicUses:397Used by:399
Symbol 399 MovieClipUses:398Used by:409
Symbol 400 BitmapUsed by:401
Symbol 401 GraphicUses:400Used by:409
Symbol 402 BitmapUsed by:403
Symbol 403 GraphicUses:402Used by:408
Symbol 404 BitmapUsed by:405
Symbol 405 GraphicUses:404Used by:408
Symbol 406 BitmapUsed by:407
Symbol 407 GraphicUses:406Used by:408
Symbol 408 MovieClipUses:403 405 407Used by:409
Symbol 409 MovieClip {TankHull} [TankHull]Uses:399 401 408
Symbol 410 BitmapUsed by:411
Symbol 411 GraphicUses:410Used by:412
Symbol 412 MovieClip {PopCornBombSprite} [PopCornBombSprite]Uses:411
Symbol 413 BitmapUsed by:414
Symbol 414 GraphicUses:413Used by:415
Symbol 415 MovieClip {StandardShellSprite} [StandardShellSprite]Uses:414
Symbol 416 BitmapUsed by:417
Symbol 417 GraphicUses:416Used by:430
Symbol 418 BitmapUsed by:419
Symbol 419 GraphicUses:418Used by:430
Symbol 420 BitmapUsed by:421
Symbol 421 GraphicUses:420Used by:430
Symbol 422 BitmapUsed by:423
Symbol 423 GraphicUses:422Used by:430
Symbol 424 BitmapUsed by:425
Symbol 425 GraphicUses:424Used by:430
Symbol 426 BitmapUsed by:427
Symbol 427 GraphicUses:426Used by:430
Symbol 428 BitmapUsed by:429
Symbol 429 GraphicUses:428Used by:430
Symbol 430 MovieClip {SmallExplosionClip} [SmallExplosionClip]Uses:417 419 421 423 425 427 429
Symbol 431 BitmapUsed by:432
Symbol 432 GraphicUses:431Used by:433
Symbol 433 MovieClip {AtomBombSprite} [AtomBombSprite]Uses:432
Symbol 434 BitmapUsed by:435
Symbol 435 GraphicUses:434Used by:466
Symbol 436 BitmapUsed by:437
Symbol 437 GraphicUses:436Used by:466
Symbol 438 BitmapUsed by:439
Symbol 439 GraphicUses:438Used by:466
Symbol 440 BitmapUsed by:441
Symbol 441 GraphicUses:440Used by:466
Symbol 442 BitmapUsed by:443
Symbol 443 GraphicUses:442Used by:466
Symbol 444 BitmapUsed by:445
Symbol 445 GraphicUses:444Used by:466
Symbol 446 BitmapUsed by:447
Symbol 447 GraphicUses:446Used by:466
Symbol 448 BitmapUsed by:449
Symbol 449 GraphicUses:448Used by:466
Symbol 450 BitmapUsed by:451
Symbol 451 GraphicUses:450Used by:466
Symbol 452 BitmapUsed by:453
Symbol 453 GraphicUses:452Used by:466
Symbol 454 BitmapUsed by:455
Symbol 455 GraphicUses:454Used by:466
Symbol 456 BitmapUsed by:457
Symbol 457 GraphicUses:456Used by:466
Symbol 458 BitmapUsed by:459
Symbol 459 GraphicUses:458Used by:466
Symbol 460 BitmapUsed by:461
Symbol 461 GraphicUses:460Used by:466
Symbol 462 BitmapUsed by:463
Symbol 463 GraphicUses:462Used by:466
Symbol 464 BitmapUsed by:465
Symbol 465 GraphicUses:464Used by:466
Symbol 466 MovieClip {FireExplosionAnimation} [FireExplosionAnimation]Uses:435 437 439 441 443 445 447 449 451 453 455 457 459 461 463 465
Symbol 467 BitmapUsed by:468
Symbol 468 GraphicUses:467Used by:469
Symbol 469 MovieClip {IncendiaryShellSprite} [IncendiaryShellSprite]Uses:468
Symbol 470 BitmapUsed by:471
Symbol 471 GraphicUses:470Used by:512
Symbol 472 BitmapUsed by:473
Symbol 473 GraphicUses:472Used by:512
Symbol 474 BitmapUsed by:475
Symbol 475 GraphicUses:474Used by:512
Symbol 476 BitmapUsed by:477
Symbol 477 GraphicUses:476Used by:512
Symbol 478 BitmapUsed by:479
Symbol 479 GraphicUses:478Used by:512
Symbol 480 BitmapUsed by:481
Symbol 481 GraphicUses:480Used by:512
Symbol 482 BitmapUsed by:483
Symbol 483 GraphicUses:482Used by:512
Symbol 484 BitmapUsed by:485
Symbol 485 GraphicUses:484Used by:512
Symbol 486 BitmapUsed by:487
Symbol 487 GraphicUses:486Used by:512
Symbol 488 BitmapUsed by:489
Symbol 489 GraphicUses:488Used by:512
Symbol 490 BitmapUsed by:491
Symbol 491 GraphicUses:490Used by:512
Symbol 492 BitmapUsed by:493
Symbol 493 GraphicUses:492Used by:512
Symbol 494 BitmapUsed by:495
Symbol 495 GraphicUses:494Used by:512
Symbol 496 BitmapUsed by:497
Symbol 497 GraphicUses:496Used by:512
Symbol 498 BitmapUsed by:499
Symbol 499 GraphicUses:498Used by:512
Symbol 500 BitmapUsed by:501
Symbol 501 GraphicUses:500Used by:512
Symbol 502 BitmapUsed by:503
Symbol 503 GraphicUses:502Used by:512
Symbol 504 BitmapUsed by:505
Symbol 505 GraphicUses:504Used by:512
Symbol 506 BitmapUsed by:507
Symbol 507 GraphicUses:506Used by:512
Symbol 508 BitmapUsed by:509
Symbol 509 GraphicUses:508Used by:512
Symbol 510 BitmapUsed by:511
Symbol 511 GraphicUses:510Used by:512
Symbol 512 MovieClip {AtomExplosionClip} [AtomExplosionClip]Uses:471 473 475 477 479 481 483 485 487 489 491 493 495 497 499 501 503 505 507 509 511
Symbol 513 BitmapUsed by:514
Symbol 514 GraphicUses:513Used by:521
Symbol 515 BitmapUsed by:516
Symbol 516 GraphicUses:515Used by:521
Symbol 517 BitmapUsed by:518
Symbol 518 GraphicUses:517Used by:521
Symbol 519 BitmapUsed by:520
Symbol 520 GraphicUses:519Used by:521
Symbol 521 MovieClip {SpiderBombClip} [SpiderBombClip]Uses:514 516 518 520
Symbol 522 BitmapUsed by:523
Symbol 523 GraphicUses:522Used by:524
Symbol 524 MovieClip {PauseMenuBackground} [PauseMenuBackground]Uses:523
Symbol 525 BitmapUsed by:526
Symbol 526 GraphicUses:525Used by:529
Symbol 527 BitmapUsed by:528
Symbol 528 GraphicUses:527Used by:529
Symbol 529 MovieClip {AirStrikeCursorClip} [AirStrikeCursorClip]Uses:526 528
Symbol 530 GraphicUses:317Used by:531
Symbol 531 MovieClip {SatelliteStrikeCursorClip} [SatelliteStrikeCursorClip]Uses:530
Symbol 532 BitmapUsed by:533
Symbol 533 GraphicUses:532Used by:534
Symbol 534 MovieClip {ArrowRightOverIcon} [ArrowRightOverIcon]Uses:533
Symbol 535 BitmapUsed by:536
Symbol 536 GraphicUses:535Used by:555
Symbol 537 EditableTextUses:232Used by:555
Symbol 538 EditableTextUses:232Used by:555
Symbol 539 BitmapUsed by:540
Symbol 540 GraphicUses:539Used by:541
Symbol 541 MovieClipUses:540Used by:555
Symbol 542 BitmapUsed by:543
Symbol 543 GraphicUses:542Used by:555
Symbol 544 BitmapUsed by:545
Symbol 545 GraphicUses:544Used by:546
Symbol 546 MovieClipUses:545Used by:555
Symbol 547 GraphicUsed by:548
Symbol 548 MovieClipUses:547Used by:555
Symbol 549 EditableTextUses:232Used by:555
Symbol 550 EditableTextUses:232Used by:555
Symbol 551 GraphicUsed by:554
Symbol 552 GraphicUsed by:553
Symbol 553 MovieClipUses:552Used by:554
Symbol 554 MovieClip {graphics_fla.MaxFirePowerIndicator_60} [graphics_fla.MaxFirePowerIndicator_60]Uses:551 553Used by:555
Symbol 555 MovieClip {HUDBackground} [HUDBackground]Uses:536 234 537 538 541 543 546 231 548 549 550 554
Symbol 556 BitmapUsed by:557
Symbol 557 GraphicUses:556Used by:558
Symbol 558 MovieClip {TeleportButtonIcon} [TeleportButtonIcon]Uses:557
Symbol 559 BitmapUsed by:560
Symbol 560 GraphicUses:559Used by:561
Symbol 561 MovieClip {PauseButtonOverIcon} [PauseButtonOverIcon]Uses:560
Symbol 562 BitmapUsed by:563
Symbol 563 GraphicUses:562Used by:564
Symbol 564 MovieClip {FireButtonOverIcon} [FireButtonOverIcon]Uses:563
Symbol 565 BitmapUsed by:566
Symbol 566 GraphicUses:565Used by:567
Symbol 567 MovieClip {ArrowRightUpIcon} [ArrowRightUpIcon]Uses:566
Symbol 568 BitmapUsed by:569
Symbol 569 GraphicUses:568Used by:570
Symbol 570 MovieClip {RepairButtonIcon} [RepairButtonIcon]Uses:569
Symbol 571 BitmapUsed by:572
Symbol 572 GraphicUses:571Used by:573
Symbol 573 MovieClip {FireButtonUpIcon} [FireButtonUpIcon]Uses:572
Symbol 574 BitmapUsed by:575
Symbol 575 GraphicUses:574Used by:576
Symbol 576 MovieClip {PauseButtonUpIcon} [PauseButtonUpIcon]Uses:575
Symbol 577 BitmapUsed by:578
Symbol 578 GraphicUses:577Used by:579
Symbol 579 MovieClip {ArrowLeftOverIcon} [ArrowLeftOverIcon]Uses:578
Symbol 580 BitmapUsed by:581
Symbol 581 GraphicUses:580Used by:582
Symbol 582 MovieClip {ShieldButtonIcon} [ShieldButtonIcon]Uses:581
Symbol 583 BitmapUsed by:584
Symbol 584 GraphicUses:583Used by:585
Symbol 585 MovieClip {ParachuteButtonIcon} [ParachuteButtonIcon]Uses:584
Symbol 586 BitmapUsed by:587
Symbol 587 GraphicUses:586Used by:588
Symbol 588 MovieClip {ArrowLeftUpIcon} [ArrowLeftUpIcon]Uses:587
Symbol 589 BitmapUsed by:590
Symbol 590 GraphicUses:589Used by:591
Symbol 591 MovieClip {AirStrikeShuttleSprite} [AirStrikeShuttleSprite]Uses:590
Symbol 592 BitmapUsed by:593
Symbol 593 GraphicUses:592Used by:604
Symbol 594 BitmapUsed by:595
Symbol 595 GraphicUses:594Used by:604
Symbol 596 BitmapUsed by:597
Symbol 597 GraphicUses:596Used by:604
Symbol 598 BitmapUsed by:599
Symbol 599 GraphicUses:598Used by:604
Symbol 600 BitmapUsed by:601
Symbol 601 GraphicUses:600Used by:604
Symbol 602 BitmapUsed by:603
Symbol 603 GraphicUses:602Used by:604
Symbol 604 MovieClip {SatelliteStrikeSprite} [SatelliteStrikeSprite]Uses:593 595 597 599 601 603
Symbol 605 BitmapUsed by:606
Symbol 606 GraphicUses:605Used by:639
Symbol 607 BitmapUsed by:608
Symbol 608 GraphicUses:607Used by:639
Symbol 609 BitmapUsed by:610
Symbol 610 GraphicUses:609Used by:639
Symbol 611 BitmapUsed by:612
Symbol 612 GraphicUses:611Used by:639
Symbol 613 BitmapUsed by:614
Symbol 614 GraphicUses:613Used by:639
Symbol 615 BitmapUsed by:616
Symbol 616 GraphicUses:615Used by:639
Symbol 617 BitmapUsed by:618
Symbol 618 GraphicUses:617Used by:639
Symbol 619 BitmapUsed by:620
Symbol 620 GraphicUses:619Used by:639
Symbol 621 BitmapUsed by:622
Symbol 622 GraphicUses:621Used by:639
Symbol 623 BitmapUsed by:624
Symbol 624 GraphicUses:623Used by:639
Symbol 625 BitmapUsed by:626
Symbol 626 GraphicUses:625Used by:639
Symbol 627 BitmapUsed by:628
Symbol 628 GraphicUses:627Used by:639
Symbol 629 BitmapUsed by:630
Symbol 630 GraphicUses:629Used by:639
Symbol 631 BitmapUsed by:632
Symbol 632 GraphicUses:631Used by:639
Symbol 633 BitmapUsed by:634
Symbol 634 GraphicUses:633Used by:639
Symbol 635 BitmapUsed by:636
Symbol 636 GraphicUses:635Used by:639
Symbol 637 BitmapUsed by:638
Symbol 638 GraphicUses:637Used by:639
Symbol 639 MovieClip {BigExplosionClip} [BigExplosionClip]Uses:606 608 610 612 614 616 618 620 622 624 626 628 630 632 634 636 638
Symbol 640 BitmapUsed by:641 666
Symbol 641 GraphicUses:640Used by:667
Symbol 642 BitmapUsed by:643
Symbol 643 GraphicUses:642Used by:667
Symbol 644 BitmapUsed by:645
Symbol 645 GraphicUses:644Used by:667
Symbol 646 BitmapUsed by:647
Symbol 647 GraphicUses:646Used by:667
Symbol 648 BitmapUsed by:649
Symbol 649 GraphicUses:648Used by:667
Symbol 650 BitmapUsed by:651
Symbol 651 GraphicUses:650Used by:667
Symbol 652 BitmapUsed by:653
Symbol 653 GraphicUses:652Used by:667
Symbol 654 BitmapUsed by:655
Symbol 655 GraphicUses:654Used by:667
Symbol 656 BitmapUsed by:657
Symbol 657 GraphicUses:656Used by:667
Symbol 658 BitmapUsed by:659
Symbol 659 GraphicUses:658Used by:667
Symbol 660 BitmapUsed by:661
Symbol 661 GraphicUses:660Used by:667
Symbol 662 BitmapUsed by:663
Symbol 663 GraphicUses:662Used by:667
Symbol 664 BitmapUsed by:665
Symbol 665 GraphicUses:664Used by:667
Symbol 666 GraphicUses:640Used by:667
Symbol 667 MovieClip {TeleportAnimationClip} [TeleportAnimationClip]Uses:641 643 645 647 649 651 653 655 657 659 661 663 665 666
Symbol 668 BitmapUsed by:669
Symbol 669 GraphicUses:668Used by:670
Symbol 670 MovieClip {NewPlayerPopupBackground} [NewPlayerPopupBackground]Uses:669
Symbol 671 BitmapUsed by:672
Symbol 672 GraphicUses:671Used by:673
Symbol 673 MovieClip {PlayerInfoPanelBackground} [PlayerInfoPanelBackground]Uses:672
Symbol 674 BitmapUsed by:675
Symbol 675 GraphicUses:674Used by:676
Symbol 676 MovieClip {CannonSliderThumbIcon} [CannonSliderThumbIcon]Uses:675
Symbol 677 BitmapUsed by:678
Symbol 678 GraphicUses:677Used by:679
Symbol 679 MovieClip {FirePowerSliderThumbIcon} [FirePowerSliderThumbIcon]Uses:678
Symbol 680 BitmapUsed by:681
Symbol 681 GraphicUses:680Used by:686
Symbol 682 BitmapUsed by:683
Symbol 683 GraphicUses:682Used by:686
Symbol 684 BitmapUsed by:685
Symbol 685 GraphicUses:684Used by:686
Symbol 686 MovieClipUses:681 683 685Used by:687
Symbol 687 MovieClip {AirStrikeRocketSprite} [AirStrikeRocketSprite]Uses:686
Symbol 688 BinaryData {tanks2.managers.ConfigManager_configXMLClass}

Instance Names

"progressBarMask"Symbol 81 MovieClip {Preloader_2DPlay_fla.preloader_progress_bar_4} [Preloader_2DPlay_fla.preloader_progress_bar_4] Frame 1Symbol 78 MovieClip
"animation"Symbol 82 MovieClip {Preloader_2DPlay_fla.logo_2} [Preloader_2DPlay_fla.logo_2] Frame 1Symbol 75 MovieClip
"progressBar"Symbol 82 MovieClip {Preloader_2DPlay_fla.logo_2} [Preloader_2DPlay_fla.logo_2] Frame 1Symbol 81 MovieClip {Preloader_2DPlay_fla.preloader_progress_bar_4} [Preloader_2DPlay_fla.preloader_progress_bar_4]
"_logo"Symbol 83 MovieClip {com.bigwigmedia.preloaders.Preloader_2DPlay} [com.bigwigmedia.preloaders.Preloader_2DPlay] Frame 1Symbol 82 MovieClip {Preloader_2DPlay_fla.logo_2} [Preloader_2DPlay_fla.logo_2]
"icon"Symbol 237 MovieClip {UpgradeSlotBackground} [UpgradeSlotBackground] Frame 1Symbol 231 MovieClip
"nameField"Symbol 237 MovieClip {UpgradeSlotBackground} [UpgradeSlotBackground] Frame 1Symbol 233 EditableText
"amountField"Symbol 237 MovieClip {UpgradeSlotBackground} [UpgradeSlotBackground] Frame 1Symbol 234 EditableText
"priceField"Symbol 237 MovieClip {UpgradeSlotBackground} [UpgradeSlotBackground] Frame 1Symbol 235 EditableText
"batchAmountField"Symbol 237 MovieClip {UpgradeSlotBackground} [UpgradeSlotBackground] Frame 1Symbol 236 EditableText
"_background"Symbol 396 MovieClip {TankCannon} [TankCannon] Frame 1Symbol 393 MovieClip
"_background"Symbol 409 MovieClip {TankHull} [TankHull] Frame 1Symbol 399 MovieClip
"_track"Symbol 409 MovieClip {TankHull} [TankHull] Frame 1Symbol 408 MovieClip
"bar"Symbol 554 MovieClip {graphics_fla.MaxFirePowerIndicator_60} [graphics_fla.MaxFirePowerIndicator_60] Frame 1Symbol 553 MovieClip
"numParachutesField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 234 EditableText
"numRepairsField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 234 EditableText
"numTeleportsField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 234 EditableText
"numShieldsField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 234 EditableText
"cannonAngleField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 537 EditableText
"scoreField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 538 EditableText
"cannonAngleIcon"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 541 MovieClip
"windArrowIcon"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 546 MovieClip
"weaponIcon"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 231 MovieClip
"healthBar"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 548 MovieClip
"shieldBar"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 548 MovieClip
"firePowerField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 549 EditableText
"windStrengthField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 549 EditableText
"fuelField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 549 EditableText
"weaponNameField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 550 EditableText
"weaponAmountField"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 234 EditableText
"maxFirePowerIndicator"Symbol 555 MovieClip {HUDBackground} [HUDBackground] Frame 1Symbol 554 MovieClip {graphics_fla.MaxFirePowerIndicator_60} [graphics_fla.MaxFirePowerIndicator_60]

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata present, AS3.
SWFMetaData (77)Timeline Frame 1459 bytes "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns ..."
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 1000, ScriptTimeout: 60 seconds
ExportAssets (56)Timeline Frame 1Symbol 83 as "com.bigwigmedia.preloaders.Preloader_2DPlay"
ExportAssets (56)Timeline Frame 1Symbol 82 as "Preloader_2DPlay_fla.logo_2"
ExportAssets (56)Timeline Frame 1Symbol 81 as "Preloader_2DPlay_fla.preloader_progress_bar_4"
ExportAssets (56)Timeline Frame 2Symbol 84 as "Font_1"
ExportAssets (56)Timeline Frame 2Symbol 90 as "PanelsOverlayAnimation"
ExportAssets (56)Timeline Frame 2Symbol 91 as "menu_click_02_wav"
ExportAssets (56)Timeline Frame 2Symbol 92 as "eqp_forcefield_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 93 as "menu_click_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 94 as "wpn_self_destruct_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 97 as "CheckBoxIcon"
ExportAssets (56)Timeline Frame 2Symbol 98 as "blast_doors_open_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 99 as "env_wind_light_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 100 as "explosn_med_02_wav"
ExportAssets (56)Timeline Frame 2Symbol 101 as "explosn_fire_bomb_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 104 as "RadioButtonSelectedIcon"
ExportAssets (56)Timeline Frame 2Symbol 105 as "wpn_teleport_02_wav"
ExportAssets (56)Timeline Frame 2Symbol 106 as "vo_shields_are_low_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 109 as "RadioButtonIcon"
ExportAssets (56)Timeline Frame 2Symbol 110 as "vo_taking_enemy_fire_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 111 as "wpn_predstrike_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 112 as "tank_move_wounded__02_wav"
ExportAssets (56)Timeline Frame 2Symbol 113 as "tank_turret_move_02_wav"
ExportAssets (56)Timeline Frame 2Symbol 114 as "wpn_airstrike_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 115 as "wpn_spidr_bomb_walk_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 116 as "explosn_lrg_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 117 as "tank_move_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 118 as "blast_doors_close_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 119 as "emp_fizzle_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 120 as "menu_click_03_wav"
ExportAssets (56)Timeline Frame 2Symbol 121 as "eqp_repair_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 122 as "wpn_teleport_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 123 as "explosn_med_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 124 as "vo_enemy_neutralized_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 125 as "explosn_atomic_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 126 as "blast_doors_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 127 as "eqp_parachute_00_wav"
ExportAssets (56)Timeline Frame 2Symbol 128 as "tank_mg_fire_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 129 as "tank_fire_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 130 as "tank_turret_move_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 131 as "explosn_atomic_02_wav"
ExportAssets (56)Timeline Frame 2Symbol 132 as "tank_move_wounded_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 135 as "CheckBoxSelectedIcon"
ExportAssets (56)Timeline Frame 2Symbol 136 as "explosn_sm_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 137 as "explosn_emp_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 138 as "wpn_sat_strike_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 139 as "tank_move_03_wav"
ExportAssets (56)Timeline Frame 2Symbol 140 as "env_wind_hard_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 141 as "vo_target_identified_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 142 as "explosn_sm_02_wav"
ExportAssets (56)Timeline Frame 2Symbol 143 as "wpn_sat_communic_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 144 as "env_wind_med_01_wav"
ExportAssets (56)Timeline Frame 2Symbol 149 as "CampaignLostViewBackground"
ExportAssets (56)Timeline Frame 2Symbol 151 as "TwoDPlayButtonIcon"
ExportAssets (56)Timeline Frame 2Symbol 155 as "CampaignPlayerSelectionViewBackground"
ExportAssets (56)Timeline Frame 2Symbol 158 as "InstructionsBackground"
ExportAssets (56)Timeline Frame 2Symbol 159 as "UrbanTexture"
ExportAssets (56)Timeline Frame 2Symbol 160 as "UrbanTopTexture"
ExportAssets (56)Timeline Frame 2Symbol 161 as "RockyTexture"
ExportAssets (56)Timeline Frame 2Symbol 162 as "AlpineTexture"
ExportAssets (56)Timeline Frame 2Symbol 163 as "RockyTopTexture"
ExportAssets (56)Timeline Frame 2Symbol 164 as "AlpineTopTexture"
ExportAssets (56)Timeline Frame 2Symbol 165 as "DesertTexture"
ExportAssets (56)Timeline Frame 2Symbol 166 as "DesertTopTexture"
ExportAssets (56)Timeline Frame 2Symbol 167 as "ForestTopTexture"
ExportAssets (56)Timeline Frame 2Symbol 168 as "ForestTexture"
ExportAssets (56)Timeline Frame 2Symbol 170 as "UpgradeScreenBackground"
ExportAssets (56)Timeline Frame 2Symbol 182 as "DeathmatchCompletedViewBackground"
ExportAssets (56)Timeline Frame 2Symbol 237 as "UpgradeSlotBackground"
ExportAssets (56)Timeline Frame 2Symbol 238 as "SplashMenuViewBackground"
ExportAssets (56)Timeline Frame 2Symbol 249 as "LevelBackground"
ExportAssets (56)Timeline Frame 2Symbol 268 as "DamageSmokeClip"
ExportAssets (56)Timeline Frame 2Symbol 279 as "DamageFireClip"
ExportAssets (56)Timeline Frame 2Symbol 312 as "MediumExplosionClip"
ExportAssets (56)Timeline Frame 2Symbol 316 as "ExplosionEffect"
ExportAssets (56)Timeline Frame 2Symbol 319 as "TankArrowClip"
ExportAssets (56)Timeline Frame 2Symbol 333 as "TerrainView"
ExportAssets (56)Timeline Frame 2Symbol 336 as "MinusButtonOverIcon"
ExportAssets (56)Timeline Frame 2Symbol 339 as "MinusButtonUpIcon"
ExportAssets (56)Timeline Frame 2Symbol 342 as "PlusButtonOverIcon"
ExportAssets (56)Timeline Frame 2Symbol 346 as "DeathmatchPlayerSelectionViewBackground"
ExportAssets (56)Timeline Frame 2Symbol 349 as "PlusButtonUpIcon"
ExportAssets (56)Timeline Frame 2Symbol 351 as "CampaignWonViewBackground"
ExportAssets (56)Timeline Frame 2Symbol 360 as "FireEffect"
ExportAssets (56)Timeline Frame 2Symbol 363 as "ShieldClip"
ExportAssets (56)Timeline Frame 2Symbol 388 as "ShieldActivatingClip"
ExportAssets (56)Timeline Frame 2Symbol 390 as "ParachutesClip"
ExportAssets (56)Timeline Frame 2Symbol 396 as "TankCannon"
ExportAssets (56)Timeline Frame 2Symbol 409 as "TankHull"
ExportAssets (56)Timeline Frame 2Symbol 412 as "PopCornBombSprite"
ExportAssets (56)Timeline Frame 2Symbol 415 as "StandardShellSprite"
ExportAssets (56)Timeline Frame 2Symbol 430 as "SmallExplosionClip"
ExportAssets (56)Timeline Frame 2Symbol 433 as "AtomBombSprite"
ExportAssets (56)Timeline Frame 2Symbol 466 as "FireExplosionAnimation"
ExportAssets (56)Timeline Frame 2Symbol 469 as "IncendiaryShellSprite"
ExportAssets (56)Timeline Frame 2Symbol 512 as "AtomExplosionClip"
ExportAssets (56)Timeline Frame 2Symbol 521 as "SpiderBombClip"
ExportAssets (56)Timeline Frame 2Symbol 524 as "PauseMenuBackground"
ExportAssets (56)Timeline Frame 2Symbol 529 as "AirStrikeCursorClip"
ExportAssets (56)Timeline Frame 2Symbol 531 as "SatelliteStrikeCursorClip"
ExportAssets (56)Timeline Frame 2Symbol 534 as "ArrowRightOverIcon"
ExportAssets (56)Timeline Frame 2Symbol 555 as "HUDBackground"
ExportAssets (56)Timeline Frame 2Symbol 558 as "TeleportButtonIcon"
ExportAssets (56)Timeline Frame 2Symbol 561 as "PauseButtonOverIcon"
ExportAssets (56)Timeline Frame 2Symbol 564 as "FireButtonOverIcon"
ExportAssets (56)Timeline Frame 2Symbol 567 as "ArrowRightUpIcon"
ExportAssets (56)Timeline Frame 2Symbol 570 as "RepairButtonIcon"
ExportAssets (56)Timeline Frame 2Symbol 573 as "FireButtonUpIcon"
ExportAssets (56)Timeline Frame 2Symbol 576 as "PauseButtonUpIcon"
ExportAssets (56)Timeline Frame 2Symbol 579 as "ArrowLeftOverIcon"
ExportAssets (56)Timeline Frame 2Symbol 582 as "ShieldButtonIcon"
ExportAssets (56)Timeline Frame 2Symbol 585 as "ParachuteButtonIcon"
ExportAssets (56)Timeline Frame 2Symbol 588 as "ArrowLeftUpIcon"
ExportAssets (56)Timeline Frame 2Symbol 591 as "AirStrikeShuttleSprite"
ExportAssets (56)Timeline Frame 2Symbol 604 as "SatelliteStrikeSprite"
ExportAssets (56)Timeline Frame 2Symbol 639 as "BigExplosionClip"
ExportAssets (56)Timeline Frame 2Symbol 667 as "TeleportAnimationClip"
ExportAssets (56)Timeline Frame 2Symbol 670 as "NewPlayerPopupBackground"
ExportAssets (56)Timeline Frame 2Symbol 673 as "PlayerInfoPanelBackground"
ExportAssets (56)Timeline Frame 2Symbol 554 as "graphics_fla.MaxFirePowerIndicator_60"
ExportAssets (56)Timeline Frame 2Symbol 676 as "CannonSliderThumbIcon"
ExportAssets (56)Timeline Frame 2Symbol 679 as "FirePowerSliderThumbIcon"
ExportAssets (56)Timeline Frame 2Symbol 687 as "AirStrikeRocketSprite"
SerialNumber (41)Timeline Frame 1

Labels

"tanks2_Main"Frame 1
"start"Frame 2
"standard_shell"Symbol 231 MovieClip Frame 1
"armor_piercing"Symbol 231 MovieClip Frame 2
"pop_corn_bomb"Symbol 231 MovieClip Frame 3
"machine_gun"Symbol 231 MovieClip Frame 4
"cluster"Symbol 231 MovieClip Frame 5
"incendiary_cluster"Symbol 231 MovieClip Frame 6
"atom_bomb"Symbol 231 MovieClip Frame 7
"tactical_nuke"Symbol 231 MovieClip Frame 8
"mini_roller"Symbol 231 MovieClip Frame 9
"big_roller"Symbol 231 MovieClip Frame 10
"incendiary_roller"Symbol 231 MovieClip Frame 11
"high_explosive_roller"Symbol 231 MovieClip Frame 12
"spider_bomb"Symbol 231 MovieClip Frame 13
"air_strike"Symbol 231 MovieClip Frame 14
"satellite_strike"Symbol 231 MovieClip Frame 15
"parachutes"Symbol 231 MovieClip Frame 24
"repair_kit"Symbol 231 MovieClip Frame 25
"teleport"Symbol 231 MovieClip Frame 26
"shield"Symbol 231 MovieClip Frame 27
"shield_upgrade"Symbol 231 MovieClip Frame 28
"fuel"Symbol 231 MovieClip Frame 29
"health"Symbol 231 MovieClip Frame 30
"engine_upgrade"Symbol 231 MovieClip Frame 31
"DESERT"Symbol 249 MovieClip {LevelBackground} [LevelBackground] Frame 1
"ALPINE"Symbol 249 MovieClip {LevelBackground} [LevelBackground] Frame 2
"ROCKY"Symbol 249 MovieClip {LevelBackground} [LevelBackground] Frame 3
"FOREST"Symbol 249 MovieClip {LevelBackground} [LevelBackground] Frame 4
"URBAN"Symbol 249 MovieClip {LevelBackground} [LevelBackground] Frame 5
"DESERT"Symbol 333 MovieClip {TerrainView} [TerrainView] Frame 1
"ALPINE"Symbol 333 MovieClip {TerrainView} [TerrainView] Frame 2
"ROCKY"Symbol 333 MovieClip {TerrainView} [TerrainView] Frame 3
"FOREST"Symbol 333 MovieClip {TerrainView} [TerrainView] Frame 4
"URBAN"Symbol 333 MovieClip {TerrainView} [TerrainView] Frame 5
"RANDOM"Symbol 333 MovieClip {TerrainView} [TerrainView] Frame 6
"RIGHT_TO_LEFT"Symbol 529 MovieClip {AirStrikeCursorClip} [AirStrikeCursorClip] Frame 1
"LEFT_TO_RIGHT"Symbol 529 MovieClip {AirStrikeCursorClip} [AirStrikeCursorClip] Frame 2




http://swfchan.com/19/90641/info.shtml
Created: 28/3 -2019 07:36:41 Last modified: 28/3 -2019 07:36:41 Server time: 14/11 -2024 17:39:03