Frame 1
MochiAd.showPreGameAd({id:"6905b807ed687d29", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
this._lockroot = true;
var gameName = "meteor";
vNum = "1.01";
flashVersionsNeeded = 8;
legalDomain = "http://www.terrypaton.com";
authorName = "Terry Paton";
authorContact = "terry@terrypaton.com";
authorsSite = "http://www.terrypaton.com";
gameLocation = _root._url.substr(0, legalDomain.length);
gameQuality = "AUTO";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem(authorsSite, gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
this._lockroot = true;
if (gameLocation != legalDomain) {
}
Frame 3
loadingClip.onLoad = function () {
};
loadingClip.onEnterFrame = function () {
pL = Math.floor((this._parent.getBytesLoaded() / this._parent.getBytesTotal()) * 100);
if (pL < 100) {
this.mask._xscale = (pL / 100) * 100;
this._parent.stop();
} else {
i = 0;
while (i < stringLength) {
removeMovieClip(eval ("loadingHolder.l" + i));
i++;
}
this._parent.play();
}
};
wordString = "METEOR";
stringLength = wordString.length;
wordOffset = (stringLength * 20) / 2;
this.createEmptyMovieClip("loadingHolder", 1);
loadingHolder._x = (320 - wordOffset) + 10;
loadingHolder._y = 175;
i = 0;
while (i < stringLength) {
t = loadingHolder.attachMovie("letter", "l" + i, i);
t._x = i * 20;
t.angle = i;
t.Lvar.text = wordString.charAt(i);
t._xscale = (t._yscale = 200);
i++;
}
stop();
Frame 4
function attachSoundFromLibrary(idname) {
var _local2 = new Sound(this);
_local2.attachSound(idname);
return(_local2);
}
var exp1Snd = attachSoundFromLibrary("exp1Snd.wav");
var exp2Snd = attachSoundFromLibrary("exp2Snd.wav");
var alarmsnd = attachSoundFromLibrary("alarmSound.wav");
var playerHitSnd = attachSoundFromLibrary("playerHit.wav");
var bonusSnd = attachSoundFromLibrary("bonuscollected.wav");
var waveCompleteSnd = attachSoundFromLibrary("waveComplete.wav");
var startLevelSnd = attachSoundFromLibrary("startLevel.wav");
var levelCompletedSnd = attachSoundFromLibrary("levelCompleted.wav");
var gunShot1Snd = attachSoundFromLibrary("gunShot1.wav");
var gunShot2Snd = attachSoundFromLibrary("gunShot2.wav");
var gunShot3Snd = attachSoundFromLibrary("gunShot3.wav");
storage = SharedObject.getLocal("meteorStore");
yourhigh = storage.data.myhighscore;
if (yourhigh == undefined) {
storage.data.myhighscore = 0;
yourhigh = 0;
}
Frame 6
_quality = "HIGH";
playBtn.onRelease = function () {
gotoAndPlay (16);
};
Frame 15
stop();
Frame 16
if (false) {
}
Frame 17
function addPoints(num) {
if (num > 0) {
score = score + num;
pscoreClip.gotoAndPlay(2);
} else {
score = score + num;
pscoreClip.gotoAndPlay(20);
if (score < 0) {
score = 0;
}
}
}
function attachMeteors() {
if ((levelMeteors < 1) && (currentMeteors < 1)) {
gameState = "level complete";
}
if (levelMeteors > 0) {
meteorCount--;
if (meteorCount < 1) {
currentMeteors++;
levelMeteors--;
meteorCount = random(maxMeteorCount);
if (level != 3) {
attackArray = new Array();
if (dome1Health > 0) {
attackArray.push(179);
}
if (dome2Health > 0) {
attackArray.push(320);
}
if (dome3Health > 0) {
attackArray.push(463);
}
if (gun1Health > 0) {
attackArray.push(playerGun1._x);
}
if (gun2Health > 0) {
attackArray.push(playerGun2._x);
}
tn = random(attackArray.length);
tx = attackArray[tn];
t = meteors.attachMovie("meteor", "m" + mNum, mNum);
t._x = random(640);
tx = tx + (random(100) - 50);
t.targetX = tx;
t.targetY = 393;
t._y = -10;
mNum++;
} else {
t = meteors.attachMovie("bUfo", "u" + mNum, mNum);
t._x = -20;
t._y = (Math.random() * 250) + 50;
mNum++;
}
}
}
}
function explodeMeteor(clipN, x, y) {
if (bDelay > 0) {
bCalc++;
bonusX = x;
bonusY = y;
}
currentMeteors--;
removeMovieClip(clipN);
t = bullets.attachMovie("bExplosion", "b" + bNum, bNum);
t._xscale = (t._yscale = 70);
t._x = x;
t._y = y;
tmp = random(4) * 90;
t._rotation = tmp;
bNum++;
exp2Snd.start();
if (y < 380) {
addPoints(100);
t.exNum.text = 100;
t.exNum._rotation = -tmp;
}
}
function explodeBullet(clipN, x, y) {
removeMovieClip(clipN);
t = bullets.attachMovie("bExplosion", "b" + bNum, bNum);
t._x = x;
t._y = y;
t._rotation = random(4) * 90;
t.exNum.text = "";
bNum++;
exp1Snd.start();
bDelay = 10;
}
function frameAction() {
switch (gameState) {
case "playing" :
if (bDelay > 0) {
bDelay--;
if (bDelay == 0) {
if (bCalc > 1) {
t = bullets.attachMovie("bonus", "b" + bNum, bNum);
t._x = bonusX;
t._y = bonusY;
t.bText.text = "x" + bCalc;
if (level != 3) {
score = score + (bCalc * 100);
} else {
score = score + (bCalc * 300);
}
bNum++;
}
bCalc = 0;
}
}
if (level != 3) {
satDelay--;
if (satDelay < 1) {
if (random(2) == 0) {
t = meteors.attachMovie("satellite", "satellite", mNum);
} else {
t = meteors.attachMovie("ufo", "ufo", mNum);
}
t._x = -100;
t._y = random(200) + 50;
mNum++;
satDelay = random(400) + 150;
}
}
attachMeteors();
if (currentMeteors < 5) {
attachMeteors();
attachMeteors();
}
angle = 90 + ((Math.atan2(_ymouse - gun1Y, _xmouse - gun1X) * 180) / Math.PI);
return;
case "level complete" :
if (level != 3) {
tellPlayer(7);
} else {
tellPlayer(11);
}
level++;
waveCompleteSnd.start();
lwait = 90;
gameState = "level complete wait";
return;
case "level complete wait" :
lwait--;
if (lwait < 1) {
if (level > 6) {
gameState = "game complete";
} else {
gameState = "setup level";
}
}
return;
case "setup" :
trace(2);
setup();
gameState = "setup level";
return;
case "setup level" :
setupLevel();
gun1X = playerGun1._x;
gun1Y = playerGun1._y;
gun2X = playerGun2._x;
gun2Y = playerGun2._y;
gameState = "playing";
_quality = "LOW";
return;
case "game over" :
_quality = "HIGH";
goWait = 90;
gameState = "game over wait";
return;
case "game complete" :
_quality = "HIGH";
gcWait = 10;
gameState = "game complete wait";
return;
case "game over wait" :
goWait--;
if (goWait < 1) {
gameState = "wait";
gotoAndPlay (26);
}
return;
case "game complete wait" :
gcWait--;
if (gcWait < 1) {
gotoAndPlay (36);
gameState = "wait";
}
return;
}
}
intervalId = setInterval(this, "frameAction", 100);
function playersTarget() {
siteX = _xmouse;
siteY = _ymouse;
if (siteY > 333) {
siteY = 333;
}
gunSite._x = siteX;
gunSite._y = siteY;
px = siteX - gun1X;
py = siteY - gun1Y;
radians = Math.atan2(py, px);
g1Rot = (radians * 180) / Math.PI;
playerGun1.turret._rotation = g1Rot;
px = siteX - gun2X;
py = siteY - gun2Y;
radians = Math.atan2(py, px);
g2Rot = (radians * 180) / Math.PI;
playerGun2.turret._rotation = g2Rot;
}
function playerClicks() {
if (gameState == "playing") {
if ((gun1Health > 0) || (gun2Health > 0)) {
addPoints(-50);
this[("gunShot" + (random(3) + 1)) + "Snd"].start();
t = bullets.attachMovie("bullet", "b" + bNum, bNum);
if ((gun1Health > 0) && (gun2Health > 0)) {
if (siteX < 321) {
t._x = playerGun1._x;
t._y = playerGun1._y;
t.angle = g1Rot;
} else {
t._x = playerGun2._x;
t._y = playerGun2._y;
t.angle = g2Rot;
}
} else if ((gun1Health > 0) && (gun2Health == 0)) {
t._x = playerGun1._x;
t._y = playerGun1._y;
t.angle = g1Rot;
} else if ((gun1Health == 0) && (gun2Health > 0)) {
t._x = playerGun2._x;
t._y = playerGun2._y;
t.angle = g2Rot;
}
t.targetX = siteX;
t.targetY = siteY;
bNum++;
u = bullets.attachMovie("bmarker", "bm" + bNum, bNum);
u._x = gunSite._x;
u._y = gunSite._y;
bNum++;
}
}
}
function setup() {
dome1Health = 100;
dome2Health = 100;
dome3Health = 100;
gun1Health = 100;
gun2Health = 100;
playerGun1.turret._visible = true;
playerGun2.turret._visible = true;
var _local1 = new flash.display.BitmapData(640, 387, true, 0);
starBack.attachBitmap(_local1, 1);
_local1.noise(random(100), 40, 255, 8, true);
onMouseDown = function () {
playerClicks();
};
score = 0;
onMouseMove = function () {
playersTarget();
};
level = 1;
}
function setupLevel() {
bCalc = 0;
bDelay = 0;
bonusX = 0;
bonusX = 0;
maxMeteorCount = 60;
meteorCount = random(maxMeteorCount);
mNum = 1;
bNum = 1;
currentMeteors = 0;
satDelay = random(400) + 150;
switch (level) {
case 1 :
levelMeteors = 40;
break;
case 2 :
levelMeteors = 50;
break;
case 3 :
levelMeteors = 30;
break;
case 4 :
levelMeteors = 70;
break;
case 5 :
levelMeteors = 80;
break;
case 6 :
levelMeteors = 90;
break;
}
if (level == 3) {
tellPlayer(10);
} else {
tellPlayer(8);
}
}
function testHitPlayer(tClip, tx, ty) {
if (gun1Health > 0) {
dx = tx - playerGun1._x;
dy = ty - playerGun1._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 55) {
gun1Health = gun1Health - 17;
playerHitSnd.start();
playerGun1.gotoAndStop(6 - Math.floor((gun1Health / 100) * 6));
addPoints(-250);
if (gun1Health <= 0) {
tellPlayer(1);
gun1Health = 0;
playerGun1.turret._visible = false;
}
}
}
if (gun2Health > 0) {
dx = tx - playerGun2._x;
dy = ty - playerGun2._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 55) {
gun2Health = gun2Health - 17;
playerHitSnd.start();
playerGun2.gotoAndStop(6 - Math.floor((gun2Health / 100) * 6));
addPoints(-250);
if (gun2Health <= 0) {
tellPlayer(5);
gun2Health = 0;
playerGun2.turret._visible = false;
}
}
}
if (dome1Health > 0) {
dx = tx - dome1._x;
dy = ty - dome1._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 55) {
addPoints(-250);
dome1Health = dome1Health - 17;
dome1.gotoAndStop(6 - Math.floor((dome1Health / 100) * 6));
if (dome1Health <= 0) {
tellPlayer(2);
dome1Health = 0;
}
}
}
if (dome2Health > 0) {
dx = tx - dome2._x;
dy = ty - dome2._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 55) {
addPoints(-250);
dome2Health = dome2Health - 17;
playerHitSnd.start();
dome2.gotoAndStop(6 - Math.floor((dome2Health / 100) * 6));
if (dome2Health <= 0) {
tellPlayer(3);
dome2Health = 0;
}
}
}
dx = tx - dome3._x;
dy = ty - dome3._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 55) {
addPoints(-250);
dome3Health = dome3Health - 17;
playerHitSnd.start();
dome3.gotoAndStop(6 - Math.floor((dome3Health / 100) * 6));
if (dome3Health <= 0) {
tellPlayer(4);
dome3Health = 0;
}
}
if (((dome1Health == 0) && (dome2Health == 0)) && (dome3Health == 0)) {
gameState = "game over";
}
}
function tellPlayer(temp) {
switch (temp) {
case 1 :
tellTxt = "GUN LOST!";
alarmsnd.start();
break;
case 2 :
tellTxt = "DOME DESTROYED!";
alarmsnd.start();
break;
case 3 :
tellTxt = "DOME DESTROYED!";
alarmsnd.start();
break;
case 4 :
tellTxt = "DOME DESTROYED!";
alarmsnd.start();
break;
case 5 :
tellTxt = "GUN LOST!";
alarmsnd.start();
break;
case 6 :
tellTxt = "SATELLITE!";
bonusSnd.start();
break;
case 7 :
if (level < 3) {
tellTxt = ("WAVE " + level) + " COMPLETE";
} else {
tellTxt = ("WAVE " + Number(level - 1)) + " COMPLETE";
}
trace(tellTxt);
levelCompletedSnd.start();
break;
case 8 :
trace(level);
if (level < 4) {
tellTxt = "WAVE " + level;
} else {
tellTxt = "WAVE " + Number(level - 1);
}
startLevelSnd.start();
break;
case 9 :
tellTxt = "UFO!";
bonusSnd.start();
break;
case 10 :
tellTxt = "BONUS WAVE";
startLevelSnd.start();
break;
case 11 :
tellTxt = "BONUS COMPLETE";
levelCompletedSnd.start();
break;
default :
tellTxt = "";
}
if (tellTxt != "") {
attachMovie("warning", "warning", 100);
warning.textBox.text = tellTxt;
}
}
function testDestroyMeteor(eName) {
if (level != 3) {
dx = eName._x - meteors.ufo._x;
dy = eName._y - meteors.ufo._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 32) {
addPoints(2000);
if (gameState == "playing") {
tellPlayer(9);
}
t = bullets.attachMovie("mExplosion", "b" + bNum, bNum);
t._x = meteors.ufo._x;
t._y = meteors.ufo._y;
t._xscale = (t._yscale = 200);
removeMovieClip(meteors.ufo);
t._rotation = random(4) * 90;
bNum++;
exp2Snd.start();
}
dx = eName._x - meteors.satellite._x;
dy = eName._y - meteors.satellite._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 32) {
addPoints(1000);
if (gameState == "playing") {
tellPlayer(6);
}
t = bullets.attachMovie("mExplosion", "b" + bNum, bNum);
t._x = meteors.satellite._x;
t._y = meteors.satellite._y;
t._xscale = (t._yscale = 200);
removeMovieClip(meteors.satellite);
t._rotation = random(4) * 90;
bNum++;
exp2Snd.start();
}
et = mNum - 15;
while (et < mNum) {
t = eval ("meteors.m" + et);
if (t != undefined) {
dx = eName._x - t._x;
dy = eName._y - t._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 36) {
addPoints(100);
_root.explodeMeteor(t, t._x, t._y);
}
}
et++;
}
} else {
et = mNum - 15;
while (et < mNum) {
t = eval ("meteors.u" + et);
if (t != undefined) {
dx = eName._x - t._x;
dy = eName._y - t._y;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 36) {
addPoints(300);
_root.explodeMeteor(t, t._x, t._y);
}
}
et++;
}
}
}
Frame 18
gameState = "setup";
Frame 25
stop();
Frame 26
delete gameState;
delete onEnterFrame;
_quality = "HIGH";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
storage.flush();
}
if (score >= 250) {
enterHigh._visible = true;
} else {
enterHigh._visible = false;
}
Frame 35
mainMenuBtn.onRelease = function () {
trace("main menu");
trace(gameState);
gotoAndPlay (6);
};
stop();
Frame 36
delete gameState;
delete onEnterFrame;
_quality = "HIGH";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
storage.flush();
}
enterHigh._visible = true;
Frame 45
mainMenuBtn.onRelease = function () {
gotoAndPlay (6);
};
stop();
Symbol 244 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.3");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local27);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0) {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_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 _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
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 showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
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.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
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 showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(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 _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _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);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Symbol 245 MovieClip [__Packages.letterClass] Frame 0
class letterClass extends MovieClip
{
var centerY, radiusY, speed, y, _y, x, _x, angle;
function letterClass () {
super();
}
function onLoad() {
centerY = 48;
radiusY = 5;
speed = 0.05;
y = _y;
x = _x;
}
function onEnterFrame() {
if (angle != undefined) {
y = centerY + (Math.sin(angle) * radiusY);
angle = angle + speed;
_x = x;
_y = y;
}
}
}
Symbol 246 MovieClip [__Packages.bulletClass] Frame 0
class bulletClass extends MovieClip
{
var bState, speed, x, _x, y, _y, tmpAngle, angle, bx, by, removeMovieClip, dx, targetX, dy, targetY, dist;
function bulletClass () {
super();
}
function onLoad() {
bState = "normal";
speed = 10;
x = _x;
y = _y;
tmpAngle = (angle * Math.PI) / 180;
bx = speed * Math.cos(tmpAngle);
by = speed * Math.sin(tmpAngle);
}
function onEnterFrame() {
_x = x;
_y = y;
x = x + bx;
y = y + by;
if ((((y > 480) || (x < 0)) || (x > 640)) || (y < 0)) {
removeMovieClip();
}
dx = x - targetX;
dy = y - targetY;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if (dist < 11) {
_root.explodeBullet(this, x, y);
}
}
}
Symbol 247 MovieClip [__Packages.bmarkerClass] Frame 0
class bmarkerClass extends MovieClip
{
var t, alf, _alpha, removeMovieClip;
function bmarkerClass () {
super();
}
function onLoad() {
t = 70;
alf = 100 / t;
}
function onEnterFrame() {
_alpha = _alpha - alf;
t--;
if (t < 0) {
removeMovieClip();
}
}
}
Symbol 248 MovieClip [__Packages.meteorClass] Frame 0
class meteorClass extends MovieClip
{
var bState, speed, x, _x, y, _y, radians, targetY, targetX, angle, tmpAngle, bx, by, _rotation, removeMovieClip, dx, dy, dist;
function meteorClass () {
super();
}
function onLoad() {
bState = "normal";
if (_root.level == 1) {
speed = 1 + (Math.random() * 2.5);
} else if (_root.level == 2) {
speed = 1 + (Math.random() * 3);
} else if (_root.level == 4) {
speed = 1 + (Math.random() * 3.5);
} else if (_root.level == 5) {
speed = 1 + (Math.random() * 4);
} else if (_root.level == 6) {
speed = 1 + (Math.random() * 4.5);
}
x = _x;
y = _y;
radians = Math.atan2(targetY - y, targetX - x);
angle = Math.floor((radians * 180) / Math.PI);
tmpAngle = (angle * Math.PI) / 180;
bx = speed * Math.cos(tmpAngle);
by = speed * Math.sin(tmpAngle);
_rotation = (radians * 180) / Math.PI;
}
function onEnterFrame() {
if (_root.gameState == "playing") {
_x = x;
_y = y;
x = x + bx;
y = y + by;
if (y > 480) {
removeMovieClip();
}
if (angle > 360) {
angle = angle - 360;
} else if (angle < 0) {
angle = angle + 360;
}
dx = x - targetX;
dy = y - targetY;
dist = Math.abs(Math.floor(Math.sqrt((dx * dx) + (dy * dy))));
if ((dist < 11) || (y > targetY)) {
_root.testHitPlayer(this, x, y);
_root.explodeMeteor(this, x, y);
}
}
}
}
Symbol 249 MovieClip [__Packages.warningClass] Frame 0
class warningClass extends MovieClip
{
var t, alf, _x, _y, _xscale, _yscale, _alpha, removeMovieClip;
function warningClass () {
super();
}
function onLoad() {
t = 100;
alf = 100 / t;
_x = 320;
_y = 200;
_xscale = (_yscale = 350);
}
function onEnterFrame() {
_alpha = _alpha - alf;
_xscale = (_yscale = _yscale - 2);
t--;
if (t < 0) {
removeMovieClip();
}
}
}
Symbol 250 MovieClip [__Packages.satelliteClass] Frame 0
class satelliteClass extends MovieClip
{
var speed, _x, removeMovieClip;
function satelliteClass () {
super();
}
function onLoad() {
speed = 4 + random(4);
}
function onEnterFrame() {
_x = _x + speed;
if (_x > 650) {
removeMovieClip();
}
}
}
Symbol 251 MovieClip [__Packages.ufoClass] Frame 0
class ufoClass extends MovieClip
{
var speed, angle, range, ySpeed, centerScale, _y, _x, removeMovieClip;
function ufoClass () {
super();
}
function onLoad() {
speed = 4 + random(4);
angle = 0;
range = 30;
ySpeed = 0.1;
centerScale = _y;
}
function onEnterFrame() {
_y = centerScale + (Math.sin(angle) * range);
angle = angle + ySpeed;
if (angle > (Math.PI*2)) {
range = random(39) + 1;
angle = 0;
}
_x = _x + speed;
if (_x > 650) {
removeMovieClip();
}
}
}
Symbol 252 MovieClip [__Packages.bonusClass] Frame 0
class bonusClass extends MovieClip
{
var t, alf, _alpha, removeMovieClip;
function bonusClass () {
super();
}
function onLoad() {
t = 70;
alf = 100 / t;
}
function onEnterFrame() {
_alpha = _alpha - alf;
t--;
if (t < 0) {
removeMovieClip();
}
}
}
Symbol 253 MovieClip [__Packages.bUfoClass] Frame 0
class bUfoClass extends MovieClip
{
var speed, angle, range, ySpeed, centerScale, _y, _x, removeMovieClip;
function bUfoClass () {
super();
}
function onLoad() {
speed = 4 + random(4);
angle = 0;
range = 30;
ySpeed = speed * 0.02;
centerScale = _y;
}
function onEnterFrame() {
_y = centerScale + (Math.sin(angle) * range);
angle = angle + ySpeed;
if (angle > (Math.PI*2)) {
range = random(39) + 1;
angle = 0;
}
_x = _x + speed;
if (_x > 650) {
removeMovieClip();
_root.currentMeteors--;
}
}
}
Symbol 254 MovieClip [__Packages.bExpClass] Frame 0
class bExpClass extends MovieClip
{
var life, removeMovieClip, _alpha;
function bExpClass () {
super();
}
function onLoad() {
life = 40;
}
function onEnterFrame() {
life--;
if (life < 1) {
removeMovieClip();
}
if (life > 10) {
_root.testDestroyMeteor(this);
}
if (life < 10) {
_alpha = _alpha - 15;
}
}
}
Symbol 10 MovieClip [letter] Frame 1
#initclip 12
Object.registerClass("letter", letterClass);
#endinitclip
Symbol 93 MovieClip [bExplosion] Frame 1
#initclip 21
Object.registerClass("bExplosion", bExpClass);
#endinitclip
Symbol 96 MovieClip [bullet] Frame 1
#initclip 13
Object.registerClass("bullet", bulletClass);
#endinitclip
Symbol 98 MovieClip [bmarker] Frame 1
#initclip 14
Object.registerClass("bmarker", bmarkerClass);
#endinitclip
Symbol 109 MovieClip [meteor] Frame 1
#initclip 15
Object.registerClass("meteor", meteorClass);
#endinitclip
Symbol 113 MovieClip [warning] Frame 1
#initclip 16
Object.registerClass("warning", warningClass);
#endinitclip
stop();
Symbol 117 MovieClip [satellite] Frame 1
#initclip 17
Object.registerClass("satellite", satelliteClass);
#endinitclip
Symbol 120 MovieClip [ufo] Frame 1
#initclip 18
Object.registerClass("ufo", ufoClass);
#endinitclip
Symbol 123 MovieClip [bonus] Frame 1
#initclip 19
Object.registerClass("bonus", bonusClass);
#endinitclip
Symbol 126 MovieClip [bUfo] Frame 1
#initclip 20
Object.registerClass("bUfo", bUfoClass);
#endinitclip
Symbol 138 MovieClip Frame 1
stop();
Symbol 144 MovieClip Frame 1
_root.stop();
Symbol 144 MovieClip Frame 75
_root.play();
Symbol 155 MovieClip Frame 1
this.onPress = function () {
getURL ("http://www.terrypaton.com", "_blank");
};
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.stop();
Symbol 158 MovieClip Frame 13
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 223 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 16
stop();
Symbol 226 MovieClip Frame 30
stop();