Frame 1
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
this._lockroot = true;
_root.authorsSite = "http://www.happymeal.com";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem(_root.authorsSite, gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
storage = SharedObject.getLocal("store");
yourHigh = storage.data.myhighscore;
if (yourHigh == undefined) {
storage.data.myhighscore = 100;
yourHigh = 100;
}
stop();
Frame 6
function attachSoundFromLibrary(idname) {
var _local1 = new Sound();
_local1.attachSound(idname);
return(_local1);
}
var explosion_snd = attachSoundFromLibrary("explosionSound.wav");
var jump_snd = attachSoundFromLibrary("jumpSound.wav");
var run_snd = attachSoundFromLibrary("runSound");
var powerup1_snd = attachSoundFromLibrary("powerupSound1.wav");
var powerup2_snd = attachSoundFromLibrary("powerupSound2.wav");
var lava_snd = attachSoundFromLibrary("lavaSound.wav");
var hitbarrier_snd = attachSoundFromLibrary("hitBarrierSound.wav");
var barrierFalls_snd = attachSoundFromLibrary("barrierFallsSound.wav");
var click_snd = attachSoundFromLibrary("clickSound.wav");
var electric_snd = attachSoundFromLibrary("electricSound.wav");
var musicHighlight_snd = attachSoundFromLibrary("musicHighlightSound.wav");
var mouseOver_snd = attachSoundFromLibrary("mouseOverSound.wav");
var step_snd = attachSoundFromLibrary("step.wav");
var rev_snd = attachSoundFromLibrary("engine");
var revUP_snd = attachSoundFromLibrary("rEVUP");
rev_snd.setVolume(20);
Frame 7
playBtnBlue.onRelease = function () {
gotoAndPlay (32);
music_snd.stop();
_global.car = "blue";
};
playBtnRed.onRelease = function () {
gotoAndPlay (32);
music_snd.stop();
_global.car = "red";
};
howBtn.onRelease = function () {
gotoAndPlay (31);
music_snd.stop();
};
sendToAFriend_btn.onRelease = function () {
gotoAndPlay (183);
music_snd.stop();
};
music_snd.start(0, 99);
_quality = "high";
Frame 30
stop();
Frame 31
stop();
backBtn.onRelease = function () {
gotoAndPlay (7);
};
Frame 32
function setup() {
music_snd.start(0, 99);
currentStageTime = 0;
this.progressIndicator.clip._xscale = 0;
i = 0;
while (i < roadArray.length) {
if (roadArray[i] == 14) {
levelDist = (i * 390) - 1320;
}
i++;
}
this.progressIndicator.clip._xscale = 0;
this.progressIndicator.clip2._xscale = 100;
trace(_global.car);
nosCount = 0;
myBlur = new flash.filters.BlurFilter(8, 2, 1);
speedoLightCount = 0;
stageStarted = false;
playerRunFrame = 1;
playerAnimState = 1;
jumpRange = 0;
jumpOffset = 0;
jumpSpeed = 1;
nosSound = 0;
revSound = 0;
stage.attachMovie("player", "player", 400);
if (_global.car == "red") {
stage.player.blue._visible = false;
stage.player.red._visible = true;
} else {
stage.player.blue._visible = true;
stage.player.red._visible = false;
}
var iso = new Isometric();
player = {x:620, y:0, z:-300, clip:stage.player, shadowClip:stage.shadow};
barrierNum = 1;
backPos = 0;
nitrous = 0;
tileNum = 1;
timeDelay = 40;
timeCount = 0;
levelProgress = 400;
currentPos = int(levelProgress / 30);
maxNOSpeed = 80;
maxSpeed = 30;
moveSpeed = 20;
backSpeed = moveSpeed * 0.25;
midSpeed = moveSpeed * 0.35;
midPos = 0;
backPos = 0;
_quality = "medium";
speed = 10;
this.movieState = "playing";
roadHolder.theStage.attachMovie("tile", "t" + tileNum, tileNum);
with (eval ("roadHolder.theStage.t" + tileNum)) {
clip.x = 670;
clip.y = 0;
clip.z = -850;
clip._visible = false;
gotoAndStop(2);
}
tileNum++;
roadHolder.theStage.attachMovie("tile", "t" + tileNum, tileNum);
with (eval ("roadHolder.theStage.t" + tileNum)) {
clip.x = 670;
clip.y = 0;
clip.z = -460;
clip._visible = false;
gotoAndStop(2);
}
tileNum++;
roadHolder.theStage.attachMovie("tile", "t" + tileNum, tileNum);
with (eval ("roadHolder.theStage.t" + tileNum)) {
clip.x = 670;
clip.y = 0;
clip.z = -70;
gotoAndStop(2);
clip._visible = false;
}
tileNum++;
this.backGround.attachMovie("back", "b" + tileNum, tileNum);
with (eval ("this.backGround.b" + tileNum)) {
clip.x = 250;
clip.y = 0;
clip.z = 350;
}
tileNum++;
this.backGround.attachMovie("back", "b" + tileNum, tileNum);
with (eval ("this.backGround.b" + tileNum)) {
clip.x = 250;
clip.y = 0;
clip.z = -300;
}
tileNum++;
this.backGround.attachMovie("mid", "m" + tileNum, tileNum + 1000);
with (eval ("this.backGround.m" + tileNum)) {
clip.x = 250;
clip.y = 140;
clip.z = -200;
gotoAndStop(random(6) + 1);
}
tileNum++;
attachMovie("Ready", "Ready", 100);
Ready._x = 320;
Ready._y = 240;
}
function captureKeys() {
keyPressed = false;
upPressed = false;
if (Key.isDown(39)) {
keyPressed = true;
if (playerAnimState != 3) {
playerAnimState = 5;
player.x = player.x + speed;
if (player.x > 760) {
player.x = 760;
}
if (player.x < 590) {
playersDepth = 200;
}
if ((player.x > 589) && (player.x < 690)) {
playersDepth = 400;
}
if (player.x > 689) {
playersDepth = 600;
}
stage.player.swapDepths(playersDepth);
}
} else if (Key.isDown(37)) {
keyPressed = true;
if (playerAnimState != 3) {
playerAnimState = 4;
player.x = player.x - speed;
if (player.x < 460) {
player.x = 460;
}
if (player.x < 590) {
playersDepth = 200;
}
if ((player.x > 589) && (player.x < 690)) {
playersDepth = 400;
}
if (player.x > 689) {
playersDepth = 600;
}
stage.player.swapDepths(playersDepth);
}
}
if (Key.isDown(40)) {
upPressed = false;
if (playerAnimState != 3) {
if (stageStarted == true) {
if (moveSpeed > 10) {
moveSpeed = moveSpeed - 0.5;
}
player.z = player.z - speed;
if (player.z < -500) {
player.z = -500;
}
}
}
}
if (Key.isDown(38)) {
upPressed = true;
if (playerAnimState != 3) {
if (stageStarted == true) {
if (!Key.isDown(32)) {
if (moveSpeed > maxSpeed) {
moveSpeed = moveSpeed - 5;
}
}
if (moveSpeed < maxSpeed) {
moveSpeed = moveSpeed + 0.25;
}
if (revSound == 0) {
revUP_snd.start(0, 1);
revSound = 1;
}
player.z = player.z + speed;
if (player.z > -50) {
player.z = -50;
}
}
}
}
if (Key.isDown(32)) {
if (stageStarted == true) {
if (nitrous > 0) {
if (nosSound == 0) {
nosSound = 10;
jump_snd.start();
}
if (nosSound > 0) {
nosSound--;
}
if (!keyPressed) {
keyPressed = true;
playerAnimState = 3;
stage.player.filters = [myBlur];
if (moveSpeed < maxNOSpeed) {
moveSpeed = moveSpeed + 20;
} else {
moveSpeed = maxNOSpeed;
}
speedo.over.full = false;
}
if (playerAnimState == 3) {
playerAnimState = 3;
jumpAnimFrame = 1;
jumpAngle = Math.PI;
jumpMax = (Math.PI*2);
}
nitrous = nitrous - 1;
if (nitrous == 0) {
nosSound = 0;
keyPressed = false;
moveSpeed = moveSpeed - 5;
stage.player.filters = [];
}
} else if (moveSpeed > maxSpeed) {
moveSpeed = moveSpeed - 5;
}
}
}
if (!keyPressed) {
if (playerAnimState != 3) {
stage.player.filters = [];
playerAnimState = 1;
}
}
if (!upPressed) {
if (playerAnimState != 3) {
if (stageStarted == true) {
revSound = 0;
if (moveSpeed > 20) {
moveSpeed = moveSpeed - 0.5;
}
player.z = player.z - speed;
if (player.z < -500) {
player.z = -500;
}
}
}
}
}
function sideClass() {
}
function tileClass() {
}
function backClass() {
}
function midClass() {
}
function barrierClass() {
}
sideClass.prototype = new MovieClip();
sideClass.prototype.onLoad = function () {
this.z = this.clip.z;
this.x = this.clip.x;
this.y = this.clip.y;
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
this.clip._visible = false;
};
sideClass.prototype.onEnterFrame = function () {
if (movieState == "playing") {
this.z = this.z - moveSpeed;
if (this.z < -900) {
removeMovieClip(this);
}
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
}
};
Object.registerClass("side", sideClass);
tileClass.prototype = new MovieClip();
tileClass.prototype.onLoad = function () {
if (movieState == "playing") {
this.z = this.clip.z;
this.x = this.clip.x;
this.y = this.clip.y;
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
}
};
tileClass.prototype.onEnterFrame = function () {
if (movieState == "playing") {
this.z = this.z - moveSpeed;
if (this.z < -1350) {
removeMovieClip(this);
}
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
}
};
Object.registerClass("tile", tileClass);
backClass.prototype = new MovieClip();
backClass.prototype.onLoad = function () {
this.z = this.clip.z;
this.x = this.clip.x;
this.y = this.clip.y;
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
this.clip._visible = false;
};
backClass.prototype.onEnterFrame = function () {
if (movieState == "playing") {
this.z = this.z - backSpeed;
if (this.z < -1490) {
removeMovieClip(this);
}
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
}
};
Object.registerClass("back", backClass);
midClass.prototype = new MovieClip();
midClass.prototype.onLoad = function () {
this.z = this.clip.z;
this.x = this.clip.x;
this.y = this.clip.y;
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
};
midClass.prototype.onEnterFrame = function () {
if (movieState == "playing") {
this.z = this.z - midSpeed;
if (this.z < -1300) {
removeMovieClip(this);
}
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
}
};
Object.registerClass("mid", midClass);
barrierClass.prototype = new MovieClip();
barrierClass.prototype.onLoad = function () {
this.z = this.clip.z;
this.x = this.clip.x;
this.y = this.clip.y;
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
this.clip._visible = false;
this.barType = this.clip.barType;
this.barState = "norm";
};
barrierClass.prototype.onEnterFrame = function () {
if (movieState == "playing") {
this.z = this.z - moveSpeed;
if (this.z < -850) {
removeMovieClip(this);
}
var _local3 = _root.mapToScreen(this.x, this.y, this.z);
this._x = _local3[0];
this._y = _local3[1];
}
};
Object.registerClass("barrier", barrierClass);
function slowPlayer() {
moveSpeed = moveSpeed * 0.5;
}
function addNOS() {
this.speedo.over.gotoAndPlay(2);
nitrous = Number(nitrous) + 30;
nosCount = Number(nosCount) + 1;
if (Number(nitrous) >= 100) {
nitrous = 100;
this.speedo.over.full = true;
}
}
function collisionTest() {
testNum = barrierNum - 5;
while (testNum < barrierNum) {
testObj = eval ("stage.bar" + testNum);
if (testObj != undefined) {
if (testObj.barState == "norm") {
testObjectX = testObj.x;
testObjectZ = testObj.z + 60;
dx = player.x - testObjectX;
dy = player.z - testObjectZ;
dist = Math.floor(Math.sqrt((dx * dx) + (dy * dy)));
if (dist < 70) {
testObj.barState = "hit";
hitObjNum = testObj.barType;
if ((hitObjNum > 0) && (hitObjNum < 10)) {
trace(jumpOffset);
if (jumpOffset > -55) {
levelStartTime = levelStartTime - 1000;
testObj.anim.gotoAndStop(2);
slowPlayer();
hitbarrier_snd.start();
}
} else if ((hitObjNum > 9) && (hitObjNum < 19)) {
if (jumpOffset > -55) {
levelStartTime = levelStartTime - 1000;
testObj.anim.gotoAndStop(2);
slowPlayer();
hitbarrier_snd.start();
}
} else if ((hitObjNum > 19) && (hitObjNum < 29)) {
if (jumpOffset > -55) {
levelStartTime = levelStartTime - 1000;
addNOS();
testObj.anim.gotoAndStop(2);
explosion_snd.start();
}
return;
}
}
}
}
testNum++;
}
}
function placePlayer() {
this.speedo.speedo_meter._rotation = Math.ceil(((moveSpeed - 8) / 22) * 18) * 5;
this.speedo.nos._alpha = nitrous;
tellX = player.x;
tellY = player.y;
tellZ = player.z;
var _local3 = mapToScreen(player.x, player.y, player.z);
player.clip._x = _local3[0];
player.clip._y = _local3[1];
_local3 = mapToScreen(player.x, 0, player.z);
player.shadowClip._x = _local3[0];
player.shadowClip._y = _local3[1];
if (player.y < 0) {
shadowScale = 100 + (player.y * 0.5);
if (shadowScale < 0) {
shadowScale = 0;
}
player.shadowClip._xscale = (player.shadowClip._yscale = shadowScale);
player.y = player.y + 6;
}
if (player.y > 0) {
player.y = 0;
}
if (player.y < -3) {
playerAnimState = 3;
}
if (player.y == 0) {
}
switch (playerAnimState) {
case 1 :
stage.player.gotoAndStop(playerRunFrame);
runAnimSpeed = 1 + (moveSpeed / 15);
playerRunFrame = int(playerRunFrame + runAnimSpeed);
if (playerRunFrame > 20) {
playerRunFrame = playerRunFrame - 20;
}
break;
case 2 :
break;
case 3 :
if (jumpAngle < jumpMax) {
jumpOffset = Math.sin(jumpAngle) * jumpRange;
if (jumpOffset < 0) {
player.y = jumpOffset;
}
jumpAngle = jumpAngle + jumpSpeed;
stage.player.gotoAndStop(40);
jumpAnimFrame++;
} else {
playerAnimState = 1;
player.y = 0;
playerRunFrame = 1;
}
break;
case 4 :
if (_global.car == "red") {
stage.player.gotoAndStop("redleft");
} else {
stage.player.gotoAndStop("blueleft");
}
break;
case 5 :
if (_global.car == "red") {
stage.player.gotoAndStop("redright");
} else {
stage.player.gotoAndStop("blueright");
}
break;
default :
playerAnimState = 1;
}
}
function Isometric(x, z) {
maxx = x;
maxz = z;
theta = 30;
alpha = 45;
theta = theta * (Math.PI/180);
alpha = alpha * (Math.PI/180);
sinTheta = Math.sin(theta);
cosTheta = Math.cos(theta);
sinAlpha = Math.sin(alpha);
cosAlpha = Math.cos(alpha);
leeway = 5;
}
function mapToScreen(xpp, ypp, zpp) {
yp = ypp;
xp = (xpp * cosAlpha) + (zpp * sinAlpha);
zp = (zpp * cosAlpha) - (xpp * sinAlpha);
x = xp;
y = (yp * cosTheta) - (zp * sinTheta);
return([x, y]);
}
function mapToIsoWorld(screenX, screenY) {
z = ((screenX / cosAlpha) - (screenY / (sinAlpha * sinTheta))) * (1 / ((cosAlpha / sinAlpha) + (sinAlpha / cosAlpha)));
x = (1 / cosAlpha) * (screenX - (z * sinAlpha));
return([x, z]);
}
function changeY(num) {
player.y = player.y + num;
if (player.y > 0) {
player.y = 0;
}
}
roadArray = new Array(0, 11, 7, 10, 4, 5, 4, 2, 1, 6, 1, 6, 1, 11, 1, 11, 1, 2, 2, 4, 6, 4, 5, 2, 1, 2, 7, 7, 7, 1, 11, 1, 11, 2, 2, 5, 2, 5, 2, 1, 2, 1, 2, 1, 6, 6, 11, 2, 11, 2, 7, 1, 7, 1, 2, 2, 11, 2, 11, 2, 7, 7, 7, 14, 7, 1, 2, 2, 2);
barrierArray = new Array(0, 0, 0, 0, 0, 0, 0, 0, 6, 2, 26, 0, 7, 0, 0, 23, 18, 0, 13, 0, 0, 9, 0, 18, 0, 15, 8, 7, 0, 14, 15, 0, 0, 0, 21, 22, 0, 26, 0, 0, 0, 7, 0, 21, 23, 0, 0, 9, 0, 0, 0, 1, 22, 14, 13, 27, 6, 0, 0, 21, 15, 22, 0, 0, 6, 0, 0);
function moveRoad() {
progM = ((levelProgress - levelStartDist) / levelDist) * 100;
this.progressIndicator.clip._xscale = progM;
this.progressIndicator.clip2._xscale = 100 - progM;
speedoLightCount = speedoLightCount + int(moveSpeed / 5);
if (speedoLightCount > 10) {
speedoLightCount = 1;
}
this.speedo.speedoLight.gotoAndStop(speedoLightCount);
if (playerAnimState != 3) {
if (stageStarted == true) {
moveSpeed = moveSpeed + 0.085;
}
}
backSpeed = moveSpeed * 0.25;
midSpeed = moveSpeed * 0.35;
a = 0;
levelProgress = levelProgress + moveSpeed;
if (moveSpeed < 10) {
moveSpeed = 10;
}
tempBarPos = int(levelProgress / 390);
if (tempBarPos > currentPos) {
if (barrierArray[tempBarPos] > 0) {
barType = barrierArray[tempBarPos];
switch (barType) {
case 1 :
attachItem(500, barType, 100);
break;
case 2 :
attachItem(560, barType, 100);
break;
case 3 :
attachItem(620, barType, 300);
break;
case 4 :
attachItem(680, barType, 300);
break;
case 5 :
attachItem(730, barType, 500);
break;
case 6 :
attachItem(500, barType, 100);
attachItem(730, barType, 500);
break;
case 7 :
attachItem(620, barType, 300);
attachItem(730, barType, 500);
break;
case 8 :
attachItem(500, barType, 100);
attachItem(620, barType, 300);
break;
case 9 :
attachItem(500, barType, 100);
attachItem(730, barType, 500);
break;
case 10 :
attachItem(500, barType, 100);
break;
case 11 :
attachItem(560, barType, 100);
break;
case 12 :
attachItem(620, barType, 300);
break;
case 13 :
attachItem(680, barType, 300);
break;
case 14 :
attachItem(730, barType, 500);
break;
case 15 :
attachItem(500, barType, 100);
attachItem(730, barType, 500);
break;
case 16 :
attachItem(620, barType, 300);
attachItem(730, barType, 500);
break;
case 17 :
attachItem(500, barType, 100);
attachItem(620, barType, 300);
break;
case 18 :
attachItem(500, barType, 100);
attachItem(730, barType, 500);
break;
case 20 :
attachItem(500, barType, 100);
break;
case 21 :
attachItem(560, barType, 100);
break;
case 22 :
attachItem(620, barType, 300);
break;
case 23 :
attachItem(680, barType, 300);
break;
case 24 :
attachItem(730, barType, 500);
break;
case 25 :
attachItem(500, barType, 100);
attachItem(730, barType, 500);
break;
case 26 :
attachItem(620, barType, 300);
attachItem(730, barType, 500);
break;
case 27 :
attachItem(500, barType, 100);
attachItem(620, barType, 300);
break;
}
}
}
tempTilePos = int(levelProgress / 390);
if (tempTilePos != currentPos) {
roadPeice = roadArray[currentPos];
roadHolder.theStage.attachMovie("tile", "t" + tileNum, tileNum);
with (eval ("roadHolder.theStage.t" + tileNum)) {
clip.x = 670;
clip.y = 0;
clip.z = 248;
gotoAndStop(roadPeice);
clip._visible = false;
}
tileNum++;
if (roadPeice == 1) {
foreGround.attachMovie("side", "s" + tileNum, tileNum);
with (eval ("foreGround.s" + tileNum)) {
clip.x = 800;
clip.y = 0;
clip.z = 640;
gotoAndStop(1);
}
tileNum++;
}
if (roadPeice == 10) {
foreGround.attachMovie("side", "s" + tileNum, tileNum);
with (eval ("foreGround.s" + tileNum)) {
clip.x = 800;
clip.y = 0;
clip.z = 640;
gotoAndStop(2);
}
tileNum++;
}
if (roadPeice == 14) {
foreGround.attachMovie("side", "s" + tileNum, tileNum);
with (eval ("foreGround.s" + tileNum)) {
clip.x = 800;
clip.y = 0;
clip.z = 640;
gotoAndStop(3);
}
tileNum++;
}
a++;
currentPos = tempTilePos;
if (roadArray[currentPos - 3] == 10) {
trace("start level");
stageStarted = true;
levelStartTime = getTimer();
levelStartDist = levelProgress;
}
if (roadArray[currentPos - 4] == 14) {
trace("race complete");
stageStarted = false;
this.movieState = "game over";
}
}
tempBackPos = Math.floor(levelProgress / 4360);
if (tempBackPos > backPos) {
this.backGround.attachMovie("back", "b" + tileNum, tileNum);
with (eval ("this.backGround.b" + tileNum)) {
clip.x = 250;
clip.y = 0;
clip.z = 700;
gotoAndStop(random(3) + 1);
}
backPos = tempBackPos;
}
tempPos = int(levelProgress / 3000);
if (tempPos > midPos) {
this.backGround.attachMovie("mid", "m" + tileNum, tileNum + 1000);
with (eval ("this.backGround.m" + tileNum)) {
clip.x = 250;
clip.y = 140;
clip.z = 550;
gotoAndStop(random(6) + 1);
}
midPos = tempPos;
}
if (tileNum > 1000) {
tileNum = 1;
}
}
function attachItem(txpos, tbtype, tclvl) {
stage.attachMovie("barrier", "bar" + barrierNum, barrierNum + tclvl);
with (eval ("stage.bar" + barrierNum)) {
clip.x = txpos;
clip.y = 0;
clip.z = 350;
clip.barType = tbtype;
gotoAndStop(tbtype);
anim.gotoAndStop(1);
}
barrierNum++;
if (barrierNum > 90) {
barrierNum = 0;
}
}
function frameAction() {
switch (this.movieState) {
case "setup" :
stageTime = 0;
gameStage = 1;
setup();
rev_snd.start(0, 999);
if (car == "blue") {
fusionLogo._visible = false;
}
break;
case "playing" :
captureKeys();
placePlayer();
collisionTest();
moveRoad();
calculateTime();
displaySpeed = Math.round(moveSpeed) * 3;
break;
case "paused" :
break;
case "game over" :
rev_snd.stop();
_quality = "high";
music_snd.stop();
gotoAndPlay (42);
delete movieState;
break;
case "game over wait" :
break;
default :
this.movieState = "setup";
}
}
function calculateTime() {
if (stageStarted == true) {
levelNowTime = getTimer();
currentStageTime = (levelNowTime - levelStartTime) / 1000;
}
}
Instance of Symbol 195 MovieClip in Frame 32
onClipEvent (enterFrame) {
_parent.frameAction();
}
Frame 41
stop();
Frame 42
_quality = "high";
newBestTimeVar = false;
if (currentStageTime < yourHigh) {
yourHigh = currentStageTime;
storage.data.myhighscore = yourHigh;
storage.flush();
newBestTimeVar = true;
} else {
newBestTime._visible = false;
}
playAgainBtn.onRelease = function () {
gotoAndPlay (32);
};
sendToAFriend_btn.onRelease = function () {
gotoAndPlay (183);
};
Frame 149
if (newBestTimeVar == false) {
raceComplete.gotoAndStop(2);
} else {
raceComplete.gotoAndStop(1);
}
Frame 182
stop();
Frame 183
_level0.loadTakeOverSection("ParentsDataCollectionDisclaimer");
playAgain_btn.onRelease = function () {
gotoAndPlay (7);
};
sendBtn.onRelease = function () {
this._parent.sendToFriend(this._parent.yourName_txt.text, this._parent.friendName_txt.text, this._parent.friendEmail_txt.text, this._parent);
};
this.yourName_txt.tabIndex = 601;
this.friendName_txt.tabIndex = 602;
this.friendEmail_txt.tabIndex = 603;
this.sendBtn.tabIndex = 604;
this.yourName_txt.onSetFocus = function () {
if (this.text == "Your First Name") {
this.text = "";
}
};
this.yourName_txt.onKillFocus = function () {
if (this.text == "") {
this.text = "Your First Name";
}
};
this.friendName_txt.onSetFocus = function () {
if (this.text == "Friend's First Name") {
this.text = "";
}
};
this.friendName_txt.onKillFocus = function () {
if (this.text == "") {
this.text = "Friend's First Name";
}
};
this.friendEmail_txt.onSetFocus = function () {
if (this.text == "Friend's Email") {
this.text = "";
}
};
this.friendEmail_txt.onKillFocus = function () {
if (this.text == "") {
this.text = "Friend's Email";
}
};
var sendToFriend = function (fromName, toName, toEmail, ref) {
trace("sendToFriend: ");
trace("from: " + fromName);
trace("to: " + toName);
trace("toE: " + toEmail);
var _local3 = 9;
var _local1 = new Object();
_local1.senderName = fromName;
_local1.toName = toName;
_local1.toEmail = toEmail;
_local1.friendName = toName;
_level0.sendToFriend("GameSunCitySprint", _local3, toEmail, _local1, new sugar.types.Handler(ref.onSTF, ref));
ref.gotoAndStop("sending");
};
var onSTF = function (myDP) {
myDP.display();
if (myDP.__get__totalErrors() == 0) {
gotoAndStop ("success");
} else {
gotoAndStop ("fail");
}
};
Frame 192
stop();
Frame 201
stop();
Frame 208
stop();
sendAnother_btn.onRelease = function () {
this._parent.gotoAndPlay("init");
};
playAgain_btn.onRelease = function () {
gotoAndPlay (7);
};
Frame 215
stop();
playAgain_btn.onRelease = function () {
gotoAndPlay (7);
};
Symbol 17 MovieClip Frame 1
this.onLoad = function () {
};
this.onEnterFrame = function () {
pL = Math.floor((this._parent.getBytesLoaded() / this._parent.getBytesTotal()) * 100);
this.dial._rotation = (pL / 100) * 215;
if (pL < 100) {
this.stop();
this._parent.stop();
} else {
this.play();
}
};
Symbol 17 MovieClip Frame 74
this._parent.play();
this.stop();
Symbol 280 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 281 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 282 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 283 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 284 MovieClip [__Packages.sugar.types.Handler] Frame 0
class sugar.types.Handler
{
var ourFunction, ourScope;
function Handler (myFunction, myScope) {
ourFunction = myFunction;
ourScope = myScope;
}
function get func() {
return(ourFunction);
}
function set func(myFunction) {
ourFunction = myFunction;
//return(func);
}
function get scope() {
return(ourScope);
}
function set scope(myScope) {
ourScope = myScope;
//return(scope);
}
function invoke(myParams) {
ourFunction.apply(ourScope, myParams);
}
}
Symbol 285 MovieClip [__Packages.DataPacket] Frame 0
class DataPacket
{
var ourData, ourOnResponse, ourResponseData, ourResponseErrors, ourRequestXML, ourTransactionID, ourResponseCode, ourAction, ourRawResponse;
function DataPacket () {
ourData = new Object();
ourOnResponse = new sugar.types.HandlerGroup();
ourResponseData = new Object();
ourResponseErrors = new Array();
ourRequestXML = new XML();
}
function addError(myError) {
ourResponseErrors.push(myError);
}
function get requestXML() {
return(ourRequestXML);
}
function set requestXML(myValue) {
ourRequestXML = myValue;
//return(requestXML);
}
function get data() {
return(ourData);
}
function set data(myValue) {
ourData = myValue;
//return(data);
}
function get onResponse() {
return(ourOnResponse);
}
function set onResponse(myValue) {
ourOnResponse = myValue;
//return(onResponse);
}
function get responseData() {
return(ourResponseData);
}
function set responseData(myValue) {
ourResponseData = myValue;
//return(responseData);
}
function get transactionID() {
return(ourTransactionID);
}
function set transactionID(myValue) {
ourTransactionID = myValue;
//return(transactionID);
}
function get responseCode() {
return(ourResponseCode);
}
function set responseCode(myValue) {
ourResponseCode = myValue;
//return(responseCode);
}
function get responseErrors() {
return(ourResponseErrors);
}
function set responseErrors(myValue) {
ourResponseErrors = myValue;
//return(responseErrors);
}
function get action() {
return(ourAction);
}
function set action(myValue) {
ourAction = myValue;
//return(action);
}
function get rawResponse() {
return(ourRawResponse);
}
function set rawResponse(myValue) {
ourRawResponse = myValue;
//return(rawResponse);
}
function responseLoaded() {
ourOnResponse.invokeAll([this]);
}
function get totalErrors() {
return(ourResponseErrors.length);
}
function display() {
trace("Data Packet ID:" + ourTransactionID);
trace(ourRawResponse);
}
}
Symbol 286 MovieClip [__Packages.sugar.types.HandlerGroup] Frame 0
class sugar.types.HandlerGroup
{
var ourHandlers;
function HandlerGroup () {
ourHandlers = new sugar.types.Collection();
}
function get handlers() {
return(ourHandlers);
}
function addHandler(myHandler) {
if (!(myHandler instanceof sugar.types.Handler)) {
trace("[HandlerGroup] ERROR: You tried to add a NON-HANDLER to a HandlerGroup.");
}
ourHandlers.addMember(myHandler);
}
function invokeAll(myParams) {
ourHandlers.walkCollection(invokeHandler, this, myParams);
}
function invokeHandler(myHandler, myIndex, myPassObj) {
myHandler.invoke(myPassObj);
}
}
Symbol 287 MovieClip [__Packages.sugar.types.Collection] Frame 0
class sugar.types.Collection extends Object
{
var ourCollection, ourAdditions;
function Collection () {
super();
sugar.dev.Debug.__set__className("Collection");
ourCollection = new Array();
ourAdditions = 0;
}
function get totalMembers() {
return(ourCollection.length);
}
function get totalAdditions() {
return(ourAdditions);
}
function shuffle() {
var _local4 = new sugar.types.Collection();
var _local5 = totalMembers;
var _local3 = 0;
while (_local3 < _local5) {
var _local2 = randomMember();
removeMember(_local2);
_local4.addMember(_local2);
_local3++;
}
setCollection(_local4);
}
function condense(Void) {
var _local3 = 0;
var _local4 = totalMembers;
var _local2 = 0;
while (_local2 <= _local4) {
if (ourCollection[_local2] == undefined) {
_local3++;
} else {
ourCollection[_local2 - _local3] = ourCollection[_local2];
ourCollection[_local2] = undefined;
}
_local2++;
}
}
function clearCollection(Void) {
ourCollection = new Array();
}
function setCollection(myColl) {
clearCollection();
var _local2 = 0;
while (_local2 < myColl.totalMembers) {
ourCollection[_local2] = myColl.findMemberByID(_local2);
_local2++;
}
}
function replaceIndex(myIndex, myContent) {
ourCollection[myIndex] = myContent;
}
function replaceMember(myDst, myContent) {
var _local2 = findMemberIndex(myDst);
replaceIndex(_local2, myContent);
}
function addMember(myObj, myIndex) {
if (myIndex == undefined) {
ourCollection.push(myObj);
} else {
ourCollection.splice(myIndex, 0, myObj);
}
ourAdditions++;
}
function addMembers(myObj) {
if (myObj.length != undefined) {
var _local3 = 0;
while (_local3 <= (myObj.length - 1)) {
addMember(myObj[_local3]);
_local3++;
}
return(undefined);
}
for (var _local3 in myObj) {
addMember(myObj[_local3]);
}
}
function findMember(myNeedle, myAtt) {
var _local2 = 0;
while (_local2 <= ourCollection.length) {
if (ourCollection[_local2][myAtt] == myNeedle) {
return(ourCollection[_local2]);
}
_local2++;
}
return(null);
}
function findMemberIndex(myObj) {
var _local2 = 0;
while (_local2 <= ourCollection.length) {
if (ourCollection[_local2] == myObj) {
return(_local2);
}
_local2++;
}
return(null);
}
function findMemberByID(myID) {
if (ourCollection[myID] != undefined) {
return(ourCollection[myID]);
}
return(null);
}
function index(myID) {
return(findMemberByID(myID));
}
function removeMember(myObj) {
var _local2 = new Number();
do {
_local2 = findMemberIndex(myObj);
if (_local2 == null) {
break;
}
removeIndex(_local2);
} while (_local2 != null);
}
function removeIndex(myIndex) {
ourCollection.splice(myIndex, 1);
}
function randomMember(Void) {
var _local2 = int(Math.random() * totalMembers);
return(findMemberByID(_local2));
}
function lastMember(Void) {
return(ourCollection[totalMembers - 1]);
}
function firstMember(Void) {
return(ourCollection[0]);
}
function walkCollection(myFunc, myScope, myObject, mySetToReturn) {
myScope = ((myScope == undefined) ? this : (myScope));
var _local2 = 0;
while (_local2 < totalMembers) {
var _local3 = myFunc.apply(myScope, [findMemberByID(_local2), _local2, myObject]);
if (mySetToReturn) {
replaceIndex(_local2, _local3);
}
_local2++;
}
}
function globalFunction(myFuncName, myPassObj) {
var _local2 = 0;
while (_local2 < totalMembers) {
index(_local2)[myFuncName](myPassObj);
_local2++;
}
}
function toArray() {
return(ourCollection);
}
function display() {
sugar.dev.Debug.out(sugar.dev.Debug.__get__MESSAGE(), ourCollection);
}
}
Symbol 288 MovieClip [__Packages.sugar.dev.Debug] Frame 0
class sugar.dev.Debug
{
static var ourClassName, ourDisplayLevel, ourRecurseObjects, ourTotalMessages, ourRecurseLevel;
function Debug () {
}
static function set className(myValue) {
ourClassName = myValue;
//return(className);
}
static function get className() {
return(ourClassName);
}
static function set displayLevel(myValue) {
ourDisplayLevel = myValue;
//return(displayLevel);
}
static function get displayLevel() {
return(ourDisplayLevel);
}
static function set recurseObjects(myValue) {
ourRecurseObjects = myValue;
//return(recurseObjects);
}
static function get recurseObjects() {
return(ourRecurseObjects);
}
static function get INIT() {
return(6);
}
static function get FATAL() {
return(5);
}
static function get CRITICAL() {
return(4);
}
static function get WARNING() {
return(3);
}
static function get MESSAGE() {
return(2);
}
static function get LOW() {
return(1);
}
static function subOut(myMessage) {
ourTotalMessages++;
var _local3 = " ";
var _local2 = 0;
while (_local2 <= int(ourRecurseLevel)) {
_local3 = _local3 + " ";
_local2++;
}
switch (typeof(myMessage)) {
case "object" :
for (var _local4 in myMessage) {
trace(((_local3 + _local4) + ":") + myMessage[_local4]);
ourRecurseLevel++;
if (ourRecurseObjects && (typeof(myMessage[_local4]) == "object")) {
subOut(myMessage[_local4]);
}
}
ourRecurseLevel--;
break;
default :
trace(_local3 + myMessage);
}
trace("");
}
static function out(myLevel, myMessage, myTitle) {
ourRecurseLevel = int(ourRecurseLevel);
ourTotalMessages = int(ourTotalMessages);
if (myLevel < displayLevel) {
return(undefined);
}
if (myLevel == INIT) {
trace(((("[" + className) + " ") + myMessage) + "]");
return(undefined);
}
var _local1 = new Date();
var _local3 = (((((_local1.getHours() + ":") + _local1.getMinutes()) + ":") + _local1.getSeconds()) + ".") + _local1.getMilliseconds();
trace(((((("L" + myLevel) + " M") + ourTotalMessages) + " [") + className) + "] ");
if (myTitle != undefined) {
trace(" " + myTitle);
}
subOut(myMessage);
ourRecurseLevel = 0;
}
}
Symbol 48 MovieClip Frame 7
if (_root.bottle == undefined) {
_root.createEmptyMovieClip("bottle", _root.getNextHighestDepth());
_root.bottle.attachMovie("barrelAnim", "object", 0);
}
new mx.transitions.Tween(_root.bottle, "_x", mx.transitions.easing.Strong.easeOut, 300, 580, 2, true);
new mx.transitions.Tween(_root.bottle, "_y", mx.transitions.easing.Strong.easeOut, 300, 580, 2, true);
new mx.transitions.Tween(_root.bottle, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, 2, true);
Symbol 48 MovieClip Frame 15
stop();
Symbol 49 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 105 MovieClip [tile] Frame 1
stop();
Symbol 111 MovieClip [Ready] Frame 168
removeMovieClip(this);
Symbol 128 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 1
full = false;
stop();
Symbol 216 MovieClip Frame 8
if (!full) {
this.gotoAndStop(1);
}
Symbol 216 MovieClip Frame 11
this.gotoAndPlay(2);
_root.stage.player.full.gotoAndPlay(2);
Symbol 259 MovieClip Frame 1
stop();
Symbol 259 MovieClip Frame 2
stop();