Frame 1
fscommand ("allowscale", "false");
fscommand ("fullscreen", "false");
_quality = "BEST";
Stage.showMenu = false;
setProperty("_root.Bar", _yscale , 0);
_level0.load = "Splash and Dash Loading";
_global.CPmycolor = 4;
_global.setcounter = function (option) {
if (_root["counteroption" + option]) {
return(undefined);
}
mybaseurl = String(_url);
filevar = mybaseurl.substr(0, 4);
if (filevar != "file") {
tempkey = Math.round(Math.random() * 100000);
this.targetUrl = (((("http://www.entertainmail.net/splash_and_dash/stats/?phpbase=" + mybaseurl) + "&option=") + option) + "&key=") + tempkey;
loadMovieNum (this.targetUrl, 2);
_root.from = "site";
} else {
_root.from = "local";
}
if (option == 0) {
_root.counteroption0 = true;
} else if (option == 1) {
_root.counteroption1 = true;
}
};
_global.setcounter(0);
_root.savefile_mygame = "SplashAndDash_mygame";
_root.initSO_mygame = function () {
_root.SplashAndDashsave_mygame = SharedObject.getLocal(_root.savefile_mygame);
};
_root.initSO_mygame();
_root.savetoSO_mygame = function (i) {
_root.SplashAndDashsave_mygame = SharedObject.getLocal(_root.savefile_mygame);
_root.SplashAndDashsave_mygame.data.save_money = _global.mymoney;
_root.SplashAndDashsave_mygame.data.save_tuning1 = _root.tuning1;
_root.SplashAndDashsave_mygame.data.save_tuning2 = _root.tuning2;
_root.SplashAndDashsave_mygame.data.save_tuning3 = _root.tuning3;
_root.SplashAndDashsave_mygame.data.save_tuning4 = _root.tuning4;
_root.SplashAndDashsave_mygame.data.save_boughta = _global.boughta;
_root.SplashAndDashsave_mygame.data.save_boughtb = _global.boughtb;
_root.SplashAndDashsave_mygame.data.save_boughtc = _global.boughtc;
_root.SplashAndDashsave_mygame.data.save_boughtd = _global.boughtd;
_root.SplashAndDashsave_mygame.data.save_CPmycolor = _global.CPmycolor;
_root.SplashAndDashsave_mygame.data.save_playername = _root.playername;
_root.SplashAndDashsave_mygame.data.save_email = _root.email;
_root.SplashAndDashsave_mygame.data.save_qualitynumber = _root.qualitynumber;
_root.SplashAndDashsave_mygame.data.savedtime1 = true;
_root.SplashAndDashsave.flush();
trace("------------------SAVED --mygame------------------");
delete _root.SplashAndDashsave_mygame;
};
_root.loadfromSO_mygame = function () {
_root.SplashAndDashsave_mygame = SharedObject.getLocal(_root.savefile_mygame);
if (_root.SplashAndDashsave_mygame.data.savedtime1 == undefined) {
trace("------------------SAVE FILE IS EMPTY------------------");
return(undefined);
}
var savefile_mygame = _root.SplashAndDashsave_mygame.data;
_global.mymoney = savefile_mygame.save_money;
_root.tuning1 = savefile_mygame.save_tuning1;
_root.tuning2 = savefile_mygame.save_tuning2;
_root.tuning3 = savefile_mygame.save_tuning3;
_root.tuning4 = savefile_mygame.save_tuning4;
_global.boughta = savefile_mygame.save_boughta;
_global.boughtb = savefile_mygame.save_boughtb;
_global.boughtc = savefile_mygame.save_boughtc;
_global.boughtd = savefile_mygame.save_boughtd;
_global.CPmycolor = savefile_mygame.save_CPmycolor;
_root.playername = savefile_mygame.save_playername;
_root.email = savefile_mygame.save_email;
_root.qualitynumber = savefile_mygame.save_qualitynumber;
if (_global.mymoney == undefined) {
_global.mymoney = 0;
}
if (_root.tuning1 == undefined) {
_root.tuning1 = 0;
}
if (_root.tuning2 == undefined) {
_root.tuning2 = 0;
}
if (_root.tuning3 == undefined) {
_root.tuning3 = 0;
}
if (_root.tuning4 == undefined) {
_root.tuning4 = 0;
}
if (_root.boughta == undefined) {
_root.boughta = 0;
}
if (_root.boughtb == undefined) {
_root.boughtb = 0;
}
if (_root.boughtc == undefined) {
_root.boughtc = 0;
}
if (_root.boughtc == undefined) {
_root.boughtc = 0;
}
if (_root.playername == undefined) {
_root.playername = "NEW DRIVER";
}
if (_root.email == undefined) {
_root.email = "YOUR E-MAIL ADRES";
}
if (_root.qualitynumber == undefined) {
_root.qualitynumber = 1;
}
trace("------------------LOADED FROM SHARED OBJECT------------------");
delete _root.SplashAndDashsave;
};
_root.loadfromSO_mygame();
Instance of Symbol 414 MovieClip "Size" in Frame 1
onClipEvent (load) {
total = int(_root.getBytesTotal());
}
onClipEvent (enterFrame) {
StatusColor = new Color(_root.Bar);
Loaded = int(_root.getBytesLoaded());
Percent = int((loaded / total) * 100);
if (percent > 20) {
_level0.load = "PitBox Loaded";
StatusColor.setRGB(16777215);
}
if (percent > 40) {
_level0.load = "Gasoline Loaded";
StatusColor.setRGB(16777215);
}
if (percent > 60) {
_level0.load = "Level Data Loaded";
StatusColor.setRGB(16777215);
}
if (percent > 80) {
_level0.load = "Lollypop Girl Loaded";
StatusColor.setRGB(16777215);
}
if (percent == 90) {
_level0.load = "Towel Girl Loaded";
StatusColor.setRGB(0);
}
_root.Percent = Percent + " %";
setProperty("_root.Bar", _yscale , Percent);
if (Percent >= 100) {
tellTarget ("_root") {
play();
};
}
}
Frame 2
stop();
Frame 260
_global.SplashandDash_Sound = new Sound();
SplashandDash_Sound.attachSound("SplashandDash_lnk");
SplashandDash_Sound.start();
continue_but.useHandCursor = false;
_root.colorname2 = "Random";
_root.difficulty = "EASY";
_global.difflevel = 1;
play();
Frame 549
_quality = "BEST";
_global.buyurl = "http://www.esales.nl/Isioux/affiliate5.htm";
mouse.show();
_global.CParray = [[-255, -241, 127, -167, -255, -255, 41, 0], [-255, -241, -255, -167, -255, -255, 41, 0], [-255, -241, -255, -255, 51, 157, 41, 0], [-197, 255, 255, -255, 51, 157, 41, 0], [200, -128, -75, 85, 184, -140, 57, 13], [255, -255, 233, -255, -255, -255, 41, 0], [234, -43, 159, 43, 43, -255, 135, -175], [147, 73, 135, 43, 255, 255, 141, -203], [65, 111, -255, -255, -255, 23, 99, -93], [3, -51, 51, 61, -255, -255, 93, -61], [182, -21, 187, 204, 88, 239, 41, 77], [71, -9, -57, -113, -255, -255, 121, -77], [255, -109, 255, 255, -255, -217, 93, -63], [205, -165, 67, 79, -169, 255, 117, -51], [205, 25, 99, 101, -51, 255, 117, -51], [205, -41, 99, 211, -51, 255, 117, -51], [94, 237, -53, 255, 35, -69, 109, -23], [-101, -111, 218, -205, 124, 156, 121, -228], [208, 184, 85, 67, 255, -9, 117, -81], [192, -247, 206, -171, 239, -119, 86, -19], [-208, 122, -165, -10, 175, -231, 81, -43], [221, -39, 204, -162, 223, 146, 104, -45], [249, 138, 169, -105, -80, 52, 182, -199], [112, -55, -74, 204, -65, -82, 133, 31], [118, -181, 228, -95, 241, -75, 119, -85], [207, -7, 137, -5, -255, -229, 255, -5], [20, -48, 119, -142, 152, -105, 255, -37], [-255, 255, -255, -255, -203, 255, 245, -255], [-255, 255, -255, 91, -255, -255, 255, -255], [-198, -11, 108, 61, -121, -81, 136, 17], [-23, 255, 97, 121, 221, -37, 129, -97], [-255, -255, -255, 203, 255, -255, 213, -187], [84, 173, 113, 207, -3, 56, 91, 85], [239, 212, -142, 249, -30, -165, 80, 41]];
_global.CParrayCPU = [[147, 99, 9, -37, -177, 59, 115, -184], [-157, 99, -27, -37, -177, 59, 115, -184], [-157, 99, 123, 5, -177, 59, 115, -184], [-157, 99, -157, 5, 123, 19, 115, -184], [-157, 99, 89, 5, 123, 19, 115, -184], [255, 29, 119, 25, -255, 19, 115, -184], [199, 71, 63, 51, -255, 19, 115, -184], [53, 39, -93, -9, 237, -131, 13, 43], [209, -23, -255, -17, 165, 23, 9, 43], [255, -23, 255, -17, 255, 23, -7, 43], [217, 21, 223, 63, 255, 93, 59, -13]];
_global.CPnamearray = ["Poison Black ", "Black Knight", "Purple Hills", "Purple Tropical ", "Royal Magenta", "Oil Black ", "Sinester Citrus", "Purple Cider", "Red Stallion ", "Green Dragon", "Cold As Ice", "Blood Rage ", "Amazone Frog", "Bangkok Spider", "Pearl King", "Dual Freak Style", "Golden Sun ", "Ocean Blue ", "Pink Panther", "Blue Diamond ", "Nighthawk ", "PinkSkies ", "Light My Fire ", "Color Blind ", "Cyanide", "Goldrush", "Skywalker", "Pink Floor", "Fire From Hell", "Croc", "Arctic Sunset", "Super Glue", "Mellow Yellow", "Sunset Boulevard"];
_root.setmymoneyshow = function (spend) {
_global.mymoney = _global.mymoney - spend;
_root.mymoneyshow = String(_global.mymoney);
if (_root.mymoneyshow.length < 4) {
_root.mymoneyshow = _root.mymoneyshow + ",-";
} else {
_root.tempmymoneyshow = "";
i = 0;
while (i < _root.mymoneyshow.length) {
var firstslice = _root.mymoneyshow.slice(0, _root.mymoneyshow.length - 3);
var lastslice = _root.mymoneyshow.slice(_root.mymoneyshow.length - 3);
_root.mymoneyshow = firstslice;
_root.tempmymoneyshow = ("." + lastslice) + _root.tempmymoneyshow;
i = i + 3;
}
_root.mymoneyshow = (_root.mymoneyshow + _root.tempmymoneyshow) + ",-";
}
};
_root.pricemoney = [0, 50000, 25000, 10000, 150000, 80000, 50000, 350000, 190000, 150000];
_root.pricemoneyshow = ["0,-", "50.000,-", "25.000,-", "10.000,-", "150.000,-", "80.000,-", "50.000,-", "350.000,-", "190.000,-", "150.000,-"];
_root.pricearray = [0, 40000, 120000, 695000, 47500, 140000, 705000, 49000, 164000, 740000, 90000, 265000, 1200000];
_root.pricearrayshow = ["0", "40.000,-", "120.000,-", "695.000,-", "47.500,-", "140.000,-", "705.000,-", "49.000,-", "164.000,-", "740.000,-", "90.000,-", "265.000,-", "1.200.000,-"];
_global.boughsteararraya = [0, 0.1, 0.2, 0.4];
_global.boughsteararrayb = [0, 0.1, 0.2, 0.3];
_global.boughsteararrayc = [0, 0.1, 0.2, 0.4];
_global.boughspeedarraya = [0, 3, 6, 10];
_global.boughspeedarrayb = [0, 4, 8, 15];
_global.boughspeedarrayc = [0, 2, 5, 10];
_global.boughspeedarrayd = [0, 5, 12, 25];
Instance of Symbol 549 MovieClip "buyme_mc" in Frame 549
onClipEvent (load) {
this._visible = false;
}
Frame 563
startgame_but.useHandCursor = false;
highscore_but.useHandCursor = false;
help_but.useHandCursor = false;
credits_but.useHandCursor = false;
Frame 566
startgame_but.useHandCursor = false;
highscore_but.useHandCursor = false;
help_but.useHandCursor = false;
credits_but.useHandCursor = false;
Frame 569
startgame_but.useHandCursor = false;
highscore_but.useHandCursor = false;
help_but.useHandCursor = false;
credits_but.useHandCursor = false;
Frame 572
startgame_but.useHandCursor = false;
savegame_but.useHandCursor = false;
highscore_but.useHandCursor = false;
help_but.useHandCursor = false;
credits_but.useHandCursor = false;
stop();
Frame 595
globalStyleFormat.darkshadow = 16776960 /* 0xFFFF00 */;
globalStyleFormat.shadow = 0;
globalStyleFormat.highlight3D = 16776960 /* 0xFFFF00 */;
globalStyleFormat.highlight = 16776960 /* 0xFFFF00 */;
globalStyleFormat.face = 0;
globalStyleFormat.background = 0;
globalStyleFormat.textColor = 16776960 /* 0xFFFF00 */;
globalStyleFormat.textFont = "arial";
globalStyleFormat.textAlign = "center";
globalStyleFormat.radioDot = 3355392 /* 0x333300 */;
globalStyleFormat.check = 3355392 /* 0x333300 */;
globalStyleFormat.arrow = 16776960 /* 0xFFFF00 */;
globalStyleFormat.applyChanges();
maxcircuits = 12;
mychangehandler = function () {
if (!(ComboBox1.getSelectedIndex() === 0)) {
ComboBox1.setSelectedIndex(0);
}
};
_global.totalcircuits = [];
for (name in myObject) {
var mycircuitname = myObject[name].savecircuitname;
ComboBox1.addItem(mycircuitname, name);
}
mychangehandler();
if (!(_global.CPmycolor === undefined)) {
_root.colorname2 = CPnamearray[_global.CPmycolor];
}
stop();
back_but.useHandCursor = false;
Instance of Symbol 408 MovieClip [FComboBoxSymbol] "combobox1" in Frame 595
//component parameters
onClipEvent (initialize) {
editable = false;
labels = [];
labels[0] = "Demo Circuit";
labels[1] = "Albert Park - not in demo";
labels[2] = "Sepang - not in demo";
labels[3] = "Bahrein - not in demo";
labels[4] = "San Marino - not in demo";
labels[5] = "Catalunya - not in demo";
labels[6] = "Monaco - not in demo";
labels[7] = "Nurburgring - not in demo";
labels[8] = "Montreal - not in demo";
labels[9] = "Indianapolis - not in demo";
labels[10] = "Magny-Cours - not in demo";
labels[11] = "Silverstone - not in demo";
labels[12] = "Hockenheim - not in demo";
labels[13] = "Budapest - not in demo";
labels[14] = "Spa - not in demo";
labels[15] = "Monza - not in demo";
labels[16] = "Shanghai - not in demo";
labels[17] = "Suzuka - not in demo";
labels[18] = "Sao Paulo - not in demo";
rowCount = 8;
changeHandler = "mychangehandler";
}
Frame 662
_global.CPchangecolor = function (i, selected) {
driver = _root["showcolor" + i];
var mytext = _root["showcolor" + i].mytext;
driver.name = CPnamearray[i];
var ctargetbody = driver.colorshow_mc.tocolor_mc;
driver.myColor = new Color(ctargetbody);
driver.myColorTransform = new Object();
var myCT = driver.myColorTransform;
myCT.ra = CParray[selected][0];
myCT.rb = CParray[selected][1];
myCT.ga = CParray[selected][2];
myCT.gb = CParray[selected][3];
myCT.ba = CParray[selected][4];
myCT.bb = CParray[selected][5];
myCT.aa = CParray[selected][6];
myCT.ab = CParray[selected][7];
driver.myColor.setTransform(myCT);
};
_global.changeTextColor = function (currenttarget, mycolor, ctext, textfield) {
if (!(ctext === undefined)) {
trace(ctext);
trace(textfield);
textfield.text = ctext;
}
currenttarget.myformat = new TextFormat();
currenttarget.myformat.color = mycolor;
currenttarget.mytext.setTextFormat(currenttarget.myformat);
};
_global.CPchangecolorcar = function (selected) {
driver = _root.Colorpicker_car_mc;
_root.colorname = ">> " + CPnamearray[selected];
_root.colorname2 = CPnamearray[selected];
var ctargetbody = driver.tocolor_mc;
driver.myColor = new Color(ctargetbody);
driver.myColorTransform = new Object();
var myCT = driver.myColorTransform;
myCT.ra = CParray[selected][0];
myCT.rb = CParray[selected][1];
myCT.ga = CParray[selected][2];
myCT.gb = CParray[selected][3];
myCT.ba = CParray[selected][4];
myCT.bb = CParray[selected][5];
myCT.aa = CParray[selected][6];
myCT.ab = CParray[selected][7];
driver.myColor.setTransform(myCT);
var myoldcolor = _root["showcolor" + CPmycolor];
changeTextColor(myoldcolor, 13421772);
_global.CPmycolor = selected;
var mynewcolor = _root["showcolor" + CPmycolor];
changeTextColor(mynewcolor, 16777011);
};
_root.createEmptyMovieClip("colorshower", 1);
_root.colorshower.i = 0;
_root.colorshower.myx = 50;
_root.colorshower.onEnterFrame = function () {
if (((((((this.i == 4) || (this.i == 8)) || (this.i == 10)) || (this.i == 16)) || (this.i == 19)) || (this.i == 21)) || (this.i == 29)) {
ctarget = _root.attachMovie("colorpicker_colorset", "showcolor" + this.i, this.i + 30);
ctarget.onPress = function () {
CPchangecolorcar(this.mynumber);
};
} else {
ctarget = _root.attachMovie("colorpicker_demo", "showcolor" + this.i, this.i + 30);
}
ctarget.mynumber = this.i;
ctarget._x = this.myx;
ctarget._y = (this.i * 22) + 70;
CPchangecolor(this.i, this.i);
this.i = this.i + 1;
if (this.i > 17) {
ctarget._y = ((this.i - 18) * 22) + 70;
this.myx = 220;
ctarget._x = this.myx;
}
if (this.i > 33) {
if (!(CPmycolor === undefined)) {
CPchangecolorcar(CPmycolor);
}
this.onEnterFrame = undefined;
}
};
stop();
back_but.useHandCursor = false;
Frame 667
stop();
Frame 669
back_but.useHandCursor = false;
Frame 670
back_but.useHandCursor = false;
Frame 671
_root.thisisdemo_mc._visible = true;
_root.gotoAndPlay("menu");
Frame 672
_root.setmymoneyshow();
i = 1;
while (i <= 12) {
if (i >= 10) {
var letter = "d";
var inlist = (i - 9);
} else if (i >= 7) {
var letter = "c";
var inlist = (i - 6);
} else if (i >= 4) {
var letter = "b";
var inlist = (i - 3);
} else {
var letter = "a";
var inlist = i;
}
var ctarget = _root["itembuy" + i];
ctarget.number = i;
ctarget.letter = letter;
ctarget.inlist = inlist;
_root["itembuy" + i].onPress = function () {
_root.itembuy_underlay_mc.gotoAndStop(this.number);
_root.shopitems.gotoAndStop(this.number);
_root.cost = _root.pricearray[this.number];
_root.costshow = _root.pricearrayshow[this.number];
_root.letterselec = this.letter;
_root.inlistselec = this.inlist;
if (_global["bought" + this.letter] == this.inlist) {
_root.item_buy_mc.gotoAndStop("already");
} else if (this.inlist > 1) {
_root.item_buy_mc.gotoAndStop("demo");
} else if (_global.mymoney < _root.cost) {
_root.item_buy_mc.gotoAndStop("tomutch");
} else {
_root.item_buy_mc.gotoAndStop("buy");
}
};
i++;
}
_root.letterselec = "a";
_root.inlistselec = 1;
this.letter = "a";
this.number = 1;
this.inlist = 1;
_root.itembuy_underlay_mc.gotoAndStop(this.number);
_root.shopitems.gotoAndStop(this.number);
_root.cost = _root.pricearray[this.number];
_root.costshow = _root.pricearrayshow[this.number];
_root.letterselec = this.letter;
_root.inlistselec = this.inlist;
if (_global["bought" + this.letter] == this.inlist) {
_root.item_buy_mc.gotoAndStop("already");
} else if (this.inlist > 1) {
_root.item_buy_mc.gotoAndStop("demo");
} else if (_global.mymoney < _root.cost) {
_root.item_buy_mc.gotoAndStop("tomutch");
} else {
_root.item_buy_mc.gotoAndStop("buy");
}
_root.itemhavea.gotoAndStop(_global.boughta + 1);
_root.itemhaveb.gotoAndStop(_global.boughtb + 1);
_root.itemhavec.gotoAndStop(_global.boughtc + 1);
_root.itemhaved.gotoAndStop(_global.boughtd + 1);
back_but.useHandCursor = false;
Frame 673
_root.slider_Watcher_mc.onEnterFrame = function () {
if (_root.pressedslider || (_root.dragging)) {
_root.pressedslider = false;
var xpos = _root["slider_mc" + _root.dragid].slider_handler_mc._x;
var percent = ((xpos * 100) / 255);
if (percent > 100) {
percent = 100;
} else if (percent < 0) {
percent = 0;
}
_root["tuning" + _root.dragid] = percent;
var frame = Math.round((percent * _root[("tuning" + _root.dragid) + "_mc"]._totalframes) / 100);
if (frame < 1) {
frame = 1;
} else if (frame > _root[("tuning" + _root.dragid) + "_mc"]._totalframes) {
frame = _root[("tuning" + _root.dragid) + "_mc"]._totalframes;
}
_root[("tuning" + _root.dragid) + "_mc"].gotoAndStop(frame);
}
};
_root.createEmptyMovieClip("sliderstarter_mc", 13);
_root.sliderstarter_mc.ctime = 0;
_root.sliderstarter_mc.onEnterFrame = function () {
if (this.ctime == 0) {
this.i = 0;
while (this.i <= 4) {
var percent = _root["tuning" + this.i];
trace("percent=" + percent);
var xpos = ((percent * 255) / 100);
_root["slider_mc" + this.i].slider_handler_mc._x = xpos;
var frame = Math.round((percent * _root[("tuning" + this.i) + "_mc"]._totalframes) / 100);
if (frame < 1) {
frame = 1;
} else if (frame > _root[("tuning" + this.i) + "_mc"]._totalframes) {
frame = _root[("tuning" + this.i) + "_mc"]._totalframes;
}
_root[("tuning" + this.i) + "_mc"].gotoAndStop(frame);
this.i++;
}
_root.sliderstarter_mc.onEnterFrame = undefined;
_root.sliderstarter_mc.removeMovieClip();
} else {
this.ctime = this.ctime + 1;
}
};
Instance of Symbol 896 MovieClip "slider_mc1" in Frame 673
onClipEvent (load) {
this.id = 1;
}
Instance of Symbol 896 MovieClip "slider_mc2" in Frame 673
onClipEvent (load) {
this.id = 2;
}
Instance of Symbol 896 MovieClip "slider_mc3" in Frame 673
onClipEvent (load) {
this.id = 3;
}
Instance of Symbol 896 MovieClip "slider_mc4" in Frame 673
onClipEvent (load) {
this.id = 4;
}
Frame 674
_global.pasby1_Sound = new Sound();
pasby1_Sound.attachSound("pasby1_lnk");
_global.pasby2_Sound = new Sound();
pasby2_Sound.attachSound("pasby2_lnk");
_global.pasby3_Sound = new Sound();
pasby3_Sound.attachSound("pasby3_lnk");
_root.createEmptyMovieClip("pasby_mc", 5);
_root.pasby_mc.gtime = (Math.random() * 200) + 50;
_root.pasby_mc.ctime = 0;
_root.pasby_mc.onEnterFrame = function () {
if (this.ctime >= this.gtime) {
var csound = _global[("pasby" + Math.ceil(Math.random() * 3)) + "_Sound"];
csound.start();
this.ctime = 0;
this.gtime = Math.round(Math.random() * 300) + 50;
}
this.ctime = this.ctime + 1;
};
_root.esccatcher_mc.onEnterFrame = function () {
if (!Key.isDown(27)) {
this.pressing = false;
}
if (this.pressing) {
return(undefined);
}
if (Key.isDown(27)) {
this.pressing = true;
if (_root.escapeMenu_mc._currentframe == 1) {
if (driverObj.driver0.atpitstreet) {
return(undefined);
}
SoundControl.stopSound(driverObj.driver0);
Mouse.show();
if (_root.paused_mc._currentframe == 1) {
_root.afterpause = _global.gamestart;
}
_global.gamestart = false;
_root.escapeMenu_mc.gotoAndStop(2);
} else {
if (driverObj.driver0.atpitstreet) {
_global.TimeControl.timePaused = _root.afterpause;
} else {
_global.gamestart = _root.afterpause;
}
_root.escapeMenu_mc.gotoAndStop(1);
}
}
};
stop();
Frame 675
_global.framedest = undefined;
_root.black_mc.gotoAndPlay("fadeout");
_root.esccatcher_mc.onEnterFrame = function () {
if (!Key.isDown(27)) {
this.pressing = false;
}
if (this.pressing) {
return(undefined);
}
if (Key.isDown(27)) {
this.pressing = true;
if (_root.escapeMenu_mc._currentframe == 1) {
if (driverObj.driver0.atpitstreet) {
return(undefined);
}
SoundControl.stopSound(driverObj.driver0);
Mouse.show();
if (_root.paused_mc._currentframe == 1) {
_root.afterpause = _global.gamestart;
}
_global.gamestart = false;
_root.escapeMenu_mc.gotoAndStop(2);
} else {
if (driverObj.driver0.atpitstreet) {
_global.TimeControl.timePaused = _root.afterpause;
} else {
_global.gamestart = _root.afterpause;
}
_root.escapeMenu_mc.gotoAndStop(1);
}
}
};
Frame 676
stop();
Frame 678
_root.alloweddemoactions = 16;
_global.framedest = undefined;
_root.black_mc.gotoAndPlay("fadeout");
mouse.show();
_global.myCarColor = new Object();
var i = 0;
var mycolorindex = pickedcolors[0];
myCarColor.ra = CParray[mycolorindex][0];
myCarColor.rb = CParray[mycolorindex][1];
myCarColor.ga = CParray[mycolorindex][2];
myCarColor.gb = CParray[mycolorindex][3];
myCarColor.ba = CParray[mycolorindex][4];
myCarColor.bb = CParray[mycolorindex][5];
myCarColor.aa = CParray[mycolorindex][6];
myCarColor.ab = CParray[mycolorindex][7];
_root.invulx = 0;
_root.invuly = 0;
_root.invulxcar = 740;
_root.invulycar = 300;
_root.invulLevel = 1;
fscommand ("allowscale", "false");
fscommand ("fullscreen", "false");
_root.yes._visible = false;
MovieClip.prototype.addAsCharacter = function () {
characterArray.push(this);
};
MovieClip.prototype.removeAsCharacter = function () {
i = 0;
while (i < characterArray.length) {
if (characterArray[i] == this) {
characterArray.splice(i, 1);
}
i++;
}
};
MovieClip.prototype.addAsStatic = function () {
staticArray.push(this);
};
Array.prototype.sortOnNum = function (p) {
var sortfunc = function (a, b) {
return(a[p] > b[p]);
};
this.sort(sortfunc);
};
_global.map = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
TimeObject = function () {
};
TimeObject.prototype.setstartTime = function () {
this.starttime = getTimer() / 1000;
};
TimeObject.prototype.addTime = function (timer) {
};
TimeObject.prototype.publishTime = function () {
if (this.timePaused) {
return(undefined);
}
this.currentTime = (MainControl.getmytimer() / 1000) - (_root.startmainpittimer / 1000);
_root.toshowpittime = this.currentTime;
var differenceRound = String(this.currentTime);
spotdot = differenceRound.lastIndexOf(".");
stringlength = differenceRound.length;
if (spotdot == -1) {
differenceRound = differenceRound + ".00";
} else if ((stringlength - spotdot) == 2) {
differenceRound = differenceRound + "0";
}
spotdot = differenceRound.lastIndexOf(".");
stringlength2 = differenceRound.length;
differenceRound2 = differenceRound.substring(0, spotdot + 3);
var gameHour = differenceRound2;
_root.indicator_time_mc.timeDisplay_txt.text = gameHour;
_root.indicator_time_mc.timeDisplay2_txt.text = gameHour;
};
TimeObject.prototype.saveTime = function () {
trace("TIMEOBJECT saveTime, this.currentTime=" + this.currentTime);
var ctime = TimeControl.currentTime;
trace("++++++++++++++++" + ctime);
pitstoplevel.push(ctime);
pitstoptimes.push(ctime);
trace("pitstoplevel=" + pitstoplevel);
trace("pitstoptimes=" + pitstoptimes);
trace("-------pitstoptimes---------");
maxlength = pitstoptimes.length - 1;
trace("maxlength=" + maxlength);
_global.averagetotal = 0;
i = 0;
while (i <= maxlength) {
var trow = Number(pitstoptimes[i]);
trace("trow=" + trow);
_global.averagetotal = _global.averagetotal + trow;
trace("averagetotal in = " + _global.averagetotal);
i++;
}
trace("averagetotal before deviding = " + _global.averagetotal);
var averagetotaltrow = (_global.averagetotal / maxlength);
_global.averagetotal = averagetotaltrow;
trace("averagetotal = " + _global.averagetotal);
var gameHour = this.gettxt(_global.averagetotal);
_root.menu_levelcomplited_mc.averagetotal_txt.text = gameHour;
_root.points = gameHour;
_root.level = clevel;
trace("-------------------_" + gameHour);
trace("-------pitstoplevel---------");
maxlength = pitstoplevel.length - 1;
trace("maxlength=" + maxlength);
_global.average = 0;
i = 0;
while (i <= maxlength) {
var trow = Number(pitstoplevel[i]);
trace("trow=" + trow);
_global.average = _global.average + trow;
trace("average in = " + _global.average);
i++;
}
trace("average before deviding = " + _global.average);
var averagetrow = (_global.average / maxlength);
_global.average = averagetrow;
trace("average = " + _global.average);
var gameHour = this.gettxt(String(_global.average));
_root.menu_levelcomplited_mc.average_txt.text = gameHour;
var differenceRound = String(targettime);
var gameHour = this.gettxt(differenceRound);
_root.menu_levelcomplited_mc.targettime_txt.text = gameHour;
_global.overtime = targettime - average;
var differenceRound = String(overtime);
var gameHour = this.gettxt(differenceRound);
_root.menu_levelcomplited_mc.overtime_txt.text = gameHour;
};
TimeObject.prototype.gettxt = function (givenNumber) {
var receivedNumber = givenNumber;
differenceRound = String(receivedNumber);
spotdot = differenceRound.lastIndexOf(".");
stringlength = differenceRound.length;
if (spotdot == -1) {
differenceRound = differenceRound + ".00";
} else if ((stringlength - spotdot) == 2) {
differenceRound = differenceRound + "0";
}
spotdot = differenceRound.lastIndexOf(".");
stringlength2 = differenceRound.length;
var differenceRound2 = differenceRound.substring(0, spotdot + 3);
return(differenceRound2);
};
TimeObject.prototype.endGame = function () {
};
TimeObject.prototype.resetTime = function () {
this.currentTime = 0;
var gameHour = "0.00";
_root.indicator_time_mc.timeDisplay_txt.text = gameHour;
_root.indicator_time_mc.timeDisplay2_txt.text = gameHour;
};
TimeObject.prototype.stopTime = function () {
var differenceRound = String(this.currentTime);
spotdot = differenceRound.lastIndexOf(".");
stringlength = differenceRound.length;
if (spotdot == -1) {
differenceRound = differenceRound + ".00";
} else if ((stringlength - spotdot) == 2) {
differenceRound = differenceRound + "0";
}
spotdot = differenceRound.lastIndexOf(".");
stringlength2 = differenceRound.length;
differenceRound2 = differenceRound.substring(0, spotdot + 3);
var gameHour = differenceRound2;
_root.indicator_time_mc.timeDisplay_txt.text = gameHour;
_root.indicator_time_mc.timeDisplay2_txt.text = gameHour;
this.timePaused = true;
};
MoneyObject = function () {
};
MoneyObject.prototype.addFunds = function (amount) {
this.totalFunds = this.totalFunds + amount;
this.displayFunds();
};
MoneyObject.prototype.decreaseFunds = function (amount) {
this.totalFunds = this.totalFunds - amount;
if (this.totalFunds < 0) {
this.totalFunds = 0;
}
this.displayFunds();
};
MoneyObject.prototype.resetFunds = function () {
this.totalFunds = 0;
this.displayFunds();
};
MoneyObject.prototype.displayFunds = function () {
var totalAmount = this.totalFunds;
var totalCents = Math.round(totalAmount * 100);
var cents = String(totalCents).slice(-2);
var dollars = String(totalCents).substring(0, String(totalCents).length - 2);
if (String(totalAmount).length == 1) {
if (totalAmount == 0) {
_root.tabs.moneyDisplay_txt.text = "$ 0.00";
} else {
_root.tabs.moneyDisplay_txt.text = "$ 0.0" + cents;
}
} else if (String(totalAmount).length == 2) {
_root.tabs.moneyDisplay_txt.text = "$ 0." + cents;
} else if (String(dollars).length == 0) {
_root.tabs.moneyDisplay_txt.text = "$ 0." + cents;
} else {
_root.tabs.moneyDisplay_txt.text = (("$ " + dollars) + ".") + cents;
}
};
ScreenObject = function () {
};
ScreenObject.prototype.normalMode = function () {
this.debug = false;
_root.screenMask._visible = true;
_root.gameScreen.setMask(_root.screenMask);
_root.screenBG._visible = true;
_root.gameScreen.labels._visible = false;
_root.gameScreen.outlines._visible = false;
_root.tabs._visible = true;
_root.buttons._visible = true;
_root.debugger._visible = false;
};
ScreenObject.prototype.debugMode = function () {
this.debug = true;
_root.gameScreen.setMask(null);
_root.screenMask._visible = false;
_root.screenBG._visible = false;
_root.gameScreen.labels._visible = true;
_root.gameScreen.outlines._visible = true;
_root.tabs._visible = false;
_root.buttons._visible = false;
_root.debugger._visible = true;
};
ScreenObject.prototype.switchMode = function () {
if (this.debug) {
this.normalMode();
} else {
this.debugMode();
}
};
ScreenObject.prototype.scrollScreen = function (referencePoint) {
var screenX = screenReferences[referencePoint].xPos;
var screenY = screenReferences[referencePoint].yPos;
this.currentX = screenX;
this.currentY = screenY;
this.currentReferencePoint = referencePoint;
this.broadcastMessage("onScroll", referencePoint);
gameControl.doWalk();
_root.gameScreen._x = screenX;
_root.gameScreen._y = screenY;
};
ScreenObject.prototype.clickCharacter = function (Obj) {
var givenObj = obj;
if (_root.mainCharacter == givenObj) {
actionControl.mainCharacter = undefined;
_root.mainCharacter = undefined;
actionControl.deselectAction();
return(undefined);
}
_root.mainCharacter = givenObj;
_root.gameScreen.mainCharacter = givenObj;
actionControl.selectAction(givenObj);
};
ScreenObject.prototype.clickScreen = function (mouseX, mouseY, charX, charY) {
if (!_root.gameScreen.mainCharacter.waiting) {
actionControl.resetcharacter();
var cxPos = Math.ceil(_root.gameScreen.mainCharacter.xPos / this.tileWidth);
var cyPos = Math.ceil(_root.gameScreen.mainCharacter.yPos / this.tileHeight);
xPos = mouseX;
yPos = mouseY;
var exPos = (Math.ceil(xPos / this.tileWidth) - 1);
var eyPos = (Math.ceil(yPos / this.tileHeight) - 1);
if ((cxPos == exPos) && (cyPos == eyPos)) {
return(undefined);
}
direction = "notimportant";
_root.newCharacter = _root.mainCharacter;
delete _root.newCharacter.mileStones;
delete _root.newCharacter.wayPoints;
xPos = _root.gameScreen.mainCharacter.xPos;
yPos = _root.gameScreen.mainCharacter.yPos;
this.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
screenControl.setboei(xPos, yPos, mouseX, mouseY);
xPos = mouseX;
yPos = mouseY;
this.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
actionControl.mainCharacter = undefined;
_root.mainCharacter = undefined;
actionControl.deselectAction();
}
};
ScreenObject.prototype.clickScreenSingle = function (mouseX, mouseY, obj) {
if (!_root.gameScreen.mainCharacter.waiting) {
var givenObj = obj;
actionControl.mainCharacter = givenObj;
_root.mainCharacter = givenObj;
_root.gameScreen.mainCharacter = givenObj;
actionControl.resetcharacter();
var cxPos = Math.ceil(_root.gameScreen.mainCharacter.xPos / this.tileWidth);
var cyPos = Math.ceil(_root.gameScreen.mainCharacter.yPos / this.tileHeight);
xPos = mouseX;
yPos = mouseY;
var exPos = (Math.ceil(xPos / this.tileWidth) - 1);
var eyPos = (Math.ceil(yPos / this.tileHeight) - 1);
if ((cxPos == exPos) && (cyPos == eyPos)) {
return(undefined);
}
direction = "notimportant";
_root.newCharacter = _root.mainCharacter;
delete _root.newCharacter.mileStones;
delete _root.newCharacter.wayPoints;
xPos = _root.gameScreen.mainCharacter.xPos;
yPos = _root.gameScreen.mainCharacter.yPos;
this.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
xPos = mouseX;
yPos = mouseY;
this.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
actionControl.mainCharacter = undefined;
_root.mainCharacter = undefined;
actionControl.deselectAction();
}
};
ScreenObject.prototype.clickAction = function (mouseX, mouseY, charX, charY) {
if (!_root.gameScreen.mainCharacter.waiting) {
var cxPos = Math.ceil(_root.gameScreen.mainCharacter.xPos / this.tileWidth);
var cyPos = Math.ceil(_root.gameScreen.mainCharacter.yPos / this.tileHeight);
xPos = mouseX - this.currentX;
yPos = mouseY - this.currentY;
var exPos = Math.ceil(xPos / this.tileWidth);
var eyPos = Math.ceil(yPos / this.tileHeight);
if ((cxPos == exPos) && (cyPos == eyPos)) {
if (!(_root.mainCharacter.myendpose === undefined)) {
_root.mainCharacter.pose = _root.mainCharacter.myendpose;
_root.mainCharacter.gotoAndStop(_root.mainCharacter.pose);
}
_root.mainCharacter.oldPose = "idle";
_root.mainCharacter.poseClip.gotoAndStop(1);
_root.mainCharacter.myendfunction(_root.mainCharacter);
return(undefined);
}
direction = "notimportant";
_root.newCharacter = _root.mainCharacter;
delete _root.newCharacter.mileStones;
delete _root.newCharacter.wayPoints;
xPos = _root.gameScreen.mainCharacter.xPos;
yPos = _root.gameScreen.mainCharacter.yPos;
this.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
screenControl.setboei(xPos, yPos, mouseX, mouseY);
xPos = mouseX - this.currentX;
yPos = mouseY - this.currentY;
this.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
};
ScreenObject.prototype.setboei = function (xPos, yPos, xGoal, yGoal) {
if ((xPos > _root.lineV3_mc._x) && (xGoal > _root.lineV3_mc._x)) {
trace("returned on 1");
return(undefined);
}
if ((xPos < _root.lineV1_mc._x) && (xGoal < _root.lineV1_mc._x)) {
trace("returned on 2");
return(undefined);
}
if ((yPos < _root.line1_mc._y) && (yGoal < _root.line1_mc._y)) {
if ((xPos < _root.lineV2_mc._x) && (xGoal > _root.lineV2_mc._x)) {
var xTogive = _root.dot9_mc._x;
var yTogive = _root.dot9_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
if ((xPos > _root.lineV2_mc._x) && (xGoal < _root.lineV2_mc._x)) {
var xTogive = _root.dot9_mc._x;
var yTogive = _root.dot9_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
trace("returned on 3");
return(undefined);
}
if ((yPos > _root.line2_mc._y) && (yGoal > _root.line2_mc._y)) {
if ((xPos < _root.lineV2_mc._x) && (xGoal > _root.lineV2_mc._x)) {
var xTogive = _root.dot10_mc._x;
var yTogive = _root.dot10_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
if ((xPos > _root.lineV2_mc._x) && (xGoal < _root.lineV2_mc._x)) {
var xTogive = _root.dot10_mc._x;
var yTogive = _root.dot10_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
trace("returned on 4");
return(undefined);
}
if ((xPos > _root.lineV3_mc._x) && (yGoal > _root.line3_mc._y)) {
trace("from right going under");
var xTogive = _root.dot6_mc._x;
var yTogive = _root.dot6_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
if ((xPos > _root.lineV2_mc._x) && (xGoal < _root.lineV2_mc._x)) {
var xTogive = _root.dot10_mc._x;
var yTogive = _root.dot10_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
if (xGoal < _root.lineV1_mc._x) {
var xTogive = _root.dot2_mc._x;
var yTogive = _root.dot6_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
return(undefined);
}
if ((xPos > _root.lineV3_mc._x) && (yGoal < _root.line3_mc._y)) {
trace("from right going over");
var xTogive = _root.dot6_mc._x;
var yTogive = _root.dot2_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
if ((xPos > _root.lineV2_mc._x) && (xGoal < _root.lineV2_mc._x)) {
var xTogive = _root.dot9_mc._x;
var yTogive = _root.dot9_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
if (xGoal < _root.lineV1_mc._x) {
var xTogive = _root.dot2_mc._x;
var yTogive = _root.dot2_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
return(undefined);
}
if ((xPos < _root.lineV1_mc._x) && (yGoal > _root.line3_mc._y)) {
trace("from left going under");
var xTogive = _root.dot2_mc._x;
var yTogive = _root.dot6_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
if ((xPos < _root.lineV2_mc._x) && (xGoal > _root.lineV2_mc._x)) {
var xTogive = _root.dot10_mc._x;
var yTogive = _root.dot10_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
if (xGoal >= _root.lineV3_mc._x) {
var xTogive = _root.dot6_mc._x;
var yTogive = _root.dot6_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
return(undefined);
}
if ((xPos > _root.lineV3_mc._x) && (yGoal < _root.line3_mc._y)) {
trace("from left going over");
var xTogive = _root.dot2_mc._x;
var yTogive = _root.dot2_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
if ((xPos < _root.lineV2_mc._x) && (xGoal > _root.lineV2_mc._x)) {
var xTogive = _root.dot9_mc._x;
var yTogive = _root.dot9_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
if (xGoal > _root.lineV3_mc._x) {
var xTogive = _root.dot6_mc._x;
var yTogive = _root.dot2_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
return(undefined);
}
if ((((yPos < _root.line1_mc._y) && (xPos > _root.lineV1_mc._x)) && (xPos < _root.lineV3_mc._x)) && (xGoal < _root.lineV1_mc._x)) {
trace("from top going left");
var xTogive = _root.dot1_mc._x;
var yTogive = _root.dot1_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
return(undefined);
}
if ((((yPos < _root.line1_mc._y) && (xPos > _root.lineV1_mc._x)) && (xPos < _root.lineV3_mc._x)) && (xGoal > _root.lineV3_mc._x)) {
trace("from top going right");
var xTogive = _root.dot5_mc._x;
var yTogive = _root.dot1_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
return(undefined);
}
if ((((yPos > _root.line2_mc._y) && (xPos > _root.lineV1_mc._x)) && (xPos < _root.lineV3_mc._x)) && (xGoal < _root.lineV1_mc._x)) {
trace("from buttom going left");
var xTogive = _root.dot1_mc._x;
var yTogive = _root.dot8_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
return(undefined);
}
if ((((yPos > _root.line2_mc._y) && (xPos > _root.lineV1_mc._x)) && (xPos < _root.lineV3_mc._x)) && (xGoal > _root.lineV3_mc._x)) {
trace("from buttom going rigth");
var xTogive = _root.dot5_mc._x;
var yTogive = _root.dot8_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
return(undefined);
}
if (((yPos < _root.line1_mc._y) && (xGoal <= _root.lineV2_mc._x)) && (yGoal > _root.line2_mc._y)) {
trace("from top going left to buttom");
var xTogive = _root.dot1_mc._x;
var yTogive = _root.dot1_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
var xTogive = _root.dot1_mc._x;
var yTogive = _root.dot8_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
} else if (((yPos < _root.line1_mc._y) && (xGoal > _root.lineV2_mc._x)) && (yGoal > _root.line2_mc._y)) {
trace("from top going rigth to buttom");
var xTogive = _root.dot5_mc._x;
var yTogive = _root.dot1_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
var xTogive = _root.dot5_mc._x;
var yTogive = _root.dot8_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
if (((yPos > _root.line2_mc._y) && (xGoal <= _root.lineV2_mc._x)) && (yGoal < _root.line1_mc._y)) {
trace("from buttom going left to top");
var xTogive = _root.dot1_mc._x;
var yTogive = _root.dot8_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
var xTogive = _root.dot1_mc._x;
var yTogive = _root.dot1_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
} else if (((yPos > _root.line2_mc._y) && (xGoal > _root.lineV2_mc._x)) && (yGoal < _root.line1_mc._y)) {
trace("from buttom going left to buttom");
var xTogive = _root.dot5_mc._x;
var yTogive = _root.dot8_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
var xTogive = _root.dot5_mc._x;
var yTogive = _root.dot1_mc._y;
this.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(this.nextWaypoint);
}
trace("Hoefde niet om telopen");
};
ScreenObject.prototype.getCoordinates = function (x, y) {
var newXpos = Math.ceil(x / this.tileWidth);
var newYpos = Math.ceil(y / this.tileHeight);
return({x:newXpos, y:newYpos});
};
ScreenObject.prototype.getTileStatus = function (column, row) {
currentTile = map[column - 1][row - 1];
if (currentTile == 0) {
return(false);
}
return(true);
};
screenObject.prototype.checkScroll = function () {
xPos = _root.gameScreen.mainCharacter.xPos + this.currentX;
yPos = _root.gameScreen.mainCharacter.yPos + this.currentY;
if ((((yPos >= 123) && (yPos <= 379)) && (xPos >= 92)) && (xPos <= 499)) {
return(undefined);
}
if (((yPos <= 123) && (xPos >= 166)) && (xPos < 499)) {
if (!(screenReferences[this.currentReferencePoint].position8 === "disabled")) {
this.scrollScreen(screenReferences[this.currentReferencePoint].position8);
}
} else if ((yPos <= 284) && (xPos >= 499)) {
if (!(screenReferences[this.currentReferencePoint].position9 === "disabled")) {
this.scrollScreen(screenReferences[this.currentReferencePoint].position9);
}
} else if (((yPos > 284) && (xPos >= 499)) || ((yPos >= 379) && (xPos >= 425))) {
if (!(screenReferences[this.currentReferencePoint].position3 === "disabled")) {
this.scrollScreen(screenReferences[this.currentReferencePoint].position3);
}
} else if (((yPos >= 379) && (xPos > 92)) && (xPos < 425)) {
if (!(screenReferences[this.currentReferencePoint].position2 === "disabled")) {
this.scrollScreen(screenReferences[this.currentReferencePoint].position2);
}
} else if ((yPos > 216) && (xPos <= 92)) {
if (!(screenReferences[this.currentReferencePoint].position4 === "disabled")) {
this.scrollScreen(screenReferences[this.currentReferencePoint].position4);
}
} else if (((yPos <= 216) && (xPos <= 92)) || ((yPos <= 123) && (xPos < 166))) {
if (!(screenReferences[this.currentReferencePoint].position7 === "disabled")) {
this.scrollScreen(screenReferences[this.currentReferencePoint].position7);
}
} else {
trace("An error has occurred on the scrollfunction of\nthe main character. No direction chosen.");
}
};
_global.screenReferences = new Object();
screenReferences.a1 = new Object();
screenReferences.a1.xPos = -529;
screenReferences.a1.yPos = 93;
screenReferences.a1.position8 = "disabled";
screenReferences.a1.position9 = "disabled";
screenReferences.a1.position3 = "a2";
screenReferences.a1.position2 = "b2";
screenReferences.a1.position4 = "b1";
screenReferences.a1.position7 = "disabled";
screenReferences.a2 = new Object();
screenReferences.a2.xPos = -863;
screenReferences.a2.yPos = -89;
screenReferences.a2.position8 = "disabled";
screenReferences.a2.position9 = "disabled";
screenReferences.a2.position3 = "a3";
screenReferences.a2.position2 = "b3";
screenReferences.a2.position4 = "b2";
screenReferences.a2.position7 = "a1";
screenReferences.a3 = new Object();
screenReferences.a3.xPos = -1196;
screenReferences.a3.yPos = -271;
screenReferences.a3.position8 = "disabled";
screenReferences.a3.position9 = "disabled";
screenReferences.a3.position3 = "a4";
screenReferences.a3.position2 = "b4";
screenReferences.a3.position4 = "b3";
screenReferences.a3.position7 = "a2";
screenReferences.a4 = new Object();
screenReferences.a4.xPos = -1528;
screenReferences.a4.yPos = -453;
screenReferences.a4.position8 = "disabled";
screenReferences.a4.position9 = "disabled";
screenReferences.a4.position3 = "a5";
screenReferences.a4.position2 = "b5";
screenReferences.a4.position4 = "b4";
screenReferences.a4.position7 = "a3";
screenReferences.a5 = new Object();
screenReferences.a5.xPos = -1861;
screenReferences.a5.yPos = -635;
screenReferences.a5.position8 = "disabled";
screenReferences.a5.position9 = "disabled";
screenReferences.a5.position3 = "disabled";
screenReferences.a5.position2 = "b6";
screenReferences.a5.position4 = "b5";
screenReferences.a5.position7 = "a4";
screenReferences.b1 = new Object();
screenReferences.b1.xPos = -122;
screenReferences.b1.yPos = 42;
screenReferences.b1.position8 = "disabled";
screenReferences.b1.position9 = "a1";
screenReferences.b1.position3 = "b2";
screenReferences.b1.position2 = "c1";
screenReferences.b1.position4 = "disabled";
screenReferences.b1.position7 = "disabled";
screenReferences.b2 = new Object();
screenReferences.b2.xPos = -455;
screenReferences.b2.yPos = -140;
screenReferences.b2.position8 = "a1";
screenReferences.b2.position9 = "a2";
screenReferences.b2.position3 = "b3";
screenReferences.b2.position2 = "c2";
screenReferences.b2.position4 = "c1";
screenReferences.b2.position7 = "b1";
screenReferences.b3 = new Object();
screenReferences.b3.xPos = -788;
screenReferences.b3.yPos = -322;
screenReferences.b3.position8 = "a2";
screenReferences.b3.position9 = "a3";
screenReferences.b3.position3 = "b4";
screenReferences.b3.position2 = "c3";
screenReferences.b3.position4 = "c2";
screenReferences.b3.position7 = "b2";
screenReferences.b4 = new Object();
screenReferences.b4.xPos = -1121;
screenReferences.b4.yPos = -504;
screenReferences.b4.position8 = "a3";
screenReferences.b4.position9 = "a4";
screenReferences.b4.position3 = "b5";
screenReferences.b4.position2 = "c4";
screenReferences.b4.position4 = "c3";
screenReferences.b4.position7 = "b3";
screenReferences.b5 = new Object();
screenReferences.b5.xPos = -1454;
screenReferences.b5.yPos = -686;
screenReferences.b5.position8 = "a4";
screenReferences.b5.position9 = "a5";
screenReferences.b5.position3 = "b6";
screenReferences.b5.position2 = "c5";
screenReferences.b5.position4 = "c4";
screenReferences.b5.position7 = "b4";
screenReferences.b6 = new Object();
screenReferences.b6.xPos = -1786;
screenReferences.b6.yPos = -868;
screenReferences.b6.position8 = "a5";
screenReferences.b6.position9 = "disabled";
screenReferences.b6.position3 = "disabled";
screenReferences.b6.position2 = "c6";
screenReferences.b6.position4 = "c5";
screenReferences.b6.position7 = "b5";
screenReferences.c1 = new Object();
screenReferences.c1.xPos = -48;
screenReferences.c1.yPos = -191;
screenReferences.c1.position8 = "b1";
screenReferences.c1.position9 = "b2";
screenReferences.c1.position3 = "c2";
screenReferences.c1.position2 = "disabled";
screenReferences.c1.position4 = "disabled";
screenReferences.c1.position7 = "disabled";
screenReferences.c2 = new Object();
screenReferences.c2.xPos = -381;
screenReferences.c2.yPos = -373;
screenReferences.c2.position8 = "b2";
screenReferences.c2.position9 = "b3";
screenReferences.c2.position3 = "c3";
screenReferences.c2.position2 = "d1";
screenReferences.c2.position4 = "disabled";
screenReferences.c2.position7 = "c1";
screenReferences.c3 = new Object();
screenReferences.c3.xPos = -714;
screenReferences.c3.yPos = -555;
screenReferences.c3.position8 = "b3";
screenReferences.c3.position9 = "b4";
screenReferences.c3.position3 = "c4";
screenReferences.c3.position2 = "d2";
screenReferences.c3.position4 = "d1";
screenReferences.c3.position7 = "c2";
screenReferences.c4 = new Object();
screenReferences.c4.xPos = -1047;
screenReferences.c4.yPos = -737;
screenReferences.c4.position8 = "b4";
screenReferences.c4.position9 = "b5";
screenReferences.c4.position3 = "c5";
screenReferences.c4.position2 = "disabled";
screenReferences.c4.position4 = "d2";
screenReferences.c4.position7 = "c3";
screenReferences.c5 = new Object();
screenReferences.c5.xPos = -1380;
screenReferences.c5.yPos = -909;
screenReferences.c5.position8 = "b5";
screenReferences.c5.position9 = "b6";
screenReferences.c5.position3 = "c6";
screenReferences.c5.position2 = "disabled";
screenReferences.c5.position4 = "disabled";
screenReferences.c5.position7 = "c4";
screenReferences.c6 = new Object();
screenReferences.c6.xPos = -1713;
screenReferences.c6.yPos = -1101;
screenReferences.c6.position8 = "b6";
screenReferences.c6.position9 = "disabled";
screenReferences.c6.position3 = "disabled";
screenReferences.c6.position2 = "disabled";
screenReferences.c6.position4 = "disabled";
screenReferences.c6.position7 = "c5";
screenReferences.d1 = new Object();
screenReferences.d1.xPos = -307;
screenReferences.d1.yPos = -606;
screenReferences.d1.position8 = "c2";
screenReferences.d1.position9 = "c3";
screenReferences.d1.position3 = "d2";
screenReferences.d1.position2 = "e1";
screenReferences.d1.position4 = "disabled";
screenReferences.d1.position7 = "disabled";
screenReferences.d2 = new Object();
screenReferences.d2.xPos = -640;
screenReferences.d2.yPos = -788;
screenReferences.d2.position8 = "c3";
screenReferences.d2.position9 = "c4";
screenReferences.d2.position3 = "disabled";
screenReferences.d2.position2 = "disabled";
screenReferences.d2.position4 = "e1";
screenReferences.d2.position7 = "d1";
screenReferences.e1 = new Object();
screenReferences.e1.xPos = -233;
screenReferences.e1.yPos = -839;
screenReferences.e1.position8 = "d1";
screenReferences.e1.position9 = "d2";
screenReferences.e1.position3 = "disabled";
screenReferences.e1.position2 = "disabled";
screenReferences.e1.position4 = "disabled";
screenReferences.e1.position7 = "disabled";
GameObject = function () {
};
GameObject.prototype.getUniqueDepth = function (type) {
if (type == "character") {
this.depthCountCharacter++;
if ((this.depthCountCharacter >= 1000) || (this.depthCountCharacter < 150)) {
this.depthCountCharacter = 150;
}
return(this.depthCountCharacter);
}
if (type == "static") {
this.depthCountStatic++;
if ((this.depthCountStatic >= 150) || (this.depthCountStatic < 0)) {
trace("To many static objects in game.\nIncrease maximum number of static objects");
}
return(this.depthCountStatic);
}
};
GameObject.prototype.doWalk = function () {
if (!timeControl.gamePaused) {
this.broadcastMessage("onWalk");
if (this.charactersPaused) {
this.charactersPaused = false;
}
} else if (!this.charactersPaused) {
this.broadcastMessage("onPause");
this.charactersPaused = true;
}
};
GameObject.prototype.createCharacter = function (xPos, yPos, direction) {
this.characterCount++;
this.characterLivingCount++;
var uniqueDepth = this.getUniqueDepth("character");
newAvatar = this.avatars[Math.floor(Math.random() * this.avatars.length)];
newCharacter = _root.gameScreen.attachMovie("character35", "character" + this.characterCount, uniqueDepth);
newCharacter.type = newAvatar.type;
newCharacter.sex = newAvatar.sex;
newCharacter.head = newAvatar.head;
var tmpArray = new Array();
i = 0;
while (i < namesArray.length) {
if (namesArray[i].sex == newCharacter.sex) {
tmpArray.push({firstName:namesArray[i].firstName, lastName:namesArray[i].lastName});
}
i++;
}
var randomNumber = Math.floor(Math.random() * tmpArray.length);
newCharacter.firstName = tmpArray[randomNumber].firstName;
newCharacter.lastName = tmpArray[randomNumber].lastName;
newCharacter._x = xPos;
newCharacter._y = yPos;
this.uniqueDepth = uniqueDepth;
newCharacter.direction = direction;
randomObjectives = Math.round(Math.random() * 3) + 3;
this.nextWaypoint = {x:xPos, y:yPos, direction:direction};
this.saveMileStone(this.nextWaypoint);
i = 1;
while (i < randomObjectives) {
tries = 1;
while (tries <= 9) {
lastX = newCharacter.mileStones[newCharacter.mileStones.length - 1].x;
lastY = newCharacter.mileStones[newCharacter.mileStones.length - 1].y;
if (tries <= 3) {
lastDirection = newCharacter.mileStones[newCharacter.mileStones.length - 1].direction + (Math.round(Math.random() * 180) - 90);
} else {
lastDirection = newCharacter.mileStones[newCharacter.mileStones.length - 1].direction + (Math.round(Math.random() * 360) - 180);
}
this.nextWaypoint = this.getNewWaypoint(lastX, lastY, lastDirection);
if (this.checkWaypoint(this.nextWaypoint)) {
this.saveMileStone(this.nextWaypoint);
break;
}
if (tries == 6) {
}
tries++;
}
i++;
}
this.saveMileStone(this.getEndZone(this.nextWaypoint));
newCharacter.inHoldingArea = false;
newCharacter.speedX = 4;
newCharacter.speedY = 4;
newCharacter.xPos = newCharacter._x;
newCharacter.yPos = newCharacter._y;
gameControl.addListener(newCharacter);
newCharacter.mileStone = 0;
newCharacter.onWalk = function () {
if (this.waiting) {
return(undefined);
}
if ((this.wayPoints.length < 1) && (!this.waiting)) {
this.mileStone++;
this.wayPoint = 1;
pathObj = new Object();
pathObj.start = screenControl.getCoordinates(this.mileStones[this.mileStone - 1].x, this.mileStones[this.mileStone - 1].y);
pathObj.end = screenControl.getCoordinates(this.mileStones[this.mileStone].x, this.mileStones[this.mileStone].y);
pathObj.mc = this;
pathObj.depth = 50;
if (!this.imLive) {
gameControl.waitForPath.push(pathObj);
} else {
gameControl.waitForPath.unshift(pathObj);
}
this.waiting = true;
this.poseClip.stop();
this.oldPose = "idle";
return(undefined);
}
var diffY = (this.yPos - this.wayPoints[this.wayPoint].y);
var diffX = (this.xPos - this.wayPoints[this.wayPoint].x);
if (diffY >= this.speedY) {
this.yPos = this.yPos - this.speedY;
this.yDirection = "up";
} else if (diffY <= (-this.speedY)) {
this.yPos = this.yPos + this.speedY;
this.yDirection = "down";
} else {
this.yDirection = "straight";
}
if (diffX <= (-this.speedX)) {
this.xPos = this.xPos + this.speedX;
this.xDirection = "right";
} else if (diffX >= this.speedX) {
this.xPos = this.xPos - this.speedX;
this.xDirection = "left";
} else {
this.xDirection = "straight";
}
var diffY = (this.yPos - this.wayPoints[this.wayPoint].y);
var diffX = (this.xPos - this.wayPoints[this.wayPoint].x);
if ((((diffY < this.speedY) && (diffY > (-this.speedY))) && (diffX > (-this.speedX))) && (diffX < this.speedX)) {
if (this.wayPoint < (this.wayPoints.length - 1)) {
this.wayPoint++;
} else if (this.mileStone < (this.mileStones.length - 1)) {
delete this.wayPoints;
} else {
this.characterLivingCount--;
this.removeAsCharacter();
this.removeMovieClip();
}
}
var positionX = (this.xPos + screenControl.currentX);
var positionY = (this.yPos + screenControl.currentY);
this.imLive = false;
this.imLive = true;
if (this.yDirection == "up") {
if (this.xDirection == "right") {
this.pose = "pose9";
} else if (this.xDirection == "straight") {
this.pose = "pose8";
} else if (this.xDirection == "left") {
this.pose = "pose7";
}
} else if (this.yDirection == "straight") {
if (this.xDirection == "right") {
this.pose = "pose6";
} else if (this.xDirection == "straight") {
} else if (this.xDirection == "left") {
this.pose = "pose4";
}
} else if (this.yDirection == "down") {
if (this.xDirection == "right") {
this.pose = "pose3";
} else if (this.xDirection == "straight") {
this.pose = "pose2";
} else if (this.xDirection == "left") {
this.pose = "pose1";
}
}
if (this.atIdleDepth) {
this.atIdleDepth = false;
}
this.swapDepths((positionY * 350) + this.uniqueDepth);
if (!(this.oldPose === this.pose)) {
this.gotoAndStop(this.pose);
this.poseClip.play();
this.oldPose = this.pose;
}
this._x = this.xPos;
this._y = this.yPos;
};
newCharacter.onPause = function () {
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
};
newCharacter.onPress = function () {
if (!timeControl.gamePaused) {
mouseX = Math.round(_root._xmouse - screenControl.currentX);
mouseY = Math.round(_root._ymouse - screenControl.currentY);
characterX = _root.gameScreen.mainCharacter._x;
characterY = _root.gameScreen.mainCharacter._y;
screenControl.clickCharacter(mouseX, mouseY, characterX, characterY, this.type, this.sex, this.firstname, this.lastname, this.head, this);
}
};
newCharacter.useHandCursor = false;
};
GameObject.prototype.createMainCharacter = function (xPos, yPos, direction) {
this.characterCount++;
this.characterLivingCount++;
var uniqueDepth = this.getUniqueDepth("character");
newAvatar = this.avatars[Math.floor(Math.random() * this.avatars.length)];
newCharacter = _root.gameScreen.attachMovie("character35", "character" + this.characterCount, uniqueDepth);
newCharacter.id = this.characterCount;
newCharacter._x = xPos;
newCharacter._y = yPos;
this.uniqueDepth = uniqueDepth;
newCharacter.inHoldingArea = false;
newCharacter.speedX = 4;
newCharacter.speedY = 4;
newCharacter.xPos = newCharacter._x;
newCharacter.yPos = newCharacter._y;
gameControl.addListener(newCharacter);
newCharacter.mileStone = 0;
newCharacter.onWalk = function () {
if (this.waiting) {
return(undefined);
}
if ((this.wayPoints.length < 1) && (!this.waiting)) {
this.mileStone = 1;
this.wayPoint = 1;
if (!(this.mileStones[1] === undefined)) {
pathObj = new Object();
pathObj.start = screenControl.getCoordinates(this.mileStones[this.mileStone - 1].x, this.mileStones[this.mileStone - 1].y);
pathObj.end = screenControl.getCoordinates(this.mileStones[this.mileStone].x, this.mileStones[this.mileStone].y);
pathObj.xcor = this.mileStones[this.mileStone].x;
pathObj.ycor = this.mileStones[this.mileStone].y;
pathObj.mc = this;
pathObj.depth = 50;
gameControl.waitForPath.unshift(pathObj);
this.waiting = true;
}
this.poseClip.gotoAndStop(1);
this.oldPose = "idle";
return(undefined);
}
var diffY = (this.yPos - this.wayPoints[this.wayPoint].y);
var diffX = (this.xPos - this.wayPoints[this.wayPoint].x);
if (diffY >= this.speedY) {
this.yPos = this.yPos - this.speedY;
this.yDirection = "up";
} else if (diffY <= (-this.speedY)) {
this.yPos = this.yPos + this.speedY;
this.yDirection = "down";
} else {
this.yDirection = "straight";
}
if (diffX <= (-this.speedX)) {
this.xPos = this.xPos + this.speedX;
this.xDirection = "right";
} else if (diffX >= this.speedX) {
this.xPos = this.xPos - this.speedX;
this.xDirection = "left";
} else {
this.xDirection = "straight";
}
var diffY = (this.yPos - this.wayPoints[this.wayPoint].y);
var diffX = (this.xPos - this.wayPoints[this.wayPoint].x);
if ((((diffY < this.speedY) && (diffY > (-this.speedY))) && (diffX > (-this.speedX))) && (diffX < this.speedX)) {
if (this.wayPoint < (this.wayPoints.length - 1)) {
this.wayPoint++;
} else {
trace((("this.mileStone=" + this.mileStone) + " , this.mileStones.length=") + this.mileStones.length);
if (this.mileStone < (this.mileStones.length - 1)) {
trace("at first milestone.. but not at the second one yet");
delete this.wayPoints;
this.mileStones.shift();
this._x = this.xPos;
this._y = this.yPos;
if (!(this.oldPose === this.pose)) {
this.gotoAndStop(this.pose);
this.poseClip.gotoAndStop(1);
this.oldPose = "idle";
}
return(undefined);
}
delete this.wayPoints;
delete this.mileStones;
if (!(this.myendpose === undefined)) {
this.pose = this.myendpose;
this.gotoAndStop(this.pose);
}
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
if (!(this.myendfunction === undefined)) {
this.myendfunction(this);
}
this.myendfunction = undefined;
this.myendpose = undefined;
return(undefined);
}
}
var positionX = (this.xPos + screenControl.currentX);
var positionY = (this.yPos + screenControl.currentY);
this.imLive = false;
this.imLive = true;
if (this.handsfull == "band") {
this.extrapossNumber = 9;
} else if (this.handsfull == "voorvleugel") {
this.extrapossNumber = 21;
} else if (this.handsfull == "achtervleugel") {
this.extrapossNumber = 30;
} else if (this.handsfull == "voorvleugeloud") {
this.extrapossNumber = 21;
} else if (this.handsfull == "voorvleugeloud2") {
this.extrapossNumber = 56;
} else if (this.handsfull == "achtervleugeloud") {
this.extrapossNumber = 30;
} else if (this.handsfull == "achtervleugeloud2") {
this.extrapossNumber = 47;
} else {
this.extrapossNumber = 0;
}
if (this.yDirection == "up") {
if (this.xDirection == "right") {
this.pose = "pose" + (9 + this.extrapossNumber);
} else if (this.xDirection == "straight") {
this.pose = "pose" + (8 + this.extrapossNumber);
} else if (this.xDirection == "left") {
this.pose = "pose" + (7 + this.extrapossNumber);
}
} else if (this.yDirection == "straight") {
if (this.xDirection == "right") {
this.pose = "pose" + (6 + this.extrapossNumber);
} else if (this.xDirection == "straight") {
} else if (this.xDirection == "left") {
this.pose = "pose" + (4 + this.extrapossNumber);
}
} else if (this.yDirection == "down") {
if (this.xDirection == "right") {
this.pose = "pose" + (3 + this.extrapossNumber);
} else if (this.xDirection == "straight") {
this.pose = "pose" + (2 + this.extrapossNumber);
} else if (this.xDirection == "left") {
this.pose = "pose" + (1 + this.extrapossNumber);
}
}
if (this.atIdleDepth) {
this.atIdleDepth = false;
}
this.swapDepths((positionY * 350) + this.uniqueDepth);
if (!(this.oldPose === this.pose)) {
this.gotoAndStop(this.pose);
this.poseClip.play();
this.oldPose = this.pose;
}
this._x = this.xPos;
this._y = this.yPos;
};
newCharacter.onPress = function () {
if (!timeControl.gamePaused) {
var myname = this;
screenControl.clickCharacter(myname);
}
};
newCharacter.useHandCursor = true;
newCharacter.onPause = function () {
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
};
};
GameObject.prototype.createPoliceCharacter = function (xPos, yPos, direction) {
this.characterCount++;
var uniqueDepth = this.getUniqueDepth("character");
newAvatar = this.avatars[Math.floor(Math.random() * this.avatars.length)];
newCharacter = _root.gameScreen.attachMovie("character35", "police", uniqueDepth);
newCharacter._x = xPos;
newCharacter._y = yPos;
this.uniqueDepth = uniqueDepth;
newCharacter.inHoldingArea = false;
newCharacter.speedX = 4;
newCharacter.speedY = 4;
newCharacter.xPos = newCharacter._x;
newCharacter.yPos = newCharacter._y;
gameControl.addListener(newCharacter);
DialogControl.addListener(newCharacter);
newCharacter.mileStone = 0;
gameControl.getPoliceMileStone(newCharacter);
newCharacter.onTransaction = function () {
diffX = Math.abs(this.xPos - _root.gameScreen.mainCharacter.xPos);
diffY = Math.abs(this.yPos - _root.gameScreen.mainCharacter.yPos);
directLength = Math.round(Math.sqrt((diffX * diffX) + (diffY * diffY)));
if (directLength >= 250) {
dialogControl.openPolice();
}
};
newCharacter.onWalk = function () {
if (this.waiting) {
return(undefined);
}
if ((this.wayPoints.length < 1) && (!this.waiting)) {
this.mileStone = 1;
this.wayPoint = 1;
if (!(this.mileStones[1] === undefined)) {
pathObj = new Object();
pathObj.start = screenControl.getCoordinates(this.mileStones[this.mileStone - 1].x, this.mileStones[this.mileStone - 1].y);
pathObj.end = screenControl.getCoordinates(this.mileStones[this.mileStone].x, this.mileStones[this.mileStone].y);
pathObj.mc = this;
pathObj.depth = 50;
gameControl.waitForPath.unshift(pathObj);
this.waiting = true;
} else {
delete this.wayPoints;
delete this.mileStones;
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
gameControl.getPoliceMileStone(this);
}
this.poseClip.gotoAndStop(1);
this.oldPose = "idle";
return(undefined);
}
var diffY = (this.yPos - this.wayPoints[this.wayPoint].y);
var diffX = (this.xPos - this.wayPoints[this.wayPoint].x);
if (diffY >= this.speedY) {
this.yPos = this.yPos - this.speedY;
this.yDirection = "up";
} else if (diffY <= (-this.speedY)) {
this.yPos = this.yPos + this.speedY;
this.yDirection = "down";
} else {
this.yDirection = "straight";
}
if (diffX <= (-this.speedX)) {
this.xPos = this.xPos + this.speedX;
this.xDirection = "right";
} else if (diffX >= this.speedX) {
this.xPos = this.xPos - this.speedX;
this.xDirection = "left";
} else {
this.xDirection = "straight";
}
var diffY = (this.yPos - this.wayPoints[this.wayPoint].y);
var diffX = (this.xPos - this.wayPoints[this.wayPoint].x);
if ((((diffY < this.speedY) && (diffY > (-this.speedY))) && (diffX > (-this.speedX))) && (diffX < this.speedX)) {
if (this.wayPoint < (this.wayPoints.length - 1)) {
this.wayPoint++;
} else {
delete this.wayPoints;
delete this.mileStones;
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
gameControl.getPoliceMileStone(this);
}
}
var positionX = (this.xPos + screenControl.currentX);
var positionY = (this.yPos + screenControl.currentY);
this.imLive = false;
if ((((positionY > 82) && (positionY < 418)) && (positionX > 52)) && (positionX < 541)) {
this.imLive = true;
if (this.yDirection == "up") {
if (this.xDirection == "right") {
this.pose = "pose9";
} else if (this.xDirection == "straight") {
this.pose = "pose8";
} else if (this.xDirection == "left") {
this.pose = "pose7";
}
} else if (this.yDirection == "straight") {
if (this.xDirection == "right") {
this.pose = "pose6";
} else if (this.xDirection == "straight") {
} else if (this.xDirection == "left") {
this.pose = "pose4";
}
} else if (this.yDirection == "down") {
if (this.xDirection == "right") {
this.pose = "pose3";
} else if (this.xDirection == "straight") {
this.pose = "pose2";
} else if (this.xDirection == "left") {
this.pose = "pose1";
}
}
if (this.atIdleDepth) {
this.atIdleDepth = false;
}
this.swapDepths((positionY * 350) + this.uniqueDepth);
if (!(this.oldPose === this.pose)) {
this.gotoAndStop(this.pose);
this.poseClip.play();
this.oldPose = this.pose;
}
this._x = this.xPos;
this._y = this.yPos;
} else if (!this.atIdleDepth) {
this.swapDepths(500000 + this.uniqueDepth);
this.atIdleDepth = true;
boundingX = 1850 + (Math.random() * 165);
boundingY = 200 + (Math.random() * 88);
this._x = boundingX;
this._y = boundingY;
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
}
};
newCharacter.onPause = function () {
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
};
};
GameObject.prototype.getPoliceMileStone = function (name) {
newCharacter = name;
direction = "notimportant";
this.nextWaypoint = {x:newCharacter.xPos, y:newCharacter.yPos, direction:direction};
this.saveMileStone(this.nextWaypoint);
exPos = (_root.gameScreen.mainCharacter.xPos + Math.ceil(Math.random() * 800)) - 400;
eyPos = (_root.gameScreen.mainCharacter.yPos + Math.ceil(Math.random() * 800)) - 400;
this.nextWaypoint = {x:exPos, y:eyPos, direction:direction};
if (this.checkWaypoint(this.nextWaypoint)) {
this.saveMileStone(this.nextWaypoint);
} else {
delete newCharacter.mileStones;
delete newCharacter.wayPoints;
}
};
GameObject.prototype.getNewWaypoint = function (x, y, direction) {
radius = Math.floor(Math.random() * 200) + 100;
angle = direction;
if (angle > 360) {
while (ange >= 360) {
angle = angle - 360;
}
} else if (angle < 0) {
while (angle < 0) {
angle = angle + 360;
}
}
if (angle <= 90) {
degree = angle;
} else if ((angle > 90) && (direction <= 180)) {
degree = angle - 90;
} else if ((angle > 180) && (direction <= 270)) {
degree = angle - 180;
} else if ((angle > 270) && (direction)) {
degree = angle - 270;
}
aanliggend = radius * Math.cos((Math.PI/180) * degree);
overstaand = radius * Math.sin((Math.PI/180) * degree);
if (direction <= 90) {
newX = Math.round(x + overstaand);
newY = Math.round(y - aanliggend);
} else if ((direction > 90) && (direction <= 180)) {
newX = Math.round(x + aanliggend);
newY = Math.round(y + overstaand);
} else if ((direction > 180) && (direction <= 270)) {
newX = Math.round(x - overstaand);
newY = Math.round(y + aanliggend);
} else if ((direction > 270) && (direction)) {
newX = Math.round(x - aanliggend);
newY = Math.round(y - overstaand);
}
return({x:newX, y:newY, direction:angle});
};
GameObject.prototype.saveMileStone = function (obj) {
if (newCharacter.mileStones == undefined) {
newCharacter.mileStones = new Array();
}
if ((obj.x == undefined) || (obj.y == undefined)) {
trace("Property undefined for current waypoint...");
} else {
newCharacter.mileStones.push({x:obj.x, y:obj.y, xcor:obj.xcor, ycor:obj.ycor, direction:obj.direction});
}
};
GameObject.prototype.checkWaypoint = function (obj) {
column = Math.floor(obj.x / 20);
row = Math.floor(obj.y / 20);
tile = map[column][row];
if (tile == 1) {
return(true);
}
return(false);
};
GameObject.prototype.getEndZone = function (obj) {
startTimer = getTimer();
currentX = obj.x;
currentY = obj.y;
tmpArray = new Array();
i = 0;
while (i < this.characterZone.length) {
diffX = Math.abs(currentX - this.characterZone[i].x);
diffY = Math.abs(currentY - this.characterZone[i].y);
directLength = Math.round(Math.sqrt((diffX * diffX) + (diffY * diffY)));
tmpArray.push({directlength:directLength, zone:i});
i++;
}
tmpArray.sortOnNum("directlength");
if ((!(tmpArray.length === 0)) && (!tmpArray.undefined)) {
closestcharacterZone = this.characterZone[tmpArray[0].zone];
}
characterZoneTiles = closestcharacterZone.tile.length;
randomTile = Math.ceil(Math.random() * characterZoneTiles);
return({x:closestcharacterZone.tile[randomTile].x, y:closestcharacterZone.tile[randomTile].y});
};
GameObject.prototype.getCreateZone = function () {
_root.characterLivingCount = this.characterLivingCount;
if (this.characterLivingCount >= 10) {
return(undefined);
}
var randomNumber = math.ceil((math.random() * this.createZonePercentage.length) - 1);
var startPosX2 = this.createZone[this.createZonePercentage[randomNumber]].startPosX;
var startPosY2 = this.createZone[this.createZonePercentage[randomNumber]].startPosY;
var dir = this.createZone[this.createZonePercentage[randomNumber]].dir;
var maxlength = (this.createZonePercentage.length - 1);
this.createZonePercentage[randomNumber] = this.createZonePercentage[maxlength];
this.createZonePercentage.pop();
this.createMainCharacter(startPosX2, startPosY2, dir);
};
GameObject.prototype.deleteCreateZone = function (zoneNumber) {
i = this.createZonePercentage.length;
while (i >= 0) {
if (this.createZonePercentage[i] == zoneNumber) {
this.createZonePercentage.splice(i, 1);
}
i--;
}
};
GameObject.prototype.addCreateZone = function (zoneNumber, times) {
i = 0;
while (i <= times) {
this.createZonePercentage.push(zoneNumber);
i++;
}
};
GameObject.prototype.initializeCreateZones = function () {
gameControl.createZone = new Array();
with (gameControl.createZone) {
push({startPosX:228, startPosY:149, dir:225, nameCreateZone:"plek 0"});
push({startPosX:268, startPosY:200, dir:200, nameCreateZone:"plek 1"});
push({startPosX:398, startPosY:159, dir:45, nameCreateZone:"plek 2"});
push({startPosX:508, startPosY:209, dir:200, nameCreateZone:"plek 3"});
push({startPosX:608, startPosY:390, dir:45, nameCreateZone:"plek 4"});
push({startPosX:548, startPosY:410, dir:180, nameCreateZone:"plek 5"});
push({startPosX:128, startPosY:410, dir:200, nameCreateZone:"plek 6"});
push({startPosX:68, startPosY:316, dir:130, nameCreateZone:"plek 7"});
push({startPosX:138, startPosY:286, dir:200, nameCreateZone:"plek 8"});
push({startPosX:148, startPosY:186, dir:200, nameCreateZone:"plek 9"});
}
gameControl.createZonePercentage = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
};
GameObject.prototype.initializeEndZones = function () {
gameControl.characterZone = new Array();
with (gameControl.characterZone) {
var zone = new Object();
zone.x = 1430;
zone.y = 385;
zone.tile = new Array();
zone.tile[0] = {x:1350, y:345};
zone.tile[1] = {x:1370, y:355};
zone.tile[2] = {x:1390, y:365};
zone.tile[3] = {x:1410, y:375};
zone.tile[4] = {x:1430, y:385};
zone.tile[5] = {x:1450, y:395};
zone.tile[6] = {x:1470, y:405};
zone.tile[7] = {x:1490, y:415};
zone.tile[8] = {x:1510, y:425};
push(zone);
var zone = new Object();
zone.x = 1630;
zone.y = 485;
zone.tile = new Array();
zone.tile[0] = {x:1590, y:465};
zone.tile[1] = {x:1610, y:475};
zone.tile[2] = {x:1630, y:485};
zone.tile[3] = {x:1650, y:494};
zone.tile[4] = {x:1670, y:505};
push(zone);
var zone = new Object();
zone.x = 1930;
zone.y = 615;
zone.tile = new Array();
zone.tile[0] = {x:1890, y:605};
zone.tile[1] = {x:1910, y:605};
zone.tile[2] = {x:1930, y:615};
zone.tile[3] = {x:1950, y:625};
push(zone);
}
};
GameObject.prototype.initializeAvatars = function () {
gameControl.avatars = new Array();
with (gameControl.avatars) {
push({clip:"Character1", type:"civilian", sex:"m", head:"manhead1"});
push({clip:"Character2", type:"civilian", sex:"m", head:"manhead2"});
push({clip:"Character3", type:"backpacker", sex:"m", head:"manhead3"});
push({clip:"Character3", type:"backpacker", sex:"m", head:"manhead3"});
push({clip:"Character3", type:"backpacker", sex:"m", head:"manhead3"});
push({clip:"Character4", type:"civilian", sex:"f", head:"womanhead1"});
push({clip:"Character5", type:"hooker", sex:"f", head:"womanhead2"});
push({clip:"Character6", type:"police", sex:"m", head:"manhead1"});
push({clip:"Character7", type:"police", sex:"m", head:"manhead2"});
push({clip:"Character8", type:"bum", sex:"m", head:"manhead2"});
push({clip:"Character9", type:"bum", sex:"m", head:"manhead1"});
push({clip:"Character10", type:"civilian", sex:"m", head:"manhead3"});
push({clip:"Character11", type:"hooker", sex:"m", head:"manhead2"});
push({clip:"Character12", type:"civilian", sex:"m", head:"manhead1"});
push({clip:"Character13", type:"backpack", sex:"f", head:"womanhead2"});
push({clip:"Character13", type:"backpack", sex:"f", head:"womanhead2"});
push({clip:"Character13", type:"backpack", sex:"f", head:"womanhead2"});
push({clip:"Character14", type:"civilian", sex:"m", head:"manhead2"});
push({clip:"Character15", type:"civilian", sex:"f", head:"womanhead2"});
push({clip:"Character16", type:"civilian", sex:"m", head:"manhead1"});
push({clip:"Character17", type:"civilian", sex:"m", head:"manhead2"});
push({clip:"Character18", type:"civilian", sex:"m", head:"manhead1"});
push({clip:"Character19", type:"civilian", sex:"f", head:"womanhead2"});
push({clip:"Character20", type:"hooker", sex:"f", head:"womanhead1"});
push({clip:"Character21", type:"civilian", sex:"m", head:"manhead3"});
push({clip:"Character22", type:"civilian", sex:"m", head:"manhead3"});
push({clip:"Character23", type:"hooker", sex:"f", head:"womanhead2"});
push({clip:"Character24", type:"backpacker", sex:"m", head:"manhead1"});
push({clip:"Character24", type:"backpacker", sex:"m", head:"manhead1"});
push({clip:"Character24", type:"backpacker", sex:"m", head:"manhead1"});
push({clip:"Character25", type:"civilian", sex:"f", head:"womanhead2"});
}
};
GameObject.prototype.initializeGame = function () {
this.waitForPath = new Array();
this.baseDepth = 1000;
this.baseIdleDepth = 100000 /* 0x0186A0 */;
this.initializeAvatars();
this.initializeEndZones();
this.initializeCreateZones();
};
PathObject = function (fStart, fEnd, fDepth, fLevel) {
this.init(fStart, fEnd, fDepth, fLevel);
};
PathObject.prototype.init = function (fStart, fEnd, fDepth, fLevel) {
this.start = fStart;
this.end = fEnd;
this.depth = fDepth;
this.level = 3;
};
PathObject.prototype.runPathFinder = function () {
if (gameControl.waitForPath.length > 0) {
this.$runPathFinder();
}
};
PathObject.prototype.$runPathFinder = function () {
gameControl.waitForPath[0].start;
start = (this.start = gameControl.waitForPath[0].start);
end = (this.end = gameControl.waitForPath[0].end);
xcor = (this.xcor = gameControl.waitForPath[0].xcor);
ycor = (this.ycor = gameControl.waitForPath[0].ycor);
gameControl.waitForPath[0].mc.wayPoints = this.findPath();
gameControl.waitForPath[0].mc.waiting = false;
shifted = gameControl.waitForPath.shift();
};
PathObject.prototype.findPath = function () {
trace("------------------------------------------");
var $paths = [];
$paths[0] = this.$findPath(this.start, this.end, 1, false);
if (this.level > 0) {
$paths[1] = this.$findPath(this.start, this.end, 0, false);
}
if (this.level > 1) {
$paths[2] = this.$findPath(this.end, this.start, 1, true);
}
if (this.level > 2) {
$paths[3] = this.$findPath(this.end, this.start, 0, true);
}
if (this.level > 3) {
$paths[4] = this.$findPath(this.start, this.end, 1, false, true);
}
if (this.level > 4) {
$paths[5] = this.$findPath(this.start, this.end, 0, false, true);
}
if (this.level > 5) {
$paths[6] = this.$findPath(this.end, this.start, 1, true, true);
}
if (this.level > 6) {
$paths[7] = this.$findPath(this.end, this.start, 0, true, true);
}
$paths.sort($pathsort);
if ($paths[0].weight == 1000) {
trace("NOG STEEDS EEN DUIZEND PAD");
}
$paths[0].wayPoints.push({x:this.xcor, y:this.ycor});
return($paths[0].waypoints);
};
PathObject.prototype.$pathSort = function (fVal1, fVal2) {
if (fVal1.weight < fVal2.weight) {
return(-1);
}
if (fVal1.weight > fVal2.weight) {
return(1);
}
return(0);
};
PathObject.prototype.$findPath = function (fStart, fEnd, Dir, fRev, fpref) {
var curx = fStart.x;
var cury = fStart.y;
var pathWeight = 0;
var waypoints = [];
var waypointsSub = [];
var endx = fEnd.x;
var endy = fEnd.y;
var fDir = Dir;
if ((endx == curx) && (endy == cury)) {
trace("WAS AT THE END AT THE FIRST PLACE");
oldx = wayPointsSub[pathWeight - 1].x;
oldy = wayPointsSub[pathWeight - 1].y;
oldx2 = wayPointsSub[pathWeight - 2].x;
oldy2 = wayPointsSub[pathWeight - 2].y;
newx = (curx * screenControl.tileWidth) - (screenControl.tileWidth / 2);
newy = (cury * screenControl.tileHeight) - (screenControl.tileHeight / 2);
wayPointsSub.push({x:curx, y:cury});
wayPoints.push({x:newx, y:newy});
pathWeight++;
if (fRev && (pathWeight < 10000)) {
wayPoints.reverse();
}
return({wayPoints:wayPoints, weight:pathWeight});
}
if ((curx == wayPointsSub[pathWeight - 3].x) && (cury == wayPointsSub[pathWeight - 3].y)) {
pathWeight = 10000;
trace("ronde gelopen");
} else {
oldx = wayPointsSub[pathWeight - 1].x;
oldy = wayPointsSub[pathWeight - 1].y;
oldx2 = wayPointsSub[pathWeight - 2].x;
oldy2 = wayPointsSub[pathWeight - 2].y;
newx = (curx * screenControl.tileWidth) - (screenControl.tileWidth / 2);
newy = (cury * screenControl.tileHeight) - (screenControl.tileHeight / 2);
wayPointsSub.push({x:curx, y:cury});
wayPoints.push({x:newx, y:newy});
pathWeight++;
if ((endx == curx) && (endy == cury)) {
} else if (pathWeight > this.depth) {
pathWeight = 10000;
} else if (fDir) {
if ((((((curx < endx) && (cury > endy)) && ((oldx != (curx + 1)) || (oldy != (cury - 1)))) && ((oldx2 != (curx + 1)) || (oldy != (cury - 1)))) && (map[curx + 1][cury - 1])) && (map[curx + 1][cury] || (map[curx][cury - 1]))) {
curx++;
cury--;
// unexpected jump
}
if ((((((curx < endx) && (cury < endy)) && ((oldx != (curx + 1)) || (oldy != (cury + 1)))) && ((oldx2 != (curx + 1)) || (oldy != (cury + 1)))) && (map[curx + 1][cury + 1])) && (map[curx + 1][cury] || (map[curx][cury + 1]))) {
curx++;
cury++;
// unexpected jump
}
if ((((((curx > endx) && (cury < endy)) && ((oldx != (curx - 1)) || (oldy != (cury + 1)))) && ((oldx2 != (curx - 1)) || (oldy != (cury + 1)))) && (map[curx - 1][cury + 1])) && (map[curx - 1][cury] || (map[curx][cury + 1]))) {
curx--;
cury++;
// unexpected jump
}
if ((((((curx > endx) && (cury > endy)) && ((oldx != (curx - 1)) || (oldy != (cury - 1)))) && ((oldx2 != (curx - 1)) || (oldy != (cury - 1)))) && (map[curx - 1][cury - 1])) && (map[curx - 1][cury] || (map[curx][cury - 1]))) {
curx--;
cury--;
// unexpected jump
}
if (((curx < endx) && (oldx != (curx + 1))) && (map[curx + 1][cury])) {
curx++;
// unexpected jump
}
if (((curx > endx) && (oldx != (curx - 1))) && (map[curx - 1][cury])) {
curx--;
// unexpected jump
}
if (((cury < endy) && (oldy != (cury + 1))) && (map[curx][cury + 1])) {
cury++;
// unexpected jump
}
if (((cury > endy) && (oldy != (cury - 1))) && (map[curx][cury - 1])) {
cury--;
// unexpected jump
}
if (curx == endx) {
if ((oldx != (curx + 1)) && (map[curx + 1][cury])) {
curx++;
// unexpected jump
}
if ((oldx != (curx - 1)) && (map[curx - 1][cury])) {
curx--;
// unexpected jump
}
// unexpected jump
}
if (cury == endy) {
if ((oldy != (cury + 1)) && (map[curx][cury + 1])) {
cury++;
// unexpected jump
}
if ((oldy != (cury - 1)) && (map[curx][cury - 1])) {
cury--;
// unexpected jump
}
}
if (fpref) {
if ((oldx != (curx - 1)) && (map[curx - 1][cury])) {
curx--;
// unexpected jump
}
if (((curx > endx) && (oldx != (curx + 1))) && (map[curx + 1][cury])) {
curx++;
// unexpected jump
}
if ((oldy != (cury - 1)) && (map[curx][cury - 1])) {
cury--;
// unexpected jump
}
if (((cury > endy) && (oldy != (cury + 1))) && (map[curx][cury + 1])) {
cury++;
// unexpected jump
}
// unexpected jump
}
if (((cury > endy) && (oldy != (cury + 1))) && (map[curx][cury + 1])) {
cury++;
// unexpected jump
}
if (((cury < endy) && (oldy != (cury - 1))) && (map[curx][cury - 1])) {
cury--;
// unexpected jump
}
if (((curx > endx) && (oldx != (curx + 1))) && (map[curx + 1][cury])) {
curx++;
// unexpected jump
}
if (((curx < endx) && (oldx != (curx - 1))) && (map[curx - 1][cury])) {
curx--;
// unexpected jump
}
var escaping = 0;
if (!map[curx + 1][cury]) {
escaping = escaping + 1;
}
if (!map[curx - 1][cury]) {
escaping = escaping + 1;
}
if (!map[curx][cury + 1]) {
escaping = escaping + 1;
}
if (!map[curx][cury - 1]) {
escaping = escaping + 1;
}
if (escaping == 3) {
curx = oldx;
cury = oldy;
pathWeight = 10000;
trace("escaped fail, break");
// unexpected jump
}
trace("killing");
pathWeight = 10000;
} else {
if ((((((curx < endx) && (cury > endy)) && ((oldx != (curx + 1)) || (oldy != (cury - 1)))) && ((oldx2 != (curx + 1)) || (oldy != (cury - 1)))) && (map[curx + 1][cury - 1])) && (map[curx + 1][cury] || (map[curx][cury - 1]))) {
curx++;
cury--;
// unexpected jump
}
if ((((((curx < endx) && (cury < endy)) && ((oldx != (curx + 1)) || (oldy != (cury + 1)))) && ((oldx2 != (curx + 1)) || (oldy != (cury + 1)))) && (map[curx + 1][cury + 1])) && (map[curx + 1][cury] || (map[curx][cury + 1]))) {
curx++;
cury++;
// unexpected jump
}
if ((((((curx > endx) && (cury < endy)) && ((oldx != (curx - 1)) || (oldy != (cury + 1)))) && ((oldx2 != (curx - 1)) || (oldy != (cury + 1)))) && (map[curx - 1][cury + 1])) && (map[curx - 1][cury] || (map[curx][cury + 1]))) {
curx--;
cury++;
// unexpected jump
}
if ((((((curx > endx) && (cury > endy)) && ((oldx != (curx - 1)) || (oldy != (cury - 1)))) && ((oldx2 != (curx - 1)) || (oldy != (cury - 1)))) && (map[curx - 1][cury - 1])) && (map[curx - 1][cury] || (map[curx][cury - 1]))) {
curx--;
cury--;
// unexpected jump
}
if (((cury < endy) && (oldy != (cury + 1))) && (map[curx][cury + 1])) {
cury++;
// unexpected jump
}
if (((cury > endy) && (oldy != (cury - 1))) && (map[curx][cury - 1])) {
cury--;
// unexpected jump
}
if (((curx < endx) && (oldx != (curx + 1))) && (map[curx + 1][cury])) {
curx++;
// unexpected jump
}
if (((curx > endx) && (oldx != (curx - 1))) && (map[curx - 1][cury])) {
curx--;
// unexpected jump
}
if (cury == endy) {
if ((oldy != (cury + 1)) && (map[curx][cury + 1])) {
cury++;
// unexpected jump
}
if ((oldy != (cury - 1)) && (map[curx][cury - 1])) {
cury--;
// unexpected jump
}
// unexpected jump
}
if (curx == endx) {
if ((oldx != (curx + 1)) && (map[curx + 1][cury])) {
curx++;
// unexpected jump
}
if ((oldx != (curx - 1)) && (map[curx - 1][cury])) {
curx--;
// unexpected jump
}
}
if (fpref) {
if (((cury < endy) && (oldy != (cury - 1))) && (map[curx][cury - 1])) {
cury--;
// unexpected jump
}
if ((oldy != (cury + 1)) && (map[curx][cury + 1])) {
cury++;
// unexpected jump
}
if (((curx < endx) && (oldx != (curx - 1))) && (map[curx - 1][cury])) {
curx--;
// unexpected jump
}
if ((oldx != (curx + 1)) && (map[curx + 1][cury])) {
curx++;
// unexpected jump
}
// unexpected jump
}
if ((curx < endx) && (map[curx - 1][cury])) {
curx--;
// unexpected jump
}
if ((curx > endx) && (map[curx + 1][cury])) {
curx++;
// unexpected jump
}
if ((cury < endy) && (map[curx][cury - 1])) {
cury--;
// unexpected jump
}
if ((cury > endy) && (map[curx][cury + 1])) {
cury++;
// unexpected jump
}
var escaping = 0;
if (!map[curx + 1][cury]) {
escaping = escaping + 1;
}
if (!map[curx - 1][cury]) {
escaping = escaping + 1;
}
if (!map[curx][cury + 1]) {
escaping = escaping + 1;
}
if (!map[curx][cury - 1]) {
escaping = escaping + 1;
}
if (escaping == 3) {
curx = oldx;
cury = oldy;
pathWeight = 10000;
trace("escaped fail, break");
} else {
pathWeight = 10000;
}
}
}
if (fRev && (pathWeight < 10000)) {
wayPoints.reverse();
}
return({wayPoints:wayPoints, weight:pathWeight});
};
_global.namesArray = new Array();
with (namesArray) {
push({sex:"m", firstName:"Gerard", lastName:"van der Poel"});
push({sex:"m", firstName:"Ger", lastName:"Boer"});
push({sex:"m", firstName:"Andre", lastName:"van Naarden"});
push({sex:"f", firstName:"Rosmerta", lastName:"Goei"});
push({sex:"f", firstName:"Birgit", lastName:"Stelder"});
push({sex:"m", firstName:"Jan", lastName:"Brinkman"});
push({sex:"m", firstName:"Peter", lastName:"Ter Hart"});
push({sex:"f", firstName:"Anne", lastName:"Van de Ven"});
push({sex:"f", firstName:"Hanneke", lastName:"Boeien"});
push({sex:"f", firstName:"Marlies", lastName:"Decker"});
push({sex:"f", firstName:"Petra", lastName:"Barends"});
push({sex:"m", firstName:"Jan", lastName:"Daalder"});
}
CarObject = function () {
};
CarObject.prototype.createCar = function (xPos, yPos, style) {
_global.timeControl.resetTime();
_global.timeControl.timePaused = false;
currentcar = _root.carholder_mc.attachMovie(style, "car_mc", 5);
currentcar._x = xPos;
currentcar._y = yPos;
levelControl.getCarStatus();
currentcar.getspot = function () {
carX = Math.round(this._x - screenControl.currentX);
carY = Math.round(this._y - screenControl.currentY);
myObj = screenControl.getCoordinates(carX, carY);
this.startx = myObj.x - 1;
this.starty = myObj.y - 1;
};
currentcar.turnstartspoton = function () {
this.getspot();
var maxlength = (this.startx + 15);
var maxsublength = (this.starty + 6);
i = this.startx;
while (i <= maxlength) {
j = this.starty;
while (j <= maxsublength) {
map[i][j] = 0;
_root.settile(i, j, 0);
j++;
}
i++;
}
this.oldstartx = this.startx;
this.oldstarty = this.starty;
};
currentcar.turnspoton = function () {
this.getspot();
var diffx = (this.oldstartx - this.startx);
this.startx = this.startx - diffx;
var maxlength = (this.startx + diffx);
var maxsublength = (this.starty + 6);
i = this.startx + 1;
while (i <= maxlength) {
j = this.starty;
while (j <= maxsublength) {
map[i + 1][j] = 0;
_root.settile(i + 1, j, 0);
j++;
}
i++;
}
this.oldstartx = this.startx + diffx;
this.oldstarty = this.starty;
};
currentcar.turnendspotoff = function () {
this.getspot();
if (this.startx == this.oldstartx) {
return(undefined);
}
var maxlength = (this.oldstartx + 15);
var maxsublength = (this.oldstarty + 6);
i = this.oldstartx;
while (i <= maxlength) {
j = this.oldstarty + 1;
while (j <= maxsublength) {
map[i][j] = 1;
_root.settile(i, j, 1);
j++;
}
i++;
}
};
currentcar.turnspotoff = function () {
this.getspot();
if (this.startx == this.oldstartx) {
return(undefined);
}
this.startx = this.startx + 15;
var maxlength = (this.oldstartx + 15);
var maxsublength = (this.starty + 6);
i = this.startx;
while (i <= maxlength) {
j = this.starty;
while (j <= maxsublength) {
if ((i < 0) || (i >= 35)) {
} else {
map[i][j] = 1;
_root.settile(i, j, 1);
}
j++;
}
i++;
}
if (((this.startx - 1) >= 0) && ((this.startx - 1) < 35)) {
map[this.startx - 1][this.starty] = 1;
_root.settile(this.startx - 1, this.starty, 1);
map[this.startx - 1][this.starty + 6] = 1;
_root.settile(this.startx - 1, this.starty + 6, 1);
}
this.turnspoton();
};
currentcar._speedx = 20;
currentcar.onmove = function () {
if (!this.inspot) {
if (((this._x - 20) <= 600) && (_root.lollipop_mc._currentframe == 1)) {
_root.lollipop_mc.gotoAndPlay(2);
}
if ((this._x - 20) <= 220) {
this._x = 220;
_root.wiping_total.gotoAndPlay(2);
_root.alarm1_mc.gotoAndStop(1);
_root.alarm2_mc.gotoAndStop(1);
clearInterval(_root.alarmInterval);
_root.alarmInterval = undefined;
_root.sound_engine_mc.gotoAndPlay("idle");
this.inspot = true;
this._speedx = 0;
return(undefined);
}
var xPos = this._x;
var yPos = this._y;
if (carControl.checkfreeway(xPos, yPos)) {
if (this._speedx == 0) {
_root.sound_engine_mc.gotoAndPlay("arriving");
}
if ((this._speedx < 20) || (this._x == undefined)) {
this._speedx = this._speedx + 1;
}
this._x = this._x - this._speedx;
} else {
this._speedx = 0;
if (!(_root.enginesound === "idle")) {
_root.sound_engine_mc.gotoAndPlay("idle");
}
}
if (this._x < -260) {
this.removeMovieClip();
}
this.turnspotoff();
} else if (this.exit) {
var xPos = this._x;
var yPos = this._y;
if (carControl.checkfreewayexit(xPos, yPos)) {
if (this._speedx == 0) {
_root.sound_engine_mc.gotoAndPlay("leaving");
}
if ((this._speedx < 20) || (this._x == undefined)) {
this._speedx = this._speedx + 1;
}
this._x = this._x - this._speedx;
} else {
this._speedx = 0;
if (!(_root.enginesound === "idle")) {
_root.sound_engine_mc.gotoAndPlay("idle");
}
}
if (this._x < -260) {
timeControl.stopTime();
timeControl.saveTime();
levelControl.chckpitstops();
this.removeMovieClip();
}
this.turnspotoff();
}
};
currentcar.onEnterFrame = function () {
this.onmove();
};
currentcar.turnstartspoton();
};
CarObject.prototype.checkfreeway = function (xPos, yPos) {
i = 1;
while (i <= 10) {
var ctarget = _root.gameScreen["character" + i];
if ((ctarget._y < (_root.line1_mc._y - 7)) || (ctarget._y > (_root.line2_mc._y + 7))) {
} else if ((ctarget._x < (xPos - 40)) || (ctarget._x > (xPos + 30))) {
} else {
return(false);
}
i++;
}
return(true);
};
CarObject.prototype.checkfreewayexit = function (xPos, yPos) {
i = 1;
while (i <= 10) {
var ctarget = _root.gameScreen["character" + i];
if ((ctarget._y < (_root.line1_mc._y - 7)) || (ctarget._y > (_root.line2_mc._y + 7))) {
} else if ((ctarget._x < (xPos - 60)) || (ctarget._x > xPos)) {
} else {
return(false);
}
i++;
}
return(true);
};
CarObject.prototype.start_alarm_Sound = function () {
alarm_Sound.start();
};
actionObject = function () {
this.initActions();
};
actionObject.prototype.initActions = function () {
_global.baseactions = [0, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
_global.actionObj = {};
actionObj.action0 = {};
ctarget = actionObj.action0;
ctarget.discr = "voor banden halen";
ctarget.free = true;
ctarget.x = 140;
ctarget.y = 160;
ctarget.nextaction = [4, 8];
ctarget.endfunction = this.PickupFronttire;
ctarget.mc = _root.actionsTotal.action0_mc;
ctarget.pose = "pose17";
actionObj.action1 = {};
ctarget = actionObj.action1;
ctarget.discr = "voor banden halen 2";
ctarget.free = true;
ctarget.x = 140;
ctarget.y = 160;
ctarget.nextaction = [4, 8];
ctarget.endfunction = this.PickupFronttire;
ctarget.mc = _root.actionsTotal.action1_mc;
ctarget.pose = "pose17";
actionObj.action2 = {};
ctarget = actionObj.action2;
ctarget.discr = "achter banden halen";
ctarget.free = true;
ctarget.x = 170;
ctarget.y = 160;
ctarget.nextaction = [6, 10];
ctarget.endfunction = this.PickupBacktire;
ctarget.mc = _root.actionsTotal.action2_mc;
ctarget.pose = "pose17";
actionObj.action3 = {};
ctarget = actionObj.action3;
ctarget.discr = "achter banden halen 2";
ctarget.free = true;
ctarget.x = 175;
ctarget.y = 155;
ctarget.nextaction = [6, 10];
ctarget.endfunction = this.PickupBacktire;
ctarget.mc = _root.actionsTotal.action3_mc;
ctarget.pose = "pose17";
actionObj.action4 = {};
ctarget = actionObj.action4;
ctarget.discr = "rechter voorband assist";
ctarget.free = true;
ctarget.x = 230;
ctarget.y = 252;
ctarget.endfunction = this.AssistFrontTire1;
ctarget.mc = _root.actionsTotal.action4_mc;
ctarget.pose = "pose3";
actionObj.action5 = {};
ctarget = actionObj.action5;
ctarget.discr = "rechter voorband changer";
ctarget.free = true;
ctarget.x = 280;
ctarget.y = 240;
ctarget.nextaction = [16];
ctarget.endfunction = this.Generalendfunction;
ctarget.mc = _root.actionsTotal.action5_mc;
ctarget.pose = "pose2";
actionObj.action6 = {};
ctarget = actionObj.action6;
ctarget.discr = "rechter achterband assist";
ctarget.free = true;
ctarget.x = 395;
ctarget.y = 252;
ctarget.endfunction = this.AssistBackTire1;
ctarget.mc = _root.actionsTotal.action6_mc;
ctarget.pose = "pose3";
actionObj.action7 = {};
ctarget = actionObj.action7;
ctarget.discr = "rechter achterband changer";
ctarget.free = true;
ctarget.x = 441;
ctarget.y = 242;
ctarget.nextaction = [17];
ctarget.endfunction = this.Generalendfunction;
ctarget.mc = _root.actionsTotal.action7_mc;
ctarget.pose = "pose2";
actionObj.action8 = {};
ctarget = actionObj.action8;
ctarget.discr = "linker voorband assist";
ctarget.free = true;
ctarget.x = 230;
ctarget.y = 402;
ctarget.endfunction = this.AssistFrontTire2;
ctarget.mc = _root.actionsTotal.action8_mc;
ctarget.pose = "pose9";
actionObj.action9 = {};
ctarget = actionObj.action9;
ctarget.discr = "linker voorband changer";
ctarget.free = true;
ctarget.x = 280;
ctarget.y = 415;
ctarget.nextaction = [18];
ctarget.endfunction = this.Generalendfunction;
ctarget.mc = _root.actionsTotal.action9_mc;
ctarget.pose = "pose8";
actionObj.action10 = {};
ctarget = actionObj.action10;
ctarget.discr = "rechter achterband assist";
ctarget.free = true;
ctarget.x = 395;
ctarget.y = 402;
ctarget.endfunction = this.AssistBackTire2;
ctarget.mc = _root.actionsTotal.action10_mc;
ctarget.pose = "pose9";
actionObj.action11 = {};
ctarget = actionObj.action11;
ctarget.discr = "techter achterband changer";
ctarget.free = true;
ctarget.x = 441;
ctarget.y = 412;
ctarget.nextaction = [19];
ctarget.endfunction = this.Generalendfunction;
ctarget.mc = _root.actionsTotal.action11_mc;
ctarget.pose = "pose8";
actionObj.action12 = {};
ctarget = actionObj.action12;
ctarget.discr = "voorvleugel halen";
ctarget.free = true;
ctarget.x = 98;
ctarget.y = 200;
ctarget.nextaction = [20];
ctarget.endfunction = this.PickupFrontwing;
ctarget.mc = _root.actionsTotal.action12_mc;
ctarget.pose = "pose28";
actionObj.action13 = {};
ctarget = actionObj.action13;
ctarget.discr = "achtervleugel halen";
ctarget.free = true;
ctarget.x = 576;
ctarget.y = 206;
ctarget.nextaction = [21];
ctarget.endfunction = this.PickupBackwing;
ctarget.mc = _root.actionsTotal.action13_mc;
ctarget.pose = "pose39";
actionObj.action14 = {};
ctarget = actionObj.action14;
ctarget.discr = "voorvleugel changer";
ctarget.free = true;
ctarget.x = 204;
ctarget.y = 323;
ctarget.nextaction = [22];
ctarget.endfunction = this.Generalendfunction;
ctarget.mc = _root.actionsTotal.action14_mc;
ctarget.pose = "pose6";
actionObj.action15 = {};
ctarget = actionObj.action15;
ctarget.discr = "achtervleugel changer";
ctarget.free = true;
ctarget.x = 510;
ctarget.y = 323;
ctarget.nextaction = [23];
ctarget.endfunction = this.Generalendfunction;
ctarget.mc = _root.actionsTotal.action15_mc;
ctarget.pose = "pose4";
actionObj.action16 = {};
ctarget = actionObj.action16;
ctarget.discr = "voorband1 verwisselen";
ctarget.free = true;
ctarget.x = 280;
ctarget.y = 240;
ctarget.endfunction = this.ChangeFrontTire1;
ctarget.mc = _root.actionsTotal.action16_mc;
ctarget.pose = "pose20";
ctarget.subaction = true;
actionObj.action17 = {};
ctarget = actionObj.action17;
ctarget.discr = "achterband1 verwisselen";
ctarget.free = true;
ctarget.x = 441;
ctarget.y = 242;
ctarget.endfunction = this.ChangeBackTire1;
ctarget.mc = _root.actionsTotal.action17_mc;
ctarget.pose = "pose29";
ctarget.subaction = true;
actionObj.action18 = {};
ctarget = actionObj.action18;
ctarget.discr = "voorband2 verwisselen";
ctarget.free = true;
ctarget.x = 280;
ctarget.y = 415;
ctarget.endfunction = this.ChangeFrontTire2;
ctarget.mc = _root.actionsTotal.action18_mc;
ctarget.pose = "pose26";
ctarget.subaction = true;
actionObj.action19 = {};
ctarget = actionObj.action19;
ctarget.discr = "achterband2 verwisselen";
ctarget.free = true;
ctarget.x = 441;
ctarget.y = 412;
ctarget.endfunction = this.ChangeBackTire2;
ctarget.mc = _root.actionsTotal.action19_mc;
ctarget.pose = "pose26";
ctarget.subaction = true;
actionObj.action20 = {};
ctarget = actionObj.action20;
ctarget.discr = "voorvleugel assist";
ctarget.free = true;
ctarget.x = 163;
ctarget.y = 273;
ctarget.nextaction = [24];
ctarget.endfunction = this.AssistFrontWing;
ctarget.mc = _root.actionsTotal.action20_mc;
ctarget.pose = "pose24";
actionObj.action21 = {};
ctarget = actionObj.action21;
ctarget.discr = "achtervleugel assist";
ctarget.free = true;
ctarget.x = 537;
ctarget.y = 293;
ctarget.nextaction = [25];
ctarget.endfunction = this.AssistBackWing;
ctarget.mc = _root.actionsTotal.action21_mc;
ctarget.pose = "pose34";
actionObj.action22 = {};
ctarget = actionObj.action22;
ctarget.discr = "take off voorvleugel";
ctarget.free = true;
ctarget.x = 204;
ctarget.y = 323;
ctarget.nextaction = [26];
ctarget.endfunction = this.takeofffrontwing;
ctarget.mc = _root.actionsTotal.action22_mc;
ctarget.pose = "pose43";
actionObj.action23 = {};
ctarget = actionObj.action23;
ctarget.discr = "take off achtervleugel";
ctarget.free = true;
ctarget.x = 510;
ctarget.y = 323;
ctarget.nextaction = [27];
ctarget.endfunction = this.takeoffbackwing;
ctarget.mc = _root.actionsTotal.action23_mc;
ctarget.pose = "pose40";
actionObj.action24 = {};
ctarget = actionObj.action24;
ctarget.discr = "put on voorvleugel";
ctarget.free = true;
ctarget.x = 204;
ctarget.y = 323;
ctarget.endfunction = this.putonfrontwing;
ctarget.mc = _root.actionsTotal.action24_mc;
ctarget.pose = "pose44";
actionObj.action25 = {};
ctarget = actionObj.action25;
ctarget.discr = "put on achtervleugel";
ctarget.free = true;
ctarget.x = 510;
ctarget.y = 323;
ctarget.endfunction = this.putonbackwing;
ctarget.mc = _root.actionsTotal.action25_mc;
ctarget.pose = "pose41";
actionObj.action26 = {};
ctarget = actionObj.action26;
ctarget.discr = "drop voorvleugel";
ctarget.free = true;
ctarget.x = 93;
ctarget.y = 430;
ctarget.endfunction = this.dropfrontwing;
ctarget.mc = _root.actionsTotal.action26_mc;
ctarget.pose = "pose45";
actionObj.action27 = {};
ctarget = actionObj.action27;
ctarget.discr = "drop achtervleugel";
ctarget.free = true;
ctarget.x = 582;
ctarget.y = 411;
ctarget.endfunction = this.dropbackwing;
ctarget.mc = _root.actionsTotal.action27_mc;
ctarget.pose = "pose42";
};
actionObject.prototype.selectAction = function (Obj) {
trace("currentaction, myAction=" + obj.myAction);
this.deselectAction();
if (obj.handsfull == "band") {
trace("aparte array, omdat de handjes vol zitten met een bandje");
_root.temparray = actionObj["action" + obj.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if (obj.handsfull == "voorvleugel") {
trace("aparte array, omdat de handjes vol zitten met een achtervleugel");
_root.temparray = actionObj["action" + obj.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if (obj.handsfull == "achtervleugel") {
trace("aparte array, omdat de handjes vol zitten met een achtervleugel");
_root.temparray = actionObj["action" + obj.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if ((obj.handsfull == "achtervleugeloud") || (obj.handsfull == "achtervleugeloud2")) {
trace("aparte array, omdat de handjes vol zitten met een oude achtervleugel");
_root.temparray = actionObj["action" + obj.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if ((obj.handsfull == "voorvleugeloud") || (obj.handsfull == "voorvleugeloud2")) {
trace("aparte array, omdat de handjes vol zitten met een oude voorvleugel");
_root.temparray = actionObj["action" + obj.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if ((!(obj.myAction === undefined)) && (!(actionObj["action" + obj.myAction].nextaction === undefined))) {
trace("aparte array, omdat er een huidige action is");
_root.temparray = actionObj["action" + obj.myAction].nextaction;
var arraytouse = baseactions.concat(temparray);
trace("arraytouse=" + arraytouse);
} else {
trace("gewone basearray");
var arraytouse = baseactions;
}
this.baselength = arraytouse.length - 1;
this.turnedon = [];
i = 0;
while (i <= this.baselength) {
index = arraytouse[i];
var ctarget = actionObj["action" + index];
var chckfunction = actionControl["chck_" + index](obj);
if (ctarget.free && (chckfunction)) {
ctarget.mc.play();
ctarget.mc._visible = true;
this.turnedon.push(index);
}
i++;
}
this.mainCharacter = obj;
};
actionObject.prototype.setAction = function (actionNumber) {
if (_root.alloweddemoactions <= 0) {
if (_root.paused_mc._currentframe < 2) {
_root.paused_mc.gotoAndStop(2);
}
return(undefined);
}
_root.alloweddemoactions = _root.alloweddemoactions - 1;
if (!actionObj["action" + actionNumber].subaction) {
actionObj["action" + this.mainCharacter.myAction].free = true;
actionObj["action" + this.mainCharacter.myGoal].free = true;
} else {
trace("SUBACTION!!");
}
this.mainCharacter.myGoal = actionNumber;
trace(("-----------" + this.mainCharacter.myGoal) + "---------------------------");
this.mainCharacter.myendfunction = actionObj["action" + actionNumber].endfunction;
this.mainCharacter.myendpose = actionObj["action" + actionNumber].pose;
if (!actionObj["action" + actionNumber].subaction) {
actionObj["action" + actionNumber].free = false;
} else {
trace("SUBACTION!!");
}
mouseX = Math.round(actionObj["action" + actionNumber].x);
mouseY = Math.round(actionObj["action" + actionNumber].y);
characterX = 0;
characterY = 0;
screenControl.clickAction(mouseX, mouseY, characterX, characterY);
this.mainCharacter = undefined;
_root.mainCharacter = undefined;
this.deselectAction();
};
actionObject.prototype.deselectAction = function () {
this.turnedonlength = this.turnedon.length - 1;
i = 0;
while (i <= this.turnedonlength) {
index = this.turnedon[i];
var ctarget = actionObj["action" + index];
ctarget.mc._visible = false;
ctarget.mc.stop();
i++;
}
this.turnedon = [];
};
actionObject.prototype.resetcharacter = function () {
trace("resetcharacter");
actionObj["action" + _root.mainCharacter.myAction].free = true;
actionObj["action" + _root.mainCharacter.myGoal].free = true;
actionControl.mainCharacter.myendfunction = undefined;
actionControl.mainCharacter.myendpose = undefined;
if (actionControl.mainCharacter.handsfull == undefined) {
actionControl.mainCharacter.myAction = undefined;
}
actionControl.mainCharacter.myGoal = undefined;
};
actionObject.prototype.Generalendfunction = function (obj) {
trace("Generalendfunction function , myGoal=" + obj.myGoal);
obj.myAction = obj.myGoal;
obj.handsfull = undefined;
};
actionObject.prototype.PickupFronttire = function (obj) {
actionControl.Generalendfunction(obj);
trace("PickupFronttire function");
obj.handsfull = "band";
_root.bandenvoor_mc.prevFrame();
};
actionObject.prototype.PickupBacktire = function (obj) {
actionControl.Generalendfunction(obj);
trace("PickupBacktire function");
obj.handsfull = "band";
_root.bandenachter_mc.prevFrame();
};
actionObject.prototype.AssistFrontTire1 = function (obj) {
if (obj.handsfull == "band") {
_root.bandenvoor1_mc.gotoAndStop(2);
}
actionControl.Generalendfunction(obj);
};
actionObject.prototype.AssistFrontTire2 = function (obj) {
if (obj.handsfull == "band") {
_root.bandenvoor2_mc.gotoAndStop(2);
}
actionControl.Generalendfunction(obj);
};
actionObject.prototype.AssistBackTire1 = function (obj) {
if (obj.handsfull == "band") {
_root.bandenachter1_mc.gotoAndStop(2);
}
actionControl.Generalendfunction(obj);
};
actionObject.prototype.AssistBackTire2 = function (obj) {
if (obj.handsfull == "band") {
_root.bandenachter2_mc.gotoAndStop(2);
}
actionControl.Generalendfunction(obj);
};
actionObject.prototype.ChangeFrontTire1 = function (obj) {
var cframe = _root.carholder_mc.car_mc.voorband1_mc._currentframe;
if (cframe > 2) {
_root.bandenvoorrol1_mc.gotoAndPlay(25);
} else {
_root.bandenvoorrol1_mc.gotoAndPlay(2);
}
_root.carholder_mc.car_mc.voorband1_mc.gotoAndStop(2);
obj.welkeband = "voor1";
obj.gotoAndPlay("pose20");
driverObj.driver0.fr = 100;
_root.R_game_mc.menu_overall_mc.fr_mc.gotoAndStop(1);
};
actionObject.prototype.ChangeFrontTire2 = function (obj) {
var cframe = _root.carholder_mc.car_mc.voorband2_mc._currentframe;
if (cframe > 2) {
_root.bandenvoorrol2_mc.gotoAndPlay(25);
} else {
_root.bandenvoorrol2_mc.gotoAndPlay(2);
}
_root.carholder_mc.car_mc.voorband2_mc.gotoAndStop(2);
obj.welkeband = "voor2";
obj.gotoAndPlay("pose21");
driverObj.driver0.fl = 100;
_root.R_game_mc.menu_overall_mc.fl_mc.gotoAndStop(1);
};
actionObject.prototype.ChangeBackTire1 = function (obj) {
var cframe = _root.carholder_mc.car_mc.achterband1_mc._currentframe;
if (cframe > 2) {
_root.bandenachterrol1_mc.gotoAndPlay(25);
} else {
_root.bandenachterrol1_mc.gotoAndPlay(2);
}
_root.carholder_mc.car_mc.achterband1_mc.gotoAndStop(2);
obj.welkeband = "achter1";
obj.gotoAndPlay("pose20");
driverObj.driver0.br = 100;
_root.R_game_mc.menu_overall_mc.br_mc.gotoAndStop(1);
};
actionObject.prototype.ChangeBackTire2 = function (obj) {
var cframe = _root.carholder_mc.car_mc.achterband2_mc._currentframe;
if (cframe > 2) {
_root.bandenachterrol2_mc.gotoAndPlay(25);
} else {
_root.bandenachterrol2_mc.gotoAndPlay(2);
}
_root.carholder_mc.car_mc.achterband2_mc.gotoAndStop(2);
obj.welkeband = "achter2";
obj.gotoAndPlay("pose21");
driverObj.driver0.bl = 100;
_root.R_game_mc.menu_overall_mc.bl_mc.gotoAndStop(1);
};
actionObject.prototype.PickupFrontwing = function (obj) {
actionControl.Generalendfunction(obj);
trace("PickupFrontwing function");
obj.handsfull = "voorvleugel";
_root.voorvleugel_mc.prevFrame();
};
actionObject.prototype.PickupBackwing = function (obj) {
actionControl.Generalendfunction(obj);
trace("PickupBackwing function");
obj.handsfull = "achtervleugel";
_root.achtervleugel_mc.prevFrame();
};
actionObject.prototype.AssistFrontWing = function (obj) {
obj.myAction = obj.myGoal;
};
actionObject.prototype.AssistBackWing = function (obj) {
obj.myAction = obj.myGoal;
};
actionObject.prototype.takeoffbackwing = function (obj) {
actionControl.Generalendfunction(obj);
trace("Pickup OLD Backwing function");
var cframe = _root.carholder_mc.car_mc.achtervleugel_mc._currentframe;
if (cframe > 2) {
obj.handsfull = "achtervleugeloud2";
obj.gotoAndPlay("pose46");
} else {
obj.handsfull = "achtervleugeloud";
obj.gotoAndPlay("pose40");
}
_root.carholder_mc.car_mc.achtervleugel_mc.gotoAndStop(2);
_root.gameScreen.mainCharacter = obj;
obj.achtervleugel_frame = cframe;
};
actionObject.prototype.takeofffrontwing = function (obj) {
actionControl.Generalendfunction(obj);
trace("Pickup OLD Frontwing function");
var cframe = _root.carholder_mc.car_mc.voorvleugel_mc._currentframe;
if (cframe > 2) {
obj.handsfull = "voorvleugeloud2";
obj.gotoAndPlay("pose66");
} else {
obj.handsfull = "voorvleugeloud";
obj.gotoAndPlay("pose43");
}
_root.carholder_mc.car_mc.voorvleugel_mc.gotoAndStop(2);
_root.gameScreen.mainCharacter = obj;
obj.voorvleugel_frame = cframe;
};
actionObject.prototype.putonbackwing = function (obj) {
actionControl.Generalendfunction(obj);
obj.gotoAndPlay("pose41");
driverObj.driver0.bw = 100;
_root.R_game_mc.menu_overall_mc.bw_mc.gotoAndStop(1);
};
actionObject.prototype.putonfrontwing = function (obj) {
actionControl.Generalendfunction(obj);
obj.gotoAndPlay("pose44");
driverObj.driver0.fw = 100;
_root.R_game_mc.menu_overall_mc.fw_mc.gotoAndStop(1);
};
actionObject.prototype.dropbackwing = function (obj) {
actionControl.Generalendfunction(obj);
if (obj.achtervleugel_frame > 2) {
obj.gotoAndPlay("pose47");
} else {
obj.gotoAndPlay("pose42");
}
};
actionObject.prototype.dropfrontwing = function (obj) {
actionControl.Generalendfunction(obj);
if (obj.voorvleugel_frame > 2) {
obj.gotoAndPlay("pose67");
} else {
obj.gotoAndPlay("pose45");
}
};
actionObject.prototype.startlollipop = function () {
if (!_root.carholder_mc.car_mc.inspot) {
return(undefined);
}
if (!enoughfuell) {
return(undefined);
}
if (!(_root.tankers_mc._currentframe === 1)) {
return(undefined);
}
if (_root.carholder_mc.car_mc.voorband1_mc._currentframe == 2) {
return(undefined);
}
if (_root.carholder_mc.car_mc.voorband2_mc._currentframe == 2) {
return(undefined);
}
if (_root.carholder_mc.car_mc.achterband1_mc._currentframe == 2) {
return(undefined);
}
if (_root.carholder_mc.car_mc.achterband2_mc._currentframe == 2) {
return(undefined);
}
if (_root.carholder_mc.car_mc.voorvleugel_mc._currentframe == 2) {
return(undefined);
}
if (_root.carholder_mc.car_mc.achtervleugel_mc._currentframe == 2) {
return(undefined);
}
if (!(_root.wiping_total._currentframe === 1)) {
return(undefined);
}
_root.carholder_mc.car_mc.exit = true;
_root.sound_engine_mc.gotoAndPlay("leaving");
_root.lollipop_mc.play();
};
actionObject.prototype.chck_0 = function (obj) {
if (_root.bandenvoor_mc._currentframe > 1) {
return(true);
}
return(false);
};
actionObject.prototype.chck_2 = function (obj) {
if (_root.bandenachter_mc._currentframe > 1) {
return(true);
}
return(false);
};
actionObject.prototype.chck_4 = function (obj) {
if ((obj.handsfull == "band") && (!(_root.bandenvoor1_mc._currentframe === 1))) {
return(false);
}
return(true);
};
actionObject.prototype.chck_6 = function (obj) {
if ((obj.handsfull == "band") && (!(_root.bandenachter1_mc._currentframe === 1))) {
return(false);
}
return(true);
};
actionObject.prototype.chck_8 = function (obj) {
if ((obj.handsfull == "band") && (!(_root.bandenvoor2_mc._currentframe === 1))) {
return(false);
}
return(true);
};
actionObject.prototype.chck_10 = function (obj) {
if ((obj.handsfull == "band") && (!(_root.bandenachter2_mc._currentframe === 1))) {
return(false);
}
return(true);
};
actionObject.prototype.chck_5 = function (obj) {
return(true);
};
actionObject.prototype.chck_7 = function (obj) {
return(true);
};
actionObject.prototype.chck_9 = function (obj) {
return(true);
};
actionObject.prototype.chck_11 = function (obj) {
return(true);
};
actionObject.prototype.chck_12 = function (obj) {
if (_root.voorvleugel_mc._currentframe > 1) {
return(true);
}
return(false);
};
actionObject.prototype.chck_13 = function (obj) {
if (_root.achtervleugel_mc._currentframe > 1) {
return(true);
}
return(false);
};
actionObject.prototype.chck_14 = function (obj) {
return(true);
};
actionObject.prototype.chck_15 = function (obj) {
return(true);
};
actionObject.prototype.chck_16 = function (obj) {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(false);
}
if ((_root.bandenvoor1_mc._currentframe == 2) && (!actionObj.action4.free)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_17 = function (obj) {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(false);
}
if ((_root.bandenachter1_mc._currentframe == 2) && (!actionObj.action6.free)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_18 = function (obj) {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(false);
}
if ((_root.bandenvoor2_mc._currentframe == 2) && (!actionObj.action8.free)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_19 = function (obj) {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(false);
}
if ((_root.bandenachter2_mc._currentframe == 2) && (!actionObj.action10.free)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_20 = function (obj) {
return(true);
};
actionObject.prototype.chck_21 = function (obj) {
return(true);
};
actionObject.prototype.chck_22 = function (obj) {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(false);
}
if (!(_root.carholder_mc.car_mc.voorvleugel_mc._currentframe === 2)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_23 = function (obj) {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(false);
}
if (!(_root.carholder_mc.car_mc.achtervleugel_mc._currentframe === 2)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_24 = function (obj) {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(false);
}
if (_root.carholder_mc.car_mc.voorvleugel_mc._currentframe == 2) {
return(true);
}
return(false);
};
actionObject.prototype.chck_25 = function (obj) {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(false);
}
if (_root.carholder_mc.car_mc.achtervleugel_mc._currentframe == 2) {
return(true);
}
return(false);
};
actionObject.prototype.chck_26 = function (obj) {
return(true);
};
actionObject.prototype.chck_27 = function (obj) {
return(true);
};
_root.submitlevel = 0;
LevelObject = function () {
};
LevelObject.prototype.addTime = function (timer) {
trace("WHOOOPS");
this.currentTime = this.currentTime + 0.00564516129032258;
};
LevelObject.prototype.resetTime = function () {
this.currentTime = 0;
};
LevelObject.prototype.stopTime = function () {
this.timePaused = true;
};
LevelObject.prototype.setLevelStatus = function () {
_global.pitstoplevel = undefined;
_global.pitstoplevel = [0];
_global.cLevel = 1;
_global.levelstatus = [];
levelstatus[0] = {change:0, tank:1, spawn:16, stops:1, targettime:7};
levelstatus[1] = {change:0, tank:1, spawn:16, stops:1, targettime:8};
levelstatus[2] = {change:1, tank:1, spawn:15, stops:1, targettime:8};
levelstatus[3] = {change:1, tank:1, spawn:14, stops:1, targettime:8};
levelstatus[4] = {change:2, tank:1, spawn:13, stops:1, targettime:10};
levelstatus[5] = {change:2, tank:1, spawn:12, stops:1, targettime:10};
levelstatus[6] = {change:3, tank:1, spawn:11, stops:1, targettime:10};
levelstatus[7] = {change:3, tank:1, spawn:10, stops:2, targettime:9};
levelstatus[8] = {change:3, tank:1, spawn:9, stops:2, targettime:9};
levelstatus[9] = {change:4, tank:1, spawn:8, stops:2, targettime:9};
levelstatus[10] = {change:4, tank:1, spawn:7, stops:2, targettime:8};
levelstatus[11] = {change:4, tank:1, spawn:6, stops:2, targettime:8};
levelstatus[12] = {change:5, tank:1, spawn:6, stops:2, targettime:8};
levelstatus[13] = {change:5, tank:1, spawn:7, stops:3, targettime:7};
levelstatus[14] = {change:5, tank:1, spawn:7, stops:3, targettime:7};
levelstatus[15] = {change:6, tank:1, spawn:7, stops:3, targettime:7};
levelstatus[16] = {change:6, tank:1, spawn:6, stops:3, targettime:6};
levelstatus[17] = {change:6, tank:1, spawn:6, stops:3, targettime:6};
levelstatus[18] = {change:6, tank:1, spawn:5, stops:3, targettime:6};
_global.tochangearray = ["voorband1_mc", "voorband2_mc", "achterband1_mc", "achterband2_mc", "voorvleugel_mc", "achtervleugel_mc"];
};
LevelObject.prototype.startLevel = function () {
_global.pitstoptimes = undefined;
_global.pitstoptimes = [0];
this.stopmade = 0;
this.getLevelStatus();
this.chckpitstops();
};
LevelObject.prototype.getLevelStatus = function () {
this.tochange = levelstatus[cLevel].change;
this.totank = levelstatus[cLevel].tank;
this.tospawn = levelstatus[cLevel].spawn * 31;
this.tostop = levelstatus[cLevel].stops;
};
LevelObject.prototype.getCarStatus = function () {
this.temptochangearray = tochangearray.concat();
var mydriver = driverObj.driver0;
var mymc = _root.carholder_mc.car_mc;
if (mydriver.fl < 50) {
mymc.voorband2_mc.gotoAndStop(3);
}
if (mydriver.fr < 50) {
mymc.voorband1_mc.gotoAndStop(3);
}
if (mydriver.bl < 50) {
mymc.achterband2_mc.gotoAndStop(3);
}
if (mydriver.br < 50) {
mymc.achterband1_mc.gotoAndStop(3);
}
if (mydriver.fw < 50) {
mymc.voorvleugel_mc.gotoAndStop(3);
}
if (mydriver.bw < 50) {
mymc.achtervleugel_mc.gotoAndStop(3);
}
var fuelframe = Math.round((mydriver.fu * 299) / 100);
_root.indicator_fuel_mc.meter_mc.gotoAndStop(fuelframe);
};
LevelObject.prototype.chckpitstops = function () {
if (this.stopmade >= this.tostop) {
driverObj.driver0.atpitstreet = false;
var cframe = _root.indicator_fuel_mc.meter_mc._currentframe;
var newfuel = ((cframe * 100) / 299);
if (newfuel > 100) {
newfuel = 100;
} else if (newfuel < 0) {
newfuel = 0;
}
driverObj.driver0.fu = newfuel;
driverObj.driver0.speedPerc = 40;
_root.R_game_mc.pittime_mc.gotoAndPlay(2);
_global.framedest = "race";
_root.black_mc.gotoAndPlay("fadein");
} else {
trace("jo");
this.stopmade = this.stopmade + 1;
_root.createEmptyMovieClip("spawn_mc", 6);
var ttime = (Math.round((Math.random() * 100) - 40) + 340);
_root.spawn_mc.gtime = ttime;
_root.spawn_mc.ctime = 0;
_root.spawn_mc.onEnterFrame = function () {
if (!(_root.carholder_mc.car_mc === undefined)) {
return(undefined);
}
this.difft = this.gtime - this.ctime;
if (this.difft == undefined) {
return(undefined);
}
if (this.difft < 20) {
if (!(_root.enginesound === "arriving")) {
_root.sound_engine_mc.gotoAndPlay("arriving");
}
}
if ((this.difft < 120) && (_root.alarmInterval == undefined)) {
_root.alarm1_mc.gotoAndPlay(2);
_root.alarm2_mc.gotoAndPlay(4);
clearInterval(_root.alarmInterval);
CarControl.start_alarm_Sound();
_root.alarmInterval = setInterval(CarControl, "start_alarm_Sound", 800);
_root.video_lamp_mc.gotoAndPlay(2);
}
if (this.ctime >= this.gtime) {
carControl.createCar(_root.invulxcar, _root.invulycar, "f1car");
this.ctime = 0;
delete this.onEnterFrame;
this.removeMovieClip();
}
this.ctime = this.ctime + 1;
};
}
};
LevelObject.prototype.endGame = function () {
};
_root.gameStarted = false;
Instance of Symbol 1547 MovieClip in Frame 678
onClipEvent (load) {
this.useHandCursor = false;
this.onRelease = function () {
mouseX = Math.round(_root._xmouse);
mouseY = Math.round(_root._ymouse);
screenControl.clickScreen(mouseX, mouseY, characterX, characterY);
};
}
Instance of Symbol 1649 MovieClip "truck_mc" in Frame 678
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1695 MovieClip "buyme_mc" in Frame 678
onClipEvent (load) {
this._visible = false;
}
Frame 679
this.startGame = function () {
if (!_root.gameStarted) {
_root.gameStarted = true;
_global.timeControl = new TimeObject();
_global.timeControl.resetTime();
_global.timeControl.timePaused = true;
_global.characterArray = new Array();
_global.staticArray = new Array();
_global.screenControl = new ScreenObject();
screenControl.tileWidth = 20;
screenControl.tileHeight = 20;
ASBroadcaster.initialize(screenControl);
Key.addListener(screenControl.keyListener);
screenControl.normalMode();
_global.gameControl = new GameObject();
gameControl.initializeCreateZones();
ASBroadcaster.initialize(gameControl);
gameControl.initializeGame();
_global.pathControl = new PathObject({x:0, y:0}, end, 100, 3);
dialogControl.initialize();
walkInterval = setInterval(gameControl, "doWalk", 40);
PathfinderInterval = setInterval(pathControl, "runPathFinder", 100);
i = 1;
while (i <= 9) {
gameControl.getCreateZone();
i++;
}
gameControl.createMainCharacter(150, 350, 180);
_global.carControl = new CarObject();
_global.actionControl = new actionObject();
_global.levelControl = new levelObject();
timeControl.setstartTime();
_root.indicator_time_mc.onEnterFrame = function () {
if (!timeControl.gamePaused) {
timeControl.publishTime();
}
};
}
};
this.startGame();
_root.settile = function (gotteni, gottenj, gottenstatus) {
var i = gotteni;
var j = gottenj;
var status = gottenstatus;
precTarget = (i + "y") + j;
cTarget = _root.mapedit["gridx" + precTarget];
cTarget.status = status;
cTarget.gotoAndPlay(2);
};
_root.but_gototruck_mc.onRollOver = function () {
_root.but_gototruck_mc.gotoAndStop(2);
};
_root.but_gototruck_mc.onRollOut = function () {
_root.but_gototruck_mc.gotoAndStop(1);
};
_root.but_gototruck_mc.onPress = function () {
_root.truck_mc.voorband_truck_pile1.gotoAndStop(1);
_root.truck_mc.voorband_truck_pile2.gotoAndStop(1);
_root.truck_mc.achterband_truck_pile1.gotoAndStop(1);
_root.truck_mc.achterband_truck_pile2.gotoAndStop(1);
_root.truck_mc.voorvleugel_truck_mc.gotoAndStop(1);
_root.truck_mc.achtervleugel_truck_mc.gotoAndStop(1);
_root.truck_mc._visible = true;
};
_root.indicator_fuel_mc.meter_mc.onEnterFrame = function () {
var cframe = this._currentframe;
if ((_root.tankers_mc._currentframe == 11) && (cframe < 300)) {
this.gotoAndStop(cframe + 1);
if (this.ctime >= 8) {
tank_Sound.start();
this.ctime = 0;
}
this.ctime = this.ctime + 1;
} else if ((_root.tankers_mc._currentframe == 11) && (cframe >= 300)) {
this.play();
}
if (cframe > 0) {
_global.enoughfuell = true;
this._knipper_mc._visible = false;
} else {
_global.enoughfuell = false;
this._knipper_mc._visible = true;
}
};
_global.laptop_Sound = new Sound();
laptop_Sound.attachSound("laptop_lnk");
_global.alarm_Sound = new Sound();
alarm_Sound.attachSound("alarm_lnk");
_global.drill_Sound = new Sound();
drill_Sound.attachSound("drill_lnk");
_global.tank_Sound = new Sound();
tank_Sound.attachSound("tank_lnk");
_global.tire_Sound = new Sound();
tire_Sound.attachSound("tire_lnk");
_global.whiping_Sound = new Sound();
whiping_Sound.attachSound("whiping_lnk");
_global.wing_Sound = new Sound();
wing_Sound.attachSound("wing_lnk");
_global.tankin_Sound = new Sound();
tankin_Sound.attachSound("tankin_lnk");
_global.tankuit_Sound = new Sound();
tankuit_Sound.attachSound("tankuit_lnk");
clevel = 1;
_global.pitstoplevel = [];
_global.pitstoptimes = [];
levelControl.setLevelStatus();
levelControl.startLevel();
_root.goprevscene = function () {
gotoAndStop (1);
};
_root.R_game_mc._visible = false;
stop();
_root.leveldisplay = _root.clevel;
Symbol 47 MovieClip [FLabelSymbol] Frame 1
#initclip 3
_global.FLabelClass = function () {
if (this.hostComponent == undefined) {
this.hostComponent = ((this._parent.controller == undefined) ? (this._parent) : (this._parent.controller));
}
if (this.customTextStyle == undefined) {
if (this.hostComponent.textStyle == undefined) {
this.hostComponent.textStyle = new TextFormat();
}
this.textStyle = this.hostComponent.textStyle;
this.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var val = this.hostComponent.styleTable.embedFonts.value;
if (val != undefined) {
this.labelField.embedFonts = val;
}
this.labelField.setNewTextFormat(this.textStyle);
this.labelField.text = label;
this.labelField._height = this.labelField.textHeight + 2;
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
this.enable = enable;
var tmpColor = this.hostComponent.styleTable[(enable ? "textColor" : "textDisabled")].value;
if (tmpColor == undefined) {
tmpColor = (enable ? 0 : 8947848);
}
this.setColor(tmpColor);
};
FLabelClass.prototype.getLabel = function () {
return(this.labelField.text);
};
FLabelClass.prototype.setColor = function (col) {
this.labelField.textColor = col;
};
#endinitclip
Symbol 50 MovieClip [FHighlightSymbol] Frame 1
var component = _parent.controller;
component.registerSkinElement(highlight_mc, "selection");
stop();
Symbol 50 MovieClip [FHighlightSymbol] Frame 2
component.registerSkinElement(highlight_mc2, "selectionDisabled");
stop();
Symbol 50 MovieClip [FHighlightSymbol] Frame 3
component.registerSkinElement(highlight_mc3, "selectionUnfocused");
stop();
Symbol 51 MovieClip [FUIComponentSymbol] Frame 1
#initclip 1
function FUIComponentClass() {
this.init();
}
FUIComponentClass.prototype = new MovieClip();
FUIComponentClass.prototype.init = function () {
this.enable = true;
this.focused = false;
this.useHandCursor = false;
this._accImpl = new Object();
this._accImpl.stub = true;
this.styleTable = new Array();
if (_global.globalStyleFormat == undefined) {
_global.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_global._focusControl = new Object();
_global._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_global._focusControl);
}
if (this._name != undefined) {
this._focusrect = false;
this.tabEnabled = true;
this.focusEnabled = true;
this.tabChildren = false;
this.tabFocused = true;
if (this.hostStyle == undefined) {
globalStyleFormat.addListener(this);
} else {
this.styleTable = this.hostStyle;
}
this.deadPreview._visible = false;
this.deadPreview._width = (this.deadPreview._height = 1);
this.methodTable = new Object();
this.keyListener = new Object();
this.keyListener.controller = this;
this.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
this.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var i in this.styleFormat_prm) {
this.setStyleProperty(i, this.styleFormat_prm[i]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
this.enable = ((arguments.length > 0) ? (enabledFlag) : true);
this.tabEnabled = (this.focusEnabled = enabledFlag);
if ((!this.enable) && (this.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
this.width = w;
this.height = h;
this.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
this.handlerObj = ((obj == undefined) ? (this._parent) : (obj));
this.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
this.methodTable[methodName] = true;
this.onEnterFrame = this.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
if (this.methodTable.setSize) {
this.setSize(this.width, this.height);
} else {
this.cleanUINotSize();
}
this.methodTable = new Object();
delete this.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
for (var funct in this.methodTable) {
this[funct]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var inner = this.styleTable.focusRectInner.value;
var outer = this.styleTable.focusRectOuter.value;
if (inner == undefined) {
inner = 16777215 /* 0xFFFFFF */;
}
if (outer == undefined) {
outer = 0;
}
this.createEmptyMovieClip("focusRect", 1000);
this.focusRect.controller = this;
this.focusRect.lineStyle(1, outer);
this.focusRect.moveTo(x, y);
this.focusRect.lineTo(x + w, y);
this.focusRect.lineTo(x + w, y + h);
this.focusRect.lineTo(x, y + h);
this.focusRect.lineTo(x, y);
this.focusRect.lineStyle(1, inner);
this.focusRect.moveTo(x + 1, y + 1);
this.focusRect.lineTo((x + w) - 1, y + 1);
this.focusRect.lineTo((x + w) - 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, (y + h) - 1);
this.focusRect.lineTo(x + 1, y + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
this.tabFocused = false;
this.focusRect.removeMovieClip();
Selection.setFocus(this);
};
FUIComponentClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
this.focused = true;
Key.addListener(this.keyListener);
if (this.tabFocused) {
this.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
this.tabFocused = true;
this.focused = false;
this.focusRect.removeMovieClip();
Key.removeListener(this.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
this.handlerObj[this.changeHandler](this);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
if (value == "") {
return(undefined);
}
var tmpValue = parseInt(value);
if (!isNaN(tmpValue)) {
value = tmpValue;
}
var global = ((arguments.length > 2) ? (isGlobal) : false);
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].useGlobal || (!global)) {
this.styleTable[propName].value = value;
if (this.setCustomStyleProperty(propName, value)) {
} else if (propName == "embedFonts") {
this.invalidate("setSize");
} else if (propName.subString(0, 4) == "text") {
if (this.textStyle == undefined) {
this.textStyle = new TextFormat();
}
var textProp = propName.subString(4, propName.length);
this.textStyle[textProp] = value;
this.invalidate("setSize");
} else {
for (var j in this.styleTable[propName].coloredMCs) {
var myColor = new Color(this.styleTable[propName].coloredMCs[j]);
if (this.styleTable[propName].value == undefined) {
var myTObj = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
myColor.setTransform(myTObj);
} else {
myColor.setRGB(value);
}
}
}
this.styleTable[propName].useGlobal = global;
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
if (this.styleTable[propName] == undefined) {
this.styleTable[propName] = new Object();
this.styleTable[propName].useGlobal = true;
}
if (this.styleTable[propName].coloredMCs == undefined) {
this.styleTable[propName].coloredMCs = new Object();
}
this.styleTable[propName].coloredMCs[skinMCRef] = skinMCRef;
if (this.styleTable[propName].value != undefined) {
var myColor = new Color(skinMCRef);
myColor.setRGB(this.styleTable[propName].value);
}
};
_global.FStyleFormat = function () {
this.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
this.listeners = new Object();
this.isGlobal = false;
if (arguments.length > 0) {
for (var i in arguments[0]) {
this[i] = arguments[0][i];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var arg = 0;
while (arg < arguments.length) {
var mcRef = arguments[arg];
this.listeners[arguments[arg]] = mcRef;
for (var i in this) {
if (this.isAStyle(i)) {
mcRef.updateStyleProperty(this, i.toString());
}
}
arg++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
this.listeners[component] = undefined;
for (var prop in this) {
if (this.isAStyle(prop)) {
if (component.styleTable[prop].useGlobal == this.isGlobal) {
component.styleTable[prop].useGlobal = true;
var value = (this.isGlobal ? undefined : (globalStyleFormat[prop]));
component.setStyleProperty(prop, value, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var count = 0;
for (var i in this.listeners) {
var component = this.listeners[i];
if (arguments.length > 0) {
var j = 0;
while (j < arguments.length) {
if (this.isAStyle(arguments[j])) {
component.updateStyleProperty(this, arguments[j]);
}
j++;
}
} else {
for (var j in this) {
if (this.isAStyle(j)) {
component.updateStyleProperty(this, j.toString());
}
}
}
}
};
FStyleFormat.prototype.isAStyle = function (name) {
return((this.nonStyles[name] ? false : true));
};
#endinitclip
Symbol 64 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 74 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 83 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 84 MovieClip [UpArrow] Frame 1
stop();
Symbol 84 MovieClip [UpArrow] Frame 2
stop();
Symbol 84 MovieClip [UpArrow] Frame 3
stop();
Symbol 91 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 98 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 103 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(highlight3D_mc, "highlight3D");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
Symbol 104 MovieClip [ScrollThumb] Frame 1
stop();
Symbol 112 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 120 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "arrow");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 128 MovieClip Frame 1
var component = _parent._parent;
component.registerSkinElement(arrow_mc, "foregroundDisabled");
component.registerSkinElement(face_mc, "face");
component.registerSkinElement(shadow_mc, "shadow");
component.registerSkinElement(darkshadow_mc, "darkshadow");
component.registerSkinElement(highlight_mc, "highlight");
component.registerSkinElement(highlight3D_mc, "highlight3D");
Symbol 129 MovieClip [DownArrow] Frame 1
stop();
Symbol 129 MovieClip [DownArrow] Frame 2
stop();
Symbol 129 MovieClip [DownArrow] Frame 3
stop();
Symbol 201 MovieClip Frame 1
stop();
Symbol 230 MovieClip [f1_main] Frame 1
stop();
Symbol 231 MovieClip [car2] Frame 1
stop();
Symbol 231 MovieClip [car2] Frame 2
stop();
Symbol 236 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 246 MovieClip Frame 1
stop();
Symbol 251 MovieClip Frame 1
stop();
Symbol 267 MovieClip Frame 1
this.myColor = new Color(this.sub_mc);
this.myColor.setTransform(myCarColor);
Symbol 268 MovieClip Frame 1
this.myColor = new Color(this.sub_mc);
this.myColor.setTransform(myCarColor);
stop();
Symbol 280 MovieClip Frame 1
stop();
Symbol 284 MovieClip [f1car] Frame 1
var ctargetbody = this.color_mc;
this.carColor = new Color(ctargetbody);
this.carColor.setTransform(myCarColor);
Symbol 346 MovieClip Frame 1
this.myColor = new Color(this.sub_mc);
this.myColor.setTransform(myCarColor);
Symbol 380 MovieClip [character35] Frame 1
stop();
Symbol 380 MovieClip [character35] Frame 22
drill_Sound.start();
Symbol 380 MovieClip [character35] Frame 45
_root[("banden" + this.welkeband) + "_mc"].gotoAndPlay(3);
Symbol 380 MovieClip [character35] Frame 64
drill_Sound.start();
Symbol 380 MovieClip [character35] Frame 65
if (this.welkeband == "voor1") {
_root.carholder_mc.car_mc.voorband1_mc.gotoAndStop(1);
} else if (this.welkeband == "voor2") {
_root.carholder_mc.car_mc.voorband2_mc.gotoAndStop(1);
} else if (this.welkeband == "achter1") {
_root.carholder_mc.car_mc.achterband1_mc.gotoAndStop(1);
} else if (this.welkeband == "achter2") {
_root.carholder_mc.car_mc.achterband2_mc.gotoAndStop(1);
}
Symbol 380 MovieClip [character35] Frame 72
stop();
Symbol 380 MovieClip [character35] Frame 76
drill_Sound.start();
Symbol 380 MovieClip [character35] Frame 99
_root[("banden" + this.welkeband) + "_mc"].gotoAndPlay(3);
Symbol 380 MovieClip [character35] Frame 115
drill_Sound.start();
Symbol 380 MovieClip [character35] Frame 119
if (this.welkeband == "voor1") {
_root.carholder_mc.car_mc.voorband1_mc.gotoAndStop(1);
} else if (this.welkeband == "voor2") {
_root.carholder_mc.car_mc.voorband2_mc.gotoAndStop(1);
} else if (this.welkeband == "achter1") {
_root.carholder_mc.car_mc.achterband2_mc.gotoAndStop(1);
} else if (this.welkeband == "achter2") {
_root.carholder_mc.car_mc.achterband2_mc.gotoAndStop(1);
}
Symbol 380 MovieClip [character35] Frame 129
stop();
Symbol 380 MovieClip [character35] Frame 155
if (this.welkeband == "voor1") {
_root.carholder_mc.car_mc.voorband1_mc.gotoAndStop(1);
} else if (this.welkeband == "voor2") {
_root.carholder_mc.car_mc.voorband2_mc.gotoAndStop(1);
} else if (this.welkeband == "achter1") {
_root.carholder_mc.car_mc.achterband2_mc.gotoAndStop(1);
} else if (this.welkeband == "achter2") {
_root.carholder_mc.car_mc.achterband2_mc.gotoAndStop(1);
}
drill_Sound.start();
Symbol 380 MovieClip [character35] Frame 165
if (this.welkeband == "voor1") {
_root.carholder_mc.car_mc.voorband1_mc.gotoAndStop(1);
} else if (this.welkeband == "voor2") {
_root.carholder_mc.car_mc.voorband2_mc.gotoAndStop(1);
} else if (this.welkeband == "achter1") {
_root.carholder_mc.car_mc.achterband2_mc.gotoAndStop(1);
} else if (this.welkeband == "achter2") {
_root.carholder_mc.car_mc.achterband2_mc.gotoAndStop(1);
}
drill_Sound.start();
Symbol 380 MovieClip [character35] Frame 184
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 185
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
screenControl.clickScreenSingle(520, 400, this);
stop();
Symbol 380 MovieClip [character35] Frame 188
drill_Sound.start();
Symbol 380 MovieClip [character35] Frame 191
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 192
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
screenControl.clickScreenSingle(520, 400, this);
stop();
Symbol 380 MovieClip [character35] Frame 201
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 202
_root.carholder_mc.car_mc.achtervleugel_mc.gotoAndStop(1);
Symbol 380 MovieClip [character35] Frame 203
stop();
Symbol 380 MovieClip [character35] Frame 207
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 208
_root.achtervleugel_oud_mc.gotoAndStop(2);
Symbol 380 MovieClip [character35] Frame 209
stop();
Symbol 380 MovieClip [character35] Frame 213
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 214
if (this.achtervleugel_frame > 2) {
_root.achtervleugel_oud_mc.gotoAndStop(3);
} else {
_root.achtervleugel_oud_mc.gotoAndStop(2);
}
Symbol 380 MovieClip [character35] Frame 215
stop();
Symbol 380 MovieClip [character35] Frame 225
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 227
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
screenControl.clickScreenSingle(100, 350, this);
stop();
Symbol 380 MovieClip [character35] Frame 232
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 234
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
screenControl.clickScreenSingle(100, 350, this);
stop();
Symbol 380 MovieClip [character35] Frame 242
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 243
_root.carholder_mc.car_mc.voorvleugel_mc.gotoAndStop(1);
Symbol 380 MovieClip [character35] Frame 244
stop();
Symbol 380 MovieClip [character35] Frame 251
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 252
_root.voorvleugel_oud_mc.gotoAndStop(2);
Symbol 380 MovieClip [character35] Frame 253
stop();
Symbol 380 MovieClip [character35] Frame 257
wing_Sound.start();
Symbol 380 MovieClip [character35] Frame 258
_root.voorvleugel_oud_mc.gotoAndStop(3);
Symbol 380 MovieClip [character35] Frame 259
stop();
Symbol 385 MovieClip Frame 1
stop();
Symbol 388 MovieClip Frame 1
stop();
Symbol 389 MovieClip [grid] Frame 2
this.sub.gotoAndStop(this.status + 2);
stop();
Symbol 394 MovieClip Frame 1
var component = _parent;
component.registerSkinElement(track_mc, "scrollTrack");
Symbol 395 MovieClip [FScrollBarSymbol] Frame 1
#initclip 5
FScrollBarClass = function () {
if (this._height == 4) {
return(undefined);
}
this.init();
this.minPos = (this.maxPos = (this.pageSize = (this.largeScroll = 0)));
this.smallScroll = 1;
this.width = (this.horizontal ? (this._width) : (this._height));
this._xscale = (this._yscale = 100);
this.setScrollPosition(0);
this.tabEnabled = false;
if (this._targetInstanceName.length > 0) {
this.setScrollTarget(this._parent[this._targetInstanceName]);
}
this.tabChildren = false;
this.setSize(this.width);
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (flag) {
if (this.horizontal && (!flag)) {
this._xscale = 100;
this._rotation = 0;
} else if (flag && (!this.horizontal)) {
this._xscale = -100;
this._rotation = -90;
}
this.horizontal = flag;
};
FScrollBarClass.prototype.setScrollProperties = function (pSize, mnPos, mxPos) {
if (!this.enable) {
return(undefined);
}
this.pageSize = pSize;
this.minPos = Math.max(mnPos, 0);
this.maxPos = Math.max(mxPos, 0);
this.scrollPosition = Math.max(this.minPos, this.scrollPosition);
this.scrollPosition = Math.min(this.maxPos, this.scrollPosition);
if ((this.maxPos - this.minPos) <= 0) {
this.scrollThumb_mc.removeMovieClip();
this.upArrow_mc.gotoAndStop(3);
this.downArrow_mc.gotoAndStop(3);
this.downArrow_mc.onPress = (this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = null));
this.upArrow_mc.onPress = (this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = null));
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onRelease = null);
this.scrollTrack_mc.onDragOut = (this.scrollTrack_mc.onRollOut = null);
this.scrollTrack_mc.useHandCursor = false;
} else {
var tmp = this.getScrollPosition();
this.upArrow_mc.gotoAndStop(1);
this.downArrow_mc.gotoAndStop(1);
this.upArrow_mc.onPress = (this.upArrow_mc.onDragOver = this.startUpScroller);
this.upArrow_mc.onRelease = (this.upArrow_mc.onDragOut = this.stopScrolling);
this.downArrow_mc.onPress = (this.downArrow_mc.onDragOver = this.startDownScroller);
this.downArrow_mc.onRelease = (this.downArrow_mc.onDragOut = this.stopScrolling);
this.scrollTrack_mc.onPress = (this.scrollTrack_mc.onDragOver = this.startTrackScroller);
this.scrollTrack_mc.onRelease = this.stopScrolling;
this.scrollTrack_mc.onDragOut = this.stopScrolling;
this.scrollTrack_mc.onRollOut = this.stopScrolling;
this.scrollTrack_mc.useHandCursor = false;
this.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
this.scrollThumb_mc._x = 0;
this.scrollThumb_mc._y = this.upArrow_mc._height;
this.scrollThumb_mc.onPress = this.startDragThumb;
this.scrollThumb_mc.controller = this;
this.scrollThumb_mc.onRelease = (this.scrollThumb_mc.onReleaseOutside = this.stopDragThumb);
this.scrollThumb_mc.useHandCursor = false;
this.thumbHeight = (this.pageSize / ((this.maxPos - this.minPos) + this.pageSize)) * this.trackSize;
this.thumbMid_mc = this.scrollThumb_mc.mc_sliderMid;
this.thumbTop_mc = this.scrollThumb_mc.mc_sliderTop;
this.thumbBot_mc = this.scrollThumb_mc.mc_sliderBot;
this.thumbHeight = Math.max(this.thumbHeight, 6);
this.midHeight = (this.thumbHeight - this.thumbTop_mc._height) - this.thumbBot_mc._height;
this.thumbMid_mc._yScale = (this.midHeight * 100) / this.thumbMid_mc._height;
this.thumbMid_mc._y = this.thumbTop_mc._height;
this.thumbBot_mc._y = this.thumbTop_mc._height + this.midHeight;
this.scrollTop = this.scrollThumb_mc._y;
this.trackHeight = this.trackSize - this.thumbHeight;
this.scrollBot = this.trackHeight + this.scrollTop;
tmp = Math.min(tmp, this.maxPos);
this.setScrollPosition(Math.max(tmp, this.minPos));
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (pos) {
this.scrollPosition = pos;
if (this.scrollThumb_mc != undefined) {
pos = Math.min(pos, this.maxPos);
pos = Math.max(pos, this.minPos);
}
this.scrollThumb_mc._y = (((pos - this.minPos) * this.trackHeight) / (this.maxPos - this.minPos)) + this.scrollTop;
this.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (lScroll) {
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function (sScroll) {
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function (enabledFlag) {
var wasEnabled = this.enable;
if (enabledFlag && (!wasEnabled)) {
this.enable = enabledFlag;
if (this.textField != undefined) {
this.setScrollTarget(this.textField);
} else {
this.setScrollProperties(this.pageSize, this.cachedMinPos, this.cachedMaxPos);
this.setScrollPosition(this.cachedPos);
}
this.clickFilter = undefined;
} else if ((!enabledFlag) && (wasEnabled)) {
this.textField.removeListener(this);
this.cachedPos = this.getScrollPosition();
this.cachedMinPos = this.minPos;
this.cachedMaxPos = this.maxPos;
if (this.clickFilter == undefined) {
this.setScrollProperties(this.pageSize, 0, 0);
} else {
this.clickFilter = true;
}
this.enable = enabledFlag;
}
};
FScrollBarClass.prototype.setSize = function (hgt) {
if (this._height == 1) {
return(undefined);
}
this.width = hgt;
this.scrollTrack_mc._yscale = 100;
this.scrollTrack_mc._yscale = (100 * this.width) / this.scrollTrack_mc._height;
if (this.upArrow_mc == undefined) {
this.attachMovie("UpArrow", "upArrow_mc", 1);
this.attachMovie("DownArrow", "downArrow_mc", 2);
this.downArrow_mc.controller = (this.upArrow_mc.controller = this);
this.upArrow_mc.useHandCursor = (this.downArrow_mc.useHandCursor = false);
this.upArrow_mc._x = (this.upArrow_mc._y = 0);
this.downArrow_mc._x = 0;
}
this.scrollTrack_mc.controller = this;
this.downArrow_mc._y = this.width - this.downArrow_mc._height;
this.trackSize = this.width - (2 * this.downArrow_mc._height);
if (this.textField != undefined) {
this.onTextChanged();
} else {
this.setScrollProperties(this.pageSize, this.minPos, this.maxPos);
}
};
FScrollBarClass.prototype.scrollIt = function (inc, mode) {
var delt = this.smallScroll;
if (inc != "one") {
delt = ((this.largeScroll == 0) ? (this.pageSize) : (this.largeScroll));
}
var newPos = (this.getScrollPosition() + (mode * delt));
if (newPos > this.maxPos) {
newPos = this.maxPos;
} else if (newPos < this.minPos) {
newPos = this.minPos;
}
this.setScrollPosition(newPos);
};
FScrollBarClass.prototype.startDragThumb = function () {
this.lastY = this._ymouse;
this.onMouseMove = this.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
this.scrollMove = this._ymouse - this.lastY;
this.scrollMove = this.scrollMove + this._y;
if (this.scrollMove < this.controller.scrollTop) {
this.scrollMove = this.controller.scrollTop;
} else if (this.scrollMove > this.controller.scrollBot) {
this.scrollMove = this.controller.scrollBot;
}
this._y = this.scrollMove;
var c = this.controller;
c.scrollPosition = Math.round(((c.maxPos - c.minPos) * (this._y - c.scrollTop)) / c.trackHeight) + c.minPos;
this.controller.isScrolling = true;
updateAfterEvent();
this.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
this.controller.trackScroller();
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (inc, mode) {
clearInterval(this.scrolling);
if (inc == "page") {
this.trackScroller();
} else {
this.scrollIt(inc, mode);
}
this.scrolling = setInterval(this, "scrollInterval", 35, inc, mode);
};
FScrollBarClass.prototype.trackScroller = function () {
if ((this.scrollThumb_mc._y + this.thumbHeight) < this._ymouse) {
this.scrollIt("page", 1);
} else if (this.scrollThumb_mc._y > this._ymouse) {
this.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
this.controller.downArrow_mc.gotoAndStop(1);
this.controller.upArrow_mc.gotoAndStop(1);
clearInterval(this.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
this.controller.upArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", -1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
this.controller.downArrow_mc.gotoAndStop(2);
this.controller.scrollIt("one", 1);
this.controller.scrolling = setInterval(this.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (tF) {
if (tF == undefined) {
this.textField.removeListener(this);
delete this.textField[(this.horizontal ? "hScroller" : "vScroller")];
if ((this.textField.hScroller != undefined) && (this.textField.vScroller != undefined)) {
this.textField.unwatch("text");
this.textField.unwatch("htmltext");
}
}
this.textField = undefined;
if (!(tF instanceof TextField)) {
return(undefined);
}
this.textField = tF;
this.textField[(this.horizontal ? "hScroller" : "vScroller")] = this;
this.onTextChanged();
this.onChanged = function () {
this.onTextChanged();
};
this.onScroller = function () {
if (!this.isScrolling) {
if (!this.horizontal) {
this.setScrollPosition(this.textField.scroll);
} else {
this.setScrollPosition(this.textField.hscroll);
}
}
};
this.textField.addListener(this);
this.textField.watch("text", this.callback);
this.textField.watch("htmlText", this.callback);
};
FScrollBarClass.prototype.callback = function (prop, oldVal, newVal) {
clearInterval(this.hScroller.synchScroll);
clearInterval(this.vScroller.synchScroll);
this.hScroller.synchScroll = setInterval(this.hScroller, "onTextChanged", 50);
this.vScroller.synchScroll = setInterval(this.vScroller, "onTextChanged", 50);
return(newVal);
};
FScrollBarClass.prototype.onTextChanged = function () {
if ((!this.enable) || (this.textField == undefined)) {
return(undefined);
}
clearInterval(this.synchScroll);
if (this.horizontal) {
var pos = this.textField.hscroll;
this.setScrollProperties(this.textField._width, 0, this.textField.maxhscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxhscroll));
} else {
var pos = this.textField.scroll;
var pageSize = (this.textField.bottomScroll - this.textField.scroll);
this.setScrollProperties(pageSize, 1, this.textField.maxscroll);
this.setScrollPosition(Math.min(pos, this.textField.maxscroll));
}
};
FScrollBarClass.prototype.executeCallBack = function () {
if (this.textField == undefined) {
super.executeCallBack();
} else if (this.horizontal) {
this.textField.hscroll = this.getScrollPosition();
} else {
this.textField.scroll = this.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 396 MovieClip [DataProviderSymbol] Frame 1
#initclip 2
_global.DataProviderClass = function () {
this.init();
};
DataProviderClass.prototype.init = function () {
this.items = new Array();
this.uniqueID = 0;
this.views = new Array();
};
DataProviderClass.prototype.addView = function (viewRef) {
this.views.push(viewRef);
var eventObj = {event:"updateAll"};
viewRef.modelChanged(eventObj);
};
DataProviderClass.prototype.addItemAt = function (index, value) {
if (index < this.getLength()) {
this.items.splice(index, 0, "tmp");
}
this.items[index] = new Object();
if (typeof(value) == "object") {
this.items[index] = value;
} else {
this.items[index].label = value;
}
this.items[index].__ID__ = this.uniqueID++;
var eventObj = {event:"addRows", firstRow:index, lastRow:index};
this.updateViews(eventObj);
};
DataProviderClass.prototype.addItem = function (value) {
this.addItemAt(this.getLength(), value);
};
DataProviderClass.prototype.removeItemAt = function (index) {
var tmpItm = this.items[index];
this.items.splice(index, 1);
var eventObj = {event:"deleteRows", firstRow:index, lastRow:index};
this.updateViews(eventObj);
return(tmpItm);
};
DataProviderClass.prototype.removeAll = function () {
this.items = new Array();
this.updateViews({event:"deleteRows", firstRow:0, lastRow:this.getLength() - 1});
};
DataProviderClass.prototype.replaceItemAt = function (index, itemObj) {
if ((index < 0) || (index >= this.getLength())) {
return(undefined);
}
var tmpID = this.getItemID(index);
if (typeof(itemObj) == "object") {
this.items[index] = itemObj;
} else {
this.items[index].label = itemObj;
}
this.items[index].__ID__ = tmpID;
this.updateViews({event:"updateRows", firstRow:index, lastRow:index});
};
DataProviderClass.prototype.getLength = function () {
return(this.items.length);
};
DataProviderClass.prototype.getItemAt = function (index) {
return(this.items[index]);
};
DataProviderClass.prototype.getItemID = function (index) {
return(this.items[index].__ID__);
};
DataProviderClass.prototype.sortItemsBy = function (fieldName, order) {
this.items.sortOn(fieldName);
if (order == "DESC") {
this.items.reverse();
}
this.updateViews({event:"sort"});
};
DataProviderClass.prototype.updateViews = function (eventObj) {
var i = 0;
while (i < this.views.length) {
this.views[i].modelChanged(eventObj);
i++;
}
};
#endinitclip
Symbol 397 MovieClip [FSelectableItemSymbol] Frame 1
#initclip 7
function FSelectableItemClass() {
this.init();
}
FSelectableItemClass.prototype = new FUIComponentClass();
FSelectableItemClass.prototype.init = function () {
if (this._name != "itemAsset") {
this.highlighted = false;
this.layoutContent(100);
}
};
FSelectableItemClass.prototype.drawItem = function (itmObj, selected) {
this.displayContent(itmObj, selected);
if ((this.highlighted != selected) || ((this.controller.focused != this.oldFocus) && (selected))) {
this.setHighlighted(selected);
}
this.oldFocus = this.controller.focused;
};
FSelectableItemClass.prototype.setSize = function (width, height) {
var LOWEST_DEPTH = -16384;
this.width = width;
this.layoutContent(width);
this.attachMovie("FHighlightSymbol", "highlight_mc", LOWEST_DEPTH);
this.highlight_mc._x = 0.5;
this.highlight_mc._width = width - 0.5;
this.highlight_mc._height = height;
this.highlight_mc.controller = this;
this.highlight_mc._alpha = 0;
this.highlight_mc.trackAsMenu = true;
this.highlight_mc.onPress = function () {
if (this.controller.enable) {
this.controller.controller.clickHandler(this.controller.itemNum);
}
};
this.highlight_mc.onDragOver = function () {
if (this.controller.controller.focused) {
this.onPress();
}
};
this.highlight_mc.useHandCursor = false;
this.highlight_mc.trackAsMenu = true;
};
FSelectableItemClass.prototype.setEnabled = function (enabledFlag) {
this.enable = enabledFlag;
this.fLabel_mc.setEnabled(enabledFlag);
this.highlight_mc.gotoAndStop((enabledFlag ? "unfocused" : "disabled"));
};
FSelectableItemClass.prototype.layoutContent = function (width) {
this.attachMovie("FLabelSymbol", "fLabel_mc", 2, {hostComponent:this.controller});
this.fLabel_mc._x = 2;
this.fLabel_mc._y = 0;
this.fLabel_mc.setSize(width - 2);
this.fLabel_mc.labelField.selectable = false;
};
FSelectableItemClass.prototype.displayContent = function (itmObj, selected) {
var tmpLabel = "";
if (itmObj.label != undefined) {
tmpLabel = itmObj.label;
} else if (typeof(itmObj) == "object") {
for (var i in itmObj) {
if (i != "__ID__") {
tmpLabel = (itmObj[i] + ", ") + tmpLabel;
}
}
tmpLabel = tmpLabel.substring(0, tmpLabel.length - 2);
} else {
tmpLabel = itmObj;
}
if (this.fLabel_mc.labelField.text != tmpLabel) {
this.fLabel_mc.setLabel(tmpLabel);
}
var clr = (selected ? (this.controller.styleTable.textSelected.value) : (this.controller.styleTable.textColor.value));
if (clr == undefined) {
clr = (selected ? 16777215 : 0);
}
this.fLabel_mc.setColor(clr);
};
FSelectableItemClass.prototype.getItemIndex = function () {
return(this.controller.getScrollPosition() + this.itemNum);
};
FSelectableItemClass.prototype.getItemModel = function () {
return(this.controller.getItemAt(this.getItemIndex()));
};
FSelectableItemClass.prototype.getHostDataProvider = function () {
return(this.controller.dataProvider);
};
FSelectableItemClass.prototype.setHighlighted = function (flag) {
fade = this.controller.styleTable.fadeRate.value;
if (((fade == undefined) || (fade == 0)) || (!flag)) {
this.highlight_mc._alpha = (flag ? 100 : 0);
delete this.onEnterFrame;
} else {
this.fadeN = fade;
this.fadeX = 1;
this.highLight_mc._alpha = 20;
this.onEnterFrame = function () {
this.highLight_mc._alpha = (60 * Math.sqrt((this.fadeX++) / this.fadeN)) + 40;
if (this.fadeX > this.fadeN) {
delete this.onEnterFrame;
}
};
}
this.highlighted = flag;
};
#endinitclip
Symbol 398 MovieClip [FSelectableListSymbol] Frame 1
#initclip 4
function FSelectableListClass() {
this.init();
}
FSelectableListClass.prototype = new FUIComponentClass();
FSelectableListClass.prototype.init = function () {
super.init();
this.enable = true;
this.selected = new Array();
this.topDisplayed = (this.numDisplayed = 0);
this.lastSelected = 0;
this.tabChildren = false;
if (this._name != undefined) {
this.dataProvider = new DataProviderClass();
this.dataProvider.addView(this);
}
};
FSelectableListClass.prototype.addItemAt = function (index, label, data) {
if ((index < 0) || (!this.enable)) {
return(undefined);
}
this.dataProvider.addItemAt(index, {label:label, data:data});
};
FSelectableListClass.prototype.addItem = function (label, data) {
if (!this.enable) {
return(undefined);
}
this.dataProvider.addItem({label:label, data:data});
};
FSelectableListClass.prototype.removeItemAt = function (index) {
this.selectHolder = this.getSelectedIndex();
var item = this.getItemAt(index);
this.dataProvider.removeItemAt(index);
return(item);
};
FSelectableListClass.prototype.removeAll = function () {
this.dataProvider.removeAll();
};
FSelectableListClass.prototype.replaceItemAt = function (index, newLabel, newData) {
this.dataProvider.replaceItemAt(index, {label:newLabel, data:newData});
};
FSelectableListClass.prototype.sortItemsBy = function (fieldName, order) {
this.lastSelID = this.dataProvider.getItemID(this.lastSelected);
this.dataProvider.sortItemsBy(fieldName, order);
};
FSelectableListClass.prototype.getLength = function () {
return(this.dataProvider.getLength());
};
FSelectableListClass.prototype.getSelectedIndex = function () {
for (var uniqueID in this.selected) {
var tmpInd = this.selected[uniqueID].sIndex;
if (tmpInd != undefined) {
return(tmpInd);
}
}
};
FSelectableListClass.prototype.getSelectedItem = function () {
return(this.getItemAt(this.getSelectedIndex()));
};
FSelectableListClass.prototype.getItemAt = function (index) {
return(this.dataProvider.getItemAt(index));
};
FSelectableListClass.prototype.getEnabled = function () {
return(this.enable);
};
FSelectableListClass.prototype.getValue = function () {
var item = this.getSelectedItem();
return(((item.data == undefined) ? (item.label) : (item.data)));
};
FSelectableListClass.prototype.setSelectedIndex = function (index, flag) {
if (((index >= 0) && (index < this.getLength())) && (this.enable)) {
this.clearSelected();
this.selectItem(index, true);
this.lastSelected = index;
this.invalidate("updateControl");
if (flag != false) {
this.executeCallBack();
}
}
};
FSelectableListClass.prototype.setDataProvider = function (obj) {
this.setScrollPosition(0);
this.clearSelected();
if (obj instanceof Array) {
this.dataProvider = new DataProviderClass();
var i = 0;
while (i < obj.length) {
var value = ((typeof(obj[i]) == "string") ? ({label:obj[i]}) : (obj[i]));
this.dataProvider.addItem(value);
i++;
}
} else {
this.dataProvider = obj;
}
this.dataProvider.addView(this);
};
FSelectableListClass.prototype.setItemSymbol = function (linkID) {
this.tmpPos = this.getScrollPosition();
this.itemSymbol = linkID;
this.invalidate("setSize");
this.setScrollPosition(this.tmpPos);
};
FSelectableListClass.prototype.setEnabled = function (enabledFlag) {
this.cleanUI();
super.setEnabled(enabledFlag);
this.enable = enabledFlag;
this.boundingBox_mc.gotoAndStop((this.enable ? "enabled" : "disabled"));
var limit = Math.min(this.numDisplayed, this.getLength());
var i = 0;
while (i < limit) {
this.container_mc[("fListItem" + i) + "_mc"].setEnabled(this.enable);
i++;
}
if (this.enable) {
this.invalidate("updateControl");
}
};
FSelectableListClass.prototype.updateControl = function () {
var i = 0;
while (i < this.numDisplayed) {
this.container_mc[("fListItem" + i) + "_mc"].drawItem(this.getItemAt(this.topDisplayed + i), this.isSelected(this.topDisplayed + i));
i++;
}
};
FSelectableListClass.prototype.setSize = function (w, h) {
super.setSize(w, h);
this.boundingBox_mc._xscale = (this.boundingBox_mc._yscale = 100);
this.boundingBox_mc._xscale = (this.width * 100) / this.boundingBox_mc._width;
this.boundingBox_mc._yscale = (this.height * 100) / this.boundingBox_mc._height;
var i = 0;
while (i < this.numDisplayed) {
this.container_mc.attachMovie(this.itemSymbol, ("fListItem" + i) + "_mc", 10 + i, {controller:this, itemNum:i});
var item_mc = this.container_mc[("fListItem" + i) + "_mc"];
var offset = ((this.scrollOffset == undefined) ? 0 : (this.scrollOffset));
item_mc.setSize(this.width - offset, this.itmHgt);
item_mc._y = (this.itmHgt - 2) * i;
i++;
}
this.updateControl();
};
FSelectableListClass.prototype.modelChanged = function (eventObj) {
var firstRow = eventObj.firstRow;
var lastRow = eventObj.lastRow;
var event = eventObj.event;
if (event == "addRows") {
for (var i in this.selected) {
if ((this.selected[i].sIndex != undefined) && (this.selected[i].sIndex >= firstRow)) {
this.selected[i].sIndex = this.selected[i].sIndex + ((lastRow - firstRow) + 1);
this.setSelectedIndex(this.selected[i].sIndex, false);
}
}
} else if (event == "deleteRows") {
if (firstRow == lastRow) {
var index = firstRow;
if (this.selectHolder == index) {
this.selectionDeleted = true;
}
if (((this.topDisplayed + this.numDisplayed) >= this.getLength()) && (this.topDisplayed > 0)) {
this.topDisplayed--;
if (this.selectionDeleted && ((index - 1) >= 0)) {
this.setSelectedIndex(index - 1, false);
}
} else if (this.selectionDeleted) {
var len = this.getLength();
if (((index == (len - 1)) && (len > 1)) || (index > (len / 2))) {
this.setSelectedIndex(index - 1, false);
} else {
this.setSelectedIndex(index, false);
}
}
for (var i in this.selected) {
if (this.selected[i].sIndex > firstRow) {
this.selected[i].sIndex--;
}
}
} else {
this.clearSelected();
this.topDisplayed = 0;
}
} else if (event == "sort") {
var len = this.getLength();
var i = 0;
while (i < len) {
if (this.isSelected(i)) {
var id = this.dataProvider.getItemID(i);
if (id == this.lastSelID) {
this.lastSelected = i;
}
this.selected[String(id)].sIndex = i;
}
i++;
}
}
this.invalidate("updateControl");
};
FSelectableListClass.prototype.measureItmHgt = function () {
this.attachMovie(this.itemSymbol, "tmpItem_mc", 0, {controller:this});
this.tmpItem_mc.drawItem({label:"Sizer: PjtTopg"}, false);
this.itmHgt = this.tmpItem_mc._height;
this.tmpItem_mc.removeMovieClip();
};
FSelectableListClass.prototype.selectItem = function (index, selectedFlag) {
if (selectedFlag && (!this.isSelected(index))) {
this.selected[String(this.dataProvider.getItemID(index))] = {sIndex:index};
} else if (!selectedFlag) {
delete this.selected[String(this.dataProvider.getItemID(index))];
}
};
FSelectableListClass.prototype.isSelected = function (index) {
return(this.selected[String(this.dataProvider.getItemID(index))].sIndex != undefined);
};
FSelectableListClass.prototype.clearSelected = function () {
for (var uniqueID in this.selected) {
var index = this.selected[uniqueID].sIndex;
if (((index != undefined) && (this.topDisplayed <= index)) && (index < (this.topDisplayed + this.numDisplayed))) {
this.container_mc[("fListItem" + (index - this.topDisplayed)) + "_mc"].drawItem(this.getItemAt(index), false);
}
}
delete this.selected;
this.selected = new Array();
};
FSelectableListClass.prototype.selectionHandler = function (itemNum) {
var tmpInd = (this.topDisplayed + itemNum);
if (this.getItemAt(tmpInd == undefined)) {
this.changeFlag = false;
return(undefined);
}
this.changeFlag = true;
this.clearSelected();
this.selectItem(tmpInd, true);
this.container_mc[("fListItem" + itemNum) + "_mc"].drawItem(this.getItemAt(tmpInd), this.isSelected(tmpInd));
};
FSelectableListClass.prototype.moveSelBy = function (incr) {
var itmNum = this.getSelectedIndex();
var newItm = (itmNum + incr);
newItm = Math.max(0, newItm);
newItm = Math.min(this.getLength() - 1, newItm);
if (newItm == itmNum) {
return(undefined);
}
if ((itmNum < this.topDisplayed) || (itmNum >= (this.topDisplayed + this.numDisplayed))) {
this.setScrollPosition(itmNum);
}
if ((newItm >= (this.topDisplayed + this.numDisplayed)) || (newItm < this.topDisplayed)) {
this.setScrollPosition(this.topDisplayed + incr);
}
this.selectionHandler(newItm - this.topDisplayed);
};
FSelectableListClass.prototype.clickHandler = function (itmNum) {
this.focusRect.removeMovieClip();
if (!this.focused) {
this.pressFocus();
}
this.selectionHandler(itmNum);
this.onMouseUp = this.releaseHandler;
};
FSelectableListClass.prototype.releaseHandler = function () {
if (this.changeFlag) {
this.executeCallBack();
}
this.changeFlag = false;
this.onMouseUp = undefined;
};
FSelectableListClass.prototype.myOnSetFocus = function () {
super.myOnSetFocus();
var i = 0;
while (i < this.numDisplayed) {
this.container_mc[("fListItem" + i) + "_mc"].highlight_mc.gotoAndStop("enabled");
i++;
}
};
FSelectableListClass.prototype.myOnKillFocus = function () {
super.myOnKillFocus();
var i = 0;
while (i < this.numDisplayed) {
this.container_mc[("fListItem" + i) + "_mc"].highlight_mc.gotoAndStop("unfocused");
i++;
}
};
#endinitclip
Instance of Symbol 396 MovieClip [DataProviderSymbol] "dPAsset" in Symbol 398 MovieClip [FSelectableListSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Instance of Symbol 397 MovieClip [FSelectableItemSymbol] "ItemAsset" in Symbol 398 MovieClip [FSelectableListSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Symbol 399 MovieClip [FScrollSelectListSymbol] Frame 1
#initclip 6
function FScrollSelectListClass() {
this.init();
}
FScrollSelectListClass.prototype = new FSelectableListClass();
FScrollSelectListClass.prototype.getScrollPosition = function () {
return(this.topDisplayed);
};
FScrollSelectListClass.prototype.setScrollPosition = function (pos) {
if (this.enable) {
pos = Math.min(pos, this.getLength() - this.numDisplayed);
pos = Math.max(pos, 0);
this.scrollBar_mc.setScrollPosition(pos);
}
};
FScrollSelectListClass.prototype.setAutoHideScrollBar = function (flag) {
this.permaScrollBar = !flag;
this.setSize(this.width, this.height);
};
FScrollSelectListClass.prototype.setEnabled = function (enabledFlag) {
super.setEnabled(enabledFlag);
this.scrollBar_mc.setEnabled(this.enable);
};
FScrollSelectListClass.prototype.setSize = function (w, h) {
var pos = this.getScrollPosition();
super.setSize(w, h);
if (this.scrollBar_mc != undefined) {
this.removed = true;
}
this.scrollBar_mc = undefined;
this.initScrollBar();
this.setScrollPosition(pos);
};
FScrollSelectListClass.prototype.modelChanged = function (eventObj) {
super.modelChanged(eventObj);
this.invalidate("initScrollBar");
};
FScrollSelectListClass.prototype.initScrollBar = function () {
if ((!this.permaScrollBar) && (this.getLength() <= this.numDisplayed)) {
if (this.removed) {
this.scrollBar_mc.removeMovieClip();
this.scrollBar_mc = undefined;
this.scrollOffset = undefined;
this.invalidate("setSize");
}
} else {
if (this.scrollBar_mc == undefined) {
this.container_mc.attachMovie("FScrollBarSymbol", "scrollBar_mc", 3000, {hostStyle:this.styleTable});
this.scrollBar_mc = this.container_mc.scrollBar_mc;
this.scrollBar_mc.setChangeHandler("scrollHandler", this);
this.scrollBar_mc.setSize(this.height);
this.scrollBar_mc._x = this.width - this.scrollBar_mc._width;
this.scrollBar_mc._y = 0;
this.scrollBar_mc.setLargeScroll(this.numDisplayed - 1);
this.scrollOffset = this.scrollBar_mc._width;
this.invalidate("setSize");
}
this.scrollBar_mc.setScrollProperties(this.numDisplayed, 0, this.getLength() - this.numDisplayed);
}
};
FScrollSelectListClass.prototype.scrollHandler = function (scrollBar) {
var pos = scrollBar.getScrollPosition();
this.topDisplayed = pos;
if (this.lastPosition != pos) {
this.updateControl();
}
this.lastPosition = pos;
};
FScrollSelectListClass.prototype.clickHandler = function (itmNum) {
super.clickHandler(itmNum);
if ((this.dragScrolling == undefined) && (this.scrollBar_mc != undefined)) {
this.dragScrolling = setInterval(this, "dragScroll", 15);
}
};
FScrollSelectListClass.prototype.releaseHandler = function () {
clearInterval(this.dragScrolling);
this.dragScrolling = undefined;
super.releaseHandler();
};
FScrollSelectListClass.prototype.dragScroll = function () {
clearInterval(this.dragScrolling);
if (this.container_mc._ymouse < 0) {
this.setScrollPosition(this.getScrollPosition() - 1);
this.selectionHandler(0);
this.scrollInterval = Math.max(25, (-23.8 * (-this.container_mc._ymouse)) + 500);
this.dragScrolling = setInterval(this, "dragScroll", this.scrollInterval);
} else if (this.container_mc._ymouse > ((this.itmHgt - 2) * this.numDisplayed)) {
this.setScrollPosition(this.getScrollPosition() + 1);
this.selectionHandler(this.numDisplayed - 1);
this.scrollInterval = Math.max(25, (-23.8 * Math.abs((this.container_mc._ymouse - ((this.itmHgt - 2) * this.numDisplayed)) - 2)) + 500);
this.dragScrolling = setInterval(this, "dragScroll", this.scrollInterval);
} else {
this.dragScrolling = setInterval(this, "dragScroll", 15);
}
};
FScrollSelectListClass.prototype.myOnKeyDown = function () {
if (this.focused) {
this.keyCodes = new Array(40, 38, 34, 33, 36, 35);
this.keyIncrs = new Array(1, -1, this.numDisplayed - 1, -(this.numDisplayed - 1), -this.getLength(), this.getLength());
var i = 0;
while (i < this.keyCodes.length) {
if (Key.isDown(this.keyCodes[i])) {
this.moveSelBy(this.keyIncrs[i]);
return(undefined);
}
i++;
}
this.findInputText();
}
};
FScrollSelectListClass.prototype.findInputText = function () {
var tmpCode = Key.getAscii();
if ((tmpCode >= 33) && (tmpCode <= 126)) {
this.findString(String.fromCharCode(tmpCode));
}
};
FScrollSelectListClass.prototype.findString = function (str) {
if (this.getLength() == 0) {
return(undefined);
}
var itemNum = this.getSelectedIndex();
var jump = 0;
var i = (itemNum + 1);
while (i != itemNum) {
var itmStr = this.getItemAt(i).label.substring(0, str.length);
if ((str == itmStr) || (str.toUpperCase() == itmStr.toUpperCase())) {
var jump = (i - itemNum);
break;
}
if (i >= (this.getLength() - 1)) {
i = -1;
}
i++;
}
if (jump != 0) {
this.moveSelBy(jump);
}
};
#endinitclip
Instance of Symbol 395 MovieClip [FScrollBarSymbol] "scrollBarAsset" in Symbol 399 MovieClip [FScrollSelectListSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
_targetInstanceName = "";
horizontal = false;
}
onClipEvent (load) {
this._width = (this._height = 1);
}
Instance of Symbol 398 MovieClip [FSelectableListSymbol] "superClassAsset" in Symbol 399 MovieClip [FScrollSelectListSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Symbol 400 MovieClip [FComboBoxItemSymbol] Frame 1
#initclip 9
function FComboBoxItemClass() {
this.init();
}
FComboBoxItemClass.prototype = new FSelectableItemClass();
Object.registerClass("FComboBoxItemSymbol", FComboBoxItemClass);
FComboBoxItemClass.prototype.setSize = function (w, h) {
super.setSize(w, h);
this.highlight_mc.onRollOver = function () {
this.controller.controller.selectionHandler(this.controller.itemNum);
};
};
#endinitclip
Symbol 405 MovieClip [FBoundingBoxSymbol] Frame 1
var component = _parent;
component.registerSkinElement(boundingBox, "background");
stop();
Symbol 405 MovieClip [FBoundingBoxSymbol] Frame 2
component.registerSkinElement(boundingBox2, "backgroundDisabled");
stop();
Symbol 408 MovieClip [FComboBoxSymbol] Frame 1
#initclip 8
function FComboBoxClass() {
_global._popUpLevel = ((_global._popUpLevel == undefined) ? 20000 : (_global._popUpLevel + 1));
this.superHolder = _root.createEmptyMovieClip("superHolder" + _popUpLevel, _popUpLevel);
var testContainer = this.superHolder.createEmptyMovieClip("testCont", 20000);
var testBox = testContainer.attachMovie("FBoundingBoxSymbol", "boundingBox_mc", 0);
if (testBox._name == undefined) {
this.superHolder.removeMovieClip();
this.superHolder = this._parent.createEmptyMovieClip("superHolder" + _popUpLevel, _popUpLevel);
} else {
testContainer.removeMovieClip();
}
if (this.rowCount == undefined) {
this.rowCount = 8;
this.editable = false;
}
this.itemSymbol = "FComboBoxItemSymbol";
this.init();
this.permaScrollBar = false;
this.proxyBox_mc.gotoAndStop(1);
this.width = this._width;
this.height = (this.proxyBox_mc._height * this._yscale) / 100;
var i = 0;
while (i < this.labels.length) {
this.addItem(this.labels[i], this.data[i]);
i++;
}
this.lastSelected = 0;
this.selectItem(0);
this._xscale = (this._yscale = 100);
this.opened = false;
this.setSize(this.width);
this.highlightTop(false);
if (this.changeHandler.length > 0) {
this.setChangeHandler(this.changeHandler);
}
this.onUnload = function () {
this.superHolder.removeMovieClip();
};
this.setSelectedIndex(0, false);
this.value = "";
this.focusEnabled = true;
this.changeFlag = false;
}
FComboBoxClass.prototype = new FScrollSelectListClass();
Object.registerClass("FComboBoxSymbol", FComboBoxClass);
FComboBoxClass.prototype.modelChanged = function (eventObj) {
super.modelChanged(eventObj);
var event = eventObj.event;
if ((event == "addRows") || (event == "deleteRows")) {
var diff = ((eventObj.lastRow - eventObj.firstRow) + 1);
var mode = ((event == "addRows") ? 1 : -1);
var len = this.getLength();
var lenBefore = (len - (mode * diff));
if ((this.rowCount > lenBefore) || (this.rowCount > len)) {
this.invalidate("setSize");
}
if (this.getSelectedIndex() == undefined) {
this.setSelectedIndex(0, false);
}
} else if (event == "updateAll") {
this.invalidate("setSize");
}
};
FComboBoxClass.prototype.removeAll = function () {
if (!this.enable) {
return(undefined);
}
super.removeAll();
if (this.editable) {
this.value = "";
}
this.invalidate("setSize");
};
FComboBoxClass.prototype.setSize = function (w) {
if ((((w == undefined) || (typeof(w) != "number")) || (w <= 0)) || (!this.enable)) {
return(undefined);
}
this.proxyBox_mc._width = w;
this.container_mc.removeMovieClip();
this.measureItmHgt();
this.container_mc = this.superHolder.createEmptyMovieClip("container", 3);
this.container_mc.tabChildren = false;
this.setPopUpLocation(this.container_mc);
this.container_mc.attachMovie("FBoundingBoxSymbol", "boundingBox_mc", 0);
this.boundingBox_mc = this.container_mc.boundingBox_mc;
this.boundingBox_mc.component = this;
this.registerSkinElement(this.boundingBox_mc.boundingBox, "background");
this.proxyBox_mc._height = this.itmHgt;
this.numDisplayed = Math.min(this.rowCount, this.getLength());
if (this.numDisplayed < 3) {
this.numDisplayed = Math.min(3, this.getLength());
}
this.height = (this.numDisplayed * (this.itmHgt - 2)) + 2;
super.setSize(w, this.height);
this.attachMovie("DownArrow", "downArrow", 10);
this.downArrow._y = 0;
this.downArrow._width = this.itmHgt;
this.downArrow._height = this.itmHgt;
this.downArrow._x = this.proxyBox_mc._width - this.downArrow._width;
this.setEditable(this.editable);
this.container_mc._visible = this.opened;
this.highlightTop(false);
this.fader = this.superHolder.attachMovie("FBoundingBoxSymbol", "faderX", 4);
this.registerSkinElement(this.fader.boundingBox, "background");
this.fader._width = this.width;
this.fader._height = this.height;
this.fader._visible = false;
};
FComboBoxClass.prototype.setDataProvider = function (dp) {
super.setDataProvider(dp);
this.invalidate("setSize");
this.setSelectedIndex(0);
};
FComboBoxClass.prototype.getValue = function () {
if (this.editable) {
return(this.fLabel_mc.getLabel());
}
return(super.getValue());
};
FComboBoxClass.prototype.getRowCount = function () {
return(this.rowCount);
};
FComboBoxClass.prototype.setRowCount = function (count) {
this.rowCount = ((this.getLength() > count) ? (Math.max(count, 3)) : (count));
this.setSize(this.width);
var len = this.getLength();
if ((len - this.getScrollPosition()) < this.rowCount) {
this.setScrollPosition(len - Math.min(this.rowCount, len));
this.invalidate("updateControl");
}
};
FComboBoxClass.prototype.setEditable = function (editableFlag) {
if (!this.enable) {
return(undefined);
}
this.editable = editableFlag;
if (!this.editable) {
this.onPress = this.pressHandler;
this.useHandCursor = false;
this.trackAsMenu = true;
this.attachMovie("FComboBoxItemSymbol", "fLabel_mc", 5, {controller:this, itemNum:-1});
this.fLabel_mc.onRollOver = undefined;
this.fLabel_mc.setSize((this.width - this.itmHgt) + 1, this.itmHgt);
this.topLabel = this.getSelectedItem();
this.fLabel_mc.drawItem(this.topLabel, false);
this.highlightTop(false);
} else {
this.attachMovie("FLabelSymbol", "fLabel_mc", 5);
this.fLabel_txt = this.fLabel_mc.labelField;
this.fLabel_txt.type = "input";
this.fLabel_txt._x = 4;
this.fLabel_txt.onSetFocus = this.onLabelFocus;
this.fLabel_mc.setSize((this.width - this.itmHgt) - 3);
delete this.onPress;
this.fLabel_txt.onKillFocus = function () {
this._parent._parent.myOnKillFocus();
};
this.fLabel_mc.setLabel(this.value);
this.fLabel_txt.onChanged = function () {
this._parent._parent.findInputText();
};
this.downArrow.onPress = this.buttonPressHandler;
this.downArrow.useHandCursor = false;
this.downArrow.trackAsMenu = true;
}
};
FComboBoxClass.prototype.setEnabled = function (enabledFlag) {
enabledFlag = (((enabledFlag == undefined) || (typeof(enabledFlag) != "boolean")) ? true : (enabledFlag));
super.setEnabled(enabledFlag);
this.registerSkinElement(this.boundingBox_mc.boundingBox, "background");
this.proxyBox_mc.gotoAndStop((this.enable ? "enabled" : "disabled"));
this.downArrow.gotoAndStop((this.enable ? 1 : 3));
if (this.editable) {
this.fLabel_txt.type = (enabledFlag ? "input" : "dynamic");
this.fLabel_txt.selectable = enabledFlag;
} else if (enabledFlag) {
this.fLabel_mc.drawItem(this.topLabel, false);
this.setSelectedIndex(this.getSelectedIndex(), false);
}
this.fLabel_mc.setEnabled(this.enable);
this.fLabel_txt.onSetFocus = (enabledFlag ? (this.onLabelFocus) : undefined);
};
FComboBoxClass.prototype.setSelectedIndex = function (index, flag) {
super.setSelectedIndex(index, flag);
if (!this.editable) {
this.topLabel = this.getSelectedItem();
this.fLabel_mc.drawItem(this.topLabel, false);
} else {
this.value = ((flag != undefined) ? "" : (this.getSelectedItem().label));
this.fLabel_mc.setLabel(this.value);
}
this.invalidate("updateControl");
};
FComboBoxClass.prototype.setValue = function (value) {
if (this.editable) {
this.fLabel_mc.setLabel(value);
this.value = value;
}
};
FComboBoxClass.prototype.pressHandler = function () {
this.focusRect.removeMovieClip();
if (this.enable) {
if (!this.opened) {
this.onMouseUp = this.releaseHandler;
} else {
this.onMouseUp = undefined;
}
this.changeFlag = false;
if (!this.focused) {
this.pressFocus();
this.clickFilter = (this.editable ? false : true);
}
if (!this.clickFilter) {
this.openOrClose(!this.opened);
} else {
this.clickFilter = false;
}
}
};
FComboBoxClass.prototype.clickHandler = function (itmNum) {
if (!this.focused) {
if (this.editable) {
this.fLabel_txt.onKillFocus = undefined;
}
this.pressFocus();
}
super.clickHandler(itmNum);
this.selectionHandler(itmNum);
this.onMouseUp = this.releaseHandler;
};
FComboBoxClass.prototype.highlightTop = function (flag) {
if (!this.editable) {
this.fLabel_mc.drawItem(this.topLabel, flag);
}
};
FComboBoxClass.prototype.myOnSetFocus = function () {
super.myOnSetFocus();
this.fLabel_mc.highlight_mc.gotoAndStop("enabled");
this.highlightTop(true);
};
FComboBoxClass.prototype.drawFocusRect = function () {
this.drawRect(-2, -2, this.width + 4, this._height + 4);
};
FComboBoxClass.prototype.myOnKillFocus = function () {
if (Selection.getFocus().indexOf("labelField") != -1) {
return(undefined);
}
super.myOnKillFocus();
delete this.fLabel_txt.onKeyDown;
this.openOrClose(false);
this.highlightTop(false);
};
FComboBoxClass.prototype.setPopUpLocation = function (mcRef) {
mcRef._x = this._x;
var point = {x:this._x, y:this._y + this.proxyBox_mc._height};
this._parent.localToGlobal(point);
mcRef._parent.globalToLocal(point);
mcRef._x = point.x;
mcRef._y = point.y;
if ((this.height + mcRef._y) >= Stage.height) {
this.upward = true;
mcRef._y = (point.y - this.height) - this.proxyBox_mc._height;
} else {
this.upward = false;
}
};
FComboBoxClass.prototype.openOrClose = function (flag) {
if (this.getLength() == 0) {
return(undefined);
}
this.setPopUpLocation(this.container_mc);
if ((this.lastSelected != -1) && ((this.lastSelected < this.topDisplayed) || (this.lastSelected > (this.topDisplayed + this.numDisplayed)))) {
super.moveSelBy(this.lastSelected - this.getSelectedIndex());
}
if (!flag) {
(this.downArrow.gotoAndStop(1));// not popped
} else {
(this.downArrow.gotoAndStop(2));// not popped
}
if (flag == this.opened) {
return(undefined);
}
this.highlightTop(!flag);
this.fadeRate = this.styleTable.popUpFade.value;
if (((!flag) || (this.fadeRate == undefined)) || (this.fadeRate == 0)) {
this.opened = (this.container_mc._visible = flag);
return(undefined);
}
this.setPopUpLocation(this.fader);
this.time = 0;
this.const = 85 / Math.sqrt(this.fadeRate);
this.fader._alpha = 85;
this.container_mc._visible = (this.fader._visible = true);
this.onEnterFrame = function () {
this.fader._alpha = 100 - ((this.const * Math.sqrt(++this.time)) + 15);
if (this.time >= this.fadeRate) {
this.fader._visible = false;
delete this.onEnterFrame;
this.opened = true;
}
};
};
FComboBoxClass.prototype.fireChange = function () {
this.lastSelected = this.getSelectedIndex();
if (!this.editable) {
this.topLabel = this.getSelectedItem();
this.fLabel_mc.drawItem(this.topLabel, true);
} else {
this.value = this.getSelectedItem().label;
this.fLabel_mc.setLabel(this.value);
}
this.executeCallback();
};
FComboBoxClass.prototype.releaseHandler = function () {
var onCombo = this.boundingBox_mc.hitTest(_root._xmouse, _root._ymouse);
if (this.changeFlag) {
if (onCombo) {
this.fireChange();
}
this.openOrClose(!this.opened);
} else if (onCombo) {
this.openOrClose(false);
} else {
this.onMouseDown = function () {
if ((!this.boundingBox_mc.hitTest(_root._xmouse, _root._ymouse)) && (!this.hitTest(_root._xmouse, _root._ymouse))) {
this.onMouseDown = undefined;
this.openOrClose(false);
}
};
}
this.changeFlag = false;
this.onMouseUp = undefined;
clearInterval(this.dragScrolling);
this.dragScrolling = undefined;
};
FComboBoxClass.prototype.moveSelBy = function (itemNum) {
if (itemNum != 0) {
super.moveSelBy(itemNum);
if (this.editable) {
this.setValue(this.getSelectedItem().label);
}
if (!this.opened) {
if (this.changeFlag && (!this.isSelected(this.lastSelected))) {
this.fireChange();
}
}
}
};
FComboBoxClass.prototype.myOnKeyDown = function () {
if (!this.focused) {
return(undefined);
}
if (this.editable && (Key.isDown(13))) {
this.setValue(this.fLabel_mc.getLabel());
this.executeCallback();
this.openOrClose(false);
} else if ((Key.isDown(13) || (Key.isDown(32) && (!this.editable))) && (this.opened)) {
if (this.getSelectedIndex() != this.lastSelected) {
this.fireChange();
}
this.openOrClose(false);
this.fLabel_txt.hscroll = 0;
}
super.myOnKeyDown();
};
FComboBoxClass.prototype.findInputText = function () {
if (!this.editable) {
super.findInputText();
}
};
FComboBoxClass.prototype.onLabelFocus = function () {
this._parent._parent.tabFocused = false;
this._parent._parent.focused = true;
this.onKeyDown = function () {
this._parent._parent.myOnKeyDown();
};
Key.addListener(this);
};
FComboBoxClass.prototype.buttonPressHandler = function () {
this._parent.pressHandler();
};
#endinitclip
this.deadPreview._visible = false;
Instance of Symbol 399 MovieClip [FScrollSelectListSymbol] "superClassAsset" in Symbol 408 MovieClip [FComboBoxSymbol] Frame 1
//component parameters
onClipEvent (initialize) {
}
Symbol 418 Button
on (press, keyPress "<Enter>") {
_root.gotoAndPlay("menu");
}
Symbol 419 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 4
stop();
Symbol 505 Button
on (press) {
_root.buyme_mc._visible = true;
}
Symbol 542 Button
on (press, keyPress "<Enter>") {
_root.colorshower.onEnterFrame = undefined;
_root.colorshower.removeMovieClip();
i = 0;
while (i <= 33) {
ctarget = _root["showcolor" + i];
ctarget.removeMovieClip();
i++;
}
_root.gotoAndPlay("settings");
}
Symbol 544 Button
on (press) {
_root.buyme_mc._visible = false;
}
Symbol 546 MovieClip Frame 10
stop();
Symbol 549 MovieClip Frame 1
this.buy_but.onPress = function () {
_global.setcounter(1);
getURL (_global.buyurl, "_blank");
};
this.buy_but.useHandCursor = false;
_global.CPchangecolorcarDEMO = function (driver, selected) {
var ctargetbody = driver.tocolor_mc;
driver.myColor = new Color(ctargetbody);
driver.myColorTransform = new Object();
var myCT = driver.myColorTransform;
myCT.ra = CParray[selected][0];
myCT.rb = CParray[selected][1];
myCT.ga = CParray[selected][2];
myCT.gb = CParray[selected][3];
myCT.ba = CParray[selected][4];
myCT.bb = CParray[selected][5];
myCT.aa = CParray[selected][6];
myCT.ab = CParray[selected][7];
driver.myColor.setTransform(myCT);
var myoldcolor = _root["showcolor" + CPmycolor];
changeTextColor(myoldcolor, 13421772);
var mynewcolor = _root["showcolor" + CPmycolor];
changeTextColor(mynewcolor, 16777011);
};
this.democolorarray = [13, 16, 18, 19, 23, 32];
i = 0;
while (i <= 5) {
var mydriver = this["Colorpicker_car_mc" + i];
_global.CPchangecolorcarDEMO(mydriver, this.democolorarray[i]);
i++;
}
Symbol 557 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(1);
}
on (press, keyPress "<Enter>") {
_root.gotoAndPlay("settings");
}
Symbol 561 MovieClip Frame 1
stop();
Symbol 565 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(2);
}
on (press) {
_root.savemenu_mc.gotoAndStop(2);
}
Symbol 569 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(3);
}
on (press) {
getURL ("http://www.entertainmail.net/splash_and_dash/highscore/highscore_viewer.php?com=0", "_blank");
}
Symbol 573 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(4);
}
on (press) {
_root.gotoAndStop("help");
}
Symbol 577 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(5);
}
on (press) {
_root.gotoAndStop("credits");
}
Symbol 586 Button
on (press) {
_root.savetoSO_mygame();
this.gotoAndStop(3);
}
Symbol 589 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 592 Button
on (press) {
this.gotoAndStop(4);
}
Symbol 597 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 600 Button
on (press) {
_global.mymoney = 0;
_root.tuning1 = 0;
_root.tuning2 = 0;
_root.tuning3 = 0;
_root.tuning4 = 0;
_root.savetoSO_mygame();
this.gotoAndStop(5);
}
Symbol 602 MovieClip Frame 1
stop();
Symbol 602 MovieClip Frame 2
underlay_but.onPress = function () {
};
underlay_but.useHandCursor = false;
Symbol 609 Button
on (press) {
_root.gotoAndStop("shop");
}
Symbol 612 Button
on (press) {
_root.gotoAndStop("tuning");
}
Symbol 615 Button
on (press) {
if (_root.difficulty == "NORMAL") {
_global.difflevel = 3;
_root.difficulty = "HARD";
} else if (_root.difficulty == "HARD") {
_global.difflevel = 1;
_root.difficulty = "EASY";
} else if (_root.difficulty == "EASY") {
_global.difflevel = 2;
_root.difficulty = "NORMAL";
}
}
Symbol 619 Button
on (press, keyPress "<Enter>") {
var numberofcolors = CParray.length;
if (CPmycolor == undefined) {
_global.CPmycolor = Math.floor(Math.random() * numberofcolors);
}
SplashandDash_Sound.stop();
_global.loadcircuit();
gotoAndStop (674);
}
Symbol 621 Button
on (press) {
_root.gotoAndPlay("colorpicker");
}
Symbol 627 Button
on (press) {
_root.gotoAndPlay("menu");
}
Symbol 629 MovieClip Frame 10
stop();
Symbol 638 Button
on (press, keyPress "<Enter>") {
_root.colorshower.onEnterFrame = undefined;
_root.colorshower.removeMovieClip();
i = 0;
while (i <= 33) {
ctarget = _root["showcolor" + i];
ctarget.removeMovieClip();
i++;
}
_root.gotoAndPlay("settings");
}
Symbol 639 MovieClip Frame 10
stop();
Symbol 645 Button
on (press, keyPress "<Enter>") {
_root.colorshower.onEnterFrame = undefined;
_root.colorshower.removeMovieClip();
i = 0;
while (i <= 33) {
ctarget = _root["showcolor" + i];
ctarget.removeMovieClip();
i++;
}
_root.gotoAndPlay("settings");
}
Symbol 647 MovieClip Frame 10
stop();
Instance of Symbol 646 MovieClip in Symbol 647 MovieClip Frame 10
on (press) {
_root.uitleg_mc.nextFrame();
}
Symbol 690 MovieClip Frame 1
stop();
Symbol 690 MovieClip Frame 9
stop();
Symbol 690 MovieClip Frame 27
gotoAndPlay (10);
Symbol 702 Button
on (press, keyPress "<Enter>") {
_root.colorshower.onEnterFrame = undefined;
_root.colorshower.removeMovieClip();
i = 0;
while (i <= 33) {
ctarget = _root["showcolor" + i];
ctarget.removeMovieClip();
i++;
}
_root.gotoAndPlay("settings");
}
Symbol 704 MovieClip Frame 10
stop();
Instance of Symbol 703 MovieClip in Symbol 704 MovieClip Frame 10
on (press) {
_root.uitleg_mc.prevFrame();
}
Symbol 726 MovieClip Frame 1
stop();
Symbol 729 MovieClip Frame 1
stop();
Symbol 739 MovieClip Frame 1
stop();
Symbol 742 MovieClip Frame 1
stop();
Instance of Symbol 738 MovieClip "knipper_mc" in Symbol 742 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 742 MovieClip Frame 405
_root.tankers_mc.gotoAndPlay("reverse");
Symbol 772 MovieClip Frame 1
stop();
back_but.useHandCursor = false;
Instance of Symbol 697 MovieClip "fuelgame_mc" in Symbol 772 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 772 MovieClip Frame 2
stop();
Symbol 772 MovieClip Frame 3
stop();
Symbol 772 MovieClip Frame 4
stop();
Symbol 796 Button
on (press) {
getURL ("http://www.isioux.nl", "_blank");
}
Symbol 813 MovieClip Frame 1
stop();
Symbol 816 MovieClip Frame 1
stop();
Symbol 873 MovieClip Frame 1
stop();
Symbol 883 Button
on (press) {
if (_global.mymoney >= _root.cost) {
_root.setmymoneyshow(_root.cost);
_global["bought" + _root.letterselec] = _root.inlistselec;
_root["itembuy" + _root.letterselec].gotoAndStop(_root.inlistselec + 1);
_root["itemhave" + _root.letterselec].gotoAndStop(_root.inlistselec + 1);
this.gotoAndStop(3);
}
}
Symbol 884 MovieClip Frame 1
stop();
Symbol 892 Button
on (press) {
_root.pressedslider = true;
_root.dragid = this.id;
slider_handler_mc._x = this._xmouse;
}
Symbol 894 Button
on (press) {
_root.dragging = true;
_root.dragid = this._parent.id;
startDrag ("", false, left, top, right, bottom);
}
on (release, releaseOutside) {
_root.dragging = false;
stopDrag();
}
Instance of Symbol 895 MovieClip "slider_handler_mc" in Symbol 896 MovieClip Frame 1
onClipEvent (load) {
top = _y;
bottom = _y;
left = _x;
right = _x + 256;
}
Symbol 931 MovieClip Frame 1
stop();
Symbol 937 MovieClip Frame 1
stop();
Symbol 940 MovieClip Frame 1
stop();
Symbol 948 MovieClip Frame 1
stop();
Symbol 964 MovieClip Frame 1
stop();
Symbol 964 MovieClip Frame 2
stop();
Symbol 964 MovieClip Frame 3
stop();
Symbol 964 MovieClip Frame 4
stop();
Symbol 964 MovieClip Frame 5
stop();
Symbol 964 MovieClip Frame 6
stop();
Symbol 964 MovieClip Frame 7
stop();
Symbol 964 MovieClip Frame 8
stop();
Symbol 964 MovieClip Frame 9
stop();
Symbol 964 MovieClip Frame 10
stop();
Symbol 1006 MovieClip Frame 1
stop();
Symbol 1044 MovieClip Frame 1
stop();
Symbol 1044 MovieClip Frame 2
stop();
Symbol 1044 MovieClip Frame 3
stop();
Symbol 1044 MovieClip Frame 4
stop();
Symbol 1044 MovieClip Frame 5
stop();
Symbol 1044 MovieClip Frame 6
stop();
Symbol 1044 MovieClip Frame 7
stop();
Symbol 1044 MovieClip Frame 8
stop();
Symbol 1044 MovieClip Frame 9
stop();
Symbol 1044 MovieClip Frame 10
stop();
Symbol 1078 MovieClip Frame 1
stop();
Symbol 1106 MovieClip Frame 1
stop();
Symbol 1106 MovieClip Frame 2
stop();
Symbol 1106 MovieClip Frame 3
stop();
Symbol 1106 MovieClip Frame 4
stop();
Symbol 1106 MovieClip Frame 5
stop();
Symbol 1106 MovieClip Frame 6
stop();
Symbol 1106 MovieClip Frame 7
stop();
Symbol 1106 MovieClip Frame 8
stop();
Symbol 1106 MovieClip Frame 9
stop();
Symbol 1106 MovieClip Frame 10
stop();
Instance of Symbol 1044 MovieClip "white_mc" in Symbol 1157 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1166 MovieClip Frame 1
stop();
Symbol 1175 MovieClip Frame 1
stop();
Symbol 1175 MovieClip Frame 2
stop();
Symbol 1175 MovieClip Frame 3
stop();
Symbol 1175 MovieClip Frame 4
stop();
Symbol 1175 MovieClip Frame 5
stop();
Symbol 1175 MovieClip Frame 6
stop();
Symbol 1178 MovieClip Frame 1
stop();
Symbol 1182 MovieClip Frame 1
stop();
Symbol 1182 MovieClip Frame 2
stop();
Symbol 1182 MovieClip Frame 3
stop();
Symbol 1182 MovieClip Frame 4
stop();
Symbol 1182 MovieClip Frame 5
stop();
Symbol 1182 MovieClip Frame 6
stop();
Symbol 1185 MovieClip Frame 1
stop();
Symbol 1189 MovieClip Frame 1
stop();
Symbol 1189 MovieClip Frame 2
stop();
Symbol 1189 MovieClip Frame 3
stop();
Symbol 1189 MovieClip Frame 4
stop();
Symbol 1189 MovieClip Frame 5
stop();
Symbol 1189 MovieClip Frame 6
stop();
Symbol 1192 MovieClip Frame 1
stop();
Symbol 1196 MovieClip Frame 1
stop();
Symbol 1196 MovieClip Frame 2
stop();
Symbol 1196 MovieClip Frame 3
stop();
Symbol 1196 MovieClip Frame 4
stop();
Symbol 1196 MovieClip Frame 5
stop();
Symbol 1196 MovieClip Frame 6
stop();
Symbol 1199 MovieClip Frame 1
stop();
Symbol 1203 MovieClip Frame 1
stop();
Symbol 1203 MovieClip Frame 2
stop();
Symbol 1203 MovieClip Frame 3
stop();
Symbol 1203 MovieClip Frame 4
stop();
Symbol 1203 MovieClip Frame 5
stop();
Symbol 1203 MovieClip Frame 6
stop();
Symbol 1206 MovieClip Frame 1
stop();
Symbol 1210 MovieClip Frame 1
stop();
Symbol 1210 MovieClip Frame 2
stop();
Symbol 1210 MovieClip Frame 3
stop();
Symbol 1210 MovieClip Frame 4
stop();
Symbol 1210 MovieClip Frame 5
stop();
Symbol 1210 MovieClip Frame 6
stop();
Symbol 1213 MovieClip Frame 1
stop();
Instance of Symbol 1178 MovieClip "bl_mc" in Symbol 1214 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1185 MovieClip "fl_mc" in Symbol 1214 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1192 MovieClip "br_mc" in Symbol 1214 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1199 MovieClip "fr_mc" in Symbol 1214 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1206 MovieClip "bw_mc" in Symbol 1214 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1213 MovieClip "fw_mc" in Symbol 1214 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Symbol 1262 MovieClip Frame 1
stop();
Symbol 1262 MovieClip Frame 8
startRace();
play();
Symbol 1262 MovieClip Frame 23
stop();
Symbol 1267 MovieClip Frame 1
stop();
Symbol 1276 MovieClip Frame 1
stop();
Symbol 1276 MovieClip Frame 2
_root.showpittime = _root.R_game_mc.timetostring(_root.toshowpittime);
Symbol 1307 MovieClip Frame 1
stop();
Symbol 1331 Button
on (press) {
if ((((_root.playername == "") || (_root.playername == undefined)) || (_root.playername == "FILL IN HERE")) || (_root.playername == "NEW DRIVER")) {
_root.scoreerror = "please fill in your name";
return(undefined);
}
if ((((_root.email == "") || (_root.email == undefined)) || (_root.email == "myadres@email.com")) || (_root.email == "YOUR E-MAIL ADRES")) {
_root.scoreerror = "please fill in your e-mail";
return(undefined);
}
this.statsvars.LVs = new LoadVars();
this.average = String(_global.endtime);
this.bestlap = String(_global.bestlaptime);
this.submitcircuit = _global.circuitnumber;
this.submitlevel = _global.difflevel;
this.statsvars.LVs.submitname = String(_root.playername);
this.statsvars.LVs.submitemail = String(_root.email);
pointssubmittussen = this.average * 1000;
pointssubmit = Math.round(pointssubmittussen);
var codestr = ((new String(pointssubmit) + new String(this.submitcircuit)) + new String(this.submitlevel));
codearray = new Array(5);
codearray[4] = 0;
groottecode = length(codestr);
teller = 1;
while (teller <= 4) {
codearray[teller] = codestr.charAt(4 - teller);
teller++;
}
if ((codearray[teller] < 6) and (codearray[5] < 6)) {
codearray[5] = codearray[5] + codearray[teller];
} else if ((codearray[teller] < 6) and (codearray[5] > 5)) {
codearray[5] = codearray[5] - codearray[teller];
}
codearray[2] = 9 - codearray[2];
codearray[4] = 9 - codearray[4];
arraychars = new Array("i", "v", "g", "c", "a", "z", "l", "e", "o", "x");
codestr = (((arraychars[codearray[1]] + arraychars[codearray[2]]) + arraychars[codearray[3]]) + arraychars[codearray[4]]) + arraychars[codearray[5]];
var scorestr2 = ((new String(pointssubmit) + new String(this.submitcircuit)) + new String(this.submitlevel));
scorestr = new String("");
q = 0;
while (q < scorestr2.length) {
scorestr = scorestr + arraychars[scorestr2.charAt(q)];
q++;
}
this.statsvars.gotoAndPlay("verstuur");
}
Symbol 1332 MovieClip Frame 1
stop();
Symbol 1332 MovieClip Frame 2
LVs.code = _parent.codestr;
LVs.lc = String(_parent.submitcircuit).length;
LVs.score = _parent.scorestr;
LVs.gc = _parent.groottecode;
LVs.uid = "ucXIODjdDvHK";
LVs.bestlap = _parent.bestlap * 1000;
LVs.onLoad = function (success) {
if (success) {
trace("Data has been sent and loaded successfully...");
trace(("I have got " + LVs.EmailStatus) + " from the PHP script.");
if (LVs.outcome == "error") {
trace(" I dont want to update user under this email :(");
_root.phpoutcome = LVs.EmailStatus;
} else {
_root.R_game_mc.endPosition_mc.sub_mc.gotoAndPlay(11);
}
} else {
trace("You have problem now...");
}
};
tempkey = Math.round(Math.random() * 100000);
this.targetUrl = (((((((((((((((("http://www.entertainmail.net/splash_and_dash/highscore/highscore_submitter.php?code=" + LVs.code) + "&lc=") + LVs.lc) + "&score=") + LVs.score) + "&gc=") + LVs.gc) + LVs.score) + "&uid=") + LVs.gc) + LVs.uid) + "&bestlap=") + LVs.bestlap) + "&submitname=") + LVs.submitname) + "&submitemail=") + LVs.submitemail;
loadMovieNum (this.targetUrl, 2);
_root.R_game_mc.endPosition_mc.sub_mc.gotoAndPlay(11);
gotoAndStop (1);
Symbol 1345 MovieClip Frame 1
stop();
Instance of Symbol 1321 MovieClip "submitscore" in Symbol 1345 MovieClip Frame 1
on (press) {
if (this._parent._currentframe < 2) {
this._parent.gotoAndPlay(2);
}
}
Symbol 1345 MovieClip Frame 10
stop();
Instance of Symbol 1333 MovieClip "submitscore" in Symbol 1345 MovieClip Frame 10
onClipEvent (load) {
_root.menu_levelcomplited_mc.submitscore._visible = false;
}
Symbol 1345 MovieClip Frame 19
getURL (((((("http://www.entertainmail.net/splash_and_dash/highscore/highscore_viewer.php?com=" + _global.circuitnumber) + "&zoeknaam=") + _root.playername) + "&diff=") + _global.difflevel) + "#t", "_blank");
stop();
Symbol 1385 Button
on (press) {
_global.endgame();
}
Symbol 1398 MovieClip Frame 1
stop();
Symbol 1398 MovieClip Frame 73
_root.R_game_mc.flag_mc.removeMovieClip();
Symbol 1398 MovieClip Frame 118
mouse.show();
stop();
Symbol 1398 MovieClip Frame 341
_global.endgame();
stop();
Symbol 1398 MovieClip Frame 437
this.gotoAndPlay("gameover");
Symbol 1402 Button
on (press) {
globalsound = new Sound();
_root.targetsound = 0;
globalsound.setVolume(0);
this.gotoAndStop(2);
}
Symbol 1406 Button
on (press) {
globalsound = new Sound();
_root.targetsound = 100;
globalsound.setVolume(100);
this.gotoAndStop(1);
}
Symbol 1407 MovieClip Frame 1
stop();
Symbol 1411 Button
on (press) {
_quality = "HIGH";
_root.qualitynumber = 2;
this.gotoAndStop(2);
}
Symbol 1415 Button
on (press) {
_quality = "BEST";
_root.qualitynumber = 3;
this.gotoAndStop(3);
}
Symbol 1419 Button
on (press) {
_quality = "LOW";
_root.qualitynumber = 1;
this.gotoAndStop(1);
}
Symbol 1420 MovieClip Frame 1
stop();
Symbol 1421 MovieClip Frame 1
_global.circuitname = "Demo Circuit";
_global.circuitnumber = 0;
_global.maxlaps = 2;
_global.circuitmaxdrivers = 5;
_global.mystylecolor = [41, 93, 163, -41, -25, -45, 100, 0];
_global.framedest = undefined;
_root.black_mc.gotoAndPlay("fadeout");
_global.falsestart = false;
_global.gameStart = false;
_global.passedendcam = false;
_global.endlist = [];
_global.totallos = false;
_global.maxlaps = 4;
_global.maxdrivers = 5;
_global.direction = 0;
_global.directionstep = 0.1;
_global.horizone = 0.03;
_global.hectamax = 45;
_global.maxdrivers = 5;
_global.maxgrasdamage = 0.1;
if (_root.qualitynumber == 3) {
_quality = "best";
} else if (_root.qualitynumber == 2) {
_quality = "high";
} else {
_quality = "low";
}
_root.R_game_mc.quality_mc.gotoAndStop(_root.qualitynumber);
_root.wonprice = "0,-";
_root.targetsound = 60;
_global.framedest = undefined;
_root.black_mc.gotoAndPlay("fadeout");
_global.falsestart = false;
_global.gameStart = false;
_global.passedendcam = false;
_global.endlist = [];
_global.totallos = false;
_global.direction = 0;
_global.directionstep = 0.1;
_global.horizone = 0.03;
_global.hectamax = 45;
_global.maxgrasdamage = 0.1;
if (_global.difflevel == 3) {
_global.myleftside = 15;
_global.myrightside = 85;
} else if (_global.difflevel == 1) {
_global.myleftside = 27;
_global.myrightside = 73;
} else {
_global.myleftside = 20;
_global.myrightside = 80;
}
_global.CpuNamesarray = ["Rubbers Birrachello", "Ferardo Alinso", "Michel Schonmacher", "Tukama Soto", "Jonsen Botton", "Keme Reikkinen", "Rolf Schonmacher", "Devid Calthourd", "Racordo Zanto", "Rebbort DoornBas", "Nack HeedFild", "Jaon Pobla Mantayo", "Jorna Trillu", "Zalst Boumgortner", "Chrastien Klein", "Merk Wabber", "Jucque Vallenivue", "Pheillipa Mosso", "Alivar Pinas", "Gioncorlo Fischachalla", "Gionmario Bruno", "Toma Glick"];
_global.driverObj = {};
driverObj.trysign = {};
driverObj.trysign.distance = 3;
driverObj.trysign.xPerc = 50;
driverObj.trysign.mc = _root.R_game_mc.flag_mc;
driverObj.finish = {};
driverObj.finish.distance = 0.5;
driverObj.finish.xPerc = 50;
driverObj.finish.mc = _root.R_game_mc.main_mc.mask_finish_mc.mask_finish_sub_mc;
driverObj.end = {};
driverObj.end.name = "End";
driverObj.end.number = 0;
driverObj.end.marker = 1;
driverObj.end.laps = 0;
driverObj.end.distance = 2E-6;
driverObj.end.xPerc = 70;
driverObj.end.speedperc = 0;
driverObj.end.speed = 0;
driverObj.end.speedmax = 320;
driverObj.driver0 = {};
driverObj.driver0.name = _root.playername;
driverObj.driver0.number = 0;
driverObj.driver0.marker = 0;
driverObj.driver0.laps = 0;
driverObj.driver0.distance = 0;
driverObj.driver0.xPerc = 70;
driverObj.driver0.speedperc = 0;
driverObj.driver0.speed = 0;
driverObj.driver0.orig_speedmax = 320;
driverObj.driver0.speedmax = 320;
driverObj.driver0.orig_maxstearforce = 4.5;
driverObj.driver0.maxstearforce = 4.5;
driverObj.driver0.hArea = 20;
driverObj.driver0.intermediat = 0;
driverObj.driver1 = {};
driverObj.driver1.number = 1;
driverObj.driver1.marker = 0;
driverObj.driver1.laps = 0;
driverObj.driver1.distance = 0.055;
driverObj.driver1.xPerc = 30;
driverObj.driver1.speedperc = 0;
driverObj.driver1.speed = 0;
driverObj.driver1.orig_speedmax = 320;
driverObj.driver1.speedmax = 320;
driverObj.driver1.orig_maxstearforce = 4.5;
driverObj.driver1.maxstearforce = 4.5;
driverObj.driver1.hArea = 20;
driverObj.driver2 = {};
driverObj.driver2.number = 2;
driverObj.driver2.marker = 0;
driverObj.driver2.laps = 0;
driverObj.driver2.distance = 1.21;
driverObj.driver2.xPerc = 70;
driverObj.driver2.speedperc = 0;
driverObj.driver2.speed = 0;
driverObj.driver2.orig_speedmax = 320;
driverObj.driver2.speedmax = 320;
driverObj.driver2.orig_maxstearforce = 4.5;
driverObj.driver2.maxstearforce = 4.5;
driverObj.driver2.hArea = 14;
driverObj.driver3 = {};
driverObj.driver3.number = 3;
driverObj.driver3.marker = 0;
driverObj.driver3.laps = 0;
driverObj.driver3.distance = 1.015;
driverObj.driver3.xPerc = 30;
driverObj.driver3.speedperc = 0;
driverObj.driver3.speed = 0;
driverObj.driver3.orig_speedmax = 320;
driverObj.driver3.speedmax = 320;
driverObj.driver3.orig_maxstearforce = 4.5;
driverObj.driver3.maxstearforce = 4.5;
driverObj.driver3.hArea = 10;
driverObj.driver4 = {};
driverObj.driver4.number = 4;
driverObj.driver4.marker = 0;
driverObj.driver4.laps = 0;
driverObj.driver4.distance = 0.9;
driverObj.driver4.xPerc = 20;
driverObj.driver4.speedperc = 0;
driverObj.driver4.speed = 0;
driverObj.driver4.orig_speedmax = 320;
driverObj.driver4.speedmax = 320;
driverObj.driver4.orig_maxstearforce = 4.5;
driverObj.driver4.maxstearforce = 4.5;
driverObj.driver4.hArea = 5;
driverObj.driver5 = {};
driverObj.driver5.number = 5;
driverObj.driver5.marker = 0;
driverObj.driver5.laps = 0;
driverObj.driver5.distance = 1.1;
driverObj.driver5.xPerc = 45;
driverObj.driver5.speedperc = 0;
driverObj.driver5.speed = 0;
driverObj.driver5.orig_speedmax = 320;
driverObj.driver5.speedmax = 320;
driverObj.driver5.orig_maxstearforce = 4.5;
driverObj.driver5.maxstearforce = 4.5;
driverObj.driver5.hArea = 22;
driverObj.driver6 = {};
driverObj.driver6.number = 6;
driverObj.driver6.marker = 0;
driverObj.driver6.laps = 0;
driverObj.driver6.distance = 1.35;
driverObj.driver6.xPerc = 60;
driverObj.driver6.speedperc = 0;
driverObj.driver6.speed = 0;
driverObj.driver6.orig_speedmax = 320;
driverObj.driver6.speedmax = 320;
driverObj.driver6.orig_maxstearforce = 4.5;
driverObj.driver6.maxstearforce = 4.5;
driverObj.driver6.hArea = 20;
driverObj.driver7 = {};
driverObj.driver7.number = 7;
driverObj.driver7.marker = 0;
driverObj.driver7.laps = 0;
driverObj.driver7.distance = 1.68;
driverObj.driver7.xPerc = 90;
driverObj.driver7.speedperc = 0;
driverObj.driver7.speed = 0;
driverObj.driver7.orig_speedmax = 320;
driverObj.driver7.speedmax = 320;
driverObj.driver7.orig_maxstearforce = 4.5;
driverObj.driver7.maxstearforce = 4.5;
driverObj.driver7.hArea = 20;
driverObj.driver8 = {};
driverObj.driver8.number = 8;
driverObj.driver8.marker = 0;
driverObj.driver8.laps = 0;
driverObj.driver8.distance = 1.8;
driverObj.driver8.xPerc = 50;
driverObj.driver8.speedperc = 0;
driverObj.driver8.speed = 0;
driverObj.driver8.orig_speedmax = 320;
driverObj.driver8.speedmax = 320;
driverObj.driver8.orig_maxstearforce = 4.5;
driverObj.driver8.maxstearforce = 4.5;
driverObj.driver8.hArea = 10;
driverObj.driver9 = {};
driverObj.driver9.number = 9;
driverObj.driver9.marker = 0;
driverObj.driver9.laps = 0;
driverObj.driver9.distance = 1.85;
driverObj.driver9.xPerc = 10;
driverObj.driver9.speedperc = 0;
driverObj.driver9.speed = 0;
driverObj.driver9.orig_speedmax = 320;
driverObj.driver9.speedmax = 320;
driverObj.driver9.orig_maxstearforce = 4.5;
driverObj.driver9.maxstearforce = 4.5;
driverObj.driver9.hArea = 8;
_global.maindriver = driverObj.driver0;
_global.initcolor = function () {
_root.R_game_mc.randomcolors();
i = 0;
while (i <= maxdrivers) {
driver = driverObj["driver" + i];
var ctargetbody = driver.mc.car_main_mc.body_mc;
_global["myColor" + i] = new Color(ctargetbody);
myColorTransform = new Object();
var mycolorindex = pickedcolors[i];
myCT.ra = CParray[mycolorindex][0];
myCT.rb = CParray[mycolorindex][1];
myCT.ga = CParray[mycolorindex][2];
myCT.gb = CParray[mycolorindex][3];
myCT.ba = CParray[mycolorindex][4];
myCT.bb = CParray[mycolorindex][5];
myCT.aa = CParray[mycolorindex][6];
myCT.ab = CParray[mycolorindex][7];
i++;
}
changecolor(0);
};
_global.changecolor = function (i) {
driver = driverObj["driver" + i];
var ctargetbody = driver.mc.car_main_mc.body_mc;
_global["myColor" + i] = new Color(ctargetbody);
_global["myColorTransform" + i] = new Object();
var myCT = _global["myColorTransform" + i];
var mycolorindex = pickedcolors[i];
myCT.ra = CParray[mycolorindex][0];
myCT.rb = CParray[mycolorindex][1];
myCT.ga = CParray[mycolorindex][2];
myCT.gb = CParray[mycolorindex][3];
myCT.ba = CParray[mycolorindex][4];
myCT.bb = CParray[mycolorindex][5];
myCT.aa = CParray[mycolorindex][6];
myCT.ab = CParray[mycolorindex][7];
_global["myColor" + i].setTransform(myCT);
};
_global.changecolorCPU = function (i) {
driver = driverObj["driver" + i];
var ctargetbody = driver.mc.car_main_mc.body_mc;
_global["myColor" + i] = new Color(ctargetbody);
_global["myColorTransform" + i] = new Object();
var myCT = _global["myColorTransform" + i];
var mycolorindex = pickedcolors[i];
myCT.ra = CParrayCPU[mycolorindex][0];
myCT.rb = CParrayCPU[mycolorindex][1];
myCT.ga = CParrayCPU[mycolorindex][2];
myCT.gb = CParrayCPU[mycolorindex][3];
myCT.ba = CParrayCPU[mycolorindex][4];
myCT.bb = CParrayCPU[mycolorindex][5];
myCT.aa = CParrayCPU[mycolorindex][6];
myCT.ab = CParrayCPU[mycolorindex][7];
_global["myColor" + i].setTransform(myCT);
};
_root.R_game_mc.randomcolors = function () {
pick5function();
};
_global.pick5functionhelper = function (mynumber) {
j = 0;
while (j <= _global.pickedcolors.length) {
if (_global.pickedcolors[j] == mynumber) {
return(false);
}
j++;
}
};
_global.pick5function = function () {
var numberofcolors = (CParrayCPU.length - 1);
_global.pickedcolors = [CPmycolor];
i = 1;
while (i <= maxdrivers) {
mypick = Math.floor(Math.random() * numberofcolors);
if (pick5functionhelper(mypick) == false) {
i = i - 1;
} else {
pickedcolors.push(mypick);
}
i++;
}
};
_global.pick5namesfunctionhelper = function (mynumber) {
j = 0;
while (j <= _global.pickednames.length) {
if (_global.pickednames[j] == mynumber) {
return(false);
}
j++;
}
};
_global.pick5namesfunction = function () {
var numberofnames = CpuNamesarray.length;
_global.pickednames = [];
i = 1;
while (i <= maxdrivers) {
mypick = Math.floor(Math.random() * numberofnames);
if (pick5namesfunctionhelper(mypick) == false) {
i = i - 1;
} else {
pickednames.push(mypick);
}
i++;
}
i = 1;
while (i <= maxdrivers) {
driverObj["driver" + i].name = _global.CpuNamesarray[pickednames[i - 1]];
i++;
}
};
ScreenControl = {};
ASBroadcaster.initialize(screenControl);
myarray = ["curbes_mc", "curbes2_mc", "road_mc", "grass_mc", "white_mc"];
maxlength = myarray.length;
i = 0;
while (i <= maxlength) {
ctarget = _root.R_game_mc.main_mc[myarray[i]];
ctarget.stopme = function () {
this.stop();
};
ctarget.gotoframe = function () {
this.play();
};
ctarget.gotoandstopframe = function (gfr) {
this.gotoAndStop(gfr);
};
screenControl.addListener(ctarget);
i++;
}
screenControl.broadcastMessage("stopme");
_global.delayperc = 100;
fscommand ("allowscale", "false");
fscommand ("fullscreen", "false");
_global.speedperc = 0;
_global.speedperc2 = 0;
_global.speedmax = 320;
_root.R_game_mc.keyKeeper = function () {
if ((!gamestart) && (!develop)) {
if (Key.isDown(38)) {
_global.falsestart = true;
}
if (!Key.isDown(38)) {
_global.falsestart = false;
}
return(undefined);
}
if (!Key.isDown(38)) {
_global.falsestart = false;
}
if (_global.falsestart) {
return(undefined);
}
var driver = driverObj.driver0;
if (driver.finished || (driver.atpitstreet)) {
if (driver.speedperc > 0) {
driver.speedperc = driver.speedperc - 1;
} else {
driver.speedperc = 0;
}
return(undefined);
}
if (Key.isDown(40) && (!Key.isDown(38))) {
if (driver.speedperc > 0) {
driver.speedperc = driver.speedperc - 2;
}
}
if (driver.fu <= 0) {
if (driver.speedperc > 0) {
driver.speedperc = driver.speedperc - 0.2;
} else {
driver.speedperc = 0;
}
if (driver.speedperc <= 0) {
if (_root.R_game_mc.endPosition_mc._currentframe < 123) {
_root.R_game_mc.endPosition_mc.gotoAndPlay(123);
}
}
return(undefined);
}
if (_global.totallos) {
if (driver.speedperc > 0) {
driver.speedperc = driver.speedperc - 0.9;
} else {
driver.speedperc = 0;
}
return(undefined);
}
if (Key.isDown(38) && (!Key.isDown(40))) {
if (driver.speedperc < 100) {
driver.speedperc = driver.speedperc + 1;
}
} else if ((driver.speedperc > 0) && (!develop)) {
driver.speedperc = driver.speedperc - 1;
}
};
_root.R_game_mc.createEmptyMovieClip("timeKeeper", 3);
_global.delaymax = 10;
_root.R_game_mc.timeKeeper.ctime = 0;
_root.R_game_mc.timeKeeper.cfr = 1;
_global.toknipper = ["curbes_mc", "curbes2_mc", "road_mc", "grass_mc", "white_mc"];
_global.knipmax = toknipper.length;
_root.R_game_mc.timeKeeper.chcktime = function () {
if (passedendcam) {
return(undefined);
}
if (!gamestart) {
return(undefined);
}
var myspeed = driverObj.driver0.speedperc;
if (myspeed <= 0) {
return(undefined);
}
if (myspeed > 50) {
myspeed = 50;
}
var framestep = Math.round((myspeed * 5) / 50);
var nfr = (this.cfr + framestep);
if (nfr > 10) {
nfr = nfr - 10;
}
this.cfr = nfr;
i = 0;
while (i <= knipmax) {
var ctarget = _root.R_game_mc.main_mc[toknipper[i]];
ctarget.gotoAndStop(nfr);
i++;
}
};
_root.onEnterFrame = function () {
_root.R_game_mc.timeKeeper.chcktime();
};
_root.R_game_mc.createEmptyMovieClip("speedKeeper", 55);
_global.distance = 0;
_global.distanceShow = 0;
_global.maxstearforce = 1.5;
cornerKeeper = {};
cornerKeeper.chckcorner = function () {
var mydriver = driverObj.driver0;
if (mydriver.speedperc <= 0) {
return(undefined);
}
if (Key.isDown(37) && (!Key.isDown(39))) {
if (mydriver.xPerc > -10) {
var myspeed = mydriver.speedperc;
if (myspeed < 50) {
var prestearforce = ((mydriver.speedperc * mydriver.maxstearforce) / 100);
var stearforce = (prestearforce + 1.7);
} else {
var prestearforce = ((mydriver.speedperc * mydriver.maxstearforce) / 100);
var stearforce = ((mydriver.maxstearforce - prestearforce) + 1.7);
}
mydriver.xPerc = mydriver.xPerc - stearforce;
}
}
if (Key.isDown(39) && (!Key.isDown(37))) {
if (mydriver.xPerc < 110) {
var myspeed = mydriver.speedperc;
if (myspeed < 50) {
var prestearforce = ((mydriver.speedperc * mydriver.maxstearforce) / 100);
var stearforce = (prestearforce + 1.7);
} else {
var prestearforce = ((mydriver.speedperc * mydriver.maxstearforce) / 100);
var stearforce = ((mydriver.maxstearforce - prestearforce) + 1.7);
}
mydriver.xPerc = mydriver.xPerc + stearforce;
}
}
};
_root.R_game_mc.attachpitstop = function () {
if (_global.develop) {
_global.circuitdis = circuit[circuit.length - 1].dis;
return(undefined);
}
var circuitlength = circuit[circuit.length - 1].dis;
var newlength = (circuitlength + 0.04);
if (circuit[circuit.length - 1].pframe < 25) {
var mydir = 1;
} else if (circuit[circuit.length - 1].pframe > 25) {
var mydir = -1;
} else {
var mydir = 0;
}
_root.pitdisstart = newlength;
circuit.push({dis:newlength, dir:mydir, step:0.5, goal:25, style:1, pframe:25});
newlength = newlength + 0.002;
circuit.push({dis:newlength, dir:0, step:0.5, goal:25, style:1, pframe:25, pit:2});
newlength = newlength + 0.02;
circuit.push({dis:newlength, dir:0, step:0.5, goal:25, style:1, pframe:25, pit:4});
_global.pitmarker = circuit.length - 1;
newlength = newlength + 0.3;
circuit.push({dis:newlength, dir:0, step:0.5, goal:25, style:1, pframe:25, pit:3});
newlength = newlength + 0.02;
circuit.push({dis:newlength, dir:0, step:0.5, goal:25, style:1, pframe:25});
newlength = newlength + 0.02;
circuit.push({dis:newlength, dir:0, step:0.5, goal:25, style:1, pframe:25});
newlength = newlength + ((maxdrivers * 0.025) + 0.034);
circuit.push({dis:newlength, dir:0, step:0.5, goal:25, style:1, pframe:25, lal:1});
_global.circuitdis = circuit[circuit.length - 1].dis;
};
circuitObject = function () {
_global.circuit = [{dis:0, dir:0, step:0.1, goal:1, style:0, pframe:25}, {dis:0.278858333333333, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:0.33532508, dir:-1, step:1.4, goal:1, style:1, pframe:46}, {dis:0.460287013333333, dir:1, step:1.4, goal:50, style:1, pframe:6.80000000000001}, {dis:0.573325146666666, dir:-1, step:1.4, goal:1, style:1, pframe:41.8}, {dis:0.613577146666666, dir:0, step:1.4, goal:25, style:1, pframe:29.2}, {dis:0.763435479999997, dir:-1, step:1.4, goal:1, style:1, pframe:25}, {dis:0.845738039999997, dir:0, step:1.4, goal:25, style:1, pframe:1}, {dis:0.935575559999997, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:1.02168052, dir:0, step:1.4, goal:25, style:1, pframe:50}, {dis:1.22298138666666, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:1.28161498666666, dir:-1, step:1.4, goal:1, style:1, pframe:43.2}, {dis:1.41198870666666, dir:0, step:1.4, goal:25, style:1, pframe:2.6}, {dis:1.59132033333333, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:1.65020541333333, dir:0, step:1.4, goal:25, style:1, pframe:43.2}, {dis:1.75405405333333, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:1.82928669333333, dir:0, step:1.4, goal:25, style:1, pframe:48.8}, {dis:1.88117181333333, dir:-1, step:1.4, goal:1, style:1, pframe:32}, {dis:2.16758237333334, dir:0, step:1.4, goal:25, style:1, pframe:1}, {dis:2.27864820000001, dir:-1, step:1.4, goal:1, style:1, pframe:25}, {dis:2.34634932000001, dir:0, step:1.4, goal:25, style:1, pframe:4.00000000000001}, {dis:2.42474590666668, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:2.49251092000001, dir:0, step:1.4, goal:25, style:1, pframe:46}, {dis:2.59592236000001, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:2.68380268000001, dir:0, step:1.4, goal:25, style:1, pframe:50}, {dis:2.78473888000001, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:2.87688842666668, dir:0, step:1.4, goal:25, style:1, pframe:50}, {dis:2.98802256000001, dir:-1, step:1.4, goal:1, style:1, pframe:25}, {dis:3.08447365333335, dir:0, step:1.4, goal:25, style:1, pframe:1}, {dis:3.12661426666668, dir:1, step:1.4, goal:50, style:1, pframe:25}, {dis:3.21109970666669, dir:-1, step:1.4, goal:1, style:1, pframe:50}, {dis:3.27361337333335, dir:0, step:1.4, goal:25, style:1, pframe:1}];
_root.R_game_mc.attachpitstop();
var circuitl = circuit.length;
k = 0;
while (k < circuitl) {
var olddis = circuit[k].dis;
var tdis = Math.round(olddis * 1000);
var ndis = (tdis / 1000);
circuit[k].dis = ndis;
k++;
}
var mycircuitlength = _global.circuit.length;
_global.maininter1 = Math.round(mycircuitlength / 4);
_global.maininter2 = Math.round(mycircuitlength / 4) * 2;
_global.maininter3 = Math.round((mycircuitlength / 4) * 3);
_global.Tinterobj = {};
var circuitlength = circuit[circuit.length - 1].dis;
driverObj.finish.distance = circuitlength;
driverObj.end.distance = circuitlength - 0.025;
_global.endcam = circuitlength - 0.025;
driverObj.driver0.marker = 0;
_global.cframe = 25;
_global.develop = false;
ASBroadcaster.initialize(this);
myarray = ["bocht1_mc", "bocht2_mc", "bocht3_mc"];
maxlength = myarray.length;
i = 0;
while (i <= maxlength) {
ctarget = _root.R_game_mc.main_mc[myarray[i]];
ctarget.stopme = function () {
this.stop();
};
ctarget.gotoframe = function (gottenframe) {
this.gotoAndStop(gottenframe);
};
ctarget.gotoframesub = function (gottenframe) {
this.sub_mc.gotoAndStop(gottenframe);
};
this.addListener(ctarget);
i++;
}
ctarget = _root.R_game_mc.hectaTotal_mc;
ctarget.stopme = function () {
this.stop();
};
ctarget.gotoframe = function (gottenframe) {
this.gotoAndStop(gottenframe);
};
this.addListener(ctarget);
_global.signControl = new signObject();
};
circuitObject.prototype.circuitchange = function (gottenDistance, gottenDirection, gottendirectionstep, gottengoal, gottenstyle, gottenpframe) {
circuit.push({dis:gottenDistance, dir:gottenDirection, step:gottendirectionstep, goal:gottengoal, style:gottenstyle, pframe:gottenpframe});
driverObj.driver0.marker = driverObj.driver0.marker + 1;
circuitControl.$circuitTraceHelper(gottenDistance, gottenDirection, gottendirectionstep, gottengoal, gottenstyle, gottenpframe);
};
circuitObject.prototype.$circuitTraceHelper = function (gottenDistance, gottenDirection, gottendirectionstep, gottengoal, gottenstyle, gottenpframe) {
trace(((((((((((("{dis:" + gottenDistance) + ",dir:") + gottenDirection) + ",step:") + gottendirectionstep) + ",goal:") + gottengoal) + ",style:") + gottenstyle) + ",pframe:") + gottenpframe) + "},");
};
circuitObject.prototype.circuitTrace = function () {
var maxlength = circuit.length;
trace("_global.circuit = [");
i = 0;
while (i < maxlength) {
circuitControl.$circuitTraceHelper(circuit[i].dis, circuit[i].dir, circuit[i].step, circuit[i].goal, circuit[i].style, circuit[i].pframe);
i++;
}
trace("];");
};
circuitObject.prototype.circuitshow = function () {
var mydriver = driverObj.driver0;
if (mydriver.finished || (mydriver.atpitstreet)) {
return(undefined);
}
if (develop) {
var maxlength = (circuit.length - 1);
var goal = circuit[maxlength].goal;
var style = circuit[maxlength].style;
if (style == 0) {
return(undefined);
}
if ((cframe == goal) || (style == undefined)) {
var tempdistance = mydriver.distance;
var tempdirectionstep = directionstep;
var tempcframe = cframe;
return(undefined);
}
if (cframe > goal) {
var dir = (-directionstep);
if ((cframe + dir) < goal) {
var tframe = goal;
} else {
var tframe = (cframe + dir);
}
} else if (cframe < goal) {
var dir = directionstep;
if ((cframe + dir) > goal) {
var tframe = goal;
} else {
var tframe = (cframe + dir);
}
}
if (tframe > 50) {
tframe = 50;
} else if (tframe < 1) {
tframe = 1;
}
cframe = tframe;
this.broadcastMessage("gotoframe", Math.round(cframe));
return(undefined);
}
if (!develop) {
if (mydriver.speed == 0) {
return(undefined);
}
var dis2 = circuit[mydriver.marker + 1].dis;
var mydist = mydriver.distance;
if (mydriver.laps == maxlaps) {
if (mydist > endcam) {
_global.passedendcam = true;
if (_root.R_game_mc.flag_mc == undefined) {
var myflag = _root.R_game_mc.attachMovie("flag", "flag_mc", 999);
myflag._x = 520;
myflag._y = 400;
}
}
}
if ((mydist >= dis2) && (!(dis2 === undefined))) {
mydriver.marker = mydriver.marker + 1;
if (mydriver.marker >= (circuit.length - 1)) {
if (!(mydriver.laps === 0)) {
endLapTime = MainControl.getmytimer();
_global.lastlaptime = (endLapTime / 1000) - (startLapTime / 1000);
_global.endtime = _global.endtime + _global.lastlaptime;
_root.showlastlaptime = _root.R_game_mc.timetostring(lastlaptime);
if ((_global.bestlaptime == undefined) || (lastlaptime < _global.bestlaptime)) {
_global.bestlaptime = lastlaptime;
_root.showbestlaptime = _root.R_game_mc.timetostring(lastlaptime);
}
}
circuitControl.reset(mydriver);
mydriver.laps = mydriver.laps + 1;
if (mydriver.laps == maxlaps) {
_root.R_game_mc.finallap_mc.gotoAndPlay(2);
}
if (mydriver.laps > maxlaps) {
mydriver.finished = true;
var precircuittime2 = _global.endtime;
mydriver.circuittime = precircuittime2;
endlist.push(mydriver.number);
var myposition = endlist.length;
_root["endtime" + myposition] = _root.R_game_mc.timetostring(precircuittime2);
_root["endname" + myposition] = (myposition + ". ") + mydriver.name;
_root["besttime" + myposition] = _root.showbestlaptime;
_root.R_game_mc.endPosition_mc.sub.gotoAndStop(myposition);
_root.R_game_mc.endPosition_mc.gotoAndPlay(2);
if (myposition < 4) {
var startbydiff = ((_global.difflevel - 1) * 3);
_root.wonprice = _root.pricemoneyshow[startbydiff + myposition];
_root.setmymoneyshow(_root.pricemoney[startbydiff + myposition] * -1);
}
_root.R_game_mc.laptime_mc._visible = false;
_global.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 3;
var mymarker = mydriver.marker;
var mylap = (mydriver.laps - 1);
var killer = _root.R_game_mc.createEmptyMovieClip("interkiller_mc", 16000);
killer.number = 0;
killer.ctime = 0;
killer.onEnterFrame = function () {
if (this.ctime >= 5) {
_root.R_game_mc.menu_inter_mc._visible = false;
}
if (this.ctime >= 5) {
_root.R_game_mc[("menu_inter" + this.number) + "_mc"]._visible = false;
this.number = this.number + 1;
if (this.number > maxdrivers) {
this.onEnterFrame = undefined;
}
} else {
this.ctime = this.ctime + 1;
}
};
return(undefined);
}
_root.showlap = (("Lap " + String(mydriver.laps)) + " / ") + maxlaps;
return(undefined);
}
var mymarker = mydriver.marker;
var mylap = mydriver.laps;
if (((mymarker == _global.maininter1) || (mymarker == _global.maininter2)) || (mymarker == _global.maininter3)) {
if (!(mydriver.intermediat === mymarker)) {
if (mymarker == _global.maininter1) {
_root.cInter = 1;
} else if (mymarker == _global.maininter2) {
_root.cInter = 2;
} else if (mymarker == _global.maininter3) {
_root.cInter = 3;
}
_global.Tinterobj[(("intermediatsStatusL" + mydriver.intermediatlap) + "M") + mydriver.intermediat] = 3;
mydriver.intermediatlap = mylap;
mydriver.intermediat = mymarker;
var myintermediat = _global.Tinterobj[(("intermediatsL" + mylap) + "M") + mymarker];
var interstatus = _global.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker];
var endLapTime = MainControl.getmytimer();
var preintertime = ((endLapTime / 1000) - (startLapTime / 1000));
var myintertime = (_global.endtime + preintertime);
maindriver.intertime = myintertime;
var intertimeShow = _root.R_game_mc.timetostring(myintertime);
_root.R_game_mc.interkiller_mc.onEnterFrame = undefined;
_root.R_game_mc.interkiller_mc.removeMovieClip();
i = 0;
while (i <= maxdrivers) {
_root.R_game_mc[("menu_inter" + i) + "_mc"]._visible = false;
i++;
}
_root.R_game_mc.menu_inter_mc._visible = true;
if (interstatus == undefined) {
var ctarget = _root.R_game_mc.menu_inter0_mc;
var ctext = _root.R_game_mc.menu_inter0_mc.mytxt;
_global.changeTextColor(ctarget, 16776960, intertimeShow, ctext);
var ctext = _root.R_game_mc.menu_inter0_mc.mynumber;
_global.changeTextColor(ctarget, 16776960, "1", ctext);
ctarget._visible = true;
_global.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] = 1;
_global.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 2;
} else {
var driverspast = myintermediat.length;
i = 0;
while (i < driverspast) {
var pasttime = (myintertime - myintermediat[i]);
var toshow = ("-" + _root.R_game_mc.timetostring(pasttime));
var ctarget = _root.R_game_mc[("menu_inter" + i) + "_mc"];
var ctext = _root.R_game_mc[("menu_inter" + i) + "_mc"].mytxt;
_global.changeTextColor(ctarget, 16718362, toshow, ctext);
var ctext = _root.R_game_mc[("menu_inter" + i) + "_mc"].mynumber;
_global.changeTextColor(ctarget, 16718362, i + 1, ctext);
ctarget._visible = true;
i++;
}
_global.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] = 1 + driverspast;
_global.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 2;
if ((driverspast + 1) >= maxdrivers) {
_global.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 3;
var killer = _root.R_game_mc.createEmptyMovieClip("interkiller_mc", 16000);
killer.number = 0;
killer.ctime = 0;
killer.onEnterFrame = function () {
if (this.ctime >= 160) {
_root.R_game_mc.menu_inter_mc._visible = false;
}
if (this.ctime >= 160) {
_root.R_game_mc[("menu_inter" + this.number) + "_mc"]._visible = false;
this.number = this.number + 1;
if (this.number > maxdrivers) {
this.onEnterFrame = undefined;
}
} else {
this.ctime = this.ctime + 1;
}
};
}
var ctarget = _root.R_game_mc[("menu_inter" + driverspast) + "_mc"];
var ctext = _root.R_game_mc[("menu_inter" + driverspast) + "_mc"].mytxt;
_global.changeTextColor(ctarget, 16776960, intertimeShow, ctext);
var ctext = _root.R_game_mc[("menu_inter" + driverspast) + "_mc"].mynumber;
_global.changeTextColor(ctarget, 16776960, driverspast + 1, ctext);
ctarget._visible = true;
}
}
}
}
if (passedendcam) {
return(undefined);
}
var goal = circuit[mydriver.marker].goal;
var pit = circuit[mydriver.marker].pit;
if (pit == undefined) {
_root.R_game_mc.main_mc.white_mc._visible = false;
} else {
_root.R_game_mc.main_mc.white_mc._visible = true;
}
if (pit == 2) {
var pframe1 = 1;
var pframe2 = 15;
} else if (pit == 3) {
var pframe1 = 15;
var pframe2 = 1;
} else if (pit == 4) {
if (mydriver.xperc > 105) {
if (!mydriver.atpitstreet) {
if (!(mydriver.lastpitstop === mydriver.laps)) {
mydriver.atpitstreet = true;
mydriver.lastpitstop = mydriver.laps;
mydriver.speedPerc = 0;
trace("##############PITSTREET#################");
SoundControl.stopSound(mydriver);
_root.mainctime = 1;
_root.mainpittimer = 0;
_root.startmainpittimer = MainControl.getmytimer();
_global.framedest = "pit";
_root.black_mc.gotoAndPlay("fadein");
}
}
}
var pframe1 = circuit[mydriver.marker].pframe;
var pframe2 = circuit[mydriver.marker + 1].pframe;
} else {
if (cframe == goal) {
return(undefined);
}
var pframe1 = circuit[mydriver.marker].pframe;
var pframe2 = circuit[mydriver.marker + 1].pframe;
}
var dis1 = circuit[mydriver.marker].dis;
var dis2 = circuit[mydriver.marker + 1].dis;
var diffdis = (dis2 - dis1);
var diffpframe = (pframe2 - pframe1);
var elapsed = (mydriver.distance - dis1);
var diffdisperc = ((elapsed * 100) / diffdis);
var elapsedframe = ((diffdisperc * diffpframe) / 100);
var tframe = Math.round(pframe1 + elapsedframe);
if (tframe > 50) {
tframe = 50;
} else if (tframe < 1) {
tframe = 1;
}
if ((pit == 2) || (pit == 3)) {
this.broadcastMessage("gotoframesub", tframe);
} else {
cframe = tframe;
this.broadcastMessage("gotoframe", cframe);
}
return(undefined);
}
};
circuitObject.prototype.reset = function (mydriver) {
mydriver.marker = 0;
mydriver.distance = 0;
distanceshow = 0;
if (!(mydriver.laps === 0)) {
startLapTime = MainControl.getmytimer();
}
};
_global.circuitControl = new circuitObject();
circuitControl.broadcastMessage("gotoframe", 25);
circuitInterval = setInterval(circuitControl, "circuitshow", 7);
treeObject = function () {
ASBroadcaster.initialize(this);
};
treeObject.prototype.initTrees = function () {
i = 0;
while (i <= 5) {
var randomNumber = Math.ceil(Math.random() * 4);
var randomNumberX = Math.round(500 - (Math.random() * 1000));
ctarget = _root.R_game_mc.main_mc.trees_mc.attachMovie("tree" + randomNumber, "tree" + i, 100 + i);
ctarget._x = randomNumberX;
this.addListener(ctarget);
ctarget.move = function (step) {
this._x = this._x + step;
if (this._x > 500) {
this._x = this._x - 1000;
} else if (this._x < -500) {
this._x = this._x + 1000;
}
};
i++;
}
i = 0;
while (i <= 2) {
var randomNumber = Math.ceil(Math.random() * 4);
var randomNumberX = Math.round(750 - (Math.random() * 1500));
var randomNumberY = Math.round(10 + (Math.random() * 200));
ctarget = _root.R_game_mc.main_mc.clouds_mc.attachMovie("cloud" + randomNumber, "cloud" + i, 200 + i);
ctarget._x = randomNumberX;
ctarget._y = randomNumberY;
ctarget.randomNumber = Math.ceil(Math.random() * 8) / 10;
this.addListener(ctarget);
ctarget.move = function (step) {
var step2 = (step * this.randomNumber);
this._x = this._x + step2;
if (this._x > 750) {
this._x = this._x - 1500;
} else if (this._x < -750) {
this._x = this._x + 1500;
}
};
i++;
}
};
treeObject.prototype.moveTrees = function () {
var mydriver = driverObj.driver0;
if (mydriver.speedperc <= 0) {
return(undefined);
}
step = (mydriver.speedperc * 3) / 100;
if (cframe > 25) {
step = step * -1;
} else if (cframe == 25) {
step = 0;
}
treeControl.broadcastMessage("move", step);
};
treeControl = new treeObject();
treeControl.initTrees();
treeInterval = setInterval(treeControl, "moveTrees", 500);
driverObject = function () {
var driver = driverObj.driver0;
driver.mc = _root.R_game_mc.car_holder_mc.attachMovie("car2", "car_mc0", 300);
ctarget.stopme = function () {
this.stop();
};
ctarget.gotoframe = function () {
this.play();
};
screenControl.addListener(ctarget);
};
driverObject.prototype.manageEnemies = function () {
_global.inscreen = [driverObj.driver0];
_global.centertime = MainControl.getmytimer();
var circuitlength = circuit[circuit.length - 1].dis;
var preposition = 1;
var lookdriver = driverObj.driver0;
if (lookdriver.finished || (passedendcam)) {
lookdriver = driverObj.end;
}
var maindriverinpit = driverObj.driver0.atpitstreet;
i = 1;
for ( ; i <= maxdrivers ; i++) {
var driver = driverObj["driver" + i];
driverControl.chckInflDamageCpu(driver);
var objDistance = (driver.distance - (lookdriver.distance - 0.005));
var enemiedistance = ((driver.laps * circuitlength) + driver.distance);
var driverdistance = ((lookdriver.laps * circuitlength) + (lookdriver.distance - 0.005));
var objDistanceLap = (enemiedistance - driverdistance);
if (objDistanceLap >= circuitlength) {
while (objDistanceLap >= circuitlength) {
objDistanceLap = objDistanceLap - circuitlength;
}
} else if (objDistanceLap < (-circuitlength)) {
while (objDistanceLap < (-circuitlength)) {
objDistanceLap = objDistanceLap + circuitlength;
}
}
if ((enemiedistance - 0.005) > driverdistance) {
preposition = preposition + 1;
}
if (driver.finished) {
if (driver.speedPerc == 0) {
continue;
}
} else if (driver.atpitstreet) {
if ((centertime - driver.startpenalty) >= driver.penaltyTime) {
driver.atpitstreet = false;
// unexpected jump
}
if (!(driver.mc === undefined)) {
driver.mc.removeMovieClip();
driver.mc = undefined;
}
} else {
var mycframe = driverControl.chckCorner(driver, 0.005);
var preideal = Math.round((mycframe * 100) / 50);
if (preideal < _global.myleftside) {
preideal = _global.myleftside;
} else if (preideal > _global.myrightside) {
preideal = _global.myrightside;
}
driver.ideal = preideal;
var mycframe = driverControl.chckCorner(driver, 0);
var myforce = driverControl.calcForce(driver, mycframe);
driver.olddistance = driver.distance;
driver.oldxPerc = driver.xPerc;
driver.oldspeedperc = driver.speedperc;
driverControl.chckspeed(driver, mycframe);
driverControl.autopilot(driver, myforce, mycframe);
driverControl.lap(driver);
if (maindriverinpit) {
} else if (((objDistance > 0) && (objDistance < horizone)) || ((objDistanceLap > 0) && (objDistanceLap < horizone))) {
if (driver.mc == undefined) {
driver.mc = _root.R_game_mc.car_holder_mc.attachMovie("car2", "car_mc" + i, 300 + i);
changecolorCPU(i);
}
if ((objDistanceLap > 0) && (objDistanceLap < horizone)) {
driverControl.calPos(driver, objDistanceLap);
} else {
driverControl.calPos(driver, objDistance);
}
inscreen.push(driver);
} else if (!(driver.mc === undefined)) {
driver.mc.removeMovieClip();
driver.mc = undefined;
}
}
}
if (maindriverinpit) {
driverControl.crashsorter();
return(undefined);
}
_root.position = preposition;
var mydriver = driverObj.driver0;
driverControl.chckInflDamage(mydriver);
mydriver.olddistance = mydriver.distance;
mydriver.oldxPerc = mydriver.xPerc;
mydriver.oldspeedperc = mydriver.speedperc;
cornerKeeper.chckcorner();
_root.R_game_mc.keyKeeper();
driverControl.chckspeed(mydriver, cframe);
driverControl.setshow(mydriver);
var force = driverControl.calcForce(mydriver, cframe);
mydriver.xPerc = mydriver.xPerc + force;
var mypresentxPerc = mydriver.xPerc;
if (mypresentxPerc > 110) {
mydriver.xPerc = 110;
} else if (mypresentxPerc < -10) {
mydriver.xPerc = -10;
}
driverControl.chckGras(mydriver, mypresentxPerc);
if ((!mydriver.finished) && (!passedendcam)) {
driverControl.calPos(mydriver, 0.005);
} else {
var objDistance = (mydriver.distance - (lookdriver.distance - 0.005));
var enemiedistance = ((mydriver.laps * circuitlength) + mydriver.distance);
var driverdistance = ((lookdriver.laps * circuitlength) + (lookdriver.distance - 0.005));
var objDistanceLap = (enemiedistance - driverdistance);
if (objDistanceLap >= circuitlength) {
while (objDistanceLap >= circuitlength) {
objDistanceLap = objDistanceLap - circuitlength;
}
} else if (objDistanceLap < (-circuitlength)) {
while (objDistanceLap < (-circuitlength)) {
objDistanceLap = objDistanceLap + circuitlength;
}
}
if (((objDistance > 0) && (objDistance < horizone)) || ((objDistanceLap > 0) && (objDistanceLap < horizone))) {
} else if (!(mydriver.mc === undefined)) {
mydriver.mc.removeMovieClip();
mydriver.mc = undefined;
}
if ((objDistanceLap > 0) && (objDistanceLap < horizone)) {
driverControl.calPos(mydriver, objDistanceLap);
} else {
driverControl.calPos(mydriver, objDistance);
}
}
SoundControl.chckSound(mydriver, mydriver.oldspeedperc, mydriver.speedperc, 60);
if (inscreen.length >= 2) {
driverControl.depthsorter();
}
var driver = driverObj.finish;
var objDistance = (driver.distance - lookdriver.distance);
if ((objDistance > -0.35) && (objDistance < horizone)) {
driverControl.calPos(driver, objDistance);
}
signControl.chckInscreen(lookdriver);
propControl.chckInscreen(lookdriver);
driverControl.crashsorter();
updateAfterEvent();
};
if (_global.difflevel == 3) {
_root.tire_dsp1 = 0.12;
_root.tire_dst1 = 0.4;
_root.wing_dsp1 = 0.16;
_root.wing_dst1 = 0.5;
_root.tire_cpu_dsp1 = 0.1;
_root.tire_cpu_dst1 = 0.25;
_root.wing_cpu_dsp1 = 0.08;
_root.wing_cpu_dst1 = 0.25;
} else if (_global.difflevel == 1) {
_root.tire_dsp1 = 0.08;
_root.tire_dst1 = 0.3;
_root.wing_dsp1 = 0.08;
_root.wing_dst1 = 0.37;
_root.tire_cpu_dsp1 = 0.08;
_root.tire_cpu_dst1 = 0.15;
_root.wing_cpu_dsp1 = 0;
_root.wing_cpu_dst1 = 0.3;
} else {
_root.tire_dsp1 = 0.1;
_root.tire_dst1 = 0.35;
_root.wing_dsp1 = 0.12;
_root.wing_dst1 = 0.45;
_root.tire_cpu_dsp1 = 0.07;
_root.tire_cpu_dst1 = 0.19;
_root.wing_cpu_dsp1 = 0;
_root.wing_cpu_dst1 = 0.25;
}
driverObject.prototype.chckInflDamage = function (givendriver) {
var origSpeed = givendriver.orig_speedmax;
var origSpeed10perc = (origSpeed * _root.tire_dsp1);
var origSpeed15perc = (origSpeed * _root.wing_dsp1);
var lossdueweight = ((givendriver.fu * origSpeed10perc) / 100);
var newspeedmax = (origSpeed - lossdueweight);
var origStear = givendriver.orig_maxstearforce;
var origStear35perc = (origStear * _root.tire_dst1);
var origStear45perc = (origStear * _root.wing_dst1);
var newstearmax = origStear;
var fl = givendriver.fl;
var fr = givendriver.fr;
var bl = givendriver.bl;
var br = givendriver.br;
var bw = givendriver.bw;
var fw = givendriver.fw;
var loscount = 0;
if (fl <= 0) {
givendriver.fl = 0;
fl = 0;
loscount = loscount + 1;
}
if (fr <= 0) {
givendriver.fr = 0;
fr = 0;
loscount = loscount + 1;
}
if (bl <= 0) {
givendriver.bl = 0;
bl = 0;
loscount = loscount + 1;
}
if (br <= 0) {
givendriver.br = 0;
br = 0;
loscount = loscount + 1;
}
if (bw <= 0) {
givendriver.bw = 0;
bw = 0;
loscount = loscount + 1;
}
if (fw <= 0) {
givendriver.fw = 0;
fw = 0;
loscount = loscount + 1;
}
if (loscount >= 2) {
if (_root.R_game_mc.endPosition_mc._currentframe < 123) {
_global.totallos = true;
_root.R_game_mc.endPosition_mc.gotoAndPlay(350);
}
}
newspeedmax = newspeedmax - (origSpeed10perc - ((fl * origSpeed10perc) / 100));
newspeedmax = newspeedmax - (origSpeed10perc - ((fr * origSpeed10perc) / 100));
newspeedmax = newspeedmax - (origSpeed10perc - ((bl * origSpeed10perc) / 100));
newspeedmax = newspeedmax - (origSpeed10perc - ((br * origSpeed10perc) / 100));
newspeedmax = newspeedmax - (origSpeed15perc - ((fw * origSpeed15perc) / 100));
newspeedmax = newspeedmax - (origSpeed15perc - ((bw * origSpeed15perc) / 100));
newstearmax = newstearmax - (origStear35perc - ((fl * origStear35perc) / 100));
newstearmax = newstearmax - (origStear35perc - ((fr * origStear35perc) / 100));
newstearmax = newstearmax - (origStear35perc - ((bl * origStear35perc) / 100));
newstearmax = newstearmax - (origStear35perc - ((br * origStear35perc) / 100));
newstearmax = newstearmax - (origStear45perc - ((fw * origStear45perc) / 100));
newstearmax = newstearmax - (origStear45perc - ((bw * origStear45perc) / 100));
if (newstearmax < 0.3) {
newstearmax = 0.3;
}
givendriver.speedmax = newspeedmax;
givendriver.maxstearforce = newstearmax;
};
driverObject.prototype.chckInflDamageCpu = function (givendriver) {
var origSpeed = givendriver.orig_speedmax;
var origSpeed5perc = (origSpeed * _root.tire_cpu_dsp1);
var origSpeed15perc = (origSpeed * _root.wing_cpu_dsp1);
var origSpeed10perc = (origSpeed * 0.1);
var lossdueweight = ((givendriver.fu * origSpeed10perc) / 100);
var newspeedmax = (origSpeed - lossdueweight);
var origStear = givendriver.orig_maxstearforce;
var origStear10perc = (origStear * _root.tire_cpu_dst1);
var origStear25perc = (origStear * _root.wing_cpu_dst1);
var newstearmax = origStear;
var fl = givendriver.fl;
var fr = givendriver.fr;
var bl = givendriver.bl;
var br = givendriver.br;
var bw = givendriver.bw;
var fw = givendriver.fw;
if (fl < 0) {
givendriver.fl = 0;
fl = 0;
}
if (fr < 0) {
givendriver.fr = 0;
fr = 0;
}
if (bl < 0) {
givendriver.bl = 0;
bl = 0;
}
if (br < 0) {
givendriver.br = 0;
br = 0;
}
if (bw < 0) {
givendriver.bw = 0;
bw = 0;
}
if (fw < 0) {
givendriver.fw = 0;
fw = 0;
}
newspeedmax = newspeedmax - (origSpeed5perc - ((fl * origSpeed5perc) / 100));
newspeedmax = newspeedmax - (origSpeed5perc - ((fr * origSpeed5perc) / 100));
newspeedmax = newspeedmax - (origSpeed5perc - ((bl * origSpeed5perc) / 100));
newspeedmax = newspeedmax - (origSpeed5perc - ((br * origSpeed5perc) / 100));
newspeedmax = newspeedmax - (origSpeed15perc - ((fw * origSpeed15perc) / 100));
newspeedmax = newspeedmax - (origSpeed15perc - ((bw * origSpeed15perc) / 100));
newstearmax = newstearmax - (origStear10perc - ((fl * origStear10perc) / 100));
newstearmax = newstearmax - (origStear10perc - ((fr * origStear10perc) / 100));
newstearmax = newstearmax - (origStear10perc - ((bl * origStear10perc) / 100));
newstearmax = newstearmax - (origStear10perc - ((br * origStear10perc) / 100));
newstearmax = newstearmax - (origStear25perc - ((fw * origStear25perc) / 100));
newstearmax = newstearmax - (origStear25perc - ((bw * origStear25perc) / 100));
if (newstearmax < 0.3) {
newstearmax = 0.3;
}
givendriver.speedmax = newspeedmax;
givendriver.maxstearforce = newstearmax;
};
driverObject.prototype.chckspeed = function (givendriver, mycframe) {
var mydriver = givendriver;
if (mydriver.speedperc < 0) {
mydriver.speedperc = 0;
} else if (mydriver.speedperc > 100) {
mydriver.speedperc = 100;
}
mydriver.speed = Math.round((mydriver.speedperc * mydriver.speedmax) / 100);
var predistance = ((mydriver.speed / 3600000) * 30);
mydriver.fu = mydriver.fu - (predistance * mydriver.fu_use);
var tirelose = (predistance * mydriver.tire_use);
mydriver.fl = mydriver.fl - tirelose;
mydriver.fr = mydriver.fr - tirelose;
mydriver.bl = mydriver.bl - tirelose;
mydriver.br = mydriver.br - tirelose;
if (mycframe == undefined) {
mydriver.distance = mydriver.distance + predistance;
return(undefined);
}
if ((mycframe > 20) && (mycframe < 30)) {
mydriver.distance = mydriver.distance + predistance;
return(undefined);
}
var verschil = ((mycframe * 2) - mydriver.xPerc);
if (verschil < 0) {
verschil = verschil * -1;
}
var maxminwaarde = (predistance * 0.4);
var minwaarde = ((verschil * maxminwaarde) / 100);
predistance = predistance - minwaarde;
mydriver.distance = mydriver.distance + predistance;
};
driverObject.prototype.chckGras = function (mydriver, mypresentxPerc) {
if (mypresentxPerc >= 92) {
if (!(mydriver.marker === pitmarker)) {
var myspeedP = mydriver.speedPerc;
var grdam = ((myspeedP * maxgrasdamage) / 100);
if (myspeedP > 10) {
var tosubstract = (myspeedP / 10);
if (tosubstract > 1.5) {
tosubstract = 1.5;
}
mydriver.speedPerc = mydriver.speedPerc - tosubstract;
}
mydriver.fr = mydriver.fr - grdam;
mydriver.br = mydriver.br - grdam;
if (mypresentxPerc > 107) {
mydriver.fl = mydriver.fl - grdam;
mydriver.bl = mydriver.bl - grdam;
}
}
} else if (mypresentxPerc < 8) {
var myspeedP = mydriver.speedPerc;
var grdam = ((myspeedP * maxgrasdamage) / 100);
if (myspeedP > 10) {
var tosubstract = (myspeedP / 10);
if (tosubstract > 1.5) {
tosubstract = 1.5;
}
mydriver.speedPerc = mydriver.speedPerc - tosubstract;
}
mydriver.fl = mydriver.fl - grdam;
mydriver.bl = mydriver.bl - grdam;
if (mypresentxPerc < -7) {
mydriver.fr = mydriver.fr - grdam;
mydriver.br = mydriver.br - grdam;
}
}
};
_global.ailengtharea = 0.021;
_global.aiwidtharea = 19;
driverObject.prototype.autopilot = function (gottendriver, gforce, gottencframe) {
if (!gamestart) {
return(undefined);
}
var gottenforce = gforce;
var mydriver = gottendriver;
if (mydriver.finished) {
driverControl.addspeed(mydriver, -1);
return(undefined);
}
myideal = mydriver.ideal;
var myspeedperc = mydriver.speedperc;
var mymaxstearforce = mydriver.maxstearforce;
var myspeed = myspeedperc;
if (myspeed < 50) {
var prestearforce = ((mydriver.speedperc * mydriver.maxstearforce) / 100);
var stearforce = (prestearforce + 1.7);
} else {
var prestearforce = ((mydriver.speedperc * mydriver.maxstearforce) / 100);
var stearforce = ((mydriver.maxstearforce - prestearforce) + 1.7);
}
myxPerc = mydriver.xPerc;
happyarea = mydriver.hArea;
frblck = mydriver.frontblock;
mycframe = gottencframe;
var mymarker = mydriver.marker;
if ((mymarker == (pitmarker - 1)) || (mymarker == (pitmarker - 2))) {
if (!(mydriver.lastpitstop === mydriver.laps)) {
if (mydriver.laps < maxlaps) {
if (driverControl.chckPitneed(mydriver)) {
if (mydriver.xperc < 100) {
mydriver.xPerc = mydriver.xPerc + stearforce;
if (mydriver.speedPerc > 20) {
driverControl.addspeed(mydriver, -1);
} else {
driverControl.addspeed(mydriver, 1);
}
return(undefined);
}
}
}
}
}
if (mydriver.marker == pitmarker) {
if (!(mydriver.lastpitstop === mydriver.laps)) {
if (mydriver.xperc > 105) {
if (!mydriver.atpitstreet) {
mydriver.atpitstreet = true;
mydriver.speedPerc = 30;
mydriver.startpenalty = MainControl.getmytimer();
mydriver.lastpitstop = mydriver.laps;
driverControl.calcPitPenalty(mydriver);
return(undefined);
}
}
if (mydriver.laps < maxlaps) {
if (driverControl.chckPitneed(mydriver)) {
mydriver.xPerc = mydriver.xPerc + stearforce;
if (mydriver.speedPerc > 20) {
driverControl.addspeed(mydriver, -1);
} else {
driverControl.addspeed(mydriver, 1);
}
return(undefined);
}
}
}
}
driverControl.chckGras(mydriver, myxPerc);
if ((mydriver.marker == _root.startmarker) && (mydriver.laps < 1)) {
mydriver.xPerc = mydriver.xPerc + gforce;
driverControl.addspeed(mydriver, 1);
return(undefined);
}
if (myxPerc < (_global.myleftside + 5)) {
driverControl.$autopilothelper(mydriver, 1, stearforce, gottenforce);
return(undefined);
}
if (myxPerc > (_global.myrightside - 5)) {
driverControl.$autopilothelper(mydriver, -1, stearforce, gottenforce);
return(undefined);
}
if (_global.difflevel == 3) {
var toll1 = 25;
} else if (_global.difflevel == 1) {
var toll1 = 5;
} else {
var toll1 = 13;
}
if ((mycframe > 13) && (mycframe < 37)) {
bkblck = mydriver.backblock;
if (!(bkblck === undefined)) {
if ((myxPerc - toll1) > bkblck) {
driverControl.$autopilothelper(mydriver, -1, stearforce, gottenforce);
return(undefined);
}
if ((myxPerc + toll1) < bkblck) {
driverControl.$autopilothelper(mydriver, 1, stearforce, gottenforce);
return(undefined);
}
}
}
if ((!(mydriver.marker === _root.startmarker)) || (mydriver.laps > 1)) {
if ((myxPerc - happyarea) > myideal) {
driverControl.$autopilothelper(mydriver, -1, stearforce, gottenforce);
return(undefined);
}
if ((myxPerc + happyarea) < myideal) {
driverControl.$autopilothelper(mydriver, 1, stearforce, gottenforce);
return(undefined);
}
}
var myLastAction = mydriver.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
mydriver.lastAction = 0;
driverControl.$autopilothelper(mydriver, -1, stearforce, gottenforce);
return(undefined);
}
if (myLastAction == 1) {
mydriver.lastAction = 0;
driverControl.$autopilothelper(mydriver, 1, stearforce, gottenforce);
return(undefined);
}
if (yxPerc > myideal) {
mydriver.lastAction = -1;
driverControl.$autopilothelper(mydriver, -1, stearforce, gottenforce);
return(undefined);
}
if (myxPerc < myideal) {
mydriver.lastAction = 1;
driverControl.$autopilothelper(mydriver, 1, stearforce, gottenforce);
return(undefined);
}
}
mydriver.xPerc = mydriver.xPerc + gforce;
driverControl.addspeed(mydriver, 1);
};
driverObject.prototype.chckPitneed = function (mydriver) {
if (_global.difflevel == 3) {
var toll1 = 15;
var toll2 = 20;
} else if (_global.difflevel == 1) {
var toll1 = 50;
var toll2 = 55;
} else {
var toll1 = 25;
var toll2 = 35;
}
if (mydriver.fl < toll1) {
return(true);
}
if (mydriver.fr < toll1) {
return(true);
}
if (mydriver.bl < toll1) {
return(true);
}
if (mydriver.br < toll1) {
return(true);
}
if (mydriver.fw < toll2) {
return(true);
}
if (mydriver.bw < toll2) {
return(true);
}
if (mydriver.fu < ((circuitdis * 4) + 2)) {
return(true);
}
if (mydriver.fu < 30) {
return(true);
}
};
driverObject.prototype.calcPitPenalty = function (mydriver) {
if (_global.difflevel == 3) {
var penaltyTime = 2000;
var toll1 = 20;
var toll2 = 25;
var pen1 = 500;
var pen2 = 1500;
} else if (_global.difflevel == 1) {
var toll1 = 55;
var toll2 = 60;
var penaltyTime = 7000;
var pen1 = 2000;
var pen2 = 3000;
} else {
var toll1 = 30;
var toll2 = 40;
var penaltyTime = 5000;
var pen1 = 1000;
var pen2 = 2000;
}
if (mydriver.fu < 100) {
var procent = (100 - mydriver.fu);
var standardpenalty = ((procent * 2000) / 100);
penaltyTime = penaltyTime + (Math.round(Math.random() * pen2) + standardpenalty);
mydriver.fu = 100;
}
if (mydriver.fl < toll1) {
penaltyTime = penaltyTime + (Math.round(Math.random() * 500) + pen1);
mydriver.fl = 100;
}
if (mydriver.fr < toll1) {
penaltyTime = penaltyTime + (Math.round(Math.random() * 500) + pen1);
mydriver.fr = 100;
}
if (mydriver.bl < toll1) {
penaltyTime = penaltyTime + (Math.round(Math.random() * 500) + pen1);
mydriver.bl = 100;
}
if (mydriver.br < toll1) {
penaltyTime = penaltyTime + (Math.round(Math.random() * 500) + pen1);
mydriver.br = 100;
}
if (mydriver.fw < toll2) {
penaltyTime = penaltyTime + (Math.round(Math.random() * 500) + pen2);
mydriver.fw = 100;
}
if (mydriver.bw < toll2) {
penaltyTime = penaltyTime + (Math.round(Math.random() * 500) + pen2);
mydriver.bw = 100;
}
mydriver.penaltyTime = penaltyTime;
trace(("---------penaltytime=" + penaltyTime) + "-----------");
};
driverObject.prototype.$autopilothelper = function (mydriver, myDir, stearforce, force) {
var gottenforce = force;
toaddspeed = 0;
if (!(frblck === undefined)) {
if (frblck < 5) {
toaddspeed = 1;
} else if (mydriver.speedPerc > frblck) {
toaddspeed = -1;
} else if (mydriver.speedPerc < frblck) {
toaddspeed = 1;
}
mydriver.frontblock = undefined;
}
if ((myxPerc < 5) || (myxPerc > 95)) {
} else if ((mycframe < 13) || (mycframe > 37)) {
} else if ((myxPerc > (myideal - happyarea)) && (myxPerc < (myideal + happyarea))) {
} else if (myDir < 0) {
var lfblck = mydriver.leftblock;
var rgblck = mydriver.rightblock;
if ((lfblck == undefined) && (myxPerc > 25)) {
var mydir = -1;
} else if ((rgblck == undefined) && (myxPerc < 75)) {
var mydir = 1;
} else {
var mydir = 0;
var Random = Math.round(Math.random() * 100);
if (Random > 90) {
var Random2 = (-1 + Math.floor(Math.random() * 3));
mydir = Random2;
}
}
} else if (myDir > 0) {
var lfblck = mydriver.leftblock;
var rgblck = mydriver.rightblock;
if ((rgblck == undefined) && (myxPerc < 75)) {
var mydir = 1;
} else if ((lfblck == undefined) && (myxPerc > 25)) {
var mydir = -1;
} else {
var mydir = 0;
var Random = Math.round(Math.random * 100);
if (Random > 90) {
var Random2 = (-1 + Math.floor(Math.random * 3));
mydir = Random2;
}
}
}
mydriver.leftblock = undefined;
mydriver.rightblock = undefined;
mydriver.backblock = undefined;
if (myDir == 0) {
var endstearforce = 0;
mydriver.xPerc = mydriver.xPerc + gforce;
} else {
var endstearforce = (myDir * stearforce);
var forceout = driverControl.calcforceout(endstearforce, gottenforce);
if (forceout) {
toaddspeed = -1;
}
}
if (!(toaddspeed === 0)) {
driverControl.addspeed(mydriver, toaddspeed);
}
var newxPerc = (mydriver.xPerc + (endstearforce + gottenforce));
if (newxPerc > 110) {
newxPerc = 110;
} else if (newxPerc < -10) {
newxPerc = -10;
}
mydriver.xPerc = newxPerc;
};
driverObject.prototype.calcforceout = function (myendstearforce, mygottenforce) {
if (myendstearforce < 0) {
if (mygottenforce <= 0) {
return(false);
}
if ((myendstearforce + mygottenforce) < 0) {
return(false);
}
return(true);
}
if (mygottenforce >= 0) {
return(false);
}
if ((myendstearforce + mygottenforce) > 0) {
return(false);
}
return(true);
};
driverObject.prototype.addspeed = function (mydriver, speedtoadd) {
if (mydriver.finished) {
speedtoadd = -1;
}
if (mydriver.fu <= 0) {
if (mydriver.speedperc > 0) {
mydriver.speedperc = mydriver.speedperc - 0.2;
} else {
mydriver.speedperc = 0;
}
return(undefined);
}
if (speedtoadd > 0) {
if (mydriver.speedperc < 100) {
mydriver.speedperc = mydriver.speedperc + speedtoadd;
} else {
mydriver.speedperc = 100;
}
} else if (mydriver.speedperc > 0) {
mydriver.speedperc = mydriver.speedperc + speedtoadd;
} else {
mydriver.speedperc = 0;
}
};
driverObject.prototype.lap = function (givendriver) {
var mydriver = givendriver;
if (mydriver.speed == 0) {
return(undefined);
}
var dis2 = mydriver.dis2;
if ((mydriver.distance >= dis2) && (!(dis2 === undefined))) {
mydriver.marker = mydriver.marker + 1;
if (mydriver.marker >= (circuit.length - 1)) {
if (!(mydriver.laps === 0)) {
var myendLapTime = MainControl.getmytimer();
var mylastlaptime = ((myendLapTime / 1000) - (mydriver.startLapTime / 1000));
mydriver.endtime = mydriver.endtime + mylastlaptime;
if (mydriver.laps < maxlaps) {
if ((mydriver.bestlaptime == undefined) || (mylastlaptime < mydriver.bestlaptime)) {
mydriver.bestlaptime = mylastlaptime;
}
}
}
driverControl.reset(mydriver);
mydriver.laps = mydriver.laps + 1;
if (mydriver.laps > maxlaps) {
trace("finished " + mydriver.name);
var precircuittime2 = mydriver.endtime;
mydriver.circuittime = precircuittime2;
endlist.push(mydriver.number);
var myposition = endlist.length;
_root["endtime" + myposition] = _root.R_game_mc.timetostring(precircuittime2);
_root["endname" + myposition] = (myposition + ". ") + mydriver.name;
_root["besttime" + myposition] = _root.R_game_mc.timetostring(mydriver.bestlaptime);
mydriver.finished = true;
return(undefined);
}
}
var mymarker = mydriver.marker;
mydriver.dis1 = circuit[mymarker].dis;
mydriver.dis2 = circuit[mymarker + 1].dis;
mydriver.diffdis = mydriver.dis2 - mydriver.dis1;
mydriver.pframe1 = circuit[mymarker].pframe;
mydriver.pframe2 = circuit[mymarker + 1].pframe;
mydriver.diffpframe = mydriver.pframe2 - mydriver.pframe1;
}
var mymarker = mydriver.marker;
if (((mymarker == _global.maininter1) || (mymarker == _global.maininter2)) || (mymarker == _global.maininter3)) {
var mylap = mydriver.laps;
if (mydriver.intermediat == mymarker) {
return(undefined);
}
if (maindriver.finished) {
return(undefined);
}
mydriver.intermediat = mymarker;
var interstatus = _global.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker];
if (interstatus == 3) {
trace("maindriver is driving to far so i won't record my intermediat");
return(undefined);
}
var myendLapTime = MainControl.getmytimer();
var mylastlaptime = ((mydriver.endtime + (myendLapTime / 1000)) - (mydriver.startLapTime / 1000));
if (interstatus == undefined) {
trace("FIRST ONE SO CREATING THE INTERMEDIATARRAY");
_global.Tinterobj[(("intermediatsL" + mylap) + "M") + mymarker] = [];
var myarray = _global.Tinterobj[(("intermediatsL" + mylap) + "M") + mymarker];
myarray.push(mylastlaptime);
_global.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 1;
} else if (interstatus == 1) {
_global.Tinterobj[(("intermediatsL" + mylap) + "M") + mymarker].push(mylastlaptime);
} else {
var driverspast = _global.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker];
_global.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] = _global.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] + 1;
var pasttime = (mylastlaptime - maindriver.intertime);
var toshow = ("+" + _root.R_game_mc.timetostring(pasttime));
var ctarget = _root.R_game_mc[("menu_inter" + driverspast) + "_mc"];
var ctext = _root.R_game_mc[("menu_inter" + driverspast) + "_mc"].mytxt;
_global.changeTextColor(ctarget, 15000804, toshow, ctext);
var ctext = _root.R_game_mc[("menu_inter" + driverspast) + "_mc"].mynumber;
_global.changeTextColor(ctarget, 15000804, driverspast + 1, ctext);
ctarget._visible = true;
if (_global.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] > maxdrivers) {
_global.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 3;
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
var killer = _root.R_game_mc.createEmptyMovieClip("interkiller_mc", 16000);
killer.number = 0;
killer.ctime = 0;
killer.onEnterFrame = function () {
if (this.ctime >= 160) {
_root.R_game_mc.menu_inter_mc._visible = false;
}
if (this.ctime >= 160) {
_root.R_game_mc[("menu_inter" + this.number) + "_mc"]._visible = false;
this.number = this.number + 1;
if (this.number > maxdrivers) {
this.onEnterFrame = undefined;
}
} else {
this.ctime = this.ctime + 1;
}
};
}
trace("driver alredy passed the intermediat, so now i've put it in screen");
}
}
};
driverObject.prototype.initlap = function () {
i = 0;
while (i <= maxdrivers) {
var mydriver = driverObj["driver" + i];
mymarker = mydriver.marker;
mydriver.dis1 = circuit[mymarker].dis;
mydriver.dis2 = circuit[mymarker + 1].dis;
mydriver.diffdis = mydriver.dis2 - mydriver.dis1;
mydriver.pframe1 = circuit[mymarker].pframe;
mydriver.pframe2 = circuit[mymarker + 1].pframe;
mydriver.diffpframe = mydriver.pframe2 - mydriver.pframe1;
i++;
}
};
driverObject.prototype.reset = function (givendriver) {
givendriver.marker = 0;
givendriver.distance = 0;
if (!(givendriver.laps === 0)) {
givendriver.startLapTime = MainControl.getmytimer();
}
};
driverObject.prototype.setshow = function (givendriver) {
var mydriver = givendriver;
var randomNumber = (-1 + Math.round(Math.random() * 2));
var percspeed = ((mydriver.speed * 100) / 400);
_root.R_game_mc.meter_mc._rotation = (((percspeed * 160) / 100) + 10) + randomNumber;
if (givendriver.finished) {
trace("finished");
return(undefined);
}
if (!(startLapTime === undefined)) {
endLapTime = MainControl.getmytimer();
_global.laptime = (endLapTime / 1000) - (startLapTime / 1000);
_root.showlaptime = _root.R_game_mc.timetostring(laptime);
}
var preshow = String((("position : " + _root.position) + " / ") + (maxdrivers + 1));
_root.showposition = String(preshow);
var fl = mydriver.fl;
var fr = mydriver.fr;
var bl = mydriver.bl;
var br = mydriver.br;
var bw = mydriver.bw;
var fw = mydriver.fw;
_root.R_game_mc.fl_mc.pointer_mc._x = (fl * 119) / 100;
_root.R_game_mc.fr_mc.pointer_mc._x = (fr * 119) / 100;
_root.R_game_mc.bl_mc.pointer_mc._x = (bl * 119) / 100;
_root.R_game_mc.br_mc.pointer_mc._x = (br * 119) / 100;
var fu = mydriver.fu;
var fuelmc = _root.R_game_mc.menu_fuel_mc;
fuelmc.pointer_mc._x = (fu * 132) / 100;
fuelmc.fuel_mc.submask_mc._x = -130 + ((fu * 130) / 100);
var overall = _root.R_game_mc.menu_overall_mc;
overall.fl_mc._alpha = 100 - fl;
overall.fr_mc._alpha = 100 - fr;
overall.bl_mc._alpha = 100 - bl;
overall.br_mc._alpha = 100 - br;
overall.fw_mc._alpha = 100 - fw;
overall.bw_mc._alpha = 100 - bw;
if (fl < 20) {
if (fl <= 0) {
overall.fl_mc.gotoAndStop(2);
} else {
overall.fl_mc.sub_mc.play();
}
}
if (fr < 20) {
if (fr <= 0) {
overall.fr_mc.gotoAndStop(2);
} else {
overall.fr_mc.sub_mc.play();
}
}
if (bl < 20) {
if (bl <= 0) {
overall.bl_mc.gotoAndStop(2);
} else {
overall.bl_mc.sub_mc.play();
}
}
if (br < 20) {
if (br <= 0) {
overall.br_mc.gotoAndStop(2);
} else {
overall.br_mc.sub_mc.play();
}
}
if (fw < 20) {
if (fw <= 0) {
overall.fw_mc.gotoAndStop(2);
} else {
overall.fw_mc.sub_mc.play();
}
}
if (bw < 20) {
if (bw <= 0) {
overall.bw_mc.gotoAndStop(2);
} else {
overall.bw_mc.sub_mc.play();
}
}
};
driverObject.prototype.chckCorner = function (givendriver, extradis) {
var mydriver = givendriver;
var dis1 = mydriver.dis1;
var diffdis = mydriver.diffdis;
var pframe1 = mydriver.pframe1;
var diffpframe = mydriver.diffpframe;
var elapsed = ((mydriver.distance + extradis) - dis1);
var diffdisperc = ((elapsed * 100) / diffdis);
var elapsedframe = ((diffdisperc * diffpframe) / 100);
var tframe = Math.round(pframe1 + elapsedframe);
if (tframe > 50) {
tframe = 50;
} else if (tframe < 1) {
tframe = 1;
}
return(tframe);
};
driverObject.prototype.calPos = function (gottenDriver, gottenDis) {
hectaPerc = (gottenDis * 100) / horizone;
preMyHecta = (hectaPerc * hectamax) / 100;
myHecta = Math.round(preMyHecta);
percDiff = preMyHecta - myHecta;
if (myHecta < preMyHecta) {
var positive = 1;
nextmyHecta = myHecta + 1;
} else if (myHecta > preMyHecta) {
var positive = -1;
percDiff = percDiff * -1;
nextmyHecta = myHecta - 1;
}
var hectaLx = _root.R_game_mc.hectaTotal_mc["hectaL" + myHecta]._x;
var hectaRx = _root.R_game_mc.hectaTotal_mc["hectaR" + myHecta]._x;
var hectaLy = _root.R_game_mc.hectaTotal_mc["hectaL" + myHecta]._y;
var hectaLx2 = _root.R_game_mc.hectaTotal_mc["hectaL" + nextmyHecta]._x;
var hectaRx2 = _root.R_game_mc.hectaTotal_mc["hectaR" + nextmyHecta]._x;
var hectaLy2 = _root.R_game_mc.hectaTotal_mc["hectaL" + nextmyHecta]._y;
var percDiffto100 = ((percDiff * 100) / hectamax);
var tussen = (hectaLy - hectaLy2);
if (tussen < 0) {
tussen = tussen * -1;
}
var extraY = ((percDiffto100 * tussen) / 100);
var xPerc = gottenDriver.xPerc;
var maxperc = (hectaRx - hectaLx);
var xNum = ((xPerc * maxperc) / 100);
var xPos = (hectaLx + xNum);
var yPos = hectaLy;
var maxperc2 = (hectaRx2 - hectaLx2);
var xNum2 = ((xPerc * maxperc2) / 100);
var xPos2 = (hectaLx2 + xNum2);
var tussen2 = (xPos2 - xPos);
var extraX = ((percDiff * tussen2) / 100);
var tempscale = (100 - hectaPerc);
if (tempscale < 0) {
tempscale = 0;
}
if (gottenDriver.mc == driverObj.finish.mc) {
gottenDriver.mc._width = maxperc;
gottenDriver.mc._yscale = tempscale;
gottenDriver.mc._x = hectaLx;
gottenDriver.mc._y = yPos + (extraY * positive);
return(undefined);
}
gottenDriver.mc._x = xPos + extraX;
gottenDriver.mc._y = yPos + (extraY * positive);
gottenDriver.mc._xscale = tempscale;
gottenDriver.mc._yscale = tempscale;
if (!(gottenDriver.linkname === undefined)) {
return(undefined);
}
var degreeHecta = (myHecta + 5);
if (hectamax > 45) {
var degreeX = _root.R_game_mc.hectaTotal_mc.hectaM._x;
var degreeY = _root.R_game_mc.hectaTotal_mc.hectaM._y;
var mydegree = driverControl.calcAngle(gottenDriver.mc, degreeX, degreeY);
} else {
var hectaLx = _root.R_game_mc.hectaTotal_mc["hectaL" + degreeHecta]._x;
var hectaRx = _root.R_game_mc.hectaTotal_mc["hectaR" + degreeHecta]._x;
var xPerc = gottenDriver.xPerc;
var maxperc = (hectaRx - hectaLx);
var xNum = ((xPerc * maxperc) / 100);
var degreeX = (hectaLx + xNum);
var degreeY = _root.R_game_mc.hectaTotal_mc["hectaL" + degreeHecta]._y;
var mydegree = driverControl.calcAngle(gottenDriver.mc, degreeX, degreeY);
}
gottenDriver.angle = mydegree;
gottenDriver.mytargetframe = driverControl.calcAngleFrame(mydegree);
gottenDriver.mc.car_main_mc.gotoAndStop(gottenDriver.mytargetframe);
gottenDriver.mc.car_main_mc.body_mc.gotoAndStop(gottenDriver.mytargetframe);
};
driverObject.prototype.calcAngle = function (gottenmc, degreeX, degreeY) {
aanliggend = gottenmc._y - degreeY;
overstaande = degreeX - gottenmc._x;
radians = Math.atan2(overstaande, aanliggend);
degrees = Math.round((radians * 180) / Math.PI);
return(degrees);
};
driverObject.prototype.calcAngleFrame = function (angle) {
if (angle >= 0) {
angleperc = (angle * 100) / 80;
var targetframe = (8 + Math.round((angleperc * 8) / 100));
} else if (angle < 0) {
angleperc = (angle * 100) / -80;
var targetframe = (8 - Math.round((angleperc * 8) / 100));
if (targetframe < 1) {
targetframe = 1;
}
}
return(targetframe);
};
_global.maxmaxforce = 2.8;
driverObject.prototype.calcForce = function (gottendriver, gottencturn) {
var cturn = (gottencturn - 25);
if (cturn < 0) {
var turnperc = ((cturn * 100) / -25);
var balance = 1;
} else {
var turnperc = ((cturn * 100) / 25);
var balance = -1;
}
var maxforce = ((gottendriver.speedperc * maxmaxforce) / 100);
var preforce = ((turnperc * maxforce) / 100);
var force = (balance * preforce);
var crashforce = driverControl.crashforce(gottendriver);
force = force + crashforce;
return(force);
};
_global.carwidth = 18;
_global.carlength = 0.00375;
_global.carlength2 = 0.0035;
_global.negcarlength = -0.0035;
_global.negcarlength2 = -0.0035;
driverObject.prototype.depthsorter = function () {
inscreenlength = inscreen.length - 1;
if (inscreen.length > 0) {
inscreen.sort(driverControl.$helperdepthsorter);
i = 0;
while (i <= inscreenlength) {
inscreen[i].mc.swapDepths((1000 + ((maxdrivers + 1) * i)) + inscreen[i].number);
i++;
}
}
};
driverObject.prototype.$helperdepthsorter = function (a, b) {
if (a == b) {
return(0);
}
var adistance = a.distance;
var bdistance = b.distance;
var diff = (adistance - bdistance);
if ((diff > negcarlength2) && (diff < carlength2)) {
var averschil = a.angle;
var bverschil = b.angle;
if (averschil < 0) {
averschil = averschil * -1;
}
if (bverschil < 0) {
bverschil = bverschil * -1;
}
if (averschil > bverschil) {
return(-1);
}
return(1);
}
if (adistance < bdistance) {
return(1);
}
if (bdistance < adistance) {
return(-1);
}
return(0);
};
driverObject.prototype.crashsorter = function () {
totaldrivers.sort(driverControl.$helpercrashsorter);
};
driverObject.prototype.$helpercrashsorter = function (a, b) {
if (!(a.marker === b.marker)) {
return(0);
}
if (a.finished) {
return(0);
}
if (b.finished) {
return(0);
}
if (a.atpitstreet) {
return(0);
}
if (b.atpitstreet) {
return(0);
}
adistance = a.distance;
bdistance = b.distance;
if (adistance > bdistance) {
var c = a;
a = b;
b = c;
adistance = a.distance;
bdistance = b.distance;
}
diff = bdistance - adistance;
if (diff < ailengtharea) {
axPerc = a.xPerc;
bxPerc = b.xPerc;
diffx = axPerc - bxPerc;
if ((diffx > (-carwidth)) && (diffx < carwidth)) {
a.frontblock = b.speedPerc;
}
if ((diffx > (-aiwidtharea)) && (diffx < aiwidtharea)) {
b.backblock = axPerc;
}
}
if (diff < carlength) {
if ((diffx > (-aiwidtharea)) && (diffx < aiwidtharea)) {
if (axPerc < bxPerc) {
a.rightblock = bxPerc;
b.leftblock = axPerc;
} else {
a.leftblock = bxPerc;
b.rightblock = axPerc;
}
}
if ((diffx > (-carwidth)) && (diffx < carwidth)) {
var cspeed = a.speedPerc;
if (cspeed <= 0) {
var cspeed = b.speedPerc;
if (cspeed <= 0) {
cspeed = 10;
}
}
var cspeed2 = (cspeed * 0.5);
aoldxPerc = a.oldxPerc;
boldxPerc = b.oldxPerc;
olddiffx = aoldxPerc - boldxPerc;
if ((olddiffx > (-carwidth)) && (olddiffx < carwidth)) {
} else {
if (aoldxPerc < boldxPerc) {
a.crashperc = a.crashperc - cspeed;
b.crashperc = b.crashperc + cspeed;
} else {
a.crashperc = a.crashperc + cspeed;
b.crashperc = b.crashperc - cspeed;
}
driverControl.CrashCorrectorX(a, b);
return(0);
}
aolddistance = a.olddistance;
bolddistance = b.olddistance;
olddiff = aolddistance - bolddistance;
if ((olddiff > negcarlength) && (olddiff < carlength)) {
if (aoldxPerc < boldxPerc) {
a.crashperc = a.crashperc - cspeed;
b.crashperc = b.crashperc + cspeed;
} else {
a.crashperc = a.crashperc + cspeed;
b.crashperc = b.crashperc - cspeed;
}
driverControl.CrashCorrectorX(a, b);
return(0);
}
a.speedperc = a.speedperc - cspeed2;
b.speedperc = b.speedperc + cspeed2;
driverControl.CrashCorrectorY(a, b);
return(0);
}
}
return(0);
};
driverObject.prototype.CrashCorrectorX = function (a, b) {
var diff = (adistance - (maindriver.distance - 0.005));
if ((diff > -0.01) && (diff < horizone)) {
soundvolume = Math.round((diff * 150) / horizone);
if (soundvolume < 0) {
soundvolume = soundvolume * -1;
}
soundvolume = 100 - soundvolume;
if (soundvolume > 100) {
soundvolume = 100;
} else if (soundvolume < 0) {
soundvolume = 0;
}
_root.crash.start();
_root.crash.setvolume(soundvolume);
}
var posdiffY = (bdistance - adistance);
var overlapY = (carlength - posdiffY);
if (axPerc <= bxPerc) {
var posdiff = (bxPerc - axPerc);
var overlap = (carwidth - posdiff);
a.oldxPerc = a.oldxPerc - overlap;
b.oldxPerc = b.oldxPerc + overlap;
a.xPerc = a.xPerc - overlap;
b.xPerc = b.xPerc + overlap;
var mydamage = (overlap * 10);
if (overlapY < 0.0005) {
a.fw = a.fw - mydamage;
b.bw = b.bw - mydamage;
return(undefined);
}
if (overlapY < 0.0035) {
a.fr = a.fr - mydamage;
b.bl = b.bl - mydamage;
return(undefined);
}
if (overlapY > 0.0035) {
a.fr = a.fr - mydamage;
a.br = a.br - mydamage;
b.fl = b.fl - mydamage;
b.bl = b.bl - mydamage;
return(undefined);
}
} else {
var posdiff = (axPerc - bxPerc);
var overlap = (carwidth - posdiff);
a.xPerc = a.xPerc + overlap;
b.xPerc = b.xPerc - overlap;
var mydamage = (overlap * 10);
if (overlapY < 5E-5) {
a.fw = a.fw - mydamage;
b.bw = b.bw - mydamage;
return(undefined);
}
if (overlapY < 0.0035) {
a.fl = a.fl - mydamage;
b.br = b.br - mydamage;
return(undefined);
}
if (overlapY > 0.0035) {
a.fl = a.fl - mydamage;
a.bl = a.bl - mydamage;
b.fr = b.fr - mydamage;
b.br = b.br - mydamage;
return(undefined);
}
}
};
driverObject.prototype.CrashCorrectorY = function (a, b) {
var diff = (adistance - (maindriver.distance - 0.005));
if ((diff > -0.01) && (diff < horizone)) {
soundvolume = Math.round((diff * 150) / horizone);
if (soundvolume < 0) {
soundvolume = soundvolume * -1;
}
soundvolume = 100 - soundvolume;
if (soundvolume > 100) {
soundvolume = 100;
} else if (soundvolume < 0) {
soundvolume = 0;
}
_root.crash.start();
_root.crash.setvolume(soundvolume);
}
var posdiffY = (bdistance - adistance);
var overlapY = (carlength - posdiffY);
a.distance = a.distance - overlapY;
b.distance = b.distance + overlapY;
var mydamage = (overlapY * 100000);
a.fw = a.fw - mydamage;
b.bw = b.bw - mydamage;
};
_global.maxcrashforce = 2;
driverObject.prototype.crashforce = function (driver) {
var crashperc = driver.crashperc;
if ((crashperc == 0) || (crashperc == undefined)) {
return(0);
}
if (crashperc > 100) {
crashperc = 100;
}
if (crashperc < -100) {
crashperc = -100;
}
if (crashperc < 0) {
crashperc = crashperc + 1;
var balance = -1;
} else {
crashperc = crashperc - 1;
var balance = 1;
}
var crashperc2 = (crashperc * balance);
var preforce = ((crashperc2 * maxcrashforce) / 100);
var force = (preforce * balance);
driver.crashperc = crashperc;
return(force);
};
_root.R_game_mc.timetostring = function (gottentime) {
m = 0;
prelaptime = Number(gottentime);
while (prelaptime >= 60) {
m = m + 1;
prelaptime = prelaptime - 60;
}
laptime2 = math.round(prelaptime * 1000);
laptime3 = laptime2 / 1000;
var differenceRound = String(laptime3);
spotdot = differenceRound.lastIndexOf(".");
stringlength = differenceRound.length;
if (spotdot == -1) {
differenceRound = differenceRound + ".000";
} else if ((stringlength - spotdot) == 2) {
differenceRound = differenceRound + "00";
} else if ((stringlength - spotdot) == 3) {
differenceRound = differenceRound + "0";
}
if (spotdot == 1) {
differenceRound = "0" + differenceRound;
}
var toshow = ((String(m) + ":") + String(differenceRound));
return(toshow);
};
signObject = function () {
ASBroadcaster.initialize(this);
_global.sign = [];
_global.cSign = 0;
var circuitlength = circuit.length;
if (circuitlength <= 0) {
trace("circuit is empty, so no signs has been placed");
return(undefined);
}
i = 0;
while (i < circuitlength) {
var dir = circuit[i].dir;
if (dir == 0) {
} else {
pframe1 = circuit[i].pframe;
pframe2 = circuit[i + 1].pframe;
diffpframe = pframe2 - pframe1;
diffpframe = diffpframe * dir;
if (pframe2 == 0) {
} else {
var step = 0;
if (diffpframe < 10) {
} else {
dis1 = circuit[i].dis;
dis2 = circuit[i + 1].dis;
diffdis = dis2 - dis1;
if ((diffpframe >= 10) && (diffpframe < 20)) {
if (diffdis < 0.01) {
step = 3;
} else if (diffdis < 0.02) {
step = 2;
} else {
step = 1;
}
} else if ((diffpframe >= 20) && (diffpframe < 35)) {
if (diffdis < 0.02) {
step = 3;
} else if (diffdis < 0.05) {
step = 2;
} else {
step = 1;
}
} else if (diffpframe >= 35) {
if (diffdis < 0.02) {
step = 3;
} else if (diffdis < 0.05) {
step = 2;
} else {
step = 1;
}
}
var prerandomNumber = Math.round(Math.random() * 35);
var randomNumber = (prerandomNumber / 1000);
var signdis = (circuit[i].dis - randomNumber);
if (dir > 0) {
var xPerc = 130;
var dirname = "right";
} else {
var xPerc = -30;
var dirname = "left";
}
var signname = (("sign" + dirname) + String(step));
sign.push({distance:signdis, xPerc:xPerc, linkname:signname});
}
}
}
i++;
}
var signname = "signpit";
var signdis = (_root.pitdisstart - 0.04);
sign.push({distance:signdis, xPerc:130, linkname:signname});
i = 0;
while (i <= 2) {
signdis = signdis + 0.05;
if (signdis >= (_root.pitdisstart - 0.03)) {
} else {
var xPerc = 130;
sign.push({distance:signdis, xPerc:130, linkname:signname});
}
i++;
}
_global.signlength = sign.length;
};
signObject.prototype.chckInscreen = function (lookdriver) {
var k = cSign;
var driver = sign[k];
var objDistance = (driver.distance - lookdriver.distance);
if ((objDistance > 0) && (objDistance < horizone)) {
if (driver.mc == undefined) {
var targetlinkname = driver.linkname;
driver.mc = _root.R_game_mc.prop_holder_mc.attachMovie(targetlinkname, "sign_mc" + k, _global.getmydepth);
driver.mc._alpha = 80;
driver.mc.driver = driver;
driver.mc.myhandle = function () {
var objDistance = (this.driver.distance - lookdriver.distance);
if ((objDistance > -0.0002) && (objDistance < horizone)) {
driverControl.calPos(driver, objDistance);
} else {
driver.mc = undefined;
this.removeMovieClip();
}
};
this.addListener(driver.mc);
}
cSign = cSign + 1;
if (cSign >= signlength) {
cSign = 0;
}
}
this.broadcastMessage("myhandle");
};
_global.availableprops = [6, 6, 6, 6, 6, 6, 4, 5];
_global.numberprops = 50;
propObject = function () {
ASBroadcaster.initialize(this);
_global.prop = [];
_global.cprop = 0;
var Apropslength = _global.availableprops.length;
var maxnumberprops = _global.numberprops;
if (((Apropslength <= 0) || (maxnumberprops == 0)) || (maxnumberprops == undefined)) {
trace("circuit is empty, so no prop has been placed");
return(undefined);
}
var circuitlength = (circuit[circuit.length - 1].dis - 0.35);
var propcount = 0;
var lastdistance = 0.03;
i = 0;
while (i < maxnumberprops) {
var dir = Math.floor(Math.random() * 2);
precircuitlength = (circuitlength - lastdistance) * 1000;
var torandom = (precircuitlength / (maxnumberprops - propcount));
var randomNumber = Math.round(Math.random() * torandom);
var propdis = (lastdistance + (randomNumber / 1000));
var randomxperc = Math.round(Math.random() * 12);
if (dir > 0) {
var xPerc = (130 + randomxperc);
var dirname = "right";
} else {
var xPerc = (-30 - randomxperc);
var dirname = "left";
}
var randomnumber = Math.floor(Math.random() * Apropslength);
var propnumber = _global.availableprops[randomnumber];
var propname = ("prop" + _global.availableprops[randomnumber]);
if (xPerc > 100) {
if (propnumber == 12) {
propname = ("prop" + _global.availableprops[randomnumber]) + "b";
}
}
prop.push({distance:propdis, xPerc:xPerc, linkname:propname});
propcount = propcount + 1;
lastdistance = propdis;
i++;
}
_global.proplength = prop.length;
};
propObject.prototype.chckInscreen = function (lookdriver) {
var k = cprop;
var driver = prop[k];
var objDistance = (driver.distance - lookdriver.distance);
if ((objDistance > 0) && (objDistance < horizone)) {
if (driver.mc == undefined) {
var targetlinkname = driver.linkname;
driver.mc = _root.R_game_mc.prop_holder_mc.attachMovie(targetlinkname, "prop_mc" + k, _global.getmydepth());
driver.mc._alpha = 70;
driver.mc.driver = driver;
driver.mc.myhandle = function () {
var objDistance = (this.driver.distance - lookdriver.distance);
if ((objDistance > -0.0002) && (objDistance < horizone)) {
driverControl.calPos(driver, objDistance);
} else {
driver.mc = undefined;
this.removeMovieClip();
}
};
this.addListener(driver.mc);
}
cprop = cprop + 1;
if (cprop >= proplength) {
cprop = 0;
}
}
this.broadcastMessage("myhandle");
};
_root.maindepth = 1500;
_global.getmydepth = function () {
_root.maindepth = _root.maindepth - 1;
if (_root.maindepth < 1) {
_root.maindepth = 1500;
}
return(_root.maindepth);
};
startSpotObject = function () {
if (_global.develop) {
return(undefined);
}
ASBroadcaster.initialize(this);
_global.startspot = [];
_global.cStartspot = 0;
if (maxdrivers <= 0) {
trace("maxdrivers is 0, so no startspots has been placed");
return(undefined);
}
var driver = driverObj["driver" + maxdrivers];
var startposition = driverObj.finish.distance;
var xperc = 30;
var spot = (startposition - 0.01);
driver.distance = spot - 0.007;
driver.marker = circuit.length - 2;
driver.xPerc = xperc;
if (xperc == 30) {
var signname = "spotLeft";
} else {
var signname = "spotRight";
}
startspot.push({distance:spot, xPerc:xPerc, linkname:signname});
startspot.push({distance:spot - 0.0045, xPerc:xPerc, linkname:signname});
i = 1;
while (i <= maxdrivers) {
var lastspot = ((i * 2) - 1);
var startposition = startspot[lastspot].distance;
var startxperc = startspot[lastspot].xperc;
var spot = (startposition - 0.002);
var driver = driverObj["driver" + (maxdrivers - i)];
driver.marker = circuit.length - 2;
_root.startmarker = circuit.length - 2;
driver.distance = spot - 0.007;
if (startxperc == 30) {
var xperc = 70;
var signname = "spotRight";
} else {
var xperc = 30;
var signname = "spotLeft";
}
driver.xPerc = xperc;
startspot.push({distance:spot, xPerc:xPerc, linkname:signname});
startspot.push({distance:spot - 0.0045, xPerc:xPerc, linkname:signname});
i++;
}
trace("--------------------");
_global.startSpotlength = startspot.length;
_global.startspot2 = [];
i = startSpotlength - 1;
while (i >= 0) {
var distance2 = startspot[i].distance;
var xPerc2 = startspot[i].xPerc;
var linkname2 = startspot[i].linkname;
startspot2.push({distance:distance2, xPerc:xPerc2, linkname:linkname2});
i--;
}
_global.startSpotlength = startspot2.length;
};
startSpotObject.prototype.checkmarker = function (gottendis) {
var circuitl = (circuit.length - 1);
j = circuitl;
while (j > 0) {
var olddis = circuit[j].dis;
if (olddis > gottendis) {
} else {
return(k);
}
j--;
}
};
startSpotObject.prototype.chckInscreen = function (lookdriver) {
var k = cStartspot;
var driver = startspot2[k];
var objDistance = (driver.distance - lookdriver.distance);
if ((objDistance > -0.005) && (objDistance < horizone)) {
if (driver.mc == undefined) {
var targetlinkname = driver.linkname;
driver.mc = _root.R_game_mc.startspot_holder_mc.attachMovie(targetlinkname, "startspot_mc" + k, 1000 + k);
driver.mc.driver = driver;
driver.mc.myhandle = function () {
var objDistance = (this.driver.distance - lookdriver.distance);
if ((objDistance > -0.003) && (objDistance < horizone)) {
driverControl.calPos(driver, objDistance);
} else {
driver.mc = undefined;
this.removeMovieClip();
}
};
this.addListener(driver.mc);
}
cStartspot = cStartspot + 1;
if (cStartspot >= startSpotlength) {
cStartspot = 0;
}
}
this.broadcastMessage("myhandle");
};
SoundObject = function () {
_global.cont6dur = 3000;
_global.downdur = 5700;
_global.updur = 5700;
_global.cont1dur = 1900;
_global.downstart = 0;
_global.upstart = 0;
_global.cont1start = 0;
_global.cont2start = 0;
_global.cont3start = 0;
_global.cont4start = 0;
_global.cont5start = 0;
_global.cont6start = 0;
this.createSound(driverObj.driver0);
};
SoundObject.prototype.createSound = function (driver) {
var mynumber = driver.number;
target = _root.Soundfx_holder_mc.createEmptyMovieClip("soundx" + mynumber, mynumber);
driver.soundPath = target;
target.cont1 = new Sound();
target.cont1.attachSound("cont1");
target.cont2 = new Sound();
target.cont2.attachSound("cont2");
target.cont3 = new Sound();
target.cont3.attachSound("cont3");
target.cont4 = new Sound();
target.cont4.attachSound("cont4");
target.cont5 = new Sound();
target.cont5.attachSound("cont5");
target.cont6 = new Sound();
target.cont6.attachSound("cont6");
target.down = new Sound();
target.down.attachSound("down");
target.up = new Sound();
target.up.attachSound("up");
_root.crash = new Sound();
_root.crash.attachSound("crash");
};
SoundObject.prototype.manageSound = function (driver, oldspeedperc, speedperc, objDistance, objDistancelap) {
if ((objDistance > -0.08) && (objDistance < 0.08)) {
soundvolume = Math.round((objDistance * 100) / 0.08);
if (soundvolume < 0) {
soundvolume = soundvolume * -1;
}
soundvolume = 100 - soundvolume;
if (soundvolume > 100) {
soundvolume = 100;
} else if (soundvolume < 0) {
soundvolume = 0;
}
SoundControl.chckSound(driver, oldspeedperc, speedperc, soundvolume);
} else if ((objDistancelap > -0.08) && (objDistancelap < 0.08)) {
soundvolume = Math.round((objDistance * 100) / 0.08);
if (soundvolume < 0) {
soundvolume = soundvolume * -1;
}
soundvolume = 100 - soundvolume;
if (soundvolume > 100) {
soundvolume = 100;
} else if (soundvolume < 0) {
soundvolume = 0;
}
SoundControl.chckSound(driver, oldspeedperc, speedperc, soundvolume);
} else {
SoundControl.stopSound(driver);
}
};
SoundObject.prototype.chckSound = function (driver, oldspeedperc, speedperc, soundvolume) {
var mycSound = driver.cSound;
soundvolume = _root.targetsound;
driver.soundPath[mycSound].setvolume(soundvolume);
if (speedperc >= 98) {
driver.oldsound = "cont6";
if (!(mycSound === "cont6")) {
this.startSound(driver, mycSound, "cont6", 1, soundvolume);
}
return(undefined);
}
if (speedperc <= 0) {
driver.oldsound = "cont1";
if (!(mycSound === "cont1")) {
this.startSound(driver, mycSound, "cont1", 1, soundvolume);
}
return(undefined);
}
if (speedperc > oldspeedperc) {
if (driver.oldsound == "up") {
driver.soundtimer = driver.soundtimer + 1;
} else {
driver.oldsound = "up";
driver.soundtimer = 1;
var soundnumber = (Math.round((speedperc * 5) / 100) + 1);
if (soundnumber == 6) {
soundnumber = 5;
}
var myword = ("cont" + String(soundnumber));
if (!(mycSound === String(myword))) {
this.startSound(driver, mycSound, String(myword), 1, soundvolume);
}
return(undefined);
}
if (driver.soundtimer > 10) {
if (!(mycSound === "up")) {
var pretime = ((speedperc * updur) / 100);
_global.upstart = pretime / 1000;
this.startSound(driver, mycSound, "up", 0, soundvolume);
}
return(undefined);
}
return(undefined);
}
if (speedperc < oldspeedperc) {
if (driver.oldsound == "down") {
driver.soundtimer = driver.soundtimer + 1;
} else {
driver.oldsound = "down";
driver.soundtimer = 1;
var soundnumber = (Math.round((speedperc * 5) / 100) + 1);
if (soundnumber == 6) {
soundnumber = 5;
}
var myword = ("cont" + String(soundnumber));
if (!(mycSound === String(myword))) {
this.startSound(driver, mycSound, String(myword), 1, soundvolume);
}
return(undefined);
}
if (driver.soundtimer > 10) {
if (!(mycSound === "down")) {
procent = 100 - speedperc;
var pretime = ((procent * downdur) / 100);
_global.downstart = pretime / 1000;
this.startSound(driver, mycSound, "down", 0, soundvolume);
}
return(undefined);
}
return(undefined);
}
};
SoundObject.prototype.startSound = function (driver, mycSound, mysound, toloop, soundvolume) {
if (toloop) {
var loop = 999;
} else {
loop = 0;
}
var target = driver.soundPath;
target[mycSound].stop();
target[mysound].start(0, loop);
driver.cSound = mysound;
driver.soundPath[mysound].setvolume(soundvolume);
};
SoundObject.prototype.stopSound = function (driver) {
var target = driver.soundPath;
target[driver.cSound].stop();
driver.cSound = undefined;
};
_global.changeTextColor = function (currenttarget, mycolor, ctext, textfield) {
textfield.text = ctext;
currenttarget.myformat = new TextFormat();
currenttarget.myformat.color = mycolor;
textfield.setTextFormat(currenttarget.myformat);
};
_global.startRace = function () {
var startTime = MainControl.getmytimer();
i = 1;
while (i <= maxdrivers) {
var driver = driverObj["driver" + i];
driver.startLapTime = startTime;
i++;
}
i = 1;
while (i <= 9) {
_root["endname" + i] = undefined;
_root["endtime" + i] = undefined;
_root["besttime" + i] = undefined;
i++;
}
_root.ambiance_mc.gotoAndPlay(2);
_global.gameStart = true;
_global.circuitStartTime = startTime;
_global.startLapTime = startTime;
};
_global.setstyle = function () {
var driver = _root.R_game_mc.main_mc.grass_mc;
var ctargetbody = _root.R_game_mc.main_mc.grass_mc;
driver.myColor = new Color(ctargetbody);
driver.myColorTransform = new Object();
var myCT = driver.myColorTransform;
myCT.ra = myStyleColor[0];
myCT.rb = myStyleColor[1];
myCT.ga = myStyleColor[2];
myCT.gb = myStyleColor[3];
myCT.ba = myStyleColor[4];
myCT.bb = myStyleColor[5];
myCT.aa = myStyleColor[6];
myCT.ab = myStyleColor[7];
driver.myColor.setTransform(myCT);
};
setstyle();
MainObject = function () {
_root.maintimer = 0;
_root.mainpittimer = 0;
_root.mainctime = 1;
};
MainObject.prototype.getmytimer = function () {
return(_root.maintimer);
};
MainObject.prototype.getmypittimer = function () {
return(_root.mainpittimer);
};
MainObject.prototype.setmytimer = function (toadd) {
_root.maintimer = _root.maintimer + toadd;
};
MainObject.prototype.ControlGame = function () {
if (!gamestart) {
return(undefined);
}
if (driverObj.driver0.atpitstreet) {
if (TimeControl.timePaused) {
return(undefined);
}
if (_root.mainctime >= 4) {
_root.mainctime = 1;
} else {
_root.mainctime = _root.mainctime + 1;
return(undefined);
}
}
this.setmytimer(33);
driverControl.manageEnemies();
};
_global.driverControl = new driverObject();
_global.MainControl = new MainObject();
_global.signControl = new signObject();
_global.propControl = new propObject();
_global.startspotControl = new startspotObject();
_global.SoundControl = new SoundObject();
driverInterval = setInterval(MainControl, "ControlGame", 7);
driverControl.initlap();
_root.showlap = "Lap 0 / " + maxlaps;
initcolor();
_global.totaldrivers = [];
i = 0;
while (i <= maxdrivers) {
var driver = driverObj["driver" + i];
driver.intermediat = 0;
driver.interlap = 0;
driver.fl = 100;
driver.bl = 100;
driver.fr = 100;
driver.br = 100;
driver.fw = 100;
driver.bw = 100;
driver.fu = 100;
totaldrivers.push(driver);
if (_global.difflevel == 3) {
driver.hArea = (Math.random() * 5) + 3;
} else if (_global.difflevel == 1) {
driver.hArea = (Math.random() * 13) + 10;
} else {
driver.hArea = (Math.random() * 9) + 7;
}
i++;
}
_root.R_game_mc.menu_inter_mc._visible = false;
i = 0;
while (i <= 9) {
_root.R_game_mc[("menu_inter" + i) + "_mc"]._visible = false;
i++;
}
_root.setshop_tuning_Cpu = function (driver, boughtlevel) {
var boughtstearforce = 0;
boughtstearforce = boughtstearforce + _global.boughsteararraya[boughtlevel];
boughtstearforce = boughtstearforce + _global.boughsteararrayb[boughtlevel];
boughtstearforce = boughtstearforce + _global.boughsteararrayc[boughtlevel];
driver.orig_maxstearforce = driver.orig_maxstearforce + boughtstearforce;
var boughtspeed = 0;
boughtspeed = boughtspeed + _global.boughspeedarraya[boughtlevel];
boughtspeed = boughtspeed + _global.boughspeedarrayb[boughtlevel];
boughtspeed = boughtspeed + _global.boughspeedarrayc[boughtlevel];
boughtspeed = boughtspeed + _global.boughspeedarrayd[boughtlevel];
driver.orig_speedmax = driver.orig_speedmax + boughtspeed;
};
_root.setdifficulty = function () {
if (_global.difflevel == 3) {
_global.tireloseNum = 4;
var boughtlevel = 2;
} else if (_global.difflevel == 1) {
_global.tireloseNum = 3;
var boughtlevel = 0;
} else {
_global.tireloseNum = 2;
var boughtlevel = 1;
}
i = 0;
while (i <= maxdrivers) {
var driver = driverObj["driver" + i];
driver.fu_use = 4;
driver.tire_use = _global.tireloseNum;
i++;
}
if (!(_global.difflevel === 1)) {
i = 1;
while (i <= maxdrivers) {
var driver = driverObj["driver" + i];
_root.setshop_tuning_Cpu(driver, boughtlevel);
i++;
}
}
};
_root.setdifficulty();
_root.setshop_tuning = function () {
var driver = driverObj.driver0;
driver.fu = 40;
var boughtstearforce = 0;
boughtstearforce = boughtstearforce + _global.boughsteararraya[_global.boughta];
boughtstearforce = boughtstearforce + _global.boughsteararrayb[_global.boughtb];
boughtstearforce = boughtstearforce + _global.boughsteararrayc[_global.boughtc];
driver.orig_maxstearforce = driver.orig_maxstearforce + boughtstearforce;
var boughtspeed = 0;
boughtspeed = boughtspeed + _global.boughspeedarraya[_global.boughta];
boughtspeed = boughtspeed + _global.boughspeedarrayb[_global.boughtb];
boughtspeed = boughtspeed + _global.boughspeedarrayc[_global.boughtc];
boughtspeed = boughtspeed + _global.boughspeedarrayd[_global.boughtd];
driver.orig_speedmax = driver.orig_speedmax + boughtspeed;
var tirelosetunning = ((_root.tuning1 * 2) / 100);
var tire_use = (_global.tireloseNum + tirelosetunning);
driver.tire_use = tire_use;
driver.orig_speedmax = driver.orig_speedmax - tirelosetunning;
var steargaintunning = ((_root.tuning1 * 0.2) / 100);
driver.orig_maxstearforce = driver.orig_maxstearforce + steargaintunning;
var speedlosetunning = ((_root.tuning2 * 5) / 100);
driver.orig_speedmax = driver.orig_speedmax - speedlosetunning;
var steargaintunning = ((_root.tuning2 * 0.3) / 100);
driver.orig_maxstearforce = driver.orig_maxstearforce + steargaintunning;
var speedlosetunning = ((_root.tuning3 * 5) / 100);
driver.orig_speedmax = driver.orig_speedmax - speedlosetunning;
var steargaintunning = ((_root.tuning3 * 0.3) / 100);
driver.orig_maxstearforce = driver.orig_maxstearforce + steargaintunning;
var fuellosetunning = ((_root.tuning4 * 2) / 100);
driver.fu_use = 4 + fuellosetunning;
var speedgaintunning = ((_root.tuning4 * 5) / 100);
driver.orig_speedmax = driver.orig_speedmax + speedgaintunning;
trace("driver.orig_speedmax=" + driver.orig_speedmax);
trace("driver.orig_maxstearforce=" + driver.orig_maxstearforce);
trace("driver.fu_use=" + driver.fu_use);
trace("driver.tire_use=" + driver.tire_use);
_root.developshow1 = driver.orig_speedmax;
_root.developshow2 = driver.orig_maxstearforce;
_root.developshow3 = driver.fu_use;
_root.developshow4 = driver.tire_use;
};
_root.setshop_tuning();
driverControl.manageEnemies();
_global.endgame = function () {
_global.gameStart = false;
circuitInterval.clearInterval();
treeInterval.clearInterval();
driverInterval.clearInterval();
_root.lightController_mc.onEnterframe = undefined;
_global.laptime = undefined;
_global.endLapTime = undefined;
_global.startLapTime = undefined;
_root.showlaptime = "0:00.000";
mouse.show();
SoundControl.stopSound(driverObj.driver0);
SplashandDash_Sound.start();
_global.Tinterobj = undefined;
_global.driverObj = undefined;
_global.endtime = undefined;
_global.lastlaptime = undefined;
_global.bestlaptime = undefined;
_root.showbestlaptime = "0:00.000";
_root.showlastlaptime = "0:00.000";
_root.pasby_mc.onEnterFrame = undefined;
_root.esccatcher_mc.onEnterFrame = undefined;
_global.framedest = "menu";
_root.black_mc.gotoAndPlay("fadein");
};
pick5namesfunction();
Symbol 1421 MovieClip Frame 2
_root.startinglights = function () {
_root.R_game_mc.startinglights_mc.gotoAndStop(2);
lightcontroller = _root.createEmptyMovieClip("lightController_mc", 1500);
lightcontroller.mystarttime = getTimer();
lightcontroller.mylight = 1;
i = 1;
while (i <= 6) {
lightcontroller["lighttime" + i] = Math.round(Math.random() * 1000) + 500;
i++;
}
lightcontroller.onEnterFrame = function () {
if ((!(_root.paused_mc._currentframe === 1)) || (!(_root.escapeMenu_mc._currentframe === 1))) {
this.mystarttime = getTimer();
return(undefined);
}
var diffT = (getTimer() - this.mystarttime);
if (diffT >= this["lighttime" + this.mylight]) {
this.mystarttime = getTimer();
_root.R_game_mc.startinglights_mc.gotoAndStop(this.mylight + 2);
this.mylight = this.mylight + 1;
if (this.mylight > 6) {
delete this.onEnterFrame;
}
}
};
};
_root.startinglights();
stop();
Symbol 1427 Button
on (press, keyPress "<Enter>") {
if (driverObj.driver0.atpitstreet) {
_global.TimeControl.timePaused = _root.afterpause;
} else {
_global.gamestart = _root.afterpause;
}
_root.escapeMenu_mc.gotoAndStop(1);
}
Symbol 1430 Button
on (press) {
_global.endgame();
}
Symbol 1431 MovieClip Frame 1
_root.paused_mc.gotoAndStop(1);
stop();
Symbol 1431 MovieClip Frame 2
_root.paused_mc.gotoAndStop(1);
this.underlay_but.onPress = function () {
};
this.underlay_but.useHandCursor = false;
Symbol 1437 MovieClip Frame 1
stop();
Symbol 1439 MovieClip Frame 6
if (!(_global.framedest === undefined)) {
_level0.gotoAndPlay(_global.framedest);
_global.framedest = undefined;
}
stop();
Symbol 1439 MovieClip Frame 11
if (_global.framedest == "race") {
timeControl.gamePaused = true;
_root.R_game_mc._visible = true;
_level0.gotoAndPlay(_global.framedest);
_global.framedest = undefined;
} else if (!(_global.framedest === undefined)) {
_level0.gotoAndPlay(_global.framedest);
_global.framedest = undefined;
}
stop();
Symbol 1455 MovieClip Frame 1
stop();
Symbol 1462 MovieClip Frame 1
this.myColor = new Color(this.sub_mc);
this.myColor.setTransform(myCarColor);
Symbol 1463 MovieClip Frame 1
stop();
Symbol 1468 MovieClip Frame 1
stop();
Symbol 1471 MovieClip Frame 1
stop();
Symbol 1472 MovieClip Frame 1
stop();
Symbol 1476 MovieClip Frame 1
stop();
Symbol 1479 MovieClip Frame 1
stop();
Symbol 1480 MovieClip Frame 1
stop();
Symbol 1482 MovieClip Frame 1
stop();
Symbol 1482 MovieClip Frame 20
tire_Sound.start();
gotoAndPlay (144);
Symbol 1482 MovieClip Frame 43
tire_Sound.start();
Symbol 1482 MovieClip Frame 135
gotoAndStop (1);
Symbol 1482 MovieClip Frame 232
gotoAndStop (1);
Symbol 1483 MovieClip Frame 1
stop();
Symbol 1484 MovieClip Frame 1
stop();
Symbol 1484 MovieClip Frame 20
tire_Sound.start();
gotoAndPlay (180);
Symbol 1484 MovieClip Frame 43
tire_Sound.start();
Symbol 1484 MovieClip Frame 151
gotoAndStop (1);
Symbol 1484 MovieClip Frame 271
gotoAndStop (1);
Symbol 1485 MovieClip Frame 1
stop();
Symbol 1486 MovieClip Frame 1
stop();
Symbol 1487 MovieClip Frame 1
stop();
Symbol 1487 MovieClip Frame 2
gotoAndPlay (20);
Symbol 1487 MovieClip Frame 3
gotoAndPlay (140);
Symbol 1487 MovieClip Frame 111
gotoAndStop (1);
Symbol 1487 MovieClip Frame 241
gotoAndStop (1);
Symbol 1488 MovieClip Frame 1
stop();
Symbol 1488 MovieClip Frame 2
gotoAndPlay (20);
Symbol 1488 MovieClip Frame 3
gotoAndPlay (120);
Symbol 1488 MovieClip Frame 101
gotoAndStop (1);
Symbol 1488 MovieClip Frame 201
gotoAndStop (1);
Symbol 1544 MovieClip Frame 1
stop();
Symbol 1544 MovieClip Frame 19
whiping_Sound.start(0, 6);
Symbol 1544 MovieClip Frame 77
this._parent.play();
Symbol 1545 MovieClip Frame 1
stop();
Symbol 1545 MovieClip Frame 2
this.sub.gotoAndPlay(2);
Symbol 1545 MovieClip Frame 15
stop();
Symbol 1548 MovieClip Frame 1
i = 0;
while (i <= 27) {
var ctarget = this[("action" + i) + "_mc"];
ctarget._visible = false;
ctarget.useHandCursor = false;
ctarget.i = i;
ctarget.onPress = function () {
actionControl.setAction(this.i);
};
i++;
}
Symbol 1560 MovieClip Frame 1
stop();
Symbol 1560 MovieClip Frame 9
stop();
Symbol 1560 MovieClip Frame 28
gotoAndPlay (11);
Symbol 1562 MovieClip Frame 1
this.start_mc.useHandCursor = false;
this.start_mc.ctarget = this.fuelgame_mc;
this.start_mc.onPress = function () {
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
return(undefined);
}
if (!this.ctarget._visible) {
this.ctarget._visible = true;
} else {
this.ctarget.stop();
var cframe = this.ctarget._currentframe;
if ((cframe >= 6) && (cframe <= 8)) {
this._parent.succes = true;
} else {
this._parent.succes = false;
}
this._parent.gotoAndPlay(2);
}
};
stop();
Instance of Symbol 697 MovieClip "fuelgame_mc" in Symbol 1562 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1562 MovieClip Frame 2
this.tanker1.gotoAndPlay("start");
Symbol 1562 MovieClip Frame 4
this.tanker2.gotoAndPlay(2);
Symbol 1562 MovieClip Frame 8
this.tanker1.gotoAndPlay("tank");
Symbol 1562 MovieClip Frame 10
this.fuelgame_mc._visible = false;
this.fuelgame_mc.gotoAndPlay(2);
if (this.succes) {
this.gotoAndPlay("tanking");
tankin_Sound.start();
} else {
this.gotoAndPlay("reverse");
}
Symbol 1562 MovieClip Frame 11
this.stop_mc.useHandCursor = false;
this.stop_mc.onPress = function () {
this._parent.gotoAndPlay("reverse");
if (_root.indicator_fuel_mc.meter_mc._currentframe > 300) {
_root.indicator_fuel_mc.meter_mc.gotoAndStop(299);
}
};
stop();
Symbol 1562 MovieClip Frame 12
this.tanker1.gotoAndPlay("start");
this.tanker2.gotoAndPlay("start");
tankuit_Sound.start();
Symbol 1567 MovieClip Frame 1
stop();
Symbol 1567 MovieClip Frame 2
stop();
Symbol 1600 MovieClip Frame 1
stop();
Symbol 1600 MovieClip Frame 19
this.startlollipop_mc.onPress = function () {
actionControl.startlollipop();
};
stop();
Symbol 1608 MovieClip Frame 1
stop();
Symbol 1608 MovieClip Frame 7
gotoAndPlay (2);
Symbol 1617 MovieClip Frame 1
stop();
Symbol 1624 MovieClip Frame 1
this.myColor = new Color(this.sub_mc);
this.myColor.setTransform(myCarColor);
stop();
Symbol 1628 MovieClip Frame 1
stop();
Symbol 1632 MovieClip Frame 1
stop();
Symbol 1639 MovieClip Frame 1
stop();
Symbol 1643 MovieClip Frame 1
stop();
Symbol 1648 Button
on (press) {
_root.truck_mc._visible = false;
}
Symbol 1649 MovieClip Frame 1
i = 1;
while (i <= 2) {
var ctarget = this["voorband_truck_pile" + i];
ctarget.onPress = function () {
if ((!(_root.bandenvoor_mc._currentframe === 3)) && (!(this._currentframe === 3))) {
_root.bandenvoor_mc.nextFrame();
this.nextFrame();
}
};
i++;
}
i = 1;
while (i <= 2) {
var ctarget = this["achterband_truck_pile" + i];
ctarget.onPress = function () {
if ((!(_root.bandenachter_mc._currentframe === 3)) && (!(this._currentframe === 3))) {
_root.bandenachter_mc.nextFrame();
this.nextFrame();
}
};
i++;
}
var ctarget = this.voorvleugel_truck_mc;
ctarget.onPress = function () {
if ((!(_root.voorvleugel_mc._currentframe === 2)) && (!(this._currentframe === 2))) {
_root.voorvleugel_mc.nextFrame();
this.nextFrame();
}
};
var ctarget = this.achtervleugel_truck_mc;
ctarget.onPress = function () {
if ((!(_root.achtervleugel_mc._currentframe === 2)) && (!(this._currentframe === 2))) {
_root.achtervleugel_mc.nextFrame();
this.nextFrame();
}
};
var ctarget = this.bg_truck;
ctarget.onPress = function () {
};
Symbol 1655 Button
on (press) {
getURL ("index.htm", "_self");
}
Symbol 1663 Button
on (press) {
_root.yes._visible = false;
gotoAndStop (1);
}
Symbol 1665 MovieClip Frame 1
stop();
Symbol 1665 MovieClip Frame 2
stop();
Symbol 1670 MovieClip Frame 1
stop();
Symbol 1670 MovieClip Frame 2
_root.enginesound = "arriving";
Symbol 1670 MovieClip Frame 137
_root.enginesound = "idle";
Symbol 1670 MovieClip Frame 143
_root.enginesound = "idle";
Symbol 1670 MovieClip Frame 226
gotoAndPlay (143);
Symbol 1670 MovieClip Frame 232
_root.enginesound = "leaving";
Symbol 1670 MovieClip Frame 481
gotoAndStop (1);
Symbol 1671 MovieClip Frame 1
stop();
Symbol 1671 MovieClip Frame 406
this.gotoAndPlay(2);
Symbol 1684 Button
on (press) {
_global.buyshow = true;
TimeControl.timePaused = true;
_root.buyme_mc._visible = true;
}
Symbol 1690 MovieClip Frame 1
stop();
Symbol 1692 Button
on (press) {
_global.buyshow = false;
TimeControl.timePaused = false;
_root.buyme_mc._visible = false;
}
Symbol 1694 MovieClip Frame 10
stop();
Symbol 1695 MovieClip Frame 1
this.buy_but.onPress = function () {
_global.setcounter(1);
getURL (_global.buyurl, "_blank");
};
this.buy_but.useHandCursor = false;
_global.CPchangecolorcarDEMO = function (driver, selected) {
_root.colorname = ">> " + CPnamearray[selected];
_root.colorname2 = CPnamearray[selected];
var ctargetbody = driver.tocolor_mc;
driver.myColor = new Color(ctargetbody);
driver.myColorTransform = new Object();
var myCT = driver.myColorTransform;
myCT.ra = CParray[selected][0];
myCT.rb = CParray[selected][1];
myCT.ga = CParray[selected][2];
myCT.gb = CParray[selected][3];
myCT.ba = CParray[selected][4];
myCT.bb = CParray[selected][5];
myCT.aa = CParray[selected][6];
myCT.ab = CParray[selected][7];
driver.myColor.setTransform(myCT);
var myoldcolor = _root["showcolor" + CPmycolor];
changeTextColor(myoldcolor, 13421772);
_global.CPmycolor = selected;
var mynewcolor = _root["showcolor" + CPmycolor];
changeTextColor(mynewcolor, 16777011);
};
this.democolorarray = [13, 16, 18, 19, 23, 32];
i = 0;
while (i <= 5) {
var mydriver = this["Colorpicker_car_mc" + i];
_global.CPchangecolorcarDEMO(mydriver, this.democolorarray[i]);
i++;
}