Frame 1
stop();
Stage.showMenu = false;
this.onEnterFrame = function () {
sofar = this.getBytesLoaded();
total = this.getBytesTotal();
if (sofar == total) {
delete this.onEnterFrame;
nextFrame();
}
};
Frame 2
stop();
blinkClip = function () {
this.i = this.i + 0.125;
this.i = this.i % 1;
this._visible = Math.round(this.i);
};
compPlay_btn.onRollOver = function () {
dot1_mc.i = 0;
dot1_mc.onEnterFrame = blinkClip;
};
compPlay_btn.onRollOut = (compPlay_btn.onDragOut = function () {
dot1_mc._visible = true;
delete dot1_mc.onEnterFrame;
});
compPlay_btn.onRelease = function () {
twoPlayer = false;
play();
};
twoPlay_btn.onRollOver = function () {
dot2_mc.i = 0;
dot2_mc.onEnterFrame = blinkClip;
};
twoPlay_btn.onRollOut = (twoPlay_btn.onDragOut = function () {
dot2_mc._visible = true;
delete dot2_mc.onEnterFrame;
});
twoPlay_btn.onRelease = function () {
twoPlayer = true;
play();
};
neave_btn.onRollOver = function () {
neave_mc.i = 0;
neave_mc.onEnterFrame = blinkClip;
};
neave_btn.onRollOut = (neave_btn.onDragOut = function () {
neave_mc._visible = true;
delete neave_mc.onEnterFrame;
});
neave_btn.onRelease = function () {
getURL ("http://www.neave.com/games/", "_blank");
};
Frame 3
wins = (losses = (ties = 0));
swapTurn = twoPlayer;
title_btn.onRollOver = function () {
title_mc.i = 0;
title_mc.onEnterFrame = blinkClip;
};
title_btn.onRollOut = (title_btn.onDragOut = function () {
title_mc._visible = true;
delete title_mc.onEnterFrame;
});
title_btn.onRelease = function () {
gotoAndStop (1);
};
checkSquare = function () {
if ((square == 0) && (a == 0)) {
ok = true;
a = turn + 1;
}
if ((square == 1) && (b == 0)) {
ok = true;
b = turn + 1;
}
if ((square == 2) && (c == 0)) {
ok = true;
c = turn + 1;
}
if ((square == 3) && (d == 0)) {
ok = true;
d = turn + 1;
}
if ((square == 4) && (e == 0)) {
ok = true;
e = turn + 1;
}
if ((square == 5) && (f == 0)) {
ok = true;
f = turn + 1;
}
if ((square == 6) && (g == 0)) {
ok = true;
g = turn + 1;
}
if ((square == 7) && (h == 0)) {
ok = true;
h = turn + 1;
}
if ((square == 8) && (i == 0)) {
ok = true;
i = turn + 1;
}
};
findRow = function (x) {
if (a == x) {
if ((b == x) && (c == x)) {
row = x;
strike = 1;
}
if ((d == x) && (g == x)) {
row = x;
strike = 4;
}
if ((e == x) && (i == x)) {
row = x;
strike = 7;
}
}
if (((b == x) && (e == x)) && (h == x)) {
row = x;
strike = 5;
}
if (c == x) {
if ((f == x) && (i == x)) {
row = x;
strike = 6;
}
if ((e == x) && (g == x)) {
row = x;
strike = 8;
}
}
if (((d == x) && (e == x)) && (f == x)) {
row = x;
strike = 2;
}
if (((g == x) && (h == x)) && (i == x)) {
row = x;
strike = 3;
}
};
checkGame = function () {
findRow(1);
findRow(2);
if ((((((((((row == 0) && (a)) && (b)) && (c)) && (d)) && (e)) && (f)) && (g)) && (h)) && (i)) {
row = 3;
ties++;
}
if (row == 1) {
if (twoPlayer) {
losses++;
} else {
wins++;
}
}
if (row == 2) {
if (twoPlayer) {
wins++;
} else {
losses++;
}
}
if (row) {
gotoAndPlay (7);
}
};
playerChoice = function (n) {
if (row == 0) {
if (twoPlayer) {
square = n;
ok = false;
checkSquare();
if (turn == 0) {
turn = 1;
if (ok) {
_root[("choice" + square) + "_mc"].gotoAndPlay("nought");
}
} else {
turn = 0;
if (ok) {
_root[("choice" + square) + "_mc"].gotoAndPlay("cross");
}
}
checkGame();
} else {
square = n;
turn = 0;
ok = false;
checkSquare();
if (ok) {
_root[("choice" + square) + "_mc"].gotoAndPlay("cross");
}
checkGame();
if (ok && (row == 0)) {
compChoice();
}
}
}
};
findGap = function (x) {
if ((!a) && (((((b == x) && (c == x)) || ((d == x) && (g == x))) || (e == x)) || (i == x))) {
square = 0;
}
if ((!b) && (((a == x) && (c == x)) || ((e == x) && (h == x)))) {
square = 1;
}
if ((!c) && ((((a == x) && (b == x)) || ((f == x) && (i == x))) || ((e == x) && (g == x)))) {
square = 2;
}
if ((!d) && (((a == x) && (g == x)) || ((e == x) && (f == x)))) {
square = 3;
}
if ((!e) && (((((a == x) && (i == x)) || ((b == x) && (h == x))) || ((c == x) && (g == x))) || ((d == x) && (f == x)))) {
square = 4;
}
if ((!f) && (((e == x) && (d == x)) || ((c == x) && (i == x)))) {
square = 5;
}
if ((!g) && ((((a == x) && (d == x)) || ((c == x) && (e == x))) || ((h == x) && (i == x)))) {
square = 6;
}
if ((!h) && (((b == x) && (e == x)) || ((g == x) && (i == x)))) {
square = 7;
}
if ((!i) && ((((a == x) && (e == x)) || ((c == x) && (f == x))) || ((g == x) && (h == x)))) {
square = 8;
}
};
compChoice = function () {
ok = false;
turn = 1;
findGap(2);
findGap(1);
checkSquare();
while (!ok) {
square = int(Math.random() * 9);
checkSquare();
}
_root[("choice" + square) + "_mc"].gotoAndPlay("nought");
checkGame();
};
Frame 5
swapTurn = !swapTurn;
a = (b = (c = (d = (e = (f = (g = (h = (i = (x = (row = (strike = (turn = 0))))))))))));
ok = false;
Frame 6
stop();
if (swapTurn) {
if (twoPlayer) {
if (turn == 0) {
turn = 1;
} else {
turn = 0;
}
} else {
compChoice();
}
}
Instance of Symbol 35 MovieClip "Grid" in Frame 15
onClipEvent (load) {
_visible = _root.strike;
}
Frame 16
if (strike) {
sound_mc.gotoAndPlay("end");
} else {
sound_mc.gotoAndPlay("tie");
}
Instance of Symbol 35 MovieClip "Grid" in Frame 21
onClipEvent (load) {
_visible = _root.strike;
}
Frame 24
stop();
gameOver_btn.onPress = function () {
gotoAndPlay (4);
};
Symbol 21 MovieClip Frame 1
if (_root.twoPlayer) {
gotoAndStop (2);
} else {
stop();
}
Symbol 24 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 3
stop();
Symbol 24 MovieClip Frame 5
stop();
Symbol 34 MovieClip Frame 1
stop();
num = Number(substring(_name, 7, 1));
if (_root.twoPlayer) {
this.onRollOver = function () {
if (_root.row == 0) {
if (_root.turn == 0) {
nought_mc._visible = true;
cross_mc._visible = false;
} else {
nought_mc._visible = false;
cross_mc._visible = true;
}
}
};
this.onRollOut = (this.onDragOut = function () {
nought_mc._visible = (cross_mc._visible = false);
});
}
this.onPress = function () {
_root.playerChoice(num);
};
Instance of Symbol 25 MovieClip "cross_mc" in Symbol 34 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 27 MovieClip "nought_mc" in Symbol 34 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 34 MovieClip Frame 2
delete this.onPress;
if (_root.twoPlayer) {
gotoAndPlay (9);
}
Symbol 34 MovieClip Frame 14
stop();
Symbol 34 MovieClip Frame 15
delete this.onPress;
Symbol 34 MovieClip Frame 19
stop();
Symbol 36 MovieClip Frame 1
gotoAndStop(_root.strike + 2);