Frame 1
stop();
MochiAd.showPreloaderAd({id:"682a7bd6e2879faf", res:"640x480"});
Frame 75
function onExitMenu() {
clearInterval(idtopscore);
delete idtopscore;
}
function initAll() {
initMc();
initOthers();
initSounds();
}
function initSounds() {
stopAllSounds();
sM1 = new Sound();
sM1.attachSound("music1");
sM2 = new Sound();
sM2.attachSound("music2");
sRelease = new Sound();
sRelease.attachSound("release");
sClick = new Sound();
sClick.attachSound("click");
sBreak = new Sound();
sBreak.attachSound("break");
sPump = new Sound();
sPump.attachSound("pump");
sRoofdown = new Sound();
sRoofdown.attachSound("roofdown");
sWin = new Sound();
sWin.attachSound("win");
sGameOver = new Sound();
sGameOver.attachSound("gameover");
this["sM" + ((level % 2) + 1)].start(0, 50000);
this["sM" + ((level % 2) + 1)].setVolume(60);
}
function initMc() {
dep = ballMinDepth;
i = 0;
while (i < maxBall) {
attachMovie("ball_mc", "ball" + i, dep + i);
this["ball" + i]._visible = false;
this["ball" + i].gotoAndStop((random(numOfType) * 6) + 1);
this["ball" + i]._depth;
dep = dep + 1;
i++;
}
attachMovie("p1_mc", "p1_man", p1Depth);
p1_man._x = 200;
p1_man._y = 295;
attachMovie("p2_mc", "p2_man", p2Depth);
p2_man._x = 440;
p2_man._y = 295;
p2_man._xscale = -100;
p1_man.gotoAndStop(14);
p2_man.gotoAndStop(14);
dep = 0;
dep = scoreMinDepth;
dep2 = dep + 100;
tempox1 = score1xpos;
tempox2 = score2xpos;
tempoy = score1ypos;
s1 = 0;
while (s1 < 10) {
attachMovie("scorenum_mc", "scorenum1" + s1, dep + s1);
this["scorenum1" + s1].gotoAndStop(1);
this["scorenum1" + s1]._x = tempox1;
this["scorenum1" + s1]._y = tempoy;
attachMovie("scorenum_mc", "scorenum2" + s1, dep2 + s1);
this["scorenum2" + s1].gotoAndStop(1);
this["scorenum2" + s1]._x = tempox2;
this["scorenum2" + s1]._y = tempoy;
tempox1 = tempox1 + 15;
tempox2 = tempox2 + 15;
s1++;
}
combo1.gotoAndStop(40);
combo2.gotoAndStop(40);
dept = blokMinDepth;
dept2 = blokMinDepth + 100;
tx1 = p1xpos - 3;
tx2 = p2xpos - 4;
ty1 = p1ypos - 2;
ty2 = p2ypos - 2;
nb = 0;
while (nb < numBlok) {
attachMovie("blok_mc", "blok1" + nb, dept + nb);
this["blok1" + nb]._x = tx1;
this["blok1" + nb]._y = ty1;
this["blok1" + nb]._visible = false;
if ((nb % 2) == 0) {
this["blok1" + nb].gotoAndStop(1);
} else {
this["blok1" + nb].gotoAndStop(2);
}
attachMovie("blok_mc", "blok2" + nb, dept2 + nb);
this["blok2" + nb]._x = tx2;
this["blok2" + nb]._y = ty2;
this["blok2" + nb]._visible = false;
if ((nb % 2) == 0) {
this["blok2" + nb].gotoAndStop(1);
} else {
this["blok2" + nb].gotoAndStop(2);
}
ty1 = ty1 + ballHeight;
ty2 = ty2 + ballHeight;
nb++;
}
attachMovie("texts_mc", "textmc", 99999);
textmc.gotoAndStop(5);
textmc._x = 320;
textmc._y = 240;
attachMovie("stagetext_mc", "stage", 100000);
stage.gotoAndStop(11);
stage._x = 110;
stage._y = 100;
stage._alpha = 100;
attachMovie("stagetext_mc", "stage1", 100001);
stage1._x = 420;
stage1._y = 110;
stage1._alpha = 100;
if (level == undefined) {
level = 1;
}
lev = Math.floor(level / 10) + 1;
stage1.gotoAndStop(lev);
attachMovie("stagetext_mc", "stage2", 100002);
lev = (level % 10) + 1;
stage2.gotoAndStop(lev);
stage2._x = 480;
stage2._y = 110;
stage2._alpha = 100;
if (isCpu == true) {
textmc._visible = false;
clearInterval(idStage);
idStage = setInterval(stageN, 30);
} else {
stage._visible = false;
stage1._visible = false;
stage2._visible = false;
idReadyGo = setInterval(readyGo, 10);
}
depth = laMinDepth;
depth2 = laMinDepth + 100;
tx1 = p1xpos + 4;
tx2 = p2xpos + 4;
ty = 440;
la = 0;
while (la < 5) {
attachMovie("pentil_mc", "pentil1" + la, depth + la);
this["pentil1" + la]._x = tx1;
this["pentil1" + la]._y = ty;
this["pentil1" + la].gotoAndStop(1);
attachMovie("pentil_mc", "pentil2" + la, depth2 + la);
this["pentil2" + la]._x = tx2;
this["pentil2" + la]._y = ty;
this["pentil2" + la].gotoAndStop(1);
tx1 = tx1 + ballWidth;
tx2 = tx2 + ballWidth;
la++;
}
attachMovie("resume_btn", "resumebtn", 1000000);
attachMovie("next_btn", "nextbtn", 1000001);
attachMovie("main_btn", "mainbtn", 1000002);
attachMovie("retry_btn", "retrybtn", 1000003);
mainbtn._x = 260;
nextbtn._x = 260;
resumebtn._x = 260;
retrybtn._x = 260;
mainbtn._y = 350;
nextbtn._y = 300;
resumebtn._y = 300;
retrybtn._y = 300;
mainbtn.onRelease = function () {
sClick.start();
onExitGame1();
gotoAndStop ("menu");
};
nextbtn.onRelease = function () {
sClick.start();
nextLevel();
};
resumebtn.onRelease = function () {
sClick.start();
isPause = false;
textmc._visible = false;
resumebtn._visible = false;
mainbtn._visible = false;
};
retrybtn.onRelease = function () {
sClick.start();
onExitGame1();
isCpu = false;
initAll();
fillQueue();
removeFirstBallFromQueue();
};
mainbtn._visible = false;
nextbtn._visible = false;
resumebtn._visible = false;
retrybtn._visible = false;
}
function initOthers() {
if (isNextLevel != true) {
p1score = 0;
p2score = 0;
}
p1Full = new Array();
p2Full = new Array();
o = 0;
while (o < 5) {
p1Full.push(false);
p2Full.push(false);
o++;
}
if (isCpu != true) {
scorePerBall = 100;
comboScore = 500;
}
isNextLevel = false;
isP1combo = false;
isP2combo = false;
p1L = 0;
p2L = 0;
arP1 = new Array();
arP2 = new Array();
aLP1 = new Array();
aLP2 = new Array();
arQ = new Array();
isPlay = true;
isPause = true;
isP1Ready = true;
isP2Ready = true;
score = 0;
p1power = 10;
p2power = 10;
isP1Win = false;
isP2Win = false;
clearInterval(idNextLevel);
x1 = p1xpos;
x2 = p2xpos;
y1 = (y2 = p1ypos);
xlpos1 = p1xpos;
xlpos2 = p2xpos;
ylpos1 = (ylpos2 = 406);
l = 0;
while (l < 5) {
aLP1.push({mc:"", xpos:xlpos1, ypos:ylpos1, indeks:i, tipe:99});
aLP2.push({mc:"", xpos:xlpos2, ypos:ylpos2, indeks:i, tipe:99});
xlpos1 = xlpos1 + ballWidth;
xlpos2 = xlpos2 + ballWidth;
l++;
}
i = 0;
while (i < maxPlayerBall) {
arP1.push({xpos:x1, ypos:y1, tipe:99, indeks:i, mc:"", islaunch:false, isNeedUpdate:false});
arP2.push({xpos:x2, ypos:y2, tipe:99, indeks:i, mc:"", islaunch:false, isNeedUpdate:false});
x1 = x1 + ballWidth;
x2 = x2 + ballWidth;
if ((i == 4) || (((i % 5) - 4) == 0)) {
x1 = p1xpos;
x2 = p2xpos;
y1 = y1 + ballHeight;
y2 = y2 + ballHeight;
}
i++;
}
qx = qxpos;
qy = qypos;
i = 0;
while (i < maxBallQueue) {
arQ.push({xpos:qx, ypos:qy, tipe:99, mc:"", isNeedUpdate:false});
qy = qy + ballHeight;
i++;
}
updateScore(1);
updateScore(2);
}
function startPlay() {
index = 0;
i = 0;
while (i < ((maxPlayerBall * 2) - 12)) {
this["ball" + index].gotoAndStop(1);
this["ball" + index]._visible = true;
if (i < maxPlayerBall) {
arP1[i].tipe = Math.ceil(this["ball" + index]._currentframe / 6);
arP1[i].mc = this["ball" + index];
this["ball" + index]._x = arP1[i].xpos;
this["ball" + index]._y = arP1[i].ypos;
} else {
arP2[i - 50].tipe = Math.ceil(this["ball" + index]._currentframe / 6);
arP2[i - 50].mc = this["ball" + index];
this["ball" + index]._x = arP2[i - 50].xpos;
this["ball" + index]._y = arP2[i - 50].ypos;
}
index = index + 1;
i++;
}
}
function fillQueue() {
i = maxBallQueue - 1;
while (i >= 0) {
if (arQ[i].mc == "") {
if ((arQ[i - 1].mc == "") || (i == 0)) {
arQ[i].mc = getFreeBall();
arQ[i].mc._visible = true;
arQ[i].mc._x = arQ[i].xpos;
arQ[i].mc._y = arQ[i].ypos;
arQ[i].isNeedUpdate = false;
arQ[i].tipe = Math.ceil(arQ[i].mc._currentframe / 6);
} else {
arQ[i].mc = arQ[i - 1].mc;
arQ[i - 1].tipe = 99;
arQ[i - 1].mc = "";
arQ[i].mc._visible = true;
arQ[i].mc._x = arQ[i].xpos;
arQ[i].mc._y = arQ[i].ypos;
arQ[i].isNeedUpdate = false;
arQ[i].tipe = Math.ceil(arQ[i].mc._currentframe / 6);
}
}
i--;
}
}
function getFreeBall() {
mc = "";
j = 0;
while (j < maxBall) {
if (this["ball" + j]._visible == false) {
mc = this["ball" + j];
mc.gotoAndStop((random(numOfType) * 6) + 1);
break;
}
j++;
}
return(mc);
}
function removeFirstBallFromQueue() {
if (isP1Ready == true) {
k = maxBallQueue - 1;
while (k >= 0) {
if (arQ[k].mc != "") {
tempmc1 = arQ[k].mc;
arQ[k].mc = "";
arQ[k].tipe = 99;
placeBall(1, tempmc1);
isP1Ready = false;
break;
}
k--;
}
fillQueue();
}
if (isP2Ready == true) {
k = maxBallQueue - 1;
while (k >= 0) {
if (arQ[k].mc != "") {
tempmc1 = arQ[k].mc;
arQ[k].mc = "";
arQ[k].tipe = 99;
placeBall(2, tempmc1);
isP2Ready = false;
break;
}
k--;
}
}
fillQueue();
}
function placeBall(player, mc) {
if (player == 1) {
loc = p1L;
} else if (player == 2) {
loc = p2L;
}
mc._x = this["aLP" + player][loc].xpos;
mc._y = this["aLP" + player][loc].ypos;
this["aLP" + player][loc].mc = mc;
this["aLP" + player][loc].tipe = Math.ceil(mc._currentframe / 6);
if ((((isCpu == true) and (isPlay == true)) and (isPause == false)) and (player == 2)) {
temploc = think(Math.ceil(mc._currentframe / 6));
if (temploc > p2L) {
while (temploc != p2L) {
moveBallRight(2);
}
} else if (temploc < p2L) {
while (temploc != p2L) {
moveBallLeft(2);
}
}
}
}
function moveBallLeft(player) {
isMove = true;
if (player == 1) {
loc = p1L - 1;
if (loc < 0) {
loc = 0;
isMove = false;
}
p1L = loc;
} else {
loc = p2L - 1;
if (loc < 0) {
loc = 0;
isMove = false;
}
p2L = loc;
}
if ((loc >= 0) and (isMove == true)) {
tempmc1 = this["aLP" + player][loc + 1].mc;
tempmc2 = this["aLP" + player][loc].mc;
tempmc1._x = this["aLP" + player][loc].xpos;
tempmc1._y = this["aLP" + player][loc].ypos;
tempmc2._x = this["aLP" + player][loc + 1].xpos;
tempmc2._y = this["aLP" + player][loc + 1].ypos;
this["aLP" + player][loc + 1].mc = tempmc2;
this["aLP" + player][loc].mc = tempmc1;
this["aLP" + player][loc + 1].tipe = Math.ceil(this["aLP" + player][loc + 1].mc._currentframe / 6);
this["aLP" + player][loc].tipe = Math.ceil(this["aLP" + player][loc].mc._currentframe / 6);
}
}
function moveBallRight(player) {
isMove = true;
if (player == 1) {
loc = p1L + 1;
if (loc > 4) {
loc = 4;
isMove = false;
}
p1L = loc;
} else {
loc = p2L + 1;
if (loc > 4) {
loc = 4;
isMove = false;
}
p2L = loc;
}
if ((loc <= 4) and (isMove == true)) {
tempmc1 = this["aLP" + player][loc - 1].mc;
tempmc2 = this["aLP" + player][loc].mc;
tempmc1._x = this["aLP" + player][loc].xpos;
tempmc1._y = this["aLP" + player][loc].ypos;
tempmc2._x = this["aLP" + player][loc - 1].xpos;
tempmc2._y = this["aLP" + player][loc - 1].ypos;
this["aLP" + player][loc - 1].mc = tempmc2;
this["aLP" + player][loc].mc = tempmc1;
this["aLP" + player][loc - 1].tipe = Math.ceil(this["aLP" + player][loc - 1].mc._currentframe / 6);
this["aLP" + player][loc].tipe = Math.ceil(this["aLP" + player][loc].mc._currentframe / 6);
}
}
function checkH(arP, player) {
val = false;
ind = arP.indeks;
if (((ind % 5) != 0) and (((ind % 5) - 4) != 0)) {
if (((this["arP" + player][ind].tipe != 99) and (this["arP" + player][ind].tipe != 88)) and (this["arP" + player][ind].isNeedUpdate == false)) {
if ((this["arP" + player][ind].tipe == this["arP" + player][ind - 1].tipe) and (this["arP" + player][ind].tipe == this["arP" + player][ind + 1].tipe)) {
if ((this["arP" + player][ind - 1].isNeedUpdate == false) and (this["arP" + player][ind + 1].isNeedUpdate == false)) {
val = true;
}
}
}
}
return(val);
}
function checkV(arP, player) {
val = false;
ind = arP.indeks;
if ((ind > 4) and (ind < (maxPlayerBall - 10))) {
if (((this["arP" + player][ind].tipe != 99) and (this["arP" + player][ind].tipe != 99)) and (this["arP" + player][ind].isNeedUpdate == false)) {
if ((this["arP" + player][ind].tipe == this["arP" + player][ind - 5].tipe) and (this["arP" + player][ind].tipe == this["arP" + player][ind + 5].tipe)) {
if ((this["arP" + player][ind - 5].isNeedUpdate == false) and (this["arP" + player][ind + 5].isNeedUpdate == false)) {
val = true;
}
}
}
}
return(val);
}
function checkBall(arP, player) {
indeks = arP.indeks;
arJadi = [];
if (player == 1) {
numBall1 = 0;
jd = 0;
while (jd < maxPlayerBall) {
if ((arP1[jd].tipe != 99) and (arP1[jd].tipe != 88)) {
if (checkH(arP1[jd], 1) == true) {
arJadi.push(jd);
arJadi.push(jd + 1);
arJadi.push(jd - 1);
}
if (checkV(arP1[jd], 1) == true) {
arJadi.push(jd);
arJadi.push(jd + 5);
arJadi.push(jd - 5);
}
}
jd++;
}
arJadi.sort(Array.DESCENDING);
jad = 0;
while (jad < arJadi.length) {
if (arJadi[jad] != arJadi[jad - 1]) {
numBall1 = numBall1 + 1;
}
removeBall(arP1[arJadi[jad]], 1);
p1Full[arJadi[jad] % 5] = false;
jad++;
}
if (numBall1 > 0) {
sBreak.start();
bomb(2);
if (isP1combo == true) {
p1score = p1score + ((numBall1 * scorePerBall) + comboScore);
combo1.gotoAndPlay(1);
} else {
p1score = p1score + (numBall1 * scorePerBall);
}
updateScore(1);
isP1combo = true;
} else {
isP1combo = false;
}
} else if (player == 2) {
numBall2 = 0;
jd = 0;
while (jd < maxPlayerBall) {
if ((arP2[jd].tipe != 99) and (arP2[jd].tipe != 88)) {
if (checkH(arP2[jd], 2) == true) {
arJadi.push(jd);
arJadi.push(jd + 1);
arJadi.push(jd - 1);
}
if (checkV(arP2[jd], 2) == true) {
arJadi.push(jd);
arJadi.push(jd + 5);
arJadi.push(jd - 5);
}
}
jd++;
}
arJadi.sort(Array.DESCENDING);
jad = 0;
while (jad < arJadi.length) {
if (arJadi[jad] != arJadi[jad - 1]) {
numBall2 = numBall2 + 1;
}
removeBall(arP2[arJadi[jad]], 2);
if (p2Full[arJadi[jad] % 5] == true) {
p2Full[arJadi[jad] % 5] = false;
}
jad++;
}
if (numBall2 > 0) {
sBreak.start();
bomb(1);
if (isP2combo == true) {
p2score = p2score + ((numBall2 * scorePerBall) + comboScore);
combo2.gotoAndPlay(1);
} else {
p2score = p2score + (numBall2 * scorePerBall);
}
updateScore(2);
isP2combo = true;
} else {
isP2combo = false;
}
}
}
function removeBall(arP, player) {
tempmc = arP.mc;
tempmc._visible = false;
arP.mc = "";
arP.tipe = 99;
}
function swapBall(player, index1, index2, wantMove) {
tempmc1 = this["arP" + player][index1].mc;
tempmc2 = this["arP" + player][index2].mc;
tipe1 = this["arP" + player][index1].tipe;
tipe2 = this["arP" + player][index2].tipe;
update1 = this["arP" + player][index1].isNeedUpdate;
update2 = this["arP" + player][index2].isNeedUpdate;
this["arP" + player][index1].mc = tempmc2;
this["arP" + player][index2].mc = tempmc1;
if (wantMove == true) {
this["arP" + player][index1].mc._x = this["arP" + player][index1].xpos;
this["arP" + player][index2].mc._x = this["arP" + player][index2].xpos;
this["arP" + player][index1].mc._y = this["arP" + player][index1].ypos;
this["arP" + player][index2].mc._y = this["arP" + player][index2].ypos;
}
this["arP" + player][index1].tipe = tipe2;
this["arP" + player][index2].tipe = tipe1;
this["arP" + player][index1].isNeedUpdate = update2;
this["arP" + player][index2].isNeedUpdate = update1;
}
function think(tipe) {
isget = false;
tempi = random(5);
ck = 0;
while (ck < maxPlayerBall) {
if (arP2[ck].mc == "") {
if ((arP2[ck - 5].mc == undefined) or (arP2[ck - 5].mc != "")) {
if ((arP2[ck - 5].tipe == arP2[ck - 10].tipe) and (arP2[ck - 5].tipe == tipe)) {
tempi = ck % 5;
isget = true;
break;
}
if (isget == false) {
if ((ck % 5) == 0) {
if ((arP2[ck + 1].tipe == arP2[ck + 2].tipe) and (tipe == arP2[ck + 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
} else if ((ck % 5) == 4) {
if ((arP2[ck - 1].tipe == arP2[ck - 2].tipe) and (tipe == arP2[ck - 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
} else if ((ck % 5) == 1) {
if ((arP2[ck + 1].tipe == arP2[ck + 2].tipe) and (tipe == arP2[ck + 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
if ((arP2[ck - 1].tipe == arP2[ck + 1].tipe) and (tipe == arP2[ck + 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
} else if ((ck % 5) == 2) {
if ((arP2[ck + 1].tipe == arP2[ck + 2].tipe) and (tipe == arP2[ck + 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
if ((arP2[ck - 1].tipe == arP2[ck - 2].tipe) and (tipe == arP2[ck - 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
if ((arP2[ck - 1].tipe == arP2[ck + 1].tipe) and (tipe == arP2[ck + 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
} else if ((ck % 5) == 3) {
if ((arP2[ck - 1].tipe == arP2[ck - 2].tipe) and (tipe == arP2[ck - 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
if ((arP2[ck - 1].tipe == arP2[ck + 1].tipe) and (tipe == arP2[ck + 1].tipe)) {
tempi = ck % 5;
isget = true;
break;
}
}
}
}
}
ck++;
}
if (isget == false) {
po = 0;
while (po < maxPlayerBall) {
if ((arP2[po].tipe == tipe) and (arP2[po + 5].tipe == 99)) {
tempi = po % 5;
isget = true;
break;
}
po++;
}
if (isget == false) {
po = 0;
while (po < maxPlayerBall) {
if (arP2[po].tipe == 99) {
tempi = po % 5;
break;
}
po++;
}
}
}
return(tempi);
}
function updateBallMovement() {
m = 0;
while (m < maxPlayerBall) {
if (arP1[m].mc == "") {
if ((arP1[m + 5].mc != "") and (arP1[m + 5].mc != undefined)) {
arP1[m + 5].isNeedUpdate = true;
swapBall(1, m, m + 5, false);
if (!idUpdateBall) {
idUpdateBall = setInterval(updateBallsY, 30);
}
}
}
if (m > (maxPlayerBall - 6)) {
arP1[m + 5].mc._visible = false;
}
if (arP2[m].mc == "") {
if ((arP2[m + 5].mc != "") and (arP2[m + 5].mc != undefined)) {
arP2[m + 5].isNeedUpdate = true;
swapBall(2, m, m + 5, false);
if (!idUpdateBall) {
idUpdateBall = setInterval(updateBallsY, 30);
}
}
}
if (m > (maxPlayerBall - 6)) {
arP2[m + 5].mc._visible = false;
}
m++;
}
}
function releaseBall(player) {
sRelease.start();
if (player == 1) {
isP1Ready = true;
launcher = p1L;
} else {
isP2Ready = true;
launcher = p2L;
}
rb = 0;
while (rb < maxPlayerBall) {
if (((this["arP" + player][rb].mc != "") and (this["arP" + player][rb].mc != undefined)) and (this["arP" + player][rb].mc != "blok")) {
if (this["aLP" + player][launcher].mc.getDepth() < this["arP" + player][rb].mc.getDepth()) {
this["aLP" + player][launcher].mc.swapDepths(this["arP" + player][rb].mc);
}
}
rb++;
}
relMc = this["aLP" + player][launcher].mc;
this["aLP" + player][launcher].mc = "";
rb = 0;
while (rb < maxPlayerBall) {
if ((rb % 5) == launcher) {
if (this["arP" + player][rb].mc == "") {
this["arP" + player][rb].mc = relMc;
this["arP" + player][rb].tipe = Math.ceil(relMc._currentframe / 6);
this["arP" + player][rb].islaunch = true;
this["arP" + player][rb].isNeedUpdate = true;
if (rb > (maxPlayerBall - 6)) {
if (player == 1) {
isP1Win = false;
isP2Win = true;
} else {
isP1Win = true;
isP2Win = false;
}
gameOver();
}
break;
}
}
rb++;
}
if (!idUpdateBall) {
idUpdateBall = setInterval(updateBallsY, 30);
}
removeFirstBallFromQueue();
}
function updateBallsY() {
if (idUpdateBall and (isPause == false)) {
num1 = 0;
num2 = 0;
u = 0;
while (u < maxPlayerBall) {
if (arP1[u].isNeedUpdate == false) {
num1++;
if (arP1[u].mc._y > bottomBorder) {
isP1Win = false;
isP2Win = true;
gameOver();
}
} else {
arP1[u].mc._y = arP1[u].mc._y - ballSpeed;
if (arP1[u].mc._y < arP1[u].ypos) {
arP1[u].mc._y = arP1[u].ypos;
arP1[u].isNeedUpdate = false;
if (arP1[u].islaunch == true) {
isP1combo = false;
}
arP1[u].islaunch = false;
if (u > (maxPlayerBall - 11)) {
p1Full[u % 5] = true;
}
checkBall(arP1[u], 1);
}
}
if (arP2[u].isNeedUpdate == false) {
num2++;
if (arP2[u].mc._y > bottomBorder) {
isP1Win = true;
isP2Win = false;
gameOver();
}
} else {
arP2[u].mc._y = arP2[u].mc._y - ballSpeed;
if (arP2[u].mc._y < arP2[u].ypos) {
arP2[u].mc._y = arP2[u].ypos;
arP2[u].isNeedUpdate = false;
if (arP2[u].islaunch == true) {
isP2combo = false;
}
arP2[u].islaunch = false;
if (u > (maxPlayerBall - 11)) {
p2Full[u % 5] = true;
}
checkBall(arP2[u], 2);
}
}
u++;
}
if ((num1 == num2) and (num1 == maxPlayerBall)) {
clearInterval(idUpdateBall);
delete idUpdateBall;
}
}
}
function pump(player) {
if (player == 1) {
sPump.start();
p1power = p1power + 5;
this["pentil1" + p1L].play();
if (p1power > 60) {
p1power = 10;
releaseBall(player);
} else {
ttipe = aLP1[p1L].tipe - 1;
aLP1[p1L].mc.gotoAndStop(Math.floor(p1power / 10) + (ttipe * 6));
}
if (p1_man._currentframe == 14) {
p1_man.gotoAndStop(15);
} else {
p1_man.gotoAndStop(14);
}
if (p1Full[p1L] == true) {
isP1Win = false;
isP2Win = true;
gameOver();
}
} else if (player == 2) {
if (isCpu == false) {
sPump.start();
p2power = p2power + 5;
this["pentil2" + p2L].play();
if (p2power > 60) {
p2power = 10;
releaseBall(player);
} else {
ttipe = aLP2[p2L].tipe - 1;
aLP2[p2L].mc.gotoAndStop(Math.floor(p2power / 10) + (ttipe * 6));
}
if (p2_man._currentframe == 14) {
p2_man.gotoAndStop(15);
} else {
p2_man.gotoAndStop(14);
}
} else if ((isPlay == true) and (isPause == false)) {
pumpCount++;
if (pumpCount > pumpCounter) {
sPump.start();
pumpCount = 0;
p2power = p2power + 5;
_root["pentil2" + p2L].play();
if (p2power > 60) {
p2power = 10;
releaseBall(player);
} else {
ttipe = aLP2[p2L].tipe - 1;
aLP2[p2L].mc.gotoAndStop(Math.floor(p2power / 10) + (ttipe * 6));
}
if (p2_man._currentframe == 14) {
p2_man.gotoAndStop(15);
} else {
p2_man.gotoAndStop(14);
}
}
}
if (p2Full[p2L] == true) {
isP2Win = false;
isP1Win = true;
gameOver();
}
}
}
function bomb(player) {
sRoofdown.start();
bm = maxPlayerBall - 1;
while (bm >= 0) {
if ((this["arP" + player][bm].mc != "") and (this["arP" + player][bm + 5].mc != undefined)) {
if (this["arP" + player][bm].isNeedUpdate == false) {
swapBall(player, bm, bm + 5, true);
} else if (this["arP" + player][bm].isNeedUpdate == true) {
swapBall(player, bm, bm + 5, false);
}
if ((this["arP" + player][bm + 5].mc._y > bottomBorder) and (this["arP" + player][bm + 5].isNeedUpdate == false)) {
this["arP" + player][bm + 5].mc._visible = false;
if (player == 1) {
isP1Win = false;
isP2Win = true;
} else {
isP1Win = true;
isP2Win = false;
}
gameOver();
}
}
bm--;
}
bl = 0;
while (bl < 5) {
if (this["arP" + player][bl].mc == "") {
this["arP" + player][bl].mc = "blok";
this["arP" + player][bl].tipe = 88;
}
bl++;
}
bk = 0;
while (bk < (numBlok - 1)) {
if (this["arP" + player][bk * 5].tipe == 88) {
if (player == 1) {
this["blok1" + bk]._visible = true;
} else if (player == 2) {
this["blok2" + bk]._visible = true;
}
} else if (player == 1) {
this["blok1" + bk]._visible = false;
} else if (player == 2) {
this["blok2" + bk]._visible = false;
}
bk++;
}
if (this.blok110._visible == true) {
isP1Win = false;
isP2Win = true;
gameOver();
}
if (this.blok210._visible == true) {
isP1Win = true;
isP2Win = false;
gameOver();
}
}
function gameOver() {
stopAllSounds();
mainbtn._visible = true;
isPlay = false;
if (isP1Win == true) {
sWin.start(0, 100000);
nb = 0;
while (nb < (numBlok - 1)) {
this["blok2" + nb]._visible = true;
nb++;
}
nb = 0;
while (nb < maxPlayerBall) {
arP2[nb]._visible = false;
nb++;
}
p1_man.gotoAndPlay(16);
p2_man.gotoAndPlay(7);
textmc._visible = true;
textmc._alpha = 100;
if (isCpu == true) {
textmc.gotoAndStop(3);
if (level < 99) {
isNextLevel = true;
nextbtn._visible = true;
} else if (p1score > lowestScore) {
retry_btn._visible = true;
mainbtn._visible = true;
}
} else {
textmc.gotoAndStop(1);
retrybtn._visible = true;
}
} else if (isP2Win == true) {
nb = 0;
while (nb < (numBlok - 1)) {
this["blok1" + nb]._visible = true;
nb++;
}
nb = 0;
while (nb < maxPlayerBall) {
arP1[nb]._visible = false;
nb++;
}
p1_man.gotoAndPlay(7);
p2_man.gotoAndPlay(16);
textmc._visible = true;
textmc._alpha = 100;
if (isCpu == true) {
sGameOver.start(0, 100000);
textmc.gotoAndStop(4);
if (p1score > lowestScore) {
mainbtn._visible = true;
retrybtn._visible = true;
}
} else {
sWin.start(0, 100000);
textmc.gotoAndStop(2);
retrybtn._visible = true;
}
}
clearInterval(idUpdateBall);
}
function updateScore(player) {
if (player == 1) {
index = 9;
tempScore = p1score;
temp = 0;
while (tempScore > 0) {
temp = tempScore % 10;
tempScore = (tempScore - temp) / 10;
this["scorenum1" + index].gotoAndStop(temp + 1);
index--;
}
} else if (player == 2) {
index = 9;
tempScore = p2score;
temp = 0;
while (tempScore > 0) {
temp = tempScore % 10;
tempScore = (tempScore - temp) / 10;
this["scorenum2" + index].gotoAndStop(temp + 1);
index--;
}
}
}
function readyGo() {
if (idReadyGo) {
if (textmc._currentframe == 5) {
textmc._alpha = textmc._alpha - 1;
if (textmc._alpha <= 0) {
textmc.gotoAndStop(6);
}
} else if (textmc._currentframe == 6) {
textmc._alpha = textmc._alpha + 3;
if (textmc._alpha >= 100) {
textmc._visible = false;
textmc._alpha = 100;
isPause = false;
p1_man.play();
p2_man.play();
clearInterval(idReadyGo);
delete idReadyGo;
}
}
}
}
function pauseGame() {
p1_man.stop();
p2_man.stop();
textmc.gotoAndStop(7);
textmc._visible = true;
textmc._alpha = 100;
mainbtn._visible = true;
resumebtn._visible = true;
}
function onExitGame1() {
clearInterval(idNextLevel);
delete idNextLevel;
clearInterval(idUpdateBall);
clearInterval(idReadyGo);
clearInterval(idStage);
delete idUpdateBall;
delete idReadyGo;
delete idStage;
removeMovieClip(inputmc);
removeMovieClip(resumebtn);
removeMovieClip(nextbtn);
removeMovieClip(mainbtn);
removeMovieClip(retrybtn);
i = 0;
while (i < maxBall) {
removeMovieClip(this["ball" + i]);
i++;
}
removeMovieClip(p1_man);
removeMovieClip(p2_man);
s1 = 0;
while (s1 < 10) {
removeMovieClip(this["scorenum1" + s1]);
removeMovieClip(this["scorenum2" + s1]);
s1++;
}
nb = 0;
while (nb < numBlok) {
removeMovieClip(this["blok1" + nb]);
removeMovieClip(this["blok2" + nb]);
nb++;
}
removeMovieClip(textmc);
la = 0;
while (la < 5) {
removeMovieClip(this["pentil1" + la]);
removeMovieClip(this["pentil2" + la]);
la++;
}
removeMovieClip(stage);
removeMovieClip(stage1);
removeMovieClip(stage2);
}
function initCom() {
isCpu = true;
if ((isNextLevel != true) and (level == undefined)) {
level = 1;
}
scorePerBall = 100 * Math.ceil(level * 0.5);
comboScore = 500 * Math.ceil(level * 0.5);
pumpCounter = Math.floor(31 - (level * 0.3));
if (pumpCounter < 5) {
pumpCounter = 5;
}
pumpCount = 0;
clearInterval(idComAction);
idComAction = setInterval(pump, 10, 2);
}
function nextLevel() {
level = level + 1;
if (level > 99) {
level = 99;
}
onExitGame1();
initCom();
initAll();
fillQueue();
removeFirstBallFromQueue();
clearInterval(idNextLevel);
delete idNextLevel;
}
function stageN() {
if (idStage) {
stage._alpha = stage._alpha - 1;
stage1._alpha = stage1._alpha - 1;
stage2._alpha = stage2._alpha - 1;
if (stage._alpha < 0) {
textmc._alpha = 200;
textmc.gotoAndStop(5);
textmc._visible = true;
if (!idReadyGo) {
idReadyGo = setInterval(readyGo, 10);
}
clearInterval(idStage);
delete idStage;
}
}
}
stop();
stopAllSounds();
var darimenu = false;
var menuso = new Sound();
menuso.attachSound("menus");
menuso.start(0, 10000);
var level;
easybtn._visible = false;
normalbtn._visible = false;
hardbtn._visible = false;
vsplayer.onRelease = function () {
sClick.start();
onExitMenu();
gotoAndStop ("game1");
};
vscpu.onRelease = function () {
sClick.start();
easybtn._visible = true;
normalbtn._visible = true;
hardbtn._visible = true;
vscpu._visible = false;
vsplayer._visible = false;
tutbtn._visible = false;
};
tutbtn.onRelease = function () {
sClick.start();
onExitMenu();
gotoAndStop ("tut");
};
easybtn.onRelease = function () {
sClick.start();
level = 1;
onExitMenu();
gotoAndStop ("game2");
};
normalbtn.onRelease = function () {
sClick.start();
level = 20;
onExitMenu();
gotoAndStop ("game2");
};
hardbtn.onRelease = function () {
sClick.start();
level = 50;
onExitMenu();
gotoAndStop ("game2");
};
this.onEnterFrame = function () {
if (Key.isDown(13)) {
darimenu = true;
gotoAndStop ("topscore");
}
};
var maxPlayerBall = 60;
var maxBallQueue = 4;
var ballMinDepth = 100;
var laMinDepth = 800;
var maxBall = ((maxPlayerBall * 2) + maxBallQueue);
var ballMaxDepth = (ballMinDepth + maxBall);
var bottomBorder = 440;
var scorePerBall = 100;
var comboScore = 500;
var numBlok = (maxPlayerBall / 5);
var p1Depth = 400;
var p2Depth = 401;
var scoreMinDepth = 1000;
var blokMinDepth = 500;
var ballWidth = 27;
var ballHeight = 35;
var p1xpos = 28;
var p1ypos = 56;
var p2xpos = 481;
var p2ypos = 56;
var score1xpos = 24;
var score1ypos = 23;
var score2xpos = 470;
var score2ypos = 23;
var qxpos = 307;
var qypos = 123;
var numOfType = 6;
var ballSpeed = 10;
var isPlay;
var isPause;
var score;
var isP1Win;
var isP2Win;
var isP1Ready;
var isP2Ready;
var p1power;
var p2power;
var p1score;
var p2score;
var isP1combo;
var isP2combo;
var p1L;
var p2L;
var arP1;
var arP2;
var aLP1;
var aLP2;
var arQ;
var p1Full;
var p2Full;
var sM1;
var sM2;
var sRelease;
var sClick;
var sBreak;
var sPump;
var sRoofdown;
var sWin;
var sGameOver;
var isCpu;
var pumpCounter;
var pumpCount;
var isNextLevel;
Frame 76
stop();
stopAllSounds();
clearInterval(idUpdateBall);
clearInterval(idReadyGo);
clearInterval(idComAction);
isCpu = false;
initAll();
fillQueue();
removeFirstBallFromQueue();
this.onKeyUp = function () {
trace(Key.getCode());
if ((isPlay == true) and (isPause == false)) {
if (Key.getCode() == 19) {
isPause = true;
pauseGame();
}
if (Key.getCode() == 27) {
isPause = true;
pauseGame();
}
if (Key.getCode() == 80) {
isPause = true;
pauseGame();
}
if (Key.getCode() == 65) {
moveBallLeft(1);
}
if (Key.getCode() == 68) {
moveBallRight(1);
}
if (Key.getCode() == 32) {
pump(1);
}
if (Key.getCode() == 81) {
}
if (Key.getCode() == 37) {
moveBallLeft(2);
}
if (Key.getCode() == 39) {
moveBallRight(2);
}
if (Key.getCode() == 96) {
pump(2);
}
if (Key.getCode() == 110) {
trace(aLP2[p2L].tipe);
trace(think(Math.floor(aLP2[p2L].mc._currentframe / 6)));
}
} else if ((isPlay == true) and (isPause == true)) {
if (Key.getCode() == 19) {
isPause = false;
textmc._visible = false;
resumebtn._visible = false;
mainbtn._visible = false;
}
if (Key.getCode() == 27) {
isPause = false;
textmc._visible = false;
resumebtn._visible = false;
mainbtn._visible = false;
}
if (Key.getCode() == 80) {
isPause = false;
textmc._visible = false;
resumebtn._visible = false;
mainbtn._visible = false;
}
}
};
this.onKeyDown = function () {
if (isPlay == false) {
if (Key.isDown(13)) {
onExitGame1();
gotoAndStop ("menu");
}
}
};
Key.addListener(this);
this.onEnterFrame = function () {
if ((isPlay == true) and (isPause == false)) {
updateBallMovement();
}
};
Frame 77
stop();
stopAllSounds();
clearInterval(idUpdateBall);
clearInterval(idReadyGo);
clearInterval(idComAction);
initCom();
initAll();
fillQueue();
removeFirstBallFromQueue();
this.onKeyUp = function () {
if ((isPlay == true) and (isPause == false)) {
if (Key.getCode() == 19) {
isPause = true;
pauseGame();
}
if (Key.getCode() == 27) {
isPause = true;
pauseGame();
}
if (Key.getCode() == 80) {
isPause = true;
pauseGame();
}
if (Key.getCode() == 65) {
moveBallLeft(1);
}
if (Key.getCode() == 68) {
moveBallRight(1);
}
if (Key.getCode() == 32) {
pump(1);
}
if (Key.getCode() == 81) {
}
} else if ((isPlay == true) and (isPause == true)) {
if (Key.getCode() == 19) {
isPause = false;
textmc._visible = false;
resumebtn._visible = false;
mainbtn._visible = false;
}
if (Key.getCode() == 27) {
isPause = false;
textmc._visible = false;
resumebtn._visible = false;
mainbtn._visible = false;
}
if (Key.getCode() == 80) {
isPause = false;
textmc._visible = false;
resumebtn._visible = false;
mainbtn._visible = false;
}
}
};
this.onKeyDown = function () {
if (isNextLevel == true) {
if (Key.isDown(13)) {
clearInterval(idNextLevel);
delete idNextLevel;
nextLevel();
}
}
};
Key.addListener(this);
this.onEnterFrame = function () {
if ((isPlay == true) and (isPause == false)) {
updateBallMovement();
}
};
Frame 78
function kemenu() {
if (idmenu) {
onExitTopScore();
gotoAndStop ("menu");
}
}
function onExitTopScore() {
clearInterval(idmenu);
delete idmenu;
i = 1;
while (i <= 10) {
removeMovieClip(this["sNama" + i]);
removeMovieClip(this["sScore" + i]);
i++;
}
delete fmt;
delete fmt1;
}
stop();
if ((darimenu = false)) {
stopAllSounds();
}
idmenu = setInterval(kemenu, 10000);
soundLoop = 0;
onEnterFrame = function () {
if (menuso.position < 50) {
soundLoop = soundLoop + 1;
}
if (soundLoop > 1) {
onExitTopScore();
gotoAndStop ("menu");
}
};
var fmt = new TextFormat();
fmt.align = "left";
fmt.bold = true;
fmt.font = "verdana";
fmt.color = 16777215 /* 0xFFFFFF */;
fmt.size = 15;
var fmt1 = new TextFormat();
fmt1.align = "right";
fmt1.bold = true;
fmt1.font = "verdana";
fmt1.color = 16777215 /* 0xFFFFFF */;
fmt1.size = 15;
xpos = 70;
ypos = 115;
xpos1 = 300;
ypos1 = 115;
i = 1;
while (i <= 10) {
this.createTextField("sNama" + i, this.getNextHighestDepth(), xpos, ypos, 200, 30);
this.createTextField("sScore" + i, this.getNextHighestDepth(), xpos1, ypos1, 260, 30);
ypos = ypos + 31.3;
ypos1 = ypos1 + 31.3;
i++;
}
znama = new Array();
zskor = new Array();
myData = new LoadVars();
xKata = 0;
xKata2 = 0;
banyakTop = 10;
i = 0;
while (i <= banyakTop) {
znama[i] = "";
zskor[i] = "";
i++;
}
rand1 = Math.random() * 1000000;
myData.load("scores.txt?" + rand1, myData, "POST");
myData.onLoad = function () {
kalimat = new String(myData.players);
kalimat2 = new String(myData.scores);
i = 0;
while (i <= kalimat.length) {
subKata = kalimat.substr(i, 1);
if (subKata == ";") {
xKata++;
} else {
znama[xKata] = znama[xKata] + subKata;
}
i++;
}
i = 0;
while (i <= kalimat2.length) {
subKata2 = kalimat2.substr(i, 1);
if (subKata2 == ";") {
xKata2++;
} else {
zskor[xKata2] = zskor[xKata2] + subKata2;
}
i++;
}
i = 0;
while (i <= banyakTop) {
_root["sNama" + (i + 1)].text = znama[i];
_root["sNama" + (i + 1)].setTextFormat(fmt);
_root["sScore" + (i + 1)].text = zskor[i];
_root["sScore" + (i + 1)].setTextFormat(fmt1);
i++;
}
};
mainbtn.onRelease = function () {
onExitTopScore();
gotoAndStop ("menu");
};
Frame 79
function onExitTut() {
removeMovieClip(tut1);
removeMovieClip(tut2);
removeMovieClip(mask4tut);
delete onEnterFrame;
}
stop();
var moveto = "";
var speedx = 20;
attachMovie("tut_mc", "tut1", 100);
tut1.gotoAndStop(1);
tut1._x = 0;
tut1.attachMovie("arrowright_btn", "rightbtn", 1000);
tut1.rightbtn._x = 585;
tut1.rightbtn._y = 220;
tut1.rightbtn.onRelease = function () {
moveto = "right";
};
attachMovie("tut_mc", "tut2", 101);
tut2.gotoAndStop(2);
tut2._x = 640;
tut2.attachMovie("arrowleft_btn", "leftbtn", 1000);
tut2.leftbtn._x = 0;
tut2.leftbtn._y = 220;
tut2.leftbtn.onRelease = function () {
moveto = "left";
};
tut2.attachMovie("main_btn", "tomain", 103);
tut2.tomain._x = 500;
tut2.tomain._y = 10;
tut2.tomain.onRelease = function () {
onExitTut();
gotoAndStop ("menu");
};
this.createEmptyMovieClip("mask4tut", 333);
mask4tut.beginFill(16711680, 100);
mask4tut.moveTo(0, 0);
mask4tut.lineTo(640, 0);
mask4tut.lineTo(640, 480);
mask4tut.lineTo(0, 480);
mask4tut.lineTo(0, 0);
mask4tut.endFill();
this.setMask(mask4tut);
onEnterFrame = function () {
if (moveto == "left") {
tut1._x = tut1._x + speedx;
tut2._x = tut2._x + speedx;
if (tut1._x > 0) {
tut1._x = 0;
tut2._x = 640;
moveto = "";
}
} else if (moveto == "right") {
tut1._x = tut1._x - speedx;
tut2._x = tut2._x - speedx;
if (tut2._x < 0) {
tut1._x = -640;
tut2._x = 0;
moveto = "";
}
}
if (moveto == "") {
if (Key.isDown(37)) {
moveto = "left";
} else if (Key.isDown(39)) {
moveto = "right";
}
}
};
Symbol 53 MovieClip [pentil_mc] Frame 7
stop();
Symbol 103 MovieClip [p2_mc] Frame 6
gotoAndPlay (1);
Symbol 103 MovieClip [p2_mc] Frame 13
gotoAndPlay (7);
Symbol 103 MovieClip [p2_mc] Frame 15
stop();
Symbol 103 MovieClip [p2_mc] Frame 20
gotoAndPlay (16);
Symbol 130 MovieClip [p1_mc] Frame 6
gotoAndPlay (1);
Symbol 130 MovieClip [p1_mc] Frame 13
gotoAndPlay (7);
Symbol 130 MovieClip [p1_mc] Frame 15
stop();
Symbol 130 MovieClip [p1_mc] Frame 20
gotoAndPlay (16);
Symbol 256 MovieClip [combo_mc] Frame 40
stop();
Symbol 284 MovieClip Frame 35
stop();
Symbol 295 Button
on (release) {
getURL ("http://dailyfreegames.com/games/action-games/sports-bar.html", "_blank");
}
Symbol 296 Button
on (release) {
getURL ("http://dailyfreegames.com/games/skill-games/britney-makeover.html", "_blank");
}
Symbol 297 Button
on (release) {
getURL ("http://dailyfreegames.com/games/action-games/final-survival.html", "_blank");
}
Symbol 298 Button
on (release) {
getURL ("http://dailyfreegames.com/games/sports-games/pat-ping-pong.html", "_blank");
}
Symbol 299 Button
on (release) {
getURL ("http://dailyfreegames.com/games/puzzle-games/match-the-couples-game.html", "_blank");
}
Symbol 314 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("1.5");
}
static function showPreloaderAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
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 _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.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 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_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 _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
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;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_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 showTimedAd(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();
}};
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_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;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
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) {
_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 _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 _loadCommunicator(options) {
var _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local25);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
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;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
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;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
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);
}
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++;
}
}
return(_local4);
}
}
Symbol 305 Button
on (release) {
getURL ("http://www.dailyfreegames.com/", "blank");
}