Frame 1
var current_cell = 0;
var current_vex = 0;
var myVEX;
var INITIALIZE_GAME = 0;
var ORIGSET = 0;
var ORDER;
var mySOLUTION;
var xVEXPOS;
var yVEXPOS;
_level0.highest = "8";
stop();
Instance of Symbol 39 MovieClip "VEX0" in Frame 1
/* no clip actions */
Frame 2
stop();
Symbol 4 Button
on (press) {
_root.HELP_MOVIE.gotoAndPlay(2);
}
on (release, releaseOutside) {
_root.HELP_MOVIE.gotoAndPlay(1);
}
Symbol 7 MovieClip Frame 1
stop();
Symbol 7 MovieClip Frame 2
stop();
Symbol 12 Button
on (press) {
_root.INITIALIZE_GAME = 0;
}
Symbol 14 Button
on (press) {
_root.mySOLUTION = new Array(99, 99, 99, 99, 99, 99, 99, 99, 99);
i = 0;
while (i < 9) {
_root["VEX" + i]._x = _root.xVEXPOS[i];
_root["VEX" + i]._y = _root.yVEXPOS[i];
i++;
}
}
Symbol 19 MovieClip Frame 1
stop();
Symbol 19 MovieClip Frame 2
stop();
Symbol 20 MovieClip Frame 1
function detCURRCELL(VEXNUM) {
XPOSVEX = getProperty(eval ("_root.VEX" + VEXNUM), _x) + (getProperty(eval ("_root.VEX" + VEXNUM), _width) / 2);
YPOSVEX = getProperty(eval ("_root.VEX" + VEXNUM), _y) + (getProperty(eval ("_root.VEX" + VEXNUM), _height) / 2);
CELLWIDTH = getProperty(_root.CELL1, _width);
XPOSCELL1 = getProperty(_root.CELL1, _x);
YPOSCELL1 = getProperty(_root.CELL1, _y);
XPOSCELL2 = getProperty(_root.CELL2, _x);
YPOSCELL2 = getProperty(_root.CELL2, _y);
XPOSCELL3 = getProperty(_root.CELL3, _x);
YPOSCELL3 = getProperty(_root.CELL3, _y);
XPOSCELL4 = getProperty(_root.CELL4, _x);
YPOSCELL4 = getProperty(_root.CELL4, _y);
XPOSCELL5 = getProperty(_root.CELL5, _x);
YPOSCELL5 = getProperty(_root.CELL5, _y);
XPOSCELL6 = getProperty(_root.CELL6, _x);
YPOSCELL6 = getProperty(_root.CELL6, _y);
XPOSCELL7 = getProperty(_root.CELL7, _x);
YPOSCELL7 = getProperty(_root.CELL7, _y);
XPOSCELL8 = getProperty(_root.CELL8, _x);
YPOSCELL8 = getProperty(_root.CELL8, _y);
XPOSCELL9 = getProperty(_root.CELL9, _x);
YPOSCELL9 = getProperty(_root.CELL9, _y);
if (((XPOSCELL1 < XPOSVEX) && (XPOSVEX < (XPOSCELL1 + CELLWIDTH))) && ((YPOSCELL1 < YPOSVEX) && (YPOSVEX < (YPOSCELL1 + CELLWIDTH)))) {
current_cell = 1;
} else if (((XPOSCELL2 < XPOSVEX) && (XPOSVEX < (XPOSCELL2 + CELLWIDTH))) && ((YPOSCELL2 < YPOSVEX) && (YPOSVEX < (YPOSCELL2 + CELLWIDTH)))) {
current_cell = 2;
} else if (((XPOSCELL3 < XPOSVEX) && (XPOSVEX < (XPOSCELL3 + CELLWIDTH))) && ((YPOSCELL3 < YPOSVEX) && (YPOSVEX < (YPOSCELL3 + CELLWIDTH)))) {
current_cell = 3;
} else if (((XPOSCELL4 < XPOSVEX) && (XPOSVEX < (XPOSCELL4 + CELLWIDTH))) && ((YPOSCELL4 < YPOSVEX) && (YPOSVEX < (YPOSCELL4 + CELLWIDTH)))) {
current_cell = 4;
} else if (((XPOSCELL5 < XPOSVEX) && (XPOSVEX < (XPOSCELL5 + CELLWIDTH))) && ((YPOSCELL5 < YPOSVEX) && (YPOSVEX < (YPOSCELL5 + CELLWIDTH)))) {
current_cell = 5;
} else if (((XPOSCELL6 < XPOSVEX) && (XPOSVEX < (XPOSCELL6 + CELLWIDTH))) && ((YPOSCELL6 < YPOSVEX) && (YPOSVEX < (YPOSCELL6 + CELLWIDTH)))) {
current_cell = 6;
} else if (((XPOSCELL7 < XPOSVEX) && (XPOSVEX < (XPOSCELL7 + CELLWIDTH))) && ((YPOSCELL7 < YPOSVEX) && (YPOSVEX < (YPOSCELL7 + CELLWIDTH)))) {
current_cell = 7;
} else if (((XPOSCELL8 < XPOSVEX) && (XPOSVEX < (XPOSCELL8 + CELLWIDTH))) && ((YPOSCELL8 < YPOSVEX) && (YPOSVEX < (YPOSCELL8 + CELLWIDTH)))) {
current_cell = 8;
} else if (((XPOSCELL9 < XPOSVEX) && (XPOSVEX < (XPOSCELL9 + CELLWIDTH))) && ((YPOSCELL9 < YPOSVEX) && (YPOSVEX < (YPOSCELL9 + CELLWIDTH)))) {
current_cell = 9;
} else {
current_cell = 99;
}
return(current_cell);
}
Symbol 22 Button
on (release) {
getURL ("http://www.anthony.ca", "_blank");
}
Symbol 32 Button
on (press) {
this.swapDepths("_level0:VEX" + _level0:highest);
Set("_level0:highest", substring(_name, 4, 1));
_root.current_vex = _name;
_root.myVEX = Number(substring(_name, 4, 1));
CURRCELL = _root.DCELL.detCURRCELL(_root.myVEX);
if (CURRCELL != 99) {
_root.mySOLUTION[CURRCELL - 1] = 99;
}
startDrag (this);
}
on (release) {
var CURRVEXNUM = Number(substring(_name, 4, 1));
if ((_root.mySOLUTION[_root.current_cell - 1] == 99) && (_root.CSOL.checkMatch(CURRVEXNUM) == 1)) {
this._x = _root["CELL" + _root.current_cell]._x;
this._y = _root["CELL" + _root.current_cell]._y;
_root.mySOLUTION[_root.current_cell - 1] = CURRVEXNUM;
} else {
this._x = _root.xVEXPOS[CURRVEXNUM];
this._y = _root.yVEXPOS[CURRVEXNUM];
}
_root.current_vex = 0;
stopDrag();
}
Symbol 40 MovieClip Frame 1
XPOSVEX = getProperty(eval ("_root." + _root.current_vex), _x) + (getProperty(eval ("_root." + _root.current_vex), _width) / 2);
YPOSVEX = getProperty(eval ("_root." + _root.current_vex), _y) + (getProperty(eval ("_root." + _root.current_vex), _height) / 2);
CELLWIDTH = getProperty(_root.CELL1, _width);
XPOSCELL1 = getProperty(_root.CELL1, _x);
YPOSCELL1 = getProperty(_root.CELL1, _y);
XPOSCELL2 = getProperty(_root.CELL2, _x);
YPOSCELL2 = getProperty(_root.CELL2, _y);
XPOSCELL3 = getProperty(_root.CELL3, _x);
YPOSCELL3 = getProperty(_root.CELL3, _y);
XPOSCELL4 = getProperty(_root.CELL4, _x);
YPOSCELL4 = getProperty(_root.CELL4, _y);
XPOSCELL5 = getProperty(_root.CELL5, _x);
YPOSCELL5 = getProperty(_root.CELL5, _y);
XPOSCELL6 = getProperty(_root.CELL6, _x);
YPOSCELL6 = getProperty(_root.CELL6, _y);
XPOSCELL7 = getProperty(_root.CELL7, _x);
YPOSCELL7 = getProperty(_root.CELL7, _y);
XPOSCELL8 = getProperty(_root.CELL8, _x);
YPOSCELL8 = getProperty(_root.CELL8, _y);
XPOSCELL9 = getProperty(_root.CELL9, _x);
YPOSCELL9 = getProperty(_root.CELL9, _y);
if (((XPOSCELL1 < XPOSVEX) && (XPOSVEX < (XPOSCELL1 + CELLWIDTH))) && ((YPOSCELL1 < YPOSVEX) && (YPOSVEX < (YPOSCELL1 + CELLWIDTH)))) {
_root.current_cell = 1;
_root.CELL1.gotoAndStop(2);
} else if (((XPOSCELL2 < XPOSVEX) && (XPOSVEX < (XPOSCELL2 + CELLWIDTH))) && ((YPOSCELL2 < YPOSVEX) && (YPOSVEX < (YPOSCELL2 + CELLWIDTH)))) {
_root.current_cell = 2;
_root.CELL2.gotoAndStop(2);
} else if (((XPOSCELL3 < XPOSVEX) && (XPOSVEX < (XPOSCELL3 + CELLWIDTH))) && ((YPOSCELL3 < YPOSVEX) && (YPOSVEX < (YPOSCELL3 + CELLWIDTH)))) {
_root.current_cell = 3;
_root.CELL3.gotoAndStop(2);
} else if (((XPOSCELL4 < XPOSVEX) && (XPOSVEX < (XPOSCELL4 + CELLWIDTH))) && ((YPOSCELL4 < YPOSVEX) && (YPOSVEX < (YPOSCELL4 + CELLWIDTH)))) {
_root.current_cell = 4;
_root.CELL4.gotoAndStop(2);
} else if (((XPOSCELL5 < XPOSVEX) && (XPOSVEX < (XPOSCELL5 + CELLWIDTH))) && ((YPOSCELL5 < YPOSVEX) && (YPOSVEX < (YPOSCELL5 + CELLWIDTH)))) {
_root.current_cell = 5;
_root.CELL5.gotoAndStop(2);
} else if (((XPOSCELL6 < XPOSVEX) && (XPOSVEX < (XPOSCELL6 + CELLWIDTH))) && ((YPOSCELL6 < YPOSVEX) && (YPOSVEX < (YPOSCELL6 + CELLWIDTH)))) {
_root.current_cell = 6;
_root.CELL6.gotoAndStop(2);
} else if (((XPOSCELL7 < XPOSVEX) && (XPOSVEX < (XPOSCELL7 + CELLWIDTH))) && ((YPOSCELL7 < YPOSVEX) && (YPOSVEX < (YPOSCELL7 + CELLWIDTH)))) {
_root.current_cell = 7;
_root.CELL7.gotoAndStop(2);
} else if (((XPOSCELL8 < XPOSVEX) && (XPOSVEX < (XPOSCELL8 + CELLWIDTH))) && ((YPOSCELL8 < YPOSVEX) && (YPOSVEX < (YPOSCELL8 + CELLWIDTH)))) {
_root.current_cell = 8;
_root.CELL8.gotoAndStop(2);
} else if (((XPOSCELL9 < XPOSVEX) && (XPOSVEX < (XPOSCELL9 + CELLWIDTH))) && ((YPOSCELL9 < YPOSVEX) && (YPOSVEX < (YPOSCELL9 + CELLWIDTH)))) {
_root.current_cell = 9;
_root.CELL9.gotoAndStop(2);
} else {
_root.current_cell = 99;
}
i = 0;
while (i < 10) {
if (_root.current_cell != i) {
_root["CELL" + i].gotoAndStop(1);
}
i++;
}
Symbol 41 MovieClip Frame 1
var posArray = new Array();
var vPOS = new Array();
if (_root.INITIALIZE_GAME == 0) {
if (_root.ORIGSET == 0) {
_root.xVEXPOS = new Array(9);
_root.yVEXPOS = new Array(9);
i = 0;
while (i < 9) {
_root.xVEXPOS[i] = _root["VEX" + i]._x;
_root.yVEXPOS[i] = _root["VEX" + i]._y;
i++;
}
_root.ORIGSET = 1;
} else {
i = 0;
while (i < 9) {
_root["VEX" + i]._x = _root.xVEXPOS[i];
_root["VEX" + i]._y = _root.yVEXPOS[i];
i++;
}
}
i = 0;
while (i < 9) {
_root["VEX" + i].LEFT_NUMBER = 1 + random(9);
_root["VEX" + i].RIGHT_NUMBER = 1 + random(9);
_root["VEX" + i].TOP_NUMBER = 1 + random(9);
_root["VEX" + i].BOTTOM_NUMBER = 1 + random(9);
posArray[i] = ((1 + random(9)) + "p") + i;
i++;
}
posArray.sort();
i = 0;
while (i < 9) {
vPOS[i] = substring(posArray[i], 3, 1);
i++;
}
_root.ORDER = vPOS;
_root.mySOLUTION = new Array(99, 99, 99, 99, 99, 99, 99, 99, 99);
_root["VEX" + vPOS[4]].LEFT_NUMBER = _root["VEX" + vPOS[3]].RIGHT_NUMBER;
_root["VEX" + vPOS[4]].RIGHT_NUMBER = _root["VEX" + vPOS[5]].LEFT_NUMBER;
_root["VEX" + vPOS[4]].TOP_NUMBER = _root["VEX" + vPOS[1]].BOTTOM_NUMBER;
_root["VEX" + vPOS[4]].BOTTOM_NUMBER = _root["VEX" + vPOS[7]].TOP_NUMBER;
_root["VEX" + vPOS[0]].RIGHT_NUMBER = _root["VEX" + vPOS[1]].LEFT_NUMBER;
_root["VEX" + vPOS[0]].BOTTOM_NUMBER = _root["VEX" + vPOS[3]].TOP_NUMBER;
_root["VEX" + vPOS[1]].RIGHT_NUMBER = _root["VEX" + vPOS[2]].LEFT_NUMBER;
_root["VEX" + vPOS[2]].BOTTOM_NUMBER = _root["VEX" + vPOS[5]].TOP_NUMBER;
_root["VEX" + vPOS[5]].BOTTOM_NUMBER = _root["VEX" + vPOS[8]].TOP_NUMBER;
_root["VEX" + vPOS[8]].LEFT_NUMBER = _root["VEX" + vPOS[7]].RIGHT_NUMBER;
_root["VEX" + vPOS[7]].LEFT_NUMBER = _root["VEX" + vPOS[6]].RIGHT_NUMBER;
_root["VEX" + vPOS[6]].TOP_NUMBER = _root["VEX" + vPOS[3]].BOTTOM_NUMBER;
_root.INITIALIZE_GAME = 1;
}
Symbol 42 MovieClip Frame 1
function checkMatch(vNUM) {
var PASS = 0;
var NOT_MATCHED = 0;
var CELL_NUM = (_root.current_cell - 1);
if (((CELL_NUM - 3) >= 0) && (_root.mySOLUTION[CELL_NUM - 3] != 99)) {
if (_root["VEX" + vNUM].TOP_NUMBER != _root["VEX" + _root.mySOLUTION[CELL_NUM - 3]].BOTTOM_NUMBER) {
NOT_MATCHED = NOT_MATCHED + 1;
}
}
if ((8 >= (CELL_NUM + 3)) && (_root.mySOLUTION[CELL_NUM + 3] != 99)) {
if (_root["VEX" + vNUM].BOTTOM_NUMBER != _root["VEX" + _root.mySOLUTION[CELL_NUM + 3]].TOP_NUMBER) {
NOT_MATCHED = NOT_MATCHED + 1;
}
}
if (((CELL_NUM % 3) != 0) && (_root.mySOLUTION[CELL_NUM - 1] != 99)) {
if (_root["VEX" + vNUM].LEFT_NUMBER != _root["VEX" + _root.mySOLUTION[CELL_NUM - 1]].RIGHT_NUMBER) {
NOT_MATCHED = NOT_MATCHED + 1;
}
}
if (((CELL_NUM % 3) != 2) && (_root.mySOLUTION[CELL_NUM + 1] != 99)) {
if (_root["VEX" + vNUM].RIGHT_NUMBER != _root["VEX" + _root.mySOLUTION[CELL_NUM + 1]].LEFT_NUMBER) {
NOT_MATCHED = NOT_MATCHED + 1;
}
}
if (NOT_MATCHED == 0) {
PASS = 1;
}
return(PASS);
}
Symbol 43 MovieClip Frame 1
WIN = 1;
i = 0;
while (i < 10) {
if (_root.mySOLUTION[i] == 99) {
WIN = 0;
}
i++;
}
if (WIN == 1) {
_root.play();
gotoAndPlay (1);
}
Symbol 46 Button
on (release) {
gotoAndPlay (1);
}