Frame 1
var MochiAd = {showPreloaderAd:function (options) {
var _local29 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812};
options = MochiAd._parseOptions(options, _local29);
var _local15 = options.clip;
var _local25 = 11000;
var _local28 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
return(undefined);
}
_local15.stop();
var mc = _local15._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local16 = MochiAd._getRes(options);
var _local5 = _local16[0];
var _local14 = _local16[1];
mc._x = _local5 * 0.5;
mc._y = _local14 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local5 * -0.5;
chk._y = _local14 * -0.5;
var _local8 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local8._x = 10;
_local8._y = _local14 - 20;
var _local24 = options.color;
delete options.color;
var _local21 = options.background;
delete options.background;
var _local26 = options.outline;
delete options.outline;
var _local6 = _local8.createEmptyMovieClip("_outline", 1);
_local6.beginFill(_local21);
_local6.moveTo(0, 0);
_local6.lineTo(_local5 - 20, 0);
_local6.lineTo(_local5 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
_local6.endFill();
var _local4 = _local8.createEmptyMovieClip("_inside", 2);
_local4.beginFill(_local24);
_local4.moveTo(0, 0);
_local4.lineTo(_local5 - 20, 0);
_local4.lineTo(_local5 - 20, 10);
_local4.lineTo(0, 10);
_local4.lineTo(0, 0);
_local4.endFill();
_local4._xscale = 0;
var _local7 = _local8.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local26, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local5 - 20, 0);
_local7.lineTo(_local5 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local25;
chk.ad_timeout = _local28;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}, showTimedAd:function (options) {
var _local15 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd"};
options = MochiAd._parseOptions(options, _local15);
var _local6 = options.clip;
var _local12 = 11000;
var _local14 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
return(undefined);
}
_local6.stop();
var mc = _local6._mochiad;
mc.onUnload = function () {
this._parent.play();
};
var _local7 = MochiAd._getRes(options);
var _local16 = _local7[0];
var _local13 = _local7[1];
mc._x = _local16 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local12;
chk.ad_timeout = _local14;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}, _allowDomains:function (server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}, _loadCommunicator:function (options) {
var _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, _local25);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = "1.4";
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
MochiAd._allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}, fetchHighScores:function (options, callbackObj, callbackMethod) {
var _local1 = MochiAd._loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}, sendHighScore:function (options, callbackObj, callbackMethod) {
var _local1 = MochiAd._loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}, load:function (options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = "1.4";
var _local7 = options.clip;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = MochiAd._getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = MochiAd._allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}, unload:function (clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}, _isNetworkAvailable:function () {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}, _getRes:function (options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}, _parseOptions:function (options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}, _:null};
MochiAd.showPreloaderAd({id:"eb0ae04791049c88", res:"450x600"});
_root.unlock1 = false;
_root.unlock2 = false;
_root.login = false;
Stage.showMenu = false;
stop();
Frame 7
function updatePlayed() {
send_lv = new LoadVars();
take_lv = new LoadVars();
send_lv.game = "flagfootball";
take_lv.onLoad = function (success) {
if (success) {
}
};
send_lv.sendAndLoad("http://www.axis-games.com/addplayed.php", take_lv, "POST");
}
updatePlayed();
stop();
Frame 13
stopAllSounds();
if (_root.login) {
login_status = "You are logged in";
} else {
login_status = "You are NOT logged in.";
}
stop();
Frame 19
function sendForm() {
submit_lv = new LoadVars();
result_lv = new LoadVars();
submit_lv.user = _root.field1;
submit_lv.pass = _root.field2;
result_lv.onLoad = function (success) {
if (success) {
if (result_lv.flashuser != "invalid") {
_root.login = true;
_root.userInfo._visible = true;
_root.loginInfo._visible = false;
_root.userName = result_lv.flashuser;
_root.passwo = _root.field2;
_root.totalPoints = result_lv.flashtap;
_root.spentPoints = result_lv.flashsap;
_root.currentPoints = result_lv.flashcap;
unlockFeat1 = result_lv.feature9;
unlockFeat2 = result_lv.feature10;
if (unlockFeat1 == 1) {
_root.unlock1 = true;
_root.display1 = "You have unlocked touchdown dances.";
}
if (unlockFeat2 == 1) {
_root.unlock2 = true;
_root.display2 = "You have unlocked a new team.";
}
} else {
_root.loginInfo.status_txt = "Invalid Login";
_root.field1 = "";
_root.field2 = "";
}
}
};
submit_lv.sendAndLoad("http://www.axis-games.com/checklogin.php", result_lv, "POST");
}
if (_root.login == false) {
_root.userInfo._visible = false;
} else {
_root.userInfo._visible = true;
_root.loginInfo._visible = false;
}
stop();
loginInfo.submit_btn.onRelease = function () {
sendForm();
_root.loginInfo.status_txt = "Processing...";
};
Frame 26
function playSound(name) {
if (_root.soundOn == true) {
_root.field.soundFX.gotoAndPlay(name);
}
}
function AIoffense() {
if ((((possession == "home") && ((difficulty == "allstar") || (difficulty == "pro"))) && (play == 17)) && (ballHolder != ([homeTeam] + "_qb"))) {
if ((_root.field[aqb]._y < endY) && (yReached == false)) {
_root.field[aqb]._y = _root.field[aqb]._y + 1.2;
if (_root.field[aqb]._y >= endY) {
yReached = true;
}
}
if ((_root.field[aqb]._y > endY) && (yReached == false)) {
_root.field[aqb]._y = _root.field[aqb]._y - 1.2;
if (_root.field[aqb]._y <= endY) {
yReached = true;
}
}
if ((_root.field[aqb]._x < endX) && (xReached == false)) {
_root.field[aqb]._x = _root.field[aqb]._x + 1.2;
if (_root.field[aqb]._x >= endX) {
xReached = true;
}
}
if ((_root.field[aqb]._x > endX) && (xReached == false)) {
_root.field[aqb]._x = _root.field[aqb]._x - 1.2;
if (_root.field[aqb]._x <= endX) {
xReached = true;
}
}
}
if ((((possession == "home") && (passing)) && (play == 17)) && (startPlay)) {
_root.field[hwr1]._y = _root.field[hwr1]._y - 1.2;
_root.field[hwr2]._y = _root.field[hwr2]._y - 1.2;
_root.field[hrb]._y = _root.field[hrb]._y - 1.2;
_root.field[hlg]._y = _root.field[hlg]._y - 1.2;
_root.field[hrg]._y = _root.field[hrg]._y - 1.2;
_root.field[hc]._y = _root.field[hc]._y - 1.2;
}
if ((((possession == "away") && (passing)) && (play == 17)) && (startPlay)) {
_root.field[awr1]._y = _root.field[awr1]._y - 1.2;
_root.field[awr2]._y = _root.field[awr2]._y - 1.2;
_root.field[arb]._y = _root.field[arb]._y - 1.2;
_root.field[alg]._y = _root.field[alg]._y - 1.2;
_root.field[arg]._y = _root.field[arg]._y - 1.2;
_root.field[ac]._y = _root.field[ac]._y - 1.2;
}
if ((possession == "home") && (startPlay)) {
playLength++;
}
if ((possession == "away") && (interception)) {
_root.field[ballHolder]._y = _root.field[ballHolder]._y + 1.6;
_root.field.ball._y = _root.field.ball._y + 1.6;
}
if (((possession == "away") && (startPlay)) && (interception == false)) {
if (justCaught) {
_root.field[ballHolder]._y = _root.field[ballHolder]._y - 1.6;
_root.field.ball._y = _root.field.ball._y - 1.6;
}
playLength++;
if (ballHolder == ([awayTeam] + "_qb")) {
if (compRun && (compIsRunning == false)) {
compIsRunning = true;
_root.field[aqb].gotoAndPlay("run");
}
if (_root.field[ballHolder]._y > ballOn) {
detClosestDef();
if ((playLength > 35) && (_root.field[aqb]._y > (ballOn + 5))) {
detOpenRec();
}
if ((((play == 9) || (play == 10)) && (_root.field[aqb]._y < (ballOn + 50))) && (moveBack)) {
_root.field[aqb]._y = _root.field[aqb]._y + 1.6;
_root.field.ball._y = _root.field.ball._y + 1.6;
if (_root.field[aqb]._y >= (ballOn + 50)) {
moveBack = false;
}
}
if (((_root.field[aqb]._y - _root.field[closestDef]._y) < (48 - diff)) && (moveBack == false)) {
if (_root.field[aqb]._x >= _root.field[closestDef]._x) {
_root.field[aqb]._x = _root.field[aqb]._x + 1.6;
_root.field.ball._x = _root.field.ball._x + 1.6;
_root.field[aqb]._rotation = 90;
compRun = true;
if (_root.field[aqb]._x > 310) {
_root.field[aqb]._y = _root.field[aqb]._y - 1.2;
_root.field[aqb]._x = _root.field[aqb]._x - 0.4;
_root.field.ball._y = _root.field.ball._y - 1.2;
_root.field.ball._x = _root.field.ball._x - 0.4;
_root.field[aqb]._rotation = 45;
}
} else if (_root.field[aqb]._x < _root.field[closestDef]._x) {
_root.field[aqb]._x = _root.field[aqb]._x - 1.6;
_root.field.ball._x = _root.field.ball._x - 1.6;
_root.field[aqb]._rotation = 270;
compRun = true;
if (_root.field[aqb]._x < 130) {
_root.field[aqb]._y = _root.field[aqb]._y - 1.2;
_root.field[aqb]._x = _root.field[aqb]._x + 0.4;
_root.field.ball._y = _root.field.ball._y - 1.2;
_root.field.ball._x = _root.field.ball._x + 0.4;
_root.field[aqb]._rotation = 315;
}
}
}
}
if (_root.field[ballHolder]._y <= ballOn) {
_root.field[aqb]._rotation = 0;
_root.field[aqb]._y = _root.field[aqb]._y - 1.6;
}
}
}
}
function detOpenRec() {
var _local8 = Math.abs(_root.field[awr1]._x - _root.field[hwr1]._x) + Math.abs(_root.field[awr1]._y - _root.field[hwr1]._y);
var _local6 = Math.abs(_root.field[awr1]._x - _root.field[hqb]._x) + Math.abs(_root.field[awr1]._y - _root.field[hqb]._y);
var _local4 = Math.abs(_root.field[awr1]._x - _root.field[hc]._x) + Math.abs(_root.field[awr1]._y - _root.field[hc]._y);
var _local7 = Math.abs(_root.field[awr2]._x - _root.field[hwr2]._x) + Math.abs(_root.field[awr2]._y - _root.field[hwr2]._y);
var _local5 = Math.abs(_root.field[awr2]._x - _root.field[hqb]._x) + Math.abs(_root.field[awr2]._y - _root.field[hqb]._y);
var _local3 = Math.abs(_root.field[awr2]._x - _root.field[hc]._x) + Math.abs(_root.field[awr2]._y - _root.field[hc]._y);
var _local11 = Math.abs(_root.field[arb]._x - _root.field[hrb]._x) + Math.abs(_root.field[arb]._y - _root.field[hrb]._y);
var _local10 = Math.abs(_root.field[arb]._x - _root.field[hqb]._x) + Math.abs(_root.field[arb]._y - _root.field[hqb]._y);
var _local9 = Math.abs(_root.field[arb]._x - _root.field[hc]._x) + Math.abs(_root.field[arb]._y - _root.field[hc]._y);
if ((_local8 < _local6) && (_local8 < _local4)) {
wr1ClosestDef = [homeTeam] + "_wr1";
wr1Coverage = _local8;
} else if ((_local6 < _local8) && (_local6 < _local4)) {
wr1ClosestDef = [homeTeam] + "_qb";
wr1Coverage = _local6;
} else if ((_local4 < _local8) && (_local4 < _local6)) {
wr1ClosestDef = [homeTeam] + "_c";
wr1Coverage = _local4;
}
if ((((((wr1Coverage > passCheck) && (passing == false)) && (_root.field[awr1]._y < _root.field[aqb]._y)) && ((play != 8) || (playLength > (75 - diff)))) && (_root.field[awr1]._y > 60)) && ((play != 10) || (playLength > 70))) {
closest = [awayTeam] + "_wr1";
passing = true;
throwPass = true;
var _local14 = Math.abs(_root.field[awr1]._x - _root.field[aqb]._x);
var _local13 = Math.abs(_root.field[awr1]._y - _root.field[aqb]._y);
var _local12 = Math.sqrt((_local14 * _local14) + (_local13 * _local13));
var _local15 = random(diff2) - 10;
var _local2 = (_local12 / throwSpeed) + _local15;
if (_local12 < 70) {
_local2 = _local12 / throwSpeed;
}
startX = _root.field[aqb]._x;
startY = _root.field[aqb]._y;
_root.field.ball.gotoAndPlay("throw");
if (wr1Dest1 == false) {
if ((_root.field[awr1]._rotation == 0) || (_root.field[awr1]._rotation == -180)) {
endX = _root.field[awr1]._x;
endY = _root.field[awr1]._y - (_local2 * dest1speedWr1);
}
if ((_root.field[awr1]._rotation == 45) || (_root.field[awr1]._rotation == -315)) {
endX = _root.field[awr1]._x + (_local2 * dest1speedWr1);
endY = _root.field[awr1]._y - (_local2 * dest1speedWr1);
}
if ((_root.field[awr1]._rotation == 90) || (_root.field[awr1]._rotation == -270)) {
endX = _root.field[awr1]._x + (_local2 * dest1speedWr1);
endY = _root.field[awr1]._y;
}
if ((_root.field[awr1]._rotation == 135) || (_root.field[awr1]._rotation == -225)) {
endX = _root.field[awr1]._x + (_local2 * dest1speedWr1);
endY = _root.field[awr1]._y + (_local2 * dest1speedWr1);
}
if (_root.field[awr1]._rotation == 180) {
endX = _root.field[awr1]._x;
endY = _root.field[awr1]._y + (_local2 * dest1speedWr1);
}
if ((_root.field[awr1]._rotation == 225) || (_root.field[awr1]._rotation == -135)) {
endX = _root.field[awr1]._x - (_local2 * dest1speedWr1);
endY = _root.field[awr1]._y + (_local2 * dest1speedWr1);
}
if ((_root.field[awr1]._rotation == 270) || (_root.field[awr1]._rotation == -90)) {
endX = _root.field[awr1]._x - (_local2 * dest1speedWr1);
endY = _root.field[awr1]._y;
}
if ((_root.field[awr1]._rotation == 315) || (_root.field[awr1]._rotation == -45)) {
endX = _root.field[awr1]._x - (_local2 * dest1speedWr1);
endY = _root.field[awr1]._y - (_local2 * dest1speedWr1);
}
} else if (wr1Dest1 && (wr1Dest2 == false)) {
if ((_root.field[awr1]._rotation == 0) || (_root.field[awr1]._rotation == -180)) {
endX = _root.field[awr1]._x;
endY = _root.field[awr1]._y - (_local2 * dest2speedWr1);
}
if ((_root.field[awr1]._rotation == 45) || (_root.field[awr1]._rotation == -315)) {
endX = _root.field[awr1]._x + (_local2 * dest2speedWr1);
endY = _root.field[awr1]._y - (_local2 * dest2speedWr1);
}
if ((_root.field[awr1]._rotation == 90) || (_root.field[awr1]._rotation == -270)) {
endX = _root.field[awr1]._x + (_local2 * dest2speedWr1);
endY = _root.field[awr1]._y;
}
if ((_root.field[awr1]._rotation == 135) || (_root.field[awr1]._rotation == -225)) {
endX = _root.field[awr1]._x + (_local2 * dest2speedWr1);
endY = _root.field[awr1]._y + (_local2 * dest2speedWr1);
}
if (_root.field[awr1]._rotation == 180) {
endX = _root.field[awr1]._x;
endY = _root.field[awr1]._y + (_local2 * dest2speedWr1);
}
if ((_root.field[awr1]._rotation == 225) || (_root.field[awr1]._rotation == -135)) {
endX = _root.field[awr1]._x - (_local2 * dest2speedWr1);
endY = _root.field[awr1]._y + (_local2 * dest2speedWr1);
}
if ((_root.field[awr1]._rotation == 270) || (_root.field[awr1]._rotation == -90)) {
endX = _root.field[awr1]._x - (_local2 * dest2speedWr1);
endY = _root.field[awr1]._y;
}
if ((_root.field[awr1]._rotation == 315) || (_root.field[awr1]._rotation == -45)) {
endX = _root.field[awr1]._x - (_local2 * dest2speedWr1);
endY = _root.field[awr1]._y - (_local2 * dest2speedWr1);
}
} else if ((wr1Dest1 && (wr1Dest2)) && (wr1Dest3 == false)) {
if ((_root.field[awr1]._rotation == 0) || (_root.field[awr1]._rotation == -180)) {
endX = _root.field[awr1]._x;
endY = _root.field[awr1]._y - (_local2 * dest3speedWr1);
}
if ((_root.field[awr1]._rotation == 45) || (_root.field[awr1]._rotation == -315)) {
endX = _root.field[awr1]._x + (_local2 * dest3speedWr1);
endY = _root.field[awr1]._y - (_local2 * dest3speedWr1);
}
if ((_root.field[awr1]._rotation == 90) || (_root.field[awr1]._rotation == -270)) {
endX = _root.field[awr1]._x + (_local2 * dest3speedWr1);
endY = _root.field[awr1]._y;
}
if ((_root.field[awr1]._rotation == 135) || (_root.field[awr1]._rotation == -225)) {
endX = _root.field[awr1]._x + (_local2 * dest3speedWr1);
endY = _root.field[awr1]._y + (_local2 * dest3speedWr1);
}
if (_root.field[awr1]._rotation == 180) {
endX = _root.field[awr1]._x;
endY = _root.field[awr1]._y + (_local2 * dest3speedWr1);
}
if ((_root.field[awr1]._rotation == 225) || (_root.field[awr1]._rotation == -135)) {
endX = _root.field[awr1]._x - (_local2 * dest3speedWr1);
endY = _root.field[awr1]._y + (_local2 * dest3speedWr1);
}
if ((_root.field[awr1]._rotation == 270) || (_root.field[awr1]._rotation == -90)) {
endX = _root.field[awr1]._x - (_local2 * dest3speedWr1);
endY = _root.field[awr1]._y;
}
if ((_root.field[awr1]._rotation == 315) || (_root.field[awr1]._rotation == -45)) {
endX = _root.field[awr1]._x - (_local2 * dest3speedWr1);
endY = _root.field[awr1]._y - (_local2 * dest3speedWr1);
}
}
if (endX < startX) {
_root.field.ball.gotoAndPlay("throw2");
}
}
if ((_local7 < _local5) && (_local7 < _local3)) {
wr2ClosestDef = [homeTeam] + "_wr2";
wr2Coverage = _local7;
} else if ((_local5 < _local7) && (_local5 < _local3)) {
wr2ClosestDef = [homeTeam] + "_qb";
wr2Coverage = _local5;
} else if ((_local3 < _local7) && (_local3 < _local5)) {
wr2ClosestDef = [homeTeam] + "_c";
wr2Coverage = _local3;
}
if (((((wr2Coverage > passCheck) && (_root.field[awr2]._y < _root.field[aqb]._y)) && ((play != 6) || (playLength > 100))) && ((play != 8) || (playLength > (75 - diff)))) && (_root.field[awr2]._y > 60)) {
closest = [awayTeam] + "_wr2";
passing = true;
throwPass = true;
var _local14 = Math.abs(_root.field[awr2]._x - _root.field[aqb]._x);
var _local13 = Math.abs(_root.field[awr2]._y - _root.field[aqb]._y);
var _local12 = Math.sqrt((_local14 * _local14) + (_local13 * _local13));
var _local15 = random(diff2) - 10;
var _local2 = (_local12 / throwSpeed) + _local15;
if (_local12 < 70) {
_local2 = _local12 / throwSpeed;
}
startX = _root.field[aqb]._x;
startY = _root.field[aqb]._y;
_root.field.ball.gotoAndPlay("throw");
if (wr2Dest1 == false) {
if ((_root.field[awr2]._rotation == 0) || (_root.field[awr2]._rotation == -180)) {
endX = _root.field[awr2]._x;
endY = _root.field[awr2]._y - (_local2 * dest1speedWr2);
}
if ((_root.field[awr2]._rotation == 45) || (_root.field[awr2]._rotation == -315)) {
endX = _root.field[awr2]._x + (_local2 * dest1speedWr2);
endY = _root.field[awr2]._y - (_local2 * dest1speedWr2);
}
if ((_root.field[awr2]._rotation == 90) || (_root.field[awr2]._rotation == -270)) {
endX = _root.field[awr2]._x + (_local2 * dest1speedWr2);
endY = _root.field[awr2]._y;
}
if ((_root.field[awr2]._rotation == 135) || (_root.field[awr2]._rotation == -225)) {
endX = _root.field[awr2]._x + (_local2 * dest1speedWr2);
endY = _root.field[awr2]._y + (_local2 * dest1speedWr2);
}
if (_root.field[awr2]._rotation == 180) {
endX = _root.field[awr2]._x;
endY = _root.field[awr2]._y + (_local2 * dest1speedWr2);
}
if ((_root.field[awr2]._rotation == 225) || (_root.field[awr2]._rotation == -135)) {
endX = _root.field[awr2]._x - (_local2 * dest1speedWr2);
endY = _root.field[awr2]._y + (_local2 * dest1speedWr2);
}
if ((_root.field[awr2]._rotation == 270) || (_root.field[awr2]._rotation == -90)) {
endX = _root.field[awr2]._x - (_local2 * dest1speedWr2);
endY = _root.field[awr2]._y;
}
if ((_root.field[awr2]._rotation == 315) || (_root.field[awr2]._rotation == -45)) {
endX = _root.field[awr2]._x - (_local2 * dest1speedWr2);
endY = _root.field[awr2]._y - (_local2 * dest1speedWr2);
}
} else if (wr2Dest1 && (wr2Dest2 == false)) {
if ((_root.field[awr2]._rotation == 0) || (_root.field[awr2]._rotation == -180)) {
endX = _root.field[awr2]._x;
endY = _root.field[awr2]._y - (_local2 * dest2speedWr2);
}
if ((_root.field[awr2]._rotation == 45) || (_root.field[awr2]._rotation == -315)) {
endX = _root.field[awr2]._x + (_local2 * dest2speedWr2);
endY = _root.field[awr2]._y - (_local2 * dest2speedWr2);
}
if ((_root.field[awr2]._rotation == 90) || (_root.field[awr2]._rotation == -270)) {
endX = _root.field[awr2]._x + (_local2 * dest2speedWr2);
endY = _root.field[awr2]._y;
}
if ((_root.field[awr2]._rotation == 135) || (_root.field[awr2]._rotation == -225)) {
endX = _root.field[awr2]._x + (_local2 * dest2speedWr2);
endY = _root.field[awr2]._y + (_local2 * dest2speedWr2);
}
if (_root.field[awr2]._rotation == 180) {
endX = _root.field[awr2]._x;
endY = _root.field[awr2]._y + (_local2 * dest2speedWr2);
}
if ((_root.field[awr2]._rotation == 225) || (_root.field[awr2]._rotation == -135)) {
endX = _root.field[awr2]._x - (_local2 * dest2speedWr2);
endY = _root.field[awr2]._y + (_local2 * dest2speedWr2);
}
if ((_root.field[awr2]._rotation == 270) || (_root.field[awr2]._rotation == -90)) {
endX = _root.field[awr2]._x - (_local2 * dest2speedWr2);
endY = _root.field[awr2]._y;
}
if ((_root.field[awr2]._rotation == 315) || (_root.field[awr2]._rotation == -45)) {
endX = _root.field[awr2]._x - (_local2 * dest2speedWr2);
endY = _root.field[awr2]._y - (_local2 * dest2speedWr2);
}
} else if ((wr2Dest1 && (wr2Dest2)) && (wr2Dest3 == false)) {
if ((_root.field[awr2]._rotation == 0) || (_root.field[awr2]._rotation == -180)) {
endX = _root.field[awr2]._x;
endY = _root.field[awr2]._y - (_local2 * dest3speedWr2);
}
if ((_root.field[awr2]._rotation == 45) || (_root.field[awr2]._rotation == -315)) {
endX = _root.field[awr2]._x + (_local2 * dest3speedWr2);
endY = _root.field[awr2]._y - (_local2 * dest3speedWr2);
}
if ((_root.field[awr2]._rotation == 90) || (_root.field[awr2]._rotation == -270)) {
endX = _root.field[awr2]._x + (_local2 * dest3speedWr2);
endY = _root.field[awr2]._y;
}
if ((_root.field[awr2]._rotation == 135) || (_root.field[awr2]._rotation == -225)) {
endX = _root.field[awr2]._x + (_local2 * dest3speedWr2);
endY = _root.field[awr2]._y + (_local2 * dest3speedWr2);
}
if (_root.field[awr2]._rotation == 180) {
endX = _root.field[awr2]._x;
endY = _root.field[awr2]._y + (_local2 * dest3speedWr2);
}
if ((_root.field[awr2]._rotation == 225) || (_root.field[awr2]._rotation == -135)) {
endX = _root.field[awr2]._x - (_local2 * dest3speedWr2);
endY = _root.field[awr2]._y + (_local2 * dest3speedWr2);
}
if ((_root.field[awr2]._rotation == 270) || (_root.field[awr2]._rotation == -90)) {
endX = _root.field[awr2]._x - (_local2 * dest3speedWr2);
endY = _root.field[awr2]._y;
}
if ((_root.field[awr2]._rotation == 315) || (_root.field[awr2]._rotation == -45)) {
endX = _root.field[awr2]._x - (_local2 * dest3speedWr2);
endY = _root.field[awr2]._y - (_local2 * dest3speedWr2);
}
}
if (endX < startX) {
_root.field.ball.gotoAndPlay("throw2");
}
}
if ((_local11 < _local10) && (_local11 < _local9)) {
rbClosestDef = [homeTeam] + "_rb";
rbCoverage = _local11;
} else if ((_local10 < _local11) && (_local10 < _local9)) {
rbClosestDef = [homeTeam] + "_qb";
rbCoverage = _local10;
} else if ((_local9 < _local11) && (_local9 < _local10)) {
rbClosestDef = [homeTeam] + "_c";
rbCoverage = _local9;
}
if ((((rbCoverage > passCheck) && (_root.field[arb]._y < _root.field[aqb]._y)) && ((play != 8) || (playLength > (75 - diff)))) && ((play != 5) || ((playLength > 70) && (_root.field[arb]._y > 60)))) {
closest = [awayTeam] + "_rb";
passing = true;
throwPass = true;
var _local14 = _root.field[awr1]._x - _root.field[aqb]._x;
var _local13 = Math.abs(_root.field[awr1]._y - _root.field[aqb]._y);
var _local12 = Math.sqrt((_local14 * _local14) + (_local13 * _local13));
var _local15 = random(diff2) - 10;
var _local2 = (_local12 / throwSpeed) + _local15;
if (_local12 < 70) {
_local2 = _local12 / throwSpeed;
}
startX = _root.field[aqb]._x;
startY = _root.field[aqb]._y;
_root.field.ball.gotoAndPlay("throw");
if (rbDest1 == false) {
if ((_root.field[arb]._rotation == 0) || (_root.field[arb]._rotation == -180)) {
endX = _root.field[arb]._x;
endY = _root.field[arb]._y - (_local2 * dest1speedRb);
}
if ((_root.field[arb]._rotation == 45) || (_root.field[arb]._rotation == -315)) {
endX = _root.field[arb]._x + (_local2 * dest1speedRb);
endY = _root.field[arb]._y - (_local2 * dest1speedRb);
}
if ((_root.field[arb]._rotation == 90) || (_root.field[arb]._rotation == -270)) {
endX = _root.field[arb]._x + (_local2 * dest1speedRb);
endY = _root.field[arb]._y;
}
if ((_root.field[arb]._rotation == 135) || (_root.field[arb]._rotation == -225)) {
endX = _root.field[arb]._x + (_local2 * dest1speedRb);
endY = _root.field[arb]._y + (_local2 * dest1speedRb);
}
if (_root.field[arb]._rotation == 180) {
endX = _root.field[arb]._x;
endY = _root.field[arb]._y + (_local2 * dest1speedRb);
}
if ((_root.field[arb]._rotation == 225) || (_root.field[arb]._rotation == -135)) {
endX = _root.field[arb]._x - (_local2 * dest1speedRb);
endY = _root.field[arb]._y + (_local2 * dest1speedRb);
}
if ((_root.field[arb]._rotation == 270) || (_root.field[arb]._rotation == -90)) {
endX = _root.field[arb]._x - (_local2 * dest1speedRb);
endY = _root.field[arb]._y;
}
if ((_root.field[arb]._rotation == 315) || (_root.field[arb]._rotation == -45)) {
endX = _root.field[arb]._x - (_local2 * dest1speedRb);
endY = _root.field[arb]._y - (_local2 * dest1speedRb);
}
} else if (rbDest1 && (rbDest2 == false)) {
if ((_root.field[arb]._rotation == 0) || (_root.field[arb]._rotation == -180)) {
endX = _root.field[arb]._x;
endY = _root.field[arb]._y - (_local2 * dest2speedRb);
}
if ((_root.field[arb]._rotation == 45) || (_root.field[arb]._rotation == -315)) {
endX = _root.field[arb]._x + (_local2 * dest2speedRb);
endY = _root.field[arb]._y - (_local2 * dest2speedRb);
}
if ((_root.field[arb]._rotation == 90) || (_root.field[arb]._rotation == -270)) {
endX = _root.field[arb]._x + (_local2 * dest2speedRb);
endY = _root.field[arb]._y;
}
if ((_root.field[arb]._rotation == 135) || (_root.field[arb]._rotation == -225)) {
endX = _root.field[arb]._x + (_local2 * dest2speedRb);
endY = _root.field[arb]._y + (_local2 * dest2speedRb);
}
if (_root.field[arb]._rotation == 180) {
endX = _root.field[arb]._x;
endY = _root.field[arb]._y + (_local2 * dest2speedRb);
}
if ((_root.field[arb]._rotation == 225) || (_root.field[arb]._rotation == -135)) {
endX = _root.field[arb]._x - (_local2 * dest2speedRb);
endY = _root.field[arb]._y + (_local2 * dest2speedRb);
}
if ((_root.field[arb]._rotation == 270) || (_root.field[arb]._rotation == -90)) {
endX = _root.field[arb]._x - (_local2 * dest2speedRb);
endY = _root.field[arb]._y;
}
if ((_root.field[arb]._rotation == 315) || (_root.field[arb]._rotation == -45)) {
endX = _root.field[arb]._x - (_local2 * dest2speedRb);
endY = _root.field[arb]._y - (_local2 * dest2speedRb);
}
} else if ((rbDest1 && (rbDest2)) && (rbDest3 == false)) {
if ((_root.field[arb]._rotation == 0) || (_root.field[arb]._rotation == -180)) {
endX = _root.field[arb]._x;
endY = _root.field[arb]._y - (_local2 * dest3speedRb);
}
if ((_root.field[arb]._rotation == 45) || (_root.field[arb]._rotation == -315)) {
endX = _root.field[arb]._x + (_local2 * dest3speedRb);
endY = _root.field[arb]._y - (_local2 * dest3speedRb);
}
if ((_root.field[arb]._rotation == 90) || (_root.field[arb]._rotation == -270)) {
endX = _root.field[arb]._x + (_local2 * dest3speedRb);
endY = _root.field[arb]._y;
}
if ((_root.field[arb]._rotation == 135) || (_root.field[arb]._rotation == -225)) {
endX = _root.field[arb]._x + (_local2 * dest3speedRb);
endY = _root.field[arb]._y + (_local2 * dest3speedRb);
}
if (_root.field[arb]._rotation == 180) {
endX = _root.field[arb]._x;
endY = _root.field[arb]._y + (_local2 * dest3speedRb);
}
if ((_root.field[arb]._rotation == 225) || (_root.field[arb]._rotation == -135)) {
endX = _root.field[arb]._x - (_local2 * dest3speedRb);
endY = _root.field[arb]._y + (_local2 * dest3speedRb);
}
if ((_root.field[arb]._rotation == 270) || (_root.field[arb]._rotation == -90)) {
endX = _root.field[arb]._x - (_local2 * dest3speedRb);
endY = _root.field[arb]._y;
}
if ((_root.field[arb]._rotation == 315) || (_root.field[arb]._rotation == -45)) {
endX = _root.field[arb]._x - (_local2 * dest3speedRb);
endY = _root.field[arb]._y - (_local2 * dest3speedRb);
}
}
if (endX < startX) {
_root.field.ball.gotoAndPlay("throw2");
}
}
}
function detClosestDef() {
var _local3 = Math.abs(_root.field[ballHolder]._x - _root.field[hqb]._x) + Math.abs(_root.field[ballHolder]._y - _root.field[hqb]._y);
var _local2 = Math.abs(_root.field[ballHolder]._x - _root.field[hrb]._x) + Math.abs(_root.field[ballHolder]._y - _root.field[hrb]._y);
var _local8 = Math.abs(_root.field[ballHolder]._x - _root.field[hc]._x) + Math.abs(_root.field[ballHolder]._y - _root.field[hc]._y);
var _local7 = Math.abs(_root.field[ballHolder]._x - _root.field[hwr1]._x) + Math.abs(_root.field[ballHolder]._y - _root.field[hwr1]._y);
var _local6 = Math.abs(_root.field[ballHolder]._x - _root.field[hwr2]._x) + Math.abs(_root.field[ballHolder]._y - _root.field[hwr2]._y);
var _local5 = Math.abs(_root.field[ballHolder]._x - _root.field[hrg]._x) + Math.abs(_root.field[ballHolder]._y - _root.field[hrg]._y);
var _local4 = Math.abs(_root.field[ballHolder]._x - _root.field[hlg]._x) + Math.abs(_root.field[ballHolder]._y - _root.field[hlg]._y);
if ((((((_local3 < _local2) && (_local3 < _local8)) && (_local3 < _local7)) && (_local3 < _local6)) && (_local3 < _local5)) && (_local3 < _local4)) {
closestDef = hqb;
}
if ((((((_local2 < _local3) && (_local2 < _local8)) && (_local2 < _local7)) && (_local2 < _local6)) && (_local2 < _local5)) && (_local2 < _local4)) {
closestDef = hrb;
}
if ((((((_local8 < _local3) && (_local8 < _local2)) && (_local8 < _local7)) && (_local8 < _local6)) && (_local8 < _local5)) && (_local8 < _local4)) {
closestDef = hc;
}
if ((((((_local7 < _local3) && (_local7 < _local2)) && (_local7 < _local8)) && (_local7 < _local6)) && (_local7 < _local5)) && (_local7 < _local4)) {
closestDef = hwr1;
}
if ((((((_local6 < _local3) && (_local6 < _local2)) && (_local6 < _local8)) && (_local6 < _local7)) && (_local6 < _local5)) && (_local6 < _local4)) {
closestDef = hwr2;
}
if ((((((_local5 < _local3) && (_local5 < _local2)) && (_local5 < _local8)) && (_local5 < _local7)) && (_local5 < _local6)) && (_local5 < _local4)) {
closestDef = hrg;
}
if ((((((_local4 < _local3) && (_local4 < _local2)) && (_local4 < _local8)) && (_local4 < _local7)) && (_local4 < _local6)) && (_local4 < _local5)) {
closestDef = hlg;
}
}
function kicking() {
if (startKick) {
if (kickTaking == "power") {
if (kickPower > 88) {
kickPower = 0;
}
kickPower = kickPower + 8;
_root.field.kickMeter.power._yscale = kickPower;
if (Key.isDown(32) && (_root.field.kickMeter.direction._visible == false)) {
if (kickPower < 40) {
kickPower = 40;
}
kickDistance = (kickPower / 1.55) * 4.6;
if (play == 17) {
kickDistance = kickDistance + 30;
}
_root.field.kickMeter.direction._visible = true;
kickTaking = "pause";
}
}
if (kickTaking == "pause") {
pause++;
if (pause > 5) {
checkForSnap = true;
kickTaking = "direction";
pause = 0;
}
}
if (kickTaking == "direction") {
if (kickDirection > 49) {
kickDirection = -50;
}
kickDirection = kickDirection + 5;
_root.field.kickMeter.direction._xscale = kickDirection;
if (Key.isDown(32)) {
_root.field[hwr1].gotoAndStop(1);
_root.field[hrb].gotoAndStop(1);
if (play == 17) {
kickAccuracy = kickDirection * 5.5;
} else {
kickAccuracy = kickDirection * 1.5;
}
kickTaking = "kick";
enlarge = 1.1;
if (play == 16) {
enlarge = 1.9;
}
throwSpeed = 5;
}
}
if (kickTaking == "kick") {
if (kickBall == true) {
_root.field.kickMeter._visible = false;
kickBall = false;
_root.field.ball.gotoAndPlay("kick");
passing = true;
throwPass = true;
endX = _root.field.ball._x + kickAccuracy;
endY = _root.field.ball._y - kickDistance;
startX = _root.field.ball._x;
startY = _root.field.ball._y;
breakThru1 = true;
breakThru2 = true;
breakThru3 = true;
if (possession == "home") {
_root.field[hwr1].gotoAndPlay("run");
_root.field[hwr2].gotoAndPlay("run");
_root.field[hrb].gotoAndPlay("run");
_root.field[hlg].gotoAndPlay("run");
_root.field[hrg].gotoAndPlay("run");
_root.field[hc].gotoAndPlay("run");
}
if (possession == "away") {
_root.field[awr1].gotoAndPlay("run");
_root.field[awr2].gotoAndPlay("run");
_root.field[arb].gotoAndPlay("run");
_root.field[alg].gotoAndPlay("run");
_root.field[arg].gotoAndPlay("run");
_root.field[ac].gotoAndPlay("run");
}
}
if ((_root.field.ball.hitTest(_root.field.upright1.good) && (skid == false)) && (play != 17)) {
_root.field.passInfo.gotoAndPlay("good");
kickTaking = "power";
if (possession == "home") {
possession = "away";
if (kickType == "pat") {
homeScore = homeScore + 1;
} else {
homeScore = homeScore + 3;
}
} else {
possession = "home";
if (kickType == "pat") {
awayScore = awayScore + 1;
} else {
awayScore = awayScore + 3;
}
}
kickOff();
}
}
}
}
function kickOff() {
firstDown = "fd1";
justScored = false;
down = 0;
ballOn = 500;
}
function clock() {
if (runClock) {
timer++;
mySec = Math.ceil(timer / 24);
sec = tAdj - mySec;
if (sec < 10) {
_root.field.scoreboard.tSecs._x = 152;
_root.field.scoreboard.zero._visible = true;
} else {
_root.field.scoreboard.tSecs._x = 138;
_root.field.scoreboard.zero._visible = false;
}
if (sec <= 0) {
if (min <= 0) {
runClock = false;
_root.field.scoreboard.tSecs._x = 138;
_root.field.scoreboard.zero._visible = false;
mySec = 0;
sec = 59;
min = 2;
if (quarter == 2) {
halfTime = true;
}
quarter++;
_root.field.scoreboard.marker.gotoAndStop(quarter);
}
sec = 59;
tAdj = tAdj + sec;
min--;
}
}
}
function afterPlay() {
runClock = false;
_root.playSound("whistle");
_root.field.advance._visible = true;
if (interception && (justScored == false)) {
var _local2 = ballOn - 95;
ballOn = 550 - _local2;
if (_root.field[ballHolder].hitTest(_root.field.endzone1) || (_root.field[ballHolder]._y < 70)) {
ballOn = 500;
firstDown = "fd1";
}
}
if ((ballOn <= _root.field[firstDown]._y) || (interception)) {
down = 1;
if (ballOn < 550) {
firstDown = "fd1";
}
if (ballOn < 440) {
firstDown = "fd2";
}
if (ballOn < 325) {
firstDown = "fd3";
}
if (ballOn < 210) {
firstDown = "fd4";
}
} else {
down++;
if ((down > 4) && (justScored == false)) {
var _local2 = ballOn - 95;
ballOn = 550 - _local2;
down = 1;
if (ballOn < 550) {
firstDown = "fd1";
}
if (ballOn < 440) {
firstDown = "fd2";
}
if (ballOn < 325) {
firstDown = "fd3";
}
if (ballOn < 210) {
firstDown = "fd4";
}
if (possession == "away") {
possession = "home";
} else {
possession = "away";
}
}
}
if (halfTime) {
ballOn = 500;
possession = "away";
down = 1;
firstDown = "fd1";
}
if (quarter > 4) {
gotoAndStop ("endofgame");
}
halfTime = false;
endX = "null";
endY = "null";
yReached = false;
xReached = false;
crossedLos = false;
oob = false;
ballInMot = false;
finish = false;
startKick = false;
interception = false;
_root.field[hlg].gotoAndStop(1);
_root.field[hrg].gotoAndStop(1);
_root.field[hc].gotoAndStop(1);
_root.field[hrb].gotoAndStop(1);
_root.field[hqb].gotoAndStop(1);
_root.field[hwr1].gotoAndStop(1);
_root.field[hwr2].gotoAndStop(1);
_root.field[alg].gotoAndStop(1);
_root.field[arg].gotoAndStop(1);
_root.field[ac].gotoAndStop(1);
_root.field[arb].gotoAndStop(1);
_root.field[aqb].gotoAndStop(1);
_root.field[awr1].gotoAndStop(1);
_root.field[awr2].gotoAndStop(1);
_root.field[hlg]._rotation = 0;
_root.field[hrg]._rotation = 0;
_root.field[hc]._rotation = 0;
_root.field[hqb]._rotation = 0;
_root.field[hrb]._rotation = 0;
_root.field[hwr1]._rotation = 0;
_root.field[hwr2]._rotation = 0;
_root.field[alg]._rotation = 0;
_root.field[arg]._rotation = 0;
_root.field[ac]._rotation = 0;
_root.field[aqb]._rotation = 0;
_root.field[arb]._rotation = 0;
_root.field[awr1]._rotation = 0;
_root.field[awr2]._rotation = 0;
_root.field.ring._rotation = 0;
_root.field.ring._x = _root.field[activePlayer]._x;
_root.field.ring._y = _root.field[activePlayer]._y + 8;
_root.field.fdMarkers._y = _root.field[firstDown]._y - 4;
_root.field.ball._xscale = 100;
_root.field.ball._yscale = 100;
toGo = Math.round((ballOn - _root.field[firstDown]._y) / 8);
if (toGo <= 0) {
toGo = 1;
}
justCaught = false;
moveBack = true;
playLength = 0;
startKick = false;
tackled = false;
startPlay = false;
wr1Dest1 = false;
wr1Dest2 = false;
wr1Dest3 = false;
wr2Dest1 = false;
wr2Dest2 = false;
wr2Dest3 = false;
rbDest1 = false;
rbDest2 = false;
rbDest3 = false;
cDest1 = false;
cDest2 = false;
cDest3 = false;
finish = false;
kickBall = false;
defQbRunning = false;
defRbRunning = false;
defWr1Running = false;
defWr2Running = false;
defCRunning = false;
defLgRunning = false;
defRgRunning = false;
rgBlocking = false;
cBlocking = false;
lgBlocking = false;
breakThru1 = false;
breakThru2 = false;
breakThru3 = false;
breakThru4 = false;
breakThru5 = false;
alreadyRunning = false;
_root.field.ball._rotation = 0;
_root.field.ball._visible = false;
_root.field.hit._visible = false;
_root.field.ring._visible = true;
compIsRunning = false;
compRun = false;
activePlayer = "null";
if (unlock1 && (dance)) {
dance = false;
_root.field[ballHolder]._rotation = 0;
_root.field[ballHolder].gotoAndPlay("pH");
}
setRing();
if (possession == "away") {
_root.playMenu.punt._visible = false;
_root.playMenu.pat._visible = false;
} else {
_root.playMenu.punt._visible = true;
_root.playMenu.pat._visible = true;
}
}
function checkForTackle() {
if ((startPlay && (possession == "home")) && ((ballHolder != (homeTeam + "_c")) || (interception))) {
if ((Math.abs(_root.field[alg]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[alg]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[arg]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[arg]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[ac]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[ac]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[arb]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[arb]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[aqb]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[aqb]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[awr1]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[awr1]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[awr2]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[awr2]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
}
}
if ((startPlay && (possession == "away")) && ((ballHolder != (awayTeam + "_c")) || (interception))) {
if ((Math.abs(_root.field[hlg]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[hlg]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[hrg]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[hrg]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[hc]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[hc]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[hrb]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[hrb]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[hqb]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[hqb]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[hwr1]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[hwr1]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
} else if ((Math.abs(_root.field[hwr2]._x - _root.field[ballHolder]._x) < 7) && (Math.abs(_root.field[hwr2]._y - _root.field[ballHolder]._y) < 7)) {
tackled = true;
}
}
if (tackled == true) {
ballOn = Math.round(_root.field[ballHolder]._y);
if (((ballHolder == ([homeTeam] + "_qb")) && (_root.field[hqb]._y > _root.field[hc]._y)) || ((ballHolder == ([awayTeam] + "_qb")) && (_root.field[aqb]._y > _root.field[ac]._y))) {
_root.field.passInfo.gotoAndPlay("sack");
ballOn = Math.round(_root.field[ballHolder]._y);
if (justScored) {
if (possession == "home") {
possession = "away";
} else {
possession = "home";
}
kickOff();
}
if (_root.field[ballHolder].hitTest(_root.field.endzone2)) {
_root.field.passInfo.gotoAndPlay("safety");
down = 0;
ballOn = 400;
if (possession == "home") {
possession = "away";
awayScore = awayScore + 2;
} else {
possession = "home";
homeScore = homeScore + 2;
}
}
}
afterPlay();
}
}
function blocking() {
if (startPlay && (possession == "home")) {
if (_root.field[arg].hitTest(_root.field[hrg]) && (breakThru1 == false)) {
rgBlocking = true;
_root.field[arg].gotoAndStop("blocking");
_root.field[hrg].gotoAndStop("blocking");
_root.field[arg]._rotation = _root.field[hrg]._rotation + 180;
block1 = random(blockTime + (diff * 3));
if (((block1 == 2) && (diff != "rookie")) && ((play == 7) || (play == 8))) {
_root.field[arg].gotoAndPlay("run");
breakThru1 = true;
}
if ((block1 == 1) && ((diff != "rookie") || (playLength > 80))) {
if ((((diff != "pro") && (playLength > 20)) || (play == 8)) || (play == 7)) {
_root.field[arg].gotoAndPlay("run");
breakThru1 = true;
}
}
} else {
rgBlocking = false;
}
if (_root.field[alg].hitTest(_root.field[hlg]) && (breakThru2 == false)) {
lgBlocking = true;
_root.field[alg].gotoAndStop("blocking");
_root.field[hlg].gotoAndStop("blocking");
_root.field[alg]._rotation = _root.field[hlg]._rotation + 180;
block2 = random(blockTime + (diff * 3));
if (((block2 == 2) && (diff != "rookie")) && ((play == 7) || (play == 8))) {
_root.field[alg].gotoAndPlay("run");
breakThru2 = true;
}
if ((block2 == 1) && ((diff != "rookie") || (playLength > 80))) {
if ((((diff != "pro") && (playLength > 20)) || (play == 8)) || (play == 7)) {
_root.field[alg].gotoAndPlay("run");
breakThru2 = true;
}
}
} else {
lgBlocking = false;
}
if (_root.field[ac].hitTest(_root.field[hc]) && (breakThru3 == false)) {
cBlocking = true;
_root.field[ac].gotoAndStop("blocking");
_root.field[hc].gotoAndStop("blocking");
_root.field[ac]._rotation = _root.field[hc]._rotation + 180;
block5 = random(blockTime + (diff * 3));
if (((block5 == 2) && (diff != "rookie")) && ((play == 7) || (play == 8))) {
_root.field[ac].gotoAndPlay("run");
breakThru3 = true;
}
if ((block5 == 1) && (diff != "rookie")) {
if ((((diff != "pro") && (playLength > 20)) || (play == 8)) || (play == 7)) {
_root.field[ac].gotoAndPlay("run");
breakThru3 = true;
}
}
} else {
cBlocking = false;
}
}
if (startPlay && (possession == "away")) {
if (_root.field[hrg].hitTest(_root.field[arg]) && (breakThru1 == false)) {
rgBlocking = true;
_root.field[arg].gotoAndStop("blocking");
_root.field[hrg].gotoAndStop("blocking");
_root.field[hrg]._rotation = _root.field[arg]._rotation + 180;
block1 = random((blockTime + 35) - diff);
if (block1 == 1) {
_root.field[hrg].gotoAndPlay("run");
breakThru1 = true;
}
} else {
rgBlocking = false;
}
if (_root.field[hlg].hitTest(_root.field[alg]) && (breakThru2 == false)) {
lgBlocking = true;
_root.field[alg].gotoAndStop("blocking");
_root.field[hlg].gotoAndStop("blocking");
_root.field[hlg]._rotation = _root.field[alg]._rotation + 180;
block2 = random((blockTime + 35) - diff);
if (block2 == 1) {
_root.field[hlg].gotoAndPlay("run");
breakThru2 = true;
}
} else {
lgBlocking = false;
}
if (_root.field[hc].hitTest(_root.field[ac]) && (breakThru3 == false)) {
cBlocking = true;
_root.field[ac].gotoAndStop("blocking");
_root.field[hc].gotoAndStop("blocking");
_root.field[hc]._rotation = _root.field[ac]._rotation + 180;
block5 = random((blockTime + 35) - diff);
if (block5 == 1) {
_root.field[hc].gotoAndPlay("run");
breakThru3 = true;
}
} else {
cBlocking = false;
}
}
}
function determineDir() {
if (possession == "home") {
if ((currentDirWr1 != _root.field[hwr1]._rotation) && (ballHolder != ([homeTeam] + "_wr1"))) {
wr1Delay++;
if (wr1Delay > (7 + diff)) {
wr1Delay = 0;
currentDirWr1 = _root.field[hwr1]._rotation;
}
}
if ((currentDirWr2 != _root.field[hwr2]._rotation) && (ballHolder != ([homeTeam] + "_wr2"))) {
wr2Delay++;
if (wr2Delay > (7 + diff)) {
wr2Delay = 0;
currentDirWr2 = _root.field[hwr2]._rotation;
}
}
if ((currentDirRb != _root.field[hrb]._rotation) && (ballHolder != ([homeTeam] + "_rb"))) {
rbDelay++;
if (rbDelay > (7 + diff)) {
rbDelay = 0;
currentDirRb = _root.field[hrb]._rotation;
}
}
}
if (possession == "away") {
if (((currentDirWr1 != _root.field[awr1]._rotation) && (ballHolder != ([awayTeam] + "_wr1"))) && (activePlayer != ([homeTeam] + "_wr1"))) {
wr1Delay++;
if (wr1Delay > (17 - diff)) {
wr1Delay = 0;
currentDirWr1 = _root.field[awr1]._rotation;
}
}
if (((currentDirWr2 != _root.field[awr2]._rotation) && (ballHolder != ([awayTeam] + "_wr2"))) && (activePlayer != ([homeTeam] + "_wr2"))) {
wr2Delay++;
if (wr2Delay > (17 - diff)) {
wr2Delay = 0;
currentDirWr2 = _root.field[awr2]._rotation;
}
}
if ((((currentDirRb != _root.field[arb]._rotation) && (ballHolder != ([awayTeam] + "_rb"))) && (_root.field[arb]._y < (ballOn + 5))) && (activePlayer != ([homeTeam] + "_rb"))) {
rbDelay++;
if (rbDelay > (17 - diff)) {
rbDelay = 0;
currentDirRb = _root.field[arb]._rotation;
}
}
}
if ((_root.field[ballHolder].hitTest(_root.field.endzone1) && (interception == false)) || (_root.field[ballHolder].hitTest(_root.field.endzone2) && (interception))) {
_root.field.passInfo.gotoAndPlay("touchdown");
dance = true;
if (justScored == false) {
ballOn = 105;
justScored = true;
if (possession == "home") {
homeScore = homeScore + 6;
} else {
awayScore = awayScore + 6;
}
} else {
justScored = false;
if (possession == "home") {
possession = "away";
homeScore = homeScore + 2;
} else {
possession = "home";
awayScore = awayScore + 2;
}
kickOff();
}
afterPlay();
}
}
function AIdefense() {
if (startPlay && (possession == "home")) {
determineDir();
if (ballInMot) {
if ((((_root.field.ball.hitTest(_root.field[awr1]) && (_root.field.ball._xscale < (128 - (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) {
intTimer1++;
if (intTimer1 > 2) {
ballHolder = [awayTeam] + "_wr1";
intProcess();
}
} else {
intTimer1 = 0;
}
if ((((_root.field.ball.hitTest(_root.field[awr2]) && (_root.field.ball._xscale < (128 - (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) {
intTimer2++;
if (intTimer2 > 2) {
ballHolder = [awayTeam] + "_wr2";
intProcess();
}
} else {
intTimer2 = 0;
}
if ((((_root.field.ball.hitTest(_root.field[arb]) && (_root.field.ball._xscale < (128 - (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) {
intTimer3++;
if (intTimer3 > 2) {
ballHolder = [awayTeam] + "_rb";
intProcess();
}
} else {
intTimer3 = 0;
}
if ((((_root.field.ball.hitTest(_root.field[aqb]) && (_root.field.ball._xscale < (128 - (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) {
intTimer4++;
if (intTimer4 > 2) {
ballHolder = [awayTeam] + "_qb";
intProcess();
}
} else {
intTimer4 = 0;
}
if (((((_root.field.ball.hitTest(_root.field[ac]) && (_root.field.ball._xscale < (128 - (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (diff == "allstar")) && (justScored == false)) {
intTimer5++;
if (intTimer5 > 2) {
ballHolder = [awayTeam] + "_c";
intProcess();
}
} else {
intTimer5 = 0;
}
}
if (((((ballHolder == ([homeTeam] + "_qb")) && (_root.field.ball._y <= ballOn)) || (ballHolder == ([homeTeam] + "_wr1"))) || (ballHolder == ([homeTeam] + "_wr2"))) || (ballHolder == ([homeTeam] + "_rb"))) {
wr1Target = ballHolder;
wr2Target = ballHolder;
rbTarget = ballHolder;
qbTarget = ballHolder;
cTarget = ballHolder;
lgTarget = ballHolder;
rgTarget = ballHolder;
crossedLos = true;
}
if (((((Math.abs(_root.field[aqb]._y - _root.field[qbTarget]._y) < 60) || (qbTarget == ([homeTeam] + "_qb"))) || (play == 6)) || (play == 7)) || ((play == 10) && (play != 17))) {
if (defQbRunning == false) {
defQbRunning = true;
_root.field[aqb].gotoAndPlay("run");
}
if (_root.field[aqb]._y == _root.field[qbTarget]._y) {
if (_root.field[aqb]._x < _root.field[qbTarget]._x) {
_root.field[aqb]._rotation = 90;
_root.field[aqb]._x = _root.field[aqb]._x + 2;
}
if (_root.field[aqb]._x > _root.field[qbTarget]._x) {
_root.field[aqb]._rotation = 270;
_root.field[aqb]._x = _root.field[aqb]._x - 2;
}
}
if (_root.field[aqb]._y < _root.field[qbTarget]._y) {
if (_root.field[aqb]._x < _root.field[qbTarget]._x) {
_root.field[aqb]._y = _root.field[aqb]._y + 1.5;
_root.field[aqb]._x = _root.field[aqb]._x + 1.5;
_root.field[aqb]._rotation = 135;
if (_root.field[aqb]._x > _root.field[qbTarget]._x) {
_root.field[aqb]._x = _root.field[qbTarget]._x;
}
} else if (_root.field[aqb]._x > _root.field[qbTarget]._x) {
_root.field[aqb]._y = _root.field[aqb]._y + 1.5;
_root.field[aqb]._x = _root.field[aqb]._x - 1.5;
_root.field[aqb]._rotation = 225;
if (_root.field[aqb]._x < _root.field[qbTarget]._x) {
_root.field[aqb]._x = _root.field[qbTarget]._x;
}
} else {
_root.field[aqb]._y = _root.field[aqb]._y + 2;
_root.field[aqb]._rotation = 180;
}
if (_root.field[aqb]._y > _root.field[qbTarget]._y) {
_root.field[aqb]._y = _root.field[qbTarget]._y;
}
}
if (_root.field[aqb]._y > _root.field[qbTarget]._y) {
if (_root.field[aqb]._x < _root.field[qbTarget]._x) {
_root.field[aqb]._y = _root.field[aqb]._y - 1.5;
_root.field[aqb]._x = _root.field[aqb]._x + 1.5;
_root.field[aqb]._rotation = 45;
if (_root.field[aqb]._x > _root.field[qbTarget]._x) {
_root.field[aqb]._x = _root.field[qbTarget]._x;
}
} else if (_root.field[aqb]._x > _root.field[qbTarget]._x) {
_root.field[aqb]._y = _root.field[aqb]._y - 1.5;
_root.field[aqb]._x = _root.field[aqb]._x - 1.5;
_root.field[aqb]._rotation = 315;
if (_root.field[aqb]._x < _root.field[qbTarget]._x) {
_root.field[aqb]._x = _root.field[qbTarget]._x;
}
} else {
_root.field[aqb]._y = _root.field[aqb]._y - 2;
_root.field[aqb]._rotation = 0;
}
if (_root.field[aqb]._y < _root.field[qbTarget]._y) {
_root.field[aqb]._y = _root.field[qbTarget]._y;
}
}
} else {
_root.field[aqb]._y = _root.field[aqb]._y - 0.5;
if (defQbRunning == false) {
defQbRunning = true;
_root.field[aqb].gotoAndPlay("run");
}
}
if (cBlocking == false) {
if (defCRunning == false) {
defCRunning = true;
_root.field[ac].gotoAndPlay("run");
}
if (_root.field[ac]._y == _root.field[cTarget]._y) {
if (_root.field[ac]._x < _root.field[cTarget]._x) {
_root.field[ac]._rotation = 90;
_root.field[ac]._x = _root.field[ac]._x + 1.7;
}
if (_root.field[ac]._x > _root.field[cTarget]._x) {
_root.field[ac]._rotation = 270;
_root.field[ac]._x = _root.field[ac]._x - 1.7;
}
}
if (_root.field[ac]._y < _root.field[cTarget]._y) {
if (_root.field[ac]._x < _root.field[cTarget]._x) {
_root.field[ac]._y = _root.field[ac]._y + 1.2;
_root.field[ac]._x = _root.field[ac]._x + 1.2;
_root.field[ac]._rotation = 135;
if (_root.field[ac]._x > _root.field[cTarget]._x) {
_root.field[ac]._x = _root.field[cTarget]._x;
}
} else if (_root.field[ac]._x > _root.field[cTarget]._x) {
_root.field[ac]._y = _root.field[ac]._y + 1.2;
_root.field[ac]._x = _root.field[ac]._x - 1.2;
_root.field[ac]._rotation = 225;
if (_root.field[ac]._x < _root.field[cTarget]._x) {
_root.field[ac]._x = _root.field[cTarget]._x;
}
} else {
_root.field[ac]._y = _root.field[ac]._y + 1.7;
_root.field[ac]._rotation = 180;
}
if (_root.field[ac]._y > _root.field[cTarget]._y) {
_root.field[ac]._y = _root.field[cTarget]._y;
}
}
if (_root.field[ac]._y > _root.field[cTarget]._y) {
if (_root.field[ac]._x < _root.field[cTarget]._x) {
_root.field[ac]._y = _root.field[ac]._y - 1.2;
_root.field[ac]._x = _root.field[ac]._x + 1.2;
_root.field[ac]._rotation = 45;
if (_root.field[ac]._x > _root.field[cTarget]._x) {
_root.field[ac]._x = _root.field[cTarget]._x;
}
} else if (_root.field[ac]._x > _root.field[cTarget]._x) {
_root.field[ac]._y = _root.field[ac]._y - 1.2;
_root.field[ac]._x = _root.field[ac]._x - 1.2;
_root.field[ac]._rotation = 315;
if (_root.field[ac]._x < _root.field[cTarget]._x) {
_root.field[ac]._x = _root.field[cTarget]._x;
}
} else {
_root.field[ac]._y = _root.field[ac]._y - 1.7;
_root.field[ac]._rotation = 0;
}
if (_root.field[ac]._y < _root.field[cTarget]._y) {
_root.field[ac]._y = _root.field[cTarget]._y;
}
}
}
if (wr1Delay == 0) {
if (defWr1Running == false) {
defWr1Running = true;
_root.field[awr1].gotoAndPlay("run");
}
if (_root.field[awr1]._y == _root.field[wr1Target]._y) {
if (_root.field[awr1]._x < _root.field[wr1Target]._x) {
_root.field[awr1]._rotation = 90;
_root.field[awr1]._x = _root.field[awr1]._x + 1.9;
}
if (_root.field[awr1]._x > _root.field[wr1Target]._x) {
_root.field[awr1]._rotation = 270;
_root.field[awr1]._x = _root.field[awr1]._x - 1.9;
}
}
if (_root.field[awr1]._y < _root.field[wr1Target]._y) {
if (_root.field[awr1]._x < _root.field[wr1Target]._x) {
_root.field[awr1]._y = _root.field[awr1]._y + 1.4;
_root.field[awr1]._x = _root.field[awr1]._x + 1.4;
_root.field[awr1]._rotation = 135;
if (_root.field[awr1]._x > _root.field[wr1Target]._x) {
_root.field[awr1]._x = _root.field[wr1Target]._x;
}
} else if (_root.field[awr1]._x > _root.field[wr1Target]._x) {
_root.field[awr1]._y = _root.field[awr1]._y + 1.4;
_root.field[awr1]._x = _root.field[awr1]._x - 1.4;
_root.field[awr1]._rotation = 225;
if (_root.field[awr1]._x < _root.field[wr1Target]._x) {
_root.field[awr1]._x = _root.field[wr1Target]._x;
}
} else {
_root.field[awr1]._y = _root.field[awr1]._y + 1.9;
_root.field[awr1]._rotation = 180;
}
if (_root.field[awr1]._y > _root.field[wr1Target]._y) {
_root.field[awr1]._y = _root.field[wr1Target]._y;
}
}
if (_root.field[awr1]._y > _root.field[wr1Target]._y) {
if (_root.field[awr1]._x < _root.field[wr1Target]._x) {
_root.field[awr1]._y = _root.field[awr1]._y - 1.4;
_root.field[awr1]._x = _root.field[awr1]._x + 1.4;
_root.field[awr1]._rotation = 45;
if (_root.field[awr1]._x > _root.field[wr1Target]._x) {
_root.field[awr1]._x = _root.field[wr1Target]._x;
}
} else if (_root.field[awr1]._x > _root.field[wr1Target]._x) {
_root.field[awr1]._y = _root.field[awr1]._y - 1.4;
_root.field[awr1]._x = _root.field[awr1]._x - 1.4;
_root.field[awr1]._rotation = 315;
if (_root.field[awr1]._x < _root.field[wr1Target]._x) {
_root.field[awr1]._x = _root.field[wr1Target]._x;
}
} else {
_root.field[awr1]._y = _root.field[awr1]._y - 1.9;
_root.field[awr1]._rotation = 0;
}
if (_root.field[awr1]._y < _root.field[wr1Target]._y) {
_root.field[awr1]._y = _root.field[wr1Target]._y;
}
}
}
if (wr2Delay == 0) {
if (defWr2Running == false) {
defWr2Running = true;
_root.field[awr2].gotoAndPlay("run");
}
if (_root.field[awr2]._y == _root.field[wr2Target]._y) {
if (_root.field[awr2]._x < _root.field[wr2Target]._x) {
_root.field[awr2]._rotation = 90;
_root.field[awr2]._x = _root.field[awr2]._x + 1.9;
}
if (_root.field[awr2]._x > _root.field[wr2Target]._x) {
_root.field[awr2]._rotation = 270;
_root.field[awr2]._x = _root.field[awr2]._x - 1.9;
}
}
if (_root.field[awr2]._y < _root.field[wr2Target]._y) {
if (_root.field[awr2]._x < _root.field[wr2Target]._x) {
_root.field[awr2]._y = _root.field[awr2]._y + 1.4;
_root.field[awr2]._x = _root.field[awr2]._x + 1.4;
_root.field[awr2]._rotation = 135;
if (_root.field[awr2]._x > _root.field[wr2Target]._x) {
_root.field[awr2]._x = _root.field[wr2Target]._x;
}
} else if (_root.field[awr2]._x > _root.field[wr2Target]._x) {
_root.field[awr2]._y = _root.field[awr2]._y + 1.4;
_root.field[awr2]._x = _root.field[awr2]._x - 1.4;
_root.field[awr2]._rotation = 225;
if (_root.field[awr2]._x < _root.field[wr2Target]._x) {
_root.field[awr2]._x = _root.field[wr2Target]._x;
}
} else {
_root.field[awr2]._y = _root.field[awr2]._y + 1.9;
_root.field[awr2]._rotation = 180;
}
if (_root.field[awr2]._y > _root.field[wr2Target]._y) {
_root.field[awr2]._y = _root.field[wr2Target]._y;
}
}
if (_root.field[awr2]._y > _root.field[wr2Target]._y) {
if (_root.field[awr2]._x < _root.field[wr2Target]._x) {
_root.field[awr2]._y = _root.field[awr2]._y - 1.4;
_root.field[awr2]._x = _root.field[awr2]._x + 1.4;
_root.field[awr2]._rotation = 45;
if (_root.field[awr2]._x > _root.field[wr2Target]._x) {
_root.field[awr2]._x = _root.field[wr2Target]._x;
}
} else if (_root.field[awr2]._x > _root.field[wr2Target]._x) {
_root.field[awr2]._y = _root.field[awr2]._y - 1.4;
_root.field[awr2]._x = _root.field[awr2]._x - 1.4;
_root.field[awr2]._rotation = 315;
if (_root.field[awr2]._x < _root.field[wr2Target]._x) {
_root.field[awr2]._x = _root.field[wr2Target]._x;
}
} else {
_root.field[awr2]._y = _root.field[awr2]._y - 1.9;
_root.field[awr2]._rotation = 0;
}
if (_root.field[awr2]._y < _root.field[wr2Target]._y) {
_root.field[awr2]._y = _root.field[wr2Target]._y;
}
}
}
if ((rbDelay == 0) && ((Math.abs(_root.field[aqb]._y - _root.field[qbTarget]._y) < 60) || (play < 9))) {
if (defRbRunning == false) {
defRbRunning = true;
_root.field[arb].gotoAndPlay("run");
}
if (_root.field[arb]._y == _root.field[rbTarget]._y) {
if (_root.field[arb]._x < _root.field[rbTarget]._x) {
_root.field[arb]._rotation = 90;
_root.field[arb]._x = _root.field[arb]._x + 1.9;
}
if (_root.field[arb]._x > _root.field[rbTarget]._x) {
_root.field[arb]._rotation = 270;
_root.field[arb]._x = _root.field[arb]._x - 1.9;
}
}
if (_root.field[arb]._y < _root.field[rbTarget]._y) {
if (_root.field[arb]._x < _root.field[rbTarget]._x) {
_root.field[arb]._y = _root.field[arb]._y + 1.4;
_root.field[arb]._x = _root.field[arb]._x + 1.4;
_root.field[arb]._rotation = 135;
if (_root.field[arb]._x > _root.field[rbTarget]._x) {
_root.field[arb]._x = _root.field[rbTarget]._x;
}
} else if (_root.field[arb]._x > _root.field[rbTarget]._x) {
_root.field[arb]._y = _root.field[arb]._y + 1.4;
_root.field[arb]._x = _root.field[arb]._x - 1.4;
_root.field[arb]._rotation = 225;
if (_root.field[arb]._x < _root.field[rbTarget]._x) {
_root.field[arb]._x = _root.field[rbTarget]._x;
}
} else {
_root.field[arb]._y = _root.field[arb]._y + 1.9;
_root.field[arb]._rotation = 180;
}
if (_root.field[arb]._y > _root.field[rbTarget]._y) {
_root.field[arb]._y = _root.field[rbTarget]._y;
}
}
if (_root.field[arb]._y > _root.field[rbTarget]._y) {
if (_root.field[arb]._x < _root.field[rbTarget]._x) {
_root.field[arb]._y = _root.field[arb]._y - 1.4;
_root.field[arb]._x = _root.field[arb]._x + 1.4;
_root.field[arb]._rotation = 45;
if (_root.field[arb]._x > _root.field[rbTarget]._x) {
_root.field[arb]._x = _root.field[rbTarget]._x;
}
} else if (_root.field[arb]._x > _root.field[rbTarget]._x) {
_root.field[arb]._y = _root.field[arb]._y - 1.4;
_root.field[arb]._x = _root.field[arb]._x - 1.4;
_root.field[arb]._rotation = 315;
if (_root.field[arb]._x < _root.field[rbTarget]._x) {
_root.field[arb]._x = _root.field[rbTarget]._x;
}
} else {
_root.field[arb]._y = _root.field[arb]._y - 1.9;
_root.field[arb]._rotation = 0;
}
if (_root.field[arb]._y < _root.field[rbTarget]._y) {
_root.field[arb]._y = _root.field[rbTarget]._y;
}
}
}
if ((Math.abs(_root.field[arg]._y - _root.field[rgTarget]._y) < 550) && (rgBlocking == false)) {
if (defRgRunning == false) {
defRgRunning = true;
_root.field[arg].gotoAndPlay("run");
}
if (_root.field[arg]._y == _root.field[rgTarget]._y) {
if (_root.field[arg]._x < _root.field[rgTarget]._x) {
_root.field[arg]._rotation = 90;
_root.field[arg]._x = _root.field[arg]._x + 1.6;
}
if (_root.field[arg]._x > _root.field[rgTarget]._x) {
_root.field[arg]._rotation = 270;
_root.field[arg]._x = _root.field[arg]._x - 1.6;
}
}
if (_root.field[arg]._y < _root.field[rgTarget]._y) {
if (_root.field[arg]._x < _root.field[rgTarget]._x) {
_root.field[arg]._y = _root.field[arg]._y + 1.3;
_root.field[arg]._x = _root.field[arg]._x + 1.3;
_root.field[arg]._rotation = 135;
if (_root.field[arg]._x > _root.field[rgTarget]._x) {
_root.field[arg]._x = _root.field[rgTarget]._x;
}
} else if (_root.field[arg]._x > _root.field[rgTarget]._x) {
_root.field[arg]._y = _root.field[arg]._y + 1.3;
_root.field[arg]._x = _root.field[arg]._x - 1.3;
_root.field[arg]._rotation = 225;
if (_root.field[arg]._x < _root.field[rgTarget]._x) {
_root.field[arg]._x = _root.field[rgTarget]._x;
}
} else {
_root.field[arg]._y = _root.field[arg]._y + 1.6;
_root.field[arg]._rotation = 180;
}
if (_root.field[arg]._y > _root.field[rgTarget]._y) {
_root.field[arg]._y = _root.field[rgTarget]._y;
}
}
if (_root.field[arg]._y > _root.field[rgTarget]._y) {
if (_root.field[arg]._x < _root.field[rgTarget]._x) {
_root.field[arg]._y = _root.field[arg]._y - 1.3;
_root.field[arg]._x = _root.field[arg]._x + 1.3;
_root.field[arg]._rotation = 45;
if (_root.field[arg]._x > _root.field[rgTarget]._x) {
_root.field[arg]._x = _root.field[rgTarget]._x;
}
} else if (_root.field[arg]._x > _root.field[rgTarget]._x) {
_root.field[arg]._y = _root.field[arg]._y - 1.3;
_root.field[arg]._x = _root.field[arg]._x - 1.3;
_root.field[arg]._rotation = 315;
if (_root.field[arg]._x < _root.field[rgTarget]._x) {
_root.field[arg]._x = _root.field[rgTarget]._x;
}
} else {
_root.field[arg]._y = _root.field[arg]._y - 1.6;
_root.field[arg]._rotation = 0;
}
if (_root.field[arg]._y < _root.field[rgTarget]._y) {
_root.field[arg]._y = _root.field[rgTarget]._y;
}
}
}
if ((Math.abs(_root.field[alg]._y - _root.field[lgTarget]._y) < 550) && (lgBlocking == false)) {
if (defLgRunning == false) {
defLgRunning = true;
_root.field[alg].gotoAndPlay("run");
}
if (_root.field[alg]._y == _root.field[lgTarget]._y) {
if (_root.field[alg]._x < _root.field[lgTarget]._x) {
_root.field[alg]._rotation = 90;
_root.field[alg]._x = _root.field[alg]._x + 1.6;
}
if (_root.field[alg]._x > _root.field[lgTarget]._x) {
_root.field[alg]._rotation = 270;
_root.field[alg]._x = _root.field[alg]._x - 1.6;
}
}
if (_root.field[alg]._y < _root.field[lgTarget]._y) {
if (_root.field[alg]._x < _root.field[lgTarget]._x) {
_root.field[alg]._y = _root.field[alg]._y + 1.3;
_root.field[alg]._x = _root.field[alg]._x + 1.3;
_root.field[alg]._rotation = 135;
if (_root.field[alg]._x > _root.field[lgTarget]._x) {
_root.field[alg]._x = _root.field[lgTarget]._x;
}
} else if (_root.field[alg]._x > _root.field[lgTarget]._x) {
_root.field[alg]._y = _root.field[alg]._y + 1.3;
_root.field[alg]._x = _root.field[alg]._x - 1.3;
_root.field[alg]._rotation = 225;
if (_root.field[alg]._x < _root.field[lgTarget]._x) {
_root.field[alg]._x = _root.field[lgTarget]._x;
}
} else {
_root.field[alg]._y = _root.field[alg]._y + 1.6;
_root.field[alg]._rotation = 180;
}
if (_root.field[alg]._y > _root.field[lgTarget]._y) {
_root.field[alg]._y = _root.field[lgTarget]._y;
}
}
if (_root.field[alg]._y > _root.field[lgTarget]._y) {
if (_root.field[alg]._x < _root.field[lgTarget]._x) {
_root.field[alg]._y = _root.field[alg]._y - 1.3;
_root.field[alg]._x = _root.field[alg]._x + 1.3;
_root.field[alg]._rotation = 45;
if (_root.field[alg]._x > _root.field[lgTarget]._x) {
_root.field[alg]._x = _root.field[lgTarget]._x;
}
} else if (_root.field[alg]._x > _root.field[lgTarget]._x) {
_root.field[alg]._y = _root.field[alg]._y - 1.3;
_root.field[alg]._x = _root.field[alg]._x - 1.3;
_root.field[alg]._rotation = 315;
if (_root.field[alg]._x < _root.field[lgTarget]._x) {
_root.field[alg]._x = _root.field[lgTarget]._x;
}
} else {
_root.field[alg]._y = _root.field[alg]._y - 1.6;
_root.field[alg]._rotation = 0;
}
if (_root.field[alg]._y < _root.field[lgTarget]._y) {
_root.field[alg]._y = _root.field[lgTarget]._y;
}
}
}
}
if (startPlay && (possession == "away")) {
determineDir();
if (ballInMot) {
if (((((_root.field.ball.hitTest(_root.field[hwr1]) && (_root.field.ball._xscale < (123 + (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) && (interception == false)) {
intTimer1++;
if (intTimer1 > 2) {
ballHolder = [homeTeam] + "_wr1";
intProcess();
}
} else {
intTimer1 = 0;
}
if (((((_root.field.ball.hitTest(_root.field[hwr2]) && (_root.field.ball._xscale < (123 + (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) && (interception == false)) {
intTimer2++;
if (intTimer2 > 2) {
ballHolder = [homeTeam] + "_wr2";
intProcess();
}
} else {
intTimer2 = 0;
}
if (((((_root.field.ball.hitTest(_root.field[hrb]) && (_root.field.ball._xscale < (123 + (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) && (interception == false)) {
intTimer3++;
if (intTimer3 > 2) {
ballHolder = [homeTeam] + "_rb";
intProcess();
}
} else {
intTimer3 = 0;
}
if (((((_root.field.ball.hitTest(_root.field[hqb]) && (_root.field.ball._xscale < (123 + (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) && (interception == false)) {
intTimer4++;
if (intTimer4 > 2) {
ballHolder = [homeTeam] + "_qb";
intProcess();
}
} else {
intTimer4 = 0;
}
if (((((_root.field.ball.hitTest(_root.field[hc]) && (_root.field.ball._xscale < (123 + (diff / 2)))) && (step > (numOfMoves / 2))) && (skid == false)) && (justScored == false)) && (interception == false)) {
intTimer5++;
if (intTimer5 > 2) {
ballHolder = [homeTeam] + "_c";
intProcess();
}
} else {
intTimer5 = 0;
}
}
if (((((ballHolder == ([awayTeam] + "_qb")) && (_root.field.ball._y <= ballOn)) || (ballHolder == ([awayTeam] + "_wr1"))) || (ballHolder == ([awayTeam] + "_wr2"))) || (ballHolder == ([awayTeam] + "_rb"))) {
wr1Target = ballHolder;
wr2Target = ballHolder;
rbTarget = ballHolder;
qbTarget = ballHolder;
cTarget = ballHolder;
lgTarget = ballHolder;
rgTarget = ballHolder;
}
if (((((((((Math.abs(_root.field[hqb]._y - _root.field[qbTarget]._y) < 100) || (qbTarget == ([awayTeam] + "_qb"))) || (play == 4)) || (play == 6)) || (play == 7)) || (play == 10)) && (activePlayer != ([homeTeam] + "_qb"))) && (!_root.field[ballHolder].hitTest(_root.field.endzone1))) && (!_root.field[ballHolder].hitTest(_root.field.endzone2))) {
if (defQbRunning == false) {
defQbRunning = true;
_root.field[hqb].gotoAndPlay("run");
}
if (_root.field[hqb]._y == _root.field[qbTarget]._y) {
if (_root.field[hqb]._x < _root.field[qbTarget]._x) {
_root.field[hqb]._rotation = 90;
_root.field[hqb]._x = _root.field[hqb]._x + 2;
}
if (_root.field[hqb]._x > _root.field[qbTarget]._x) {
_root.field[hqb]._rotation = 270;
_root.field[hqb]._x = _root.field[hqb]._x - 2;
}
}
if (_root.field[hqb]._y < _root.field[qbTarget]._y) {
if (_root.field[hqb]._x < _root.field[qbTarget]._x) {
_root.field[hqb]._y = _root.field[hqb]._y + 1.5;
_root.field[hqb]._x = _root.field[hqb]._x + 1.5;
_root.field[hqb]._rotation = 135;
if (_root.field[hqb]._x > _root.field[qbTarget]._x) {
_root.field[hqb]._x = _root.field[qbTarget]._x;
}
} else if (_root.field[hqb]._x > _root.field[qbTarget]._x) {
_root.field[hqb]._y = _root.field[hqb]._y + 1.5;
_root.field[hqb]._x = _root.field[hqb]._x - 1.5;
_root.field[hqb]._rotation = 225;
if (_root.field[hqb]._x < _root.field[qbTarget]._x) {
_root.field[hqb]._x = _root.field[qbTarget]._x;
}
} else {
_root.field[hqb]._y = _root.field[hqb]._y + 2;
_root.field[hqb]._rotation = 180;
}
if (_root.field[hqb]._y > _root.field[qbTarget]._y) {
_root.field[hqb]._y = _root.field[qbTarget]._y;
}
}
if (_root.field[hqb]._y > _root.field[qbTarget]._y) {
if (_root.field[hqb]._x < _root.field[qbTarget]._x) {
_root.field[hqb]._y = _root.field[hqb]._y - 1.5;
_root.field[hqb]._x = _root.field[hqb]._x + 1.5;
_root.field[hqb]._rotation = 45;
if (_root.field[hqb]._x > _root.field[qbTarget]._x) {
_root.field[hqb]._x = _root.field[qbTarget]._x;
}
} else if (_root.field[hqb]._x > _root.field[qbTarget]._x) {
_root.field[hqb]._y = _root.field[hqb]._y - 1.5;
_root.field[hqb]._x = _root.field[hqb]._x - 1.5;
_root.field[hqb]._rotation = 315;
if (_root.field[hqb]._x < _root.field[qbTarget]._x) {
_root.field[hqb]._x = _root.field[qbTarget]._x;
}
} else {
_root.field[hqb]._y = _root.field[hqb]._y - 2;
_root.field[hqb]._rotation = 0;
}
if (_root.field[hqb]._y < _root.field[qbTarget]._y) {
_root.field[hqb]._y = _root.field[qbTarget]._y;
}
}
} else if (defQbRunning == false) {
defQbRunning = true;
_root.field[hqb].gotoAndPlay("run");
}
if ((((cBlocking == false) && (activePlayer != ([homeTeam] + "_c"))) && (!_root.field[ballHolder].hitTest(_root.field.endzone1))) && (!_root.field[ballHolder].hitTest(_root.field.endzone2))) {
if (defCRunning == false) {
defCRunning = true;
_root.field[hc].gotoAndPlay("run");
}
if (_root.field[hc]._y == _root.field[cTarget]._y) {
if (_root.field[hc]._x < _root.field[cTarget]._x) {
_root.field[hc]._rotation = 90;
_root.field[hc]._x = _root.field[hc]._x + 1.7;
}
if (_root.field[hc]._x > _root.field[cTarget]._x) {
_root.field[hc]._rotation = 270;
_root.field[hc]._x = _root.field[hc]._x - 1.7;
}
}
if (_root.field[hc]._y < _root.field[cTarget]._y) {
if (_root.field[hc]._x < _root.field[cTarget]._x) {
_root.field[hc]._y = _root.field[hc]._y + 1.2;
_root.field[hc]._x = _root.field[hc]._x + 1.2;
_root.field[hc]._rotation = 135;
if (_root.field[hc]._x > _root.field[cTarget]._x) {
_root.field[hc]._x = _root.field[cTarget]._x;
}
} else if (_root.field[hc]._x > _root.field[cTarget]._x) {
_root.field[hc]._y = _root.field[hc]._y + 1.2;
_root.field[hc]._x = _root.field[hc]._x - 1.2;
_root.field[hc]._rotation = 225;
if (_root.field[hc]._x < _root.field[cTarget]._x) {
_root.field[hc]._x = _root.field[cTarget]._x;
}
} else {
_root.field[hc]._y = _root.field[hc]._y + 1.7;
_root.field[hc]._rotation = 180;
}
if (_root.field[hc]._y > _root.field[cTarget]._y) {
_root.field[hc]._y = _root.field[cTarget]._y;
}
}
if (_root.field[hc]._y > _root.field[cTarget]._y) {
if (_root.field[hc]._x < _root.field[cTarget]._x) {
_root.field[hc]._y = _root.field[hc]._y - 1.2;
_root.field[hc]._x = _root.field[hc]._x + 1.2;
_root.field[hc]._rotation = 45;
if (_root.field[hc]._x > _root.field[cTarget]._x) {
_root.field[hc]._x = _root.field[cTarget]._x;
}
} else if (_root.field[hc]._x > _root.field[cTarget]._x) {
_root.field[hc]._y = _root.field[hc]._y - 1.2;
_root.field[hc]._x = _root.field[hc]._x - 1.2;
_root.field[hc]._rotation = 315;
if (_root.field[hc]._x < _root.field[cTarget]._x) {
_root.field[hc]._x = _root.field[cTarget]._x;
}
} else {
_root.field[hc]._y = _root.field[hc]._y - 1.7;
_root.field[hc]._rotation = 0;
}
if (_root.field[hc]._y < _root.field[cTarget]._y) {
_root.field[hc]._y = _root.field[cTarget]._y;
}
}
}
if ((((wr1Delay == 0) && (activePlayer != ([homeTeam] + "_wr1"))) && (!_root.field[ballHolder].hitTest(_root.field.endzone1))) && (!_root.field[ballHolder].hitTest(_root.field.endzone2))) {
if (defWr1Running == false) {
defWr1Running = true;
_root.field[hwr1].gotoAndPlay("run");
}
if (_root.field[hwr1]._y == _root.field[wr1Target]._y) {
if (_root.field[hwr1]._x < _root.field[wr1Target]._x) {
_root.field[hwr1]._rotation = 90;
_root.field[hwr1]._x = _root.field[hwr1]._x + 1.9;
}
if (_root.field[hwr1]._x > _root.field[wr1Target]._x) {
_root.field[hwr1]._rotation = 270;
_root.field[hwr1]._x = _root.field[hwr1]._x - 1.9;
}
}
if (_root.field[hwr1]._y < _root.field[wr1Target]._y) {
if (_root.field[hwr1]._x < _root.field[wr1Target]._x) {
_root.field[hwr1]._y = _root.field[hwr1]._y + 1.4;
_root.field[hwr1]._x = _root.field[hwr1]._x + 1.4;
_root.field[hwr1]._rotation = 135;
if (_root.field[hwr1]._x > _root.field[wr1Target]._x) {
_root.field[hwr1]._x = _root.field[wr1Target]._x;
}
} else if (_root.field[hwr1]._x > _root.field[wr1Target]._x) {
_root.field[hwr1]._y = _root.field[hwr1]._y + 1.4;
_root.field[hwr1]._x = _root.field[hwr1]._x - 1.4;
_root.field[hwr1]._rotation = 225;
if (_root.field[hwr1]._x < _root.field[wr1Target]._x) {
_root.field[hwr1]._x = _root.field[wr1Target]._x;
}
} else {
_root.field[hwr1]._y = _root.field[hwr1]._y + 1.9;
_root.field[hwr1]._rotation = 180;
}
if (_root.field[hwr1]._y > _root.field[wr1Target]._y) {
_root.field[hwr1]._y = _root.field[wr1Target]._y;
}
}
if (_root.field[hwr1]._y > _root.field[wr1Target]._y) {
if (_root.field[hwr1]._x < _root.field[wr1Target]._x) {
_root.field[hwr1]._y = _root.field[hwr1]._y - 1.4;
_root.field[hwr1]._x = _root.field[hwr1]._x + 1.4;
_root.field[hwr1]._rotation = 45;
if (_root.field[hwr1]._x > _root.field[wr1Target]._x) {
_root.field[hwr1]._x = _root.field[wr1Target]._x;
}
} else if (_root.field[hwr1]._x > _root.field[wr1Target]._x) {
_root.field[hwr1]._y = _root.field[hwr1]._y - 1.4;
_root.field[hwr1]._x = _root.field[hwr1]._x - 1.4;
_root.field[hwr1]._rotation = 315;
if (_root.field[hwr1]._x < _root.field[wr1Target]._x) {
_root.field[hwr1]._x = _root.field[wr1Target]._x;
}
} else {
_root.field[hwr1]._y = _root.field[hwr1]._y - 1.9;
_root.field[hwr1]._rotation = 0;
}
if (_root.field[hwr1]._y < _root.field[wr1Target]._y) {
_root.field[hwr1]._y = _root.field[wr1Target]._y;
}
}
}
if ((((wr2Delay == 0) && (activePlayer != ([homeTeam] + "_wr2"))) && (!_root.field[ballHolder].hitTest(_root.field.endzone1))) && (!_root.field[ballHolder].hitTest(_root.field.endzone2))) {
if (defWr2Running == false) {
defWr2Running = true;
_root.field[hwr2].gotoAndPlay("run");
}
if (_root.field[hwr2]._y == _root.field[wr2Target]._y) {
if (_root.field[hwr2]._x < _root.field[wr2Target]._x) {
_root.field[hwr2]._rotation = 90;
_root.field[hwr2]._x = _root.field[hwr2]._x + 1.9;
}
if (_root.field[hwr2]._x > _root.field[wr2Target]._x) {
_root.field[hwr2]._rotation = 270;
_root.field[hwr2]._x = _root.field[hwr2]._x - 1.9;
}
}
if (_root.field[hwr2]._y < _root.field[wr2Target]._y) {
if (_root.field[hwr2]._x < _root.field[wr2Target]._x) {
_root.field[hwr2]._y = _root.field[hwr2]._y + 1.4;
_root.field[hwr2]._x = _root.field[hwr2]._x + 1.4;
_root.field[hwr2]._rotation = 135;
if (_root.field[hwr2]._x > _root.field[wr2Target]._x) {
_root.field[hwr2]._x = _root.field[wr2Target]._x;
}
} else if (_root.field[hwr2]._x > _root.field[wr2Target]._x) {
_root.field[hwr2]._y = _root.field[hwr2]._y + 1.4;
_root.field[hwr2]._x = _root.field[hwr2]._x - 1.4;
_root.field[hwr2]._rotation = 225;
if (_root.field[hwr2]._x < _root.field[wr2Target]._x) {
_root.field[hwr2]._x = _root.field[wr2Target]._x;
}
} else {
_root.field[hwr2]._y = _root.field[hwr2]._y + 1.9;
_root.field[hwr2]._rotation = 180;
}
if (_root.field[hwr2]._y > _root.field[wr2Target]._y) {
_root.field[hwr2]._y = _root.field[wr2Target]._y;
}
}
if (_root.field[hwr2]._y > _root.field[wr2Target]._y) {
if (_root.field[hwr2]._x < _root.field[wr2Target]._x) {
_root.field[hwr2]._y = _root.field[hwr2]._y - 1.4;
_root.field[hwr2]._x = _root.field[hwr2]._x + 1.4;
_root.field[hwr2]._rotation = 45;
if (_root.field[hwr2]._x > _root.field[wr2Target]._x) {
_root.field[hwr2]._x = _root.field[wr2Target]._x;
}
} else if (_root.field[hwr2]._x > _root.field[wr2Target]._x) {
_root.field[hwr2]._y = _root.field[hwr2]._y - 1.4;
_root.field[hwr2]._x = _root.field[hwr2]._x - 1.4;
_root.field[hwr2]._rotation = 315;
if (_root.field[hwr2]._x < _root.field[wr2Target]._x) {
_root.field[hwr2]._x = _root.field[wr2Target]._x;
}
} else {
_root.field[hwr2]._y = _root.field[hwr2]._y - 1.9;
_root.field[hwr2]._rotation = 0;
}
if (_root.field[hwr2]._y < _root.field[wr2Target]._y) {
_root.field[hwr2]._y = _root.field[wr2Target]._y;
}
}
}
if (((((rbDelay == 0) && ((Math.abs(_root.field[hqb]._y - _root.field[qbTarget]._y) < 60) || (play < 9))) && (activePlayer != ([homeTeam] + "_rb"))) && (!_root.field[ballHolder].hitTest(_root.field.endzone1))) && (!_root.field[ballHolder].hitTest(_root.field.endzone2))) {
if (defRbRunning == false) {
defRbRunning = true;
_root.field[hrb].gotoAndPlay("run");
}
if (_root.field[hrb]._y == _root.field[rbTarget]._y) {
if (_root.field[hrb]._x < _root.field[rbTarget]._x) {
_root.field[hrb]._rotation = 90;
_root.field[hrb]._x = _root.field[hrb]._x + 1.9;
}
if (_root.field[hrb]._x > _root.field[rbTarget]._x) {
_root.field[hrb]._rotation = 270;
_root.field[hrb]._x = _root.field[hrb]._x - 1.9;
}
}
if (_root.field[hrb]._y < _root.field[rbTarget]._y) {
if (_root.field[hrb]._x < _root.field[rbTarget]._x) {
_root.field[hrb]._y = _root.field[hrb]._y + 1.4;
_root.field[hrb]._x = _root.field[hrb]._x + 1.4;
_root.field[hrb]._rotation = 135;
if (_root.field[hrb]._x > _root.field[rbTarget]._x) {
_root.field[hrb]._x = _root.field[rbTarget]._x;
}
} else if (_root.field[hrb]._x > _root.field[rbTarget]._x) {
_root.field[hrb]._y = _root.field[hrb]._y + 1.4;
_root.field[hrb]._x = _root.field[hrb]._x - 1.4;
_root.field[hrb]._rotation = 225;
if (_root.field[hrb]._x < _root.field[rbTarget]._x) {
_root.field[hrb]._x = _root.field[rbTarget]._x;
}
} else {
_root.field[hrb]._y = _root.field[hrb]._y + 1.9;
_root.field[hrb]._rotation = 180;
}
if (_root.field[hrb]._y > _root.field[rbTarget]._y) {
_root.field[hrb]._y = _root.field[rbTarget]._y;
}
}
if (_root.field[hrb]._y > _root.field[rbTarget]._y) {
if (_root.field[hrb]._x < _root.field[rbTarget]._x) {
_root.field[hrb]._y = _root.field[hrb]._y - 1.4;
_root.field[hrb]._x = _root.field[hrb]._x + 1.4;
_root.field[hrb]._rotation = 45;
if (_root.field[hrb]._x > _root.field[rbTarget]._x) {
_root.field[hrb]._x = _root.field[rbTarget]._x;
}
} else if (_root.field[hrb]._x > _root.field[rbTarget]._x) {
_root.field[hrb]._y = _root.field[hrb]._y - 1.4;
_root.field[hrb]._x = _root.field[hrb]._x - 1.4;
_root.field[hrb]._rotation = 315;
if (_root.field[hrb]._x < _root.field[rbTarget]._x) {
_root.field[hrb]._x = _root.field[rbTarget]._x;
}
} else {
_root.field[hrb]._y = _root.field[hrb]._y - 1.9;
_root.field[hrb]._rotation = 0;
}
if (_root.field[hrb]._y < _root.field[rbTarget]._y) {
_root.field[hrb]._y = _root.field[rbTarget]._y;
}
}
}
if (((((Math.abs(_root.field[hrg]._y - _root.field[rgTarget]._y) < 550) && (rgBlocking == false)) && (activePlayer != ([homeTeam] + "_rg"))) && (!_root.field[ballHolder].hitTest(_root.field.endzone1))) && (!_root.field[ballHolder].hitTest(_root.field.endzone2))) {
if (defRgRunning == false) {
defRgRunning = true;
_root.field[hrg].gotoAndPlay("run");
}
if (_root.field[hrg]._y == _root.field[rgTarget]._y) {
if (_root.field[hrg]._x < _root.field[rgTarget]._x) {
_root.field[hrg]._rotation = 90;
_root.field[hrg]._x = _root.field[hrg]._x + 1.6;
}
if (_root.field[hrg]._x > _root.field[rgTarget]._x) {
_root.field[hrg]._rotation = 270;
_root.field[hrg]._x = _root.field[hrg]._x - 1.6;
}
}
if (_root.field[hrg]._y < _root.field[rgTarget]._y) {
if (_root.field[hrg]._x < _root.field[rgTarget]._x) {
_root.field[hrg]._y = _root.field[hrg]._y + 1.3;
_root.field[hrg]._x = _root.field[hrg]._x + 1.3;
_root.field[hrg]._rotation = 135;
if (_root.field[hrg]._x > _root.field[rgTarget]._x) {
_root.field[hrg]._x = _root.field[rgTarget]._x;
}
} else if (_root.field[hrg]._x > _root.field[rgTarget]._x) {
_root.field[hrg]._y = _root.field[hrg]._y + 1.3;
_root.field[hrg]._x = _root.field[hrg]._x - 1.3;
_root.field[hrg]._rotation = 225;
if (_root.field[hrg]._x < _root.field[rgTarget]._x) {
_root.field[hrg]._x = _root.field[rgTarget]._x;
}
} else {
_root.field[hrg]._y = _root.field[hrg]._y + 1.6;
_root.field[hrg]._rotation = 180;
}
if (_root.field[hrg]._y > _root.field[rgTarget]._y) {
_root.field[hrg]._y = _root.field[rgTarget]._y;
}
}
if (_root.field[hrg]._y > _root.field[rgTarget]._y) {
if (_root.field[hrg]._x < _root.field[rgTarget]._x) {
_root.field[hrg]._y = _root.field[hrg]._y - 1.3;
_root.field[hrg]._x = _root.field[hrg]._x + 1.3;
_root.field[hrg]._rotation = 45;
if (_root.field[hrg]._x > _root.field[rgTarget]._x) {
_root.field[hrg]._x = _root.field[rgTarget]._x;
}
} else if (_root.field[hrg]._x > _root.field[rgTarget]._x) {
_root.field[hrg]._y = _root.field[hrg]._y - 1.3;
_root.field[hrg]._x = _root.field[hrg]._x - 1.3;
_root.field[hrg]._rotation = 315;
if (_root.field[hrg]._x < _root.field[rgTarget]._x) {
_root.field[hrg]._x = _root.field[rgTarget]._x;
}
} else {
_root.field[hrg]._y = _root.field[hrg]._y - 1.6;
_root.field[hrg]._rotation = 0;
}
if (_root.field[hrg]._y < _root.field[rgTarget]._y) {
_root.field[hrg]._y = _root.field[rgTarget]._y;
}
}
}
if (((((Math.abs(_root.field[hlg]._y - _root.field[lgTarget]._y) < 550) && (lgBlocking == false)) && (activePlayer != ([homeTeam] + "_lg"))) && (!_root.field[ballHolder].hitTest(_root.field.endzone1))) && (!_root.field[ballHolder].hitTest(_root.field.endzone2))) {
if (defLgRunning == false) {
defLgRunning = true;
_root.field[hlg].gotoAndPlay("run");
}
if (_root.field[hlg]._y == _root.field[lgTarget]._y) {
if (_root.field[hlg]._x < _root.field[lgTarget]._x) {
_root.field[hlg]._rotation = 90;
_root.field[hlg]._x = _root.field[hlg]._x + 1.6;
}
if (_root.field[hlg]._x > _root.field[lgTarget]._x) {
_root.field[hlg]._rotation = 270;
_root.field[hlg]._x = _root.field[hlg]._x - 1.6;
}
}
if (_root.field[hlg]._y < _root.field[lgTarget]._y) {
if (_root.field[hlg]._x < _root.field[lgTarget]._x) {
_root.field[hlg]._y = _root.field[hlg]._y + 1.3;
_root.field[hlg]._x = _root.field[hlg]._x + 1.3;
_root.field[hlg]._rotation = 135;
if (_root.field[hlg]._x > _root.field[lgTarget]._x) {
_root.field[hlg]._x = _root.field[lgTarget]._x;
}
} else if (_root.field[hlg]._x > _root.field[lgTarget]._x) {
_root.field[hlg]._y = _root.field[hlg]._y + 1.3;
_root.field[hlg]._x = _root.field[hlg]._x - 1.3;
_root.field[hlg]._rotation = 225;
if (_root.field[hlg]._x < _root.field[lgTarget]._x) {
_root.field[hlg]._x = _root.field[lgTarget]._x;
}
} else {
_root.field[hlg]._y = _root.field[hlg]._y + 1.6;
_root.field[hlg]._rotation = 180;
}
if (_root.field[hlg]._y > _root.field[lgTarget]._y) {
_root.field[hlg]._y = _root.field[lgTarget]._y;
}
}
if (_root.field[hlg]._y > _root.field[lgTarget]._y) {
if (_root.field[hlg]._x < _root.field[lgTarget]._x) {
_root.field[hlg]._y = _root.field[hlg]._y - 1.3;
_root.field[hlg]._x = _root.field[hlg]._x + 1.3;
_root.field[hlg]._rotation = 45;
if (_root.field[hlg]._x > _root.field[lgTarget]._x) {
_root.field[hlg]._x = _root.field[lgTarget]._x;
}
} else if (_root.field[hlg]._x > _root.field[lgTarget]._x) {
_root.field[hlg]._y = _root.field[hlg]._y - 1.3;
_root.field[hlg]._x = _root.field[hlg]._x - 1.3;
_root.field[hlg]._rotation = 315;
if (_root.field[hlg]._x < _root.field[lgTarget]._x) {
_root.field[hlg]._x = _root.field[lgTarget]._x;
}
} else {
_root.field[hlg]._y = _root.field[hlg]._y - 1.6;
_root.field[hlg]._rotation = 0;
}
if (_root.field[hlg]._y < _root.field[lgTarget]._y) {
_root.field[hlg]._y = _root.field[lgTarget]._y;
}
}
}
}
}
function setRing() {
_root.field.ring._rotation = _root.field[activePlayer]._rotation;
if (_root.field.ring._rotation == 0) {
_root.field.ring._y = _root.field[activePlayer]._y + 8;
_root.field.ring._x = _root.field[activePlayer]._x;
} else if ((_root.field.ring._rotation == 45) || (_root.field.ring._rotation == -315)) {
_root.field.ring._x = _root.field[activePlayer]._x - 4.5;
_root.field.ring._y = _root.field[activePlayer]._y + 5.5;
} else if ((_root.field.ring._rotation == 90) || (_root.field.ring._rotation == -270)) {
_root.field.ring._x = _root.field[activePlayer]._x - 8;
_root.field.ring._y = _root.field[activePlayer]._y;
} else if ((_root.field.ring._rotation == 135) || (_root.field.ring._rotation == -225)) {
_root.field.ring._x = _root.field[activePlayer]._x - 5.5;
_root.field.ring._y = _root.field[activePlayer]._y - 5.5;
} else if ((_root.field.ring._rotation == 180) || (_root.field.ring._rotation == -180)) {
_root.field.ring._y = _root.field[activePlayer]._y - 8;
_root.field.ring._x = _root.field[activePlayer]._x;
} else if ((_root.field.ring._rotation == 225) || (_root.field.ring._rotation == -135)) {
_root.field.ring._x = _root.field[activePlayer]._x + 5.5;
_root.field.ring._y = _root.field[activePlayer]._y - 5.5;
} else if ((_root.field.ring._rotation == 270) || (_root.field.ring._rotation == -90)) {
_root.field.ring._x = _root.field[activePlayer]._x + 8;
_root.field.ring._y = _root.field[activePlayer]._y;
} else if ((_root.field.ring._rotation == 315) || (_root.field.ring._rotation == -45)) {
_root.field.ring._x = _root.field[activePlayer]._x + 4.5;
_root.field.ring._y = _root.field[activePlayer]._y + 5.5;
}
}
function moveSelected() {
if (possession == "away") {
if (!Key.isDown(32)) {
allowChange = true;
}
if (Key.isDown(32) && (allowChange)) {
if ((activePlayer == ([homeTeam] + "_wr1")) && (allowChange)) {
activePlayer = [homeTeam] + "_qb";
allowChange = false;
}
if ((activePlayer == ([homeTeam] + "_qb")) && (allowChange)) {
activePlayer = [homeTeam] + "_wr2";
allowChange = false;
}
if ((activePlayer == ([homeTeam] + "_wr2")) && (allowChange)) {
activePlayer = [homeTeam] + "_rb";
allowChange = false;
}
if ((activePlayer == ([homeTeam] + "_rb")) && (allowChange)) {
activePlayer = [homeTeam] + "_wr1";
allowChange = false;
}
if (((activePlayer == ([homeTeam] + "_rg")) || (activePlayer == ([homeTeam] + "_lg"))) || (activePlayer == ([homeTeam] + "_c"))) {
activePlayer = [homeTeam] + "_qb";
allowChange = false;
}
if (allowChange == false) {
setRing();
}
}
}
if (startPlay == true) {
if (((ballHolder == ([homeTeam] + "_c")) && (possession == "home")) && (interception == false)) {
_root.field.ball._visible = true;
handingBall = true;
_root.field.ball._y = _root.field.ball._y + 3;
if (_root.field.ball.hitTest(_root.field[hqb]) || (_root.field.ball.hitTest(_root.field[hwr1]))) {
kickBall = true;
ballHolder = [homeTeam] + "_qb";
handingBall = false;
_root.field.ball._visible = false;
_root.field[hqb].gotoAndStop("standwball");
alreadyRunning = false;
activePlayer = [homeTeam] + "_qb";
}
}
if (((ballHolder == ([awayTeam] + "_c")) && (possession == "away")) && (interception == false)) {
_root.field.ball._visible = true;
handingBall = true;
_root.field.ball._y = _root.field.ball._y + 3;
if (_root.field.ball.hitTest(_root.field[aqb]) || (_root.field.ball.hitTest(_root.field[awr1]))) {
kickBall = true;
ballHolder = [awayTeam] + "_qb";
handingBall = false;
_root.field.ball._visible = false;
_root.field[aqb].gotoAndStop("standwball");
}
}
if (Key.isDown(38) || ((Key.isDown(87) && (handingBall == false)) && ((play != 17) || (play != 16)))) {
running = true;
if (Key.isDown(37) || (Key.isDown(65))) {
_root.field[activePlayer]._rotation = 315;
_root.field.ring._rotation = 315;
if (possession == "away") {
_root.field[activePlayer]._y = _root.field[activePlayer]._y - 0.3;
_root.field[activePlayer]._x = _root.field[activePlayer]._x - 0.3;
}
_root.field[activePlayer]._y = _root.field[activePlayer]._y - 1;
_root.field[activePlayer]._x = _root.field[activePlayer]._x - 1;
_root.field.ring._x = _root.field[activePlayer]._x + 4.5;
_root.field.ring._y = _root.field[activePlayer]._y + 5.5;
if (activePlayer == ballHolder) {
_root.field.ball._y = _root.field.ball._y - 1;
_root.field.ball._x = _root.field.ball._x - 1;
}
} else if (Key.isDown(39) || (Key.isDown(68) && (handingBall == false))) {
_root.field[activePlayer]._rotation = 45;
_root.field.ring._rotation = 45;
if (possession == "away") {
_root.field[activePlayer]._y = _root.field[activePlayer]._y - 0.3;
_root.field[activePlayer]._x = _root.field[activePlayer]._x + 0.3;
}
_root.field[activePlayer]._y = _root.field[activePlayer]._y - 1;
_root.field[activePlayer]._x = _root.field[activePlayer]._x + 1;
_root.field.ring._x = _root.field[activePlayer]._x - 4.5;
_root.field.ring._y = _root.field[activePlayer]._y + 5.5;
if (activePlayer == ballHolder) {
_root.field.ball._y = _root.field.ball._y - 1;
_root.field.ball._x = _root.field.ball._x + 1;
}
} else {
_root.field[activePlayer]._rotation = 0;
_root.field.ring._rotation = 0;
if (possession == "away") {
_root.field[activePlayer]._y = _root.field[activePlayer]._y - 0.4;
}
_root.field[activePlayer]._y = _root.field[activePlayer]._y - 1.5;
_root.field.ring._x = _root.field[activePlayer]._x;
_root.field.ring._y = _root.field[activePlayer]._y + 8;
if (activePlayer == ballHolder) {
_root.field.ball._y = _root.field.ball._y - 1.5;
}
}
}
if (Key.isDown(40) || ((Key.isDown(83) && (handingBall == false)) && ((play != 17) || (play != 16)))) {
running = true;
if (Key.isDown(37) || (Key.isDown(65))) {
_root.field[activePlayer]._rotation = 225;
_root.field.ring._rotation = 225;
if (possession == "away") {
_root.field[activePlayer]._y = _root.field[activePlayer]._y + 0.3;
_root.field[activePlayer]._x = _root.field[activePlayer]._x - 0.3;
}
_root.field[activePlayer]._y = _root.field[activePlayer]._y + 1;
_root.field[activePlayer]._x = _root.field[activePlayer]._x - 1;
_root.field.ring._x = _root.field[activePlayer]._x + 5.5;
_root.field.ring._y = _root.field[activePlayer]._y - 5.5;
if (activePlayer == ballHolder) {
_root.field.ball._y = _root.field.ball._y + 1;
_root.field.ball._x = _root.field.ball._x - 1;
}
} else if (Key.isDown(39) || (Key.isDown(68) && (handingBall == false))) {
_root.field[activePlayer]._rotation = 135;
_root.field.ring._rotation = 135;
if (possession == "away") {
_root.field[activePlayer]._y = _root.field[activePlayer]._y + 0.3;
_root.field[activePlayer]._x = _root.field[activePlayer]._x + 0.3;
}
_root.field[activePlayer]._y = _root.field[activePlayer]._y + 1;
_root.field[activePlayer]._x = _root.field[activePlayer]._x + 1;
_root.field.ring._x = _root.field[activePlayer]._x - 5.5;
_root.field.ring._y = _root.field[activePlayer]._y - 5.5;
if (activePlayer == ballHolder) {
_root.field.ball._y = _root.field.ball._y + 1;
_root.field.ball._x = _root.field.ball._x + 1;
}
} else {
if (possession == "away") {
_root.field[activePlayer]._y = _root.field[activePlayer]._y + 0.4;
}
_root.field[activePlayer]._y = _root.field[activePlayer]._y + 1.5;
_root.field[activePlayer]._rotation = 180;
_root.field.ring._rotation = 180;
_root.field.ring._x = _root.field[activePlayer]._x;
_root.field.ring._y = _root.field[activePlayer]._y - 8;
if (activePlayer == ballHolder) {
_root.field.ball._y = _root.field.ball._y + 1.5;
}
}
}
if (Key.isDown(39) || ((Key.isDown(68) && (handingBall == false)) && ((play != 17) || (play != 16)))) {
running = true;
if ((((!Key.isDown(87)) && (!Key.isDown(38))) && (!Key.isDown(83))) && (!Key.isDown(40))) {
if (possession == "away") {
_root.field[activePlayer]._x = _root.field[activePlayer]._x + 0.4;
}
_root.field[activePlayer]._x = _root.field[activePlayer]._x + 1.5;
_root.field[activePlayer]._rotation = 90;
_root.field.ring._rotation = 90;
_root.field.ring._x = _root.field[activePlayer]._x - 8;
_root.field.ring._y = _root.field[activePlayer]._y;
if (activePlayer == ballHolder) {
_root.field.ball._x = _root.field.ball._x + 1.5;
}
}
}
if (Key.isDown(37) || ((Key.isDown(65) && (handingBall == false)) && ((play != 17) || (play != 16)))) {
running = true;
if ((((!Key.isDown(87)) && (!Key.isDown(38))) && (!Key.isDown(83))) && (!Key.isDown(40))) {
if (possession == "away") {
_root.field[activePlayer]._x = _root.field[activePlayer]._x - 0.4;
}
_root.field[activePlayer]._x = _root.field[activePlayer]._x - 1.5;
_root.field[activePlayer]._rotation = 270;
_root.field.ring._rotation = 270;
_root.field.ring._x = _root.field[activePlayer]._x + 8;
_root.field.ring._y = _root.field[activePlayer]._y;
if (activePlayer == ballHolder) {
_root.field.ball._x = _root.field.ball._x - 1.5;
}
}
}
if ((running == true) && (alreadyRunning == false)) {
alreadyRunning = true;
if (activePlayer == ballHolder) {
_root.field[activePlayer].gotoAndPlay("runwball");
} else {
_root.field[activePlayer].gotoAndPlay("run");
}
}
if (running == false) {
alreadyRunning = false;
if (activePlayer == ballHolder) {
_root.field[activePlayer].gotoAndStop("standwball");
} else {
_root.field[activePlayer].gotoAndStop(1);
}
}
running = false;
}
}
function determineClosest() {
var _local6 = _xmouse;
var _local5 = _ymouse;
if (possession == "home") {
var _local4 = Math.abs(_root.field[hrb]._x - _local6) + Math.abs(_root.field[hrb]._y - _local5);
var _local3 = Math.abs(_root.field[hwr1]._x - _local6) + Math.abs(_root.field[hwr1]._y - _local5);
var _local2 = Math.abs(_root.field[hwr2]._x - _local6) + Math.abs(_root.field[hwr2]._y - _local5);
if ((_local4 < _local3) && (_local4 < _local2)) {
closest = [homeTeam] + "_rb";
} else if ((_local3 < _local4) && (_local3 < _local2)) {
closest = [homeTeam] + "_wr1";
} else if ((_local2 < _local4) && (_local2 < _local3)) {
closest = [homeTeam] + "_wr2";
}
}
}
function pass() {
if ((skid == true) && (interception == false)) {
skidsLeft--;
skidAdj = skidAdj - 0.1;
skidSpeedX = xMove * skidAdj;
skidSpeedY = yMove * skidAdj;
_root.field.ball._x = _root.field.ball._x + skidSpeedX;
_root.field.ball._y = _root.field.ball._y - skidSpeedY;
if (skidsLeft == 0) {
skid = false;
skidsLeft = 6;
skidAdj = 1;
ballInMot = false;
if (play == 17) {
ballOn = _root.field.hit._y;
interception = true;
if (oob) {
ballOn = savedY;
oob = false;
}
if (ballOn < 96) {
ballOn = 150;
firstDown = "fd1";
}
if (possession == "away") {
possession = "home";
} else {
possession = "away";
}
}
afterPlay();
}
}
if (throwPass && (ballInMot == false)) {
determineClosest();
_root.field.ball._visible = true;
if (possession == "home") {
_root.field[hqb].gotoAndStop(1);
} else {
_root.field[aqb].gotoAndStop(1);
}
ballHolder = "inAir";
difOfX = Math.abs(endX - startX);
difOfY = Math.abs(endY - startY);
passDist = Math.sqrt((difOfX * difOfX) + (difOfY * difOfY));
cosine = Math.atan2(difOfY, difOfX);
passAng = cosine * 57.2957795130823;
numOfMoves = Math.round(passDist / throwSpeed);
yMove = difOfY / numOfMoves;
xMove = difOfX / numOfMoves;
enlargePerMove = (numOfMoves / 2) / enlarge;
ballInMot = true;
step = 0;
step2 = 0;
if (endX > startX) {
newAngle1 = 90 - passAng;
_root.field.ball._rotation = newAngle1;
} else {
newAngle2 = passAng - 270;
_root.field.ball._rotation = newAngle2;
xMove = xMove * -1;
}
}
if ((ballInMot && (finish == false)) && (interception == false)) {
step++;
_root.field.ball._x = _root.field.ball._x + xMove;
_root.field.ball._y = _root.field.ball._y - yMove;
if (((play == 17) && (_root.field.ball._x < 25)) && (oob == false)) {
savedY = _root.field.ball._y;
oob = true;
}
if (((play == 17) && (_root.field.ball._x > 420)) && (oob == false)) {
savedY = _root.field.ball._y;
oob = true;
}
if (((_root.field.ball.hitTest(_root.field[closest]) && (play != 16)) && (play != 17)) && (_root.field[closest]._y > 25)) {
if (_root.field.ball._xscale < 120) {
wr1Delay = 0;
wr2Delay = 0;
rbDelay = 0;
finish = true;
passing = false;
throwPass = false;
ballCaught = true;
ballInMot = false;
skid = false;
finish = false;
if (possession == "home") {
_root.field[activePlayer].gotoAndStop(1);
activePlayer = closest;
ballHolder = activePlayer;
_root.field[activePlayer].gotoAndStop("standwball");
alreadyRunning = false;
_root.field.ring._rotation = _root.field[activePlayer]._rotation;
setRing();
}
if (possession == "away") {
ballHolder = closest;
_root.field[ballHolder].gotoAndPlay("runwball");
_root.field[ballHolder]._rotation = 0;
justCaught = true;
}
if ((_root.field[ballHolder].hitTest(_root.field.endzone1) && (interception == false)) || (_root.field[ballHolder].hitTest(_root.field.endzone2) && (interception))) {
_root.field.passInfo.gotoAndPlay("touchdown");
dance = true;
if (justScored == false) {
ballOn = 105;
justScored = true;
if (possession == "home") {
homeScore = homeScore + 6;
} else {
awayScore = awayScore + 6;
}
} else {
justScored = false;
if (possession == "home") {
possession = "away";
homeScore = homeScore + 2;
} else {
possession = "home";
awayScore = awayScore + 2;
}
kickOff();
}
afterPlay();
} else {
_root.field.passInfo.gotoAndPlay("complete");
}
_root.field.ball._visible = false;
passing = false;
}
}
if (step <= (numOfMoves / 2)) {
_root.field.ball._xscale = _root.field.ball._xscale + enlargePerMove;
_root.field.ball._yscale = _root.field.ball._yscale + enlargePerMove;
} else {
_root.field.ball._xscale = _root.field.ball._xscale - enlargePerMove;
_root.field.ball._yscale = _root.field.ball._yscale - enlargePerMove;
}
if (step == numOfMoves) {
_root.field.ball._xscale = 100;
finish = true;
passing = false;
throwPass = false;
}
}
if (((ballInMot && (finish)) && (ballCaught == false)) && (interception == false)) {
if (step2 == 0) {
if (((kickTaking == "kick") && (startKick)) && (play != 17)) {
_root.field.passInfo.gotoAndPlay("nogood");
if (possession == "home") {
possession = "away";
} else {
possession = "home";
}
if (kickType == "pat") {
kickOff();
} else {
interception = true;
}
afterPlay();
} else if ((startKick == false) && (play != 17)) {
_root.field.passInfo.gotoAndPlay("incomplete");
if (justScored) {
if (possession == "home") {
possession = "away";
} else {
possession = "home";
}
kickOff();
}
}
_root.field.ball.gotoAndStop(1);
_root.field.hit._visible = true;
_root.field.hit._x = _root.field.ball._x;
_root.field.hit._y = _root.field.ball._y;
}
step2++;
_root.field.ball._x = _root.field.ball._x + xMove;
_root.field.ball._y = _root.field.ball._y - yMove;
if (step2 > (numOfMoves * 0.1)) {
_root.field.hit._visible = false;
ballInMot = false;
finish = false;
skid = true;
}
}
}
function movePlayers() {
if (startPlay) {
if (((_root.field[ballHolder]._x < 30) || (_root.field[ballHolder]._x > 420)) && (ballHolder != "inAir")) {
if ((_root.field[ballHolder].hitTest(_root.field.endzone1) && (interception == false)) || (_root.field[ballHolder].hitTest(_root.field.endzone2) && (interception))) {
_root.field.passInfo.gotoAndPlay("touchdown");
dance = true;
if (justScored == false) {
ballOn = 105;
justScored = true;
if (possession == "home") {
homeScore = homeScore + 6;
} else {
awayScore = awayScore + 6;
}
} else {
justScored = false;
if (possession == "home") {
possession = "away";
homeScore = homeScore + 2;
} else {
possession = "home";
awayScore = awayScore + 2;
}
kickOff();
}
afterPlay();
}
ballOn = Math.round(_root.field[ballHolder]._y);
tackled = true;
}
if (possession == "home") {
if ((wr1Dest1 == false) && (activePlayer != ([homeTeam] + "_wr1"))) {
_root.field[hwr1]._rotation = dest1rotationWr1;
if (_root.field[hwr1]._x < (startXwr1 + dest1xWr1)) {
_root.field[hwr1]._x = _root.field[hwr1]._x + dest1speedWr1;
if (_root.field[hwr1]._x >= (startXwr1 + dest1xWr1)) {
_root.field[hwr1]._x = startXwr1 + dest1xWr1;
}
} else if (_root.field[hwr1]._x > (startXwr1 + dest1xWr1)) {
_root.field[hwr1]._x = _root.field[hwr1]._x - dest1speedWr1;
if (_root.field[hwr1]._x <= (startXwr1 + dest1xWr1)) {
_root.field[hwr1]._x = startXwr1 + dest1xWr1;
}
}
if (_root.field[hwr1]._y < (startYwr1 + dest1yWr1)) {
_root.field[hwr1]._y = _root.field[hwr1]._y + dest1speedWr1;
if (_root.field[hwr1]._y >= (startYwr1 + dest1yWr1)) {
_root.field[hwr1]._y = startYwr1 + dest1yWr1;
}
} else if (_root.field[hwr1]._y > (startYwr1 + dest1yWr1)) {
_root.field[hwr1]._y = _root.field[hwr1]._y - dest1speedWr1;
if (_root.field[hwr1]._y <= (startYwr1 + dest1yWr1)) {
}
}
if ((Math.abs(_root.field[hwr1]._x - (startXwr1 + dest1xWr1)) < 5) && (Math.abs(_root.field[hwr1]._y - (startYwr1 + dest1yWr1)) < 5)) {
wr1Dest1 = true;
}
if ((_root.field[hwr1]._x == (startXwr1 + dest1xWr1)) && ((_root.field[hwr1]._y <= (startYwr1 + dest1yWr1)) && (_root.field[hwr1]._rotation != 180))) {
wr1Dest1 = true;
}
if ((_root.field[hwr1]._x == (startXwr1 + dest1xWr1)) && (_root.field[hwr1]._y == (startYwr1 + dest1yWr1))) {
wr1Dest1 = true;
}
if ((_root.field[hwr1]._rotation == 90) && (_root.field[hwr1]._x >= (startXwr1 + dest1xWr1))) {
wr1Dest1 = true;
}
if ((_root.field[hwr1]._rotation == -90) && (_root.field[hwr1]._x <= (startXwr1 + dest1xWr1))) {
wr1Dest1 = true;
}
if ((_root.field[hwr1]._rotation == 0) && (_root.field[hwr1]._y <= (startYwr1 + dest1yWr1))) {
wr1Dest1 = true;
}
if (playLength > 100) {
wr1Dest1 = true;
}
}
if (((wr1Dest1 == true) && (wr1Dest2 == false)) && (activePlayer != ([homeTeam] + "_wr1"))) {
_root.field[hwr1]._rotation = dest2rotationWr1;
if (_root.field[hwr1]._x < (startXwr1 + dest2xWr1)) {
_root.field[hwr1]._x = _root.field[hwr1]._x + dest2speedWr1;
if (_root.field[hwr1]._x >= (startXwr1 + dest2xWr1)) {
_root.field[hwr1]._x = startXwr1 + dest2xWr1;
}
} else if (_root.field[hwr1]._x > (startXwr1 + dest2xWr1)) {
_root.field[hwr1]._x = _root.field[hwr1]._x - dest2speedWr1;
if (_root.field[hwr1]._x <= (startXwr1 + dest2xWr1)) {
_root.field[hwr1]._x = startXwr1 + dest2xWr1;
}
}
if (_root.field[hwr1]._y < (startYwr1 + dest2yWr1)) {
_root.field[hwr1]._y = _root.field[hwr1]._y + dest2speedWr1;
if (_root.field[hwr1]._y >= (startYwr1 + dest2yWr1)) {
_root.field[hwr1]._y = startYwr1 + dest2yWr1;
}
} else if (_root.field[hwr1]._y > (startYwr1 + dest2yWr1)) {
_root.field[hwr1]._y = _root.field[hwr1]._y - dest2speedWr1;
if (_root.field[hwr1]._y <= (startYwr1 + dest2yWr1)) {
_root.field[hwr1]._y = startYwr1 + dest2yWr1;
}
}
if ((_root.field[hwr1]._x == (startXwr1 + dest2xWr1)) && ((_root.field[hwr1]._y <= (startYwr1 + dest2yWr1)) && (_root.field[hwr1]._rotation != 180))) {
wr1Dest2 = true;
}
if ((_root.field[hwr1]._x == (startXwr1 + dest2xWr1)) && (_root.field[hwr1]._y == (startYwr1 + dest2yWr1))) {
wr1Dest2 = true;
}
if ((_root.field[hwr1]._rotation == 90) && (_root.field[hwr1]._x >= (startXwr1 + dest2xWr1))) {
wr1Dest2 = true;
}
if ((_root.field[hwr1]._rotation == -90) && (_root.field[hwr1]._x <= (startXwr1 + dest2xWr1))) {
wr1Dest2 = true;
}
if ((_root.field[hwr1]._rotation == 0) && (_root.field[hwr1]._y <= (startYwr1 + dest2yWr1))) {
wr1Dest2 = true;
}
}
if ((((wr1Dest1 == true) && (wr1Dest2 == true)) && (wr1Dest3 == false)) && (activePlayer != ([homeTeam] + "_wr1"))) {
_root.field[hwr1]._rotation = dest3rotationWr1;
if (_root.field[hwr1]._x < (startXwr1 + dest3xWr1)) {
_root.field[hwr1]._x = _root.field[hwr1]._x + dest3speedWr1;
if (_root.field[hwr1]._x >= (startXwr1 + dest3xWr1)) {
_root.field[hwr1]._x = startXwr1 + dest3xWr1;
}
} else if (_root.field[hwr1]._x > (startXwr1 + dest3xWr1)) {
_root.field[hwr1]._x = _root.field[hwr1]._x - dest3speedWr1;
if (_root.field[hwr1]._x <= (startXwr1 + dest3xWr1)) {
_root.field[hwr1]._x = startXwr1 + dest3xWr1;
}
}
if (_root.field[hwr1]._y < (startYwr1 + dest3yWr1)) {
_root.field[hwr1]._y = _root.field[hwr1]._y + dest3speedWr1;
if (_root.field[hwr1]._y >= (startYwr1 + dest3yWr1)) {
_root.field[hwr1]._y = startYwr1 + dest3yWr1;
}
} else if (_root.field[hwr1]._y > (startYwr1 + dest3yWr1)) {
_root.field[hwr1]._y = _root.field[hwr1]._y - dest3speedWr1;
if (_root.field[hwr1]._y <= (startYwr1 + dest3yWr1)) {
_root.field[hwr1]._y = startYwr1 + dest3yWr1;
}
}
if ((_root.field[hwr1]._x == (startXwr1 + dest3xWr1)) && ((_root.field[hwr1]._y <= (startYwr1 + dest3yWr1)) && (_root.field[hwr1]._rotation != 180))) {
wr1Dest3 = true;
}
if ((_root.field[hwr1]._x == (startXwr1 + dest3xWr1)) && (_root.field[hwr1]._y == (startYwr1 + dest3yWr1))) {
wr1Dest3 = true;
}
if ((_root.field[hwr1]._rotation == 90) && (_root.field[hwr1]._x >= (startXwr1 + dest3xWr1))) {
wr1Dest3 = true;
}
if ((_root.field[hwr1]._rotation == -90) && (_root.field[hwr1]._x <= (startXwr1 + dest3xWr1))) {
wr1Dest3 = true;
}
if ((_root.field[hwr1]._rotation == 0) && (_root.field[hwr1]._y <= (startYwr1 + dest3yWr1))) {
wr1Dest3 = true;
}
}
if ((wr2Dest1 == false) && (activePlayer != ([homeTeam] + "_wr2"))) {
_root.field[hwr2]._rotation = dest1rotationWr2;
if (_root.field[hwr2]._x < (startXwr2 + dest1xWr2)) {
_root.field[hwr2]._x = _root.field[hwr2]._x + dest1speedWr2;
if (_root.field[hwr2]._x >= (startXwr2 + dest1xWr2)) {
_root.field[hwr2]._x = startXwr2 + dest1xWr2;
}
} else if (_root.field[hwr2]._x > (startXwr2 + dest1xWr2)) {
_root.field[hwr2]._x = _root.field[hwr2]._x - dest1speedWr2;
if (_root.field[hwr2]._x <= (startXwr2 + dest1xWr2)) {
_root.field[hwr2]._x = startXwr2 + dest1xWr2;
}
}
if (_root.field[hwr2]._y < (startYwr2 + dest1yWr2)) {
_root.field[hwr2]._y = _root.field[hwr2]._y + dest1speedWr2;
if (_root.field[hwr2]._y >= (startYwr2 + dest1yWr2)) {
_root.field[hwr2]._y = startYwr2 + dest1yWr2;
}
} else if (_root.field[hwr2]._y > (startYwr2 + dest1yWr2)) {
_root.field[hwr2]._y = _root.field[hwr2]._y - dest1speedWr2;
if (_root.field[hwr2]._y <= (startYwr2 + dest1yWr2)) {
_root.field[hwr2]._y = startYwr2 + dest1yWr2;
}
}
if ((_root.field[hwr2]._x == (startXwr2 + dest1xWr2)) && ((_root.field[hwr2]._y <= (startYwr2 + dest1yWr2)) && (_root.field[hwr2]._rotation != 180))) {
wr2Dest1 = true;
}
if ((_root.field[hwr2]._x == (startXwr2 + dest1xWr2)) && (_root.field[hwr2]._y == (startYwr2 + dest1yWr2))) {
wr2Dest1 = true;
}
if ((_root.field[hwr2]._rotation == 90) && (_root.field[hwr2]._x >= (startXwr2 + dest1xWr2))) {
wr2Dest1 = true;
}
if ((_root.field[hwr2]._rotation == -90) && (_root.field[hwr2]._x <= (startXwr2 + dest1xWr2))) {
wr2Dest1 = true;
}
if ((_root.field[hwr2]._rotation == 0) && (_root.field[hwr2]._y <= (startYwr2 + dest1yWr2))) {
wr2Dest1 = true;
}
if (playLength > 100) {
wr2Dest1 = true;
}
}
if (((wr2Dest1 == true) && (wr2Dest2 == false)) && (activePlayer != ([homeTeam] + "_wr2"))) {
_root.field[hwr2]._rotation = dest2rotationWr2;
if (_root.field[hwr2]._x < (startXwr2 + dest2xWr2)) {
_root.field[hwr2]._x = _root.field[hwr2]._x + dest2speedWr2;
if (_root.field[hwr2]._x >= (startXwr2 + dest2xWr2)) {
_root.field[hwr2]._x = startXwr2 + dest2xWr2;
}
} else if (_root.field[hwr2]._x > (startXwr2 + dest2xWr2)) {
_root.field[hwr2]._x = _root.field[hwr2]._x - dest2speedWr2;
if (_root.field[hwr2]._x <= (startXwr2 + dest2xWr2)) {
_root.field[hwr2]._x = startXwr2 + dest2xWr2;
}
}
if (_root.field[hwr2]._y < (startYwr2 + dest2yWr2)) {
_root.field[hwr2]._y = _root.field[hwr2]._y + dest2speedWr2;
if (_root.field[hwr2]._y >= (startYwr2 + dest2yWr2)) {
_root.field[hwr2]._y = startYwr2 + dest2yWr2;
}
} else if (_root.field[hwr2]._y > (startYwr2 + dest2yWr2)) {
_root.field[hwr2]._y = _root.field[hwr2]._y - dest2speedWr2;
if (_root.field[hwr2]._y <= (startYwr2 + dest2yWr2)) {
_root.field[hwr2]._y = startYwr2 + dest2yWr2;
}
}
if ((_root.field[hwr2]._x == (startXwr2 + dest2xWr2)) && ((_root.field[hwr2]._y <= (startYwr2 + dest2yWr2)) && (_root.field[hwr2]._rotation != 180))) {
wr2Dest2 = true;
}
if ((_root.field[hwr2]._x == (startXwr2 + dest2xWr2)) && (_root.field[hwr2]._y == (startYwr2 + dest2yWr2))) {
wr2Dest2 = true;
}
if ((_root.field[hwr2]._rotation == 90) && (_root.field[hwr2]._x >= (startXwr2 + dest2xWr2))) {
wr2Dest2 = true;
}
if ((_root.field[hwr2]._rotation == -90) && (_root.field[hwr2]._x <= (startXwr2 + dest2xWr2))) {
wr2Dest2 = true;
}
if ((_root.field[hwr2]._rotation == 0) && (_root.field[hwr2]._y <= (startYwr2 + dest2yWr2))) {
wr2Dest2 = true;
}
}
if ((((wr2Dest1 == true) && (wr2Dest2 == true)) && (wr2Dest3 == false)) && (activePlayer != ([homeTeam] + "_wr2"))) {
_root.field[hwr2]._rotation = dest3rotationWr2;
if (_root.field[hwr2]._x < (startXwr2 + dest3xWr2)) {
_root.field[hwr2]._x = _root.field[hwr2]._x + dest3speedWr2;
if (_root.field[hwr2]._x >= (startXwr2 + dest3xWr2)) {
_root.field[hwr2]._x = startXwr2 + dest3xWr2;
}
} else if (_root.field[hwr2]._x > (startXwr2 + dest3xWr2)) {
_root.field[hwr2]._x = _root.field[hwr2]._x - dest3speedWr2;
if (_root.field[hwr2]._x <= (startXwr2 + dest3xWr2)) {
_root.field[hwr2]._x = startXwr2 + dest3xWr2;
}
}
if (_root.field[hwr2]._y < (startYwr2 + dest3yWr2)) {
_root.field[hwr2]._y = _root.field[hwr2]._y + dest3speedWr2;
if (_root.field[hwr2]._y >= (startYwr2 + dest3yWr2)) {
_root.field[hwr2]._y = startYwr2 + dest3yWr2;
}
} else if (_root.field[hwr2]._y > (startYwr2 + dest3yWr2)) {
_root.field[hwr2]._y = _root.field[hwr2]._y - dest3speedWr2;
if (_root.field[hwr2]._y <= (startYwr2 + dest3yWr2)) {
_root.field[hwr2]._y = startYwr2 + dest3yWr2;
}
}
if ((_root.field[hwr2]._x == (startXwr2 + dest3xWr2)) && ((_root.field[hwr2]._y <= (startYwr2 + dest3yWr2)) && (_root.field[hwr2]._rotation != 180))) {
wr2Dest3 = true;
}
if ((_root.field[hwr2]._x == (startXwr2 + dest3xWr2)) && (_root.field[hwr2]._y == (startYwr2 + dest3yWr2))) {
wr2Dest3 = true;
}
if ((_root.field[hwr2]._rotation == 90) && (_root.field[hwr2]._x >= (startXwr2 + dest3xWr2))) {
wr2Dest3 = true;
}
if ((_root.field[hwr2]._rotation == -90) && (_root.field[hwr2]._x <= (startXwr2 + dest3xWr2))) {
wr2Dest3 = true;
}
if ((_root.field[hwr2]._rotation == 0) && (_root.field[hwr2]._y <= (startYwr2 + dest3yWr2))) {
wr2Dest3 = true;
}
}
if ((rbDest1 == false) && (activePlayer != ([homeTeam] + "_rb"))) {
_root.field[hrb]._rotation = dest1rotationRb;
if (_root.field[hrb]._x < (startXrb + dest1xRb)) {
_root.field[hrb]._x = _root.field[hrb]._x + dest1speedRb;
if (_root.field[hrb]._x >= (startXrb + dest1xRb)) {
_root.field[hrb]._x = startXrb + dest1xRb;
}
} else if (_root.field[hrb]._x > (startXrb + dest1xRb)) {
_root.field[hrb]._x = _root.field[hrb]._x - dest1speedRb;
if (_root.field[hrb]._x <= (startXrb + dest1xRb)) {
_root.field[hrb]._x = startXrb + dest1xRb;
}
}
if (_root.field[hrb]._y < (startYrb + dest1yRb)) {
_root.field[hrb]._y = _root.field[hrb]._y + dest1speedRb;
if (_root.field[hrb]._y >= (startYrb + dest1yRb)) {
_root.field[hrb]._y = startYrb + dest1yRb;
}
} else if (_root.field[hrb]._y > (startYrb + dest1yRb)) {
_root.field[hrb]._y = _root.field[hrb]._y - dest1speedRb;
if (_root.field[hrb]._y <= (startYrb + dest1yRb)) {
_root.field[hrb]._y = startYrb + dest1yRb;
}
}
if ((_root.field[hrb]._x == (startXrb + dest1xRb)) && ((_root.field[hrb]._y <= (startYrb + dest1yRb)) && (_root.field[hrb]._rotation != 180))) {
rbDest1 = true;
}
if ((_root.field[hrb]._x == startXrbdest1xRb) && (_root.field[hrb]._y == (startYrb + dest1yRb))) {
rbDest1 = true;
}
if ((_root.field[hrb]._rotation == 90) && (_root.field[hrb]._x >= (startXrb + dest1xRb))) {
rbDest1 = true;
}
if ((_root.field[hrb]._rotation == -90) && (_root.field[hrb]._x <= (startXrb + dest1xRb))) {
rbDest1 = true;
}
if ((_root.field[hrb]._rotation == 0) && (_root.field[hrb]._y <= (startYrb + dest1yRb))) {
rbDest1 = true;
}
if (playLength > 100) {
rbDest1 = true;
}
}
if (((rbDest1 == true) && (rbDest2 == false)) && (activePlayer != ([homeTeam] + "_rb"))) {
_root.field[hrb]._rotation = dest2rotationRb;
if (_root.field[hrb]._x < (startXrb + dest2xRb)) {
_root.field[hrb]._x = _root.field[hrb]._x + dest2speedRb;
if (_root.field[hrb]._x >= (startXrb + dest2xRb)) {
_root.field[hrb]._x = startXrb + dest2xRb;
}
} else if (_root.field[hrb]._x > (startXrb + dest2xRb)) {
_root.field[hrb]._x = _root.field[hrb]._x - dest2speedRb;
if (_root.field[hrb]._x <= (startXrb + dest2xRb)) {
_root.field[hrb]._x = startXrb + dest2xRb;
}
}
if (_root.field[hrb]._y < (startYrb + dest2yRb)) {
_root.field[hrb]._y = _root.field[hrb]._y + dest2speedRb;
if (_root.field[hrb]._y >= (startYrb + dest2yRb)) {
_root.field[hrb]._y = startYrb + dest2yRb;
}
} else if (_root.field[hrb]._y > (startYrb + dest2yRb)) {
_root.field[hrb]._y = _root.field[hrb]._y - dest2speedRb;
if (_root.field[hrb]._y <= (startYrb + dest2yRb)) {
_root.field[hrb]._y = startYrb + dest2yRb;
}
}
if ((_root.field[hrb]._x == (startXrb + dest2xRb)) && ((_root.field[hrb]._y <= (startYrb + dest2yRb)) && (_root.field[hrb]._rotation != 180))) {
rbDest2 = true;
}
if ((_root.field[hrb]._x == startXrbdest2xRb) && (_root.field[hrb]._y == (startYrb + dest2yRb))) {
rbDest2 = true;
}
if ((_root.field[hrb]._rotation == 90) && (_root.field[hrb]._x >= (startXrb + dest2xRb))) {
rbDest2 = true;
}
if ((_root.field[hrb]._rotation == -90) && (_root.field[hrb]._x <= (startXrb + dest2xRb))) {
rbDest2 = true;
}
if ((_root.field[hrb]._rotation == 0) && (_root.field[hrb]._y <= (startYrb + dest2yRb))) {
rbDest2 = true;
}
}
if ((((rbDest1 == true) && (rbDest2 == true)) && (rbDest3 == false)) && (activePlayer != ([homeTeam] + "_rb"))) {
_root.field[hrb]._rotation = dest3rotationRb;
if (_root.field[hrb]._x < (startXrb + dest3xRb)) {
_root.field[hrb]._x = _root.field[hrb]._x + dest3speedRb;
if (_root.field[hrb]._x >= (startXrb + dest3xRb)) {
_root.field[hrb]._x = startXrb + dest3xRb;
}
} else if (_root.field[hrb]._x > (startXrb + dest3xRb)) {
_root.field[hrb]._x = _root.field[hrb]._x - dest3speedRb;
if (_root.field[hrb]._x <= (startXrb + dest3xRb)) {
_root.field[hrb]._x = startXrb + dest3xRb;
}
}
if (_root.field[hrb]._y < (startYrb + dest3yRb)) {
_root.field[hrb]._y = _root.field[hrb]._y + dest3speedRb;
if (_root.field[hrb]._y >= (startYrb + dest3yRb)) {
_root.field[hrb]._y = startYrb + dest3yRb;
}
} else if (_root.field[hrb]._y > (startYrb + dest3yRb)) {
_root.field[hrb]._y = _root.field[hrb]._y - dest3speedRb;
if (_root.field[hrb]._y <= (startYrb + dest3yRb)) {
_root.field[hrb]._y = startYrb + dest3yRb;
}
}
if ((_root.field[hrb]._x == (startXrb + dest3xRb)) && ((_root.field[hrb]._y <= (startYrb + dest3yRb)) && (_root.field[hrb]._rotation != 180))) {
rbDest3 = true;
}
if ((_root.field[hrb]._x == startXrbdest3xRb) && (_root.field[hrb]._y == (startYrb + dest3yRb))) {
rbDest3 = true;
}
if ((_root.field[hrb]._rotation == 90) && (_root.field[hrb]._x >= (startXrb + dest3xRb))) {
rbDest3 = true;
}
if ((_root.field[hrb]._rotation == -90) && (_root.field[hrb]._x <= (startXrb + dest3xRb))) {
rbDest3 = true;
}
if ((_root.field[hrb]._rotation == 0) && (_root.field[hrb]._y <= (startYrb + dest3yRb))) {
rbDest3 = true;
}
}
}
if (possession == "away") {
if ((wr1Dest1 == false) && (ballHolder != ([awayTeam] + "_wr1"))) {
_root.field[awr1]._rotation = dest1rotationWr1;
if (_root.field[awr1]._x < (startXwr1 + dest1xWr1)) {
_root.field[awr1]._x = _root.field[awr1]._x + dest1speedWr1;
if (_root.field[awr1]._x >= (startXwr1 + dest1xWr1)) {
_root.field[awr1]._x = startXwr1 + dest1xWr1;
}
} else if (_root.field[awr1]._x > (startXwr1 + dest1xWr1)) {
_root.field[awr1]._x = _root.field[awr1]._x - dest1speedWr1;
if (_root.field[awr1]._x <= (startXwr1 + dest1xWr1)) {
_root.field[awr1]._x = startXwr1 + dest1xWr1;
}
}
if (_root.field[awr1]._y < (startYwr1 + dest1yWr1)) {
_root.field[awr1]._y = _root.field[awr1]._y + dest1speedWr1;
if (_root.field[awr1]._y >= (startYwr1 + dest1yWr1)) {
_root.field[awr1]._y = startYwr1 + dest1yWr1;
}
} else if (_root.field[awr1]._y > (startYwr1 + dest1yWr1)) {
_root.field[awr1]._y = _root.field[awr1]._y - dest1speedWr1;
if (_root.field[awr1]._y <= (startYwr1 + dest1yWr1)) {
}
}
if ((Math.abs(_root.field[awr1]._x - (startXwr1 + dest1xWr1)) < 5) && (Math.abs(_root.field[awr1]._y - (startYwr1 + dest1yWr1)) < 5)) {
wr1Dest1 = true;
}
if ((_root.field[awr1]._x == (startXwr1 + dest1xWr1)) && ((_root.field[awr1]._y <= (startYwr1 + dest1yWr1)) && (_root.field[awr1]._rotation != 180))) {
wr1Dest1 = true;
}
if ((_root.field[awr1]._x == (startXwr1 + dest1xWr1)) && (_root.field[awr1]._y == (startYwr1 + dest1yWr1))) {
wr1Dest1 = true;
}
if ((_root.field[awr1]._rotation == 90) && (_root.field[awr1]._x >= (startXwr1 + dest1xWr1))) {
wr1Dest1 = true;
}
if ((_root.field[awr1]._rotation == -90) && (_root.field[awr1]._x <= (startXwr1 + dest1xWr1))) {
wr1Dest1 = true;
}
if ((_root.field[awr1]._rotation == 0) && (_root.field[awr1]._y <= (startYwr1 + dest1yWr1))) {
wr1Dest1 = true;
}
}
if (((wr1Dest1 == true) && (wr1Dest2 == false)) && (ballHolder != ([awayTeam] + "_wr1"))) {
_root.field[awr1]._rotation = dest2rotationWr1;
if (_root.field[awr1]._x < (startXwr1 + dest2xWr1)) {
_root.field[awr1]._x = _root.field[awr1]._x + dest2speedWr1;
if (_root.field[awr1]._x >= (startXwr1 + dest2xWr1)) {
_root.field[awr1]._x = startXwr1 + dest2xWr1;
}
} else if (_root.field[awr1]._x > (startXwr1 + dest2xWr1)) {
_root.field[awr1]._x = _root.field[awr1]._x - dest2speedWr1;
if (_root.field[awr1]._x <= (startXwr1 + dest2xWr1)) {
_root.field[awr1]._x = startXwr1 + dest2xWr1;
}
}
if (_root.field[awr1]._y < (startYwr1 + dest2yWr1)) {
_root.field[awr1]._y = _root.field[awr1]._y + dest2speedWr1;
if (_root.field[awr1]._y >= (startYwr1 + dest2yWr1)) {
_root.field[awr1]._y = startYwr1 + dest2yWr1;
}
} else if (_root.field[awr1]._y > (startYwr1 + dest2yWr1)) {
_root.field[awr1]._y = _root.field[awr1]._y - dest2speedWr1;
if (_root.field[awr1]._y <= (startYwr1 + dest2yWr1)) {
_root.field[awr1]._y = startYwr1 + dest2yWr1;
}
}
if ((_root.field[awr1]._x == (startXwr1 + dest2xWr1)) && ((_root.field[awr1]._y <= (startYwr1 + dest2yWr1)) && (_root.field[awr1]._rotation != 180))) {
wr1Dest2 = true;
}
if ((_root.field[awr1]._x == (startXwr1 + dest2xWr1)) && (_root.field[awr1]._y == (startYwr1 + dest2yWr1))) {
wr1Dest2 = true;
}
if ((_root.field[awr1]._rotation == 90) && (_root.field[awr1]._x >= (startXwr1 + dest2xWr1))) {
wr1Dest2 = true;
}
if ((_root.field[awr1]._rotation == -90) && (_root.field[awr1]._x <= (startXwr1 + dest2xWr1))) {
wr1Dest2 = true;
}
if ((_root.field[awr1]._rotation == 0) && (_root.field[awr1]._y <= (startYwr1 + dest2yWr1))) {
wr1Dest2 = true;
}
}
if ((((wr1Dest1 == true) && (wr1Dest2 == true)) && (wr1Dest3 == false)) && (ballHolder != ([awayTeam] + "_wr1"))) {
_root.field[awr1]._rotation = dest3rotationWr1;
if (_root.field[awr1]._x < (startXwr1 + dest3xWr1)) {
_root.field[awr1]._x = _root.field[awr1]._x + dest3speedWr1;
if (_root.field[awr1]._x >= (startXwr1 + dest3xWr1)) {
_root.field[awr1]._x = startXwr1 + dest3xWr1;
}
} else if (_root.field[awr1]._x > (startXwr1 + dest3xWr1)) {
_root.field[awr1]._x = _root.field[awr1]._x - dest3speedWr1;
if (_root.field[awr1]._x <= (startXwr1 + dest3xWr1)) {
_root.field[awr1]._x = startXwr1 + dest3xWr1;
}
}
if (_root.field[awr1]._y < (startYwr1 + dest3yWr1)) {
_root.field[awr1]._y = _root.field[awr1]._y + dest3speedWr1;
if (_root.field[awr1]._y >= (startYwr1 + dest3yWr1)) {
_root.field[awr1]._y = startYwr1 + dest3yWr1;
}
} else if (_root.field[awr1]._y > (startYwr1 + dest3yWr1)) {
_root.field[awr1]._y = _root.field[awr1]._y - dest3speedWr1;
if (_root.field[awr1]._y <= (startYwr1 + dest3yWr1)) {
_root.field[awr1]._y = startYwr1 + dest3yWr1;
}
}
if ((_root.field[awr1]._x == (startXwr1 + dest3xWr1)) && ((_root.field[awr1]._y <= (startYwr1 + dest3yWr1)) && (_root.field[awr1]._rotation != 180))) {
wr1Dest3 = true;
}
if ((_root.field[awr1]._x == (startXwr1 + dest3xWr1)) && (_root.field[awr1]._y == (startYwr1 + dest3yWr1))) {
wr1Dest3 = true;
}
if ((_root.field[awr1]._rotation == 90) && (_root.field[awr1]._x >= (startXwr1 + dest3xWr1))) {
wr1Dest3 = true;
}
if ((_root.field[awr1]._rotation == -90) && (_root.field[awr1]._x <= (startXwr1 + dest3xWr1))) {
wr1Dest3 = true;
}
if ((_root.field[awr1]._rotation == 0) && (_root.field[awr1]._y <= (startYwr1 + dest3yWr1))) {
wr1Dest3 = true;
}
}
if ((wr2Dest1 == false) && (ballHolder != ([awayTeam] + "_wr2"))) {
_root.field[awr2]._rotation = dest1rotationWr2;
if (_root.field[awr2]._x < (startXwr2 + dest1xWr2)) {
_root.field[awr2]._x = _root.field[awr2]._x + dest1speedWr2;
if (_root.field[awr2]._x >= (startXwr2 + dest1xWr2)) {
_root.field[awr2]._x = startXwr2 + dest1xWr2;
}
} else if (_root.field[awr2]._x > (startXwr2 + dest1xWr2)) {
_root.field[awr2]._x = _root.field[awr2]._x - dest1speedWr2;
if (_root.field[awr2]._x <= (startXwr2 + dest1xWr2)) {
_root.field[awr2]._x = startXwr2 + dest1xWr2;
}
}
if (_root.field[awr2]._y < (startYwr2 + dest1yWr2)) {
_root.field[awr2]._y = _root.field[awr2]._y + dest1speedWr2;
if (_root.field[awr2]._y >= (startYwr2 + dest1yWr2)) {
_root.field[awr2]._y = startYwr2 + dest1yWr2;
}
} else if (_root.field[awr2]._y > (startYwr2 + dest1yWr2)) {
_root.field[awr2]._y = _root.field[awr2]._y - dest1speedWr2;
if (_root.field[awr2]._y <= (startYwr2 + dest1yWr2)) {
_root.field[awr2]._y = startYwr2 + dest1yWr2;
}
}
if ((_root.field[awr2]._x == (startXwr2 + dest1xWr2)) && ((_root.field[awr2]._y <= (startYwr2 + dest1yWr2)) && (_root.field[awr2]._rotation != 180))) {
wr2Dest1 = true;
}
if ((_root.field[awr2]._x == (startXwr2 + dest1xWr2)) && (_root.field[awr2]._y == (startYwr2 + dest1yWr2))) {
wr2Dest1 = true;
}
if ((_root.field[awr2]._rotation == 90) && (_root.field[awr2]._x >= (startXwr2 + dest1xWr2))) {
wr2Dest1 = true;
}
if ((_root.field[awr2]._rotation == -90) && (_root.field[awr2]._x <= (startXwr2 + dest1xWr2))) {
wr2Dest1 = true;
}
if ((_root.field[awr2]._rotation == 0) && (_root.field[awr2]._y <= (startYwr2 + dest1yWr2))) {
wr2Dest1 = true;
}
}
if (((wr2Dest1 == true) && (wr2Dest2 == false)) && (ballHolder != ([awayTeam] + "_wr2"))) {
_root.field[awr2]._rotation = dest2rotationWr2;
if (_root.field[awr2]._x < (startXwr2 + dest2xWr2)) {
_root.field[awr2]._x = _root.field[awr2]._x + dest2speedWr2;
if (_root.field[awr2]._x >= (startXwr2 + dest2xWr2)) {
_root.field[awr2]._x = startXwr2 + dest2xWr2;
}
} else if (_root.field[awr2]._x > (startXwr2 + dest2xWr2)) {
_root.field[awr2]._x = _root.field[awr2]._x - dest2speedWr2;
if (_root.field[awr2]._x <= (startXwr2 + dest2xWr2)) {
_root.field[awr2]._x = startXwr2 + dest2xWr2;
}
}
if (_root.field[awr2]._y < (startYwr2 + dest2yWr2)) {
_root.field[awr2]._y = _root.field[awr2]._y + dest2speedWr2;
if (_root.field[awr2]._y >= (startYwr2 + dest2yWr2)) {
_root.field[awr2]._y = startYwr2 + dest2yWr2;
}
} else if (_root.field[awr2]._y > (startYwr2 + dest2yWr2)) {
_root.field[awr2]._y = _root.field[awr2]._y - dest2speedWr2;
if (_root.field[awr2]._y <= (startYwr2 + dest2yWr2)) {
_root.field[awr2]._y = startYwr2 + dest2yWr2;
}
}
if ((_root.field[awr2]._x == (startXwr2 + dest2xWr2)) && ((_root.field[awr2]._y <= (startYwr2 + dest2yWr2)) && (_root.field[awr2]._rotation != 180))) {
wr2Dest2 = true;
}
if ((_root.field[awr2]._x == (startXwr2 + dest2xWr2)) && (_root.field[awr2]._y == (startYwr2 + dest2yWr2))) {
wr2Dest2 = true;
}
if ((_root.field[awr2]._rotation == 90) && (_root.field[awr2]._x >= (startXwr2 + dest2xWr2))) {
wr2Dest2 = true;
}
if ((_root.field[awr2]._rotation == -90) && (_root.field[awr2]._x <= (startXwr2 + dest2xWr2))) {
wr2Dest2 = true;
}
if ((_root.field[awr2]._rotation == 0) && (_root.field[awr2]._y <= (startYwr2 + dest2yWr2))) {
wr2Dest2 = true;
}
}
if ((((wr2Dest1 == true) && (wr2Dest2 == true)) && (wr2Dest3 == false)) && (ballHolder != ([awayTeam] + "_wr2"))) {
_root.field[awr2]._rotation = dest3rotationWr2;
if (_root.field[awr2]._x < (startXwr2 + dest3xWr2)) {
_root.field[awr2]._x = _root.field[awr2]._x + dest3speedWr2;
if (_root.field[awr2]._x >= (startXwr2 + dest3xWr2)) {
_root.field[awr2]._x = startXwr2 + dest3xWr2;
}
} else if (_root.field[awr2]._x > (startXwr2 + dest3xWr2)) {
_root.field[awr2]._x = _root.field[awr2]._x - dest3speedWr2;
if (_root.field[awr2]._x <= (startXwr2 + dest3xWr2)) {
_root.field[awr2]._x = startXwr2 + dest3xWr2;
}
}
if (_root.field[awr2]._y < (startYwr2 + dest3yWr2)) {
_root.field[awr2]._y = _root.field[awr2]._y + dest3speedWr2;
if (_root.field[awr2]._y >= (startYwr2 + dest3yWr2)) {
_root.field[awr2]._y = startYwr2 + dest3yWr2;
}
} else if (_root.field[awr2]._y > (startYwr2 + dest3yWr2)) {
_root.field[awr2]._y = _root.field[awr2]._y - dest3speedWr2;
if (_root.field[awr2]._y <= (startYwr2 + dest3yWr2)) {
_root.field[awr2]._y = startYwr2 + dest3yWr2;
}
}
if ((_root.field[awr2]._x == (startXwr2 + dest3xWr2)) && ((_root.field[awr2]._y <= (startYwr2 + dest3yWr2)) && (_root.field[awr2]._rotation != 180))) {
wr2Dest3 = true;
}
if ((_root.field[awr2]._x == (startXwr2 + dest3xWr2)) && (_root.field[awr2]._y == (startYwr2 + dest3yWr2))) {
wr2Dest3 = true;
}
if ((_root.field[awr2]._rotation == 90) && (_root.field[awr2]._x >= (startXwr2 + dest3xWr2))) {
wr2Dest3 = true;
}
if ((_root.field[awr2]._rotation == -90) && (_root.field[awr2]._x <= (startXwr2 + dest3xWr2))) {
wr2Dest3 = true;
}
if ((_root.field[awr2]._rotation == 0) && (_root.field[awr2]._y <= (startYwr2 + dest3yWr2))) {
wr2Dest3 = true;
}
}
if ((rbDest1 == false) && (ballHolder != ([awayTeam] + "_rb"))) {
_root.field[arb]._rotation = dest1rotationRb;
if (_root.field[arb]._x < (startXrb + dest1xRb)) {
_root.field[arb]._x = _root.field[arb]._x + dest1speedRb;
if (_root.field[arb]._x >= (startXrb + dest1xRb)) {
_root.field[arb]._x = startXrb + dest1xRb;
}
} else if (_root.field[arb]._x > (startXrb + dest1xRb)) {
_root.field[arb]._x = _root.field[arb]._x - dest1speedRb;
if (_root.field[arb]._x <= (startXrb + dest1xRb)) {
_root.field[arb]._x = startXrb + dest1xRb;
}
}
if (_root.field[arb]._y < (startYrb + dest1yRb)) {
_root.field[arb]._y = _root.field[arb]._y + dest1speedRb;
if (_root.field[arb]._y >= (startYrb + dest1yRb)) {
_root.field[arb]._y = startYrb + dest1yRb;
}
} else if (_root.field[arb]._y > (startYrb + dest1yRb)) {
_root.field[arb]._y = _root.field[arb]._y - dest1speedRb;
if (_root.field[arb]._y <= (startYrb + dest1yRb)) {
_root.field[arb]._y = startYrb + dest1yRb;
}
}
if ((_root.field[arb]._x == (startXrb + dest1xRb)) && ((_root.field[arb]._y <= (startYrb + dest1yRb)) && (_root.field[arb]._rotation != 180))) {
rbDest1 = true;
}
if ((_root.field[arb]._x == startXrbdest1xRb) && (_root.field[arb]._y == (startYrb + dest1yRb))) {
rbDest1 = true;
}
if ((_root.field[arb]._rotation == 90) && (_root.field[arb]._x >= (startXrb + dest1xRb))) {
rbDest1 = true;
}
if ((_root.field[arb]._rotation == -90) && (_root.field[arb]._x <= (startXrb + dest1xRb))) {
rbDest1 = true;
}
if ((_root.field[arb]._rotation == 0) && (_root.field[arb]._y <= (startYrb + dest1yRb))) {
rbDest1 = true;
}
}
if (((rbDest1 == true) && (rbDest2 == false)) && (ballHolder != ([awayTeam] + "_rb"))) {
_root.field[arb]._rotation = dest2rotationRb;
if (_root.field[arb]._x < (startXrb + dest2xRb)) {
_root.field[arb]._x = _root.field[arb]._x + dest2speedRb;
if (_root.field[arb]._x >= (startXrb + dest2xRb)) {
_root.field[arb]._x = startXrb + dest2xRb;
}
} else if (_root.field[arb]._x > (startXrb + dest2xRb)) {
_root.field[arb]._x = _root.field[arb]._x - dest2speedRb;
if (_root.field[arb]._x <= (startXrb + dest2xRb)) {
_root.field[arb]._x = startXrb + dest2xRb;
}
}
if (_root.field[arb]._y < (startYrb + dest2yRb)) {
_root.field[arb]._y = _root.field[arb]._y + dest2speedRb;
if (_root.field[arb]._y >= (startYrb + dest2yRb)) {
_root.field[arb]._y = startYrb + dest2yRb;
}
} else if (_root.field[arb]._y > (startYrb + dest2yRb)) {
_root.field[arb]._y = _root.field[arb]._y - dest2speedRb;
if (_root.field[arb]._y <= (startYrb + dest2yRb)) {
_root.field[arb]._y = startYrb + dest2yRb;
}
}
if ((_root.field[arb]._x == (startXrb + dest2xRb)) && ((_root.field[arb]._y <= (startYrb + dest2yRb)) && (_root.field[arb]._rotation != 180))) {
rbDest2 = true;
}
if ((_root.field[arb]._x == startXrbdest2xRb) && (_root.field[arb]._y == (startYrb + dest2yRb))) {
rbDest2 = true;
}
if ((_root.field[arb]._rotation == 90) && (_root.field[arb]._x >= (startXrb + dest2xRb))) {
rbDest2 = true;
}
if ((_root.field[arb]._rotation == -90) && (_root.field[arb]._x <= (startXrb + dest2xRb))) {
rbDest2 = true;
}
if ((_root.field[arb]._rotation == 0) && (_root.field[arb]._y <= (startYrb + dest2yRb))) {
rbDest2 = true;
}
}
if ((((rbDest1 == true) && (rbDest2 == true)) && (rbDest3 == false)) && (ballHolder != ([awayTeam] + "_rb"))) {
_root.field[arb]._rotation = dest3rotationRb;
if (_root.field[arb]._x < (startXrb + dest3xRb)) {
_root.field[arb]._x = _root.field[arb]._x + dest3speedRb;
if (_root.field[arb]._x >= (startXrb + dest3xRb)) {
_root.field[arb]._x = startXrb + dest3xRb;
}
} else if (_root.field[arb]._x > (startXrb + dest3xRb)) {
_root.field[arb]._x = _root.field[arb]._x - dest3speedRb;
if (_root.field[arb]._x <= (startXrb + dest3xRb)) {
_root.field[arb]._x = startXrb + dest3xRb;
}
}
if (_root.field[arb]._y < (startYrb + dest3yRb)) {
_root.field[arb]._y = _root.field[arb]._y + dest3speedRb;
if (_root.field[arb]._y >= (startYrb + dest3yRb)) {
_root.field[arb]._y = startYrb + dest3yRb;
}
} else if (_root.field[arb]._y > (startYrb + dest3yRb)) {
_root.field[arb]._y = _root.field[arb]._y - dest3speedRb;
if (_root.field[arb]._y <= (startYrb + dest3yRb)) {
_root.field[arb]._y = startYrb + dest3yRb;
}
}
if ((_root.field[arb]._x == (startXrb + dest3xRb)) && ((_root.field[arb]._y <= (startYrb + dest3yRb)) && (_root.field[arb]._rotation != 180))) {
rbDest3 = true;
}
if ((_root.field[arb]._x == startXrbdest3xRb) && (_root.field[arb]._y == (startYrb + dest3yRb))) {
rbDest3 = true;
}
if ((_root.field[arb]._rotation == 90) && (_root.field[arb]._x >= (startXrb + dest3xRb))) {
rbDest3 = true;
}
if ((_root.field[arb]._rotation == -90) && (_root.field[arb]._x <= (startXrb + dest3xRb))) {
rbDest3 = true;
}
if ((_root.field[arb]._rotation == 0) && (_root.field[arb]._y <= (startYrb + dest3yRb))) {
rbDest3 = true;
}
}
}
}
}
function choosePlay() {
if (choosingPlay) {
_root.playMenu._visible = true;
} else {
_root.playMenu._visible = false;
}
if ((possession == "home") && (checkForSnap)) {
if (Key.isDown(32)) {
runClock = true;
checkForSnap = false;
startPlay = true;
crossedLos = false;
if (play != 17) {
_root.field[hwr1].gotoAndPlay("run");
_root.field[hwr2].gotoAndPlay("run");
_root.field[hrb].gotoAndPlay("run");
}
}
}
if ((possession == "away") && (checkForSnap)) {
snapTimer++;
if ((snapDelay == 0) && (snapTimer > 36)) {
snapNow = true;
}
if ((snapDelay == 1) && (snapTimer > 48)) {
snapNow = true;
}
if ((snapDelay == 2) && (snapTimer > 72)) {
snapNow = true;
}
if (snapNow) {
runClock = true;
checkForSnap = false;
startPlay = true;
crossedLos = false;
if (play != 17) {
_root.field[awr1].gotoAndPlay("run");
_root.field[awr2].gotoAndPlay("run");
_root.field[arb].gotoAndPlay("run");
}
snapNow = false;
}
}
}
function intProcess() {
if (ballOn != 105) {
_root.field.hit._visible = false;
if (!(play === 17)) {
_root.field.passInfo.gotoAndPlay("interception");
}
_root.field.ball._visible = false;
justScored = false;
closest = "null";
interception = true;
finish = true;
passing = false;
throwPass = false;
ballCaught = true;
ballInMot = false;
skid = false;
finish = false;
wr1Target = ballHolder;
wr2Target = ballHolder;
qbTarget = ballHolder;
rbTarget = ballHolder;
cTarget = ballHolder;
rgTarget = ballHolder;
lgTarget = ballHolder;
if (possession == "home") {
possession = "away";
_root.field[ballHolder].gotoAndPlay("runwball");
_root.field[ballHolder]._rotation = 180;
_root.field[hwr1].gotoAndPlay("run");
_root.field[hwr2].gotoAndPlay("run");
_root.field[hrb].gotoAndPlay("run");
_root.field[hqb].gotoAndPlay("run");
_root.field[hc].gotoAndPlay("run");
_root.field[hlg].gotoAndPlay("run");
_root.field[hrg].gotoAndPlay("run");
} else if (possession == "away") {
possession = "home";
activePlayer = ballHolder;
setRing();
_root.field[awr1].gotoAndPlay("run");
_root.field[awr2].gotoAndPlay("run");
_root.field[arb].gotoAndPlay("run");
_root.field[aqb].gotoAndPlay("run");
_root.field[ac].gotoAndPlay("run");
_root.field[alg].gotoAndPlay("run");
_root.field[arg].gotoAndPlay("run");
}
}
}
function assignValues() {
if (possession == "away") {
gplay = play;
play = random(10) + 1;
if ((toGo < 5) || (ballOn < 150)) {
var _local3 = random(4);
if (_local3 == 0) {
play = 4;
} else if (_local3 == 1) {
play = 6;
} else if (_local3 == 2) {
play = 9;
} else {
play = 10;
}
}
if (((justScored && ((homeScore - awayScore) != 2)) && ((homeScore - awayScore) != 5)) && ((homeScore - awayScore) != 9)) {
down = 0;
toGo = 0;
kickType = "pat";
play = 16;
formation = 8;
} else if ((toGo < 5) || (ballOn < 150)) {
var _local3 = random(4);
if (_local3 == 0) {
play = 4;
} else if (_local3 == 1) {
play = 6;
} else if (_local3 == 2) {
play = 9;
} else {
play = 10;
}
}
if (down == 4) {
if ((ballOn <= 225) && ((quarter != 4) || ((homeScore - awayScore) < 3))) {
play = 16;
kickType = "fg";
formation = 8;
} else if ((quarter == 4) && ((homeScore - awayScore) > 3)) {
play = random(10) + 1;
} else {
play = 17;
formation = 9;
}
}
if (play < 9) {
moveBack = false;
}
snapDelay = random(2);
snapTimer = 0;
if ((((play == 1) || (play == 2)) || (play == 3)) || (play == 4)) {
formation = 1;
} else if ((play == 5) || (play == 6)) {
formation = 2;
} else if ((play == 7) || (play == 8)) {
formation = 3;
} else if (play == 9) {
formation = 5;
} else if (play == 10) {
formation = 7;
}
}
ballInMot = false;
finish = false;
interception = false;
passing = false;
randomVal1 = random(2);
randomVal2 = random(3);
var _local2 = (_root.play * 12) - 12;
dest1xWr1 = pass1wr1[_local2 + 0];
dest1yWr1 = pass1wr1[_local2 + 1];
dest1speedWr1 = pass1wr1[_local2 + 2];
dest1rotationWr1 = pass1wr1[_local2 + 3];
dest2xWr1 = pass1wr1[_local2 + 4];
dest2yWr1 = pass1wr1[_local2 + 5];
dest2speedWr1 = pass1wr1[_local2 + 6];
dest2rotationWr1 = pass1wr1[_local2 + 7];
dest3xWr1 = pass1wr1[_local2 + 8];
dest3yWr1 = pass1wr1[_local2 + 9];
dest3speedWr1 = pass1wr1[_local2 + 10];
dest3rotationWr1 = pass1wr1[_local2 + 11];
dest1xWr2 = pass1wr2[_local2 + 0];
dest1yWr2 = pass1wr2[_local2 + 1];
dest1speedWr2 = pass1wr2[_local2 + 2];
dest1rotationWr2 = pass1wr2[_local2 + 3];
dest2xWr2 = pass1wr2[_local2 + 4];
dest2yWr2 = pass1wr2[_local2 + 5];
dest2speedWr2 = pass1wr2[_local2 + 6];
dest2rotationWr2 = pass1wr2[_local2 + 7];
dest3xWr2 = pass1wr2[_local2 + 8];
dest3yWr2 = pass1wr2[_local2 + 9];
dest3speedWr2 = pass1wr2[_local2 + 10];
dest3rotationWr2 = pass1wr2[_local2 + 11];
dest1xRb = pass1rb[_local2 + 0];
dest1yRb = pass1rb[_local2 + 1];
dest1speedRb = pass1rb[_local2 + 2];
dest1rotationRb = pass1rb[_local2 + 3];
dest2xRb = pass1rb[_local2 + 4];
dest2yRb = pass1rb[_local2 + 5];
dest2speedRb = pass1rb[_local2 + 6];
dest2rotationRb = pass1rb[_local2 + 7];
dest3xRb = pass1rb[_local2 + 8];
dest3yRb = pass1rb[_local2 + 9];
dest3speedRb = pass1rb[_local2 + 10];
dest3rotationRb = pass1rb[_local2 + 11];
dest1xC = pass1c[_local2 + 0];
dest1yC = pass1c[_local2 + 1];
dest1speedC = pass1c[_local2 + 2];
dest1rotationC = pass1c[_local2 + 3];
dest2xC = pass1c[_local2 + 4];
dest2yC = pass1c[_local2 + 5];
dest2speedC = pass1c[_local2 + 6];
dest2rotationC = pass1c[_local2 + 7];
dest3xC = pass1c[_local2 + 8];
dest3yC = pass1c[_local2 + 9];
dest3speedC = pass1c[_local2 + 10];
dest3rotationC = pass1c[_local2 + 11];
_root.field[hlg].gotoAndStop(1);
_root.field[hrg].gotoAndStop(1);
_root.field[hc].gotoAndStop(1);
_root.field[hrb].gotoAndStop(1);
_root.field[hqb].gotoAndStop(1);
_root.field[hwr1].gotoAndStop(1);
_root.field[hwr2].gotoAndStop(1);
_root.field[alg].gotoAndStop(1);
_root.field[arg].gotoAndStop(1);
_root.field[ac].gotoAndStop(1);
_root.field[arb].gotoAndStop(1);
_root.field[aqb].gotoAndStop(1);
_root.field[awr1].gotoAndStop(1);
_root.field[awr2].gotoAndStop(1);
ballCaught = false;
wr1Target = [homeTeam] + "_wr1";
wr2Target = [homeTeam] + "_wr2";
rbTarget = [homeTeam] + "_rb";
qbTarget = [homeTeam] + "_qb";
cTarget = [homeTeam] + "null";
lgTarget = [homeTeam] + "_qb";
rgTarget = [homeTeam] + "_qb";
currentDirWr1 = _root.field[hwr1]._rotation;
currentDirWr2 = _root.field[hwr2]._rotation;
defPlay = random(10) + 1;
if (possession == "away") {
defPlay = 0;
wr1Target = [awayTeam] + "_wr1";
wr2Target = [awayTeam] + "_wr2";
rbTarget = [awayTeam] + "_rb";
qbTarget = [awayTeam] + "null";
cTarget = [awayeam] + "_c";
lgTarget = [awayTeam] + "_qb";
rgTarget = [awayTeam] + "_qb";
currentDirWr1 = _root.field[awr1]._rotation;
currentDirWr2 = _root.field[awr2]._rotation;
}
currentDirRb = 0;
wr1Delay = 0;
wr2Delay = 0;
rbDelay = 0;
qbDelay = 0;
cDelay = 0;
if (((defPlay == play) || (gplay == play)) && (diff != "rookie")) {
breakThru1 = true;
breakThru2 = true;
breakThru3 = true;
}
}
function setPlayers() {
if (setTeam == true) {
if (possession == "home") {
setTeam = false;
arrayValue = (7 * formation) - 7;
_root.field[hlg]._x = offFormationX[arrayValue] + xAdj;
_root.field[hc]._x = offFormationX[arrayValue + 1] + xAdj;
startXc = _root.field[hc]._x;
_root.field[hrg]._x = offFormationX[arrayValue + 2] + xAdj;
_root.field[hwr1]._x = offFormationX[arrayValue + 3] + xAdj;
startXwr1 = _root.field[hwr1]._x;
_root.field[hwr2]._x = offFormationX[arrayValue + 4] + xAdj;
startXwr2 = _root.field[hwr2]._x;
_root.field[hqb]._x = offFormationX[arrayValue + 5] + xAdj;
_root.field[hrb]._x = offFormationX[arrayValue + 6] + xAdj;
startXrb = _root.field[hrb]._x;
_root.field[hlg]._y = (offFormationY[arrayValue] + ballOn) + yAdj;
_root.field[hc]._y = (offFormationY[arrayValue + 1] + ballOn) + yAdj;
startYc = _root.field[hc]._y;
_root.field[hrg]._y = (offFormationY[arrayValue + 2] + ballOn) + yAdj;
_root.field[hwr1]._y = (offFormationY[arrayValue + 3] + ballOn) + yAdj;
startYwr1 = _root.field[hwr1]._y;
_root.field[hwr2]._y = (offFormationY[arrayValue + 4] + ballOn) + yAdj;
startYwr2 = _root.field[hwr2]._y;
_root.field[hqb]._y = (offFormationY[arrayValue + 5] + ballOn) + yAdj;
_root.field[hrb]._y = (offFormationY[arrayValue + 6] + ballOn) + yAdj;
startYrb = _root.field[hrb]._y;
_root.field[alg]._x = defFormationX[arrayValue] + xAdj;
_root.field[ac]._x = defFormationX[arrayValue + 1] + xAdj;
_root.field[arg]._x = defFormationX[arrayValue + 2] + xAdj;
_root.field[awr1]._x = defFormationX[arrayValue + 3] + xAdj;
_root.field[awr2]._x = defFormationX[arrayValue + 4] + xAdj;
_root.field[aqb]._x = defFormationX[arrayValue + 5] + xAdj;
_root.field[arb]._x = defFormationX[arrayValue + 6] + xAdj;
_root.field[alg]._y = (defFormationY[arrayValue] + ballOn) + yAdj;
_root.field[ac]._y = (defFormationY[arrayValue + 1] + ballOn) + yAdj;
_root.field[arg]._y = (defFormationY[arrayValue + 2] + ballOn) + yAdj;
_root.field[awr1]._y = (defFormationY[arrayValue + 3] + ballOn) + yAdj;
_root.field[awr2]._y = (defFormationY[arrayValue + 4] + ballOn) + yAdj;
_root.field[aqb]._y = (defFormationY[arrayValue + 5] + ballOn) + yAdj;
_root.field[arb]._y = (defFormationY[arrayValue + 6] + ballOn) + yAdj;
_root.field[alg]._rotation = 180;
_root.field[arg]._rotation = 180;
_root.field[ac]._rotation = 180;
_root.field[aqb]._rotation = 180;
_root.field[arb]._rotation = 180;
_root.field[awr1]._rotation = 180;
_root.field[awr2]._rotation = 180;
ballHolder = [homeTeam] + "_c";
var _local4 = homeTeam + "_qb";
_root.field.ring._x = _root.field[_local4]._x;
_root.field.ring._y = _root.field[_local4]._y + 8;
_root.field.ball._x = _root.field[hc]._x;
_root.field.ball._y = _root.field[hc]._y;
if (play == 17) {
_root.field.ring._visible = false;
_root.field.kickMeter._x = _root.field[hc]._x + 80;
_root.field.kickMeter._y = _root.field[hc]._y - 16;
_root.field.kickMeter.direction._visible = false;
_root.field.kickMeter._visible = true;
kickPower = 0;
kickDirection = 0;
kickTaking = "power";
}
if (play == 16) {
_root.field[hwr1]._rotation = 270;
_root.field[hwr2]._rotation = 45;
_root.field.ring._visible = false;
_root.field.kickMeter._x = _root.field[hc]._x + 80;
_root.field.kickMeter._y = _root.field[hc]._y - 16;
_root.field.kickMeter.direction._visible = false;
_root.field.kickMeter._visible = true;
kickPower = 0;
kickDirection = 0;
kickTaking = "power";
}
}
if (possession == "away") {
setTeam = false;
arrayValue = (7 * formation) - 7;
_root.field[alg]._x = offFormationX[arrayValue] + xAdj;
_root.field[ac]._x = offFormationX[arrayValue + 1] + xAdj;
_root.field[arg]._x = offFormationX[arrayValue + 2] + xAdj;
_root.field[awr1]._x = offFormationX[arrayValue + 3] + xAdj;
startXwr1 = _root.field[awr1]._x;
_root.field[awr2]._x = offFormationX[arrayValue + 4] + xAdj;
startXwr2 = _root.field[awr2]._x;
_root.field[aqb]._x = offFormationX[arrayValue + 5] + xAdj;
_root.field[arb]._x = offFormationX[arrayValue + 6] + xAdj;
startXrb = _root.field[arb]._x;
_root.field[alg]._y = (offFormationY[arrayValue] + ballOn) + yAdj;
_root.field[ac]._y = (offFormationY[arrayValue + 1] + ballOn) + yAdj;
_root.field[arg]._y = (offFormationY[arrayValue + 2] + ballOn) + yAdj;
_root.field[awr1]._y = (offFormationY[arrayValue + 3] + ballOn) + yAdj;
startYwr1 = _root.field[awr1]._y;
_root.field[awr2]._y = (offFormationY[arrayValue + 4] + ballOn) + yAdj;
startYwr2 = _root.field[awr2]._y;
_root.field[aqb]._y = (offFormationY[arrayValue + 5] + ballOn) + yAdj;
_root.field[arb]._y = (offFormationY[arrayValue + 6] + ballOn) + yAdj;
startYrb = _root.field[arb]._y;
_root.field[hlg]._x = defFormationX[arrayValue] + xAdj;
_root.field[hc]._x = defFormationX[arrayValue + 1] + xAdj;
_root.field[hrg]._x = defFormationX[arrayValue + 2] + xAdj;
_root.field[hwr1]._x = defFormationX[arrayValue + 3] + xAdj;
_root.field[hwr2]._x = defFormationX[arrayValue + 4] + xAdj;
_root.field[hqb]._x = defFormationX[arrayValue + 5] + xAdj;
_root.field[hrb]._x = defFormationX[arrayValue + 6] + xAdj;
_root.field[hlg]._y = (defFormationY[arrayValue] + ballOn) + yAdj;
_root.field[hc]._y = (defFormationY[arrayValue + 1] + ballOn) + yAdj;
_root.field[hrg]._y = (defFormationY[arrayValue + 2] + ballOn) + yAdj;
_root.field[hwr1]._y = (defFormationY[arrayValue + 3] + ballOn) + yAdj;
_root.field[hwr2]._y = (defFormationY[arrayValue + 4] + ballOn) + yAdj;
_root.field[hqb]._y = (defFormationY[arrayValue + 5] + ballOn) + yAdj;
_root.field[hrb]._y = (defFormationY[arrayValue + 6] + ballOn) + yAdj;
_root.field[hlg]._rotation = 180;
_root.field[hrg]._rotation = 180;
_root.field[hc]._rotation = 180;
_root.field[hqb]._rotation = 180;
_root.field[hrb]._rotation = 180;
_root.field[hwr1]._rotation = 180;
_root.field[hwr2]._rotation = 180;
ballHolder = [awayTeam] + "_c";
var _local4 = homeTeam + "_qb";
_root.field.ball._x = _root.field[ac]._x;
_root.field.ball._y = _root.field[ac]._y - 8;
activePlayer = [homeTeam] + "_qb";
_root.field.ring._rotation = 180;
_root.field.ring._x = _root.field[activePlayer]._x;
_root.field.ring._y = _root.field[activePlayer]._y;
throwSpeed = 6;
enlarge = 1.8;
if (play == 17) {
var _local2 = (random(20) + 75) - diff;
var _local3 = random(20) - 10;
kickDistance = ((_local2 / 1.55) * 4.66) + 30;
kickAccuracy = _local3 * 5.5;
kickTaking = "kick";
_root.field.upright1._visible = true;
startKick = true;
enlarge = 1.1;
throwSpeed = 4.5;
}
if (play == 16) {
_root.field[awr1]._y;
var _local2 = (random(20) + 72) - diff;
var _local3 = random(20) - 10;
_root.field[awr1]._rotation = 270;
_root.field[awr2]._rotation = 45;
kickDistance = (_local2 / 1.55) * 4.66;
kickAccuracy = _local3 * 1.5;
kickTaking = "kick";
_root.field.upright1._visible = true;
startKick = true;
enlarge = 1.9;
throwSpeed = 5;
}
}
}
}
stopAllSounds();
if (_root.difficulty == "rookie") {
diff2 = 23;
diff = 11;
} else if (_root.difficulty == "pro") {
diff = 6;
diff2 = 18;
} else if (_root.difficulty == "allstar") {
diff = 1;
diff2 = 8;
}
_root.field.scoreboard.zero._visible = false;
_root.field.hit._visible = false;
_root.field.upright1._visible = false;
_root.soundOn = true;
passCheck = 28 + diff;
blockTime = 40;
crossedLos = false;
oob = false;
allowChange = true;
_root.field.scoreboard.hometeam.gotoAndStop(homeTeam);
_root.field.scoreboard.awayteam.gotoAndStop(awayTeam);
possession = "home";
_root.field.ball._visible = false;
hashMark = 1;
formation = 1;
ballOn = 500;
setTeam = false;
snapTimer = 0;
interception = false;
_root.field.ball._xscale = 100;
_root.field.kickMeter.direction._xscale = 0;
_root.field.kickMeter._visible = false;
hlg = [homeTeam] + "_lg";
hc = [homeTeam] + "_c";
hrg = [homeTeam] + "_rg";
hwr1 = [homeTeam] + "_wr1";
hwr2 = [homeTeam] + "_wr2";
hqb = [homeTeam] + "_qb";
hrb = [homeTeam] + "_rb";
alg = [awayTeam] + "_lg";
ac = [awayTeam] + "_c";
arg = [awayTeam] + "_rg";
awr1 = [awayTeam] + "_wr1";
awr2 = [awayTeam] + "_wr2";
aqb = [awayTeam] + "_qb";
arb = [awayTeam] + "_rb";
quarter = 1;
timer = 0;
_root.field.advance._visible = false;
compIsRunning = false;
startKick = false;
wr1Dest1 = false;
wr1Dest2 = false;
wr1Dest3 = false;
wr2Dest1 = false;
wr2Dest2 = false;
wr2Dest3 = false;
rbDest1 = false;
rbDest2 = false;
rbDest3 = false;
cDest1 = false;
cDest2 = false;
cDest3 = false;
choosingPlay = true;
checkForSnap = false;
ballInMot = false;
running = false;
skid = false;
skidsLeft = 6;
skidAdj = 0.8;
tAdj = 59;
xAdj = 4;
yAdj = 8;
pause = 0;
tossBall = false;
handingBall = false;
alreadyRunning = false;
defSpeed = 1.4;
yReached = false;
xReached = false;
finish = false;
justScored = false;
defQbRunning = false;
defRbRunning = false;
defWr1Running = false;
defWr2Running = false;
defCRunning = false;
defLgRunning = false;
defRgRunning = false;
rgBlocking = false;
cBlocking = false;
lgBlocking = false;
breakThru1 = false;
breakThru2 = false;
breakThru3 = false;
breakThru4 = false;
breakThru5 = false;
rgHittingRg = false;
rgHittingC = false;
lgHittingLg = false;
lgHittingC = false;
cHittingC = false;
tackled = false;
down = 1;
playLength = 0;
firstDown = "fd1";
moveBack = true;
_root.field.fdMarkers._y = _root.field[firstDown]._y - 4;
homeScore = 0;
awayScore = 0;
toGo = Math.round((ballOn - _root.field.fd1._y) / 8);
offFormationX = [241, 217, 194, 107, 330, 217, 290, 241, 217, 194, 292, 324, 217, 237, 241, 217, 194, 297, 319, 217, 275, 241, 217, 194, 107, 330, 217, 237, 241, 217, 194, 107, 330, 217, 217, 241, 217, 194, 151, 120, 217, 217, 241, 217, 194, 175, 260, 217, 217, 241, 217, 194, 221, 193, 175, 260, 241, 217, 194, 175, 230, 221, 260];
offFormationY = [1, 1, 1, 1, 1, 40, 20, 1, 1, 1, 20, 1, 40, 30, 1, 1, 1, 1, 20, 40, 20, 1, 1, 1, 1, 1, 40, 30, 1, 1, 1, 1, 1, 16, 45, 1, 1, 1, 1, 20, 16, 45, 1, 1, 1, 15, 15, 16, 45, 1, 1, 1, 44, 57, 15, 15, 1, 1, 1, 15, 57, 84, 15];
defFormationX = [238, 217, 196, 107, 330, 217, 290, 238, 217, 196, 291, 330, 217, 246, 238, 217, 196, 297, 328, 243, 265, 238, 217, 196, 107, 330, 217, 246, 238, 207, 196, 107, 330, 217, 230, 238, 207, 196, 151, 121, 218, 230, 238, 217, 196, 158, 279, 208, 229, 238, 217, 196, 158, 279, 208, 229, 238, 217, 196, 158, 279, 219, 219];
defFormationY = [-17, -39, -17, -30, -30, -95, -35, -17, -39, -17, -30, -30, -95, -54, -17, -39, -17, -30, -35, -80, -45, -17, -39, -17, -30, -30, -95, -54, -17, -38, -17, -30, -30, -70, -38, -17, -38, -17, -40, -35, -70, -38, -17, -17, -17, -25, -25, -50, -50, -17, -17, -17, -25, -25, -50, -50, -17, -17, -17, -25, -25, -150, -50];
pass1wr1 = [0, -50, 1.5, 0, 300, -350, 1.5, 45, n, n, n, n, 0, -50, 1.5, 0, 300, -350, 1.3, 45, n, n, n, n, 80, -80, 1.4, 45, 80, -30, 1.3, 180, -50, -148, 1.4, 315, 0, 15, 1.5, 180, 50, 15, 1.5, 90, 280, -222, 1.3, 45, 0, -90, 1.5, 0, 120, -90, 2, 90, 120, -490, 1.8, 0, 38, -40, 1.5, 45, 38, -120, 1.5, 0, 122, -120, 2, 90, 95, -95, 1.5, 45, 95, -35, 1.5, 180, 95, -300, 2, 0, 0, -80, 1.5, 0, 20, -100, 1.5, 45, 20, -300, 1.5, 0, 61, -61, 1.3, 45, 293, -61, 1.5, 90, 293, -300, 1.5, 0, -74, -74, 1.5, 315, -114, -74, 1.5, 270, 158, -347, 1.5, 45, 0, -30, 1.5, 0, n, n, n, n, n, n, n, n, 45, -45, 1.5, 45, n, n, n, n, n, n, n, n, 0, -30, 1.5, 0, n, n, n, n, n, n, n, n, 0, -25, 1.5, 0, -5, -30, 1, 315, n, n, n, n, 0, -25, 1.5, 0, -5, -30, 1, 315, n, n, n, n];
pass1wr2 = [0, -40, 1.5, 0, -300, -40, 2, 270, n, n, n, n, 0, -86, 1.5, 0, -38, -28, 1, 225, -315, -285, 1.5, 315, 0, -35, 1.5, 0, -229, -265, 1.5, 315, 50, -265, 2, 90, 0, -35, 1.5, 0, -56, -91, 1.4, 315, -56, -31, 1.5, 180, 0, -35, 1.5, 0, -229, -265, 1.5, 315, 50, -265, 1.5, 90, 0, 16, 1.5, 180, -295, 16, 2, 270, n, n, n, n, -25, 0, 1, 270, -25, -650, 2.2, 0, n, n, n, n, 0, -70, 1.5, 0, -260, -330, 1.5, 315, n, n, n, n, 0, -35, 1.5, 0, -229, -265, 1.5, 315, 50, -265, 1.5, 90, 43, -43, 1.5, 45, 153, -43, 1.5, 90, 153, -330, 1.5, 0, 0, -20, 1.5, 0, n, n, n, n, n, n, n, n, -30, -30, 1.5, 315, n, n, n, n, n, n, n, n, -50, -50, 1.5, 315, n, n, n, n, n, n, n, n, 0, -25, 1.5, 0, 5, -30, 1, 45, n, n, n, n, 20, -20, 1.5, 45, 20, -35, 1.5, 0, n, n, n, n, 17, -17, 1, 45, 17, -20, 1, 0, n, n, n, n, n];
pass1rb = [0, -70, 1.5, 0, -260, -330, 1.5, 315, n, n, n, n, 0, -30, 1.5, 0, 50, -30, 1.7, 90, 50, -400, 1.5, 0, 0, -43, 1.5, 0, -37, -80, 1.3, 315, 127, -244, 1.3, 45, 0, -45, 1.5, 0, -24, -20, 1.5, 225, 125, -20, 2.2, 90, 95, 0, 1.5, 90, 95, -258, 1.9, 0, -195, -258, 2, 270, 33, -31, 1.5, 45, 33, -90, 1.7, 0, 180, -90, 1.8, 90, -235, -235, 1.3, 315, 113, -235, 2, 90, -185, -235, 2, 270, 0, -50, 1.5, 0, 100, -150, 1.3, 45, 100, -300, 1.5, 0, 12, -12, 1, 45, 12, -151, 2, 0, -168, -151, 2, 270, 18, -18, 1.5, 45, 18, -26, 1, 0, 185, -193, 1.5, 45, -30, 0, 1.5, 270, n, n, n, n, n, n, n, n, 20, 0, 1, 90, n, n, n, n, n, n, n, n, 31, 0, 1.5, 80, n, n, n, n, n, n, n, n, 12, -12, 1.5, 45, 12, -100, 1.5, 0, n, n, n, n, 31, 0, 1.5, 80, n, n, n, n, n, n, n, n];
pass1c = [n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, -12, 11, 1, 225, -42, 11, 1.5, 270, -42, -40, 1.5, 0, 12, 11, 1, 135, 42, 11, 1.5, 90, 42, -40, 1.5, 0, 12, 11, 1, 135, 89, 11, 1.5, 90, 134, -34, 1, 45, n, n, n, n, n, n, n, n, n, n, n, n, 12, 11, 1, 135, 89, 11, 1.5, 90, 89, -34, 1.5, 0];
_root.onEnterFrame = function () {
setRing();
AIdefense();
choosePlay();
movePlayers();
setPlayers();
pass();
blocking();
checkForTackle();
clock();
kicking();
AIoffense();
moveSelected();
endzoneDance();
};
_root.onMouseUp = function () {
if (possession == "away") {
allowChange = true;
}
};
_root.onMouseDown = function () {
if (possession == "away") {
detClosestDef();
if ((allowChange && (closestDef == ([homeTeam] + "_rg"))) && (breakThru1)) {
activePlayer = [homeTeam] + "_rg";
allowChange = false;
}
if ((allowChange && (closestDef == ([homeTeam] + "_lg"))) && (breakThru2)) {
activePlayer = [homeTeam] + "_lg";
allowChange = false;
}
if ((allowChange && (closestDef == ([homeTeam] + "_c"))) && (breakThru3)) {
activePlayer = [homeTeam] + "_c";
allowChange = false;
}
if (allowChange && (closestDef == ([homeTeam] + "_qb"))) {
activePlayer = [homeTeam] + "_qb";
allowChange = false;
}
if (allowChange && (closestDef == ([homeTeam] + "_rb"))) {
activePlayer = [homeTeam] + "_rb";
allowChange = false;
}
if (allowChange && (closestDef == ([homeTeam] + "_wr1"))) {
activePlayer = [homeTeam] + "_wr1";
allowChange = false;
}
if (allowChange && (closestDef == ([homeTeam] + "_wr2"))) {
activePlayer = [homeTeam] + "_wr2";
allowChange = false;
}
if (allowChange == false) {
setRing();
}
}
if (((((passing == false) && (startPlay == true)) && (ballHolder == ([homeTeam] + "_qb"))) && (crossedLos == false)) && (_root.field[hqb]._y > _root.field._ymouse)) {
endX = _xmouse;
endY = _ymouse;
startX = _root.field.ball._x;
startY = _root.field.ball._y;
enlarge = 6;
throwSpeed = 6;
passing = true;
throwPass = true;
_root.field.ball.gotoAndPlay("throw");
if (endX < startX) {
_root.field.ball.gotoAndPlay("throw2");
}
}
};
stop();
Frame 32
stop();
Frame 60
stop();
Frame 68
if (_root.unlock2 == false) {
_root.white._visible = false;
}
Frame 78
if (_root.unlock2 == false) {
_root.white._visible = false;
}
if (_root.homeTeam == "gold") {
_root.gold._visible = false;
}
if (_root.homeTeam == "blue") {
_root.blue._visible = false;
}
if (_root.homeTeam == "bblue") {
_root.bblue._visible = false;
}
if (_root.homeTeam == "brown") {
_root.brown._visible = false;
}
if (_root.homeTeam == "orange") {
_root.orange._visible = false;
}
if (_root.homeTeam == "white") {
_root.white._visible = false;
}
Frame 95
function sendForm() {
send_lv = new LoadVars();
take_lv = new LoadVars();
send_lv.user = _root.userName;
send_lv.pass = _root.passwo;
send_lv.amount = updateAmt;
send_lv.game = "apflag";
take_lv.onLoad = function (success) {
if (success) {
_root.return_btn._visible = true;
statusbox = "Update Finished!";
}
};
send_lv.sendAndLoad("http://www.axis-games.com/addpoints.php", take_lv, "POST");
}
function updateTotal() {
throw_lv = new LoadVars();
catch_lv = new LoadVars();
throw_lv.amt = updateAmt;
throw_lv.gametype = "flagfootball";
catch_lv.onLoad = function (success) {
if (success) {
}
};
throw_lv.sendAndLoad("http://www.axis-games.com/addtotals.php", catch_lv, "POST");
}
_root.homeT.gotoAndStop(homeTeam);
_root.awayT.gotoAndStop(awayTeam);
apupdate = "You are not logged in.";
statusbox = "";
if (_root.login) {
apupdate = "";
if ((_root.homeScore > _root.awayScore) && (_root.difficulty == "allstar")) {
_root.return_btn._visible = false;
apupdate = "You earned 4 Axis Points!";
statusbox = "Updating Your Account...";
updateAmt = 4;
updateTotal();
sendForm();
}
if ((_root.homeScore > _root.awayScore) && (_root.difficulty == "pro")) {
_root.return_btn._visible = false;
apupdate = "You earned 2 Axis Point!";
statusbox = "Updating Your Account...";
updateAmt = 2;
updateTotal();
sendForm();
}
if ((_root.homeScore > _root.awayScore) && (_root.difficulty == "rookie")) {
_root.return_btn._visible = false;
apupdate = "You earned 1 Axis Point!";
statusbox = "Updating Your Account...";
updateAmt = 1;
updateTotal();
sendForm();
}
}
Symbol 23 MovieClip Frame 39
stop();
Symbol 43 MovieClip Frame 39
stop();
Symbol 71 MovieClip Frame 35
this.gotoAndPlay(1);
Symbol 74 MovieClip Frame 144
stopAllSounds();
Symbol 74 MovieClip Frame 145
_root.gotoAndStop("splash");
Symbol 96 Button
on (release) {
_root.gotoAndStop("hometeam");
}
Symbol 99 Button
on (release) {
_root.gotoAndStop("offcontrols");
}
Symbol 102 Button
on (release) {
_root.gotoAndStop("credits");
}
Symbol 105 Button
on (release) {
gotoAndStop ("login");
}
Symbol 113 Button
on (release) {
_root.gotoAndStop("splash");
}
Symbol 138 Button
on (release) {
getURL ("http://www.axis-games.com/forgotpassword.php", "_self");
}
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 16
this.gotoAndPlay("run");
Symbol 190 MovieClip Frame 65
this.gotoAndPlay("dance");
Symbol 190 MovieClip Frame 77
this.gotoAndPlay("runwball");
Symbol 190 MovieClip Frame 89
this.gotoAndPlay("dance");
Symbol 197 MovieClip Frame 1
stop();
Symbol 197 MovieClip Frame 15
this.gotoAndPlay("run");
Symbol 204 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 15
this.gotoAndPlay("run");
Symbol 230 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 16
this.gotoAndPlay("run");
Symbol 230 MovieClip Frame 65
this.gotoAndPlay("dance");
Symbol 230 MovieClip Frame 77
this.gotoAndPlay("runwball");
Symbol 230 MovieClip Frame 89
this.gotoAndPlay("dance");
Symbol 237 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 15
this.gotoAndPlay("run");
Symbol 263 MovieClip Frame 1
stop();
Symbol 263 MovieClip Frame 16
this.gotoAndPlay("run");
Symbol 263 MovieClip Frame 65
this.gotoAndPlay("dance");
Symbol 263 MovieClip Frame 77
this.gotoAndPlay("runwball");
Symbol 263 MovieClip Frame 89
this.gotoAndPlay("dance");
Symbol 273 MovieClip Frame 1
stop();
Symbol 273 MovieClip Frame 17
this.gotoAndPlay("run");
Symbol 299 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 16
this.gotoAndPlay("run");
Symbol 299 MovieClip Frame 65
this.gotoAndPlay("dance");
Symbol 299 MovieClip Frame 77
this.gotoAndPlay("runwball");
Symbol 299 MovieClip Frame 89
this.gotoAndPlay("dance");
Symbol 306 MovieClip Frame 1
stop();
Symbol 306 MovieClip Frame 15
this.gotoAndPlay("run");
Symbol 332 MovieClip Frame 1
stop();
Symbol 332 MovieClip Frame 16
this.gotoAndPlay("run");
Symbol 332 MovieClip Frame 65
this.gotoAndPlay("dance");
Symbol 332 MovieClip Frame 77
this.gotoAndPlay("runwball");
Symbol 332 MovieClip Frame 89
this.gotoAndPlay("dance");
Symbol 339 MovieClip Frame 1
stop();
Symbol 339 MovieClip Frame 15
this.gotoAndPlay("run");
Symbol 365 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 16
this.gotoAndPlay("run");
Symbol 365 MovieClip Frame 65
this.gotoAndPlay("dance");
Symbol 365 MovieClip Frame 77
this.gotoAndPlay("runwball");
Symbol 365 MovieClip Frame 89
this.gotoAndPlay("dance");
Symbol 373 MovieClip Frame 1
stop();
Symbol 381 MovieClip Frame 1
stop();
Symbol 444 MovieClip Frame 1
stop();
Symbol 444 MovieClip Frame 21
this.gotoAndPlay("kick");
Symbol 444 MovieClip Frame 41
this.gotoAndPlay("throw");
Symbol 444 MovieClip Frame 61
this.gotoAndPlay("throw2");
Symbol 448 Button
on (release) {
_root.choosingPlay = true;
_root.field.advance._visible = false;
_root.field.upright1._visible = false;
_root.field.passInfo.gotoAndStop(1);
}
Symbol 465 MovieClip Frame 1
stop();
Symbol 465 MovieClip Frame 22
this.gotoAndStop(1);
Symbol 465 MovieClip Frame 43
stop();
Symbol 465 MovieClip Frame 64
stop();
Symbol 465 MovieClip Frame 85
stop();
Symbol 465 MovieClip Frame 108
stop();
Symbol 465 MovieClip Frame 132
this.gotoAndStop(1);
Symbol 465 MovieClip Frame 156
this.gotoAndStop(1);
Symbol 465 MovieClip Frame 179
stop();
Symbol 468 MovieClip Frame 1
stop();
Symbol 468 MovieClip Frame 2
this.gotoAndStop(1);
Symbol 477 Button
on (release) {
_root.play = 1;
_root.formation = 1;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.homeTeam + "_wr1";
} else {
_root.qbTarget = _root.homeTeam + "_rb";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.homeTeam + "_qb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.homeTeam + "_wr2";
} else {
_root.cTarget = _root.homeTeam + "_rb";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.awayTeam + "_wr1";
} else {
_root.qbTarget = _root.awayTeam + "_rb";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.awayTeam + "_qb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.awayTeam + "_wr2";
} else {
_root.cTarget = _root.awayTeam + "_rb";
}
}
}
Symbol 483 Button
on (release) {
_root.play = 5;
_root.formation = 2;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.homeTeam + "_wr2";
} else {
_root.qbTarget = _root.homeTeam + "_qb";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.homeTeam + "_qb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.homeTeam + "_wr1";
} else {
_root.cTarget = _root.homeTeam + "_rb";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.awayTeam + "_wr2";
} else {
_root.qbTarget = _root.awayTeam + "_qb";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.awayTeam + "_qb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.awayTeam + "_wr1";
} else {
_root.cTarget = _root.awayTeam + "_rb";
}
}
}
Symbol 489 Button
on (release) {
_root.play = 2;
_root.formation = 1;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.homeTeam + "_wr2";
} else {
_root.qbTarget = _root.homeTeam + "_wr1";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.homeTeam + "_qb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.homeTeam + "_rb";
} else {
_root.cTarget = _root.homeTeam + "_wr2";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.awayTeam + "_wr2";
} else {
_root.qbTarget = _root.awayTeam + "_wr1";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.awayTeam + "_qb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.awayTeam + "_rb";
} else {
_root.cTarget = _root.awayTeam + "_wr2";
}
}
}
Symbol 493 Button
on (release) {
_root.play = 3;
_root.formation = 1;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.cTarget = _root.homeTeam + "_qb";
} else {
_root.cTarget = _root.homeTeam + "_rb";
}
if (_root.randomVal2 == 0) {
_root.qbTarget = _root.homeTeam + "_wr1";
} else if (_root.randomVal2 == 1) {
_root.qbTarget = _root.homeTeam + "_rb";
} else {
_root.qbTarget = _root.homeTeam + "_wr2";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.cTarget = _root.awayTeam + "_qb";
} else {
_root.cTarget = _root.awayTeam + "_rb";
}
if (_root.randomVal2 == 0) {
_root.qbTarget = _root.awayTeam + "_wr1";
} else if (_root.randomVal2 == 1) {
_root.qbTarget = _root.awayTeam + "_rb";
} else {
_root.qbTarget = _root.awayTeam + "_wr2";
}
}
}
Symbol 498 Button
on (release) {
_root.play = 4;
_root.formation = 1;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.homeTeam + "_wr2";
} else {
_root.qbTarget = _root.homeTeam + "_qb";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.homeTeam + "_wr1";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.homeTeam + "_wr2";
} else {
_root.cTarget = _root.homeTeam + "_rb";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.awayTeam + "_wr2";
} else {
_root.qbTarget = _root.awayTeam + "_qb";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.awayTeam + "_wr1";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.awayTeam + "_wr2";
} else {
_root.cTarget = _root.awayTeam + "_rb";
}
}
}
Symbol 505 Button
on (release) {
_root.play = 6;
_root.formation = 2;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.homeTeam + "_qb";
} else {
_root.qbTarget = _root.homeTeam + "_wr1";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.homeTeam + "_rb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.homeTeam + "_wr1";
} else {
_root.cTarget = _root.homeTeam + "_wr2";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.awayTeam + "_qb";
} else {
_root.qbTarget = _root.awayTeam + "_wr1";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.awayTeam + "_rb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.awayTeam + "_wr1";
} else {
_root.cTarget = _root.awayTeam + "_wr2";
}
}
}
Symbol 511 Button
on (release) {
_root.play = 7;
_root.formation = 3;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.homeTeam + "_wr1";
} else {
_root.qbTarget = _root.homeTeam + "_wr2";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.homeTeam + "_rb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.homeTeam + "_qb";
} else {
_root.cTarget = _root.homeTeam + "_wr2";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.awayTeam + "_wr1";
} else {
_root.qbTarget = _root.awayTeam + "_wr2";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.awayTeam + "_rb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.awayTeam + "_qb";
} else {
_root.cTarget = _root.awayTeam + "_wr2";
}
}
}
Symbol 518 Button
on (release) {
_root.play = 8;
_root.formation = 3;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.cTarget = _root.homeTeam + "_qb";
} else {
_root.cTarget = _root.homeTeam + "_rb";
}
if (_root.randomVal2 == 0) {
_root.qbTarget = _root.homeTeam + "_wr1";
} else if (_root.randomVal2 == 1) {
_root.qbTarget = _root.homeTeam + "_rb";
} else {
_root.qbTarget = _root.homeTeam + "_wr2";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.cTarget = _root.awayTeam + "_qb";
} else {
_root.cTarget = _root.awayTeam + "_rb";
}
if (_root.randomVal2 == 0) {
_root.qbTarget = _root.awayTeam + "_wr1";
} else if (_root.randomVal2 == 1) {
_root.qbTarget = _root.awayTeam + "_rb";
} else {
_root.qbTarget = _root.awayTeam + "_wr2";
}
}
}
Symbol 525 Button
on (release) {
_root.play = 9;
_root.formation = 5;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.homeTeam + "_wr1";
} else {
_root.qbTarget = _root.homeTeam + "_wr2";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.homeTeam + "_qb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.homeTeam + "_rb";
} else {
_root.cTarget = _root.homeTeam + "_wr1";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.qbTarget = _root.awayTeam + "_wr1";
} else {
_root.qbTarget = _root.awayTeam + "_wr2";
}
if (_root.randomVal2 == 0) {
_root.cTarget = _root.awayTeam + "_qb";
} else if (_root.randomVal2 == 1) {
_root.cTarget = _root.awayTeam + "_rb";
} else {
_root.cTarget = _root.awayTeam + "_wr1";
}
}
}
Symbol 531 Button
on (release) {
_root.play = 10;
_root.formation = 7;
_root.setTeam = true;
_root.choosingPlay = false;
_root.checkForSnap = true;
_root.assignValues();
if (_root.possession == "home") {
if (_root.randomVal1 == 0) {
_root.cTarget = _root.homeTeam + "_rb";
} else {
_root.cTarget = _root.homeTeam + "_qb";
}
if (_root.randomVal2 == 0) {
_root.qbTarget = _root.homeTeam + "_wr1";
} else if (_root.randomVal2 == 1) {
_root.qbTarget = _root.homeTeam + "_rb";
} else {
_root.qbTarget = _root.homeTeam + "_wr2";
}
}
if (_root.possession == "away") {
if (_root.randomVal1 == 0) {
_root.cTarget = _root.awayTeam + "_rb";
} else {
_root.cTarget = _root.awayTeam + "_qb";
}
if (_root.randomVal2 == 0) {
_root.qbTarget = _root.awayTeam + "_wr1";
} else if (_root.randomVal2 == 1) {
_root.qbTarget = _root.awayTeam + "_rb";
} else {
_root.qbTarget = _root.awayTeam + "_wr2";
}
}
}
Symbol 536 Button
on (release) {
if (_root.justScored == false) {
_root.play = 17;
_root.formation = 9;
_root.setTeam = true;
_root.choosingPlay = false;
_root.startKick = true;
_root.assignValues();
_root.cTarget = _root.homeTeam + "_qb";
_root.qbTarget = "null";
_root.kickType = "fg";
}
}
Symbol 540 Button
on (release) {
_root.play = 16;
_root.formation = 8;
_root.setTeam = true;
_root.choosingPlay = false;
_root.startKick = true;
_root.assignValues();
_root.cTarget = _root.homeTeam + "_qb";
_root.qbTarget = _root.homeTeam + "_qb";
_root.field.upright1._visible = true;
_root.kickType = "fg";
if (_root.justScored == true) {
_root.kickType = "pat";
_root.ballOn = 105;
_root.justScored = false;
_root.down = 0;
_root.toGo = 0;
_root.choosingPlay = false;
_root.play = 16;
_root.formation = 8;
_root.setTeam = true;
_root.choosingPlay = false;
_root.startKick = true;
_root.conPass++;
_root.assignValues();
_root.cTarget = _root.homeTeam + "_qb";
_root.qbTarget = _root.homeTeam + "_qb";
_root.field.upright1._visible = true;
}
}
Symbol 546 Button
on (release) {
if (_root.soundOn) {
_root.soundOn = false;
_root.slash.gotoAndStop(2);
} else {
_root.soundOn = true;
_root.slash.gotoAndStop(1);
}
}
Symbol 548 MovieClip Frame 1
stop();
Symbol 554 Button
on (release) {
_root.gotoAndStop("defcontrols");
}
Symbol 557 Button
on (release) {
_root.gotoAndStop("splash");
}
Symbol 561 Button
on (release) {
_root.gotoAndStop("rules");
}
Symbol 562 Button
on (release) {
_root.gotoAndStop("offcontrols");
}
Symbol 566 Button
on (release) {
_root.gotoAndStop("defcontrols");
}
Symbol 569 Button
on (release) {
_root.gotoAndStop("splash");
}
Symbol 584 Button
on (release) {
_root.homeTeam = "brown";
_root.gotoAndStop("awayteam");
}
Symbol 591 Button
on (release) {
_root.homeTeam = "bblue";
_root.gotoAndStop("awayteam");
}
Symbol 598 Button
on (release) {
_root.homeTeam = "orange";
_root.gotoAndStop("awayteam");
}
Symbol 605 Button
on (release) {
_root.homeTeam = "blue";
_root.gotoAndStop("awayteam");
}
Symbol 612 Button
on (release) {
_root.homeTeam = "gold";
_root.gotoAndStop("awayteam");
}
Symbol 619 Button
on (release) {
_root.homeTeam = "white";
_root.gotoAndStop("awayteam");
}
Symbol 622 Button
on (release) {
_root.awayTeam = "brown";
_root.gotoAndStop("difficulty");
}
Symbol 623 Button
on (release) {
_root.awayTeam = "bblue";
_root.gotoAndStop("difficulty");
}
Symbol 624 Button
on (release) {
_root.awayTeam = "orange";
_root.gotoAndStop("difficulty");
}
Symbol 625 Button
on (release) {
_root.awayTeam = "blue";
_root.gotoAndStop("difficulty");
}
Symbol 626 Button
on (release) {
_root.awayTeam = "gold";
_root.gotoAndStop("difficulty");
}
Symbol 627 Button
on (release) {
_root.awayTeam = "white";
_root.gotoAndStop("difficulty");
}
Symbol 632 Button
on (release) {
_root.difficulty = "rookie";
_root.gotoAndPlay("game");
}
Symbol 635 Button
on (release) {
_root.difficulty = "pro";
_root.gotoAndPlay("game");
}
Symbol 638 Button
on (release) {
_root.difficulty = "allstar";
_root.gotoAndPlay("game");
}
Symbol 643 Button
on (release) {
gotoAndStop ("splash");
}