Frame 1
MochiAd.showPreGameAd({id:"e62b1c768b35121e", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
this._lockroot = true;
var gameName = "topShot";
vNum = "Version 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 = "TOP SHOT";
stringLength = wordString.length;
wordOffset = (stringLength * 20) / 2;
this.createEmptyMovieClip("loadingHolder", 1);
loadingHolder._x = (320 - wordOffset) + 10;
loadingHolder._y = 175;
i = 0;
while (i < stringLength) {
loadingHolder.attachMovie("letter", "l" + i, i);
eval ("loadingHolder.l" + i)._x = i * 20;
eval ("loadingHolder.l" + i).angle = i;
eval ("loadingHolder.l" + i).Lvar.text = wordString.charAt(i);
i++;
}
stop();
Frame 4
topshotStorage = SharedObject.getLocal("dartsStore");
yourhigh = topshotStorage.data.myhighscore;
trace(yourhigh);
if (yourhigh == undefined) {
trace("yo");
topshotStorage.data.myhighscore = 0;
yourhigh = 0;
dartsStorage.flush();
}
Frame 5
function attachSoundFromLibrary(idname) {
var _local2 = new Sound(this);
_local2.attachSound(idname);
return(_local2);
}
var score1_snd = attachSoundFromLibrary("scoreSnd1.wav");
var score2_snd = attachSoundFromLibrary("scoreSnd2.wav");
var score3_snd = attachSoundFromLibrary("scoreSnd3.wav");
var score4_snd = attachSoundFromLibrary("scoreSnd4.wav");
var missed1Snd = attachSoundFromLibrary("missed1Snd.wav");
var throw1_snd = attachSoundFromLibrary("throwSnd1.wav");
var throw2_snd = attachSoundFromLibrary("throwSnd2.wav");
var throw3_snd = attachSoundFromLibrary("throwSnd3.wav");
var throw4_snd = attachSoundFromLibrary("throwSnd4.wav");
var music_snd = attachSoundFromLibrary("music.wav");
var nextLvl_snd = attachSoundFromLibrary("nextLvl.wav");
var gameOver_snd = attachSoundFromLibrary("gameOver.wav");
var gameComplete_snd = attachSoundFromLibrary("gameComplete.wav");
var targetReached_snd = attachSoundFromLibrary("targetReached.wav");
var nextBall_snd = attachSoundFromLibrary("nextBall.wav");
var lastBall_snd = attachSoundFromLibrary("lastBall.wav");
Frame 7
music_snd.start();
playBtn.onRelease = function () {
gotoAndPlay (17);
};
highReset.onRelease = function () {
yourhigh = 0;
topshotStorage.data.myhighscore = 0;
topshotStorage.flush();
};
Frame 8
if (false) {
}
Frame 16
stop();
Frame 17
function findTarget() {
hitSomething = false;
i = 0;
while (i < 20) {
if ((currentBallClip._y > 187) && (currentBallClip._y < 285)) {
layerName = "layer1";
} else if ((currentBallClip._y > 113) && (currentBallClip._y < 178)) {
layerName = "layer2";
} else if (currentBallClip._y < 92) {
layerName = "layer3";
}
if (currentBallClip.hitTest(eval (((layerName + ".t") + i) + ".hotSpot"))) {
tempState = eval ((layerName + ".t") + i).tarState;
if (tempState == "normal") {
_root.hitTarget(eval ((layerName + ".t") + i).num, currentBallClip._x, currentBallClip._y);
eval ((layerName + ".t") + i).tarState = "hit";
eval ((layerName + ".t") + i).hotSpot._visible = false;
hitSomething = true;
}
break;
}
i++;
}
if (!hitSomething) {
trace("you missed");
missed1Snd.start();
}
if (targetY < 99) {
layer4.attachMovie("ball", "ball", layer4.getNextHighestDepth() + random(20));
tempLayer = "layer4";
} else if ((targetY > 98) && (targetY < 181)) {
tempLayer = "layer2";
layer2.attachMovie("ball", "ball", layer2.getNextHighestDepth() + random(20));
} else if ((targetY > 181) && (targetY < 290)) {
layer1.attachMovie("ball", "ball", layer1.getNextHighestDepth() + random(20));
tempLayer = "layer1";
} else if (targetY > 298) {
layer0.attachMovie("ball", "ball", layer0.getNextHighestDepth() + random(20));
tempLayer = "layer0";
}
tempBall = eval (tempLayer + ".ball");
tempBall._x = currentBallClip._x;
tempBall._y = ballY;
tempBall.tarState = "fall";
tempBall._xscale = (tempBall._yscale = currentBallClip._xscale);
tempBall.gotoAndStop(random(11) + 1);
tempBall.shadowClip._visible = false;
removeMovieClip(currentBallClip);
uptoBall++;
currentBallClip = eval ("ballHolder.ball" + uptoBall);
if (uptoBall >= maxBalls) {
gameState = "level complete test";
} else {
gameState = "playing";
if (uptoBall == (maxBalls - 1)) {
lastBall_snd.start();
ballHolder.attachMovie("tellPlayer", "tellPlayer", 1000);
ballHolder.tellPlayer._x = 320;
ballHolder.tellPlayer._y = 240;
ballHolder.tellPlayer.tell.text = "Last Ball";
} else {
nextBall_snd.start();
}
}
}
function setupLevel() {
i = 0;
while (i < 20) {
removeMovieClip(eval ("layer1.t" + i));
removeMovieClip(eval ("layer2.t" + i));
removeMovieClip(eval ("layer3.t" + i));
i++;
}
tarRch = false;
targetClip.gotoAndStop(1);
mSight.gotoAndPlay(2);
mSight.exit = false;
uptoBall = 1;
ballNum = 1;
i = 1;
while (i < maxBalls) {
ballHolder.attachMovie("ball", "ball" + ballNum, 200 - ballNum);
with (eval ("ballHolder.ball" + ballNum)) {
_x = (i * 55) + random(10);
_y = 410 - random(20);
rot = random(11) + 1;
gotoAndStop(rot);
}
ballNum++;
i++;
}
currentBallClip = eval ("ballHolder.ball" + uptoBall);
ballHolder.attachMovie("tellPlayer", "tellPlayer", 1000);
ballHolder.tellPlayer._x = 320;
ballHolder.tellPlayer._y = 240;
ballHolder.tellPlayer.tell.text = "Level " + level;
switch (level) {
case 1 :
levelArray = new Array(1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5);
levelArray.push(11, 8, 11, 8, 6, 11, 8, 11, 8, 6, 11, 8, 11, 8, 6, 11, 8, 11, 8, 6);
levelArray.push(11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10);
levelTarget = 500;
layer1Speed = 2;
layer2Speed = 4;
layer3Speed = 8;
layer1Start = 640;
layer1Xpos = layer1Start;
layer1dir = "left";
layer2Start = 0;
layer2Xpos = layer2Start;
layer2dir = "right";
layer3Start = 640;
layer3Xpos = layer3Start;
layer3dir = "left";
break;
case 2 :
levelArray = new Array(10, 11, 10, 11, 10, 1, 10, 11, 10, 11, 10, 1, 10, 11, 10, 11, 10, 1, 10, 11);
levelArray.push(1, 1, 8, 0, 1, 8, 0, 1, 8, 1, 0, 8, 1, 0, 8, 1, 1, 0, 1, 1);
levelArray.push(2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0);
levelTarget = 2000;
layer1Speed = 2;
layer2Speed = 4;
layer3Speed = 8;
layer1Start = 0;
layer1Xpos = layer1Start;
layer1dir = "right";
layer2Start = 640;
layer2Xpos = layer2Start;
layer2dir = "left";
layer3Start = 0;
layer3Xpos = layer3Start;
layer3dir = "right";
break;
case 3 :
levelArray = new Array(5, 11, 5, 0, 5, 0, 11, 5, 11, 0, 5, 11, 0, 11, 5, 5, 11, 0, 11, 0);
levelArray.push(8, 4, 0, 4, 4, 8, 0, 8, 4, 4, 0, 4, 8, 0, 4, 8, 0, 8, 0, 4, 8);
levelArray.push(2, 10, 2, 0, 2, 10, 2, 10, 2, 0, 2, 10, 2, 0, 2, 10, 2, 10, 2);
levelTarget = 4000;
layer1Speed = 2;
layer2Speed = 4;
layer3Speed = 8;
layer1Start = 640;
layer1Xpos = layer1Start;
layer1dir = "left";
layer2Start = 0;
layer2Xpos = layer2Start;
layer2dir = "right";
layer3Start = 0;
layer3Xpos = layer3Start;
layer3dir = "right";
break;
case 4 :
levelArray = new Array(7, 8, 11, 7, 8, 0, 7, 8, 11, 7, 8, 0, 7, 8, 11, 7, 0, 11, 7, 8);
levelArray.push(6, 2, 0, 2, 2, 6, 2, 6, 0, 2, 6, 2, 6, 2, 2, 0, 2, 6, 2, 2);
levelArray.push(9, 0, 9, 4, 0, 9, 0, 9, 4, 0, 9, 4, 9, 0, 4, 9, 4, 9, 0, 4);
levelTarget = 6500;
layer1Speed = 2;
layer2Speed = 4;
layer3Speed = 8;
layer1Start = 0;
layer1Xpos = layer1Start;
layer1dir = "right";
layer2Start = 640;
layer2Xpos = layer2Start;
layer2dir = "left";
layer3Start = 640;
layer3Xpos = layer3Start;
layer3dir = "left";
break;
case 5 :
levelArray = new Array(3, 4, 0, 3, 0, 3, 4, 4, 0, 0, 3, 4, 0, 3, 0, 3, 4, 4, 0, 0);
levelArray.push(11, 2, 0, 10, 0, 5, 11, 0, 11, 2, 0, 10, 0, 5, 11, 0, 11, 2, 0, 10);
levelArray.push(8, 0, 7, 0, 6, 0, 8, 0, 7, 0, 6, 0, 8, 0, 7, 0, 6, 0, 8, 0);
trace("levelArray = " + levelArray.length);
levelTarget = 11000;
layer1Speed = 2;
layer2Speed = 4;
layer3Speed = 8;
layer1Start = 0;
layer1Xpos = layer1Start;
layer1dir = "right";
layer2Start = 0;
layer2Xpos = layer2Start;
layer2dir = "right";
layer3Start = 640;
layer3Xpos = layer3Start;
layer3dir = "left";
break;
}
targetNum = 0;
if (layer1dir == "right") {
addOffset = -layer1Offset;
} else {
addOffset = layer1Offset;
}
i = 0;
while (i < 20) {
if (levelArray[targetNum] > 0) {
layer1.attachMovie("target", "t" + i, i);
eval ("layer1.t" + i).targetType = levelArray[targetNum];
eval ("layer1.t" + i).layerNum = 1;
eval ("layer1.t" + i).x = (i * addOffset) + layer1Start;
eval ("layer1.t" + i)._y = layer1y;
eval ("layer1.t" + i).repeatWidth = 20 * layer1Offset;
eval ("layer1.t" + i).num = targetNum;
eval ("layer1.t" + i).dir = layer1dir;
eval ("layer1.t" + i).speed = layer1Speed;
}
targetNum++;
i++;
}
if (layer2dir == "right") {
addOffset = -layer2Offset;
} else {
addOffset = layer2Offset;
}
i = 0;
while (i < 20) {
if (levelArray[targetNum] > 0) {
layer2.attachMovie("target", "t" + i, i);
eval ("layer2.t" + i).targetType = levelArray[targetNum];
eval ("layer2.t" + i).layerNum = 2;
eval ("layer2.t" + i).x = (i * addOffset) + layer2Start;
eval ("layer2.t" + i)._y = layer2y;
eval ("layer2.t" + i).repeatWidth = 20 * layer2Offset;
eval ("layer2.t" + i).num = targetNum;
eval ("layer2.t" + i).dir = layer2dir;
eval ("layer2.t" + i).speed = layer2Speed;
}
targetNum++;
i++;
}
if (layer3dir == "right") {
addOffset = -layer3Offset;
} else {
addOffset = layer3Offset;
}
i = 0;
while (i < 20) {
if (levelArray[targetNum] > 0) {
layer3.attachMovie("target", "t" + i, i);
eval ("layer3.t" + i).targetType = levelArray[targetNum];
eval ("layer3.t" + i).layerNum = 3;
eval ("layer3.t" + i).x = (i * addOffset) + layer3Start;
eval ("layer3.t" + i)._y = layer3y;
eval ("layer3.t" + i).repeatWidth = 20 * layer3Offset;
eval ("layer3.t" + i).num = targetNum;
eval ("layer3.t" + i).dir = layer3dir;
eval ("layer3.t" + i).speed = layer3Speed;
}
targetNum++;
i++;
}
}
function setup() {
music_snd.stop();
maxBalls = 11;
score = 0;
layer1y = 292;
layer2y = 184;
layer3y = 99;
layer1Offset = 180;
layer2Offset = 120;
layer3Offset = 100;
layer1Distance = 20 * layer1Offset;
layer2Distance = 20 * layer2Offset;
layer3Distance = 20 * layer3Offset;
level = 1;
setupLevel();
onMouseDown = function () {
if (gameState == "playing") {
gameState = "start throw";
}
};
}
function convertToRadians(tempAngle) {
return((tempAngle * Math.PI) / 180);
}
onEnterFrame = function () {
switch (this.gameState) {
case "playing" :
moveAmount = (_root._xmouse - eval ("ballHolder.ball" + uptoBall)._x) / 5;
with (currentBallClip) {
_x = _x + moveAmount;
_y = 425;
}
if (currentBallClip._x < 50) {
currentBallClip._x = 50;
} else if (currentBallClip._x > 590) {
currentBallClip._x = 590;
}
return;
case "start throw" :
switch (random(4)) {
case 0 :
throw1_snd.start();
break;
case 1 :
throw2_snd.start();
break;
case 2 :
throw3_snd.start();
break;
case 3 :
throw4_snd.start();
break;
}
ballX = _root._xmouse;
if (ballX < 50) {
ballX = 50;
} else if (ballX > 590) {
ballX = 590;
}
currentBallClip._x = ballX;
currentBallClip.shadowClip._visible = false;
ballY = 425;
gameState = "throwingBall";
targetY = _root._ymouse;
byspeed = Math.abs((ballY - targetY) / 8);
return;
case "throwingBall" :
ballY = ballY - byspeed;
eval ("ballHolder.ball" + uptoBall)._y = ballY;
currentBallClip._xscale = (currentBallClip._yscale = 50 + Math.abs((ballY / 425) * 50));
if (ballY <= targetY) {
findTarget();
}
return;
case "level complete test" :
if (score > levelTarget) {
gameState = "next level";
} else {
gameState = "game over";
}
nextLvl_snd.start();
return;
case "next level" :
trace(gameState);
level++;
if (level > 5) {
gameState = "game complete";
} else {
gameState = "next level wait";
nlw = 60;
i = 0;
while (i < 20) {
eval ("layer1.t" + i).tarState = "hit";
eval ("layer2.t" + i).tarState = "hit";
eval ("layer3.t" + i).tarState = "hit";
i++;
}
}
return;
case "next level wait" :
nlw--;
if (nlw < 1) {
layer1._alpha = (layer2._alpha = (layer3._alpha = 100));
setupLevel();
gameState = "playing";
} else {
layer1._alpha = layer1._alpha - 2;
layer2._alpha = layer2._alpha - 2;
layer3._alpha = layer3._alpha - 2;
}
return;
case "setup" :
setup();
gameState = "playing";
return;
case "game over" :
gameOver_snd.start();
gameState = "game over wait";
ballHolder.attachMovie("tellPlayer", "tellPlayer", 1000);
ballHolder.tellPlayer._x = 320;
ballHolder.tellPlayer._y = 240;
ballHolder.tellPlayer.tell.text = "Game Over ";
gow = 60;
trace(gameState);
return;
case "game over wait" :
gow--;
if (gow < 1) {
gotoAndPlay (27);
delete onEnterFrame;
}
return;
case "game complete" :
trace(gameState);
gotoAndPlay (37);
delete onEnterFrame;
return;
}
};
function hitTarget(temp, tx, ty) {
switch (levelArray[temp]) {
case 1 :
hitScore = 50;
score1_snd.start();
break;
case 2 :
hitScore = 300;
score2_snd.start();
break;
case 3 :
hitScore = 300;
score3_snd.start();
break;
case 4 :
hitScore = 100;
score4_snd.start();
break;
case 5 :
hitScore = 75;
score1_snd.start();
break;
case 6 :
hitScore = 100;
score2_snd.start();
break;
case 7 :
hitScore = 225;
score3_snd.start();
break;
case 8 :
hitScore = 250;
score4_snd.start();
break;
case 9 :
hitScore = 400;
score1_snd.start();
break;
case 10 :
hitScore = 25;
score2_snd.start();
break;
case 11 :
hitScore = 25;
score3_snd.start();
break;
default :
hitScore = 25;
score4_snd.start();
}
score = score + hitScore;
if ((score >= levelTarget) && (!tarRch)) {
targetReached_snd.start();
targetClip.gotoAndStop(2);
tarRch = true;
}
ballHolder.attachMovie("hitSplash", "hitSplash", 299);
ballHolder.hitSplash._x = tx;
ballHolder.hitSplash._y = ty;
trace(ballHolder.hitSplash._y);
ballHolder.attachMovie("pointsClip", "pointsClip", 300);
ballHolder.pointsClip._x = tx;
ballHolder.pointsClip._y = ty;
ballHolder.pointsClip.pts.text = hitScore;
}
Frame 26
stop();
this.gameState = "setup";
Frame 27
function goMain() {
gotoAndPlay (7);
}
delete gameState;
music_snd.stop();
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
storage.flush();
}
if (score >= 1000) {
enterHigh._visible = true;
} else {
enterHigh._visible = false;
}
Frame 36
stop();
Frame 37
function goMain() {
gotoAndPlay (7);
}
delete gameState;
music_snd.stop();
if (score > yourhigh) {
yourhigh = score;
topshotStorage.data.myhighscore = score;
}
if (gameLocation == legalDomain) {
enterHigh._visible = true;
} else {
enterHigh._visible = false;
}
gameComplete_snd.start();
Frame 46
stop();
Symbol 373 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 374 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 375 MovieClip [__Packages.hitSplashClass] Frame 0
class hitSplashClass extends MovieClip
{
var cacheAsBitmap, num, dir, _xscale, _yscale, removeMovieClip, _alpha, _rotation;
function hitSplashClass () {
super();
}
function onLoad() {
cacheAsBitmap = true;
num = 15;
dir = random(6) - 3;
_xscale = (_yscale = 70);
}
function onEnterFrame() {
num--;
if (num < 1) {
removeMovieClip();
}
_xscale = (_yscale = _yscale * 1.1);
_alpha = _alpha * 0.85;
_rotation = _rotation + dir;
}
}
Symbol 376 MovieClip [__Packages.ballClass] Frame 0
class ballClass extends MovieClip
{
var fallSpeed, tarState, _y, removeMovieClip;
function ballClass () {
super();
}
function onLoad() {
fallSpeed = 2;
}
function onEnterFrame() {
switch (tarState) {
case "normal" :
break;
case "fall" :
_y = _y + fallSpeed;
fallSpeed = fallSpeed * 1.3;
if (fallSpeed > 24) {
removeMovieClip();
}
break;
default :
tarState = "normal";
}
}
}
Symbol 377 MovieClip [__Packages.pointsClipClass] Frame 0
class pointsClipClass extends MovieClip
{
var cacheAsBitmap, speed, angle, range, ySpeed, centerY, _x, _y, _xscale, _yscale, _alpha, removeMovieClip;
function pointsClipClass () {
super();
}
function onLoad() {
cacheAsBitmap = true;
speed = 0.75;
angle = 0;
range = 20;
ySpeed = 0.25;
centerY = _x;
}
function onEnterFrame() {
_x = centerY + (Math.sin(angle) * range);
angle = angle + ySpeed;
_y = _y - speed;
speed = speed * 1.05;
_xscale = (_yscale = _yscale - 1);
_alpha = _alpha - 2;
if (_alpha < 10) {
removeMovieClip();
}
}
}
Symbol 378 MovieClip [__Packages.tellPlayerClass] Frame 0
class tellPlayerClass extends MovieClip
{
var cacheAsBitmap, wait, dir, _alpha, removeMovieClip;
function tellPlayerClass () {
super();
}
function onLoad() {
cacheAsBitmap = true;
wait = 50;
dir = true;
_alpha = 0;
}
function onEnterFrame() {
if (dir) {
_alpha = _alpha + 5;
if (_alpha >= 100) {
_alpha = 100;
dir = false;
}
} else {
_alpha = _alpha - 2;
if (_alpha < 1) {
removeMovieClip();
}
}
}
}
Symbol 379 MovieClip [__Packages.targetClass] Frame 0
class targetClass extends MovieClip
{
var gotoAndStop, targetType, dodgeMax, dodgeCount, returnMax, returnCount, dodgeWaitMax, dodgeWait, angle, range, ySpeed, centerY, _y, tarState, dir, x, speed, repeatWidth, y, _x;
function targetClass () {
super();
}
function onLoad() {
gotoAndStop(targetType);
dodgeMax = 50 + random(50);
dodgeCount = dodgeMax;
returnMax = 6;
returnCount = returnMax;
dodgeWaitMax = 20 + random(20);
dodgeWait = dodgeWaitMax;
angle = random(360);
range = 40;
ySpeed = 0.075;
centerY = _y + 30;
}
function onEnterFrame() {
if ((_root.gameState != "setup") || (_root.gameState != "game over")) {
switch (tarState) {
case "normal" :
if (((((targetType != 2) && (targetType != 7)) && (targetType != 8)) && (targetType != 9)) && (targetType != 11)) {
dodgeCount--;
if (dodgeCount < 1) {
dodgeCount = dodgeMax;
tarState = "dodge wait";
gotoAndStop(targetType + 40);
}
}
break;
case "hit" :
gotoAndStop(targetType + 20);
tarState = "dead";
break;
case "dodge wait" :
dodgeWait--;
if (dodgeWait < 1) {
dodgeWait = dodgeWaitMax;
gotoAndStop(targetType + 60);
tarState = "return wait";
}
break;
case "return wait" :
returnCount--;
if (returnCount < 1) {
returnCount = returnMax;
gotoAndStop(targetType);
tarState = "normal";
}
break;
case "dead" :
break;
default :
tarState = "normal";
}
if (dir == "right") {
x = x + speed;
if (x > 700) {
x = x - repeatWidth;
}
} else if (dir == "left") {
x = x - speed;
if (x < -40) {
x = x + repeatWidth;
}
}
if ((((targetType == 2) || (targetType == 7)) || (targetType == 8)) || (targetType == 9)) {
y = centerY + (Math.sin(angle) * range);
_y = y;
angle = angle + ySpeed;
}
_x = x;
}
}
}
Symbol 380 MovieClip [__Packages.msightClass] Frame 0
class msightClass extends MovieClip
{
var exit, _x, _parent, _y, gotoAndPlay;
function msightClass () {
super();
}
function onLoad() {
exit = false;
}
function onEnterFrame() {
_x = _parent._xmouse;
_y = _parent._ymouse;
if ((_root.gameState == "level complete test") && (!exit)) {
gotoAndPlay(11);
exit = true;
}
}
}
Symbol 13 MovieClip [letter] Frame 1
#initclip 9
Object.registerClass("letter", letterClass);
#endinitclip
Symbol 55 MovieClip Frame 10
stop();
Symbol 74 MovieClip Frame 10
stop();
Symbol 93 MovieClip Frame 10
stop();
Symbol 112 MovieClip Frame 10
stop();
Symbol 131 MovieClip Frame 10
stop();
Symbol 150 MovieClip Frame 10
stop();
Symbol 161 MovieClip Frame 5
stop();
Symbol 172 MovieClip Frame 5
stop();
Symbol 183 MovieClip Frame 5
stop();
Symbol 194 MovieClip Frame 5
stop();
Symbol 205 MovieClip Frame 5
stop();
Symbol 216 MovieClip Frame 5
stop();
Symbol 217 MovieClip Frame 5
stop();
Symbol 218 MovieClip Frame 5
stop();
Symbol 219 MovieClip Frame 5
stop();
Symbol 220 MovieClip Frame 5
stop();
Symbol 221 MovieClip Frame 5
stop();
Symbol 222 MovieClip Frame 5
stop();
Symbol 223 MovieClip [target] Frame 1
#initclip 14
Object.registerClass("target", targetClass);
#endinitclip
Symbol 225 MovieClip [hitSplash] Frame 1
#initclip 10
Object.registerClass("hitSplash", hitSplashClass);
#endinitclip
Symbol 250 MovieClip [ball] Frame 1
#initclip 11
Object.registerClass("ball", ballClass);
#endinitclip
Symbol 253 MovieClip [pointsClip] Frame 1
#initclip 12
Object.registerClass("pointsClip", pointsClipClass);
#endinitclip
Symbol 256 MovieClip [tellPlayer] Frame 1
#initclip 13
Object.registerClass("tellPlayer", tellPlayerClass);
#endinitclip
Symbol 272 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 1
_root.stop();
Symbol 278 MovieClip Frame 75
_root.play();
Symbol 305 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 323 MovieClip Frame 1
stop();
Symbol 349 MovieClip [mSight] Frame 1
#initclip 15
Object.registerClass("mSight", msightClass);
#endinitclip
stop();
Symbol 349 MovieClip [mSight] Frame 10
stop();
Symbol 349 MovieClip [mSight] Frame 20
stop();
Symbol 367 Button
on (release) {
_root.goMain();
}