Frame 1
b1 = _root.getBytesLoaded();
b2 = _root.getBytesTotal();
tgPrel = 1 + Math.round((b1 * 100) / b2);
prel.gotoAndStop(tgPrel);
if (b1 >= b2) {
gotoAndPlay ("intro");
}
Frame 4
if (Math.round(b1 / 1024) <= 35) {
gotoAndPlay ("loop1");
}
Frame 5
b1 = _root.getBytesLoaded();
b2 = _root.getBytesTotal();
tgPrel = 1 + Math.round((b1 * 100) / b2);
tg = tgprel - 1;
if (tg <= 9) {
procent = "0" + tg;
} else {
procent = tg;
}
prel.gotoAndStop(tgPrel);
Frame 9
if (Math.round(b1 / 1024) <= 325) {
gotoAndPlay ("loop2");
}
Frame 11
b1 = _root.getBytesLoaded();
b2 = _root.getBytesTotal();
tgPrel = 1 + Math.round((b1 * 100) / b2);
tg = tgprel - 2;
if (tgprel <= 9) {
procent = "0" + tg;
} else {
procent = tg;
}
prel.gotoAndStop(tgPrel);
Frame 14
if (b1 < b2) {
gotoAndPlay ("loop3");
}
Frame 15
procent = "--";
prel.gotoAndStop(100);
Frame 136
play();
Frame 137
player1 = "p";
player2 = "c";
Frame 140
play();
Frame 153
stop();
Frame 154
play();
Frame 176
desc = Array();
desc = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
pl1 = Array();
pl1 = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
pl2 = Array();
pl2 = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
y = 0;
while (y < 6) {
x = 0;
while (x < 7) {
name = eval ((("_root.ball0" + (y + 1)) + "0") + (x + 1));
if (desc[y][x] == 0) {
name.gotoAndPlay("Empty");
}
if (desc[y][x] == 1) {
name.gotoAndPlay("RedBall");
}
if (desc[y][x] == 2) {
name.gotoAndPlay("GreenBall");
}
x++;
}
y++;
}
Instance of Symbol 138 MovieClip "HandCursor" in Frame 177
onClipEvent (load) {
mode = "0";
curcolumn = 0;
this._x = 35;
automode = false;
ret = Array();
pl1 = Array();
pl2 = Array();
higher = Array();
}
onClipEvent (enterFrame) {
function GetMass() {
var x;
var y;
var n;
var m;
var name;
var nmass;
var massh;
var massv;
var massd;
var massd1;
var massd2;
var mass;
pl1 = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
pl2 = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
pmode = 1;
x = 0;
while (x <= 6) {
ret = MovePossible(x, pmode);
y = ret[0];
if (y >= 0) {
mass = ret[1];
pl1[y][x] = mass;
massh = HorSliding(y, x, pmode, mass);
massv = VertSliding(y, x, pmode, mass);
massd1 = DiagSliding1(y, x, pmode, mass);
massd2 = DiagSliding2(y, x, pmode, mass);
if (massh >= massv) {
mass = massh;
} else {
mass = massv;
}
if (massd1 >= massd2) {
massd = massd1;
} else {
massd = massd2;
}
if (mass < massd) {
mass = massd;
}
pl1[y][x] = mass;
}
x++;
}
pmode = 2;
x = 0;
while (x <= 6) {
ret = MovePossible(x, pmode);
y = ret[0];
if (y >= 0) {
mass = ret[1];
pl2[y][x] = mass;
massh = HorSliding(y, x, pmode, mass);
massv = VertSliding(y, x, pmode, mass);
massd1 = DiagSliding1(y, x, pmode, mass);
massd2 = DiagSliding2(y, x, pmode, mass);
if (massh >= massv) {
mass = massh;
} else {
mass = massv;
}
if (massd1 >= massd2) {
massd = massd1;
} else {
massd = massd2;
}
if (mass < massd) {
mass = massd;
}
pl2[y][x] = mass;
}
x++;
}
y = 0;
while (y <= 5) {
x = 0;
while (x <= 6) {
name = eval ((("_root.ball0" + (y + 1)) + "0") + (x + 1));
name.red = pl1[y][x];
x++;
}
y++;
}
y = 0;
while (y <= 5) {
x = 0;
while (x <= 6) {
name = eval ((("_root.ball0" + (y + 1)) + "0") + (x + 1));
name.green = pl2[y][x];
x++;
}
y++;
}
}
function GetHigher() {
var m1x;
var m1val;
var m2x;
var m2val;
var _local2;
var _local1;
var tmass1 = Array();
var _local3 = Array();
m1val = 0;
m1x = -1;
_local2 = 0;
while (_local2 <= 5) {
_local1 = 0;
while (_local1 <= 6) {
if (pl1[_local2][_local1] == m1val) {
tmass1.push(_local1);
}
if (pl1[_local2][_local1] > m1val) {
tmass1 = [];
tmass1.push(_local1);
m1val = pl1[_local2][_local1];
m1x = _local1;
}
_local1++;
}
_local2++;
}
m2val = 0;
m2x = -1;
_local2 = 0;
while (_local2 <= 5) {
_local1 = 0;
while (_local1 <= 6) {
if (pl2[_local2][_local1] == m2val) {
_local3.push(_local1);
}
if (pl2[_local2][_local1] > m2val) {
_local3 = [];
_local3.push(_local1);
m2val = pl2[_local2][_local1];
m2x = _local1;
}
_local1++;
}
_local2++;
}
m1x = tmass1[Math.floor(tmass1.length * Math.random(1))];
m2x = _local3[Math.floor(_local3.length * Math.random(1))];
higher = [m1x, m1val, m2x, m2val];
return(higher);
}
function MovePossible(x, mode) {
var x;
var _local1;
var _local2;
var _local3;
var mode;
var ret = Array();
_local2 = false;
_local3 = 0;
_local1 = 0;
while (_local1 < 6) {
if (_root.desc[_local1][x] == 0) {
_local3 = 1;
_local2 = true;
break;
}
_local1++;
}
if (_local2 == true) {
ret = [_local1, _local3];
return(ret);
}
return([-1, -1]);
}
function HorSliding(y, x, mode, mass) {
var _local2 = y;
var _local3 = _root;
var x;
var mass;
var mode;
var _local1;
var ex;
var tx;
var tsuc;
var tmass;
var nmass;
var lmass;
var rmass;
lmass = mass;
_local1 = x - 1;
while (_local1 >= (x - 3)) {
if (_local1 >= 0) {
if ((_local3.desc[_local2][_local1] != mode) or (_local3.desc[_local2][_local1] == 0)) {
break;
}
if (_local3.desc[_local2][_local1] == mode) {
lmass++;
}
}
_local1--;
}
rmass = mass;
_local1 = x + 1;
while (_local1 <= (x + 3)) {
if (_local1 <= 6) {
if ((_local3.desc[_local2][_local1] != mode) or (_local3.desc[_local2][_local1] == 0)) {
break;
}
if (_local3.desc[_local2][_local1] == mode) {
rmass++;
}
}
_local1++;
}
nmass = (lmass + rmass) - mass;
return(nmass);
}
function DiagSliding1(y, x, mode, mass) {
var _local3 = _root;
var x;
var y;
var mass;
var mode;
var _local1;
var ex;
var tx;
var tsuc;
var tmass;
var nmass;
var lmass;
var rmass;
var _local2;
lmass = mass;
_local2 = y - 1;
_local1 = x - 1;
while (_local1 >= (x - 3)) {
if ((_local1 >= 0) and (_local2 >= 0)) {
if ((_local3.desc[_local2][_local1] != mode) or (_local3.desc[_local2][_local1] == 0)) {
break;
}
if (_local3.desc[_local2][_local1] == mode) {
lmass++;
}
}
_local2--;
_local1--;
}
rmass = mass;
_local2 = y + 1;
_local1 = x + 1;
while (_local1 <= (x + 3)) {
if ((_local1 <= 6) and (_local2 <= 5)) {
if ((_local3.desc[_local2][_local1] != mode) or (_local3.desc[_local2][_local1] == 0)) {
break;
}
if (_local3.desc[_local2][_local1] == mode) {
rmass++;
}
}
_local2++;
_local1++;
}
nmass = (lmass + rmass) - mass;
return(nmass);
}
function DiagSliding2(y, x, mode, mass) {
var _local3 = _root;
var x;
var y;
var mass;
var mode;
var _local1;
var ex;
var tx;
var tsuc;
var tmass;
var nmass;
var lmass;
var rmass;
var _local2;
lmass = mass;
_local2 = y + 1;
_local1 = x - 1;
while (_local1 >= (x - 3)) {
if ((_local1 >= 0) and (_local2 <= 5)) {
if ((_local3.desc[_local2][_local1] != mode) or (_local3.desc[_local2][_local1] == 0)) {
break;
}
if (_local3.desc[_local2][_local1] == mode) {
lmass++;
}
}
_local2++;
_local1--;
}
rmass = mass;
_local2 = y - 1;
_local1 = x + 1;
while (_local1 <= (x + 3)) {
if ((_local1 <= 6) and (_local2 >= 0)) {
if ((_local3.desc[_local2][_local1] != mode) or (_local3.desc[_local2][_local1] == 0)) {
break;
}
if (_local3.desc[_local2][_local1] == mode) {
rmass++;
}
}
_local2--;
_local1++;
}
nmass = (lmass + rmass) - mass;
return(nmass);
}
function HorSlidingOld(y, x, mode, mass) {
var _local3 = y;
var x;
var mass;
var mode;
var _local2;
var ex;
var _local1;
var tsuc;
var tmass;
var nmass;
nmass = mass;
_local2 = x - 3;
while (_local2 <= x) {
ex = _local2 + 3;
if ((_local2 >= 0) and (ex <= 6)) {
tbad = false;
tmass = mass;
_local1 = _local2;
while (_local1 <= ex) {
if ((_root.desc[_local3][_local1] != mode) and (_root.desc[_local3][_local1] != 0)) {
tbad = true;
}
if (_root.desc[_local3][_local1] == mode) {
tmass++;
}
_local1++;
}
if (tbad == false) {
nmass = tmass;
}
}
if (nmass > mass) {
mass = nmass;
}
_local2++;
}
return(mass);
}
function VertSliding(y, x, mode, mass) {
var _local2 = x;
var _local3 = _root;
var y;
var mass;
var mode;
var _local1;
var tmass;
var tbad;
tbad = false;
tmass = mass;
_local1 = y;
while (_local1 >= (y - 3)) {
if (_local1 >= 0) {
if ((_local3.desc[_local1][_local2] != mode) and (_local3.desc[_local1][_local2] != 0)) {
if (_local1 >= 2) {
tmass = mass;
}
break;
}
if (_local3.desc[_local1][_local2] == mode) {
tmass++;
}
} else {
break;
}
_local1--;
}
return(tmass);
}
function CheckIt(y, x) {
var y;
var x;
var mode;
mode = _root.desc[y][x];
fxsuc = false;
fx = 0;
while (fx <= 6) {
if (_root.desc[5][fx] == 0) {
fxsuc = true;
}
fx++;
}
if (fxsuc == false) {
_root.winner = mode;
_root.gotoAndPlay("Win");
}
sx = x;
while (sx >= 0) {
if (_root.desc[y][sx] != mode) {
sx++;
break;
}
sx--;
}
if (sx < 0) {
sx = 0;
}
ex = x;
while (ex < 7) {
if (_root.desc[y][ex] != mode) {
ex--;
break;
}
ex++;
}
if (ex > 6) {
ex = 6;
}
if ((ex - sx) >= 3) {
x = sx;
while (x <= ex) {
name = eval ((("_root.ball0" + (y + 1)) + "0") + (x + 1));
if (_root.desc[y][x] == 1) {
name.gotoAndPlay("RedFlash");
}
if (_root.desc[y][x] == 2) {
name.gotoAndPlay("GreenFlash");
}
x++;
}
return(1);
}
sy = y;
while (sy >= 0) {
if (_root.desc[sy][x] != mode) {
sy++;
break;
}
sy--;
}
if (sy < 0) {
sy = 0;
}
ey = y;
while (ey < 6) {
if (_root.desc[ey][x] != mode) {
ey--;
break;
}
ey++;
}
if (ey > 5) {
ey = 5;
}
if ((ey - sy) >= 3) {
y = sy;
while (y <= ey) {
name = eval ((("_root.ball0" + (y + 1)) + "0") + (x + 1));
if (_root.desc[y][x] == 1) {
name.gotoAndPlay("RedFlash");
}
if (_root.desc[y][x] == 2) {
name.gotoAndPlay("GreenFlash");
}
y++;
}
return(1);
}
sy = y;
sx = x;
while (sx >= 0) {
if (_root.desc[sy][sx] != mode) {
sx++;
sy++;
break;
}
sy--;
sx--;
}
if (sx < 0) {
sx = 0;
sy++;
}
ey = y;
ex = x;
while (ex < 7) {
if (_root.desc[ey][ex] != mode) {
ex--;
ey--;
break;
}
ey++;
ex++;
}
if (ex > 6) {
ex = 6;
ey--;
}
if ((ex - sx) >= 3) {
y = sy;
x = sx;
while (x <= ex) {
name = eval ((("_root.ball0" + (sy + 1)) + "0") + (x + 1));
if (_root.desc[sy][x] == 1) {
name.gotoAndPlay("RedFlash");
}
if (_root.desc[sy][x] == 2) {
name.gotoAndPlay("GreenFlash");
}
sy++;
x++;
}
return(1);
}
sy = y;
sx = x;
while (sx >= 0) {
if (_root.desc[sy][sx] != mode) {
sx++;
sy--;
break;
}
sy++;
sx--;
}
if (sx < 0) {
sx = 0;
sy--;
}
ey = y;
ex = x;
while (ex < 7) {
if (_root.desc[ey][ex] != mode) {
ex--;
ey++;
break;
}
ey--;
ex++;
}
if (ex > 6) {
ex = 6;
ey++;
}
if ((ex - sx) >= 3) {
y = sy;
x = sx;
while (x <= ex) {
name = eval ((("_root.ball0" + (sy + 1)) + "0") + (x + 1));
if (_root.desc[sy][x] == 1) {
name.gotoAndPlay("RedFlash");
}
if (_root.desc[sy][x] == 2) {
name.gotoAndPlay("GreenFlash");
}
sy--;
x++;
}
return(1);
}
return(0);
}
function DropBall() {
var x;
var y;
var success;
x = _root.handover - 1;
success = false;
y = 0;
while (y < 6) {
if (_root.desc[y][x] == 0) {
_root.desc[y][x] = mode * 1;
name = eval ((("_root.ball0" + (y + 1)) + "0") + (x + 1));
if ((mode == "1") and (_root.player1 == "p")) {
name.gotoAndPlay("RedBall");
}
if ((mode == "2") and (_root.player2 == "p")) {
name.gotoAndPlay("GreenBall");
}
success = true;
break;
}
y++;
}
if (success == true) {
if ((mode == "1") and (_root.player1 == "p")) {
_root.gotoAndPlay("Green");
}
if ((mode == "2") and (_root.player2 == "p")) {
_root.gotoAndPlay("Red");
}
if (CheckIt(y, x) == 1) {
_root.winner = mode;
_root.gotoAndPlay("Win");
}
return(1);
}
return(0);
}
switch (mode) {
case "0" :
this.gotoAndPlay("Hide");
break;
case "1" :
this.gotoAndPlay("Red");
break;
case "2" :
this.gotoAndPlay("Green");
}
if ((_root.handover > 0) and (_root.handover != curcolumn)) {
this._x = _root.handover_x - ((_root.handover_x - this._x) / 1.5);
}
if (((mode == "1") and (_root.player1 == "c")) and (automode == false)) {
automode = true;
autom = "think";
thinkmode = 2;
}
if (((mode == "2") and (_root.player2 == "c")) and (automode == false)) {
automode = true;
autom = "think";
thinkmode = 2;
}
if (automode == true) {
switch (autom) {
case "think" :
if (thinkmode == 1) {
rm = Math.floor(6.8 * Math.random(1)) + 1;
_root.handover = rm;
if (DropBall() == 1) {
autom = "wait";
wt = 1;
_root.handover_x = eval ("_root.column0" + rm)._x;
}
} else {
higher = GetHigher();
if (mode == "1") {
if (higher[1] >= higher[3]) {
rx = higher[0];
} else {
rx = higher[2];
}
}
if (mode == "2") {
if (higher[3] >= higher[1]) {
rx = higher[2];
} else {
rx = higher[0];
}
}
if (mode == "1") {
rm = rx + 1;
_root.handover = rm;
}
if (mode == "2") {
rm = rx + 1;
_root.handover = rm;
}
if (DropBall() == 1) {
autom = "wait";
wt = 1;
_root.handover_x = eval ("_root.column0" + rm)._x;
}
}
break;
case "wait" :
if (wt < 12) {
wt++;
} else {
autom = "dropball";
}
break;
case "dropball" :
if ((mode == "1") and (_root.player1 == "c")) {
name.gotoAndPlay("RedBall");
}
if ((mode == "2") and (_root.player2 == "c")) {
name.gotoAndPlay("GreenBall");
}
if (mode == "1") {
_root.gotoAndPlay("Green");
}
if (mode == "2") {
_root.gotoAndPlay("Red");
}
automode = false;
}
}
}
Frame 182
_root.HandCursor.mode = "1";
_root.HandCursor.GetMass();
Instance of Symbol 141 MovieClip in Frame 182
onClipEvent (load) {
if (_root.player2 == "c") {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Frame 187
stop();
Frame 191
_root.HandCursor.mode = "2";
_root.HandCursor.GetMass();
Instance of Symbol 144 MovieClip in Frame 191
onClipEvent (load) {
if (_root.player2 == "c") {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Frame 197
stop();
Frame 200
play();
Instance of Symbol 152 MovieClip "WinM" in Frame 225
onClipEvent (load) {
if (_root.winner == 1) {
this.gotoAndPlay("P1");
}
if (_root.winner == 2) {
this.gotoAndPlay("P2");
}
}
Frame 240
stop();
Symbol 3 Button
on (release) {
getURL ("http://www.FreeOnlineGames.com?004", "_blank");
}
Symbol 7 MovieClip Frame 1
stop();
Symbol 18 MovieClip Frame 1
stop();
Symbol 31 MovieClip Frame 50
stop();
_parent.play();
Symbol 72 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 28
gotoAndPlay ("loop");
Symbol 79 Button
on (release) {
getURL ("http://www.freeonlinegames.com?004", "_blank");
}
Symbol 84 Button
on (release) {
getURL ("http://www.freeonlinegames.com?004", "_blank");
}
Symbol 87 Button
on (release) {
getURL ("http://www.freegamesforyourwebsite.com?004", "_blank");
}
Symbol 90 Button
on (release) {
getURL ("http://freeonlinegames.com/downloads/connect4.exe", "_blank");
}
Symbol 94 Button
on (release) {
checkit.gotoAndStop("1");
_root.player1 = "p";
_root.player2 = "c";
}
Symbol 95 Button
on (release) {
checkit.gotoAndStop("2");
_root.player1 = "p";
_root.player2 = "p";
}
Symbol 104 MovieClip Frame 1
stop();
Symbol 104 MovieClip Frame 2
stop();
Instance of Symbol 104 MovieClip "checkit" in Symbol 105 MovieClip Frame 1
onClipEvent (load) {
if (_root.player2 == "c") {
this.gotoAndStop("1");
} else {
this.gotoAndStop("2");
}
}
Symbol 110 Button
on (release) {
_root.play();
}
Symbol 114 Button
on (release) {
gotoAndPlay ("Start");
}
Symbol 119 Button
on (release) {
gotoAndPlay ("Menu");
}
Symbol 129 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 10
play();
Symbol 129 MovieClip Frame 29
stop();
Symbol 129 MovieClip Frame 30
play();
Symbol 129 MovieClip Frame 48
stop();
Symbol 129 MovieClip Frame 49
play();
Symbol 129 MovieClip Frame 58
stop();
Symbol 129 MovieClip Frame 59
play();
Symbol 129 MovieClip Frame 68
stop();
Symbol 131 Button
on (rollOver) {
n = this + "";
n = n.substr(-1, 1);
_root.handover = n;
_root.handover_x = this._x;
}
on (release) {
if ((_root.HandCursor.mode == "1") and (_root.player1 == "p")) {
n = this + "";
n = n.substr(-1, 1);
_root.handover = n;
_root.handover_x = this._x;
_root.HandCursor.DropBall();
}
if ((_root.HandCursor.mode == "2") and (_root.player2 == "p")) {
n = this + "";
n = n.substr(-1, 1);
_root.handover = n;
_root.handover_x = this._x;
_root.HandCursor.DropBall();
}
}
Symbol 138 MovieClip Frame 9
stop();
Symbol 138 MovieClip Frame 18
stop();
Symbol 138 MovieClip Frame 28
stop();
Symbol 141 MovieClip Frame 1
stop();
Symbol 141 MovieClip Frame 2
stop();
Symbol 144 MovieClip Frame 1
stop();
Symbol 144 MovieClip Frame 2
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 2
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 2
stop();
Symbol 152 MovieClip Frame 1
stop();
Symbol 152 MovieClip Frame 2
play();
Instance of Symbol 148 MovieClip "text2m" in Symbol 152 MovieClip Frame 2
onClipEvent (load) {
if (_root.player2 == "c") {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Symbol 152 MovieClip Frame 22
gotoAndPlay ("P1");
Symbol 152 MovieClip Frame 23
play();
Instance of Symbol 151 MovieClip "text2ma" in Symbol 152 MovieClip Frame 23
onClipEvent (load) {
if (_root.player2 == "c") {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
}
Symbol 152 MovieClip Frame 44
gotoAndPlay ("P2");