Frame 1
this.onEnterFrame = function () {
ifFrameLoaded (5) {
delete this.onEnterFrame;
gotoAndStop (2);
}
loaded = Math.round(getBytesLoaded() / 1024);
total = Math.round(getBytesTotal() / 1024);
percent = Math.round((loaded / total) * 100);
loadBar.gotoAndStop(percent);
};
stop();
Frame 2
beta = "http://www.joyjam.com/joyjam_dev/";
live = "http://www.joyjam.com/";
if (false) {
}
(_root.preurl = live);
_root.game_id = 51;
_quality = "medium";
_root.local_data = SharedObject.getLocal("user_data", "/");
awards = _root.local_data.data.drunkdrivingawards;
trace("awards: " + awards);
awspl = awards.split(":");
bronse_arr = new Array();
silver_arr = new Array();
gold_arr = new Array();
i = 0;
while (i < 15) {
a = awspl[i].split(",");
((a[0] == undefined) ? ((bronse_arr[i] = 0)) : ((bronse_arr[i] = a[0])));
((a[1] == undefined) ? ((silver_arr[i] = 0)) : ((silver_arr[i] = a[1])));
((a[2] == undefined) ? ((gold_arr[i] = 0)) : ((gold_arr[i] = a[2])));
i++;
}
_root.stpnts = 3;
((_root.pints == undefined) ? ((_root.pints = _root.stpnts)) : 0);
buildlist = function () {
i = _root.stpnts;
while (i < (14 + _root.stpnts)) {
mc = "cuprow" + i;
duplicateMovieClip ("cuprowsource", mc, i);
this[mc]._y = cuprowsource._y + (23 * (i - _root.stpnts));
this[mc].text = i + " pints";
this[mc].i = i;
if (bronse_arr[i - _root.stpnts] != 1) {
(this[mc].cup_a.gotoAndStop(4));// not popped
} else {
(this[mc].cup_a.gotoAndStop(1));// not popped
}
if (silver_arr[i - _root.stpnts] != 1) {
(this[mc].cup_b.gotoAndStop(4));// not popped
} else {
(this[mc].cup_b.gotoAndStop(2));// not popped
}
if (gold_arr[i - _root.stpnts] != 1) {
(this[mc].cup_c.gotoAndStop(4));// not popped
} else {
(this[mc].cup_c.gotoAndStop(3));// not popped
}
if (bronse_arr[i - _root.stpnts] == 1) {
this[mc].but.i = i;
this[mc].but.onRelease = function () {
_root.pints = this.i;
_root.startgamefunction();
};
_root.pints = i + 1;
} else {
this[mc].textMC.gotoAndStop("greyed");
}
i++;
}
this["cuprow" + _root.pints].textMC.gotoAndPlay(2);
this["cuprow" + _root.pints].but.onRelease = function () {
_root.startgamefunction();
};
cuprowsource._visible = false;
};
buildlist();
_root.bgmusic1 = new Sound();
_root.bgmusic1.attachSound("Smusic1");
if (_root.soundOn != false) {
_root.bgmusic1.start(0, 100000);
}
_root.soundOnOff = function (v) {
if (v) {
trace("sound ON");
_root.soundOn = true;
_root.bgmusic1.start(0, 100000);
} else {
trace("sound OFF");
_root.soundOn = false;
stopAllSounds();
}
};
fscommand ("allowscale", "false");
fscommand ("showmenu", "false");
fscommand ("trapallkeys", "true");
removeList = function () {
i = _root.stpnts;
while (i < (14 + _root.stpnts)) {
mc = "cuprow" + i;
removeMovieClip(mc);
i++;
}
};
_root.startgamefunction = function () {
removeList();
trace("startGame fnct");
gotoAndPlay (6);
};
_root.gotoMenu = function () {
trace("gotoMenu fnct");
gotoAndStop (2);
};
stop();
Instance of Symbol 68 MovieClip "menu" in Frame 2
onClipEvent (load) {
((_root.soundOn == undefined) ? ((_root.soundOn = true)) : 0);
if (_root.soundOn != false) {
(this.gotoAndStop(1));// not popped
} else {
(this.gotoAndStop(2));// not popped
}
}
Frame 3
buildlist();
Frame 4
mc.gotoAndStop("hiscores");
Frame 5
_root.bgsnd = new Sound();
_root.bgsnd.attachSound("bgs");
_root.bgmusic2 = new Sound();
_root.bgmusic2.attachSound("Smusic2");
if (_root.soundOn != false) {
_root.bgsnd.start(0, 100000);
_root.bgmusic2.start(0, 100000);
}
_root.soundOnOff = function (v) {
if (v) {
trace("sound ON");
_root.soundOn = true;
_root.bgsnd.start(0, 100000);
_root.bgmusic2.start(0, 100000);
} else {
trace("sound OFF");
_root.soundOn = false;
stopAllSounds();
}
};
_root.ccc = 0;
_root.tunnels = 6;
_root.ecnt = 10;
_root.scfl = 0;
_root.gameover = false;
_root.paused = false;
_root.exploded = false;
_root.speed = 4;
_root.score = 0;
_root.chances = 1;
_root.award_bronse = false;
_root.award_silver = false;
_root.award_gold = false;
topsp = 99;
responce = 0.5;
dec = 0.1 + (0.1 * _root.pints);
if (!_root.hsdone) {
_root.hscore = 0;
_root.hsdone = true;
duplicateMovieClip ("gameovermcSource", "gameovermc", 9910);
duplicateMovieClip ("awardssource", "awardsMC", 9912);
gameovermcSource._visible = false;
awardssource._visible = false;
}
awards.gotoAndStop(15);
_root.startgamefunction = function () {
gameovermc.gotoAndStop(1);
gotoAndPlay (6);
};
_root.gotoMenu = function () {
removeMovieClip("mainol");
gameovermc.gotoAndStop(1);
gotoAndStop (2);
};
stop();
Instance of Symbol 107 MovieClip "stage" in Frame 5
onClipEvent (load) {
_root.speed = 20;
}
Instance of Symbol 109 MovieClip "stageP" in Frame 5
onClipEvent (load) {
function updaterng(rng) {
flag = 1;
if (rng < 0) {
sn = 1;
rng = rng * -1;
} else {
sn = -1;
}
if (rng < 40) {
rng = rng + 0.5;
}
rng = rng * sn;
if (cnt > 60) {
flag = random(4);
}
return(rng);
}
y = _y;
rng = random(6) + 12;
if (random(2)) {
rng = rng * -1;
}
}
onClipEvent (enterFrame) {
if (_y < (rng + y)) {
rg = rng;
if (rng < 0) {
rg = rg * -1;
}
per = (rg / 50) * 100;
if (!flag) {
cnt = 0;
val = ((per / 100) * random(5)) + 4;
} else {
val = (per / 100) * 1.5;
}
_y = (_y + val);
if (_y >= (rng + y)) {
_y = (rng + y);
rng = updaterng(rng);
}
}
if (_y > (rng + y)) {
rg = rng;
if (rng < 0) {
rg = rg * -1;
}
per = (rg / 50) * 100;
if (!flag) {
cnt = 0;
val = ((per / 100) * random(5)) + 4;
} else {
val = (per / 100) * 1.5;
}
_y = (_y - val);
if (_y <= (rng + y)) {
_y = (rng + y);
rng = updaterng(rng);
}
}
cnt++;
}
Instance of Symbol 141 MovieClip "mainexp" in Frame 5
onClipEvent (enterFrame) {
if (!_root.gameover) {
if (_name ne "mainexp") {
_x = (_x - _root.speed);
}
}
}
Instance of Symbol 159 MovieClip "ob1" in Frame 5
onClipEvent (enterFrame) {
c++;
if (!_root.gameover) {
((c > tr) ? (_x = (_x - (_root.speed + 1))_x - (_root.speed + 1)) : (_x = 600600));
if (_x < -200) {
c = 0;
tr = random(650) + 150;
gotoAndStop ("start");
_x = (650 + random(200));
_y = (random(170) + 100);
vdir = random(2);
}
if (vdir) {
_y = (_y-1);
if (_y <= 110) {
vdir = 0;
}
} else {
_y = (_y+1);
if (_y >= 260) {
vdir = 1;
}
}
}
}
onClipEvent (load) {
c = 0;
tr = random(550) + 150;
_y = (random(170) + 100);
vdir = random(2);
}
Instance of Symbol 162 MovieClip "ob5" in Frame 5
onClipEvent (enterFrame) {
if (!_root.gameover) {
_x = (_x - (_root.speed / 2));
if ((!sadded) and (_x < (_root.plane._x - 75))) {
sadded = true;
}
if (_x < -150) {
_x = 670;
_y = ((_root.stageP._y + 20) + random(150));
sadded = false;
}
_root.bar5._x = _x;
_root.bar5._y = _y;
}
}
onClipEvent (load) {
_visible = false;
_y = (random(300) + 50);
vdir = random(2);
}
Instance of Symbol 162 MovieClip "ob6" in Frame 5
onClipEvent (enterFrame) {
if (!_root.gameover) {
_x = (_x - (_root.speed / 2));
if ((!sadded) and (_x < (_root.plane._x - 75))) {
sadded = true;
}
if (_x < -150) {
_x = 670;
_y = ((_root.stageP._y + 20) + random(150));
sadded = false;
}
_root.bar6._x = _x;
_root.bar6._y = _y;
}
}
onClipEvent (load) {
_visible = false;
_y = (random(300) + 50);
vdir = random(2);
}
Instance of Symbol 180 MovieClip "plane" in Frame 5
onClipEvent (enterFrame) {
if (_name eq "plane") {
if (!_root.gameover) {
if (_root.soundOn != false) {
if (random(30) == 1) {
sn = random(5) + 1;
_root.bangsnd = new Sound();
_root.bangsnd.attachSound("bang" + sn);
_root.bangsnd.start();
}
}
_root.scfl = _root.scfl + 0.1;
_root.score = int(_root.scfl);
_root.distleft = 100 - _root.score;
if (_root.award_bronse != true) {
if (_root.score > 100) {
_root.award_bronse = true;
_root.awardsMC.gotoAndPlay("bronse");
_root.bronse_arr[_root.pints - _root.stpnts] = 1;
}
}
if (_root.award_silver != true) {
if (_root.score > 150) {
_root.award_silver = true;
_root.awardsMC.gotoAndPlay("silver");
_root.silver_arr[_root.pints - _root.stpnts] = 1;
}
}
if (_root.award_gold != true) {
if (_root.score > 200) {
_root.award_gold = true;
_root.awardsMC.gotoAndPlay("gold");
_root.gold_arr[_root.pints - _root.stpnts] = 1;
}
}
if (!_root.paused) {
thr = 10;
ha = _root.stage.hitTest(_x - thr, _y - 25, true);
hb = _root.stage.hitTest(_x + thr, _y - 25, true);
hc = _root.stage.hitTest(_x - thr, _y + 25, true);
hd = _root.stage.hitTest(_x + thr, _y + 25, true);
if (((ha == false) && (hb == false)) or ((hc == false) && (hd == false))) {
stopAllSounds();
_root.paused = true;
gotoAndPlay ("explosion");
}
if (!_root.exploded) {
if (this.hitmc.hitTest("_root.ob1") and (_root.ob1._currentframe == 1)) {
stopAllSounds();
_root.paused = true;
_root.exploded = true;
gotoAndPlay ("explosion");
o = new Object();
o.x = _root.ob1.ammo._x;
o.y = _root.ob1.ammo._y;
_root.ob1.localToGlobal(o);
_root.ecnt++;
if (_root.ecnt == 20) {
_root.ecnt = 10;
}
_root.mainexp.duplicateMovieClip("exp" + _root.ecnt, _root.ecnt);
_root["exp" + _root.ecnt]._x = o.x;
_root["exp" + _root.ecnt]._y = o.y;
_root.ob1.gotoAndStop(51);
} else if (this.hitmc.hitTest("_root.ob5")) {
stopAllSounds();
_root.paused = true;
_root.exploded = true;
gotoAndPlay ("explosion");
} else if (this.hitmc.hitTest("_root.ob6")) {
stopAllSounds();
_root.paused = true;
_root.exploded = true;
gotoAndPlay ("explosion");
}
}
if (_root.mousepressed or spacepressed) {
if (_root.yspeed > 0) {
_root.yspeed = _root.yspeed - _root.responce;
} else if (_root.yspeed < (-_root.topsp)) {
_root.yspeed = _root.yspeed - (_root.responce / 10);
} else {
_root.yspeed = _root.yspeed - _root.dec;
}
if (plane._currentframe != 1) {
plane.prevFrame();
}
} else {
if (_root.yspeed < 0) {
_root.yspeed = _root.yspeed + _root.responce;
} else if (_root.yspeed > _root.topsp) {
_root.yspeed = _root.yspeed + (_root.responce / 10);
} else {
_root.yspeed = _root.yspeed + _root.dec;
}
if (plane._currentframe != 17) {
plane.nextFrame();
}
}
_y = (_y + _root.yspeed);
if (Key.isDown(32)) {
if (!spacepressed) {
spacepressed = true;
if (BULLETON) {
_root.bsnd = new Sound();
_root.bsnd.attachSound("Bullet");
((_root.soundOn != false) ? (_root.bsnd.start(0.1)) : 0);
_root.bullet.duplicateMovieClip("b" + _root.bcnt, _root.bcnt);
_root["b" + _root.bcnt]._x = _x;
_root["b" + _root.bcnt]._y = _y;
_root.bcnt++;
if (_root.bcnt > 75) {
_root.bcnt = 50;
}
}
}
} else {
spacepressed = false;
}
}
if (_currentframe != 1) {
play();
}
}
}
}
onClipEvent (mouseDown) {
if (_name eq "plane") {
_root.mousepressed = true;
}
}
onClipEvent (mouseUp) {
if (_name eq "plane") {
_root.mousepressed = false;
}
}
onClipEvent (load) {
if (_name eq "plane") {
_root.yspeed = 0;
_root.bcnt = 50;
xp = _x;
yp = _y;
}
}
Instance of Symbol 183 MovieClip "bullet" in Frame 5
onClipEvent (enterFrame) {
if (!_root.gameover) {
if (_name ne "bullet") {
_x = (_x + 40);
if (_x < 480) {
if (this.hitTest("_root.ob1")) {
_root.score = _root.score + 10;
_root.ob1.play();
this.removeMovieClip();
}
}
}
}
}
Instance of Symbol 190 MovieClip in Frame 5
onClipEvent (load) {
if (!_root.oled) {
this.duplicateMovieClip("mainol", "9900");
_x = 5000000;
_root.oled = true;
}
}
Instance of Symbol 68 MovieClip "menu" in Frame 5
onClipEvent (load) {
if (_root.soundOn != false) {
(this.gotoAndStop(1));// not popped
} else {
(this.gotoAndStop(2));// not popped
}
}
Frame 6
gotoAndStop (5);
Symbol 9 MovieClip Frame 1
stop();
Symbol 15 Button
on (release) {
_root.pints = 4;
_root.startgamefunction();
}
Symbol 16 Button
on (release) {
_root.pints = 5;
_root.startgamefunction();
}
Symbol 17 Button
on (release) {
_root.pints = 6;
_root.startgamefunction();
}
Symbol 18 Button
on (release) {
_root.pints = 7;
_root.startgamefunction();
}
Symbol 19 Button
on (release) {
_root.pints = 8;
_root.startgamefunction();
}
Symbol 20 Button
on (release) {
_root.pints = 9;
_root.startgamefunction();
}
Symbol 21 Button
on (release) {
_root.pints = 11;
_root.startgamefunction();
}
Symbol 22 Button
on (release) {
_root.pints = 12;
_root.startgamefunction();
}
Symbol 23 Button
on (release) {
_root.pints = 13;
_root.startgamefunction();
}
Symbol 24 Button
on (release) {
_root.pints = 14;
_root.startgamefunction();
}
Symbol 25 Button
on (release) {
_root.pints = 15;
_root.startgamefunction();
}
Symbol 27 Button
on (release) {
getURL ("http://www.joyjam.com");
}
Symbol 39 MovieClip Frame 20
stop();
Symbol 41 Button
on (release) {
removeList();
nextFrame();
}
Symbol 45 MovieClip Frame 1
this._rotation = random(6) - 3;
Symbol 45 MovieClip Frame 7
stop();
Symbol 47 Button
on (release) {
_root.START_PLAYER1_SCROLL(1);
}
Symbol 56 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 2
stop();
Symbol 56 MovieClip Frame 3
stop();
Symbol 56 MovieClip Frame 4
stop();
Symbol 62 MovieClip Frame 1
text = _parent.text;
stop();
Symbol 62 MovieClip Frame 2
play();
Symbol 62 MovieClip Frame 37
gotoAndPlay (2);
Symbol 65 Button
on (release) {
gotoAndStop (2);
}
Symbol 67 Button
on (release) {
gotoAndStop (1);
}
Symbol 68 MovieClip Frame 1
_root.soundOnOff(true);
stop();
Symbol 68 MovieClip Frame 2
_root.soundOnOff(false);
stop();
Symbol 97 MovieClip Frame 1
_root.ccc++;
Symbol 103 MovieClip Frame 1
gotoAndStop(random(4) + 1);
Instance of Symbol 106 MovieClip "mainstage" in Symbol 107 MovieClip Frame 1
onClipEvent (load) {
if (_name eq "mainstage") {
_root.myx = _x;
_root.myy = _y;
_root.mywidth = 40;
_root.mystagecnt = 0;
_y = 5000;
i = 1;
while (i <= 19) {
this.duplicateMovieClip("stage" + _root.mystagecnt, _root.mystagecnt);
_root.stage["stage" + _root.mystagecnt]._x = _root.mystagecnt * _root.mywidth;
_root.stage["stage" + _root.mystagecnt]._y = _root.myy;
_root.stage["stage" + _root.mystagecnt].gotoAndStop(_root.mystagecnt);
_root.mystagecnt++;
i++;
}
_root.mystagecnt = _root.mystagecnt - 5;
_root.ydif = 0;
_root.yflag = 1;
_root.murdir = random(2);
_root.murspd = random(5) + 5;
_root.murcnt = 1;
_root.muropt = 1;
_root.xcnt = 1;
}
}
onClipEvent (enterFrame) {
if ((_name ne "mainstage") and (!_root.gameover)) {
_x = (_x - _root.speed);
if (_x == (-(_root.speed * 5))) {
_x = (_root.mystagecnt * _root.mywidth);
o = new Object();
o.x = _root.stageP._x;
o.y = _root.stageP._y;
_root.stage.globalToLocal(o);
_y = o.y;
}
}
if (_name eq "mainstage") {
_root.xcnt++;
if (_root.xcnt > 50) {
_root.xcnt = 1;
}
}
}
Symbol 141 MovieClip Frame 2
if (_name ne "mainexp") {
if (_root.soundOn != false) {
trace("expode sound");
_root.ams = new Sound();
_root.ams.attachSound("ams");
_root.ams.start(0.6);
}
}
Symbol 141 MovieClip Frame 33
this.removeMovieClip();
Symbol 149 MovieClip Frame 1
gotoAndStop(random(3) + 1);
Symbol 150 MovieClip Frame 1
gotoAndStop(random(2) + 1);
gotoAndPlay(random(5) + 1);
Symbol 159 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 2
if (_root.soundOn != false) {
trace("expode sound");
_root.ams = new Sound();
_root.ams.attachSound("ams");
_root.ams.start(0.6);
}
Symbol 159 MovieClip Frame 43
stop();
Symbol 162 MovieClip Frame 1
nm = "h" + this._name;
stop();
Symbol 175 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 1
_root.exploded = false;
stop();
Symbol 180 MovieClip Frame 2
if (_root.soundOn != false) {
trace("plane crash sound");
_root.pcr = new Sound();
_root.pcr.attachSound("pcr");
_root.pcr.start(0.2);
}
Symbol 180 MovieClip Frame 33
_root.mainol["chance" + _root.chances]._visible = 0;
_root.chances--;
if (_root.chances == 0) {
_root.gameover = true;
_root.gameovermc.play();
stop();
}
Symbol 180 MovieClip Frame 59
_x = xp;
_y = yp;
_root.paused = false;
if (_root.chances > 0) {
_root.bgsnd = new Sound();
_root.bgsnd.attachSound("bgs");
_root.bgsnd.start(0, 100000);
}
Symbol 183 MovieClip Frame 1
stop();
Symbol 193 MovieClip Frame 20
stop();
Symbol 194 Button
on (press) {
i = 1;
while (i < 11) {
removeMovieClip("scorerow" + i);
i++;
}
_root.startgamefunction();
}
on (rollOver) {
_root.Sbleep.start();
}
Symbol 196 MovieClip Frame 20
stop();
Symbol 197 Button
on (release) {
i = 1;
while (i < 11) {
removeMovieClip("scorerow" + i);
i++;
}
_root.gotoMenu();
}
on (rollOver) {
_root.Sbleep.start();
}
Symbol 220 Button
on (press) {
offsetDo = "down";
}
on (release, releaseOutside) {
offsetDo = "none";
}
Symbol 221 Button
on (press) {
offsetDo = "up";
}
on (release, releaseOutside) {
offsetDo = "none";
}
Symbol 225 MovieClip Frame 1
stop();
Symbol 225 MovieClip Frame 35
((_root.score > _root.hscore) ? ((_root.hscore = _root.score)) : 0);
str = "";
i = 0;
while (i < 15) {
str = str + (((((_root.bronse_arr[i] + ",") + _root.silver_arr[i]) + ",") + _root.gold_arr[i]) + ":");
i++;
}
trace("str:" + str);
_root.local_data = SharedObject.getLocal("user_data", "/");
_root.local_data.data.drunkdrivingawards = str;
Symbol 225 MovieClip Frame 89
loca = _url.split(":");
if (loca[0] == "http") {
locb = loca[1].split("/");
if (locb[2] != "www.joyjam.com") {
gotoAndStop ("visitjj");
}
}
Symbol 225 MovieClip Frame 90
((_root.score < 1) ? ((_root.score = 0)) : 0);
mode = "register";
loadVariables ((((_root.preurl + "registerscores.php?game_id=") + _root.game_id) + "&mode=register&score=") + _root.score, this, "GET");
this.onEnterFrame = function () {
trace("complete:" + complete);
trace("complete:" + complete.length);
if ((complete == 1) or (complete == 2)) {
trace(unescape(lv));
delete this.onEnterFrame;
nextFrame();
}
};
stop();
Symbol 225 MovieClip Frame 91
function lTrim(str) {
tstr = "";
t = 0;
while (t < str.length) {
((str.charCodeAt(t) != 32) ? ((tstr = tstr + str.charAt(t))) : 0);
t++;
}
return(tstr);
}
delete loaded;
scorerow._visible = false;
loadingscorestxt._visible = true;
i = 1;
while (i < 11) {
mc = "scorerow" + i;
duplicateMovieClip ("scorerow", mc, i);
this[mc]._y = scorerow._y + ((i - 1) * 17);
i++;
}
offset = 0;
lv = new LoadVars();
lv.load(((_root.preurl + "registerscores.php?game_id=") + _root.game_id) + "&mode=retrieve");
this.onEnterFrame = function () {
if (loaded != true) {
hi = unescape(lv);
if (hi.length > 10) {
trace("hi: " + hi);
topnames = new Array();
topscores = new Array();
spl = hi.split(",");
trace(spl);
i = 0;
while (i < 51) {
namescore = spl[i].split(":");
((namescore[0].charAt(0) == " ") ? ((namescore[0] = namescore[0].slice(1, namescore[0].length))) : 0);
(((namescore[0] != "=") && (namescore[0] != undefined)) ? ((topnames[i] = String(namescore[0]))) : ((topnames[i] = "")));
((namescore[1] != undefined) ? ((topscores[i] = String(namescore[1]))) : ((topscores[i] = "")));
i++;
}
loadingscorestxt._visible = false;
loaded = true;
}
} else {
i = 1;
while (i < 11) {
mc = "scorerow" + i;
cn = i + offset;
this[mc].num = cn add ". ";
this[mc].name = topnames[cn - 1];
this[mc].score = topscores[cn - 1];
i++;
}
if (offsetDo == "up") {
if (offset < 40) {
offset++;
}
}
if (offsetDo == "down") {
if (offset > 0) {
offset--;
}
}
}
};
stop();
Symbol 225 MovieClip Frame 92
stop();
Symbol 226 MovieClip Frame 1
stop();
Symbol 226 MovieClip Frame 2
play();
Symbol 226 MovieClip Frame 30
gotoAndStop (1);
Symbol 226 MovieClip Frame 60
gotoAndStop (1);
Symbol 226 MovieClip Frame 90
gotoAndStop (1);