Frame 1
Security.allowDomain("*");
MochiAd.showPreGameAd({id:"c9d001e1472c7b27", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
versionNum = "JUMBLE 1.05";
this._lockroot = true;
_root.gameName = "jumble";
_root.authorsSite = "http://www.terrypaton.com";
legalDomain = "http://www.terrypaton.com";
_root.flashVersionsNeeded = 8;
_root.gameLocation = _root._url.substr(0, legalDomain.length);
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem(_root.authorsSite, gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
this.createEmptyMovieClip("ob", 1);
ob.lineStyle(1, 0, 100);
ob.lineTo(240, 0);
ob.lineTo(240, 20);
ob.lineTo(0, 20);
ob.lineTo(0, 0);
ob.endFill();
ob._x = 200;
ob._y = 220;
this.createEmptyMovieClip("iB", 2);
iB.beginFill(0, 30);
iB.lineTo(233, 0);
iB.lineTo(233, 15);
iB.lineTo(0, 15);
iB.endFill();
iB._x = 204;
iB._y = 223;
var mf = new TextFormat();
mf.bold = true;
mf.font = "Arial";
mf.size = 14;
mf.align = "center";
mf.color = 0;
this.createTextField("lT", 5000, 0, 0, 640, 32);
lT.setNewTextFormat(mf);
lT.selectable = false;
lT.text = "LOADING...";
lT._x = 0;
lT._y = 240;
iB.onLoad = function () {
};
iB.onEnterFrame = function () {
pL = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (pL < 100) {
this._xscale = pL;
_root.stop();
} else {
removeMovieClip(this._parent.ob);
removeMovieClip(this._parent.lT);
removeMovieClip(this);
_root.play();
}
};
Frame 5
Frame 6
function goLink(link) {
trace(link);
switch (link) {
case "GAME" :
gotoAndPlay (16);
break;
case "HOW TO PLAY" :
gotoAndPlay (31);
break;
case "INTRO" :
gotoAndPlay (6);
break;
case "RESTART" :
restartGame();
break;
case "SOLVE" :
showAnswers();
break;
}
}
function playGame() {
gotoAndPlay (16);
}
function mainMenu() {
gotoAndPlay (6);
}
function howToPlay() {
gotoAndPlay (31);
}
function restartGame() {
delete gameState;
removeAllClips();
gotoAndPlay (16);
white.gotoAndPlay(1);
}
function removeAllClips() {
theWordList.lines.clear();
wordList.lines.clear();
i = 0;
while (i < 100) {
removeMovieClip(eval ("board.lines.circle" + i));
i++;
}
}
delete gameState;
howtoplayBtn.link = "HOW TO PLAY";
playBtn.link = "GAME";
Frame 15
stop();
Frame 16
function cheat() {
trace("CHEAT");
var _local3 = 0;
while (_local3 < boardSize) {
var _local1 = 0;
while (_local1 < boardSize) {
var _local2 = (("letter" + _local3) + "_") + _local1;
if (board[_local2].dummy) {
board[_local2]._alpha = 30;
}
_local1++;
}
_local3++;
}
}
function frameAction() {
switch (gameState) {
case "SETUP" :
trace(gameState);
setup();
gameState = "PLAYING";
return;
case "PLAYING" :
return;
case "SOLVED" :
return;
case "GAME COMPLETE" :
congratulations.gotoAndPlay(2);
showAnswers();
gCount = 70;
gameState = "GAME COMPLETE WAIT";
return;
case "GAME COMPLETE WAIT" :
gCount--;
if (gCount < 1) {
gotoAndPlay (42);
}
return;
case "" :
return;
default :
gameState = "SETUP";
}
}
function selected(downX, downY, upX, upY) {
var _local12 = Math.floor(downX / gridSpacing);
var _local11 = Math.floor(downY / gridSpacing);
var _local14 = Math.floor(upX / gridSpacing);
var _local13 = Math.floor(upY / gridSpacing);
var _local2 = "";
if (_local11 == _local13) {
if (_local14 > _local12) {
var _local1 = _local12;
while (_local1 <= _local14) {
_local2 = _local2 + words.letters[_local1][_local11];
_local1++;
}
} else if (_local12 > _local14) {
var _local1 = _local14;
while (_local1 <= _local12) {
_local2 = _local2 + words.letters[_local1][_local11];
_local1++;
}
}
} else if (_local12 == _local14) {
if (_local13 > _local11) {
var _local1 = _local11;
while (_local1 <= _local13) {
_local2 = _local2 + words.letters[_local12][_local1];
_local1++;
}
} else if (_local11 > _local13) {
var _local1 = _local13;
while (_local1 <= _local11) {
_local2 = _local2 + words.letters[_local12][_local1];
_local1++;
}
}
} else if (((_local12 != _local14) && (_local11 != _local13)) && (Math.abs(_local12 - _local14) == Math.abs(_local11 - _local13))) {
var _local4 = (_local14 - _local12) / Math.abs(_local14 - _local12);
var _local5 = (_local13 - _local11) / Math.abs(_local13 - _local11);
var _local6 = Math.abs(_local14 - _local12);
var _local1 = 0;
while (_local1 <= _local6) {
_local2 = _local2 + words.letters[_local12 + (_local4 * _local1)][_local11 + (_local5 * _local1)];
_local1++;
}
}
if (_local2 != "") {
if (checkList(_local2)) {
_local12 = (_local12 * gridSpacing) + (gridSpacing / 2);
_local14 = (_local14 * gridSpacing) + (gridSpacing / 2);
_local11 = (_local11 * gridSpacing) + (gridSpacing / 2);
_local13 = (_local13 * gridSpacing) + (gridSpacing / 2);
var _local9 = _local13 - _local11;
var _local7 = _local14 - _local12;
var _local15 = (Math.atan2(_local9, _local7) * 180) / Math.PI;
var _local8 = Math.sqrt((_local9 * _local9) + (_local7 * _local7));
var _local10 = "circle" + (++board.circles);
board.lines.attachMovie("wordFound", _local10, ++board.depth);
var _local3 = board.lines[_local10];
trace(_local3);
trace(_local3);
_local3._x = _local12;
_local3._y = _local11;
_local3._rotation = _local15;
_local3.right._x = _local8;
_local3.lineStyle(4, 16711680, 30);
_local3.moveTo(0, 13);
_local3.lineTo(_local8, 13);
_local3.moveTo(0, -13);
_local3.lineTo(_local8, -13);
displayList();
}
}
}
function setup() {
restartBtn.restartHighlight._visible = false;
removeAllClips();
switch (random(4)) {
case 0 :
mywords = new Array("ENGINE", "PEDAL", "WHEEL", "ROUTE", "FINISH", "PETROL", "GAS", "STEER", "RUBBER", "DRIVE", "JAGUAR");
break;
case 1 :
mywords = new Array("PIZZA", "TOMATO", "PEPPER", "SALAMI", "ONION", "FLOUR", "DOUGH", "CHEESE", "OLIVES");
break;
case 2 :
mywords = new Array("WARCRAFT", "ORC", "DRUID", "NIGHTELF", "SPELLS", "KALIMDOR", "PEON", "WOW", "CHAOS", "UNDEAD");
break;
case 3 :
mywords = new Array("VANGOGH", "DAVINCI", "POLLOCK", "MONET", "MANET", "RUBIN", "DURER", "HANSEL", "PICASSO", "RUSSELL", "HAACKE");
break;
default :
mywords = new Array("FREAK", "SPAM", "INSANE", "NUTTY", "CRAZY", "FUNK", "QUAKE", "ELDER", "FABLE");
}
wordTarget = mywords.length;
boardSize = 13;
words = new Object();
words.lists = new Array();
scrambleWords();
if (scrambledOk) {
trace("words scrambled ok");
generating._visible = false;
displayList();
createBoard();
} else {
var _local1 = 0;
while (_local1 <= board.circles) {
board["circle" + _local1].removeMovieClip();
_local1++;
}
restartGame();
}
}
function displayList() {
trace("display list");
wordFoundCount = 0;
var _local3 = "";
var _local1 = 0;
while (_local1 < mywords.length) {
var _local2 = mywords[_local1];
if (!words.listings[_local1].found) {
} else {
wordFoundCount++;
y = 33 + (_local1 * 26.2);
theWordList.lines.lineStyle(6, 16711680, 100);
theWordList.lines.moveTo(0, y);
theWordList.lines.lineTo(150, y);
}
_local1++;
}
if (wordFoundCount >= wordTarget) {
trace("all words found");
gameState = "GAME COMPLETE";
}
displaywordList = "";
_local1 = 0;
while (_local1 < mywords.length) {
displaywordList = displaywordList + (mywords[_local1] + newline);
_local1++;
}
theWordList.mywordsList.text = displaywordList;
trace("display list");
}
function showAnswers() {
restartBtn.restartHighlight._visible = true;
var _local3 = 0;
while (_local3 < boardSize) {
var _local1 = 0;
while (_local1 < boardSize) {
var _local2 = (("letter" + _local3) + "_") + _local1;
if (board[_local2].dummy) {
board[_local2]._visible = false;
gameState = "SOLVED";
}
_local1++;
}
_local3++;
}
}
function checkList(tempWord) {
var _local4 = wordReverse(tempWord);
var _local3 = false;
var _local1 = 0;
while (_local1 < words.listings.length) {
var _local2 = words.listings[_local1].word;
if (((tempWord == _local2) || (_local4 == _local2)) && (!words.listings[_local1].found)) {
words.listings[_local1].found = true;
_local3 = true;
}
_local1++;
}
return(_local3);
}
function scrambleWords() {
trace("scramble");
var _local6 = getTimer();
var _local5 = 3000;
scrambledOk = true;
words.letters = new Array();
words.listings = new Array();
var _local15 = ["horizontal", "vertical", "diagonal"];
var _local16 = ["forward", "backward"];
var _local13 = 0;
while (_local13 < boardSize) {
words.letters[_local13] = new Array();
_local13++;
}
_local13 = 0;
while (_local13 < mywords.length) {
var _local12 = _local15[random(_local15.length)];
var _local14 = _local16[random(_local16.length)];
var _local4 = mywords[_local13].toUpperCase();
var _local2 = _local4.length;
words.listings.push({word:_local4, direction:_local14, alignment:_local12});
if (_local14 == "backward") {
_local4 = wordReverse(_local4);
}
if (_local12 == "horizontal") {
var _local10 = true;
while (_local10) {
var _local7 = random(boardSize);
var _local8 = random(boardSize - _local2);
_local10 = false;
var _local3 = _local8;
while (_local3 < (_local8 + _local2)) {
var _local11 = _local4.substr(_local3 - _local8, 1);
if ((words.letters[_local3][_local7] != undefined) && (words.letters[_local3][_local7] != _local11)) {
_local10 = true;
break;
}
if ((getTimer() - _local6) > _local5) {
scrambledOk = false;
return(undefined);
}
_local3++;
}
if (!_local10) {
_local3 = _local8;
while (_local3 < (_local8 + _local2)) {
words.letters[_local3][_local7] = _local4.substr(_local3 - _local8, 1);
if ((getTimer() - _local6) > _local5) {
scrambledOk = false;
return(undefined);
}
_local3++;
}
}
}
} else if (_local12 == "vertical") {
var _local10 = true;
while (_local10) {
var _local9 = random(boardSize);
var _local1 = random(boardSize - _local2);
_local10 = false;
var _local3 = _local1;
while (_local3 < (_local1 + _local2)) {
var _local11 = _local4.substr(_local3 - _local1, 1);
if ((words.letters[_local9][_local3] != undefined) && (words.letters[_local9][_local3] != _local11)) {
_local10 = true;
break;
}
if ((getTimer() - _local6) > _local5) {
scrambledOk = false;
return(undefined);
}
_local3++;
}
if (!_local10) {
_local3 = _local1;
while (_local3 < (_local1 + _local2)) {
words.letters[_local9][_local3] = _local4.substr(_local3 - _local1, 1);
if ((getTimer() - _local6) > _local5) {
scrambledOk = false;
return(undefined);
}
_local3++;
}
}
}
} else if (_local12 == "diagonal") {
var _local10 = true;
while (_local10) {
var _local1 = random(boardSize - _local2);
var _local8 = random(boardSize - _local2);
_local10 = false;
var _local3 = _local1;
while (_local3 < (_local1 + _local2)) {
var _local11 = _local4.substr(_local3 - _local1, 1);
if ((words.letters[_local8 + (_local3 - _local1)][_local3] != undefined) && (words.letters[_local8 + (_local3 - _local1)][_local3] != _local11)) {
_local10 = true;
break;
}
if ((getTimer() - _local6) > _local5) {
scrambledOk = false;
return(undefined);
}
_local3++;
}
if (!_local10) {
_local3 = _local1;
while (_local3 < (_local1 + _local2)) {
words.letters[_local8 + (_local3 - _local1)][_local3] = _local4.substr(_local3 - _local1, 1);
if ((getTimer() - _local6) > _local5) {
scrambledOk = false;
return(undefined);
}
_local3++;
}
}
}
}
_local13++;
}
}
function wordReverse(item) {
var _local3 = "";
var _local1 = 0;
while (_local1 < item.length) {
_local3 = _local3 + item.substr((item.length - 1) - _local1, 1);
_local1++;
}
return(_local3);
}
function createBoard() {
trace("create board");
path = board;
path.depth = 0;
path.circles = 0;
gridSpacing = 27;
trace(boardSize);
var _local4 = 0;
while (_local4 < boardSize) {
var _local1 = 0;
while (_local1 < boardSize) {
var _local3 = (("letter" + _local4) + "_") + _local1;
path.attachMovie("letter", _local3, ++path.depth);
path[_local3]._x = _local4 * gridSpacing;
path[_local3]._y = _local1 * gridSpacing;
var _local2 = words.letters[_local4][_local1].toUpperCase();
if ((_local2 == undefined) || (_local2 == "")) {
_local2 = chr(random(26) + 65);
words.letters[_local4][_local1] = _local2;
path[_local3].dummy = true;
}
path[_local3].letter.text = _local2;
_local1++;
}
_local4++;
}
}
restartBtn.link = "RESTART";
solveBtn.link = "SOLVE";
menuBtn.link = "INTRO";
MouseState = new Object();
_root.onMouseDown = function () {
if (board.hitTest(_root._xmouse, _root._ymouse)) {
MouseState.isDown = true;
circler.checkOnOffStatus();
}
};
_root.onMouseUp = function () {
MouseState.isDown = false;
circler.off();
};
Instance of Symbol 61 MovieClip [Circler] "circler" in Frame 16
onClipEvent (load) {
function draw() {
trace(_parent.gameState);
if (_parent.gameState != "SOLVED") {
if (!showing) {
downX = _root.board._xmouse;
downY = _root.board._ymouse;
}
showing = true;
updateAfterEvent();
this._visible = true;
this.clear();
this.lineStyle(2, 153, 100);
var _local8 = _root._xmouse;
var _local7 = _root._ymouse;
var _local6 = _local7 - this._y;
var _local4 = _local8 - this._x;
var _local9 = (Math.atan2(_local6, _local4) * 180) / Math.PI;
var _local5 = Math.sqrt((_local6 * _local6) + (_local4 * _local4));
this._rotation = _local9;
this.right._x = _local5;
this.moveTo(0, 13);
this.lineTo(_local5, 13);
this.moveTo(0, -13);
this.lineTo(_local5, -13);
}
}
function off() {
showing = false;
this._visible = false;
}
function checkOnOffStatus() {
if (_root.MouseState.isDown) {
draw();
} else {
off();
}
}
function moveMe() {
var _local4 = (_root.board._x + (Math.floor(_root.board._xmouse / _root.gridSpacing) * _root.gridSpacing)) + (_root.gridSpacing / 2);
var _local3 = (_root.board._y + (Math.floor(_root.board._ymouse / _root.gridSpacing) * _root.gridSpacing)) + (_root.gridSpacing / 2);
this._x = _local4;
this._y = _local3;
}
this.swapDepths(200);
}
onClipEvent (mouseMove) {
checkOnOffStatus();
}
onClipEvent (mouseDown) {
moveMe();
}
onClipEvent (mouseUp) {
if (showing) {
upX = _root.board._xmouse;
upY = _root.board._ymouse;
_root.selected(downX, downY, upX, upY);
}
}
Instance of Symbol 76 MovieClip in Frame 19
onClipEvent (enterFrame) {
_parent.frameAction();
}
Frame 19
if (false) {
}
Frame 30
stop();
Frame 31
menuBtn.link = "INTRO";
Frame 40
stop();
Frame 41
gotoAndPlay (6);
Frame 42
menuBtn.link = "INTRO";
playAgainBtn.link = "RESTART";
Frame 49
stop();
Symbol 87 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 88 MovieClip [__Packages.bounceBtnClass] Frame 0
class bounceBtnClass extends MovieClip
{
var angle, bState, high, _height, wide, _width, _xmouse, _ymouse, _parent, link, _xscale, _yscale, _rotation;
function bounceBtnClass () {
super();
}
function onLoad() {
angle = 0;
bState = false;
high = (_height + 20) / 2;
wide = (_width + 20) / 2;
}
function onRollOver() {
bState = true;
}
function onRollOut() {
bState = false;
}
function onMouseDown() {
if ((((_xmouse > (-wide)) && (_xmouse < wide)) && (_ymouse > (-high))) && (_ymouse < high)) {
_parent.goLink(link);
}
}
function onEnterFrame() {
if ((((_xmouse > (-wide)) && (_xmouse < wide)) && (_ymouse > (-high))) && (_ymouse < high)) {
_xscale = (_yscale = 100 + (Math.sin(angle) * 20));
_rotation = Math.sin(angle) * 20;
angle = angle + 0.1;
} else {
if (_xscale < 99) {
_xscale = _yscale++;
}
if (_xscale > 101) {
_xscale = _yscale--;
}
if (_rotation > 0) {
_rotation--;
}
if (_rotation < 0) {
_rotation++;
}
angle = 0;
}
}
}
Symbol 8 MovieClip Frame 1
stop();
Symbol 16 MovieClip Frame 1
_root.stop();
Symbol 16 MovieClip Frame 117
_root.play();
Symbol 23 MovieClip [playButton] Frame 1
#initclip 4
Object.registerClass("playButton", bounceBtnClass);
#endinitclip
Symbol 25 MovieClip [howtoplay] Frame 1
#initclip 3
Object.registerClass("howtoplay", bounceBtnClass);
#endinitclip
Symbol 34 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 35 MovieClip Frame 25
stop();
Symbol 50 MovieClip [mainMenu_clip] Frame 1
#initclip 7
Object.registerClass("mainMenu_clip", bounceBtnClass);
#endinitclip
Symbol 54 MovieClip [RESTART_clip] Frame 1
#initclip 5
Object.registerClass("RESTART_clip", bounceBtnClass);
#endinitclip
Symbol 56 MovieClip [SHOW ANSWERS_clip] Frame 1
#initclip 6
Object.registerClass("SHOW ANSWERS_clip", bounceBtnClass);
#endinitclip
Symbol 58 Button
on (release) {
_root.cheat();
}
Symbol 72 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 65
stop();
Symbol 84 MovieClip [playAgain_clip] Frame 1
#initclip 8
Object.registerClass("playAgain_clip", bounceBtnClass);
#endinitclip