Frame 1
function onEnterFrame() {
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = Math.round(PercentLoaded);
playBttn.percent.text = bar._xscale + "%";
} else {
bar._xscale = 100;
playBttn.percent.text = "100%";
playBttn._visible = true;
playBttn.play();
delete onEnterFrame;
}
}
stop();
Stage.showMenu = false;
playBttn._visible = false;
var backSound = false;
var gameSound = false;
bgSound = new Sound();
saved = SharedObject.getLocal("gravitysgrid");
var i = 2;
while (i <= 30) {
if (saved.data["lvl" + i] == undefined) {
saved.data["lvl" + i] = 2;
}
i++;
}
if (saved.data.currLevel == undefined) {
saved.data.currLevel = 1;
}
if (saved.data.currLevel == 1) {
saved.data.sc = "START";
} else {
saved.data.sc = "CONTINUE";
}
var level1_code = "<rotect: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,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,1,0,1,0,1,0,0;1:end>";
var level2_code = "<rotect: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,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,2,2,0,0,0,0,0,1,2,1,1,0,0,0;1:end>";
var level3_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,1,2,0,0,0,0,0,0,1,2,1,0,0,0,0;1:end>";
var level4_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,2,1,2,1,1,0,0;2:end>";
var level5_code = "<rotect: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,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,2,0,0,0,0,0,0,0,3,3,0,0,0,3,0,0,1,2,2,0,0,0;2:end>";
var level6_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,1,0,0,0,0,2,0,0,0,1,3,0,0,0,2,0,0,0,3,1,2,0,0;2:end>";
var level7_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,2,0,3,2,0,0,0,0,0,1,3,1,2,0,0,1,0;3:end>";
var level8_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,3,0,1,0,0,0,0,1,3,2,3,1,0,0;3:end>";
var level9_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,0,0,0,0,4,0,3,1,4,2,0,0,0,2,0,4,2,1,1,0,0,0;2:end>";
var level10_code = "<rotect: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,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,2,0,0,0,0,0,0,1,5,2,0,0,0,0,0,0,5,4,3,0,0,0,0,2,4,5,4,3,0,0,0;2:end>";
var level11_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,2,1,1,2,0,0;4:end>";
var level12_code = "<rotect: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,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,3,1,2,2,0,3,0;6:end>";
var level13_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,3,0,0,3,7,0,1,0,0,7,0,0,1,7,0,7,0,0,7,3,0;2:end>";
var level14_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,3,2,3,0,0,0,0,7,3,1,1,2,2,0,0;3:end>";
var level15_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,2,7,2,0,0,0,1,7,0,7,1,7,0,0,0;2:end>";
var level16_code = "<rotect:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,4,0,3,0,0,0,0,0,0,4,0,7,0,0,0,0,0,0,7,0,4,0,0,0,0,0,0,7,0,2,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,1,1,3,2,0,0,0;5:end>";
var level17_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,2,1,0,0,0,0,2,7,0,2,1,0,0,0;5:end>";
var level18_code = "<rotect: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,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,0,2,4,2,0,7,0,1,0,0,3,2,7,0,3,0,3,0,0,1,7,1,0,7;7:end>";
var level19_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,0,0,3,2,7,0,0,0,0,0,0,2,7,3,3,1,1,0;7:end>";
var level20_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,7,0,0,0,0,7,1,1,7,1,7,0,0;3:end>";
var level21_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,1,0,7,0,0,0,4,3,2,4,0,7,0,0,0,3,1,2,1,4,7,0,0;4:end>";
var level22_code = "<rotect: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,4,0,0,0,0,0,0,0,4,2,4,0,0,0,0,0,0,1,1,7,7,0,0,0,0,0,2,7,1,7,0,0,0,0,0,2,7,7,7,0,7;3:end>";
var level23_code = "<rotect: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,1,0,0,0,0,0,0,0,6,2,0,0,0,0,0,0,0,5,3,0,0,0,0,0,0,5,2,4,0,4,0,6,5,0,1,2,1,0,4,6,3,3;5:end>";
var level24_code = "<rotect: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,6,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,4,6,0,0,0,0,0,0,0,1,5,0,0,0,0,0,0,3,4,2,5,0,0,4,0,3,1,2,1,2,3,0,5,0;8:end>";
var level25_code = "<rotect: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,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,3,3,2,1,4,3,4,7,2,2,7;4:end>";
var level26_code = "<rotect: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,1,0,0,0,0,0,0,0,1,7,1,0,0,0,0,0,7,4,2,4,7,0,0,0,7,5,6,3,6,2,7,0,7,5,3,4,5,6,3,2,7;8:end>";
var level27_code = "<rotect: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,2,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,1,5,0,4,0,5,1,2,0,3,2,5,4,0,4,1;7:end>";
var level28_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,7,7,1,0,0,0,0,2,0,7,7,7,1,2,2,0;4:end>";
var level29_code = "<rotect: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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,1,0,0,0,0,0,0,0,4,7,2,0,0,0,3,2,2,1,4,1,0,3,3;6:end>";
var level30_code = "<rotect:0,0,0,0,1,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,0,0,0,0,0,0,0,0,0,0,7,0,7,0,0,0,0,0,7,7,0,7,7,0,0,0,7,1,7,7,7,1,7,0;6:end>";
Instance of Symbol 115 MovieClip in Frame 1
onClipEvent (load) {
this.swapDepths(999);
}
onClipEvent (keyDown) {
if (Key.isDown(77)) {
play();
}
}
Frame 30
_root.gotoAndPlay("agintro");
Frame 33
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;
var pv;
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);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&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__("8346fb05", this, 10301, true);
if (gameSound) {
gameSound = false;
stopAllSounds();
}
if (!backSound) {
backSound = true;
bgSound.attachSound("menutrack.mp3");
bgSound.start(0, 9999);
}
if (saved.data.currLevel == 1) {
saved.data.sc = "START";
} else {
saved.data.sc = "CONTINUE";
}
Frame 119
menu_web.enabled = false;
Frame 132
menu_web.enabled = true;
delete onEnterFrame;
stop();
Instance of Symbol 189 MovieClip in Frame 132
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (press) {
this.gotoAndStop(3);
}
on (release) {
_root.level_code = _root[("level" + _root.saved.data.currLevel) + "_code"];
_root.level = _root.saved.data.currLevel;
_root.gotoAndStop("levels");
}
Frame 137
menu_web.enabled = false;
Frame 153
stop();
Frame 154
if (gameSound) {
gameSound = false;
stopAllSounds();
}
if (!backSound) {
backSound = true;
bgSound.attachSound("menutrack.mp3");
bgSound.start(0, 9999);
}
if (saved.data.currLevel == 1) {
saved.data.sc = "START";
} else {
saved.data.sc = "CONTINUE";
}
Frame 176
menu_web.enabled = false;
Frame 189
menu_web.enabled = true;
delete onEnterFrame;
stop();
Instance of Symbol 189 MovieClip in Frame 189
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
on (press) {
this.gotoAndStop(3);
}
on (release) {
_root.level_code = _root[("level" + _root.saved.data.currLevel) + "_code"];
_root.level = _root.saved.data.currLevel;
_root.gotoAndStop("levels");
}
Frame 194
menu_web.enabled = false;
Frame 210
stop();
Frame 211
delete builtLine;
var builtLine = new Array();
builtLine[0] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
builtLine[1] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
builtLine[2] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
builtLine[3] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
builtLine[4] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
builtLine[5] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
builtLine[6] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
builtLine[7] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
builtLine[8] = [0, 0, 0, 0, 0, 0, 0, 0, 0];
var nogrey = false;
var colour = "green";
var colourRed = false;
var colourGreen = true;
var colourBlue = false;
var colourOrange = false;
var colourPurple = false;
var colourYellow = false;
var colourGrey = false;
var numbRed = 0;
var numbGreen = 0;
var numbBlue = 0;
var numbOrange = 0;
var numbPurple = 0;
var numbYellow = 0;
var placeX = 0;
var placeY = 0;
var arrayId = 3;
var gridPlace = true;
var hitBlock = false;
var changeBack = false;
Frame 212
function onMouseDown() {
var _local1 = 1;
while (_local1 <= id) {
if (grid["block" + _local1].hitTest(_xmouse, _ymouse, true)) {
switch (Number(grid["block" + _local1].nid)) {
case 1 :
numbGreen--;
if (numbBlue < 3) {
colourBlue = true;
} else if (numbRed < 3) {
colourRed = true;
} else if (numbOrange < 3) {
colourOrange = true;
} else if (numbPurple < 3) {
colourPurple = true;
} else if (numbYellow < 3) {
colourYellow = true;
} else {
colourGrey = true;
}
grid["block" + _local1].removeMovieClip();
break;
case 2 :
numbBlue--;
if (numbRed < 3) {
colourRed = true;
} else if (numbOrange < 3) {
colourOrange = true;
} else if (numbPurple < 3) {
colourPurple = true;
} else if (numbYellow < 3) {
colourYellow = true;
} else {
colourGrey = true;
}
grid["block" + _local1].removeMovieClip();
break;
case 3 :
numbRed--;
if (numbOrange < 3) {
colourOrange = true;
} else if (numbPurple < 3) {
colourPurple = true;
} else if (numbYellow < 3) {
colourYellow = true;
} else {
colourGrey = true;
}
grid["block" + _local1].removeMovieClip();
break;
case 4 :
numbOrange--;
if (numbPurple < 3) {
colourPurple = true;
} else if (numbYellow < 3) {
colourYellow = true;
} else {
colourGrey = true;
}
grid["block" + _local1].removeMovieClip();
break;
case 5 :
numbPurple--;
if (numbYellow < 3) {
colourYellow = true;
} else {
colourGrey = true;
}
grid["block" + _local1].removeMovieClip();
break;
case 6 :
numbYellow--;
colourGrey = true;
grid["block" + _local1].removeMovieClip();
break;
case 7 :
builtLine[grid["block" + _local1].arrayY][grid["block" + _local1].arrayX] = 0;
gridPlace = false;
nogrey = true;
grid["block" + _local1].removeMovieClip();
}
hitBlock = true;
break;
}
_local1++;
}
if (!hitBlock) {
if (numbGreen < 3) {
colourGreen = true;
} else if (numbBlue < 3) {
colourBlue = true;
} else if (numbRed < 3) {
colourRed = true;
} else if (numbOrange < 3) {
colourOrange = true;
} else if (numbPurple < 3) {
colourPurple = true;
} else if (numbYellow < 3) {
colourYellow = true;
} else if (!nogrey) {
colourGrey = true;
}
}
nogrey = false;
hitBlock = false;
if (gridHit.hitTest(_xmouse, _ymouse, true)) {
if (colourRed) {
if (numbRed < 3) {
numbRed++;
colour = "red";
arrayId = 3;
} else {
gridPlace = false;
}
} else if (colourGreen) {
if (numbGreen < 3) {
numbGreen++;
colour = "green";
arrayId = 1;
} else {
gridPlace = false;
}
} else if (colourBlue) {
if (numbBlue < 3) {
numbBlue++;
colour = "blue";
arrayId = 2;
} else {
gridPlace = false;
}
} else if (colourOrange) {
if (numbOrange < 3) {
numbOrange++;
colour = "orange";
arrayId = 4;
} else {
gridPlace = false;
}
} else if (colourPurple) {
if (numbPurple < 3) {
numbPurple++;
colour = "purple";
arrayId = 5;
} else {
gridPlace = false;
}
} else if (colourYellow) {
if (numbYellow < 3) {
numbYellow++;
colour = "yellow";
arrayId = 6;
} else {
gridPlace = false;
}
} else if (colourGrey) {
colour = "grey";
arrayId = 7;
}
if (gridPlace) {
id++;
placeX = Math.round(grid._xmouse / 30);
placeY = Math.round(grid._ymouse / 30);
var _local2 = grid.attachMovie(colour, "block" + id, id);
_local2._x = placeX * 30;
_local2._y = placeY * 30;
_local2.nid = arrayId;
_local2.arrayX = placeX + 4;
_local2.arrayY = placeY + 4;
builtLine[placeY + 4][placeX + 4] = arrayId;
} else {
gridPlace = true;
}
}
colourRed = false;
colourBlue = false;
colourGreen = false;
colourOrange = false;
colourPurple = false;
colourYellow = false;
colourGrey = false;
}
function onMouseMove() {
if (gridHit.hitTest(_xmouse, _ymouse, true)) {
grid.cursor._visible = true;
grid.cursor._x = (Math.round(grid._xmouse / 30) * 30) - 15;
grid.cursor._y = (Math.round(grid._ymouse / 30) * 30) - 15;
} else {
grid.cursor._visible = false;
}
}
stop();
var id = 1;
grid.cursor.swapDepths(9999999);
grid.cursor._visible = false;
if (changeBack) {
var x = 0;
while (x <= 8) {
var y = 0;
while (y <= 8) {
if (builtLine[y][x] == 1) {
id++;
placeX = x - 4;
placeY = y - 4;
var nest = grid.attachMovie("green", "block" + id, id);
nest._x = placeX * 30;
nest._y = placeY * 30;
nest.nid = 1;
nest.arrayX = placeX + 4;
nest.arrayY = placeY + 4;
} else if (builtLine[y][x] == 2) {
id++;
placeX = x - 4;
placeY = y - 4;
var nest = grid.attachMovie("blue", "block" + id, id);
nest._x = placeX * 30;
nest._y = placeY * 30;
nest.nid = 2;
nest.arrayX = placeX + 4;
nest.arrayY = placeY + 4;
} else if (builtLine[y][x] == 3) {
id++;
placeX = x - 4;
placeY = y - 4;
var nest = grid.attachMovie("red", "block" + id, id);
nest._x = placeX * 30;
nest._y = placeY * 30;
nest.nid = 3;
nest.arrayX = placeX + 4;
nest.arrayY = placeY + 4;
} else if (builtLine[y][x] == 4) {
id++;
placeX = x - 4;
placeY = y - 4;
var nest = grid.attachMovie("orange", "block" + id, id);
nest._x = placeX * 30;
nest._y = placeY * 30;
nest.nid = 4;
nest.arrayX = placeX + 4;
nest.arrayY = placeY + 4;
} else if (builtLine[y][x] == 5) {
id++;
placeX = x - 4;
placeY = y - 4;
var nest = grid.attachMovie("purple", "block" + id, id);
nest._x = placeX * 30;
nest._y = placeY * 30;
nest.nid = 5;
nest.arrayX = placeX + 4;
nest.arrayY = placeY + 4;
} else if (builtLine[y][x] == 6) {
id++;
placeX = x - 4;
placeY = y - 4;
var nest = grid.attachMovie("yellow", "block" + id, id);
nest._x = placeX * 30;
nest._y = placeY * 30;
nest.nid = 6;
nest.arrayX = placeX + 4;
nest.arrayY = placeY + 4;
} else if (builtLine[y][x] == 7) {
id++;
placeX = x - 4;
placeY = y - 4;
var nest = grid.attachMovie("grey", "block" + id, id);
nest._x = placeX * 30;
nest._y = placeY * 30;
nest.nid = 7;
nest.arrayX = placeX + 4;
nest.arrayY = placeY + 4;
}
y++;
}
x++;
}
}
Frame 213
function goClockFunc() {
movesLeft++;
goClock = true;
goRot = grid._rotation + 90;
if (goRot > 180) {
goRot = -180 + (goRot - 180);
grid._rotation = grid._rotation + 5;
}
if (gridDir == "down") {
gridDir = "left";
} else if (gridDir == "left") {
gridDir = "up";
} else if (gridDir == "up") {
gridDir = "right";
} else if (gridDir == "right") {
gridDir = "down";
}
}
function goAntiFunc() {
movesLeft++;
goAntiClock = true;
goRot = grid._rotation - 90;
if (goRot < -180) {
goRot = 180 - ((-goRot) - 180);
grid._rotation = grid._rotation - 5;
}
if (gridDir == "down") {
gridDir = "right";
} else if (gridDir == "right") {
gridDir = "up";
} else if (gridDir == "up") {
gridDir = "left";
} else if (gridDir == "left") {
gridDir = "down";
}
}
function onMouseDown() {
if (grid.drag.hitTest(_xmouse, _ymouse, true)) {
dragGrid = true;
}
}
function onMouseUp() {
dragGrid = false;
}
function onMouseMove() {
if ((((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) && (dragGrid)) {
if (_xmouse < 275) {
if (_ymouse < 230) {
if (_ymouse < (prevY - 5)) {
goClockFunc();
} else if (_ymouse > (prevY + 5)) {
goAntiFunc();
}
if (_xmouse < (prevX - 5)) {
goAntiFunc();
} else if (_xmouse > (prevX + 5)) {
goClockFunc();
}
} else {
if (_ymouse < (prevY - 5)) {
goClockFunc();
} else if (_ymouse > (prevY + 5)) {
goAntiFunc();
}
if (_xmouse < (prevX - 5)) {
goClockFunc();
} else if (_xmouse > (prevX + 5)) {
goAntiFunc();
}
}
} else if (_ymouse < 230) {
if (_ymouse < (prevY - 5)) {
goAntiFunc();
} else if (_ymouse > (prevY + 5)) {
goClockFunc();
}
if (_xmouse < (prevX - 5)) {
goAntiFunc();
} else if (_xmouse > (prevX + 5)) {
goClockFunc();
}
} else {
if (_ymouse < (prevY - 5)) {
goAntiFunc();
} else if (_ymouse > (prevY + 5)) {
goClockFunc();
}
if (_xmouse < (prevX - 5)) {
goClockFunc();
} else if (_xmouse > (prevX + 5)) {
goAntiFunc();
}
}
}
prevX = _xmouse;
prevY = _ymouse;
}
function onEnterFrame() {
if (movesLeft > 23) {
moves_mc.gotoAndStop(25);
moves_mc.brackets.text = ("(" + (movesLeft - 23)) + ")";
} else {
moves_mc.gotoAndStop(movesLeft + 1);
}
if (goClock) {
if (grid._rotation < goRot) {
grid._rotation = grid._rotation + 5;
} else {
moveBlocks = true;
goClock = false;
}
} else if (goAntiClock) {
if (grid._rotation > goRot) {
grid._rotation = grid._rotation - 5;
} else {
moveBlocks = true;
goAntiClock = false;
}
} else if (goFlip) {
if (changeScaleX) {
if (grid._xscale <= goScale) {
if (grid._xscale == goScale) {
moveBlocks = true;
changeScaleX = false;
goFlip = false;
} else {
grid._xscale = grid._xscale + 5;
}
} else if (grid._xscale == goScale) {
moveBlocks = true;
changeScaleX = false;
goFlip = false;
} else {
grid._xscale = grid._xscale - 5;
}
} else if (grid._yscale <= goScale) {
if (grid._yscale == goScale) {
moveBlocks = true;
changeScaleY = false;
goFlip = false;
} else {
grid._yscale = grid._yscale + 5;
}
} else if (grid._yscale == goScale) {
moveBlocks = true;
changeScaleY = false;
goFlip = false;
} else {
grid._yscale = grid._yscale - 5;
}
} else if (moveBlocks) {
if ((gridScaledX || (gridScaledY)) && (!(gridScaledX && (gridScaledY)))) {
if (gridDir == "right") {
var _local3 = 1;
while (_local3 <= id) {
grid["block" + _local3]._x = grid["block" + _local3]._x + 5;
while (grid.edge.hitTest(grid["block" + _local3]._y + gridX, (grid["block" + _local3]._x + gridY) + 14, true)) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._x--;
}
var _local1 = 1;
while (_local1 <= id) {
while (grid["block" + _local1].hitTest(grid["block" + _local3]._y + gridX, (grid["block" + _local3]._x + gridY) + 14, true) && (grid["block" + _local3] != grid["block" + _local1])) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._x--;
}
_local1++;
}
_local3++;
}
} else if (gridDir == "up") {
var _local3 = 1;
while (_local3 <= id) {
grid["block" + _local3]._y = grid["block" + _local3]._y - 5;
while (grid.edge.hitTest(grid["block" + _local3]._x + gridX, ((-grid["block" + _local3]._y) + gridY) + 14, true)) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._y++;
}
var _local1 = 1;
while (_local1 <= id) {
while (grid["block" + _local1].hitTest(grid["block" + _local3]._x + gridX, ((-grid["block" + _local3]._y) + gridY) + 14, true) && (grid["block" + _local3] != grid["block" + _local1])) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._y++;
}
_local1++;
}
_local3++;
}
} else if (gridDir == "left") {
var _local3 = 1;
while (_local3 <= id) {
grid["block" + _local3]._x = grid["block" + _local3]._x - 5;
while (grid.edge.hitTest((-grid["block" + _local3]._y) + gridX, ((-grid["block" + _local3]._x) + gridY) + 14, true)) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._x++;
}
var _local1 = 1;
while (_local1 <= id) {
while (grid["block" + _local1].hitTest((-grid["block" + _local3]._y) + gridX, ((-grid["block" + _local3]._x) + gridY) + 14, true) && (grid["block" + _local3] != grid["block" + _local1])) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._x++;
}
_local1++;
}
_local3++;
}
} else if (gridDir == "down") {
var _local3 = 1;
while (_local3 <= id) {
grid["block" + _local3]._y = grid["block" + _local3]._y + 5;
while (grid.edge.hitTest((-grid["block" + _local3]._x) + gridX, (grid["block" + _local3]._y + gridY) + 14, true)) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._y--;
}
var _local1 = 1;
while (_local1 <= id) {
while (grid["block" + _local1].hitTest((-grid["block" + _local3]._x) + gridX, (grid["block" + _local3]._y + gridY) + 14, true) && (grid["block" + _local3] != grid["block" + _local1])) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._y--;
}
_local1++;
}
_local3++;
}
}
} else if (gridDir == "left") {
var _local3 = 1;
while (_local3 <= id) {
grid["block" + _local3]._x = grid["block" + _local3]._x + 5;
while (grid.edge.hitTest((-grid["block" + _local3]._y) + gridX, (grid["block" + _local3]._x + gridY) + 14, true)) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._x--;
}
var _local1 = 1;
while (_local1 <= id) {
while (grid["block" + _local1].hitTest((-grid["block" + _local3]._y) + gridX, (grid["block" + _local3]._x + gridY) + 14, true) && (grid["block" + _local3] != grid["block" + _local1])) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._x--;
}
_local1++;
}
_local3++;
}
} else if (gridDir == "up") {
var _local3 = 1;
while (_local3 <= id) {
grid["block" + _local3]._y = grid["block" + _local3]._y - 5;
while (grid.edge.hitTest((-grid["block" + _local3]._x) + gridX, ((-grid["block" + _local3]._y) + gridY) + 14, true)) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._y++;
}
var _local1 = 1;
while (_local1 <= id) {
while (grid["block" + _local1].hitTest((-grid["block" + _local3]._x) + gridX, ((-grid["block" + _local3]._y) + gridY) + 14, true) && (grid["block" + _local3] != grid["block" + _local1])) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._y++;
}
_local1++;
}
_local3++;
}
} else if (gridDir == "right") {
var _local3 = 1;
while (_local3 <= id) {
grid["block" + _local3]._x = grid["block" + _local3]._x - 5;
while (grid.edge.hitTest(grid["block" + _local3]._y + gridX, ((-grid["block" + _local3]._x) + gridY) + 14, true)) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._x++;
}
var _local1 = 1;
while (_local1 <= id) {
while (grid["block" + _local1].hitTest(grid["block" + _local3]._y + gridX, ((-grid["block" + _local3]._x) + gridY) + 14, true) && (grid["block" + _local3] != grid["block" + _local1])) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._x++;
}
_local1++;
}
_local3++;
}
} else if (gridDir == "down") {
var _local3 = 1;
while (_local3 <= id) {
grid["block" + _local3]._y = grid["block" + _local3]._y + 5;
while (grid.edge.hitTest(grid["block" + _local3]._x + gridX, (grid["block" + _local3]._y + gridY) + 14, true)) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._y--;
}
var _local1 = 1;
while (_local1 <= id) {
while (grid["block" + _local1].hitTest(grid["block" + _local3]._x + gridX, (grid["block" + _local3]._y + gridY) + 14, true) && (grid["block" + _local3] != grid["block" + _local1])) {
grid["block" + _local3].hit = true;
grid["block" + _local3]._y--;
}
_local1++;
}
_local3++;
}
}
var _local3 = 1;
while (_local3 <= id) {
if (grid["block" + _local3].hit) {
blocksHit++;
}
_local3++;
}
if (blocksHit == totalNumb) {
moveBlocks = false;
checkHit = true;
}
blocksHit = 0;
_local3 = 1;
while (_local3 <= id) {
grid["block" + _local3].hit = false;
_local3++;
}
} else if (checkHit) {
if ((gridScaledX || (gridScaledY)) && (!(gridScaledX && (gridScaledY)))) {
if (gridDir == "left") {
var _local3 = 1;
while (_local3 <= id) {
var _local2 = 0;
var _local1 = 1;
while (_local1 <= id) {
if ((grid["block" + _local1].hitTest((-grid["block" + _local3]._y) + gridX, ((-grid["block" + _local3]._x) + gridY) + 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((-grid["block" + _local3]._y) + gridX, ((-grid["block" + _local3]._x) + gridY) - 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(((-grid["block" + _local3]._y) + gridX) + 17, (-grid["block" + _local3]._x) + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(((-grid["block" + _local3]._y) + gridX) - 17, (-grid["block" + _local3]._x) + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
_local1++;
}
if (_local2 > 1) {
switch (grid["block" + _local3].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local2 = 0;
_local3++;
}
} else if (gridDir == "right") {
var _local3 = 1;
while (_local3 <= id) {
var _local2 = 0;
var _local1 = 1;
while (_local1 <= id) {
if ((grid["block" + _local1].hitTest(grid["block" + _local3]._y + gridX, (grid["block" + _local3]._x + gridY) + 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(grid["block" + _local3]._y + gridX, (grid["block" + _local3]._x + gridY) - 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((grid["block" + _local3]._y + gridX) + 17, grid["block" + _local3]._x + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((grid["block" + _local3]._y + gridX) - 17, grid["block" + _local3]._x + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
_local1++;
}
if (_local2 > 1) {
switch (grid["block" + _local3].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local2 = 0;
_local3++;
}
} else if (gridDir == "up") {
var _local3 = 1;
while (_local3 <= id) {
var _local2 = 0;
var _local1 = 1;
while (_local1 <= id) {
if ((grid["block" + _local1].hitTest(grid["block" + _local3]._x + gridX, ((-grid["block" + _local3]._y) + gridY) + 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(grid["block" + _local3]._x + gridX, ((-grid["block" + _local3]._y) + gridY) - 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((grid["block" + _local3]._x + gridX) + 17, (-grid["block" + _local3]._y) + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((grid["block" + _local3]._x + gridX) - 17, (-grid["block" + _local3]._y) + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
_local1++;
}
if (_local2 > 1) {
switch (grid["block" + _local3].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local2 = 0;
_local3++;
}
} else if (gridDir == "down") {
var _local3 = 1;
while (_local3 <= id) {
var _local2 = 0;
var _local1 = 1;
while (_local1 <= id) {
if ((grid["block" + _local1].hitTest((-grid["block" + _local3]._x) + gridX, (grid["block" + _local3]._y + gridY) + 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((-grid["block" + _local3]._x) + gridX, (grid["block" + _local3]._y + gridY) - 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(((-grid["block" + _local3]._x) + gridX) + 17, grid["block" + _local3]._y + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(((-grid["block" + _local3]._x) + gridX) - 17, grid["block" + _local3]._y + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
_local1++;
}
if (_local2 > 1) {
switch (grid["block" + _local3].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local2 = 0;
_local3++;
}
}
} else if (gridDir == "left") {
var _local3 = 1;
while (_local3 <= id) {
var _local2 = 0;
var _local1 = 1;
while (_local1 <= id) {
if ((grid["block" + _local1].hitTest((-grid["block" + _local3]._y) + gridX, (grid["block" + _local3]._x + gridY) + 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((-grid["block" + _local3]._y) + gridX, (grid["block" + _local3]._x + gridY) - 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(((-grid["block" + _local3]._y) + gridX) + 17, grid["block" + _local3]._x + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(((-grid["block" + _local3]._y) + gridX) - 17, grid["block" + _local3]._x + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
_local1++;
}
if (_local2 > 1) {
switch (grid["block" + _local3].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local2 = 0;
_local3++;
}
} else if (gridDir == "right") {
var _local3 = 1;
while (_local3 <= id) {
var _local2 = 0;
var _local1 = 1;
while (_local1 <= id) {
if ((grid["block" + _local1].hitTest(grid["block" + _local3]._y + gridX, ((-grid["block" + _local3]._x) + gridY) + 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(grid["block" + _local3]._y + gridX, ((-grid["block" + _local3]._x) + gridY) - 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((grid["block" + _local3]._y + gridX) + 17, (-grid["block" + _local3]._x) + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((grid["block" + _local3]._y + gridX) - 17, (-grid["block" + _local3]._x) + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
_local1++;
}
if (_local2 > 1) {
switch (grid["block" + _local3].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local2 = 0;
_local3++;
}
} else if (gridDir == "up") {
var _local3 = 1;
while (_local3 <= id) {
var _local2 = 0;
var _local1 = 1;
while (_local1 <= id) {
if ((grid["block" + _local1].hitTest((-grid["block" + _local3]._x) + gridX, ((-grid["block" + _local3]._y) + gridY) + 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((-grid["block" + _local3]._x) + gridX, ((-grid["block" + _local3]._y) + gridY) - 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(((-grid["block" + _local3]._x) + gridX) + 17, (-grid["block" + _local3]._y) + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(((-grid["block" + _local3]._x) + gridX) - 17, (-grid["block" + _local3]._y) + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
_local1++;
}
if (_local2 > 1) {
switch (grid["block" + _local3].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local2 = 0;
_local3++;
}
} else if (gridDir == "down") {
var _local3 = 1;
while (_local3 <= id) {
var _local2 = 0;
var _local1 = 1;
while (_local1 <= id) {
if ((grid["block" + _local1].hitTest(grid["block" + _local3]._x + gridX, (grid["block" + _local3]._y + gridY) + 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest(grid["block" + _local3]._x + gridX, (grid["block" + _local3]._y + gridY) - 17, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((grid["block" + _local3]._x + gridX) + 17, grid["block" + _local3]._y + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
if ((grid["block" + _local1].hitTest((grid["block" + _local3]._x + gridX) - 17, grid["block" + _local3]._y + gridY, true) && (grid["block" + _local3] != grid["block" + _local1])) && (grid["block" + _local3].colour == grid["block" + _local1].colour)) {
_local2++;
}
_local1++;
}
if (_local2 > 1) {
switch (grid["block" + _local3].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local2 = 0;
_local3++;
}
}
if (takeOutGreen) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutGreen = false;
var _local3 = 1;
while (_local3 <= id) {
if (grid["block" + _local3].colour == "green") {
totalNumb--;
grid["block" + _local3].onEnterFrame = die;
}
_local3++;
}
}
if (takeOutBlue) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutBlue = false;
var _local3 = 1;
while (_local3 <= id) {
if (grid["block" + _local3].colour == "blue") {
totalNumb--;
grid["block" + _local3].onEnterFrame = die;
}
_local3++;
}
}
if (takeOutRed) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutRed = false;
var _local3 = 1;
while (_local3 <= id) {
if (grid["block" + _local3].colour == "red") {
totalNumb--;
grid["block" + _local3].onEnterFrame = die;
}
_local3++;
}
}
if (takeOutOrange) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutOrange = false;
var _local3 = 1;
while (_local3 <= id) {
if (grid["block" + _local3].colour == "orange") {
totalNumb--;
grid["block" + _local3].onEnterFrame = die;
}
_local3++;
}
}
if (takeOutPurple) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutPurple = false;
var _local3 = 1;
while (_local3 <= id) {
if (grid["block" + _local3].colour == "purple") {
totalNumb--;
grid["block" + _local3].onEnterFrame = die;
}
_local3++;
}
}
if (takeOutYellow) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutYellow = false;
var _local3 = 1;
while (_local3 <= id) {
if (grid["block" + _local3].colour == "yellow") {
totalNumb--;
grid["block" + _local3].onEnterFrame = die;
}
_local3++;
}
}
checkHit = false;
}
if (totalNumb == numbGrey) {
finishFunc();
}
}
function die() {
this._alpha = this._alpha - 5;
if (this._alpha < 1) {
this.removeMovieClip();
}
}
function finishFunc() {
finish = true;
nextbttn._visible = true;
}
changeBack = true;
nextbttn._visible = false;
var goClock = false;
var goAntiClock = false;
var goFlip = false;
var gridDir = "down";
var goRot = 0;
var goScale = 0;
var changeScaleX = false;
var changeScaleY = false;
var gridScaledX = false;
var gridScaledY = false;
var moveBlocks = true;
var blocksHit = 0;
var id = 0;
var checkHit = false;
var takeOutGreen = false;
var takeOutBlue = false;
var takeOutRed = false;
var takeOutOrange = false;
var takeOutPurple = false;
var takeOutYellow = false;
var finish = false;
var movesLeft = 0;
var numbGrey = 0;
var gridX = grid._x;
var gridY = grid._y;
grid._xscale = 100;
grid._yscale = 100;
grid.edge._visible = false;
var x = 0;
while (x <= 8) {
var y = 0;
while (y <= 8) {
if (builtLine[y][x] == 1) {
id++;
var nest = grid.attachMovie("green", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "green";
} else if (builtLine[y][x] == 2) {
id++;
var nest = grid.attachMovie("blue", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "blue";
} else if (builtLine[y][x] == 3) {
id++;
var nest = grid.attachMovie("red", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "red";
} else if (builtLine[y][x] == 4) {
id++;
var nest = grid.attachMovie("orange", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "orange";
} else if (builtLine[y][x] == 5) {
id++;
var nest = grid.attachMovie("purple", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "purple";
} else if (builtLine[y][x] == 6) {
id++;
var nest = grid.attachMovie("yellow", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "yellow";
} else if (builtLine[y][x] == 7) {
numbGrey++;
id++;
var nest = grid.attachMovie("grey", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "grey";
}
y++;
}
x++;
}
var totalNumb = id;
clock.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
goClockFunc();
}
};
anticlock.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
goAntiFunc();
}
};
flip.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
movesLeft++;
goFlip = true;
if ((gridDir == "left") || (gridDir == "right")) {
changeScaleX = true;
goScale = -grid._xscale;
if (gridScaledY && (gridScaledX)) {
gridScaledX = false;
} else if ((!gridScaledY) && (gridScaledX)) {
gridScaledX = false;
} else {
gridScaledX = true;
}
} else if (gridDir == "up") {
changeScaleY = true;
goScale = -grid._yscale;
if (gridScaledY && (gridScaledX)) {
gridDir = "down";
gridScaledY = false;
} else if (gridScaledY && (!gridScaledX)) {
gridDir = "down";
gridScaledY = false;
} else {
gridDir = "down";
gridScaledY = true;
}
} else if (gridDir == "down") {
changeScaleY = true;
goScale = -grid._yscale;
if (gridScaledY && (gridScaledX)) {
gridDir = "up";
gridScaledY = false;
} else if (gridScaledY && (!gridScaledX)) {
gridDir = "up";
gridScaledY = false;
} else {
gridDir = "up";
gridScaledY = true;
}
}
}
};
var dragGrid = false;
var prevX = 0;
var prevY = 0;
Frame 214
var paste = ((("code:" + builtLine) + ";") + movesLeft);
Frame 215
inputField = "";
if (gameSound) {
gameSound = false;
stopAllSounds();
}
if (!backSound) {
backSound = true;
bgSound.attachSound("menutrack.mp3");
bgSound.start(0, 9999);
}
Frame 216
var line = new Array();
var temp = new Array();
if (inputField.substr(0, 5) != "code:") {
debug.text = "Error reading code";
errorSound = new Sound();
errorSound.attachSound("errorcode.mp3");
errorSound.start(0, 1);
prevFrame();
} else {
debug.text = "";
trace(inputField);
inputField = inputField.substring(5, inputField.length);
trace(inputField);
temp = inputField.split(";");
var numbMoves = temp[1];
var splitter = temp[0];
var i = 17;
while (i < splitter.length) {
splitter = (splitter.substr(0, i) + "#") + splitter.substr(i + 1, splitter.length);
i = i + 18;
}
line = splitter.split("#");
var i = 0;
while (i <= 8) {
line[i] = line[i].split(",");
i++;
}
stopAllSounds();
nextFrame();
}
Frame 217
function goClockFunc() {
moves++;
movesLeft--;
goClock = true;
goRot = grid._rotation + 90;
if (goRot > 180) {
goRot = -180 + (goRot - 180);
grid._rotation = grid._rotation + 5;
}
if (gridDir == "down") {
gridDir = "left";
} else if (gridDir == "left") {
gridDir = "up";
} else if (gridDir == "up") {
gridDir = "right";
} else if (gridDir == "right") {
gridDir = "down";
}
}
function goAntiFunc() {
moves++;
movesLeft--;
goAntiClock = true;
goRot = grid._rotation - 90;
if (goRot < -180) {
goRot = 180 - ((-goRot) - 180);
grid._rotation = grid._rotation - 5;
}
if (gridDir == "down") {
gridDir = "right";
} else if (gridDir == "right") {
gridDir = "up";
} else if (gridDir == "up") {
gridDir = "left";
} else if (gridDir == "left") {
gridDir = "down";
}
}
function onMouseDown() {
if (grid.drag.hitTest(_xmouse, _ymouse, true)) {
dragGrid = true;
}
}
function onMouseUp() {
dragGrid = false;
}
function onMouseMove() {
if ((((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) && (dragGrid)) {
if (_xmouse < 275) {
if (_ymouse < 230) {
if (_ymouse < (prevY - 5)) {
goClockFunc();
} else if (_ymouse > (prevY + 5)) {
goAntiFunc();
}
if (_xmouse < (prevX - 5)) {
goAntiFunc();
} else if (_xmouse > (prevX + 5)) {
goClockFunc();
}
} else {
if (_ymouse < (prevY - 5)) {
goClockFunc();
} else if (_ymouse > (prevY + 5)) {
goAntiFunc();
}
if (_xmouse < (prevX - 5)) {
goClockFunc();
} else if (_xmouse > (prevX + 5)) {
goAntiFunc();
}
}
} else if (_ymouse < 230) {
if (_ymouse < (prevY - 5)) {
goAntiFunc();
} else if (_ymouse > (prevY + 5)) {
goClockFunc();
}
if (_xmouse < (prevX - 5)) {
goAntiFunc();
} else if (_xmouse > (prevX + 5)) {
goClockFunc();
}
} else {
if (_ymouse < (prevY - 5)) {
goAntiFunc();
} else if (_ymouse > (prevY + 5)) {
goClockFunc();
}
if (_xmouse < (prevX - 5)) {
goClockFunc();
} else if (_xmouse > (prevX + 5)) {
goAntiFunc();
}
}
}
prevX = _xmouse;
prevY = _ymouse;
}
function onEnterFrame() {
if (movesLeft > 23) {
moves_mc.gotoAndStop(25);
moves_mc.brackets.text = ("(" + (movesLeft - 23)) + ")";
} else {
moves_mc.gotoAndStop(Number(movesLeft) + 1);
}
if (blockAnimation) {
moves_fake.play();
if (Number(movesLeft) < 23) {
if (moves_fake._currentframe == ((3 * (Number(movesLeft) + 1)) + 18)) {
moves_mc._visible = true;
moves_fake.stop();
moves_fake._visible = false;
blockAnimation = false;
}
} else if (moves_fake._currentframe == 92) {
moves_fake.stop();
if (tempCount < (Number(movesLeft) - 23)) {
tempCount++;
moves_fake.brackets.text = ("(" + tempCount) + ")";
} else {
moves_mc._visible = true;
moves_fake._visible = false;
blockAnimation = false;
}
}
} else if (goClock) {
if (grid._rotation < goRot) {
grid._rotation = grid._rotation + 5;
} else {
moveBlocks = true;
goClock = false;
}
} else if (goAntiClock) {
if (grid._rotation > goRot) {
grid._rotation = grid._rotation - 5;
} else {
moveBlocks = true;
goAntiClock = false;
}
} else if (goFlip) {
if (changeScaleX) {
if (grid._xscale <= goScale) {
if (grid._xscale == goScale) {
moveBlocks = true;
changeScaleX = false;
goFlip = false;
} else {
grid._xscale = grid._xscale + 5;
}
} else if (grid._xscale == goScale) {
moveBlocks = true;
changeScaleX = false;
goFlip = false;
} else {
grid._xscale = grid._xscale - 5;
}
} else if (grid._yscale <= goScale) {
if (grid._yscale == goScale) {
moveBlocks = true;
changeScaleY = false;
goFlip = false;
} else {
grid._yscale = grid._yscale + 5;
}
} else if (grid._yscale == goScale) {
moveBlocks = true;
changeScaleY = false;
goFlip = false;
} else {
grid._yscale = grid._yscale - 5;
}
} else if (moveBlocks) {
if ((gridScaledX || (gridScaledY)) && (!(gridScaledX && (gridScaledY)))) {
if (gridDir == "right") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._x = grid["block" + _local6]._x + 5;
while (grid.edge.hitTest(grid["block" + _local6]._y + gridX, (grid["block" + _local6]._x + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x--;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, (grid["block" + _local6]._x + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x--;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "up") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._y = grid["block" + _local6]._y - 5;
while (grid.edge.hitTest(grid["block" + _local6]._x + gridX, ((-grid["block" + _local6]._y) + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y++;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, ((-grid["block" + _local6]._y) + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y++;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "left") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._x = grid["block" + _local6]._x - 5;
while (grid.edge.hitTest((-grid["block" + _local6]._y) + gridX, ((-grid["block" + _local6]._x) + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x++;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, ((-grid["block" + _local6]._x) + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x++;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "down") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._y = grid["block" + _local6]._y + 5;
while (grid.edge.hitTest((-grid["block" + _local6]._x) + gridX, (grid["block" + _local6]._y + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y--;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, (grid["block" + _local6]._y + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y--;
}
_local2++;
}
_local6++;
}
}
} else if (gridDir == "left") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._x = grid["block" + _local6]._x + 5;
while (grid.edge.hitTest((-grid["block" + _local6]._y) + gridX, (grid["block" + _local6]._x + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x--;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, (grid["block" + _local6]._x + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x--;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "up") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._y = grid["block" + _local6]._y - 5;
while (grid.edge.hitTest((-grid["block" + _local6]._x) + gridX, ((-grid["block" + _local6]._y) + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y++;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, ((-grid["block" + _local6]._y) + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y++;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "right") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._x = grid["block" + _local6]._x - 5;
while (grid.edge.hitTest(grid["block" + _local6]._y + gridX, ((-grid["block" + _local6]._x) + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x++;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, ((-grid["block" + _local6]._x) + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x++;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "down") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._y = grid["block" + _local6]._y + 5;
while (grid.edge.hitTest(grid["block" + _local6]._x + gridX, (grid["block" + _local6]._y + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y--;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, (grid["block" + _local6]._y + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y--;
}
_local2++;
}
_local6++;
}
}
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].hit) {
blocksHit++;
}
_local6++;
}
if (blocksHit == totalNumb) {
moveBlocks = false;
checkHit = true;
}
blocksHit = 0;
_local6 = 1;
while (_local6 <= id) {
grid["block" + _local6].hit = false;
_local6++;
}
} else if (checkHit) {
if ((gridScaledX || (gridScaledY)) && (!(gridScaledX && (gridScaledY)))) {
if (gridDir == "left") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, ((-grid["block" + _local6]._x) + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, ((-grid["block" + _local6]._x) + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._y) + gridX) + 17, (-grid["block" + _local6]._x) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._y) + gridX) - 17, (-grid["block" + _local6]._x) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "right") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, (grid["block" + _local6]._x + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, (grid["block" + _local6]._x + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._y + gridX) + 17, grid["block" + _local6]._x + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._y + gridX) - 17, grid["block" + _local6]._x + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "up") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, ((-grid["block" + _local6]._y) + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, ((-grid["block" + _local6]._y) + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._x + gridX) + 17, (-grid["block" + _local6]._y) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._x + gridX) - 17, (-grid["block" + _local6]._y) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "down") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, (grid["block" + _local6]._y + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, (grid["block" + _local6]._y + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._x) + gridX) + 17, grid["block" + _local6]._y + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._x) + gridX) - 17, grid["block" + _local6]._y + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
}
} else if (gridDir == "left") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, (grid["block" + _local6]._x + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, (grid["block" + _local6]._x + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._y) + gridX) + 17, grid["block" + _local6]._x + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._y) + gridX) - 17, grid["block" + _local6]._x + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "right") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, ((-grid["block" + _local6]._x) + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, ((-grid["block" + _local6]._x) + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._y + gridX) + 17, (-grid["block" + _local6]._x) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._y + gridX) - 17, (-grid["block" + _local6]._x) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "up") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, ((-grid["block" + _local6]._y) + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, ((-grid["block" + _local6]._y) + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._x) + gridX) + 17, (-grid["block" + _local6]._y) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._x) + gridX) - 17, (-grid["block" + _local6]._y) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "down") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, (grid["block" + _local6]._y + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, (grid["block" + _local6]._y + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._x + gridX) + 17, grid["block" + _local6]._y + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._x + gridX) - 17, grid["block" + _local6]._y + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
}
if (takeOutGreen) {
moveBlocks = true;
takeOutGreen = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "green") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutBlue) {
moveBlocks = true;
takeOutBlue = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "blue") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutRed) {
moveBlocks = true;
takeOutRed = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "red") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutOrange) {
moveBlocks = true;
takeOutOrange = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "orange") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutPurple) {
moveBlocks = true;
takeOutPurple = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "purple") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutYellow) {
moveBlocks = true;
takeOutYellow = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "yellow") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
checkHit = false;
} else if ((movesLeft == 0) && (totalNumb != numbGrey)) {
cross.play();
crossPlaying = true;
if (cross._currentframe == cross._totalframes) {
crossPlaying = false;
attempts++;
movesLeft = numbMoves;
grid._rotation = 0;
grid._xscale = 100;
grid._yscale = 100;
goClock = false;
goAntiClock = false;
goFlip = false;
gridDir = "down";
changeScaleX = false;
changeScaleY = false;
gridScaledX = false;
gridScaledY = false;
moveBlocks = true;
blocksHit = 0;
id = 0;
checkHit = false;
takeOutGreen = false;
takeOutBlue = false;
takeOutRed = false;
takeOutOrange = false;
takeOutPurple = false;
takeOutYellow = false;
finish = false;
moves = 0;
var _local3 = 0;
while (_local3 <= 8) {
var _local1 = 0;
while (_local1 <= 8) {
if (line[_local1][_local3] == 1) {
id++;
var _local5 = grid.attachMovie("green", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "green";
} else if (line[_local1][_local3] == 2) {
id++;
var _local5 = grid.attachMovie("blue", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "blue";
} else if (line[_local1][_local3] == 3) {
id++;
var _local5 = grid.attachMovie("red", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "red";
} else if (line[_local1][_local3] == 4) {
id++;
var _local5 = grid.attachMovie("orange", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "orange";
} else if (line[_local1][_local3] == 5) {
id++;
var _local5 = grid.attachMovie("purple", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "purple";
} else if (line[_local1][_local3] == 6) {
id++;
var _local5 = grid.attachMovie("yellow", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "yellow";
} else if (line[_local1][_local3] == 7) {
id++;
var _local5 = grid.attachMovie("grey", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "grey";
}
_local1++;
}
_local3++;
}
totalNumb = id;
}
}
if ((totalNumb == numbGrey) && (!finish)) {
finishFunc();
}
}
function die() {
this._alpha = this._alpha - 5;
if (this._alpha < 1) {
this.removeMovieClip();
}
}
function finishFunc() {
finish = true;
clearInterval(timerInt);
level_complete.play();
}
function timerUp() {
timer++;
}
if (backSound) {
backSound = false;
stopAllSounds();
}
if (!gameSound) {
gameSound = true;
bgSound.attachSound("gametrack.mp3");
bgSound.start(0, 9999);
}
var crossPlaying = false;
var timer = 0;
var attempts = 1;
var movesLeft = numbMoves;
var numbGrey = 0;
var goClock = false;
var goAntiClock = false;
var goFlip = false;
var gridDir = "down";
var goRot = 0;
var goScale = 0;
var changeScaleX = false;
var changeScaleY = false;
var gridScaledX = false;
var gridScaledY = false;
var moveBlocks = true;
var blocksHit = 0;
var id = 0;
var checkHit = false;
var takeOutGreen = false;
var takeOutBlue = false;
var takeOutRed = false;
var takeOutOrange = false;
var takeOutPurple = false;
var takeOutYellow = false;
var finish = false;
var moves = 0;
var gridX = grid._x;
var gridY = grid._y;
var blockAnimation = true;
var tempCount = 0;
moves_mc._visible = false;
grid.edge._visible = false;
grid._xscale = 100;
grid._yscale = 100;
var x = 0;
while (x <= 8) {
var y = 0;
while (y <= 8) {
if (line[y][x] == 1) {
id++;
var nest = grid.attachMovie("green", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "green";
} else if (line[y][x] == 2) {
id++;
var nest = grid.attachMovie("blue", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "blue";
} else if (line[y][x] == 3) {
id++;
var nest = grid.attachMovie("red", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "red";
} else if (line[y][x] == 4) {
id++;
var nest = grid.attachMovie("orange", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "orange";
} else if (line[y][x] == 5) {
id++;
var nest = grid.attachMovie("purple", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "purple";
} else if (line[y][x] == 6) {
id++;
var nest = grid.attachMovie("yellow", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "yellow";
} else if (line[y][x] == 7) {
numbGrey++;
id++;
var nest = grid.attachMovie("grey", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "grey";
}
y++;
}
x++;
}
var totalNumb = id;
clock.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
goClockFunc();
}
};
anticlock.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
goAntiFunc();
}
};
flip.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
moves++;
movesLeft--;
goFlip = true;
if ((gridDir == "left") || (gridDir == "right")) {
changeScaleX = true;
goScale = -grid._xscale;
if (gridScaledY && (gridScaledX)) {
gridScaledX = false;
} else if ((!gridScaledY) && (gridScaledX)) {
gridScaledX = false;
} else {
gridScaledX = true;
}
} else if (gridDir == "up") {
changeScaleY = true;
goScale = -grid._yscale;
if (gridScaledY && (gridScaledX)) {
gridDir = "down";
gridScaledY = false;
} else if (gridScaledY && (!gridScaledX)) {
gridDir = "down";
gridScaledY = false;
} else {
gridDir = "down";
gridScaledY = true;
}
} else if (gridDir == "down") {
changeScaleY = true;
goScale = -grid._yscale;
if (gridScaledY && (gridScaledX)) {
gridDir = "up";
gridScaledY = false;
} else if (gridScaledY && (!gridScaledX)) {
gridDir = "up";
gridScaledY = false;
} else {
gridDir = "up";
gridScaledY = true;
}
}
}
};
var dragGrid = false;
var prevX = 0;
var prevY = 0;
timerInt = setInterval(timerUp, 1000);
Frame 218
function goClockFunc() {
moves++;
movesLeft--;
goClock = true;
goRot = grid._rotation + 90;
if (goRot > 180) {
goRot = -180 + (goRot - 180);
grid._rotation = grid._rotation + 5;
}
if (gridDir == "down") {
gridDir = "left";
} else if (gridDir == "left") {
gridDir = "up";
} else if (gridDir == "up") {
gridDir = "right";
} else if (gridDir == "right") {
gridDir = "down";
}
}
function goAntiFunc() {
moves++;
movesLeft--;
goAntiClock = true;
goRot = grid._rotation - 90;
if (goRot < -180) {
goRot = 180 - ((-goRot) - 180);
grid._rotation = grid._rotation - 5;
}
if (gridDir == "down") {
gridDir = "right";
} else if (gridDir == "right") {
gridDir = "up";
} else if (gridDir == "up") {
gridDir = "left";
} else if (gridDir == "left") {
gridDir = "down";
}
}
function onMouseDown() {
if (grid.drag.hitTest(_xmouse, _ymouse, true)) {
dragGrid = true;
}
}
function onMouseUp() {
dragGrid = false;
}
function onMouseMove() {
if ((((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) && (dragGrid)) {
if (_xmouse < 275) {
if (_ymouse < 230) {
if (_ymouse < (prevY - 5)) {
goClockFunc();
} else if (_ymouse > (prevY + 5)) {
goAntiFunc();
} else if (_xmouse < (prevX - 5)) {
goAntiFunc();
} else if (_xmouse > (prevX + 5)) {
goClockFunc();
}
} else if (_ymouse < (prevY - 5)) {
goClockFunc();
} else if (_ymouse > (prevY + 5)) {
goAntiFunc();
} else if (_xmouse < (prevX - 5)) {
goClockFunc();
} else if (_xmouse > (prevX + 5)) {
goAntiFunc();
}
} else if (_ymouse < 230) {
if (_ymouse < (prevY - 5)) {
goAntiFunc();
} else if (_ymouse > (prevY + 5)) {
goClockFunc();
} else if (_xmouse < (prevX - 5)) {
goAntiFunc();
} else if (_xmouse > (prevX + 5)) {
goClockFunc();
}
} else if (_ymouse < (prevY - 5)) {
goAntiFunc();
} else if (_ymouse > (prevY + 5)) {
goClockFunc();
} else if (_xmouse < (prevX - 5)) {
goClockFunc();
} else if (_xmouse > (prevX + 5)) {
goAntiFunc();
}
}
prevX = _xmouse;
prevY = _ymouse;
}
function onEnterFrame() {
if (movesLeft > 23) {
moves_mc.gotoAndStop(25);
moves_mc.brackets.text = ("(" + (movesLeft - 23)) + ")";
} else {
moves_mc.gotoAndStop(Number(movesLeft) + 1);
}
if (blockAnimation) {
moves_fake.play();
if (Number(movesLeft) < 23) {
if (moves_fake._currentframe == ((3 * (Number(movesLeft) + 1)) + 18)) {
moves_mc._visible = true;
moves_fake.stop();
moves_fake._visible = false;
blockAnimation = false;
}
} else if (moves_fake._currentframe == 92) {
moves_fake.stop();
if (tempCount < (Number(movesLeft) - 23)) {
tempCount++;
moves_fake.brackets.text = ("(" + tempCount) + ")";
} else {
moves_mc._visible = true;
moves_fake._visible = false;
blockAnimation = false;
}
}
} else if (goClock) {
if (grid._rotation < goRot) {
grid._rotation = grid._rotation + 5;
} else {
moveBlocks = true;
goClock = false;
}
} else if (goAntiClock) {
if (grid._rotation > goRot) {
grid._rotation = grid._rotation - 5;
} else {
moveBlocks = true;
goAntiClock = false;
}
} else if (goFlip) {
if (changeScaleX) {
if (grid._xscale <= goScale) {
if (grid._xscale == goScale) {
moveBlocks = true;
changeScaleX = false;
goFlip = false;
} else {
grid._xscale = grid._xscale + 5;
}
} else if (grid._xscale == goScale) {
moveBlocks = true;
changeScaleX = false;
goFlip = false;
} else {
grid._xscale = grid._xscale - 5;
}
} else if (grid._yscale <= goScale) {
if (grid._yscale == goScale) {
moveBlocks = true;
changeScaleY = false;
goFlip = false;
} else {
grid._yscale = grid._yscale + 5;
}
} else if (grid._yscale == goScale) {
moveBlocks = true;
changeScaleY = false;
goFlip = false;
} else {
grid._yscale = grid._yscale - 5;
}
} else if (moveBlocks) {
if ((gridScaledX || (gridScaledY)) && (!(gridScaledX && (gridScaledY)))) {
if (gridDir == "right") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._x = grid["block" + _local6]._x + 5;
while (grid.edge.hitTest(grid["block" + _local6]._y + gridX, (grid["block" + _local6]._x + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x--;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, (grid["block" + _local6]._x + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x--;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "up") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._y = grid["block" + _local6]._y - 5;
while (grid.edge.hitTest(grid["block" + _local6]._x + gridX, ((-grid["block" + _local6]._y) + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y++;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, ((-grid["block" + _local6]._y) + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y++;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "left") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._x = grid["block" + _local6]._x - 5;
while (grid.edge.hitTest((-grid["block" + _local6]._y) + gridX, ((-grid["block" + _local6]._x) + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x++;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, ((-grid["block" + _local6]._x) + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x++;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "down") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._y = grid["block" + _local6]._y + 5;
while (grid.edge.hitTest((-grid["block" + _local6]._x) + gridX, (grid["block" + _local6]._y + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y--;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, (grid["block" + _local6]._y + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y--;
}
_local2++;
}
_local6++;
}
}
} else if (gridDir == "left") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._x = grid["block" + _local6]._x + 5;
while (grid.edge.hitTest((-grid["block" + _local6]._y) + gridX, (grid["block" + _local6]._x + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x--;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, (grid["block" + _local6]._x + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x--;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "up") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._y = grid["block" + _local6]._y - 5;
while (grid.edge.hitTest((-grid["block" + _local6]._x) + gridX, ((-grid["block" + _local6]._y) + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y++;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, ((-grid["block" + _local6]._y) + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y++;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "right") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._x = grid["block" + _local6]._x - 5;
while (grid.edge.hitTest(grid["block" + _local6]._y + gridX, ((-grid["block" + _local6]._x) + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x++;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, ((-grid["block" + _local6]._x) + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._x++;
}
_local2++;
}
_local6++;
}
} else if (gridDir == "down") {
var _local6 = 1;
while (_local6 <= id) {
grid["block" + _local6]._y = grid["block" + _local6]._y + 5;
while (grid.edge.hitTest(grid["block" + _local6]._x + gridX, (grid["block" + _local6]._y + gridY) + 14, true)) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y--;
}
var _local2 = 1;
while (_local2 <= id) {
while (grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, (grid["block" + _local6]._y + gridY) + 14, true) && (grid["block" + _local6] != grid["block" + _local2])) {
grid["block" + _local6].hit = true;
grid["block" + _local6]._y--;
}
_local2++;
}
_local6++;
}
}
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].hit) {
blocksHit++;
}
_local6++;
}
if (blocksHit == totalNumb) {
moveBlocks = false;
checkHit = true;
}
blocksHit = 0;
_local6 = 1;
while (_local6 <= id) {
grid["block" + _local6].hit = false;
_local6++;
}
} else if (checkHit) {
if ((gridScaledX || (gridScaledY)) && (!(gridScaledX && (gridScaledY)))) {
if (gridDir == "left") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, ((-grid["block" + _local6]._x) + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, ((-grid["block" + _local6]._x) + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._y) + gridX) + 17, (-grid["block" + _local6]._x) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._y) + gridX) - 17, (-grid["block" + _local6]._x) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "right") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, (grid["block" + _local6]._x + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, (grid["block" + _local6]._x + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._y + gridX) + 17, grid["block" + _local6]._x + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._y + gridX) - 17, grid["block" + _local6]._x + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "up") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, ((-grid["block" + _local6]._y) + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, ((-grid["block" + _local6]._y) + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._x + gridX) + 17, (-grid["block" + _local6]._y) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._x + gridX) - 17, (-grid["block" + _local6]._y) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "down") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, (grid["block" + _local6]._y + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, (grid["block" + _local6]._y + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._x) + gridX) + 17, grid["block" + _local6]._y + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._x) + gridX) - 17, grid["block" + _local6]._y + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
}
} else if (gridDir == "left") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, (grid["block" + _local6]._x + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._y) + gridX, (grid["block" + _local6]._x + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._y) + gridX) + 17, grid["block" + _local6]._x + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._y) + gridX) - 17, grid["block" + _local6]._x + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "right") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, ((-grid["block" + _local6]._x) + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._y + gridX, ((-grid["block" + _local6]._x) + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._y + gridX) + 17, (-grid["block" + _local6]._x) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._y + gridX) - 17, (-grid["block" + _local6]._x) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "up") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, ((-grid["block" + _local6]._y) + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((-grid["block" + _local6]._x) + gridX, ((-grid["block" + _local6]._y) + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._x) + gridX) + 17, (-grid["block" + _local6]._y) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(((-grid["block" + _local6]._x) + gridX) - 17, (-grid["block" + _local6]._y) + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
} else if (gridDir == "down") {
var _local6 = 1;
while (_local6 <= id) {
var _local4 = 0;
var _local2 = 1;
while (_local2 <= id) {
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, (grid["block" + _local6]._y + gridY) + 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest(grid["block" + _local6]._x + gridX, (grid["block" + _local6]._y + gridY) - 17, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._x + gridX) + 17, grid["block" + _local6]._y + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
if ((grid["block" + _local2].hitTest((grid["block" + _local6]._x + gridX) - 17, grid["block" + _local6]._y + gridY, true) && (grid["block" + _local6] != grid["block" + _local2])) && (grid["block" + _local6].colour == grid["block" + _local2].colour)) {
_local4++;
}
_local2++;
}
if (_local4 > 1) {
switch (grid["block" + _local6].colour) {
case "green" :
takeOutGreen = true;
break;
case "blue" :
takeOutBlue = true;
break;
case "red" :
takeOutRed = true;
break;
case "orange" :
takeOutOrange = true;
break;
case "purple" :
takeOutPurple = true;
break;
case "yellow" :
takeOutYellow = true;
}
}
_local4 = 0;
_local6++;
}
}
if (takeOutGreen) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutGreen = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "green") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutBlue) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutBlue = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "blue") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutRed) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutRed = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "red") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutOrange) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutOrange = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "orange") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutPurple) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutPurple = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "purple") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
if (takeOutYellow) {
blockSound = new Sound();
blockSound.attachSound("blockfade.mp3");
blockSound.start(0, 1);
moveBlocks = true;
takeOutYellow = false;
var _local6 = 1;
while (_local6 <= id) {
if (grid["block" + _local6].colour == "yellow") {
totalNumb--;
grid["block" + _local6].onEnterFrame = die;
}
_local6++;
}
}
checkHit = false;
} else if ((movesLeft == 0) && (totalNumb != numbGrey)) {
crossPlaying = true;
cross.play();
if (cross._currentframe == cross._totalframes) {
crossPlaying = false;
attempts++;
movesLeft = numbMoves;
grid._rotation = 0;
grid._xscale = 100;
grid._yscale = 100;
goClock = false;
goAntiClock = false;
goFlip = false;
gridDir = "down";
changeScaleX = false;
changeScaleY = false;
gridScaledX = false;
gridScaledY = false;
moveBlocks = true;
blocksHit = 0;
id = 0;
checkHit = false;
takeOutGreen = false;
takeOutBlue = false;
takeOutRed = false;
takeOutOrange = false;
takeOutPurple = false;
takeOutYellow = false;
finish = false;
moves = 0;
var _local3 = 0;
while (_local3 <= 8) {
var _local1 = 0;
while (_local1 <= 8) {
if (line[_local1][_local3] == 1) {
id++;
var _local5 = grid.attachMovie("green", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "green";
} else if (line[_local1][_local3] == 2) {
id++;
var _local5 = grid.attachMovie("blue", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "blue";
} else if (line[_local1][_local3] == 3) {
id++;
var _local5 = grid.attachMovie("red", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "red";
} else if (line[_local1][_local3] == 4) {
id++;
var _local5 = grid.attachMovie("orange", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "orange";
} else if (line[_local1][_local3] == 5) {
id++;
var _local5 = grid.attachMovie("purple", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "purple";
} else if (line[_local1][_local3] == 6) {
id++;
var _local5 = grid.attachMovie("yellow", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "yellow";
} else if (line[_local1][_local3] == 7) {
id++;
var _local5 = grid.attachMovie("grey", "block" + id, id);
_local5._x = (30 * _local3) - 120;
_local5._y = (30 * _local1) - 120;
_local5.colour = "grey";
}
_local1++;
}
_local3++;
}
totalNumb = id;
}
}
if ((totalNumb == numbGrey) && (!finish)) {
finishFunc();
}
}
function die() {
this._alpha = this._alpha - 5;
if (this._alpha < 1) {
this.removeMovieClip();
}
}
function finishFunc() {
finish = true;
clearInterval(timerInt);
level_complete.play();
}
function timerUp() {
timer++;
}
var line = new Array();
var temp = new Array();
level_code = level_code.substring(8, level_code.length - 5);
temp = level_code.split(";");
var numbMoves = temp[1];
var splitter = temp[0];
var i = 17;
while (i < splitter.length) {
splitter = (splitter.substr(0, i) + "#") + splitter.substr(i + 1, splitter.length);
i = i + 18;
}
line = splitter.split("#");
var i = 0;
while (i <= 8) {
line[i] = line[i].split(",");
i++;
}
if (backSound) {
backSound = false;
stopAllSounds();
}
if (!gameSound) {
gameSound = true;
bgSound.attachSound("gametrack.mp3");
bgSound.start(0, 9999);
}
levelView.levelText.text = "LEVEL: " + level;
var crossPlaying = false;
var timer = 0;
var attempts = 1;
var movesLeft = numbMoves;
var numbGrey = 0;
var goClock = false;
var goAntiClock = false;
var goFlip = false;
var gridDir = "down";
var goRot = 0;
var goScale = 0;
var changeScaleX = false;
var changeScaleY = false;
var gridScaledX = false;
var gridScaledY = false;
var moveBlocks = true;
var blocksHit = 0;
var id = 0;
var checkHit = false;
var takeOutGreen = false;
var takeOutBlue = false;
var takeOutRed = false;
var takeOutOrange = false;
var takeOutPurple = false;
var takeOutYellow = false;
var finish = false;
var moves = 0;
var gridX = grid._x;
var gridY = grid._y;
var blockAnimation = true;
var tempCount = 0;
moves_mc._visible = false;
grid.edge._visible = false;
grid._xscale = 100;
grid._yscale = 100;
var x = 0;
while (x <= 8) {
var y = 0;
while (y <= 8) {
if (line[y][x] == 1) {
id++;
var nest = grid.attachMovie("green", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "green";
} else if (line[y][x] == 2) {
id++;
var nest = grid.attachMovie("blue", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "blue";
} else if (line[y][x] == 3) {
id++;
var nest = grid.attachMovie("red", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "red";
} else if (line[y][x] == 4) {
id++;
var nest = grid.attachMovie("orange", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "orange";
} else if (line[y][x] == 5) {
id++;
var nest = grid.attachMovie("purple", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "purple";
} else if (line[y][x] == 6) {
id++;
var nest = grid.attachMovie("yellow", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "yellow";
} else if (line[y][x] == 7) {
numbGrey++;
id++;
var nest = grid.attachMovie("grey", "block" + id, id);
nest._x = (30 * x) - 120;
nest._y = (30 * y) - 120;
nest.colour = "grey";
}
y++;
}
x++;
}
var totalNumb = id;
clock.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
goClockFunc();
}
};
anticlock.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
goAntiFunc();
}
};
flip.onRelease = function () {
if (((((((!goClock) && (!goAntiClock)) && (!goFlip)) && (!moveBlocks)) && (!checkHit)) && (!finish)) && (!crossPlaying)) {
moves++;
movesLeft--;
goFlip = true;
if ((gridDir == "left") || (gridDir == "right")) {
changeScaleX = true;
goScale = -grid._xscale;
if (gridScaledY && (gridScaledX)) {
gridScaledX = false;
} else if ((!gridScaledY) && (gridScaledX)) {
gridScaledX = false;
} else {
gridScaledX = true;
}
} else if (gridDir == "up") {
changeScaleY = true;
goScale = -grid._yscale;
if (gridScaledY && (gridScaledX)) {
gridDir = "down";
gridScaledY = false;
} else if (gridScaledY && (!gridScaledX)) {
gridDir = "down";
gridScaledY = false;
} else {
gridDir = "down";
gridScaledY = true;
}
} else if (gridDir == "down") {
changeScaleY = true;
goScale = -grid._yscale;
if (gridScaledY && (gridScaledX)) {
gridDir = "up";
gridScaledY = false;
} else if (gridScaledY && (!gridScaledX)) {
gridDir = "up";
gridScaledY = false;
} else {
gridDir = "up";
gridScaledY = true;
}
}
}
};
var dragGrid = false;
var prevX = 0;
var prevY = 0;
timerInt = setInterval(timerUp, 1000);
Frame 219
level++;
if (level > 30) {
delete onEnterFrame;
clearInterval(timerInt);
_root.gotoAndPlay("credits");
} else {
if (level > saved.data.currLevel) {
saved.data.currLevel = level;
}
level_code = _root[("level" + level) + "_code"];
saved.data["lvl" + level] = 1;
prevFrame();
}
Frame 489
_root.gotoAndPlay("firstmenu");
Symbol 34 Button
on (release) {
_root.play();
}
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 10
stop();
Symbol 52 Button
on (release) {
_root.nextFrame();
}
Symbol 58 MovieClip Frame 1
if (_root.timer >= 36000) {
hours = 9;
minutes = 99;
seconds = 99;
} else {
meet = 0;
seconds = 0;
hours = 0;
minutes = 0;
while (meet < _root.timer) {
meet++;
seconds++;
if (seconds == 60) {
minutes++;
seconds = 0;
}
if (minutes == 60) {
hours++;
minutes = 0;
}
}
if (seconds < 10) {
seconds = "0" + seconds;
}
if (minutes < 10) {
minutes = "0" + minutes;
}
}
var timer = ((((hours + ":") + minutes) + ":") + seconds);
var attempts = _root.attempts;
var moves = _root.moves;
Symbol 59 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 20
stop();
Symbol 72 Button
on (release) {
play();
}
Symbol 96 Button
on (release) {
gotoAndPlay (2);
}
Symbol 97 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 432
stop();
Symbol 104 Button
on (release) {
getURL ("http://www.mindless-games.com/", "_blank");
}
Symbol 108 Button
on (release) {
getURL ("http://armorgames.com/", "_blank");
}
Symbol 112 Button
on (release) {
getURL ("http://armorblog.com/", "_blank");
}
Symbol 115 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 2
_root.bgSound.setVolume(0);
Symbol 115 MovieClip Frame 21
stop();
Symbol 115 MovieClip Frame 22
_root.bgSound.setVolume(100);
Symbol 133 Button
on (press) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 136 MovieClip Frame 1
_root.stop();
gotoAndPlay (2);
Symbol 136 MovieClip Frame 159
_root.play();
Symbol 152 MovieClip Frame 1
startT.text = _root.saved.data.sc;
stop();
Symbol 161 Button
on (release) {
this.enabled = false;
getURL ("http://armorgames.com/free-website-games", "_blank");
}
Symbol 162 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 168 Button
on (release) {
_root.gotoAndStop("loader");
}
Symbol 172 Button
on (release) {
_root.gotoAndPlay("creator");
}
Symbol 177 Button
on (release) {
getURL ("http://www.mindless-games.com/posts/submit-your-gravity-grid-levels", "_blank");
}
Symbol 181 Button
on (release) {
getURL ("http://armorgames.com/", "_blank");
}
Symbol 185 Button
on (release) {
play();
}
Symbol 189 MovieClip Frame 1
startT.text = _root.saved.data.sc;
stop();
Symbol 189 MovieClip Frame 2
startT.text = _root.saved.data.sc;
Symbol 189 MovieClip Frame 3
startT.text = _root.saved.data.sc;
Symbol 194 Button
on (release) {
_root.level_code = _root.level1_code;
_root.level = 1;
_root.gotoAndStop("levels");
}
Symbol 198 Button
on (release) {
_root.level_code = _root.level2_code;
_root.level = 2;
_root.gotoAndStop("levels");
}
Symbol 203 Button
on (release) {
_root.level_code = _root.level3_code;
_root.level = 3;
_root.gotoAndStop("levels");
}
Symbol 207 Button
on (release) {
_root.level_code = _root.level4_code;
_root.level = 4;
_root.gotoAndStop("levels");
}
Symbol 211 Button
on (release) {
_root.level_code = _root.level5_code;
_root.level = 5;
_root.gotoAndStop("levels");
}
Symbol 215 Button
on (release) {
_root.level_code = _root.level6_code;
_root.level = 6;
_root.gotoAndStop("levels");
}
Symbol 219 Button
on (release) {
_root.level_code = _root.level7_code;
_root.level = 7;
_root.gotoAndStop("levels");
}
Symbol 223 Button
on (release) {
_root.level_code = _root.level8_code;
_root.level = 8;
_root.gotoAndStop("levels");
}
Symbol 227 Button
on (release) {
_root.level_code = _root.level9_code;
_root.level = 9;
_root.gotoAndStop("levels");
}
Symbol 231 Button
on (release) {
_root.level_code = _root.level10_code;
_root.level = 10;
_root.gotoAndStop("levels");
}
Symbol 235 Button
on (release) {
_root.level_code = _root.level11_code;
_root.level = 11;
_root.gotoAndStop("levels");
}
Symbol 239 Button
on (release) {
_root.level_code = _root.level12_code;
_root.level = 12;
_root.gotoAndStop("levels");
}
Symbol 243 Button
on (release) {
_root.level_code = _root.level13_code;
_root.level = 13;
_root.gotoAndStop("levels");
}
Symbol 247 Button
on (release) {
_root.level_code = _root.level14_code;
_root.level = 14;
_root.gotoAndStop("levels");
}
Symbol 251 Button
on (release) {
_root.level_code = _root.level15_code;
_root.level = 15;
_root.gotoAndStop("levels");
}
Symbol 255 Button
on (release) {
_root.level_code = _root.level16_code;
_root.level = 16;
_root.gotoAndStop("levels");
}
Symbol 259 Button
on (release) {
_root.level_code = _root.level17_code;
_root.level = 17;
_root.gotoAndStop("levels");
}
Symbol 263 Button
on (release) {
_root.level_code = _root.level18_code;
_root.level = 18;
_root.gotoAndStop("levels");
}
Symbol 267 Button
on (release) {
_root.level_code = _root.level19_code;
_root.level = 19;
_root.gotoAndStop("levels");
}
Symbol 271 Button
on (release) {
_root.level_code = _root.level20_code;
_root.level = 20;
_root.gotoAndStop("levels");
}
Symbol 275 Button
on (release) {
_root.level_code = _root.level21_code;
_root.level = 21;
_root.gotoAndStop("levels");
}
Symbol 279 Button
on (release) {
_root.level_code = _root.level22_code;
_root.level = 22;
_root.gotoAndStop("levels");
}
Symbol 283 Button
on (release) {
_root.level_code = _root.level23_code;
_root.level = 23;
_root.gotoAndStop("levels");
}
Symbol 287 Button
on (release) {
_root.level_code = _root.level24_code;
_root.level = 24;
_root.gotoAndStop("levels");
}
Symbol 291 Button
on (release) {
_root.level_code = _root.level25_code;
_root.level = 25;
_root.gotoAndStop("levels");
}
Symbol 295 Button
on (release) {
_root.level_code = _root.level26_code;
_root.level = 26;
_root.gotoAndStop("levels");
}
Symbol 300 Button
on (release) {
_root.level_code = _root.level27_code;
_root.level = 27;
_root.gotoAndStop("levels");
}
Symbol 304 Button
on (release) {
_root.level_code = _root.level28_code;
_root.level = 28;
_root.gotoAndStop("levels");
}
Symbol 309 Button
on (release) {
_root.level_code = _root.level29_code;
_root.level = 29;
_root.gotoAndStop("levels");
}
Symbol 313 Button
on (release) {
_root.level_code = _root.level30_code;
_root.level = 30;
_root.gotoAndStop("levels");
}
Symbol 319 Button
on (release) {
_root.onEnterFrame = function () {
_root.prevFrame();
};
}
Instance of Symbol 200 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl2);
}
Instance of Symbol 204 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl3);
}
Instance of Symbol 208 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl4);
}
Instance of Symbol 212 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl5);
}
Instance of Symbol 216 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl6);
}
Instance of Symbol 220 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl7);
}
Instance of Symbol 224 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl8);
}
Instance of Symbol 228 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl9);
}
Instance of Symbol 232 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl10);
}
Instance of Symbol 236 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl11);
}
Instance of Symbol 240 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl12);
}
Instance of Symbol 244 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl13);
}
Instance of Symbol 248 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl14);
}
Instance of Symbol 252 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl15);
}
Instance of Symbol 256 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl16);
}
Instance of Symbol 260 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl17);
}
Instance of Symbol 264 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl18);
}
Instance of Symbol 268 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl19);
}
Instance of Symbol 272 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl20);
}
Instance of Symbol 276 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl21);
}
Instance of Symbol 280 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl22);
}
Instance of Symbol 284 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl23);
}
Instance of Symbol 288 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl24);
}
Instance of Symbol 292 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl25);
}
Instance of Symbol 296 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl26);
}
Instance of Symbol 301 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl27);
}
Instance of Symbol 305 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl28);
}
Instance of Symbol 310 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl29);
}
Instance of Symbol 314 MovieClip in Symbol 320 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl30);
}
Instance of Symbol 200 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl2);
}
Instance of Symbol 204 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl3);
}
Instance of Symbol 208 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl4);
}
Instance of Symbol 212 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl5);
}
Instance of Symbol 216 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl6);
}
Instance of Symbol 220 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl7);
}
Instance of Symbol 224 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl8);
}
Instance of Symbol 228 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl9);
}
Instance of Symbol 232 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl10);
}
Instance of Symbol 236 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl11);
}
Instance of Symbol 240 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl12);
}
Instance of Symbol 244 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl13);
}
Instance of Symbol 248 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl14);
}
Instance of Symbol 252 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl15);
}
Instance of Symbol 256 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl16);
}
Instance of Symbol 260 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl17);
}
Instance of Symbol 264 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl18);
}
Instance of Symbol 268 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl19);
}
Instance of Symbol 272 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl20);
}
Instance of Symbol 276 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl21);
}
Instance of Symbol 280 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl22);
}
Instance of Symbol 284 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl23);
}
Instance of Symbol 288 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl24);
}
Instance of Symbol 292 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl25);
}
Instance of Symbol 296 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl26);
}
Instance of Symbol 301 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl27);
}
Instance of Symbol 305 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl28);
}
Instance of Symbol 310 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl29);
}
Instance of Symbol 314 MovieClip in Symbol 323 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(_root.saved.data.lvl30);
}
Symbol 334 Button
on (release) {
delete onMouseDown;
delete onMouseMove;
nextFrame();
}
Symbol 337 Button
on (release) {
delete onMouseDown;
delete onMouseMove;
_root.gotoAndPlay("menu");
}
Symbol 353 Button
on (release) {
if (finish) {
delete onEnterFrame;
nextFrame();
}
}
Symbol 357 Button
on (release) {
delete onEnterFrame;
prevFrame();
}
Symbol 358 Button
on (release) {
delete onEnterFrame;
_root.gotoAndPlay("menu");
}
Symbol 367 Button
on (release) {
_root.gotoAndPlay("menu");
}
Symbol 371 Button
on (release) {
System.setClipboard(paste);
}
Symbol 378 Button
on (release) {
nextFrame();
}
Symbol 380 Button
on (release) {
clearInterval(timerInt);
_root.gotoAndPlay("menu");
}
Symbol 389 Button
on (release) {
delete _root.onEnterFrame;
_root.gotoAndStop("loader");
}
Symbol 393 MovieClip Frame 1
if (_root.timer >= 36000) {
hours = 9;
minutes = 99;
seconds = 99;
} else {
meet = 0;
seconds = 0;
hours = 0;
minutes = 0;
while (meet < _root.timer) {
meet++;
seconds++;
if (seconds == 60) {
minutes++;
seconds = 0;
}
if (minutes == 60) {
hours++;
minutes = 0;
}
}
if (seconds < 10) {
seconds = "0" + seconds;
}
if (minutes < 10) {
minutes = "0" + minutes;
}
}
var timer = ((((hours + ":") + minutes) + ":") + seconds);
var attempts = _root.attempts;
var moves = _root.moves;
Symbol 394 MovieClip Frame 1
stop();
Symbol 394 MovieClip Frame 20
stop();
Symbol 397 MovieClip Frame 1
stop();
Symbol 398 Button
on (release) {
delete onEnterFrame;
clearInterval(timerInt);
_root.gotoAndPlay("menu");
}