Frame 1
gvTrackCode = "2814";
System.security.allowDomain("www.chunk.co.uk");
this.createEmptyMovieClip("flashTrack", 999);
loadMovie ("http://www.chunk.co.uk/reporting/chunkTrack.swf", flashTrack);
flashTrack.trackEvent("open");
stop();
Instance of Symbol 27 MovieClip in Frame 1
onClipEvent (load) {
targetMC = _parent;
}
onClipEvent (enterFrame) {
if (targetMC.getBytesLoaded() > 1000) {
this.gotoAndStop(Math.ceil((this._totalframes * targetMC.getBytesLoaded()) / targetMC.getBytesTotal()));
if (this.preloadAnimFinished) {
_parent.gotoAndPlay("intro");
}
}
}
Instance of Symbol 171 MovieClip "toolTipMC" in Frame 12
onClipEvent (enterFrame) {
this._x = this._x + ((_root._xmouse - this._x) / 3);
this._y = this._y + ((_root._ymouse - this._y) / 3);
}
Frame 13
if (my_hiscoreModel == undefined) {
my_hiscoreModel = new hiscore.HiscoreModel();
}
if (my_hiscoreResultsController == undefined) {
my_hiscoreResultsController = new hiscore.HiscoreResultsController(my_hiscoreModel, null);
my_hiscoreResultsController.checkHiscore();
}
stop();
Frame 41
if (g == undefined) {
var g = (new com.arnoldclark.Game());
}
g.init();
this.onEnterFrame = function () {
g.step();
};
Frame 59
delete this.onEnterFrame;
g.setScores();
if (my_hiscoreResults == undefined) {
my_hiscoreResults = new hiscore.HiscoreResults(my_hiscoreModel, g);
}
my_hiscoreResults.init();
Frame 67
g.clearPopups();
if (my_hiscoreEntry == undefined) {
my_hiscoreEntry = new hiscore.HiscoreEntry(my_hiscoreModel, enterScore_mc, g);
}
my_hiscoreEntry.init();
Frame 76
if (results_mc) {
results_mc.removeMovieClip();
}
if (my_hiscoreTable == undefined) {
my_hiscoreTable = new hiscore.HiscoreTable(my_hiscoreModel, hiscore_mc);
}
my_hiscoreTable.displayTable();
Symbol 4 MovieClip [sparkAnim] Frame 18
gotoAndPlay ("loopstart");
Symbol 27 MovieClip Frame 1
stop();
Instance of Symbol 23 MovieClip "fillMC" in Symbol 27 MovieClip Frame 1
onClipEvent (enterFrame) {
this._y = this._y + ((_parent.followMeMC._y - this._y) / 5);
if (Math.round(this._x) == -110) {
this._y = -100;
_parent.preloadAnimFinished = true;
}
}
Symbol 27 MovieClip Frame 42
stop();
preloadAnimFinished = true;
Symbol 363 MovieClip [__Packages.util.StandardButton] Frame 0
class util.StandardButton
{
var button_mc;
function StandardButton (mc, label_str) {
button_mc = mc;
if (label_str) {
button_mc.title_txt.htmlText = label_str;
}
button_mc.classRef = this;
button_mc.onRollOver = function () {
this.classRef.over();
};
button_mc.onRollOut = function () {
this.classRef.out();
};
}
function over() {
button_mc.gotoAndPlay("over");
}
function out() {
button_mc.gotoAndPlay("out");
}
function off() {
button_mc.gotoAndStop("off");
}
}
Symbol 364 MovieClip [__Packages.hiscore.HiscoreModel] Frame 0
class hiscore.HiscoreModel
{
var bestScore_num, lastScore_num, hiscore_num, name_str, tableData_xml;
function HiscoreModel () {
}
function setBestScore(bestScore_arg) {
bestScore_num = bestScore_arg;
}
function getBestScore() {
return(bestScore_num);
}
function setLastScore(lastScore_arg) {
lastScore_num = lastScore_arg;
}
function getLastScore() {
return(lastScore_num);
}
function setHiscore(hiscore_arg) {
hiscore_num = hiscore_arg;
}
function getHiscore() {
return(hiscore_num);
}
function setName(name_arg) {
name_str = name_arg;
}
function getName() {
return(name_str);
}
function setTableData(tableData_arg) {
tableData_xml = tableData_arg;
}
function getTableData() {
return(tableData_xml);
}
}
Symbol 365 MovieClip [__Packages.hiscore.HiscoreResultsController] Frame 0
class hiscore.HiscoreResultsController
{
var my_model, my_view, my_XMLLoader, XMLLoader_mc;
function HiscoreResultsController (model_arg, view_arg) {
my_model = model_arg;
my_view = view_arg;
my_XMLLoader = new util.xml.XMLLoader();
}
function setBestScore(score_arg) {
my_model.setBestScore(score_arg);
}
function setLastScore(score_arg) {
my_model.setLastScore(score_arg);
}
function checkHiscore() {
_root.hiscore_btn.enabled = false;
_root.hiscore2_btn.enabled = false;
my_XMLLoader.loadXML("http://www.chunktestarea.com/aclark/topten.asp", this);
}
function XMLLoading() {
XMLLoader_mc = _root.attachMovie("NonPercentageLoader", "XMLLoader", _root.getNextHighestDepth(), {_x:300, _y:190});
}
function XMLLoaded(hiscoreXML_arg) {
XMLLoader_mc.removeMovieClip();
_root.hiscore_btn.enabled = true;
_root.hiscore2_btn.enabled = true;
my_model.setTableData(hiscoreXML_arg);
if (my_model.getBestScore() != undefined) {
var _local4 = my_model.getBestScore();
var _local7 = my_model.getHiscore();
var _local8 = false;
var _local6 = my_model.getTableData();
var _local3 = 0;
while (_local3 < _local6.firstChild.childNodes.length) {
var _local5 = _local6.childNodes[0].childNodes[_local3].attributes.score_num;
if ((_local4 > _local5) && ((_local7 == undefined) || (_local4 > _local7))) {
_local8 = true;
my_model.setHiscore(_local4);
}
_local3++;
}
my_view.showResult(_local8);
}
}
function XMLError() {
XMLLoader_mc.removeMovieClip();
util.AlertBox.show("Error in Data Loading", "There has been an error while loading the data for this game. Please check your connection and click anywhere to load again", undefined, undefined, this, "checkHiscore");
}
}
Symbol 366 MovieClip [__Packages.hiscore.HiscoreResults] Frame 0
class hiscore.HiscoreResults
{
var my_model, my_controller, my_game, hiscoreResults_mc;
function HiscoreResults (model_arg, game_arg) {
my_model = model_arg;
my_controller = new hiscore.HiscoreResultsController(my_model, this);
my_game = game_arg;
}
function init() {
my_controller.setBestScore(my_game.getBestScore());
my_controller.setLastScore(my_game.getLastScore());
my_controller.checkHiscore();
}
function showResult(isHiscore_arg) {
if (isHiscore_arg) {
var _local3 = "resultsHiscore_mc";
} else {
var _local3 = "resultsNoHiscore_mc";
}
hiscoreResults_mc = _root.attachMovie(_local3, "results_mc", _root.getNextHighestDepth(), {_x:185, _y:130});
hiscoreResults_mc.playAgain_btn.onRelease = function () {
_root.flashTrack.trackEvent("playagain");
_root.gotoAndStop("newGame");
this._parent.removeMovieClip();
};
if (isHiscore_arg) {
hiscoreResults_mc.enterScore_btn.onRelease = function () {
_root.gotoAndStop("enterScore");
this._parent.removeMovieClip();
};
}
hiscoreResults_mc.bestScore_txt.text = my_model.getBestScore();
hiscoreResults_mc.lastScore_txt.text = my_game.getLastScore();
}
}
Symbol 367 MovieClip [__Packages.com.arnoldclark.Game] Frame 0
class com.arnoldclark.Game
{
var bestScore, carOn, r, c, fg, rb, sp, sb1, sb2, sb3, sBoard, m, animationList, lastScore;
function Game () {
bestScore = 0;
}
function init() {
clearPopups();
carOn = false;
_root.fgMC._x = 0;
_root.bg1MC._x = 0;
_root.bg2MC._x = 0;
_root.bg3MC._x = 0;
_root.fgMC.carMC._x = 135;
_root.fgMC.carMC._y = 336;
_root.fgMC.startingCarAnimMC.gotoAndPlay(1);
r = new com.arnoldclark.Ramp(_root.fgMC.rampMC, 191, 337, 78, 20);
c = new com.arnoldclark.Car(135, 322, 8, _root.fgMC.carMC, r, this);
fg = new com.arnoldclark.Foreground(_root.fgMC, c);
rb = new com.arnoldclark.RampButton(_root.fgMC._root.fgMC.rbMC, r);
sp = new com.arnoldclark.SoundPlayer(_root.soundsMC);
sb1 = new com.arnoldclark.ScrollingBackground(_root.bg1MC, c, -0.5, 336);
sb2 = new com.arnoldclark.ScrollingBackground(_root.bg2MC, c, -0.25, 336);
sb3 = new com.arnoldclark.ScrollingBackground(_root.bg3MC, c, -0.1, 336);
sBoard = new com.arnoldclark.Scoreboard(this);
displayYourBest();
m = new com.arnoldclark.Marker("marker", _root.fgMC, 280, 500, 20);
animationList = new Array(r, fg, sb1, sb2, sb3);
var _local3 = random(3) + 1;
_root.fgMC.startingCarAnimMC.carMC.bodyMC.gotoAndStop(_local3);
_root.fgMC.carMC.bodyMC.gotoAndStop(_local3);
}
function step() {
var _local2 = 0;
while (_local2 < animationList.length) {
animationList[_local2].moveMe();
animationList[_local2].drawMe();
_local2++;
}
if (carOn) {
c.moveMe();
c.drawMe();
}
rb.operate();
}
function getLastScore() {
return(lastScore);
}
function getBestScore() {
return(bestScore);
}
function setScores() {
lastScore = Math.round(c.getMyX() - r.getMyEndX());
if ((lastScore > bestScore) || (bestScore == undefined)) {
bestScore = lastScore;
}
}
function displayScores() {
sBoard.displayScores();
}
function displayYourBest() {
_root.yourBestMC.displayTXT.text = getBestScore() + "m";
}
function clearPopups() {
_root.scoreboardMC.removeMovieClip();
}
}
Symbol 368 MovieClip [__Packages.com.arnoldclark.Ramp] Frame 0
class com.arnoldclark.Ramp
{
var myMC, myX, myY, myLength, myRot, myMinRot, myMaxRot, myEndX, myEndY;
function Ramp (myMC, myX, myY, myLength, myRot) {
this.myMC = myMC;
this.myX = myX;
this.myY = myY;
this.myLength = myLength;
this.myRot = myRot;
myMinRot = -50;
myMaxRot = 20;
}
function moveMe() {
if (myRot < myMaxRot) {
if ((myRot + 5) <= myMaxRot) {
myRot = myRot + 5;
} else {
myRot = myMaxRot;
}
}
}
function drawMe() {
calculateMyEnds();
myMC.clear();
myMC.beginFill(16711703);
myMC.lineStyle(0, 16711680, 100);
myMC.moveTo(myX - 8, myY);
myMC.lineTo(myX + 8, myY);
myMC.lineTo(myEndX + 10, myEndY);
myMC.lineTo(myEndX - 10, myEndY);
myMC.lineTo(myX - 8, myY);
myMC.endFill();
myMC.moveTo(myX - 8, myY);
myMC.lineStyle(2, 8847617, 100);
myMC.lineTo(myEndX - 10, myEndY);
myMC.lineTo(myEndX + 10, myEndY);
if (myRot <= 0) {
myMC.swapDepths(101);
} else {
myMC.swapDepths(50);
}
}
function calculateMyEnds() {
myEndX = myX + (Math.cos(degreesToRadians(myRot)) * myLength);
myEndY = myY + (Math.sin(degreesToRadians(myRot)) * myLength);
}
function degreesToRadians(degrees) {
var _local1 = (degrees * Math.PI) / 180;
return(_local1);
}
function radiansToDegrees(radians) {
var _local1 = (radians * 180) / Math.PI;
return(_local1);
}
function getMyX() {
return(myX);
}
function getMyY() {
return(myY);
}
function getMyEndX() {
return(myEndX);
}
function getMyEndY() {
return(myEndY);
}
function getMyRot() {
return(myRot);
}
function setMyRot(newRot) {
myRot = newRot;
if (myRot > myMaxRot) {
myRot = myMaxRot;
} else if (myRot < myMinRot) {
myRot = myMinRot;
} else {
myRot = newRot;
}
}
}
Symbol 369 MovieClip [__Packages.com.arnoldclark.Car] Frame 0
class com.arnoldclark.Car
{
var myX, myY, gameObject, mySpeed, rampObject, myMC, gravity, myRot, floorY, hasLeftRamp, myYspeed, myLastY, myXspeed, myLastX, randomRot, sparkAnim;
function Car (myX, myY, mySpeed, myMC, rampObject, gameObject) {
this.myX = myX;
this.myY = myY;
this.gameObject = gameObject;
this.mySpeed = mySpeed;
this.rampObject = rampObject;
this.myMC = myMC;
grounded = false;
crashed = false;
gravity = 0.5;
myRot = 0;
floorY = 360;
}
function moveMe() {
if (!hasLeftRamp) {
if (myX < rampObject.getMyEndX()) {
if (myX >= rampObject.getMyX()) {
myY = rampObject.getMyY() + (Math.tan(degreesToRadians(myRot)) * (myX - rampObject.getMyX()));
myY = myY - (myMC._height / 2);
myRot = rampObject.getMyRot();
myYspeed = Math.sin(degreesToRadians(myRot)) * mySpeed;
if ((myY - myLastY) < 0) {
myYspeed = myYspeed + (myY - myLastY);
}
} else {
myYspeed = Math.sin(degreesToRadians(myRot)) * mySpeed;
}
myXspeed = Math.cos(degreesToRadians(myRot)) * mySpeed;
} else {
hasLeftRamp = true;
}
myLastX = myX;
myLastY = myY;
myX = myX + myXspeed;
myY = myY + myYspeed;
} else if (!grounded) {
rotateMe();
myYspeed = myYspeed + gravity;
if ((myY + myYspeed) < floorY) {
myX = myX + myXspeed;
myY = myY + myYspeed;
} else {
myY = floorY;
if (checkUprightness()) {
if (myYspeed > 3) {
randomRot = random(10) - 5;
gameObject.sp.playSound("boing");
myXspeed = myXspeed * 0.95;
myYspeed = myYspeed * -0.95;
if (myYspeed > 1) {
myYspeed = 0;
}
myX = myX + myXspeed;
} else {
grounded = true;
}
} else {
gameObject.sp.playSound("crash");
grounded = true;
crashed = true;
}
}
} else {
if (crashed) {
if (sparkAnim == undefined) {
sparkAnim = new com.arnoldclark.SparkAnimation(this);
}
sparkAnim.operate();
} else {
if (myRot < 0) {
myRot = myRot + 360;
}
if (myRot > 180) {
myRot = myRot + ((360 - myRot) / 3);
} else {
myRot = myRot + ((-myRot) / 3);
}
}
if (myXspeed > 0) {
myXspeed = myXspeed - 0.1;
myX = myX + myXspeed;
_root.fgMC.sparkAnimMC._alpha = myXspeed * 100;
} else {
if (sparkAnim != undefined) {
sparkAnim.turnOff();
}
_root.gotoAndStop("results");
}
}
}
function drawMe() {
myMC._x = myX;
myMC._y = myY;
myMC._rotation = myRot;
}
function degreesToRadians(degrees) {
var _local1 = (degrees * Math.PI) / 180;
return(_local1);
}
function radiansToDegrees(radians) {
var _local1 = (radians * 180) / Math.PI;
return(_local1);
}
function getMyX() {
return(myX);
}
function rotateMe() {
if (randomRot != undefined) {
myRot = myRot + randomRot;
}
myRot = myRot + ((20 * (_root._xmouse - 300)) / 300);
if (myRot < 0) {
myRot = myRot + 360;
}
}
function crash() {
delete _root.onEnterFrame;
_root.gotoAndStop("results");
}
function checkUprightness() {
if (((myRot % 360) >= 270) && ((myRot % 360) < 360)) {
var _local2 = ((360 - (myRot % 360)) / 90) * 0.05;
myXspeed = myXspeed * (0.95 - _local2);
return(true);
}
if (((myRot % 360) >= 0) && ((myRot % 360) <= 90)) {
var _local2 = ((myRot % 360) / 90) * 0.05;
myXspeed = myXspeed * (0.95 + _local2);
return(true);
}
return(false);
}
var grounded = true;
var crashed = true;
}
Symbol 370 MovieClip [__Packages.com.arnoldclark.SparkAnimation] Frame 0
class com.arnoldclark.SparkAnimation
{
var carObject, myMC;
function SparkAnimation (carObject) {
this.carObject = carObject;
init();
}
function operate() {
myMC._x = carObject.getMyX() + 7;
myMC._y = 370;
}
function init() {
myMC = _root.fgMC.attachMovie("sparkAnim", "sparkAnimMC", 250);
}
function turnOff() {
myMC.removeMovieClip();
}
}
Symbol 371 MovieClip [__Packages.com.arnoldclark.Foreground] Frame 0
class com.arnoldclark.Foreground
{
var myMC, carObject, myX;
function Foreground (myMC, carObject) {
this.myMC = myMC;
this.carObject = carObject;
}
function moveMe() {
if (carObject.getMyX() > 300) {
myX = 300 - carObject.getMyX();
}
}
function drawMe() {
myMC._x = myX;
}
}
Symbol 372 MovieClip [__Packages.com.arnoldclark.RampButton] Frame 0
class com.arnoldclark.RampButton
{
var myMC, rampObject, pressed;
function RampButton (myMC, rampObject) {
this.myMC = myMC;
this.rampObject = rampObject;
codeButton();
}
function codeButton() {
var objRef = this;
myMC.onPress = function () {
objRef.pressed = true;
};
myMC.onRelease = (myMC.onReleaseOutside = function () {
objRef.pressed = false;
});
}
function operate() {
if (pressed) {
rampObject.setMyRot(rampObject.getMyRot() - 12);
}
}
}
Symbol 373 MovieClip [__Packages.com.arnoldclark.ScrollingBackground] Frame 0
class com.arnoldclark.ScrollingBackground
{
var myMC, scrollRef, scrollRatio, scrollStart, myX, myWidth;
function ScrollingBackground (myMC, scrollRef, scrollRatio, scrollStart) {
this.myMC = myMC;
this.scrollRef = scrollRef;
this.scrollRatio = scrollRatio;
this.scrollStart = scrollStart;
myX = 0;
myWidth = this.myMC._width;
}
function moveMe() {
if (scrollRef.getMyX() >= scrollStart) {
myX = (scrollRef.getMyX() - scrollStart) * scrollRatio;
}
if (myX < (-(myWidth / 2))) {
myX = myX + (myWidth / 2);
}
}
function drawMe() {
myMC._x = myX;
}
}
Symbol 374 MovieClip [__Packages.com.arnoldclark.Scoreboard] Frame 0
class com.arnoldclark.Scoreboard
{
var gameObject, myMC;
function Scoreboard (gameObject) {
this.gameObject = gameObject;
}
function displayScores() {
myMC = _root.attachMovie("scoreboard", "scoreboardMC", _root.getNextHighestDepth());
myMC._x = 205;
myMC._y = 153;
trace(myMC);
myMC.lastScoreTXT.text = gameObject.getLastScore();
myMC.bestScoreTXT.text = gameObject.getBestScore();
}
}
Symbol 375 MovieClip [__Packages.com.arnoldclark.Marker] Frame 0
class com.arnoldclark.Marker
{
var myMCID, targetMC, xOrigin, markerInc, markerAmount, myY;
function Marker (myMCID, targetMC, xOrigin, markerInc, markerAmount) {
this.myMCID = myMCID;
this.targetMC = targetMC;
this.xOrigin = xOrigin;
this.markerInc = markerInc;
this.markerAmount = markerAmount;
myY = 330;
drawMarkers();
}
function drawMarkers() {
var _local2 = 1;
while (_local2 <= markerAmount) {
var _local3 = targetMC.attachMovie(myMCID, "marker" + _local2, _local2);
_local3._x = xOrigin + (markerInc * _local2);
_local3._y = myY;
_local3.displayTXT.text = _local2 * markerInc;
_local2++;
}
}
}
Symbol 376 MovieClip [__Packages.com.arnoldclark.SoundPlayer] Frame 0
class com.arnoldclark.SoundPlayer
{
static var soundCounter, soundHolder;
function SoundPlayer (targetMC) {
soundCounter = 0;
soundHolder = targetMC;
}
function playSound(soundID) {
soundCounter++;
var soundMC = soundHolder.createEmptyMovieClip("soundMC" + soundCounter, soundCounter);
var _local3;
soundMC.soundObj = new Sound(soundMC);
soundMC.soundObj.attachSound(soundID);
soundMC.soundObj.setVolume(100);
soundMC.soundObj.onSoundComplete = function () {
soundMC.removeMovieClip();
};
soundMC.soundObj.start(0, 1);
}
}
Symbol 377 MovieClip [__Packages.util.xml.XMLLoader] Frame 0
class util.xml.XMLLoader
{
var XMLHandler_obj;
function XMLLoader () {
}
function loadXML(url_str, XMLHandler_arg) {
XMLHandler_obj = XMLHandler_arg;
XMLHandler_obj.XMLLoading();
var _local2 = new XML();
var classRef = this;
_local2.ignoreWhite = true;
_local2.load(url_str);
_local2.onLoad = function (success) {
if (success) {
if (classRef.XMLHandler_obj) {
classRef.XMLHandler_obj.XMLLoaded(this);
}
} else if (classRef.XMLHandler_obj) {
classRef.XMLHandler_obj.XMLError();
}
};
}
function sendAndLoadXML(url_str, send_str, XMLHandler_arg) {
XMLHandler_obj = XMLHandler_arg;
XMLHandler_obj.XMLLoading();
var _local3 = new XML(send_str);
var _local2 = new XML();
var classRef = this;
_local2.ignoreWhite = true;
_local3.sendAndLoad(url_str, _local2);
_local2.onLoad = function (success) {
if (success) {
if (classRef.XMLHandler_obj) {
classRef.XMLHandler_obj.XMLLoaded(this);
}
} else {
trace("d");
if (classRef.XMLHandler_obj) {
classRef.XMLHandler_obj.XMLError();
}
}
};
}
}
Symbol 378 MovieClip [__Packages.util.AlertBox] Frame 0
class util.AlertBox
{
function AlertBox () {
}
static function show(messageTitle_arg, message_arg, x_arg, y_arg, class_arg, method_arg) {
if (messageTitle_arg == undefined) {
messageTitle_arg = "Message";
}
if (message_arg == undefined) {
message_arg = "";
}
if (x_arg == undefined) {
x_arg = Stage.width / 2;
}
if (y_arg == undefined) {
y_arg = Stage.height / 2;
}
_root.createEmptyMovieClip("alertHolder_mc", _root.getNextHighestDepth());
createButtonMask();
_root.alertHolder_mc.attachMovie("AlertBox", "alert_mc", 10, {_x:x_arg, _y:y_arg});
_root.alertHolder_mc.alert_mc.messageTitle_txt.htmlText = messageTitle_arg;
_root.alertHolder_mc.alert_mc.message_txt.htmlText = message_arg;
_root.alertHolder_mc.class_obj = class_arg;
_root.alertHolder_mc.method_obj = method_arg;
}
static function createButtonMask() {
_root.alertHolder_mc.createEmptyMovieClip("buttonMask_mc", 5);
_root.alertHolder_mc.buttonMask_mc.alertHolder_mc = _root.alertHolder_mc;
_root.alertHolder_mc.buttonMask_mc.onRelease = function () {
if ((!this._parent.class_obj) != undefined) {
this._parent.class_obj[this._parent.method_obj]();
}
this.alertHolder_mc.removeMovieClip();
};
_root.alertHolder_mc.buttonMask_mc.useHandCursor = false;
_root.alertHolder_mc.buttonMask_mc.beginFill(0, 0);
_root.alertHolder_mc.buttonMask_mc.moveTo(-3000, -3000);
_root.alertHolder_mc.buttonMask_mc.lineTo(3000, -3000);
_root.alertHolder_mc.buttonMask_mc.lineTo(3000, 3000);
_root.alertHolder_mc.buttonMask_mc.lineTo(-3000, 3000);
_root.alertHolder_mc.buttonMask_mc.lineTo(-3000, -3000);
_root.alertHolder_mc.buttonMask_mc.endFill();
}
}
Symbol 379 MovieClip [__Packages.hiscore.HiscoreEntry] Frame 0
class hiscore.HiscoreEntry
{
var my_model, hiscoreEntry_mc, my_controller, submit_btn, cancel_btn, initialID_num, key_listener;
function HiscoreEntry (model_arg, hiscoreEntry_arg) {
my_model = model_arg;
hiscoreEntry_mc = hiscoreEntry_arg;
my_controller = new hiscore.HiscoreEntryController(my_model, this);
submit_btn = hiscoreEntry_mc.submit_btn;
cancel_btn = hiscoreEntry_mc.cancel_btn;
initKeyListener();
}
function init() {
var _local2 = my_model.getName();
if (_local2 != undefined) {
my_controller.setName(_local2);
} else {
my_controller.setName("AAA");
}
displayBestScore();
initInitials();
initButtons();
initialID_num = 0;
focusOnInitial(initialID_num);
}
function displayBestScore() {
hiscoreEntry_mc.bestScore_txt.text = my_model.getBestScore();
}
function displayInitials() {
var _local3 = my_model.getName();
var _local2 = 0;
while (_local2 < _local3.length) {
displayInitial(_local3.substr(_local2, 1), _local2);
_local2++;
}
}
function displayInitial(initial_arg, initialID_arg) {
hiscoreEntry_mc[("initial" + initialID_arg) + "_mc"].initial_txt.text = initial_arg;
}
function focusOnInitial(initialID_arg) {
hiscoreEntry_mc[("initial" + initialID_arg) + "_mc"].background_mc.gotoAndStop("on");
}
function blurInitial(initialID_arg) {
hiscoreEntry_mc[("initial" + initialID_arg) + "_mc"].background_mc.gotoAndStop("off");
}
function replaceInitial(initialID_arg) {
blurInitial(initialID_num);
initialID_num = initialID_arg;
focusOnInitial(initialID_num);
}
function initInitials() {
var _local2 = 0;
while (_local2 < 3) {
this[("initial" + _local2) + "_mc"] = hiscoreEntry_mc[("initial" + _local2) + "_mc"];
this[("initial" + _local2) + "_mc"].initialID_num = _local2;
this[("initial" + _local2) + "_mc"].hiscoreEntry_ref = this;
this[("initial" + _local2) + "_mc"].onRelease = function () {
this.hiscoreEntry_ref.replaceInitial(this.initialID_num);
};
_local2++;
}
}
function initKeyListener() {
key_listener = new Object();
key_listener.hiscoreEntry_ref = this;
key_listener.onKeyDown = function () {
if ((Key.getCode() == 46) || (Key.getCode() == 8)) {
trace("delete");
this.initialID_clone = this.hiscoreEntry_ref.initialID_num;
if (this.initialID_clone > 0) {
this.initialID_clone--;
} else {
this.initialID_clone = 2;
}
this.hiscoreEntry_ref.replaceInitial(this.initialID_clone);
} else if (Key.getCode() == 13) {
trace("enter");
this.hiscoreEntry_ref.my_controller.submitBestScore();
} else {
var _local2 = String.fromCharCode(Key.getAscii());
var _local3 = _local2.toUpperCase();
this.hiscoreEntry_ref.my_controller.setInitial(_local3, this.hiscoreEntry_ref.initialID_num);
this.initialID_clone = this.hiscoreEntry_ref.initialID_num;
if (this.initialID_clone < 2) {
this.initialID_clone++;
} else {
this.initialID_clone = 0;
}
this.hiscoreEntry_ref.replaceInitial(this.initialID_clone);
}
};
Key.addListener(key_listener);
}
function initButtons() {
new util.StandardButton(submit_btn);
submit_btn.hiscoreEntry_ref = this;
submit_btn.onRelease = function () {
this.hiscoreEntry_ref.my_controller.submitBestScore();
};
new util.StandardButton(cancel_btn);
cancel_btn.onRelease = function () {
_root.gotoAndStop("newGame");
};
}
}
Symbol 380 MovieClip [__Packages.hiscore.HiscoreEntryController] Frame 0
class hiscore.HiscoreEntryController
{
var my_model, my_view, my_XMLLoader, XMLLoader_mc;
function HiscoreEntryController (model_arg, view_arg) {
my_model = model_arg;
my_view = view_arg;
my_XMLLoader = new util.xml.XMLLoader();
}
function setName(name_arg) {
my_model.setName(name_arg);
my_view.displayInitials(name_arg);
}
function setBestScore(score_arg) {
my_model.setBestScore(score_arg);
my_view.displayBestScore(score_arg);
}
function setInitial(initial_arg, initialID_arg) {
if (initial_arg == "") {
initial_arg = " ";
}
var _local4 = my_model.getName();
var _local3 = "";
var _local2 = 0;
while (_local2 < _local4.length) {
if (_local2 != initialID_arg) {
_local3 = _local3 + _local4.substr(_local2, 1);
} else {
_local3 = _local3 + initial_arg;
}
_local2++;
}
my_model.setName(_local3);
my_view.displayInitial(initial_arg, initialID_arg);
}
function updateHiscoreTable() {
var _local6 = my_model.getBestScore();
var _local5 = -1;
var _local3 = my_model.getTableData();
var _local2 = 0;
while (_local2 < _local3.firstChild.childNodes.length) {
var _local4 = _local3.childNodes[0].childNodes[_local2].attributes.score_num;
if (_local6 > _local4) {
_local5 = _local2;
break;
}
_local2++;
}
_local2 = _local3.firstChild.childNodes.length - 1;
while (_local2 > _local5) {
_local3.childNodes[0].childNodes[_local2].attributes.score_num = _local3.childNodes[0].childNodes[_local2 - 1].attributes.score_num;
_local3.childNodes[0].childNodes[_local2].attributes.name_str = _local3.childNodes[0].childNodes[_local2 - 1].attributes.name_str;
_local2--;
}
_local3.childNodes[0].childNodes[_local5].attributes.score_num = my_model.getBestScore();
_local3.childNodes[0].childNodes[_local5].attributes.name_str = my_model.getName();
my_model.setTableData(_local3);
}
function submitBestScore() {
var _local2 = ((("<bestscore name_str=\"" + my_model.getName()) + "\" score_num=\"") + my_model.getBestScore()) + "\" />";
my_XMLLoader.sendAndLoadXML("http://www.chunktestarea.com/aclark/scoresubmit.asp", _local2, this);
}
function XMLLoading() {
XMLLoader_mc = _root.attachMovie("NonPercentageLoader", "XMLLoader", _root.getNextHighestDepth(), {_x:300, _y:190});
}
function XMLLoaded() {
updateHiscoreTable();
XMLLoader_mc.removeMovieClip();
_root.gotoAndStop("highScores");
}
function XMLError() {
XMLLoader_mc.removeMovieClip();
util.AlertBox.show("Submission Error", "There has been an error while submitting your score. Please check your connection and click anywhere to try again", undefined, undefined, this, "submitBestScore");
}
}
Symbol 381 MovieClip [__Packages.hiscore.HiscoreTable] Frame 0
class hiscore.HiscoreTable
{
var my_model, hiscoreTable_mc;
function HiscoreTable (model_arg, hiscoreTable_arg) {
my_model = model_arg;
hiscoreTable_mc = hiscoreTable_arg;
}
function displayTable() {
var _local6 = my_model.getTableData();
var _local3 = 0;
while (_local3 < _local6.firstChild.childNodes.length) {
var _local5 = _local6.childNodes[0].childNodes[_local3].attributes.name_str;
_local5 = _local5.toUpperCase();
var _local2 = _local6.childNodes[0].childNodes[_local3].attributes.score_num;
var _local4 = 0;
while (_local2.length < 4) {
_local2 = "0" + _local2;
_local4++;
}
hiscoreTable_mc[("name" + _local3) + "_txt"].text = _local5;
hiscoreTable_mc[("score" + _local3) + "_txt"].text = _local2;
_local3++;
}
}
}
Symbol 39 MovieClip Frame 1
my_button = new util.StandardButton(this);
stop();
Symbol 39 MovieClip Frame 11
stop();
Symbol 39 MovieClip Frame 21
stop();
Symbol 42 MovieClip Frame 1
my_button = new util.StandardButton(this);
stop();
Symbol 42 MovieClip Frame 11
stop();
Symbol 42 MovieClip Frame 21
stop();
Symbol 92 MovieClip Frame 1
my_button = new util.StandardButton(this);
this.onRelease = function () {
getURL ("javascript:NewWindow('competitionentry.html','prize',400,410,'no','no')");
};
stop();
Instance of Symbol 75 MovieClip in Symbol 92 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 0.3);
}
Symbol 92 MovieClip Frame 11
stop();
Instance of Symbol 75 MovieClip in Symbol 92 MovieClip Frame 20
onClipEvent (enterFrame) {
_rotation = (_rotation + 0.6);
}
Symbol 92 MovieClip Frame 21
stop();
Symbol 116 Button
on (release) {
gotoAndStop ("newGame");
}
Symbol 128 Button
on (rollOver) {
toolTipMC.gotoAndStop("howto");
}
on (rollOut) {
toolTipMC.gotoAndStop("off");
}
on (release) {
gotoAndStop ("instructions");
}
Symbol 146 Button
on (rollOver) {
toolTipMC.gotoAndStop("hi");
}
on (rollOut) {
toolTipMC.gotoAndStop("off");
}
on (release) {
gotoAndStop ("highScores");
}
Symbol 162 Button
on (rollOver) {
toolTipMC.gotoAndStop("send");
}
on (rollOut) {
toolTipMC.gotoAndStop("off");
}
on (release) {
getURL ("javascript:NewWindow('sendtoafriend.html','send',400,300,'no','no')");
}
Symbol 171 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 1
my_button = new util.StandardButton(this);
this.onRelease = function () {
_root.flashTrack.trackEvent("clickthru");
getURL ("http://www.arnoldclark.com", "_blank");
};
stop();
Symbol 177 MovieClip Frame 11
stop();
Symbol 177 MovieClip Frame 21
stop();
Symbol 182 MovieClip Frame 1
my_button = new util.StandardButton(this);
this.onRelease = function () {
getURL ("javascript:NewWindow('sendtoafriend.html','send',400,300,'no','no')");
};
stop();
Symbol 182 MovieClip Frame 11
stop();
Symbol 182 MovieClip Frame 21
stop();
Symbol 187 MovieClip Frame 1
my_button = new util.StandardButton(this);
this.onRelease = function () {
_root.gotoAndStop("highScores");
};
stop();
Symbol 187 MovieClip Frame 11
stop();
Symbol 187 MovieClip Frame 21
stop();
Symbol 200 Button
on (rollOver) {
toolTipMC.gotoAndStop("backtohome");
}
on (rollOut) {
toolTipMC.gotoAndStop("off");
}
on (release) {
gotoAndStop ("intro");
}
Symbol 207 MovieClip Frame 1
stop();
Symbol 222 MovieClip Frame 1
stop();
Symbol 235 MovieClip Frame 64
stop();
_parent._parent.g.carOn = true;
Instance of Symbol 237 MovieClip "shadowMC" in Symbol 241 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (_parent.carMC._x > 260) {
if (!this._visible) {
this._visible = true;
}
} else if (this._visible) {
this._visible = false;
}
this._x = _parent.carMC._x;
}
Instance of Symbol 240 MovieClip "carMC" in Symbol 241 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(99);
}
Instance of Symbol 213 MovieClip in Symbol 241 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(100);
}
Symbol 286 MovieClip Frame 1
var counter_num = 0;
var frame_num = (1 + Math.round(Math.random() * 10));
this.gotoAndStop(frame_num);
this.onEnterFrame = function () {
this.counter_num++;
if (this.counter_num == 150) {
this.counter_num = 0;
this.frame_num++;
if (this.frame_num == 13) {
this.frame_num = 1;
}
this.gotoAndStop(this.frame_num);
}
};
stop();
Symbol 305 MovieClip Frame 1
my_button = new util.StandardButton(this);
this.onRelease = function () {
getURL ("javascript:NewWindow('competitionentry.html','prize',400,410,'no','no')");
};
stop();
Instance of Symbol 75 MovieClip in Symbol 305 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 0.3);
}
Symbol 305 MovieClip Frame 11
stop();
Instance of Symbol 75 MovieClip in Symbol 305 MovieClip Frame 20
onClipEvent (enterFrame) {
_rotation = (_rotation + 0.6);
}
Symbol 305 MovieClip Frame 21
stop();
Symbol 309 MovieClip Frame 1
stop();
Symbol 309 MovieClip Frame 11
stop();
Symbol 309 MovieClip Frame 21
stop();
Symbol 314 MovieClip Frame 1
stop();
Symbol 314 MovieClip Frame 11
stop();
Symbol 314 MovieClip Frame 21
stop();
Symbol 321 MovieClip Frame 1
stop();
Symbol 361 MovieClip Frame 1
my_button = new util.StandardButton(this);
this.onRelease = function () {
_root.flashTrack.trackEvent("playagain");
_root.gotoAndStop("newGame");
};
stop();
Symbol 361 MovieClip Frame 11
stop();
Symbol 361 MovieClip Frame 21
stop();