Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("9ac43b2e", this, 10301, true);
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
if (domain != "agame.com") {
MochiAd.showPreGameAd({id:"a0560afad653c7d2", res:"540x400"});
stop();
}
Frame 2
Stage.scaleMode = "noScale";
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
var allowPlay = true;
if (domain != "www8.agame.com") {
}
onEnterFrame = function () {
loader.text = Math.round(this.getBytesLoaded() * (100 / this.getBytesTotal())) + " %";
loadBar.gotoAndStop(Math.round(this.getBytesLoaded() * (100 / this.getBytesTotal())));
if ((this.getBytesLoaded() == this.getBytesTotal()) && (allowPlay)) {
delete onEnterFrame;
gotoAndStop ("intro");
}
};
stop();
legal.onPress = function () {
getURL ("http://www.modul.no/interactive", "_blank");
};
Frame 10
redirect.onPress = function () {
getURL ("http://www.modul-games.com/aniball", "_self");
};
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
debugg.text = (("domain:" + domain) + " || _url: ") + _url;
Frame 11
function onDoneIntro() {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
}
modulIntro.onPress = function () {
getURL ("http://www.modul-games.com/aniball/landingPage.php", "_blank");
};
stop();
Frame 13
com.onixus.as2.sound.AudioPlayer.vol = 90;
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
var soundIsOn = true;
soundBtn.onRelease = function () {
if (soundIsOn) {
this.gotoAndStop(2);
com.onixus.as2.sound.AudioPlayer.mute(true);
soundIsOn = false;
} else {
this.gotoAndStop(1);
com.onixus.as2.sound.AudioPlayer.mute(false);
soundIsOn = true;
}
};
Frame 21
function disableMain() {
p1.enabled = false;
p2.enabled = false;
help.enabled = false;
credits.enabled = false;
p1.bg.gotoAndStop(1);
p2.bg.gotoAndStop(1);
help.bg.gotoAndStop(1);
credits.bg.gotoAndStop(1);
}
function enableMain() {
p1.enabled = true;
p2.enabled = true;
help.enabled = true;
credits.enabled = true;
}
if (!allowPlay) {
gotoAndStop ("error");
}
delete onEnterFrame;
enableMain();
p1.onRollOver = function () {
p1.bg.gotoAndStop(2);
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
p1.onRollOut = function () {
p1.bg.gotoAndStop(1);
};
p2.onRollOver = function () {
p2.bg.gotoAndStop(2);
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
p2.onRollOut = function () {
p2.bg.gotoAndStop(1);
};
help.onRollOver = function () {
help.bg.gotoAndStop(2);
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
help.onRollOut = function () {
help.bg.gotoAndStop(1);
};
credits.onRollOver = function () {
credits.bg.gotoAndStop(2);
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
credits.onRollOut = function () {
credits.bg.gotoAndStop(1);
};
scores.onRollOver = function () {
scores.bg.gotoAndStop(2);
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
scores.onRollOut = function () {
scores.bg.gotoAndStop(1);
};
playMore.onRollOver = function () {
playMore.bg.gotoAndStop(2);
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
playMore.onRollOut = function () {
playMore.bg.gotoAndStop(1);
};
var so = SharedObject.getLocal("modul_aniball", "/");
if (so.data.l1 == undefined) {
so.data.l1 = false;
}
if (so.data.l2 == undefined) {
so.data.l2 = false;
}
if (so.data.l3 == undefined) {
so.data.l3 = false;
}
if (so.data.l1_won == undefined) {
so.data.l1_won = false;
}
if (so.data.l2_won == undefined) {
so.data.l2_won = false;
}
if (so.data.l3_won == undefined) {
so.data.l3_won = false;
}
so.flush();
if (so.data.showKeys == undefined) {
so.data.showKeys = true;
}
scoreC = 0;
var sc = scoreC.toString();
var bsc = "";
if (sc.length == 1) {
bsc = "000000";
}
if (sc.length == 2) {
bsc = "00000";
}
if (sc.length == 3) {
bsc = "0000";
}
if (sc.length == 4) {
bsc = "000";
}
if (sc.length == 5) {
bsc = "00";
}
if (sc.length == 6) {
bsc = "0";
}
scoreArea.text = ("YOUR SCORE: " + bsc) + sc;
p1.onRelease = function () {
disableMain();
paper_bg.newPage = "1p-s1";
paper_bg.gotoAndPlay("in");
};
p2.onRelease = function () {
disableMain();
paper_bg.newPage = "2p-s1";
paper_bg.gotoAndPlay("in");
};
credits.onRelease = function () {
disableMain();
paper_bg.newPage = "credits";
paper_bg.gotoAndPlay("in");
};
help.onRelease = function () {
disableMain();
paper_bg.newPage = "help";
paper_bg.gotoAndPlay("in");
};
scores.onRelease = function () {
getURL ("http://www.modul-games.com/aniball/score/scores.php", "_blank");
};
playMore.onRelease = function () {
getURL ("http://www.modul-games.com/aniball/landingPage.php", "_blank");
};
stop();
Frame 31
back.onRelease = function () {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
};
ts1.onRelease = function () {
player_1 = 1;
paper_bg.newPage = "1p-s2";
paper_bg.gotoAndPlay("in");
};
ts2.onRelease = function () {
player_1 = 2;
paper_bg.newPage = "1p-s2";
paper_bg.gotoAndPlay("in");
};
ts3.onRelease = function () {
player_1 = 3;
paper_bg.newPage = "1p-s2";
paper_bg.gotoAndPlay("in");
};
ts4.onRelease = function () {
player_1 = 4;
paper_bg.newPage = "1p-s2";
paper_bg.gotoAndPlay("in");
};
ts1.gotoAndStop(1);
ts2.gotoAndStop(2);
ts3.gotoAndStop(3);
ts4.gotoAndStop(4);
ts1.active.gotoAndStop(2);
back.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 41
back.onRelease = function () {
paper_bg.newPage = "1p-s1";
paper_bg.gotoAndPlay("in");
};
var counter = 1;
if (player_1 == 1) {
counter++;
}
ts1.gotoAndStop(counter);
counter++;
if (player_1 == 2) {
counter++;
}
ts2.gotoAndStop(counter);
counter++;
if (player_1 == 3) {
counter++;
}
ts3.gotoAndStop(counter);
player_2 = undefined;
control1 = "manual";
control2 = "cpu";
fs1.onRelease = function () {
fieldId = 1;
paper_bg.newPage = "game";
paper_bg.gotoAndPlay("in");
};
if (so.data.l2) {
active2.gotoAndStop(2);
fs2.onRelease = function () {
fieldId = 2;
paper_bg.newPage = "game";
paper_bg.gotoAndPlay("in");
};
}
if (so.data.l3) {
active3.gotoAndStop(2);
fs3.onRelease = function () {
fieldId = 3;
paper_bg.newPage = "game";
paper_bg.gotoAndPlay("in");
};
}
fs1.gotoAndStop(1);
fs2.gotoAndStop(2);
fs3.gotoAndStop(3);
back.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs1.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs2.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs3.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 51
player_1 = undefined;
player_2 = undefined;
back.onRelease = function () {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
};
rsid_1_1.gotoAndStop(1);
rsid_1_2.gotoAndStop(1);
rsid_1_3.gotoAndStop(1);
rsid_1_4.gotoAndStop(1);
rsid_2_1.gotoAndStop(1);
rsid_2_2.gotoAndStop(1);
rsid_2_3.gotoAndStop(1);
rsid_2_4.gotoAndStop(1);
ts1_1.onRelease = function () {
player_1 = 1;
ts1_1.idMarker.gotoAndStop(2);
ts1_2.idMarker.gotoAndStop(1);
ts1_3.idMarker.gotoAndStop(1);
ts1_4.idMarker.gotoAndStop(1);
rsid_1_1.gotoAndStop(2);
rsid_1_2.gotoAndStop(1);
rsid_1_3.gotoAndStop(1);
rsid_1_4.gotoAndStop(1);
};
ts1_2.onRelease = function () {
player_1 = 2;
ts1_1.idMarker.gotoAndStop(1);
ts1_2.idMarker.gotoAndStop(2);
ts1_3.idMarker.gotoAndStop(1);
ts1_4.idMarker.gotoAndStop(1);
rsid_1_1.gotoAndStop(1);
rsid_1_2.gotoAndStop(2);
rsid_1_3.gotoAndStop(1);
rsid_1_4.gotoAndStop(1);
};
ts1_3.onRelease = function () {
player_1 = 3;
ts1_1.idMarker.gotoAndStop(1);
ts1_2.idMarker.gotoAndStop(1);
ts1_3.idMarker.gotoAndStop(2);
ts1_4.idMarker.gotoAndStop(1);
rsid_1_1.gotoAndStop(1);
rsid_1_2.gotoAndStop(1);
rsid_1_3.gotoAndStop(2);
rsid_1_4.gotoAndStop(1);
};
ts1_4.onRelease = function () {
player_1 = 4;
ts1_1.idMarker.gotoAndStop(1);
ts1_2.idMarker.gotoAndStop(1);
ts1_3.idMarker.gotoAndStop(1);
ts1_4.idMarker.gotoAndStop(2);
rsid_1_1.gotoAndStop(1);
rsid_1_2.gotoAndStop(1);
rsid_1_3.gotoAndStop(1);
rsid_1_4.gotoAndStop(2);
};
ts1_1.gotoAndStop(1);
ts1_2.gotoAndStop(2);
ts1_3.gotoAndStop(3);
ts1_4.gotoAndStop(4);
ts2_1.onRelease = function () {
player_2 = 1;
ts2_1.idMarker.gotoAndStop(3);
ts2_2.idMarker.gotoAndStop(1);
ts2_3.idMarker.gotoAndStop(1);
ts2_4.idMarker.gotoAndStop(1);
rsid_2_1.gotoAndStop(2);
rsid_2_2.gotoAndStop(1);
rsid_2_3.gotoAndStop(1);
rsid_2_4.gotoAndStop(1);
};
ts2_2.onRelease = function () {
player_2 = 2;
ts2_1.idMarker.gotoAndStop(1);
ts2_2.idMarker.gotoAndStop(3);
ts2_3.idMarker.gotoAndStop(1);
ts2_4.idMarker.gotoAndStop(1);
rsid_2_1.gotoAndStop(1);
rsid_2_2.gotoAndStop(2);
rsid_2_3.gotoAndStop(1);
rsid_2_4.gotoAndStop(1);
};
ts2_3.onRelease = function () {
player_2 = 3;
ts2_1.idMarker.gotoAndStop(1);
ts2_2.idMarker.gotoAndStop(1);
ts2_3.idMarker.gotoAndStop(3);
ts2_4.idMarker.gotoAndStop(1);
rsid_2_1.gotoAndStop(1);
rsid_2_2.gotoAndStop(1);
rsid_2_3.gotoAndStop(2);
rsid_2_4.gotoAndStop(1);
};
ts2_4.onRelease = function () {
player_2 = 4;
ts2_1.idMarker.gotoAndStop(1);
ts2_2.idMarker.gotoAndStop(1);
ts2_3.idMarker.gotoAndStop(1);
ts2_4.idMarker.gotoAndStop(3);
rsid_2_1.gotoAndStop(1);
rsid_2_2.gotoAndStop(1);
rsid_2_3.gotoAndStop(1);
rsid_2_4.gotoAndStop(2);
};
ts2_1.gotoAndStop(1);
ts2_2.gotoAndStop(2);
ts2_3.gotoAndStop(3);
ts2_4.gotoAndStop(4);
onEnterFrame = function () {
if ((player_1 != undefined) && (player_2 != undefined)) {
delete onEnterFrame;
paper_bg.newPage = "2p-s2";
paper_bg.gotoAndPlay("in");
}
if (ts1_1.idMarker._currentframe == 2) {
ts2_1._alpha = 20;
ts2_1.enabled = false;
} else {
ts2_1._alpha = 100;
ts2_1.enabled = true;
}
if (ts1_2.idMarker._currentframe == 2) {
ts2_2._alpha = 20;
ts2_2.enabled = false;
} else {
ts2_2._alpha = 100;
ts2_2.enabled = true;
}
if (ts1_3.idMarker._currentframe == 2) {
ts2_3._alpha = 20;
ts2_3.enabled = false;
} else {
ts2_3._alpha = 100;
ts2_3.enabled = true;
}
if (ts1_4.idMarker._currentframe == 2) {
ts2_4._alpha = 20;
ts2_4.enabled = false;
} else {
ts2_4._alpha = 100;
ts2_4.enabled = true;
}
if (ts2_1.idMarker._currentframe == 3) {
ts1_1._alpha = 20;
ts1_1.enabled = false;
} else {
ts1_1._alpha = 100;
ts1_1.enabled = true;
}
if (ts2_2.idMarker._currentframe == 3) {
ts1_2._alpha = 20;
ts1_2.enabled = false;
} else {
ts1_2._alpha = 100;
ts1_2.enabled = true;
}
if (ts2_3.idMarker._currentframe == 3) {
ts1_3._alpha = 20;
ts1_3.enabled = false;
} else {
ts1_3._alpha = 100;
ts1_3.enabled = true;
}
if (ts2_4.idMarker._currentframe == 3) {
ts1_4._alpha = 20;
ts1_4.enabled = false;
} else {
ts1_4._alpha = 100;
ts1_4.enabled = true;
}
};
back.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs1_1.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs1_2.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs1_3.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 61
fs1.gotoAndStop(1);
fs2.gotoAndStop(2);
fs3.gotoAndStop(3);
tm1.gotoAndStop(1);
tm2.gotoAndStop(2);
tm3.gotoAndStop(3);
rsid_1_1.gotoAndStop(1);
rsid_1_2.gotoAndStop(1);
rsid_1_3.gotoAndStop(1);
rsid_2_1.gotoAndStop(1);
rsid_2_2.gotoAndStop(1);
rsid_2_3.gotoAndStop(1);
fieldId = undefined;
timeSet = undefined;
back.onRelease = function () {
paper_bg.newPage = "2p-s1";
paper_bg.gotoAndPlay("in");
};
fs1.onRelease = function () {
fieldId = 1;
rsid_1_1.gotoAndStop(2);
rsid_1_2.gotoAndStop(1);
rsid_1_3.gotoAndStop(1);
};
fs2.onRelease = function () {
fieldId = 2;
rsid_1_1.gotoAndStop(1);
rsid_1_2.gotoAndStop(2);
rsid_1_3.gotoAndStop(1);
};
fs3.onRelease = function () {
fieldId = 3;
rsid_1_1.gotoAndStop(1);
rsid_1_2.gotoAndStop(1);
rsid_1_3.gotoAndStop(2);
};
tm1.onRelease = function () {
timeSet = 1;
rsid_2_1.gotoAndStop(2);
rsid_2_2.gotoAndStop(1);
rsid_2_3.gotoAndStop(1);
};
tm2.onRelease = function () {
timeSet = 3;
rsid_2_1.gotoAndStop(1);
rsid_2_2.gotoAndStop(2);
rsid_2_3.gotoAndStop(1);
};
tm3.onRelease = function () {
timeSet = 6;
rsid_2_1.gotoAndStop(1);
rsid_2_2.gotoAndStop(1);
rsid_2_3.gotoAndStop(2);
};
onEnterFrame = function () {
trace((timeSet + " * ") + fieldId);
if ((fieldId != undefined) && (timeSet != undefined)) {
delete onEnterFrame;
paper_bg.newPage = "game";
paper_bg.gotoAndPlay("in");
}
};
control1 = "manual";
control2 = "manual";
back.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs1.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs2.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
fs3.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
tm1.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
tm2.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
tm3.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 71
back.onRelease = function () {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
};
so.data.showKeys = false;
back.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 81
back.onRelease = function () {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
};
back.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 91
if (!so.data.showKeys) {
gotoAndStop ("game_a");
return(undefined);
}
playGame.onPress = function () {
paper_bg.newPage = "game_a";
paper_bg.gotoAndPlay("in");
};
playGame.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 101
var scoreCount_ = 0;
if (player_2 == undefined) {
player_2 = fieldId;
if (player_2 >= player_1) {
player_2 = player_2 + 1;
}
}
if (timeSet != undefined) {
time = timeSet;
} else {
time = 2;
}
field = fieldId;
stage.bg_container.gotoAndStop("f" + field);
po1 = new Object();
po1.charId = player_1;
po1.control = control1;
po1.difficulty = 0;
po2 = new Object();
po2.charId = player_2;
po2.control = control2;
po2.difficulty = 0;
if ((fieldId == 1) && (control2 == "cpu")) {
var team2Conf = [new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 100, classes.MatchManager.CENTER_Y, "top", 5), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 200, classes.MatchManager.CENTER_Y - 180, "center", 4.5), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 200, classes.MatchManager.CENTER_Y + 190, "center", 5), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 330, classes.MatchManager.CENTER_Y, "keeper", 2)];
var at = (new classes.footbot.AiTag(25, 6, 20, 0, 10, 50, 40, 50, 5, 20, 40));
}
if ((fieldId == 2) && (control2 == "cpu")) {
var team2Conf = [new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 100, classes.MatchManager.CENTER_Y, "top", 6), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 200, classes.MatchManager.CENTER_Y - 180, "center", 5.5), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 200, classes.MatchManager.CENTER_Y + 190, "center", 5.5), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 330, classes.MatchManager.CENTER_Y, "keeper", 2)];
var at = (new classes.footbot.AiTag(10, 6, 40, 15, 5, 45, 45, 30, 6.5, 25, 40));
}
if ((fieldId == 3) && (control2 == "cpu")) {
var team2Conf = [new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 100, classes.MatchManager.CENTER_Y, "top", 6), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 200, classes.MatchManager.CENTER_Y - 180, "center", 6), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 200, classes.MatchManager.CENTER_Y + 190, "center", 6), new classes.footbot.PlayerTag(classes.MatchManager.CENTER_X + 330, classes.MatchManager.CENTER_Y, "keeper", 2)];
var at = (new classes.footbot.AiTag(10, 6, 50, 30, 2, 40, 50, 16, 7, 30, 40));
}
var main = (new classes.Main(field, po1, po2, time, undefined, team2Conf, at));
stop();
var isPaused = false;
pauseBtn.onRelease = function () {
if (isPaused) {
this.gotoAndStop(2);
isPaused = false;
} else {
this.gotoAndStop(1);
isPaused = true;
}
};
Frame 111
trace("domain: " + domain);
if (domain == "agame.com") {
MochiAd.showInterLevelAd({id:"a0560afad653c7d2", res:"540x400"});
stop();
} else {
play();
}
Frame 112
player1 = undefined;
player2 = undefined;
timeSet = undefined;
at = undefined;
if (control2 == "manual") {
gotoAndStop ("2pResult");
}
if (score.right.text > score.left.text) {
if (control2 == "cpu") {
gotoAndStop ("youWon");
}
winId = 2;
} else {
if (control2 == "cpu") {
gotoAndStop ("youLost");
}
winId = 1;
}
scoreCount_ = scoreCount_ * fieldId;
so.data.showKeys = false;
Frame 121
_root.submit_score.enabled = true;
_root.submit_score._visible = true;
startGame.onPress = function () {
paper_bg.newPage = "1p-s2";
paper_bg.gotoAndPlay("in");
};
mainMen.onPress = function () {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
};
submit_score.onPress = function () {
scoreUp.play();
mainMen.enabled = false;
startGame.enabled = false;
unlockClip.enabled = false;
submit_score.enabled = false;
};
if ((fieldId == 1) && (so.data.l2 != true)) {
so.data.l2 = true;
unlockClip.gotoAndStop(2);
}
if ((fieldId == 2) && (so.data.l3 != true)) {
so.data.l3 = true;
unlockClip.gotoAndStop(3);
}
if (fieldId == 3) {
unlockClip.gotoAndStop(4);
}
scoreArea.text = ("YOU GOT: " + scoreCount_) + " POINTS";
scoreC = scoreCount_;
startGame.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
mainMen.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 131
scoreCount_ = 0;
startGame.onPress = function () {
paper_bg.newPage = "1p-s2";
paper_bg.gotoAndPlay("in");
};
mainMen.onPress = function () {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
};
startGame.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
mainMen.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 141
resText.text = ("PLAYER " + winId) + " WON!";
winId = undefined;
startGame.onPress = function () {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
};
startGame.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
Frame 151
function init() {
you_can_be_first._visible = false;
loader_symb._visible = true;
var _local2 = new XML();
_local2.ignoreWhite = true;
_local2.onLoad = function (success) {
if (success) {
if (sortId == 1) {
scoreHeader.text = "Today's top scores";
}
if (sortId == 2) {
scoreHeader.text = "This month's top scores";
}
if (sortId == 3) {
scoreHeader.text = "The highest scores in Aniball history!";
}
strip(this);
} else {
goModul._visible = true;
loader_symb._visible = false;
trace("Error: could not load XML");
}
};
_local2.load(adress + sortId);
}
function strip(xml) {
var _local5 = new Array();
var _local1 = xml.childNodes;
var _local2 = 0;
while (_local2 < _local1.length) {
if (_local1[_local2].nodeName == "xml") {
_local1 = _local1[_local2].childNodes;
}
_local2++;
}
var _local4 = new Array();
_local2 = 0;
while (_local2 < _local1.length) {
var _local3 = new Object();
_local3.score = _local1[_local2].childNodes[0].firstChild;
_local3.name = _local1[_local2].childNodes[1].firstChild;
_local4.push(_local3);
_local2++;
}
build(_local4);
}
function build(score) {
loader_symb._visible = false;
trace("--- SCORE TABLE ------------------------------------------------------------------------");
if (score.length == 0) {
you_can_be_first._visible = true;
}
var _local1 = 0;
while (_local1 < score.length) {
archive.stripContainer.attachMovie("strip_archive", "strip_archive_" + _local1, _local1);
var _local2 = archive.stripContainer["strip_archive_" + _local1];
_local2._y = _local1 * _local2._height;
_local2.pos_txt.text = _local1 + 1;
_local2.sco_txt.text = score[_local1].score;
_local2.nam_txt.text = score[_local1].name;
trace(((((_local1 + 1) + "\t: ") + score[_local1].score) + "\t\t\t: ") + score[_local1].name);
_local1++;
}
}
function resetScoreBoard() {
archive.stripContainer.unloadMovie();
trace("reset");
}
you_can_be_first._visible = false;
goModul._visible = false;
goModul.onPress = function () {
getURL ("http://www.modul-games.com/aniball", "_blank");
};
back.onRelease = function () {
paper_bg.newPage = "mainMenu";
paper_bg.gotoAndPlay("in");
};
back.onRollOver = function () {
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
var sortId = 1;
var adress = "http://www.modul-games.com/labs/results.php?sort=";
var xmlObject;
init();
day.onPress = function () {
if (sortId != 1) {
resetScoreBoard();
sortId = 1;
init();
}
};
month.onPress = function () {
if (sortId != 2) {
resetScoreBoard();
sortId = 2;
init();
}
};
ever.onPress = function () {
if (sortId != 3) {
resetScoreBoard();
sortId = 3;
init();
}
};
Symbol 15 MovieClip Frame 1
var currentDir = "start";
onEnterFrame = function () {
if (currentDir != dirString) {
trace("currentDir: " + currentDir);
currentDir = dirString;
gotoAndPlay(currentDir);
}
};
stop();
Symbol 15 MovieClip Frame 16
gotoAndPlay(dirString);
Symbol 15 MovieClip Frame 28
gotoAndPlay(dirString);
Symbol 15 MovieClip Frame 40
gotoAndPlay(dirString);
Symbol 15 MovieClip Frame 52
gotoAndPlay(dirString);
Symbol 15 MovieClip Frame 64
gotoAndPlay(dirString);
Symbol 15 MovieClip Frame 76
gotoAndPlay(dirString);
Symbol 15 MovieClip Frame 88
gotoAndPlay(dirString);
Symbol 15 MovieClip Frame 100
gotoAndPlay(dirString);
Symbol 16 MovieClip [ball] Frame 1
#initclip 29
Object.registerClass("ball", classes.footbot.Ball);
#endinitclip
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 2
onEnterFrame = function () {
selestor._rotation = selestor._rotation + 3;
};
Symbol 30 MovieClip Frame 1
stop();
Symbol 32 MovieClip [player02_off] Frame 1
#initclip 24
Object.registerClass("player02_off", classes.footbot.Player);
#endinitclip
stop();
Symbol 56 MovieClip Frame 1
stop();
Symbol 56 MovieClip Frame 19
gotoAndPlay ("run_up");
Symbol 56 MovieClip Frame 28
gotoAndPlay ("run_down");
Symbol 56 MovieClip Frame 37
gotoAndPlay ("run_left");
Symbol 56 MovieClip Frame 46
gotoAndPlay ("run_right");
Symbol 56 MovieClip Frame 55
stop();
Symbol 59 MovieClip [player2] Frame 1
#initclip 25
Object.registerClass("player2", classes.footbot.Player);
#endinitclip
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 15
gotoAndPlay ("run_up");
Symbol 74 MovieClip Frame 24
gotoAndPlay ("run_down");
Symbol 74 MovieClip Frame 33
gotoAndPlay ("run_left");
Symbol 74 MovieClip Frame 42
gotoAndPlay ("run_right");
Symbol 74 MovieClip Frame 51
stop();
Symbol 76 MovieClip [player4] Frame 1
#initclip 26
Object.registerClass("player4", classes.footbot.Player);
#endinitclip
stop();
Symbol 85 MovieClip Frame 1
allowIo = true;
onEnterFrame = function () {
if (allowIo) {
if (random(10) == 1) {
allowIo = false;
play();
} else {
stop();
}
}
};
Symbol 91 MovieClip Frame 1
stop();
Symbol 91 MovieClip Frame 15
gotoAndPlay ("run_up");
Symbol 91 MovieClip Frame 24
gotoAndPlay ("run_down");
Symbol 91 MovieClip Frame 33
gotoAndPlay ("run_left");
Symbol 91 MovieClip Frame 42
gotoAndPlay ("run_right");
Symbol 91 MovieClip Frame 51
stop();
Symbol 93 MovieClip [player3] Frame 1
#initclip 27
Object.registerClass("player3", classes.footbot.Player);
#endinitclip
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 18
gotoAndPlay ("run_up");
Symbol 112 MovieClip Frame 27
gotoAndPlay ("run_down");
Symbol 112 MovieClip Frame 36
gotoAndPlay ("run_left");
Symbol 112 MovieClip Frame 45
gotoAndPlay ("run_right");
Symbol 112 MovieClip Frame 54
gotoAndStop (1);
Symbol 112 MovieClip Frame 63
gotoAndStop (1);
Symbol 112 MovieClip Frame 72
gotoAndStop (1);
Symbol 112 MovieClip Frame 81
gotoAndStop (1);
Symbol 112 MovieClip Frame 90
gotoAndStop (1);
Symbol 112 MovieClip Frame 99
gotoAndStop (1);
Symbol 112 MovieClip Frame 108
gotoAndStop (1);
Symbol 112 MovieClip Frame 117
gotoAndStop (1);
Symbol 112 MovieClip Frame 126
stop();
Symbol 114 MovieClip [player1] Frame 1
#initclip 28
Object.registerClass("player1", classes.footbot.Player);
#endinitclip
stop();
Symbol 123 MovieClip [player_high2] Frame 1
stop();
Symbol 123 MovieClip [player_high2] Frame 2
onEnterFrame = function () {
selestor._rotation = selestor._rotation + 3;
};
Symbol 124 MovieClip [player_high1] Frame 1
stop();
Symbol 124 MovieClip [player_high1] Frame 2
onEnterFrame = function () {
selestor._rotation = selestor._rotation + 3;
};
Symbol 129 MovieClip Frame 1
stop();
Symbol 130 MovieClip [spark] Frame 1
var dirX;
var dirY;
var count = 0;
onEnterFrame = function () {
this._x = this._x + dirX;
this._y = this._y + dirY;
count++;
if (count == 50) {
_parent._parent.cleanUp(id);
}
};
Symbol 382 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
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.adLoaded = function (width, height) {
};
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;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
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.adLoaded = function (width, height) {
};
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;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(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);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
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_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
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);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _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 _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(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);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(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]);
}
static function _parseOptions(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);
}
}
Symbol 383 MovieClip [__Packages.classes.footbot.Player] Frame 0
class classes.footbot.Player extends MovieClip
{
var cpuSidekick, cpuAi, manualInput, teamManager, keeperInput, ball, compass, maxBallHandleSpeed, ballHandleRange, opposingTeam, myKickSpeed, hisKickSpeed, startX, _x, startY, _y, type, physicalSpeed, highLite, isSelected, animationDir, charLayer, miniMe, xDirOld, yDirOld;
function Player () {
super();
setSelection(false);
cpuSidekick = new classes.footbot.controller.CpuSidekick();
cpuAi = new classes.footbot.controller.CpuAi();
manualInput = new classes.footbot.controller.ManualInput(this, teamManager.IOScheme);
keeperInput = new classes.footbot.controller.KeeperInput(this, teamManager.teamIO);
ball = classes.MatchManager.ball;
ball.cickTeam = undefined;
compass.gotoAndStop(facing);
maxBallHandleSpeed = 30;
ballHandleRange = 20;
if (teamManager.teamId == 1) {
opposingTeam = classes.MatchManager.team2;
} else {
opposingTeam = classes.MatchManager.team1;
}
myKickSpeed = classes.Main.at.myKick;
hisKickSpeed = classes.Main.at.hisKick;
}
function saveState() {
startX = _x;
startY = _y;
keeperInput.initSpeed = speed;
keeperInput.xSpeed = startX * 8;
keeperInput.ySpeed = startY * 8;
if (type == "keeper") {
if (teamManager.teamId == 1) {
maxBallHandleSpeed = 50;
ballHandleRange = 30;
} else {
maxBallHandleSpeed = classes.Main.at.keeperHandleSpeed;
ballHandleRange = classes.Main.at.keeperRange;
}
}
}
function move(isUp, isDown, isLeft, isRight) {
if (isUp == undefined) {
isUp = false;
}
if (isDown == undefined) {
isDown = false;
}
if (isLeft == undefined) {
isLeft = false;
}
if (isRight == undefined) {
isRight = false;
}
if (isUp && (isDown)) {
isUp = false;
isDown = false;
}
if (isLeft && (isRight)) {
isLeft = false;
isRight = false;
}
if ((isUp || (isDown)) && (isLeft || (isRight))) {
physicalSpeed = Math.floor(speed * 0.707106781186547);
} else {
physicalSpeed = speed;
}
if (isUp) {
_y = _y - physicalSpeed;
}
if (isDown) {
_y = _y + physicalSpeed;
}
if (isLeft) {
_x = _x - physicalSpeed;
}
if (isRight) {
_x = _x + physicalSpeed;
}
highLite._x = _x;
highLite._y = _y;
var _local2 = facing;
if (isUp) {
_local2 = "u";
}
if (isDown) {
_local2 = "d";
}
if (isLeft) {
_local2 = "l";
}
if (isRight) {
_local2 = "r";
}
if (isUp && (isRight)) {
_local2 = "u-r";
}
if (isDown && (isRight)) {
_local2 = "d-r";
}
if (isUp && (isLeft)) {
_local2 = "u-l";
}
if (isDown && (isLeft)) {
_local2 = "d-l";
}
facing = _local2;
if (_y < classes.MatchManager.FIELD.top) {
_y = classes.MatchManager.FIELD.top;
}
if (_y > classes.MatchManager.FIELD.bottom) {
_y = classes.MatchManager.FIELD.bottom;
}
if (_x < (classes.MatchManager.FIELD.left - (_y / 15))) {
if ((_y > classes.MatchManager.GOAL.top) && (_y < classes.MatchManager.GOAL.bottom)) {
if (_x < (classes.MatchManager.FIELD.left - classes.MatchManager.GOAL.depth)) {
_x = classes.MatchManager.FIELD.left - classes.MatchManager.GOAL.depth;
}
} else if ((_y > (classes.MatchManager.GOAL.top - 10)) && (_y < (classes.MatchManager.GOAL.bottom + 10))) {
if (_y <= classes.MatchManager.GOAL.top) {
_y = classes.MatchManager.GOAL.top;
}
if (_y >= classes.MatchManager.GOAL.bottom) {
_y = classes.MatchManager.GOAL.bottom;
}
if (_x < (classes.MatchManager.FIELD.left - classes.MatchManager.GOAL.depth)) {
_x = classes.MatchManager.FIELD.left - classes.MatchManager.GOAL.depth;
}
} else {
_x = classes.MatchManager.FIELD.left - (_y / 15);
}
}
if (_x > (classes.MatchManager.FIELD.right + (_y / 15))) {
if ((_y > classes.MatchManager.GOAL.top) && (_y < classes.MatchManager.GOAL.bottom)) {
if (_x > (classes.MatchManager.FIELD.right + classes.MatchManager.GOAL.depth)) {
_x = classes.MatchManager.FIELD.right + classes.MatchManager.GOAL.depth;
}
} else if ((_y > (classes.MatchManager.GOAL.top - 10)) && (_y < (classes.MatchManager.GOAL.bottom + 10))) {
if (_y <= classes.MatchManager.GOAL.top) {
_y = classes.MatchManager.GOAL.top;
}
if (_y >= classes.MatchManager.GOAL.bottom) {
_y = classes.MatchManager.GOAL.bottom;
}
if (_x > (classes.MatchManager.FIELD.right + classes.MatchManager.GOAL.depth)) {
_x = classes.MatchManager.FIELD.right + classes.MatchManager.GOAL.depth;
}
} else {
_x = classes.MatchManager.FIELD.right + (_y / 15);
}
}
}
function handleBall() {
ball.cickTeam = undefined;
ball.xKick = ball.xKick / 3;
ball.yKick = ball.yKick / 3;
if (!isSelected) {
teamManager.selectedPlayer.setSelection(false);
setSelection(true);
}
var _local2 = 0;
if (((facing == "u") || (facing == "u-l")) || (facing == "u-r")) {
_local2 = -15;
}
if (((facing == "d") || (facing == "d-l")) || (facing == "d-r")) {
_local2 = 14;
}
if (holdCoult < 1) {
ball._x = _x + 0;
ball._y = (_y + 4) + _local2;
}
}
function passBall() {
if (hasBall) {
ball.cickTeam = undefined;
hasBall = false;
var _local3 = getClosestPartner();
var _local4 = (_local3.distance / 7) / 100;
classes.MatchManager.ball.pass(this, _local3, _local4);
ball.anim.dirString = "start";
if (teamManager.teamId == 1) {
_root.scoreCount_ = _root.scoreCount_ + 10;
}
}
}
function passDone(newKid) {
ball.team = undefined;
ball.owner = undefined;
setSelection(false);
newKid.setSelection(true);
}
function getClosestPartner() {
var _local7 = 1000;
var _local8 = 0;
var _local6 = 0;
if (facing == "u") {
_local6 = 0;
}
if (facing == "r") {
_local6 = 90;
}
if (facing == "d") {
_local6 = 180;
}
if (facing == "l") {
_local6 = 270;
}
if (facing == "u-r") {
_local6 = 45;
}
if (facing == "d-r") {
_local6 = 135;
}
if (facing == "u-l") {
_local6 = 315;
}
if (facing == "d-l") {
_local6 = 225;
}
var _local4 = teamManager.playerList;
var _local2 = 0;
while (_local2 < _local4.length) {
if (_local4[_local2] != this) {
var _local5 = com.onixus.as2.math.MathExtensions.getDistance(_x, _y, _local4[_local2]._x, _local4[_local2]._y);
_local4[_local2].distance = _local5;
var _local3 = Math.floor(com.onixus.as2.math.MathExtensions.getLineAngle(_x, _y, _local4[_local2]._x, _local4[_local2]._y));
_local3 = _local3 - _local6;
_local3 = com.onixus.as2.math.MathExtensions.toUnit(_local3);
if (_local3 > 180) {
_local3 = 360 - _local3;
}
if (_local3 < _local7) {
_local7 = _local3;
_local8 = _local2;
}
}
_local2++;
}
return(_local4[_local8]);
}
function getClosestOpponent() {
var _local7 = 1000;
var _local8 = 0;
var _local6 = 0;
if (facing == "u") {
_local6 = 0;
}
if (facing == "r") {
_local6 = 90;
}
if (facing == "d") {
_local6 = 180;
}
if (facing == "l") {
_local6 = 270;
}
if (facing == "u-r") {
_local6 = 45;
}
if (facing == "d-r") {
_local6 = 135;
}
if (facing == "u-l") {
_local6 = 315;
}
if (facing == "d-l") {
_local6 = 225;
}
var _local4 = opposingTeam;
var _local2 = 0;
while (_local2 < _local4.length) {
if (_local4[_local2] != this) {
var _local5 = com.onixus.as2.math.MathExtensions.getDistance(_x, _y, _local4[_local2]._x, _local4[_local2]._y);
_local4[_local2].distance = _local5;
var _local3 = Math.floor(com.onixus.as2.math.MathExtensions.getLineAngle(_x, _y, _local4[_local2]._x, _local4[_local2]._y));
_local3 = _local3 - _local6;
_local3 = com.onixus.as2.math.MathExtensions.toUnit(_local3);
if (_local3 > 180) {
_local3 = 360 - _local3;
}
if (_local3 < _local7) {
_local7 = _local3;
_local8 = _local2;
}
}
_local2++;
}
return(_local4[_local8]);
}
function kickBall() {
if (hasBall) {
ball.cickTeam = teamManager.teamId;
hasBall = false;
ball.team = undefined;
ball.owner = undefined;
if (teamManager.teamId == 1) {
ball.kick(facing, myKickSpeed);
} else {
ball.kick(facing, hisKickSpeed);
}
ball.anim.dirString = "start";
}
}
function animationAdaptor(dir, moving) {
compass.gotoAndStop(dir);
if (moving) {
if (animationDir != dir) {
animationDir = dir;
} else {
return(undefined);
}
switch (animationDir) {
case "u" :
charLayer.gotoAndPlay("run_up");
if (hasBall) {
ball.anim.dirString = "run_up";
}
break;
case "d" :
charLayer.gotoAndPlay("run_down");
if (hasBall) {
ball.anim.dirString = "run_down";
}
break;
case "l" :
charLayer.gotoAndPlay("run_left");
if (hasBall) {
ball.anim.dirString = "run_left";
}
break;
case "r" :
charLayer.gotoAndPlay("run_right");
if (hasBall) {
ball.anim.dirString = "run_right";
}
break;
case "u-l" :
charLayer.gotoAndPlay("run_up");
if (hasBall) {
ball.anim.dirString = "run_up";
}
break;
case "u-r" :
charLayer.gotoAndPlay("run_up");
if (hasBall) {
ball.anim.dirString = "run_up";
}
break;
case "d-l" :
charLayer.gotoAndPlay("run_down");
if (hasBall) {
ball.anim.dirString = "run_down";
}
break;
case "d-r" :
charLayer.gotoAndPlay("run_down");
if (hasBall) {
ball.anim.dirString = "run_down";
}
break;
default :
charLayer.gotoAndStop(1);
if (!hasBall) {
break;
}
ball.anim.dirString = "start";
}
} else {
animationDir = undefined;
if (hasBall) {
ball.anim.dirString = "start";
}
switch (dir) {
case "u" :
charLayer.gotoAndStop("run_up");
break;
case "d" :
charLayer.gotoAndStop("run_down");
break;
case "l" :
charLayer.gotoAndStop("run_left");
break;
case "r" :
charLayer.gotoAndStop("run_right");
break;
case "u-l" :
charLayer.gotoAndStop("run_up");
break;
case "u-r" :
charLayer.gotoAndStop("run_up");
break;
case "d-l" :
charLayer.gotoAndStop("run_down");
break;
case "d-r" :
charLayer.gotoAndStop("run_down");
break;
default :
charLayer.gotoAndStop(1);
}
}
}
function handleSelection() {
if (isSelected && (ball.team != teamManager.teamId)) {
if ((ball.xKick || (ball.yKick)) < 20) {
teamManager.selectPlayer();
}
}
}
function toggleSelection() {
if (ball.team != teamManager.teamId) {
teamManager.togglePlayer();
}
}
function setSelection(f_isSelected) {
if (f_isSelected) {
highLite.gotoAndStop(2);
isSelected = true;
teamManager.selectedPlayer = this;
} else {
highLite.gotoAndStop(1);
isSelected = false;
}
}
function reset() {
hasBall = false;
_x = startX;
_y = startY;
charLayer.gotoAndStop("run_down");
animationAdaptor("d", false);
holdCoult = 0;
hold(0, false);
teamManager.selectPlayer();
}
function hold(time, show) {
if (show == undefined) {
show = true;
}
holdCoult = time;
if (hasBall) {
ball.anim.dirString = "start";
}
if (show) {
charLayer.gotoAndStop("knockout");
}
}
function tackle() {
if (com.onixus.as2.math.MathExtensions.getDistance(_x, _y, ball._x, ball._y) < 30) {
if (holdCoult < 1) {
if (((ball.owner != undefined) && (ball.owner != this)) && (ball.team != teamManager.teamId)) {
if (teamManager.teamId == 1) {
_root.scoreCount_ = _root.scoreCount_ + 50;
}
if ((ball.owner.type == "defender") || (ball.owner.type == "keeper")) {
ball.owner.hold(20);
} else {
ball.owner.hold(150);
}
ball.owner.hasBall = false;
com.onixus.as2.sound.AudioPlayer.playFX("tackle");
}
}
}
}
function onEnterFrame() {
aimation();
highLite._x = _x;
highLite._y = _y;
miniMe._x = _x / 3.4;
miniMe._y = _y / 3.4;
if (isSelected) {
miniMe._alpha = 100;
} else {
miniMe._alpha = 50;
}
if (holdCoult == 1) {
compass.gotoAndStop("u");
}
if (holdCoult > 0) {
holdCoult--;
}
if (cpuSidekick.isInit == undefined) {
cpuSidekick.init(this);
}
if (cpuAi.isInit == undefined) {
cpuAi.init(this);
}
if (hasBall) {
handleBall();
} else if (holdCoult < 1) {
if (com.onixus.as2.math.MathExtensions.getDistance(_x, _y, ball._x, ball._y) < ballHandleRange) {
if ((ball.team != teamManager.teamId) && (!ball.owner.hasBall)) {
if ((ball.xKick || (ball.yKick)) < maxBallHandleSpeed) {
ball.cickTeam = undefined;
ball.team = teamManager.teamId;
hasBall = true;
ball.owner = this;
animationAdaptor("d", false);
if (!ball.allowPassing) {
ball.snapOut();
}
}
}
}
}
if (teamManager.teamIO == "cpu") {
handleSelection();
} else {
if (ball.cickTeam) {
handleSelection();
}
if ((holdCoult > 0) && (isSelected)) {
handleSelection();
}
}
if (type == "keeper") {
if ((!hasBall) && (isSelected)) {
handleSelection();
}
if (holdCoult < 1) {
keeperInput.process();
}
return(undefined);
}
if (type == "defender") {
manualInput.process();
if (holdCoult < 1) {
keeperInput.process();
}
if (!hasBall) {
return(undefined);
}
}
if (teamManager.teamIO == "manual") {
if (isSelected) {
if (holdCoult < 1) {
manualInput.process();
if ((type != "defender") && (type != "keeper")) {
cpuSidekick.process();
}
}
} else if (holdCoult < 1) {
cpuSidekick.process();
}
}
if (teamManager.teamIO == "cpu") {
if (isSelected) {
if (holdCoult < 1) {
cpuAi.process();
if ((type != "defender") && (type != "keeper")) {
cpuSidekick.process();
}
}
} else if (holdCoult < 1) {
cpuSidekick.process();
}
}
}
function aimation() {
if (xDirOld == undefined) {
xDirOld = _x;
}
if (yDirOld == undefined) {
yDirOld = _y;
}
if (holdCoult > 0) {
if (!isOntheGround) {
charLayer.gotoAndStop("knockout");
}
isOntheGround = true;
return(undefined);
}
if (isOntheGround) {
animationAdaptor("d", false);
isOntheGround = false;
}
var _local6 = false;
var _local4 = false;
if (_y > (yDirOld + 0.1)) {
_local6 = true;
}
if (_y < (yDirOld - 0.1)) {
_local4 = true;
}
yDirOld = _y;
var _local5 = false;
var _local3 = false;
if (_x > (xDirOld + 0.1)) {
_local3 = true;
}
if (_x < (xDirOld - 0.1)) {
_local5 = true;
}
xDirOld = _x;
var _local2 = facing;
if (_local4) {
_local2 = "u";
}
if (_local6) {
_local2 = "d";
}
if (_local5) {
_local2 = "l";
}
if (_local3) {
_local2 = "r";
}
if (_local4 && (_local3)) {
_local2 = "u-r";
}
if (_local6 && (_local3)) {
_local2 = "d-r";
}
if (_local4 && (_local5)) {
_local2 = "u-l";
}
if (_local6 && (_local5)) {
_local2 = "d-l";
}
facing = _local2;
if (((_local4 || (_local6)) || (_local5)) || (_local3)) {
animationAdaptor(_local2, true);
} else {
animationAdaptor(facing, false);
}
}
var speed = 8;
var hasBall = false;
var facing = "d";
var holdCoult = 0;
var isOntheGround = false;
}
Symbol 384 MovieClip [__Packages.classes.footbot.controller.CpuSidekick] Frame 0
class classes.footbot.controller.CpuSidekick
{
var isInit, player, teamId, ball, allyTeam, opposingTeam, moveX, moveY, DIRECTION, startX, startY;
function CpuSidekick () {
}
function init(m_player) {
isInit = true;
player = m_player;
teamId = player.teamManager.teamId;
ball = classes.MatchManager.ball;
allyTeam = classes.MatchManager["team" + teamId];
if (teamId == 1) {
opposingTeam = classes.MatchManager.team2;
} else {
opposingTeam = classes.MatchManager.team1;
}
moveX = player.startX;
moveY = player.startY;
DIRECTION = player.teamManager.DIRECTION;
}
function process() {
if (ball.team == teamId) {
if (player.isSelected) {
var _local4 = 10000;
var _local5 = 0;
var _local2 = 0;
while (_local2 < allyTeam.length) {
if (allyTeam[_local2].type != "keeper") {
var _local3 = com.onixus.as2.math.MathExtensions.getDistance(0, player._y, 0, allyTeam[_local2].startY);
if (_local3 < _local4) {
_local4 = _local3;
_local5 = _local2;
}
}
_local2++;
}
var _local11 = player.startX;
var _local10 = player.startY;
player.startX = allyTeam[_local5].startX;
player.startY = allyTeam[_local5].startY;
allyTeam[_local5].startX = _local11;
allyTeam[_local5].startY = _local10;
} else {
moveX = player._x;
if (com.onixus.as2.math.MathExtensions.getDistance(0, player._y, 0, player.startY) > 20) {
moveY = player.startY;
}
var _local6;
var _local8;
var _local2 = 0;
while (_local2 < allyTeam.length) {
if ((allyTeam[_local2].type != "keeper") && (!allyTeam[_local2].isSelected)) {
if (allyTeam[_local2] == player) {
_local6 = allyTeam[_local2];
} else {
_local8 = allyTeam[_local2];
}
}
_local2++;
}
var _local7;
if (DIRECTION == "left") {
_local7 = 150;
} else {
_local7 = -150;
}
if (ball._y >= (classes.MatchManager.CENTER_Y + 50)) {
if (_local6._y > classes.MatchManager.CENTER_Y) {
moveX = ball._x + _local7;
} else {
moveX = ball._x - _local7;
}
}
if (ball._y < (classes.MatchManager.CENTER_Y - 50)) {
if (_local6._y < classes.MatchManager.CENTER_Y) {
moveX = ball._x + _local7;
} else {
moveX = ball._x - _local7;
}
}
if (ball.owner.type == "defender") {
moveX = player.startX - _local7;
moveY = player.startY;
}
if (moveX < (classes.MatchManager.FIELD.left + 50)) {
moveX = classes.MatchManager.FIELD.left + 70;
}
if (moveX > (classes.MatchManager.FIELD.right - 50)) {
moveX = classes.MatchManager.FIELD.right - 70;
}
move(moveX, moveY);
}
} else if ((ball.team != undefined) && (!player.isSelected)) {
var _local9 = com.onixus.as2.math.MathExtensions.getDistance(player._x, player._y, ball._x, ball._y);
if (_local9 < 70) {
} else {
moveY = player.startY;
moveX = player.startX;
move(moveX, moveY);
}
}
}
function move(toX, toY) {
if (Math.floor(com.onixus.as2.math.MathExtensions.toUnit(player._y - toY)) > 5) {
var _local5 = false;
var _local3 = false;
if (player._y < toY) {
_local5 = true;
}
if (player._y > toY) {
_local3 = true;
}
}
if (Math.floor(com.onixus.as2.math.MathExtensions.toUnit(player._x - toX)) > 5) {
var _local4 = false;
var _local2 = false;
if (player._x < toX) {
_local2 = true;
}
if (player._x > toX) {
_local4 = true;
}
}
player.move(_local3, _local5, _local4, _local2);
}
function gotoStart() {
var _local4 = false;
var _local2 = false;
var _local5 = false;
var _local3 = false;
if (com.onixus.as2.math.MathExtensions.toUnit(startX - player._x) > 20) {
if (startX < player._x) {
_local5 = true;
}
if (startX > player._x) {
_local3 = true;
}
}
if (com.onixus.as2.math.MathExtensions.toUnit(startY - player._y) > 20) {
if (startY < player._y) {
_local4 = true;
}
if (startY > player._y) {
_local2 = true;
}
}
player.move(_local4, _local2, _local5, _local3);
}
function takePosition() {
var _local4 = false;
var _local3 = false;
var _local5 = false;
var _local2 = false;
if (ball._x > (player._x - 100)) {
_local2 = true;
}
if (com.onixus.as2.math.MathExtensions.getDistance(player._x, player._y, ball._x, ball._y) > 500) {
gotoBall();
} else {
player.move(_local4, _local3, _local5, _local2);
}
}
function gotoBall() {
var _local4 = false;
var _local2 = false;
var _local5 = false;
var _local3 = false;
if (com.onixus.as2.math.MathExtensions.toUnit(ball._x - player._x) > 10) {
if (ball._x < player._x) {
_local5 = true;
}
if (ball._x > player._x) {
_local3 = true;
}
}
if (com.onixus.as2.math.MathExtensions.toUnit(ball._y - player._y) > 10) {
if (ball._y < player._y) {
_local4 = true;
}
if (ball._y > player._y) {
_local2 = true;
}
}
player.move(_local4, _local2, _local5, _local3);
}
}
Symbol 385 MovieClip [__Packages.classes.MatchManager] Frame 0
class classes.MatchManager
{
static var mManager, team1, team2, ball, interval, scoreSide;
var p1obj, p2obj, main, team1Conf, team2Conf, target, _time;
function MatchManager (f_main, f_field, f_p1, f_p2, f_time, f_team1Conf, f_team2Conf) {
if (f_time != undefined) {
GAME_TIME = f_time;
trace("game time:" + GAME_TIME);
}
p1obj = f_p1;
p2obj = f_p2;
main = f_main;
mManager = this;
var _local5 = CENTER_Y;
if (f_team1Conf == undefined) {
team1Conf = [new classes.footbot.PlayerTag(CENTER_X - 100, CENTER_Y, "top", 6), new classes.footbot.PlayerTag(CENTER_X - 200, CENTER_Y - 180, "center", 5.5), new classes.footbot.PlayerTag(CENTER_X - 200, CENTER_Y + 190, "center", 5), new classes.footbot.PlayerTag(CENTER_X - 330, CENTER_Y, "keeper", 2)];
} else {
team1Conf = f_team1Conf;
}
if (f_team2Conf == undefined) {
team2Conf = [new classes.footbot.PlayerTag(CENTER_X + 100, CENTER_Y, "top", 6), new classes.footbot.PlayerTag(CENTER_X + 200, CENTER_Y - 180, "center", 5.5), new classes.footbot.PlayerTag(CENTER_X + 200, CENTER_Y + 190, "center", 5), new classes.footbot.PlayerTag(CENTER_X + 330, CENTER_Y, "keeper", 2)];
} else {
team2Conf = f_team2Conf;
}
team1 = new Array();
team2 = new Array();
target = _root.stage.charLayer;
initBall();
initTeams();
initCamera();
initTimer();
classes.footbot.Ball.scoreLeft = 1;
classes.footbot.Ball.scoreRight = 1;
_root.score.left.text = 0;
_root.score.right.text = 0;
}
function initTeams() {
var _local4;
var _local2 = 1;
var _local3 = p1obj.control;
var _local5 = p1obj.charId;
_local4 = new classes.footbot.controller.KeyConfig(38, 40, 37, 39, 188, 190);
new classes.TeamManager(target, team1Conf, _local2, _local3, _local4, _local5);
_local2 = 2;
_local3 = p2obj.control;
_local5 = p2obj.charId;
_local4 = new classes.footbot.controller.KeyConfig(87, 83, 65, 68, 84, 89);
new classes.TeamManager(target, team2Conf, _local2, _local3, _local4, _local5);
com.onixus.as2.sound.AudioPlayer.playFX("whistle_start");
}
function initBall() {
ball = target.attachMovie("ball", "ball", 500, {_x:(Stage.width / 2) + 95, _y:(ball._y = (Stage.height / 2) - 45)});
ball._x = CENTER_X;
ball._y = CENTER_Y;
ball.cacheAsBitmap = true;
com.onixus.as2._2d.DepthManager.addObject(ball);
ball._xscale = (ball._yscale = 40);
}
function initCamera() {
new classes.Cam();
}
static function reset() {
_root.goal.gotoAndStop(2);
interval = setInterval(mManager.resetExecuted, 1800);
}
function resetExecuted() {
clearInterval(interval);
classes.Cam.hRim = 450;
classes.footbot.controller.CpuAi.delay = classes.footbot.controller.CpuAi.initDelay;
ball.snapOut();
ball.xKick = 0;
ball.yKick = 0;
ball.owner = undefined;
ball.team = undefined;
ball._x = CENTER_X;
ball._y = CENTER_Y;
ball.inGoal = false;
ball.anim.dirString = "start";
var _local1 = 0;
while (_local1 < team1.length) {
team1[_local1].reset();
team2[_local1].reset();
_local1++;
}
interval = setInterval(mManager.kickIn, 800);
}
function kickIn() {
clearInterval(interval);
if (scoreSide == "left") {
ball.xKick = -15;
}
if (scoreSide == "right") {
ball.xKick = 15;
}
com.onixus.as2.sound.AudioPlayer.playFX("whistle_start");
}
function initTimer() {
com.onixus.as2.events.FrameGenerator.addListener(this);
_time = new com.onixus.as2.events.Timer();
}
function onEnterFrame() {
_root.score.time.text = (((GAME_TIME - 1) - _time.getMinutes()) + ":") + (((59 - _time.getSeconds()) >= 10) ? (59 - _time.getSeconds()) : ("0" + (59 - _time.getSeconds())));
if (_time.getMinutes() >= GAME_TIME) {
_root.score.time.text = "overtime";
if (classes.footbot.Ball.scoreLeft != classes.footbot.Ball.scoreRight) {
endGame();
}
}
}
function endGame() {
com.onixus.as2.sound.AudioPlayer.playFX("whistle_end");
clearInterval(interval);
_root.score.time.text = "";
com.onixus.as2.events.FrameGenerator.removeListener(this);
main.kill();
_root.paper_bg.newPage = "postGame";
_root.paper_bg.gotoAndPlay("in");
}
var GAME_TIME = 3;
static var FIELD = {top:-100, bottom:455, left:-70, right:760};
static var GOAL = {top:135, bottom:195, depth:70};
static var CENTER_X = 340;
static var CENTER_Y = 145;
}
Symbol 386 MovieClip [__Packages.com.onixus.as2.events.Timer] Frame 0
class com.onixus.as2.events.Timer
{
var initTime, pStart;
function Timer (f_offset) {
if (f_offset == null) {
f_offset = 0;
}
offset = f_offset * 1000;
initTime = getTimer();
}
function getTime() {
if (isPaused) {
var _local2 = getTimer() - pStart;
} else {
var _local2 = 0;
}
return((((getTimer() - initTime) - pauseTime) - _local2) + offset);
}
function getSeconds() {
var _local2 = Math.floor(getTime() / 1000);
var _local4 = Math.floor(_local2 / 60);
var _local3 = _local2 - (_local4 * 60);
return(Number(_local3));
}
function getMinutes() {
var _local3 = Math.floor(getTime() / 1000);
var _local2 = Math.floor(_local3 / 60);
var _local5 = Math.floor(_local2 / 60);
var _local4 = _local2 - (_local5 * 60);
return(Number(_local4));
}
function getHours() {
var _local2 = Math.floor(getTime() / 1000);
var _local4 = Math.floor(_local2 / 60);
var _local5 = Math.floor(_local4 / 60);
var _local3 = _local5;
return(Number(_local3));
}
function start() {
initTime = getTimer();
}
function pause() {
pStart = getTimer();
isPaused = true;
}
function resume() {
var _local2 = getTimer() - pStart;
pauseTime = pauseTime + _local2;
isPaused = false;
}
var isPaused = false;
var pauseTime = 0;
var offset = 0;
}
Symbol 387 MovieClip [__Packages.classes.footbot.PlayerTag] Frame 0
class classes.footbot.PlayerTag
{
var x, y, type, speed;
function PlayerTag (m_x, m_y, m_type, m_speed) {
x = m_x;
y = m_y;
type = m_type;
speed = m_speed;
}
}
Symbol 388 MovieClip [__Packages.classes.footbot.Ball] Frame 0
class classes.footbot.Ball extends MovieClip
{
static var _destinationObj;
var myTween1, _x, myTween2, _y;
function Ball () {
super();
}
function pass(departureObj, destinationObj, passSpeed) {
com.onixus.as2.sound.AudioPlayer.playFX("kick");
_destinationObj = destinationObj;
if (allowPassing) {
allowPassing = false;
myTween1 = new mx.transitions.Tween(this, "_x", mx.transitions.easing.Regular.easeOut, _x, destinationObj._x, passSpeed, true);
myTween2 = new mx.transitions.Tween(this, "_y", mx.transitions.easing.Regular.easeOut, _y, destinationObj._y, passSpeed, true);
}
var target = this;
myTween1.onMotionChanged = function () {
this.finish = classes.footbot.Ball._destinationObj._x;
};
myTween2.onMotionChanged = function () {
this.finish = classes.footbot.Ball._destinationObj._y;
};
myTween1.onMotionFinished = function () {
target.allowPassing = true;
departureObj.passDone(destinationObj);
};
}
function kick(dir, myKickSpeed) {
com.onixus.as2.sound.AudioPlayer.playFX("kick");
kickSpeed = myKickSpeed;
xKick = 0;
yKick = 0;
if (dir == "u") {
yKick = -kickSpeed;
}
if (dir == "d") {
yKick = kickSpeed;
}
if (dir == "l") {
xKick = -kickSpeed;
}
if (dir == "r") {
xKick = kickSpeed;
}
if (dir.length > 2) {
var _local2 = Math.round(kickSpeed * 0.707106781186547);
}
if (dir == "u-r") {
yKick = -_local2;
xKick = _local2;
}
if (dir == "d-r") {
yKick = _local2;
xKick = _local2;
}
if (dir == "u-l") {
yKick = -_local2;
xKick = -_local2;
}
if (dir == "d-l") {
yKick = _local2;
xKick = -_local2;
}
isKicking = true;
}
function onEnterFrame() {
if (isKicking) {
_x = _x + xKick;
_y = _y + yKick;
if (_y < classes.MatchManager.FIELD.top) {
_y = classes.MatchManager.FIELD.top;
yKick = yKick * -1;
}
if (_y > classes.MatchManager.FIELD.bottom) {
_y = classes.MatchManager.FIELD.bottom;
yKick = yKick * -1;
}
var _local3 = 15;
if (_x < ((classes.MatchManager.FIELD.left - (_y / _local3)) - 5)) {
if ((_y > (classes.MatchManager.GOAL.top - 10)) && (_y < (classes.MatchManager.GOAL.bottom + 10))) {
if (!inGoal) {
inGoal = true;
classes.MatchManager.reset();
_root.score.left.text = scoreLeft++;
classes.MatchManager.scoreSide = "left";
com.onixus.as2.sound.AudioPlayer.playFX("cheer");
}
if (_x < ((classes.MatchManager.FIELD.left - (_y / _local3)) - classes.MatchManager.GOAL.depth)) {
_x = (classes.MatchManager.FIELD.left - (_y / _local3)) - classes.MatchManager.GOAL.depth;
xKick = xKick * -1;
xKick = xKick / 5;
yKick = yKick / 5;
}
} else if ((_y > (classes.MatchManager.GOAL.top - 20)) && (_y < (classes.MatchManager.GOAL.bottom + 20))) {
if (_y <= classes.MatchManager.GOAL.top) {
_y = classes.MatchManager.GOAL.top;
yKick = yKick * -1;
xKick = xKick / 5;
yKick = yKick / 5;
}
if (_y >= classes.MatchManager.GOAL.bottom) {
_y = classes.MatchManager.GOAL.bottom;
yKick = yKick * -1;
xKick = xKick / 5;
yKick = yKick / 5;
}
if (_x < ((classes.MatchManager.FIELD.left - (_y / _local3)) - classes.MatchManager.GOAL.depth)) {
_x = (classes.MatchManager.FIELD.left - (_y / _local3)) - classes.MatchManager.GOAL.depth;
xKick = xKick * -1;
xKick = xKick / 5;
yKick = yKick / 5;
}
} else {
_x = classes.MatchManager.FIELD.left - (_y / _local3);
xKick = xKick * -1;
}
}
if (_x > ((classes.MatchManager.FIELD.right + (_y / _local3)) + 14)) {
if ((_y > (classes.MatchManager.GOAL.top - 10)) && (_y < (classes.MatchManager.GOAL.bottom + 10))) {
if (!inGoal) {
inGoal = true;
classes.MatchManager.reset();
_root.score.right.text = scoreRight++;
classes.MatchManager.scoreSide = "right";
_root.scoreCount_ = _root.scoreCount_ + 1000;
com.onixus.as2.sound.AudioPlayer.playFX("cheer");
}
if (_x > ((classes.MatchManager.FIELD.right + (_y / _local3)) + classes.MatchManager.GOAL.depth)) {
_x = (classes.MatchManager.FIELD.right + (_y / _local3)) + classes.MatchManager.GOAL.depth;
xKick = xKick * -1;
xKick = xKick / 5;
yKick = yKick / 5;
}
} else if ((_y > (classes.MatchManager.GOAL.top - 20)) && (_y < (classes.MatchManager.GOAL.bottom + 20))) {
if (_y <= classes.MatchManager.GOAL.top) {
_y = classes.MatchManager.GOAL.top;
yKick = yKick * -1;
xKick = xKick / 5;
yKick = yKick / 5;
}
if (_y >= classes.MatchManager.GOAL.bottom) {
_y = classes.MatchManager.GOAL.bottom;
yKick = yKick * -1;
xKick = xKick / 5;
yKick = yKick / 5;
}
if (_x > ((classes.MatchManager.FIELD.right + (_y / _local3)) + classes.MatchManager.GOAL.depth)) {
_x = (classes.MatchManager.FIELD.right + (_y / _local3)) + classes.MatchManager.GOAL.depth;
xKick = xKick * -1;
xKick = xKick / 5;
yKick = yKick / 5;
}
} else {
_x = classes.MatchManager.FIELD.right + (_y / _local3);
xKick = xKick * -1;
}
}
if ((xKick < 1) && (xKick > -1)) {
xKick = 0;
}
xKick = xKick / breakSpeed;
if ((yKick < 1) && (yKick > -1)) {
yKick = 0;
}
yKick = yKick / breakSpeed;
}
}
function snapOut(tm) {
myTween1.stop();
myTween2.stop();
allowPassing = true;
}
var allowPassing = true;
var isKicking = true;
var xKick = 0;
var yKick = 0;
var kickSpeed = 40;
var breakSpeed = 1.09;
static var scoreLeft = 1;
static var scoreRight = 1;
var inGoal = false;
}
Symbol 389 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 390 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 391 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 392 MovieClip [__Packages.com.onixus.as2.sound.AudioPlayer] Frame 0
class com.onixus.as2.sound.AudioPlayer
{
static var soundFX, soundES, tmp_vol;
function AudioPlayer () {
}
static function playFX(trakID, isRepeate) {
if (isRepeate == undefined) {
isRepeate = false;
}
if (soundFX == undefined) {
soundFX = new Sound();
}
soundFX.attachSound(trakID);
soundFX.setVolume(vol);
soundFX.start();
}
static function playExternalSong(trakName, isLoop) {
if (soundES == undefined) {
soundES = new Sound();
}
soundES.onLoad = function (success) {
if (success) {
this.start();
if (com.onixus.as2.sound.AudioPlayer.vol == 0) {
this.setVolume(0);
} else {
this.setVolume(com.onixus.as2.sound.AudioPlayer.vol - 50);
}
}
};
soundES.onSoundComplete = function () {
if (com.onixus.as2.sound.AudioPlayer.cueTrak != undefined) {
com.onixus.as2.sound.AudioPlayer.playExternalSong(com.onixus.as2.sound.AudioPlayer.cueTrak, true);
com.onixus.as2.sound.AudioPlayer.cueTrak = undefined;
}
if (isLoop != false) {
this.start();
if (com.onixus.as2.sound.AudioPlayer.vol == 0) {
this.setVolume(0);
} else {
this.setVolume(com.onixus.as2.sound.AudioPlayer.vol - 50);
}
} else {
}
};
soundES.loadSound(trakName, false);
}
static function addNextSong(trakName, isLoop) {
var tmp_nextSong = new Sound();
tmp_nextSong.onLoad = function (success) {
com.onixus.as2.sound.AudioPlayer.cueTrak = trakName;
delete tmp_nextSong;
};
tmp_nextSong.loadSound(trakName, false);
}
static function mute(isOn) {
if (isOn) {
tmp_vol = vol;
vol = 0;
} else {
vol = tmp_vol;
}
soundFX.setVolume(vol);
if (vol > 0) {
var _local1 = vol - 50;
} else {
var _local1 = 0;
}
soundES.setVolume(_local1);
}
static var vol = 60;
}
Symbol 393 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 394 MovieClip [__Packages.classes.footbot.controller.KeyConfig] Frame 0
class classes.footbot.controller.KeyConfig
{
var up, down, left, right, action1, action2;
function KeyConfig (m_up, m_down, m_left, m_right, m_action1, m_action2) {
up = m_up;
down = m_down;
left = m_left;
right = m_right;
action1 = m_action1;
action2 = m_action2;
}
}
Symbol 395 MovieClip [__Packages.classes.TeamManager] Frame 0
class classes.TeamManager
{
var target, teamId, teamConfig, teamIO, IOScheme, CharId, DIRECTION, playerList, selectedPlayer;
function TeamManager (m_target, m_teamConfig, m_teamId, m_teamIO, m_IOScheme, m_CharId) {
target = m_target;
teamId = m_teamId;
teamConfig = m_teamConfig;
teamIO = m_teamIO;
IOScheme = m_IOScheme;
CharId = m_CharId;
if (m_teamConfig[0].x < classes.MatchManager.CENTER_X) {
DIRECTION = "right";
} else {
DIRECTION = "left";
}
build();
}
function build() {
playerList = new Array();
var _local4 = 0;
while (_local4 < teamConfig.length) {
var _local3 = target.attachMovie("player" + CharId, (("player" + teamId) + "_") + _local4, target.getNextHighestDepth(), {teamManager:this, id:_local4});
trace("team id: " + teamId);
var _local5 = _root.stage.highLayer.attachMovie("player_high" + teamId, (("player_high" + teamId) + "_") + _local4, target.getNextHighestDepth());
_local3.highLite = _local5;
_local3.highLite._yScale = 50;
_local3.id_txt.text = _local4;
if (_local4 == 0) {
_local3.setSelection(true);
}
_local3._x = teamConfig[_local4].x;
_local3._y = teamConfig[_local4].y;
_local3.type = teamConfig[_local4].type;
_local3.speed = teamConfig[_local4].speed;
playerList.push(_local3);
_local3.cacheAsBitmap = true;
com.onixus.as2._2d.DepthManager.addObject(_local3);
classes.MatchManager["team" + teamId].push(_local3);
_local3.saveState();
_local3._xscale = (_local3._yscale = 60);
_local3.miniMe = _root.miniMap.attachMovie("miniPlayer" + teamId, (("miniPlayer" + teamId) + "_") + _local4, _root.miniMap.getNextHighestDepth());
_local4++;
}
}
function selectPlayer() {
var _local4 = 9000;
var _local5;
var _local2 = 0;
while (_local2 < playerList.length) {
var _local3 = com.onixus.as2.math.MathExtensions.getDistance(playerList[_local2]._x, playerList[_local2]._y, classes.MatchManager.ball._x, classes.MatchManager.ball._y);
if ((((_local3 < _local4) && (playerList[_local2].holdCoult == 0)) && (playerList[_local2].type != "keeper")) && (playerList[_local2].type != "defender")) {
_local4 = _local3;
_local5 = _local2;
}
_local2++;
}
var _local7 = com.onixus.as2.math.MathExtensions.getDistance(selectedPlayer._x, selectedPlayer._y, classes.MatchManager.ball._x, classes.MatchManager.ball._y);
var _local8 = com.onixus.as2.math.MathExtensions.getDistance(playerList[_local5]._x, playerList[_local5]._y, classes.MatchManager.ball._x, classes.MatchManager.ball._y);
var _local6 = com.onixus.as2.math.MathExtensions.toUnit(_local7 - _local8);
if (_local6 > 30) {
selectedPlayer.setSelection(false);
playerList[_local5].setSelection(true);
}
}
function togglePlayer(player) {
trace("switch...");
var _local4 = 9000;
var _local5;
var _local2 = 0;
while (_local2 < playerList.length) {
var _local3 = com.onixus.as2.math.MathExtensions.getDistance(playerList[_local2]._x, playerList[_local2]._y, classes.MatchManager.ball._x, classes.MatchManager.ball._y);
if ((((((_local3 < _local4) && (playerList[_local2].holdCoult == 0)) && (!playerList[_local2].isSelected)) && (playerList[_local2] != player)) && (playerList[_local2].type != "keeper")) && (playerList[_local2].type != "defender")) {
_local4 = _local3;
_local5 = _local2;
}
_local2++;
}
var _local8 = com.onixus.as2.math.MathExtensions.getDistance(selectedPlayer._x, selectedPlayer._y, classes.MatchManager.ball._x, classes.MatchManager.ball._y);
var _local9 = com.onixus.as2.math.MathExtensions.getDistance(playerList[_local5]._x, playerList[_local5]._y, classes.MatchManager.ball._x, classes.MatchManager.ball._y);
var _local7 = com.onixus.as2.math.MathExtensions.toUnit(_local8 - _local9);
if (_local7 > 10) {
selectedPlayer.setSelection(false);
playerList[_local5].setSelection(true);
}
}
}
Symbol 396 MovieClip [__Packages.com.onixus.as2._2d.DepthManager] Frame 0
class com.onixus.as2._2d.DepthManager
{
function DepthManager () {
}
static function addObject(target) {
objectList.push({id:target, y:target._y});
com.onixus.as2.events.FrameGenerator.addListener(com.onixus.as2._2d.DepthManager);
}
static function removeObject(target) {
var _local2 = objectList.length;
var _local1 = 0;
while (_local1 < _local2) {
if (objectList[_local1] == target) {
objectList.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
static function onEnterFrame() {
objectList.sortOn("id");
objectList.sortOn("y", 16);
var _local2 = objectList.length;
var _local1 = 0;
while (_local1 < _local2) {
objectList[_local1].id.swapDepths(_local1);
objectList[_local1].y = objectList[_local1].id._y;
_local1++;
}
}
static var objectList = new Array();
}
Symbol 397 MovieClip [__Packages.com.onixus.as2.events.FrameGenerator] Frame 0
class com.onixus.as2.events.FrameGenerator
{
static var isFirstRun, broadCasterObj;
function FrameGenerator () {
}
static function addListener(list) {
if (isFirstRun == undefined) {
isFirstRun = false;
init();
}
broadCasterObj.addListener(list);
}
static function removeListener(list) {
broadCasterObj.removeListener(list);
}
static function kill() {
unloadMovie (broadCasterObj);
isFirstRun = true;
}
static function init() {
broadCasterObj = _root.createEmptyMovieClip("fc_8726w", -25000);
AsBroadcaster.initialize(broadCasterObj);
broadCasterObj.onEnterFrame = function () {
this.broadcastMessage("onEnterFrame");
};
}
}
Symbol 398 MovieClip [__Packages.com.onixus.as2.math.MathExtensions] Frame 0
class com.onixus.as2.math.MathExtensions
{
function MathExtensions () {
}
static function getDistance(x1, y1, x2, y2) {
var _local3 = x1 - x2;
var _local2 = y1 - y2;
var _local1 = Math.pow(_local2, 2) + Math.pow(_local3, 2);
return(Math.round(Math.sqrt(_local1)));
}
static function getAngle(x1, y1, x2, y2) {
var _local3 = x2 - x1;
var _local2 = y2 - y1;
var _local1 = 90 + (Math.atan(_local3 / _local2) / (Math.PI/180));
if (y2 > y1) {
_local1 = _local1 + 180;
}
return(_local1);
}
static function getLineAngle(x1, y1, x2, y2) {
var _local1 = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI;
return(_local1 + 90);
}
static function getPoint(x, y, angle, diagonal) {
var _local1 = (angle * Math.PI) / 180;
var _local2 = Math.sin(_local1) * diagonal;
var _local3 = Math.cos(_local1) * diagonal;
var _local4 = {x:x + _local3, y:y - _local2};
return(_local4);
}
static function getDiagonal(d) {
return(d * 0.707106781186547);
}
static function toUnit(d) {
if (d < 0) {
d = d * -1;
}
return(d);
}
}
Symbol 399 MovieClip [__Packages.classes.Cam] Frame 0
class classes.Cam
{
static var hRim, vRim;
var mcc, ball, flexy, xSpeed, ySpeed, finder;
function Cam () {
mcc = _root.stage;
ball = classes.MatchManager.ball;
flexy = 7;
xSpeed = 0;
ySpeed = 0;
hRim = 250;
vRim = 150;
finder = {up:vRim, down:400 - vRim, left:hRim, right:540 - hRim};
com.onixus.as2.events.FrameGenerator.addListener(this);
}
function onEnterFrame() {
mcc._x = xSpeed;
mcc._y = ySpeed;
if (hRim > 300) {
hRim--;
finder = {up:vRim, down:400 - vRim, left:hRim, right:540 - hRim};
}
if ((ball._x + mcc._x) > finder.right) {
xSpeed = xSpeed - (com.onixus.as2.math.MathExtensions.getDistance(ball._x + mcc._x, 0, finder.right, 0) / flexy);
}
if ((ball._x + mcc._x) < finder.left) {
xSpeed = xSpeed + (com.onixus.as2.math.MathExtensions.getDistance(ball._x + mcc._x, 0, finder.left, 0) / flexy);
}
if ((ball._y + mcc._y) < finder.up) {
ySpeed = ySpeed + (com.onixus.as2.math.MathExtensions.getDistance(ball._y + mcc._y, 0, finder.up, 0) / flexy);
}
if ((ball._y + mcc._y) > finder.down) {
ySpeed = ySpeed - (com.onixus.as2.math.MathExtensions.getDistance(ball._y + mcc._y, 0, finder.down, 0) / flexy);
}
}
}
Symbol 400 MovieClip [__Packages.classes.footbot.controller.CpuAi] Frame 0
class classes.footbot.controller.CpuAi
{
var isInit, player, teamId, ball, allyTeam, opposingTeam, moveX, moveY, DIRECTION, attackIsSet;
function CpuAi () {
}
function init(m_player) {
isInit = true;
player = m_player;
teamId = player.teamManager.teamId;
ball = classes.MatchManager.ball;
allyTeam = classes.MatchManager["team" + teamId];
if (teamId == 1) {
opposingTeam = classes.MatchManager.team2;
} else {
opposingTeam = classes.MatchManager.team1;
}
moveX = player.startX;
moveY = player.startY;
DIRECTION = player.teamManager.DIRECTION;
hold(classes.Main.at.initDelay);
}
function process() {
if (delay > 0) {
delay--;
return(undefined);
}
if (ball.owner != player) {
interceptOpponent();
attackIsSet = false;
}
if (ball.owner == player) {
runAttack();
}
}
function runAttack() {
if (!attackIsSet) {
attackIsSet = true;
moveX = (classes.MatchManager.FIELD.left + random(100)) + 20;
if (random(40) != 1) {
moveY = (player._y + random(80)) - 40;
} else {
moveY = classes.MatchManager.CENTER_Y;
}
}
if (player.type == "defender") {
player.passBall();
} else {
if ((com.onixus.as2.math.MathExtensions.getDistance(player._x, player._y, classes.MatchManager.FIELD.left, classes.MatchManager.CENTER_Y) > 250) && (random(50) == 1)) {
if (player._y < classes.MatchManager.CENTER_Y) {
move(player._x, player._y + 10);
} else {
move(player._x, player._y - 10);
}
player.passBall();
}
if (com.onixus.as2.math.MathExtensions.getDistance(player._x, player._y, classes.MatchManager.FIELD.left, classes.MatchManager.CENTER_Y) < (random(100) + 220)) {
if ((player._y < (classes.MatchManager.CENTER_Y + 30)) && (player._y > (classes.MatchManager.CENTER_Y - 30))) {
move(player._x - 10, player._y);
kickOnGoal();
} else {
if (random(classes.Main.at.triggerHappiness) == 1) {
kickOnGoal();
}
if (com.onixus.as2.math.MathExtensions.getDistance(player._x, 0, moveX, 0) < 10) {
moveX = moveX + (random(150) + 70);
}
if (com.onixus.as2.math.MathExtensions.getDistance(0, player._y, 0, moveY) < 10) {
if (player._y < classes.MatchManager.CENTER_Y) {
moveY = moveY + (random(60) - 30);
} else {
moveY = moveY + (random(60) - 30);
}
}
}
} else {
if (com.onixus.as2.math.MathExtensions.getDistance(player._x, 0, 200, 0) < 20) {
if ((com.onixus.as2.math.MathExtensions.getDistance(0, player._y, 0, classes.MatchManager.FIELD.top) < 40) && (random(10) == 1)) {
move(player._x - 10, player._y - 10);
kickOnGoal();
}
if ((com.onixus.as2.math.MathExtensions.getDistance(0, player._y, 0, classes.MatchManager.FIELD.bottom) < 40) && (random(10) == 1)) {
move(player._x - 10, player._y + 10);
kickOnGoal();
}
}
if (player._x < (classes.MatchManager.FIELD.left + 40)) {
moveY = random(10) - 5;
move(player._x - 10, moveY);
player.passBall();
}
}
var _local2 = 0;
while (_local2 < opposingTeam.length) {
if (com.onixus.as2.math.MathExtensions.getDistance(player._x, player._y, opposingTeam[_local2]._x, opposingTeam[_local2]._y) < (random(classes.Main.at.passHappiness) + classes.Main.at.passSub)) {
if (opposingTeam[_local2].holdCoult < 1) {
player.passBall();
}
}
_local2++;
}
move(moveX, moveY);
}
}
function interceptOpponent() {
moveX = ball._x;
moveY = ball._y;
move(moveX, moveY);
if (com.onixus.as2.math.MathExtensions.getDistance(player._x, player._y, ball._x, ball._y) < 40) {
if (random(classes.Main.at.tackleHappiness) == 1) {
player.tackle();
}
}
}
function kickOnGoal() {
player.kickBall();
}
function hold(duration) {
delay = duration;
}
function move(toX, toY) {
if (player.holdCoult < 1) {
if (Math.floor(com.onixus.as2.math.MathExtensions.toUnit(player._y - toY)) > 5) {
var _local5 = false;
var _local3 = false;
if (player._y < toY) {
_local5 = true;
}
if (player._y > toY) {
_local3 = true;
}
}
if (Math.floor(com.onixus.as2.math.MathExtensions.toUnit(player._x - toX)) > 5) {
var _local4 = false;
var _local2 = false;
if (player._x < toX) {
_local2 = true;
}
if (player._x > toX) {
_local4 = true;
}
}
player.move(_local3, _local5, _local4, _local2);
}
}
static var delay = 0;
static var initDelay = 25;
}
Symbol 401 MovieClip [__Packages.classes.Main] Frame 0
class classes.Main
{
static var at;
var mm;
function Main (field, p1, p2, time, team1Conf, team2Conf, f_at) {
if (f_at == undefined) {
at = new classes.footbot.AiTag();
} else {
at = f_at;
}
mm = new classes.MatchManager(this, field, p1, p2, time, team1Conf, team2Conf);
}
function kill() {
trace("kill main");
delete mm;
}
}
Symbol 402 MovieClip [__Packages.classes.footbot.AiTag] Frame 0
class classes.footbot.AiTag
{
var initDelay, triggerHappiness, pasHappiness, passSub, tackleHappiness, myKick, hisKick, hisKeeperBreakSpeed, hisKeeperRunSpeed, keeperRange, keeperHandleSpeed;
function AiTag (f_initDelay, f_triggerHappiness, f_pasHappiness, f_passSub, f_tackleHappiness, f_myKick, f_hisKick, f_hisKeeperBreakSpeed, f_hisKeeperRunSpeed, f_keeperRange, f_keeperHandleSpeed) {
if (f_initDelay != undefined) {
initDelay = f_initDelay;
} else {
initDelay = 25;
}
if (f_triggerHappiness != undefined) {
triggerHappiness = f_triggerHappiness;
} else {
triggerHappiness = 5;
}
if (f_pasHappiness != undefined) {
pasHappiness = f_pasHappiness;
} else {
pasHappiness = 90;
}
if (f_passSub != undefined) {
passSub = f_passSub;
} else {
passSub = -5;
}
if (f_tackleHappiness != undefined) {
tackleHappiness = f_tackleHappiness;
} else {
tackleHappiness = -5;
}
if (f_myKick != undefined) {
myKick = f_myKick;
} else {
myKick = 40;
}
if (f_hisKick != undefined) {
hisKick = f_hisKick;
} else {
hisKick = 40;
}
if (f_hisKeeperBreakSpeed != undefined) {
hisKeeperBreakSpeed = f_hisKeeperBreakSpeed;
} else {
hisKeeperBreakSpeed = 16;
}
if (f_hisKeeperRunSpeed != undefined) {
hisKeeperRunSpeed = f_hisKeeperRunSpeed;
} else {
hisKeeperRunSpeed = 8;
}
if (f_keeperRange != undefined) {
keeperRange = f_keeperRange;
} else {
keeperRange = 30;
}
if (f_keeperHandleSpeed != undefined) {
keeperHandleSpeed = f_keeperHandleSpeed;
} else {
keeperHandleSpeed = 50;
}
}
}
Symbol 403 MovieClip [__Packages.classes.footbot.controller.ManualInput] Frame 0
class classes.footbot.controller.ManualInput
{
static var allowKey1, allowKey2;
var player, IOScheme, kObj;
function ManualInput (target, m_IOScheme) {
player = target;
if (m_IOScheme != undefined) {
IOScheme = m_IOScheme;
} else {
IOScheme = new classes.footbot.controller.KeyConfig(38, 40, 37, 39, 90, 88);
}
allowKey1 = true;
allowKey2 = true;
com.onixus.as2.events.FrameGenerator.addListener(this);
kObj = new Object();
Key.addListener(kObj);
var target = this;
kObj.onKeyUp = function () {
if (Key.getCode() == target.IOScheme.action1) {
classes.footbot.controller.ManualInput.allowKey1 = true;
}
if (Key.getCode() == target.IOScheme.action2) {
classes.footbot.controller.ManualInput.allowKey2 = true;
}
};
}
function process() {
if (player.holdCoult < 1) {
player.move(Key.isDown(IOScheme.up), Key.isDown(IOScheme.down), Key.isDown(IOScheme.left), Key.isDown(IOScheme.right));
}
if (Key.isDown(IOScheme.action1) && (player.holdCoult < 1)) {
if (player.hasBall) {
if (allowKey1) {
player.passBall();
allowKey1 = false;
}
} else if (allowKey1) {
player.tackle();
allowKey1 = false;
}
}
if (Key.isDown(IOScheme.action2) && (player.holdCoult < 1)) {
if (player.hasBall) {
if (allowKey2) {
player.kickBall();
allowKey2 = false;
}
} else if (allowKey2) {
player.toggleSelection();
allowKey2 = false;
}
}
}
}
Symbol 404 MovieClip [__Packages.classes.footbot.controller.KeeperInput] Frame 0
class classes.footbot.controller.KeeperInput
{
var keeper, teamIO, teamId, ball, allyTeam, opposingTeam, keeperBreakSpeed, keeperRunSpeed, ySpeed, xSpeed, initSpeed, yDirOld, xDirOld;
function KeeperInput (m_player, m_teamIO) {
keeper = m_player;
teamIO = m_teamIO;
teamId = keeper.teamManager.teamId;
ball = classes.MatchManager.ball;
allyTeam = classes.MatchManager["team" + teamId];
if (teamId == 1) {
opposingTeam = classes.MatchManager.team2;
keeperBreakSpeed = 16;
keeperRunSpeed = 8;
} else {
opposingTeam = classes.MatchManager.team1;
keeperBreakSpeed = classes.Main.at.hisKeeperBreakSpeed;
keeperRunSpeed = classes.Main.at.hisKeeperRunSpeed;
}
}
function process() {
if (keeper.hasBall) {
keeper.type = "defender";
ySpeed = keeper._y * 8;
xSpeed = keeper._x * 8;
keeper.speed = initSpeed;
} else {
keeper.type = "keeper";
ySpeed = keeper._y * 8;
xSpeed = keeper._x * 8;
keeper.speed = initSpeed;
}
var _local7 = com.onixus.as2.math.MathExtensions.getDistance(keeper._x, keeper._y, ball._x, ball._y);
var _local9 = com.onixus.as2.math.MathExtensions.getDistance(keeper._x, keeper._y, keeper.startX, keeper.startY);
if (((!keeper.hasBall) && ((_local7 < 150) && (_local9 < 350))) && (ball.team != keeper.teamManager.teamId)) {
keeper.speed = keeperRunSpeed;
move(ball._x, ball._y);
keeper.speed = initSpeed;
keeper.type = "defender";
keeper.tackle();
}
if (keeper.type == "keeper") {
var _local6 = 7;
if (((keeper._x < keeper.startX) && (keeper.startX > 300)) && (keeper.holdCoult < 1)) {
var _local4 = Math.floor(com.onixus.as2.math.MathExtensions.getDistance(keeper._x, 0, keeper.startX, 0) / 5);
if (_local4 > 4) {
xSpeed = xSpeed + _local4;
}
}
if (((keeper._x > keeper.startX) && (keeper.startX < 300)) && (keeper.holdCoult < 1)) {
var _local4 = Math.floor(com.onixus.as2.math.MathExtensions.getDistance(keeper._x, 0, keeper.startX, 0) / 5);
if (_local4 > 4) {
xSpeed = xSpeed - _local4;
}
}
if ((keeper._y < (classes.MatchManager.CENTER_Y - 100)) && (keeper.holdCoult < 1)) {
var _local3 = Math.floor(com.onixus.as2.math.MathExtensions.getDistance(keeper._y, 0, classes.MatchManager.CENTER_Y, 0) / 5);
if (_local3 > 4) {
ySpeed = ySpeed + _local3;
}
}
if ((keeper._y > (classes.MatchManager.CENTER_Y + 100)) && (keeper.holdCoult < 1)) {
var _local3 = Math.floor(com.onixus.as2.math.MathExtensions.getDistance(keeper._y, 0, classes.MatchManager.CENTER_Y, 0) / 5);
if (_local3 > 4) {
ySpeed = ySpeed - _local3;
}
}
var _local8 = com.onixus.as2.math.MathExtensions.getDistance(keeper._x, keeper._y, ball._x, ball._y);
if (_local8 < classes.MatchManager.CENTER_X) {
if (keeper._y > ball._y) {
var _local5 = com.onixus.as2.math.MathExtensions.getDistance(keeper._y, 0, classes.MatchManager.CENTER_Y - 200, 0);
var _local2 = com.onixus.as2.math.MathExtensions.getDistance(keeper._x, keeper._y, ball._x, ball._y) / 5;
_local2 = Math.round(_local2);
var _local3 = Math.floor(com.onixus.as2.math.MathExtensions.getDistance(keeper._y * _local5, 0, ball._y * _local5, 0) / (_local6 * (_local2 + 16)));
if (_local3 > 16) {
ySpeed = ySpeed - _local3;
}
if (keeper.teamManager.teamId == 1) {
}
} else {
var _local5 = com.onixus.as2.math.MathExtensions.getDistance(keeper._y, 0, classes.MatchManager.CENTER_Y + 200, 0);
var _local2 = com.onixus.as2.math.MathExtensions.getDistance(keeper._x, keeper._y, ball._x, ball._y) / 5;
_local2 = Math.round(_local2);
var _local3 = Math.floor(com.onixus.as2.math.MathExtensions.getDistance(keeper._y * _local5, 0, ball._y * _local5, 0) / (_local6 * (_local2 + 16)));
if (_local3 > 16) {
ySpeed = ySpeed + _local3;
}
if (keeper.teamManager.teamId == 1) {
}
}
} else {
if (keeper._y < keeper.startY) {
if (keeper.holdCoult < 1) {
var _local3 = Math.floor(com.onixus.as2.math.MathExtensions.getDistance(keeper._y, 0, keeper.startY, 0) / 4);
if (_local3 > 4) {
ySpeed = ySpeed + _local3;
}
}
}
if (keeper._y > keeper.startY) {
if (keeper.holdCoult < 1) {
var _local3 = Math.floor(com.onixus.as2.math.MathExtensions.getDistance(keeper._y, 0, keeper.startY, 0) / 4);
if (_local3 > 4) {
ySpeed = ySpeed - _local3;
}
}
}
}
if (keeper.holdCoult < 1) {
keeper._y = Math.round(ySpeed / 8);
keeper._x = Math.round(xSpeed / 8);
keeper.highLite._x = keeper._x;
keeper.highLite._y = keeper._y;
animate(Math.round(xSpeed / 8), Math.round(ySpeed / 8));
}
}
}
function animate(xSpeed, ySpeed) {
var _local4 = false;
var _local3 = false;
if (ySpeed > (yDirOld + 0.1)) {
_local4 = true;
}
if (ySpeed < (yDirOld - 0.1)) {
_local3 = true;
}
yDirOld = ySpeed;
var _local6 = false;
var _local5 = false;
if (xSpeed > (xDirOld + 0.1)) {
_local5 = true;
}
if (xSpeed < (xDirOld - 0.1)) {
_local6 = true;
}
xDirOld = xSpeed;
var _local2 = facing;
if (_local3) {
_local2 = "u";
}
if (_local4) {
_local2 = "d";
}
if (_local6) {
_local2 = "l";
}
if (_local5) {
_local2 = "r";
}
if (_local3 && (_local5)) {
_local2 = "u-r";
}
if (_local4 && (_local5)) {
_local2 = "d-r";
}
if (_local3 && (_local6)) {
_local2 = "u-l";
}
if (_local4 && (_local6)) {
_local2 = "d-l";
}
if (com.onixus.as2.math.MathExtensions.getDistance(0, ball._y, 0, keeper._y) < 50) {
if ((!_local4) && (!_local3)) {
}
}
facing = _local2;
if (((_local3 || (_local4)) || (_local6)) || (_local5)) {
keeper.animationAdaptor(_local2, true);
} else {
keeper.animationAdaptor(facing, false);
}
}
function move(toX, toY) {
if (Math.floor(com.onixus.as2.math.MathExtensions.toUnit(keeper._y - toY)) > 5) {
var _local5 = false;
var _local3 = false;
if (keeper._y < toY) {
_local5 = true;
}
if (keeper._y > toY) {
_local3 = true;
}
}
if (Math.floor(com.onixus.as2.math.MathExtensions.toUnit(keeper._x - toX)) > 5) {
var _local4 = false;
var _local2 = false;
if (keeper._x < toX) {
_local2 = true;
}
if (keeper._x > toX) {
_local4 = true;
}
}
keeper.move(_local3, _local5, _local4, _local2);
}
var facing = "d";
}
Symbol 147 MovieClip Frame 1
p1.onRelease = function () {
};
p2.onRelease = function () {
};
credits.onRelease = function () {
};
help.onRelease = function () {
};
Symbol 147 MovieClip Frame 5
_parent.gotoAndStop(_parent._currentframe + 1);
_parent.gotoAndStop(newPage);
Symbol 147 MovieClip Frame 12
stop();
Symbol 159 MovieClip Frame 86
_root.onDoneIntro();
stop();
Symbol 163 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 11
stop();
Symbol 170 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 7
function cleanUp(id) {
unloadMovie (this.sparBox[id]);
activeBalls--;
}
var i = 0;
var activeBalls = 0;
onEnterFrame = function () {
if ((random(5) == 1) || (activeBalls > 60)) {
return(undefined);
}
i++;
this.sparBox.attachMovie("spark", "spark" + i, i, {dirX:random(10) - 5, dirY:random(10) - 5, id:"spark" + i});
this.sparBox["spark" + i].bll.gotoAndStop(random(2) + 1);
this.sparBox["spark" + i]._x = 0;
this.sparBox["spark" + i]._y = 0;
this.sparBox["spark" + i]._xscale = (this.sparBox["spark" + i]._yscale = random(20) + 1);
this.sparBox["spark" + i]._alpha = random(80) + 60;
activeBalls++;
if (i > 100) {
i = 0;
}
};
Symbol 182 MovieClip Frame 14
stop();
Symbol 197 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.mark.gotoAndStop(2);
com.onixus.as2.sound.AudioPlayer.playFX("btnPling");
};
this.onRollOut = function () {
this.mark.gotoAndStop(1);
};
Symbol 215 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 1
stop();
Symbol 237 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 1
stop();
Symbol 288 MovieClip Frame 1
lineAd_bottom.onPress = function () {
getURL ("http://www.modul-games.com/aniball/landingPage.php", "_blank");
};
lineAd_top.onPress = function () {
getURL ("http://www.modul-games.com/aniball/landingPage.php", "_blank");
};
Symbol 294 MovieClip Frame 36
_parent.gotoAndStop(1);
Symbol 295 MovieClip Frame 1
stop();
Symbol 295 MovieClip Frame 2
function buildSpark() {
if (activeBalls > 300) {
return(undefined);
}
i++;
this.sparBox.attachMovie("spark", "spark" + i, i, {dirX:random(20) - 10, dirY:random(20) - 10, id:"spark" + i});
this.sparBox["spark" + i].bll.gotoAndStop(random(2) + 1);
this.sparBox["spark" + i]._x = 0;
this.sparBox["spark" + i]._y = 0;
this.sparBox["spark" + i]._xscale = (this.sparBox["spark" + i]._yscale = random(15) + 3);
this.sparBox["spark" + i]._alpha = random(80) + 60;
activeBalls++;
if (i > 100) {
i = 0;
}
}
function cleanUp(id) {
unloadMovie (this.sparBox[id]);
activeBalls--;
}
var i = 0;
var activeBalls = 0;
onEnterFrame = function () {
buildSpark();
buildSpark();
buildSpark();
};
Symbol 299 MovieClip Frame 1
stop();
Symbol 319 MovieClip Frame 1
stop();
Symbol 349 MovieClip Frame 1
stop();
Symbol 354 MovieClip Frame 1
Symbol 354 MovieClip Frame 10
snd.onPress = function () {
nam = name_field.text;
if (((nam.length < 1) || (nam == "enter your name here")) || (nam == "you need to set a name!")) {
name_field.text = "you need to set a name!";
} else {
gotoAndStop ("sendNow");
}
};
can.onPress = function () {
gotoAndPlay ("rollOut");
};
stop();
Symbol 354 MovieClip Frame 11
function gotoAndP1ay(seS) {
v1 = random(6) + 2;
v2 = random(9);
v3 = random(9);
v4 = random(5);
v5 = random(9);
v6 = random(9);
v7 = random(4);
return(((((((((((((((((((((((v1 + "") + v2) + "") + 3) + "") + "") + v3) + "") + v4) + "") + (score * se5)) + "") + v5) + "") + v6) + "") + 8) + "") + v1) + "") + v2) + "") + v7);
}
playerName = nam;
if (_root.scoreCount_ == undefined) {
_root.scoreCount_ = 0;
}
score = _root.scoreCount_;
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
var send_lv = new LoadVars();
var send_sc = new LoadVars();
send_lv.onLoad = function (success) {
if (success) {
if (send_lv.erro == 1) {
trace("Please go to modul-games to use the highScore");
gotoAndStop ("erro");
err_txt.text = "part 1 - onLoad";
return(undefined);
}
trace("server url : " + send_lv.purl);
trace("server ses1: " + send_lv.ses1);
trace("server ses2: " + send_lv.ses2);
trace("server erro: " + send_lv.erro);
seS = send_lv.ses2;
trace("server ip: " + send_lv.ip);
trace("server cf: " + send_lv.cf);
trace("server ur: " + send_lv.ur);
se5 = send_lv.ses1;
var _local1 = gotoAndP1ay(seS);
trace((("encoded : " + _local1) + " - ") + typeof(_local1));
send_sc.scc = _local1;
send_sc.name = playerName;
send_sc.sendAndLoad(send_lv.purl, send_sc, "POST");
} else {
gotoAndStop ("erro");
err_txt.text = "part 1 - connection";
trace("Error connecting to server.");
}
};
send_sc.onLoad = function (success) {
if (success) {
trace("server score : " + send_sc.scc);
trace("modivied score : " + send_sc.ns1);
trace("modivied score : " + send_sc.ns2);
trace("modivied score : " + send_sc.sce);
trace("modivied name : " + send_sc.name);
trace("server erro: " + send_sc.erro);
_root.submit_score.enabled = false;
_root.submit_score._visible = false;
gotoAndStop ("seeScore");
} else {
gotoAndStop ("erro");
err_txt.text = "part 2 - onLoad";
}
};
send_lv.cf = "151";
send_lv.dm = "modul-games.com";
send_lv.sendAndLoad("http://www.modul-games.com/aniball/score/index.php", send_lv, "POST");
Symbol 354 MovieClip Frame 12
error_re.onPress = function () {
getURL ("http://www.modul-games.com/aniball/landingPage.php", "_blank");
};
can.onPress = function () {
gotoAndPlay ("rollOut");
};
Symbol 354 MovieClip Frame 13
can.onPress = function () {
gotoAndPlay ("rollOut");
};
vs.onPress = function () {
getURL ("http://www.modul-games.com/aniball/score/scores.php", "_blank");
gotoAndPlay ("rollOut");
};
Symbol 354 MovieClip Frame 24
_root.mainMen.enabled = true;
_root.startGame.enabled = true;
_root.unlockClip.enabled = true;
_root.submit_score.enabled = true;
gotoAndStop (1);
Symbol 364 MovieClip Frame 1
function initScrollBar() {
totalArea = parentContainer._height;
var _local3 = viewArea / (totalArea / 100);
var _local2 = (this._height / 100) * _local3;
if (totalArea > viewArea) {
this._visible = true;
allowScroll = true;
slider.slide_bar._height = _local2;
} else {
this._visible = false;
allowScroll = false;
slider._y = 0;
}
}
function reset() {
trace("reset");
slider._y = 0;
}
function scrollPos(cpos) {
pos = cpos;
var _local1 = Number(parentContainer._height);
posX = (pos * (_local1 - viewArea)) / 100;
parentContainer._y = (posX * -1) + offset;
}
var slice = false;
var speed = 0;
var allowScroll = false;
this._visible = false;
scrollPos(0);
var parentContainer = _root.archive.stripContainer;
var viewArea = 248;
var offset = parentContainer._y;
this.onPress = function () {
tpdiv = (slider._y + ((slider._height - 12) / 2)) - _ymouse;
slide = true;
};
this.onRelease = function () {
slide = false;
};
this.onReleaseOutside = function () {
slide = false;
};
var h = this._height;
onEnterFrame = function () {
initScrollBar();
if (slide) {
if (((_ymouse - (slider.slide_bar._height / 2)) + tpdiv) < 0) {
slider._y = 0;
} else if (((_ymouse + (slider.slide_bar._height / 2)) + tpdiv) > h) {
slider._y = h - slider.slide_bar._height;
} else {
speed = (_ymouse - ((slider._y - tpdiv) + (slider.slide_bar._height / 2))) / 2;
slider._y = slider._y + speed;
}
} else {
if (speed > 30) {
speed = speed / 2;
}
if ((speed < 0.5) && (speed > -0.5)) {
speed = 0;
}
speed = speed / 1.35;
slider._y = slider._y + speed;
if (slider._y <= 0) {
speed = 0;
slider._y = 0;
} else if ((slider._y + slider.slide_bar._height) >= h) {
speed = 0;
slider._y = h - slider.slide_bar._height;
}
}
scrollPos(((slider._y / (h - slider.slide_bar._height)) * 100) - 0);
};
var mouseListener = new Object();
mouseListener.onMouseWheel = function (t) {
if (allowScroll) {
slider._y = slider._y - (t * 5);
}
};
Mouse.addListener(mouseListener);
var pos;
Symbol 366 MovieClip Frame 1
stop();