Section 1
//HMAC (com.hurlant.crypto.hash.HMAC)
package com.hurlant.crypto.hash {
import flash.utils.*;
public class HMAC {
private var bits:uint;
private var hash:IHash;
public function HMAC(_arg1:IHash, _arg2:uint=0){
this.hash = _arg1;
this.bits = _arg2;
}
public function toString():String{
return ((("hmac-" + ((bits > 0)) ? (bits + "-") : "") + hash.toString()));
}
public function getHashSize():uint{
if (bits != 0){
return ((bits / 8));
};
return (hash.getHashSize());
}
public function compute(_arg1:ByteArray, _arg2:ByteArray):ByteArray{
var _local3:ByteArray;
if (_arg1.length > hash.getInputSize()){
_local3 = hash.hash(_arg1);
} else {
_local3 = new ByteArray();
_local3.writeBytes(_arg1);
};
while (_local3.length < hash.getInputSize()) {
_local3[_local3.length] = 0;
};
var _local4:ByteArray = new ByteArray();
var _local5:ByteArray = new ByteArray();
var _local6:uint;
while (_local6 < _local3.length) {
_local4[_local6] = (_local3[_local6] ^ 54);
_local5[_local6] = (_local3[_local6] ^ 92);
_local6++;
};
_local4.position = _local3.length;
_local4.writeBytes(_arg2);
var _local7:ByteArray = hash.hash(_local4);
_local5.position = _local3.length;
_local5.writeBytes(_local7);
var _local8:ByteArray = hash.hash(_local5);
if ((((bits > 0)) && ((bits < (8 * _local8.length))))){
_local8.length = (bits / 8);
};
return (_local8);
}
public function dispose():void{
hash = null;
bits = 0;
}
}
}//package com.hurlant.crypto.hash
Section 2
//IHash (com.hurlant.crypto.hash.IHash)
package com.hurlant.crypto.hash {
import flash.utils.*;
public interface IHash {
function toString():String;
function getHashSize():uint;
function getInputSize():uint;
function hash(_arg1:ByteArray):ByteArray;
}
}//package com.hurlant.crypto.hash
Section 3
//MD2 (com.hurlant.crypto.hash.MD2)
package com.hurlant.crypto.hash {
import flash.utils.*;
public class MD2 implements IHash {
public static const HASH_SIZE:int = 16;
private static const S:Array = [41, 46, 67, 201, 162, 216, 124, 1, 61, 54, 84, 161, 236, 240, 6, 19, 98, 167, 5, 243, 192, 199, 115, 140, 152, 147, 43, 217, 188, 76, 130, 202, 30, 155, 87, 60, 253, 212, 224, 22, 103, 66, 111, 24, 138, 23, 229, 18, 190, 78, 196, 214, 218, 158, 222, 73, 160, 251, 245, 142, 187, 47, 238, 122, 169, 104, 121, 145, 21, 178, 7, 63, 148, 194, 16, 137, 11, 34, 95, 33, 128, 127, 93, 154, 90, 144, 50, 39, 53, 62, 204, 231, 191, 247, 151, 3, 0xFF, 25, 48, 179, 72, 165, 181, 209, 215, 94, 146, 42, 172, 86, 170, 198, 79, 184, 56, 210, 150, 164, 125, 182, 118, 252, 107, 226, 156, 116, 4, 241, 69, 157, 112, 89, 100, 113, 135, 32, 134, 91, 207, 101, 230, 45, 168, 2, 27, 96, 37, 173, 174, 176, 185, 246, 28, 70, 97, 105, 52, 64, 126, 15, 85, 71, 163, 35, 221, 81, 175, 58, 195, 92, 249, 206, 186, 197, 234, 38, 44, 83, 13, 110, 133, 40, 132, 9, 211, 223, 205, 244, 65, 129, 77, 82, 106, 220, 55, 200, 108, 193, 171, 250, 36, 225, 123, 8, 12, 189, 177, 74, 120, 136, 149, 139, 227, 99, 232, 109, 233, 203, 213, 254, 59, 0, 29, 57, 242, 239, 183, 14, 102, 88, 208, 228, 166, 119, 114, 248, 235, 117, 75, 10, 49, 68, 80, 180, 143, 237, 31, 26, 219, 153, 141, 51, 159, 17, 131, 20];
public function toString():String{
return ("md2");
}
public function getInputSize():uint{
return (16);
}
public function getHashSize():uint{
return (HASH_SIZE);
}
public function hash(_arg1:ByteArray):ByteArray{
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local2:uint = _arg1.length;
var _local3:uint = (((16 - (_arg1.length % 16))) || (16));
do {
_arg1[_arg1.length] = _local3;
} while ((_arg1.length % 16) != 0);
var _local4:uint = _arg1.length;
var _local5:ByteArray = new ByteArray();
var _local6:uint;
_local3 = 0;
while (_local3 < _local4) {
_local8 = 0;
while (_local8 < 16) {
_local6 = (_local5[_local8] = (_local5[_local8] ^ S[(_arg1[(_local3 + _local8)] ^ _local6)]));
_local8++;
};
_local3 = (_local3 + 16);
};
_arg1.position = _arg1.length;
_arg1.writeBytes(_local5);
_local4 = (_local4 + 16);
var _local7:ByteArray = new ByteArray();
_local3 = 0;
while (_local3 < _local4) {
_local8 = 0;
while (_local8 < 16) {
_local7[(32 + _local8)] = ((_local7[(16 + _local8)] = _arg1[(_local3 + _local8)]) ^ _local7[_local8]);
_local8++;
};
_local9 = 0;
_local8 = 0;
while (_local8 < 18) {
_local10 = 0;
while (_local10 < 48) {
_local9 = (_local7[_local10] ^ S[_local9]);
_local7[_local10] = _local9;
_local10++;
};
_local9 = ((_local9 + _local8) & 0xFF);
_local8++;
};
_local3 = (_local3 + 16);
};
_local7.length = 16;
_arg1.length = _local2;
return (_local7);
}
}
}//package com.hurlant.crypto.hash
Section 4
//MD5 (com.hurlant.crypto.hash.MD5)
package com.hurlant.crypto.hash {
import flash.utils.*;
public class MD5 implements IHash {
public static const HASH_SIZE:int = 16;
private function ff(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint):uint{
return (cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private function cmn(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint):uint{
return ((rol((((_arg2 + _arg1) + _arg4) + _arg6), _arg5) + _arg3));
}
private function hh(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint):uint{
return (cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public function getHashSize():uint{
return (HASH_SIZE);
}
public function hash(_arg1:ByteArray):ByteArray{
var _local2:uint = (_arg1.length * 8);
var _local3:String = _arg1.endian;
while ((_arg1.length % 4) != 0) {
_arg1[_arg1.length] = 0;
};
_arg1.position = 0;
var _local4:Array = [];
_arg1.endian = Endian.LITTLE_ENDIAN;
var _local5:uint;
while (_local5 < _arg1.length) {
_local4.push(_arg1.readUnsignedInt());
_local5 = (_local5 + 4);
};
var _local6:Array = core_md5(_local4, _local2);
var _local7:ByteArray = new ByteArray();
_local7.endian = Endian.LITTLE_ENDIAN;
_local5 = 0;
while (_local5 < 4) {
_local7.writeUnsignedInt(_local6[_local5]);
_local5++;
};
_arg1.length = (_local2 / 8);
_arg1.endian = _local3;
return (_local7);
}
private function gg(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint):uint{
return (cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public function toString():String{
return ("md5");
}
public function getInputSize():uint{
return (64);
}
private function rol(_arg1:uint, _arg2:uint):uint{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
private function ii(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint, _arg5:uint, _arg6:uint, _arg7:uint):uint{
return (cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private function core_md5(_arg1:Array, _arg2:uint):Array{
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
var _local3:uint = 1732584193;
var _local4:uint = 4023233417;
var _local5:uint = 2562383102;
var _local6:uint = 271733878;
var _local7:uint;
while (_local7 < _arg1.length) {
_arg1[_local7] = ((_arg1[_local7]) || (0));
_arg1[(_local7 + 1)] = ((_arg1[(_local7 + 1)]) || (0));
_arg1[(_local7 + 2)] = ((_arg1[(_local7 + 2)]) || (0));
_arg1[(_local7 + 3)] = ((_arg1[(_local7 + 3)]) || (0));
_arg1[(_local7 + 4)] = ((_arg1[(_local7 + 4)]) || (0));
_arg1[(_local7 + 5)] = ((_arg1[(_local7 + 5)]) || (0));
_arg1[(_local7 + 6)] = ((_arg1[(_local7 + 6)]) || (0));
_arg1[(_local7 + 7)] = ((_arg1[(_local7 + 7)]) || (0));
_arg1[(_local7 + 8)] = ((_arg1[(_local7 + 8)]) || (0));
_arg1[(_local7 + 9)] = ((_arg1[(_local7 + 9)]) || (0));
_arg1[(_local7 + 10)] = ((_arg1[(_local7 + 10)]) || (0));
_arg1[(_local7 + 11)] = ((_arg1[(_local7 + 11)]) || (0));
_arg1[(_local7 + 12)] = ((_arg1[(_local7 + 12)]) || (0));
_arg1[(_local7 + 13)] = ((_arg1[(_local7 + 13)]) || (0));
_arg1[(_local7 + 14)] = ((_arg1[(_local7 + 14)]) || (0));
_arg1[(_local7 + 15)] = ((_arg1[(_local7 + 15)]) || (0));
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, 3614090360);
_local6 = ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, 3905402710);
_local5 = ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 = ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, 3250441966);
_local3 = ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, 4118548399);
_local6 = ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 = ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, 2821735955);
_local4 = ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, 4249261313);
_local3 = ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 = ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, 2336552879);
_local5 = ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, 4294925233);
_local4 = ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, 2304563134);
_local3 = ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 = ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, 4254626195);
_local5 = ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, 2792965006);
_local4 = ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 = gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, 4129170786);
_local6 = gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, 3225465664);
_local5 = gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 = gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, 3921069994);
_local3 = gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, 3593408605);
_local6 = gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 = gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, 3634488961);
_local4 = gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, 3889429448);
_local3 = gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 = gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, 3275163606);
_local5 = gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, 4107603335);
_local4 = gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 = gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, 2850285829);
_local6 = gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, 4243563512);
_local5 = gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 = gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, 2368359562);
_local3 = hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, 4294588738);
_local6 = hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, 2272392833);
_local5 = hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, 4259657740);
_local3 = hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, 2763975236);
_local6 = hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, 4139469664);
_local4 = hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, 3200236656);
_local3 = hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, 3936430074);
_local5 = hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, 3572445317);
_local4 = hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, 3654602809);
_local6 = hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, 3873151461);
_local5 = hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, 3299628645);
_local3 = ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, 4096336452);
_local6 = ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, 2878612391);
_local4 = ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, 4237533241);
_local3 = ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, 2399980690);
_local5 = ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, 4293915773);
_local4 = ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, 2240044497);
_local3 = ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, 4264355552);
_local5 = ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, 2734768916);
_local4 = ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, 4149444226);
_local6 = ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, 3174756917);
_local5 = ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, 3951481745);
_local3 = (_local3 + _local8);
_local4 = (_local4 + _local9);
_local5 = (_local5 + _local10);
_local6 = (_local6 + _local11);
_local7 = (_local7 + 16);
};
return ([_local3, _local4, _local5, _local6]);
}
}
}//package com.hurlant.crypto.hash
Section 5
//SHA1 (com.hurlant.crypto.hash.SHA1)
package com.hurlant.crypto.hash {
public class SHA1 extends SHABase implements IHash {
public static const HASH_SIZE:int = 20;
override public function toString():String{
return ("sha1");
}
override protected function core(_arg1:Array, _arg2:uint):Array{
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (24 - (_arg2 % 32))));
_arg1[((((_arg2 + 64) >> 9) << 4) + 15)] = _arg2;
var _local3:Array = [];
var _local4:uint = 1732584193;
var _local5:uint = 4023233417;
var _local6:uint = 2562383102;
var _local7:uint = 271733878;
var _local8:uint = 3285377520;
var _local9:uint;
while (_local9 < _arg1.length) {
_local10 = _local4;
_local11 = _local5;
_local12 = _local6;
_local13 = _local7;
_local14 = _local8;
_local15 = 0;
while (_local15 < 80) {
if (_local15 < 16){
_local3[_local15] = ((_arg1[(_local9 + _local15)]) || (0));
} else {
_local3[_local15] = rol((((_local3[(_local15 - 3)] ^ _local3[(_local15 - 8)]) ^ _local3[(_local15 - 14)]) ^ _local3[(_local15 - 16)]), 1);
};
_local16 = ((((rol(_local4, 5) + ft(_local15, _local5, _local6, _local7)) + _local8) + _local3[_local15]) + kt(_local15));
_local8 = _local7;
_local7 = _local6;
_local6 = rol(_local5, 30);
_local5 = _local4;
_local4 = _local16;
_local15++;
};
_local4 = (_local4 + _local10);
_local5 = (_local5 + _local11);
_local6 = (_local6 + _local12);
_local7 = (_local7 + _local13);
_local8 = (_local8 + _local14);
_local9 = (_local9 + 16);
};
return ([_local4, _local5, _local6, _local7, _local8]);
}
private function kt(_arg1:uint):uint{
return (((_arg1)<20) ? 1518500249 : ((_arg1)<40) ? 1859775393 : ((_arg1)<60) ? 2400959708 : 3395469782);
}
override public function getHashSize():uint{
return (HASH_SIZE);
}
private function ft(_arg1:uint, _arg2:uint, _arg3:uint, _arg4:uint):uint{
if (_arg1 < 20){
return (((_arg2 & _arg3) | (~(_arg2) & _arg4)));
};
if (_arg1 < 40){
return (((_arg2 ^ _arg3) ^ _arg4));
};
if (_arg1 < 60){
return ((((_arg2 & _arg3) | (_arg2 & _arg4)) | (_arg3 & _arg4)));
};
return (((_arg2 ^ _arg3) ^ _arg4));
}
private function rol(_arg1:uint, _arg2:uint):uint{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.hurlant.crypto.hash
Section 6
//SHA224 (com.hurlant.crypto.hash.SHA224)
package com.hurlant.crypto.hash {
public class SHA224 extends SHA256 {
public function SHA224(){
h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428];
}
override public function getHashSize():uint{
return (28);
}
override public function toString():String{
return ("sha224");
}
}
}//package com.hurlant.crypto.hash
Section 7
//SHA256 (com.hurlant.crypto.hash.SHA256)
package com.hurlant.crypto.hash {
public class SHA256 extends SHABase implements IHash {
protected var h:Array;
protected static const k:Array = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298];
public function SHA256(){
h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225];
super();
}
override public function toString():String{
return ("sha256");
}
override public function getHashSize():uint{
return (32);
}
protected function rrol(_arg1:uint, _arg2:uint):uint{
return (((_arg1 << (32 - _arg2)) | (_arg1 >>> _arg2)));
}
override protected function core(_arg1:Array, _arg2:uint):Array{
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:uint;
var _local22:uint;
var _local23:uint;
var _local24:uint;
var _local25:uint;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (24 - (_arg2 % 32))));
_arg1[((((_arg2 + 64) >> 9) << 4) + 15)] = _arg2;
var _local3:Array = [];
var _local4:uint = h[0];
var _local5:uint = h[1];
var _local6:uint = h[2];
var _local7:uint = h[3];
var _local8:uint = h[4];
var _local9:uint = h[5];
var _local10:uint = h[6];
var _local11:uint = h[7];
var _local12:uint;
while (_local12 < _arg1.length) {
_local13 = _local4;
_local14 = _local5;
_local15 = _local6;
_local16 = _local7;
_local17 = _local8;
_local18 = _local9;
_local19 = _local10;
_local20 = _local11;
_local21 = 0;
while (_local21 < 64) {
if (_local21 < 16){
_local3[_local21] = ((_arg1[(_local12 + _local21)]) || (0));
} else {
_local24 = ((rrol(_local3[(_local21 - 15)], 7) ^ rrol(_local3[(_local21 - 15)], 18)) ^ (_local3[(_local21 - 15)] >>> 3));
_local25 = ((rrol(_local3[(_local21 - 2)], 17) ^ rrol(_local3[(_local21 - 2)], 19)) ^ (_local3[(_local21 - 2)] >>> 10));
_local3[_local21] = (((_local3[(_local21 - 16)] + _local24) + _local3[(_local21 - 7)]) + _local25);
};
_local22 = (((rrol(_local4, 2) ^ rrol(_local4, 13)) ^ rrol(_local4, 22)) + (((_local4 & _local5) ^ (_local4 & _local6)) ^ (_local5 & _local6)));
_local23 = ((((_local11 + ((rrol(_local8, 6) ^ rrol(_local8, 11)) ^ rrol(_local8, 25))) + ((_local8 & _local9) ^ (_local10 & ~(_local8)))) + k[_local21]) + _local3[_local21]);
_local11 = _local10;
_local10 = _local9;
_local9 = _local8;
_local8 = (_local7 + _local23);
_local7 = _local6;
_local6 = _local5;
_local5 = _local4;
_local4 = (_local23 + _local22);
_local21++;
};
_local4 = (_local4 + _local13);
_local5 = (_local5 + _local14);
_local6 = (_local6 + _local15);
_local7 = (_local7 + _local16);
_local8 = (_local8 + _local17);
_local9 = (_local9 + _local18);
_local10 = (_local10 + _local19);
_local11 = (_local11 + _local20);
_local12 = (_local12 + 16);
};
return ([_local4, _local5, _local6, _local7, _local8, _local9, _local10, _local11]);
}
}
}//package com.hurlant.crypto.hash
Section 8
//SHABase (com.hurlant.crypto.hash.SHABase)
package com.hurlant.crypto.hash {
import flash.utils.*;
public class SHABase implements IHash {
public function toString():String{
return ("sha");
}
public function getInputSize():uint{
return (64);
}
public function getHashSize():uint{
return (0);
}
public function hash(_arg1:ByteArray):ByteArray{
var _local2:uint = _arg1.length;
var _local3:String = _arg1.endian;
_arg1.endian = Endian.BIG_ENDIAN;
var _local4:uint = (_local2 * 8);
while ((_arg1.length % 4) != 0) {
_arg1[_arg1.length] = 0;
};
_arg1.position = 0;
var _local5:Array = [];
var _local6:uint;
while (_local6 < _arg1.length) {
_local5.push(_arg1.readUnsignedInt());
_local6 = (_local6 + 4);
};
var _local7:Array = core(_local5, _local4);
var _local8:ByteArray = new ByteArray();
var _local9:uint = (getHashSize() / 4);
_local6 = 0;
while (_local6 < _local9) {
_local8.writeUnsignedInt(_local7[_local6]);
_local6++;
};
_arg1.length = _local2;
_arg1.endian = _local3;
return (_local8);
}
protected function core(_arg1:Array, _arg2:uint):Array{
return (null);
}
}
}//package com.hurlant.crypto.hash
Section 9
//ARC4 (com.hurlant.crypto.prng.ARC4)
package com.hurlant.crypto.prng {
import flash.utils.*;
import com.hurlant.crypto.symmetric.*;
import com.hurlant.util.*;
public class ARC4 implements IPRNG, IStreamCipher {
private const psize:uint = 0x0100;
private var S:ByteArray;
private var i:int;// = 0
private var j:int;// = 0
public function ARC4(_arg1:ByteArray=null){
S = new ByteArray();
if (_arg1){
init(_arg1);
};
}
public function decrypt(_arg1:ByteArray):void{
encrypt(_arg1);
}
public function init(_arg1:ByteArray):void{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = 0;
while (_local2 < 0x0100) {
S[_local2] = _local2;
_local2++;
};
_local3 = 0;
_local2 = 0;
while (_local2 < 0x0100) {
_local3 = (((_local3 + S[_local2]) + _arg1[(_local2 % _arg1.length)]) & 0xFF);
_local4 = S[_local2];
S[_local2] = S[_local3];
S[_local3] = _local4;
_local2++;
};
this.i = 0;
this.j = 0;
}
public function next():uint{
var _local1:int;
i = ((i + 1) & 0xFF);
j = ((j + S[i]) & 0xFF);
_local1 = S[i];
S[i] = S[j];
S[j] = _local1;
return (S[((_local1 + S[i]) & 0xFF)]);
}
public function encrypt(_arg1:ByteArray):void{
var _local2:uint;
while (_local2 < _arg1.length) {
var _temp1 = _local2;
_local2 = (_local2 + 1);
var _local3 = _temp1;
_arg1[_local3] = (_arg1[_local3] ^ next());
};
}
public function dispose():void{
var _local1:uint;
if (S != null){
_local1 = 0;
while (_local1 < S.length) {
S[_local1] = (Math.random() * 0x0100);
_local1++;
};
S.length = 0;
S = null;
};
this.i = 0;
this.j = 0;
Memory.gc();
}
public function getBlockSize():uint{
return (1);
}
public function getPoolSize():uint{
return (psize);
}
public function toString():String{
return ("rc4");
}
}
}//package com.hurlant.crypto.prng
Section 10
//IPRNG (com.hurlant.crypto.prng.IPRNG)
package com.hurlant.crypto.prng {
import flash.utils.*;
public interface IPRNG {
function init(_arg1:ByteArray):void;
function next():uint;
function getPoolSize():uint;
function toString():String;
function dispose():void;
}
}//package com.hurlant.crypto.prng
Section 11
//Random (com.hurlant.crypto.prng.Random)
package com.hurlant.crypto.prng {
import flash.utils.*;
import com.hurlant.util.*;
import flash.text.*;
import flash.system.*;
public class Random {
private var ready:Boolean;// = false
private var pool:ByteArray;
private var seeded:Boolean;// = false
private var psize:int;
private var state:IPRNG;
private var pptr:int;
public function Random(_arg1:Class=null){
var _local2:uint;
super();
if (_arg1 == null){
_arg1 = ARC4;
};
state = (new (_arg1) as IPRNG);
psize = state.getPoolSize();
pool = new ByteArray();
pptr = 0;
while (pptr < psize) {
_local2 = (65536 * Math.random());
var _local3 = pptr++;
pool[_local3] = (_local2 >>> 8);
var _local4 = pptr++;
pool[_local4] = (_local2 & 0xFF);
};
pptr = 0;
seed();
}
public function autoSeed():void{
var _local3:Font;
var _local1:ByteArray = new ByteArray();
_local1.writeUnsignedInt(System.totalMemory);
_local1.writeUTF(Capabilities.serverString);
_local1.writeUnsignedInt(getTimer());
_local1.writeUnsignedInt(new Date().getTime());
var _local2:Array = Font.enumerateFonts(true);
for each (_local3 in _local2) {
_local1.writeUTF(_local3.fontName);
_local1.writeUTF(_local3.fontStyle);
_local1.writeUTF(_local3.fontType);
};
_local1.position = 0;
while (_local1.bytesAvailable >= 4) {
seed(_local1.readUnsignedInt());
};
}
public function seed(_arg1:int=0):void{
if (_arg1 == 0){
_arg1 = new Date().getTime();
};
var _local2 = pptr++;
pool[_local2] = (pool[_local2] ^ (_arg1 & 0xFF));
var _local3 = pptr++;
pool[_local3] = (pool[_local3] ^ ((_arg1 >> 8) & 0xFF));
var _local4 = pptr++;
pool[_local4] = (pool[_local4] ^ ((_arg1 >> 16) & 0xFF));
var _local5 = pptr++;
pool[_local5] = (pool[_local5] ^ ((_arg1 >> 24) & 0xFF));
pptr = (pptr % psize);
seeded = true;
}
public function toString():String{
return (("random-" + state.toString()));
}
public function dispose():void{
var _local1:uint;
while (_local1 < pool.length) {
pool[_local1] = (Math.random() * 0x0100);
_local1++;
};
pool.length = 0;
pool = null;
state.dispose();
state = null;
psize = 0;
pptr = 0;
Memory.gc();
}
public function nextBytes(_arg1:ByteArray, _arg2:int):void{
while (_arg2--) {
_arg1.writeByte(nextByte());
};
}
public function nextByte():int{
if (!ready){
if (!seeded){
autoSeed();
};
state.init(pool);
pool.length = 0;
pptr = 0;
ready = true;
};
return (state.next());
}
}
}//package com.hurlant.crypto.prng
Section 12
//RSAKey (com.hurlant.crypto.rsa.RSAKey)
package com.hurlant.crypto.rsa {
import flash.utils.*;
import com.hurlant.math.*;
import com.hurlant.crypto.prng.*;
import com.hurlant.util.*;
public class RSAKey {
public var dmp1:BigInteger;
protected var canDecrypt:Boolean;
public var d:BigInteger;
public var e:int;
public var dmq1:BigInteger;
public var n:BigInteger;
public var p:BigInteger;
public var q:BigInteger;
protected var canEncrypt:Boolean;
public var coeff:BigInteger;
public function RSAKey(_arg1:BigInteger, _arg2:int, _arg3:BigInteger=null, _arg4:BigInteger=null, _arg5:BigInteger=null, _arg6:BigInteger=null, _arg7:BigInteger=null, _arg8:BigInteger=null){
this.n = _arg1;
this.e = _arg2;
this.d = _arg3;
this.p = _arg4;
this.q = _arg5;
this.dmp1 = _arg6;
this.dmq1 = _arg7;
this.coeff = _arg8;
canEncrypt = ((!((n == null))) && (!((e == 0))));
canDecrypt = ((canEncrypt) && (!((d == null))));
}
public function verify(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint, _arg4:Function=null):void{
_decrypt(doPublic, _arg1, _arg2, _arg3, _arg4, 1);
}
protected function doPrivate2(_arg1:BigInteger):BigInteger{
if ((((p == null)) && ((q == null)))){
return (_arg1.modPow(d, n));
};
var _local2:BigInteger = _arg1.mod(p).modPow(dmp1, p);
var _local3:BigInteger = _arg1.mod(q).modPow(dmq1, q);
while (_local2.compareTo(_local3) < 0) {
_local2 = _local2.add(p);
};
var _local4:BigInteger = _local2.subtract(_local3).multiply(coeff).mod(p).multiply(q).add(_local3);
return (_local4);
}
public function dump():String{
var _local1 = ((((("N=" + n.toString(16)) + "\n") + "E=") + e.toString(16)) + "\n");
if (canDecrypt){
_local1 = (_local1 + (("D=" + d.toString(16)) + "\n"));
if (((!((p == null))) && (!((q == null))))){
_local1 = (_local1 + (("P=" + p.toString(16)) + "\n"));
_local1 = (_local1 + (("Q=" + q.toString(16)) + "\n"));
_local1 = (_local1 + (("DMP1=" + dmp1.toString(16)) + "\n"));
_local1 = (_local1 + (("DMQ1=" + dmq1.toString(16)) + "\n"));
_local1 = (_local1 + (("IQMP=" + coeff.toString(16)) + "\n"));
};
};
return (_local1);
}
public function decrypt(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint, _arg4:Function=null):void{
_decrypt(doPrivate2, _arg1, _arg2, _arg3, _arg4, 2);
}
private function _decrypt(_arg1:Function, _arg2:ByteArray, _arg3:ByteArray, _arg4:uint, _arg5:Function, _arg6:int):void{
var _local9:BigInteger;
var _local10:BigInteger;
var _local11:ByteArray;
if (_arg5 == null){
_arg5 = pkcs1unpad;
};
if (_arg2.position >= _arg2.length){
_arg2.position = 0;
};
var _local7:uint = getBlockSize();
var _local8:int = (_arg2.position + _arg4);
while (_arg2.position < _local8) {
_local9 = new BigInteger(_arg2, _arg4);
_local10 = _arg1(_local9);
_local11 = _arg5(_local10, _local7);
_arg3.writeBytes(_local11);
};
}
protected function doPublic(_arg1:BigInteger):BigInteger{
return (_arg1.modPowInt(e, n));
}
public function dispose():void{
e = 0;
n.dispose();
n = null;
Memory.gc();
}
private function _encrypt(_arg1:Function, _arg2:ByteArray, _arg3:ByteArray, _arg4:uint, _arg5:Function, _arg6:int):void{
var _local9:BigInteger;
var _local10:BigInteger;
if (_arg5 == null){
_arg5 = pkcs1pad;
};
if (_arg2.position >= _arg2.length){
_arg2.position = 0;
};
var _local7:uint = getBlockSize();
var _local8:int = (_arg2.position + _arg4);
while (_arg2.position < _local8) {
_local9 = new BigInteger(_arg5(_arg2, _local8, _local7, _arg6), _local7);
_local10 = _arg1(_local9);
_local10.toArray(_arg3);
};
}
private function rawpad(_arg1:ByteArray, _arg2:int, _arg3:uint):ByteArray{
return (_arg1);
}
public function encrypt(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint, _arg4:Function=null):void{
_encrypt(doPublic, _arg1, _arg2, _arg3, _arg4, 2);
}
private function pkcs1pad(_arg1:ByteArray, _arg2:int, _arg3:uint, _arg4:uint=2):ByteArray{
var _local9:int;
var _local5:ByteArray = new ByteArray();
var _local6:uint = _arg1.position;
_arg2 = Math.min(_arg2, _arg1.length, ((_local6 + _arg3) - 11));
_arg1.position = _arg2;
var _local7:int = (_arg2 - 1);
while ((((_local7 >= _local6)) && ((_arg3 > 11)))) {
--_arg3;
var _local10 = _arg3;
var _temp1 = _local7;
_local7 = (_local7 - 1);
_local5[_local10] = _arg1[_temp1];
};
--_arg3;
_local10 = _arg3;
_local5[_local10] = 0;
var _local8:Random = new Random();
while (_arg3 > 2) {
_local9 = 0;
while (_local9 == 0) {
_local9 = ((_arg4)==2) ? _local8.nextByte() : 0xFF;
};
--_arg3;
var _local11 = _arg3;
_local5[_local11] = _local9;
};
--_arg3;
_local11 = _arg3;
_local5[_local11] = _arg4;
--_arg3;
var _local12 = _arg3;
_local5[_local12] = 0;
return (_local5);
}
private function pkcs1unpad(_arg1:BigInteger, _arg2:uint, _arg3:uint=2):ByteArray{
var _local4:ByteArray = _arg1.toByteArray();
var _local5:ByteArray = new ByteArray();
var _local6:int;
while ((((_local6 < _local4.length)) && ((_local4[_local6] == 0)))) {
_local6++;
};
if (((!(((_local4.length - _local6) == (_arg2 - 1)))) || ((_local4[_local6] > 2)))){
trace(((("PKCS#1 unpad: i=" + _local6) + ", expected b[i]==[0,1,2], got b[i]=") + _local4[_local6].toString(16)));
return (null);
};
_local6++;
while (_local4[_local6] != 0) {
++_local6;
if (_local6 >= _local4.length){
trace((((("PKCS#1 unpad: i=" + _local6) + ", b[i-1]!=0 (=") + _local4[(_local6 - 1)].toString(16)) + ")"));
return (null);
};
};
while (++_local6 < _local4.length) {
_local5.writeByte(_local4[_local6]);
};
_local5.position = 0;
return (_local5);
}
public function getBlockSize():uint{
return (((n.bitLength() + 7) / 8));
}
public function toString():String{
return ("rsa");
}
public function sign(_arg1:ByteArray, _arg2:ByteArray, _arg3:uint, _arg4:Function=null):void{
_encrypt(doPrivate2, _arg1, _arg2, _arg3, _arg4, 1);
}
protected function doPrivate(_arg1:BigInteger):BigInteger{
if ((((p == null)) || ((q == null)))){
return (_arg1.modPow(d, n));
};
var _local2:BigInteger = _arg1.mod(p).modPow(dmp1, p);
var _local3:BigInteger = _arg1.mod(q).modPow(dmq1, q);
while (_local2.compareTo(_local3) < 0) {
_local2 = _local2.add(p);
};
return (_local2.subtract(_local3).multiply(coeff).mod(p).multiply(q).add(_local3));
}
protected static function bigRandom(_arg1:int, _arg2:Random):BigInteger{
if (_arg1 < 2){
return (BigInteger.nbv(1));
};
var _local3:ByteArray = new ByteArray();
_arg2.nextBytes(_local3, (_arg1 >> 3));
_local3.position = 0;
var _local4:BigInteger = new BigInteger(_local3);
_local4.primify(_arg1, 1);
return (_local4);
}
public static function parsePublicKey(_arg1:String, _arg2:String):RSAKey{
return (new RSAKey(new BigInteger(_arg1, 16), parseInt(_arg2, 16)));
}
public static function generate(_arg1:uint, _arg2:String):RSAKey{
var _local7:BigInteger;
var _local8:BigInteger;
var _local9:BigInteger;
var _local10:BigInteger;
var _local3:Random = new Random();
var _local4:uint = (_arg1 >> 1);
var _local5:RSAKey = new RSAKey(null, 0, null);
_local5.e = parseInt(_arg2, 16);
var _local6:BigInteger = new BigInteger(_arg2, 16);
while (true) {
while (true) {
_local5.p = bigRandom((_arg1 - _local4), _local3);
if ((((_local5.p.subtract(BigInteger.ONE).gcd(_local6).compareTo(BigInteger.ONE) == 0)) && (_local5.p.isProbablePrime(10)))){
break;
};
};
while (true) {
_local5.q = bigRandom(_local4, _local3);
if ((((_local5.q.subtract(BigInteger.ONE).gcd(_local6).compareTo(BigInteger.ONE) == 0)) && (_local5.q.isProbablePrime(10)))){
break;
};
};
if (_local5.p.compareTo(_local5.q) <= 0){
_local10 = _local5.p;
_local5.p = _local5.q;
_local5.q = _local10;
};
_local7 = _local5.p.subtract(BigInteger.ONE);
_local8 = _local5.q.subtract(BigInteger.ONE);
_local9 = _local7.multiply(_local8);
if (_local9.gcd(_local6).compareTo(BigInteger.ONE) == 0){
_local5.n = _local5.p.multiply(_local5.q);
_local5.d = _local6.modInverse(_local9);
_local5.dmp1 = _local5.d.mod(_local7);
_local5.dmq1 = _local5.d.mod(_local8);
_local5.coeff = _local5.q.modInverse(_local5.p);
break;
};
};
return (_local5);
}
public static function parsePrivateKey(_arg1:String, _arg2:String, _arg3:String, _arg4:String=null, _arg5:String=null, _arg6:String=null, _arg7:String=null, _arg8:String=null):RSAKey{
if (_arg4 == null){
return (new RSAKey(new BigInteger(_arg1, 16), parseInt(_arg2, 16), new BigInteger(_arg3, 16)));
};
return (new RSAKey(new BigInteger(_arg1, 16), parseInt(_arg2, 16), new BigInteger(_arg3, 16), new BigInteger(_arg4, 16), new BigInteger(_arg5, 16), new BigInteger(_arg6, 16), new BigInteger(_arg7), new BigInteger(_arg8)));
}
}
}//package com.hurlant.crypto.rsa
Section 13
//AESKey (com.hurlant.crypto.symmetric.AESKey)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
import com.hurlant.crypto.prng.*;
import com.hurlant.util.*;
public class AESKey implements ISymmetricKey {
private var state:ByteArray;
private var tmp:ByteArray;
private var Nr:uint;
private var keyLength:uint;
private var key:ByteArray;
private static const _Xtime2:Array = [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 27, 25, 31, 29, 19, 17, 23, 21, 11, 9, 15, 13, 3, 1, 7, 5, 59, 57, 63, 61, 51, 49, 55, 53, 43, 41, 47, 45, 35, 33, 39, 37, 91, 89, 95, 93, 83, 81, 87, 85, 75, 73, 79, 77, 67, 65, 71, 69, 123, 121, 127, 125, 115, 113, 119, 117, 107, 105, 111, 109, 99, 97, 103, 101, 155, 153, 159, 157, 147, 145, 151, 149, 139, 137, 143, 141, 131, 129, 135, 133, 187, 185, 191, 189, 179, 177, 183, 181, 171, 169, 175, 173, 163, 161, 167, 165, 219, 217, 223, 221, 211, 209, 215, 213, 203, 201, 207, 205, 195, 193, 199, 197, 251, 249, 0xFF, 253, 243, 241, 247, 245, 235, 233, 239, 237, 227, 225, 231, 229];
private static const _Xtime9:Array = [0, 9, 18, 27, 36, 45, 54, 63, 72, 65, 90, 83, 108, 101, 126, 119, 144, 153, 130, 139, 180, 189, 166, 175, 216, 209, 202, 195, 252, 245, 238, 231, 59, 50, 41, 32, 31, 22, 13, 4, 115, 122, 97, 104, 87, 94, 69, 76, 171, 162, 185, 176, 143, 134, 157, 148, 227, 234, 241, 248, 199, 206, 213, 220, 118, 127, 100, 109, 82, 91, 64, 73, 62, 55, 44, 37, 26, 19, 8, 1, 230, 239, 244, 253, 194, 203, 208, 217, 174, 167, 188, 181, 138, 131, 152, 145, 77, 68, 95, 86, 105, 96, 123, 114, 5, 12, 23, 30, 33, 40, 51, 58, 221, 212, 207, 198, 249, 240, 235, 226, 149, 156, 135, 142, 177, 184, 163, 170, 236, 229, 254, 247, 200, 193, 218, 211, 164, 173, 182, 191, 128, 137, 146, 155, 124, 117, 110, 103, 88, 81, 74, 67, 52, 61, 38, 47, 16, 25, 2, 11, 215, 222, 197, 204, 243, 250, 225, 232, 159, 150, 141, 132, 187, 178, 169, 160, 71, 78, 85, 92, 99, 106, 113, 120, 15, 6, 29, 20, 43, 34, 57, 48, 154, 147, 136, 129, 190, 183, 172, 165, 210, 219, 192, 201, 246, 0xFF, 228, 237, 10, 3, 24, 17, 46, 39, 60, 53, 66, 75, 80, 89, 102, 111, 116, 125, 161, 168, 179, 186, 133, 140, 151, 158, 233, 224, 251, 242, 205, 196, 223, 214, 49, 56, 35, 42, 21, 28, 7, 14, 121, 112, 107, 98, 93, 84, 79, 70];
private static const Nb:uint = 4;
private static const _XtimeB:Array = [0, 11, 22, 29, 44, 39, 58, 49, 88, 83, 78, 69, 116, 127, 98, 105, 176, 187, 166, 173, 156, 151, 138, 129, 232, 227, 254, 245, 196, 207, 210, 217, 123, 112, 109, 102, 87, 92, 65, 74, 35, 40, 53, 62, 15, 4, 25, 18, 203, 192, 221, 214, 231, 236, 241, 250, 147, 152, 133, 142, 191, 180, 169, 162, 246, 253, 224, 235, 218, 209, 204, 199, 174, 165, 184, 179, 130, 137, 148, 159, 70, 77, 80, 91, 106, 97, 124, 119, 30, 21, 8, 3, 50, 57, 36, 47, 141, 134, 155, 144, 161, 170, 183, 188, 213, 222, 195, 200, 249, 242, 239, 228, 61, 54, 43, 32, 17, 26, 7, 12, 101, 110, 115, 120, 73, 66, 95, 84, 247, 252, 225, 234, 219, 208, 205, 198, 175, 164, 185, 178, 131, 136, 149, 158, 71, 76, 81, 90, 107, 96, 125, 118, 31, 20, 9, 2, 51, 56, 37, 46, 140, 135, 154, 145, 160, 171, 182, 189, 212, 223, 194, 201, 248, 243, 238, 229, 60, 55, 42, 33, 16, 27, 6, 13, 100, 111, 114, 121, 72, 67, 94, 85, 1, 10, 23, 28, 45, 38, 59, 48, 89, 82, 79, 68, 117, 126, 99, 104, 177, 186, 167, 172, 157, 150, 139, 128, 233, 226, 0xFF, 244, 197, 206, 211, 216, 122, 113, 108, 103, 86, 93, 64, 75, 34, 41, 52, 63, 14, 5, 24, 19, 202, 193, 220, 215, 230, 237, 240, 251, 146, 153, 132, 143, 190, 181, 168, 163];
private static const _XtimeE:Array = [0, 14, 28, 18, 56, 54, 36, 42, 112, 126, 108, 98, 72, 70, 84, 90, 224, 238, 252, 242, 216, 214, 196, 202, 144, 158, 140, 130, 168, 166, 180, 186, 219, 213, 199, 201, 227, 237, 0xFF, 241, 171, 165, 183, 185, 147, 157, 143, 129, 59, 53, 39, 41, 3, 13, 31, 17, 75, 69, 87, 89, 115, 125, 111, 97, 173, 163, 177, 191, 149, 155, 137, 135, 221, 211, 193, 207, 229, 235, 249, 247, 77, 67, 81, 95, 117, 123, 105, 103, 61, 51, 33, 47, 5, 11, 25, 23, 118, 120, 106, 100, 78, 64, 82, 92, 6, 8, 26, 20, 62, 48, 34, 44, 150, 152, 138, 132, 174, 160, 178, 188, 230, 232, 250, 244, 222, 208, 194, 204, 65, 79, 93, 83, 121, 119, 101, 107, 49, 63, 45, 35, 9, 7, 21, 27, 161, 175, 189, 179, 153, 151, 133, 139, 209, 223, 205, 195, 233, 231, 245, 251, 154, 148, 134, 136, 162, 172, 190, 176, 234, 228, 246, 248, 210, 220, 206, 192, 122, 116, 102, 104, 66, 76, 94, 80, 10, 4, 22, 24, 50, 60, 46, 32, 236, 226, 240, 254, 212, 218, 200, 198, 156, 146, 128, 142, 164, 170, 184, 182, 12, 2, 16, 30, 52, 58, 40, 38, 124, 114, 96, 110, 68, 74, 88, 86, 55, 57, 43, 37, 15, 1, 19, 29, 71, 73, 91, 85, 127, 113, 99, 109, 215, 217, 203, 197, 239, 225, 243, 253, 167, 169, 187, 181, 159, 145, 131, 141];
private static const _Xtime2Sbox:Array = [198, 248, 238, 246, 0xFF, 214, 222, 145, 96, 2, 206, 86, 231, 181, 77, 236, 143, 31, 137, 250, 239, 178, 142, 251, 65, 179, 95, 69, 35, 83, 228, 155, 117, 225, 61, 76, 108, 126, 245, 131, 104, 81, 209, 249, 226, 171, 98, 42, 8, 149, 70, 157, 48, 55, 10, 47, 14, 36, 27, 223, 205, 78, 127, 234, 18, 29, 88, 52, 54, 220, 180, 91, 164, 118, 183, 125, 82, 221, 94, 19, 166, 185, 0, 193, 64, 227, 121, 182, 212, 141, 103, 114, 148, 152, 176, 133, 187, 197, 79, 237, 134, 154, 102, 17, 138, 233, 4, 254, 160, 120, 37, 75, 162, 93, 128, 5, 63, 33, 112, 241, 99, 119, 175, 66, 32, 229, 253, 191, 129, 24, 38, 195, 190, 53, 136, 46, 147, 85, 252, 122, 200, 186, 50, 230, 192, 25, 158, 163, 68, 84, 59, 11, 140, 199, 107, 40, 167, 188, 22, 173, 219, 100, 116, 20, 146, 12, 72, 184, 159, 189, 67, 196, 57, 49, 211, 242, 213, 139, 110, 218, 1, 177, 156, 73, 216, 172, 243, 207, 202, 244, 71, 16, 111, 240, 74, 92, 56, 87, 115, 151, 203, 161, 232, 62, 150, 97, 13, 15, 224, 124, 113, 204, 144, 6, 247, 28, 194, 106, 174, 105, 23, 153, 58, 39, 217, 235, 43, 34, 210, 169, 7, 51, 45, 60, 21, 201, 135, 170, 80, 165, 3, 89, 9, 26, 101, 215, 132, 208, 130, 41, 90, 30, 123, 168, 109, 44];
private static const _Xtime3Sbox:Array = [165, 132, 153, 141, 13, 189, 177, 84, 80, 3, 169, 125, 25, 98, 230, 154, 69, 157, 64, 135, 21, 235, 201, 11, 236, 103, 253, 234, 191, 247, 150, 91, 194, 28, 174, 106, 90, 65, 2, 79, 92, 244, 52, 8, 147, 115, 83, 63, 12, 82, 101, 94, 40, 161, 15, 181, 9, 54, 155, 61, 38, 105, 205, 159, 27, 158, 116, 46, 45, 178, 238, 251, 246, 77, 97, 206, 123, 62, 113, 151, 245, 104, 0, 44, 96, 31, 200, 237, 190, 70, 217, 75, 222, 212, 232, 74, 107, 42, 229, 22, 197, 215, 85, 148, 207, 16, 6, 129, 240, 68, 186, 227, 243, 254, 192, 138, 173, 188, 72, 4, 223, 193, 117, 99, 48, 26, 14, 109, 76, 20, 53, 47, 225, 162, 204, 57, 87, 242, 130, 71, 172, 231, 43, 149, 160, 152, 209, 127, 102, 126, 171, 131, 202, 41, 211, 60, 121, 226, 29, 118, 59, 86, 78, 30, 219, 10, 108, 228, 93, 110, 239, 166, 168, 164, 55, 139, 50, 67, 89, 183, 140, 100, 210, 224, 180, 250, 7, 37, 175, 142, 233, 24, 213, 136, 111, 114, 36, 241, 199, 81, 35, 124, 156, 33, 221, 220, 134, 133, 144, 66, 196, 170, 216, 5, 1, 18, 163, 95, 249, 208, 145, 88, 39, 185, 56, 19, 179, 51, 187, 112, 137, 167, 182, 34, 146, 32, 73, 0xFF, 120, 122, 143, 248, 128, 23, 218, 49, 198, 184, 195, 176, 119, 17, 203, 252, 214, 58];
private static const _InvSbox:Array = [82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 0xFF, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125];
private static const _XtimeD:Array = [0, 13, 26, 23, 52, 57, 46, 35, 104, 101, 114, 127, 92, 81, 70, 75, 208, 221, 202, 199, 228, 233, 254, 243, 184, 181, 162, 175, 140, 129, 150, 155, 187, 182, 161, 172, 143, 130, 149, 152, 211, 222, 201, 196, 231, 234, 253, 240, 107, 102, 113, 124, 95, 82, 69, 72, 3, 14, 25, 20, 55, 58, 45, 32, 109, 96, 119, 122, 89, 84, 67, 78, 5, 8, 31, 18, 49, 60, 43, 38, 189, 176, 167, 170, 137, 132, 147, 158, 213, 216, 207, 194, 225, 236, 251, 246, 214, 219, 204, 193, 226, 239, 248, 245, 190, 179, 164, 169, 138, 135, 144, 157, 6, 11, 28, 17, 50, 63, 40, 37, 110, 99, 116, 121, 90, 87, 64, 77, 218, 215, 192, 205, 238, 227, 244, 249, 178, 191, 168, 165, 134, 139, 156, 145, 10, 7, 16, 29, 62, 51, 36, 41, 98, 111, 120, 117, 86, 91, 76, 65, 97, 108, 123, 118, 85, 88, 79, 66, 9, 4, 19, 30, 61, 48, 39, 42, 177, 188, 171, 166, 133, 136, 159, 146, 217, 212, 195, 206, 237, 224, 247, 250, 183, 186, 173, 160, 131, 142, 153, 148, 223, 210, 197, 200, 235, 230, 241, 252, 103, 106, 125, 112, 83, 94, 73, 68, 15, 2, 21, 24, 59, 54, 33, 44, 12, 1, 22, 27, 56, 53, 34, 47, 100, 105, 126, 115, 80, 93, 74, 71, 220, 209, 198, 203, 232, 229, 242, 0xFF, 180, 185, 174, 163, 128, 141, 154, 151];
private static const _Sbox:Array = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 0xFF, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22];
private static var XtimeE:ByteArray = new ByteArray();
private static var i:uint = 0;
private static var Xtime2Sbox:ByteArray = new ByteArray();
private static var Xtime3Sbox:ByteArray = new ByteArray();
private static var _Rcon:Array = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54];
private static var Sbox:ByteArray = new ByteArray();
private static var Rcon:ByteArray = new ByteArray();
private static var InvSbox:ByteArray = new ByteArray();
private static var Xtime2:ByteArray = new ByteArray();
private static var Xtime9:ByteArray = new ByteArray();
private static var XtimeB:ByteArray = new ByteArray();
private static var XtimeD:ByteArray = new ByteArray();
public function AESKey(_arg1:ByteArray){
tmp = new ByteArray();
state = new ByteArray();
keyLength = _arg1.length;
this.key = new ByteArray();
this.key.writeBytes(_arg1);
expandKey();
}
public function toString():String{
return (("aes" + (8 * keyLength)));
}
public function decrypt(_arg1:ByteArray, _arg2:uint=0):void{
var _local3:uint;
state.position = 0;
state.writeBytes(_arg1, _arg2, (Nb * 4));
addRoundKey(key, ((Nr * Nb) * 4));
invShiftRows();
_local3 = Nr;
while (_local3--) {
addRoundKey(key, ((_local3 * Nb) * 4));
if (_local3){
invMixSubColumns();
};
};
_arg1.position = _arg2;
_arg1.writeBytes(state);
}
protected function invMixSubColumns():void{
var _local1:uint;
tmp.length = 0;
tmp[0] = (((XtimeE[state[0]] ^ XtimeB[state[1]]) ^ XtimeD[state[2]]) ^ Xtime9[state[3]]);
tmp[5] = (((Xtime9[state[0]] ^ XtimeE[state[1]]) ^ XtimeB[state[2]]) ^ XtimeD[state[3]]);
tmp[10] = (((XtimeD[state[0]] ^ Xtime9[state[1]]) ^ XtimeE[state[2]]) ^ XtimeB[state[3]]);
tmp[15] = (((XtimeB[state[0]] ^ XtimeD[state[1]]) ^ Xtime9[state[2]]) ^ XtimeE[state[3]]);
tmp[4] = (((XtimeE[state[4]] ^ XtimeB[state[5]]) ^ XtimeD[state[6]]) ^ Xtime9[state[7]]);
tmp[9] = (((Xtime9[state[4]] ^ XtimeE[state[5]]) ^ XtimeB[state[6]]) ^ XtimeD[state[7]]);
tmp[14] = (((XtimeD[state[4]] ^ Xtime9[state[5]]) ^ XtimeE[state[6]]) ^ XtimeB[state[7]]);
tmp[3] = (((XtimeB[state[4]] ^ XtimeD[state[5]]) ^ Xtime9[state[6]]) ^ XtimeE[state[7]]);
tmp[8] = (((XtimeE[state[8]] ^ XtimeB[state[9]]) ^ XtimeD[state[10]]) ^ Xtime9[state[11]]);
tmp[13] = (((Xtime9[state[8]] ^ XtimeE[state[9]]) ^ XtimeB[state[10]]) ^ XtimeD[state[11]]);
tmp[2] = (((XtimeD[state[8]] ^ Xtime9[state[9]]) ^ XtimeE[state[10]]) ^ XtimeB[state[11]]);
tmp[7] = (((XtimeB[state[8]] ^ XtimeD[state[9]]) ^ Xtime9[state[10]]) ^ XtimeE[state[11]]);
tmp[12] = (((XtimeE[state[12]] ^ XtimeB[state[13]]) ^ XtimeD[state[14]]) ^ Xtime9[state[15]]);
tmp[1] = (((Xtime9[state[12]] ^ XtimeE[state[13]]) ^ XtimeB[state[14]]) ^ XtimeD[state[15]]);
tmp[6] = (((XtimeD[state[12]] ^ Xtime9[state[13]]) ^ XtimeE[state[14]]) ^ XtimeB[state[15]]);
tmp[11] = (((XtimeB[state[12]] ^ XtimeD[state[13]]) ^ Xtime9[state[14]]) ^ XtimeE[state[15]]);
_local1 = 0;
while (_local1 < (4 * Nb)) {
state[_local1] = InvSbox[tmp[_local1]];
_local1++;
};
}
protected function invShiftRows():void{
var _local1:uint;
state[0] = InvSbox[state[0]];
state[4] = InvSbox[state[4]];
state[8] = InvSbox[state[8]];
state[12] = InvSbox[state[12]];
_local1 = InvSbox[state[13]];
state[13] = InvSbox[state[9]];
state[9] = InvSbox[state[5]];
state[5] = InvSbox[state[1]];
state[1] = _local1;
_local1 = InvSbox[state[2]];
state[2] = InvSbox[state[10]];
state[10] = _local1;
_local1 = InvSbox[state[6]];
state[6] = InvSbox[state[14]];
state[14] = _local1;
_local1 = InvSbox[state[3]];
state[3] = InvSbox[state[7]];
state[7] = InvSbox[state[11]];
state[11] = InvSbox[state[15]];
state[15] = _local1;
}
public function dispose():void{
var _local1:uint;
var _local2:Random = new Random();
_local1 = 0;
while (_local1 < key.length) {
key[_local1] = _local2.nextByte();
_local1++;
};
Nr = _local2.nextByte();
_local1 = 0;
while (_local1 < state.length) {
state[_local1] = _local2.nextByte();
_local1++;
};
_local1 = 0;
while (_local1 < tmp.length) {
tmp[_local1] = _local2.nextByte();
_local1++;
};
key.length = 0;
keyLength = 0;
state.length = 0;
tmp.length = 0;
key = null;
state = null;
tmp = null;
Nr = 0;
Memory.gc();
}
private function expandKey():void{
var _local1:uint;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:uint = (key.length / 4);
Nr = (_local7 + 6);
_local6 = _local7;
while (_local6 < (Nb * (Nr + 1))) {
_local1 = key[((4 * _local6) - 4)];
_local2 = key[((4 * _local6) - 3)];
_local3 = key[((4 * _local6) - 2)];
_local4 = key[((4 * _local6) - 1)];
if (!(_local6 % _local7)){
_local5 = _local4;
_local4 = Sbox[_local1];
_local1 = (Sbox[_local2] ^ Rcon[(_local6 / _local7)]);
_local2 = Sbox[_local3];
_local3 = Sbox[_local5];
} else {
if ((((_local7 > 6)) && (((_local6 % _local7) == 4)))){
_local1 = Sbox[_local1];
_local2 = Sbox[_local2];
_local3 = Sbox[_local3];
_local4 = Sbox[_local4];
};
};
key[((4 * _local6) + 0)] = (key[(((4 * _local6) - (4 * _local7)) + 0)] ^ _local1);
key[((4 * _local6) + 1)] = (key[(((4 * _local6) - (4 * _local7)) + 1)] ^ _local2);
key[((4 * _local6) + 2)] = (key[(((4 * _local6) - (4 * _local7)) + 2)] ^ _local3);
key[((4 * _local6) + 3)] = (key[(((4 * _local6) - (4 * _local7)) + 3)] ^ _local4);
_local6++;
};
}
protected function addRoundKey(_arg1:ByteArray, _arg2:uint):void{
var _local3:uint;
_local3 = 0;
while (_local3 < 16) {
state[_local3] = (state[_local3] ^ _arg1[(_local3 + _arg2)]);
_local3++;
};
}
public function encrypt(_arg1:ByteArray, _arg2:uint=0):void{
var _local3:uint;
state.position = 0;
state.writeBytes(_arg1, _arg2, (Nb * 4));
addRoundKey(key, 0);
_local3 = 1;
while (_local3 < (Nr + 1)) {
if (_local3 < Nr){
mixSubColumns();
} else {
shiftRows();
};
addRoundKey(key, ((_local3 * Nb) * 4));
_local3++;
};
_arg1.position = _arg2;
_arg1.writeBytes(state);
}
protected function mixSubColumns():void{
tmp.length = 0;
tmp[0] = (((Xtime2Sbox[state[0]] ^ Xtime3Sbox[state[5]]) ^ Sbox[state[10]]) ^ Sbox[state[15]]);
tmp[1] = (((Sbox[state[0]] ^ Xtime2Sbox[state[5]]) ^ Xtime3Sbox[state[10]]) ^ Sbox[state[15]]);
tmp[2] = (((Sbox[state[0]] ^ Sbox[state[5]]) ^ Xtime2Sbox[state[10]]) ^ Xtime3Sbox[state[15]]);
tmp[3] = (((Xtime3Sbox[state[0]] ^ Sbox[state[5]]) ^ Sbox[state[10]]) ^ Xtime2Sbox[state[15]]);
tmp[4] = (((Xtime2Sbox[state[4]] ^ Xtime3Sbox[state[9]]) ^ Sbox[state[14]]) ^ Sbox[state[3]]);
tmp[5] = (((Sbox[state[4]] ^ Xtime2Sbox[state[9]]) ^ Xtime3Sbox[state[14]]) ^ Sbox[state[3]]);
tmp[6] = (((Sbox[state[4]] ^ Sbox[state[9]]) ^ Xtime2Sbox[state[14]]) ^ Xtime3Sbox[state[3]]);
tmp[7] = (((Xtime3Sbox[state[4]] ^ Sbox[state[9]]) ^ Sbox[state[14]]) ^ Xtime2Sbox[state[3]]);
tmp[8] = (((Xtime2Sbox[state[8]] ^ Xtime3Sbox[state[13]]) ^ Sbox[state[2]]) ^ Sbox[state[7]]);
tmp[9] = (((Sbox[state[8]] ^ Xtime2Sbox[state[13]]) ^ Xtime3Sbox[state[2]]) ^ Sbox[state[7]]);
tmp[10] = (((Sbox[state[8]] ^ Sbox[state[13]]) ^ Xtime2Sbox[state[2]]) ^ Xtime3Sbox[state[7]]);
tmp[11] = (((Xtime3Sbox[state[8]] ^ Sbox[state[13]]) ^ Sbox[state[2]]) ^ Xtime2Sbox[state[7]]);
tmp[12] = (((Xtime2Sbox[state[12]] ^ Xtime3Sbox[state[1]]) ^ Sbox[state[6]]) ^ Sbox[state[11]]);
tmp[13] = (((Sbox[state[12]] ^ Xtime2Sbox[state[1]]) ^ Xtime3Sbox[state[6]]) ^ Sbox[state[11]]);
tmp[14] = (((Sbox[state[12]] ^ Sbox[state[1]]) ^ Xtime2Sbox[state[6]]) ^ Xtime3Sbox[state[11]]);
tmp[15] = (((Xtime3Sbox[state[12]] ^ Sbox[state[1]]) ^ Sbox[state[6]]) ^ Xtime2Sbox[state[11]]);
state.position = 0;
state.writeBytes(tmp, 0, (Nb * 4));
}
protected function shiftRows():void{
var _local1:uint;
state[0] = Sbox[state[0]];
state[4] = Sbox[state[4]];
state[8] = Sbox[state[8]];
state[12] = Sbox[state[12]];
_local1 = Sbox[state[1]];
state[1] = Sbox[state[5]];
state[5] = Sbox[state[9]];
state[9] = Sbox[state[13]];
state[13] = _local1;
_local1 = Sbox[state[2]];
state[2] = Sbox[state[10]];
state[10] = _local1;
_local1 = Sbox[state[6]];
state[6] = Sbox[state[14]];
state[14] = _local1;
_local1 = Sbox[state[15]];
state[15] = Sbox[state[11]];
state[11] = Sbox[state[7]];
state[7] = Sbox[state[3]];
state[3] = _local1;
}
public function getBlockSize():uint{
return (16);
}
while (i < 0x0100) {
Sbox[i] = _Sbox[i];
InvSbox[i] = _InvSbox[i];
Xtime2Sbox[i] = _Xtime2Sbox[i];
Xtime3Sbox[i] = _Xtime3Sbox[i];
Xtime2[i] = _Xtime2[i];
Xtime9[i] = _Xtime9[i];
XtimeB[i] = _XtimeB[i];
XtimeD[i] = _XtimeD[i];
XtimeE[i] = _XtimeE[i];
i++;
};
i = 0;
while (i < _Rcon.length) {
Rcon[i] = _Rcon[i];
i++;
};
}
}//package com.hurlant.crypto.symmetric
Section 14
//BlowFishKey (com.hurlant.crypto.symmetric.BlowFishKey)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
import com.hurlant.util.*;
public class BlowFishKey implements ISymmetricKey {
private var S3:Array;
private var P:Array;
private var S1:Array;
private var key:ByteArray;// = null
private var S0:Array;
private var S2:Array;
private static const KP:Array = [608135816, 2242054355, 320440878, 57701188, 2752067618, 698298832, 137296536, 3964562569, 1160258022, 953160567, 3193202383, 887688300, 3232508343, 3380367581, 1065670069, 3041331479, 2450970073, 2306472731];
private static const KS0:Array = [3509652390, 2564797868, 805139163, 3491422135, 3101798381, 1780907670, 3128725573, 4046225305, 614570311, 3012652279, 134345442, 2240740374, 1667834072, 1901547113, 2757295779, 4103290238, 227898511, 1921955416, 1904987480, 2182433518, 2069144605, 3260701109, 2620446009, 720527379, 3318853667, 677414384, 3393288472, 3101374703, 2390351024, 1614419982, 1822297739, 2954791486, 3608508353, 3174124327, 2024746970, 1432378464, 3864339955, 2857741204, 1464375394, 1676153920, 1439316330, 715854006, 3033291828, 289532110, 2706671279, 2087905683, 3018724369, 1668267050, 732546397, 1947742710, 3462151702, 2609353502, 2950085171, 1814351708, 2050118529, 680887927, 999245976, 1800124847, 3300911131, 1713906067, 1641548236, 4213287313, 1216130144, 1575780402, 4018429277, 3917837745, 3693486850, 3949271944, 596196993, 3549867205, 258830323, 2213823033, 772490370, 2760122372, 1774776394, 2652871518, 566650946, 4142492826, 1728879713, 2882767088, 1783734482, 3629395816, 2517608232, 2874225571, 1861159788, 326777828, 3124490320, 2130389656, 2716951837, 967770486, 1724537150, 2185432712, 2364442137, 1164943284, 2105845187, 998989502, 3765401048, 2244026483, 1075463327, 1455516326, 1322494562, 910128902, 469688178, 1117454909, 936433444, 3490320968, 3675253459, 1240580251, 122909385, 2157517691, 634681816, 4142456567, 3825094682, 3061402683, 2540495037, 79693498, 3249098678, 1084186820, 1583128258, 426386531, 1761308591, 1047286709, 322548459, 995290223, 1845252383, 2603652396, 3431023940, 2942221577, 3202600964, 3727903485, 1712269319, 422464435, 3234572375, 1170764815, 3523960633, 3117677531, 1434042557, 442511882, 3600875718, 1076654713, 1738483198, 4213154764, 2393238008, 3677496056, 1014306527, 4251020053, 793779912, 2902807211, 842905082, 4246964064, 1395751752, 1040244610, 2656851899, 3396308128, 445077038, 3742853595, 3577915638, 679411651, 2892444358, 2354009459, 1767581616, 3150600392, 3791627101, 3102740896, 284835224, 4246832056, 1258075500, 768725851, 2589189241, 3069724005, 3532540348, 1274779536, 3789419226, 2764799539, 1660621633, 3471099624, 4011903706, 913787905, 3497959166, 737222580, 2514213453, 2928710040, 3937242737, 1804850592, 3499020752, 2949064160, 2386320175, 2390070455, 2415321851, 4061277028, 2290661394, 2416832540, 1336762016, 1754252060, 3520065937, 3014181293, 791618072, 3188594551, 3933548030, 2332172193, 3852520463, 3043980520, 413987798, 3465142937, 3030929376, 4245938359, 2093235073, 3534596313, 375366246, 2157278981, 2479649556, 555357303, 3870105701, 2008414854, 3344188149, 4221384143, 3956125452, 2067696032, 3594591187, 2921233993, 2428461, 544322398, 577241275, 1471733935, 610547355, 4027169054, 1432588573, 1507829418, 2025931657, 3646575487, 545086370, 48609733, 2200306550, 1653985193, 298326376, 1316178497, 3007786442, 2064951626, 458293330, 2589141269, 3591329599, 3164325604, 727753846, 2179363840, 146436021, 1461446943, 4069977195, 705550613, 3059967265, 3887724982, 4281599278, 3313849956, 1404054877, 2845806497, 146425753, 1854211946];
private static const KS1:Array = [1266315497, 3048417604, 3681880366, 3289982499, 2909710000, 1235738493, 2632868024, 2414719590, 3970600049, 1771706367, 1449415276, 3266420449, 422970021, 1963543593, 2690192192, 3826793022, 1062508698, 1531092325, 1804592342, 2583117782, 2714934279, 4024971509, 1294809318, 4028980673, 1289560198, 2221992742, 1669523910, 35572830, 157838143, 1052438473, 1016535060, 1802137761, 1753167236, 1386275462, 3080475397, 2857371447, 1040679964, 2145300060, 2390574316, 1461121720, 2956646967, 4031777805, 4028374788, 33600511, 2920084762, 1018524850, 629373528, 3691585981, 3515945977, 2091462646, 2486323059, 586499841, 988145025, 935516892, 3367335476, 2599673255, 2839830854, 265290510, 3972581182, 2759138881, 3795373465, 1005194799, 847297441, 406762289, 1314163512, 1332590856, 1866599683, 4127851711, 750260880, 613907577, 1450815602, 3165620655, 3734664991, 3650291728, 3012275730, 3704569646, 1427272223, 778793252, 1343938022, 2676280711, 2052605720, 1946737175, 3164576444, 3914038668, 3967478842, 3682934266, 1661551462, 3294938066, 4011595847, 840292616, 3712170807, 616741398, 312560963, 711312465, 1351876610, 322626781, 1910503582, 271666773, 2175563734, 1594956187, 70604529, 3617834859, 1007753275, 1495573769, 4069517037, 2549218298, 2663038764, 504708206, 2263041392, 3941167025, 2249088522, 1514023603, 1998579484, 1312622330, 694541497, 2582060303, 2151582166, 1382467621, 776784248, 2618340202, 3323268794, 2497899128, 2784771155, 503983604, 4076293799, 907881277, 423175695, 432175456, 1378068232, 4145222326, 3954048622, 3938656102, 3820766613, 2793130115, 2977904593, 26017576, 3274890735, 3194772133, 1700274565, 1756076034, 4006520079, 3677328699, 720338349, 1533947780, 354530856, 688349552, 3973924725, 1637815568, 332179504, 3949051286, 53804574, 2852348879, 3044236432, 1282449977, 3583942155, 3416972820, 4006381244, 1617046695, 2628476075, 3002303598, 1686838959, 431878346, 2686675385, 1700445008, 1080580658, 1009431731, 832498133, 3223435511, 2605976345, 2271191193, 2516031870, 1648197032, 4164389018, 2548247927, 300782431, 375919233, 238389289, 3353747414, 2531188641, 2019080857, 1475708069, 455242339, 2609103871, 448939670, 3451063019, 1395535956, 2413381860, 1841049896, 1491858159, 885456874, 4264095073, 4001119347, 1565136089, 3898914787, 1108368660, 540939232, 1173283510, 2745871338, 3681308437, 4207628240, 3343053890, 4016749493, 1699691293, 1103962373, 3625875870, 2256883143, 3830138730, 1031889488, 3479347698, 1535977030, 4236805024, 3251091107, 2132092099, 1774941330, 1199868427, 1452454533, 157007616, 2904115357, 342012276, 595725824, 1480756522, 206960106, 497939518, 591360097, 863170706, 2375253569, 3596610801, 1814182875, 2094937945, 3421402208, 1082520231, 3463918190, 2785509508, 435703966, 3908032597, 1641649973, 2842273706, 3305899714, 1510255612, 2148256476, 2655287854, 3276092548, 4258621189, 236887753, 3681803219, 274041037, 1734335097, 3815195456, 3317970021, 1899903192, 1026095262, 4050517792, 356393447, 2410691914, 3873677099, 3682840055];
private static const KS3:Array = [976866871, 3556439503, 2881648439, 1522871579, 1555064734, 1336096578, 3548522304, 2579274686, 3574697629, 3205460757, 3593280638, 3338716283, 3079412587, 564236357, 2993598910, 1781952180, 1464380207, 3163844217, 3332601554, 1699332808, 1393555694, 1183702653, 3581086237, 1288719814, 691649499, 2847557200, 2895455976, 3193889540, 2717570544, 1781354906, 1676643554, 2592534050, 3230253752, 1126444790, 2770207658, 2633158820, 2210423226, 2615765581, 2414155088, 3127139286, 673620729, 2805611233, 1269405062, 4015350505, 3341807571, 4149409754, 1057255273, 2012875353, 2162469141, 2276492801, 2601117357, 993977747, 3918593370, 2654263191, 753973209, 36408145, 2530585658, 25011837, 3520020182, 2088578344, 530523599, 2918365339, 1524020338, 1518925132, 3760827505, 3759777254, 1202760957, 3985898139, 3906192525, 674977740, 4174734889, 2031300136, 2019492241, 3983892565, 4153806404, 3822280332, 352677332, 2297720250, 60907813, 90501309, 3286998549, 1016092578, 2535922412, 2839152426, 457141659, 509813237, 4120667899, 652014361, 1966332200, 2975202805, 55981186, 2327461051, 676427537, 3255491064, 2882294119, 3433927263, 1307055953, 942726286, 933058658, 2468411793, 3933900994, 4215176142, 1361170020, 2001714738, 2830558078, 3274259782, 1222529897, 1679025792, 2729314320, 3714953764, 1770335741, 151462246, 3013232138, 1682292957, 1483529935, 471910574, 1539241949, 458788160, 3436315007, 1807016891, 3718408830, 978976581, 1043663428, 3165965781, 1927990952, 4200891579, 2372276910, 3208408903, 3533431907, 1412390302, 2931980059, 4132332400, 1947078029, 3881505623, 4168226417, 2941484381, 1077988104, 1320477388, 886195818, 18198404, 3786409000, 2509781533, 112762804, 3463356488, 1866414978, 891333506, 18488651, 661792760, 1628790961, 3885187036, 3141171499, 876946877, 2693282273, 1372485963, 791857591, 2686433993, 3759982718, 3167212022, 3472953795, 2716379847, 445679433, 3561995674, 3504004811, 3574258232, 54117162, 3331405415, 2381918588, 3769707343, 4154350007, 1140177722, 4074052095, 668550556, 3214352940, 367459370, 261225585, 2610173221, 4209349473, 3468074219, 3265815641, 314222801, 3066103646, 3808782860, 282218597, 3406013506, 3773591054, 379116347, 1285071038, 846784868, 2669647154, 3771962079, 3550491691, 2305946142, 453669953, 1268987020, 3317592352, 3279303384, 3744833421, 2610507566, 3859509063, 266596637, 3847019092, 517658769, 3462560207, 3443424879, 370717030, 4247526661, 2224018117, 4143653529, 4112773975, 2788324899, 2477274417, 1456262402, 2901442914, 1517677493, 1846949527, 2295493580, 3734397586, 2176403920, 1280348187, 1908823572, 3871786941, 846861322, 1172426758, 3287448474, 3383383037, 1655181056, 3139813346, 901632758, 1897031941, 2986607138, 3066810236, 3447102507, 1393639104, 373351379, 950779232, 625454576, 3124240540, 4148612726, 2007998917, 544563296, 2244738638, 2330496472, 2058025392, 1291430526, 424198748, 50039436, 29584100, 3605783033, 2429876329, 2791104160, 1057563949, 3255363231, 3075367218, 3463963227, 1469046755, 985887462];
private static const ROUNDS:uint = 16;
private static const KS2:Array = [3913112168, 2491498743, 4132185628, 2489919796, 1091903735, 1979897079, 3170134830, 3567386728, 3557303409, 857797738, 1136121015, 1342202287, 507115054, 2535736646, 337727348, 3213592640, 1301675037, 2528481711, 1895095763, 1721773893, 3216771564, 62756741, 2142006736, 835421444, 2531993523, 1442658625, 3659876326, 2882144922, 676362277, 1392781812, 170690266, 3921047035, 1759253602, 3611846912, 1745797284, 664899054, 1329594018, 3901205900, 3045908486, 2062866102, 2865634940, 3543621612, 3464012697, 1080764994, 553557557, 3656615353, 3996768171, 991055499, 499776247, 1265440854, 648242737, 3940784050, 980351604, 3713745714, 1749149687, 3396870395, 4211799374, 3640570775, 1161844396, 3125318951, 1431517754, 545492359, 4268468663, 3499529547, 1437099964, 2702547544, 3433638243, 2581715763, 2787789398, 1060185593, 1593081372, 2418618748, 4260947970, 69676912, 2159744348, 86519011, 2512459080, 3838209314, 1220612927, 3339683548, 133810670, 1090789135, 1078426020, 1569222167, 845107691, 3583754449, 4072456591, 1091646820, 628848692, 1613405280, 3757631651, 526609435, 236106946, 48312990, 2942717905, 3402727701, 1797494240, 859738849, 992217954, 4005476642, 2243076622, 3870952857, 3732016268, 765654824, 3490871365, 2511836413, 1685915746, 3888969200, 1414112111, 2273134842, 3281911079, 4080962846, 172450625, 2569994100, 980381355, 4109958455, 2819808352, 2716589560, 2568741196, 3681446669, 3329971472, 1835478071, 660984891, 3704678404, 4045999559, 3422617507, 3040415634, 1762651403, 1719377915, 3470491036, 2693910283, 3642056355, 3138596744, 1364962596, 2073328063, 1983633131, 926494387, 3423689081, 2150032023, 4096667949, 1749200295, 3328846651, 309677260, 2016342300, 1779581495, 3079819751, 111262694, 1274766160, 443224088, 298511866, 1025883608, 3806446537, 1145181785, 168956806, 3641502830, 3584813610, 1689216846, 3666258015, 3200248200, 1692713982, 2646376535, 4042768518, 1618508792, 1610833997, 3523052358, 4130873264, 2001055236, 3610705100, 2202168115, 4028541809, 2961195399, 1006657119, 2006996926, 3186142756, 1430667929, 3210227297, 1314452623, 4074634658, 4101304120, 2273951170, 1399257539, 3367210612, 3027628629, 1190975929, 2062231137, 2333990788, 2221543033, 2438960610, 1181637006, 548689776, 2362791313, 3372408396, 3104550113, 3145860560, 296247880, 1970579870, 3078560182, 3769228297, 1714227617, 3291629107, 3898220290, 166772364, 1251581989, 493813264, 448347421, 195405023, 2709975567, 677966185, 3703036547, 1463355134, 2715995803, 1338867538, 1343315457, 2802222074, 2684532164, 233230375, 2599980071, 2000651841, 3277868038, 1638401717, 4028070440, 3237316320, 6314154, 819756386, 300326615, 590932579, 1405279636, 3267499572, 3150704214, 2428286686, 3959192993, 3461946742, 1862657033, 1266418056, 963775037, 2089974820, 2263052895, 1917689273, 448879540, 3550394620, 3981727096, 150775221, 3627908307, 1303187396, 508620638, 2975983352, 2726630617, 1817252668, 1876281319, 1457606340, 908771278, 3720792119, 3617206836, 2455994898, 1729034894, 1080033504];
private static const BLOCK_SIZE:uint = 8;
private static const P_SZ:uint = 18;
private static const SBOX_SK:uint = 0x0100;
public function BlowFishKey(_arg1:ByteArray){
this.key = _arg1;
setKey(_arg1);
}
private function F(_arg1:uint):uint{
return ((((S0[(_arg1 >>> 24)] + S1[((_arg1 >>> 16) & 0xFF)]) ^ S2[((_arg1 >>> 8) & 0xFF)]) + S3[(_arg1 & 0xFF)]));
}
private function BytesTo32bits(_arg1:ByteArray, _arg2:uint):uint{
return ((((((_arg1[_arg2] & 0xFF) << 24) | ((_arg1[(_arg2 + 1)] & 0xFF) << 16)) | ((_arg1[(_arg2 + 2)] & 0xFF) << 8)) | (_arg1[(_arg2 + 3)] & 0xFF)));
}
private function decryptBlock(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray, _arg4:uint):void{
var _local5:uint = BytesTo32bits(_arg1, _arg2);
var _local6:uint = BytesTo32bits(_arg1, (_arg2 + 4));
_local5 = (_local5 ^ P[(ROUNDS + 1)]);
var _local7:uint = ROUNDS;
while (_local7 > 0) {
_local6 = (_local6 ^ (F(_local5) ^ P[_local7]));
_local5 = (_local5 ^ (F(_local6) ^ P[(_local7 - 1)]));
_local7 = (_local7 - 2);
};
_local6 = (_local6 ^ P[0]);
Bits32ToBytes(_local6, _arg3, _arg4);
Bits32ToBytes(_local5, _arg3, (_arg4 + 4));
}
public function decrypt(_arg1:ByteArray, _arg2:uint=0):void{
decryptBlock(_arg1, _arg2, _arg1, _arg2);
}
public function getBlockSize():uint{
return (BLOCK_SIZE);
}
private function setKey(_arg1:ByteArray):void{
var _local5:uint;
var _local6:uint;
S0 = KS0.concat();
S1 = KS1.concat();
S2 = KS2.concat();
S3 = KS3.concat();
P = KP.concat();
var _local2:uint = _arg1.length;
var _local3:uint;
var _local4:uint;
while (_local4 < P_SZ) {
_local5 = 0;
_local6 = 0;
while (_local6 < 4) {
var _temp1 = _local3;
_local3 = (_local3 + 1);
_local5 = ((_local5 << 8) | (_arg1[_temp1] & 0xFF));
if (_local3 >= _local2){
_local3 = 0;
};
_local6++;
};
P[_local4] = (P[_local4] ^ _local5);
_local4++;
};
processTable(0, 0, P);
processTable(P[(P_SZ - 2)], P[(P_SZ - 1)], S0);
processTable(S0[(SBOX_SK - 2)], S0[(SBOX_SK - 1)], S1);
processTable(S1[(SBOX_SK - 2)], S1[(SBOX_SK - 1)], S2);
processTable(S2[(SBOX_SK - 2)], S2[(SBOX_SK - 1)], S3);
}
private function processTable(_arg1:uint, _arg2:uint, _arg3:Array):void{
var _local6:uint;
var _local4:uint = _arg3.length;
var _local5:uint;
while (_local5 < _local4) {
_arg1 = (_arg1 ^ P[0]);
_local6 = 1;
while (_local6 < ROUNDS) {
_arg2 = (_arg2 ^ (F(_arg1) ^ P[_local6]));
_arg1 = (_arg1 ^ (F(_arg2) ^ P[(_local6 + 1)]));
_local6 = (_local6 + 2);
};
_arg2 = (_arg2 ^ P[(ROUNDS + 1)]);
_arg3[_local5] = _arg2;
_arg3[(_local5 + 1)] = _arg1;
_arg2 = _arg1;
_arg1 = _arg3[_local5];
_local5 = (_local5 + 2);
};
}
public function encrypt(_arg1:ByteArray, _arg2:uint=0):void{
encryptBlock(_arg1, _arg2, _arg1, _arg2);
}
public function dispose():void{
var _local1:uint;
_local1 = 0;
while (_local1 < S0.length) {
S0[_local1] = 0;
_local1++;
};
_local1 = 0;
while (_local1 < S1.length) {
S1[_local1] = 0;
_local1++;
};
_local1 = 0;
while (_local1 < S2.length) {
S2[_local1] = 0;
_local1++;
};
_local1 = 0;
while (_local1 < S3.length) {
S3[_local1] = 0;
_local1++;
};
_local1 = 0;
while (_local1 < P.length) {
P[_local1] = 0;
_local1++;
};
S0 = null;
S1 = null;
S2 = null;
S3 = null;
P = null;
_local1 = 0;
while (_local1 < key.length) {
key[_local1] = 0;
_local1++;
};
key.length = 0;
key = null;
Memory.gc();
}
private function encryptBlock(_arg1:ByteArray, _arg2:uint, _arg3:ByteArray, _arg4:uint):void{
var _local5:uint = BytesTo32bits(_arg1, _arg2);
var _local6:uint = BytesTo32bits(_arg1, (_arg2 + 4));
_local5 = (_local5 ^ P[0]);
var _local7:uint = 1;
while (_local7 < ROUNDS) {
_local6 = (_local6 ^ (F(_local5) ^ P[_local7]));
_local5 = (_local5 ^ (F(_local6) ^ P[(_local7 + 1)]));
_local7 = (_local7 + 2);
};
_local6 = (_local6 ^ P[(ROUNDS + 1)]);
Bits32ToBytes(_local6, _arg3, _arg4);
Bits32ToBytes(_local5, _arg3, (_arg4 + 4));
}
private function Bits32ToBytes(_arg1:uint, _arg2:ByteArray, _arg3:uint):void{
_arg2[(_arg3 + 3)] = _arg1;
_arg2[(_arg3 + 2)] = (_arg1 >> 8);
_arg2[(_arg3 + 1)] = (_arg1 >> 16);
_arg2[_arg3] = (_arg1 >> 24);
}
public function toString():String{
return ("blowfish");
}
}
}//package com.hurlant.crypto.symmetric
Section 15
//CBCMode (com.hurlant.crypto.symmetric.CBCMode)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public class CBCMode extends IVMode implements IMode {
public function CBCMode(_arg1:ISymmetricKey, _arg2:IPad=null){
super(_arg1, _arg2);
}
public function toString():String{
return ((key.toString() + "-cbc"));
}
public function encrypt(_arg1:ByteArray):void{
var _local4:uint;
padding.pad(_arg1);
var _local2:ByteArray = getIV4e();
var _local3:uint;
while (_local3 < _arg1.length) {
_local4 = 0;
while (_local4 < blockSize) {
_arg1[(_local3 + _local4)] = (_arg1[(_local3 + _local4)] ^ _local2[_local4]);
_local4++;
};
key.encrypt(_arg1, _local3);
_local2.position = 0;
_local2.writeBytes(_arg1, _local3, blockSize);
_local3 = (_local3 + blockSize);
};
}
public function decrypt(_arg1:ByteArray):void{
var _local5:uint;
var _local2:ByteArray = getIV4d();
var _local3:ByteArray = new ByteArray();
var _local4:uint;
while (_local4 < _arg1.length) {
_local3.position = 0;
_local3.writeBytes(_arg1, _local4, blockSize);
key.decrypt(_arg1, _local4);
_local5 = 0;
while (_local5 < blockSize) {
_arg1[(_local4 + _local5)] = (_arg1[(_local4 + _local5)] ^ _local2[_local5]);
_local5++;
};
_local2.position = 0;
_local2.writeBytes(_local3, 0, blockSize);
_local4 = (_local4 + blockSize);
};
padding.unpad(_arg1);
}
}
}//package com.hurlant.crypto.symmetric
Section 16
//CFB8Mode (com.hurlant.crypto.symmetric.CFB8Mode)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public class CFB8Mode extends IVMode implements IMode {
public function CFB8Mode(_arg1:ISymmetricKey, _arg2:IPad=null){
super(_arg1, null);
}
public function toString():String{
return ((key.toString() + "-cfb8"));
}
public function encrypt(_arg1:ByteArray):void{
var _local5:uint;
var _local2:ByteArray = getIV4e();
var _local3:ByteArray = new ByteArray();
var _local4:uint;
while (_local4 < _arg1.length) {
_local3.position = 0;
_local3.writeBytes(_local2);
key.encrypt(_local2);
_arg1[_local4] = (_arg1[_local4] ^ _local2[0]);
_local5 = 0;
while (_local5 < (blockSize - 1)) {
_local2[_local5] = _local3[(_local5 + 1)];
_local5++;
};
_local2[(blockSize - 1)] = _arg1[_local4];
_local4++;
};
}
public function decrypt(_arg1:ByteArray):void{
var _local5:uint;
var _local6:uint;
var _local2:ByteArray = getIV4d();
var _local3:ByteArray = new ByteArray();
var _local4:uint;
while (_local4 < _arg1.length) {
_local5 = _arg1[_local4];
_local3.position = 0;
_local3.writeBytes(_local2);
key.encrypt(_local2);
_arg1[_local4] = (_arg1[_local4] ^ _local2[0]);
_local6 = 0;
while (_local6 < (blockSize - 1)) {
_local2[_local6] = _local3[(_local6 + 1)];
_local6++;
};
_local2[(blockSize - 1)] = _local5;
_local4++;
};
}
}
}//package com.hurlant.crypto.symmetric
Section 17
//CFBMode (com.hurlant.crypto.symmetric.CFBMode)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public class CFBMode extends IVMode implements IMode {
public function CFBMode(_arg1:ISymmetricKey, _arg2:IPad=null){
super(_arg1, null);
}
public function toString():String{
return ((key.toString() + "-cfb"));
}
public function encrypt(_arg1:ByteArray):void{
var _local5:uint;
var _local6:uint;
var _local2:uint = _arg1.length;
var _local3:ByteArray = getIV4e();
var _local4:uint;
while (_local4 < _arg1.length) {
key.encrypt(_local3);
_local5 = (((_local4 + blockSize))<_local2) ? blockSize : (_local2 - _local4);
_local6 = 0;
while (_local6 < _local5) {
_arg1[(_local4 + _local6)] = (_arg1[(_local4 + _local6)] ^ _local3[_local6]);
_local6++;
};
_local3.position = 0;
_local3.writeBytes(_arg1, _local4, _local5);
_local4 = (_local4 + blockSize);
};
}
public function decrypt(_arg1:ByteArray):void{
var _local6:uint;
var _local7:uint;
var _local2:uint = _arg1.length;
var _local3:ByteArray = getIV4d();
var _local4:ByteArray = new ByteArray();
var _local5:uint;
while (_local5 < _arg1.length) {
key.encrypt(_local3);
_local6 = (((_local5 + blockSize))<_local2) ? blockSize : (_local2 - _local5);
_local4.position = 0;
_local4.writeBytes(_arg1, _local5, _local6);
_local7 = 0;
while (_local7 < _local6) {
_arg1[(_local5 + _local7)] = (_arg1[(_local5 + _local7)] ^ _local3[_local7]);
_local7++;
};
_local3.position = 0;
_local3.writeBytes(_local4);
_local5 = (_local5 + blockSize);
};
}
}
}//package com.hurlant.crypto.symmetric
Section 18
//CTRMode (com.hurlant.crypto.symmetric.CTRMode)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public class CTRMode extends IVMode implements IMode {
public function CTRMode(_arg1:ISymmetricKey, _arg2:IPad=null){
super(_arg1, _arg2);
}
private function core(_arg1:ByteArray, _arg2:ByteArray):void{
var _local6:uint;
var _local3:ByteArray = new ByteArray();
var _local4:ByteArray = new ByteArray();
_local3.writeBytes(_arg2);
var _local5:uint;
while (_local5 < _arg1.length) {
_local4.position = 0;
_local4.writeBytes(_local3);
key.encrypt(_local4);
_local6 = 0;
while (_local6 < blockSize) {
_arg1[(_local5 + _local6)] = (_arg1[(_local5 + _local6)] ^ _local4[_local6]);
_local6++;
};
_local6 = (blockSize - 1);
while (_local6 >= 0) {
var _local7 = _local3;
var _local8 = _local6;
var _local9 = (_local7[_local8] + 1);
_local7[_local8] = _local9;
if (_local3[_local6] != 0){
break;
};
_local6--;
};
_local5 = (_local5 + blockSize);
};
}
public function toString():String{
return ((key.toString() + "-ctr"));
}
public function encrypt(_arg1:ByteArray):void{
padding.pad(_arg1);
var _local2:ByteArray = getIV4e();
core(_arg1, _local2);
}
public function decrypt(_arg1:ByteArray):void{
var _local2:ByteArray = getIV4d();
core(_arg1, _local2);
padding.unpad(_arg1);
}
}
}//package com.hurlant.crypto.symmetric
Section 19
//DESKey (com.hurlant.crypto.symmetric.DESKey)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
import com.hurlant.util.*;
public class DESKey implements ISymmetricKey {
protected var encKey:Array;
protected var key:ByteArray;
protected var decKey:Array;
private static const SP8:Array = [268439616, 0x1000, 262144, 268701760, 268435456, 268439616, 64, 268435456, 262208, 268697600, 268701760, 266240, 268701696, 266304, 0x1000, 64, 268697600, 268435520, 268439552, 4160, 266240, 262208, 268697664, 268701696, 4160, 0, 0, 268697664, 268435520, 268439552, 266304, 262144, 266304, 262144, 268701696, 0x1000, 64, 268697664, 0x1000, 266304, 268439552, 64, 268435520, 268697600, 268697664, 268435456, 262144, 268439616, 0, 268701760, 262208, 268435520, 268697600, 268439552, 268439616, 0, 268701760, 266240, 266240, 4160, 4160, 262208, 268435456, 268701696];
private static const bytebit:Array = [128, 64, 32, 16, 8, 4, 2, 1];
private static const bigbyte:Array = [0x800000, 0x400000, 0x200000, 0x100000, 524288, 262144, 131072, 65536, 0x8000, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, 0x0100, 128, 64, 32, 16, 8, 4, 2, 1];
private static const pc1:Array = [56, 48, 40, 32, 24, 16, 8, 0, 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 60, 52, 44, 36, 28, 20, 12, 4, 27, 19, 11, 3];
private static const pc2:Array = [13, 16, 10, 23, 0, 4, 2, 27, 14, 5, 20, 9, 22, 18, 11, 3, 25, 7, 15, 6, 26, 19, 12, 1, 40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47, 43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31];
private static const Df_Key:Array = [1, 35, 69, 103, 137, 171, 205, 239, 254, 220, 186, 152, 118, 84, 50, 16, 137, 171, 205, 239, 1, 35, 69, 103];
private static const totrot:Array = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
private static const SP1:Array = [16843776, 0, 65536, 16843780, 16842756, 66564, 4, 65536, 0x0400, 16843776, 16843780, 0x0400, 16778244, 16842756, 16777216, 4, 0x0404, 16778240, 16778240, 66560, 66560, 16842752, 16842752, 16778244, 65540, 16777220, 16777220, 65540, 0, 0x0404, 66564, 16777216, 65536, 16843780, 4, 16842752, 16843776, 16777216, 16777216, 0x0400, 16842756, 65536, 66560, 16777220, 0x0400, 4, 16778244, 66564, 16843780, 65540, 16842752, 16778244, 16777220, 0x0404, 66564, 16843776, 0x0404, 16778240, 16778240, 0, 65540, 66560, 0, 16842756];
private static const SP2:Array = [2148565024, 2147516416, 0x8000, 1081376, 0x100000, 32, 2148532256, 2147516448, 2147483680, 2148565024, 2148564992, 2147483648, 2147516416, 0x100000, 32, 2148532256, 0x108000, 0x100020, 2147516448, 0, 2147483648, 0x8000, 1081376, 2148532224, 0x100020, 2147483680, 0, 0x108000, 32800, 2148564992, 2148532224, 32800, 0, 1081376, 2148532256, 0x100000, 2147516448, 2148532224, 2148564992, 0x8000, 2148532224, 2147516416, 32, 2148565024, 1081376, 32, 0x8000, 2147483648, 32800, 2148564992, 0x100000, 2147483680, 0x100020, 2147516448, 2147483680, 0x100020, 0x108000, 0, 2147516416, 32800, 2147483648, 2148532256, 2148565024, 0x108000];
private static const SP3:Array = [520, 134349312, 0, 134348808, 134218240, 0, 131592, 134218240, 131080, 134217736, 134217736, 131072, 134349320, 131080, 134348800, 520, 134217728, 8, 134349312, 0x0200, 131584, 134348800, 134348808, 131592, 134218248, 131584, 131072, 134218248, 8, 134349320, 0x0200, 134217728, 134349312, 134217728, 131080, 520, 131072, 134349312, 134218240, 0, 0x0200, 131080, 134349320, 134218240, 134217736, 0x0200, 0, 134348808, 134218248, 131072, 134217728, 134349320, 8, 131592, 131584, 134217736, 134348800, 134218248, 520, 134348800, 131592, 8, 134348808, 131584];
private static const SP4:Array = [8396801, 8321, 8321, 128, 8396928, 0x800081, 0x800001, 8193, 0, 0x802000, 0x802000, 8396929, 129, 0, 0x800080, 0x800001, 1, 0x2000, 0x800000, 8396801, 128, 0x800000, 8193, 8320, 0x800081, 1, 8320, 0x800080, 0x2000, 8396928, 8396929, 129, 0x800080, 0x800001, 0x802000, 8396929, 129, 0, 0, 0x802000, 8320, 0x800080, 0x800081, 1, 8396801, 8321, 8321, 128, 8396929, 129, 1, 0x2000, 0x800001, 8193, 8396928, 0x800081, 8193, 8320, 0x800000, 8396801, 128, 0x800000, 0x2000, 8396928];
private static const SP5:Array = [0x0100, 34078976, 34078720, 1107296512, 524288, 0x0100, 1073741824, 34078720, 1074266368, 524288, 33554688, 1074266368, 1107296512, 1107820544, 524544, 1073741824, 33554432, 1074266112, 1074266112, 0, 1073742080, 1107820800, 1107820800, 33554688, 1107820544, 1073742080, 0, 1107296256, 34078976, 33554432, 1107296256, 524544, 524288, 1107296512, 0x0100, 33554432, 1073741824, 34078720, 1107296512, 1074266368, 33554688, 1073741824, 1107820544, 34078976, 1074266368, 0x0100, 33554432, 1107820544, 1107820800, 524544, 1107296256, 1107820800, 34078720, 0, 1074266112, 1107296256, 524544, 33554688, 1073742080, 524288, 0, 1074266112, 34078976, 1073742080];
private static const SP6:Array = [536870928, 541065216, 0x4000, 541081616, 541065216, 16, 541081616, 0x400000, 536887296, 4210704, 0x400000, 536870928, 0x400010, 536887296, 536870912, 16400, 0, 0x400010, 536887312, 0x4000, 0x404000, 536887312, 16, 541065232, 541065232, 0, 4210704, 541081600, 16400, 0x404000, 541081600, 536870912, 536887296, 16, 541065232, 0x404000, 541081616, 0x400000, 16400, 536870928, 0x400000, 536887296, 536870912, 16400, 536870928, 541081616, 0x404000, 541065216, 4210704, 541081600, 0, 541065232, 16, 0x4000, 541065216, 4210704, 0x4000, 0x400010, 536887312, 0, 541081600, 536870912, 0x400010, 536887312];
private static const SP7:Array = [0x200000, 69206018, 67110914, 0, 0x0800, 67110914, 2099202, 69208064, 69208066, 0x200000, 0, 67108866, 2, 67108864, 69206018, 2050, 67110912, 2099202, 0x200002, 67110912, 67108866, 69206016, 69208064, 0x200002, 69206016, 0x0800, 2050, 69208066, 0x200800, 2, 67108864, 0x200800, 67108864, 0x200800, 0x200000, 67110914, 67110914, 69206018, 69206018, 2, 0x200002, 67108864, 67110912, 0x200000, 69208064, 2050, 2099202, 69208064, 2050, 67108866, 69208066, 69206016, 0x200800, 0, 2, 69208066, 0, 2099202, 69206016, 0x0800, 67108866, 67110912, 0x0800, 0x200002];
public function DESKey(_arg1:ByteArray){
this.key = _arg1;
this.encKey = generateWorkingKey(true, _arg1, 0);
this.decKey = generateWorkingKey(false, _arg1, 0);
}
protected function generateWorkingKey(_arg1:Boolean, _arg2:ByteArray, _arg3:uint):Array{
var _local7:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local4:Array = [];
var _local5:ByteArray = new ByteArray();
var _local6:ByteArray = new ByteArray();
var _local8:uint;
while (_local8 < 56) {
_local7 = pc1[_local8];
_local5[_local8] = !(((_arg2[(_arg3 + (_local7 >>> 3))] & bytebit[(_local7 & 7)]) == 0));
_local8++;
};
var _local9:uint;
while (_local9 < 16) {
if (_arg1){
_local10 = (_local9 << 1);
} else {
_local10 = ((15 - _local9) << 1);
};
_local11 = (_local10 + 1);
_local4[_local10] = (_local4[_local11] = 0);
_local8 = 0;
while (_local8 < 28) {
_local7 = (_local8 + totrot[_local9]);
if (_local7 < 28){
_local6[_local8] = _local5[_local7];
} else {
_local6[_local8] = _local5[(_local7 - 28)];
};
_local8++;
};
_local8 = 28;
while (_local8 < 56) {
_local7 = (_local8 + totrot[_local9]);
if (_local7 < 56){
_local6[_local8] = _local5[_local7];
} else {
_local6[_local8] = _local5[(_local7 - 28)];
};
_local8++;
};
_local8 = 0;
while (_local8 < 24) {
if (_local6[pc2[_local8]]){
_local4[_local10] = (_local4[_local10] | bigbyte[_local8]);
};
if (_local6[pc2[(_local8 + 24)]]){
_local4[_local11] = (_local4[_local11] | bigbyte[_local8]);
};
_local8++;
};
_local9++;
};
_local9 = 0;
while (_local9 != 32) {
_local12 = _local4[_local9];
_local13 = _local4[(_local9 + 1)];
_local4[_local9] = (((((_local12 & 0xFC0000) << 6) | ((_local12 & 4032) << 10)) | ((_local13 & 0xFC0000) >>> 10)) | ((_local13 & 4032) >>> 6));
_local4[(_local9 + 1)] = (((((_local12 & 258048) << 12) | ((_local12 & 63) << 16)) | ((_local13 & 258048) >>> 4)) | (_local13 & 63));
_local9 = (_local9 + 2);
};
return (_local4);
}
public function getBlockSize():uint{
return (8);
}
public function encrypt(_arg1:ByteArray, _arg2:uint=0):void{
desFunc(encKey, _arg1, _arg2, _arg1, _arg2);
}
public function decrypt(_arg1:ByteArray, _arg2:uint=0):void{
desFunc(decKey, _arg1, _arg2, _arg1, _arg2);
}
protected function desFunc(_arg1:Array, _arg2:ByteArray, _arg3:uint, _arg4:ByteArray, _arg5:uint):void{
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local10:uint;
_local8 = ((_arg2[(_arg3 + 0)] & 0xFF) << 24);
_local8 = (_local8 | ((_arg2[(_arg3 + 1)] & 0xFF) << 16));
_local8 = (_local8 | ((_arg2[(_arg3 + 2)] & 0xFF) << 8));
_local8 = (_local8 | (_arg2[(_arg3 + 3)] & 0xFF));
_local7 = ((_arg2[(_arg3 + 4)] & 0xFF) << 24);
_local7 = (_local7 | ((_arg2[(_arg3 + 5)] & 0xFF) << 16));
_local7 = (_local7 | ((_arg2[(_arg3 + 6)] & 0xFF) << 8));
_local7 = (_local7 | (_arg2[(_arg3 + 7)] & 0xFF));
_local6 = (((_local8 >>> 4) ^ _local7) & 252645135);
_local7 = (_local7 ^ _local6);
_local8 = (_local8 ^ (_local6 << 4));
_local6 = (((_local8 >>> 16) ^ _local7) & 0xFFFF);
_local7 = (_local7 ^ _local6);
_local8 = (_local8 ^ (_local6 << 16));
_local6 = (((_local7 >>> 2) ^ _local8) & 858993459);
_local8 = (_local8 ^ _local6);
_local7 = (_local7 ^ (_local6 << 2));
_local6 = (((_local7 >>> 8) ^ _local8) & 0xFF00FF);
_local8 = (_local8 ^ _local6);
_local7 = (_local7 ^ (_local6 << 8));
_local7 = (((_local7 << 1) | ((_local7 >>> 31) & 1)) & 4294967295);
_local6 = ((_local8 ^ _local7) & 2863311530);
_local8 = (_local8 ^ _local6);
_local7 = (_local7 ^ _local6);
_local8 = (((_local8 << 1) | ((_local8 >>> 31) & 1)) & 4294967295);
var _local9:uint;
while (_local9 < 8) {
_local6 = ((_local7 << 28) | (_local7 >>> 4));
_local6 = (_local6 ^ _arg1[((_local9 * 4) + 0)]);
_local10 = SP7[(_local6 & 63)];
_local10 = (_local10 | SP5[((_local6 >>> 8) & 63)]);
_local10 = (_local10 | SP3[((_local6 >>> 16) & 63)]);
_local10 = (_local10 | SP1[((_local6 >>> 24) & 63)]);
_local6 = (_local7 ^ _arg1[((_local9 * 4) + 1)]);
_local10 = (_local10 | SP8[(_local6 & 63)]);
_local10 = (_local10 | SP6[((_local6 >>> 8) & 63)]);
_local10 = (_local10 | SP4[((_local6 >>> 16) & 63)]);
_local10 = (_local10 | SP2[((_local6 >>> 24) & 63)]);
_local8 = (_local8 ^ _local10);
_local6 = ((_local8 << 28) | (_local8 >>> 4));
_local6 = (_local6 ^ _arg1[((_local9 * 4) + 2)]);
_local10 = SP7[(_local6 & 63)];
_local10 = (_local10 | SP5[((_local6 >>> 8) & 63)]);
_local10 = (_local10 | SP3[((_local6 >>> 16) & 63)]);
_local10 = (_local10 | SP1[((_local6 >>> 24) & 63)]);
_local6 = (_local8 ^ _arg1[((_local9 * 4) + 3)]);
_local10 = (_local10 | SP8[(_local6 & 63)]);
_local10 = (_local10 | SP6[((_local6 >>> 8) & 63)]);
_local10 = (_local10 | SP4[((_local6 >>> 16) & 63)]);
_local10 = (_local10 | SP2[((_local6 >>> 24) & 63)]);
_local7 = (_local7 ^ _local10);
_local9++;
};
_local7 = ((_local7 << 31) | (_local7 >>> 1));
_local6 = ((_local8 ^ _local7) & 2863311530);
_local8 = (_local8 ^ _local6);
_local7 = (_local7 ^ _local6);
_local8 = ((_local8 << 31) | (_local8 >>> 1));
_local6 = (((_local8 >>> 8) ^ _local7) & 0xFF00FF);
_local7 = (_local7 ^ _local6);
_local8 = (_local8 ^ (_local6 << 8));
_local6 = (((_local8 >>> 2) ^ _local7) & 858993459);
_local7 = (_local7 ^ _local6);
_local8 = (_local8 ^ (_local6 << 2));
_local6 = (((_local7 >>> 16) ^ _local8) & 0xFFFF);
_local8 = (_local8 ^ _local6);
_local7 = (_local7 ^ (_local6 << 16));
_local6 = (((_local7 >>> 4) ^ _local8) & 252645135);
_local8 = (_local8 ^ _local6);
_local7 = (_local7 ^ (_local6 << 4));
_arg4[(_arg5 + 0)] = ((_local7 >>> 24) & 0xFF);
_arg4[(_arg5 + 1)] = ((_local7 >>> 16) & 0xFF);
_arg4[(_arg5 + 2)] = ((_local7 >>> 8) & 0xFF);
_arg4[(_arg5 + 3)] = (_local7 & 0xFF);
_arg4[(_arg5 + 4)] = ((_local8 >>> 24) & 0xFF);
_arg4[(_arg5 + 5)] = ((_local8 >>> 16) & 0xFF);
_arg4[(_arg5 + 6)] = ((_local8 >>> 8) & 0xFF);
_arg4[(_arg5 + 7)] = (_local8 & 0xFF);
}
public function toString():String{
return ("des");
}
public function dispose():void{
var _local1:uint;
_local1 = 0;
while (_local1 < encKey.length) {
encKey[_local1] = 0;
_local1++;
};
_local1 = 0;
while (_local1 < decKey.length) {
decKey[_local1] = 0;
_local1++;
};
encKey = null;
decKey = null;
_local1 = 0;
while (_local1 < key.length) {
key[_local1] = 0;
_local1++;
};
key.length = 0;
key = null;
Memory.gc();
}
}
}//package com.hurlant.crypto.symmetric
Section 20
//ECBMode (com.hurlant.crypto.symmetric.ECBMode)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
import com.hurlant.util.*;
public class ECBMode implements IMode, ICipher {
private var key:ISymmetricKey;
private var padding:IPad;
public function ECBMode(_arg1:ISymmetricKey, _arg2:IPad=null){
this.key = _arg1;
if (_arg2 == null){
_arg2 = new PKCS5(_arg1.getBlockSize());
} else {
_arg2.setBlockSize(_arg1.getBlockSize());
};
this.padding = _arg2;
}
public function encrypt(_arg1:ByteArray):void{
padding.pad(_arg1);
_arg1.position = 0;
var _local2:uint = key.getBlockSize();
var _local3:ByteArray = new ByteArray();
var _local4:ByteArray = new ByteArray();
var _local5:uint;
while (_local5 < _arg1.length) {
_local3.length = 0;
_arg1.readBytes(_local3, 0, _local2);
key.encrypt(_local3);
_local4.writeBytes(_local3);
_local5 = (_local5 + _local2);
};
_arg1.length = 0;
_arg1.writeBytes(_local4);
}
public function getBlockSize():uint{
return (key.getBlockSize());
}
public function decrypt(_arg1:ByteArray):void{
_arg1.position = 0;
var _local2:uint = key.getBlockSize();
if ((_arg1.length % _local2) != 0){
throw (new Error(("ECB mode cipher length must be a multiple of blocksize " + _local2)));
};
var _local3:ByteArray = new ByteArray();
var _local4:ByteArray = new ByteArray();
var _local5:uint;
while (_local5 < _arg1.length) {
_local3.length = 0;
_arg1.readBytes(_local3, 0, _local2);
key.decrypt(_local3);
_local4.writeBytes(_local3);
_local5 = (_local5 + _local2);
};
padding.unpad(_local4);
_arg1.length = 0;
_arg1.writeBytes(_local4);
}
public function toString():String{
return ((key.toString() + "-ecb"));
}
public function dispose():void{
key.dispose();
key = null;
padding = null;
Memory.gc();
}
}
}//package com.hurlant.crypto.symmetric
Section 21
//ICipher (com.hurlant.crypto.symmetric.ICipher)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public interface ICipher {
function encrypt(_arg1:ByteArray):void;
function getBlockSize():uint;
function toString():String;
function decrypt(_arg1:ByteArray):void;
function dispose():void;
}
}//package com.hurlant.crypto.symmetric
Section 22
//IMode (com.hurlant.crypto.symmetric.IMode)
package com.hurlant.crypto.symmetric {
public interface IMode extends ICipher {
}
}//package com.hurlant.crypto.symmetric
Section 23
//IPad (com.hurlant.crypto.symmetric.IPad)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public interface IPad {
function unpad(_arg1:ByteArray):void;
function pad(_arg1:ByteArray):void;
function setBlockSize(_arg1:uint):void;
}
}//package com.hurlant.crypto.symmetric
Section 24
//IStreamCipher (com.hurlant.crypto.symmetric.IStreamCipher)
package com.hurlant.crypto.symmetric {
public interface IStreamCipher extends ICipher {
}
}//package com.hurlant.crypto.symmetric
Section 25
//ISymmetricKey (com.hurlant.crypto.symmetric.ISymmetricKey)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public interface ISymmetricKey {
function encrypt(_arg1:ByteArray, _arg2:uint=0):void;
function getBlockSize():uint;
function toString():String;
function decrypt(_arg1:ByteArray, _arg2:uint=0):void;
function dispose():void;
}
}//package com.hurlant.crypto.symmetric
Section 26
//IVMode (com.hurlant.crypto.symmetric.IVMode)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
import com.hurlant.crypto.prng.*;
import com.hurlant.util.*;
public class IVMode {
protected var lastIV:ByteArray;
protected var iv:ByteArray;
protected var blockSize:uint;
protected var padding:IPad;
protected var prng:Random;
protected var key:ISymmetricKey;
public function IVMode(_arg1:ISymmetricKey, _arg2:IPad=null){
this.key = _arg1;
blockSize = _arg1.getBlockSize();
if (_arg2 == null){
_arg2 = new PKCS5(blockSize);
} else {
_arg2.setBlockSize(blockSize);
};
this.padding = _arg2;
prng = new Random();
iv = null;
lastIV = new ByteArray();
}
public function set IV(_arg1:ByteArray):void{
iv = _arg1;
lastIV.length = 0;
lastIV.writeBytes(iv);
}
protected function getIV4d():ByteArray{
var _local1:ByteArray = new ByteArray();
if (iv){
_local1.writeBytes(iv);
} else {
throw (new Error("an IV must be set before calling decrypt()"));
};
return (_local1);
}
protected function getIV4e():ByteArray{
var _local1:ByteArray = new ByteArray();
if (iv){
_local1.writeBytes(iv);
} else {
prng.nextBytes(_local1, blockSize);
};
lastIV.length = 0;
lastIV.writeBytes(_local1);
return (_local1);
}
public function get IV():ByteArray{
return (lastIV);
}
public function dispose():void{
var _local1:uint;
if (iv != null){
_local1 = 0;
while (_local1 < iv.length) {
iv[_local1] = prng.nextByte();
_local1++;
};
iv.length = 0;
iv = null;
};
if (lastIV != null){
_local1 = 0;
while (_local1 < iv.length) {
lastIV[_local1] = prng.nextByte();
_local1++;
};
lastIV.length = 0;
lastIV = null;
};
key.dispose();
key = null;
padding = null;
prng.dispose();
prng = null;
Memory.gc();
}
public function getBlockSize():uint{
return (key.getBlockSize());
}
}
}//package com.hurlant.crypto.symmetric
Section 27
//NullPad (com.hurlant.crypto.symmetric.NullPad)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public class NullPad implements IPad {
public function unpad(_arg1:ByteArray):void{
}
public function pad(_arg1:ByteArray):void{
}
public function setBlockSize(_arg1:uint):void{
}
}
}//package com.hurlant.crypto.symmetric
Section 28
//OFBMode (com.hurlant.crypto.symmetric.OFBMode)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public class OFBMode extends IVMode implements IMode {
public function OFBMode(_arg1:ISymmetricKey, _arg2:IPad=null){
super(_arg1, null);
}
private function core(_arg1:ByteArray, _arg2:ByteArray):void{
var _local6:uint;
var _local7:uint;
var _local3:uint = _arg1.length;
var _local4:ByteArray = new ByteArray();
var _local5:uint;
while (_local5 < _arg1.length) {
key.encrypt(_arg2);
_local4.position = 0;
_local4.writeBytes(_arg2);
_local6 = (((_local5 + blockSize))<_local3) ? blockSize : (_local3 - _local5);
_local7 = 0;
while (_local7 < _local6) {
_arg1[(_local5 + _local7)] = (_arg1[(_local5 + _local7)] ^ _arg2[_local7]);
_local7++;
};
_arg2.position = 0;
_arg2.writeBytes(_local4);
_local5 = (_local5 + blockSize);
};
}
public function toString():String{
return ((key.toString() + "-ofb"));
}
public function encrypt(_arg1:ByteArray):void{
var _local2:ByteArray = getIV4e();
core(_arg1, _local2);
}
public function decrypt(_arg1:ByteArray):void{
var _local2:ByteArray = getIV4d();
core(_arg1, _local2);
}
}
}//package com.hurlant.crypto.symmetric
Section 29
//PKCS5 (com.hurlant.crypto.symmetric.PKCS5)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
public class PKCS5 implements IPad {
private var blockSize:uint;
public function PKCS5(_arg1:uint=0){
this.blockSize = _arg1;
}
public function pad(_arg1:ByteArray):void{
var _local2:uint = (blockSize - (_arg1.length % blockSize));
var _local3:uint;
while (_local3 < _local2) {
_arg1[_arg1.length] = _local2;
_local3++;
};
}
public function setBlockSize(_arg1:uint):void{
blockSize = _arg1;
}
public function unpad(_arg1:ByteArray):void{
var _local4:uint;
var _local2:uint = (_arg1.length % blockSize);
if (_local2 != 0){
throw (new Error("PKCS#5::unpad: ByteArray.length isn't a multiple of the blockSize"));
};
_local2 = _arg1[(_arg1.length - 1)];
var _local3:uint = _local2;
while (_local3 > 0) {
_local4 = _arg1[(_arg1.length - 1)];
_arg1.length--;
if (_local2 != _local4){
throw (new Error((((("PKCS#5:unpad: Invalid padding value. expected [" + _local2) + "], found [") + _local4) + "]")));
};
_local3--;
};
}
}
}//package com.hurlant.crypto.symmetric
Section 30
//SimpleIVMode (com.hurlant.crypto.symmetric.SimpleIVMode)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
import com.hurlant.util.*;
public class SimpleIVMode implements IMode, ICipher {
protected var mode:IVMode;
protected var cipher:ICipher;
public function SimpleIVMode(_arg1:IVMode){
this.mode = _arg1;
cipher = (_arg1 as ICipher);
}
public function encrypt(_arg1:ByteArray):void{
cipher.encrypt(_arg1);
var _local2:ByteArray = new ByteArray();
_local2.writeBytes(mode.IV);
_local2.writeBytes(_arg1);
_arg1.position = 0;
_arg1.writeBytes(_local2);
}
public function decrypt(_arg1:ByteArray):void{
var _local2:ByteArray = new ByteArray();
_local2.writeBytes(_arg1, 0, getBlockSize());
mode.IV = _local2;
_local2 = new ByteArray();
_local2.writeBytes(_arg1, getBlockSize());
cipher.decrypt(_local2);
_arg1.length = 0;
_arg1.writeBytes(_local2);
}
public function dispose():void{
mode.dispose();
mode = null;
cipher = null;
Memory.gc();
}
public function getBlockSize():uint{
return (mode.getBlockSize());
}
public function toString():String{
return (("simple-" + cipher.toString()));
}
}
}//package com.hurlant.crypto.symmetric
Section 31
//TripleDESKey (com.hurlant.crypto.symmetric.TripleDESKey)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
import com.hurlant.util.*;
public class TripleDESKey extends DESKey {
protected var encKey2:Array;
protected var encKey3:Array;
protected var decKey2:Array;
protected var decKey3:Array;
public function TripleDESKey(_arg1:ByteArray){
super(_arg1);
encKey2 = generateWorkingKey(false, _arg1, 8);
decKey2 = generateWorkingKey(true, _arg1, 8);
if (_arg1.length > 16){
encKey3 = generateWorkingKey(true, _arg1, 16);
decKey3 = generateWorkingKey(false, _arg1, 16);
} else {
encKey3 = encKey;
decKey3 = decKey;
};
}
override public function encrypt(_arg1:ByteArray, _arg2:uint=0):void{
desFunc(encKey, _arg1, _arg2, _arg1, _arg2);
desFunc(encKey2, _arg1, _arg2, _arg1, _arg2);
desFunc(encKey3, _arg1, _arg2, _arg1, _arg2);
}
override public function dispose():void{
super.dispose();
var _local1:uint;
if (encKey2 != null){
_local1 = 0;
while (_local1 < encKey2.length) {
encKey2[_local1] = 0;
_local1++;
};
encKey2 = null;
};
if (encKey3 != null){
_local1 = 0;
while (_local1 < encKey3.length) {
encKey3[_local1] = 0;
_local1++;
};
encKey3 = null;
};
if (decKey2 != null){
_local1 = 0;
while (_local1 < decKey2.length) {
decKey2[_local1] = 0;
_local1++;
};
decKey2 = null;
};
if (decKey3 != null){
_local1 = 0;
while (_local1 < decKey3.length) {
decKey3[_local1] = 0;
_local1++;
};
decKey3 = null;
};
Memory.gc();
}
override public function decrypt(_arg1:ByteArray, _arg2:uint=0):void{
desFunc(decKey3, _arg1, _arg2, _arg1, _arg2);
desFunc(decKey2, _arg1, _arg2, _arg1, _arg2);
desFunc(decKey, _arg1, _arg2, _arg1, _arg2);
}
override public function toString():String{
return ("3des");
}
}
}//package com.hurlant.crypto.symmetric
Section 32
//XTeaKey (com.hurlant.crypto.symmetric.XTeaKey)
package com.hurlant.crypto.symmetric {
import flash.utils.*;
import com.hurlant.crypto.prng.*;
import com.hurlant.util.*;
public class XTeaKey implements ISymmetricKey {
public const NUM_ROUNDS:uint = 64;
private var k:Array;
public function XTeaKey(_arg1:ByteArray){
_arg1.position = 0;
k = [_arg1.readUnsignedInt(), _arg1.readUnsignedInt(), _arg1.readUnsignedInt(), _arg1.readUnsignedInt()];
}
public function encrypt(_arg1:ByteArray, _arg2:uint=0):void{
var _local5:uint;
_arg1.position = _arg2;
var _local3:uint = _arg1.readUnsignedInt();
var _local4:uint = _arg1.readUnsignedInt();
var _local6:uint;
var _local7:uint = 2654435769;
_local5 = 0;
while (_local5 < NUM_ROUNDS) {
_local3 = (_local3 + ((((_local4 << 4) ^ (_local4 >> 5)) + _local4) ^ (_local6 + k[(_local6 & 3)])));
_local6 = (_local6 + _local7);
_local4 = (_local4 + ((((_local3 << 4) ^ (_local3 >> 5)) + _local3) ^ (_local6 + k[((_local6 >> 11) & 3)])));
_local5++;
};
_arg1.position = (_arg1.position - 8);
_arg1.writeUnsignedInt(_local3);
_arg1.writeUnsignedInt(_local4);
}
public function decrypt(_arg1:ByteArray, _arg2:uint=0):void{
var _local5:uint;
_arg1.position = _arg2;
var _local3:uint = _arg1.readUnsignedInt();
var _local4:uint = _arg1.readUnsignedInt();
var _local6:uint = 2654435769;
var _local7:uint = (_local6 * NUM_ROUNDS);
_local5 = 0;
while (_local5 < NUM_ROUNDS) {
_local4 = (_local4 - ((((_local3 << 4) ^ (_local3 >> 5)) + _local3) ^ (_local7 + k[((_local7 >> 11) & 3)])));
_local7 = (_local7 - _local6);
_local3 = (_local3 - ((((_local4 << 4) ^ (_local4 >> 5)) + _local4) ^ (_local7 + k[(_local7 & 3)])));
_local5++;
};
_arg1.position = (_arg1.position - 8);
_arg1.writeUnsignedInt(_local3);
_arg1.writeUnsignedInt(_local4);
}
public function getBlockSize():uint{
return (8);
}
public function toString():String{
return ("xtea");
}
public function dispose():void{
var _local1:Random = new Random();
var _local2:uint;
while (_local2 < k.length) {
k[_local2] = _local1.nextByte();
delete k[_local2];
_local2++;
};
k = null;
Memory.gc();
}
public static function parseKey(_arg1:String):XTeaKey{
var _local2:ByteArray = new ByteArray();
_local2.writeUnsignedInt(parseInt(_arg1.substr(0, 8), 16));
_local2.writeUnsignedInt(parseInt(_arg1.substr(8, 8), 16));
_local2.writeUnsignedInt(parseInt(_arg1.substr(16, 8), 16));
_local2.writeUnsignedInt(parseInt(_arg1.substr(24, 8), 16));
_local2.position = 0;
return (new XTeaKey(_local2));
}
}
}//package com.hurlant.crypto.symmetric
Section 33
//Crypto (com.hurlant.crypto.Crypto)
package com.hurlant.crypto {
import flash.utils.*;
import com.hurlant.crypto.symmetric.*;
import com.hurlant.crypto.hash.*;
import com.hurlant.crypto.rsa.*;
import com.hurlant.crypto.prng.*;
import com.hurlant.util.*;
public class Crypto {
private var b64:Base64;
public static function getCipher(_arg1:String, _arg2:ByteArray, _arg3:IPad=null):ICipher{
var _local5:ICipher;
var _local4:Array = _arg1.split("-");
switch (_local4[0]){
case "simple":
_local4.shift();
_arg1 = _local4.join("-");
_local5 = getCipher(_arg1, _arg2, _arg3);
if ((_local5 is IVMode)){
return (new SimpleIVMode((_local5 as IVMode)));
};
return (_local5);
case "aes":
case "aes128":
case "aes192":
case "aes256":
_local4.shift();
if ((_arg2.length * 8) == _local4[0]){
_local4.shift();
};
return (getMode(_local4[0], new AESKey(_arg2), _arg3));
case "bf":
case "blowfish":
_local4.shift();
return (getMode(_local4[0], new BlowFishKey(_arg2), _arg3));
case "des":
_local4.shift();
if (((!((_local4[0] == "ede"))) && (!((_local4[0] == "ede3"))))){
return (getMode(_local4[0], new DESKey(_arg2), _arg3));
};
if (_local4.length == 1){
_local4.push("ecb");
};
case "3des":
case "des3":
_local4.shift();
return (getMode(_local4[0], new TripleDESKey(_arg2), _arg3));
case "xtea":
_local4.shift();
return (getMode(_local4[0], new XTeaKey(_arg2), _arg3));
case "rc4":
_local4.shift();
return (new ARC4(_arg2));
};
return (null);
}
public static function getHash(_arg1:String):IHash{
switch (_arg1){
case "md2":
return (new MD2());
case "md5":
return (new MD5());
case "sha":
case "sha1":
return (new SHA1());
case "sha224":
return (new SHA224());
case "sha256":
return (new SHA256());
};
return (null);
}
public static function getRSA(_arg1:String, _arg2:String):RSAKey{
return (RSAKey.parsePublicKey(_arg2, _arg1));
}
private static function getMode(_arg1:String, _arg2:ISymmetricKey, _arg3:IPad=null):IMode{
switch (_arg1){
case "ecb":
return (new ECBMode(_arg2, _arg3));
case "cfb":
return (new CFBMode(_arg2, _arg3));
case "cfb8":
return (new CFB8Mode(_arg2, _arg3));
case "ofb":
return (new OFBMode(_arg2, _arg3));
case "ctr":
return (new CTRMode(_arg2, _arg3));
case "cbc":
default:
return (new CBCMode(_arg2, _arg3));
};
}
public static function getKeySize(_arg1:String):uint{
var _local2:Array = _arg1.split("-");
switch (_local2[0]){
case "simple":
_local2.shift();
return (getKeySize(_local2.join("-")));
case "aes128":
return (16);
case "aes192":
return (24);
case "aes256":
return (32);
case "aes":
_local2.shift();
return ((parseInt(_local2[0]) / 8));
case "bf":
case "blowfish":
return (16);
case "des":
_local2.shift();
switch (_local2[0]){
case "ede":
return (16);
case "ede3":
return (24);
default:
return (8);
};
case "3des":
case "des3":
return (24);
case "xtea":
return (8);
case "rc4":
if (parseInt(_local2[1]) > 0){
return ((parseInt(_local2[1]) / 8));
};
return (16);
};
return (0);
}
public static function getPad(_arg1:String):IPad{
switch (_arg1){
case "null":
return (new NullPad());
case "pkcs5":
default:
return (new PKCS5());
};
}
public static function getHMAC(_arg1:String):HMAC{
var _local2:Array = _arg1.split("-");
if (_local2[0] == "hmac"){
_local2.shift();
};
var _local3:uint;
if (_local2.length > 1){
_local3 = parseInt(_local2[1]);
};
return (new HMAC(getHash(_local2[0]), _local3));
}
}
}//package com.hurlant.crypto
Section 34
//BarrettReduction (com.hurlant.math.BarrettReduction)
package com.hurlant.math {
import com.hurlant.math.*;
class BarrettReduction implements IReduction {
private var r2:BigInteger;
private var q3:BigInteger;
private var mu:BigInteger;
private var m:BigInteger;
function BarrettReduction(_arg1:BigInteger){
r2 = new BigInteger();
q3 = new BigInteger();
BigInteger.ONE.dlShiftTo((2 * _arg1.t), r2);
mu = r2.divide(_arg1);
this.m = _arg1;
}
public function revert(_arg1:BigInteger):BigInteger{
return (_arg1);
}
public function sqrTo(_arg1:BigInteger, _arg2:BigInteger):void{
_arg1.squareTo(_arg2);
reduce(_arg2);
}
public function convert(_arg1:BigInteger):BigInteger{
var _local2:BigInteger;
if ((((_arg1.s < 0)) || ((_arg1.t > (2 * m.t))))){
return (_arg1.mod(m));
};
if (_arg1.compareTo(m) < 0){
return (_arg1);
};
_local2 = new BigInteger();
_arg1.copyTo(_local2);
reduce(_local2);
return (_local2);
}
public function reduce(_arg1:BigInteger):void{
var _local2:BigInteger = (_arg1 as BigInteger);
_local2.drShiftTo((m.t - 1), r2);
if (_local2.t > (m.t + 1)){
_local2.t = (m.t + 1);
_local2.clamp();
};
mu.multiplyUpperTo(r2, (m.t + 1), q3);
m.multiplyLowerTo(q3, (m.t + 1), r2);
while (_local2.compareTo(r2) < 0) {
_local2.dAddOffset(1, (m.t + 1));
};
_local2.subTo(r2, _local2);
while (_local2.compareTo(m) >= 0) {
_local2.subTo(m, _local2);
};
}
public function mulTo(_arg1:BigInteger, _arg2:BigInteger, _arg3:BigInteger):void{
_arg1.multiplyTo(_arg2, _arg3);
reduce(_arg3);
}
}
}//package com.hurlant.math
Section 35
//bi_internal (com.hurlant.math.bi_internal)
package com.hurlant.math {
public namespace bi_internal = "http://crypto.hurlant.com/BigInteger";
}//package com.hurlant.math
Section 36
//BigInteger (com.hurlant.math.BigInteger)
package com.hurlant.math {
import flash.utils.*;
import com.hurlant.crypto.prng.*;
import com.hurlant.util.*;
public class BigInteger {
bi_internal var a:Array;
bi_internal var s:int;
public var t:int;
public static const ONE:BigInteger = nbv(1);
public static const ZERO:BigInteger = nbv(0);
public static const DM:int = (DV - 1);
public static const F1:int = 22;
public static const F2:int = 8;
public static const lplim:int = ((1 << 26) / lowprimes[(lowprimes.length - 1)]);
public static const lowprimes:Array = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 0x0101, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509];
public static const FV:Number = Math.pow(2, BI_FP);
public static const BI_FP:int = 52;
public static const DV:int = (1 << DB);
public static const DB:int = 30;
public function BigInteger(_arg1=null, _arg2:int=0){
var _local3:ByteArray;
var _local4:int;
super();
a = new Array();
if ((_arg1 is String)){
_arg1 = Hex.toArray(_arg1);
_arg2 = 0;
};
if ((_arg1 is ByteArray)){
_local3 = (_arg1 as ByteArray);
_local4 = ((_arg2) || ((_local3.length - _local3.position)));
fromArray(_local3, _local4);
};
}
public function clearBit(_arg1:int):BigInteger{
return (changeBit(_arg1, op_andnot));
}
private function op_or(_arg1:int, _arg2:int):int{
return ((_arg1 | _arg2));
}
public function negate():BigInteger{
var _local1:BigInteger = nbi();
ZERO.subTo(this, _local1);
return (_local1);
}
public function andNot(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
bitwiseTo(_arg1, op_andnot, _local2);
return (_local2);
}
public function modPow(_arg1:BigInteger, _arg2:BigInteger):BigInteger{
var _local4:int;
var _local6:IReduction;
var _local12:int;
var _local15:BigInteger;
var _local16:BigInteger;
var _local3:int = _arg1.bitLength();
var _local5:BigInteger = nbv(1);
if (_local3 <= 0){
return (_local5);
};
if (_local3 < 18){
_local4 = 1;
} else {
if (_local3 < 48){
_local4 = 3;
} else {
if (_local3 < 144){
_local4 = 4;
} else {
if (_local3 < 0x0300){
_local4 = 5;
} else {
_local4 = 6;
};
};
};
};
if (_local3 < 8){
_local6 = new ClassicReduction(_arg2);
} else {
if (_arg2.isEven()){
_local6 = new BarrettReduction(_arg2);
} else {
_local6 = new MontgomeryReduction(_arg2);
};
};
var _local7:Array = [];
var _local8 = 3;
var _local9:int = (_local4 - 1);
var _local10:int = ((1 << _local4) - 1);
_local7[1] = _local6.convert(this);
if (_local4 > 1){
_local16 = new BigInteger();
_local6.sqrTo(_local7[1], _local16);
while (_local8 <= _local10) {
_local7[_local8] = new BigInteger();
_local6.mulTo(_local16, _local7[(_local8 - 2)], _local7[_local8]);
_local8 = (_local8 + 2);
};
};
var _local11:int = (_arg1.t - 1);
var _local13:Boolean;
var _local14:BigInteger = new BigInteger();
_local3 = (nbits(_arg1.a[_local11]) - 1);
while (_local11 >= 0) {
if (_local3 >= _local9){
_local12 = ((_arg1.a[_local11] >> (_local3 - _local9)) & _local10);
} else {
_local12 = ((_arg1.a[_local11] & ((1 << (_local3 + 1)) - 1)) << (_local9 - _local3));
if (_local11 > 0){
_local12 = (_local12 | (_arg1.a[(_local11 - 1)] >> ((DB + _local3) - _local9)));
};
};
_local8 = _local4;
while ((_local12 & 1) == 0) {
_local12 = (_local12 >> 1);
_local8--;
};
_local3 = (_local3 - _local8);
if (_local3 < 0){
_local3 = (_local3 + DB);
_local11--;
};
if (_local13){
_local7[_local12].copyTo(_local5);
_local13 = false;
} else {
while (_local8 > 1) {
_local6.sqrTo(_local5, _local14);
_local6.sqrTo(_local14, _local5);
_local8 = (_local8 - 2);
};
if (_local8 > 0){
_local6.sqrTo(_local5, _local14);
} else {
_local15 = _local5;
_local5 = _local14;
_local14 = _local15;
};
_local6.mulTo(_local14, _local7[_local12], _local5);
};
while ((((_local11 >= 0)) && (((_arg1.a[_local11] & (1 << _local3)) == 0)))) {
_local6.sqrTo(_local5, _local14);
_local15 = _local5;
_local5 = _local14;
_local14 = _local15;
--_local3;
if (_local3 < 0){
_local3 = (DB - 1);
_local11--;
};
};
};
return (_local6.revert(_local5));
}
public function isProbablePrime(_arg1:int):Boolean{
var _local2:int;
var _local4:int;
var _local5:int;
var _local3:BigInteger = abs();
if ((((_local3.t == 1)) && ((_local3.a[0] <= lowprimes[(lowprimes.length - 1)])))){
_local2 = 0;
while (_local2 < lowprimes.length) {
if (_local3[0] == lowprimes[_local2]){
return (true);
};
_local2++;
};
return (false);
};
if (_local3.isEven()){
return (false);
};
_local2 = 1;
while (_local2 < lowprimes.length) {
_local4 = lowprimes[_local2];
_local5 = (_local2 + 1);
while ((((_local5 < lowprimes.length)) && ((_local4 < lplim)))) {
var _temp1 = _local5;
_local5 = (_local5 + 1);
_local4 = (_local4 * lowprimes[_temp1]);
};
_local4 = _local3.modInt(_local4);
while (_local2 < _local5) {
var _temp2 = _local4;
var _temp3 = _local2;
_local2 = (_local2 + 1);
if ((_temp2 % lowprimes[_temp3]) == 0){
return (false);
};
};
};
return (_local3.millerRabin(_arg1));
}
public function divide(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
divRemTo(_arg1, _local2, null);
return (_local2);
}
public function mod(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = nbi();
abs().divRemTo(_arg1, null, _local2);
if ((((s < 0)) && ((_local2.compareTo(ZERO) > 0)))){
_arg1.subTo(_local2, _local2);
};
return (_local2);
}
protected function addTo(_arg1:BigInteger, _arg2:BigInteger):void{
var _local3:int;
var _local4:int;
var _local5:int = Math.min(_arg1.t, t);
while (_local3 < _local5) {
_local4 = (_local4 + (this.a[_local3] + _arg1.a[_local3]));
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local6 = _temp1;
_arg2.a[_local6] = (_local4 & DM);
_local4 = (_local4 >> DB);
};
if (_arg1.t < t){
_local4 = (_local4 + _arg1.s);
while (_local3 < t) {
_local4 = (_local4 + this.a[_local3]);
var _temp2 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp2;
_arg2.a[_local6] = (_local4 & DM);
_local4 = (_local4 >> DB);
};
_local4 = (_local4 + s);
} else {
_local4 = (_local4 + s);
while (_local3 < _arg1.t) {
_local4 = (_local4 + _arg1.a[_local3]);
var _temp3 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp3;
_arg2.a[_local6] = (_local4 & DM);
_local4 = (_local4 >> DB);
};
_local4 = (_local4 + _arg1.s);
};
_arg2.s = ((_local4)<0) ? -1 : 0;
if (_local4 > 0){
var _temp4 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp4;
_arg2.a[_local6] = _local4;
} else {
if (_local4 < -1){
var _temp5 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp5;
_arg2.a[_local6] = (DV + _local4);
};
};
_arg2.t = _local3;
_arg2.clamp();
}
protected function bitwiseTo(_arg1:BigInteger, _arg2:Function, _arg3:BigInteger):void{
var _local4:int;
var _local5:int;
var _local6:int = Math.min(_arg1.t, t);
_local4 = 0;
while (_local4 < _local6) {
_arg3.a[_local4] = _arg2(this.a[_local4], _arg1.a[_local4]);
_local4++;
};
if (_arg1.t < t){
_local5 = (_arg1.s & DM);
_local4 = _local6;
while (_local4 < t) {
_arg3.a[_local4] = _arg2(this.a[_local4], _local5);
_local4++;
};
_arg3.t = t;
} else {
_local5 = (s & DM);
_local4 = _local6;
while (_local4 < _arg1.t) {
_arg3.a[_local4] = _arg2(_local5, _arg1.a[_local4]);
_local4++;
};
_arg3.t = _arg1.t;
};
_arg3.s = _arg2(s, _arg1.s);
_arg3.clamp();
}
protected function modInt(_arg1:int):int{
var _local4:int;
if (_arg1 <= 0){
return (0);
};
var _local2:int = (DV % _arg1);
var _local3:int = ((s)<0) ? (_arg1 - 1) : 0;
if (t > 0){
if (_local2 == 0){
_local3 = (a[0] % _arg1);
} else {
_local4 = (t - 1);
while (_local4 >= 0) {
_local3 = (((_local2 * _local3) + a[_local4]) % _arg1);
_local4--;
};
};
};
return (_local3);
}
protected function chunkSize(_arg1:Number):int{
return (Math.floor(((Math.LN2 * DB) / Math.log(_arg1))));
}
public function gcd(_arg1:BigInteger):BigInteger{
var _local6:BigInteger;
var _local2:BigInteger = ((s)<0) ? negate() : clone();
var _local3:BigInteger = ((_arg1.s)<0) ? _arg1.negate() : _arg1.clone();
if (_local2.compareTo(_local3) < 0){
_local6 = _local2;
_local2 = _local3;
_local3 = _local6;
};
var _local4:int = _local2.getLowestSetBit();
var _local5:int = _local3.getLowestSetBit();
if (_local5 < 0){
return (_local2);
};
if (_local4 < _local5){
_local5 = _local4;
};
if (_local5 > 0){
_local2.rShiftTo(_local5, _local2);
_local3.rShiftTo(_local5, _local3);
};
while (_local2.sigNum() > 0) {
_local4 = _local2.getLowestSetBit();
if (_local4 > 0){
_local2.rShiftTo(_local4, _local2);
};
_local4 = _local3.getLowestSetBit();
if (_local4 > 0){
_local3.rShiftTo(_local4, _local3);
};
if (_local2.compareTo(_local3) >= 0){
_local2.subTo(_local3, _local2);
_local2.rShiftTo(1, _local2);
} else {
_local3.subTo(_local2, _local3);
_local3.rShiftTo(1, _local3);
};
};
if (_local5 > 0){
_local3.lShiftTo(_local5, _local3);
};
return (_local3);
}
bi_internal function dAddOffset(_arg1:int, _arg2:int):void{
while (t <= _arg2) {
var _local3 = t++;
a[_local3] = 0;
};
a[_arg2] = (a[_arg2] + _arg1);
while (a[_arg2] >= DV) {
a[_arg2] = (a[_arg2] - DV);
++_arg2;
if (_arg2 >= t){
_local3 = t++;
a[_local3] = 0;
};
_local3 = a;
var _local4 = _arg2;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
};
}
bi_internal function lShiftTo(_arg1:int, _arg2:BigInteger):void{
var _local8:int;
var _local3:int = (_arg1 % DB);
var _local4:int = (DB - _local3);
var _local5:int = ((1 << _local4) - 1);
var _local6:int = (_arg1 / DB);
var _local7 = ((s << _local3) & DM);
_local8 = (t - 1);
while (_local8 >= 0) {
_arg2.a[((_local8 + _local6) + 1)] = ((a[_local8] >> _local4) | _local7);
_local7 = ((a[_local8] & _local5) << _local3);
_local8--;
};
_local8 = (_local6 - 1);
while (_local8 >= 0) {
_arg2.a[_local8] = 0;
_local8--;
};
_arg2.a[_local6] = _local7;
_arg2.t = ((t + _local6) + 1);
_arg2.s = s;
_arg2.clamp();
}
public function getLowestSetBit():int{
var _local1:int;
while (_local1 < t) {
if (a[_local1] != 0){
return (((_local1 * DB) + lbit(a[_local1])));
};
_local1++;
};
if (s < 0){
return ((t * DB));
};
return (-1);
}
public function subtract(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
subTo(_arg1, _local2);
return (_local2);
}
public function primify(_arg1:int, _arg2:int):void{
if (!testBit((_arg1 - 1))){
bitwiseTo(BigInteger.ONE.shiftLeft((_arg1 - 1)), op_or, this);
};
if (isEven()){
dAddOffset(1, 0);
};
while (!(isProbablePrime(_arg2))) {
dAddOffset(2, 0);
while (bitLength() > _arg1) {
subTo(BigInteger.ONE.shiftLeft((_arg1 - 1)), this);
};
};
}
bi_internal function multiplyLowerTo(_arg1:BigInteger, _arg2:int, _arg3:BigInteger):void{
var _local5:int;
var _local4:int = Math.min((t + _arg1.t), _arg2);
_arg3.s = 0;
_arg3.t = _local4;
while (_local4 > 0) {
--_local4;
var _local6 = _local4;
_arg3.a[_local6] = 0;
};
_local5 = (_arg3.t - t);
while (_local4 < _local5) {
_arg3.a[(_local4 + t)] = am(0, _arg1.a[_local4], _arg3, _local4, 0, t);
_local4++;
};
_local5 = Math.min(_arg1.t, _arg2);
while (_local4 < _local5) {
am(0, _arg1.a[_local4], _arg3, _local4, 0, (_arg2 - _local4));
_local4++;
};
_arg3.clamp();
}
public function modPowInt(_arg1:int, _arg2:BigInteger):BigInteger{
var _local3:IReduction;
if ((((_arg1 < 0x0100)) || (_arg2.isEven()))){
_local3 = new ClassicReduction(_arg2);
} else {
_local3 = new MontgomeryReduction(_arg2);
};
return (exp(_arg1, _local3));
}
bi_internal function intAt(_arg1:String, _arg2:int):int{
return (parseInt(_arg1.charAt(_arg2), 36));
}
public function testBit(_arg1:int):Boolean{
var _local2:int = Math.floor((_arg1 / DB));
if (_local2 >= t){
return (!((s == 0)));
};
return (!(((a[_local2] & (1 << (_arg1 % DB))) == 0)));
}
bi_internal function exp(_arg1:int, _arg2:IReduction):BigInteger{
var _local7:BigInteger;
if ((((_arg1 > 4294967295)) || ((_arg1 < 1)))){
return (ONE);
};
var _local3:BigInteger = nbi();
var _local4:BigInteger = nbi();
var _local5:BigInteger = _arg2.convert(this);
var _local6:int = (nbits(_arg1) - 1);
_local5.copyTo(_local3);
while (--_local6 >= 0) {
_arg2.sqrTo(_local3, _local4);
if ((_arg1 & (1 << _local6)) > 0){
_arg2.mulTo(_local4, _local5, _local3);
} else {
_local7 = _local3;
_local3 = _local4;
_local4 = _local7;
};
};
return (_arg2.revert(_local3));
}
public function toArray(_arg1:ByteArray):uint{
var _local2 = 8;
var _local3:int = ((1 << 8) - 1);
var _local4:int;
var _local5:int = t;
var _local6:int = (DB - ((_local5 * DB) % _local2));
var _local7:Boolean;
var _local8:int;
var _temp1 = _local5;
_local5 = (_local5 - 1);
if (_temp1 > 0){
if ((((_local6 < DB)) && (((a[_local5] >> _local6) > 0)))){
_local7 = true;
_arg1.writeByte(_local4);
_local8++;
};
while (_local5 >= 0) {
if (_local6 < _local2){
_local4 = ((a[_local5] & ((1 << _local6) - 1)) << (_local2 - _local6));
var _temp2 = _local4;
_local5 = (_local5 - 1);
_local6 = (_local6 + (DB - _local2));
_local4 = (_temp2 | (a[_local5] >> _local6));
} else {
_local6 = (_local6 - _local2);
_local4 = ((a[_local5] >> _local6) & _local3);
if (_local6 <= 0){
_local6 = (_local6 + DB);
_local5--;
};
};
if (_local4 > 0){
_local7 = true;
};
if (_local7){
_arg1.writeByte(_local4);
_local8++;
};
};
};
return (_local8);
}
public function dispose():void{
var _local1:Random = new Random();
var _local2:uint;
while (_local2 < a.length) {
a[_local2] = _local1.nextByte();
delete a[_local2];
_local2++;
};
a = null;
t = 0;
s = 0;
Memory.gc();
}
private function lbit(_arg1:int):int{
if (_arg1 == 0){
return (-1);
};
var _local2:int;
if ((_arg1 & 0xFFFF) == 0){
_arg1 = (_arg1 >> 16);
_local2 = (_local2 + 16);
};
if ((_arg1 & 0xFF) == 0){
_arg1 = (_arg1 >> 8);
_local2 = (_local2 + 8);
};
if ((_arg1 & 15) == 0){
_arg1 = (_arg1 >> 4);
_local2 = (_local2 + 4);
};
if ((_arg1 & 3) == 0){
_arg1 = (_arg1 >> 2);
_local2 = (_local2 + 2);
};
if ((_arg1 & 1) == 0){
_local2++;
};
return (_local2);
}
bi_internal function divRemTo(_arg1:BigInteger, _arg2:BigInteger=null, _arg3:BigInteger=null):void{
var qd:int;
var m = _arg1;
var q = _arg2;
var r = _arg3;
var pm:BigInteger = m.abs();
if (pm.t <= 0){
return;
};
var pt:BigInteger = abs();
if (pt.t < pm.t){
if (q != null){
q.fromInt(0);
};
if (r != null){
copyTo(r);
};
return;
};
if (r == null){
r = nbi();
};
var y:BigInteger = nbi();
var ts:int = s;
var ms:int = m.s;
var nsh:int = (DB - nbits(pm.a[(pm.t - 1)]));
if (nsh > 0){
pm.lShiftTo(nsh, y);
pt.lShiftTo(nsh, r);
} else {
pm.copyTo(y);
pt.copyTo(r);
};
var ys:int = y.t;
var y0:int = y.a[(ys - 1)];
if (y0 == 0){
return;
};
var yt:Number = ((y0 * (1 << F1)) + ((ys)>1) ? (y.a[(ys - 2)] >> F2) : 0);
var d1:Number = (FV / yt);
var d2:Number = ((1 << F1) / yt);
var e:Number = (1 << F2);
var i:int = r.t;
var j:int = (i - ys);
var t:BigInteger = ((q)==null) ? nbi() : q;
y.dlShiftTo(j, t);
if (r.compareTo(t) >= 0){
var _local5 = r.t++;
r.a[_local5] = 1;
r.subTo(t, r);
};
ONE.dlShiftTo(ys, t);
t.subTo(y, y);
while (y.t < ys) {
y.(y.t++); //not popped
};
while ((j = (j - 1)), (j - 1) >= 0) {
i = (i - 1);
qd = ((r.a[(i - 1)])==y0) ? DM : ((Number(r.a[i]) * d1) + ((Number(r.a[(i - 1)]) + e) * d2));
if ((r.a[i] = (r.a[i] + y.am(0, qd, r, j, 0, ys))) < qd){
y.dlShiftTo(j, t);
r.subTo(t, r);
while ((qd = (qd - 1)), r.a[i] < (qd - 1)) {
r.subTo(t, r);
};
};
};
if (q != null){
r.drShiftTo(ys, q);
if (ts != ms){
ZERO.subTo(q, q);
};
};
r.t = ys;
r.clamp();
if (nsh > 0){
r.rShiftTo(nsh, r);
};
if (ts < 0){
ZERO.subTo(r, r);
};
}
public function remainder(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
divRemTo(_arg1, null, _local2);
return (_local2);
}
bi_internal function multiplyUpperTo(_arg1:BigInteger, _arg2:int, _arg3:BigInteger):void{
_arg2--;
var _local4:int = (_arg3.t = ((t + _arg1.t) - _arg2));
_arg3.s = 0;
while (--_local4 >= 0) {
_arg3.a[_local4] = 0;
};
_local4 = Math.max((_arg2 - t), 0);
while (_local4 < _arg1.t) {
_arg3.a[((t + _local4) - _arg2)] = am((_arg2 - _local4), _arg1.a[_local4], _arg3, 0, 0, ((t + _local4) - _arg2));
_local4++;
};
_arg3.clamp();
_arg3.drShiftTo(1, _arg3);
}
public function divideAndRemainder(_arg1:BigInteger):Array{
var _local2:BigInteger = new BigInteger();
var _local3:BigInteger = new BigInteger();
divRemTo(_arg1, _local2, _local3);
return ([_local2, _local3]);
}
public function valueOf():Number{
var _local1:Number = 1;
var _local2:Number = 0;
var _local3:uint;
while (_local3 < t) {
_local2 = (_local2 + (a[_local3] * _local1));
_local1 = (_local1 * DV);
_local3++;
};
return (_local2);
}
public function shiftLeft(_arg1:int):BigInteger{
var _local2:BigInteger = new BigInteger();
if (_arg1 < 0){
rShiftTo(-(_arg1), _local2);
} else {
lShiftTo(_arg1, _local2);
};
return (_local2);
}
public function multiply(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
multiplyTo(_arg1, _local2);
return (_local2);
}
bi_internal function am(_arg1:int, _arg2:int, _arg3:BigInteger, _arg4:int, _arg5:int, _arg6:int):int{
var _local9:int;
var _local10:int;
var _local11:int;
var _local7 = (_arg2 & 32767);
var _local8 = (_arg2 >> 15);
while (--_arg6 >= 0) {
_local9 = (a[_arg1] & 32767);
var _temp1 = _arg1;
_arg1 = (_arg1 + 1);
_local10 = (a[_temp1] >> 15);
_local11 = ((_local8 * _local9) + (_local10 * _local7));
_local9 = ((((_local7 * _local9) + ((_local11 & 32767) << 15)) + _arg3.a[_arg4]) + (_arg5 & 1073741823));
_arg5 = ((((_local9 >>> 30) + (_local11 >>> 15)) + (_local8 * _local10)) + (_arg5 >>> 30));
var _temp2 = _arg4;
_arg4 = (_arg4 + 1);
var _local12 = _temp2;
_arg3.a[_local12] = (_local9 & 1073741823);
};
return (_arg5);
}
bi_internal function drShiftTo(_arg1:int, _arg2:BigInteger):void{
var _local3:int;
_local3 = _arg1;
while (_local3 < t) {
_arg2.a[(_local3 - _arg1)] = a[_local3];
_local3++;
};
_arg2.t = Math.max((t - _arg1), 0);
_arg2.s = s;
}
public function add(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
addTo(_arg1, _local2);
return (_local2);
}
protected function nbi(){
return (new BigInteger());
}
protected function millerRabin(_arg1:int):Boolean{
var _local7:BigInteger;
var _local8:int;
var _local2:BigInteger = subtract(BigInteger.ONE);
var _local3:int = _local2.getLowestSetBit();
if (_local3 <= 0){
return (false);
};
var _local4:BigInteger = _local2.shiftRight(_local3);
_arg1 = ((_arg1 + 1) >> 1);
if (_arg1 > lowprimes.length){
_arg1 = lowprimes.length;
};
var _local5:BigInteger = new BigInteger();
var _local6:int;
while (_local6 < _arg1) {
_local5.fromInt(lowprimes[_local6]);
_local7 = _local5.modPow(_local4, this);
if (((!((_local7.compareTo(BigInteger.ONE) == 0))) && (!((_local7.compareTo(_local2) == 0))))){
_local8 = 1;
while ((((_local8++ < _local3)) && (!((_local7.compareTo(_local2) == 0))))) {
_local7 = _local7.modPowInt(2, this);
if (_local7.compareTo(BigInteger.ONE) == 0){
return (false);
};
};
if (_local7.compareTo(_local2) != 0){
return (false);
};
};
_local6++;
};
return (true);
}
bi_internal function dMultiply(_arg1:int):void{
a[t] = am(0, (_arg1 - 1), this, 0, 0, t);
t++;
clamp();
}
private function op_andnot(_arg1:int, _arg2:int):int{
return ((_arg1 & ~(_arg2)));
}
bi_internal function clamp():void{
var _local1 = (s & DM);
while ((((t > 0)) && ((a[(t - 1)] == _local1)))) {
t--;
};
}
bi_internal function invDigit():int{
if (t < 1){
return (0);
};
var _local1:int = a[0];
if ((_local1 & 1) == 0){
return (0);
};
var _local2 = (_local1 & 3);
_local2 = ((_local2 * (2 - ((_local1 & 15) * _local2))) & 15);
_local2 = ((_local2 * (2 - ((_local1 & 0xFF) * _local2))) & 0xFF);
_local2 = ((_local2 * (2 - (((_local1 & 0xFFFF) * _local2) & 0xFFFF))) & 0xFFFF);
_local2 = ((_local2 * (2 - ((_local1 * _local2) % DV))) % DV);
return (((_local2)>0) ? (DV - _local2) : -(_local2));
}
protected function changeBit(_arg1:int, _arg2:Function):BigInteger{
var _local3:BigInteger = BigInteger.ONE.shiftLeft(_arg1);
bitwiseTo(_local3, _arg2, _local3);
return (_local3);
}
public function equals(_arg1:BigInteger):Boolean{
return ((compareTo(_arg1) == 0));
}
public function compareTo(_arg1:BigInteger):int{
var _local2:int = (s - _arg1.s);
if (_local2 != 0){
return (_local2);
};
var _local3:int = t;
_local2 = (_local3 - _arg1.t);
if (_local2 != 0){
return (_local2);
};
while (--_local3 >= 0) {
_local2 = (a[_local3] - _arg1.a[_local3]);
if (_local2 != 0){
return (_local2);
};
};
return (0);
}
public function shiftRight(_arg1:int):BigInteger{
var _local2:BigInteger = new BigInteger();
if (_arg1 < 0){
lShiftTo(-(_arg1), _local2);
} else {
rShiftTo(_arg1, _local2);
};
return (_local2);
}
bi_internal function multiplyTo(_arg1:BigInteger, _arg2:BigInteger):void{
var _local3:BigInteger = abs();
var _local4:BigInteger = _arg1.abs();
var _local5:int = _local3.t;
_arg2.t = (_local5 + _local4.t);
while (--_local5 >= 0) {
_arg2.a[_local5] = 0;
};
_local5 = 0;
while (_local5 < _local4.t) {
_arg2.a[(_local5 + _local3.t)] = _local3.am(0, _local4.a[_local5], _arg2, _local5, 0, _local3.t);
_local5++;
};
_arg2.s = 0;
_arg2.clamp();
if (s != _arg1.s){
ZERO.subTo(_arg2, _arg2);
};
}
public function bitCount():int{
var _local1:int;
var _local2 = (s & DM);
var _local3:int;
while (_local3 < t) {
_local1 = (_local1 + cbit((a[_local3] ^ _local2)));
_local3++;
};
return (_local1);
}
protected function toRadix(_arg1:uint=10):String{
if ((((((sigNum() == 0)) || ((_arg1 < 2)))) || ((_arg1 > 32)))){
return ("0");
};
var _local2:int = chunkSize(_arg1);
var _local3:Number = Math.pow(_arg1, _local2);
var _local4:BigInteger = nbv(_local3);
var _local5:BigInteger = nbi();
var _local6:BigInteger = nbi();
var _local7 = "";
divRemTo(_local4, _local5, _local6);
while (_local5.sigNum() > 0) {
_local7 = ((_local3 + _local6.intValue()).toString(_arg1).substr(1) + _local7);
_local5.divRemTo(_local4, _local5, _local6);
};
return ((_local6.intValue().toString(_arg1) + _local7));
}
private function cbit(_arg1:int):int{
var _local2:uint;
while (_arg1 != 0) {
_arg1 = (_arg1 & (_arg1 - 1));
_local2++;
};
return (_local2);
}
bi_internal function rShiftTo(_arg1:int, _arg2:BigInteger):void{
var _local7:int;
_arg2.s = s;
var _local3:int = (_arg1 / DB);
if (_local3 >= t){
_arg2.t = 0;
return;
};
var _local4:int = (_arg1 % DB);
var _local5:int = (DB - _local4);
var _local6:int = ((1 << _local4) - 1);
_arg2.a[0] = (a[_local3] >> _local4);
_local7 = (_local3 + 1);
while (_local7 < t) {
_arg2.a[((_local7 - _local3) - 1)] = (_arg2.a[((_local7 - _local3) - 1)] | ((a[_local7] & _local6) << _local5));
_arg2.a[(_local7 - _local3)] = (a[_local7] >> _local4);
_local7++;
};
if (_local4 > 0){
_arg2.a[((t - _local3) - 1)] = (_arg2.a[((t - _local3) - 1)] | ((s & _local6) << _local5));
};
_arg2.t = (t - _local3);
_arg2.clamp();
}
public function modInverse(_arg1:BigInteger):BigInteger{
var _local2:Boolean = _arg1.isEven();
if (((((isEven()) && (_local2))) || ((_arg1.sigNum() == 0)))){
return (BigInteger.ZERO);
};
var _local3:BigInteger = _arg1.clone();
var _local4:BigInteger = clone();
var _local5:BigInteger = nbv(1);
var _local6:BigInteger = nbv(0);
var _local7:BigInteger = nbv(0);
var _local8:BigInteger = nbv(1);
while (_local3.sigNum() != 0) {
while (_local3.isEven()) {
_local3.rShiftTo(1, _local3);
if (_local2){
if (((!(_local5.isEven())) || (!(_local6.isEven())))){
_local5.addTo(this, _local5);
_local6.subTo(_arg1, _local6);
};
_local5.rShiftTo(1, _local5);
} else {
if (!_local6.isEven()){
_local6.subTo(_arg1, _local6);
};
};
_local6.rShiftTo(1, _local6);
};
while (_local4.isEven()) {
_local4.rShiftTo(1, _local4);
if (_local2){
if (((!(_local7.isEven())) || (!(_local8.isEven())))){
_local7.addTo(this, _local7);
_local8.subTo(_arg1, _local8);
};
_local7.rShiftTo(1, _local7);
} else {
if (!_local8.isEven()){
_local8.subTo(_arg1, _local8);
};
};
_local8.rShiftTo(1, _local8);
};
if (_local3.compareTo(_local4) >= 0){
_local3.subTo(_local4, _local3);
if (_local2){
_local5.subTo(_local7, _local5);
};
_local6.subTo(_local8, _local6);
} else {
_local4.subTo(_local3, _local4);
if (_local2){
_local7.subTo(_local5, _local7);
};
_local8.subTo(_local6, _local8);
};
};
if (_local4.compareTo(BigInteger.ONE) != 0){
return (BigInteger.ZERO);
};
if (_local8.compareTo(_arg1) >= 0){
return (_local8.subtract(_arg1));
};
if (_local8.sigNum() < 0){
_local8.addTo(_arg1, _local8);
} else {
return (_local8);
};
if (_local8.sigNum() < 0){
return (_local8.add(_arg1));
};
return (_local8);
}
bi_internal function fromArray(_arg1:ByteArray, _arg2:int):void{
var _local7:int;
var _local3:int = _arg1.position;
var _local4:int = (_local3 + _arg2);
var _local5:int;
var _local6 = 8;
t = 0;
s = 0;
while (--_local4 >= _local3) {
_local7 = ((_local4 < _arg1.length)) ? _arg1[_local4] : 0;
if (_local5 == 0){
var _local8 = t++;
a[_local8] = _local7;
} else {
if ((_local5 + _local6) > DB){
a[(t - 1)] = (a[(t - 1)] | ((_local7 & ((1 << (DB - _local5)) - 1)) << _local5));
_local8 = t++;
a[_local8] = (_local7 >> (DB - _local5));
} else {
a[(t - 1)] = (a[(t - 1)] | (_local7 << _local5));
};
};
_local5 = (_local5 + _local6);
if (_local5 >= DB){
_local5 = (_local5 - DB);
};
};
clamp();
_arg1.position = Math.min((_local3 + _arg2), _arg1.length);
}
bi_internal function copyTo(_arg1:BigInteger):void{
var _local2:int = (t - 1);
while (_local2 >= 0) {
_arg1.a[_local2] = a[_local2];
_local2--;
};
_arg1.t = t;
_arg1.s = s;
}
public function intValue():int{
if (s < 0){
if (t == 1){
return ((a[0] - DV));
};
if (t == 0){
return (-1);
};
} else {
if (t == 1){
return (a[0]);
};
if (t == 0){
return (0);
};
};
return ((((a[1] & ((1 << (32 - DB)) - 1)) << DB) | a[0]));
}
public function min(_arg1:BigInteger):BigInteger{
return (((compareTo(_arg1))<0) ? this : _arg1);
}
public function bitLength():int{
if (t <= 0){
return (0);
};
return (((DB * (t - 1)) + nbits((a[(t - 1)] ^ (s & DM)))));
}
public function shortValue():int{
return (((t)==0) ? s : ((a[0] << 16) >> 16));
}
public function and(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
bitwiseTo(_arg1, op_and, _local2);
return (_local2);
}
public function byteValue():int{
return (((t)==0) ? s : ((a[0] << 24) >> 24));
}
public function not():BigInteger{
var _local1:BigInteger = new BigInteger();
var _local2:int;
while (_local2 < t) {
_local1[_local2] = (DM & ~(a[_local2]));
_local2++;
};
_local1.t = t;
_local1.s = ~(s);
return (_local1);
}
bi_internal function subTo(_arg1:BigInteger, _arg2:BigInteger):void{
var _local3:int;
var _local4:int;
var _local5:int = Math.min(_arg1.t, t);
while (_local3 < _local5) {
_local4 = (_local4 + (a[_local3] - _arg1.a[_local3]));
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _local6 = _temp1;
_arg2.a[_local6] = (_local4 & DM);
_local4 = (_local4 >> DB);
};
if (_arg1.t < t){
_local4 = (_local4 - _arg1.s);
while (_local3 < t) {
_local4 = (_local4 + a[_local3]);
var _temp2 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp2;
_arg2.a[_local6] = (_local4 & DM);
_local4 = (_local4 >> DB);
};
_local4 = (_local4 + s);
} else {
_local4 = (_local4 + s);
while (_local3 < _arg1.t) {
_local4 = (_local4 - _arg1.a[_local3]);
var _temp3 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp3;
_arg2.a[_local6] = (_local4 & DM);
_local4 = (_local4 >> DB);
};
_local4 = (_local4 - _arg1.s);
};
_arg2.s = ((_local4)<0) ? -1 : 0;
if (_local4 < -1){
var _temp4 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp4;
_arg2.a[_local6] = (DV + _local4);
} else {
if (_local4 > 0){
var _temp5 = _local3;
_local3 = (_local3 + 1);
_local6 = _temp5;
_arg2.a[_local6] = _local4;
};
};
_arg2.t = _local3;
_arg2.clamp();
}
public function clone():BigInteger{
var _local1:BigInteger = new BigInteger();
this.copyTo(_local1);
return (_local1);
}
public function pow(_arg1:int):BigInteger{
return (exp(_arg1, new NullReduction()));
}
public function flipBit(_arg1:int):BigInteger{
return (changeBit(_arg1, op_xor));
}
public function xor(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
bitwiseTo(_arg1, op_xor, _local2);
return (_local2);
}
public function or(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
bitwiseTo(_arg1, op_or, _local2);
return (_local2);
}
public function max(_arg1:BigInteger):BigInteger{
return (((compareTo(_arg1))>0) ? this : _arg1);
}
bi_internal function fromInt(_arg1:int):void{
t = 1;
s = ((_arg1)<0) ? -1 : 0;
if (_arg1 > 0){
a[0] = _arg1;
} else {
if (_arg1 < -1){
a[0] = (_arg1 + DV);
} else {
t = 0;
};
};
}
bi_internal function isEven():Boolean{
return ((((t)>0) ? (a[0] & 1) : s == 0));
}
public function toString(_arg1:Number=16):String{
var _local2:int;
if (s < 0){
return (("-" + negate().toString(_arg1)));
};
switch (_arg1){
case 2:
_local2 = 1;
break;
case 4:
_local2 = 2;
break;
case 8:
_local2 = 3;
break;
case 16:
_local2 = 4;
break;
case 32:
_local2 = 5;
break;
};
var _local3:int = ((1 << _local2) - 1);
var _local4:int;
var _local5:Boolean;
var _local6 = "";
var _local7:int = t;
var _local8:int = (DB - ((_local7 * DB) % _local2));
var _temp1 = _local7;
_local7 = (_local7 - 1);
if (_temp1 > 0){
if ((((_local8 < DB)) && (((a[_local7] >> _local8) > 0)))){
_local5 = true;
_local6 = _local4.toString(36);
};
while (_local7 >= 0) {
if (_local8 < _local2){
_local4 = ((a[_local7] & ((1 << _local8) - 1)) << (_local2 - _local8));
var _temp2 = _local4;
_local7 = (_local7 - 1);
_local8 = (_local8 + (DB - _local2));
_local4 = (_temp2 | (a[_local7] >> _local8));
} else {
_local8 = (_local8 - _local2);
_local4 = ((a[_local7] >> _local8) & _local3);
if (_local8 <= 0){
_local8 = (_local8 + DB);
_local7--;
};
};
if (_local4 > 0){
_local5 = true;
};
if (_local5){
_local6 = (_local6 + _local4.toString(36));
};
};
};
return ((_local5) ? _local6 : "0");
}
public function setBit(_arg1:int):BigInteger{
return (changeBit(_arg1, op_or));
}
public function abs():BigInteger{
return (((s)<0) ? negate() : this);
}
bi_internal function nbits(_arg1:int):int{
var _local3:int;
var _local2 = 1;
_local3 = (_arg1 >>> 16);
if (_local3 != 0){
_arg1 = _local3;
_local2 = (_local2 + 16);
};
_local3 = (_arg1 >> 8);
if (_local3 != 0){
_arg1 = _local3;
_local2 = (_local2 + 8);
};
_local3 = (_arg1 >> 4);
if (_local3 != 0){
_arg1 = _local3;
_local2 = (_local2 + 4);
};
_local3 = (_arg1 >> 2);
if (_local3 != 0){
_arg1 = _local3;
_local2 = (_local2 + 2);
};
_local3 = (_arg1 >> 1);
if (_local3 != 0){
_arg1 = _local3;
_local2 = (_local2 + 1);
};
return (_local2);
}
public function sigNum():int{
if (s < 0){
return (-1);
};
if ((((t <= 0)) || ((((t == 1)) && ((a[0] <= 0)))))){
return (0);
};
return (1);
}
public function toByteArray():ByteArray{
var _local4:int;
var _local1:int = t;
var _local2:ByteArray = new ByteArray();
_local2[0] = s;
var _local3:int = (DB - ((_local1 * DB) % 8));
var _local5:int;
var _temp1 = _local1;
_local1 = (_local1 - 1);
if (_temp1 > 0){
if ((((_local3 < DB)) && (!(((a[_local1] >> _local3) == ((s & DM) >> _local3)))))){
var _temp2 = _local5;
_local5 = (_local5 + 1);
var _local6 = _temp2;
_local2[_local6] = (_local4 | (s << (DB - _local3)));
};
while (_local1 >= 0) {
if (_local3 < 8){
_local4 = ((a[_local1] & ((1 << _local3) - 1)) << (8 - _local3));
var _temp3 = _local4;
_local1 = (_local1 - 1);
_local3 = (_local3 + (DB - 8));
_local4 = (_temp3 | (a[_local1] >> _local3));
} else {
_local3 = (_local3 - 8);
_local4 = ((a[_local1] >> _local3) & 0xFF);
if (_local3 <= 0){
_local3 = (_local3 + DB);
_local1--;
};
};
if ((_local4 & 128) != 0){
_local4 = (_local4 | -256);
};
if ((((_local5 == 0)) && (!(((s & 128) == (_local4 & 128)))))){
_local5++;
};
if ((((_local5 > 0)) || (!((_local4 == s))))){
var _temp4 = _local5;
_local5 = (_local5 + 1);
_local6 = _temp4;
_local2[_local6] = _local4;
};
};
};
return (_local2);
}
bi_internal function squareTo(_arg1:BigInteger):void{
var _local4:int;
var _local2:BigInteger = abs();
var _local3:int = (_arg1.t = (2 * _local2.t));
while (--_local3 >= 0) {
_arg1.a[_local3] = 0;
};
_local3 = 0;
while (_local3 < (_local2.t - 1)) {
_local4 = _local2.am(_local3, _local2.a[_local3], _arg1, (2 * _local3), 0, 1);
if ((_arg1.a[(_local3 + _local2.t)] = (_arg1.a[(_local3 + _local2.t)] + _local2.am((_local3 + 1), (2 * _local2.a[_local3]), _arg1, ((2 * _local3) + 1), _local4, ((_local2.t - _local3) - 1)))) >= DV){
_arg1.a[(_local3 + _local2.t)] = (_arg1.a[(_local3 + _local2.t)] - DV);
_arg1.a[((_local3 + _local2.t) + 1)] = 1;
};
_local3++;
};
if (_arg1.t > 0){
_arg1.a[(_arg1.t - 1)] = (_arg1.a[(_arg1.t - 1)] + _local2.am(_local3, _local2.a[_local3], _arg1, (2 * _local3), 0, 1));
};
_arg1.s = 0;
_arg1.clamp();
}
private function op_and(_arg1:int, _arg2:int):int{
return ((_arg1 & _arg2));
}
protected function fromRadix(_arg1:String, _arg2:int=10):void{
var _local9:int;
fromInt(0);
var _local3:int = chunkSize(_arg2);
var _local4:Number = Math.pow(_arg2, _local3);
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:int;
while (_local8 < _arg1.length) {
_local9 = intAt(_arg1, _local8);
if (_local9 < 0){
if ((((_arg1.charAt(_local8) == "-")) && ((sigNum() == 0)))){
_local5 = true;
};
} else {
_local7 = ((_arg2 * _local7) + _local9);
++_local6;
if (_local6 >= _local3){
dMultiply(_local4);
dAddOffset(_local7, 0);
_local6 = 0;
_local7 = 0;
};
};
_local8++;
};
if (_local6 > 0){
dMultiply(Math.pow(_arg2, _local6));
dAddOffset(_local7, 0);
};
if (_local5){
BigInteger.ZERO.subTo(this, this);
};
}
bi_internal function dlShiftTo(_arg1:int, _arg2:BigInteger):void{
var _local3:int;
_local3 = (t - 1);
while (_local3 >= 0) {
_arg2.a[(_local3 + _arg1)] = a[_local3];
_local3--;
};
_local3 = (_arg1 - 1);
while (_local3 >= 0) {
_arg2.a[_local3] = 0;
_local3--;
};
_arg2.t = (t + _arg1);
_arg2.s = s;
}
private function op_xor(_arg1:int, _arg2:int):int{
return ((_arg1 ^ _arg2));
}
public static function nbv(_arg1:int):BigInteger{
var _local2:BigInteger = new (BigInteger);
_local2.fromInt(_arg1);
return (_local2);
}
}
}//package com.hurlant.math
Section 37
//ClassicReduction (com.hurlant.math.ClassicReduction)
package com.hurlant.math {
import com.hurlant.math.*;
class ClassicReduction implements IReduction {
private var m:BigInteger;
function ClassicReduction(_arg1:BigInteger){
this.m = _arg1;
}
public function revert(_arg1:BigInteger):BigInteger{
return (_arg1);
}
public function reduce(_arg1:BigInteger):void{
_arg1.divRemTo(m, null, _arg1);
}
public function mulTo(_arg1:BigInteger, _arg2:BigInteger, _arg3:BigInteger):void{
_arg1.multiplyTo(_arg2, _arg3);
reduce(_arg3);
}
public function sqrTo(_arg1:BigInteger, _arg2:BigInteger):void{
_arg1.squareTo(_arg2);
reduce(_arg2);
}
public function convert(_arg1:BigInteger):BigInteger{
if ((((_arg1.s < 0)) || ((_arg1.compareTo(m) >= 0)))){
return (_arg1.mod(m));
};
return (_arg1);
}
}
}//package com.hurlant.math
Section 38
//IReduction (com.hurlant.math.IReduction)
package com.hurlant.math {
import com.hurlant.math.*;
interface IReduction {
function revert(_arg1:BigInteger):BigInteger;
function reduce(_arg1:BigInteger):void;
function convert(_arg1:BigInteger):BigInteger;
function mulTo(_arg1:BigInteger, _arg2:BigInteger, _arg3:BigInteger):void;
function sqrTo(_arg1:BigInteger, _arg2:BigInteger):void;
}
}//package com.hurlant.math
Section 39
//MontgomeryReduction (com.hurlant.math.MontgomeryReduction)
package com.hurlant.math {
import com.hurlant.math.*;
class MontgomeryReduction implements IReduction {
private var mp:int;
private var mph:int;
private var mpl:int;
private var mt2:int;
private var m:BigInteger;
private var um:int;
function MontgomeryReduction(_arg1:BigInteger){
this.m = _arg1;
mp = _arg1.invDigit();
mpl = (mp & 32767);
mph = (mp >> 15);
um = ((1 << (BigInteger.DB - 15)) - 1);
mt2 = (2 * _arg1.t);
}
public function convert(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
_arg1.abs().dlShiftTo(m.t, _local2);
_local2.divRemTo(m, null, _local2);
if ((((_arg1.s < 0)) && ((_local2.compareTo(BigInteger.ZERO) > 0)))){
m.subTo(_local2, _local2);
};
return (_local2);
}
public function revert(_arg1:BigInteger):BigInteger{
var _local2:BigInteger = new BigInteger();
_arg1.copyTo(_local2);
reduce(_local2);
return (_local2);
}
public function sqrTo(_arg1:BigInteger, _arg2:BigInteger):void{
_arg1.squareTo(_arg2);
reduce(_arg2);
}
public function reduce(_arg1:BigInteger):void{
var _local3:int;
var _local4:int;
while (_arg1.t <= mt2) {
var _local5 = _arg1.t++;
_arg1.a[_local5] = 0;
};
var _local2:int;
while (_local2 < m.t) {
_local3 = (_arg1.a[_local2] & 32767);
_local4 = (((_local3 * mpl) + ((((_local3 * mph) + ((_arg1.a[_local2] >> 15) * mpl)) & um) << 15)) & BigInteger.DM);
_local3 = (_local2 + m.t);
_arg1.a[_local3] = (_arg1.a[_local3] + m.am(0, _local4, _arg1, _local2, 0, m.t));
while (_arg1.a[_local3] >= BigInteger.DV) {
_arg1.a[_local3] = (_arg1.a[_local3] - BigInteger.DV);
_local5 = _arg1.a;
++_local3;
var _local6 = _local3;
var _local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
};
_local2++;
};
_arg1.clamp();
_arg1.drShiftTo(m.t, _arg1);
if (_arg1.compareTo(m) >= 0){
_arg1.subTo(m, _arg1);
};
}
public function mulTo(_arg1:BigInteger, _arg2:BigInteger, _arg3:BigInteger):void{
_arg1.multiplyTo(_arg2, _arg3);
reduce(_arg3);
}
}
}//package com.hurlant.math
Section 40
//NullReduction (com.hurlant.math.NullReduction)
package com.hurlant.math {
public class NullReduction implements IReduction {
public function convert(_arg1:BigInteger):BigInteger{
return (_arg1);
}
public function sqrTo(_arg1:BigInteger, _arg2:BigInteger):void{
_arg1.squareTo(_arg2);
}
public function mulTo(_arg1:BigInteger, _arg2:BigInteger, _arg3:BigInteger):void{
_arg1.multiplyTo(_arg2, _arg3);
}
public function revert(_arg1:BigInteger):BigInteger{
return (_arg1);
}
public function reduce(_arg1:BigInteger):void{
}
}
}//package com.hurlant.math
Section 41
//Base64 (com.hurlant.util.Base64)
package com.hurlant.util {
import flash.utils.*;
public class Base64 {
public static const version:String = "1.0.0";
private static const BASE64_CHARS:String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
public function Base64(){
throw (new Error("Base64 class is static container only"));
}
public static function encode(_arg1:String):String{
var _local2:ByteArray = new ByteArray();
_local2.writeUTFBytes(_arg1);
return (encodeByteArray(_local2));
}
public static function encodeByteArray(_arg1:ByteArray):String{
var _local3:Array;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local2 = "";
var _local4:Array = new Array(4);
_arg1.position = 0;
while (_arg1.bytesAvailable > 0) {
_local3 = new Array();
_local5 = 0;
while ((((_local5 < 3)) && ((_arg1.bytesAvailable > 0)))) {
_local3[_local5] = _arg1.readUnsignedByte();
_local5++;
};
_local4[0] = ((_local3[0] & 252) >> 2);
_local4[1] = (((_local3[0] & 3) << 4) | (_local3[1] >> 4));
_local4[2] = (((_local3[1] & 15) << 2) | (_local3[2] >> 6));
_local4[3] = (_local3[2] & 63);
_local6 = _local3.length;
while (_local6 < 3) {
_local4[(_local6 + 1)] = 64;
_local6++;
};
_local7 = 0;
while (_local7 < _local4.length) {
_local2 = (_local2 + BASE64_CHARS.charAt(_local4[_local7]));
_local7++;
};
};
return (_local2);
}
public static function decode(_arg1:String):String{
var _local2:ByteArray = decodeToByteArray(_arg1);
return (_local2.readUTFBytes(_local2.length));
}
public static function decodeToByteArray(_arg1:String):ByteArray{
var _local6:uint;
var _local7:uint;
var _local2:ByteArray = new ByteArray();
var _local3:Array = new Array(4);
var _local4:Array = new Array(3);
var _local5:uint;
while (_local5 < _arg1.length) {
_local6 = 0;
while ((((_local6 < 4)) && (((_local5 + _local6) < _arg1.length)))) {
_local3[_local6] = BASE64_CHARS.indexOf(_arg1.charAt((_local5 + _local6)));
_local6++;
};
_local4[0] = ((_local3[0] << 2) + ((_local3[1] & 48) >> 4));
_local4[1] = (((_local3[1] & 15) << 4) + ((_local3[2] & 60) >> 2));
_local4[2] = (((_local3[2] & 3) << 6) + _local3[3]);
_local7 = 0;
while (_local7 < _local4.length) {
if (_local3[(_local7 + 1)] == 64){
break;
};
_local2.writeByte(_local4[_local7]);
_local7++;
};
_local5 = (_local5 + 4);
};
_local2.position = 0;
return (_local2);
}
}
}//package com.hurlant.util
Section 42
//Hex (com.hurlant.util.Hex)
package com.hurlant.util {
import flash.utils.*;
public class Hex {
public static function fromString(_arg1:String, _arg2:Boolean=false):String{
var _local3:ByteArray = new ByteArray();
_local3.writeUTFBytes(_arg1);
return (fromArray(_local3, _arg2));
}
public static function toString(_arg1:String):String{
var _local2:ByteArray = toArray(_arg1);
return (_local2.readUTFBytes(_local2.length));
}
public static function toArray(_arg1:String):ByteArray{
_arg1 = _arg1.replace(/\s|:/gm, "");
var _local2:ByteArray = new ByteArray();
if ((_arg1.length & (1 == 1))){
_arg1 = ("0" + _arg1);
};
var _local3:uint;
while (_local3 < _arg1.length) {
_local2[(_local3 / 2)] = parseInt(_arg1.substr(_local3, 2), 16);
_local3 = (_local3 + 2);
};
return (_local2);
}
public static function fromArray(_arg1:ByteArray, _arg2:Boolean=false):String{
var _local3 = "";
var _local4:uint;
while (_local4 < _arg1.length) {
_local3 = (_local3 + ("0" + _arg1[_local4].toString(16)).substr(-2, 2));
if (_arg2){
if (_local4 < (_arg1.length - 1)){
_local3 = (_local3 + ":");
};
};
_local4++;
};
return (_local3);
}
}
}//package com.hurlant.util
Section 43
//Memory (com.hurlant.util.Memory)
package com.hurlant.util {
import flash.net.*;
import flash.system.*;
public class Memory {
public static function gc():void{
try {
new LocalConnection().connect("foo");
new LocalConnection().connect("foo");
} catch(e) {
};
}
public static function get used():uint{
return (System.totalMemory);
}
}
}//package com.hurlant.util
Section 44
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 45
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 46
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 47
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
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;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local5:int;
var _local6:String;
_target = _arg1.target;
if (_arg1.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if ((_arg1.exposedVars.orientToBezier is Array)){
_orientData = _arg1.exposedVars.orientToBezier;
_orient = true;
};
};
var _local4:Object = {};
_local5 = 0;
while (_local5 < _arg2.length) {
for (_local6 in _arg2[_local5]) {
if (_local4[_local6] == undefined){
_local4[_local6] = [_arg1.target[_local6]];
};
if (typeof(_arg2[_local5][_local6]) == "number"){
_local4[_local6].push(_arg2[_local5][_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg2[_local5][_local6])));
};
};
_local5++;
};
for (_local6 in _local4) {
this.overwriteProps[this.overwriteProps.length] = _local6;
if (_arg1.exposedVars[_local6] != undefined){
if (typeof(_arg1.exposedVars[_local6]) == "number"){
_local4[_local6].push(_arg1.exposedVars[_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg1.exposedVars[_local6])));
};
delete _arg1.exposedVars[_local6];
_local5 = (_arg1.tweens.length - 1);
while (_local5 > -1) {
if (_arg1.tweens[_local5].name == _local6){
_arg1.tweens.splice(_local5, 1);
};
_local5--;
};
};
};
_beziers = parseBeziers(_local4, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:int;
var _local9:Object;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
var _local13:Array;
var _local14:Number;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_local8 = ((_local7)<0) ? -1 : 1;
_target[_local3] = ((((_local7 % 1) * _local8))>0.5) ? (int(_local7) + _local8) : int(_local7);
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local9 = _target;
_local10 = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = (_arg1 + 0.01);
_target = _local9;
this.round = _local10;
_orient = true;
_local2 = 0;
while (_local2 < _orientData.length) {
_local13 = _orientData[_local2];
_local14 = ((_local13[3]) || (0));
_local11 = (_future[_local13[0]] - _target[_local13[0]]);
_local12 = (_future[_local13[1]] - _target[_local13[1]]);
_target[_local13[2]] = ((Math.atan2(_local12, _local11) * _RAD2DEG) + _local14);
_local2++;
};
};
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package gs.plugins
Section 48
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package gs.plugins
Section 49
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 50
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.01;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = ColorMatrixFilter;
var _local4:Object = _arg2;
initFilter({}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
var _local5:Array = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
}
}//package gs.plugins
Section 51
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject));
return (true);
}
}
}//package gs.plugins
Section 52
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
}
}//package gs.plugins
Section 53
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
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 = 1.03;
public static const API:Number = 1;
public function onCompleteTween():void{
var _local1:int;
var _local2:Array;
if (_remove){
_local2 = _target.filters;
if (!(_local2[_index] is _type)){
_local1 = (_local2.length - 1);
while (_local1 > -1) {
if ((_local2[_local1] is _type)){
_local2.splice(_local1, 1);
break;
};
_local1--;
};
} else {
_local2.splice(_index, 1);
};
_target.filters = _local2;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local3:Array = _target.filters;
_index = -1;
if (_arg1.index != null){
_index = _arg1.index;
} else {
_local5 = (_local3.length - 1);
while (_local5 > -1) {
if ((_local3[_local5] is _type)){
_index = _local5;
break;
};
_local5--;
};
};
if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){
_index = ((_arg1.index)!=null) ? _arg1.index : _local3.length;
_local3[_index] = _arg2;
_target.filters = _local3;
};
_filter = _local3[_index];
_remove = Boolean((_arg1.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
var _local7:Object = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1;
for (_local4 in _local7) {
if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){
} else {
if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){
_local6 = new HexColorsPlugin();
_local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]);
_tweens[_tweens.length] = new TweenInfo(_local6, "changeFactor", 0, 1, _local4, false);
} else {
if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){
_filter[_local4] = _local7[_local4];
} else {
addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4);
};
};
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array = _target.filters;
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
if (!(_local4[_index] is _type)){
_index = (_local4.length - 1);
_local2 = (_local4.length - 1);
while (_local2 > -1) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
_local2--;
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
}
}//package gs.plugins
Section 54
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package gs.plugins
Section 55
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout));
return (true);
}
}
}//package gs.plugins
Section 56
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(_arg1:Object):void{
var _local2:int = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
}
}//package gs.plugins
Section 57
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 58
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 59
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], _arg2[_local4]);
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 60
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _target:DisplayObject;
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
}
}//package gs.plugins
Section 61
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 62
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 63
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
}
}//package gs.plugins
Section 64
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 65
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 66
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
import gs.utils.tween.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array):void{
var _local4:int;
var _local5:String;
var _local6:TweenInfo;
_local4 = (_arg3.length - 1);
while (_local4 > -1) {
_local6 = _arg3[_local4];
if ((_local6.name in _arg1)){
_arg3.splice(_local4, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_arg1);
if (_local6.target.overwriteProps.length == 0){
_arg3.splice(_local4, 1);
};
};
};
_local4--;
};
for (_local5 in _arg1) {
delete _arg2[_local5];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local7:int;
var _local8:TweenLite;
var _local10:Array;
var _local11:Object;
var _local12:int;
var _local13:TweenInfo;
var _local14:Array;
var _local3:Object = _arg1.vars;
var _local4:int = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
var _local5:Number = _arg1.startTime;
var _local6:Array = [];
var _local9 = -1;
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (_local8 == _arg1){
_local9 = _local7;
} else {
if ((((((_local7 < _local9)) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
};
_local7--;
};
if ((((_local6.length == 0)) || ((_arg1.tweens.length == 0)))){
return;
};
if (_local4 == AUTO){
_local10 = _arg1.tweens;
_local11 = {};
_local7 = (_local10.length - 1);
while (_local7 > -1) {
_local13 = _local10[_local7];
if (_local13.isPlugin){
if (_local13.name == "_MULTIPLE_"){
_local14 = _local13.target.overwriteProps;
_local12 = (_local14.length - 1);
while (_local12 > -1) {
_local11[_local14[_local12]] = true;
_local12--;
};
} else {
_local11[_local13.name] = true;
};
_local11[_local13.target.propName] = true;
} else {
_local11[_local13.name] = true;
};
_local7--;
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
killVars(_local11, _local6[_local7].exposedVars, _local6[_local7].tweens);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 67
//TweenLite (gs.TweenLite)
package gs {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import gs.utils.tween.*;
import gs.plugins.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
public static const version:Number = 10.09;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && ((this.target is TweenLite)))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 68
//TweenMax (gs.TweenMax)
package gs {
import flash.utils.*;
import flash.events.*;
import gs.utils.tween.*;
import gs.plugins.*;
import gs.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.1;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (TweenLite.version < 10.09){
trace("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.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if ((((this.delay == 0)) && (!((this.exposedVars.startAt == null))))){
this.exposedVars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.exposedVars.startAt);
};
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
public function get progress():Number{
var _local1:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var _local2:Number = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
override public function set enabled(_arg1:Boolean):void{
if (!_arg1){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local5:int;
var _local6:TweenInfo;
var _local7:Object;
var _local8:Object;
var _local9:Array;
var _local10:Boolean;
var _local11:Array;
var _local12:Object;
var _local4:Number = this.progress;
if (this.initted){
if (!_arg3){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
_local6.target[_local6.property] = _local6.start;
};
_local5--;
};
};
_local7 = this.vars;
_local8 = this.exposedVars;
_local9 = this.tweens;
_local10 = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
_local11 = this.tweens;
this.vars = _local7;
this.exposedVars = _local8;
this.tweens = _local9;
_local12 = {};
_local12[_arg1] = true;
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
this.tweens.splice(_local5, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_local12);
if (_local6.target.overwriteProps.length == 0){
this.tweens.splice(_local5, 1);
};
};
};
_local5--;
};
this.tweens = this.tweens.concat(_local11);
_hasPlugins = Boolean(((_local10) || (_hasPlugins)));
};
this.vars[_arg1] = (this.exposedVars[_arg1] = _arg2);
}
override public function initTweenVals():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Object;
var _local7:TweenInfo;
if (((!((this.exposedVars.startAt == null))) && (!((this.delay == 0))))){
this.exposedVars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.exposedVars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
_local5 = this.exposedVars.roundProps;
_local1 = (_local5.length - 1);
while (_local1 > -1) {
_local3 = _local5[_local1];
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local7 = this.tweens[_local2];
if (_local7.name == _local3){
if (_local7.isPlugin){
_local7.target.round = true;
} else {
if (_local6 == null){
_local6 = new TweenLite.plugins.roundProps();
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
_hasPlugins = true;
this.tweens[_local2] = new TweenInfo(_local6, "changeFactor", 0, 1, _local3, true);
} else {
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
this.tweens.splice(_local2, 1);
};
};
} else {
if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){
_local4 = ((" " + _local7.target.overwriteProps.join(" ")) + " ");
if (_local4.indexOf(((" " + _local3) + " ")) != -1){
_local7.target.round = true;
};
};
};
_local2--;
};
_local1--;
};
};
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
protected function adjustStartValues():void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:TweenInfo;
var _local6:int;
var _local1:Number = this.progress;
if (_local1 != 0){
_local2 = this.ease(_local1, 0, 1, 1);
_local3 = (1 / (1 - _local2));
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
_local5 = this.tweens[_local6];
_local4 = (_local5.start + _local5.change);
if (_local5.isPlugin){
_local5.change = ((_local4 - _local2) * _local3);
} else {
_local5.change = ((_local4 - _local5.target[_local5.property]) * _local3);
};
_local5.start = (_local4 - _local5.change);
_local6--;
};
};
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
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);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var _local3:Number = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
public function killProperties(_arg1:Array):void{
var _local3:int;
var _local2:Object = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
_local2[_arg1[_local3]] = true;
_local3--;
};
killVars(_local2);
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
override public function complete(_arg1:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
var _local2:Dictionary = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenMax)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:TweenLite;
var _local5:int;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2 != null){
_local5 = (_local2.length - 1);
while (_local5 > -1) {
if (!_local2[_local5].gc){
_local3[_local3.length] = _local2[_local5];
};
_local5--;
};
};
for each (_local4 in _pausedTweens) {
if (_local4.target == _arg1){
_local3[_local3.length] = _local4;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array = getTweensOf(_arg1);
var _local3:int = (_local2.length - 1);
while (_local3 > -1) {
if (((((_local2[_local3].active) || ((_local2[_local3].startTime == currentTime)))) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local6:int;
var _local4:Array = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function getAllTweens():Array{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
var _local1:Dictionary = masterList;
var _local2:Array = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 69
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const NO_USER:String = "NoUser";
public static const IO_ERROR:String = "IOError";
public static const ITEM_NEW:String = "ItemNew";
public static const ITEM_OWNED:String = "ItemOwned";
public static const STORE_ITEMS:String = "StoreItems";
public static const ERROR:String = "Error";
public static const STORE_SHOW:String = "StoreShow";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static var _inventory:MochiInventory;
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function get inventory():MochiInventory{
return (_inventory);
}
public static function showStore(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function requestFunding(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFunding", _arg1);
}
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_inventory = new MochiInventory();
});
addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_inventory = null;
});
}
}//package mochi.as3
Section 70
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 71
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 72
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function endPlay():void{
MochiServices.send("events_clearRoundID", null, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function trackEvent(_arg1:String, _arg2=null):void{
MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startPlay(_arg1:String="gameplay"):void{
MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null);
}
}
}//package mochi.as3
Section 73
//MochiInventory (mochi.as3.MochiInventory)
package mochi.as3 {
import flash.utils.*;
import flash.events.*;
public dynamic class MochiInventory extends Proxy {
private var _timer:Timer;
private var _names:Array;
private var _syncID:Number;
private var _consumableProperties:Object;
private var _storeSync:Object;
private var _outstandingID:Number;
private var _syncPending:Boolean;
public static const READY:String = "InvReady";
public static const ERROR:String = "Error";
public static const IO_ERROR:String = "IoError";
private static const KEY_SALT:String = " syncMaint";
public static const WRITTEN:String = "InvWritten";
public static const NOT_READY:String = "InvNotReady";
public static const VALUE_ERROR:String = "InvValueError";
private static const CONSUMER_KEY:String = "MochiConsumables";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public function MochiInventory():void{
MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned);
MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut);
_storeSync = new Object();
_syncPending = false;
_outstandingID = 0;
_syncID = 0;
_timer = new Timer(1000);
_timer.addEventListener(TimerEvent.TIMER, sync);
_timer.start();
if (MochiSocial.loggedIn){
loggedIn();
} else {
loggedOut();
};
}
private function newItems(_arg1:Object):void{
if (!this[(_arg1.id + KEY_SALT)]){
this[(_arg1.id + KEY_SALT)] = 0;
};
if (!this[_arg1.id]){
this[_arg1.id] = 0;
};
this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count);
this[_arg1.id] = (this[_arg1.id] + _arg1.count);
if (((_arg1.privateProperties) && (_arg1.privateProperties.consumable))){
if (!this[_arg1.privateProperties.tag]){
this[_arg1.privateProperties.tag] = 0;
};
this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count));
};
}
public function release():void{
MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems);
MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn);
MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (-1);
};
if (_consumableProperties[_arg1]){
return (MochiDigits(_consumableProperties[_arg1]).value);
};
return (undefined);
}
private function loggedIn(_arg1:Object=null):void{
MochiUserData.get(CONSUMER_KEY, getConsumableBag);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return (false);
};
if (_consumableProperties[_arg1] == undefined){
return (false);
};
return (true);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1));
}
private function putConsumableBag(_arg1:MochiUserData):void{
_syncPending = false;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
_outstandingID = -1;
};
triggerEvent(WRITTEN, {});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:MochiDigits;
if (_consumableProperties == null){
triggerEvent(ERROR, {type:NOT_READY});
return;
};
if (!(_arg2 is Number)){
triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2});
return;
};
if (_consumableProperties[_arg1]){
_local3 = MochiDigits(_consumableProperties[_arg1]);
if (_local3.value == _arg2){
return;
};
_local3.value = _arg2;
} else {
_names.push(_arg1);
_consumableProperties[_arg1] = new MochiDigits(_arg2);
};
_syncID++;
}
private function itemOwned(_arg1:Object):void{
_storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count};
}
private function sync(_arg1:Event=null):void{
var _local3:String;
if (((_syncPending) || ((_syncID == _outstandingID)))){
return;
};
_outstandingID = _syncID;
var _local2:Object = {};
for (_local3 in _consumableProperties) {
_local2[_local3] = MochiDigits(_consumableProperties[_local3]).value;
};
MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag);
_syncPending = true;
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return (_names[(_arg1 - 1)]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{
if (!_consumableProperties[_arg1]){
return (false);
};
_names.splice(_names.indexOf(_arg1), 1);
delete _consumableProperties[_arg1];
return (true);
}
private function getConsumableBag(_arg1:MochiUserData):void{
var _local2:String;
var _local3:Number;
if (_arg1.error){
triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error});
return;
};
_consumableProperties = {};
_names = new Array();
if (_arg1.data){
for (_local2 in _arg1.data) {
_names.push(_local2);
_consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]);
};
};
for (_local2 in _storeSync) {
_local3 = _storeSync[_local2].count;
if (_consumableProperties[(_local2 + KEY_SALT)]){
_local3 = (_local3 - _consumableProperties[(_local2 + KEY_SALT)].value);
};
if (_local3 == 0){
} else {
newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties});
};
};
triggerEvent(READY, {});
}
private function loggedOut(_arg1:Object=null):void{
_consumableProperties = null;
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package mochi.as3
Section 74
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
public static const CONNECTED:String = "onConnected";
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _queue:Array;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _nextCallbackID:Number;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var _callbacks:Object;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _callbacks[cb];
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID});
};
if (_clip != null){
if (_callbacks != null){
_callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_nextCallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
private static function detach(_arg1:Event):void{
var _local2:LoaderInfo = LoaderInfo(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, detach);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.removeEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
private static function loadLCBridgeComplete(_arg1:Event):void{
var _local2:Loader = LoaderInfo(_arg1.target).loader;
_mochiLocalConnection = MovieClip(_local2.content);
listen();
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.9.2 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_queue))){
while (_queue.length > 0) {
_local2 = _queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _callbacks[_local2.callbackID];
};
delete _callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "services":
MochiServices.triggerEvent(_arg1.event, _arg1.args);
break;
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "social":
MochiSocial.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://link.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_clip.parent){
_clip.parent.removeChild(_clip);
};
if (_arg1 != null){
if ((_arg1 is DisplayObjectContainer)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is DisplayObjectContainer)){
DisplayObjectContainer(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
public static function get childClip():Object{
return (_clip);
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift());
};
};
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
private static function loadLCBridge(_arg1:Object):void{
var _local2:Loader = new Loader();
var _local3:String = (_servURL + _mochiLC);
var _local4:URLRequest = new URLRequest(_local3);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_local2.contentLoaderInfo.addEventListener(Event.COMPLETE, loadLCBridgeComplete);
_local2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local2.load(_local4);
_arg1.addChild(_local2);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local3:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local3 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local3);
_clip = new MovieClip();
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, detach);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local4:URLRequest = new URLRequest(_local3);
var _local5:URLVariables = new URLVariables();
_local5.listenLC = _listenChannelName;
_local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local5.api_version = getVersion();
if (widget){
_local5.widget = true;
};
_local4.data = _local5;
_loader.load(_local4);
_clip.addChild(_loader);
_sendChannel = new LocalConnection();
_queue = [];
_nextCallbackID = 0;
_callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (clip.stage == null){
trace("MochiServices connect requires the containing clip be attached to the stage");
};
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
} else {
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, connectWait);
_timer = null;
};
}
}
}//package mochi.as3
Section 75
//MochiSocial (mochi.as3.MochiSocial)
package mochi.as3 {
public class MochiSocial {
public static const LOGGED_IN:String = "LoggedIn";
public static const ACTION_CANCELED:String = "onCancel";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const IO_ERROR:String = "IOError";
public static const NO_USER:String = "NoUser";
public static const FRIEND_LIST:String = "FriendsList";
public static const PROFILE_DATA:String = "ProfileData";
public static const GAMEPLAY_DATA:String = "GameplayData";
public static const ACTION_COMPLETE:String = "onComplete";
public static const LOGIN_SHOW:String = "LoginShow";
public static const PROFILE_HIDE:String = "ProfileHide";
public static const USER_INFO:String = "UserInfo";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOWN:String = "LoginShown";
public static var _user_info:Object = null;
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function requestFan(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestFan", _arg1);
}
public static function postToStream(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_postToStream", _arg1);
}
public static function getFriendsList(_arg1:Object=null):void{
MochiServices.send("social_getFriendsList", _arg1);
}
public static function requestLogin(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_requestLogin", _arg1);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("social_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function inviteFriends(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_inviteFriends", _arg1);
}
public static function get loggedIn():Boolean{
return (!((_user_info == null)));
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("social_showLoginWidget", {options:_arg1});
}
public static function getAPIURL():String{
if (!_user_info){
return (null);
};
return (_user_info.api_url);
}
public static function hideLoginWidget():void{
MochiServices.send("social_hideLoginWidget");
}
public static function getAPIToken():String{
if (!_user_info){
return (null);
};
return (_user_info.api_token);
}
MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{
_user_info = _arg1;
});
MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{
_user_info = null;
});
}
}//package mochi.as3
Section 76
//MochiUserData (mochi.as3.MochiUserData)
package mochi.as3 {
import flash.utils.*;
import flash.events.*;
import flash.net.*;
public class MochiUserData extends EventDispatcher {
public var callback:Function;// = null
public var operation:String;// = null
public var error:Event;// = null
public var data;// = null
public var _loader:URLLoader;
public var key:String;// = null
public function MochiUserData(_arg1:String="", _arg2:Function=null){
this.key = _arg1;
this.callback = _arg2;
}
public function serialize(_arg1):ByteArray{
var _local2:ByteArray = new ByteArray();
_local2.objectEncoding = ObjectEncoding.AMF3;
_local2.writeObject(_arg1);
_local2.compress();
return (_local2);
}
public function errorHandler(_arg1:IOErrorEvent):void{
data = null;
error = _arg1;
if (callback != null){
performCallback();
} else {
dispatchEvent(_arg1);
};
close();
}
public function putEvent(_arg1):void{
request("put", serialize(_arg1));
}
public function deserialize(_arg1:ByteArray){
_arg1.objectEncoding = ObjectEncoding.AMF3;
_arg1.uncompress();
return (_arg1.readObject());
}
public function securityErrorHandler(_arg1:SecurityErrorEvent):void{
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString())));
}
public function getEvent():void{
request("get", serialize(null));
}
override public function toString():String{
return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]"));
}
public function performCallback():void{
try {
callback(this);
} catch(e:Error) {
trace(("[MochiUserData] exception during callback: " + e));
};
}
public function request(_arg1:String, _arg2:ByteArray):void{
var _operation = _arg1;
var _data = _arg2;
operation = _operation;
var api_url:String = MochiSocial.getAPIURL();
var api_token:String = MochiSocial.getAPIToken();
if ((((api_url == null)) || ((api_token == null)))){
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in"));
return;
};
_loader = new URLLoader();
var args:URLVariables = new URLVariables();
args.op = _operation;
args.key = key;
var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString()));
req.method = URLRequestMethod.POST;
req.contentType = "application/x-mochi-userdata";
req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)];
req.data = _data;
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
try {
_loader.load(req);
} catch(e:SecurityError) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString())));
};
}
public function completeHandler(_arg1:Event):void{
var event = _arg1;
try {
if (_loader.data.length){
data = deserialize(_loader.data);
} else {
data = null;
};
} catch(e:Error) {
errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString())));
return;
};
if (callback != null){
performCallback();
} else {
dispatchEvent(event);
};
close();
}
public function close():void{
if (_loader){
_loader.removeEventListener(Event.COMPLETE, completeHandler);
_loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
_loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_loader.close();
_loader = null;
};
error = null;
callback = null;
}
public static function get(_arg1:String, _arg2:Function):void{
var _local3:MochiUserData = new MochiUserData(_arg1, _arg2);
_local3.getEvent();
}
public static function put(_arg1:String, _arg2, _arg3:Function):void{
var _local4:MochiUserData = new MochiUserData(_arg1, _arg3);
_local4.putEvent(_arg2);
}
}
}//package mochi.as3
Section 77
//MathPoint (YDKClass.Math.MathPoint)
package YDKClass.Math {
import flash.display.*;
import flash.geom.*;
public class MathPoint {
public static function Angle(_arg1:MovieClip, _arg2:MovieClip):Number{
var _local3:Number = 10;
var _local4:* = Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x));
var _local5:Number = int(((_local4 * 180) / Math.PI));
return (_local5);
}
public static function Distance(_arg1:MovieClip, _arg2:MovieClip):Number{
var _local3:Point = new Point(_arg1.x, _arg1.y);
var _local4:Point = new Point(_arg2.x, _arg2.y);
var _local5:Number = Point.distance(_local3, _local4);
return (_local5);
}
public static function AgoBtoC(_arg1:MovieClip, _arg2:MovieClip){
var _local4:Number;
var _local3:Object = new Object();
_local3.x = ((_arg1.x + _arg2.x) / 2);
_local3.y = ((_arg1.y + _arg2.y) / 2);
return (_local3);
}
}
}//package YDKClass.Math
Section 78
//TimerExample (YDKClass.Math.TimerExample)
package YDKClass.Math {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
public class TimerExample extends Sprite {
public var myTimer:Timer;
public var TimeNum:int;
public var TimeFun:Function;
public function TimerExample(_arg1:int, _arg2:Function){
TimeNum = _arg1;
TimeFun = _arg2;
myTimer = new Timer(1000, 0);
myTimer.addEventListener("timer", timerHandler);
}
private function timerHandler(_arg1:TimerEvent):void{
TimeNum--;
TimeFun(TimeNum);
}
public function Ready(){
myTimer.start();
}
public function Stop(){
myTimer.stop();
}
}
}//package YDKClass.Math
Section 79
//DynamicRegistration (YDKClass.Photo.DynamicRegistration)
package YDKClass.Photo {
import flash.display.*;
import flash.geom.*;
public class DynamicRegistration {
private var target:DisplayObject;
private var regpoint:Point;
public function DynamicRegistration(_arg1:DisplayObject, _arg2:Point){
this.target = _arg1;
this.regpoint = _arg2;
}
public function flush(_arg1:String, _arg2:Number):void{
var _local5:Point;
var _local3:* = this.target;
var _local4:Point = _local3.parent.globalToLocal(_local3.localToGlobal(regpoint));
if ((((_arg1 == "x")) || ((_arg1 == "y")))){
_local3[_arg1] = (_arg2 - regpoint[_arg1]);
} else {
_local3[_arg1] = _arg2;
_local5 = _local3.parent.globalToLocal(_local3.localToGlobal(regpoint));
_local3.x = (_local3.x + (_local4.x - _local5.x));
_local3.y = (_local3.y + (_local4.y - _local5.y));
};
}
}
}//package YDKClass.Photo
Section 80
//ServerData (YDKClass.System.ServerData)
package YDKClass.System {
import flash.utils.*;
import flash.net.*;
public class ServerData {
public static var DataName:String = ("ZooDodgem" + Version);
public static var BackFun:Function;
public static var Version:int = 1;
public static function DelOneData(_arg1:int){
trace(("DelOneData:" + _arg1));
var _local2:SharedObject = SharedObject.getLocal(DataName, "/");
var _local3:* = _local2.data.Data;
_local3.splice(_arg1, 1);
_local2.data.Data = _local3;
}
public static function LoadUserNameData(_arg1:String=null){
var _local4:*;
var _local2:SharedObject = SharedObject.getLocal(DataName, "/");
var _local3:* = _local2.data.Data;
_local2 = null;
if (_local3){
for (_local4 in _local3) {
if (_local3[_local4].UserName == _arg1){
return (_local3[_local4]);
};
};
} else {
return (false);
};
}
public static function SaveData(_arg1, _arg2:String=null, _arg3:Function=null){
var _local6:*;
BackFun = _arg3;
var _local4:SharedObject = SharedObject.getLocal(DataName, "/");
var _local5:* = _local4.data.Data;
if (_local5){
} else {
trace("这个游戏第一次存储!");
_local5 = [];
_local4.data.ID = 0;
};
if (_arg2 == "NewUser"){
if (!_local4.data.ID){
_local4.data.ID = 0;
};
_arg1.UserID = _local4.data.ID++;
_local5.push(_arg1);
trace(((("添加一个新的数据 UserName:" + _arg1.UserName) + " UserID:") + _arg1.UserID));
BackFun(_arg1.UserID);
} else {
for (_local6 in _local5) {
if (_local5[_local6].UserName == _arg1.UserName){
_local5[_local6] = _arg1;
trace(((("覆盖以前的旧数据 UserName:" + _arg1.UserName) + " UserID:") + _arg1.UserID));
break;
} else {
if (_local6 == (_local5.length - 1)){
if (!_local4.data.ID){
_local4.data.ID = 0;
};
_arg1.UserID = _local4.data.ID++;
_arg1.UserName = String((_arg1.UserName + _local4.data.ID));
_local5.push(_arg1);
trace(((("这是一个游客 UserName:" + _arg1.UserName) + " UserID:") + _arg1.UserID));
break;
};
};
};
};
_local4.data.Data = _local5;
_local4 = null;
trace("数据保存成功!");
}
public static function SaveOneData(_arg1){
var _local2:SharedObject = SharedObject.getLocal(DataName, "/");
_local2.data.Data = _arg1;
_local2 = null;
trace("数据保存成功!");
}
public static function clone(_arg1:Object){
var _local2:ByteArray = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function LoadData(_arg1:String=null){
var _local2:SharedObject = SharedObject.getLocal(DataName, "/");
var _local3:* = _local2.data.Data;
_local2 = null;
if (_local3){
trace("读取数据成功!");
return (_local3);
};
trace("没有数据!!");
return (false);
}
}
}//package YDKClass.System
Section 81
//GameMask (YDKClass.GameMask)
package YDKClass {
import flash.display.*;
public class GameMask extends MovieClip {
public static function GameMaskReady(_arg1:Number, _arg2:Number, _arg3:MovieClip){
var _local4:Sprite = new Sprite();
_local4.graphics.beginFill(0);
_local4.graphics.drawRect(0, 0, _arg1, _arg2);
_local4.graphics.endFill();
_arg3.addChild(_local4);
_arg3.mask = _local4;
}
}
}//package YDKClass
Section 82
//MusicMenu (YDKClass.MusicMenu)
package YDKClass {
import flash.events.*;
import flash.media.*;
public class MusicMenu extends MusicPlay {
public static var Music:SoundTransform = new SoundTransform();
public static var S:Number = 1;
public static function ChangeVolume(){
if (Channel){
Music = Channel.soundTransform;
Music.volume = S;
Channel.soundTransform = Music;
};
if (OneSound){
Music = OneSound.soundTransform;
Music.volume = S;
OneSound.soundTransform = Music;
};
}
public static function Ready(_arg1){
var NewMusic:Function;
var Obj = _arg1;
NewMusic = function (_arg1){
MusicButtonVisible(_arg1.target.name);
};
var MusicButtonVisible:Function = function (_arg1:String){
if (_arg1 == "MusicOK"){
Obj.MusicOK.visible = false;
Obj.MusicNO.visible = true;
BackGroundMusic = false;
S = 0;
} else {
S = 1;
BackGroundMusic = true;
Obj.MusicOK.visible = true;
Obj.MusicNO.visible = false;
};
ChangeVolume();
};
Obj.MusicOK.addEventListener(MouseEvent.CLICK, NewMusic);
Obj.MusicNO.addEventListener(MouseEvent.CLICK, NewMusic);
if (S == 1){
MusicButtonVisible("MusicNO");
} else {
MusicButtonVisible("MusicOK");
};
}
}
}//package YDKClass
Section 83
//MusicPlay (YDKClass.MusicPlay)
package YDKClass {
import flash.media.*;
public class MusicPlay {
public static var Channel:SoundChannel;
public static var OneSound:SoundChannel;
public static var MusicEffect:Boolean;
public static var BackGroundMusic:Boolean;
public static function Add(_arg1){
var _local2:Sound = new (_arg1);
OneSound = _local2.play(0, 10000);
MusicMenu.ChangeVolume();
}
public static function AddOne(_arg1){
var _local2:Sound = new (_arg1);
OneSound = _local2.play(0, 1);
MusicMenu.ChangeVolume();
}
public static function AllStop(){
SoundMixer.stopAll();
}
public static function ChangeReady(_arg1){
SoundMixer.stopAll();
var _local2:Sound = new (_arg1);
Channel = _local2.play(0, 10000);
MusicMenu.ChangeVolume();
}
public static function ChangeReadyOne(_arg1){
SoundMixer.stopAll();
var _local2:Sound = new (_arg1);
Channel = _local2.play(0, 1);
MusicMenu.ChangeVolume();
}
}
}//package YDKClass
Section 84
//YDKScreen (YDKClass.YDKScreen)
package YDKClass {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class YDKScreen extends MovieClip {
public var Pt:Point;
public var BMP:BitmapData;
public var MyGif:MovieClip;
public var Fps:int;// = 0
public var Rect:Rectangle;
public function YDKScreen(_arg1){
BMP = new BitmapData(700, 500, false);
Rect = new Rectangle(0, 0, 40, 40);
Pt = new Point(0, 0);
super();
MyGif = _arg1;
var _local2:Bitmap = new Bitmap(BMP);
this.addChild(_local2);
this.addEventListener(Event.ENTER_FRAME, NewBMP);
}
public function NewBMP(_arg1){
Fps++;
if (Fps > 10){
BMP.draw(MyGif);
};
}
}
}//package YDKClass
Section 85
//AshLine (YDKGame.AshLine)
package YDKGame {
import flash.display.*;
import flash.events.*;
import gs.*;
import gs.easing.*;
public class AshLine extends GameRoom {
public function NewAsh(_arg1:MovieClip, _arg2:MovieClip){
var Time:Function;
var Obj = _arg1;
var Space = _arg2;
Time = function (_arg1){
if (((GamePause) || (GamePlayIng))){
if ((((_arg1.target.Time > _arg1.target.TimeMax)) || (GamePlayIng))){
_arg1.target.Parent.removeChild(_arg1.target);
_arg1.target.removeEventListener(Event.ENTER_FRAME, Time);
} else {
_arg1.target.Time++;
};
};
};
var Mc:MovieClip = new MovieClip();
Mc.alpha = 0.1;
Mc.graphics.lineStyle(22, 0, 1, true, LineScaleMode.VERTICAL, CapsStyle.SQUARE, JointStyle.MITER);
Mc.graphics.moveTo(Obj.x, Obj.y);
Space.addChild(Mc);
Mc.Parent = Space;
Obj.AshIng = Mc;
Mc.addEventListener(Event.ENTER_FRAME, Time);
Mc.Time = 0;
Mc.TimeMax = 100;
var Blur = 10;
if (UserCarNum == 2){
Blur = 2;
} else {
Blur = 10;
};
TweenMax.to(Mc, 0, {blurFilter:{blurX:Blur, blurY:Blur}});
}
public function AshMove(_arg1:MovieClip){
if (_arg1.AshIng){
_arg1.AshIng.Time = 0;
_arg1.AshIng.graphics.lineTo(_arg1.x, _arg1.y);
};
}
}
}//package YDKGame
Section 86
//Car (YDKGame.Car)
package YDKGame {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class Car extends GameRoom {
public static var N:int;
public static var AshLineData:AshLine = new AshLine();
public static var KeyS:KeyboardEventExample;
public static function CarToWater(_arg1:MovieClip, _arg2:Boolean=false){
var Time:Function;
var Mc = _arg1;
var Visible = _arg2;
Time = function (_arg1){
var _local2:* = _arg1.target;
if (_local2.currentFrame == _local2.totalFrames){
if (!_local2.Del){
_local2.removeEventListener(Event.ENTER_FRAME, Time);
_local2.Del = true;
_local2.Spage.removeChild(_local2);
Mc.visible = true;
InidData(Mc);
};
};
};
var Water:MovieClip = new WaterID();
GameJpg.addChild(Water);
Water.x = Mc.x;
Water.y = Mc.y;
Mc.visible = false;
if (Visible){
Water.visible = false;
};
Water.addEventListener(Event.ENTER_FRAME, Time);
Water.Spage = GameJpg;
}
public static function Ready(){
KeyS = new KeyboardEventExample(GamePic.stage);
AllCarReady();
}
public static function InitCarBody(){
var _local2:MovieClip;
var _local3:int;
var _local1:* = 0;
while (_local1 < CarClub.length) {
_local2 = CarClubData[_local1].Car;
_local3 = (CarClubData[_local1].Id + 1);
if (_local1 >= LevelCarNum[(Level - 1)]){
} else {
if (_local2.Type == "Box"){
_local2.Type = "Enemy";
_local2.Car.gotoAndStop(_local3);
};
};
_local1++;
};
}
public static function NewSpeed(_arg1:MovieClip){
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (_arg1.SpeedHitPower > 0){
_arg1.SpeedHitPower--;
_local2 = ((_arg1.PowerSpeedInit * Math.cos(((int((90 - _arg1.RotationPower)) / 180) * Math.PI))) * _arg1.Speed);
_local3 = ((_arg1.PowerSpeedInit * Math.sin(((int((90 - _arg1.RotationPower)) / 180) * Math.PI))) * _arg1.Speed);
_arg1.SpeedInit = 0;
} else {
_local2 = ((_arg1.SpeedInit * Math.cos(((int((90 - _arg1.Rotation)) / 180) * Math.PI))) * _arg1.Speed);
_local3 = ((_arg1.SpeedInit * Math.sin(((int((90 - _arg1.Rotation)) / 180) * Math.PI))) * _arg1.Speed);
};
_arg1.SaveX = _arg1.x;
_arg1.SaveY = _arg1.y;
_arg1.SaveAngle = _arg1.Angle;
_arg1.SaveRotation = _arg1.Car.rotation;
_arg1.SaveMcRotation = _arg1.Rotation;
_arg1.SaveMainRotation = _arg1.MainRotation;
if (_local2 > 20){
_local2 = 20;
} else {
if (_local2 < -20){
_local2 = -20;
};
};
if (_local3 > 20){
_local3 = 20;
} else {
if (_local3 < -20){
_local3 = -20;
};
};
_arg1.x = (_arg1.x + _local2);
_arg1.y = (_arg1.y - _local3);
_arg1.XX = _local2;
_arg1.YY = _local3;
if (int(Math.abs(_arg1.SpeedInit)) == 5){
};
if (_arg1.UserReady){
_local4 = (Number((_arg1.MainRotation - _arg1.Angle)) / 1);
_arg1.Rotation = (_arg1.Rotation + ((_arg1.MainRotation - _arg1.Rotation) / 10));
} else {
_local4 = (Number((_arg1.Rotation - _arg1.Angle)) / 8);
};
if ((int((Math.abs(_local4) + Math.abs(_arg1.Car.rotation))) / 2) > 30){
AshLineData.AshMove(_arg1);
};
var _local5:int = Math.abs((Math.abs(_arg1.MainRotation) - Math.abs(_arg1.Rotation)));
if ((((((int(Math.abs(_arg1.SpeedInit)) > 5)) && ((Math.abs(_local4) > 3)))) || ((_arg1.SpeedHitPower > 0)))){
_arg1.AshTime++;
if (_arg1.AshTime > _arg1.AshTimeMax){
_arg1.AshTime = 0;
AshLineData.NewAsh(_arg1, AshClub);
if ((((_arg1.ScoreN < 10)) || ((_arg1.SpeedHitPower > 0)))){
_arg1.ScoreN++;
};
} else {
if ((((_arg1.ScoreN < 10)) || ((_arg1.SpeedHitPower > 0)))){
AshLineData.AshMove(_arg1);
};
};
} else {
_arg1.AshTime = 0;
_arg1.ScoreN = 0;
_arg1.AshIng = null;
};
_arg1.Car.rotation = (_arg1.Car.rotation + _local4);
_arg1.Angle = (_arg1.Angle + _local4);
}
public static function Engine(_arg1:MovieClip){
var PointClub:Array;
var CarXY:*;
var CarHitWal:Boolean;
var EnemyCar:MovieClip;
var McGif:MovieClip;
var EnemyCarMcGif:MovieClip;
var SpeedInit:*;
var Rotation:*;
var Mc = _arg1;
var CarHitWalHitOK:Function = function (){
var _local1:int = Math.abs((Mc.XX * 3));
var _local2:int = Math.abs((Mc.YY * 3));
var _local3 = 5;
var _local4 = 10;
if (_local1 > _local4){
_local1 = _local4;
};
if (_local2 > _local4){
_local2 = _local4;
};
_local1 = 5;
_local2 = 5;
if (BackGroundPic.Wall.hitTestPoint((CarXY.x - 20), CarXY.y, true)){
Mc.x = Mc.SaveX;
Mc.y = Mc.SaveY;
Mc.x = (Mc.x + _local1);
CarHitWal = true;
} else {
if (BackGroundPic.Wall.hitTestPoint((CarXY.x + 20), CarXY.y, true)){
Mc.x = Mc.SaveX;
Mc.y = Mc.SaveY;
Mc.x = (Mc.x - _local1);
CarHitWal = true;
};
};
if (BackGroundPic.Wall.hitTestPoint(CarXY.x, CarXY.y, true)){
Mc.x = Mc.SaveX;
Mc.y = Mc.SaveY;
Mc.y = (Mc.y + _local2);
CarHitWal = true;
} else {
if (BackGroundPic.Wall.hitTestPoint(CarXY.x, (CarXY.y + 20), true)){
Mc.x = Mc.SaveX;
Mc.y = Mc.SaveY;
Mc.y = (Mc.y - _local2);
CarHitWal = true;
};
};
};
var WalHitOK:Function = function (_arg1:MovieClip, _arg2:String){
var _local4:*;
var _local5:*;
var _local3:* = 0;
while (_local3 < PointClub.length) {
_local4 = PointClub[_local3];
if (_arg2 == "CarHitWal"){
CarHitWal = _arg1.hitTestPoint(_local4.x, _local4.y, true);
if (CarHitWal){
Mc.PointName = int(_local3);
trace((((("SaveX:" + Mc.SaveX) + " ") + "SaveY:") + Mc.SaveY));
break;
};
} else {
if (_arg2 == "CarHitCar"){
_local5 = _arg1.hitTestPoint(_local4.x, _local4.y, true);
if (_local5){
Mc.PointName = int(_local3);
return (_local5);
};
};
};
_local3++;
};
};
var CarHitBox:Function = function (_arg1){
var _local2:Boolean;
var _local4:*;
var _local3:* = 0;
while (_local3 < BackGroundPic.Wall.numChildren) {
_local4 = BackGroundPic.Wall.getChildAt(_local3);
if (_arg1.hitTestObject(_local4)){
if (_arg1.x > (_local4.x + _local4.width)){
_arg1.x = (_arg1.x + 10);
} else {
_arg1.x = (_arg1.x - 10);
};
if (_arg1.y > _local4.y){
_arg1.y = (_arg1.y + 10);
} else {
_arg1.y = (_arg1.y - 10);
};
trace(("CarHitBox:" + _local4.name));
};
_local3++;
};
};
var CarHitWoodArr:Function = function (_arg1:MovieClip){
var _local3:*;
var _local2:* = 0;
while (_local2 < BackGroundPic.WoodPic.numChildren) {
_local3 = BackGroundPic.WoodPic.getChildAt(_local2);
if (_local3.ActionIng == "Ready"){
if (_arg1.hitTestObject(_local3)){
_local3.HP = (_local3.HP - 130);
if (_local3.HP < 1){
_local3.play();
};
};
};
_local2++;
};
};
var HitCar:Function = function (){
var _local1:Boolean;
var _local2:* = 0;
while (_local2 < CarClub.length) {
EnemyCar = CarClub[_local2];
if (((!((EnemyCar == Mc))) && (EnemyCar.visible))){
_local1 = WalHitOK(EnemyCar.Car, "CarHitCar");
if (_local1){
CarHitCar = true;
break;
};
};
_local2++;
};
};
var KScore:Function = function (_arg1:MovieClip){
if (_arg1.Type == "My"){
N = -(int(((Math.random() * int(Math.abs(6))) + 5)));
} else {
N = -(int(((Math.random() * int(Math.abs(6))) + 5)));
};
Prop.McaddScore(_arg1, N);
MusicMian.AddOne(得分的碰撞);
};
var UpDownHit:Function = function (_arg1:MovieClip){
var _local2:int;
if ((((_arg1.PointName == 0)) || ((_arg1.PointName == 1)))){
if (EnemyCar.Type == "Box"){
_local2 = 1;
} else {
_local2 = int(((Math.random() * int(Math.abs(_arg1.SpeedInit))) + 5));
};
if (_arg1.Type == "My"){
N = _local2;
} else {
N = _local2;
};
Prop.McaddScore(_arg1, N);
MusicMian.AddOne(得分的碰撞);
} else {
if ((((_arg1.PointName == 2)) || ((_arg1.PointName == 3)))){
if (_arg1.Type == "My"){
N = -(int(((Math.random() * int(Math.abs(_arg1.SpeedInit))) + 5)));
} else {
N = -(int(((Math.random() * int(Math.abs(_arg1.SpeedInit))) + 5)));
};
Prop.McaddScore(_arg1, N);
MusicMian.AddOne(得分的碰撞);
};
};
};
NewSpeed(Mc);
PointClub = [];
var XX:Number = 0;
var YY:Number = 0;
var PXY:Point = new Point(Mc.x, Mc.y);
CarXY = GameJpg.localToGlobal(PXY);
var point1:Point = new Point((Mc.Car.p1.x + XX), (Mc.Car.p1.y + YY));
var XY:* = Mc.Car.localToGlobal(point1);
var point2:Point = new Point((Mc.Car.p2.x + XX), (Mc.Car.p2.y + YY));
var XY2:* = Mc.Car.localToGlobal(point2);
var point3:Point = new Point((Mc.Car.p3.x + XX), (Mc.Car.p3.y + YY));
var XY3:* = Mc.Car.localToGlobal(point3);
var point4:Point = new Point((Mc.Car.p4.x + XX), (Mc.Car.p4.y + YY));
var XY4:* = Mc.Car.localToGlobal(point4);
PointClub[0] = XY;
PointClub[1] = XY2;
PointClub[2] = XY3;
PointClub[3] = XY4;
Mc.XY = XY;
var CarHitWater:Boolean;
CarHitWal = false;
var CarHitCar:Boolean;
if (Mc.EngineReady){
if (Mc.Type != "Box"){
EnemyAI.Ready(Mc);
} else {
NewSpeedInit(Mc);
};
};
CarHitWater = BackGroundPic.Water.hitTestPoint(CarXY.x, CarXY.y, true);
CarHitWalHitOK();
HitCar();
if (((CarHitCar) && (!((Mc == EnemyCar))))){
SpeedInit = Mc.SpeedInit;
UpDownHit(Mc);
UpDownHit(EnemyCar);
Rotation = Mc.Rotation;
if ((((SpeedInit > 1)) || ((SpeedInit < -1)))){
EnemyCar.SpeedInit = (SpeedInit * 0.8);
EnemyCar.PowerSpeedInit = (SpeedInit * 0.8);
EnemyCar.RotationPower = Rotation;
EnemyCar.SpeedHitPower = (int(Math.abs(Mc.SpeedInit)) * 5);
};
Mc.HitObj = EnemyCar;
Mc.HitObjTime = Mc.HitObjTimeMax;
if (Mc.x > EnemyCar.x){
Mc.x = (Mc.x + 5);
EnemyCar.x = (EnemyCar.x - 5);
} else {
Mc.x = (Mc.x - 5);
EnemyCar.x = (EnemyCar.x + 5);
};
if (Mc.y > EnemyCar.y){
Mc.y = (Mc.y + 5);
EnemyCar.y = (EnemyCar.y - 5);
} else {
Mc.y = (Mc.y - 5);
EnemyCar.y = (EnemyCar.y + 5);
};
if (Mc.Type == "Box"){
Mc.Rotation = (Math.random() * 360);
};
Mc.SpeedInit = (-(Mc.SpeedInit) * 1.2);
McGif = Mc.Car.getChildAt(0);
McGif.gotoAndPlay(2);
EnemyCarMcGif = EnemyCar.Car.getChildAt(0);
EnemyCarMcGif.gotoAndPlay(2);
Mc.XYEnd = true;
};
if (CarHitWater){
Mc.SpeedInit = (-(Mc.SpeedInit) * 1.5);
Mc.KeyReady = false;
CarToWater(Mc);
MusicMian.AddOne(落水);
if ((((Mc == P1Car)) || ((Mc == P2Car)))){
N = -(int((Mc.Score / 5)));
} else {
N = -(int((Mc.Score / 15)));
};
Prop.McaddScore(Mc, N);
trace(("有人掉水里去了! " + Mc.Car.currentFrame));
MyHitObjCarScore(Mc);
};
if (CarHitWal){
KScore(Mc);
CarHitWoodArr(Mc);
Mc.SpeedInit = (-(Mc.SpeedInit) * 0.8);
Mc.PowerSpeedInit = (-(Mc.SpeedInit) * 0.8);
Mc.SpeedHitPower = 0;
if ((((Mc.SpeedInit >= 0)) && ((Mc.SpeedInit < 3)))){
Mc.SpeedInit = 3;
} else {
if ((((Mc.SpeedInit <= 0)) && ((Mc.SpeedInit > -3)))){
Mc.SpeedInit = -3;
};
};
McGif = Mc.Car.getChildAt(0);
McGif.gotoAndPlay(2);
Mc.XYEnd = true;
if ((((Mc == P1Car)) || ((Mc == P2Car)))){
N = (int(Math.abs(Mc.SpeedInit)) + 2);
} else {
N = (int((int(Math.abs(Mc.SpeedInit)) + 5)) * 2);
};
};
if (Mc.SpeedInit > Mc.SpeedInitMax){
Mc.SpeedInit = Mc.SpeedInitMax;
};
if (Mc.SpeedInit < -(Mc.SpeedInitMax)){
Mc.SpeedInit = -(Mc.SpeedInitMax);
};
if (Mc.HitObjTime > 0){
Mc.HitObjTime--;
} else {
Mc.HitObj = null;
};
}
public static function InidData(_arg1:MovieClip){
_arg1.Speed = 2;
_arg1.SpeedMax = 2;
_arg1.SpeedInit = 0;
_arg1.PowerSpeedInit = 0;
_arg1.SpeedInitMax = 8;
_arg1.Angle = 0;
_arg1.RotationPower = 0;
_arg1.SpeedHitPower = 0;
_arg1.Rotation = 0;
_arg1.MainRotation = 0;
_arg1.DriftTime = 0;
_arg1.DriftRotation = 0;
_arg1.Car.rotation = 0;
_arg1.AshTime = 0;
_arg1.AshTimeMax = 1;
_arg1.KeyReady = true;
_arg1.EngineReady = true;
_arg1.ScoreN = 0;
if (!_arg1.Prop){
_arg1.Prop = "Null";
};
_arg1.Space = false;
_arg1.x = _arg1.InitX;
_arg1.y = _arg1.InitY;
_arg1.NearHe = 0;
_arg1.HitObjTime = 0;
_arg1.HitObjTimeMax = 100;
_arg1.XYEnd = false;
}
public static function AllCarReady(){
var Action:Function;
var Mc:MovieClip;
var XY:MovieClip;
var Goto:int;
Action = function (_arg1){
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local2:* = _arg1.target;
if (GameInit){
_local2.removeEventListener(Event.ENTER_FRAME, Action);
GameJpg.removeChild(_local2);
return;
};
if (GamePause){
if (((_local2.KeyReady) && (_local2.visible))){
Engine(_local2);
};
if (_local2 == P1Car){
_local3 = new Object();
_local3.Up = KeyS.P1Key.W;
_local3.Down = KeyS.P1Key.S;
_local3.Left = KeyS.P1Key.A;
_local3.Right = KeyS.P1Key.D;
_local3.Space = KeyS.P1Key.Space;
_local4 = new Object();
_local4.Up = KeyS.P2Key.Up;
_local4.Down = KeyS.P2Key.Down;
_local4.Left = KeyS.P2Key.Left;
_local4.Right = KeyS.P2Key.Right;
_local4.Space = KeyS.P2Key.Space;
if (UserCarNum == 1){
KeyAction(P1Car, _local3, _local4);
} else {
if (UserCarNum == 2){
KeyAction(P1Car, _local3, _local3);
};
};
};
if (_local2 == P2Car){
if (UserCarNum == 2){
_local5 = new Object();
_local5.Up = KeyS.P2Key.Up;
_local5.Down = KeyS.P2Key.Down;
_local5.Left = KeyS.P2Key.Left;
_local5.Right = KeyS.P2Key.Right;
_local5.Space = KeyS.P2Key.Space;
KeyAction(P2Car, _local5, _local5);
};
};
};
};
CarClub = [];
trace((("准备汽车 [ " + CarNum) + " ] 辆."));
var i:* = 0;
while (i < CarNum) {
Mc = new CarID();
XY = BackGroundPic[("Car" + (i + 1))];
Mc.Type = "Enemy";
Mc.NumPic.visible = false;
if (XY){
Mc.x = XY.x;
Mc.y = XY.y;
Mc.InitX = XY.x;
Mc.InitY = XY.y;
XY.visible = false;
} else {
Mc.x = (BackGroundPic.Car1.x + (Math.random() * 700));
Mc.y = (BackGroundPic.Car1.y + (Math.random() * 500));
};
Goto = (CarClubData[i].Id + 1);
if (Goto){
Mc.Car.gotoAndStop(Goto);
} else {
Mc.Car.gotoAndStop(int(i));
};
if ((((i >= LevelCarNum[(Level - 1)])) && ((UserCarNum == 1)))){
Mc.Car.gotoAndStop((Goto + 10));
Mc.Type = "Box";
};
CarClubData[i].Car = Mc;
CarClub.push(Mc);
Mc.Score = 0;
InidData(Mc);
GameJpg.addChild(Mc);
Mc.addEventListener(Event.ENTER_FRAME, Action);
i = (i + 1);
};
P1Car = CarClub[0];
P1Car.UserReady = true;
P1Car.NumPic.visible = true;
P1Car.NumPic.gotoAndStop(1);
P1Car.Type = "My";
P2Car = CarClub[1];
P2Car.NumPic.gotoAndStop(2);
CameraObj = P1Car;
if (UserCarNum == 2){
P2Car.UserReady = true;
P2Car.NumPic.visible = true;
P2Car.Type = "My";
};
}
public static function KeyAction(_arg1:MovieClip, _arg2:Object=null, _arg3:Object=null){
if (((((_arg1.KeyReady) && (_arg1.EngineReady))) && (_arg1.visible))){
if (((_arg2.Up) || (_arg3.Up))){
_arg1.SpeedInit = (_arg1.SpeedInit + 0.5);
};
if (((_arg2.Down) || (_arg3.Down))){
_arg1.SpeedInit = (_arg1.SpeedInit - 0.5);
};
if (((_arg2.Left) || (_arg3.Left))){
_arg1.MainRotation = (_arg1.MainRotation - Number(Math.abs(_arg1.SpeedInit)));
};
if (((_arg2.Right) || (_arg3.Right))){
_arg1.MainRotation = (_arg1.MainRotation + Number(Math.abs(_arg1.SpeedInit)));
};
if (_arg2.Space){
if (((!((_arg1.Prop == "Null"))) && (!(_arg1.Space)))){
_arg1.Space = true;
Prop.UseProp(_arg1);
};
};
};
if (((!(_arg2.W)) && (!(_arg2.S)))){
NewSpeedInit(_arg1);
};
if (!_arg2.Space){
_arg1.Space = false;
};
}
public static function NewSpeedInit(_arg1:MovieClip){
if (_arg1.SpeedInit > 0.2){
_arg1.SpeedInit = (_arg1.SpeedInit - 0.2);
} else {
if (_arg1.SpeedInit < -0.2){
_arg1.SpeedInit = (_arg1.SpeedInit + 0.2);
} else {
_arg1.SpeedInit = 0;
};
};
if (_arg1.PowerSpeedInit > 0.2){
_arg1.PowerSpeedInit = (_arg1.PowerSpeedInit - 0.2);
} else {
if (_arg1.PowerSpeedInit < -0.2){
_arg1.PowerSpeedInit = (_arg1.PowerSpeedInit + 0.2);
} else {
_arg1.PowerSpeedInit = 0;
};
};
}
public static function MyHitObjCarScore(_arg1:MovieClip){
if (_arg1.HitObj){
N = (int((Math.random() * 50)) + 10);
Prop.McaddScore(_arg1.HitObj, N);
trace(("是它把我撞下去的:" + _arg1.HitObj.Car.currentFrame));
_arg1.HitObj = null;
};
}
public static function CarHitCarEngine(_arg1:MovieClip, _arg2:Number, _arg3:Number){
var HitPower:Function;
var Mc = _arg1;
var Angle = _arg2;
var Power = _arg3;
HitPower = function (_arg1){
if (Power > 0.2){
Power = (Power - 0.2);
} else {
if (Power < -0.2){
Power = (Power + 0.2);
} else {
Mc.removeEventListener(Event.ENTER_FRAME, HitPower);
};
};
var _local2:* = ((Power * Math.cos(((int((90 - Angle)) / 180) * Math.PI))) * 2);
var _local3:* = ((Power * Math.sin(((int((90 - Angle)) / 180) * Math.PI))) * 2);
Mc.x = (Mc.x + _local2);
Mc.y = (Mc.y - _local3);
};
Mc.addEventListener(Event.ENTER_FRAME, HitPower);
}
}
}//package YDKGame
Section 87
//EnemyAI (YDKGame.EnemyAI)
package YDKGame {
import flash.display.*;
import flash.events.*;
import YDKClass.Math.*;
public class EnemyAI extends GameRoom {
public static function Ready(_arg1:MovieClip){
var EnemyCarHitAI:Boolean;
var X:Number;
var Y:Number;
var Angle:Number;
var AIRotation:Number;
var DistanceObj:MovieClip;
var DistanceObj1:MovieClip;
var DistanceObj2:MovieClip;
var T:int;
var T2:int;
var i:*;
var Obj:*;
var Mc = _arg1;
BackGroundPic.EnemyAI.visible = false;
if (!Mc.UserReady){
var GetObjDistance:Function = function (){
var _local3:*;
var _local4:Number;
var _local1:Array = [];
var _local2:* = 0;
while (_local2 < CarClub.length) {
_local3 = CarClub[_local2];
if (((!((Mc == _local3))) && (!((_local3.Type == "Box"))))){
_local4 = MathPoint.Distance(Mc, _local3);
_local1.push({Mc:_local3, Distance:_local4});
};
_local2++;
};
_local1.sortOn("Distance", Array.NUMERIC);
DistanceObj = _local1[0].Mc;
};
var NewAngle:Function = function (_arg1:MovieClip, _arg2:int, _arg3:int){
var Time:Function;
var Mc = _arg1;
var AIRotation = _arg2;
var Goto = _arg3;
Time = function (_arg1){
var _local2:* = _arg1.target;
if (_local2.Time < _local2.TimeMax){
_local2.Time++;
} else {
GameJpg.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, Time);
};
};
var Temp:MovieClip = new AngleID();
GameJpg.addChild(Temp);
Temp.gotoAndStop(Goto);
Temp.x = Mc.x;
Temp.y = Mc.y;
Temp.addEventListener(Event.ENTER_FRAME, Time);
Temp.Time = 0;
Temp.TimeMax = 20;
Temp.rotation = AIRotation;
};
T = (Math.random() * 50);
T2 = (Math.random() * 100);
if (T == 0){
};
if (T2 == 0){
if (Mc.Prop != "Null"){
Prop.UseProp(Mc);
};
} else {
if (T2 == 1){
} else {
if (T2 > 98){
};
};
};
Mc.SpeedInit = (Mc.SpeedInit + 0.1);
if (Mc.XYEnd){
X = (Math.random() * BackGroundPic.width);
Y = (Math.random() * BackGroundPic.height);
Angle = Math.atan2((Y - Mc.y), (X - Mc.x));
Mc.Rotation = (Mc.Rotation + int((Math.random() * 90)));
Mc.XYEnd = false;
};
if (Mc.NearHe > 0){
Mc.NearHe--;
};
GetObjDistance();
if (DistanceObj){
if (DistanceObj.visible){
Angle = Math.atan2((DistanceObj.y - Mc.y), (DistanceObj.x - Mc.x));
AIRotation = (int(((Angle * 180) / Math.PI)) + 90);
if (Mc.Rotation > AIRotation){
Mc.Rotation = (Mc.Rotation - 5);
} else {
Mc.Rotation = (Mc.Rotation + 5);
};
Mc.AttackObj = DistanceObj;
if ((int((Math.abs(AIRotation) + Math.abs(Mc.Rotation))) / 2) > 30){
};
};
};
i = 0;
while (i < BackGroundPic.EnemyAI.numChildren) {
Obj = BackGroundPic.EnemyAI.getChildAt(i);
if (Obj){
EnemyCarHitAI = Obj.hitTestObject(Mc);
if (EnemyCarHitAI){
AIRotation = Obj.rotation;
Mc.SpeedInit = (Mc.SpeedInit + ((Number(3) - Mc.SpeedInit) / 15));
Mc.Rotation = (Mc.Rotation + (Number((AIRotation - Mc.Rotation)) / 10));
Mc.AttackObj = null;
};
};
i = (i + 1);
};
};
}
}
}//package YDKGame
Section 88
//GameData (YDKGame.GameData)
package YDKGame {
import flash.utils.*;
import flash.display.*;
import YDKClass.*;
public class GameData extends MovieClip {
public static var myTimer:Timer;
public static var SavePropType:Object = {};
public static var GamePause:Boolean = true;
public static var OneGame:Boolean;
public static var Level:int = 1;
public static var GameTimeNum:int = 90;
public static var CarClub:Array = new Array();
public static var MenuPic:MovieClip;
public static var P2Car:MovieClip;
public static var AgainstTime:Number = 0;
public static var LevelCarNum:Array = [2, 3, 4, 5, 6];
public static var GamePic:MovieClip;
public static var GamePlayIng:Boolean;
public static var MouseSize:int = 0;
public static var CarNum:int = 6;
public static var BackGroundNum:Number = 1;
public static var P1Car:MovieClip;
public static var AshClub:MovieClip;
public static var BackGroundPic:MovieClip;
public static var GameInit:Boolean;
public static var RadarPic:MovieClip;
public static var MusicPic:MovieClip;
public static var MouseDown:Boolean;
public static var P4Car:MovieClip;
public static var CarClubData:Array = new Array();
public static var GreatTime:Number = 0;
public static var UserCarNum:int = 1;
public static var LevelMax:int = LevelCarNum.length;
public static var UIPic:MovieClip;
public static var AlphaMapPic:MovieClip;
public static var MusicMian = MusicPlay;
public static var GameJpg:MovieClip;
public static var P3Car:MovieClip;
public static var Score:Number = 0;
public static var RoleIng:MovieClip;
public static var CameraObj:MovieClip = P1Car;
public static var GameMain:MovieClip;
public static function InitData(){
Level = 1;
}
public static function MusicButton(_arg1){
MusicMian.AddOne(按钮副本);
}
public static function GetData(){
var _local1:Array = [];
var _local2:* = 0;
while (_local2 < CarNum) {
_local1[_local2] = [];
if (CarClub[_local2].Type == "My"){
_local1[_local2].Score = (CarClub[_local2].Score + 0.1);
} else {
_local1[_local2].Score = CarClub[_local2].Score;
};
_local1[_local2].Id = CarClubData[_local2].Id;
_local1[_local2].Car = CarClubData[_local2].Car;
if (CarClub[_local2].Type == "Box"){
_local1[_local2].Score = -1;
};
trace(("Score:" + _local1[_local2].Score));
_local2++;
};
_local1.sortOn("Score", Array.NUMERIC);
_local1.reverse();
return (_local1);
}
public static function AllUserData(){
trace("==========================[初始化用户数据]=========================");
var _local1:* = 0;
while (_local1 < CarNum) {
CarClubData[_local1] = [];
CarClubData[_local1].Id = int(_local1);
_local1++;
};
}
public static function SubmitHighscoreOK(){
}
public static function PlayAgianData(){
var _local1:*;
var _local2:*;
trace(" [重新开始游戏]");
GamePause = true;
GamePlayIng = false;
for (_local1 in CarClub) {
_local2 = CarClub[_local1];
Car.InidData(_local2);
if (_local2.Type != "Box"){
_local2.Score = 0;
_local2.Prop = "Null";
_local2.PropIco.Prop.gotoAndStop("Null");
_local2.PropIco.Score.text = _local2.Score;
};
};
MusicMian.AllStop();
UI.GameThreeTimeReady();
}
public static function AllInitData(){
trace("==========================[初始化所有的数据]=========================");
GameInit = true;
CarClub = [];
UserCarNum = 1;
Level = 1;
GamePause = true;
GamePlayIng = false;
var _local1:* = 0;
while (_local1 < CarNum) {
CarClubData[_local1] = [];
CarClubData[_local1].Id = int(_local1);
_local1++;
};
}
}
}//package YDKGame
Section 89
//GameRoom (YDKGame.GameRoom)
package YDKGame {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import gs.*;
import YDKClass.*;
import gs.easing.*;
import YDKClass.Text.*;
public class GameRoom extends GameData {
public static function Ready(){
GameInit = false;
GameJpg = new MovieClip();
BackGroundPic = new BackGroundID();
GameJpg.addChild(BackGroundPic);
AshClub = new MovieClip();
GameJpg.addChild(AshClub);
AlphaMapPic = new AlphaMap1ID();
GameJpg.addChild(AlphaMapPic);
UIPic = new UIID();
GamePic.stage.focus = GameJpg;
GamePic.addChild(GameJpg);
GamePic.addChild(UIPic);
Car.Ready();
Map.Ready();
UI.Ready();
MusicMian.AllStop();
}
public static function GameOver(){
var Mc:MovieClip;
var Type:String;
var TempData:*;
var ButtonType:Function;
var SetData:Function = function (){
var _local1:*;
var _local2:*;
var _local3:*;
for (_local1 in TempData) {
_local2 = TempData[_local1];
_local3 = Mc.Total[("a" + _local1)];
if (_local3){
_local3.Ico.gotoAndStop(int((_local2.Id + 1)));
if (_local2.Score < 0){
_local3.Score.text = "";
} else {
_local3.Score.text = int(_local2.Score);
};
if (_local2.Car == P1Car){
Mc.Total.P1.x = (_local3.x + 40);
};
if (_local2.Car == P2Car){
Mc.Total.P2.x = (_local3.x + 40);
};
if (UserCarNum == 1){
if (_local1 >= LevelCarNum[(Level - 1)]){
TweenMax.to(_local3, 1, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
_local3.Ico.visible = false;
};
};
};
};
Mc.Total.P1.gotoAndStop(1);
Mc.Total.P2.gotoAndStop(2);
if (UserCarNum == 1){
Mc.Total.P2.visible = false;
};
};
ButtonType = function (_arg1){
if (_arg1.target.name == "Menu"){
GamePic.removeChild(Mc);
DelRoom();
} else {
if (_arg1.target.name == "TryAgain"){
if (Type == "GameWin"){
};
PlayAgianData();
GamePic.stage.focus = GamePic;
GamePic.removeChild(Mc);
UI.IcoReady();
Car.InitCarBody();
} else {
if (_arg1.target.name == "NextLevel"){
Level++;
PlayAgianData();
GamePic.stage.focus = GamePic;
GamePic.removeChild(Mc);
UI.IcoReady();
Car.InitCarBody();
} else {
if (_arg1.target.name == "MoreGames"){
MovieClip(GamePic.root).LogoMoreGame("moregames-donepage");
trace("moregame1");
};
};
};
};
};
GamePlayIng = true;
GamePause = false;
MochiEvents.endPlay();
trace("endPlay geactiveerd!");
TempData = GetData();
if (UserCarNum == 1){
if (TempData[0].Car == P1Car){
Type = "GameWin";
} else {
Type = "GameOver";
};
};
if (UserCarNum == 2){
if ((((TempData[0].Car == P1Car)) || ((TempData[0].Car == P2Car)))){
Type = "GameWin";
} else {
Type = "GameOver";
};
};
if (Type == "GameOver"){
MusicMian.ChangeReadyOne(过关失败);
Mc = new YouLoseID();
GamePic.addChild(Mc);
SetData();
} else {
if (Type == "GameWin"){
MusicMian.ChangeReadyOne(游戏结束音乐);
if (UserCarNum == 2){
Mc = new YouWinID();
GamePic.addChild(Mc);
Mc.MenuButton.NextLevel.visible = false;
SetData();
} else {
if (Level == LevelMax){
Mc = new GameEndID();
GamePic.addChild(Mc);
Mc.gotoAndStop(int(P1Car.Car.currentFrame));
} else {
Mc = new YouWinID();
GamePic.addChild(Mc);
Mc.MenuButton.TryAgain.visible = false;
SetData();
};
};
};
};
Mc.MenuButton.addEventListener(MouseEvent.CLICK, ButtonType);
}
public static function DelRoom(){
GameInit = true;
GameJpg.removeChild(BackGroundPic);
GameJpg.removeChild(AshClub);
GameJpg.removeChild(AlphaMapPic);
GamePic.removeChild(GameJpg);
GamePic.removeChild(UIPic);
Car.KeyS.Del(GamePic.stage);
UI.Time.Stop();
Home.Ready();
}
public static function EditModel(){
}
}
}//package YDKGame
Section 90
//Home (YDKGame.Home)
package YDKGame {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import gs.*;
import YDKClass.*;
import YDKClass.System.*;
import gs.easing.*;
public class Home extends GameData {
public static var KeyS:KeyboardEventExample;
public static var SetKeyS:SetKey;
public static function SelectRoleReady(){
var RoleIco:Array;
var Mc:MovieClip;
var OneKeyDown:Boolean;
var TwoKeyDown:Boolean;
var addEvent:Function;
var ButtonType:Function;
var Init:Function = function (){
AllUserData();
Mc.SelectRole.P1.gotoAndStop(1);
Mc.SelectRole.P2.gotoAndStop(2);
Mc.SelectRole.P2.visible = false;
Mc.MenuButton.P1.visible = false;
Mc.HelpPic.gotoAndStop(UserCarNum);
Mc.SelectRole.P1.SelectOK = false;
Mc.SelectRole.P2.SelectOK = false;
Mc.SelectRole.P1.x = Mc.SelectRole.a0.x;
Mc.SelectRole.P1.y = Mc.SelectRole.a0.y;
SelectRole();
if (UserCarNum == 2){
Mc.SelectRole.P2.visible = false;
Mc.SelectRole.P2.SelectOK = true;
Mc.MenuButton.Start.visible = false;
Mc.MenuButton.Select.visible = true;
} else {
Mc.MenuButton.Select.visible = false;
Mc.MenuButton.ReSelect.visible = false;
};
};
addEvent = function (_arg1){
var _local2:Object = new Object();
_local2.Up = KeyS.P1Key.W;
_local2.Down = KeyS.P1Key.S;
_local2.Left = KeyS.P1Key.A;
_local2.Right = KeyS.P1Key.D;
var _local3:Object = new Object();
_local3.Up = KeyS.P2Key.Up;
_local3.Down = KeyS.P2Key.Down;
_local3.Left = KeyS.P2Key.Left;
_local3.Right = KeyS.P2Key.Right;
if (((!(OneKeyDown)) && (!(Mc.SelectRole.P1.SelectOK)))){
if (_local2.Up){
OneKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P1, "Up");
} else {
if (_local2.Down){
OneKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P1, "Down");
} else {
if (_local2.Left){
OneKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P1, "Left");
} else {
if (_local2.Right){
OneKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P1, "Right");
};
};
};
};
};
if (UserCarNum == 1){
if (!TwoKeyDown){
if (_local3.Up){
TwoKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P1, "Up");
} else {
if (_local3.Down){
TwoKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P1, "Down");
} else {
if (_local3.Left){
TwoKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P1, "Left");
} else {
if (_local3.Right){
TwoKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P1, "Right");
};
};
};
};
};
};
if (((((((!(_local2.Up)) && (!(_local2.Down)))) && (!(_local2.Left)))) && (!(_local2.Right)))){
OneKeyDown = false;
};
if (((((((!(_local3.Up)) && (!(_local3.Down)))) && (!(_local3.Left)))) && (!(_local3.Right)))){
TwoKeyDown = false;
};
if ((((UserCarNum == 2)) && (!(Mc.SelectRole.P2.SelectOK)))){
if (!TwoKeyDown){
if (_local3.Up){
TwoKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P2, "Up");
} else {
if (_local3.Down){
TwoKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P2, "Down");
} else {
if (_local3.Left){
TwoKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P2, "Left");
} else {
if (_local3.Right){
TwoKeyDown = true;
MoveUserSelectOK(Mc.SelectRole.P2, "Right");
};
};
};
};
};
};
};
var MoveUserSelectOK:Function = function (_arg1:MovieClip, _arg2:String){
var _local3:*;
if (_arg2 == "Right"){
_local3 = Mc.SelectRole[("a" + (int((_arg1.Id + 1)) % 6))];
if (_local3.OK){
_local3 = Mc.SelectRole[("a" + (int((_arg1.Id + 2)) % 6))];
};
MoveUserFinish(_arg1, _local3);
} else {
if (_arg2 == "Left"){
_local3 = Mc.SelectRole[("a" + (((int((_arg1.Id - 1)) % 6) < 0)) ? 5 : (int((_arg1.Id - 1)) % 6))];
if (_local3.OK){
if (_local3.Id == 5){
_local3 = Mc.SelectRole["a4"];
} else {
_local3 = Mc.SelectRole[("a" + (((int((_arg1.Id - 2)) % 6) < 0)) ? 5 : (int((_arg1.Id - 2)) % 6))];
};
};
MoveUserFinish(_arg1, _local3);
} else {
if (_arg2 == "Up"){
_local3 = Mc.SelectRole[("a" + (int((_arg1.Id + 3)) % 6))];
if (_local3.OK){
_local3 = Mc.SelectRole[("a" + (int((_arg1.Id + 4)) % 6))];
};
MoveUserFinish(_arg1, _local3);
} else {
if (_arg2 == "Down"){
_local3 = Mc.SelectRole[("a" + (int((_arg1.Id + 3)) % 6))];
if (_local3.OK){
_local3 = Mc.SelectRole[("a" + (int((_arg1.Id + 4)) % 6))];
};
MoveUserFinish(_arg1, _local3);
};
};
};
};
MusicMian.AddOne(选择角色按钮);
};
var MoveUserFinish:Function = function (_arg1:MovieClip, _arg2:MovieClip){
_arg1.x = _arg2.x;
_arg1.y = _arg2.y;
_arg1.Id = _arg2.Id;
_arg1.Obj.OK = false;
_arg2.OK = true;
TweenMax.to(_arg1.Obj, 1, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
TweenMax.to(_arg2, 1, {colorMatrixFilter:{}});
_arg1.Obj = _arg2;
if (_arg1 == Mc.SelectRole.P1){
CarClubData[0].Id = _arg2.Id;
} else {
if (_arg1 == Mc.SelectRole.P2){
CarClubData[1].Id = _arg2.Id;
};
};
};
ButtonType = function (_arg1){
if (_arg1.target.name == "Menu"){
GamePic.removeChild(Mc);
KeyS.Del(GamePic.stage);
Mc.removeEventListener(Event.ENTER_FRAME, addEvent);
Ready();
} else {
if (_arg1.target.name == "P2"){
Mc.MenuButton.P2.visible = false;
Mc.MenuButton.P1.visible = true;
P1orP2(2);
} else {
if (_arg1.target.name == "P1"){
Mc.MenuButton.P1.visible = false;
Mc.MenuButton.P2.visible = true;
P1orP2(1);
} else {
if (_arg1.target.name == "Start"){
Mc.removeEventListener(Event.ENTER_FRAME, addEvent);
GamePic.removeChild(Mc);
KeyS.Del(GamePic.stage);
CPUSelectRole();
GameRoom.Ready();
} else {
if (_arg1.target.name == "Select"){
Mc.MenuButton.P2.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
Mc.SelectRole.P1.SelectOK = true;
Mc.SelectRole.P1.gotoAndStop(3);
Mc.SelectRole.P2.visible = true;
Mc.SelectRole.P2.SelectOK = false;
Mc.MenuButton.Start.visible = true;
Mc.MenuButton.Select.visible = false;
MusicMian.AddOne(汽车发动机);
} else {
if (_arg1.target.name == "ReSelect"){
Init();
};
};
};
};
};
};
};
var P1orP2:Function = function (_arg1:Number){
if (_arg1 == 1){
Mc.SelectRole.P2.visible = false;
if (Mc.SelectRole.P2.Obj){
TweenMax.to(Mc.SelectRole.P2.Obj, 1, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
Mc.SelectRole.P2.Obj.OK = false;
Mc.SelectRole.P2.Obj = null;
};
} else {
if (_arg1 == 2){
Mc.SelectRole.P2.visible = true;
if (Mc.SelectRole.a0.OK){
Mc.SelectRole.P2.x = Mc.SelectRole.a1.x;
Mc.SelectRole.P2.y = Mc.SelectRole.a1.y;
Mc.SelectRole.P2.Obj = Mc.SelectRole.a1;
Mc.SelectRole.P2.Id = Mc.SelectRole.a1.Id;
Mc.SelectRole.a1.OK = true;
TweenMax.to(Mc.SelectRole.a1, 1, {colorMatrixFilter:{}});
trace("1号被选中");
} else {
Mc.SelectRole.P2.x = Mc.SelectRole.a0.x;
Mc.SelectRole.P2.y = Mc.SelectRole.a0.y;
Mc.SelectRole.P2.Obj = Mc.SelectRole.a0;
Mc.SelectRole.P2.Id = Mc.SelectRole.a0.Id;
Mc.SelectRole.a0.OK = true;
TweenMax.to(Mc.SelectRole.a0, 1, {colorMatrixFilter:{}});
CarClubData[1].Id = 0;
};
};
};
UserCarNum = _arg1;
};
var SelectRole:Function = function (){
var RoleOK:Function;
var Obj:*;
RoleOK = function (_arg1){
var _local2:* = _arg1.target;
if (((!(_local2.OK)) && (!(Mc.SelectRole.P1.SelectOK)))){
MusicMian.AddOne(选择角色按钮);
MoveUserFinish(Mc.SelectRole.P1, _local2);
CarClubData[0].Id = _local2.Id;
} else {
if (!_local2.OK){
MusicMian.AddOne(选择角色按钮);
MoveUserFinish(Mc.SelectRole.P2, _local2);
CarClubData[1].Id = _local2.Id;
};
};
};
var i:* = 0;
while (i < 6) {
Obj = Mc.SelectRole[("a" + i)];
RoleIco[i] = [];
RoleIco[i].Ico = Obj;
Obj.buttonMode = true;
Obj.mouseChildren = false;
Obj.Id = int(i);
Obj.addEventListener(MouseEvent.CLICK, RoleOK);
Obj.OK = false;
TweenMax.to(Obj, 1, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
i = (i + 1);
};
Mc.SelectRole.a0.OK = true;
Mc.SelectRole.P1.Obj = Mc.SelectRole.a0;
Mc.SelectRole.P1.Id = Mc.SelectRole.a0.Id;
TweenMax.to(Mc.SelectRole.a0, 1, {colorMatrixFilter:{}});
};
var CPUSelectRole:Function = function (){
var RoleNum:Array;
var j:*;
var DelRoleNum:Function = function (){
var _local1:*;
for (_local1 in RoleNum) {
if (CarClubData[0].Id == RoleNum[_local1]){
RoleNum.splice(_local1, 1);
DelRoleNum();
};
if (UserCarNum == 2){
if (CarClubData[1].Id == RoleNum[_local1]){
RoleNum.splice(_local1, 1);
DelRoleNum();
};
};
};
};
RoleNum = [0, 1, 2, 3, 4, 5];
DelRoleNum();
trace(("RoleNum:" + RoleNum));
if (UserCarNum == 1){
CarClubData[1].Id = RoleNum[0];
CarClubData[2].Id = RoleNum[1];
CarClubData[3].Id = RoleNum[2];
CarClubData[4].Id = RoleNum[3];
CarClubData[5].Id = RoleNum[4];
} else {
if (UserCarNum == 2){
CarClubData[2].Id = RoleNum[0];
CarClubData[3].Id = RoleNum[1];
CarClubData[4].Id = RoleNum[2];
CarClubData[5].Id = RoleNum[3];
};
};
for (j in CarClubData) {
};
};
MusicMian.ChangeReady(选角色时的背景音乐);
RoleIco = [];
Mc = new SelectRoleID();
GamePic.addChild(Mc);
(GamePic.stage.focus = GamePic);
Mc.MenuButton.addEventListener(MouseEvent.CLICK, ButtonType);
Mc.MenuButton.addEventListener(MouseEvent.ROLL_OVER, MusicButton);
(KeyS = new KeyboardEventExample(GamePic.stage));
Mc.addEventListener(Event.ENTER_FRAME, addEvent);
Init();
}
public static function Ready(){
var ButtonType:Function;
ButtonType = function (_arg1){
if (_arg1.target.name == "PlayOn"){
MenuPic.P2Role.visible = true;
MochiEvents.trackEvent("Play", 1);
MochiEvents.startPlay();
trace("startPlay Geactiveerd!");
} else {
if (_arg1.target.name == "Option"){
GamePic.removeChild(MenuPic);
SetKeyS = new SetKey(GamePic.stage);
MochiEvents.trackEvent("Settings", 1);
} else {
if (_arg1.target.name == "P1"){
GamePic.removeChild(MenuPic);
SelectRoleReady();
} else {
if (_arg1.target.name == "P2"){
GamePic.removeChild(MenuPic);
UserCarNum = 2;
SelectRoleReady();
} else {
if (_arg1.target.name == "HelpOn"){
GamePic.removeChild(MenuPic);
HelpReady();
MochiEvents.trackEvent("Help", 1);
} else {
if (_arg1.target.name == "MoreGames"){
MovieClip(GamePic.root).LogoMoreGame("moregames-donepage");
MochiEvents.trackEvent("MoreGames Menu", 1);
trace("moregame1");
};
};
};
};
};
};
};
AllInitData();
var MyData:* = ServerData.LoadData();
if (MyData){
KeyboardEventExample.MyKey = MyData;
};
MenuPic = new HomeID();
GamePic.addChild(MenuPic);
MusicMenu.Ready(MenuPic.MusicPic);
MusicMian.ChangeReady(开场音乐);
MenuPic.MenuButton.addEventListener(MouseEvent.CLICK, ButtonType);
MenuPic.MenuButton.addEventListener(MouseEvent.ROLL_OVER, MusicButton);
MenuPic.P2Role.ButtonPic.addEventListener(MouseEvent.CLICK, ButtonType);
MenuPic.P2Role.ButtonPic.addEventListener(MouseEvent.ROLL_OVER, MusicButton);
MenuPic.P2Role.visible = false;
}
public static function HelpReady(){
var Mc:MovieClip;
var RecetOK:Function;
var ButtonType:Function;
RecetOK = function (_arg1){
GamePic.removeChild(Mc);
SetKeyS = new SetKey(GamePic.stage);
SetKeyS.RecetClick(true);
};
ButtonType = function (_arg1){
if (_arg1.target.name == "Back"){
GamePic.removeChild(Mc);
Ready();
} else {
if (_arg1.target.name == "PlayOn"){
GamePic.removeChild(Mc);
SelectRoleReady();
};
};
};
Mc = new HelpID();
Mc.MenuButton.addEventListener(MouseEvent.CLICK, ButtonType);
Mc.MenuButton.addEventListener(MouseEvent.ROLL_OVER, MusicButton);
Mc.Recet.addEventListener(MouseEvent.CLICK, RecetOK);
Mc.Recet.addEventListener(MouseEvent.ROLL_OVER, MusicButton);
GamePic.addChild(Mc);
}
}
}//package YDKGame
Section 91
//KeyboardEventExample (YDKGame.KeyboardEventExample)
package YDKGame {
import flash.events.*;
public class KeyboardEventExample extends GameRoom {
public var A:Number;
public var D:Number;
public var UserType:String;
public var Down:Number;
public var S:Number;
public var W:Number;
public var P2Key:Array;
public var Left:Number;
public var PageUp:Number;
public var Power0:Number;
public var Space:Number;
public var PageDown:Number;
public var Up:Number;
public var Right:Number;
public var P1Key:Array;
public static var MyKey:Object = {W:87, A:65, S:83, D:68, Space:32, Up:38, Down:40, Left:37, Right:39, Power0:34};
public static var MyS:Number = 83;
public static var MyW:Number = 87;
public static var MyDown:Number = 40;
public static var MySpace:Number = 32;
public static var MyUp:Number = 38;
public static var MyLeft:Number = 37;
public static var MyA:Number = 65;
public static var MyPageUp:Number = 33;
public static var MyRight:Number = 39;
public static var MyD:Number = 68;
public static var MyPageDown:Number = 34;
public static var MyPower0:Number = 34;
public function KeyboardEventExample(_arg1, _arg2:String=null){
W = MyKey.W;
A = MyKey.A;
S = MyKey.S;
D = MyKey.D;
Space = MyKey.Space;
Up = MyKey.Up;
Down = MyKey.Down;
Left = MyKey.Left;
Right = MyKey.Right;
Power0 = MyKey.Power0;
PageUp = MyPageUp;
PageDown = MyPageDown;
P1Key = [];
P2Key = [];
super();
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function keyUpHandler(_arg1:KeyboardEvent):void{
keyUpDownHandler(_arg1.keyCode, false);
}
private function keyUpDownHandler(_arg1:Number, _arg2:Boolean):void{
if (_arg1 == W){
P1Key.W = _arg2;
} else {
if (_arg1 == A){
P1Key.A = _arg2;
} else {
if (_arg1 == S){
P1Key.S = _arg2;
} else {
if (_arg1 == D){
P1Key.D = _arg2;
} else {
if (_arg1 == Up){
P2Key.Up = _arg2;
} else {
if (_arg1 == Down){
P2Key.Down = _arg2;
} else {
if (_arg1 == Left){
P2Key.Left = _arg2;
} else {
if (_arg1 == Right){
P2Key.Right = _arg2;
} else {
if (_arg1 == Space){
P1Key.Space = _arg2;
} else {
if (_arg1 == Power0){
P2Key.Space = _arg2;
};
};
};
};
};
};
};
};
};
};
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
keyUpDownHandler(_arg1.keyCode, true);
}
public function Del(_arg1){
_arg1.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_arg1.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
}
}//package YDKGame
Section 92
//Map (YDKGame.Map)
package YDKGame {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.geom.*;
import YDKClass.Photo.*;
import YDKClass.Math.*;
import gs.easing.*;
public class Map extends GameRoom {
public static var P1P2Distance:Number = 0;
public static function Ready(){
Init();
}
public static function Init(){
var MapXEnd:Number;
var MapYEnd:Number;
var MapScale:Number;
var SX:Number;
var SY:Number;
var X:Number;
var Y:Number;
var PointA:DynamicRegistration;
var MapAction:Function;
MapAction = function (_arg1){
var _local3:*;
var _local2:* = _arg1.target;
if (GameInit){
_local2.removeEventListener(Event.ENTER_FRAME, MapAction);
} else {
GameJpg.setChildIndex(AlphaMapPic, (GameJpg.numChildren - 1));
};
if (UserCarNum == 2){
SX = (SX + (Number((MapScale - _local2.scaleX)) / 5));
SY = (SY + (Number((MapScale - _local2.scaleY)) / 5));
_local3 = MathPoint.AgoBtoC(P1Car, P2Car);
P1P2Distance = MathPoint.Distance(P1Car, P2Car);
if (P1P2Distance > 600){
P1P2Distance = 600;
};
X = Number(((_local3.x - 760) - (P1P2Distance / 2)));
Y = Number(((_local3.y - 550) - (P1P2Distance / 2)));
PointA = new DynamicRegistration(_local2, new Point(X, Y));
MapScale = (1 - Number(((P1P2Distance / 1000) + 0.1)));
if (MapScale > 1){
MapScale = 1;
};
if (MapScale < 0.3){
MapScale = 0.3;
};
_local2.scaleX = 0.4;
_local2.scaleY = 0.4;
if (!GameInit){
};
} else {
_local2.scaleX = MapScale;
_local2.scaleY = MapScale;
X = Number((CameraObj.x - 300));
Y = Number((CameraObj.y - 300));
};
MapXEnd = (MapXEnd + (int((X - MapXEnd)) / 5));
MapYEnd = (MapYEnd + (int((Y - MapYEnd)) / 5));
if (MapXEnd < (0 + 20)){
MapXEnd = (0 + 20);
};
if (MapYEnd < (0 + 20)){
MapYEnd = (0 + 20);
};
if (MapXEnd > (GameJpg.width - 700)){
MapXEnd = (GameJpg.width - 700);
};
if (MapYEnd > (GameJpg.height - 600)){
MapYEnd = (GameJpg.height - 600);
};
_local2.x = ((0 - MapXEnd) + 100);
_local2.y = (0 - MapYEnd);
};
GameJpg.addEventListener(Event.ENTER_FRAME, MapAction);
MapXEnd = 0;
MapYEnd = 0;
var MiddleCamera:Object = new Object();
MapScale = 1;
SX = 1;
SY = 1;
BackGroundPic.Water.visible = false;
BackGroundPic.EnemyAI.visible = false;
AlphaMapPic.alpha = 0.7;
BackGroundPic.Wall.alpha = 0;
}
public static function WoodArrReady(){
var _local2:*;
var _local1:* = 0;
while (_local1 < BackGroundPic.WoodPic.numChildren) {
_local2 = BackGroundPic.WoodPic.getChildAt(_local1);
_local2.gotoAndStop(1);
_local2.HP = 100;
_local2.ActionIng = "Ready";
_local1++;
};
}
}
}//package YDKGame
Section 93
//Prop (YDKGame.Prop)
package YDKGame {
import flash.display.*;
import flash.events.*;
import gs.*;
import flash.geom.*;
import YDKClass.Math.*;
import gs.easing.*;
public class Prop extends GameRoom {
public static var MyColor:ColorTransform = new ColorTransform();
public static function SetColorReady(_arg1, _arg2){
MyColor.color = _arg2;
_arg1.transform.colorTransform = MyColor;
}
public static function Ready(){
Init();
}
public static function MissileTrack(_arg1:MovieClip, _arg2:MovieClip):void{
var _local3:Number = 12;
var _local4:Number = 15;
var _local5:Number = 8;
var _local6:Number = (_arg1.x - _arg2.x);
var _local7:Number = (_arg1.y - _arg2.y);
var _local8:* = (Number((270 + ((Math.atan2(_local7, _local6) * 180) / Math.PI))) % 360);
var _local9:* = (Number(((_local8 - _arg1.rotation) + 360)) % 360);
var _local10:Number = ((_local9 <= 180)) ? 1 : -1;
_arg1.rotation = (Number((((((_local9 < 180)) && ((_local9 > _local5)))) || ((((_local9 > 180)) && (((360 - _local9) > _local5))))))) ? Number((_arg1.rotation + (_local5 * _local10))) : _local8;
_arg1.x = (_arg1.x + (_local4 * Math.sin(((_arg1.rotation * Math.PI) / 180))));
_arg1.y = (_arg1.y - (_local4 * Math.cos(((_arg1.rotation * Math.PI) / 180))));
}
public static function NewMissile(_arg1:MovieClip){
var i:*;
var ActionEvent:Function;
var Temp:*;
var Distance:*;
var Mc = _arg1;
ActionEvent = function (_arg1){
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local2:* = _arg1.target;
if (((((((((((GamePlayIng) || ((_local2.Time >= _local2.TimeMax)))) || ((_local2.x > (BackGroundPic.width - 20))))) || ((_local2.x < 22)))) || ((_local2.y < 22)))) || ((_local2.y > (BackGroundPic.height - 20))))){
if (!_local2.Del){
_local2.Del = true;
_local2.Space.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, ActionEvent);
trace(" 导弹超出了界线! ");
return;
};
};
if (GamePause){
if (_local2.Obj){
MissileTrack(_local2, _local2.Obj);
} else {
_local4 = ((_local2.Speed * Math.cos(((int((90 - _local2.Rotation)) / 180) * Math.PI))) * 2);
_local5 = ((_local2.Speed * Math.sin(((int((90 - _local2.Rotation)) / 180) * Math.PI))) * 2);
_local2.x = (_local2.x + _local4);
_local2.y = (_local2.y - _local5);
};
if ((((_local2.Time < _local2.TimeMax)) && (_local2.hitTestObject(BackGroundPic)))){
_local2.Time++;
};
for (_local3 in CarClub) {
_local6 = CarClub[_local3];
if (_local6.Type != "Box"){
if (((((_local2.hitTestObject(_local6)) && (!((_local6 == _local2.Mc))))) && (_local6.visible))){
if (_local6.SpeedInit < 0){
_local6.SpeedInit = (_local6.SpeedInit - 10);
} else {
_local6.SpeedInit = (_local6.SpeedInit + 10);
};
_local6.PowerSpeedInit = 10;
trace(("有人中弹了:" + _local6.PowerSpeedInit));
_local6.RotationPower = _local2.rotation;
_local6.SpeedHitPower = 50;
_local7 = -(int((_local6.Score / 10)));
Prop.McaddScore(_local6, _local7);
if (!_local2.Del){
_local2.Del = true;
_local2.Space.removeChild(_local2);
NewBlast(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, ActionEvent);
};
};
};
};
};
};
MusicMian.AddOne(发射火箭);
trace("创建导弹!");
var Ico:MovieClip = new PropID();
GameJpg.addChild(Ico);
Ico.x = Mc.x;
Ico.y = Mc.y;
Ico.gotoAndStop(2);
Ico.Speed = 10;
Ico.rotation = Mc.Rotation;
Ico.Mc = Mc;
var SSArr:Array = [];
for (i in CarClub) {
Temp = CarClub[i];
if (Temp.Type != "Box"){
Distance = MathPoint.Distance(Ico, Temp);
if ((((Distance < 3000)) && (!((Temp == Mc))))){
SSArr.push({Mc:Temp, Distance:Distance});
};
};
};
SSArr.sortOn("Distance", Array.NUMERIC);
Ico.Obj = SSArr[0].Mc;
if (Ico.Obj){
trace("发现目标!------------------> 开始导航");
Ico.Angle = Math.atan2((Ico.Obj.y - Mc.y), (Ico.Obj.x - Mc.x));
Ico.Rotation = int(((Ico.Rotation * 180) / Math.PI));
} else {
Ico.Rotation = Mc.Rotation;
};
Ico.Rotation = Mc.Rotation;
Ico.Time = 0;
Ico.TimeMax = 500;
Ico.addEventListener(Event.ENTER_FRAME, ActionEvent);
Ico.Space = GameJpg;
}
public static function McaddScore(_arg1:MovieClip, _arg2:Number){
if (_arg1.Type != "Box"){
NewScore(_arg1, _arg2);
_arg1.Score = (_arg1.Score + _arg2);
if (_arg1.Score < 0){
_arg1.Score = 0;
};
_arg1.PropIco.Score.text = _arg1.Score;
};
}
public static function UseProp(_arg1:MovieClip){
if (_arg1.Prop == "Missile"){
Prop.NewMissile(_arg1);
} else {
if (_arg1.Prop == "Bomb"){
Prop.NewBomb(_arg1);
} else {
if (_arg1.Prop == "Oil"){
Prop.NewOil(_arg1);
} else {
if (_arg1.Prop == "Sleep"){
Prop.NewSleep(_arg1);
};
};
};
};
_arg1.Prop = "Null";
_arg1.PropIco.Prop.gotoAndStop(_arg1.Prop);
}
public static function Init(){
}
public static function NewBomb(_arg1:MovieClip){
var ActionEvent:Function;
var Mc = _arg1;
ActionEvent = function (_arg1){
var _local3:*;
var _local4:*;
var _local5:*;
var _local2:* = _arg1.target;
if ((((_local2.currentFrame == _local2.totalFrames)) || (GamePlayIng))){
if (!_local2.Del){
_local2.Del = true;
_local2.Space.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, ActionEvent);
};
};
for (_local3 in CarClub) {
_local4 = CarClub[_local3];
if (_local4.Type != "Box"){
if (((((_local2.hitTestObject(_local4)) && (!((_local4 == _local2.Mc))))) && (_local4.visible))){
_local5 = -(int((_local4.Score / 10)));
Prop.McaddScore(_local4, _local5);
if (!_local2.Del){
_local2.Del = true;
_local2.Space.removeChild(_local2);
NewBlast(_local2);
Car.CarToWater(_local4, true);
_local2.removeEventListener(Event.ENTER_FRAME, ActionEvent);
};
};
};
};
};
trace("创建地雷!");
var Ico:MovieClip = new PropID();
AshClub.addChild(Ico);
Ico.x = Mc.x;
Ico.y = Mc.y;
Ico.gotoAndStop(1);
var Obj:* = Ico.getChildAt(0);
Obj.gotoAndStop(1);
Ico.addEventListener(Event.ENTER_FRAME, ActionEvent);
Ico.Mc = Mc;
Ico.Space = AshClub;
}
public static function NewScore(_arg1:MovieClip, _arg2:Number){
var Time:Function;
var Mc = _arg1;
var Num = _arg2;
Time = function (_arg1){
var _local2:* = _arg1.target;
if (_local2.currentFrame == _local2.totalFrames){
if (!_local2.Del){
_local2.Del = true;
_local2.Space.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, Time);
};
};
};
var ColorS:Array = [0x9900, 0xFFFF, 0xFF0000, 0xFF00FF, 0xFFFF00, 0xFF00, null, null, null, null, 0x9900, 0xFFFF, 0xFF0000, 0xFF00FF, 0xFFFF00, 0xFF00];
var Ico:MovieClip = new ScoreIcoID();
GameJpg.addChild(Ico);
Ico.Ico.a.Score.text = Num;
if (Num <= 0){
TweenMax.to(Ico, 0, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
} else {
TweenMax.to(Ico, 0, {colorMatrixFilter:{colorize:ColorS[(Mc.Car.currentFrame - 1)], amount:1}});
};
Ico.x = Mc.x;
Ico.y = Mc.y;
Ico.addEventListener(Event.ENTER_FRAME, Time);
Ico.Space = GameJpg;
}
public static function NewBlast(_arg1:MovieClip){
var Time:Function;
var Mc = _arg1;
Time = function (_arg1){
var _local2:* = _arg1.target;
if (_local2.currentFrame == _local2.totalFrames){
if (!_local2.Del){
_local2.Del = true;
_local2.Space.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, Time);
};
};
};
var Ico:MovieClip = new BlastID();
GameJpg.addChild(Ico);
MusicMian.AddOne(地雷爆炸);
Ico.x = Mc.x;
Ico.y = Mc.y;
Ico.play();
Ico.addEventListener(Event.ENTER_FRAME, Time);
Ico.Space = GameJpg;
}
public static function NewOil(_arg1:MovieClip){
var Time:Function;
var Mc = _arg1;
Time = function (_arg1){
var _local2:* = _arg1.target;
if ((((_local2.Time < _local2.TimeMax)) && (_local2.Car.visible))){
_local2.Time++;
Mc.Speed = 4;
} else {
_local2.Car.Speed = _local2.Car.SpeedMax;
_local2.Car.Car.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, Time);
};
};
MusicMian.AddOne(加油门);
trace("给自己加汽油!");
var Ico:MovieClip = new PropID();
Mc.Car.addChild(Ico);
Ico.gotoAndStop(5);
Ico.Car = Mc;
Ico.addEventListener(Event.ENTER_FRAME, Time);
Ico.Time = 0;
Ico.TimeMax = 200;
}
public static function NewSleep(_arg1:MovieClip){
var i:*;
var ActionEvent:Function;
var Car:*;
var Ico:MovieClip;
var Mc = _arg1;
ActionEvent = function (_arg1){
var _local2:* = _arg1.target;
if ((((_local2.Time < _local2.TimeMax)) && (_local2.Car.visible))){
_local2.Time++;
} else {
_local2.Car.EngineReady = true;
TweenMax.to(_local2.Car, 1, {colorMatrixFilter:{}});
_local2.Car.Car.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, ActionEvent);
};
};
trace("使对方睡觉!");
for (i in CarClub) {
Car = CarClub[i];
if (Car.Type != "Box"){
if (((!((Car == Mc))) && (Car.EngineReady))){
Ico = new PropID();
Ico.gotoAndStop(4);
Car.Car.addChild(Ico);
Car.EngineReady = false;
Ico.Car = Car;
TweenMax.to(Car, 1, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
Ico.addEventListener(Event.ENTER_FRAME, ActionEvent);
Ico.Time = 0;
Ico.TimeMax = 100;
};
};
};
}
}
}//package YDKGame
Section 94
//SetKey (YDKGame.SetKey)
package YDKGame {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import gs.*;
import YDKClass.System.*;
import gs.easing.*;
public class SetKey extends GameRoom {
public var McPic:MovieClip;
public var ObjIco:MovieClip;
public function SetKey(_arg1){
Init();
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
public function keyDownHandler(_arg1:KeyboardEvent):void{
trace(("keyDownHandler: " + _arg1.keyCode));
keyUpDownHandler(_arg1.keyCode, true, GetCodeAbc(_arg1.keyCode));
}
public function GetCodeAbc(_arg1){
var _local2:* = String.fromCharCode(_arg1);
var _local3:* = GetCode(_arg1);
if (_local3){
_local2 = _local3;
};
return (_local2);
}
public function InitKey(){
McPic.SetKey.W.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.W);
McPic.SetKey.A.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.A);
McPic.SetKey.S.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.S);
McPic.SetKey.D.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.D);
McPic.SetKey.Space.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.Space);
McPic.SetKey.Up.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.Up);
McPic.SetKey.Down.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.Down);
McPic.SetKey.Left.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.Left);
McPic.SetKey.Right.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.Right);
McPic.SetKey.Power0.Msg.text = GetCodeAbc(KeyboardEventExample.MyKey.Power0);
}
public function Click(_arg1){
var _local2:* = _arg1.target;
if (_local2.name == "Back"){
DelThis();
Home.Ready();
} else {
if (_local2.name == "PlayOn"){
DelThis();
Home.SelectRoleReady();
} else {
if (_local2.name == "Save"){
_local2.visible = false;
ServerData.SaveOneData(KeyboardEventExample.MyKey);
} else {
if (_local2.name == "P2"){
DelThis();
UserCarNum = 2;
Home.SelectRoleReady();
};
};
};
};
}
public function DelThis(){
GamePic.removeChild(McPic);
Del(GamePic.stage);
}
public function GetCode(_arg1){
if (_arg1 == 38){
return ("↑");
};
if (_arg1 == 40){
return ("↓");
};
if (_arg1 == 37){
return ("←");
};
if (_arg1 == 39){
return ("→");
};
if (_arg1 == 17){
return ("Ctrl");
};
if (_arg1 == 16){
return ("Shift");
};
if (_arg1 == 32){
return ("Space");
};
if (_arg1 == 45){
return ("Insert");
};
if (_arg1 == 36){
return ("Home");
};
if (_arg1 == 33){
return ("PageUp");
};
if (_arg1 == 46){
return ("Delete");
};
if (_arg1 == 35){
return ("End");
};
if (_arg1 == 34){
return ("PageDown");
};
if (_arg1 == 96){
return ("0");
};
if (_arg1 == 97){
return ("1");
};
if (_arg1 == 98){
return ("2");
};
if (_arg1 == 99){
return ("3");
};
if (_arg1 == 100){
return ("4");
};
if (_arg1 == 101){
return ("5");
};
if (_arg1 == 102){
return ("6");
};
if (_arg1 == 103){
return ("7");
};
if (_arg1 == 104){
return ("8");
};
if (_arg1 == 105){
return ("9");
};
if (_arg1 == 110){
return (".");
};
if (_arg1 == 219){
return ("[");
};
if (_arg1 == 221){
return ("]");
};
if (_arg1 == 186){
return (";");
};
if (_arg1 == 222){
return ("'");
};
if (_arg1 == 188){
return (",");
};
if (_arg1 == 190){
return (".");
};
if (_arg1 == 191){
return ("/");
};
if (_arg1 == 110){
return (",");
};
return (false);
}
public function Del(_arg1){
_arg1.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_arg1.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
public function keyUpDownHandler(_arg1:Number, _arg2:Boolean, _arg3:String=null):void{
if (ObjIco){
ObjIco.Msg.text = _arg3;
McPic.PleaseKey.visible = false;
KeyboardEventExample.MyKey[ObjIco.name] = _arg1;
TweenMax.to(ObjIco, 1, {glowFilter:{color:0xFF0000, alpha:0, blurX:15, blurY:15, strength:2}});
};
}
public function Init(){
McPic = new SetKeyID();
GamePic.addChild(McPic);
McPic.MenuButton.addEventListener(MouseEvent.CLICK, Click);
McPic.MenuButton.addEventListener(MouseEvent.ROLL_OVER, MusicButton);
McPic.Recet.addEventListener(MouseEvent.CLICK, RecetClick);
McPic.Recet.addEventListener(MouseEvent.ROLL_OVER, MusicButton);
McPic.SetKey.addEventListener(MouseEvent.CLICK, SetKeyIco);
NoMouseEvent();
InitKey();
McPic.PleaseKey.visible = false;
McPic.JT.visible = false;
McPic.Look.visible = false;
}
public function NoMouseEvent(){
var _local2:*;
var _local1:* = 0;
while (_local1 < McPic.SetKey.numChildren) {
_local2 = McPic.SetKey.getChildAt(_local1);
_local2.buttonMode = true;
_local2.mouseChildren = false;
_local1++;
};
}
public function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function RecetClick(_arg1){
McPic.SetKey.W.Msg.text = "";
McPic.SetKey.A.Msg.text = "";
McPic.SetKey.S.Msg.text = "";
McPic.SetKey.D.Msg.text = "";
McPic.SetKey.Space.Msg.text = "";
McPic.SetKey.Up.Msg.text = "";
McPic.SetKey.Down.Msg.text = "";
McPic.SetKey.Left.Msg.text = "";
McPic.SetKey.Right.Msg.text = "";
McPic.SetKey.Power0.Msg.text = "";
McPic.JT.visible = true;
SetKeyLook();
}
public function SetKeyLook(){
McPic.Look.visible = true;
McPic.Look.gotoAndPlay(2);
}
public function SetKeyIco(_arg1){
var _local2:* = _arg1.target;
ObjIco = _local2;
trace(("Obj:" + _local2.name));
McPic.PleaseKey.visible = true;
TweenMax.to(ObjIco, 1, {glowFilter:{color:0xFF0000, alpha:1, blurX:15, blurY:15, strength:5}});
McPic.MenuButton.Save.visible = true;
}
}
}//package YDKGame
Section 95
//UI (YDKGame.UI)
package YDKGame {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import gs.*;
import YDKClass.*;
import YDKClass.Math.*;
import gs.easing.*;
public class UI extends GameRoom {
public static var Time;
public static function Init(){
}
public static function GameThreeTimeReady(){
var GameThreeTimeHander:Function;
GameThreeTimeHander = function (_arg1){
var _local2:* = _arg1.target;
if ((((((_local2.Gif.currentFrame == 2)) || ((_local2.Gif.currentFrame == 30)))) || ((_local2.Gif.currentFrame == 55)))){
MusicMian.AddOne(倒计时1秒);
};
if (_local2.Gif.currentFrame == 74){
MusicMian.AddOne(GO);
};
if (_local2.Gif.currentFrame == _local2.Gif.totalFrames){
GamePause = true;
GamePic.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, GameThreeTimeHander);
NewTime();
MusicMian.ChangeReady(背景音乐);
};
};
trace("GameThreeTimeReady");
GamePause = false;
Map.WoodArrReady();
var Mc:MovieClip = new TimeReadyID();
GamePic.addChild(Mc);
Mc.addEventListener(Event.ENTER_FRAME, GameThreeTimeHander);
}
public static function Ready(){
Init();
IcoReady();
MenuReady();
GameThreeTimeReady();
MusicMenu.Ready(UIPic.MusicPic);
}
public static function MenuReady(){
var Handler:Function;
Handler = function (_arg1){
var _local2:* = _arg1.target.name;
if (_local2 == "Pause"){
PauseReady();
MochiEvents.trackEvent("Pauze", 1);
} else {
if (_local2 == "Quit"){
QuitReady();
MochiEvents.trackEvent("Quit", 1);
};
};
trace(("Name:" + _local2));
};
var QuitReady:Function = function (){
var Mc:MovieClip;
var Handler:Function;
Handler = function (_arg1){
if (_arg1.target.name == "Yes"){
GamePic.removeChild(Mc);
GameRoom.DelRoom();
} else {
if (_arg1.target.name == "No"){
GamePause = true;
Time.Ready();
TweenMax.to(GameJpg, 1, {colorMatrixFilter:{}});
GamePic.removeChild(Mc);
GamePic.stage.focus = GamePic;
};
};
};
trace("确认是否退出!");
GamePause = false;
Time.Stop();
Mc = new QuitID();
GamePic.addChild(Mc);
Mc.MenuButton.addEventListener(MouseEvent.CLICK, Handler);
TweenMax.to(GameJpg, 2, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
};
var PauseReady:Function = function (){
var Mc:*;
var Handler:Function;
Handler = function (_arg1){
var _local2:* = _arg1.target;
if (_local2.name == "MoreGames"){
MovieClip(GamePic.root).LogoMoreGame("moregames-ingame");
} else {
GamePause = true;
Time.Ready();
TweenMax.to(GameJpg, 1, {colorMatrixFilter:{}});
GamePic.removeChild(Mc);
GamePic.stage.focus = GamePic;
};
};
GamePause = false;
Time.Stop();
trace("暂停!");
Mc = new PauseID();
GamePic.addChild(Mc);
Mc.buttonMode = true;
Mc.addEventListener(MouseEvent.CLICK, Handler);
TweenMax.to(GameJpg, 2, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
};
UIPic.Menu.addEventListener(MouseEvent.CLICK, Handler);
UIPic.tabChildren = false;
}
public static function SelectCameraObj(_arg1:MovieClip){
var NewCamera:Function;
var Mc = _arg1;
NewCamera = function (_arg1){
var _local2:* = _arg1.target;
CameraObj = _local2.Car;
};
Mc.buttonMode = true;
Mc.mouseChildren = false;
Mc.addEventListener(MouseEvent.CLICK, NewCamera);
}
public static function GameThreeTimeEnd(){
var GameThreeTimeHander:Function;
GameThreeTimeHander = function (_arg1){
var _local2:* = _arg1.target;
if ((((((_local2.Gif.currentFrame == 2)) || ((_local2.Gif.currentFrame == 35)))) || ((_local2.Gif.currentFrame == 65)))){
MusicMian.AddOne(倒计时1秒);
};
if (_local2.Gif.currentFrame == _local2.Gif.totalFrames){
GamePic.removeChild(_local2);
_local2.removeEventListener(Event.ENTER_FRAME, GameThreeTimeHander);
};
};
var Mc:MovieClip = new TimeEndID();
GamePic.addChild(Mc);
Mc.addEventListener(Event.ENTER_FRAME, GameThreeTimeHander);
GamePic.stage.focus = GamePic;
}
public static function NewTime(){
var TimeOver:Function;
TimeOver = function (_arg1:int){
var _local2:* = int((_arg1 / 60));
var _local3:* = int((_arg1 - (int((_arg1 / 60)) * 60)));
if (_local2 < 10){
_local2 = ("0" + _local2);
};
if (_local3 < 10){
_local3 = ("0" + _local3);
};
UIPic.Time.text = ((_local2 + ":") + _local3);
if (_arg1 < 1){
GameOver();
Time.Stop();
};
if (_arg1 == 3){
GameThreeTimeEnd();
};
};
Time = new TimerExample(GameTimeNum, TimeOver);
Time.Ready();
}
public static function IcoReady(){
var PropIcoHander:Function;
var Mc:MovieClip;
var PropIco:MovieClip;
var Goto:int;
var Car:MovieClip;
PropIcoHander = function (_arg1){
var _local3:*;
var _local4:*;
var _local2:* = _arg1.target;
if (GameInit){
_local2.removeEventListener(Event.ENTER_FRAME, PropIcoHander);
};
if (_local2.Ready){
if (_local2.Time < _local2.TimeMax){
_local2.Time++;
} else {
_local2.gotoAndStop(1);
_local2.Ready = false;
};
} else {
for (_local3 in CarClub) {
_local4 = CarClub[_local3];
if (_local4.Type != "Box"){
if (_local2.hitTestObject(_local4)){
_local2.Ready = true;
_local2.gotoAndStop(2);
AddProp(_local4);
_local2.Time = 0;
};
};
};
};
};
var AddProp:Function = function (_arg1:MovieClip){
var _local4:int;
var _local2:Array = ["Bomb", "Missile", "Oil", "Sleep"];
var _local3:* = _local2[int((Math.random() * _local2.length))];
trace(("我吃到道具了!" + _local3));
if (_arg1.Prop != "Null"){
_local4 = ((Math.random() * 10) + 5);
Prop.NewScore(_arg1, _local4);
_arg1.Score = (_arg1.Score + _local4);
_arg1.PropIco.Score.text = _arg1.Score;
} else {
_arg1.Prop = _local3;
_arg1.PropIco.Prop.gotoAndStop(_local3);
if (UserCarNum == 1){
if (((!(SavePropType[_local3])) && ((_arg1 == P1Car)))){
OpenPorpInfo(_local3);
SavePropType[_local3] = true;
_arg1.PropIco.Prop.Msg.a.gotoAndStop(_local3);
_arg1.PropIco.Prop.Msg.gotoAndPlay(2);
};
};
};
};
var OpenPorpInfo:Function = function (_arg1){
var Mc:MovieClip;
var Exit:Function;
var Type = _arg1;
Exit = function (){
GamePause = true;
Time.Ready();
GamePic.removeChild(Mc);
};
Mc = new InfoPropID();
GamePic.addChild(Mc);
Mc.gotoAndStop(Type);
GamePause = false;
Time.Stop();
var I:* = setTimeout(Exit, 3000);
};
var i:* = 0;
while (i < CarClub.length) {
Mc = UIPic[("a" + i)];
PropIco = BackGroundPic[("b" + int((i + 1)))];
Goto = (CarClubData[i].Id + 1);
Car = CarClub[i];
Car.PropIco = Mc;
Mc.Car = Car;
SelectCameraObj(Mc);
if (Goto){
Mc.Ico.gotoAndStop(Goto);
} else {
Mc.Ico.gotoAndStop((i + 1));
};
Mc.Prop.gotoAndStop(Car.Prop);
Mc.Prop.Msg.visible = false;
Mc.CPU.gotoAndStop(1);
if (i > 0){
Mc.CPU.visible = false;
};
if (UserCarNum == 2){
if (i == 1){
Mc.CPU.gotoAndStop(2);
Mc.CPU.visible = true;
};
};
if (UserCarNum == 1){
if (i >= LevelCarNum[(Level - 1)]){
TweenMax.to(Mc, 1, {colorMatrixFilter:{colorize:0xFFFFFF, amount:1}});
Mc.Ico.visible = false;
Mc.alpha = 0.2;
} else {
TweenMax.to(Mc, 1, {colorMatrixFilter:{}});
Mc.Ico.visible = true;
Mc.alpha = 1;
};
};
if (PropIco){
PropIco.gotoAndStop(1);
PropIco.Time = 0;
PropIco.TimeMax = 200;
PropIco.Ready = false;
PropIco.gotoAndStop(1);
if (!PropIco.hasEventListener(Event.ENTER_FRAME)){
PropIco.addEventListener(Event.ENTER_FRAME, PropIcoHander);
};
};
i = (i + 1);
};
}
}
}//package YDKGame
Section 96
//con_mcGamesClub2as2_9 (ZooDodgem_fla.con_mcGamesClub2as2_9)
package ZooDodgem_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class con_mcGamesClub2as2_9 extends MovieClip {
public var a:SimpleButton;
public function con_mcGamesClub2as2_9(){
addFrameScript(0, frame1, 13, frame14, 21, frame22, 29, frame30, 35, frame36, 42, frame43, 52, frame53, 59, frame60, 66, frame67, 72, frame73, 79, frame80);
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, Change);
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame80(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
public function GotoOK(_arg1){
MovieClip(parent).gotoAndPlay("ReadyPlay");
}
function frame60(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame73(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame30(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame53(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame43(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame22(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame67(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
public function Change(_arg1){
var _local2:* = root;
gotoAndStop(_local2.Goto);
removeEventListener(Event.ENTER_FRAME, Change);
}
function frame14(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame36(){
a.addEventListener(MouseEvent.CLICK, GotoOK);
}
}
}//package ZooDodgem_fla
Section 97
//Gamesbookas2_42 (ZooDodgem_fla.Gamesbookas2_42)
package ZooDodgem_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Gamesbookas2_42 extends MovieClip {
public var Type:String;
public var Logo:MovieClip;
public function Gamesbookas2_42(){
addFrameScript(0, frame1);
}
public function NewLogo(_arg1){
trace(Type);
gotoAndStop(1);
if ((MovieClip(root).LogoMoreGame as Function)){
MovieClip(root).LogoMoreGame(Type);
} else {
trace("loading...Error!");
};
}
public function Over(_arg1){
Logo.gotoAndStop(2);
}
function frame1(){
stop();
Logo.buttonMode = true;
Logo.mouseChildren = false;
Logo.addEventListener(MouseEvent.CLICK, NewLogo);
Logo.addEventListener(MouseEvent.MOUSE_OVER, Over);
Logo.addEventListener(MouseEvent.MOUSE_OUT, Out);
}
public function Out(_arg1){
Logo.gotoAndStop(1);
}
}
}//package ZooDodgem_fla
Section 98
//Gamesbookas22_43 (ZooDodgem_fla.Gamesbookas22_43)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Gamesbookas22_43 extends MovieClip {
public function Gamesbookas22_43(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 99
//GamesBookLoader_1 (ZooDodgem_fla.GamesBookLoader_1)
package ZooDodgem_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class GamesBookLoader_1 extends MovieClip {
public var con:MovieClip;
public var LoadPic:MovieClip;
public var Pic:MovieClip;
public var U:SimpleButton;
public var Role:SimpleButton;
public var IntroLogo:MovieClip;
public var T;
public function GamesBookLoader_1(){
addFrameScript(0, frame1, 18, frame19, 19, frame20, 33, frame34, 47, frame48);
}
public function RoleOK2(_arg1){
MovieClip(root).LogoMoreGame("intro");
}
public function RoleOK(_arg1){
MovieClip(root).LogoMoreGame("preloader actor");
}
function frame1(){
stop();
U.addEventListener(MouseEvent.CLICK, GotoOK);
}
function frame48(){
MovieClip(root).LoadGamePlay();
stop();
Pic.stop();
}
public function Star(){
play();
}
function frame20(){
U.addEventListener(MouseEvent.CLICK, RoleOK2);
}
function frame19(){
stop();
Role.addEventListener(MouseEvent.CLICK, RoleOK);
}
function frame34(){
stop();
T = setTimeout(Star, (MovieClip(root).TimeNum * 1000));
}
public function GotoOK(_arg1){
MovieClip(root).LogoMoreGame("preloader");
}
}
}//package ZooDodgem_fla
Section 100
//loadingGamesClub2as2_4 (ZooDodgem_fla.loadingGamesClub2as2_4)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class loadingGamesClub2as2_4 extends MovieClip {
public function loadingGamesClub2as2_4(){
addFrameScript(23, frame24);
}
function frame24(){
gotoAndPlay(1);
}
}
}//package ZooDodgem_fla
Section 101
//MainTimeline (ZooDodgem_fla.MainTimeline)
package ZooDodgem_fla {
import flash.utils.*;
import flash.display.*;
import com.hurlant.crypto.symmetric.*;
import flash.events.*;
import mochi.as3.*;
import flash.geom.*;
import flash.filters.*;
import com.hurlant.util.*;
import com.hurlant.crypto.*;
import YDKClass.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import YDKGame.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var Prop:MovieClip;
public var portal:String;
public var GAME_ID:String;
public var Goto:String;
public var ServerFps;
public var Game:MovieClip;
public var loader:URLLoader;
public var scf:SoundTransform;
public var IntroPic:MovieClip;
public var sender:LocalConnection;
public var Volume:Number;
public var GameName:String;
public var HighscoreUrl:String;
public var continueButton:Number;
public var domain:String;
public var Url:String;
public var TypeS;
public var TimeNum:Number;
public var MochiBotKey:String;
public var wouter:String;
public var AphaIco:AlphaMap1ID;
public var PleaseKey:PleaseKeyID;
public var url:String;
public var utm_content:String;
public var branding:String;
public function MainTimeline(){
addFrameScript(0, frame1, 4, frame5);
}
function frame5(){
Game = new MovieClip();
addChild(Game);
stage.frameRate = 30;
GameInitReady();
}
public function com(_arg1){
var _local2:String;
_local2 = _arg1.target.data.toLowerCase();
if (_local2 == "funnygames.co.uk"){
Url = "http://www.funnygames.co.uk/";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
Goto = "funnygames";
} else {
if (_local2 == "giocare.it"){
Url = "http://www.giocare.it/";
HighscoreUrl = ((Url + "punteggi-piu-alti/") + clean_game_name(GameName));
Goto = "giocare";
} else {
if (_local2 == "hry.net"){
Url = "http://www.hry.net/";
HighscoreUrl = ((Url + "nejvyssi-skore/") + clean_game_name(GameName));
Goto = "hry";
} else {
if (_local2 == "sk.hry.net"){
Url = "http://sk.hry.net/";
HighscoreUrl = ((Url + "najvyssie-skore/") + clean_game_name(GameName));
Goto = "hry";
} else {
if (_local2 == "jatekok.net"){
Url = "http://www.jatekok.net/";
HighscoreUrl = ((Url + "legmagasabb-pontszam/") + clean_game_name(GameName));
Goto = "jatekok";
} else {
if (_local2 == "jeuxgratuits.fr"){
Url = "http://www.jeuxgratuits.fr/";
HighscoreUrl = ((Url + "meilleurs-scores/") + clean_game_name(GameName));
Goto = "jeuxgratuits";
} else {
if (_local2 == "jocuri.net"){
Url = "http://www.jocuri.net/";
HighscoreUrl = ((Url + "cele-mai-mari-scoruri/") + clean_game_name(GameName));
Goto = "jocuri";
} else {
if (_local2 == "lege.dk"){
Url = "http://www.lege.dk/";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
Goto = "lege";
} else {
if (_local2 == "spelletje.nl"){
Url = "http://www.spelletje.nl/";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
Goto = "spelletje";
} else {
if (_local2 == "spiel.de"){
Url = "http://www.spiel.de/";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
Goto = "spiel";
} else {
if (_local2 == "igriigri.ru"){
Url = "http://www.igriigri.ru/";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
Goto = "igriigri";
} else {
if (_local2 == "spille.no"){
Url = "http://www.spille.no/";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
Goto = "spille";
} else {
if (_local2 == "flashgierki.pl"){
Url = "http://www.flashgierki.pl/";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
Goto = "flashgierki";
} else {
Url = "http://www.gamesclub.com/";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
Goto = "gamesclub";
};
};
};
};
};
};
};
};
};
};
};
};
};
IntroPic.IntroLogo.gotoAndStop(Goto);
NewLoading();
}
public function GameInitReady(){
GameData.GamePic = Game;
Home.Ready();
GameMask.GameMaskReady(700, 500, MovieClip(root));
gotoAndStop("GameFrame");
}
public function NewLoading(){
stage.addEventListener(Event.ENTER_FRAME, onEnterFramee);
MochiServices.connect(GAME_ID, MovieClip(root), onFailure);
}
public function onFailure(_arg1=null):void{
trace("Mochi did not load");
}
public function JaludoMochiStopplay(){
}
public function ScreenReady(){
removeChild(Game);
var _local1:YDKScreen = new YDKScreen(Game);
addChild(_local1);
}
public function onEnterFramee(_arg1:Event){
var _local2:Number;
var _local3:Number;
if (framesLoaded == totalFrames){
stage.removeEventListener(Event.ENTER_FRAME, onEnterFramee);
IntroPic.gotoAndPlay(2);
} else {
_local2 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
_local3 = Math.round((_local2 * 100));
IntroPic.LoadPic.gotoAndStop((int((_local3 / 10)) + 1));
};
}
public function send_highscore(_arg1:String){
var _local2:URLRequest;
_local2 = new URLRequest(HighscoreUrl);
_local2.contentType = "application/octet-stream";
var _local3:* = encrypt(_arg1);
_local2.method = URLRequestMethod.POST;
_local2.data = _local3;
navigateToURL(_local2);
}
public function clean_game_name(_arg1){
_arg1 = _arg1.toLowerCase();
_arg1 = _arg1.split(" ").join("-");
return (_arg1);
}
public function JaludoMochiTrackEvent(_arg1){
MochiEvents.trackEvent(_arg1, 1);
trace(("JaludoMochiTrackEvent:" + _arg1));
}
public function LogoMoreGame(_arg1:String){
utm_content = _arg1;
MoreGameURL(true);
}
public function OpenGameUrl(){
var _local1 = "WWW";
var _local2 = "Open Game Name?";
var _local3:String = ((((((("?utm_campaign=" + GameName) + "&utm_content=") + _local2) + "&utm_medium=") + branding) + "&utm_source=") + url);
var _local4:String = (_local1 + _local3);
var _local5:URLRequest = new URLRequest(_local4);
navigateToURL(_local5);
}
public function JSod(){
stage.addEventListener(Event.ENTER_FRAME, NewSod);
}
public function MoreGameURL(_arg1){
var _local2:String = ((((((("?utm_campaign=" + escape(GameName)) + "&utm_content=") + escape(utm_content)) + "&utm_medium=") + escape(branding)) + "&utm_source=") + escape(url));
var _local3:String = (Url + _local2);
var _local4:URLRequest = new URLRequest(_local3);
navigateToURL(_local4);
}
function frame1(){
GameName = "Zoo Dodgemen";
GAME_ID = "d62768f1291e130c";
MochiBotKey = "234f409c";
branding = "original";
continueButton = 1;
TimeNum = 3;
wouter = "2b9tf5tw";
Volume = 1;
scf = new SoundTransform();
ServerFps = stage.frameRate;
stage.frameRate = 30;
MochiBot.track(this, MochiBotKey);
sender = new LocalConnection();
url = root.loaderInfo.url;
domain = sender.domain;
utm_content = "intro";
if (domain != "localhost"){
loader = new URLLoader(new URLRequest("http://api.jaludo.com/geoip/index.php?return=domain&type=gameshell&portal=gamesclub"));
loader.addEventListener(Event.COMPLETE, com);
} else {
NewLoading();
};
Url = "http://www.gamesclub.com/";
TypeS = 1;
Goto = "gamesclub";
HighscoreUrl = ((Url + "highscores/") + clean_game_name(GameName));
stop();
stop();
}
public function encrypt(_arg1:String=""):String{
var _local2:ByteArray = Hex.toArray(Hex.fromString(_arg1));
var _local3 = "simple-des-ecb";
var _local4:IPad = new PKCS5();
var _local5:ICipher = Crypto.getCipher(_local3, Hex.toArray(Hex.fromString(wouter)), _local4);
_local4.setBlockSize(_local5.getBlockSize());
_local5.encrypt(_local2);
return (Base64.encodeByteArray(_local2));
}
public function NewSod(_arg1){
Volume = (Volume - 0.02);
scf.volume = Volume;
soundTransform = scf;
if (Volume < 0){
stage.removeEventListener(Event.ENTER_FRAME, NewSod);
};
}
public function LoadGamePlay(){
stage.frameRate = ServerFps;
SoundMixer.stopAll();
MovieClip(root).gotoAndStop(5);
}
public function JaludoMochiStartplay(){
MochiEvents.startPlay("Normal");
}
}
}//package ZooDodgem_fla
Section 102
//playfreeonlinegames_24 (ZooDodgem_fla.playfreeonlinegames_24)
package ZooDodgem_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class playfreeonlinegames_24 extends MovieClip {
public function playfreeonlinegames_24(){
addFrameScript(0, frame1);
}
public function Change(_arg1){
var _local2:* = root;
gotoAndStop(_local2.Goto);
removeEventListener(Event.ENTER_FRAME, Change);
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, Change);
}
}
}//package ZooDodgem_fla
Section 103
//Timeline_115 (ZooDodgem_fla.Timeline_115)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_115 extends MovieClip {
public function Timeline_115(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 104
//Timeline_122 (ZooDodgem_fla.Timeline_122)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_122 extends MovieClip {
public function Timeline_122(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 105
//Timeline_124 (ZooDodgem_fla.Timeline_124)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_124 extends MovieClip {
public function Timeline_124(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 106
//Timeline_132 (ZooDodgem_fla.Timeline_132)
package ZooDodgem_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Timeline_132 extends MovieClip {
public var Msg:MovieClip;
public function Timeline_132(){
addFrameScript(0, frame1, 64, frame65, 67, frame68, 74, frame75, 83, frame84);
}
function frame1(){
}
function frame84(){
Msg.a.gotoAndStop(4);
}
function frame75(){
Msg.a.gotoAndStop(3);
}
function frame65(){
Msg.a.gotoAndStop(1);
}
function frame68(){
Msg.a.gotoAndStop(2);
}
}
}//package ZooDodgem_fla
Section 107
//Timeline_133 (ZooDodgem_fla.Timeline_133)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_133 extends MovieClip {
public var a:MovieClip;
public function Timeline_133(){
addFrameScript(93, frame94);
}
function frame94(){
stop();
}
}
}//package ZooDodgem_fla
Section 108
//Timeline_137 (ZooDodgem_fla.Timeline_137)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_137 extends MovieClip {
public function Timeline_137(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 109
//Timeline_139 (ZooDodgem_fla.Timeline_139)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_139 extends MovieClip {
public function Timeline_139(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 110
//Timeline_140 (ZooDodgem_fla.Timeline_140)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_140 extends MovieClip {
public function Timeline_140(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 111
//Timeline_141 (ZooDodgem_fla.Timeline_141)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_141 extends MovieClip {
public function Timeline_141(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 112
//Timeline_142 (ZooDodgem_fla.Timeline_142)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_142 extends MovieClip {
public function Timeline_142(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 113
//Timeline_152 (ZooDodgem_fla.Timeline_152)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_152 extends MovieClip {
public function Timeline_152(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 114
//Timeline_25 (ZooDodgem_fla.Timeline_25)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_25 extends MovieClip {
public function Timeline_25(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 115
//Timeline_66 (ZooDodgem_fla.Timeline_66)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_66 extends MovieClip {
public function Timeline_66(){
addFrameScript(45, frame46);
}
function frame46(){
stop();
}
}
}//package ZooDodgem_fla
Section 116
//Timeline_7 (ZooDodgem_fla.Timeline_7)
package ZooDodgem_fla {
import flash.display.*;
public dynamic class Timeline_7 extends MovieClip {
public function Timeline_7(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package ZooDodgem_fla
Section 117
//webSite_44 (ZooDodgem_fla.webSite_44)
package ZooDodgem_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class webSite_44 extends MovieClip {
public function webSite_44(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
if ((MovieClip(root).Goto as String)){
gotoAndStop(MovieClip(root).Goto);
};
}
}
}//package ZooDodgem_fla
Section 118
//webSiteGamesClub2as2_2 (ZooDodgem_fla.webSiteGamesClub2as2_2)
package ZooDodgem_fla {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class webSiteGamesClub2as2_2 extends MovieClip {
public function webSiteGamesClub2as2_2(){
addFrameScript(0, frame1);
}
public function Change(_arg1){
var _local2:* = root;
gotoAndStop(_local2.Goto);
removeEventListener(Event.ENTER_FRAME, Change);
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, Change);
}
}
}//package ZooDodgem_fla
Section 119
//AlphaMap1ID (AlphaMap1ID)
package {
import flash.display.*;
public dynamic class AlphaMap1ID extends MovieClip {
}
}//package
Section 120
//AngleID (AngleID)
package {
import flash.display.*;
public dynamic class AngleID extends MovieClip {
}
}//package
Section 121
//BackGroundID (BackGroundID)
package {
import flash.display.*;
public dynamic class BackGroundID extends MovieClip {
public var Car4:MovieClip;
public var Car5:MovieClip;
public var WoodPic:MovieClip;
public var Car2:MovieClip;
public var b1:MovieClip;
public var EnemyAI:MovieClip;
public var b3:MovieClip;
public var b4:MovieClip;
public var b2:MovieClip;
public var Car6:MovieClip;
public var Wall:MovieClip;
public var Water:MovieClip;
public var Car1:MovieClip;
public var Car3:MovieClip;
}
}//package
Section 122
//BlastID (BlastID)
package {
import flash.display.*;
public dynamic class BlastID extends MovieClip {
}
}//package
Section 123
//CarID (CarID)
package {
import flash.display.*;
public dynamic class CarID extends MovieClip {
public var Car:MovieClip;
public var NumPic:MovieClip;
}
}//package
Section 124
//GameEndID (GameEndID)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class GameEndID extends MovieClip {
public var MenuButton:MovieClip;
public var __id3_:MovieClip;
public function GameEndID(){
__setProp___id3__GameEndID_();
}
function __setProp___id3__GameEndID_(){
try {
__id3_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id3_.Type = "logo-donepage";
try {
__id3_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 125
//GO (GO)
package {
import flash.media.*;
public dynamic class GO extends Sound {
}
}//package
Section 126
//HelpID (HelpID)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class HelpID extends MovieClip {
public var MenuButton:MovieClip;
public var __id6_:MovieClip;
public var __setPropDict:Dictionary;
public var Recet:SimpleButton;
public function HelpID(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(0, frame1);
}
function frame1(){
if ((((__setPropDict[__id6_] == undefined)) || (!((int(__setPropDict[__id6_]) == 1))))){
__setPropDict[__id6_] = 1;
__setProp___id6__HelpID_();
};
stop();
}
function __setProp___id6__HelpID_(){
try {
__id6_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id6_.Type = "logo-ingame";
try {
__id6_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 127
//HomeID (HomeID)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class HomeID extends MovieClip {
public var MenuButton:MovieClip;
public var __id7_:MovieClip;
public var MusicPic:MusicIocID;
public var P2Role:MovieClip;
public function HomeID(){
addFrameScript(0, frame1);
__setProp___id7__HomeID_();
}
function frame1(){
MochiEvents.endPlay();
trace("endPlay geactiveerd!");
}
function __setProp___id7__HomeID_(){
try {
__id7_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id7_.Type = "logo-menu";
try {
__id7_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 128
//InfoPropID (InfoPropID)
package {
import flash.display.*;
public dynamic class InfoPropID extends MovieClip {
public var BackGround:MovieClip;
}
}//package
Section 129
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 130
//MusicIocID (MusicIocID)
package {
import flash.display.*;
public dynamic class MusicIocID extends MovieClip {
public var MusicOK:SimpleButton;
public var MusicNO:SimpleButton;
}
}//package
Section 131
//PauseID (PauseID)
package {
import flash.display.*;
public dynamic class PauseID extends MovieClip {
public var MoreGames:SimpleButton;
public var BackGround:MovieClip;
}
}//package
Section 132
//PleaseKeyID (PleaseKeyID)
package {
import flash.display.*;
public dynamic class PleaseKeyID extends MovieClip {
public var BackGround:MovieClip;
}
}//package
Section 133
//PropID (PropID)
package {
import flash.display.*;
public dynamic class PropID extends MovieClip {
}
}//package
Section 134
//QuitID (QuitID)
package {
import flash.display.*;
public dynamic class QuitID extends MovieClip {
public var MenuButton:MovieClip;
public var BackGround:MovieClip;
}
}//package
Section 135
//ScoreIcoID (ScoreIcoID)
package {
import flash.display.*;
public dynamic class ScoreIcoID extends MovieClip {
public var Ico:MovieClip;
}
}//package
Section 136
//SelectRoleID (SelectRoleID)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class SelectRoleID extends MovieClip {
public var SelectRole:MovieClip;
public var __id4_:MovieClip;
public var MenuButton:MovieClip;
public var HelpPic:MovieClip;
public function SelectRoleID(){
__setProp___id4__SelectRoleID_();
}
function __setProp___id4__SelectRoleID_(){
try {
__id4_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id4_.Type = "logo-ingame";
try {
__id4_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 137
//SetKeyID (SetKeyID)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class SetKeyID extends MovieClip {
public var __id5_:MovieClip;
public var Look:MovieClip;
public var JT:MovieClip;
public var PleaseKey:PleaseKeyID;
public var MenuButton:MovieClip;
public var SetKey:MovieClip;
public var Recet:SimpleButton;
public function SetKeyID(){
__setProp___id5__SetKeyID_();
}
function __setProp___id5__SetKeyID_(){
try {
__id5_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id5_.Type = "logo-ingame";
try {
__id5_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 138
//TimeEndID (TimeEndID)
package {
import flash.display.*;
public dynamic class TimeEndID extends MovieClip {
public var Gif:MovieClip;
}
}//package
Section 139
//TimeReadyID (TimeReadyID)
package {
import flash.display.*;
public dynamic class TimeReadyID extends MovieClip {
public var Gif:MovieClip;
public var BackGround:MovieClip;
}
}//package
Section 140
//UIID (UIID)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class UIID extends MovieClip {
public var __id0_:MovieClip;
public var MusicPic:MusicIocID;
public var Time:TextField;
public var a0:MovieClip;
public var a1:MovieClip;
public var a2:MovieClip;
public var a3:MovieClip;
public var a4:MovieClip;
public var a5:MovieClip;
public var Menu:MovieClip;
public function UIID(){
__setProp___id0__UIID_();
}
function __setProp___id0__UIID_(){
try {
__id0_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id0_.Type = "logo-ingame";
try {
__id0_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 141
//WaterID (WaterID)
package {
import flash.display.*;
public dynamic class WaterID extends MovieClip {
}
}//package
Section 142
//YouLoseID (YouLoseID)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class YouLoseID extends MovieClip {
public var MenuButton:MovieClip;
public var Total:MovieClip;
public var __id1_:MovieClip;
public function YouLoseID(){
__setProp___id1__YouLoseID_();
}
function __setProp___id1__YouLoseID_(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.Type = "logo-donepage";
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 143
//YouWinID (YouWinID)
package {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.net.*;
import flash.text.*;
import flash.system.*;
import flash.errors.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class YouWinID extends MovieClip {
public var MenuButton:MovieClip;
public var Total:MovieClip;
public var __id2_:MovieClip;
public function YouWinID(){
__setProp___id2__YouWinID_();
}
function __setProp___id2__YouWinID_(){
try {
__id2_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id2_.Type = "logo-donepage";
try {
__id2_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 144
//倒计时1秒 (倒计时1秒)
package {
import flash.media.*;
public dynamic class 倒计时1秒 extends Sound {
}
}//package
Section 145
//刹车 (刹车)
package {
import flash.media.*;
public dynamic class 刹车 extends Sound {
}
}//package
Section 146
//加油门 (åŠ æ²¹é—¨)
package {
import flash.media.*;
public dynamic class 加油门 extends Sound {
}
}//package
Section 147
//发射火箭 (å‘å°„ç«ç®)
package {
import flash.media.*;
public dynamic class 发射火箭 extends Sound {
}
}//package
Section 148
//地雷爆炸 (地雷爆炸)
package {
import flash.media.*;
public dynamic class 地雷爆炸 extends Sound {
}
}//package
Section 149
//开场音乐 (开场音ä¹)
package {
import flash.media.*;
public dynamic class 开场音乐 extends Sound {
}
}//package
Section 150
//得分的碰撞 (得分的碰撞)
package {
import flash.media.*;
public dynamic class 得分的碰撞 extends Sound {
}
}//package
Section 151
//打滑 (打滑)
package {
import flash.media.*;
public dynamic class 打滑 extends Sound {
}
}//package
Section 152
//扣分的碰撞 (扣分的碰撞)
package {
import flash.media.*;
public dynamic class 扣分的碰撞 extends Sound {
}
}//package
Section 153
//按钮副本 (按钮副本)
package {
import flash.media.*;
public dynamic class 按钮副本 extends Sound {
}
}//package
Section 154
//汽车发动机 (汽车å‘动机)
package {
import flash.media.*;
public dynamic class 汽车发动机 extends Sound {
}
}//package
Section 155
//游戏结束音乐 (游æˆç»“æŸéŸ³ä¹)
package {
import flash.media.*;
public dynamic class 游戏结束音乐 extends Sound {
}
}//package
Section 156
//背景音乐 (背景音ä¹)
package {
import flash.media.*;
public dynamic class 背景音乐 extends Sound {
}
}//package
Section 157
//落水 (è½æ°´)
package {
import flash.media.*;
public dynamic class 落水 extends Sound {
}
}//package
Section 158
//过关失败 (过关失败)
package {
import flash.media.*;
public dynamic class 过关失败 extends Sound {
}
}//package
Section 159
//选择角色按钮 (选择角色按钮)
package {
import flash.media.*;
public dynamic class 选择角色按钮 extends Sound {
}
}//package
Section 160
//选角色时的背景音乐 (选角色时的背景音ä¹)
package {
import flash.media.*;
public dynamic class 选角色时的背景音乐 extends Sound {
}
}//package