Frame 1
function Encode64(intxt) {
var _local3 = intxt;
var outtxt;
var inlen;
var inq;
var i;
var _local1;
var _local2 = new Array();
var rest;
var reststr;
var enctab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
inlen = _local3.length;
inq = int(inlen / 3);
outtxt = "";
i = 0;
while (i < inq) {
_local1 = 0;
while (_local1 <= 2) {
if (typeof(_local3) == "string") {
_local2[_local1] = _local3.charCodeAt((i * 3) + _local1);
} else {
_local2[_local1] = _local3[(i * 3) + _local1];
}
_local1++;
}
outtxt = outtxt + Encq(_local2, enctab);
i++;
}
rest = inlen % 3;
if (rest == 1) {
if (typeof(_local3) == "string") {
_local2[0] = _local3.charCodeAt(inlen - 1);
_local2[1] = 0;
_local2[2] = 0;
} else {
_local2[0] = _local3[inlen - 1];
_local2[1] = 0;
_local2[2] = 0;
}
reststr = Encq(_local2, enctab);
outtxt = (outtxt + reststr.slice(0, 2)) + "==";
}
if (rest == 2) {
if (typeof(_local3) == "string") {
_local2[0] = _local3.charCodeAt(inlen - 2);
_local2[1] = _local3.charCodeAt(inlen - 1);
_local2[2] = 0;
} else {
_local2[0] = _local3[inlen - 2];
_local2[1] = _local3[inlen - 1];
_local2[2] = 0;
}
reststr = Encq(_local2, enctab);
outtxt = (outtxt + reststr.slice(0, 3)) + "=";
}
return(outtxt);
}
function Decode64(intxt) {
var outtxt;
var _local3 = new Array();
var dtab = new Array();
var _local2;
var l;
var i;
var c;
var _local1 = new Array();
var retarr;
outtxt = "";
_local2 = 0;
l = 0;
while (l <= 255) {
dtab[l] = -1;
l++;
}
dtab.splice(43, 1, 62);
dtab.splice(47, 11, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61);
dtab.splice(61, 1, 64);
dtab.splice(65, 26, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25);
dtab.splice(97, 26, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51);
i = 0;
while (i < intxt.length) {
c = dtab[intxt.charCodeAt(i)];
if (c >= 0) {
_local3[_local2] = c;
_local2++;
if (_local2 == 4) {
retarr = Decq(_local3);
_local1.push(retarr[0]);
_local1.push(retarr[1]);
_local1.push(retarr[2]);
if (_local3[3] == 64) {
_local1.pop();
}
if (_local3[2] == 64) {
_local1.pop();
}
_local2 = 0;
}
}
i++;
}
return(_local1);
}
function Encq(btab, etab) {
var _local3 = btab;
var _local1;
var _local2;
_local1 = "";
_local2 = (_local3[0] >> 2) & 63;
_local1 = _local1 + etab.charAt(_local2);
_local2 = ((_local3[0] & 3) << 4) | ((_local3[1] >> 4) & 15);
_local1 = _local1 + etab.charAt(_local2);
_local2 = ((_local3[1] & 15) << 2) | ((_local3[2] >> 6) & 3);
_local1 = _local1 + etab.charAt(_local2);
_local2 = _local3[2] & 63;
_local1 = _local1 + etab.charAt(_local2);
return(_local1);
}
function Decq(btab) {
var _local2 = btab;
var _local3 = new Array();
var _local1;
outq = "";
_local1 = (_local2[0] << 2) | ((_local2[1] >> 4) & 3);
_local3[0] = _local1;
_local1 = ((_local2[1] & 15) << 4) | ((_local2[2] >> 2) & 15);
_local3[1] = _local1;
_local1 = ((_local2[2] & 3) << 6) | _local2[3];
_local3[2] = _local1;
return(_local3);
}
function BlowFish_init(key) {
var _local2 = _root;
var keyarr = new Array();
var cnt;
var keylen;
keylen = key.length;
cnt = 0;
while (cnt < keylen) {
keyarr[cnt] = key.charCodeAt(cnt);
cnt++;
}
var _local1;
var _local3;
var k;
var vntA;
_local2.blowfish = new Object();
_local2.blowfish.blf_P = new Array();
_local2.blowfish.blf_S = new Array();
_local2.blowfish.blf_S[0] = new Array();
_local2.blowfish.blf_S[1] = new Array();
_local2.blowfish.blf_S[2] = new Array();
_local2.blowfish.blf_S[3] = new Array();
vntA = new Array(608135816, 2242054355, 320440878, 57701188, 2752067618, 698298832, 137296536, 3964562569, 1160258022, 953160567, 3193202383, 887688300, 3232508343, 3380367581, 1065670069, 3041331479, 2450970073, 2306472731);
_local1 = 0;
while (_local1 <= 17) {
_local2.blowfish.blf_P[_local1] = vntA[_local1];
_local1++;
}
vntA = new 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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[0][_local1] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[0][_local1 + 64] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[0][_local1 + 128] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[0][_local1 + 192] = vntA[_local1];
_local1++;
}
vntA = new 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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[1][_local1] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[1][_local1 + 64] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[1][_local1 + 128] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[1][_local1 + 192] = vntA[_local1];
_local1++;
}
vntA = new 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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[2][_local1] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[2][_local1 + 64] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[2][_local1 + 128] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[2][_local1 + 192] = vntA[_local1];
_local1++;
}
vntA = new 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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[3][_local1] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[3][_local1 + 64] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[3][_local1 + 128] = vntA[_local1];
_local1++;
}
vntA = new Array(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);
_local1 = 0;
while (_local1 <= 63) {
_local2.blowfish.blf_S[3][_local1 + 192] = vntA[_local1];
_local1++;
}
var temp;
var templ;
var tempr;
var ret;
_local3 = 0;
_local1 = 0;
while (_local1 <= 17) {
temp = 0;
k = 0;
while (k <= 3) {
temp = (temp << 8) | keyarr[_local3];
_local3 = _local3 + 1;
if (_local3 >= keylen) {
_local3 = 0;
}
k++;
}
_local2.blowfish.blf_P[_local1] = _local2.blowfish.blf_P[_local1] ^ temp;
_local1++;
}
templ = 0;
tempr = 0;
_local1 = 0;
while (_local1 <= 17) {
ret = DoBlowEnc(templ, tempr);
_local2.blowfish.blf_P[_local1] = ret[0];
_local2.blowfish.blf_P[_local1 + 1] = ret[1];
templ = ret[0];
tempr = ret[1];
_local1 = _local1 + 2;
}
_local1 = 0;
while (_local1 <= 3) {
_local3 = 0;
while (_local3 <= 255) {
ret = DoBlowEnc(templ, tempr);
_local2.blowfish.blf_S[_local1][_local3] = ret[0];
_local2.blowfish.blf_S[_local1][_local3 + 1] = ret[1];
templ = ret[0];
tempr = ret[1];
_local3 = _local3 + 2;
}
_local1++;
}
}
function BlowFish_enc64str(intxt) {
var outarr;
var inlen;
var nrblocks;
var _local1;
var _local2;
var dat = new Array();
var _local3 = new Array();
var wordL;
var wordR;
var w1;
var w2;
var w3;
var w4;
var padstr;
var padnum;
inlen = intxt.length;
padnum = ((int(inlen / 8) + 1) * 8) - inlen;
padstr = "";
_local1 = 0;
while (_local1 <= padnum) {
padstr = padstr + chr(padnum);
_local1++;
}
intxt = intxt + padstr;
inlen = intxt.length;
nrblocks = int(inlen / 8);
_local1 = 0;
while (_local1 < nrblocks) {
_local2 = 0;
while (_local2 <= 3) {
dat[_local2] = intxt.charCodeAt((_local1 * 8) + _local2);
_local2++;
}
wordL = (((dat[0] << 24) | (dat[1] << 16)) | (dat[2] << 8)) | dat[3];
_local2 = 0;
while (_local2 <= 3) {
dat[_local2] = intxt.charCodeAt(((_local1 * 8) + _local2) + 4);
_local2++;
}
wordR = (((dat[0] << 24) | (dat[1] << 16)) | (dat[2] << 8)) | dat[3];
_local3[_local1 * 2] = wordL;
_local3[(_local1 * 2) + 1] = wordR;
_local1++;
}
_local1 = 0;
while (_local1 < (nrblocks * 2)) {
ret = DoBlowEnc(_local3[_local1], _local3[_local1 + 1]);
_local3[_local1] = ret[0];
_local3[_local1 + 1] = ret[1];
_local1 = _local1 + 2;
}
outarr = new Array();
_local1 = 0;
while (_local1 < nrblocks) {
w1 = (_local3[_local1 * 2] & 4278190080) >>> 24;
w2 = (_local3[_local1 * 2] & 16711680) >>> 16;
w3 = (_local3[_local1 * 2] & 65280) >>> 8;
w4 = _local3[_local1 * 2] & 255;
outarr.push(w1, w2, w3, w4);
w1 = (_local3[(_local1 * 2) + 1] & 4278190080) >>> 24;
w2 = (_local3[(_local1 * 2) + 1] & 16711680) >>> 16;
w3 = (_local3[(_local1 * 2) + 1] & 65280) >>> 8;
w4 = _local3[(_local1 * 2) + 1] & 255;
outarr.push(w1, w2, w3, w4);
_local1++;
}
return(Encode64(outarr));
}
function BlowFish_dec64str(intxt) {
var outtxt;
var inlen;
var nrblocks;
var _local1;
var _local2;
var dat = new Array();
var _local3 = new Array();
var wordL;
var wordR;
var w1;
var w2;
var w3;
var w4;
var padchar;
var inarr;
inarr = Decode64(intxt);
inlen = inarr.length;
nrblocks = int(inlen / 8);
_local1 = 0;
while (_local1 < nrblocks) {
_local2 = 0;
while (_local2 <= 3) {
dat[_local2] = inarr[(_local1 * 8) + _local2];
_local2++;
}
wordL = (((dat[0] << 24) | (dat[1] << 16)) | (dat[2] << 8)) | dat[3];
_local2 = 0;
while (_local2 <= 3) {
dat[_local2] = inarr[((_local1 * 8) + _local2) + 4];
_local2++;
}
wordR = (((dat[0] << 24) | (dat[1] << 16)) | (dat[2] << 8)) | dat[3];
_local3[_local1 * 2] = wordL;
_local3[(_local1 * 2) + 1] = wordR;
_local1++;
}
_local1 = 0;
while (_local1 < (nrblocks * 2)) {
ret = DoBlowDec(_local3[_local1], _local3[_local1 + 1]);
_local3[_local1] = ret[0];
_local3[_local1 + 1] = ret[1];
_local1 = _local1 + 2;
}
outtxt = "";
_local1 = 0;
while (_local1 < nrblocks) {
w1 = (_local3[_local1 * 2] & 4278190080) >>> 24;
w2 = (_local3[_local1 * 2] & 16711680) >>> 16;
w3 = (_local3[_local1 * 2] & 65280) >>> 8;
w4 = _local3[_local1 * 2] & 255;
outtxt = outtxt + String.fromCharCode(w1, w2, w3, w4);
w1 = (_local3[(_local1 * 2) + 1] & 4278190080) >>> 24;
w2 = (_local3[(_local1 * 2) + 1] & 16711680) >>> 16;
w3 = (_local3[(_local1 * 2) + 1] & 65280) >>> 8;
w4 = _local3[(_local1 * 2) + 1] & 255;
outtxt = outtxt + String.fromCharCode(w1, w2, w3, w4);
_local1++;
}
padchar = outtxt.slice(-1).charCodeAt(0);
if (padchar > 8) {
padchar = 0;
}
outtxt = outtxt.substring(0, outtxt.length - padchar);
return(outtxt);
}
function DoBlowEnc(dat1, dat2) {
var _local1 = dat1;
var _local3 = dat2;
var _local2;
var temp;
var fret = new Array();
_local2 = 0;
while (_local2 <= 15) {
_local1 = _local1 ^ _root.blowfish.blf_P[_local2];
_local3 = _local3 ^ blf_F(_local1);
temp = _local1;
_local1 = _local3;
_local3 = temp;
_local2++;
}
temp = _local1;
_local1 = _local3;
_local3 = temp;
_local3 = _local3 ^ _root.blowfish.blf_P[16];
_local1 = _local1 ^ _root.blowfish.blf_P[17];
fret[0] = _local1;
fret[1] = _local3;
return(fret);
}
function DoBlowDec(dat1, dat2) {
var _local2 = dat1;
var _local3 = dat2;
var fret = new Array();
var _local1;
var temp;
_local1 = 17;
while (_local1 >= 2) {
_local2 = _local2 ^ _root.blowfish.blf_P[_local1];
_local3 = _local3 ^ blf_F(_local2);
temp = _local2;
_local2 = _local3;
_local3 = temp;
_local1 = _local1 - 1;
}
temp = _local2;
_local2 = _local3;
_local3 = temp;
_local3 = _local3 ^ _root.blowfish.blf_P[1];
_local2 = _local2 ^ _root.blowfish.blf_P[0];
fret[0] = _local2;
fret[1] = _local3;
return(fret);
}
function blf_F(x) {
var _local2 = _root;
var _local3 = x;
var w1;
var w2;
var w3;
var w4;
var _local1;
w1 = (_local3 & 4278190080) >>> 24;
w2 = (_local3 & 16711680) >>> 16;
w3 = (_local3 & 65280) >>> 8;
w4 = _local3 & 255;
_local1 = _local2.blowfish.blf_S[0][w1] + _local2.blowfish.blf_S[1][w2];
_local1 = _local1 ^ _local2.blowfish.blf_S[2][w3];
_local1 = _local1 + _local2.blowfish.blf_S[3][w4];
return(_local1);
}
function makeQuerystring(obj) {
var _local1 = obj;
var querystring:String = "";
querystring = _local1.action;
querystring = querystring + _local1.userid;
querystring = querystring + _local1.sid;
querystring = querystring + _local1.gameid;
querystring = querystring + _local1.rn;
querystring = querystring + "wD9c84X0vA";
return(querystring);
}
function getTracker(trackWhat) {
var _local2 = _global;
var _local1 = new LoadVars();
_local1.gameid = _local2.gameid;
_local1.action = trackWhat;
_local1.sid = _local2.sid;
_local1.userid = _local2.userid;
_local1.rn = _local2.rn;
return(_local1);
}
_global.MD5 = new Object();
MD5.hexcase = 0;
MD5.b64pad = "";
MD5.chrsz = 8;
MD5.hex_md5 = function (s) {
var _local1 = this;
return(_local1.binl2hex(_local1.core_md5(_local1.str2binl(s), s.length * _local1.chrsz)));
};
MD5.b64_md5 = function (s) {
var _local1 = this;
return(_local1.binl2b64(_local1.core_md5(_local1.str2binl(s), s.length * _local1.chrsz)));
};
MD5.str_md5 = function (s) {
var _local1 = this;
return(_local1.binl2str(_local1.core_md5(_local1.str2binl(s), s.length * _local1.chrsz)));
};
MD5.hex_hmac_md5 = function (key, data) {
return(this.binl2hex(this.core_hmac_md5(key, data)));
};
MD5.b64_hmac_md5 = function (key, data) {
return(this.binl2b64(this.core_hmac_md5(key, data)));
};
MD5.str_hmac_md5 = function (key, data) {
return(this.binl2str(this.core_hmac_md5(key, data)));
};
MD5.md5_vm_test = function () {
return(this.hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72");
};
MD5.core_md5 = function (x, len) {
var olda;
var oldb;
var oldc;
var oldd;
x[len >> 5] = x[len >> 5] | (128 << (len & 31));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var a = 1732584193;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var max = x.length;
var i = 0;
while (i < max) {
olda = a;
oldb = _local3;
oldc = _local2;
oldd = _local1;
a = this.md5_ff(a, _local3, _local2, _local1, x[i + 0], 7, -680876936);
_local1 = this.md5_ff(_local1, a, _local3, _local2, x[i + 1], 12, -389564586);
_local2 = this.md5_ff(_local2, _local1, a, _local3, x[i + 2], 17, 606105819);
_local3 = this.md5_ff(_local3, _local2, _local1, a, x[i + 3], 22, -1044525330);
a = this.md5_ff(a, _local3, _local2, _local1, x[i + 4], 7, -176418897);
_local1 = this.md5_ff(_local1, a, _local3, _local2, x[i + 5], 12, 1200080426);
_local2 = this.md5_ff(_local2, _local1, a, _local3, x[i + 6], 17, -1473231341);
_local3 = this.md5_ff(_local3, _local2, _local1, a, x[i + 7], 22, -45705983);
a = this.md5_ff(a, _local3, _local2, _local1, x[i + 8], 7, 1770035416);
_local1 = this.md5_ff(_local1, a, _local3, _local2, x[i + 9], 12, -1958414417);
_local2 = this.md5_ff(_local2, _local1, a, _local3, x[i + 10], 17, -42063);
_local3 = this.md5_ff(_local3, _local2, _local1, a, x[i + 11], 22, -1990404162);
a = this.md5_ff(a, _local3, _local2, _local1, x[i + 12], 7, 1804603682);
_local1 = this.md5_ff(_local1, a, _local3, _local2, x[i + 13], 12, -40341101);
_local2 = this.md5_ff(_local2, _local1, a, _local3, x[i + 14], 17, -1502002290);
_local3 = this.md5_ff(_local3, _local2, _local1, a, x[i + 15], 22, 1236535329);
a = this.md5_gg(a, _local3, _local2, _local1, x[i + 1], 5, -165796510);
_local1 = this.md5_gg(_local1, a, _local3, _local2, x[i + 6], 9, -1069501632);
_local2 = this.md5_gg(_local2, _local1, a, _local3, x[i + 11], 14, 643717713);
_local3 = this.md5_gg(_local3, _local2, _local1, a, x[i + 0], 20, -373897302);
a = this.md5_gg(a, _local3, _local2, _local1, x[i + 5], 5, -701558691);
_local1 = this.md5_gg(_local1, a, _local3, _local2, x[i + 10], 9, 38016083);
_local2 = this.md5_gg(_local2, _local1, a, _local3, x[i + 15], 14, -660478335);
_local3 = this.md5_gg(_local3, _local2, _local1, a, x[i + 4], 20, -405537848);
a = this.md5_gg(a, _local3, _local2, _local1, x[i + 9], 5, 568446438);
_local1 = this.md5_gg(_local1, a, _local3, _local2, x[i + 14], 9, -1019803690);
_local2 = this.md5_gg(_local2, _local1, a, _local3, x[i + 3], 14, -187363961);
_local3 = this.md5_gg(_local3, _local2, _local1, a, x[i + 8], 20, 1163531501);
a = this.md5_gg(a, _local3, _local2, _local1, x[i + 13], 5, -1444681467);
_local1 = this.md5_gg(_local1, a, _local3, _local2, x[i + 2], 9, -51403784);
_local2 = this.md5_gg(_local2, _local1, a, _local3, x[i + 7], 14, 1735328473);
_local3 = this.md5_gg(_local3, _local2, _local1, a, x[i + 12], 20, -1926607734);
a = this.md5_hh(a, _local3, _local2, _local1, x[i + 5], 4, -378558);
_local1 = this.md5_hh(_local1, a, _local3, _local2, x[i + 8], 11, -2022574463);
_local2 = this.md5_hh(_local2, _local1, a, _local3, x[i + 11], 16, 1839030562);
_local3 = this.md5_hh(_local3, _local2, _local1, a, x[i + 14], 23, -35309556);
a = this.md5_hh(a, _local3, _local2, _local1, x[i + 1], 4, -1530992060);
_local1 = this.md5_hh(_local1, a, _local3, _local2, x[i + 4], 11, 1272893353);
_local2 = this.md5_hh(_local2, _local1, a, _local3, x[i + 7], 16, -155497632);
_local3 = this.md5_hh(_local3, _local2, _local1, a, x[i + 10], 23, -1094730640);
a = this.md5_hh(a, _local3, _local2, _local1, x[i + 13], 4, 681279174);
_local1 = this.md5_hh(_local1, a, _local3, _local2, x[i + 0], 11, -358537222);
_local2 = this.md5_hh(_local2, _local1, a, _local3, x[i + 3], 16, -722521979);
_local3 = this.md5_hh(_local3, _local2, _local1, a, x[i + 6], 23, 76029189);
a = this.md5_hh(a, _local3, _local2, _local1, x[i + 9], 4, -640364487);
_local1 = this.md5_hh(_local1, a, _local3, _local2, x[i + 12], 11, -421815835);
_local2 = this.md5_hh(_local2, _local1, a, _local3, x[i + 15], 16, 530742520);
_local3 = this.md5_hh(_local3, _local2, _local1, a, x[i + 2], 23, -995338651);
a = this.md5_ii(a, _local3, _local2, _local1, x[i + 0], 6, -198630844);
_local1 = this.md5_ii(_local1, a, _local3, _local2, x[i + 7], 10, 1126891415);
_local2 = this.md5_ii(_local2, _local1, a, _local3, x[i + 14], 15, -1416354905);
_local3 = this.md5_ii(_local3, _local2, _local1, a, x[i + 5], 21, -57434055);
a = this.md5_ii(a, _local3, _local2, _local1, x[i + 12], 6, 1700485571);
_local1 = this.md5_ii(_local1, a, _local3, _local2, x[i + 3], 10, -1894986606);
_local2 = this.md5_ii(_local2, _local1, a, _local3, x[i + 10], 15, -1051523);
_local3 = this.md5_ii(_local3, _local2, _local1, a, x[i + 1], 21, -2054922799);
a = this.md5_ii(a, _local3, _local2, _local1, x[i + 8], 6, 1873313359);
_local1 = this.md5_ii(_local1, a, _local3, _local2, x[i + 15], 10, -30611744);
_local2 = this.md5_ii(_local2, _local1, a, _local3, x[i + 6], 15, -1560198380);
_local3 = this.md5_ii(_local3, _local2, _local1, a, x[i + 13], 21, 1309151649);
a = this.md5_ii(a, _local3, _local2, _local1, x[i + 4], 6, -145523070);
_local1 = this.md5_ii(_local1, a, _local3, _local2, x[i + 11], 10, -1120210379);
_local2 = this.md5_ii(_local2, _local1, a, _local3, x[i + 2], 15, 718787259);
_local3 = this.md5_ii(_local3, _local2, _local1, a, x[i + 9], 21, -343485551);
a = this.safe_add(a, olda);
_local3 = this.safe_add(_local3, oldb);
_local2 = this.safe_add(_local2, oldc);
_local1 = this.safe_add(_local1, oldd);
i = i + 16;
}
var result = Array(a, _local3, _local2, _local1);
return(result);
};
MD5.md5_cmn = function (q, a, b, x, s, t) {
var _local1 = this;
var _local2 = _local1.safe_add(_local1.bit_rol(_local1.safe_add(_local1.safe_add(a, q), _local1.safe_add(x, t)), s), b);
return(_local2);
};
MD5.md5_ff = function (a, b, c, d, x, s, t) {
var _local1 = b;
return(this.md5_cmn((_local1 & c) | ((~_local1) & d), a, _local1, x, s, t));
};
MD5.test = function () {
};
MD5.md5_gg = function (a, b, c, d, x, s, t) {
return(this.md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
};
MD5.md5_hh = function (a, b, c, d, x, s, t) {
return(this.md5_cmn((b ^ c) ^ d, a, b, x, s, t));
};
MD5.md5_ii = function (a, b, c, d, x, s, t) {
return(this.md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
};
MD5.core_hmac_md5 = function (key, data) {
var _local2 = this.str2binl(key);
if (_local2.length > 16) {
_local2 = this.core_md5(_local2, key.length * this.chrsz);
}
var _local3 = Array(16);
var opad = Array(16);
var _local1 = 0;
while (_local1 < 16) {
_local3[_local1] = _local2[_local1] ^ 909522486;
opad[_local1] = _local2[_local1] ^ 1549556828;
_local1++;
}
var hash = this.core_md5(_local3.concat(this.str2binl(data)), 512 + (data.length * this.chrsz));
return(this.core_md5(opad.concat(hash), 640));
};
MD5.safe_add = function (x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
};
MD5.bit_rol = function (num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
};
MD5.str2binl = function (str) {
var _local2 = this;
var _local3 = Array();
var mask = ((1 << _local2.chrsz) - 1);
var max = (str.length * _local2.chrsz);
var _local1 = 0;
while (_local1 < max) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / _local2.chrsz) & mask) << (_local1 & 31));
_local1 = _local1 + _local2.chrsz;
}
return(_local3);
};
MD5.binl2str = function (bin) {
var _local2 = "";
var _local3 = (1 << this.chrsz) - 1;
var max = (bin.length * 32);
var _local1 = 0;
while (_local1 < max) {
_local2 = _local2 + String.fromCharCode((bin[_local1 >> 5] >>> (_local1 & 31)) & _local3);
_local1 = _local1 + this.chrsz;
}
return(_local2);
};
MD5.binl2hex = function (binarray) {
var _local3 = binarray;
var _local2 = (this.hexcase ? "0123456789ABCDEF" : "0123456789abcdef");
var str = "";
var max = (_local3.length * 4);
var _local1 = 0;
while (_local1 < max) {
str = str + (_local2.charAt((_local3[_local1 >> 2] >> (((_local1 & 3) * 8) + 4)) & 15) + _local2.charAt((_local3[_local1 >> 2] >> ((_local1 & 3) * 8)) & 15));
_local1++;
}
return(str);
};
MD5.binl2b64 = function (binarray) {
var _local3 = binarray;
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var str = "";
var max = (_local3.length * 4);
var m4x = (4 * max);
var _local1 = 0;
while (_local1 < max) {
var triplet = (((((_local3[_local1 >> 2] >> (8 * (_local1 & 3))) & 255) << 16) | (((_local3[(_local1 + 1) >> 2] >> (8 * ((_local1 + 1) & 3))) & 255) << 8)) | ((_local3[(_local1 + 2) >> 2] >> (8 * ((_local1 + 2) & 3))) & 255));
_local1 = _local1 + 3;
}
var _local2 = 0;
while (_local2 < 4) {
if (((_local1 * 8) + (_local2 * 6)) > m4x) {
str = str + this.b64pad;
} else {
str = str + tab.charAt((triplet >> (6 * (3 - _local2))) & 63);
}
_local2++;
}
return(str);
};
NetDebug.initialize();
startTime = getTimer();
_global.trackingURL = unescape(url);
NetDebug.trace("_global.trackingURL :: " + _global.trackingURL);
_global.scoreURL = unescape(sw4);
_global.gameid = sw6;
_global.userid = uuid;
_global.sid = session_id;
_global.rn = Math.random(1E21);
_global.scoreURL = unescape(_global.scoreURL);
_global.trackingVars = _global.trackingURL.split("?");
_global.trackingURL = _global.trackingVars[0];
_global.objTrackingVars = new Object();
if (uuid != undefined) {
_global.objTrackingVars.uuid = uuid;
}
var trackingArr = _global.trackingVars[1].split("&");
for (var prop in trackingArr) {
var myVars = trackingArr[prop].split("=");
if (myVars[1] != "") {
_global.objTrackingVars[myVars[0]] = myVars[1];
}
}
NetDebug.trace("tracking -- ");
for (var prop in _global.objTrackingVars) {
NetDebug.trace((("tracking : " + prop) + "=") + _global.objTrackingVars[prop]);
}
NetDebug.trace("tracking -- ");
_global.scoreVars = _global.scoreURL.split("?");
_global.scoreURL = _global.scoreVars[0];
_global.objScoreVars = new Object();
if (challengeUuid != undefined) {
_global.objScoreVars.challengeUuid = challengeUuid;
}
_global.scoreArr = _global.scoreVars[1].split("&");
NetDebug.trace(_global.scoreArr);
for (var prop in _global.scoreArr) {
var myVars = _global.scoreArr[prop].split("=");
if (myVars[1] != "") {
_global.objScoreVars[myVars[0]] = myVars[1];
}
}
NetDebug.trace("score vars");
for (var prop in _global.objScoreVars) {
NetDebug.trace((prop + "=") + _global.objScoreVars[prop]);
}
NetDebug.trace("score vars");
trackerOnLoad = function (success) {
var _local1 = _global;
for (var _local2 in _local1.tracker) {
trace((_local2 + "=") + _local1.tracker(_local2));
}
if (success) {
trace("success");
NetDebug.trace("success");
} else {
NetDebug.trace("error on script");
}
infomessage = "Return from tracking";
};
trackingGameLoaded = function () {
var _local1 = _global;
endTime = getTimer();
downloadTime = Math.round((endTime - startTime) / 1000);
_local1.tracker = new LoadVars();
_local1.tracker = getTracker("load");
_local1.tracker.d1 = _downloadTime;
var _local3 = MD5.hex_md5(makeQuerystring(_local1.tracker));
_local1.tracker.cr = _local3;
for (var _local2 in _local1.objTrackingVars) {
_local1.tracker[_local2] = _local1.objTrackingVars[_local2];
}
for (var _local2 in _local1.tracker) {
}
_local1.tracker.sendAndLoad(_local1.trackingURL, _local1.tracker, "GET");
_local1.tracker.onLoad = trackerOnLoad;
};
trackingGameStart = function () {
var _local1 = _global;
NetDebug.trace("trackingGameStart");
_local1.startGameTime = getTimer();
_local1.tracker = new LoadVars();
_local1.tracker = getTracker("play");
var _local3 = MD5.hex_md5(makeQuerystring(_local1.tracker));
_local1.tracker.cr = _local3;
for (var _local2 in _local1.objTrackingVars) {
_local1.tracker[_local2] = _local1.objTrackingVars[_local2];
}
_local1.tracker.sendAndLoad(_local1.trackingURL, _local1.tracker, "GET");
_local1.tracker.onLoad = trackerOnLoad;
};
trackingGameOver = function () {
var _local1 = _global;
_local1.endGameTime = getTimer();
_local1.tracker = new LoadVars();
_local1.tracker = getTracker("over");
var _local3 = MD5.hex_md5(makeQuerystring(_local1.tracker));
_local1.tracker.cr = _local3;
for (var _local2 in _local1.objTrackingVars) {
_local1.tracker[_local2] = _local1.objTrackingVars[_local2];
}
_local1.tracker.sendAndLoad(_local1.trackingURL, _local1.tracker, "GET");
_local1.tracker.onLoad = trackerOnLoad;
};
trackingGameQuit = function () {
var _local1 = _global;
_local1.totalSecondsPlayed = Math.round((_local1.endGameTime - _local1.startGameTime) / 1000);
_local1.endGameTime = getTimer();
_local1.tracker = new LoadVars();
_local1.tracker = getTracker("quit");
_local1.tracker.d1 = _local1._global.totalSecondsPlayed;
var _local3 = MD5.hex_md5(makeQuerystring(_local1.tracker));
_local1.tracker.cr = _local3;
for (var _local2 in _local1.objTrackingVars) {
_local1.tracker[_local2] = _local1.objTrackingVars[_local2];
}
_local1.tracker.sendAndLoad(_local1.trackingURL, _local1.tracker, "GET");
_local1.tracker.onLoad = trackerOnLoad;
};
submitScore = function (s) {
var _local2 = _global;
NetDebug.trace("submitScore");
sendCommand("trackingGameQuit");
var strPT:String;
var my_date:Date = new Date();
var myHour:String = ((my_date.getHours() < 10) ? ("0" + my_date.getHours().toString()) : (my_date.getHours().toString()));
var myMinutes:String = ((my_date.getMinutes() < 10) ? ("0" + my_date.getMinutes().toString()) : (my_date.getMinutes().toString()));
var mySeconds:String = ((my_date.getSeconds() < 10) ? ("0" + my_date.getSeconds().toString()) : (my_date.getSeconds().toString()));
var myTime:String = ((myHour + myMinutes) + mySeconds);
trace(myTime);
strPT = ("gamename=" + _local2.gameName) + "&";
strPT = strPT + (("score=" + s) + "&");
strPT = strPT + (("pn=" + sw3) + "&");
strPT = strPT + (("sf=" + (cheated ? "0" : "1")) + "&");
strPT = strPT + "np=1&";
totalGames = (isNaN(totalGames) ? 0 : (totalGames));
strPT = strPT + (("ng=" + totalGames) + "&");
strPT = strPT + "nr=0&";
secondsPlayed = (isNaN(secondsPlayed) ? 1 : (secondsPlayed));
strPT = strPT + (("tp=" + secondsPlayed) + "&");
strPT = strPT + "ms=11243&";
strPT = strPT + "mr=0&";
strPT = strPT + "bd=0&";
strPT = strPT + "pi=6&";
downloadTime = (isNaN(downloadTime) ? 0 : (downloadTime));
strPT = strPT + (("ds=" + downloadTime.toString()) + "&");
strPT = strPT + "dt=&";
strPT = strPT + (((("ss=" + System.capabilities.screenResolutionX) + "by") + System.capabilities.screenResolutionY) + "&");
strPT = strPT + "sp=none&";
strPT = strPT + "sn=&";
strPT = strPT + (("tt=" + myTime) + "&");
gameVersion = (isNaN(gameVersion) ? 1 : (gameVersion));
strPT = strPT + (("vr=" + gameVersion) + "&");
strPT = strPT + ("gid=" + _local2.gameid);
cr = MD5.hex_md5(strPT + _local2.keyString);
strPT = strPT + ("&cr=" + cr);
strBlow = BlowFish_enc64str(strPT);
p = strBlow;
if (_local2.scoreURL.length > 0) {
var _local3 = [];
for (var prop in _local2.objScoreVars) {
_local3.push((prop + "=") + _local2.objScoreVars[prop]);
}
var _local1 = 0;
while (_local1 < _local3.length) {
p = p + "&";
p = p + _local3[_local1];
_local1++;
}
}
var _local1 = 0;
while (_local1 < _local2.scoreArr.length) {
p = p + "&";
p = p + _local2.scoreArr[_local1];
_local1++;
}
flashScoreUrl = (_local2.scoreURL + "?param=") + p;
getURL (flashScoreUrl);
NetDebug.trace("STR WILL BE: " + flashScoreUrl);
isQuitting = 1;
_root.isQuitting = 1;
};
_global.sendCommand = function (what) {
var _local1 = what;
NetDebug.trace("sendCommand: " + _local1);
switch (_local1) {
case "trackingGameLoaded" :
trackingGameLoaded();
break;
case "trackingGameStart" :
trackingGameStart();
break;
case "trackingGameOver" :
trackingGameOver();
break;
case "trackingGameQuit" :
trackingGameQuit();
}
var sending_lc:LocalConnection = new LocalConnection();
sending_lc.send("lc_name", "methodToExecute", _local1);
};
_global.keyString = "Pnj4Jw9qMo";
_global.gameName = "Horse";
BlowFish_init(_global.keyString);
skipStinger = true;
switch (SWLIST) {
case "" :
trace("no entry, use default");
stingerURL = "http://candystand.com/games/stinger.swf";
break;
case undefined :
trace("no entry, use default");
stingerURL = "http://candystand.com/games/stinger.swf";
break;
case "none" :
trace("no stinger, use nothing");
skipStinger = true;
break;
default :
stingerURL = SWLIST;
trace("use this url: " + stingerURL);
}
if (!skipStinger) {
this.createEmptyMovieClip("stinger_mc", this.getNextHighestDepth());
stinger_mc.loadMovie(stingerURL);
}
gotoAndStop (2);
loader._visible = false;
_quality = "BEST";
myColor = new Color(this);
myTransform = new Object();
fade = function (destination) {
fader.destination = destination;
fader.gotoAndPlay(2);
};
chatText = ["OFF THE GROUND", "OFF THE WALL", "OFF THE BACKBOARD", "MOONSHOT", "SWISH", "EYES CLOSED", "CLEAR ALL"];
buildDropDown = function () {
var _local3 = this;
chatter._visible = true;
chatter.bg._y = ((-chatText.length) * 16) - 56;
chatter.bg._visible = false;
var _local1 = 0;
while (_local1 < chatText.length) {
_local3.attachMovie("chatButton_mc", "DropDown" + _local1, _local1 + 1000);
var _local2 = _local3["DropDown" + _local1];
_local2._x = chatter._x - 5;
_local2._y = (chatter._y - (16 * _local1)) - 22;
trace((("build dropdown " + _local2._y) + " x=") + _local2._x);
_local2.myText = chatText[_local1];
_local2._visible = false;
_local2.id = _local1;
_local1++;
}
};
showDropDown = function () {
var _local3 = this;
closeHelper();
if (((!main.flying) and (main.gameInfo.playerID == main.thrower)) and (!main.alreadyMade)) {
if (chatter.bg._visible) {
chatter.bg._visible = false;
var _local1 = 0;
while (_local1 < chatText.length) {
var _local2 = _local3["DropDown" + _local1];
_local2._visible = false;
_local1++;
}
} else {
chatter.bg._visible = true;
var _local1 = 0;
while (_local1 < chatText.length) {
var _local2 = _local3["DropDown" + _local1];
_local2._visible = true;
_local1++;
}
}
}
};
hideChatter = function () {
var _local3 = this;
chatter.bg._visible = false;
var _local1 = 0;
while (_local1 < chatText.length) {
var _local2 = _local3["DropDown" + _local1];
_local2._visible = false;
_local1++;
}
};
chooseChat = function (which) {
var _local3 = which;
trace("which=" + _local3);
currentChatID = _local3;
if (_root.variant == "none") {
if (_local3 < 6) {
if (main.useList[_local3]) {
main.removeFromUseList(_local3);
} else if ((((((((!main.flying) and (main.gameInfo.playerID == main.thrower)) and (Selection.getFocus() != "_level0.lobby.sender")) and (!main.useList[_local3])) and (!main.alreadyMade)) and (!main.dragging)) and (!main.flying)) and (!main.shooting)) {
main.addToUseList(_local3);
}
} else {
var _local1 = 0;
while (_local1 < 6) {
if (main.useList[_local1]) {
main.removeFromUseList(_local1);
}
_local1++;
}
}
}
chatter.bg._visible = false;
var _local1 = 0;
while (_local1 < chatText.length) {
var _local2 = this["DropDown" + _local1];
_local2._visible = false;
_local1++;
}
};
Frame 2
onEnterFrame = function () {
if (((stinger_mc._currentframe > 1) && (stinger_mc._currentframe == stinger_mc._totalframes)) || (skipStinger)) {
if (this._framesloaded == this._totalframes) {
sendCommand("trackingGameLoaded");
mygoal = 5;
spread = 85;
slot = [0, 0];
delete onEnterFrame;
removeMovieClip(loader);
removeMovieClip(stinger_mc);
gotoAndPlay ("menu");
}
}
if (stinger_mc._currentframe > 1) {
}
if (((stinger_mc._currentframe > (stinger_mc._totalframes / 2)) and (!swapped)) || (skipStinger)) {
swapped = true;
loader._visible = true;
loader.swapDepths(1000);
}
};
stop();
Frame 4
locked = false;
closeHelper = function () {
locked = false;
helper.spinner.stop();
main.resetModule.playAgainButton.enabled = true;
helper.gotoAndPlay("leave");
};
openHelper = function () {
locked = true;
helper.spinner.play();
main.resetModule.playAgainButton.enabled = false;
helper._visible = true;
helper.gotoAndPlay("enter");
};
sounds.radio.fade();
score0 = 0;
score1 = 0;
_quality = "BEST";
play();
Frame 5
sounds.mainMusic.start();
stop();
Frame 19
jumpPos = [126, 164, 202];
if (mygoal == 10) {
slot[1] = 1;
}
onEnterFrame = function () {
jumper0._y = jumpPos[slot[0]];
jumper1._y = jumpPos[slot[1]];
};
mode = "computer";
stop();
Frame 25
inProgress = false;
gotoAndStop ("lobby");
Frame 31
onEnterFrame = function () {
if (inProgress) {
id = gameInfo.playerID;
gameInfo.goal = 5;
gotoAndStop ("connected");
}
};
trace("LOCAL NAME=" + name);
score0 = 0;
score1 = 0;
stop();
Frame 41
mode = "online";
main.gameInfo = gameInfo;
buildDropDown();
stop();
Frame 51
buildDropDown();
stop();
Frame 60
mode = "practice";
trace("practicing");
buildDropDown();
main.gameInfo = new Object();
main.gameInfo.playerID = 0;
Frame 69
mode = "practice";
trace("practicing really");
chatter._visible = false;
main.gameInfo = new Object();
main.gameInfo.playerID = 0;
_root.gameID = 94;
_root.rootWidth = 550;
_root.rootHeight = 400;
stop();
Instance of Symbol 400 MovieClip "scores" in Frame 69
/* no clip actions */
Frame 78
mode = "practice";
trace("practicing");
main.gameInfo = new Object();
main.gameInfo.playerID = 0;
_root.gameID = 95;
_root.rootWidth = 550;
_root.rootHeight = 400;
loadMovie ("http://64.91.231.65/actionscript/scores.swf", "scores");
stop();
Symbol 8 MovieClip [chatButton_mc] Frame 1
btnChatText.onPress = function () {
_parent.chooseChat(id);
};
Symbol 13 MovieClip Frame 1
total = _root.getBytesTotal();
Symbol 13 MovieClip Frame 2
percent = _root.getBytesLoaded() / total;
bar._xscale = percent * 100;
Symbol 13 MovieClip Frame 3
gotoAndPlay (2);
Symbol 16 MovieClip Frame 1
changeColor = function (percent) {
var _local1 = _parent;
var _local2 = percent;
_local1.myTransform.rb = 3 * _local2;
_local1.myTransform.gb = 3 * _local2;
_local1.myTransform.bb = 2.55 * _local2;
_local1.myColor.setTransform(_local1.myTransform);
};
changeColor(0);
stop();
Symbol 16 MovieClip Frame 2
changeColor(10);
Symbol 16 MovieClip Frame 3
changeColor(20);
Symbol 16 MovieClip Frame 4
_root.sounds.scratch.start();
changeColor(30);
Symbol 16 MovieClip Frame 5
changeColor(40);
Symbol 16 MovieClip Frame 6
changeColor(50);
Symbol 16 MovieClip Frame 7
changeColor(60);
Symbol 16 MovieClip Frame 8
changeColor(80);
Symbol 16 MovieClip Frame 9
changeColor(100);
_parent.gotoAndStop(destination);
Symbol 16 MovieClip Frame 10
changeColor(80);
Symbol 16 MovieClip Frame 11
changeColor(60);
Symbol 16 MovieClip Frame 12
changeColor(40);
Symbol 16 MovieClip Frame 13
changeColor(30);
Symbol 16 MovieClip Frame 14
changeColor(20);
Symbol 16 MovieClip Frame 15
changeColor(10);
Symbol 20 Button
on (release) {
mode = "multiplayer";
variant = "none";
objLogin = new LoadVars();
objLogin.load("http://www.makaimedia.com/scripts/getMemberInfo.aspx", objLogin);
objLogin.onLoad = function (success) {
trace(objLogin.memberID);
if (objLogin.memberID > 0) {
trace("connect");
gotoAndStop ("connect");
} else {
trace("login");
getURL ("/membership/login.aspx?ref=g&gid=" + _root.gameID, "_self");
}
};
}
Symbol 26 Button
on (release) {
sendCommand("trackingGameStart");
btnQuit._visible = true;
choice = "practice";
variant = "none";
mode = "practice";
fade("court");
}
Symbol 29 Button
on (release) {
sendCommand("trackingGameStart");
btnQuit._visible = true;
choice = "computer";
mode = "computer";
variant = "none";
fade("difficulty");
}
Symbol 32 Button
on (release) {
sendCommand("trackingGameStart");
btnQuit._visible = true;
choice = "freethrow";
mode = "practice";
variant = "freethrow";
fade("court");
}
Symbol 47 Button
on (release) {
trackingGameQuit();
getURL (SW1);
}
Symbol 51 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 57 MovieClip Frame 1
onEnterFrame = function () {
if (_root._currentframe > 40) {
count++;
if (count >= 54) {
count = 0;
r = random(3);
if (r == 0) {
r = random(4) + 1;
}
}
}
};
stop();
Symbol 57 MovieClip Frame 6
stop();
Symbol 57 MovieClip Frame 13
stop();
Symbol 57 MovieClip Frame 20
stop();
Symbol 57 MovieClip Frame 27
stop();
Symbol 62 MovieClip Frame 1
onEnterFrame = function () {
if (_root._currentframe > 40) {
count++;
if (count >= 120) {
count = 0;
r = random(2);
if (r == 0) {
r = random(3) + 1;
gotoAndPlay("sound" + r);
}
}
}
};
count = 80;
stop();
Symbol 62 MovieClip Frame 12
stop();
Symbol 62 MovieClip Frame 19
stop();
Symbol 62 MovieClip Frame 25
stop();
Symbol 63 MovieClip Frame 1
function start() {
var _local1 = _parent;
if ((_currentframe == 1) and (_local1.volumes[4] == 0)) {
_local1.goals[4] = 80;
_local1.goals[5] = 0;
gotoAndPlay (2);
}
}
stop();
Symbol 65 MovieClip Frame 1
function start() {
if (_currentframe == 1) {
gotoAndPlay (2);
}
}
stop();
Symbol 69 MovieClip Frame 1
function start() {
current++;
if (current > 3) {
current = 1;
}
gotoAndPlay("bounce" + current);
}
current = 0;
stop();
Symbol 69 MovieClip Frame 3
stop();
Symbol 69 MovieClip Frame 12
stop();
Symbol 69 MovieClip Frame 22
stop();
Symbol 71 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 73 MovieClip Frame 1
function start() {
current++;
if (current > 3) {
current = 1;
}
gotoAndPlay("bounce" + current);
}
current = 0;
stop();
Symbol 73 MovieClip Frame 3
stop();
Symbol 73 MovieClip Frame 12
stop();
Symbol 73 MovieClip Frame 22
stop();
Symbol 76 MovieClip Frame 1
start = function (which) {
s.stop();
playing = true;
s.setVolume(100);
gotoAndPlay("on" + which);
};
fade = function (which) {
playing = false;
gotoAndPlay("fade" + which);
};
change = function (which) {
if (!playing) {
start(which);
} else {
fade(which);
}
};
s = new Sound(this);
stop();
playing = false;
Symbol 76 MovieClip Frame 8
stop();
Symbol 76 MovieClip Frame 9
s.setVolume(80);
trace("fading out");
Symbol 76 MovieClip Frame 10
s.setVolume(60);
Symbol 76 MovieClip Frame 11
s.setVolume(40);
Symbol 76 MovieClip Frame 12
s.setVolume(20);
Symbol 76 MovieClip Frame 13
s.setVolume(0);
Symbol 76 MovieClip Frame 14
stop();
Symbol 76 MovieClip Frame 23
stop();
Symbol 76 MovieClip Frame 24
s.setVolume(80);
trace("fading out");
Symbol 76 MovieClip Frame 25
s.setVolume(60);
Symbol 76 MovieClip Frame 26
s.setVolume(40);
Symbol 76 MovieClip Frame 27
s.setVolume(20);
Symbol 76 MovieClip Frame 28
s.setVolume(0);
Symbol 76 MovieClip Frame 29
stop();
Symbol 77 MovieClip Frame 1
start = function () {
s.stop();
playing = true;
s.setVolume(100);
gotoAndPlay ("on");
};
fade = function () {
playing = false;
gotoAndPlay ("fade");
};
s = new Sound(this);
stop();
playing = false;
Symbol 77 MovieClip Frame 8
stop();
Symbol 77 MovieClip Frame 9
s.setVolume(80);
trace("fading out");
Symbol 77 MovieClip Frame 10
s.setVolume(60);
Symbol 77 MovieClip Frame 11
s.setVolume(40);
Symbol 77 MovieClip Frame 12
s.setVolume(20);
Symbol 77 MovieClip Frame 13
s.setVolume(0);
Symbol 77 MovieClip Frame 14
stop();
Symbol 79 MovieClip Frame 1
function start() {
gotoAndPlay (2);
}
stop();
Symbol 83 MovieClip Frame 1
stop();
Symbol 85 Button
on (release) {
trace("volume");
if (goals[0] == 100) {
goals[0] = 0;
} else {
goals[0] = 100;
}
}
Symbol 86 MovieClip Frame 1
instance = new Array();
names = ["this", "bounce", "rim", "net", "backboard"];
goals = [100, 100, 100, 60, 0];
volumes = [100, 100, 100, 60, 0];
adjustments = [5, 5, 5, 10, 10];
i = 0;
while (i < names.length) {
instance[i] = new Sound(eval (names[i]));
instance[i].setVolume(volumes[i]);
i++;
}
onEnterFrame = function () {
i = 0;
while (i < names.length) {
if (goals[i] < volumes[i]) {
volumes[i] = volumes[i] - adjustments[i];
} else if (goals[i] > volumes[i]) {
volumes[i] = volumes[i] + adjustments[i];
}
if (Math.abs(goals[i] - volumes[i]) < adjustments[i]) {
volumes[i] - goals[i];
}
instance[i].setVolume(volumes[i]);
i++;
}
frame = int(volumes[0] / 10) + 1;
speaker.gotoAndStop(frame);
};
Symbol 86 MovieClip Frame 2
music.start();
stop();
Symbol 93 Button
on (release) {
court = 1;
sounds.mainMusic.fade();
sounds.scratcher.start();
fade(choice);
}
Symbol 98 Button
on (release) {
court = 2;
sounds.mainMusic.fade();
sounds.scratcher.start();
fade(choice);
}
Symbol 104 Button
on (release) {
sendCommand("trackingGameOver");
fade("menu");
}
Symbol 107 Button
on (release) {
difficulty = 1;
fade("court");
}
Symbol 110 Button
on (release) {
difficulty = 2;
fade("court");
}
Symbol 113 Button
on (release) {
difficulty = 3;
fade("court");
}
Symbol 129 Button
on (release) {
_parent.gotoAndStop("logon");
trace("::RETRY CONNECTION");
}
Symbol 136 Button
on (release) {
gotoAndStop ("creating");
client.call("create", new createRet());
}
Symbol 141 Button
on (press) {
scrollMove = -1;
scroll(-1);
}
on (release, dragOut, releaseOutside) {
scrollCount = 0;
scrollMove = 0;
}
Symbol 143 Button
on (press) {
scrollMove = 1;
scroll(1);
}
on (release, dragOut, releaseOutside) {
scrollCount = 0;
scrollMove = 0;
}
Symbol 150 Button
on (release) {
_parent._parent._parent.join(id, gameName);
}
Symbol 157 MovieClip Frame 1
function scroll(how) {
position = position + how;
position = Math.min(total, position);
position = Math.max(position, 0);
gameList._y = listinit - (position * spread);
shuttle._y = top + ((bottom - top) * (position / total));
}
spread = 22;
top = -70;
bottom = 42;
scrollCount = 0;
position = 0;
listinit = gameList._y;
dragging = false;
onEnterFrame = function () {
total = Math.max(0, elements - 8);
if (dragging) {
position = int(((shuttle._y - top) / (bottom - top)) * total);
gameList._y = listinit - (position * spread);
}
scrollCount = scrollCount + scrollMove;
if (scrollCount > 3) {
scroll(1);
}
if (scrollCount < -3) {
scroll(-1);
}
};
Instance of Symbol 156 MovieClip "gameList" in Symbol 157 MovieClip Frame 1
/* no clip actions */
Symbol 164 Button
on (release) {
_parent._parent._parent.challenge(id);
}
Symbol 167 MovieClip Frame 1
function scroll(how) {
position = position + how;
position = Math.min(total, position);
position = Math.max(position, 0);
peopleList._y = listinit - (position * spread);
shuttle._y = top + ((bottom - top) * (position / total));
}
spread = 22;
top = -70;
bottom = 42;
scrollCount = 0;
position = 0;
listinit = peopleList._y;
dragging = false;
onEnterFrame = function () {
total = Math.max(0, elements - 8);
if (dragging) {
position = int(((shuttle._y - top) / (bottom - top)) * total);
peopleList._y = listinit - (position * spread);
}
scrollCount = scrollCount + scrollMove;
if (scrollCount > 3) {
scroll(1);
}
if (scrollCount < -3) {
scroll(-1);
}
};
Instance of Symbol 166 MovieClip "peopleList" in Symbol 167 MovieClip Frame 1
/* no clip actions */
Symbol 176 Button
on (release) {
nextFrame();
}
Symbol 177 Button
on (release) {
prevFrame();
}
Symbol 178 MovieClip Frame 1
_parent.makeAvailable(true);
stop();
Symbol 178 MovieClip Frame 2
_parent.makeAvailable(false);
stop();
Symbol 183 Button
on (release) {
_parent.gotoAndStop("menu");
}
Symbol 188 Button
on (release) {
gotoAndStop ("connected");
}
Symbol 195 Button
on (release) {
cancelChallenge();
}
Symbol 200 Button
on (release) {
leave(myGame.id, true);
}
Symbol 206 Button
on (release) {
respondToChallenge(true);
}
Symbol 211 Button
on (release) {
respondToChallenge(false);
}
Symbol 223 Button
on (release) {
leave(myGame.id, myGame.host);
}
Symbol 230 Button
on (release) {
launch(myGame.id);
}
Symbol 239 Button
on (release) {
sendTaunt(1);
}
Symbol 243 Button
on (release) {
sendTaunt(2);
}
Symbol 247 Button
on (release) {
sendTaunt(3);
}
Symbol 251 Button
on (release) {
sendTaunt(4);
}
Symbol 255 Button
on (release) {
sendTaunt(5);
}
Symbol 260 MovieClip Frame 1
function scroll(how) {
history.scroll = history.scroll + how;
history.scroll = Math.min(history.scroll, history.maxscroll - 1);
history.scroll = Math.max(history.scroll, 1);
shuttle._y = top + ((bottom - top) * ((history.scroll - 1) / (history.maxscroll - 2)));
}
spread = 22;
top = -69;
bottom = 42;
history.scroll = 1;
history.html = true;
listinit = gameList._y;
dragging = false;
onEnterFrame = function () {
if (dragging) {
history.scroll = int(((shuttle._y - top) / (bottom - top)) * (history.maxscroll - 2)) + 1;
}
scrollCount = scrollCount + scrollMove;
if (scrollCount > 3) {
scroll(1);
}
if (scrollCount < -3) {
scroll(-1);
}
};
Symbol 267 Button
on (release) {
sendChat();
}
Symbol 270 Button
on (release) {
leave(myGame.id, myGame.host);
}
Symbol 272 MovieClip Frame 1
if (_root.name == null) {
hey = _root.name;
trace("stopping");
stop();
} else {
trace("going to login");
hey = "log in";
name = _root.name;
gotoAndStop ("logon");
}
myUrl = "rtmp://www.makaimedia.com/horse";
Symbol 272 MovieClip Frame 5
_parent.connected = false;
elligible = true;
client = new NetConnection();
client.onStatus = function (info) {
trace(info.code);
if (info.code == "NetConnection.Connect.Success") {
gotoAndStop ("connected");
} else {
gotoAndStop ("failure");
}
};
client.connect(myUrl, name);
client.setUserInfo = function (clientID) {
id = clientID;
trace("MY ID=" + id);
};
Symbol 272 MovieClip Frame 15
function respondToChallenge(accepted) {
if (accepted) {
client.call("acceptChallenge", null, challengedByID);
join(challengedByID, challengedBy + "'s Game");
} else {
client.call("declineChallenge", new declineChallengeRet(), challengedByID);
gotoAndStop ("connected");
}
}
function cancelChallenge() {
client.call("cancelChallenge", new cancelChallengeRet(), myChallengeID);
}
function challenge(id, name) {
myChallenge = name;
myChallengeID = id;
client.call("challenge", new challengeRet(), id);
}
function join(gameid, gameName) {
myGame.id = gameID;
myGame.name = gameName;
myGame.host = false;
client.call("join", new joinRet(), gameid);
gotoAndStop ("joining");
}
function leave(gameid, host) {
var _local1 = _parent;
client.call("leave", null, gameid, host);
_local1.gotoAndStop("lobby");
_local1.inProgress = false;
chat.close();
_local1.game.close();
gotoAndStop ("connected");
}
function addToList() {
g = games.data[j];
resp = resp + "::::";
resp = resp + ((g.started + g.challenge) + g.players);
if (((((!g.started) and (!g.challenge)) and (g.players >= 1)) or (g.started and (g.players > 1))) or (g.challenge and (g.players > 1))) {
duplicateMovieClip ("scroller.gameList.gameKing", "game" + gameCount, gameCount);
n = eval ("scroller.gameList.game" + gameCount);
n.id = g.id;
n.players = g.players + "/2";
n.gameName = g.name;
if (g.players < 2) {
n.join._visible = true;
n.status = "open";
openGames++;
} else {
n.join._visible = false;
if (g.started) {
n.status = "In Progress";
} else {
n.status = "Full";
}
}
gameCount++;
n._y = 138 + (gamecount * scroller.spread);
}
}
function makeAvailable(whether) {
users.data["user" + id].elligible = whether;
elligible = whether;
}
function addToPeople(u) {
if (u.id == myChallengeID) {
challengedPresent = true;
}
if ((u.id == id) and (!u.elligible)) {
available.gotoAndStop(2);
}
duplicateMovieClip ("peopleScroller.peopleList.peopleKing", "people" + userCount, userCount);
n = eval ("peopleScroller.peopleList.people" + userCount);
if ((!u.available) or (!u.elligible)) {
n.btnChallenge._visible = false;
} else if (u.id == id) {
n.btnChallenge._visible = false;
} else {
n.btnChallenge._visible = true;
}
n.id = u.id;
n.user = u.name;
userCount++;
n._y = 138 + (userCount * peopleScroller.spread);
}
createRet = function () {
this.onResult = function (value) {
myGame.id = value;
myGame.host = true;
myGame.playerid = 0;
gotoAndStop ("room");
};
};
joinRet = function () {
this.onResult = function (value) {
if (value) {
myGame.host = false;
myGame.playerid = 1;
gotoAndStop ("room");
} else {
gotoAndStop ("joinError");
}
};
};
cancelChallengeRet = function () {
this.onResult = function (value) {
trace(value);
myChallengeID = undefined;
myChallenge = undefined;
gotoAndStop ("connected");
};
};
challengeRet = function () {
this.onResult = function (value) {
trace(value);
if (!value) {
gotoAndStop ("challengeError");
} else {
gotoAndStop ("challenge");
}
};
};
client.cancelChallenge = function () {
gotoAndStop ("challengeCancelled");
};
client.declineChallenge = function () {
myChallengeID = null;
leave(myGame.id, true);
gotoAndStop ("challengeDeclined");
};
client.acceptChallenge = function () {
myGame.id = id;
myGame.host = true;
myGame.playerid = 0;
gotoAndStop ("room");
};
client.challengedBy = function (id, name) {
challengedBy = name;
challengedByID = id;
gotoAndStop ("respondToChallenge");
};
openGames = 0;
userCount = 0;
myGame = new Object();
myGame.name = name;
games = SharedObject.getRemote("games_so", client.uri, false);
games.connect(client);
games.onSync = function (list) {
var _local1 = list;
i = 0;
while (i < _local1.length) {
gamecount = 0;
i = 0;
while (i <= 500) {
removeMovieClip("scroller.gameList.game" + i);
i++;
}
scroller.elements = 0;
openGames = 0;
for (j in games.data) {
scroller.elements++;
addtoList();
}
gameTitle = ("Games (" + openGames) + " open)";
i++;
}
};
users = SharedObject.getRemote("users_so", client.uri, false);
users.connect(client);
users.onSync = function (list) {
var _local1 = list;
trace("USERS ON SYNC");
i = 0;
while (i < _local1.length) {
if (_local1[i].code == "clear") {
makeAvailable(true);
}
usercount = 0;
i = 0;
while (i <= 500) {
removeMovieClip("peopleScroller.peopleList.people" + i);
i++;
}
peopleScroller.elements = 0;
userCount = 0;
challengedPresent = false;
cList = new Array();
bList = new Array();
for (j in users.data) {
if ((users.data[j].available and users.data[j].elligible) and (users.data[j].id != id)) {
cList.push(users.data[j]);
} else {
bList.push(users.data[j]);
}
}
trace((clist.length + " ") + blist.length);
for (j in cList) {
peopleScroller.elements++;
addtoPeople(cList[j]);
}
for (j in bList) {
peopleScroller.elements++;
addtoPeople(bList[j]);
}
UserTitle = ("Who's Here (" + userCount) + ")";
if ((!challengedPresent) and (myChallengeID != null)) {
leave(myGame.id, true);
gotoAndStop ("challengeError");
}
i++;
}
};
onEnterFrame = function () {
};
if (!elligible) {
available.gotoAndStop(2);
}
challengedById = null;
myChallengeID = null;
Symbol 272 MovieClip Frame 23
onEnterFrame = function () {
};
chat.close();
Symbol 272 MovieClip Frame 38
onEnterFrame = function () {
if (challengedById > 0) {
gotoAndStop ("respondToChallenge");
}
};
myChallengeID = null;
Symbol 272 MovieClip Frame 48
onEnterFrame = function () {
};
myChallengeID = null;
Symbol 272 MovieClip Frame 60
onEnterFrame = function () {
};
myChallengeID = null;
Symbol 272 MovieClip Frame 73
Symbol 272 MovieClip Frame 85
games.onSync = function (list) {
};
onEnterFrame = function () {
};
myChallengeID = null;
Symbol 272 MovieClip Frame 124
function addMessage(who, what) {
var _local1 = what;
if (_local1.substr(_local1.length - 1, 1) == "\r") {
_local1 = _local1.substring(0, _local1.length - 1);
}
_local1 = stripSpaces(_local1);
chatlist.history.htmlText = chatlist.history.htmlText + (((("<FONT COLOR='#557799'>" + who) + ":</FONT><FONT COLOR='#113355'> ") + _local1) + "</FONT><br>");
if (chatlist.history.scroll != chatlist.history.maxscroll) {
chatlist.shuttle._y = chatlist.bottom;
chatlist.history.scroll = chatlist.history.maxscroll;
}
}
function stripSpaces(strText) {
var _local2 = strText;
jim = Number(_local2.length);
j = 0;
while (j < jim) {
var _local1 = (jim - j) - 1;
if ((_local2.charCodeAt(_local1) == 32) and (_local2.charCodeAt(_local1 - 1) == 32)) {
_local2 = _local2.substr(0, _local1) add _local2.substr(_local1 + 1, _local2.length - _local1);
}
j++;
}
return(_local2);
}
function setUpChat() {
chatlist.history.htmlText = "";
chatTransfer = "";
chat = SharedObject.getRemote("chat" + myGame.id, client.uri, false);
chat.connect(client);
chat.onSync = function (list) {
var _local1 = list;
i = 0;
while (i < _local1.length) {
if ((_local1[i].name == "chatted0") and (chat.data.message0 != "")) {
addMessage(myGame.player0, chat.data.message0);
}
if ((_local1[i].name == "chatted1") and (chat.data.message1 != "")) {
addMessage(myGame.player1, chat.data.message1);
}
if ((_local1[i].name == "taunted0") and (chat.data.taunt0 != "")) {
playTaunt(chat.data.taunt0);
}
if ((_local1[i].name == "taunted1") and (chat.data.taunt1 != "")) {
playTaunt(chat.data.taunt1);
}
i++;
}
};
}
function sendChat() {
if (myGame.host) {
chat.data.message0 = sender.text;
chat.data.chatted0++;
} else {
chat.data.message1 = sender.text;
chat.data.chatted1++;
}
sender.text = "";
}
function sendTaunt(which) {
var _local1 = which;
if (myGame.host) {
chat.data.taunt0 = _local1;
chat.data.taunted0++;
} else {
chat.data.taunt1 = _local1;
chat.data.taunted1++;
}
switch (_local1) {
case 1 :
if (myGame.host) {
chat.data.message0 = "Yes!";
chat.data.chatted0++;
} else {
chat.data.message1 = "Yes!";
chat.data.chatted1++;
}
return;
case 2 :
if (myGame.host) {
chat.data.message0 = "No!";
chat.data.chatted0++;
} else {
chat.data.message1 = "No!";
chat.data.chatted1++;
}
return;
case 3 :
if (myGame.host) {
chat.data.message0 = "Hello!";
chat.data.chatted0++;
} else {
chat.data.message1 = "Hello!";
chat.data.chatted1++;
}
return;
case 4 :
if (myGame.host) {
chat.data.message0 = "Good game!";
chat.data.chatted0++;
} else {
chat.data.message1 = "Good game!";
chat.data.chatted1++;
}
return;
case 5 :
if (myGame.host) {
chat.data.message0 = "Play again?";
chat.data.chatted0++;
} else {
chat.data.message1 = "Play again?";
chat.data.chatted1++;
}
}
}
function playTaunt(which) {
eval ("_parent.sounds.taunt" + which).start();
}
function launch(gameid) {
chatTransfer = chatlist.history.text;
client.call("launch", new launchRet(), gameid);
gotoAndStop ("launching");
}
function updateSetup(g) {
var _local1 = g;
gameName = _local1.name;
if (_local1.started) {
if (!myGame.host) {
chatTransfer = chatlist.history.text;
}
gotoAndStop ("game");
} else if (_local1.player1.length > 0) {
setup = (_local1.player0 + " vs. ") + _local1.player1;
myGame.player0 = _local1.player0;
myGame.player1 = _local1.player1;
if (myGame.host) {
launchButton._visible = true;
myGame.you = myGame.player0;
myGame.him = myGame.player1;
myGame.opponent = 1;
} else {
launchButton._visible = false;
myGame.you = myGame.player1;
myGame.him = myGame.player0;
myGame.opponent = 0;
}
} else {
if (myGame.player1.length > 0) {
chat.close();
setUpChat();
}
setup = _local1.player0 + " vs. ?????";
myGame.player0 = _local1.player0;
launchButton._visible = false;
}
}
launchRet = function () {
this.onResult = function (value) {
if (value) {
} else {
gotoAndStop ("room");
}
};
};
games.onSync = function (list) {
var _local1 = list;
i = 0;
while (i < _local1.length) {
if ((_local1[i].code == "delete") and (_local1[i].name == ("game" + myGame.id))) {
users.data["user" + id].available = true;
gotoAndStop ("disconnect");
} else if (_local1[i].name == ("game" + myGame.id)) {
if (!games.data["game" + myGame.id].challenge) {
} else if ((!games.data["game" + myGame.id].started) and (games.data["game" + myGame.id].players < 2)) {
games.data["game" + myGame.id] = null;
gotoAndStop ("challengeAborted");
}
updateSetup(games.data["game" + myGame.id]);
}
i++;
}
};
onEnterFrame = function () {
if (selection.getFocus() == "_level0.lobby.sender") {
if ((sender.text != "") and Key.isDown(13)) {
sendChat();
}
} else if (Key.isDown(13)) {
selection.setFocus("_level0.lobby.sender");
}
};
updateSetup(eval ("games.data.game" + myGame.id));
newListener = new Object();
newListener.onChanged = function () {
sender.text = stripSpaces(sender.text);
};
challengedById = null;
sender.addListener(newListener);
setUpChat();
Symbol 272 MovieClip Frame 136
games.onSync = function (list) {
var _local1 = list;
i = 0;
while (i < _local1.length) {
if ((_local1[i].code == "delete") and (_local1[i].name == ("game" + myGame.id))) {
gotoAndStop ("gameDisconnect");
}
i++;
}
if (games.data["game" + myGame.id].players != 2) {
gotoAndStop ("gameDisconnect");
}
};
chatlist.history.text = chatTransfer;
_parent.gameInfo = newObject();
_parent.gameInfo = myGame;
_parent.inProgress = true;
Symbol 272 MovieClip Frame 142
_parent.inProgress = false;
chat.close();
_parent.game.close();
Symbol 276 Button
on (press) {
trace("hello there");
_root.sounds.radio.change(_parent.court);
}
Symbol 279 MovieClip Frame 1
gotoAndStop(_parent.court);
Symbol 283 MovieClip Frame 1
_alpha = 0;
Symbol 285 MovieClip Frame 1
left = _x - (_width / 2);
right = _x + (_width / 2);
top = _y - (_height / 2);
bottom = _y + (_height / 2);
center = new Array();
center[0] = new Object();
center[0].y = _y;
center[0].x = _x - 10000;
center[1] = new Object();
center[1].y = _y + 10000;
center[1].x = _x;
center[2] = new Object();
center[2].y = _y;
center[2].x = _x + 10000;
center[3] = new Object();
center[3].y = _y - 10000;
center[3].x = _x;
_visible = false;
Symbol 286 MovieClip Frame 1
left = _x - (_width / 2);
right = _x + (_width / 2);
top = _y - (_height / 2);
bottom = _y + (_height / 2);
center = new Array();
center[0] = new Object();
center[0].y = _y;
center[0].x = _x - 10000;
center[1] = new Object();
center[1].y = _y + 10000;
center[1].x = _x;
center[2] = new Object();
center[2].y = _y;
center[2].x = _x + 10000;
center[3] = new Object();
center[3].y = _y - 10000;
center[3].x = _x;
_visible = false;
Symbol 288 MovieClip Frame 1
_visible = false;
Symbol 295 MovieClip Frame 1
function distance(x1, y1, x2, y2) {
distx = x1 - x2;
disty = y1 - y2;
return(Math.sqrt((distx * distx) + (disty * disty)));
}
function magnitude(v1) {
return(distance(0, 0, v1.x, v1.y));
}
function dot(v1, v2) {
return((v1.x * v2.x) + (v1.y * v2.y));
}
function adds(v1, v2) {
tempVector = new Object();
tempVector.x = v1.x + v2.x;
tempVector.y = v1.y + v2.y;
return(tempVector);
}
function subtract(v1, v2) {
tempVector = new Object();
tempVector.x = v1.x - v2.x;
tempVector.y = v1.y - v2.y;
return(tempVector);
}
function Multiply(s, v) {
tempVector = new Object();
tempVector.x = v.x * s;
tempVector.y = v.y * s;
return(tempVector);
}
function resetCollisions() {
myCollisions = new Array();
}
function findAngle(xdist, ydist) {
var _local1 = xdist;
var _local2 = ydist;
a = Math.atan(_local2 / _local1) * rad;
if ((_local1 > 0) and (_local2 < 0)) {
a = -a;
}
if (_local1 < 0) {
a = 180 - a;
}
if ((_local1 > 0) and (_local2 > 0)) {
a = 360 - a;
}
return(a);
}
function getLap() {
var _local1 = _parent;
result = lap + 1;
if (result > _local1.laps) {
result = _local1.laps;
}
result = (("lap: " + result) + " of ") + _local1.laps;
return(result);
}
function findWhichWall(c, x1, y1) {
var _local1 = c;
retVec = new Object();
retVec.x = 0;
retVec.y = 0;
wallDist = new Array();
myVel = distance(0, 0, speed.x, speed.y);
wallDist[0] = (Math.abs(_local1.right - (x1 - span)) < myvel) and (oldPos.x > _x);
wallDist[1] = (Math.abs(_local1.top - (y1 + span)) < myvel) and (oldPos.y < _y);
wallDist[2] = (Math.abs(_local1.left - (x1 + span)) < myvel) and (oldPos.x < _x);
wallDist[3] = (Math.abs(_local1.bottom - (y1 - span)) < myvel) and (oldPos.y > _y);
if (wallDist[0]) {
retVec.x = retVec.x + 1;
}
if (wallDist[1]) {
retVec.y = retVec.y - 1;
}
if (wallDist[2]) {
retVec.x = retVec.x - 1;
}
if (wallDist[3]) {
retVec.y = retVec.y + 1;
}
return(retVec);
}
function myHitTest(c) {
var _local1 = c;
hitting = true;
if (((((_x + span) < _local1.left) or ((_x - span) > _local1.right)) or ((_y + span) < _local1.top)) or ((_y - span) > _local1.bottom)) {
hitting = false;
}
return(hitting);
}
function getSlope(x1, y1, x2, y2) {
return((y1 - y2) / (x1 - x2));
}
function getIntercept(x1, y1, slope) {
return(y1 - (x1 * slope));
}
function getIntersection(x1, y1, x2, y2, x3, y3, x4, y4) {
m1 = getSlope(x1, y1, x2, y2);
m2 = getSlope(x3, y3, x4, y4);
b1 = getIntercept(x1, y1, m1);
b2 = getIntercept(x3, y3, m2);
tempPoint = new Object();
tempPoint.x = (b2 - b1) / (m1 - m2);
tempPoint.y = (m1 * tempPoint.x) + b1;
return(tempPoint);
}
function wallTest(which) {
clip = eval ("_parent.wall" + which);
if (hitTest(clip)) {
startNormal = new Object();
startNormal.x = (_x + clip.point2.y) - clip.point1.y;
startNormal.y = (_y + clip.point1.x) - clip.point2.x;
crossPoint = new Object();
crosspoint = getIntersection(clip.point1.x, clip.point1.y, clip.point2.x, clip.point2.y, startNormal.x, startNormal.y, _x, _y);
mydiff = distance(_x, _y, crossPoint.x, crossPoint.y) - span;
if (myDiff <= 0) {
collisionInfo = new Object();
collisionInfo.perpVector = new Object();
collisionInfo.perpVector.x = 0;
collisionInfo.perpVector.y = 0;
collisionInfo.heft = heft * 1000;
collisionInfo.normal = new Object();
collisionInfo.normal.x = _x - crossPoint.x;
collisionInfo.normal.y = _y - crossPoint.y;
collisionInfo.speed = new Object();
collisionInfo.speed.x = 0;
collisionInfo.speed.y = 0;
collisionInfo.mass = 1000000 /* 0x0F4240 */;
collisionInfo.body = clip;
myCollisions.push(collisionInfo);
}
}
}
function boxTest(which) {
clip = eval ("_parent.box" + which);
if (myHitTest(clip)) {
myDist = distance(_x, _y, clip._x, clip._y);
currentdistx = distx;
currentdisty = disty;
futureDist = distance(_x + speed.x, _y + speed.y, clip._x, clip._y);
wallVector = new Object();
wallVector = findWhichWall(clip, _x, _y);
if ((wallVector.x != 0) or (wallVector.y != 0)) {
if (clip == _parent.box0) {
_parent.bounces++;
_parent.pendingGood = false;
_parent.enmeshed = false;
}
collisionInfo = new Object();
collisionInfo.perpVector = new Object();
collisionInfo.perpVector.x = 0;
collisionInfo.perpVector.y = 0;
collisionInfo.heft = heft * 1000;
collisionInfo.normal = new Object();
collisionInfo.normal = wallVector;
collisionInfo.speed = new Object();
collisionInfo.speed.x = 0;
collisionInfo.speed.y = 0;
collisionInfo.mass = 10000000000;
collisionInfo.body = clip;
myCollisions.push(collisionInfo);
}
}
}
function bumperTest(which) {
clip = eval ("_parent.bumper" + which);
if (hitTest(clip)) {
myDist = distance(_x, _y, clip._x, clip._y);
futureDist = distance(_x + speed.x, _y + speed.y, clip._x, clip._y);
mydiff = myDist - (span + (clip._width / 2));
if ((myDiff <= 0) and (myDist > futureDist)) {
if (((clip == _parent.bumper3) or (clip == _parent.bumper4)) or (clip == _parent.bumper5)) {
_parent.bounces++;
_parent.enmeshed = false;
}
collisionInfo = new Object();
collisionInfo.perpVector = new Object();
collisionInfo.perpVector.x = 0;
collisionInfo.perpVector.y = 0;
collisionInfo.heft = heft * 1000;
collisionInfo.normal = new Object();
collisionInfo.normal = findNormal(this, clip);
collisionInfo.speed = new Object();
collisionInfo.speed.x = 0;
collisionInfo.speed.y = 0;
collisionInfo.mass = 1000000 /* 0x0F4240 */;
collisionInfo.body = clip;
myCollisions.push(collisionInfo);
}
}
}
function cornerTest(which) {
clip = eval ("_parent.corner" + which);
if (hitTest(clip)) {
myDist = distance(_x, _y, clip._x, clip._y);
futureDist = distance(_x + speed.x, _y + speed.y, clip._x, clip._y);
myDiff = myDist - (clip._width - span);
if ((mydiff >= 0) and (myDist < futureDist)) {
collisionInfo = new Object();
collisionInfo.perpVector = new Object();
collisionInfo.perpVector.x = 0;
collisionInfo.perpVector.y = 0;
collisionInfo.heft = heft * 1000;
collisionInfo.normal = new Object();
collisionInfo.normal = findNormal(this, clip);
collisionInfo.normal.x = collisionInfo.normal.x * -1;
collisionInfo.normal.y = collisionInfo.normal.y * -1;
collisionInfo.speed = new Object();
collisionInfo.speed.x = 0;
collisionInfo.speed.y = 0;
collisionInfo.rot = 0;
collisionInfo.mass = 100000000 /* 0x5F5E100 */;
collisionInfo.body = clip;
myCollisions.push(collisionInfo);
}
}
}
function findNormal(me, him) {
tempVector = new Object();
tempVector.x = him._x - me._x;
tempVector.y = him._y - me._y;
return(tempVector);
}
function findBoxNormal(me, him, wall) {
var _local1 = wall;
tempVector = new Object();
if (_local1 == 0) {
tempVector.x = 10;
tempVector.y = 0;
}
if (_local1 == 1) {
tempVector.x = 0;
tempVector.y = -10;
}
if (_local1 == 2) {
tempVector.x = -10;
tempVector.y = 0;
}
if (_local1 == 3) {
tempVector.x = 0;
tempVector.y = 10;
}
return(tempVector);
}
function getJ(mine, his, normal, hismass, hisHeft, hisPerp) {
var _local1 = normal;
myr = (temp = new Object());
diff = new Object();
diff = subtract(mine, his);
temp = multiply(-(1 + elastic), diff);
top = dot(temp, _local1);
massnum = (1 / mass) + (1 / hismass);
temp = multiply(massnum, _local1);
firstAdd = dot(perpVector, _local1);
firstAdd = firstAdd * firstAdd;
firstAdd = firstAdd / heft;
secondAdd = dot(hisPerp, _local1);
secondAdd = secondAdd * secondAdd;
secondAdd = secondAdd / hisHeft;
bottom = dot(_local1, temp);
bottom = bottom + (firstAdd + secondAdd);
j = top / bottom;
return(j);
}
function getCollisions() {
i = id + 1;
while (i < _parent.balls) {
clip = eval ("_parent.ball" + i);
if (hitTest(clip)) {
myDist = distance(_x, _y, clip._x, clip._y);
futureDist = distance(_x + speed.x, _y + speed.y, clip._x + clip.speed.x, clip._y + clip.speed.y);
mydiff = (span + clip.span) - myDist;
if ((myDiff > 0) and (myDist > futureDist)) {
collisionInfo = new Object();
collisionInfo.perpVector = new Object();
collisionInfo.perpVector = clip.perpVector;
collisionInfo.normal = new Object();
collisionInfo.normal = findNormal(this, clip);
collisionInfo.speed = new Object();
collisionInfo.speed = clip.speed;
collisionInfo.rot = clip.rot;
collisionInfo.mass = clip.mass;
collisionInfo.heft = clip.heft;
myCollisions.push(collisionInfo);
collisionInfo = new Object();
collisionInfo.perpVector = new Object();
collisionInfo.perpVector = perpVector;
collisionInfo.normal = new Object();
collisionInfo.normal = findNormal(clip, this);
collisionInfo.speed = new Object();
collisionInfo.speed = speed;
collisionInfo.rot = rot;
collisionInfo.mass = mass;
collisionInfo.heft = heft;
clip.myCollisions.push(collisionInfo);
}
}
i++;
}
i = 0;
while (i < _parent.corners) {
cornerTest(i);
i++;
}
i = 0;
while (i < _parent.bumpers) {
bumperTest(i);
i++;
}
i = 0;
while (i < _parent.walls) {
wallTest(i);
i++;
}
i = 0;
while (i < _parent.boxes) {
boxTest(i);
i++;
}
return(MyCollisions);
}
function translate() {
oldPos = new Object();
oldPos.x = _x;
oldPos.y = _y;
prevelocity = distance(0, 0, speed.x, speed.y);
if (maxvelocity > maxvelocity) {
finalvel = finalvel * 0.8;
} else {
finalvel = maxVelocity;
}
finalVel = Math.max(finalVel, maxvelocity);
if (prevelocity > finalvel) {
ratio = finalvel / prevelocity;
speed.x = speed.x * ratio;
speed.y = speed.y * ratio;
}
_x = (_x + (speed.x / _parent.iterations));
_y = (_y + (speed.y / _parent.iterations));
_rotation = (_rotation + (rot * rad));
rot = rot * 0.85;
perpVector.x = (-Math.sin(_rotation / rad)) * span;
perpVector.y = Math.cos(_rotation / rad) * span;
prevelocity = distance(0, 0, speed.x, speed.y);
if (prevelocity > 0) {
velocity = prevelocity - friction;
velocity = Math.max(0, velocity);
ratio = velocity / preVelocity;
speed.x = speed.x * ratio;
speed.y = speed.y * ratio;
}
}
function collisionDetection() {
collisionList = new Array();
collisionList = getCollisions();
}
function collisionResponse() {
var _local3 = _root;
if (collisionList.length > 0) {
speedtotal = new Object();
rottotal = 0;
i = 0;
while (i < collisionList.length) {
j = getj(speed, collisionList[i].speed, collisionList[i].normal, collisionList[i].mass, collisionList[i].heft, collisionList[i].perpVector);
temp = new Object();
temp = multiply(j / mass, collisionList[i].normal);
speedtotal = adds(speedtotal, temp);
jnormal = new Object();
jnormal = multiply(j, collisionList[i].normal);
value = dot(jnormal, perpvector);
rottotal = rottotal + (value / heft);
var _local1 = collisionList[i].body;
i++;
}
_parent.determineSpecs(_local1._name);
vol = int(magnitude(speedTotal) * 2);
if (vol > 15) {
var _local2 = determineSound(_local1);
_local3.sounds.instance[_local2].setVolume(vol);
_local3.sounds.volumes[_local2] = vol;
_local3.sounds.goals[_local2] = vol;
if (_local2 == 1) {
_local3.sounds.bounce.start();
} else if (_local2 == 2) {
_local3.sounds.rim.start();
} else if (_local2 == 4) {
_local3.sounds.backboard.start();
}
}
speedtotal.x = speedtotal.x / collisionList.length;
speedtotal.y = speedtotal.y / collisionList.length;
rotTotal = rotTotal / collisionList.length;
rot = rot - rotTotal;
speed = adds(speed, speedTotal);
_parent.checkBounces();
}
}
determineSound = function (who) {
var _local1 = who;
if (((_local1._name == "bumper0") or (_local1._name == "bumper1")) or (_local1._name == "box2")) {
return(2);
}
if (_local1._name == "box1") {
return(4);
}
return(1);
};
Symbol 297 Button
on (press) {
_parent.doPress();
}
on (release, releaseOutside) {
trace("the release button was supposedly pressed");
_parent.doRelease();
}
Symbol 301 MovieClip Frame 1
_alpha = false;
Symbol 305 MovieClip Frame 1
_visible = false;
Symbol 309 MovieClip Frame 1
_alpha = 0;
Symbol 311 MovieClip Frame 1
_visible = false;
Symbol 313 MovieClip Frame 1
stop();
Symbol 313 MovieClip Frame 5
play();
Symbol 313 MovieClip Frame 8
stop();
Symbol 313 MovieClip Frame 12
play();
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 5
stop();
Symbol 332 MovieClip Frame 1
if (_root.variant == "none") {
bongo = _parent.gameInfo.him.toUpperCase();
youText = "You";
} else {
bongo = "Best";
youText = "Score";
_parent.meDisplay = 0;
}
Symbol 334 MovieClip Frame 1
stop();
Symbol 334 MovieClip Frame 3
_parent.computerMove();
play();
Symbol 334 MovieClip Frame 25
_parent.computerEyes();
Symbol 334 MovieClip Frame 46
_parent.computerDrag();
Symbol 334 MovieClip Frame 47
_parent.computerDrag();
Symbol 334 MovieClip Frame 48
_parent.computerDrag();
Symbol 334 MovieClip Frame 49
_parent.computerDrag();
Symbol 334 MovieClip Frame 50
_parent.computerDrag();
Symbol 334 MovieClip Frame 51
_parent.computerDrag();
Symbol 334 MovieClip Frame 52
_parent.computerDrag();
Symbol 334 MovieClip Frame 53
_parent.computerDrag();
Symbol 334 MovieClip Frame 54
_parent.computerDrag();
Symbol 334 MovieClip Frame 55
_parent.computerDrag();
Symbol 334 MovieClip Frame 56
_parent.computerDrag();
Symbol 334 MovieClip Frame 57
_parent.computerDrag();
Symbol 334 MovieClip Frame 62
_parent.computerShot();
Symbol 351 Button
on (release) {
gameInit();
}
Symbol 357 Button
on (release) {
if (_root.mode != "computer") {
if (_parent.gameInfo.playerID == 1) {
trace("player 1 play again");
_parent.game.data.playAgain1 = 1;
} else {
trace("player 0 play again");
_parent.game.data.playAgain0 = 1;
}
message = "WAITING FOR YOUR OPPONENT...";
gotoAndStop (2);
} else {
_parent._parent.trackingGameStart();
_parent.gameInit();
}
}
Symbol 361 Button
on (release) {
_parent._parent.fade("menu");
}
Symbol 364 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 1
shotList = new Array();
shotList[2] = new Object();
shotList[2].speed = new Object();
shotList[2].x = -61.8;
shotList[2].y = -90.5;
shotList[2].speed.x = 17.625;
shotList[2].speed.y = -30.96;
shotList[2].useList = [false, false, false, false, false, false];
shotList[12] = new Object();
shotList[12].speed = new Object();
shotList[12].x = -285.65;
shotList[12].y = -50.8;
shotList[12].speed.x = 21.435;
shotList[12].speed.y = -41.43;
shotList[12].useList = [false, false, false, false, false, false];
shotList[17] = new Object();
shotList[17].speed = new Object();
shotList[17].x = -328.5;
shotList[17].y = -34.95;
shotList[17].speed.x = 20.49;
shotList[17].speed.y = -47.625;
shotList[17].useList = [false, false, false, false, false, false];
shotList[20] = new Object();
shotList[20].speed = new Object();
shotList[20].x = -366.6;
shotList[20].y = -11.15;
shotList[20].speed.x = 23.82;
shotList[20].speed.y = 56.67;
shotList[20].useList = [true, false, true, false, false, false];
shotList[33] = new Object();
shotList[33].speed = new Object();
shotList[33].x = -288.8;
shotList[33].y = -23.85;
shotList[33].speed.x = 21.435;
shotList[33].speed.y = -45.735;
shotList[33].useList = [false, false, false, false, false, true];
shotList[41] = new Object();
shotList[41].speed = new Object();
shotList[41].x = -249.15;
shotList[41].y = -31.75;
shotList[41].speed.x = 14.28;
shotList[41].speed.y = -55.725;
shotList[41].useList = [false, false, false, true, false, false];
shotList[0] = new Object();
shotList[0].speed = new Object();
shotList[0].x = 146.05;
shotList[0].y = -103.2;
shotList[0].speed.x = 6.18;
shotList[0].speed.y = -32.865;
shotList[0].useList = [false, false, false, false, false, false];
shotList[1] = new Object();
shotList[1].speed = new Object();
shotList[1].x = -233.35;
shotList[1].y = 3.15;
shotList[1].speed.x = 21.435;
shotList[1].speed.y = -42.87;
shotList[1].useList = [false, false, false, false, false, false];
shotList[3] = new Object();
shotList[3].speed = new Object();
shotList[3].x = -49.2;
shotList[3].y = 85.7;
shotList[3].speed.x = 9.045;
shotList[3].speed.y = 63.81;
shotList[3].useList = [true, false, false, false, false, false];
shotList[4] = new Object();
shotList[4].speed = new Object();
shotList[4].x = -30.15;
shotList[4].y = -88.9;
shotList[4].speed.x = 9.045;
shotList[4].speed.y = -47.625;
shotList[4].useList = [false, false, false, true, false, false];
shotList[5] = new Object();
shotList[5].speed = new Object();
shotList[5].x = 406.45;
shotList[5].y = -60.35;
shotList[5].speed.x = -2.385;
shotList[5].speed.y = -43.35;
shotList[5].useList = [false, false, false, false, false, false];
shotList[6] = new Object();
shotList[6].speed = new Object();
shotList[6].x = -12.7;
shotList[6].y = -71.45;
shotList[6].speed.x = 14.76;
shotList[6].speed.y = -38.1;
shotList[6].useList = [false, false, false, false, false, false];
shotList[7] = new Object();
shotList[7].speed = new Object();
shotList[7].x = -298.45;
shotList[7].y = -71.45;
shotList[7].speed.x = 23.34;
shotList[7].speed.y = -39.525;
shotList[7].useList = [false, false, false, false, false, false];
shotList[9] = new Object();
shotList[9].speed = new Object();
shotList[9].x = 34.95;
shotList[9].y = -69.85;
shotList[9].speed.x = 18.57;
shotList[9].speed.y = -30.48;
shotList[9].useList = [false, false, true, false, false, false];
shotList[10] = new Object();
shotList[10].speed = new Object();
shotList[10].x = -106.35;
shotList[10].y = -49.25;
shotList[10].speed.x = 12.855;
shotList[10].speed.y = -40.965;
shotList[10].useList = [false, false, false, false, false, false];
shotList[11] = new Object();
shotList[11].speed = new Object();
shotList[11].x = -260.35;
shotList[11].y = 15.85;
shotList[11].speed.x = 15.72;
shotList[11].speed.y = -49.53;
shotList[11].useList = [false, false, false, true, false, false];
shotList[13] = new Object();
shotList[13].speed = new Object();
shotList[13].x = -252.4;
shotList[13].y = 109.55;
shotList[13].speed.x = 21.915;
shotList[13].speed.y = 60.495;
shotList[13].useList = [true, false, false, false, false, false];
shotList[14] = new Object();
shotList[14].speed = new Object();
shotList[14].x = -168.25;
shotList[14].y = 30.15;
shotList[14].speed.x = 23.34;
shotList[14].speed.y = -35.715;
shotList[14].useList = [false, false, false, false, false, false];
shotList[15] = new Object();
shotList[15].speed = new Object();
shotList[15].x = -203.2;
shotList[15].y = -33.35;
shotList[15].speed.x = 6.66;
shotList[15].speed.y = -56.205;
shotList[15].useList = [true, false, false, false, false, false];
shotList[16] = new Object();
shotList[16].speed = new Object();
shotList[16].x = -42.85;
shotList[16].y = 73;
shotList[16].speed.x = 17.625;
shotList[16].speed.y = -38.58;
shotList[16].useList = [false, false, false, false, false, false];
shotList[18] = new Object();
shotList[18].speed = new Object();
shotList[18].x = -123.8;
shotList[18].y = -88.9;
shotList[18].speed.x = 16.68;
shotList[18].speed.y = -34.29;
shotList[18].useList = [false, false, false, false, false, false];
shotList[22] = new Object();
shotList[22].speed = new Object();
shotList[22].x = -300.05;
shotList[22].y = 26.95;
shotList[22].speed.x = 22.86;
shotList[22].speed.y = 62.385;
shotList[22].useList = [true, false, false, false, false, false];
shotList[23] = new Object();
shotList[23].speed = new Object();
shotList[23].x = 33.35;
shotList[23].y = -90.5;
shotList[23].speed.x = 10.005;
shotList[23].speed.y = -36.195;
shotList[23].useList = [false, false, false, false, true, false];
shotList[24] = new Object();
shotList[24].speed = new Object();
shotList[24].x = 41.3;
shotList[24].y = -95.25;
shotList[24].speed.x = 9.045;
shotList[24].speed.y = -36.195;
shotList[24].useList = [false, false, false, false, true, false];
shotList[25] = new Object();
shotList[25].speed = new Object();
shotList[25].x = -98.4;
shotList[25].y = -90.5;
shotList[25].speed.x = 9.06;
shotList[25].speed.y = -54.765;
shotList[25].useList = [false, false, false, true, true, false];
shotList[26] = new Object();
shotList[26].speed = new Object();
shotList[26].x = -26.95;
shotList[26].y = 69.85;
shotList[26].speed.x = 14.295;
shotList[26].speed.y = -44.76;
shotList[26].useList = [false, false, true, false, false, false];
shotList[27] = new Object();
shotList[27].speed = new Object();
shotList[27].x = 182.6;
shotList[27].y = 23.8;
shotList[27].speed.x = 1.425;
shotList[27].speed.y = -55.245;
shotList[27].useList = [false, false, false, true, false, false];
shotList[29] = new Object();
shotList[29].speed = new Object();
shotList[29].x = -204.8;
shotList[29].y = 44.45;
shotList[29].speed.x = 18.09;
shotList[29].speed.y = -42.855;
shotList[29].useList = [false, false, false, false, false, false];
shotList[30] = new Object();
shotList[30].speed = new Object();
shotList[30].x = 122.25;
shotList[30].y = 4.75;
shotList[30].speed.x = 5.235;
shotList[30].speed.y = 62.865;
shotList[30].useList = [true, false, false, false, false, false];
shotList[31] = new Object();
shotList[31].speed = new Object();
shotList[31].x = 33.35;
shotList[31].y = 25.4;
shotList[31].speed.x = 10.47;
shotList[31].speed.y = -46.2;
shotList[31].useList = [false, false, true, false, false, false];
shotList[32] = new Object();
shotList[32].speed = new Object();
shotList[32].x = -96.85;
shotList[32].y = 60.3;
shotList[32].speed.x = 12.855;
shotList[32].speed.y = -43.815;
shotList[32].useList = [false, false, false, false, false, false];
shotList[34] = new Object();
shotList[34].speed = new Object();
shotList[34].x = 150.85;
shotList[34].y = 46;
shotList[34].speed.x = 5.25;
shotList[34].speed.y = -41.445;
shotList[34].useList = [false, false, false, false, false, false];
shotList[35] = new Object();
shotList[35].speed = new Object();
shotList[35].x = -146.05;
shotList[35].y = 15.85;
shotList[35].speed.x = 13.815;
shotList[35].speed.y = -50.49;
shotList[35].useList = [false, false, false, false, false, false];
shotList[36] = new Object();
shotList[36].speed = new Object();
shotList[36].x = 4.8;
shotList[36].y = -19.05;
shotList[36].speed.x = 10.965;
shotList[36].speed.y = -38.1;
shotList[36].useList = [false, false, false, false, false, false];
shotList[8] = new Object();
shotList[8].speed = new Object();
shotList[8].x = -293.7;
shotList[8].y = 3.15;
shotList[8].speed.x = 21.435;
shotList[8].speed.y = -47.625;
shotList[8].useList = [false, false, false, false, false, false];
shotList[19] = new Object();
shotList[19].speed = new Object();
shotList[19].x = 447.7;
shotList[19].y = -28.6;
shotList[19].speed.x = -4.28999999999999;
shotList[19].speed.y = -43.35;
shotList[19].useList = [false, false, false, false, false, true];
shotList[21] = new Object();
shotList[21].speed = new Object();
shotList[21].x = 454.05;
shotList[21].y = -55.6;
shotList[21].speed.x = -3.81;
shotList[21].speed.y = -53.82;
shotList[21].useList = [false, false, false, false, false, false];
shotList[28] = new Object();
shotList[28].speed = new Object();
shotList[28].x = -296.9;
shotList[28].y = -17.5;
shotList[28].speed.x = -29.535;
shotList[28].speed.y = -52.875;
shotList[28].useList = [false, true, false, false, false, false];
shotList[37] = new Object();
shotList[37].speed = new Object();
shotList[37].x = -271.5;
shotList[37].y = -28.6;
shotList[37].speed.x = 15.72;
shotList[37].speed.y = -53.34;
shotList[37].useList = [false, false, false, true, false, false];
shotList[38] = new Object();
shotList[38].speed = new Object();
shotList[38].x = -271.5;
shotList[38].y = -39.7;
shotList[38].speed.x = 7.62000000000001;
shotList[38].speed.y = -60.015;
shotList[38].useList = [true, false, false, true, false, false];
shotList[44] = new Object();
shotList[44].speed = new Object();
shotList[44].x = -300.05;
shotList[44].y = -54;
shotList[44].speed.x = 15.24;
shotList[44].speed.y = -51.435;
shotList[44].useList = [false, false, false, false, true, false];
shotList[39] = new Object();
shotList[39].speed = new Object();
shotList[39].x = 139.7;
shotList[39].y = 12.7;
shotList[39].speed.x = 4.29;
shotList[39].speed.y = 68.595;
shotList[39].useList = [true, false, false, false, false, false];
shotList[40] = new Object();
shotList[40].speed = new Object();
shotList[40].x = -223.85;
shotList[40].y = -90.5;
shotList[40].speed.x = 11.91;
shotList[40].speed.y = -57.15;
shotList[40].useList = [false, false, false, true, true, false];
shotList[42] = new Object();
shotList[42].speed = new Object();
shotList[42].x = -128.6;
shotList[42].y = -12.7;
shotList[42].speed.x = 17.625;
shotList[42].speed.y = 59.07;
shotList[42].useList = [true, false, true, false, false, false];
shotList[43] = new Object();
shotList[43].speed = new Object();
shotList[43].x = -9.55;
shotList[43].y = 77.8;
shotList[43].speed.x = 11.91;
shotList[43].speed.y = -40.95;
shotList[43].useList = [false, false, false, false, false, false];
for (var i in shotList) {
shotList[i].x = shotList[i].x + 32.2;
}
function ballproperties() {
ball.rad = 57.2957795130823;
ball.span = ball._width / 2;
ball.active = false;
ball.rot = 0;
ball._rotation = 0;
ball.prevelocity = 0;
ball.maxVelocity = 200;
ball.elastic = 0.7;
ball.heft = 200000000000;
ball.speed = new Object();
ball.speed.y = 0;
ball.speed.x = 0;
ball.mass = (ball._width * ball._width) * ball._width;
ball.id = i;
ball.friction = 0;
ball.hitDistance = new Array();
ball.wallDistance = new Array();
ball.bumperDistance = new Array();
ball.cornerDistance = new Array();
ball.perpVector = new Object();
}
refreshAds = function () {
_root.scores.scripting.adTime = getTimer();
outgoing_lc = new LocalConnection();
outgoing_lc.send("_lc_name", "refreshAds", "Test var");
delete outgoing_lc;
};
startResult = function (what) {
result = what;
if (shower.resulter._currentframe == 1) {
shower.resulter.gotoAndPlay("in");
}
if (_root.variant == "freethrow") {
if (freethrowShower.resulter._currentframe == 1) {
freethrowShower.resulter.gotoAndPlay("in");
}
}
};
init = function () {
var _local2 = _root;
resultShown = false;
itsAgoodShot = false;
myAnchorSpot = -100 + random(15);
confirmation = false;
game.data.dragging = false;
flyConfirm = false;
doneChecking = true;
hitGround = false;
hitBackboard = false;
hitGarage = false;
hitRoof = false;
hitRim = false;
waitingToCheck = false;
moonshot = false;
pendingGood = false;
anchor._visible = false;
shower.resulter.gotoAndPlay("out");
if (_local2.variant == "freethrow") {
if (freethrowShower.resulter._currentframe == 5) {
freethrowShower.resulter.gotoAndPlay("out");
}
}
if (alreadyMade) {
goodBasket = false;
}
alreadyMade = false;
if (goodBasket) {
alreadyMade = true;
var _local1 = message;
if (thrower == gameInfo.playerID) {
message = ("You need to make this to avoid getting an " + letters[meScore]) + ".";
} else {
message = ((gameInfo.him + " needs to make this to avoid getting an ") + letters[youScore]) + ".";
}
if (_local1.length > 0) {
message = (_local1 + "\r") + message;
}
} else {
useGround = false;
useBackboard = false;
useGarage = false;
useRoof = false;
swish = false;
useList = [false, false, false, false, false, false];
leftScreen = false;
message = "";
}
enmeshed = false;
flying = false;
dragging = false;
shooting = false;
gravity = 2.5;
balls = 1;
maxSpring = 37;
walls = 0;
boxes = 4;
bumpers = 3;
corners = 2;
iterations = 3;
bounces = 0;
goodBasket = false;
initNet();
ballproperties();
if ((thrower == 1) and (_local2.mode == "computer")) {
brain.gotoAndPlay("move");
}
if ((aroundShot == 5) and (_local2.variant == "around")) {
}
unhookAnchor();
};
unhookAnchor = function () {
var _local1 = _root;
tester = (((!dragging) and (!flying)) and (!shooting)) and (gameInfo.playerID == thrower);
if (((((!dragging) and (!flying)) and (!shooting)) and (gameInfo.playerID == thrower)) and ((!alreadyMade) or (_local1.variant == "around"))) {
if (_local1.variant == "freethrow") {
anchor._x = myAnchorSpot;
anchor._x = aroundPosition[aroundShot];
} else if (_local1.variant == "around") {
anchor._x = aroundPosition[aroundShot];
} else {
anchor._x = _xmouse;
}
anchor._y = _ymouse;
}
if ((_xmouse < 412) and (Selection.getFocus() == "_level0.lobby.sender")) {
Selection.setFocus(null);
}
};
gameInit = function () {
resultShown = false;
playAgain._visible = false;
whosTurn = "0.00";
timing = false;
gameOver = false;
if ((_root.variant == "around") || (_root.variant == "freethrow")) {
aroundShot = 0;
aroundPosition = [150, -80, -265, -80];
updateMessage();
anchor._x = aroundPosition[aroundShot];
}
letters = ["H", "O", "R", "S", "E"];
_parent.leaver._visible = false;
_parent.gameOver._visible = false;
game.data.thrower = 0;
thrower = 0;
mescore = 0;
youscore = 0;
playAgains = 0;
if (_root.variant == "freethrow") {
meDisplay = 0;
} else if (_parent.mode != "practice") {
meDisplay = "-----";
youDisplay = "-----";
} else {
meDisplay = "";
youDisplay = "";
}
main.closeMessage = "";
resetModule._visible = false;
resetModule.gotoAndStop(1);
if (gameInfo.playerID == thrower) {
var _local3 = new Object();
_local3.x = anchor._x;
_local3.y = anchor._y;
_local3.dragging = false;
game.data.anchor = _local3;
var _local2 = new Object();
_local2.x = ball._x;
_local2.y = ball._y;
_local2.dragging = false;
_local2.flying = false;
_local2.culprit = "init";
var _local1 = new Object();
_local1.x = ball._x;
_local1.y = ball._y;
_local1.dragging = false;
_local1.flying = false;
_local1.culprit = "init";
game.data.shot = _local1;
game.data.playAgain0 = 0;
game.data.playAgain1 = 0;
game.data.useList = new Array();
}
assignNames();
init();
if (_root.variant == "around") {
useList = [false, false, false, false, false, false];
alreadymade = false;
goodbasket = false;
message = "Clock starts after first shot";
}
};
newAroundGame = function () {
startResult("ITS GOOD!");
goodBasket = false;
alreadyMade = false;
playAgain._visible = true;
};
assignNames = function () {
if (id == 0) {
name0 = "You";
name1 = gameInfo.him;
name1 = "Computer";
} else {
name1 = "You";
name0 = gameInfo.him;
}
};
netspring = function (n) {
var _local1 = n;
var _local2 = 0.2;
var _local3 = (_local1.parent._x + _local1.child._x) / 2;
if (_local1.id == 3) {
_local3 = _local1.parent._x;
}
var diff = (_local3 - _local1._x);
var force = ((diff * _local2) * 2);
_local1.speed.x = _local1.speed.x + force;
_local1.speed.x = _local1.speed.x * 0.65;
var diff = (_local1.parent._y - _local1._y);
var force = ((diff * _local2) * 1.3);
_local1.speed.y = _local1.speed.y + force;
_local1.speed.y = _local1.speed.y + (gravity * 2);
_local1.speed.y = _local1.speed.y * 0.65;
_local1._x = _local1._x + _local1.speed.x;
_local1._y = _local1._y + _local1.speed.y;
};
widthcheck = function (n) {
var _local1 = n;
var _local2 = Math.abs(ball._width / 2);
var _local3 = Math.abs(_local1._y - ball._y);
if (_local3 < _local2) {
var far = (Math.sqrt((_local2 * _local2) - (_local3 * _local3)) * 2);
if (_local1._width < far) {
var ratio = (far / _local1._width);
_local1._xscale = ratio * _local1.startScale;
} else {
_local1._xscale = _local1.startScale;
}
} else {
_local1._xscale = _local1.startScale;
}
};
ballcheck = function (n) {
var _local1 = n;
var _local2 = Math.abs(ball._x - _local1.x) < ((_local1._width / 2) - (ball._width / 2));
if ((((((ball._y > _local1.parent._y) and (ball._y <= _local1._y)) or (((ball._y > _local1._y) and (ball._y <= (_local1._y + _local1.diff))) and (_local1.child != undefined))) and (!_local2)) and ball.hitTest(cylander)) and pendingGood) {
widthCheck(_local1);
if (ball._x > _local1._x) {
_local1._x = (ball._x + (ball._width / 2)) - (_local1._width / 2);
} else {
_local1._x = (ball._x - (ball._width / 2)) + (_local1._width / 2);
}
var _local3 = Math.abs(_local1._x - _local1.parent._x);
_local1._y = (_local1.parent._y + _local1.diff) - _local3;
ball.speed.x = ball.speed.x * 0.75;
ball.speed.y = ball.speed.y - 10;
ball.speed.y = Math.max(4, ball.speed.y);
} else {
if (enmeshed) {
widthCheck(_local1);
}
netspring(_local1);
}
};
rotate = function (n) {
var _local1 = n;
var _local2 = _local1.parent._x - _local1._x;
_local1._rotation = _local2 * 1.95;
};
drawNet = function () {
var _local1 = 0;
while (_local1 < net.length) {
var _local3 = net[_local1]._width / 2;
net[_local1].left = new Object();
net[_local1].left.x = net[_local1]._x - (Math.cos(net[_local1]._rotation / ball.rad) * _local3);
net[_local1].left.y = net[_local1]._y - (Math.sin(net[_local1]._rotation / ball.rad) * _local3);
net[_local1].right = new Object();
net[_local1].right.x = net[_local1]._x + (Math.cos(net[_local1]._rotation / ball.rad) * _local3);
net[_local1].right.y = net[_local1]._y + (Math.sin(net[_local1]._rotation / ball.rad) * _local3);
segx = (net[_local1].right.x - net[_local1].left.x) / (node[_local1].length - 1);
segy = (net[_local1].right.y - net[_local1].left.y) / (node[_local1].length - 1);
var _local2 = 0;
while (_local2 < node[_local1].length) {
node[_local1][_local2].x = net[_local1].left.x + (_local2 * segx);
node[_local1][_local2].y = net[_local1].left.y + (_local2 * segy);
_local2++;
}
_local1++;
}
shape.clear();
shape.lineStyle(2, 16777215, 100);
shape.beginFill();
shape.moveTo(node[0][0].x, node[0][0].y);
shape.LineTo(node[1][0].x, node[1][0].y);
shape.LineTo(node[2][0].x, node[2][0].y);
shape.LineTo(node[3][1].x, node[3][1].y);
shape.LineTo(node[2][2].x, node[2][2].y);
shape.LineTo(node[1][5].x, node[1][5].y);
shape.LineTo(node[0][3].x, node[0][3].y);
shape.LineTo(node[0][2].x, node[0][2].y);
shape.LineTo(node[1][4].x, node[1][4].y);
shape.LineTo(node[2][2].x, node[2][2].y);
shape.LineTo(node[3][2].x, node[3][2].y);
shape.LineTo(node[2][1].x, node[2][1].y);
shape.LineTo(node[1][2].x, node[1][2].y);
shape.LineTo(node[0][1].x, node[0][1].y);
shape.LineTo(node[1][1].x, node[1][1].y);
shape.LineTo(node[2][0].x, node[2][0].y);
shape.LineTo(node[3][0].x, node[3][0].y);
shape.LineTo(node[2][1].x, node[2][1].y);
shape.LineTo(node[1][3].x, node[1][3].y);
shape.LineTo(node[0][2].x, node[0][2].y);
shape.endFill();
shape2.clear();
shape2.lineStyle(1, 5400693, 100);
shape2.beginFill();
shape2.moveTo(node[0][0].x, node[0][0].y);
shape2.LineTo(node[1][0].x, node[1][0].y);
shape2.LineTo(node[2][0].x, node[2][0].y);
shape2.LineTo(node[3][1].x, node[3][1].y);
shape2.LineTo(node[2][2].x, node[2][2].y);
shape2.LineTo(node[1][5].x, node[1][5].y);
shape2.LineTo(node[0][3].x, node[0][3].y);
shape2.LineTo(node[0][2].x, node[0][2].y);
shape2.LineTo(node[1][4].x, node[1][4].y);
shape2.LineTo(node[2][2].x, node[2][2].y);
shape2.LineTo(node[3][2].x, node[3][2].y);
shape2.LineTo(node[2][1].x, node[2][1].y);
shape2.LineTo(node[1][2].x, node[1][2].y);
shape2.LineTo(node[0][1].x, node[0][1].y);
shape2.LineTo(node[1][1].x, node[1][1].y);
shape2.LineTo(node[2][0].x, node[2][0].y);
shape2.LineTo(node[3][0].x, node[3][0].y);
shape2.LineTo(node[2][1].x, node[2][1].y);
shape2.LineTo(node[1][3].x, node[1][3].y);
shape2.LineTo(node[0][2].x, node[0][2].y);
shape2.endFill();
};
doPlayAgainIncrement = function (value) {
if (value == 1) {
playAgains++;
if (playagains >= 2) {
gameInit();
}
}
};
doTime = function () {
time++;
whosTurn = (int((time / 25) * 100) / 100) + (random(5) / 100);
};
startClock = function () {
timing = true;
time = 0;
doTime();
};
doWhosTurn = function () {
var _local1 = _parent;
if (_local1.mode == "practice") {
if (_root.variant != "around") {
whosTurn = "";
}
if (_root.variant == "none") {
shower.youLabel._visible = false;
}
} else if (gameInfo.playerID == thrower) {
_local1.chatter._visible = true;
if (alreadyMade) {
_local1.chatter._visible = false;
}
whosTurn = "Your Turn";
} else {
_local1.chatter._visible = false;
whosTurn = gameInfo.him + "'s Turn";
}
};
distance = function (x1, y1, x2, y2) {
distx = x1 - x2;
disty = y1 - y2;
return(Math.sqrt((distx * distx) + (disty * disty)));
};
doKeys = function () {
if (_root.variant == "none") {
trace("KEY " + Key.getCode());
if (Key.isDown(66) and (!pressing66)) {
if (useList[2]) {
removeFromUseList(2);
} else if (((((!flying) and (gameInfo.playerID == thrower)) and (Selection.getFocus() != "_level0.lobby.sender")) and (!useList[2])) and (!alreadyMade)) {
addToUseList(2);
}
pressing66 = true;
}
if (!Key.isDown(66)) {
pressing66 = false;
}
if (Key.isDown(71) and (!pressing71)) {
if (useList[0]) {
removeFromUseList(0);
} else if (((((!flying) and (gameInfo.playerID == thrower)) and (Selection.getFocus() != "_level0.lobby.sender")) and (!useList[0])) and (!alreadyMade)) {
addToUseList(0);
}
pressing71 = true;
}
if (!Key.isDown(71)) {
pressing71 = false;
}
if (Key.isDown(87) and (!pressing87)) {
if (useList[1]) {
removeFromUseList(1);
} else if (((((!flying) and (gameInfo.playerID == thrower)) and (Selection.getFocus() != "_level0.lobby.sender")) and (!useList[1])) and (!alreadyMade)) {
addToUseList(1);
}
pressing87 = true;
}
if (!Key.isDown(87)) {
pressing87 = false;
}
if (Key.isDown(83) and (!pressing83)) {
if (useList[4]) {
removeFromUseList(4);
} else if (((((!flying) and (gameInfo.playerID == thrower)) and (Selection.getFocus() != "_level0.lobby.sender")) and (!useList[4])) and (!alreadyMade)) {
addToUseList(4);
}
pressing83 = true;
}
if (!Key.isDown(83)) {
pressing83 = false;
}
if (Key.isDown(77) and (!pressing77)) {
if (useList[3]) {
removeFromUseList(3);
} else if (((((!flying) and (gameInfo.playerID == thrower)) and (Selection.getFocus() != "_level0.lobby.sender")) and (!useList[3])) and (!alreadyMade)) {
addToUseList(3);
}
pressing77 = true;
}
if (!Key.isDown(77)) {
pressing77 = false;
}
if (Key.isDown(69) and (!pressing69)) {
if (useList[5]) {
removeFromUseList(5);
} else if ((((((((!flying) and (gameInfo.playerID == thrower)) and (Selection.getFocus() != "_level0.lobby.sender")) and (!useList[5])) and (!alreadyMade)) and (!dragging)) and (!flying)) and (!shooting)) {
addToUseList(5);
}
pressing69 = true;
}
if (!Key.isDown(69)) {
pressing69 = false;
}
}
};
doPress = function () {
if (((thrower == gameInfo.playerID) and (!flying)) and (!_parent.locked)) {
_parent.hideChatter();
game.data.dragging = true;
var _local1 = new Object();
_local1.x = anchor._x;
_local1.y = anchor._y;
_local1.dragging = true;
game.data.anchor = _local1;
if (useList[5]) {
eyes.gotoAndPlay("close");
_root.rim._visible = false;
}
anchor._visible = true;
dragging = true;
startDrag (ball, true);
sizeAnchor();
}
};
doRelease = function () {
var _local3 = _root;
trace("Doing Release");
if ((!flying) and (!_parent.locked)) {
var mult = 0.3;
var power = distance(anchor._x, anchor._y, ball._x, ball._y);
power = Math.min(power, 50);
trace("power=" + power);
if (power > 40) {
if (_local3.variant == "around") {
message = "";
}
if (_local3.variant == "freethrow") {
itsAGoodShot = false;
gameOver = false;
}
if (thrower == gameInfo.playerID) {
var _local1 = new Object();
_local1.x = anchor._x;
_local1.y = anchor._y;
_local1.speed = new Object();
_local1.speed.x = (anchor._x - ball._x) * mult;
_local1.speed.y = (anchor._y - ball._y) * mult;
_local1.culprit = "dragger";
game.data.shot = _local1;
stopDrag();
}
if ((_local3.mode == "practice") or ((_local3.mode == "computer") and (thrower == gameInfo.playerID))) {
stopDrag();
if ((aroundShot == 0) and (_local3.variant == "around")) {
startClock();
}
if (useList[5]) {
eyes.gotoAndPlay("open");
_local3.rim._visible = true;
}
waitingToChuck = false;
anchor._visible = false;
dragging = false;
shooting = false;
flying = true;
ball.speed.x = (anchor._x - ball._x) * mult;
ball.speed.y = (anchor._y - ball._y) * mult;
ball._x = anchor._x;
ball._y = anchor._y;
originalx = ball._x;
originaly = ball._y;
var _local2 = 100;
if ((ball.speed.x > _local2) || (ball.speed.x < (-_local2))) {
myDiffuse = Math.abs(ball.speed.x / _local2);
ball.speed.x = ball.speed.x / myDiffuse;
ball.speed.y = ball.speed.y / myDiffuse;
}
if ((ball.speed.y > _local2) || (ball.speed.y < (-_local2))) {
myDiffuse = Math.abs(ball.speed.y / _local2);
ball.speed.x = ball.speed.x / myDiffuse;
ball.speed.y = ball.speed.y / myDiffuse;
}
originalspeedx = ball.speed.x;
originalspeedy = ball.speed.y;
trace("speedy=" + originalspeedy);
trace("speedx=" + originalspeedx);
originalUseList = useList;
}
} else if (thrower == gameInfo.playerID) {
game.data.dragging = false;
if (useList[5]) {
eyes.gotoAndPlay("open");
_local3.rim._visible = true;
}
anchor._visible = false;
dragging = false;
stopDrag();
}
}
};
isABasket = function () {
var _local2 = _root;
var _local1 = new Object();
_local1 = ball.getIntersection(ball._x, ball._y, ball._x + ball.speed.x, ball._y + ball.speed.y, bumper0._x, bumper0._y, bumper1._x, bumper1._y);
if (((((!pendingGood) and (ball._y < bumper0._y)) and ((ball._y + ball.speed.y) > bumper0._y)) and (_local1.x > bumper0._x)) and (_local1.x < bumper1._x)) {
pendingGood = true;
enmeshed = true;
bounces = 0;
vol = ball.speed.y * 2;
if (vol > 5) {
_local2.sounds.instance[3].setVolume(vol);
_local2.sounds.volumes[3] = vol;
_local2.sounds.goals[3] = vol;
_local2.sounds.net.start();
}
}
};
moveNet = function () {
var _local1 = 1;
while (_local1 < net.length) {
ballcheck(net[_local1]);
rotate(net[_local1]);
_local1++;
}
drawNet();
};
spring = function () {
var _local2 = 0.25;
var diff = (anchor._x - ball._x);
var force = (diff * _local2);
ball.speed.x = ball.speed.x + force;
ball.speed.x = ball.speed.x * 0.8;
var diff = (anchor._y - ball._y);
var force = (diff * _local2);
ball.speed.y = ball.speed.y + force;
ball.speed.y = ball.speed.y * 0.8;
var _local3 = distance(0, 0, ball.speed.x, ball.speed.y);
if ((_local3 > maxSpring) and (!shooting)) {
var _local1 = maxSpring / _local3;
ball.speed.y = ball.speed.y * _local1;
ball.speed.x = ball.speed.x * _local1;
}
ball._x = ball._x + ball.speed.x;
ball._y = ball._y + ball.speed.y;
ball._x = Math.max(ball._x, -358);
ball._x = Math.min(ball._x, 490);
ball._y = Math.max(ball._y, -96);
ball._y = Math.min(ball._y, 146);
};
initNet = function () {
net = [net0, net1, net2, net3];
i = 1;
while (i < net.length) {
net[i].parent = net[i - 1];
net[i].child = net[i + 1];
net[i].id = i;
net[i].speed = new Object();
net[i].speed.x = 0;
net[i].speed.y = 0;
net[i].x = net[i]._x;
net[i].y = net[i]._y;
net[i].startScale = net[i]._xscale;
net[i].diff = net[i]._y - net[i].parent._y;
i++;
}
net[3].child = null;
node = new Array();
node[0] = new Array();
node[0][0] = new Object();
node[0][0].x = 0;
node[0][0].y = 0;
node[0][1] = new Object();
node[0][1].x = 0;
node[0][1].y = 0;
node[0][2] = new Object();
node[0][2].x = 0;
node[0][2].y = 0;
node[0][3] = new Object();
node[0][3].x = 0;
node[0][3].y = 0;
node[1] = new Array();
node[1][0] = new Object();
node[1][0].x = 0;
node[1][0].y = 0;
node[1][1] = new Object();
node[1][1].x = 0;
node[1][1].y = 0;
node[1][2] = new Object();
node[1][2].x = 0;
node[1][2].y = 0;
node[1][3] = new Object();
node[1][3].x = 0;
node[1][3].y = 0;
node[1][4] = new Object();
node[1][4].x = 0;
node[1][4].y = 0;
node[1][5] = new Object();
node[1][5].x = 0;
node[1][5].y = 0;
node[2] = new Array();
node[2][0] = new Object();
node[2][0].x = 0;
node[2][0].y = 0;
node[2][1] = new Object();
node[2][1].x = 0;
node[2][1].y = 0;
node[2][2] = new Object();
node[2][2].x = 0;
node[2][2].y = 0;
node[3] = new Array();
node[3][0] = new Object();
node[3][0].x = 0;
node[3][0].y = 0;
node[3][1] = new Object();
node[3][1].x = 0;
node[3][1].y = 0;
node[3][2] = new Object();
node[3][2].x = 0;
node[3][2].y = 0;
};
testSpecs = function () {
result = true;
if ((hitBackboard or hitRim) and useList[4]) {
result = false;
}
if (hitGround and (!useList[0])) {
result = false;
}
if (bounces > 1) {
result = false;
}
if ((!hitGround) and useList[0]) {
result = false;
}
if ((!hitGarage) and useList[1]) {
result = false;
}
if ((!hitBackboard) and useList[2]) {
result = false;
}
if ((!moonshot) and useList[3]) {
result = false;
}
return(result);
};
determineSpecs = function (which) {
var _local1 = which;
if (!goodBasket) {
if (_local1 == "box1") {
if (!hitBackboard) {
hitBackboard = true;
}
}
if ((_local1 == "bumper0") or (_local1 == "bumper1")) {
if (!hitRim) {
hitRim = true;
}
}
if (_local1 == "box3") {
if (!hitGarage) {
hitGarage = true;
}
}
if (((_local1 == "bumper2") or (_local1 == "box4")) or (_local1 == "corner0")) {
if (!hitRoof) {
hitRoof = true;
}
}
if ((((_local1 == "bumper3") or (_local1 == "bumper4")) or (_local1 == "bumper5")) or (_local1 == "box0")) {
if (!hitGround) {
hitGround = true;
}
}
}
};
updateMessage = function () {
message = "";
var _local2 = new Array();
var _local1 = 0;
while (_local1 < useList.length) {
if (useList[_local1]) {
_local2.push(useText[_local1]);
}
_local1++;
}
if (_local2.length > 0) {
if (_local2.length == 1) {
message = _local2[0];
} else if (_local2.length == 2) {
message = (_local2[0] + " and ") + _local2[1];
} else {
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
message = message + (_local2[_local1] + ", ");
_local1++;
}
message = message + ("and " + _local2[_local2.length - 1]);
}
}
var _local3 = message.charAt(0).toUpperCase();
message = _local3 + message.slice(1);
};
addChat = function (message) {
_root.lobby.addChat((gameInfo.playerId + ": ") + message);
};
addToUseList = function (what) {
if (!alreadyMade) {
useList[what] = true;
updateMessage();
game.data.useList = useList;
}
};
removeFromUseList = function (what) {
if (!alreadyMade) {
useList[what] = false;
updateMessage();
game.data.useList = useList;
}
};
checkGameOver = function () {
victoryCondition = 5;
if ((meScore >= victoryCondition) or (youScore >= victoryCondition)) {
gameOver = true;
_parent.trackingGameOver();
if (meScore < victoryCondition) {
resetModule.victor = "You Won!!";
resetModule.againText = "Play Again?";
} else {
resetModule.victor = gameInfo.him + " Won!!";
resetModule.againText = "Play Again?";
}
resetModule._visible = true;
}
};
checkBounces = function () {
var _local1 = _root;
if ((!goodBasket) and (!gameOver)) {
if (useList[0]) {
if (bounces > 1) {
resultShown = true;
startResult("NO GOOD!");
}
} else if (bounces > 0) {
resultShown = true;
startResult("NO GOOD!");
}
}
var _local2 = 3;
if (_local1.variant == "around") {
_local2 = 1;
}
if ((bounces == 1) and (_local1.variant != "around")) {
adcount++;
if ((adcount % 3) == 0) {
refreshAds();
}
}
if ((bounces >= _local2) and (!gameOver)) {
if (_local1.variant == "freethrow") {
trace("used up bounces");
if (!itsAGoodShot) {
trace("not a good shot");
checkFreethrows(false);
} else {
message = "Huh?";
init();
}
}
if (_parent.mode != "practice") {
if (((!goodBasket) and alreadyMade) and (_local1.mode != "online")) {
if (thrower == gameInfo.playerID) {
if (meDisplay == "-----") {
meDisplay = "";
}
meDisplay = meDisplay + letters[mescore];
meScore++;
} else {
if (youDisplay == "-----") {
youDisplay = "";
}
youDisplay = youDisplay + letters[youscore];
youScore++;
}
checkGameOver();
}
if (_local1.mode == "online") {
if (thrower == gameInfo.playerID) {
game.data.thrower = 1 - thrower;
}
} else {
thrower = 1 - thrower;
}
} else {
alreadyMade = false;
goodBasket = false;
}
if (((!gameOver) and (!waitingToCheck)) and (_local1.mode != "online")) {
init();
}
}
if (gameOver) {
ball.speed.x = ball.speed.x * 0.95;
ball.speed.y = ball.speed.y * 0.95;
}
};
moveShadow = function () {
var _local1 = shadow.start - ball._y;
shadow._x = ball._x + (_local1 * 0.2);
shadow._x = ball._x;
shadow2._x = ball._x + 40;
};
sizeAnchor = function () {
anchor._xscale = distance(anchor._x, anchor._y, ball._x, ball._y);
var _local1 = anchor._y - ball._y;
anchor._rotation = Math.asin(_local1 / anchor._xscale) * ball.rad;
if (ball._x > anchor._x) {
anchor._rotation = (-anchor._rotation) + 180;
}
};
addToShots = function () {
trace(("shotList[" + shotCount) + "] = new Object();");
trace(("shotList[" + shotCount) + "].speed = new Object();");
trace(((("shotList[" + shotCount) + "].x = ") + originalx) + ";");
trace(((("shotList[" + shotCount) + "].y = ") + originaly) + ";");
trace(((("shotList[" + shotCount) + "].speed.x = ") + originalspeedx) + ";");
trace(((("shotList[" + shotCount) + "].speed.y = ") + originalspeedy) + ";");
trace(((("shotList[" + shotCount) + "].useList = [") + originalUseList) + "];");
shotCount++;
};
checkFreeThrows = function (res) {
if (_root.variant == "freethrow") {
trace("checkFreeThrows");
if (res) {
itsAGoodShot = true;
meDisplay++;
if (medisplay > youDisplay) {
youDisplay++;
}
} else if (!waitingToChuck) {
message = "testing score";
gameOver = true;
waitingToCheck = true;
waitingToChuck = true;
doneChecking = false;
_parent.game.reset();
}
}
};
hitGooder = function () {
var _local1 = _root;
if (gooder.hitTest(ball) and pendingGood) {
goodBasket = testSpecs();
if (goodBasket) {
startResult("ITS GOOD!");
if ((_local1.mode == "practice") and (!confirmation)) {
resultShown = true;
checkFreethrows(true);
if (_local1.variant == "around") {
aroundShot++;
if (AroundShot > 3) {
timing = false;
gameOver = true;
_local1.scores.scripting.test(whosTurn);
}
}
if (_local1.variant == "freethrow") {
aroundShot++;
if (AroundShot > 5) {
aroundShot = 0;
}
}
addToShots();
}
confirmation = true;
} else {
checkFreethrows(false);
result = "NO GOOD!";
resultShown = true;
}
}
};
computerShot = function () {
if (useList[5]) {
var _local3 = 8;
} else {
var _local3 = 4;
}
var _local1 = 5 + ((3 - _root.difficulty) * _local3);
var _local2 = int(_local1 / 2);
anchor._visible = false;
shooting = false;
flying = true;
dragging = false;
if (alreadyMade) {
ball._x = originalx;
ball._y = originaly;
ball.speed.x = (originalspeedx + random(_local1)) - _local2;
ball.speed.y = (originalspeedy + random(_local1)) - _local2;
updateMessage();
} else {
ball._x = shotList[r].x;
ball._y = shotList[r].y;
ball.speed.x = (shotList[r].speed.x + random(_local1)) - _local2;
ball.speed.y = (shotList[r].speed.y + random(_local1)) - _local2;
updateMessage();
}
};
computerEyes = function () {
computerEyesClosed = false;
var _local1 = random(2 + (_root.difficulty * 3));
if (_local1 == 2) {
computerEyesClosed = true;
}
};
computerDrag = function () {
dragging = true;
dragCount++;
anchor._visible = true;
if (dragCount <= 12) {
if (alreadyMade) {
ball._x = originalx - (dragspeedx * dragCount);
ball._y = originaly - (dragspeedy * dragCount);
useList = originalUseList;
updateMessage();
} else {
ball._x = shotList[r].x - (dragspeedx * dragCount);
ball._y = shotList[r].y - (dragspeedy * dragCount);
useList = shotList[r].useList;
if (computerEyesClosed) {
addToUseList(6);
}
updateMessage();
}
}
};
computerMove = function () {
anchor._visible = false;
dragCount = 0;
r = random(shotList.length);
if (alreadyMade) {
anchor._x = originalx;
anchor._y = originaly;
dragSpeedx = (originalspeedx * 3.33333333333333) * 0.0833333333333333;
dragSpeedy = (originalspeedy * 3.33333333333333) * 0.0833333333333333;
} else {
anchor._x = shotList[r].x;
anchor._y = shotList[r].y;
dragSpeedx = (shotList[r].speed.x * 3.33333333333333) * 0.0833333333333333;
dragSpeedy = (shotList[r].speed.y * 3.33333333333333) * 0.0833333333333333;
}
};
onEnterFrame = function () {
var _local2 = _parent;
modBG._visible = (message.length > 0) and (_local2.mode == "practice");
doKeys();
unhookAnchor();
releaser._x = anchor._x;
releaser._y = anchor._y;
doWhosTurn();
if ((!_local2.inProgress) and (_local2.mode == "online")) {
game.data.gameover = true;
_local2.leaver._visible = true;
_local2.resetModule._visible = false;
}
framecount++;
if ((gameInfo.playerId == thrower) or (_local2.mode != "online")) {
if ((!dragging) and (!flying)) {
spring();
if (((frameCount % 3) == 0) and (!shooting)) {
var _local3 = new Object();
_local3.x = anchor._x;
_local3.y = anchor._y;
_local3.dragging = game.data.anchor.dragging;
game.data.anchor = _local3;
}
}
if (dragging and ((frameCount % 3) == 0)) {
var _local1 = new Object();
_local1.x = ball._x;
_local1.y = ball._y;
_local1.dragging = true;
_local1.flying = false;
_local1.culprit = "dragger";
game.data.ball = _local1;
}
if (dragging) {
sizeAnchor();
}
if (shooting and ball.hitTest(releaser)) {
shooting = false;
flying = true;
pendingGood = false;
enmeshed = false;
var _local1 = new Object();
_local1.x = ball._x;
_local1.y = ball._y;
_local1.dragging = false;
_local1.flying = true;
_local1.speed = ball.speed;
_local1.culprit = "begin fly";
game.data.ball = _local1;
} else if (flying) {
ball.speed.y = ball.speed.y + gravity;
i = 0;
while (i < iterations) {
ball.resetCollisions();
ball.collisionDetection();
ball.collisionResponse();
isABasket();
ball.translate();
if (ball._y <= -409) {
moonshot = true;
}
i++;
}
}
} else if (flying) {
ball.speed.y = ball.speed.y + gravity;
i = 0;
while (i < iterations) {
ball.resetCollisions();
ball.collisionDetection();
ball.collisionResponse();
isABasket();
ball.translate();
if (ball._y <= -409) {
moonshot = true;
}
i++;
}
} else if (game.data.dragging) {
sizeAnchor();
anchor._visible = true;
} else {
anchor._visible = false;
spring();
}
if (aroundShot == 5) {
shotDisplay = "Final Shot";
} else if (aroundShot == 6) {
shotDisplay = "";
} else {
shotDisplay = Number(aroundShot) + 1;
shotDisplay = ("Shot " + shotDisplay) + " of 6";
}
moveNet();
moveShadow();
display._x = ball._x;
display._y = ball._y;
ball._alpha = 0;
hitGooder();
if (ball._y > 300) {
init();
}
if (waitingToCheck and doneChecking) {
init();
}
if (timing) {
doTime();
}
};
if (_root.mode == "computer") {
gameInfo = new Object();
gameInfo.playerID = 0;
gameInfo.him = "Computer";
}
if (_parent.variant == "around") {
shower._visible = false;
freethrowShower._visible = false;
aroundShower._visible = true;
} else if (_parent.variant == "freethrow") {
shower._visible = false;
freethrowShower._visible = true;
aroundShower._visible = false;
} else {
shower._visible = true;
freethrowShower._visible = false;
aroundShower._visible = false;
}
shotcount = shotList.length;
shadow.start = shadow._y;
useText = ["off the ground", "off the wall", "off the backboard", "moonshot", "swish", "Eyes Closed"];
useList = [false, false, false, false, false, false];
tester = 0;
if (_parent.mode == "online") {
game = SharedObject.getRemote("game" + gameInfo.id, _root.lobby.client.uri, false);
game.connect(_parent.lobby.client);
game.onSync = function (info) {
var _local1 = info;
var _local2 = _root;
for (name in _local1) {
if ((_local1[name].name == "anchor") and (_local1[name].code == "change")) {
anchor._x = game.data.anchor.x;
anchor._y = game.data.anchor.y;
}
if ((_local1[name].name == "playAgain0") and ((_local1[name].code == "change") or (_local1[name].code == "success"))) {
doPlayAgainIncrement(game.data.playAgain0);
}
if ((_local1[name].name == "playAgain1") and ((_local1[name].code == "change") or (_local1[name].code == "success"))) {
doPlayAgainIncrement(game.data.playAgain1);
}
if ((_local1[name].name == "thrower") and ((_local1[name].code == "change") or (_local1[name].code == "success"))) {
if ((!goodBasket) and alreadyMade) {
if (thrower == gameInfo.playerID) {
meDisplay = meDisplay + letters[mescore];
meScore++;
} else {
youDisplay = youDisplay + letters[youscore];
youScore++;
}
}
checkGameOver();
if (!gameOver) {
thrower = game.data.thrower;
init();
}
}
if ((_local1[name].name == "useList") and (_local1[name].code == "change")) {
useList = game.data.useList;
updateMessage();
}
if (((_local1[name].name == "ball") and (_local1[name].code == "change")) and (!flying)) {
ball._x = game.data.ball.x;
ball._y = game.data.ball.y;
}
if (_local1[name].name == "shot") {
if (useList[5] and (thrower == gameInfo.playerID)) {
eyes.gotoAndPlay("open");
_local2.rim._visible = true;
}
anchor._visible = false;
dragging = false;
shooting = false;
flying = true;
ball._x = game.data.shot.x;
ball._y = game.data.shot.y;
ball.speed.x = game.data.shot.speed.x;
ball.speed.y = game.data.shot.speed.y;
}
}
};
}
if (_root.variant == "freethrow") {
youDisplay = 0;
}
adcount = 0;
gameInit();
modBG._visible = false;
shower.resulter.gotoAndStop(1);
freethrowShower.resulter.gotoAndStop(1);
_root.sounds.radio.start(_parent.court);
display.but.useHandCursor = false;
Symbol 372 Button
on (release) {
hideChatter();
sendCommand("trackingGameOver");
sounds.radio.fade(court);
sounds.scratcher.start();
fade("menu");
}
Symbol 378 Button
on (release) {
_parent.closeHelper();
}
Symbol 382 MovieClip Frame 1
spinner.stop();
if ((_parent.variant == "freethrow") or _parent.seenAlready) {
_parent.locked = false;
_visible = false;
stop();
} else {
_parent.locked = true;
_visible = true;
}
_parent.seenAlready = true;
Symbol 382 MovieClip Frame 6
stop();
Symbol 382 MovieClip Frame 11
_visible = false;
Symbol 395 Button
on (press) {
_parent.showDropDown();
}
Symbol 399 MovieClip Frame 1
reset = function () {
var _local1 = _root;
_local1.main.doneChecking = true;
if (_local1.variant == "freethrow") {
_local1.main.message = "call gameInit";
_local1.main.meDisplay = 0;
_local1.main.gameInit();
}
if (_local1.variant == "around") {
_local1.main.newAroundGame();
}
};
Symbol 404 Button
on (release) {
_root.submitScore(main.youDisplay);
}
Symbol 408 Button
on (release) {
openHelper();
}
Symbol 409 Button
on (release) {
sendCommand("trackingGameOver");
sounds.radio.fade(court);
sounds.scratcher.start();
fade("menu");
}