Frame 1
if (((_framesloaded / _totalframes) * 100) > 90) {
preloader._visible = false;
} else {
preloader._visible = true;
}
Instance of Symbol 3 MovieClip "preloader" in Frame 1
//component parameters
onClipEvent (initialize) {
r = 100;
color1 = 16777215 /* 0xFFFFFF */;
color2 = 10066329 /* 0x999999 */;
color4 = 16777215 /* 0xFFFFFF */;
color5 = 13421772 /* 0xCCCCCC */;
color3 = 0;
fcomp = 100;
}
Frame 2
function initialize() {
lives = 5;
cash = 0;
cashDisplay = 0;
gameState = "stop";
progress_bar_mc.gotoAndPlay(1);
}
function updateObstacle(obstacleTargetName) {
if (gameState == "play") {
obstacleTargetName.play();
}
if (gameState == "stop") {
obstacleTargetName.stop();
}
}
function testForCollision(xMin, xMax) {
if ((car_mc._x >= xMin) & (car_mc._x <= xMax)) {
car_mc._y = car_mc._y - 6;
sound_mc.gotoAndPlay("crash");
lives = lives - 1;
if (lives == 0) {
gotoAndPlay (88);
}
}
}
function testForCashCollision(xMin, xMax) {
if ((car_mc._x >= xMin) & (car_mc._x <= xMax)) {
car_mc._y = car_mc._y - 6;
sound_mc.gotoAndPlay("cash_register");
cash = cash + 10000;
num = String(cash).split(".");
commanum = "";
if (num.length == 2) {
commanum = "." + num[1];
}
if (length(num[0]) > 3) {
commanum = String(num[0]).substr(length(num[0]) - 3, 3) + commanum;
digit = length(num[0]) - 6;
while (digit >= 0) {
commanum = (String(num[0]).substr(digit, 3) + ",") + commanum;
digit = digit - 3;
}
if (digit > -3) {
commanum = (String(num[0]).substr(0, digit + 3) + ",") + commanum;
}
} else {
commanum = num[0] + commanum;
}
cashDisplay = commanum;
}
}
initialize();
stop();
this.onMouseUp = function () {
gotoAndPlay (10);
};
Frame 10
stop();
this.onMouseUp = function () {
gotoAndPlay (20);
};
Frame 20
this.onMouseUp = function () {
};
Instance of Symbol 45 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (_x > -221) {
_x = (_x - 0.5);
} else {
_x = 675;
}
}
Instance of Symbol 45 MovieClip in Frame 20
onClipEvent (enterFrame) {
if (_x > -221) {
_x = (_x - 0.5);
} else {
_x = 675;
}
}
Instance of Symbol 55 MovieClip "landscape_mc" in Frame 20
onClipEvent (load) {
startX = this._x;
}
onClipEvent (enterFrame) {
leftKey = 37;
rightKey = 39;
scrollIncrement = 2;
scrollLimit = 18;
if (_parent.gameState == "play") {
if (Key.isDown(leftKey)) {
if (this._x < (startX + scrollLimit)) {
this._x = this._x + scrollIncrement;
}
}
if (Key.isDown(rightKey)) {
if (this._x > (startX - scrollLimit)) {
this._x = this._x - scrollIncrement;
}
}
}
}
Instance of Symbol 62 MovieClip "road_mc" in Frame 20
onClipEvent (enterFrame) {
if (_parent.gameState == "play") {
nextFrame();
play();
}
if (_parent.gameState == "stop") {
stop();
}
}
Instance of Symbol 83 MovieClip "car_mc" in Frame 20
onClipEvent (enterFrame) {
if (_parent.gameState == "play") {
car_body_mc.brakelights._alpha = 0;
}
if (_parent.gameState == "stop") {
car_body_mc.brakelights._alpha = 100;
}
}
Instance of Symbol 91 MovieClip "progress_bar_mc" in Frame 20
onClipEvent (enterFrame) {
if (_parent.gameState == "play") {
nextFrame();
play();
}
if (_parent.gameState == "stop") {
stop();
}
}
Frame 74
stopAllSounds();
gotoAndPlay (75);
Frame 75
gameState = "play";
sound_mc.gotoAndPlay("screech");
smoke_mc.gotoAndPlay("puff");
stop();
Instance of Symbol 114 MovieClip "trees_and_signs_mc" in Frame 75
onClipEvent (load) {
this.gotoAndStop("start_position");
}
onClipEvent (enterFrame) {
if (_parent.gameState == "play") {
this.play();
}
if (_parent.gameState == "stop") {
this.stop();
}
}
Instance of Symbol 129 MovieClip "obstacle_01_mc" in Frame 75
onClipEvent (load) {
this.gotoAndStop("starting_line");
}
onClipEvent (enterFrame) {
_parent.updateObstacle(eval (this._target));
}
Instance of Symbol 141 MovieClip "obstacle_02_mc" in Frame 75
onClipEvent (load) {
this.gotoAndStop("starting_line");
}
onClipEvent (enterFrame) {
_parent.updateObstacle(eval (this._target));
}
Instance of Symbol 146 MovieClip "obstacle_06_mc" in Frame 75
onClipEvent (load) {
this.gotoAndStop("starting_line");
}
onClipEvent (enterFrame) {
_parent.updateObstacle(eval (this._target));
}
Instance of Symbol 83 MovieClip "car_mc" in Frame 75
onClipEvent (load) {
origY = _y;
}
onClipEvent (enterFrame) {
if (Key.isDown(37) and (x_target > 80)) {
x_target = x_target - 50;
if (_parent.sound_mc._currentFrame == 1) {
_parent.sound_mc.gotoAndPlay("screech");
}
car_body_mc.signal_left._alpha = 100;
} else {
car_body_mc.signal_left._alpha = 0;
}
if (Key.isDown(39) and (x_target < 350)) {
x_target = x_target + 50;
if (_parent.sound_mc._currentFrame == 1) {
_parent.sound_mc.gotoAndPlay("screech");
}
car_body_mc.signal_right._alpha = 100;
} else {
car_body_mc.signal_right._alpha = 0;
}
if (Key.isDown(37)) {
dir = 0.5;
}
if (Key.isDown(39)) {
dir = -0.5;
}
if (_parent.gameState == "play") {
car_body_mc.brakelights._alpha = 0;
}
if (_parent.gameState == "stop") {
car_body_mc.brakelights._alpha = 100;
}
}
Frame 88
sound_mc.gotoAndPlay("crash");
gameState = "stop";
Frame 115
stop();
Instance of Symbol 159 MovieClip in Frame 115
onClipEvent (keyUp) {
_parent.initialize();
_parent.gotoAndPlay("countdown");
}
onClipEvent (mouseUp) {
_parent.initialize();
_parent.gotoAndPlay("countdown");
}
Frame 116
sound_mc.gotoAndPlay("congratulations");
gameState = "stop";
Frame 145
stop();
Symbol 3 MovieClip Frame 1
bLoaded = _parent.getBytesLoaded();
bTotal = _parent.getBytesTotal();
factor = Math.ceil((bLoaded / bTotal) * 100);
if (factor < fcomp) {
_parent.stop();
percentloaded = Math.ceil(((bTotal - bLoaded) * 9) / bTotal);
} else {
_parent.play();
}
percentage.text = percentloaded;
percentage.textColor = color3;
percentage.textFont = fText;
function drawProCircle(r, x, y, p, line, fill, trans) {
lineStyle(1, line);
beginFill(fill, trans);
moveTo(x + r, y);
var angle = 1;
while (angle <= p) {
var endx = (r * Math.cos((angle * Math.PI) / 180));
var endy = (r * Math.sin((angle * Math.PI) / 180));
var cx = endx;
var cy = endy;
this.curveTo(cx + x, cy + y, endx + x, endy + y);
angle = angle + 1;
}
this.lineTo(x, y);
this.lineTo(x + r, y);
}
this.clear();
p = Math.ceil(((bLoaded / bTotal) * 9) * 360);
p1 = int(p / 360);
if (p > 360) {
p = p - (p1 * 360);
}
drawProCircle(r, 0, 0, p, color1, color2, 100);
drawProCircle(r / 2, 0, 0, p, color4, color5, 100);
Symbol 3 MovieClip Frame 2
gotoAndPlay (1);
Instance of Symbol 8 MovieClip in Symbol 18 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
act = "1";
}
onClipEvent (enterFrame) {
if (act == "1") {
this._alpha = this._alpha + 7;
if (this._alpha > (60 + tr)) {
tr = random(40);
act = "2";
}
}
if (act == "2") {
this._alpha = this._alpha - 5;
if (this._alpha < tr) {
tr = random(40);
act = "1";
}
}
}
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 24
gotoAndPlay (1);
Symbol 26 MovieClip Frame 39
gotoAndPlay (1);
Symbol 26 MovieClip Frame 79
gotoAndPlay (1);
Symbol 26 MovieClip Frame 80
gotoAndPlay (1);
Symbol 26 MovieClip Frame 141
gotoAndPlay (1);
Symbol 42 MovieClip Frame 28
gotoAndPlay (17);
Symbol 55 MovieClip Frame 1
stop();
Instance of Symbol 48 MovieClip "landscape_mc" in Symbol 55 MovieClip Frame 1
onClipEvent (load) {
startX = this._x;
}
onClipEvent (enterFrame) {
leftKey = 37;
rightKey = 39;
scrollIncrement = 2;
scrollLimit = 18;
if (_parent.gameState == "play") {
if (Key.isDown(leftKey)) {
if (this._x < (startX + scrollLimit)) {
this._x = this._x + scrollIncrement;
}
}
if (Key.isDown(rightKey)) {
if (this._x > (startX - scrollLimit)) {
this._x = this._x - scrollIncrement;
}
}
}
}
Symbol 55 MovieClip Frame 20
stop();
Symbol 55 MovieClip Frame 37
stop();
Symbol 55 MovieClip Frame 54
stop();
Symbol 62 MovieClip Frame 1
stop();
Symbol 83 MovieClip Frame 1
x_value = _x;
x_target = x_value;
acc = 10;
b = 1.45;
Instance of Symbol 82 MovieClip "car_body_mc" in Symbol 83 MovieClip Frame 1
onClipEvent (load) {
y = _y;
}
onClipEvent (enterFrame) {
if (_parent._parent.gameState == "play") {
_y = ((y + random(2)) - 1);
}
}
Symbol 83 MovieClip Frame 2
vx = (Number(vx) + Number(((x_target - x_value) * 1) / acc)) / b;
x_value = Number(x_value) + Number(vx);
_x = x_value;
Symbol 83 MovieClip Frame 3
gotoAndPlay (2);
Symbol 91 MovieClip Frame 720
_parent.landscape_mc.gotoAndPlay("stage_02");
Symbol 91 MovieClip Frame 745
_parent.stage_completed_mc.gotoAndPlay("stage_1_completed");
Symbol 91 MovieClip Frame 1440
_parent.landscape_mc.gotoAndPlay("stage_03");
Symbol 91 MovieClip Frame 1467
_parent.stage_completed_mc.gotoAndPlay("stage_2_completed");
Symbol 91 MovieClip Frame 2160
_parent.landscape_mc.gotoAndPlay("stage_04");
Symbol 91 MovieClip Frame 2185
_parent.stage_completed_mc.gotoAndPlay("stage_3_completed");
Symbol 91 MovieClip Frame 2880
_parent.gotoAndPlay("congratulations");
stop();
Symbol 114 MovieClip Frame 1
function randomTreeSequence() {
randomSequenceNumber = Math.floor((Math.random() * 3) + 1);
if (randomSequenceNumber == 1) {
gotoAndPlay (1);
}
if (randomSequenceNumber == 2) {
gotoAndPlay (28);
}
if (randomSequenceNumber == 3) {
gotoAndPlay (55);
}
}
Symbol 114 MovieClip Frame 27
randomTreeSequence();
Symbol 114 MovieClip Frame 54
randomTreeSequence();
Symbol 114 MovieClip Frame 81
randomTreeSequence();
Symbol 129 MovieClip Frame 1
xMin = 60;
xMax = 123;
stop();
Symbol 129 MovieClip Frame 21
_parent.testForCollision(this.xMin, this.xMax);
Symbol 129 MovieClip Frame 22
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 129 MovieClip Frame 25
gotoAndPlay (117);
Symbol 129 MovieClip Frame 39
_parent.testForCollision(this.xMin, this.xMax);
Symbol 129 MovieClip Frame 40
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 129 MovieClip Frame 42
gotoAndPlay (117);
Symbol 129 MovieClip Frame 57
_parent.testForCollision(this.xMin, this.xMax);
Symbol 129 MovieClip Frame 58
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 129 MovieClip Frame 59
gotoAndPlay (117);
Symbol 129 MovieClip Frame 75
_parent.testForCollision(this.xMin, this.xMax);
Symbol 129 MovieClip Frame 76
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 129 MovieClip Frame 78
gotoAndPlay (117);
Symbol 129 MovieClip Frame 94
_parent.testForCollision(this.xMin, this.xMax);
Symbol 129 MovieClip Frame 95
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 129 MovieClip Frame 97
gotoAndPlay (117);
Symbol 129 MovieClip Frame 113
_parent.testForCashCollision(this.xMin, this.xMax);
Symbol 129 MovieClip Frame 114
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 129 MovieClip Frame 116
gotoAndPlay (117);
Symbol 129 MovieClip Frame 117
gotoAndPlay(this._currentFrame + Math.floor((Math.random() * 75) + 1));
Symbol 129 MovieClip Frame 192
randomObstacle = Math.floor((Math.random() * 6) + 1);
if (randomObstacle == 1) {
gotoAndPlay (9);
} else if (randomObstacle == 2) {
gotoAndPlay (26);
} else if (randomObstacle == 3) {
gotoAndPlay (43);
} else if (randomObstacle == 4) {
gotoAndPlay (60);
} else if (randomObstacle == 5) {
gotoAndPlay (79);
} else if (randomObstacle == 6) {
gotoAndPlay (98);
}
Symbol 141 MovieClip Frame 1
xMin = 120;
xMax = 323;
stop();
Symbol 141 MovieClip Frame 22
smoke_mc.gotoAndPlay("puff");
Symbol 141 MovieClip Frame 24
_parent.testForCollision(this.xMin, this.xMax);
Symbol 141 MovieClip Frame 25
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 141 MovieClip Frame 29
gotoAndPlay (135);
Instance of Symbol 132 MovieClip in Symbol 141 MovieClip Frame 29
onClipEvent (load) {
_yscale = 1;
_xscale = 1;
}
onClipEvent (enterFrame) {
dist = dist + (0.03 + (dist / 15));
_yscale = (_yscale + dist);
_xscale = (_xscale + dist);
obs = obs + 1;
if (obs > 80) {
_yscale = 1;
_xscale = 1;
obs = 1;
dist = 0;
}
}
Symbol 141 MovieClip Frame 43
_parent.testForCollision(this.xMin, this.xMax);
Symbol 141 MovieClip Frame 44
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 141 MovieClip Frame 50
gotoAndPlay (135);
Symbol 141 MovieClip Frame 66
_parent.testForCollision(this.xMin, this.xMax);
Symbol 141 MovieClip Frame 67
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 141 MovieClip Frame 71
gotoAndPlay (135);
Symbol 141 MovieClip Frame 89
_parent.testForCollision(this.xMin, this.xMax);
Symbol 141 MovieClip Frame 90
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 141 MovieClip Frame 92
gotoAndPlay (135);
Symbol 141 MovieClip Frame 106
_parent.testForCollision(this.xMin, this.xMax);
Symbol 141 MovieClip Frame 107
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 141 MovieClip Frame 113
gotoAndPlay (135);
Symbol 141 MovieClip Frame 127
_parent.testForCashCollision(this.xMin, this.xMax);
Symbol 141 MovieClip Frame 128
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 141 MovieClip Frame 134
gotoAndPlay (135);
Symbol 141 MovieClip Frame 135
gotoAndPlay(this._currentFrame + Math.floor((Math.random() * 75) + 1));
Symbol 141 MovieClip Frame 210
randomObstacle = Math.floor((Math.random() * 6) + 1);
if (randomObstacle == 1) {
gotoAndPlay (9);
} else if (randomObstacle == 2) {
gotoAndPlay (30);
} else if (randomObstacle == 3) {
gotoAndPlay (51);
} else if (randomObstacle == 4) {
gotoAndPlay (72);
} else if (randomObstacle == 5) {
gotoAndPlay (93);
} else if (randomObstacle == 6) {
gotoAndPlay (114);
}
Symbol 146 MovieClip Frame 1
xMin = 320;
xMax = 384;
stop();
Symbol 146 MovieClip Frame 25
_parent.testForCollision(this.xMin, this.xMax);
Symbol 146 MovieClip Frame 26
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 146 MovieClip Frame 29
gotoAndPlay (128);
Symbol 146 MovieClip Frame 45
_parent.testForCollision(this.xMin, this.xMax);
Symbol 146 MovieClip Frame 46
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 146 MovieClip Frame 50
gotoAndPlay (128);
Symbol 146 MovieClip Frame 61
_parent.testForCollision(this.xMin, this.xMax);
Symbol 146 MovieClip Frame 62
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 146 MovieClip Frame 64
gotoAndPlay (128);
Symbol 146 MovieClip Frame 82
_parent.testForCollision(this.xMin, this.xMax);
Symbol 146 MovieClip Frame 83
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 146 MovieClip Frame 85
gotoAndPlay (128);
Symbol 146 MovieClip Frame 103
_parent.testForCollision(this.xMin, this.xMax);
Symbol 146 MovieClip Frame 104
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 146 MovieClip Frame 106
gotoAndPlay (128);
Symbol 146 MovieClip Frame 124
_parent.testForCashCollision(this.xMin, this.xMax);
Symbol 146 MovieClip Frame 125
if (_parent.car_mc._y != _parent.car_mc.origY) {
_parent.car_mc._y = _parent.car_mc.origY;
}
Symbol 146 MovieClip Frame 127
gotoAndPlay (128);
Symbol 146 MovieClip Frame 128
gotoAndPlay(this._currentFrame + Math.floor((Math.random() * 75) + 1));
Symbol 146 MovieClip Frame 203
randomObstacle = Math.floor((Math.random() * 6) + 1);
if (randomObstacle == 1) {
gotoAndPlay (9);
} else if (randomObstacle == 2) {
gotoAndPlay (30);
} else if (randomObstacle == 3) {
gotoAndPlay (51);
} else if (randomObstacle == 4) {
gotoAndPlay (65);
} else if (randomObstacle == 5) {
gotoAndPlay (86);
} else if (randomObstacle == 6) {
gotoAndPlay (107);
}
Symbol 149 MovieClip Frame 24
stop();
Symbol 153 MovieClip Frame 1
stop();
Symbol 153 MovieClip Frame 25
gotoAndPlay (1);
Symbol 153 MovieClip Frame 49
gotoAndPlay (1);
Symbol 153 MovieClip Frame 73
gotoAndPlay (1);