Frame 1
Object.FLEM = function () {
this._listener_array = [];
};
Object.FLEM.prototype.addFLEMListener = function (obj) {
var a = this._listener_array;
var found = false;
var i = a.length;
while (i--) {
if (a[i] == obj) {
found = true;
break;
}
}
if (found) {
return(false);
}
a.unshift(obj);
if (this.sendFLEMEvent == undefined) {
this.sendFLEMEvent = this._sendFLEMEvent;
}
return(true);
};
Object.FLEM.prototype.removeFLEMListener = function (obj) {
var a = this._listener_array;
var i = a.length;
while (i--) {
if (a[i] == obj) {
a.splice(i, 1);
break;
}
}
if (a.length == 0) {
this.sendFLEMEvent = undefined;
}
};
Object.FLEM.prototype._sendFLEMEvent = function (func_str, argObj) {
var a = this._listener_array;
var i = a.length;
while (i--) {
if (a[i] != undefined) {
a[i][func_str](argObj);
} else {
a.splice(i, 1);
}
}
};
Object.addStaticFLEM = function (obj) {
trace(obj);
if (obj._listener_array == undefined) {
obj._listener_array = [];
obj._sendFLEMEvent = Object.FLEM.prototype._sendFLEMEvent;
obj.addFLEMListener = Object.FLEM.prototype.addFLEMListener;
obj.removeFLEMListener = Object.FLEM.prototype.removeFLEMListener;
}
};
Object.removeStaticFLEM = function (obj) {
delete obj._listener_array;
delete obj._sendFLEMEvent;
delete obj.addFLEMListener;
delete obj.removeFLEMListener;
};
Object.prototype.registerFLEM = function (objects, reg) {
if (objects.__proto__ == Array.prototype) {
var n = objects.length;
var i = 0;
while (i < n) {
if (reg == false) {
objects[i].removeFLEMListener(this);
} else {
objects[i].addFLEMListener(this);
}
i++;
}
}
};
ASSetPropFlags(Object.prototype, ["registerFLEM"], 1);
Object.addStaticFLEM(MovieClip);
Object.addStaticFLEM(Mouse);
Object.addStaticFLEM(Key);
if (_level0.flemEngine == undefined) {
_level0.attachMovie("flemEngine", "flemEngine", 8888);
if (_level0.flemEngine == undefined) {
trace("Cannot attach flemEngine! Make sure it is in the library.");
}
}
Frame 13
stop();
loader = {tb:this.getBytesTotal(), tl:this, clip:this.loaderMc};
loader.onEnterFrame = function () {
if (this.lb == this.tb) {
this.tl.play();
MovieClip.removeFLEMListener(this);
this.onEnterFrame = null;
} else {
this.lb = this.tl.getBytesLoaded();
this.percent = Math.round(100 * (this.lb / this.tb));
trace(diff);
this.timeLineFr = this.clip._currentframe + parseInt(this.percent / 5);
if (this.clip._totalframes < this.timeLineFr) {
this.timeLineFr = this.timeLineFr - this.clip._totalframes;
}
this.clip.percentText = this.percent + "%";
this.clip.gotoAndStop(this.timeLineFr);
}
};
MovieClip.addFLEMListener(loader);
Frame 59
if (tpswfpath == null) {
gotoAndPlay (132);
}
Frame 178
function init() {
zoom = false;
trackOrder = new Array();
linePoints = new Array();
linePoints[1] = new Array();
linePoints[2] = new Array();
trackPieces = new Array();
pointsPerAngle = parseInt(pointsPerCurve / 100);
maxSpeed = parseInt(pointsPerCurve / 7);
maxAccel = parseInt(pointsPerCurve / 50);
trackHolder.guides._visible = true;
pieceTypes = new Array("", "hstraight", "vstraight", "tlcorner", "trcorner", "brcorner", "blcorner");
maxWidth = 7;
maxHeight = 4;
thisSection = trackHolder.startFinish;
stopDragTrack();
}
function startDragTrack(pieceName) {
pieceNo++;
trackHolder.attachMovie("dragablePiece", "section" + pieceNo, pieceNo);
thisSection = trackHolder["section" + pieceNo];
thisSection.attachMovie(pieceName, "track", 1);
thisSection._x = trackHolder._xmouse - 50;
thisSection._y = trackHolder._ymouse - 50;
thisSection.startDrag();
thisSection.localToGlobaled = false;
thisSection.track.section.resetEnds();
}
function attachSavedTrackPart(pieceType, x, y, totalPieces, thisPiece) {
trace("adding saved track part");
pieceNo++;
var pieceName = pieceTypes[pieceType];
trackHolder.attachMovie("dragablePiece", "section" + pieceNo, pieceNo);
thisSection = trackHolder["section" + pieceNo];
thisSection.attachMovie(pieceName, "track", 1);
thisSection._x = x * 100;
thisSection._y = y * 100;
buildStatus.setStatus((("adding track part " + thisPiece) + " of ") + totalPieces);
buildStatus.progressBar.setBar(thisPiece / totalPieces);
thisSection.localToGlobaled = false;
thisSection.track.section.resetEnds();
this.timeOut(1, "stopDragTrack");
}
function startDragTrack2(trackPieceMC) {
thisSection = trackPieceMC;
trackPieces[thisSection.x][thisSection.y] = undefined;
thisSection.startDrag();
thisSection.localToGlobaled = false;
thisSection.track.section.resetEnds();
}
function stopDragTrack() {
stopDrag();
if (_root.buildingTrack) {
thisSection.gotoAndStop("drag");
} else {
thisSection.gotoAndStop("active");
}
thisSection._x = roundDown(thisSection._x, 100);
thisSection._y = roundDown(thisSection._y, 100);
thisSection.x = thisSection._x / 100;
thisSection.y = thisSection._y / 100;
if (!thisSection.localToGlobaled) {
thisSection.localToGlobaled = true;
thisSection.track.section.localToGlobal(thisSection.track.section.trackEnd1);
thisSection.track.section.localToGlobal(thisSection.track.section.trackEnd2);
}
var canAttach = false;
trace("trackPieces[thisSection.x][thisSection.y] : " + trackPieces[thisSection.x][thisSection.y]);
trace("thisSection.x : " + thisSection.x);
trace("thisSection.y : " + thisSection.y);
if (trackPieces[thisSection.x][thisSection.y] == undefined) {
trace("nothing under this part");
var check1x = (thisSection.x + thisSection.track.check1.x);
var check1y = (thisSection.y + thisSection.track.check1.y);
var check2x = (thisSection.x + thisSection.track.check2.x);
var check2y = (thisSection.y + thisSection.track.check2.y);
trace("check1x :" + check1x);
if ((((((((maxWidth >= check1x) && (maxWidth >= check2x)) && (maxHeight >= check1y)) && (maxHeight >= check2y)) && (check1x >= 0)) && (check2x >= 0)) && (check1y >= 0)) && (check2y >= 0)) {
trace("in bounds");
var check1 = trackPieces[thisSection.x + thisSection.track.check1.x][thisSection.y + thisSection.track.check1.y];
var check2 = trackPieces[thisSection.x + thisSection.track.check2.x][thisSection.y + thisSection.track.check2.y];
trace((((("check1 = " + (thisSection.x + thisSection.track.check1.x)) + " : ") + (thisSection.y + thisSection.track.check1.y)) + " : ") + check1);
trace((((("check2 = " + (thisSection.x + thisSection.track.check2.x)) + " : ") + (thisSection.y + thisSection.track.check2.y)) + " : ") + check2);
if (check1 && (checkCanConnect(thisSection, check1))) {
if (check2) {
if (checkCanConnect(thisSection, check2)) {
canAttach = true;
}
} else {
canAttach = true;
}
}
if (check2 && (checkCanConnect(thisSection, check2))) {
trace("can connect to check2");
if (check1) {
if (checkCanConnect(thisSection, check1)) {
canAttach = true;
}
} else {
canAttach = true;
}
}
if (thisSection._name == "startFinish") {
canAttach = true;
}
}
}
if (!canAttach) {
trace("not adding it!");
thisSection.removeMovieClip();
} else {
if (trackPieces[thisSection._x / 100] == undefined) {
trackPieces[thisSection._x / 100] = new Array();
}
trackPieces[thisSection._x / 100][thisSection._y / 100] = thisSection;
thisSection.track.section.drawLines();
}
trackBuildWindowContent.buildTrackBtn.setActive(checkCanBuild());
}
function checkCanConnect(sec1, sec2) {
return(((((sec1.track.section.trackEnd1.x == sec2.track.section.trackEnd1.x) && (sec1.track.section.trackEnd1.y == sec2.track.section.trackEnd1.y)) || ((sec1.track.section.trackEnd1.x == sec2.track.section.trackEnd2.x) && (sec1.track.section.trackEnd1.y == sec2.track.section.trackEnd2.y))) || ((sec1.track.section.trackEnd2.x == sec2.track.section.trackEnd1.x) && (sec1.track.section.trackEnd2.y == sec2.track.section.trackEnd1.y))) || ((sec1.track.section.trackEnd2.x == sec2.track.section.trackEnd2.x) && (sec1.track.section.trackEnd2.y == sec2.track.section.trackEnd2.y)));
}
function checkCanBuild() {
var loopCheck = 0;
var canBuildTrack = false;
var trackOrder = new Array(trackHolder.startFinish);
var nextSection = trackHolder.startFinish;
do {
nextSection = getNextSection(nextSection, true);
if (50 < (loopCheck++)) {
break;
}
if (nextSection == trackHolder.startFinish) {
trace("got track order");
canBuildTrack = true;
break;
}
if (nextSection == false) {
trace("couldn't get track order - are they joining up?");
break;
}
trackOrder.push(nextSection);
} while (nextSection && (nextSection != trackHolder.startFinish));
return(canBuildTrack);
}
function buildTrack(dontWorkoutAngles) {
buildStatus.setStatus("working out track order");
buildStatus.progressBar.setBar(0.5);
trackHolder.startFinish.track.end = 2;
trackOrder = new Array(trackHolder.startFinish);
var nextSection = trackHolder.startFinish;
var loopCheck = 0;
var canBuildTrack = false;
do {
nextSection = getNextSection(nextSection);
if (50 < (loopCheck++)) {
trace("looped too many times...");
break;
}
if (nextSection == trackHolder.startFinish) {
trace("got track order");
canBuildTrack = true;
break;
}
if (nextSection == false) {
trace("couldn't get track order - are they joining up?");
break;
}
trace(nextSection);
trackOrder.push(nextSection);
} while (nextSection && (nextSection != trackHolder.startFinish));
if (canBuildTrack) {
var segments = trackOrder.length;
var i = 0;
while (i < segments) {
linePoints[1] = linePoints[1].concat(trackOrder[i].track.section.line1);
linePoints[2] = linePoints[2].concat(trackOrder[i].track.section.line2);
i++;
}
if (!dontWorkoutAngles) {
workOutAngles(linePoints);
}
}
return(canBuildTrack);
}
function workOutAngles(line, callBack) {
var tlLoop = new Object();
tlLoop.totalPoints = line[1].length + line[2].length;
tlLoop.lines = line;
tlLoop.tl = this;
tlLoop.lineCompleted = [null, false, false];
tlLoop.i = [null, line[1].length, line[2].length];
tlLoop.doNextAngle = function (n) {
var thisLine = this.lines[n];
var thisPoint;
var lastPoint;
var angle;
var dx;
var dy;
if (this.i[n]--) {
var i = this.i[n];
thisPoint = thisLine[i];
if ((i - 10) >= 0) {
lastPoint = thisLine[i - 10];
} else {
lastPoint = thisLine[(thisLine.length + i) - 10];
}
dx = thisPoint.x - lastPoint.x;
dy = thisPoint.y - lastPoint.y;
angle = Math.atan(dx / dy);
angle = -180 * (angle / Math.PI);
if (dy < 0) {
angle = angle + 180;
}
if (angle < 0) {
angle = angle + 360;
}
thisPoint.angle = angle;
} else {
this.lineCompleted[n] = true;
}
};
tlLoop.onEnterFrame = function () {
this.tl.buildStatus.setStatus(((("working out track angles (" + this.onPoint) + "/") + this.totalPoints) + ")");
this.tl.buildStatus.progressBar.setBar(this.onPoint / this.totalPoints);
working = false;
var x = 0;
while (x < 50) {
var n = 1;
while (2 >= n) {
if (!this.lineCompleted[n]) {
this.doNextAngle(n);
working = true;
this.onPoint++;
}
n++;
}
if (!working) {
MovieClip.removeFLEMListener(this);
var timeTaken = ((getTimer() - this.startTime) / 1000);
trace(("done calculating the angles. that took " + timeTaken) + " seconds");
this.tl.workOutAnglesDone();
return;
}
x++;
}
};
tlLoop.startTime = getTimer();
MovieClip.addFLEMListener(tlLoop);
}
function workOutAnglesDone() {
buildStatus.complete();
buildStatus.progressBar.setBar(1);
trace("got the done call back");
trackBuildWindowContent.trackBuilt();
}
function testTrack() {
playTrack(cars[1], cars[1], false, false);
}
function playTrack(p1car, p2car, p1Com, p2Com) {
if (this.zoom) {
trackHolder.doScale();
}
trackHolder.guides._visible = false;
attachCars(p1car, p2car, p1Com, p2Com);
attachGameWindows();
}
function attachGameWindows() {
trace("attaching game windows");
this.attachMovie("trafficlights", "trafficlights", 10000);
var tl = trafficlights;
tl._x = 360;
tl.tweenObject("", "_y", 250, 20, "linearTween");
}
function attachCars(p1car, p2car, p1Com, p2Com) {
trace(p1Car.linkage);
car1 = new Object.PlayerCar(trackHolder, p1car, 1, currentTrack, p1Com);
car2 = new Object.PlayerCar(trackHolder, p2car, 2, currentTrack, p2Com);
}
function getNextSection(section, test) {
var thisCheck = section.track["check" + section.track.end];
var thisTrackEnd = section.track.section["trackEnd" + section.track.end];
var nextSection = trackPieces[section.x + thisCheck.x][section.y + thisCheck.y];
if (nextSection == undefined) {
return(false);
}
if ((nextSection.track.section.trackEnd1.x == thisTrackEnd.x) && (nextSection.track.section.trackEnd1.y == thisTrackEnd.y)) {
nextSection.track.end = 2;
} else {
nextSection.track.end = 1;
if (!test) {
reverseSectionLines(nextSection);
}
}
return(nextSection);
}
function reverseSectionLines(section) {
trace("reversing section lines : " + section);
section.track.section.line1.reverse();
section.track.section.line2.reverse();
var temp1 = section.track.section.line1.slice();
var temp2 = section.track.section.line2.slice();
section.track.section.line1 = temp2.slice();
section.track.section.line2 = temp1.slice();
}
function roundDown(x, n) {
return(Math.round(x / n) * n);
}
function saveTrack() {
statusText = "saving track...";
var tileString = "";
var i;
var iend = trackOrder.length;
i = 1;
while (i < iend) {
tileString = tileString + ((((trackOrder[i].track.trackType + ",") + trackOrder[i].x) + ",") + trackOrder[i].y);
if (i < (iend - 1)) {
tileString = tileString + "|";
}
i++;
}
trace("here's the tilestring " + tileString);
return(new Object.Track(999, "test track", "no one", "01.02.2003", tileString, 9999999, 99999, "no one", 99999, "no one"));
}
function createTrack() {
trace("creatingTrack");
statusText = "creating track...";
if (buildTrack(true)) {
var thisTrack = saveTrack();
buildSavedTrack(thisTrack, true);
}
}
function buildSavedTrack(track) {
buildStatus.setStatus("building track");
clearTrack();
currentTrack = track;
var tileArray = currentTrack.getTileArray();
var i = tileArray.length;
var max = i;
var waitTime = 1;
while (i--) {
this.timeOut(i * 3, "attachSavedTrackPart", (((((((("" + tileArray[i][0]) + ",") + tileArray[i][1]) + ",") + tileArray[i][2]) + ",") + max) + ",") + i);
waitTime = waitTime + 2;
}
this.timeOut(waitTime, "buildTrack");
}
function makeTrackDragable() {
var i = trackPieces.length;
while (i--) {
trace("trackPieces : " + trackPieces[i]);
trackPieces[i].gotoAndStop("drag");
}
}
function clearCars() {
car1.remove();
delete car1;
car2.remove();
delete car2;
trackHolder.guides._visible = true;
}
function clearTrackParts() {
for (i in trackHolder) {
trackHolder[i].removeMovieClip();
}
init();
}
function clearTrack() {
trace("trying to clear the track");
clearCars();
clearTrackParts();
}
function startGame() {
car1.go();
car2.go();
}
function setBuildStatusMc(mc) {
trace("setbuildStatusMc : " + mc);
buildStatus = mc;
}
function setUpBuildYourOwn() {
clearTrack();
_root.buildingTrack = true;
trackHolder.guides._visible = true;
trackBuildWindowHelp = createContentWindow("trackEditHelp", "center", "middle", 210, 340, true);
trackBuildWindow = createContentWindow("trackEditWindow", "right", "top", 245, 100);
trackBuildWindowContent = trackBuildWindow.placeHolder.content;
}
function setUpIntroWindows() {
introWin = createContentWindow("userinterface", 150, 150, 300, 200, false, false);
animWin = createContentWindow("packClip", 460, 150, 180, 180, false, false);
}
function restartRace() {
gameOver = false;
car1.reset();
car2.reset();
attachGameWindows();
}
function restartGame() {
gameOver = false;
car1.reset();
car2.reset();
clearTrack();
trackBuildWindow.close();
startPlayingBackwards();
}
function raceOver(car) {
if (!gameOver) {
gameOver = true;
raceOverWin = createContentWindow("results", "center", "middle", 300, 200, false, false);
winningCar = car;
}
}
function showLoginWindow() {
if (loginWin._name == undefined) {
loginWin = createContentWindow("login", "center", "middle", 265, 265, true);
}
}
function showScoreWindow(t) {
highScoreTrack = t;
if (highScoreWin._name == undefined) {
highScoreWin = createContentWindow("highScoreWin", "center", "middle", 330, 200, true);
}
}
function showCreditsWindow() {
if (creditsWin._name == undefined) {
creditsWin = createContentWindow("credits", "center", "middle", 300, 200, true);
}
}
function winBtn() {
if (winWin._name == undefined) {
winWin = createContentWindow("winWin", "center", "middle", 390, 260, true);
}
}
function sendBtn() {
if (sendWin._name == undefined) {
sendWin = createContentWindow("sendWin", "center", "middle", 390, 260, true);
}
}
function videoBtn() {
if (videoWin._name == undefined) {
videoWin = createContentWindow("videoWin", "center", "middle", 390, 260, true);
}
}
function mobileBtn() {
getURL ("http://www.puretoneonline.com/mobile", "_blank");
}
function openVideo(vidURL) {
getURL (vidURL, "_blank");
}
Object.prototype.setPropFlags = function (pProp, write, erase, hide) {
theFlags = parseInt([Number(write), Number(erase), Number(hide)].join(""), 2);
var player = $VERSION.split(" ")[1].split(",")[0];
if (5 < player) {
ASSetPropFlags(this, pProp, theFlags);
} else {
ASSetPropFlags(this, [pProp], ((theFlags == 0) ? 8 : (theFlags)));
}
};
Object.prototype.setPropFlags("setPropFlags", false, false, true);
MovieClip.prototype._attachMovie = MovieClip.prototype.attachMovie;
MovieClip.prototype.attachMovie = function (idName, newName, depth, initObject) {
this._attachMovie(idName, newName, depth, initObject);
return(this[newName]);
};
if (MovieClip.prototype.setPropFlags) {
MovieClip.prototype.setPropFlags("_attachMovie", false, false, true);
} else {
trace("attachMovie prototype : need to include setPropFlags.as to hide _attachMovie");
}
Math.linearTween = function (t, b, c, d) {
return(((c * t) / d) + b);
};
Math.easeInQuad = function (t, b, c, d) {
return(((c * ((t = t / d))) * t) + b);
};
Math.easeOutQuad = function (t, b, c, d) {
return((((-c) * ((t = t / d))) * (t - 2)) + b);
};
Math.easeInOutQuad = function (t, b, c, d) {
if (((t = t / (d / 2))) < 1) {
return((((c / 2) * t) * t) + b);
}
return((((-c) / 2) * (((--t) * (t - 2)) - 1)) + b);
};
Math.easeInCubic = function (t, b, c, d) {
return((((c * ((t = t / d))) * t) * t) + b);
};
Math.easeOutCubic = function (t, b, c, d) {
return((c * (((((t = (t / d) - 1)) * t) * t) + 1)) + b);
};
Math.easeInOutCubic = function (t, b, c, d) {
if (((t = t / (d / 2))) < 1) {
return(((((c / 2) * t) * t) * t) + b);
}
return(((c / 2) * (((((t = t - 2)) * t) * t) + 2)) + b);
};
Math.easeInQuart = function (t, b, c, d) {
return(((((c * ((t = t / d))) * t) * t) * t) + b);
};
Math.easeOutQuart = function (t, b, c, d) {
return(((-c) * ((((((t = (t / d) - 1)) * t) * t) * t) - 1)) + b);
};
Math.easeInOutQuart = function (t, b, c, d) {
if (((t = t / (d / 2))) < 1) {
return((((((c / 2) * t) * t) * t) * t) + b);
}
return((((-c) / 2) * ((((((t = t - 2)) * t) * t) * t) - 2)) + b);
};
Math.easeInQuint = function (t, b, c, d) {
return((((((c * ((t = t / d))) * t) * t) * t) * t) + b);
};
Math.easeOutQuint = function (t, b, c, d) {
return((c * (((((((t = (t / d) - 1)) * t) * t) * t) * t) + 1)) + b);
};
Math.easeInOutQuint = function (t, b, c, d) {
if (((t = t / (d / 2))) < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
return(((c / 2) * (((((((t = t - 2)) * t) * t) * t) * t) + 2)) + b);
};
Math.easeInSine = function (t, b, c, d) {
return((c * (1 - Math.cos((t / d) * (Math.PI/2)))) + b);
};
Math.easeOutSine = function (t, b, c, d) {
return((c * Math.sin((t / d) * (Math.PI/2))) + b);
};
Math.easeInOutSine = function (t, b, c, d) {
return(((c / 2) * (1 - Math.cos((t / d) * Math.PI))) + b);
};
Math.easeInExpo = function (t, b, c, d) {
return((c * Math.pow(2, 10 * ((t / d) - 1))) + b);
};
Math.easeOutExpo = function (t, b, c, d) {
return((c * ((-Math.pow(2, (-10 * t) / d)) + 1)) + b);
};
Math.easeInOutExpo = function (t, b, c, d) {
if (((t = t / (d / 2))) < 1) {
return(((c / 2) * Math.pow(2, 10 * (t - 1))) + b);
}
return(((c / 2) * ((-Math.pow(2, -10 * (--t))) + 2)) + b);
};
Math.easeInCirc = function (t, b, c, d) {
return((c * (1 - Math.sqrt(1 - (((t = t / d)) * t)))) + b);
};
Math.easeOutCirc = function (t, b, c, d) {
return((c * Math.sqrt(1 - (((t = (t / d) - 1)) * t))) + b);
};
Math.easeInOutCirc = function (t, b, c, d) {
if (((t = t / (d / 2))) < 1) {
return(((c / 2) * (1 - Math.sqrt(1 - (t * t)))) + b);
}
return(((c / 2) * (Math.sqrt(1 - (((t = t - 2)) * t)) + 1)) + b);
};
Math.elasticTween = function (t, b, c, d, a, p) {
a = ((((0 < c) && (a < c)) || ((c < 0) && (c < (-a)))) ? (c) : (a));
if (p == undefined) {
p = d / 2;
}
return(((((t == d) ? 0 : (((-a) * ((-Math.pow(2, (-10 * t) / d)) + 1)) + a)) * Math.sin(((t - ((p / (Math.PI*2)) * Math.asin(c / a))) * (Math.PI*2)) / p)) + b) + c);
};
MovieClip.prototype.tweenObject = function (obj, prop, targetV, d, tweenType) {
var motionObj = new Object();
if (obj == "") {
motionObj.mc = this;
} else {
motionObj.mc = obj;
}
motionObj.prop = prop;
motionObj.tweenType = tweenType;
motionObj.bX = parseInt(motionObj.mc[prop]);
motionObj.fX = parseInt(targetV);
motionObj.cX = motionObj.fX - motionObj.bX;
motionObj.d = parseInt(d);
motionObj.t = 0;
motionObj.onEnterFrame = function () {
if (this.d < this.t) {
this.mc[this.prop] = this.fX;
MovieClip.removeFLEMListener(this);
delete this.onEnterFrame;
} else {
this.mc[this.prop] = Math[this.tweenType](this.t++, this.bX, this.cX, this.d);
}
};
motionObj.stopMe = function () {
trace("----------------------stopping");
delete this.onEnterFrame;
MovieClip.removeFLEMListener(this);
};
if (MovieClip.addFLEMListener) {
MovieClip.addFLEMListener(motionObj);
return(motionObj);
}
trace("Tween Object needs FLEM");
return(false);
};
MovieClip.prototype.setPropFlags("tweenObject", false, false, true);
MovieClip.prototype.startPlayingBackwards = function () {
this.stopPlayingBackwards();
trace("playbackwards");
this.__playHead = {};
this.__playHead.tl = this;
this.__playHead.onEnterFrame = function () {
this.tl.prevFrame();
};
MovieClip.addFLEMListener(this.__playHead);
};
MovieClip.prototype.stopPlayingBackwards = function () {
MovieClip.removeFLEMListener(this.__playHead);
delete this.__playHead;
};
MovieClip.prototype.setPropFlags("stopPlayingBackwards", false, false, true);
MovieClip.prototype.setPropFlags("startPlayingBackwards", false, false, true);
Object.prototype.timeOut = function (d, func, args, obj, doEval, evalArray) {
var timer = new Object();
timer.d = d;
if ((obj == null) || (obj == "")) {
timer.obj = this;
} else {
timer.obj = obj;
}
timer.func = func;
timer.args = args.split(",");
if (doEval) {
var evalArg;
evalArray = evalArray.split(",");
for (var i in evalArray) {
evalArg = parseInt(evalArray[i]);
if (eval (timer.args[evalArg]) != undefined) {
timer.args[i] = eval (timer.args[i]);
}
}
}
timer.time = 0;
timer.onEnterFrame = function () {
this.time++;
if (this.d < this.time) {
this.obj[this.func](this.args[0], this.args[1], this.args[2], this.args[3], this.args[4], this.args[5], this.args[6], this.args[7]);
MovieClip.removeFLEMListener(this);
}
};
MovieClip.addFLEMListener(timer);
return(timer);
};
Object.prototype.clearTimeOut = function (timer) {
delete timer.onEnterFrame;
};
Object.prototype.setPropFlags("clearTimeOut", false, false, true);
Object.prototype.setPropFlags("timeOut", false, false, true);
Object.Track = function (trackID, trackName, createdBy, createdOn, tileStr, laps, bestLapTimes, bestTotalTimes) {
trace("creating new track");
this.id = trackID;
this.name = trackName;
this.createdBy = createdBy;
this.createdOn = createdOn;
this.tileStr = tileStr;
this.laps = laps;
this.bestLapTimes = bestLapTimes.split("|");
var i = this.bestLapTimes.length;
while (i--) {
var ta = this.bestLapTimes[i].split(",");
this.bestLapTimes[i] = new this.recordTime(parseInt(ta[0]), ta[1]);
}
this.bestTotalTimes = bestTotalTimes.split("|");
var i = this.bestTotalTimes.length;
while (i--) {
var ta = this.bestTotalTimes[i].split(",");
this.bestTotalTimes[i] = new this.recordTime(parseInt(ta[0]), ta[1]);
}
this.getID = function () {
return(this.id);
};
this.getName = function () {
return(this.name);
};
this.getTotalLaps = function () {
return(this.laps);
};
this.getTrackRecord = function () {
return(this.bestTotalTimes[0]);
};
this.getLapRecord = function () {
return(this.bestLapTimes[0]);
};
this.getCreatedBy = function () {
return(this.createdBy);
};
this.getCreatedOn = function () {
return(this.createdOn);
};
this.getTileArray = function () {
return(this.tileArray);
};
this.getTileString = function () {
return(this.tileStr);
};
this.getBestLapTimes = function () {
return(this.bestLapTimes);
};
this.getBestTotalTimes = function () {
return(this.bestTotalTimes);
};
this.tileArray = this.tileStr.split("|");
var i = this.tileArray.length;
while (i--) {
this.tileArray[i] = this.tileArray[i].split(",");
}
};
Object.Track.prototype.recordTime = function (time, player) {
this.time = time;
this.player = player;
};
tileStr = "1,4,4|5,5,4|2,5,3|3,5,2|1,6,2|5,7,2|2,7,1|4,7,0|1,6,0|3,5,0|5,5,1|3,4,1|2,4,2|5,4,3|1,3,3|1,2,3|6,1,3|3,1,2|1,2,2|5,3,2|2,3,1|4,3,0|1,2,0|1,1,0|3,0,0|2,0,1|2,0,2|2,0,3|6,0,4|1,1,4|1,2,4";
tempTrack = new Track("bowdys track", "bowdy", "01.02.2003", tileStr, 8, 73049, "bowdy", 7544, "sermad");
pointsPerCurve = 200;
Object.PlayerCar = function (tl, carObj, playerNo, onTrack, com) {
trace("trying to create a new car on " + tl);
this.tl = tl;
this.carObj = carObj;
this.onTrack = onTrack;
this.playerNo = playerNo;
this.timerConsol = _root["timer" + this.playerNo];
this.ghosting = ghosting != undefined;
this.tl.attachMovie("car", "car" + playerNo, 1000 + playerNo);
this.car = this.tl["car" + playerNo];
trace("attaching car " + this.carObj.linkage);
this.car.attachMovie(this.carObj.linkage, "carSprite", 1);
this.startFinishLine = Math.round(_root.pointsPerCurve / 5);
this.i = this.startFinishLine;
this.weight = {x:this.car.backEnd._x, y:this.car.backEnd._y};
this.ACCELFACTOR = 100;
this.MASTERFRICTION = 0.8 - (0.2 * carObj.grip);
this.MAXSPEED = Math.round(_root.MAXSPEED * carObj.speed);
this.MAXACCEL = Math.round(_root.MAXACCEL * carObj.accel);
this.crashed = false;
this.track = linePoints[playerNo];
this.trackLength = this.track.length - 1;
this.cfn = 1000;
this.lapTimes = new Array();
this.com = com;
this.keys = [null, 90, 77];
this.maxRightX = 800;
this.minRightX = 0;
this.crashSoundClip = this.car.attachMovie("empty", "crashSound", 2);
this.carSoundClip = this.car.attachMovie("empty", "carSound", 3);
this.inplayLoop();
this.car._rotation = -90;
this.resetWeight();
this.car._rotation = -90;
};
Object.PlayerCar.prototype.remove = function () {
this.carSound.stop();
MovieClip.removeFLEMListener(this);
Key.removeFLEMListener(this);
this.car.removeMovieClip();
this.timerConsol.reset();
};
Object.PlayerCar.prototype.go = function () {
this.carSound = new Sound(this.carSoundClip);
this.carSound.attachSound("carSound");
this.carSound.setVolume(0);
this.carSound.start(0, 99999999999);
this.crashSound = new Sound(this.crashSoundClip);
this.crashSound.attachSound("crashSound");
this.crashSound.setVolume(100);
if (!this.com) {
this.accelKey = this.keys[this.playerNo];
Key.addFLEMListener(this);
} else {
this.comSpeed = 2;
}
this.startTime = getTimer();
this.onLap = 1;
this.lapStartTime = this.startTime;
this.timerConsol.handleStart(this.startTime, this.onTrack);
this.racing = true;
this.onEnterFrame = this.inplayLoop;
MovieClip.addFLEMListener(this);
};
Object.PlayerCar.prototype.reset = function () {
this.carSound.stop();
MovieClip.removeFLEMListener(this);
this.onEnterFrame = null;
this.timerConsol.reset();
this.i = this.startFinishLine;
this.crashed = false;
this.speed = 0;
this.accel = 0;
this.racing = false;
this.inplayLoop();
this.resetWeight();
this.car._rotation = -90;
};
Object.PlayerCar.prototype.comLoop = function () {
this.fr++;
if ((this.fr % (this.comSpeed * 2)) == 0) {
this.accelerate();
} else if ((this.fr % this.comSpeed) == 0) {
this.brake();
}
};
Object.PlayerCar.prototype.inplayLoop = function () {
if (!this.crashed) {
if (this.com && (this.racing)) {
this.comLoop();
}
if (this.isAccelerating) {
this.accel = Math.min(this.maxAccel, this.accel + 1);
} else {
this.accel = Math.max(-1, this.accel - 2);
}
this.speed = Math.max(0, Math.min(this.maxSpeed, this.speed + this.accel));
this.lasti = this.i;
this.i = this.i + this.speed;
if (this.trackLength < this.i) {
this.i = this.i - this.trackLength;
}
this.relSpeed = 100 * (this.speed / this.maxSpeed);
this.carSound.setVolume(this.relSpeed);
this.relPos = 100 * (this.car._x / this.maxRightX);
this.carSound.setPan(this.relPos);
this.thisPoint = this.track[this.i];
var bp = (this.i - 20);
if (bp < 0) {
bp = bp + this.trackLength;
}
this.backPoint = this.track[bp];
this.currSpeed = this.speed / this.maxSpeed;
this.friction = Math.max(0.5, this.currSpeed * this.MASTERFRICTION);
if (this.speed == 0) {
this.resetWeight();
}
var t = {x:this.backPoint.x, y:this.backPoint.y};
this.dx = this.weight.x - t.x;
if (0 < this.dx) {
this.xaccel = (-(this.dx * this.dx)) / this.accelfactor;
} else {
this.xaccel = (this.dx * this.dx) / this.accelfactor;
}
this.xspeed = (this.xspeed + this.xaccel) * this.friction;
this.weight.x = this.weight.x + this.xspeed;
this.dy = this.weight.y - t.y;
if (0 < this.dy) {
this.yaccel = (-(this.dy * this.dy)) / this.accelfactor;
} else {
this.yaccel = (this.dy * this.dy) / this.accelfactor;
}
this.yspeed = (this.yspeed + this.yaccel) * this.friction;
this.weight.y = this.weight.y + this.yspeed;
if (this.playerNo == 1) {
this.tl.weight._x = this.weight.x;
this.tl.weight._y = this.weight.y;
}
this.dx = this.weight.x - this.car._x;
this.dy = this.weight.y - this.car._y;
this.angle = Math.atan(this.dx / this.dy);
this.angle = -180 * (this.angle / Math.PI);
if (this.dy < 0) {
this.angle = this.angle + 180;
}
this.angle = this.angle - 180;
if (this.angle < 0) {
this.angle = this.angle + 360;
}
this.rotationSpeed = this.angle - this.car._rotation;
this.car._rotation = this.angle;
this.diff = this.angle - this.thisPoint.angle;
this.diff = Math.abs(this.diff);
if (180 < this.diff) {
this.diff = 360 - this.diff;
}
this.diff = this.diff * (this.speed / this.maxSpeed);
if ((178 < this.diff) && (this.diff < 182)) {
this.diff = 0;
}
if (50 < this.diff) {
this.carSound.setVolume(0);
this.crashSound.setPan(this.relPos);
this.crashSound.start();
this.crashed = true;
if (0.5 < this.currSpeed) {
this.car.carSprite.play();
}
this.speed = 0;
this.accel = 0;
this.brake();
trace("crashed at " + this.diff);
} else {
this.adx = this.thisPoint.x - this.car._x;
this.ady = this.thisPoint.y - this.car._y;
aSpeed = Math.sqrt((this.adx * this.adx) + (this.ady * this.ady));
this.car._x = this.thisPoint.x;
this.car._y = this.thisPoint.y;
if ((this.i >= this.startFinishLine) && (this.lasti < this.startFinishLine)) {
var timeNow = getTimer();
this.lapTimes[this.onLap] = timeNow - this.lapStartTime;
this.lapStartTime = timeNow;
this.timerConsol.handleLapTime(this.lapTimes[this.onLap], timeNow);
if (this.onLap == this.onTrack.getTotalLaps()) {
_root.raceOver(this);
Key.removeFLEMListener(this);
this.racing = false;
this.brake();
} else {
this.onLap++;
}
}
}
} else if (this.crashed) {
this.adx = this.adx * 0.9;
this.car._x = this.car._x + this.adx;
this.ady = this.ady * 0.9;
this.car._y = this.car._y + this.ady;
this.rotationSpeed = this.rotationSpeed * 0.8;
this.car._rotation = this.car._rotation - this.rotationSpeed;
if ((Math.abs(this.adx) < 0.1) && (Math.abs(this.ady) < 0.1)) {
this.car._x = this.thisPoint.x;
this.car._y = this.thisPoint.y;
this.car._rotation = this.thisPoint.angle;
this.resetWeight();
this.crashed = false;
}
}
};
Object.PlayerCar.prototype.resetWeight = function () {
var ob = {x:this.backPoint.x, y:this.backPoint.y};
this.weight.x = ob.x;
this.weight.y = ob.y;
};
Object.PlayerCar.prototype.accelerate = function () {
if (!this.isAccelerating) {
trace("accelerate");
this.isAccelerating = true;
this.accel = ((this.accel < 0) ? 0 : (this.accel));
}
};
Object.PlayerCar.prototype.brake = function () {
if (this.isAccelerating) {
trace("brake");
this.isAccelerating = false;
this.accel = ((0 < this.accel) ? 0 : (this.accel));
}
};
Object.PlayerCar.prototype.onKeyDown = function () {
if (key.isDown(this.accelKey)) {
this.accelerate();
}
};
Object.PlayerCar.prototype.onKeyUp = function () {
if (!key.isDown(this.accelKey)) {
this.brake();
}
};
Object.Car = function (name, linkage, speed, accel, brakeing, grip) {
this.name = name;
this.linkage = linkage;
this.speed = speed;
(this.accel = accel);
(this.brakeing = brakeing);
this.grip = grip;
};
cars = new Array(null);
cars.push(new Object.Car("Feretti", "car1", 0.8, 0.6, 0.5, 0.7));
cars.push(new Object.Car("Lamburrito", "car2", 0.9, 0.7, 0.8, 0.5));
cars.push(new Object.Car("Jordan 36D", "car3", 1, 0.9, 0.5, 0.7));
cars.push(new Object.Car("Mr Toad", "car4", 0.6, 1, 0.9, 0.6));
cars.push(new Object.Car("Mini", "car5", 0.7, 0.9, 1, 0.4));
Object.prototype.PQueue = function () {
this.heap = new Array();
this.map = new Object();
this.idInc = 0;
};
PQueue.prototype.insert = function (obj, priority) {
if (priority == null) {
priority = 1000;
}
var pos = this.heap.length;
var temp = new Object();
var id = (this.idInc++);
temp.priority = priority;
temp.data = obj;
temp.id = id;
temp.pos = pos;
this.map[id] = temp;
this.heap[pos] = temp;
this.$filterUp(pos);
return(id);
};
PQueue.prototype.removeTop = function () {
if (0 < this.heap.length) {
var result = this.heap[0].data;
delete this.map[this.heap[0].id];
delete this.heap[0];
this.heap[0] = this.heap[this.heap.length - 1];
this.heap[0].pos = 0;
this.heap.splice(this.heap.length - 1, 1);
this.$filterDown(0);
return(result);
}
return(false);
};
PQueue.prototype.changePriority = function (id, value, absolute) {
var element = this._map[id];
var pos = element.pos;
var oldPriority = element.priority;
if (absolute) {
element.priority = value;
} else {
element.priority = element.priority + value;
}
if (element.priority < oldPriority) {
this.$filterUp(pos);
} else {
this.$filterDown(pos);
}
};
PQueue.prototype.isEmpty = function () {
return(this.heap.length == 0);
};
PQueue.prototype.getTopPriority = function () {
return(this.heap[0].priority);
};
PQueue.prototype.isQueued = function (id) {
return(this.map[id] != null);
};
PQUeue.prototype.remove = function (id) {
if (this.isQueued(id)) {
var index = this.map[id].pos;
delete this.map[id];
delete this.heap[index];
this.heap[index] = this.heap[this.heap.length - 1];
this.heap[0].pos = 0;
this.heap.splice(this.heap.length - 1, 1);
return(true);
}
return(false);
};
PQueue.prototype.$hasLeft = function (index) {
return(((2 * index) + 1) < this.heap.length);
};
PQueue.prototype.$hasRight = function (index) {
return(((2 * index) + 2) < this.heap.length);
};
PQueue.prototype.$getLeft = function (index) {
return((2 * index) + 1);
};
PQueue.prototype.$getRight = function (index) {
return((2 * index) + 2);
};
PQueue.prototype.$filterUp = function (index) {
var i = index;
while ((0 < i) && (this.heap[i].priority < this.heap[int((i - 1) / 2)].priority)) {
var parent = int((i - 1) / 2);
var temp = this.heap[i];
this.heap[i] = this.heap[parent];
this.heap[parent] = temp;
this.heap[i].pos = i;
this.heap[parent].pos = parent;
i = int((i - 1) / 2);
}
};
PQueue.prototype.$filterDown = function (index) {
var done = false;
var i = index;
var largest;
do {
largest = i;
if (this.$hasLeft(i) && (this.heap[this.$getLeft(i)].priority < this.heap[i].priority)) {
largest = this.$getLeft(i);
}
if (this.$hasRight(i) && (this.heap[this.$getRight(i)].priority < this.heap[largest].priority)) {
largest = this.$getRight(i);
}
if (largest != i) {
var temp = this.heap[i];
this.heap[i] = this.heap[largest];
this.heap[largest] = temp;
this.heap[i].pos = i;
this.heap[largest].pos = largest;
i = largest;
} else {
done = true;
}
} while (!done);
};
Object.prototype.setPropFlags("PQueue", false, false, true);
Object.DataConn = function (processURL, tl) {
this.tl = tl;
this.$processURL = processURL;
this.$dataQueue = new PQueue();
Object.dataConnCount++;
this.tl.attachMovie("dataConnHolder", "dataConn" + Object.dataConnCount, 10000 + Object.dataConnCount);
this.$dataConnMc = tl["dataConn" + Object.dataConnCount].dataConnMC;
this.$dataIsSending = false;
Object.addStaticFLEM(this);
};
Object.DataConn.prototype.queueData = function (dataObj) {
trace("queueData Called");
this.$dataQueue.insert(dataObj);
if (!this.$dataIsSending) {
this.$sendNextData();
}
};
Object.DataConn.prototype.handleData = function (dataObj) {
this.sendFLEMEvent("onRawData");
this["handle_" + dataObj.action](dataObj);
this.$dataConnMc.clearProps();
this.$sendNextData();
};
Object.DataConn.prototype.$sendNextData = function () {
trace("sendNextData Called");
var nextData = this.$dataQueue.removeTop();
if (!nextData) {
this.$dataIsSending = false;
this.sendFLEMEvent("onAllData");
return(undefined);
}
this.$sendData(nextData);
};
Object.DataConn.prototype.$sendData = function (dataObj) {
this.sendFLEMEvent("onSendData");
this.$dataIsSending = true;
trace("sending data: action : " + dataObj.action);
dataObj.r = Math.round(Math.random() * 100000);
this.$dataConnMc.clearProps();
this.$dataConnMc.copyProps(dataObj);
var dataString = "?";
for (var i in this:$dataConnMC) {
dataString = dataString + (((i + "=") + this.$dataConnMC[i]) + "&");
}
trace(("sending data: " + this.$processURL) + dataString);
this.$dataConnMc.loadVariables(this.$processURL, "GET");
this.$dataConnMc.dataConnObj = this;
};
String.prototype.isEmail = function () {
if ((((this.indexOf(" ") == -1) && (0 < this.indexOf("@"))) && ((1 + this.indexOf("@")) < this.lastIndexOf("."))) && (this.lastIndexOf(".") != (this.length - 1))) {
return(true);
}
return(false);
};
Object.prototype.copy = function () {
var temp = {};
for (var p in this) {
var pType = typeof(this[p]);
var pTypeIsPrimitive = (((pType == "number") || (pType == "string")) || (pType == "boolean"));
if (pTypeIsPrimitive) {
temp[p] = this[p];
} else if (pType != "function") {
temp[p] = this[p].copy();
}
}
return(temp);
};
Object.prototype.copyProps = function (obj) {
for (var p in obj) {
var pType = typeof(obj[p]);
var pTypeIsPrimitive = (((pType == "number") || (pType == "string")) || (pType == "boolean"));
if (pTypeIsPrimitive) {
this[p] = obj[p];
}
}
};
Object.prototype.clearProps = function () {
for (var p in this) {
delete this[p];
}
};
Object.prototype.setPropFlags("clearProps", false, false, true);
Object.prototype.setPropFlags("copyProps", false, false, true);
Object.prototype.setPropFlags("copy", false, false, true);
Object.setPropFlags("DataConn", false, false, true);
String.prototype.setPropFlags("isEmail", false, false, true);
dc = new Object.DataConn("http://uk.sonymusic.co.uk/puretone/groove/process.php", this);
dc.saveTrackScore = function (trackID, totalTime, bestLapTime) {
var queueObj = {action:"saveTrackScore", username:_root.player.username, password:_root.player.password, trackID:trackID, totalTime:totalTime, bestLapTime:bestLapTime};
this.queueData(queueObj);
};
dc.handle_saveTrackScore = function (dataObj) {
this.sendFLEMEvent("onSaveTrackScore", dataObj);
};
dc.getTrackIDs = function () {
trace("getting trackIDs");
var queueObj = {action:"getTrackIDs"};
this.queueData(queueObj);
};
dc.handle_getTrackIDs = function (dataObj) {
trace("handle_getTrackIDs called");
var trackIDs = dataObj.trackIDs.split("|");
if (trackIDs[trackIDs.length - 1] == "") {
trackIDs.pop();
}
this.sendFLEMEvent("onTracksLoad", trackIDs);
};
dc.loadTrack = function (id) {
trace("loading track " + id);
var queueObj = {action:"loadTrack", trackID:id};
this.queueData(queueObj);
};
dc.handle_loadTrack = function (dataObj) {
trace("got the track!");
var thisTrack = (new Object.Track(dataObj.trackID, dataObj.name, dataObj.username, dataObj.createdOn, dataObj.tiles, dataObj.laps, dataObj.bestLapTime, dataObj.totaltime));
this.sendFLEMEvent("onTrackLoad", thisTrack);
};
dc.saveTrack = function (laps, name, tiles) {
var queueObj = {action:"saveTrack", name:name, laps:laps, tiles:tiles, username:_root.player.username, password:_root.player.password};
this.queueData(queueObj);
};
dc.handle_saveTrack = function (dataObj) {
this.sendFLEMEvent("onTrackSaved", dataObj);
};
dc.registerPlayer = function (firstName, surname, email, username, password, sms, optin1, optin2, ref) {
if ((firstName == "") || (surname == "")) {
return(6);
}
if (!email.isEmail()) {
return(1);
}
if (username.length < 4) {
return(2);
}
if (password.length < 4) {
return(3);
}
sms = ((sms == undefined) ? "" : (sms));
ref = ((ref == undefined) ? "none" : (ref));
var queueObj = {action:"registerPlayer", firstname:firstname, surname:surname, email:email, username:username, password:password, sms:sms, optin1:optin1, optin2:optin2, ref:ref};
this.queueData(queueObj);
return(0);
};
dc.handle_registerPlayer = function (dataObj) {
this.sendFLEMEvent("onRegisterPlayer", dataObj);
};
dc.login = function (username, password) {
if ((username == "") || (password == "")) {
return(1);
}
var queueObj = {action:"login", username:username, password:password};
this.queueData(queueObj);
return(0);
};
dc.handle_login = function (dataObj) {
this.sendFLEMEvent("onLogin", dataObj);
};
dc.sendToFriend = function (username, usermail, friendmail_1, friendmail_2, friendmail_3, optin1, optin2, ref) {
var queueObj = {action:"sendtofriend", username:username, usermail:usermail, friendmail_1:friendmail_1, friendmail_2:friendmail_2, friendmail_3:friendmail_3, optin1:optin1, optin2:optin2, ref:ref};
this.queueData(queueObj);
};
dc.handle_sendtofriend = function () {
this.sendFLEMEvent("onMailSent");
};
interface = {};
interface.tl = this;
interface.dc = dc;
interface.dc.addFLEMListener(interface);
interface.playerCar = [null, 1, 1];
interface.comPlayer = [null, false, true];
interface.maxCarID = cars.length - 1;
interface.currentPlayer = 1;
interface.cars = cars;
interface.buildYourOwn = function () {
this.buildOwn = true;
this.mc.play();
};
interface.buildYourOwnTrack = function () {
this.tl.setUpBuildYourOwn();
};
interface.showPlayer = function (playerID) {
this.currentPlayer = playerID;
this.showCurrentPlayerCar();
this.showComControl();
this.showPlayerOrCom();
};
interface.showPlayerOrCom = function () {
this.mc.playerOrCom.gotoAndStop((this.comPlayer[this.currentPlayer] ? "com" : "player"));
};
interface.showComControl = function () {
trace("current player com controller " + this.comPlayer[this.currentPlayer]);
this.mc.carSelect.comTick.setState(this.comPlayer[this.currentPlayer]);
};
interface.setComControl = function (state) {
this.comPlayer[this.currentPlayer] = state;
this.showPlayerOrCom();
};
interface.setInterfaceMovie = function (mc) {
this.mc = mc;
this.init();
};
interface.init = function () {
this.buildOwn = false;
this.mc.gotoAndPlay("welcome");
};
interface.getTracks = function () {
trace("interface.getTracks");
trace(this.dc);
delete this.tracks;
this.dc.getTrackIDs();
};
interface.onTracksLoad = function (tracksArray) {
trace("interface.onTracksLoad");
this.trackIDs = tracksArray;
this.dc.loadTrack(this.trackIDs[0]);
this.currentTrackIDsID = 0;
};
interface.onTrackLoad = function (newTrack) {
trace("interface.onTrackLoad");
if (!this.tracks) {
this.tracks = new Array();
}
this.tracks[newTrack.getID()] = newTrack;
this.displayTrack(newTrack);
};
interface.displayTrackFromID = function (trackID) {
if (this.tracks[trackID]) {
this.displayTrack(this.tracks[trackID]);
} else {
this.dc.loadTrack(trackID);
}
};
interface.displayTrack = function (track) {
trace("interface.displayTrack");
this.currentTrack = track;
this.mc.trackSelect.displayTrack(track);
};
interface.getNextCar = function () {
this.playerCar[this.currentPlayer]++;
if (this.maxCarID < this.playerCar[this.currentPlayer]) {
this.playerCar[this.currentPlayer] = 1;
}
this.showCar(this.playerCar[this.currentPlayer], 1);
};
interface.getPrevCar = function () {
this.playerCar[this.currentPlayer]--;
if (this.playerCar[this.currentPlayer] < 1) {
this.playerCar[this.currentPlayer] = this.maxCarID;
}
this.showCar(this.playerCar[this.currentPlayer], -1);
};
interface.showCurrentPlayerCar = function () {
this.showPlayerCar(this.currentPlayer);
};
interface.buildTrack = function () {
_root.buildingTrack = false;
this.tl.buildSavedTrack(this.currentTrack);
};
interface.playTrack = function () {
this.tl.playTrack(this.cars[this.playerCar[1]], this.cars[this.playerCar[2]], this.comPlayer[1], this.comPlayer[2]);
};
interface.showChoices = function () {
this.mc.choices.trackDisplay.displayTrack(this.currentTrack);
this.showChosenCars();
};
interface.showChoices2 = function () {
this.showChosenCars();
var p1Key = "Z";
var p2key = "M";
var keys = [null, p1Key, p2Key];
var i = 1;
while (2 >= i) {
if (!this.comPlayer[i]) {
this.mc.choices["keyPlayer" + i].playerKey.gotoAndStop(keys[i]);
this.mc.choices["keyPlayer" + i]._visible = true;
} else {
this.mc.choices["keyPlayer" + i]._visible = false;
}
i++;
}
};
interface.showChosenCars = function () {
var i = 1;
while (2 >= i) {
this.mc.choices["playerOrCom" + i].gotoAndStop((this.comPlayer[i] ? "com" : "player"));
this.mc.choices["carPlayer" + i].nextCar = this.cars[this.playerCar[i]].linkage;
this.mc.choices["carPlayer" + i].play();
i++;
}
};
interface.showPlayerCar = function (playerID) {
this.showCar(this.playerCar[this.currentPlayer], 1);
};
interface.showCar = function (carID, dir) {
trace("interface.showCar : " + carID);
this.mc.carSelect.carSelectMovie.nextCar = "car" + carID;
if (0 < dir) {
this.mc.carSelect.carSelectMovie.play();
} else {
this.mc.carSelect.carSelectMovie.startPlayingBackwards();
}
this.mc.carSelect.displayCarDetails(this.cars[carID]);
};
interface.getNextTrack = function () {
this.currentTrackIDsID = this.currentTrackIDsID + 1;
if (this.currentTrackIDsID >= this.trackIDs.length) {
this.currentTrackIDsID = 0;
}
this.displayTrackFromID(this.trackIDs[this.currentTrackIDsID]);
};
interface.getPrevTrack = function () {
this.currentTrackIDsID = this.currentTrackIDsID - 1;
if (this.currentTrackIDsID == -1) {
this.currentTrackIDsID = this.trackIDs.length - 1;
}
this.displayTrackFromID(this.trackIDs[this.currentTrackIDsID]);
};
interface.onSendData = function () {
this.mc.mask.text = "Data being sent... please wait";
this.mc.mask._visible = true;
};
interface.onRawData = function () {
this.mc.mask.text = "Data recieved... processing";
this.mc.mask._visible = true;
};
interface.onAllData = function () {
this.mc.mask._visible = false;
};
Object.prototype.createContentWindow = function (content, x, y, width, height, showCloseButton, hideWindow, adheretocolorscheme) {
if (!_root.windowHolder) {
_root.attachMovie("empty", "windowHolder", 999);
}
clip = _root.windowHolder;
clip.depth++;
clip.attachMovie("window", "window" + clip.depth, clip.depth);
var thisWindow = clip["window" + clip.depth];
thisWindow.onClip = clip;
thisWindow.placeHolder.attachMovie(content, "content", 0);
var twidth = ((width == -1) ? (thisWindow.placeHolder.content._width + (2 * thisWindow.placeHolder._x)) : (width));
var theight = ((height == -1) ? (thisWindow.placeHolder.content._height + (2 * thisWindow.placeHolder._y)) : (height));
thisWindow._visible = false;
thisWindow.width = 40;
thisWindow.height = 40;
thisWindow._x = x;
thisWindow._y = y;
thisWindow.adheretocolorscheme = Boolean(adheretocolorscheme);
thisWindow.hideWindow = hideWindow;
if (!showCloseButton) {
thisWindow.timeOut(1, "hideCloseButton");
}
timeOut(1, "hideContent", "", thisWindow);
timeOut(1, "moveOffScreen", "random,2", thisWindow);
timeOut(1, "placeOnTop", "", thisWindow);
timeOut(4, "moveOnScreen", (((x + ",") + y) + ",") + 15, thisWindow);
timeOut(15, "resizeTo", (twidth + ",") + theight, thisWindow);
timeOut(22, "initContent", "", thisWindow);
return(thisWindow);
};
Object.prototype.setPropFlags("createContentWindow", false, false, true);
Number.prototype.makeSecondsDisplay = function () {
if (isNaN(this)) {
return(undefined);
}
var secs = (this / 1000);
secs = secs.toString();
var decimalPlace = secs.lastIndexOf(".");
if (decimalPlace == -1) {
secs = secs + ".";
decimalPlace = secs.lastIndexOf(".");
}
decimals = (secs.length - decimalPlace) - 1;
i = 3 - decimals;
while (i--) {
secs = secs + "0";
}
return(secs);
};
Instance of Symbol 17 MovieClip in Frame 178
onClipEvent (load) {
btnText = "win";
functionToCall = "winBtn";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Frame 178
onClipEvent (load) {
btnText = "send it on";
functionToCall = "sendBtn";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Frame 178
onClipEvent (load) {
btnText = "video";
functionToCall = "videoBtn";
onEnter = false;
active = "active";
toolTipText = "";
}
Frame 179
stop();
setUpIntroWindows();
stopPlayingBackwards();
Frame 184
stop();
Frame 190
stop();
Instance of Symbol 3 MovieClip "dataConnMC" in Symbol 4 MovieClip [dataConnHolder] Frame 1
onClipEvent (data) {
trace("on data called");
var dataObj = {};
dataObj.copyProps(this);
this.dataConnObj.handleData(dataObj);
}
Instance of Symbol 5 MovieClip [flemEngineClip] in Symbol 6 MovieClip [flemEngine] Frame 1
onClipEvent (load) {
MovieClip.sendFLEMEvent("onLoad");
}
onClipEvent (enterFrame) {
MovieClip.sendFLEMEvent("onEnterFrame");
}
onClipEvent (mouseDown) {
Mouse.sendFLEMEvent("onMouseDown");
}
onClipEvent (mouseUp) {
Mouse.sendFLEMEvent("onMouseUp");
}
onClipEvent (keyDown) {
Key.sendFLEMEvent("onKeyDown");
}
onClipEvent (keyUp) {
Key.sendFLEMEvent("onKeyUp");
}
Symbol 16 Button
on (release) {
onRelease();
}
on (rollOver) {
toolTip(toolTipText);
}
on (keyPress "<Enter>") {
if (onEnter) {
onRelease();
}
}
Symbol 17 MovieClip Frame 1
function setText(str) {
btnText = str;
}
function onRelease() {
trace("onRelease");
_parent[functionToCall]();
}
function makeActive() {
active = "active";
gotoAndStop(active);
}
function setActive(bool) {
if (bool) {
makeActive();
} else {
makeInActive();
}
}
function makeInActive() {
active = "inactive";
gotoAndStop(active);
}
trace(active);
gotoAndStop(active);
Symbol 18 MovieClip [highScoreWin] Frame 1
function close() {
window.close();
}
window = _parent._parent;
createHighScoreList = function (scoreArray, mc) {
trace("createHighScore called");
var i = 10;
while (i--) {
var thisScore = mc.attachMovie("namevaluebig", "score" + i, i + 1);
thisScore.pos = i + 1;
thisScore.initN = scoreArray[i].player;
thisScore.initV = scoreArray[i].time.makeSecondsDisplay();
thisScore._y = i * 15;
}
return(thisScore);
};
showBestTimes = function (t) {
bestTimesMC = attachMovie("empty", "bestTimes", 1);
createHighScoreList(t.getBestTotalTimes(), bestTimesMC);
bestTimesMC._y = 30;
bestTimesMC._x = 10;
lapTimesMC = attachMovie("empty", "lapTimes", 2);
createHighScoreList(t.getBestLapTimes(), lapTimesMC);
lapTimesMC._x = 170;
lapTimesMC._y = 30;
};
window.initContent = function () {
placeHolder.content.showBestTimes(_root.highScoreTrack);
};
Instance of Symbol 17 MovieClip in Symbol 18 MovieClip [highScoreWin] Frame 1
onClipEvent (load) {
btnText = "close";
functionToCall = "close";
onEnter = false;
active = "active";
toolTipText = "";
}
Symbol 28 MovieClip Frame 1
function resetEnds() {
trackEnd1 = {x:50, y:0};
trackEnd2 = {x:0, y:50};
}
function drawQuater(radius) {
var points = new Array();
angle = (Math.PI/2);
accuracy = 100;
d = angle / (radius * (_root.pointsPerCurve / 100));
x = 0 * radius;
y = 1 * radius;
n = 0;
this.moveTo(radius, 0);
var i = angle;
while (d < i) {
n++;
x = Math.round((Math.sin(i) * radius) * accuracy) / accuracy;
y = Math.round((Math.cos(i) * radius) * accuracy) / accuracy;
this.lineStyle(0, 16711680);
this.lineTo(x, y);
point = {x:x, y:y};
localToGlobal(point);
_root.trackHolder.globalToLocal(point);
points.push(point);
i = i - d;
}
return(points);
}
function drawLines() {
line1 = drawQuater(60);
line2 = drawQuater(40);
}
resetEnds();
Symbol 29 MovieClip [blcorner] Frame 1
check1 = {x:1, y:0};
check2 = {x:0, y:-1};
trackType = 6;
Symbol 30 MovieClip [brcorner] Frame 1
check2 = {x:-1, y:0};
check1 = {x:0, y:-1};
trackType = 5;
Symbol 34 MovieClip Frame 1
function resetEnds() {
trackEnd1 = {x:-100, y:-50};
trackEnd2 = {x:0, y:-50};
}
function drawLine(y) {
var points = new Array();
this.moveTo(-100, y);
i = 1;
while (i < noOfPoints) {
x = -100 + (i * spaceBetweenPoints);
this.lineStyle(0, 16711680);
this.lineTo(x, y);
point = {x:x, y:y};
localToGlobal(point);
_root.trackHolder.globalToLocal(point);
points.push(point);
i++;
}
return(points);
}
function drawLines() {
trace("drawlines called");
line1 = drawLine(-60);
line2 = drawLine(-40);
}
resetEnds();
length = 100;
circleRadius = 100;
circleDiameter = (Math.PI*2) * circleRadius;
quarterCircleDia = circleDiameter / 4;
trace(_root.pointsPerCurve);
noOfPoints = _root.pointsPerCurve * (length / quarterCircleDia);
spaceBetweenPoints = length / noOfPoints;
Symbol 35 MovieClip [hstraight] Frame 1
check1 = {x:-1, y:0};
check2 = {x:1, y:0};
trackType = 1;
Symbol 36 MovieClip Frame 1
check1 = {x:-1, y:0};
check2 = {x:1, y:0};
trackType = 0;
Symbol 40 MovieClip [tlcorner] Frame 1
check1 = {x:0, y:1};
check2 = {x:1, y:0};
trackType = 3;
Symbol 41 MovieClip [trcorner] Frame 1
check1 = {x:-1, y:0};
check2 = {x:0, y:1};
trackType = 4;
Symbol 55 MovieClip [car1] Frame 1
stop();
Symbol 63 MovieClip Frame 1
this.attachMovie("empty", "logoHolder", 1);
logoHolder.attachMovie("empty", "holder", 1);
logoHolder._visible = false;
logoHolder.holder.loadMovie(_root.tpswfpath);
logoHolder.onEnterFrame = function () {
if ((this.holder.getBytesLoaded() == this.holder.getBytesTotal()) && (10 < this.holder.getBytesTotal())) {
delete this.onEnterFrame;
MovieClip.removeFLEMListener(this);
this._x = (this._parent._width - this.holder._width) / 2;
this._y = ((this._parent._height - 30) - this.holder._height) / 2;
this._visible = true;
}
};
MovieClip.addFLEMListener(logoHolder);
Symbol 76 MovieClip [vstraight] Frame 1
check1 = {x:0, y:-1};
check2 = {x:0, y:1};
trackType = 2;
Symbol 84 MovieClip Frame 1
_visible = false;
Symbol 86 MovieClip Frame 17
gotoAndPlay (1);
Symbol 90 Button
on (release) {
gotoAndPlay (11);
}
Symbol 99 Button
on (release) {
_parent.interface.getPrevTrack();
}
Symbol 100 Button
on (release) {
_parent.interface.getNextTrack();
}
Symbol 101 MovieClip Frame 1
function buildTrack(track) {
for (var i in this) {
this[i].removeMovieClip();
}
var tileArray = track.getTileArray();
var i = tileArray.length;
var max = i;
var waitTime = 1;
while (i--) {
this.addPart(tileArray[i][0], tileArray[i][1], tileArray[i][2], i);
waitTime = waitTime + 2;
}
}
function addPart(partType, x, y, i) {
this.attachMovie("trackLayoutViewer.trackParts", "part" + i, i);
var thisPart = this["part" + i];
thisPart._x = x * 20;
thisPart._y = y * 20;
thisPart.gotoAndStop(partType);
}
sf.stop();
Symbol 102 MovieClip Frame 1
function displayTrack(track) {
track1.buildTrack(track);
track2.buildTrack(track);
}
Symbol 107 MovieClip [namevalue] Frame 1
function setDisplay(n, v) {
(name = n + " :");
(value = (((v == "") || (v == undefined)) ? "no record" : (v)));
}
setDisplay(initN, initV);
Symbol 111 MovieClip Frame 1
function displayTrack(t) {
trace("lap record time : " + t.getLapRecord().time);
trackDisplay.displayTrack(t);
currentTrack = t;
name.text = t.getName();
laps.setDisplay("Laps", t.getTotalLaps());
bestTime.setDisplay("best time", t.getTrackRecord().time.makeSecondsDisplay());
bestTimePlayer.setDisplay("by", t.getTrackRecord().player);
bestLap.setDisplay("best lap", t.getLapRecord().time.makeSecondsDisplay());
bestLapPlayer.setDisplay("by", t.getLapRecord().player);
createdBy.setDisplay("created by", t.getCreatedBy());
}
function showAllScores() {
_root.showScoreWindow(currentTrack);
}
Instance of Symbol 17 MovieClip in Symbol 111 MovieClip Frame 1
onClipEvent (load) {
btnText = "more scores...";
functionToCall = "showAllScores";
onEnter = false;
active = "active";
toolTipText = "";
}
Symbol 113 Button
on (release) {
play();
}
Symbol 120 Button
on (release) {
_parent.interface.buildYourOwn();
}
Symbol 122 Button
on (release) {
_parent.interface.getPrevCar();
}
Symbol 123 Button
on (release) {
_parent.interface.getNextCar();
}
Symbol 138 MovieClip [car2] Frame 1
stop();
Symbol 152 MovieClip [car3] Frame 1
stop();
Symbol 166 MovieClip [car4] Frame 1
stop();
Symbol 177 MovieClip [car5] Frame 1
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 2
gotoAndPlay(nextCar);
Symbol 178 MovieClip Frame 6
gotoAndStop(nextCar + "end");
Symbol 178 MovieClip Frame 13
stop();
stopPlayingBackwards();
Symbol 178 MovieClip Frame 19
gotoAndPlay(nextCar);
Symbol 178 MovieClip Frame 20
gotoAndStop(nextCar + "end");
Symbol 178 MovieClip Frame 27
stop();
stopPlayingBackwards();
Symbol 178 MovieClip Frame 33
gotoAndPlay(nextCar);
Symbol 178 MovieClip Frame 34
gotoAndStop(nextCar + "end");
Symbol 178 MovieClip Frame 41
stop();
stopPlayingBackwards();
Symbol 178 MovieClip Frame 47
gotoAndPlay(nextCar);
Symbol 178 MovieClip Frame 48
gotoAndStop(nextCar + "end");
Symbol 178 MovieClip Frame 55
stop();
stopPlayingBackwards();
Symbol 178 MovieClip Frame 61
gotoAndPlay(nextCar);
Symbol 178 MovieClip Frame 68
stop();
stopPlayingBackwards();
Symbol 178 MovieClip Frame 74
gotoAndPlay(nextCar);
Symbol 182 MovieClip Frame 1
function setBar(value) {
this.bar.tscale = value * 100;
MovieClip.addFLEMListener(bar);
}
this.bar.onEnterFrame = function () {
var dx = (this.tscale - this._xscale);
if (0.2 < Math.abs(dx)) {
this._xscale = this._xscale + (dx / 3);
this._parent.barbg._xscale = this._xscale;
} else {
MovieClip.removeFLEMListener(this);
}
};
Symbol 183 MovieClip Frame 1
function setDisplay(n, v) {
(name = n + " :");
bar.setBar(v);
trace(v);
}
name = "";
value = "";
Symbol 186 Button
on (release) {
this.toggleState();
}
Symbol 188 MovieClip Frame 1
function toggleState() {
this.setState(!this.state);
this._parent._parent.interface.setComControl(this.state);
}
function setState(newState) {
this.state = newState;
this.gotoAndStop((newState ? "on" : "off"));
}
Symbol 189 MovieClip Frame 1
function displayCarDetails(car) {
name.text = car.name;
speed.setDisplay("Speed", car.speed);
accel.setDisplay("Accel", car.accel);
brakeing.setDisplay("Brakes", car.brakeing);
grip.setDisplay("Grip", car.grip);
}
Symbol 193 Button
on (release) {
startPlayingBackwards();
}
Symbol 207 Button
on (release) {
play();
_root.play();
}
Symbol 209 MovieClip Frame 1
_root.setBuildStatusMc(this);
setStatus = function (str) {
status = str;
};
complete = function () {
_parent.play();
};
Symbol 217 MovieClip Frame 12
fr = this._currentFrame - Math.round(Math.random() * this._currentFrame);
gotoAndPlay(fr);
Symbol 222 Button
on (release) {
play();
}
Symbol 223 MovieClip [userinterface] Frame 1
stop();
trace("userinterfaceon");
interface = _root.interface;
window = _parent._parent;
interface.setInterfaceMovie(this);
Symbol 223 MovieClip [userinterface] Frame 4
play();
Symbol 223 MovieClip [userinterface] Frame 7
stop();
Symbol 223 MovieClip [userinterface] Frame 11
play();
Symbol 223 MovieClip [userinterface] Frame 15
stop();
stopPlayingBackwards();
interface.getTracks();
Symbol 223 MovieClip [userinterface] Frame 20
if (interface.buildOwn) {
gotoAndPlay (71);
}
Symbol 223 MovieClip [userinterface] Frame 25
stop();
stopPlayingBackwards();
interface.showPlayer(1);
Symbol 223 MovieClip [userinterface] Frame 35
stop();
stopPlayingBackwards();
interface.showPlayer(2);
Symbol 223 MovieClip [userinterface] Frame 45
stop();
interface.showChoices();
Symbol 223 MovieClip [userinterface] Frame 55
stop();
interface.buildTrack();
_root.animWin.close();
Symbol 223 MovieClip [userinterface] Frame 65
stop();
interface.showChoices2();
Symbol 223 MovieClip [userinterface] Frame 70
stop();
interface.playTrack();
window.close();
Symbol 223 MovieClip [userinterface] Frame 75
stop();
Symbol 223 MovieClip [userinterface] Frame 80
stop();
interface.buildYourOwnTrack();
_root.animWin.close();
window.close();
_root.play();
Symbol 224 Button
on (press) {
window.startDrag();
}
on (release) {
window.stopDrag();
}
Symbol 227 Button
on (press) {
_root.startDragTrack(pieceName);
}
on (release, releaseOutside) {
_root.stopDragTrack(true);
}
Symbol 228 MovieClip Frame 1
this.attachMovie(pieceName, "trackPart", 1);
Symbol 230 MovieClip [trackEditWindow] Frame 1
function inactivateAll() {
buildTrackBtn.setActive(false);
testTrackBtn.setActive(false);
saveTrackBtn.setActive(false);
clearTrackBtn.setActive(false);
clearCarsBtn.setActive(false);
}
function buildTrack() {
_root.createTrack();
inactivateAll();
}
function trackBuilt() {
testTrackBtn.setActive(true);
saveTrackBtn.setActive(true);
clearTrackBtn.setActive(true);
buildTrackBtn.setActive(false);
}
function testTrack() {
_root.testTrack();
inactivateAll();
clearTrackBtn.setActive(true);
clearCarsBtn.setActive(true);
}
function saveTrack() {
if (saveWin._name == undefined) {
saveWin = createContentWindow("saveTrackWindow", "center", "middle", 300, 200, true);
}
}
function clearTrack() {
inactivateAll();
_root.clearTrack();
}
function clearCars() {
_root.clearCars();
_root.makeTrackDragable();
testTrackBtn.setActive(true);
saveTrackBtn.setActive(true);
clearTrackBtn.setActive(true);
clearCarsBtn.setActive(false);
}
window = _parent._parent;
inactivateAll();
Instance of Symbol 228 MovieClip in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
pieceName = "blcorner";
}
Instance of Symbol 228 MovieClip in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
pieceName = "brcorner";
}
Instance of Symbol 228 MovieClip in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
pieceName = "tlcorner";
}
Instance of Symbol 228 MovieClip in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
pieceName = "trcorner";
}
Instance of Symbol 228 MovieClip in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
pieceName = "hstraight";
}
Instance of Symbol 228 MovieClip in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
pieceName = "vstraight";
}
Instance of Symbol 17 MovieClip "buildTrackBtn" in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
btnText = "build track";
functionToCall = "buildTrack";
onEnter = false;
active = "inactive";
toolTipText = "";
}
Instance of Symbol 17 MovieClip "testTrackBtn" in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
btnText = "test track";
functionToCall = "testTrack";
onEnter = false;
active = "inactive";
toolTipText = "";
}
Instance of Symbol 17 MovieClip "saveTrackBtn" in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
btnText = "save track";
functionToCall = "saveTrack";
onEnter = false;
active = "inactive";
toolTipText = "";
}
Instance of Symbol 17 MovieClip "clearTrackBtn" in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
btnText = "clear track";
functionToCall = "clearTrack";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip "clearCarsBtn" in Symbol 230 MovieClip [trackEditWindow] Frame 1
onClipEvent (load) {
btnText = "clear cars";
functionToCall = "clearCars";
onEnter = false;
active = "active";
toolTipText = "";
}
Symbol 238 MovieClip Frame 1
if (password) {
gotoAndStop (5);
} else {
stop();
}
text = _parent[_name + "text"];
Symbol 247 MovieClip [saveTrackWindow] Frame 1
function tryAgain() {
gotoAndStop (1);
}
function saveTrack() {
lapsText = Math.min(9, parseInt(laps.text));
trackNameText = trackName.text;
checkLoginAndSave();
}
function checkLoginAndSave() {
if (_root.player) {
gotoAndStop (17);
this.dc.saveTrack(lapsText, trackNameText, _root.currentTrack.getTileString());
} else {
gotoAndStop (5);
}
}
function cancel() {
window.close();
}
function continueGame() {
window.close();
_root.restartGame();
}
function login() {
_root.showLoginWindow();
gotoAndStop (10);
}
function onTrackSaved(dataObj) {
var status = parseInt(dataObj.status);
if (status == 0) {
gotoAndStop (31);
} else {
gotoAndStop (24);
}
}
this.dc = _root.dc;
window = _parent._parent;
dc.addFLEMListener(this);
stop();
Instance of Symbol 238 MovieClip "trackName" in Symbol 247 MovieClip [saveTrackWindow] Frame 1
onClipEvent (load) {
label = "track name";
text = "trackNameText";
password = false;
}
Instance of Symbol 238 MovieClip "laps" in Symbol 247 MovieClip [saveTrackWindow] Frame 1
onClipEvent (load) {
label = "No of Laps";
text = "lapsText";
password = false;
}
Instance of Symbol 17 MovieClip in Symbol 247 MovieClip [saveTrackWindow] Frame 1
onClipEvent (load) {
btnText = "save";
functionToCall = "saveTrack";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 247 MovieClip [saveTrackWindow] Frame 1
onClipEvent (load) {
btnText = "cancel";
functionToCall = "cancel";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 247 MovieClip [saveTrackWindow] Frame 5
onClipEvent (load) {
btnText = "login";
functionToCall = "login";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 247 MovieClip [saveTrackWindow] Frame 10
onClipEvent (load) {
btnText = "try again";
functionToCall = "checkLoginAndSave";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 247 MovieClip [saveTrackWindow] Frame 24
onClipEvent (load) {
btnText = "try again";
functionToCall = "tryAgain";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 247 MovieClip [saveTrackWindow] Frame 31
onClipEvent (load) {
btnText = "continue";
functionToCall = "continueGame";
onEnter = false;
active = "active";
toolTipText = "";
}
Symbol 248 Button
on (press) {
_parent._parent.startDragTrack2(this);
}
on (release, releaseOutside) {
_parent._parent.stopDragTrack(true);
}
Symbol 249 MovieClip [dragablePiece] Frame 1
stop();
Symbol 253 Button
on (release) {
gotoRegister();
}
Instance of Symbol 260 MovieClip in Symbol 261 MovieClip Frame 1
onClipEvent (load) {
if (_parent.style.toUpperCase() == "AUTO") {
playerVersion = getVersion();
_parent.platform = playerVersion.substr(0, 3);
} else {
_parent.platform = _parent.style.toUpperCase();
}
_parent.child = this;
_parent.getLabel = function () {
return(child.label);
};
_parent.getState = function () {
return(child.checked);
};
_parent.setLabel = function (label) {
child.label = label;
};
_parent.setState = function (state) {
child.checked = state;
if (state) {
if (platform == "MAC") {
child.gotoandstop(4);
} else {
child.gotoandstop(2);
}
} else if (platform == "MAC") {
child.gotoandstop(3);
} else {
child.gotoandstop(1);
}
};
}
onClipEvent (load) {
stop();
label = _parent.label;
_parent.setState(_parent._parent[_parent._name + "State"]);
}
onClipEvent (mouseDown) {
if (hitTest(_root._xmouse, _root._ymouse, false)) {
if (_parent.getState()) {
_parent.setState(false);
} else {
_parent.setState(true);
}
updateAfterEvent();
}
}
Symbol 264 Button
on (release) {
gotoLogin();
}
on (rollOver) {
toolTip("back to the login screen");
}
Symbol 267 Button
on (release) {
gotoRegister();
}
on (rollOver) {
toolTip("register as a new player");
}
Symbol 270 MovieClip [login] Frame 1
function gotoRegister() {
this.gotoAndStop("register");
}
function gotoLogin() {
this.gotoAndStop("login");
}
function privacyPolicy() {
_root.showPrivacyPolicy();
}
function login(u, p) {
usernameText = u;
passwordText = p;
var success = 0;
var messages = new Array();
messages[1] = "You have not entered a valid username (must be more than 5 characters).";
messages[2] = "You have not entered a valid password (must be more than 5 characters).";
var returnCode = dc.login(u, p);
if (returnCode == success) {
this.gotoAndStop("loginWait");
} else {
message = messages[returnCode];
this.gotoAndStop("loginError");
}
}
function loginUser() {
login(username.text, password.text);
}
function registerBack() {
gotoAndStop (7);
}
function registerUser() {
firstname = fullname.text.split(" ")[0];
surname = fullname.text.split(" ")[1];
if (surname == undefined) {
surname = "not given";
}
trace(surname);
fullnameText = fullname.text;
emailText = email.text;
usernameText = username.text;
passwordText = password.text;
mobileText = mobile.text;
optin1State = optin1.getState();
optin2State = optin2.getState();
register(firstName, surname, emailText, usernameText, passwordText, mobileText, optin1State, optin2State);
}
function gotParentalConsent() {
register(emailText, usernameText, passwordText, smsText, optinState, dobAge);
}
function register(firstname, surname, email, username, password, sms, optin1, optin2) {
var success = 0;
var messages = new Array(null);
messages[1] = "you did not enter a valid email address. emails should have the form : name@domain.com";
messages[2] = "the username you entered is not valid. your username should be at least 5 characters long";
messages[3] = "the password you entered is not valid. your password should be at least 5 characters long";
messages[4] = "the mobile phone number you entered is not valid. you should enter an 11 digit number eg '07123123456'";
messages[5] = "the optin value did not work!";
messages[6] = "you did not enter your full name. Please try again.";
optin1 = (optin1 ? 1 : 0);
optin2 = (optin2 ? 1 : 0);
var returnCode = dc.registerPlayer(firstName, surname, email, username, password, sms, optin1, optin2, _root.tpname);
if (returnCode == success) {
this.gotoAndStop("registerWait");
} else {
Message = messages[returnCode];
this.gotoAndStop("registerError");
}
}
function registerFailure(returnCode) {
Message = "Sorry, you couldn't be registered. Your email address or Driver name has already been registered - please try again.";
this.gotoAndStop("registerError");
}
function registerSuccess() {
Message = "Success";
this.gotoAndPlay("registerSuccess");
_root.newUser = true;
_root.player = {username:usernameText, password:passwordText};
}
function loginFailure() {
message = "Either your username does not exist or the password you supplied was incorrect. \nClick below if you have not registered.";
this.gotoAndStop("loginError");
}
function loginSuccess() {
this.gotoAndStop("loginSuccess");
_root.loginSuccess();
_root.player = {username:usernameText, password:passwordText};
this.window.close();
}
function onRegisterPlayer(dataObj) {
if (dataObj.status == 0) {
registerSuccess();
} else {
registerFailure(dataObj.status);
}
}
function onLogin(dataObj) {
trace(dataObj.status);
if (dataObj.status == 0) {
loginSuccess();
} else {
loginFailure();
}
}
stop();
window = _parent._parent;
emailText = "";
usernameText = "";
passwordText = "";
mobileText = "";
fullnameText = "";
optin1State = true;
optin2State = true;
ref = _root.tpname;
dc = _root.dc;
dc.addFLEMListener(this);
_root.newUser = false;
Instance of Symbol 238 MovieClip "password" in Symbol 270 MovieClip [login] Frame 1
onClipEvent (load) {
label = "password";
text = "password";
password = true;
}
Instance of Symbol 238 MovieClip "username" in Symbol 270 MovieClip [login] Frame 1
onClipEvent (load) {
label = "Driver Name";
text = "username";
password = false;
}
Instance of Symbol 17 MovieClip "loginButton" in Symbol 270 MovieClip [login] Frame 1
onClipEvent (load) {
btnText = "login";
functionToCall = "loginUser";
onEnter = true;
active = "active";
toolTipText = "login and play!";
}
Instance of Symbol 17 MovieClip "privacyButton" in Symbol 270 MovieClip [login] Frame 1
onClipEvent (load) {
btnText = "privacy";
functionToCall = "privacyPolicy";
onEnter = false;
active = "active";
toolTipText = "read the privacy policy";
}
Symbol 270 MovieClip [login] Frame 7
stop();
Instance of Symbol 261 MovieClip "optin2" in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
_name = "optin2";
checked = "true";
label = "";
style = "Win";
}
onClipEvent (load) {
if (((_root.tpname == "none") || (_root.tpname == "stf")) || (_root.tpname == undefined)) {
this._visible = false;
} else {
this.label = ("Yes, I would like to join the " + _root.tpname) + " Newsletter";
}
}
Instance of Symbol 261 MovieClip "optin1" in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
_name = "optin1";
checked = "true";
label = "Yes, I would like to join the Puretone Newsletter";
style = "Win";
}
Instance of Symbol 238 MovieClip "password" in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
label = "password";
text = "passwordText";
password = true;
}
Instance of Symbol 238 MovieClip "username" in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
label = "Driver Name";
text = "usernameText";
password = false;
}
Instance of Symbol 238 MovieClip "mobile" in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
label = "mobile";
text = "mobileText";
password = false;
}
Instance of Symbol 238 MovieClip "email" in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
label = "email";
text = "emailText";
password = false;
}
Instance of Symbol 238 MovieClip "fullname" in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
label = "Full Name";
text = "fullnameText";
password = false;
}
Instance of Symbol 17 MovieClip "privacyButton" in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
btnText = "privacy";
functionToCall = "privacyPolicy";
onEnter = false;
active = "active";
toolTipText = "read the privacy policy";
}
Instance of Symbol 17 MovieClip in Symbol 270 MovieClip [login] Frame 7
onClipEvent (load) {
btnText = "next";
functionToCall = "registerUser";
onEnter = true;
active = "active";
toolTipText = "register to play!";
}
Instance of Symbol 17 MovieClip in Symbol 270 MovieClip [login] Frame 30
onClipEvent (load) {
btnText = "try again";
functionToCall = "gotoRegister";
onEnter = true;
active = "active";
toolTipText = "";
}
Symbol 270 MovieClip [login] Frame 47
login(_root.player.username, _root.player.password);
Symbol 270 MovieClip [login] Frame 55
gotoAndStop (96);
Instance of Symbol 17 MovieClip in Symbol 270 MovieClip [login] Frame 73
onClipEvent (load) {
btnText = "try again";
functionToCall = "gotoLogin";
onEnter = true;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip "loginButton" in Symbol 270 MovieClip [login] Frame 81
onClipEvent (load) {
btnText = "close";
functionToCall = "closeWindow";
onEnter = true;
active = "active";
toolTipText = "login and play!";
}
Symbol 272 MovieClip Frame 15
gotoAndPlay (1);
Symbol 274 MovieClip Frame 15
gotoAndPlay (1);
Symbol 279 MovieClip [results] Frame 1
function enterTime() {
if (_root.player) {
gotoAndStop (1);
dc.saveTrackScore(_root.currentTrack.getID(), winningCar.timerConsol.raceTime, winningCar.timerConsol.bestLapTime);
} else {
gotoAndStop (22);
}
}
function showScores() {
_root.showScoreWindow(_root.currentTrack);
}
function onSaveTrackScore() {
gotoAndStop (49);
}
function login() {
_root.showLoginWindow();
gotoAndStop (40);
}
function restartRace() {
window.close();
_root.restartRace();
}
function restartGame() {
window.close();
_root.restartGame();
}
winningCar = _root.winningCar;
trace(winningCar.playerNo);
if (winningCar.com) {
gotoAndStop (5);
} else {
gotoAndStop (13);
}
window = _parent._parent;
dc = _root.dc;
dc.addFLEMlistener(this);
Instance of Symbol 17 MovieClip in Symbol 279 MovieClip [results] Frame 1
onClipEvent (load) {
btnText = "restart race";
functionToCall = "restartRace";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 279 MovieClip [results] Frame 1
onClipEvent (load) {
btnText = "restart game";
functionToCall = "restartGame";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 279 MovieClip [results] Frame 13
onClipEvent (load) {
btnText = "enter time";
functionToCall = "enterTime";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 279 MovieClip [results] Frame 22
onClipEvent (load) {
btnText = "login";
functionToCall = "login";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 279 MovieClip [results] Frame 40
onClipEvent (load) {
btnText = "try again";
functionToCall = "enterTime";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 279 MovieClip [results] Frame 49
onClipEvent (load) {
btnText = "see scores";
functionToCall = "showScores";
onEnter = false;
active = "active";
toolTipText = "";
}
Symbol 315 Button
on (release) {
_parent.close();
}
on (rollOver) {
toolTip("close");
}
Symbol 317 MovieClip [window] Frame 1
function flicker() {
}
function setMasterColors(bc, cc) {
this.borderColor = bc;
this.contentColor = cc;
this.changeColors(bc, cc);
}
function changeColors(bc, cc) {
if (typeof(bc) == "string") {
bc = parseInt(bc);
}
if (typeof(cc) == "string") {
cc = parseInt(cc);
}
changeBorderColor(bc);
changeContentColor(cc);
}
function changeBorderColor(hex) {
var i = mainWindowMcs.length;
while (i--) {
var col = new color(this[mainWindowMcs[i]].skin.border);
col.setRGB(hex);
}
}
function placeOnTop() {
this.swapDepths(9999);
}
function toggleWindow() {
if (hideWindow == undefined) {
hideWindow = false;
}
hideWindow = (hideWindow ? false : true);
var i = mainWindowMcs.length;
while (i--) {
this[mainWindowMcs[i]]._visible = (hideWindow ? true : false);
}
}
function toggleShadow() {
if (shadowOn == undefined) {
shadowOn = true;
}
shadowOn = (shadowOn ? false : true);
var i = shadowWindowMcs.length;
while (i--) {
this[shadowWindowMcs[i]]._visible = shadowOn;
}
}
function changeContentColor(hex) {
if (typeof(hex) == "string") {
hex = parseInt(hex);
}
var i = mainWindowMcs.length;
while (i--) {
var col = new color(this[mainWindowMcs[i]].skin.content);
col.setRGB(hex);
}
this.contentColor = hex;
}
function loadContent(idName) {
this.placeHolder.attachMovie(idName, "content", 0);
}
function resize() {
if (!hideWindow) {
if (this.xAlign == "right") {
this._x = this.MAXX - this.width;
} else if (this.xAlign == "center") {
this._x = this.MIDX - (this.width / 2);
}
if (this.yAlign == "bottom") {
this._y = this.MAXY - this.height;
} else if (this.yAlign == "middle") {
this._y = this.MIDY - (this.height / 2);
}
this._xscale = 100;
this._yscale = 100;
this.top._x = this.topLeft._width;
this.top._y = 0;
this.top._width = this.width - (this.topLeft._width + this.topRight._width);
this.topRight._x = this.width;
this.topRight._y = 0;
this.right._x = this.width;
this.right._y = this.topRight._height;
this.right._height = this.height - (this.topRight._height + this.bottomRight._height);
this.bottomRight._x = this.width;
this.bottomRight._y = this.height;
this.bottom._x = this.bottomLeft._width;
this.bottom._y = this.height;
this.bottom._width = this.width - (this.bottomLeft._width + this.bottomRight._width);
this.left._x = 0;
this.left._y = this.topLeft._height;
this.left._height = this.height - (this.topLeft._height + this.bottomLeft._height);
this.bottomLeft._x = 0;
this.bottomLeft._y = this.height;
this.center._x = this.left._width;
this.center._y = this.top._height;
this.center._width = this.top._width;
this.center._height = this.left._height;
this.closeButton._x = this.width - this.topRight._width;
this.closeButton._y = this.topRight._height;
if ((SHADOWDX != 0) || (SHADOWDY != 0)) {
this.topShadow._x = this.top._x + shadowDX;
this.topShadow._y = this.top._y + shadowDY;
this.topShadow._width = this.top._width;
this.bottomLeftShadow._x = this.bottomLeft._x + shadowDX;
this.bottomLeftShadow._y = this.bottomLeft._y + shadowDY;
this.leftShadow._x = this.left._x + shadowDX;
this.leftShadow._y = this.left._y + shadowDY;
this.leftShadow._height = this.left._height;
this.bottomShadow._x = this.bottom._x + shadowDX;
this.bottomShadow._y = this.bottom._y + shadowDY;
this.bottomShadow._width = this.bottom._width;
this.bottomRightShadow._x = this.bottomRight._x + shadowDX;
this.bottomRightShadow._y = this.bottomRight._y + shadowDY;
this.bottomRightShadow._x = this.bottomRight._x + shadowDX;
this.bottomRightShadow._y = this.bottomRight._y + shadowDY;
this.rightShadow._x = this.right._x + shadowDX;
this.rightShadow._y = this.right._y + shadowDY;
this.rightShadow._height = this.right._height;
this.topRightShadow._x = this.topRight._x + shadowDX;
this.topRightShadow._y = this.topRight._y + shadowDY;
}
}
}
function resizeTo(w, h, inner) {
if (w < 0) {
w = this.width;
}
if (h < 0) {
h = this.height;
}
if (inner) {
w = w + (this.topLeft._width + this.topRight._width);
h = h + (this.topLeft._height + this.bottomLeft._height);
}
this.targetWidth = w;
this.targetHeight = h;
this.initialWidth = ((this.initialWidth == undefined) ? (w) : (this.initialWidth));
this.initialHeight = ((this.initialHeight == undefined) ? (h) : (this.initialHeight));
debug((((("resizing " + this._name) + " to : ") + w) + ",") + h);
this.RESIZETIME = 6;
this.hideContent();
timeOut(this.RESIZETIME, "showContent", "", this);
this.tweenObject(this, "width", w, this.RESIZETIME, "easeInOutQuad");
this.tweenObject(this, "height", h, this.RESIZETIME, "easeInOutQuad");
var counter = new Object();
counter.t = 0;
counter.window = this;
counter.onEnterFrame = function () {
if ((this.window.RESIZETIME + 2) >= this.t) {
this.window.resize();
this.t++;
} else {
this.window.width = this.window.targetWidth;
this.window.height = this.window.targetHeight;
this.window.resize();
MovieClip.removeFLEMListener(this);
}
};
MovieClip.addFLEMListener(counter);
}
function showContent() {
this.placeHolder._alpha = 0;
this.placeHolder._visible = true;
this.tweenObject(this.placeHolder, "_alpha", 100, 10, "easeInQuad");
}
function hideContent() {
this.placeHolder._visible = false;
}
function showCloseButton() {
this.closeButton._visible = true;
}
function hideCloseButton() {
this.closeButton._visible = false;
}
function close() {
this.hideContent();
this.resizeTo(40, 40);
this.moveOffScreen("top", 10);
timeOut(11, "removeMovieClip", "", this);
playSound("swoosh1");
}
function moveOffScreen(side, t) {
side = side.toLowerCase();
var x = this._x;
var y = this._y;
if (side == "left") {
x = this.MINX - this._width;
} else if (side == "right") {
x = this.MAXX;
} else if (side == "top") {
y = this.MINY - this._height;
} else if (side == "bottom") {
y = this.MAXY;
} else {
x = ((0.5 < Math.random()) ? (this.MINX - this._width) : (this.MAXX));
y = ((0.5 < Math.random()) ? (this.MINY - this._height) : (this.MAXY));
}
this.moveIntoPosition(x, y, t);
}
function moveOnScreen(x, y, t) {
this._visible = true;
this.moveIntoPosition(x, y, t);
}
function moveIntoPosition(x, y, t) {
this.xAlign = x;
this.yAlign = y;
if (x.toLowerCase() == "left") {
x = this.MINX;
} else if (x.toLowerCase() == "right") {
x = this.MAXX - this.width;
} else if (x.toLowerCase() == "center") {
x = this.MIDX - (this.width / 2);
}
if (y.toLowerCase() == "top") {
y = this.MINY;
} else if (y.toLowerCase() == "bottom") {
y = this.MAXY - this.height;
} else if (y.toLowerCase() == "middle") {
y = this.MIDY - (this.height / 2);
}
this.tweenObject(this, "_x", x, t, "easeInOutQuad");
this.tweenObject(this, "_y", y, t, "easeInOutQuad");
}
SHADOWDX = 5;
SHADOWDY = 5;
MINY = 10;
MINX = 10;
MAXX = 710;
MAXY = 490;
MIDX = MINX + ((MAXX - MINX) / 2);
MIDY = MINY + ((MAXY - MINY) / 2);
this.width = ((this.width == undefined) ? (this._width) : (this.width));
this.height = ((this.height == undefined) ? (this._height) : (this.height));
mainWindowMcs = new Array("topLeft", "top", "topRight", "right", "bottomRight", "bottom", "bottomLeft", "left", "center");
shadowWindowMcs = new Array("topLeftShadow", "topShadow", "topRightShadow", "rightShadow", "bottomRightShadow", "bottomShadow", "bottomLeftShadow", "leftShadow");
resize();
toggleShadow();
if (hideWindow) {
toggleWindow();
}
Symbol 326 MovieClip [trafficlights] Frame 114
_root.startGame();
Symbol 326 MovieClip [trafficlights] Frame 137
this.tweenObject("", "_y", -200, 20, "linearTween");
stop();
Symbol 330 MovieClip [packclip] Frame 182
gotoAndPlay (1);
Symbol 334 MovieClip [namevaluebig] Frame 1
function setDisplay(pos, n, v) {
posValue = pos;
(name = n);
(value = (((v == "") || (v == undefined)) ? "no record" : (v)));
}
setDisplay(pos, initN, initV);
Symbol 346 MovieClip [sendWin] Frame 1
function sendItOn() {
gotoAndStop (7);
}
function onMailSent() {
this.gotoAndStop("sent");
}
function sendMail() {
if (username.text.length == 0) {
errorMsg = "You must enter a name!";
return(undefined);
}
if (!usermail.text.isEmail()) {
errorMsg = "You must enter a valid email address!";
return(undefined);
}
if (!friendmail_1.text.isEmail()) {
errorMsg = "You must enter a valid friends email address!";
return(undefined);
}
dc.sendToFriend(username.text, usermail.text, friendmail_1.text, friendmail_2.text, friendmail_3.text, optin1.getState(), optin2.getState(), _root.tpname);
gotoAndStop (13);
}
function close() {
window.close();
}
stop();
dc = _root.dc;
dc.addFLEMListener(this);
window = _parent._parent;
optin1State = true;
optin2State = true;
Instance of Symbol 17 MovieClip in Symbol 346 MovieClip [sendWin] Frame 1
onClipEvent (load) {
btnText = "send it on";
functionToCall = "sendItOn";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 346 MovieClip [sendWin] Frame 7
onClipEvent (load) {
btnText = "send";
functionToCall = "sendMail";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 238 MovieClip "friendmail_1" in Symbol 346 MovieClip [sendWin] Frame 7
onClipEvent (load) {
label = "friend 1 email";
text = "text";
password = false;
}
Instance of Symbol 238 MovieClip "friendmail_2" in Symbol 346 MovieClip [sendWin] Frame 7
onClipEvent (load) {
label = "friend 2 email";
text = "text";
password = false;
}
Instance of Symbol 238 MovieClip "friendmail_3" in Symbol 346 MovieClip [sendWin] Frame 7
onClipEvent (load) {
label = "friend 3 email";
text = "text";
password = false;
}
Instance of Symbol 238 MovieClip "username" in Symbol 346 MovieClip [sendWin] Frame 7
onClipEvent (load) {
label = "your name";
text = "text";
password = false;
}
Instance of Symbol 238 MovieClip "usermail" in Symbol 346 MovieClip [sendWin] Frame 7
onClipEvent (load) {
label = "your email";
text = "text";
password = false;
}
Instance of Symbol 261 MovieClip "optin1" in Symbol 346 MovieClip [sendWin] Frame 7
onClipEvent (load) {
_name = "optin1";
checked = "true";
label = "Yes, I would like to join the Puretone Newsletter";
style = "Win";
}
Instance of Symbol 261 MovieClip "optin2" in Symbol 346 MovieClip [sendWin] Frame 7
onClipEvent (load) {
_name = "optin2";
checked = "true";
label = "";
style = "Win";
}
onClipEvent (load) {
if (((_root.tpname == "none") || (_root.tpname == "stf")) || (_root.tpname == undefined)) {
this._visible = false;
} else {
this.label = ("Yes, I would like to join the " + _root.tpname) + " Newsletter";
}
}
Instance of Symbol 17 MovieClip in Symbol 346 MovieClip [sendWin] Frame 13
onClipEvent (load) {
btnText = "close";
functionToCall = "close";
onEnter = false;
active = "inactive";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 346 MovieClip [sendWin] Frame 19
onClipEvent (load) {
btnText = "close";
functionToCall = "close";
onEnter = false;
active = "active";
toolTipText = "";
}
Symbol 353 Button
on (release) {
viewVideo();
}
Symbol 358 MovieClip [videoWin] Frame 1
function login() {
_root.showLoginWindow();
gotoAndStop (15);
}
function viewVideo() {
if (_root.player) {
gotoAndStop (21);
} else {
gotoAndStop (7);
}
}
function lowVid() {
_root.openVideo("http://www.sonymusiceurope.com/cgi-bin/multimedia/wmwax?wm.sony-aoma.global.speedera.net&wm.sony-aoma.global/video/900020000003491.wmv");
}
function medVid() {
_root.openVideo("http://www.sonymusiceurope.com/cgi-bin/multimedia/wmwax?wm.sony-aoma.global.speedera.net&wm.sony-aoma.global/video/900020000003492.wmv");
}
function highVid() {
_root.openVideo("http://www.sonymusiceurope.com/cgi-bin/multimedia/wmwax?wm.sony-aoma.global.speedera.net&wm.sony-aoma.global/video/900020000003493.wmv");
}
stop();
Instance of Symbol 17 MovieClip in Symbol 358 MovieClip [videoWin] Frame 7
onClipEvent (load) {
btnText = "login";
functionToCall = "login";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 358 MovieClip [videoWin] Frame 21
onClipEvent (load) {
btnText = "Low Quality";
functionToCall = "lowVid";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 358 MovieClip [videoWin] Frame 21
onClipEvent (load) {
btnText = "Med Quality";
functionToCall = "medVid";
onEnter = false;
active = "active";
toolTipText = "";
}
Instance of Symbol 17 MovieClip in Symbol 358 MovieClip [videoWin] Frame 21
onClipEvent (load) {
btnText = "High Quality";
functionToCall = "highVid";
onEnter = false;
active = "active";
toolTipText = "";
}
Symbol 367 MovieClip Frame 87
gotoAndPlay (1);
Symbol 373 Button
on (release) {
getURL ("http://www.holler.co.uk/", "_blank");
}
Symbol 374 MovieClip [credits] Frame 1
function close() {
this._parent._parent.close();
}
Instance of Symbol 17 MovieClip in Symbol 374 MovieClip [credits] Frame 1
onClipEvent (load) {
btnText = "close";
functionToCall = "close";
onEnter = false;
active = "active";
toolTipText = "";
}
Symbol 375 MovieClip Frame 1
_visible = false;
Symbol 375 MovieClip Frame 3
stop();
Symbol 377 MovieClip Frame 1
stop();
Symbol 377 MovieClip Frame 10
stop();
Symbol 377 MovieClip Frame 19
gotoAndStop (1);
Symbol 381 Button
on (rollOver) {
roll2.gotoAndPlay("in");
}
on (rollOut) {
roll2.gotoAndPlay("out");
}
on (release) {
showCreditsWindow();
}
Symbol 385 Button
on (rollOver) {
_parent.roll1.gotoAndPlay("in");
}
on (rollOut) {
_parent.roll1.gotoAndPlay("out");
}
on (release) {
soundController.max();
}
Symbol 388 Button
on (rollOver) {
_parent.roll1.gotoAndPlay("in");
}
on (rollOut) {
_parent.roll1.gotoAndPlay("out");
}
on (release) {
soundController.min();
}
Symbol 389 MovieClip Frame 1
soundController = {masterSound:new Sound(_root), tvol:0, parent:this};
soundController.setVolume = function (volume) {
this.tvol = volume;
this.onEnterFrame = function () {
var curVol = this.masterSound.getVolume();
if (this.tvol < curVol) {
var newVol = (curVol - 1);
} else if (curVol < this.tvol) {
var newVol = (curVol + 1);
} else {
delete this.onEnterFrame;
MovieClip.removeFLEMListener(this);
return(undefined);
}
this.masterSound.setVolume(newVol);
};
MovieClip.removeFLEMListener(this);
MovieClip.addFLEMListener(this);
};
soundController.min = function () {
this.setVolume(0);
this.parent.gotoAndStop("soundOff");
};
soundController.max = function () {
this.setVolume(100);
this.parent.gotoAndStop("soundOn");
};
soundController.max();
Symbol 393 MovieClip Frame 1
square._visible = false;
this.doScale = function () {
this.onEnterFrame = this.doScaleEnterFrame;
_parent.gotoAndStop("zoom");
MovieClip.addFLEMListener(this);
startX = this._x;
startY = this._y;
};
this.doScaleEnterFrame = function () {
dx = car2._x - car1._x;
dy = car2._y - car1._y;
midX = car1._x + (dx / 2);
midY = car1._y + (dy / 2);
adx = Math.abs(dx) / 1.5;
ady = Math.abs(dy) / 1.5;
if ((ady * 1.5) < adx) {
ady = adx * 0.75;
} else {
adx = ady * 1.5;
}
txscale = Math.max(150, adx);
tyscale = Math.max(100, ady);
tx = midX;
ty = midY;
x = x + ((square.tx - x) / 5);
y = y + ((square.ty - y) / 5);
xscale = xscale + ((txscale - xscale) / 5);
yscale = yscale + ((tyscale - yscale) / 5);
x = Math.round(x);
y = Math.round(y);
xscale = Math.round(xscale);
yscale = Math.round(yscale);
xFactor = 1.5 / (xscale / 100);
yFactor = 1 / (yscale / 100);
this._xscale = 100 * xFactor;
this._yscale = 100 * yFactor;
this._x = startX - (x * xFactor);
this._y = startY - (y * yFactor);
};
Symbol 407 MovieClip Frame 1
function startLapTimerDisplay() {
timerObj.updateLapTimer = true;
}
function pauseLapTimerDisplay() {
timerObj.updateLapTimer = false;
}
function handleStart(timeNow, currentTrack) {
timerObj.startTime = timeNow;
timerObj.lapStartTime = timeNow;
startTime = timeNow;
setTotalLaps(currentTrack.getTotalLaps());
setCurrentLap(1);
startLapTimerDisplay();
MovieClip.addFLEMListener(timerObj);
}
function reset() {
var zero = 0;
stopTimer();
setCurrentLap(1);
totalTime.text = zero.makeSecondsDisplay();
thisLap.text = zero.makeSecondsDisplay();
bestLapTime = 999999 /* 0x0F423F */;
}
function setCurrentLap(lap) {
currentLap = lap;
lapCounter.currentLap.text = lap;
return(currentLap);
}
function setTotalLaps(tLaps) {
totalLaps = tLaps;
lapCounter.totalLaps.text = totalLaps;
}
function stopTimer() {
MovieClip.removeFLEMListener(timerObj);
}
function handleLapTime(lapTime, timeNow) {
thisLapTime = lapTime;
pauseLapTimerDisplay();
thisLap.text = thisLapTime.makeSecondsDisplay();
if (thisLapTime < bestLapTime) {
bestLapTime = thisLapTime;
bestLap.text = thisLapTime.makeSecondsDisplay();
}
if (totalLaps < (currentLap + 1)) {
raceTime = timeNow - startTime;
stopTimer();
totalTime.text = raceTime.makeSecondsDisplay();
} else {
setCurrentLap(currentLap + 1);
}
timerObj.lapStartTime = timeNow;
this.timeOut(40, "startLapTimerDisplay");
}
bestLapTime = 99999999 /* 0x5F5E0FF */;
timerObj = new Object();
timerObj.tl = this;
timerObj.onEnterFrame = function () {
this.timeNow = getTimer();
this.timeElapsed = this.timeNow - this.startTime;
this.tl.totalTime.text = this.timeElapsed.makeSecondsDisplay();
this.lapTimeElapsed = this.timeNow - this.lapStartTime;
if (this.updateLapTimer) {
this.tl.thisLap.text = this.lapTimeElapsed.makeSecondsDisplay();
}
};
Symbol 408 Button
on (rollOver) {
roll2.gotoAndPlay("in");
}
on (rollOut) {
roll2.gotoAndPlay("out");
}
on (release) {
showCreditsWindow();
}