Frame 1
funcHITBOX = function (arEvent, arAction) {
lString = ((("javascript: _hbLink ('/flash/" + arEvent.toLowerCase()) + "/") + arAction.toLowerCase()) + "','left','0,0,0,0')";
trace(lString);
getURL (lString);
};
Frame 94
stop();
Frame 95
stop();
Frame 96
function rate() {
var _local1 = _root;
_local1.genre = "puzzle";
_local1.promo = 0;
_local1.name = "GridLock";
_local1.borderX = 900;
_local1.borderY = 600;
_local1.loadMovie("/general/game/rating.swf", "get");
}
Instance of Symbol 51 MovieClip "actions" in Frame 96
onClipEvent (load) {
_root.startTime = getTimer() / 1000;
}
onClipEvent (enterFrame) {
if (_root.frame.moves._currentframe == 1) {
if (_root.look) {
count++;
}
if (count >= 20) {
_root.lookiehere();
_root.look = false;
count = 0;
}
_root.timer = int(((getTimer() / 1000) - _root.startTime) * 100) / 100;
if ((_root.shrink == "left") or (_root.shrink == "down")) {
i++;
}
if (i > 5) {
i = 0;
if (_root.shrink == "down") {
i = 0;
while (i <= _root.xgrid) {
j = 0;
while (j <= _root.ygrid) {
if (_root.grid[i][j + 1] == 0) {
_root.grid[i][j + 1] = _root.grid[i][j];
_root[(("blot" + i) + "_") + (j + 1)].gotoAndStop(_root.grid[i][j + 1]);
_root.grid[i][j] = 0;
_root[(("blot" + i) + "_") + j].gotoAndStop(6);
}
j++;
}
i++;
}
}
m = 0;
while (m <= _root.xgrid) {
n = 0;
while (n <= _root.ygrid) {
if (_root.grid[m][n] == 0) {
shrinkleft = true;
start = m + 1;
} else {
shrinkleft = false;
n = _root.ygrid + 1;
}
n++;
}
if (shrinkleft) {
i = start;
while (i <= _root.xgrid) {
j = 0;
while (j <= _root.ygrid) {
_root.grid[i - 1][j] = _root.grid[i][j];
_root[(("blot" + (i - 1)) + "_") + j].gotoAndStop(_root.grid[i - 1][j]);
_root.grid[i][j] = 0;
_root[(("blot" + i) + "_") + j].gotoAndStop(6);
j++;
}
i++;
}
_root.xgrid--;
}
m++;
}
}
}
}
Frame 97
function place(x, y) {
this.x = x;
this.y = y;
}
function unselect() {
var _local1 = _root;
i = xgrid;
while (i >= 0) {
j = ygrid;
while (j >= 0) {
_local1[(("blot" + i) + "_") + j].highlight._visible = false;
j--;
}
i--;
}
}
function lookiehere() {
var _local1 = _root;
_local1.frame.moves.play();
_local1.done = true;
i = xgrid;
while (i >= 0) {
j = ygrid;
while (j >= 0) {
color = grid[i][j];
if (color > 0) {
_local1.done = false;
}
if ((grid[i + 1][j] == color) and (color > 0)) {
_local1.frame.moves.stop();
}
if ((grid[i][j + 1] == color) and (color > 0)) {
_local1.frame.moves.stop();
}
if ((grid[i - 1][j] == color) and (color > 0)) {
_local1.frame.moves.stop();
}
if ((grid[i][j - 1] == color) and (color > 0)) {
_local1.frame.moves.stop();
}
j--;
}
i--;
}
if (_local1.done) {
_local1.frame.moves.gotoAndPlay("done");
}
}
function select(x, y) {
var _local1 = y;
var _local2 = x;
var _local3 = _root;
_local3.beep.start();
i = 0;
q = 0;
color = grid[_local2][_local1];
queue = new Array();
queue[i] = new place(_local2, _local1);
while (queue[q].x != null) {
_local3[(("blot" + _local2) + "_") + _local1].highlight._visible = true;
if (grid[_local2 + 1][_local1] == color) {
i++;
queue[i] = new place(_local2 + 1, _local1);
_local3[(("blot" + (_local2 + 1)) + "_") + _local1].highlight._visible = true;
grid[_local2 + 1][_local1] = 0;
}
if (grid[_local2][_local1 + 1] == color) {
i++;
queue[i] = new place(_local2, _local1 + 1);
_local3[(("blot" + _local2) + "_") + (_local1 + 1)].highlight._visible = true;
grid[_local2][_local1 + 1] = 0;
}
if (grid[_local2 - 1][_local1] == color) {
i++;
queue[i] = new place(_local2 - 1, _local1);
_local3[(("blot" + (_local2 - 1)) + "_") + _local1].highlight._visible = true;
grid[_local2 - 1][_local1] = 0;
}
if (grid[_local2][_local1 - 1] == color) {
i++;
queue[i] = new place(_local2, _local1 - 1);
_local3[(("blot" + _local2) + "_") + (_local1 - 1)].highlight._visible = true;
grid[_local2][_local1 - 1] = 0;
}
q++;
_local2 = queue[q].x;
_local1 = queue[q].y;
}
if (i == 0) {
_local2 = queue[0].x;
_local1 = queue[0].y;
_local3[(("blot" + _local2) + "_") + _local1].highlight._visible = false;
currentscore = "";
} else {
currentscore = (queue.length - 1) * (queue.length - 1);
}
q = 0;
i = 0;
i = 0;
while (i <= queue.length) {
grid[queue[i].x][queue[i].y] = color;
i++;
}
}
function check(x, y) {
var _local1 = y;
var _local2 = x;
var _local3 = _root;
_local3.beep.start();
i = 0;
q = 0;
color = grid[_local2][_local1];
_local3.shrink = "down";
queue = new Array();
queue[i] = new place(_local2, _local1);
while (queue[q].x != null) {
_local3[(("blot" + _local2) + "_") + _local1].gotoAndStop(6);
if (grid[_local2 + 1][_local1] == color) {
i++;
queue[i] = new place(_local2 + 1, _local1);
_local3[(("blot" + (_local2 + 1)) + "_") + _local1].gotoAndStop(6);
grid[_local2 + 1][_local1] = 0;
}
if (grid[_local2][_local1 + 1] == color) {
i++;
queue[i] = new place(_local2, _local1 + 1);
_local3[(("blot" + _local2) + "_") + (_local1 + 1)].gotoAndStop(6);
grid[_local2][_local1 + 1] = 0;
}
if (grid[_local2 - 1][_local1] == color) {
i++;
queue[i] = new place(_local2 - 1, _local1);
_local3[(("blot" + (_local2 - 1)) + "_") + _local1].gotoAndStop(6);
grid[_local2 - 1][_local1] = 0;
}
if (grid[_local2][_local1 - 1] == color) {
i++;
queue[i] = new place(_local2, _local1 - 1);
_local3[(("blot" + _local2) + "_") + (_local1 - 1)].gotoAndStop(6);
grid[_local2][_local1 - 1] = 0;
}
q++;
_local2 = queue[q].x;
_local1 = queue[q].y;
}
q = 0;
i = 0;
score = score + currentscore;
currentscore = "";
_local3.actions.count = 0;
look = true;
}
grid = new Array();
xgrid = 7;
ygrid = 7;
beep = new Sound();
beep.attachSound("beep");
score = 0;
dots = (xgrid + 1) * (ygrid + 1);
_root.frame.swapDepths(10000);
_root.frame.play();
i = 0;
while (i <= xgrid) {
grid[i] = new Array();
j = 0;
while (j <= ygrid) {
again = true;
while (again) {
ran = random(4) + 1;
_root["count" + ran]++;
again = false;
if ((_root.count1 >= int(dots / 4)) and (ran == 1)) {
again = true;
}
if ((_root.count2 >= int(dots / 4)) and (ran == 2)) {
again = true;
}
if ((_root.count3 >= int(dots / 4)) and (ran == 3)) {
again = true;
}
if ((_root.count4 >= (int(dots / 4) + (dots % 4))) and (ran == 4)) {
again = true;
}
if (((((_root.count4 >= (int(dots / 4) + (dots % 4))) and (_root.count2 >= (dots / 4))) and (_root.count1 >= (dots / 4))) and (_root.count4 >= (dots / 4))) and (_root.count3 >= (dots / 4))) {
again = false;
}
}
grid[i][j] = ran;
duplicateMovieClip (blot, (("blot" + i) + "_") + j, (i * 100) + j);
_root[(("blot" + i) + "_") + j]._y = 25 + (j * 25);
_root[(("blot" + i) + "_") + j]._x = 95 + (i * 25);
_root[(("blot" + i) + "_") + j].x = i;
_root[(("blot" + i) + "_") + j].y = j;
_root[(("blot" + i) + "_") + j].gotoAndStop(grid[i][j]);
j++;
}
i++;
}
stop();
Frame 98
i = 0;
while (i <= xgrid) {
j = 0;
while (j <= ygrid) {
removeMovieClip((("blot" + i) + "_") + j);
j++;
}
i++;
}
gotoAndPlay (97);
Symbol 11 MovieClip Frame 1
stop();
Symbol 11 MovieClip Frame 2
stop();
Symbol 20 MovieClip Frame 7
stop();
Symbol 28 Button
on (release) {
gotoAndPlay (96);
_root.funcHITBOX("play_activity", "play");
}
Symbol 29 Button
on (release) {
_root.funcHITBOX("instructions", "view_instructions");
play();
}
Symbol 39 Button
on (release) {
play();
_root.funcHITBOX("play_activity", "play_from_instructions");
}
Symbol 41 Button
on (release) {
if (highlight._visible == false) {
_root.unselect();
_root.select(this.x, this.y);
} else {
_root.check(this.x, this.y);
}
}
Symbol 49 MovieClip Frame 1
stop();
Instance of Symbol 43 MovieClip "highlight" in Symbol 49 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 49 MovieClip Frame 2
stop();
Symbol 49 MovieClip Frame 3
stop();
Symbol 49 MovieClip Frame 4
stop();
Symbol 49 MovieClip Frame 5
stop();
Symbol 69 Button
on (release) {
gotoAndStop ("highscores");
}
Symbol 80 Button
on (keyPress "<Enter>") {
loadVariables ((((((("/games/writeGameHighScore.asp?&gameID=" + _global.gameID) + "&name=") + _root.player) + "&score=") + _root.score) + "&tag1=") + _root.timer, this);
play();
}
Symbol 89 Button
on (press) {
if (scoreWindow._y > ymax) {
scoreWindow._y = scoreWindow._y - 50;
}
}
Symbol 90 Button
on (press) {
if (scoreWindow._y < ymin) {
scoreWindow._y = scoreWindow._y + 50;
}
}
Symbol 95 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 46
stop();
Symbol 95 MovieClip Frame 102
stop();
Instance of Symbol 79 MovieClip in Symbol 95 MovieClip Frame 102
onClipEvent (enterFrame) {
if (_root.player.length == 3) {
loadVariables ((((("enter.asp?game=GridLock&name=" + _root.player) + "&score=") + _root.score) + "&time=") + _root.timer, this);
play();
_root.player = "";
}
}
Symbol 95 MovieClip Frame 103
stop();
Instance of Symbol 91 MovieClip "List" in Symbol 95 MovieClip Frame 103
onClipEvent (data) {
i = 0;
while (this["name" + i] != null) {
duplicateMovieClip (scoreWindow.ListEntry, "entry" + i, i * 99999);
this.scoreWindow["entry" + i].Entry = this["name" + i];
this.scoreWindow["entry" + i].Score = this["score" + i];
this.scoreWindow["entry" + i].Time = this["tag1_" + i];
this.scoreWindow["entry" + i].Place = i + 1;
this.scoreWindow["entry" + i]._y = 25 * i;
i++;
}
ymin = scoreWindow._y - 50;
ymax = (ymin - scoreWindow._height) + 190;
}
onClipEvent (load) {
this.scoreWindow.listentry._visible = false;
}
onClipEvent (load) {
loadVariables ("/games/getGameHighScores.asp?gameID=" + _global.gameID, this);
}
Symbol 96 Button
on (release) {
removeMovieClip(this);
_root.play();
_root.funcHITBOX("play_activity", "play_again");
}
Symbol 98 MovieClip Frame 2
stop();