Frame 1
_quality = "BEST";
Frame 2
if (_framesloaded < _totalframes) {
frameNum = math.floor((getBytesLoaded() / getBytesTotal()) * 100);
iProgress.gotoAndStop(frameNum);
vShot = frameNum + "%";
} else {
gotoAndStop (4);
}
Frame 3
gotoAndPlay (2);
Frame 4
function constantsObject() {
this.MOVIE_WIDTH = 700;
this.QUALITY_LOW = "MEDIUM";
this.QUALITY_MEDIUM = "MEDIUM";
this.QUALITY_HIGH = "BEST";
this.URL_COMMAND = "http://www.beatbeckham.com/CommandServer";
this.URL_TANDC = "http://www.venetianGold.com/footy.htm";
this.URL_VENETIAN_GOLD = "http://www.venetiangold.com";
this.URL_SLOTS_AND_THE_CITY = "http://www.slotsandthecity.com";
this.URL_PADDYS_GOLD = "http://www.paddysgold.com";
this.TIME_GAME = 180;
this.TIME_WARNING = 15;
this.SCORE_GOAL = 80;
this.SCORE_CORNER = 60;
this.SCORE_HEIGHT = 40;
this.SCORE_SWERVE = 20;
this.SCORE_HIT_BAR = 25;
this.SCORE_HIT_POST = 15;
this.SHOTS_WITHOUT_WALL = 5;
this.MENU_COMMAND_GOTO_PAGE = 0;
this.MENU_COMMAND_START_GAME = 1;
this.MENU_COMMAND_GET_TOP_SCORES = 2;
this.BUTTON_CREDITS = 0;
this.BUTTON_ENTER_LEAGUE = 1;
this.BUTTON_TELL_A_FRIEND = 2;
this.SEND_SUBMIT_SCORE = 3;
this.SEND_GET_TOP_SCORES = 4;
this.SEND_TELL_FRIENDS = 5;
this.BUTTON_CANCEL = 6;
this.BUTTON_OK = 7;
this.BUTTONTYPE_GOTO_PAGE = 0;
this.BUTTONTYPE_SUBMIT_FORM = 1;
this.BUTTONTYPE_CANCEL_FORM = 2;
var goto = this.BUTTONTYPE_GOTO_PAGE;
var send = this.BUTTONTYPE_SUBMIT_FORM;
var other = this.BUTTONTYPE_OTHER;
this.BUTTONTYPE_LIST = [goto, goto, goto, send, send, send, other, other];
this.FORM_SUBMIT_SCORE = 0;
this.FORM_GET_TOP_SCORES = 1;
this.FORM_TELL_FRIENDS = 2;
this.COMMAND_SUBMIT_SCORE = "submitScore";
this.COMMAND_GET_TOP_SCORES = "getTopScores";
this.COMMAND_TELL_FRIENDS = "tellFriends";
this.ERROR_NONE = 0;
this.ERROR_BUSY = 1;
this.ERROR_COMMS_FAILED = 2;
this.ERROR_BACKEND_FAILED = 3;
this.PAGE_INTRO = 0;
this.PAGE_INSTRUCTIONS = 1;
this.PAGE_GAME_OVER = 2;
this.PAGE_TELL_A_FRIEND = 3;
this.PAGE_ENTER_LEAGUE = 4;
this.PAGE_LEAGUE_TABLE = 5;
this.PAGE_VENETIAN_GOLD = 6;
this.PAGE_CREDITS = 7;
this.PAGE_LOADING = 8;
this.PAGES = 9;
this.BALL_RADIUS = 24;
this.WOODWORK_RADIUS = 12;
this.X_GOAL_L = -605;
this.X_GOAL_R = 615;
this.Y_BOARD = 270;
this.Y_GOAL = 425;
this.Z_FENCE = 4000;
this.Z_NET = 2500;
this.Z_GOAL = 2000;
this.Z_GOALIE = 1900;
this.Z_WALL = 700;
this.Z_CAMERA = -500;
this.ZDEPTH_BACK = 1;
this.ZDEPTH_NET = 3;
this.ZDEPTH_GOAL = 5;
this.ZDEPTH_GOALIE = 7;
this.ZDEPTH_WALL = 9;
this.ZDEPTH_LAUNCHER = 11;
this.ZDEPTH_DISPLAYS = 13;
this.ZDEPTH_PANEL = 100;
this.ZDEPTH_CONTENT = 200;
this.ZDEPTH_MENU = 300;
this.ZDEPTH_BORDER = 400;
this.ZDEPTH_FRAME = 500;
this.ZDEPTH_UNDER = -1;
this.ZDEPTH_OVER = 1;
this.MODE_GAME_VIEWING_PAGES = 0;
this.MODE_GAME_PREPARING_SHOT = 1;
this.MODE_GAME_AIMING_SHOT = 2;
this.MODE_GAME_FLYING_BALL = 3;
this.MODE_PAGE_OFF = 0;
this.MODE_PAGE_PREPARING_VIEW = 1;
this.MODE_PAGE_ANIMATING_ON = 2;
this.MODE_PAGE_ON = 3;
this.MODE_ANIMATING_OFF = 4;
this.MODE_LAUNCHER_LOCKED = 0;
this.MODE_LAUNCHER_STATIC = 1;
this.MODE_LAUNCHER_AUTO = 2;
this.MODE_LAUNCHER_AIM = 3;
this.MODE_LAUNCHER_SWERVE = 4;
this.MODE_BALL_STATIC = 0;
this.MODE_BALL_FLYING = 1;
this.MODE_BALL_SEEKING = 2;
this.MODE_BALL_DEAD = 3;
this.MODE_GOALIE_READY = 0;
this.MODE_GOALIE_TRACKING = 1;
this.MODE_GOALIE_DIVING = 2;
this.MODE_GOALIE_WAITING = 3;
this.MODE_GOALIE_RESETING = 4;
this.MODE_WALL_READY = 0;
this.MODE_WALL_SEEKING = 1;
this.RAD_TO_DEG = 57.2957795130823;
this.DEG_TO_RAD = (Math.PI/180);
if (_root.goldUrl != null) {
this.URL_VENETIAN_GOLD = _root.goldUrl;
}
}
fscommand ("showmenu", "false");
fscommand ("allowScale", "false");
fscommand ("fullScreen", "false");
oC = new constantsObject();
_quality = oC.QUALITY_LOW;
play();
Instance of Symbol 26 MovieClip "iBack" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 31 MovieClip "iNet" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 34 MovieClip "iGoal" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 51 MovieClip "iGoalie" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 56 MovieClip "iWall" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 81 MovieClip "iLauncher" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 86 MovieClip "iBall" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 104 MovieClip "iDisplays" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 201 MovieClip "iItem0" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 205 MovieClip "iItem1" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 209 MovieClip "iItem2" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 215 MovieClip "iItem3" in Frame 4
onClipEvent (load) {
this._visible = false;
}
Frame 5
function func_degToRad(degrees) {
return((degrees * Math.PI) / 180);
}
function func_radToDeg(radians) {
return((radians * 180) / Math.PI);
}
function func_aTanRadians(x, y) {
var angle;
if (y == 0) {
var rightAngle = (Math.PI/2);
if (0 < x) {
angle = rightAngle;
} else {
angle = -rightAngle;
}
} else {
angle = Math.atan(x / y);
}
return(angle);
}
function func_aTanDegrees(x, y) {
var angle;
if (y == 0) {
if (0 < x) {
angle = 90;
} else {
angle = -90;
}
} else {
angle = Math.atan(x / y) * _root.oC.RAD_TO_DEG;
}
return(angle);
}
function func_randomInt(range) {
return(Math.floor((range - 0.001) * Math.random()));
}
function func_wrapInt(value, min, max) {
if (value < min) {
value = (min - value) + (max - 1);
} else if (max < value) {
value = (value - max) + (min - 1);
}
return(value);
}
function func_sign(value) {
return((2 * (value >= 0)) - 1);
}
function func_stringToBool(theString) {
with (this) {
return(theString.toUpperCase() != "FALSE");
}
}
function func_boolToString(theBool) {
with (this) {
return(theBool.toString().toUpperCase());
}
}
function func_allSpaces(theString) {
with (this) {
var spaces = "";
var i = 0;
while (i < theString.length) {
spaces = spaces + " ";
i++;
}
return(theString.indexOf(spaces) != -1);
}
}
function func_isBlank(theString) {
with (this) {
var allSpaces = _root.func_allSpaces(theString);
var empty = ((theString == "") or (theString == null));
return(allSpaces or empty);
}
}
Frame 6
function func_getChildValue(rootNode, childName) {
with (this) {
var node = func_findChildNode(rootNode, childName);
var result;
if (node == null) {
result = null;
} else {
result = node.firstChild.nodeValue;
}
return(result);
}
}
function func_findChildNode(rootNode, childName) {
with (this) {
var childNode = rootNode.firstChild;
while ((childNode.nodeName != childName) and (childNode != null)) {
childNode = childNode.nextSibling;
}
return(childNode);
}
}
function func_getChildList(rootNode, childName) {
with (this) {
var childList = [];
var childNode = rootNode.firstChild;
while (childNode != null) {
if (childNode.nodeName == childName) {
childList.push(childNode);
}
childNode = childNode.nextSibling;
}
return(childList);
}
}
function func_createAppendNode(xmlObj, rootNode, nodeName) {
with (this) {
var node = xmlObj.createElement(nodeName);
rootNode.appendChild(node);
return(node);
}
}
function func_createAppendTextNode(xmlObj, rootNode, nodeName, contentText) {
with (this) {
var node = func_createAppendNode(xmlObj, rootNode, nodeName);
textNode = xmlObj.createTextNode(contentText);
node.appendChild(textNode);
return(node);
}
}
Frame 7
function soundsObject(game) {
this.oGame = game;
this.pKick = this.addSound("sound_kick", _root);
this.pBounce = this.addSound("sound_bounce", _root.iBall);
this.pWoodwork = this.addSound("sound_woodwork", _root);
this.pAtmosphere = this.addSound("sound_atmosphere", _root.iBack);
this.pGoal = this.addSound("sound_goal", _root.iGoal);
this.pMiss = this.addSound("sound_miss", _root.iNet);
this.pWhistle = this.addSound("sound_whistle", _root.iDisplays);
}
soundsObject.prototype.addSound = function (soundName, movie) {
with (this) {
var s = new sound(movie);
s.attachSound(soundName);
return(s);
}
};
Frame 9
function cameraObject(game) {
this.oC = game.oC;
this.pOriginX = 350;
this.pOriginY = 310;
this.pVanishingPointY = 150;
this.pFocalLength = 800;
this.pX = 0;
this.init();
this.reset();
}
cameraObject.prototype.init = function () {
with (this) {
}
};
cameraObject.prototype.reset = function () {
with (this) {
pX = 0;
}
};
cameraObject.prototype.setPosition = function (x) {
with (this) {
pX = x;
}
};
cameraObject.prototype.calculateScreenPosition = function (object, x, y, z) {
with (this) {
var perspective = (pFocalLength / (z + pFocalLength));
var screenX = (pOriginX + ((x - pX) * perspective));
var height = (y * perspective);
var groundScreenY = (pVanishingPointY * (1 - (pFocalLength / (pFocalLength + z))));
var screenY = (pOriginY - (groundScreenY + height));
object.setScreenPosition(screenX, screenY, height, perspective);
}
};
Frame 10
function viewObject(game) {
this.mBack = _root.iBack;
this.mNet = _root.iNet;
this.mGoal = _root.iGoal;
this.mGoalie = _root.iGoalie;
this.mWall = _root.iWall;
this.mLauncher = _root.iLauncher;
this.mBall = _root.iBall;
this.mDisplays = _root.iDisplays;
this.mPanelAnim = _root.iPanelAnim;
this.mContent = _root.iContent;
this.mBorder = _root.iBorder;
this.mFrame = _root.iFrame;
this.oGame = game;
this.oCamera = game.oCamera;
this.oArrivalCallback = null;
this.oC = game.oC;
this.pFrames = 200;
this.pSnapDistance = 0.1;
this.pAcceleration = 10;
this.pDeceleration = 2;
this.pViewScaleX = 13.4;
this.pTrackingInertia = 2;
this.pMoving = true;
this.pDestX = 100;
this.pX = 100;
this.pSpeed = 0;
this.init();
}
viewObject.prototype.init = function () {
with (this) {
mBack.swapDepths(oC.ZDEPTH_BACK);
mNet.swapDepths(oC.ZDEPTH_NET);
mGoal.swapDepths(oC.ZDEPTH_GOAL);
mGoalie.swapDepths(oC.ZDEPTH_GOALIE);
mWall.swapDepths(oC.ZDEPTH_WALL);
mLauncher.swapDepths(oC.ZDEPTH_LAUNCHER);
mDisplays.swapDepths(oC.ZDEPTH_DISPLAYS);
mBorder.swapDepths(oC.ZDEPTH_BORDER);
mFrame.swapDepths(oC.ZDEPTH_FRAME);
mPanelAnim.swapDepths(oC.ZDEPTH_PANEL);
mContent.swapDepths(oC.ZDEPTH_CONTENT);
mBack.gotoAndStop(pFrames);
mNet.gotoAndStop(pFrames);
mGoal.gotoAndStop(pFrames);
mLauncher._x = 999;
mGoalie._x = 999;
mWall._x = 999;
mBall._x = 999;
mBack._visible = true;
mNet._visible = true;
mGoal._visible = true;
mGoalie._visible = true;
mWall._visible = true;
mLauncher._visible = true;
mDisplays._visible = true;
mBall._visible = true;
}
};
viewObject.prototype.setDestination = function (destX, callbackObject) {
with (this) {
oArrivalCallback = callbackObject;
pDestX = Math.max(0, Math.min(100, destX));
pMoving = true;
}
};
viewObject.prototype.update = function () {
with (this) {
if (pMoving) {
var distance = (pDestX - pX);
var arrived = (pSnapDistance >= Math.abs(distance));
if (arrived) {
arriveAtDestination();
} else {
updatePosition(distance);
}
updateCamera();
updateMovies();
}
}
};
viewObject.prototype.setRandomDestination = function () {
with (this) {
var r = Math.random();
if (r >= 0.98) {
setDestination(100, null);
} else if ((r >= 0.74) and (0.76 >= r)) {
setDestination(75, null);
} else if ((r >= 0.49) and (0.51 >= r)) {
setDestination(50, null);
} else if ((r >= 0.24) and (0.26 >= r)) {
setDestination(25, null);
} else if (0.02 >= r) {
setDestination(0, null);
} else {
setDestination(r * 100, null);
}
}
};
viewObject.prototype.updatePosition = function (distance) {
with (this) {
var accel = pAcceleration;
var decel = pDeceleration;
if (oGame.pMode == oC.MODE_GAME_FLYING_BALL) {
accel = accel * pTrackingInertia;
decel = decel * pTrackingInertia;
}
var decelSpeed = (distance / decel);
var speedChange = ((decelSpeed - pSpeed) / accel);
var accelSpeed = (pSpeed + speedChange);
var accelerating = (Math.abs(accelSpeed) < Math.abs(decelSpeed));
if (accelerating) {
pSpeed = accelSpeed;
} else {
pSpeed = decelSpeed;
}
pX = pX + pSpeed;
}
};
viewObject.prototype.updateCamera = function () {
with (this) {
oCamera.setPosition(pViewScaleX * (pX - 50));
}
};
viewObject.prototype.updateMovies = function () {
with (this) {
var frame = Math.floor((pX * pFrames) / 100);
mBack.gotoAndStop(frame);
mNet.gotoAndStop(frame);
mGoal.gotoAndStop(frame);
}
};
viewObject.prototype.arriveAtDestination = function () {
with (this) {
pX = pDestX;
pSpeed = 0;
pMoving = false;
if (oArrivalCallback != null) {
oArrivalCallback.viewArrived();
}
}
};
Frame 11
function launcherObject(game) {
this.mLauncher = _root.iLauncher;
this.mArrow = this.mLauncher.iArrow;
this.mRadial = this.mLauncher.iRadial;
this.mAltitude = this.mLauncher.iAltitude;
this.mInputPoint = this.mLauncher.iInputPoint;
this.mCircle = this.mLauncher.iCircle;
this.mButton = this.mLauncher.iButton;
this.mShotNumber = this.mLauncher.iShotNumber;
this.oGame = game;
this.oCamera = game.oCamera;
this.oC = game.oC;
this.pInputInertia = 3;
this.pInputLimitX = 50;
this.pInputLimitY = [];
this.pInputMinY = 4;
this.pInputAreaHeight = 40;
this.pInputScale = 1.75;
this.pOvalRadiusH = 50;
this.pOvalRadiusV = 18;
this.pAngleCorrection = 7;
this.pAspectRatio = this.pOvalRadiusH / (this.pOvalRadiusV - this.pAngleCorrection);
this.pChipCorrection = 1.4;
this.pChipPower = 150;
this.pPower = 300;
this.pViewCorrection = 61.75;
this.pXCorrection = 825;
this.pRangeX = 900;
this.pMode = null;
this.pInputX = 0;
this.pInputY = 0;
this.pArrowX = 0;
this.pArrowY = 0;
this.pArrowAngle = 0;
this.pRadialY = 0;
this.pInputRadialY = 0;
this.pRadialAngle = 0;
this.pAltitudeHeight = 0;
this.pX = 0;
this.pPressX = 0;
this.pPressY = 0;
this.pSwerveInputX = 0;
this.pScreenX = this.mLauncher._x;
this.pScreenY = this.mLauncher._y;
this.pHeightAboveGround = 0;
this.pPerspective = 1;
this.init();
this.reset();
}
launcherObject.prototype.init = function () {
with (this) {
mLauncher.oLauncher = this;
var yScale = (pOvalRadiusV / pInputLimitX);
var rSquared = (pInputLimitX * pInputLimitX);
var y;
var x = 0;
while (pInputLimitX >= x) {
y = Math.sqrt(rSquared - (x * x));
pInputLimitY[x] = Math.max(pInputMinY, y * yScale);
x = x + 1;
}
}
};
launcherObject.prototype.reset = function () {
with (this) {
setPosition(0);
updateSwerve(0);
skipShowSpotAnimation();
changeModeTo(oC.MODE_LAUNCHER_LOCKED);
}
};
launcherObject.prototype.launch = function (ball) {
with (this) {
var power = (pPower / (pAltitudeHeight + pChipPower));
var dx = (power * pArrowX);
var dy = ((power * pAltitudeHeight) / pChipCorrection);
var dz = ((power * pAspectRatio) * (-pRadialY));
var launchAngle = _root.func_aTanRadians(dx, dz);
var viewOffset = ((50 - oGame.oView.pX) / pViewCorrection);
var xOffset = (pX / pXCorrection);
var correctedAngle = (((launchAngle * 1.1) + viewOffset) + xOffset);
var xzPower = Math.sqrt((dx * dx) + (dz * dz));
dx = xzPower * Math.sin(correctedAngle);
dz = xzPower * Math.cos(correctedAngle);
ball.reset();
ball.kick(dx, dy, dz, pSwerveInputX);
}
};
launcherObject.prototype.setRandomPosition = function () {
with (this) {
var x = (((Math.random() * pRangeX) * 2) - pRangeX);
setPosition(x);
}
};
launcherObject.prototype.setPosition = function (x) {
with (this) {
pX = x;
}
};
launcherObject.prototype.startShowSpotAnimation = function () {
with (this) {
mCircle.gotoAndPlay("showSpot");
}
};
launcherObject.prototype.skipShowSpotAnimation = function () {
with (this) {
mCircle.gotoAndStop("skipShowSpot");
endShowSpotAnimation();
}
};
launcherObject.prototype.endShowSpotAnimation = function () {
with (this) {
var viewX = ((48 * (pX / pRangeX)) + 50);
oGame.endShowSpotAnimation(viewX);
}
};
launcherObject.prototype.lock = function () {
with (this) {
changeModeTo(oC.MODE_LAUNCHER_LOCKED);
}
};
launcherObject.prototype.unlock = function () {
with (this) {
if (pMode == oC.MODE_LAUNCHER_LOCKED) {
changeModeTo(oC.MODE_LAUNCHER_AUTO);
}
}
};
launcherObject.prototype.changeModeTo = function (newMode) {
with (this) {
if (pMode == oC.MODE_LAUNCHER_SWERVE) {
updateSwerve(0);
pInputX = mLauncher._xmouse;
pInputY = mLauncher._ymouse;
updateGeometry();
}
pMode = newMode;
if (pMode == oC.MODE_LAUNCHER_AIM) {
enableTriangle(true);
enableInputPoint(true, true);
enableButton(true);
} else if (pMode == oC.MODE_LAUNCHER_SWERVE) {
enableTriangle(true);
enableArrow(true);
enableInputPoint(false, false);
enableButton(true);
} else if (pMode == oC.MODE_LAUNCHER_AUTO) {
enableTriangle(true);
enableInputPoint(true, false);
enableButton(true);
} else if (pMode == oC.MODE_LAUNCHER_STATIC) {
enableInputPoint(false, false);
enableTriangle(false);
enableButton(true);
} else if (pMode == oC.MODE_LAUNCHER_LOCKED) {
enableTriangle(false);
enableInputPoint(false, false);
enableButton(false);
}
}
};
launcherObject.prototype.enableInputPoint = function (visible, replaceCursor) {
with (this) {
mInputPoint._visible = visible;
if (replaceCursor) {
Mouse.hide();
mInputPoint.startDrag(true);
} else {
Mouse.show();
mInputPoint.stopDrag();
}
}
};
launcherObject.prototype.enableTriangle = function (visible) {
with (this) {
mArrow._visible = visible;
mRadial._visible = visible;
mAltitude._visible = visible;
}
};
launcherObject.prototype.enableArrow = function (visible) {
with (this) {
pInputX = mLauncher._xmouse - pPressX;
mArrow._visible = visible;
}
};
launcherObject.prototype.enableButton = function (visible) {
with (this) {
mButton._visible = visible;
}
};
launcherObject.prototype.stopSwerving = function () {
with (this) {
changeModeTo(oC.MODE_LAUNCHER_STATIC);
var overFlag = mButton.hitTest(_root._xMouse, _root._yMouse);
rollOverHandler(overFlag);
}
};
launcherObject.prototype.rollOverHandler = function (overFlag) {
with (this) {
if ((pMode != oC.MODE_LAUNCHER_LOCKED) and (pMode != oC.MODE_LAUNCHER_SWERVE)) {
if (overFlag) {
changeModeTo(oC.MODE_LAUNCHER_AIM);
} else {
changeModeTo(oC.MODE_LAUNCHER_STATIC);
}
}
}
};
launcherObject.prototype.pressHandler = function () {
with (this) {
if (pMode != oC.MODE_LAUNCHER_LOCKED) {
pPressX = mLauncher._xmouse;
pPressY = mLauncher._ymouse;
changeModeTo(oC.MODE_LAUNCHER_SWERVE);
}
}
};
launcherObject.prototype.releaseHandler = function () {
with (this) {
if (pMode != oC.MODE_LAUNCHER_LOCKED) {
oGame.takeShot();
}
}
};
launcherObject.prototype.update = function () {
with (this) {
updateScreenPosition();
updateMovie();
if (pMode == oC.MODE_LAUNCHER_AIM) {
if (setInputsFromMouse()) {
updateGeometry();
}
} else if (pMode == oC.MODE_LAUNCHER_SWERVE) {
if (setInputsFromSwerve()) {
updateSwerve(pInputX * -2);
}
} else if (pMode == oC.MODE_LAUNCHER_AUTO) {
if (setInputsFromAuto()) {
updateGeometry();
}
}
}
};
launcherObject.prototype.timedLaunch = function (seconds) {
with (this) {
var time = getTimer();
if ((_root.lastBall + (seconds * 1000)) < time) {
launch(oGame.oBall);
_root.lastBall = time;
}
}
};
launcherObject.prototype.updateScreenPosition = function () {
with (this) {
oCamera.calculateScreenPosition(this, pX, 0, 0);
}
};
launcherObject.prototype.setScreenPosition = function (x, y, height, perspective) {
with (this) {
pScreenX = x;
pScreenY = y;
pHeightAboveGround = height;
pPerspective = perspective;
}
};
launcherObject.prototype.updateMovie = function () {
with (this) {
mLauncher._x = pScreenX;
}
};
launcherObject.prototype.setInputsFromMouse = function () {
with (this) {
var mouseX = mLauncher._xmouse;
var mouseY = mLauncher._ymouse;
var inputX = (pInputX + ((mouseX - pInputX) / pInputInertia));
var inputY = (pInputY + ((mouseY - pInputY) / pInputInertia));
var changedFlag = limitInputs(inputX, inputY);
return(changedFlag);
}
};
launcherObject.prototype.setInputsFromAuto = function () {
with (this) {
var time = (getTimer() / 500);
var inputX = (pOvalRadiusH * Math.sin(time));
var inputY = (((pOvalRadiusV * 2) * Math.cos(time)) + (pInputAreaHeight / 2));
var changedFlag = limitInputs(inputX, inputY);
mInputPoint._x = pInputX;
mInputPoint._y = pInputY;
return(changedFlag);
}
};
launcherObject.prototype.limitInputs = function (inputX, inputY) {
with (this) {
if (inputX < (-pInputLimitX)) {
inputX = -pInputLimitX;
} else if (pInputLimitX < inputX) {
inputX = pInputLimitX;
}
var x = Math.abs(Math.round(inputX));
pInputRadialY = pInputLimitY[x];
var minInputY = pInputRadialY;
var maxInputY = (minInputY + pInputAreaHeight);
if (inputY < minInputY) {
inputY = minInputY;
} else if (maxInputY < inputY) {
inputY = maxInputY;
}
var changedFlag = ((inputX != pInputX) or (inputY != pInputY));
pInputX = inputX;
pInputY = inputY;
return(changedFlag);
}
};
launcherObject.prototype.setInputsFromSwerve = function () {
with (this) {
var mouseX = ((mLauncher._xmouse - pPressX) * 3);
var mouseY = ((mLauncher._ymouse - pPressY) * 3);
var inputX = (pInputX + ((mouseX - pInputX) / pInputInertia));
var inputY = (pInputY + ((mouseY - pInputY) / pInputInertia));
var changedFlag = limitInputs(inputX, inputY);
return(changedFlag);
}
};
launcherObject.prototype.updateSwerve = function (swerveX) {
with (this) {
pSwerveInputX = swerveX;
mArrow.gotoAndStop(Math.round(swerveX / 4) + 51);
}
};
launcherObject.prototype.updateGeometry = function () {
with (this) {
pArrowX = (-pInputX) * pInputScale;
pArrowY = (-pInputY) * pInputScale;
pRadialY = (-pInputRadialY) * pInputScale;
updateArrow();
updateRadial();
updateAltitude();
}
};
launcherObject.prototype.updateArrow = function () {
with (this) {
mArrow._x = pArrowX;
mArrow._y = pArrowY;
pArrowAngle = -_root.func_aTanDegrees(pArrowX, pArrowY);
mArrow._rotation = pArrowAngle;
}
};
launcherObject.prototype.updateRadial = function () {
with (this) {
mRadial._x = pArrowX;
mRadial._y = pRadialY;
pRadialAngle = -_root.func_aTanDegrees(pArrowX, pRadialY);
mRadial._rotation = pRadialAngle;
}
};
launcherObject.prototype.updateAltitude = function () {
with (this) {
mAltitude._x = pArrowX;
mAltitude._y = pArrowY;
pAltitudeHeight = pRadialY - pArrowY;
mAltitude._height = pAltitudeHeight;
}
};
launcherObject.prototype.showShotNumber = function (shotNumber) {
with (this) {
mShotNumber.vShot = "SHOT " + shotNumber;
mShotNumber.gotoAndPlay("on");
}
};
launcherObject.prototype.hideShotNumber = function () {
with (this) {
mShotNumber.gotoAndStop("off");
}
};
Frame 12
function ballObject(game) {
this.mBall = _root.iBall;
this.mShadow = this.mBall.iShadow;
this.mDisplays = _root.iDisplays;
this.mDeadBall = this.mDisplays.iDeadBall;
this.mNetWobble = _root.iNet.iWobble;
this.mGoalie = _root.iGoalie.iAnim;
this.mWall = _root.iWall.iAnim;
this.oGame = game;
this.oCamera = game.oCamera;
this.oC = game.oC;
this.pGravity = -3;
this.pAirFriction = 0.98;
this.pGroundFriction = 0.92;
this.pBounce = 0.6;
this.pMinBounce = 2;
this.pBallHitRadius = this.oC.BALL_RADIUS + this.oC.WOODWORK_RADIUS;
this.pReturnInertia = 5;
this.pRollOnInertia = 4;
this.pSeekInertia = null;
this.pSeekBounce = 5;
this.pSnapDistance = 50;
this.pSnapSpeed = 2;
this.pDisplaysOffsetX = -this.mDisplays._x;
this.pDisplaysOffsetY = -this.mDisplays._y;
this.pGoalieHitRadius = 7;
this.pSwerveScale = 0.05;
this.pSwerveStrength = 1.006;
this.pSwerveDuration = 15;
this.pMode = null;
this.pOriginalSwerveX = 0;
this.pSwerveX = 0;
this.pSwerveTime = 0;
this.pX = 0;
this.pY = 0;
this.pZ = 0;
this.pOldX = 0;
this.pOldY = 0;
this.pOldZ = 0;
this.pDX = 0;
this.pDY = 0;
this.pDZ = 0;
this.pDestX = 0;
this.pDestY = 0;
this.pDestZ = 0;
this.pBehindWall = false;
this.pBehindGoalie = false;
this.pBehindGoal = false;
this.pBehindNet = false;
this.pInGoal = false;
this.pScreenX = this.mBall._x;
this.pScreenY = this.mBall._y;
this.pHeightAboveGround = 0;
this.pPerspective = 1;
this.init();
this.reset();
}
ballObject.prototype.init = function () {
with (this) {
}
};
ballObject.prototype.reset = function () {
with (this) {
resetZDepthFlags();
resetZdepth();
setPositionStatic(oGame.oLauncher.pX, 0, 0);
changeModeTo(oC.MODE_BALL_STATIC);
}
};
ballObject.prototype.kick = function (dx, dy, dz, swerveX) {
with (this) {
pOriginalSwerveX = swerveX * pSwerveScale;
pSwerveX = pOriginalSwerveX;
pSwerveTime = pSwerveDuration;
setSpeed(dx, dy, dz);
oGame.oSounds.pKick.start();
changeModeTo(oC.MODE_BALL_FLYING);
}
};
ballObject.prototype.startReturnToLauncher = function () {
with (this) {
var launcherX = oGame.oLauncher.pX;
seekPoint(launcherX, 0, 0, pReturnInertia);
}
};
ballObject.prototype.rollOn = function () {
with (this) {
var launcherX = oGame.oLauncher.pX;
setPositionStatic(launcherX, 0, oC.Z_CAMERA);
seekPoint(launcherX, 0, 0, pRollOnInertia);
}
};
ballObject.prototype.seekPoint = function (x, y, z, inertia) {
with (this) {
resetZdepth();
pSeekInertia = inertia;
setDestinationPosition(x, y, z);
changeModeTo(oC.MODE_BALL_SEEKING);
}
};
ballObject.prototype.isInMode = function (mode) {
with (this) {
return(mode == pMode);
}
};
ballObject.prototype.changeModeTo = function (newMode) {
with (this) {
if (pMode == oC.MODE_BALL_DEAD) {
mBall._x = 999;
mBall._visible = true;
}
pMode = newMode;
if (pMode == oC.MODE_BALL_DEAD) {
mBall._visible = false;
}
}
};
ballObject.prototype.update = function () {
with (this) {
updateScreenPosition();
updateMovie();
if (pMode == oC.MODE_BALL_FLYING) {
updateFlying();
} else if (pMode == oC.MODE_BALL_SEEKING) {
updateSeeking();
}
}
};
ballObject.prototype.updateSeeking = function () {
with (this) {
var dx = (pDestX - pX);
var dz = (pDestZ - pZ);
var d = (Math.abs(dx) + Math.abs(dz));
var destY = (d / pSeekBounce);
var dy = (destY - pY);
if (d < pSnapDistance) {
pX = pDestX;
pY = pDestY;
pZ = pDestZ;
changeModeTo(oC.MODE_BALL_STATIC);
} else {
pX = pX + (dx / pSeekInertia);
pY = pY + (dy / pSeekInertia);
pZ = pZ + (dz / pSeekInertia);
}
}
};
ballObject.prototype.updateFlying = function () {
with (this) {
updatePhysics();
checkIfDead();
}
};
ballObject.prototype.updatePhysics = function () {
with (this) {
var friction;
var gravity;
if ((pY == 0) and (pDY == 0)) {
friction = pGroundFriction;
gravity = 0;
} else {
friction = pAirFriction;
gravity = pGravity;
}
if (0 < pSwerveTime) {
pSwerveTime = pSwerveTime - 1;
pSwerveX = pSwerveX * pSwerveStrength;
pDX = pDX + pSwerveX;
}
setSpeed(pDX * friction, pDY + gravity, pDZ * friction);
setOldPosition(pX, pY, pZ);
setPosition(pX + pDX, pY + pDY, pZ + pDZ);
detectCollisions();
}
};
ballObject.prototype.updateScreenPosition = function () {
with (this) {
oCamera.calculateScreenPosition(this, pX, pY, pZ);
}
};
ballObject.prototype.updateMovie = function () {
with (this) {
mBall._x = pScreenX;
mBall._y = pScreenY;
var scale = (100 * pPerspective);
mBall._xScale = scale;
mBall._yScale = scale;
var shadowOffset = ((pHeightAboveGround * 100) / scale);
mShadow._x = (-shadowOffset) / 2;
mShadow._y = shadowOffset;
}
};
ballObject.prototype.checkIfDead = function () {
with (this) {
var stopped = isStopped();
var offScreen = isOffScreen();
if (stopped or offScreen) {
if (!offScreen) {
showDeadBall();
}
setSpeed(0, 0, 0);
changeModeTo(oC.MODE_BALL_DEAD);
}
}
};
ballObject.prototype.isStopped = function () {
with (this) {
var stopped = (pY == 0);
if (stopped) {
var speed = ((Math.abs(pDX) + Math.abs(pDY)) + Math.abs(pDZ));
stopped = speed < pSnapSpeed;
}
return(stopped);
}
};
ballObject.prototype.isOffScreen = function () {
with (this) {
var x = mBall._x;
var offFlag = ((x < 0) or (oC.MOVIE_WIDTH < x));
if (!offFlag) {
offFlag = pZ < oC.Z_CAMERA;
}
return(offFlag);
}
};
ballObject.prototype.showDeadBall = function () {
with (this) {
mDeadBall._x = mBall._x + pDisplaysOffsetX;
mDeadBall._y = mBall._y + pDisplaysOffsetY;
mDeadBall._xScale = mBall._xScale;
mDeadBall._yScale = mBall._yScale;
mDeadBall.gotoAndPlay("on");
}
};
ballObject.prototype.detectCollisions = function () {
with (this) {
if (pY < 0) {
hitGround();
}
var crossingGoalLine = crossingLineZ(oC.Z_GOAL);
if (crossingGoalLine) {
pBehindGoal = crossingGoalLine < 0;
var hitFlag = detectHitGoalie();
if (!hitFlag) {
detectHitGoal();
}
if (!pInGoal) {
var missSound = oGame.oSounds.pMiss;
var x = (100 - (Math.max(0, Math.abs(pX) - oC.X_GOAL_R) / 4));
var volume = Math.max(10, Math.min(90, x));
var pan = Math.max(-100, Math.min(100, (-pX) / 10));
missSound.setPan(pan);
missSound.setVolume(volume);
missSound.start();
oGame.pNoise = Math.max(oGame.pDestNoise, volume);
}
} else {
detectHitNotGoal();
}
updateZdepth();
}
};
ballObject.prototype.detectHitGoal = function () {
with (this) {
var betweenPosts = ((pX >= oC.X_GOAL_L) and (oC.X_GOAL_R >= pX));
var belowBar = (pY < oC.Y_GOAL);
var barDY = (pY - oC.Y_GOAL);
var absBarDY = Math.abs(barDY);
var nearBar = (pBallHitRadius >= absBarDY);
if (nearBar and betweenPosts) {
hitBar(barDY, absBarDY);
} else if (belowBar) {
detectHitPosts(betweenPosts);
}
}
};
ballObject.prototype.detectHitPosts = function (betweenPosts) {
with (this) {
var leftPostDX = (pX - oC.X_GOAL_L);
var absLeftPostDX = Math.abs(leftPostDX);
if (pBallHitRadius >= absLeftPostDX) {
hitPost(leftPostDX, absLeftPostDX, 1);
} else {
var rightPostDX = (pX - oC.X_GOAL_R);
var absRightPostDX = Math.abs(rightPostDX);
if (pBallHitRadius >= absRightPostDX) {
hitPost(rightPostDX, absRightPostDX, -1);
} else if (betweenPosts) {
goalDetected();
}
}
}
};
ballObject.prototype.detectHitNotGoal = function () {
with (this) {
if (pBehindGoal) {
var crossingNetLine = crossingLineZ(oC.Z_NET);
if (crossingNetLine) {
pBehindNet = crossingNetLine < 0;
detectHitNet();
}
detectHitBehindGoal();
} else {
var hitFlag = detectHitGoalie();
if (!hitFlag) {
detectHitWall();
}
}
}
};
ballObject.prototype.detectHitNet = function () {
with (this) {
if ((oC.Y_GOAL >= pY) or (oC.Y_GOAL >= pOldY)) {
if ((pX >= oC.X_GOAL_L) or (pOldX >= oC.X_GOAL_L)) {
if ((oC.X_GOAL_R >= pX) or (oC.X_GOAL_R >= pOldX)) {
hitNet();
}
}
}
}
};
ballObject.prototype.detectHitBehindGoal = function () {
with (this) {
if (pBehindNet) {
if (oC.Z_FENCE < pZ) {
hitFence();
}
} else {
detectHitTopNet();
detectHitSideNets();
}
}
};
ballObject.prototype.detectHitGoalie = function () {
with (this) {
var hitFlag = false;
var crossingGoalieLine = crossingLineZ(oC.Z_GOALIE);
if (crossingGoalieLine) {
pBehindGoalie = crossingGoalieLine < 0;
hitFlag = detectHitMovie(mGoalie, pGoalieHitRadius);
if (hitFlag) {
hitGoalie();
}
}
return(hitFlag);
}
};
ballObject.prototype.detectHitWall = function () {
with (this) {
var crossingWallLine = crossingLineZ(oC.Z_WALL);
if (crossingWallLine) {
pBehindWall = crossingWallLine < 0;
var hitFlag = detectHitMovie(mWall, mBall._width / 4.5);
if (hitFlag) {
hitWall();
}
}
}
};
ballObject.prototype.detectHitMovie = function (mMovie, r) {
with (this) {
var hitFlag = mMovie.hitTest(mBall);
if (hitFlag) {
var x = pScreenX;
var y = pScreenY;
hitFlag = mMovie.hitTest(x, y - r, true);
if (!hitFlag) {
hitFlag = mMovie.hitTest(x - r, y, true);
if (!hitFlag) {
hitFlag = mMovie.hitTest(x + r, y, true);
if (!hitFlag) {
hitFlag = mMovie.hitTest(x, y + r, true);
if (!hitFlag) {
hitFlag = detectBallDiagonals(mMovie, r);
}
}
}
}
}
return(hitFlag);
}
};
ballObject.prototype.detectBallDiagonals = function (mTarget, radius) {
with (this) {
var d = (radius * 0.7);
var x = pScreenX;
var y = pScreenY;
var hitFlag = mTarget.hitTest(x - d, y + d, true);
if (!hitFlag) {
hitFlag = mTarget.hitTest(x + d, y + d, true);
if (!hitFlag) {
hitFlag = mTarget.hitTest(x - d, y - d, true);
if (!hitFlag) {
hitFlag = mTarget.hitTest(x + d, y - d, true);
}
}
}
return(hitFlag);
}
};
ballObject.prototype.detectHitTopNet = function () {
with (this) {
if ((pX >= oC.X_GOAL_L) and (oC.X_GOAL_R >= pX)) {
var crossingTopNet = crossingLineY(oC.Y_GOAL);
if (crossingTopNet) {
hitTopNet(crossingTopNet);
}
}
}
};
ballObject.prototype.detectHitSideNets = function () {
with (this) {
if ((oC.Y_GOAL >= pY) or (oC.Y_GOAL >= pOldY)) {
if (crossingLineX(oC.X_GOAL_L)) {
hitSideNet(oC.X_GOAL_L);
} else if (crossingLineX(oC.X_GOAL_R)) {
hitSideNet(oC.X_GOAL_R);
}
}
}
};
ballObject.prototype.crossingLineX = function (lineX) {
with (this) {
var crossed = 0;
if (pX >= lineX) {
crossed = -(pOldX < lineX);
}
if (lineX >= pX) {
crossed = lineX < pOldX;
}
return(crossed);
}
};
ballObject.prototype.crossingLineY = function (lineY) {
with (this) {
var crossed = 0;
if (pY >= lineY) {
crossed = -(pOldY < lineY);
}
if (lineY >= pY) {
crossed = lineY < pOldY;
}
return(crossed);
}
};
ballObject.prototype.crossingLineZ = function (lineZ) {
with (this) {
var crossed = 0;
if (pZ >= lineZ) {
crossed = -(pOldZ < lineZ);
}
if (lineZ >= pZ) {
crossed = lineZ < pOldZ;
}
return(crossed);
}
};
ballObject.prototype.hitGround = function () {
with (this) {
pY = 0;
pDY = (-pDY) * pBounce;
pOldY = pY;
pSwerveX = 0;
if (pDY < pMinBounce) {
pDY = 0;
}
var bounceSound = oGame.oSounds.pBounce;
var volume = Math.max(0, Math.min(100, Math.abs(pDY) * 2));
var pan = Math.max(-100, Math.min(100, (-pX) / 7));
bounceSound.setPan(pan);
bounceSound.setVolume(volume);
bounceSound.start();
}
};
ballObject.prototype.hitFence = function () {
with (this) {
pZ = oC.Z_FENCE;
pOldZ = pZ;
if (oC.Y_BOARD < pY) {
pDX = pDX / 6;
pDY = pDY / 6;
pDZ = (pBounce / 1.7) * (-pDZ);
} else {
pDX = pDX / 3;
pDZ = pBounce * (-pDZ);
}
pSwerveX = 0;
}
};
ballObject.prototype.hitNet = function () {
with (this) {
pBehindNet = !pBehindNet;
pZ = oC.Z_NET;
pOldZ = pZ;
pDX = pDX / 10;
pDY = 0;
pDZ = (-pDZ) / 20;
mNetWobble.gotoAndPlay("wobble");
pSwerveX = 0;
}
};
ballObject.prototype.hitSideNet = function (netX) {
with (this) {
pX = netX;
pOldX = pX;
pDX = (-pDX) / 10;
pDY = 1;
pDZ = pDZ / 10;
pSwerveX = 0;
}
};
ballObject.prototype.hitTopNet = function (aboveNet) {
with (this) {
pY = oC.Y_GOAL;
pOldY = pY;
if (0 < aboveNet) {
pDZ = -Math.abs(pDZ);
hitNet();
pDZ = 30;
} else {
pDX = pDX / 10;
pDY = 0;
pDZ = pDZ / 10;
}
pSwerveX = 0;
}
};
ballObject.prototype.hitBar = function (barDY, absBarDY) {
with (this) {
var hitDZ = pDZ;
var zFactor = (((2 * absBarDY) / pBallHitRadius) - 1);
pDZ = zFactor * (pDZ * pBounce);
var sign = 1;
if (barDY != 0) {
sign = barDY / absBarDY;
}
var yFactor = ((1 - Math.abs(zFactor)) * sign);
pDY = pDY + ((yFactor * hitDZ) / 4);
pZ = oC.Z_GOAL;
pOldZ = pZ;
pSwerveX = 0;
oGame.increaseScore(oC.SCORE_HIT_BAR, pScreenX, pScreenY - 12);
oGame.oSounds.pWoodwork.start();
if (0 >= pDZ) {
pBehindGoal = false;
} else if (barDY < 0) {
goalDetected();
}
}
};
ballObject.prototype.hitPost = function (postDX, absPostDX, inGoalSign) {
with (this) {
var hitDZ = pDZ;
var zFactor = (((2 * absPostDX) / pBallHitRadius) - 1);
pDZ = zFactor * (pDZ * pBounce);
var sign = 1;
if (postDX != 0) {
sign = postDX / absPostDX;
}
var xFactor = ((1 - Math.abs(zFactor)) * sign);
pDX = pDX + (xFactor * hitDZ);
pZ = oC.Z_GOAL;
pOldZ = pZ;
pSwerveX = 0;
oGame.increaseScore(oC.SCORE_HIT_POST, pScreenX, pScreenY + 12);
oGame.oSounds.pWoodwork.start();
if (pDZ < 0) {
pBehindGoal = false;
} else if (0 < (postDX * inGoalSign)) {
goalDetected();
}
}
};
ballObject.prototype.hitGoalie = function () {
with (this) {
pZ = oC.Z_GOALIE;
pOldZ = pZ;
pDX = pDX / 4;
pDY = pDY / 4;
pDZ = (-pDZ) / 4;
pSwerveX = 0;
pBehindGoalie = !pBehindGoalie;
var bounceSound = oGame.oSounds.pBounce;
var volume = Math.max(20, Math.min(100, Math.abs(pDZ) * 2));
var pan = Math.max(-100, Math.min(100, (-pX) / 7));
bounceSound.setPan(pan);
bounceSound.setVolume(volume);
bounceSound.start();
pBehindGoal = false;
}
};
ballObject.prototype.hitWall = function () {
with (this) {
pZ = oC.Z_WALL;
pOldZ = pZ;
pDX = ((pX - oGame.oWall.pX) + 100) / 3;
pDY = pDY / 1.5;
pDZ = (-pDZ) / 5;
pSwerveX = 0;
var bounceSound = oGame.oSounds.pBounce;
var pan = Math.max(-100, Math.min(100, (-pX) / 7));
bounceSound.setPan(pan);
bounceSound.setVolume(100);
bounceSound.start();
pBehindWall = !pBehindWall;
}
};
ballObject.prototype.goalDetected = function () {
with (this) {
if (!pInGoal) {
var cornerPoints = ((Math.abs(pX) / oC.X_GOAL_R) * oC.SCORE_CORNER);
var heightPoints = ((Math.abs(pY) / oC.Y_GOAL) * oC.SCORE_HEIGHT);
var swervePoints = ((Math.abs(pOriginalSwerveX) / 5) * oC.SCORE_SWERVE);
var points = Math.floor(((oC.SCORE_GOAL + cornerPoints) + heightPoints) + swervePoints);
oGame.scoreGoal(points, pScreenX, pScreenY);
pInGoal = true;
}
}
};
ballObject.prototype.resetZDepthFlags = function () {
with (this) {
pBehindWall = false;
pBehindGoalie = false;
pBehindGoal = false;
pBehindNet = false;
pInGoal = false;
}
};
ballObject.prototype.resetZdepth = function () {
with (this) {
setZdepth(oC.ZDEPTH_LAUNCHER + oC.ZDEPTH_OVER);
}
};
ballObject.prototype.updateZdepth = function () {
with (this) {
if (!pBehindWall) {
setZdepthBehind(oC.ZDEPTH_WALL, false);
} else if (!pBehindGoalie) {
setZdepthBehind(oC.ZDEPTH_GOALIE, false);
} else if (!pBehindGoal) {
setZdepthBehind(oC.ZDEPTH_GOAL, false);
} else {
setZdepthBehind(oC.ZDEPTH_NET, pBehindNet);
}
}
};
ballObject.prototype.setZdepthBehind = function (depth, behindFlag) {
with (this) {
var depthOffset;
if (behindFlag) {
depthOffset = oC.ZDEPTH_UNDER;
} else {
depthOffset = oC.ZDEPTH_OVER;
}
setZdepth(depth + depthOffset);
}
};
ballObject.prototype.setZdepth = function (depth) {
with (this) {
mBall.swapDepths(depth);
}
};
ballObject.prototype.setPositionStatic = function (x, y, z) {
with (this) {
setPosition(x, y, z);
setOldPosition(x, y, z);
setSpeed(0, 0, 0);
}
};
ballObject.prototype.setPosition = function (x, y, z) {
with (this) {
if (x != null) {
pX = x;
}
if (y != null) {
pY = y;
}
if (z != null) {
pZ = z;
}
}
};
ballObject.prototype.setOldPosition = function (x, y, z) {
with (this) {
if (x != null) {
pOldX = x;
}
if (y != null) {
pOldY = y;
}
if (z != null) {
pOldZ = z;
}
}
};
ballObject.prototype.setDestinationPosition = function (x, y, z) {
with (this) {
if (x != null) {
pDestX = x;
}
if (y != null) {
pDestY = y;
}
if (z != null) {
pDestZ = z;
}
}
};
ballObject.prototype.setSpeed = function (dx, dy, dz) {
with (this) {
if (dx != null) {
pDX = dx;
}
if (dy != null) {
pDY = dy;
}
if (dz != null) {
pDZ = dz;
}
}
};
ballObject.prototype.setScreenPosition = function (x, y, height, perspective) {
with (this) {
pScreenX = x;
pScreenY = y;
pHeightAboveGround = height;
pPerspective = perspective;
}
};
Frame 13
function goalieObject(game) {
this.mGoalie = _root.iGoalie;
this.mAnim = this.mGoalie.iAnim;
this.mLegs = this.mAnim.iLegs;
this.mArms = this.mAnim.iArms;
this.oGame = game;
this.oCamera = game.oCamera;
this.oBall = game.oBall;
this.oC = game.oC;
this.pWobbleX = 7;
this.pWobblePeriod = 90;
this.pWobbleArms = 20;
this.pArmsPeriod = 200;
this.pArmsInertia = 2.5;
this.pResetInertia = 8;
this.pTrackingInertia = 3;
this.pRangeX = 600;
this.pSnapX = 20;
this.pMode = null;
this.pX = 0;
this.pResetX = 0;
this.pArmsHeight = 0;
this.pArmsDest = 0;
this.pScreenX = this.mGoalie._x;
this.pScreenY = this.mGoalie._y;
this.pHeightAboveGround = 0;
this.pPerspective = 1;
this.init();
this.reset();
}
goalieObject.prototype.init = function () {
with (this) {
}
};
goalieObject.prototype.reset = function () {
with (this) {
setPosition(pResetX);
changeModeTo(oC.MODE_GOALIE_READY);
}
};
goalieObject.prototype.setPosition = function (x) {
with (this) {
pX = x;
}
};
goalieObject.prototype.changeModeTo = function (newMode) {
with (this) {
pMode = newMode;
if (pMode == oC.MODE_GOALIE_READY) {
mLegs.vMove = false;
} else if (pMode == oC.MODE_GOALIE_WAITING) {
mLegs.vMove = false;
} else if (pMode == oC.MODE_GOALIE_RESETING) {
mLegs.vMove = true;
pArmsDest = 100;
}
}
};
goalieObject.prototype.update = function () {
with (this) {
if (pMode == oC.MODE_GOALIE_TRACKING) {
updateTracking();
} else if (pMode == oC.MODE_GOALIE_READY) {
updateReady();
} else if (pMode == oC.MODE_GOALIE_RESETING) {
updateReseting();
} else if (pMode == oC.MODE_GOALIE_WAITING) {
updateWaiting();
}
updateScreenPosition();
updateMovie();
}
};
goalieObject.prototype.updateReady = function () {
with (this) {
var time = getTimer();
var destX = (pResetX + (pWobbleX * Math.sin(time / pWobblePeriod)));
pX = pX + ((destX - pX) / pResetInertia);
pArmsDest = 30 + (pWobbleArms * Math.sin(time / pArmsPeriod));
}
};
goalieObject.prototype.updateTracking = function () {
with (this) {
var destX = Math.max(-pRangeX, Math.min(pRangeX, oBall.pX));
var dx = (destX - pX);
pX = pX + (dx / pTrackingInertia);
mLegs.vMove = pSnapX < Math.abs(dx);
pArmsDest = Math.min(100, oBall.pY / 2);
if (oBall.pBehindGoal or (oBall.pDZ < 0)) {
changeModeTo(oC.MODE_GOALIE_WAITING);
}
}
};
goalieObject.prototype.updateWaiting = function () {
with (this) {
pArmsDest = pArmsDest / 1.3;
}
};
goalieObject.prototype.updateReseting = function () {
with (this) {
var dx = (pResetX - pX);
pX = pX + (dx / pResetInertia);
if (Math.abs(dx) < pSnapX) {
changeModeTo(oC.MODE_GOALIE_READY);
}
}
};
goalieObject.prototype.updateScreenPosition = function () {
with (this) {
oCamera.calculateScreenPosition(this, pX, 0, oC.Z_GOALIE);
}
};
goalieObject.prototype.setScreenPosition = function (x, y, height, perspective) {
with (this) {
pScreenX = x;
pScreenY = y;
pHeightAboveGround = height;
pPerspective = perspective;
}
};
goalieObject.prototype.updateMovie = function () {
with (this) {
mGoalie._x = pScreenX;
pArmsHeight = pArmsHeight + ((pArmsDest - pArmsHeight) / pArmsInertia);
var frame = (Math.floor(pArmsHeight) + 1);
mArms.gotoAndStop(frame);
}
};
Frame 14
function wallObject(game) {
this.mWall = _root.iWall;
this.oGame = game;
this.oCamera = game.oCamera;
this.oC = game.oC;
this.pSeekingInertia = 7;
this.pSnapX = 1;
this.pPracticeX = -200;
this.pMoveDistance = 100;
this.pMode = null;
this.pX = -500;
this.pDestX = 0;
this.pScreenX = this.mWall._x;
this.pScreenY = this.mWall._y;
this.pHeightAboveGround = 0;
this.pPerspective = 1;
this.init();
this.reset();
}
wallObject.prototype.init = function () {
with (this) {
}
};
wallObject.prototype.reset = function () {
with (this) {
startSeeking(pPracticeX);
}
};
wallObject.prototype.setPosition = function (x) {
with (this) {
pX = x;
}
};
wallObject.prototype.startSeeking = function (x) {
with (this) {
if (pMode != oC.MODE_WALL_SEEKING) {
changeModeTo(oC.MODE_WALL_SEEKING);
}
pDestX = x;
}
};
wallObject.prototype.startRandomMove = function (x) {
with (this) {
var sign;
if (Math.random() < 0.5) {
sign = -1;
} else {
sign = 1;
}
startSeeking(x + (pMoveDistance * sign));
}
};
wallObject.prototype.changeModeTo = function (newMode) {
with (this) {
pMode = newMode;
}
};
wallObject.prototype.update = function () {
with (this) {
if (pMode == oC.MODE_WALL_READY) {
updateReady();
} else if (pMode == oC.MODE_WALL_SEEKING) {
updateSeeking();
}
updateScreenPosition();
updateMovie();
}
};
wallObject.prototype.updateReady = function () {
with (this) {
}
};
wallObject.prototype.updateSeeking = function () {
with (this) {
var dx = (pDestX - pX);
pX = pX + (dx / pSeekingInertia);
if (Math.abs(dx) < pSnapX) {
pX = pDestX;
changeModeTo(oC.MODE_WALL_READY);
}
}
};
wallObject.prototype.updateScreenPosition = function () {
with (this) {
oCamera.calculateScreenPosition(this, pX, 0, oC.Z_WALL);
}
};
wallObject.prototype.setScreenPosition = function (x, y, height, perspective) {
with (this) {
pScreenX = x;
pScreenY = y;
pHeightAboveGround = height;
pPerspective = perspective;
}
};
wallObject.prototype.updateMovie = function () {
with (this) {
mWall._x = pScreenX;
}
};
Frame 15
function scoreObject(game) {
this.mDisplays = _root.iDisplays;
this.mScore = this.mDisplays.iScore;
this.mPointsDisplayList = [];
this.oGame = game;
this.oC = game.oC;
this.pPointDisplays = 3;
this.pDisplaysOffsetX = -this.mDisplays._x;
this.pDisplaysOffsetY = -this.mDisplays._y;
this.pVisible = false;
this.pScore = 0;
this.pGoals = 0;
this.pNextPointDisplay = 0;
this.init();
this.reset();
}
scoreObject.prototype.init = function () {
with (this) {
var mPoints;
var i = 0;
while (i < pPointDisplays) {
mPoints = eval ("mDisplays.iPoints" + i);
mPointsDisplayList[i] = mPoints;
i++;
}
}
};
scoreObject.prototype.reset = function () {
with (this) {
pScore = 0;
displayScore(pScore);
pGoals = 0;
displayGoals(pGoals);
flashCursor();
}
};
scoreObject.prototype.increaseScore = function (points, x, y) {
with (this) {
pScore = pScore + points;
displayScore(pScore);
flashCursor();
showPoints(points, x, y);
}
};
scoreObject.prototype.increaseGoals = function () {
with (this) {
pGoals++;
displayGoals(pGoals);
}
};
scoreObject.prototype.displayScore = function (score) {
with (this) {
if (score < 10) {
score = "000" + score;
} else if (score < 100) {
score = "00" + score;
} else if (score < 1000) {
score = "0" + score;
}
mScore.vScore = score;
}
};
scoreObject.prototype.flashCursor = function () {
with (this) {
mScore.iCursor.gotoAndPlay("on");
}
};
scoreObject.prototype.showHide = function (showFlag) {
with (this) {
if (showFlag != pVisible) {
var frame;
if (showFlag) {
frame = "animateOn";
} else {
frame = "animateOff";
}
mScore.gotoAndPlay(frame);
pVisible = showFlag;
}
}
};
scoreObject.prototype.showPoints = function (points, x, y) {
with (this) {
var mPoints = mPointsDisplayList[pNextPointDisplay];
pNextPointDisplay++;
if (pNextPointDisplay == pPointDisplays) {
pNextPointDisplay = 0;
}
mPoints.vPoints = points;
mPoints._x = x + pDisplaysOffsetX;
mPoints._y = y + pDisplaysOffsetY;
mPoints.gotoAndPlay("on");
}
};
scoreObject.prototype.displayGoals = function () {
with (this) {
var units = (pGoals % 10);
var tens = Math.floor(pGoals / 10);
mScore.vGoals = (tens + " ") + units;
}
};
Frame 16
function timerObject(game) {
this.mDisplays = _root.iDisplays;
this.mTimer = this.mDisplays.iTimer;
this.oGame = game;
this.oC = game.oC;
this.pRunning = false;
this.pEndTime = 0;
this.pOldSeconds = null;
this.pVisible = false;
this.init();
this.reset();
}
timerObject.prototype.init = function () {
with (this) {
}
};
timerObject.prototype.reset = function () {
with (this) {
pRunning = false;
pVisible = false;
mTimer.gotoAndStop("off");
}
};
timerObject.prototype.setCountdown = function (duration) {
with (this) {
var startTime = getTimer();
pEndTime = startTime + (duration * 1000);
pOldSeconds = null;
pRunning = true;
}
};
timerObject.prototype.update = function () {
with (this) {
if (pRunning) {
var seconds = Math.floor((pEndTime - getTimer()) / 1000);
if (0 >= seconds) {
timeout();
} else if (seconds != pOldSeconds) {
pOldSeconds = seconds;
displayTime(seconds);
if (seconds == oC.TIME_WARNING) {
flashCursor();
}
}
}
}
};
timerObject.prototype.timeout = function () {
with (this) {
pRunning = false;
displayTime(0);
oGame.endCountdown();
}
};
timerObject.prototype.displayTime = function (seconds) {
with (this) {
var mins = Math.floor(seconds / 60);
var secs = (seconds - (mins * 60));
if (secs < 10) {
secs = "0" + secs;
}
mTimer.vTime = (("0" + mins) + ":") + secs;
}
};
timerObject.prototype.flashCursor = function () {
with (this) {
mTimer.iCursor.gotoAndPlay("on");
}
};
timerObject.prototype.showHide = function (showFlag) {
with (this) {
if (showFlag != pVisible) {
var frame;
if (showFlag) {
frame = "animateOn";
} else {
frame = "animateOff";
}
mTimer.gotoAndPlay(frame);
pVisible = showFlag;
}
}
};
Frame 17
function panelObject(game) {
this.mPanelAnim = _root.iPanelAnim;
this.mPanel = this.mPanelAnim.iPanel;
this.mItemList = [];
this.oGame = game;
this.oCamera = game.oCamera;
this.oView = game.oView;
this.oC = game.oC;
this.pItems = 4;
this.pOnViewPosition = 60;
this.pOffViewPosition = 0;
this.pBallSeekInertia = 3;
this.pBallReturnInertia = 2;
this.pMode = null;
this.pItemXList = new Array(this.pItems);
this.pItemZList = new Array(this.pItems);
this.pMenuActive = false;
this.pHighlightItem = null;
this.pScreenX = this.mLauncher._x;
this.pScreenY = this.mLauncher._y;
this.pHeightAboveGround = 0;
this.pPerspective = 1;
this.init();
this.reset();
}
panelObject.prototype.init = function () {
with (this) {
var mItem;
var i = 0;
while (i < pItems) {
mItem = eval ("_root.iItem" + i);
mItemList[i] = mItem;
mItem.oPanel = this;
mItem.vItemNumber = i;
mItem.swapDepths((oC.ZDEPTH_MENU + i) + 1);
pItemXList[i] = 195;
pItemZList[i] = 470 - (i * 195);
i++;
}
}
};
panelObject.prototype.reset = function () {
with (this) {
highlightMenuItem(null);
changeModeTo(oC.MODE_PAGE_OFF);
}
};
panelObject.prototype.startAnimatingOn = function (pageID) {
with (this) {
changeModeTo(oC.MODE_PAGE_ANIMATING_ON);
mPanel.gotoAndStop(pageID + 1);
oView.setDestination(pOnViewPosition, this);
}
};
panelObject.prototype.viewArrived = function () {
with (this) {
if (pMode == oC.MODE_PAGE_ANIMATING_ON) {
endAnimatingOn();
} else if (pMode == oC.MODE_PAGE_ANIMATING_OFF) {
endAnimatingOff();
}
}
};
panelObject.prototype.endAnimatingOn = function () {
with (this) {
menuItemRollOverHandler(null, false);
oGame.oPages.oContent.startAnimatingOn();
}
};
panelObject.prototype.startAnimatingOff = function () {
with (this) {
changeModeTo(oC.MODE_PAGE_ANIMATING_OFF);
oView.setDestination(pOffViewPosition, this);
}
};
panelObject.prototype.endAnimatingOff = function () {
with (this) {
changeModeTo(oC.MODE_PAGE_OFF);
oGame.oPages.endAnimatingOff();
}
};
panelObject.prototype.changeModeTo = function (newMode) {
with (this) {
if (pMode == oC.MODE_PAGE_OFF) {
showHide(true);
}
pMode = newMode;
if (pMode == oC.MODE_PAGE_OFF) {
showHide(false);
}
}
};
panelObject.prototype.showHide = function (showFlag) {
with (this) {
mPanelAnim._visible = showFlag;
var i = 0;
while (i < pItems) {
mItemList[i]._visible = showFlag;
i++;
}
}
};
panelObject.prototype.buttonHandler = function (buttonID, mForm) {
with (this) {
if (pMenuActive) {
pMenuActive = false;
oGame.oPages.buttonHandler(buttonID, mForm);
}
}
};
panelObject.prototype.menuItemPressHandler = function (itemNumber) {
with (this) {
if (pMenuActive) {
pMenuActive = false;
highlightMenuItem(itemNumber);
oGame.menuItemPressHandler(itemNumber);
}
}
};
panelObject.prototype.highlightMenuItem = function (itemNumber) {
with (this) {
if (pHighlightItem != null) {
mItemList[pHighlightItem].gotoAndStop("off");
}
if (itemNumber != null) {
mItemList[itemNumber].gotoAndStop("on");
}
pHighlightItem = itemNumber;
}
};
panelObject.prototype.menuItemRollOverHandler = function (itemNumber, overFlag) {
with (this) {
if (pMenuActive) {
if (overFlag) {
oGame.oLauncher.lock();
var x = ((pItemXList[itemNumber] - 35) - (itemNumber * 2));
var y = 0;
var z = pItemZList[itemNumber];
oGame.oBall.seekPoint(x, y, z, pBallSeekInertia);
} else {
oGame.oLauncher.unlock();
oGame.oBall.seekPoint(0, 0, 0, pBallReturnInertia);
}
}
}
};
panelObject.prototype.update = function () {
with (this) {
if (pMode != oC.MODE_PAGE_OFF) {
var i = 0;
while (i < pItems) {
updateItemPosition(i);
i++;
}
var frame = ((2 * Math.round(oGame.oView.pX)) + 1);
mPanelAnim.gotoAndStop(frame);
}
}
};
panelObject.prototype.updateItemPosition = function (itemNumber) {
with (this) {
var x = pItemXList[itemNumber];
var z = pItemZList[itemNumber];
oCamera.calculateScreenPosition(this, x, 0, z);
var mItem = mItemList[itemNumber];
mItem._x = pScreenX;
mItem._y = pScreenY;
}
};
panelObject.prototype.setScreenPosition = function (x, y, height, perspective) {
with (this) {
pScreenX = x;
pScreenY = y;
pHeightAboveGround = height;
pPerspective = perspective;
}
};
Frame 18
function contentObject(game) {
this.mContent = _root.iContent;
this.mPageList = [];
this.mLoadingPage = null;
this.mLeagueTablePage = null;
this.oGame = game;
this.oC = game.oC;
this.pPages = this.oC.PAGES;
this.pMode = null;
this.init();
this.reset();
}
contentObject.prototype.init = function () {
with (this) {
var mPage;
var i = 0;
while (i < pPages) {
mPage = eval ("mContent.iPage" + i);
mPageList[i] = mPage;
mPage.oContent = this;
mPage.oGame = oGame;
i++;
}
mLoadingPage = mPageList[oC.PAGE_LOADING];
mLeagueTablePage = mPageList[oC.PAGE_LEAGUE_TABLE];
}
};
contentObject.prototype.reset = function () {
with (this) {
changeModeTo(oC.MODE_PAGE_OFF);
}
};
contentObject.prototype.startAnimatingOn = function () {
with (this) {
_quality = oC.QUALITY_MEDIUM;
changeModeTo(oC.MODE_PAGE_ANIMATING_ON);
var pageID = oGame.oPages.pCurrentPageID;
mPageList[pageID].gotoAndPlay("animateOn");
}
};
contentObject.prototype.endAnimatingOn = function () {
with (this) {
_quality = oC.QUALITY_HIGH;
changeModeTo(oC.MODE_PAGE_ON);
oGame.oPages.endAnimatingOn();
}
};
contentObject.prototype.startAnimatingOff = function () {
with (this) {
changeModeTo(oC.MODE_PAGE_ANIMATING_OFF);
var pageID = oGame.oPages.pCurrentPageID;
mPageList[pageID].gotoAndPlay("animateOff");
}
};
contentObject.prototype.endAnimatingOff = function () {
with (this) {
_quality = oC.QUALITY_LOW;
changeModeTo(oC.MODE_PAGE_OFF);
oGame.oPages.oPanel.startAnimatingOff();
}
};
contentObject.prototype.changeModeTo = function (newMode) {
with (this) {
if (pMode == oC.MODE_PAGE_OFF) {
showHide(true);
}
pMode = newMode;
if (pMode == oC.MODE_PAGE_OFF) {
showHide(false);
}
}
};
contentObject.prototype.showHide = function (showFlag) {
with (this) {
mContent._visible = showFlag;
}
};
contentObject.prototype.setLoadingText = function (heading, bodyText) {
with (this) {
if (heading != null) {
mLoadingPage.vHeading = heading;
}
if (bodyText != null) {
mLoadingPage.vBodyText = bodyText;
}
}
};
contentObject.prototype.setLoadingState = function (errorID) {
with (this) {
mLoadingPage.setLoadingState(errorID);
}
};
contentObject.prototype.setTableRow = function (rowNumber, rowData) {
with (this) {
mLeagueTablePage.setTableRow(rowNumber, rowData);
}
};
Frame 19
function pagesObject(game) {
this.oGame = game;
this.oView = game.oView;
this.oPanel = new panelObject(game);
this.oContent = new contentObject(game);
this.oFormData = null;
this.oC = game.oC;
this.pViewReadyPosition = 0;
this.pMenuCommandList = [];
this.pMenuParameterList = [];
this.pMode = null;
this.pCurrentPageID = null;
this.pNextPageID = null;
this.pMenuCommand = null;
this.pMenuParameter = null;
this.init();
this.reset();
}
pagesObject.prototype.init = function () {
with (this) {
pMenuCommandList[0] = oC.MENU_COMMAND_GOTO_PAGE;
pMenuCommandList[1] = oC.MENU_COMMAND_GOTO_PAGE;
pMenuCommandList[2] = oC.MENU_COMMAND_GOTO_PAGE;
pMenuCommandList[3] = oC.MENU_COMMAND_START_GAME;
pMenuParameterList[0] = oC.PAGE_INSTRUCTIONS;
pMenuParameterList[1] = oC.PAGE_VENETIAN_GOLD;
pMenuParameterList[2] = oC.PAGE_CREDITS;
pMenuParameterList[3] = null;
}
};
pagesObject.prototype.reset = function () {
with (this) {
clearMenuCommand();
changeModeTo(oC.MODE_PAGE_OFF);
}
};
pagesObject.prototype.gotoPage = function (pageID) {
with (this) {
pNextPageID = pageID;
if (pMode == oC.MODE_PAGE_ON) {
startAnimatingOff();
} else if (pMode == oC.MODE_PAGE_OFF) {
if (pageID != null) {
startPreparingView();
}
}
}
};
pagesObject.prototype.startPreparingView = function () {
with (this) {
changeModeTo(oC.MODE_PAGE_PREPARING_VIEW);
oGame.oTimer.showHide(false);
oView.setDestination(pViewReadyPosition, this);
}
};
pagesObject.prototype.viewArrived = function () {
with (this) {
if (pMode == oC.MODE_PAGE_PREPARING_VIEW) {
startAnimatingOn();
}
}
};
pagesObject.prototype.startAnimatingOn = function () {
with (this) {
pCurrentPageID = pNextPageID;
pNextPageID = null;
changeModeTo(oC.MODE_PAGE_ANIMATING_ON);
if (pCurrentPageID == oC.PAGE_GAME_OVER) {
oGame.oLauncher.reset();
oGame.oBall.startReturnToLauncher();
}
oPanel.startAnimatingOn(pCurrentPageID);
}
};
pagesObject.prototype.endAnimatingOn = function () {
with (this) {
changeModeTo(oC.MODE_PAGE_ON);
if (pNextPageID != null) {
gotoPage(pNextPageID);
} else {
oPanel.pMenuActive = true;
oGame.pageArrived(pCurrentPageID);
}
}
};
pagesObject.prototype.startAnimatingOff = function () {
with (this) {
changeModeTo(oC.MODE_PAGE_ANIMATING_OFF);
oContent.startAnimatingOff();
}
};
pagesObject.prototype.endAnimatingOff = function () {
with (this) {
changeModeTo(oC.MODE_PAGE_OFF);
if (pNextPageID != null) {
gotoPage(pNextPageID);
} else if (pMenuCommand != null) {
processMenuCommand(pMenuCommand, pMenuParameter);
}
}
};
pagesObject.prototype.changeModeTo = function (newMode) {
with (this) {
pMode = newMode;
}
};
pagesObject.prototype.buttonHandler = function (buttonID, mForm) {
with (this) {
var buttonType = oC.BUTTONTYPE_LIST[buttonID];
if (buttonType == oC.BUTTONTYPE_GOTO_PAGE) {
processGotoPageButton(buttonID);
} else if (buttonType == oC.BUTTONTYPE_SUBMIT_FORM) {
processSubmitButton(buttonID, mForm);
} else if (buttonType == oC.BUTTONTYPE_OTHER) {
processOtherButton(buttonID);
}
}
};
pagesObject.prototype.processGotoPageButton = function (buttonID) {
with (this) {
var pageID = null;
if (buttonID == oC.BUTTON_CREDITS) {
pageID = oC.PAGE_CREDITS;
} else if (buttonID == oC.BUTTON_ENTER_LEAGUE) {
pageID = oC.PAGE_ENTER_LEAGUE;
} else if (buttonID == oC.BUTTON_TELL_A_FRIEND) {
pageID = oC.PAGE_TELL_A_FRIEND;
}
if (pageID != null) {
oGame.clearMenuHighlight();
gotoPage(pageID);
}
}
};
pagesObject.prototype.processSubmitButton = function (buttonID, mForm) {
with (this) {
var formID = null;
if (buttonID == oC.SEND_SUBMIT_SCORE) {
formID = oC.FORM_SUBMIT_SCORE;
} else if (buttonID == oC.SEND_GET_TOP_SCORES) {
formID = oC.FORM_GET_TOP_SCORES;
} else if (buttonID == oC.SEND_TELL_FRIENDS) {
formID = oC.FORM_TELL_FRIENDS;
}
if (formID != null) {
var valid = trySubmitForm(formID, mForm);
if (valid) {
oGame.clearMenuHighlight();
gotoPage(oC.PAGE_LOADING);
} else {
oPanel.pMenuActive = true;
}
}
}
};
pagesObject.prototype.processOtherButton = function (buttonID) {
with (this) {
if (buttonID == oC.BUTTON_CANCEL) {
processCancelButton();
} else if (buttonID == oC.BUTTON_OK) {
processOKButton();
}
}
};
pagesObject.prototype.processCancelButton = function () {
with (this) {
var pageID = null;
var formID = oFormData.pFormID;
if (formID == oC.FORM_SUBMIT_SCORE) {
pageID = oC.PAGE_ENTER_LEAGUE;
} else if (formID == oC.FORM_GET_TOP_SCORES) {
pageID = oC.PAGE_LEAGUE_TABLE;
} else if (formID == oC.FORM_TELL_FRIENDS) {
pageID = oC.PAGE_TELL_A_FRIEND;
}
if (pageID != null) {
oGame.clearMenuHighlight();
gotoPage(pageID);
}
}
};
pagesObject.prototype.processOKButton = function () {
with (this) {
var pageID = null;
var formID = oFormData.pFormID;
if (formID == oC.FORM_SUBMIT_SCORE) {
pageID = oC.PAGE_LEAGUE_TABLE;
} else if (formID == oC.FORM_GET_TOP_SCORES) {
pageID = oC.PAGE_LEAGUE_TABLE;
} else if (formID == oC.FORM_TELL_FRIENDS) {
pageID = oC.PAGE_TELL_A_FRIEND;
}
if (pageID != null) {
oGame.clearMenuHighlight();
gotoPage(pageID);
}
}
};
pagesObject.prototype.trySubmitForm = function (formID, mForm) {
with (this) {
oFormData = extractFormData(formID, mForm);
validateForm(oFormData);
var valid = oFormData.pValid;
if (valid) {
submitForm(oFormData);
} else {
displayValidationError(oFormData);
}
return(valid);
}
};
pagesObject.prototype.submitForm = function (formData) {
with (this) {
oContent.setLoadingState(oC.ERROR_BUSY);
oGame.submitForm(formData);
}
};
pagesObject.prototype.extractFormData = function (formID, mForm) {
with (this) {
var formData = new Object();
formData.pFormID = formID;
formData.mForm = mForm;
if (formID == oC.FORM_SUBMIT_SCORE) {
formData.pCommand = oC.COMMAND_SUBMIT_SCORE;
formData.pEmail = _root.vEmail;
formData.pNickname = _root.vNickname;
formData.pCountry = _root.vCountry;
formData.pDpa = _root.vDpa;
formData.pScore = oGame.oScore.pScore;
formData.pGoals = oGame.oScore.pGoals;
} else if (formID == oC.FORM_GET_TOP_SCORES) {
formData.pCommand = oC.COMMAND_GET_TOP_SCORES;
formData.pEmail = _root.vEmail;
} else if (formID == oC.FORM_TELL_FRIENDS) {
formData.pCommand = oC.COMMAND_TELL_FRIENDS;
formData.pEmail = _root.vEmail;
formData.pFriendList = [];
var i = 0;
while (i < 5) {
formData.pFriendList[i] = eval ("_root.vFriend" + i);
i++;
}
}
return(formData);
}
};
pagesObject.prototype.validateForm = function (formData) {
with (this) {
formData.pValid = true;
var formID = formData.pFormID;
if (formID == oC.FORM_SUBMIT_SCORE) {
validateSubmitScore(formData);
} else if (formID == oC.FORM_GET_TOP_SCORES) {
validateGetTopScores(formData);
} else if (formID == oC.FORM_TELL_FRIENDS) {
validateTellFriends(formData);
}
}
};
pagesObject.prototype.validateSubmitScore = function (formData) {
with (this) {
var email = formData.pEmail;
validateEmail(formData, email);
if (formData.pValid) {
if (_root.func_isBlank(formData.pNickname)) {
var indexAt = email.indexOf("@");
var nickname = email.substring(0, indexAt);
formData.pNickname = nickname;
}
if (_root.func_isBlank(formData.pCountry)) {
var indexDot = email.lastIndexOf(".");
var country = email.substring(indexDot + 1);
formData.pCountry = country;
}
}
}
};
pagesObject.prototype.validateGetTopScores = function (formData) {
with (this) {
var email = formData.pEmail;
if (_root.func_isBlank(email)) {
formData.pEmail = "";
} else {
validateEmail(formData, email);
}
}
};
pagesObject.prototype.validateTellFriends = function (formData) {
with (this) {
validateEmail(formData, formData.pEmail);
if (formData.pValid) {
var friendList = formData.pFriendList;
var friendCount = 0;
var friend;
var blank;
var i = 0;
while (i < 5) {
friend = friendList[i];
if (!_root.func_isBlank(friend)) {
validateEmail(formData, friend);
friendCount++;
if (!formData.pValid) {
break;
}
}
i++;
}
if (formData.pValid and (friendCount == 0)) {
setRequiredError(formData, "'YOUR FRIENDS'. Enter at least one.");
}
}
}
};
pagesObject.prototype.validateRequired = function (formData, fieldName, fieldValue) {
with (this) {
var valid = (!_root.func_isBlank(fieldValue));
if (!valid) {
setRequiredError(formData, ("'" + fieldName) + "'");
}
}
};
pagesObject.prototype.validateEmail = function (formData, email) {
with (this) {
var valid = validateEmailFormat(email);
if (!valid) {
setEmailError(formData, email);
}
}
};
pagesObject.prototype.validateEmailFormat = function (email) {
with (this) {
var indexAt = email.indexOf("@");
var url = email.substring(indexAt + 1);
var indexDot = url.indexOf(".");
return(((0 < indexAt) and (0 < indexDot)) and (indexDot < (url.length - 1)));
}
};
pagesObject.prototype.setRequiredError = function (formData, fieldName) {
with (this) {
formData.pErrorMessage = ("This field is required: " + fieldName) + "\n Please fill it in and press the send button again.";
formData.pValid = false;
}
};
pagesObject.prototype.setEmailError = function (formData, email) {
with (this) {
var shortEmail = email.substring(0, 18);
if (shortEmail.length < email.length) {
shortEmail = shortEmail + "...";
}
formData.pErrorMessage = ("This email is not valid: '" + shortEmail) + "'.\n Please correct it and press the send button again.";
formData.pValid = false;
}
};
pagesObject.prototype.displayValidationError = function (formData) {
with (this) {
formData.mForm.vBodyText = formData.pErrorMessage;
}
};
pagesObject.prototype.processMenuSelection = function (itemNumber) {
with (this) {
var command = pMenuCommandList[itemNumber];
var parameter = pMenuParameterList[itemNumber];
if (command == oC.MENU_COMMAND_GOTO_PAGE) {
gotoPage(parameter);
} else {
pMenuCommand = command;
pMenuParameter = parameter;
gotoPage(null);
}
}
};
pagesObject.prototype.processMenuCommand = function (command, parameter) {
with (this) {
if (command == oC.MENU_COMMAND_START_GAME) {
oGame.startGame();
} else if (command == oC.MENU_COMMAND_GET_TOP_SCORES) {
if (!validateEmailFormat(_root.vEmail)) {
_root.vEmail = "";
}
processSubmitButton(oC.SEND_GET_TOP_SCORES, oContent.mLeagueTablePage);
}
clearMenuCommand();
}
};
pagesObject.prototype.clearMenuCommand = function () {
with (this) {
pMenuCommand = null;
pMenuParameter = null;
}
};
pagesObject.prototype.update = function () {
with (this) {
oPanel.update();
}
};
Frame 20
function commsObject(game) {
this.oGame = game;
this.oXmlResponse = new XML();
this.oXmlCommand = new XML();
this.oC = game.oC;
this.pCommandName = null;
this.init();
}
commsObject.prototype.init = function () {
with (this) {
oXmlResponse.onLoad = this.onResponse;
}
};
commsObject.prototype.func_findChildNode = _root.func_findChildNode;
commsObject.prototype.func_getChildValue = _root.func_getChildValue;
commsObject.prototype.func_createAppendNode = _root.func_createAppendNode;
commsObject.prototype.func_createAppendTextNode = _root.func_createAppendTextNode;
commsObject.prototype.func_getChildList = _root.func_getChildList;
commsObject.prototype.sendSubmitScore = function (formData) {
with (this) {
resetXmlCommands();
resetXmlCommands();
var commandNode = addXmlCommand("submitScore");
addXmlCommandParam(commandNode, "email", formData.pEmail);
addXmlCommandParam(commandNode, "nickname", formData.pNickname);
addXmlCommandParam(commandNode, "country", formData.pCountry);
addXmlCommandParam(commandNode, "dpaOption", _root.func_boolToString(formData.pDpa));
addXmlCommandParam(commandNode, "score", formData.pScore);
addXmlCommandParam(commandNode, "goals", formData.pGoals);
sendXmlCommands(oXmlResponse);
}
};
commsObject.prototype.sendGetTopScores = function (formData) {
with (this) {
resetXmlCommands();
resetXmlCommands();
var commandNode = addXmlCommand("getTopScores");
addXmlCommandParam(commandNode, "email", formData.pEmail);
sendXmlCommands(oXmlResponse);
}
};
commsObject.prototype.sendTellFriends = function (formData) {
with (this) {
resetXmlCommands();
resetXmlCommands();
var commandNode = addXmlCommand("tellFriends");
addXmlCommandParam(commandNode, "email", formData.pEmail);
var paramsNode = func_findChildNode(commandNode, "parameters");
var friendsNode = func_createAppendNode(oXmlCommand, paramsNode, "friends");
var friendList = formData.pFriendList;
var friends = friendList.length;
var friendNode;
var email;
var i = 0;
while (i < friends) {
email = friendList[i];
if (!_root.func_isBlank(email)) {
friendNode = func_createAppendNode(oXmlCommand, friendsNode, "friend");
friendNode.attributes.email = email;
}
i++;
}
sendXmlCommands(oXmlResponse);
}
};
commsObject.prototype.resetXmlCommands = function () {
with (this) {
oXmlCommand = new XML();
func_createAppendNode(oXmlCommand, oXmlCommand, "xml");
}
};
commsObject.prototype.addXmlCommand = function (commandName) {
with (this) {
pCommandName = commandName;
var xmlNode = func_findChildNode(oXmlCommand, "xml");
var commandNode = func_createAppendNode(oXmlCommand, xmlNode, "command");
commandNode.attributes.name = commandName;
var paramsNode = func_createAppendNode(oXmlCommand, commandNode, "parameters");
return(commandNode);
}
};
commsObject.prototype.addXmlCommandParam = function (commandNode, paramName, paramValue) {
with (this) {
var paramsNode = func_findChildNode(commandNode, "parameters");
if (paramsNode != null) {
func_createAppendTextNode(oXmlCommand, paramsNode, paramName, paramValue);
}
}
};
commsObject.prototype.sendXmlCommands = function (response) {
with (this) {
if (!oGame.pDebug) {
if (response != null) {
oXmlCommand.sendAndLoad(oC.URL_COMMAND, response);
} else {
oXmlCommand.send(oC.URL_COMMAND);
}
} else {
response.load(("Debug/" + pCommandName) + ".xml");
}
displayCommand();
}
};
commsObject.prototype.displayCommand = function () {
with (this) {
if (oGame.pShowDebug) {
var command = oXmlCommand.toString();
trace(command);
_root.vCommand = command;
}
}
};
commsObject.prototype.getLeagueTableData = function (responseNode) {
with (this) {
var paramsNode = func_findChildNode(responseNode, "parameters");
var playersNode = func_findChildNode(paramsNode, "players");
var playerNodeList = func_getChildList(playersNode, "player");
var rowDataList = [];
var playerNode;
var rowData;
var i = 0;
while (6 >= i) {
playerNode = playerNodeList[i];
rowData = new Object();
rowData.pRank = playerNode.attributes.rank;
rowData.pNickname = _root.func_getChildValue(playerNode, "nickname");
rowData.pCountry = _root.func_getChildValue(playerNode, "country");
rowData.pScore = _root.func_getChildValue(playerNode, "score");
if (rowData.pRank == null) {
rowData.pRank = "";
}
if (rowData.pNickname == null) {
rowData.pNickname = "";
}
if (rowData.pCountry == null) {
rowData.pCountry = "";
}
if (rowData.pScore == null) {
rowData.pScore = "";
}
rowDataList[i] = rowData;
i++;
}
return(rowDataList);
}
};
commsObject.prototype.onResponseHandler = function (rootNode, responseNode) {
with (this) {
if (oGame.pShowDebug) {
var xmlString = rootNode.toString();
trace("\nRESPONSE:" + xmlString);
_root.vCommand = ("RESPONSE:\n" + xmlString) + newline;
}
var statusNode = func_findChildNode(responseNode, "status");
var status = statusNode.firstChild.nodeValue;
if (status != "OK") {
xmlErrorHandler(oC.ERROR_BACKEND_FAILED, rootNode);
} else {
oGame.xmlResponseHandler(responseNode);
}
}
};
commsObject.prototype.xmlErrorHandler = function (errorID, node) {
with (this) {
if (oGame.pShowDebug) {
var xmlString = node.toString();
trace((("\nXML ERROR:" + errorID) + newline) + xmlString);
_root.vCommand = (("XML ERROR:" + errorID) + newline) + xmlString;
}
oGame.xmlErrorHandler(errorID);
}
};
commsObject.prototype.onResponse = function (successFlag) {
with (this) {
if (successFlag) {
var xmlNode = _root.func_findChildNode(this, "xml");
var responseNode = _root.func_findChildNode(xmlNode, "response");
successFlag = responseNode != null;
}
if (successFlag) {
_root.oGame.oComms.onResponseHandler(this, responseNode);
} else {
_root.oGame.oComms.xmlErrorHandler(_root.oC.ERROR_COMMS_FAILED, this);
}
}
};
Frame 21
function gameObject(constants) {
this.oC = constants;
this.pDebug = false;
this.pShowDebug = false;
this.pMode = null;
this.pViewReady = false;
this.pShotNumber = 0;
this.pNoise = 0;
this.pDestNoise = 0;
this.oSounds = new soundsObject(this);
this.oCamera = new cameraObject(this);
this.oView = new viewObject(this);
this.oLauncher = new launcherObject(this);
this.oBall = new ballObject(this);
this.oGoalie = new goalieObject(this);
this.oWall = new wallObject(this);
this.oScore = new scoreObject(this);
this.oTimer = new timerObject(this);
this.oPages = new pagesObject(this);
this.oComms = new commsObject(this);
this.init();
this.reset();
}
gameObject.prototype.init = function () {
with (this) {
oSounds.pAtmosphere.setVolume(0);
oSounds.pAtmosphere.start(0, 999);
pDestNoise = 30;
oScore.showHide(true);
}
};
gameObject.prototype.reset = function () {
with (this) {
changeModeTo(oC.MODE_GAME_VIEWING_PAGES);
oPages.gotoPage(oC.PAGE_INTRO);
}
};
gameObject.prototype.startGame = function () {
with (this) {
pDestNoise = 40;
oSounds.pWhistle.setVolume(5);
oScore.reset();
oTimer.setCountdown(oC.TIME_GAME);
oTimer.showHide(true);
pShotNumber = 1;
startNewShot();
}
};
gameObject.prototype.startNewShot = function () {
with (this) {
pViewReady = false;
changeModeTo(oC.MODE_GAME_PREPARING_SHOT);
oLauncher.setRandomPosition();
oLauncher.startShowSpotAnimation();
var launcherX = oLauncher.pX;
var goalieX;
if (0 < launcherX) {
goalieX = -200 + (launcherX / 5);
} else {
goalieX = 200 + (launcherX / 5);
}
oGoalie.pResetX = goalieX;
oGoalie.changeModeTo(oC.MODE_GOALIE_RESETING);
var noWall = ((pShotNumber % oC.SHOTS_WITHOUT_WALL) == 0);
var wallX;
if (0 < launcherX) {
if (noWall) {
wallX = 1500;
} else {
wallX = 80 + (oLauncher.pX / 1.5);
}
} else if (noWall) {
wallX = -1500;
} else {
wallX = -80 + (oLauncher.pX / 1.5);
}
oWall.startSeeking(wallX);
}
};
gameObject.prototype.endShowSpotAnimation = function (viewX) {
with (this) {
if (pMode == oC.MODE_GAME_PREPARING_SHOT) {
oView.setDestination(viewX, this);
}
}
};
gameObject.prototype.viewArrived = function () {
with (this) {
if (pMode == oC.MODE_GAME_PREPARING_SHOT) {
pViewReady = true;
oLauncher.showShotNumber(pShotNumber);
pShotNumber++;
}
}
};
gameObject.prototype.pageArrived = function (pageID) {
with (this) {
oLauncher.unlock();
}
};
gameObject.prototype.takeShot = function () {
with (this) {
if (pMode == oC.MODE_GAME_AIMING_SHOT) {
oWall.startRandomMove(oWall.pDestX);
oLauncher.launch(oBall);
oLauncher.lock();
changeModeTo(oC.MODE_GAME_FLYING_BALL);
} else {
oLauncher.launch(oBall);
oLauncher.stopSwerving();
}
oGoalie.changeModeTo(oC.MODE_GOALIE_TRACKING);
}
};
gameObject.prototype.changeModeTo = function (newMode) {
with (this) {
pMode = newMode;
}
};
gameObject.prototype.scoreGoal = function (points, screenX, screenY) {
with (this) {
if (pMode == oC.MODE_GAME_FLYING_BALL) {
oScore.increaseGoals();
}
var volume = Math.max(0, Math.min(100, points / 2));
var goalSound = oSounds.pGoal;
goalSound.setVolume(volume);
goalSound.start();
pNoise = 50 + (points / 10);
increaseScore(points, screenX, screenY);
}
};
gameObject.prototype.increaseScore = function (points, screenX, screenY) {
with (this) {
if (pMode == oC.MODE_GAME_FLYING_BALL) {
oScore.increaseScore(points, screenX, screenY);
} else {
oScore.flashCursor();
oScore.showPoints(points, screenX, screenY);
}
}
};
gameObject.prototype.endCountdown = function () {
with (this) {
gameOver();
}
};
gameObject.prototype.gameOver = function () {
with (this) {
clearMenuHighlight();
oLauncher.hideShotNumber();
oGoalie.changeModeTo(oC.MODE_GOALIE_RESETING);
oWall.startSeeking(oWall.pPracticeX);
pDestNoise = 20;
oSounds.pWhistle.setVolume(20);
oSounds.pWhistle.start(0, 2);
changeModeTo(oC.MODE_GAME_VIEWING_PAGES);
oPages.gotoPage(oC.PAGE_GAME_OVER);
}
};
gameObject.prototype.submitForm = function (formData) {
with (this) {
var heading;
var bodyText;
if (formData.pFormID == oC.FORM_SUBMIT_SCORE) {
heading = "UPDATING LEAGUE...";
bodyText = "Your score is being added to the league table.\n Please wait a moment.";
oPages.oContent.setLoadingText(heading, bodyText);
oComms.sendSubmitScore(formData);
} else if (formData.pFormID == oC.FORM_GET_TOP_SCORES) {
heading = "LOADING LEAGUE...";
bodyText = "The league table is being downloaded.\n Please wait a moment.";
oPages.oContent.setLoadingText(heading, bodyText);
oComms.sendGetTopScores(formData);
} else if (formData.pFormID == oC.FORM_TELL_FRIENDS) {
heading = "SENDING CHALLENGE...";
bodyText = "The challenge is being sent to your friends.\n Please wait a moment.";
oPages.oContent.setLoadingText(heading, bodyText);
oComms.sendTellFriends(formData);
}
}
};
gameObject.prototype.xmlResponseHandler = function (responseNode) {
with (this) {
var commandName = responseNode.attributes.command;
var bodyText;
if (commandName == oC.COMMAND_SUBMIT_SCORE) {
bodyText = "Your score has been added to the league table.\n Please continue.";
oPages.oContent.setLoadingText(null, bodyText);
processLeagueTable(responseNode);
} else if (commandName == oC.COMMAND_GET_TOP_SCORES) {
bodyText = "The league table has been downloaded.\n Please continue.";
oPages.oContent.setLoadingText(null, bodyText);
processLeagueTable(responseNode);
if (pMode == oC.MODE_GAME_VIEWING_PAGES) {
oPages.gotoPage(oC.PAGE_LEAGUE_TABLE);
}
} else if (commandName == oC.COMMAND_TELL_FRIENDS) {
bodyText = "The challenge has been sent to your friends.\n Please continue.";
oPages.oContent.setLoadingText(null, bodyText);
}
oPages.oContent.setLoadingState(oC.ERROR_NONE);
}
};
gameObject.prototype.processLeagueTable = function (responseNode) {
with (this) {
var rowDataList = oComms.getLeagueTableData(responseNode);
var i = 0;
while (6 >= i) {
oPages.oContent.setTableRow(i, rowDataList[i]);
i++;
}
}
};
gameObject.prototype.xmlErrorHandler = function (errorID) {
with (this) {
oPages.oContent.setLoadingText("WARNING!", "There was a problem reaching the game server.\n Sorry, your request was not processed.");
oPages.oContent.setLoadingState(errorID);
}
};
gameObject.prototype.linkHandler = function (link) {
with (this) {
getURL(link, "_blank");
}
};
gameObject.prototype.menuItemPressHandler = function (itemNumber) {
with (this) {
oLauncher.lock();
oBall.pInGoal = true;
oBall.kick(-75, 50, 300, 0);
oPages.processMenuSelection(itemNumber);
}
};
gameObject.prototype.setMenuHighlight = function (itemNumber) {
with (this) {
oPages.oPanel.highlightMenuItem(itemNumber);
}
};
gameObject.prototype.clearMenuHighlight = function () {
with (this) {
oPages.oPanel.highlightMenuItem(null);
}
};
gameObject.prototype.update = function () {
with (this) {
if (pMode == oC.MODE_GAME_VIEWING_PAGES) {
updateViewingPages();
} else if (pMode == oC.MODE_GAME_PREPARING_SHOT) {
updatePreparingShot();
} else if (pMode == oC.MODE_GAME_AIMING_SHOT) {
updateAimingKick();
} else if (pMode == oC.MODE_GAME_FLYING_BALL) {
updateFlyingBall();
}
if (pNoise != pDestNoise) {
var error = (pDestNoise - pNoise);
if (1 < Math.abs(error)) {
pNoise = pNoise + (error / 100);
} else {
pNoise = pDestNoise;
}
oSounds.pAtmosphere.setVolume(pNoise);
}
}
};
gameObject.prototype.updateViewingPages = function () {
with (this) {
oView.update();
oLauncher.update();
oGoalie.update();
oWall.update();
oBall.update();
oPages.update();
if (oBall.isInMode(oC.MODE_BALL_DEAD)) {
oBall.rollOn();
}
}
};
gameObject.prototype.updatePreparingShot = function () {
with (this) {
oView.update();
oLauncher.update();
oGoalie.update();
oWall.update();
oBall.update();
if (pViewReady) {
if (pMode == oC.MODE_GAME_PREPARING_SHOT) {
oLauncher.unlock();
oBall.rollOn();
changeModeTo(oC.MODE_GAME_AIMING_SHOT);
oSounds.pWhistle.start();
}
}
oTimer.update();
}
};
gameObject.prototype.updateAimingKick = function () {
with (this) {
oLauncher.update();
oGoalie.update();
oWall.update();
oBall.update();
oTimer.update();
}
};
gameObject.prototype.updateFlyingBall = function () {
with (this) {
oView.setDestination((oBall.pX / 18) + 50, null);
oView.update();
oLauncher.update();
oGoalie.update();
oWall.update();
oBall.update();
if (oBall.isInMode(oC.MODE_BALL_DEAD)) {
startNewShot();
}
oTimer.update();
}
};
Frame 23
oGame = new gameObject(oC);
stop();
Instance of Symbol 220 MovieClip in Frame 23
onClipEvent (enterFrame) {
_root.oGame.update();
}
Symbol 10 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 20
gotoAndStop (1);
Symbol 31 MovieClip Frame 1
stop();
Symbol 34 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 1
play();
Symbol 49 MovieClip Frame 2
if (vMove) {
gotoAndPlay (3);
} else {
gotoAndPlay (1);
}
Symbol 49 MovieClip Frame 10
if (vMove) {
gotoAndPlay (3);
} else {
gotoAndPlay (1);
}
Symbol 50 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 1
stop();
Symbol 55 MovieClip Frame 1
play();
Symbol 55 MovieClip Frame 18
gotoAndPlay(loop);
Symbol 56 MovieClip Frame 1
stop();
Symbol 60 MovieClip Frame 1
play();
Symbol 60 MovieClip Frame 25
stop();
Symbol 61 Button
on (press) {
_parent.oLauncher.pressHandler();
}
on (release, releaseOutside) {
_parent.oLauncher.releaseHandler();
}
on (rollOver, dragOver) {
_parent.oLauncher.rollOverHandler(true);
}
on (rollOut, dragOut) {
_parent.oLauncher.rollOverHandler(false);
}
Symbol 62 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 20
_parent.oLauncher.endShowSpotAnimation();
Symbol 64 MovieClip Frame 21
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 1
play();
Symbol 77 MovieClip Frame 7
gotoAndPlay (1);
Symbol 79 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 80 MovieClip Frame 2
play();
Symbol 80 MovieClip Frame 40
stop();
Symbol 81 MovieClip Frame 1
stop();
Symbol 83 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 2
play();
Symbol 88 MovieClip Frame 14
stop();
Symbol 92 MovieClip Frame 1
stop();
Symbol 92 MovieClip Frame 2
play();
Symbol 92 MovieClip Frame 47
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 2
play();
Symbol 98 MovieClip Frame 15
if (vLoop) {
gotoAndPlay (2);
} else {
stop();
}
Symbol 99 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 19
stop();
Instance of Symbol 98 MovieClip "iCursor" in Symbol 99 MovieClip Frame 19
onClipEvent (enterFrame) {
vLoop = true;
}
Symbol 99 MovieClip Frame 36
stop();
Symbol 103 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 2
play();
Symbol 103 MovieClip Frame 19
stop();
Instance of Symbol 98 MovieClip "iCursor" in Symbol 103 MovieClip Frame 19
onClipEvent (enterFrame) {
vLoop = false;
}
Symbol 103 MovieClip Frame 20
play();
Symbol 103 MovieClip Frame 36
stop();
Symbol 104 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 1
stop();
Symbol 107 MovieClip Frame 1
stop();
Symbol 116 Button
on (press) {
getURL ("http://www.globalDipGaming.com", "_blank");
}
Symbol 117 Button
on (press) {
oGame.linkHandler(_root.oC.URL_SLOTS_AND_THE_CITY);
}
Symbol 120 MovieClip Frame 1
vHeading = "SLOTS & THE CITY";
stop();
Symbol 120 MovieClip Frame 2
play();
Symbol 120 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 120 MovieClip Frame 8
play();
Symbol 122 MovieClip Frame 1
vHeading = "SLOTS & THE CITY";
stop();
Symbol 122 MovieClip Frame 2
play();
Symbol 122 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 122 MovieClip Frame 8
play();
Symbol 122 MovieClip Frame 11
oContent.endAnimatingOff();
stop();
Symbol 124 Button
on (press) {
oGame.linkHandler(_root.oC.URL_PADDYS_GOLD);
}
Symbol 125 MovieClip Frame 1
vHeading = "PADDY'S GOLD CASINO";
stop();
Symbol 125 MovieClip Frame 2
play();
Symbol 125 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 125 MovieClip Frame 8
play();
Symbol 125 MovieClip Frame 11
oContent.endAnimatingOff();
stop();
Symbol 132 MovieClip Frame 1
stop();
Symbol 144 Button
on (press) {
var oPanel = oGame.oPages.oPanel;
oPanel.buttonHandler(oPanel.oC.SEND_GET_TOP_SCORES, this);
}
Symbol 146 Button
on (press) {
oGame.oPages.oPanel.buttonHandler(oGame.oC.BUTTON_TELL_A_FRIEND);
}
Symbol 147 MovieClip Frame 1
function setTableRow(rowNumber, rowData) {
vRowList[rowNumber] = rowData;
updateTableRow(rowNumber);
}
function updateTable() {
var i = 0;
while (6 >= i) {
updateTableRow(i);
i++;
}
}
function updateTableRow(rowNumber) {
var rowData = vRowList[rowNumber];
var mRow = eval ("iRow" + rowNumber);
if (mRow != null) {
mRow.vRank = rowData.pRank;
mRow.vName = rowData.pNickname;
mRow.vCountry = rowData.pCountry;
mRow.vScore = rowData.pScore;
}
}
if (vRowList == null) {
vRowList = [];
}
vHeading = "6 OF THE BEST";
stop();
Symbol 147 MovieClip Frame 2
vBodyText = "To view your best score (or a friend's) enter an email address\n below. If you think you're a good shot, challenge your friends.";
updateTable();
play();
Symbol 147 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 147 MovieClip Frame 8
play();
Symbol 147 MovieClip Frame 11
oContent.endAnimatingOff();
stop();
Symbol 153 Button
on (press) {
var oPanel = oGame.oPages.oPanel;
oPanel.buttonHandler(oPanel.oC.SEND_SUBMIT_SCORE, this);
}
Symbol 155 Button
on (press) {
_root.vDPA = false;
gotoAndStop (3);
}
Symbol 157 Button
on (press) {
_root.vDPA = true;
gotoAndStop (2);
}
Symbol 158 MovieClip Frame 1
if (_root.vDPA == null) {
_root.vDPA = true;
}
if (_root.vDPA == true) {
gotoAndStop (2);
} else {
gotoAndStop (3);
}
Symbol 158 MovieClip Frame 2
stop();
Symbol 163 MovieClip Frame 1
vHeading = "UP 4 THE CUP!";
stop();
Symbol 163 MovieClip Frame 2
vBodyText = "For your chance at fame and fortune, enter your details below.\n If you're already in the league then just enter your email.";
play();
Symbol 163 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 163 MovieClip Frame 8
play();
Symbol 163 MovieClip Frame 11
oContent.endAnimatingOff();
stop();
Symbol 167 Button
on (press) {
var oPanel = oGame.oPages.oPanel;
oPanel.buttonHandler(oPanel.oC.SEND_TELL_FRIENDS, this);
}
Symbol 175 MovieClip Frame 1
vHeading = "5 A-SIDE CHALLENGE...";
stop();
Symbol 175 MovieClip Frame 2
vBodyText = "See if up to 5 friends can beat your best submitted score so far.\n Enter their emails below to send them the challenge.";
play();
Symbol 175 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 175 MovieClip Frame 8
play();
Symbol 175 MovieClip Frame 11
oContent.endAnimatingOff();
stop();
Symbol 179 Button
on (press) {
oGame.oPages.oPanel.buttonHandler(oGame.oC.BUTTON_TELL_A_FRIEND);
}
Symbol 182 Button
on (press) {
getURL ("http://www.venetiangold.com", "_blank");
}
Symbol 183 Button
on (press) {
getURL ("http://www.paddysgold.com", "_blank");
}
Symbol 184 Button
on (press) {
getURL ("http://www.slotsandthecity.com", "_blank");
}
Symbol 185 MovieClip Frame 1
vHeading = "3 MINUTES ARE UP!";
stop();
Symbol 185 MovieClip Frame 2
play();
Symbol 185 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 185 MovieClip Frame 8
play();
Symbol 185 MovieClip Frame 11
oContent.endAnimatingOff();
stop();
Symbol 191 Button
on (press) {
oGame.linkHandler(_root.oC.URL_VENETIAN_GOLD);
}
Symbol 192 MovieClip Frame 1
vHeading = "VENETIAN GOLD CASINO";
stop();
Symbol 192 MovieClip Frame 2
play();
Symbol 192 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 192 MovieClip Frame 8
play();
Symbol 192 MovieClip Frame 11
oContent.endAnimatingOff();
stop();
Symbol 196 MovieClip Frame 1
vHeading = "PLAY 2 WIN ...";
stop();
Symbol 196 MovieClip Frame 2
play();
Symbol 196 MovieClip Frame 7
oContent.endAnimatingOn();
stop();
Symbol 196 MovieClip Frame 8
play();
Symbol 196 MovieClip Frame 11
oContent.endAnimatingOff();
stop();
Symbol 197 MovieClip Frame 1
stop();
Symbol 199 Button
on (press) {
oPanel.menuItemPressHandler(vItemNumber);
}
on (rollOver, dragOver) {
oPanel.menuItemRollOverHandler(vItemNumber, true);
}
on (rollOut, dragOut) {
oPanel.menuItemRollOverHandler(vItemNumber, false);
}
Symbol 200 Button
on (rollOver, dragOver) {
oPanel.menuItemRollOverHandler(vItemNumber, true);
}
on (rollOut, dragOut) {
oPanel.menuItemRollOverHandler(vItemNumber, false);
}
Symbol 201 MovieClip Frame 1
stop();
Symbol 203 Button
on (press) {
oPanel.menuItemPressHandler(vItemNumber);
}
on (rollOver, dragOver) {
oPanel.menuItemRollOverHandler(vItemNumber, true);
}
on (rollOut, dragOut) {
oPanel.menuItemRollOverHandler(vItemNumber, false);
}
Symbol 204 Button
on (rollOver, dragOver) {
oPanel.menuItemRollOverHandler(vItemNumber, true);
}
on (rollOut, dragOut) {
oPanel.menuItemRollOverHandler(vItemNumber, false);
}
Symbol 205 MovieClip Frame 1
stop();
Symbol 207 Button
on (press) {
oPanel.menuItemPressHandler(vItemNumber);
}
on (rollOver, dragOver) {
oPanel.menuItemRollOverHandler(vItemNumber, true);
}
on (rollOut, dragOut) {
oPanel.menuItemRollOverHandler(vItemNumber, false);
}
Symbol 208 Button
on (rollOver, dragOver) {
oPanel.menuItemRollOverHandler(vItemNumber, true);
}
on (rollOut, dragOut) {
oPanel.menuItemRollOverHandler(vItemNumber, false);
}
Symbol 209 MovieClip Frame 1
stop();
Symbol 211 Button
on (press) {
getURL ("http://www.globalDipGaming.com", "_blank");
}
Symbol 213 Button
on (press) {
oPanel.menuItemPressHandler(vItemNumber);
}
on (rollOver, dragOver) {
oPanel.menuItemRollOverHandler(vItemNumber, true);
}
on (rollOut, dragOut) {
oPanel.menuItemRollOverHandler(vItemNumber, false);
}
Symbol 214 Button
on (rollOver, dragOver) {
oPanel.menuItemRollOverHandler(vItemNumber, true);
}
on (rollOut, dragOut) {
oPanel.menuItemRollOverHandler(vItemNumber, false);
}
Symbol 215 MovieClip Frame 1
stop();
Symbol 217 MovieClip Frame 1
stop();