Frame 1
stop();
Instance of Symbol 83 MovieClip "preloader" in Frame 1
onClipEvent (enterFrame) {
percent = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
bar._width = percent * 2;
output = percent + " %";
if (percent >= 100) {
_root.gotoAndStop(2);
} else {
_root.stop();
}
}
Instance of Symbol 88 MovieClip "topFrame" in Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 96 MovieClip in Frame 1
onClipEvent (load) {
this._visible = false;
}
Frame 2
stop();
basemusic = new Sound();
basemusic.attachSound("bgMusic");
Frame 3
function spawnBot(randNum, mcRef) {
var randNum;
var mcRef;
if (mcRef == "spider") {
var i = 0;
while (i < randNum) {
attachMovie("spd_bot", "spd_bot" + spidDepth, 500 + spidDepth);
tmpMc = _root["spd_bot" + spidDepth];
tmpMc._y = -tmpMc._height;
i++;
}
spidDepth++;
}
if (mcRef == "bat") {
var j = 0;
while (j < randNum) {
attachMovie("bat_bot", "bat_bot" + j, 1000 + j);
j++;
}
}
if (mcRef == "candy") {
var k = 1;
while (k < randNum) {
attachMovie("candy", "candy" + candyDepth, 2000 + candyDepth);
tmpMc = _root["candy" + candyDepth];
tmpMc.gotoAndStop(randGen(4, 1, true));
candyDepth++;
k++;
}
}
}
function randGen(range, flrVal, integer) {
var range;
var flrVal;
var randNum;
var integer;
if (integer) {
randNum = Math.floor((Math.random() * range) + flrVal);
} else {
randNum = (Math.random() * range) + flrVal;
}
return(randNum);
}
var score = 30;
var distance = 0;
var spidDepth = 1;
var time = 0;
var spidDepth;
var candyDepth = 10;
stop();
Instance of Symbol 159 MovieClip "bg" in Frame 3
onClipEvent (enterFrame) {
if (_x < 0) {
_x = (_x + 1000);
_root.distance = _root.distance + 0.5;
_root.spawnBot(4, "candy");
}
}
Instance of Symbol 171 MovieClip "bg2" in Frame 3
onClipEvent (enterFrame) {
if (_x < 0) {
_x = (_x + 1000);
}
}
Instance of Symbol 172 MovieClip "controller" in Frame 3
onClipEvent (load) {
var spidTrig = false;
var batTrig = false;
var sSpawnTime = 10;
var bSpawnTime = 15;
var singleExec = false;
_root.spawnBot(_root.randGen(3, 2, true), "candy");
}
onClipEvent (enterFrame) {
time = Math.round(getTimer() / 1000);
_root.time = time;
if (((time % sSpawnTime) == 0) && (!spidTrig)) {
_root.spawnBot(_root.randGen(3, 1, true), "spider");
spidTrig = true;
sSpawnTime = _root.randGen(10, 5, true);
} else {
spidTrig = false;
}
if (((time % bSpawnTime) == 0) && (!batTrig)) {
_root.spawnBot(_root.randGen(2, 1, true), "bat");
batTrig = true;
bSpawnTime = _root.randGen(10, 5, true);
} else {
batTrig = false;
}
if ((_root.distance == 10) && (singleExec)) {
attachMovie("sign_grave", "sign_grave", 5000);
singleExec = false;
} else if ((_root.distance == 8) && (!singleExec)) {
_root.attachMovie("bonus", "bonus", 6000);
_root.attachMovie("evilBat", "evilBat", 5060);
singleExec = true;
} else if ((_root.distance == 5) && (singleExec)) {
attachMovie("web", "web", 5050);
singleExec = false;
} else if ((_root.distance == 0) && (!singleExec)) {
attachMovie("sign_grave", "sign_grave", 5000);
singleExec = true;
}
if (0 >= _root.score) {
_root.score = 0;
_root.gotoAndStop(4);
}
if (_root.score < 15) {
_root.panel.gotoAndStop(2);
}
if ((15 < _root.score) || (_root._currentframe == 4)) {
_root.panel.gotoAndStop(1);
}
}
onClipEvent (keyDown) {
updateAfterEvent();
}
Instance of Symbol 173 MovieClip "ghost" in Frame 3
onClipEvent (load) {
var xspeed = ((yspeed = 0));
var bgXspeed;
var maxXspeed = 20;
var momentum = 1.25;
var top = 75;
var baseline = (_root.bg._height - 20);
var leftB = Math.round(_root.lBounds._x + (_width / 2));
var rightB = Math.round(_root.rBounds._x - (_width / 2));
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT) && ((-maxXspeed) < xspeed)) {
xspeed = xspeed - momentum;
} else if (xspeed < 0) {
xspeed = xspeed + momentum;
}
if (Key.isDown(Key.RIGHT) && (xspeed < maxXspeed)) {
xspeed = xspeed + momentum;
} else if (0 < xspeed) {
xspeed = xspeed - momentum;
}
if (Key.isDown(Key.UP)) {
yspeed = yspeed - momentum;
} else if (yspeed < 0) {
yspeed = yspeed + momentum;
}
if (Key.isDown(Key.DOWN)) {
yspeed = yspeed + momentum;
} else if (0 < yspeed) {
yspeed = yspeed - momentum;
}
if (_root._currentFrame == 3) {
move();
bgXspeed = xspeed;
boundsDetect();
}
}
Frame 4
if (score >= 100) {
result = ("Awesome! " + score) + " Points. You made it safe and sound.";
ghost.gotoAndPlay("madegrave");
} else if ((score < 100) && (0 < score)) {
result = score + " Candy Points. You'll need to eat even more candy next time.";
} else {
result = "Ooops, you ran out of candy.";
}
stop();
basemusic.stop();
Symbol 90 Button
on (release) {
getURL ("http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash", "_blank");
}
Symbol 95 Button
on (release) {
getURL ("http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash", "_blank");
}
Instance of Symbol 6 MovieClip in Symbol 17 MovieClip [evilBat] Frame 1
onClipEvent (load) {
var yIncrem = _root.randGen(1, 0, false);
var xIncrem = _root.randGen(3, 0, false);
var gX = _root.ghost._x;
var gY = _root.ghost._y;
var proxFar = 250;
var proxClose = 100;
var randFac = _root.randGen(proxFar, proxClose, true);
var randXstart = (gX - randFac);
var randYstart = (gY - randFac);
_parent._x = randXstart;
_parent._y = randYstart;
var singleExec = false;
biteMe = new Sound(this);
biteMe.attachSound("munch");
}
onClipEvent (enterFrame) {
dX = _parent._x - _root.ghost._x;
dY = _parent._y - _root.ghost._y;
if (0 < Math.floor(dX * dX)) {
_parent._x = _root.ghost._x + (dX * 0.98);
dX--;
} else {
_parent._x = _root.ghost._x;
}
if (0 < Math.floor(dY * dY)) {
_parent._y = _root.ghost._y + (dY * 0.98);
dY--;
} else {
_parent._y = _root.ghost._y;
}
if (_parent.hitTest(_root.ghost.hit1) && (!singleExec)) {
_root.score = _root.score - 100;
singleExec = true;
biteMe.start();
_root.ghost.gotoAndPlay("grimace");
} else if (!_parent.hitTest(_root.ghost.hit1)) {
singleExec = false;
}
if (_root._currentframe == 4) {
removeMovieClip(_parent);
}
}
Symbol 17 MovieClip [evilBat] Frame 9
stop();
Instance of Symbol 18 MovieClip in Symbol 35 MovieClip [bat_bot] Frame 1
onClipEvent (load) {
var yIncrem = _root.randGen(1, 0, false);
var xIncrem = _root.randGen(3, 0, false);
var gX = _root.ghost._x;
var gY = _root.ghost._y;
var proxFar = 100;
var proxClose = 60;
var randFac = _root.randGen(proxFar, proxClose, true);
var randXstart = (gX - randFac);
var randYstart = (gY - randFac);
_parent._x = randXstart;
_parent._y = randYstart;
var singleExec = false;
biteMe = new Sound(this);
biteMe.attachSound("munch");
}
onClipEvent (enterFrame) {
var targetY = _root.ghost._y;
if (targetY < _parent._y) {
_parent._y = _parent._y - yIncrem;
} else {
_parent._y = _parent._y + yIncrem;
}
_parent._x = _parent._x + (xIncrem + (_root.ghost.bgXspeed * -1));
if (_parent.hitTest(_root.ghost.hit1) && (!singleExec)) {
_root.score = _root.score - 10;
biteMe.start();
_root.ghost.gotoAndPlay("grimace");
singleExec = true;
} else if (!_parent.hitTest(_root.ghost.hit1)) {
singleExec = false;
}
if (_parent._x < (_root.lBounds._x - 150)) {
removeMovieClip(_parent);
}
if (_root._currentframe == 4) {
removeMovieClip(_parent);
}
}
Symbol 35 MovieClip [bat_bot] Frame 9
stop();
Instance of Symbol 37 MovieClip "line" in Symbol 54 MovieClip [spd_bot] Frame 1
onClipEvent (enterFrame) {
sX = _parent.spider._x;
sY = _parent.spider._y;
pX = _parent.point._x;
pY = _parent.point._y;
dX = sX - pX;
dY = sY - pY;
xcenter = (sX + pX) / 2;
ycenter = (sY + pY) / 2;
_xscale = dX;
_yscale = dY;
_x = xcenter;
_y = ycenter;
}
Instance of Symbol 53 MovieClip "point" in Symbol 54 MovieClip [spd_bot] Frame 1
onClipEvent (load) {
var yIncrem = _root.randGen(3, 0, false);
var gX = _root.ghost._x;
var gY = _root.ghost._y;
var sY = _parent._y;
var startY = _y;
var targetY = Math.abs(sY - gY);
var tempTar = false;
var proxFar = 100;
var proxClose = 30;
var randFac = _root.randGen(proxFar, proxClose, true);
var singleExec = false;
var randXstart = (gX + randFac);
biteMe = new Sound(this);
biteMe.attachSound("munch");
if (_root.lBounds._x >= randXstart) {
_parent._x = _root.lBounds._x;
} else if (randXstart >= _root.rBounds._x) {
_parent._x = _root.rBounds._x;
} else {
_parent._x = randXstart;
}
_x = _parent.spider._x;
}
onClipEvent (enterFrame) {
if ((_parent.spider._y < targetY) && (!tempTar)) {
_parent.spider._y = _parent.spider._y + yIncrem;
} else if (((startY >= _parent.spider._y) && (tempTar)) || (_parent._x < (_root.lBounds._x - 50))) {
removeMovieClip(_parent);
} else {
tempTar = true;
_parent.spider._y = _parent.spider._y - yIncrem;
}
_parent._x = _parent._x + (-_root.ghost.bgXspeed);
if (_parent.spider.hitTest(_root.ghost.hit1) && (!singleExec)) {
_root.score = _root.score - 5;
biteMe.start();
_root.ghost.gotoAndPlay("grimace");
singleExec = true;
} else if (!_parent.hitTest(_root.ghost.hit1)) {
singleExec = false;
}
if (_root._currentframe == 4) {
removeMovieClip(_parent);
}
}
Symbol 60 MovieClip [web] Frame 1
stop();
Instance of Symbol 56 MovieClip "webHit" in Symbol 60 MovieClip [web] Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 59 MovieClip in Symbol 60 MovieClip [web] Frame 1
onClipEvent (load) {
var gX = _root.ghost._x;
var proxFar = 300;
var proxClose = 200;
var randFac = _root.randGen(proxFar, proxClose, true);
var randXstart = (gX + randFac);
_parent._x = randXstart;
_parent._y = 440;
var singleExec = false;
tempSound = new Sound(this);
tempSound.attachSound("shake");
}
onClipEvent (enterFrame) {
_parent._x = _parent._x + (_root.ghost.bgXspeed * -1);
if (_parent.webHit.hitTest(_root.ghost.hit1) && (!singleExec)) {
_root.score = _root.score - 50;
tempSound.start();
_root.ghost.gotoAndPlay("grimace");
_parent.gotoAndPlay(2);
singleExec = true;
} else if (!_parent.hitTest(_root.ghost.hit1)) {
singleExec = false;
}
if (_parent._x < (_root.lBounds._x - 150)) {
removeMovieClip(_parent);
}
if (_root._currentframe == 4) {
removeMovieClip(_parent);
}
}
Symbol 67 MovieClip [candy] Frame 1
stop();
Instance of Symbol 63 MovieClip in Symbol 67 MovieClip [candy] Frame 1
onClipEvent (load) {
var yIncrem = _root.randGen(4, 1, false);
var targetY = _root.bg._height;
var singleExec = false;
var gX = _root.ghost._x;
var proxFar = 850;
var proxClose = 20;
var randFac = _root.randGen(proxFar, proxClose, true);
var randXstart = (gX + randFac);
_parent._x = randXstart;
_parent._y = -_parent._height;
tempSound = new Sound(this);
tempSound.attachSound("gulp");
}
onClipEvent (enterFrame) {
if (_parent._y < targetY) {
_parent._y = _parent._y + yIncrem;
} else if (_parent._y >= targetY) {
removeMovieClip(_parent);
}
_parent._x = _parent._x + (-_root.ghost.bgXspeed);
if (_parent.hitTest(_root.ghost.hit1) && (!singleExec)) {
_root.ghost.gotoAndPlay("munch");
_root.score = _root.score + (_parent._currentframe * 2);
tempSound.start();
removeMovieClip(_parent);
singleExec = true;
}
if (_root._currentframe == 4) {
removeMovieClip(_parent);
}
}
Symbol 72 MovieClip [sign_grave] Frame 1
stop();
Instance of Symbol 69 MovieClip in Symbol 72 MovieClip [sign_grave] Frame 1
onClipEvent (load) {
if (_root.distance >= 2) {
_parent.gotoAndStop(2);
} else {
_parent._x = 565;
_parent._y = 440;
}
}
onClipEvent (enterFrame) {
_parent._x = _parent._x + (_root.ghost.bgXspeed * -1);
if (_parent._x < (_root.lBounds._x - 150)) {
removeMovieClip(_parent);
}
}
Instance of Symbol 71 MovieClip in Symbol 72 MovieClip [sign_grave] Frame 2
onClipEvent (load) {
_parent._x = 750;
_parent._y = 440;
}
onClipEvent (enterFrame) {
_parent._x = _parent._x + (_root.ghost.bgXspeed * -1);
if (_parent._x < (_root.lBounds._x + 150)) {
_root.ghost.bgXspeed = 0;
_root.gotoAndStop(4);
}
if (_root._currentframe == 4) {
removeMovieClip(_parent);
}
}
Instance of Symbol 74 MovieClip in Symbol 76 MovieClip [bonus] Frame 1
onClipEvent (load) {
var yIncrem = _root.randGen(5, 2, false);
var targetY = _root.bg._height;
var singleExec = false;
var randXstart = _root.randGen(_root.rBounds._x, _root.lBounds._x, true);
_parent._x = randXstart + 300;
tempSound = new Sound(this);
tempSound.attachSound("gulp");
}
onClipEvent (enterFrame) {
if (_parent._y < targetY) {
_parent._y = _parent._y + yIncrem;
} else if (_parent._y >= targetY) {
_parent._y = targetY;
removeMovieClip(_parent);
}
_parent._x = _parent._x + (-_root.ghost.bgXspeed);
if (_parent.hitTest(_root.ghost.hit1) && (!singleExec)) {
_root.ghost.mouth.gotoAndPlay(2);
_root.score = _root.score + 50;
tempSound.start();
removeMovieClip(_parent);
singleExec = true;
}
if (_root._currentframe == 4) {
removeMovieClip(_parent);
}
}
Symbol 145 MovieClip Frame 1
function boundsDetect() {
if (rightB < _x) {
bgXspeed = xspeed;
_root.bg._x = _root.bg._x - bgXspeed;
_root.bg2._x = _root.bg2._x - (bgXspeed * 0.3);
_x = rightB;
} else if (leftB >= _x) {
bgXspeed = (xspeed = 0);
_x = leftB;
} else {
bgXspeed = 0;
}
if (_y >= baseline) {
_y = baseline;
yspeed = 0;
}
if (top >= _y) {
_y = top;
yspeed = 0;
}
}
function move() {
_x = (_x + xspeed);
_y = (_y + yspeed);
if (xspeed < 0) {
_xscale = -100;
} else if (xspeed == 0) {
_xscale = _xscale;
} else {
_xscale = 100;
}
}
stop();
Instance of Symbol 56 MovieClip "hit1" in Symbol 145 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 145 MovieClip Frame 13
gotoAndStop (1);
Symbol 145 MovieClip Frame 21
gotoAndStop (1);
Symbol 145 MovieClip Frame 39
stop();
Symbol 149 Button
on (release) {
basemusic.start(0, 999);
gotoAndStop (3);
}
Symbol 166 MovieClip Frame 1
stop();
Symbol 173 MovieClip Frame 1
function boundsDetect() {
if (rightB < _x) {
bgXspeed = xspeed;
_root.bg._x = _root.bg._x - bgXspeed;
_root.bg2._x = _root.bg2._x - (bgXspeed * 0.3);
_x = rightB;
} else if (leftB >= _x) {
bgXspeed = (xspeed = 0);
_x = leftB;
} else {
bgXspeed = 0;
}
if (_y >= baseline) {
_y = baseline;
yspeed = 0;
}
if (top >= _y) {
_y = top;
yspeed = 0;
}
}
function move() {
_x = (_x + xspeed);
_y = (_y + yspeed);
if (xspeed < 0) {
_xscale = -100;
} else if (xspeed == 0) {
_xscale = _xscale;
} else {
_xscale = 100;
}
}
stop();
Instance of Symbol 56 MovieClip "hit1" in Symbol 173 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 173 MovieClip Frame 13
gotoAndStop (1);
Symbol 173 MovieClip Frame 21
gotoAndStop (1);
Symbol 173 MovieClip Frame 39
stop();
Symbol 182 Button
on (release) {
gname = "thegreatcandycaperXec";
gscore = _root.score;
getURL ("index.php?act=Arcade&do=newscore", "_self", "POST");
}