Frame 1
function soundPrep() {
globalVolume = new Sound();
createEmptyMovieClip("fxSoundHolder", 11);
createEmptyMovieClip("bgSoundHolder", 12);
createEmptyMovieClip("ambientSoundHolder", 13);
curSound = new Sound("fxSoundHolder");
ambientSound = new Sound("ambientSoundHolder");
ambientSound.attachSound("ambient");
ambientSound.setVolume(95);
bgSound = new Sound("bgSoundHolder");
bgSound.attachSound("bgMusic");
bgSound.setVolume(50);
_global.muteSound = false;
}
function soundState(n) {
if (n) {
globalVolume.setVolume(0);
} else {
globalVolume.setVolume(100);
}
}
function sectionStart(sectionNum) {
var _local3 = _global;
trace("section: " + sectionNum);
_local3.section = sectionNum;
switch (sectionNum) {
case "init" :
var br = attachMovie("border", "border", 99999);
br._x = 0;
br._y = 0;
var _local1 = attachMovie("openingScreens", "openingScreens", 10);
_local1._x = 275;
_local1._y = 225;
var sb = attachMovie("soundButton", "soundButton", 100);
sb._x = 515;
sb._y = 420;
sb._alpha = 75;
soundPrep();
bgSound.start(0, 9999);
return;
case "startGame" :
var p1 = (this.aChosenPlayers[0].num - 1);
var p2 = (this.aChosenPlayers[1].num - 1);
border.swapDepths(99999);
openingScreens.removeMovieClip();
ambientSound.start(0, 9999);
bgSound.stop();
var batsman1 = {pName:_local3.aPlayers[p1].pName, nickName:_local3.aPlayers[p1].nickName, num:p1, runs:0, nextTarg:50};
var batsman2 = {pName:_local3.aPlayers[p2].pName, nickName:_local3.aPlayers[p2].nickName, num:p2, runs:0, nextTarg:50};
var openingScore = Math.ran(10, 40);
var openingScore = (runsTarget - runsToGet);
_lev.attachClass("mcBat", 20, Bat, [batsman1, batsman2], openingScore);
return;
case "endGame" :
var _local2 = mcBat.score - startScore;
mcBat.removeMovieClip();
ambientSound.stop();
bgSound.start(0, 9999);
_local1 = attachMovie("openingScreens", "openingScreens", 10);
_local1._x = 275;
_local1._y = 225;
_local1.gotoAndStop("endGame");
if (_local2 >= runsToGet) {
_local1.info = ("Well done you scored " + _local2) + " runs! You won the Ashes! Submit your score to enter the prize draw to win xxxx!";
_local1.score = _local2;
} else {
_local1.info = ("Disaster! You only managed to score " + _local2) + " runs. The Aussies retain the Ashes! Submit your score anyway to enter the prize draw to win xxxx.";
_local1.score = _local2;
}
_local1.finalScore.text = _local2;
return;
}
}
fscommand ("allowscale", false);
fscommand ("showmenu", false);
_quality = "HIGH";
_lev = _root;
_global.section = 0;
_global.movieHeight = 400;
_global.movieWidth = 400;
RADIAN = (Math.PI/180);
mRd = math.round;
mMx = math.max;
mMn = math.min;
mAb = math.abs;
runsMax = [200, 185, 165, 150, 135, 115, 100, 85, 65, 50];
runsMin = [150, 135, 120, 110, 95, 80, 70, 55, 40, 25];
Math.easeInOutQuad = function (t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return((((c / 2) * _local1) * _local1) + b);
}
_local1--;
return((((-c) / 2) * ((_local1 * (_local1 - 2)) - 1)) + b);
};
Math.ran = function (n1, n2) {
return(Math.ceil((Math.random() * n1) + n2));
};
var l = attachMovie("loader", "loader", 10);
l._x = 120;
l._y = 200;
playerReset = function (n) {
var acp = ((this.aChosenPlayers = []));
};
playerSelect = function (n) {
var _local3 = n;
var _local1 = this.aChosenPlayers;
_local1.push(_local3);
trace(_local3.num);
_local3.pos = _local1.length - 1;
if (_local1.length > 2) {
_local1[0].gotoAndStop("notSelected");
_local1.splice(0, 1);
_local1[0].pos = 0;
_local1[1].pos = 1;
}
if (_local1.length == 2) {
openingScreens.stepOut.gotoAndStop(2);
var _local2 = Math.max(_local1[0].num, _local1[1].num) - 2;
runsToGet = runsMin[_local2] + Math.floor(Math.random() * (runsMax[_local2] - runsMin[_local2]));
openingScreens.runsRequired = (("Runs required with this partnership:" + runsMin[_local2]) + "-") + runsMax[_local2];
trace(runsToGet);
} else {
openingScreens.runsRequired = "";
}
};
playerDeselect = function (n) {
var _local1 = this.aChosenPlayers;
n.gotoAndStop("notSelected");
_local1.splice(n.pos, 1);
_local1[0].pos = 0;
openingScreens.stepOut.gotoAndStop(1);
};
_global.playFX = function (cur) {
curSound.attachSound(cur);
curSound.start();
};
_global.killMusic = function () {
bgSound.stop();
};
_global.killAmbient = function () {
ambientSound.stop();
};
var b = ((_global.bowlerLib = {}));
b.bowler1 = {num:1, bName:"S. Warne", skill:4, speed:3, spin:3, arm:"right"};
b.bowler2 = {num:2, bName:"J. Gillespie", skill:3, speed:4, spin:1, arm:"right"};
b.bowler3 = {num:3, bName:"G. McGrath", skill:3, speed:3, spin:2, arm:"right"};
b.bowler4 = {num:4, bName:"M. Kasprowicz", skill:3, speed:4, spin:1, arm:"right"};
var a = ((_global.aPlayers = []));
a.push({pName:"A. Strauss", nickName:"Strauss"});
a.push({pName:"M. Trescothick", nickName:"Trescothick"});
a.push({pName:"M. Vaughan", nickName:"Vaughan"});
a.push({pName:"G. Thorpe", nickName:"Thorpe"});
a.push({pName:"K. Pietersen", nickName:"Pietersen"});
a.push({pName:"A. Flintoff", nickName:"Flintoff"});
a.push({pName:"G. Jones", nickName:"Jones"});
a.push({pName:"A. Giles", nickName:"Giles"});
a.push({pName:"S. Jones", nickName:"Jones"});
a.push({pName:"D. Gough", nickName:"Gough"});
a.push({pName:"S. Harmison", nickName:"Harmison"});
var a = ((_global.aInfo = new Array(11)));
a[0] = ["batsman 1 against bowler 1", "batsman 1 against bowler 2", "batsman 1 against bowler 3", "batsman 1 against bowler 4"];
a[1] = ["batsman 2 against bowler 1", "batsman 2 against bowler 2", "batsman 2 against bowler 3", "batsman 2 against bowler 4"];
a[2] = ["batsman 3 against bowler 1", "batsman 3 against bowler 2", "batsman 3 against bowler 3", "batsman 3 against bowler 4"];
a[3] = ["batsman 4 against bowler 1", "batsman 4 against bowler 2", "batsman 4 against bowler 3", "batsman 4 against bowler 4"];
a[4] = ["batsman 5 against bowler 1", "batsman 5 against bowler 2", "batsman 5 against bowler 3", "batsman 5 against bowler 4"];
a[5] = ["batsman 6 against bowler 1", "batsman 6 against bowler 2", "batsman 6 against bowler 3", "batsman 6 against bowler 4"];
a[6] = ["batsman 7 against bowler 1", "batsman 7 against bowler 2", "batsman 7 against bowler 3", "batsman 7 against bowler 4"];
a[7] = ["batsman 8 against bowler 1", "batsman 8 against bowler 2", "batsman 8 against bowler 3", "batsman 8 against bowler 4"];
a[8] = ["batsman 9 against bowler 1", "batsman 9 against bowler 2", "batsman 9 against bowler 3", "batsman 9 against bowler 4"];
a[9] = ["batsman 10 against bowler 1", "batsman 10 against bowler 2", "batsman 10 against bowler 3", "batsman 10 against bowler 4"];
a[10] = ["batsman 11 against bowler 1", "batsman 11 against bowler 2", "batsman 11 against bowler 3", "batsman 11 against bowler 4"];
runsTarget = 251;
MovieClip.prototype.attachClass = function (instance, depth, t_class) {
var _local2 = arguments;
var instance;
var depth;
var t_class;
var mc = this.createEmptyMovieClip(instance, depth);
if (t_class != undefined) {
mc.__proto__ = t_class.prototype;
var _local3 = new Array();
var _local1;
_local1 = 3;
while (_local1 < _local2.length) {
_local3[_local1 - 3] = _local2[_local1];
_local1++;
}
t_class.apply(mc, _local3);
mc.onLoad();
}
return(mc);
};
ASSetPropFlags(MovieClip.prototype, ["attachClass"], 1);
Bat = function (aPlayers, openingScore) {
var _local1 = this;
_local1.aPlayers = aPlayers;
_local1.score = openingScore;
startScore = openingScore;
_local1.init();
};
Bat.prototype = new MovieClip();
Bat.prototype.init = function () {
var _local2 = this;
_local2.bowlNum = 0;
_local2.overNum = 1;
_local2.bowl = true;
_local2.ballHeight = 0;
_local2.actionStyle = 0;
_local2.mouseTrigger = false;
_local2.onMouseDown = function () {
if (this.startScreen._x < 0) {
this.mouseTrigger = true;
}
};
_local2.onMouseUp = function () {
this.mouseTrigger = false;
};
var genAlpha = 40;
var p = _local2.attachMovie("pitch", "pitch", 20);
var s = _local2.attachMovie("stumps", "stumps", 150);
s._x = 255;
s._y = 335;
s._xscale = (s._yscale = 92);
var bs = _local2.attachMovie("stumps", "farStumps", 134);
bs._x = 266;
bs._y = 110;
bs._xscale = (bs._yscale = 31);
var u = _local2.attachMovie("umpire", "umpire", 133);
u._x = 233;
u._y = 40;
u._xscale = (u._yscale = 90);
var p = _local2.createEmptyMovieClip("player", 143);
var bx = ((_local2.bx = 275));
var by = ((_local2.by = 250));
var b = p.attachMovie("bat", "bat", 95);
b.gotoAndStop(50);
b._x = bx;
b._y = by;
b._xscale = (b._yscale = 50);
var b = p.attachMovie("body", "body", 100);
b.top.chestPivot._xscale = 0;
b.bottom.gotoAndStop("stand");
b._x = bx - 30;
b._y = by;
b._alpha = genAlpha;
var rs = p.attachMovie("shoulder", "rightShoulder", 120);
rs._x = bx;
rs._y = by;
rs._alpha = genAlpha;
var ra = p.attachMovie("arm", "rightArm", 110);
ra._x = bx;
ra._y = by;
ra._alpha = genAlpha;
var rg = p.attachMovie("glove", "rightGlove", 115);
rg._x = bx;
rg._y = by;
rg._alpha = genAlpha;
var ls = p.attachMovie("shoulderDark", "leftShoulder", 80);
ls._x = bx;
ls._y = by;
ls._alpha = genAlpha;
var la = p.attachMovie("arm", "leftArm", 70);
la._x = bx;
la._y = by;
la._alpha = genAlpha;
var lg = p.attachMovie("gloveDark", "leftGlove", 90);
lg._x = bx;
lg._y = by;
lg._alpha = genAlpha;
_local2.handlePrep();
_local2.curBatsman = _local2.aPlayers[1];
_local2.curBowler = _global.bowlerLib.bowler1;
var bi = _local2.attachMovie("infoScreen", "bowlerInfo", 250);
bi._x = 560;
bi._y = 10;
var ci = _local2.attachMovie("contextInfo", "contextInfo", 255);
ci._x = -250;
ci._y = 10;
ci.stop();
var oi = _local2.attachMovie("onScreenInfo", "onScreenInfo", 260);
oi._x = 0;
oi._y = 0;
_local2.updateScore(0);
o.bowler.text = _local2.curBowler.bName;
_local2.switchPlayers();
var ss = _local2.attachMovie("startScreen", "startScreen", 265);
ss._x = -300;
ss._y = 10;
var r = Math.ran(3, 0);
if (r == 1) {
_global.playFX("start1");
ss.info.text = ((((("This is it, England are on " + _local2.score) + " for 9. Can the fabled partnership of ") + _local2.aPlayers[0].nickName) + " and ") + _local2.aPlayers[1].nickName) + " produce the magic required here today....";
} else if (r == 2) {
_global.playFX("start2");
ss.info.text = ((((("It's " + _local2.aPlayers[0].nickName) + " and ") + _local2.aPlayers[1].nickName) + ". With England on ") + _local2.score) + " for 9, this partnership will have to be at it's best against some tough Australian bowlers...";
} else {
_global.playFX("start1");
ss.info.text = ((((_local2.score + " for 9 and England need a powerful performance from the ") + _local2.aPlayers[0].nickName) + " and ") + _local2.aPlayers[1].nickName) + " partnership, but can they deliver...?";
}
ss.info.text = ss.info.text + ((" you need " + runsTarget) + " runs to win.");
_local2.startScreenIn();
var _local3 = 0;
while (_local3 < 4) {
var _local1 = _local2.attachMovie("fielder", "fielder" + _local3, 60 + _local3);
_local1.num = _local3;
switch (_local1.num) {
case 1 :
_local1.xMin = 0;
_local1.xMax = 166;
break;
case 2 :
_local1.xMin = 191;
_local1.xMax = 357;
break;
case 3 :
_local1.xMin = 382;
_local1.xMax = 550;
}
_local1._x = Math.ran(166, _local1.xMin);
_local1._y = Math.ran(60, 60);
_local2.prepFielder(_local1);
}
_local3 = _local3++;
};
Bat.prototype.startScreenIn = function () {
var _local1 = this;
var _local2 = _local1.startScreen;
_local2.onMouseDown = function () {
this._parent.startScreenOut();
};
_local2.onEnterFrame = function () {
this._x = this._x - ((this._x - 275) / 5);
};
};
Bat.prototype.startScreenOut = function () {
var _local1 = this;
var _local2 = _local1.startScreen;
_local2.onMouseDown = function () {
};
_local2.onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x - ((_local1._x + 300) / 5);
if (_local1._x < -290) {
_local1._parent.bowlerInfoIn();
delete _local1.onEnterFrame;
}
};
};
Bat.prototype.prepFielder = function (f) {
var _local1 = this;
var _local2 = f;
_local2.gotoAndStop("stand");
_local2.xTarg = Math.ran(166, _local2.xMin);
_local2.yTarg = Math.ran(60, 60);
_local2.xAcc = (_local2.yAcc = 0);
var scaleCalc;
var bs = _local1.ballShadow;
var i = 0;
_local2.onEnterFrame = function () {
var _local1 = this;
if ((++i) % 2) {
_local1.swapDepths(Math.min(Math.max(Math.round(_local1._y), 60), 120));
}
_local1._yscale = (_local1._xscale = _local1._y / 1.8);
scaleCalc = (_local1._xscale * 1) / 100;
if ((((_local1._x > (bs._x - 50)) && (_local1._x < (bs._x + 50))) && (_local1._x > _local1.xMin)) && (_local1._x < _local1.xMax)) {
_local1.chosenField = true;
} else {
_local1.chosenField = false;
}
if ((!_local1._parent.actionStyle) && (_local1.chosenField)) {
if (_local1._x > (bs._x + 2)) {
_local1.xAcc = _local1.xAcc - ((_local1.xAcc + (scaleCalc * 3)) / 10);
if (_local1._currentframe == 3) {
_local1.gotoAndStop("runFront");
}
} else if (_local1._x < (bs._x - 2)) {
if (_local1._currentframe == 3) {
_local1.gotoAndStop("runFront");
}
_local1.xAcc = _local1.xAcc - ((_local1.xAcc - (scaleCalc * 3)) / 10);
}
if (((_local1._y > bs._y) || (_local1._parent.ballHeight > (bs._y / 1.5))) && (_local1._y > 65)) {
_local1.yAcc = _local1.yAcc - ((_local1.yAcc + scaleCalc) / 10);
_local1.gotoAndStop("runBack");
} else if (_local1._y < 120) {
_local1.yAcc = _local1.yAcc - ((_local1.yAcc - scaleCalc) / 10);
_local1.gotoAndStop("runFront");
} else {
_local1.yAcc = _local1.yAcc - ((_local1.yAcc - 0) / 5);
if ((_local1._currentframe < 4) && (Math.abs(_local1.xAcc) < 0.1)) {
_local1.gotoAndStop("stand");
}
}
if ((_local1._y > (bs._y - (_local1._yscale / 8))) && (_local1._y < (bs._y + (_local1._yscale / 8)))) {
if ((_local1._x > (bs._x - (_local1._yscale / 4))) && (_local1._x < (bs._x + (_local1._yscale / 4)))) {
if ((_local1._parent.ballHeight < ((bs._y / 1.5) - 20)) && (Math.ran(3, 0) == 1)) {
if (!bs.bounceNum) {
_global.playFX("bigCheer");
_local1._parent.caughtBall();
_local1.gotoAndStop("catch");
_local1._parent.playVoice("catch");
_local1._parent.ball._visible = false;
_local1._parent.ballShadow._visible = false;
} else if (bs.bounceNum > 0) {
_local1._parent.fieldBall(bs._x, bs._y);
_local1.gotoAndStop("field");
_local1._parent.ball._visible = false;
_local1._parent.ballShadow._visible = false;
}
}
}
}
} else if (_local1._parent.actionStyle == 1) {
_local1.yAcc = _local1.yAcc - ((_local1.yAcc - 0) / 5);
_local1.xAcc = _local1.xAcc - ((_local1.xAcc - 0) / 5);
if (_local1._currentframe < 4) {
_local1.gotoAndStop("stand");
}
} else if (!_local1.chosenField) {
if (_local1._x > _local1.xTarg) {
_local1.xAcc = _local1.xAcc - ((_local1.xAcc + (scaleCalc * 3)) / 10);
} else if (_local1._x < _local1.xTarg) {
_local1.xAcc = _local1.xAcc - ((_local1.xAcc - (scaleCalc * 3)) / 10);
}
if (_local1._y > (_local1.yTarg + 2)) {
_local1.yAcc = _local1.yAcc - ((_local1.yAcc + scaleCalc) / 10);
_local1.gotoAndStop("runBack");
} else if (_local1._y < (_local1.yTarg - 2)) {
_local1.yAcc = _local1.yAcc - ((_local1.yAcc - scaleCalc) / 10);
_local1.gotoAndStop("runFront");
} else {
_local1.yAcc = _local1.yAcc - ((_local1.yAcc - 0) / 5);
if ((_local1._currentframe < 4) && (Math.abs(_local1.xAcc) < 0.1)) {
_local1.gotoAndStop("stand");
}
}
}
_local1._y = _local1._y + _local1.yAcc;
_local1._x = _local1._x + _local1.xAcc;
};
};
Bat.prototype.contextIn = function (n) {
var _local2 = this;
var _local1 = _local2.contextInfo;
var inc = 0;
_local1.gotoAndStop(n);
_local1.onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x - ((_local1._x - 10) / 5);
if ((++inc) > 50) {
if ((n != "caught") && (n != "bowled")) {
_local1._parent.contextOut();
}
}
};
};
Bat.prototype.contextOut = function () {
var _local1 = this;
var _local2 = _local1.contextInfo;
_local2.onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x - ((_local1._x + 250) / 5);
if (_local1._x < -245) {
_local1._parent.nextBowl();
delete _local1.onEnterFrame;
}
};
};
Bat.prototype.bowlerInfoIn = function () {
var _local1 = this;
var _local2 = _local1.bowlerInfo;
_local2.nameText.text = _local1.curBowler.bName;
_local2.infoText.text = _global.aInfo[_local1.curBatsman.num][_local1.curBowler.num - 1];
var inc = 0;
_local2.onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x - ((_local1._x - 330) / 5);
if ((++inc) > 50) {
_local1._parent.bowlerInfoOut();
}
};
};
Bat.prototype.bowlerInfoOut = function () {
var _local1 = this;
var _local2 = _local1.bowlerInfo;
_local2.onMouseDown = function () {
};
_local2.onEnterFrame = function () {
var _local1 = this;
_local1._x = _local1._x - ((_local1._x - 560) / 5);
if (_local1._x > 550) {
_local1._parent.nextBowl();
delete _local1.onEnterFrame;
}
};
};
Bat.prototype.handlePrep = function () {
var _local1 = this;
var p = _local1.player;
var pcp = p.body.top.chestPivot;
var rs = p.rightShoulder;
var ls = p.leftShoulder;
var ra = p.rightArm;
var la = p.leftArm;
var rg = p.rightGlove;
var lg = p.leftGlove;
var b = p.bat;
var xm = _lev._xmouse;
var ym = _lev._ymouse;
var xPrev = xm;
var yPrev = ym;
var mTan;
var rHyp;
var maxRad = 80;
var bDepth = 50;
var bDepthInc = 0;
var bDepthLimiter = true;
var swingState = 0;
var moveTrigger = true;
var yLast = 0;
var i = 0;
p.onEnterFrame = function () {
var _local1 = this;
if (!swingState) {
b.prevRot = (b._rotation = b._rotation - ((b._rotation + ((xm - 275) / 3)) / 3));
b.tempRot = -(xm - 275);
if (_local1._parent.mouseTrigger) {
swingState = 1;
}
} else {
switch (swingState) {
case 1 :
b._rotation = b.prevRot - (b.tempRot + (xm - 275));
bDepth = bDepth - ((bDepth - 10) / 10);
b.gotoAndStop(Math.round(bDepth));
bDepthInc = 0;
if (!_local1._parent.mouseTrigger) {
_local1._parent.player.body.bottom.gotoAndPlay("step");
swingState = 2;
bDepth = 51;
bDepthInc = 15;
}
break;
case 2 :
b._rotation = b.prevRot - ((b.tempRot + (xm - 275)) / 3);
if (bDepth < 50) {
bDepth = bDepth + ((bDepthInc = bDepthInc + 4));
} else {
swingState = 3;
}
break;
case 3 :
b._rotation = (b._rotation + ((xm - 275) / 3)) / 3;
if (bDepthInc > 0) {
bDepth = bDepth + ((bDepthInc = bDepthInc - 1.5));
} else {
swingState = 4;
}
break;
case 4 :
b._rotation = b._rotation - ((b._rotation + ((xm - 275) / 3)) / 3);
if (bDepth > 50.4) {
bDepth = bDepth - ((bDepth - 50) / 2);
} else {
swingState = 0;
}
}
b.gotoAndStop(Math.round(bDepth));
}
xPrev = xm;
yPrev = ym;
xm = _lev._xmouse;
ym = (_lev._ymouse / 2) + 175;
rmAngle = Math.atan2(ym - rs._y, xm - rs._x) / RADIAN;
lmAngle = Math.atan2(ym - ls._y, xm - ls._x) / RADIAN;
bAngle = Math.atan2(ym - rg._y, xm - rg._x) / RADIAN;
rg.xPos = ((xm - rs._x) / 2) + rs._x;
rg.yPos = ((ym - rs._y) / 2) + rs._y;
lg.xPos = ((xm - ls._x) / 2) + ls._x;
lg.yPos = ((ym - ls._y) / 2) + ls._y;
rHyp = Math.sqrt(((rs._x - rg.xPos) * (rs._x - rg.xPos)) + ((rs._y - rg.yPos) * (rs._y - rg.yPos)));
lHyp = Math.sqrt(((ls._x - lg.xPos) * (ls._x - lg.xPos)) + ((ls._y - lg.yPos) * (ls._y - lg.yPos)));
curHyp = Math.max(rHyp, lHyp);
if (curHyp < maxRad) {
rs._rotation = rmAngle + (Math.atan2(maxRad - rHyp, rHyp) / RADIAN);
ra._rotation = rmAngle - (Math.atan2(maxRad - rHyp, rHyp) / RADIAN);
rg._xscale = (rs._xscale = (((100 / maxRad) * rHyp) / 2) + 50);
ra._xscale = (((100 / maxRad) * rHyp) / 2) + 50;
ls._rotation = lmAngle - (Math.atan2(maxRad - lHyp, lHyp) / RADIAN);
la._rotation = lmAngle + (Math.atan2(maxRad - lHyp, lHyp) / RADIAN);
ls._xscale = (((100 / maxRad) * lHyp) / 2) + 50;
lg._xscale = (la._xscale = (((100 / maxRad) * lHyp) / 2) + 50);
} else {
rs._rotation = rmAngle;
ra._rotation = rmAngle;
ls._rotation = lmAngle;
la._rotation = lmAngle;
}
pcp._xscale = Math.min(Math.max(-50, -((xm - _local1._parent.bx) + 50)), 50);
rs.x = (rs.y = 0);
pcp.right.localToGlobal(rs);
rs._x = rs.x;
rs._y = rs.y;
ls.x = (ls.y = 0);
pcp.left.localToGlobal(ls);
ls._x = ls.x;
ls._y = ls.y;
ra.x = (ra.y = 0);
rs.pivot.localToGlobal(ra);
ra._x = ra.x;
ra._y = ra.y;
la.x = (la.y = 0);
ls.pivot.localToGlobal(la);
la._x = la.x;
la._y = la.y;
rg.x = (rg.y = 0);
ra.pivot.localToGlobal(rg);
rg._x = rg.x;
rg._y = rg.y;
rg._rotation = (((xm - 200) / -3) + (ym / 2)) - 65;
lg.x = (lg.y = 0);
la.pivot.localToGlobal(lg);
lg._x = lg.x;
lg._y = lg.y;
lg._rotation = (((xm - 200) / -3) + (ym / 2)) - 65;
if (Key.isDown(38)) {
p.body.top._rotation = p.body.top._rotation - ((p.body.top._rotation - 5) / 10);
p.body.top.head._rotation = p.body.top.head._rotation - ((p.body.top.head._rotation - 40) / 10);
} else if (Key.isDown(40)) {
p.body.top._rotation = p.body.top._rotation - ((p.body.top._rotation - 65) / 10);
p.body.top.head._rotation = p.body.top.head._rotation - ((p.body.top.head._rotation + 20) / 10);
} else {
p.body.top._rotation = p.body.top._rotation - ((p.body.top._rotation - 35) / 10);
p.body.top.head._rotation = p.body.top.head._rotation - (p.body.top.head._rotation / 10);
}
if (Key.isDown(37) && (p.body._x > 100)) {
if (!moveTrigger) {
p.body.bottom.gotoAndPlay("walkLeft");
moveTrigger = true;
}
p.body._x = p.body._x - 2;
} else if (Key.isDown(39) && (p.body._x < 450)) {
if (!moveTrigger) {
p.body.bottom.gotoAndPlay("walkRight");
moveTrigger = true;
}
p.body._x = p.body._x + 2;
} else if (moveTrigger) {
p.body.bottom.gotoAndStop("stand");
moveTrigger = false;
}
b.x = (b.y = 0);
rg.pivot.localToGlobal(b);
b._x = b.x;
b._y = b.y;
_local1._parent.xSwing = xPrev - xm;
_local1._parent.ySwing = yPrev - ym;
if (_local1._parent.ySwing < yLast) {
_local1._parent.ySwing = yLast--;
} else {
yLast = _local1._parent.ySwing;
}
};
};
Bat.prototype.bowlerPrep = function () {
var _local1 = this;
var _local2 = _global;
var b = _local1.attachMovie("ball", "ball", 140);
var s = _local1.attachMovie("ballShadow", "ballShadow", 30);
_local1.bowlerReset();
var i = 0;
var j = 0;
var lim;
var totPower;
var cf;
var blockDamp;
var xSTot;
var ySTot;
var boundaryBounce = false;
var xS = 0;
var yS = 0;
s.onEnterFrame = function () {
var _local1 = this;
var _local2 = _global;
_local1._parent.ballHeight = _local1._y - _local1.ball._y;
if (_local1._parent.bowl) {
_local1.speed = _local1.speed + _local1.inc;
_local1._y = _local1._y + _local1.speed;
_local1._x = _local1._x + (_local1.xThrow + _local1.spinAllow);
_local1._yscale = (_local1._xscale = (b._yscale = (b._xscale = _local1._y / 35)));
b._x = _local1._x;
b._y = b._y + ((b.speed = b.speed + (_local1.inc * 2)));
if (_local1.ball._y > _local1._y) {
_local1._parent.player.body.top.head.play();
_local2.playFX("bounce");
_local1.spinAllow = _local1.spin;
b.speed = b.speed * (-((Math.random() * 0.2) + 0.05));
b._y = _local1._y;
var bs = _local1._parent.attachMovie("bounceSpot", "bounceSpot", 46);
bs._xscale = (bs._yscale = b._xscale);
bs._x = b._x;
bs._y = b._y;
}
if ((_local1._y > 300) && (_local1._y < 420)) {
if (_local1._parent.player.bat.hitTest(_local1.ball._x, _local1.ball._y, true)) {
_local1._parent.actionStyle = 0;
cf = _local1._parent.player.bat._currentFrame;
if (cf == 50) {
blockDamp = 0.7;
} else {
blockDamp = 1;
}
_local1.bounceNum = 0;
_local1.yHit = _local1._y;
_local1.speed = _local1.speed * -1;
_local1.xHitAngle = (-(_local1._parent.xSwing / 4)) * blockDamp;
_local1.yHitAngle = (-(_local1._parent.ySwing / 4.5)) * blockDamp;
totPower = Math.min(Math.sqrt((_local1.xHitAngle * _local1.xHitAngle) + (_local1.yHitAngle * _local1.yHitAngle)), 30);
if (totPower < 10) {
_local2.playFX("weakHit");
} else if (totPower < 20) {
_local2.playFX("medHit");
_local1._parent.playVoice("good");
} else {
_local2.playFX("bigHit");
_local1._parent.playVoice("good");
}
_local1.loft = ((cf - 45) + totPower) / -5.5;
_local1.maxLoft = _local1.loft;
catchRandom = 0;
if (totPower >= 30) {
catchRandom = catchRandom + 0.6;
} else if (totPower >= 25) {
catchRandom = catchRandom + 0.3;
} else if (totPower >= 20) {
catchRandom = catchRandom + 0.25;
} else if (totPower >= 10) {
catchRandom = catchRandom + 0.2;
} else {
catchRandom = catchRandom + 0.1;
}
if (_local1.loft >= -2) {
catchRandom = catchRandom + 0.6;
} else if (_local1.loft >= -4) {
catchRandom = catchRandom + 0.3;
} else if (_local1.loft >= -6) {
catchRandom = catchRandom + 0.25;
} else if (_local1.loft >= -8) {
catchRandom = catchRandom + 0.2;
} else {
catchRandom = catchRandom + 0.1;
}
trace((((("totPower:" + totPower) + ", this.maxLoft:") + _local1.maxLoft) + ", catchRandom:") + catchRandom);
_local1._parent.bowl = false;
}
}
} else {
var lim = (((1 / _local1.yHit) * (_local1.yHit - ((_local1.yHit - _local1._y) + 35))) * _local1.friction);
_local1._y = _local1._y + (_local1.yHitAngle * lim);
_local1._x = _local1._x + (_local1.xHitAngle * lim);
_local1._yscale = (_local1._xscale = (b._yscale = (b._xscale = _local1._y / 30)));
b._x = _local1._x;
b._y = b._y + (((_local1.loft = _local1.loft + 0.4)) + ((_local1.yHitAngle * lim) / 2));
_local1.ball.ballBit._rotation = _local1.ball.ballBit._rotation + _local1.loft;
if (b._y > _local1._y) {
if ((_local1._x < -40) || ((_local1._x > 590) && (_local1.bounceNum == 0))) {
_local1.bounceNum++;
var ran = Math.random();
trace("ran" + ran);
if (ran > catchRandom) {
_local2.playFX("bigCheer");
_local1._parent.caughtBall();
_local1.gotoAndStop("catch");
_local1._parent.playVoice("catch");
trace("hitOut");
}
} else {
if ((_local1.loft > 0.3) || (_local1.loft < -0.3)) {
_local2.playFX("bounce");
}
_local1.bounceNum++;
if (_local1._y < 41) {
_local1.ball._visible = false;
_local1._visible = false;
if (_local1.bounceNum == 1) {
boundaryBounce = true;
_local2.playFX("bigCheer");
}
}
_local1.loft = _local1.loft * -0.4;
b._y = _local1._y;
_local1.friction = _local1.friction * ((_local1.frictionInc = _local1.frictionInc - 0.007));
if (_local1.friction < 0.01) {
_local1.ball.ballBit.stop();
_local1._parent.actionStyle = 1;
if (_local1.friction < 0.001) {
delete _local1.onEnterFrame;
if (!boundaryBounce) {
var runs = _local1._parent.calcRuns(_local1._x, _local1._y);
} else {
runs = 6;
_local1._parent.updateScore(6);
_local1._parent.umpire.gotoAndPlay("six");
_local1._parent.playVoice("six");
}
_local1._parent.contextIn("run" + runs);
}
}
if (_local1._y < 150) {
if ((++j) % 2) {
_local1.ball.swapDepths(Math.min(Math.max(Math.round(_local1._y), 60), 120));
_local1.swapDepths(Math.min(Math.max(Math.round(_local1._y - 1), 60), 120));
}
}
var bs = _local1._parent.attachMovie("bounceSpot", "bounceSpot", 46);
bs._xscale = (bs._yscale = b._xscale);
bs._x = _local1.ball._x;
bs._y = _local1.ball._y;
}
}
}
if ((++i) > 10) {
i = 0;
}
if (_local1.ball._visible) {
var bd = _local1._parent.attachMovie("ballDot", "ballDot" + i, 35 + i);
bd._xscale = (bd._yscale = 2);
bd._x = _local1.ball._x;
bd._y = _local1.ball._y;
}
if (_local1.ball._y > 500) {
delete _local1.onEnterFrame;
_local1._parent.contextIn("run0");
}
if (_local1._y > 450) {
if (_local1._parent.redCross == undefined) {
var _local3 = _local1._parent.attachMovie("redCross", "redCross", 155);
_local3._x = _local1.ball._x;
_local3._y = _local1.ball._y;
if (_local1._parent.stumps.hitTest(_local3._x, _local3._y, false)) {
_local2.playFX("wicket");
_local2.playFX("bigCheer");
_local1._parent.playVoice("bowled");
_local1._visible = (_local1.ball._visible = false);
delete _local1.onEnterFrame;
_local1._parent.contextIn("bowled");
_local1._parent.umpire.gotoAndPlay("out");
if (_local3._x < 270) {
_local1._parent.stumps.gotoAndPlay("left");
} else if (_local3._x > 280) {
_local1._parent.stumps.gotoAndPlay("right");
} else {
_local1._parent.stumps.gotoAndPlay("centre");
}
} else {
_local1._parent.playVoice("bad");
}
}
}
};
};
Bat.prototype.caughtBall = function () {
delete this.ballShadow.onEnterFrame;
var _local1 = {};
var _local2 = function (timerHolder, objSource) {
clearInterval(timerHolder.timerInt);
objSource.contextIn("caught");
objSource.umpire.gotoAndPlay("out");
};
var _local3 = setInterval(_local2, 1000, _local1, this);
_local1.timerInt = _local3;
this.actionStyle = 1;
};
Bat.prototype.fieldBall = function (xDist, yDist) {
var _local2 = this;
runs = _local2.calcRuns(xDist, yDist);
delete _local2.ballShadow.onEnterFrame;
var _local1 = {};
var _local3 = function (timerHolder, objSource) {
clearInterval(timerHolder.timerInt);
objSource.contextIn("run" + runs);
};
var timerInt = setInterval(_local3, 1000, _local1, _local2);
_local1.timerInt = timerInt;
_local2.actionStyle = 1;
};
Bat.prototype.calcRuns = function (xDist, yDist) {
var _local2 = yDist;
var _local3 = xDist;
var _local1;
if (((_local2 < 41) || (_local3 > 2000)) || (_local3 < -1800)) {
_local1 = 4;
this.umpire.gotoAndPlay("four");
_global.playFX("smallCheer");
this.playVoice("four");
} else if ((((_local2 > 40) && (_local2 < 62)) || (_local3 > 1200)) || (_local3 < -1000)) {
_local1 = 3;
} else if ((((_local2 > 61) && (_local2 < 90)) || (_local3 > 900)) || (_local3 < -700)) {
_local1 = 2;
} else if ((((_local2 > 89) && (_local2 < 126)) || (_local3 > 600)) || (_local3 < -400)) {
_local1 = 1;
} else if (_local2 > 126) {
_local1 = 0;
} else {
_local1 = 1;
trace("run anomaly");
}
this.updateScore(_local1);
return(_local1);
};
Bat.prototype.bowlerReset = function () {
var _local1 = this;
_local1.stumps.gotoAndStop(1);
var _local3 = 0;
while (_local3 < 4) {
_local1.prepFielder(_local1["fielder" + _local3]);
}
var b = _local1.attachMovie("ball", "ball", 140);
b._xscale = (b._yscale = 5);
b._x = 275;
b._y = 75;
b.speed = -2;
var _local2 = _local1.ballShadow;
_local2._xscale = (_local2._yscale = 5);
_local2._y = 150;
_local2.ball = b;
if (_local1.curBowler.arm == "right") {
var angler = -0.5;
_local2._x = 300;
_local2.ball._x = 300;
} else {
var angler = 0.6;
_local2._x = 245;
_local2.ball._x = 245;
}
_local2.speed = 0;
_local2.bounceNum = -1;
_local2.inc = 0.1 + (_local1.curBowler.speed / 10);
var bs = (5.5 - _local1.curBowler.skill);
_local2.xThrow = (((Math.random() * bs) - (bs / 2)) + angler) * 0.8;
_local2.spinAllow = 0;
_local2.spin = (Math.random() * _local1.curBowler.spin) - (_local1.curBowler.spin / 2);
_local1.bowl = true;
_local1.actionStyle = 1;
_local2.friction = 1;
_local2.frictionInc = 0.99;
_local3 = _local3++;
};
Bat.prototype.nextBowl = function () {
var _local1 = this;
_local1.ball.removeMovieClip();
_local1.ballShadow.removeMovieClip();
_local1.redCross.removeMovieClip();
if ((++_local1.bowlNum) > 6) {
_local1.switchPlayers();
_local1.nextBowler();
_local1.overNum++;
_local1.bowlNum = 0;
} else {
var _local2 = _local1.attachMovie("bowler", "bowler", 135);
_global.playFX("runUp");
if (_local1.curBowler.arm == "right") {
_local2._x = 300;
_local2._y = 100;
_local2._xscale = (_local2._yscale = 80);
} else {
_local2._x = 232;
_local2._y = 100;
_local2._xscale = -80;
_local2._yscale = 80;
}
}
_local1.onScreenInfo.bowler.text = _local1.curBowler.bName;
_local1.onScreenInfo.bowls.text = (_local1.bowlNum + ".") + _local1.overNum;
};
Bat.prototype.nextBowler = function () {
var _local2 = this;
var _local1 = _local2.curBowler.num + 1;
if (_local1 > 4) {
_local1 = 1;
}
_local2.curBowler = _global.bowlerLib["bowler" + _local1];
_local2.bowlerInfoIn();
};
Bat.prototype.updateScore = function (r) {
var _local1 = this;
var _local2 = _global;
var _local3 = r;
_local1.score = _local1.score + _local3;
_local1.curBatsman.runs = _local1.curBatsman.runs + _local3;
if (_local1.curBatsman.runs >= _local1.curBatsman.nextTarg) {
if (_local1.curBatsman.nextTarg == 50) {
_local2.playFX("fifty");
_local1.curBatsman.nextTarg = 100;
} else if (_local1.curBatsman.nextTarg == 100) {
_local2.playFX("century");
_local2.playFX("bigCheer");
_local1.curBatsman.nextTarg = 1000;
}
}
_local1.onScreenInfo.score.text = _local1.score + "/9";
_local1.onScreenInfo.runs.text = _local1.curBatsman.runs;
if (_local3 % 2) {
_local1.switchPlayers();
}
};
Bat.prototype.switchPlayers = function () {
var _local1 = this;
_local1.onScreenInfo.partnerBatsman.text = _local1.curBatsman.pName;
_local1.onScreenInfo.partnerRuns.text = _local1.curBatsman.runs;
if (_local1.curBatsman == _local1.aPlayers[0]) {
_local1.curBatsman = _local1.aPlayers[1];
} else {
_local1.curBatsman = _local1.aPlayers[0];
}
_local1.onScreenInfo.batsman.text = _local1.curBatsman.pName;
_local1.onScreenInfo.runs.text = _local1.curBatsman.runs;
};
Bat.prototype.playVoice = function (state) {
var _local1 = _global;
switch (state) {
case "good" :
var _local2 = Math.ran(20, 0);
_local1.playFX("goodShot" + _local2);
return;
case "bad" :
_local2 = Math.ran(8, 0);
_local1.playFX("badShot" + _local2);
return;
case "six" :
_local2 = Math.ran(3, 0);
_local1.playFX("six" + _local2);
return;
case "four" :
_local2 = Math.ran(3, 0);
_local1.playFX("four" + _local2);
return;
case "catch" :
_root.curSound.stop();
_local2 = Math.ran(2, 0);
_local1.playFX("catch" + _local2);
return;
case "bowled" :
_local2 = Math.ran(2, 0);
_local1.playFX("out" + _local2);
return;
case "start" :
_local2 = Math.ran(2, 0);
_local1.playFX("start" + _local2);
}
};
Frame 2
pd = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
Frame 3
if (pd < 100) {
gotoAndPlay ("load");
} else {
gotoAndPlay ("draw");
}
Frame 5
stop();
Symbol 6 MovieClip Frame 1
stop();
Symbol 18 MovieClip [loader] Frame 1
stop();
this.onEnterFrame = function () {
var _local1 = _parent;
var _local2 = this;
if (_local1.pd < 100) {
_local2.loadingbat.gotoAndStop(int(_local1.pd));
}
loaderText.text = int(_local1.pd) + "%";
if (_local1.pd == 100) {
delete _local2.onEnterFrame;
_local2.play();
}
};
Symbol 18 MovieClip [loader] Frame 16
_parent.soundPrep();
_parent.sectionStart("init");
this.removeMovieClip();
Symbol 35 MovieClip [umpire] Frame 1
stop();
Symbol 35 MovieClip [umpire] Frame 65
gotoAndStop (1);
Symbol 35 MovieClip [umpire] Frame 126
gotoAndStop (1);
Symbol 35 MovieClip [umpire] Frame 222
_root.sectionStart("endGame");
gotoAndStop (1);
Symbol 78 MovieClip Frame 15
gotoAndPlay ("walkLeft");
Symbol 78 MovieClip Frame 30
gotoAndPlay ("walkRight");
Symbol 78 MovieClip Frame 94
gotoAndStop ("stand");
Symbol 89 MovieClip Frame 1
stop();
Symbol 111 MovieClip [stumps] Frame 1
stop();
Symbol 111 MovieClip [stumps] Frame 23
stop();
Symbol 111 MovieClip [stumps] Frame 41
stop();
Symbol 111 MovieClip [stumps] Frame 60
stop();
Symbol 123 MovieClip [ballDot] Frame 10
this.removeMovieClip();
Symbol 126 MovieClip [bounceSpot] Frame 65
this.removeMovieClip();
Symbol 136 MovieClip [redCross] Frame 15
stop();
Symbol 181 MovieClip Frame 75
stop();
Symbol 236 MovieClip [bowler] Frame 31
this._parent.bowlerPrep();
Symbol 236 MovieClip [bowler] Frame 58
stop();
Symbol 253 Button
on (release) {
this.gotoAndStop(2);
this._parent.gotoAndStop("selectplayers");
_global.playFX("click");
}
Symbol 258 Button
on (release) {
this.gotoAndStop(3);
this._parent.gotoAndStop("lessons");
_global.playFX("click");
}
Symbol 263 Button
on (release) {
this.gotoAndStop(4);
this._parent.gotoAndStop("highscores");
_global.playFX("click");
}
Symbol 268 Button
on (release) {
this.gotoAndStop(5);
this._parent.gotoAndStop("sendtofriend");
_global.playFX("click");
}
Symbol 271 Button
on (release) {
this.gotoAndStop(1);
this._parent.gotoAndStop("start");
_global.playFX("click");
}
Symbol 275 MovieClip Frame 1
stop();
Symbol 285 MovieClip Frame 67
_parent.gotoAndStop("start");
Symbol 294 Button
on (release) {
if (_root.aff_id == 1) {
getURL ("http://www.totesport.com/?AID=492&SID=0", "_blank");
}
if (_root.aff_id == 2) {
getURL ("http://www.totesport.com/?AID=493&SID=0", "_blank");
}
if (_root.aff_id == 3) {
getURL ("http://www.totesport.com/?AID=494&SID=0", "_blank");
}
if (_root.aff_id == 4) {
getURL ("http://www.totesport.com/?AID=495&SID=0", "_blank");
}
if (_root.aff_id == 5) {
getURL ("http://www.totesport.com/?AID=496&SID=0", "_blank");
}
if (_root.aff_id == 6) {
getURL ("http://www.totesport.com/?AID=497&SID=0", "_blank");
}
if (_root.aff_id == 7) {
getURL ("http://www.totesport.com/?AID=498&SID=0", "_blank");
}
if (_root.aff_id == 8) {
getURL ("http://www.totesport.com/?AID=499&SID=0", "_blank");
}
if (_root.aff_id == 9) {
getURL ("http://www.totesport.com/?AID=500&SID=0", "_blank");
}
if (_root.aff_id == 10) {
getURL ("http://www.totesport.com/?AID=503&SID=0", "_blank");
}
}
Symbol 319 MovieClip Frame 1
stop();
Symbol 319 MovieClip Frame 2
stop();
Symbol 328 MovieClip Frame 1
stop();
Symbol 328 MovieClip Frame 2
stop();
Symbol 337 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 2
stop();
Symbol 341 Button
on (rollOver) {
this._parent.howtobat.step1.gotoAndStop("on");
}
on (rollOut) {
this._parent.howtobat.step1.gotoAndStop("off");
}
Symbol 342 Button
on (rollOver) {
this._parent.howtobat.step2.gotoAndStop("on");
}
on (rollOut) {
this._parent.howtobat.step2.gotoAndStop("off");
}
Symbol 343 Button
on (rollOver) {
this._parent.howtobat.step3.gotoAndStop("on");
}
on (rollOut) {
this._parent.howtobat.step3.gotoAndStop("off");
}
Symbol 355 Button
on (release) {
this.gotoAndStop("intro");
}
Symbol 362 Button
on (release) {
if (_root.aff_id == 1) {
getURL ("http://www.totesport.com/?AID=492&SID=0", "_blank");
}
if (_root.aff_id == 2) {
getURL ("http://www.totesport.com/?AID=493&SID=0", "_blank");
}
if (_root.aff_id == 3) {
getURL ("http://www.totesport.com/?AID=494&SID=0", "_blank");
}
if (_root.aff_id == 4) {
getURL ("http://www.totesport.com/?AID=495&SID=0", "_blank");
}
if (_root.aff_id == 5) {
getURL ("http://www.totesport.com/?AID=496&SID=0", "_blank");
}
if (_root.aff_id == 6) {
getURL ("http://www.totesport.com/?AID=497&SID=0", "_blank");
}
if (_root.aff_id == 7) {
getURL ("http://www.totesport.com/?AID=498&SID=0", "_blank");
}
if (_root.aff_id == 8) {
getURL ("http://www.totesport.com/?AID=499&SID=0", "_blank");
}
if (_root.aff_id == 9) {
getURL ("http://www.totesport.com/?AID=500&SID=0", "_blank");
}
if (_root.aff_id == 10) {
getURL ("http://www.totesport.com/?AID=503&SID=0", "_blank");
}
}
Symbol 366 Button
on (press) {
startDrag (this, true, this._parent.scrollbar._x, top, this._parent.scrollbar._x, bottom);
}
on (release) {
stopDrag();
}
Symbol 367 MovieClip Frame 1
this.onMouseUp = function () {
stopDrag();
};
Symbol 371 Button
on (press, keyPress "<Up>") {
slider._y = slider._y - 20;
if (slider._y < -10) {
slider._y = -10;
}
}
Symbol 372 Button
on (press, keyPress "<Down>") {
slider._y = slider._y + 20;
if (slider._y > 165) {
slider._y = 165;
}
}
Symbol 480 MovieClip Frame 1
loadVariables ("http://www.totesportgame.com/gethiscore.php?" add randNum, this, "POST");
Symbol 480 MovieClip Frame 2
this.score = "hello";
if (this.score != undefined) {
gotoAndStop (4);
}
Symbol 480 MovieClip Frame 3
gotoAndPlay (1);
Symbol 480 MovieClip Frame 4
stop();
Symbol 497 MovieClip Frame 1
stop();
Symbol 497 MovieClip Frame 2
stop();
Symbol 509 MovieClip Frame 1
stop();
Symbol 509 MovieClip Frame 2
stop();
Symbol 512 MovieClip Frame 1
stop();
Symbol 512 MovieClip Frame 2
stop();
Symbol 522 Button
on (release) {
gotoAndStop ("selected");
_root.playerSelect(this);
_global.playFX("click");
}
Symbol 524 Button
on (release) {
gotoAndStop ("notSelected");
_root.playerDeselect(this);
}
Symbol 525 MovieClip Frame 1
stop();
Symbol 525 MovieClip Frame 2
stop();
Symbol 532 MovieClip Frame 1
stop();
Symbol 532 MovieClip Frame 2
stop();
stepOutBT.onRelease = function () {
_parent.mySound.stop();
_global.playFX("click");
_root.sectionStart("startGame");
};
Symbol 574 Button
on (release) {
this.nav2.gotoAndStop(2);
this.gotoAndStop("selectplayers");
_global.playFX("click");
}
Symbol 575 MovieClip [openingScreens] Frame 1
stop();
Symbol 575 MovieClip [openingScreens] Frame 2
mySound = new Sound();
mySound.attachSound("musicloop");
mySound.start("musicloop", 99);
Symbol 575 MovieClip [openingScreens] Frame 4
stop();
Instance of Symbol 367 MovieClip "slider" in Symbol 575 MovieClip [openingScreens] Frame 4
onClipEvent (load) {
setProperty(this, _y , this._parent.scrollbar._y - (this._parent.scrollbar._height * 0.5));
magnification = (this._parent.object._height - this._parent.scrollbar._height) / this._parent.scrollbar._height;
objectstart = this._parent.object._y;
sliderstart = this._parent.slider._y;
top = this._parent.scrollbar._y - (this._parent.scrollbar._height * 0.5);
bottom = this._parent.scrollbar._y + (this._parent.scrollbar._height * 0.5);
}
onClipEvent (enterFrame) {
setProperty(this._parent.object, _y , ((this._parent.slider._y - sliderstart) * (-magnification)) + objectstart);
}
Symbol 575 MovieClip [openingScreens] Frame 5
function validate(address) {
var _local1 = address;
if (_local1.length >= 7) {
if (_local1.indexOf("@") > 0) {
if ((_local1.indexOf("@") + 2) < _local1.lastIndexOf(".")) {
if (_local1.lastIndexOf(".") < (_local1.length - 2)) {
return(true);
}
}
}
}
return(false);
}
function formCheck() {
var _local1 = this;
loadVariables ("http://www.totesportgame.com/mailamate.php", _local1, "GET");
trace(_local1);
gotoAndStop (1);
}
stop();
fUserame.tabIndex = 1;
fEmail.tabIndex = 2;
fNamea.tabIndex = 3;
fToa.tabIndex = 4;
emailtype = "html";
optin = false;
optinBT.gotoAndStop(1);
Selection.setFocus("fname");
txtEmail.onPress = (htmlEmail.onPress = function () {
if (emailtype == "html") {
txtEmail.gotoAndStop(2);
htmlEmail.gotoAndStop(2);
emailtype = "text";
} else {
txtEmail.gotoAndStop(1);
htmlEmail.gotoAndStop(1);
emailtype = "html";
}
});
stop();
backBT.onRelease = function () {
_global.playFX("click");
gotoAndStop (1);
};
okBT.onRelease = function () {
errorMessage = "";
formCheck();
};
privacyBT.onRelease = function () {
_global.playFX("click");
_parent.privacyLink();
};
optinBT.onRelease = function () {
if (!optin) {
optin = true;
this.gotoAndStop(2);
} else {
optin = false;
this.gotoAndStop(1);
}
};
Symbol 575 MovieClip [openingScreens] Frame 6
_root.playerReset();
var i = 0;
while ((++i) < 12) {
this["batsman" + i].num = i;
this["pName" + i].text = _global.aPlayers[i - 1].pName;
}
Symbol 575 MovieClip [openingScreens] Frame 7
function validate(address) {
var _local1 = address;
if (_local1.length >= 7) {
if (_local1.indexOf("@") > 0) {
if ((_local1.indexOf("@") + 2) < _local1.lastIndexOf(".")) {
if (_local1.lastIndexOf(".") < (_local1.length - 2)) {
return(true);
}
}
}
}
return(false);
}
function formcheck() {
loadVariablesNum ("http://www.totesportgame.com/submitscore.php", 0, "POST");
gotoAndStop (5);
}
stop();
optin = false;
optinBT.gotoAndStop(1);
eUsername.tabIndex = 1;
eAgency.tabIndex = 2;
eEmail.tabIndex = 3;
Selection.setFocus("eUsername");
stop();
privacyBT.onRelease = function () {
_parent.privacyLink();
};
backBT.onRelease = function () {
_root.sectionStart("removeArchitecture");
gotoAndStop (1);
};
okBT.onRelease = function () {
errorMessage = "";
formcheck();
};
optinBT.onRelease = function () {
if (!optin) {
optin = true;
this.gotoAndStop(2);
} else {
optin = false;
this.gotoAndStop(1);
}
};
Symbol 624 MovieClip [soundButton] Frame 1
soundIcon.gotoAndStop(1);
sndFlip = 0;
soundBT.onRelease = function () {
sndFlip = ((sndFlip == 0) ? 1 : 0);
_root.soundState(sndFlip);
soundIcon.gotoAndStop(sndFlip + 1);
};