Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("77b24cbc", this, 10301, true);
Frame 2
function moveOn() {
this.gotoAndStop(5);
}
MochiAd.showPreGameAd({id:"fcd227f8f122f836", res:"550x400", ad_finished:function () {
moveOn();
}});
Frame 5
mochi.MochiServices.connect("ae81787d5f9d358a");
this.addButton.onRelease = function () {
getURL ("http://www.gamebonkers.com/?link=ecaps");
};
Instance of Symbol 330 MovieClip [Splash] in Frame 5
//component parameters
onClipEvent (construct) {
frameAfterCompletion = 6;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Frame 6
function setUp() {
shotA = new Sound(this);
shotA.attachSound("lazer");
shotA.setVolume(70);
shotB = new Sound(this);
shotB.attachSound("lazer_retro2");
shotC = new Sound(this);
shotC.attachSound("lazer_retro");
shotD = new Sound(this);
shotD.attachSound("beam");
shockX = new Sound(this);
shockX.attachSound("ShockX");
explosion = new Sound(this);
explosion.attachSound("Explode");
explosion2 = new Sound(this);
explosion2.attachSound("explosion2");
explosionB = new Sound(this);
explosionB.attachSound("smallxplo");
collect = new Sound(this);
collect.attachSound("collected");
sCollect = new Sound(this);
sCollect.attachSound("pcollect");
Spawn = new Sound(this);
Spawn.attachSound("PlayerSpawn");
eSpawn = new Sound(this);
eSpawn.attachSound("EnemySpawn");
HitA = new Sound(this);
HitA.attachSound("smallHit");
mOver = new Sound(this);
mOver.attachSound("mouse_over1");
swSnd = new Sound(this);
swSnd.attachSound("switchSnd");
WAVE = new Sound(this);
WAVE.attachSound("NWAVE");
MSHIP = new Sound(this);
MSHIP.attachSound("mShip");
}
function startGame() {
if (endScreen != undefined) {
removeMC(endScreen);
}
lightfx._alpha = 100;
Mouse.hide();
attachMovie("mainMenu", "mainMenu", 0, {_x:0, _y:0});
}
function newGame() {
if (endScreen != undefined) {
removeMC(endScreen);
}
attachMovie("hud", "hud", 6, {_x:0, _y:0});
proxMgr = new ProximityManager();
proxMgr.gridSize = 25;
attachMovie("bg1", "bg1", 0, {_x:0, _y:0});
attachMovie("container", "gameContainer", 1, {_x:0, _y:0});
playerScore = 0;
currentLevel = 0;
gameObjects = new Array();
collectables = new Array();
gameContainer.attachMovie("playernew", "player", 0, {_x:275, _y:200});
gameContainer.player.hull.gotoAndStop(1);
gameContainer.player.weapon.gotoAndStop(1);
attachMovie("popup", "popup1", 39, {_x:275, _y:200});
gameTarget = gameContainer.player;
bPaused = true;
}
function onMouseDown() {
gameContainer.player.bFiring = true;
}
function onMouseUp() {
gameContainer.player.bFiring = false;
}
function updateWorld() {
gameContainer._x = (-gameContainer.player._x) + 275;
gameContainer._y = (-gameContainer.player._y) + 200;
bg1._x = gameContainer._x * 0.2;
bg1._y = gameContainer._y * 0.2;
proxMgr.refresh();
}
function removeMC(mc) {
var _local2 = _root.getInstanceAtDepth(0);
mc.swapDepths(0);
mc.removeMovieClip();
if (_local2 != undefined) {
_local2.swapDepths(0);
}
}
function checkEnemys() {
var _local1 = 0;
for (i in gameObjects) {
if (gameObjects[i] != undefined) {
_local1 = _local1 + 1;
}
}
if ((_local1 <= 0) && (bEnemysChecked == false)) {
bEnemysChecked = true;
}
}
function createPowerUps() {
var _local1 = new Array();
_local1.removeAll();
_local1 = getPowerUps(currentLevel);
for (i in _local1) {
xpos = (gameContainer.player._x - 250) + (Math.random() * 500);
ypos = (gameContainer.player._y - 200) + (Math.random() * 400);
gameContainer.attachMovie(_local1[i], "powerup" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:xpos, _y:ypos});
}
if (gameContainer.player.mine < 9) {
gameContainer.player.mine = gameContainer.player.mine + 2;
}
currentLevel = currentLevel + 1;
createEnemys();
}
function createEnemys() {
var _local6 = currentLevel + 2;
if (_local6 > 8) {
_local6 = 8;
}
if ((Math.floor(currentLevel * 0.2) == (currentLevel * 0.2)) || (bTestBoss == true)) {
var _local3 = 0 + (Math.random() * 1200);
var _local2 = 0 + (Math.random() * 1200);
var _local1 = gameContainer.attachMovie("enemyBoss", "enemy" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:_local3, _y:_local2});
_local1.power = currentLevel + 2;
_local1._alpha = 0;
if (currentLevel >= 20) {
_local3 = 0 + (Math.random() * 1200);
_local2 = 0 + (Math.random() * 1200);
_local1 = gameContainer.attachMovie("enemyBoss", "enemy" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:_local3, _y:_local2});
_local1.power = currentLevel + 2;
_local1._alpha = 0;
}
MSHIP.start();
} else {
WAVE.start();
i = 1;
while (i < _local6) {
var _local3 = 0 + (Math.random() * 1200);
var _local2 = 0 + (Math.random() * 1200);
var _local1 = gameContainer.attachMovie("enemyBlue", "enemy" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:_local3, _y:_local2});
_local1.power = currentLevel + 2;
_local1.health = currentLevel + 2;
_local1.fHealth = currentLevel + 2;
_local1._alpha = 0;
_local3 = 0 + (Math.random() * 1200);
_local2 = 0 + (Math.random() * 1200);
_local1 = gameContainer.attachMovie("enemyGreen", "enemy" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:_local3, _y:_local2});
_local1.power = currentLevel + 2;
_local1.health = currentLevel + 2;
_local1.fHealth = currentLevel + 2;
_local1._alpha = 0;
_local3 = 0 + (Math.random() * 1200);
_local2 = 0 + (Math.random() * 1200);
_local1 = gameContainer.attachMovie("enemyRed", "enemy" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:_local3, _y:_local2});
_local1.power = currentLevel + 2;
_local1.health = currentLevel + 2;
_local1.fHealth = currentLevel + 2;
_local1._alpha = 0;
_local3 = 0 + (Math.random() * 1200);
_local2 = 0 + (Math.random() * 1200);
_local1 = gameContainer.attachMovie("enemyYellow", "enemy" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:_local3, _y:_local2});
_local1.power = currentLevel + 2;
_local1.health = currentLevel + 2;
_local1.fHealth = currentLevel + 2;
_local1._alpha = 0;
i++;
}
}
bEnemysChecked = false;
}
function spawnShield() {
var _local3 = (gameContainer.player._x - 250) + (Math.random() * 500);
var _local2 = (gameContainer.player._y - 200) + (Math.random() * 400);
var _local1 = gameContainer.attachMovie("HullPickup", "shieldup" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:_local3, _y:_local2});
_local1.xspeed = -1 + (Math.random() * 2);
_local1.yspeed = -1 + (Math.random() * 2);
collectables.push(_local1);
}
function checkCollision(actor, other) {
if (getDistance(actor, other) < (actor.radius + other.radius)) {
return(true);
}
return(false);
}
function traceHit(rot, range, actor) {
var _local7 = 10;
var _local6 = actor._x;
var _local5 = actor._y;
var _local11 = Math.cos(angle) * _local7;
var _local10 = Math.sin(angle) * _local7;
var angle = ((rot / 180) * Math.PI);
var _local8 = new Array();
while (_local7 < range) {
_local6 = _local6 + _local11;
_local5 = _local5 + _local10;
for (var _local9 in gameObjects) {
var _local1 = gameObjects[_local9];
if (_local1 != undefined) {
var _local3 = _local6 - _local1._x;
var _local2 = _local5 - _local1._y;
var _local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (_local4 < 20) {
_local8.push(_local1);
}
}
}
_local7 = _local7 + 10;
}
return(_local8);
}
function gameOver() {
removeMC(bg1);
removeMC(hud);
removeMC(gameContainer);
attachMovie("blackOut", "bout", 21, {_x:0, _y:0});
attachMovie("endScreen", "endScreen", 4, {_x:0, _y:0});
}
function cleanUp() {
}
function getDistance(actor, other) {
var _local2 = actor._x - other._x;
var _local1 = actor._y - other._y;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function getAngle(pointA, pointB) {
var _local1 = Math.atan2(pointA, pointB);
var _local2 = (_local1 * 180) / Math.PI;
return(_local2);
}
function hitFX(actor) {
var _local2 = 1;
while (_local2 < 4) {
var _local3 = -8 + (Math.random() * 16);
var _local4 = -8 + (Math.random() * 16);
var _local1 = gameContainer.attachMovie("spark", "spark" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:actor._x, _y:actor._y});
_local1.velocity_x = _local3;
_local1.velocity_y = _local4;
_local2++;
}
}
function blastFX(actor) {
var _local1 = gameContainer.attachMovie("blast", "spark" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:actor._x, _y:actor._y});
_local1._xscale = 5;
_local1._yscale = 5;
}
function collectFX(actor) {
collect.start();
var _local1 = gameContainer.attachMovie("colFX", "spark" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:actor._x, _y:actor._y});
_local1._xscale = 120;
_local1._yscale = 120;
}
function explode(damage, actor, range) {
shockX.start();
var _local1 = gameContainer.attachMovie("blast2", "spark" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:actor._x, _y:actor._y});
_local1._xscale = 5;
_local1._yscale = 5;
_local1.power = damage;
_local1.range = range;
}
function trailFX(actor) {
var _local1 = gameContainer.attachMovie("pulsefx", "trail" + gameContainer.getNextHighestDepth(), gameContainer.getNextHighestDepth(), {_x:actor._x, _y:actor._y});
_local1._rotation = actor._rotation;
return(_local1);
}
function getPowerUps(curLevel) {
var _local1 = new Array();
_local1.removeAll();
switch (curLevel) {
case 1 :
_local1[0] = "lsrPickUp";
break;
case 2 :
_local1[0] = "nukePickUp";
_local1[1] = "plsPickUp";
break;
case 3 :
_local1[0] = "lsrPickUp";
_local1[1] = "magPickUp";
break;
case 5 :
_local1[0] = "lsrPickUp";
_local1[1] = "plsPickUp";
break;
case 7 :
_local1[0] = "lsrPickUp";
_local1[1] = "plsPickUp";
_local1[2] = "shkPickUp";
break;
case 9 :
_local1[0] = "lsrPickUp";
_local1[1] = "plsPickUp";
_local1[2] = "shkPickUp";
break;
case 10 :
_local1[0] = "lsrPickUp";
_local1[1] = "magPickUp";
break;
case 11 :
_local1[0] = "lsrPickUp";
_local1[2] = "shkPickUp";
break;
case 12 :
_local1[0] = "lsrPickUp";
_local1[1] = "plsPickUp";
break;
case 13 :
_local1[0] = "shkPickUp";
break;
case 14 :
_local1[0] = "lsrPickUp";
_local1[1] = "plsPickUp";
break;
case 15 :
_local1[0] = "shkPickUp";
_local1[1] = "nukePickUp";
break;
case 16 :
_local1[0] = "plsPickUp";
_local1[1] = "magPickUp";
break;
case 17 :
_local1[0] = "shkPickUp";
break;
case 18 :
_local1[0] = "plsPickUp";
break;
case 19 :
_local1[0] = "shkPickUp";
_local1[1] = "nukePickUp";
break;
case 20 :
_local1[0] = "plsPickUp";
_local1[1] = "magPickUp";
break;
case 22 :
_local1[0] = "plsPickUp";
_local1[1] = "nukePickUp";
break;
case 22 :
_local1[0] = "nukePickUp";
_local1[1] = "nukePickUp";
break;
case 29 :
_local1[0] = "shkPickUp";
_local1[1] = "magPickUp";
break;
case 30 :
_local1[0] = "shkPickUp";
_local1[1] = "nukePickUp";
_local1[2] = "nukePickUp";
break;
default :
_local1[0] = getMissedPwrUp();
}
return(_local1);
}
function getMissedPwrUp() {
pwrUp = "";
if (currentLevel > 30) {
if (gameContainer.player.laser < 10) {
pwrUp = "lsrPickUp";
} else if (gameContainer.player.shock < 10) {
pwrUp = "shkPickUp";
} else if (gameContainer.player.pulse < 10) {
pwrUp = "plsPickUp";
}
}
return(pwrUp);
}
stop();
var playerScore = 0;
var currentLevel = 0;
var bEnemysChecked = false;
var bTestBoss = false;
attachMovie("light", "lightfx", 5, {_x:0, _y:0});
attachMovie("music", "music", 22, {_x:0, _y:0});
attachMovie("blackOut", "blout", 50, {_x:0, _y:0});
attachMovie("cHair", "chair1", 40, {_x:0, _y:0});
attachMovie("muteB", "muteButton", 26, {_x:10, _y:380});
setUp();
lightfx.blendMode = 13;
startGame();
Symbol 3 MovieClip [music] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.ogm = new Sound(this);
this.ogm.attachSound("bgm");
this.ogm.start();
this.ogm.setVolume(85);
this.ogm.onSoundComplete = function () {
this.start();
};
}
}
Symbol 5 MovieClip [pulse2] Frame 1
#initclip 56
Object.registerClass("pulse2", Beam);
#endinitclip
Symbol 9 MovieClip [Epusle] Frame 1
#initclip 35
Object.registerClass("Epusle", EPulse);
#endinitclip
Symbol 12 MovieClip [magProj] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.counter = 0;
this.radius = 10;
}
if (!_root.bPaused) {
this.outer._rotation = this.outer._rotation + 3;
this.outer2._rotation = this.outer2._rotation - 3;
var _local8 = this.counter * 0.01;
_root._x = (-_local8) + (Math.random() * (_local8 * 2));
_root._y = (-_local8) + (Math.random() * (_local8 * 2));
this.counter++;
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
if ((((this._x < 10) || (this._x > 1190)) || (this._y < 10)) || (this._y > 1190)) {
this.dirx = 0;
this.diry = 0;
}
this.dirx = this.dirx * 0.92;
this.diry = this.diry * 0.92;
for (i in _root.gameObjects) {
var _local4 = _root.gameObjects[i];
if (_local4 != undefined) {
var _local7 = this._x - _local4._x;
var _local6 = this._y - _local4._y;
var _local9 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local5 = Math.atan2(_local6, _local7);
if (_local9 > 40) {
_local4.xspeed = Math.cos(_local5 - 1.1) * (_local8 * 2);
_local4.yspeed = Math.sin(_local5 - 1.1) * (_local8 * 2);
} else {
_local4.xspeed = Math.cos(_local5 - 1.5) * _local8;
_local4.yspeed = Math.sin(_local5 - 1.5) * _local8;
}
}
}
if (this.counter >= 450) {
this.destroy();
}
var _local12 = this._x + (-80 + (Math.random() * 160));
var _local11 = this._y + (-80 + (Math.random() * 160));
var _local15 = this._x - _local12;
var _local14 = this._y - _local11;
var _local13 = Math.atan2(_local14, _local15);
var _local10 = _parent.attachMovie("rspark", "spark" + parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_local12, _y:_local11});
_local10.velocity_x = Math.cos(_local13) * 2;
_local10.velocity_y = Math.sin(_local13) * 2;
_local10._xscale = 10;
}
}
function destroy() {
_root._x = 0;
_root._y = 0;
_root.gameTarget = _parent.player;
_root.hitFX(this);
_root.explode(1, this, 500);
_root.removeMC(this);
}
Symbol 15 MovieClip [mineProj] Frame 1
#initclip 36
Object.registerClass("mineProj", Mine);
#endinitclip
Symbol 25 MovieClip [shockProj] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.collided = false;
}
if (!_root.bPaused) {
if (this.collided == false) {
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
if ((((this._x < 0) || (this._x > 1200)) || (this._y < 0)) || (this._y > 1200)) {
this.destroy();
}
for (i in _root.gameObjects) {
enemy = _root.gameObjects[i];
if (enemy != undefined) {
dist_x = this._x - enemy._x;
if ((dist_x > -50) && (dist_x < 50)) {
dist_y = this._y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 15) {
this.collided = true;
enemy.takeHit(this.power);
_root.explode(0.5, this, 200 + (this.power * 10));
this.destroy();
}
}
}
}
}
}
}
function destroy() {
_root.hitFX(this);
_root.removeMC(this);
}
Symbol 26 MovieClip [pulse] Frame 1
#initclip 37
Object.registerClass("pulse", Pulse);
#endinitclip
Symbol 29 MovieClip [pulsefx] Frame 1
function onEnterFrame() {
this._yscale = this._yscale - 4;
this._alpha = this._yscale;
if (this._yscale < 10) {
_root.removeMC(this);
}
}
Symbol 32 MovieClip [rspark] Frame 1
function onEnterFrame() {
this._xscale = this._xscale * 1.1;
this._yscale = this._xscale;
if (this._xscale > 100) {
_root.removeMC(this);
}
this._x = this._x + this.velocity_x;
this._y = this._y + this.velocity_y;
}
Symbol 35 MovieClip [nukeFX] Frame 1
#initclip 38
Object.registerClass("nukeFX", NukeFX);
#endinitclip
Symbol 36 MovieClip [cleaner] Frame 1
#initclip 39
Object.registerClass("cleaner", Cleaner);
#endinitclip
Symbol 37 MovieClip [blast2] Frame 1
#initclip 40
Object.registerClass("blast2", Blast);
#endinitclip
Symbol 40 MovieClip [colFX] Frame 1
function onEnterFrame() {
if (!this.bsetup) {
this.bsetup = true;
this.counter = 0;
this._alpha = 60;
}
this.counter++;
if (this.counter > 4) {
this._xscale = this._xscale * 0.9;
this._yscale = this._yscale * 0.9;
} else {
this._xscale = this._xscale * 1.1;
this._yscale = this._yscale * 1.1;
}
this._alpha = this._alpha * 0.95;
if (this._xscale < 2) {
_root.removeMC(this);
}
}
Symbol 41 MovieClip [blast] Frame 1
function onEnterFrame() {
this._xscale = this._xscale * 1.5;
this._yscale = this._yscale * 1.5;
this._alpha = this._alpha * 0.95;
if (this._xscale > 300) {
_root.removeMC(this);
}
this._x = this._x + this.velocity_x;
this._y = this._y + this.velocity_y;
}
Symbol 44 MovieClip [spark] Frame 1
#initclip 41
Object.registerClass("spark", Spark);
#endinitclip
Symbol 78 MovieClip Frame 1
function onEnterFrame() {
if (this._alpha > 5) {
this._alpha = this._alpha - 2;
}
}
Symbol 79 MovieClip [playernew] Frame 1
#initclip 42
Object.registerClass("playernew", Player);
#endinitclip
Symbol 99 MovieClip [waveTimer] Frame 1
function onEnterFrame() {
if (!this.bsetup) {
this.start_time = getTimer();
_root.clock = this;
this.bsetup = true;
this.count = ((_root.currentLevel * 2) + 34) * 1000;
this.warningTime = 8000;
this.bPaused = false;
}
if (!_root.bPaused) {
if (this.bPaused) {
this.bPaused = false;
this.start_time = getTimer();
if (elapsed_time != undefined) {
this.count = this.count - this.elapsed_time;
}
} else {
this.elapsed_time = getTimer() - this.start_time;
this.timeDisplay.text = time_to_string(this.count - this.elapsed_time) + " ";
if (((this.count - this.elapsed_time) < 0) && (this.elapsed_time != undefined)) {
this.resetClock();
_root.createPowerUps();
}
}
} else {
this.bPaused = true;
}
}
function unPauseClock() {
}
function resetClock() {
this.start_time = getTimer();
this.count = ((_root.currentLevel * 2) + 34) * 1000;
}
function time_to_string(time_to_convert) {
elapsed_hours = Math.floor(time_to_convert / 3600000);
remaining = time_to_convert - (elapsed_hours * 3600000);
elapsed_minutes = Math.floor(remaining / 60000);
remaining = remaining - (elapsed_minutes * 60000);
elapsed_seconds = Math.floor(remaining / 1000);
remaining = remaining - (elapsed_seconds * 1000);
elapsed_fs = Math.floor(remaining / 10);
if (elapsed_minutes < 10) {
minutes = "0" + elapsed_minutes.toString();
} else {
minutes = elapsed_minutes.toString();
}
if (elapsed_seconds < 10) {
seconds = "0" + elapsed_seconds.toString();
} else {
seconds = elapsed_seconds.toString();
}
return((minutes + ":") + seconds);
}
Symbol 104 MovieClip [map] Frame 1
#initclip 43
Object.registerClass("map", Map);
#endinitclip
Symbol 108 MovieClip [hud] Frame 1
function onEnterFrame() {
var _local3 = _root.gameContainer.player;
this.mineText.text = _local3.mine;
this.nukeText.text = _local3.nuke;
this.magText.text = _local3.mag;
this.sp._xscale = _local3.health * 10;
this.sH._xscale = _local3.shieldHealth * 10;
if (this.sH._xscale > 100) {
this.sH._xscale = 100;
}
this.scoreText.text = _root.playerScore;
switch (_local3.weaponType) {
case 1 :
this.w1._alpha = 100;
this.w2._alpha = 40;
this.w3._alpha = 40;
this.w4._alpha = 40;
this.w5._alpha = 40;
this.w6._alpha = 40;
this.w7._alpha = 40;
this.wep._xscale = _local3.laser * 10;
this.sWeapon.text = "LASER";
break;
case 2 :
this.w2._alpha = 100;
this.w1._alpha = 40;
this.w3._alpha = 40;
this.w4._alpha = 40;
this.w5._alpha = 40;
this.w6._alpha = 40;
this.w7._alpha = 40;
this.wep._xscale = 100;
this.sWeapon.text = "MINE";
break;
case 3 :
this.w3._alpha = 100;
this.w1._alpha = 40;
this.w2._alpha = 40;
this.w4._alpha = 40;
this.w5._alpha = 40;
this.w6._alpha = 40;
this.w7._alpha = 40;
this.wep._xscale = _local3.pulse * 10;
this.sWeapon.text = "PULSE";
break;
case 4 :
this.w4._alpha = 100;
this.w1._alpha = 40;
this.w3._alpha = 40;
this.w2._alpha = 40;
this.w5._alpha = 40;
this.w6._alpha = 40;
this.w7._alpha = 40;
this.wep._xscale = 100;
break;
case 5 :
this.w5._alpha = 100;
this.w1._alpha = 40;
this.w3._alpha = 40;
this.w4._alpha = 40;
this.w2._alpha = 40;
this.w6._alpha = 40;
this.w7._alpha = 40;
this.wep._xscale = _local3.shock * 10;
this.sWeapon.text = "SHOCKWAVE";
break;
case 6 :
this.w6._alpha = 100;
this.w1._alpha = 40;
this.w3._alpha = 40;
this.w4._alpha = 40;
this.w5._alpha = 40;
this.w2._alpha = 40;
this.w7._alpha = 40;
this.wep._xscale = 100;
this.sWeapon.text = "MAGNET";
break;
case 7 :
this.w7._alpha = 100;
this.w1._alpha = 40;
this.w3._alpha = 40;
this.w4._alpha = 40;
this.w5._alpha = 40;
this.w6._alpha = 40;
this.w2._alpha = 40;
this.wep._xscale = 100;
this.sWeapon.text = "NUKE";
}
}
Symbol 112 MovieClip Frame 1
function onEnterFrame() {
if (!this.setup) {
this.setup = true;
this.setMask(this._parent.hMask);
}
}
Symbol 125 MovieClip [enemyBoss] Frame 1
#initclip 44
Object.registerClass("enemyBoss", EnemyBoss);
#endinitclip
Symbol 126 MovieClip [shieldBlue] Frame 1
#initclip 45
Object.registerClass("shieldBlue", ShieldBlue);
#endinitclip
Symbol 129 MovieClip [enemyBlue] Frame 1
#initclip 46
Object.registerClass("enemyBlue", EnemyBlue);
#endinitclip
Symbol 133 MovieClip Frame 1
function onEnterFrame() {
if (!this.setup) {
this.setup = true;
this.setMask(this._parent.hMask);
}
}
Symbol 134 MovieClip [enemyGreen] Frame 1
#initclip 47
Object.registerClass("enemyGreen", EnemyGreen);
#endinitclip
Symbol 138 MovieClip Frame 1
function onEnterFrame() {
if (!this.setup) {
this.setup = true;
this.setMask(this._parent.hMask);
}
}
Symbol 139 MovieClip [enemyRed] Frame 1
#initclip 48
Object.registerClass("enemyRed", EnemyRed);
#endinitclip
Symbol 143 MovieClip Frame 1
function onEnterFrame() {
if (!this.setup) {
this.setup = true;
this.setMask(this._parent.hMask);
}
}
Symbol 144 MovieClip [enemyYellow] Frame 1
#initclip 49
Object.registerClass("enemyYellow", EnemyYellow);
#endinitclip
Symbol 147 MovieClip [electroPickUp] Frame 1
#initclip 50
Object.registerClass("electroPickUp", ElectroPickup);
#endinitclip
Symbol 149 MovieClip [defensePickUp] Frame 1
#initclip 51
Object.registerClass("defensePickUp", DefensePickup);
#endinitclip
Symbol 153 MovieClip [hullPickUp] Frame 1
#initclip 52
Object.registerClass("hullPickUp", HullPickup);
#endinitclip
Symbol 155 MovieClip [shieldlPickUp] Frame 1
#initclip 53
Object.registerClass("shieldlPickUp", ShieldPickup);
#endinitclip
Symbol 158 MovieClip [telePickUp] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.gotoAndStop(1);
this.collected = false;
this.xspeed = -1 + (Math.random() * 2);
this.yspeed = -1 + (Math.random() * 2);
_root.collectables.push(this);
}
if (this.hitTest(_parent.player) && (!this.collected)) {
this.collected = true;
_parent.player.tele = _parent.player.tele + 1;
}
if (this.collected) {
_root.collectFX(this);
for (i in _root.collectables) {
if (_root.collectables == this) {
_root.collectables.splice(i, 1);
}
}
_root.removeMC(this);
}
if (this._x < 15) {
this._x = 16;
this.xspeed = this.xspeed * -1;
}
if (this._x > 1185) {
this._x = 1184;
this.xspeed = this.xspeed * -1;
}
if (this._y < 15) {
this._y = 16;
this.yspeed = this.yspeed * -1;
}
if (this._y > 1185) {
this._y = 1184;
this.yspeed = this.yspeed * -1;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
Symbol 160 MovieClip [nukePickUp] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.gotoAndStop(1);
this.collected = false;
this.xspeed = -1 + (Math.random() * 2);
this.yspeed = -1 + (Math.random() * 2);
_root.collectables.push(this);
}
if (this.hitTest(_parent.player) && (!this.collected)) {
this.collected = true;
_parent.player.nuke = _parent.player.nuke + 1;
}
if (this.collected) {
_root.collectFX(this);
for (i in _root.collectables) {
if (_root.collectables == this) {
_root.collectables.splice(i, 1);
}
}
_root.removeMC(this);
}
if (this._x < 15) {
this._x = 16;
this.xspeed = this.xspeed * -1;
}
if (this._x > 1185) {
this._x = 1184;
this.xspeed = this.xspeed * -1;
}
if (this._y < 15) {
this._y = 16;
this.yspeed = this.yspeed * -1;
}
if (this._y > 1185) {
this._y = 1184;
this.yspeed = this.yspeed * -1;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
Symbol 162 MovieClip [magPickUp] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.gotoAndStop(1);
this.collected = false;
this.xspeed = -1 + (Math.random() * 2);
this.yspeed = -1 + (Math.random() * 2);
_root.collectables.push(this);
}
if (this.hitTest(_parent.player) && (!this.collected)) {
this.collected = true;
_parent.player.mag = _parent.player.mag + 1;
}
if (this.collected) {
_root.collectFX(this);
for (i in _root.collectables) {
if (_root.collectables == this) {
_root.collectables.splice(i, 1);
}
}
_root.removeMC(this);
}
if (this._x < 15) {
this._x = 16;
this.xspeed = this.xspeed * -1;
}
if (this._x > 1185) {
this._x = 1184;
this.xspeed = this.xspeed * -1;
}
if (this._y < 15) {
this._y = 16;
this.yspeed = this.yspeed * -1;
}
if (this._y > 1185) {
this._y = 1184;
this.yspeed = this.yspeed * -1;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
Symbol 164 MovieClip [shkPickUp] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.gotoAndStop(1);
this.collected = false;
this.xspeed = -1 + (Math.random() * 2);
this.yspeed = -1 + (Math.random() * 2);
_root.collectables.push(this);
}
if (this.hitTest(_parent.player) && (!this.collected)) {
this.collected = true;
_parent.player.shock = _parent.player.shock + 1;
}
if (this.collected) {
_root.collectFX(this);
for (i in _root.collectables) {
if (_root.collectables == this) {
_root.collectables.splice(i, 1);
}
}
_root.removeMC(this);
}
if (this._x < 15) {
this._x = 16;
this.xspeed = this.xspeed * -1;
}
if (this._x > 1185) {
this._x = 1184;
this.xspeed = this.xspeed * -1;
}
if (this._y < 15) {
this._y = 16;
this.yspeed = this.yspeed * -1;
}
if (this._y > 1185) {
this._y = 1184;
this.yspeed = this.yspeed * -1;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
Symbol 166 MovieClip [plsPickUp] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.gotoAndStop(1);
this.collected = false;
this.xspeed = -1 + (Math.random() * 2);
this.yspeed = -1 + (Math.random() * 2);
_root.collectables.push(this);
}
if (this.hitTest(_parent.player) && (!this.collected)) {
this.collected = true;
_parent.player.pulse = _parent.player.pulse + 1;
}
if (this.collected) {
_root.collectFX(this);
for (i in _root.collectables) {
if (_root.collectables == this) {
_root.collectables.splice(i, 1);
}
}
_root.removeMC(this);
}
if (this._x < 15) {
this._x = 16;
this.xspeed = this.xspeed * -1;
}
if (this._x > 1185) {
this._x = 1184;
this.xspeed = this.xspeed * -1;
}
if (this._y < 15) {
this._y = 16;
this.yspeed = this.yspeed * -1;
}
if (this._y > 1185) {
this._y = 1184;
this.yspeed = this.yspeed * -1;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
Symbol 168 MovieClip [lsrPickUp] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.gotoAndStop(1);
this.collected = false;
this.xspeed = -1 + (Math.random() * 2);
this.yspeed = -1 + (Math.random() * 2);
_root.collectables.push(this);
}
if (this.hitTest(_parent.player) && (!this.collected)) {
this.collected = true;
_parent.player.laser = _parent.player.laser + 1;
}
if (this.collected) {
_root.collectFX(this);
for (i in _root.collectables) {
if (_root.collectables == this) {
_root.collectables.splice(i, 1);
}
}
_root.removeMC(this);
}
if (this._x < 15) {
this._x = 16;
this.xspeed = this.xspeed * -1;
}
if (this._x > 1185) {
this._x = 1184;
this.xspeed = this.xspeed * -1;
}
if (this._y < 15) {
this._y = 16;
this.yspeed = this.yspeed * -1;
}
if (this._y > 1185) {
this._y = 1184;
this.yspeed = this.yspeed * -1;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
}
Symbol 169 MovieClip [electroPulse] Frame 1
function onEnterFrame() {
this.tEnemy.takeHit(1);
this._x = _parent.player._x;
this._y = _parent.player._y;
if (this.lightning._currentframe > 10) {
_root.removeMC(this);
}
}
Symbol 172 MovieClip [blueShot] Frame 1
#initclip 54
Object.registerClass("blueShot", BlueShot);
#endinitclip
Symbol 175 MovieClip [phaseBeam] Frame 1
#initclip 55
Object.registerClass("phaseBeam", PhaseBeam);
#endinitclip
Symbol 186 MovieClip [popup] Frame 1
function onEnterFrame() {
if (this.fade) {
this._alpha = this._alpha - 5;
}
if ((this._alpha <= 5) && (this.fade)) {
this.fade = false;
_root.eSpawn.start();
_root.createPowerUps();
_root.bPaused = false;
_root.removeMC(this);
}
}
this.conButton.onRelease = function () {
this._parent.fade = true;
};
Symbol 331 MovieClip [__Packages.EPulse] Frame 0
class EPulse extends MovieClip
{
var _x, dirx, _y, diry, _parent, power;
function EPulse () {
super();
}
function onEnterFrame() {
if (!_root.bPaused) {
_x = _x + dirx;
_y = _y + diry;
if ((((_x < 10) || (_x > 1190)) || (_y < 10)) || (_y > 1190)) {
destroy();
}
var _local4 = _parent.player;
var _local3 = _x - _local4._x;
if ((_local3 > -50) && (_local3 < 50)) {
var _local5 = _y - _local4._y;
var _local6 = Math.sqrt((_local3 * _local3) + (_local5 * _local5));
if (_local6 < 15) {
_local4.takeHit(power);
destroy();
}
}
}
}
function destroy() {
_root.hitFX(this);
_root.removeMC(this);
}
}
Symbol 332 MovieClip [__Packages.Mine] Frame 0
class Mine extends MovieClip
{
var _x, dirx, _y, diry, hitTest, power;
function Mine () {
super();
}
function onEnterFrame() {
_x = _x + dirx;
_y = _y + diry;
dirx = dirx * 0.95;
diry = diry * 0.95;
if ((((_x < 0) || (_x > 1200)) || (_y < 0)) || (_y > 1200)) {
destroy();
}
for (var _local4 in _root.gameObjects) {
var _local3 = _root.gameObjects[_local4];
if (_local3 != undefined) {
if (hitTest(_local3)) {
_root.explode(power, this, 100);
_root.blastFX(this);
destroy();
}
}
}
}
function destroy() {
_root.hitFX(this);
_root.removeMC(this);
}
}
Symbol 333 MovieClip [__Packages.Pulse] Frame 0
class Pulse extends MovieClip
{
var _x, dirx, _y, diry, enemy, dist_x, dist_y, distance, power;
function Pulse () {
super();
}
function onEnterFrame() {
_x = _x + dirx;
_y = _y + diry;
if (!_root.bPaused) {
if ((((_x < 0) || (_x > 1200)) || (_y < 0)) || (_y > 1200)) {
destroy();
}
for (var _local3 in _root.gameObjects) {
enemy = _root.gameObjects[_local3];
if (enemy != undefined) {
dist_x = _x - enemy._x;
if ((dist_x > -50) && (dist_x < 50)) {
dist_y = _y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 15) {
enemy.takeHit(power);
destroy();
}
}
}
}
}
}
function destroy() {
_root.hitFX(this);
_root.removeMC(this);
}
}
Symbol 334 MovieClip [__Packages.NukeFX] Frame 0
class NukeFX extends MovieClip
{
var _xscale, _yscale, _alpha, hitTest;
function NukeFX () {
super();
}
function onEnterFrame() {
_xscale = _xscale * 1.2;
_yscale = _yscale * 1.2;
_alpha = _alpha * 0.9;
if (_xscale > range) {
_root._x = 0;
_root._y = 0;
_root.removeMC(this);
}
if (_xscale < range) {
_root._x = -5 + (Math.random() * 10);
_root._y = -5 + (Math.random() * 10);
}
for (var _local4 in _root.gameObjects) {
var _local3 = _root.gameObjects[_local4];
if ((_local3 != undefined) && (_local3 != this)) {
if (hitTest(_local3)) {
_local3.takeHit(power);
}
}
}
}
var range = 3000;
var power = 10;
}
Symbol 335 MovieClip [__Packages.Cleaner] Frame 0
class Cleaner extends MovieClip
{
var _xscale, _yscale, _alpha;
function Cleaner () {
super();
}
function onEnterFrame() {
_xscale = _xscale * 1.1;
_yscale = _yscale * 1.1;
_alpha = _alpha * 0.9;
if (_xscale > range) {
_root.gameOver();
_root.removeMC(this);
}
}
var range = 20000;
var power = 100;
}
Symbol 336 MovieClip [__Packages.Blast] Frame 0
class Blast extends MovieClip
{
var _xscale, _yscale, _alpha, range, hitTest, power;
function Blast () {
super();
}
function onEnterFrame() {
_xscale = _xscale * 1.5;
_yscale = _yscale * 1.5;
_alpha = _alpha * 0.9;
if (_xscale > range) {
_root.removeMC(this);
}
for (var _local4 in _root.gameObjects) {
var _local3 = _root.gameObjects[_local4];
if ((_local3 != undefined) && (_local3 != this)) {
if (hitTest(_local3)) {
_local3.takeHit(power);
}
}
}
}
}
Symbol 337 MovieClip [__Packages.Spark] Frame 0
class Spark extends MovieClip
{
var velocity_x, velocity_y, _xscale, _yscale, _x, _y;
function Spark () {
super();
}
function onEnterFrame() {
velocity_x = velocity_x * 0.995;
velocity_y = velocity_y * 0.99;
_xscale = _xscale * 0.95;
_yscale = _yscale * 0.95;
if (_xscale < 2) {
_root.removeMC(this);
}
_x = _x + velocity_x;
_y = _y + velocity_y;
}
}
Symbol 338 MovieClip [__Packages.Player] Frame 0
class Player extends MovieClip
{
var _rotation, pauseTimer, switchTimer, fireTimer, _x, _y, hull, weapon, SHIELD, _parent, shieldTimer, _alpha;
function Player () {
super();
}
function onEnterFrame() {
var _local6 = _rotation;
if ((Key.isDown(80) && (_root.bPaused)) && (bSwitchpause)) {
_root.bPaused = false;
bSwitchpause = false;
pauseTimer = setInterval(this, "pauseTime", 500);
}
if ((Key.isDown(80) && (!_root.bPaused)) && (bSwitchpause)) {
_root.bPaused = true;
bSwitchpause = false;
pauseTimer = setInterval(this, "pauseTime", 500);
}
if (!_root.bPaused) {
if ((Key.isDown(82) && (!_root.bPaused)) && (bSwitchWeapon)) {
bSwitchWeapon = false;
switchTimer = setInterval(this, "switchTime", 200);
getNextWeapon();
}
if ((bFiring && (!bDead)) && (!bFired)) {
bFired = true;
if (weaponType == 1) {
fireTimer = setInterval(this, "fireTime", 200);
fireLaser();
} else if ((weaponType == 2) && (mine > 0)) {
fireTimer = setInterval(this, "fireTime", 400);
fireMine();
mine--;
} else if ((weaponType == 3) && (pulse > 0)) {
fireTimer = setInterval(this, "fireTime", 400);
firePulse();
} else if ((weaponType == 5) && (shock > 0)) {
fireTimer = setInterval(this, "fireTime", 500);
fireShock();
} else if ((weaponType == 6) && (mag > 0)) {
fireTimer = setInterval(this, "fireTime", 1000);
fireMag();
mag--;
} else if ((weaponType == 7) && (nuke > 0)) {
fireTimer = setInterval(this, "fireTime", 2000);
fireNuke();
nuke--;
} else {
weaponType = 1;
fireTimer = setInterval(this, "fireTime", 100);
}
}
if (Key.isDown(68) && (!_root.bPaused)) {
dirx = dirx + 0.5;
}
if (Key.isDown(65) && (!_root.bPaused)) {
dirx = dirx - 0.5;
}
if (Key.isDown(87) && (!_root.bPaused)) {
diry = diry - 0.5;
}
if (Key.isDown(83) && (!_root.bPaused)) {
diry = diry + 0.5;
}
if (!bDead) {
var _local4 = 200 - _root._ymouse;
var _local5 = 275 - _root._xmouse;
rRate = rRate * 0.8;
dirx = dirx * friction;
diry = diry * friction;
var _local3 = 180 + ((Math.atan2(_local4, _local5) * 180) / Math.PI);
_rotation = _local3;
_x = _x + dirx;
_y = _y + diry;
_root.updateWorld();
}
if (_x < 10) {
_x = 10;
}
if (_y < 10) {
_y = 10;
}
if (_x > 1190) {
_x = 1190;
}
if (_y > 1190) {
_y = 1190;
}
if (shieldHealth > 0) {
hull.gotoAndStop(3);
} else {
hull.gotoAndStop(1);
}
weapon.gotoAndStop(weaponType);
if (!bShielded) {
bShielded = true;
fireShields();
}
if (enemysHit >= 20) {
enemysHit = 0;
_root.spawnShield();
}
}
}
function getNextWeapon() {
weaponType++;
_root.swSnd.start();
if (weaponType > 7) {
weaponType = 1;
}
if (weaponType == 2) {
if (mine <= 0) {
weaponType++;
}
}
if (weaponType == 4) {
weaponType = 5;
}
if (weaponType == 5) {
if (shock <= 0) {
weaponType++;
}
}
if (weaponType == 6) {
if (mag <= 0) {
weaponType++;
}
}
if (weaponType == 7) {
if (nuke <= 0) {
weaponType = 1;
}
}
}
function takeHit(damage) {
_root.HitA.start();
var _local3 = damage * 0.1;
if (shieldHealth > 0) {
shieldHealth = shieldHealth - (_local3 * 2);
SHIELD._alpha = 40;
if (shieldHealth < 0) {
shieldHealth = 0;
}
} else {
health = health - _local3;
SHIELD._alpha = 0;
}
if ((health <= 0) && (bDead == false)) {
health = 0;
bDead = true;
destroy();
}
if (health <= 0) {
health = 0;
}
}
function getBestShield() {
if (electro > 0) {
currentShield = 4;
} else if (defense > 0) {
currentShield = 3;
} else if (shield > 0) {
currentShield = 2;
} else {
currentShield = 1;
}
}
function fireLaser() {
_root.shotD.start();
var _local4 = (_rotation / 180) * Math.PI;
var _local6 = (_x + (20 * Math.cos(_local4))) + dirx;
var _local5 = (_y + (20 * Math.sin(_local4))) + diry;
var _local8 = Math.cos(_local4) * 15;
var _local7 = Math.sin(_local4) * 15;
var _local3 = _parent.attachMovie("pulse", "pulse" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_local6, _y:_local5});
_local3.dirx = _local8;
_local3.diry = _local7;
_local3.power = laser * 0.8;
_local3._yscale = 100 + (laser * 10);
_local3._rotation = _rotation;
}
function fireMine() {
var _local2 = (_rotation / 180) * Math.PI;
var _local5 = (_x + (20 * Math.cos(_local2))) + dirx;
var _local4 = (_y + (20 * Math.sin(_local2))) + diry;
var _local7 = Math.cos(_local2) * 1;
var _local6 = Math.sin(_local2) * 1;
var _local3 = _parent.attachMovie("mineProj", "mpulse" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_local5, _y:_local4});
_local3.dirx = _local7;
_local3.diry = _local6;
_local3.power = 20;
_local3._rotation = _rotation;
}
function fireNuke() {
_root.explosion2.start();
var _local3 = _parent.attachMovie("nukeFX", "nuker" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_x, _y:_y});
}
function fireMag() {
var _local2 = (_rotation / 180) * Math.PI;
var _local5 = (_x + (20 * Math.cos(_local2))) + dirx;
var _local4 = (_y + (20 * Math.sin(_local2))) + diry;
var _local7 = Math.cos(_local2) * 12;
var _local6 = Math.sin(_local2) * 12;
var _local3 = _parent.attachMovie("magProj", "Mpulse" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_local5, _y:_local4});
_local3.dirx = _local7;
_local3.diry = _local6;
_local3.power = 10;
_local3._rotation = _rotation;
}
function fireShock() {
_root.shotB.start();
var _local4 = (_rotation / 180) * Math.PI;
var _local6 = (_x + (20 * Math.cos(_local4))) + dirx;
var _local5 = (_y + (20 * Math.sin(_local4))) + diry;
var _local8 = Math.cos(_local4) * 10;
var _local7 = Math.sin(_local4) * 10;
var _local3 = _parent.attachMovie("shockProj", "spulse" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_local6, _y:_local5});
_local3.dirx = _local8;
_local3.diry = _local7;
_local3.power = shock;
_local3._yscale = 100 + (shock * 10);
_local3._rotation = _rotation;
}
function fireTele() {
}
function firePulse() {
_root.shotC.start();
var _local3 = (_rotation / 180) * Math.PI;
var _local6 = (_x + (20 * Math.cos(_local3))) + dirx;
var _local5 = (_y + (20 * Math.sin(_local3))) + diry;
var _local8 = Math.cos(_local3) * 20;
var _local7 = Math.sin(_local3) * 20;
var _local4 = _parent.attachMovie("pulse2", "pulse" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_local6, _y:_local5});
_local4.dirx = _local8;
_local4.diry = _local7;
_local4.power = pulse;
_local4._rotation = _rotation;
}
function fireTime() {
clearInterval(fireTimer);
bFired = false;
}
function switchTime() {
clearInterval(switchTimer);
bSwitchWeapon = true;
}
function pauseTime() {
clearInterval(pauseTimer);
bSwitchpause = true;
}
function shieldTime() {
clearInterval(shieldTimer);
bShielded = false;
}
function fireShields() {
}
function fireElectro() {
for (var _local9 in _root.gameObjects) {
var _local4 = _root.gameObjects[_local9];
if (_local4 != undefined) {
var _local3 = _x - _local4._x;
if ((_local3 > -50) && (_local3 < 50)) {
var _local5 = _y - _local4._y;
var _local7 = Math.sqrt((_local3 * _local3) + (_local5 * _local5));
if (_local7 < 100) {
var _local6 = _parent.attachMovie("electroPulse", "elePulse" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_x, _y:_y});
_local6.tEnemy = _local4;
var _local8 = Math.atan2(_local5, _local3);
_local6._rotation = 180 + ((_local8 * 180) / Math.PI);
electro = electro - 0.2;
_local6._xscale = _local7;
}
}
}
}
}
function destroy() {
_alpha = 0;
_root.explosion2.start();
_parent.attachMovie("cleaner", "elePulse" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_x, _y:_y});
}
function defensiveShield() {
}
var bSetup = true;
var weaponType = 1;
var secondary = 1;
var laser = 1;
var mine = 2;
var nuke = 0;
var pulse = 1;
var shock = 1;
var mag = 0;
var bFiring = false;
var bDead = false;
var enemysHit = 0;
var bFired = false;
var bShielded = false;
var health = 10;
var shield = 10;
var defense = 10;
var electro = 10;
var currentShield = 4;
var bHasShield = false;
var shieldHealth = 5;
var rRate = 0;
var Power = 0.2;
var dirx = 0;
var diry = 0;
var fThrust = 0;
var friction = 0.95;
var radius = 10;
var bSwitchWeapon = true;
var bSwitchpause = true;
}
Symbol 339 MovieClip [__Packages.Map] Frame 0
class Map extends MovieClip
{
var createEmptyMovieClip;
function Map () {
super();
}
function onEnterFrame() {
if (radar == null) {
createEmptyMovieClip("radar", 50);
}
radar.clear();
for (var _local6 in _root.gameObjects) {
var _local5 = _root.gameObjects[_local6];
if (_local5 != undefined) {
var _local4 = _local5._x * 0.1;
var _local3 = _local5._y * 0.1;
radar.beginFill(_local5.mapColor, 100);
radar.moveTo(_local4, _local3);
radar.lineTo(_local4 + 3, _local3);
radar.lineTo(_local4 + 3, _local3 + 3);
radar.lineTo(_local4, _local3 + 3);
radar.endFill();
}
}
var _local4 = _root.gameContainer.player._x * 0.1;
var _local3 = _root.gameContainer.player._y * 0.1;
radar.beginFill(16777215, 100);
radar.moveTo(_local4, _local3);
radar.lineTo(_local4 + 3, _local3);
radar.lineTo(_local4 + 3, _local3 + 3);
radar.lineTo(_local4, _local3 + 3);
}
var radar = null;
}
Symbol 340 MovieClip [__Packages.EnemyBoss] Frame 0
class EnemyBoss extends MovieClip
{
var health, fHealth, dist_x, _x, _parent, dist_y, _y, _distance, lgtning, tPawn, colRadius, _alpha, _visible, power, angle, hc;
function EnemyBoss () {
super();
}
function onEnterFrame() {
if (!bSetup) {
_root.gameObjects.push(this);
bSetup = true;
health = 300;
fHealth = 300;
dist_x = _parent.player._x - _x;
dist_y = _parent.player._y - _y;
_distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
lgtning.gotoAndStop(1);
if (_distance < 100) {
_x = _x + 200;
_y = _y + 200;
}
tPawn = _root.gameTarget;
colRadius = radius + tPawn.radius;
buildShields();
}
if (!_root.bPaused) {
if (_alpha < 100) {
_alpha = _alpha + 2;
} else {
var colRadius = (radius + tPawn.radius);
dist_x = tPawn._x - _x;
dist_y = tPawn._y - _y;
if ((Math.abs(dist_x) > 300) || (Math.abs(dist_y) > 250)) {
_visible = false;
} else {
_visible = true;
}
if (Math.abs(dist_x) < 140) {
_distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((_distance <= colRadius) && (bReady)) {
tPawn.takeHit(power);
takeHit(10);
}
}
if (_x < 15) {
_x = 15;
}
if (_x > 1190) {
_x = 1190;
}
if (_y < 15) {
_y = 15;
}
if (_y > 1190) {
_y = 1190;
}
if (_distance < 150) {
angle = Math.atan2(dist_y, dist_x);
lgtning._rotation = (angle * 180) / Math.PI;
}
aCount++;
_x = _x + xspeed;
_y = _y + yspeed;
hc._xscale = (health / fHealth) * 100;
hc._yscale = (health / fHealth) * 100;
flockCount++;
lgtning._xscale = _distance;
for (var _local5 in shields) {
var _local3 = shields[_local5];
if ((_local3 != undefined) && (_local3._owner == this)) {
var _local4 = (aCount * 0.1) + _local3.eIndex;
_local3._x = _x + (Math.cos(_local4) * 30);
_local3._y = _y + (Math.sin(_local4) * 30);
}
}
if (flockCount >= 8) {
flockCount = 0;
_distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
angle = Math.atan2(dist_y, dist_x);
if (_distance < 200) {
xspeed = Math.cos(angle - 1.5) * 2;
yspeed = Math.sin(angle - 1.5) * 2;
lgtning.gotoAndPlay(2);
lgtning._rotation = (angle * 180) / Math.PI;
tPawn.takeHit(power * 0.2);
} else {
lgtning.gotoAndStop(1);
xspeed = Math.cos(angle) * 2;
yspeed = Math.sin(angle) * 2;
}
bReady = true;
}
}
}
}
function takeHit(amount) {
_root.HitA.start();
health = health - amount;
_root.hitFX(this);
if (health <= 0) {
destroy();
}
}
function destroy() {
for (var _local4 in _root.gameObjects) {
if (_root.gameObjects[_local4] == this) {
_root.gameObjects.splice(_local4, 1);
}
}
for (var _local4 in shields) {
var _local3 = shields[_local4];
if ((_local3 != undefined) && (_local3._owner == this)) {
_local3.destroy();
}
}
_parent.player.enemysHit = _parent.player.enemysHit + 1;
_root.playerScore = _root.playerScore + score;
_root.proxMgr.removeItem(this);
_root.deathFX(this);
_root.checkEnemys();
_root.removeMC(this);
}
function buildShields() {
var _local4 = 1;
while (_local4 < 8) {
var _local3 = _parent.attachMovie("shieldBlue", "enemy" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_x, _y:_y});
_local3.power = _root.currentLevel + 2;
_local3.health = _root.currentLevel + 4;
_local3.fHealth = _root.currentLevel + 4;
_local3._alpha = 0;
_local3._owner = this;
_local3.eIndex = _local4;
shields.push(_local3);
_local4++;
}
}
var xspeed = 0;
var yspeed = 0;
var frameCount = 0;
var flockCount = 0;
var bSetup = false;
var score = 2000;
var radius = 30;
var mapColor = 16711816;
var aCount = 0;
var shields = new Array();
var bReady = true;
}
Symbol 341 MovieClip [__Packages.ShieldBlue] Frame 0
class ShieldBlue extends MovieClip
{
var tPawn, _x, _parent, _y, _alpha, _visible, power, fHealth, health, hc, xspeed, yspeed, _rotation, _owner;
function ShieldBlue () {
super();
}
function onEnterFrame() {
if (!bSetup) {
bSetup = true;
_root.gameObjects.push(this);
tPawn = _root.gameTarget;
var _local3 = _parent.player._x - _x;
var _local4 = _parent.player._y - _y;
var _local5 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
if (_local5 < 200) {
_x = _x + 200;
_y = _y + 200;
}
}
if (!_root.bPaused) {
if (_alpha < 100) {
_alpha = _alpha + 1;
} else {
flockCount++;
if (flockCount > 5) {
bReady = true;
}
var _local3 = tPawn._x - _x;
var _local4 = tPawn._y - _y;
if ((Math.abs(_local3) > 300) || (Math.abs(_local4) > 250)) {
_visible = false;
} else {
_visible = true;
}
shotCount++;
if ((shotCount >= 50) && (_visible)) {
shotCount = 0;
fireLaser();
}
if (Math.abs(_local3) < 60) {
var _local6 = radius + tPawn.radius;
var _local5 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
if ((_local5 <= _local6) && (bReady)) {
tPawn.takeHit(power * 2);
takeHit(10);
}
}
hc._xscale = (health / fHealth) * 100;
hc._yscale = (health / fHealth) * 100;
frameCount++;
if (_x < 15) {
_x = 16;
xspeed = xspeed * -1;
}
if (_x > 1185) {
_x = 1184;
xspeed = xspeed * -1;
}
if (_y < 15) {
_y = 16;
yspeed = yspeed * -1;
}
if (_y > 1185) {
_y = 1184;
yspeed = yspeed * -1;
}
_x = _x + xspeed;
_y = _y + yspeed;
}
}
}
function takeHit(amount) {
_root.HitA.start();
health = health - amount;
_root.hitFX(this);
if (health <= 0) {
destroy();
}
}
function fireLaser() {
var _local3 = Math.atan2(_y - tPawn._y, _x - tPawn._x);
var _local5 = Math.cos(_local3) * -6;
var _local4 = Math.sin(_local3) * -6;
var _local2 = _parent.attachMovie("blueShot", "bShot" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_x, _y:_y});
_local2.dirx = _local5;
_local2.diry = _local4;
_local2.power = power;
_local2._rotation = _rotation;
}
function destroy() {
for (var _local3 in _root.gameObjects) {
if (_root.gameObjects[_local3] == this) {
_root.gameObjects.splice(_local3, 1);
}
}
for (var _local3 in _owner.shields) {
if (_owner.shields[_local3] == this) {
_owner.shields.splice(_local3, 1);
}
}
_parent.player.enemysHit = _parent.player.enemysHit + 1;
_root.playerScore = _root.playerScore + score;
_root.deathFX(this);
_root.checkEnemys();
_root.removeMC(this);
}
var bSetup = false;
var flockCount = 0;
var shotCount = 0;
var score = 100;
var radius = 14;
var mapColor = 2237183;
var frameCount = 0;
var bReady = false;
}
Symbol 342 MovieClip [__Packages.EnemyBlue] Frame 0
class EnemyBlue extends MovieClip
{
var xspeed, yspeed, tPawn, _x, _parent, _y, _alpha, _visible, power, fHealth, health, hMask, _rotation;
function EnemyBlue () {
super();
}
function onEnterFrame() {
if (!bSetup) {
bSetup = true;
xspeed = -3 + (Math.random() * 6);
yspeed = -3 + (Math.random() * 6);
_root.gameObjects.push(this);
_root.proxMgr.addItem(this);
tPawn = _root.gameTarget;
var _local3 = _parent.player._x - _x;
var _local4 = _parent.player._y - _y;
var _local5 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
if (_local5 < 200) {
_x = _x + 200;
_y = _y + 200;
}
}
if (!_root.bPaused) {
if (_alpha < 100) {
_alpha = _alpha + 1;
} else {
flockCount++;
if (flockCount > 5) {
bReady = true;
}
var _local3 = tPawn._x - _x;
var _local4 = tPawn._y - _y;
if ((Math.abs(_local3) > 300) || (Math.abs(_local4) > 250)) {
_visible = false;
} else {
_visible = true;
}
shotCount++;
if ((shotCount >= 80) && (_visible)) {
shotCount = 0;
fireLaser();
}
if (Math.abs(_local3) < 60) {
var _local6 = radius + tPawn.radius;
var _local5 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
if ((_local5 <= _local6) && (bReady)) {
tPawn.takeHit(power * 2);
takeHit(10);
}
}
hMask._yscale = (health / fHealth) * 100;
frameCount++;
if (_x < 15) {
_x = 16;
xspeed = xspeed * -1;
}
if (_x > 1185) {
_x = 1184;
xspeed = xspeed * -1;
}
if (_y < 15) {
_y = 16;
yspeed = yspeed * -1;
}
if (_y > 1185) {
_y = 1184;
yspeed = yspeed * -1;
}
_x = _x + xspeed;
_y = _y + yspeed;
}
}
}
function takeHit(amount) {
_root.HitA.start();
health = health - amount;
_root.hitFX(this);
if (health <= 0) {
destroy();
}
}
function fireLaser() {
var _local3 = Math.atan2(_y - tPawn._y, _x - tPawn._x);
var _local5 = Math.cos(_local3) * -6;
var _local4 = Math.sin(_local3) * -6;
var _local2 = _parent.attachMovie("blueShot", "bShot" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_x, _y:_y});
_local2.dirx = _local5;
_local2.diry = _local4;
_local2.power = power;
_local2._rotation = _rotation;
}
function destroy() {
for (var _local3 in _root.gameObjects) {
if (_root.gameObjects[_local3] == this) {
_root.gameObjects.splice(_local3, 1);
}
}
_parent.player.enemysHit = _parent.player.enemysHit + 1;
_root.playerScore = _root.playerScore + score;
_root.proxMgr.removeItem(this);
_root.deathFX(this);
_root.checkEnemys();
_root.removeMC(this);
}
var bSetup = false;
var flockCount = 0;
var shotCount = 0;
var score = 100;
var radius = 14;
var mapColor = 2237183;
var frameCount = 0;
var bReady = false;
}
Symbol 343 MovieClip [__Packages.EnemyGreen] Frame 0
class EnemyGreen extends MovieClip
{
var dist_x, _x, _parent, dist_y, _y, _distance, lgtning, tPawn, colRadius, _alpha, _visible, power, angle, fHealth, health, hMask;
function EnemyGreen () {
super();
}
function onEnterFrame() {
if (!bSetup) {
_root.gameObjects.push(this);
_root.proxMgr.addItem(this);
bSetup = true;
dist_x = _parent.player._x - _x;
dist_y = _parent.player._y - _y;
_distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
lgtning.gotoAndStop(1);
if (_distance < 100) {
_x = _x + 200;
_y = _y + 200;
}
tPawn = _root.gameTarget;
colRadius = radius + tPawn.radius;
}
if (!_root.bPaused) {
if (_alpha < 100) {
_alpha = _alpha + 2;
} else {
var colRadius = (radius + tPawn.radius);
dist_x = tPawn._x - _x;
dist_y = tPawn._y - _y;
if ((Math.abs(dist_x) > 300) || (Math.abs(dist_y) > 250)) {
_visible = false;
} else {
_visible = true;
}
if (Math.abs(dist_x) < 140) {
_distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((_distance <= colRadius) && (bReady)) {
tPawn.takeHit(power);
takeHit(10);
}
}
if (_x < 15) {
_x = 15;
}
if (_x > 1190) {
_x = 1190;
}
if (_y < 15) {
_y = 15;
}
if (_y > 1190) {
_y = 1190;
}
if (_distance < 150) {
angle = Math.atan2(dist_y, dist_x);
lgtning._rotation = (angle * 180) / Math.PI;
}
_x = _x + xspeed;
_y = _y + yspeed;
hMask._yscale = (health / fHealth) * 100;
flockCount++;
lgtning._xscale = _distance;
if (flockCount >= 8) {
flockCount = 0;
_distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
angle = Math.atan2(dist_y, dist_x);
if (_distance < 100) {
xspeed = Math.cos(angle + 1.3) * 2;
yspeed = Math.sin(angle + 1.3) * 2;
lgtning.gotoAndPlay(2);
lgtning._rotation = (angle * 180) / Math.PI;
tPawn.takeHit(power * 0.2);
} else {
lgtning.gotoAndStop(1);
xspeed = Math.cos(angle) * 2;
yspeed = Math.sin(angle) * 2;
}
bReady = true;
var _local11 = _root.proxMgr.getNeighbours(this);
var _local10 = _local11.length;
while (_local10--) {
var _local3 = _local11[_local10];
if ((_local3 != undefined) && (_local3 != this)) {
var _local5 = _x - _local3._x;
var _local4 = _y - _local3._y;
var _local8 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local8 < 50) {
var _local6 = Math.atan2(_local4, _local5);
var _local9 = Math.cos(_local6);
var _local7 = Math.sin(_local6);
_local3._x = _local3._x - (_local9 * 0.7);
_local3._y = _local3._y - (_local7 * 0.7);
}
}
}
}
}
}
}
function takeHit(amount) {
_root.HitA.start();
health = health - amount;
_root.hitFX(this);
if (health <= 0) {
destroy();
}
}
function destroy() {
for (var _local3 in _root.gameObjects) {
if (_root.gameObjects[_local3] == this) {
_root.gameObjects.splice(_local3, 1);
}
}
_parent.player.enemysHit = _parent.player.enemysHit + 1;
_root.playerScore = _root.playerScore + score;
_root.proxMgr.removeItem(this);
_root.deathFX(this);
_root.checkEnemys();
_root.removeMC(this);
}
var xspeed = 0;
var yspeed = 0;
var frameCount = 0;
var flockCount = 0;
var bSetup = false;
var score = 200;
var radius = 14;
var mapColor = 2293538;
var bReady = true;
}
Symbol 344 MovieClip [__Packages.EnemyRed] Frame 0
class EnemyRed extends MovieClip
{
var dist_x, _x, _parent, dist_y, _y, distance, tPawn, colRadius, _alpha, _visible, power, fHealth, health, hMask, angle;
function EnemyRed () {
super();
}
function onEnterFrame() {
if (!bSetup) {
frameCount = 0;
flockCount = 0;
_root.gameObjects.push(this);
_root.proxMgr.addItem(this);
bSetup = true;
enumAI();
dist_x = _parent.player._x - _x;
dist_y = _parent.player._y - _y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 100) {
_x = _x + 200;
_y = _y + 200;
}
tPawn = _root.gameTarget;
colRadius = radius + tPawn.radius;
}
if (!_root.bPaused) {
if (_alpha < 100) {
_alpha = _alpha + 2;
} else {
dist_x = tPawn._x - _x;
dist_y = tPawn._y - _y;
if ((Math.abs(dist_x) > 300) || (Math.abs(dist_y) > 250)) {
_visible = false;
} else {
_visible = true;
}
if (Math.abs(dist_x) < 60) {
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance <= colRadius) && (bReady)) {
tPawn.takeHit(power);
takeHit(10);
}
}
shotCount++;
if ((shotCount >= 100) && (_visible)) {
shotCount = 0;
enumAI();
fireLaser();
}
if (_x < 15) {
_x = 15;
enumAI();
}
if (_x > 1190) {
_x = 1190;
enumAI();
}
if (_y < 15) {
_y = 15;
enumAI();
}
if (_y > 1190) {
_y = 1190;
enumAI();
}
_x = _x + xspeed;
_y = _y + yspeed;
hMask._yscale = (health / fHealth) * 100;
flockCount++;
}
if (flockCount >= 10) {
bReady = true;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 200) {
angle = angle + 0.08;
}
xspeed = Math.cos(angle) * 2.3;
yspeed = Math.sin(angle) * 2.3;
flockCount = 0;
var _local11 = _root.proxMgr.getNeighbours(this);
var _local10 = _local11.length;
while (_local10--) {
var _local3 = _local11[_local10];
if ((_local3 != undefined) && (_local3 != this)) {
var _local5 = _x - _local3._x;
var _local4 = _y - _local3._y;
var _local8 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local8 < 50) {
var _local6 = Math.atan2(_local4, _local5);
var _local9 = Math.cos(_local6);
var _local7 = Math.sin(_local6);
_local3._x = _local3._x - (_local9 * 0.7);
_local3._y = _local3._y - (_local7 * 0.7);
}
}
}
}
}
}
function takeHit(amount) {
_root.HitA.start();
health = health - amount;
_root.hitFX(this);
if (health <= 0) {
destroy();
}
}
function destroy() {
for (var _local3 in _root.gameObjects) {
if (_root.gameObjects[_local3] == this) {
_root.gameObjects.splice(_local3, 1);
}
}
_parent.player.enemysHit = _parent.player.enemysHit + 1;
_root.proxMgr.removeItem(this);
_root.playerScore = _root.playerScore + score;
_root.deathFX(this);
_root.checkEnemys();
_root.removeMC(this);
}
function enumAI() {
var _local2 = Math.random() * 5;
if (_local2 > 4) {
var _local4 = 2.48643987308266;
var _local3 = -3.13330763850993;
} else if (_local2 > 3) {
var _local4 = -2.01938441839943;
var _local3 = -3.45283746659549;
} else if (_local2 > 2) {
var _local4 = -3.61628856806824;
var _local3 = 1.70951952093532;
} else if (_local2 > 1) {
var _local4 = 3.82134595650242;
var _local3 = 1.18208082664536;
} else {
var _local4 = 0.282948806670812;
var _local3 = 3.98997994641622;
}
angle = Math.atan2(_local3, _local4);
xspeed = Math.cos(angle) * 2.3;
yspeed = Math.sin(angle) * 2.3;
}
function fireLaser() {
var _local2 = Math.atan2(tPawn._y - _y, tPawn._x - _x);
if ((_local2 < -0.3) && (_local2 > -1.5)) {
var _local5 = 2.48643987308266;
var _local4 = -3.13330763850993;
} else if ((_local2 < -1.5) && (_local2 > -3)) {
var _local5 = -2.01938441839943;
var _local4 = -3.45283746659549;
} else if ((_local2 < 3) && (_local2 > 2.1)) {
var _local5 = -3.61628856806824;
var _local4 = 1.70951952093532;
} else if ((_local2 < 0.9) && (_local2 > -0.3)) {
var _local5 = 3.82134595650242;
var _local4 = 1.18208082664536;
} else {
var _local5 = 0.282948806670812;
var _local4 = 3.98997994641622;
}
var _local3 = _parent.attachMovie("phaseBeam", "bShot" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_x, _y:_y});
_local3.dirx = _local5;
_local3.diry = _local4;
_local3.power = power;
_local3._rotation = (Math.atan2(_local4, _local5) * 180) / Math.PI;
}
var xspeed = 0;
var yspeed = 0;
var frameCount = 0;
var flockCount = 0;
var bSetup = false;
var score = 150;
var radius = 10;
var mapColor = 16720418;
var bReady = true;
var shotCount = 0;
}
Symbol 345 MovieClip [__Packages.EnemyYellow] Frame 0
class EnemyYellow extends MovieClip
{
var dist_x, _x, _parent, dist_y, _y, distance, tPawn, colRadius, _alpha, _visible, power, fHealth, health, hMask, angle, _rotation;
function EnemyYellow () {
super();
}
function onEnterFrame() {
if (!bSetup) {
_root.gameObjects.push(this);
_root.proxMgr.addItem(this);
bSetup = true;
dist_x = _parent.player._x - _x;
dist_y = _parent.player._y - _y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 100) {
_x = _x + 200;
_y = _y + 200;
}
tPawn = _root.gameTarget;
colRadius = radius + tPawn.radius;
}
if (!_root.bPaused) {
if (_alpha < 100) {
_alpha = _alpha + 2;
} else {
dist_x = tPawn._x - _x;
dist_y = tPawn._y - _y;
if ((Math.abs(dist_x) > 300) || (Math.abs(dist_y) > 250)) {
_visible = false;
} else {
_visible = true;
}
if (Math.abs(dist_x) < 60) {
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance <= colRadius) && (bReady)) {
tPawn.takeHit(power);
takeHit(10);
}
}
if (_x < 15) {
_x = 15;
}
if (_x > 1190) {
_x = 1190;
}
if (_y < 15) {
_y = 15;
}
if (_y > 1190) {
_y = 1190;
}
_x = _x + xspeed;
_y = _y + yspeed;
hMask._yscale = (health / fHealth) * 100;
flockCount++;
if (flockCount >= 6) {
shotCount++;
angle = Math.atan2(dist_y, dist_x);
_rotation = (angle * 180) / Math.PI;
if (distance > 200) {
xspeed = Math.cos(angle) * 1;
yspeed = Math.sin(angle) * 1;
} else {
xspeed = Math.cos(angle) * 0.5;
yspeed = Math.sin(angle) * 0.5;
}
bReady = true;
flockCount = 0;
if ((shotCount >= 10) && (_visible)) {
shotCount = 0;
fireLaser();
}
var _local11 = _root.proxMgr.getNeighbours(this);
var _local10 = _local11.length;
while (_local10--) {
var _local3 = _local11[_local10];
if ((_local3 != undefined) && (_local3 != this)) {
var _local5 = _x - _local3._x;
var _local4 = _y - _local3._y;
var _local8 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local8 < 50) {
var _local6 = Math.atan2(_local4, _local5);
var _local9 = Math.cos(_local6);
var _local7 = Math.sin(_local6);
_local3._x = _local3._x - (_local9 * 0.7);
_local3._y = _local3._y - (_local7 * 0.7);
}
}
}
}
}
}
}
function takeHit(amount) {
_root.HitA.start();
health = health - amount;
_root.hitFX(this);
if (health <= 0) {
destroy();
}
}
function fireLaser() {
var _local3 = (_rotation / 180) * Math.PI;
var _local5 = Math.cos(_local3) * 5;
var _local4 = Math.sin(_local3) * 5;
var _local2 = _parent.attachMovie("Epusle", "Epulse" + _parent.getNextHighestDepth(), _parent.getNextHighestDepth(), {_x:_x, _y:_y});
_local2.dirx = _local5;
_local2.diry = _local4;
_local2.power = power;
_local2._rotation = _rotation;
}
function destroy() {
for (var _local3 in _root.gameObjects) {
if (_root.gameObjects[_local3] == this) {
_root.gameObjects.splice(_local3, 1);
}
}
_root.proxMgr.removeItem(this);
_parent.player.enemysHit = _parent.player.enemysHit + 1;
_root.playerScore = _root.playerScore + score;
_root.deathFX(this);
_root.checkEnemys();
_root.removeMC(this);
}
var xspeed = 0;
var yspeed = 0;
var frameCount = 0;
var flockCount = 0;
var shotCount = 0;
var bSetup = false;
var score = 175;
var radius = 10;
var mapColor = 16776994;
var bReady = true;
}
Symbol 346 MovieClip [__Packages.ElectroPickup] Frame 0
class ElectroPickup extends MovieClip
{
var hitTest, _parent, _x, xspeed, _y, yspeed;
function ElectroPickup () {
super();
}
function onEnterFrame() {
if (hitTest(_parent.player) && (!collected)) {
collected = true;
_parent.player.electro = _parent.player.electro + 1;
_root.collectFX(this);
_root.removeMC(this);
}
if (_x < 15) {
_x = 16;
xspeed = xspeed * -1;
}
if (_x > 1185) {
_x = 1184;
xspeed = xspeed * -1;
}
if (_y < 15) {
_y = 16;
yspeed = yspeed * -1;
}
if (_y > 1185) {
_y = 1184;
yspeed = yspeed * -1;
}
_x = _x + xspeed;
_y = _y + yspeed;
}
var collected = false;
}
Symbol 347 MovieClip [__Packages.DefensePickup] Frame 0
class DefensePickup extends MovieClip
{
var hitTest, _parent, _x, xspeed, _y, yspeed;
function DefensePickup () {
super();
}
function onEnterFrame() {
if (hitTest(_parent.player) && (!collected)) {
collected = true;
_parent.player.defense = _parent.player.defense + 1;
_root.collectFX(this);
_root.removeMC(this);
}
if (_x < 15) {
_x = 16;
xspeed = xspeed * -1;
}
if (_x > 1185) {
_x = 1184;
xspeed = xspeed * -1;
}
if (_y < 15) {
_y = 16;
yspeed = yspeed * -1;
}
if (_y > 1185) {
_y = 1184;
yspeed = yspeed * -1;
}
_x = _x + xspeed;
_y = _y + yspeed;
}
var collected = false;
}
Symbol 348 MovieClip [__Packages.HullPickup] Frame 0
class HullPickup extends MovieClip
{
var hitTest, _parent, _x, xspeed, _y, yspeed;
function HullPickup () {
super();
}
function onEnterFrame() {
if (hitTest(_parent.player) && (!collected)) {
collected = true;
_parent.player.shieldHealth = 10;
_root.collectFX(this);
_root.removeMC(this);
}
if (_x < 15) {
_x = 16;
xspeed = xspeed * -1;
}
if (_x > 1185) {
_x = 1184;
xspeed = xspeed * -1;
}
if (_y < 15) {
_y = 16;
yspeed = yspeed * -1;
}
if (_y > 1185) {
_y = 1184;
yspeed = yspeed * -1;
}
_x = _x + xspeed;
_y = _y + yspeed;
}
var collected = false;
}
Symbol 349 MovieClip [__Packages.ShieldPickup] Frame 0
class ShieldPickup extends MovieClip
{
var hitTest, _parent, _x, xspeed, _y, yspeed;
function ShieldPickup () {
super();
}
function onEnterFrame() {
if (hitTest(_parent.player) && (!collected)) {
collected = true;
_root.collected.start();
_parent.player.shield = _parent.player.shield + 1;
_root.collectFX(this);
_root.removeMC(this);
}
if (_x < 15) {
_x = 16;
xspeed = xspeed * -1;
}
if (_x > 1185) {
_x = 1184;
xspeed = xspeed * -1;
}
if (_y < 15) {
_y = 16;
yspeed = yspeed * -1;
}
if (_y > 1185) {
_y = 1184;
yspeed = yspeed * -1;
}
_x = _x + xspeed;
_y = _y + yspeed;
}
var collected = false;
}
Symbol 350 MovieClip [__Packages.BlueShot] Frame 0
class BlueShot extends MovieClip
{
var _x, dirx, _y, diry, _parent, power;
function BlueShot () {
super();
}
function onEnterFrame() {
if (!bSetup) {
bSetup = true;
_root.gameObjects.push(this);
}
if (!_root.bPaused) {
_x = _x + dirx;
_y = _y + diry;
if ((((_x < 10) || (_x > 1190)) || (_y < 10)) || (_y > 1190)) {
destroy();
}
var _local4 = _parent.player;
var _local3 = _x - _local4._x;
if ((_local3 > -50) && (_local3 < 50)) {
var _local5 = _y - _local4._y;
var _local6 = Math.sqrt((_local3 * _local3) + (_local5 * _local5));
if (_local6 < 15) {
_local4.takeHit(power);
destroy();
}
}
}
}
function takeHit(amount) {
destroy();
}
function destroy() {
for (var _local3 in _root.gameObjects) {
if (_root.gameObjects[_local3] == this) {
_root.gameObjects.splice(_local3, 1);
}
}
_root.hitFX(this);
_root.checkEnemys();
_root.removeMC(this);
}
var bSetup = false;
var mapColor = 0;
}
Symbol 351 MovieClip [__Packages.PhaseBeam] Frame 0
class PhaseBeam extends MovieClip
{
var _x, dirx, _y, diry, _alpha, _parent, hitTest, power;
function PhaseBeam () {
super();
}
function onEnterFrame() {
if (!bSetup) {
bSetup = true;
_root.gameObjects.push(this);
}
_x = _x + dirx;
_y = _y + diry;
_alpha = _alpha * 0.98;
if ((((_x < 10) || (_x > 1190)) || (_y < 10)) || (_y > 1190)) {
destroy();
}
if (_alpha < 15) {
fade();
}
var _local3 = _parent.player;
if (hitTest(_local3)) {
_local3.takeHit(power);
destroy();
}
}
function takeHit(amount) {
destroy();
}
function destroy() {
for (var _local3 in _root.gameObjects) {
if (_root.gameObjects[_local3] == this) {
_root.gameObjects.splice(_local3, 1);
}
}
_root.hitFX(this);
_root.checkEnemys();
_root.removeMC(this);
}
function fade() {
for (var _local3 in _root.gameObjects) {
if (_root.gameObjects[_local3] == this) {
_root.gameObjects.splice(_local3, 1);
}
}
_root.removeMC(this);
}
var bSetup = false;
var mapColor = 0;
}
Symbol 352 MovieClip [__Packages.Beam] Frame 0
class Beam extends MovieClip
{
var trail, power, _x, dirx, _y, diry, enemy, hitTest;
function Beam () {
super();
}
function onEnterFrame() {
if (!bSetup) {
bSetup = true;
trail = _root.trailFX(this);
trail._yscale = 100 + (power * 10);
}
if (!_root.bPaused) {
fCount++;
_x = _x + dirx;
_y = _y + diry;
trail._xscale = trail._xscale + 95;
if (((((_x < 0) || (_x > 1200)) || (_y < 0)) || (_y > 1200)) || (fCount > 20)) {
destroy();
}
for (var _local3 in _root.gameObjects) {
enemy = _root.gameObjects[_local3];
if (enemy != undefined) {
if (hitTest(enemy)) {
enemy.takeHit(power);
}
}
}
}
}
function destroy() {
_root.hitFX(this);
_root.removeMC(this);
}
var bSetup = false;
var fCount = 0;
}
Symbol 353 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.5");
}
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 () {
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (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) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
}, 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;
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) {
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (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) {
showPreGameAd(options);
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
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 _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_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);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
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") {
}
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);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
}
}
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);
}
}
Symbol 354 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 355 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _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("1.31");
}
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";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.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 _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
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.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.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];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._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 (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:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 356 MovieClip [__Packages.ProximityManager] Frame 0
class ProximityManager
{
var mcs, pos;
function ProximityManager () {
mcs = [];
pos = [];
}
function getNeighbours(p_mc) {
var _local5 = Math.ceil(p_mc._x / gridSize);
var _local4 = Math.ceil(p_mc._y / gridSize);
var _local3 = pos;
var _local2 = _local3[_local5][_local4];
if (_local3[_local5 - 1][_local4 - 1]) {
_local2 = _local2.concat(_local3[_local5 - 1][_local4 - 1]);
}
if (_local3[_local5][_local4 - 1]) {
_local2 = _local2.concat(_local3[_local5][_local4 - 1]);
}
if (_local3[_local5 + 1][_local4 - 1]) {
_local2 = _local2.concat(_local3[_local5 + 1][_local4 - 1]);
}
if (_local3[_local5 - 1][_local4]) {
_local2 = _local2.concat(_local3[_local5 - 1][_local4]);
}
if (_local3[_local5 + 1][_local4]) {
_local2 = _local2.concat(_local3[_local5 + 1][_local4]);
}
if (_local3[_local5 - 1][_local4 + 1]) {
_local2 = _local2.concat(_local3[_local5 - 1][_local4 + 1]);
}
if (_local3[_local5][_local4 + 1]) {
_local2 = _local2.concat(_local3[_local5][_local4 + 1]);
}
if (_local3[_local5 + 1][_local4 + 1]) {
_local2 = _local2.concat(_local3[_local5 + 1][_local4 + 1]);
}
return(_local2);
}
function addItem(p_mc) {
mcs.push(p_mc);
}
function removeItem(p_mc) {
var _local2 = mcs.length;
while (_local2--) {
if (mcs[_local2] == p_mc) {
mcs.splice(_local2, 1);
return(undefined);
}
}
}
function refresh() {
var _local7 = mcs;
var _local4 = [];
var _local6 = _local7.length;
while (_local6--) {
var _local3 = mcs[_local6];
var _local2 = Math.ceil(_local3._x / gridSize);
var _local5 = Math.ceil(_local3._y / gridSize);
if (!_local4[_local2]) {
_local4[_local2] = [];
}
if (!_local4[_local2][_local5]) {
_local4[_local2][_local5] = [_local3];
continue;
}
_local4[_local2][_local5].push(_local3);
}
pos = _local4;
}
var gridSize = 25;
}
Symbol 259 MovieClip [__Packages.mx.core.UIObject] Frame 0
class mx.core.UIObject extends MovieClip
{
var _width, _height, _x, _y, _parent, _minHeight, _minWidth, _visible, dispatchEvent, _xscale, _yscale, methodTable, onEnterFrame, tfList, __width, __height, moveTo, lineTo, createTextField, attachMovie, buildDepthTable, findNextAvailableDepth, idNames, childrenCreated, _name, createAccessibilityImplementation, _endInit, validateNow, hasOwnProperty, initProperties, stylecache, className, ignoreClassStyleDeclaration, _tf, fontFamily, fontSize, color, marginLeft, marginRight, fontStyle, fontWeight, textAlign, textIndent, textDecoration, embedFonts, styleName, enabled;
function UIObject () {
super();
constructObject();
}
function get width() {
return(_width);
}
function get height() {
return(_height);
}
function get left() {
return(_x);
}
function get x() {
return(_x);
}
function get top() {
return(_y);
}
function get y() {
return(_y);
}
function get right() {
return(_parent.width - (_x + width));
}
function get bottom() {
return(_parent.height - (_y + height));
}
function getMinHeight(Void) {
return(_minHeight);
}
function setMinHeight(h) {
_minHeight = h;
}
function get minHeight() {
return(getMinHeight());
}
function set minHeight(h) {
setMinHeight(h);
//return(minHeight);
}
function getMinWidth(Void) {
return(_minWidth);
}
function setMinWidth(w) {
_minWidth = w;
}
function get minWidth() {
return(getMinWidth());
}
function set minWidth(w) {
setMinWidth(w);
//return(minWidth);
}
function setVisible(x, noEvent) {
if (x != _visible) {
_visible = x;
if (noEvent != true) {
dispatchEvent({type:(x ? "reveal" : "hide")});
}
}
}
function get visible() {
return(_visible);
}
function set visible(x) {
setVisible(x, false);
//return(visible);
}
function get scaleX() {
return(_xscale);
}
function set scaleX(x) {
_xscale = x;
//return(scaleX);
}
function get scaleY() {
return(_yscale);
}
function set scaleY(y) {
_yscale = y;
//return(scaleY);
}
function doLater(obj, fn) {
if (methodTable == undefined) {
methodTable = new Array();
}
methodTable.push({obj:obj, fn:fn});
onEnterFrame = doLaterDispatcher;
}
function doLaterDispatcher(Void) {
delete onEnterFrame;
if (invalidateFlag) {
redraw();
}
var _local3 = methodTable;
methodTable = new Array();
if (_local3.length > 0) {
var _local2;
while (_local2 = _local3.shift() , _local2 != undefined) {
_local2.obj[_local2.fn]();
}
}
}
function cancelAllDoLaters(Void) {
delete onEnterFrame;
methodTable = new Array();
}
function invalidate(Void) {
invalidateFlag = true;
onEnterFrame = doLaterDispatcher;
}
function invalidateStyle(Void) {
invalidate();
}
function redraw(bAlways) {
if (invalidateFlag || (bAlways)) {
invalidateFlag = false;
var _local2;
for (_local2 in tfList) {
tfList[_local2].draw();
}
draw();
dispatchEvent({type:"draw"});
}
}
function draw(Void) {
}
function move(x, y, noEvent) {
var _local3 = _x;
var _local2 = _y;
_x = x;
_y = y;
if (noEvent != true) {
dispatchEvent({type:"move", oldX:_local3, oldY:_local2});
}
}
function setSize(w, h, noEvent) {
var _local3 = __width;
var _local2 = __height;
__width = w;
__height = h;
size();
if (noEvent != true) {
dispatchEvent({type:"resize", oldWidth:_local3, oldHeight:_local2});
}
}
function size(Void) {
_width = __width;
_height = __height;
}
function drawRect(x1, y1, x2, y2) {
moveTo(x1, y1);
lineTo(x2, y1);
lineTo(x2, y2);
lineTo(x1, y2);
lineTo(x1, y1);
}
function createLabel(name, depth, text) {
createTextField(name, depth, 0, 0, 0, 0);
var _local2 = this[name];
_local2._color = textColorList;
_local2._visible = false;
_local2.__text = text;
if (tfList == undefined) {
tfList = new Object();
}
tfList[name] = _local2;
_local2.invalidateStyle();
invalidate();
_local2.styleName = this;
return(_local2);
}
function createObject(linkageName, id, depth, initobj) {
return(attachMovie(linkageName, id, depth, initobj));
}
function createClassObject(className, id, depth, initobj) {
var _local3 = className.symbolName == undefined;
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className);
}
var _local4 = mx.core.UIObject(createObject(className.symbolOwner.symbolName, id, depth, initobj));
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className.symbolOwner);
}
return(_local4);
}
function createEmptyObject(id, depth) {
return(createClassObject(mx.core.UIObject, id, depth));
}
function destroyObject(id) {
var _local2 = this[id];
if (_local2.getDepth() < 0) {
var _local4 = buildDepthTable();
var _local5 = findNextAvailableDepth(0, _local4, "up");
var _local3 = _local5;
_local2.swapDepths(_local3);
}
_local2.removeMovieClip();
delete this[id];
}
function getSkinIDName(tag) {
return(idNames[tag]);
}
function setSkin(tag, linkageName, initObj) {
if (_global.skinRegistry[linkageName] == undefined) {
mx.skins.SkinElement.registerElement(linkageName, mx.skins.SkinElement);
}
return(createObject(linkageName, getSkinIDName(tag), tag, initObj));
}
function createSkin(tag) {
var _local2 = getSkinIDName(tag);
createEmptyObject(_local2, tag);
return(this[_local2]);
}
function createChildren(Void) {
}
function _createChildren(Void) {
createChildren();
childrenCreated = true;
}
function constructObject(Void) {
if (_name == undefined) {
return(undefined);
}
init();
_createChildren();
createAccessibilityImplementation();
_endInit();
if (validateNow) {
redraw(true);
} else {
invalidate();
}
}
function initFromClipParameters(Void) {
var _local4 = false;
var _local2;
for (_local2 in clipParameters) {
if (hasOwnProperty(_local2)) {
_local4 = true;
this["def_" + _local2] = this[_local2];
delete this[_local2];
}
}
if (_local4) {
for (_local2 in clipParameters) {
var _local3 = this["def_" + _local2];
if (_local3 != undefined) {
this[_local2] = _local3;
}
}
}
}
function init(Void) {
__width = _width;
__height = _height;
if (initProperties == undefined) {
initFromClipParameters();
} else {
initProperties();
}
if (_global.cascadingStyles == true) {
stylecache = new Object();
}
}
function getClassStyleDeclaration(Void) {
var _local4 = this;
var _local3 = className;
while (_local3 != undefined) {
if (ignoreClassStyleDeclaration[_local3] == undefined) {
if (_global.styles[_local3] != undefined) {
return(_global.styles[_local3]);
}
}
_local4 = _local4.__proto__;
_local3 = _local4.className;
}
}
function setColor(color) {
}
function __getTextFormat(tf, bAll) {
var _local8 = stylecache.tf;
if (_local8 != undefined) {
var _local3;
for (_local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
tf[_local3] = _local8[_local3];
}
}
}
return(false);
}
var _local6 = false;
for (var _local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
var _local5 = _tf[_local3];
if (_local5 != undefined) {
tf[_local3] = _local5;
} else if ((_local3 == "font") && (fontFamily != undefined)) {
tf[_local3] = fontFamily;
} else if ((_local3 == "size") && (fontSize != undefined)) {
tf[_local3] = fontSize;
} else if ((_local3 == "color") && (color != undefined)) {
tf[_local3] = color;
} else if ((_local3 == "leftMargin") && (marginLeft != undefined)) {
tf[_local3] = marginLeft;
} else if ((_local3 == "rightMargin") && (marginRight != undefined)) {
tf[_local3] = marginRight;
} else if ((_local3 == "italic") && (fontStyle != undefined)) {
tf[_local3] = fontStyle == _local3;
} else if ((_local3 == "bold") && (fontWeight != undefined)) {
tf[_local3] = fontWeight == _local3;
} else if ((_local3 == "align") && (textAlign != undefined)) {
tf[_local3] = textAlign;
} else if ((_local3 == "indent") && (textIndent != undefined)) {
tf[_local3] = textIndent;
} else if ((_local3 == "underline") && (textDecoration != undefined)) {
tf[_local3] = textDecoration == _local3;
} else if ((_local3 == "embedFonts") && (embedFonts != undefined)) {
tf[_local3] = embedFonts;
} else {
_local6 = true;
}
}
}
}
if (_local6) {
var _local9 = styleName;
if (_local9 != undefined) {
if (typeof(_local9) != "string") {
_local6 = _local9.__getTextFormat(tf, true, this);
} else if (_global.styles[_local9] != undefined) {
_local6 = _global.styles[_local9].__getTextFormat(tf, true, this);
}
}
}
if (_local6) {
var _local10 = getClassStyleDeclaration();
if (_local10 != undefined) {
_local6 = _local10.__getTextFormat(tf, true, this);
}
}
if (_local6) {
if (_global.cascadingStyles) {
if (_parent != undefined) {
_local6 = _parent.__getTextFormat(tf, false);
}
}
}
if (_local6) {
_local6 = _global.style.__getTextFormat(tf, true, this);
}
return(_local6);
}
function _getTextFormat(Void) {
var _local2 = stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
__getTextFormat(_local2, true);
stylecache.tf = _local2;
if (enabled == false) {
var _local3 = getStyle("disabledColor");
_local2.color = _local3;
}
return(_local2);
}
function getStyleName(Void) {
var _local2 = styleName;
if (_local2 != undefined) {
if (typeof(_local2) != "string") {
return(_local2.getStyleName());
}
return(_local2);
}
if (_parent != undefined) {
return(_parent.getStyleName());
}
return(undefined);
}
function getStyle(styleProp) {
var _local3;
_global.getStyleCounter++;
if (this[styleProp] != undefined) {
return(this[styleProp]);
}
var _local6 = styleName;
if (_local6 != undefined) {
if (typeof(_local6) != "string") {
_local3 = _local6.getStyle(styleProp);
} else {
var _local7 = _global.styles[_local6];
_local3 = _local7.getStyle(styleProp);
}
}
if (_local3 != undefined) {
return(_local3);
}
var _local7 = getClassStyleDeclaration();
if (_local7 != undefined) {
_local3 = _local7[styleProp];
}
if (_local3 != undefined) {
return(_local3);
}
if (_global.cascadingStyles) {
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (mx.styles.StyleManager.isColorStyle(styleProp))) {
var _local5 = stylecache;
if (_local5 != undefined) {
if (_local5[styleProp] != undefined) {
return(_local5[styleProp]);
}
}
if (_parent != undefined) {
_local3 = _parent.getStyle(styleProp);
} else {
_local3 = _global.style[styleProp];
}
if (_local5 != undefined) {
_local5[styleProp] = _local3;
}
return(_local3);
}
}
if (_local3 == undefined) {
_local3 = _global.style[styleProp];
}
return(_local3);
}
static function mergeClipParameters(o, p) {
for (var _local3 in p) {
o[_local3] = p[_local3];
}
return(true);
}
static var symbolName = "UIObject";
static var symbolOwner = mx.core.UIObject;
static var version = "2.0.2.127";
static var textColorList = {color:1, disabledColor:1};
var invalidateFlag = false;
var lineWidth = 1;
var lineColor = 0;
var tabEnabled = false;
var clipParameters = {visible:1, minHeight:1, minWidth:1, maxHeight:1, maxWidth:1, preferredHeight:1, preferredWidth:1};
}
Symbol 260 MovieClip [__Packages.mx.core.UIComponent] Frame 0
class mx.core.UIComponent extends mx.core.UIObject
{
var __width, __height, invalidate, stylecache, removeEventListener, dispatchEvent, drawFocus, addEventListener, _xscale, _yscale, _focusrect, watch, enabled;
function UIComponent () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function setVisible(x, noEvent) {
super.setVisible(x, noEvent);
}
function enabledChanged(id, oldValue, newValue) {
setEnabled(newValue);
invalidate();
delete stylecache.tf;
return(newValue);
}
function setEnabled(enabled) {
invalidate();
}
function getFocus() {
var selFocus = Selection.getFocus();
return(((selFocus === null) ? null : (eval (selFocus))));
}
function setFocus() {
Selection.setFocus(this);
}
function getFocusManager() {
var _local2 = this;
while (_local2 != undefined) {
if (_local2.focusManager != undefined) {
return(_local2.focusManager);
}
_local2 = _local2._parent;
}
return(undefined);
}
function onKillFocus(newFocus) {
removeEventListener("keyDown", this);
removeEventListener("keyUp", this);
dispatchEvent({type:"focusOut"});
drawFocus(false);
}
function onSetFocus(oldFocus) {
addEventListener("keyDown", this);
addEventListener("keyUp", this);
dispatchEvent({type:"focusIn"});
if (getFocusManager().bDrawFocus != false) {
drawFocus(true);
}
}
function findFocusInChildren(o) {
if (o.focusTextField != undefined) {
return(o.focusTextField);
}
if (o.tabEnabled == true) {
return(o);
}
return(undefined);
}
function findFocusFromObject(o) {
if (o.tabEnabled != true) {
if (o._parent == undefined) {
return(undefined);
}
if (o._parent.tabEnabled == true) {
o = o._parent;
} else if (o._parent.tabChildren) {
o = findFocusInChildren(o._parent);
} else {
o = findFocusFromObject(o._parent);
}
}
return(o);
}
function pressFocus() {
var _local3 = findFocusFromObject(this);
var _local2 = getFocus();
if (_local3 != _local2) {
_local2.drawFocus(false);
if (getFocusManager().bDrawFocus != false) {
_local3.drawFocus(true);
}
}
}
function releaseFocus() {
var _local2 = findFocusFromObject(this);
if (_local2 != getFocus()) {
_local2.setFocus();
}
}
function isParent(o) {
while (o != undefined) {
if (o == this) {
return(true);
}
o = o._parent;
}
return(false);
}
function size() {
}
function init() {
super.init();
_xscale = 100;
_yscale = 100;
_focusrect = _global.useFocusRect == false;
watch("enabled", enabledChanged);
if (enabled == false) {
setEnabled(false);
}
}
function dispatchValueChangedEvent(value) {
dispatchEvent({type:"valueChanged", value:value});
}
static var symbolName = "UIComponent";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.127";
static var kStretch = 5000;
var focusEnabled = true;
var tabEnabled = true;
var origBorderStyles = {themeColor:16711680};
var clipParameters = {};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters, mx.core.UIObject.prototype.clipParameters);
}
Symbol 261 MovieClip [__Packages.HiScores] Frame 0
class HiScores extends mx.core.UIComponent
{
var _visible, g5User, g5UserExists, gameId, levelId, gameCode, lowIsBest, score, msg1, msg2, movEntryScreen, movAutoEntryScreen, movInfoScreen, invalidate, getURL;
function HiScores () {
super();
_visible = false;
}
function setDetails(gameId, levelId, gameCode, lowIsBest, score, msg1, msg2) {
g5User = flash.external.ExternalInterface.call("getG5User");
g5UserExists = ((g5User == null) ? false : (!isNaN(g5User[0])));
this.gameId = gameId;
this.levelId = levelId;
this.gameCode = gameCode;
this.lowIsBest = lowIsBest;
this.score = score;
this.msg1 = msg1;
this.msg2 = msg2;
entryScreen = movEntryScreen;
autoEntryScreen = movAutoEntryScreen;
infoScreen = movInfoScreen;
entryScreen._visible = false;
autoEntryScreen._visible = false;
infoScreen._visible = false;
if (g5UserExists) {
showAutoEntryScreen();
} else {
showEntryScreen();
}
_visible = true;
}
function createChildren() {
size();
}
function size() {
super.size();
invalidate();
}
function secCodeLoad() {
var _local2 = new MovieClipLoader();
_local2.loadClip((HS_SERVLET_URL + "?type=genCode&cachebuster=") + new Date().getTime(), entryScreen.movCode);
}
function back() {
entryScreen._visible = true;
infoScreen._visible = false;
}
function viewScore() {
if (g5UserExists) {
getURL((((((((HI_SCORE_URL + gameCode) + "_hs") + "&userId=") + g5User[0]) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime(), "_blank");
} else {
getURL((((((((HI_SCORE_URL + gameCode) + "_hs") + "&name=") + entryScreen.txtName.text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime(), "_blank");
}
}
function showEntryScreen() {
entryScreen.txtMsg1.text = msg1;
entryScreen.txtMsg2.text = msg2;
entryScreen.txtName.text = "";
entryScreen.txtCode.text = "";
entryScreen._visible = true;
secCodeLoad();
}
function showAutoEntryScreen() {
autoEntryScreen.txtMsg1.text = msg1;
autoEntryScreen.txtMsg2.text = msg2;
autoEntryScreen.txtName.text = g5User[1];
autoEntryScreen._visible = true;
}
function showInfoMessage(msg, error) {
infoScreen.txtInfo.text = msg;
infoScreen.btnBack._visible = error;
infoScreen.btnView._visible = !error;
}
function submitScore() {
entryScreen._visible = false;
autoEntryScreen._visible = false;
infoScreen._visible = true;
var _local8 = true;
if ((!g5UserExists) && (entryScreen.txtName.text.length == 0)) {
showInfoMessage("Please enter your name.", true);
} else if ((!g5UserExists) && (entryScreen.txtCode.text.length != 5)) {
showInfoMessage("Please enter all 5 letters of the security code.", true);
} else {
showInfoMessage("Submitting hi-score details to the server, please wait.", true);
infoScreen.btnBack._visible = false;
_local8 = false;
}
if (!_local8) {
var _local4 = "save|";
if (g5UserExists) {
_local4 = _local4 + ((((((("----------|-----|" + score) + "|") + gameId) + "|") + levelId) + "|") + g5User[0]);
} else {
_local4 = _local4 + (((((((((entryScreen.txtName.text + "|") + entryScreen.txtCode.text) + "|") + score) + "|") + gameId) + "|") + levelId) + "|-----");
}
var _local5 = "";
var _local3 = 0;
var _local2 = 0;
while (_local3 < _local4.length) {
if (_local2 >= KEY.length) {
_local2 = 0;
}
_local5 = _local5 + String.fromCharCode((_local4.charCodeAt(_local3) ^ KEY.charCodeAt(_local2)) + 1);
_local3++;
_local2++;
}
var self = this;
var _local6 = new LoadVars();
_local6.ffdata = _local5;
_local6.lowIsBest = lowIsBest;
_local6.sendAndLoad(HS_SERVLET_URL, _local6, "POST");
_local6.onLoad = function (success) {
var _local2 = parseInt(this.res);
if (!success) {
self.showInfoMessage("A serious problem was encountered with the server, please try again in a few minutes.", true);
} else if (_local2 == -1) {
self.showInfoMessage("Could not store hi-score details. Click on back, generate a new security code and re-submit.", true);
} else if (_local2 == 0) {
self.showInfoMessage("Sorry, a better score already exists with that name.", false);
} else if (_local2 == 1) {
self.showInfoMessage("Congratulations! You made it into the\nhi-score table.", false);
}
};
}
}
function enterAnotherName() {
g5UserExists = false;
autoEntryScreen._visible = false;
showEntryScreen();
}
static var symbolName = "HiScores";
static var symbolOwner = HiScores;
var className = "HiScores";
static var SERVER_URL = "http://www.gimme5games.com";
static var HS_SERVLET_URL = SERVER_URL + "/servlet/hiServlet";
static var HI_SCORE_URL = SERVER_URL + "/index.jsp?id=";
var KEY = "rocket";
var entryScreen = null;
var autoEntryScreen = null;
var infoScreen = null;
}
Symbol 303 MovieClip [__Packages.mx.skins.SkinElement] Frame 0
class mx.skins.SkinElement extends MovieClip
{
var _visible, _x, _y, _width, _height;
function SkinElement () {
super();
}
static function registerElement(name, className) {
Object.registerClass(name, ((className == undefined) ? (mx.skins.SkinElement) : (className)));
_global.skinRegistry[name] = true;
}
function __set__visible(visible) {
_visible = visible;
}
function move(x, y) {
_x = x;
_y = y;
}
function setSize(w, h) {
_width = w;
_height = h;
}
}
Symbol 304 MovieClip [__Packages.mx.styles.CSSTextStyles] Frame 0
class mx.styles.CSSTextStyles
{
function CSSTextStyles () {
}
static function addTextStyles(o, bColor) {
o.addProperty("textAlign", function () {
return(this._tf.align);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.align = x;
});
o.addProperty("fontWeight", function () {
return(((this._tf.bold != undefined) ? ((this._tf.bold ? "bold" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.bold = x == "bold";
});
if (bColor) {
o.addProperty("color", function () {
return(this._tf.color);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.color = x;
});
}
o.addProperty("fontFamily", function () {
return(this._tf.font);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.font = x;
});
o.addProperty("textIndent", function () {
return(this._tf.indent);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.indent = x;
});
o.addProperty("fontStyle", function () {
return(((this._tf.italic != undefined) ? ((this._tf.italic ? "italic" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.italic = x == "italic";
});
o.addProperty("marginLeft", function () {
return(this._tf.leftMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.leftMargin = x;
});
o.addProperty("marginRight", function () {
return(this._tf.rightMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.rightMargin = x;
});
o.addProperty("fontSize", function () {
return(this._tf.size);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.size = x;
});
o.addProperty("textDecoration", function () {
return(((this._tf.underline != undefined) ? ((this._tf.underline ? "underline" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.underline = x == "underline";
});
o.addProperty("embedFonts", function () {
return(this._tf.embedFonts);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.embedFonts = x;
});
}
}
Symbol 305 MovieClip [__Packages.mx.styles.StyleManager] Frame 0
class mx.styles.StyleManager
{
function StyleManager () {
}
static function registerInheritingStyle(styleName) {
inheritingStyles[styleName] = true;
}
static function isInheritingStyle(styleName) {
return(inheritingStyles[styleName] == true);
}
static function registerColorStyle(styleName) {
colorStyles[styleName] = true;
}
static function isColorStyle(styleName) {
return(colorStyles[styleName] == true);
}
static function registerColorName(colorName, colorValue) {
colorNames[colorName] = colorValue;
}
static function isColorName(colorName) {
return(colorNames[colorName] != undefined);
}
static function getColorName(colorName) {
return(colorNames[colorName]);
}
static var inheritingStyles = {color:true, direction:true, fontFamily:true, fontSize:true, fontStyle:true, fontWeight:true, textAlign:true, textIndent:true};
static var colorStyles = {barColor:true, trackColor:true, borderColor:true, buttonColor:true, color:true, dateHeaderColor:true, dateRollOverColor:true, disabledColor:true, fillColor:true, highlightColor:true, scrollTrackColor:true, selectedDateColor:true, shadowColor:true, strokeColor:true, symbolBackgroundColor:true, symbolBackgroundDisabledColor:true, symbolBackgroundPressedColor:true, symbolColor:true, symbolDisabledColor:true, themeColor:true, todayIndicatorColor:true, shadowCapColor:true, borderCapColor:true, focusColor:true};
static var colorNames = {black:0, white:16777215, red:16711680, green:65280, blue:255, magenta:16711935, yellow:16776960, cyan:65535, haloGreen:8453965, haloBlue:2881013, haloOrange:16761344};
static var TextFormatStyleProps = {font:true, size:true, color:true, leftMargin:false, rightMargin:false, italic:true, bold:true, align:true, indent:true, underline:false, embedFonts:false};
static var TextStyleMap = {textAlign:true, fontWeight:true, color:true, fontFamily:true, textIndent:true, fontStyle:true, lineHeight:true, marginLeft:true, marginRight:true, fontSize:true, textDecoration:true, embedFonts:true};
}
Symbol 306 MovieClip [__Packages.mx.styles.CSSStyleDeclaration] Frame 0
class mx.styles.CSSStyleDeclaration
{
var _tf;
function CSSStyleDeclaration () {
}
function __getTextFormat(tf, bAll) {
var _local5 = false;
if (_tf != undefined) {
var _local2;
for (_local2 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local2])) {
if (tf[_local2] == undefined) {
var _local3 = _tf[_local2];
if (_local3 != undefined) {
tf[_local2] = _local3;
} else {
_local5 = true;
}
}
}
}
} else {
_local5 = true;
}
return(_local5);
}
function getStyle(styleProp) {
var _local2 = this[styleProp];
var _local3 = mx.styles.StyleManager.getColorName(_local2);
return(((_local3 == undefined) ? (_local2) : (_local3)));
}
static function classConstruct() {
mx.styles.CSSTextStyles.addTextStyles(mx.styles.CSSStyleDeclaration.prototype, true);
return(true);
}
static var classConstructed = classConstruct();
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
}
Symbol 309 MovieClip [__Packages.Splash] Frame 0
class Splash extends mx.core.UIComponent
{
var useHandCursor, boundingBox_mc, invalidate;
function Splash () {
super();
}
function init() {
super.init();
useHandCursor = false;
boundingBox_mc._visible = false;
}
function createChildren() {
size();
}
function size() {
super.size();
invalidate();
}
function draw() {
super.draw();
if (_global.isLivePreview) {
boundingBox_mc._visible = true;
} else {
boundingBox_mc._visible = false;
}
}
function getFrameAfterCompletion() {
return(frameAfterCompletion);
}
function setFrameAfterCompletion(frameAfterCompletion) {
this.frameAfterCompletion = frameAfterCompletion;
}
static var symbolName = "Splash";
static var symbolOwner = Splash;
var className = "Splash";
var frameAfterCompletion = 0;
}
Symbol 194 MovieClip [cHair] Frame 1
function onEnterFrame() {
this._rotation = this._rotation + 3;
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Symbol 199 MovieClip [muteB] Frame 1
function onEnterFrame() {
if (_root.bMute == true) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
}
function onRelease() {
if (_root.bMute == true) {
_root.bMute = false;
_root.shotA.setVolume(70);
_root.music.bgm.setVolume(70);
} else {
_root.bMute = true;
_root.shotA.setVolume(0);
_root.music.bgm.setVolume(0);
}
}
Symbol 200 MovieClip [blackOut] Frame 1
function onEnterFrame() {
if (this._alpha > 1) {
this._alpha = this._alpha - 2;
} else {
_root.removeMC(this);
}
}
Symbol 225 MovieClip Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.dirx = -2;
this.diry = -2;
this.bSetup = true;
}
this.container._x = this.container._x + this.dirx;
this.container._y = this.container._y + this.diry;
if (this.container._x <= -400) {
this.dirx = 2;
} else if (this.container._x >= 0) {
this.dirx = -2;
}
if (this.container._y <= -350) {
this.diry = 2;
} else if (this.container._y >= 0) {
this.diry = -2;
}
this.bg1._x = this.container._x * 0.2;
this.bg1._y = this.container._y * 0.2;
}
Symbol 232 MovieClip [insScreen] Frame 1
function onEnterFrame() {
this.scoreText.text = _root.playerScore;
}
this.mmButton.onRelease = function () {
_root.startGame();
};
this.mmButton.onRollOver = function () {
_root.mOver.start();
};
this.subButton.onRollOver = function () {
_root.mOver.start();
};
this.PAGbutton.onRollOver = function () {
_root.mOver.start();
};
Symbol 243 MovieClip [mainMenu] Frame 1
function onEnterFrame() {
if (!this.bShowIns) {
if (this.ins._xscale > 1) {
this.ins._xscale = this.ins._xscale - 5;
}
} else if (this.ins._xscale < 100) {
this.ins._xscale = this.ins._xscale + 5;
}
}
this.startButton.onRelease = function () {
_root.newGame();
};
this.HSbutton.onRelease = function () {
Mouse.show();
mochi.MochiScores.showLeaderboard({boardID:"ae81787d5f9d358a", onClose:function () {
_root.startGame();
}});
_root.attachMovie("leadBG", "bgl", 0, {_x:0, _y:0});
};
this.PAGbutton.onRelease = function () {
getURL ("http://www.gimme5games.com/", "_blank");
};
this.insButton.onRelease = function () {
_root.attachMovie("insScreen", "bgl", 0, {_x:0, _y:0});
};
this.credButton.onRelease = function () {
_root.attachMovie("credits", "bgl", 0, {_x:0, _y:0});
};
this.HSbutton.onRollOver = function () {
_root.mOver.start();
};
this.credButton.onRollOver = function () {
_root.mOver.start();
};
this.PAGbutton.onRollOver = function () {
_root.mOver.start();
};
this.startButton.onRollOver = function () {
_root.mOver.start();
};
this.insButton.onRollOver = function () {
_root.mOver.start();
};
Symbol 253 MovieClip [endScreen] Frame 1
function onEnterFrame() {
this.scoreText.text = _root.playerScore;
}
this.mmButton.onRelease = function () {
_root.startGame();
};
this.paButton.onRelease = function () {
_root.newGame();
};
this.subButton.onRelease = function () {
Mouse.show();
_root.attachMovie("leadBG", "bgl", 0, {_x:0, _y:0});
_root.removeMC(this._parent);
};
this.PAGbutton.onRelease = function () {
getURL ("http://www.gimme5games.com/", "_blank");
};
this.mmButton.onRollOver = function () {
_root.mOver.start();
};
this.paButton.onRollOver = function () {
_root.mOver.start();
};
this.subButton.onRollOver = function () {
_root.mOver.start();
};
this.PAGbutton.onRollOver = function () {
_root.mOver.start();
};
Symbol 258 MovieClip [credits] Frame 1
function onEnterFrame() {
this.scoreText.text = _root.playerScore;
}
this.mmButton.onRelease = function () {
_root.startGame();
};
this.mmButton.onRollOver = function () {
_root.mOver.start();
};
this.subButton.onRollOver = function () {
_root.mOver.start();
};
this.PAGbutton.onRollOver = function () {
_root.mOver.start();
};
Symbol 279 Button
on (release) {
_parent.submitScore();
}
Symbol 281 Button
on (release) {
_parent.secCodeLoad();
}
Symbol 292 Button
on (release) {
_parent.enterAnotherName();
}
Symbol 296 Button
on (release) {
_parent.back();
}
Symbol 299 Button
on (release) {
_parent.viewScore();
}
Symbol 302 MovieClip [HiScores] Frame 1
#initclip 57
Object.registerClass("HiScores", HiScores);
#endinitclip
Symbol 307 MovieClip [leadBG] Frame 1
function onEnterFrame() {
if (!bDone) {
_root.lightfx._alpha = 0;
bDone = true;
this.movHiScores.setDetails(89, 0, "ecaps", false, _root.playerScore, _root.playerScore, "Points");
}
}
this.mmButton.onRelease = function () {
_root.startGame();
};
this.subButton.onRelease = function () {
Mouse.show();
mochi.MochiScores.showLeaderboard({boardID:"ae81787d5f9d358a", score:_root.playerScore, onClose:function () {
_root.startGame();
}});
};
this.PAGbutton.onRelease = function () {
getURL ("http://www.stockmarketgame.biz/?link=ecaps");
};
this.mmButton.onRollOver = function () {
_root.mOver.start();
};
this.subButton.onRollOver = function () {
_root.mOver.start();
};
this.PAGbutton.onRollOver = function () {
_root.mOver.start();
};
Instance of Symbol 302 MovieClip [HiScores] "movHiScores" in Symbol 307 MovieClip [leadBG] Frame 1
//component parameters
onClipEvent (construct) {
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 319 Button
on (release) {
getURL ("http://www.gimme5games.com", "_blank");
}
Symbol 330 MovieClip [Splash] Frame 1
#initclip 58
Object.registerClass("Splash", Splash);
#endinitclip
Symbol 330 MovieClip [Splash] Frame 91
_root.gotoAndPlay(this.getFrameAfterCompletion());