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

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

1277572314601.swf

This is the info page for
Flash #85569

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


Text
<p align="center"><font face="Lamebrain (BRK)" size="20" color="#990000" letterSpacing="0.000000" kerning="1">Click &apos;Reset&apos; again if you really want to drop all discovered elements</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="20" color="#222222" letterSpacing="0.000000" kerning="1">Score: 52345</font></p>

<p align="center"><font face="Arial" size="14" color="#000000" letterSpacing="0.000000" kerning="1">www.doodleGod.com</font></p>

<p align="center"><font face="Arial" size="14" color="#000000" letterSpacing="0.000000" kerning="1">More great games by JoyBits at: http://LS.GD/JBMG</font></p>

<p align="center"><font face="Arial" size="14" color="#000000" letterSpacing="0.000000" kerning="1">Got an iPhone? Well, this game is here: http://LS.GD/DGA</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1">Some of these elements may react:</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">000</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Elements:</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">/</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Groups: </font></p>

<p align="left"><font face="Lamebrain (BRK)" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">12345</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Score:</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="22" color="#3e3e3e" letterSpacing="0.000000" kerning="1">Scientists say they have</font></p><p align="left"><font face="Lamebrain (BRK)" size="22" color="#3e3e3e" letterSpacing="0.000000" kerning="1">developed a car that can run</font></p><p align="left"><font face="Lamebrain (BRK)" size="22" color="#3e3e3e" letterSpacing="0.000000" kerning="1">on water. The only catch is,</font></p><p align="left"><font face="Lamebrain (BRK)" size="22" color="#3e3e3e" letterSpacing="0.000000" kerning="1">the water has to come</font></p><p align="left"><font face="Lamebrain (BRK)" size="22" color="#3e3e3e" letterSpacing="0.000000" kerning="1">from the Gulf of Mexico.</font></p>

<p align="right"><font face="Lamebrain (BRK)" size="15" color="#3e3e3e" letterSpacing="0.000000" kerning="1">William Shakespeare</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="20" color="#990000" letterSpacing="0.000000" kerning="1">(new elements created)</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1">click to continue</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">In the next episodes:</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="21" color="#ffffff" letterSpacing="0.000000" kerning="1">CONGRATULATIONS!</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">- Which path will the development of the </font></p><p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">world creation take?</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">- Maybe technological disaster will throw the world to the stone age?</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">- What other fantastic inventions will Doodle God make?</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">- What creatures will inhabit the planet?</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">- Or maybe world will take the path of magic?</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">- Perhaps the Doodle God himself will descend from Heavens </font></p><p align="center"><font face="Lamebrain (BRK)" size="21" color="#333333" letterSpacing="0.000000" kerning="1">and take on adventures personally?</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="25" color="#3333cc" letterSpacing="0.000000" kerning="1">Goal</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="25" color="#3333cc" letterSpacing="0.000000" kerning="1">Click group to expand</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="25" color="#3333cc" letterSpacing="0.000000" kerning="1">Click </font></p><p align="center"><font face="Lamebrain (BRK)" size="25" color="#3333cc" letterSpacing="0.000000" kerning="1">element</font></p>

<p align="left"><font face="Lamebrain (BRK)" size="25" color="#3333cc" letterSpacing="0.000000" kerning="1">New element in this group</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1">What if I combined the basic</font></p><p align="center"><font face="Lamebrain (BRK)" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1">elements to create new ones?</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1">skip &gt;</font></p>

<p align="center"><font face="Lamebrain (BRK)" size="20" color="#ffffff" letterSpacing="0.000000" kerning="1">Reactions history:</font></p>

<p align="center"><font face="04b03b" size="8" color="#ffffff" letterSpacing="0.000000" kerning="1">0:00</font></p>

ActionScript [AS3]

Section 1
//Images (assets.Images) package assets { import flash.display.*; import flash.system.*; public class Images { private static var _cache:Object = {}; public static var imagesAppDomain:ApplicationDomain; private static var _Balloon3Class:Class = Images__Balloon3Class; private static var _Balloon2Class:Class = Images__Balloon2Class; private static var _Balloon1Class:Class = Images__Balloon1Class; public function Images(){ super(); } public static function getBitmap(name:String):Bitmap{ var ElementClass:*; var bitmapData:BitmapData = _cache[name]; if (!bitmapData){ ElementClass = imagesAppDomain.getDefinition(name); bitmapData = new ElementClass(0, 0); _cache[name] = bitmapData; }; var bitmap:Bitmap = new Bitmap(bitmapData, PixelSnapping.AUTO, true); return (bitmap); } public static function getBalloon(n:int):DisplayObject{ var mc:*; if (n == 0){ return (null); }; if (n == 1){ mc = new _Balloon1Class(); } else { if (n == 2){ mc = new _Balloon2Class(); } else { mc = new _Balloon3Class(); }; }; return (mc); } } }//package assets
Section 2
//Images__Balloon1Class (assets.Images__Balloon1Class) package assets { import flash.display.*; import mx.core.*; public class Images__Balloon1Class extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package assets
Section 3
//Images__Balloon2Class (assets.Images__Balloon2Class) package assets { import flash.display.*; import mx.core.*; public class Images__Balloon2Class extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package assets
Section 4
//Images__Balloon3Class (assets.Images__Balloon3Class) package assets { import flash.display.*; import mx.core.*; public class Images__Balloon3Class extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package assets
Section 5
//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 6
//JSON (com.adobe.serialization.json.JSON) package com.adobe.serialization.json { public class JSON { public static function decode(_arg1:String){ var _local2:JSONDecoder = new JSONDecoder(_arg1); return (_local2.getValue()); } public static function encode(_arg1:Object):String{ var _local2:JSONEncoder = new JSONEncoder(_arg1); return (_local2.getString()); } } }//package com.adobe.serialization.json
Section 7
//JSONDecoder (com.adobe.serialization.json.JSONDecoder) package com.adobe.serialization.json { public class JSONDecoder { private var value; private var tokenizer:JSONTokenizer; private var token:JSONToken; public function JSONDecoder(_arg1:String){ this.tokenizer = new JSONTokenizer(_arg1); this.nextToken(); this.value = this.parseValue(); } private function parseObject():Object{ var _local2:String; var _local1:Object = new Object(); this.nextToken(); if (this.token.type == JSONTokenType.RIGHT_BRACE){ return (_local1); }; while (true) { if (this.token.type == JSONTokenType.STRING){ _local2 = String(this.token.value); this.nextToken(); if (this.token.type == JSONTokenType.COLON){ this.nextToken(); _local1[_local2] = this.parseValue(); this.nextToken(); if (this.token.type == JSONTokenType.RIGHT_BRACE){ return (_local1); }; if (this.token.type == JSONTokenType.COMMA){ this.nextToken(); } else { this.tokenizer.parseError(("Expecting } or , but found " + this.token.value)); }; } else { this.tokenizer.parseError(("Expecting : but found " + this.token.value)); }; } else { this.tokenizer.parseError(("Expecting string but found " + this.token.value)); }; }; return (null); } private function parseValue():Object{ if (this.token == null){ this.tokenizer.parseError("Unexpected end of input"); }; switch (this.token.type){ case JSONTokenType.LEFT_BRACE: return (this.parseObject()); case JSONTokenType.LEFT_BRACKET: return (this.parseArray()); case JSONTokenType.STRING: case JSONTokenType.NUMBER: case JSONTokenType.TRUE: case JSONTokenType.FALSE: case JSONTokenType.NULL: return (this.token.value); default: this.tokenizer.parseError(("Unexpected " + this.token.value)); }; return (null); } private function nextToken():JSONToken{ return ((this.token = this.tokenizer.getNextToken())); } public function getValue(){ return (this.value); } private function parseArray():Array{ var _local1:Array = new Array(); this.nextToken(); if (this.token.type == JSONTokenType.RIGHT_BRACKET){ return (_local1); }; while (true) { _local1.push(this.parseValue()); this.nextToken(); if (this.token.type == JSONTokenType.RIGHT_BRACKET){ return (_local1); }; if (this.token.type == JSONTokenType.COMMA){ this.nextToken(); } else { this.tokenizer.parseError(("Expecting ] or , but found " + this.token.value)); }; }; return (null); } } }//package com.adobe.serialization.json
Section 8
//JSONEncoder (com.adobe.serialization.json.JSONEncoder) package com.adobe.serialization.json { import flash.utils.*; public class JSONEncoder { private var jsonString:String; public function JSONEncoder(_arg1){ this.jsonString = this.convertToString(_arg1); } private function escapeString(_arg1:String):String{ var _local3:String; var _local6:String; var _local7:String; var _local2 = ""; var _local4:Number = _arg1.length; var _local5:int; while (_local5 < _local4) { _local3 = _arg1.charAt(_local5); switch (_local3){ case "\"": _local2 = (_local2 + "\\\""); break; case "\\": _local2 = (_local2 + "\\\\"); break; case "\b": _local2 = (_local2 + "\\b"); break; case "\f": _local2 = (_local2 + "\\f"); break; case "\n": _local2 = (_local2 + "\\n"); break; case "\r": _local2 = (_local2 + "\\r"); break; case "\t": _local2 = (_local2 + "\\t"); break; default: if (_local3 < " "){ _local6 = _local3.charCodeAt(0).toString(16); _local7 = ((_local6.length == 2)) ? "00" : "000"; _local2 = (_local2 + (("\\u" + _local7) + _local6)); } else { _local2 = (_local2 + _local3); }; }; _local5++; }; return ((("\"" + _local2) + "\"")); } private function arrayToString(_arg1:Array):String{ var _local2 = ""; var _local3:int; while (_local3 < _arg1.length) { if (_local2.length > 0){ _local2 = (_local2 + ","); }; _local2 = (_local2 + this.convertToString(_arg1[_local3])); _local3++; }; return ((("[" + _local2) + "]")); } public function getString():String{ return (this.jsonString); } private function objectToString(_arg1:Object):String{ var value:Object; var key:String; var v:XML; var o = _arg1; var s = ""; var classInfo:XML = describeType(o); if (classInfo.@name.toString() == "Object"){ for (key in o) { value = o[key]; if ((value is Function)){ } else { if (s.length > 0){ s = (s + ","); }; s = (s + ((this.escapeString(key) + ":") + this.convertToString(value))); }; }; } else { for each (v in classInfo..*.(((name() == "variable")) || ((name() == "accessor")))) { if (s.length > 0){ s = (s + ","); }; s = (s + ((this.escapeString(v.@name.toString()) + ":") + this.convertToString(o[v.@name]))); }; }; return ((("{" + s) + "}")); } private function convertToString(_arg1):String{ if ((_arg1 is String)){ return (this.escapeString((_arg1 as String))); }; if ((_arg1 is Number)){ return ((isFinite((_arg1 as Number))) ? _arg1.toString() : "null"); } else { if ((_arg1 is Boolean)){ return ((_arg1) ? "true" : "false"); } else { if ((_arg1 is Array)){ return (this.arrayToString((_arg1 as Array))); }; if ((((_arg1 is Object)) && (!((_arg1 == null))))){ return (this.objectToString(_arg1)); }; }; }; return ("null"); } } }//package com.adobe.serialization.json
Section 9
//JSONParseError (com.adobe.serialization.json.JSONParseError) package com.adobe.serialization.json { public class JSONParseError extends Error { private var _location:int; private var _text:String; public function JSONParseError(_arg1:String="", _arg2:int=0, _arg3:String=""){ super(_arg1); name = "JSONParseError"; this._location = _arg2; this._text = _arg3; } public function get location():int{ return (this._location); } public function get text():String{ return (this._text); } } }//package com.adobe.serialization.json
Section 10
//JSONToken (com.adobe.serialization.json.JSONToken) package com.adobe.serialization.json { public class JSONToken { private var _value:Object; private var _type:int; public function JSONToken(_arg1:int=-1, _arg2:Object=null){ this._type = _arg1; this._value = _arg2; } public function get value():Object{ return (this._value); } public function get type():int{ return (this._type); } public function set type(_arg1:int):void{ this._type = _arg1; } public function set value(_arg1:Object):void{ this._value = _arg1; } } }//package com.adobe.serialization.json
Section 11
//JSONTokenizer (com.adobe.serialization.json.JSONTokenizer) package com.adobe.serialization.json { public class JSONTokenizer { private var loc:int; private var ch:String; private var obj:Object; private var jsonString:String; public function JSONTokenizer(_arg1:String){ this.jsonString = _arg1; this.loc = 0; this.nextChar(); } private function skipComments():void{ if (this.ch == "/"){ this.nextChar(); switch (this.ch){ case "/": do { this.nextChar(); } while (((!((this.ch == "\n"))) && (!((this.ch == ""))))); this.nextChar(); break; case "*": this.nextChar(); while (true) { if (this.ch == "*"){ this.nextChar(); if (this.ch == "/"){ this.nextChar(); break; }; } else { this.nextChar(); }; if (this.ch == ""){ this.parseError("Multi-line comment not closed"); }; }; break; default: this.parseError((("Unexpected " + this.ch) + " encountered (expecting '/' or '*' )")); }; }; } private function isDigit(_arg1:String):Boolean{ return ((((_arg1 >= "0")) && ((_arg1 <= "9")))); } private function readString():JSONToken{ var _local3:String; var _local4:int; var _local1:JSONToken = new JSONToken(); _local1.type = JSONTokenType.STRING; var _local2 = ""; this.nextChar(); while (((!((this.ch == "\""))) && (!((this.ch == ""))))) { if (this.ch == "\\"){ this.nextChar(); switch (this.ch){ case "\"": _local2 = (_local2 + "\""); break; case "/": _local2 = (_local2 + "/"); break; case "\\": _local2 = (_local2 + "\\"); break; case "b": _local2 = (_local2 + "\b"); break; case "f": _local2 = (_local2 + "\f"); break; case "n": _local2 = (_local2 + "\n"); break; case "r": _local2 = (_local2 + "\r"); break; case "t": _local2 = (_local2 + "\t"); break; case "u": _local3 = ""; _local4 = 0; while (_local4 < 4) { if (!this.isHexDigit(this.nextChar())){ this.parseError((" Excepted a hex digit, but found: " + this.ch)); }; _local3 = (_local3 + this.ch); _local4++; }; _local2 = (_local2 + String.fromCharCode(parseInt(_local3, 16))); break; default: _local2 = (_local2 + ("\\" + this.ch)); }; } else { _local2 = (_local2 + this.ch); }; this.nextChar(); }; if (this.ch == ""){ this.parseError("Unterminated string literal"); }; this.nextChar(); _local1.value = _local2; return (_local1); } private function nextChar():String{ return ((this.ch = this.jsonString.charAt(this.loc++))); } public function getNextToken():JSONToken{ var _local2:String; var _local3:String; var _local4:String; var _local1:JSONToken = new JSONToken(); this.skipIgnored(); switch (this.ch){ case "{": _local1.type = JSONTokenType.LEFT_BRACE; _local1.value = "{"; this.nextChar(); break; case "}": _local1.type = JSONTokenType.RIGHT_BRACE; _local1.value = "}"; this.nextChar(); break; case "[": _local1.type = JSONTokenType.LEFT_BRACKET; _local1.value = "["; this.nextChar(); break; case "]": _local1.type = JSONTokenType.RIGHT_BRACKET; _local1.value = "]"; this.nextChar(); break; case ",": _local1.type = JSONTokenType.COMMA; _local1.value = ","; this.nextChar(); break; case ":": _local1.type = JSONTokenType.COLON; _local1.value = ":"; this.nextChar(); break; case "t": _local2 = ((("t" + this.nextChar()) + this.nextChar()) + this.nextChar()); if (_local2 == "true"){ _local1.type = JSONTokenType.TRUE; _local1.value = true; this.nextChar(); } else { this.parseError(("Expecting 'true' but found " + _local2)); }; break; case "f": _local3 = (((("f" + this.nextChar()) + this.nextChar()) + this.nextChar()) + this.nextChar()); if (_local3 == "false"){ _local1.type = JSONTokenType.FALSE; _local1.value = false; this.nextChar(); } else { this.parseError(("Expecting 'false' but found " + _local3)); }; break; case "n": _local4 = ((("n" + this.nextChar()) + this.nextChar()) + this.nextChar()); if (_local4 == "null"){ _local1.type = JSONTokenType.NULL; _local1.value = null; this.nextChar(); } else { this.parseError(("Expecting 'null' but found " + _local4)); }; break; case "\"": _local1 = this.readString(); break; default: if (((this.isDigit(this.ch)) || ((this.ch == "-")))){ _local1 = this.readNumber(); } else { if (this.ch == ""){ return (null); }; this.parseError((("Unexpected " + this.ch) + " encountered")); }; }; return (_local1); } private function skipWhite():void{ while (this.isWhiteSpace(this.ch)) { this.nextChar(); }; } public function parseError(_arg1:String):void{ throw (new JSONParseError(_arg1, this.loc, this.jsonString)); } private function isWhiteSpace(_arg1:String):Boolean{ return ((((((((_arg1 == " ")) || ((_arg1 == "\t")))) || ((_arg1 == "\n")))) || ((_arg1 == "\r")))); } private function skipIgnored():void{ var _local1:int; do { _local1 = this.loc; this.skipWhite(); this.skipComments(); } while (_local1 != this.loc); } private function isHexDigit(_arg1:String):Boolean{ var _local2:String = _arg1.toUpperCase(); return (((this.isDigit(_arg1)) || ((((_local2 >= "A")) && ((_local2 <= "F")))))); } private function readNumber():JSONToken{ var _local1:JSONToken = new JSONToken(); _local1.type = JSONTokenType.NUMBER; var _local2 = ""; if (this.ch == "-"){ _local2 = (_local2 + "-"); this.nextChar(); }; if (!this.isDigit(this.ch)){ this.parseError("Expecting a digit"); }; if (this.ch == "0"){ _local2 = (_local2 + this.ch); this.nextChar(); if (this.isDigit(this.ch)){ this.parseError("A digit cannot immediately follow 0"); }; } else { while (this.isDigit(this.ch)) { _local2 = (_local2 + this.ch); this.nextChar(); }; }; if (this.ch == "."){ _local2 = (_local2 + "."); this.nextChar(); if (!this.isDigit(this.ch)){ this.parseError("Expecting a digit"); }; while (this.isDigit(this.ch)) { _local2 = (_local2 + this.ch); this.nextChar(); }; }; if ((((this.ch == "e")) || ((this.ch == "E")))){ _local2 = (_local2 + "e"); this.nextChar(); if ((((this.ch == "+")) || ((this.ch == "-")))){ _local2 = (_local2 + this.ch); this.nextChar(); }; if (!this.isDigit(this.ch)){ this.parseError("Scientific notation number needs exponent value"); }; while (this.isDigit(this.ch)) { _local2 = (_local2 + this.ch); this.nextChar(); }; }; var _local3:Number = Number(_local2); if (((isFinite(_local3)) && (!(isNaN(_local3))))){ _local1.value = _local3; return (_local1); }; this.parseError((("Number " + _local3) + " is not valid!")); return (null); } } }//package com.adobe.serialization.json
Section 12
//JSONTokenType (com.adobe.serialization.json.JSONTokenType) package com.adobe.serialization.json { public class JSONTokenType { public static const NUMBER:int = 11; public static const FALSE:int = 8; public static const RIGHT_BRACKET:int = 4; public static const NULL:int = 9; public static const TRUE:int = 7; public static const RIGHT_BRACE:int = 2; public static const UNKNOWN:int = -1; public static const COMMA:int = 0; public static const LEFT_BRACKET:int = 3; public static const STRING:int = 10; public static const LEFT_BRACE:int = 1; public static const COLON:int = 6; } }//package com.adobe.serialization.json
Section 13
//ArrayUtil (com.adobe.utils.ArrayUtil) package com.adobe.utils { public class ArrayUtil { public function ArrayUtil(){ super(); } public static function arraysAreEqual(arr1:Array, arr2:Array):Boolean{ if (arr1.length != arr2.length){ return (false); }; var len:Number = arr1.length; var i:Number = 0; while (i < len) { if (arr1[i] !== arr2[i]){ return (false); }; i++; }; return (true); } public static function arrayContainsValue(arr:Array, value:Object):Boolean{ return (!((arr.indexOf(value) == -1))); } public static function copyArray(arr:Array):Array{ return (arr.slice()); } public static function removeValueFromArray(arr:Array, value:Object):void{ var len:uint = arr.length; var i:Number = len; while (i > -1) { if (arr[i] === value){ arr.splice(i, 1); }; i--; }; } public static function createUniqueCopy(a:Array):Array{ var item:Object; var newArray:Array = new Array(); var len:Number = a.length; var i:uint; while (i < len) { item = a[i]; if (_slot1.arrayContainsValue(newArray, item)){ } else { newArray.push(item); }; i++; }; return (newArray); } } }//package com.adobe.utils
Section 14
//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 15
//NumberFormatter (com.adobe.utils.NumberFormatter) package com.adobe.utils { public class NumberFormatter { public function NumberFormatter(){ super(); } public static function addLeadingZero(n:Number):String{ var out:String = String(n); if ((((n < 10)) && ((n > -1)))){ out = ("0" + out); }; return (out); } } }//package com.adobe.utils
Section 16
//StringUtil (com.adobe.utils.StringUtil) package com.adobe.utils { public class StringUtil { public function StringUtil(){ super(); } public static function beginsWith(input:String, prefix:String):Boolean{ return ((prefix == input.substring(0, prefix.length))); } public static function trim(input:String):String{ return (_slot1.ltrim(_slot1.rtrim(input))); } public static function stringsAreEqual(s1:String, s2:String, caseSensitive:Boolean):Boolean{ if (caseSensitive){ return ((s1 == s2)); }; return ((s1.toUpperCase() == s2.toUpperCase())); } public static function replace(input:String, replace:String, replaceWith:String):String{ var j:Number; var sb:String = new String(); var found:Boolean; var sLen:Number = input.length; var rLen:Number = replace.length; var i:Number = 0; while (i < sLen) { if (input.charAt(i) == replace.charAt(0)){ found = true; j = 0; while (j < rLen) { if (input.charAt((i + j)) != replace.charAt(j)){ found = false; break; }; j++; }; //unresolved if sb = (sb + replaceWith); i = (i + (rLen - 1)); } else { sb = (sb + input.charAt(i)); }; i++; }; return (sb); } public static function rtrim(input:String):String{ var size:Number = input.length; var i:Number = size; while (i > 0) { if (input.charCodeAt((i - 1)) > 32){ return (input.substring(0, i)); }; i--; }; return (""); } public static function endsWith(input:String, suffix:String):Boolean{ return ((suffix == input.substring((input.length - suffix.length)))); } public static function stringHasValue(s:String):Boolean{ return (((!((s == null))) && ((s.length > 0)))); } public static function remove(input:String, remove:String):String{ return (_slot1.replace(input, remove, "")); } public static function ltrim(input:String):String{ var size:Number = input.length; var i:Number = 0; while (i < size) { if (input.charCodeAt(i) > 32){ return (input.substring(i)); }; i++; }; return (""); } } }//package com.adobe.utils
Section 17
//PropTween (com.greensock.core.PropTween) package com.greensock.core { public class PropTween { public var priority:int; public var start:Number; public var prevNode:PropTween; public var change:Number; public var target:Object; public var name:String; public var property:String; public var nextNode:PropTween; public var isPlugin:Boolean; public function PropTween(target:Object, property:String, start:Number, change:Number, name:String, isPlugin:Boolean, nextNode:PropTween=null, priority:int=0){ super(); this.target = target; this.property = property; this.start = start; this.change = change; this.name = name; this.isPlugin = isPlugin; if (nextNode){ nextNode.prevNode = this; this.nextNode = nextNode; }; this.priority = priority; } } }//package com.greensock.core
Section 18
//SimpleTimeline (com.greensock.core.SimpleTimeline) package com.greensock.core { public class SimpleTimeline extends TweenCore { public var autoRemoveChildren:Boolean; protected var _lastChild:TweenCore; protected var _firstChild:TweenCore; public function SimpleTimeline(vars:Object=null){ super(0, vars); } override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ var dur:Number; var next:TweenCore; var tween:TweenCore = _firstChild; this.cachedTotalTime = time; this.cachedTime = time; while (tween) { next = tween.nextNode; if (((tween.active) || ((((((time >= tween.cachedStartTime)) && (!(tween.cachedPaused)))) && (!(tween.gc)))))){ if (!tween.cachedReversed){ tween.renderTime(((time - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false); } else { dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration; tween.renderTime((dur - ((time - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false); }; }; tween = next; }; } public function addChild(tween:TweenCore):void{ if (((!(tween.gc)) && (tween.timeline))){ tween.timeline.remove(tween, true); }; tween.timeline = this; if (tween.gc){ tween.setEnabled(true, true); }; if (_firstChild){ _firstChild.prevNode = tween; }; tween.nextNode = _firstChild; _firstChild = tween; tween.prevNode = null; } public function remove(tween:TweenCore, skipDisable:Boolean=false):void{ if (tween.gc){ return; }; if (!skipDisable){ tween.setEnabled(false, true); }; if (tween.nextNode){ tween.nextNode.prevNode = tween.prevNode; } else { if (_lastChild == tween){ _lastChild = tween.prevNode; }; }; if (tween.prevNode){ tween.prevNode.nextNode = tween.nextNode; } else { if (_firstChild == tween){ _firstChild = tween.nextNode; }; }; } public function get rawTime():Number{ return (this.cachedTotalTime); } } }//package com.greensock.core
Section 19
//TweenCore (com.greensock.core.TweenCore) package com.greensock.core { import com.greensock.*; public class TweenCore { public var initted:Boolean; protected var _hasUpdate:Boolean; public var active:Boolean; protected var _delay:Number; public var cachedTime:Number; public var cachedReversed:Boolean; public var nextNode:TweenCore; protected var _rawPrevTime:Number;// = -1 public var vars:Object; public var cachedTotalTime:Number; public var timeline:SimpleTimeline; public var data; public var cachedStartTime:Number; public var prevNode:TweenCore; public var cachedDuration:Number; public var gc:Boolean; protected var _pauseTime:Number; public var cacheIsDirty:Boolean; public var cachedPaused:Boolean; public var cachedTimeScale:Number; public var cachedTotalDuration:Number; public static const version:Number = 1.13; protected static var _classInitted:Boolean; public function TweenCore(duration:Number=0, vars:Object=null){ super(); this.vars = ((vars) || ({})); this.cachedDuration = (this.cachedTotalDuration = ((duration) || (0))); _delay = ((this.vars.delay) || (0)); this.cachedTimeScale = ((this.vars.timeScale) || (1)); this.active = Boolean((((((duration == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false))))); this.cachedTotalTime = (this.cachedTime = 0); this.data = this.vars.data; if (!_classInitted){ if (isNaN(TweenLite.rootFrame)){ TweenLite.initClass(); _classInitted = true; } else { return; }; }; var tl:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline; this.cachedStartTime = (tl.cachedTotalTime + _delay); tl.addChild(this); if (this.vars.reversed){ this.cachedReversed = true; }; if (this.vars.paused){ this.paused = true; }; } public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ } public function get delay():Number{ return (_delay); } public function get duration():Number{ return (this.cachedDuration); } public function restart(includeDelay:Boolean=false, suppressEvents:Boolean=true):void{ this.reversed = false; this.paused = false; this.setTotalTime((includeDelay) ? -(_delay) : 0, suppressEvents); } public function set reversed(b:Boolean):void{ if (b != this.cachedReversed){ this.cachedReversed = b; setTotalTime(this.cachedTotalTime, true); }; } public function set startTime(n:Number):void{ var adjust:Boolean = Boolean(((!((this.timeline == null))) && (((!((n == this.cachedStartTime))) || (this.gc))))); this.cachedStartTime = n; if (adjust){ this.timeline.addChild(this); }; } public function set delay(n:Number):void{ this.startTime = (this.startTime + (n - _delay)); _delay = n; } public function resume():void{ this.paused = false; } public function get paused():Boolean{ return (this.cachedPaused); } public function play():void{ this.reversed = false; this.paused = false; } public function set duration(n:Number):void{ this.cachedDuration = (this.cachedTotalDuration = n); setDirtyCache(false); } public function complete(skipRender:Boolean=false, suppressEvents:Boolean=false):void{ if (!skipRender){ renderTime(this.cachedTotalDuration, suppressEvents, false); return; }; if (this.timeline.autoRemoveChildren){ this.setEnabled(false, false); } else { this.active = false; }; if (!suppressEvents){ if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); } else { if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){ this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams); }; }; }; } public function invalidate():void{ } public function get totalTime():Number{ return (this.cachedTotalTime); } public function get reversed():Boolean{ return (this.cachedReversed); } public function get startTime():Number{ return (this.cachedStartTime); } public function set currentTime(n:Number):void{ setTotalTime(n, false); } protected function setDirtyCache(includeSelf:Boolean=true):void{ var tween:TweenCore = (includeSelf) ? this : this.timeline; while (tween) { tween.cacheIsDirty = true; tween = tween.timeline; }; } public function reverse(forceResume:Boolean=true):void{ this.reversed = true; if (forceResume){ this.paused = false; } else { if (this.gc){ this.setEnabled(true, false); }; }; } public function set paused(b:Boolean):void{ if (((!((b == this.cachedPaused))) && (this.timeline))){ if (b){ _pauseTime = this.timeline.rawTime; } else { this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime)); _pauseTime = NaN; setDirtyCache(false); }; this.cachedPaused = b; this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); }; if (((!(b)) && (this.gc))){ this.setTotalTime(this.cachedTotalTime, false); this.setEnabled(true, false); }; } public function kill():void{ setEnabled(false, false); } public function set totalTime(n:Number):void{ setTotalTime(n, false); } public function get currentTime():Number{ return (this.cachedTime); } protected function setTotalTime(time:Number, suppressEvents:Boolean=false):void{ var tlTime:Number; var dur:Number; if (this.timeline){ tlTime = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime; if (this.cachedReversed){ dur = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; this.cachedStartTime = (tlTime - ((dur - time) / this.cachedTimeScale)); } else { this.cachedStartTime = (tlTime - (time / this.cachedTimeScale)); }; if (!this.timeline.cacheIsDirty){ setDirtyCache(false); }; if (this.cachedTotalTime != time){ renderTime(time, suppressEvents, false); }; }; } public function pause():void{ this.paused = true; } public function set totalDuration(n:Number):void{ this.duration = n; } public function get totalDuration():Number{ return (this.cachedTotalDuration); } public function setEnabled(enabled:Boolean, ignoreTimeline:Boolean=false):Boolean{ if (enabled){ this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); if (((!(ignoreTimeline)) && (this.gc))){ this.timeline.addChild(this); }; } else { this.active = false; if (!ignoreTimeline){ this.timeline.remove(this, true); }; }; this.gc = !(enabled); return (false); } } }//package com.greensock.core
Section 20
//Back (com.greensock.easing.Back) package com.greensock.easing { public class Back { public function Back(){ super(); } public static function easeOut(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{ t = ((t / d) - 1); return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b)); } public static function easeIn(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{ t = (t / d); return (((((c * t) * t) * (((s + 1) * t) - s)) + b)); } public static function easeInOut(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{ t = (t / (d * 0.5)); if (t < 1){ s = (s * 1.525); return ((((c * 0.5) * ((t * t) * (((s + 1) * t) - s))) + b)); }; t = (t - 2); s = (s * 1.525); return ((((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b)); } } }//package com.greensock.easing
Section 21
//Cubic (com.greensock.easing.Cubic) package com.greensock.easing { public class Cubic { public static const power:uint = 2; public function Cubic(){ super(); } public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{ t = ((t / d) - 1); return (((c * (((t * t) * t) + 1)) + b)); } public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); return (((((c * t) * t) * t) + b)); } public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / (d * 0.5)); if (t < 1){ return ((((((c * 0.5) * t) * t) * t) + b)); }; t = (t - 2); return ((((c * 0.5) * (((t * t) * t) + 2)) + b)); } } }//package com.greensock.easing
Section 22
//Linear (com.greensock.easing.Linear) package com.greensock.easing { public class Linear { public static const power:uint = 0; public function Linear(){ super(); } public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } public static function easeNone(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } } }//package com.greensock.easing
Section 23
//Quad (com.greensock.easing.Quad) package com.greensock.easing { public class Quad { public static const power:uint = 1; public function Quad(){ super(); } public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); return ((((-(c) * t) * (t - 2)) + b)); } public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); return ((((c * t) * t) + b)); } public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / (d * 0.5)); if (t < 1){ return (((((c * 0.5) * t) * t) + b)); }; --t; return ((((-(c) * 0.5) * ((t * (t - 2)) - 1)) + b)); } } }//package com.greensock.easing
Section 24
//Sine (com.greensock.easing.Sine) package com.greensock.easing { public class Sine { private static const _HALF_PI:Number = (Math.PI * 0.5); public function Sine(){ super(); } public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{ return (((c * Math.sin(((t / d) * _HALF_PI))) + b)); } public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number{ return ((((-(c) * Math.cos(((t / d) * _HALF_PI))) + c) + b)); } public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number{ return ((((-(c) * 0.5) * (Math.cos(((Math.PI * t) / d)) - 1)) + b)); } } }//package com.greensock.easing
Section 25
//TweenEvent (com.greensock.events.TweenEvent) package com.greensock.events { import flash.events.*; public class TweenEvent extends Event { public static const COMPLETE:String = "complete"; public static const START:String = "init"; public static const UPDATE:String = "change"; public static const REVERSE_COMPLETE:String = "reverseComplete"; public static const VERSION:Number = 1; public static const REPEAT:String = "repeat"; public function TweenEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){ super(type, bubbles, cancelable); } override public function clone():Event{ return (new TweenEvent(this.type, this.bubbles, this.cancelable)); } } }//package com.greensock.events
Section 26
//AutoAlphaPlugin (com.greensock.plugins.AutoAlphaPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class AutoAlphaPlugin extends TweenPlugin { protected var _target:Object; protected var _ignoreVisible:Boolean; public static const API:Number = 1; public function AutoAlphaPlugin(){ super(); this.propName = "autoAlpha"; this.overwriteProps = ["alpha", "visible"]; } override public function killProps(lookup:Object):void{ super.killProps(lookup); _ignoreVisible = Boolean(("visible" in lookup)); } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ _target = target; addTween(target, "alpha", target.alpha, value, "alpha"); return (true); } override public function set changeFactor(n:Number):void{ updateTweens(n); if (!_ignoreVisible){ _target.visible = Boolean(!((_target.alpha == 0))); }; } } }//package com.greensock.plugins
Section 27
//BevelFilterPlugin (com.greensock.plugins.BevelFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class BevelFilterPlugin extends FilterPlugin { public static const API:Number = 1; private static var _propNames:Array = ["distance", "angle", "highlightColor", "highlightAlpha", "shadowColor", "shadowAlpha", "blurX", "blurY", "strength", "quality"]; public function BevelFilterPlugin(){ super(); this.propName = "bevelFilter"; this.overwriteProps = ["bevelFilter"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ _target = target; _type = BevelFilter; initFilter(value, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((value.quality) || (2))), _propNames); return (true); } } }//package com.greensock.plugins
Section 28
//BezierPlugin (com.greensock.plugins.BezierPlugin) package com.greensock.plugins { import com.greensock.*; import com.greensock.core.*; public class BezierPlugin extends TweenPlugin { protected var _future:Object; protected var _orient:Boolean; protected var _orientData:Array; protected var _target:Object; protected var _beziers:Object; public static const API:Number = 1; protected static const _RAD2DEG:Number = 57.2957795130823; public function BezierPlugin(){ _future = {}; super(); this.propName = "bezier"; this.overwriteProps = []; } override public function killProps(lookup:Object):void{ var p:String; for (p in _beziers) { if ((p in lookup)){ delete _beziers[p]; }; }; super.killProps(lookup); } protected function init(tween:TweenLite, beziers:Array, through:Boolean):void{ var i:int; var p:String; var killVarsLookup:Object; _target = tween.target; var enumerables:Object = ((tween.vars.isTV)==true) ? tween.vars.exposedVars : tween.vars; if (enumerables.orientToBezier == true){ _orientData = [["x", "y", "rotation", 0, 0.01]]; _orient = true; } else { if ((enumerables.orientToBezier is Array)){ _orientData = enumerables.orientToBezier; _orient = true; }; }; var props:Object = {}; i = 0; while (i < beziers.length) { for (p in beziers[i]) { if (props[p] == undefined){ props[p] = [tween.target[p]]; }; if (typeof(beziers[i][p]) == "number"){ props[p].push(beziers[i][p]); } else { props[p].push((tween.target[p] + Number(beziers[i][p]))); }; }; i++; }; for (p in props) { this.overwriteProps[this.overwriteProps.length] = p; if (enumerables[p] != undefined){ if (typeof(enumerables[p]) == "number"){ props[p].push(enumerables[p]); } else { props[p].push((tween.target[p] + Number(enumerables[p]))); }; killVarsLookup = {}; killVarsLookup[p] = true; tween.killVars(killVarsLookup, false); delete enumerables[p]; }; }; _beziers = parseBeziers(props, through); } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ if (!(value is Array)){ return (false); }; init(tween, (value as Array), false); return (true); } override public function set changeFactor(n:Number):void{ var i:int; var p:String; var b:Object; var t:Number; var segments:uint; var val:Number; var curVals:Object; var dx:Number; var dy:Number; var cotb:Array; var toAdd:Number; var oldTarget:Object; var oldRound:Boolean; if (n == 1){ for (p in _beziers) { i = (_beziers[p].length - 1); _target[p] = _beziers[p][i][2]; }; } else { for (p in _beziers) { segments = _beziers[p].length; if (n < 0){ i = 0; } else { if (n >= 1){ i = (segments - 1); } else { i = int((segments * n)); }; }; t = ((n - (i * (1 / segments))) * segments); b = _beziers[p][i]; if (this.round){ val = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0]))))); _target[p] = ((val)>0) ? int((val + 0.5)) : int((val - 0.5)); } else { _target[p] = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0]))))); }; }; }; if (_orient){ i = _orientData.length; curVals = {}; while (i--) { cotb = _orientData[i]; curVals[cotb[0]] = _target[cotb[0]]; curVals[cotb[1]] = _target[cotb[1]]; }; oldTarget = _target; oldRound = this.round; _target = _future; this.round = false; _orient = false; i = _orientData.length; while (i--) { cotb = _orientData[i]; this.changeFactor = (n + ((cotb[4]) || (0.01))); toAdd = ((cotb[3]) || (0)); dx = (_future[cotb[0]] - curVals[cotb[0]]); dy = (_future[cotb[1]] - curVals[cotb[1]]); oldTarget[cotb[2]] = ((Math.atan2(dy, dx) * _RAD2DEG) + toAdd); }; _target = oldTarget; this.round = oldRound; _orient = true; }; } public static function parseBeziers(props:Object, through:Boolean=false):Object{ var i:int; var a:Array; var b:Object; var p:String; var all:Object = {}; if (through){ for (p in props) { a = props[p]; b = []; all[p] = b; if (a.length > 2){ b[b.length] = [a[0], (a[1] - ((a[2] - a[0]) / 4)), a[1]]; i = 1; while (i < (a.length - 1)) { b[b.length] = [a[i], (a[i] + (a[i] - b[(i - 1)][1])), a[(i + 1)]]; i++; }; } else { b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]]; }; }; } else { for (p in props) { a = props[p]; b = []; all[p] = b; if (a.length > 3){ b[b.length] = [a[0], a[1], ((a[1] + a[2]) / 2)]; i = 2; while (i < (a.length - 2)) { b[b.length] = [b[(i - 2)][2], a[i], ((a[i] + a[(i + 1)]) / 2)]; i++; }; b[b.length] = [b[(b.length - 1)][2], a[(a.length - 2)], a[(a.length - 1)]]; } else { if (a.length == 3){ b[b.length] = [a[0], a[1], a[2]]; } else { if (a.length == 2){ b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]]; }; }; }; }; }; return (all); } } }//package com.greensock.plugins
Section 29
//BezierThroughPlugin (com.greensock.plugins.BezierThroughPlugin) package com.greensock.plugins { import com.greensock.*; public class BezierThroughPlugin extends BezierPlugin { public static const API:Number = 1; public function BezierThroughPlugin(){ super(); this.propName = "bezierThrough"; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ if (!(value is Array)){ return (false); }; init(tween, (value as Array), true); return (true); } } }//package com.greensock.plugins
Section 30
//BlurFilterPlugin (com.greensock.plugins.BlurFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class BlurFilterPlugin extends FilterPlugin { public static const API:Number = 1; private static var _propNames:Array = ["blurX", "blurY", "quality"]; public function BlurFilterPlugin(){ super(); this.propName = "blurFilter"; this.overwriteProps = ["blurFilter"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ _target = target; _type = BlurFilter; initFilter(value, new BlurFilter(0, 0, ((value.quality) || (2))), _propNames); return (true); } } }//package com.greensock.plugins
Section 31
//ColorMatrixFilterPlugin (com.greensock.plugins.ColorMatrixFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class ColorMatrixFilterPlugin extends FilterPlugin { protected var _matrix:Array; protected var _matrixTween:EndArrayPlugin; public static const API:Number = 1; private static var _propNames:Array = []; protected static var _lumG:Number = 0.71516; protected static var _lumR:Number = 0.212671; protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]; protected static var _lumB:Number = 0.072169; public function ColorMatrixFilterPlugin(){ super(); this.propName = "colorMatrixFilter"; this.overwriteProps = ["colorMatrixFilter"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ _target = target; _type = ColorMatrixFilter; var cmf:Object = value; initFilter({remove:value.remove, index:value.index, addFilter:value.addFilter}, new ColorMatrixFilter(_idMatrix.slice()), _propNames); _matrix = ColorMatrixFilter(_filter).matrix; var endMatrix:Array = []; if (((!((cmf.matrix == null))) && ((cmf.matrix is Array)))){ endMatrix = cmf.matrix; } else { if (cmf.relative == true){ endMatrix = _matrix.slice(); } else { endMatrix = _idMatrix.slice(); }; endMatrix = setBrightness(endMatrix, cmf.brightness); endMatrix = setContrast(endMatrix, cmf.contrast); endMatrix = setHue(endMatrix, cmf.hue); endMatrix = setSaturation(endMatrix, cmf.saturation); endMatrix = setThreshold(endMatrix, cmf.threshold); if (!isNaN(cmf.colorize)){ endMatrix = colorize(endMatrix, cmf.colorize, cmf.amount); }; }; _matrixTween = new EndArrayPlugin(); _matrixTween.init(_matrix, endMatrix); return (true); } override public function set changeFactor(n:Number):void{ _matrixTween.changeFactor = n; ColorMatrixFilter(_filter).matrix = _matrix; super.changeFactor = n; } public static function setSaturation(m:Array, n:Number):Array{ if (isNaN(n)){ return (m); }; var inv:Number = (1 - n); var r:Number = (inv * _lumR); var g:Number = (inv * _lumG); var b:Number = (inv * _lumB); var temp:Array = [(r + n), g, b, 0, 0, r, (g + n), b, 0, 0, r, g, (b + n), 0, 0, 0, 0, 0, 1, 0]; return (applyMatrix(temp, m)); } public static function setHue(m:Array, n:Number):Array{ if (isNaN(n)){ return (m); }; n = (n * (Math.PI / 180)); var c:Number = Math.cos(n); var s:Number = Math.sin(n); var temp:Array = [((_lumR + (c * (1 - _lumR))) + (s * -(_lumR))), ((_lumG + (c * -(_lumG))) + (s * -(_lumG))), ((_lumB + (c * -(_lumB))) + (s * (1 - _lumB))), 0, 0, ((_lumR + (c * -(_lumR))) + (s * 0.143)), ((_lumG + (c * (1 - _lumG))) + (s * 0.14)), ((_lumB + (c * -(_lumB))) + (s * -0.283)), 0, 0, ((_lumR + (c * -(_lumR))) + (s * -((1 - _lumR)))), ((_lumG + (c * -(_lumG))) + (s * _lumG)), ((_lumB + (c * (1 - _lumB))) + (s * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]; return (applyMatrix(temp, m)); } public static function setContrast(m:Array, n:Number):Array{ if (isNaN(n)){ return (m); }; n = (n + 0.01); var temp:Array = [n, 0, 0, 0, (128 * (1 - n)), 0, n, 0, 0, (128 * (1 - n)), 0, 0, n, 0, (128 * (1 - n)), 0, 0, 0, 1, 0]; return (applyMatrix(temp, m)); } public static function applyMatrix(m:Array, m2:Array):Array{ var y:int; var x:int; if (((!((m is Array))) || (!((m2 is Array))))){ return (m2); }; var temp:Array = []; var i:int; var z:int; y = 0; while (y < 4) { x = 0; while (x < 5) { if (x == 4){ z = m[(i + 4)]; } else { z = 0; }; temp[(i + x)] = (((((m[i] * m2[x]) + (m[(i + 1)] * m2[(x + 5)])) + (m[(i + 2)] * m2[(x + 10)])) + (m[(i + 3)] * m2[(x + 15)])) + z); x++; }; i = (i + 5); y++; }; return (temp); } public static function setThreshold(m:Array, n:Number):Array{ if (isNaN(n)){ return (m); }; var temp:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * n), 0, 0, 0, 1, 0]; return (applyMatrix(temp, m)); } public static function colorize(m:Array, color:Number, amount:Number=1):Array{ if (isNaN(color)){ return (m); }; if (isNaN(amount)){ amount = 1; }; var r:Number = (((color >> 16) & 0xFF) / 0xFF); var g:Number = (((color >> 8) & 0xFF) / 0xFF); var b:Number = ((color & 0xFF) / 0xFF); var inv:Number = (1 - amount); var temp:Array = [(inv + ((amount * r) * _lumR)), ((amount * r) * _lumG), ((amount * r) * _lumB), 0, 0, ((amount * g) * _lumR), (inv + ((amount * g) * _lumG)), ((amount * g) * _lumB), 0, 0, ((amount * b) * _lumR), ((amount * b) * _lumG), (inv + ((amount * b) * _lumB)), 0, 0, 0, 0, 0, 1, 0]; return (applyMatrix(temp, m)); } public static function setBrightness(m:Array, n:Number):Array{ if (isNaN(n)){ return (m); }; n = ((n * 100) - 100); return (applyMatrix([1, 0, 0, 0, n, 0, 1, 0, 0, n, 0, 0, 1, 0, n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], m)); } } }//package com.greensock.plugins
Section 32
//ColorTransformPlugin (com.greensock.plugins.ColorTransformPlugin) package com.greensock.plugins { import flash.display.*; import flash.geom.*; import com.greensock.*; public class ColorTransformPlugin extends TintPlugin { public static const API:Number = 1; public function ColorTransformPlugin(){ super(); this.propName = "colorTransform"; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ var p:String; var ratio:Number; if (!(target is DisplayObject)){ return (false); }; var end:ColorTransform = target.transform.colorTransform; for (p in value) { if ((((p == "tint")) || ((p == "color")))){ if (value[p] != null){ end.color = int(value[p]); }; } else { if ((((((p == "tintAmount")) || ((p == "exposure")))) || ((p == "brightness")))){ } else { end[p] = value[p]; }; }; }; if (!isNaN(value.tintAmount)){ ratio = (value.tintAmount / (1 - (((end.redMultiplier + end.greenMultiplier) + end.blueMultiplier) / 3))); end.redOffset = (end.redOffset * ratio); end.greenOffset = (end.greenOffset * ratio); end.blueOffset = (end.blueOffset * ratio); end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = (1 - value.tintAmount))); } else { if (!isNaN(value.exposure)){ end.redOffset = (end.greenOffset = (end.blueOffset = (0xFF * (value.exposure - 1)))); end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = 1)); } else { if (!isNaN(value.brightness)){ end.redOffset = (end.greenOffset = (end.blueOffset = Math.max(0, ((value.brightness - 1) * 0xFF)))); end.redMultiplier = (end.greenMultiplier = (end.blueMultiplier = (1 - Math.abs((value.brightness - 1))))); }; }; }; _ignoreAlpha = Boolean(((!((tween.vars.alpha == undefined))) && ((value.alphaMultiplier == undefined)))); init((target as DisplayObject), end); return (true); } } }//package com.greensock.plugins
Section 33
//DropShadowFilterPlugin (com.greensock.plugins.DropShadowFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class DropShadowFilterPlugin extends FilterPlugin { public static const API:Number = 1; private static var _propNames:Array = ["distance", "angle", "color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout", "hideObject"]; public function DropShadowFilterPlugin(){ super(); this.propName = "dropShadowFilter"; this.overwriteProps = ["dropShadowFilter"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ _target = target; _type = DropShadowFilter; initFilter(value, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((value.quality) || (2)), value.inner, value.knockout, value.hideObject), _propNames); return (true); } } }//package com.greensock.plugins
Section 34
//EndArrayPlugin (com.greensock.plugins.EndArrayPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class EndArrayPlugin extends TweenPlugin { protected var _a:Array; protected var _info:Array; public static const API:Number = 1; public function EndArrayPlugin(){ _info = []; super(); this.propName = "endArray"; this.overwriteProps = ["endArray"]; } public function init(start:Array, end:Array):void{ _a = start; var i:int = end.length; while (i--) { if (((!((start[i] == end[i]))) && (!((start[i] == null))))){ _info[_info.length] = new ArrayTweenInfo(i, _a[i], (end[i] - _a[i])); }; }; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ if (((!((target is Array))) || (!((value is Array))))){ return (false); }; init((target as Array), value); return (true); } override public function set changeFactor(n:Number):void{ var ti:ArrayTweenInfo; var val:Number; var i:int = _info.length; if (this.round){ while (i--) { ti = _info[i]; val = (ti.start + (ti.change * n)); _a[ti.index] = ((val)>0) ? int((val + 0.5)) : int((val - 0.5)); }; } else { while (i--) { ti = _info[i]; _a[ti.index] = (ti.start + (ti.change * n)); }; }; } } }//package com.greensock.plugins class ArrayTweenInfo { public var change:Number; public var start:Number; public var index:uint; private function ArrayTweenInfo(index:uint, start:Number, change:Number){ super(); this.index = index; this.start = start; this.change = change; } }
Section 35
//FilterPlugin (com.greensock.plugins.FilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import com.greensock.core.*; import flash.filters.*; public class FilterPlugin extends TweenPlugin { protected var _remove:Boolean; protected var _target:Object; protected var _index:int; protected var _filter:BitmapFilter; protected var _type:Class; public static const VERSION:Number = 2.03; public static const API:Number = 1; public function FilterPlugin(){ super(); } public function onCompleteTween():void{ var filters:Array; var i:int; if (_remove){ filters = _target.filters; if (!(filters[_index] is _type)){ i = filters.length; while (i--) { if ((filters[i] is _type)){ filters.splice(i, 1); break; }; }; } else { filters.splice(_index, 1); }; _target.filters = filters; }; } protected function initFilter(props:Object, defaultFilter:BitmapFilter, propNames:Array):void{ var p:String; var i:int; var colorTween:HexColorsPlugin; var filters:Array = _target.filters; var extras:Object = ((props is BitmapFilter)) ? {} : props; _index = -1; if (extras.index != null){ _index = extras.index; } else { i = filters.length; while (i--) { if ((filters[i] is _type)){ _index = i; break; }; }; }; if ((((((_index == -1)) || ((filters[_index] == null)))) || ((extras.addFilter == true)))){ _index = ((extras.index)!=null) ? extras.index : filters.length; filters[_index] = defaultFilter; _target.filters = filters; }; _filter = filters[_index]; if (extras.remove == true){ _remove = true; this.onComplete = onCompleteTween; }; i = propNames.length; while (i--) { p = propNames[i]; if ((((p in props)) && (!((_filter[p] == props[p]))))){ if ((((((p == "color")) || ((p == "highlightColor")))) || ((p == "shadowColor")))){ colorTween = new HexColorsPlugin(); colorTween.initColor(_filter, p, _filter[p], props[p]); _tweens[_tweens.length] = new PropTween(colorTween, "changeFactor", 0, 1, p, false); } else { if ((((((((p == "quality")) || ((p == "inner")))) || ((p == "knockout")))) || ((p == "hideObject")))){ _filter[p] = props[p]; } else { addTween(_filter, p, _filter[p], props[p], p); }; }; }; }; } override public function set changeFactor(n:Number):void{ var ti:PropTween; var i:int = _tweens.length; var filters:Array = _target.filters; while (i--) { ti = _tweens[i]; ti.target[ti.property] = (ti.start + (ti.change * n)); }; if (!(filters[_index] is _type)){ i = (_index = filters.length); while (i--) { if ((filters[i] is _type)){ _index = i; break; }; }; }; filters[_index] = _filter; _target.filters = filters; } } }//package com.greensock.plugins
Section 36
//FrameLabelPlugin (com.greensock.plugins.FrameLabelPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class FrameLabelPlugin extends FramePlugin { public static const API:Number = 1; public function FrameLabelPlugin(){ super(); this.propName = "frameLabel"; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ if ((!(tween.target) is MovieClip)){ return (false); }; _target = (target as MovieClip); this.frame = _target.currentFrame; var labels:Array = _target.currentLabels; var label:String = value; var endFrame:int = _target.currentFrame; var i:int = labels.length; while (i--) { if (labels[i].name == label){ endFrame = labels[i].frame; break; }; }; if (this.frame != endFrame){ addTween(this, "frame", this.frame, endFrame, "frame"); }; return (true); } } }//package com.greensock.plugins
Section 37
//FramePlugin (com.greensock.plugins.FramePlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class FramePlugin extends TweenPlugin { protected var _target:MovieClip; public var frame:int; public static const API:Number = 1; public function FramePlugin(){ super(); this.propName = "frame"; this.overwriteProps = ["frame", "frameLabel"]; this.round = true; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ if (((!((target is MovieClip))) || (isNaN(value)))){ return (false); }; _target = (target as MovieClip); this.frame = _target.currentFrame; addTween(this, "frame", this.frame, value, "frame"); return (true); } override public function set changeFactor(n:Number):void{ updateTweens(n); _target.gotoAndStop(this.frame); } } }//package com.greensock.plugins
Section 38
//GlowFilterPlugin (com.greensock.plugins.GlowFilterPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.filters.*; public class GlowFilterPlugin extends FilterPlugin { public static const API:Number = 1; private static var _propNames:Array = ["color", "alpha", "blurX", "blurY", "strength", "quality", "inner", "knockout"]; public function GlowFilterPlugin(){ super(); this.propName = "glowFilter"; this.overwriteProps = ["glowFilter"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ _target = target; _type = GlowFilter; initFilter(value, new GlowFilter(0xFFFFFF, 0, 0, 0, ((value.strength) || (1)), ((value.quality) || (2)), value.inner, value.knockout), _propNames); return (true); } } }//package com.greensock.plugins
Section 39
//HexColorsPlugin (com.greensock.plugins.HexColorsPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class HexColorsPlugin extends TweenPlugin { protected var _colors:Array; public static const API:Number = 1; public function HexColorsPlugin(){ super(); this.propName = "hexColors"; this.overwriteProps = []; _colors = []; } override public function killProps(lookup:Object):void{ var i:int = (_colors.length - 1); while (i > -1) { if (lookup[_colors[i][1]] != undefined){ _colors.splice(i, 1); }; i--; }; super.killProps(lookup); } public function initColor(target:Object, propName:String, start:uint, end:uint):void{ var r:Number; var g:Number; var b:Number; if (start != end){ r = (start >> 16); g = ((start >> 8) & 0xFF); b = (start & 0xFF); _colors[_colors.length] = [target, propName, r, ((end >> 16) - r), g, (((end >> 8) & 0xFF) - g), b, ((end & 0xFF) - b)]; this.overwriteProps[this.overwriteProps.length] = propName; }; } override public function set changeFactor(n:Number):void{ var i:int; var a:Array; i = (_colors.length - 1); while (i > -1) { a = _colors[i]; a[0][a[1]] = ((((a[2] + (n * a[3])) << 16) | ((a[4] + (n * a[5])) << 8)) | (a[6] + (n * a[7]))); i--; }; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ var p:String; for (p in value) { initColor(target, p, uint(target[p]), uint(value[p])); }; return (true); } } }//package com.greensock.plugins
Section 40
//RemoveTintPlugin (com.greensock.plugins.RemoveTintPlugin) package com.greensock.plugins { public class RemoveTintPlugin extends TintPlugin { public static const API:Number = 1; public function RemoveTintPlugin(){ super(); this.propName = "removeTint"; } } }//package com.greensock.plugins
Section 41
//RoundPropsPlugin (com.greensock.plugins.RoundPropsPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class RoundPropsPlugin extends TweenPlugin { public static const API:Number = 1; public function RoundPropsPlugin(){ super(); this.propName = "roundProps"; this.overwriteProps = []; this.round = true; } public function add(object:Object, propName:String, start:Number, change:Number):void{ addTween(object, propName, start, (start + change), propName); this.overwriteProps[this.overwriteProps.length] = propName; } } }//package com.greensock.plugins
Section 42
//ShortRotationPlugin (com.greensock.plugins.ShortRotationPlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class ShortRotationPlugin extends TweenPlugin { public static const API:Number = 1; public function ShortRotationPlugin(){ super(); this.propName = "shortRotation"; this.overwriteProps = []; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ var p:String; if (typeof(value) == "number"){ return (false); }; for (p in value) { initRotation(target, p, target[p], ((typeof(value[p]))=="number") ? Number(value[p]) : (target[p] + Number(value[p]))); }; return (true); } public function initRotation(target:Object, propName:String, start:Number, end:Number):void{ var dif:Number = ((end - start) % 360); if (dif != (dif % 180)){ dif = ((dif)<0) ? (dif + 360) : (dif - 360); }; addTween(target, propName, start, (start + dif), propName); this.overwriteProps[this.overwriteProps.length] = propName; } } }//package com.greensock.plugins
Section 43
//TintPlugin (com.greensock.plugins.TintPlugin) package com.greensock.plugins { import flash.display.*; import flash.geom.*; import com.greensock.*; import com.greensock.core.*; public class TintPlugin extends TweenPlugin { protected var _ct:ColorTransform; protected var _transform:Transform; protected var _ignoreAlpha:Boolean; public static const API:Number = 1; protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"]; public function TintPlugin(){ super(); this.propName = "tint"; this.overwriteProps = ["tint"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ if (!(target is DisplayObject)){ return (false); }; var end:ColorTransform = new ColorTransform(); if (((!((value == null))) && (!((tween.vars.removeTint == true))))){ end.color = uint(value); }; _ignoreAlpha = true; init((target as DisplayObject), end); return (true); } override public function set changeFactor(n:Number):void{ var ct:ColorTransform; updateTweens(n); if (_ignoreAlpha){ ct = _transform.colorTransform; _ct.alphaMultiplier = ct.alphaMultiplier; _ct.alphaOffset = ct.alphaOffset; }; _transform.colorTransform = _ct; } public function init(target:DisplayObject, end:ColorTransform):void{ var p:String; _transform = target.transform; _ct = _transform.colorTransform; var i:int = _props.length; while (i--) { p = _props[i]; if (_ct[p] != end[p]){ _tweens[_tweens.length] = new PropTween(_ct, p, _ct[p], (end[p] - _ct[p]), "tint", false); }; }; } } }//package com.greensock.plugins
Section 44
//TweenPlugin (com.greensock.plugins.TweenPlugin) package com.greensock.plugins { import com.greensock.*; import com.greensock.core.*; public class TweenPlugin { public var activeDisable:Boolean; protected var _changeFactor:Number;// = 0 protected var _tweens:Array; public var onDisable:Function; public var propName:String; public var round:Boolean; public var onEnable:Function; public var priority:int;// = 0 public var overwriteProps:Array; public var onComplete:Function; public static const VERSION:Number = 1.31; public static const API:Number = 1; public function TweenPlugin(){ _tweens = []; super(); } protected function updateTweens(changeFactor:Number):void{ var pt:PropTween; var val:Number; var i:int = _tweens.length; if (this.round){ while (i--) { pt = _tweens[i]; val = (pt.start + (pt.change * changeFactor)); pt.target[pt.property] = ((val)>0) ? int((val + 0.5)) : int((val - 0.5)); }; } else { while (i--) { pt = _tweens[i]; pt.target[pt.property] = (pt.start + (pt.change * changeFactor)); }; }; } protected function addTween(object:Object, propName:String, start:Number, end, overwriteProp:String=null):void{ var change:Number; if (end != null){ change = ((typeof(end))=="number") ? (Number(end) - start) : Number(end); if (change != 0){ _tweens[_tweens.length] = new PropTween(object, propName, start, change, ((overwriteProp) || (propName)), false); }; }; } public function get changeFactor():Number{ return (_changeFactor); } public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ addTween(target, this.propName, target[this.propName], value, this.propName); return (true); } public function killProps(lookup:Object):void{ var i:int = this.overwriteProps.length; while (i--) { if ((this.overwriteProps[i] in lookup)){ this.overwriteProps.splice(i, 1); }; }; i = _tweens.length; while (i--) { if ((PropTween(_tweens[i]).name in lookup)){ _tweens.splice(i, 1); }; }; } public function set changeFactor(n:Number):void{ updateTweens(n); _changeFactor = n; } public static function activate(plugins:Array):Boolean{ var instance:Object; TweenLite.onPluginEvent = TweenPlugin.onTweenEvent; var i:int = plugins.length; while (i--) { if (plugins[i].hasOwnProperty("API")){ instance = new ((plugins[i] as Class)); TweenLite.plugins[instance.propName] = plugins[i]; }; }; return (true); } private static function onTweenEvent(type:String, tween:TweenLite):Boolean{ var changed:Boolean; var tweens:Array; var i:int; var pt:PropTween = tween.cachedPT1; if (type == "onInit"){ tweens = []; while (pt) { tweens[tweens.length] = pt; pt = pt.nextNode; }; tweens.sortOn("priority", (Array.NUMERIC | Array.DESCENDING)); i = tweens.length; while (i--) { PropTween(tweens[i]).nextNode = tweens[(i + 1)]; PropTween(tweens[i]).prevNode = tweens[(i - 1)]; }; tween.cachedPT1 = tweens[0]; } else { while (pt) { if (((pt.isPlugin) && (pt.target[type]))){ if (pt.target.activeDisable){ changed = true; }; var _local7 = pt.target; _local7[type](); }; pt = pt.nextNode; }; }; return (changed); } } }//package com.greensock.plugins
Section 45
//VisiblePlugin (com.greensock.plugins.VisiblePlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; public class VisiblePlugin extends TweenPlugin { protected var _target:Object; protected var _initVal:Boolean; protected var _visible:Boolean; protected var _tween:TweenLite; public static const API:Number = 1; public function VisiblePlugin(){ super(); this.propName = "visible"; this.overwriteProps = ["visible"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ _target = target; _tween = tween; _initVal = _target.visible; _visible = Boolean(value); return (true); } override public function set changeFactor(n:Number):void{ if ((((n == 1)) && ((((_tween.cachedDuration == _tween.cachedTime)) || ((_tween.cachedTime == 0)))))){ _target.visible = _visible; } else { _target.visible = _initVal; }; } } }//package com.greensock.plugins
Section 46
//VolumePlugin (com.greensock.plugins.VolumePlugin) package com.greensock.plugins { import flash.display.*; import com.greensock.*; import flash.media.*; public class VolumePlugin extends TweenPlugin { protected var _target:Object; protected var _st:SoundTransform; public static const API:Number = 1; public function VolumePlugin(){ super(); this.propName = "volume"; this.overwriteProps = ["volume"]; } override public function onInitTween(target:Object, value, tween:TweenLite):Boolean{ if (((isNaN(value)) || (!(target.hasOwnProperty("soundTransform"))))){ return (false); }; _target = target; _st = _target.soundTransform; addTween(_st, "volume", _st.volume, value, "volume"); return (true); } override public function set changeFactor(n:Number):void{ updateTweens(n); _target.soundTransform = _st; } } }//package com.greensock.plugins
Section 47
//OverwriteManager (com.greensock.OverwriteManager) package com.greensock { import com.greensock.core.*; import flash.utils.*; import flash.errors.*; public class OverwriteManager { public static const ALL_ONSTART:int = 4; public static const CONCURRENT:int = 3; public static const ALL_IMMEDIATE:int = 1; public static const PREEXISTING:int = 5; public static const AUTO:int = 2; public static const version:Number = 6; public static const NONE:int = 0; public static var enabled:Boolean; public static var mode:int; public function OverwriteManager(){ super(); } public static function getGlobalPaused(tween:TweenCore):Boolean{ while (tween) { if (tween.cachedPaused){ return (true); }; tween = tween.timeline; }; return (false); } public static function init(defaultMode:int=2):int{ if (TweenLite.version < 11.099994){ throw (new Error("Warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.")); }; TweenLite.overwriteManager = OverwriteManager; mode = defaultMode; enabled = true; return (mode); } public static function manageOverwrites(tween:TweenLite, props:Object, targetTweens:Array, mode:uint):Boolean{ var i:int; var changed:Boolean; var curTween:TweenLite; var l:uint; var combinedTimeScale:Number; var combinedStartTime:Number; var cousin:TweenCore; var cousinStartTime:Number; var timeline:SimpleTimeline; if (mode >= 4){ l = targetTweens.length; i = 0; while (i < l) { curTween = targetTweens[i]; if (curTween != tween){ if (curTween.setEnabled(false, false)){ changed = true; }; } else { if (mode == 5){ break; }; }; i++; }; return (changed); }; var startTime:Number = tween.startTime; var overlaps:Array = []; var cousins:Array = []; var cCount:uint; var oCount:uint; i = targetTweens.length; while (i--) { curTween = targetTweens[i]; if ((((curTween == tween)) || (curTween.gc))){ } else { if (curTween.timeline != tween.timeline){ if (!getGlobalPaused(curTween)){ var _temp1 = cCount; cCount = (cCount + 1); var _local19 = _temp1; cousins[_local19] = curTween; }; } else { if ((((((curTween.startTime <= startTime)) && (((curTween.startTime + curTween.totalDuration) > startTime)))) && (!(getGlobalPaused(curTween))))){ var _temp2 = oCount; oCount = (oCount + 1); _local19 = _temp2; overlaps[_local19] = curTween; }; }; }; }; if (cCount != 0){ combinedTimeScale = tween.cachedTimeScale; combinedStartTime = startTime; timeline = tween.timeline; while (timeline) { combinedTimeScale = (combinedTimeScale * timeline.cachedTimeScale); combinedStartTime = (combinedStartTime + timeline.startTime); timeline = timeline.timeline; }; startTime = (combinedTimeScale * combinedStartTime); i = cCount; while (i--) { cousin = cousins[i]; combinedTimeScale = cousin.cachedTimeScale; combinedStartTime = cousin.startTime; timeline = cousin.timeline; while (timeline) { combinedTimeScale = (combinedTimeScale * timeline.cachedTimeScale); combinedStartTime = (combinedStartTime + timeline.startTime); timeline = timeline.timeline; }; cousinStartTime = (combinedTimeScale * combinedStartTime); if ((((cousinStartTime <= startTime)) && (((((cousinStartTime + (cousin.totalDuration * combinedTimeScale)) > startTime)) || ((cousin.cachedDuration == 0)))))){ var _temp3 = oCount; oCount = (oCount + 1); _local19 = _temp3; overlaps[_local19] = cousin; }; }; }; if (oCount == 0){ return (changed); }; i = oCount; if (mode == 2){ while (i--) { curTween = overlaps[i]; if (curTween.killVars(props)){ changed = true; }; if ((((curTween.cachedPT1 == null)) && (curTween.initted))){ curTween.setEnabled(false, false); }; }; } else { while (i--) { if (TweenLite(overlaps[i]).setEnabled(false, false)){ changed = true; }; }; }; return (changed); } } }//package com.greensock
Section 48
//TimelineLite (com.greensock.TimelineLite) package com.greensock { import com.greensock.core.*; import flash.utils.*; public class TimelineLite extends SimpleTimeline { protected var _endCaps:Array; protected var _labels:Object; public static const version:Number = 1.142; private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(2); ; public function TimelineLite(vars:Object=null){ super(vars); _endCaps = []; _labels = {}; this.autoRemoveChildren = Boolean((this.vars.autoRemoveChildren == true)); _hasUpdate = Boolean((typeof(this.vars.onUpdate) == "function")); if ((this.vars.tweens is Array)){ this.insertMultiple(this.vars.tweens, 0, ((this.vars.align) || ("normal")), ((this.vars.stagger) || (0))); }; } public function set timeScale(n:Number):void{ if (n == 0){ n = 0.0001; }; var tlTime:Number = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime; this.cachedStartTime = (tlTime - (((tlTime - this.cachedStartTime) * this.cachedTimeScale) / n)); this.cachedTimeScale = n; setDirtyCache(false); } public function stop():void{ this.paused = true; } override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ var tween:TweenCore; var isComplete:Boolean; var rendered:Boolean; var next:TweenCore; var dur:Number; if (this.gc){ this.setEnabled(true, false); } else { if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; }; var totalDur:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; var prevTime:Number = this.cachedTime; var prevStart:Number = this.cachedStartTime; if (time >= totalDur){ if ((((_rawPrevTime <= totalDur)) && (!((_rawPrevTime == time))))){ this.cachedTotalTime = (this.cachedTime = totalDur); forceChildrenToEnd(totalDur, suppressEvents); isComplete = !(this.hasPausedChild()); rendered = true; if ((((((this.cachedDuration == 0)) && (isComplete))) && ((((time == 0)) || ((_rawPrevTime < 0)))))){ force = true; }; }; } else { if (time <= 0){ if (time < 0){ this.active = false; if ((((this.cachedDuration == 0)) && ((_rawPrevTime > 0)))){ force = true; isComplete = true; }; }; if ((((_rawPrevTime >= 0)) && (!((_rawPrevTime == time))))){ forceChildrenToBeginning(0, suppressEvents); this.cachedTotalTime = 0; this.cachedTime = 0; rendered = true; if (this.cachedReversed){ isComplete = true; }; }; } else { this.cachedTotalTime = (this.cachedTime = time); }; }; _rawPrevTime = time; if ((((this.cachedTime == prevTime)) && (!(force)))){ return; }; if (!this.initted){ this.initted = true; }; if ((((((((prevTime == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(suppressEvents)))){ this.vars.onStart.apply(null, this.vars.onStartParams); }; if (rendered){ } else { if ((this.cachedTime - prevTime) > 0){ tween = _firstChild; while (tween) { next = tween.nextNode; if (((tween.active) || (((((!(tween.cachedPaused)) && ((tween.cachedStartTime <= this.cachedTime)))) && (!(tween.gc)))))){ if (!tween.cachedReversed){ tween.renderTime(((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false); } else { dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration; tween.renderTime((dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false); }; }; tween = next; }; } else { tween = _lastChild; while (tween) { next = tween.prevNode; if (((tween.active) || (((((!(tween.cachedPaused)) && ((tween.cachedStartTime <= prevTime)))) && (!(tween.gc)))))){ if (!tween.cachedReversed){ tween.renderTime(((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false); } else { dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration; tween.renderTime((dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false); }; }; tween = next; }; }; }; if (((_hasUpdate) && (!(suppressEvents)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (((isComplete) && ((prevStart == this.cachedStartTime)))){ complete(true, suppressEvents); }; } override public function remove(tween:TweenCore, skipDisable:Boolean=false):void{ if (tween.gc){ return; }; if (!skipDisable){ tween.setEnabled(false, true); }; var first:TweenCore = ((_firstChild) || (_endCaps[0])); var last:TweenCore = ((_lastChild) || (_endCaps[1])); if (tween.nextNode){ tween.nextNode.prevNode = tween.prevNode; } else { if (last == tween){ last = tween.prevNode; }; }; if (tween.prevNode){ tween.prevNode.nextNode = tween.nextNode; } else { if (first == tween){ first = tween.nextNode; }; }; if (this.gc){ _endCaps[0] = first; _endCaps[1] = last; } else { _firstChild = first; _lastChild = last; }; setDirtyCache(true); } public function get currentProgress():Number{ return ((this.cachedTime / this.duration)); } override public function get totalDuration():Number{ var max:Number; var end:Number; var tween:TweenCore; var prevStart:Number; var next:TweenCore; if (this.cacheIsDirty){ max = 0; tween = ((_firstChild) || (_endCaps[0])); prevStart = -(Infinity); while (tween) { next = tween.nextNode; if (tween.cachedStartTime < prevStart){ this.addChild(tween); prevStart = tween.prevNode.cachedStartTime; } else { prevStart = tween.cachedStartTime; }; if (tween.cachedStartTime < 0){ max = (max - tween.cachedStartTime); this.shiftChildren(-(tween.cachedStartTime), false, -9999999999); }; end = (tween.cachedStartTime + (tween.totalDuration / tween.cachedTimeScale)); if (end > max){ max = end; }; tween = next; }; this.cachedDuration = (this.cachedTotalDuration = max); this.cacheIsDirty = false; }; return (this.cachedTotalDuration); } public function gotoAndPlay(timeOrLabel, suppressEvents:Boolean=true):void{ goto(timeOrLabel, suppressEvents); play(); } public function appendMultiple(tweens:Array, offset:Number=0, align:String="normal", stagger:Number=0):void{ insertMultiple(tweens, (this.duration + offset), align, stagger); } public function set currentProgress(n:Number):void{ setTotalTime((this.duration * n), false); } public function clear(tweens:Array=null):void{ if (tweens == null){ tweens = getChildren(false, true, true); }; var i:int = tweens.length; while (i--) { TweenCore(tweens[i]).setEnabled(false, false); }; } public function prepend(tween:TweenCore, adjustLabels:Boolean=false):void{ shiftChildren(((tween.totalDuration / tween.cachedTimeScale) + tween.delay), adjustLabels, 0); insert(tween, 0); } public function removeLabel(label:String):Number{ var n:Number = _labels[label]; delete _labels[label]; return (n); } public function addLabel(label:String, time:Number):void{ _labels[label] = time; } public function hasPausedChild():Boolean{ var tween:TweenCore = ((_firstChild) || (_endCaps[0])); while (tween) { if (((tween.cachedPaused) || ((((tween is TimelineLite)) && ((tween as TimelineLite).hasPausedChild()))))){ return (true); }; tween = tween.nextNode; }; return (false); } public function getTweensOf(target:Object, nested:Boolean=true):Array{ var i:int; var tweens:Array = getChildren(nested, true, false); var a:Array = []; var l:uint = tweens.length; i = 0; while (i < l) { if (TweenLite(tweens[i]).target == target){ a[a.length] = tweens[i]; }; i++; }; return (a); } public function gotoAndStop(timeOrLabel, suppressEvents:Boolean=true):void{ goto(timeOrLabel, suppressEvents); this.paused = true; } public function append(tween:TweenCore, offset:Number=0):void{ insert(tween, (this.duration + offset)); } override public function get duration():Number{ var d:Number; if (this.cacheIsDirty){ d = this.totalDuration; }; return (this.cachedDuration); } public function get useFrames():Boolean{ var tl:SimpleTimeline = this.timeline; while (tl.timeline) { tl = tl.timeline; }; return (Boolean((tl == TweenLite.rootFramesTimeline))); } public function shiftChildren(amount:Number, adjustLabels:Boolean=false, ignoreBeforeTime:Number=0):void{ var p:String; var tween:TweenCore = ((_firstChild) || (_endCaps[0])); while (tween) { if (tween.cachedStartTime >= ignoreBeforeTime){ tween.cachedStartTime = (tween.cachedStartTime + amount); }; tween = tween.nextNode; }; if (adjustLabels){ for (p in _labels) { if (_labels[p] >= ignoreBeforeTime){ _labels[p] = (_labels[p] + amount); }; }; }; this.setDirtyCache(true); } public function goto(timeOrLabel, suppressEvents:Boolean=true):void{ if (typeof(timeOrLabel) == "string"){ if ((timeOrLabel in _labels)){ setTotalTime(Number(_labels[timeOrLabel]), suppressEvents); }; } else { setTotalTime(Number(timeOrLabel), suppressEvents); }; } public function killTweensOf(target:Object, nested:Boolean=true):Boolean{ var tweens:Array = getTweensOf(target, nested); var i:int = tweens.length; while (i--) { TweenLite(tweens[i]).setEnabled(false, false); }; return (Boolean((tweens.length > 0))); } override public function invalidate():void{ var tween:TweenCore = ((_firstChild) || (_endCaps[0])); while (tween) { tween.invalidate(); tween = tween.nextNode; }; } public function insertMultiple(tweens:Array, timeOrLabel=0, align:String="normal", stagger:Number=0):void{ var i:int; var tween:TweenCore; var curTime:Number = ((Number(timeOrLabel)) || (0)); var l:uint = tweens.length; if (typeof(timeOrLabel) == "string"){ if (!(timeOrLabel in _labels)){ addLabel(timeOrLabel, this.duration); }; curTime = _labels[timeOrLabel]; }; i = 0; while (i < l) { tween = (tweens[i] as TweenCore); insert(tween, curTime); if (align == "sequence"){ curTime = (tween.cachedStartTime + (tween.totalDuration / tween.cachedTimeScale)); } else { if (align == "start"){ tween.cachedStartTime = (tween.cachedStartTime - tween.delay); }; }; curTime = (curTime + stagger); i++; }; } public function getLabelTime(label:String):Number{ return (((label in _labels)) ? Number(_labels[label]) : -1); } override public function get rawTime():Number{ if (((!((this.cachedTotalTime == 0))) && (!((this.cachedTotalTime == this.cachedTotalDuration))))){ return (this.cachedTotalTime); }; return (((this.timeline.rawTime - this.cachedStartTime) * this.cachedTimeScale)); } override public function set duration(n:Number):void{ if (((!((this.duration == 0))) && (!((n == 0))))){ this.timeScale = (this.duration / n); }; } override public function set totalDuration(n:Number):void{ if (((!((this.totalDuration == 0))) && (!((n == 0))))){ this.timeScale = (this.totalDuration / n); }; } public function getChildren(nested:Boolean=true, tweens:Boolean=true, timelines:Boolean=true, ignoreBeforeTime:Number=-9999999999):Array{ var a:Array = []; var tween:TweenCore = ((_firstChild) || (_endCaps[0])); var cnt:uint; while (tween) { if (tween.cachedStartTime < ignoreBeforeTime){ } else { if ((tween is TweenLite)){ if (tweens){ var _temp1 = cnt; cnt = (cnt + 1); var _local8 = _temp1; a[_local8] = tween; }; } else { if (timelines){ var _temp2 = cnt; cnt = (cnt + 1); _local8 = _temp2; a[_local8] = tween; }; if (nested){ a = a.concat(TimelineLite(tween).getChildren(true, tweens, timelines)); }; }; }; tween = tween.nextNode; }; return (a); } protected function forceChildrenToEnd(time:Number, suppressEvents:Boolean=false):Number{ var next:TweenCore; var dur:Number; var tween:TweenCore = _firstChild; while (tween) { next = tween.nextNode; if (((tween.active) || (((((!(tween.cachedPaused)) && (!(tween.gc)))) && (((!((tween.cachedTotalTime == tween.cachedTotalDuration))) || ((tween.cachedDuration == 0)))))))){ if ((((time == this.cachedDuration)) && (((!((tween.cachedDuration == 0))) || ((tween.cachedStartTime == this.cachedDuration)))))){ tween.renderTime((tween.cachedReversed) ? 0 : tween.cachedTotalDuration, suppressEvents, false); } else { if (!tween.cachedReversed){ tween.renderTime(((time - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false); } else { dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration; tween.renderTime((dur - ((time - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false); }; }; }; tween = next; }; return (time); } protected function forceChildrenToBeginning(time:Number, suppressEvents:Boolean=false):Number{ var next:TweenCore; var dur:Number; var tween:TweenCore = _lastChild; while (tween) { next = tween.prevNode; if (((tween.active) || (((((!(tween.cachedPaused)) && (!(tween.gc)))) && (((!((tween.cachedTotalTime == 0))) || ((tween.cachedDuration == 0)))))))){ if ((((time == 0)) && (((!((tween.cachedDuration == 0))) || ((tween.cachedStartTime == 0)))))){ tween.renderTime((tween.cachedReversed) ? tween.cachedTotalDuration : 0, suppressEvents, false); } else { if (!tween.cachedReversed){ tween.renderTime(((time - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false); } else { dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration; tween.renderTime((dur - ((time - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false); }; }; }; tween = next; }; return (time); } public function insert(tween:TweenCore, timeOrLabel=0):void{ if (typeof(timeOrLabel) == "string"){ if (!(timeOrLabel in _labels)){ addLabel(timeOrLabel, this.duration); }; timeOrLabel = Number(_labels[timeOrLabel]); }; tween.cachedStartTime = (Number(timeOrLabel) + tween.delay); addChild(tween); } override public function addChild(tween:TweenCore):void{ var curTween:TweenCore; var st:Number; if (((!(tween.gc)) && (tween.timeline))){ tween.timeline.remove(tween, true); }; tween.timeline = this; if (tween.gc){ tween.setEnabled(true, true); }; setDirtyCache(true); var first:TweenCore = ((_firstChild) || (_endCaps[0])); var last:TweenCore = ((_lastChild) || (_endCaps[1])); if (last == null){ last = tween; first = last; tween.nextNode = (tween.prevNode = null); } else { curTween = last; st = tween.cachedStartTime; while (((!((curTween == null))) && ((st <= curTween.cachedStartTime)))) { curTween = curTween.prevNode; }; if (curTween == null){ first.prevNode = tween; tween.nextNode = first; tween.prevNode = null; first = tween; } else { if (curTween.nextNode){ curTween.nextNode.prevNode = tween; } else { if (curTween == last){ last = tween; }; }; tween.prevNode = curTween; tween.nextNode = curTween.nextNode; curTween.nextNode = tween; }; }; if (this.gc){ _endCaps[0] = first; _endCaps[1] = last; } else { _firstChild = first; _lastChild = last; }; } public function get timeScale():Number{ return (this.cachedTimeScale); } public function prependMultiple(tweens:Array, align:String="normal", stagger:Number=0, adjustLabels:Boolean=false):void{ var tl:TimelineLite = new TimelineLite({tweens:tweens, align:align, stagger:stagger}); shiftChildren(tl.duration, adjustLabels, 0); insertMultiple(tweens, 0, align, stagger); tl.kill(); } override public function setEnabled(enabled:Boolean, ignoreTimeline:Boolean=false):Boolean{ var tween:TweenCore; var next:TweenCore; if (enabled == this.gc){ if (enabled){ tween = _endCaps[0]; _firstChild = tween; _lastChild = _endCaps[1]; } else { tween = _firstChild; _endCaps = [_firstChild, _lastChild]; _firstChild = (_lastChild = null); }; while (tween) { tween.setEnabled(enabled, true); tween = tween.nextNode; }; }; return (super.setEnabled(enabled, ignoreTimeline)); } } }//package com.greensock
Section 49
//TimelineMax (com.greensock.TimelineMax) package com.greensock { import flash.events.*; import com.greensock.core.*; import flash.utils.*; import com.greensock.events.*; public class TimelineMax extends TimelineLite implements IEventDispatcher { protected var _cyclesComplete:uint; protected var _dispatcher:EventDispatcher; protected var _hasUpdateListener:Boolean; public var yoyo:Boolean; protected var _repeatDelay:Number; protected var _repeat:int; public static const version:Number = 1.13; public function TimelineMax(vars:Object=null){ super(vars); _repeat = ((this.vars.repeat) || (0)); _repeatDelay = ((this.vars.repeatDelay) || (0)); _cyclesComplete = 0; this.yoyo = ((this.vars.yoyo) || (false)); this.cacheIsDirty = true; if (((((((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))) || (!((this.vars.onRepeatListener == null))))) || (!((this.vars.onReverseCompleteListener == null))))){ initDispatcher(); }; } public function dispatchEvent(e:Event):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(e)); } public function get currentLabel():String{ return (getLabelBefore((this.cachedTime + 1E-8))); } override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ var tween:TweenCore; var isComplete:Boolean; var rendered:Boolean; var repeated:Boolean; var next:TweenCore; var dur:Number; var cycleDuration:Number; var prevCycle:Number; var forward:Boolean; var prevForward:Boolean; var wrap:Boolean; if (this.gc){ this.setEnabled(true, false); } else { if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; }; var totalDur:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; var prevTime:Number = this.cachedTime; var prevStart:Number = this.cachedStartTime; if (time >= totalDur){ if ((((_rawPrevTime <= totalDur)) && (!((_rawPrevTime == time))))){ if (((((!(this.cachedReversed)) && (this.yoyo))) && (!(((_repeat % 2) == 0))))){ forceChildrenToBeginning(0, suppressEvents); this.cachedTime = 0; } else { forceChildrenToEnd(this.cachedDuration, suppressEvents); this.cachedTime = this.cachedDuration; }; this.cachedTotalTime = totalDur; isComplete = !(this.hasPausedChild()); rendered = true; if ((((((this.cachedDuration == 0)) && (isComplete))) && ((((time == 0)) || ((_rawPrevTime < 0)))))){ force = true; }; }; } else { if (time <= 0){ if (time < 0){ this.active = false; if ((((this.cachedDuration == 0)) && ((_rawPrevTime > 0)))){ force = true; isComplete = true; }; }; if ((((_rawPrevTime >= 0)) && (!((_rawPrevTime == time))))){ this.cachedTotalTime = 0; if (((((!(this.cachedReversed)) && (this.yoyo))) && (!(((_repeat % 2) == 0))))){ forceChildrenToEnd(this.cachedDuration, suppressEvents); this.cachedTime = this.cachedDuration; } else { forceChildrenToBeginning(0, suppressEvents); this.cachedTime = 0; }; rendered = true; if (this.cachedReversed){ isComplete = true; }; }; } else { this.cachedTotalTime = (this.cachedTime = time); }; }; _rawPrevTime = time; if (_repeat != 0){ cycleDuration = (this.cachedDuration + _repeatDelay); if (isComplete){ if (((this.yoyo) && ((_repeat % 2)))){ this.cachedTime = 0; }; } else { if (time > 0){ prevCycle = _cyclesComplete; if (_cyclesComplete != (_cyclesComplete = int((this.cachedTotalTime / cycleDuration)))){ repeated = true; }; this.cachedTime = (((this.cachedTotalTime / cycleDuration) - _cyclesComplete) * cycleDuration); if (((this.yoyo) && ((_cyclesComplete % 2)))){ this.cachedTime = (this.cachedDuration - this.cachedTime); } else { if (this.cachedTime >= this.cachedDuration){ this.cachedTime = this.cachedDuration; }; }; if (this.cachedTime < 0){ this.cachedTime = 0; }; }; }; if (((((repeated) && (!(isComplete)))) && (((!((this.cachedTime == prevTime))) || (force))))){ forward = Boolean(((!(this.yoyo)) || (((_cyclesComplete % 2) == 0)))); prevForward = Boolean(((!(this.yoyo)) || (((prevCycle % 2) == 0)))); wrap = Boolean((forward == prevForward)); if (prevCycle > _cyclesComplete){ prevForward = !(prevForward); }; if (prevForward){ prevTime = forceChildrenToEnd(this.cachedDuration, suppressEvents); if (wrap){ prevTime = forceChildrenToBeginning(0, true); }; } else { prevTime = forceChildrenToBeginning(0, suppressEvents); if (wrap){ prevTime = forceChildrenToEnd(this.cachedDuration, true); }; }; rendered = false; }; }; if ((((this.cachedTime == prevTime)) && (!(force)))){ return; }; if (!this.initted){ this.initted = true; }; if ((((((prevTime == 0)) && (!((this.cachedTotalTime == 0))))) && (!(suppressEvents)))){ if (this.vars.onStart){ this.vars.onStart.apply(null, this.vars.onStartParams); }; if (_dispatcher){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START)); }; }; if (rendered){ } else { if ((this.cachedTime - prevTime) > 0){ tween = _firstChild; while (tween) { next = tween.nextNode; if (((tween.active) || (((((!(tween.cachedPaused)) && ((tween.cachedStartTime <= this.cachedTime)))) && (!(tween.gc)))))){ if (!tween.cachedReversed){ tween.renderTime(((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false); } else { dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration; tween.renderTime((dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false); }; }; tween = next; }; } else { tween = _lastChild; while (tween) { next = tween.prevNode; if (((tween.active) || (((((!(tween.cachedPaused)) && ((tween.cachedStartTime <= prevTime)))) && (!(tween.gc)))))){ if (!tween.cachedReversed){ tween.renderTime(((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale), suppressEvents, false); } else { dur = (tween.cacheIsDirty) ? tween.totalDuration : tween.cachedTotalDuration; tween.renderTime((dur - ((this.cachedTime - tween.cachedStartTime) * tween.cachedTimeScale)), suppressEvents, false); }; }; tween = next; }; }; }; if (((_hasUpdate) && (!(suppressEvents)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (((_hasUpdateListener) && (!(suppressEvents)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE)); }; if (((isComplete) && ((prevStart == this.cachedStartTime)))){ complete(true, suppressEvents); } else { if (((repeated) && (!(suppressEvents)))){ if (this.vars.onRepeat){ this.vars.onRepeat.apply(null, this.vars.onRepeatParams); }; if (_dispatcher){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT)); }; }; }; } public function addCallback(callback:Function, timeOrLabel, params:Array=null):TweenLite{ var cb:TweenLite = new TweenLite(callback, 0, {onComplete:callback, onCompleteParams:params, overwrite:0, immediateRender:false}); insert(cb, timeOrLabel); return (cb); } public function set repeatDelay(n:Number):void{ _repeatDelay = n; setDirtyCache(true); } public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{ if (_dispatcher != null){ _dispatcher.removeEventListener(type, listener, useCapture); }; } override public function set currentTime(n:Number):void{ if (_cyclesComplete == 0){ setTotalTime(n, false); } else { if (((this.yoyo) && (((_cyclesComplete % 2) == 1)))){ setTotalTime(((this.duration - n) + (_cyclesComplete * (this.cachedDuration + _repeatDelay))), false); } else { setTotalTime((n + (_cyclesComplete * (this.duration + _repeatDelay))), false); }; }; } public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{ if (_dispatcher == null){ initDispatcher(); }; if (type == TweenEvent.UPDATE){ _hasUpdateListener = true; }; _dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference); } public function tweenTo(timeOrLabel, vars:Object=null):TweenLite{ var p:String; var varsCopy:Object = {ease:easeNone, overwrite:2, useFrames:this.useFrames}; for (p in vars) { varsCopy[p] = vars[p]; }; if (typeof(timeOrLabel) == "string"){ if (!(timeOrLabel in _labels)){ trace((("TimelineMax warning: tweenTo(" + timeOrLabel) + ") failed because the label was not found.")); return (null); }; varsCopy.currentTime = getLabelTime(String(timeOrLabel)); } else { varsCopy.currentTime = Number(timeOrLabel); }; this.paused = true; return (new TweenLite(this, (Math.abs((Number(varsCopy.currentTime) - this.cachedTime)) / this.cachedTimeScale), varsCopy)); } public function hasEventListener(type:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(type)); } protected function initDispatcher():void{ if (_dispatcher == null){ _dispatcher = new EventDispatcher(this); if ((this.vars.onStartListener is Function)){ _dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true); }; if ((this.vars.onUpdateListener is Function)){ _dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true); _hasUpdateListener = true; }; if ((this.vars.onCompleteListener is Function)){ _dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true); }; if ((this.vars.onRepeatListener is Function)){ _dispatcher.addEventListener(TweenEvent.REPEAT, this.vars.onRepeatListener, false, 0, true); }; if ((this.vars.onReverseCompleteListener is Function)){ _dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE, this.vars.onReverseCompleteListener, false, 0, true); }; }; } public function get repeat():int{ return (_repeat); } public function getLabelBefore(time:Number=NaN):String{ if (((!(time)) && (!((time == 0))))){ time = this.cachedTime; }; var labels:Array = getLabelsArray(); var i:int = labels.length; while (i--) { if (labels[i].time < time){ return (labels[i].name); }; }; return (null); } public function willTrigger(type:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(type)); } public function get totalProgress():Number{ return ((this.cachedTotalTime / this.totalDuration)); } public function set totalProgress(n:Number):void{ setTotalTime((this.totalDuration * n), false); } protected function getLabelsArray():Array{ var p:String; var a:Array = []; for (p in _labels) { a[a.length] = {time:_labels[p], name:p}; }; a.sortOn("time", Array.NUMERIC); return (a); } public function removeCallback(callback:Function, timeOrLabel=null):Boolean{ var a:Array; var success:Boolean; var i:int; if (timeOrLabel == null){ return (killTweensOf(callback, false)); }; if (typeof(timeOrLabel) == "string"){ if (!(timeOrLabel in _labels)){ return (false); }; timeOrLabel = _labels[timeOrLabel]; }; a = getTweensOf(callback, false); i = a.length; while (i--) { if (a[i].cachedStartTime == timeOrLabel){ remove((a[i] as TweenCore)); success = true; }; }; return (success); } public function get repeatDelay():Number{ return (_repeatDelay); } public function set repeat(n:int):void{ _repeat = n; setDirtyCache(true); } override public function get totalDuration():Number{ var temp:Number; if (this.cacheIsDirty){ temp = super.totalDuration; this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat)); }; return (this.cachedTotalDuration); } override public function complete(skipRender:Boolean=false, suppressEvents:Boolean=false):void{ super.complete(skipRender, suppressEvents); if (((_dispatcher) && (!(suppressEvents)))){ if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (!((this.cachedDuration == 0))))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE)); } else { _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE)); }; }; } override public function invalidate():void{ _repeat = ((this.vars.repeat) || (0)); _repeatDelay = ((this.vars.repeatDelay) || (0)); this.yoyo = ((this.vars.yoyo) || (false)); _hasUpdateListener = false; if (((((((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))) || (!((this.vars.onRepeatListener == null))))) || (!((this.vars.onReverseCompleteListener == null))))){ initDispatcher(); }; setDirtyCache(true); super.invalidate(); } public function getActive(nested:Boolean=true, tweens:Boolean=true, timelines:Boolean=false):Array{ var i:int; var a:Array = []; var all:Array = getChildren(nested, tweens, timelines); var l:uint = all.length; var cnt:uint; i = 0; while (i < l) { if (TweenCore(all[i]).active){ var _temp1 = cnt; cnt = (cnt + 1); var _local9 = _temp1; a[_local9] = all[i]; }; i++; }; return (a); } public function getLabelAfter(time:Number=NaN):String{ if (((!(time)) && (!((time == 0))))){ time = this.cachedTime; }; var labels:Array = getLabelsArray(); var l:uint = labels.length; var i:int; while (i < l) { if (labels[i].time > time){ return (labels[i].name); }; i++; }; return (null); } private static function easeNone(t:Number, b:Number, c:Number, d:Number):Number{ return ((t / d)); } } }//package com.greensock
Section 50
//TweenLite (com.greensock.TweenLite) package com.greensock { import flash.events.*; import flash.display.*; import com.greensock.core.*; import flash.utils.*; import com.greensock.plugins.*; public class TweenLite extends TweenCore { protected var _hasPlugins:Boolean; public var propTweenLookup:Object; public var cachedPT1:PropTween; protected var _overwrite:uint; protected var _ease:Function; public var target:Object; public var ratio:Number;// = 0 protected var _overwrittenProps:Object; protected var _notifyPluginsOfEnabled:Boolean; public static const version:Number = 11.133; public static var rootTimeline:SimpleTimeline; public static var fastEaseLookup:Dictionary = new Dictionary(false); public static var onPluginEvent:Function; public static var rootFramesTimeline:SimpleTimeline; public static var defaultEase:Function = TweenLite.easeOut; public static var plugins:Object = {}; public static var masterList:Dictionary = new Dictionary(false); public static var overwriteManager:Object; public static var rootFrame:Number; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; private static var _shape:Shape = new Shape(); protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1}; public function TweenLite(target:Object, duration:Number, vars:Object){ var sibling:TweenLite; super(duration, vars); this.target = target; if ((((this.target is TweenCore)) && (("timeScale" in this.vars)))){ this.cachedTimeScale = 1; }; propTweenLookup = {}; _ease = defaultEase; _overwrite = (((!((Number(vars.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((vars.overwrite > 1)))))) ? overwriteManager.mode : int(vars.overwrite); var a:Array = masterList[target]; if (!a){ masterList[target] = [this]; } else { if (_overwrite == 1){ for each (sibling in a) { if (!sibling.gc){ sibling.setEnabled(false, false); }; }; masterList[target] = [this]; } else { a[a.length] = this; }; }; if (((this.active) || (this.vars.immediateRender))){ renderTime(0, false, true); }; } protected function easeProxy(t:Number, b:Number, c:Number, d:Number):Number{ return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); } override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ var isComplete:Boolean; var prevTime:Number = this.cachedTime; if (time >= this.cachedDuration){ this.cachedTotalTime = (this.cachedTime = this.cachedDuration); this.ratio = 1; isComplete = true; if (this.cachedDuration == 0){ if ((((((time == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == time))))){ force = true; }; _rawPrevTime = time; }; } else { if (time <= 0){ this.cachedTotalTime = (this.cachedTime = (this.ratio = 0)); if (time < 0){ this.active = false; if (this.cachedDuration == 0){ if (_rawPrevTime > 0){ force = true; isComplete = true; }; _rawPrevTime = time; }; }; if (((this.cachedReversed) && (!((prevTime == 0))))){ isComplete = true; }; } else { this.cachedTotalTime = (this.cachedTime = time); this.ratio = _ease(time, 0, 1, this.cachedDuration); }; }; if ((((this.cachedTime == prevTime)) && (!(force)))){ return; }; if (!this.initted){ init(); if (((!(isComplete)) && (this.cachedTime))){ this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; if ((((((((prevTime == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(suppressEvents)))){ this.vars.onStart.apply(null, this.vars.onStartParams); }; var pt:PropTween = this.cachedPT1; while (pt) { pt.target[pt.property] = (pt.start + (this.ratio * pt.change)); pt = pt.nextNode; }; if (((_hasUpdate) && (!(suppressEvents)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (isComplete){ if (((_hasPlugins) && (this.cachedPT1))){ onPluginEvent("onComplete", this); }; complete(true, suppressEvents); }; } override public function setEnabled(enabled:Boolean, ignoreTimeline:Boolean=false):Boolean{ var a:Array; if (enabled){ a = TweenLite.masterList[this.target]; if (!a){ TweenLite.masterList[this.target] = [this]; } else { a[a.length] = this; }; }; super.setEnabled(enabled, ignoreTimeline); if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ return (onPluginEvent((enabled) ? "onEnable" : "onDisable", this)); }; return (false); } protected function init():void{ var p:String; var i:int; var plugin:*; var prioritize:Boolean; var siblings:Array; var pt:PropTween; if (typeof(this.vars.ease) == "function"){ _ease = this.vars.ease; }; if (this.vars.easeParams){ this.vars.proxiedEase = _ease; _ease = easeProxy; }; this.cachedPT1 = null; this.propTweenLookup = {}; for (p in this.vars) { if ((((p in _reservedProps)) && (!((((p == "timeScale")) && ((this.target is TweenCore))))))){ } else { if ((((p in plugins)) && (new ((plugins[p] as Class)).onInitTween(this.target, this.vars[p], this)))){ this.cachedPT1 = new PropTween(plugin, "changeFactor", 0, 1, ((plugin.overwriteProps.length)==1) ? plugin.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1); if (this.cachedPT1.name == "_MULTIPLE_"){ i = plugin.overwriteProps.length; while (i--) { this.propTweenLookup[plugin.overwriteProps[i]] = this.cachedPT1; }; } else { this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1; }; if (plugin.priority){ this.cachedPT1.priority = plugin.priority; prioritize = true; }; if (((plugin.onDisable) || (plugin.onEnable))){ _notifyPluginsOfEnabled = true; }; _hasPlugins = true; } else { this.cachedPT1 = new PropTween(this.target, p, Number(this.target[p]), ((typeof(this.vars[p]))=="number") ? (Number(this.vars[p]) - this.target[p]) : Number(this.vars[p]), p, false, this.cachedPT1); this.propTweenLookup[p] = this.cachedPT1; }; }; }; if (prioritize){ onPluginEvent("onInit", this); }; if (this.vars.runBackwards){ pt = this.cachedPT1; while (pt) { pt.start = (pt.start + pt.change); pt.change = -(pt.change); pt = pt.nextNode; }; }; _hasUpdate = Boolean(!((this.vars.onUpdate == null))); if (_overwrittenProps){ killVars(_overwrittenProps); if (this.cachedPT1 == null){ this.setEnabled(false, false); }; }; if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((siblings.length > 1)))){ if (overwriteManager.manageOverwrites(this, this.propTweenLookup, siblings, _overwrite)){ init(); }; }; this.initted = true; } public function killVars(vars:Object, permanent:Boolean=true):Boolean{ var p:String; var pt:PropTween; var changed:Boolean; if (_overwrittenProps == null){ _overwrittenProps = {}; }; for (p in vars) { if ((p in propTweenLookup)){ pt = propTweenLookup[p]; if (((pt.isPlugin) && ((pt.name == "_MULTIPLE_")))){ pt.target.killProps(vars); if (pt.target.overwriteProps.length == 0){ pt.name = ""; }; }; if (pt.name != "_MULTIPLE_"){ if (pt.nextNode){ pt.nextNode.prevNode = pt.prevNode; }; if (pt.prevNode){ pt.prevNode.nextNode = pt.nextNode; } else { if (this.cachedPT1 == pt){ this.cachedPT1 = pt.nextNode; }; }; if (((pt.isPlugin) && (pt.target.onDisable))){ pt.target.onDisable(); if (pt.target.activeDisable){ changed = true; }; }; delete propTweenLookup[p]; }; }; if (permanent){ _overwrittenProps[p] = 1; }; }; return (changed); } override public function invalidate():void{ if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ onPluginEvent("onDisable", this); }; this.cachedPT1 = null; _overwrittenProps = null; _hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false))); this.propTweenLookup = {}; } public static function initClass():void{ rootFrame = 0; rootTimeline = new SimpleTimeline(null); rootFramesTimeline = new SimpleTimeline(null); rootTimeline.cachedStartTime = (getTimer() * 0.001); rootFramesTimeline.cachedStartTime = rootFrame; rootTimeline.autoRemoveChildren = true; rootFramesTimeline.autoRemoveChildren = true; _shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); if (overwriteManager == null){ overwriteManager = {mode:1, enabled:false}; }; } public static function killTweensOf(target:Object, complete:Boolean=false):void{ var a:Array; var i:int; if ((target in masterList)){ a = masterList[target]; i = a.length; while (i--) { if (!TweenLite(a[i]).gc){ if (complete){ TweenLite(a[i]).complete(false, false); } else { TweenLite(a[i]).setEnabled(false, false); }; }; }; delete masterList[target]; }; } public static function from(target:Object, duration:Number, vars:Object):TweenLite{ vars.runBackwards = true; if (!("immediateRender" in vars)){ vars.immediateRender = true; }; return (new TweenLite(target, duration, vars)); } protected static function easeOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (1 - (t / d)); return ((1 - (t * t))); } public static function delayedCall(delay:Number, onComplete:Function, onCompleteParams:Array=null, useFrames:Boolean=false):TweenLite{ return (new TweenLite(onComplete, 0, {delay:delay, onComplete:onComplete, onCompleteParams:onCompleteParams, immediateRender:false, useFrames:useFrames, overwrite:0})); } protected static function updateAll(e:Event=null):void{ var ml:Dictionary; var tgt:Object; var a:Array; var i:int; rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false); rootFrame++; rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false); if (!(rootFrame % 60)){ ml = masterList; for (tgt in ml) { a = ml[tgt]; i = a.length; while (i--) { if (TweenLite(a[i]).gc){ a.splice(i, 1); }; }; if (a.length == 0){ delete ml[tgt]; }; }; }; } public static function to(target:Object, duration:Number, vars:Object):TweenLite{ return (new TweenLite(target, duration, vars)); } } }//package com.greensock
Section 51
//TweenMax (com.greensock.TweenMax) package com.greensock { import flash.events.*; import flash.display.*; import com.greensock.core.*; import flash.utils.*; import com.greensock.events.*; import com.greensock.plugins.*; public class TweenMax extends TweenLite implements IEventDispatcher { protected var _cyclesComplete:uint;// = 0 protected var _dispatcher:EventDispatcher; protected var _hasUpdateListener:Boolean; protected var _easeType:uint; protected var _repeatDelay:Number;// = 0 public var yoyo:Boolean; protected var _easePower:uint; protected var _repeat:int;// = 0 public static const version:Number = 11.14; private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init(2); ; public static var killTweensOf:Function = TweenLite.killTweensOf; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; public function TweenMax(target:Object, duration:Number, vars:Object){ super(target, duration, vars); if (TweenLite.version < 11.1){ throw (new Error("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.")); }; this.yoyo = Boolean(this.vars.yoyo); _repeat = ((this.vars.repeat) || (0)); _repeatDelay = ((this.vars.repeatDelay) || (0)); this.cacheIsDirty = true; if (((((((((this.vars.onCompleteListener) || (this.vars.onUpdateListener))) || (this.vars.onStartListener))) || (this.vars.onRepeatListener))) || (this.vars.onReverseCompleteListener))){ initDispatcher(); if ((((duration == 0)) && ((_delay == 0)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE)); _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE)); }; }; if (((("timeScale" in this.vars)) && (!((this.target is TweenCore))))){ this.cachedTimeScale = this.vars.timeScale; }; } public function dispatchEvent(e:Event):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.dispatchEvent(e)); } public function set timeScale(n:Number):void{ if (n == 0){ n = 0.0001; }; var tlTime:Number = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime; this.cachedStartTime = (tlTime - (((tlTime - this.cachedStartTime) * this.cachedTimeScale) / n)); this.cachedTimeScale = n; setDirtyCache(false); } override public function renderTime(time:Number, suppressEvents:Boolean=false, force:Boolean=false):void{ var isComplete:Boolean; var repeated:Boolean; var setRatio:Boolean; var cycleDuration:Number; var power:uint; var val:Number; var totalDur:Number = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; var prevTime:Number = this.cachedTime; if (time >= totalDur){ this.cachedTotalTime = totalDur; this.cachedTime = this.cachedDuration; this.ratio = 1; isComplete = true; if (this.cachedDuration == 0){ if ((((((time == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == time))))){ force = true; }; _rawPrevTime = time; }; } else { if (time <= 0){ if (time < 0){ this.active = false; if (this.cachedDuration == 0){ if (_rawPrevTime > 0){ force = true; isComplete = true; }; _rawPrevTime = time; }; }; this.cachedTotalTime = (this.cachedTime = (this.ratio = 0)); if (((this.cachedReversed) && (!((prevTime == 0))))){ isComplete = true; }; } else { this.cachedTotalTime = (this.cachedTime = time); setRatio = true; }; }; if (_repeat != 0){ cycleDuration = (this.cachedDuration + _repeatDelay); if (isComplete){ if (((this.yoyo) && ((_repeat % 2)))){ this.cachedTime = (this.ratio = 0); }; } else { if (time > 0){ if (_cyclesComplete != (_cyclesComplete = int((this.cachedTotalTime / cycleDuration)))){ repeated = true; }; this.cachedTime = (((this.cachedTotalTime / cycleDuration) - _cyclesComplete) * cycleDuration); if (((this.yoyo) && ((_cyclesComplete % 2)))){ this.cachedTime = (this.cachedDuration - this.cachedTime); } else { if (this.cachedTime >= this.cachedDuration){ this.cachedTime = this.cachedDuration; this.ratio = 1; setRatio = false; }; }; if (this.cachedTime <= 0){ this.cachedTime = (this.ratio = 0); setRatio = false; }; }; }; }; if ((((prevTime == this.cachedTime)) && (!(force)))){ return; }; if (!this.initted){ init(); }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; if (setRatio){ if (_easeType){ power = _easePower; val = (this.cachedTime / this.cachedDuration); if (_easeType == 2){ val = (1 - val); this.ratio = val; while (power--) { this.ratio = (val * this.ratio); }; this.ratio = (1 - this.ratio); } else { if (_easeType == 1){ this.ratio = val; while (power--) { this.ratio = (val * this.ratio); }; } else { if (val < 0.5){ val = (val * 2); this.ratio = val; while (power--) { this.ratio = (val * this.ratio); }; this.ratio = (this.ratio * 0.5); } else { val = ((1 - val) * 2); this.ratio = val; while (power--) { this.ratio = (val * this.ratio); }; this.ratio = (1 - (0.5 * this.ratio)); }; }; }; } else { this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; if ((((((prevTime == 0)) && (!((this.cachedTotalTime == 0))))) && (!(suppressEvents)))){ if (this.vars.onStart){ this.vars.onStart.apply(null, this.vars.onStartParams); }; if (_dispatcher){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START)); }; }; var pt:PropTween = this.cachedPT1; while (pt) { pt.target[pt.property] = (pt.start + (this.ratio * pt.change)); pt = pt.nextNode; }; if (((_hasUpdate) && (!(suppressEvents)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (((_hasUpdateListener) && (!(suppressEvents)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE)); }; if (isComplete){ if (((_hasPlugins) && (this.cachedPT1))){ onPluginEvent("onComplete", this); }; complete(true, suppressEvents); } else { if (((repeated) && (!(suppressEvents)))){ if (this.vars.onRepeat){ this.vars.onRepeat.apply(null, this.vars.onRepeatParams); }; if (_dispatcher){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REPEAT)); }; }; }; } override public function set totalDuration(n:Number):void{ if (_repeat == -1){ return; }; this.duration = ((n - (_repeat * _repeatDelay)) / (_repeat + 1)); } public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{ if (_dispatcher == null){ initDispatcher(); }; if (type == TweenEvent.UPDATE){ _hasUpdateListener = true; }; _dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference); } protected function insertPropTween(target:Object, property:String, start:Number, end, name:String, isPlugin:Boolean, nextNode:PropTween):PropTween{ var op:Array; var i:int; var pt:PropTween = new PropTween(target, property, start, ((typeof(end))=="number") ? (end - start) : Number(end), name, isPlugin, nextNode); if (((isPlugin) && ((name == "_MULTIPLE_")))){ op = target.overwriteProps; i = op.length; while (i--) { this.propTweenLookup[op[i]] = pt; }; } else { this.propTweenLookup[name] = pt; }; return (pt); } override protected function init():void{ var startTween:TweenMax; var j:int; var prop:String; var multiProps:String; var rp:Array; var plugin:Object; var ptPlugin:PropTween; var pt:PropTween; var i:int; if (this.vars.startAt){ this.vars.startAt.overwrite = 0; this.vars.startAt.immediateRender = true; startTween = new TweenMax(this.target, 0, this.vars.startAt); }; super.init(); if ((_ease in fastEaseLookup)){ _easeType = fastEaseLookup[_ease][0]; _easePower = fastEaseLookup[_ease][1]; }; if (((!((this.vars.roundProps == null))) && (("roundProps" in TweenLite.plugins)))){ rp = this.vars.roundProps; i = rp.length; while (i--) { prop = rp[i]; pt = this.cachedPT1; while (pt) { if (pt.name == prop){ if (pt.isPlugin){ pt.target.round = true; } else { if (plugin == null){ plugin = new TweenLite.plugins.roundProps(); plugin.add(pt.target, prop, pt.start, pt.change); _hasPlugins = true; ptPlugin = insertPropTween(plugin, "changeFactor", 0, 1, "_MULTIPLE_", true, this.cachedPT1); this.cachedPT1 = ptPlugin; } else { plugin.add(pt.target, prop, pt.start, pt.change); }; this.removePropTween(pt); this.propTweenLookup[prop] = ptPlugin; }; } else { if (((((pt.isPlugin) && ((pt.name == "_MULTIPLE_")))) && (!(pt.target.round)))){ multiProps = ((" " + pt.target.overwriteProps.join(" ")) + " "); if (multiProps.indexOf(((" " + prop) + " ")) != -1){ pt.target.round = true; }; }; }; pt = pt.nextNode; }; }; }; } public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{ if (_dispatcher){ _dispatcher.removeEventListener(type, listener, useCapture); }; } public function setDestination(property:String, value, adjustStartValues:Boolean=true):void{ var vars:Object = {}; vars[property] = value; updateTo(vars, !(adjustStartValues)); } public function willTrigger(type:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.willTrigger(type)); } public function hasEventListener(type:String):Boolean{ return (((_dispatcher)==null) ? false : _dispatcher.hasEventListener(type)); } protected function initDispatcher():void{ if (_dispatcher == null){ _dispatcher = new EventDispatcher(this); }; if ((this.vars.onStartListener is Function)){ _dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true); }; if ((this.vars.onUpdateListener is Function)){ _dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true); _hasUpdateListener = true; }; if ((this.vars.onCompleteListener is Function)){ _dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true); }; if ((this.vars.onRepeatListener is Function)){ _dispatcher.addEventListener(TweenEvent.REPEAT, this.vars.onRepeatListener, false, 0, true); }; if ((this.vars.onReverseCompleteListener is Function)){ _dispatcher.addEventListener(TweenEvent.REVERSE_COMPLETE, this.vars.onReverseCompleteListener, false, 0, true); }; } public function set currentProgress(n:Number):void{ if (_cyclesComplete == 0){ setTotalTime((this.duration * n), false); } else { setTotalTime(((this.duration * n) + (_cyclesComplete * this.cachedDuration)), false); }; } public function get totalProgress():Number{ return ((this.cachedTotalTime / this.totalDuration)); } public function set totalProgress(n:Number):void{ setTotalTime((this.totalDuration * n), false); } protected function removePropTween(propTween:PropTween):Boolean{ if (propTween.nextNode){ propTween.nextNode.prevNode = propTween.prevNode; }; if (propTween.prevNode){ propTween.prevNode.nextNode = propTween.nextNode; } else { if (this.cachedPT1 == propTween){ this.cachedPT1 = propTween.nextNode; }; }; if (((propTween.isPlugin) && (propTween.target.onDisable))){ propTween.target.onDisable(); if (propTween.target.activeDisable){ return (true); }; }; return (false); } public function get currentProgress():Number{ return ((this.cachedTime / this.duration)); } public function get repeat():int{ return (_repeat); } public function updateTo(vars:Object, resetDuration:Boolean=false):void{ var p:String; var inv:Number; var pt:PropTween; var endValue:Number; var curRatio:Number = this.ratio; if (((((resetDuration) && (!((this.timeline == null))))) && ((this.cachedStartTime < this.timeline.cachedTime)))){ this.cachedStartTime = this.timeline.cachedTime; if (this.gc){ this.setEnabled(true, false); } else { this.timeline.addChild(this); }; }; for (p in vars) { this.vars[p] = vars[p]; }; if (this.initted){ init(); if (((((!(resetDuration)) && ((this.cachedTime > 0)))) && ((this.cachedTime < this.cachedDuration)))){ inv = (1 / (1 - curRatio)); pt = this.cachedPT1; while (pt) { endValue = (pt.start + pt.change); pt.change = (pt.change * inv); pt.start = (endValue - pt.change); pt = pt.nextNode; }; }; }; } override public function set currentTime(n:Number):void{ if (_cyclesComplete == 0){ } else { if (((this.yoyo) && (((_cyclesComplete % 2) == 1)))){ n = ((this.duration - n) + (_cyclesComplete * (this.cachedDuration + _repeatDelay))); } else { n = (n + (_cyclesComplete * (this.duration + _repeatDelay))); }; }; setTotalTime(n, false); } public function get repeatDelay():Number{ return (_repeatDelay); } public function killProperties(names:Array):void{ var v:Object = {}; var i:int = names.length; while (i--) { v[names[i]] = true; }; killVars(v); } public function set repeatDelay(n:Number):void{ _repeatDelay = n; setDirtyCache(true); } public function set repeat(n:int):void{ _repeat = n; setDirtyCache(true); } override public function complete(skipRender:Boolean=false, suppressEvents:Boolean=false):void{ super.complete(skipRender, suppressEvents); if (((!(suppressEvents)) && (_dispatcher))){ if ((((this.cachedTotalTime == this.cachedTotalDuration)) && (!(this.cachedReversed)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE)); } else { if (((this.cachedReversed) && ((this.cachedTotalTime == 0)))){ _dispatcher.dispatchEvent(new TweenEvent(TweenEvent.REVERSE_COMPLETE)); }; }; }; } override public function invalidate():void{ this.yoyo = Boolean((this.vars.yoyo == true)); _repeat = ((this.vars.repeat) || (0)); _repeatDelay = ((this.vars.repeatDelay) || (0)); _hasUpdateListener = false; if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){ initDispatcher(); }; setDirtyCache(true); super.invalidate(); } public function get timeScale():Number{ return (this.cachedTimeScale); } override public function get totalDuration():Number{ if (this.cacheIsDirty){ this.cachedTotalDuration = ((_repeat)==-1) ? 999999999999 : ((this.cachedDuration * (_repeat + 1)) + (_repeatDelay * _repeat)); this.cacheIsDirty = false; }; return (this.cachedTotalDuration); } public static function set globalTimeScale(n:Number):void{ if (n == 0){ n = 0.0001; }; if (TweenLite.rootTimeline == null){ TweenLite.to({}, 0, {}); }; var tl:SimpleTimeline = TweenLite.rootTimeline; var curTime:Number = (getTimer() * 0.001); tl.cachedStartTime = (curTime - (((curTime - tl.cachedStartTime) * tl.cachedTimeScale) / n)); tl = TweenLite.rootFramesTimeline; curTime = TweenLite.rootFrame; tl.cachedStartTime = (curTime - (((curTime - tl.cachedStartTime) * tl.cachedTimeScale) / n)); TweenLite.rootFramesTimeline.cachedTimeScale = (TweenLite.rootTimeline.cachedTimeScale = n); } public static function fromTo(target:Object, duration:Number, fromVars:Object, toVars:Object):TweenMax{ toVars.startAt = fromVars; if (fromVars.immediateRender){ toVars.immediateRender = true; }; return (new TweenMax(target, duration, toVars)); } public static function allFromTo(targets:Array, duration:Number, fromVars:Object, toVars:Object, stagger:Number=0, onCompleteAll:Function=null, onCompleteAllParams:Array=null):Array{ toVars.startAt = fromVars; if (fromVars.immediateRender){ toVars.immediateRender = true; }; return (allTo(targets, duration, toVars, stagger, onCompleteAll, onCompleteAllParams)); } public static function pauseAll(tweens:Boolean=true, delayedCalls:Boolean=true):void{ changePause(true, tweens, delayedCalls); } public static function getTweensOf(target:Object):Array{ var i:int; var cnt:uint; var a:Array = masterList[target]; var toReturn:Array = []; if (a){ i = a.length; cnt = 0; while (i--) { if (!a[i].gc){ var _temp1 = cnt; cnt = (cnt + 1); var _local6 = _temp1; toReturn[_local6] = a[i]; }; }; }; return (toReturn); } public static function get globalTimeScale():Number{ return (((TweenLite.rootTimeline)==null) ? 1 : TweenLite.rootTimeline.cachedTimeScale); } public static function killChildTweensOf(parent:DisplayObjectContainer, complete:Boolean=false):void{ var curTarget:Object; var curParent:DisplayObjectContainer; var a:Array = getAllTweens(); var i:int = a.length; while (i--) { curTarget = a[i].target; if ((curTarget is DisplayObject)){ curParent = curTarget.parent; while (curParent) { if (curParent == parent){ if (complete){ a[i].complete(false); } else { a[i].setEnabled(false, false); }; }; curParent = curParent.parent; }; }; }; } public static function delayedCall(delay:Number, onComplete:Function, onCompleteParams:Array=null, useFrames:Boolean=false):TweenMax{ return (new TweenMax(onComplete, 0, {delay:delay, onComplete:onComplete, onCompleteParams:onCompleteParams, immediateRender:false, useFrames:useFrames, overwrite:0})); } public static function isTweening(target:Object):Boolean{ var tween:TweenLite; var a:Array = getTweensOf(target); var i:int = a.length; while (i--) { tween = a[i]; if (((tween.active) || ((((tween.cachedStartTime == tween.timeline.cachedTime)) && (tween.timeline.active))))){ return (true); }; }; return (false); } public static function killAll(complete:Boolean=false, tweens:Boolean=true, delayedCalls:Boolean=true):void{ var isDC:Boolean; var a:Array = getAllTweens(); var i:int = a.length; while (i--) { isDC = (a[i].target == a[i].vars.onComplete); if ((((isDC == delayedCalls)) || (!((isDC == tweens))))){ if (complete){ a[i].complete(false); } else { a[i].setEnabled(false, false); }; }; }; } private static function changePause(pause:Boolean, tweens:Boolean=true, delayedCalls:Boolean=false):void{ var isDC:Boolean; var a:Array = getAllTweens(); var i:int = a.length; while (i--) { isDC = (TweenLite(a[i]).target == TweenLite(a[i]).vars.onComplete); if ((((isDC == delayedCalls)) || (!((isDC == tweens))))){ TweenCore(a[i]).paused = pause; }; }; } public static function from(target:Object, duration:Number, vars:Object):TweenMax{ vars.runBackwards = true; if (!("immediateRender" in vars)){ vars.immediateRender = true; }; return (new TweenMax(target, duration, vars)); } public static function allFrom(targets:Array, duration:Number, vars:Object, stagger:Number=0, onCompleteAll:Function=null, onCompleteAllParams:Array=null):Array{ vars.runBackwards = true; if (!("immediateRender" in vars)){ vars.immediateRender = true; }; return (allTo(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams)); } public static function getAllTweens():Array{ var a:Array; var i:int; var ml:Dictionary = masterList; var cnt:uint; var toReturn:Array = []; for each (a in ml) { i = a.length; while (i--) { if (!TweenLite(a[i]).gc){ var _temp1 = cnt; cnt = (cnt + 1); var _local8 = _temp1; toReturn[_local8] = a[i]; }; }; }; return (toReturn); } public static function resumeAll(tweens:Boolean=true, delayedCalls:Boolean=true):void{ changePause(false, tweens, delayedCalls); } public static function to(target:Object, duration:Number, vars:Object):TweenMax{ return (new TweenMax(target, duration, vars)); } public static function allTo(targets:Array, duration:Number, vars:Object, stagger:Number=0, onCompleteAll:Function=null, onCompleteAllParams:Array=null):Array{ var i:int; var varsDup:Object; var p:String; var onCompleteProxy:Function; var onCompleteParamsProxy:Array; var targets = targets; var duration = duration; var vars = vars; var stagger = stagger; var onCompleteAll = onCompleteAll; var onCompleteAllParams = onCompleteAllParams; var l:uint = targets.length; var a:Array = []; var curDelay:Number = ((vars.delay) || (0)); onCompleteProxy = vars.onComplete; onCompleteParamsProxy = vars.onCompleteParams; var lastIndex:int = ((stagger)<=0) ? 0 : (l - 1); i = 0; while (i < l) { varsDup = {}; for (p in vars) { varsDup[p] = vars[p]; }; varsDup.delay = curDelay; if ((((i == lastIndex)) && (!((onCompleteAll == null))))){ varsDup.onComplete = function ():void{ if (onCompleteProxy != null){ onCompleteProxy.apply(null, onCompleteParamsProxy); }; onCompleteAll.apply(null, onCompleteAllParams); }; }; a[a.length] = new TweenMax(targets[i], duration, varsDup); curDelay = (curDelay + stagger); i = (i + 1); }; return (a); } TweenPlugin.activate([AutoAlphaPlugin, EndArrayPlugin, FramePlugin, RemoveTintPlugin, TintPlugin, VisiblePlugin, VolumePlugin, BevelFilterPlugin, BezierPlugin, BezierThroughPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, ColorTransformPlugin, DropShadowFilterPlugin, FrameLabelPlugin, GlowFilterPlugin, HexColorsPlugin, RoundPropsPlugin, ShortRotationPlugin, {}]); } }//package com.greensock
Section 52
//BaseSprite (common.controls.BaseSprite) package common.controls { import flash.display.*; public dynamic class BaseSprite extends Sprite { public var THIS:BaseSprite; public function BaseSprite(){ super(); THIS = this; } public function onEnter():void{ } } }//package common.controls
Section 53
//ModalManager (common.controls.ModalManager) package common.controls { import common.*; import flash.events.*; import flash.display.*; import flash.geom.*; import com.greensock.*; import com.greensock.easing.*; public class ModalManager { public var mouse;// = null public var topWindow:DisplayObjectContainer; public static var inst:ModalManager; public function ModalManager(){ super(); } public function showDialog(dialog:DisplayObject, parent:DisplayObjectContainer=null, callback:Function=null, doAnimate:Boolean=true, doCenterParent:Boolean=true, closeByClick:Boolean=true, alpha:Number=0.4):void{ var rect:Sprite; var appRect:Rectangle; var onClose:Function; var dialog = dialog; var parent = parent; var callback = callback; var doAnimate = doAnimate; var doCenterParent = doCenterParent; var closeByClick = closeByClick; var alpha = alpha; var center:Function = function ():void{ if (doCenterParent){ GraphUtils.center(dialog, LayoutManager.inst.displayRect); } else { if ((dialog.x + dialog.width) > appRect.width){ dialog.x = (dialog.x - dialog.width); }; if ((dialog.y + dialog.height) > appRect.height){ dialog.y = (dialog.y - dialog.height); }; }; }; if (parent == null){ parent = topWindow; }; rect = createTransparentRect(alpha, 0); parent.addChild(rect); parent.addChild(dialog); appRect = Application.inst.getRect(Application.inst); center(); Application.inst.stage.addEventListener(FullScreenEvent.FULL_SCREEN, function (e:FullScreenEvent):void{ center(); }); if (doAnimate){ animate(dialog, rect, alpha); }; if (mouse != null){ mouse.capture(); }; var _local9 = function (e):void{ dialog.removeEventListener(Event.CLOSE, onClose); parent.removeChild(dialog); parent.removeChild(rect); if (mouse != null){ mouse.release(); }; if (callback != null){ if (("button" in e)){ callback(e.button); } else { callback({}); }; }; }; onClose = _local9; dialog.addEventListener(Event.CLOSE, _local9); if (closeByClick){ with ({}) { with ({}) { !ERROR!.oMouseClick = function ():void{ rect.removeEventListener(MouseEvent.CLICK, oMouseClick); onClose({}); dialog.dispatchEvent(new DynamicEvent(Event.CLOSE)); }; }; rect.addEventListener(MouseEvent.CLICK, function ():void{ rect.removeEventListener(MouseEvent.CLICK, oMouseClick); onClose({}); dialog.dispatchEvent(new DynamicEvent(Event.CLOSE)); }); }; } protected function animate(dialog:DisplayObject, rect:DisplayObject, toAlpha:Number):void{ var duration:Number = 0.2; rect.alpha = 0; TweenLite.to(rect, duration, {alpha:toAlpha}); dialog.scaleX = 0.3; dialog.scaleY = 0.3; dialog.alpha = 0.5; TweenLite.to(dialog, duration, {alpha:1, scaleX:1, scaleY:1, ease:Back.easeOut}); } private static function createTransparentRect(alpha:Number, color:uint=0x777777):Sprite{ var rect:Sprite = new Sprite(); rect.graphics.beginFill(color, 1); rect.graphics.drawRect(0, 0, Application.inst.width, Application.inst.height); rect.graphics.endFill(); rect.alpha = alpha; return (rect); } } }//package common.controls
Section 54
//NonScaledSprite (common.controls.NonScaledSprite) package common.controls { import common.*; import flash.display.*; import flash.geom.*; public dynamic class NonScaledSprite extends BaseSprite { protected var _bkg:Sprite; public function NonScaledSprite(color:uint=0, alpha:Number=0){ super(); _bkg = new Sprite(); _bkg.graphics.beginFill(color, alpha); _bkg.graphics.drawRect(0, 0, 100, 100); _bkg.graphics.endFill(); _bkg.mouseEnabled = false; addChild(_bkg); } public function setSize(width:Number, height:Number):void{ this.width = width; this.height = height; } override public function get width():Number{ return (_bkg.width); } override public function get height():Number{ return (_bkg.height); } override public function removeChildAt(index:int):DisplayObject{ if (index == getChildIndex(_bkg)){ return (_bkg); }; return (super.removeChildAt(index)); } override public function set width(value:Number):void{ _bkg.width = value; onSizeChanged(); } override public function set height(value:Number):void{ _bkg.height = value; onSizeChanged(); } override public function getBounds(targetCoordinateSpace:DisplayObject):Rectangle{ return (_bkg.getBounds(targetCoordinateSpace)); } protected function onSizeChanged():void{ } override public function removeChild(child:DisplayObject):DisplayObject{ if (child == _bkg){ return (child); }; return (super.removeChild(child)); } override public function getRect(targetCoordinateSpace:DisplayObject):Rectangle{ return (_bkg.getRect(targetCoordinateSpace)); } public function removeAllChildren():void{ Utils.removeAllChildren(this, _bkg); } public static function create(rect:Rectangle, parent:DisplayObjectContainer=null, color:uint=0, alpha:Number=0):NonScaledSprite{ var sprite:NonScaledSprite = new NonScaledSprite(color, alpha); if (parent){ parent.addChild(sprite); sprite.x = rect.x; sprite.y = rect.y; sprite.width = rect.width; sprite.height = rect.height; sprite.graphics.lineStyle(1, 0); }; return (sprite); } } }//package common.controls
Section 55
//EventManager (common.events.EventManager) package common.events { import flash.events.*; import flash.utils.*; public class EventManager { private static const _instance:EventManager = new (EventManager); ; private static const _dispatcher:EventDispatcher = new EventDispatcher(); public function EventManager(){ super(); setInterval(function ():void{ _dispatcher.dispatchEvent(new Event("heartbeat")); }, 500); } public function dispatchEvent(event):Boolean{ if ((event is String)){ event = new Event(event); }; return (_dispatcher.dispatchEvent(event)); } public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{ _dispatcher.removeEventListener(type, listener, useCapture); } public function hasEventListener(type:String):Boolean{ return (_dispatcher.hasEventListener(type)); } public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{ _dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference); } public static function get inst():EventManager{ return (_instance); } } }//package common.events
Section 56
//MMWrapper (common.platform.mm.MMWrapper) package common.platform.mm { import flash.display.*; import common.platform.*; public class MMWrapper extends Wrapper { public function MMWrapper(stage:Stage){ super(stage); } } }//package common.platform.mm
Section 57
//Settings (common.platform.vk.Settings) package common.platform.vk { public class Settings { private var _settings:Number;// = 0 public static const PHOTOS:uint = 4; public static const FRIENDS:uint = 2; public static const BOOKMARK:uint = 0x0100; public static const WALL:uint = 0x0200; public static const NOTIFICATIONS:uint = 1; public function Settings(settings){ super(); if ((settings is Number)){ _settings = (settings as Number); } else { if ((((settings is String)) && (!((String(settings) == ""))))){ _settings = parseInt((settings as String)); } else { _settings = 0; }; }; } public function get bookmarkAllowed():Boolean{ return (allowed(BOOKMARK)); } public function set settings(value:Number):void{ _settings = value; } public function allowed(flags:uint):Boolean{ return (((settings & flags) == flags)); } public function get friendsAllowed():Boolean{ return (allowed(FRIENDS)); } public function get settings():Number{ return (_settings); } public function get notificationAllowed():Boolean{ return (allowed(NOTIFICATIONS)); } } }//package common.platform.vk
Section 58
//VkontakteRequest (common.platform.vk.VkontakteRequest) package common.platform.vk { import flash.events.*; import com.adobe.serialization.json.*; import mx.utils.*; import com.adobe.crypto.*; import flash.net.*; public class VkontakteRequest extends EventDispatcher { public static var api_id:String; public static var viewer_id:String; public static var api_url:String; private static var _appKey:String = "oucd6nYmny"; public function VkontakteRequest(){ super(); } private static function signParams(params:Object):String{ var paramName:String; var concatedParams:String; var sortedParamName:String; var sortedParamNames:Array = new Array(); for (paramName in params) { sortedParamNames.push(paramName); }; sortedParamNames.sort(); concatedParams = ""; for each (sortedParamName in sortedParamNames) { concatedParams = (concatedParams + ((sortedParamName + "=") + params[sortedParamName])); }; params.sig = MD5.hash(((viewer_id + concatedParams) + _appKey)); return (((api_url + "?") + URLUtil.objectToString(params, "&", true))); } private static function addCommonParams(params:Object):void{ params.api_id = api_id; params.viewer_id = viewer_id; params.v = "2.0"; params.format = "JSON"; params.test_mode = "0"; } public static function init(flashParameters:Object):void{ viewer_id = flashParameters["viewer_id"]; api_url = flashParameters["api_url"]; api_id = flashParameters["api_id"]; } public static function call(params:Object, callback=null):void{ var loader:URLLoader; var onResponse:Function; var params = params; var callback = callback; onResponse = function (event:Event):void{ var json:Object; var event = event; loader.removeEventListener(Event.COMPLETE, onResponse); loader.removeEventListener(IOErrorEvent.IO_ERROR, onResponse); loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onResponse); if (event.type == Event.COMPLETE){ if ((loader.data is String)){ }; json = JSON.decode(loader.data); //unresolved jump var _slot1 = error; json = {error:event}; } else { json = {error:event}; }; if (json != null){ if (callback != null){ callback(json); }; }; }; if ((params is String)){ params = {method:params}; }; addCommonParams(params); var url:String = signParams(params); var request:URLRequest = new URLRequest(url); loader = new URLLoader(request); loader.addEventListener(Event.COMPLETE, onResponse); loader.addEventListener(IOErrorEvent.IO_ERROR, onResponse); loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onResponse); loader.load(request); //unresolved jump var _slot1 = error; loader.removeEventListener(Event.COMPLETE, onResponse); loader.removeEventListener(IOErrorEvent.IO_ERROR, onResponse); loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onResponse); if (callback != null){ callback({error:_slot1}); }; } } }//package common.platform.vk
Section 59
//VKWrapper (common.platform.vk.VKWrapper) package common.platform.vk { import common.*; import flash.events.*; import flash.display.*; import flash.geom.*; import flash.utils.*; import common.platform.*; public class VKWrapper extends Wrapper { private var _settingsTimeoutId:Number;// = 0 private var _settings:Settings; private var _wrapper:Object; private var _friends; private var _nextShowSettingsTime:Number;// = 0 public function VKWrapper(app:Object){ var app = app; _settings = new Settings(0); super(app.stage); _wrapper = app.parent.parent; while (Utils.getClassName(_wrapper) != "APIWrapper") { _wrapper = _wrapper.parent; if (!_wrapper){ throw (new Error("Vkontake wrapper not found")); }; }; _settings = new Settings(_wrapper.application.parameters["api_settings"]); VkontakteRequest.init(_wrapper.application.parameters); wrapper.addEventListener("onSettingsChanged", function (e:Object):void{ _settings.settings = e.settings; }); _wrapper.application.scaleMode = StageScaleMode.NO_SCALE; _wrapper.external.scrollWindow(70, 3000); _stage.addEventListener(FullScreenEvent.FULL_SCREEN, function (e:FullScreenEvent):void{ if (e.fullScreen){ _wrapper.scaleX = 1; _wrapper.scaleY = 1; }; }); viewerId = _wrapper.application.parameters["viewer_id"]; authKey = _wrapper.application.parameters["auth_key"]; isInstalled = (_wrapper.application.parameters["is_app_user"] == 1); configUrl = "http://cj-online.appspot.com/static/config.json"; serverUrl = "http://cj-online.appspot.com"; } public function showSettings(requestedSettings:uint):void{ var requestedSettings = requestedSettings; var now:Number = new Date().time; var leftToWait:Number = (_nextShowSettingsTime - now); if (leftToWait <= 0){ _wrapper.external.showSettingsBox(requestedSettings); _nextShowSettingsTime = (now + 3500); } else { clearTimeout(_settingsTimeoutId); _settingsTimeoutId = setTimeout(function ():void{ _wrapper.external.showSettingsBox(requestedSettings); _nextShowSettingsTime = (new Date().time + 3500); }, leftToWait); }; } public function get settings():Settings{ return (_settings); } override public function showInviteBox():void{ _wrapper.external.showInviteBox(); } override public function getFriends(callback):void{ var callback = callback; checkSettings(Settings.FRIENDS, function ():void{ if (settings.allowed(Settings.FRIENDS)){ if (_friends != null){ callback(_friends); } else { VkontakteRequest.call({method:"execute", code:"return API.getProfiles({\"uids\":API.getFriends(), \"fields\":[\"photo_medium\", \"sex\"]});"}, function (result):void{ _friends = processCallback(result, callback); }); }; } else { callback(null); }; }); } override public function set frameRate(rate:Number):void{ wrapper.application.frameRate = rate; } override public function getAppFriends(callback):void{ var callback = callback; checkSettings(Settings.FRIENDS, function ():void{ if (settings.allowed(Settings.FRIENDS)){ if (_friends != null){ callback(_friends); } else { VkontakteRequest.call({method:"execute", code:"return API.getProfiles({\"uids\":API.getAppFriends(), \"fields\":[\"photo_medium\", \"sex\"]});"}, function (result):void{ _friends = processCallback(result, callback); }); }; } else { callback(null); }; }); } public function checkSettings(flags:uint, callback, onlySuccess:Boolean=false):void{ var f:*; var onSettings:Function; var flags = flags; var callback = callback; var onlySuccess = onlySuccess; if (settings.allowed(flags)){ callback(); } else { onSettings = function ():void{ _wrapper.removeEventListener("onWindowFocus", onSettings); if (((!(onlySuccess)) || (settings.allowed(flags)))){ callback(); }; }; _wrapper.addEventListener("onWindowFocus", onSettings); showSettings(flags); }; } private function processCallback(answer, callBackFunction){ if (((!((answer == null))) && (!((answer.response == null))))){ callBackFunction(answer.response); return (answer.response); }; callBackFunction(null); return (null); } override public function get stageSize():Rectangle{ return (new Rectangle(0, 0, wrapper.application.stageWidth, wrapper.application.stageHeight)); } override public function addServerRequestParams(request:Object):void{ } override public function setSize(width:Number, height:Number):void{ wrapper.external.resizeWindow(width, height); } public function get wrapper():Object{ return (_wrapper); } } }//package common.platform.vk
Section 60
//FakeWrapper (common.platform.FakeWrapper) package common.platform { import common.*; import flash.display.*; public class FakeWrapper extends Wrapper { public function FakeWrapper(stage:Stage){ super(stage); stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; viewerId = "105739"; authKey = "c4e9a994a06fb716d35ceaceb576712f"; isInstalled = true; configUrl = "http://localhost:8080/static/config.json"; serverUrl = "http://localhost:8080"; } override public function getAppFriends(callback):void{ callback(null); } override public function getFriends(callback):void{ callback(Test.vkFriendsResponse.response); } } }//package common.platform
Section 61
//Platform (common.platform.Platform) package common.platform { import common.platform.vk.*; import common.platform.mm.*; public class Platform { public static var wrapper:Wrapper; public function Platform(){ super(); } public static function detect(application):void{ var url:String = application.loaderInfo.url; if ((((url.indexOf("vkontakte.ru") > -1)) || ((url.indexOf("vk.com") > -1)))){ trace("Detected vkontakte.ru platform"); wrapper = new VKWrapper(application); } else { if (url.indexOf("mail.ru") > -1){ trace("Detected mail.ru platform"); wrapper = new MMWrapper(application.stage); } else { trace("Platform not detected, using fake wrapper"); wrapper = new FakeWrapper(application.stage); }; }; } } }//package common.platform
Section 62
//Wrapper (common.platform.Wrapper) package common.platform { import flash.display.*; import flash.geom.*; import flash.net.*; public dynamic class Wrapper { public var spaceFullscreenSize:Rectangle; public var normalSize:Rectangle; public var viewerId:String; public var configUrl:String; public var authKey:String; public var spaceBiggerSize:Rectangle; public var spaceNormaSize:Rectangle; public var serverUrl:String; public var isInstalled:Boolean; protected var _stage:Stage; public function Wrapper(stage:Stage){ normalSize = new Rectangle(0, 0, 640, 480); spaceNormaSize = new Rectangle(0, 45, 640, 365); spaceBiggerSize = new Rectangle(0, 0, 864, 708); spaceFullscreenSize = new Rectangle(0, 0, 864, 708); super(); _stage = stage; } public function setSize(width:Number, height:Number):void{ } public function showInviteBox():void{ } public function navigateToURL(url:String):void{ navigateToURL(new URLRequest(url)); } public function addServerRequestParams(request:Object):void{ } public function getFriends(callback):void{ throw (new Error("not implemeted")); } public function set frameRate(rate:Number):void{ _stage.frameRate = rate; } public function get stageSize():Rectangle{ return (new Rectangle(0, 0, _stage.stageWidth, _stage.stageHeight)); } public function getAppFriends(callback):void{ throw (new Error("not implemeted")); } } }//package common.platform
Section 63
//AnimationUtils (common.AnimationUtils) package common { import flash.display.*; import com.greensock.*; import flash.utils.*; import com.greensock.easing.*; public class AnimationUtils { public function AnimationUtils(){ super(); } public static function tweenAnimation(clip:MovieClip, duration:Number):void{ var step:Function; var clip = clip; var duration = duration; step = function ():void{ clip.stop(); if (clip.currentFrame == clip.framesLoaded){ clip.gotoAndStop(1); } else { clip.gotoAndStop((clip.currentFrame + 1)); }; setTimeout(step, duration); }; duration = ((duration * 1000) / clip.framesLoaded); step(); clip.gotoAndStop(1); } public static function stopAnimationAndPlayOnceEveryNSeconds(movieClip:MovieClip, timeout:Number, frameRate:Number):void{ var onTimeout:Function; var onEnterFrame:Function; var movieClip = movieClip; var timeout = timeout; var frameRate = frameRate; var onClipEnd:Function = function ():void{ movieClip.gotoAndStop(0); setTimeout(onTimeout, int((timeout * 1000))); }; onTimeout = function ():void{ movieClip.gotoAndStop(0); setTimeout(onEnterFrame, int((1000 / frameRate))); }; onEnterFrame = function ():void{ if (movieClip.currentFrame < movieClip.framesLoaded){ movieClip.gotoAndStop((movieClip.currentFrame + 1)); setTimeout(onEnterFrame, int((1000 / frameRate))); } else { onClipEnd(); }; }; onClipEnd(); } public static function tweenAnimationYoyo(clip:MovieClip, duration:Number, repeat:int=-1, onComplete:Function=null):TimelineMax{ var clip = clip; var duration = duration; var repeat = repeat; var onComplete = onComplete; if (repeat > 0){ duration = (duration / 2); }; clip.gotoAndStop(1); var tween:TimelineMax = new TimelineMax({repeat:repeat, onComplete:function ():void{ if (onComplete != null){ onComplete(); }; }}); tween.append(TweenMax.to(clip, duration, {frame:clip.framesLoaded, useFrames:true, ease:Linear.easeNone})); tween.append(TweenMax.to(clip, duration, {frame:1, useFrames:true, ease:Linear.easeNone})); return (tween); } } }//package common
Section 64
//ApplicationBase (common.ApplicationBase) package common { import flash.events.*; import flash.display.*; import flash.text.*; import flash.geom.*; import common.events.*; import com.adobe.serialization.json.*; import flash.system.*; import flash.ui.*; public class ApplicationBase extends Sprite { public var config; private var _customCursor:DisplayObject; protected var _configLoader:ConfigLoader;// = null private var _lastSimpleAlertRect; protected var _configProgress:Number;// = 0 private var _lastSimpleAlertTextField; private var _THIS; private var _bkg:Sprite; public function ApplicationBase(configLoader:ConfigLoader=null){ var configLoader = configLoader; super(); Security.allowDomain("*"); _THIS = this; createBkg(); if (configLoader){ _configLoader = configLoader; loadConfig(); }; addEventListener(Event.ADDED_TO_STAGE, function (e):void{ onAddedToStage(); }); } public function setSize(width:Number, height:Number):void{ _bkg.width = width; _bkg.height = height; } protected function loadConfig():void{ if (_configLoader != null){ _configProgress = 0; _configLoader.load(function (result):void{ var result = result; if ((result is Error)){ onError(Dict.str("error_load_config")); } else { config = JSON.decode(result); //unresolved jump var _slot1 = e; onError(Dict.str("error_parse_config")); if (config){ onConfigLoaded(); }; }; }, onConfigProgress); //unresolved jump var _slot1 = e; onError(_slot1); }; } protected function get allReady():Boolean{ return (((config) || (!(_configLoader)))); } protected function onReady():void{ } public function showSimpleAlert(message:String, rect:DisplayObjectContainer=null):void{ var modalRect:Sprite; var newRect:Sprite; var bounds:Rectangle; var alertRect:Rectangle; var message = message; var rect = rect; if (!rect){ if (!_lastSimpleAlertRect){ modalRect = new Sprite(); newRect = new Sprite(); bounds = this.getBounds(this); modalRect.graphics.beginFill(0, 0.4); modalRect.graphics.drawRect(bounds.left, bounds.top, bounds.width, bounds.height); modalRect.graphics.endFill(); if ((((bounds.width < 400)) || ((bounds.height < 300)))){ bounds = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight); }; alertRect = new Rectangle((bounds.left + (bounds.width / 3)), (bounds.top + (bounds.height / 3)), (bounds.width / 3), (bounds.height / 3)); newRect.graphics.beginFill(0x777777); newRect.graphics.drawRect(alertRect.x, alertRect.y, alertRect.width, alertRect.height); newRect.graphics.endFill(); rect = newRect; this.addChild(modalRect); this.addChild(newRect); } else { rect = _lastSimpleAlertRect; }; }; _lastSimpleAlertRect = rect; rect.removeChild(_lastSimpleAlertTextField); //unresolved jump var _slot1 = e; var textField:TextField = new TextField(); var tf:TextFormat = new TextFormat("Arial", 20, 0xFFFFFF, true); var rectBounds:Rectangle = rect.getBounds(rect); tf.align = TextFormatAlign.CENTER; textField.autoSize = TextFieldAutoSize.CENTER; textField.defaultTextFormat = tf; textField.text = message; textField.width = (rectBounds.width - 20); textField.wordWrap = true; rect.addChild(textField); _lastSimpleAlertTextField = textField; textField.x = (((rectBounds.left + rectBounds.right) / 2) - (textField.width / 2)); textField.y = (((rectBounds.top + rectBounds.bottom) / 2) - (textField.height / 2)); } protected function onConfigProgress(e:ProgressEvent):void{ _configProgress = (Number(e.bytesLoaded) / Number(e.bytesTotal)); } public function hideCustomCursor(tween:Boolean=false):void{ if (_customCursor){ if (tween){ GraphUtils.tweenVisible(_customCursor, false, 0.2); } else { _customCursor.visible = false; }; }; } public function showCustomCursor(tween:Boolean=false):void{ if (_customCursor){ if (tween){ GraphUtils.tweenVisible(_customCursor, true, 0.2); } else { _customCursor.visible = true; }; }; } protected function onError(error):void{ if ((error is Error)){ error = error.text; }; trace(("ApplicationBase.onError: " + error)); showSimpleAlert(((error + "\n") + Dict.str("try_reload_browser"))); } public function setCursor(cursor:DisplayObject):void{ Mouse.hide(); _customCursor = cursor; if ((_customCursor is InteractiveObject)){ InteractiveObject(_customCursor).mouseEnabled = false; }; if ((_customCursor is DisplayObjectContainer)){ DisplayObjectContainer(_customCursor).mouseChildren = false; }; var root:* = DisplayObjectContainer(this.root); root.addChild(_customCursor); } public function get THIS(){ return (_THIS); } protected function createBkg():void{ _bkg = new Sprite(); _bkg.graphics.beginFill(5452813, 1); _bkg.graphics.drawRect(0, 0, 100, 100); _bkg.graphics.endFill(); addChild(_bkg); } protected function onConfigLoaded():void{ checkAllReady(); } public function get customCursor():DisplayObject{ return (_customCursor); } protected function onAddedToStage():void{ checkAllReady(); registerMouseMove(); } protected function checkAllReady():void{ if (allReady){ onReady(); }; } private function registerMouseMove():void{ root.addEventListener(MouseEvent.MOUSE_MOVE, function (e:MouseEvent):void{ if (e.target.root){ if (_customCursor){ _customCursor.x = e.stageX; _customCursor.y = e.stageY; }; EventManager.inst.dispatchEvent(new DynamicEvent("cursorMove", {stageX:e.stageX, stageY:e.stageY})); }; }); } override public function addChild(child:DisplayObject):DisplayObject{ var result:* = super.addChild(child); if (((_customCursor) && (contains(_customCursor)))){ setChildIndex(_customCursor, (numChildren - 1)); }; return (result); } } }//package common
Section 65
//ConfigLoader (common.ConfigLoader) package common { import flash.events.*; import flash.net.*; public class ConfigLoader { private var _configPathes:Array;// = null private var _currentPathIndex:int;// = -1 public function ConfigLoader(configPathes:Array=null){ super(); if (configPathes){ _configPathes = configPathes; } else { _configPathes = ["./config.json"]; }; } protected function loadInternal(callback, progress):void{ var handler:Function; var callback = callback; var progress = progress; handler = function (e:Event):void{ var configLoader:URLLoader = URLLoader(e.currentTarget); configLoader.removeEventListener(IOErrorEvent.IO_ERROR, handler); configLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, handler); configLoader.removeEventListener(Event.COMPLETE, handler); if (progress){ configLoader.removeEventListener(ProgressEvent.PROGRESS, progress); }; if (e.type == Event.COMPLETE){ trace("Config loaded"); callback(configLoader.data); } else { if ((e is ErrorEvent)){ if (_currentPathIndex < (_configPathes.length - 1)){ loadInternal(callback, progress); } else { callback(new Error(ErrorEvent(e).text)); }; } else { if (_currentPathIndex < (_configPathes.length - 1)){ loadInternal(callback, progress); } else { callback(new Error("Unknown error loading config")); }; }; }; }; var configLoader:URLLoader = new URLLoader(); configLoader.addEventListener(IOErrorEvent.IO_ERROR, handler); configLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handler); configLoader.addEventListener(Event.COMPLETE, handler); if (progress){ configLoader.addEventListener(ProgressEvent.PROGRESS, progress); }; _currentPathIndex++; var path:String = ((_configPathes[_currentPathIndex] + "?random=") + int((Math.random() * 1000000000))); trace(("Loading config from: " + path)); configLoader.load(new URLRequest(path)); } public function get configPathes():Array{ return (_configPathes); } public function load(callback, progress=null):void{ _currentPathIndex = -1; loadInternal(callback, progress); } } }//package common
Section 66
//CSV (common.CSV) package common { import com.adobe.utils.*; public class CSV { private static const DELIM:String = ","; public function CSV(){ super(); } private static function parseList(str:String, delim:String):Array{ var stack:Array; var groups:Array; var isDelim:Boolean; var isEnd:Boolean; var char:String; var value:String; var str = str; var delim = delim; var checkGroupStart:Function = function (char:String):Boolean{ var group:String; for each (group in groups) { if (group.charAt(0) == char){ stack.push(group); return (true); }; }; return (false); }; var checkGroupEnd:Function = function (char:String):Boolean{ var curGroup:String; if (stack.length > 0){ curGroup = stack[(stack.length - 1)]; if (curGroup.charAt(1) == char){ stack.splice((stack.length - 1), 1); return (true); }; }; return (false); }; var values:Array = []; stack = []; groups = ["\"\"", "{}", "[]"]; var startIndex:int; var i:int; while (true) { isDelim = false; isEnd = false; if (stack.length == 0){ if (i == str.length){ isDelim = true; isEnd = true; } else { char = str.charAt(i); if (char == delim){ isDelim = true; }; }; } else { if (i == str.length){ throw (new Error((((((((("Error parsing CSV: " + "in line ") + str) + " group end not found at ") + i) + ", stack length: ") + stack.length) + ", group: ") + stack[(stack.length - 1)]))); }; char = str.charAt(i); }; if (isDelim){ value = str.substring(startIndex, i); values.push(value); if (isEnd){ break; }; i = (i + 1); while ((((i < str.length)) && ((((str.charCodeAt(i) == 32)) || ((str.charCodeAt(i) == 9)))))) { i = (i + 1); }; startIndex = i; } else { if (!checkGroupEnd(char)){ checkGroupStart(char); i = (i + 1); } else { i = (i + 1); }; }; }; return (values); } public static function parse(text:String, LineClass_:Class=null):Array{ var fieldNames:Array; var k:int; var j:int; var line:String; var values:Array; var obj:Object; var i:int; var text = text; var LineClass_ = LineClass_; var lines:Array = text.split("\n"); var objects:Array = []; if (lines.length > 0){ fieldNames = String(StringUtil.trim(lines[0])).split(","); k = 1; while (k < fieldNames.length) { fieldNames[k] = StringUtil.trim(fieldNames[k]); k = (k + 1); }; if (fieldNames.length > 0){ j = 1; for (;j < lines.length;(j = (j + 1))) { line = StringUtil.trim(lines[j]); if (line.length > 0){ values = parseList(line, DELIM); if (values.length > fieldNames.length){ throw (new Error(((((((("Error parsing CSV: " + fieldNames.length) + " values > ") + values.length) + " columns in line ") + lines[j]) + " \n") + values))); }; obj = (LineClass_) ? new (LineClass_) : new Object(); i = 0; while (i < values.length) { obj[fieldNames[i]] = parseValue(values[i]); i = (i + 1); }; objects.push(obj); continue; var _slot1 = e; throw (new Error((((("Error parsing CSV: " + "in line ") + line) + "\n") + _slot1))); }; }; }; }; return (objects); } private static function splitFirst(str:String, delim:String):Object{ var i:int = str.indexOf(delim); if (i > -1){ return ({key:str.substring(0, i), value:str.substring((i + 1))}); }; return (null); } private static function parseObject(value:String):Object{ var keyValue:Object; var key:String; value = value.substring(1, (value.length - 1)); var pairs:Array = parseList(value, DELIM); var obj:Object = {}; var i:int; while (i < pairs.length) { keyValue = splitFirst(pairs[i], "="); if (keyValue){ key = StringUtil.trim(keyValue.key); obj[key] = parseValue(StringUtil.trim(keyValue.value)); }; i++; }; return (obj); } private static function parseArray(value:String):Object{ value = value.substring(1, (value.length - 1)); var items:Array = parseList(value, DELIM); var i:int; while (i < items.length) { items[i] = parseValue(StringUtil.trim(items[i])); i++; }; if ((((items.length == 1)) && ((items[0] == "")))){ items = []; }; return (items); } private static function parseValue(value:String):Object{ value = StringUtil.trim(value); if (StringUtil.beginsWith(value, "\"")){ return (parseValue(value.substring(1, (value.length - 1)))); }; if (StringUtil.beginsWith(value, "{")){ return (parseObject(value)); }; if (StringUtil.beginsWith(value, "[")){ return (parseArray(value)); }; return (value); } } }//package common
Section 67
//Dict (common.Dict) package common { public class Dict { public static var _provider; public function Dict(){ super(); } public static function str(key:String, ... _args):String{ var value:String; if (_provider){ value = _provider[key]; if (value){ return (replaceParams(value, _args)); }; }; return (key); } public static function get provider(){ return (_provider); } public static function set provider(value):void{ _provider = value; } private static function replaceParams(str:String, ... _args):String{ var args:Array; if (str == null){ return (""); }; var len:uint = _args.length; if ((((len == 1)) && ((_args[0] is Array)))){ args = (_args[0] as Array); len = args.length; } else { args = _args; }; var i:int; while (i < len) { str = str.replace(new RegExp((("\\{" + i) + "\\}"), "g"), args[i]); i++; }; return (str); } } }//package common
Section 68
//DragInfo (common.DragInfo) package common { import flash.display.*; import flash.geom.*; public class DragInfo { public var point:Point; public var item:Object; public var source; public var object:DisplayObject; public function DragInfo(object:DisplayObject, source, item:Object=null, point:Point=null){ super(); this.item = item; this.source = source; this.object = object; this.point = point; } } }//package common
Section 69
//DynamicEvent (common.DynamicEvent) package common { import flash.events.*; public dynamic class DynamicEvent extends Event { public function DynamicEvent(type:String, params:Object=null, cancelable:Boolean=false){ var propName:String; super(type, false, cancelable); if (params){ for (propName in params) { this[propName] = params[propName]; }; }; } } }//package common
Section 70
//GraphUtils (common.GraphUtils) package common { import flash.display.*; import flash.text.*; import flash.geom.*; import com.greensock.*; import common.platform.*; import com.adobe.utils.*; public class GraphUtils { public static const LEFT_CENTER:String = "leftCenter"; public static const BOTTOM_CENTER:String = "bottomCenter"; public static const TOP_LEFT:String = "topLeft"; public static const BOTTOM_LEFT:String = "bottomLeft"; public static const TOP_CENTER:String = "topCenter"; public function GraphUtils(){ super(); } public static function alignTo(obj:DisplayObject, to, align:String):void{ if (!(to is Rectangle)){ to = to.getBounds(to.parent); }; switch (align){ case BOTTOM_LEFT: obj.x = to.left; obj.y = to.bottom; break; case BOTTOM_CENTER: center(obj, to, NaN, to.bottom); break; case TOP_CENTER: center(obj, to, NaN, (to.top - obj.height)); break; }; } public static function centerX(obj:DisplayObject):Number{ var rect:Rectangle = obj.getRect(obj); return ((obj.x + ((rect.left + rect.right) / 2))); } public static function copyClipAsImage(clip:DisplayObject):InteractiveObject{ var oldMatrix:Matrix = clip.transform.matrix.clone(); clip.transform.matrix = new Matrix(); clip.x = 0; clip.y = 0; var copy:Sprite = new Sprite(); var bitmapData:BitmapData = new BitmapData(clip.width, clip.height, true, 0); var m:Matrix = new Matrix(); var rect:Rectangle = clip.getBounds(clip); m.translate(-(rect.x), -(rect.y)); bitmapData.draw(clip, m, null, null, null); var bitmap:Bitmap = new Bitmap(bitmapData); bitmap.smoothing = true; copy.addChild(bitmap); copy.transform.matrix = oldMatrix.clone(); copy.transform.colorTransform = clip.transform.colorTransform; if ((clip is InteractiveObject)){ copy.mouseEnabled = InteractiveObject(clip).mouseEnabled; }; clip.transform.matrix = oldMatrix; return (copy); } public static function tweenVisible(obj:DisplayObject, visible:Boolean, duration:Number, remove:Boolean=false):void{ var obj = obj; var visible = visible; var duration = duration; var remove = remove; if (visible){ obj.visible = true; obj.alpha = 0; TweenLite.killTweensOf(obj); TweenLite.to(obj, duration, {alpha:1}); } else { obj.alpha = 1; TweenLite.killTweensOf(obj); TweenLite.to(obj, duration, {alpha:0, onComplete:function ():void{ obj.alpha = 1; if (!remove){ obj.visible = false; } else { Utils.removeChildSafe(obj); }; }}); }; } public static function copyAndPasteClipAsImage(clip:DisplayObject, dest:DisplayObjectContainer):InteractiveObject{ var copy:InteractiveObject = copyClipAsImage(clip); var p:Point = dest.globalToLocal(clip.parent.localToGlobal(new Point(clip.x, clip.y))); copy.scaleX = (copy.scaleX * clip.parent.scaleX); copy.scaleY = (copy.scaleY * clip.parent.scaleY); copy.x = p.x; copy.y = p.y; dest.addChild(copy); return (copy); } private static function ellipsisLastLine(textField:TextField, delta:int=0):int{ var newText:String; var lastLine2:String; var end2:int; var nextSpaceIndex:int; var oldText:String = textField.text; var lastLine:String = textField.getLineText((textField.bottomScrollV - 1)); var i:int = oldText.indexOf(lastLine); if ((i + lastLine.length) < oldText.length){ newText = (StringUtil.rtrim(oldText.substring(0, ((i + lastLine.length) + delta))) + "..."); setTextInternal(textField, newText); lastLine2 = textField.getLineText((textField.bottomScrollV - 1)); if (lastLine2.indexOf("...") == -1){ setTextInternal(textField, oldText); return (-1); }; end2 = ((newText.indexOf(lastLine2) + lastLine2.length) - "...".length); nextSpaceIndex = oldText.indexOf(" ", end2); if (nextSpaceIndex == end2){ nextSpaceIndex = oldText.indexOf(" ", (end2 + 1)); }; if (nextSpaceIndex == -1){ nextSpaceIndex = oldText.length; }; return ((nextSpaceIndex - end2)); //unresolved jump }; return (0); } public static function showFlash(container:DisplayObjectContainer, onComplete:Function=null):void{ var flash:Sprite; var container = container; var onComplete = onComplete; flash = new Sprite(); var displayRect:Rectangle = LayoutManager.inst.displayRect; flash.graphics.beginFill(0xFFFFFF, 1); flash.graphics.drawRect(0, 0, displayRect.width, displayRect.height); flash.graphics.endFill(); container.addChild(flash); TweenLite.to(flash, 1, {alpha:0, onComplete:function ():void{ Utils.removeChildSafe(flash); if (onComplete != null){ onComplete(); }; }}); } private static function setTextInternal(textField:TextField, text:String):void{ var format:TextFormat; if (text == null){ text = ""; }; if (textField.text.length > 0){ format = textField.getTextFormat(0); } else { format = textField.getTextFormat(); }; textField.text = text; textField.setTextFormat(format); } public static function setText(textField:TextField, text:String, ellipsis:Boolean=false):void{ var nextWordLen:int; var addLen:int; if (text == null){ text = ""; }; setTextInternal(textField, text); if (ellipsis){ nextWordLen = ellipsisLastLine(textField); if (nextWordLen == -1){ ellipsisLastLine(textField, -3); } else { if (nextWordLen > 0){ addLen = 1; while (addLen < nextWordLen) { setTextInternal(textField, text); if (ellipsisLastLine(textField, addLen) == -1){ ellipsisLastLine(textField, (addLen - 1)); break; }; addLen++; }; }; }; }; } public static function centerPoint():Point{ return (new Point((Platform.wrapper.normalSize.width / 2), (Platform.wrapper.normalSize.height / 2))); } public static function randomPoint():Point{ return (new Point((Math.random() * LayoutManager.inst.displayRect.width), (Math.random() * LayoutManager.inst.displayRect.height))); } public static function center(obj:DisplayObject, by=null, x:Number=NaN, y:Number=NaN):void{ if (by == null){ if (obj.parent){ by = obj.parent; } else { by = LayoutManager.inst.displayRect; }; }; var objRect:Rectangle = obj.getBounds(obj); if (!(by is Rectangle)){ by = by.getBounds(by); }; if (isNaN(x)){ obj.x = (((by.left + by.right) / 2) - ((objRect.left + objRect.right) / 2)); } else { obj.x = x; }; if (isNaN(y)){ obj.y = (((by.top + by.bottom) / 2) - ((objRect.top + objRect.bottom) / 2)); trace(((((((by.top + by.bottom) / 2) + " ") + ((objRect.top + objRect.bottom) / 2)) + " ") + obj.y)); } else { obj.y = y; }; } public static function fit(obj:DisplayObject, parent=null, marginX:Number=0, marginY:Number=0):void{ var rect:Rectangle; if (!parent){ parent = obj.parent; }; if ((parent is Rectangle)){ rect = parent; } else { rect = parent.getRect(parent); }; rect.x = (rect.x + marginX); rect.width = (rect.width - (marginX * 2)); rect.y = (rect.y + marginY); rect.height = (rect.height - (marginY * 2)); obj.scaleX = 1; obj.scaleY = 1; var scale:Number = Math.min((rect.width / obj.width), (rect.height / obj.height)); obj.scaleX = scale; obj.scaleY = scale; var newX:Number = Math.floor(((rect.width - obj.width) / 2)); var newY:Number = Math.floor(((rect.height - obj.height) / 2)); obj.x = Math.round((newX + rect.x)); obj.y = Math.round((newY + rect.y)); } public static function alignIn(obj:DisplayObject, by, align:String):void{ if (!(by is Rectangle)){ by = by.getBounds(by); }; switch (align){ case LEFT_CENTER: center(obj, by, by.x); break; case TOP_CENTER: center(obj, by, NaN, by.y); break; case BOTTOM_CENTER: center(obj, by, NaN, (by.bottom - obj.height)); break; case TOP_LEFT: obj.x = by.left; obj.y = by.top; break; case BOTTOM_LEFT: obj.x = by.left; obj.y = (by.bottom - obj.height); break; }; } } }//package common
Section 71
//LayoutManager (common.LayoutManager) package common { import flash.events.*; import flash.display.*; import flash.geom.*; import common.events.*; import common.platform.*; public class LayoutManager { public var isFullscreen:Boolean;// = false private var _stage:Stage; public static var inst:LayoutManager; public function LayoutManager(stage:Stage){ var stage = stage; super(); _stage = stage; stage.addEventListener(FullScreenEvent.FULL_SCREEN, function (e:FullScreenEvent):void{ isFullscreen = e.fullScreen; EventManager.inst.dispatchEvent("needRelayout"); }); } public function internalLayout(container:DisplayObjectContainer, objects:Array, removeAll:Boolean, scaleForScalable:Number=1):void{ var item:Object; var obj:*; var scale:Number; var objRect:Rectangle; if (removeAll){ Utils.removeAllChildren(container); } else { removeObjects(objects); }; for each (item in objects) { obj = item.obj; item = preprocessItem(item); if (item.x != undefined){ obj.x = item.y; }; if (item.y != undefined){ obj.y = item.y; }; scale = (((!((item.scale == undefined))) && ((item.scale == true)))) ? scaleForScalable : 1; if (item.width != undefined){ if (((("maxSize" in item.obj)) && (item.obj.maxSize))){ obj.width = (scale * Math.min(item.width, item.obj.maxSize.width)); } else { obj.width = (scale * item.width); }; }; if (item.height != undefined){ if (((("maxSize" in item.obj)) && (item.obj.maxSize))){ obj.height = (scale * Math.min(item.height, item.obj.maxSize.height)); } else { obj.height = (scale * item.height); }; }; objRect = obj.getRect(obj); switch (item.vAlign.align){ case undefined: break; case "bottom": if (item.vAlign.type == "out"){ obj.y = item.vAlign.target.bottom; } else { obj.y = (item.vAlign.target.bottom - objRect.bottom); }; break; case "top": if (item.vAlign.type == "out"){ obj.y = (item.vAlign.target.top - objRect.bottom); } else { obj.y = item.vAlign.target.top; }; break; case "center": obj.y = Math.round((((item.vAlign.target.top + item.vAlign.target.bottom) / 2) - ((objRect.top + objRect.bottom) / 2))); break; case "fill": obj.y = item.vAlign.target.top; obj.height = item.vAlign.target.height; break; default: throw (new Error(("not implemented: vAlign.align: " + item.vAlign.align))); }; switch (item.hAlign.align){ case undefined: break; case "left": obj.x = item.hAlign.target.left; break; case "right": obj.x = item.hAlign.target.right; break; case "center": obj.x = Math.round((((item.hAlign.target.left + item.hAlign.target.right) / 2) - ((objRect.left + objRect.right) / 2))); break; case "fill": obj.x = item.hAlign.target.left; obj.width = item.hAlign.target.width; break; default: throw (new Error(("not implemented: hAlign: " + item.hAlign.align))); }; if (item.dx){ obj.x = (obj.x + item.dx); }; if (item.dy){ obj.y = (obj.y + item.dy); }; container.addChild(obj); }; } public function get displayRect():Rectangle{ if (isFullscreen){ return (new Rectangle(0, 0, _stage.fullScreenWidth, _stage.fullScreenHeight)); }; return (Platform.wrapper.normalSize.clone()); } private function copyNonExistingProps(dest:Object, src):void{ var propName:String; for (propName in src) { if (!dest[propName]){ dest[propName] = src[propName]; }; }; } private function checkOutOfScreenBoundsAndCorrectScalableObjects(container:DisplayObjectContainer, objects:Array, removeAll:Boolean):void{ var outerBounds:Rectangle; var scalableHeight:Number; var scalableWidth:Number; var item:Object; var overWidth:Number; var overHeight:Number; var dx:Number; var dy:Number; var obj:*; var scaleX:Number; var scaleY:Number; var scale:Number; if (objects.length > 0){ outerBounds = calcBounds(objects, container); scalableHeight = 0; scalableWidth = 0; for each (item in objects) { obj = item.obj; if (((!((item.scale == undefined))) && ((item.scale == true)))){ scalableWidth = (scalableWidth + obj.width); scalableHeight = (scalableHeight + obj.height); }; }; overWidth = (outerBounds.width - displayRect.width); overHeight = (outerBounds.height - displayRect.height); if ((((((overHeight > 0)) && ((scalableHeight > 0)))) || ((((overWidth > 0)) && ((scalableWidth > 0)))))){ scaleX = ((scalableWidth - overWidth) / scalableWidth); scaleY = ((scalableHeight - overHeight) / scalableHeight); scale = Math.min(scaleX, scaleY); if (scale < 0){ scale = 0; }; internalLayout(container, objects, removeAll, scale); }; outerBounds = calcBounds(objects, container); dx = 0; dy = 0; if (outerBounds.top < 0){ dy = -(outerBounds.top); }; if (outerBounds.bottom > displayRect.bottom){ dy = (displayRect.bottom - outerBounds.bottom); }; if (outerBounds.left < 0){ dx = -(outerBounds.left); }; if (outerBounds.right > displayRect.right){ dx = (displayRect.right - outerBounds.right); }; if (((!((dx == 0))) || (!((dy == 0))))){ for each (item in objects) { item.obj.x = (item.obj.x + dx); item.obj.y = (item.obj.y + dy); }; }; }; } private function removeObjects(objects:Array):void{ var item:Object; for each (item in objects) { Utils.removeChildSafe(item.obj); }; } private function calcBounds(objects:Array, container:DisplayObjectContainer):Rectangle{ var rect:Rectangle; var item:Object = objects[0].obj; var outerBounds:Rectangle = item.getRect(container); var i = 1; while (i < objects.length) { item = objects[i].obj; rect = item.getRect(container); if (rect.left < outerBounds.left){ outerBounds.left = rect.left; }; if (rect.right > outerBounds.right){ outerBounds.right = rect.right; }; if (rect.top < outerBounds.top){ outerBounds.top = rect.top; }; if (rect.bottom > outerBounds.bottom){ outerBounds.bottom = rect.bottom; }; i++; }; return (outerBounds); } private function collectAlignProps(item:Object):Object{ var props:Object = {}; if (item.target){ props.target = item.target; }; if (item.type){ props.type = item.type; }; if (((item.align) && ((item.align is String)))){ props.align = item.align; }; return (props); } public function layout(container:DisplayObjectContainer, objects:Array, removeAll:Boolean=true):void{ internalLayout(container, objects, removeAll); checkOutOfScreenBoundsAndCorrectScalableObjects(container, objects, removeAll); } public function preprocessItem(item:Object):Object{ var hAlign:Object = item.align; var vAlign:Object = item.align; var newItem:Object = {}; Utils.copyDynamicProps(newItem, item, true); var rootProps:Object = collectAlignProps(newItem); if (!rootProps.target){ rootProps.target = displayRect; }; if (!newItem.align){ newItem.align = {}; } else { if ((newItem.align is String)){ newItem.align = {align:newItem.align}; }; }; copyNonExistingProps(newItem.align, rootProps); if (!newItem.vAlign){ newItem.vAlign = {}; } else { if ((newItem.vAlign is String)){ newItem.vAlign = {align:newItem.vAlign}; }; }; copyNonExistingProps(newItem.vAlign, newItem.align); if (!newItem.hAlign){ newItem.hAlign = {}; } else { if ((newItem.hAlign is String)){ newItem.hAlign = {align:newItem.hAlign}; }; }; copyNonExistingProps(newItem.hAlign, newItem.align); if (!(newItem.align.target is Rectangle)){ newItem.align.target = newItem.align.target.getRect(newItem.align.target.parent); }; if (!(newItem.vAlign.target is Rectangle)){ newItem.vAlign.target = newItem.vAlign.target.getRect(newItem.vAlign.target.parent); }; if (!(newItem.hAlign.target is Rectangle)){ newItem.hAlign.target = newItem.hAlign.target.getRect(newItem.hAlign.target.parent); }; return (newItem); } } }//package common
Section 72
//MouseController (common.MouseController) package common { import flash.events.*; import flash.display.*; import flash.geom.*; public class MouseController extends EventDispatcher { private var _mode:String;// = "normal" private var _captureCount:Number;// = 0 private var _clickObjects:Array; private var _holdTarget:Object; private var _curPos:Point; private var _holdPos:Point; private var _lastWheelTime:Number;// = -1 private var _outerObject:IEventDispatcher; private var _lastPos:Point; private var _holdLocalPoint:Point; private var _holdCurrentTarget:Object; private var _dragEnabled:Boolean;// = true private var _cursor:DisplayObject; private var _delta:Point; public static const MODE_NORMAL:String = "normal"; public static const MODE_HOLD:String = "hold"; public static const MODE_DRAGGING:String = "dragging"; private static var _instance:MouseController; public function MouseController(){ _curPos = new Point(-1, -1); _delta = new Point(0, 0); _clickObjects = []; super(); } public function get captured():Boolean{ return ((_captureCount > 0)); } private function onMouseUp(event:MouseEvent):void{ var _local2:DisplayObject; if (!captured){ switch (_mode){ case MODE_HOLD: changeMode(MODE_NORMAL); dispatchEvent(new MouseEvent(MouseEvent.CLICK)); break; case MODE_DRAGGING: changeMode(MODE_NORMAL); _local2 = findClickObject(event.stageX, event.stageY); dispatchEvent(new DynamicEvent("stopDragging", {targetObject:event.target, currentTargetObject:_local2})); break; default: dispatchEvent(event.clone()); }; } else { dispatchEvent(event.clone()); }; } public function get curPos():Point{ return (_curPos); } public function attach(clickObject, outerObject):void{ outerObject.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); outerObject.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); if (clickObject){ setClickObjects(clickObject); }; _outerObject = outerObject; } public function release():void{ if (_captureCount > 0){ _captureCount--; }; } public function get lastDelta():Point{ _delta.x = (_curPos.x - _lastPos.x); _delta.y = (_curPos.y - _lastPos.y); return (_delta); } public function capture():void{ if (_captureCount == 0){ changeMode(MODE_NORMAL); }; _captureCount++; } public function get holdDelta():Point{ _delta.x = (_holdPos.x - _lastPos.x); _delta.y = (_holdPos.y - _lastPos.y); return (_delta); } private function onMouseDown(event:MouseEvent):void{ if (!captured){ switch (_mode){ case MODE_NORMAL: changeMode(MODE_HOLD); _holdPos = _curPos.clone(); _holdTarget = event.target; _holdCurrentTarget = event.currentTarget; _holdLocalPoint = new Point(event.localX, event.localY); break; }; dispatchEvent(event.clone()); } else { dispatchEvent(event.clone()); }; } public function set dragEnabled(value:Boolean):void{ _dragEnabled = value; } private function onMouseWeel(event:MouseEvent):void{ var d:Number; var now:Number = new Date().time; if ((now - _lastWheelTime) > 50){ _lastWheelTime = now; if (!captured){ d = ((event.delta > 0)) ? 0.05 : -0.05; if (d > 0){ if (dragEnabled){ dispatchEvent(new Event("zoomIn")); }; } else { if (dragEnabled){ dispatchEvent(new Event("zoomOut")); }; }; }; }; } public function get cursor():DisplayObject{ return (_cursor); } private function findClickObject(stageX:Number, stageY:Number):DisplayObject{ var clickObject:DisplayObject; var index:int; while (index < _clickObjects.length) { clickObject = _clickObjects[index]; if (clickObject.hitTestPoint(stageX, stageY, false)){ if (clickObject.stage){ return (clickObject); }; return (null); }; index++; }; return (null); } public function set curPos(value:Point):void{ _curPos = value; } public function get dragEnabled():Boolean{ return (_dragEnabled); } private function onMouseMove(event:MouseEvent):void{ _lastPos = _curPos.clone(); _curPos.x = event.stageX; _curPos.y = event.stageY; if (_cursor != null){ _cursor.x = _curPos.x; _cursor.y = _curPos.y; }; var DRAG_THRESHOLD:Number = 3; if (!captured){ switch (_mode){ case MODE_HOLD: if ((((Math.abs((_holdPos.x - _curPos.x)) > DRAG_THRESHOLD)) || ((Math.abs((_holdPos.y - _curPos.y)) > DRAG_THRESHOLD)))){ changeMode(MODE_DRAGGING); if (dragEnabled){ dispatchEvent(new DynamicEvent("startDrag", {targetObject:_holdTarget, currentTargetObject:_holdCurrentTarget, localPoint:_holdLocalPoint})); dispatchEvent(new Event("dragging")); }; }; break; case MODE_DRAGGING: if (dragEnabled){ dispatchEvent(new Event("dragging")); }; break; default: dispatchEvent(event.clone()); break; }; } else { dispatchEvent(event.clone()); }; } private function changeMode(newMode:String):void{ _mode = newMode; } public function set cursor(value:DisplayObject):void{ _cursor = value; } public function setClickObjects(clickObjects):void{ var clickObject:*; if (!(clickObjects is Array)){ clickObjects = [clickObjects]; }; for each (clickObject in clickObjects) { clickObject.removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWeel); clickObject.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); }; _clickObjects = []; for each (clickObject in clickObjects) { if (_clickObjects.indexOf(clickObject) == -1){ _clickObjects.push(clickObject); clickObject.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWeel); clickObject.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); }; }; } } }//package common
Section 73
//PlatformApplicationBase (common.PlatformApplicationBase) package common { import common.platform.*; public class PlatformApplicationBase extends ApplicationBase { public function PlatformApplicationBase(configLoader:ConfigLoader=null){ super(configLoader); } override protected function get allReady():Boolean{ return (((super.allReady) && (Platform.wrapper))); } override protected function onAddedToStage():void{ Platform.detect(this); super.onAddedToStage(); } override public function setSize(width:Number, height:Number):void{ Platform.wrapper.setSize(width, height); super.setSize(width, height); } } }//package common
Section 74
//SoundManager (common.SoundManager) package common { import flash.events.*; import flash.display.*; import flash.media.*; public class SoundManager { public var hint:Sound;// = null public var click:Sound;// = null public var move:Sound;// = null public var reactionFailedClick:Sound;// = null public var mainMusic:Sound;// = null public var flash:Sound;// = null public var flight:Sound;// = null public var elementClick:Sound;// = null public var newElement:Sound;// = null public var _oldElements:Array; public static var inst:SoundManager; private static var _MoveClass:Class = SoundManager__MoveClass; private static var _FlightClass:Class = SoundManager__FlightClass; private static var _ElementClickClass:Class = SoundManager__ElementClickClass; private static var _ClickClass:Class = SoundManager__ClickClass; private static var _HintClass:Class = SoundManager__HintClass; private static var _NoClass:Class = SoundManager__NoClass; private static var _FlashClass:Class = SoundManager__FlashClass; private static var _MainMusicClass:Class = SoundManager__MainMusicClass; private static var _OldElementClass1:Class = SoundManager__OldElementClass1; private static var _OldElementClass2:Class = SoundManager__OldElementClass2; private static var _OldElementClass3:Class = SoundManager__OldElementClass3; private static var _OldElementClass4:Class = SoundManager__OldElementClass4; private static var _NewElementClass:Class = SoundManager__NewElementClass; public function SoundManager(){ super(); mainMusic = (new _MainMusicClass() as Sound); click = (new _ClickClass() as Sound); elementClick = (new _ElementClickClass() as Sound); reactionFailedClick = (new _NoClass() as Sound); move = (new _MoveClass() as Sound); hint = (new _HintClass() as Sound); flight = (new _FlightClass() as Sound); flash = (new _FlashClass() as Sound); newElement = (new _NewElementClass() as Sound); _oldElements = [(new _OldElementClass1() as Sound), (new _OldElementClass2() as Sound), (new _OldElementClass3() as Sound), (new _OldElementClass4() as Sound)]; } public function registerClickSoundForAllButtons(container:DisplayObjectContainer):void{ var container = container; Utils.doForAllChildrenRecursive(container, function (child):void{ var child = child; if ((child is SimpleButton)){ child.addEventListener(MouseEvent.CLICK, function (e):void{ SoundManager.inst.click.play(); }); }; }); } public function playMain():void{ var channel:SoundChannel = mainMusic.play(0, int.MAX_VALUE, new SoundTransform(0.5)); } public function muteAll():void{ SoundMixer.soundTransform = new SoundTransform(0); SoundMixer.stopAll(); } public function enableAll():void{ SoundMixer.soundTransform = new SoundTransform(1); } public function playOldElement():void{ var sound:Sound; if (_oldElements.length > 0){ sound = _oldElements[int((Math.random() * _oldElements.length))]; sound.play(); }; } } }//package common
Section 75
//SoundManager__ClickClass (common.SoundManager__ClickClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__ClickClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 76
//SoundManager__ElementClickClass (common.SoundManager__ElementClickClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__ElementClickClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 77
//SoundManager__FlashClass (common.SoundManager__FlashClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__FlashClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 78
//SoundManager__FlightClass (common.SoundManager__FlightClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__FlightClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 79
//SoundManager__HintClass (common.SoundManager__HintClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__HintClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 80
//SoundManager__MainMusicClass (common.SoundManager__MainMusicClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__MainMusicClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 81
//SoundManager__MoveClass (common.SoundManager__MoveClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__MoveClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 82
//SoundManager__NewElementClass (common.SoundManager__NewElementClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__NewElementClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 83
//SoundManager__NoClass (common.SoundManager__NoClass) package common { import flash.display.*; import mx.core.*; public class SoundManager__NoClass extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 84
//SoundManager__OldElementClass1 (common.SoundManager__OldElementClass1) package common { import flash.display.*; import mx.core.*; public class SoundManager__OldElementClass1 extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 85
//SoundManager__OldElementClass2 (common.SoundManager__OldElementClass2) package common { import flash.display.*; import mx.core.*; public class SoundManager__OldElementClass2 extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 86
//SoundManager__OldElementClass3 (common.SoundManager__OldElementClass3) package common { import flash.display.*; import mx.core.*; public class SoundManager__OldElementClass3 extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 87
//SoundManager__OldElementClass4 (common.SoundManager__OldElementClass4) package common { import flash.display.*; import mx.core.*; public class SoundManager__OldElementClass4 extends SoundAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var slash:DisplayObject; } }//package common
Section 88
//Test (common.Test) package common { public class Test { public static const vkFriendsResponse:Object = {response:[{uid:9316, first_name:"Максим", last_name:"Благушко", photo_medium:"http://cs10326.vkontakte.ru/u09316/b_71cabac3.jpg", sex:"2"}, {uid:9325, first_name:"Антипов", last_name:"Артём", photo_medium:"http://cs10335.vkontakte.ru/u09325/b_4b45c6b6.jpg", sex:"2"}, {uid:14178, first_name:"Демид", last_name:"Лупин", photo_medium:"http://cs9299.vkontakte.ru/u14178/b_9069bbf5.jpg", sex:"2"}, {uid:30997, first_name:"Владимир", last_name:"Шубин", photo_medium:"http://cs14.vkontakte.ru/u30997/b_85c77a9.jpg", sex:"2"}, {uid:39495, first_name:"Free", last_name:"Mind", photo_medium:"http://cs552.vkontakte.ru/u39495/b_bca3d6a5.jpg", sex:"2"}, {uid:40452, first_name:"Тимофей", last_name:"Пушкарёв", photo_medium:"http://cs4232.vkontakte.ru/u40452/b_ff9bce5b.jpg", sex:"2"}, {uid:41762, first_name:"Елена", last_name:"Михайлова", photo_medium:"http://cs9424.vkontakte.ru/u41762/b_b474300c.jpg", sex:"1"}, {uid:41880, first_name:"Маша", last_name:"Анциферова", photo_medium:"http://cs10.vkontakte.ru/u41880/b_451c46b.jpg", sex:"1"}, {uid:45895, first_name:"Полина", last_name:"Лубнина", photo_medium:"http://cs9893.vkontakte.ru/u45895/b_a354f3f3.jpg", sex:"1"}, {uid:47897, first_name:"Алексей", last_name:"Жохов", photo_medium:"http://cs14.vkontakte.ru/u47897/b_ce7a322.jpg", sex:"2"}, {uid:49130, first_name:"Александр", last_name:"Кукута", photo_medium:"http://cs201.vkontakte.ru/u49130/b_521200d8.jpg", sex:"2"}, {uid:53640, first_name:"Anton", last_name:"Shtulberg", photo_medium:"http://cs217.vkontakte.ru/u53640/b_781f931b.jpg", sex:"2"}, {uid:54295, first_name:"Маргарита", last_name:"Пушкарева", photo_medium:"http://cs9943.vkontakte.ru/u54295/b_d1cf41eb.jpg", sex:"1"}, {uid:73548, first_name:"Андрей", last_name:"Майборода", photo_medium:"http://cs9971.vkontakte.ru/u73548/b_6d9227cd.jpg", sex:"0"}, {uid:80896, first_name:"Дарья", last_name:"Сергиенко", photo_medium:"http://cs9673.vkontakte.ru/u80896/b_315e84f0.jpg", sex:"1"}, {uid:84300, first_name:"Виктор", last_name:"Леонов", photo_medium:"http://cs10280.vkontakte.ru/u84300/b_5115f6e1.jpg", sex:"2"}, {uid:88700, first_name:"Egor", last_name:"Antipov", photo_medium:"http://cs4415.vkontakte.ru/u88700/b_0b595f8c.jpg", sex:"2"}, {uid:93793, first_name:"Pavel", last_name:"Galibarov", photo_medium:"http://cs269.vkontakte.ru/u93793/b_35299b3e.jpg", sex:"2"}, {uid:96040, first_name:"Данил", last_name:"Галимов", photo_medium:"http://cs04.vkontakte.ru/u96040/b_2ddd96e.jpg", sex:"2"}, {uid:96275, first_name:"Владимир", last_name:"Шевченко", photo_medium:"http://cs351.vkontakte.ru/u96275/b_c1ddbfc0.jpg", sex:"2"}, {uid:100040, first_name:"Мария", last_name:"Авдеева", photo_medium:"http://cs9679.vkontakte.ru/u100040/b_be155c10.jpg", sex:"1"}, {uid:107737, first_name:"Алексей", last_name:"Лычкин", photo_medium:"http://cs05.vkontakte.ru/u107737/b_fda8448.jpg", sex:"2"}, {uid:109830, first_name:"Антон", last_name:"Ланцов", photo_medium:"http://cs713.vkontakte.ru/u109830/b_b16b57e5.jpg", sex:"2"}, {uid:118605, first_name:"Сергей", last_name:"Афанасьев", photo_medium:"http://cs9709.vkontakte.ru/u118605/b_d6fac38b.jpg", sex:"2"}, {uid:128171, first_name:"Александр", last_name:"Ярцев", photo_medium:"http://cs9859.vkontakte.ru/u128171/b_839bdc70.jpg", sex:"2"}, {uid:132347, first_name:"Наталья", last_name:"Кузнецова", photo_medium:"http://cs9353.vkontakte.ru/u132347/b_0b03b1b0.jpg", sex:"1"}, {uid:136161, first_name:"Лариса", last_name:"Сидорова", photo_medium:"http://cs1059.vkontakte.ru/u136161/b_c9543376.jpg", sex:"1"}, {uid:140838, first_name:"Леонид", last_name:"Антоненков", photo_medium:"http://cs47.vkontakte.ru/u140838/b_5f862d7.jpg", sex:"2"}, {uid:162859, first_name:"Виталиск", last_name:"Котов", photo_medium:"http://cs10366.vkontakte.ru/u162859/b_5396f611.jpg", sex:"2"}, {uid:177017, first_name:"Two", last_name:"One", photo_medium:"http://cs4559.vkontakte.ru/u177017/b_0b58aa95.jpg", sex:"2"}, {uid:194563, first_name:"Dr", last_name:"Boshkanovych", photo_medium:"http://cs4864.vkontakte.ru/u194563/b_517517c8.jpg", sex:"0"}, {uid:209207, first_name:"Ольга", last_name:"Антипова", photo_medium:"http://cs549.vkontakte.ru/u209207/b_fb768ee5.jpg", sex:"1"}, {uid:210968, first_name:"Леша", last_name:"Качанов", photo_medium:"http://cs517.vkontakte.ru/u210968/b_d0c205c4.jpg", sex:"2"}, {uid:232262, first_name:"Максим", last_name:"Игнатов", photo_medium:"http://cs4561.vkontakte.ru/u232262/b_f0a7ed30.jpg", sex:"2"}, {uid:234860, first_name:"Андрей", last_name:"Алешкин", photo_medium:"http://cs9382.vkontakte.ru/u234860/b_26e11fd5.jpg", sex:"2"}, {uid:234914, first_name:"Екатерина", last_name:"Малых", photo_medium:"http://cs10337.vkontakte.ru/u234914/b_b180c991.jpg", sex:"1"}, {uid:247506, first_name:"Евгений", last_name:"Лубнин", photo_medium:"http://cs297.vkontakte.ru/u247506/b_f6f70d05.jpg", sex:"2"}, {uid:269160, first_name:"Дмитрий", last_name:"Смирнов", photo_medium:"http://cs80.vkontakte.ru/u269160/b_2ee1fd0.jpg", sex:"2"}, {uid:278040, first_name:"Валерия", last_name:"Скалозуб", photo_medium:"http://cs707.vkontakte.ru/u278040/b_fb46b47c.jpg", sex:"1"}, {uid:290813, first_name:"Степан", last_name:"Оранжевый", photo_medium:"http://cs9194.vkontakte.ru/u290813/b_85d7e079.jpg", sex:"2"}, {uid:292928, first_name:"Анастасия", last_name:"Зверева-Воскресенская", photo_medium:"http://cs850.vkontakte.ru/u292928/b_4e78a0ce.jpg", sex:"1"}, {uid:293269, first_name:"Павел", last_name:"Мо", photo_medium:"http://cs4289.vkontakte.ru/u293269/b_d185c2b5.jpg", sex:"2"}, {uid:296675, first_name:"Сидоров", last_name:"Александр", photo_medium:"http://vkontakte.ru/images/question_b.gif", sex:"2"}, {uid:309352, first_name:"Константин", last_name:"Ткаченко", photo_medium:"http://cs10282.vkontakte.ru/u309352/b_65764ad2.jpg", sex:"2"}, {uid:319414, first_name:"Илья", last_name:"Киреев", photo_medium:"http://cs9897.vkontakte.ru/u319414/b_727c094b.jpg", sex:"2"}, {uid:330187, first_name:"Павел", last_name:"Шептунов", photo_medium:"http://cs958.vkontakte.ru/u330187/b_7b20d67e.jpg", sex:"2"}, {uid:330939, first_name:"Саша", last_name:"Разумный", photo_medium:"http://cs4134.vkontakte.ru/u330939/b_aa2d0d29.jpg", sex:"2"}, {uid:338434, first_name:"Юрий", last_name:"Ичкитидзе", photo_medium:"http://cs11.vkontakte.ru/u338434/b_d97a744.jpg", sex:"2"}, {uid:340166, first_name:"Надежда", last_name:"Медведь", photo_medium:"http://cs218.vkontakte.ru/u340166/b_a7b5f95e.jpg", sex:"1"}, {uid:346125, first_name:"Сергей", last_name:"Уздин", photo_medium:"http://cs782.vkontakte.ru/u346125/b_180b7e09.jpg", sex:"2"}, {uid:351299, first_name:"Elina", last_name:"Fineberg", photo_medium:"http://cs9952.vkontakte.ru/u351299/b_c57f4ac6.jpg", sex:"0"}, {uid:355841, first_name:"Стас", last_name:"Наривончик", photo_medium:"http://cs225.vkontakte.ru/u355841/b_5d7cf586.jpg", sex:"2"}, {uid:380202, first_name:"Екатерина", last_name:"Борисова", photo_medium:"http://cs10306.vkontakte.ru/u380202/b_d797d599.jpg", sex:"1"}, {uid:387132, first_name:"Евгений", last_name:"Марченков", photo_medium:"http://cs4279.vkontakte.ru/u387132/b_012e9deb.jpg", sex:"2"}, {uid:387702, first_name:"Сергей", last_name:"Гречихин", photo_medium:"http://cs226.vkontakte.ru/u387702/b_b8ded4b0.jpg", sex:"2"}, {uid:405754, first_name:"Сергей", last_name:"Чекмарёв", photo_medium:"http://cs12.vkontakte.ru/u405754/b_b9dccd3.jpg", sex:"2"}, {uid:406822, first_name:"Семен", last_name:"Семаков", photo_medium:"http://cs9814.vkontakte.ru/u406822/b_42898bf3.jpg", sex:"2"}, {uid:426035, first_name:"Ваня", last_name:"Лубнин", photo_medium:"http://cs9488.vkontakte.ru/u426035/b_f6386562.jpg", sex:"2"}, {uid:430422, first_name:"Алексей", last_name:"Виногоров", photo_medium:"http://cs556.vkontakte.ru/u430422/b_3d8740d4.jpg", sex:"2"}, {uid:436629, first_name:"Михаил", last_name:"Бахтин", photo_medium:"http://cs16.vkontakte.ru/u436629/b_e94e2c1.jpg", sex:"2"}, {uid:440381, first_name:"Ksenia", last_name:"Kolotushkina", photo_medium:"http://cs443.vkontakte.ru/u440381/b_dfdcff8e.jpg", sex:"1"}, {uid:457391, first_name:"Наталья", last_name:"Вдовкина", photo_medium:"http://cs520.vkontakte.ru/u457391/b_c0d8d94a.jpg", sex:"1"}, {uid:458294, first_name:"Григорий", last_name:"Шраго", photo_medium:"http://cs4436.vkontakte.ru/u458294/b_be2a39cb.jpg", sex:"2"}, {uid:485974, first_name:"Ольга", last_name:"Фирсина", photo_medium:"http://cs874.vkontakte.ru/u485974/b_4906e482.jpg", sex:"1"}, {uid:487402, first_name:"Альберт", last_name:"Садовников", photo_medium:"http://cs4325.vkontakte.ru/u487402/b_60cf05cb.jpg", sex:"2"}, {uid:492321, first_name:"Петр", last_name:"Евсеев", photo_medium:"http://cs33.vkontakte.ru/u492321/b_76e91c8.jpg", sex:"2"}, {uid:509000, first_name:"Алексей", last_name:"Обухов", photo_medium:"http://cs10205.vkontakte.ru/u509000/b_a1aa2f32.jpg", sex:"2"}, {uid:509064, first_name:"Денис", last_name:"Саблин", photo_medium:"http://cs9466.vkontakte.ru/u509064/b_22572814.jpg", sex:"2"}, {uid:516426, first_name:"Vladimir", last_name:"Balakirev", photo_medium:"http://cs593.vkontakte.ru/u516426/b_77978b14.jpg", sex:"2"}, {uid:525751, first_name:"Леонид", last_name:"Молочник", photo_medium:"http://cs312.vkontakte.ru/u525751/b_9157c71f.jpg", sex:"2"}, {uid:527080, first_name:"Марат", last_name:"Иванов", photo_medium:"http://cs955.vkontakte.ru/u527080/b_c78edbc2.jpg", sex:"2"}, {uid:531738, first_name:"Петр", last_name:"Кулаков", photo_medium:"http://cs9386.vkontakte.ru/u531738/b_cf493826.jpg", sex:"2"}, {uid:533251, first_name:"Анси", last_name:"Такса", photo_medium:"http://cs16.vkontakte.ru/u533251/b_c314fa9.jpg", sex:"0"}, {uid:534011, first_name:"Михаил", last_name:"Ходос", photo_medium:"http://cs128.vkontakte.ru/u534011/b_a4939a39.jpg", sex:"2"}, {uid:551764, first_name:"Елена", last_name:"Иванова", photo_medium:"http://cs554.vkontakte.ru/u551764/b_c52d142f.jpg", sex:"1"}, {uid:565130, first_name:"Андрей", last_name:"Демидов", photo_medium:"http://cs19.vkontakte.ru/u565130/b_5576386.jpg", sex:"2"}, {uid:565755, first_name:"Андрей", last_name:"Берковский", photo_medium:"http://cs1063.vkontakte.ru/u565755/b_b3e12cd5.jpg", sex:"2"}, {uid:568467, first_name:"Александр", last_name:"Зверев", photo_medium:"http://cs642.vkontakte.ru/u568467/b_492855eb.jpg", sex:"2"}, {uid:589277, first_name:"Odessit", last_name:"Ontour", photo_medium:"http://cs10265.vkontakte.ru/u589277/b_e0c63c05.jpg", sex:"2"}, {uid:607453, first_name:"Ольга", last_name:"Соколова", photo_medium:"http://cs124.vkontakte.ru/u607453/b_682fcd46.jpg", sex:"1"}, {uid:627791, first_name:"Руслан", last_name:"Сушко", photo_medium:"http://cs18.vkontakte.ru/u627791/b_7f4f352.jpg", sex:"2"}, {uid:630693, first_name:"Юлечко", last_name:"Стёпкина", photo_medium:"http://cs506.vkontakte.ru/u630693/b_53195dd4.jpg", sex:"1"}, {uid:647960, first_name:"Ульяна", last_name:"Колиушко", photo_medium:"http://cs10066.vkontakte.ru/u647960/b_b9f84741.jpg", sex:"1"}, {uid:653884, first_name:"Ярик", last_name:"Николаев", photo_medium:"http://cs49.vkontakte.ru/u653884/b_7392b07f.jpg", sex:"2"}, {uid:654193, first_name:"Павел", last_name:"Гонтарев", photo_medium:"http://cs19.vkontakte.ru/u654193/b_b507f8e.jpg", sex:"2"}, {uid:682395, first_name:"Елена", last_name:"Комарова", photo_medium:"http://cs4965.vkontakte.ru/u682395/b_8c3225c0.jpg", sex:"1"}, {uid:710086, first_name:"Александр", last_name:"Никулин", photo_medium:"http://cs9714.vkontakte.ru/u710086/b_10b3175b.jpg", sex:"2"}, {uid:710270, first_name:"Николай", last_name:"Попов", photo_medium:"http://cs18.vkontakte.ru/u710270/b_bd91037.jpg", sex:"2"}, {uid:734921, first_name:"Игорь", last_name:"Атрощенко", photo_medium:"http://cs673.vkontakte.ru/u734921/b_81fc6138.jpg", sex:"2"}, {uid:747770, first_name:"Павел", last_name:"Алешкевич", photo_medium:"http://cs37.vkontakte.ru/u747770/b_e7696b8.jpg", sex:"2"}, {uid:775659, first_name:"Анатолий", last_name:"Ковальчук", photo_medium:"http://cs91.vkontakte.ru/u775659/b_5abcf7cc.jpg", sex:"2"}, {uid:823226, first_name:"Никита", last_name:"Фирсин", photo_medium:"http://cs13.vkontakte.ru/u823226/b_532dc804.jpg", sex:"2"}, {uid:823799, first_name:"Анастасия", last_name:"Фирсина", photo_medium:"http://cs9467.vkontakte.ru/u823799/b_b01a0f50.jpg", sex:"1"}, {uid:858649, first_name:"Алексей", last_name:"Белоусов", photo_medium:"http://cs9545.vkontakte.ru/u858649/b_b22133cc.jpg", sex:"2"}, {uid:878502, first_name:"sergey", last_name:"apatenkov", photo_medium:"http://cs20.vkontakte.ru/u878502/b_29b5cbd.jpg", sex:"2"}, {uid:892700, first_name:"Алексей", last_name:"Захаров", photo_medium:"http://cs20.vkontakte.ru/u892700/b_a65b68e.jpg", sex:"2"}, {uid:893914, first_name:"Ольга", last_name:"Павлушко", photo_medium:"http://cs19.vkontakte.ru/u893914/b_f3415bc.jpg", sex:"1"}, {uid:904002, first_name:"Михаил", last_name:"Таратин", photo_medium:"http://cs774.vkontakte.ru/u904002/b_5a509636.jpg", sex:"2"}, {uid:922334, first_name:"Alexander", last_name:"Smirnoff", photo_medium:"http://cs20.vkontakte.ru/u922334/b_a3bc0f9.jpg", sex:"2"}, {uid:923089, first_name:"Лошадь", last_name:"Бри", photo_medium:"http://cs1690.vkontakte.ru/u923089/b_68cd9bf7.jpg", sex:"2"}, {uid:936529, first_name:"Сергей", last_name:"Марков", photo_medium:"http://cs250.vkontakte.ru/u936529/b_ee27a5d7.jpg", sex:"2"}, {uid:952691, first_name:"Александр", last_name:"Федотьев", photo_medium:"http://cs10063.vkontakte.ru/u952691/b_013c31e3.jpg", sex:"2"}, {uid:967042, first_name:"Тимур", last_name:"Тарасов", photo_medium:"http://cs4983.vkontakte.ru/u967042/b_b450900a.jpg", sex:"2"}, {uid:1005589, first_name:"Мария", last_name:"Доменеч", photo_medium:"http://cs409.vkontakte.ru/u1005589/b_021cab6d.jpg", sex:"1"}, {uid:1046013, first_name:"Anastasia", last_name:"Yartseva", photo_medium:"http://cs9879.vkontakte.ru/u1046013/b_d26c8201.jpg", sex:"1"}, {uid:1057998, first_name:"Андрей", last_name:"Винокуров", photo_medium:"http://cs33.vkontakte.ru/u1057998/b_f7ff9ea.jpg", sex:"2"}, {uid:1087771, first_name:"Юлия", last_name:"Горбачева", photo_medium:"http://cs1364.vkontakte.ru/u1087771/b_7d0c7510.jpg", sex:"1"}, {uid:1100526, first_name:"Ольга", last_name:"Майборода", photo_medium:"http://cs229.vkontakte.ru/u1100526/b_b672d9a2.jpg", sex:"1"}, {uid:1114800, first_name:"Александр", last_name:"Драгунов", photo_medium:"http://cs4111.vkontakte.ru/u1114800/b_447fe2f8.jpg", sex:"2"}, {uid:1169403, first_name:"Сергей", last_name:"Конопатов", photo_medium:"http://cs29.vkontakte.ru/u1169403/b_43323cf.jpg", sex:"2"}, {uid:1304603, first_name:"Владимир", last_name:"Домбровский", photo_medium:"http://cs4548.vkontakte.ru/u1304603/b_bf2e7dc8.jpg", sex:"2"}, {uid:1377964, first_name:"Елена", last_name:"Берковская", photo_medium:"http://cs9559.vkontakte.ru/u1377964/b_4ff26959.jpg", sex:"1"}, {uid:1401082, first_name:"Дина", last_name:"Медведь", photo_medium:"http://cs10155.vkontakte.ru/u1401082/b_909c0eb2.jpg", sex:"1"}, {uid:1407551, first_name:"Егор", last_name:"Цинько", photo_medium:"http://cs35.vkontakte.ru/u1407551/b_57e4de7.jpg", sex:"2"}, {uid:1412292, first_name:"Татьяна", last_name:"Богданова", photo_medium:"http://cs4737.vkontakte.ru/u1412292/b_422a3c60.jpg", sex:"1"}, {uid:1516525, first_name:"Andrew", last_name:"Fomin", photo_medium:"http://cs4515.vkontakte.ru/u1516525/b_fb9b53bb.jpg", sex:"2"}, {uid:1838738, first_name:"Дарья", last_name:"Богачева", photo_medium:"http://cs55.vkontakte.ru/u1838738/b_4575038.jpg", sex:"1"}, {uid:1856843, first_name:"Олег", last_name:"Сысоев", photo_medium:"http://cs10240.vkontakte.ru/u1856843/b_2f765ac0.jpg", sex:"2"}, {uid:1882310, first_name:"Анастасия", last_name:"Лубнина", photo_medium:"http://cs634.vkontakte.ru/u1882310/b_5ab4c88d.jpg", sex:"1"}, {uid:1989837, first_name:"Евгений", last_name:"Фофанов", photo_medium:"http://cs34.vkontakte.ru/u1989837/b_2b09e0c.jpg", sex:"2"}, {uid:2083890, first_name:"Анюта", last_name:"Боброва", photo_medium:"http://cs862.vkontakte.ru/u2083890/b_f109391d.jpg", sex:"1"}, {uid:2116288, first_name:"Наталья", last_name:"Алексеева", photo_medium:"http://cs10162.vkontakte.ru/u2116288/b_1d8a8923.jpg", sex:"1"}, {uid:2132710, first_name:"Алена", last_name:"Батеева", photo_medium:"http://cs4565.vkontakte.ru/u2132710/b_54197400.jpg", sex:"1"}, {uid:2176694, first_name:"Наталия", last_name:"Лубнина", photo_medium:"http://cs9278.vkontakte.ru/u2176694/b_d3a68bf1.jpg", sex:"1"}, {uid:2188720, first_name:"Дмитрий", last_name:"Адов", photo_medium:"http://cs89.vkontakte.ru/u2188720/b_2025cbfe.jpg", sex:"2"}, {uid:2267901, first_name:"Ярослав", last_name:"Рихтхоффен", photo_medium:"http://cs4337.vkontakte.ru/u2267901/b_8c087558.jpg", sex:"2"}, {uid:3213171, first_name:"Владимир", last_name:"Иванов", photo_medium:"http://cs1026.vkontakte.ru/u3213171/b_2bc9b2fe.jpg", sex:"2"}, {uid:3461253, first_name:"Андрей", last_name:"Стрижкин", photo_medium:"http://cs58.vkontakte.ru/u3461253/b_0c0754e7.jpg", sex:"2"}, {uid:3710274, first_name:"Саша", last_name:"Лубнина", photo_medium:"http://cs9815.vkontakte.ru/u3710274/b_5865f7f5.jpg", sex:"1"}, {uid:3856679, first_name:"Елена", last_name:"Лебедева", photo_medium:"http://cs9784.vkontakte.ru/u3856679/b_8ccc5721.jpg", sex:"1"}, {uid:4537264, first_name:"Алексей", last_name:"Михайлов", photo_medium:"http://cs74.vkontakte.ru/u4537264/b_c42a77aa.jpg", sex:"2"}, {uid:4949134, first_name:"Николай", last_name:"Сокорнов", photo_medium:"http://cs85.vkontakte.ru/u4949134/b_995b53b5.jpg", sex:"2"}, {uid:10540437, first_name:"Вова", last_name:"лубнин", photo_medium:"http://cs4486.vkontakte.ru/u10540437/b_0315b51b.jpg", sex:"2"}, {uid:17587638, first_name:"Aндрeй", last_name:"Бaтюк", photo_medium:"http://cs274.vkontakte.ru/u17587638/b_817d55ab.jpg", sex:"2"}, {uid:18333669, first_name:"Игорь", last_name:"Горохов", photo_medium:"http://cs9832.vkontakte.ru/u18333669/b_333ed975.jpg", sex:"2"}, {uid:20419425, first_name:"Anton", last_name:"Denisov", photo_medium:"http://cs4748.vkontakte.ru/u20419425/b_336cf04f.jpg", sex:"0"}, {uid:21444411, first_name:"Ярослава", last_name:"Кришталь", photo_medium:"http://cs9618.vkontakte.ru/u21444411/b_54dce65f.jpg", sex:"1"}, {uid:40908361, first_name:"Евгений", last_name:"Аршанский", photo_medium:"http://cs4233.vkontakte.ru/u40908361/b_29827589.jpg", sex:"2"}, {uid:54487576, first_name:"Всеволод", last_name:"Леонов", photo_medium:"http://cs10392.vkontakte.ru/u54487576/b_cb1b7064.jpg", sex:"2"}, {uid:71573009, first_name:"Турбостул", last_name:"Онлайн", photo_medium:"http://cs4331.vkontakte.ru/u71573009/b_479fb0ea.jpg", sex:"2"}, {uid:73076748, first_name:"Misha", last_name:"Malkin", photo_medium:"http://vkontakte.ru/images/question_b.gif", sex:"2"}, {uid:80496522, first_name:"Даниил", last_name:"Егоров", photo_medium:"http://cs9424.vkontakte.ru/u80496522/b_e649c1b9.jpg", sex:"2"}]}; public function Test(){ super(); } } }//package common
Section 89
//Utils (common.Utils) package common { import flash.events.*; import flash.display.*; import flash.text.*; import flash.geom.*; import flash.utils.*; public class Utils { private static var _serverTimeDelta:Number = 0; public function Utils(){ super(); } public static function bringToTop(clip:DisplayObject):void{ if (clip.parent){ clip.parent.setChildIndex(clip, (clip.parent.numChildren - 1)); }; } public static function disableMouseForAllTextFields(obj:DisplayObjectContainer):void{ var obj = obj; doForAllChildrenRecursive(obj, function (child):void{ if ((child is TextField)){ child.mouseEnabled = false; }; }); } public static function getRandomElement(arr:Array):String{ return (arr[int((Math.random() * arr.length))]); } public static function dumpArray(arr:Array, caption:String=null):void{ var obj:Object; if (caption){ trace(caption); }; for each (obj in arr) { trace(obj); }; } public static function copyDynamicProps(dest:Object, source:Object, recursive:Boolean=false, ignore:String=null):void{ var propName:String; for (propName in source) { if (((((!(((ignore) && ((ignore == propName))))) && ((getClassName(source[propName]) == "Object")))) && (recursive))){ dest[propName] = {}; copyDynamicProps(dest[propName], source[propName]); } else { dest[propName] = source[propName]; }; }; } public static function get nowSeconds():Number{ return (((new Date().time / 1000) - _serverTimeDelta)); } public static function stringFormat(str:String, ... _args):String{ var i:int; while (i < _args.length) { str = str.replace(new RegExp((("\\{" + i) + "\\}"), "g"), _args[i]); i++; }; return (str); } public static function repeatString(str:String, n:int):String{ var s:String = ""; var i:int; while (i < n) { s = (s + str); i++; }; return (s); } public static function dumpDisplayObject(obj:Object, msg:String):void{ var name:String = (("name" in obj)) ? obj["name"] : ""; trace(((((msg + " ") + obj) + " ") + name)); } public static function get nowMiliseconds():Number{ return ((new Date().time - (_serverTimeDelta * 1000))); } public static function dumpChildren(obj:DisplayObjectContainer, depth:int=0):void{ var child:Object; var name:String; var i:int; while (i < obj.numChildren) { child = obj.getChildAt(i); name = (("name" in child)) ? child["name"] : ""; trace(((((repeatString("-", depth) + " ") + child) + " ") + name)); if ((child is DisplayObjectContainer)){ dumpChildren((child as DisplayObjectContainer), (depth + 1)); }; i++; }; } public static function addEventListener(dispatcher:EventDispatcher, targets:Array, exceptions:Array, type:String, handler:Function):void{ var f:*; var dispatcher = dispatcher; var targets = targets; var exceptions = exceptions; var type = type; var handler = handler; var _local7 = function (e:Event):void{ if ((((targets == null)) || ((targets.indexOf(e.target) > -1)))){ if ((((exceptions == null)) || ((exceptions.indexOf(e.target) == -1)))){ dispatcher.removeEventListener(type, f); handler(e); }; }; }; f = _local7; dispatcher.addEventListener(type, _local7); } public static function useServerTime(seconds:Number):void{ _serverTimeDelta = (Utils.nowSeconds - seconds); } public static function dumpObject(obj:Object, caption:String="", recursive:Boolean=true):void{ trace((caption + getObjectAsString(obj, recursive))); } public static function removeAllChildren(obj:DisplayObjectContainer, except:DisplayObject=null):void{ var count:int = obj.numChildren; var i:int = (count - 1); while (i >= 0) { if (((!(except)) || (!((obj.getChildAt(i) == except))))){ obj.removeChildAt(i); }; i--; }; } public static function convertPoint(from:DisplayObject, to:DisplayObject, p:Point, trunc:Boolean=false):Point{ var p2:Point = to.globalToLocal(from.localToGlobal(p)); if (trunc){ p2.x = int(p2.x); p2.y = int(p2.y); }; return (p2); } public static function shuffleArray(array:Array, iterations:int=0):void{ var index1:int; var index2:int; var temp:*; if (iterations < 1){ iterations = array.length; }; var i:int; while (i < iterations) { index1 = (Math.random() * array.length); index2 = (Math.random() * array.length); temp = array[index1]; array[index1] = array[index2]; array[index2] = temp; i++; }; } public static function removeChildSafe(obj:DisplayObject):void{ var obj = obj; obj.parent.removeChild(obj); //unresolved jump var _slot1 = e; } public static function get nowSecondsInt():Number{ return (Math.floor(((new Date().time / 1000) - _serverTimeDelta))); } public static function convertArrayToObject(array:Array, keyName:String, valueName:String, obj=null):Object{ var item:Object; if (!obj){ obj = {}; }; for each (item in array) { if (valueName){ obj[item[keyName]] = item[valueName]; } else { obj[item[keyName]] = item; }; }; return (obj); } public static function addChildSafe(obj:DisplayObject, parent:DisplayObjectContainer):void{ var obj = obj; var parent = parent; parent.addChild(obj); //unresolved jump var _slot1 = e; } public static function convertObjectToArray(object:Object, enumValues:Boolean=true):Array{ var o:Object; var key:String; var array:Array = []; if (enumValues){ for each (o in object) { array.push(o); }; } else { for (key in object) { array.push(object[key]); }; }; return (array); } public static function getClassName(obj:Object):String{ var name:String = getQualifiedClassName(obj); var index:int = name.indexOf("::"); if (index != -1){ name = name.substr((index + 2)); }; return (name); } public static function subtractArrays(fromArray:Array, array:Array):Array{ var elem:*; var index:int; var result:Array = []; var length:uint = fromArray.length; var i:int; while (i < length) { elem = fromArray[i]; index = array.indexOf(elem); if (index == -1){ result.push(elem); }; i++; }; return (result); } public static function stopAmimationRecursive(obj:DisplayObjectContainer):void{ var obj = obj; if ((obj is MovieClip)){ MovieClip(obj).gotoAndStop(1); }; doForAllChildrenRecursive(obj, function (child):void{ if ((child is MovieClip)){ child.gotoAndStop(1); }; }); } public static function doForAllChildrenRecursive(obj:DisplayObjectContainer, func:Function):void{ var child:Object; var result:*; var i:int; while (i < obj.numChildren) { child = obj.getChildAt(i); if (child != null){ result = func(child); if (result == true){ break; }; if ((child is DisplayObjectContainer)){ doForAllChildrenRecursive(DisplayObjectContainer(child), func); }; }; i++; }; } public static function getFirstElement(anyArray){ var e:*; for each (e in anyArray) { return (e); }; return (null); } public static function disableMouseForAllChildren(obj:DisplayObjectContainer):void{ var obj = obj; doForAllChildrenRecursive(obj, function (child):void{ if ((child is InteractiveObject)){ child.mouseEnabled = false; }; }); } public static function dumpFonts():void{ var f:*; for each (f in Font.enumerateFonts(false)) { trace(((f + " ") + f.fontName)); }; } public static function getObjectAsString(obj:Object, recursive:Boolean):String{ var i:int; var propName:String; var value:*; if ((((obj is String)) || ((obj is Number)))){ return (obj.toString()); }; if (obj == null){ return ("null"); }; var str:String = ""; var varList:XMLList = describeType(obj)..variable; while (i < varList.length()) { propName = varList[i].@name; if (str.length > 0){ str = (str + ", "); }; value = obj[propName]; if (((recursive) && ((getClassName(value) == "Object")))){ value = getObjectAsString(obj[propName], recursive); }; str = (str + ((propName + ": ") + value)); i++; }; return ((("{" + str) + "}")); } public static function copyProps(dest:Object, source:Object, recursive:Boolean=false):void{ var i:int; var propName:String; var varList:XMLList = describeType(source)..variable; while (i < varList.length()) { propName = varList[i].@name; if ((((getClassName(source[propName]) == "Object")) && (recursive))){ dest[propName] = {}; copyDynamicProps(dest[propName], source[propName]); } else { dest[propName] = source[propName]; }; i++; }; } public static function addNonContainingElementsToArray(array:Array, elements:Array):void{ var target:*; for each (target in elements) { if (array.indexOf(target) == -1){ array.push(target); }; }; } public static function roll(probability:Number):Boolean{ var rnd:Number = Math.random(); return ((rnd <= probability)); } public static function isToday(time:Number):Boolean{ return ((int((time / (3600 * 24))) == int((nowSeconds / (3600 * 24))))); } } }//package common
Section 90
//Element (model.Element) package model { public class Element { public var id:String; public var isNew:Boolean;// = false public var isUnread:Boolean;// = true public var image:String; public var group:String; public function Element(){ super(); } } }//package model
Section 91
//Group (model.Group) package model { public class Group { public var image:String; private var _color:String; private var _colorInt:uint; public var id:String; public function Group(){ super(); } public function get color():String{ return (_color); } public function set color(value:String):void{ _color = value; if (value.indexOf("0x") == 0){ value = value.substring(2); }; _colorInt = parseInt(value, 16); } public function get colorInt():uint{ return (_colorInt); } } }//package model
Section 92
//Model (model.Model) package model { import common.*; import com.adobe.utils.*; import flash.net.*; public class Model { public var initialElementIds:Array; public var introShown:Boolean;// = false private var _ElementsCSVFileClass:Class; public var score:Number;// = 0 public var currentElementStartTimeSeconds:Number; private var _GroupsCSVFileClass:Class; public var finalScreenShown:Boolean; private var _QuotesCSVFileClass:Class; public var soundOn:Boolean;// = true public var groupCount:int; public var groups:Object; public var reactionLog:Array; public var unlockedElementIds:Array; private var _ReactionsCSVFileClass:Class; public var reactions:Array; public var elementCount:int; public var elements:Object; public var quotes:Array; public static const MAX_REACTION_LOG:int = 100; public static var inst:Model; public function Model(){ var quote:Quote; _ElementsCSVFileClass = Model__ElementsCSVFileClass; _GroupsCSVFileClass = Model__GroupsCSVFileClass; _ReactionsCSVFileClass = Model__ReactionsCSVFileClass; _QuotesCSVFileClass = Model__QuotesCSVFileClass; reactionLog = []; quotes = []; initialElementIds = ["Fire", "Water", "Earth", "Air"]; unlockedElementIds = []; super(); var elementsArray:Array = CSV.parse(new _ElementsCSVFileClass().toString(), Element); elementCount = elementsArray.length; elements = Utils.convertArrayToObject(elementsArray, "id", null, null); var groupArray:Array = CSV.parse(new _GroupsCSVFileClass().toString(), Group); groups = Utils.convertArrayToObject(groupArray, "id", null, null); groupCount = groupArray.length; reactions = CSV.parse(new _ReactionsCSVFileClass().toString(), Reaction); quotes = CSV.parse(new _QuotesCSVFileClass().toString(), Quote); for each (quote in quotes) { quote.text = repairQuoteText(quote.text); }; } public function tryReaction(element1:Element, element2:Element, log:Boolean=true):Reaction{ var reaction:Reaction; var result:Array; var newElements:Array; var elem:Element; var newReaction:Object; for each (reaction in reactions) { if ((((((reaction.element1 == element1.id)) && ((reaction.element2 == element2.id)))) || ((((reaction.element1 == element2.id)) && ((reaction.element2 == element1.id)))))){ result = reaction.getResult(); newElements = unlockElements(result); for each (elem in newElements) { elem.isNew = true; }; if (log){ newReaction = {reaction:reaction, isUnread:true}; if ((((reactionLog.length == 0)) || ((((reactionLog.length > 0)) && (!(reactionLog[(reactionLog.length - 1)].reaction.equals(newReaction.reaction))))))){ reactionLog.push(newReaction); if (reactionLog.length > MAX_REACTION_LOG){ reactionLog.splice(0, 1); }; }; }; return (reaction); }; }; return (null); } public function getUnlockedGroups():Array{ var elemId:String; var arr:Array; var elem:Element; var unlockedGroups:Object = {}; for each (elemId in unlockedElementIds) { elem = elements[elemId]; if (!unlockedGroups[elem.group]){ unlockedGroups[elem.group] = groups[elem.group]; }; }; arr = Utils.convertObjectToArray(unlockedGroups, false); arr.sortOn(["id"]); return (arr); } public function saveGame():void{ var save:SharedObject = SharedObject.getLocal("save"); if (save != null){ save.data["unlockedElementIds"] = unlockedElementIds; save.data["score"] = score; save.data["soundOn"] = soundOn; save.data["introShown"] = introShown; save.data["finalScreenShown"] = finalScreenShown; }; } public function get cooldownSeconds():int{ var unlockedCount:int = unlockedElementIds.length; if (unlockedCount <= 10){ return (30); }; if (unlockedCount <= 20){ return (60); }; if (unlockedCount <= 60){ return (180); }; return (240); } public function markAsRead(groupId:String):void{ var elem:Element; for each (elem in getUnlockedElements(groupId)) { elem.isUnread = false; }; } private function repairQuoteText(text:String):String{ var slashN:RegExp = /\\n/g; text = text.replace(slashN, "\n"); return (text); } public function getRandomQuote(elementId:String):Quote{ var quote:Quote; var index:int; var elementQuotes:Array = []; for each (quote in quotes) { if (quote.element == elementId){ elementQuotes.push(quote); }; }; if (elementQuotes.length == 0){ return (null); }; index = int((Math.random() * elementQuotes.length)); return (elementQuotes[index]); } public function getUnreadReactionsCount():int{ var reaction:Object; var count:int; for each (reaction in reactionLog) { if (reaction.isUnread){ count++; }; }; return (count); } public function getUnreadElements(groupId:String):int{ var elem:Element; var unreadCount:int; for each (elem in getUnlockedElements(groupId)) { if (elem.isUnread){ unreadCount++; }; }; return (unreadCount); } public function tryLoadGame():void{ var elemId:String; var save:SharedObject = SharedObject.getLocal("save"); if (save.data["unlockedElementIds"] == null){ resetGame(); } else { unlockedElementIds = save.data["unlockedElementIds"]; score = save.data["score"]; for each (elemId in unlockedElementIds) { elements[elemId].isUnread = false; }; soundOn = save.data["soundOn"]; introShown = save.data["introShown"]; finalScreenShown = save.data["finalScreenShown"]; }; } public function markReactionLogAsRead():void{ var reactionObj:Object; for each (reactionObj in reactionLog) { reactionObj.isUnread = false; }; } private function unlockElements(elementsToUnlock:Array):Array{ var element:Element; var newElements:Array = []; for each (element in elementsToUnlock) { if (unlockedElementIds.indexOf(element.id) == -1){ unlockedElementIds.push(element.id); newElements.push(element); }; }; return (newElements); } private function getAllElementIds():Array{ var elemId:String; var arr:Array = []; for (elemId in elements) { arr.push(elemId); }; return (arr); } public function resetGame():void{ var elem:Element; var elemId:String; unlockedElementIds = ArrayUtil.copyArray(initialElementIds); for each (elem in elements) { elem.isNew = false; elem.isUnread = true; }; for each (elemId in unlockedElementIds) { trace(("elemId =" + elemId)); elements[elemId].isUnread = false; }; reactionLog = []; currentElementStartTimeSeconds = Utils.nowSeconds; score = 0; introShown = false; finalScreenShown = false; saveGame(); } public function getUnlockedElements(groupId:String):Array{ var elemId:String; var element:Element; var groupElements:Array = []; for each (elemId in unlockedElementIds) { element = elements[elemId]; if (element.group == groupId){ groupElements.push(element); }; }; return (groupElements); } public function addScore(newElements:int, newGroups:int):void{ score = (score + (newElements * 20)); score = (score + (newGroups * 300)); var deltaTime:Number = (Utils.nowSeconds - currentElementStartTimeSeconds); if (deltaTime < 60){ score = (score + 20); }; currentElementStartTimeSeconds = Utils.nowSeconds; } public function isElementUnlocked(elemId:String):Boolean{ return ((unlockedElementIds.indexOf(elemId) > -1)); } public function getHint():Reaction{ var reaction:Reaction; var index:int; var result1:Boolean; var result2:Boolean; var result3:Boolean; var element1:Boolean; var element2:Boolean; var unusedReactions:Array = []; for each (reaction in reactions) { result1 = (unlockedElementIds.indexOf(reaction.result1) == -1); result2 = ((!((reaction.result2 == ""))) && ((unlockedElementIds.indexOf(reaction.result2) == -1))); result3 = ((!((reaction.result3 == ""))) && ((unlockedElementIds.indexOf(reaction.result3) == -1))); element1 = (unlockedElementIds.indexOf(reaction.element1) > -1); element2 = (unlockedElementIds.indexOf(reaction.element2) > -1); if (((((((result1) || (result2))) || (result3))) && (((element1) && (element2))))){ unusedReactions.push(reaction); }; }; Utils.shuffleArray(unusedReactions); index = int((Math.random() * unusedReactions.length)); reaction = unusedReactions[index]; return (reaction); } } }//package model
Section 93
//Model__ElementsCSVFileClass (model.Model__ElementsCSVFileClass) package model { import mx.core.*; public class Model__ElementsCSVFileClass extends ByteArrayAsset { } }//package model
Section 94
//Model__GroupsCSVFileClass (model.Model__GroupsCSVFileClass) package model { import mx.core.*; public class Model__GroupsCSVFileClass extends ByteArrayAsset { } }//package model
Section 95
//Model__QuotesCSVFileClass (model.Model__QuotesCSVFileClass) package model { import mx.core.*; public class Model__QuotesCSVFileClass extends ByteArrayAsset { } }//package model
Section 96
//Model__ReactionsCSVFileClass (model.Model__ReactionsCSVFileClass) package model { import mx.core.*; public class Model__ReactionsCSVFileClass extends ByteArrayAsset { } }//package model
Section 97
//Quote (model.Quote) package model { public class Quote { public var author:String; public var element:String; public var text:String; public function Quote(){ super(); } } }//package model
Section 98
//Reaction (model.Reaction) package model { import common.*; import screens.*; public class Reaction { private const _templates:Array; public var result1:String; public var element1:String; public var element2:String; public var result2:String; public var result3:String; public var skip:String; public function Reaction(){ _templates = ["I found out how to make {3} by combining {1} with {2}!", "I was trying very hard to invent {3} until finally combined {1} and {2}.", "I want to share a secret recipe of {3} with you! It's {1} combined with {2}, but don't tell anyone ;)", "Still wondering how to make {3}? I have found out that it is {1} combined with {2}.", "I combined {1} with {2} just for fun, and was very surprised to get {3}."]; super(); } public function getResult():Array{ var result:Array = [Model.inst.elements[result1]]; if (((result2) && (!((result2 == ""))))){ result.push(Model.inst.elements[result2]); }; if (((result3) && (!((result3 == ""))))){ result.push(Model.inst.elements[result3]); }; return (result); } public function getReactionText():String{ var str:String = ((((Main.loc(element1) + " %252b ") + Main.loc(element2)) + " = ") + Main.loc(result1)); if (((result2) && (!((result2 == ""))))){ str = (str + (" %252b " + Main.loc(result2))); }; if (((result3) && (!((result3 == ""))))){ str = (str + (" %252b " + Main.loc(result3))); }; str = (str + "!"); return (str); } public function equals(other:Reaction):Boolean{ return ((((other.element1 == this.element1)) && ((other.element2 == this.element2)))); } public function getFacebookText():String{ var message:String = Utils.getRandomElement(_templates); return (Utils.stringFormat(message, null, Main.loc(element1), Main.loc(element2), Main.loc(result1))); } public function toString():String{ return ((((((((((("Reaction{element1=" + String(element1)) + ",element2=") + String(element2)) + ",result1=") + String(result1)) + ",result2=") + String(result2)) + ",result3=") + String(result3)) + "}")); } } }//package model
Section 99
//BitmapAsset (mx.core.BitmapAsset) package mx.core { import flash.display.*; public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject { mx_internal static const VERSION:String = "3.4.0.9271"; public function BitmapAsset(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){ super(bitmapData, pixelSnapping, smoothing); } public function get measuredWidth():Number{ if (bitmapData){ return (bitmapData.width); }; return (0); } public function get measuredHeight():Number{ if (bitmapData){ return (bitmapData.height); }; return (0); } public function setActualSize(newWidth:Number, newHeight:Number):void{ width = newWidth; height = newHeight; } public function move(x:Number, y:Number):void{ this.x = x; this.y = y; } } }//package mx.core
Section 100
//ButtonAsset (mx.core.ButtonAsset) package mx.core { public class ButtonAsset extends FlexSimpleButton implements IFlexAsset, IFlexDisplayObject { private var _measuredHeight:Number; private var _measuredWidth:Number; mx_internal static const VERSION:String = "3.4.0.9271"; public function ButtonAsset(){ super(); _measuredWidth = width; _measuredHeight = height; } public function get measuredWidth():Number{ return (_measuredWidth); } public function get measuredHeight():Number{ return (_measuredHeight); } public function setActualSize(newWidth:Number, newHeight:Number):void{ width = newWidth; height = newHeight; } public function move(x:Number, y:Number):void{ this.x = x; this.y = y; } } }//package mx.core
Section 101
//ByteArrayAsset (mx.core.ByteArrayAsset) package mx.core { import flash.utils.*; public class ByteArrayAsset extends ByteArray implements IFlexAsset { mx_internal static const VERSION:String = "3.4.0.9271"; public function ByteArrayAsset(){ super(); } } }//package mx.core
Section 102
//EdgeMetrics (mx.core.EdgeMetrics) package mx.core { public class EdgeMetrics { public var top:Number; public var left:Number; public var bottom:Number; public var right:Number; mx_internal static const VERSION:String = "3.4.0.9271"; public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0); ; public function EdgeMetrics(left:Number=0, top:Number=0, right:Number=0, bottom:Number=0){ super(); this.left = left; this.top = top; this.right = right; this.bottom = bottom; } public function clone():EdgeMetrics{ return (new EdgeMetrics(left, top, right, bottom)); } } }//package mx.core
Section 103
//FlexBitmap (mx.core.FlexBitmap) package mx.core { import flash.display.*; import mx.utils.*; public class FlexBitmap extends Bitmap { mx_internal static const VERSION:String = "3.4.0.9271"; public function FlexBitmap(bitmapData:BitmapData=null, pixelSnapping:String="auto", smoothing:Boolean=false){ var bitmapData = bitmapData; var pixelSnapping = pixelSnapping; var smoothing = smoothing; super(bitmapData, pixelSnapping, smoothing); name = NameUtil.createUniqueName(this); //unresolved jump var _slot1 = e; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 104
//FlexSimpleButton (mx.core.FlexSimpleButton) package mx.core { import flash.display.*; import mx.utils.*; public class FlexSimpleButton extends SimpleButton { mx_internal static const VERSION:String = "3.4.0.9271"; public function FlexSimpleButton(){ super(); name = NameUtil.createUniqueName(this); //unresolved jump var _slot1 = e; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 105
//FlexSprite (mx.core.FlexSprite) package mx.core { import flash.display.*; import mx.utils.*; public class FlexSprite extends Sprite { mx_internal static const VERSION:String = "3.4.0.9271"; public function FlexSprite(){ super(); name = NameUtil.createUniqueName(this); //unresolved jump var _slot1 = e; } override public function toString():String{ return (NameUtil.displayObjectToString(this)); } } }//package mx.core
Section 106
//IBorder (mx.core.IBorder) package mx.core { public interface IBorder { function get borderMetrics():EdgeMetrics; } }//package mx.core
Section 107
//IFlexAsset (mx.core.IFlexAsset) package mx.core { public interface IFlexAsset { } }//package mx.core
Section 108
//IFlexDisplayObject (mx.core.IFlexDisplayObject) package mx.core { import flash.events.*; import flash.display.*; import flash.geom.*; import flash.accessibility.*; public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher { function get visible():Boolean; function get rotation():Number; function localToGlobal(void:Point):Point; function get name():String; function set width(flash.display:Number):void; function get measuredHeight():Number; function get blendMode():String; function get scale9Grid():Rectangle; function set name(flash.display:String):void; function set scaleX(flash.display:Number):void; function set scaleY(flash.display:Number):void; function get measuredWidth():Number; function get accessibilityProperties():AccessibilityProperties; function set scrollRect(flash.display:Rectangle):void; function get cacheAsBitmap():Boolean; function globalToLocal(void:Point):Point; function get height():Number; function set blendMode(flash.display:String):void; function get parent():DisplayObjectContainer; function getBounds(String:DisplayObject):Rectangle; function get opaqueBackground():Object; function set scale9Grid(flash.display:Rectangle):void; function setActualSize(_arg1:Number, _arg2:Number):void; function set alpha(flash.display:Number):void; function set accessibilityProperties(flash.display:AccessibilityProperties):void; function get width():Number; function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean; function set cacheAsBitmap(flash.display:Boolean):void; function get scaleX():Number; function get scaleY():Number; function get scrollRect():Rectangle; function get mouseX():Number; function get mouseY():Number; function set height(flash.display:Number):void; function set mask(flash.display:DisplayObject):void; function getRect(String:DisplayObject):Rectangle; function get alpha():Number; function set transform(flash.display:Transform):void; function move(_arg1:Number, _arg2:Number):void; function get loaderInfo():LoaderInfo; function get root():DisplayObject; function hitTestObject(mx.core:IFlexDisplayObject/mx.core:IFlexDisplayObject:stage/get:DisplayObject):Boolean; function set opaqueBackground(flash.display:Object):void; function set visible(flash.display:Boolean):void; function get mask():DisplayObject; function set x(flash.display:Number):void; function set y(flash.display:Number):void; function get transform():Transform; function set filters(flash.display:Array):void; function get x():Number; function get y():Number; function get filters():Array; function set rotation(flash.display:Number):void; function get stage():Stage; } }//package mx.core
Section 109
//IRepeaterClient (mx.core.IRepeaterClient) package mx.core { public interface IRepeaterClient { function get instanceIndices():Array; function set instanceIndices(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get isDocument():Boolean; function set repeaters(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function initializeRepeaterArrays(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:IRepeaterClient):void; function get repeaters():Array; function set repeaterIndices(C:\autobuild\galaga\frameworks\projects\framework\src;mx\core;IRepeaterClient.as:Array):void; function get repeaterIndices():Array; } }//package mx.core
Section 110
//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 111
//SoundAsset (mx.core.SoundAsset) package mx.core { import flash.media.*; public class SoundAsset extends Sound implements IFlexAsset { mx_internal static const VERSION:String = "3.4.0.9271"; public function SoundAsset(){ super(); } } }//package mx.core
Section 112
//SpriteAsset (mx.core.SpriteAsset) package mx.core { public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder { private var _measuredHeight:Number; private var _measuredWidth:Number; mx_internal static const VERSION:String = "3.4.0.9271"; public function SpriteAsset(){ super(); _measuredWidth = width; _measuredHeight = height; } public function get measuredWidth():Number{ return (_measuredWidth); } public function get measuredHeight():Number{ return (_measuredHeight); } public function setActualSize(newWidth:Number, newHeight:Number):void{ width = newWidth; height = newHeight; } public function move(x:Number, y:Number):void{ this.x = x; this.y = y; } public function get borderMetrics():EdgeMetrics{ if (scale9Grid == null){ return (EdgeMetrics.EMPTY); }; return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom)))); } } }//package mx.core
Section 113
//LoaderConfig (mx.messaging.config.LoaderConfig) package mx.messaging.config { import mx.core.*; public class LoaderConfig { mx_internal static const VERSION:String = "3.4.0.9271"; mx_internal static var _parameters:Object; mx_internal static var _swfVersion:uint; mx_internal static var _url:String = null; public function LoaderConfig(){ super(); } public static function get parameters():Object{ return (_parameters); } public static function get url():String{ return (_url); } public static function get swfVersion():uint{ return (_swfVersion); } } }//package mx.messaging.config
Section 114
//NameUtil (mx.utils.NameUtil) package mx.utils { import flash.display.*; import mx.core.*; import flash.utils.*; public class NameUtil { mx_internal static const VERSION:String = "3.4.0.9271"; private static var counter:int = 0; public function NameUtil(){ super(); } public static function displayObjectToString(displayObject:DisplayObject):String{ var result:String; var o:DisplayObject; var s:String; var indices:Array; var displayObject = displayObject; o = displayObject; while (o != null) { if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){ break; }; s = o.name; if ((o is IRepeaterClient)){ indices = IRepeaterClient(o).instanceIndices; if (indices){ s = (s + (("[" + indices.join("][")) + "]")); }; }; result = ((result == null)) ? s : ((s + ".") + result); o = o.parent; }; //unresolved jump var _slot1 = e; return (result); } public static function createUniqueName(object:Object):String{ if (!object){ return (null); }; var name:String = getQualifiedClassName(object); var index:int = name.indexOf("::"); if (index != -1){ name = name.substr((index + 2)); }; var charCode:int = name.charCodeAt((name.length - 1)); if ((((charCode >= 48)) && ((charCode <= 57)))){ name = (name + "_"); }; return ((name + counter++)); } } }//package mx.utils
Section 115
//StringUtil (mx.utils.StringUtil) package mx.utils { import mx.core.*; public class StringUtil { mx_internal static const VERSION:String = "3.4.0.9271"; public function StringUtil(){ super(); } public static function trim(str:String):String{ if (str == null){ return (""); }; var startIndex:int; while (isWhitespace(str.charAt(startIndex))) { startIndex++; }; var endIndex:int = (str.length - 1); while (isWhitespace(str.charAt(endIndex))) { endIndex--; }; if (endIndex >= startIndex){ return (str.slice(startIndex, (endIndex + 1))); }; return (""); } public static function isWhitespace(character:String):Boolean{ switch (character){ case " ": case "\t": case "\r": case "\n": case "\f": return (true); default: return (false); }; } public static function substitute(str:String, ... _args):String{ var args:Array; if (str == null){ return (""); }; var len:uint = _args.length; if ((((len == 1)) && ((_args[0] is Array)))){ args = (_args[0] as Array); len = args.length; } else { args = _args; }; var i:int; while (i < len) { str = str.replace(new RegExp((("\\{" + i) + "\\}"), "g"), args[i]); i++; }; return (str); } public static function trimArrayElements(value:String, delimiter:String):String{ var items:Array; var len:int; var i:int; if (((!((value == ""))) && (!((value == null))))){ items = value.split(delimiter); len = items.length; i = 0; while (i < len) { items[i] = StringUtil.trim(items[i]); i++; }; if (len > 0){ value = items.join(delimiter); }; }; return (value); } } }//package mx.utils
Section 116
//URLUtil (mx.utils.URLUtil) package mx.utils { import mx.messaging.config.*; public class URLUtil { public static const SERVER_NAME_TOKEN:String = "{server.name}"; private static const SERVER_PORT_REGEX:RegExp = new RegExp("\\{server.port\\}", "g"); private static const SERVER_NAME_REGEX:RegExp = new RegExp("\\{server.name\\}", "g"); public static const SERVER_PORT_TOKEN:String = "{server.port}"; public function URLUtil(){ super(); } public static function hasUnresolvableTokens():Boolean{ return (!((LoaderConfig.url == null))); } public static function getServerName(url:String):String{ var sp:String = getServerNameWithPort(url); var delim:int = sp.indexOf("]"); delim = ((delim)>-1) ? sp.indexOf(":", delim) : sp.indexOf(":"); if (delim > 0){ sp = sp.substring(0, delim); }; return (sp); } public static function isHttpsURL(url:String):Boolean{ return (((!((url == null))) && ((url.indexOf("https://") == 0)))); } private static function internalObjectToString(object:Object, separator:String, prefix:String, encodeURL:Boolean):String{ var p:String; var value:Object; var name:String; var s:String = ""; var first:Boolean; for (p in object) { if (first){ first = false; } else { s = (s + separator); }; value = object[p]; name = (prefix) ? ((prefix + ".") + p) : p; if (encodeURL){ name = encodeURIComponent(name); }; if ((value is String)){ s = (s + ((name + "=") + (encodeURL) ? encodeURIComponent((value as String)) : value)); } else { if ((value is Number)){ value = value.toString(); if (encodeURL){ value = encodeURIComponent((value as String)); }; s = (s + ((name + "=") + value)); } else { if ((value is Boolean)){ s = (s + ((name + "=") + (value) ? "true" : "false")); } else { if ((value is Array)){ s = (s + internalArrayToString((value as Array), separator, name, encodeURL)); } else { s = (s + internalObjectToString(value, separator, name, encodeURL)); }; }; }; }; }; return (s); } public static function getFullURL(rootURL:String, url:String):String{ var slashPos:Number; if (((!((url == null))) && (!(URLUtil.isHttpURL(url))))){ if (url.indexOf("./") == 0){ url = url.substring(2); }; if (URLUtil.isHttpURL(rootURL)){ if (url.charAt(0) == "/"){ slashPos = rootURL.indexOf("/", 8); if (slashPos == -1){ slashPos = rootURL.length; }; } else { slashPos = (rootURL.lastIndexOf("/") + 1); if (slashPos <= 8){ rootURL = (rootURL + "/"); slashPos = rootURL.length; }; }; if (slashPos > 0){ url = (rootURL.substring(0, slashPos) + url); }; }; }; return (url); } public static function getServerNameWithPort(url:String):String{ var start:int = (url.indexOf("/") + 2); var length:int = url.indexOf("/", start); return (((length == -1)) ? url.substring(start) : url.substring(start, length)); } public static function replaceProtocol(uri:String, newProtocol:String):String{ return (uri.replace(getProtocol(uri), newProtocol)); } public static function urisEqual(uri1:String, uri2:String):Boolean{ if (((!((uri1 == null))) && (!((uri2 == null))))){ uri1 = StringUtil.trim(uri1).toLowerCase(); uri2 = StringUtil.trim(uri2).toLowerCase(); if (uri1.charAt((uri1.length - 1)) != "/"){ uri1 = (uri1 + "/"); }; if (uri2.charAt((uri2.length - 1)) != "/"){ uri2 = (uri2 + "/"); }; }; return ((uri1 == uri2)); } public static function getProtocol(url:String):String{ var slash:int = url.indexOf("/"); var indx:int = url.indexOf(":/"); if ((((indx > -1)) && ((indx < slash)))){ return (url.substring(0, indx)); }; indx = url.indexOf("::"); if ((((indx > -1)) && ((indx < slash)))){ return (url.substring(0, indx)); }; return (""); } private static function internalArrayToString(array:Array, separator:String, prefix:String, encodeURL:Boolean):String{ var value:Object; var name:String; var s:String = ""; var first:Boolean; var n:int = array.length; var i:int; while (i < n) { if (first){ first = false; } else { s = (s + separator); }; value = array[i]; name = ((prefix + ".") + i); if (encodeURL){ name = encodeURIComponent(name); }; if ((value is String)){ s = (s + ((name + "=") + (encodeURL) ? encodeURIComponent((value as String)) : value)); } else { if ((value is Number)){ value = value.toString(); if (encodeURL){ value = encodeURIComponent((value as String)); }; s = (s + ((name + "=") + value)); } else { if ((value is Boolean)){ s = (s + ((name + "=") + (value) ? "true" : "false")); } else { if ((value is Array)){ s = (s + internalArrayToString((value as Array), separator, name, encodeURL)); } else { s = (s + internalObjectToString(value, separator, name, encodeURL)); }; }; }; }; i++; }; return (s); } public static function objectToString(object:Object, separator:String=";", encodeURL:Boolean=true):String{ var s:String = internalObjectToString(object, separator, null, encodeURL); return (s); } public static function replaceTokens(url:String):String{ var loaderProtocol:String; var loaderServerName:String; var loaderPort:uint; var loaderURL:String = ((LoaderConfig.url == null)) ? "" : LoaderConfig.url; if (url.indexOf(SERVER_NAME_TOKEN) > 0){ loaderProtocol = URLUtil.getProtocol(loaderURL); loaderServerName = "localhost"; if (loaderProtocol.toLowerCase() != "file"){ loaderServerName = URLUtil.getServerName(loaderURL); }; url = url.replace(SERVER_NAME_REGEX, loaderServerName); }; var portToken:int = url.indexOf(SERVER_PORT_TOKEN); if (portToken > 0){ loaderPort = URLUtil.getPort(loaderURL); if (loaderPort > 0){ url = url.replace(SERVER_PORT_REGEX, loaderPort); } else { if (url.charAt((portToken - 1)) == ":"){ url = (url.substring(0, (portToken - 1)) + url.substring(portToken)); }; url = url.replace(SERVER_PORT_REGEX, ""); }; }; return (url); } public static function getPort(url:String):uint{ var p:Number; var sp:String = getServerNameWithPort(url); var delim:int = sp.indexOf("]"); delim = ((delim)>-1) ? sp.indexOf(":", delim) : sp.indexOf(":"); var port:uint; if (delim > 0){ p = Number(sp.substring((delim + 1))); if (!isNaN(p)){ port = int(p); }; }; return (port); } public static function stringToObject(string:String, separator:String=";", decodeURL:Boolean=true):Object{ var pieces:Array; var name:String; var value:Object; var obj:Object; var m:int; var j:int; var temp:Object; var prop:String; var subProp:String; var idx:Object; var o:Object = {}; var arr:Array = string.split(separator); var n:int = arr.length; var i:int; while (i < n) { pieces = arr[i].split("="); name = pieces[0]; if (decodeURL){ name = decodeURIComponent(name); }; value = pieces[1]; if (decodeURL){ value = decodeURIComponent((value as String)); }; if (value == "true"){ value = true; } else { if (value == "false"){ value = false; } else { temp = int(value); if (temp.toString() == value){ value = temp; } else { temp = Number(value); if (temp.toString() == value){ value = temp; }; }; }; }; obj = o; pieces = name.split("."); m = pieces.length; j = 0; while (j < (m - 1)) { prop = pieces[j]; if ((((obj[prop] == null)) && ((j < (m - 1))))){ subProp = pieces[(j + 1)]; idx = int(subProp); if (idx.toString() == subProp){ obj[prop] = []; } else { obj[prop] = {}; }; }; obj = obj[prop]; j++; }; obj[pieces[j]] = value; i++; }; return (o); } public static function replacePort(uri:String, newPort:uint):String{ var portEnd:int; var result:String = ""; var indx:int = uri.indexOf("]"); if (indx == -1){ indx = uri.indexOf(":"); }; var portStart:int = uri.indexOf(":", (indx + 1)); if (portStart > -1){ portStart++; portEnd = uri.indexOf("/", portStart); result = ((uri.substring(0, portStart) + newPort.toString()) + uri.substring(portEnd, uri.length)); } else { portEnd = uri.indexOf("/", indx); if (portEnd > -1){ if (uri.charAt((portEnd + 1)) == "/"){ portEnd = uri.indexOf("/", (portEnd + 2)); }; if (portEnd > 0){ result = (((uri.substring(0, portEnd) + ":") + newPort.toString()) + uri.substring(portEnd, uri.length)); } else { result = ((uri + ":") + newPort.toString()); }; } else { result = ((uri + ":") + newPort.toString()); }; }; return (result); } public static function isHttpURL(url:String):Boolean{ return (((!((url == null))) && ((((url.indexOf("http://") == 0)) || ((url.indexOf("https://") == 0)))))); } } }//package mx.utils
Section 117
//ElementClip (screens.ElementClip) package screens { import common.*; import flash.display.*; import flash.geom.*; import model.*; import assets.*; public dynamic class ElementClip extends LayoutClip { public var element:Element; public var onTween:Function;// = null public function ElementClip(elementId:String, layout:String=null){ super(layout); element = Model.inst.elements[elementId]; var bitmap:Bitmap = Images.getBitmap(element.image); bitmap.x = -(Math.floor((bitmap.width / 2))); bitmap.y = -(Math.floor((bitmap.height / 2))); addChild(bitmap); } public function startDragging(target:DisplayObject, point:Point):Object{ return (null); } override public function get id():String{ return (("element_" + element.id)); } public function canDrop(dragInfo:DragInfo, target:DisplayObject):Boolean{ return (true); } public function finish(dragInfo:DragInfo, cancel:Boolean=false, dropTarget=null):void{ } public function clone():ElementClip{ var newClip:ElementClip = new ElementClip(element.id, layout); newClip.x = this.x; newClip.y = this.y; newClip.scaleX = this.scaleX; newClip.scaleY = this.scaleY; return (newClip); } public function drop(dragInfo:DragInfo, target:DisplayObject):Boolean{ var element:Element = (dragInfo.item as Element); return (((element) && (!((element.id == this.element.id))))); } } }//package screens
Section 118
//GroupClip (screens.GroupClip) package screens { import flash.display.*; import model.*; import assets.*; public dynamic class GroupClip extends LayoutClip { public var group:Group; public function GroupClip(groupId:String, layout:String=null){ super(layout); group = Model.inst.groups[groupId]; var bmp:Bitmap = Images.getBitmap(group.image); addChild(bmp); var n:int = Model.inst.getUnreadElements(group.id); var balloon:* = Images.getBalloon(n); if (balloon){ balloon.scaleX = 1.5; balloon.scaleY = 1.5; addChild(balloon); }; } override public function get id():String{ return (("group_" + group.id)); } } }//package screens
Section 119
//GroupsLayout (screens.GroupsLayout) package screens { import common.*; import flash.display.*; import flash.geom.*; import model.*; import common.platform.*; public class GroupsLayout extends Layout { public var selectedGroupRight:Group;// = null public var selectedGroupLeft:Group;// = null public function GroupsLayout(selectedGroupLeft:Group, selectedGroupRight:Group){ super(); this.selectedGroupLeft = selectedGroupLeft; this.selectedGroupRight = selectedGroupRight; } private function flatten(obj:DisplayObjectContainer, target:DisplayObjectContainer, scale:Number):void{ var child:DisplayObject; var newPoint:Point; var i:int = (obj.numChildren - 1); while (i >= 0) { child = obj.getChildAt(i); if ((child is LayoutClip)){ child.scaleX = (child.scaleX * scale); child.scaleY = (child.scaleY * scale); newPoint = obj.localToGlobal(new Point(child.x, child.y)); child.x = newPoint.x; child.y = newPoint.y; target.addChild(child); } else { if ((child is DisplayObjectContainer)){ flatten(DisplayObjectContainer(child), target, (child.scaleX * scale)); }; }; i--; }; } override public function update(prevLayout:Layout):void{ var elementsLeft:MovieClip; var elementsRight:MovieClip; var rows:int; var groupIndex:int; var i:int; var col:MovieClip; var j:int; var groupClip2:MovieClip; var spaceRect:Rectangle = Platform.wrapper.spaceNormaSize; var unlockedGroups:Array = Model.inst.getUnlockedGroups(); var x:Number = 0; var y:Number = 0; var scale:Number = 0.7; var cols = 1; if (unlockedGroups.length <= 4){ } else { if (unlockedGroups.length <= 10){ scale = 0.6; cols = 2; } else { if (unlockedGroups.length <= 12){ scale = 0.5; cols = 2; } else { scale = 0.42; cols = 2; }; }; }; if ((((selectedGroupLeft == null)) && ((selectedGroupRight == null)))){ if (unlockedGroups.length >= 9){ scale = 0.6; cols = 3; }; }; _objects = []; var all:MovieClip = new MovieClip(); var groups:MovieClip = new MovieClip(); Utils.removeAllChildren(this); if ((((selectedGroupLeft == null)) || ((selectedGroupRight == null)))){ rows = (unlockedGroups.length / cols); if ((unlockedGroups.length % cols) > 0){ rows++; }; groupIndex = 0; i = 0; while (i < cols) { col = new MovieClip(); j = 0; while (j < rows) { if (groupIndex > (unlockedGroups.length - 1)){ break; }; groupClip2 = new GroupClip(unlockedGroups[groupIndex].id); _objects.push(groupClip2); groupClip2.y = col.height; col.addChild(groupClip2); groupIndex++; j++; }; col.x = groups.width; col.y = (((rows * 128) / 2) - (col.height / 2)); groups.addChild(col); i++; }; groups.scaleX = scale; groups.scaleY = scale; groups.y = ((spaceRect.y + (spaceRect.height / 2)) - (groups.height / 2)); all.addChild(groups); }; var prevGroupLayout:GroupsLayout = (prevLayout as GroupsLayout); if (selectedGroupRight){ groups.x = 64; elementsRight = createElementsLayout(selectedGroupRight, spaceRect, LayoutClip.RIGHT); all.addChild(elementsRight); elementsRight.x = (spaceRect.width - elementsRight.width); }; if (selectedGroupLeft){ groups.x = ((spaceRect.width - groups.width) - 64); elementsLeft = createElementsLayout(selectedGroupLeft, spaceRect, LayoutClip.LEFT); all.addChild(elementsLeft); elementsLeft.x = 0; }; if (((!(selectedGroupLeft)) && (!(selectedGroupRight)))){ groups.x = ((spaceRect.x + (spaceRect.width / 2)) - (groups.width / 2)); }; Utils.removeAllChildren(this); flatten(all, this, 1); } private function createElementsLayout(group:Group, spaceRect:Rectangle, layout:String):MovieClip{ var element:Element; var clip:ElementClip; var elementsLayout:MovieClip = new MovieClip(); var elementsList:MovieClip = new MovieClip(); var groupClip:GroupClip = new GroupClip(group.id, layout); _objects.push(groupClip); elementsLayout.addChild(groupClip); groupClip.y = ((spaceRect.y + (spaceRect.height / 2)) - (groupClip.height / 2)); groupClip.x = 0; var shift:Number = 64; var groupElements:Array = Model.inst.getUnlockedElements(group.id); var i:int; while (i < groupElements.length) { element = groupElements[i]; clip = new ElementClip(element.id, layout); clip.x = (int((i / 5)) * clip.width); clip.y = (int((i % 5)) * clip.height); elementsList.addChild(clip); _objects.push(clip); i++; }; if (layout == LayoutClip.LEFT){ groupClip.x = shift; elementsList.x = ((groupClip.x + groupClip.width) + 32); } else { groupClip.x = ((elementsList.x + elementsList.width) - shift); elementsList.x = (elementsList.x + (32 - shift)); }; elementsList.y = (((spaceRect.y + (spaceRect.height / 2)) - (elementsList.height / 2)) + 32); elementsLayout.addChild(elementsList); return (elementsLayout); } } }//package screens
Section 120
//Intro (screens.Intro) package screens { import common.*; import flash.events.*; import flash.display.*; import flash.geom.*; import model.*; import com.greensock.*; import flash.utils.*; import common.platform.*; import flash.media.*; import com.greensock.easing.*; public class Intro extends Sprite { private var _basicElements:MovieClip; private var _QuestionClass:Class; private var _nextScene:Function;// = null private var _skipTimeout:uint;// = 0 private var _texts:Array; private var _IntroClass:Class; private var _intro; private var _nextSceneTimeout:uint;// = 0 private var _equation:MovieClip; private var _sceneSkipEnabled:Boolean;// = false public function Intro(){ _IntroClass = Intro__IntroClass; _QuestionClass = Intro__QuestionClass; super(); _intro = new _IntroClass(); addChild(_intro); _intro.skip.addEventListener(MouseEvent.CLICK, function ():void{ onExit(); }); var d:Number = 0.3; AnimationUtils.tweenAnimation(_intro.water, d); AnimationUtils.tweenAnimation(_intro.earth, d); AnimationUtils.tweenAnimation(_intro.air, d); AnimationUtils.tweenAnimation(_intro.fire, d); _intro.water.visible = false; _intro.earth.visible = false; _intro.air.visible = false; _intro.fire.visible = false; _intro.idea.visible = false; _intro.subtitle.visible = false; this.graphics.beginFill(0, 0); this.graphics.drawRect(0, 0, Platform.wrapper.normalSize.width, Platform.wrapper.normalSize.height); this.graphics.endFill(); addEventListener(MouseEvent.CLICK, function (e):void{ nextScene(true); }); TweenMax.to(_intro.halo, 10, {rotation:360, repeat:-1, ease:Linear.easeNone}); _texts = ["In the beginning there\nwas only Doodle God.", "Doodle God created\nthe four basic elements...", "From earth Doodle God\n created the planets...", "From water seas and\noceans were created...", "From fire were created\nvolcanoes... and other stuff...", "From air... you know...", "But the world was still\n vast and deserted...", "...and then Doodle God was\n struck with a bright idea!", "What if I combined the basic\nelements to create new ones?", "And Doodle God began\ncreating new elements...", "Wow! There is so much to\ncombine, so much to create!"]; _nextScene = sceneBeginning; nextScene(); } private function tweenFly(clip:ElementClip, duration:Number, delay:Number=0):void{ addChild(clip); clip.x = -64; clip.y = ((Math.random() * 100) + 190); var points:Array = []; points.push({x:((Math.random() * 100) + 220), y:((Math.random() * 100) + 190)}); points.push({x:(640 + 64), y:((Math.random() * 100) + 190)}); TweenMax.to(clip, duration, {delay:delay, bezierThrough:points, ease:Quad.easeIn}); } private function sceneFly1():Number{ SoundManager.inst.newElement.play(); GraphUtils.showFlash(this); _equation.visible = false; var d:Number = 5; var d2:Number = 1.5; tweenFly(new ElementClip("Worm"), d); tweenFly(new ElementClip("Tree"), d, d2); tweenFly(new ElementClip("Clay"), d, (d2 * 2)); tweenFly(new ElementClip("Dolphin"), d, (d2 * 3)); animateText(_texts[9]); _nextScene = sceneFly2; return (((d2 * 4) + (d - d2))); } private function sceneFly2():Number{ SoundManager.inst.newElement.play(); GraphUtils.showFlash(this); var d:Number = 5; var d2:Number = 1.5; tweenFly(new ElementClip("Human"), d); tweenFly(new ElementClip("Boat"), d, d2); tweenFly(new ElementClip("Car"), d, (d2 * 2)); tweenFly(new ElementClip("Airplane"), d, (d2 * 3)); animateText(_texts[10]); _nextScene = end; return (((d2 * 4) + (d - d2))); } private function animateText(text:String):void{ TweenMax.killTweensOf(_intro.subtitle); _intro.subtitle.visible = true; var textX:Number = (GraphUtils.centerPoint().x - (_intro.subtitle.width / 2)); GraphUtils.setText(_intro.subtitle, text); _intro.subtitle.x = -(_intro.subtitle.width); _intro.subtitle.y = 425; var timeline:TimelineMax = new TimelineMax(); var timelineAmin:TimelineMax = new TimelineMax({repeat:-1, yoyo:true}); timeline.appendMultiple([TweenMax.to(_intro.subtitle, 1, {x:(textX + 10), ease:Cubic.easeOut})]); timelineAmin.appendMultiple([TweenMax.to(_intro.subtitle, 5, {x:(textX - 10), ease:Cubic.easeInOut})]); timeline.append(timelineAmin); } private function sceneBasicElements():Number{ var elemClip:ElementClip; SoundManager.inst.newElement.play(); GraphUtils.showFlash(this); animateText(_texts[1]); _basicElements = new MovieClip(); addChild(_basicElements); _basicElements.earth = new ElementClip("Earth"); _basicElements.water = new ElementClip("Water"); _basicElements.fire = new ElementClip("Fire"); _basicElements.air = new ElementClip("Air"); var arr:Array = [_basicElements.earth, _basicElements.water, _basicElements.fire, _basicElements.air]; var x:Number = 0; var delay:Number = 0; for each (elemClip in arr) { _basicElements.addChild(elemClip); elemClip.x = x; x = (x + 64); TweenMax.to(elemClip, 0.5, {delay:delay, repeat:-1, y:(elemClip.y + 10), yoyo:true, ease:Sine.easeInOut}); delay = (delay + 0.12); }; _basicElements.y = 170; tweenCenter(_basicElements); _nextScene = sceneEarth; return (6); } private function tweenCreateWorldsPart(elem:ElementClip, part:MovieClip):void{ var elem = elem; var part = part; addChild(elem); elem.x = (elem.x + _basicElements.x); elem.y = (elem.y + _basicElements.y); tweenCenter(_basicElements); TweenLite.to(elem, 0.5, {y:350, alpha:0, onComplete:function ():void{ Utils.removeChildSafe(elem); GraphUtils.tweenVisible(part, true, 0.5); }}); } private function sceneBut():Number{ SoundManager.inst.playOldElement(); GraphUtils.showFlash(this); animateText(_texts[6]); _nextScene = sceneIdea; return (6); } private function sceneEarth():Number{ SoundManager.inst.flight.play(0, 0, new SoundTransform(2)); GraphUtils.showFlash(this); animateText(_texts[2]); tweenCreateWorldsPart(_basicElements.earth, _intro.earth); _nextScene = sceneWater; return (6); } private function tweenCenter(clip:MovieClip):void{ var rect:Rectangle = clip.getRect(clip); var targetX:Number = ((Platform.wrapper.normalSize.width / 2) - ((rect.left + rect.right) / 2)); trace(("targetX = " + targetX)); TweenLite.to(clip, 0.5, {x:targetX}); } private function sceneFire():Number{ SoundManager.inst.flight.play(0, 0, new SoundTransform(2)); GraphUtils.showFlash(this); animateText(_texts[4]); tweenCreateWorldsPart(_basicElements.fire, _intro.fire); _nextScene = sceneAir; return (6); } private function onExit():void{ clearTimeout(_skipTimeout); clearTimeout(_nextSceneTimeout); _nextScene = null; Model.inst.introShown = true; Model.inst.saveGame(); dispatchEvent(new DynamicEvent("introShown")); } private function sceneAir():Number{ SoundManager.inst.flight.play(0, 0, new SoundTransform(2)); GraphUtils.showFlash(this); animateText(_texts[5]); tweenCreateWorldsPart(_basicElements.air, _intro.air); _nextScene = sceneBut; return (6); } private function nextScene(byClick:Boolean=false):void{ var duration:Number; var byClick = byClick; if (((!((_nextScene == null))) && (((!(byClick)) || (_sceneSkipEnabled))))){ duration = _nextScene(); if (duration > 0){ clearTimeout(_nextSceneTimeout); _nextSceneTimeout = setTimeout(function ():void{ nextScene(); }, (duration * 1000)); }; _sceneSkipEnabled = false; clearTimeout(_skipTimeout); _skipTimeout = setTimeout(function ():void{ _sceneSkipEnabled = true; }, 3000); }; } private function sceneBeginning():Number{ SoundManager.inst.flight.play(0, 0, new SoundTransform(2)); GraphUtils.showFlash(this); animateText(_texts[0]); _nextScene = sceneBasicElements; return (6); } private function sceneEquation():Number{ SoundManager.inst.playOldElement(); GraphUtils.showFlash(this); _intro.idea.visible = false; animateText(_texts[8]); var question:MovieClip = new MovieClip(); _equation = new MovieClip(); _equation.earth = _equation.addChild(new ElementClip("Earth")); _equation.earth.y = 32; _equation.plus = _equation.addChild(new ReactionsLogScreen._PlusClass()); _equation.plus.x = ((_equation.earth.x + _equation.earth.width) - 32); _equation.fire = _equation.addChild(new ElementClip("Fire")); _equation.fire.x = ((_equation.plus.x + _equation.plus.width) + 32); _equation.fire.y = 32; _equation.equals = _equation.addChild(new ReactionsLogScreen._EqualClass()); _equation.equals.x = ((_equation.fire.x + _equation.fire.width) - 32); question.addChild(new _QuestionClass()); question.getChildAt(0).x = (-(question.getChildAt(0).width) / 2); question.getChildAt(0).y = (-(question.getChildAt(0).height) / 2); Bitmap(question.getChildAt(0)).smoothing = true; _equation.question = _equation.addChild(question); _equation.question.x = ((_equation.equals.x + _equation.equals.width) + 20); _equation.question.y = 32; TweenMax.to(_equation.question, 0.5, {startAt:{scaleX:0.7, scaleY:0.7}, scaleX:1.5, scaleY:1.5, repeat:-1, yoyo:true, ease:Linear.easeIn}); addChild(_equation); _equation.y = 140; tweenCenter(_equation); _nextScene = sceneFly1; return (6); } private function sceneWater():Number{ SoundManager.inst.flight.play(0, 0, new SoundTransform(2)); GraphUtils.showFlash(this); animateText(_texts[3]); tweenCreateWorldsPart(_basicElements.water, _intro.water); _nextScene = sceneFire; return (6); } private function sceneIdea():Number{ SoundManager.inst.hint.play(); GraphUtils.showFlash(this); animateText(_texts[7]); _intro.idea.visible = true; TweenMax.to(_intro.idea, 0.5, {startAt:{alpha:0.3}, alpha:1, repeat:-1, yoyo:true, ease:Sine.easeInOut}); _nextScene = sceneEquation; return (6); } private function end():void{ GraphUtils.showFlash(this); clearTimeout(_nextSceneTimeout); clearTimeout(_skipTimeout); _nextScene = null; onExit(); } } }//package screens
Section 121
//Intro__IntroClass (screens.Intro__IntroClass) package screens { import flash.display.*; import mx.core.*; public class Intro__IntroClass extends SpriteAsset { public var counter:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var hint:DisplayObject; public var hintCooldown:DisplayObject; public var dragon:DisplayObject; public var water:DisplayObject; public var score:DisplayObject; public var caption:DisplayObject; public var groupsCounter:DisplayObject; public var subtitle:DisplayObject; public var text:DisplayObject; public var eye:DisplayObject; public var menuBar:DisplayObject; public var halo:DisplayObject; public var fire:DisplayObject; public var bkg:DisplayObject; public var appStore:DisplayObject; public var help:DisplayObject; public var total:DisplayObject; public var air:DisplayObject; public var resetWarning:DisplayObject; public var reset:DisplayObject; public var earth:DisplayObject; public var soundOn:DisplayObject; public var alco:DisplayObject; public var submitScore:DisplayObject; public var wheel:DisplayObject; public var log:DisplayObject; public var hintCooldownText:DisplayObject; public var soundOff:DisplayObject; public var balloon1:DisplayObject; public var balloon2:DisplayObject; public var balloon3:DisplayObject; public var hintCaption:DisplayObject; public var assasin:DisplayObject; public var moreGames:DisplayObject; public var firearm:DisplayObject; public var value:DisplayObject; public var game:DisplayObject; public var butterfly:DisplayObject; public var back:DisplayObject; public var idea:DisplayObject; public var snake:DisplayObject; public var toMenu:DisplayObject; public var slash:DisplayObject; public var skip:DisplayObject; } }//package screens
Section 122
//Intro__QuestionClass (screens.Intro__QuestionClass) package screens { import mx.core.*; public class Intro__QuestionClass extends BitmapAsset { } }//package screens
Section 123
//Layout (screens.Layout) package screens { import flash.display.*; public class Layout extends MovieClip { protected var _objects:Array; public function Layout(){ _objects = []; super(); } public function update(prevLayout:Layout):void{ } public function getObjects():Array{ return (_objects); } } }//package screens
Section 124
//LayoutClip (screens.LayoutClip) package screens { import flash.display.*; public class LayoutClip extends MovieClip { public var tweenDirection:String;// = "appear" public var freeze:Boolean;// = false public var layout:String; public var curObjs:Array;// = null public static const DISAPPEAR:String = "disappear"; public static const KEEP:String = "keep"; public static const APPEAR:String = "appear"; public static const LEFT:String = "left"; public static const RIGHT:String = "right"; public function LayoutClip(layout:String=null){ super(); this.layout = layout; } public function get id():String{ return (null); } public function tween():Boolean{ return (false); } } }//package screens
Section 125
//Main (screens.Main) package screens { import common.*; import flash.events.*; import flash.display.*; import flash.text.*; import flash.geom.*; import common.events.*; import model.*; import com.greensock.*; import flash.utils.*; import common.platform.*; import com.greensock.easing.*; public class Main extends Sprite { private const SWITCH_LAYOUT_DURATION:Number = 0.7; private var _currentLayout:Layout; private var _space:Sprite; private var _NewElementCreatedClass:Class; private var _HelpScreenClass:Class; private var _newElementCreated; private var _QuoteClass:Class; private var _selectedElementClipRight:ElementClip; private var _helpScreen; private var _ClickToContinueClass:Class; private var _currentLayoutName:String;// = "" private var _currenLayoutTween:TimelineMax;// = null private var _selectedElementClipLeft:ElementClip; private var _toolbar:Toolbar; private var _tutorial:TutorialController; private var _menu:MainMenu; private var _currentScreen;// = null private var _selectedGroupLeft:Group; private var _logScreen:ReactionsLogScreen; private var _BkgClass:Class; private var _dragElementClip:ElementClip; private var _mouseController:MouseController; private var _NewElementHaloClass:Class; private var _intro:Intro; private var _selectedGroupRight:Group; private var _quote; private var _dragElementCopy:DisplayObject; private var _bkg; private static const _apiKey:String = "53c085cec10a0c6f533e9935de994542"; public static var inst:Main; private static var _locTable:Object; public static var _FinalScreenClass:Class = Main__FinalScreenClass; public static var _FacebookShareClass:Class = Main__FacebookShareClass; public function Main(){ _BkgClass = Main__BkgClass; _HelpScreenClass = Main__HelpScreenClass; _ClickToContinueClass = Main__ClickToContinueClass; _NewElementCreatedClass = Main__NewElementCreatedClass; _NewElementHaloClass = Main__NewElementHaloClass; _QuoteClass = Main__QuoteClass; _mouseController = new MouseController(); _tutorial = new TutorialController(); inst = this; super(); _bkg = new _BkgClass(); addChild(_bkg); _toolbar = new Toolbar(); GraphUtils.alignIn(_toolbar, this, GraphUtils.BOTTOM_CENTER); addChild(_toolbar); _helpScreen = new _HelpScreenClass(); _helpScreen.mouseEnabled = false; _bkg.hintCaption.visible = false; _logScreen = new ReactionsLogScreen(); _newElementCreated = new _NewElementCreatedClass(); _toolbar.hint.addEventListener(MouseEvent.CLICK, function (e):void{ var reaction:Reaction; var groupId1:String; var groupId2:String; var e = e; if (Model.inst.finalScreenShown){ showFinalScreen(); } else { SoundManager.inst.hint.play(); hideScreen(); reaction = Model.inst.getHint(); groupId1 = Model.inst.elements[reaction.element1].group; groupId2 = Model.inst.elements[reaction.element2].group; _selectedGroupLeft = Model.inst.groups[groupId1]; _selectedGroupRight = Model.inst.groups[groupId2]; switchLayout(new GroupsLayout(_selectedGroupLeft, _selectedGroupRight), function ():void{ _space.addChild(_bkg.hintCaption); _bkg.hintCaption.visible = true; tweenBlink(_bkg.hintCaption, 6, 0xFF0000, 0xFFFFFF, 1.5); setTimeout(function ():void{ GraphUtils.tweenVisible(_bkg.hintCaption, false, 0.5, true); }, 4500); }); _toolbar.startCooldown(); }; }); _toolbar.help.addEventListener(MouseEvent.CLICK, function (e):void{ if (hideScreen() != _helpScreen){ showScreen(_helpScreen); } else { switchLayout(new GroupsLayout(_selectedGroupLeft, _selectedGroupRight)); }; }); _toolbar.toMenu.addEventListener(MouseEvent.CLICK, function (e):void{ hideScreen(); switchLayout(null); addChild(_menu); GraphUtils.tweenVisible(_menu, true, 0.3); _menu.startRandomAnimations(); _menu.updateScore(); }); _toolbar.back.addEventListener(MouseEvent.CLICK, function (e):void{ if (!hideScreen()){ _selectedGroupRight = null; _selectedGroupLeft = null; }; switchLayout(new GroupsLayout(_selectedGroupLeft, _selectedGroupRight)); updateToolbar(); }); _toolbar.log.addEventListener(MouseEvent.CLICK, function (e):void{ if (hideScreen() != _logScreen){ _logScreen.update(); Model.inst.markReactionLogAsRead(); updateToolbar(); showScreen(_logScreen); } else { switchLayout(new GroupsLayout(_selectedGroupLeft, _selectedGroupRight)); }; }); _quote = new _QuoteClass(); _quote.text.autoSize = TextFieldAutoSize.LEFT; _quote.author.autoSize = TextFieldAutoSize.RIGHT; _space = new Sprite(); addChild(_space); _space.addEventListener(MouseEvent.CLICK, onMouseClick); _menu = new MainMenu(); addChild(_menu); _menu.addEventListener("resetGame", onResetGame); _menu.addEventListener("sound", function (e:DynamicEvent):void{ }); _menu.game.addEventListener(MouseEvent.CLICK, function (e):void{ startGame(); }); _menu.setSoundOn(Model.inst.soundOn); _mouseController.attach(_space, Application.inst); _mouseController.addEventListener("startDrag", function (e:DynamicEvent):void{ var elementClip:ElementClip = (e.targetObject as ElementClip); if (elementClip){ if (_selectedElementClipLeft){ killSelectedElementTween(_selectedElementClipLeft); _selectedElementClipLeft = null; }; if (_selectedElementClipRight){ killSelectedElementTween(_selectedElementClipRight); _selectedElementClipRight = null; }; _dragElementCopy = GraphUtils.copyAndPasteClipAsImage(elementClip, _space); _dragElementClip = elementClip; GraphUtils.tweenVisible(_dragElementCopy, true, 0.1); _dragElementCopy.x = (_mouseController.curPos.x - 32); _dragElementCopy.y = (_mouseController.curPos.y - 32); if (elementClip.layout == LayoutClip.LEFT){ _selectedElementClipLeft = elementClip; } else { if (elementClip.layout == LayoutClip.RIGHT){ _selectedElementClipRight = elementClip; }; }; tweenSelectedElement(elementClip); }; }); _mouseController.addEventListener("stopDragging", function (e:DynamicEvent):void{ var i:int; var elementClip:ElementClip; var dx:Number; var dy:Number; if (_dragElementClip){ GraphUtils.tweenVisible(_dragElementCopy, false, 0.1, true); if (_selectedElementClipLeft){ killSelectedElementTween(_selectedElementClipLeft); _selectedElementClipLeft = null; }; if (_selectedElementClipRight){ killSelectedElementTween(_selectedElementClipRight); _selectedElementClipRight = null; }; i = 0; while (i < _space.numChildren) { elementClip = (_space.getChildAt(i) as ElementClip); if (elementClip){ dx = Math.abs(((_dragElementCopy.x + 32) - elementClip.x)); dy = Math.abs(((_dragElementCopy.y + 32) - elementClip.y)); if ((((dx <= 30)) && ((dy <= 30)))){ tryReaction(elementClip, _dragElementClip); break; }; }; i++; }; }; _dragElementCopy = null; _dragElementClip = null; }); EventManager.inst.addEventListener("cursorMove", function (e:DynamicEvent):void{ if (_dragElementCopy){ _dragElementCopy.x = (e.stageX - 32); _dragElementCopy.y = (e.stageY - 32); }; }); _bkg.appStore.addEventListener(MouseEvent.CLICK, MainMenu.onAppStore); _bkg.moreGames.addEventListener(MouseEvent.CLICK, MainMenu.onMoreGames); SoundManager.inst.registerClickSoundForAllButtons(_bkg); _locTable = {}; _locTable["Animal"] = "Beast"; _locTable["Arable"] = "Field"; _locTable["Clothing"] = "Clothes"; _locTable["Livestock"] = "Domestic animal"; _locTable["Manure"] = "Fertilizer"; _locTable["Philosophers stone"] = "Philosophers' stone"; _locTable["Sailing ship"] = "Frigate"; _locTable["Spirit"] = "Alcohol"; _locTable["Team"] = "Chariot"; _bkg.moreGamesTooltip.visible = false; _bkg.appStoreTooltip.visible = false; addChild(_bkg.moreGamesTooltip); addChild(_bkg.appStoreTooltip); _bkg.moreGames.addEventListener(MouseEvent.ROLL_OVER, function (e):void{ _bkg.moreGamesTooltip.visible = true; Utils.bringToTop(_bkg.moreGamesTooltip); }); _bkg.moreGames.addEventListener(MouseEvent.ROLL_OUT, function (e):void{ _bkg.moreGamesTooltip.visible = false; }); _bkg.appStore.addEventListener(MouseEvent.ROLL_OVER, function (e):void{ _bkg.appStoreTooltip.visible = true; Utils.bringToTop(_bkg.appStoreTooltip); }); _bkg.appStore.addEventListener(MouseEvent.ROLL_OUT, function (e):void{ _bkg.appStoreTooltip.visible = false; }); } public function get space():Sprite{ return (_space); } public function get currentLayout():Layout{ return (_currentLayout); } private function killSelectedElementTween(elementClip:ElementClip):void{ TweenLite.killTweensOf(elementClip); elementClip.rotation = 0; } public function get selectedElementClipLeft():ElementClip{ return (_selectedElementClipLeft); } public function get elementsCounter(){ return (_bkg.elementsCounter); } private function tryReaction(element1:ElementClip, element2:ElementClip):void{ var oldGroupsCount:int; var THIS:*; var reaction:Reaction; var result:Array; var element1 = element1; var element2 = element2; oldGroupsCount = Model.inst.getUnlockedGroups().length; THIS = this; if (((element1) && (element2))){ reaction = Model.inst.tryReaction(element1.element, element2.element); result = (reaction) ? reaction.getResult() : null; killSelectedElementTween(element1); killSelectedElementTween(element2); if (!result){ SoundManager.inst.reactionFailedClick.play(); tweenFailedElement(element1); tweenFailedElement(element2); _selectedElementClipLeft = null; _selectedElementClipRight = null; } else { _selectedGroupLeft = null; _selectedGroupRight = null; enableControls(false); SoundManager.inst.flight.play(); switchLayout(new ReactionLayout(element1, element2, function (newElementPoint:Point):Array{ var newElementClipArray:*; var newCount:*; var element:*; var i:*; var newElementClip:*; var newElementPoint = newElementPoint; newElementClipArray = []; var width:* = 0; newCount = 0; for each (element in result) { newElementClip = new ElementClip(element.id); newElementClipArray.push(newElementClip); newElementClip.mouseEnabled = false; newElementClip.x = newElementPoint.x; newElementClip.y = newElementPoint.y; width = (width + newElementClip.width); _space.addChild(newElementClip); if (element.isNew){ newCount = (newCount + 1); }; }; i = 0; while (i < newElementClipArray.length) { newElementClip.freeze = false; newElementClip = newElementClipArray[i]; newElementClip.x = (((newElementPoint.x - (width / 2)) + (i * newElementClip.width)) + (newElementClip.width / 2)); i = (i + 1); }; SoundManager.inst.flash.play(); GraphUtils.showFlash(THIS, function ():void{ switchLayout(new ResultLayout(newElementClipArray), function ():void{ var quoteTop:*; var halos:*; var clip:*; var element:*; var halo:*; var textX:*; var authorX:*; var timeline:*; var timelineAmin:*; updateUI(); var clickToContinue:* = new _ClickToContinueClass(); clickToContinue.x = GraphUtils.centerPoint().x; clickToContinue.y = Platform.wrapper.spaceNormaSize.bottom; var quoteBottom:* = (clickToContinue.y - clickToContinue.height); halos = []; var facebookShare:* = null; if (newCount > 0){ SoundManager.inst.newElement.play(); _space.addChild(_newElementCreated); facebookShare = new _FacebookShareClass(); _space.addChild(facebookShare); facebookShare.addEventListener(MouseEvent.CLICK, function (e):void{ postReactionToFacebook(reaction); }); GraphUtils.setText(_newElementCreated.text, ((newCount > 1)) ? "(new elements created)" : "(new element created)"); _newElementCreated.x = newElementPoint.x; _newElementCreated.y = (newElementPoint.y + 30); facebookShare.x = (_newElementCreated.getRect(_space).right + 10); facebookShare.y = (_newElementCreated.y + 3); for each (clip in ResultLayout(_currentLayout).getObjects()) { if ((((clip is ElementClip)) && (clip.element.isNew))){ halo = new _NewElementHaloClass(); _space.addChildAt(halo, 0); halo.x = clip.x; halo.y = clip.y; halo.alpha = 0; halos.push(halo); new TimelineMax().appendMultiple([TweenMax.to(halo, 1, {alpha:1}), TweenMax.to(halo, 10, {rotation:360, repeat:-1, ease:Linear.easeNone})]); }; }; for each (element in result) { element.isNew = false; }; quoteTop = (_newElementCreated.y + _newElementCreated.height); } else { SoundManager.inst.playOldElement(); quoteTop = (newElementPoint.y + 40); }; var quote:* = Model.inst.getRandomQuote(result[0].id); if (quote){ _space.addChild(_quote.text); _space.addChild(_quote.author); GraphUtils.setText(_quote.text, quote.text); GraphUtils.setText(_quote.author, quote.author); textX = (GraphUtils.centerPoint().x - (_quote.text.width / 2)); authorX = ((textX + _quote.text.width) - _quote.author.width); _quote.text.x = -(_quote.text.width); _quote.author.x = Platform.wrapper.normalSize.width; _quote.text.y = (((quoteTop + quoteBottom) / 2) - ((_quote.text.height + _quote.author.height) / 2)); _quote.author.y = (_quote.text.y + _quote.text.height); timeline = new TimelineMax(); timelineAmin = new TimelineMax({repeat:-1, yoyo:true}); timeline.appendMultiple([TweenMax.to(_quote.text, 0.5, {x:(textX + 10), ease:Quad.easeInOut}), TweenMax.to(_quote.author, 0.5, {x:authorX, ease:Quad.easeInOut})]); timelineAmin.appendMultiple([TweenMax.to(_quote.text, 10, {x:(textX - 15), ease:Sine.easeInOut}), TweenMax.to(_quote.author, 10, {x:(authorX + 25), ease:Sine.easeInOut})]); timeline.append(timelineAmin); }; _space.addChild(clickToContinue); Utils.addEventListener(THIS, null, [facebookShare], MouseEvent.CLICK, function (e):void{ var clipsCollapse:*; var halo:*; var clip:*; var timelineCollapse:*; var e = e; timeline.kill(); var tweensCollapse:* = []; clipsCollapse = []; for each (halo in halos) { Utils.removeChildSafe(halo); }; for each (clip in ResultLayout(_currentLayout).getObjects()) { if ((clip is ElementClip)){ tweensCollapse.push(TweenLite.to(clip, 0.5, {y:(clip.y - 100), ease:Linear.easeNone})); clipsCollapse.push(clip); }; }; timelineCollapse = new TimelineMax({onComplete:function ():void{ var clip:*; for each (clip in clipsCollapse) { Utils.removeChildSafe(clip); }; if ((((Model.inst.unlockedElementIds.length >= Model.inst.elementCount)) && (!(Model.inst.finalScreenShown)))){ Model.inst.finalScreenShown = true; Model.inst.saveGame(); showFinalScreen(); _toolbar.showHintButton(true); updateToolbar(); } else { switchLayout(new GroupsLayout(_selectedGroupLeft, _selectedGroupRight)); }; var newGroups:* = (Model.inst.getUnlockedGroups().length - oldGroupsCount); if (newCount > 0){ Model.inst.addScore(newCount, newGroups); Model.inst.saveGame(); updateCounter2(_bkg.score, Model.inst.score); tweenBlink(_bkg.elementsCounter.counter, 15, 0xFF0000, 0xFFFFFF, 1.5); tweenBlink(_bkg.score.value, 15, 0xFF0000, 0xFFFFFF, 1.5); }; if (newGroups > 0){ tweenBlink(_bkg.groupsCounter.counter, 15, 0xFF0000, 0xFFFFFF, 1.5); }; }}); timelineCollapse.appendMultiple(tweensCollapse); }); }, true); }); return (newElementClipArray); }), null, true); }; }; } public function updateUI():void{ updateTop(); updateToolbar(); } public function switchLayout(newLayout:Layout, onComplete:Function=null, leaveDisabled:Boolean=false):void{ var newObj:LayoutClip; var curObj:LayoutClip; var tweens:Array; var THIS:Main; var child:*; var closestObj:LayoutClip; var minDist:Number; var obj:LayoutClip; var dist:Number; var tween:TweenLite; var newLayout = newLayout; var onComplete = onComplete; var leaveDisabled = leaveDisabled; if ((((newLayout is GroupsLayout)) || ((_currentLayout is GroupsLayout)))){ SoundManager.inst.move.play(); }; enableControls(false); _currentLayoutName = name; _selectedElementClipLeft = null; _selectedElementClipRight = null; var currentObjects:Array = []; var newObjects:Array = []; if (_currentLayout){ currentObjects = _currentLayout.getObjects(); }; if (newLayout){ newLayout.update(_currentLayout); newObjects = newLayout.getObjects(); }; var type = ""; var otherObjects:Array = []; var i:int; while (i < _space.numChildren) { child = _space.getChildAt(i); if (currentObjects.indexOf(child) < 0){ otherObjects.push(child); }; i = (i + 1); }; for each (newObj in newObjects) { newObj.tweenDirection = LayoutClip.APPEAR; newObj.curObjs = []; }; for each (curObj in currentObjects) { curObj.tweenDirection = LayoutClip.DISAPPEAR; }; for each (newObj in newObjects) { for each (curObj in currentObjects) { if (newObj.id == curObj.id){ newObj.tweenDirection = LayoutClip.KEEP; newObj.curObjs.push(curObj); }; }; }; for each (newObj in newObjects) { if (newObj.curObjs.length > 0){ minDist = Number.MAX_VALUE; for each (obj in newObj.curObjs) { dist = Math.sqrt((Math.pow((obj.x - newObj.x), 2) + Math.pow((obj.y - newObj.y), 2))); if (dist < minDist){ closestObj = obj; minDist = dist; }; }; newObj.curObjs = [closestObj]; closestObj.tweenDirection = LayoutClip.KEEP; }; }; _tutorial.hideAll(); for each (curObj in currentObjects) { if (curObj.tweenDirection != LayoutClip.KEEP){ tween(curObj); }; }; Utils.dumpArray(currentObjects, "currentObjects"); Utils.dumpArray(newObjects, "newObjects"); tweens = []; for each (newObj in newObjects) { tween = tween(newObj); if (tween){ tweens.push(tween); }; }; THIS = this; if (_currenLayoutTween){ _currenLayoutTween.kill(); }; if (!leaveDisabled){ setTimeout(function ():void{ enableControls(true); }, ((SWITCH_LAYOUT_DURATION * 1000) - 300)); }; _currenLayoutTween = new TimelineMax({onComplete:function ():void{ if (onComplete != null){ onComplete(); }; _tutorial.update(THIS); }}); _currenLayoutTween.appendMultiple(tweens); var temp:Sprite = new Sprite(); _currenLayoutTween.append(TweenLite.to(temp, 0.1, {})); _currentLayout = newLayout; for each (child in otherObjects) { GraphUtils.tweenVisible(child, false, (SWITCH_LAYOUT_DURATION / 2), true); }; } private function updateCounter2(counter, value:Number):void{ GraphUtils.setText(counter.value, ("" + value)); counter.value.x = (counter.caption.x + counter.caption.width); } private function onMouseClick(event:MouseEvent):void{ var groupClip:GroupClip; var centerX:Number; var elementClip:ElementClip; if ((event.target is GroupClip)){ groupClip = GroupClip(event.target); if (!groupClip.layout){ if (_selectedGroupRight){ _selectedGroupLeft = groupClip.group; } else { if (_selectedGroupLeft){ _selectedGroupRight = groupClip.group; } else { centerX = GraphUtils.centerX(groupClip); if (centerX > (Platform.wrapper.normalSize.width / 2)){ _selectedGroupRight = groupClip.group; } else { _selectedGroupLeft = groupClip.group; }; }; }; Model.inst.markAsRead(groupClip.group.id); } else { if (groupClip.layout == LayoutClip.LEFT){ _selectedGroupLeft = null; } else { if (groupClip.layout == LayoutClip.RIGHT){ _selectedGroupRight = null; }; }; }; switchLayout(new GroupsLayout(_selectedGroupLeft, _selectedGroupRight)); updateToolbar(); } else { if ((event.target is ElementClip)){ SoundManager.inst.elementClick.play(); elementClip = ElementClip(event.target); if ((((elementClip.layout == LayoutClip.LEFT)) && (_selectedElementClipLeft))){ killSelectedElementTween(_selectedElementClipLeft); }; if ((((elementClip.layout == LayoutClip.RIGHT)) && (_selectedElementClipRight))){ killSelectedElementTween(_selectedElementClipRight); }; if (elementClip == _selectedElementClipLeft){ _selectedElementClipLeft = null; } else { if (elementClip == _selectedElementClipRight){ _selectedElementClipRight = null; } else { if (elementClip.layout == LayoutClip.LEFT){ _selectedElementClipLeft = elementClip; tweenSelectedElement(elementClip); } else { _selectedElementClipRight = elementClip; tweenSelectedElement(elementClip); }; }; }; _tutorial.update(this); tryReaction(_selectedElementClipLeft, _selectedElementClipRight); }; }; } private function tweenBlink(clip, n:Number, color1:uint, color2:uint, duration:Number, onComplete:Function=null):void{ var timeline:TimelineMax = new TimelineMax({onComplete:onComplete}); var i:int; while (i < n) { timeline.append(TweenMax.to(clip, ((duration / n) / 2), {tint:0x770000})); timeline.append(TweenMax.to(clip, ((duration / n) / 2), {tint:0xFFFFFF})); i++; }; } private function tweenScreen(screen:DisplayObject, show:Boolean, onComplete:Function=null, leaveDisable:Boolean=false):void{ var screen = screen; var show = show; var onComplete = onComplete; var leaveDisable = leaveDisable; if (show){ switchLayout(null, null, leaveDisable); addChild(screen); screen.x = _bkg.width; TweenLite.to(screen, 1, {x:((_bkg.width / 2) - (screen.width / 2)), ease:customBackEaseOut, onComplete:onComplete}); } else { TweenLite.to(screen, 1, {x:_bkg.width, ease:customBackEaseOut, onComplete:function ():void{ Utils.removeChildSafe(screen); if (onComplete != null){ onComplete(); }; }}); }; } public function getGroupClip(groupId:String):GroupClip{ var groupClip:GroupClip; var i:int; while (i < _space.numChildren) { groupClip = (_space.getChildAt(i) as GroupClip); if (((groupClip) && ((groupClip.group.id == groupId)))){ return (groupClip); }; i++; }; return (null); } public function showFinalScreen():void{ var THIS:*; THIS = this; enableControls(false); showScreen(new _FinalScreenClass(), function ():void{ var appStoreOldX:Number; var appStoreOldY:Number; var moreGamesOldX:Number; var moreGamesOldY:Number; appStoreOldX = _bkg.appStore.x; appStoreOldY = _bkg.appStore.y; moreGamesOldX = _bkg.moreGames.x; moreGamesOldY = _bkg.moreGames.y; TweenLite.to(_bkg.moreGames, 0.5, {x:((320 - _bkg.moreGames.width) - 10), y:375}); TweenLite.to(_bkg.appStore, 0.5, {x:(320 + 10), y:375}); Utils.addEventListener(THIS, null, [_bkg.moreGames, _bkg.appStore], MouseEvent.CLICK, function (e):void{ enableControls(true); hideScreen(); switchLayout(new GroupsLayout(null, null)); TweenLite.to(_bkg.appStore, 0.5, {x:appStoreOldX, y:appStoreOldY}); TweenLite.to(_bkg.moreGames, 0.5, {x:moreGamesOldX, y:moreGamesOldY}); }); }, true); } private function killFailedElement(elementClip:ElementClip):void{ TweenLite.killTweensOf(elementClip); elementClip.x = elementClip.oldX; } private function showScreen(screen, onComplete:Function=null, leaveDisabled:Boolean=false):void{ tweenScreen(screen, true, onComplete, leaveDisabled); _currentScreen = screen; _toolbar.showMenuButton(false); } public function get selectedGroupLeft():Group{ return (_selectedGroupLeft); } private function hideScreen(){ if (_currentScreen){ tweenScreen(_currentScreen, false); }; var prevScreen:* = _currentScreen; _currentScreen = null; return (prevScreen); } public function get selectedElementClipRight():ElementClip{ return (_selectedElementClipRight); } private function updateTop():void{ updateCounter(_bkg.elementsCounter, Model.inst.unlockedElementIds.length, Model.inst.elementCount); updateCounter(_bkg.groupsCounter, Model.inst.getUnlockedGroups().length, Model.inst.groupCount); updateCounter2(_bkg.score, Model.inst.score); } private function tweenFailedElement(elementClip:ElementClip):void{ var elementClip = elementClip; elementClip.oldX = elementClip.x; var shift:Number = 4; elementClip.x = (elementClip.oldX - shift); TweenMax.to(elementClip, 0.055, {yoyo:true, repeat:7, x:(elementClip.oldX + shift), ease:Sine.easeInOut, onComplete:function ():void{ elementClip.x = elementClip.oldX; }}); } public function get selectedGroupRight():Group{ return (_selectedGroupRight); } public function getElementClip(elementId:String):ElementClip{ var elementClip:ElementClip; var i:int; while (i < _space.numChildren) { elementClip = (_space.getChildAt(i) as ElementClip); if (((elementClip) && ((elementClip.element.id == elementId)))){ return (elementClip); }; i++; }; return (null); } private function onResetGame(e=null):void{ Model.inst.resetGame(); startGame(); } private function tween(obj:LayoutClip):TweenLite{ var obj = obj; var tween:TweenLite; var duration:Number = SWITCH_LAYOUT_DURATION; var ease:* = customBackEaseOut; if (!obj.freeze){ switch (obj.tweenDirection){ case LayoutClip.APPEAR: _space.addChild(obj); tween = TweenLite.to(obj, duration, {x:obj.x, ease:ease}); if (GraphUtils.centerX(obj) < (Platform.wrapper.normalSize.width / 2)){ obj.x = -(obj.width); } else { obj.x = (Platform.wrapper.normalSize.width + obj.width); }; break; case LayoutClip.DISAPPEAR: if (GraphUtils.centerX(obj) < (Platform.wrapper.normalSize.width / 2)){ tween = TweenLite.to(obj, duration, {x:-(obj.width), ease:ease, onComplete:function ():void{ Utils.removeChildSafe(obj); }}); } else { tween = TweenLite.to(obj, duration, {x:(Platform.wrapper.normalSize.width + obj.width), ease:ease, onComplete:function ():void{ Utils.removeChildSafe(obj); }}); }; break; case LayoutClip.KEEP: tween = TweenLite.to(obj, duration, {x:obj.x, y:obj.y, scaleX:obj.scaleX, scaleY:obj.scaleY, ease:ease}); _space.addChild(obj); obj.x = obj.curObjs[0].x; obj.y = obj.curObjs[0].y; obj.scaleX = obj.curObjs[0].scaleX; obj.scaleY = obj.curObjs[0].scaleY; if (obj != obj.curObjs[0]){ Utils.removeChildSafe(obj.curObjs[0]); }; break; }; }; return (tween); } private function enableControls(enabled:Boolean):void{ _toolbar.mouseEnabled = enabled; _toolbar.mouseChildren = enabled; } private function updateCounter(counter, value:int, total:int):void{ counter.counter.autoSize = TextFieldAutoSize.LEFT; counter.total.autoSize = TextFieldAutoSize.LEFT; GraphUtils.setText(counter.counter, ("" + value)); GraphUtils.setText(counter.total, ("" + total)); counter.counter.x = (counter.caption.x + counter.caption.width); counter.slash.x = (counter.counter.x + counter.counter.width); counter.total.x = (counter.slash.x + counter.slash.width); } private function startGame():void{ GraphUtils.tweenVisible(_menu, false, 0.3, true); if (Model.inst.introShown){ Utils.removeChildSafe(_bkg.bkg); addChildAt(_bkg, 0); _bkg.addChildAt(_bkg.bkg, 0); updateUI(); switchLayout(new GroupsLayout(null, null)); } else { Utils.removeChildSafe(_bkg); addChild(_bkg.bkg); _intro = new Intro(); _intro.addEventListener("introShown", function (e):void{ GraphUtils.tweenVisible(_intro, false, 0.5, true); _intro = null; startGame(); }); addChild(_intro); }; } private function tweenSelectedElement(elementClip:ElementClip):void{ var elementClip = elementClip; var angle:Number = 6; elementClip.rotation = -(angle); TweenMax.to(elementClip, 0.055, {yoyo:true, repeat:-1, rotation:angle, onComplete:function ():void{ elementClip.rotation = 0; }}); } private function updateToolbar():void{ if (((((_selectedGroupLeft) || (_selectedGroupRight))) || (_currentScreen))){ _toolbar.showMenuButton(false); } else { _toolbar.showMenuButton(true); }; _toolbar.setReactionLogBalloon(Model.inst.getUnreadReactionsCount()); } public static function loc(key:String):String{ if (_locTable[key]){ return (String(_locTable[key])); }; return (key); } public static function customBackEaseOut(t:Number, b:Number, c:Number, d:Number, s:Number=1.70158):Number{ t = ((t / d) - 1); s = (s / 4); return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b)); } public static function postReactionToFacebook(reaction:Reaction):void{ var attachment:String; var base:String = "http://www.facebook.com/connect/prompt_feed.php?locale=en_US"; attachment = Utils.stringFormat("&attachment={\"name\":\"{0}\",\"caption\":\"{1}\",\"description\":\"{2}\",\"href\":\"{3}\",\"media\":[{\"type\":\"image\",\"src\":\"{4}\",\"href\":\"{5}\"}]}", "I've found a new element!", reaction.getReactionText(), reaction.getFacebookText(), "http://www.avaloid.com/doodle-god/appstore?id=111", ("http://www.avaloid.com/custom/doodle-god/elements/" + Model.inst.elements[reaction.result1].image), "http://www.avaloid.com/doodle-god/appstore?id=112"); var actionLinks:String = Utils.stringFormat("&action_links=[{\"text\":\"{0}\",\"href\":\"{1}\"}]", "AppStore", "http://www.avaloid.com/doodle-god/appstore?id=113"); var userMessagePrompt:String = "&user_message_prompt=Get your friends to create elements too!"; var otherParams:String = ("&api_key=" + _apiKey); var url:String = ((((base + attachment) + actionLinks) + userMessagePrompt) + otherParams); Platform.wrapper.navigateToURL(url); } } }//package screens
Section 126
//Main__BkgClass (screens.Main__BkgClass) package screens { import flash.display.*; import mx.core.*; public class Main__BkgClass extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package screens
Section 127
//Main__ClickToContinueClass (screens.Main__ClickToContinueClass) package screens { import flash.display.*; import mx.core.*; public class Main__ClickToContinueClass extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package screens
Section 128
//Main__FacebookShareClass (screens.Main__FacebookShareClass) package screens { import flash.display.*; import mx.core.*; public class Main__FacebookShareClass extends ButtonAsset { public var text:DisplayObject; } }//package screens
Section 129
//Main__FinalScreenClass (screens.Main__FinalScreenClass) package screens { import flash.display.*; import mx.core.*; public class Main__FinalScreenClass extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package screens
Section 130
//Main__HelpScreenClass (screens.Main__HelpScreenClass) package screens { import flash.display.*; import mx.core.*; public class Main__HelpScreenClass extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package screens
Section 131
//Main__NewElementCreatedClass (screens.Main__NewElementCreatedClass) package screens { import flash.display.*; import mx.core.*; public class Main__NewElementCreatedClass extends SpriteAsset { public var text:DisplayObject; } }//package screens
Section 132
//Main__NewElementHaloClass (screens.Main__NewElementHaloClass) package screens { import flash.display.*; import mx.core.*; public class Main__NewElementHaloClass extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package screens
Section 133
//Main__QuoteClass (screens.Main__QuoteClass) package screens { import flash.display.*; import mx.core.*; public class Main__QuoteClass extends SpriteAsset { public var appStore:DisplayObject; public var counter:DisplayObject; public var total:DisplayObject; public var elementsCounter:DisplayObject; public var author:DisplayObject; public var bkg:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var hintCaption:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var moreGamesTooltip:DisplayObject; public var slash:DisplayObject; } }//package screens
Section 134
//MainMenu (screens.MainMenu) package screens { import common.*; import flash.events.*; import flash.display.*; import flash.text.*; import model.*; import com.greensock.*; import common.platform.*; public class MainMenu extends Sprite { private var _MainMenuClass:Class; private var _animationBlock; private var _animations:Array; private var _currentTween:TimelineMax;// = null private var _MenuAnimationClass:Class; private var _isAnimating:Boolean; private var _menu; public static const APP_STORE_LINK:String = "http://www.avaloid.com/doodle-god/appstore?id=99"; public function MainMenu(){ _MainMenuClass = MainMenu__MainMenuClass; _MenuAnimationClass = MainMenu__MenuAnimationClass; super(); _menu = new _MainMenuClass(); _animationBlock = new _MenuAnimationClass(); Utils.stopAmimationRecursive(_animationBlock); addChild(_menu); _menu.bkg.addChild(_animationBlock); _animationBlock.mouseEnabled = false; resetWarning.visible = false; addEventListener(MouseEvent.CLICK, function (e):void{ if (e.target == reset){ SoundManager.inst.click.play(); if (resetWarning.visible){ GraphUtils.tweenVisible(_animationBlock, true, 0.2); GraphUtils.tweenVisible(resetWarning, false, 0.2); stopRandomAnimations(); dispatchEvent(new DynamicEvent("resetGame")); } else { GraphUtils.tweenVisible(_animationBlock, false, 0.2); GraphUtils.tweenVisible(resetWarning, true, 0.2); }; } else { if (resetWarning.visible){ SoundManager.inst.click.play(); GraphUtils.tweenVisible(_animationBlock, true, 0.2); GraphUtils.tweenVisible(resetWarning, false, 0.2); }; }; }); game.addEventListener(MouseEvent.CLICK, function (e):void{ stopRandomAnimations(); }); soundOn.addEventListener(MouseEvent.CLICK, function (e):void{ setSoundOn(true); dispatchEvent(new DynamicEvent("soundOn", {soundOn:true})); }); soundOff.addEventListener(MouseEvent.CLICK, function (e):void{ setSoundOn(false); dispatchEvent(new DynamicEvent("soundOn", {soundOn:false})); }); appStore.addEventListener(MouseEvent.CLICK, onAppStore); submitScore.addEventListener(MouseEvent.CLICK, function (e):void{ }); moreGames.addEventListener(MouseEvent.CLICK, onMoreGames); submitScore.addEventListener(MouseEvent.CLICK, function (e):void{ }); _menu.doodleGodComLink.htmlText = "<a href=\"http://www.doodlegod.com\" target=\"_blank\">www.doodleGod.com</a>"; _animations = [_animationBlock.alco, _animationBlock.wheel, _animationBlock.assasin, _animationBlock.firearm, _animationBlock.dragon, _animationBlock.snake, _animationBlock.butterfly]; updateScore(); startRandomAnimations(); SoundManager.inst.registerClickSoundForAllButtons(this); _menu.moreGamesTooltip.visible = false; _menu.appStoreTooltip.visible = false; _menu.moreGames.addEventListener(MouseEvent.ROLL_OVER, function (e):void{ _menu.moreGamesTooltip.visible = true; }); _menu.moreGames.addEventListener(MouseEvent.ROLL_OUT, function (e):void{ _menu.moreGamesTooltip.visible = false; }); _menu.appStore.addEventListener(MouseEvent.ROLL_OVER, function (e):void{ _menu.appStoreTooltip.visible = true; }); _menu.appStore.addEventListener(MouseEvent.ROLL_OUT, function (e):void{ _menu.appStoreTooltip.visible = false; }); } public function get appStore():SimpleButton{ return (_menu.appStore); } public function updateScore():void{ GraphUtils.setText(_menu.score, ("Score: " + Model.inst.score)); } public function setSoundOn(on:Boolean):void{ if (on){ soundOn.visible = false; soundOff.visible = true; Model.inst.soundOn = true; Model.inst.saveGame(); SoundManager.inst.enableAll(); SoundManager.inst.playMain(); } else { soundOn.visible = true; soundOff.visible = false; Model.inst.soundOn = false; Model.inst.saveGame(); SoundManager.inst.muteAll(); }; } public function get resetWarning():TextField{ return (_menu.resetWarning); } public function get reset():SimpleButton{ return (_menu.menuBar.reset); } public function startRandomAnimations(nextClip:MovieClip=null):void{ var nextClip = nextClip; _isAnimating = true; if (nextClip == null){ nextClip = getRandomClip(); }; _currentTween = AnimationUtils.tweenAnimationYoyo(nextClip, 0.3, 3, function ():void{ if (_isAnimating){ startRandomAnimations(); }; }); } public function get score():TextField{ return (_menu.score); } public function get submitScore():SimpleButton{ return (_menu.submitScore); } public function get soundOn():SimpleButton{ return (_menu.menuBar.soundOn); } public function get soundOff():SimpleButton{ return (_menu.menuBar.soundOff); } private function getRandomClip(){ return (_animations[int((Math.random() * _animations.length))]); } public function get moreGames():SimpleButton{ return (_menu.moreGames); } public function get game():SimpleButton{ return (_menu.menuBar.game); } private function stopRandomAnimations():void{ _currentTween.kill(); _currentTween = null; _isAnimating = false; } public static function onMoreGames(event:MouseEvent=null):void{ Platform.wrapper.navigateToURL("http://www.avaloid.com/custom/joybits?id=1"); } public static function onAppStore(event:MouseEvent=null):void{ Platform.wrapper.navigateToURL(APP_STORE_LINK); } } }//package screens
Section 135
//MainMenu__MainMenuClass (screens.MainMenu__MainMenuClass) package screens { import flash.display.*; import mx.core.*; public class MainMenu__MainMenuClass extends SpriteAsset { public var appStore:DisplayObject; public var total:DisplayObject; public var bkg:DisplayObject; public var author:DisplayObject; public var resetWarning:DisplayObject; public var soundOn:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var elementsCounter:DisplayObject; public var reset:DisplayObject; public var hintCaption:DisplayObject; public var soundOff:DisplayObject; public var submitScore:DisplayObject; public var appStoreTooltip:DisplayObject; public var caption:DisplayObject; public var moreGames:DisplayObject; public var text:DisplayObject; public var value:DisplayObject; public var game:DisplayObject; public var menuBar:DisplayObject; public var moreGamesTooltip:DisplayObject; public var counter:DisplayObject; public var slash:DisplayObject; public var doodleGodComLink:DisplayObject; } }//package screens
Section 136
//MainMenu__MenuAnimationClass (screens.MainMenu__MenuAnimationClass) package screens { import flash.display.*; import mx.core.*; public class MainMenu__MenuAnimationClass extends SpriteAsset { public var counter:DisplayObject; public var elementsCounter:DisplayObject; public var hint:DisplayObject; public var author:DisplayObject; public var hintCooldown:DisplayObject; public var dragon:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var text:DisplayObject; public var menuBar:DisplayObject; public var appStore:DisplayObject; public var help:DisplayObject; public var total:DisplayObject; public var resetWarning:DisplayObject; public var reset:DisplayObject; public var soundOn:DisplayObject; public var bkg:DisplayObject; public var alco:DisplayObject; public var submitScore:DisplayObject; public var wheel:DisplayObject; public var log:DisplayObject; public var hintCaption:DisplayObject; public var soundOff:DisplayObject; public var balloon1:DisplayObject; public var balloon2:DisplayObject; public var balloon3:DisplayObject; public var firearm:DisplayObject; public var assasin:DisplayObject; public var moreGames:DisplayObject; public var hintCooldownText:DisplayObject; public var value:DisplayObject; public var game:DisplayObject; public var butterfly:DisplayObject; public var caption:DisplayObject; public var back:DisplayObject; public var snake:DisplayObject; public var toMenu:DisplayObject; public var slash:DisplayObject; } }//package screens
Section 137
//ReactionLayout (screens.ReactionLayout) package screens { import common.*; import flash.geom.*; import com.greensock.*; import com.greensock.easing.*; public class ReactionLayout extends Layout { private var _onFinish:Function; public function ReactionLayout(elementClip1:ElementClip, elementClip2:ElementClip, onFinish:Function){ super(); _objects = [elementClip1, elementClip2]; _onFinish = onFinish; } override public function update(prevLayout:Layout):void{ var newElementPoint:Point; var elementClip:ElementClip; var p1:Point; var bezierPoints:Array; var prevLayout = prevLayout; var duration:Number = 0.75; newElementPoint = GraphUtils.centerPoint(); newElementPoint.y = (newElementPoint.y - 30); var timeline:TimelineMax = new TimelineMax({onComplete:function ():void{ Utils.removeChildSafe(_objects[0]); Utils.removeChildSafe(_objects[1]); _objects = _onFinish(newElementPoint); }}); var tweens:Array = []; for each (elementClip in _objects) { p1 = GraphUtils.randomPoint(); p1.x = ((p1.x / 2) + (LayoutManager.inst.displayRect.width / 4)); p1.y = ((p1.y / 2) + (LayoutManager.inst.displayRect.height / 4)); bezierPoints = [{x:p1.x, y:p1.y}, {x:newElementPoint.x, y:newElementPoint.y}]; elementClip.freeze = true; tweens.push(TweenMax.to(elementClip, duration, {bezierThrough:bezierPoints, ease:Linear.easeOut})); }; timeline.appendMultiple(tweens); } } }//package screens
Section 138
//ReactionsLogScreen (screens.ReactionsLogScreen) package screens { import common.*; import flash.events.*; import flash.display.*; import flash.geom.*; import model.*; import com.greensock.*; import common.controls.*; import common.platform.*; import com.greensock.easing.*; public class ReactionsLogScreen extends NonScaledSprite { private var _content:Sprite; private var _ButtonDownClass:Class; private var _ReactionHistoryClass:Class; private var _buttonDown; public var scrollY:Number;// = 0 private var _buttonUp; private var _visibleCount:int;// = 5 private var _rowHeight:Number;// = 60 private var _topIndex:int;// = 0 private var _caption; private var _ButtonUpClass:Class; private var _facebookShare; public static var _EqualClass:Class = ReactionsLogScreen__EqualClass; public static var _PlusClass:Class = ReactionsLogScreen__PlusClass; public function ReactionsLogScreen(){ _ButtonUpClass = ReactionsLogScreen__ButtonUpClass; _ButtonDownClass = ReactionsLogScreen__ButtonDownClass; _ReactionHistoryClass = ReactionsLogScreen__ReactionHistoryClass; _facebookShare = new Main._FacebookShareClass(); super(0x440000, 0); width = 350; height = Platform.wrapper.spaceNormaSize.height; y = Platform.wrapper.spaceNormaSize.top; x = 145; _buttonUp = new _ButtonUpClass(); _buttonDown = new _ButtonDownClass(); _caption = new _ReactionHistoryClass(); _buttonUp.x = ((width - _buttonUp.width) - 30); _buttonUp.y = -15; _buttonUp.alpha = 0.7; _buttonDown.x = ((width - _buttonDown.width) - 30); _buttonDown.y = ((height - _buttonDown.height) + 20); _buttonDown.alpha = 0.7; _caption.x = ((width / 2) - (_caption.width / 2)); _caption.y = 10; _content = new Sprite(); _content.y = 33; _content.x = 8; addChild(_content); addChild(_caption); addChild(_buttonUp); addChild(_buttonDown); _buttonUp.addEventListener(MouseEvent.CLICK, function (e):void{ var oldTopIndex:int = _topIndex; _topIndex = (_topIndex - _visibleCount); if (_topIndex < 0){ _topIndex = 0; }; animateScroll(); updateButtons(); }); _buttonDown.addEventListener(MouseEvent.CLICK, function (e):void{ var oldTopIndex:int = _topIndex; _topIndex = (_topIndex + _visibleCount); if ((_topIndex + _visibleCount) > itemCount){ _topIndex = (itemCount - _visibleCount); }; animateScroll(); updateButtons(); }); SoundManager.inst.registerClickSoundForAllButtons(this); _content.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); _content.addEventListener(MouseEvent.ROLL_OUT, onMouseOut); _facebookShare.visible = false; _facebookShare.addEventListener(MouseEvent.CLICK, function (e:MouseEvent):void{ var reaction:Reaction = _facebookShare.parent["reaction"]; Main.postReactionToFacebook(reaction); }); } private function updateButtons():void{ _buttonUp.visible = (_topIndex > 0); _buttonDown.visible = ((_topIndex + _visibleCount) < itemCount); } private function updateScrollRect():void{ var h:Number = ((_visibleCount * _rowHeight) + 5); var w:Number = 400; _content.scrollRect = new Rectangle(-(_facebookShare.width), scrollY, w, h); } public function update():void{ var reactionObj:Object; var reaction:Reaction; var equationObjects:Array; var x:Number; var row:MovieClip; var obj:DisplayObject; var rect:Rectangle; Utils.removeAllChildren(_content); _content.addChild(_facebookShare); _facebookShare.visible = false; var y:Number = 32; for each (reactionObj in Model.inst.reactionLog) { reaction = reactionObj.reaction; equationObjects = []; equationObjects.push(new ElementClip(reaction.element1)); equationObjects.push(new _PlusClass()); equationObjects.push(new ElementClip(reaction.element2)); equationObjects.push(new _EqualClass()); equationObjects.push(new ElementClip(reaction.result1)); if (reaction.result2 != ""){ equationObjects.push(new _PlusClass()); equationObjects.push(new ElementClip(reaction.result2)); }; if (reaction.result3 != ""){ equationObjects.push(new _PlusClass()); equationObjects.push(new ElementClip(reaction.result3)); }; x = (32 + 10); row = new MovieClip(); row.reaction = reaction; _content.addChild(row); row.y = y; row.x = 0; for each (obj in equationObjects) { if ((obj is InteractiveObject)){ obj["mouseEnabled"] = false; }; row.addChild(obj); if ((obj is ElementClip)){ obj.x = x; obj.y = 0; x = (x + 25); } else { obj.x = x; obj.y = -32; x = (x + 40); }; }; rect = row.getRect(row); row.graphics.beginFill(0, 0); row.graphics.drawRect((rect.left - _facebookShare.width), rect.top, rect.width, rect.height); y = (y + _rowHeight); }; _topIndex = 0; scrollY = 0; updateScrollRect(); updateButtons(); } private function animateScroll():void{ var h:Number; h = ((_visibleCount * _rowHeight) + 5); var newY:Number = (_topIndex * _rowHeight); TweenLite.to(this, 1, {scrollY:newY, overwrite:OverwriteManager.AUTO, ease:Quad.easeOut, onUpdate:function ():void{ _content.scrollRect = new Rectangle(-(_facebookShare.width), scrollY, 400, h); }}); } private function onMouseOut(event:MouseEvent):void{ _facebookShare.visible = false; } private function onMouseMove(event:MouseEvent):void{ var reaction:Reaction; if (("reaction" in event.target)){ reaction = (event.target["reaction"] as Reaction); if (reaction){ event.target.addChild(_facebookShare); _facebookShare.visible = true; _facebookShare.y = -10; _facebookShare.x = -(_facebookShare.width); } else { _facebookShare.visible = false; }; }; } private function get itemCount():int{ return (Model.inst.reactionLog.length); } } }//package screens
Section 139
//ReactionsLogScreen__ButtonDownClass (screens.ReactionsLogScreen__ButtonDownClass) package screens { import flash.display.*; import mx.core.*; public class ReactionsLogScreen__ButtonDownClass extends ButtonAsset { public var elementsCounter:DisplayObject; public var moreGamesTooltip:DisplayObject; public var hintCooldown:DisplayObject; public var dragon:DisplayObject; public var water:DisplayObject; public var subtitle:DisplayObject; public var goal:DisplayObject; public var text:DisplayObject; public var eye:DisplayObject; public var menuBar:DisplayObject; public var fire:DisplayObject; public var halo:DisplayObject; public var bkg:DisplayObject; public var appStore:DisplayObject; public var help:DisplayObject; public var total:DisplayObject; public var newElementRight:DisplayObject; public var air:DisplayObject; public var log:DisplayObject; public var resetWarning:DisplayObject; public var soundOn:DisplayObject; public var reset:DisplayObject; public var earth:DisplayObject; public var clickElement:DisplayObject; public var snake:DisplayObject; public var wheel:DisplayObject; public var hintCaption:DisplayObject; public var submitScore:DisplayObject; public var newElementLeft:DisplayObject; public var hintCooldownText:DisplayObject; public var moreGames:DisplayObject; public var firearm:DisplayObject; public var value:DisplayObject; public var butterfly:DisplayObject; public var toMenu:DisplayObject; public var slash:DisplayObject; public var clickGroupLeft:DisplayObject; public var skip:DisplayObject; public var clickGroupRight:DisplayObject; public var author:DisplayObject; public var hint:DisplayObject; public var score:DisplayObject; public var groupsCounter:DisplayObject; public var appStoreTooltip:DisplayObject; public var alco:DisplayObject; public var assasin:DisplayObject; public var soundOff:DisplayObject; public var balloon1:DisplayObject; public var balloon2:DisplayObject; public var balloon3:DisplayObject; public var caption:DisplayObject; public var back:DisplayObject; public var game:DisplayObject; public var idea:DisplayObject; public var counter:DisplayObject; public var doodleGodComLink:DisplayObject; } }//package screens
Section 140
//ReactionsLogScreen__ButtonUpClass (screens.ReactionsLogScreen__ButtonUpClass) package screens { import flash.display.*; import mx.core.*; public class ReactionsLogScreen__ButtonUpClass extends ButtonAsset { public var elementsCounter:DisplayObject; public var moreGamesTooltip:DisplayObject; public var hintCooldown:DisplayObject; public var dragon:DisplayObject; public var water:DisplayObject; public var subtitle:DisplayObject; public var goal:DisplayObject; public var text:DisplayObject; public var eye:DisplayObject; public var menuBar:DisplayObject; public var fire:DisplayObject; public var halo:DisplayObject; public var bkg:DisplayObject; public var appStore:DisplayObject; public var help:DisplayObject; public var total:DisplayObject; public var newElementRight:DisplayObject; public var air:DisplayObject; public var log:DisplayObject; public var resetWarning:DisplayObject; public var soundOn:DisplayObject; public var reset:DisplayObject; public var earth:DisplayObject; public var clickElement:DisplayObject; public var snake:DisplayObject; public var wheel:DisplayObject; public var hintCaption:DisplayObject; public var submitScore:DisplayObject; public var newElementLeft:DisplayObject; public var hintCooldownText:DisplayObject; public var moreGames:DisplayObject; public var firearm:DisplayObject; public var value:DisplayObject; public var butterfly:DisplayObject; public var toMenu:DisplayObject; public var slash:DisplayObject; public var clickGroupLeft:DisplayObject; public var skip:DisplayObject; public var clickGroupRight:DisplayObject; public var author:DisplayObject; public var hint:DisplayObject; public var score:DisplayObject; public var groupsCounter:DisplayObject; public var appStoreTooltip:DisplayObject; public var alco:DisplayObject; public var assasin:DisplayObject; public var soundOff:DisplayObject; public var balloon1:DisplayObject; public var balloon2:DisplayObject; public var balloon3:DisplayObject; public var caption:DisplayObject; public var back:DisplayObject; public var game:DisplayObject; public var idea:DisplayObject; public var counter:DisplayObject; public var doodleGodComLink:DisplayObject; } }//package screens
Section 141
//ReactionsLogScreen__EqualClass (screens.ReactionsLogScreen__EqualClass) package screens { import mx.core.*; public class ReactionsLogScreen__EqualClass extends BitmapAsset { } }//package screens
Section 142
//ReactionsLogScreen__PlusClass (screens.ReactionsLogScreen__PlusClass) package screens { import mx.core.*; public class ReactionsLogScreen__PlusClass extends BitmapAsset { } }//package screens
Section 143
//ReactionsLogScreen__ReactionHistoryClass (screens.ReactionsLogScreen__ReactionHistoryClass) package screens { import flash.display.*; import mx.core.*; public class ReactionsLogScreen__ReactionHistoryClass extends SpriteAsset { public var elementsCounter:DisplayObject; public var moreGamesTooltip:DisplayObject; public var hintCooldown:DisplayObject; public var dragon:DisplayObject; public var water:DisplayObject; public var subtitle:DisplayObject; public var goal:DisplayObject; public var text:DisplayObject; public var eye:DisplayObject; public var menuBar:DisplayObject; public var fire:DisplayObject; public var halo:DisplayObject; public var bkg:DisplayObject; public var appStore:DisplayObject; public var help:DisplayObject; public var total:DisplayObject; public var newElementRight:DisplayObject; public var air:DisplayObject; public var log:DisplayObject; public var resetWarning:DisplayObject; public var soundOn:DisplayObject; public var reset:DisplayObject; public var earth:DisplayObject; public var clickElement:DisplayObject; public var snake:DisplayObject; public var wheel:DisplayObject; public var hintCaption:DisplayObject; public var submitScore:DisplayObject; public var newElementLeft:DisplayObject; public var hintCooldownText:DisplayObject; public var moreGames:DisplayObject; public var firearm:DisplayObject; public var value:DisplayObject; public var butterfly:DisplayObject; public var toMenu:DisplayObject; public var slash:DisplayObject; public var clickGroupLeft:DisplayObject; public var skip:DisplayObject; public var clickGroupRight:DisplayObject; public var author:DisplayObject; public var hint:DisplayObject; public var score:DisplayObject; public var groupsCounter:DisplayObject; public var appStoreTooltip:DisplayObject; public var alco:DisplayObject; public var assasin:DisplayObject; public var soundOff:DisplayObject; public var balloon1:DisplayObject; public var balloon2:DisplayObject; public var balloon3:DisplayObject; public var caption:DisplayObject; public var back:DisplayObject; public var game:DisplayObject; public var idea:DisplayObject; public var counter:DisplayObject; public var doodleGodComLink:DisplayObject; } }//package screens
Section 144
//ResultLayout (screens.ResultLayout) package screens { import common.*; import flash.geom.*; public class ResultLayout extends Layout { private var _elementClips:Array; public function ResultLayout(elementClips:Array){ var elementClip:ElementClip; super(); _elementClips = []; for each (elementClip in elementClips) { _elementClips.push(elementClip.clone()); }; } override public function update(prevLayout:Layout):void{ var elementClip:ElementClip; var center:Point; var i:int; var groupClip:GroupClip; var width:Number = 0; var groupClips:Array = []; for each (elementClip in _elementClips) { groupClip = new GroupClip(elementClip.element.group); _objects.push(elementClip); _objects.push(groupClip); groupClips.push(groupClip); groupClip.scaleX = 0.9; groupClip.scaleY = 0.9; width = (width + groupClip.width); groupClip.y = (((elementClip.y - (elementClip.height / 2)) - groupClip.height) - 20); groupClip.mouseEnabled = false; elementClip.mouseEnabled = false; }; center = GraphUtils.centerPoint(); i = 0; while (i < groupClips.length) { groupClip = groupClips[i]; groupClip.x = ((center.x - (width / 2)) + (i * groupClip.width)); _elementClips[i].x = (groupClip.x + (groupClip.width / 2)); i++; }; } } }//package screens
Section 145
//Toolbar (screens.Toolbar) package screens { import common.*; import flash.display.*; import model.*; import flash.utils.*; import com.adobe.utils.*; public class Toolbar extends Sprite { private var _toolbar; private var _timerEndMilliseconds:Number; private var _cooldownTimer:uint; private var _ToolbarClass:Class; public function Toolbar(){ _ToolbarClass = Toolbar__ToolbarClass; super(); _toolbar = new _ToolbarClass(); addChild(_toolbar); showMenuButton(true); showHintButton(true); _toolbar.hintCooldown.enabled = false; if (!Model.inst.finalScreenShown){ startCooldown(); }; SoundManager.inst.registerClickSoundForAllButtons(this); } public function get help():SimpleButton{ return (_toolbar.help); } public function get log():SimpleButton{ return (_toolbar.log); } public function showHintButton(show:Boolean):void{ _toolbar.hintCooldown.visible = !(show); _toolbar.hintCooldownText.visible = !(show); _toolbar.hint.visible = show; } public function get back():SimpleButton{ return (_toolbar.back); } public function startCooldown():void{ if (!Model.inst.finalScreenShown){ var onTimer:Function = function ():void{ var secondsLeft:Number = Math.round(((_timerEndMilliseconds - Utils.nowMiliseconds) / 1000)); if (secondsLeft < 0){ secondsLeft = 0; }; GraphUtils.setText(_toolbar.hintCooldownText, ((int((secondsLeft / 60)) + ":") + NumberFormatter.addLeadingZero((secondsLeft % 60)))); if (secondsLeft <= 0){ showHintButton(true); clearInterval(_cooldownTimer); }; }; showHintButton(false); _timerEndMilliseconds = ((Utils.nowMiliseconds + (Model.inst.cooldownSeconds * 1000)) + 300); onTimer(); _cooldownTimer = setInterval(onTimer, 250); }; } public function setReactionLogBalloon(n:int):void{ _toolbar.balloon1.visible = false; _toolbar.balloon2.visible = false; _toolbar.balloon3.visible = false; if (n == 0){ } else { if (n == 1){ _toolbar.balloon1.visible = true; } else { if (n == 2){ _toolbar.balloon2.visible = true; } else { _toolbar.balloon3.visible = true; }; }; }; } public function get toMenu():SimpleButton{ return (_toolbar.toMenu); } public function showMenuButton(show:Boolean):void{ _toolbar.back.visible = !(show); _toolbar.toMenu.visible = show; } public function get hint():SimpleButton{ return (_toolbar.hint); } } }//package screens
Section 146
//Toolbar__ToolbarClass (screens.Toolbar__ToolbarClass) package screens { import flash.display.*; import mx.core.*; public class Toolbar__ToolbarClass extends SpriteAsset { public var counter:DisplayObject; public var elementsCounter:DisplayObject; public var hint:DisplayObject; public var author:DisplayObject; public var assasin:DisplayObject; public var hintCooldown:DisplayObject; public var dragon:DisplayObject; public var groupsCounter:DisplayObject; public var score:DisplayObject; public var appStoreTooltip:DisplayObject; public var text:DisplayObject; public var menuBar:DisplayObject; public var appStore:DisplayObject; public var help:DisplayObject; public var total:DisplayObject; public var reset:DisplayObject; public var resetWarning:DisplayObject; public var soundOn:DisplayObject; public var bkg:DisplayObject; public var alco:DisplayObject; public var submitScore:DisplayObject; public var wheel:DisplayObject; public var log:DisplayObject; public var hintCaption:DisplayObject; public var soundOff:DisplayObject; public var balloon1:DisplayObject; public var balloon2:DisplayObject; public var balloon3:DisplayObject; public var firearm:DisplayObject; public var back:DisplayObject; public var moreGames:DisplayObject; public var hintCooldownText:DisplayObject; public var value:DisplayObject; public var game:DisplayObject; public var butterfly:DisplayObject; public var caption:DisplayObject; public var moreGamesTooltip:DisplayObject; public var doodleGodComLink:DisplayObject; public var snake:DisplayObject; public var toMenu:DisplayObject; public var slash:DisplayObject; } }//package screens
Section 147
//TutorialController (screens.TutorialController) package screens { import common.*; import flash.display.*; import model.*; import com.greensock.*; import com.greensock.easing.*; public class TutorialController { private var _tutorial; private static var _TutorialClass:Class = TutorialController__TutorialClass; public function TutorialController(){ _tutorial = new _TutorialClass(); super(); } public function get newElementRight(){ return (_tutorial.newElementRight); } private function tweenVertical(arrow:DisplayObject, x:Number, y:Number, dy:Number=1):void{ arrow.x = x; arrow.y = (y + (dy * 10)); TweenMax.to(arrow, 0.25, {repeat:-1, yoyo:true, y:y, ease:Quad.easeIn}); } public function get goal(){ return (_tutorial.goal); } public function get newElementLeft(){ return (_tutorial.newElementLeft); } public function get clickGroupRight(){ return (_tutorial.clickGroupRight); } public function update(main:Main):void{ var earthGroupClip:GroupClip = main.getGroupClip("Earth"); var fireGroupClip:GroupClip = main.getGroupClip("Fire"); var earthElementClip:ElementClip = main.getElementClip("Earth"); var fireElementClip:ElementClip = main.getElementClip("Fire"); if ((((main.selectedGroupLeft == null)) && ((main.selectedGroupRight == null)))){ if ((main.currentLayout is GroupsLayout)){ if (!Model.inst.isElementUnlocked("Lava")){ main.space.addChild(goal); GraphUtils.tweenVisible(goal, true, 0.1); tweenVertical(goal, (main.elementsCounter.total.x + (main.elementsCounter.total.width / 2)), (main.elementsCounter.total.y + main.elementsCounter.total.height)); if (fireGroupClip){ main.space.addChild(clickGroupRight); GraphUtils.tweenVisible(clickGroupRight, true, 0.1); tweenHorizontal(clickGroupRight, fireGroupClip.x, (fireGroupClip.y + (fireGroupClip.height / 2))); }; } else { if (Model.inst.elements["Lava"].isUnread){ if (fireGroupClip){ main.space.addChild(newElementRight); GraphUtils.tweenVisible(newElementRight, true, 0.1); tweenHorizontal(newElementRight, fireGroupClip.x, (fireGroupClip.y + (fireGroupClip.height / 2))); }; }; }; } else { if ((main.currentLayout is ResultLayout)){ if (Model.inst.elements["Lava"].isUnread){ if (fireGroupClip){ main.space.addChild(newElementRight); GraphUtils.tweenVisible(newElementRight, true, 0.1); tweenHorizontal(newElementRight, fireGroupClip.x, (fireGroupClip.y + (fireGroupClip.height / 2))); }; }; }; }; } else { if (((!((main.selectedGroupLeft == null))) && ((main.selectedGroupRight == null)))){ if (!Model.inst.isElementUnlocked("Lava")){ if (main.selectedGroupLeft.id == "Fire"){ if (earthGroupClip){ main.space.addChild(clickGroupRight); GraphUtils.tweenVisible(clickGroupRight, true, 0.1); tweenHorizontal(clickGroupRight, earthGroupClip.x, (earthGroupClip.y + (earthGroupClip.height / 2))); }; } else { if (earthGroupClip){ main.space.addChild(clickGroupRight); GraphUtils.tweenVisible(clickGroupRight, true, 0.1); tweenHorizontal(clickGroupRight, fireGroupClip.x, (fireGroupClip.y + (fireGroupClip.height / 2))); }; }; }; } else { if ((((main.selectedGroupLeft == null)) && (!((main.selectedGroupRight == null))))){ if (!Model.inst.isElementUnlocked("Lava")){ if (main.selectedGroupRight.id == "Fire"){ if (earthGroupClip){ main.space.addChild(clickGroupLeft); GraphUtils.tweenVisible(clickGroupLeft, true, 0.1); tweenHorizontal(clickGroupLeft, (earthGroupClip.x + earthGroupClip.width), (earthGroupClip.y + (earthGroupClip.height / 2)), -1); }; } else { if (fireGroupClip){ main.space.addChild(clickGroupLeft); GraphUtils.tweenVisible(clickGroupLeft, true, 0.1); tweenHorizontal(clickGroupLeft, (fireGroupClip.x + fireGroupClip.width), (fireGroupClip.y + (fireGroupClip.height / 2)), -1); }; }; }; } else { if (((((((!((main.selectedGroupLeft == null))) && (!((main.selectedGroupRight == null))))) && (fireElementClip))) && (earthElementClip))){ if (!Model.inst.isElementUnlocked("Lava")){ if (((!((main.selectedElementClipLeft == fireElementClip))) && (!((main.selectedElementClipRight == fireElementClip))))){ main.space.addChild(clickElement); GraphUtils.tweenVisible(clickElement, true, 0.1); tweenVertical(clickElement, fireElementClip.x, (fireElementClip.y + 32)); } else { if (earthElementClip){ main.space.addChild(clickElement); GraphUtils.tweenVisible(clickElement, true, 0.1); tweenVertical(clickElement, earthElementClip.x, (earthElementClip.y + 32)); }; }; }; }; }; }; }; } private function tweenHorizontal(arrow:DisplayObject, x:Number, y:Number, dx:Number=1):void{ arrow.x = (x + (dx * 10)); arrow.y = y; TweenMax.to(arrow, 0.25, {repeat:-1, yoyo:true, x:x, ease:Quad.easeIn}); } public function get clickElement(){ return (_tutorial.clickElement); } public function get clickGroupLeft(){ return (_tutorial.clickGroupLeft); } public function hideAll():void{ Utils.removeChildSafe(goal); TweenLite.killTweensOf(goal); Utils.removeChildSafe(clickElement); TweenLite.killTweensOf(clickElement); Utils.removeChildSafe(newElementLeft); TweenLite.killTweensOf(newElementLeft); Utils.removeChildSafe(newElementRight); TweenLite.killTweensOf(newElementRight); Utils.removeChildSafe(clickGroupLeft); TweenLite.killTweensOf(clickGroupLeft); Utils.removeChildSafe(clickGroupRight); TweenLite.killTweensOf(clickGroupRight); } } }//package screens
Section 148
//TutorialController__TutorialClass (screens.TutorialController__TutorialClass) package screens { import flash.display.*; import mx.core.*; public class TutorialController__TutorialClass extends SpriteAsset { public var elementsCounter:DisplayObject; public var moreGamesTooltip:DisplayObject; public var hintCooldown:DisplayObject; public var dragon:DisplayObject; public var water:DisplayObject; public var subtitle:DisplayObject; public var goal:DisplayObject; public var text:DisplayObject; public var eye:DisplayObject; public var menuBar:DisplayObject; public var fire:DisplayObject; public var halo:DisplayObject; public var bkg:DisplayObject; public var appStore:DisplayObject; public var help:DisplayObject; public var total:DisplayObject; public var newElementRight:DisplayObject; public var air:DisplayObject; public var log:DisplayObject; public var resetWarning:DisplayObject; public var soundOn:DisplayObject; public var reset:DisplayObject; public var earth:DisplayObject; public var clickElement:DisplayObject; public var snake:DisplayObject; public var wheel:DisplayObject; public var hintCaption:DisplayObject; public var submitScore:DisplayObject; public var newElementLeft:DisplayObject; public var hintCooldownText:DisplayObject; public var moreGames:DisplayObject; public var firearm:DisplayObject; public var value:DisplayObject; public var butterfly:DisplayObject; public var toMenu:DisplayObject; public var slash:DisplayObject; public var clickGroupLeft:DisplayObject; public var skip:DisplayObject; public var clickGroupRight:DisplayObject; public var author:DisplayObject; public var hint:DisplayObject; public var score:DisplayObject; public var groupsCounter:DisplayObject; public var appStoreTooltip:DisplayObject; public var alco:DisplayObject; public var assasin:DisplayObject; public var soundOff:DisplayObject; public var balloon1:DisplayObject; public var balloon2:DisplayObject; public var balloon3:DisplayObject; public var caption:DisplayObject; public var back:DisplayObject; public var game:DisplayObject; public var idea:DisplayObject; public var counter:DisplayObject; public var doodleGodComLink:DisplayObject; } }//package screens
Section 149
//Application (Application) package { import common.*; import flash.events.*; import flash.display.*; import model.*; import screens.*; import common.controls.*; import common.platform.*; import assets.*; import flash.ui.*; public class Application extends PlatformApplicationBase { private var _ImagesSWFContent:Class; public static var inst:Application; public function Application(){ var loader:Loader; _ImagesSWFContent = Application__ImagesSWFContent; super(); inst = this; ModalManager.inst = new ModalManager(); ModalManager.inst.topWindow = this; SoundManager.inst = new SoundManager(); Model.inst = new Model(); Model.inst.tryLoadGame(); loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function (e):void{ Images.imagesAppDomain = loader.contentLoaderInfo.applicationDomain; checkAllReady(); }); loader.loadBytes(new _ImagesSWFContent()); } override protected function onAddedToStage():void{ super.onAddedToStage(); LayoutManager.inst = new LayoutManager(stage); } override protected function get allReady():Boolean{ return (((super.allReady) && (Images.imagesAppDomain))); } override protected function onReady():void{ super.onReady(); var main:Main = new Main(); addChild(main); Platform.wrapper.frameRate = 100; var contextMenu:ContextMenu = new ContextMenu(); contextMenu.hideBuiltInItems(); var moreGamesItem:ContextMenuItem = new ContextMenuItem("More Games"); moreGamesItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function (e):void{ MainMenu.onMoreGames(); }); var appStoreItem:ContextMenuItem = new ContextMenuItem("iPhone Version"); appStoreItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function (e):void{ MainMenu.onAppStore(); }); contextMenu.customItems.push(appStoreItem); contextMenu.customItems.push(moreGamesItem); this.contextMenu = contextMenu; } private static function testData():void{ Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[16]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[0]}); Model.inst.reactionLog.push({reaction:Model.inst.reactions[16]}); } } }//package
Section 150
//Application__ImagesSWFContent (Application__ImagesSWFContent) package { import mx.core.*; public class Application__ImagesSWFContent extends ByteArrayAsset { } }//package

Library Items

Symbol 1 Sound {common.SoundManager__MainMusicClass} [music.mp3]
Symbol 2 Sound {common.SoundManager__FlightClass} [flight.wav]
Symbol 3 Sound {common.SoundManager__ElementClickClass} [element_click.wav]
Symbol 4 Sound {common.SoundManager__HintClass} [hint.wav]
Symbol 5 Sound {common.SoundManager__FlashClass} [flash.wav]
Symbol 6 Sound {common.SoundManager__MoveClass} [move.wav]
Symbol 7 Sound {common.SoundManager__NewElementClass} [new_element.wav]
Symbol 8 Sound {common.SoundManager__NoClass} [no.wav]
Symbol 9 Sound {common.SoundManager__ClickClass} [click.wav]
Symbol 10 Sound {common.SoundManager__OldElementClass4} [old_element_v4.wav]
Symbol 11 Sound {common.SoundManager__OldElementClass2} [old_element_v2.wav]
Symbol 12 Sound {common.SoundManager__OldElementClass3} [old_element_v3.wav]
Symbol 13 Sound {common.SoundManager__OldElementClass1} [old_element_v1.wav]
Symbol 14 BitmapUsed by:15
Symbol 15 GraphicUses:14Used by:16
Symbol 16 MovieClipUses:15Used by:50
Symbol 17 FontUsed by:18 42 113 114 115 116 118 120 121 124 125 127 132 134 135 136 137 138 139 140 141 151 153 159 161 200 204 212
Symbol 18 EditableTextUses:17 199Used by:50
Symbol 19 BitmapUsed by:20
Symbol 20 GraphicUses:19Used by:33
Symbol 21 BitmapUsed by:22
Symbol 22 GraphicUses:21Used by:23
Symbol 23 ButtonUses:22Used by:33
Symbol 24 BitmapUsed by:25
Symbol 25 GraphicUses:24Used by:26
Symbol 26 ButtonUses:25Used by:33
Symbol 27 BitmapUsed by:28
Symbol 28 GraphicUses:27Used by:29
Symbol 29 ButtonUses:28Used by:33
Symbol 30 BitmapUsed by:31
Symbol 31 GraphicUses:30Used by:32
Symbol 32 ButtonUses:31Used by:33
Symbol 33 MovieClipUses:20 23 26 29 32Used by:50
Symbol 34 BitmapUsed by:35
Symbol 35 GraphicUses:34Used by:36
Symbol 36 ButtonUses:35Used by:50 123
Symbol 37 BitmapUsed by:38
Symbol 38 GraphicUses:37Used by:39
Symbol 39 ButtonUses:38Used by:50 123
Symbol 40 BitmapUsed by:41
Symbol 41 GraphicUses:40Used by:50
Symbol 42 EditableTextUses:17 199Used by:50
Symbol 43 BitmapUsed by:44
Symbol 44 GraphicUses:43Used by:45
Symbol 45 ButtonUses:44Used by:50
Symbol 46 FontUsed by:47 48 49
Symbol 47 EditableTextUses:46Used by:50
Symbol 48 EditableTextUses:46Used by:50 123
Symbol 49 EditableTextUses:46Used by:50 123
Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass]Uses:16 18 33 36 39 41 42 45 47 48 49
Symbol 51 BitmapUsed by:52
Symbol 52 GraphicUses:51Used by:57
Symbol 53 BitmapUsed by:54
Symbol 54 GraphicUses:53Used by:57
Symbol 55 BitmapUsed by:56
Symbol 56 GraphicUses:55Used by:57
Symbol 57 MovieClipUses:52 54 56Used by:100
Symbol 58 BitmapUsed by:59
Symbol 59 GraphicUses:58Used by:64
Symbol 60 BitmapUsed by:61
Symbol 61 GraphicUses:60Used by:64
Symbol 62 BitmapUsed by:63
Symbol 63 GraphicUses:62Used by:64
Symbol 64 MovieClipUses:59 61 63Used by:100
Symbol 65 BitmapUsed by:66
Symbol 66 GraphicUses:65Used by:71
Symbol 67 BitmapUsed by:68
Symbol 68 GraphicUses:67Used by:71
Symbol 69 BitmapUsed by:70
Symbol 70 GraphicUses:69Used by:71
Symbol 71 MovieClipUses:66 68 70Used by:100
Symbol 72 BitmapUsed by:73
Symbol 73 GraphicUses:72Used by:78
Symbol 74 BitmapUsed by:75
Symbol 75 GraphicUses:74Used by:78
Symbol 76 BitmapUsed by:77
Symbol 77 GraphicUses:76Used by:78
Symbol 78 MovieClipUses:73 75 77Used by:100
Symbol 79 BitmapUsed by:80
Symbol 80 GraphicUses:79Used by:85
Symbol 81 BitmapUsed by:82
Symbol 82 GraphicUses:81Used by:85
Symbol 83 BitmapUsed by:84
Symbol 84 GraphicUses:83Used by:85
Symbol 85 MovieClipUses:80 82 84Used by:100
Symbol 86 BitmapUsed by:87
Symbol 87 GraphicUses:86Used by:92
Symbol 88 BitmapUsed by:89
Symbol 89 GraphicUses:88Used by:92
Symbol 90 BitmapUsed by:91
Symbol 91 GraphicUses:90Used by:92
Symbol 92 MovieClipUses:87 89 91Used by:100
Symbol 93 BitmapUsed by:94
Symbol 94 GraphicUses:93Used by:99
Symbol 95 BitmapUsed by:96
Symbol 96 GraphicUses:95Used by:99
Symbol 97 BitmapUsed by:98
Symbol 98 GraphicUses:97Used by:99
Symbol 99 MovieClipUses:94 96 98Used by:100
Symbol 100 MovieClip {screens.MainMenu__MenuAnimationClass} [MenuAnimationClass]Uses:57 64 71 78 85 92 99
Symbol 101 BitmapUsed by:102
Symbol 102 GraphicUses:101Used by:103
Symbol 103 MovieClip {assets.Images__Balloon2Class} [Balloon2]Uses:102Used by:232
Symbol 104 BitmapUsed by:105
Symbol 105 GraphicUses:104Used by:106
Symbol 106 MovieClip {assets.Images__Balloon3Class} [Balloon3]Uses:105Used by:232
Symbol 107 BitmapUsed by:108
Symbol 108 GraphicUses:107Used by:109
Symbol 109 MovieClip {assets.Images__Balloon1Class} [Balloon1]Uses:108Used by:232
Symbol 110 BitmapUsed by:111
Symbol 111 GraphicUses:110Used by:112
Symbol 112 MovieClipUses:111Used by:123
Symbol 113 EditableTextUses:17 199Used by:123
Symbol 114 EditableTextUses:17 199Used by:117 119
Symbol 115 EditableTextUses:17 199Used by:117
Symbol 116 EditableTextUses:17 199Used by:117 119
Symbol 117 MovieClipUses:114 115 116Used by:123
Symbol 118 EditableTextUses:17 199Used by:119
Symbol 119 MovieClipUses:114 118 116Used by:123
Symbol 120 EditableTextUses:17 199Used by:122
Symbol 121 EditableTextUses:17 199Used by:122
Symbol 122 MovieClipUses:120 121Used by:123
Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass]Uses:112 113 117 119 39 122 36 48 49
Symbol 124 EditableTextUses:17 199Used by:126
Symbol 125 EditableTextUses:17 199Used by:126
Symbol 126 MovieClip {screens.Main__QuoteClass} [QuoteClass]Uses:124 125
Symbol 127 EditableTextUses:17 199Used by:128
Symbol 128 MovieClip {screens.Main__NewElementCreatedClass} [NewElementCreatedClass]Uses:127
Symbol 129 BitmapUsed by:130
Symbol 130 GraphicUses:129Used by:131
Symbol 131 MovieClip {screens.Main__NewElementHaloClass} [NewElementHaloClass]Uses:130
Symbol 132 EditableTextUses:17 199Used by:133
Symbol 133 MovieClip {screens.Main__ClickToContinueClass} [ClickToContinueClass]Uses:132
Symbol 134 EditableTextUses:17 199Used by:142
Symbol 135 EditableTextUses:17 199Used by:142
Symbol 136 EditableTextUses:17 199Used by:142
Symbol 137 EditableTextUses:17 199Used by:142
Symbol 138 EditableTextUses:17 199Used by:142
Symbol 139 EditableTextUses:17 199Used by:142
Symbol 140 EditableTextUses:17 199Used by:142
Symbol 141 EditableTextUses:17 199Used by:142
Symbol 142 MovieClip {screens.Main__FinalScreenClass} [FinalScreenClass]Uses:134 135 136 137 138 139 140 141
Symbol 143 BitmapUsed by:144
Symbol 144 GraphicUses:143Used by:145
Symbol 145 MovieClip {screens.Main__HelpScreenClass} [HelpScreenClass]Uses:144
Symbol 146 BitmapUsed by:147
Symbol 147 GraphicUses:146Used by:148
Symbol 148 Button {screens.Main__FacebookShareClass} [FacebookShareClass]Uses:147
Symbol 149 BitmapUsed by:150
Symbol 150 GraphicUses:149Used by:152 160
Symbol 151 EditableTextUses:17 199Used by:152
Symbol 152 MovieClipUses:150 151Used by:164
Symbol 153 EditableTextUses:17 199Used by:156 158
Symbol 154 BitmapUsed by:155 157
Symbol 155 GraphicUses:154Used by:156 162
Symbol 156 MovieClipUses:153 155Used by:164
Symbol 157 GraphicUses:154Used by:158 163
Symbol 158 MovieClipUses:153 157Used by:164
Symbol 159 EditableTextUses:17 199Used by:160
Symbol 160 MovieClipUses:150 159Used by:164
Symbol 161 EditableTextUses:17 199Used by:162 163
Symbol 162 MovieClipUses:161 155Used by:164
Symbol 163 MovieClipUses:161 157Used by:164
Symbol 164 MovieClip {screens.TutorialController__TutorialClass} [TutorialClass]Uses:152 156 158 160 162 163
Symbol 165 BitmapUsed by:166
Symbol 166 GraphicUses:165Used by:171
Symbol 167 BitmapUsed by:168
Symbol 168 GraphicUses:167Used by:171
Symbol 169 BitmapUsed by:170
Symbol 170 GraphicUses:169Used by:171
Symbol 171 MovieClipUses:166 168 170Used by:206
Symbol 172 BitmapUsed by:173
Symbol 173 GraphicUses:172Used by:178
Symbol 174 BitmapUsed by:175
Symbol 175 GraphicUses:174Used by:178
Symbol 176 BitmapUsed by:177
Symbol 177 GraphicUses:176Used by:178
Symbol 178 MovieClipUses:173 175 177Used by:206
Symbol 179 BitmapUsed by:180
Symbol 180 GraphicUses:179Used by:181
Symbol 181 MovieClipUses:180Used by:206
Symbol 182 BitmapUsed by:183
Symbol 183 GraphicUses:182Used by:184
Symbol 184 MovieClipUses:183Used by:206
Symbol 185 BitmapUsed by:186
Symbol 186 GraphicUses:185Used by:191
Symbol 187 BitmapUsed by:188
Symbol 188 GraphicUses:187Used by:191
Symbol 189 BitmapUsed by:190
Symbol 190 GraphicUses:189Used by:191
Symbol 191 MovieClipUses:186 188 190Used by:206
Symbol 192 BitmapUsed by:193
Symbol 193 GraphicUses:192Used by:198
Symbol 194 BitmapUsed by:195
Symbol 195 GraphicUses:194Used by:198
Symbol 196 BitmapUsed by:197
Symbol 197 GraphicUses:196Used by:198
Symbol 198 MovieClipUses:193 195 197Used by:206
Symbol 199 FontUsed by:18 42 113 114 115 116 118 120 121 124 125 127 132 134 135 136 137 138 139 140 141 151 153 159 161 200 204 212
Symbol 200 EditableTextUses:17 199Used by:206
Symbol 201 BitmapUsed by:202 217
Symbol 202 GraphicUses:201Used by:203
Symbol 203 MovieClipUses:202Used by:206
Symbol 204 EditableTextUses:17 199Used by:205
Symbol 205 ButtonUses:204Used by:206
Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass]Uses:171 178 181 184 191 198 200 203 205
Symbol 207 BitmapUsed by:208 210 230
Symbol 208 GraphicUses:207Used by:209
Symbol 209 Button {screens.ReactionsLogScreen__ButtonDownClass} [ButtonDownClass]Uses:208
Symbol 210 GraphicUses:207Used by:211
Symbol 211 Button {screens.ReactionsLogScreen__ButtonUpClass} [ButtonUpClass]Uses:210
Symbol 212 EditableTextUses:17 199Used by:213
Symbol 213 MovieClip {screens.ReactionsLogScreen__ReactionHistoryClass} [ReactionHistoryClass]Uses:212
Symbol 214 BitmapUsed by:215
Symbol 215 GraphicUses:214Used by:216
Symbol 216 ButtonUses:215Used by:232
Symbol 217 GraphicUses:201Used by:218
Symbol 218 ButtonUses:217Used by:232
Symbol 219 BitmapUsed by:220
Symbol 220 GraphicUses:219Used by:221
Symbol 221 ButtonUses:220Used by:232
Symbol 222 BitmapUsed by:223
Symbol 223 GraphicUses:222Used by:224
Symbol 224 ButtonUses:223Used by:232
Symbol 225 BitmapUsed by:226
Symbol 226 GraphicUses:225Used by:227
Symbol 227 ButtonUses:226Used by:232
Symbol 228 FontUsed by:229
Symbol 229 EditableTextUses:228Used by:232
Symbol 230 GraphicUses:207Used by:231
Symbol 231 ButtonUses:230Used by:232
Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass]Uses:216 218 221 224 109 106 103 227 229 231
Symbol 233 Bitmap {screens.ReactionsLogScreen__PlusClass}
Symbol 234 BinaryData {model.Model__QuotesCSVFileClass}
Symbol 235 BinaryData {Application__ImagesSWFContent}
Symbol 236 Bitmap {screens.ReactionsLogScreen__EqualClass}
Symbol 237 Bitmap {screens.Intro__QuestionClass}
Symbol 238 BinaryData {model.Model__ElementsCSVFileClass}
Symbol 239 BinaryData {model.Model__GroupsCSVFileClass}
Symbol 240 BinaryData {model.Model__ReactionsCSVFileClass}

Instance Names

"reset"Symbol 33 MovieClip Frame 1Symbol 23 Button
"game"Symbol 33 MovieClip Frame 1Symbol 26 Button
"soundOff"Symbol 33 MovieClip Frame 1Symbol 29 Button
"soundOn"Symbol 33 MovieClip Frame 1Symbol 32 Button
"bkg"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 16 MovieClip
"resetWarning"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 18 EditableText
"menuBar"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 33 MovieClip
"moreGames"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 36 Button
"appStore"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 39 Button
"score"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 42 EditableText
"submitScore"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 45 Button
"doodleGodComLink"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 47 EditableText
"moreGamesTooltip"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 48 EditableText
"appStoreTooltip"Symbol 50 MovieClip {screens.MainMenu__MainMenuClass} [MainMenuClass] Frame 1Symbol 49 EditableText
"dragon"Symbol 100 MovieClip {screens.MainMenu__MenuAnimationClass} [MenuAnimationClass] Frame 1Symbol 57 MovieClip
"alco"Symbol 100 MovieClip {screens.MainMenu__MenuAnimationClass} [MenuAnimationClass] Frame 1Symbol 64 MovieClip
"assasin"Symbol 100 MovieClip {screens.MainMenu__MenuAnimationClass} [MenuAnimationClass] Frame 1Symbol 71 MovieClip
"butterfly"Symbol 100 MovieClip {screens.MainMenu__MenuAnimationClass} [MenuAnimationClass] Frame 1Symbol 78 MovieClip
"firearm"Symbol 100 MovieClip {screens.MainMenu__MenuAnimationClass} [MenuAnimationClass] Frame 1Symbol 85 MovieClip
"snake"Symbol 100 MovieClip {screens.MainMenu__MenuAnimationClass} [MenuAnimationClass] Frame 1Symbol 92 MovieClip
"wheel"Symbol 100 MovieClip {screens.MainMenu__MenuAnimationClass} [MenuAnimationClass] Frame 1Symbol 99 MovieClip
"counter"Symbol 117 MovieClip Frame 1Symbol 114 EditableText
"caption"Symbol 117 MovieClip Frame 1Symbol 115 EditableText
"slash"Symbol 117 MovieClip Frame 1Symbol 116 EditableText
"total"Symbol 117 MovieClip Frame 1Symbol 114 EditableText
"counter"Symbol 119 MovieClip Frame 1Symbol 114 EditableText
"caption"Symbol 119 MovieClip Frame 1Symbol 118 EditableText
"slash"Symbol 119 MovieClip Frame 1Symbol 116 EditableText
"total"Symbol 119 MovieClip Frame 1Symbol 114 EditableText
"value"Symbol 122 MovieClip Frame 1Symbol 120 EditableText
"caption"Symbol 122 MovieClip Frame 1Symbol 121 EditableText
"bkg"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 112 MovieClip
"hintCaption"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 113 EditableText
"elementsCounter"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 117 MovieClip
"groupsCounter"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 119 MovieClip
"appStore"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 39 Button
"score"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 122 MovieClip
"moreGames"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 36 Button
"moreGamesTooltip"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 48 EditableText
"appStoreTooltip"Symbol 123 MovieClip {screens.Main__BkgClass} [BkgClass] Frame 1Symbol 49 EditableText
"text"Symbol 126 MovieClip {screens.Main__QuoteClass} [QuoteClass] Frame 1Symbol 124 EditableText
"author"Symbol 126 MovieClip {screens.Main__QuoteClass} [QuoteClass] Frame 1Symbol 125 EditableText
"text"Symbol 128 MovieClip {screens.Main__NewElementCreatedClass} [NewElementCreatedClass] Frame 1Symbol 127 EditableText
"goal"Symbol 164 MovieClip {screens.TutorialController__TutorialClass} [TutorialClass] Frame 1Symbol 152 MovieClip
"clickGroupLeft"Symbol 164 MovieClip {screens.TutorialController__TutorialClass} [TutorialClass] Frame 1Symbol 156 MovieClip
"clickGroupRight"Symbol 164 MovieClip {screens.TutorialController__TutorialClass} [TutorialClass] Frame 1Symbol 158 MovieClip
"clickElement"Symbol 164 MovieClip {screens.TutorialController__TutorialClass} [TutorialClass] Frame 1Symbol 160 MovieClip
"newElementLeft"Symbol 164 MovieClip {screens.TutorialController__TutorialClass} [TutorialClass] Frame 1Symbol 162 MovieClip
"newElementRight"Symbol 164 MovieClip {screens.TutorialController__TutorialClass} [TutorialClass] Frame 1Symbol 163 MovieClip
"earth"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 171 MovieClip
"water"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 178 MovieClip
"halo"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 181 MovieClip
"eye"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 184 MovieClip
"fire"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 191 MovieClip
"air"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 198 MovieClip
"subtitle"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 200 EditableText
"idea"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 203 MovieClip
"skip"Symbol 206 MovieClip {screens.Intro__IntroClass} [IntroClass] Frame 1Symbol 205 Button
"toMenu"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 216 Button
"hint"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 218 Button
"log"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 221 Button
"help"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 224 Button
"balloon1"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 109 MovieClip {assets.Images__Balloon1Class} [Balloon1]
"balloon3"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 106 MovieClip {assets.Images__Balloon3Class} [Balloon3]
"balloon2"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 103 MovieClip {assets.Images__Balloon2Class} [Balloon2]
"hintCooldown"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 227 Button
"hintCooldownText"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 229 EditableText
"back"Symbol 232 MovieClip {screens.Toolbar__ToolbarClass} [ToolbarClass] Frame 1Symbol 231 Button

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 1 as "music.mp3"
ExportAssets (56)Timeline Frame 1Symbol 2 as "flight.wav"
ExportAssets (56)Timeline Frame 1Symbol 3 as "element_click.wav"
ExportAssets (56)Timeline Frame 1Symbol 4 as "hint.wav"
ExportAssets (56)Timeline Frame 1Symbol 5 as "flash.wav"
ExportAssets (56)Timeline Frame 1Symbol 6 as "move.wav"
ExportAssets (56)Timeline Frame 1Symbol 7 as "new_element.wav"
ExportAssets (56)Timeline Frame 1Symbol 8 as "no.wav"
ExportAssets (56)Timeline Frame 1Symbol 9 as "click.wav"
ExportAssets (56)Timeline Frame 1Symbol 10 as "old_element_v4.wav"
ExportAssets (56)Timeline Frame 1Symbol 11 as "old_element_v2.wav"
ExportAssets (56)Timeline Frame 1Symbol 12 as "old_element_v3.wav"
ExportAssets (56)Timeline Frame 1Symbol 13 as "old_element_v1.wav"
ExportAssets (56)Timeline Frame 1Symbol 50 as "MainMenuClass"
ExportAssets (56)Timeline Frame 1Symbol 100 as "MenuAnimationClass"
ExportAssets (56)Timeline Frame 1Symbol 103 as "Balloon2"
ExportAssets (56)Timeline Frame 1Symbol 106 as "Balloon3"
ExportAssets (56)Timeline Frame 1Symbol 109 as "Balloon1"
ExportAssets (56)Timeline Frame 1Symbol 123 as "BkgClass"
ExportAssets (56)Timeline Frame 1Symbol 126 as "QuoteClass"
ExportAssets (56)Timeline Frame 1Symbol 128 as "NewElementCreatedClass"
ExportAssets (56)Timeline Frame 1Symbol 131 as "NewElementHaloClass"
ExportAssets (56)Timeline Frame 1Symbol 133 as "ClickToContinueClass"
ExportAssets (56)Timeline Frame 1Symbol 142 as "FinalScreenClass"
ExportAssets (56)Timeline Frame 1Symbol 145 as "HelpScreenClass"
ExportAssets (56)Timeline Frame 1Symbol 148 as "FacebookShareClass"
ExportAssets (56)Timeline Frame 1Symbol 164 as "TutorialClass"
ExportAssets (56)Timeline Frame 1Symbol 206 as "IntroClass"
ExportAssets (56)Timeline Frame 1Symbol 209 as "ButtonDownClass"
ExportAssets (56)Timeline Frame 1Symbol 211 as "ButtonUpClass"
ExportAssets (56)Timeline Frame 1Symbol 213 as "ReactionHistoryClass"
ExportAssets (56)Timeline Frame 1Symbol 232 as "ToolbarClass"
EnableDebugger2 (64)Timeline Frame 131 bytes "u.$1$QR$3/M30JEGPteFUDE5/QmiW1."
DebugMX1 (63)Timeline Frame 1
SerialNumber (41)Timeline Frame 126 bytes "..........7$......l..[)..."

Labels

"Application"Frame 1




http://swfchan.com/18/85569/info.shtml
Created: 30/3 -2019 20:44:54 Last modified: 30/3 -2019 20:44:54 Server time: 19/04 -2024 07:58:16