Frame 2
stop();
Frame 3
stop();
this._lockroot = true;
_global.mute = false;
getURL ("javascript:dcsMultiTrack('DCS.dcsuri','/ff/classicFootball','WT.cg_n','FantasyFootball','WT.ti','FF:Classic Football');");
Symbol 6 MovieClip Frame 2
var loadedBytes = _parent.getBytesLoaded();
var totalBytes = _parent.getBytesTotal();
var perc = ((loadedBytes / totalBytes) * 100);
trace("loaded bytes = " + loadedBytes);
trace("total bytes = " + totalBytes);
loadBar_mc._xscale = perc;
if (loadedBytes >= totalBytes) {
trace("done loading");
gotoAndPlay ("endLoad");
} else {
gotoAndPlay ("startLoad");
}
Symbol 6 MovieClip Frame 3
_parent.gotoAndPlay("MAIN");
Symbol 292 MovieClip [__Packages.tinymantis.Delegate] Frame 0
class tinymantis.Delegate
{
function Delegate () {
}
static function create(target, handler) {
var extraArgs = arguments.slice(2);
var delegate;
delegate = function () {
var _local2 = arguments.concat(extraArgs, [delegate]);
return(handler.apply(target, _local2));
};
return(delegate);
}
}
Symbol 293 MovieClip [__Packages.com.cpbgroup.utils.MovieClipDispatcher] Frame 0
class com.cpbgroup.utils.MovieClipDispatcher extends MovieClip
{
function MovieClipDispatcher () {
super();
mx.events.EventDispatcher.initialize(this);
}
}
Symbol 294 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 295 MovieClip [__Packages.org.asapframework.events.EventDelegate] Frame 0
class org.asapframework.events.EventDelegate
{
function EventDelegate () {
}
static function create(scope, method) {
var p = arguments.splice(2, arguments.length - 2);
var _local2 = function () {
method.apply(scope, arguments.concat(p));
};
return(_local2);
}
}
Symbol 296 MovieClip [__Packages.TimePopUp] Frame 0
class TimePopUp extends MovieClip
{
var gotoAndPlay, expandButton, oneMin, twoMin, twoHalfMin, oneMinShow, twoMinShow, twoHalfMinShow;
function TimePopUp () {
super();
}
function Expand() {
gotoAndPlay("expand");
}
function SetExpandButton() {
expandButton.onPress = tinymantis.Delegate.create(this, Expand);
Select();
}
function SetTimes() {
oneMin.onPress = tinymantis.Delegate.create(this, SelectOne);
twoMin.onPress = tinymantis.Delegate.create(this, SelectTwo);
twoHalfMin.onPress = tinymantis.Delegate.create(this, SelectTwoHalf);
}
function SelectOne() {
mSelectedTime = 1;
Contract();
}
function SelectTwo() {
mSelectedTime = 2;
Contract();
}
function SelectTwoHalf() {
mSelectedTime = 2.5;
Contract();
}
function Contract() {
gotoAndPlay("contract");
}
function Select() {
switch (mSelectedTime) {
case 1 :
oneMinShow._visible = true;
twoMinShow._visible = false;
twoHalfMinShow._visible = false;
break;
case 2 :
oneMinShow._visible = false;
twoMinShow._visible = true;
twoHalfMinShow._visible = false;
break;
case 2.5 :
oneMinShow._visible = false;
twoMinShow._visible = false;
twoHalfMinShow._visible = true;
}
_global.quarterLength = mSelectedTime;
}
var mSelectedTime = 1;
}
Symbol 297 MovieClip [__Packages.src.Interstitials] Frame 0
class src.Interstitials extends MovieClip
{
var resumeButton, mCB, mMsg, removeMovieClip;
function Interstitials () {
super();
_global.showingInterstitials = true;
resumeButton.onRelease = tinymantis.Delegate.create(this, Resume);
}
function Resume() {
_global.showingInterstitials = false;
mCB(mMsg);
trace("+++++++++++ game resumed");
removeMovieClip();
}
}
Symbol 31 Button
on (release, keyPress "<Enter>") {
onHitRelease();
}
on (rollOver) {
onHitRollOver();
MouseChecker.overItem("view");
}
on (rollOut) {
onHitRollOut();
MouseChecker.outItem("view");
}
Symbol 44 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 44 MovieClip Frame 27
stop();
Symbol 44 MovieClip Frame 43
gotoAndStop ("idle");
Symbol 65 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 65 MovieClip Frame 27
stop();
Symbol 65 MovieClip Frame 43
gotoAndStop ("idle");
Symbol 68 MovieClip [interstitials] Frame 1
#initclip 8
Object.registerClass("interstitials", src.Interstitials);
#endinitclip
Instance of Symbol 46 MovieClip in Symbol 68 MovieClip [interstitials] Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (press) {
}
Symbol 68 MovieClip [interstitials] Frame 14
stop();
resumeButton.onRollOver = function () {
this.gotoAndPlay("over");
};
resumeButton.onRollOut = function () {
this.gotoAndPlay("out");
};
cSendToFriendsRO.onRollOver = function () {
this.gotoAndPlay("over");
};
cSendToFriendsRO.onRollOut = function () {
this.gotoAndPlay("out");
};
cSendToFriendsRO.onPress = function () {
this.gotoAndStop("idle");
this.enabled = true;
this.useHandCursor = true;
_level0.ffgamesSend.show();
};
Symbol 68 MovieClip [interstitials] Frame 28
stop();
cSendFriendRO1.onRollOver = function () {
this.gotoAndPlay("over");
};
cSendFriendRO1.onRollOut = function () {
this.gotoAndPlay("out");
};
cSendFriendRO1.onPress = function () {
this.gotoAndStop("idle");
this.enabled = true;
this.useHandCursor = true;
_level0.ffgamesSend.show();
};
cPlayAgain.onRollOver = function () {
this.gotoAndPlay("over");
};
cPlayAgain.onRollOut = function () {
this.gotoAndPlay("out");
};
cPlayAgain.onPress = function () {
_global.showingInterstitials = false;
_parent._parent.gotoAndPlay("INSTRUCTIONS");
gameApp.initGame(1);
this.removeMovieClip();
};
Symbol 70 Button
on (release) {
getURL ("http://www.cocacolazero.com/", "_blank");
}
Symbol 94 MovieClip [Messaging] Frame 1
stop();
Symbol 94 MovieClip [Messaging] Frame 5
stop();
Symbol 94 MovieClip [Messaging] Frame 80
stop();
scripts.endGameCB("touchdown");
gameApp.grid._visible = true;
Symbol 94 MovieClip [Messaging] Frame 155
stop();
scripts.endGameCB("field goal");
gameApp.grid._visible = true;
Symbol 94 MovieClip [Messaging] Frame 230
stop();
Symbol 94 MovieClip [Messaging] Frame 305
if (gameApp.tackledOnce < 3) {
gotoAndPlay ("hitST");
} else {
stop();
}
Symbol 94 MovieClip [Messaging] Frame 390
stop();
scripts.endGameCB("posession");
Symbol 94 MovieClip [Messaging] Frame 492
stop();
scripts.endGameCB("punt");
Symbol 94 MovieClip [Messaging] Frame 567
stop();
scripts.endGameCB("timeoutScore");
gameApp.grid._visible = true;
Symbol 94 MovieClip [Messaging] Frame 642
stop();
scripts.endGameCB("timeoutScore");
gameApp.grid._visible = true;
Symbol 94 MovieClip [Messaging] Frame 700
stop();
Symbol 94 MovieClip [Messaging] Frame 745
stop();
Symbol 94 MovieClip [Messaging] Frame 818
if (gameApp.tackledOnce < 3) {
gotoAndPlay ("hitST");
} else {
stop();
}
Symbol 133 Button
on (release) {
scripts.updatePlayer("down");
}
on (rollOver) {
if (scripts.powerOn) {
if (scripts.playActive == false) {
cHelpDown.doRollOver();
}
}
}
on (rollOut) {
cHelpDown.doRollOut();
}
Symbol 134 Button
on (release) {
scripts.updatePlayer("up");
}
on (rollOver) {
if (scripts.powerOn) {
if (scripts.playActive == false) {
cHelpUp.doRollOver();
}
}
}
on (rollOut) {
cHelpUp.doRollOut();
}
Symbol 135 Button
on (release) {
scripts.updatePlayer("fore");
}
on (rollOver) {
if (scripts.powerOn) {
if (scripts.playActive == false) {
cHelpForward.doRollOver();
}
}
}
on (rollOut) {
cHelpForward.doRollOut();
}
Symbol 138 Button
on (release) {
if (_global.showingInterstitials == false) {
scripts.fieldGoalAttempt();
}
}
on (rollOver) {
if (_global.showingInterstitials == false) {
if ((scripts.playActive == false) && (gameApp.down == 4)) {
if (gameApp.playerActive == 1) {
distanceToGoal = 100 - gameApp.fieldPosition;
} else {
distanceToGoal = gameApp.fieldPosition;
}
if (distanceToGoal > 65) {
cHelpPunt.doRollOver();
} else {
cHelpFieldGoal.doRollOver();
}
}
}
}
on (rollOut) {
if (gameApp.playerActive == 1) {
distanceToGoal = 100 - gameApp.fieldPosition;
} else {
distanceToGoal = gameApp.fieldPosition;
}
if (distanceToGoal > 65) {
cHelpPunt.doRollOut();
} else {
cHelpFieldGoal.doRollOut();
}
glow_k._visible = false;
}
Symbol 141 Button
on (press) {
if (_global.showingInterstitials == false) {
if (scripts.playActive == false) {
scripts.playReady = false;
scripts.displayHUD("score");
}
}
}
on (release, releaseOutside) {
if (_global.showingInterstitials == false) {
scripts.hideHUD();
if ((scripts.playReady == false) && (scripts.gameOn == true)) {
scripts.setupPlay();
}
}
}
on (rollOver) {
if (_global.showingInterstitials == false) {
if (scripts.playActive == false) {
cHelpScore.doRollOver();
}
}
glow_st._visible = false;
glow_sc._visible = false;
glow_k._visible = false;
}
on (rollOut) {
cHelpScore.doRollOut();
}
Symbol 144 Button
on (press) {
if (_global.showingInterstitials == false) {
if (scripts.playActive == false) {
scripts.playReady = false;
scripts.displayHUD("stats");
}
}
}
on (release, releaseOutside) {
if (_global.showingInterstitials == false) {
scripts.hideHUD();
if ((scripts.playReady == false) && (scripts.gameOn == true)) {
scripts.setupPlay();
}
}
}
on (rollOver) {
if (_global.showingInterstitials == false) {
if (scripts.playActive == false) {
cHelpStatus.doRollOver();
}
}
glow_st._visible = false;
glow_sc._visible = false;
glow_k._visible = false;
}
on (rollOut) {
cHelpStatus.doRollOut();
}
Symbol 152 Button
on (release) {
scripts.toggleSettings();
}
Symbol 155 Button
on (release) {
scripts.toggleSound();
}
Symbol 168 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 1
Instance of Symbol 168 MovieClip "settingSwitch" in Symbol 174 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 171 MovieClip "soundSwitch" in Symbol 174 MovieClip Frame 1
on (release) {
scripts.toggleSound();
}
onClipEvent (load) {
trace("soundSwitch here" + _global.mute);
if (_global.mute) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
scripts.muteSound(_global.mute);
}
Symbol 182 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 182 MovieClip Frame 27
stop();
Symbol 182 MovieClip Frame 43
gotoAndStop ("idle");
Symbol 189 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 1
stop();
this._visible = false;
Symbol 202 MovieClip Frame 16
stop();
Symbol 205 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 205 MovieClip Frame 27
stop();
Symbol 205 MovieClip Frame 43
gotoAndStop ("idle");
Instance of Symbol 60 MovieClip in Symbol 211 MovieClip [instructions_ingame2] Frame 1
onClipEvent (load) {
this.useHandCursor = false;
this.enabled = false;
}
on (press) {
}
Instance of Symbol 168 MovieClip "settingSwitch" in Symbol 211 MovieClip [instructions_ingame2] Frame 1
/* no clip actions */
Instance of Symbol 171 MovieClip "soundSwitch" in Symbol 211 MovieClip [instructions_ingame2] Frame 1
on (release) {
scripts.toggleSound();
}
onClipEvent (load) {
trace("soundSwitch here" + _global.mute);
if (_global.mute) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
scripts.muteSound(_global.mute);
}
Symbol 211 MovieClip [instructions_ingame2] Frame 34
stop();
getURL ("javascript:dcsMultiTrack('DCS.dcsuri','/ff/classicInstructions1','WT.cg_n','FantasyFootball','WT.ti','FF:Classic Instructions1');");
next_btn.onRelease = function () {
gotoAndPlay ("page2");
};
next_btn.onRollOver = function () {
this.gotoAndPlay("over");
};
next_btn.onRollOut = function () {
this.gotoAndPlay("out");
};
return1_btn.onRelease = function () {
gotoAndPlay ("exit page 1");
};
return1_btn.onRollOver = function () {
this.gotoAndPlay("over");
};
return1_btn.onRollOut = function () {
this.gotoAndPlay("out");
};
Symbol 211 MovieClip [instructions_ingame2] Frame 61
stop();
getURL ("javascript:dcsMultiTrack('DCS.dcsuri','/ff/classicInstructions2','WT.cg_n','FantasyFootball','WT.ti','FF:Classic Instructions2');");
return_btn.onRelease = function () {
gotoAndPlay ("exit page 2");
};
return_btn.onRollOver = function () {
this.gotoAndPlay("over");
};
return_btn.onRollOut = function () {
this.gotoAndPlay("out");
};
back_btn.onRelease = function () {
gotoAndPlay ("return page 1");
};
back_btn.onRollOver = function () {
this.gotoAndPlay("over");
};
back_btn.onRollOut = function () {
this.gotoAndPlay("out");
};
Symbol 211 MovieClip [instructions_ingame2] Frame 84
gameApp.showingInterstitials = false;
stop();
this.removeMovieClip();
Instance of Symbol 60 MovieClip in Symbol 211 MovieClip [instructions_ingame2] Frame 102
onClipEvent (load) {
this.useHandCursor = false;
this.enabled = false;
}
on (press) {
}
Symbol 211 MovieClip [instructions_ingame2] Frame 107
gameApp.showingInterstitials = false;
stop();
this.removeMovieClip();
Symbol 211 MovieClip [instructions_ingame2] Frame 108
Symbol 211 MovieClip [instructions_ingame2] Frame 133
gotoAndStop (34);
Symbol 223 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 223 MovieClip Frame 27
stop();
Symbol 223 MovieClip Frame 43
gotoAndStop ("idle");
Symbol 239 Button
on (press) {
gotoAndPlay ("expand");
}
Symbol 241 MovieClip [timePopUp] Frame 1
#initclip 7
Object.registerClass("timePopUp", TimePopUp);
#endinitclip
stop();
SetExpandButton();
Symbol 241 MovieClip [timePopUp] Frame 9
stop();
SetTimes();
Symbol 241 MovieClip [timePopUp] Frame 18
gotoAndPlay (1);
Instance of Symbol 168 MovieClip "settingSwitch" in Symbol 242 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 171 MovieClip "soundSwitch" in Symbol 242 MovieClip Frame 1
on (release) {
scripts.toggleSound();
}
onClipEvent (load) {
trace("soundSwitch here" + _global.mute);
if (_global.mute) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
scripts.muteSound(_global.mute);
}
Instance of Symbol 176 MovieClip in Symbol 242 MovieClip Frame 28
onClipEvent (load) {
this.useHandCursor = false;
this.enabled = false;
}
on (press) {
}
Symbol 242 MovieClip Frame 58
stop();
kickoff_btn.onRollOver = function () {
this.gotoAndPlay("over");
};
kickoff_btn.onRollOut = function () {
this.gotoAndPlay("out");
};
kickoff_btn.onPress = function () {
play();
};
Symbol 242 MovieClip Frame 77
_parent.gotoAndPlay("GAME");
Instance of Symbol 245 MovieClip in Symbol 250 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 250 MovieClip Frame 3
stop();
Symbol 250 MovieClip Frame 22
stop();
Symbol 250 MovieClip Frame 32
Symbol 250 MovieClip Frame 43
stop();
Symbol 259 MovieClip Frame 1
stop();
Instance of Symbol 254 MovieClip "timer" in Symbol 259 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this.timerOn) {
var currtime = getTimer();
elapsedTime = (currtime - this.startTime) + this.bakTime;
timeSinceBeginning = (currtime - this.startTime) + this.gameStartTime;
totalSeconds = _parent._parent.DetermineQuarterLength() - Math.floor(elapsedTime / 1000);
if (totalSeconds < 0) {
totalSeconds = 0;
gameApp.clockRanOut = true;
return(undefined);
}
myHours = Math.floor(totalSeconds / 3600);
minSeconds = totalSeconds - (myHours * 3600);
myMinutes = Math.floor(minSeconds / 60);
mySeconds = minSeconds - (myMinutes * 60);
if (mySeconds < 10) {
mySeconds = "0" + String(mySeconds);
}
this.displayHour = myHours;
this.displayMin = myMinutes;
this.displaySec = mySeconds;
_parent.displayMin = myMinutes;
_parent.displaySec = mySeconds;
gameApp.cTimer.text = (myMinutes + ":") + mySeconds;
}
}
Symbol 262 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 40
stop();
Symbol 276 MovieClip Frame 1
stop();
Instance of Symbol 268 MovieClip in Symbol 276 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 282 Button
on (release) {
scripts.initGame(1);
}
Symbol 283 Button
on (release) {
scripts.initGame(2);
}
Symbol 284 Button
on (release) {
trace("sound on");
scripts.muteSound(false);
}
Symbol 285 Button
on (release) {
scripts.muteSound(true);
}
Symbol 288 MovieClip Frame 1
gotoAndStop ("idle");
Symbol 288 MovieClip Frame 27
stop();
Symbol 288 MovieClip Frame 43
gotoAndStop ("idle");
Symbol 290 MovieClip [game] Frame 1
getURL ("javascript:dcsMultiTrack('DCS.dcsuri','/ff/playClassic','WT.cg_n','FantasyFootball','WT.ti','FF:Play Classic Football');");
cHowToPlay.onRelease = function () {
if (scripts.powerOn && (playActive == false)) {
this.gotoAndStop("idle");
attachMovie("instructions_ingame2", "instr", 100);
this.enabled = true;
}
};
cHowToPlay.onRollOver = function () {
this.gotoAndPlay("over");
};
cHowToPlay.onRollOut = function () {
this.gotoAndPlay("out");
};
cSendToFriends.onRelease = function () {
if (scripts.powerOn && (playActive == false)) {
this.gotoAndStop("idle");
this.enabled = true;
this.useHandCursor = true;
_level0.ffgamesSend.show();
getURL ("javascript:dcsMultiTrack('DCS.dcsuri','/ff/classicSend','WT.cg_n','FantasyFootball','WT.ti','FF:Classic Send to Friend');");
} else {
this.useHandCursor = false;
}
};
cSendToFriends.onRollOver = function () {
this.gotoAndPlay("over");
};
cSendToFriends.onRollOut = function () {
this.gotoAndPlay("out");
};
function initBaddyTimer(timerLength) {
var _local2 = timerLength;
intervalId = setInterval(this, "executeCallback", _local2);
gameApp.doBaddyAI = false;
}
function executeCallback() {
oppNum = 1;
gameApp.doBaddyAI = true;
}
function baddyAI() {
myNum = gameApp.oppNum;
var correctDir;
var makeMove = false;
myLoc = eval (("opp" + myNum) + "Loc");
if (myLoc[0] > playerLoc[0]) {
correctDir = 1;
myDir = randomIn(1, 3);
if (correctDir == myDir) {
makeMove = true;
}
} else if (myLoc[0] < playerLoc[0]) {
correctDir = 4;
myDir = randomIn(2, 4);
if (correctDir == myDir) {
makeMove = true;
}
}
if ((myLoc[0] == playerLoc[0]) || (makeMove == false)) {
if (myLoc[1] > playerLoc[1]) {
correctDir = 2;
myDir = randomIn(1, 4);
} else {
correctDir = 3;
myDir = randomIn(2, 4);
}
}
if (myDir == correctDir) {
if (myDir == 1) {
oppX = myLoc[0] - 1;
oppY = myLoc[1];
}
if (myDir == 2) {
oppX = myLoc[0];
oppY = myLoc[1] - 1;
}
if (myDir == 3) {
oppX = myLoc[0];
oppY = myLoc[1] + 1;
}
if (myDir == 4) {
oppX = myLoc[0] + 1;
oppY = myLoc[1];
}
} else {
oppX = myLoc[0];
oppY = myLoc[1];
}
if (oppX < 0) {
oppX = 0;
}
if (oppX > 8) {
oppX = 8;
}
if (oppY < 0) {
oppY = 0;
}
if (oppY > 2) {
oppY = 2;
}
moveAllowed = checkOpponantMove(myNum, oppX, oppY);
moveTackle = checkOpponantTackle(myNum, oppX, oppY);
if ((moveAllowed == true) && (moveTackle == false)) {
moveOpponant(myNum, oppX, oppY);
}
if (moveTackle) {
trace("baddy iniitated tackle");
showTackle(myLoc[0], myLoc[1]);
trace("calling endplay");
endPlay();
}
if (myNum < 6) {
gameApp.oppNum = gameApp.oppNum + 1;
scripts.newBaddyTime = getTimer() + 85;
} else {
gameApp.oppNum = 0;
gameApp.doBaddyAI = false;
}
}
function moveOpponant(oppNum, newX, newY) {
oppArray = eval (("opp" + oppNum) + "Loc");
oldCell = eval ((("gameApp.grid.cell_" + oppArray[0]) + "_") + oppArray[1]);
oldCell.gotoAndStop(1);
newCell = eval ((("gameApp.grid.cell_" + newX) + "_") + newY);
newCell.gotoAndStop(3);
oppArray[0] = newX;
oppArray[1] = newY;
}
function showTackle(tX, tY) {
tackleCell = eval ((("gameApp.grid.cell_" + tX) + "_") + tY);
tackleCell.gotoAndStop(4);
}
function checkOpponantMove(oppNum, propX, propY) {
moveOK = true;
n = 1;
while (n < 6) {
if (n == oppNum) {
} else {
oppArray = eval (("opp" + n) + "Loc");
if ((propX == oppArray[0]) && (propY == oppArray[1])) {
moveOK = false;
}
}
n++;
}
return(moveOK);
}
function checkOpponantTackle(oppNum, propX, propY) {
oppTackle = false;
oppArray = eval (("opp" + oppNum) + "Loc");
if ((propX == playerLoc[0]) && (propY == playerLoc[1])) {
oppTackle = true;
}
return(oppTackle);
}
var intervalId;
trace("button=" + this.cAButton);
trace("gameApp=" + gameApp);
var myListener = this.createEmptyMovieClip("myListener", 500);
myListener.currentKey = 0;
myListener.lock = false;
myListener.forwardLock = false;
myListener.keyQueue = new Array();
myListener.doKeyUp = function (myKey) {
myKey = Key.getCode();
if ((myKey == 81) || (myKey == 65)) {
scripts.hideHUD();
if ((scripts.playReady == false) && (scripts.gameOn == true)) {
scripts.setupPlay();
gameApp.cAButtonDown._alpha = 0;
gameApp.cQButtonDown._alpha = 0;
}
}
if ((myKey == 37) || (myKey == 39)) {
forwardLock = false;
}
gameApp.cUpButtonDown._alpha = 0;
gameApp.cDownButtonDown._alpha = 0;
gameApp.cSButtonDown._alpha = 0;
gameApp.cSideButtonDown._alpha = 0;
};
myListener.onKeyDown = function () {
myKey = Key.getCode();
myListener.keyQueue.unshift(myKey);
trace(myListener.keyQueue);
if (myListener.keyQueue.length > 3) {
myListener.keyQueue.pop();
}
};
myListener.onEnterFrame = function () {
if (myListener.keyQueue.length == 0) {
if (Key.isDown(myListener.currentKey)) {
if (Key.isDown(65) || (Key.isDown(81))) {
myKey = myListener.currentKey;
} else {
myKey = 0;
}
} else {
myKey = 0;
}
} else {
myKey = myListener.keyQueue.pop();
}
if (_global.showingInterstitials == true) {
return(undefined);
}
if (myListener.lock == true) {
trace("re-entrant lock... sorry");
return(undefined);
}
myListener.lock = true;
oldKey = myListener.currentKey;
if (oldKey != myKey) {
myListener.doKeyUp(oldKey);
}
if ((myKey == 81) && (!Key.isDown(65))) {
myListener.currentKey = myKey;
if (scripts.playActive == false) {
scripts.playReady = false;
scripts.displayHUD("stats");
gameApp.cQButtonDown._alpha = 100;
gameApp.glow_st._visible = false;
gameApp.glow_sc._visible = false;
if (down == 4) {
gameApp.glow_k._visible = true;
}
}
} else if ((myKey == 65) && (!Key.isDown(81))) {
myListener.currentKey = myKey;
if (scripts.playActive == false) {
scripts.playReady = false;
scripts.displayHUD("score");
gameApp.cAButtonDown._alpha = 100;
gameApp.glow_st._visible = false;
gameApp.glow_sc._visible = false;
if (down == 4) {
gameApp.glow_k._visible = true;
}
}
} else if (myKey == 75) {
oldKey = myListener.currentKey;
myListener.currentKey = myKey;
if (scripts.powerOn && (playReady == true)) {
scripts.fieldGoalAttempt();
gameApp.cSButtonDown._alpha = 100;
gameApp.glow_k._visible = false;
}
}
if (playReady == true) {
oldKey = myListener.currentKey;
myListener.currentKey = myKey;
if ((myKey == 37) && (!forwardLock)) {
if (scripts.playerActive == 2) {
scripts.updatePlayer("fore");
gameApp.cSideButtonDown._alpha = 100;
forwardLock = true;
}
}
if ((myKey == 39) && (!forwardLock)) {
if (scripts.playerActive == 1) {
scripts.updatePlayer("fore");
gameApp.cSideButtonDown._alpha = 100;
forwardLock = true;
}
}
if (myKey == 38) {
scripts.updatePlayer("up");
gameApp.cUpButtonDown._alpha = 100;
}
if (myKey == 40) {
scripts.updatePlayer("down");
gameApp.cDownButtonDown._alpha = 100;
}
}
myListener.lock = false;
};
Key.addListener(myListener);
function updatePlayer(playerCode) {
if ((playReady == true) && (playActive == false)) {
startPlay();
}
if (playActive == true) {
if (playerCode == "fore") {
newX = playerLoc[0] + foreIncrement;
newY = playerLoc[1];
}
if (playerCode == "up") {
newX = playerLoc[0];
newY = playerLoc[1] - 1;
}
if (playerCode == "down") {
newX = playerLoc[0];
newY = playerLoc[1] + 1;
}
if (newX > 8) {
newX = 0;
}
if (newX < 0) {
newX = 8;
}
tackled = checkPlayerCollide(newX, newY);
if (((tackled == false) && (newY <= 2)) && (newY >= 0)) {
movePlayer(newX, newY);
if (playerCode == "fore") {
fieldPosition = Number(fieldPosition) + foreIncrement;
trace("fp=" + fieldPosition);
newYardsToGo = yardsToGo - 1;
if (newYardsToGo <= 0) {
newYardsToGo = 0;
firstDownAchieved = true;
}
yardsToGo = newYardsToGo;
if (playerActive == 1) {
if (fieldPosition >= 100) {
touchDownAchieved = true;
trace("endPlay called from updatePlayer:52");
endPlay();
}
}
if (playerActive == 2) {
if (fieldPosition <= 0) {
touchDownAchieved = true;
trace("endPlay called from updatePlayer:60");
endPlay();
}
}
}
}
if (tackled == true) {
showTackle(newX, newY);
trace("endPlay called from updatePlayer:70");
endPlay();
}
gameApp.cFieldPosition.text = fieldPosition;
gameApp.cQuarter.text = gameApp.currentQuarter;
}
}
function movePlayer(newX, newY) {
oldCell = eval ((("gameApp.grid.cell_" + playerLoc[0]) + "_") + playerLoc[1]);
oldCell.gotoAndStop(1);
newCell = eval ((("gameApp.grid.cell_" + newX) + "_") + newY);
newCell.gotoAndStop(2);
playerLoc[0] = newX;
playerLoc[1] = newY;
}
function DetermineRank(ticker) {
trace("RUN " + _global.longestRun);
ticker.setMask(ticker._parent.textMask);
ticker.benchwarmer._visible = (ticker.starter._visible = (ticker.probowler._visible = (ticker.halloffamer._visible = (ticker.legend._visible = false))));
ticker.quickTD.text = _global.quickestTouchdown;
ticker.longestRun.text = _global.longestRun;
ticker.numDowns.text = _global.numDowns;
var _local3 = _global.playerOneScore + _global.playerTwoScore;
if (int(_local3) < 28) {
ticker.rank.text = "BENCHWARMER";
ticker.benchwarmer._visible = true;
} else if (int(_local3) < 56) {
ticker.rank.text = "STARTER";
ticker.starter._visible = true;
} else if (int(_local3) < 84) {
ticker.rank.text = "PRO BOWLER";
ticker.probowler._visible = true;
} else if (int(_local3) < 112) {
ticker.rank.text = "HALL OF FAMER";
ticker.halloffamer._visible = true;
} else {
ticker.rank.text = "LEGEND";
ticker.legend._visible = true;
}
}
function setupPlay() {
trace("CURRENT QUARTER: " + gameApp.currentQuarter);
clearGrid();
firstDownAchieved = false;
kickAttempted = false;
if (playerActive == 1) {
foreIncrement = 1;
movePlayer(0, 1);
moveOpponant(1, 3, 0);
moveOpponant(2, 3, 1);
moveOpponant(3, 3, 2);
moveOpponant(4, 5, 1);
moveOpponant(5, 8, 1);
}
if (playerActive == 2) {
foreIncrement = -1;
movePlayer(8, 1);
moveOpponant(1, 5, 0);
moveOpponant(2, 5, 1);
moveOpponant(3, 5, 2);
moveOpponant(4, 2, 1);
moveOpponant(5, 0, 1);
}
playReady = true;
}
function moveUp() {
if (gameApp.cHowToPlay._alpha < 70) {
gameApp.cDisabler._visible = true;
this.onEnterFrame = null;
}
}
function moveDown() {
gameApp.cHowToPlay._alpha = gameApp.cHowToPlay._alpha + 2;
if (gameApp.cHowToPlay._alpha >= 100) {
this.onEnterFrame = null;
gameApp.cHowToPlay._alpha = 100;
gameApp.cDisabler._visible = false;
}
}
function startPlay() {
trace("start play");
showMessaging("blank");
gameApp.startPosition = fieldPosition;
touchDownAchieved = false;
fieldGoalAchieved = false;
testMessage = "";
playActive = true;
if (gameApp.levelPlay == 1) {
initBaddyTimer(1500);
} else if (gameApp.levelPlay == 2) {
initBaddyTimer(750);
}
gameApp.score.timer.startTime = getTimer();
gameApp.score.timer.timerOn = true;
gameApp.soundMC.gotoAndStop("clock");
gameApp.glow_k._visible = false;
gameApp.glow_directional._visible = false;
moveButtonsMC.onEnterFrame = moveUp;
}
function fieldGoalAttempt() {
trace("attempting kick");
if (playReady == true) {
if (playActive == false) {
if (gameApp.down == 4) {
if (playerActive == 1) {
distanceToGoal = 100 - gameApp.fieldPosition;
} else {
distanceToGoal = gameApp.fieldPosition;
}
if (distanceToGoal <= 40) {
gameApp.playActive = false;
fieldGoalAchieved = true;
trace("endplay called from fieldGoalAttempt:133");
endPlay();
} else {
trace("not close enough for a kick, do a punt instead");
kickAttempted = true;
if (playerActive == 1) {
newFieldPos = gameApp.fieldPosition + randomIn(15, 55);
if (newFieldPos > 100) {
newFieldPos = 80;
}
gameApp.fieldPosition = newFieldPos;
trace("kicked to:" + newFieldPos);
}
if (playerActive == 2) {
newFieldPos = gameApp.fieldPosition - randomIn(15, 55);
if (newFieldPos < 0) {
newFieldPos = 20;
}
gameApp.fieldPosition = newFieldPos;
trace("kicked to:" + newFieldPos);
}
trace("endplay called from fieldGoalAttempt:158");
endPlay();
}
} else {
trace("not fourth down");
}
} else {
trace("play already active...");
}
} else {
trace("play not ready yet");
}
}
function endPlay() {
trace("endPlay");
moveButtonsMC.onEnterFrame = moveDown;
trace("elapsed time = " + gameApp.score.timer.elapsedTime);
trace("time since beginning = " + gameApp.score.timer.timeSinceBeginning);
trace("gameApp.currentTouchdown=" + gameApp.currentTouchdown);
playReady = false;
playActive = false;
gameApp.soundMC.gotoAndStop("none");
gameApp.doBaddyAI = false;
gameApp.score.timer.bakTime = gameApp.score.timer.elapsedTime;
gameApp.score.timer.gameStartTime = gameApp.score.timer.timeSinceBeginning;
gameApp.score.timer.timerOn = false;
var _local1 = Math.abs(fieldPosition - gameApp.startPosition);
gameApp.cYardsGained.text = _local1;
if (_local1 > gameApp.longestRun) {
gameApp.longestRun = _local1;
trace("new longest run = " + _local1);
}
gameApp.numDowns++;
trace(gameApp.numDowns);
clearInterval(intervalId);
if (gameOn) {
if (touchDownAchieved == true) {
trace("TOUCHDOWN");
gameApp.grid._visible = false;
var _local2 = int((Number(gameApp.score.timer.timeSinceBeginning) - gameApp.currentTouchdown) / 1000);
gameApp.currentTouchdown = gameApp.score.timer.timeSinceBeginning;
trace("time it took:" + _local2);
if (_local2 < gameApp.quickestTouchdown) {
gameApp.quickestTouchdown = _local2;
trace("quickestTouchdown = " + gameApp.quickestTouchdown);
}
gameApp.soundMC.gotoAndPlay("score");
if (playerActive == 1) {
playerOneScore = playerOneScore + 7;
}
if (playerActive == 2) {
playerTwoScore = playerTwoScore + 7;
}
if (gameApp.clockRanOut == true) {
showMessaging("touchdownQuarter");
} else {
showMessaging("touchdown");
}
} else if (fieldGoalAchieved) {
trace("play score sound for field goal");
gameApp.grid._visible = false;
gameApp.soundMC.gotoAndPlay("score");
if (playerActive == 1) {
playerOneScore = playerOneScore + 3;
}
if (playerActive == 2) {
playerTwoScore = playerTwoScore + 3;
}
if (gameApp.clockRanOut == true) {
showMessaging("fieldgoalQuarter");
} else {
showMessaging("field goal");
}
} else if (kickAttempted == true) {
trace("play kick sound at new down");
gameApp.soundMC.gotoAndPlay("switch");
if (gameApp.clockRanOut == true) {
endGameCB("timeout");
} else {
showMessaging("punt");
}
} else if (firstDownAchieved) {
newDown();
trace("play tackle sound at new down");
gameApp.soundMC.gotoAndPlay("tackle");
if (gameApp.clockRanOut == true) {
endGameCB("timeout");
} else {
showMessaging("first down");
gameApp.glow_st._visible = true;
}
} else {
down = down + 1;
if (gameApp.clockRanOut == true) {
if (down > 4) {
gameApp.soundMC.gotoAndPlay("switch");
} else {
gameApp.soundMC.gotoAndPlay("tackle");
}
endGameCB("timeout");
return(undefined);
}
if (down > 4) {
trace("4th down turnover... play the sound");
gameApp.soundMC.gotoAndPlay("switch");
showMessaging("turnover");
} else {
trace("play tackle sound");
gameApp.glow_st._visible = true;
gameApp.soundMC.gotoAndPlay("tackle");
showMessaging("tackled");
gameApp.tackledOnce = gameApp.tackledOnce + 1;
trace("tackled = " + gameApp.tackledOnce);
}
}
}
}
function showMessaging(msg) {
switch (msg) {
case "turnover" :
case "punt" :
case "touchdown" :
case "touchdownQuarter" :
case "field goal" :
case "fieldgoalQuarter" :
posNum++;
trace("++++++++++++++++++ two player info");
trace("current quarter = " + gameApp.currentQuarter);
trace("current mins = " + gameApp.score.timer.displayMin);
trace("current seconds = " + gameApp.score.timer.displaySec);
trace("home score = " + playerOneScore);
trace("away scrore = " + playerTwoScore);
trace("label = " + this.labelText);
trace("label text = " + this.labelText.text);
trace("longest run = " + gameApp.longestRun);
trace("quickestTouchdown = " + gameApp.quickestTouchdown);
trace("number of downs = " + gameApp.numDowns);
trace("player active = " + gameApp.playerActive);
trace("number of possessions = " + gameApp.posNum);
trace("time elapsed = " + gameApp.score.timer.elapsedTime);
trace("time since beginning = " + gameApp.score.timer.timeSinceBeginning);
trace("gameApp.currentTouchdown = " + gameApp.currentTouchdown);
trace("quarter length = " + _global.quarterLength);
trace("++++++++++++++++++ two player info");
_global.showingInterstitials = true;
}
gameApp.cMessaging.gotoAndPlay(msg);
}
function InterstitialsCB(msg) {
trace("InterstitialsCB = " + msg);
switch (msg) {
case "posession" :
case "punt" :
turnOverForce();
break;
case "touchdown" :
case "field goal" :
turnOver();
break;
case "quarter" :
if (gameApp.currentQuarter == 3) {
turnOver();
gameApp.playerActive = 2;
} else if (down > 4) {
turnOverForce();
}
ResetClock(false);
break;
case "quarterScore" :
turnOver();
if (gameApp.currentQuarter == 3) {
gameApp.playerActive = 2;
}
ResetClock(false);
}
setupPlay();
}
function ShowInterstitials(endOf) {
var _local4 = ["1st", "2nd", "3rd", "4th"];
var _local5 = false;
this.interstitials.removeMovieClip();
attachMovie("interstitials", "interstitials", 150, {mCB:InterstitialsCB, mMsg:endOf});
this.interstitials.gotoAndPlay(1);
this.interstitials.ticker._visible = false;
this.interstitials.tickerContainer._visible = false;
var _local3 = "ST";
if (gameApp.currentQuarter == 2) {
_local3 = "ND";
} else if (gameApp.currentQuarter == 3) {
_local3 = "RD";
} else if (gameApp.currentQuarter == 4) {
_local3 = "TH";
}
if ((((endOf == "posession") || (endOf == "punt")) || (endOf == "touchdown")) || (endOf == "field goal")) {
_local5 = true;
trace(this.interstitials.labelText);
this.interstitials.labelText.text = ((((gameApp.currentQuarter + _local3) + " QTR ") + gameApp.score.timer.displayMin) + ":") + gameApp.score.timer.displaySec;
} else if ((endOf == "quarter") || (endOf == "quarterScore")) {
this.interstitials.labelText.text = ("END OF " + _local4[gameApp.currentQuarter - 2]) + " QUARTER";
} else if (endOf == "game") {
this.interstitials.labelText.text = "FINAL";
}
this.interstitials.homeScore.text = playerOneScore;
this.interstitials.visitorScore.text = playerTwoScore;
if (endOf != "game") {
this.interstitials.ticker._visible = true;
} else {
this.interstitials.gotoAndPlay(15);
DetermineRank(this.interstitials.tickerContainer.scrollingTicker);
this.interstitials.tickerContainer.scrollingTicker.onEnterFrame = tinymantis.Delegate.create(this, ScrollTicker);
this.interstitials.tickerContainer._visible = true;
}
}
function ScrollTicker() {
ticker = this.interstitials.tickerContainer.scrollingTicker;
if (ticker._visible) {
if (ticker._x <= (ticker._width * -1)) {
ticker._x = 500;
}
ticker._x = ticker._x - 2;
}
}
function endGameCB(msg) {
if (msg == null) {
throw new Error("msg is empty");
}
trace("endGameCB msg=" + msg);
switch (msg) {
case "timeout" :
if (gameApp.currentQuarter == 4) {
endGame();
} else {
trace("end of quarter " + gameApp.currentQuarter);
gameApp.currentQuarter++;
ShowInterstitials("quarter");
trace("gameApp.currentQuarter=" + gameApp.currentQuarter);
}
break;
case "timeoutScore" :
if (gameApp.currentQuarter == 4) {
endGame();
} else {
trace("end of quarter + a score" + gameApp.currentQuarter);
gameApp.currentQuarter++;
ShowInterstitials("quarterScore");
trace("gameApp.currentQuarter=" + gameApp.currentQuarter);
}
break;
case "touchdown" :
ShowInterstitials("touchdown");
break;
case "posession" :
ShowInterstitials("posession");
break;
case "punt" :
ShowInterstitials("punt");
break;
case "field goal" :
ShowInterstitials("field goal");
}
}
function checkPlayerCollide(newX, newY) {
playerTackled = false;
if ((newX == opp1Loc[0]) && (newY == opp1Loc[1])) {
playerTackled = true;
}
if ((newX == opp2Loc[0]) && (newY == opp2Loc[1])) {
playerTackled = true;
}
if ((newX == opp3Loc[0]) && (newY == opp3Loc[1])) {
playerTackled = true;
}
if ((newX == opp4Loc[0]) && (newY == opp4Loc[1])) {
playerTackled = true;
}
if ((newX == opp5Loc[0]) && (newY == opp5Loc[1])) {
playerTackled = true;
}
return(playerTackled);
}
var moveButtonsMC = this.createEmptyMovieClip("moveButtonsMC", 600);
function initGame(proLevel) {
trace("init game");
trace("cMessaging = " + gameApp.cMessaging);
gameOn = false;
playReady = false;
playActive = false;
trace("endPlay called from initGame");
endPlay();
clearGrid();
doBaddyAI = false;
if (proLevel == 1) {
gameApp.levelPlay = 1;
trace("set switch to 1");
gameApp.settingSwitch.gotoAndStop(1);
scripts.powerOn = true;
}
if (proLevel == 2) {
gameApp.levelPlay = 2;
trace("set switch to 2");
gameApp.settingSwitch.gotoAndStop(2);
scripts.powerOn = true;
}
if (proLevel == 3) {
gameApp.levelPlay = 3;
gameApp.settingSwitch.gotoAndStop(3);
scripts.powerOn = false;
}
trace("+++++++++++ set two player variables");
gameOn = false;
playerOneScore = 0;
playerTwoScore = 0;
playerActive = 1;
if (scripts.powerOn) {
playerLoc = new Array(0, 0);
opp1Loc = new Array(0, 0);
opp2Loc = new Array(0, 0);
opp3Loc = new Array(0, 0);
opp4Loc = new Array(0, 0);
opp5Loc = new Array(0, 0);
gameApp.grid._visible = true;
gameOn = true;
gameApp.currentQuarter = 1;
ResetClock(true);
newPosession();
gameApp.tackledOnce = 0;
gameApp.possessionLeft = false;
gameApp.posNum = 0;
showMessaging("hitArrow");
gameApp.longestRun = 0;
gameApp.startPosition = 0;
gameApp.numDowns = 0;
gameApp.quickestTouchdown = 10000;
gameApp.currentTouchdown = 0;
gameApp.glow_st._visible = false;
gameApp.glow_sc._visible = false;
gameApp.glow_k._visible = false;
gameApp.glow_directional._visible = true;
_global.showingInterstitials = false;
gameApp.cDisabler._visible = false;
setupPlay();
} else {
gameApp.grid._visible = false;
}
gameApp.onEnterFrame = function () {
if (gameApp.doBaddyAI) {
if (getTimer() >= scripts.newBaddyTime) {
scripts.baddyAI();
}
}
};
}
function DetermineQuarterLength() {
switch (_global.quarterLength) {
case 1 :
return(150);
case 2 :
return(180);
case 2.5 :
return(300);
}
}
function ResetClock(newGame) {
if (newGame) {
gameApp.score.timer.timeSinceBeginning = 0;
gameApp.score.timer.gameStartTime = 0;
}
gameApp.score.timer.bakTime = 0;
gameApp.score.timer.totalSeconds = DetermineQuarterLength();
gameApp.setClockDisplay(gameApp.score.timer.totalSeconds);
gameApp.clockRanOut = false;
}
function setClockDisplay(inSeconds) {
trace("inSeconds=" + inSeconds);
var _local2 = int(inSeconds / 60);
var _local1 = inSeconds % 60;
gameApp.score.timer.displayMin = (gameApp.score.displayMin = ((_local2 < 10) ? (" " + _local2) : (_local2)));
gameApp.score.timer.displaySec = (gameApp.score.displaySec = ((_local1 < 10) ? ("0" + _local1) : (_local1)));
}
function endGame() {
_global.longestRun = gameApp.longestRun;
_global.numDowns = gameApp.numDowns;
_global.playerOneScore = gameApp.playerOneScore;
_global.playerTwoScore = gameApp.playerTwoScore;
if (gameApp.quickestTouchdown == 10000) {
_global.quickestTouchdown = "0:00";
} else {
var _local2 = int(gameApp.quickestTouchdown % 60);
_global.quickestTouchdown = (int(gameApp.quickestTouchdown / 60) + ":") + ((_local2 < 10) ? ("0" + _local2) : (_local2));
}
ShowInterstitials("game");
trace("game over");
}
function newPosession() {
testMessage = "new posession";
fieldPosition = 20;
newDown();
}
function turnOver() {
trace("turnOver");
testMessage = "turnOver, setting up at players 20 yard line";
if (scripts.playerActive == 1) {
scripts.playerActive = 2;
fieldPosition = 80;
} else {
scripts.playerActive = 1;
fieldPosition = 20;
}
newDown();
}
function turnOverForce() {
trace("turnOverForce");
testMessage = "turnOver after a punt or 4th down run, setting up at returned field pos";
trace("player active = " + scripts.playerActive);
if (scripts.playerActive == 1) {
scripts.playerActive = 2;
} else {
scripts.playerActive = 1;
}
newDown();
}
function newDown() {
trace("new down");
down = 1;
yardsToGo = 10;
}
function randomIn(lowerbound, upperbound) {
return(Math.round(((upperbound - lowerbound) * Math.random()) + lowerbound));
}
function clearGrid() {
playerLoc = new Array(0, 0);
opp1Loc = new Array(0, 0);
opp2Loc = new Array(0, 0);
opp3Loc = new Array(0, 0);
opp4Loc = new Array(0, 0);
opp5Loc = new Array(0, 0);
ix = 0;
while (ix < 9) {
jy = 0;
while (jy < 3) {
cellMC = eval ((("gameApp.grid.cell_" + ix) + "_") + jy);
cellMC.gotoAndStop(1);
jy++;
}
ix++;
}
}
_global.gameApp = this;
_global.scripts = this;
this.tabEnabled = false;
this.tabChildren = false;
stop();
var globalVolume = new Sound();
gameApp.soundVol = 100;
gameApp.globalVolume.setVolume(gameApp.soundVol);
gameApp.cTimer.text = 100;
gameApp.soundSwitch.gotoAndStop(1);
playActive = false;
playReady = false;
gameOn = false;
userName = "";
doBaddyAI = false;
initGame(1);
function updateHUD() {
}
function displayHUD(displayType) {
if (playActive == false) {
gameApp.cMessaging.gotoAndStop(1);
if (displayType == "stats") {
gameApp.stats.down = gameApp.down;
if (gameApp.fieldPosition < 50) {
gameApp.stats.fieldPosition = gameApp.fieldPosition;
gameApp.stats.displayFlag.gotoAndStop(1);
}
if (gameApp.fieldPosition >= 50) {
gameApp.stats.fieldPosition = 100 - gameApp.fieldPosition;
gameApp.stats.displayFlag.gotoAndStop(3);
}
if (playerActive == 1) {
if (gameApp.fieldPosition >= 90) {
gameApp.stats.yardsToGo = "";
} else {
gameApp.stats.yardsToGo = gameApp.yardsToGo;
}
} else if (gameApp.fieldPosition <= 10) {
gameApp.stats.yardsToGo = "";
} else {
gameApp.stats.yardsToGo = gameApp.yardsToGo;
}
gameApp.grid._visible = false;
gameApp.stats._visible = true;
gameApp.cSTHighlight._alpha = 86;
}
if (displayType == "score") {
gameApp.score.playerOneScore = gameApp.playerOneScore;
gameApp.score.playerTwoScore = gameApp.playerTwoScore;
gameApp.grid._visible = false;
gameApp.score._visible = true;
gameApp.cSCHighlight._alpha = 86;
}
}
}
function hideHUD() {
gameApp.grid._visible = true;
gameApp.stats._visible = false;
gameApp.score._visible = false;
gameApp.cSTHighlight._alpha = 0;
gameApp.cSCHighlight._alpha = 0;
}
function changeSound(evt) {
isSound = Boolean(evt.isSound);
if (isSound) {
muteSound(false);
} else {
muteSound(true);
}
}
function muteSound(yes) {
_global.mute = yes;
if (yes) {
trace("turn sound off");
gameApp.soundVol = 0;
gameApp.setVolume(gameApp.soundVol);
gameApp.globalVolume.setVolume(gameApp.soundVol);
gameApp.soundSwitch.gotoAndStop(2);
} else {
trace("turn sound on");
gameApp.soundVol = 100;
gameApp.setVolume(gameApp.soundVol);
gameApp.globalVolume.setVolume(gameApp.soundVol);
gameApp.soundSwitch.gotoAndStop(1);
}
}
function toggleSound() {
muteSound(!_global.mute);
}
function toggleSettings() {
trace("toggle settings called");
trace(gameApp.levelPlay);
if (gameApp.levelPlay == 1) {
gameApp.levelPlay = 2;
gameApp.settingSwitch.gotoAndStop(2);
} else if (gameApp.levelPlay == 2) {
gameApp.levelPlay = 1;
gameApp.settingSwitch.gotoAndStop(1);
}
}
var soundController;
var isSound;
soundController = com.cpbgroup.utils.MovieClipDispatcher(_level0.bottom.soundMc);
soundController.addEventListener("ONSOUNDCHANGE", org.asapframework.events.EventDelegate.create(this, changeSound));
Instance of Symbol 259 MovieClip "score" in Symbol 290 MovieClip [game] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 266 MovieClip "stats" in Symbol 290 MovieClip [game] Frame 1
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 277 MovieClip "grid" in Symbol 290 MovieClip [game] Frame 1
onClipEvent (enterFrame) {
}
Instance of Symbol 168 MovieClip "settingSwitch" in Symbol 290 MovieClip [game] Frame 1
on (release) {
if (gameApp.levelPlay == 1) {
scripts.initGame(2);
} else if (gameApp.levelPlay == 2) {
scripts.initGame(1);
}
}
Instance of Symbol 171 MovieClip "soundSwitch" in Symbol 290 MovieClip [game] Frame 1
on (release) {
scripts.toggleSound();
}
onClipEvent (load) {
trace("soundSwitch here" + _global.mute);
if (_global.mute) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
scripts.muteSound(_global.mute);
}
Symbol 291 MovieClip Frame 2
stop();
Instance of Symbol 242 MovieClip in Symbol 291 MovieClip Frame 2
onClipEvent (load) {
this.tabEnabled = false;
this.tabChildren = false;
}
Symbol 291 MovieClip Frame 3
stop();