Frame 1
stop();
preloader_mc.onEnterFrame = function () {
var _local2 = this;
var _local3 = _root;
var _local1 = Math.floor((_local3.getBytesLoaded() * 100) / _local3.getBytesTotal());
if (_local1 >= 100) {
_local3.play();
} else {
_local2.gotoAndStop(_local1);
_local2.units_mc.gotoAndStop(Math.round(_local1 % 10));
_local2.tens_mc.gotoAndStop(Math.round(_local1 / 10));
_local2.hundreds_mc.gotoAndStop(Math.round(_local1 / 100));
}
};
stop();
this.createEmptyMovieClip("tracker_mc", 1000);
tracker_mc.loadMovie(("http://ad.uk.tangozebra.com/a/bg/g_001701581081;" + new Date().getTime()) + "?");
loadMovieNum ("http://watches.whodidit.co.uk/watch61.swf", 1001);
Frame 3
function object3D(x, y, z, rx, ry, rz) {
var _local1 = this;
_local1.numpoints = 0;
_local1.pointlist = new Array();
_local1.tpointlist = new Array();
_local1.numlines = 0;
_local1.lines = new Array();
_local1.numquads = 0;
_local1.quads = new Array();
_local1.disabled = false;
_local1.pos = new Vector(x, y, z);
}
function image3d(x, y, z, scale, source, targetclip) {
var _local1 = this;
clipCount++;
_local1.pos = new Vector(x, y, z);
_local1.tpos = new Vector(x, y, z);
_local1.scale = scale;
targetclip.attachMovie(source, "image" + clipCount, 100000 - clipCount);
_local1.clip_mc = targetclip["image" + clipCount];
}
function line3d(p1, p2, lthickness, lcolour, targetclip) {
var _local1 = this;
var _local2 = targetclip;
_local1.p1 = p1;
_local1.p2 = p2;
if (!lthickness) {
_local1.linethickness = 0;
} else {
_local1.linethickness = lthickness;
}
if (!lcolour) {
_local1.linecolour = 16777215 /* 0xFFFFFF */;
} else {
_local1.linecolour = lcolour;
}
clipCount++;
if (!_local2) {
_local2 = dynamicGFX;
}
_local2.createEmptyMovieClip("image" + clipCount, 100000 - clipCount);
_local1.clip_mc = _local2["image" + clipCount];
_local1.linetype = DRAW;
}
function lineImage(p1, p2, imagename, scale) {
var _local1 = this;
_local1.p1 = p1;
_local1.p2 = p2;
clipCount++;
dynamicGFX.attachMovie(imagename, "image" + clipCount, 100000 - clipCount);
_local1.clip_mc = dynamicGFX["image" + clipCount];
_local1.linetype = IMAGE;
_local1.ignoreDepth = false;
}
function quad3d(p1, p2, p3, p4, col, targetclip) {
var _local1 = this;
var _local2 = targetclip;
_local1.p1 = p1;
_local1.p2 = p2;
_local1.p3 = p3;
_local1.p4 = p4;
clipCount++;
if (!_local2) {
_local2 = dynamicGFX;
}
_local2.createEmptyMovieClip("image" + clipCount, 100000 - clipCount);
_local1.clip_mc = _local2["image" + clipCount];
_local1.col = col;
_local1.ignoreDepth = false;
}
function camera3d(x, y, z, rx, ry, rz, zoom) {
var _local1 = this;
_local1.pos = new Vector(x, y, z);
_local1.rot = new Vector(rx, ry, rz);
_local1.zoom = zoom;
}
function setCam(cam, speed) {
var _local1 = speed;
var _local2 = cam;
if (!_local1) {
_local1 = 0.5;
}
vCopy(_local2.pos, worldDestPos);
vCopy(_local2.rot, worldDestRot);
worldDestZoom = _local2.zoom;
if (!_local1) {
worldDestSpeed = 0.3;
} else {
worldDestSpeed = _local1;
}
}
function updateCamera() {
var _local1 = new Vector(0, 0, 0);
if (!EqualiseVectors(worldPos, worldDestPos, 0.5)) {
vSubtract(worldDestPos, worldPos, _local1);
vMultiplyWithScalar(_local1, worldDestSpeed);
vAdd(worldPos, _local1);
viewChanged = true;
}
if (!EqualiseVectors(worldRot, worldDestRot, 0.1)) {
vSubtract(worldDestRot, worldRot, _local1);
vMultiplyWithScalar(_local1, worldDestSpeed);
vAdd(worldRot, _local1);
viewChanged = true;
}
if (Math.abs(d - worldDestZoom) < 2) {
d = worldDestZoom;
} else if (Math.abs(d - worldDestZoom) > 2) {
_local1 = worldDestZoom - d;
d = d + (_local1 * worldDestSpeed);
viewChanged = true;
}
}
function drawNet(p1, p2, p3, p4, xdivide, ydivide, lineweight, linecol, linealpha, targetclip, edging) {
var _local1 = targetclip;
_local1.clear();
_local1.lineStyle(lineweight, linecol, linealpha);
var top = new Vector(p1.x, p1.y, 0);
var _local3 = new Vector(p3.x, p3.y, 0);
var topdiff = new Vector(0, 0, 0);
var botdiff = new Vector(0, 0, 0);
vSubtract(p2, p1, topdiff);
vSubtract(p4, p3, botdiff);
vDivideByScalar(topdiff, ydivide);
vDivideByScalar(botdiff, ydivide);
var left = new Vector(p1.x, p1.y, 0);
var right = new Vector(p2.x, p2.y, 0);
var leftdiff = new Vector(0, 0, 0);
var rightdiff = new Vector(0, 0, 0);
vSubtract(p3, p1, leftdiff);
vSubtract(p4, p2, rightdiff);
vDivideByScalar(leftdiff, xdivide);
vDivideByScalar(rightdiff, xdivide);
if (edging) {
ydivide++;
xdivide++;
}
var _local2 = 0;
while (_local2 < ydivide) {
_local1.moveTo(top.x, top.y);
_local1.lineTo(_local3.x, _local3.y);
vAdd(top, topdiff);
vAdd(_local3, botdiff);
_local2++;
}
_local2 = 0;
while (_local2 < xdivide) {
_local1.moveTo(left.x, left.y);
_local1.lineTo(right.x, right.y);
vAdd(left, leftdiff);
vAdd(right, rightdiff);
_local2++;
}
}
function clipZOrder(clip_mc, z1, z2) {
var _local2 = z1;
var _local3 = clip_mc;
_local2 = _local2 * 10;
z2 = z2 * 10;
var _local1 = _local2;
depthTracker[_local3.getDepth()] = false;
if (z2) {
_local1 = _local2 + ((z2 - _local2) / 2);
}
_local1 = 100000 - Math.floor(_local1);
while (depthTracker[_local1]) {
_local1++;
}
depthTracker[_local1] = _local3;
_local3.swapDepths(_local1);
}
function dial(clip_mc, minVal, maxVal, minDisplay, maxDisplay, updateFunction) {
var _local1 = this;
_local1.clip_mc = clip_mc;
_local1.minVal = minVal;
_local1.maxVal = maxVal;
_local1.minDisplay = minDisplay;
_local1.maxDisplay = maxDisplay;
_local1.updateFunction = updateFunction;
_local1.currentSetting = minVal;
_local1.active = false;
_local1.needle_mc = _local1.clip_mc.needle_mc;
_local1.needleVel = (_local1.maxDisplay - _local1.minDisplay) / (16 - needleSpeed);
_local1.needle_mc._rotation = minDisplay;
_local1.clip_mc.set_btn.dialObj = _local1;
_local1.clip_mc.set_btn._visible = false;
_local1.clip_mc.set_btn.onPress = function () {
this.dialObj.setFunction();
};
_local1.clip_mc._xscale = 0;
_local1.clip_mc._yscale = 0;
_local1.clip_mc._visible = false;
_local1.targetScale = _local1.clip_mc._xscale;
_local1.targetDelay = 0;
_local1.updateFunction(true);
}
function updateDials() {
var _local2 = 0;
while (_local2 < dials.length) {
var _local1 = dials[_local2];
_local1.updateFunction();
if (_local1.targetScale != _local1.clip_mc._xscale) {
if (_local1.targetDelay > 0) {
_local1.targetDelay--;
} else {
var _local3 = (_local1.targetScale - _local1.clip_mc._xscale) * 0.5;
_local1.clip_mc._xscale = _local1.clip_mc._xscale + _local3;
_local1.clip_mc._yscale = _local1.clip_mc._xscale;
if (_local1.clip_mc._xscale < 0.1) {
_local1.clip_mc._visible = false;
} else {
_local1.clip_mc._visible = true;
}
}
}
_local2++;
}
}
function updateRotateDial(refresh) {
var _local1 = this;
if (_local1.active || (refresh)) {
if (_local1.needleAngle == undefined) {
_local1.needleAngle = _local1.minDisplay;
} else {
_local1.needleAngle = _local1.needleAngle + _local1.needleVel;
}
if (_local1.needleAngle >= _local1.maxDisplay) {
_local1.needleAngle = _local1.maxDisplay;
_local1.needleVel = -_local1.needleVel;
} else if (_local1.needleAngle <= _local1.minDisplay) {
_local1.needleAngle = _local1.minDisplay;
_local1.needleVel = -_local1.needleVel;
}
_local1.needle_mc._rotation = _local1.needleAngle;
_local1.currentSetting = (((_local1.needleAngle - _local1.minDisplay) / (_local1.maxDisplay - _local1.minDisplay)) * (_local1.maxVal - _local1.minVal)) + _local1.minVal;
}
}
function updateCurveDial(refresh) {
var _local1 = this;
if (_local1.active || (refresh)) {
if (_local1.curvePos == undefined) {
_local1.curvePos = 0;
}
_local1.clip_mc.curve_mc.clear();
_local1.clip_mc.curve_mc.lineStyle(8, 13369344, 100);
_local1.clip_mc.curve_mc.moveTo(0, -49);
_local1.clip_mc.curve_mc.curveTo(_local1.curvePos, 0, 0, 49);
_local1.curvePos = _local1.curvePos + _local1.needleVel;
if (_local1.curvePos >= _local1.maxDisplay) {
_local1.curvePos >= _local1.maxDisplay;
_local1.needleVel = -_local1.needleVel;
} else if (_local1.curvePos <= _local1.minDisplay) {
_local1.curvePos >= _local1.minDisplay;
_local1.needleVel = -_local1.needleVel;
}
_local1.currentSetting = (((_local1.curvePos - _local1.minDisplay) / (_local1.maxDisplay - _local1.minDisplay)) * (_local1.maxVal - _local1.minVal)) + _local1.minVal;
}
}
function updateNumberDial(clip_mc, num) {
var _local1 = clip_mc;
var _local2 = num;
var _local3 = _local2 % 10;
var tens = (Math.floor(_local2 / 10) % 10);
var hundreds = (Math.floor(_local2 / 100) % 10);
_local1.hundreds_mc.gotoAndStop(hundreds + 1);
_local1.tens_mc.gotoAndStop(tens + 1);
_local1.units_mc.gotoAndStop(_local3 + 1);
}
function AreVectorsEqual(v1, v2) {
var _local1 = v2;
var _local2 = v1;
if (((_local2.x == _local1.x) && (_local2.y == _local1.y)) && (_local2.z == _local1.z)) {
return(true);
}
return(false);
}
function EqualiseVectors(v1, v2, acc) {
var _local3 = v2;
if (AreVectorsEqual(v1, _local3)) {
return(true);
}
var _local1 = new Vector(0, 0, 0);
vSubtract(_local3, v1, _local1);
var _local2 = ((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z);
if (_local2 < (acc * acc)) {
vCopy(v1, _local3);
return(true);
}
return(false);
}
function vIsLessThan(v1, mag) {
var _local1 = v1;
var _local2 = ((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z);
if (_local2 < (mag * mag)) {
return(true);
}
return(false);
}
function vIsGreaterThan(v1, mag) {
var _local1 = v1;
var _local2 = ((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z);
if (_local2 > (mag * mag)) {
return(true);
}
return(false);
}
function InitLookups(accuracy) {
if (accuracy) {
MATHACCURACY = accuracy;
}
sinLookUp = new Array();
var _local1 = 0;
while (_local1 <= (360 * MATHACCURACY)) {
sinLookUp[_local1] = Math.sin(DegreesToRadians(_local1 / MATHACCURACY));
_local1++;
}
cosLookUp = new Array();
_local1 = 0;
while (_local1 <= (360 * MATHACCURACY)) {
cosLookUp[_local1] = Math.cos(DegreesToRadians(_local1 / MATHACCURACY));
_local1++;
}
tanLookUp = new Array();
_local1 = 0;
while (_local1 <= (360 * MATHACCURACY)) {
tanLookUp[_local1] = Math.tan(DegreesToRadians(_local1 / MATHACCURACY));
_local1++;
}
}
function Vector(x, y, z) {
var _local1 = this;
_local1.x = x;
_local1.y = y;
_local1.z = z;
}
function vCopy(u, w) {
var _local1 = u;
var _local2 = w;
_local2.x = _local1.x;
_local2.y = _local1.y;
_local2.z = _local1.z;
}
function vMagnitude(v) {
var _local1 = v;
return(Math.sqrt(((_local1.x * _local1.x) + (_local1.y * _local1.y)) + (_local1.z * _local1.z)));
}
function vNormalise(v, w) {
var _local1 = w;
var _local3 = v;
if (!_local1) {
_local1 = _local3;
}
var _local2 = vMagnitude(_local3);
if (_local2 <= tol) {
_local2 = 1;
}
_local1.x = _local3.x / _local2;
_local1.y = _local3.y / _local2;
_local1.z = _local3.z / _local2;
if (Math.abs(_local1.x) < tol) {
_local1.x = 0;
}
if (Math.abs(_local1.y) < tol) {
_local1.y = 0;
}
if (Math.abs(_local1.z) < tol) {
_local1.y = 0;
}
}
function vReverse(v, w) {
var _local1 = w;
var _local2 = v;
if (!_local1) {
_local1 = _local2;
}
_local1.x = -_local2.x;
_local1.y = -_local2.y;
_local1.z = -_local2.z;
}
function vAdd(u, v, w) {
var _local1 = w;
var _local2 = u;
var _local3 = v;
if (!_local1) {
_local1 = _local2;
}
_local1.x = _local2.x + _local3.x;
_local1.y = _local2.y + _local3.y;
_local1.z = _local2.z + _local3.z;
}
function vSubtract(u, v, w) {
var _local1 = w;
var _local2 = u;
var _local3 = v;
if (!_local1) {
_local1 = _local2;
}
_local1.x = _local2.x - _local3.x;
_local1.y = _local2.y - _local3.y;
_local1.z = _local2.z - _local3.z;
}
function vMultiply(u, v, w) {
var _local1 = w;
var _local2 = u;
var _local3 = v;
if (!_local1) {
_local1 = _local2;
}
_local1.x = _local2.x * _local3.x;
_local1.y = _local2.y * _local3.y;
_local1.z = _local2.z * _local3.z;
}
function vMultiplyWithScalar(v, s, w) {
var _local1 = w;
var _local2 = v;
var _local3 = s;
if (!_local1) {
_local1 = _local2;
}
_local1.x = _local2.x * _local3;
_local1.y = _local2.y * _local3;
_local1.z = _local2.z * _local3;
}
function vDivide(u, v, w) {
var _local1 = w;
var _local2 = u;
var _local3 = v;
if (!_local1) {
_local1 = _local2;
}
_local1.x = _local2.x / _local3.x;
_local1.y = _local2.y / _local3.y;
_local1.z = _local2.z / _local3.z;
}
function vDivideByScalar(v, s, w) {
var _local1 = w;
var _local2 = v;
var _local3 = s;
if (!_local1) {
_local1 = _local2;
}
_local1.x = _local2.x / _local3;
_local1.y = _local2.y / _local3;
_local1.z = _local2.z / _local3;
}
function vCross(u, v) {
return((u.x * v.y) - (u.y * v.x));
}
function v3dCross(u, v, w) {
var _local1 = v;
var _local2 = u;
var _local3 = w;
_local3.x = (_local2.y * _local1.z) - (_local2.z * _local1.y);
_local3.y = ((-_local2.x) * _local1.z) + (_local2.z * _local1.x);
_local3.z = (_local2.x * _local1.y) - (_local2.y * _local1.x);
}
function vDot(p, q) {
var _local1 = (p.x * q.x) + (p.y * q.y);
return(_local1);
}
function vProj(u, v, w) {
var _local1 = v;
var _local3 = w;
if (!_local3) {
_local3 = u;
}
var _local2 = vDot(u, _local1) / vDot(_local1, _local1);
vMultiplyWithScalar(_local1, _local2, _local3);
}
function vAngle(u) {
var _local2 = u;
var _local1 = atan(_local2.y / _local2.x);
if (_local2.x < 0) {
_local1 = _local1 + 180;
}
return(_local1);
}
function vAngleBetween(u, v) {
var _local1 = (vAngle(v) - vAngle(u)) % 360;
if (_local1 > 180) {
_local1 = _local1 - 360;
} else if (_local1 < -180) {
_local1 = _local1 + 360;
}
return(_local1);
}
function DegreesToRadians(deg) {
return((deg * Math.PI) / 180);
}
function RadiansToDegrees(rad) {
return((rad * 180) / Math.PI);
}
function vRotate2D(angle, u, w) {
var _local2 = angle;
var _local3 = u;
if (!w) {
w = _local3;
}
_local2 = normaliseAngle(_local2);
var _local1 = new Vector(0, 0, 0);
_local1.x = (_local3.x * cos(-_local2)) + (_local3.y * sin(-_local2));
_local1.y = ((-_local3.x) * sin(-_local2)) + (_local3.y * cos(-_local2));
w.x = _local1.x;
w.y = _local1.y;
}
function vRotateX(angle, u, w) {
var _local2 = angle;
var _local3 = u;
if (!w) {
w = _local3;
}
_local2 = normaliseAngle(_local2);
var _local1 = new Vector(0, 0, 0);
_local1.z = (_local3.z * cos(-_local2)) + (_local3.y * sin(-_local2));
_local1.y = ((-_local3.z) * sin(-_local2)) + (_local3.y * cos(-_local2));
w.z = _local1.z;
w.y = _local1.y;
}
function vRotateY(angle, u, w) {
var _local2 = angle;
var _local3 = u;
if (!w) {
w = _local3;
}
_local2 = normaliseAngle(_local2);
var _local1 = new Vector(0, 0, 0);
_local1.z = (_local3.z * cos(-_local2)) + (_local3.x * sin(-_local2));
_local1.x = ((-_local3.z) * sin(-_local2)) + (_local3.x * cos(-_local2));
w.z = _local1.z;
w.x = _local1.x;
}
function vRotateYAroundPoint(angle, u, v, w) {
var _local3 = angle;
if (!w) {
w = u;
}
var _local2 = new Vector(0, 0, 0);
var _local1 = new Vector(0, 0, 0);
vSubtract(u, v, _local1);
_local3 = normaliseAngle(_local3);
_local2.z = (_local1.z * cos(-_local3)) + (_local1.x * sin(-_local3));
_local2.x = ((-_local1.z) * sin(-_local3)) + (_local1.x * cos(-_local3));
vAdd(_local2, v);
w.z = _local2.z;
w.x = _local2.x;
}
function VRotate2DAroundPoint(angle, u, v, w) {
var _local3 = angle;
if (!w) {
w = u;
}
var _local2 = new Vector(0, 0, 0);
var _local1 = new Vector(0, 0, 0);
vSubtract(u, v, _local1);
_local2.x = (_local1.x * cos(-_local3)) + (_local1.y * sin(-_local3));
_local2.y = ((-_local1.x) * sin(-_local3)) + (_local1.y * cos(-_local3));
vAdd(_local2, v);
w.x = _local2.x;
w.y = _local2.y;
}
function cos(a) {
var _local1 = Math.round(a * MATHACCURACY);
_local1 = _local1 % (360 * MATHACCURACY);
if (_local1 < 0) {
_local1 = _local1 + (360 * MATHACCURACY);
}
return(cosLookup[_local1]);
}
function sin(a) {
var _local1 = Math.round(a * MATHACCURACY);
_local1 = _local1 % (360 * MATHACCURACY);
if (_local1 < 0) {
_local1 = _local1 + (360 * MATHACCURACY);
}
return(sinLookup[_local1]);
}
function tan(a) {
return(Math.tan(DegreesToRadians(a)));
}
function atan(s) {
return(RadiansToDegrees(Math.atan(s)));
}
function acos(s) {
return(RadiansToDegrees(Math.acos(s)));
}
function normaliseAngle(angle) {
var _local1 = angle;
_local1 = _local1 % 360;
if (_local1 < 0) {
_local1 = _local1 + 360;
}
return(_local1);
}
function setEra(eraNum) {
var _local2 = _global;
var _local3 = eraNum;
if (_local2.fixedEra != undefined) {
_local3 = _local2.fixedEra;
}
if (_local3 < 1) {
_local3 = 3;
}
if (_local3 > 3) {
_local3 = 1;
}
_root.bg_mc.gotoAndStop(_local3);
_local2.currEra = _local3;
goalie.clip_mc.goalie1_mc._visible = _local3 == 1;
goalie.clip_mc.goalie2_mc._visible = _local3 == 2;
goalie.clip_mc.goalie3_mc._visible = _local3 == 3;
goalie.clip_mc[("goalie" + _local3) + "_mc"].gotoAndStop(1);
var pitchStripesA = [8421504, 32768, 32768];
var pitchStripesB = [9474192, 36864, 36864];
var _local1 = 0;
while (_local1 < pitch.quads.length) {
if (_local1 & true) {
pitch.quads[_local1].col = pitchStripesA[_local2.currEra - 1];
} else {
pitch.quads[_local1].col = pitchStripesB[_local2.currEra - 1];
}
_local1++;
}
initEraSounds(_local2.currEra);
}
function showEndOfIntro() {
lose_mc._visible = false;
intro_mc.gotoAndStop(intro_mc._totalframes);
intro_mc._visible = true;
_global.currEra = 0;
_global.fixedEra = null;
}
function getStarPosition() {
var _local2 = random(70) - 35;
var _local1 = -random(18);
return([_local2, _local1, 520]);
}
function initConstants() {
GRAVITY = 0.3;
DAMPING = 0.95;
DRAG = 0.9;
BOUNCE = 0.5;
NETZPOS = 540;
NETBOUNCE = 0.1;
NETXDAMPING = 0.2;
NETLEFT = -35;
NETRIGHT = 35;
NETTOP = -20;
KEEPERDEFLECT = 0.5;
SPINDRAG = 0.95;
BOARDZPOS = 600;
BOARDBOUNCE = 0.5;
GOALLEFT = -40;
GOALRIGHT = 40;
GOALTOP = -26;
BALLRADIUS = 0.5;
GROUND = -1;
}
function initVars() {
_global.main_mc = this;
InitLookups(20);
viewChanged = true;
screencenterX = 275;
screencenterY = 200;
d = 1079.8;
worldPos = new Vector(0, 0, 0);
worldDestPos = new Vector(0, 0, 0);
worldDestRot = new Vector(0, 0, 0);
worldDestZoom = d;
worldDestSpeed = 1;
worldRot = new Vector(0, 0, 0);
cams = new Array();
cams.push(new camera3d(0, -290, 252, -12, 0, 0, 620));
cams.push(new camera3d(0, -35, 250, -14, 0, 0, 620));
cams.push(new camera3d(0, -64, 411, -21, 0, 0, 620));
cams.push(new camera3d(0, -25, 383, -14, 0, 0, 620));
camnum = 2;
setCam(cams[2], 1);
vCopy(worldDestPos, worldPos);
vCopy(worldDestRot, worldRot);
d = worldDestZoom;
resolution = 10;
startPoint = new Vector(0, -1, 410);
ballStart = [26, 10, 10];
gameplaying = false;
clipCount = 0;
startPointRotation = 0;
rotatePoint = new Vector(0, 0, 500);
goalcount = 0;
scorecount = 0;
soundOn = true;
senderEmail = "";
senderName = "";
receiverEmail = "";
receiverName = "";
allowCameraMoves = false;
}
function initClips() {
instructions_mc._visible = false;
instructions_mc.stop();
GFX3D_mc._visible = false;
preloadedclips_mc._visible = false;
grain_mc._visible = false;
lose_mc._visible = false;
lose_mc.gotoAndStop(1);
win_mc._visible = false;
win_mc.gotoAndStop(1);
}
function instructionsFinished() {
instructions_mc._visible = false;
instructions_mc.gotoAndStop(1);
intro_mc._visible = true;
}
function initDials() {
var _local2 = this;
dials = new Array();
dials.push(new dial(dialDir_mc, -20, 20, -40, 40, updateRotateDial));
dials.push(new dial(dialPitch_mc, 50, 0, 6, 61, updateRotateDial));
dials.push(new dial(dialSwerve_mc, 2.5, -2.5, -60, 60, updateCurveDial));
dials.push(new dial(dialPower_mc, 1, 30, -69, 69, updateRotateDial));
dials[0].setFunction = function () {
this.deactivate();
dials[1].activate();
};
dials[1].setFunction = function () {
this.deactivate();
dials[2].activate();
};
dials[2].setFunction = function () {
this.deactivate();
dials[3].activate();
};
dials[3].setFunction = function () {
this.deactivate();
vSubtract(rotatePoint, ball.pos, ball.vel);
vNormalise(ball.vel);
vMultiplyWithScalar(ball.vel, dials[3].currentSetting);
vRotateY(dials[0].currentSetting, ball.vel);
vRotateX(dials[1].currentSetting, ball.vel);
ball.spin = dials[2].currentSetting;
ballDir = dials[0].currentSetting;
var _local1 = 0;
while (_local1 < dials.length) {
dials[_local1].shrink(_local1);
_local1++;
}
gameplaying = true;
gameprogress = 0;
player.clip_mc.play();
};
needleSpeed = 0.5;
}
function playResult() {
if (goalscored || (starHit)) {
win_mc._visible = true;
win_mc.gotoAndPlay("win" + _global.currEra);
} else {
lose_mc._visible = true;
var _local1 = _root.competion == "active";
if (goalcount > 0) {
lose_mc.goalcount = goalcount;
lose_mc.scorecount = scorecount;
lose_mc.gotoAndStop((_local1 ? "losegoodcompetion" : "losegood"));
} else {
lose_mc.gotoAndStop((_local1 ? "losebadcompetion" : "losebad"));
}
s_crowdloop.stop();
goalcount = 0;
scorecount = 0;
registerScore();
}
gameplaying = false;
}
function startGame() {
intro_mc._visible = false;
instructions_mc._visible = false;
resetGame(1, true);
}
function showInstructions() {
intro_mc._visible = false;
instructions_mc._visible = true;
instructions_mc.gotoAndPlay(1);
}
function resetGame(era, showStadiumAnimation) {
var _local2 = _global;
var _local3 = era;
stopAllSounds();
if (_local3 == undefined) {
_local3 = _local2.currEra + 1;
}
setEra(_local3);
star.clip_mc.gotoAndStop(1);
lose_mc._visible = false;
lose_mc.gotoAndStop(1);
win_mc._visible = false;
win_mc.gotoAndStop(1);
GFX3D_mc._visible = true;
var _local1 = 1;
while (_local1 < dials.length) {
dials[_local1].enlarge(_local1);
_local1++;
}
dials[0].activate();
ball.pos.x = 0;
ball.pos.y = -1;
ball.pos.z = 360;
player.pos.x = -3;
player.pos.y = -3;
player.pos.z = 350;
defenders.pos.x = 0;
defenders.pos.y = 0;
defenders.pos.z = 450;
starPos = getStarPosition();
star.pos.x = starPos[0];
star.pos.y = starPos[1];
star.pos.z = starPos[2];
goalie.clip_mc[("goalie" + _local2.currEra) + "_mc"].gotoAndStop(1);
goalscored = false;
starHit = false;
setCam(cams[2], 1);
vCopy(worldDestPos, worldPos);
vCopy(worldDestRot, worldRot);
gameplaying = false;
player.clip_mc.gotoAndStop("player" + _local2.currEra);
grain_mc._visible = _local2.currEra == 1;
defenders.clip_mc.gotoAndStop(goalcount + 1);
defenders.clip_mc.def1_mc.gotoAndStop("defender" + _local2.currEra);
defenders.clip_mc.def2_mc.gotoAndStop("defender" + _local2.currEra);
defenders.clip_mc.def3_mc.gotoAndStop("defender" + _local2.currEra);
startPointRotation = (Math.random() * 40) - 20;
frontadboards.clip_mc.gotoAndStop(_local2.currEra);
bg_mc.gotoAndStop(_local2.currEra);
ball.clip_mc.gotoAndStop(_local2.currEra);
vRotateYAroundPoint(startPointRotation, ball.pos, rotatePoint);
vRotateYAroundPoint(startPointRotation, player.pos, rotatePoint);
vRotateYAroundPoint(startPointRotation, defenders.pos, rotatePoint);
setCam(cams[1], 0.1);
vRotateYAroundPoint(startPointRotation, WorldDestPos, rotatePoint);
worldDestRot.y = startPointRotation;
s_crowdloop.stop();
if (soundOn) {
s_crowdloop.start(0, 1000);
}
updateNumberDial(goals_mc, goalcount);
updateNumberDial(score_mc, scorecount);
scoreRegistered = false;
if (showStadiumAnimation == true) {
stadiumIntro_mc.gotoAndPlay("stadium" + _local2.currEra);
} else {
playSound(s_comments[(scommentcount++) % 2]);
}
}
function toggleCams() {
camnum = (camnum + 1) % cams.length;
setCam(cams[camnum], 0.6);
}
function camButton(num) {
camnum = num;
setCam(cams[camnum], 0.6);
}
function initPitch() {
GFX3D_mc.createEmptyMovieClip("dynamicGFX_mc", 4);
dynamicGFX = GFX3D_mc.dynamicGFX_mc;
GFX3D_mc.createEmptyMovieClip("dynamicBG2_mc", 3);
dynamicBG2 = GFX3D_mc.dynamicBG2_mc;
GFX3D_mc.createEmptyMovieClip("dynamicBG_mc", 2);
dynamicBG = GFX3D_mc.dynamicBG_mc;
GFX3D_mc.createEmptyMovieClip("dynamicBG3_mc", 1);
dynamicBG3 = GFX3D_mc.dynamicBG3_mc;
pitch = new object3D(0, 0, 0, 0, 0, 0);
p = pitch.numpoints;
pitch.addpoint(new Vector(-230, 0, 520));
pitch.addpoint(new Vector(230, 0, 520));
pitch.addpoint(new Vector(230, 0, 380));
pitch.addpoint(new Vector(-230, 0, 380));
pitch.addline(p, p + 1, 3, 16777215, dynamicBG2);
pitch.addline(p + 1, p + 2, 3, 16777215, dynamicBG2);
pitch.addline(p + 3, p, 3, 16777215, dynamicBG2);
p = pitch.numpoints;
pitch.addpoint(new Vector(-120, 0, 520));
pitch.addpoint(new Vector(120, 0, 520));
pitch.addpoint(new Vector(120, 0, 400));
pitch.addpoint(new Vector(-120, 0, 400));
pitch.addline(p + 3, p + 2, 3, 16777215, dynamicBG2);
pitch.addline(p + 1, p + 2, 3, 16777215, dynamicBG2);
pitch.addline(p, p + 3, 3, 16777215, dynamicBG2);
p = pitch.numpoints;
pitch.addpoint(new Vector(-70, 0, 520));
pitch.addpoint(new Vector(70, 0, 520));
pitch.addpoint(new Vector(70, 0, 465));
pitch.addpoint(new Vector(-70, 0, 465));
pitch.addline(p + 1, p + 2, 3, 16777215, dynamicBG2);
pitch.addline(p + 2, p + 3, 3, 16777215, dynamicBG2);
pitch.addline(p + 3, p + 0, 3, 16777215, dynamicBG2);
p = pitch.numpoints;
pitch.addpoint(new Vector(-0.3, 0, 410));
pitch.addpoint(new Vector(0.3, 0, 410));
pitch.addline(p, p + 1, 2, false, dynamicBG);
goal = new object3D(0, 0, 0, 0, 0, 0);
p = goal.numpoints;
goal.addpoint(new Vector(GOALLEFT, 0, 520));
goal.addpoint(new Vector(GOALLEFT, GOALTOP, 520));
goal.addpoint(new Vector(GOALRIGHT, GOALTOP, 520));
goal.addpoint(new Vector(GOALRIGHT, 0, 520));
goal.addline(p + 1, p, 5, 16777215);
goal.addline(p + 1, p + 2, 5, 16777215);
goal.addline(p + 2, p + 3, 5, 16777215);
goal.addpoint(new Vector(GOALLEFT, 0, 550));
goal.addpoint(new Vector(GOALLEFT, GOALTOP, 550));
goal.addpoint(new Vector(GOALRIGHT, GOALTOP, 550));
goal.addpoint(new Vector(GOALRIGHT, 0, 550));
goal.addquad(p + 4, p + 5, p + 6, p + 7, 16777215, dynamicGFX, 30);
goal.addquad(p, p + 1, p + 5, p + 4, 16777215, dynamicGFX, 40);
goal.addquad(p + 1, p + 2, p + 6, p + 5, 16777215, dynamicGFX, 40);
goal.addquad(p + 6, p + 2, p + 3, p + 7, 16777215, dynamicGFX, 40);
goal.addline(p + 4, p + 5, 1, 16777215);
goal.addline(p + 5, p + 6, 1, 16777215);
goal.addline(p + 6, p + 7, 1, 16777215);
goal.addline(p + 1, p + 5, 1, 16777215);
goal.addline(p + 6, p + 2, 1, 16777215);
var _local1 = 0;
while (_local1 <= 20) {
var p = pitch.numpoints;
pitch.addpoint(new Vector(-250, 0, 100 + (_local1 * 25)));
pitch.addpoint(new Vector(250, 0, 100 + (_local1 * 25)));
if (_local1 > 0) {
if ((_local1 % 2) == 0) {
pitch.addquad(p, p + 1, p - 1, p - 2, 8421504, dynamicBG);
} else {
pitch.addquad(p, p + 1, p - 1, p - 2, 9474192, dynamicBG);
}
}
_local1++;
}
starPos = getStarPosition();
star = new image3D(starPos[0], starPos[1], starPos[2], 0.25, "star", dynamicGFX);
ball = new image3D(0, -1, 360, 0.11, "ball", _root.dynamicGFX);
ballshadow = new image3D(0, 0, 360, 0.11, "ballshadow", dynamicGFX);
ball.vel = new Vector(0, 0, 0);
ball.spin = 0;
player = new image3D(-3, -3, 350, 0.15, "playerShoot", dynamicGFX);
goalie = new image3D(0, 0, 515, 0.07, "goalie", dynamicGFX);
defenders = new image3D(0, 0, 450, 0.06, "defenders", dynamicGFX);
frontadboards = new image3D(0, 0, 600, 0.6, "backstand", dynamicBG3);
objects3d = new Array(pitch, goal, goalie, star, player, defenders, frontadboards);
ball.clip_mc.spots_mc.stop();
GOALWIDTH = 73.2;
GOALHEIGHT = -24.4;
ROWS = 5;
COLS = 7;
GOALX = -36.6;
GOALZ = 519;
GOALY = 0;
}
function updateFrameRate() {
if (!lasttimer) {
lasttimer = getTimer();
} else {
thistimer = getTimer();
diff = thistimer - lasttimer;
framerate = Math.round(1000 / diff);
lasttimer = thistimer;
}
}
function frameFunction() {
updateFrameRate();
if (!gameplaying) {
moveCameraWithMouse();
}
checkKeys();
updateCamera();
checkFade();
updateDials();
if (viewChanged) {
viewChanged = false;
for (var _local1 in objects3d) {
objects3d[_local1].updatePoints();
objects3d[_local1].updatePos();
objects3d[_local1].draw();
}
}
if (gameprogress > ballStart[_global.currEra - 1]) {
updateBall();
}
if (gameprogress == 0) {
playSound(s_whistle, 60);
}
if (gameprogress == ballStart[_global.currEra - 1]) {
playSound(s_kick, 100);
}
ball.updatePos();
ball.draw();
ballshadow.updatePos();
ballshadow.draw();
updateBallSpots();
gameprogress++;
}
function updateBall() {
var _local1 = _global;
if (ball.pos.y < GROUND) {
vMultiplyWithScalar(ball.vel, DAMPING);
vRotateY(ball.spin, ball.vel);
ball.spin = ball.spin * SPINDRAG;
} else {
vMultiplyWithScalar(ball.vel, DRAG);
}
ball.vel.y = ball.vel.y + gravity;
ball.newpos = new Vector(0, 0, 0);
vAdd(ball.pos, ball.vel, ball.newpos);
if (ball.newpos.y > GROUND) {
ball.newpos.y = GROUND;
ball.vel.y = (-ball.vel.y) * bounce;
}
if ((ball.newpos.z > boardZpos) && (ball.vel.z > 0)) {
ball.newpos.z = boardZpos;
ball.vel.z = ball.vel.z * (-BOARDBOUNCE);
}
if (checkCollisionWithFlat(defenders)) {
if (ball.clip_mc.hitTest(defenders.clip_mc.def1_mc)) {
defenders.clip_mc.def1_mc.play();
}
if (ball.clip_mc.hitTest(defenders.clip_mc.def2_mc)) {
defenders.clip_mc.def2_mc.play();
}
if (ball.clip_mc.hitTest(defenders.clip_mc.def3_mc)) {
defenders.clip_mc.def3_mc.play();
}
setCam(cams[3], 0.1);
worldDestPos.x = defenders.pos.x;
registerScore();
}
if ((ball.pos.z < star.pos.z) && (ball.newpos.z > star.pos.z)) {
if (ball.clip_mc.hitTest(star.clip_mc)) {
starHit = true;
star.clip_mc.gotoAndPlay(2);
} else {
starHit = false;
}
}
if (checkCollisionWithFlat(goalie)) {
registerScore();
}
if ((ball.pos.z < 520) && (ball.newpos.z > 520)) {
if (ball.clip_mc.hitTest(goalie.clip_mc[("goalie" + _local1.currEra) + "_mc"])) {
ball.vel.z = ball.vel.z * (-KEEPERDEFLECT);
ball.newpos.z = goalie.pos.z;
playSound(s_kick, 100);
}
if (((((!goalscored) && (!goaliesave)) && (ball.newpos.x >= (GOALLEFT + BALLRADIUS))) && (ball.newpos.x <= (GOALRIGHT - BALLRADIUS))) && (ball.newpos.y > (GOALTOP + BALLRADIUS))) {
goalscored = true;
} else {
goalscored = false;
}
if (((ball.newpos.x > (GOALLEFT - BALLRADIUS)) && (ball.newpos.x < (GOALLEFT + BALLRADIUS))) && (ball.newpos.y > GOALTOP)) {
ball.newpos.z = 519;
ball.vel.z = ball.vel.z * (-KEEPERDEFLECT);
playSound(s_kick, 100);
} else if (((ball.newpos.x < (GOALRIGHT + BALLRADIUS)) && (ball.newpos.x > (GOALRIGHT - BALLRADIUS))) && (ball.newpos.y > GOALTOP)) {
ball.newpos.z = 519;
ball.vel.z = ball.vel.z * (-KEEPERDEFLECT);
playSound(s_kick, 100);
} else if ((((ball.newpos.x > GOALLEFT) && (ball.newpos.x < GOALRIGHT)) && (ball.newpos.y > (GOALTOP - BALLRADIUS))) && (ball.newpos.y < (GOALTOP + BALLRADIUS))) {
ball.newpos.z = 519;
ball.vel.z = ball.vel.z * (-KEEPERDEFLECT);
playSound(s_kick, 100);
}
registerScore();
}
if (goalscored) {
if ((ball.newpos.z > NETZPOS) && (ball.vel.z > 0)) {
ball.vel.z = ball.vel.z * (-NETBOUNCE);
ball.vel.x = ball.vel.x * NETXDAMPING;
}
if ((ball.newpos.x < NETLEFT) && (ball.vel.x < 0)) {
ball.vel.x = ball.vel.x * (-NETBOUNCE);
}
if ((ball.newpos.x > NETRIGHT) && (ball.vel.x > 0)) {
ball.vel.x = ball.vel.x * (-NETBOUNCE);
}
if ((ball.newpos.y < NETTOP) && (ball.vel.y < 0)) {
ball.vel.y = ball.vel.y * (-NETBOUNCE);
}
}
if ((ball.pos.z <= 450) && (ball.newpos.z >= 450)) {
if ((ballDir < -2) && (ballDir > -30)) {
if (goalie.clip_mc._xscale < 0) {
goalie.clip_mc._xscale = -goalie.clip_mc._xscale;
}
goalie.clip_mc[("goalie" + _local1.currEra) + "_mc"].play();
} else if ((ballDir > 2) && (ballDir < 30)) {
if (goalie.clip_mc._xscale > 0) {
goalie.clip_mc._xscale = -goalie.clip_mc._xscale;
}
goalie.clip_mc[("goalie" + _local1.currEra) + "_mc"].play();
} else if ((ballDir >= -2) && (ballDir <= 2)) {
goalie.clip_mc[("goalie" + _local1.currEra) + "_mc"].gotoAndPlay("save2");
}
}
vCopy(ball.newpos, ball.pos);
ballshadow.pos.x = ball.newpos.x;
ballshadow.pos.z = ball.newpos.z;
var _local2 = Math.round(Math.abs(ball.newpos.y / 2));
if (_local2 > ballshadow.clip_mc._totalframes) {
_local2 = ballshadow.clip_mc._totalframes;
}
ballshadow.clip_mc.gotoAndStop(_local2);
if ((gameplaying && (Math.abs(ball.vel.z) < 0.01)) && (gameprogress > ballStart[_local1.currEra - 1])) {
ball.vel.x = 0;
ball.vel.y = 0;
ball.vel.z = 0;
playResult();
}
if (((worldDestPos.z - ball.pos.z) < -150) && (worldDestPos.z < 400)) {
worldDestPos.z = ball.pos.z - 150;
}
}
function registerScore() {
if (!scoreRegistered) {
if (goalscored || (starHit)) {
debuginfo = debuginfo + "\nSCORED!!!";
goalcount++;
if (starHit) {
if (scorecount > 0) {
scorecount = scorecount * 2;
} else {
scorecount = 2;
}
} else {
scorecount = scorecount + 1;
}
goalinfo = "SCORE!";
playSound(s_goal[(sgoalcount++) % 4]);
playSound(s_cheer, 25);
} else {
debuginfo = debuginfo + "\nMISS!!!";
goalinfo = "MISS!";
playSound(s_miss[(smisscount++) % 4]);
playSound(s_boo, 25);
}
updateNumberDial(goals_mc, goalcount);
updateNumberDial(score_mc, scorecount);
alert((("scorecount" + scorecount) + "goalcount") + goalcount);
scoreRegistered = true;
}
}
function checkCollisionWithFlat(flat) {
var _local2 = flat;
if ((ball.pos.z < _local2.pos.z) && (ball.newpos.z > _local2.pos.z)) {
var _local1 = _local2.clip_mc;
if (_local1 == goalie.clip_mc) {
_local1 = goalie.clip_mc[("goalie" + _global.currEra) + "_mc"];
}
if (ball.clip_mc.hitTest(_local1)) {
ball.vel.z = ball.vel.z * (-KEEPERDEFLECT);
ball.newpos.z = _local2.pos.z;
playSound(s_kick, 100);
return(true);
}
}
return(false);
}
function updateBallSpots() {
if (ball.pos.y <= startPoint.y) {
var _local1 = parseInt((ball.pos.z % ball.clip_mc.spots_mc._totalframes) + 1);
ball.clip_mc.spots_mc.gotoAndPlay(_local1);
}
}
function checkKeys() {
if (Key.isDown(Key.Left) && (Key.isDown(Key.Right))) {
allowCameraMovement = true;
}
}
function moveCameraWithMouse() {
var _local1 = _root;
if (!allowCameraMovement) {
return(false);
}
var _local3 = 0;
var rightlimit = 550;
var _local2 = 0;
var bottomlimit = 300;
var xmin = -55;
var xmax = 55;
var zmin = 400;
var zmax = 240;
if ((((_local1._xmouse > _local3) && (_local1._xmouse < rightlimit)) && (_local1._ymouse > _local2)) && (_local1._ymouse < bottomlimit)) {
worldDestPos.x = (((_local1._xmouse - _local3) / (rightlimit - _local3)) * (xmax - xmin)) + xmin;
worldDestPos.z = (((_local1._ymouse - _local2) / (bottomlimit - _local2)) * (zmax - zmin)) + zmin;
worldDestRot.y = worldDestPos.x * -0.15;
worldDestSpeed = 0.15;
resetCam = false;
} else if (!resetCam) {
setCam(cams[1], 0.15);
vRotateYAroundPoint(startPointRotation, WorldDestPos, rotatePoint);
worldDestRot.y = startPointRotation;
resetCam = true;
}
return(undefined);
}
function swapClips(oldClip_mc, newClipName, targetClip_mc) {
var _local1 = oldClip_mc;
targetClip_mc.attachMovie(newClipName, _local1._name + "_tmp", _local1.getDepth() + 100000);
var _local2 = targetClip_mc[_local1._name + "_tmp"];
_local2._xscale = _local1._xscale;
_local2._yscale = _local1._yscale;
_local2._x = _local1._x;
_local2._y = _local1._y;
_local1.swapDepths(_local2);
var _local3 = _local1._name;
removeMovieClip(_local1);
_local2._name = _local3;
return(_local2);
}
function B4(t) {
var _local1 = t;
return((_local1 * _local1) * _local1);
}
function B3(t) {
var _local1 = t;
return(((3 * _local1) * _local1) * (1 - _local1));
}
function B2(t) {
var _local1 = t;
return(((3 * _local1) * (1 - _local1)) * (1 - _local1));
}
function B1(t) {
var _local1 = t;
return(((1 - _local1) * (1 - _local1)) * (1 - _local1));
}
function startFadeOut(speed, donefunction) {
if (!currBrightness) {
currBrightness = 0;
}
if (fadeFunction) {
fadeFunction();
}
fadeFunction = donefunction;
fadeChange = -(100 / speed);
}
function startFadeIn(speed, donefunction) {
if (!currBrightness) {
currBrightness = -100;
}
if (fadeFunction) {
fadeFunction();
}
fadeFunction = donefunction;
fadeChange = 100 / speed;
}
function checkFade() {
if (fadeChange) {
currBrightness = currBrightness + fadeChange;
if (currBrightness > 0) {
currBrightness = 0;
fadeChange = false;
if (fadeFunction) {
fadeFunction();
fadeFunction = null;
}
} else if (currBrightness < -100) {
currBrightness = -100;
fadeChange = false;
if (fadeFunction) {
fadeFunction();
fadeFunction = null;
}
}
adjustBrightness(currBrightness);
}
}
function adjustBrightness(brightness) {
var _local1 = new Color(GFX3D_mc);
_local1.setBrightness(brightness, true);
}
function initSounds() {
var _local2 = 1;
sounds_mc.createEmptyMovieClip("kick_mc", _local2++);
s_kick = new Sound(sounds_mc.kick_mc);
s_kick.attachSound("s_kick");
sounds_mc.createEmptyMovieClip("whistle_mc", _local2++);
s_whistle = new Sound(sounds_mc.whistle_mc);
s_whistle.attachSound("s_whistle");
s_comments = new Array();
s_goal = new Array();
s_miss = new Array();
var _local1 = 1;
while (_local1 <= 4) {
sounds_mc.createEmptyMovieClip("s_goal" + _local1, _local2++);
sounds_mc.createEmptyMovieClip("s_miss" + _local1, _local2++);
_local1++;
}
_local1 = 1;
while (_local1 <= 2) {
sounds_mc.createEmptyMovieClip("s_comments" + _local1, _local2++);
_local1++;
}
_local1 = 0;
while (_local1 <= 2) {
sounds_mc.createEmptyMovieClip("s_cheer" + _local1, _local2++);
sounds_mc.createEmptyMovieClip("s_boo" + _local1, _local2++);
sounds_mc.createEmptyMovieClip("s_crowdloop" + _local1, _local2++);
_local1++;
}
}
function initEraSounds(_era) {
var _local3;
var _local2;
var _local1 = 1;
while (_local1 <= 4) {
_local3 = sounds_mc["s_goal" + _local1];
s_goal[_local1 - 1] = new Sound(_local3);
_local2 = (_era + "goal") + _local1;
s_goal[_local1 - 1].attachSound(_local2);
_local3 = sounds_mc["s_miss" + _local1];
s_miss[_local1 - 1] = new Sound(_local3);
_local2 = (_era + "miss") + _local1;
s_miss[_local1 - 1].attachSound(_local2);
_local1++;
}
_local1 = 1;
while (_local1 <= 2) {
_local3 = sounds_mc["s_goal" + _local1];
s_comments[_local1 - 1] = new Sound(_local3);
_local2 = (_era + "comment") + _local1;
s_comments[_local1 - 1].attachSound(_local2);
_local1++;
}
var cheerVolumes = [50, 50, 50];
var booVolumes = [50, 50, 50];
var crowdloopVolumes = [50, 30, 40];
_era--;
s_cheer = new Sound(sounds_mc["s_cheer" + _era]);
s_cheer.attachSound("s_cheer" + _era);
s_cheer.setVolume(cheerVolumes[_era]);
s_boo = new Sound(sounds_mc["s_boo" + _era]);
s_boo.attachSound("s_boo" + _era);
s_boo.setVolume(booVolumes[_era]);
s_crowdloop = new Sound(sounds_mc["s_crowdloop" + _era]);
s_crowdloop.attachSound("s_crowdloop" + _era);
s_crowdloop.setVolume(crowdloopVolumes[_era]);
}
function playSound(soundobj, vol, delay) {
if (soundOn) {
if (delay == undefined) {
delay = 0;
}
if (vol != undefined) {
soundobj.setVolume(vol);
}
soundobj.start();
}
}
function playSwish() {
playSound(s_swish, 50);
}
function toggleSound() {
if (soundOn) {
stopAllSounds();
soundbutton_mc.gotoAndStop(2);
} else {
s_crowdloop.start(0, 1000);
soundbutton_mc.gotoAndStop(1);
}
soundOn = !soundOn;
}
DRAW = 0;
IMAGE = 1;
FILL = 0;
MESH = 1;
depthTracker = new Array();
object3D.prototype.addline = function (p1num, p2num, lthickness, lcolour, targetclip) {
this.lines.push(new line3D(p1num, p2num, lthickness, lcolour, targetclip));
this.numlines++;
};
object3D.prototype.addlineimage = function (p1num, p2num, imagename, targetclip) {
this.lines.push(new lineImage(p1num, p2num, imagename, targetclip));
this.numlines++;
};
object3D.prototype.addquad = function (p1num, p2num, p3num, p4num, col, targetclip, alpha) {
var _local1 = this;
_local1.quads.push(new quad3D(p1num, p2num, p3num, p4num, col, targetclip));
_local1.quads[_local1.numquads].quadtype = FILL;
if (alpha) {
_local1.quads[_local1.numquads].clip_mc._alpha = alpha;
}
_local1.numquads++;
};
object3D.prototype.addnet = function (p1num, p2num, p3num, p4num, lineweight, linecol, linealpha, xdivide, ydivide, targetclip) {
var _local1 = this;
_local1.quads.push(new quad3D(p1num, p2num, p3num, p4num, linecol, targetclip));
_local1.quads[_local1.numquads].lineweight = lineweight;
_local1.quads[_local1.numquads].clip_mc._alpha = linealpha;
_local1.quads[_local1.numquads].quadtype = MESH;
_local1.quads[_local1.numquads].xdivide = xdivide;
_local1.quads[_local1.numquads].ydivide = ydivide;
_local1.edging = false;
_local1.numquads++;
};
object3D.prototype.addpoint = function (point) {
var _local1 = this;
var _local2 = point;
_local1.pointlist[_local1.numpoints] = _local2;
_local1.tpointlist[_local1.numpoints] = new Vector(_local2.x, _local2.y, _local2.z);
_local1.numpoints++;
};
object3D.prototype.updatePoints = function () {
var _local2 = this;
if (_local2.disabled) {
return(true);
}
pyawsin = sin(worldRot.y);
pyawcos = cos(worldRot.y);
ppitchsin = sin(worldRot.x);
ppitchcos = cos(worldRot.x);
i = 0;
while (i < _local2.numpoints) {
var _local1 = new Vector(0, 0, 0);
vSubtract(_local2.pos, worldPos, _local1);
vAdd(_local1, _local2.pointlist[i]);
_local1.x = (pyawcos * _local1.x) - (pyawsin * _local1.z);
var _local3 = (pyawsin * _local1.x) + (pyawcos * _local1.z);
var ty = _local1.y;
_local1.z = (ppitchcos * _local3) - (ppitchsin * ty);
_local1.y = (ppitchsin * _local3) + (ppitchcos * ty);
vCopy(_local1, _local2.tpointlist[i]);
i++;
}
return(undefined);
};
object3D.prototype.draw = function () {
var _local3 = this;
if (_local3.disabled) {
return(true);
}
i = _local3.numquads - 1;
while (i >= 0) {
var _local1 = _local3.quads[i];
p1ind = _local1.p1;
p2ind = _local1.p2;
var p1 = _local3.tpointlist[_local1.p1];
var p2 = _local3.tpointlist[_local1.p2];
var p3 = _local3.tpointlist[_local1.p3];
var p4 = _local3.tpointlist[_local1.p4];
if ((((p1.z > 1) && (p2.z > 1)) && (p3.z > 1)) && (p4.z > 1)) {
sx1 = (d * (p1.x / p1.z)) + screencenterX;
sy1 = (d * (p1.y / p1.z)) + screencenterY;
sx2 = (d * (p2.x / p2.z)) + screencenterX;
sy2 = (d * (p2.y / p2.z)) + screencenterY;
sx3 = (d * (p3.x / p3.z)) + screencenterX;
sy3 = (d * (p3.y / p3.z)) + screencenterY;
sx4 = (d * (p4.x / p4.z)) + screencenterX;
sy4 = (d * (p4.y / p4.z)) + screencenterY;
_local1.clip_mc._visible = true;
if (_local1.quadtype == FILL) {
_local1.clip_mc.clear();
_local1.clip_mc.moveTo(sx1, sy1);
_local1.clip_mc.beginFill(_local1.col, 100);
_local1.clip_mc.lineTo(sx2, sy2);
_local1.clip_mc.lineTo(sx3, sy3);
_local1.clip_mc.lineTo(sx4, sy4);
_local1.clip_mc.lineTo(sx1, sy1);
_local1.clip_mc.endFill();
} else if (_local1.quadtype == MESH) {
drawNet(new Vector(sx1, sy1), new Vector(sx2, sy2), new Vector(sx3, sy3), new Vector(sx4, sy4), _local1.xdivide, _local1.ydivide, _local1.lineweight, _local1.col, 100, _local1.clip_mc, _local1.edging);
}
clipZOrder(_local1.clip_mc, p1.z, p2.z);
} else {
_local1.clip_mc._visible = false;
}
i--;
}
i = _local3.numlines - 1;
while (i >= 0) {
var _local2 = _local3.lines[i];
p1ind = _local2.p1;
p2ind = _local2.p2;
var p1 = _local3.tpointlist[p1ind];
var p2 = _local3.tpointlist[p2ind];
if ((p1.z > 1) && (p2.z > 1)) {
sx1 = (d * (p1.x / p1.z)) + screencenterX;
sy1 = (d * (p1.y / p1.z)) + screencenterY;
sx2 = (d * (p2.x / p2.z)) + screencenterX;
sy2 = (d * (p2.y / p2.z)) + screencenterY;
_local2.clip_mc._visible = true;
if (_local2.linetype == DRAW) {
if (_local2.linethickness > 0) {
var thickness = (((d / (p1.z + ((p2.z - p1.z) >> 1))) * _local2.linethickness) / 5);
} else {
thickness = 0;
}
_local2.clip_mc.clear();
_local2.clip_mc.lineStyle(thickness, _local2.linecolour, 100);
_local2.clip_mc.moveTo(sx1, sy1);
_local2.clip_mc.lineTo(sx2, sy2);
} else if (_local2.linetype == IMAGE) {
var linevec = new Vector(sx2 - sx1, sy2 - sy1);
_local2.clip_mc._rotation = vAngle(linevec);
_local2.clip_mc._x = sx1;
_local2.clip_mc._y = sy1;
_local2.clip_mc._xscale = vMagnitude(linevec);
_local2.clip_mc._yscale = _local2.clip_mc._xscale;
}
clipZOrder(_local2.clip_mc, p1.z, p2.z);
} else {
_local2.clip_mc._visible = false;
}
i--;
}
return(undefined);
};
object3D.prototype.disable = function () {
var _local1 = this;
_local1.disabled = true;
i = 0;
while (i < _local1.numquads) {
_local1.quads[i].clip_mc._visible = false;
i++;
}
i = 0;
while (i < _local1.numlines) {
_local1.lines[i].clip_mc._visible = false;
i++;
}
};
object3D.prototype.enable = function () {
var _local1 = this;
_local1.disabled = false;
i = 0;
while (i < _local1.numquads) {
_local1.quads[i].clip_mc._visible = true;
i++;
}
i = 0;
while (i < _local1.numlines) {
_local1.lines[i].clip_mc._visible = true;
i++;
}
_local1.updatePoints();
_local1.draw();
};
image3d.prototype.disable = function () {
this.disabled = true;
this.clip_mc._visible = false;
};
image3d.prototype.enable = function () {
var _local1 = this;
_local1.disabled = false;
_local1.clip_mc._visible = true;
_local1.updatePos();
_local1.draw();
};
image3D.prototype.updatePos = function () {
if (this.disabled) {
return(true);
}
pyawsin = sin(worldRot.y);
pyawcos = cos(worldRot.y);
ppitchsin = sin(worldRot.x);
ppitchcos = cos(worldRot.x);
var _local1 = new Vector(0, 0, 0);
vSubtract(this.pos, worldPos, _local1);
_local1.x = (pyawcos * _local1.x) - (pyawsin * _local1.z);
var _local2 = (pyawsin * _local1.x) + (pyawcos * _local1.z);
var _local3 = _local1.y;
_local1.z = (ppitchcos * _local2) - (ppitchsin * _local3);
_local1.y = (ppitchsin * _local2) + (ppitchcos * _local3);
vCopy(_local1, this.tpos);
return(undefined);
};
image3D.prototype.draw = function () {
var _local1 = this;
if (_local1.disabled) {
return(true);
}
newPos = new Vector(0, 0, 0);
vCopy(_local1.tpos, newPos);
if (newPos.z > 0) {
sx = (d * (newPos.x / newPos.z)) + screencenterX;
sy = (d * (newPos.y / newPos.z)) + screencenterY;
_local1.clip_mc._visible = true;
_local1.clip_mc._x = sx;
_local1.clip_mc._y = sy;
scale = ((d * 100) / newPos.z) * _local1.scale;
if (_local1.clip_mc._xscale < 0) {
_local1.clip_mc._xscale = -scale;
} else {
_local1.clip_mc._xscale = scale;
}
if (_local1.clip_mc._yscale < 0) {
_local1.clip_mc._yscale = -scale;
} else {
_local1.clip_mc._yscale = scale;
}
clipZOrder(_local1.clip_mc, newPos.z);
} else {
_local1.clip_mc._visible = false;
}
return(undefined);
};
dial.prototype.activate = function () {
var _local2 = this;
_local2.active = true;
_local2.clip_mc.set_btn._visible = true;
_local2.targetScale = 40;
var _local1 = 0;
while (_local1 < dials.length) {
if (dials[_local1].clip_mc.getDepth() > _local2.clip_mc.getDepth()) {
_local2.clip_mc.swapDepths(dials[_local1].clip_mc);
}
_local1++;
}
};
dial.prototype.deactivate = function () {
var _local1 = this;
_local1.active = false;
_local1.clip_mc.set_btn._visible = false;
_local1.targetScale = 40;
};
dial.prototype.shrink = function (delay) {
var _local1 = this;
_local1.targetScale = 0;
if (delay) {
_local1.targetDelay = delay;
} else {
_local1.targetDelay = 0;
}
};
dial.prototype.enlarge = function (delay) {
var _local1 = this;
_local1.targetScale = 30;
if (delay) {
_local1.targetDelay = delay;
} else {
_local1.targetDelay = 0;
}
};
TWOPI = (Math.PI*2);
Color.prototype.setTint = function (col, percent, resetMode) {
if (isNaN(col) || (isNaN(percent))) {
return(undefined);
}
col = ((col <= 0) ? 0 : (((col >= 16777215) ? 16777215 : (Math.round(col)))));
percent = ((percent <= 0) ? 0 : (((percent >= 100) ? 1 : (percent / 100))));
if ((resetMode == undefined) || ((resetMode != true) && (resetMode != false))) {
resetMode = true;
}
var trans = this.getTransform();
if (resetMode) {
with (trans) {
ra = (ga = (ba = 100));
rb = (gb = (bb = 0));
}
}
with (trans) {
ra = ra - (ra * percent);
ga = ga - (ga * percent);
ba = ba - (ba * percent);
rb = rb + ((((col & 16711680) >> 16) - rb) * percent);
gb = gb + ((((col & 65280) >> 8) - gb) * percent);
bb = bb + (((col & 255) - bb) * percent);
}
this.setTransform(trans);
};
Color.prototype.resetBrightness = function () {
var trans = this.getTransform();
with (trans) {
ra = (ga = (ba = 100));
rb = (gb = (bb = 0));
}
this.setTransform(trans);
};
Color.prototype.setBrightness = function (value, resetMode) {
if (isNaN(value)) {
return(undefined);
}
value = ((value <= -100) ? -100 : (((value >= 100) ? 100 : (value))));
if ((resetMode == undefined) || ((resetMode != true) && (resetMode != false))) {
resetMode = true;
}
var trans = this.getTransform();
if (resetMode) {
with (trans) {
ra = (ga = (ba = 100));
rb = (gb = (bb = 0));
}
}
var percent = (Math.abs(value) / 100);
var brightnessColor = ((value > 0) ? 255 : 0);
with (trans) {
ra = ra - (ra * percent);
ga = ga - (ga * percent);
ba = ba - (ba * percent);
rb = rb + ((brightnessColor - rb) * percent);
gb = gb + ((brightnessColor - gb) * percent);
bb = bb + ((brightnessColor - bb) * percent);
}
this.setTransform(trans);
};
Color.prototype.negative = function () {
var trans = this.getTransform();
with (trans) {
ra = ra * -1;
ga = ga * -1;
ba = ba * -1;
rb = 255 - rb;
gb = 255 - gb;
bb = 255 - bb;
}
this.setTransform(trans);
};
Color.prototype.reset = function () {
this.setTransform({ra:100, ga:100, ba:100, aa:100, rb:0, gb:0, bb:0, ab:0});
};
Color.getColor = function (r, g, b) {
var _local1 = b;
var _local2 = r;
var _local3 = g;
if ((isNaN(_local2) || (isNaN(_local3))) || (isNaN(_local1))) {
return(-1);
}
_local2 = ((_local2 <= 0) ? 0 : (((_local2 >= 255) ? 255 : (Math.round(_local2)))));
_local3 = ((_local3 <= 0) ? 0 : (((_local3 >= 255) ? 255 : (Math.round(_local3)))));
_local1 = ((_local1 <= 0) ? 0 : (((_local1 >= 255) ? 255 : (Math.round(_local1)))));
return(((_local2 << 16) | (_local3 << 8)) | _local1);
};
initSounds();
stop();
initConstants();
initVars();
initDials();
initClips();
initPitch();
main_mc.onEnterFrame = frameFunction;
var labeltexts = new Array("PLAY GAME", "INSTRUCTIONS", "HIGH SCORES", "SEND TO FRIEND");
var labelactions = new Array();
labelactions[0] = new Array(_root, "showScreen", "intro_mc");
labelactions[1] = new Array(_root, "showScreen", "instruction_mc");
labelactions[2] = new Array(_root, "showScreen", "highscores_mc");
labelactions[3] = new Array(_root, "showScreen", "sendtofriend_mc");
var i = 0;
while (i < labeltexts.length) {
this[("btn_nav" + (i + 1)) + "_mc"].btn_nav_txt_mc.btn_nav_txt.text = labeltexts[i];
this[("btn_nav" + (i + 1)) + "_mc"].action = labelactions[i];
this[("btn_nav" + (i + 1)) + "_mc"].active = false;
this[("btn_nav" + (i + 1)) + "_mc"].onRollOver = function () {
this.gotoAndStop("over");
};
this[("btn_nav" + (i + 1)) + "_mc"].onRollOut = function () {
var _local1 = this;
if (_local1.active) {
_local1.gotoAndStop("active");
_local1.enabled = false;
} else {
_local1.gotoAndStop("up");
}
};
this[("btn_nav" + (i + 1)) + "_mc"].onPress = function () {
var _local1 = this;
if (_local1 != _local1._parent.currentbutton) {
_local1._parent.currentbutton.gotoAndStop("up");
_local1._parent.currentbutton.active = false;
_local1._parent.currentbutton.enabled = true;
}
_local1.gotoAndStop("down");
_local1.active = true;
_local1._parent.currentbutton = _local1;
_local1.action[0][_local1.action[1]](_local1.action[2]);
};
_root[labelactions[i][2]]._visible = false;
i++;
}
this.currentScreen = undefined;
this.currentbutton = undefined;
this.showScreen = function (_screenName) {
var _local1 = this[_screenName];
if (_local1 != currentScreen) {
if (currentScreen != undefined) {
currentScreen._visible = false;
}
_local1._visible = true;
this.currentScreen = _local1;
}
if (_screenName != "intro_mc") {
stopAllSounds();
}
};
this.btn_nav1_mc.onPress();
this.soundbutton_mc.onPress = function () {
_root.toggleSound();
};
stop();
Symbol 16 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 1
stop();
Symbol 30 MovieClip [star] Frame 1
stop();
Symbol 30 MovieClip [star] Frame 10
gotoAndPlay (3);
Symbol 98 MovieClip [playerShoot] Frame 1
stop();
Symbol 98 MovieClip [playerShoot] Frame 37
stop();
Symbol 98 MovieClip [playerShoot] Frame 38
stop();
Symbol 98 MovieClip [playerShoot] Frame 60
stop();
Symbol 98 MovieClip [playerShoot] Frame 61
stop();
Symbol 98 MovieClip [playerShoot] Frame 83
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 25
if (!_global.main_mc.goalscored) {
stop();
}
Symbol 125 MovieClip Frame 37
stop();
Symbol 125 MovieClip Frame 48
stop();
Symbol 150 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 23
if (!_global.main_mc.goalscored) {
stop();
}
Symbol 150 MovieClip Frame 41
stop();
Symbol 150 MovieClip Frame 52
stop();
Symbol 177 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 25
if (!_global.main_mc.goalscored) {
stop();
}
Symbol 177 MovieClip Frame 39
stop();
Symbol 177 MovieClip Frame 50
stop();
Symbol 185 MovieClip [backstand] Frame 1
stop();
Symbol 189 MovieClip Frame 1
stop();
Symbol 191 MovieClip [ballshadow] Frame 1
stop();
Symbol 218 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 4
stop();
Symbol 218 MovieClip Frame 5
stop();
Symbol 218 MovieClip Frame 8
stop();
Symbol 218 MovieClip Frame 9
stop();
Symbol 218 MovieClip Frame 12
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 4
stop();
Symbol 241 MovieClip Frame 5
stop();
Symbol 241 MovieClip Frame 8
stop();
Symbol 241 MovieClip Frame 9
stop();
Symbol 241 MovieClip Frame 12
stop();
Symbol 266 MovieClip Frame 1
stop();
Symbol 266 MovieClip Frame 4
stop();
Symbol 266 MovieClip Frame 5
stop();
Symbol 266 MovieClip Frame 8
stop();
Symbol 266 MovieClip Frame 9
stop();
Symbol 266 MovieClip Frame 12
stop();
Symbol 267 MovieClip [defenders] Frame 1
stop();
Symbol 273 MovieClip [sidestand] Frame 1
stop();
Symbol 275 MovieClip Frame 1
stop();
Symbol 280 MovieClip Frame 1
stop();
Symbol 284 MovieClip Frame 1
stop();
Symbol 285 MovieClip [ball] Frame 1
stop();
Symbol 327 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 1
stop();
Symbol 367 MovieClip Frame 1
stop();
Symbol 399 Button
on (release) {
_global.fixedEra = 1;
_global.main_mc.startGame();
}
Symbol 410 Button
on (release) {
_global.fixedEra = 2;
_global.main_mc.startGame();
}
Symbol 419 Button
on (release) {
_global.fixedEra = 3;
_global.main_mc.startGame();
}
Symbol 448 MovieClip Frame 31
goals_txt.text = this.goalcount;
score_txt.text = this.scorecount;
submit_btn.onPress = function () {
var _local3 = name_txt.text;
var _local2 = email_txt.text;
if ((((_local3 != "") && (_local3 != "NAME")) && (_local2 != "")) && (_local2 != "EMAIL")) {
var _local1 = new LoadVars();
var rv = new LoadVars();
_local1.NAME = _local3;
_local1.SCORE = goalcount;
_local1.GOALS = scorecount;
_local1.EMAIL = _local2;
_local1.sendAndLoad(_root.basepath + "SaveScore.php", rv, "POST");
rv.onLoad = function () {
_root.lose_mc._visible = false;
_root.intro_mc._visible = true;
};
}
};
Symbol 448 MovieClip Frame 49
goals_txt.text = this.goalcount;
score_txt.text = this.scorecount;
submit_btn.onPress = function () {
var _local2 = name_txt.text;
if ((_local2 != "") && (_local2 != "NAME")) {
var _local1 = new LoadVars();
var _local3 = new LoadVars();
_local1.NAME = _local2;
_local1.SCORE = goalcount;
_local1.GOALS = scorecount;
_local1.sendAndLoad(_root.basepath + "SaveScore.php", _local3, "POST");
_local3.onLoad = function () {
_root.lose_mc._visible = false;
_root.intro_mc._visible = true;
};
}
};
Symbol 553 MovieClip Frame 74
_global.main_mc.resetGame();
Symbol 553 MovieClip Frame 152
_global.main_mc.resetGame();
Symbol 553 MovieClip Frame 234
_global.main_mc.resetGame();
Symbol 579 Button
on (press) {
gotoAndPlay ("skip1");
}
Symbol 585 Button
on (press) {
gotoAndPlay ("skip2");
}
Symbol 599 Button
on (press) {
gotoAndPlay ("skip3");
}
Symbol 612 MovieClip Frame 1
stop();
Symbol 612 MovieClip Frame 2
blanking_btn.useHandCursor = false;
Symbol 612 MovieClip Frame 118
gotoAndStop (1);
_root.playSound(_root.s_comments[(_root.scommentcount++) % 2]);
Symbol 612 MovieClip Frame 119
blanking_btn.useHandCursor = false;
Symbol 612 MovieClip Frame 247
gotoAndStop (1);
_root.playSound(_root.s_comments[(_root.scommentcount++) % 2]);
Symbol 612 MovieClip Frame 248
blanking_btn.useHandCursor = false;
Symbol 612 MovieClip Frame 363
gotoAndStop (1);
_root.playSound(_root.s_comments[(_root.scommentcount++) % 2]);
Symbol 630 MovieClip Frame 1
function xValidateEmail(xES) {
var _local2 = xES;
_local2 = _local2.toLowerCase();
var _local1 = true;
var _local3 = _local2.indexOf("@");
var xB = _local2.substring(0, _local3);
var xD = (_local2.length - 1);
var xE = _local2.lastIndexOf(".");
var xC = _local2.substring(_local3 + 1, xE);
var xF = (xD - (xE + 1));
if (_local3 == -1) {
_local1 = false;
}
if (_local3 != _local2.lastIndexOf("@")) {
_local1 = false;
}
if (this.xCheckSUVC(xB) != true) {
_local1 = false;
}
if (xB.length < 1) {
_local1 = false;
}
if (this.xCheckSUVC(xC) != true) {
_local1 = false;
}
if (xC.length < 2) {
_local1 = false;
}
if (this.xCheckSUVC(_local2.substr(xE + 1, xD)) != true) {
_local1 = false;
}
if ((xF < 1) || (xF > 3)) {
_local1 = false;
}
return(_local1);
}
function xCheckSUVC(xESS) {
var _local3 = true;
var _local2 = new Array("!", "\u00A3", "$", "%", "^", "&", "*", "+", "=", "?", ":", ";", "'", "\t", " ", "\"", "~", "#", "/");
var _local1 = 0;
while (_local1 <= (_local2.length - 1)) {
if (xESS.indexOf(_local2[_local1], 0) != -1) {
_local3 = false;
break;
}
_local1++;
}
return(_local3);
}
goals_txt.text = this.goalcount;
yourname_txt.tabIndex = 1;
youremail_txt.tabIndex = 2;
f1name_txt.tabIndex = 3;
f1email_txt.tabIndex = 4;
f2name_txt.tabIndex = 5;
f2email_txt.tabIndex = 6;
f3name_txt.tabIndex = 7;
f3email_txt.tabIndex = 8;
submit_btn.onPress = function () {
var sname = yourname_txt.text;
var _local3 = youremail_txt.text;
var f1email = f1email_txt.text;
var f1name = f1name_txt.text;
var f2email = f2email_txt.text;
var f2name = f2name_txt.text;
var f3email = f3email_txt.text;
var f3name = f3name_txt.text;
var _local2 = false;
var emailok = xValidateEmail(_local3);
if ((_local3 == "YOUR EMAIL") || (!emailok)) {
youremail_txt.textColor = 13369344 /* 0xCC0000 */;
_local2 = true;
} else {
youremail_txt.textColor = 0;
}
if ((sname == "YOUR NAME") || (sname.length < 4)) {
yourname_txt.textColor = 13369344 /* 0xCC0000 */;
_local2 = true;
} else {
yourname_txt.textColor = 0;
}
var emailok = xValidateEmail(f1email);
if ((f1email == "FRIEND 1 EMAIL") || (!emailok)) {
f1email_txt.textColor = 13369344 /* 0xCC0000 */;
_local2 = true;
} else {
f1email_txt.textColor = 0;
}
if ((f1name == "FRIEND 1 NAME") || (f1name.length < 3)) {
f1name_txt.textColor = 13369344 /* 0xCC0000 */;
_local2 = true;
} else {
f1name_txt.textColor = 0;
}
if (!_local2) {
var _local1 = new LoadVars();
var rv = new LoadVars();
_local1.SENDERNAME = sname;
_local1.SENDEREMAIL = _local3;
_local1.RECEIPIENTNAME1 = f1name;
_local1.RECEIPIENTEMAIL1 = f1email;
if (f2email != "FRIEND 2 EMAIL") {
var emailok = xValidateEmail(f2email);
if (!emailok) {
f2email_txt.textColor = 13369344 /* 0xCC0000 */;
_local2 = true;
} else {
f2email_txt.textColor = 0;
_local1.RECEIPIENTNAME2 = f2name;
_local1.RECEIPIENTEMAIL2 = f2email;
}
}
if (f3email != "FRIEND 3 EMAIL") {
var emailok = xValidateEmail(f3email);
if (!emailok) {
f3email_txt.textColor = 13369344 /* 0xCC0000 */;
_local2 = true;
} else {
f3email_txt.textColor = 0;
_local1.RECEIPIENTNAME3 = f3name;
_local1.RECEIPIENTEMAIL3 = f3email;
}
}
if (!_local2) {
_local1.sendAndLoad(_root.basepath + "TellAFriend.php", rv, "POST");
rv.onLoad = function () {
nextFrame();
};
}
}
};
stop();
Symbol 630 MovieClip Frame 2
back_btn.onPress = function () {
prevFrame();
};
Symbol 640 MovieClip Frame 1
stop();
Symbol 644 MovieClip Frame 1
stop();
Symbol 648 MovieClip Frame 1
stop();
Symbol 662 MovieClip Frame 1
stop();
var selfRef = this;
this._parent.scrollup_mc.onPress = function () {
if (selfRef.scrollhandle_mc._y > 0) {
selfRef.scrollhandle_mc._y = selfRef.scrollhandle_mc._y - 10;
selfRef.update();
} else {
selfRef.scrollhandle_mc._y = 0;
}
};
this._parent.scrolldown_mc.onPress = function () {
if (selfRef.scrollhandle_mc._y < (selfRef._height - selfRef.scrollhandle_mc._height)) {
selfRef.scrollhandle_mc._y = selfRef.scrollhandle_mc._y + 10;
selfRef.update();
} else {
selfRef.scrollhandle_mc._y = selfRef._height - selfRef.scrollhandle_mc._height;
}
};
this.scrollhandle_mc.onPress = function () {
var _local1 = this;
_local1.startDrag(false, 0, 0, 0, _local1._parent.scrollbartrack_mc._height - _local1._height);
_local1._parent.updateInterval = setInterval(_local1._parent, "update", 100);
};
this.scrollhandle_mc.onRelease = (this.scrollhandle_mc.onReleaseOutside = function () {
this.stopDrag();
clearInterval(this._parent.updateInterval);
});
this.update = function () {
var _local1 = this;
var _local2 = _local1.scrollhandle_mc._y / (_local1._height - _local1.scrollhandle_mc._height);
_local1._parent.scroller_mc._y = (-((_local1._parent.scroller_mc._height - _local1._height) * _local2)) + _local1._y;
};
this.init = function () {
var _local1 = this;
_local1._visible = _local1._parent.scroller_mc._height > _local1._height;
};
Symbol 663 MovieClip Frame 1
function clearScores() {
var _local1 = 1;
while (_local1 < lv.total) {
scroller_mc[("row" + _local1) + "_mc"].removeMovieClip();
_local1++;
}
}
function showScores(_timemode, _buttonRef) {
clearScores();
if (currentMode != undefined) {
currentMode.enabled = true;
currentMode.gotoAndStop("_up");
}
_buttonRef.enabled = false;
currentMode = _buttonRef;
scrollbar_mc._visible = false;
scroller_mc._visible = false;
scrollup_mc._visible = false;
scrolldown_mc._visible = false;
lv = new LoadVars();
lv.load((((_root.basepath + "GetScores.php?MODE=") + _timemode) + "&rnd=") + new Date().getTime());
lv.onLoad = function () {
generateScores();
};
}
function generateScores() {
var _local1;
var _local3;
var _local2 = 0;
while (_local2 < lv.total) {
_local1 = scroller_mc[("row" + _local2) + "_mc"];
if (_local1 == undefined) {
_local1 = scroller_mc.row0_mc.duplicateMovieClip(("row" + _local2) + "_mc", _local2 + 2);
_local1._y = _local2 * _local1._height;
}
_local3 = _local2 + 1;
_local1.nr_txt.text = _local3 + ".";
_local1.name_txt.text = lv["name" + _local3];
_local1.goals_txt.text = lv["goals" + _local3];
_local1.score_txt.text = lv["score" + _local3];
_local2++;
}
scroller_mc._visible = true;
scrollbar_mc._visible = scroller_mc._height > scrollbar_mc._height;
scrolldown_mc._visible = scroller_mc._height > scrollbar_mc._height;
scrollup_mc._visible = scroller_mc._height > scrollbar_mc._height;
}
var lv;
var total = 0;
var currentMode;
stop();
today_mc.onPress = function () {
showScores("today", this);
};
week_mc.onPress = function () {
showScores("week", this);
};
alltime_mc.onPress = function () {
showScores("alltime", this);
};
today_mc.gotoAndStop("_down");
today_mc.onPress();
Symbol 672 MovieClip Frame 1
stop();
Symbol 679 MovieClip Frame 1
stop();
Symbol 680 MovieClip Frame 1
stop();
Symbol 681 MovieClip Frame 1
stop();
Symbol 682 MovieClip Frame 1
stop();
Symbol 688 Button
on (release) {
getURL ("http://www.vauxhall.co.uk/vx/carsandvans/microsite.do?bandWidth_m=broadbandµsite=newvectra&campaignid=vecsig&advertiserid=freeloader&bannerid=game", "_blank");
}