Frame 1
Security.allowDomain("*");
MochiAd.showPreGameAd({id:"dd5c5f98b5c1ba66", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
this._lockroot = true;
var gameName = "crystalMines";
vNum = "1.01";
gameQuality = "AUTO";
_quality = "HIGH";
authorsSite = "http://www.terrypaton.com";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem(authorsSite, gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
legalDomain = "http://www.terrypaton.com";
gameLocation = _root._url.substr(0, legalDomain.length);
if (gameLocation != legalDomain) {
}
Frame 3
gameLoadingName = "crystal mines";
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();
}
};
stringLength = gameLoadingName.length;
wordOffset = (stringLength * 10) / 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 * 10;
t.angle = i;
t.Lvar.text = gameLoadingName.charAt(i);
t._xscale = (t._yscale = 200);
i++;
}
stop();
Frame 6
function playSound(temp) {
switch (temp) {
case "start level" :
startLevelSnd.start();
break;
case "chest" :
chestSnd.start();
break;
case "no" :
noSnd.start();
break;
case "tell player" :
tellPlayerSnd.start();
break;
case "dirt" :
dirtSnd.start();
break;
case "bonus" :
bonusSnd.start();
break;
case "points" :
pointsSnd.start();
break;
case "level complete" :
levelComplete1Snd.start();
break;
case "push boulder" :
pushBoulderSnd.start();
break;
case "move" :
move1Snd.start();
break;
case "move object" :
moveObject1Snd.start();
break;
case "mouseOver" :
mouseOverSnd.start();
break;
case "mouseDown" :
mouseDownSnd.start();
break;
case "bonus collected" :
bonusCollectedSnd.start();
}
}
function attachSoundFromLibrary(idname) {
var _local2 = new Sound(this);
_local2.attachSound(idname);
return(_local2);
}
storage = SharedObject.getLocal(gameName + "storage");
yourhigh = storage.data.myhighscore;
if (yourhigh == undefined) {
storage.data.myhighscore = 0;
yourhigh = 0;
}
mouseOverSnd = attachSoundFromLibrary("mouseOver.wav");
mouseDownSnd = attachSoundFromLibrary("mouseDownSnd.wav");
pointsSnd = attachSoundFromLibrary("pointsSnd.wav");
tellPlayerSnd = attachSoundFromLibrary("tellPlayer.wav");
pushBoulderSnd = attachSoundFromLibrary("pushBoulder.wav");
pointsSnd = attachSoundFromLibrary("points.wav");
energySnd = attachSoundFromLibrary("energySnd.wav");
dirtSnd = attachSoundFromLibrary("dirt.wav");
move1Snd = attachSoundFromLibrary("move1.wav");
levelComplete1Snd = attachSoundFromLibrary("levelComplete1.wav");
levelComplete2Snd = attachSoundFromLibrary("levelComplete2.wav");
levelComplete3Snd = attachSoundFromLibrary("levelComplete3.wav");
moveObject1Snd = attachSoundFromLibrary("moveObject1.wav");
bonusSnd = attachSoundFromLibrary("bonus.wav");
noSnd = attachSoundFromLibrary("no.wav");
startLevelSnd = attachSoundFromLibrary("startLevel.wav");
chestSnd = attachSoundFromLibrary("chest.wav");
bonusCollectedSnd = attachSoundFromLibrary("bonusCollected.wav");
Frame 7
_quality = "HIGH";
this.playBtn.onRelease = function () {
gotoAndPlay (23);
playSound("mouseDown");
};
this.playBtn.onRollOver = function () {
playSound("mouseOver");
};
this.yourHighClip.reset_btn.onRelease = function () {
playSound("mouseDown");
_root.yourhigh = 0;
trace(yourhigh);
yourHighClip.resetclip.gotoAndPlay(2);
storage.data.myhighscore = 0;
storage.flush();
};
this.yourHighClip.reset_btn.onRollOver = function () {
playSound("mouseOver");
};
Frame 22
stop();
Frame 23
function updateStopWatch() {
bonusTime--;
if (bonusTime > 0) {
bonusTimeRotation = (360 - ((bonusTime / maxbonusTime) * 360)) - 90;
stopWatch.hand._rotation = bonusTimeRotation;
}
}
function addPointsClip(tClip, tVal) {
playSound("points");
tz = holder.getNextHighestDepth();
apt = holder.attachMovie("pointsClip", "pts" + tz, tz);
apt._x = tClip._x;
apt._y = tClip._y;
apt.textBox.text = tVal;
apt.theTween = new mx.transitions.Tween(apt, "_y", mx.transitions.easing.Regular.easeIn, apt._y - 20, apt._y - 40, 1, true);
new mx.transitions.Tween(apt, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, 1, true);
apt.theTween.clipName = apt;
apt.theTween.onMotionFinished = function () {
removeMovieClip(this.clipName);
};
score = score + tVal;
}
function startPlay() {
levelCodeArray = new Array("one", "bing", "bong", "the", "witch", "is", "dead", "terry", "paton", "made", "this", "game", "ihope", "you", "like", "it", "fee", "fie", "fow", "fum");
codeText = chooseCharacter.levelCodeBox.text;
if (codeText != "-") {
i = 0;
while (i < levelCodeArray.length) {
if (levelCodeArray[i] == codeText) {
level = i + 1;
}
i++;
}
}
ccTween = new mx.transitions.Tween(chooseCharacter, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 0.75, true);
ccTween.clipName = chooseCharacter;
ccTween.onMotionFinished = function () {
removeMovieClip(this.clipName);
};
spCount = 5;
gameState = "start play wait";
}
function changeCharacter() {
if (playerType == 1) {
playerType = 2;
} else {
playerType = 1;
}
if (playerType == 1) {
new mx.transitions.Tween(chooseCharacter.characterSelected, "_x", mx.transitions.easing.Strong.easeOut, -16, -113.8, 0.25, true);
} else {
new mx.transitions.Tween(chooseCharacter.characterSelected, "_x", mx.transitions.easing.Strong.easeOut, -113.8, -16, 0.25, true);
}
}
function fadeClip(fadeClipName) {
fadeTween = new mx.transitions.Tween(fadeClipName, "_alpha", mx.transitions.easing.Regular.easeOut, 100, 0, 0.5, true);
fadeTween.clipName = fadeClipName;
fadeTween.onMotionFinished = function () {
removeMovieClip(this.clipName);
};
}
function moveObject(moveObject, tx, ty, tmovex, tmovey) {
new mx.transitions.Tween(moveObject, "_x", mx.transitions.easing.Regular.easeOut, tx, tmovex, 0.25, true);
new mx.transitions.Tween(moveObject, "_y", mx.transitions.easing.Regular.easeOut, ty, tmovey, 0.25, true);
}
function clearPosition(tx, ty) {
levelData[ty][tx][0] = 1;
levelData[ty][tx][1] = "";
}
function setPosition(tx, ty, setClipType, setClipName) {
trace((((("set position " + tx) + " ") + ty) + " ") + setClipType);
levelData[ty][tx][0] = setClipType;
levelData[ty][tx][1] = setClipName;
}
function setGemInPosition(tx, ty) {
levelData[ty][tx][0] = levelData[ty][tx][0] + 10;
solvedGem = levelData[ty][tx][1];
solvedGem.clip.gotoAndStop(2);
new mx.transitions.Tween(solvedGem, "_yscale", mx.transitions.easing.Strong.easeIn, 100, 10, 1, true);
solvedGemTween = new mx.transitions.Tween(solvedGem, "_alpha", mx.transitions.easing.Strong.easeIn, 100, 0, 1, true);
solvedGemTween.clipName = solvedGem;
solvedGemTween.onMotionFinished = function () {
this.clipName.gemSolved();
};
requiredLevelGems--;
if (requiredLevelGems < 1) {
trace("exit unlocked");
openExit();
}
}
function keyFunc() {
if (Key.isDown(39)) {
lastPressed = "right";
if (playerX < gridWidth) {
testPlayerMove(1, 0);
}
}
if (Key.isDown(37)) {
lastPressed = "left";
if (playerX > 0) {
testPlayerMove(-1, 0);
}
}
if (Key.isDown(40)) {
lastPressed = "down";
if (playerY < gridHeight) {
testPlayerMove(0, 1);
}
}
if (Key.isDown(38)) {
lastPressed = "up";
if (playerY > 0) {
testPlayerMove(0, -1);
}
}
}
function testPlayerMove(moveXDir, moveYDir) {
hitObject = levelData[playerY + moveYDir][playerX + moveXDir][0];
trace("hitObject = " + hitObject);
if ((hitObject == 1) || (hitObject == 40)) {
playSound("move");
oldX = playerX;
oldY = playerY;
playerX = playerX + moveXDir;
playerY = playerY + moveYDir;
new mx.transitions.Tween(player, "_x", mx.transitions.easing.Regular.easeOut, findX(oldX), findX(playerX), 0.15, true);
playerYTween = new mx.transitions.Tween(player, "_y", mx.transitions.easing.Regular.easeOut, findY(oldY), findY(playerY), 0.15, true);
playerYTween.onMotionFinished = function () {
_root.playerPushing = false;
};
gameState = "move player";
if (playerPushing) {
if (moveXDir == -1) {
player.gotoAndStop(8);
} else if (moveXDir == 1) {
player.gotoAndStop(6);
} else if (moveYDir == -1) {
player.gotoAndStop(9);
} else if (moveYDir == 1) {
player.gotoAndStop(7);
}
} else if (moveXDir == -1) {
player.gotoAndStop(3);
} else if (moveXDir == 1) {
player.gotoAndStop(1);
} else if (moveYDir == -1) {
player.gotoAndStop(4);
} else if (moveYDir == 1) {
player.gotoAndStop(2);
}
player.clip.play();
} else {
trace("hit the clip " + levelData[playerY + moveYDir][playerX + moveXDir][1]);
clipName = levelData[playerY + moveYDir][playerX + moveXDir][0];
if (hitObject == 2) {
playSound("dirt");
playerPushing = true;
addPointsClip(levelData[playerY + moveYDir][playerX + moveXDir][1], 10);
dirtTween = new mx.transitions.Tween(levelData[playerY + moveYDir][playerX + moveXDir][1], "_alpha", mx.transitions.easing.Regular.easeOut, 100, 0, 0.25, true);
dirtTween.clipName = levelData[playerY + moveYDir][playerX + moveXDir][1];
dirtTween.onMotionFinished = function () {
this.clipName._alpha = 100;
this.clipName.itemType = 1;
this.clipName.gotoAndStop(1);
};
levelData[playerY + moveYDir][playerX + moveXDir][0] = 1;
gameState = "move player";
if (moveXDir == -1) {
player.gotoAndStop(3);
} else if (moveXDir == 1) {
player.gotoAndStop(1);
} else if (moveYDir == -1) {
player.gotoAndStop(4);
} else if (moveYDir == 1) {
player.gotoAndStop(2);
}
} else if (hitObject == 4) {
playerPushing = true;
trace("boulder");
playSound("push boulder");
hit2Object = levelData[(playerY + moveYDir) + moveYDir][(playerX + moveXDir) + moveXDir][0];
if ((((hit2Object == 1) || (hit2Object == 40)) || (hit2Object == 41)) || (hit2Object == 42)) {
clipLink = levelData[playerY + moveYDir][playerX + moveXDir][1];
clipLink.moveItem((playerX + moveXDir) + moveXDir, (playerY + moveYDir) + moveYDir);
}
playerPushing = true;
} else if ((hitObject >= 5) && (hitObject < 14)) {
hit2Object = levelData[(playerY + moveYDir) + moveYDir][(playerX + moveXDir) + moveXDir][0];
if (hit2Object == 1) {
playSound("move object");
clipLink = levelData[playerY + moveYDir][playerX + moveXDir][1];
clipLink.moveItem((playerX + moveXDir) + moveXDir, (playerY + moveYDir) + moveYDir);
} else if (hit2Object == 14) {
playSound("chest");
addPointsClip(levelData[playerY + moveYDir][playerX + moveXDir][1], 200);
clipLink = levelData[playerY + moveYDir][playerX + moveXDir][1];
clipLink.moveGemIntoHolder((playerX + moveXDir) + moveXDir, (playerY + moveYDir) + moveYDir);
playerPushing = true;
}
} else if (hitObject == 15) {
playSound("bonus collected");
playerPushing = true;
addPointsClip(levelData[playerY + moveYDir][playerX + moveXDir][1], 1000);
fishTween = new mx.transitions.Tween(levelData[playerY + moveYDir][playerX + moveXDir][1], "_alpha", mx.transitions.easing.Regular.easeOut, 100, 0, 0.25, true);
fishTween.clipName = levelData[playerY + moveYDir][playerX + moveXDir][1];
fishTween.onMotionFinished = function () {
this.clipName.itemType = 1;
this.clipName.gotoAndStop(1);
};
levelData[playerY + moveYDir][playerX + moveXDir][0] = 1;
gameState = "move player";
if (moveXDir == -1) {
player.gotoAndStop(3);
} else if (moveXDir == 1) {
player.gotoAndStop(1);
} else if (moveYDir == -1) {
player.gotoAndStop(4);
} else if (moveYDir == 1) {
player.gotoAndStop(2);
}
} else if (hitObject == 42) {
playerPushing = true;
removeMovieClip(goArrowClip);
oldX = playerX;
oldY = playerY;
playerX = playerX + moveXDir;
playerY = playerY + moveYDir;
new mx.transitions.Tween(player, "_x", mx.transitions.easing.Regular.easeOut, findX(oldX), findX(playerX), 0.25, true);
new mx.transitions.Tween(player, "_y", mx.transitions.easing.Regular.easeOut, findY(oldY), findY(playerY), 0.25, true);
if (moveXDir == -1) {
player.gotoAndStop(3);
} else if (moveXDir == 1) {
player.gotoAndStop(1);
} else if (moveYDir == -1) {
player.gotoAndStop(4);
} else if (moveYDir == 1) {
player.gotoAndStop(2);
}
gameState = "level complete";
}
}
}
function openExit() {
trace("open exit");
i = 0;
while (i < gridHeight) {
j = 0;
while (j < gridWidth) {
theExit = levelData[i][j][0];
if (theExit == 41) {
trace("EXIT FOUND!");
levelData[i][j][0] = 42;
theExitClip = levelData[i][j][1];
a = levelData[i][j][0];
trace(a);
theExitClip.gotoAndStop(42);
theExitClip.itemType = 42;
attachMovie("goArrowClip", "goArrowClip", this.getNextHighestDepth());
goArrowClip._x = theExitClip._x + 20;
goArrowClip._y = theExitClip._y + 20;
}
j++;
}
i++;
}
}
function outputLevelData() {
myLevelData = new Array();
i = 0;
while (i < gridHeight) {
j = 0;
while (j < gridWidth) {
myLevelData.push(levelData[i][j][0]);
j++;
}
i++;
}
trace(" ");
trace(" ");
trace(("// level " + level) + " data");
trace(("newLevelData = new Array(" + myLevelData) + ")");
trace(" ");
}
function setupLevel() {
playSound("start level");
playerPushing = false;
levelCode = levelCodeArray[level - 1];
livesClip.gotoAndStop(lives + 1);
maxbonusTime = (bonusTime = 2000);
updateStopWatch();
restartLevelBtn.onRelease = function () {
if (gameState == "playing") {
gameState = "restart level";
}
};
setTheBlock = 1;
switch (level) {
case 1 :
newLevelData = new Array(23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 20, 20, 20, 20, 20, 20, 20, 28, 27, 20, 20, 20, 20, 20, 20, 40, 1, 1, 1, 6, 1, 14, 22, 24, 1, 1, 1, 1, 1, 41, 17, 17, 17, 17, 17, 18, 1, 19, 21, 1, 16, 17, 17, 17, 17, 23, 23, 23, 23, 23, 24, 1, 9, 1, 14, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 26, 17, 17, 17, 17, 25, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23);
break;
case 2 :
newLevelData = new Array(23, 23, 23, 23, 23, 23, 24, 41, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 14, 22, 23, 23, 23, 23, 23, 23, 23, 27, 20, 20, 20, 28, 24, 1, 22, 23, 23, 23, 23, 23, 23, 20, 21, 2, 2, 2, 22, 24, 1, 19, 20, 28, 23, 23, 23, 23, 40, 1, 1, 29, 7, 22, 24, 2, 2, 2, 22, 23, 23, 23, 23, 17, 18, 1, 1, 1, 22, 24, 8, 29, 2, 22, 23, 23, 23, 23, 23, 24, 1, 29, 1, 19, 21, 2, 29, 2, 22, 23, 23, 23, 23, 23, 24, 1, 1, 14, 1, 1, 1, 2, 2, 22, 23, 23, 23, 23, 23, 26, 17, 17, 17, 17, 17, 17, 17, 17, 25, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23);
break;
case 3 :
newLevelData = new Array(27, 20, 20, 20, 20, 20, 28, 23, 23, 23, 23, 23, 23, 23, 23, 24, 2, 2, 2, 2, 2, 19, 20, 20, 28, 23, 23, 23, 23, 23, 24, 2, 1, 1, 4, 2, 1, 1, 1, 22, 23, 23, 23, 23, 23, 24, 2, 1, 29, 14, 29, 29, 29, 1, 19, 20, 28, 23, 23, 23, 26, 18, 1, 29, 4, 9, 2, 2, 1, 2, 14, 19, 20, 20, 28, 23, 24, 2, 5, 1, 16, 17, 18, 1, 16, 18, 1, 1, 41, 22, 23, 24, 2, 2, 1, 22, 23, 24, 1, 19, 21, 1, 16, 17, 25, 23, 26, 17, 18, 1, 22, 23, 24, 1, 1, 1, 1, 22, 23, 23, 23, 23, 23, 24, 1, 19, 20, 21, 16, 17, 17, 17, 25, 23, 23, 23, 23, 23, 24, 1, 1, 1, 40, 22, 23, 23, 23, 23, 23, 23);
break;
case 4 :
newLevelData = new Array(23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 27, 20, 20, 20, 28, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 2, 2, 2, 19, 20, 20, 20, 20, 20, 20, 28, 23, 23, 23, 24, 1, 5, 4, 14, 1, 1, 1, 2, 14, 1, 22, 23, 20, 20, 21, 1, 1, 1, 29, 29, 29, 29, 5, 29, 1, 19, 20, 40, 1, 1, 1, 1, 2, 2, 2, 2, 2, 15, 29, 1, 1, 41, 17, 17, 18, 1, 1, 1, 29, 29, 29, 29, 12, 29, 1, 16, 17, 23, 23, 24, 1, 11, 4, 14, 2, 1, 2, 1, 14, 1, 22, 23, 23, 23, 24, 2, 2, 2, 16, 17, 17, 17, 17, 17, 17, 25, 23, 23, 23, 26, 17, 17, 17, 25, 23, 23, 23, 23, 23, 23, 23, 23);
break;
case 5 :
newLevelData = new Array(27, 20, 20, 28, 23, 23, 23, 23, 23, 23, 24, 42, 22, 23, 23, 24, 2, 2, 19, 20, 28, 27, 20, 28, 23, 24, 1, 22, 23, 23, 24, 2, 1, 1, 1, 19, 21, 14, 19, 28, 24, 1, 19, 20, 20, 24, 2, 1, 29, 2, 15, 2, 4, 2, 19, 21, 2, 4, 1, 1, 21, 29, 4, 29, 7, 29, 1, 6, 2, 1, 1, 1, 29, 1, 16, 40, 1, 1, 1, 1, 1, 2, 14, 4, 1, 4, 1, 29, 1, 22, 17, 18, 1, 29, 1, 29, 1, 5, 2, 1, 1, 1, 29, 1, 22, 23, 26, 17, 17, 17, 18, 2, 4, 2, 16, 17, 17, 18, 1, 22, 23, 23, 23, 23, 23, 26, 18, 14, 16, 25, 23, 23, 24, 15, 22, 23, 23, 23, 23, 23, 23, 26, 17, 25, 23, 23, 23, 26, 17, 25);
break;
case 6 :
newLevelData = new Array(27, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 28, 23, 23, 24, 2, 2, 1, 1, 14, 1, 4, 1, 1, 2, 2, 22, 23, 23, 21, 2, 4, 1, 29, 4, 29, 5, 29, 1, 4, 2, 22, 23, 23, 40, 1, 1, 1, 2, 1, 1, 1, 7, 1, 1, 2, 22, 23, 23, 24, 2, 4, 1, 29, 5, 29, 4, 29, 1, 4, 2, 22, 23, 23, 24, 2, 2, 1, 14, 1, 1, 14, 1, 1, 2, 2, 22, 23, 23, 26, 17, 17, 17, 17, 17, 18, 1, 16, 17, 17, 17, 25, 23, 23, 23, 23, 23, 23, 23, 23, 24, 1, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 1, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 41, 22, 23, 23, 23, 23, 23, 23);
break;
case 7 :
newLevelData = new Array(23, 24, 40, 2, 19, 20, 20, 20, 20, 20, 28, 23, 23, 24, 15, 23, 24, 1, 1, 1, 1, 1, 2, 1, 2, 19, 20, 20, 21, 2, 23, 24, 1, 16, 17, 17, 17, 18, 1, 1, 1, 1, 1, 29, 2, 23, 24, 1, 22, 27, 20, 20, 21, 1, 2, 4, 13, 1, 29, 2, 23, 24, 1, 22, 24, 14, 1, 2, 1, 4, 6, 2, 1, 29, 1, 23, 24, 1, 22, 24, 1, 16, 18, 1, 2, 4, 7, 1, 29, 1, 23, 24, 1, 22, 24, 1, 22, 24, 1, 4, 1, 4, 1, 29, 1, 23, 24, 1, 19, 21, 1, 19, 21, 1, 1, 1, 1, 1, 2, 1, 23, 24, 14, 2, 4, 14, 1, 1, 1, 2, 16, 17, 17, 17, 17, 23, 24, 41, 16, 17, 17, 17, 17, 17, 17, 25, 23, 23, 23, 23);
break;
case 8 :
newLevelData = new Array(23, 27, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 28, 23, 23, 23, 24, 14, 1, 1, 1, 1, 1, 1, 4, 2, 1, 22, 23, 23, 23, 26, 18, 1, 1, 4, 1, 1, 4, 29, 29, 1, 19, 20, 20, 20, 20, 21, 1, 1, 1, 4, 5, 1, 1, 29, 14, 1, 1, 2, 2, 11, 2, 4, 1, 1, 14, 2, 1, 1, 29, 1, 29, 1, 2, 2, 29, 29, 1, 1, 4, 1, 1, 1, 1, 29, 1, 29, 6, 16, 15, 2, 2, 1, 14, 1, 1, 1, 4, 2, 29, 1, 2, 2, 22, 17, 17, 17, 17, 17, 17, 18, 1, 11, 1, 29, 1, 29, 29, 19, 23, 23, 23, 23, 23, 23, 24, 1, 1, 1, 29, 1, 1, 1, 40, 23, 23, 23, 23, 23, 23, 26, 17, 18, 41, 16, 17, 17, 17, 29);
break;
case 9 :
newLevelData = new Array(23, 23, 23, 23, 23, 23, 23, 23, 24, 40, 22, 23, 23, 23, 23, 23, 27, 20, 20, 20, 20, 20, 20, 21, 1, 19, 20, 20, 20, 28, 23, 24, 1, 14, 1, 1, 1, 2, 12, 1, 1, 4, 1, 1, 22, 23, 24, 1, 16, 18, 29, 29, 14, 29, 4, 29, 29, 1, 29, 22, 23, 24, 1, 19, 21, 14, 2, 1, 1, 1, 1, 4, 1, 2, 22, 23, 24, 1, 29, 15, 2, 29, 1, 2, 5, 1, 29, 1, 16, 25, 23, 24, 1, 16, 18, 2, 29, 1, 9, 2, 8, 29, 1, 22, 23, 23, 24, 1, 22, 24, 14, 2, 1, 4, 1, 1, 1, 1, 22, 23, 23, 24, 1, 22, 26, 17, 17, 17, 17, 17, 17, 17, 17, 25, 23, 23, 24, 41, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23);
break;
case 10 :
newLevelData = new Array(1, 1, 1, 1, 1, 1, 1, 40, 1, 1, 4, 1, 1, 1, 1, 2, 16, 17, 17, 17, 17, 18, 1, 16, 18, 2, 2, 4, 1, 1, 2, 22, 23, 23, 23, 23, 24, 1, 22, 23, 18, 2, 29, 4, 1, 1, 22, 23, 23, 23, 27, 21, 1, 19, 20, 21, 2, 7, 1, 1, 1, 22, 23, 23, 23, 24, 2, 1, 5, 1, 22, 18, 29, 14, 16, 1, 19, 20, 20, 20, 21, 29, 14, 29, 1, 19, 21, 1, 1, 22, 15, 1, 1, 2, 2, 15, 16, 17, 18, 1, 8, 1, 1, 4, 22, 29, 29, 29, 29, 29, 29, 19, 20, 21, 1, 29, 29, 1, 2, 22, 41, 1, 14, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 22, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 25);
break;
case 11 :
newLevelData = new Array(23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23);
break;
case 12 :
newLevelData = new Array(23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23);
break;
default :
newLevelData = new Array(23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23);
}
gridWidth = 15;
gridHeight = 10;
arrayNum = 0;
levelData = new Array();
requiredLevelGems = 0;
i = 0;
while (i < gridHeight) {
levelData[i] = new Array();
j = 0;
while (j < gridWidth) {
levelData[i][j] = new Array();
theData = newLevelData[arrayNum];
if ((theData < 16) || (theData > 29)) {
fb = floorHolder.attachMovie("floorBoard", "fb" + arrayNum, arrayNum);
fb._x = findX(j);
fb._y = findY(i);
}
if ((theData > 4) && (theData < 14)) {
requiredLevelGems++;
}
if (theData != undefined) {
t = tileHolder.attachMovie("item", "item" + arrayNum, arrayNum);
t.x = j;
t.y = i;
t.itemType = theData;
levelData[i][j][0] = theData;
levelData[i][j][1] = t;
}
if (theData == 40) {
playerX = j;
playerY = i;
}
arrayNum++;
j++;
}
i++;
}
player = holder.attachMovie("player", "player", 100);
player._x = findX(playerX);
player._y = findY(playerY);
tileHolder.cacheAsBitmap = true;
}
function changeLevel(x, y) {
temp1Data = levelData[y][x][0];
temp2Data = levelData[y][x][1];
temp1Data = setTheBlock;
levelData[y][x][0] = temp1Data;
temp2Data.gotoAndStop(temp1Data);
temp2Data.clip.gotoAndStop(Math.floor(Math.random() * 10) + 1);
outputLevelData();
return(temp1Data);
}
function findX(xNum) {
theX = (xNum * 40) + 20;
return(theX);
}
function findY(yNum) {
theY = ((yNum * 40) + 75) - 5;
return(theY);
}
function tellPlayer(tellText) {
playSound("tell player");
tellPlayerClip = holder.attachMovie("tellPlayerClip", "tellPlayerClip", 1000);
tellPlayerClip._x = 320;
tellPlayerClip._y = 200;
tellPlayerClip.textBox.text = tellText;
tellPlayerMotion = new mx.transitions.Tween(tellPlayerClip, "_y", mx.transitions.easing.Strong.easeOut, -10, 200, 1, true);
tellPlayerMotion.clipName = tellPlayerClip;
tellPlayerMotion.onMotionFinished = function () {
new mx.transitions.Tween(tellPlayerClip, "_alpha", mx.transitions.easing.Regular.easeIn, 100, 0, 3, true);
};
}
onEnterFrame = function () {
switch (gameState) {
case "playing" :
keyFunc();
updateStopWatch();
break;
case "move player" :
movePlayerCount = 6;
gameState = "move player wait";
break;
case "move player wait" :
updateStopWatch();
movePlayerCount--;
if (movePlayerCount < 1) {
gameState = "playing";
}
break;
case "setup" :
score = 0;
lives = 3;
level = 1;
gameState = "choose character";
break;
case "choose character" :
attachMovie("chooseCharacter", "chooseCharacter", 1000);
chooseCharacter.cacheAsBitmap = true;
chooseCharacter._x = 320;
new mx.transitions.Tween(chooseCharacter, "_y", mx.transitions.easing.Bounce.easeOut, -100, 240, 1.5, true);
chooseCharacter.playBtn.onRelease = function () {
startPlay();
};
chooseCharacter.levelCodeBox.onSetFocus = function () {
if (this.text == "-") {
this.text = "";
}
};
chooseCharacter.levelCodeBox.onKillFocus = function () {
if (this.text == "") {
this.text = "-";
}
};
playerType = 1;
chooseCharacter.changeBtn1.onPress = (chooseCharacter.changeBtn2.onPress = function () {
changeCharacter();
});
gameState = "choose character wait";
break;
case "choose character wait" :
if (Key.getCode() == 32) {
startPlay();
}
break;
case "start play wait" :
spCount--;
if (spCount < 1) {
gameState = "setup level";
}
break;
case "setup level" :
setupLevel();
new mx.transitions.Tween(tileHolder, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 1, true);
var _local4 = new flash.filters.BlurFilter(0, 0, 1);
tileHolder.filters = [_local4];
gameState = "start level";
break;
case "start level" :
levelCount = 30;
gameState = "start level wait";
tellPlayer("LEVEL " + level);
break;
case "start level wait" :
levelCount--;
if (levelCount < 1) {
gameState = "playing";
}
break;
case "level complete" :
playSound("level complete");
new mx.transitions.Tween(stopWatch, "_x", mx.transitions.easing.Regular.easeOut, 588, 458, 0.75, true);
new mx.transitions.Tween(stopWatch, "_y", mx.transitions.easing.Regular.easeOut, 40, 257, 0.75, true);
new mx.transitions.Tween(stopWatch, "_xscale", mx.transitions.easing.Regular.easeOut, 100, 200, 0.75, true);
new mx.transitions.Tween(stopWatch, "_yscale", mx.transitions.easing.Regular.easeOut, 100, 200, 0.75, true);
t = holder.attachMovie("endOfLevelClip", "endOfLevelClip", 100);
t.textBox.text = ("LEVEL " + level) + " COMPLETE";
t.levelCodeText.text = levelCode;
t.levelCodeDetails.text = ("LEVEL " + level) + " CODE: ";
t._x = 320;
t._y = 240;
new mx.transitions.Tween(t, "_xscale", mx.transitions.easing.Regular.easeOut, 10, 100, 0.5, true);
new mx.transitions.Tween(t, "_yscale", mx.transitions.easing.Regular.easeOut, 10, 100, 0.5, true);
t.playNextBtn.onRelease = function () {
_root.gameState = "level complete wait end";
};
blurAmount = 1;
levelCount = 90;
player.gotoAndStop(5);
var _local3 = new Object();
_local3.onKeyDown = function () {
trace(Key.getCode());
};
Key.addListener(_local3);
gameState = "level complete wait";
blurAmount = 10;
break;
case "level complete wait" :
if (bonusTime > 5) {
playSound("add points");
score = score + 5;
bonusTime = bonusTime - 5;
holder.endOfLevelClip.scoreText.text = score;
bonusTimeRotation = (360 - ((bonusTime / maxbonusTime) * 360)) - 90;
stopWatch.hand._rotation = bonusTimeRotation;
}
if (blurAmount < 10) {
_local4 = new flash.filters.BlurFilter(blurAmount, blurAmount, 1);
tileHolder.filters = [_local4];
blurAmount = blurAmount + 0.25;
}
if (Key.getCode() == 32) {
gameState = "level complete wait end";
}
break;
case "level complete wait end" :
if (bonusTime > 0) {
score = score + bonusTime;
holder.endOfLevelClip.scoreText.text = 0;
}
new mx.transitions.Tween(stopWatch, "_x", mx.transitions.easing.Regular.easeOut, 458, 588, 0.5, true);
new mx.transitions.Tween(stopWatch, "_y", mx.transitions.easing.Regular.easeOut, 257, 40, 0.5, true);
new mx.transitions.Tween(stopWatch, "_xscale", mx.transitions.easing.Regular.easeOut, 200, 100, 0.75, true);
new mx.transitions.Tween(stopWatch, "_yscale", mx.transitions.easing.Regular.easeOut, 200, 100, 0.75, true);
endLevelClipTween = new mx.transitions.Tween(tileHolder, "_alpha", mx.transitions.easing.None.easeOut, 100, 0, 1, true);
endLevelClipTween.clipName = holder.endOfLevelClip;
endLevelClipTween.onMotionFinished = function () {
removeMovieClip(this.clipName);
};
new mx.transitions.Tween(stopWatch.hand, "_rotation", mx.transitions.easing.Regular.easeOut, stopWatch.hand._rotation, -90, 0.5, true);
gameState = "level complete wait end wait";
levelCount = 30;
blurAmount = 10;
break;
case "level complete wait end wait" :
levelCount--;
if (blurAmount > 0) {
blurAmount = blurAmount - 1;
}
if (levelCount < 1) {
gameState = "next level";
}
break;
case "next level" :
level++;
if (level > 10) {
gameState = "game complete";
} else {
gameState = "setup level";
}
break;
case "restart level" :
lives--;
if (lives < 1) {
gameState = "game over";
} else {
gameState = "setup level";
}
break;
case "game over" :
tellPlayer("game over");
gameOverWait = 60;
gameState = "game over wait";
break;
case "game over wait" :
gameOverWait--;
if (gameOverWait < 1) {
gameState = "void";
gotoAndPlay ("GAME OVER");
}
break;
case "lose life" :
break;
case "lose life wait" :
break;
case "game complete" :
tellPlayer("game complete");
gameCompleteCount = 60;
gameState = "game complete wait";
break;
case "game complete wait" :
gameCompleteCount--;
if (gameCompleteCount < 1) {
gameState = "void";
gotoAndPlay (33);
}
break;
}
};
gameState = "setup";
outputLevelData.onRelease = function () {
outputLevelData();
};
myString = "";
i = 0;
while (i < 150) {
myString = myString + "3,";
i++;
}
stop();
Frame 24
if (false) {
}
Frame 25
_quality = "high";
if (yourhigh == undefined) {
yourhigh = 0;
}
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
this.playBtn.onRelease = function () {
playSound("mouseDown");
removeMovieClip(highHolder);
gotoAndPlay (23);
};
this.playBtn.onRollOver = function () {
playSound("mouseOver");
};
if ((score > 1000) && (score < 1000000)) {
t = this.createEmptyMovieClip("highHolder", 1000);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 50;
t._y = 320;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.flush();
i = 0;
while (i < 16) {
t = holder.attachMovie("boulder", "b" + i, i);
t._x = ((i * 30) + 90) + (Math.random() * 10);
new mx.transitions.Tween(t, "_y", mx.transitions.easing.Bounce.easeOut, -20, 58 + (Math.random() * 10), 0.5, true);
i++;
}
i = 0;
while (i < 16) {
t = holder.attachMovie("boulder", "b" + i, i + 20);
t._x = ((i * 30) + 90) + (Math.random() * 10);
new mx.transitions.Tween(t, "_y", mx.transitions.easing.Bounce.easeOut, -20, 170 + (Math.random() * 10), 0.5, true);
i++;
}
Frame 32
stop();
Frame 33
_quality = "high";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
this.playBtn.onRelease = function () {
playSound("mouseDown");
removeMovieClip(highHolder);
gotoAndPlay (23);
};
this.playBtn.onRollOver = function () {
playSound("mouseOver");
};
if (score > 1000) {
t = this.createEmptyMovieClip("highHolder", 1000);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 50;
t._y = 320;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.flush();
i = 0;
while (i < 15) {
t = holder.attachMovie("gem", "g" + i, i);
t._x = ((i * 30) + 90) + (Math.random() * 10);
t.gotoAndStop(Math.floor(Math.random() * 7) + 1);
new mx.transitions.Tween(t, "_y", mx.transitions.easing.Bounce.easeOut, -20, 16 + (Math.random() * 6), 0.5, true);
i++;
}
i = 0;
while (i < 15) {
t = holder.attachMovie("gem", "g" + i, i + 20);
t.gotoAndStop(Math.floor(Math.random() * 7) + 1);
t._x = ((i * 30) + 90) + (Math.random() * 10);
new mx.transitions.Tween(t, "_y", mx.transitions.easing.Bounce.easeOut, -20, 114 + (Math.random() * 6), 0.5, true);
i++;
}
Frame 41
stop();
Symbol 4 MovieClip [letter] Frame 1
#initclip 12
Object.registerClass("letter", letterClass);
#endinitclip
Symbol 271 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 272 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 273 MovieClip [__Packages.levelEditBtnClass] Frame 0
class levelEditBtnClass extends MovieClip
{
var x, y, _x, _y;
function levelEditBtnClass () {
super();
}
function onLoad() {
setPosition(x, y);
}
function onPress() {
trace(this);
_root.changeLevel(x, y);
}
function setPosition(movex, movey) {
_x = _root.findX(x);
_y = _root.findY(y);
}
}
Symbol 274 MovieClip [__Packages.itemClass] Frame 0
class itemClass extends MovieClip
{
var x, y, itemType, removeMovieClip, _x, _y, gotoAndStop, clip;
function itemClass () {
super();
}
function onLoad() {
setPosition(x, y);
}
function moveItem(movex, movey) {
trace("MOVE ITEM");
_root.moveObject(this, _root.findX(x), _root.findY(y), _root.findX(movex), _root.findY(movey));
_root.clearPosition(x, y);
x = movex;
y = movey;
_root.setPosition(x, y, itemType, this);
}
function moveGemIntoHolder(movex, movey) {
_root.moveObject(this, _root.findX(x), _root.findY(y), _root.findX(movex), _root.findY(movey));
_root.fadeClip(this);
_root.clearPosition(x, y);
x = movex;
y = movey;
_root.setGemInPosition(x, y, itemType, this);
}
function gemSolved() {
_root.clearPosition(x, y);
removeMovieClip();
}
function setPosition(movex, movey) {
_x = _root.findX(x);
_y = _root.findY(y);
gotoAndStop(itemType);
switch (itemType) {
case 23 :
if (Math.floor(Math.random() * 9) == 0) {
clip.gotoAndStop(Math.floor(Math.random() * 13) + 1);
} else {
clip.gotoAndStop(1);
}
break;
case 5 :
itemType = Math.floor(Math.random() * 9) + 5;
break;
case 14 :
clip.gotoAndStop(1);
break;
default :
clip.gotoAndStop(Math.floor(Math.random() * 4) + 1);
}
}
}
Symbol 275 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 276 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 277 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 278 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 279 MovieClip [__Packages.mx.transitions.easing.Bounce] Frame 0
class mx.transitions.easing.Bounce
{
function Bounce () {
}
static function easeOut(t, b, c, d) {
t = t / d;
if (t < 0.363636363636364) {
return((c * ((7.5625 * t) * t)) + b);
}
if (t < 0.727272727272727) {
t = t - 0.545454545454545;
return((c * (((7.5625 * t) * t) + 0.75)) + b);
}
if (t < 0.909090909090909) {
t = t - 0.818181818181818;
return((c * (((7.5625 * t) * t) + 0.9375)) + b);
}
t = t - 0.954545454545455;
return((c * (((7.5625 * t) * t) + 0.984375)) + b);
}
static function easeIn(t, b, c, d) {
return((c - easeOut(d - t, 0, c, d)) + b);
}
static function easeInOut(t, b, c, d) {
if (t < (d / 2)) {
return((easeIn(t * 2, 0, c, d) * 0.5) + b);
}
return(((easeOut((t * 2) - d, 0, c, d) * 0.5) + (c * 0.5)) + b);
}
static var version = "1.1.0.52";
}
Symbol 280 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 281 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 47 MovieClip Frame 1
stop();
Symbol 93 MovieClip [item] Frame 1
#initclip 14
Object.registerClass("item", itemClass);
#endinitclip
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 2
stop();
Symbol 103 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 2
stop();
Symbol 108 MovieClip Frame 1
stop();
Symbol 108 MovieClip Frame 2
stop();
Symbol 118 MovieClip [player] Frame 1
stop();
Symbol 125 MovieClip [levelEditBtn] Frame 1
#initclip 13
Object.registerClass("levelEditBtn", levelEditBtnClass);
#endinitclip
Symbol 170 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 1
_root.stop();
new mx.transitions.Tween(this.head, "_rotation", mx.transitions.easing.Bounce.easeOut, 0, 180, 0.7, true);
new mx.transitions.Tween(this.head, "_y", mx.transitions.easing.Bounce.easeOut, this.head._y - 200, this.head._y, 1, true);
new mx.transitions.Tween(this.head, "_x", mx.transitions.easing.Strong.easeOut, (Math.random() * 640) - 320, 0, 1, true);
Symbol 174 MovieClip Frame 92
_root.play();
Symbol 208 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 215 MovieClip Frame 1
stop();
Symbol 257 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 1
stop();