Frame 1
mochi.as2.MochiAd.showPreGameAd({id:"b0ca5de52450c089", res:"640x480"});
stop();
Frame 69
fscommand ("showmenu", false);
fscommand ("trapallkeys", true);
fscommand ("allowscale", false);
lang = System.capabilities.language;
stop();
this.onEnterFrame = function () {
bar._xscale = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
delete this.onEnterFrame;
play();
}
};
Instance of Symbol 665 MovieClip "bar" in Frame 69
onClipEvent (enterFrame) {
this._xscale = _root.Percent;
}
Frame 70
stop();
Instance of Symbol 698 MovieClip in Frame 70
on (release) {
getURL ("http://mousebreaker.com", "_blank");
}
Frame 71
attachMovie("fadeOut", "fadeOut", _root.getNextHighestDepth());
lives = 3;
score = 0;
mute = false;
stop();
level = 1;
score = 0;
bonusChance = 11;
activeWeapon = 2;
money = (moneyOld = 0);
enemiesPeriodicityStart = new Array(0, 20, 10, 20, 20, 99999);
weaponDelay = new Array(0, 2, 10, 15, 1, 1, 30);
weaponDamage = new Array(0, 25, 20, 50, 16, 0.8, 300);
ammo = new Array(0, 999999999, 250, 50, 0, 0, 0);
ammoOld = new Array(0, 999999999, 250, 50, 0, 0, 0);
weaponAvailable = new Array(false, false, true, true, false, false, false);
weaponCost = new Array(0, 50, 50, 100, 300, 500, 700);
ammoCost = new Array(0, 0, 1, 2, 1, 4, 100);
ammoDrop = new Array(0, 0, 50, 20, 150, 70, 1);
enemyCost = new Array(4, 7, 13, 17, 30);
enemyDamage = new Array();
enemyDamage[0] = 5;
enemyDamage[1] = 1;
enemyDamage[2] = 15;
enemyDamage[3] = 5;
enemyDamage[4] = 10;
enemySpeed = new Array();
enemySpeed[0] = 1;
enemySpeed[1] = 1;
enemySpeed[2] = 2;
enemySpeed[3] = 2;
enemySpeed[4] = 2.5;
enemyHealth = new Array();
enemyHealth[0] = 20;
enemyHealth[1] = 35;
enemyHealth[2] = 150;
enemyHealth[3] = 100;
enemyHealth[4] = 200;
weapon = new Array();
weapon[1] = 99999999 /* 0x5F5E0FF */;
weapon[2] = 200;
weapon[3] = 10;
levelText = new Array();
levelText[1] = "Monsters on your street? You know the drill \u2013 murder, death, kill!";
levelText[2] = "Deeper underground... The smell of sewage pales in comparison to the stench of death Brian Damage is about to unleash!";
levelText[3] = "This subway line should take me straight to Hell\u2026 as regular commuters will know. Best watch out for the trains if you don\u2019t want to become demon-kibble\u2026";
levelText[4] = "Watch out underworld, it\u2019s been a picnic until now \u2013 you\u2019re about to learn the true meaning of Hell, Brian Damage style!";
levelText[5] = "Back to Earth for the finale \u2013 This stadium sure does seem familiar!";
redObj = new flash.geom.ColorTransform();
redObj.alphaMultiplier = 1;
redObj.redMultiplier = 11;
redObj.greenMultiplier = 0.3;
redObj.blueMultiplier = 0.3;
defaultObj = new flash.geom.ColorTransform();
defaultObj.alphaMultiplier = 1;
defaultObj.redMultiplier = 1;
defaultObj.greenMultiplier = 1;
defaultObj.blueMultiplier = 1;
transparentObj = new flash.geom.ColorTransform();
transparentObj.alphaMultiplier = 0.2;
transparentObj.redMultiplier = 1;
transparentObj.greenMultiplier = 1;
transparentObj.blueMultiplier = 1;
darkObj = new flash.geom.ColorTransform();
darkObj.alphaMultiplier = 1;
darkObj.redMultiplier = 0.3;
darkObj.greenMultiplier = 0.3;
darkObj.blueMultiplier = 0.3;
MovieClip.prototype.playSound = function (snd, times, stopPrevious) {
if (stopPrevious != false) {
this.thisSound.stop();
}
if (snd == undefined) {
return(undefined);
}
this.thisSound = new Sound(this);
this.thisSound.attachSound(snd);
if (times == undefined) {
this.thisSound.start();
} else {
this.thisSound.start(0, times);
}
};
this.playSound("_music", 9999);
so = SharedObject.getLocal("jailbreak255");
if (so.data.level != undefined) {
btnPrevious.onRelease = function () {
level = so.data.level;
score = so.data.score;
gotoAndStop ("task");
if (level == 11) {
level = (so.data.level = 1);
score = (so.data.score = 0);
}
};
}
buttonNewGame.onRelease = function () {
removeMovieClip(credits);
play();
};
buttonFacebook.onRelease = function () {
getURL ("http://apps.facebook.com/mousebreakergames/?utm_source=distrobution&utm_medium=generic-sites&utm_campaign=brian-damage", "_blank");
};
buttonMoreGames.onRelease = function () {
getURL ("http://www.mousebreaker.com", "_blank");
};
buttonCredits.onRelease = function () {
attachMovie("credits", "credits", _root.getNextHighestDepth());
};
charPos = new Array();
charPos[1] = new Object();
charPos[1].x = 30;
charPos[1].y = 350;
charPos[2] = new Object();
charPos[2].x = -100;
charPos[2].y = 100;
charPos[3] = new Object();
charPos[3].x = 50;
charPos[3].y = 100;
charPos[4] = new Object();
charPos[4].x = 50;
charPos[4].y = 200;
charPos[5] = new Object();
charPos[5].x = 50;
charPos[5].y = 50;
enemiesBalance = new Array(50, 100, 100, 100, 100);
startBalance = new Array();
startBalance[1] = new Array(50, 100, 100, 100, 100);
startBalance[2] = new Array(50, 100, 100, 100, 100);
startBalance[3] = new Array(50, 100, 100, 100, 100);
startBalance[4] = new Array(50, 100, 100, 100, 100);
startBalance[5] = new Array(50, 100, 100, 100, 100);
startBalance[6] = new Array(50, 100, 100, 100, 100);
enemyData = new Array();
enemyData[1] = new Array();
enemyData[1][0] = new Object();
enemyData[1][0].x = 750;
enemyData[1][0].y = 200;
enemyData[1][0].amount = 2;
enemyData[1][0].typ = 0;
enemyData[1][0].dir = "Right";
enemyData[1][1] = new Object();
enemyData[1][1].x = 1200;
enemyData[1][1].y = 200;
enemyData[1][1].amount = 5;
enemyData[1][1].typ = 1;
enemyData[1][1].dir = "Right";
enemyData[1][2] = new Object();
enemyData[1][2].x = 1700;
enemyData[1][2].y = 100;
enemyData[1][2].amount = 2;
enemyData[1][2].typ = 2;
enemyData[1][2].dir = "Right";
enemyData[1][3] = new Object();
enemyData[1][3].x = 2200;
enemyData[1][3].y = 200;
enemyData[1][3].amount = 5;
enemyData[1][3].typ = 3;
enemyData[1][3].dir = "Right";
enemyData[1][4] = new Object();
enemyData[1][4].x = 2650;
enemyData[1][4].y = 200;
enemyData[1][4].amount = 1;
enemyData[1][4].typ = 2;
enemyData[1][4].balance = new Array(100, 100, 100, 100, 100);
enemyData[1][4].periodicity = 55;
enemyData[1][4].dir = "Right";
enemyData[2] = new Array();
enemyData[2][0] = new Object();
enemyData[2][0].x = 700;
enemyData[2][0].y = 850;
enemyData[2][0].amount = 24;
enemyData[2][0].typ = 1;
enemyData[2][0].dir = "UpRight";
enemyData[2][0].balance = new Array(30, 100, 100, 100, 100);
enemyData[2][0].periodicity = 40;
enemyData[2][1] = new Object();
enemyData[2][1].x = 1300;
enemyData[2][1].y = 200;
enemyData[2][1].amount = 30;
enemyData[2][1].typ = 0;
enemyData[2][1].dir = "UpRight";
enemyData[2][1].balance = new Array(50, 100, 100, 100, 100);
enemyData[2][1].periodicity = 30;
enemyData[2][2] = new Object();
enemyData[2][2].x = 1700;
enemyData[2][2].y = -450;
enemyData[2][2].amount = 7;
enemyData[2][2].typ = 2;
enemyData[2][2].dir = "DownRight";
enemyData[2][2].balance = new Array(100, 100, 100, 100, 100);
enemyData[2][2].periodicity = 65;
enemyData[2][3] = new Object();
enemyData[2][3].x = 2200;
enemyData[2][3].y = 250;
enemyData[2][3].amount = 1;
enemyData[2][3].typ = 3;
enemyData[2][3].balance = new Array(50, 100, 100, 100, 100);
enemyData[2][3].periodicity = 50;
enemyData[2][3].dir = "DownRight";
enemyData[3] = new Array();
enemyData[3][0] = new Object();
enemyData[3][0].x = 750;
enemyData[3][0].y = 150;
enemyData[3][0].amount = 7;
enemyData[3][0].typ = 3;
enemyData[3][0].dir = "Right";
enemyData[3][0].balance = new Array(50, 100, 100, 100, 100);
enemyData[3][0].periodicity = 40;
enemyData[3][0].train = true;
enemyData[3][1] = new Object();
enemyData[3][1].x = 1500;
enemyData[3][1].y = 150;
enemyData[3][1].amount = 4;
enemyData[3][1].typ = 4;
enemyData[3][1].dir = "Right";
enemyData[3][1].balance = new Array(50, 100, 100, 100, 100);
enemyData[3][1].periodicity = 30;
enemyData[3][2] = new Object();
enemyData[3][2].x = 2000;
enemyData[3][2].y = 150;
enemyData[3][2].amount = 15;
enemyData[3][2].typ = 1;
enemyData[3][2].dir = "Right";
enemyData[3][2].balance = new Array(50, 100, 100, 100, 100);
enemyData[3][2].periodicity = 30;
enemyData[3][2].train = true;
enemyData[3][3] = new Object();
enemyData[3][3].x = 2600;
enemyData[3][3].y = 150;
enemyData[3][3].amount = 4;
enemyData[3][3].typ = 4;
enemyData[3][3].dir = "Right";
enemyData[3][3].balance = new Array(50, 100, 100, 100, 100);
enemyData[3][3].periodicity = 40;
enemyData[3][4] = new Object();
enemyData[3][4].x = 5400;
enemyData[3][4].y = 190;
enemyData[3][4].amount = 3;
enemyData[3][4].typ = 3;
enemyData[3][4].dir = "Down";
enemyData[3][4].balance = new Array(0, 50, 70, 100, 100);
enemyData[3][4].periodicity = 50;
enemyData[4] = new Array();
enemyData[4][0] = new Object();
enemyData[4][0].x = 800;
enemyData[4][0].y = 70;
enemyData[4][0].amount = 10;
enemyData[4][0].typ = 4;
enemyData[4][0].dir = "UpRight";
enemyData[4][0].balance = new Array(0, 0, 0, 100, 100);
enemyData[4][0].periodicity = 30;
enemyData[4][1] = new Object();
enemyData[4][1].x = 1300;
enemyData[4][1].y = 700;
enemyData[4][1].amount = 15;
enemyData[4][1].typ = 3;
enemyData[4][1].dir = "Down";
enemyData[4][1].balance = new Array(0, 0, 0, 100, 100);
enemyData[4][1].periodicity = 60;
enemyData[4][2] = new Object();
enemyData[4][2].x = 1300;
enemyData[4][2].y = 1700;
enemyData[4][2].amount = 20;
enemyData[4][2].typ = 3;
enemyData[4][2].dir = "Right";
enemyData[4][2].balance = new Array(0, 0, 0, 100, 100);
enemyData[4][2].periodicity = 20;
enemyData[4][3] = new Object();
enemyData[4][3].x = 1900;
enemyData[4][3].y = 2000;
enemyData[4][3].amount = 40;
enemyData[4][3].typ = 1;
enemyData[4][3].dir = "Right";
enemyData[4][3].balance = new Array(0, 0, 0, 100, 100);
enemyData[4][3].periodicity = 20;
enemyData[4][4] = new Object();
enemyData[4][4].x = 2850;
enemyData[4][4].y = 2000;
enemyData[4][4].amount = 20;
enemyData[4][4].typ = 2;
enemyData[4][4].dir = "Up";
enemyData[4][4].balance = new Array(100, 100, 100, 100, 100);
enemyData[4][4].periodicity = 7;
enemyData[4][5] = new Object();
enemyData[4][5].x = 2850;
enemyData[4][5].y = 1200;
enemyData[4][5].amount = 6;
enemyData[4][5].typ = 4;
enemyData[4][5].dir = "Up";
enemyData[4][5].balance = new Array(0, 0, 30, 70, 100);
enemyData[4][5].periodicity = 40;
enemyData[4][6] = new Object();
enemyData[4][6].x = 2850;
enemyData[4][6].y = 600;
enemyData[4][6].amount = 6;
enemyData[4][6].typ = 4;
enemyData[4][6].balance = new Array(0, 0, 30, 70, 100);
enemyData[4][6].periodicity = 1000;
enemyData[4][7] = new Object();
enemyData[4][7].x = 2850;
enemyData[4][7].y = 600;
enemyData[4][7].amount = 1;
enemyData[4][7].typ = 4;
enemyData[4][7].balance = new Array(0, 0, 30, 70, 100);
enemyData[4][7].periodicity = 1000;
enemyData[5] = new Array();
enemyData[5][0] = new Object();
enemyData[5][0].x = 800;
enemyData[5][0].y = 500;
enemyData[5][0].amount = 2;
enemyData[5][0].typ = 4;
enemyData[5][0].balance = new Array(35, 70, 85, 95, 100);
enemyData[5][0].periodicity = 5;
enemyData[5][0].train = true;
Frame 72
stop();
buttonNext.onRelease = function () {
play();
};
Frame 73
function generateEnemy(xx, yy, typ) {
enemy.push(charLayer.attachMovie("enemy" + typ, ("enemy" + enemy.length) + getTimer(), charLayer.getNextHighestDepth(), {_x:xx, _y:yy}));
enemy[enemy.length - 1].num = enemy.length - 1;
enemy[enemy.length - 1].typ = typ;
enemy[enemy.length - 1].speed = enemySpeed[typ];
enemy[enemy.length - 1].offsetX = random(160) - 80;
enemy[enemy.length - 1].offsetY = random(160) - 80;
enemy[enemy.length - 1].gotoAndStop(1);
enemy[enemy.length - 1].health = enemyHealth[typ];
enemy[enemy.length - 1]._vx = (enemy[enemy.length - 1]._vy = 0);
enemy[enemy.length - 1]._ax = (enemy[enemy.length - 1]._ay = 0);
enemy[enemy.length - 1].kickX = (enemy[enemy.length - 1].kickY = 0);
enemy[enemy.length - 1].onEnterFrame = enemyMove;
enemy[enemy.length - 1].pathfinder = new Array();
enemy[enemy.length - 1].antipod = enemy[enemy.length - 2];
}
function randomEnemy() {
if (random(enemiesPeriodicity) == 1) {
en = random(100);
if (en < enemiesBalance[0]) {
en = 0;
} else if (en < enemiesBalance[1]) {
en = 1;
} else if (en < enemiesBalance[2]) {
en = 2;
} else if (en < enemiesBalance[3]) {
en = 3;
}
do {
xx = random(Stage.width);
yy = random(Stage.height);
ab = Math.sqrt(((xx - char._x) * (xx - char._x)) + ((yy - char._y) * (yy - char._y)));
} while (bgrLayer.obstacles.hitTest(xx, yy, true) || (ab < 150));
generateEnemy(xx - charLayer._x, yy - charLayer._y, en);
}
}
function showMessage(txt) {
removeMovieClip(showMsg);
if ((txt != "") && (txt != undefined)) {
attachMovie("showMsg", "showMsg", _root.getNextHighestDepth());
showMsg.showMsg.text = txt;
}
}
function charMove() {
if (pause == true) {
return(undefined);
}
if ((((((Key.isDown(49) || (Key.isDown(50))) || (Key.isDown(51))) || (Key.isDown(52))) || (Key.isDown(53))) || (Key.isDown(54))) && (activeWeapon != Math.abs(48 - Key.getCode()))) {
if (weaponAvailable[Math.abs(48 - Key.getCode())] == true) {
click = false;
char.playSound();
char.body.playSound("_changeWeapon");
activeWeapon = Math.abs(48 - Key.getCode());
this.body.gotoAndStop("weapon" + activeWeapon);
topPan.weaponButtons.redFrame._x = topPan.weaponButtons["w" + activeWeapon]._x;
topPan.weaponButtons.redFrame._y = topPan.weaponButtons["w" + activeWeapon]._y;
}
}
if (Key.isDown(37) || (Key.isDown(65))) {
this._vx = this._vx - 0.6;
}
if (Key.isDown(39) || (Key.isDown(68))) {
this._vx = this._vx + 0.6;
}
if (Key.isDown(38) || (Key.isDown(87))) {
this._vy = this._vy - 0.6;
}
if (Key.isDown(40) || (Key.isDown(83))) {
this._vy = this._vy + 0.6;
}
if (Key.isDown(32) && (char._currentframe == 1)) {
var _local3 = {x:0, y:-25};
char.body.localToGlobal(_local3);
char.gotoAndPlay("act");
for (i in activeObject) {
if (activeObject[i].hitTest(_local3.x, _local3.y, true) && (activeObject[i]._currentframe == 1)) {
activeObject[i].play();
}
}
if ((charLayer.guard0.head.hitTest(this.sensor) && (level == 7)) && (key != true)) {
_root.target++;
_root.instructions = _root.inGameText[_root.level][3];
key = true;
_root.topPan.attachMovie("key", "key", _root.topPan.getNextHighestDepth());
}
}
shotDelay++;
if (click == true) {
if (shotDelay >= weaponDelay[activeWeapon]) {
if (ammo[activeWeapon] <= 0) {
activeWeaponOld = activeWeapon;
do {
activeWeapon++;
} while ((activeWeapon < 7) && ((weaponAvailable[activeWeapon] == false) || (ammo[activeWeapon] <= 0)));
if (activeWeapon == 7) {
do {
activeWeapon--;
} while ((activeWeapon > 1) && ((weaponAvailable[activeWeapon] == false) || (ammo[activeWeapon] <= 0)));
}
if (weaponAvailable[activeWeapon] == false) {
activeWeapon = activeWeaponOld;
} else {
topPan.weaponButtons.redFrame._x = topPan.weaponButtons["w" + activeWeapon]._x;
topPan.weaponButtons.redFrame._y = topPan.weaponButtons["w" + activeWeapon]._y;
this.playSound("_noAmmo");
click = false;
this.body.gotoAndStop("weapon" + activeWeapon);
topPan.weaponButtons.redFrame._x = topPan.weaponButtons["w" + activeWeapon]._x;
topPan.weaponButtons.redFrame._y = topPan.weaponButtons["w" + activeWeapon]._y;
}
} else {
ammo[activeWeapon]--;
topPan.weaponButtons["ammo" + activeWeapon].text = ammo[activeWeapon];
shotDelay = 0;
if (((activeWeapon != 1) && (activeWeapon != 4)) && (activeWeapon != 5)) {
char.body.gotoAndPlay("weapon" + activeWeapon);
}
if (((activeWeapon == 2) || (activeWeapon == 3)) || (activeWeapon == 4)) {
i = 50;
while (i < Stage.width) {
var _local3 = {x:13, y:-i};
char.body.localToGlobal(_local3);
if (bgrLayer.obstacles.hitTest(_local3.x, _local3.y, true)) {
if (activeWeapon == 3) {
ricochet(_local3.x, _local3.y, 13);
} else {
ricochet(_local3.x, _local3.y, 3);
}
bgrLayer.playSound("_rico" + random(7), 1, false);
break;
}
if (charLayer.hitTest(_local3.x, _local3.y, true)) {
for (j in enemy) {
if (enemy[j].hitTest(_local3.x, _local3.y)) {
enemy[j].health = enemy[j].health - weaponDamage[activeWeapon];
if (activeWeapon == 3) {
enemy[j].kickX = (-enemy[j]._vx) * 11;
enemy[j].kickY = (-enemy[j]._vy) * 11;
} else {
enemy[j].kickX = (-enemy[j]._vx) * 4;
enemy[j].kickY = (-enemy[j]._vy) * 4;
}
if (enemy[j].boss == true) {
enemy[j].kickX = enemy[j].kickX / 8;
enemy[j].kickY = enemy[j].kickY / 8;
}
blood((_local3.x - topLayer._x) - (enemy[j]._vx * 15), (_local3.y - topLayer._y) - (enemy[j]._vy * 15), (((enemy[j]._x + charLayer._x) - this._x) / enemy[j].ab) * 2, (((enemy[j]._y + charLayer._y) - this._y) / enemy[j].ab) * 2, "part" + enemy[j].typ, 25);
break;
}
}
break;
}
i = i + 10;
}
} else if (activeWeapon == 1) {
var _local3 = {x:13, y:-35};
var _local5 = {x:13, y:-55};
var _local4 = {x:13, y:-75};
char.body.localToGlobal(_local3);
char.body.localToGlobal(_local5);
char.body.localToGlobal(_local4);
for (i in enemy) {
if ((enemy[i].enemy.head.hitTest(_local3.x, _local3.y) || (enemy[i].enemy.head.hitTest(_local5.x, _local5.y))) || (enemy[i].enemy.head.hitTest(_local4.x, _local4.y))) {
enemy[i].health = enemy[i].health - weaponDamage[activeWeapon];
blood(_local4.x - topLayer._x, _local4.y - topLayer._y, -enemy[i]._vx, -enemy[i]._vy, "part" + enemy[i].typ, 5);
break;
}
}
if (bgrLayer.obstacles.hitTest(_local4.x, _local4.y, true)) {
ricochet(_local4.x, _local4.y, 25);
}
} else if (activeWeapon == 5) {
var _local3 = {x:9, y:-62};
char.body.localToGlobal(_local3);
this.ab = Math.sqrt(((this._x - _xmouse) * (this._x - _xmouse)) + ((this._y - _ymouse) * (this._y - _ymouse)));
fire(_local3.x - topLayer._x, _local3.y - topLayer._y, ((_xmouse - this._x) / this.ab) * 2, ((_ymouse - this._y) / this.ab) * 2, "fire", 3);
} else if (activeWeapon == 6) {
this.rocketDelay = 6;
this.abRocket = Math.sqrt(((this._x - _xmouse) * (this._x - _xmouse)) + ((this._y - _ymouse) * (this._y - _ymouse)));
i = 50;
while (i < (Stage.width + 50)) {
var _local3 = {x:13, y:-i};
char.body.localToGlobal(_local3);
if (bgrLayer.obstacles.hitTest(_local3.x, _local3.y, true)) {
this.rocketX = _local3.x;
this.rocketY = _local3.y;
break;
}
this.ab = Math.sqrt(((this._x - _local3.x) * (this._x - _local3.x)) + ((this._y - _local3.y) * (this._y - _local3.y)));
if (this.ab > this.abRocket) {
this.rocketX = _xmouse;
this.rocketY = _ymouse;
break;
}
i = i + 10;
}
}
}
}
}
if (this.rocketDelay != undefined) {
this.rocketDelay--;
if (this.rocketDelay <= 0) {
this.rocketDelay = undefined;
exp = topLayer.attachMovie("explosion", "explosion", topLayer.getNextHighestDepth(), {_x:this.rocketX - topLayer._x, _y:this.rocketY - topLayer._y});
for (i in enemy) {
this.ab = Math.sqrt(((exp._x - enemy[i]._x) * (exp._x - enemy[i]._x)) + ((exp._y - enemy[i]._y) * (exp._y - enemy[i]._y)));
if (this.ab < 150) {
enemy[i]._rotation = ((-Math.atan2(exp._x - enemy[i]._x, exp._y - enemy[i]._y)) * 180) / Math.PI;
enemy[i].health = enemy[i].health - (12000 / this.ab);
enemy[i].kickX = ((-(exp._x - enemy[i]._x)) * 12) / this.ab;
enemy[i].kickY = ((-(exp._y - enemy[i]._y)) * 12) / this.ab;
}
}
}
}
this.kickX = this.kickX * 0.8;
this.kickY = this.kickY * 0.8;
if ((Math.abs(this._vx) + Math.abs(this._vy)) > 8) {
this._vx = this._vx / ((Math.abs(this._vx) + Math.abs(this._vy)) / 8);
this._vy = this._vy / ((Math.abs(this._vx) + Math.abs(this._vy)) / 8);
}
if (bgrLayer.obstacles2.hitTest((this._x + this._vx) + this.kickX, (this._y + this._vy) + this.kickY, true)) {
x1 = (x2 = (y1 = (y2 = undefined)));
ab = Math.sqrt((this._vx * this._vx) + (this._vy * this._vy));
i = 0;
while (i < (Math.PI*2)) {
if ((bgrLayer.obstacles2.hitTest((this._x + (Math.sin(i) * ab)) + this._vx, (this._y + (Math.cos(i) * ab)) + this._vy, true) == false) && (bgrLayer.obstacles2.hitTest((this._x + (Math.sin(i - 0.314159265358979) * ab)) + this._vx, (this._y + (Math.cos(i - 0.314159265358979) * ab)) + this._vy, true))) {
x1 = (this._x + (Math.sin(i) * ab)) + this._vx;
y1 = (this._y + (Math.cos(i) * ab)) + this._vy;
} else if (bgrLayer.obstacles2.hitTest((this._x + (Math.sin(i) * ab)) + this._vx, (this._y + (Math.cos(i) * ab)) + this._vy, true) && (bgrLayer.obstacles2.hitTest((this._x + (Math.sin(i - 0.314159265358979) * ab)) + this._vx, (this._y + (Math.cos(i - 0.314159265358979) * ab)) + this._vy, true) == false)) {
x2 = (this._x + (Math.sin(i - 0.314159265358979) * ab)) + this._vx;
y2 = (this._y + (Math.cos(i - 0.314159265358979) * ab)) + this._vy;
}
i = i + 0.314159265358979;
}
ab1 = Math.sqrt(((this._x - x1) * (this._x - x1)) + ((this._y - y1) * (this._y - y1)));
ab2 = Math.sqrt(((this._x - x2) * (this._x - x2)) + ((this._y - y2) * (this._y - y2)));
if (ab1 < ab2) {
this._vxNew = x2 - this._x;
this._vyNew = y2 - this._y;
} else {
this._vxNew = x1 - this._x;
this._vyNew = y1 - this._y;
}
abNew = Math.sqrt((this._vxNew * this._vxNew) + (this._vyNew * this._vyNew));
if (Math.abs(((Math.acos(this._vx / ab) * 180) / Math.PI) - ((Math.acos(this._vxNew / abNew) * 180) / Math.PI)) < 50) {
this._vx = (this._vxNew / abNew) * ab;
this._vy = (this._vyNew / abNew) * ab;
} else {
this._vx = (this._vy = 0);
}
this.kickX = (this.kickY = 0);
}
if (((((((this._x + this._vx) + this.kickX) > 0) || ((this._vx + this.kickX) >= 0)) && ((((this._x + this._vx) + this.kickX) < Stage.width) || ((this._vx + this.kickX) <= 0))) && ((((this._y + this._vy) + this.kickY) > 0) || ((this._vy + this.kickY) >= 0))) && ((((this._y + this._vy) + this.kickY) < Stage.height) || ((this._vy + this.kickY) <= 0))) {
this._x = this._x + (this._vx + this.kickX);
this._y = this._y + (this._vy + this.kickY);
} else {
this._vx = 0;
this._vy = 0;
this.kickX = 0;
this.kickY = 0;
}
this._vx = this._vx * 0.9;
this._vy = this._vy * 0.9;
if ((((this.foots.l0._y > 10) && (this.foots.l1._y < -10)) || ((this.foots.l0._y < -10) && (this.foots.l1._y > 10))) && (ff >= 3)) {
this.legsIndex = -this.legsIndex;
ff = 0;
}
ff++;
this.foots._v = (Math.abs(this._vx) + Math.abs(this._vy)) * this.legsIndex;
if (this.foots._v > 5) {
this.foots._v = 5;
}
if (this.foots._v < -5) {
this.foots._v = -5;
}
this.foots.l0._y = this.foots.l0._y + this.foots._v;
this.foots.l1._y = this.foots.l1._y - this.foots._v;
this.hands.l0._y = this.hands.l0._y + (this.foots._v * 0.8);
this.hands.l1._y = this.hands.l1._y - (this.foots._v * 0.8);
this.body.gotoAndStop(Math.round(this.hands.l0._y) + 17);
if ((Math.abs(this._vx) > 0.2) || (Math.abs(this._vy) > 0.2)) {
this._rotation = ((-Math.atan2(this._vx, this._vy)) * 180) / 3.141593;
}
this.hands._rotation = (this.body._rotation = (((-Math.atan2(this._x - _xmouse, this._y - _ymouse)) * 180) / Math.PI) - this._rotation);
this.arrow._rotation = (((-Math.atan2((targetPoint[level][target].x + bgrLayer._x) - this._x, (targetPoint[level][target].y + bgrLayer._y) - this._y)) * 180) / 3.141593) - this._rotation;
if (Math.sqrt((((targetPoint[level][target].x + bgrLayer._x) - this._x) * ((targetPoint[level][target].x + bgrLayer._x) - this._x)) + (((targetPoint[level][target].y + bgrLayer._y) - this._y) * ((targetPoint[level][target].y + bgrLayer._y) - this._y))) < 180) {
this.arrow._visible = false;
if (level == 8) {
this.arrow._y = this.arrow._y + 2000;
}
} else {
this.arrow._visible = true;
}
ab = Math.sqrt((char._vx * char._vx) + (char._vy * char._vy));
if (bgrLayer.finish.hitTest(this.body.head) && (boss != true)) {
clearAll();
level++;
gotoAndStop ("nextLevel");
}
if (topLayer.tr.hitTest(this._x, this._y, true)) {
health = 0;
}
if (health <= 0) {
topPan.healthBar.gotoAndStop(1);
this.gotoAndPlay("death");
delete this.onEnterFrame;
}
darkness._x = this._x;
darkness._y = this._y;
}
function enemyMove() {
if (pause == true) {
return(undefined);
}
this.kickX = this.kickX * 0.8;
this.kickY = this.kickY * 0.8;
if (topLayer.tr.hitTest(this._x + charLayer._x, this._y + charLayer._y, true)) {
this.health = 0;
}
if (this.health <= 0) {
if (this.fire == true) {
this.gotoAndStop("deathFire");
} else {
this.gotoAndStop("death");
}
removeObj(this, enemy);
m = topLayer.attachMovie("moneyText", "moneyText" + getTimer(), topLayer.getNextHighestDepth(), {_x:this._x, _y:this._y});
if (this.boss == true) {
boss = false;
m.money.money.text = enemyCost[this.typ] * 10;
money = money + (enemyCost[this.typ] * 10);
if (level == 4) {
earthquake();
}
} else {
m.money.money.text = enemyCost[this.typ];
money = money + enemyCost[this.typ];
}
if (this.typ == enemyData[level][spawn - 1].typ) {
killToUnlock--;
}
if (((killToUnlock <= 0) && (focusingObj != char)) && (boss != true)) {
attachMovie("arrow" + enemyData[level][spawn - 1].dir, "arrow", _root.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
focusingObj = char;
newFocusPoint.removeMovieClip();
}
if (random(bonusChance) == 1) {
do {
typ = random(5) + 2;
} while (weaponAvailable[typ] == false);
if (random(6) == 1) {
typ = 0;
}
a = bonusLayer.attachMovie("ammo" + typ, ("ammo" + getTimer()) + this.num, bonusLayer.getNextHighestDepth(), {_x:this._x, _y:this._y});
a.typ = typ;
a.onEnterFrame = function () {
if (char.body.head.hitTest(this)) {
if (this.typ != 0) {
ammo[this.typ] = ammo[this.typ] + ammoDrop[this.typ];
topPan.weaponButtons["ammo" + this.typ].text = ammo[this.typ];
} else {
health = health + 30;
if (health > 100) {
health = 100;
}
topPan.healthBar.gotoAndStop(health);
}
removeMovieClip(this);
char.body.playSound("_ammo2");
}
if (((((this._x + charLayer._x) < -50) || ((this._x + charLayer._x) > (Stage.width + 50))) || ((this._y + charLayer._y) < -50)) || ((this._y + charLayer._y) > (Stage.height + 50))) {
removeMovieClip(this);
}
};
}
if (((level == 5) && (focusingObj != char)) && (enemy.length == 0)) {
clearAll();
gotoAndStop ("win");
}
killed++;
delete this.onEnterFrame;
return(undefined);
}
if (((this._currentframe != 1) && (focusingObj == char)) && (((((this._x + charLayer._x) < -50) || ((this._x + charLayer._x) > (Stage.width + 50))) || ((this._y + charLayer._y) < -50)) || ((this._y + charLayer._y) > (Stage.height + 50)))) {
removeObj(this, enemy);
removeMovieClip(this);
}
this.ab = Math.sqrt((((char._x - this._x) - charLayer._x) * ((char._x - this._x) - charLayer._x)) + (((char._y - this._y) - charLayer._y) * ((char._y - this._y) - charLayer._y)));
this._vx = (((char._x - this._x) - charLayer._x) / this.ab) * this.speed;
this._vy = (((char._y - this._y) - charLayer._y) / this.ab) * this.speed;
if (this.hitTest(char.body.head) && (this._currentframe != 1)) {
if (this._currentframe != 5) {
this.gotoAndStop("attack");
health = health - enemyDamage[this.typ];
healthLost = healthLost + enemyDamage[this.typ];
topPan.healthBar.gotoAndStop(health);
if (this.typ == 2) {
char.kickX = char.kickX + (this._vx * 15);
char.kickY = char.kickY + (this._vy * 15);
}
}
if (this.typ == 1) {
var _local3 = {x:0, y:40};
this.enemy.localToGlobal(_local3);
this._x = this._x + ((char._x - _local3.x) / 4);
this._y = this._y + ((char._y - _local3.y) / 4);
this._rotation = ((Math.atan2(this._vy, this._vx) / Math.PI) * 180) - 90;
}
} else if (((this.typ == 3) && (this.ab < 120)) && (((((this._x + charLayer._x) > 0) && ((this._y + charLayer._y) > 0)) && ((this._x + charLayer._x) < Stage.width)) && ((this._y + charLayer._y) < Stage.height))) {
if (this._currentframe != 5) {
i = 0;
while (i < 12) {
if (bgrLayer.obstacles.hitTest((this._x + charLayer._x) + (((char._x - (this._x + charLayer._x)) / 12) * i), (this._y + charLayer._y) + (((char._y - (this._y + charLayer._y)) / 12) * i), true)) {
break;
}
i++;
}
if (i >= 12) {
this.gotoAndStop("attack");
health = health - enemyDamage[this.typ];
healthLost = healthLost + enemyDamage[this.typ];
topPan.healthBar.gotoAndStop(health);
char.kickX = char.kickX + (this._vx * 5);
char.kickY = char.kickY + (this._vy * 5);
}
}
} else if (((this.typ == 4) && (this.ab < 130)) && (((((this._x + charLayer._x) > 0) && ((this._y + charLayer._y) > 0)) && ((this._x + charLayer._x) < Stage.width)) && ((this._y + charLayer._y) < Stage.height))) {
if (this._currentframe != 5) {
i = 0;
while (i < 13) {
if (bgrLayer.obstacles.hitTest((this._x + charLayer._x) + (((char._x - (this._x + charLayer._x)) / 12) * i), (this._y + charLayer._y) + (((char._y - (this._y + charLayer._y)) / 12) * i), true)) {
break;
}
i++;
}
if (i >= 13) {
this.gotoAndStop("attack");
health = health - enemyDamage[this.typ];
healthLost = healthLost + enemyDamage[this.typ];
topPan.healthBar.gotoAndStop(health);
char.attachMovie("lighting", "lighting", char.getNextHighestDepth());
char.kickX = char.kickX + (this._vx * 10);
char.kickY = char.kickY + (this._vy * 10);
}
}
} else {
if (this.antipod._x != undefined) {
this.ab2 = Math.sqrt(((this._x - this.antipod._x) * (this._x - this.antipod._x)) + ((this._y - this.antipod._y) * (this._y - this.antipod._y)));
if (bgrLayer.obstacles.hitTest((this._x + charLayer._x) + ((this._x - this.antipod._x) / this.ab2), (this._y + charLayer._y) + ((this._y - this.antipod._y) / this.ab2), true) == false) {
if (enemySpeed[this.typ] < 2) {
this._vx = this._vx + (((this._x - this.antipod._x) / this.ab2) / 2);
this._vy = this._vy + (((this._y - this.antipod._y) / this.ab2) / 2);
} else {
this._vx = this._vx + ((this._x - this.antipod._x) / this.ab2);
this._vy = this._vy + ((this._y - this.antipod._y) / this.ab2);
}
this._rotation = ((Math.atan2(this._vy, this._vx) / Math.PI) * 180) - 90;
}
} else {
this._rotation = ((Math.atan2(this._vy, this._vx) / Math.PI) * 180) - 90;
}
if (((this._currentframe != 5) && (this._currentframe != 1)) && (char._currentframe == 1)) {
if (bgrLayer.obstacles.hitTest(((this._x + this._vx) + this.kickX) + charLayer._x, ((this._y + this._vy) + this.kickY) + charLayer._y, true)) {
x1 = (x2 = (y1 = (y2 = undefined)));
i = 0;
while (i < (Math.PI*2)) {
if ((bgrLayer.obstacles.hitTest(((this._x + (Math.sin(i) * enemySpeed[this.typ])) + this._vx) + charLayer._x, ((this._y + (Math.cos(i) * enemySpeed[this.typ])) + this._vy) + charLayer._y, true) == false) && (bgrLayer.obstacles.hitTest(((this._x + (Math.sin(i - 0.314159265358979) * enemySpeed[this.typ])) + this._vx) + charLayer._x, ((this._y + (Math.cos(i - 0.314159265358979) * enemySpeed[this.typ])) + this._vy) + charLayer._y, true))) {
x1 = (this._x + (Math.sin(i) * enemySpeed[this.typ])) + this._vx;
y1 = (this._y + (Math.cos(i) * enemySpeed[this.typ])) + this._vy;
} else if (bgrLayer.obstacles.hitTest(((this._x + (Math.sin(i) * enemySpeed[this.typ])) + this._vx) + charLayer._x, ((this._y + (Math.cos(i) * enemySpeed[this.typ])) + this._vy) + charLayer._y, true) && (bgrLayer.obstacles.hitTest(((this._x + (Math.sin(i - 0.314159265358979) * enemySpeed[this.typ])) + this._vx) + charLayer._x, ((this._y + (Math.cos(i - 0.314159265358979) * enemySpeed[this.typ])) + this._vy) + charLayer._y, true) == false)) {
x2 = (this._x + (Math.sin(i - 0.314159265358979) * enemySpeed[this.typ])) + this._vx;
y2 = (this._y + (Math.cos(i - 0.314159265358979) * enemySpeed[this.typ])) + this._vy;
}
i = i + 0.314159265358979;
}
this.ab2 = Math.sqrt(((char._x - (x1 + charLayer._x)) * (char._x - (x1 + charLayer._x))) + ((char._y - (y1 + charLayer._y)) * (char._y - (y1 + charLayer._y))));
this.ab3 = Math.sqrt(((char._x - (x2 + charLayer._x)) * (char._x - (x2 + charLayer._x))) + ((char._y - (y2 + charLayer._y)) * (char._y - (y2 + charLayer._y))));
if (this.ab2 < this.ab3) {
this._vx = x1 - this._x;
this._vy = y1 - this._y;
} else {
this._vx = x2 - this._x;
this._vy = y2 - this._y;
}
this.kickX = (this.kickY = 0);
}
this._x = this._x + (this._vx + this.kickX);
this._y = this._y + (this._vy + this.kickY);
}
}
this.fire = false;
}
function enemyShoot() {
this._rotation = (((-Math.atan2((this._x + charLayer._x) - char._x, (this._y + charLayer._y) - char._y)) * 180) / Math.PI) + 180;
if ((this.shotDelay <= 0) || (this.shotDelay == undefined)) {
this.shotDelay = 8;
this.gotoAndPlay("shooting");
this.ab = Math.sqrt((((this._x + charLayer._x) - char._x) * ((this._x + charLayer._x) - char._x)) + (((this._y + charLayer._y) - char._y) * ((this._y + charLayer._y) - char._y)));
char._vx = char._vx - ((((this._x + charLayer._x) - char._x) / this.ab) * 2);
char._vy = char._vy - ((((this._y + charLayer._y) - char._y) / this.ab) * 2);
}
this.shotDelay--;
}
function ricochet(xxx, yyy, amount) {
i = 0;
while (i < amount) {
rico = topLayer.attachMovie("rico", ("rico" + getTimer()) + i, topLayer.getNextHighestDepth(), {_x:xxx - topLayer._x, _y:yyy - topLayer._y});
rico._vx = random(21) - 10;
rico._vy = random(21) - 10;
rico.onEnterFrame = function () {
if (pause == true) {
return(undefined);
}
this._x = this._x + this._vx;
this._y = this._y + this._vy;
this._rotation = (Math.atan2(this._vy, this._vx) / Math.PI) * 180;
};
i++;
}
}
function blood(xx, yy, vx, vy, typ, amount) {
i = 0;
while (i < amount) {
bl = topLayer.attachMovie(typ, typ + i, topLayer.getNextHighestDepth(), {_x:xx, _y:yy});
iii = random(9);
bl._vx = (vx * iii) + ((random(Math.abs(vx) * 100) - (Math.abs(vx) * 50)) / 50);
bl._vy = (vy * iii) + ((random(Math.abs(vy) * 100) - (Math.abs(vy) * 50)) / 50);
bl._rotation = ((-Math.atan2(bl._vx, bl._vy)) * 180) / Math.PI;
bl.onEnterFrame = function () {
if (pause == true) {
return(undefined);
}
this._vx = this._vx * 0.98;
this._vy = this._vy * 0.98;
this._x = this._x + this._vx;
this._y = this._y + this._vy;
this._alpha = this._alpha - 7;
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
bl._xscale = (bl._yscale = random(100) + 50);
i++;
}
}
function fire(xx, yy, vx, vy, typ, amount) {
i = 0;
while (i < amount) {
bl = topLayer.attachMovie("fire", "fire" + i, topLayer.getNextHighestDepth(), {_x:xx, _y:yy});
iii = 7;
bl._vx = (vx * iii) + ((random(61) - 30) / 30);
bl._vy = (vy * iii) + ((random(61) - 30) / 30);
bl._rotation = ((-Math.atan2(bl._vx, bl._vy)) * 180) / Math.PI;
bl._xscale = (bl._yscale = random(70) + 70);
bl.onEnterFrame = function () {
if (pause == true) {
return(undefined);
}
this._vx = this._vx * 0.98;
this._vy = this._vy * 0.98;
this._x = this._x + this._vx;
this._y = this._y + this._vy;
this._alpha = this._alpha - 7;
for (j in enemy) {
if (enemy[j].hitTest(this._x + topLayer._x, this._y + topLayer._y)) {
enemy[j].health = enemy[j].health - weaponDamage[activeWeapon];
enemy[j].fire = true;
}
}
if (bgrLayer.obstacles.hitTest(this._x + topLayer._x, this._y + topLayer._y, true)) {
this.play();
delete this.onEnterFrame;
}
if (this._alpha <= 0) {
removeMovieClip(this);
}
};
i++;
}
}
function focus() {
if (pause == true) {
return(undefined);
}
xoffset = Math.round(((Stage.width / 2) - focusingObj._x) / 10);
yoffset = Math.round(((Stage.height / 2) - focusingObj._y) / 10);
if (((bgr._x + xoffset) > 0) || (((bgr._x + bgr._width) + xoffset) < Stage.width)) {
xoffset = 0;
}
}
function removeObj(obj, arr) {
arr[obj.num] = arr[arr.length - 1];
arr[obj.num].num = obj.num;
arr.pop();
if (arr == enemy) {
arr[obj.num].antipod = arr[obj.num - 1];
arr[obj.num + 1].antipod = arr[obj.num];
if (arr.length > 1) {
arr[0].antipod = arr[arr.length - 1];
}
}
}
function loseState() {
clearAll();
lose = true;
lives--;
if (lives < 0) {
gotoAndStop ("gameOver");
} else {
gotoAndStop ("nextLevel");
}
}
function nextLevel() {
if (level != 4) {
score = score + Math.round((level * 1000) / t);
} else {
score = score + 100;
}
clearAll();
level++;
clearTimeout(timeout);
so.data.level = level;
so.data.score = score;
if (level <= 10) {
if (level == 9) {
gotoAndStop ("tunneling");
} else {
gotoAndStop ("task");
}
} else {
gotoAndStop ("win");
}
}
function clearAll() {
bgrLayer.playSound();
topLayer.playSound();
char.playSound();
char.body.playSound();
bonusLayer.removeMovieClip();
char.removeMovieClip();
charLayer.removeMovieClip();
bgrLayer.removeMovieClip();
topLayer.removeMovieClip();
darkness.removeMovieClip();
topPan.removeMovieClip();
delete this.onEnterFrame;
delete this.onMouseDown;
delete this.onMouseUp;
delete char.onEnterFrame;
}
function earthquake() {
shake = 1;
increment = 0.2;
if (level == 3) {
topLayer.playSound("_train");
}
bgrLayer.onEnterFrame = function () {
if (pause == true) {
return(undefined);
}
if (offsetX != undefined) {
this._x = this._x - offsetX;
this._y = this._y - offsetY;
bonusLayer._x = bonusLayer._x - offsetX;
bonusLayer._y = bonusLayer._y - offsetY;
charLayer._x = charLayer._x - offsetX;
charLayer._y = charLayer._y - offsetY;
topLayer._x = topLayer._x - offsetX;
topLayer._y = topLayer._y - offsetY;
char._x = char._x - offsetX;
char._y = char._y - offsetY;
}
offsetX = random(shake) - (shake / 2);
offsetY = random(shake) - (shake / 2);
this._x = this._x + offsetX;
this._y = this._y + offsetY;
bonusLayer._x = bonusLayer._x + offsetX;
bonusLayer._y = bonusLayer._y + offsetY;
charLayer._x = charLayer._x + offsetX;
charLayer._y = charLayer._y + offsetY;
topLayer._x = topLayer._x + offsetX;
topLayer._y = topLayer._y + offsetY;
char._x = char._x + offsetX;
char._y = char._y + offsetY;
shake = shake + increment;
if (shake >= 30) {
shake--;
increment = -0.2;
if (level == 3) {
topLayer.attachMovie("train", "tr", topLayer.getNextHighestDepth(), {_x:Stage.width - topLayer._x, _y:Stage.height / 3.7});
}
if (level == 4) {
clearAll();
level++;
gotoAndStop ("nextLevel");
}
} else if (shake <= 0) {
delete this.onEnterFrame;
}
};
}
this.playSound();
if (level == 5) {
bonusChance = 5;
}
this.playSound();
killed = 0;
lose = false;
boss = false;
click = false;
spawn = 0;
healthLost = 1;
level3enemies = 30;
health = 100;
shotDelay = 100;
allowFinish = true;
t0 = getTimer();
target = 0;
t = undefined;
timeout = undefined;
enemy = new Array();
enemiesBalance = startBalance[level];
enemiesPeriodicity = enemiesPeriodicityStart[level];
attachMovie("bgr" + level, "bgrLayer", _root.getNextHighestDepth());
createEmptyMovieClip("bonusLayer", _root.getNextHighestDepth());
attachMovie("char", "char", _root.getNextHighestDepth(), {_x:charPos[level].x, _y:charPos[level].y});
char.legsIndex = 1;
char.body.gotoAndStop("weapon" + activeWeapon);
char.kickX = (char.kickY = 0);
createEmptyMovieClip("charLayer", _root.getNextHighestDepth());
createEmptyMovieClip("topLayer", _root.getNextHighestDepth());
if (level == 3) {
attachMovie("darkness", "darkness", _root.getNextHighestDepth());
darkness.setMask(char.body.maska);
}
attachMovie("topPan", "topPan", _root.getNextHighestDepth());
topPan.healthBar.gotoAndStop(health);
topPan.weaponButtons.redFrame._x = topPan.weaponButtons["w" + activeWeapon]._x;
topPan.weaponButtons.redFrame._y = topPan.weaponButtons["w" + activeWeapon]._y;
i = 1;
while (i <= 6) {
topPan.weaponButtons["ammo" + i].text = ammo[i];
if (weaponAvailable[i] == false) {
topPan.weaponButtons["w" + i].transform.colorTransform = darkObj;
topPan.weaponButtons["ww" + i].transform.colorTransform = darkObj;
}
i++;
}
topPan.btnPause.onRelease = function () {
pause = !pause;
if (pause == true) {
_root.transform.colorTransform = darkObj;
} else {
_root.transform.colorTransform = defaultObj;
}
};
focusingObj = char;
bgrLayer.playSound("_level" + level, 999);
attachMovie("fadeOut", "fadeOut", _root.getNextHighestDepth());
if (level > 1) {
showMessage(levelText[level]);
} else {
attachMovie("instructions", "instructions", _root.getNextHighestDepth());
pause = true;
}
char.onEnterFrame = charMove;
char._vx = (char._vy = 0);
this.onMouseDown = function () {
if ((pause == true) || (topPan.hitTest(_xmouse, _ymouse, true))) {
return(undefined);
}
click = true;
if (((activeWeapon == 1) || (activeWeapon == 4)) || (activeWeapon == 5)) {
char.body.gotoAndPlay("weapon" + activeWeapon);
}
if (ammo[activeWeapon] <= 0) {
char.playSound("_noAmmo");
}
};
this.onMouseUp = function () {
if ((click != true) || (pause == true)) {
return(undefined);
}
click = false;
if (((activeWeapon == 1) || (activeWeapon == 4)) || (activeWeapon == 5)) {
char.body.gotoAndPlay(("weapon" + activeWeapon) + "off");
}
};
this.onEnterFrame = function () {
t = Math.round((getTimer() - t0) / 1000);
if (pause == true) {
return(undefined);
}
randomEnemy();
if (((((enemyData[level][spawn].x + charLayer._x) < (Stage.width + 100)) && ((enemyData[level][spawn].y + charLayer._y) < (Stage.height + 100))) && ((enemyData[level][spawn].x + charLayer._x) > -100)) && ((enemyData[level][spawn].y + charLayer._y) > -100)) {
i = 0;
while (i < enemyData[level][spawn].amount) {
generateEnemy((enemyData[level][spawn].x + random(200)) - 100, (enemyData[level][spawn].y + random(200)) - 100, enemyData[level][spawn].typ);
i++;
}
if (level < 5) {
this.createEmptyMovieClip("newFocusPoint", _root.getNextHighestDepth());
newFocusPoint._x = enemyData[level][spawn].x + charLayer._x;
newFocusPoint._y = enemyData[level][spawn].y + charLayer._y;
focusingObj = newFocusPoint;
}
killToUnlock = enemyData[level][spawn].amount;
if (enemyData[level][spawn].balance[0] != undefined) {
enemiesBalance = enemyData[level][spawn].balance;
}
enemiesPeriodicity = enemyData[level][spawn].periodicity;
if (enemyData[level][spawn].amount == 1) {
enemy[enemy.length - 1]._xscale = (enemy[enemy.length - 1]._yscale = 135);
enemy[enemy.length - 1].transform.colorTransform = redObj;
enemy[enemy.length - 1].health = enemy[enemy.length - 1].health * 10;
if (level == 1) {
enemy[enemy.length - 1].health = enemy[enemy.length - 1].health * 0.65;
}
enemy[enemy.length - 1].boss = true;
boss = true;
}
if (enemyData[level][spawn].train == true) {
earthquake();
}
spawn++;
}
focus();
charLayer._x = charLayer._x + xoffset;
charLayer._y = charLayer._y + yoffset;
topLayer._x = topLayer._x + xoffset;
topLayer._y = topLayer._y + yoffset;
bgrLayer._y = bgrLayer._y + yoffset;
bgrLayer._x = bgrLayer._x + xoffset;
bonusLayer._y = bonusLayer._y + yoffset;
bonusLayer._x = bonusLayer._x + xoffset;
newFocusPoint._x = newFocusPoint._x + xoffset;
newFocusPoint._y = newFocusPoint._y + yoffset;
bl._y = bl._y + yoffset;
bl._x = bl._x + xoffset;
char._x = char._x + xoffset;
char._y = char._y + yoffset;
if (level == 3) {
var _local3 = {x:bgrLayer.obstacles.portal._x, y:bgrLayer.obstacles.portal._y};
bgrLayer.obstacles.localToGlobal(_local3);
if ((((_local3.x > 0) && (_local3.x < Stage.width)) && (_local3.y > 0)) && (_local3.y < Stage.height)) {
if ((random(10) == 1) && (level3enemies > 0)) {
generateEnemy(_local3.x - charLayer._x, (_local3.y - charLayer._y) - 30, random(4));
level3enemies--;
}
} else if ((level3enemies < 30) && (level3enemies > 1)) {
level3enemies = 30;
}
}
if ((level == 5) && (killed >= 300)) {
clearAll();
gotoAndStop ("win");
}
};
stop();
Frame 74
function checkCosts() {
i = 1;
while (i <= 6) {
if (weaponCost[i] > money) {
_root["w" + i]._alpha = 30;
}
if (ammoCost[i] > money) {
_root["a" + i]._alpha = 30;
_root[("a" + i) + "max"]._alpha = 30;
}
i++;
}
}
this.playSound("_music", 9999);
attachMovie("fadeOut", "fadeOut", _root.getNextHighestDepth());
if (lose != true) {
buttonTryAgain._visible = false;
score = score + Math.round((((10000 * level) * level) / t) - healthLost);
trace((score + " ") + Math.round((((10000 * level) * level) / t) - healthLost));
} else {
buttonNextLevel._visible = false;
if (level == 1) {
money = moneyOld;
for (i in ammoOld) {
ammo[i] = ammoOld[i];
}
} else {
money = moneyOld;
for (i in ammoOld) {
ammo[i] = ammoOld[i];
}
for (i in weaponAvailableOld) {
weaponAvailable[i] = weaponAvailableOld[i];
}
}
}
moneyOld = money;
ammoOld = new Array();
for (i in ammo) {
ammoOld[i] = ammo[i];
}
weaponAvailableOld = new Array();
for (i in weaponAvailable) {
weaponAvailableOld[i] = weaponAvailable[i];
}
i = 1;
while (i <= 6) {
_root["ammo" + i].text = ammo[i];
if (weaponAvailable[i] == true) {
_root["w" + i]._visible = false;
_root[("w" + i) + "cost"]._visible = false;
_root[("a" + i) + "cost"].text = "$" + ammoCost[i];
} else {
_root["a" + i]._visible = false;
_root[("a" + i) + "max"]._visible = false;
_root[("a" + i) + "cost"]._visible = false;
_root[("w" + i) + "cost"].text = "$" + weaponCost[i];
}
i++;
}
checkCosts();
totalMoney.text = "$" + money;
w1.onRelease = (w3.onRelease = (w4.onRelease = (w5.onRelease = (w6.onRelease = function () {
if (weaponCost[this._name.substr(1, 1)] > money) {
return(undefined);
}
money = money - weaponCost[this._name.substr(1, 1)];
checkCosts();
totalMoney.text = "$" + money;
weaponAvailable[this._name.substr(1, 1)] = true;
ammo[this._name.substr(1, 1)] = ammo[this._name.substr(1, 1)] + ammoDrop[this._name.substr(1, 1)];
_root["w" + this._name.substr(1, 1)]._visible = false;
_root["a" + this._name.substr(1, 1)]._visible = true;
_root[("a" + this._name.substr(1, 1)) + "max"]._visible = true;
_root[("w" + this._name.substr(1, 1)) + "cost"]._visible = false;
_root[("a" + this._name.substr(1, 1)) + "cost"]._visible = true;
_root[("a" + this._name.substr(1, 1)) + "cost"].text = "$" + ammoCost[this._name.substr(1, 1)];
_root["ammo" + this._name.substr(1, 1)].text = ammo[this._name.substr(1, 1)];
}))));
a2.onPress = (a3.onPress = (a4.onPress = (a5.onPress = (a6.onPress = function () {
ammo2buy = this._name.substr(1, 1);
counter = 0;
}))));
a2max.onRelease = (a3max.onRelease = (a4max.onRelease = (a5max.onRelease = (a6max.onRelease = function () {
ammo[this._name.substr(1, 1)] = ammo[this._name.substr(1, 1)] + Math.floor(money / ammoCost[this._name.substr(1, 1)]);
_root["ammo" + this._name.substr(1, 1)].text = ammo[this._name.substr(1, 1)];
money = money - (Math.floor(money / ammoCost[this._name.substr(1, 1)]) * ammoCost[this._name.substr(1, 1)]);
totalMoney.text = "$" + money;
checkCosts();
}))));
this.onMouseUp = function () {
ammo2buy = undefined;
};
this.onEnterFrame = function () {
if (counter > 300) {
iii = 8;
} else if (counter > 200) {
iii = 4;
} else if (counter > 100) {
iii = 2;
} else {
iii = 1;
}
if (((ammoCost[ammo2buy] * iii) > money) || (ammo2buy == undefined)) {
return(undefined);
}
counter++;
money = money - (ammoCost[ammo2buy] * iii);
checkCosts();
totalMoney.text = "$" + money;
ammo[ammo2buy] = ammo[ammo2buy] + iii;
_root["ammo" + ammo2buy].text = ammo[ammo2buy];
};
buttonMoreGames.onRelease = function () {
getURL ("http://www.mousebreaker.com", "_blank");
};
buttonNextLevel.onRelease = (buttonTryAgain.onRelease = function () {
gotoAndStop ("gamePlay");
});
Frame 75
attachMovie("fadeOut", "fadeOut", _root.getNextHighestDepth());
score = score * 0.8;
Frame 76
this.playSound("_music", 9999);
score = score + Math.round((((10000 * level) * level) / t) - healthLost);
attachMovie("fadeOut", "fadeOut", _root.getNextHighestDepth());
Frame 77
attachMovie("fadeOut", "fadeOut", _root.getNextHighestDepth());
sc.text = "You scored " + score;
buttonMainMenu.onRelease = function () {
_root.gotoAndPlay("mainMenu");
};
buttonSubmit.onRelease = function () {
if ((playerName == undefined) || (playerName == "")) {
return(undefined);
}
_root.gotoAndPlay("highscores");
};
buttonMoreGames.onRelease = function () {
getURL ("http://www.mousebreaker.com", "_blank");
};
buttonFacebook.onRelease = function () {
getURL ("http://apps.facebook.com/mousebreakergames/?utm_source=distrobution&utm_medium=generic-sites&utm_campaign=brian-damage", "_blank");
};
stop();
Frame 78
stop();
Instance of Symbol 812 MovieClip "xyz" in Frame 78
onClipEvent (load) {
score = _level0.score;
playerName = _level0.playerName;
this.loadVariables("highscores_briandamage.php?" + int(Math.random() * 100000), "POST");
}
Symbol 29 MovieClip [showMsg] Frame 85
removeMovieClip(this);
Symbol 52 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 54 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 61 MovieClip [bgr3] Frame 1
_root.allowFinish = true;
obj.onEnterFrame = function () {
if (this.hitTest(_root.char)) {
_root.instructions = _root.inGameText[_root.level][1];
delete this.onEnterFrame;
}
};
Symbol 65 MovieClip [lighting] Frame 10
removeMovieClip(this);
Symbol 75 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 124 MovieClip [topPan] Frame 1
if (_root.mute == true) {
btnMute.gotoAndStop(2);
}
btnMute.onRelease = function () {
_root.mute = !_root.mute;
if (this._currentframe == 1) {
_root.thisSound.setVolume(0);
this.gotoAndStop(2);
} else {
_root.thisSound.setVolume(100);
this.gotoAndStop(1);
}
};
btnRestart.onRelease = function () {
_root.gotoAndPlay("mainMenu");
_root.clearAll();
};
buttonMouseBreaker.onRelease = function () {
getURL ("http://www.mousebreaker.com", "_blank");
};
Symbol 134 MovieClip [fadeOut] Frame 22
removeMovieClip(this);
Symbol 147 MovieClip Frame 24
this._parent.gotoAndStop("walk");
Symbol 163 MovieClip Frame 19
this._parent.removeMovieClip();
Symbol 175 MovieClip Frame 38
this._parent.removeMovieClip();
Symbol 183 MovieClip Frame 5
this._parent.gotoAndStop("walk");
Symbol 184 MovieClip [enemy1] Frame 2
enemy.gotoAndPlay(random(30));
Symbol 197 MovieClip Frame 31
this._parent.gotoAndStop("walk");
Symbol 210 MovieClip Frame 22
this._parent.removeMovieClip();
Symbol 214 MovieClip Frame 18
this._parent.removeMovieClip();
Symbol 226 MovieClip Frame 18
this._parent.gotoAndStop("walk");
Symbol 227 MovieClip [enemy4] Frame 2
enemy.gotoAndPlay(random(14));
Symbol 261 MovieClip Frame 24
this._parent.gotoAndStop("walk");
Symbol 277 MovieClip Frame 18
this._parent.removeMovieClip();
Symbol 280 MovieClip Frame 18
this._parent.removeMovieClip();
Symbol 288 MovieClip Frame 18
this._parent.gotoAndStop("walk");
Symbol 289 MovieClip [enemy3] Frame 2
enemy.gotoAndPlay(random(9));
Symbol 302 MovieClip Frame 32
this._parent.gotoAndStop("walk");
Symbol 321 MovieClip Frame 25
this._parent.removeMovieClip();
Symbol 325 MovieClip Frame 18
this._parent.removeMovieClip();
Symbol 331 MovieClip Frame 17
this._parent.gotoAndStop("walk");
Symbol 332 MovieClip [enemy2] Frame 2
enemy.gotoAndPlay(random(20));
Symbol 342 MovieClip Frame 30
this._parent.gotoAndStop("walk");
Symbol 361 MovieClip Frame 23
this._parent.removeMovieClip(this);
Symbol 366 MovieClip Frame 18
this._parent.removeMovieClip();
Symbol 374 MovieClip Frame 20
this._parent.gotoAndStop("walk");
Symbol 375 MovieClip [enemy0] Frame 2
enemy.gotoAndPlay(random(21));
Symbol 386 MovieClip [bgr5] Frame 1
_root.allowFinish = true;
obj.onEnterFrame = function () {
if (this.hitTest(_root.char)) {
_root.instructions = _root.inGameText[_root.level][1];
delete this.onEnterFrame;
}
};
Symbol 394 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 396 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 398 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 399 MovieClip [bgr4] Frame 1
_root.allowFinish = true;
obj.onEnterFrame = function () {
if (this.hitTest(_root.char)) {
_root.instructions = _root.inGameText[_root.level][1];
delete this.onEnterFrame;
}
};
Symbol 406 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 408 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 421 MovieClip [bgr2] Frame 1
_root.allowFinish = true;
obj.onEnterFrame = function () {
if (this.hitTest(_root.char)) {
_root.instructions = _root.inGameText[_root.level][1];
delete this.onEnterFrame;
}
};
Symbol 431 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 449 MovieClip Frame 1
_root.activeObject.push(obj0);
Symbol 452 MovieClip [bgr1] Frame 1
_root.allowFinish = true;
obj.onEnterFrame = function () {
if (this.hitTest(_root.char)) {
_root.instructions = _root.inGameText[_root.level][1];
delete this.onEnterFrame;
}
};
Symbol 472 MovieClip Frame 1
Symbol 493 MovieClip Frame 1
Symbol 529 MovieClip Frame 2
_root.char.playSound("_weapon1standby", 9999);
Symbol 529 MovieClip Frame 3
_root.char.playSound("_weapon1start");
Symbol 529 MovieClip Frame 9
stop();
_root.char.playSound("_weapon1", 999);
Symbol 529 MovieClip Frame 10
_root.char.playSound("_weapon1off");
Symbol 529 MovieClip Frame 35
gotoAndStop ("weapon1");
_root.char.playSound("_weapon1standby", 999);
Symbol 529 MovieClip Frame 42
stop();
Symbol 529 MovieClip Frame 49
stop();
Symbol 529 MovieClip Frame 51
stop();
_root.char.playSound("_weapon4", 999);
Symbol 529 MovieClip Frame 52
_root.char.playSound("_weapon4off");
Symbol 529 MovieClip Frame 56
gotoAndStop ("weapon4");
Symbol 529 MovieClip Frame 57
_root.char.playSound("_weapon5standby", 9999);
Symbol 529 MovieClip Frame 58
stop();
_root.char.playSound("_weapon5", 999);
Symbol 529 MovieClip Frame 59
_root.char.playSound("_weapon5off");
Symbol 529 MovieClip Frame 67
gotoAndStop ("weapon5");
Symbol 529 MovieClip Frame 85
stop();
Symbol 536 MovieClip [char] Frame 1
stop();
Symbol 536 MovieClip [char] Frame 2
_root.char.playSound();
Symbol 536 MovieClip [char] Frame 59
this._parent.loseState();
Symbol 541 MovieClip [rico] Frame 10
removeMovieClip(this);
Symbol 558 MovieClip Frame 9
this._parent.removeMovieClip();
Symbol 559 MovieClip [fire] Frame 1
stop();
Symbol 559 MovieClip [fire] Frame 2
stop();
Symbol 580 MovieClip [explosion] Frame 22
removeMovieClip(this);
Symbol 583 MovieClip [arrowUpRight] Frame 31
removeMovieClip(this);
Symbol 584 MovieClip [arrowUpLeft] Frame 31
removeMovieClip(this);
Symbol 585 MovieClip [arrowUp] Frame 31
removeMovieClip(this);
Symbol 586 MovieClip [arrowLeft] Frame 31
removeMovieClip(this);
Symbol 587 MovieClip [arrowDownRight] Frame 31
removeMovieClip(this);
Symbol 588 MovieClip [arrowDownLeft] Frame 31
removeMovieClip(this);
Symbol 589 MovieClip [arrowDown] Frame 31
removeMovieClip(this);
Symbol 590 MovieClip [arrowRight] Frame 31
removeMovieClip(this);
Symbol 593 MovieClip [moneyText] Frame 35
removeMovieClip(this);
Symbol 598 MovieClip [train] Frame 73
removeMovieClip(this);
Instance of Symbol 615 MovieClip in Symbol 616 MovieClip Frame 1
on (release) {
getURL ("http://madfatcat.com?ref=brianDamage", "_blank");
}
Symbol 619 MovieClip [credits] Frame 13
stop();
btnClose.onRelease = function () {
play();
_root.showMessage(_root.levelText[_root.level]);
};
Symbol 619 MovieClip [credits] Frame 26
_root.pause = false;
removeMovieClip(this);
Symbol 650 MovieClip [instructions] Frame 13
stop();
btnClose.onRelease = function () {
play();
_root.showMessage(_root.levelText[_root.level]);
};
Symbol 650 MovieClip [instructions] Frame 26
_root.pause = false;
_root.t0 = getTimer();
removeMovieClip(this);
Symbol 815 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 _local23 = 11000;
var _local19 = options.ad_timeout;
if (options.skip) {
_local19 = 0;
}
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 _local22 = options.color;
delete options.color;
var _local20 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local20);
_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(_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 _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local24, 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 = _local23;
chk.ad_timeout = _local19;
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;
}
};
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 _local10 = {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, _local10);
var clip = options.clip;
var _local9 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local3 = clip._mochiad;
_local3.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local11 = _local5[0];
var _local8 = _local5[1];
_local3._x = _local11 * 0.5;
_local3._y = _local8 * 0.5;
var chk = _local3.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local9;
chk.started = getTimer();
chk.showing = false;
_local3.lc.adLoaded = options.ad_loaded;
_local3.lc.adSkipped = options.ad_skipped;
_local3.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
_local3.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local21 = false;
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 _local12 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local12);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local6 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local6._mochiad_loaded) {
return(null);
}
var _local11 = options.depth;
delete options.depth;
var mc = _local6.createEmptyMovieClip("_mochiad", _local11);
var _local10 = _getRes(options);
options.res = (_local10[0] + "x") + _local10[1];
options.server = options.server + options.id;
delete options.id;
_local6._mochiad_loaded = true;
if (_local6._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = mc.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local9 = _local4.server;
delete _local4.server;
var _local13 = _allowDomains(_local9);
mc.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 _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = mc;
_local5.name = _local8;
_local5.hostname = _local13;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
mc.lc = _local5;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
_local4.lc = _local8;
_local4.st = getTimer();
if (!options.skip) {
_local4.loadMovie(_local9 + ".swf", "POST");
}
return(mc);
}
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 816 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 817 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.8 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.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_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, 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.MochiSocial.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 updateCopy(args) {
send("coins_updateCopy", args, null, null);
}
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 818 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 819 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
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 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 startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
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 820 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
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 requestLogin() {
mochi.as2.MochiServices.send("coins_requestLogin");
}
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 LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
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 671 MovieClip Frame 7
gotoAndPlay (1);
Symbol 674 MovieClip Frame 32
gotoAndPlay (1);
Symbol 680 MovieClip Frame 1
Symbol 680 MovieClip Frame 19
stop();
Symbol 694 MovieClip Frame 36
gotoAndPlay (1);
Symbol 696 MovieClip Frame 208
_root.play();
Symbol 752 MovieClip Frame 94
_root.gotoAndStop("submitScore");
Symbol 779 MovieClip Frame 1
stop();
Symbol 796 MovieClip Frame 1
stop();
Symbol 796 MovieClip Frame 215
gotoAndPlay (2);
Symbol 799 MovieClip Frame 143
_root.play();
Symbol 814 MovieClip Frame 86
_root.gotoAndStop("mainMenu");