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) {
var _local1 = _root;
var _local2 = option;
var _local3 = this;
if (_local1["counteroption" + _local2]) {
} else {
mybaseurl = String(_url);
filevar = mybaseurl.substr(0, 4);
if (filevar != "file") {
tempkey = Math.round(Math.random() * 100000);
_local3.targetUrl = (((("http://www.entertainmail.net/splash_and_dash/stats/?phpbase=" + mybaseurl) + "&option=") + _local2) + "&key=") + tempkey;
loadMovieNum (_local3.targetUrl, 2);
_local1.from = "site";
} else {
_local1.from = "local";
}
if (_local2 == 0) {
_local1.counteroption0 = true;
} else if (_local2 == 1) {
_local1.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) {
var _local1 = _root;
var _local2 = _global;
_local1.SplashAndDashsave_mygame = SharedObject.getLocal(_local1.savefile_mygame);
_local1.SplashAndDashsave_mygame.data.save_money = _local2.mymoney;
_local1.SplashAndDashsave_mygame.data.save_tuning1 = _local1.tuning1;
_local1.SplashAndDashsave_mygame.data.save_tuning2 = _local1.tuning2;
_local1.SplashAndDashsave_mygame.data.save_tuning3 = _local1.tuning3;
_local1.SplashAndDashsave_mygame.data.save_tuning4 = _local1.tuning4;
_local1.SplashAndDashsave_mygame.data.save_boughta = _local2.boughta;
_local1.SplashAndDashsave_mygame.data.save_boughtb = _local2.boughtb;
_local1.SplashAndDashsave_mygame.data.save_boughtc = _local2.boughtc;
_local1.SplashAndDashsave_mygame.data.save_boughtd = _local2.boughtd;
_local1.SplashAndDashsave_mygame.data.save_CPmycolor = _local2.CPmycolor;
_local1.SplashAndDashsave_mygame.data.save_playername = _local1.playername;
_local1.SplashAndDashsave_mygame.data.save_email = _local1.email;
_local1.SplashAndDashsave_mygame.data.save_qualitynumber = _local1.qualitynumber;
_local1.SplashAndDashsave_mygame.data.savedtime1 = true;
_local1.SplashAndDashsave.flush();
trace("------------------SAVED --mygame------------------");
delete _local1.SplashAndDashsave_mygame;
};
_root.loadfromSO_mygame = function () {
var _local1 = _root;
var _local3 = _global;
_local1.SplashAndDashsave_mygame = SharedObject.getLocal(_local1.savefile_mygame);
if (_local1.SplashAndDashsave_mygame.data.savedtime1 == undefined) {
trace("------------------SAVE FILE IS EMPTY------------------");
} else {
var _local2 = _local1.SplashAndDashsave_mygame.data;
_local3.mymoney = _local2.save_money;
_local1.tuning1 = _local2.save_tuning1;
_local1.tuning2 = _local2.save_tuning2;
_local1.tuning3 = _local2.save_tuning3;
_local1.tuning4 = _local2.save_tuning4;
_local3.boughta = _local2.save_boughta;
_local3.boughtb = _local2.save_boughtb;
_local3.boughtc = _local2.save_boughtc;
_local3.boughtd = _local2.save_boughtd;
_local3.CPmycolor = _local2.save_CPmycolor;
_local1.playername = _local2.save_playername;
_local1.email = _local2.save_email;
_local1.qualitynumber = _local2.save_qualitynumber;
if (_local3.mymoney == undefined) {
_local3.mymoney = 0;
}
if (_local1.tuning1 == undefined) {
_local1.tuning1 = 0;
}
if (_local1.tuning2 == undefined) {
_local1.tuning2 = 0;
}
if (_local1.tuning3 == undefined) {
_local1.tuning3 = 0;
}
if (_local1.tuning4 == undefined) {
_local1.tuning4 = 0;
}
if (_local1.boughta == undefined) {
_local1.boughta = 0;
}
if (_local1.boughtb == undefined) {
_local1.boughtb = 0;
}
if (_local1.boughtc == undefined) {
_local1.boughtc = 0;
}
if (_local1.boughtc == undefined) {
_local1.boughtc = 0;
}
if (_local1.playername == undefined) {
_local1.playername = "NEW DRIVER";
}
if (_local1.email == undefined) {
_local1.email = "YOUR E-MAIL ADRES";
}
if (_local1.qualitynumber == undefined) {
_local1.qualitynumber = 1;
}
trace("------------------LOADED FROM SHARED OBJECT------------------");
delete _local1.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/affiliate3.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) {
var _local1 = _root;
_global.mymoney = _global.mymoney - spend;
_local1.mymoneyshow = String(_global.mymoney);
if (_local1.mymoneyshow.length < 4) {
_local1.mymoneyshow = _local1.mymoneyshow + ",-";
} else {
_local1.tempmymoneyshow = "";
i = 0;
while (i < _local1.mymoneyshow.length) {
var _local3 = _local1.mymoneyshow.slice(0, _local1.mymoneyshow.length - 3);
var _local2 = _local1.mymoneyshow.slice(_local1.mymoneyshow.length - 3);
_local1.mymoneyshow = _local3;
_local1.tempmymoneyshow = ("." + _local2) + _local1.tempmymoneyshow;
i = i + 3;
}
_local1.mymoneyshow = (_local1.mymoneyshow + _local1.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 563 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) {
var _local2 = selected;
driver = _root["showcolor" + i];
var mytext = _root["showcolor" + i].mytext;
driver.name = CPnamearray[i];
var _local3 = driver.colorshow_mc.tocolor_mc;
driver.myColor = new Color(_local3);
driver.myColorTransform = new Object();
var _local1 = driver.myColorTransform;
_local1.ra = CParray[_local2][0];
_local1.rb = CParray[_local2][1];
_local1.ga = CParray[_local2][2];
_local1.gb = CParray[_local2][3];
_local1.ba = CParray[_local2][4];
_local1.bb = CParray[_local2][5];
_local1.aa = CParray[_local2][6];
_local1.ab = CParray[_local2][7];
driver.myColor.setTransform(_local1);
};
_global.changeTextColor = function (currenttarget, mycolor, ctext, textfield) {
var _local1 = currenttarget;
var _local2 = ctext;
if (!(_local2 === undefined)) {
trace(_local2);
trace(textfield);
textfield.text = _local2;
}
_local1.myformat = new TextFormat();
_local1.myformat.color = mycolor;
_local1.mytext.setTextFormat(_local1.myformat);
};
_global.CPchangecolorcar = function (selected) {
var _local2 = selected;
var _local3 = _root;
driver = _local3.Colorpicker_car_mc;
_local3.colorname = ">> " + CPnamearray[_local2];
_local3.colorname2 = CPnamearray[_local2];
var ctargetbody = driver.tocolor_mc;
driver.myColor = new Color(ctargetbody);
driver.myColorTransform = new Object();
var _local1 = driver.myColorTransform;
_local1.ra = CParray[_local2][0];
_local1.rb = CParray[_local2][1];
_local1.ga = CParray[_local2][2];
_local1.gb = CParray[_local2][3];
_local1.ba = CParray[_local2][4];
_local1.bb = CParray[_local2][5];
_local1.aa = CParray[_local2][6];
_local1.ab = CParray[_local2][7];
driver.myColor.setTransform(_local1);
var myoldcolor = _local3["showcolor" + CPmycolor];
changeTextColor(myoldcolor, 13421772);
_global.CPmycolor = _local2;
var mynewcolor = _local3["showcolor" + CPmycolor];
changeTextColor(mynewcolor, 16777011);
};
_root.createEmptyMovieClip("colorshower", 1);
_root.colorshower.i = 0;
_root.colorshower.myx = 50;
_root.colorshower.onEnterFrame = function () {
var _local1 = this;
if (((((((_local1.i == 4) || (_local1.i == 8)) || (_local1.i == 10)) || (_local1.i == 16)) || (_local1.i == 19)) || (_local1.i == 21)) || (_local1.i == 29)) {
ctarget = _root.attachMovie("colorpicker_colorset", "showcolor" + _local1.i, _local1.i + 30);
ctarget.onPress = function () {
CPchangecolorcar(this.mynumber);
};
} else {
ctarget = _root.attachMovie("colorpicker_demo", "showcolor" + _local1.i, _local1.i + 30);
}
ctarget.mynumber = _local1.i;
ctarget._x = _local1.myx;
ctarget._y = (_local1.i * 22) + 70;
CPchangecolor(_local1.i, _local1.i);
_local1.i = _local1.i + 1;
if (_local1.i > 17) {
ctarget._y = ((_local1.i - 18) * 22) + 70;
_local1.myx = 220;
ctarget._x = _local1.myx;
}
if (_local1.i > 33) {
if (!(CPmycolor === undefined)) {
CPchangecolorcar(CPmycolor);
}
_local1.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 () {
var _local1 = _root;
var _local2 = this;
_local1.itembuy_underlay_mc.gotoAndStop(_local2.number);
_local1.shopitems.gotoAndStop(_local2.number);
_local1.cost = _local1.pricearray[_local2.number];
_local1.costshow = _local1.pricearrayshow[_local2.number];
_local1.letterselec = _local2.letter;
_local1.inlistselec = _local2.inlist;
if (_global["bought" + _local2.letter] == _local2.inlist) {
_local1.item_buy_mc.gotoAndStop("already");
} else if (_local2.inlist > 1) {
_local1.item_buy_mc.gotoAndStop("demo");
} else if (_global.mymoney < _local1.cost) {
_local1.item_buy_mc.gotoAndStop("tomutch");
} else {
_local1.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 () {
var _local1 = _root;
if (_local1.pressedslider || (_local1.dragging)) {
_local1.pressedslider = false;
var xpos = _local1["slider_mc" + _local1.dragid].slider_handler_mc._x;
var _local2 = (xpos * 100) / 255;
if (_local2 > 100) {
_local2 = 100;
} else if (_local2 < 0) {
_local2 = 0;
}
_local1["tuning" + _local1.dragid] = _local2;
var _local3 = Math.round((_local2 * _local1[("tuning" + _local1.dragid) + "_mc"]._totalframes) / 100);
if (_local3 < 1) {
_local3 = 1;
} else if (_local3 > _local1[("tuning" + _local1.dragid) + "_mc"]._totalframes) {
_local3 = _local1[("tuning" + _local1.dragid) + "_mc"]._totalframes;
}
_local1[("tuning" + _local1.dragid) + "_mc"].gotoAndStop(_local3);
}
};
_root.createEmptyMovieClip("sliderstarter_mc", 13);
_root.sliderstarter_mc.ctime = 0;
_root.sliderstarter_mc.onEnterFrame = function () {
var _local1 = this;
var _local3 = _root;
if (_local1.ctime == 0) {
_local1.i = 0;
while (_local1.i <= 4) {
var percent = _local3["tuning" + _local1.i];
trace("percent=" + percent);
var xpos = ((percent * 255) / 100);
_local3["slider_mc" + _local1.i].slider_handler_mc._x = xpos;
var _local2 = Math.round((percent * _local3[("tuning" + _local1.i) + "_mc"]._totalframes) / 100);
if (_local2 < 1) {
_local2 = 1;
} else if (_local2 > _local3[("tuning" + _local1.i) + "_mc"]._totalframes) {
_local2 = _local3[("tuning" + _local1.i) + "_mc"]._totalframes;
}
_local3[("tuning" + _local1.i) + "_mc"].gotoAndStop(_local2);
_local1.i++;
}
_local3.sliderstarter_mc.onEnterFrame = undefined;
_local3.sliderstarter_mc.removeMovieClip();
} else {
_local1.ctime = _local1.ctime + 1;
}
};
Instance of Symbol 909 MovieClip "slider_mc1" in Frame 673
onClipEvent (load) {
this.id = 1;
}
Instance of Symbol 909 MovieClip "slider_mc2" in Frame 673
onClipEvent (load) {
this.id = 2;
}
Instance of Symbol 909 MovieClip "slider_mc3" in Frame 673
onClipEvent (load) {
this.id = 3;
}
Instance of Symbol 909 MovieClip "slider_mc4" in Frame 673
onClipEvent (load) {
this.id = 4;
}
Frame 692
_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 () {
var _local1 = this;
if (_local1.ctime >= _local1.gtime) {
var _local2 = _global[("pasby" + Math.ceil(Math.random() * 3)) + "_Sound"];
_local2.start();
_local1.ctime = 0;
_local1.gtime = Math.round(Math.random() * 300) + 50;
}
_local1.ctime = _local1.ctime + 1;
};
_root.esccatcher_mc.onEnterFrame = function () {
var _local1 = _root;
var _local2 = _global;
var _local3 = this;
if (!Key.isDown(27)) {
_local3.pressing = false;
}
if (_local3.pressing) {
} else if (Key.isDown(27)) {
_local3.pressing = true;
if (_local1.escapeMenu_mc._currentframe == 1) {
if (driverObj.driver0.atpitstreet) {
return;
}
SoundControl.stopSound(driverObj.driver0);
Mouse.show();
if (_local1.paused_mc._currentframe == 1) {
_local1.afterpause = _local2.gamestart;
}
_local2.gamestart = false;
_local1.escapeMenu_mc.gotoAndStop(2);
} else {
if (driverObj.driver0.atpitstreet) {
_local2.TimeControl.timePaused = _local1.afterpause;
} else {
_local2.gamestart = _local1.afterpause;
}
_local1.escapeMenu_mc.gotoAndStop(1);
}
}
};
stop();
Frame 693
_global.framedest = undefined;
_root.black_mc.gotoAndPlay("fadeout");
_root.esccatcher_mc.onEnterFrame = function () {
var _local1 = _root;
var _local2 = _global;
var _local3 = this;
if (!Key.isDown(27)) {
_local3.pressing = false;
}
if (_local3.pressing) {
} else if (Key.isDown(27)) {
_local3.pressing = true;
if (_local1.escapeMenu_mc._currentframe == 1) {
if (driverObj.driver0.atpitstreet) {
return;
}
SoundControl.stopSound(driverObj.driver0);
Mouse.show();
if (_local1.paused_mc._currentframe == 1) {
_local1.afterpause = _local2.gamestart;
}
_local2.gamestart = false;
_local1.escapeMenu_mc.gotoAndStop(2);
} else {
if (driverObj.driver0.atpitstreet) {
_local2.TimeControl.timePaused = _local1.afterpause;
} else {
_local2.gamestart = _local1.afterpause;
}
_local1.escapeMenu_mc.gotoAndStop(1);
}
}
};
Frame 694
stop();
Frame 696
_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 () {
var _local1 = this;
i = 0;
while (i < characterArray.length) {
if (characterArray[i] == _local1) {
characterArray.splice(i, 1);
}
i++;
}
};
MovieClip.prototype.addAsStatic = function () {
staticArray.push(this);
};
Array.prototype.sortOnNum = function (p) {
var _local1 = function (a, b) {
return(a[p] > b[p]);
};
this.sort(_local1);
};
_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 () {
var _local3 = this;
if (_local3.timePaused) {
} else {
_local3.currentTime = (MainControl.getmytimer() / 1000) - (_root.startmainpittimer / 1000);
_root.toshowpittime = _local3.currentTime;
var _local1 = String(_local3.currentTime);
spotdot = _local1.lastIndexOf(".");
stringlength = _local1.length;
if (spotdot == -1) {
_local1 = _local1 + ".00";
} else if ((stringlength - spotdot) == 2) {
_local1 = _local1 + "0";
}
spotdot = _local1.lastIndexOf(".");
stringlength2 = _local1.length;
differenceRound2 = _local1.substring(0, spotdot + 3);
var _local2 = differenceRound2;
_root.indicator_time_mc.timeDisplay_txt.text = _local2;
_root.indicator_time_mc.timeDisplay2_txt.text = _local2;
}
};
TimeObject.prototype.saveTime = function () {
var _local1 = _global;
var _local3 = _root;
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);
_local1.averagetotal = 0;
i = 0;
while (i <= maxlength) {
var _local2 = Number(pitstoptimes[i]);
trace("trow=" + _local2);
_local1.averagetotal = _local1.averagetotal + _local2;
trace("averagetotal in = " + _local1.averagetotal);
i++;
}
trace("averagetotal before deviding = " + _local1.averagetotal);
var averagetotaltrow = (_local1.averagetotal / maxlength);
_local1.averagetotal = averagetotaltrow;
trace("averagetotal = " + _local1.averagetotal);
var gameHour = this.gettxt(_local1.averagetotal);
_local3.menu_levelcomplited_mc.averagetotal_txt.text = gameHour;
_local3.points = gameHour;
_local3.level = clevel;
trace("-------------------_" + gameHour);
trace("-------pitstoplevel---------");
maxlength = pitstoplevel.length - 1;
trace("maxlength=" + maxlength);
_local1.average = 0;
i = 0;
while (i <= maxlength) {
var _local2 = Number(pitstoplevel[i]);
trace("trow=" + _local2);
_local1.average = _local1.average + _local2;
trace("average in = " + _local1.average);
i++;
}
trace("average before deviding = " + _local1.average);
var averagetrow = (_local1.average / maxlength);
_local1.average = averagetrow;
trace("average = " + _local1.average);
var gameHour = this.gettxt(String(_local1.average));
_local3.menu_levelcomplited_mc.average_txt.text = gameHour;
var differenceRound = String(targettime);
var gameHour = this.gettxt(differenceRound);
_local3.menu_levelcomplited_mc.targettime_txt.text = gameHour;
_local1.overtime = targettime - average;
var differenceRound = String(overtime);
var gameHour = this.gettxt(differenceRound);
_local3.menu_levelcomplited_mc.overtime_txt.text = gameHour;
};
TimeObject.prototype.gettxt = function (givenNumber) {
var _local2 = givenNumber;
differenceRound = String(_local2);
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 _local1 = differenceRound.substring(0, spotdot + 3);
return(_local1);
};
TimeObject.prototype.endGame = function () {
};
TimeObject.prototype.resetTime = function () {
this.currentTime = 0;
var _local1 = "0.00";
_root.indicator_time_mc.timeDisplay_txt.text = _local1;
_root.indicator_time_mc.timeDisplay2_txt.text = _local1;
};
TimeObject.prototype.stopTime = function () {
var _local1 = String(this.currentTime);
spotdot = _local1.lastIndexOf(".");
stringlength = _local1.length;
if (spotdot == -1) {
_local1 = _local1 + ".00";
} else if ((stringlength - spotdot) == 2) {
_local1 = _local1 + "0";
}
spotdot = _local1.lastIndexOf(".");
stringlength2 = _local1.length;
differenceRound2 = _local1.substring(0, spotdot + 3);
var _local2 = differenceRound2;
_root.indicator_time_mc.timeDisplay_txt.text = _local2;
_root.indicator_time_mc.timeDisplay2_txt.text = _local2;
this.timePaused = true;
};
MoneyObject = function () {
};
MoneyObject.prototype.addFunds = function (amount) {
this.totalFunds = this.totalFunds + amount;
this.displayFunds();
};
MoneyObject.prototype.decreaseFunds = function (amount) {
var _local1 = this;
_local1.totalFunds = _local1.totalFunds - amount;
if (_local1.totalFunds < 0) {
_local1.totalFunds = 0;
}
_local1.displayFunds();
};
MoneyObject.prototype.resetFunds = function () {
this.totalFunds = 0;
this.displayFunds();
};
MoneyObject.prototype.displayFunds = function () {
var _local3 = _root;
var _local1 = this.totalFunds;
var totalCents = Math.round(_local1 * 100);
var _local2 = String(totalCents).slice(-2);
var dollars = String(totalCents).substring(0, String(totalCents).length - 2);
if (String(_local1).length == 1) {
if (_local1 == 0) {
_local3.tabs.moneyDisplay_txt.text = "$ 0.00";
} else {
_local3.tabs.moneyDisplay_txt.text = "$ 0.0" + _local2;
}
} else if (String(_local1).length == 2) {
_local3.tabs.moneyDisplay_txt.text = "$ 0." + _local2;
} else if (String(dollars).length == 0) {
_local3.tabs.moneyDisplay_txt.text = "$ 0." + _local2;
} else {
_local3.tabs.moneyDisplay_txt.text = (("$ " + dollars) + ".") + _local2;
}
};
ScreenObject = function () {
};
ScreenObject.prototype.normalMode = function () {
var _local1 = _root;
this.debug = false;
_local1.screenMask._visible = true;
_local1.gameScreen.setMask(_local1.screenMask);
_local1.screenBG._visible = true;
_local1.gameScreen.labels._visible = false;
_local1.gameScreen.outlines._visible = false;
_local1.tabs._visible = true;
_local1.buttons._visible = true;
_local1.debugger._visible = false;
};
ScreenObject.prototype.debugMode = function () {
var _local1 = _root;
this.debug = true;
_local1.gameScreen.setMask(null);
_local1.screenMask._visible = false;
_local1.screenBG._visible = false;
_local1.gameScreen.labels._visible = true;
_local1.gameScreen.outlines._visible = true;
_local1.tabs._visible = false;
_local1.buttons._visible = false;
_local1.debugger._visible = true;
};
ScreenObject.prototype.switchMode = function () {
var _local1 = this;
if (_local1.debug) {
_local1.normalMode();
} else {
_local1.debugMode();
}
};
ScreenObject.prototype.scrollScreen = function (referencePoint) {
var _local3 = referencePoint;
var _local2 = screenReferences[_local3].xPos;
var _local1 = screenReferences[_local3].yPos;
this.currentX = _local2;
this.currentY = _local1;
this.currentReferencePoint = _local3;
this.broadcastMessage("onScroll", _local3);
gameControl.doWalk();
_root.gameScreen._x = _local2;
_root.gameScreen._y = _local1;
};
ScreenObject.prototype.clickCharacter = function (Obj) {
var _local2 = _root;
var _local1 = obj;
if (_local2.mainCharacter == _local1) {
actionControl.mainCharacter = undefined;
_local2.mainCharacter = undefined;
actionControl.deselectAction();
} else {
_local2.mainCharacter = _local1;
_local2.gameScreen.mainCharacter = _local1;
actionControl.selectAction(_local1);
}
};
ScreenObject.prototype.clickScreen = function (mouseX, mouseY, charX, charY) {
var _local1 = _root;
var _local2 = this;
if (!_local1.gameScreen.mainCharacter.waiting) {
actionControl.resetcharacter();
var cxPos = Math.ceil(_local1.gameScreen.mainCharacter.xPos / _local2.tileWidth);
var cyPos = Math.ceil(_local1.gameScreen.mainCharacter.yPos / _local2.tileHeight);
xPos = mouseX;
yPos = mouseY;
var _local3 = Math.ceil(xPos / _local2.tileWidth) - 1;
var eyPos = (Math.ceil(yPos / _local2.tileHeight) - 1);
if ((cxPos == _local3) && (cyPos == eyPos)) {
} else {
direction = "notimportant";
_local1.newCharacter = _local1.mainCharacter;
delete _local1.newCharacter.mileStones;
delete _local1.newCharacter.wayPoints;
xPos = _local1.gameScreen.mainCharacter.xPos;
yPos = _local1.gameScreen.mainCharacter.yPos;
_local2.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
screenControl.setboei(xPos, yPos, mouseX, mouseY);
xPos = mouseX;
yPos = mouseY;
_local2.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
actionControl.mainCharacter = undefined;
_local1.mainCharacter = undefined;
actionControl.deselectAction();
}
}
};
ScreenObject.prototype.clickScreenSingle = function (mouseX, mouseY, obj) {
var _local1 = _root;
var _local2 = this;
if (!_local1.gameScreen.mainCharacter.waiting) {
var _local3 = obj;
actionControl.mainCharacter = _local3;
_local1.mainCharacter = _local3;
_local1.gameScreen.mainCharacter = _local3;
actionControl.resetcharacter();
var cxPos = Math.ceil(_local1.gameScreen.mainCharacter.xPos / _local2.tileWidth);
var cyPos = Math.ceil(_local1.gameScreen.mainCharacter.yPos / _local2.tileHeight);
xPos = mouseX;
yPos = mouseY;
var exPos = (Math.ceil(xPos / _local2.tileWidth) - 1);
var eyPos = (Math.ceil(yPos / _local2.tileHeight) - 1);
if ((cxPos == exPos) && (cyPos == eyPos)) {
} else {
direction = "notimportant";
_local1.newCharacter = _local1.mainCharacter;
delete _local1.newCharacter.mileStones;
delete _local1.newCharacter.wayPoints;
xPos = _local1.gameScreen.mainCharacter.xPos;
yPos = _local1.gameScreen.mainCharacter.yPos;
_local2.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
xPos = mouseX;
yPos = mouseY;
_local2.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
actionControl.mainCharacter = undefined;
_local1.mainCharacter = undefined;
actionControl.deselectAction();
}
}
};
ScreenObject.prototype.clickAction = function (mouseX, mouseY, charX, charY) {
var _local1 = _root;
var _local2 = this;
if (!_local1.gameScreen.mainCharacter.waiting) {
var cxPos = Math.ceil(_local1.gameScreen.mainCharacter.xPos / _local2.tileWidth);
var cyPos = Math.ceil(_local1.gameScreen.mainCharacter.yPos / _local2.tileHeight);
xPos = mouseX - _local2.currentX;
yPos = mouseY - _local2.currentY;
var _local3 = Math.ceil(xPos / _local2.tileWidth);
var eyPos = Math.ceil(yPos / _local2.tileHeight);
if ((cxPos == _local3) && (cyPos == eyPos)) {
if (!(_local1.mainCharacter.myendpose === undefined)) {
_local1.mainCharacter.pose = _local1.mainCharacter.myendpose;
_local1.mainCharacter.gotoAndStop(_local1.mainCharacter.pose);
}
_local1.mainCharacter.oldPose = "idle";
_local1.mainCharacter.poseClip.gotoAndStop(1);
_local1.mainCharacter.myendfunction(_local1.mainCharacter);
} else {
direction = "notimportant";
_local1.newCharacter = _local1.mainCharacter;
delete _local1.newCharacter.mileStones;
delete _local1.newCharacter.wayPoints;
xPos = _local1.gameScreen.mainCharacter.xPos;
yPos = _local1.gameScreen.mainCharacter.yPos;
_local2.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
screenControl.setboei(xPos, yPos, mouseX, mouseY);
xPos = mouseX - _local2.currentX;
yPos = mouseY - _local2.currentY;
_local2.nextWaypoint = {x:xPos, y:yPos, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
}
};
ScreenObject.prototype.setboei = function (xPos, yPos, xGoal, yGoal) {
var _local1 = _root;
var _local2 = this;
var _local3 = xPos;
if ((_local3 > _local1.lineV3_mc._x) && (xGoal > _local1.lineV3_mc._x)) {
trace("returned on 1");
} else if ((_local3 < _local1.lineV1_mc._x) && (xGoal < _local1.lineV1_mc._x)) {
trace("returned on 2");
} else if ((yPos < _local1.line1_mc._y) && (yGoal < _local1.line1_mc._y)) {
if ((_local3 < _local1.lineV2_mc._x) && (xGoal > _local1.lineV2_mc._x)) {
var xTogive = _local1.dot9_mc._x;
var yTogive = _local1.dot9_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
if ((_local3 > _local1.lineV2_mc._x) && (xGoal < _local1.lineV2_mc._x)) {
var xTogive = _local1.dot9_mc._x;
var yTogive = _local1.dot9_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
trace("returned on 3");
} else if ((yPos > _local1.line2_mc._y) && (yGoal > _local1.line2_mc._y)) {
if ((_local3 < _local1.lineV2_mc._x) && (xGoal > _local1.lineV2_mc._x)) {
var xTogive = _local1.dot10_mc._x;
var yTogive = _local1.dot10_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
if ((_local3 > _local1.lineV2_mc._x) && (xGoal < _local1.lineV2_mc._x)) {
var xTogive = _local1.dot10_mc._x;
var yTogive = _local1.dot10_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
trace("returned on 4");
} else if ((_local3 > _local1.lineV3_mc._x) && (yGoal > _local1.line3_mc._y)) {
trace("from right going under");
var xTogive = _local1.dot6_mc._x;
var yTogive = _local1.dot6_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
if ((_local3 > _local1.lineV2_mc._x) && (xGoal < _local1.lineV2_mc._x)) {
var xTogive = _local1.dot10_mc._x;
var yTogive = _local1.dot10_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
if (xGoal < _local1.lineV1_mc._x) {
var xTogive = _local1.dot2_mc._x;
var yTogive = _local1.dot6_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
} else if ((_local3 > _local1.lineV3_mc._x) && (yGoal < _local1.line3_mc._y)) {
trace("from right going over");
var xTogive = _local1.dot6_mc._x;
var yTogive = _local1.dot2_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
if ((_local3 > _local1.lineV2_mc._x) && (xGoal < _local1.lineV2_mc._x)) {
var xTogive = _local1.dot9_mc._x;
var yTogive = _local1.dot9_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
if (xGoal < _local1.lineV1_mc._x) {
var xTogive = _local1.dot2_mc._x;
var yTogive = _local1.dot2_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
} else if ((_local3 < _local1.lineV1_mc._x) && (yGoal > _local1.line3_mc._y)) {
trace("from left going under");
var xTogive = _local1.dot2_mc._x;
var yTogive = _local1.dot6_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
if ((_local3 < _local1.lineV2_mc._x) && (xGoal > _local1.lineV2_mc._x)) {
var xTogive = _local1.dot10_mc._x;
var yTogive = _local1.dot10_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
if (xGoal >= _local1.lineV3_mc._x) {
var xTogive = _local1.dot6_mc._x;
var yTogive = _local1.dot6_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
} else if ((_local3 > _local1.lineV3_mc._x) && (yGoal < _local1.line3_mc._y)) {
trace("from left going over");
var xTogive = _local1.dot2_mc._x;
var yTogive = _local1.dot2_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
if ((_local3 < _local1.lineV2_mc._x) && (xGoal > _local1.lineV2_mc._x)) {
var xTogive = _local1.dot9_mc._x;
var yTogive = _local1.dot9_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
if (xGoal > _local1.lineV3_mc._x) {
var xTogive = _local1.dot6_mc._x;
var yTogive = _local1.dot2_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
} else if ((((yPos < _local1.line1_mc._y) && (_local3 > _local1.lineV1_mc._x)) && (_local3 < _local1.lineV3_mc._x)) && (xGoal < _local1.lineV1_mc._x)) {
trace("from top going left");
var xTogive = _local1.dot1_mc._x;
var yTogive = _local1.dot1_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
} else if ((((yPos < _local1.line1_mc._y) && (_local3 > _local1.lineV1_mc._x)) && (_local3 < _local1.lineV3_mc._x)) && (xGoal > _local1.lineV3_mc._x)) {
trace("from top going right");
var xTogive = _local1.dot5_mc._x;
var yTogive = _local1.dot1_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
} else if ((((yPos > _local1.line2_mc._y) && (_local3 > _local1.lineV1_mc._x)) && (_local3 < _local1.lineV3_mc._x)) && (xGoal < _local1.lineV1_mc._x)) {
trace("from buttom going left");
var xTogive = _local1.dot1_mc._x;
var yTogive = _local1.dot8_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
} else if ((((yPos > _local1.line2_mc._y) && (_local3 > _local1.lineV1_mc._x)) && (_local3 < _local1.lineV3_mc._x)) && (xGoal > _local1.lineV3_mc._x)) {
trace("from buttom going rigth");
var xTogive = _local1.dot5_mc._x;
var yTogive = _local1.dot8_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
} else {
if (((yPos < _local1.line1_mc._y) && (xGoal <= _local1.lineV2_mc._x)) && (yGoal > _local1.line2_mc._y)) {
trace("from top going left to buttom");
var xTogive = _local1.dot1_mc._x;
var yTogive = _local1.dot1_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
var xTogive = _local1.dot1_mc._x;
var yTogive = _local1.dot8_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
} else if (((yPos < _local1.line1_mc._y) && (xGoal > _local1.lineV2_mc._x)) && (yGoal > _local1.line2_mc._y)) {
trace("from top going rigth to buttom");
var xTogive = _local1.dot5_mc._x;
var yTogive = _local1.dot1_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
var xTogive = _local1.dot5_mc._x;
var yTogive = _local1.dot8_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
if (((yPos > _local1.line2_mc._y) && (xGoal <= _local1.lineV2_mc._x)) && (yGoal < _local1.line1_mc._y)) {
trace("from buttom going left to top");
var xTogive = _local1.dot1_mc._x;
var yTogive = _local1.dot8_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
var xTogive = _local1.dot1_mc._x;
var yTogive = _local1.dot1_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
} else if (((yPos > _local1.line2_mc._y) && (xGoal > _local1.lineV2_mc._x)) && (yGoal < _local1.line1_mc._y)) {
trace("from buttom going left to buttom");
var xTogive = _local1.dot5_mc._x;
var yTogive = _local1.dot8_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
var xTogive = _local1.dot5_mc._x;
var yTogive = _local1.dot1_mc._y;
_local2.nextWaypoint = {x:xTogive, y:yTogive, direction:direction};
gameControl.saveMileStone(_local2.nextWaypoint);
}
trace("Hoefde niet om telopen");
}
};
ScreenObject.prototype.getCoordinates = function (x, y) {
var _local2 = Math.ceil(x / this.tileWidth);
var _local1 = Math.ceil(y / this.tileHeight);
return({x:_local2, y:_local1});
};
ScreenObject.prototype.getTileStatus = function (column, row) {
currentTile = map[column - 1][row - 1];
if (currentTile == 0) {
return(false);
}
return(true);
};
screenObject.prototype.checkScroll = function () {
var _local1 = this;
xPos = _root.gameScreen.mainCharacter.xPos + _local1.currentX;
yPos = _root.gameScreen.mainCharacter.yPos + _local1.currentY;
if ((((yPos >= 123) && (yPos <= 379)) && (xPos >= 92)) && (xPos <= 499)) {
} else if (((yPos <= 123) && (xPos >= 166)) && (xPos < 499)) {
if (!(screenReferences[_local1.currentReferencePoint].position8 === "disabled")) {
_local1.scrollScreen(screenReferences[_local1.currentReferencePoint].position8);
}
} else if ((yPos <= 284) && (xPos >= 499)) {
if (!(screenReferences[_local1.currentReferencePoint].position9 === "disabled")) {
_local1.scrollScreen(screenReferences[_local1.currentReferencePoint].position9);
}
} else if (((yPos > 284) && (xPos >= 499)) || ((yPos >= 379) && (xPos >= 425))) {
if (!(screenReferences[_local1.currentReferencePoint].position3 === "disabled")) {
_local1.scrollScreen(screenReferences[_local1.currentReferencePoint].position3);
}
} else if (((yPos >= 379) && (xPos > 92)) && (xPos < 425)) {
if (!(screenReferences[_local1.currentReferencePoint].position2 === "disabled")) {
_local1.scrollScreen(screenReferences[_local1.currentReferencePoint].position2);
}
} else if ((yPos > 216) && (xPos <= 92)) {
if (!(screenReferences[_local1.currentReferencePoint].position4 === "disabled")) {
_local1.scrollScreen(screenReferences[_local1.currentReferencePoint].position4);
}
} else if (((yPos <= 216) && (xPos <= 92)) || ((yPos <= 123) && (xPos < 166))) {
if (!(screenReferences[_local1.currentReferencePoint].position7 === "disabled")) {
_local1.scrollScreen(screenReferences[_local1.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) {
var _local1 = this;
if (type == "character") {
_local1.depthCountCharacter++;
if ((_local1.depthCountCharacter >= 1000) || (_local1.depthCountCharacter < 150)) {
_local1.depthCountCharacter = 150;
}
return(_local1.depthCountCharacter);
}
if (type == "static") {
_local1.depthCountStatic++;
if ((_local1.depthCountStatic >= 150) || (_local1.depthCountStatic < 0)) {
trace("To many static objects in game.\nIncrease maximum number of static objects");
}
return(_local1.depthCountStatic);
}
return(undefined);
};
GameObject.prototype.doWalk = function () {
var _local1 = this;
if (!timeControl.gamePaused) {
_local1.broadcastMessage("onWalk");
if (_local1.charactersPaused) {
_local1.charactersPaused = false;
}
} else if (!_local1.charactersPaused) {
_local1.broadcastMessage("onPause");
_local1.charactersPaused = true;
}
};
GameObject.prototype.createCharacter = function (xPos, yPos, direction) {
var _local1 = this;
_local1.characterCount++;
_local1.characterLivingCount++;
var uniqueDepth = _local1.getUniqueDepth("character");
newAvatar = _local1.avatars[Math.floor(Math.random() * _local1.avatars.length)];
newCharacter = _root.gameScreen.attachMovie("character35", "character" + _local1.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;
_local1.uniqueDepth = uniqueDepth;
newCharacter.direction = direction;
randomObjectives = Math.round(Math.random() * 3) + 3;
_local1.nextWaypoint = {x:xPos, y:yPos, direction:direction};
_local1.saveMileStone(_local1.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);
}
_local1.nextWaypoint = _local1.getNewWaypoint(lastX, lastY, lastDirection);
if (_local1.checkWaypoint(_local1.nextWaypoint)) {
_local1.saveMileStone(_local1.nextWaypoint);
break;
}
if (tries == 6) {
}
tries++;
}
i++;
}
_local1.saveMileStone(_local1.getEndZone(_local1.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 () {
var _local1 = this;
if (_local1.waiting) {
} else if ((_local1.wayPoints.length < 1) && (!_local1.waiting)) {
_local1.mileStone++;
_local1.wayPoint = 1;
pathObj = new Object();
pathObj.start = screenControl.getCoordinates(_local1.mileStones[_local1.mileStone - 1].x, _local1.mileStones[_local1.mileStone - 1].y);
pathObj.end = screenControl.getCoordinates(_local1.mileStones[_local1.mileStone].x, _local1.mileStones[_local1.mileStone].y);
pathObj.mc = _local1;
pathObj.depth = 50;
if (!_local1.imLive) {
gameControl.waitForPath.push(pathObj);
} else {
gameControl.waitForPath.unshift(pathObj);
}
_local1.waiting = true;
_local1.poseClip.stop();
_local1.oldPose = "idle";
} else {
var _local2 = _local1.yPos - _local1.wayPoints[_local1.wayPoint].y;
var _local3 = _local1.xPos - _local1.wayPoints[_local1.wayPoint].x;
if (_local2 >= _local1.speedY) {
_local1.yPos = _local1.yPos - _local1.speedY;
_local1.yDirection = "up";
} else if (_local2 <= (-_local1.speedY)) {
_local1.yPos = _local1.yPos + _local1.speedY;
_local1.yDirection = "down";
} else {
_local1.yDirection = "straight";
}
if (_local3 <= (-_local1.speedX)) {
_local1.xPos = _local1.xPos + _local1.speedX;
_local1.xDirection = "right";
} else if (_local3 >= _local1.speedX) {
_local1.xPos = _local1.xPos - _local1.speedX;
_local1.xDirection = "left";
} else {
_local1.xDirection = "straight";
}
_local2 = _local1.yPos - _local1.wayPoints[_local1.wayPoint].y;
_local3 = _local1.xPos - _local1.wayPoints[_local1.wayPoint].x;
if ((((_local2 < _local1.speedY) && (_local2 > (-_local1.speedY))) && (_local3 > (-_local1.speedX))) && (_local3 < _local1.speedX)) {
if (_local1.wayPoint < (_local1.wayPoints.length - 1)) {
_local1.wayPoint++;
} else if (_local1.mileStone < (_local1.mileStones.length - 1)) {
delete _local1.wayPoints;
} else {
_local1.characterLivingCount--;
_local1.removeAsCharacter();
_local1.removeMovieClip();
}
}
var positionX = (_local1.xPos + screenControl.currentX);
var positionY = (_local1.yPos + screenControl.currentY);
_local1.imLive = false;
_local1.imLive = true;
if (_local1.yDirection == "up") {
if (_local1.xDirection == "right") {
_local1.pose = "pose9";
} else if (_local1.xDirection == "straight") {
_local1.pose = "pose8";
} else if (_local1.xDirection == "left") {
_local1.pose = "pose7";
}
} else if (_local1.yDirection == "straight") {
if (_local1.xDirection == "right") {
_local1.pose = "pose6";
} else if (_local1.xDirection == "straight") {
} else if (_local1.xDirection == "left") {
_local1.pose = "pose4";
}
} else if (_local1.yDirection == "down") {
if (_local1.xDirection == "right") {
_local1.pose = "pose3";
} else if (_local1.xDirection == "straight") {
_local1.pose = "pose2";
} else if (_local1.xDirection == "left") {
_local1.pose = "pose1";
}
}
if (_local1.atIdleDepth) {
_local1.atIdleDepth = false;
}
_local1.swapDepths((positionY * 350) + _local1.uniqueDepth);
if (!(_local1.oldPose === _local1.pose)) {
_local1.gotoAndStop(_local1.pose);
_local1.poseClip.play();
_local1.oldPose = _local1.pose;
}
_local1._x = _local1.xPos;
_local1._y = _local1.yPos;
}
};
newCharacter.onPause = function () {
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
};
newCharacter.onPress = function () {
var _local1 = this;
var _local2 = _root;
if (!timeControl.gamePaused) {
mouseX = Math.round(_local2._xmouse - screenControl.currentX);
mouseY = Math.round(_local2._ymouse - screenControl.currentY);
characterX = _local2.gameScreen.mainCharacter._x;
characterY = _local2.gameScreen.mainCharacter._y;
screenControl.clickCharacter(mouseX, mouseY, characterX, characterY, _local1.type, _local1.sex, _local1.firstname, _local1.lastname, _local1.head, _local1);
}
};
newCharacter.useHandCursor = false;
};
GameObject.prototype.createMainCharacter = function (xPos, yPos, direction) {
var _local1 = this;
_local1.characterCount++;
_local1.characterLivingCount++;
var uniqueDepth = _local1.getUniqueDepth("character");
newAvatar = _local1.avatars[Math.floor(Math.random() * _local1.avatars.length)];
newCharacter = _root.gameScreen.attachMovie("character35", "character" + _local1.characterCount, uniqueDepth);
newCharacter.id = _local1.characterCount;
newCharacter._x = xPos;
newCharacter._y = yPos;
_local1.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 () {
var _local1 = this;
if (_local1.waiting) {
} else if ((_local1.wayPoints.length < 1) && (!_local1.waiting)) {
_local1.mileStone = 1;
_local1.wayPoint = 1;
if (!(_local1.mileStones[1] === undefined)) {
pathObj = new Object();
pathObj.start = screenControl.getCoordinates(_local1.mileStones[_local1.mileStone - 1].x, _local1.mileStones[_local1.mileStone - 1].y);
pathObj.end = screenControl.getCoordinates(_local1.mileStones[_local1.mileStone].x, _local1.mileStones[_local1.mileStone].y);
pathObj.xcor = _local1.mileStones[_local1.mileStone].x;
pathObj.ycor = _local1.mileStones[_local1.mileStone].y;
pathObj.mc = _local1;
pathObj.depth = 50;
gameControl.waitForPath.unshift(pathObj);
_local1.waiting = true;
}
_local1.poseClip.gotoAndStop(1);
_local1.oldPose = "idle";
} else {
var _local2 = _local1.yPos - _local1.wayPoints[_local1.wayPoint].y;
var _local3 = _local1.xPos - _local1.wayPoints[_local1.wayPoint].x;
if (_local2 >= _local1.speedY) {
_local1.yPos = _local1.yPos - _local1.speedY;
_local1.yDirection = "up";
} else if (_local2 <= (-_local1.speedY)) {
_local1.yPos = _local1.yPos + _local1.speedY;
_local1.yDirection = "down";
} else {
_local1.yDirection = "straight";
}
if (_local3 <= (-_local1.speedX)) {
_local1.xPos = _local1.xPos + _local1.speedX;
_local1.xDirection = "right";
} else if (_local3 >= _local1.speedX) {
_local1.xPos = _local1.xPos - _local1.speedX;
_local1.xDirection = "left";
} else {
_local1.xDirection = "straight";
}
_local2 = _local1.yPos - _local1.wayPoints[_local1.wayPoint].y;
_local3 = _local1.xPos - _local1.wayPoints[_local1.wayPoint].x;
if ((((_local2 < _local1.speedY) && (_local2 > (-_local1.speedY))) && (_local3 > (-_local1.speedX))) && (_local3 < _local1.speedX)) {
if (_local1.wayPoint < (_local1.wayPoints.length - 1)) {
_local1.wayPoint++;
// unexpected jump
}
trace((("this.mileStone=" + _local1.mileStone) + " , this.mileStones.length=") + _local1.mileStones.length);
if (_local1.mileStone < (_local1.mileStones.length - 1)) {
trace("at first milestone.. but not at the second one yet");
delete _local1.wayPoints;
_local1.mileStones.shift();
_local1._x = _local1.xPos;
_local1._y = _local1.yPos;
if (!(_local1.oldPose === _local1.pose)) {
_local1.gotoAndStop(_local1.pose);
_local1.poseClip.gotoAndStop(1);
_local1.oldPose = "idle";
}
return;
}
delete _local1.wayPoints;
delete _local1.mileStones;
if (!(_local1.myendpose === undefined)) {
_local1.pose = _local1.myendpose;
_local1.gotoAndStop(_local1.pose);
}
_local1.oldPose = "idle";
_local1.poseClip.gotoAndStop(1);
if (!(_local1.myendfunction === undefined)) {
_local1.myendfunction(_local1);
}
_local1.myendfunction = undefined;
_local1.myendpose = undefined;
} else {
var positionX = (_local1.xPos + screenControl.currentX);
var positionY = (_local1.yPos + screenControl.currentY);
_local1.imLive = false;
_local1.imLive = true;
if (_local1.handsfull == "band") {
_local1.extrapossNumber = 9;
} else if (_local1.handsfull == "voorvleugel") {
_local1.extrapossNumber = 21;
} else if (_local1.handsfull == "achtervleugel") {
_local1.extrapossNumber = 30;
} else if (_local1.handsfull == "voorvleugeloud") {
_local1.extrapossNumber = 21;
} else if (_local1.handsfull == "voorvleugeloud2") {
_local1.extrapossNumber = 56;
} else if (_local1.handsfull == "achtervleugeloud") {
_local1.extrapossNumber = 30;
} else if (_local1.handsfull == "achtervleugeloud2") {
_local1.extrapossNumber = 47;
} else {
_local1.extrapossNumber = 0;
}
if (_local1.yDirection == "up") {
if (_local1.xDirection == "right") {
_local1.pose = "pose" + (9 + _local1.extrapossNumber);
} else if (_local1.xDirection == "straight") {
_local1.pose = "pose" + (8 + _local1.extrapossNumber);
} else if (_local1.xDirection == "left") {
_local1.pose = "pose" + (7 + _local1.extrapossNumber);
}
} else if (_local1.yDirection == "straight") {
if (_local1.xDirection == "right") {
_local1.pose = "pose" + (6 + _local1.extrapossNumber);
} else if (_local1.xDirection == "straight") {
} else if (_local1.xDirection == "left") {
_local1.pose = "pose" + (4 + _local1.extrapossNumber);
}
} else if (_local1.yDirection == "down") {
if (_local1.xDirection == "right") {
_local1.pose = "pose" + (3 + _local1.extrapossNumber);
} else if (_local1.xDirection == "straight") {
_local1.pose = "pose" + (2 + _local1.extrapossNumber);
} else if (_local1.xDirection == "left") {
_local1.pose = "pose" + (1 + _local1.extrapossNumber);
}
}
if (_local1.atIdleDepth) {
_local1.atIdleDepth = false;
}
_local1.swapDepths((positionY * 350) + _local1.uniqueDepth);
if (!(_local1.oldPose === _local1.pose)) {
_local1.gotoAndStop(_local1.pose);
_local1.poseClip.play();
_local1.oldPose = _local1.pose;
}
_local1._x = _local1.xPos;
_local1._y = _local1.yPos;
}
}
};
newCharacter.onPress = function () {
if (!timeControl.gamePaused) {
var _local1 = this;
screenControl.clickCharacter(_local1);
}
};
newCharacter.useHandCursor = true;
newCharacter.onPause = function () {
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
};
};
GameObject.prototype.createPoliceCharacter = function (xPos, yPos, direction) {
var _local1 = this;
_local1.characterCount++;
var uniqueDepth = _local1.getUniqueDepth("character");
newAvatar = _local1.avatars[Math.floor(Math.random() * _local1.avatars.length)];
newCharacter = _root.gameScreen.attachMovie("character35", "police", uniqueDepth);
newCharacter._x = xPos;
newCharacter._y = yPos;
_local1.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 () {
var _local1 = this;
if (_local1.waiting) {
} else if ((_local1.wayPoints.length < 1) && (!_local1.waiting)) {
_local1.mileStone = 1;
_local1.wayPoint = 1;
if (!(_local1.mileStones[1] === undefined)) {
pathObj = new Object();
pathObj.start = screenControl.getCoordinates(_local1.mileStones[_local1.mileStone - 1].x, _local1.mileStones[_local1.mileStone - 1].y);
pathObj.end = screenControl.getCoordinates(_local1.mileStones[_local1.mileStone].x, _local1.mileStones[_local1.mileStone].y);
pathObj.mc = _local1;
pathObj.depth = 50;
gameControl.waitForPath.unshift(pathObj);
_local1.waiting = true;
} else {
delete _local1.wayPoints;
delete _local1.mileStones;
_local1.oldPose = "idle";
_local1.poseClip.gotoAndStop(1);
gameControl.getPoliceMileStone(_local1);
}
_local1.poseClip.gotoAndStop(1);
_local1.oldPose = "idle";
} else {
var diffY = (_local1.yPos - _local1.wayPoints[_local1.wayPoint].y);
var diffX = (_local1.xPos - _local1.wayPoints[_local1.wayPoint].x);
if (diffY >= _local1.speedY) {
_local1.yPos = _local1.yPos - _local1.speedY;
_local1.yDirection = "up";
} else if (diffY <= (-_local1.speedY)) {
_local1.yPos = _local1.yPos + _local1.speedY;
_local1.yDirection = "down";
} else {
_local1.yDirection = "straight";
}
if (diffX <= (-_local1.speedX)) {
_local1.xPos = _local1.xPos + _local1.speedX;
_local1.xDirection = "right";
} else if (diffX >= _local1.speedX) {
_local1.xPos = _local1.xPos - _local1.speedX;
_local1.xDirection = "left";
} else {
_local1.xDirection = "straight";
}
var diffY = (_local1.yPos - _local1.wayPoints[_local1.wayPoint].y);
var diffX = (_local1.xPos - _local1.wayPoints[_local1.wayPoint].x);
if ((((diffY < _local1.speedY) && (diffY > (-_local1.speedY))) && (diffX > (-_local1.speedX))) && (diffX < _local1.speedX)) {
if (_local1.wayPoint < (_local1.wayPoints.length - 1)) {
_local1.wayPoint++;
} else {
delete _local1.wayPoints;
delete _local1.mileStones;
_local1.oldPose = "idle";
_local1.poseClip.gotoAndStop(1);
gameControl.getPoliceMileStone(_local1);
}
}
var _local3 = _local1.xPos + screenControl.currentX;
var _local2 = _local1.yPos + screenControl.currentY;
_local1.imLive = false;
if ((((_local2 > 82) && (_local2 < 418)) && (_local3 > 52)) && (_local3 < 541)) {
_local1.imLive = true;
if (_local1.yDirection == "up") {
if (_local1.xDirection == "right") {
_local1.pose = "pose9";
} else if (_local1.xDirection == "straight") {
_local1.pose = "pose8";
} else if (_local1.xDirection == "left") {
_local1.pose = "pose7";
}
} else if (_local1.yDirection == "straight") {
if (_local1.xDirection == "right") {
_local1.pose = "pose6";
} else if (_local1.xDirection == "straight") {
} else if (_local1.xDirection == "left") {
_local1.pose = "pose4";
}
} else if (_local1.yDirection == "down") {
if (_local1.xDirection == "right") {
_local1.pose = "pose3";
} else if (_local1.xDirection == "straight") {
_local1.pose = "pose2";
} else if (_local1.xDirection == "left") {
_local1.pose = "pose1";
}
}
if (_local1.atIdleDepth) {
_local1.atIdleDepth = false;
}
_local1.swapDepths((_local2 * 350) + _local1.uniqueDepth);
if (!(_local1.oldPose === _local1.pose)) {
_local1.gotoAndStop(_local1.pose);
_local1.poseClip.play();
_local1.oldPose = _local1.pose;
}
_local1._x = _local1.xPos;
_local1._y = _local1.yPos;
} else if (!_local1.atIdleDepth) {
_local1.swapDepths(500000 + _local1.uniqueDepth);
_local1.atIdleDepth = true;
boundingX = 1850 + (Math.random() * 165);
boundingY = 200 + (Math.random() * 88);
_local1._x = boundingX;
_local1._y = boundingY;
_local1.oldPose = "idle";
_local1.poseClip.gotoAndStop(1);
}
}
};
newCharacter.onPause = function () {
this.oldPose = "idle";
this.poseClip.gotoAndStop(1);
};
};
GameObject.prototype.getPoliceMileStone = function (name) {
var _local1 = this;
newCharacter = name;
direction = "notimportant";
_local1.nextWaypoint = {x:newCharacter.xPos, y:newCharacter.yPos, direction:direction};
_local1.saveMileStone(_local1.nextWaypoint);
exPos = (_root.gameScreen.mainCharacter.xPos + Math.ceil(Math.random() * 800)) - 400;
eyPos = (_root.gameScreen.mainCharacter.yPos + Math.ceil(Math.random() * 800)) - 400;
_local1.nextWaypoint = {x:exPos, y:eyPos, direction:direction};
if (_local1.checkWaypoint(_local1.nextWaypoint)) {
_local1.saveMileStone(_local1.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) {
var _local1 = obj;
if (newCharacter.mileStones == undefined) {
newCharacter.mileStones = new Array();
}
if ((_local1.x == undefined) || (_local1.y == undefined)) {
trace("Property undefined for current waypoint...");
} else {
newCharacter.mileStones.push({x:_local1.x, y:_local1.y, xcor:_local1.xcor, ycor:_local1.ycor, direction:_local1.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) {
var _local1 = this;
startTimer = getTimer();
currentX = obj.x;
currentY = obj.y;
tmpArray = new Array();
i = 0;
while (i < _local1.characterZone.length) {
diffX = Math.abs(currentX - _local1.characterZone[i].x);
diffY = Math.abs(currentY - _local1.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 = _local1.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 () {
var _local1 = this;
_root.characterLivingCount = _local1.characterLivingCount;
if (_local1.characterLivingCount >= 10) {
} else {
var _local2 = math.ceil((math.random() * _local1.createZonePercentage.length) - 1);
var _local3 = _local1.createZone[_local1.createZonePercentage[_local2]].startPosX;
var startPosY2 = _local1.createZone[_local1.createZonePercentage[_local2]].startPosY;
var dir = _local1.createZone[_local1.createZonePercentage[_local2]].dir;
var maxlength = (_local1.createZonePercentage.length - 1);
_local1.createZonePercentage[_local2] = _local1.createZonePercentage[maxlength];
_local1.createZonePercentage.pop();
_local1.createMainCharacter(_local3, startPosY2, dir);
}
};
GameObject.prototype.deleteCreateZone = function (zoneNumber) {
var _local1 = this;
var _local2 = zoneNumber;
i = _local1.createZonePercentage.length;
while (i >= 0) {
if (_local1.createZonePercentage[i] == _local2) {
_local1.createZonePercentage.splice(i, 1);
}
i--;
}
};
GameObject.prototype.addCreateZone = function (zoneNumber, times) {
var _local1 = zoneNumber;
var _local2 = times;
var _local3 = this;
i = 0;
while (i <= _local2) {
_local3.createZonePercentage.push(_local1);
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 () {
var _local1 = this;
_local1.waitForPath = new Array();
_local1.baseDepth = 1000;
_local1.baseIdleDepth = 100000 /* 0x0186A0 */;
_local1.initializeAvatars();
_local1.initializeEndZones();
_local1.initializeCreateZones();
};
PathObject = function (fStart, fEnd, fDepth, fLevel) {
this.init(fStart, fEnd, fDepth, fLevel);
};
PathObject.prototype.init = function (fStart, fEnd, fDepth, fLevel) {
var _local1 = this;
_local1.start = fStart;
_local1.end = fEnd;
_local1.depth = fDepth;
_local1.level = 3;
};
PathObject.prototype.runPathFinder = function () {
if (gameControl.waitForPath.length > 0) {
this.$runPathFinder();
}
};
PathObject.prototype.$runPathFinder = function () {
var _local1 = this;
gameControl.waitForPath[0].start;
start = (_local1.start = gameControl.waitForPath[0].start);
end = (_local1.end = gameControl.waitForPath[0].end);
xcor = (_local1.xcor = gameControl.waitForPath[0].xcor);
ycor = (_local1.ycor = gameControl.waitForPath[0].ycor);
gameControl.waitForPath[0].mc.wayPoints = _local1.findPath();
gameControl.waitForPath[0].mc.waiting = false;
shifted = gameControl.waitForPath.shift();
};
PathObject.prototype.findPath = function () {
var _local1 = this;
trace("------------------------------------------");
var _local2 = [];
_local2[0] = _local1.$findPath(_local1.start, _local1.end, 1, false);
if (_local1.level > 0) {
_local2[1] = _local1.$findPath(_local1.start, _local1.end, 0, false);
}
if (_local1.level > 1) {
_local2[2] = _local1.$findPath(_local1.end, _local1.start, 1, true);
}
if (_local1.level > 2) {
_local2[3] = _local1.$findPath(_local1.end, _local1.start, 0, true);
}
if (_local1.level > 3) {
_local2[4] = _local1.$findPath(_local1.start, _local1.end, 1, false, true);
}
if (_local1.level > 4) {
_local2[5] = _local1.$findPath(_local1.start, _local1.end, 0, false, true);
}
if (_local1.level > 5) {
_local2[6] = _local1.$findPath(_local1.end, _local1.start, 1, true, true);
}
if (_local1.level > 6) {
_local2[7] = _local1.$findPath(_local1.end, _local1.start, 0, true, true);
}
_local2.sort($pathsort);
if (_local2[0].weight == 1000) {
trace("NOG STEEDS EEN DUIZEND PAD");
}
_local2[0].wayPoints.push({x:_local1.xcor, y:_local1.ycor});
return(_local2[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 _local2 = fStart.x;
var _local1 = fStart.y;
var pathWeight = 0;
var waypoints = [];
var waypointsSub = [];
var _local3 = fEnd.x;
var endy = fEnd.y;
var fDir = Dir;
if ((_local3 == _local2) && (endy == _local1)) {
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 = (_local2 * screenControl.tileWidth) - (screenControl.tileWidth / 2);
newy = (_local1 * screenControl.tileHeight) - (screenControl.tileHeight / 2);
wayPointsSub.push({x:_local2, y:_local1});
wayPoints.push({x:newx, y:newy});
pathWeight++;
if (fRev && (pathWeight < 10000)) {
wayPoints.reverse();
}
return({wayPoints:wayPoints, weight:pathWeight});
}
if ((_local2 == wayPointsSub[pathWeight - 3].x) && (_local1 == 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 = (_local2 * screenControl.tileWidth) - (screenControl.tileWidth / 2);
newy = (_local1 * screenControl.tileHeight) - (screenControl.tileHeight / 2);
wayPointsSub.push({x:_local2, y:_local1});
wayPoints.push({x:newx, y:newy});
pathWeight++;
if ((_local3 == _local2) && (endy == _local1)) {
} else if (pathWeight > this.depth) {
pathWeight = 10000;
} else if (fDir) {
if ((((((_local2 < _local3) && (_local1 > endy)) && ((oldx != (_local2 + 1)) || (oldy != (_local1 - 1)))) && ((oldx2 != (_local2 + 1)) || (oldy != (_local1 - 1)))) && (map[_local2 + 1][_local1 - 1])) && (map[_local2 + 1][_local1] || (map[_local2][_local1 - 1]))) {
_local2++;
_local1--;
// unexpected jump
}
if ((((((_local2 < _local3) && (_local1 < endy)) && ((oldx != (_local2 + 1)) || (oldy != (_local1 + 1)))) && ((oldx2 != (_local2 + 1)) || (oldy != (_local1 + 1)))) && (map[_local2 + 1][_local1 + 1])) && (map[_local2 + 1][_local1] || (map[_local2][_local1 + 1]))) {
_local2++;
_local1++;
// unexpected jump
}
if ((((((_local2 > _local3) && (_local1 < endy)) && ((oldx != (_local2 - 1)) || (oldy != (_local1 + 1)))) && ((oldx2 != (_local2 - 1)) || (oldy != (_local1 + 1)))) && (map[_local2 - 1][_local1 + 1])) && (map[_local2 - 1][_local1] || (map[_local2][_local1 + 1]))) {
_local2--;
_local1++;
// unexpected jump
}
if ((((((_local2 > _local3) && (_local1 > endy)) && ((oldx != (_local2 - 1)) || (oldy != (_local1 - 1)))) && ((oldx2 != (_local2 - 1)) || (oldy != (_local1 - 1)))) && (map[_local2 - 1][_local1 - 1])) && (map[_local2 - 1][_local1] || (map[_local2][_local1 - 1]))) {
_local2--;
_local1--;
// unexpected jump
}
if (((_local2 < _local3) && (oldx != (_local2 + 1))) && (map[_local2 + 1][_local1])) {
_local2++;
// unexpected jump
}
if (((_local2 > _local3) && (oldx != (_local2 - 1))) && (map[_local2 - 1][_local1])) {
_local2--;
// unexpected jump
}
if (((_local1 < endy) && (oldy != (_local1 + 1))) && (map[_local2][_local1 + 1])) {
_local1++;
// unexpected jump
}
if (((_local1 > endy) && (oldy != (_local1 - 1))) && (map[_local2][_local1 - 1])) {
_local1--;
// unexpected jump
}
if (_local2 == _local3) {
if ((oldx != (_local2 + 1)) && (map[_local2 + 1][_local1])) {
_local2++;
// unexpected jump
}
if ((oldx != (_local2 - 1)) && (map[_local2 - 1][_local1])) {
_local2--;
// unexpected jump
}
// unexpected jump
}
if (_local1 == endy) {
if ((oldy != (_local1 + 1)) && (map[_local2][_local1 + 1])) {
_local1++;
// unexpected jump
}
if ((oldy != (_local1 - 1)) && (map[_local2][_local1 - 1])) {
_local1--;
// unexpected jump
}
}
if (fpref) {
if ((oldx != (_local2 - 1)) && (map[_local2 - 1][_local1])) {
_local2--;
// unexpected jump
}
if (((_local2 > _local3) && (oldx != (_local2 + 1))) && (map[_local2 + 1][_local1])) {
_local2++;
// unexpected jump
}
if ((oldy != (_local1 - 1)) && (map[_local2][_local1 - 1])) {
_local1--;
// unexpected jump
}
if (((_local1 > endy) && (oldy != (_local1 + 1))) && (map[_local2][_local1 + 1])) {
_local1++;
// unexpected jump
}
// unexpected jump
}
if (((_local1 > endy) && (oldy != (_local1 + 1))) && (map[_local2][_local1 + 1])) {
_local1++;
// unexpected jump
}
if (((_local1 < endy) && (oldy != (_local1 - 1))) && (map[_local2][_local1 - 1])) {
_local1--;
// unexpected jump
}
if (((_local2 > _local3) && (oldx != (_local2 + 1))) && (map[_local2 + 1][_local1])) {
_local2++;
// unexpected jump
}
if (((_local2 < _local3) && (oldx != (_local2 - 1))) && (map[_local2 - 1][_local1])) {
_local2--;
// unexpected jump
}
var escaping = 0;
if (!map[_local2 + 1][_local1]) {
escaping = escaping + 1;
}
if (!map[_local2 - 1][_local1]) {
escaping = escaping + 1;
}
if (!map[_local2][_local1 + 1]) {
escaping = escaping + 1;
}
if (!map[_local2][_local1 - 1]) {
escaping = escaping + 1;
}
if (escaping == 3) {
_local2 = oldx;
_local1 = oldy;
pathWeight = 10000;
trace("escaped fail, break");
// unexpected jump
}
trace("killing");
pathWeight = 10000;
} else {
if ((((((_local2 < _local3) && (_local1 > endy)) && ((oldx != (_local2 + 1)) || (oldy != (_local1 - 1)))) && ((oldx2 != (_local2 + 1)) || (oldy != (_local1 - 1)))) && (map[_local2 + 1][_local1 - 1])) && (map[_local2 + 1][_local1] || (map[_local2][_local1 - 1]))) {
_local2++;
_local1--;
// unexpected jump
}
if ((((((_local2 < _local3) && (_local1 < endy)) && ((oldx != (_local2 + 1)) || (oldy != (_local1 + 1)))) && ((oldx2 != (_local2 + 1)) || (oldy != (_local1 + 1)))) && (map[_local2 + 1][_local1 + 1])) && (map[_local2 + 1][_local1] || (map[_local2][_local1 + 1]))) {
_local2++;
_local1++;
// unexpected jump
}
if ((((((_local2 > _local3) && (_local1 < endy)) && ((oldx != (_local2 - 1)) || (oldy != (_local1 + 1)))) && ((oldx2 != (_local2 - 1)) || (oldy != (_local1 + 1)))) && (map[_local2 - 1][_local1 + 1])) && (map[_local2 - 1][_local1] || (map[_local2][_local1 + 1]))) {
_local2--;
_local1++;
// unexpected jump
}
if ((((((_local2 > _local3) && (_local1 > endy)) && ((oldx != (_local2 - 1)) || (oldy != (_local1 - 1)))) && ((oldx2 != (_local2 - 1)) || (oldy != (_local1 - 1)))) && (map[_local2 - 1][_local1 - 1])) && (map[_local2 - 1][_local1] || (map[_local2][_local1 - 1]))) {
_local2--;
_local1--;
// unexpected jump
}
if (((_local1 < endy) && (oldy != (_local1 + 1))) && (map[_local2][_local1 + 1])) {
_local1++;
// unexpected jump
}
if (((_local1 > endy) && (oldy != (_local1 - 1))) && (map[_local2][_local1 - 1])) {
_local1--;
// unexpected jump
}
if (((_local2 < _local3) && (oldx != (_local2 + 1))) && (map[_local2 + 1][_local1])) {
_local2++;
// unexpected jump
}
if (((_local2 > _local3) && (oldx != (_local2 - 1))) && (map[_local2 - 1][_local1])) {
_local2--;
// unexpected jump
}
if (_local1 == endy) {
if ((oldy != (_local1 + 1)) && (map[_local2][_local1 + 1])) {
_local1++;
// unexpected jump
}
if ((oldy != (_local1 - 1)) && (map[_local2][_local1 - 1])) {
_local1--;
// unexpected jump
}
// unexpected jump
}
if (_local2 == _local3) {
if ((oldx != (_local2 + 1)) && (map[_local2 + 1][_local1])) {
_local2++;
// unexpected jump
}
if ((oldx != (_local2 - 1)) && (map[_local2 - 1][_local1])) {
_local2--;
// unexpected jump
}
}
if (fpref) {
if (((_local1 < endy) && (oldy != (_local1 - 1))) && (map[_local2][_local1 - 1])) {
_local1--;
// unexpected jump
}
if ((oldy != (_local1 + 1)) && (map[_local2][_local1 + 1])) {
_local1++;
// unexpected jump
}
if (((_local2 < _local3) && (oldx != (_local2 - 1))) && (map[_local2 - 1][_local1])) {
_local2--;
// unexpected jump
}
if ((oldx != (_local2 + 1)) && (map[_local2 + 1][_local1])) {
_local2++;
// unexpected jump
}
// unexpected jump
}
if ((_local2 < _local3) && (map[_local2 - 1][_local1])) {
_local2--;
// unexpected jump
}
if ((_local2 > _local3) && (map[_local2 + 1][_local1])) {
_local2++;
// unexpected jump
}
if ((_local1 < endy) && (map[_local2][_local1 - 1])) {
_local1--;
// unexpected jump
}
if ((_local1 > endy) && (map[_local2][_local1 + 1])) {
_local1++;
// unexpected jump
}
var escaping = 0;
if (!map[_local2 + 1][_local1]) {
escaping = escaping + 1;
}
if (!map[_local2 - 1][_local1]) {
escaping = escaping + 1;
}
if (!map[_local2][_local1 + 1]) {
escaping = escaping + 1;
}
if (!map[_local2][_local1 - 1]) {
escaping = escaping + 1;
}
if (escaping == 3) {
_local2 = oldx;
_local1 = 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) {
var _local1 = this;
var _local2 = _root;
_global.timeControl.resetTime();
_global.timeControl.timePaused = false;
currentcar = _local2.carholder_mc.attachMovie(style, "car_mc", 5);
currentcar._x = xPos;
currentcar._y = yPos;
levelControl.getCarStatus();
currentcar.getspot = function () {
var _local1 = this;
carX = Math.round(_local1._x - screenControl.currentX);
carY = Math.round(_local1._y - screenControl.currentY);
myObj = screenControl.getCoordinates(carX, carY);
_local1.startx = myObj.x - 1;
_local1.starty = myObj.y - 1;
};
currentcar.turnstartspoton = function () {
var _local1 = this;
var _local3 = _root;
_local1.getspot();
var maxlength = (_local1.startx + 15);
var _local2 = _local1.starty + 6;
i = _local1.startx;
while (i <= maxlength) {
j = _local1.starty;
while (j <= _local2) {
map[i][j] = 0;
_local3.settile(i, j, 0);
j++;
}
i++;
}
_local1.oldstartx = _local1.startx;
_local1.oldstarty = _local1.starty;
};
currentcar.turnspoton = function () {
var _local1 = this;
var _local3 = _root;
_local1.getspot();
var diffx = (_local1.oldstartx - _local1.startx);
_local1.startx = _local1.startx - diffx;
var maxlength = (_local1.startx + diffx);
var _local2 = _local1.starty + 6;
i = _local1.startx + 1;
while (i <= maxlength) {
j = _local1.starty;
while (j <= _local2) {
map[i + 1][j] = 0;
_local3.settile(i + 1, j, 0);
j++;
}
i++;
}
_local1.oldstartx = _local1.startx + diffx;
_local1.oldstarty = _local1.starty;
};
currentcar.turnendspotoff = function () {
var _local1 = this;
var _local3 = _root;
_local1.getspot();
if (_local1.startx == _local1.oldstartx) {
} else {
var maxlength = (_local1.oldstartx + 15);
var _local2 = _local1.oldstarty + 6;
i = _local1.oldstartx;
while (i <= maxlength) {
j = _local1.oldstarty + 1;
while (j <= _local2) {
map[i][j] = 1;
_local3.settile(i, j, 1);
j++;
}
i++;
}
}
};
currentcar.turnspotoff = function () {
var _local1 = this;
var _local3 = _root;
_local1.getspot();
if (_local1.startx == _local1.oldstartx) {
} else {
_local1.startx = _local1.startx + 15;
var maxlength = (_local1.oldstartx + 15);
var _local2 = _local1.starty + 6;
i = _local1.startx;
while (i <= maxlength) {
j = _local1.starty;
while (j <= _local2) {
if ((i < 0) || (i >= 35)) {
} else {
map[i][j] = 1;
_local3.settile(i, j, 1);
}
j++;
}
i++;
}
if (((_local1.startx - 1) >= 0) && ((_local1.startx - 1) < 35)) {
map[_local1.startx - 1][_local1.starty] = 1;
_local3.settile(_local1.startx - 1, _local1.starty, 1);
map[_local1.startx - 1][_local1.starty + 6] = 1;
_local3.settile(_local1.startx - 1, _local1.starty + 6, 1);
}
_local1.turnspoton();
}
};
currentcar._speedx = 20;
currentcar.onmove = function () {
var _local1 = this;
var _local2 = _root;
if (!_local1.inspot) {
if (((_local1._x - 20) <= 600) && (_local2.lollipop_mc._currentframe == 1)) {
_local2.lollipop_mc.gotoAndPlay(2);
}
if ((_local1._x - 20) <= 220) {
_local1._x = 220;
_local2.wiping_total.gotoAndPlay(2);
_local2.alarm1_mc.gotoAndStop(1);
_local2.alarm2_mc.gotoAndStop(1);
clearInterval(_local2.alarmInterval);
_local2.alarmInterval = undefined;
_local2.sound_engine_mc.gotoAndPlay("idle");
_local1.inspot = true;
_local1._speedx = 0;
return;
}
var xPos = _local1._x;
var _local3 = _local1._y;
if (carControl.checkfreeway(xPos, _local3)) {
if (_local1._speedx == 0) {
_local2.sound_engine_mc.gotoAndPlay("arriving");
}
if ((_local1._speedx < 20) || (_local1._x == undefined)) {
_local1._speedx = _local1._speedx + 1;
}
_local1._x = _local1._x - _local1._speedx;
} else {
_local1._speedx = 0;
if (!(_local2.enginesound === "idle")) {
_local2.sound_engine_mc.gotoAndPlay("idle");
}
}
if (_local1._x < -260) {
_local1.removeMovieClip();
}
_local1.turnspotoff();
} else if (_local1.exit) {
var xPos = _local1._x;
var _local3 = _local1._y;
if (carControl.checkfreewayexit(xPos, _local3)) {
if (_local1._speedx == 0) {
_local2.sound_engine_mc.gotoAndPlay("leaving");
}
if ((_local1._speedx < 20) || (_local1._x == undefined)) {
_local1._speedx = _local1._speedx + 1;
}
_local1._x = _local1._x - _local1._speedx;
} else {
_local1._speedx = 0;
if (!(_local2.enginesound === "idle")) {
_local2.sound_engine_mc.gotoAndPlay("idle");
}
}
if (_local1._x < -260) {
timeControl.stopTime();
timeControl.saveTime();
levelControl.chckpitstops();
_local1.removeMovieClip();
}
_local1.turnspotoff();
}
};
currentcar.onEnterFrame = function () {
this.onmove();
};
currentcar.turnstartspoton();
};
CarObject.prototype.checkfreeway = function (xPos, yPos) {
var _local2 = _root;
var _local3 = xPos;
i = 1;
while (i <= 10) {
var _local1 = _local2.gameScreen["character" + i];
if ((_local1._y < (_local2.line1_mc._y - 7)) || (_local1._y > (_local2.line2_mc._y + 7))) {
} else if ((_local1._x < (_local3 - 40)) || (_local1._x > (_local3 + 30))) {
} else {
return(false);
}
i++;
}
return(true);
};
CarObject.prototype.checkfreewayexit = function (xPos, yPos) {
var _local2 = _root;
var _local3 = xPos;
i = 1;
while (i <= 10) {
var _local1 = _local2.gameScreen["character" + i];
if ((_local1._y < (_local2.line1_mc._y - 7)) || (_local1._y > (_local2.line2_mc._y + 7))) {
} else if ((_local1._x < (_local3 - 60)) || (_local1._x > _local3)) {
} else {
return(false);
}
i++;
}
return(true);
};
CarObject.prototype.start_alarm_Sound = function () {
alarm_Sound.start();
};
actionObject = function () {
this.initActions();
};
actionObject.prototype.initActions = function () {
var _local1 = this;
var _local2 = _root;
_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 = _local1.PickupFronttire;
ctarget.mc = _local2.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 = _local1.PickupFronttire;
ctarget.mc = _local2.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 = _local1.PickupBacktire;
ctarget.mc = _local2.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 = _local1.PickupBacktire;
ctarget.mc = _local2.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 = _local1.AssistFrontTire1;
ctarget.mc = _local2.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 = _local1.Generalendfunction;
ctarget.mc = _local2.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 = _local1.AssistBackTire1;
ctarget.mc = _local2.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 = _local1.Generalendfunction;
ctarget.mc = _local2.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 = _local1.AssistFrontTire2;
ctarget.mc = _local2.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 = _local1.Generalendfunction;
ctarget.mc = _local2.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 = _local1.AssistBackTire2;
ctarget.mc = _local2.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 = _local1.Generalendfunction;
ctarget.mc = _local2.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 = _local1.PickupFrontwing;
ctarget.mc = _local2.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 = _local1.PickupBackwing;
ctarget.mc = _local2.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 = _local1.Generalendfunction;
ctarget.mc = _local2.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 = _local1.Generalendfunction;
ctarget.mc = _local2.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 = _local1.ChangeFrontTire1;
ctarget.mc = _local2.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 = _local1.ChangeBackTire1;
ctarget.mc = _local2.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 = _local1.ChangeFrontTire2;
ctarget.mc = _local2.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 = _local1.ChangeBackTire2;
ctarget.mc = _local2.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 = _local1.AssistFrontWing;
ctarget.mc = _local2.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 = _local1.AssistBackWing;
ctarget.mc = _local2.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 = _local1.takeofffrontwing;
ctarget.mc = _local2.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 = _local1.takeoffbackwing;
ctarget.mc = _local2.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 = _local1.putonfrontwing;
ctarget.mc = _local2.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 = _local1.putonbackwing;
ctarget.mc = _local2.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 = _local1.dropfrontwing;
ctarget.mc = _local2.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 = _local1.dropbackwing;
ctarget.mc = _local2.actionsTotal.action27_mc;
ctarget.pose = "pose42";
};
actionObject.prototype.selectAction = function (Obj) {
var _local2 = Obj;
trace("currentaction, myAction=" + _local2.myAction);
this.deselectAction();
if (_local2.handsfull == "band") {
trace("aparte array, omdat de handjes vol zitten met een bandje");
_root.temparray = actionObj["action" + _local2.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if (_local2.handsfull == "voorvleugel") {
trace("aparte array, omdat de handjes vol zitten met een achtervleugel");
_root.temparray = actionObj["action" + _local2.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if (_local2.handsfull == "achtervleugel") {
trace("aparte array, omdat de handjes vol zitten met een achtervleugel");
_root.temparray = actionObj["action" + _local2.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if ((_local2.handsfull == "achtervleugeloud") || (_local2.handsfull == "achtervleugeloud2")) {
trace("aparte array, omdat de handjes vol zitten met een oude achtervleugel");
_root.temparray = actionObj["action" + _local2.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if ((_local2.handsfull == "voorvleugeloud") || (_local2.handsfull == "voorvleugeloud2")) {
trace("aparte array, omdat de handjes vol zitten met een oude voorvleugel");
_root.temparray = actionObj["action" + _local2.myAction].nextaction;
var arraytouse = temparray;
trace("arraytouse=" + arraytouse);
} else if ((!(_local2.myAction === undefined)) && (!(actionObj["action" + _local2.myAction].nextaction === undefined))) {
trace("aparte array, omdat er een huidige action is");
_root.temparray = actionObj["action" + _local2.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 _local1 = actionObj["action" + index];
var _local3 = actionControl["chck_" + index](_local2);
if (_local1.free && (_local3)) {
_local1.mc.play();
_local1.mc._visible = true;
this.turnedon.push(index);
}
i++;
}
this.mainCharacter = _local2;
};
actionObject.prototype.setAction = function (actionNumber) {
var _local1 = actionNumber;
var _local2 = this;
var _local3 = _root;
if (_local3.alloweddemoactions <= 0) {
if (_local3.paused_mc._currentframe < 2) {
_local3.paused_mc.gotoAndStop(2);
}
} else {
_local3.alloweddemoactions = _local3.alloweddemoactions - 1;
if (!actionObj["action" + _local1].subaction) {
actionObj["action" + _local2.mainCharacter.myAction].free = true;
actionObj["action" + _local2.mainCharacter.myGoal].free = true;
} else {
trace("SUBACTION!!");
}
_local2.mainCharacter.myGoal = _local1;
trace(("-----------" + _local2.mainCharacter.myGoal) + "---------------------------");
_local2.mainCharacter.myendfunction = actionObj["action" + _local1].endfunction;
_local2.mainCharacter.myendpose = actionObj["action" + _local1].pose;
if (!actionObj["action" + _local1].subaction) {
actionObj["action" + _local1].free = false;
} else {
trace("SUBACTION!!");
}
mouseX = Math.round(actionObj["action" + _local1].x);
mouseY = Math.round(actionObj["action" + _local1].y);
characterX = 0;
characterY = 0;
screenControl.clickAction(mouseX, mouseY, characterX, characterY);
_local2.mainCharacter = undefined;
_local3.mainCharacter = undefined;
_local2.deselectAction();
}
};
actionObject.prototype.deselectAction = function () {
var _local2 = this;
_local2.turnedonlength = _local2.turnedon.length - 1;
i = 0;
while (i <= _local2.turnedonlength) {
index = _local2.turnedon[i];
var _local1 = actionObj["action" + index];
_local1.mc._visible = false;
_local1.mc.stop();
i++;
}
_local2.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) {
var _local1 = obj;
trace("Generalendfunction function , myGoal=" + _local1.myGoal);
_local1.myAction = _local1.myGoal;
_local1.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 _local1 = _root;
var _local2 = _local1.carholder_mc.car_mc.voorband1_mc._currentframe;
if (_local2 > 2) {
_local1.bandenvoorrol1_mc.gotoAndPlay(25);
} else {
_local1.bandenvoorrol1_mc.gotoAndPlay(2);
}
_local1.carholder_mc.car_mc.voorband1_mc.gotoAndStop(2);
obj.welkeband = "voor1";
obj.gotoAndPlay("pose20");
driverObj.driver0.fr = 100;
_local1.R_game_mc.menu_overall_mc.fr_mc.gotoAndStop(1);
};
actionObject.prototype.ChangeFrontTire2 = function (obj) {
var _local1 = _root;
var _local2 = _local1.carholder_mc.car_mc.voorband2_mc._currentframe;
if (_local2 > 2) {
_local1.bandenvoorrol2_mc.gotoAndPlay(25);
} else {
_local1.bandenvoorrol2_mc.gotoAndPlay(2);
}
_local1.carholder_mc.car_mc.voorband2_mc.gotoAndStop(2);
obj.welkeband = "voor2";
obj.gotoAndPlay("pose21");
driverObj.driver0.fl = 100;
_local1.R_game_mc.menu_overall_mc.fl_mc.gotoAndStop(1);
};
actionObject.prototype.ChangeBackTire1 = function (obj) {
var _local1 = _root;
var _local2 = _local1.carholder_mc.car_mc.achterband1_mc._currentframe;
if (_local2 > 2) {
_local1.bandenachterrol1_mc.gotoAndPlay(25);
} else {
_local1.bandenachterrol1_mc.gotoAndPlay(2);
}
_local1.carholder_mc.car_mc.achterband1_mc.gotoAndStop(2);
obj.welkeband = "achter1";
obj.gotoAndPlay("pose20");
driverObj.driver0.br = 100;
_local1.R_game_mc.menu_overall_mc.br_mc.gotoAndStop(1);
};
actionObject.prototype.ChangeBackTire2 = function (obj) {
var _local1 = _root;
var _local2 = _local1.carholder_mc.car_mc.achterband2_mc._currentframe;
if (_local2 > 2) {
_local1.bandenachterrol2_mc.gotoAndPlay(25);
} else {
_local1.bandenachterrol2_mc.gotoAndPlay(2);
}
_local1.carholder_mc.car_mc.achterband2_mc.gotoAndStop(2);
obj.welkeband = "achter2";
obj.gotoAndPlay("pose21");
driverObj.driver0.bl = 100;
_local1.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) {
var _local1 = obj;
var _local3 = _root;
actionControl.Generalendfunction(_local1);
trace("Pickup OLD Backwing function");
var _local2 = _local3.carholder_mc.car_mc.achtervleugel_mc._currentframe;
if (_local2 > 2) {
_local1.handsfull = "achtervleugeloud2";
_local1.gotoAndPlay("pose46");
} else {
_local1.handsfull = "achtervleugeloud";
_local1.gotoAndPlay("pose40");
}
_local3.carholder_mc.car_mc.achtervleugel_mc.gotoAndStop(2);
_local3.gameScreen.mainCharacter = _local1;
_local1.achtervleugel_frame = _local2;
};
actionObject.prototype.takeofffrontwing = function (obj) {
var _local1 = obj;
var _local3 = _root;
actionControl.Generalendfunction(_local1);
trace("Pickup OLD Frontwing function");
var _local2 = _local3.carholder_mc.car_mc.voorvleugel_mc._currentframe;
if (_local2 > 2) {
_local1.handsfull = "voorvleugeloud2";
_local1.gotoAndPlay("pose66");
} else {
_local1.handsfull = "voorvleugeloud";
_local1.gotoAndPlay("pose43");
}
_local3.carholder_mc.car_mc.voorvleugel_mc.gotoAndStop(2);
_local3.gameScreen.mainCharacter = _local1;
_local1.voorvleugel_frame = _local2;
};
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) {
var _local1 = obj;
actionControl.Generalendfunction(_local1);
if (_local1.achtervleugel_frame > 2) {
_local1.gotoAndPlay("pose47");
} else {
_local1.gotoAndPlay("pose42");
}
};
actionObject.prototype.dropfrontwing = function (obj) {
var _local1 = obj;
actionControl.Generalendfunction(_local1);
if (_local1.voorvleugel_frame > 2) {
_local1.gotoAndPlay("pose67");
} else {
_local1.gotoAndPlay("pose45");
}
};
actionObject.prototype.startlollipop = function () {
var _local1 = _root;
if (!_local1.carholder_mc.car_mc.inspot) {
} else if (!enoughfuell) {
} else if (!(_local1.tankers_mc._currentframe === 1)) {
} else if (_local1.carholder_mc.car_mc.voorband1_mc._currentframe == 2) {
} else if (_local1.carholder_mc.car_mc.voorband2_mc._currentframe == 2) {
} else if (_local1.carholder_mc.car_mc.achterband1_mc._currentframe == 2) {
} else if (_local1.carholder_mc.car_mc.achterband2_mc._currentframe == 2) {
} else if (_local1.carholder_mc.car_mc.voorvleugel_mc._currentframe == 2) {
} else if (_local1.carholder_mc.car_mc.achtervleugel_mc._currentframe == 2) {
} else if (!(_local1.wiping_total._currentframe === 1)) {
} else {
_local1.carholder_mc.car_mc.exit = true;
_local1.sound_engine_mc.gotoAndPlay("leaving");
_local1.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) {
var _local1 = _root;
if ((!_local1.carholder_mc.car_mc.inspot) || (_local1.carholder_mc.car_mc.exit)) {
return(false);
}
if ((_local1.bandenvoor1_mc._currentframe == 2) && (!actionObj.action4.free)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_17 = function (obj) {
var _local1 = _root;
if ((!_local1.carholder_mc.car_mc.inspot) || (_local1.carholder_mc.car_mc.exit)) {
return(false);
}
if ((_local1.bandenachter1_mc._currentframe == 2) && (!actionObj.action6.free)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_18 = function (obj) {
var _local1 = _root;
if ((!_local1.carholder_mc.car_mc.inspot) || (_local1.carholder_mc.car_mc.exit)) {
return(false);
}
if ((_local1.bandenvoor2_mc._currentframe == 2) && (!actionObj.action8.free)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_19 = function (obj) {
var _local1 = _root;
if ((!_local1.carholder_mc.car_mc.inspot) || (_local1.carholder_mc.car_mc.exit)) {
return(false);
}
if ((_local1.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) {
var _local1 = _root;
if ((!_local1.carholder_mc.car_mc.inspot) || (_local1.carholder_mc.car_mc.exit)) {
return(false);
}
if (!(_local1.carholder_mc.car_mc.voorvleugel_mc._currentframe === 2)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_23 = function (obj) {
var _local1 = _root;
if ((!_local1.carholder_mc.car_mc.inspot) || (_local1.carholder_mc.car_mc.exit)) {
return(false);
}
if (!(_local1.carholder_mc.car_mc.achtervleugel_mc._currentframe === 2)) {
return(true);
}
return(false);
};
actionObject.prototype.chck_24 = function (obj) {
var _local1 = _root;
if ((!_local1.carholder_mc.car_mc.inspot) || (_local1.carholder_mc.car_mc.exit)) {
return(false);
}
if (_local1.carholder_mc.car_mc.voorvleugel_mc._currentframe == 2) {
return(true);
}
return(false);
};
actionObject.prototype.chck_25 = function (obj) {
var _local1 = _root;
if ((!_local1.carholder_mc.car_mc.inspot) || (_local1.carholder_mc.car_mc.exit)) {
return(false);
}
if (_local1.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 () {
var _local1 = _global;
_local1.pitstoplevel = undefined;
_local1.pitstoplevel = [0];
_local1.cLevel = 1;
_local1.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};
_local1.tochangearray = ["voorband1_mc", "voorband2_mc", "achterband1_mc", "achterband2_mc", "voorvleugel_mc", "achtervleugel_mc"];
};
LevelObject.prototype.startLevel = function () {
var _local1 = this;
_global.pitstoptimes = undefined;
_global.pitstoptimes = [0];
_local1.stopmade = 0;
_local1.getLevelStatus();
_local1.chckpitstops();
};
LevelObject.prototype.getLevelStatus = function () {
var _local1 = this;
_local1.tochange = levelstatus[cLevel].change;
_local1.totank = levelstatus[cLevel].tank;
_local1.tospawn = levelstatus[cLevel].spawn * 31;
_local1.tostop = levelstatus[cLevel].stops;
};
LevelObject.prototype.getCarStatus = function () {
this.temptochangearray = tochangearray.concat();
var _local1 = driverObj.driver0;
var _local2 = _root.carholder_mc.car_mc;
if (_local1.fl < 50) {
_local2.voorband2_mc.gotoAndStop(3);
}
if (_local1.fr < 50) {
_local2.voorband1_mc.gotoAndStop(3);
}
if (_local1.bl < 50) {
_local2.achterband2_mc.gotoAndStop(3);
}
if (_local1.br < 50) {
_local2.achterband1_mc.gotoAndStop(3);
}
if (_local1.fw < 50) {
_local2.voorvleugel_mc.gotoAndStop(3);
}
if (_local1.bw < 50) {
_local2.achtervleugel_mc.gotoAndStop(3);
}
var _local3 = Math.round((_local1.fu * 299) / 100);
_root.indicator_fuel_mc.meter_mc.gotoAndStop(_local3);
};
LevelObject.prototype.chckpitstops = function () {
var _local1 = _root;
var _local2 = this;
if (_local2.stopmade >= _local2.tostop) {
driverObj.driver0.atpitstreet = false;
var cframe = _local1.indicator_fuel_mc.meter_mc._currentframe;
var _local3 = (cframe * 100) / 299;
if (_local3 > 100) {
_local3 = 100;
} else if (_local3 < 0) {
_local3 = 0;
}
driverObj.driver0.fu = _local3;
driverObj.driver0.speedPerc = 40;
_local1.R_game_mc.pittime_mc.gotoAndPlay(2);
_global.framedest = "race";
_local1.black_mc.gotoAndPlay("fadein");
} else {
trace("jo");
_local2.stopmade = _local2.stopmade + 1;
_local1.createEmptyMovieClip("spawn_mc", 6);
var ttime = (Math.round((Math.random() * 100) - 40) + 340);
_local1.spawn_mc.gtime = ttime;
_local1.spawn_mc.ctime = 0;
_local1.spawn_mc.onEnterFrame = function () {
var _local1 = this;
var _local2 = _root;
if (!(_local2.carholder_mc.car_mc === undefined)) {
} else {
_local1.difft = _local1.gtime - _local1.ctime;
if (_local1.difft == undefined) {
} else {
if (_local1.difft < 20) {
if (!(_local2.enginesound === "arriving")) {
_local2.sound_engine_mc.gotoAndPlay("arriving");
}
}
if ((_local1.difft < 120) && (_local2.alarmInterval == undefined)) {
_local2.alarm1_mc.gotoAndPlay(2);
_local2.alarm2_mc.gotoAndPlay(4);
clearInterval(_local2.alarmInterval);
CarControl.start_alarm_Sound();
_local2.alarmInterval = setInterval(CarControl, "start_alarm_Sound", 800);
_local2.video_lamp_mc.gotoAndPlay(2);
}
if (_local1.ctime >= _local1.gtime) {
carControl.createCar(_local2.invulxcar, _local2.invulycar, "f1car");
_local1.ctime = 0;
delete _local1.onEnterFrame;
_local1.removeMovieClip();
}
_local1.ctime = _local1.ctime + 1;
}
}
};
}
};
LevelObject.prototype.endGame = function () {
};
_root.gameStarted = false;
Instance of Symbol 1561 MovieClip in Frame 696
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 1663 MovieClip "truck_mc" in Frame 696
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 1709 MovieClip "buyme_mc" in Frame 696
onClipEvent (load) {
this._visible = false;
}
Frame 697
this.startGame = function () {
var _local1 = _global;
var _local2 = _root;
if (!_local2.gameStarted) {
_local2.gameStarted = true;
_local1.timeControl = new TimeObject();
_local1.timeControl.resetTime();
_local1.timeControl.timePaused = true;
_local1.characterArray = new Array();
_local1.staticArray = new Array();
_local1.screenControl = new ScreenObject();
screenControl.tileWidth = 20;
screenControl.tileHeight = 20;
ASBroadcaster.initialize(screenControl);
Key.addListener(screenControl.keyListener);
screenControl.normalMode();
_local1.gameControl = new GameObject();
gameControl.initializeCreateZones();
ASBroadcaster.initialize(gameControl);
gameControl.initializeGame();
_local1.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);
_local1.carControl = new CarObject();
_local1.actionControl = new actionObject();
_local1.levelControl = new levelObject();
timeControl.setstartTime();
_local2.indicator_time_mc.onEnterFrame = function () {
if (!timeControl.gamePaused) {
timeControl.publishTime();
}
};
}
};
this.startGame();
_root.settile = function (gotteni, gottenj, gottenstatus) {
var _local2 = gotteni;
var _local1 = gottenj;
var _local3 = gottenstatus;
precTarget = (_local2 + "y") + _local1;
cTarget = _root.mapedit["gridx" + precTarget];
cTarget.status = _local3;
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 () {
var _local1 = _root;
_local1.truck_mc.voorband_truck_pile1.gotoAndStop(1);
_local1.truck_mc.voorband_truck_pile2.gotoAndStop(1);
_local1.truck_mc.achterband_truck_pile1.gotoAndStop(1);
_local1.truck_mc.achterband_truck_pile2.gotoAndStop(1);
_local1.truck_mc.voorvleugel_truck_mc.gotoAndStop(1);
_local1.truck_mc.achtervleugel_truck_mc.gotoAndStop(1);
_local1.truck_mc._visible = true;
};
_root.indicator_fuel_mc.meter_mc.onEnterFrame = function () {
var _local1 = this;
var _local2 = _local1._currentframe;
if ((_root.tankers_mc._currentframe == 11) && (_local2 < 300)) {
_local1.gotoAndStop(_local2 + 1);
if (_local1.ctime >= 8) {
tank_Sound.start();
_local1.ctime = 0;
}
_local1.ctime = _local1.ctime + 1;
} else if ((_root.tankers_mc._currentframe == 11) && (_local2 >= 300)) {
_local1.play();
}
if (_local2 > 0) {
_global.enoughfuell = true;
_local1._knipper_mc._visible = false;
} else {
_global.enoughfuell = false;
_local1._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 () {
var _local1 = this;
if (_local1.hostComponent == undefined) {
_local1.hostComponent = ((_local1._parent.controller == undefined) ? (_local1._parent) : (_local1._parent.controller));
}
if (_local1.customTextStyle == undefined) {
if (_local1.hostComponent.textStyle == undefined) {
_local1.hostComponent.textStyle = new TextFormat();
}
_local1.textStyle = _local1.hostComponent.textStyle;
_local1.enable = true;
}
};
FLabelClass.prototype = new MovieClip();
Object.registerClass("FLabelSymbol", FLabelClass);
FLabelClass.prototype.setLabel = function (label) {
var _local1 = this;
var _local2 = _local1.hostComponent.styleTable.embedFonts.value;
if (_local2 != undefined) {
_local1.labelField.embedFonts = _local2;
}
_local1.labelField.setNewTextFormat(_local1.textStyle);
_local1.labelField.text = label;
_local1.labelField._height = _local1.labelField.textHeight + 2;
};
FLabelClass.prototype.setSize = function (width) {
this.labelField._width = width;
};
FLabelClass.prototype.setEnabled = function (enable) {
var _local2 = this;
var _local3 = enable;
_local2.enable = _local3;
var _local1 = _local2.hostComponent.styleTable[(_local3 ? "textColor" : "textDisabled")].value;
if (_local1 == undefined) {
_local1 = (_local3 ? 0 : 8947848);
}
_local2.setColor(_local1);
};
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 () {
var _local1 = this;
var _local3 = _global;
_local1.enable = true;
_local1.focused = false;
_local1.useHandCursor = false;
_local1._accImpl = new Object();
_local1._accImpl.stub = true;
_local1.styleTable = new Array();
if (_local3.globalStyleFormat == undefined) {
_local3.globalStyleFormat = new FStyleFormat();
globalStyleFormat.isGlobal = true;
_local3._focusControl = new Object();
_local3._focusControl.onSetFocus = function (oldFocus, newFocus) {
oldFocus.myOnKillFocus();
newFocus.myOnSetFocus();
};
Selection.addListener(_local3._focusControl);
}
if (_local1._name != undefined) {
_local1._focusrect = false;
_local1.tabEnabled = true;
_local1.focusEnabled = true;
_local1.tabChildren = false;
_local1.tabFocused = true;
if (_local1.hostStyle == undefined) {
globalStyleFormat.addListener(_local1);
} else {
_local1.styleTable = _local1.hostStyle;
}
_local1.deadPreview._visible = false;
_local1.deadPreview._width = (_local1.deadPreview._height = 1);
_local1.methodTable = new Object();
_local1.keyListener = new Object();
_local1.keyListener.controller = _local1;
_local1.keyListener.onKeyDown = function () {
this.controller.myOnKeyDown();
};
_local1.keyListener.onKeyUp = function () {
this.controller.myOnKeyUp();
};
for (var _local2 in _local1.styleFormat_prm) {
_local1.setStyleProperty(_local2, _local1.styleFormat_prm[_local2]);
}
}
};
FUIComponentClass.prototype.setEnabled = function (enabledFlag) {
var _local1 = this;
_local1.enable = ((arguments.length > 0) ? (enabledFlag) : true);
_local1.tabEnabled = (_local1.focusEnabled = enabledFlag);
if ((!_local1.enable) && (_local1.focused)) {
Selection.setFocus(undefined);
}
};
FUIComponentClass.prototype.getEnabled = function () {
return(this.enable);
};
FUIComponentClass.prototype.setSize = function (w, h) {
var _local1 = this;
_local1.width = w;
_local1.height = h;
_local1.focusRect.removeMovieClip();
};
FUIComponentClass.prototype.setChangeHandler = function (chng, obj) {
var _local1 = this;
_local1.handlerObj = ((obj == undefined) ? (_local1._parent) : (obj));
_local1.changeHandler = chng;
};
FUIComponentClass.prototype.invalidate = function (methodName) {
var _local1 = this;
_local1.methodTable[methodName] = true;
_local1.onEnterFrame = _local1.cleanUI;
};
FUIComponentClass.prototype.cleanUI = function () {
var _local1 = this;
if (_local1.methodTable.setSize) {
_local1.setSize(_local1.width, _local1.height);
} else {
_local1.cleanUINotSize();
}
_local1.methodTable = new Object();
delete _local1.onEnterFrame;
};
FUIComponentClass.prototype.cleanUINotSize = function () {
var _local1 = this;
for (var _local2 in _local1.methodTable) {
_local1[_local2]();
}
};
FUIComponentClass.prototype.drawRect = function (x, y, w, h) {
var _local1 = this;
var _local2 = y;
var _local3 = x;
var inner = _local1.styleTable.focusRectInner.value;
var outer = _local1.styleTable.focusRectOuter.value;
if (inner == undefined) {
inner = 16777215 /* 0xFFFFFF */;
}
if (outer == undefined) {
outer = 0;
}
_local1.createEmptyMovieClip("focusRect", 1000);
_local1.focusRect.controller = _local1;
_local1.focusRect.lineStyle(1, outer);
_local1.focusRect.moveTo(_local3, _local2);
_local1.focusRect.lineTo(_local3 + w, _local2);
_local1.focusRect.lineTo(_local3 + w, _local2 + h);
_local1.focusRect.lineTo(_local3, _local2 + h);
_local1.focusRect.lineTo(_local3, _local2);
_local1.focusRect.lineStyle(1, inner);
_local1.focusRect.moveTo(_local3 + 1, _local2 + 1);
_local1.focusRect.lineTo((_local3 + w) - 1, _local2 + 1);
_local1.focusRect.lineTo((_local3 + w) - 1, (_local2 + h) - 1);
_local1.focusRect.lineTo(_local3 + 1, (_local2 + h) - 1);
_local1.focusRect.lineTo(_local3 + 1, _local2 + 1);
};
FUIComponentClass.prototype.pressFocus = function () {
var _local1 = this;
_local1.tabFocused = false;
_local1.focusRect.removeMovieClip();
Selection.setFocus(_local1);
};
FUIComponentClass.prototype.drawFocusRect = function () {
var _local1 = this;
_local1.drawRect(-2, -2, _local1.width + 4, _local1.height + 4);
};
FUIComponentClass.prototype.myOnSetFocus = function () {
var _local1 = this;
_local1.focused = true;
Key.addListener(_local1.keyListener);
if (_local1.tabFocused) {
_local1.drawFocusRect();
}
};
FUIComponentClass.prototype.myOnKillFocus = function () {
var _local1 = this;
_local1.tabFocused = true;
_local1.focused = false;
_local1.focusRect.removeMovieClip();
Key.removeListener(_local1.keyListener);
};
FUIComponentClass.prototype.executeCallBack = function () {
var _local1 = this;
_local1.handlerObj[_local1.changeHandler](_local1);
};
FUIComponentClass.prototype.updateStyleProperty = function (styleFormat, propName) {
this.setStyleProperty(propName, styleFormat[propName], styleFormat.isGlobal);
};
FUIComponentClass.prototype.setStyleProperty = function (propName, value, isGlobal) {
var _local1 = this;
var _local2 = propName;
if (value == "") {
} else {
var tmpValue = parseInt(value);
if (!isNaN(tmpValue)) {
value = tmpValue;
}
var global = ((arguments.length > 2) ? (isGlobal) : false);
if (_local1.styleTable[_local2] == undefined) {
_local1.styleTable[_local2] = new Object();
_local1.styleTable[_local2].useGlobal = true;
}
if (_local1.styleTable[_local2].useGlobal || (!global)) {
_local1.styleTable[_local2].value = value;
if (_local1.setCustomStyleProperty(_local2, value)) {
} else if (_local2 == "embedFonts") {
_local1.invalidate("setSize");
} else if (_local2.subString(0, 4) == "text") {
if (_local1.textStyle == undefined) {
_local1.textStyle = new TextFormat();
}
var textProp = _local2.subString(4, _local2.length);
_local1.textStyle[textProp] = value;
_local1.invalidate("setSize");
} else {
for (var j in _local1.styleTable[_local2].coloredMCs) {
var _local3 = new Color(_local1.styleTable[_local2].coloredMCs[j]);
if (_local1.styleTable[_local2].value == undefined) {
var myTObj = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_local3.setTransform(myTObj);
} else {
_local3.setRGB(value);
}
}
}
_local1.styleTable[_local2].useGlobal = global;
}
}
};
FUIComponentClass.prototype.registerSkinElement = function (skinMCRef, propName) {
var _local1 = this;
var _local2 = propName;
if (_local1.styleTable[_local2] == undefined) {
_local1.styleTable[_local2] = new Object();
_local1.styleTable[_local2].useGlobal = true;
}
if (_local1.styleTable[_local2].coloredMCs == undefined) {
_local1.styleTable[_local2].coloredMCs = new Object();
}
_local1.styleTable[_local2].coloredMCs[skinMCRef] = skinMCRef;
if (_local1.styleTable[_local2].value != undefined) {
var _local3 = new Color(skinMCRef);
_local3.setRGB(_local1.styleTable[_local2].value);
}
};
_global.FStyleFormat = function () {
var _local1 = arguments;
var _local2 = this;
_local2.nonStyles = {listeners:true, isGlobal:true, isAStyle:true, addListener:true, removeListener:true, nonStyles:true, applyChanges:true};
_local2.listeners = new Object();
_local2.isGlobal = false;
if (_local1.length > 0) {
for (var _local3 in _local1[0]) {
_local2[_local3] = _local1[0][_local3];
}
}
};
_global.FStyleFormat.prototype = new Object();
FStyleFormat.prototype.addListener = function () {
var _local1 = this;
var _local2 = 0;
while (_local2 < arguments.length) {
var _local3 = arguments[_local2];
_local1.listeners[arguments[_local2]] = _local3;
for (var i in _local1) {
if (_local1.isAStyle(i)) {
_local3.updateStyleProperty(_local1, i.toString());
}
}
_local2++;
}
};
FStyleFormat.prototype.removeListener = function (component) {
var _local1 = this;
var _local2 = component;
_local1.listeners[_local2] = undefined;
for (var prop in _local1) {
if (_local1.isAStyle(prop)) {
if (_local2.styleTable[prop].useGlobal == _local1.isGlobal) {
_local2.styleTable[prop].useGlobal = true;
var _local3 = (_local1.isGlobal ? undefined : (globalStyleFormat[prop]));
_local2.setStyleProperty(prop, _local3, true);
}
}
}
};
FStyleFormat.prototype.applyChanges = function () {
var _local1 = this;
var _local2 = arguments;
var count = 0;
for (var i in _local1.listeners) {
var _local3 = _local1.listeners[i];
if (_local2.length > 0) {
var j = 0;
while (j < _local2.length) {
if (_local1.isAStyle(_local2[j])) {
_local3.updateStyleProperty(_local1, _local2[j]);
}
j++;
}
} else {
for (var j in _local1) {
if (_local1.isAStyle(j)) {
_local3.updateStyleProperty(_local1, 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 () {
var _local1 = this;
if (_local1._height == 4) {
} else {
_local1.init();
_local1.minPos = (_local1.maxPos = (_local1.pageSize = (_local1.largeScroll = 0)));
_local1.smallScroll = 1;
_local1.width = (_local1.horizontal ? (_local1._width) : (_local1._height));
_local1._xscale = (_local1._yscale = 100);
_local1.setScrollPosition(0);
_local1.tabEnabled = false;
if (_local1._targetInstanceName.length > 0) {
_local1.setScrollTarget(_local1._parent[_local1._targetInstanceName]);
}
_local1.tabChildren = false;
_local1.setSize(_local1.width);
}
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function (flag) {
var _local1 = this;
var _local2 = flag;
if (_local1.horizontal && (!_local2)) {
_local1._xscale = 100;
_local1._rotation = 0;
} else if (_local2 && (!_local1.horizontal)) {
_local1._xscale = -100;
_local1._rotation = -90;
}
_local1.horizontal = _local2;
};
FScrollBarClass.prototype.setScrollProperties = function (pSize, mnPos, mxPos) {
var _local1 = this;
if (!_local1.enable) {
} else {
_local1.pageSize = pSize;
_local1.minPos = Math.max(mnPos, 0);
_local1.maxPos = Math.max(mxPos, 0);
_local1.scrollPosition = Math.max(_local1.minPos, _local1.scrollPosition);
_local1.scrollPosition = Math.min(_local1.maxPos, _local1.scrollPosition);
if ((_local1.maxPos - _local1.minPos) <= 0) {
_local1.scrollThumb_mc.removeMovieClip();
_local1.upArrow_mc.gotoAndStop(3);
_local1.downArrow_mc.gotoAndStop(3);
_local1.downArrow_mc.onPress = (_local1.downArrow_mc.onRelease = (_local1.downArrow_mc.onDragOut = null));
_local1.upArrow_mc.onPress = (_local1.upArrow_mc.onRelease = (_local1.upArrow_mc.onDragOut = null));
_local1.scrollTrack_mc.onPress = (_local1.scrollTrack_mc.onRelease = null);
_local1.scrollTrack_mc.onDragOut = (_local1.scrollTrack_mc.onRollOut = null);
_local1.scrollTrack_mc.useHandCursor = false;
} else {
var _local2 = _local1.getScrollPosition();
_local1.upArrow_mc.gotoAndStop(1);
_local1.downArrow_mc.gotoAndStop(1);
_local1.upArrow_mc.onPress = (_local1.upArrow_mc.onDragOver = _local1.startUpScroller);
_local1.upArrow_mc.onRelease = (_local1.upArrow_mc.onDragOut = _local1.stopScrolling);
_local1.downArrow_mc.onPress = (_local1.downArrow_mc.onDragOver = _local1.startDownScroller);
_local1.downArrow_mc.onRelease = (_local1.downArrow_mc.onDragOut = _local1.stopScrolling);
_local1.scrollTrack_mc.onPress = (_local1.scrollTrack_mc.onDragOver = _local1.startTrackScroller);
_local1.scrollTrack_mc.onRelease = _local1.stopScrolling;
_local1.scrollTrack_mc.onDragOut = _local1.stopScrolling;
_local1.scrollTrack_mc.onRollOut = _local1.stopScrolling;
_local1.scrollTrack_mc.useHandCursor = false;
_local1.attachMovie("ScrollThumb", "scrollThumb_mc", 3);
_local1.scrollThumb_mc._x = 0;
_local1.scrollThumb_mc._y = _local1.upArrow_mc._height;
_local1.scrollThumb_mc.onPress = _local1.startDragThumb;
_local1.scrollThumb_mc.controller = _local1;
_local1.scrollThumb_mc.onRelease = (_local1.scrollThumb_mc.onReleaseOutside = _local1.stopDragThumb);
_local1.scrollThumb_mc.useHandCursor = false;
_local1.thumbHeight = (_local1.pageSize / ((_local1.maxPos - _local1.minPos) + _local1.pageSize)) * _local1.trackSize;
_local1.thumbMid_mc = _local1.scrollThumb_mc.mc_sliderMid;
_local1.thumbTop_mc = _local1.scrollThumb_mc.mc_sliderTop;
_local1.thumbBot_mc = _local1.scrollThumb_mc.mc_sliderBot;
_local1.thumbHeight = Math.max(_local1.thumbHeight, 6);
_local1.midHeight = (_local1.thumbHeight - _local1.thumbTop_mc._height) - _local1.thumbBot_mc._height;
_local1.thumbMid_mc._yScale = (_local1.midHeight * 100) / _local1.thumbMid_mc._height;
_local1.thumbMid_mc._y = _local1.thumbTop_mc._height;
_local1.thumbBot_mc._y = _local1.thumbTop_mc._height + _local1.midHeight;
_local1.scrollTop = _local1.scrollThumb_mc._y;
_local1.trackHeight = _local1.trackSize - _local1.thumbHeight;
_local1.scrollBot = _local1.trackHeight + _local1.scrollTop;
_local2 = Math.min(_local2, _local1.maxPos);
_local1.setScrollPosition(Math.max(_local2, _local1.minPos));
}
}
};
FScrollBarClass.prototype.getScrollPosition = function () {
return(this.scrollPosition);
};
FScrollBarClass.prototype.setScrollPosition = function (pos) {
var _local1 = this;
var _local2 = pos;
_local1.scrollPosition = _local2;
if (_local1.scrollThumb_mc != undefined) {
_local2 = Math.min(_local2, _local1.maxPos);
_local2 = Math.max(_local2, _local1.minPos);
}
_local1.scrollThumb_mc._y = (((_local2 - _local1.minPos) * _local1.trackHeight) / (_local1.maxPos - _local1.minPos)) + _local1.scrollTop;
_local1.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function (lScroll) {
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function (sScroll) {
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function (enabledFlag) {
var _local1 = this;
var _local2 = enabledFlag;
var _local3 = _local1.enable;
if (_local2 && (!_local3)) {
_local1.enable = _local2;
if (_local1.textField != undefined) {
_local1.setScrollTarget(_local1.textField);
} else {
_local1.setScrollProperties(_local1.pageSize, _local1.cachedMinPos, _local1.cachedMaxPos);
_local1.setScrollPosition(_local1.cachedPos);
}
_local1.clickFilter = undefined;
} else if ((!_local2) && (_local3)) {
_local1.textField.removeListener(_local1);
_local1.cachedPos = _local1.getScrollPosition();
_local1.cachedMinPos = _local1.minPos;
_local1.cachedMaxPos = _local1.maxPos;
if (_local1.clickFilter == undefined) {
_local1.setScrollProperties(_local1.pageSize, 0, 0);
} else {
_local1.clickFilter = true;
}
_local1.enable = _local2;
}
};
FScrollBarClass.prototype.setSize = function (hgt) {
var _local1 = this;
if (_local1._height == 1) {
} else {
_local1.width = hgt;
_local1.scrollTrack_mc._yscale = 100;
_local1.scrollTrack_mc._yscale = (100 * _local1.width) / _local1.scrollTrack_mc._height;
if (_local1.upArrow_mc == undefined) {
_local1.attachMovie("UpArrow", "upArrow_mc", 1);
_local1.attachMovie("DownArrow", "downArrow_mc", 2);
_local1.downArrow_mc.controller = (_local1.upArrow_mc.controller = _local1);
_local1.upArrow_mc.useHandCursor = (_local1.downArrow_mc.useHandCursor = false);
_local1.upArrow_mc._x = (_local1.upArrow_mc._y = 0);
_local1.downArrow_mc._x = 0;
}
_local1.scrollTrack_mc.controller = _local1;
_local1.downArrow_mc._y = _local1.width - _local1.downArrow_mc._height;
_local1.trackSize = _local1.width - (2 * _local1.downArrow_mc._height);
if (_local1.textField != undefined) {
_local1.onTextChanged();
} else {
_local1.setScrollProperties(_local1.pageSize, _local1.minPos, _local1.maxPos);
}
}
};
FScrollBarClass.prototype.scrollIt = function (inc, mode) {
var _local1 = this;
var _local3 = _local1.smallScroll;
if (inc != "one") {
_local3 = ((_local1.largeScroll == 0) ? (_local1.pageSize) : (_local1.largeScroll));
}
var _local2 = _local1.getScrollPosition() + (mode * _local3);
if (_local2 > _local1.maxPos) {
_local2 = _local1.maxPos;
} else if (_local2 < _local1.minPos) {
_local2 = _local1.minPos;
}
_local1.setScrollPosition(_local2);
};
FScrollBarClass.prototype.startDragThumb = function () {
var _local1 = this;
_local1.lastY = _local1._ymouse;
_local1.onMouseMove = _local1.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function () {
var _local1 = this;
_local1.scrollMove = _local1._ymouse - _local1.lastY;
_local1.scrollMove = _local1.scrollMove + _local1._y;
if (_local1.scrollMove < _local1.controller.scrollTop) {
_local1.scrollMove = _local1.controller.scrollTop;
} else if (_local1.scrollMove > _local1.controller.scrollBot) {
_local1.scrollMove = _local1.controller.scrollBot;
}
_local1._y = _local1.scrollMove;
var _local2 = _local1.controller;
_local2.scrollPosition = Math.round(((_local2.maxPos - _local2.minPos) * (_local1._y - _local2.scrollTop)) / _local2.trackHeight) + _local2.minPos;
_local1.controller.isScrolling = true;
updateAfterEvent();
_local1.controller.executeCallBack();
};
FScrollBarClass.prototype.stopDragThumb = function () {
this.controller.isScrolling = false;
this.onMouseMove = null;
};
FScrollBarClass.prototype.startTrackScroller = function () {
var _local1 = this;
_local1.controller.trackScroller();
_local1.controller.scrolling = setInterval(_local1.controller, "scrollInterval", 500, "page", -1);
};
FScrollBarClass.prototype.scrollInterval = function (inc, mode) {
var _local1 = this;
var _local2 = inc;
clearInterval(_local1.scrolling);
if (_local2 == "page") {
_local1.trackScroller();
} else {
_local1.scrollIt(_local2, mode);
}
_local1.scrolling = setInterval(_local1, "scrollInterval", 35, _local2, mode);
};
FScrollBarClass.prototype.trackScroller = function () {
var _local1 = this;
if ((_local1.scrollThumb_mc._y + _local1.thumbHeight) < _local1._ymouse) {
_local1.scrollIt("page", 1);
} else if (_local1.scrollThumb_mc._y > _local1._ymouse) {
_local1.scrollIt("page", -1);
}
};
FScrollBarClass.prototype.stopScrolling = function () {
var _local1 = this;
_local1.controller.downArrow_mc.gotoAndStop(1);
_local1.controller.upArrow_mc.gotoAndStop(1);
clearInterval(_local1.controller.scrolling);
};
FScrollBarClass.prototype.startUpScroller = function () {
var _local1 = this;
_local1.controller.upArrow_mc.gotoAndStop(2);
_local1.controller.scrollIt("one", -1);
_local1.controller.scrolling = setInterval(_local1.controller, "scrollInterval", 500, "one", -1);
};
FScrollBarClass.prototype.startDownScroller = function () {
var _local1 = this;
_local1.controller.downArrow_mc.gotoAndStop(2);
_local1.controller.scrollIt("one", 1);
_local1.controller.scrolling = setInterval(_local1.controller, "scrollInterval", 500, "one", 1);
};
FScrollBarClass.prototype.setScrollTarget = function (tF) {
var _local1 = this;
var _local2 = tF;
if (_local2 == undefined) {
_local1.textField.removeListener(_local1);
delete _local1.textField[(_local1.horizontal ? "hScroller" : "vScroller")];
if ((_local1.textField.hScroller != undefined) && (_local1.textField.vScroller != undefined)) {
_local1.textField.unwatch("text");
_local1.textField.unwatch("htmltext");
}
}
_local1.textField = undefined;
if (!(_local2 instanceof TextField)) {
} else {
_local1.textField = _local2;
_local1.textField[(_local1.horizontal ? "hScroller" : "vScroller")] = _local1;
_local1.onTextChanged();
_local1.onChanged = function () {
this.onTextChanged();
};
_local1.onScroller = function () {
var _local1 = this;
if (!_local1.isScrolling) {
if (!_local1.horizontal) {
_local1.setScrollPosition(_local1.textField.scroll);
} else {
_local1.setScrollPosition(_local1.textField.hscroll);
}
}
};
_local1.textField.addListener(_local1);
_local1.textField.watch("text", _local1.callback);
_local1.textField.watch("htmlText", _local1.callback);
}
};
FScrollBarClass.prototype.callback = function (prop, oldVal, newVal) {
var _local1 = this;
clearInterval(_local1.hScroller.synchScroll);
clearInterval(_local1.vScroller.synchScroll);
_local1.hScroller.synchScroll = setInterval(_local1.hScroller, "onTextChanged", 50);
_local1.vScroller.synchScroll = setInterval(_local1.vScroller, "onTextChanged", 50);
return(newVal);
};
FScrollBarClass.prototype.onTextChanged = function () {
var _local1 = this;
if ((!_local1.enable) || (_local1.textField == undefined)) {
} else {
clearInterval(_local1.synchScroll);
if (_local1.horizontal) {
var _local2 = _local1.textField.hscroll;
_local1.setScrollProperties(_local1.textField._width, 0, _local1.textField.maxhscroll);
_local1.setScrollPosition(Math.min(_local2, _local1.textField.maxhscroll));
} else {
var _local2 = _local1.textField.scroll;
var _local3 = _local1.textField.bottomScroll - _local1.textField.scroll;
_local1.setScrollProperties(_local3, 1, _local1.textField.maxscroll);
_local1.setScrollPosition(Math.min(_local2, _local1.textField.maxscroll));
}
}
};
FScrollBarClass.prototype.executeCallBack = function () {
var _local1 = this;
if (_local1.textField == undefined) {
super.executeCallBack();
} else if (_local1.horizontal) {
_local1.textField.hscroll = _local1.getScrollPosition();
} else {
_local1.textField.scroll = _local1.getScrollPosition();
}
};
Object.registerClass("FScrollBarSymbol", FScrollBarClass);
#endinitclip
Symbol 396 MovieClip [DataProviderSymbol] Frame 1
#initclip 2
_global.DataProviderClass = function () {
this.init();
};
DataProviderClass.prototype.init = function () {
var _local1 = this;
_local1.items = new Array();
_local1.uniqueID = 0;
_local1.views = new Array();
};
DataProviderClass.prototype.addView = function (viewRef) {
this.views.push(viewRef);
var _local1 = {event:"updateAll"};
viewRef.modelChanged(_local1);
};
DataProviderClass.prototype.addItemAt = function (index, value) {
var _local1 = index;
var _local2 = this;
var _local3 = value;
if (_local1 < _local2.getLength()) {
_local2.items.splice(_local1, 0, "tmp");
}
_local2.items[_local1] = new Object();
if (typeof(_local3) == "object") {
_local2.items[_local1] = _local3;
} else {
_local2.items[_local1].label = _local3;
}
_local2.items[_local1].__ID__ = _local2.uniqueID++;
var eventObj = {event:"addRows", firstRow:_local1, lastRow:_local1};
_local2.updateViews(eventObj);
};
DataProviderClass.prototype.addItem = function (value) {
this.addItemAt(this.getLength(), value);
};
DataProviderClass.prototype.removeItemAt = function (index) {
var _local1 = index;
var _local2 = this;
var tmpItm = _local2.items[_local1];
_local2.items.splice(_local1, 1);
var _local3 = {event:"deleteRows", firstRow:_local1, lastRow:_local1};
_local2.updateViews(_local3);
return(tmpItm);
};
DataProviderClass.prototype.removeAll = function () {
var _local1 = this;
_local1.items = new Array();
_local1.updateViews({event:"deleteRows", firstRow:0, lastRow:_local1.getLength() - 1});
};
DataProviderClass.prototype.replaceItemAt = function (index, itemObj) {
var _local1 = index;
var _local2 = this;
if ((_local1 < 0) || (_local1 >= _local2.getLength())) {
} else {
var _local3 = _local2.getItemID(_local1);
if (typeof(itemObj) == "object") {
_local2.items[_local1] = itemObj;
} else {
_local2.items[_local1].label = itemObj;
}
_local2.items[_local1].__ID__ = _local3;
_local2.updateViews({event:"updateRows", firstRow:_local1, lastRow:_local1});
}
};
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) {
var _local1 = this;
_local1.items.sortOn(fieldName);
if (order == "DESC") {
_local1.items.reverse();
}
_local1.updateViews({event:"sort"});
};
DataProviderClass.prototype.updateViews = function (eventObj) {
var _local2 = this;
var _local3 = eventObj;
var _local1 = 0;
while (_local1 < _local2.views.length) {
_local2.views[_local1].modelChanged(_local3);
_local1++;
}
};
#endinitclip
Symbol 397 MovieClip [FSelectableItemSymbol] Frame 1
#initclip 7
function FSelectableItemClass() {
this.init();
}
FSelectableItemClass.prototype = new FUIComponentClass();
FSelectableItemClass.prototype.init = function () {
var _local1 = this;
if (_local1._name != "itemAsset") {
_local1.highlighted = false;
_local1.layoutContent(100);
}
};
FSelectableItemClass.prototype.drawItem = function (itmObj, selected) {
var _local1 = this;
var _local2 = selected;
_local1.displayContent(itmObj, _local2);
if ((_local1.highlighted != _local2) || ((_local1.controller.focused != _local1.oldFocus) && (_local2))) {
_local1.setHighlighted(_local2);
}
_local1.oldFocus = _local1.controller.focused;
};
FSelectableItemClass.prototype.setSize = function (width, height) {
var _local1 = this;
var _local3 = width;
var _local2 = -16384;
_local1.width = _local3;
_local1.layoutContent(_local3);
_local1.attachMovie("FHighlightSymbol", "highlight_mc", _local2);
_local1.highlight_mc._x = 0.5;
_local1.highlight_mc._width = _local3 - 0.5;
_local1.highlight_mc._height = height;
_local1.highlight_mc.controller = _local1;
_local1.highlight_mc._alpha = 0;
_local1.highlight_mc.trackAsMenu = true;
_local1.highlight_mc.onPress = function () {
var _local1 = this;
if (_local1.controller.enable) {
_local1.controller.controller.clickHandler(_local1.controller.itemNum);
}
};
_local1.highlight_mc.onDragOver = function () {
if (this.controller.controller.focused) {
this.onPress();
}
};
_local1.highlight_mc.useHandCursor = false;
_local1.highlight_mc.trackAsMenu = true;
};
FSelectableItemClass.prototype.setEnabled = function (enabledFlag) {
var _local1 = this;
var _local2 = enabledFlag;
_local1.enable = _local2;
_local1.fLabel_mc.setEnabled(_local2);
_local1.highlight_mc.gotoAndStop((_local2 ? "unfocused" : "disabled"));
};
FSelectableItemClass.prototype.layoutContent = function (width) {
var _local1 = this;
_local1.attachMovie("FLabelSymbol", "fLabel_mc", 2, {hostComponent:_local1.controller});
_local1.fLabel_mc._x = 2;
_local1.fLabel_mc._y = 0;
_local1.fLabel_mc.setSize(width - 2);
_local1.fLabel_mc.labelField.selectable = false;
};
FSelectableItemClass.prototype.displayContent = function (itmObj, selected) {
var _local2 = itmObj;
var _local1 = "";
if (_local2.label != undefined) {
_local1 = _local2.label;
} else if (typeof(_local2) == "object") {
for (var _local3 in _local2) {
if (_local3 != "__ID__") {
_local1 = (_local2[_local3] + ", ") + _local1;
}
}
_local1 = _local1.substring(0, _local1.length - 2);
} else {
_local1 = _local2;
}
if (this.fLabel_mc.labelField.text != _local1) {
this.fLabel_mc.setLabel(_local1);
}
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) {
var _local1 = this;
var _local2 = flag;
fade = _local1.controller.styleTable.fadeRate.value;
if (((fade == undefined) || (fade == 0)) || (!_local2)) {
_local1.highlight_mc._alpha = (_local2 ? 100 : 0);
delete _local1.onEnterFrame;
} else {
_local1.fadeN = fade;
_local1.fadeX = 1;
_local1.highLight_mc._alpha = 20;
_local1.onEnterFrame = function () {
var _local1 = this;
_local1.highLight_mc._alpha = (60 * Math.sqrt((_local1.fadeX++) / _local1.fadeN)) + 40;
if (_local1.fadeX > _local1.fadeN) {
delete _local1.onEnterFrame;
}
};
}
_local1.highlighted = _local2;
};
#endinitclip
Symbol 398 MovieClip [FSelectableListSymbol] Frame 1
#initclip 4
function FSelectableListClass() {
this.init();
}
FSelectableListClass.prototype = new FUIComponentClass();
FSelectableListClass.prototype.init = function () {
var _local1 = this;
super.init();
_local1.enable = true;
_local1.selected = new Array();
_local1.topDisplayed = (_local1.numDisplayed = 0);
_local1.lastSelected = 0;
_local1.tabChildren = false;
if (_local1._name != undefined) {
_local1.dataProvider = new DataProviderClass();
_local1.dataProvider.addView(_local1);
}
};
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) {
var _local1 = this;
_local1.selectHolder = _local1.getSelectedIndex();
var _local2 = _local1.getItemAt(index);
_local1.dataProvider.removeItemAt(index);
return(_local2);
};
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) {
var _local1 = this;
_local1.lastSelID = _local1.dataProvider.getItemID(_local1.lastSelected);
_local1.dataProvider.sortItemsBy(fieldName, order);
};
FSelectableListClass.prototype.getLength = function () {
return(this.dataProvider.getLength());
};
FSelectableListClass.prototype.getSelectedIndex = function () {
var _local2 = this;
for (var _local3 in _local2.selected) {
var _local1 = _local2.selected[_local3].sIndex;
if (_local1 != undefined) {
return(_local1);
}
}
return(undefined);
};
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 _local1 = this.getSelectedItem();
if (_local1.data != undefined) {
return(_local1.data);
}
return(_local1.label);
};
FSelectableListClass.prototype.setSelectedIndex = function (index, flag) {
var _local1 = this;
var _local2 = index;
if (((_local2 >= 0) && (_local2 < _local1.getLength())) && (_local1.enable)) {
_local1.clearSelected();
_local1.selectItem(_local2, true);
_local1.lastSelected = _local2;
_local1.invalidate("updateControl");
if (flag != false) {
_local1.executeCallBack();
}
}
};
FSelectableListClass.prototype.setDataProvider = function (obj) {
var _local2 = obj;
this.setScrollPosition(0);
this.clearSelected();
if (_local2 instanceof Array) {
this.dataProvider = new DataProviderClass();
var _local1 = 0;
while (_local1 < _local2.length) {
var _local3 = ((typeof(_local2[_local1]) == "string") ? ({label:_local2[_local1]}) : (_local2[_local1]));
this.dataProvider.addItem(_local3);
_local1++;
}
} else {
this.dataProvider = _local2;
}
this.dataProvider.addView(this);
};
FSelectableListClass.prototype.setItemSymbol = function (linkID) {
var _local1 = this;
_local1.tmpPos = _local1.getScrollPosition();
_local1.itemSymbol = linkID;
_local1.invalidate("setSize");
_local1.setScrollPosition(_local1.tmpPos);
};
FSelectableListClass.prototype.setEnabled = function (enabledFlag) {
var _local2 = this;
_local2.cleanUI();
super.setEnabled(enabledFlag);
_local2.enable = enabledFlag;
_local2.boundingBox_mc.gotoAndStop((_local2.enable ? "enabled" : "disabled"));
var _local3 = Math.min(_local2.numDisplayed, _local2.getLength());
var _local1 = 0;
while (_local1 < _local3) {
_local2.container_mc[("fListItem" + _local1) + "_mc"].setEnabled(_local2.enable);
_local1++;
}
if (_local2.enable) {
_local2.invalidate("updateControl");
}
};
FSelectableListClass.prototype.updateControl = function () {
var _local2 = this;
var _local1 = 0;
while (_local1 < _local2.numDisplayed) {
_local2.container_mc[("fListItem" + _local1) + "_mc"].drawItem(_local2.getItemAt(_local2.topDisplayed + _local1), _local2.isSelected(_local2.topDisplayed + _local1));
_local1++;
}
};
FSelectableListClass.prototype.setSize = function (w, h) {
var _local1 = this;
super.setSize(w, h);
_local1.boundingBox_mc._xscale = (_local1.boundingBox_mc._yscale = 100);
_local1.boundingBox_mc._xscale = (_local1.width * 100) / _local1.boundingBox_mc._width;
_local1.boundingBox_mc._yscale = (_local1.height * 100) / _local1.boundingBox_mc._height;
var _local2 = 0;
while (_local2 < _local1.numDisplayed) {
_local1.container_mc.attachMovie(_local1.itemSymbol, ("fListItem" + _local2) + "_mc", 10 + _local2, {controller:_local1, itemNum:_local2});
var _local3 = _local1.container_mc[("fListItem" + _local2) + "_mc"];
var offset = ((_local1.scrollOffset == undefined) ? 0 : (_local1.scrollOffset));
_local3.setSize(_local1.width - offset, _local1.itmHgt);
_local3._y = (_local1.itmHgt - 2) * _local2;
_local2++;
}
_local1.updateControl();
};
FSelectableListClass.prototype.modelChanged = function (eventObj) {
var _local1 = this;
var firstRow = eventObj.firstRow;
var lastRow = eventObj.lastRow;
var event = eventObj.event;
if (event == "addRows") {
for (var _local2 in _local1.selected) {
if ((_local1.selected[_local2].sIndex != undefined) && (_local1.selected[_local2].sIndex >= firstRow)) {
_local1.selected[_local2].sIndex = _local1.selected[_local2].sIndex + ((lastRow - firstRow) + 1);
_local1.setSelectedIndex(_local1.selected[_local2].sIndex, false);
}
}
} else if (event == "deleteRows") {
if (firstRow == lastRow) {
var index = firstRow;
if (_local1.selectHolder == index) {
_local1.selectionDeleted = true;
}
if (((_local1.topDisplayed + _local1.numDisplayed) >= _local1.getLength()) && (_local1.topDisplayed > 0)) {
_local1.topDisplayed--;
if (_local1.selectionDeleted && ((index - 1) >= 0)) {
_local1.setSelectedIndex(index - 1, false);
}
} else if (_local1.selectionDeleted) {
var len = _local1.getLength();
if (((index == (len - 1)) && (len > 1)) || (index > (len / 2))) {
_local1.setSelectedIndex(index - 1, false);
} else {
_local1.setSelectedIndex(index, false);
}
}
for (var _local2 in _local1.selected) {
if (_local1.selected[_local2].sIndex > firstRow) {
_local1.selected[_local2].sIndex--;
}
}
} else {
_local1.clearSelected();
_local1.topDisplayed = 0;
}
} else if (event == "sort") {
var len = _local1.getLength();
var _local2 = 0;
while (_local2 < len) {
if (_local1.isSelected(_local2)) {
var _local3 = _local1.dataProvider.getItemID(_local2);
if (_local3 == _local1.lastSelID) {
_local1.lastSelected = _local2;
}
_local1.selected[String(_local3)].sIndex = _local2;
}
_local2++;
}
}
_local1.invalidate("updateControl");
};
FSelectableListClass.prototype.measureItmHgt = function () {
var _local1 = this;
_local1.attachMovie(_local1.itemSymbol, "tmpItem_mc", 0, {controller:_local1});
_local1.tmpItem_mc.drawItem({label:"Sizer: PjtTopg"}, false);
_local1.itmHgt = _local1.tmpItem_mc._height;
_local1.tmpItem_mc.removeMovieClip();
};
FSelectableListClass.prototype.selectItem = function (index, selectedFlag) {
var _local1 = this;
var _local2 = index;
if (selectedFlag && (!_local1.isSelected(_local2))) {
_local1.selected[String(_local1.dataProvider.getItemID(_local2))] = {sIndex:_local2};
} else if (!selectedFlag) {
delete _local1.selected[String(_local1.dataProvider.getItemID(_local2))];
}
};
FSelectableListClass.prototype.isSelected = function (index) {
return(this.selected[String(this.dataProvider.getItemID(index))].sIndex != undefined);
};
FSelectableListClass.prototype.clearSelected = function () {
var _local1 = this;
for (var _local3 in _local1.selected) {
var _local2 = _local1.selected[_local3].sIndex;
if (((_local2 != undefined) && (_local1.topDisplayed <= _local2)) && (_local2 < (_local1.topDisplayed + _local1.numDisplayed))) {
_local1.container_mc[("fListItem" + (_local2 - _local1.topDisplayed)) + "_mc"].drawItem(_local1.getItemAt(_local2), false);
}
}
delete _local1.selected;
_local1.selected = new Array();
};
FSelectableListClass.prototype.selectionHandler = function (itemNum) {
var _local1 = this;
var _local2 = _local1.topDisplayed + itemNum;
if (_local1.getItemAt(_local2 == undefined)) {
_local1.changeFlag = false;
} else {
_local1.changeFlag = true;
_local1.clearSelected();
_local1.selectItem(_local2, true);
_local1.container_mc[("fListItem" + itemNum) + "_mc"].drawItem(_local1.getItemAt(_local2), _local1.isSelected(_local2));
}
};
FSelectableListClass.prototype.moveSelBy = function (incr) {
var _local1 = this;
var _local3 = _local1.getSelectedIndex();
var _local2 = _local3 + incr;
_local2 = Math.max(0, _local2);
_local2 = Math.min(_local1.getLength() - 1, _local2);
if (_local2 == _local3) {
} else {
if ((_local3 < _local1.topDisplayed) || (_local3 >= (_local1.topDisplayed + _local1.numDisplayed))) {
_local1.setScrollPosition(_local3);
}
if ((_local2 >= (_local1.topDisplayed + _local1.numDisplayed)) || (_local2 < _local1.topDisplayed)) {
_local1.setScrollPosition(_local1.topDisplayed + incr);
}
_local1.selectionHandler(_local2 - _local1.topDisplayed);
}
};
FSelectableListClass.prototype.clickHandler = function (itmNum) {
var _local1 = this;
_local1.focusRect.removeMovieClip();
if (!_local1.focused) {
_local1.pressFocus();
}
_local1.selectionHandler(itmNum);
_local1.onMouseUp = _local1.releaseHandler;
};
FSelectableListClass.prototype.releaseHandler = function () {
var _local1 = this;
if (_local1.changeFlag) {
_local1.executeCallBack();
}
_local1.changeFlag = false;
_local1.onMouseUp = undefined;
};
FSelectableListClass.prototype.myOnSetFocus = function () {
var _local2 = this;
super.myOnSetFocus();
var _local1 = 0;
while (_local1 < _local2.numDisplayed) {
_local2.container_mc[("fListItem" + _local1) + "_mc"].highlight_mc.gotoAndStop("enabled");
_local1++;
}
};
FSelectableListClass.prototype.myOnKillFocus = function () {
var _local2 = this;
super.myOnKillFocus();
var _local1 = 0;
while (_local1 < _local2.numDisplayed) {
_local2.container_mc[("fListItem" + _local1) + "_mc"].highlight_mc.gotoAndStop("unfocused");
_local1++;
}
};
#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) {
var _local1 = pos;
var _local2 = this;
if (_local2.enable) {
_local1 = Math.min(_local1, _local2.getLength() - _local2.numDisplayed);
_local1 = Math.max(_local1, 0);
_local2.scrollBar_mc.setScrollPosition(_local1);
}
};
FScrollSelectListClass.prototype.setAutoHideScrollBar = function (flag) {
var _local1 = this;
_local1.permaScrollBar = !flag;
_local1.setSize(_local1.width, _local1.height);
};
FScrollSelectListClass.prototype.setEnabled = function (enabledFlag) {
super.setEnabled(enabledFlag);
this.scrollBar_mc.setEnabled(this.enable);
};
FScrollSelectListClass.prototype.setSize = function (w, h) {
var _local1 = this;
var _local2 = _local1.getScrollPosition();
super.setSize(w, h);
if (_local1.scrollBar_mc != undefined) {
_local1.removed = true;
}
_local1.scrollBar_mc = undefined;
_local1.initScrollBar();
_local1.setScrollPosition(_local2);
};
FScrollSelectListClass.prototype.modelChanged = function (eventObj) {
super.modelChanged(eventObj);
this.invalidate("initScrollBar");
};
FScrollSelectListClass.prototype.initScrollBar = function () {
var _local1 = this;
if ((!_local1.permaScrollBar) && (_local1.getLength() <= _local1.numDisplayed)) {
if (_local1.removed) {
_local1.scrollBar_mc.removeMovieClip();
_local1.scrollBar_mc = undefined;
_local1.scrollOffset = undefined;
_local1.invalidate("setSize");
}
} else {
if (_local1.scrollBar_mc == undefined) {
_local1.container_mc.attachMovie("FScrollBarSymbol", "scrollBar_mc", 3000, {hostStyle:_local1.styleTable});
_local1.scrollBar_mc = _local1.container_mc.scrollBar_mc;
_local1.scrollBar_mc.setChangeHandler("scrollHandler", _local1);
_local1.scrollBar_mc.setSize(_local1.height);
_local1.scrollBar_mc._x = _local1.width - _local1.scrollBar_mc._width;
_local1.scrollBar_mc._y = 0;
_local1.scrollBar_mc.setLargeScroll(_local1.numDisplayed - 1);
_local1.scrollOffset = _local1.scrollBar_mc._width;
_local1.invalidate("setSize");
}
_local1.scrollBar_mc.setScrollProperties(_local1.numDisplayed, 0, _local1.getLength() - _local1.numDisplayed);
}
};
FScrollSelectListClass.prototype.scrollHandler = function (scrollBar) {
var _local2 = this;
var _local1 = scrollBar.getScrollPosition();
_local2.topDisplayed = _local1;
if (_local2.lastPosition != _local1) {
_local2.updateControl();
}
_local2.lastPosition = _local1;
};
FScrollSelectListClass.prototype.clickHandler = function (itmNum) {
var _local1 = this;
super.clickHandler(itmNum);
if ((_local1.dragScrolling == undefined) && (_local1.scrollBar_mc != undefined)) {
_local1.dragScrolling = setInterval(_local1, "dragScroll", 15);
}
};
FScrollSelectListClass.prototype.releaseHandler = function () {
clearInterval(this.dragScrolling);
this.dragScrolling = undefined;
super.releaseHandler();
};
FScrollSelectListClass.prototype.dragScroll = function () {
var _local1 = this;
clearInterval(_local1.dragScrolling);
if (_local1.container_mc._ymouse < 0) {
_local1.setScrollPosition(_local1.getScrollPosition() - 1);
_local1.selectionHandler(0);
_local1.scrollInterval = Math.max(25, (-23.8 * (-_local1.container_mc._ymouse)) + 500);
_local1.dragScrolling = setInterval(_local1, "dragScroll", _local1.scrollInterval);
} else if (_local1.container_mc._ymouse > ((_local1.itmHgt - 2) * _local1.numDisplayed)) {
_local1.setScrollPosition(_local1.getScrollPosition() + 1);
_local1.selectionHandler(_local1.numDisplayed - 1);
_local1.scrollInterval = Math.max(25, (-23.8 * Math.abs((_local1.container_mc._ymouse - ((_local1.itmHgt - 2) * _local1.numDisplayed)) - 2)) + 500);
_local1.dragScrolling = setInterval(_local1, "dragScroll", _local1.scrollInterval);
} else {
_local1.dragScrolling = setInterval(_local1, "dragScroll", 15);
}
};
FScrollSelectListClass.prototype.myOnKeyDown = function () {
var _local2 = this;
if (_local2.focused) {
_local2.keyCodes = new Array(40, 38, 34, 33, 36, 35);
_local2.keyIncrs = new Array(1, -1, _local2.numDisplayed - 1, -(_local2.numDisplayed - 1), -_local2.getLength(), _local2.getLength());
var _local1 = 0;
while (_local1 < _local2.keyCodes.length) {
if (Key.isDown(_local2.keyCodes[_local1])) {
_local2.moveSelBy(_local2.keyIncrs[_local1]);
return;
}
_local1++;
}
_local2.findInputText();
}
};
FScrollSelectListClass.prototype.findInputText = function () {
var _local1 = Key.getAscii();
if ((_local1 >= 33) && (_local1 <= 126)) {
this.findString(String.fromCharCode(_local1));
}
};
FScrollSelectListClass.prototype.findString = function (str) {
if (this.getLength() == 0) {
} else {
var _local3 = this.getSelectedIndex();
var jump = 0;
var _local1 = _local3 + 1;
while (_local1 != _local3) {
var _local2 = this.getItemAt(_local1).label.substring(0, str.length);
if ((str == _local2) || (str.toUpperCase() == _local2.toUpperCase())) {
var jump = (_local1 - _local3);
break;
}
if (_local1 >= (this.getLength() - 1)) {
_local1 = -1;
}
_local1++;
}
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) {
var _local1 = this;
super.setSize(w, h);
_local1.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() {
var _local1 = this;
_global._popUpLevel = ((_global._popUpLevel == undefined) ? 20000 : (_global._popUpLevel + 1));
_local1.superHolder = _root.createEmptyMovieClip("superHolder" + _popUpLevel, _popUpLevel);
var _local3 = _local1.superHolder.createEmptyMovieClip("testCont", 20000);
var testBox = _local3.attachMovie("FBoundingBoxSymbol", "boundingBox_mc", 0);
if (testBox._name == undefined) {
_local1.superHolder.removeMovieClip();
_local1.superHolder = _local1._parent.createEmptyMovieClip("superHolder" + _popUpLevel, _popUpLevel);
} else {
_local3.removeMovieClip();
}
if (_local1.rowCount == undefined) {
_local1.rowCount = 8;
_local1.editable = false;
}
_local1.itemSymbol = "FComboBoxItemSymbol";
_local1.init();
_local1.permaScrollBar = false;
_local1.proxyBox_mc.gotoAndStop(1);
_local1.width = _local1._width;
_local1.height = (_local1.proxyBox_mc._height * _local1._yscale) / 100;
var _local2 = 0;
while (_local2 < _local1.labels.length) {
_local1.addItem(_local1.labels[_local2], _local1.data[_local2]);
_local2++;
}
_local1.lastSelected = 0;
_local1.selectItem(0);
_local1._xscale = (_local1._yscale = 100);
_local1.opened = false;
_local1.setSize(_local1.width);
_local1.highlightTop(false);
if (_local1.changeHandler.length > 0) {
_local1.setChangeHandler(_local1.changeHandler);
}
_local1.onUnload = function () {
this.superHolder.removeMovieClip();
};
_local1.setSelectedIndex(0, false);
_local1.value = "";
_local1.focusEnabled = true;
_local1.changeFlag = false;
}
FComboBoxClass.prototype = new FScrollSelectListClass();
Object.registerClass("FComboBoxSymbol", FComboBoxClass);
FComboBoxClass.prototype.modelChanged = function (eventObj) {
var _local1 = this;
super.modelChanged(eventObj);
var _local2 = eventObj.event;
if ((_local2 == "addRows") || (_local2 == "deleteRows")) {
var diff = ((eventObj.lastRow - eventObj.firstRow) + 1);
var mode = ((_local2 == "addRows") ? 1 : -1);
var _local3 = _local1.getLength();
var lenBefore = (_local3 - (mode * diff));
if ((_local1.rowCount > lenBefore) || (_local1.rowCount > _local3)) {
_local1.invalidate("setSize");
}
if (_local1.getSelectedIndex() == undefined) {
_local1.setSelectedIndex(0, false);
}
} else if (_local2 == "updateAll") {
_local1.invalidate("setSize");
}
};
FComboBoxClass.prototype.removeAll = function () {
var _local1 = this;
if (!_local1.enable) {
} else {
super.removeAll();
if (_local1.editable) {
_local1.value = "";
}
_local1.invalidate("setSize");
}
};
FComboBoxClass.prototype.setSize = function (w) {
var _local1 = this;
var _local2 = w;
if ((((_local2 == undefined) || (typeof(_local2) != "number")) || (_local2 <= 0)) || (!_local1.enable)) {
} else {
_local1.proxyBox_mc._width = _local2;
_local1.container_mc.removeMovieClip();
_local1.measureItmHgt();
_local1.container_mc = _local1.superHolder.createEmptyMovieClip("container", 3);
_local1.container_mc.tabChildren = false;
_local1.setPopUpLocation(_local1.container_mc);
_local1.container_mc.attachMovie("FBoundingBoxSymbol", "boundingBox_mc", 0);
_local1.boundingBox_mc = _local1.container_mc.boundingBox_mc;
_local1.boundingBox_mc.component = _local1;
_local1.registerSkinElement(_local1.boundingBox_mc.boundingBox, "background");
_local1.proxyBox_mc._height = _local1.itmHgt;
_local1.numDisplayed = Math.min(_local1.rowCount, _local1.getLength());
if (_local1.numDisplayed < 3) {
_local1.numDisplayed = Math.min(3, _local1.getLength());
}
_local1.height = (_local1.numDisplayed * (_local1.itmHgt - 2)) + 2;
super.setSize(_local2, _local1.height);
_local1.attachMovie("DownArrow", "downArrow", 10);
_local1.downArrow._y = 0;
_local1.downArrow._width = _local1.itmHgt;
_local1.downArrow._height = _local1.itmHgt;
_local1.downArrow._x = _local1.proxyBox_mc._width - _local1.downArrow._width;
_local1.setEditable(_local1.editable);
_local1.container_mc._visible = _local1.opened;
_local1.highlightTop(false);
_local1.fader = _local1.superHolder.attachMovie("FBoundingBoxSymbol", "faderX", 4);
_local1.registerSkinElement(_local1.fader.boundingBox, "background");
_local1.fader._width = _local1.width;
_local1.fader._height = _local1.height;
_local1.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) {
var _local1 = this;
var _local3 = count;
_local1.rowCount = ((_local1.getLength() > _local3) ? (Math.max(_local3, 3)) : (_local3));
_local1.setSize(_local1.width);
var _local2 = _local1.getLength();
if ((_local2 - _local1.getScrollPosition()) < _local1.rowCount) {
_local1.setScrollPosition(_local2 - Math.min(_local1.rowCount, _local2));
_local1.invalidate("updateControl");
}
};
FComboBoxClass.prototype.setEditable = function (editableFlag) {
var _local1 = this;
if (!_local1.enable) {
} else {
_local1.editable = editableFlag;
if (!_local1.editable) {
_local1.onPress = _local1.pressHandler;
_local1.useHandCursor = false;
_local1.trackAsMenu = true;
_local1.attachMovie("FComboBoxItemSymbol", "fLabel_mc", 5, {controller:_local1, itemNum:-1});
_local1.fLabel_mc.onRollOver = undefined;
_local1.fLabel_mc.setSize((_local1.width - _local1.itmHgt) + 1, _local1.itmHgt);
_local1.topLabel = _local1.getSelectedItem();
_local1.fLabel_mc.drawItem(_local1.topLabel, false);
_local1.highlightTop(false);
} else {
_local1.attachMovie("FLabelSymbol", "fLabel_mc", 5);
_local1.fLabel_txt = _local1.fLabel_mc.labelField;
_local1.fLabel_txt.type = "input";
_local1.fLabel_txt._x = 4;
_local1.fLabel_txt.onSetFocus = _local1.onLabelFocus;
_local1.fLabel_mc.setSize((_local1.width - _local1.itmHgt) - 3);
delete _local1.onPress;
_local1.fLabel_txt.onKillFocus = function () {
this._parent._parent.myOnKillFocus();
};
_local1.fLabel_mc.setLabel(_local1.value);
_local1.fLabel_txt.onChanged = function () {
this._parent._parent.findInputText();
};
_local1.downArrow.onPress = _local1.buttonPressHandler;
_local1.downArrow.useHandCursor = false;
_local1.downArrow.trackAsMenu = true;
}
}
};
FComboBoxClass.prototype.setEnabled = function (enabledFlag) {
var _local1 = this;
var _local2 = enabledFlag;
_local2 = (((_local2 == undefined) || (typeof(_local2) != "boolean")) ? true : (_local2));
super.setEnabled(_local2);
_local1.registerSkinElement(_local1.boundingBox_mc.boundingBox, "background");
_local1.proxyBox_mc.gotoAndStop((_local1.enable ? "enabled" : "disabled"));
_local1.downArrow.gotoAndStop((_local1.enable ? 1 : 3));
if (_local1.editable) {
_local1.fLabel_txt.type = (_local2 ? "input" : "dynamic");
_local1.fLabel_txt.selectable = _local2;
} else if (_local2) {
_local1.fLabel_mc.drawItem(_local1.topLabel, false);
_local1.setSelectedIndex(_local1.getSelectedIndex(), false);
}
_local1.fLabel_mc.setEnabled(_local1.enable);
_local1.fLabel_txt.onSetFocus = (_local2 ? (_local1.onLabelFocus) : undefined);
};
FComboBoxClass.prototype.setSelectedIndex = function (index, flag) {
var _local1 = this;
super.setSelectedIndex(index, flag);
if (!_local1.editable) {
_local1.topLabel = _local1.getSelectedItem();
_local1.fLabel_mc.drawItem(_local1.topLabel, false);
} else {
_local1.value = ((flag != undefined) ? "" : (_local1.getSelectedItem().label));
_local1.fLabel_mc.setLabel(_local1.value);
}
_local1.invalidate("updateControl");
};
FComboBoxClass.prototype.setValue = function (value) {
var _local1 = this;
if (_local1.editable) {
_local1.fLabel_mc.setLabel(value);
_local1.value = value;
}
};
FComboBoxClass.prototype.pressHandler = function () {
var _local1 = this;
_local1.focusRect.removeMovieClip();
if (_local1.enable) {
if (!_local1.opened) {
_local1.onMouseUp = _local1.releaseHandler;
} else {
_local1.onMouseUp = undefined;
}
_local1.changeFlag = false;
if (!_local1.focused) {
_local1.pressFocus();
_local1.clickFilter = (_local1.editable ? false : true);
}
if (!_local1.clickFilter) {
_local1.openOrClose(!_local1.opened);
} else {
_local1.clickFilter = false;
}
}
};
FComboBoxClass.prototype.clickHandler = function (itmNum) {
var _local1 = this;
if (!_local1.focused) {
if (_local1.editable) {
_local1.fLabel_txt.onKillFocus = undefined;
}
_local1.pressFocus();
}
super.clickHandler(itmNum);
_local1.selectionHandler(itmNum);
_local1.onMouseUp = _local1.releaseHandler;
};
FComboBoxClass.prototype.highlightTop = function (flag) {
var _local1 = this;
if (!_local1.editable) {
_local1.fLabel_mc.drawItem(_local1.topLabel, flag);
}
};
FComboBoxClass.prototype.myOnSetFocus = function () {
super.myOnSetFocus();
this.fLabel_mc.highlight_mc.gotoAndStop("enabled");
this.highlightTop(true);
};
FComboBoxClass.prototype.drawFocusRect = function () {
var _local1 = this;
_local1.drawRect(-2, -2, _local1.width + 4, _local1._height + 4);
};
FComboBoxClass.prototype.myOnKillFocus = function () {
var _local1 = this;
if (Selection.getFocus().indexOf("labelField") != -1) {
} else {
super.myOnKillFocus();
delete _local1.fLabel_txt.onKeyDown;
_local1.openOrClose(false);
_local1.highlightTop(false);
}
};
FComboBoxClass.prototype.setPopUpLocation = function (mcRef) {
var _local1 = this;
var _local3 = mcRef;
_local3._x = _local1._x;
var _local2 = {x:_local1._x, y:_local1._y + _local1.proxyBox_mc._height};
_local1._parent.localToGlobal(_local2);
_local3._parent.globalToLocal(_local2);
_local3._x = _local2.x;
_local3._y = _local2.y;
if ((_local1.height + _local3._y) >= Stage.height) {
_local1.upward = true;
_local3._y = (_local2.y - _local1.height) - _local1.proxyBox_mc._height;
} else {
_local1.upward = false;
}
};
FComboBoxClass.prototype.openOrClose = function (flag) {
var _local1 = this;
var _local2 = flag;
if (_local1.getLength() == 0) {
} else {
_local1.setPopUpLocation(_local1.container_mc);
if ((_local1.lastSelected != -1) && ((_local1.lastSelected < _local1.topDisplayed) || (_local1.lastSelected > (_local1.topDisplayed + _local1.numDisplayed)))) {
super.moveSelBy(_local1.lastSelected - _local1.getSelectedIndex());
}
if (!_local2) {
(_local1.downArrow.gotoAndStop(1));// not popped
} else {
(_local1.downArrow.gotoAndStop(2));// not popped
}
if (_local2 == _local1.opened) {
} else {
_local1.highlightTop(!_local2);
_local1.fadeRate = _local1.styleTable.popUpFade.value;
if (((!_local2) || (_local1.fadeRate == undefined)) || (_local1.fadeRate == 0)) {
_local1.opened = (_local1.container_mc._visible = _local2);
} else {
_local1.setPopUpLocation(_local1.fader);
_local1.time = 0;
_local1.const = 85 / Math.sqrt(_local1.fadeRate);
_local1.fader._alpha = 85;
_local1.container_mc._visible = (_local1.fader._visible = true);
_local1.onEnterFrame = function () {
var _local1 = this;
_local1.fader._alpha = 100 - ((_local1.const * Math.sqrt(++_local1.time)) + 15);
if (_local1.time >= _local1.fadeRate) {
_local1.fader._visible = false;
delete _local1.onEnterFrame;
_local1.opened = true;
}
};
}
}
}
};
FComboBoxClass.prototype.fireChange = function () {
var _local1 = this;
_local1.lastSelected = _local1.getSelectedIndex();
if (!_local1.editable) {
_local1.topLabel = _local1.getSelectedItem();
_local1.fLabel_mc.drawItem(_local1.topLabel, true);
} else {
_local1.value = _local1.getSelectedItem().label;
_local1.fLabel_mc.setLabel(_local1.value);
}
_local1.executeCallback();
};
FComboBoxClass.prototype.releaseHandler = function () {
var _local1 = this;
var _local2 = _root;
var _local3 = _local1.boundingBox_mc.hitTest(_local2._xmouse, _local2._ymouse);
if (_local1.changeFlag) {
if (_local3) {
_local1.fireChange();
}
_local1.openOrClose(!_local1.opened);
} else if (_local3) {
_local1.openOrClose(false);
} else {
_local1.onMouseDown = function () {
var _local1 = this;
var _local2 = _root;
if ((!_local1.boundingBox_mc.hitTest(_local2._xmouse, _local2._ymouse)) && (!_local1.hitTest(_local2._xmouse, _local2._ymouse))) {
_local1.onMouseDown = undefined;
_local1.openOrClose(false);
}
};
}
_local1.changeFlag = false;
_local1.onMouseUp = undefined;
clearInterval(_local1.dragScrolling);
_local1.dragScrolling = undefined;
};
FComboBoxClass.prototype.moveSelBy = function (itemNum) {
var _local1 = this;
if (itemNum != 0) {
super.moveSelBy(itemNum);
if (_local1.editable) {
_local1.setValue(_local1.getSelectedItem().label);
}
if (!_local1.opened) {
if (_local1.changeFlag && (!_local1.isSelected(_local1.lastSelected))) {
_local1.fireChange();
}
}
}
};
FComboBoxClass.prototype.myOnKeyDown = function () {
var _local1 = this;
if (!_local1.focused) {
} else {
if (_local1.editable && (Key.isDown(13))) {
_local1.setValue(_local1.fLabel_mc.getLabel());
_local1.executeCallback();
_local1.openOrClose(false);
} else if ((Key.isDown(13) || (Key.isDown(32) && (!_local1.editable))) && (_local1.opened)) {
if (_local1.getSelectedIndex() != _local1.lastSelected) {
_local1.fireChange();
}
_local1.openOrClose(false);
_local1.fLabel_txt.hscroll = 0;
}
super.myOnKeyDown();
}
};
FComboBoxClass.prototype.findInputText = function () {
if (!this.editable) {
super.findInputText();
}
};
FComboBoxClass.prototype.onLabelFocus = function () {
var _local1 = this;
_local1._parent._parent.tabFocused = false;
_local1._parent._parent.focused = true;
_local1.onKeyDown = function () {
this._parent._parent.myOnKeyDown();
};
Key.addListener(_local1);
};
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 419 Button
on (press) {
getURL ("http://www.totallygame.com", "_blank");
}
Symbol 430 Button
on (press) {
getURL ("http://www.totallygame.com", "_blank");
}
Symbol 432 Button
on (press, keyPress "<Enter>") {
_root.gotoAndPlay("menu");
}
Symbol 433 MovieClip Frame 1
stop();
Symbol 433 MovieClip Frame 4
stop();
Symbol 519 Button
on (press) {
_root.buyme_mc._visible = true;
}
Symbol 556 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 558 Button
on (press) {
_root.buyme_mc._visible = false;
}
Symbol 560 MovieClip Frame 10
stop();
Symbol 563 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 _local2 = selected;
var _local3 = driver;
var ctargetbody = _local3.tocolor_mc;
_local3.myColor = new Color(ctargetbody);
_local3.myColorTransform = new Object();
var _local1 = _local3.myColorTransform;
_local1.ra = CParray[_local2][0];
_local1.rb = CParray[_local2][1];
_local1.ga = CParray[_local2][2];
_local1.gb = CParray[_local2][3];
_local1.ba = CParray[_local2][4];
_local1.bb = CParray[_local2][5];
_local1.aa = CParray[_local2][6];
_local1.ab = CParray[_local2][7];
_local3.myColor.setTransform(_local1);
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 571 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(1);
}
on (press, keyPress "<Enter>") {
_root.gotoAndPlay("settings");
}
Symbol 575 MovieClip Frame 1
stop();
Symbol 579 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(2);
}
on (press) {
_root.savemenu_mc.gotoAndStop(2);
}
Symbol 583 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 587 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(4);
}
on (press) {
_root.gotoAndStop("help");
}
Symbol 591 Button
on (rollOver, dragOver) {
buttondowncar_mc.gotoAndStop(5);
}
on (press) {
_root.gotoAndStop("credits");
}
Symbol 600 Button
on (press) {
_root.savetoSO_mygame();
this.gotoAndStop(3);
}
Symbol 603 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 606 Button
on (press) {
this.gotoAndStop(4);
}
Symbol 611 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 614 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 616 MovieClip Frame 1
stop();
Symbol 616 MovieClip Frame 2
underlay_but.onPress = function () {
};
underlay_but.useHandCursor = false;
Symbol 623 Button
on (press) {
_root.gotoAndStop("shop");
}
Symbol 626 Button
on (press) {
_root.gotoAndStop("tuning");
}
Symbol 629 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 633 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 (692);
}
Symbol 635 Button
on (press) {
_root.gotoAndPlay("colorpicker");
}
Symbol 641 Button
on (press) {
_root.gotoAndPlay("menu");
}
Symbol 643 MovieClip Frame 10
stop();
Symbol 652 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 653 MovieClip Frame 10
stop();
Symbol 659 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 661 MovieClip Frame 10
stop();
Instance of Symbol 660 MovieClip in Symbol 661 MovieClip Frame 10
on (press) {
_root.uitleg_mc.nextFrame();
}
Symbol 704 MovieClip Frame 1
stop();
Symbol 704 MovieClip Frame 9
stop();
Symbol 704 MovieClip Frame 27
gotoAndPlay ("start");
Symbol 716 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 718 MovieClip Frame 10
stop();
Instance of Symbol 717 MovieClip in Symbol 718 MovieClip Frame 10
on (press) {
_root.uitleg_mc.prevFrame();
}
Symbol 740 MovieClip Frame 1
stop();
Symbol 743 MovieClip Frame 1
stop();
Symbol 753 MovieClip Frame 1
stop();
Symbol 756 MovieClip Frame 1
stop();
Instance of Symbol 752 MovieClip "knipper_mc" in Symbol 756 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 756 MovieClip Frame 405
_root.tankers_mc.gotoAndPlay("reverse");
Symbol 786 MovieClip Frame 1
stop();
back_but.useHandCursor = false;
Instance of Symbol 711 MovieClip "fuelgame_mc" in Symbol 786 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 786 MovieClip Frame 2
stop();
Symbol 786 MovieClip Frame 3
stop();
Symbol 786 MovieClip Frame 4
stop();
Symbol 810 Button
on (press) {
getURL ("http://www.isioux.nl", "_blank");
}
Symbol 826 MovieClip Frame 1
stop();
Symbol 829 MovieClip Frame 1
stop();
Symbol 886 MovieClip Frame 1
stop();
Symbol 896 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 897 MovieClip Frame 1
stop();
Symbol 905 Button
on (press) {
_root.pressedslider = true;
_root.dragid = this.id;
slider_handler_mc._x = this._xmouse;
}
Symbol 907 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 908 MovieClip "slider_handler_mc" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
top = _y;
bottom = _y;
left = _x;
right = _x + 256;
}
Symbol 944 MovieClip Frame 1
stop();
Symbol 950 MovieClip Frame 1
stop();
Symbol 953 MovieClip Frame 1
stop();
Symbol 961 MovieClip Frame 1
stop();
Symbol 977 MovieClip Frame 1
stop();
Symbol 977 MovieClip Frame 2
stop();
Symbol 977 MovieClip Frame 3
stop();
Symbol 977 MovieClip Frame 4
stop();
Symbol 977 MovieClip Frame 5
stop();
Symbol 977 MovieClip Frame 6
stop();
Symbol 977 MovieClip Frame 7
stop();
Symbol 977 MovieClip Frame 8
stop();
Symbol 977 MovieClip Frame 9
stop();
Symbol 977 MovieClip Frame 10
stop();
Symbol 1019 MovieClip Frame 1
stop();
Symbol 1057 MovieClip Frame 1
stop();
Symbol 1057 MovieClip Frame 2
stop();
Symbol 1057 MovieClip Frame 3
stop();
Symbol 1057 MovieClip Frame 4
stop();
Symbol 1057 MovieClip Frame 5
stop();
Symbol 1057 MovieClip Frame 6
stop();
Symbol 1057 MovieClip Frame 7
stop();
Symbol 1057 MovieClip Frame 8
stop();
Symbol 1057 MovieClip Frame 9
stop();
Symbol 1057 MovieClip Frame 10
stop();
Symbol 1091 MovieClip Frame 1
stop();
Symbol 1119 MovieClip Frame 1
stop();
Symbol 1119 MovieClip Frame 2
stop();
Symbol 1119 MovieClip Frame 3
stop();
Symbol 1119 MovieClip Frame 4
stop();
Symbol 1119 MovieClip Frame 5
stop();
Symbol 1119 MovieClip Frame 6
stop();
Symbol 1119 MovieClip Frame 7
stop();
Symbol 1119 MovieClip Frame 8
stop();
Symbol 1119 MovieClip Frame 9
stop();
Symbol 1119 MovieClip Frame 10
stop();
Instance of Symbol 1057 MovieClip "white_mc" in Symbol 1170 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1179 MovieClip Frame 1
stop();
Symbol 1188 MovieClip Frame 1
stop();
Symbol 1188 MovieClip Frame 2
stop();
Symbol 1188 MovieClip Frame 3
stop();
Symbol 1188 MovieClip Frame 4
stop();
Symbol 1188 MovieClip Frame 5
stop();
Symbol 1188 MovieClip Frame 6
stop();
Symbol 1191 MovieClip Frame 1
stop();
Symbol 1195 MovieClip Frame 1
stop();
Symbol 1195 MovieClip Frame 2
stop();
Symbol 1195 MovieClip Frame 3
stop();
Symbol 1195 MovieClip Frame 4
stop();
Symbol 1195 MovieClip Frame 5
stop();
Symbol 1195 MovieClip Frame 6
stop();
Symbol 1198 MovieClip Frame 1
stop();
Symbol 1202 MovieClip Frame 1
stop();
Symbol 1202 MovieClip Frame 2
stop();
Symbol 1202 MovieClip Frame 3
stop();
Symbol 1202 MovieClip Frame 4
stop();
Symbol 1202 MovieClip Frame 5
stop();
Symbol 1202 MovieClip Frame 6
stop();
Symbol 1205 MovieClip Frame 1
stop();
Symbol 1209 MovieClip Frame 1
stop();
Symbol 1209 MovieClip Frame 2
stop();
Symbol 1209 MovieClip Frame 3
stop();
Symbol 1209 MovieClip Frame 4
stop();
Symbol 1209 MovieClip Frame 5
stop();
Symbol 1209 MovieClip Frame 6
stop();
Symbol 1212 MovieClip Frame 1
stop();
Symbol 1216 MovieClip Frame 1
stop();
Symbol 1216 MovieClip Frame 2
stop();
Symbol 1216 MovieClip Frame 3
stop();
Symbol 1216 MovieClip Frame 4
stop();
Symbol 1216 MovieClip Frame 5
stop();
Symbol 1216 MovieClip Frame 6
stop();
Symbol 1219 MovieClip Frame 1
stop();
Symbol 1223 MovieClip Frame 1
stop();
Symbol 1223 MovieClip Frame 2
stop();
Symbol 1223 MovieClip Frame 3
stop();
Symbol 1223 MovieClip Frame 4
stop();
Symbol 1223 MovieClip Frame 5
stop();
Symbol 1223 MovieClip Frame 6
stop();
Symbol 1226 MovieClip Frame 1
stop();
Instance of Symbol 1191 MovieClip "bl_mc" in Symbol 1227 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1198 MovieClip "fl_mc" in Symbol 1227 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1205 MovieClip "br_mc" in Symbol 1227 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1212 MovieClip "fr_mc" in Symbol 1227 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1219 MovieClip "bw_mc" in Symbol 1227 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Instance of Symbol 1226 MovieClip "fw_mc" in Symbol 1227 MovieClip Frame 1
onClipEvent (load) {
this._alpha = 0;
}
Symbol 1275 MovieClip Frame 1
stop();
Symbol 1275 MovieClip Frame 8
startRace();
play();
Symbol 1275 MovieClip Frame 23
stop();
Symbol 1280 MovieClip Frame 1
stop();
Symbol 1289 MovieClip Frame 1
stop();
Symbol 1289 MovieClip Frame 2
_root.showpittime = _root.R_game_mc.timetostring(_root.toshowpittime);
Symbol 1320 MovieClip Frame 1
stop();
Symbol 1344 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 1345 MovieClip Frame 1
stop();
Symbol 1345 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 1359 MovieClip Frame 1
stop();
Instance of Symbol 1334 MovieClip "submitscore" in Symbol 1359 MovieClip Frame 1
on (press) {
if (this._parent._currentframe < 2) {
this._parent.gotoAndPlay(2);
}
}
Symbol 1359 MovieClip Frame 10
stop();
Instance of Symbol 1346 MovieClip "submitscore" in Symbol 1359 MovieClip Frame 10
onClipEvent (load) {
_root.menu_levelcomplited_mc.submitscore._visible = false;
}
Symbol 1359 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 1399 Button
on (press) {
_global.endgame();
}
Symbol 1412 MovieClip Frame 1
stop();
Symbol 1412 MovieClip Frame 73
_root.R_game_mc.flag_mc.removeMovieClip();
Symbol 1412 MovieClip Frame 118
mouse.show();
stop();
Symbol 1412 MovieClip Frame 341
_global.endgame();
stop();
Symbol 1412 MovieClip Frame 437
this.gotoAndPlay("gameover");
Symbol 1416 Button
on (press) {
globalsound = new Sound();
_root.targetsound = 0;
globalsound.setVolume(0);
this.gotoAndStop(2);
}
Symbol 1420 Button
on (press) {
globalsound = new Sound();
_root.targetsound = 100;
globalsound.setVolume(100);
this.gotoAndStop(1);
}
Symbol 1421 MovieClip Frame 1
stop();
Symbol 1425 Button
on (press) {
_quality = "HIGH";
_root.qualitynumber = 2;
this.gotoAndStop(2);
}
Symbol 1429 Button
on (press) {
_quality = "BEST";
_root.qualitynumber = 3;
this.gotoAndStop(3);
}
Symbol 1433 Button
on (press) {
_quality = "LOW";
_root.qualitynumber = 1;
this.gotoAndStop(1);
}
Symbol 1434 MovieClip Frame 1
stop();
Symbol 1435 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 () {
var _local3 = _global;
_root.R_game_mc.randomcolors();
i = 0;
while (i <= maxdrivers) {
driver = driverObj["driver" + i];
var _local2 = driver.mc.car_main_mc.body_mc;
_local3["myColor" + i] = new Color(_local2);
myColorTransform = new Object();
var _local1 = pickedcolors[i];
myCT.ra = CParray[_local1][0];
myCT.rb = CParray[_local1][1];
myCT.ga = CParray[_local1][2];
myCT.gb = CParray[_local1][3];
myCT.ba = CParray[_local1][4];
myCT.bb = CParray[_local1][5];
myCT.aa = CParray[_local1][6];
myCT.ab = CParray[_local1][7];
i++;
}
changecolor(0);
};
_global.changecolor = function (i) {
var _local3 = i;
driver = driverObj["driver" + _local3];
var ctargetbody = driver.mc.car_main_mc.body_mc;
_global["myColor" + _local3] = new Color(ctargetbody);
_global["myColorTransform" + _local3] = new Object();
var _local1 = _global["myColorTransform" + _local3];
var _local2 = pickedcolors[_local3];
_local1.ra = CParray[_local2][0];
_local1.rb = CParray[_local2][1];
_local1.ga = CParray[_local2][2];
_local1.gb = CParray[_local2][3];
_local1.ba = CParray[_local2][4];
_local1.bb = CParray[_local2][5];
_local1.aa = CParray[_local2][6];
_local1.ab = CParray[_local2][7];
_global["myColor" + _local3].setTransform(_local1);
};
_global.changecolorCPU = function (i) {
var _local3 = i;
driver = driverObj["driver" + _local3];
var ctargetbody = driver.mc.car_main_mc.body_mc;
_global["myColor" + _local3] = new Color(ctargetbody);
_global["myColorTransform" + _local3] = new Object();
var _local1 = _global["myColorTransform" + _local3];
var _local2 = pickedcolors[_local3];
_local1.ra = CParrayCPU[_local2][0];
_local1.rb = CParrayCPU[_local2][1];
_local1.ga = CParrayCPU[_local2][2];
_local1.gb = CParrayCPU[_local2][3];
_local1.ba = CParrayCPU[_local2][4];
_local1.bb = CParrayCPU[_local2][5];
_local1.aa = CParrayCPU[_local2][6];
_local1.ab = CParrayCPU[_local2][7];
_global["myColor" + _local3].setTransform(_local1);
};
_root.R_game_mc.randomcolors = function () {
pick5function();
};
_global.pick5functionhelper = function (mynumber) {
var _local1 = _global;
var _local2 = mynumber;
j = 0;
while (j <= _local1.pickedcolors.length) {
if (_local1.pickedcolors[j] == _local2) {
return(false);
}
j++;
}
return(undefined);
};
_global.pick5function = function () {
var _local1 = CParrayCPU.length - 1;
_global.pickedcolors = [CPmycolor];
i = 1;
while (i <= maxdrivers) {
mypick = Math.floor(Math.random() * _local1);
if (pick5functionhelper(mypick) == false) {
i = i - 1;
} else {
pickedcolors.push(mypick);
}
i++;
}
};
_global.pick5namesfunctionhelper = function (mynumber) {
var _local1 = _global;
var _local2 = mynumber;
j = 0;
while (j <= _local1.pickednames.length) {
if (_local1.pickednames[j] == _local2) {
return(false);
}
j++;
}
return(undefined);
};
_global.pick5namesfunction = function () {
var _local2 = _global;
var _local1 = CpuNamesarray.length;
_local2.pickednames = [];
i = 1;
while (i <= maxdrivers) {
mypick = Math.floor(Math.random() * _local1);
if (pick5namesfunctionhelper(mypick) == false) {
i = i - 1;
} else {
pickednames.push(mypick);
}
i++;
}
i = 1;
while (i <= maxdrivers) {
driverObj["driver" + i].name = _local2.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 () {
var _local2 = _global;
if ((!gamestart) && (!develop)) {
if (Key.isDown(38)) {
_local2.falsestart = true;
}
if (!Key.isDown(38)) {
_local2.falsestart = false;
}
} else {
if (!Key.isDown(38)) {
_local2.falsestart = false;
}
if (_local2.falsestart) {
} else {
var _local1 = driverObj.driver0;
if (_local1.finished || (_local1.atpitstreet)) {
if (_local1.speedperc > 0) {
_local1.speedperc = _local1.speedperc - 1;
} else {
_local1.speedperc = 0;
}
} else {
if (Key.isDown(40) && (!Key.isDown(38))) {
if (_local1.speedperc > 0) {
_local1.speedperc = _local1.speedperc - 2;
}
}
if (_local1.fu <= 0) {
if (_local1.speedperc > 0) {
_local1.speedperc = _local1.speedperc - 0.2;
} else {
_local1.speedperc = 0;
}
if (_local1.speedperc <= 0) {
if (_root.R_game_mc.endPosition_mc._currentframe < 123) {
_root.R_game_mc.endPosition_mc.gotoAndPlay(123);
}
}
} else if (_local2.totallos) {
if (_local1.speedperc > 0) {
_local1.speedperc = _local1.speedperc - 0.9;
} else {
_local1.speedperc = 0;
}
} else if (Key.isDown(38) && (!Key.isDown(40))) {
if (_local1.speedperc < 100) {
_local1.speedperc = _local1.speedperc + 1;
}
} else if ((_local1.speedperc > 0) && (!develop)) {
_local1.speedperc = _local1.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) {
} else if (!gamestart) {
} else {
var _local3 = driverObj.driver0.speedperc;
if (_local3 <= 0) {
} else {
if (_local3 > 50) {
_local3 = 50;
}
var framestep = Math.round((_local3 * 5) / 50);
var _local2 = this.cfr + framestep;
if (_local2 > 10) {
_local2 = _local2 - 10;
}
this.cfr = _local2;
i = 0;
while (i <= knipmax) {
var _local1 = _root.R_game_mc.main_mc[toknipper[i]];
_local1.gotoAndStop(_local2);
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 _local1 = driverObj.driver0;
if (_local1.speedperc <= 0) {
} else {
if (Key.isDown(37) && (!Key.isDown(39))) {
if (_local1.xPerc > -10) {
var _local2 = _local1.speedperc;
if (_local2 < 50) {
var _local3 = (_local1.speedperc * _local1.maxstearforce) / 100;
var stearforce = (_local3 + 1.7);
} else {
var _local3 = (_local1.speedperc * _local1.maxstearforce) / 100;
var stearforce = ((_local1.maxstearforce - _local3) + 1.7);
}
_local1.xPerc = _local1.xPerc - stearforce;
}
}
if (Key.isDown(39) && (!Key.isDown(37))) {
if (_local1.xPerc < 110) {
var _local2 = _local1.speedperc;
if (_local2 < 50) {
var _local3 = (_local1.speedperc * _local1.maxstearforce) / 100;
var stearforce = (_local3 + 1.7);
} else {
var _local3 = (_local1.speedperc * _local1.maxstearforce) / 100;
var stearforce = ((_local1.maxstearforce - _local3) + 1.7);
}
_local1.xPerc = _local1.xPerc + stearforce;
}
}
}
};
_root.R_game_mc.attachpitstop = function () {
var _local2 = _global;
if (_local2.develop) {
_local2.circuitdis = circuit[circuit.length - 1].dis;
} else {
var circuitlength = circuit[circuit.length - 1].dis;
var _local1 = circuitlength + 0.04;
if (circuit[circuit.length - 1].pframe < 25) {
var _local3 = 1;
} else if (circuit[circuit.length - 1].pframe > 25) {
var _local3 = -1;
} else {
var _local3 = 0;
}
_root.pitdisstart = _local1;
circuit.push({dis:_local1, dir:_local3, step:0.5, goal:25, style:1, pframe:25});
_local1 = _local1 + 0.002;
circuit.push({dis:_local1, dir:0, step:0.5, goal:25, style:1, pframe:25, pit:2});
_local1 = _local1 + 0.02;
circuit.push({dis:_local1, dir:0, step:0.5, goal:25, style:1, pframe:25, pit:4});
_local2.pitmarker = circuit.length - 1;
_local1 = _local1 + 0.3;
circuit.push({dis:_local1, dir:0, step:0.5, goal:25, style:1, pframe:25, pit:3});
_local1 = _local1 + 0.02;
circuit.push({dis:_local1, dir:0, step:0.5, goal:25, style:1, pframe:25});
_local1 = _local1 + 0.02;
circuit.push({dis:_local1, dir:0, step:0.5, goal:25, style:1, pframe:25});
_local1 = _local1 + ((maxdrivers * 0.025) + 0.034);
circuit.push({dis:_local1, dir:0, step:0.5, goal:25, style:1, pframe:25, lal:1});
_local2.circuitdis = circuit[circuit.length - 1].dis;
}
};
circuitObject = function () {
var _local1 = this;
_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 _local2 = circuit[k].dis;
var _local3 = Math.round(_local2 * 1000);
var ndis = (_local3 / 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(_local1);
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);
};
_local1.addListener(ctarget);
i++;
}
ctarget = _root.R_game_mc.hectaTotal_mc;
ctarget.stopme = function () {
this.stop();
};
ctarget.gotoframe = function (gottenframe) {
this.gotoAndStop(gottenframe);
};
_local1.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 _local1 = circuit.length;
trace("_global.circuit = [");
i = 0;
while (i < _local1) {
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 _local1 = _root;
var _local3 = _global;
var _local2 = driverObj.driver0;
if (_local2.finished || (_local2.atpitstreet)) {
} else if (develop) {
var maxlength = (circuit.length - 1);
var goal = circuit[maxlength].goal;
var style = circuit[maxlength].style;
if (style == 0) {
return;
}
if ((cframe == goal) || (style == undefined)) {
var tempdistance = _local2.distance;
var tempdirectionstep = directionstep;
var tempcframe = cframe;
} else {
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;
if (!develop) {
if (_local2.speed == 0) {
} else {
var dis2 = circuit[_local2.marker + 1].dis;
var mydist = _local2.distance;
if (_local2.laps == maxlaps) {
if (mydist > endcam) {
_local3.passedendcam = true;
if (_local1.R_game_mc.flag_mc == undefined) {
var myflag = _local1.R_game_mc.attachMovie("flag", "flag_mc", 999);
myflag._x = 520;
myflag._y = 400;
}
}
}
if ((mydist >= dis2) && (!(dis2 === undefined))) {
_local2.marker = _local2.marker + 1;
if (_local2.marker >= (circuit.length - 1)) {
if (!(_local2.laps === 0)) {
endLapTime = MainControl.getmytimer();
_local3.lastlaptime = (endLapTime / 1000) - (startLapTime / 1000);
_local3.endtime = _local3.endtime + _local3.lastlaptime;
_local1.showlastlaptime = _local1.R_game_mc.timetostring(lastlaptime);
if ((_local3.bestlaptime == undefined) || (lastlaptime < _local3.bestlaptime)) {
_local3.bestlaptime = lastlaptime;
_local1.showbestlaptime = _local1.R_game_mc.timetostring(lastlaptime);
}
}
circuitControl.reset(_local2);
_local2.laps = _local2.laps + 1;
if (_local2.laps == maxlaps) {
_local1.R_game_mc.finallap_mc.gotoAndPlay(2);
}
if (_local2.laps > maxlaps) {
_local2.finished = true;
var precircuittime2 = _local3.endtime;
_local2.circuittime = precircuittime2;
endlist.push(_local2.number);
var myposition = endlist.length;
_local1["endtime" + myposition] = _local1.R_game_mc.timetostring(precircuittime2);
_local1["endname" + myposition] = (myposition + ". ") + _local2.name;
_local1["besttime" + myposition] = _local1.showbestlaptime;
_local1.R_game_mc.endPosition_mc.sub.gotoAndStop(myposition);
_local1.R_game_mc.endPosition_mc.gotoAndPlay(2);
if (myposition < 4) {
var startbydiff = ((_local3.difflevel - 1) * 3);
_local1.wonprice = _local1.pricemoneyshow[startbydiff + myposition];
_local1.setmymoneyshow(_local1.pricemoney[startbydiff + myposition] * -1);
}
_local1.R_game_mc.laptime_mc._visible = false;
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 3;
var mymarker = _local2.marker;
var mylap = (_local2.laps - 1);
var killer = _local1.R_game_mc.createEmptyMovieClip("interkiller_mc", 16000);
killer.number = 0;
killer.ctime = 0;
killer.onEnterFrame = function () {
var _local1 = this;
if (_local1.ctime >= 5) {
_root.R_game_mc.menu_inter_mc._visible = false;
}
if (_local1.ctime >= 5) {
_root.R_game_mc[("menu_inter" + _local1.number) + "_mc"]._visible = false;
_local1.number = _local1.number + 1;
if (_local1.number > maxdrivers) {
_local1.onEnterFrame = undefined;
}
} else {
_local1.ctime = _local1.ctime + 1;
}
};
return;
}
_local1.showlap = (("Lap " + String(_local2.laps)) + " / ") + maxlaps;
return;
}
var mymarker = _local2.marker;
var mylap = _local2.laps;
if (((mymarker == _local3.maininter1) || (mymarker == _local3.maininter2)) || (mymarker == _local3.maininter3)) {
if (!(_local2.intermediat === mymarker)) {
if (mymarker == _local3.maininter1) {
_local1.cInter = 1;
} else if (mymarker == _local3.maininter2) {
_local1.cInter = 2;
} else if (mymarker == _local3.maininter3) {
_local1.cInter = 3;
}
_local3.Tinterobj[(("intermediatsStatusL" + _local2.intermediatlap) + "M") + _local2.intermediat] = 3;
_local2.intermediatlap = mylap;
_local2.intermediat = mymarker;
var myintermediat = _local3.Tinterobj[(("intermediatsL" + mylap) + "M") + mymarker];
var interstatus = _local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker];
var endLapTime = MainControl.getmytimer();
var preintertime = ((endLapTime / 1000) - (startLapTime / 1000));
var myintertime = (_local3.endtime + preintertime);
maindriver.intertime = myintertime;
var intertimeShow = _local1.R_game_mc.timetostring(myintertime);
_local1.R_game_mc.interkiller_mc.onEnterFrame = undefined;
_local1.R_game_mc.interkiller_mc.removeMovieClip();
i = 0;
while (i <= maxdrivers) {
_local1.R_game_mc[("menu_inter" + i) + "_mc"]._visible = false;
i++;
}
_local1.R_game_mc.menu_inter_mc._visible = true;
if (interstatus == undefined) {
var ctarget = _local1.R_game_mc.menu_inter0_mc;
var ctext = _local1.R_game_mc.menu_inter0_mc.mytxt;
_local3.changeTextColor(ctarget, 16776960, intertimeShow, ctext);
var ctext = _local1.R_game_mc.menu_inter0_mc.mynumber;
_local3.changeTextColor(ctarget, 16776960, "1", ctext);
ctarget._visible = true;
_local3.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] = 1;
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 2;
} else {
var driverspast = myintermediat.length;
i = 0;
while (i < driverspast) {
var pasttime = (myintertime - myintermediat[i]);
var toshow = ("-" + _local1.R_game_mc.timetostring(pasttime));
var ctarget = _local1.R_game_mc[("menu_inter" + i) + "_mc"];
var ctext = _local1.R_game_mc[("menu_inter" + i) + "_mc"].mytxt;
_local3.changeTextColor(ctarget, 16718362, toshow, ctext);
var ctext = _local1.R_game_mc[("menu_inter" + i) + "_mc"].mynumber;
_local3.changeTextColor(ctarget, 16718362, i + 1, ctext);
ctarget._visible = true;
i++;
}
_local3.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] = 1 + driverspast;
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 2;
if ((driverspast + 1) >= maxdrivers) {
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 3;
var killer = _local1.R_game_mc.createEmptyMovieClip("interkiller_mc", 16000);
killer.number = 0;
killer.ctime = 0;
killer.onEnterFrame = function () {
var _local1 = this;
if (_local1.ctime >= 160) {
_root.R_game_mc.menu_inter_mc._visible = false;
}
if (_local1.ctime >= 160) {
_root.R_game_mc[("menu_inter" + _local1.number) + "_mc"]._visible = false;
_local1.number = _local1.number + 1;
if (_local1.number > maxdrivers) {
_local1.onEnterFrame = undefined;
}
} else {
_local1.ctime = _local1.ctime + 1;
}
};
}
var ctarget = _local1.R_game_mc[("menu_inter" + driverspast) + "_mc"];
var ctext = _local1.R_game_mc[("menu_inter" + driverspast) + "_mc"].mytxt;
_local3.changeTextColor(ctarget, 16776960, intertimeShow, ctext);
var ctext = _local1.R_game_mc[("menu_inter" + driverspast) + "_mc"].mynumber;
_local3.changeTextColor(ctarget, 16776960, driverspast + 1, ctext);
ctarget._visible = true;
}
}
}
}
if (passedendcam) {
} else {
var goal = circuit[_local2.marker].goal;
var pit = circuit[_local2.marker].pit;
if (pit == undefined) {
_local1.R_game_mc.main_mc.white_mc._visible = false;
} else {
_local1.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 (_local2.xperc > 105) {
if (!_local2.atpitstreet) {
if (!(_local2.lastpitstop === _local2.laps)) {
_local2.atpitstreet = true;
_local2.lastpitstop = _local2.laps;
_local2.speedPerc = 0;
trace("##############PITSTREET#################");
SoundControl.stopSound(_local2);
_local1.mainctime = 1;
_local1.mainpittimer = 0;
_local1.startmainpittimer = MainControl.getmytimer();
_local3.framedest = "pit";
_local1.black_mc.gotoAndPlay("fadein");
}
}
}
var pframe1 = circuit[_local2.marker].pframe;
var pframe2 = circuit[_local2.marker + 1].pframe;
} else {
if (cframe == goal) {
return;
}
var pframe1 = circuit[_local2.marker].pframe;
var pframe2 = circuit[_local2.marker + 1].pframe;
}
var dis1 = circuit[_local2.marker].dis;
var dis2 = circuit[_local2.marker + 1].dis;
var diffdis = (dis2 - dis1);
var diffpframe = (pframe2 - pframe1);
var elapsed = (_local2.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);
}
}
}
}
}
} else if (!develop) {
if (_local2.speed == 0) {
} else {
var dis2 = circuit[_local2.marker + 1].dis;
var mydist = _local2.distance;
if (_local2.laps == maxlaps) {
if (mydist > endcam) {
_local3.passedendcam = true;
if (_local1.R_game_mc.flag_mc == undefined) {
var myflag = _local1.R_game_mc.attachMovie("flag", "flag_mc", 999);
myflag._x = 520;
myflag._y = 400;
}
}
}
if ((mydist >= dis2) && (!(dis2 === undefined))) {
_local2.marker = _local2.marker + 1;
if (_local2.marker >= (circuit.length - 1)) {
if (!(_local2.laps === 0)) {
endLapTime = MainControl.getmytimer();
_local3.lastlaptime = (endLapTime / 1000) - (startLapTime / 1000);
_local3.endtime = _local3.endtime + _local3.lastlaptime;
_local1.showlastlaptime = _local1.R_game_mc.timetostring(lastlaptime);
if ((_local3.bestlaptime == undefined) || (lastlaptime < _local3.bestlaptime)) {
_local3.bestlaptime = lastlaptime;
_local1.showbestlaptime = _local1.R_game_mc.timetostring(lastlaptime);
}
}
circuitControl.reset(_local2);
_local2.laps = _local2.laps + 1;
if (_local2.laps == maxlaps) {
_local1.R_game_mc.finallap_mc.gotoAndPlay(2);
}
if (_local2.laps > maxlaps) {
_local2.finished = true;
var precircuittime2 = _local3.endtime;
_local2.circuittime = precircuittime2;
endlist.push(_local2.number);
var myposition = endlist.length;
_local1["endtime" + myposition] = _local1.R_game_mc.timetostring(precircuittime2);
_local1["endname" + myposition] = (myposition + ". ") + _local2.name;
_local1["besttime" + myposition] = _local1.showbestlaptime;
_local1.R_game_mc.endPosition_mc.sub.gotoAndStop(myposition);
_local1.R_game_mc.endPosition_mc.gotoAndPlay(2);
if (myposition < 4) {
var startbydiff = ((_local3.difflevel - 1) * 3);
_local1.wonprice = _local1.pricemoneyshow[startbydiff + myposition];
_local1.setmymoneyshow(_local1.pricemoney[startbydiff + myposition] * -1);
}
_local1.R_game_mc.laptime_mc._visible = false;
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 3;
var mymarker = _local2.marker;
var mylap = (_local2.laps - 1);
var killer = _local1.R_game_mc.createEmptyMovieClip("interkiller_mc", 16000);
killer.number = 0;
killer.ctime = 0;
killer.onEnterFrame = function () {
var _local1 = this;
if (_local1.ctime >= 5) {
_root.R_game_mc.menu_inter_mc._visible = false;
}
if (_local1.ctime >= 5) {
_root.R_game_mc[("menu_inter" + _local1.number) + "_mc"]._visible = false;
_local1.number = _local1.number + 1;
if (_local1.number > maxdrivers) {
_local1.onEnterFrame = undefined;
}
} else {
_local1.ctime = _local1.ctime + 1;
}
};
return;
}
_local1.showlap = (("Lap " + String(_local2.laps)) + " / ") + maxlaps;
return;
}
var mymarker = _local2.marker;
var mylap = _local2.laps;
if (((mymarker == _local3.maininter1) || (mymarker == _local3.maininter2)) || (mymarker == _local3.maininter3)) {
if (!(_local2.intermediat === mymarker)) {
if (mymarker == _local3.maininter1) {
_local1.cInter = 1;
} else if (mymarker == _local3.maininter2) {
_local1.cInter = 2;
} else if (mymarker == _local3.maininter3) {
_local1.cInter = 3;
}
_local3.Tinterobj[(("intermediatsStatusL" + _local2.intermediatlap) + "M") + _local2.intermediat] = 3;
_local2.intermediatlap = mylap;
_local2.intermediat = mymarker;
var myintermediat = _local3.Tinterobj[(("intermediatsL" + mylap) + "M") + mymarker];
var interstatus = _local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker];
var endLapTime = MainControl.getmytimer();
var preintertime = ((endLapTime / 1000) - (startLapTime / 1000));
var myintertime = (_local3.endtime + preintertime);
maindriver.intertime = myintertime;
var intertimeShow = _local1.R_game_mc.timetostring(myintertime);
_local1.R_game_mc.interkiller_mc.onEnterFrame = undefined;
_local1.R_game_mc.interkiller_mc.removeMovieClip();
i = 0;
while (i <= maxdrivers) {
_local1.R_game_mc[("menu_inter" + i) + "_mc"]._visible = false;
i++;
}
_local1.R_game_mc.menu_inter_mc._visible = true;
if (interstatus == undefined) {
var ctarget = _local1.R_game_mc.menu_inter0_mc;
var ctext = _local1.R_game_mc.menu_inter0_mc.mytxt;
_local3.changeTextColor(ctarget, 16776960, intertimeShow, ctext);
var ctext = _local1.R_game_mc.menu_inter0_mc.mynumber;
_local3.changeTextColor(ctarget, 16776960, "1", ctext);
ctarget._visible = true;
_local3.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] = 1;
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 2;
} else {
var driverspast = myintermediat.length;
i = 0;
while (i < driverspast) {
var pasttime = (myintertime - myintermediat[i]);
var toshow = ("-" + _local1.R_game_mc.timetostring(pasttime));
var ctarget = _local1.R_game_mc[("menu_inter" + i) + "_mc"];
var ctext = _local1.R_game_mc[("menu_inter" + i) + "_mc"].mytxt;
_local3.changeTextColor(ctarget, 16718362, toshow, ctext);
var ctext = _local1.R_game_mc[("menu_inter" + i) + "_mc"].mynumber;
_local3.changeTextColor(ctarget, 16718362, i + 1, ctext);
ctarget._visible = true;
i++;
}
_local3.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + mymarker] = 1 + driverspast;
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 2;
if ((driverspast + 1) >= maxdrivers) {
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + mymarker] = 3;
var killer = _local1.R_game_mc.createEmptyMovieClip("interkiller_mc", 16000);
killer.number = 0;
killer.ctime = 0;
killer.onEnterFrame = function () {
var _local1 = this;
if (_local1.ctime >= 160) {
_root.R_game_mc.menu_inter_mc._visible = false;
}
if (_local1.ctime >= 160) {
_root.R_game_mc[("menu_inter" + _local1.number) + "_mc"]._visible = false;
_local1.number = _local1.number + 1;
if (_local1.number > maxdrivers) {
_local1.onEnterFrame = undefined;
}
} else {
_local1.ctime = _local1.ctime + 1;
}
};
}
var ctarget = _local1.R_game_mc[("menu_inter" + driverspast) + "_mc"];
var ctext = _local1.R_game_mc[("menu_inter" + driverspast) + "_mc"].mytxt;
_local3.changeTextColor(ctarget, 16776960, intertimeShow, ctext);
var ctext = _local1.R_game_mc[("menu_inter" + driverspast) + "_mc"].mynumber;
_local3.changeTextColor(ctarget, 16776960, driverspast + 1, ctext);
ctarget._visible = true;
}
}
}
}
if (passedendcam) {
} else {
var goal = circuit[_local2.marker].goal;
var pit = circuit[_local2.marker].pit;
if (pit == undefined) {
_local1.R_game_mc.main_mc.white_mc._visible = false;
} else {
_local1.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 (_local2.xperc > 105) {
if (!_local2.atpitstreet) {
if (!(_local2.lastpitstop === _local2.laps)) {
_local2.atpitstreet = true;
_local2.lastpitstop = _local2.laps;
_local2.speedPerc = 0;
trace("##############PITSTREET#################");
SoundControl.stopSound(_local2);
_local1.mainctime = 1;
_local1.mainpittimer = 0;
_local1.startmainpittimer = MainControl.getmytimer();
_local3.framedest = "pit";
_local1.black_mc.gotoAndPlay("fadein");
}
}
}
var pframe1 = circuit[_local2.marker].pframe;
var pframe2 = circuit[_local2.marker + 1].pframe;
} else {
if (cframe == goal) {
return;
}
var pframe1 = circuit[_local2.marker].pframe;
var pframe2 = circuit[_local2.marker + 1].pframe;
}
var dis1 = circuit[_local2.marker].dis;
var dis2 = circuit[_local2.marker + 1].dis;
var diffdis = (dis2 - dis1);
var diffpframe = (pframe2 - pframe1);
var elapsed = (_local2.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);
}
}
}
}
};
circuitObject.prototype.reset = function (mydriver) {
var _local1 = mydriver;
_local1.marker = 0;
_local1.distance = 0;
distanceshow = 0;
if (!(_local1.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 () {
var _local1 = this;
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;
_local1.addListener(ctarget);
ctarget.move = function (step) {
var _local1 = this;
_local1._x = _local1._x + step;
if (_local1._x > 500) {
_local1._x = _local1._x - 1000;
} else if (_local1._x < -500) {
_local1._x = _local1._x + 1000;
}
};
i++;
}
i = 0;
while (i <= 2) {
var randomNumber = Math.ceil(Math.random() * 4);
var randomNumberX = Math.round(750 - (Math.random() * 1500));
var _local2 = 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 = _local2;
ctarget.randomNumber = Math.ceil(Math.random() * 8) / 10;
_local1.addListener(ctarget);
ctarget.move = function (step) {
var _local1 = this;
var _local2 = step * _local1.randomNumber;
_local1._x = _local1._x + _local2;
if (_local1._x > 750) {
_local1._x = _local1._x - 1500;
} else if (_local1._x < -750) {
_local1._x = _local1._x + 1500;
}
};
i++;
}
};
treeObject.prototype.moveTrees = function () {
var _local1 = driverObj.driver0;
if (_local1.speedperc <= 0) {
} else {
step = (_local1.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 _local1 = driverObj.driver0;
_local1.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 _local1 = 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 * _local1) + driver.distance);
var driverdistance = ((lookdriver.laps * _local1) + (lookdriver.distance - 0.005));
var _local3 = enemiedistance - driverdistance;
if (_local3 >= _local1) {
while (_local3 >= _local1) {
_local3 = _local3 - _local1;
}
} else if (_local3 < (-_local1)) {
while (_local3 < (-_local1)) {
_local3 = _local3 + _local1;
}
}
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 _local2 = Math.round((mycframe * 100) / 50);
if (_local2 < _global.myleftside) {
_local2 = _global.myleftside;
} else if (_local2 > _global.myrightside) {
_local2 = _global.myrightside;
}
driver.ideal = _local2;
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)) || ((_local3 > 0) && (_local3 < horizone))) {
if (driver.mc == undefined) {
driver.mc = _root.R_game_mc.car_holder_mc.attachMovie("car2", "car_mc" + i, 300 + i);
changecolorCPU(i);
}
if ((_local3 > 0) && (_local3 < horizone)) {
driverControl.calPos(driver, _local3);
} else {
driverControl.calPos(driver, objDistance);
}
inscreen.push(driver);
} else if (!(driver.mc === undefined)) {
driver.mc.removeMovieClip();
driver.mc = undefined;
}
}
}
if (maindriverinpit) {
driverControl.crashsorter();
} else {
_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 * _local1) + mydriver.distance);
var driverdistance = ((lookdriver.laps * _local1) + (lookdriver.distance - 0.005));
var _local3 = enemiedistance - driverdistance;
if (_local3 >= _local1) {
while (_local3 >= _local1) {
_local3 = _local3 - _local1;
}
} else if (_local3 < (-_local1)) {
while (_local3 < (-_local1)) {
_local3 = _local3 + _local1;
}
}
if (((objDistance > 0) && (objDistance < horizone)) || ((_local3 > 0) && (_local3 < horizone))) {
} else if (!(mydriver.mc === undefined)) {
mydriver.mc.removeMovieClip();
mydriver.mc = undefined;
}
if ((_local3 > 0) && (_local3 < horizone)) {
driverControl.calPos(mydriver, _local3);
} 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 _local1 = givendriver;
var origSpeed = _local1.orig_speedmax;
var _local3 = origSpeed * _root.tire_dsp1;
var origSpeed15perc = (origSpeed * _root.wing_dsp1);
var lossdueweight = ((_local1.fu * _local3) / 100);
var newspeedmax = (origSpeed - lossdueweight);
var origStear = _local1.orig_maxstearforce;
var origStear35perc = (origStear * _root.tire_dst1);
var origStear45perc = (origStear * _root.wing_dst1);
var _local2 = origStear;
var fl = _local1.fl;
var fr = _local1.fr;
var bl = _local1.bl;
var br = _local1.br;
var bw = _local1.bw;
var fw = _local1.fw;
var loscount = 0;
if (fl <= 0) {
_local1.fl = 0;
fl = 0;
loscount = loscount + 1;
}
if (fr <= 0) {
_local1.fr = 0;
fr = 0;
loscount = loscount + 1;
}
if (bl <= 0) {
_local1.bl = 0;
bl = 0;
loscount = loscount + 1;
}
if (br <= 0) {
_local1.br = 0;
br = 0;
loscount = loscount + 1;
}
if (bw <= 0) {
_local1.bw = 0;
bw = 0;
loscount = loscount + 1;
}
if (fw <= 0) {
_local1.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 - (_local3 - ((fl * _local3) / 100));
newspeedmax = newspeedmax - (_local3 - ((fr * _local3) / 100));
newspeedmax = newspeedmax - (_local3 - ((bl * _local3) / 100));
newspeedmax = newspeedmax - (_local3 - ((br * _local3) / 100));
newspeedmax = newspeedmax - (origSpeed15perc - ((fw * origSpeed15perc) / 100));
newspeedmax = newspeedmax - (origSpeed15perc - ((bw * origSpeed15perc) / 100));
_local2 = _local2 - (origStear35perc - ((fl * origStear35perc) / 100));
_local2 = _local2 - (origStear35perc - ((fr * origStear35perc) / 100));
_local2 = _local2 - (origStear35perc - ((bl * origStear35perc) / 100));
_local2 = _local2 - (origStear35perc - ((br * origStear35perc) / 100));
_local2 = _local2 - (origStear45perc - ((fw * origStear45perc) / 100));
_local2 = _local2 - (origStear45perc - ((bw * origStear45perc) / 100));
if (_local2 < 0.3) {
_local2 = 0.3;
}
_local1.speedmax = newspeedmax;
_local1.maxstearforce = _local2;
};
driverObject.prototype.chckInflDamageCpu = function (givendriver) {
var _local1 = givendriver;
var origSpeed = _local1.orig_speedmax;
var origSpeed5perc = (origSpeed * _root.tire_cpu_dsp1);
var origSpeed15perc = (origSpeed * _root.wing_cpu_dsp1);
var origSpeed10perc = (origSpeed * 0.1);
var lossdueweight = ((_local1.fu * origSpeed10perc) / 100);
var newspeedmax = (origSpeed - lossdueweight);
var origStear = _local1.orig_maxstearforce;
var _local3 = origStear * _root.tire_cpu_dst1;
var origStear25perc = (origStear * _root.wing_cpu_dst1);
var _local2 = origStear;
var fl = _local1.fl;
var fr = _local1.fr;
var bl = _local1.bl;
var br = _local1.br;
var bw = _local1.bw;
var fw = _local1.fw;
if (fl < 0) {
_local1.fl = 0;
fl = 0;
}
if (fr < 0) {
_local1.fr = 0;
fr = 0;
}
if (bl < 0) {
_local1.bl = 0;
bl = 0;
}
if (br < 0) {
_local1.br = 0;
br = 0;
}
if (bw < 0) {
_local1.bw = 0;
bw = 0;
}
if (fw < 0) {
_local1.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));
_local2 = _local2 - (_local3 - ((fl * _local3) / 100));
_local2 = _local2 - (_local3 - ((fr * _local3) / 100));
_local2 = _local2 - (_local3 - ((bl * _local3) / 100));
_local2 = _local2 - (_local3 - ((br * _local3) / 100));
_local2 = _local2 - (origStear25perc - ((fw * origStear25perc) / 100));
_local2 = _local2 - (origStear25perc - ((bw * origStear25perc) / 100));
if (_local2 < 0.3) {
_local2 = 0.3;
}
_local1.speedmax = newspeedmax;
_local1.maxstearforce = _local2;
};
driverObject.prototype.chckspeed = function (givendriver, mycframe) {
var _local1 = givendriver;
if (_local1.speedperc < 0) {
_local1.speedperc = 0;
} else if (_local1.speedperc > 100) {
_local1.speedperc = 100;
}
_local1.speed = Math.round((_local1.speedperc * _local1.speedmax) / 100);
var _local2 = (_local1.speed / 3600000) * 30;
_local1.fu = _local1.fu - (_local2 * _local1.fu_use);
var tirelose = (_local2 * _local1.tire_use);
_local1.fl = _local1.fl - tirelose;
_local1.fr = _local1.fr - tirelose;
_local1.bl = _local1.bl - tirelose;
_local1.br = _local1.br - tirelose;
if (mycframe == undefined) {
_local1.distance = _local1.distance + _local2;
} else if ((mycframe > 20) && (mycframe < 30)) {
_local1.distance = _local1.distance + _local2;
} else {
var _local3 = (mycframe * 2) - _local1.xPerc;
if (_local3 < 0) {
_local3 = _local3 * -1;
}
var maxminwaarde = (_local2 * 0.4);
var minwaarde = ((_local3 * maxminwaarde) / 100);
_local2 = _local2 - minwaarde;
_local1.distance = _local1.distance + _local2;
}
};
driverObject.prototype.chckGras = function (mydriver, mypresentxPerc) {
var _local1 = mydriver;
if (mypresentxPerc >= 92) {
if (!(_local1.marker === pitmarker)) {
var myspeedP = _local1.speedPerc;
var _local2 = (myspeedP * maxgrasdamage) / 100;
if (myspeedP > 10) {
var _local3 = myspeedP / 10;
if (_local3 > 1.5) {
_local3 = 1.5;
}
_local1.speedPerc = _local1.speedPerc - _local3;
}
_local1.fr = _local1.fr - _local2;
_local1.br = _local1.br - _local2;
if (mypresentxPerc > 107) {
_local1.fl = _local1.fl - _local2;
_local1.bl = _local1.bl - _local2;
}
}
} else if (mypresentxPerc < 8) {
var myspeedP = _local1.speedPerc;
var _local2 = (myspeedP * maxgrasdamage) / 100;
if (myspeedP > 10) {
var _local3 = myspeedP / 10;
if (_local3 > 1.5) {
_local3 = 1.5;
}
_local1.speedPerc = _local1.speedPerc - _local3;
}
_local1.fl = _local1.fl - _local2;
_local1.bl = _local1.bl - _local2;
if (mypresentxPerc < -7) {
_local1.fr = _local1.fr - _local2;
_local1.br = _local1.br - _local2;
}
}
};
_global.ailengtharea = 0.021;
_global.aiwidtharea = 19;
driverObject.prototype.autopilot = function (gottendriver, gforce, gottencframe) {
if (!gamestart) {
} else {
var _local3 = gforce;
var _local1 = gottendriver;
if (_local1.finished) {
driverControl.addspeed(_local1, -1);
} else {
myideal = _local1.ideal;
var myspeedperc = _local1.speedperc;
var mymaxstearforce = _local1.maxstearforce;
var myspeed = myspeedperc;
if (myspeed < 50) {
var prestearforce = ((_local1.speedperc * _local1.maxstearforce) / 100);
var _local2 = prestearforce + 1.7;
} else {
var prestearforce = ((_local1.speedperc * _local1.maxstearforce) / 100);
var _local2 = (_local1.maxstearforce - prestearforce) + 1.7;
}
myxPerc = _local1.xPerc;
happyarea = _local1.hArea;
frblck = _local1.frontblock;
mycframe = gottencframe;
var mymarker = _local1.marker;
if ((mymarker == (pitmarker - 1)) || (mymarker == (pitmarker - 2))) {
if (!(_local1.lastpitstop === _local1.laps)) {
if (_local1.laps < maxlaps) {
if (driverControl.chckPitneed(_local1)) {
if (_local1.xperc < 100) {
_local1.xPerc = _local1.xPerc + _local2;
if (_local1.speedPerc > 20) {
driverControl.addspeed(_local1, -1);
} else {
driverControl.addspeed(_local1, 1);
}
return;
}
}
}
}
} else if (_local1.marker == pitmarker) {
if (!(_local1.lastpitstop === _local1.laps)) {
if (_local1.xperc > 105) {
if (!_local1.atpitstreet) {
_local1.atpitstreet = true;
_local1.speedPerc = 30;
_local1.startpenalty = MainControl.getmytimer();
_local1.lastpitstop = _local1.laps;
driverControl.calcPitPenalty(_local1);
return;
}
}
if (_local1.laps < maxlaps) {
if (driverControl.chckPitneed(_local1)) {
_local1.xPerc = _local1.xPerc + _local2;
if (_local1.speedPerc > 20) {
driverControl.addspeed(_local1, -1);
} else {
driverControl.addspeed(_local1, 1);
}
return;
}
} else {
driverControl.chckGras(_local1, myxPerc);
if ((_local1.marker == _root.startmarker) && (_local1.laps < 1)) {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
} else if (myxPerc < (_global.myleftside + 5)) {
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (myxPerc > (_global.myrightside - 5)) {
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else {
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 = _local1.backblock;
if (!(bkblck === undefined)) {
if ((myxPerc - toll1) > bkblck) {
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if ((myxPerc + toll1) < bkblck) {
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if ((!(_local1.marker === _root.startmarker)) || (_local1.laps > 1)) {
if ((myxPerc - happyarea) > myideal) {
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if ((myxPerc + happyarea) < myideal) {
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
var myLastAction = _local1.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if (myLastAction == 1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (yxPerc > myideal) {
_local1.lastAction = -1;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else if (myxPerc < myideal) {
_local1.lastAction = 1;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
}
} else {
var myLastAction = _local1.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if (myLastAction == 1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (yxPerc > myideal) {
_local1.lastAction = -1;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else if (myxPerc < myideal) {
_local1.lastAction = 1;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
}
}
} else if ((!(_local1.marker === _root.startmarker)) || (_local1.laps > 1)) {
if ((myxPerc - happyarea) > myideal) {
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if ((myxPerc + happyarea) < myideal) {
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
var myLastAction = _local1.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if (myLastAction == 1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (yxPerc > myideal) {
_local1.lastAction = -1;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else if (myxPerc < myideal) {
_local1.lastAction = 1;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
}
} else {
var myLastAction = _local1.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if (myLastAction == 1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (yxPerc > myideal) {
_local1.lastAction = -1;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else if (myxPerc < myideal) {
_local1.lastAction = 1;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
}
}
}
}
} else {
driverControl.chckGras(_local1, myxPerc);
if ((_local1.marker == _root.startmarker) && (_local1.laps < 1)) {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
} else if (myxPerc < (_global.myleftside + 5)) {
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (myxPerc > (_global.myrightside - 5)) {
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else {
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 = _local1.backblock;
if (!(bkblck === undefined)) {
if ((myxPerc - toll1) > bkblck) {
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if ((myxPerc + toll1) < bkblck) {
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if ((!(_local1.marker === _root.startmarker)) || (_local1.laps > 1)) {
if ((myxPerc - happyarea) > myideal) {
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if ((myxPerc + happyarea) < myideal) {
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
var myLastAction = _local1.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if (myLastAction == 1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (yxPerc > myideal) {
_local1.lastAction = -1;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else if (myxPerc < myideal) {
_local1.lastAction = 1;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
}
} else {
var myLastAction = _local1.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if (myLastAction == 1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (yxPerc > myideal) {
_local1.lastAction = -1;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else if (myxPerc < myideal) {
_local1.lastAction = 1;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
}
}
} else if ((!(_local1.marker === _root.startmarker)) || (_local1.laps > 1)) {
if ((myxPerc - happyarea) > myideal) {
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if ((myxPerc + happyarea) < myideal) {
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
var myLastAction = _local1.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if (myLastAction == 1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (yxPerc > myideal) {
_local1.lastAction = -1;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else if (myxPerc < myideal) {
_local1.lastAction = 1;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
}
} else {
var myLastAction = _local1.lastAction;
if (!(frblck === undefined)) {
if (myLastAction == -1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
return;
}
if (myLastAction == 1) {
_local1.lastAction = 0;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else if (yxPerc > myideal) {
_local1.lastAction = -1;
driverControl.$autopilothelper(_local1, -1, _local2, _local3);
} else if (myxPerc < myideal) {
_local1.lastAction = 1;
driverControl.$autopilothelper(_local1, 1, _local2, _local3);
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
} else {
_local1.xPerc = _local1.xPerc + gforce;
driverControl.addspeed(_local1, 1);
}
}
}
}
}
}
};
driverObject.prototype.chckPitneed = function (mydriver) {
var _local1 = mydriver;
if (_global.difflevel == 3) {
var _local2 = 15;
var _local3 = 20;
} else if (_global.difflevel == 1) {
var _local2 = 50;
var _local3 = 55;
} else {
var _local2 = 25;
var _local3 = 35;
}
if (_local1.fl < _local2) {
return(true);
}
if (_local1.fr < _local2) {
return(true);
}
if (_local1.bl < _local2) {
return(true);
}
if (_local1.br < _local2) {
return(true);
}
if (_local1.fw < _local3) {
return(true);
}
if (_local1.bw < _local3) {
return(true);
}
if (_local1.fu < ((circuitdis * 4) + 2)) {
return(true);
}
if (_local1.fu < 30) {
return(true);
}
return(undefined);
};
driverObject.prototype.calcPitPenalty = function (mydriver) {
var _local1 = mydriver;
if (_global.difflevel == 3) {
var _local2 = 2000;
var _local3 = 20;
var toll2 = 25;
var pen1 = 500;
var pen2 = 1500;
} else if (_global.difflevel == 1) {
var _local3 = 55;
var toll2 = 60;
var _local2 = 7000;
var pen1 = 2000;
var pen2 = 3000;
} else {
var _local3 = 30;
var toll2 = 40;
var _local2 = 5000;
var pen1 = 1000;
var pen2 = 2000;
}
if (_local1.fu < 100) {
var procent = (100 - _local1.fu);
var standardpenalty = ((procent * 2000) / 100);
var _local2 = _local2 + (Math.round(Math.random() * pen2) + standardpenalty);
_local1.fu = 100;
}
if (_local1.fl < _local3) {
var _local2 = _local2 + (Math.round(Math.random() * 500) + pen1);
_local1.fl = 100;
}
if (_local1.fr < _local3) {
var _local2 = _local2 + (Math.round(Math.random() * 500) + pen1);
_local1.fr = 100;
}
if (_local1.bl < _local3) {
var _local2 = _local2 + (Math.round(Math.random() * 500) + pen1);
_local1.bl = 100;
}
if (_local1.br < _local3) {
var _local2 = _local2 + (Math.round(Math.random() * 500) + pen1);
_local1.br = 100;
}
if (_local1.fw < toll2) {
var _local2 = _local2 + (Math.round(Math.random() * 500) + pen2);
_local1.fw = 100;
}
if (_local1.bw < toll2) {
var _local2 = _local2 + (Math.round(Math.random() * 500) + pen2);
_local1.bw = 100;
}
_local1.penaltyTime = _local2;
trace(("---------penaltytime=" + _local2) + "-----------");
};
driverObject.prototype.$autopilothelper = function (mydriver, myDir, stearforce, force) {
var _local1 = mydriver;
var _local3 = myDir;
var gottenforce = force;
toaddspeed = 0;
if (!(frblck === undefined)) {
if (frblck < 5) {
toaddspeed = 1;
} else if (_local1.speedPerc > frblck) {
toaddspeed = -1;
} else if (_local1.speedPerc < frblck) {
toaddspeed = 1;
}
_local1.frontblock = undefined;
}
if ((myxPerc < 5) || (myxPerc > 95)) {
} else if ((mycframe < 13) || (mycframe > 37)) {
} else if ((myxPerc > (myideal - happyarea)) && (myxPerc < (myideal + happyarea))) {
} else if (_local3 < 0) {
var lfblck = _local1.leftblock;
var rgblck = _local1.rightblock;
if ((lfblck == undefined) && (myxPerc > 25)) {
_local3 = -1;
} else if ((rgblck == undefined) && (myxPerc < 75)) {
_local3 = 1;
} else {
_local3 = 0;
var Random = Math.round(Math.random() * 100);
if (Random > 90) {
var Random2 = (-1 + Math.floor(Math.random() * 3));
_local3 = Random2;
}
}
} else if (_local3 > 0) {
var lfblck = _local1.leftblock;
var rgblck = _local1.rightblock;
if ((rgblck == undefined) && (myxPerc < 75)) {
_local3 = 1;
} else if ((lfblck == undefined) && (myxPerc > 25)) {
_local3 = -1;
} else {
_local3 = 0;
var Random = Math.round(Math.random * 100);
if (Random > 90) {
var Random2 = (-1 + Math.floor(Math.random * 3));
_local3 = Random2;
}
}
}
_local1.leftblock = undefined;
_local1.rightblock = undefined;
_local1.backblock = undefined;
if (_local3 == 0) {
var endstearforce = 0;
_local1.xPerc = _local1.xPerc + gforce;
} else {
var endstearforce = (_local3 * stearforce);
var forceout = driverControl.calcforceout(endstearforce, gottenforce);
if (forceout) {
toaddspeed = -1;
}
}
if (!(toaddspeed === 0)) {
driverControl.addspeed(_local1, toaddspeed);
}
var _local2 = _local1.xPerc + (endstearforce + gottenforce);
if (_local2 > 110) {
_local2 = 110;
} else if (_local2 < -10) {
_local2 = -10;
}
_local1.xPerc = _local2;
};
driverObject.prototype.calcforceout = function (myendstearforce, mygottenforce) {
var _local1 = mygottenforce;
var _local2 = myendstearforce;
if (_local2 < 0) {
if (_local1 <= 0) {
return(false);
}
if ((_local2 + _local1) < 0) {
return(false);
}
return(true);
}
if (_local1 >= 0) {
return(false);
}
if ((_local2 + _local1) > 0) {
return(false);
}
return(true);
};
driverObject.prototype.addspeed = function (mydriver, speedtoadd) {
var _local1 = mydriver;
var _local2 = speedtoadd;
if (_local1.finished) {
_local2 = -1;
}
if (_local1.fu <= 0) {
if (_local1.speedperc > 0) {
_local1.speedperc = _local1.speedperc - 0.2;
} else {
_local1.speedperc = 0;
}
} else if (_local2 > 0) {
if (_local1.speedperc < 100) {
_local1.speedperc = _local1.speedperc + _local2;
} else {
_local1.speedperc = 100;
}
} else if (_local1.speedperc > 0) {
_local1.speedperc = _local1.speedperc + _local2;
} else {
_local1.speedperc = 0;
}
};
driverObject.prototype.lap = function (givendriver) {
var _local3 = _global;
var _local1 = givendriver;
if (_local1.speed == 0) {
} else {
var dis2 = _local1.dis2;
if ((_local1.distance >= dis2) && (!(dis2 === undefined))) {
_local1.marker = _local1.marker + 1;
if (_local1.marker >= (circuit.length - 1)) {
if (!(_local1.laps === 0)) {
var myendLapTime = MainControl.getmytimer();
var mylastlaptime = ((myendLapTime / 1000) - (_local1.startLapTime / 1000));
_local1.endtime = _local1.endtime + mylastlaptime;
if (_local1.laps < maxlaps) {
if ((_local1.bestlaptime == undefined) || (mylastlaptime < _local1.bestlaptime)) {
_local1.bestlaptime = mylastlaptime;
}
}
}
driverControl.reset(_local1);
_local1.laps = _local1.laps + 1;
if (_local1.laps > maxlaps) {
trace("finished " + _local1.name);
var precircuittime2 = _local1.endtime;
_local1.circuittime = precircuittime2;
endlist.push(_local1.number);
var myposition = endlist.length;
_root["endtime" + myposition] = _root.R_game_mc.timetostring(precircuittime2);
_root["endname" + myposition] = (myposition + ". ") + _local1.name;
_root["besttime" + myposition] = _root.R_game_mc.timetostring(_local1.bestlaptime);
_local1.finished = true;
return;
}
}
var _local2 = _local1.marker;
_local1.dis1 = circuit[_local2].dis;
_local1.dis2 = circuit[_local2 + 1].dis;
_local1.diffdis = _local1.dis2 - _local1.dis1;
_local1.pframe1 = circuit[_local2].pframe;
_local1.pframe2 = circuit[_local2 + 1].pframe;
_local1.diffpframe = _local1.pframe2 - _local1.pframe1;
}
var _local2 = _local1.marker;
if (((_local2 == _local3.maininter1) || (_local2 == _local3.maininter2)) || (_local2 == _local3.maininter3)) {
var mylap = _local1.laps;
if (_local1.intermediat == _local2) {
} else if (maindriver.finished) {
} else {
_local1.intermediat = _local2;
var interstatus = _local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + _local2];
if (interstatus == 3) {
trace("maindriver is driving to far so i won't record my intermediat");
} else {
var myendLapTime = MainControl.getmytimer();
var mylastlaptime = ((_local1.endtime + (myendLapTime / 1000)) - (_local1.startLapTime / 1000));
if (interstatus == undefined) {
trace("FIRST ONE SO CREATING THE INTERMEDIATARRAY");
_local3.Tinterobj[(("intermediatsL" + mylap) + "M") + _local2] = [];
var myarray = _local3.Tinterobj[(("intermediatsL" + mylap) + "M") + _local2];
myarray.push(mylastlaptime);
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + _local2] = 1;
} else if (interstatus == 1) {
_local3.Tinterobj[(("intermediatsL" + mylap) + "M") + _local2].push(mylastlaptime);
} else {
var driverspast = _local3.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + _local2];
_local3.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + _local2] = _local3.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + _local2] + 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;
_local3.changeTextColor(ctarget, 15000804, toshow, ctext);
var ctext = _root.R_game_mc[("menu_inter" + driverspast) + "_mc"].mynumber;
_local3.changeTextColor(ctarget, 15000804, driverspast + 1, ctext);
ctarget._visible = true;
if (_local3.Tinterobj[(("intermediatsNumberL" + mylap) + "M") + _local2] > maxdrivers) {
_local3.Tinterobj[(("intermediatsStatusL" + mylap) + "M") + _local2] = 3;
trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
var killer = _root.R_game_mc.createEmptyMovieClip("interkiller_mc", 16000);
killer.number = 0;
killer.ctime = 0;
killer.onEnterFrame = function () {
var _local1 = this;
if (_local1.ctime >= 160) {
_root.R_game_mc.menu_inter_mc._visible = false;
}
if (_local1.ctime >= 160) {
_root.R_game_mc[("menu_inter" + _local1.number) + "_mc"]._visible = false;
_local1.number = _local1.number + 1;
if (_local1.number > maxdrivers) {
_local1.onEnterFrame = undefined;
}
} else {
_local1.ctime = _local1.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 _local1 = driverObj["driver" + i];
mymarker = _local1.marker;
_local1.dis1 = circuit[mymarker].dis;
_local1.dis2 = circuit[mymarker + 1].dis;
_local1.diffdis = _local1.dis2 - _local1.dis1;
_local1.pframe1 = circuit[mymarker].pframe;
_local1.pframe2 = circuit[mymarker + 1].pframe;
_local1.diffpframe = _local1.pframe2 - _local1.pframe1;
i++;
}
};
driverObject.prototype.reset = function (givendriver) {
var _local1 = givendriver;
_local1.marker = 0;
_local1.distance = 0;
if (!(_local1.laps === 0)) {
_local1.startLapTime = MainControl.getmytimer();
}
};
driverObject.prototype.setshow = function (givendriver) {
var _local2 = _root;
var _local3 = givendriver;
var randomNumber = (-1 + Math.round(Math.random() * 2));
var percspeed = ((_local3.speed * 100) / 400);
_local2.R_game_mc.meter_mc._rotation = (((percspeed * 160) / 100) + 10) + randomNumber;
if (givendriver.finished) {
trace("finished");
} else {
if (!(startLapTime === undefined)) {
endLapTime = MainControl.getmytimer();
_global.laptime = (endLapTime / 1000) - (startLapTime / 1000);
_local2.showlaptime = _local2.R_game_mc.timetostring(laptime);
}
var preshow = String((("position : " + _local2.position) + " / ") + (maxdrivers + 1));
_local2.showposition = String(preshow);
var fl = _local3.fl;
var fr = _local3.fr;
var bl = _local3.bl;
var br = _local3.br;
var bw = _local3.bw;
var fw = _local3.fw;
_local2.R_game_mc.fl_mc.pointer_mc._x = (fl * 119) / 100;
_local2.R_game_mc.fr_mc.pointer_mc._x = (fr * 119) / 100;
_local2.R_game_mc.bl_mc.pointer_mc._x = (bl * 119) / 100;
_local2.R_game_mc.br_mc.pointer_mc._x = (br * 119) / 100;
var fu = _local3.fu;
var fuelmc = _local2.R_game_mc.menu_fuel_mc;
fuelmc.pointer_mc._x = (fu * 132) / 100;
fuelmc.fuel_mc.submask_mc._x = -130 + ((fu * 130) / 100);
var _local1 = _local2.R_game_mc.menu_overall_mc;
_local1.fl_mc._alpha = 100 - fl;
_local1.fr_mc._alpha = 100 - fr;
_local1.bl_mc._alpha = 100 - bl;
_local1.br_mc._alpha = 100 - br;
_local1.fw_mc._alpha = 100 - fw;
_local1.bw_mc._alpha = 100 - bw;
if (fl < 20) {
if (fl <= 0) {
_local1.fl_mc.gotoAndStop(2);
} else {
_local1.fl_mc.sub_mc.play();
}
}
if (fr < 20) {
if (fr <= 0) {
_local1.fr_mc.gotoAndStop(2);
} else {
_local1.fr_mc.sub_mc.play();
}
}
if (bl < 20) {
if (bl <= 0) {
_local1.bl_mc.gotoAndStop(2);
} else {
_local1.bl_mc.sub_mc.play();
}
}
if (br < 20) {
if (br <= 0) {
_local1.br_mc.gotoAndStop(2);
} else {
_local1.br_mc.sub_mc.play();
}
}
if (fw < 20) {
if (fw <= 0) {
_local1.fw_mc.gotoAndStop(2);
} else {
_local1.fw_mc.sub_mc.play();
}
}
if (bw < 20) {
if (bw <= 0) {
_local1.bw_mc.gotoAndStop(2);
} else {
_local1.bw_mc.sub_mc.play();
}
}
}
};
driverObject.prototype.chckCorner = function (givendriver, extradis) {
var _local1 = givendriver;
var dis1 = _local1.dis1;
var diffdis = _local1.diffdis;
var pframe1 = _local1.pframe1;
var diffpframe = _local1.diffpframe;
var elapsed = ((_local1.distance + extradis) - dis1);
var diffdisperc = ((elapsed * 100) / diffdis);
var _local3 = (diffdisperc * diffpframe) / 100;
var _local2 = Math.round(pframe1 + _local3);
if (_local2 > 50) {
_local2 = 50;
} else if (_local2 < 1) {
_local2 = 1;
}
return(_local2);
};
driverObject.prototype.calPos = function (gottenDriver, gottenDis) {
var _local1 = gottenDriver;
var _local2 = _root;
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 = _local2.R_game_mc.hectaTotal_mc["hectaL" + myHecta]._x;
var hectaRx = _local2.R_game_mc.hectaTotal_mc["hectaR" + myHecta]._x;
var hectaLy = _local2.R_game_mc.hectaTotal_mc["hectaL" + myHecta]._y;
var hectaLx2 = _local2.R_game_mc.hectaTotal_mc["hectaL" + nextmyHecta]._x;
var hectaRx2 = _local2.R_game_mc.hectaTotal_mc["hectaR" + nextmyHecta]._x;
var hectaLy2 = _local2.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 = _local1.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 _local3 = 100 - hectaPerc;
if (_local3 < 0) {
_local3 = 0;
}
if (_local1.mc == driverObj.finish.mc) {
_local1.mc._width = maxperc;
_local1.mc._yscale = _local3;
_local1.mc._x = hectaLx;
_local1.mc._y = yPos + (extraY * positive);
} else {
_local1.mc._x = xPos + extraX;
_local1.mc._y = yPos + (extraY * positive);
_local1.mc._xscale = _local3;
_local1.mc._yscale = _local3;
if (!(_local1.linkname === undefined)) {
} else {
var degreeHecta = (myHecta + 5);
if (hectamax > 45) {
var degreeX = _local2.R_game_mc.hectaTotal_mc.hectaM._x;
var degreeY = _local2.R_game_mc.hectaTotal_mc.hectaM._y;
var mydegree = driverControl.calcAngle(_local1.mc, degreeX, degreeY);
} else {
var hectaLx = _local2.R_game_mc.hectaTotal_mc["hectaL" + degreeHecta]._x;
var hectaRx = _local2.R_game_mc.hectaTotal_mc["hectaR" + degreeHecta]._x;
var xPerc = _local1.xPerc;
var maxperc = (hectaRx - hectaLx);
var xNum = ((xPerc * maxperc) / 100);
var degreeX = (hectaLx + xNum);
var degreeY = _local2.R_game_mc.hectaTotal_mc["hectaL" + degreeHecta]._y;
var mydegree = driverControl.calcAngle(_local1.mc, degreeX, degreeY);
}
_local1.angle = mydegree;
_local1.mytargetframe = driverControl.calcAngleFrame(mydegree);
_local1.mc.car_main_mc.gotoAndStop(_local1.mytargetframe);
_local1.mc.car_main_mc.body_mc.gotoAndStop(_local1.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) {
var _local2 = angle;
if (_local2 >= 0) {
angleperc = (_local2 * 100) / 80;
var _local1 = 8 + Math.round((angleperc * 8) / 100);
} else if (_local2 < 0) {
angleperc = (_local2 * 100) / -80;
var _local1 = 8 - Math.round((angleperc * 8) / 100);
if (_local1 < 1) {
_local1 = 1;
}
}
return(_local1);
};
_global.maxmaxforce = 2.8;
driverObject.prototype.calcForce = function (gottendriver, gottencturn) {
var _local1 = gottencturn - 25;
if (_local1 < 0) {
var turnperc = ((_local1 * 100) / -25);
var balance = 1;
} else {
var turnperc = ((_local1 * 100) / 25);
var balance = -1;
}
var maxforce = ((gottendriver.speedperc * maxmaxforce) / 100);
var preforce = ((turnperc * maxforce) / 100);
var _local2 = balance * preforce;
var _local3 = driverControl.crashforce(gottendriver);
_local2 = _local2 + _local3;
return(_local2);
};
_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 _local3 = a.distance;
var bdistance = b.distance;
var diff = (_local3 - bdistance);
if ((diff > negcarlength2) && (diff < carlength2)) {
var _local1 = a.angle;
var _local2 = b.angle;
if (_local1 < 0) {
_local1 = _local1 * -1;
}
if (_local2 < 0) {
_local2 = _local2 * -1;
}
if (_local1 > _local2) {
return(-1);
}
return(1);
}
if (_local3 < bdistance) {
return(1);
}
if (bdistance < _local3) {
return(-1);
}
return(0);
};
driverObject.prototype.crashsorter = function () {
totaldrivers.sort(driverControl.$helpercrashsorter);
};
driverObject.prototype.$helpercrashsorter = function (a, b) {
var _local1 = b;
var _local2 = a;
if (!(_local2.marker === _local1.marker)) {
return(0);
}
if (_local2.finished) {
return(0);
}
if (_local1.finished) {
return(0);
}
if (_local2.atpitstreet) {
return(0);
}
if (_local1.atpitstreet) {
return(0);
}
adistance = _local2.distance;
bdistance = _local1.distance;
if (adistance > bdistance) {
var c = _local2;
_local2 = _local1;
_local1 = c;
adistance = _local2.distance;
bdistance = _local1.distance;
}
diff = bdistance - adistance;
if (diff < ailengtharea) {
axPerc = _local2.xPerc;
bxPerc = _local1.xPerc;
diffx = axPerc - bxPerc;
if ((diffx > (-carwidth)) && (diffx < carwidth)) {
_local2.frontblock = _local1.speedPerc;
}
if ((diffx > (-aiwidtharea)) && (diffx < aiwidtharea)) {
_local1.backblock = axPerc;
}
}
if (diff < carlength) {
if ((diffx > (-aiwidtharea)) && (diffx < aiwidtharea)) {
if (axPerc < bxPerc) {
_local2.rightblock = bxPerc;
_local1.leftblock = axPerc;
} else {
_local2.leftblock = bxPerc;
_local1.rightblock = axPerc;
}
}
if ((diffx > (-carwidth)) && (diffx < carwidth)) {
var _local3 = _local2.speedPerc;
if (_local3 <= 0) {
_local3 = _local1.speedPerc;
if (_local3 <= 0) {
_local3 = 10;
}
}
var cspeed2 = (_local3 * 0.5);
aoldxPerc = _local2.oldxPerc;
boldxPerc = _local1.oldxPerc;
olddiffx = aoldxPerc - boldxPerc;
if ((olddiffx > (-carwidth)) && (olddiffx < carwidth)) {
} else {
if (aoldxPerc < boldxPerc) {
_local2.crashperc = _local2.crashperc - _local3;
_local1.crashperc = _local1.crashperc + _local3;
} else {
_local2.crashperc = _local2.crashperc + _local3;
_local1.crashperc = _local1.crashperc - _local3;
}
driverControl.CrashCorrectorX(_local2, _local1);
return(0);
}
aolddistance = _local2.olddistance;
bolddistance = _local1.olddistance;
olddiff = aolddistance - bolddistance;
if ((olddiff > negcarlength) && (olddiff < carlength)) {
if (aoldxPerc < boldxPerc) {
_local2.crashperc = _local2.crashperc - _local3;
_local1.crashperc = _local1.crashperc + _local3;
} else {
_local2.crashperc = _local2.crashperc + _local3;
_local1.crashperc = _local1.crashperc - _local3;
}
driverControl.CrashCorrectorX(_local2, _local1);
return(0);
}
_local2.speedperc = _local2.speedperc - cspeed2;
_local1.speedperc = _local1.speedperc + cspeed2;
driverControl.CrashCorrectorY(_local2, _local1);
return(0);
}
}
return(0);
};
driverObject.prototype.CrashCorrectorX = function (a, b) {
var _local1 = b;
var _local2 = a;
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);
_local2.oldxPerc = _local2.oldxPerc - overlap;
_local1.oldxPerc = _local1.oldxPerc + overlap;
_local2.xPerc = _local2.xPerc - overlap;
_local1.xPerc = _local1.xPerc + overlap;
var _local3 = overlap * 10;
if (overlapY < 0.0005) {
_local2.fw = _local2.fw - _local3;
_local1.bw = _local1.bw - _local3;
return;
}
if (overlapY < 0.0035) {
_local2.fr = _local2.fr - _local3;
_local1.bl = _local1.bl - _local3;
} else if (overlapY > 0.0035) {
_local2.fr = _local2.fr - _local3;
_local2.br = _local2.br - _local3;
_local1.fl = _local1.fl - _local3;
_local1.bl = _local1.bl - _local3;
} else {
return;
var posdiff = (axPerc - bxPerc);
var overlap = (carwidth - posdiff);
_local2.xPerc = _local2.xPerc + overlap;
_local1.xPerc = _local1.xPerc - overlap;
_local3 = overlap * 10;
if (overlapY < 5E-5) {
_local2.fw = _local2.fw - _local3;
_local1.bw = _local1.bw - _local3;
} else if (overlapY < 0.0035) {
_local2.fl = _local2.fl - _local3;
_local1.br = _local1.br - _local3;
} else if (overlapY > 0.0035) {
_local2.fl = _local2.fl - _local3;
_local2.bl = _local2.bl - _local3;
_local1.fr = _local1.fr - _local3;
_local1.br = _local1.br - _local3;
}
}
} else {
var posdiff = (axPerc - bxPerc);
var overlap = (carwidth - posdiff);
_local2.xPerc = _local2.xPerc + overlap;
_local1.xPerc = _local1.xPerc - overlap;
var _local3 = overlap * 10;
if (overlapY < 5E-5) {
_local2.fw = _local2.fw - _local3;
_local1.bw = _local1.bw - _local3;
} else if (overlapY < 0.0035) {
_local2.fl = _local2.fl - _local3;
_local1.br = _local1.br - _local3;
} else if (overlapY > 0.0035) {
_local2.fl = _local2.fl - _local3;
_local2.bl = _local2.bl - _local3;
_local1.fr = _local1.fr - _local3;
_local1.br = _local1.br - _local3;
}
}
};
driverObject.prototype.CrashCorrectorY = function (a, b) {
var _local2 = adistance - (maindriver.distance - 0.005);
if ((_local2 > -0.01) && (_local2 < horizone)) {
soundvolume = Math.round((_local2 * 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 _local1 = carlength - posdiffY;
a.distance = a.distance - _local1;
b.distance = b.distance + _local1;
var _local3 = _local1 * 100000;
a.fw = a.fw - _local3;
b.bw = b.bw - _local3;
};
_global.maxcrashforce = 2;
driverObject.prototype.crashforce = function (driver) {
var _local1 = driver.crashperc;
if ((_local1 == 0) || (_local1 == undefined)) {
return(0);
}
if (_local1 > 100) {
_local1 = 100;
}
if (_local1 < -100) {
_local1 = -100;
}
if (_local1 < 0) {
_local1 = _local1 + 1;
var _local2 = -1;
} else {
_local1 = _local1 - 1;
var _local2 = 1;
}
var _local3 = _local1 * _local2;
var preforce = ((_local3 * maxcrashforce) / 100);
var force = (preforce * _local2);
driver.crashperc = _local1;
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 _local1 = String(laptime3);
spotdot = _local1.lastIndexOf(".");
stringlength = _local1.length;
if (spotdot == -1) {
_local1 = _local1 + ".000";
} else if ((stringlength - spotdot) == 2) {
_local1 = _local1 + "00";
} else if ((stringlength - spotdot) == 3) {
_local1 = _local1 + "0";
}
if (spotdot == 1) {
_local1 = "0" + _local1;
}
var _local2 = (String(m) + ":") + String(_local1);
return(_local2);
};
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");
} else {
i = 0;
while (i < circuitlength) {
var _local2 = circuit[i].dir;
if (_local2 == 0) {
} else {
pframe1 = circuit[i].pframe;
pframe2 = circuit[i + 1].pframe;
diffpframe = pframe2 - pframe1;
diffpframe = diffpframe * _local2;
if (pframe2 == 0) {
} else {
var _local1 = 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) {
_local1 = 3;
} else if (diffdis < 0.02) {
_local1 = 2;
} else {
_local1 = 1;
}
} else if ((diffpframe >= 20) && (diffpframe < 35)) {
if (diffdis < 0.02) {
_local1 = 3;
} else if (diffdis < 0.05) {
_local1 = 2;
} else {
_local1 = 1;
}
} else if (diffpframe >= 35) {
if (diffdis < 0.02) {
_local1 = 3;
} else if (diffdis < 0.05) {
_local1 = 2;
} else {
_local1 = 1;
}
}
var prerandomNumber = Math.round(Math.random() * 35);
var randomNumber = (prerandomNumber / 1000);
var _local3 = circuit[i].dis - randomNumber;
if (_local2 > 0) {
var xPerc = 130;
var dirname = "right";
} else {
var xPerc = -30;
var dirname = "left";
}
var signname = (("sign" + dirname) + String(_local1));
sign.push({distance:_local3, xPerc:xPerc, linkname:signname});
}
}
}
i++;
}
var signname = "signpit";
var _local3 = _root.pitdisstart - 0.04;
sign.push({distance:_local3, xPerc:130, linkname:signname});
i = 0;
while (i <= 2) {
_local3 = _local3 + 0.05;
if (_local3 >= (_root.pitdisstart - 0.03)) {
} else {
var xPerc = 130;
sign.push({distance:_local3, xPerc:130, linkname:signname});
}
i++;
}
_global.signlength = sign.length;
}
};
signObject.prototype.chckInscreen = function (lookdriver) {
var _local2 = this;
var _local3 = cSign;
var driver = sign[_local3];
var _local1 = driver.distance - lookdriver.distance;
if ((_local1 > 0) && (_local1 < horizone)) {
if (driver.mc == undefined) {
var targetlinkname = driver.linkname;
driver.mc = _root.R_game_mc.prop_holder_mc.attachMovie(targetlinkname, "sign_mc" + _local3, _global.getmydepth);
driver.mc._alpha = 80;
driver.mc.driver = driver;
driver.mc.myhandle = function () {
var _local1 = this.driver.distance - lookdriver.distance;
if ((_local1 > -0.0002) && (_local1 < horizone)) {
driverControl.calPos(driver, _local1);
} else {
driver.mc = undefined;
this.removeMovieClip();
}
};
_local2.addListener(driver.mc);
}
cSign = cSign + 1;
if (cSign >= signlength) {
cSign = 0;
}
}
_local2.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");
} else {
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 _local1 = Math.round(Math.random() * torandom);
var _local3 = lastdistance + (_local1 / 1000);
var _local2 = Math.round(Math.random() * 12);
if (dir > 0) {
var xPerc = (130 + _local2);
var dirname = "right";
} else {
var xPerc = (-30 - _local2);
var dirname = "left";
}
_local1 = Math.floor(Math.random() * Apropslength);
var propnumber = _global.availableprops[_local1];
var propname = ("prop" + _global.availableprops[_local1]);
if (xPerc > 100) {
if (propnumber == 12) {
propname = ("prop" + _global.availableprops[_local1]) + "b";
}
}
prop.push({distance:_local3, xPerc:xPerc, linkname:propname});
propcount = propcount + 1;
lastdistance = _local3;
i++;
}
_global.proplength = prop.length;
}
};
propObject.prototype.chckInscreen = function (lookdriver) {
var _local2 = this;
var _local3 = cprop;
var driver = prop[_local3];
var _local1 = driver.distance - lookdriver.distance;
if ((_local1 > 0) && (_local1 < horizone)) {
if (driver.mc == undefined) {
var targetlinkname = driver.linkname;
driver.mc = _root.R_game_mc.prop_holder_mc.attachMovie(targetlinkname, "prop_mc" + _local3, _global.getmydepth());
driver.mc._alpha = 70;
driver.mc.driver = driver;
driver.mc.myhandle = function () {
var _local1 = this.driver.distance - lookdriver.distance;
if ((_local1 > -0.0002) && (_local1 < horizone)) {
driverControl.calPos(driver, _local1);
} else {
driver.mc = undefined;
this.removeMovieClip();
}
};
_local2.addListener(driver.mc);
}
cprop = cprop + 1;
if (cprop >= proplength) {
cprop = 0;
}
}
_local2.broadcastMessage("myhandle");
};
_root.maindepth = 1500;
_global.getmydepth = function () {
var _local1 = _root;
_local1.maindepth = _local1.maindepth - 1;
if (_local1.maindepth < 1) {
_local1.maindepth = 1500;
}
return(_local1.maindepth);
};
startSpotObject = function () {
if (_global.develop) {
} else {
ASBroadcaster.initialize(this);
_global.startspot = [];
_global.cStartspot = 0;
if (maxdrivers <= 0) {
trace("maxdrivers is 0, so no startspots has been placed");
} else {
var _local1 = driverObj["driver" + maxdrivers];
var startposition = driverObj.finish.distance;
var xperc = 30;
var _local2 = startposition - 0.01;
_local1.distance = _local2 - 0.007;
_local1.marker = circuit.length - 2;
_local1.xPerc = xperc;
if (xperc == 30) {
var signname = "spotLeft";
} else {
var signname = "spotRight";
}
startspot.push({distance:_local2, xPerc:xPerc, linkname:signname});
startspot.push({distance:_local2 - 0.0045, xPerc:xPerc, linkname:signname});
i = 1;
while (i <= maxdrivers) {
var _local3 = (i * 2) - 1;
var startposition = startspot[_local3].distance;
var startxperc = startspot[_local3].xperc;
_local2 = startposition - 0.002;
_local1 = driverObj["driver" + (maxdrivers - i)];
_local1.marker = circuit.length - 2;
_root.startmarker = circuit.length - 2;
_local1.distance = _local2 - 0.007;
if (startxperc == 30) {
var xperc = 70;
var signname = "spotRight";
} else {
var xperc = 30;
var signname = "spotLeft";
}
_local1.xPerc = xperc;
startspot.push({distance:_local2, xPerc:xPerc, linkname:signname});
startspot.push({distance:_local2 - 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 _local3 = gottendis;
var _local2 = circuit.length - 1;
j = _local2;
while (j > 0) {
var _local1 = circuit[j].dis;
if (_local1 > _local3) {
} else {
return(k);
}
j--;
}
return(undefined);
};
startSpotObject.prototype.chckInscreen = function (lookdriver) {
var _local3 = this;
var _local1 = cStartspot;
var driver = startspot2[_local1];
var _local2 = driver.distance - lookdriver.distance;
if ((_local2 > -0.005) && (_local2 < horizone)) {
if (driver.mc == undefined) {
var targetlinkname = driver.linkname;
driver.mc = _root.R_game_mc.startspot_holder_mc.attachMovie(targetlinkname, "startspot_mc" + _local1, 1000 + _local1);
driver.mc.driver = driver;
driver.mc.myhandle = function () {
var _local1 = this.driver.distance - lookdriver.distance;
if ((_local1 > -0.003) && (_local1 < horizone)) {
driverControl.calPos(driver, _local1);
} else {
driver.mc = undefined;
this.removeMovieClip();
}
};
_local3.addListener(driver.mc);
}
cStartspot = cStartspot + 1;
if (cStartspot >= startSpotlength) {
cStartspot = 0;
}
}
_local3.broadcastMessage("myhandle");
};
SoundObject = function () {
var _local1 = _global;
_local1.cont6dur = 3000;
_local1.downdur = 5700;
_local1.updur = 5700;
_local1.cont1dur = 1900;
_local1.downstart = 0;
_local1.upstart = 0;
_local1.cont1start = 0;
_local1.cont2start = 0;
_local1.cont3start = 0;
_local1.cont4start = 0;
_local1.cont5start = 0;
_local1.cont6start = 0;
this.createSound(driverObj.driver0);
};
SoundObject.prototype.createSound = function (driver) {
var _local2 = _root;
var _local1 = driver.number;
target = _local2.Soundfx_holder_mc.createEmptyMovieClip("soundx" + _local1, _local1);
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");
_local2.crash = new Sound();
_local2.crash.attachSound("crash");
};
SoundObject.prototype.manageSound = function (driver, oldspeedperc, speedperc, objDistance, objDistancelap) {
var _local1 = objDistance;
var _local2 = driver;
if ((_local1 > -0.08) && (_local1 < 0.08)) {
soundvolume = Math.round((_local1 * 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(_local2, oldspeedperc, speedperc, soundvolume);
} else if ((objDistancelap > -0.08) && (objDistancelap < 0.08)) {
soundvolume = Math.round((_local1 * 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(_local2, oldspeedperc, speedperc, soundvolume);
} else {
SoundControl.stopSound(_local2);
}
};
SoundObject.prototype.chckSound = function (driver, oldspeedperc, speedperc, soundvolume) {
var _local1 = driver;
var _local3 = speedperc;
var _local2 = _local1.cSound;
soundvolume = _root.targetsound;
_local1.soundPath[_local2].setvolume(soundvolume);
if (_local3 >= 98) {
_local1.oldsound = "cont6";
if (!(_local2 === "cont6")) {
this.startSound(_local1, _local2, "cont6", 1, soundvolume);
}
} else if (_local3 <= 0) {
_local1.oldsound = "cont1";
if (!(_local2 === "cont1")) {
this.startSound(_local1, _local2, "cont1", 1, soundvolume);
}
} else if (_local3 > oldspeedperc) {
if (_local1.oldsound == "up") {
_local1.soundtimer = _local1.soundtimer + 1;
} else {
_local1.oldsound = "up";
_local1.soundtimer = 1;
var soundnumber = (Math.round((_local3 * 5) / 100) + 1);
if (soundnumber == 6) {
soundnumber = 5;
}
var myword = ("cont" + String(soundnumber));
if (!(_local2 === String(myword))) {
this.startSound(_local1, _local2, String(myword), 1, soundvolume);
}
return;
}
if (_local1.soundtimer > 10) {
if (!(_local2 === "up")) {
var pretime = ((_local3 * updur) / 100);
_global.upstart = pretime / 1000;
this.startSound(_local1, _local2, "up", 0, soundvolume);
}
return;
}
} else if (_local3 < oldspeedperc) {
if (_local1.oldsound == "down") {
_local1.soundtimer = _local1.soundtimer + 1;
} else {
_local1.oldsound = "down";
_local1.soundtimer = 1;
var soundnumber = (Math.round((_local3 * 5) / 100) + 1);
if (soundnumber == 6) {
soundnumber = 5;
}
var myword = ("cont" + String(soundnumber));
if (!(_local2 === String(myword))) {
this.startSound(_local1, _local2, String(myword), 1, soundvolume);
}
return;
}
if (_local1.soundtimer > 10) {
if (!(_local2 === "down")) {
procent = 100 - _local3;
var pretime = ((procent * downdur) / 100);
_global.downstart = pretime / 1000;
this.startSound(_local1, _local2, "down", 0, soundvolume);
}
return;
}
}
};
SoundObject.prototype.startSound = function (driver, mycSound, mysound, toloop, soundvolume) {
var _local3 = driver;
if (toloop) {
var _local1 = 999;
} else {
var _local1 = 0;
}
var _local2 = _local3.soundPath;
_local2[mycSound].stop();
_local2[mysound].start(0, _local1);
_local3.cSound = mysound;
_local3.soundPath[mysound].setvolume(soundvolume);
};
SoundObject.prototype.stopSound = function (driver) {
var _local1 = driver;
var _local2 = _local1.soundPath;
_local2[_local1.cSound].stop();
_local1.cSound = undefined;
};
_global.changeTextColor = function (currenttarget, mycolor, ctext, textfield) {
var _local1 = currenttarget;
textfield.text = ctext;
_local1.myformat = new TextFormat();
_local1.myformat.color = mycolor;
textfield.setTextFormat(_local1.myformat);
};
_global.startRace = function () {
var _local1 = _root;
var _local3 = MainControl.getmytimer();
i = 1;
while (i <= maxdrivers) {
var _local2 = driverObj["driver" + i];
_local2.startLapTime = _local3;
i++;
}
i = 1;
while (i <= 9) {
_local1["endname" + i] = undefined;
_local1["endtime" + i] = undefined;
_local1["besttime" + i] = undefined;
i++;
}
_local1.ambiance_mc.gotoAndPlay(2);
_global.gameStart = true;
_global.circuitStartTime = _local3;
_global.startLapTime = _local3;
};
_global.setstyle = function () {
var _local2 = _root.R_game_mc.main_mc.grass_mc;
var _local3 = _root.R_game_mc.main_mc.grass_mc;
_local2.myColor = new Color(_local3);
_local2.myColorTransform = new Object();
var _local1 = _local2.myColorTransform;
_local1.ra = myStyleColor[0];
_local1.rb = myStyleColor[1];
_local1.ga = myStyleColor[2];
_local1.gb = myStyleColor[3];
_local1.ba = myStyleColor[4];
_local1.bb = myStyleColor[5];
_local1.aa = myStyleColor[6];
_local1.ab = myStyleColor[7];
_local2.myColor.setTransform(_local1);
};
setstyle();
MainObject = function () {
var _local1 = _root;
_local1.maintimer = 0;
_local1.mainpittimer = 0;
_local1.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 () {
var _local1 = _root;
if (!gamestart) {
} else if (driverObj.driver0.atpitstreet) {
if (TimeControl.timePaused) {
return;
}
if (_local1.mainctime >= 4) {
_local1.mainctime = 1;
} else {
_local1.mainctime = _local1.mainctime + 1;
return;
}
} else {
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 _local1 = _global;
var _local3 = boughtlevel;
var boughtstearforce = 0;
boughtstearforce = boughtstearforce + _local1.boughsteararraya[_local3];
boughtstearforce = boughtstearforce + _local1.boughsteararrayb[_local3];
boughtstearforce = boughtstearforce + _local1.boughsteararrayc[_local3];
driver.orig_maxstearforce = driver.orig_maxstearforce + boughtstearforce;
var _local2 = 0;
_local2 = _local2 + _local1.boughspeedarraya[_local3];
_local2 = _local2 + _local1.boughspeedarrayb[_local3];
_local2 = _local2 + _local1.boughspeedarrayc[_local3];
_local2 = _local2 + _local1.boughspeedarrayd[_local3];
driver.orig_speedmax = driver.orig_speedmax + _local2;
};
_root.setdifficulty = function () {
var _local2 = _global;
if (_local2.difflevel == 3) {
_local2.tireloseNum = 4;
var _local3 = 2;
} else if (_local2.difflevel == 1) {
_local2.tireloseNum = 3;
var _local3 = 0;
} else {
_local2.tireloseNum = 2;
var _local3 = 1;
}
i = 0;
while (i <= maxdrivers) {
var _local1 = driverObj["driver" + i];
_local1.fu_use = 4;
_local1.tire_use = _local2.tireloseNum;
i++;
}
if (!(_local2.difflevel === 1)) {
i = 1;
while (i <= maxdrivers) {
var _local1 = driverObj["driver" + i];
_root.setshop_tuning_Cpu(_local1, _local3);
i++;
}
}
};
_root.setdifficulty();
_root.setshop_tuning = function () {
var _local2 = _global;
var _local3 = _root;
var _local1 = driverObj.driver0;
_local1.fu = 40;
var boughtstearforce = 0;
boughtstearforce = boughtstearforce + _local2.boughsteararraya[_local2.boughta];
boughtstearforce = boughtstearforce + _local2.boughsteararrayb[_local2.boughtb];
boughtstearforce = boughtstearforce + _local2.boughsteararrayc[_local2.boughtc];
_local1.orig_maxstearforce = _local1.orig_maxstearforce + boughtstearforce;
var boughtspeed = 0;
boughtspeed = boughtspeed + _local2.boughspeedarraya[_local2.boughta];
boughtspeed = boughtspeed + _local2.boughspeedarrayb[_local2.boughtb];
boughtspeed = boughtspeed + _local2.boughspeedarrayc[_local2.boughtc];
boughtspeed = boughtspeed + _local2.boughspeedarrayd[_local2.boughtd];
_local1.orig_speedmax = _local1.orig_speedmax + boughtspeed;
var tirelosetunning = ((_local3.tuning1 * 2) / 100);
var tire_use = (_local2.tireloseNum + tirelosetunning);
_local1.tire_use = tire_use;
_local1.orig_speedmax = _local1.orig_speedmax - tirelosetunning;
var steargaintunning = ((_local3.tuning1 * 0.2) / 100);
_local1.orig_maxstearforce = _local1.orig_maxstearforce + steargaintunning;
var speedlosetunning = ((_local3.tuning2 * 5) / 100);
_local1.orig_speedmax = _local1.orig_speedmax - speedlosetunning;
var steargaintunning = ((_local3.tuning2 * 0.3) / 100);
_local1.orig_maxstearforce = _local1.orig_maxstearforce + steargaintunning;
var speedlosetunning = ((_local3.tuning3 * 5) / 100);
_local1.orig_speedmax = _local1.orig_speedmax - speedlosetunning;
var steargaintunning = ((_local3.tuning3 * 0.3) / 100);
_local1.orig_maxstearforce = _local1.orig_maxstearforce + steargaintunning;
var fuellosetunning = ((_local3.tuning4 * 2) / 100);
_local1.fu_use = 4 + fuellosetunning;
var speedgaintunning = ((_local3.tuning4 * 5) / 100);
_local1.orig_speedmax = _local1.orig_speedmax + speedgaintunning;
trace("driver.orig_speedmax=" + _local1.orig_speedmax);
trace("driver.orig_maxstearforce=" + _local1.orig_maxstearforce);
trace("driver.fu_use=" + _local1.fu_use);
trace("driver.tire_use=" + _local1.tire_use);
_local3.developshow1 = _local1.orig_speedmax;
_local3.developshow2 = _local1.orig_maxstearforce;
_local3.developshow3 = _local1.fu_use;
_local3.developshow4 = _local1.tire_use;
};
_root.setshop_tuning();
driverControl.manageEnemies();
_global.endgame = function () {
var _local1 = _global;
var _local2 = _root;
_local1.gameStart = false;
circuitInterval.clearInterval();
treeInterval.clearInterval();
driverInterval.clearInterval();
_local2.lightController_mc.onEnterframe = undefined;
_local1.laptime = undefined;
_local1.endLapTime = undefined;
_local1.startLapTime = undefined;
_local2.showlaptime = "0:00.000";
mouse.show();
SoundControl.stopSound(driverObj.driver0);
SplashandDash_Sound.start();
_local1.Tinterobj = undefined;
_local1.driverObj = undefined;
_local1.endtime = undefined;
_local1.lastlaptime = undefined;
_local1.bestlaptime = undefined;
_local2.showbestlaptime = "0:00.000";
_local2.showlastlaptime = "0:00.000";
_local2.pasby_mc.onEnterFrame = undefined;
_local2.esccatcher_mc.onEnterFrame = undefined;
_local1.framedest = "menu";
_local2.black_mc.gotoAndPlay("fadein");
};
pick5namesfunction();
Symbol 1435 MovieClip Frame 2
_root.startinglights = function () {
var _local1 = this;
var _local2 = _root;
_local2.R_game_mc.startinglights_mc.gotoAndStop(2);
lightcontroller = _local2.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 () {
var _local1 = this;
var _local2 = _root;
if ((!(_local2.paused_mc._currentframe === 1)) || (!(_local2.escapeMenu_mc._currentframe === 1))) {
_local1.mystarttime = getTimer();
} else {
var _local3 = getTimer() - _local1.mystarttime;
if (_local3 >= _local1["lighttime" + _local1.mylight]) {
_local1.mystarttime = getTimer();
_local2.R_game_mc.startinglights_mc.gotoAndStop(_local1.mylight + 2);
_local1.mylight = _local1.mylight + 1;
if (_local1.mylight > 6) {
delete _local1.onEnterFrame;
}
}
}
};
};
_root.startinglights();
stop();
Symbol 1441 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 1444 Button
on (press) {
_global.endgame();
}
Symbol 1445 MovieClip Frame 1
_root.paused_mc.gotoAndStop(1);
stop();
Symbol 1445 MovieClip Frame 2
_root.paused_mc.gotoAndStop(1);
this.underlay_but.onPress = function () {
};
this.underlay_but.useHandCursor = false;
Symbol 1451 MovieClip Frame 1
stop();
Symbol 1453 MovieClip Frame 6
if (!(_global.framedest === undefined)) {
_level0.gotoAndPlay(_global.framedest);
_global.framedest = undefined;
}
stop();
Symbol 1453 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 1469 MovieClip Frame 1
stop();
Symbol 1476 MovieClip Frame 1
this.myColor = new Color(this.sub_mc);
this.myColor.setTransform(myCarColor);
Symbol 1477 MovieClip Frame 1
stop();
Symbol 1482 MovieClip Frame 1
stop();
Symbol 1485 MovieClip Frame 1
stop();
Symbol 1486 MovieClip Frame 1
stop();
Symbol 1490 MovieClip Frame 1
stop();
Symbol 1493 MovieClip Frame 1
stop();
Symbol 1494 MovieClip Frame 1
stop();
Symbol 1496 MovieClip Frame 1
stop();
Symbol 1496 MovieClip Frame 20
tire_Sound.start();
gotoAndPlay (144);
Symbol 1496 MovieClip Frame 43
tire_Sound.start();
Symbol 1496 MovieClip Frame 135
gotoAndStop (1);
Symbol 1496 MovieClip Frame 232
gotoAndStop (1);
Symbol 1497 MovieClip Frame 1
stop();
Symbol 1498 MovieClip Frame 1
stop();
Symbol 1498 MovieClip Frame 20
tire_Sound.start();
gotoAndPlay (180);
Symbol 1498 MovieClip Frame 43
tire_Sound.start();
Symbol 1498 MovieClip Frame 151
gotoAndStop (1);
Symbol 1498 MovieClip Frame 271
gotoAndStop (1);
Symbol 1499 MovieClip Frame 1
stop();
Symbol 1500 MovieClip Frame 1
stop();
Symbol 1501 MovieClip Frame 1
stop();
Symbol 1501 MovieClip Frame 2
gotoAndPlay ("fade1");
Symbol 1501 MovieClip Frame 3
gotoAndPlay ("fade2");
Symbol 1501 MovieClip Frame 111
gotoAndStop (1);
Symbol 1501 MovieClip Frame 241
gotoAndStop (1);
Symbol 1502 MovieClip Frame 1
stop();
Symbol 1502 MovieClip Frame 2
gotoAndPlay ("fade1");
Symbol 1502 MovieClip Frame 3
gotoAndPlay ("fade2");
Symbol 1502 MovieClip Frame 101
gotoAndStop (1);
Symbol 1502 MovieClip Frame 201
gotoAndStop (1);
Symbol 1558 MovieClip Frame 1
stop();
Symbol 1558 MovieClip Frame 19
whiping_Sound.start(0, 6);
Symbol 1558 MovieClip Frame 77
this._parent.play();
Symbol 1559 MovieClip Frame 1
stop();
Symbol 1559 MovieClip Frame 2
this.sub.gotoAndPlay(2);
Symbol 1559 MovieClip Frame 15
stop();
Symbol 1562 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 1574 MovieClip Frame 1
stop();
Symbol 1574 MovieClip Frame 9
stop();
Symbol 1574 MovieClip Frame 28
gotoAndPlay ("start");
Symbol 1576 MovieClip Frame 1
this.start_mc.useHandCursor = false;
this.start_mc.ctarget = this.fuelgame_mc;
this.start_mc.onPress = function () {
var _local1 = this;
if ((!_root.carholder_mc.car_mc.inspot) || (_root.carholder_mc.car_mc.exit)) {
} else if (!_local1.ctarget._visible) {
_local1.ctarget._visible = true;
} else {
_local1.ctarget.stop();
var _local2 = _local1.ctarget._currentframe;
if ((_local2 >= 6) && (_local2 <= 8)) {
_local1._parent.succes = true;
} else {
_local1._parent.succes = false;
}
_local1._parent.gotoAndPlay(2);
}
};
stop();
Instance of Symbol 711 MovieClip "fuelgame_mc" in Symbol 1576 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 1576 MovieClip Frame 2
this.tanker1.gotoAndPlay("start");
Symbol 1576 MovieClip Frame 4
this.tanker2.gotoAndPlay(2);
Symbol 1576 MovieClip Frame 8
this.tanker1.gotoAndPlay("tank");
Symbol 1576 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 1576 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 1576 MovieClip Frame 12
this.tanker1.gotoAndPlay("start");
this.tanker2.gotoAndPlay("start");
tankuit_Sound.start();
Symbol 1581 MovieClip Frame 1
stop();
Symbol 1581 MovieClip Frame 2
stop();
Symbol 1614 MovieClip Frame 1
stop();
Symbol 1614 MovieClip Frame 19
this.startlollipop_mc.onPress = function () {
actionControl.startlollipop();
};
stop();
Symbol 1622 MovieClip Frame 1
stop();
Symbol 1622 MovieClip Frame 7
gotoAndPlay (2);
Symbol 1631 MovieClip Frame 1
stop();
Symbol 1638 MovieClip Frame 1
this.myColor = new Color(this.sub_mc);
this.myColor.setTransform(myCarColor);
stop();
Symbol 1642 MovieClip Frame 1
stop();
Symbol 1646 MovieClip Frame 1
stop();
Symbol 1653 MovieClip Frame 1
stop();
Symbol 1657 MovieClip Frame 1
stop();
Symbol 1662 Button
on (press) {
_root.truck_mc._visible = false;
}
Symbol 1663 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 1669 Button
on (press) {
getURL ("index.htm", "_self");
}
Symbol 1677 Button
on (press) {
_root.yes._visible = false;
gotoAndStop (1);
}
Symbol 1679 MovieClip Frame 1
stop();
Symbol 1679 MovieClip Frame 2
stop();
Symbol 1684 MovieClip Frame 1
stop();
Symbol 1684 MovieClip Frame 2
_root.enginesound = "arriving";
Symbol 1684 MovieClip Frame 137
_root.enginesound = "idle";
Symbol 1684 MovieClip Frame 143
_root.enginesound = "idle";
Symbol 1684 MovieClip Frame 226
gotoAndPlay ("idle2");
Symbol 1684 MovieClip Frame 232
_root.enginesound = "leaving";
Symbol 1684 MovieClip Frame 481
gotoAndStop (1);
Symbol 1685 MovieClip Frame 1
stop();
Symbol 1685 MovieClip Frame 406
this.gotoAndPlay(2);
Symbol 1698 Button
on (press) {
_global.buyshow = true;
TimeControl.timePaused = true;
_root.buyme_mc._visible = true;
}
Symbol 1704 MovieClip Frame 1
stop();
Symbol 1706 Button
on (press) {
_global.buyshow = false;
TimeControl.timePaused = false;
_root.buyme_mc._visible = false;
}
Symbol 1708 MovieClip Frame 10
stop();
Symbol 1709 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 _local2 = selected;
var _local3 = driver;
_root.colorname = ">> " + CPnamearray[_local2];
_root.colorname2 = CPnamearray[_local2];
var ctargetbody = _local3.tocolor_mc;
_local3.myColor = new Color(ctargetbody);
_local3.myColorTransform = new Object();
var _local1 = _local3.myColorTransform;
_local1.ra = CParray[_local2][0];
_local1.rb = CParray[_local2][1];
_local1.ga = CParray[_local2][2];
_local1.gb = CParray[_local2][3];
_local1.ba = CParray[_local2][4];
_local1.bb = CParray[_local2][5];
_local1.aa = CParray[_local2][6];
_local1.ab = CParray[_local2][7];
_local3.myColor.setTransform(_local1);
var myoldcolor = _root["showcolor" + CPmycolor];
changeTextColor(myoldcolor, 13421772);
_global.CPmycolor = _local2;
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++;
}