Frame 1
MochiAd.showPreGameAd({id:"f244ea97e9b56acd", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
this._lockroot = true;
var gameName = "pacpark";
vNum = "1.01";
gameQuality = "AUTO";
fscommand ("fullscreen", true);
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 = "pac park";
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 * 20) / 2;
this.createEmptyMovieClip("loadingHolder", 1);
loadingHolder._x = (320 - wordOffset) + 10;
loadingHolder._y = 175;
i = 0;
while (i < stringLength) {
t = loadingHolder.attachMovie("letter", "l" + i, i);
t._x = i * 20;
t.angle = i;
t.Lvar.text = gameLoadingName.charAt(i);
t._xscale = (t._yscale = 200);
i++;
}
stop();
Frame 4
function attachSoundFromLibrary(idname) {
var _local2 = new Sound(this);
_local2.attachSound(idname);
return(_local2);
}
function playSound(temp) {
trace(temp);
if (temp == "mouseOverSnd") {
mouseOverSnd.start();
}
if (temp == "mouseDownSnd") {
mouseDownSnd.start();
}
if (temp == "boulderFalls") {
if (random(2) == 0) {
boulderLands4Snd.start();
} else {
boulderLands3Snd.start();
}
}
if (temp == "winGameSnd") {
winGameSnd.start();
}
if (temp == "playerDiesSnd") {
playerDiesSnd.start();
}
if (temp == "pickAxeSnd") {
pickAxeSnd.start();
}
if (temp == "pushBoulderSnd") {
pushBoulderSnd.start();
}
if (temp == "crushPlayer") {
boulderCrushesPlayerSnd.start();
}
if (temp == "gameOverSnd") {
gameOverSnd.start();
}
}
var collectDiamondSnd = attachSoundFromLibrary("collectDiamondSnd.wav");
var dirtSnd = attachSoundFromLibrary("dirtSnd.wav");
var boulderFalls = attachSoundFromLibrary("boulderFalls.wav");
var mouseOverSnd = attachSoundFromLibrary("mouseOver.wav");
var mouseDownSnd = attachSoundFromLibrary("mouseDown.wav");
var winGameSnd = attachSoundFromLibrary("winGame.wav");
var playerDiesSnd = attachSoundFromLibrary("playerDies.wav");
var pickAxeSnd = attachSoundFromLibrary("pickAxe1.wav");
var pushBoulderSnd = attachSoundFromLibrary("pushBoulder.wav");
var boulderCrushesPlayerSnd = attachSoundFromLibrary("boulderCrushesPlayer.wav");
var boulderLands3Snd = attachSoundFromLibrary("boulderLands3.wav");
var boulderLands4Snd = attachSoundFromLibrary("boulderLands4.wav");
var gameOverSnd = attachSoundFromLibrary("gameOverSnd.wav");
storage = SharedObject.getLocal("pacpark_store");
yourhigh = storage.data.myhighscore;
if (yourhigh == undefined) {
storage.data.myhighscore = 0;
yourhigh = 0;
}
Frame 6
_quality = "high";
Frame 7
if (false) {
}
Frame 19
sendToFriendFlower.onLoad = function () {
this.rot = false;
};
sendToFriendFlower.onEnterFrame = function () {
if (this.rot) {
this._rotation = this._rotation + 2;
}
};
howtoplayFlower.onLoad = function () {
this.rot = false;
};
howtoplayFlower.onEnterFrame = function () {
if (this.rot) {
this._rotation = this._rotation + 2;
}
};
playFlower.onLoad = function () {
this.rot = false;
};
playFlower.onEnterFrame = function () {
if (this.rot) {
this._rotation = this._rotation + 2;
}
};
playBtn.onRelease = function () {
playSound("mouseDownSnd");
gotoAndPlay (20);
};
playBtn.onRollOut = function () {
playFlower.rot = false;
};
playBtn.onRollOver = function () {
playFlower.rot = true;
playSound("mouseOverSnd");
};
howToBtn.onRollOver = function () {
playSound("mouseOverSnd");
howtoplayFlower.rot = true;
};
howToBtn.onRollOut = function () {
howtoplayFlower.rot = false;
};
howToBtn.onRelease = function () {
playSound("mouseDownSnd");
gotoAndPlay (23);
};
sendToFriend.onRelease = function () {
playSound("mouseDownSnd");
gotoAndPlay (6);
};
sendToFriend.onRollOver = function () {
playSound("mouseOverSnd");
sendToFriendFlower.rot = true;
};
sendToFriend.onRollOut = function () {
sendToFriendFlower.rot = false;
};
introG.onEnterFrame = function () {
if (this.b == undefined) {
this.b = 60;
}
this.b--;
if (this.b < 1) {
this.b = random(200) + 280;
this.play();
}
};
stop();
Frame 20
u = objHolder.attachMovie("showPlayer", "showPlayer", 2001);
u._x = 320;
u._y = 240;
Frame 21
if (false) {
}
Frame 22
function hurtPlayer() {
if (gameState == "playing") {
trace("hit player");
gameState = "lose life";
i = 0;
while (i < 10) {
removeMovieClip(eval ("objHolder.enemy" + i));
i++;
}
playSound("crushPlayer");
}
}
function makeDust() {
if (lastPressed == "left") {
xm = -50;
ym = 0;
}
if (lastPressed == "right") {
xm = 50;
ym = 0;
}
if (lastPressed == "up") {
xm = 0;
ym = -50;
}
if (lastPressed == "down") {
xm = 0;
ym = 50;
}
i = 0;
while (i < 10) {
t = attachMovie("dust", "d" + (i + random(200)), 1000 + random(200));
t._x = px + xm;
t._y = py + ym;
i++;
}
}
function addPoints(temp) {
score = score + temp;
if (score < 0) {
score = 0;
}
}
function hitPeice(xt, yt) {
if (gameState == "playing") {
e = 0;
i = 0;
while (i < (stageHeight * stageWidth)) {
tc = eval ("objHolder.b" + i);
if (tc != undefined) {
t3 = tc._x - xt;
if (Math.abs(t3) < 5) {
t4 = tc._y - yt;
if (Math.abs(t4) < 5) {
if (tc.zstate == "wait") {
typeOfObj = tc.objType;
if (typeOfObj == "exit") {
testTouchExit();
}
if (typeOfObj == "diamond") {
_root.addPoints(500);
collectDiamondSnd.start();
_root.showPoints(500, tc._x, tc._y);
tc.zstate = "pop";
levelDiamonds--;
return(false);
}
if (typeOfObj == "flower") {
makeDust();
tc.zstate = "pop";
levelFlowers--;
trace("flower collected");
if (levelFlowers < 1) {
levelFlowers = 0;
gameState = "level complete";
}
_root.addPoints(20);
dirtSnd.start();
_root.showPoints(20, tc._x, tc._y);
return(false);
}
return(true);
}
return(true);
}
}
}
i++;
}
}
return(0);
}
function objPeiceTest(xt, yt) {
i = 0;
while (i < (stageHeight * stageWidth)) {
tc = eval ("objHolder.b" + i);
trace(tc);
if (tc != undefined) {
t3 = tc._x - xt;
if (t3 > -5) {
if (t3 < 5) {
t4 = tc._y - yt;
if (t4 > -5) {
if (t4 < 5) {
if (tc.zstate == "wait") {
typeOfObj = tc.objType;
return(typeOfObj);
}
}
}
}
}
}
i++;
}
}
function keyFunc() {
if (Key.isDown(37) && (lastPressed != "left")) {
lastPressed = "left";
if (px > 20) {
hitR = objHolder.hitTest(px - 40, py, true);
if (!hitR) {
pxTarget = px - 40;
pyTarget = py;
playerMoving = true;
player.gotoAndStop(3);
player.clip.play();
} else {
hitting = hitPeice(px - 40, py);
if (!hitting) {
pxTarget = px - 40;
pyTarget = py;
playerMoving = true;
player.gotoAndStop(3);
player.clip.play();
}
}
}
} else if (Key.isDown(39)) {
lastPressed = "right";
if (px < 600) {
hitR = objHolder.hitTest(px + 40, py, true);
if (!hitR) {
pxTarget = px + 40;
pyTarget = py;
playerMoving = true;
player.gotoAndStop(1);
player.clip.play();
} else {
hitting = hitPeice(px + 40, py);
if (!hitting) {
pxTarget = px + 40;
pyTarget = py;
playerMoving = true;
player.gotoAndStop(1);
player.clip.play();
}
}
}
} else if (Key.isDown(40) && (lastPressed != "down")) {
lastPressed = "down";
if (py < 440) {
hitR = objHolder.hitTest(px, py + 40, true);
if (!hitR) {
pyTarget = py + 40;
pxTarget = px;
playerMoving = true;
player.gotoAndStop(2);
player.clip.play();
} else {
hitting = hitPeice(px, py + 40);
if (!hitting) {
pxTarget = px;
pyTarget = py + 40;
playerMoving = true;
player.gotoAndStop(2);
player.clip.play();
}
}
}
} else if (Key.isDown(38) && (lastPressed != "up")) {
lastPressed = "up";
if (py > 100) {
hitR = objHolder.hitTest(px, py - 40, true);
trace(hitR);
if (!hitR) {
pyTarget = py - 40;
pxTarget = px;
playerMoving = true;
player.gotoAndStop(4);
player.clip.play();
} else {
hitting = hitPeice(px, py - 40);
if (!hitting) {
pxTarget = px;
pyTarget = py - 40;
playerMoving = true;
player.gotoAndStop(4);
player.clip.play();
}
}
}
}
}
function testit(tclip) {
hitResult = objHolder.hitTest(tclip.x, tclip.y + 23, true);
return(hitResult);
}
function testwaitit(tclip) {
hitResult = objHolder.hitTest(tclip.x, tclip.y + 23, true);
return(hitResult);
}
function findHit(tx, ty) {
hitResult = objHolder.hitTest(tx, ty, true);
return(hitResult);
}
function monsterGen() {
if (monsterCount < levelMonsterMax) {
monsterGenCount++;
if (monsterGenCount > monsterGenDelay) {
monsterCount++;
trace("adding a monster");
t = objHolder.attachMovie("enemy", "enemy" + monsterCount, monsterCount + 1000);
t._x = xSpawn;
bugType = random(3) + 1;
t.gotoAndStop(bugType);
t.bugType = bugType;
t._y = ySpawn + 80;
monsterGenCount = 0;
u = objHolder.attachMovie("monsterSpawnClip", "monsterSpawnClip", monsterCount + 1500);
u._x = t._x;
u._y = t._y;
}
}
}
function showPoints(t1, t2, t3) {
if (t1 > 99) {
n = this.getNextHighestDepth();
t = this.attachMovie("points", "p" + n, n);
t._x = t2;
t.pText.text = t1;
t._y = t3;
}
}
function setupLevel() {
monsterGenCount = 0;
monsterGenDelay = 120;
monsterCount = 0;
ballNum = 0;
pxTarget = 0;
pyTarget = 0;
playerMoving = false;
px = 20;
py = 100;
t = attachMovie("player", "player", 2000);
player.gotoAndStop(2);
player._x = 20;
player._y = 100;
if (level == 1) {
levelMonsterMax = 3;
roomData = new Array(4, 1, 1, 3, 1, 3, 2, 3, 3, 1, 3, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 2, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 3, 3, 1, 3, 1, 3, 1, 3, 3, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 2, 3, 3, 2, 3, 1, 3, 1, 3, 3, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 4, 4, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 3, 1, 3, 1, 5, 5, 1, 3, 2, 3, 3, 1, 2);
}
if (level == 2) {
levelMonsterMax = 3;
roomData = new Array(4, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 2, 1, 3, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 3, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 3, 3, 1, 1, 3, 4, 4, 3, 1, 1, 3, 3, 3, 1, 2, 1, 1, 1, 1, 1, 3, 5, 5, 3, 1, 1, 1, 1, 1, 2);
}
if (level == 3) {
levelMonsterMax = 4;
roomData = new Array(4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 3, 1, 3, 3, 3, 3, 1, 3, 1, 3, 1, 1, 1, 3, 3, 1, 3, 1, 1, 3, 2, 1, 1, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 2, 1, 3, 3, 3, 3, 1, 1, 3, 1, 3, 1, 1, 3, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 3, 3, 1, 1, 1, 3, 1, 3, 1, 3, 4, 4, 3, 1, 3, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 3, 5, 5, 3, 1, 1, 1, 1, 1, 2);
}
if (level == 4) {
levelMonsterMax = 4;
roomData = new Array(4, 1, 1, 3, 1, 3, 2, 3, 3, 1, 3, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 2, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 3, 3, 1, 3, 1, 3, 1, 3, 3, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 2, 3, 3, 2, 3, 1, 3, 1, 3, 3, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 4, 4, 1, 3, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 3, 4, 4, 1, 1, 2, 3, 1, 3, 1, 3, 3, 1, 3, 2, 3, 3, 5, 5);
}
if (level == 5) {
levelMonsterMax = 5;
roomData = new Array(1, 1, 3, 2, 1, 3, 1, 1, 1, 1, 3, 1, 2, 3, 1, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 2, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 3, 1, 3, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 1, 1, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 4, 4, 1, 1, 3, 2, 1, 3, 1, 1, 1, 1, 3, 1, 2, 3, 5, 5);
}
levelDiamonds = 0;
levelFlowers = 0;
i = 0;
while (i < roomData.length) {
if (roomData[i] == 1) {
}
i++;
}
trace(levelFlowers);
levelComplete = false;
i = 0;
while (i < (stageHeight * stageWidth)) {
b = roomData[i];
t = objHolder.attachMovie(itemClip, "b" + ballNum, ballNum);
a = Math.floor(i / stageWidth);
b = i - (a * stageWidth);
t.x = (b * 40) + 20;
t.y = ((a * 40) + 20) + 80;
b = roomData[i];
t.hitBox._visible = false;
t.gotoAndStop(b);
t.fall = false;
if (b == 1) {
t.objType = "flower";
t.clip1.gotoAndStop(random(4) + 1);
t.clip1._rotation = random(360);
levelFlowers++;
}
if (b == 2) {
t.objType = "diamond";
t.clip1.gotoAndStop(random(4) + 1);
}
if (b == 3) {
t.objType = "rock";
t.clip1.gotoAndStop(level);
}
if (b == 5) {
t.objType = "spawn";
xSpawn = t.x;
ySpawn = t.y;
}
if ((b == 6) || (b == 7)) {
t.objType = "gate";
}
t.btype = b;
t.num = ballNum;
ballNum++;
numObjects = ballNum;
i++;
}
}
function setup() {
lives = 3;
_quality = "MEDIUM";
level = 1;
levelDiamonds = 0;
itemClip = "bd_object";
score = 0;
d = 60;
stageWidth = 16;
stageHeight = 10;
}
function audit() {
playSound(1);
if (gameState == "playing") {
pressedNum = undefined;
i = 0;
while (i < ballNum) {
hitR = eval ("objHolder.b" + i).hitTest(_xmouse, _ymouse, true);
if (hitR) {
pressedNum = i;
}
i++;
}
if (pressedNum != undefined) {
eval ("objHolder.b" + pressedNum).zstate = "pop";
}
}
}
function tellPlayer(temp) {
attachMovie("tellPlayer", "tellPlayer", 2002);
if (temp == "level announce") {
tellPlayerText = "Level " + level;
}
if (temp == "life lost") {
tellPlayerText = "Life Lost";
}
if (temp == "restart") {
tellPlayerText = "Noooo!!!";
}
}
gameState = "setup";
onEnterFrame = function () {
switch (gameState) {
case "playing" :
if (levelFlowers < 1) {
trace("level coplete from 'playing'");
gameState = "level complete";
trace(gameState);
return;
}
monsterGen();
if (!playerMoving) {
keyFunc();
}
if (playerMoving) {
lastPressed = "";
t1 = pxTarget - px;
t2 = pyTarget - py;
if (Math.abs(t1) < 2) {
px = pxTarget;
} else {
px = px + (t1 * 0.3);
}
if (Math.abs(t2) < 2) {
py = pyTarget;
} else {
py = py + (t2 * 0.3);
}
if ((px == pxTarget) && (py == pyTarget)) {
playerMoving = false;
}
player._x = px;
player._y = py;
}
return;
case "setup" :
setup();
gameState = "start level";
return;
case "start level" :
tellPlayer("level announce");
trace("level = " + level);
setupLevel();
gameState = "playing";
return;
case "lose life" :
trace(gameState);
i = 0;
while (i < 10) {
removeMovieClip(eval ("objHolder.enemy" + i));
i++;
}
tellPlayer("restart");
lives--;
if (lives != 0) {
player.gotoAndStop(6);
gameState = "lose life wait";
c = 60;
rn = 0;
} else {
gameState = "game over";
}
return;
case "lose life wait" :
c--;
if (c < 1) {
gameState = "next life";
}
return;
case "game over" :
playSound("gameOverSnd");
gameState = "null";
gotoAndPlay (40);
return;
case "next life" :
trace(gamestate);
monsterGenCount = 0;
monsterCount = 0;
pxTarget = 0;
pyTarget = 0;
playerMoving = false;
px = 20;
py = 100;
t = attachMovie("player", "player", 2000);
player.gotoAndStop(2);
player._x = 20;
player._y = 100;
if (lives < 1) {
gameState = "game over";
} else {
gameState = "playing";
}
return;
case "level complete" :
trace(gameState);
gameState = "exit level wait";
c = 60;
player.gotoAndStop(5);
rn = 0;
i = 0;
while (i < 10) {
removeMovieClip(eval ("objHolder.enemy" + i));
i++;
}
return;
case "exit level wait" :
player._alpha = player._alpha - 1;
c--;
if (c < 1) {
if (eval ("objHolder.b" + rn) == undefined) {
rn++;
}
removeMovieClip(eval ("objHolder.b" + rn));
if (eval ("objHolder.b" + rn) == undefined) {
rn++;
}
removeMovieClip(eval ("objHolder.b" + rn));
rn++;
c = 1;
if (rn > (stageHeight * stageWidth)) {
gameState = "next level";
}
}
return;
case "next level" :
level++;
if (level > 5) {
gameState = "game complete";
} else {
gameState = "start level";
}
return;
case "game complete" :
trace(gameState);
gameState = "null";
gotoAndPlay (74);
return;
}
};
stop();
stop();
Frame 23
playFlower.onLoad = function () {
this.rot = false;
};
playFlower.onEnterFrame = function () {
if (this.rot) {
this._rotation = this._rotation + 2;
}
};
playBtn.onRelease = function () {
playSound("mouseDownSnd");
gotoAndPlay (20);
};
playBtn.onRollOut = function () {
playFlower.rot = false;
};
playBtn.onRollOver = function () {
playFlower.rot = true;
playSound("mouseOverSnd");
};
Frame 39
stop();
Frame 40
playFlower.onLoad = function () {
this.rot = false;
};
playFlower.onEnterFrame = function () {
if (this.rot) {
this._rotation = this._rotation + 2;
}
};
playBtn.onRelease = function () {
playSound("mouseDownSnd");
removeMovieClip(_root.highHolder);
gotoAndPlay (20);
};
playBtn.onRollOut = function () {
playFlower.rot = false;
};
playBtn.onRollOver = function () {
playFlower.rot = true;
playSound("mouseOverSnd");
};
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
_quality = "high";
removeMovieClip(player);
if (score > 1000) {
t = this.createEmptyMovieClip("highHolder", 1000);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 28;
t._y = 261;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.flush();
Frame 73
stop();
Frame 74
menuBtn.onRelease = function () {
playSound("mouseDownSnd");
gotoAndPlay (6);
};
menuBtn.onRollOver = function () {
playSound("mouseOverSnd");
};
removeMovieClip(player);
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
playFlower.onLoad = function () {
this.rot = false;
};
playFlower.onEnterFrame = function () {
if (this.rot) {
this._rotation = this._rotation + 2;
}
};
sendToFriendFlower.onLoad = function () {
this.rot = false;
};
sendToFriendFlower.onEnterFrame = function () {
if (this.rot) {
this._rotation = this._rotation + 2;
}
};
playBtn.onRelease = function () {
playSound("mouseDownSnd");
removeMovieClip(_root.highHolder);
gotoAndPlay (20);
};
playBtn.onRollOut = function () {
playFlower.rot = false;
};
playBtn.onRollOver = function () {
playFlower.rot = true;
playSound("mouseOverSnd");
};
sendToFriend.onRelease = function () {
playSound("mouseDownSnd");
gotoAndPlay (20);
};
if (score > 1000) {
t = this.createEmptyMovieClip("highHolder", 1000);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 28;
t._y = 261;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.flush();
Frame 81
stop();
Symbol 235 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 236 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 237 MovieClip [__Packages.bd_objectClass] Frame 0
class bd_objectClass extends MovieClip
{
var objType, clip, _x, x, _y, y, zstate, speed, xMove, angle, yMove, left, right, delay, c, dir, _rotation, _xscale, _yscale, removeMovieClip;
function bd_objectClass () {
super();
}
function onLoad() {
if (objType == "diamond") {
clip.gotoAndStop(random(30) + 1);
}
if (objType == "boulder") {
clip.gotoAndStop(random(10) + 1);
}
if (objType == "dirt") {
clip.gotoAndStop(random(10) + 1);
}
_x = x;
_y = y;
zstate = "wait";
speed = 6;
xMove = speed * Math.cos((angle * Math.PI) / 180);
yMove = speed * Math.sin((angle * Math.PI) / 180);
yMove = 6;
angle = 90;
left._visible = false;
right._visible = false;
delay = 15 + random(15);
c = delay;
}
function onEnterFrame() {
if (_root.gameState == "playing") {
switch (zstate) {
case "wait" :
break;
case "pop" :
c = 30;
zstate = "pop wait";
dir = 5 * (random(3) - 1);
break;
case "pop wait" :
_rotation = _rotation + dir;
_xscale = (_yscale = _yscale * 0.8);
if (_xscale < 10) {
removeMovieClip();
}
break;
case "die" :
removeMovieClip();
break;
}
}
}
}
Symbol 238 MovieClip [__Packages.dustClass] Frame 0
class dustClass extends MovieClip
{
var angle, speed, tmpAngle, bx, by, l, x, _x, y, _y, gotoAndStop, removeMovieClip;
function dustClass () {
super();
}
function onLoad() {
angle = random(360);
speed = 2;
tmpAngle = (angle * Math.PI) / 180;
bx = speed * Math.cos(tmpAngle);
by = speed * Math.sin(tmpAngle);
l = 10;
x = _x;
y = _y;
gotoAndStop(random(3) + 1);
}
function onEnterFrame() {
_x = x;
_y = y;
x = x + bx;
y = y + by;
l--;
if (l < 1) {
removeMovieClip();
}
}
}
Symbol 239 MovieClip [__Packages.tellPlayerClass] Frame 0
class tellPlayerClass extends MovieClip
{
var _x, _y, l, _xscale, _yscale, _alpha, removeMovieClip;
function tellPlayerClass () {
super();
}
function onLoad() {
_x = 320;
_y = 240;
l = 230;
_xscale = (_yscale = 50);
_alpha = 50;
}
function onEnterFrame() {
if (_xscale > 130) {
_alpha = _alpha - 2;
} else if (_alpha < 100) {
_alpha = _alpha + 5;
}
_xscale = (_yscale = _yscale + 2);
l--;
if (_alpha < 2) {
removeMovieClip();
}
}
}
Symbol 240 MovieClip [__Packages.enemyClass] Frame 0
class enemyClass extends MovieClip
{
var angle, bugType, speed, tmpAngle, bx, by, _rotation, moveSpeed, x, _x, y, _y, moving, radians;
function enemyClass () {
super();
}
function onLoad() {
angle = 0;
angle = random(180) + 180;
trace("bug angle = " + angle);
if (bugType == 1) {
speed = 0.55;
speed = 0.68;
} else {
speed = 2.2;
speed = 2.5;
}
tmpAngle = (angle * Math.PI) / 180;
bx = speed * Math.cos(tmpAngle);
by = speed * Math.sin(tmpAngle);
_rotation = 90 + angle;
moveSpeed = 0.1;
x = _x;
y = _y;
moving = true;
}
function onEnterFrame() {
if (_root.gameState == "playing") {
if (Math.abs(x - _root.px) < 20) {
if (Math.abs(y - _root.py) < 20) {
_root.hurtPlayer();
}
}
if (bugType != 1) {
angle = angle + ((Math.random() * 10) - 5);
}
if (bugType == 1) {
if (random(3) == 0) {
radians = Math.atan2(_root.py - y, _root.px - x);
angle = Math.floor((radians * 180) / Math.PI);
tmpAngle = (angle * Math.PI) / 180;
bx = speed * Math.cos(tmpAngle);
by = speed * Math.sin(tmpAngle);
_rotation = angle + 90;
}
}
if (x < 20) {
x = 20;
angle = angle - 10;
}
if (x > 620) {
x = 620;
angle = angle - 10;
}
if (y < 100) {
y = 100;
angle = angle - 10;
}
if (y > 440) {
y = 440;
angle = angle - 10;
}
if (angle > 360) {
angle = angle - 360;
}
if (angle < 0) {
angle = angle + 360;
}
_rotation = 90 + angle;
tmpAngle = (angle * Math.PI) / 180;
bx = speed * Math.cos(tmpAngle);
by = speed * Math.sin(tmpAngle);
x = x + bx;
y = y + by;
_x = x;
_y = y;
}
}
}
Symbol 241 MovieClip [__Packages.monsterSpawnClass] Frame 0
class monsterSpawnClass extends MovieClip
{
var _xscale, _yscale, c, removeMovieClip;
function monsterSpawnClass () {
super();
}
function onLoad() {
_xscale = (_yscale = 50);
c = 0;
}
function onEnterFrame() {
c++;
if (c > 20) {
removeMovieClip();
}
_xscale = (_yscale = _yscale + 5);
}
}
Symbol 242 MovieClip [__Packages.pointsClass] Frame 0
class pointsClass extends MovieClip
{
var speed, _y, _alpha, removeMovieClip;
function pointsClass () {
super();
}
function onLoad() {
speed = 1;
}
function onEnterFrame() {
_y = _y - speed;
_alpha = _alpha - speed;
speed = speed * 1.05;
if (_alpha < 20) {
removeMovieClip();
}
}
}
Symbol 4 MovieClip [letter] Frame 1
#initclip 9
Object.registerClass("letter", letterClass);
#endinitclip
Symbol 16 MovieClip [points] Frame 1
#initclip 15
Object.registerClass("points", pointsClass);
#endinitclip
Symbol 39 MovieClip [bd_object] Frame 1
#initclip 10
Object.registerClass("bd_object", bd_objectClass);
#endinitclip
Symbol 50 MovieClip Frame 1
Symbol 50 MovieClip Frame 10
stop();
Symbol 61 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 10
stop();
Symbol 97 MovieClip Frame 21
stop();
Symbol 98 MovieClip [player] Frame 1
stop();
Symbol 101 MovieClip [dust] Frame 1
#initclip 11
Object.registerClass("dust", dustClass);
#endinitclip
Symbol 104 MovieClip [tellPlayer] Frame 1
#initclip 12
Object.registerClass("tellPlayer", tellPlayerClass);
#endinitclip
Symbol 109 MovieClip [showPlayer] Frame 62
removeMovieClip(this);
Symbol 156 MovieClip [enemy] Frame 1
#initclip 13
Object.registerClass("enemy", enemyClass);
#endinitclip
Symbol 158 MovieClip [monsterSpawnClip] Frame 1
#initclip 14
Object.registerClass("monsterSpawnClip", monsterSpawnClass);
#endinitclip
Symbol 172 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 1
_root.stop();
Symbol 178 MovieClip Frame 75
_root.play();
Symbol 196 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();