Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
mochi.as2.MochiAd.showPreGameAd({id:"fbd70d1195f13c39", res:"640x480"});
__com_mochibot__("944a15e0", this, 10301, true);
Frame 2
function itemHandler1(obj, item) {
getURL (sponsorurl, "_blank");
}
stop();
_global.sponsorurl = "http://www.candystand.com/play/puzzle-games?utm_source=prizma-puzzle-2&utm_medium=link&utm_campaign=prizma-puzzle-2-vrl";
_global.morelevelsurl = "http://www.candystand.com/play/prizma-puzzle-2?utm_source=prizma-puzzle-2&utm_medium=link&utm_campaign=prizma-puzzle-2-vrl";
_global.walkurl = "http://www.candystand.com/show-content.do?key=prizmapuzzle2walkthrough";
percentDone = 0;
lvl = 0;
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
item1 = new ContextMenuItem("Play More Games!", itemHandler1);
myMenu.customItems.push(item1);
_root.menu = myMenu;
level0 = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
level0a = "";
level1 = "000000000000000000000000000000000000000000000000000601011200000000000000310100000000000000000000000000000000000000000000000000000000";
level1a = "Silen";
level1s = 135;
level2 = "000000000012000000000000000006010000011200000010010000210100001200000000010100000301000000001100001001000000000000000000000000000000";
level2a = "Silen";
level2s = 850;
level3 = "000000000000000000000000011201000102010000000201000121010001080000000006000001610100000000000000020100019100000000000000000900000000";
level3a = "Silen";
level3s = 1045;
level4 = "000000140000140100000013010000011400001201000000020100000102000014010100001401000001140000110101000014010000000000000001000000150000";
level4a = "Silen";
level4s = 555;
level5 = "000000120000000000120000000002010200010100000010011101010102001200000001010201010201110100001101000001010100000000000001010100000000";
level5a = "Mikozoid";
level5s = 2400;
level5s = 700;
level6 = "001200190000000100120000010208010000070213000000000041112100010000001701096100810600010000120201000001150212000000000000000000000000";
level6a = "Mikozoid";
level6s = 1000;
level7 = "000001060019001415010018000000010000011213001700000000020100010000002100000118000000000021112121001600000003000000210101010100150000";
level7a = "Mikozoid";
level7s = 450;
level8 = "000000000012000000000000000042061000120000000011011012620710001200000001110110122208100000000000011101101200000000000000000100000000";
level8a = "Mikozoid";
level8s = 1250;
level9 = "000781000001151200000010000009020012000012000000100000211200126313000000614200000101000000118100001006000001010000000000000070080000";
level9a = "Mikozoid";
level9s = 2000;
level10 = "000100130200130100120013000200001800000114001000170101030000000000120100010101000000011600112000000001010102010000010101000000000000";
level10a = "Mikozoid";
level10s = 2150;
level11 = "000009010801070106000000010103010101030101000101014101120141010100014141218111812141410061016141412141614161000000010141014101010000";
level11a = "CRYSTALL_m";
level11s = 1750;
level12 = "000106140000120100000001000000000301000012000121161101000000001101010123004141005000000001011816001541000000000000010107010200000000";
level12a = "CRYSTALL_m";
level12s = 2450;
level13 = "000000000033010000000000200611001100111600000000000102120201000000000000110201021100000000001000000016010100000000000000120100000000";
level13a = "Wertolet";
level13s = 1460;
level14 = "000000121204000000000000121204040101010000000010040101010167460100090100000129880101210006101201000001000061410000081007000011810000";
level14a = "LERO";
level14s = 2475;
level15 = "000112011201120112010001060106010601060106002134343621343436243400010121013601210136010001010114010101010101000000161101010101010000";
level15a = "LERO";
level15s = 765;
level16 = "000012230000112112060010004120000001017555101709000041810000017295410154030052011810201600041000161820140832170000011212002007100000";
level16a = "Artem";
level16s = 4015;
level17 = "001300151107150311010000110018100001000011120000030000001011211206002000032008000000110002811814001561511811160000011211091600180000";
level17a = "Artem";
level17s = 3280;
level18 = "002012000020000014120000090000120000070000001000710000009110030100100831000000510603000000180000121800000000000000120000000012160000";
level18a = "EvGenius";
level18s = 1185;
level19 = "001101061203121001070001097212021320000181001202021920000000010100121020000000014110010001080121010110010201100000000000000000110000";
level19a = "Hale32bit";
level19s = 2930;
level20 = "008210000006000171000012000002010101011201160001010101025101010900070101710201010101000001031001010102000061970000010008000032410000";
level20a = "CRYSTALL_m";
level20s = 4710;
level21 = "000000000000130612000000000000000300000027001301000101121213010000000002121201010001170019510000021800010001000000320000000000150000";
level21a = "IHERO21";
level21s = 1405;
level22 = "001900020001130100000001010001010000010101000020010101000120000011010100000102000000021712011801010101140000000000010101030000000000";
level22a = "CRYSTALL_m";
level22s = 1650;
level23 = "005232020701000103010071010100000141003001030102000101100101000000120001010601010100000000120100000100000101000000000050000101080000";
level23a = "CRYSTALL_m";
level23s = 3700;
level24 = "000000190000000600000000010100010200001048101301001212120201000000000002021212124121570027100000016181216291000000691000007500910000";
level24a = "IHERO21";
level24s = 2290;
level25 = "000000008802200000000000000016001710180010001802001512311219000267090000141213122000001400000000000200104600000000000016000000000000";
level25a = "IHERO21";
level25s = 945;
level26 = "000000010101000000110000041300010001030117000000005101120012011300000000170012100200000000040007010101010001000000191001010101010000";
level26a = "Alastor G";
level26s = 1130;
level27 = "001200000000081000000000070200005857581181000000100039213778761269000000180000780006100000120200000000010012000000000018010100020000";
level27a = "Wertolet";
level27s = 1420;
level28 = "000111101202001811100011160015001512021218110000190000002013120301001800001601160000150611010001480700183902110000039169810211010000";
level28a = "Wertolet";
level28s = 3200;
level29 = "000101010101106101070001110101230101128101000101010112060101015100100141030101611201010008018112011121010101000000010101100901030000";
level29a = "Mikozoid";
level29s = 3325;
level30 = "000810150419100700000013000901120106001300000092520111015292000000002072011101721400000002100000110000100200000000010211020100000000";
level30a = "Alastor G";
level30s = 655;
level31 = "000000111112111100000000111112120612121111000011121209201012121100000011111212121111000012040000110011000081110000040310000012210000";
level31a = "CurlySue";
level31s = 4300;
level32 = "001200181900120100010000140200520800000110091300122000000210000000920300000018010100000000010110000000006631000000070000000000000000";
level32a = "Wertolet";
level32s = 1745;
level33 = "000000011201001100000000010700000261410012007000180101120106210000001220000103010000300001040050000000080100000000010000010100000000";
level33a = "Silen";
level33s = 2225;
level34 = "000000000001120100000000000021010861010102000001020750112109106100120190016101410102011200000101620121210110000000000001120101060000";
level34a = "Hale32bit";
level34s = 1495;
level35 = "001110100000000102010008020001010013000015000039009600180013030700125912741100000000061200010000001800001615000000010117000209010000";
level35a = "Raidho";
level35s = 2140;
level36 = "000014000001150000000013000001010001211614000001011811121116000401001301211100110217000020000219151900001517000000000206010102170000";
level36a = "Raidho";
level36s = 2210;
level37 = "000101001551000000000013000011190002111200000081010000090101420100000001010017150101000711121100010342000000000000000000001800000000";
level37a = "Raidho";
level37s = 2145;
level38 = "001202131101120106120008131900021120001411811300132000000011000015111016000000001610171018020158001800100912020000071202782018360000";
level38a = "Wertolet";
level38s = 2035;
level39 = "000000010110000902120000011202160131010001010108200201021602910600000151012001010214010101120007711020011200000000020000000100000000";
level39a = "Wertolet";
level39s = 3870;
level40 = "006972012000140001080070010700000118120016109100000014120201191401061000161601200000010112011901010400360271720000011601312110630000";
level40a = "Kornao";
level40s = 3875;
levelCompile = function () {
z = "";
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = back[("tesla" + i) + j];
if (obj._visible == true) {
x = obj._currentframe;
if (obj.bar1._visible) {
x = x + (obj.bar1._currentframe * 20);
} else if (x < 10) {
x = "0" + x;
}
} else {
x = "00";
}
z = z + x;
j = j + 1;
}
i = i + 1;
}
return(z);
};
Frame 3
totalBytes = Math.round(_root.getBytesTotal() / 1024);
loadedBytes = Math.round(_root.getBytesLoaded() / 1024);
if (percentDone < Math.round((loadedBytes / totalBytes) * 100)) {
percentDone = percentDone + 1;
}
preloaderBar._xscale = percentDone;
preloaderEff._x = percentDone * 6.4;
if (percentDone >= 100) {
_root.gotoAndPlay(5);
}
Frame 4
gotoAndPlay (3);
Frame 10
function stepCoord(dif) {
switch (dif) {
case 0 :
xx = 100;
yy = 0;
break;
case 1 :
xx = 50;
yy = -38;
break;
case 2 :
xx = 0;
yy = -75;
break;
case 3 :
xx = -50;
yy = -38;
break;
case 4 :
xx = -100;
yy = 0;
break;
case 5 :
xx = -50;
yy = 38;
break;
case 6 :
xx = 0;
yy = 75;
break;
case 7 :
xx = 50;
yy = 38;
}
}
stop();
totalscore = 0;
var my_so = SharedObject.getLocal("prizma_2a", "/");
lvlrec = new Array();
if (my_so.data.lvlrec[0] == undefined) {
my_so.data.lvlrec = new Array();
my_so.data.lvlrec[0] = 0;
}
lvlmedal = new Array();
if (my_so.data.lvlmedal[0] == undefined) {
my_so.data.lvlmedal = new Array();
my_so.data.lvlmedal[0] = 0;
my_so.data.lvlmedal[1] = 0;
my_so.data.lvlmedal[11] = 0;
my_so.data.lvlmedal[21] = 0;
}
i = 1;
while (i < 31) {
lvlmedal[i] = my_so.data.lvlmedal[i];
lvlrec[i] = my_so.data.lvlrec[i];
if (lvlrec[i] != undefined) {
totalscore = totalscore + lvlrec[i];
}
i++;
}
menu_screen.tar = "main";
my_lvl = 30;
var play_laser1 = new Sound(_root);
play_laser1.attachSound("snd_laser1");
var play_laser2 = new Sound(_root);
play_laser2.attachSound("snd_laser2");
var play_laser3 = new Sound(_root);
play_laser3.attachSound("snd_laser3");
var play_powerdown = new Sound(_root);
play_powerdown.attachSound("snd_powerdown");
var play_on = new Sound(_root);
play_on.attachSound("snd_on");
var play_pre = new Sound(_root);
play_pre.attachSound("snd_pre");
var play_record = new Sound(_root);
play_record.attachSound("snd_record");
var play_medal = new Sound(_root);
play_medal.attachSound("snd_medal");
var play_score = new Sound(_root);
play_score.attachSound("snd_score");
var play_music = new Sound(_root);
play_music.attachSound("snd_mus");
play_music.start(0, 999);
showscore._visible = false;
tesla._visible = false;
select._visible = false;
fly._visible = false;
fly.stop();
star._visible = false;
marker.select._visible = false;
menu_screen.swapDepths(99999);
win_screen.swapDepths(99998);
level_screen.swapDepths(99997);
inter.swapDepths(99990);
select.swapDepths(10000);
marker.swapDepths(9999);
eff.swapDepths(9998);
back.gotoAndStop(2);
menu_screen.gotoAndPlay(2);
inter._y = 540;
begin = 0;
edit = false;
camp = true;
menu_type = 0;
begin_type = 0;
help = true;
bonus = 0;
medal = 0;
lvl = 0;
aim = 0;
inform = 2;
music = 2;
step = 5;
stepmax = 5;
minute = 0;
sec = 0;
sec_str = "00";
msec = 0;
score = 0;
need_score = 0;
global_score = 0;
plus = 0;
obj = 0;
fly = 0;
xx = 0;
yy = 0;
ii = 0;
target = 0;
targ = 0;
targ_cur = 0;
targ_cur_last = 0;
targ_true = false;
tar1 = 0;
tar2 = 0;
tar3 = 0;
tar4 = 0;
addscore_count = 0;
fly_count = 0;
tutor_count = 0;
eff_count = 0;
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
map[j] = 0;
j = j + 1;
}
i = i + 1;
}
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
if ((j % 2) == 0) {
plus = 0;
} else {
plus = 50;
}
obj = back.attachMovie("tesla", ("tesla" + i) + j, (j * 10) + i);
obj._x = (plus + 45) + (i * 100);
obj._y = 50 + (j * 38);
obj.posx = i;
obj.posy = j;
obj.x = i;
obj.y = j;
obj.stop();
obj._visible = false;
j = j + 1;
}
i = i + 1;
}
loadLevel = function () {
inter._y = 540;
aim = 0;
trace(lvl);
if (lvl == 0) {
begin = -1;
} else {
begin = 0;
showscore._visible = true;
}
step = 5;
stepmax = 5;
score = 0;
record = 0;
combo = 1;
addscore_count = 0;
fly_count = 0;
tutor_count = 0;
eff_count = 0;
combo_count = 0;
minute = 0;
sec = 0;
sec_str = "0:00";
msec = 0;
need_min = Math.floor(_root[("level" + lvl) + "timer"] / 60);
need_sec = _root[("level" + lvl) + "timer"] % 60;
need_str = (need_min + ":") + need_sec;
need_score = _root[("level" + lvl) + "score"];
levelname = (("Level " + lvl) + " by ") + _root[("level" + lvl) + "a"];
k = 0;
map = _root["level" + lvl];
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = back[("tesla" + i) + j];
obj.type = Number(map.substr(k, 2));
k = k + 2;
if (obj.type > 20) {
x = obj.type % 20;
y = (obj.type - x) / 20;
obj.type = x;
obj.bar1._visible = (obj.bar2._visible = true);
obj.bar1.gotoAndStop(y);
obj.bar2.gotoAndStop(y);
} else {
obj.bar1._visible = (obj.bar2._visible = false);
}
obj.gotoAndStop(obj.type);
obj.inform.gotoAndStop(obj.type);
obj.ramka.gotoAndStop(1);
if (obj.type == 0) {
obj._visible = false;
} else {
obj._visible = true;
if (inform == 1) {
obj.inform._visible = false;
}
}
if ((obj.type > 5) and (obj.type < 10)) {
obj.img.gotoAndStop(obj.type - 4);
} else {
obj.img.gotoAndStop(2);
}
if (((obj.type > 9) and (obj.type < 13)) and (edit == false)) {
z = _root.attachMovie("nexus", ("nexus" + i) + j, _root.getNextHighestDepth());
z._x = obj._x;
z._y = obj._y - 7;
if (obj.type == 10) {
z._visible = false;
}
if (obj.type == 11) {
aim = aim + 1;
z._visible = false;
}
if (obj.type == 12) {
if (obj.bar1._visible == false) {
z._visible = true;
} else {
z._visible = false;
}
}
}
j = j + 1;
}
i = i + 1;
}
switch (lvl) {
case 1 :
createTutor(245, 288, 3, "Start", "Click here to start");
createTutor(295, 130, 2, "Switch", "Move here to open Finish");
break;
case 2 :
createTutor(396, 326, 4, "Charger", "Increase your move count");
createTutor(296, 64, 2, "Teleport", "Move to any Start elements");
break;
case 3 :
createTutor(34, 403, 4, "Helper", "Click here to hide hints");
createTutor(650, 25, 3, "Rewards", "Speed up to get more scores");
break;
case 99 :
createTutor(0, -5, 4, "Alt. controls", "Hold left button and move mouse cursor");
}
};
_global.playSound = function (info) {
_root[info].start();
};
_global.openMenu = function (info) {
menu_screen.tablo.img.close = true;
menu_screen.tablo.img.tar = info;
};
lengthdir_x = function (len, dir) {
return(Math.cos((dir * Math.PI) / 180) * len);
};
lengthdir_y = function (len, dir) {
return((-Math.sin((dir * Math.PI) / 180)) * len);
};
collisionPoint = function (x, y) {
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = back[("tesla" + i) + j];
if (x > (obj._x - 25)) {
if (x < (obj._x + 25)) {
if (y > (obj._y - 19)) {
if (y < (obj._y + 19)) {
if (target.type == -1) {
if (obj.type < 1) {
obj = undefined;
}
}
return(obj);
}
}
}
}
j = j + 1;
}
i = i + 1;
}
};
createEff = function (x1, y1, x2, y2) {
eff.lineStyle(10, 7208956, 10);
eff.moveTo(x1 - ((x1 - x2) / 5), (y1 - ((y1 - y2) / 5)) - 20);
eff.lineTo(x2 - ((x2 - x1) / 5), (y2 - ((y2 - y1) / 5)) - 20);
eff.lineStyle(6, 12058617, 30);
eff.moveTo(x1 - ((x1 - x2) / 10), (y1 - ((y1 - y2) / 10)) - 20);
eff.lineTo(x2 - ((x2 - x1) / 10), (y2 - ((y2 - y1) / 10)) - 20);
eff.lineStyle(3, 16777215, 60);
eff.moveTo(x1, y1 - 20);
eff.lineTo(x2, y2 - 20);
eff_count++;
obj = eff.attachMovie("eff_bitmap", "eff" + eff_count, eff.getNextHighestDepth());
obj._x = x1;
obj._y = y1 - 20;
obj._rotation = Math.random() * 360;
};
createFly = function (x, y, count) {
i = count;
stepCoord(Math.floor(marker.select._rotation / 45));
xx = xx / count;
yy = yy / count;
while (i--) {
fly_count++;
obj = this.attachMovie("fly", "fly" + fly_count, 11000 + fly_count);
obj._x = x;
obj._y = y;
obj._rotation = Math.random() * 360;
}
};
createStar = function (x, y, w, h, count) {
i = count;
while (i--) {
fly_count++;
obj = this.attachMovie("star", "star" + fly_count, 110000 + fly_count);
obj._x = x + (Math.random() * w);
obj._y = y + (Math.random() * h);
obj.gotoAndPlay(Math.random() * 15);
}
};
createTutor = function (x, y, typ, nam, des) {
tutor_count++;
obj = this.attachMovie("tutor" + typ, "tutor" + tutor_count, 99990 + tutor_count);
obj._x = x;
obj._y = y;
obj.nam = nam;
obj.des = des;
};
addScore = function () {
this["play_laser" + Math.min(3, combo)].start();
addscore_count = addscore_count + 1;
combo_count = 60;
score = score + ((5 * combo) + 5);
obj = _root.attachMovie("text_addscore", "text_addscore_" + addscore_count, 10000 + addscore_count);
obj.txt.text = String("+" + ((5 * combo) + 5));
obj._x = target._x;
obj._y = target._y;
if (target.type < 13) {
combo = combo + 1;
}
};
levelClear = function () {
eff.clear();
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root.back[("tesla" + i) + j];
obj._visible = false;
if ((obj._currentframe > 9) and (obj._currentframe < 13)) {
_root[("nexus" + obj.x) + obj.y].removeMovieClip();
}
j = j + 1;
}
i = i + 1;
}
if (eff_count > 0) {
i = 1;
while (i <= eff_count) {
obj = _root.eff["eff" + i];
obj.removeMovieClip();
i = i + 1;
}
eff_count = 0;
}
if (tutor_count > 0) {
i = 1;
while (i <= tutor_count) {
obj = _root["tutor" + i];
obj.removeMovieClip();
i = i + 1;
}
tutor_count = 0;
}
marker._visible = false;
select._visible = false;
};
endLevel = function (die) {
if (begin != -1) {
levelClear();
begin = -1;
switch (die) {
case 0 :
fly_count = 0;
menu_screen.tar = "score";
menu_screen.gotoAndPlay(2);
break;
case 1 :
level_screen.text_level.text = String("Level " + lvl);
level_screen.gotoAndPlay(2);
break;
case 2 :
level_screen.text_level.text = String("Not Enough Energy");
level_screen.gotoAndPlay(3);
play_powerdown.start();
break;
case 3 :
level_screen.text_level.text = String("No Moves Left");
level_screen.gotoAndPlay(3);
play_powerdown.start();
break;
case 4 :
level_screen.text_level.text = String("Editor Mode");
level_screen.gotoAndPlay(3);
edit = true;
break;
case 5 :
level_screen.text_level.text = String("Tester Mode");
level_screen.gotoAndPlay(3);
edit = false;
lvl = 0;
level0 = editor.map;
}
}
};
heroPos = function () {
herox = target.posx;
heroy = target.posy;
marker._x = target._x;
marker._y = target._y;
marker.select._visible = false;
};
targetSet = function () {
heroPos();
tar1 = collisionPoint(marker._x + 50, marker._y - 38);
tar2 = collisionPoint(marker._x - 50, marker._y - 38);
tar3 = collisionPoint(marker._x - 50, marker._y + 38);
tar4 = collisionPoint(marker._x + 50, marker._y + 38);
i = 1;
while (i < 5) {
if (_root["tar" + i].bar1._visible == true) {
_root["tar" + i] = undefined;
}
i++;
}
if ((((tar1 == undefined) and (tar2 == undefined)) and (tar3 == undefined)) and (tar4 == undefined)) {
endLevel(3);
}
marker.t1._alpha = (marker.t2._alpha = (marker.t3._alpha = (marker.t4._alpha = 0)));
if (tar1 == undefined) {
marker.t1._visible = false;
} else {
marker.t1._visible = true;
}
if (tar2 == undefined) {
marker.t2._visible = false;
} else {
marker.t2._visible = true;
}
if (tar3 == undefined) {
marker.t3._visible = false;
} else {
marker.t3._visible = true;
}
if (tar4 == undefined) {
marker.t4._visible = false;
} else {
marker.t4._visible = true;
}
};
changeTesla = function () {
marker.effect._xscale = (marker.effect._yscale = 250);
createEff(marker._x, marker._y, target._x, target._y);
addScore();
if (target.type == 11) {
aim = aim - 1;
}
if (aim == 0) {
endLevel(0);
}
step = step - 1;
switch (target.type) {
case 2 :
step = step + 5;
inter.text_step._yscale = 150;
break;
case 3 :
step = step + 10;
inter.text_step._yscale = 150;
break;
case 4 :
step = step + 15;
inter.text_step._yscale = 150;
break;
case 6 :
case 7 :
case 8 :
case 9 :
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root.back[("tesla" + i) + j];
if (obj.bar1._visible == true) {
if (obj.bar1._currentframe == (target.img._currentframe - 1)) {
obj.bar1._visible = (obj.bar2._visible = false);
z = _root.attachMovie("eff_bar", "eff_bar", _root.getNextHighestDepth());
z._x = obj._x;
z._y = obj._y;
}
}
j = j + 1;
}
i = i + 1;
}
break;
case 10 :
begin = 0;
target.ramka.gotoAndPlay(12);
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root.back[("tesla" + i) + j];
if (obj.type == 11) {
_root[("nexus" + obj.x) + obj.y]._visible = false;
}
if (obj.type == 12) {
if (obj.bar1._visible == false) {
_root[("nexus" + obj.x) + obj.y]._visible = true;
}
}
j = j + 1;
}
i = i + 1;
}
eff_count++;
obj = eff.attachMovie("eff_bitmap", "eff" + eff_count, eff.getNextHighestDepth());
obj._x = target._x;
obj._y = target._y - 20;
obj._rotation = Math.random() * 360;
obj = _root.attachMovie("eff_line", "eff_line" + eff_count, _root.getNextHighestDepth());
obj._x = target._x;
obj._y = target._y - 20;
obj.gotoAndPlay("up");
break;
case 11 :
_root[("nexus" + target.x) + target.y]._visible = false;
}
if (step < 1) {
endLevel(2);
}
eff._alpha = Math.min(120, 70 + (10 * step));
marker.select._alpha = Math.min(120, 70 + (10 * step));
if ((target._currentframe > 12) and (step > 0)) {
stepCoord(target._currentframe - 13);
ii = 0;
if (true) {
ii = ii + 1;
targ = collisionPoint(target._x + (ii * xx), target._y + (ii * yy));
if (targ != undefined) {
if (targ.type != 0) {
if ((targ.type < 0) or (obj.bar1._visible == true)) {
endLevel(3);
// unexpected jump
}
createEff(target._x, target._y, targ._x, targ._y);
target.type = -2;
target.img.gotoAndStop(1);
target = targ;
heroPos();
changeTesla();
// unexpected jump
}
// unexpected jump
}
endLevel(3);
}
} else {
target.type = -1;
target.img.gotoAndStop(1);
target.inform.gotoAndStop(1);
if (target._currentframe != 10) {
targetSet();
} else {
x = 0;
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
z = back[("tesla" + i) + j];
if (z.type == 12) {
if (z.bar1._visible == false) {
x = 1;
break;
}
}
j = j + 1;
}
i = i + 1;
}
if (x == 0) {
endLevel(3);
}
}
}
};
onEnterFrame = function () {
if (edit == false) {
if (begin > -1) {
targ_cur = collisionPoint(_xmouse, _ymouse);
if ((((targ_cur == tar1) or (targ_cur == tar2)) or (targ_cur == tar3)) or (targ_cur == tar4)) {
targ_true = true;
} else {
targ_true = false;
}
if (begin == 0) {
marker._visible = false;
select._visible = false;
if (targ_cur.bar1._visible == false) {
if (targ_cur.type == 12) {
select._visible = true;
select._x = _root._xmouse;
select._y = _root._ymouse;
select.light._x = (select.bord._x = targ_cur._x - _root._xmouse);
select.light._y = (select.bord._y = targ_cur._y - _root._ymouse);
select.light.gotoAndStop(targ_cur.type);
select.bord.gotoAndStop(targ_cur.type);
}
}
}
if (begin == 1) {
marker.select._visible = false;
select._visible = false;
if (targ_cur != undefined) {
if (targ_true == true) {
marker.select._xscale = Math.sqrt(Math.pow(marker._x - _xmouse, 2) + Math.pow((marker._y - 20) - _ymouse, 2));
marker.select._rotation = (Math.atan2(_ymouse - (marker._y - 20), _xmouse - marker._x) / Math.PI) * 180;
marker.select._visible = true;
select._visible = true;
select._x = _root._xmouse;
select._y = _root._ymouse;
select.light._x = (select.bord._x = targ_cur._x - _root._xmouse);
select.light._y = (select.bord._y = targ_cur._y - _root._ymouse);
select.light.gotoAndStop(targ_cur.type);
select.bord.gotoAndStop(targ_cur.type);
if ((msec % 5) == 0) {
createFly(_root._xmouse, _root._ymouse, 1);
}
}
}
if (combo_count > 0) {
combo_count = combo_count - 1;
} else {
combo = 1;
}
if (msec == 30) {
msec = 1;
if (sec == 59) {
minute = minute + 1;
sec = 0;
sec_str = "00";
} else {
sec = sec + 1;
if (sec < 10) {
sec_str = (minute + ":0") + sec;
} else {
sec_str = (minute + ":") + sec;
}
}
} else {
msec = msec + 1;
}
}
if (inter._y > 480) {
inter._y = inter._y - 5;
}
if (inter.text_step._yscale > 100) {
inter.text_step._yscale = inter.text_step._yscale - 10;
}
} else if (inter._y < 540) {
inter._y = inter._y + 5;
}
if (mousePressed == true) {
if (begin == 0) {
target = collisionPoint(_root._xmouse, _root._ymouse);
if (target != undefined) {
if (target.type == 12) {
if (targ_cur.bar1._visible == false) {
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = back[("tesla" + i) + j];
if (obj.type == 11) {
_root[("nexus" + obj.x) + obj.y]._visible = true;
}
if (obj.type == 12) {
_root[("nexus" + obj.x) + obj.y]._visible = false;
}
j = j + 1;
}
i = i + 1;
}
marker.effect._xscale = (marker.effect._yscale = 250);
target.img.gotoAndStop(1);
target.type = -1;
begin = 1;
addScore();
targetSet();
marker._visible = true;
obj = _root.attachMovie("eff_line", "eff_line" + eff_count, _root.getNextHighestDepth());
obj._x = target._x;
obj._y = target._y - 20;
obj.gotoAndPlay("down");
}
}
}
} else if (begin == 1) {
target = collisionPoint(_root._xmouse, _root._ymouse);
if (target != undefined) {
if (target.type > 0) {
if ((((target == tar1) || (target == tar2)) || (target == tar3)) || (target == tar4)) {
changeTesla();
}
}
}
}
}
} else {
targ_cur = collisionPoint(_xmouse, _ymouse);
if (targ_cur_last != targ_cur) {
targ_cur_last.ramka.gotoAndPlay(12);
targ_cur.ramka.gotoAndPlay(2);
}
targ_cur_last = targ_cur;
if (mousePressed == true) {
mousePressed = false;
if (inter.cursor > 0) {
z = ("" + targ_cur.x) + targ_cur.y;
if ((((((z != "00") and (z != "010")) and (z != "50")) and (z != "51")) and (z != "59")) and (z != "510")) {
targ_cur._visible = true;
targ_frame = targ_cur._currentframe;
switch (inter.cursor) {
case 1 :
targ_cur.gotoAndStop(12);
break;
case 2 :
targ_cur.gotoAndStop(1);
break;
case 3 :
if ((targ_frame < 2) or (targ_frame > 3)) {
targ_cur.gotoAndStop(2);
} else {
targ_cur.nextFrame();
}
break;
case 4 :
targ_frame = targ_cur.bar1._currentframe;
if (targ_cur.bar1._visible == true) {
if (targ_frame == 4) {
targ_cur.bar1._visible = false;
targ_cur.bar2._visible = false;
} else {
targ_cur.bar1.nextFrame();
targ_cur.bar2.nextFrame();
}
} else {
targ_cur.bar1._visible = true;
targ_cur.bar2._visible = true;
targ_cur.bar1.gotoAndStop(1);
targ_cur.bar1.gotoAndStop(1);
}
break;
case 5 :
if ((targ_frame < 6) or (targ_frame > 8)) {
targ_cur.gotoAndStop(6);
targ_cur.img.gotoAndStop(2);
} else {
targ_cur.nextFrame();
targ_cur.img.gotoAndStop(targ_cur._currentframe - 4);
}
break;
case 6 :
targ_cur.gotoAndStop(10);
break;
case 7 :
if ((targ_frame < 13) or (targ_frame > 19)) {
targ_cur.gotoAndStop(13);
} else {
targ_cur.nextFrame();
}
break;
case 8 :
targ_cur.gotoAndStop(11);
break;
case 9 :
targ_cur.gotoAndStop(1);
targ_cur._visible = false;
targ_cur.bar1._visible = false;
targ_cur.bar2._visible = false;
}
targ_cur.inform.gotoAndStop(targ_cur._currentframe);
}
}
}
if (inter._y > 480) {
inter._y = inter._y - 5;
}
}
};
onMouseDown = function () {
mousePressed = true;
};
onMouseUp = function () {
mousePressed = false;
};
loadLevel();
Symbol 15 MovieClip [tutor4] Frame 1
gotoAndPlay(Math.floor(Math.random() * 10));
Symbol 15 MovieClip [tutor4] Frame 21
name.text = nam;
Symbol 15 MovieClip [tutor4] Frame 29
desc.text = des;
Symbol 15 MovieClip [tutor4] Frame 35
stop();
Symbol 18 MovieClip [tutor3] Frame 1
gotoAndPlay(Math.floor(Math.random() * 10));
Symbol 18 MovieClip [tutor3] Frame 21
name.text = nam;
Symbol 18 MovieClip [tutor3] Frame 29
desc.text = des;
Symbol 18 MovieClip [tutor3] Frame 35
stop();
Symbol 23 MovieClip Frame 1
stop();
Symbol 28 MovieClip Frame 2
stop();
Symbol 33 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 11
stop();
Symbol 48 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 2
stop();
Symbol 58 MovieClip Frame 2
stop();
Symbol 63 MovieClip Frame 2
stop();
Symbol 69 MovieClip Frame 2
stop();
Symbol 76 MovieClip Frame 2
stop();
Symbol 81 MovieClip Frame 2
stop();
Symbol 86 MovieClip Frame 2
stop();
Symbol 91 MovieClip Frame 2
stop();
Symbol 96 MovieClip Frame 2
stop();
Symbol 101 MovieClip Frame 2
stop();
Symbol 106 MovieClip Frame 2
stop();
Symbol 111 MovieClip Frame 2
stop();
Symbol 116 MovieClip Frame 2
stop();
Symbol 121 MovieClip Frame 2
stop();
Symbol 126 MovieClip Frame 2
stop();
Symbol 133 MovieClip [text_addscore] Frame 20
this.removeMovieClip();
Symbol 135 MovieClip Frame 1
onEnterFrame = function () {
if (_alpha < 100) {
_alpha = (_alpha + 10);
}
};
Symbol 140 MovieClip [fly] Frame 31
this.removeMovieClip();
Symbol 141 MovieClip [star] Frame 1
rot = Math.ceil((Math.random() * 6) - 3);
alp = Math.ceil((Math.random() * 3) + 3);
onEnterFrame = function () {
_y = (_y - (Math.random() * 1));
_rotation = (_rotation + rot);
_alpha = (_alpha - alp);
if (_alpha < 1) {
this.removeMovieClip();
}
};
Symbol 147 Button
on (release) {
if (_root.begin == -2) {
_root.menu_screen.tablo.play();
_root.menu_screen.play();
_root.begin = -1;
_root.menu_type = 0;
_root.lvl = numb;
}
}
Symbol 152 Button
on (release) {
if (_root.begin == -2) {
_root.menu_screen.tablo.play();
_root.menu_screen.play();
_root.begin = -1;
_root.menu_type = 0;
_root.lvl = numb;
}
}
Symbol 156 Button
on (release) {
if (_root.begin == -2) {
_root.menu_screen.tablo.play();
_root.menu_screen.play();
_root.begin = -1;
_root.menu_type = 0;
_root.lvl = numb;
}
}
Symbol 160 MovieClip [tutor2] Frame 1
gotoAndPlay(Math.floor(Math.random() * 10));
Symbol 160 MovieClip [tutor2] Frame 21
name.text = nam;
Symbol 160 MovieClip [tutor2] Frame 29
desc.text = des;
Symbol 160 MovieClip [tutor2] Frame 35
stop();
Symbol 163 MovieClip [tutor1] Frame 1
gotoAndPlay(Math.floor(Math.random() * 10));
Symbol 163 MovieClip [tutor1] Frame 21
name.text = nam;
Symbol 163 MovieClip [tutor1] Frame 29
desc.text = des;
Symbol 163 MovieClip [tutor1] Frame 35
stop();
Symbol 166 MovieClip [eff_line] Frame 9
this.removeMovieClip();
Symbol 166 MovieClip [eff_line] Frame 18
this.removeMovieClip();
Symbol 171 MovieClip [eff_glass] Frame 1
dir = 45 + random(90);
vspeed = 0;
speed = 5 + random(9);
rot = 40 - random(80);
timer = 20 + random(20);
_rotation = random(360);
onEnterFrame = function () {
_rotation = (_rotation + rot);
_x = (_x + _root.lengthdir_x(speed, dir));
_y = (_y + (_root.lengthdir_y(speed, dir) + vspeed));
vspeed = vspeed + 0.5;
if (timer > 0) {
timer--;
if (timer < 10) {
_alpha = (_alpha - 10);
}
} else {
this.removeMovieClip();
}
};
Symbol 174 MovieClip [eff_bar] Frame 15
this.removeMovieClip();
Symbol 552 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {id:"hostLoadPcnt", pcnt:_local2}, clip._mochiad._containerLCName);
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
if (_local7._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new Object();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
containerNotify(clip, {id:"unload"}, clip._mochiad._containerLCName);
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
containerRpcResult(clip, callbackID, _local4, clip._mochiad._containerLCName);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
containerRpcResult(clip, callbackID, _local3, clip._mochiad._containerLCName);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
static function containerNotify(clip, args, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.notify) {
_local1.notify(args);
} else {
new LocalConnection().send(lcName, "notify", args);
}
}
static function containerRpcResult(clip, callbackID, val, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.rpcResult) {
_local1.rpcResult(callbackID, val);
} else {
new LocalConnection().send(lcName, "rpcResult", callbackID, val);
}
}
}
Symbol 553 MovieClip [__Packages.mochi.as2.MochiSync] Frame 0
class mochi.as2.MochiSync
{
var _syncContainer;
function MochiSync () {
_syncContainer = {};
}
function getProp(name) {
return(_syncContainer[name]);
}
function setProp(name, value) {
if (_syncContainer[name] == value) {
return(undefined);
}
_syncContainer[name] = value;
mochi.as2.MochiServices.send("sync_propUpdate", {name:name, value:value});
}
function triggerEvent(eventType, args) {
switch (eventType) {
case SYNC_REQUEST :
mochi.as2.MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY :
_syncContainer[args.name] = args.value;
}
}
static var SYNC_REQUEST = "SyncRequest";
static var SYNC_PROPERTY = "UpdateProperty";
}
Symbol 554 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.3 as2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "sync" :
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var servicesSync = new mochi.as2.MochiSync();
}
Symbol 555 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 556 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
static var gameStart, levelStart;
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function trigger(kind, obj) {
if (obj == undefined) {
obj = {};
} else if (obj.kind != undefined) {
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
obj.kind = kind;
}
mochi.as2.MochiServices.send("events_triggerEvent", {eventObject:obj}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startGame() {
gameStart = new Date().getTime();
trigger("start_game");
}
static function endGame() {
var _local1 = new Date().getTime() - gameStart;
trigger("end_game", {time:_local1});
}
static function startLevel() {
levelStart = new Date().getTime();
trigger("start_level");
}
static function endLevel() {
var _local1 = new Date().getTime() - levelStart;
trigger("end_level", {time:_local1});
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 557 MovieClip [__Packages.mochi.as2.MochiCoins] Frame 0
class mochi.as2.MochiCoins
{
function MochiCoins () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showStore(options) {
mochi.as2.MochiServices.send("coins_showStore", {options:options}, null, null);
}
static function showItem(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showItem call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showItem", {options:options}, null, null);
}
static function showVideo(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showVideo call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showVideo", {options:options}, null, null);
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("coins_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("coins_hideLoginWidget");
}
static function getStoreItems() {
mochi.as2.MochiServices.send("coins_getStoreItems");
}
static function getUserInfo() {
mochi.as2.MochiServices.send("coins_getUserInfo");
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("coins_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var STORE_SHOW = "StoreShow";
static var STORE_HIDE = "StoreHide";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var ITEM_OWNED = "ItemOwned";
static var ITEM_NEW = "ItemNew";
static var STORE_ITEMS = "StoreItems";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 312 MovieClip Frame 216
stop();
_root.gotoAndStop(10);
Symbol 316 MovieClip Frame 1
onEnterFrame = function () {
_yscale = (80 + (Math.random() * 20));
_xscale = (80 + (Math.random() * 20));
};
Symbol 318 MovieClip Frame 1
onEnterFrame = function () {
_alpha = (90 + (Math.random() * 20));
};
Symbol 322 Button
on (rollOver) {
_root.play_on.start();
}
on (release) {
getURL (sponsorurl, "_blank");
_root.play_pre.start();
}
Symbol 326 MovieClip Frame 1
stop();
onEnterFrame = function () {
if (_root.lvl != 0) {
x = Math.ceil(_root.lvl / 10);
if (x != _currentframe) {
gotoAndStop(x);
}
}
};
Symbol 329 MovieClip Frame 1
stop();
Symbol 330 MovieClip Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 1);
_yscale = (80 + (Math.random() * 40));
_xscale = (80 + (Math.random() * 40));
};
Symbol 333 MovieClip Frame 30
onEnterFrame = function () {
if (_currentframe == 30) {
xx = Math.round(Math.random() * 7);
yy = Math.round(Math.random() * 6);
_x = (45 + (xx * 100));
_y = (50 + (yy * 75.5));
}
};
Symbol 334 MovieClip Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 1);
_alpha = (100 + (Math.random() * 20));
if (_xscale > 125) {
_yscale = (_yscale - 25);
_xscale = (_yscale - 25);
}
};
Symbol 346 Button
on (release) {
if (_root.music == 2) {
_root.music = 1;
new Sound().setVolume(0);
} else {
_root.music = 2;
new Sound().setVolume(100);
}
}
Symbol 348 MovieClip Frame 1
onEnterFrame = function () {
gotoAndStop(_root.music);
};
Symbol 356 Button
on (release) {
if (_root.inform == 2) {
_root.inform = 1;
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root.back[("tesla" + i) + j];
obj.inform._visible = false;
j = j + 1;
}
i = i + 1;
}
} else {
_root.inform = 2;
i = 0;
while (i < 6) {
j = 0;
while (j < 11) {
obj = _root.back[("tesla" + i) + j];
obj.inform._visible = true;
j = j + 1;
}
i = i + 1;
}
}
}
Symbol 358 MovieClip Frame 1
onEnterFrame = function () {
gotoAndStop(_root.inform);
};
Symbol 371 Button
on (release) {
if (_root.begin > -1) {
_root.menu_screen.gotoAndPlay(2);
_root.menu_screen.tar = "main";
_root.begin = -1;
_root.lvl = 0;
}
}
Symbol 378 Button
on (release) {
if (_root.begin > -1) {
_root.endLevel(1);
_root.begin = -1;
}
}
Symbol 384 Button
on (rollOver) {
_root.play_on.start();
}
on (release) {
getURL (walkurl, "_blank");
_root.play_pre.start();
}
Symbol 397 MovieClip Frame 1
_visible = false;
stop();
Symbol 397 MovieClip Frame 3
_visible = true;
Symbol 397 MovieClip Frame 40
_root.back.gotoAndStop(1);
_root.loadLevel(_root["level" + _root.lvl]);
Symbol 400 MovieClip Frame 1
onEnterFrame = function () {
_rotation = (_rotation + 1);
_yscale = (250 + (Math.random() * 100));
_xscale = (250 + (Math.random() * 100));
};
Symbol 411 Button
on (release) {
if (_root.begin == -2) {
_root.totalscore = _root.totalscore + (_root.score + _root.bonus);
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 2;
}
}
Symbol 418 Button
on (release) {
if (_root.begin == -2) {
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 3;
_root.begin_type = 1;
}
}
Symbol 419 Button
on (release) {
if (_root.begin == -2) {
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 1;
}
}
Symbol 426 Button
on (release) {
if (_root.begin == -2) {
_root.totalscore = _root.totalscore + (_root.score + _root.bonus);
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 3;
_root.begin_type = 1;
}
}
Symbol 427 Button
on (release) {
if (_root.begin == -2) {
_root.win_screen.tablo.play();
_root.begin = -1;
_root.win_screen.play();
_root.menu_type = 2;
_root.begin_type = 2;
}
}
Symbol 428 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 1
stop();
Symbol 456 MovieClip Frame 2
if (_root.score < _root.need_score) {
text1.rec.gotoAndStop(1);
} else {
text1.rec.gotoAndStop(2);
_root.createStar(320 - (text1.rec._width / 2), 400 + text1._y, text1.rec._width, text1.rec._height, 10);
_root.play_laser1.start();
}
text1.txt.text = _root.score;
Symbol 456 MovieClip Frame 12
_root.bonus = 0;
have = ((_root.minute * 1800) + (_root.sec * 30)) + _root.msec;
need = (_root.need_min * 1800) + (_root.need_sec * 30);
if (have < need) {
_root.bonus = Math.round((need - have) / 5);
}
if (need < have) {
text2.rec.gotoAndStop(1);
} else {
text2.rec.gotoAndStop(2);
_root.createStar(320 - (text2.rec._width / 2), 400 + text2._y, text2.rec._width, text2.rec._height, 10);
_root.play_laser2.start();
}
text2.txt.text = _root.bonus;
Symbol 456 MovieClip Frame 22
_root.medal = (text1.rec._currentframe + text2.rec._currentframe) - 1;
text3.rec.gotoAndStop(_root.medal);
if (_root.medal > 1) {
_root.createStar(320 - (text3.rec._width / 2), 400 + text3._y, text3.rec._width, text3.rec._height, 20);
_root.play_laser3.start();
}
text3.txt.text = (_root.totalscore + _root.score) + _root.bonus;
Symbol 456 MovieClip Frame 27
stop();
Symbol 459 MovieClip Frame 1
_visible = false;
stop();
Symbol 459 MovieClip Frame 2
_visible = true;
Symbol 459 MovieClip Frame 9
_root.back.gotoAndStop(2);
_root.levelClear();
Symbol 459 MovieClip Frame 10
if (_root.lvl == 40) {
text_win.text = "Game Complete!";
} else {
text_win.text = "Level Complete";
}
Symbol 459 MovieClip Frame 23
if (_root.lvl == 40) {
buttons.gotoAndStop(2);
} else {
buttons.gotoAndStop(1);
}
Symbol 459 MovieClip Frame 43
stop();
tablo.play();
_root.begin = -2;
Symbol 459 MovieClip Frame 60
if (_root.lvl >= _root.my_lvl) {
_root.my_lvl = _root.lvl + 1;
_root.my_so.data.my_lvl = _root.my_lvl;
_root.my_so.flush();
}
if (_root.lvlmedal[_root.lvl] < _root.medal) {
_root.lvlmedal[_root.lvl] = _root.medal;
_root.my_so.data.lvlmedal[_root.lvl] = _root.medal;
_root.my_so.flush();
}
switch (_root.menu_type) {
case 1 :
_root.level_screen.text_level.text = String("Level " + _root.lvl);
_root.level_screen.gotoAndPlay(2);
break;
case 2 :
_root.lvl = _root.lvl + 1;
if (_root.lvl == 41) {
_root.lvl = 1;
_root.menu_screen.gotoAndPlay(2);
} else {
_root.level_screen.text_level.text = String("Level " + _root.lvl);
_root.level_screen.gotoAndPlay(2);
}
break;
case 3 :
_root.menu_screen.gotoAndPlay(2);
}
Symbol 467 MovieClip Frame 1
stop();
if (_root.lvl > 0) {
if (_root.lvl == 30) {
gotoAndStop (3);
} else {
gotoAndStop (2);
}
}
Symbol 470 Button
on (rollOver) {
gotoAndPlay ("on");
}
on (rollOut) {
gotoAndPlay ("off");
}
on (release) {
if (_root.begin == -2) {
gotoAndPlay (1);
_root.begin = -1;
switch (_parent.tar) {
case "main" :
switch (_name) {
case "but1" :
openMenu("select");
break;
case "but2" :
_root.begin = -2;
getURL (walkurl, "_blank");
break;
case "but3" :
openMenu("credit");
break;
case "but4" :
_root.begin = -2;
getURL (morelevelsurl, "_blank");
break;
case "but5" :
_root.begin = -2;
getURL (sponsorurl, "_blank");
}
break;
case "score" :
switch (_name) {
case "but1" :
if (_root.lvl == 30) {
openMenu("main");
} else {
openMenu("select");
}
_root.lvl = 0;
break;
case "but2" :
_root.menu_screen.play();
break;
case "but3" :
if (_root.lvl == 30) {
openMenu("main");
} else {
_root.submitScore();
}
_root.lvl = 0;
break;
case "but4" :
openMenu("select");
break;
case "but5" :
_root.begin = -2;
getURL (sponsorurl, "_blank");
}
break;
case "submit" :
switch (_name) {
case "but1" :
_root.submitScore();
break;
case "but2" :
openMenu("main");
}
break;
case "select" :
case "achi" :
case "credit" :
case "walk" :
openMenu("main");
break;
case "help" :
_root.menu_screen.play();
}
_root.play_pre.start();
}
}
Symbol 474 MovieClip Frame 1
stop();
Symbol 474 MovieClip Frame 8
stop();
Symbol 485 Button
on (release) {
if (_root.begin == -2) {
_root.begin = -1;
_root.lvl = id;
if (_root.help == true) {
_root.help = false;
openMenu("help");
} else {
_root.menu_screen.play();
}
}
}
Symbol 492 MovieClip Frame 1
stop();
Symbol 510 MovieClip Frame 1
stop();
Symbol 510 MovieClip Frame 12
stop();
Symbol 519 MovieClip Frame 1
rectxt._visible = false;
addtxt._visible = false;
totaladd = 0;
meter.eff._visible = true;
medal = 0;
snd_timer = 0;
score = _root.score;
totalscore = _root.totalscore;
score_add = 0;
half = _root[("level" + _root.lvl) + "s"] / 2;
step = 200 / _root[("level" + _root.lvl) + "s"];
plus = (Math.round(score / 1000) * 5) + 5;
i = 0;
while (i < 3) {
if (_root.lvlmedal[_root.lvl] > i) {
meter["star" + i].gotoAndStop("on");
}
i++;
}
medal_have = Math.ceil((score + 1) / half);
if (_root.lvlmedal[_root.lvl] < medal_have) {
_root.lvlmedal[_root.lvl] = medal_have;
_root.my_so.data.lvlmedal[_root.lvl] = medal_have;
}
trace("have=" + medal_have);
if (_root.lvlmedal[_root.lvl + 1] == undefined) {
_root.lvlmedal[_root.lvl + 1] = 0;
_root.my_so.data.lvlmedal[_root.lvl + 1] = 0;
}
if (_root.lvlrec[_root.lvl] == undefined) {
totaladd = score;
} else if (score > _root.lvlrec[_root.lvl]) {
totaladd = score - _root.lvlrec[_root.lvl];
}
if (totaladd > 0) {
_root.lvlrec[_root.lvl] = score;
_root.my_so.data.lvlrec[_root.lvl] = score;
rectxt._visible = true;
addtxt._visible = true;
addtxt.text = ("(+" + totaladd) + ")";
}
_root.my_so.flush();
scorex.text = score;
_root.totalscore = totalscore + totaladd;
totalscorex.text = _root.totalscore;
rectxt._x = (scorex._x + scorex.textWidth) + 10;
addtxt._x = (totalscorex._x + totalscorex.textWidth) + 10;
onEnterFrame = function () {
if (score > 0) {
if (score > plus) {
totalscore = totalscore + plus;
meter.eff._x = meter.eff._x + (step * plus);
score = score - plus;
score_add = score_add + plus;
} else {
totalscore = totalscore + score;
meter.eff._x = meter.eff._x + (step * score);
score_add = score_add + score;
score = 0;
}
if (snd_timer == 0) {
_root.play_score.start();
snd_timer = 2;
} else {
snd_timer--;
}
}
if (medal < 3) {
meter.eff._x = step * score_add;
if (score_add >= (half * medal)) {
meter["star" + medal].gotoAndPlay(2);
if (medal < 2) {
_root.play_record.start();
} else {
_root.play_medal.start();
}
medal++;
}
} else if (medal == 3) {
meter.eff._visible = false;
meter.eff._x = 0;
medal = 4;
}
};
Symbol 531 Button
on (rollOver) {
_root.play_on.start();
}
on (release) {
getURL ("http://www.silengames.com", "_blank");
_root.play_pre.start();
}
Symbol 539 MovieClip Frame 1
stop();
Symbol 540 MovieClip Frame 1
cur.gotoAndStop(1);
e1.gotoAndStop(2);
e2.gotoAndStop(2);
e3.gotoAndStop(2);
e4.gotoAndStop(2);
e5.gotoAndStop(2);
Symbol 540 MovieClip Frame 20
cur.gotoAndStop(2);
e1.gotoAndStop(1);
Symbol 540 MovieClip Frame 34
e2.gotoAndStop(1);
Symbol 540 MovieClip Frame 44
e3.gotoAndStop(1);
Symbol 540 MovieClip Frame 54
e4.gotoAndStop(1);
Symbol 540 MovieClip Frame 64
e5.gotoAndStop(1);
Symbol 540 MovieClip Frame 70
cur.gotoAndStop(1);
Symbol 543 MovieClip Frame 1
close = false;
_alpha = 0;
tar = "close";
gotoAndStop(tar);
onEnterFrame = function () {
if (close == false) {
if (_alpha < 100) {
_alpha = (_alpha + 10);
} else if (_alpha != 100) {
_alpha = 100;
}
} else if (_alpha > 0) {
_alpha = (_alpha - 10);
} else {
_alpha = 0;
close = false;
gotoAndStop(tar);
_root.begin = -2;
}
};
Symbol 543 MovieClip Frame 2
stop();
but1.img.title = "START GAME";
but2.img.title = "Walkthrough";
but3.img.title = "Credits";
but4.img.title = "More Levels";
but5.img.title = "More Puzzle Games";
Symbol 543 MovieClip Frame 3
but1.img.title = "Main Menu";
stat_lvl = 0;
stat_star = 0;
i = 1;
while (i < 31) {
z = this["lvl" + i];
z.id = i;
if (_root.lvlmedal[i] != undefined) {
z.gotoAndStop(_root.lvlmedal[i] + 2);
stat_lvl++;
stat_star = stat_star + _root.lvlmedal[i];
}
i++;
}
Symbol 543 MovieClip Frame 4
if (_root.lvl == 30) {
but1.img.title = "BACK TO MENU";
} else {
but1.img.title = "CONTINUE";
}
but2.img.title = "Restart";
but4.img.title = "Level Select";
but5.img.title = "More Puzzle Games";
title = ("LEVEL " + _root.lvl) + " RESULTS";
Symbol 543 MovieClip Frame 5
but1.img.title = "Main Menu";
Symbol 543 MovieClip Frame 6
but1.img.title = "SUBMIT SCORE";
but2.img.title = "Main Menu";
Symbol 543 MovieClip Frame 7
but1.img.title = "Main Menu";
Symbol 543 MovieClip Frame 8
but1.img.title = "Main Menu";
Symbol 543 MovieClip Frame 9
but1.img.title = "Continue";
Symbol 545 MovieClip Frame 1
_visible = false;
stop();
Symbol 545 MovieClip Frame 2
_visible = true;
_root.showscore._visible = false;
play();
Symbol 545 MovieClip Frame 9
_root.back.gotoAndStop(2);
_root.levelClear();
_root.menu_type = 0;
Symbol 545 MovieClip Frame 31
_root.menu_type = _root.begin_type;
Symbol 545 MovieClip Frame 44
stop();
_root.begin = -2;
openMenu(tar);
Symbol 545 MovieClip Frame 56
_root.level_screen.text_level.text = String("Level " + _root.lvl);
_root.level_screen.gotoAndPlay(2);
Symbol 545 MovieClip Frame 68
_root.back.gotoAndStop(1);
Symbol 551 MovieClip Frame 1
stop();
_alpha = 0;
needload = false;
onEnterFrame = function () {
if (action != undefined) {
gotoAndStop(action);
switch (action) {
case "LOAD" :
needload = true;
case "SAVE" :
if (_alpha < 100) {
_alpha = (_alpha + 10);
}
break;
case "DONE" :
if (needload == true) {
_root.loadLevel(map);
needload = false;
}
case "NO" :
if (_alpha <= 0) {
break;
}
_alpha = (_alpha - 5);
}
if (_alpha < 1) {
action = undefined;
needload = false;
gotoAndStop (1);
}
}
};