Frame 2
_quality = "best";
if (_framesloaded == _totalframes) {
gotoAndPlay ("start");
} else {
play();
}
Instance of Symbol 11 MovieClip "loader_mc" in Frame 11
onClipEvent (load) {
function startLoading() {
this.percentage = 0;
this.onEnterFrame = this.runLoading;
}
function finishedLoading() {
this.percentage = 100;
this.stopLoading();
_parent.gotoAndPlay("main");
}
function stopLoading() {
this.onEnterFrame = null;
}
function runLoading() {
var bytes_loaded = 0;
var bytes_total = 0;
var i = 0;
while (i < this.load_levels.length) {
if (eval (this.load_levels[i]).getBytesTotal() == -1) {
bytes_loaded = bytes_loaded + 0;
bytes_total = bytes_total + 10000000;
} else {
bytes_loaded = bytes_loaded + eval (this.load_levels[i]).getBytesLoaded();
bytes_total = bytes_total + eval (this.load_levels[i]).getBytesTotal();
}
i++;
}
var temp_perc = Math.round((bytes_loaded / bytes_total) * 100);
if (temp_perc > this.percentage) {
this.percentage = Math.round((bytes_loaded / bytes_total) * 100);
}
this.loadingbar_mc.gotoAndStop(this.percentage + 1);
if (this.percentage >= 100) {
this.finishedLoading();
}
}
this.load_levels = ["_parent"];
}
Frame 11
if (false) {
}
Frame 12
stop();
loader_mc.startLoading();
Frame 20
if (false) {
}
Frame 22
init = function () {
if (_level0.dotdotpath == null) {
_level0.dotdotpath = "";
}
if (_level0.gameID == null) {
_level0.gameID = "2";
}
this.secondsBetweenRounds = 0.5;
this.nextRoundIntervalID = null;
this.secondsPerHalf = 45;
this.resetBestScore();
strikeIt_mc.__target_obj = this;
strikeIt_mc.onRoundOver = function (outcome_obj) {
trace("Game Outcome:");
for (var _local3 in outcome_obj) {
trace((("\t" + _local3) + "=") + outcome_obj[_local3]);
}
this.__target_obj.playNextRound(outcome_obj);
};
strikeIt_mc.reset(false);
countdownTimer_mc.__target_obj = this;
countdownTimer_mc.onReachedZero = function () {
this.__target_obj.endOfHalfOutro();
};
this.reset();
};
reset = function (showLeaderBoard) {
this.playingHalf = false;
if (showLeaderBoard == null) {
showLeaderBoard = true;
}
panelStart_mc._visible = showLeaderBoard;
panelResults_mc._visible = false;
panelEndOfHalf_mc._visible = false;
panelInstr_mc._visible = false;
panelEmail_mc._visible = false;
this.resetTotalScore();
this.resetHalfTimeCountdown();
this.resetShotTally();
this.currentHalf_int = 1;
};
getLeaderBoard = function () {
panelStart_mc.leaderboard_mc.getLeaderBoard();
};
resetHalfTimeCountdown = function () {
countdownTimer_mc.init(0, this.secondsPerHalf, null);
};
calculateShotScore = function (outcome_obj) {
var _local2 = 0;
if (outcome_obj.onTarget && (!outcome_obj.saved)) {
var _local4 = outcome_obj.accuracy;
var _local1 = outcome_obj.verticalCode;
if (_local1 == "b") {
_local1 = 0;
} else if (_local1 == "m") {
_local1 = 3;
} else if (_local1 == "t") {
_local1 = 6;
} else {
_local1 = 0;
}
_local2 = (_local4 + _local1) + 1;
}
return(_local2);
};
resetBestScore = function () {
this.bestScore_int = 0;
this.updateBestScoreDisplay(this.bestScore_int);
};
resetTotalScore = function () {
this.totalScore_int = 0;
this.updateTotalScoreDisplay(this.totalScore_int);
};
addToTotalScore = function (s) {
this.totalScore_int = this.totalScore_int + s;
this.updateTotalScoreDisplay(this.totalScore_int);
};
updateBestScoreDisplay = function (s) {
_root.bestScore_txt.text = s;
};
updateTotalScoreDisplay = function (s) {
_root.totalScore_txt.text = s;
};
displayShotScore = function (s) {
if (s > 0) {
var _local1 = {x:strikeIt_mc.ballShoot_mc.ball_mc._x, y:strikeIt_mc.ballShoot_mc.ball_mc._y};
strikeIt_mc.ballShoot_mc.localToGlobal(_local1);
scoreDisplay_mc._x = _local1.x;
scoreDisplay_mc._y = _local1.y;
trace((((("displayShotScore = " + s) + ", ") + _local1.x) + ", ") + _local1.y);
scoreDisplay_mc.displayValue(s);
}
};
updateBestScore = function (s) {
if (s > this.bestScore_int) {
this.bestScore_int = s;
this.updateBestScoreDisplay(this.bestScore_int);
}
};
resetShotTally = function () {
this.shotTally_1_obj = {goalsScored_int:0, goalsSaved_int:0, missedGoal_int:0, missedBall_int:0, hitGoal_int:0, hitBall_int:0};
this.shotTally_2_obj = {goalsScored_int:0, goalsSaved_int:0, missedGoal_int:0, missedBall_int:0, hitGoal_int:0, hitBall_int:0};
};
storeShotTally = function (outcome_obj) {
if (outcome_obj.kickedBall) {
this[("shotTally_" + this.currentHalf_int) + "_obj"].hitBall_int++;
if (outcome_obj.onTarget) {
this[("shotTally_" + this.currentHalf_int) + "_obj"].hitGoal_int++;
if (outcome_obj.saved == true) {
this[("shotTally_" + this.currentHalf_int) + "_obj"].goalsSaved_int++;
} else {
_root.mc_crowd_score.gotoAndPlay("on");
this[("shotTally_" + this.currentHalf_int) + "_obj"].goalsScored_int++;
}
} else {
_root.mc_crowd_miss.gotoAndPlay("on");
this[("shotTally_" + this.currentHalf_int) + "_obj"].missedGoal_int++;
}
} else {
this[("shotTally_" + this.currentHalf_int) + "_obj"].missedBall_int++;
}
};
emailaFriend = function (half) {
if (half == "1") {
panelEmail_mc.play_now_mc._visible = true;
panelEmail_mc.new_game_mc._visible = false;
} else {
panelEmail_mc.play_now_mc._visible = false;
panelEmail_mc.new_game_mc._visible = true;
}
panelEndOfHalf_mc._visible = false;
panelEmail_mc.gotoAndPlay("set");
panelEmail_mc._visible = true;
};
viewInstructions = function () {
panelStart_mc._visible = false;
panelInstr_mc._visible = true;
};
displayResults = function (outcome_obj) {
panelResults_mc.updateDisplay(outcome_obj);
panelResults_mc._visible = true;
};
hideAllPanels = function () {
panelStart_mc._visible = false;
panelResults_mc._visible = false;
panelEndOfHalf_mc._visible = false;
panelInstr_mc._visible = false;
panelEmail_mc._visible = false;
};
playAgain = function () {
panelResults_mc._visible = false;
strikeIt_mc.reset(true);
};
playNextHalfIntro = function () {
trace("playNextHalfIntro");
this.hideAllPanels();
this.resetHalfTimeCountdown();
strikeIt_mc.reset(false);
_root.mc_crowd_ambience.gotoAndPlay("loud");
if (this.currentHalf_int == 1) {
halvesAnim_mc.gotoAndPlay("firstHalf");
} else {
halvesAnim_mc.gotoAndPlay("secondHalf");
}
};
playNextHalf = function () {
strikeIt_mc.enableControls(true);
countdownTimer_mc.startTimer();
this.playingHalf = true;
};
endOfHalfOutro = function () {
this.playingHalf = false;
strikeIt_mc.enableControls(false);
strikeIt_mc.powerBar_mc.stopPowerGauge();
if (this.currentHalf_int == 1) {
halvesAnim_mc.gotoAndPlay("endFirstHalf");
} else {
halvesAnim_mc.gotoAndPlay("endSecondHalf");
}
};
endOfHalf = function () {
if (this.currentHalf_int == 1) {
this.endOfFirstHalf();
} else {
this.endOfSecondHalf();
}
this.currentHalf_int++;
};
endOfFirstHalf = function () {
trace("End of first half");
panelEndOfHalf_mc.displayEndOfFirstHalf(this.shotTally_1_obj, this.totalScore_int);
panelEndOfHalf_mc._visible = true;
};
endOfSecondHalf = function () {
trace("End of second half");
panelEndOfHalf_mc.displayEndOfSecondHalf(this.shotTally_2_obj, this.totalScore_int);
panelEndOfHalf_mc._visible = true;
};
playNextRound = function (outcome_obj) {
if (this.playingHalf) {
var _local2 = this.calculateShotScore(outcome_obj);
this.storeShotTally(outcome_obj);
this.displayShotScore(_local2);
this.addToTotalScore(_local2);
this.nextRoundIntervalID = setInterval(this, "startNextRound", this.secondsBetweenRounds * 1000);
}
};
startNextRound = function () {
clearInterval(this.nextRoundIntervalID);
strikeIt_mc.reset(this.playingHalf);
};
startNextGame = function (showLeaderBoard) {
if (showLeaderBoard == null) {
showLeaderBoard = true;
}
this.updateBestScore(this.totalScore_int);
this.reset(showLeaderBoard);
if (!showLeaderBoard) {
this.playNextHalfIntro();
}
};
validateSend = function () {
trace("called validate");
var _local1 = _level0.dotdotpath + "";
trace(panelEmail_mc.from_email);
if (!(((((((((panelEmail_mc.from_email.indexOf("@") > 0) && (panelEmail_mc.from_email.indexOf(".") > 0)) && (panelEmail_mc.from_email.lastIndexOf(".") < (panelEmail_mc.from_email.length - 2))) && (panelEmail_mc.from_email.indexOf("@") == panelEmail_mc.from_email.lastIndexOf("@"))) && (panelEmail_mc.from_email.indexOf("@") < panelEmail_mc.from_email.lastIndexOf("."))) && (allowchar(" <>,;:", panelEmail_mc.from_email) == false)) && (panelEmail_mc.from_email.indexOf("..") == -1)) && (panelEmail_mc.from_email.indexOf(".@") == -1)) && (panelEmail_mc.from_email.indexOf("@.") == -1))) {
panelEmail_mc.no_details_txt.text = "your e-mail is not valid";
} else if (!(((((((((panelEmail_mc.to_email.indexOf("@") > 0) && (panelEmail_mc.to_email.indexOf(".") > 0)) && (panelEmail_mc.to_email.lastIndexOf(".") < (panelEmail_mc.to_email.length - 2))) && (panelEmail_mc.to_email.indexOf("@") == panelEmail_mc.to_email.lastIndexOf("@"))) && (panelEmail_mc.to_email.indexOf("@") < panelEmail_mc.to_email.lastIndexOf("."))) && (allowchar(" <>,;:", panelEmail_mc.to_email) == false)) && (panelEmail_mc.to_email.indexOf("..") == -1)) && (panelEmail_mc.to_email.indexOf(".@") == -1)) && (panelEmail_mc.to_email.indexOf("@.") == -1))) {
panelEmail_mc.no_details_txt.text = "friend's e-mail is not valid";
} else {
send_result = new LoadVars();
send_result.onLoad = function (success) {
if (success) {
trace("success");
panelEmail_mc.gotoAndPlay("sent");
} else {
trace("error");
panelEmail_mc.gotoAndPlay("sent");
}
};
send_mail = new LoadVars();
send_mail.subject = "Play Corner Kick on theFA.com";
send_mail.from_email = panelEmail_mc.from_email;
send_mail.to_email = panelEmail_mc.to_email;
send_mail.from_name = panelEmail_mc.from_name;
send_mail.to_name = panelEmail_mc.to_name;
send_mail.mail_message = panelEmail_mc.message_txt.text;
send_mail.sendAndLoad(_local1, send_result, "POST");
}
};
allowchar = function (allow, str) {
var _local3 = true;
var _local1 = 0;
while (_local1 < str.length) {
if (allow.indexOf(str.charAt(_local1)) == -1) {
_local3 = false;
}
_local1++;
}
return(_local3);
};
init();
stop();
Symbol 31 MovieClip Frame 2
stop();
Symbol 31 MovieClip Frame 13
_parent.onCornerKick();
Symbol 31 MovieClip Frame 26
stop();
Symbol 96 MovieClip Frame 1
init = function () {
reset();
};
reset = function () {
this._visible = true;
gotoAndPlay ("set");
};
startBallFlight = function () {
gotoAndPlay ("go");
};
kickBall = function () {
this._visible = false;
stop();
};
onBallFlightOver = function () {
_parent.onBallFlightOver();
};
nextBallFrame = function () {
gotoAndStop(_currentframe + 1);
};
init();
Symbol 96 MovieClip Frame 3
stop();
Symbol 96 MovieClip Frame 44
Symbol 96 MovieClip Frame 73
onBallFlightOver();
Symbol 96 MovieClip Frame 79
stop();
Symbol 131 MovieClip Frame 1
init = function () {
this.dive_array = ["left", "right", "up"];
this.reset();
};
reset = function () {
goalie_mc._visible = false;
gotoAndPlay ("set");
};
dive = function () {
var _local2 = Math.floor(Math.random() * this.dive_array.length);
gotoAndPlay(this.dive_array[_local2]);
};
init();
Symbol 131 MovieClip Frame 3
stop();
Symbol 131 MovieClip Frame 22
stop();
Symbol 131 MovieClip Frame 35
stop();
Symbol 131 MovieClip Frame 49
stop();
Symbol 133 MovieClip Frame 1
reset = function () {
this.currectShotID = null;
this.ball_mc._visible = false;
this.savedByGoalie_bool = false;
this.savedIntervalID_int = null;
this.startBallScale = 210;
this.currentBallScale = this.startBallScale;
this.reduceBallScale_normal = 0.96;
this.reduceBallScale_saved = 1.008;
this.reduceBallScale = this.reduceBallScale_normal;
this.ball_mc._x = 0;
this.ball_mc._y = 0;
this.ball_mc._xscale = this.startBallScale;
this.ball_mc._yscale = this.startBallScale;
this.goalieDives_mc.reset();
};
initTargets = function () {
for (var _local3 in this) {
if ((typeof(this[_local3]) == "movieclip") && (_local3.indexOf("target") == 0)) {
var _local2 = _local3.split("_");
this[((((("angle_" + _local2[1]) + "_") + _local2[2]) + "_") + _local2[3]) + "_int"] = Math.atan2(this[_local3]._y, this[_local3]._x);
}
}
};
shootAtGoal = function (accuracy_int, rightPost_int, leftPost_int, missError_int, powerLevel_int) {
this.goalieDives_mc.dive();
if ((accuracy_int > (rightPost_int + missError_int)) || (accuracy_int < (leftPost_int - missError_int))) {
return(false);
}
if (accuracy_int >= rightPost_int) {
var _local9 = "miss_";
var _local5 = 3;
var _local2 = _local5;
while (_local2 > 0) {
if (accuracy_int >= (rightPost_int + (((_local2 - 1) * missError_int) / _local5))) {
_local9 = _local9 + ("r_" + _local2);
break;
}
_local2--;
}
this.playShot(_local9, 20);
return(true);
}
if (accuracy_int <= leftPost_int) {
var _local9 = "miss_";
var _local5 = 3;
var _local2 = _local5;
while (_local2 > 0) {
if (accuracy_int <= (leftPost_int - (((_local2 - 1) * missError_int) / _local5))) {
_local9 = _local9 + ("l_" + _local2);
break;
}
_local2--;
}
this.playShot(_local9, 20);
return(true);
}
var _local10 = this.convertPowerLevelToPosition(powerLevel_int);
var _local11 = 5;
var _local6 = (accuracy_int - leftPost_int) / (rightPost_int - leftPost_int);
_local6 = _local6 * (_local11 - 1);
_local6 = Math.round(_local6);
_local6 = _local6 - Math.floor(_local11 / 2);
trace("direction = " + _local6);
if ((_local10 == "o") || (_local10 == "u")) {
var _local9 = "miss_";
} else {
var _local9 = "hit_";
}
if (_local6 < 0) {
var _local9 = _local9 + ((("l" + _local10) + "_") + (-_local6));
} else if (_local6 > 0) {
var _local9 = _local9 + ((("r" + _local10) + "_") + _local6);
} else {
var _local9 = _local9 + (("m" + _local10) + "_0");
}
trace("shotID_str = " + _local9);
this.playShot(_local9, this.convertPowerLevelToSpeed(powerLevel_int));
return(true);
};
getShotID = function () {
return(this.currectShotID);
};
playShot = function (shotID_str, speed_int) {
this.reduceBallScale = this.convertSpeedToFrictionLevel(speed_int);
trace("speed_int = " + speed_int);
this.currectShotID = shotID_str;
this.shotAngle_int = this[("angle_" + this.currectShotID) + "_int"];
trace("angle = " + this.shotAngle_int);
this.shotSpeed_int = speed_int;
this.finalX_int = this[("target_" + this.currectShotID) + "_mc"]._x;
this.finalY_int = this[("target_" + this.currectShotID) + "_mc"]._y;
this.ball_mc._visible = true;
this.onEnterFrame = this.moveBall;
};
moveBall = function () {
if (((!this.savedByGoalie_bool) && (this.currectShotID.indexOf("hit") >= 0)) && (this.ball_mc.hitTest(this.goalieDives_mc.goalie_mc))) {
_root.mc_crowd_miss.gotoAndPlay("on");
_root.mc_catch.gotoAndPlay("on");
trace("################# hit " + this.shotAngle_int);
this.reduceBallScale = this.reduceBallScale_saved;
this.shotAngle_int = (Math.PI/2);
this.shotSpeed_int = this.shotSpeed_int * 0.2;
trace(this.shotAngle_int);
this.savedByGoalie_bool = true;
this.savedIntervalID_int = setInterval(this, "stopBallAfterSave", 500);
}
this.currentBallScale = this.currentBallScale * this.reduceBallScale;
this.ball_mc._xscale = this.currentBallScale;
this.ball_mc._yscale = this.currentBallScale;
var _local4 = this.ball_mc._x + (this.shotSpeed_int * Math.cos(this.shotAngle_int));
var _local3 = this.ball_mc._y + (this.shotSpeed_int * Math.sin(this.shotAngle_int));
if ((_local3 < this.finalY_int) && (!this.savedByGoalie_bool)) {
this.ball_mc._x = this.finalX_int;
this.ball_mc._y = this.finalY_int;
this.stopBall();
} else {
this.ball_mc._x = _local4;
this.ball_mc._y = _local3;
}
};
stopBallAfterSave = function () {
clearInterval(this.savedIntervalID_int);
this.stopBall();
};
stopBall = function () {
delete this.onEnterFrame;
_parent.onBallShotOver(this.savedByGoalie_bool);
};
convertPowerLevelToPosition = function (powerLevel_int) {
if (powerLevel_int <= 30) {
return("u");
}
if (powerLevel_int <= 55) {
return("b");
}
if (powerLevel_int <= 70) {
return("m");
}
if (powerLevel_int <= 80) {
return("t");
}
return("o");
};
convertPowerLevelToSpeed = function (powerLevel_int) {
if (powerLevel_int <= 30) {
return(2);
}
if (powerLevel_int <= 55) {
return(20);
}
if (powerLevel_int <= 70) {
return(20);
}
if (powerLevel_int <= 80) {
return(20);
}
return(30);
};
convertSpeedToFrictionLevel = function (speed_int) {
if (speed_int <= 2) {
return(0.993);
}
if (powerLevel_int <= 20) {
return(0.93);
}
return(0.96);
};
initTargets();
reset();
Symbol 169 MovieClip Frame 1
init = function () {
this.millsToPrimePosition = 33;
};
reset = function () {
this.shoot_date = null;
this.gotoAndPlay("set");
};
shoot = function (shoot_date) {
this.shoot_date = shoot_date;
this.shoot_date.setMilliseconds(this.shoot_date.getMilliseconds() + this.millsToPrimePosition);
this.gotoAndPlay("go");
};
onPrimePosition = function () {
_parent.onShoot(this.shoot_date);
};
init();
Symbol 169 MovieClip Frame 3
stop();
Symbol 169 MovieClip Frame 20
onPrimePosition();
Symbol 169 MovieClip Frame 40
stop();
Symbol 178 MovieClip Frame 1
reset = function () {
this.gaugeMaxPos = 200;
this.gaugeSpeed = 6;
this.gaugeDirection = 1;
gauge_mc.mask_mc._x = 0;
};
getPowerLevel = function () {
var _local2 = Math.round((100 * gauge_mc.mask_mc._x) / this.gaugeMaxPos);
return(_local2);
};
startPowerGauge = function () {
gauge_mc.onEnterFrame = this.powerGaugeLoop;
};
stopPowerGauge = function () {
delete gauge_mc.onEnterFrame;
};
powerGaugeLoop = function () {
var _local2 = this.mask_mc._x + (this._parent.gaugeSpeed * this._parent.gaugeDirection);
if (_local2 >= this._parent.gaugeMaxPos) {
_local2 = this._parent.gaugeMaxPos;
this._parent.gaugeDirection = -1;
} else if (_local2 <= 0) {
_local2 = 0;
this._parent.gaugeDirection = 1;
}
this.mask_mc._x = _local2;
};
reset();
Symbol 179 MovieClip [StrikeIt] Frame 1
#initclip 2
StrikeIt = function () {
this.STATE_PRE_CORNER_KICK = 0;
this.STATE_PRE_POWER = 1;
this.STATE_PRE_SHOOT = 2;
this.STATE_POST_SHOOT_MISS = 3;
this.STATE_POST_SHOOT_HIT = 4;
this.STATE_FINISHED = 3;
this.POWER_POOR = 55;
this.POWER_AVERAGE = 75;
this.POWER_GOOD = 90;
this.POWER_GREAT = 95;
this.POWER_PERFECT = 100;
this.currentState = null;
this.rangeTimer_date = null;
};
StrikeIt.prototype = new MovieClip();
Object.registerClass("StrikeIt", StrikeIt);
StrikeIt.prototype.init = function () {
};
StrikeIt.prototype.reset = function (withControls) {
this.currentState = this.STATE_PRE_CORNER_KICK;
this.cornerKicker_mc.gotoAndPlay("set");
this.ballFlight_mc.reset();
this.striker_mc.reset();
this.ballShoot_mc.reset();
this.powerBar_mc.reset();
this.enableControls(withControls);
};
StrikeIt.prototype.enableControls = function (flag) {
if (flag) {
this.addMouseEvents();
} else {
this.removeMouseEvents();
}
};
StrikeIt.prototype.addMouseEvents = function () {
this.onMouseDown = this.onUserInput;
this.keyboardListener_obj = new Object();
this.keyboardListener_obj.game_obj = this;
this.keyboardListener_obj.onKeyDown = function () {
this.game_obj.onUserInput();
};
Key.addListener(this.keyboardListener_obj);
};
StrikeIt.prototype.removeMouseEvents = function () {
delete this.onMouseDown;
Key.removeListener(this.keyboardListener_obj);
};
StrikeIt.prototype.takeCorner = function () {
this.currentState = this.STATE_PRE_POWER;
this.cornerKicker_mc.gotoAndPlay("go");
};
StrikeIt.prototype.startPower = function () {
this.currentState = this.STATE_PRE_SHOOT;
this.powerBar_mc.startPowerGauge();
};
StrikeIt.prototype.takeShot = function () {
this.powerBar_mc.stopPowerGauge();
trace("PowerBar.powerLevel = " + this.powerBar_mc.getPowerLevel());
this.striker_mc.shoot(new Date());
};
StrikeIt.prototype.getAccuracy = function (shotTime_date) {
var _local2 = ((this.rangeTimer_date == null) ? -1 : (shotTime_date.getTime() - this.rangeTimer_date.getTime()));
trace("accuracy = " + _local2);
return(_local2);
};
StrikeIt.prototype.roundOver = function (savedByGoalie_bool) {
this.enableControls(false);
var _local2 = this.ballShoot_mc.getShotID().split("_");
var _local8 = _local2[0] == "hit";
var _local3 = Number(_local2[2]);
var _local4 = {onTarget:_local8, accuracy:_local3, saved:savedByGoalie_bool, kickedBall:!isNaN(_local3), power:this.powerBar_mc.getPowerLevel(), horizontalCode:_local2[1].charAt(0), verticalCode:_local2[1].charAt(1), skill:this.convertPowerToSkill(this.powerBar_mc.getPowerLevel())};
this.onRoundOver(_local4);
};
StrikeIt.prototype.convertPowerToSkill = function (powerLevel_int) {
if (powerLevel_int <= this.POWER_POOR) {
return(0);
}
if (powerLevel_int <= this.POWER_AVERAGE) {
return(1);
}
if (powerLevel_int <= this.POWER_GOOD) {
return(2);
}
if (powerLevel_int <= this.POWER_GREAT) {
return(3);
}
if (powerLevel_int <= this.POWER_PERFECT) {
return(4);
}
return(0);
};
StrikeIt.prototype.onUserInput = function () {
trace("StrikeIt.onUserInput at " + new Date().getTime());
switch (this.currentState) {
case this.STATE_PRE_CORNER_KICK :
this.takeCorner();
break;
case this.STATE_PRE_POWER :
this.startPower();
break;
case this.STATE_PRE_SHOOT :
this.takeShot();
break;
default :
trace("Some other state");
}
};
StrikeIt.prototype.onCornerKick = function () {
this.onInRange();
this.ballFlight_mc.startBallFlight();
};
StrikeIt.prototype.onInRange = function () {
this.rangeTimer_date = new Date();
trace("StrikeIt.onInRange at " + this.rangeTimer_date.getTime());
};
StrikeIt.prototype.onShoot = function (shotTime_date) {
var _local5 = (Math.random() * 5) - 5;
var _local3 = this.ballFlight_mc.ball_mc._x;
trace("distance = " + _local3);
_local3 = _local3 + _local5;
trace("distance + chaosFactor = " + _local3);
var _local6 = 3;
var _local7 = this.powerBar_mc.getPowerLevel();
var _local4 = this.ballShoot_mc.shootAtGoal(_local3, 5, -5, _local6, _local7);
trace("result = " + _local4);
if (_local4) {
this.ballFlight_mc.kickBall();
this.currentState = this.STATE_POST_SHOOT_HIT;
_root.mc_striker_kick.gotoAndPlay("on");
} else {
this.currentState = this.STATE_POST_SHOOT_MISS;
_root.mc_crowd_miss.gotoAndPlay("on");
}
};
StrikeIt.prototype.onBallFlightOver = function () {
trace("totally missed the shot, try again...");
if (this.currentState == this.STATE_PRE_SHOOT) {
this.powerBar_mc.stopPowerGauge();
}
this.roundOver();
};
StrikeIt.prototype.onBallShotOver = function (savedByGoalie_bool) {
if (this.currentState == this.STATE_POST_SHOOT_HIT) {
this.roundOver(savedByGoalie_bool);
}
};
#endinitclip
Symbol 181 MovieClip Frame 1
this.soundControl = new Sound(this);
Symbol 181 MovieClip Frame 2
this.soundControl.setVolume(50);
Symbol 181 MovieClip Frame 7
stop();
Symbol 181 MovieClip Frame 8
this.soundControl.setVolume(100);
Symbol 181 MovieClip Frame 14
stop();
Symbol 182 MovieClip Frame 7
stop();
Symbol 182 MovieClip Frame 14
stop();
Symbol 184 MovieClip Frame 7
stop();
Symbol 184 MovieClip Frame 14
stop();
Symbol 186 MovieClip Frame 7
stop();
Symbol 186 MovieClip Frame 14
stop();
Symbol 188 MovieClip Frame 7
stop();
Symbol 188 MovieClip Frame 14
stop();
Symbol 194 MovieClip Frame 1
init = function () {
this.reset();
};
reset = function () {
this.title_str = "";
this.gotoAndPlay("set");
};
displayValue = function (value_str) {
this.title_str = value_str;
this.gotoAndPlay("go");
};
this.init();
Symbol 194 MovieClip Frame 3
stop();
Symbol 194 MovieClip Frame 5
this.title_mc.title_txt.text = this.title_str;
Symbol 194 MovieClip Frame 30
this.reset();
Symbol 197 MovieClip [CountdownTimer] Frame 1
#initclip 1
CountdownTimer = function () {
};
CountdownTimer.prototype = new MovieClip();
Object.registerClass("CountdownTimer", CountdownTimer);
CountdownTimer.prototype.init = function (m, s, n) {
this.showMinutes = n != null;
this.showSeconds = s != null;
this.showMilliseconds = m != null;
m = ((m == null) ? 0 : (m));
s = ((s == null) ? 0 : (s));
n = ((n == null) ? 0 : (n));
this.timeLimit = ((n * 60000) + (s * 1000)) + m;
this.totalMilliseconds = 0;
this.milliseconds = m;
this.seconds = s;
this.minutes = n;
this.setTimeText(this.milliseconds, this.seconds, this.minutes);
};
CountdownTimer.prototype.addZero = function (x) {
if (x < 10) {
return("0" + x);
}
return(x);
};
CountdownTimer.prototype.startTimer = function () {
this.rootMilliseconds = new Date().getTime();
this.onEnterFrame = this.calculateTime;
};
CountdownTimer.prototype.stopTimer = function () {
delete this.onEnterFrame;
};
CountdownTimer.prototype.calculateTime = function () {
this.totalMilliseconds = (this.timeLimit - new Date().getTime()) + this.rootMilliseconds;
this.milliseconds = Math.floor((this.totalMilliseconds % 1000) / 10);
this.seconds = Math.floor(this.totalMilliseconds / 1000) % 60;
this.minutes = Math.floor(this.totalMilliseconds / 60000);
this.setTimeText(this.milliseconds, this.seconds, this.minutes);
if (((this.minutes <= 0) && (this.seconds <= 0)) && (this.milliseconds <= 0)) {
this.milliseconds = 0;
this.seconds = 0;
this.minutes = 0;
this.setTimeText(this.milliseconds, this.seconds, this.minutes);
this.stopTimer();
this.onReachedZero();
}
};
CountdownTimer.prototype.setTimeText = function (m, s, n) {
var _local2 = "";
if (this.showMinutes) {
_local2 = _local2 + (this.addZero(n) + ":");
}
if (this.showSeconds) {
_local2 = _local2 + (this.addZero(s) + ":");
}
if (this.showMilliseconds) {
_local2 = _local2 + (this.addZero(m) + ":");
}
if (_local2.charAt(_local2.length - 1) == ":") {
_local2 = _local2.substr(0, _local2.length - 1);
}
this.time_txt.text = _local2;
};
CountdownTimer.prototype.getTotalMilliseconds = function () {
return(this.totalMilliseconds);
};
CountdownTimer.prototype.getMilliseconds = function () {
return(this.milliseconds);
};
CountdownTimer.prototype.getSeconds = function () {
return(this.seconds);
};
CountdownTimer.prototype.getMinutes = function () {
return(this.minutes);
};
#endinitclip
Symbol 229 MovieClip Frame 10
stop();
Symbol 232 Button
on (release) {
_parent.playNextHalfIntro();
}
Symbol 257 MovieClip Frame 10
stop();
Symbol 260 Button
on (release) {
sendscore = new LoadVars();
sendscore.gscore = _root.totalScore_txt.text;
sendscore.gname = "on_the_volleySte";
sendscore.send("index.php?act=Arcade&do=newscore", "_self", "POST");
gotoAndPlay ("saved");
}
Symbol 281 Button
on (release) {
if ((((username == null) || (useremail == null)) || (username == "")) || (useremail == "")) {
no_details_txt.text = "Please complete all fields";
} else {
validateEmail();
}
}
Symbol 285 Button
on (release) {
gotoAndPlay ("play");
}
Symbol 286 Button
on (release) {
gotoAndPlay (2);
}
Symbol 288 MovieClip Frame 1
if (_parent.fa_info == 1) {
gotoAndPlay ("play");
}
Symbol 288 MovieClip Frame 4
stop();
_parent.fa_info = 0;
Symbol 288 MovieClip Frame 8
stop();
_parent.fa_info = 1;
Symbol 289 Button
on (release) {
gotoAndPlay ("play");
}
Symbol 290 Button
on (release) {
gotoAndPlay (2);
}
Symbol 291 MovieClip Frame 1
if (_parent.partner_info == 1) {
gotoAndPlay ("play");
}
Symbol 291 MovieClip Frame 4
stop();
_parent.partner_info = 0;
_root.UpdateCookie("partner_info", 0);
Symbol 291 MovieClip Frame 8
stop();
_parent.partner_info = 1;
_root.UpdateCookie("partner_info", 1);
Symbol 306 MovieClip Frame 1
init = function () {
this.send_obj = new LoadVars();
this.load_xml = new XML();
this.load_xml.target_obj = this;
this.load_xml.ignoreWhite = true;
this.load_xml.onLoad = this.saveScore_Result;
};
displayEndOfFirstHalf = function (shotTally_obj, totalScore_int) {
this.shotTally1_obj = shotTally_obj;
this.totalScore_int = totalScore_int;
gotoAndPlay ("first");
};
displayEndOfSecondHalf = function (shotTally_obj, totalScore_int) {
this.shotTally2_obj = shotTally_obj;
this.totalScore_int = totalScore_int;
gotoAndPlay ("second");
};
saveScore = function (u, e, s) {
var _local2 = _level0.dotdotpath + "";
this.send_obj.username = u;
this.send_obj.email = e;
this.send_obj.score = s;
this.send_obj.gameID = _level0.gameID;
this.send_obj.FAinfo = fa_info;
this.send_obj.partnerinfo = partner_info;
this.send_obj.sendAndLoad(_local2, this.load_xml, "POST");
gotoAndPlay ("saving");
};
saveScore_Result = function (success) {
if (success) {
var _local3 = this.childNodes[0].childNodes[0].childNodes[0].nodeValue;
if (Number(_local3) == 1) {
this.target_obj.gotoAndPlay("inUse");
} else {
_parent.getLeaderBoard();
this.target_obj.gotoAndPlay("saved");
}
}
};
allowchar = function (allow, str) {
var _local3 = true;
var _local1 = 0;
while (_local1 < str.length) {
if (allow.indexOf(str.charAt(_local1)) == -1) {
_local3 = false;
}
_local1++;
}
return(_local3);
};
validateEmail = function () {
if (!(((((((((useremail.indexOf("@") > 0) && (useremail.indexOf(".") > 0)) && (useremail.lastIndexOf(".") < (useremail.length - 2))) && (useremail.indexOf("@") == useremail.lastIndexOf("@"))) && (useremail.indexOf("@") < useremail.lastIndexOf("."))) && (allowchar(" <>,;:", useremail) == false)) && (useremail.indexOf("..") == -1)) && (useremail.indexOf(".@") == -1)) && (useremail.indexOf("@.") == -1))) {
no_details_txt.text = "e-mail is not valid";
} else {
saveScore(username, useremail, this.totalScore_int);
}
};
init();
Symbol 306 MovieClip Frame 3
this.goalsScored_txt.text = this.shotTally1_obj.goalsScored_int;
this.goalsSaved_txt.text = this.shotTally1_obj.goalsSaved_int;
this.missedGoal_txt.text = this.shotTally1_obj.missedGoal_int;
this.missedBall_txt.text = this.shotTally1_obj.missedBall_int;
this.hitGoal_txt.text = this.shotTally1_obj.hitGoal_int;
this.hitBall_txt.text = this.shotTally1_obj.hitBall_int;
this.totalScore_txt.text = this.totalScore_int;
_root.mc_crowd_ambience.gotoAndPlay("quiet");
Symbol 306 MovieClip Frame 4
stop();
Symbol 306 MovieClip Frame 11
this.goalsScored_txt.text = this.shotTally1_obj.goalsScored_int + this.shotTally2_obj.goalsScored_int;
this.goalsSaved_txt.text = this.shotTally1_obj.goalsSaved_int + this.shotTally2_obj.goalsSaved_int;
this.missedGoal_txt.text = this.shotTally1_obj.missedGoal_int + this.shotTally2_obj.missedGoal_int;
this.missedBall_txt.text = this.shotTally1_obj.missedBall_int + this.shotTally2_obj.missedBall_int;
this.hitGoal_txt.text = this.shotTally1_obj.hitGoal_int + this.shotTally2_obj.hitGoal_int;
this.hitBall_txt.text = this.shotTally1_obj.hitBall_int + this.shotTally2_obj.hitBall_int;
this.totalScore_txt.text = this.totalScore_int;
_root.mc_crowd_ambience.gotoAndPlay("quiet");
Symbol 306 MovieClip Frame 13
stop();
Symbol 306 MovieClip Frame 20
stop();
username_txt.type = "input";
useremail_txt.type = "input";
username_txt.restrict = " a-zA-Z0-9";
useremail_txt.restrict = "^'^\"";
username_txt.tabIndex = 1;
useremail_txt.tabIndex = 2;
username_txt.onSetFocus = function () {
no_details_txt.text = "";
};
useremail_txt.onSetFocus = function () {
no_details_txt.text = "";
};
if ((_parent.panelEmail_mc.from_name != null) && (_parent.panelEmail_mc.from_name != "")) {
username_txt.text = _parent.panelEmail_mc.from_name;
}
if ((_parent.panelEmail_mc.from_email != null) && (_parent.panelEmail_mc.from_email != "")) {
useremail_txt.text = _parent.panelEmail_mc.from_email;
}
Symbol 306 MovieClip Frame 30
stop();
username_txt.type = "input";
useremail_txt.type = "input";
Symbol 306 MovieClip Frame 61
stop();
username_txt.type = "dynamic";
useremail_txt.type = "dynamic";
Symbol 306 MovieClip Frame 63
stopAllSounds();
stop();
Symbol 314 Button
on (release) {
_parent.playNextHalfIntro();
}
Symbol 316 Button
on (release) {
_parent.viewInstructions();
}
Symbol 354 MovieClip Frame 1
function getLeaderBoard() {
var _local2 = (_level0.dotdotpath + "") + _level0.gameID;
this.load_xml = new XML();
this.load_xml.ignoreWhite = true;
this.load_xml.target_obj = this;
this.load_xml.onLoad = this.getLeaderBoard_result;
this.load_xml.load(_local2);
this.gotoAndStop("loading");
}
function getLeaderBoard_result(success) {
if (success) {
var _local3 = this.childNodes[0].childNodes;
var _local2 = 0;
while (_local2 < _local3.length) {
var _local5 = _local3[_local2].childNodes[0].childNodes[0].nodeValue;
var _local4 = _local3[_local2].childNodes[1].childNodes[0].nodeValue;
this.target_obj[("l" + (_local2 + 1)) + "_name"] = _local5;
this.target_obj[("l" + (_local2 + 1)) + "_score"] = _local4;
_local2++;
}
this.target_obj.gotoAndStop("play");
}
}
stop();
getLeaderBoard();
Symbol 354 MovieClip Frame 2
stop();
Symbol 354 MovieClip Frame 8
stop();
Symbol 364 Button
on (release) {
_parent.startNextGame();
}
Symbol 373 Button
on (release) {
_parent._parent.startNextGame();
}
Symbol 376 Button
on (release) {
_parent._parent.playNextHalf();
gotoAndPlay ("set");
}
Symbol 379 Button
on (release) {
if ((from_name == null) || (from_name == "")) {
no_details_txt.text = "Please enter your name";
} else if ((to_name == null) || (to_name == "")) {
no_details_txt.text = "Please enter your friend's name";
} else if ((from_email == null) || (from_email == "")) {
no_details_txt.text = "Please enter your e-mail address";
} else if ((to_email == null) || (to_email == "")) {
no_details_txt.text = "Please enter your friend's e-mail address";
} else {
_root.validateSend();
}
}
Symbol 396 MovieClip Frame 1
if ((_parent.panelEndOfHalf_mc.username != null) && (_parent.panelEndOfHalf_mc.username != "")) {
username = _parent.panelEndOfHalf_mc.username;
}
if ((_parent.panelEndOfHalf_mc.useremail != null) && (_parent.panelEndOfHalf_mc.useremail != "")) {
useremail = _parent.panelEndOfHalf_mc.useremail;
}
if ((username != null) && (username != "")) {
from_name = username;
}
if ((useremail != null) && (useremail != "")) {
from_email = useremail;
}
from_name_txt.tabIndex = 1;
to_name_txt.tabIndex = 2;
message_txt.tabIndex = 3;
from_email_txt.tabIndex = 4;
to_email_txt.tabIndex = 5;
from_name_txt.onSetFocus = function () {
no_details_txt.text = "";
};
from_email_txt.onSetFocus = function () {
no_details_txt.text = "";
};
to_name_txt.onSetFocus = function () {
no_details_txt.text = "";
};
to_email_txt.onSetFocus = function () {
no_details_txt.text = "";
};
message_txt.onSetFocus = function () {
};
Symbol 396 MovieClip Frame 3
stop();
Symbol 396 MovieClip Frame 10
stop();
Symbol 405 MovieClip Frame 1
stop();
Symbol 405 MovieClip Frame 38
_parent.playNextHalf();
Symbol 405 MovieClip Frame 49
stop();
Symbol 405 MovieClip Frame 93
stop();
_parent.endOfHalf();
Symbol 405 MovieClip Frame 130
_parent.playNextHalf();
Symbol 405 MovieClip Frame 141
stop();
Symbol 405 MovieClip Frame 184
stop();
_parent.endOfHalf();