Frame 1
function EditorMode() {
initVariables();
AttachGameBoard();
createGameArray();
loadGameArrayOnBoard();
refreshedSmall = (refreshedBig = 0);
needNewGame = false;
}
function initVariables() {
if (gameType == 6) {
blockW = 3;
blockH = 2;
} else if (gameType == 8) {
blockW = 4;
blockH = 2;
} else if (gameType == 12) {
blockW = 4;
blockH = 3;
} else {
blockW = Math.sqrt(gameType);
blockH = Math.sqrt(gameType);
}
if (gameType == 6) {
gameW = 2;
gameH = 3;
} else if (gameType == 8) {
gameW = 2;
gameH = 4;
} else if (gameType == 12) {
gameW = 3;
gameH = 4;
} else {
gameW = (gameH = Math.sqrt(gameType));
}
gameState = gameStatePlaying;
}
function AttachGameBoard() {
var _local8 = (350 - (gameW * 3)) / (gameW * blockW);
var _local7 = (350 - (gameH * 3)) / (gameH * blockH);
var _local9 = "element" + gameType;
var _local10 = 100;
var _local6 = 0;
while (_local6 < gameW) {
var _local5 = 0;
while (_local5 < gameH) {
var _local4 = 0;
while (_local4 < blockW) {
var _local3 = 0;
while (_local3 < blockH) {
var _local2 = (("block" + ((_local6 * blockW) + _local4)) + "_") + ((_local5 * blockH) + _local3);
attachMovie(_local9, _local2, _local10++);
_root[_local2]._x = (DX + (((_local6 * blockW) + _local4) * _local8)) + (_local6 * 3);
_root[_local2]._y = (DY + (((_local5 * blockH) + _local3) * _local7)) + (_local5 * 3);
_root[_local2].i = (_local6 * blockW) + _local4;
_root[_local2].j = (_local5 * blockH) + _local3;
_root[_local2].state = 2;
_local3++;
}
_local4++;
}
_local5++;
}
_local6++;
}
}
function removeGameElements() {
var _local5 = 0;
while (_local5 < gameW) {
var _local4 = 0;
while (_local4 < gameH) {
var _local2 = 0;
while (_local2 < blockW) {
var _local1 = 0;
while (_local1 < blockH) {
var _local3 = (("block" + ((_local5 * blockW) + _local2)) + "_") + ((_local4 * blockH) + _local1);
removeMovieClip(_local3);
_local1++;
}
_local2++;
}
_local4++;
}
_local5++;
}
}
function createGameArray() {
board = new Array(gameType);
var _local2 = 0;
while (_local2 < gameType) {
board[_local2] = new Array(gameType);
_local2++;
}
_local2 = 0;
while (_local2 < gameType) {
var _local1 = 0;
while (_local1 < gameType) {
board[_local2][_local1] = 0;
_local1++;
}
_local2++;
}
}
function loadGameArrayOnBoard() {
var _local3 = 0;
while (_local3 < gameType) {
var _local2 = 0;
while (_local2 < gameType) {
var _local4 = (("block" + _local3) + "_") + _local2;
if (board[_local3][_local2] != 0) {
_root[_local4].gotoAndStop(board[_local3][_local2] + 1);
}
_local2++;
}
_local3++;
}
}
function NewGame() {
initVariables();
AttachGameBoard();
createGameArray();
Generate();
loadGameArrayOnBoard();
refreshedSmall = (refreshedBig = 0);
needNewGame = false;
}
function FindSumInColumn(i) {
var _local5 = 0;
var _local2 = false;
var _local4 = -1;
var _local1 = 0;
while (_local1 < gameType) {
if (board[i][_local1] == 0) {
if (!_local2) {
_local2 = true;
_local4 = _local1;
} else {
return(0);
}
}
_local5 = _local5 + board[i][_local1];
_local1++;
}
if (_local4 == -1) {
return(0);
}
return((_local5 * 1000) + _local4);
}
function FindSumInRow(j) {
var _local5 = 0;
var _local2 = false;
var _local4 = -1;
var _local1 = 0;
while (_local1 < gameType) {
if (board[_local1][j] == 0) {
if (!_local2) {
_local2 = true;
_local4 = _local1;
} else {
return(0);
}
}
_local5 = _local5 + board[_local1][j];
_local1++;
}
if (_local4 == -1) {
return(0);
}
return((_local5 * 1000) + _local4);
}
function FindUniqueDigitInCol() {
var _local6 = ((1 + gameType) * gameType) / 2;
var _local5 = 0;
var _local3 = 0;
while (_local3 < gameType) {
var _local2 = FindSumInColumn(_local3);
_local5 = _local2 - (Math.floor(_local2 / 1000) * 1000);
_local2 = Math.floor(_local2 / 1000);
if ((_local2 > 0) && (_local2 < _local6)) {
var _local4 = _local6 - _local2;
board[_local3][_local5] = _local4;
refreshedSmall = 1;
_root[(("block" + _local3) + "_") + _local5].gotoAndStop(_local4 + 1);
return(true);
}
_local3++;
}
return(false);
}
function FindUniqueDigitInRow() {
var _local6 = ((1 + gameType) * gameType) / 2;
var _local5 = 0;
var _local3 = 0;
while (_local3 < gameType) {
var _local2 = FindSumInRow(_local3);
_local5 = _local2 - (Math.floor(_local2 / 1000) * 1000);
_local2 = Math.floor(_local2 / 1000);
if ((_local2 > 0) && (_local2 < _local6)) {
var _local4 = _local6 - _local2;
board[_local5][_local3] = _local4;
refreshedSmall = 1;
_root[(("block" + _local5) + "_") + _local3].gotoAndStop(_local4 + 1);
return(true);
}
_local3++;
}
return(false);
}
function FindSumInBlock(x, y) {
var _local6 = 0;
var _local3 = false;
var _local5 = -1;
var _local7 = -1;
var _local2 = x * blockW;
while (_local2 < ((x + 1) * blockW)) {
var _local1 = y * blockH;
while (_local1 < ((y + 1) * blockH)) {
if (board[_local2][_local1] == 0) {
if (!_local3) {
_local3 = true;
_local5 = _local2;
_local7 = _local1;
} else {
return(0);
}
}
_local6 = _local6 + board[_local2][_local1];
_local1++;
}
_local2++;
}
if (_local5 == -1) {
return(0);
}
return(((_local6 * 10000) + (_local5 * 100)) + _local7);
}
function FindUniqueDigitInBlock() {
var _local9 = ((1 + gameType) * gameType) / 2;
var _local8 = 0;
while (_local8 < gameW) {
var _local3 = 0;
while (_local3 < gameH) {
var _local2 = FindSumInBlock(_local8, _local3);
var _local4 = Math.floor(_local2 / 10000);
var _local6 = Math.floor((_local2 - (_local4 * 10000)) / 100);
var _local5 = _local2 - (Math.floor(_local2 / 100) * 100);
if (_local2 > 0) {
var _local7 = _local9 - _local4;
board[_local6][_local5] = _local7;
refreshedSmall = 1;
_root[(("block" + _local6) + "_") + _local5].gotoAndStop(_local7 + 1);
return(true);
}
_local3++;
}
_local8++;
}
return(false);
}
function FindSingleDigit() {
var _local4 = 0;
while (_local4 < gameType) {
var _local3 = 0;
while (_local3 < gameType) {
if (board[_local4][_local3] == 0) {
var _local5 = 0;
var _local6;
var _local2 = 0;
while (_local2 < gameType) {
if (Approval(board, _local4, _local3, _local2 + 1) == 1) {
_local5++;
_local6 = _local2 + 1;
if (_local5 > 1) {
break;
}
}
_local2++;
}
if (_local5 == 1) {
board[_local4][_local3] = _local6;
refreshedSmall = 1;
_root[(("block" + _local4) + "_") + _local3].gotoAndStop(_local6 + 1);
return(true);
}
}
_local3++;
}
_local4++;
}
return(false);
}
function FindSimpleSolution() {
if (FindUniqueDigitInCol()) {
return(1);
}
if (FindUniqueDigitInRow()) {
return(1);
}
if (FindUniqueDigitInBlock()) {
return(1);
}
if (FindSingleDigit()) {
return(1);
}
return(0);
}
function onTimer() {
if (gameState == gameStateSolving) {
if (simpleSolutionCounter < 10) {
simpleSolutionCounter++;
} else {
simpleSolutionCounter = 0;
if (FindSimpleSolution() == 0) {
var _local6 = false;
var _local5 = 0;
while (_local5 < gameType) {
var _local4 = 0;
while (_local4 < gameType) {
if (board[_local5][_local4] == 0) {
_local6 = true;
break;
}
_local4++;
}
if (_local6) {
break;
}
_local5++;
}
if (_local6) {
attachMovie("mtOneSol", "mtOneSol", 10003);
gameState = gameStateWindow;
} else {
gameState = gameStatePlaying;
}
}
}
} else if (needNewGame) {
NewGame();
return(undefined);
}
var _local5 = 0;
while (_local5 < gameType) {
var _local4 = 0;
while (_local4 < gameType) {
var _local3 = (("block" + _local5) + "_") + _local4;
var _local2 = 1;
while (_local2 < (gameType + 1)) {
_root[_local3][_local2 + "big"].gotoAndStop(_root[_local3].state);
_local2++;
}
_local4++;
}
_local5++;
}
if ((refreshedBig++) < 2) {
loadGameArrayOnBoard();
}
if ((refreshedSmall++) < 2) {
refreshSmallDigits();
}
}
function showSolutionNo() {
removeMovieClip(mtOneSol);
gameState = gameStatePlaying;
}
function showSolutionYes() {
var _local4 = new Array(gameType);
var _local2 = 0;
while (_local2 < gameType) {
_local4[_local2] = new Array(gameType);
_local2++;
}
var _local3 = new Array(gameType);
_local2 = 0;
while (_local2 < gameType) {
_local3[_local2] = new Array(gameType);
_local2++;
}
var _local5;
_local2 = 0;
while (_local2 < gameType) {
var _local1 = 0;
while (_local1 < gameType) {
_local3[_local2][_local1] = board[_local2][_local1];
_local1++;
}
_local2++;
}
_local3[cx][cy] = _local5;
if (Solve(_local3, 1, _local4) == 0) {
attachMovie("mtNoSol", "mtNoSol", 10005);
gameState = gameStateWindow;
trace("NoSolution");
} else {
_local2 = 0;
while (_local2 < gameType) {
var _local1 = 0;
while (_local1 < gameType) {
board[_local2][_local1] = _local4[_local2][_local1];
_local1++;
}
_local2++;
}
refreshedBig = 0;
refreshedSmall = 0;
}
removeMovieClip(mtOneSol);
gameState = gameStatePlaying;
}
function checkCorrect() {
var _local4 = 0;
while (_local4 < gameType) {
var _local2 = 0;
while (_local2 < gameType) {
if (board[_local4][_local2] == 0) {
var _local3 = false;
var _local1 = 1;
while (_local1 <= gameType) {
if (Approval(board, _local4, _local2, _local1) == 1) {
_local3 = true;
break;
}
_local1++;
}
if (!_local3) {
return(false);
}
}
_local2++;
}
_local4++;
}
return(true);
}
function refreshSmallDigits() {
if (popup) {
var _local4 = 0;
while (_local4 < gameType) {
var _local3 = 0;
while (_local3 < gameType) {
var _local5 = (("block" + _local4) + "_") + _local3;
if (board[_local4][_local3] == 0) {
var _local2 = 0;
while (_local2 < gameType) {
_root[_local5]["d" + (_local2 + 1)]._visible = false;
_local2++;
}
}
_local3++;
}
_local4++;
}
} else if (hints) {
var _local4 = 0;
while (_local4 < gameType) {
var _local3 = 0;
while (_local3 < gameType) {
var _local5 = (("block" + _local4) + "_") + _local3;
if (board[_local4][_local3] == 0) {
var _local2 = 0;
while (_local2 < gameType) {
if (Approval(board, _local4, _local3, _local2 + 1) == 0) {
_root[_local5]["d" + (_local2 + 1)]._visible = false;
} else {
_root[_local5]["d" + (_local2 + 1)]._visible = true;
}
_local2++;
}
}
_local3++;
}
_local4++;
}
} else {
var _local4 = 0;
while (_local4 < gameType) {
var _local3 = 0;
while (_local3 < gameType) {
var _local5 = (("block" + _local4) + "_") + _local3;
if (board[_local4][_local3] == 0) {
var _local2 = 0;
while (_local2 < gameType) {
_root[_local5]["d" + (_local2 + 1)]._visible = true;
_local2++;
}
}
_local3++;
}
_local4++;
}
}
}
function Generate() {
var _local3 = new Array(gameType);
if (gameType != 16) {
var _local7 = 0;
while (_local7 < gameType) {
_local3[_local7] = new Array(gameType);
_local7++;
}
var _local2 = new Array(gameType);
_local7 = 0;
while (_local7 < gameType) {
_local2[_local7] = new Array(gameType);
_local7++;
}
var _local5;
do {
_local7 = 0;
while (_local7 < gameType) {
_local2[_local7][0] = _local7 + 1;
_local7++;
}
_local7 = 0;
while (_local7 < gameType) {
var _local6 = 1;
while (_local6 < gameType) {
_local2[_local7][_local6] = 0;
_local6++;
}
_local7++;
}
var _local9 = random(gameType);
var _local8 = random(gameType - 1) + 1;
do {
_local5 = 1 + random(gameType);
} while (Approval(_local2, _local9, _local8, _local5) == 0);
_local2[_local9][_local8] = _local5;
} while (Solve(_local2, 1, _local3) == 0);
} else {
_local3[0] = new Array(5, 9, 7, 4, 3, 13, 12, 14, 11, 1, 8, 2, 10, 6, 16, 15);
_local3[1] = new Array(11, 13, 12, 3, 5, 9, 7, 4, 10, 6, 16, 15, 14, 2, 8, 1);
_local3[2] = new Array(14, 2, 8, 1, 10, 6, 16, 15, 5, 9, 7, 4, 11, 13, 12, 3);
_local3[3] = new Array(15, 6, 16, 10, 11, 2, 8, 1, 14, 13, 12, 3, 5, 9, 4, 7);
_local3[4] = new Array(9, 5, 4, 7, 13, 11, 3, 12, 2, 14, 1, 8, 6, 10, 15, 16);
_local3[5] = new Array(13, 11, 3, 12, 9, 5, 4, 7, 6, 10, 15, 16, 2, 14, 1, 8);
_local3[6] = new Array(2, 14, 1, 8, 6, 10, 15, 16, 9, 5, 4, 7, 13, 11, 3, 12);
_local3[7] = new Array(6, 10, 15, 16, 2, 14, 1, 8, 13, 11, 3, 12, 9, 5, 7, 4);
_local3[8] = new Array(4, 7, 5, 9, 12, 3, 11, 13, 8, 2, 10, 1, 16, 15, 14, 6);
_local3[9] = new Array(12, 3, 11, 13, 7, 4, 5, 9, 16, 15, 14, 6, 8, 1, 10, 2);
_local3[10] = new Array(8, 1, 14, 2, 16, 15, 10, 6, 7, 4, 5, 9, 12, 3, 11, 13);
_local3[11] = new Array(16, 15, 10, 6, 8, 1, 14, 2, 12, 3, 11, 13, 7, 4, 5, 9);
_local3[12] = new Array(7, 4, 9, 5, 15, 12, 13, 11, 3, 8, 2, 14, 1, 16, 6, 10);
_local3[13] = new Array(3, 12, 13, 11, 4, 7, 9, 5, 1, 16, 6, 10, 15, 8, 2, 14);
_local3[14] = new Array(1, 8, 2, 15, 14, 16, 6, 10, 4, 7, 9, 5, 3, 12, 13, 11);
_local3[15] = new Array(10, 16, 6, 14, 1, 8, 2, 3, 15, 12, 13, 11, 4, 7, 9, 5);
var _local7 = 0;
while (_local7 < gameType) {
var _local6 = 0;
while (_local6 < gameType) {
board[_local7][_local6] = 0;
_local6++;
}
_local7++;
}
}
var _local7 = 0;
while (_local7 < gameType) {
var _local6 = 0;
while (_local6 < gameType) {
board[_local7][_local6] = 0;
_local6++;
}
_local7++;
}
var _local4 = new Array(gameType);
_local7 = 0;
while (_local7 < gameType) {
_local4[_local7] = _local7 + 1;
_local7++;
}
var _local10 = 0;
while (_local10 < 100) {
var _local12 = 0;
do {
_local7 = random(gameType);
var _local6 = random(gameType);
_local12++;
} while ((_local7 == _local6) && (_local12 < 100));
var _local11 = _local4[_local7];
_local4[_local7] = _local4[_local6];
_local4[_local6] = _local11;
_local10++;
}
_local7 = 0;
while (_local7 < gameType) {
var _local6 = 0;
while (_local6 < gameType) {
_local3[_local7][_local6] = _local4[_local3[_local7][_local6] - 1];
_local6++;
}
_local7++;
}
var _local12 = 0;
var _local13;
if (gameSkill == 0) {
_local13 = (gameType * gameType) / 2;
} else if (gameSkill == 1) {
_local13 = (gameType * gameType) / 4;
} else if (gameSkill == 2) {
_local13 = (gameType * gameType) / 8;
}
do {
_local7 = random(gameType);
var _local6 = random(gameType);
if (board[_local7][_local6] == 0) {
board[_local7][_local6] = _local3[_local7][_local6];
_local12++;
_root[(("block" + _local7) + "_") + _local6].state = elementStateFixed;
}
} while (_local12 < _local13);
}
function Solve() {
if (!checkCorrect()) {
attachMovie("mtNoSol", "mtNoSol", 10005);
_root.gameState = _root.gameStateWindow;
return(undefined);
}
var _local4 = new Array(gameType);
var _local3 = 0;
while (_local3 < gameType) {
_local4[_local3] = new Array(gameType);
_local3++;
}
var _local5 = new Array(gameType);
_local3 = 0;
while (_local3 < gameType) {
_local5[_local3] = new Array(gameType);
_local3++;
}
_local3 = 0;
while (_local3 < gameType) {
var _local2 = 0;
while (_local2 < gameType) {
_local4[_local3][_local2] = board[_local3][_local2];
_local2++;
}
_local3++;
}
var _local6 = Solve(_local4, 1, _local5);
if (_local6 != 0) {
_local3 = 0;
while (_local3 < gameType) {
var _local2 = 0;
while (_local2 < gameType) {
Curr(_local3, _local2, _local5[_local3][_local2]);
_local2++;
}
_local3++;
}
}
return(_local6);
}
function Curr(x, y, digit) {
board[x][y] = digit;
}
function Solve(table, max_num_solvs, solution) {
var _local7 = -1;
var _local6 = -1;
var _local8 = false;
var _local2 = 0;
while (_local2 < gameType) {
var _local1 = 0;
while (_local1 < gameType) {
if (table[_local2][_local1] == 0) {
_local7 = _local2;
_local6 = _local1;
_local8 = true;
break;
}
_local1++;
}
if (_local8) {
break;
}
_local2++;
}
if ((_local7 == -1) || (_local6 == -1)) {
_local2 = 0;
while (_local2 < gameType) {
var _local1 = 0;
while (_local1 < gameType) {
solution[_local2][_local1] = table[_local2][_local1];
_local1++;
}
_local2++;
}
return(1);
}
var _local12 = 0;
var _local11;
var _local5 = 1;
while (_local5 <= gameType) {
if (Approval(table, _local7, _local6, _local5) == 0) {
} else {
var _local3 = new Array(gameType);
_local2 = 0;
while (_local2 < gameType) {
_local3[_local2] = new Array(gameType);
_local2++;
}
_local2 = 0;
while (_local2 < gameType) {
var _local1 = 0;
while (_local1 < gameType) {
_local3[_local2][_local1] = table[_local2][_local1];
_local1++;
}
_local2++;
}
_local3[_local7][_local6] = _local5;
_local11 = Solve(_local3, max_num_solvs, solution);
_local12 = _local12 + _local11;
max_num_solvs = max_num_solvs - _local11;
if (max_num_solvs <= 0) {
break;
}
}
_local5++;
}
return(_local12);
}
function Approval(temp, x, y, digit) {
var _local10 = Math.floor(x / blockW);
var _local9 = Math.floor(y / blockH);
var _local6 = _local10 * blockW;
var _local3 = _local9 * blockH;
var _local2 = 0;
while (_local2 < gameType) {
if (temp[_local2][y] == digit) {
return(0);
}
_local2++;
}
var _local1 = 0;
while (_local1 < gameType) {
if (temp[x][_local1] == digit) {
return(0);
}
_local1++;
}
_local2 = _local6;
while (_local2 < (_local6 + blockW)) {
_local1 = _local3;
while (_local1 < (_local3 + blockH)) {
if (temp[_local2][_local1] == digit) {
return(0);
}
_local1++;
}
_local2++;
}
return(1);
}
function onPopupDigitClick(i) {
_root.board[_root.popupClp.i][_root.popupClp.j] = i;
_root.refreshedSmall = 1;
if (i == 0) {
_root.refreshedBig = 1;
}
_root[(("block" + _root.popupClp.i) + "_") + _root.popupClp.j].gotoAndStop(i + 1);
removeMovieClip(_root.popupClp);
_root.popupIs = false;
_root.refreshSmallDigits();
}
function onConfirmNewGameYesClick() {
_root.gameType = _root.confirmWnd.newGameType;
_root.removeGameElements();
_root.NewGame();
removeMovieClip(_root.confirmWnd);
_root.gameState = _root.gameStatePlaying;
}
function onConfirmNewGameNoClick() {
removeMovieClip(_root.confirmWnd);
var _local2 = 1;
while (_local2 < 7) {
var _local3;
if (_local2 == 1) {
_local3 = 4;
} else if (_local2 == 2) {
_local3 = 6;
} else if (_local2 == 3) {
_local3 = 8;
} else if (_local2 == 4) {
_local3 = 9;
} else if (_local2 == 5) {
_local3 = 12;
} else if (_local2 == 6) {
_local3 = 16;
}
if (_root.gameType == _local3) {
_root.panel.kinds["kind" + _local2]._checked = true;
_root.panel.kinds["kind" + _local2].gotoAndStop(3);
} else {
_root.panel.kinds["kind" + _local2]._checked = false;
_root.panel.kinds["kind" + _local2].gotoAndStop(2);
}
_local2++;
}
_root.gameState = _root.gameStatePlaying;
}
function onConfirmHardYesClick() {
_root.gameSkill = _root.HardConfirmWnd.newHard;
_root.removeGameElements();
_root.NewGame();
removeMovieClip(_root.HardConfirmWnd);
_root.gameState = _root.gameStatePlaying;
}
function onConfirmHardNoClick() {
removeMovieClip(_root.HardConfirmWnd);
var _local2 = 1;
while (_local2 < 4) {
if (_local2 == (_root.gameSkill + 1)) {
_root.panel.hards["hard" + _local2]._checked = true;
_root.panel.hards["hard" + _local2].gotoAndStop(3);
} else {
_root.panel.hards["hard" + _local2]._checked = false;
_root.panel.hards["hard" + _local2].gotoAndStop(2);
}
_local2++;
}
_root.gameState = _root.gameStatePlaying;
}
function startGame() {
_root.panel.kinds.kind4._checked = true;
_root.panel.kinds.kind4.gotoAndStop(3);
_root.panel.hards.hard1._checked = true;
_root.panel.hards.hard1.gotoAndStop(3);
someListener = new Object();
someListener.onMouseMove = function () {
var _local7;
var _local6;
var _local8 = false;
var _local5 = 0;
while (_local5 < gameType) {
var _local4 = 0;
while (_local4 < gameType) {
var _local2 = _root[(("block" + _local5) + "_") + _local4];
if ((((_local2._xmouse > 0) && (_local2._xmouse < _local2._width)) && (_local2._ymouse > 0)) && (_local2._ymouse < _local2._height)) {
_local8 = true;
_local7 = _local5;
_local6 = _local4;
break;
}
_local4++;
}
if (_local8) {
break;
}
_local5++;
}
_local5 = 0;
while (_local5 < gameType) {
var _local4 = 0;
while (_local4 < gameType) {
_root[(("block" + _local5) + "_") + _local4].back.gotoAndStop(1);
var _local3 = 1;
while (_local3 <= gameType) {
_root[(("block" + _local5) + "_") + _local4]["d" + _local3].gotoAndStop(1);
_local3++;
}
_local4++;
}
_local5++;
}
_root[(("block" + _local7) + "_") + _local6].back.gotoAndStop(2);
var _local9 = "d" + _root.block0_0.getNearestNumberN(_local7, _local6);
_local5 = 1;
while (_local5 <= gameType) {
_root[(("block" + _local7) + "_") + _local6]["d" + _local5].gotoAndStop(1);
_local5++;
}
_root[(("block" + _local7) + "_") + _local6][_local9].gotoAndStop(2);
};
Mouse.addListener(someListener);
}
var DX = 12.5;
var DY = 25;
var elementStateFixed = 1;
var elementStateVariable = 2;
var elementStateLabel = 3;
var gameStatePlaying = 0;
var gameStateWindow = 1;
var gameStateSolving = 2;
var gameType = 9;
var gameState;
var blockW;
var blockH;
var gameW;
var gameH;
var board;
var simpleSolutionCounter;
var gameSkill = 0;
var refreshedSmall;
var refreshedBig;
var hints = true;
var popup = true;
var popupIs = false;
var needNewGame = false;
startGame();
NewGame();
Frame 2
onTimer();
Frame 3
gotoAndPlay (2);
Symbol 10 Button
on (release) {
_root.gameState = _root.gameStatePlaying;
removeMovieClip(this);
}
Symbol 14 MovieClip Frame 1
stop();
Symbol 14 MovieClip Frame 2
stop();
Symbol 42 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 2
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 2
stop();
Symbol 48 MovieClip Frame 1
stop();
Symbol 48 MovieClip Frame 2
stop();
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 2
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 2
stop();
Symbol 57 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 2
stop();
Symbol 58 MovieClip [element6] Frame 1
function onDigitClick(i) {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = i;
_root.refreshedSmall = 1;
gotoAndStop(i + 1);
}
}
}
function onBigDigitClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (this.state != _root.elementStateFixed) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = 0;
_root.refreshedSmall = 1;
gotoAndStop(_root.gameType + 2);
}
}
}
}
function onBackClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
if (!_root.popupIs) {
_root.attachMovie("popup" + _root.gameType, "popupClp", 10000);
_root.popupClp._alpha = 70;
_root.popupIs = true;
}
_root.popupClp._x = (this._x + (this._width / 2)) - (_root.popupClp._width / 2);
_root.popupClp._y = (this._y + (this._height / 2)) - (_root.popupClp._height / 2);
if (_root.popupClp._x < _root.block0_0._x) {
_root.popupClp._x = _root.block0_0._x;
}
if (_root.popupClp._y < _root.block0_0._y) {
_root.popupClp._y = _root.block0_0._y;
}
if (_root.popupClp._x > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width)) {
_root.popupClp._x = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width;
}
if (_root.popupClp._y > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height)) {
_root.popupClp._y = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height;
}
_root.popupClp.i = this.i;
_root.popupClp.j = this.j;
var _local4 = 0;
if (_root.board[this.i][this.j] != 0) {
_local4 = _root.board[this.i][this.j];
_root.board[this.i][this.j] = 0;
}
if (_root.hints) {
var _local3 = 0;
while (_local3 < _root.gameType) {
if (_root.Approval(_root.board, this.i, this.j, _local3 + 1) == 0) {
_root.popupClp["d" + (_local3 + 1)]._visible = false;
} else {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
}
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < _root.gameType) {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
_local3++;
}
}
if (_local4 != 0) {
_root.board[this.i][this.j] = _local4;
}
} else {
onDigitClick(getNearestNumberN(this.i, this.j));
}
}
}
function getNearestNumberN(x, y) {
var _local5 = 9999999999999;
var _local4;
var _local6;
var _local2 = 1;
while (_local2 <= _root.gameType) {
var _local3 = _root[(("block" + x) + "_") + y];
if (_local3["d" + _local2]._visible == true) {
_local4 = Math.pow(_local3["d" + _local2]._xmouse, 2) + Math.pow(_local3["d" + _local2]._ymouse, 2);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local2;
}
}
_local2++;
}
return(_local6);
}
gotoAndStop(_totalframes);
stop();
Instance of Symbol 14 MovieClip "back" in Symbol 58 MovieClip [element6] Frame 1
on (release) {
_parent.onBackClick();
}
Symbol 58 MovieClip [element6] Frame 2
stop();
Instance of Symbol 19 MovieClip "1big" in Symbol 58 MovieClip [element6] Frame 2
on (release) {
_parent.onBigDigitClick();
}
Symbol 58 MovieClip [element6] Frame 3
stop();
Instance of Symbol 23 MovieClip "2big" in Symbol 58 MovieClip [element6] Frame 3
on (release) {
_parent.onBigDigitClick();
}
Symbol 58 MovieClip [element6] Frame 4
stop();
Instance of Symbol 27 MovieClip "3big" in Symbol 58 MovieClip [element6] Frame 4
on (release) {
_parent.onBigDigitClick();
}
Symbol 58 MovieClip [element6] Frame 5
stop();
Instance of Symbol 31 MovieClip "4big" in Symbol 58 MovieClip [element6] Frame 5
on (release) {
_parent.onBigDigitClick();
}
Symbol 58 MovieClip [element6] Frame 6
stop();
Instance of Symbol 35 MovieClip "5big" in Symbol 58 MovieClip [element6] Frame 6
on (release) {
_parent.onBigDigitClick();
}
Symbol 58 MovieClip [element6] Frame 7
stop();
Instance of Symbol 39 MovieClip "6big" in Symbol 58 MovieClip [element6] Frame 7
on (release) {
_parent.onBigDigitClick();
}
Symbol 58 MovieClip [element6] Frame 8
stop();
Symbol 61 MovieClip Frame 1
stop();
Symbol 61 MovieClip Frame 2
stop();
Symbol 97 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 2
stop();
Symbol 100 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 2
stop();
Symbol 103 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 2
stop();
Symbol 106 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 2
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 2
stop();
Symbol 112 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 2
stop();
Symbol 115 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 2
stop();
Symbol 118 MovieClip Frame 1
stop();
Symbol 118 MovieClip Frame 2
stop();
Symbol 119 MovieClip [element8] Frame 1
function onDigitClick(i) {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = i;
_root.refreshedSmall = 1;
gotoAndStop(i + 1);
}
}
}
function onBigDigitClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (this.state != _root.elementStateFixed) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = 0;
_root.refreshedSmall = 1;
gotoAndStop(_root.gameType + 2);
}
}
}
}
function onBackClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
if (!_root.popupIs) {
_root.attachMovie("popup" + _root.gameType, "popupClp", 10000);
_root.popupClp._alpha = 70;
_root.popupIs = true;
}
_root.popupClp._x = (this._x + (this._width / 2)) - (_root.popupClp._width / 2);
_root.popupClp._y = (this._y + (this._height / 2)) - (_root.popupClp._height / 2);
if (_root.popupClp._x < _root.block0_0._x) {
_root.popupClp._x = _root.block0_0._x;
}
if (_root.popupClp._y < _root.block0_0._y) {
_root.popupClp._y = _root.block0_0._y;
}
if (_root.popupClp._x > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width)) {
_root.popupClp._x = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width;
}
if (_root.popupClp._y > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height)) {
_root.popupClp._y = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height;
}
_root.popupClp.i = this.i;
_root.popupClp.j = this.j;
var _local4 = 0;
if (_root.board[this.i][this.j] != 0) {
_local4 = _root.board[this.i][this.j];
_root.board[this.i][this.j] = 0;
}
if (_root.hints) {
var _local3 = 0;
while (_local3 < _root.gameType) {
if (_root.Approval(_root.board, this.i, this.j, _local3 + 1) == 0) {
_root.popupClp["d" + (_local3 + 1)]._visible = false;
} else {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
}
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < _root.gameType) {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
_local3++;
}
}
if (_local4 != 0) {
_root.board[this.i][this.j] = _local4;
}
} else {
onDigitClick(getNearestNumberN(this.i, this.j));
}
}
}
function getNearestNumberN(x, y) {
var _local5 = 9999999999999;
var _local4;
var _local6;
var _local2 = 1;
while (_local2 <= _root.gameType) {
var _local3 = _root[(("block" + x) + "_") + y];
if (_local3["d" + _local2]._visible == true) {
_local4 = Math.pow(_local3["d" + _local2]._xmouse, 2) + Math.pow(_local3["d" + _local2]._ymouse, 2);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local2;
}
}
_local2++;
}
return(_local6);
}
gotoAndStop(_totalframes);
Instance of Symbol 61 MovieClip in Symbol 119 MovieClip [element8] Frame 1
on (release) {
_parent.onBackClick();
}
Symbol 119 MovieClip [element8] Frame 2
stop();
Instance of Symbol 66 MovieClip "1big" in Symbol 119 MovieClip [element8] Frame 2
on (release) {
_parent.onBigDigitClick();
}
Symbol 119 MovieClip [element8] Frame 3
stop();
Instance of Symbol 70 MovieClip "2big" in Symbol 119 MovieClip [element8] Frame 3
on (release) {
_parent.onBigDigitClick();
}
Symbol 119 MovieClip [element8] Frame 4
stop();
Instance of Symbol 74 MovieClip "3big" in Symbol 119 MovieClip [element8] Frame 4
on (release) {
_parent.onBigDigitClick();
}
Symbol 119 MovieClip [element8] Frame 5
stop();
Instance of Symbol 78 MovieClip "4big" in Symbol 119 MovieClip [element8] Frame 5
on (release) {
_parent.onBigDigitClick();
}
Symbol 119 MovieClip [element8] Frame 6
stop();
Instance of Symbol 82 MovieClip "5big" in Symbol 119 MovieClip [element8] Frame 6
on (release) {
_parent.onBigDigitClick();
}
Symbol 119 MovieClip [element8] Frame 7
stop();
Instance of Symbol 86 MovieClip "6big" in Symbol 119 MovieClip [element8] Frame 7
on (release) {
_parent.onBigDigitClick();
}
Symbol 119 MovieClip [element8] Frame 8
stop();
Instance of Symbol 90 MovieClip "7big" in Symbol 119 MovieClip [element8] Frame 8
on (release) {
_parent.onBigDigitClick();
}
Symbol 119 MovieClip [element8] Frame 9
stop();
Instance of Symbol 94 MovieClip "8big" in Symbol 119 MovieClip [element8] Frame 9
on (release) {
_parent.onBigDigitClick();
}
Symbol 119 MovieClip [element8] Frame 10
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 2
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 2
stop();
Symbol 168 MovieClip Frame 1
stop();
Symbol 168 MovieClip Frame 2
stop();
Symbol 171 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 2
stop();
Symbol 174 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 2
stop();
Symbol 177 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 2
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 2
stop();
Symbol 183 MovieClip Frame 1
stop();
Symbol 183 MovieClip Frame 2
stop();
Symbol 186 MovieClip Frame 1
stop();
Symbol 186 MovieClip Frame 2
stop();
Symbol 187 MovieClip [element9] Frame 1
function onDigitClick(i) {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = i;
_root.refreshedSmall = 1;
gotoAndStop(i + 1);
}
}
}
function onBigDigitClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (this.state != _root.elementStateFixed) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = 0;
_root.refreshedSmall = 1;
gotoAndStop(_root.gameType + 2);
}
}
}
}
function onBackClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
if (!_root.popupIs) {
_root.attachMovie("popup" + _root.gameType, "popupClp", 10000);
_root.popupClp._alpha = 70;
_root.popupIs = true;
}
_root.popupClp._x = (this._x + (this._width / 2)) - (_root.popupClp._width / 2);
_root.popupClp._y = (this._y + (this._height / 2)) - (_root.popupClp._height / 2);
if (_root.popupClp._x < _root.block0_0._x) {
_root.popupClp._x = _root.block0_0._x;
}
if (_root.popupClp._y < _root.block0_0._y) {
_root.popupClp._y = _root.block0_0._y;
}
if (_root.popupClp._x > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width)) {
_root.popupClp._x = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width;
}
if (_root.popupClp._y > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height)) {
_root.popupClp._y = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height;
}
_root.popupClp.i = this.i;
_root.popupClp.j = this.j;
var _local4 = 0;
if (_root.board[this.i][this.j] != 0) {
_local4 = _root.board[this.i][this.j];
_root.board[this.i][this.j] = 0;
}
if (_root.hints) {
var _local3 = 0;
while (_local3 < _root.gameType) {
if (_root.Approval(_root.board, this.i, this.j, _local3 + 1) == 0) {
_root.popupClp["d" + (_local3 + 1)]._visible = false;
} else {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
}
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < _root.gameType) {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
_local3++;
}
}
if (_local4 != 0) {
_root.board[this.i][this.j] = _local4;
}
} else {
onDigitClick(getNearestNumberN(this.i, this.j));
}
}
}
function getNearestNumberN(x, y) {
var _local5 = 9999999999999;
var _local4;
var _local6;
var _local2 = 1;
while (_local2 <= _root.gameType) {
var _local3 = _root[(("block" + x) + "_") + y];
if (_local3["d" + _local2]._visible == true) {
_local4 = Math.pow(_local3["d" + _local2]._xmouse, 2) + Math.pow(_local3["d" + _local2]._ymouse, 2);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local2;
}
}
_local2++;
}
return(_local6);
}
gotoAndStop(_totalframes);
Instance of Symbol 122 MovieClip "back" in Symbol 187 MovieClip [element9] Frame 1
on (release) {
_parent.onBackClick();
}
Symbol 187 MovieClip [element9] Frame 2
stop();
Instance of Symbol 127 MovieClip "1big" in Symbol 187 MovieClip [element9] Frame 2
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 3
stop();
Instance of Symbol 131 MovieClip "2big" in Symbol 187 MovieClip [element9] Frame 3
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 4
stop();
Instance of Symbol 135 MovieClip "3big" in Symbol 187 MovieClip [element9] Frame 4
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 5
stop();
Instance of Symbol 139 MovieClip "4big" in Symbol 187 MovieClip [element9] Frame 5
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 6
stop();
Instance of Symbol 143 MovieClip "5big" in Symbol 187 MovieClip [element9] Frame 6
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 7
stop();
Instance of Symbol 147 MovieClip "6big" in Symbol 187 MovieClip [element9] Frame 7
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 8
stop();
Instance of Symbol 151 MovieClip "7big" in Symbol 187 MovieClip [element9] Frame 8
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 9
stop();
Instance of Symbol 155 MovieClip "8big" in Symbol 187 MovieClip [element9] Frame 9
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 10
stop();
Instance of Symbol 159 MovieClip "9big" in Symbol 187 MovieClip [element9] Frame 10
on (release) {
_parent.onBigDigitClick();
}
Symbol 187 MovieClip [element9] Frame 11
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 2
stop();
Symbol 242 MovieClip Frame 1
stop();
Symbol 242 MovieClip Frame 2
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 2
stop();
Symbol 248 MovieClip Frame 1
stop();
Symbol 248 MovieClip Frame 2
stop();
Symbol 251 MovieClip Frame 1
stop();
Symbol 251 MovieClip Frame 2
stop();
Symbol 254 MovieClip Frame 1
stop();
Symbol 254 MovieClip Frame 2
stop();
Symbol 257 MovieClip Frame 1
stop();
Symbol 257 MovieClip Frame 2
stop();
Symbol 260 MovieClip Frame 1
stop();
Symbol 260 MovieClip Frame 2
stop();
Symbol 263 MovieClip Frame 1
stop();
Symbol 263 MovieClip Frame 2
stop();
Symbol 266 MovieClip Frame 1
stop();
Symbol 266 MovieClip Frame 2
stop();
Symbol 269 MovieClip Frame 1
stop();
Symbol 269 MovieClip Frame 2
stop();
Symbol 272 MovieClip Frame 1
stop();
Symbol 272 MovieClip Frame 2
stop();
Symbol 275 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 2
stop();
Symbol 276 MovieClip [element12] Frame 1
function onDigitClick(i) {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = i;
_root.refreshedSmall = 1;
gotoAndStop(i + 1);
}
}
}
function onBigDigitClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (this.state != _root.elementStateFixed) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = 0;
_root.refreshedSmall = 1;
gotoAndStop(_root.gameType + 2);
}
}
}
}
function onBackClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
if (!_root.popupIs) {
_root.attachMovie("popup" + _root.gameType, "popupClp", 10000);
_root.popupClp._alpha = 70;
_root.popupIs = true;
}
_root.popupClp._x = (this._x + (this._width / 2)) - (_root.popupClp._width / 2);
_root.popupClp._y = (this._y + (this._height / 2)) - (_root.popupClp._height / 2);
if (_root.popupClp._x < _root.block0_0._x) {
_root.popupClp._x = _root.block0_0._x;
}
if (_root.popupClp._y < _root.block0_0._y) {
_root.popupClp._y = _root.block0_0._y;
}
if (_root.popupClp._x > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width)) {
_root.popupClp._x = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width;
}
if (_root.popupClp._y > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height)) {
_root.popupClp._y = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height;
}
_root.popupClp.i = this.i;
_root.popupClp.j = this.j;
var _local4 = 0;
if (_root.board[this.i][this.j] != 0) {
_local4 = _root.board[this.i][this.j];
_root.board[this.i][this.j] = 0;
}
if (_root.hints) {
var _local3 = 0;
while (_local3 < _root.gameType) {
if (_root.Approval(_root.board, this.i, this.j, _local3 + 1) == 0) {
_root.popupClp["d" + (_local3 + 1)]._visible = false;
} else {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
}
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < _root.gameType) {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
_local3++;
}
}
if (_local4 != 0) {
_root.board[this.i][this.j] = _local4;
}
} else {
onDigitClick(getNearestNumberN(this.i, this.j));
}
}
}
function getNearestNumberN(x, y) {
var _local5 = 9999999999999;
var _local4;
var _local6;
var _local2 = 1;
while (_local2 <= _root.gameType) {
var _local3 = _root[(("block" + x) + "_") + y];
if (_local3["d" + _local2]._visible == true) {
_local4 = Math.pow(_local3["d" + _local2]._xmouse, 2) + Math.pow(_local3["d" + _local2]._ymouse, 2);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local2;
}
}
_local2++;
}
return(_local6);
}
gotoAndStop(_totalframes);
Instance of Symbol 190 MovieClip "back" in Symbol 276 MovieClip [element12] Frame 1
on (release) {
_parent.onBackClick();
}
Symbol 276 MovieClip [element12] Frame 2
stop();
Instance of Symbol 195 MovieClip "1big" in Symbol 276 MovieClip [element12] Frame 2
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 3
stop();
Instance of Symbol 199 MovieClip "2big" in Symbol 276 MovieClip [element12] Frame 3
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 4
stop();
Instance of Symbol 203 MovieClip "3big" in Symbol 276 MovieClip [element12] Frame 4
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 5
stop();
Instance of Symbol 207 MovieClip "4big" in Symbol 276 MovieClip [element12] Frame 5
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 6
stop();
Instance of Symbol 211 MovieClip "5big" in Symbol 276 MovieClip [element12] Frame 6
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 7
stop();
Instance of Symbol 215 MovieClip "6big" in Symbol 276 MovieClip [element12] Frame 7
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 8
stop();
Instance of Symbol 219 MovieClip "7big" in Symbol 276 MovieClip [element12] Frame 8
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 9
stop();
Instance of Symbol 223 MovieClip "8big" in Symbol 276 MovieClip [element12] Frame 9
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 10
stop();
Instance of Symbol 227 MovieClip "9big" in Symbol 276 MovieClip [element12] Frame 10
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 11
stop();
Instance of Symbol 231 MovieClip "10big" in Symbol 276 MovieClip [element12] Frame 11
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 12
stop();
Instance of Symbol 235 MovieClip "11big" in Symbol 276 MovieClip [element12] Frame 12
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 13
stop();
Instance of Symbol 239 MovieClip "12big" in Symbol 276 MovieClip [element12] Frame 13
on (release) {
_parent.onBigDigitClick();
}
Symbol 276 MovieClip [element12] Frame 14
stop();
Symbol 345 MovieClip Frame 1
stop();
Symbol 345 MovieClip Frame 2
stop();
Symbol 348 MovieClip Frame 1
stop();
Symbol 348 MovieClip Frame 2
stop();
Symbol 351 MovieClip Frame 1
stop();
Symbol 351 MovieClip Frame 2
stop();
Symbol 354 MovieClip Frame 1
stop();
Symbol 354 MovieClip Frame 2
stop();
Symbol 357 MovieClip Frame 1
stop();
Symbol 357 MovieClip Frame 2
stop();
Symbol 360 MovieClip Frame 1
stop();
Symbol 360 MovieClip Frame 2
stop();
Symbol 363 MovieClip Frame 1
stop();
Symbol 363 MovieClip Frame 2
stop();
Symbol 366 MovieClip Frame 1
stop();
Symbol 366 MovieClip Frame 2
stop();
Symbol 369 MovieClip Frame 1
stop();
Symbol 369 MovieClip Frame 2
stop();
Symbol 372 MovieClip Frame 1
stop();
Symbol 372 MovieClip Frame 2
stop();
Symbol 375 MovieClip Frame 1
stop();
Symbol 375 MovieClip Frame 2
stop();
Symbol 378 MovieClip Frame 1
stop();
Symbol 378 MovieClip Frame 2
stop();
Symbol 381 MovieClip Frame 1
stop();
Symbol 381 MovieClip Frame 2
stop();
Symbol 384 MovieClip Frame 1
stop();
Symbol 384 MovieClip Frame 2
stop();
Symbol 387 MovieClip Frame 1
stop();
Symbol 387 MovieClip Frame 2
stop();
Symbol 390 MovieClip Frame 1
stop();
Symbol 390 MovieClip Frame 2
stop();
Symbol 391 MovieClip [element16] Frame 1
function onDigitClick(i) {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = i;
_root.refreshedSmall = 1;
gotoAndStop(i + 1);
}
}
}
function onBigDigitClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (this.state != _root.elementStateFixed) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = 0;
_root.refreshedSmall = 1;
gotoAndStop(_root.gameType + 2);
}
}
}
}
function onBackClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
if (!_root.popupIs) {
_root.attachMovie("popup" + _root.gameType, "popupClp", 10000);
_root.popupClp._alpha = 70;
_root.popupIs = true;
}
_root.popupClp._x = (this._x + (this._width / 2)) - (_root.popupClp._width / 2);
_root.popupClp._y = (this._y + (this._height / 2)) - (_root.popupClp._height / 2);
if (_root.popupClp._x < _root.block0_0._x) {
_root.popupClp._x = _root.block0_0._x;
}
if (_root.popupClp._y < _root.block0_0._y) {
_root.popupClp._y = _root.block0_0._y;
}
if (_root.popupClp._x > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width)) {
_root.popupClp._x = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width;
}
if (_root.popupClp._y > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height)) {
_root.popupClp._y = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height;
}
_root.popupClp.i = this.i;
_root.popupClp.j = this.j;
var _local4 = 0;
if (_root.board[this.i][this.j] != 0) {
_local4 = _root.board[this.i][this.j];
_root.board[this.i][this.j] = 0;
}
if (_root.hints) {
var _local3 = 0;
while (_local3 < _root.gameType) {
if (_root.Approval(_root.board, this.i, this.j, _local3 + 1) == 0) {
_root.popupClp["d" + (_local3 + 1)]._visible = false;
} else {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
}
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < _root.gameType) {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
_local3++;
}
}
if (_local4 != 0) {
_root.board[this.i][this.j] = _local4;
}
} else {
onDigitClick(getNearestNumberN(this.i, this.j));
}
}
}
function getNearestNumberN(x, y) {
var _local5 = 9999999999999;
var _local4;
var _local6;
var _local2 = 1;
while (_local2 <= _root.gameType) {
var _local3 = _root[(("block" + x) + "_") + y];
if (_local3["d" + _local2]._visible == true) {
_local4 = Math.pow(_local3["d" + _local2]._xmouse, 2) + Math.pow(_local3["d" + _local2]._ymouse, 2);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local2;
}
}
_local2++;
}
return(_local6);
}
gotoAndStop(_totalframes);
Instance of Symbol 278 MovieClip in Symbol 391 MovieClip [element16] Frame 1
on (release) {
_parent.onBackClick();
}
Symbol 391 MovieClip [element16] Frame 2
stop();
Instance of Symbol 282 MovieClip "1big" in Symbol 391 MovieClip [element16] Frame 2
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 3
stop();
Instance of Symbol 286 MovieClip "2big" in Symbol 391 MovieClip [element16] Frame 3
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 4
stop();
Instance of Symbol 290 MovieClip "3big" in Symbol 391 MovieClip [element16] Frame 4
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 5
stop();
Instance of Symbol 294 MovieClip "4big" in Symbol 391 MovieClip [element16] Frame 5
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 6
stop();
Instance of Symbol 298 MovieClip "5big" in Symbol 391 MovieClip [element16] Frame 6
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 7
stop();
Instance of Symbol 302 MovieClip "6big" in Symbol 391 MovieClip [element16] Frame 7
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 8
stop();
Instance of Symbol 306 MovieClip "7big" in Symbol 391 MovieClip [element16] Frame 8
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 9
stop();
Instance of Symbol 310 MovieClip "8big" in Symbol 391 MovieClip [element16] Frame 9
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 10
stop();
Instance of Symbol 314 MovieClip "9big" in Symbol 391 MovieClip [element16] Frame 10
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 11
stop();
Instance of Symbol 318 MovieClip "10big" in Symbol 391 MovieClip [element16] Frame 11
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 12
stop();
Instance of Symbol 322 MovieClip "11big" in Symbol 391 MovieClip [element16] Frame 12
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 13
stop();
Instance of Symbol 326 MovieClip "12big" in Symbol 391 MovieClip [element16] Frame 13
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 14
stop();
Instance of Symbol 330 MovieClip "13big" in Symbol 391 MovieClip [element16] Frame 14
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 15
stop();
Instance of Symbol 334 MovieClip "14big" in Symbol 391 MovieClip [element16] Frame 15
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 16
stop();
Instance of Symbol 338 MovieClip "15big" in Symbol 391 MovieClip [element16] Frame 16
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 17
stop();
Instance of Symbol 342 MovieClip "16big" in Symbol 391 MovieClip [element16] Frame 17
on (release) {
_parent.onBigDigitClick();
}
Symbol 391 MovieClip [element16] Frame 18
stop();
Symbol 394 MovieClip Frame 1
stop();
Symbol 394 MovieClip Frame 2
stop();
Symbol 414 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 2
stop();
Symbol 417 MovieClip Frame 1
stop();
Symbol 417 MovieClip Frame 2
stop();
Symbol 420 MovieClip Frame 1
stop();
Symbol 420 MovieClip Frame 2
stop();
Symbol 423 MovieClip Frame 1
stop();
Symbol 423 MovieClip Frame 2
stop();
Symbol 424 MovieClip [element4] Frame 1
function onDigitClick(i) {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = i;
_root.refreshedSmall = 1;
gotoAndStop(i + 1);
}
}
}
function onBigDigitClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (this.state != _root.elementStateFixed) {
if (_root.popup) {
onBackClick();
} else {
_root.board[this.i][this.j] = 0;
_root.refreshedSmall = 1;
gotoAndStop(_root.gameType + 2);
}
}
}
}
function onBackClick() {
if (_root.gameState == _root.gameStatePlaying) {
if (_root.popup) {
if (!_root.popupIs) {
_root.attachMovie("popup" + _root.gameType, "popupClp", 10000);
_root.popupClp._alpha = 70;
_root.popupIs = true;
}
_root.popupClp._x = (this._x + (this._width / 2)) - (_root.popupClp._width / 2);
_root.popupClp._y = (this._y + (this._height / 2)) - (_root.popupClp._height / 2);
if (_root.popupClp._x < _root.block0_0._x) {
_root.popupClp._x = _root.block0_0._x;
}
if (_root.popupClp._y < _root.block0_0._y) {
_root.popupClp._y = _root.block0_0._y;
}
if (_root.popupClp._x > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width)) {
_root.popupClp._x = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._x + _root.block0_0._width) - _root.popupClp._width;
}
if (_root.popupClp._y > ((_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height)) {
_root.popupClp._y = (_root[(("block" + (_root.gameType - 1)) + "_") + (_root.gameType - 1)]._y + _root.block0_0._height) - _root.popupClp._height;
}
_root.popupClp.i = this.i;
_root.popupClp.j = this.j;
var _local4 = 0;
if (_root.board[this.i][this.j] != 0) {
_local4 = _root.board[this.i][this.j];
_root.board[this.i][this.j] = 0;
}
if (_root.hints) {
var _local3 = 0;
while (_local3 < _root.gameType) {
if (_root.Approval(_root.board, this.i, this.j, _local3 + 1) == 0) {
_root.popupClp["d" + (_local3 + 1)]._visible = false;
} else {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
}
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < _root.gameType) {
_root.popupClp["d" + (_local3 + 1)]._visible = true;
_local3++;
}
}
if (_local4 != 0) {
_root.board[this.i][this.j] = _local4;
}
} else {
onDigitClick(getNearestNumberN(this.i, this.j));
}
}
}
function getNearestNumberN(x, y) {
var _local5 = 9999999999999;
var _local4;
var _local6;
var _local2 = 1;
while (_local2 <= _root.gameType) {
var _local3 = _root[(("block" + x) + "_") + y];
if (_local3["d" + _local2]._visible == true) {
_local4 = Math.pow(_local3["d" + _local2]._xmouse, 2) + Math.pow(_local3["d" + _local2]._ymouse, 2);
if (_local4 < _local5) {
_local5 = _local4;
_local6 = _local2;
}
}
_local2++;
}
return(_local6);
}
gotoAndStop(_totalframes);
Instance of Symbol 394 MovieClip "back" in Symbol 424 MovieClip [element4] Frame 1
on (release) {
_parent.onBackClick();
}
Symbol 424 MovieClip [element4] Frame 2
stop();
Instance of Symbol 399 MovieClip "1big" in Symbol 424 MovieClip [element4] Frame 2
on (release) {
_parent.onBigDigitClick();
}
Symbol 424 MovieClip [element4] Frame 3
stop();
Instance of Symbol 403 MovieClip "2big" in Symbol 424 MovieClip [element4] Frame 3
on (release) {
_parent.onBigDigitClick();
}
Symbol 424 MovieClip [element4] Frame 4
stop();
Instance of Symbol 407 MovieClip "3big" in Symbol 424 MovieClip [element4] Frame 4
on (release) {
_parent.onBigDigitClick();
}
Symbol 424 MovieClip [element4] Frame 5
stop();
Instance of Symbol 411 MovieClip "4big" in Symbol 424 MovieClip [element4] Frame 5
on (release) {
_parent.onBigDigitClick();
}
Symbol 424 MovieClip [element4] Frame 6
stop();
Symbol 430 Button
on (release) {
_root.onPopupDigitClick(1);
}
Symbol 433 Button
on (release) {
_root.onPopupDigitClick(2);
}
Symbol 435 Button
on (release) {
_root.onPopupDigitClick(3);
}
Symbol 437 Button
on (release) {
_root.onPopupDigitClick(4);
}
Symbol 442 Button
on (release) {
_root.onPopupDigitClick(0);
}
Symbol 447 Button
on (release) {
_root.onPopupDigitClick(1);
}
Symbol 448 Button
on (release) {
_root.onPopupDigitClick(2);
}
Symbol 449 Button
on (release) {
_root.onPopupDigitClick(3);
}
Symbol 450 Button
on (release) {
_root.onPopupDigitClick(4);
}
Symbol 452 Button
on (release) {
_root.onPopupDigitClick(5);
}
Symbol 454 Button
on (release) {
_root.onPopupDigitClick(6);
}
Symbol 455 Button
on (release) {
_root.onPopupDigitClick(0);
}
Symbol 461 Button
on (release) {
_root.onPopupDigitClick(1);
}
Symbol 463 Button
on (release) {
_root.onPopupDigitClick(2);
}
Symbol 465 Button
on (release) {
_root.onPopupDigitClick(3);
}
Symbol 467 Button
on (release) {
_root.onPopupDigitClick(4);
}
Symbol 469 Button
on (release) {
_root.onPopupDigitClick(5);
}
Symbol 471 Button
on (release) {
_root.onPopupDigitClick(6);
}
Symbol 473 Button
on (release) {
_root.onPopupDigitClick(7);
}
Symbol 475 Button
on (release) {
_root.onPopupDigitClick(8);
}
Symbol 476 Button
on (release) {
_root.onPopupDigitClick(0);
}
Symbol 482 Button
on (release) {
_root.onPopupDigitClick(1);
}
Symbol 484 Button
on (release) {
_root.onPopupDigitClick(2);
}
Symbol 486 Button
on (release) {
_root.onPopupDigitClick(3);
}
Symbol 488 Button
on (release) {
_root.onPopupDigitClick(4);
}
Symbol 490 Button
on (release) {
_root.onPopupDigitClick(5);
}
Symbol 492 Button
on (release) {
_root.onPopupDigitClick(6);
}
Symbol 494 Button
on (release) {
_root.onPopupDigitClick(7);
}
Symbol 496 Button
on (release) {
_root.onPopupDigitClick(8);
}
Symbol 498 Button
on (release) {
_root.onPopupDigitClick(9);
}
Symbol 499 Button
on (release) {
_root.onPopupDigitClick(0);
}
Symbol 502 Button
on (release) {
_root.onPopupDigitClick(1);
}
Symbol 504 Button
on (release) {
_root.onPopupDigitClick(2);
}
Symbol 506 Button
on (release) {
_root.onPopupDigitClick(3);
}
Symbol 508 Button
on (release) {
_root.onPopupDigitClick(4);
}
Symbol 510 Button
on (release) {
_root.onPopupDigitClick(5);
}
Symbol 512 Button
on (release) {
_root.onPopupDigitClick(6);
}
Symbol 514 Button
on (release) {
_root.onPopupDigitClick(7);
}
Symbol 516 Button
on (release) {
_root.onPopupDigitClick(8);
}
Symbol 518 Button
on (release) {
_root.onPopupDigitClick(9);
}
Symbol 520 Button
on (release) {
_root.onPopupDigitClick(10);
}
Symbol 522 Button
on (release) {
_root.onPopupDigitClick(11);
}
Symbol 524 Button
on (release) {
_root.onPopupDigitClick(12);
}
Symbol 525 Button
on (release) {
_root.onPopupDigitClick(0);
}
Symbol 530 Button
on (release) {
_root.onPopupDigitClick(1);
}
Symbol 531 Button
on (release) {
_root.onPopupDigitClick(2);
}
Symbol 532 Button
on (release) {
_root.onPopupDigitClick(3);
}
Symbol 533 Button
on (release) {
_root.onPopupDigitClick(4);
}
Symbol 534 Button
on (release) {
_root.onPopupDigitClick(5);
}
Symbol 535 Button
on (release) {
_root.onPopupDigitClick(6);
}
Symbol 536 Button
on (release) {
_root.onPopupDigitClick(7);
}
Symbol 537 Button
on (release) {
_root.onPopupDigitClick(8);
}
Symbol 538 Button
on (release) {
_root.onPopupDigitClick(9);
}
Symbol 539 Button
on (release) {
_root.onPopupDigitClick(10);
}
Symbol 540 Button
on (release) {
_root.onPopupDigitClick(11);
}
Symbol 541 Button
on (release) {
_root.onPopupDigitClick(12);
}
Symbol 543 Button
on (release) {
_root.onPopupDigitClick(13);
}
Symbol 545 Button
on (release) {
_root.onPopupDigitClick(14);
}
Symbol 547 Button
on (release) {
_root.onPopupDigitClick(15);
}
Symbol 549 Button
on (release) {
_root.onPopupDigitClick(16);
}
Symbol 550 Button
on (release) {
_root.onPopupDigitClick(0);
}
Symbol 558 Button
on (release) {
_root.onConfirmHardYesClick();
}
Symbol 564 Button
on (release) {
_root.onConfirmHardNoClick();
}
Symbol 568 Button
on (release) {
_root.onConfirmNewGameYesClick();
}
Symbol 569 Button
on (release) {
_root.onConfirmNewGameNoClick();
}
Symbol 572 Button
on (release) {
_root.showSolutionYes();
}
Symbol 573 Button
on (release) {
_root.showSolutionNo();
}
Symbol 580 Button
on (release) {
onGameKindClick();
}
Symbol 585 MovieClip Frame 1
function onGameKindClick() {
var _local5;
if (_root.gameType == 4) {
_local5 = 1;
} else if (_root.gameType == 6) {
_local5 = 2;
} else if (_root.gameType == 8) {
_local5 = 3;
} else if (_root.gameType == 9) {
_local5 = 4;
} else if (_root.gameType == 12) {
_local5 = 5;
} else if (_root.gameType == 16) {
_local5 = 6;
}
var _local3 = 1;
while (_local3 < 7) {
if (_root.panel.kinds["kind" + _local3] == this) {
this._checked = true;
var _local4;
if (_local3 == 1) {
_local4 = 4;
} else if (_local3 == 2) {
_local4 = 6;
} else if (_local3 == 3) {
_local4 = 8;
} else if (_local3 == 4) {
_local4 = 9;
} else if (_local3 == 5) {
_local4 = 12;
} else if (_local3 == 6) {
_local4 = 16;
}
if (_local3 != _local5) {
_root.attachMovie("NewGameConfirmWnd", "confirmWnd", 10001);
_root.confirmWnd._x = 187.5 - (_root.confirmWnd._width / 2);
_root.confirmWnd._y = 187.5 - (_root.confirmWnd._height / 2);
_root.confirmWnd.newGameType = _local4;
_root.gameState = _root.gameStateWindow;
}
this.gotoAndStop(3);
} else {
_root.panel.kinds["kind" + _local3]._checked = false;
_root.panel.kinds["kind" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHardClick() {
var _local3 = 1;
while (_local3 < 4) {
if (_root.panel.hards["hard" + _local3] == this) {
if (_local3 != (_root.gameSkill + 1)) {
_root.attachMovie("HardConfirmWnd", "HardConfirmWnd", 10002);
_root.HardConfirmWnd._x = 187.5 - (_root.HardConfirmWnd._width / 2);
_root.HardConfirmWnd._y = 187.5 - (_root.HardConfirmWnd._height / 2);
_root.HardConfirmWnd.newHard = _local3 - 1;
_root.gameState = _root.gameStateWindow;
}
this._checked = true;
this.gotoAndStop(3);
} else {
_root.panel.hards["hard" + _local3]._checked = false;
_root.panel.hards["hard" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHintsClick() {
this._checked = !this._checked;
_root.hints = this._checked;
_root.refreshedSmall = 0;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onSoundClick() {
this._checked = !this._checked;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onPopupClick() {
_root.refreshedSmall = 0;
this._checked = !this._checked;
_root.popup = this._checked;
if ((!this._checked) && (_root.popupIs)) {
removeMovieClip(_root.popupClp);
_root.popupIs = false;
}
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
this._checked = false;
Symbol 585 MovieClip Frame 2
stop();
Symbol 585 MovieClip Frame 3
stop();
Symbol 597 Button
on (release) {
onHardClick();
}
Symbol 598 MovieClip Frame 1
function onGameKindClick() {
var _local5;
if (_root.gameType == 4) {
_local5 = 1;
} else if (_root.gameType == 6) {
_local5 = 2;
} else if (_root.gameType == 8) {
_local5 = 3;
} else if (_root.gameType == 9) {
_local5 = 4;
} else if (_root.gameType == 12) {
_local5 = 5;
} else if (_root.gameType == 16) {
_local5 = 6;
}
var _local3 = 1;
while (_local3 < 7) {
if (_root.panel.kinds["kind" + _local3] == this) {
this._checked = true;
var _local4;
if (_local3 == 1) {
_local4 = 4;
} else if (_local3 == 2) {
_local4 = 6;
} else if (_local3 == 3) {
_local4 = 8;
} else if (_local3 == 4) {
_local4 = 9;
} else if (_local3 == 5) {
_local4 = 12;
} else if (_local3 == 6) {
_local4 = 16;
}
if (_local3 != _local5) {
_root.attachMovie("NewGameConfirmWnd", "confirmWnd", 10001);
_root.confirmWnd._x = 187.5 - (_root.confirmWnd._width / 2);
_root.confirmWnd._y = 187.5 - (_root.confirmWnd._height / 2);
_root.confirmWnd.newGameType = _local4;
_root.gameState = _root.gameStateWindow;
}
this.gotoAndStop(3);
} else {
_root.panel.kinds["kind" + _local3]._checked = false;
_root.panel.kinds["kind" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHardClick() {
var _local3 = 1;
while (_local3 < 4) {
if (_root.panel.hards["hard" + _local3] == this) {
if (_local3 != (_root.gameSkill + 1)) {
_root.attachMovie("HardConfirmWnd", "HardConfirmWnd", 10002);
_root.HardConfirmWnd._x = 187.5 - (_root.HardConfirmWnd._width / 2);
_root.HardConfirmWnd._y = 187.5 - (_root.HardConfirmWnd._height / 2);
_root.HardConfirmWnd.newHard = _local3 - 1;
_root.gameState = _root.gameStateWindow;
}
this._checked = true;
this.gotoAndStop(3);
} else {
_root.panel.hards["hard" + _local3]._checked = false;
_root.panel.hards["hard" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHintsClick() {
this._checked = !this._checked;
_root.hints = this._checked;
_root.refreshedSmall = 0;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onSoundClick() {
this._checked = !this._checked;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onPopupClick() {
_root.refreshedSmall = 0;
this._checked = !this._checked;
_root.popup = this._checked;
if ((!this._checked) && (_root.popupIs)) {
removeMovieClip(_root.popupClp);
_root.popupIs = false;
}
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
this._checked = false;
Symbol 598 MovieClip Frame 2
stop();
Symbol 598 MovieClip Frame 3
stop();
Symbol 606 Button
on (release) {
_root.attachMovie("NewGameConfirmWnd", "confirmWnd", 10001);
_root.confirmWnd._x = 187.5 - (_root.confirmWnd._width / 2);
_root.confirmWnd._y = 187.5 - (_root.confirmWnd._height / 2);
_root.confirmWnd.newGameType = _root.gameType;
}
Symbol 611 Button
on (release) {
onHintsClick();
}
Symbol 616 Button
on (release) {
onHintsClick();
}
Symbol 617 MovieClip Frame 1
function onGameKindClick() {
var _local5;
if (_root.gameType == 4) {
_local5 = 1;
} else if (_root.gameType == 6) {
_local5 = 2;
} else if (_root.gameType == 8) {
_local5 = 3;
} else if (_root.gameType == 9) {
_local5 = 4;
} else if (_root.gameType == 12) {
_local5 = 5;
} else if (_root.gameType == 16) {
_local5 = 6;
}
var _local3 = 1;
while (_local3 < 7) {
if (_root.panel.kinds["kind" + _local3] == this) {
this._checked = true;
var _local4;
if (_local3 == 1) {
_local4 = 4;
} else if (_local3 == 2) {
_local4 = 6;
} else if (_local3 == 3) {
_local4 = 8;
} else if (_local3 == 4) {
_local4 = 9;
} else if (_local3 == 5) {
_local4 = 12;
} else if (_local3 == 6) {
_local4 = 16;
}
if (_local3 != _local5) {
_root.attachMovie("NewGameConfirmWnd", "confirmWnd", 10001);
_root.confirmWnd._x = 187.5 - (_root.confirmWnd._width / 2);
_root.confirmWnd._y = 187.5 - (_root.confirmWnd._height / 2);
_root.confirmWnd.newGameType = _local4;
_root.gameState = _root.gameStateWindow;
}
this.gotoAndStop(3);
} else {
_root.panel.kinds["kind" + _local3]._checked = false;
_root.panel.kinds["kind" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHardClick() {
var _local3 = 1;
while (_local3 < 4) {
if (_root.panel.hards["hard" + _local3] == this) {
if (_local3 != (_root.gameSkill + 1)) {
_root.attachMovie("HardConfirmWnd", "HardConfirmWnd", 10002);
_root.HardConfirmWnd._x = 187.5 - (_root.HardConfirmWnd._width / 2);
_root.HardConfirmWnd._y = 187.5 - (_root.HardConfirmWnd._height / 2);
_root.HardConfirmWnd.newHard = _local3 - 1;
_root.gameState = _root.gameStateWindow;
}
this._checked = true;
this.gotoAndStop(3);
} else {
_root.panel.hards["hard" + _local3]._checked = false;
_root.panel.hards["hard" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHintsClick() {
this._checked = !this._checked;
_root.hints = this._checked;
_root.refreshedSmall = 0;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onSoundClick() {
this._checked = !this._checked;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onPopupClick() {
_root.refreshedSmall = 0;
this._checked = !this._checked;
_root.popup = this._checked;
if ((!this._checked) && (_root.popupIs)) {
removeMovieClip(_root.popupClp);
_root.popupIs = false;
}
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
this._checked = true;
gotoAndStop (3);
Symbol 617 MovieClip Frame 2
stop();
Symbol 617 MovieClip Frame 3
stop();
Symbol 619 Button
on (release) {
onSoundClick();
}
Symbol 620 Button
on (release) {
onSoundClick();
}
Symbol 621 MovieClip Frame 1
function onGameKindClick() {
var _local5;
if (_root.gameType == 4) {
_local5 = 1;
} else if (_root.gameType == 6) {
_local5 = 2;
} else if (_root.gameType == 8) {
_local5 = 3;
} else if (_root.gameType == 9) {
_local5 = 4;
} else if (_root.gameType == 12) {
_local5 = 5;
} else if (_root.gameType == 16) {
_local5 = 6;
}
var _local3 = 1;
while (_local3 < 7) {
if (_root.panel.kinds["kind" + _local3] == this) {
this._checked = true;
var _local4;
if (_local3 == 1) {
_local4 = 4;
} else if (_local3 == 2) {
_local4 = 6;
} else if (_local3 == 3) {
_local4 = 8;
} else if (_local3 == 4) {
_local4 = 9;
} else if (_local3 == 5) {
_local4 = 12;
} else if (_local3 == 6) {
_local4 = 16;
}
if (_local3 != _local5) {
_root.attachMovie("NewGameConfirmWnd", "confirmWnd", 10001);
_root.confirmWnd._x = 187.5 - (_root.confirmWnd._width / 2);
_root.confirmWnd._y = 187.5 - (_root.confirmWnd._height / 2);
_root.confirmWnd.newGameType = _local4;
_root.gameState = _root.gameStateWindow;
}
this.gotoAndStop(3);
} else {
_root.panel.kinds["kind" + _local3]._checked = false;
_root.panel.kinds["kind" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHardClick() {
var _local3 = 1;
while (_local3 < 4) {
if (_root.panel.hards["hard" + _local3] == this) {
if (_local3 != (_root.gameSkill + 1)) {
_root.attachMovie("HardConfirmWnd", "HardConfirmWnd", 10002);
_root.HardConfirmWnd._x = 187.5 - (_root.HardConfirmWnd._width / 2);
_root.HardConfirmWnd._y = 187.5 - (_root.HardConfirmWnd._height / 2);
_root.HardConfirmWnd.newHard = _local3 - 1;
_root.gameState = _root.gameStateWindow;
}
this._checked = true;
this.gotoAndStop(3);
} else {
_root.panel.hards["hard" + _local3]._checked = false;
_root.panel.hards["hard" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHintsClick() {
this._checked = !this._checked;
_root.hints = this._checked;
_root.refreshedSmall = 0;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onSoundClick() {
this._checked = !this._checked;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onPopupClick() {
_root.refreshedSmall = 0;
this._checked = !this._checked;
_root.popup = this._checked;
if ((!this._checked) && (_root.popupIs)) {
removeMovieClip(_root.popupClp);
_root.popupIs = false;
}
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
this._checked = true;
gotoAndStop (3);
Symbol 621 MovieClip Frame 2
stop();
Symbol 621 MovieClip Frame 3
stop();
Symbol 623 Button
on (release) {
onPopupClick();
}
Symbol 624 Button
on (release) {
onPopupClick();
}
Symbol 625 MovieClip Frame 1
function onGameKindClick() {
var _local5;
if (_root.gameType == 4) {
_local5 = 1;
} else if (_root.gameType == 6) {
_local5 = 2;
} else if (_root.gameType == 8) {
_local5 = 3;
} else if (_root.gameType == 9) {
_local5 = 4;
} else if (_root.gameType == 12) {
_local5 = 5;
} else if (_root.gameType == 16) {
_local5 = 6;
}
var _local3 = 1;
while (_local3 < 7) {
if (_root.panel.kinds["kind" + _local3] == this) {
this._checked = true;
var _local4;
if (_local3 == 1) {
_local4 = 4;
} else if (_local3 == 2) {
_local4 = 6;
} else if (_local3 == 3) {
_local4 = 8;
} else if (_local3 == 4) {
_local4 = 9;
} else if (_local3 == 5) {
_local4 = 12;
} else if (_local3 == 6) {
_local4 = 16;
}
if (_local3 != _local5) {
_root.attachMovie("NewGameConfirmWnd", "confirmWnd", 10001);
_root.confirmWnd._x = 187.5 - (_root.confirmWnd._width / 2);
_root.confirmWnd._y = 187.5 - (_root.confirmWnd._height / 2);
_root.confirmWnd.newGameType = _local4;
_root.gameState = _root.gameStateWindow;
}
this.gotoAndStop(3);
} else {
_root.panel.kinds["kind" + _local3]._checked = false;
_root.panel.kinds["kind" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHardClick() {
var _local3 = 1;
while (_local3 < 4) {
if (_root.panel.hards["hard" + _local3] == this) {
if (_local3 != (_root.gameSkill + 1)) {
_root.attachMovie("HardConfirmWnd", "HardConfirmWnd", 10002);
_root.HardConfirmWnd._x = 187.5 - (_root.HardConfirmWnd._width / 2);
_root.HardConfirmWnd._y = 187.5 - (_root.HardConfirmWnd._height / 2);
_root.HardConfirmWnd.newHard = _local3 - 1;
_root.gameState = _root.gameStateWindow;
}
this._checked = true;
this.gotoAndStop(3);
} else {
_root.panel.hards["hard" + _local3]._checked = false;
_root.panel.hards["hard" + _local3].gotoAndStop(2);
}
_local3++;
}
}
function onHintsClick() {
this._checked = !this._checked;
_root.hints = this._checked;
_root.refreshedSmall = 0;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onSoundClick() {
this._checked = !this._checked;
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
function onPopupClick() {
_root.refreshedSmall = 0;
this._checked = !this._checked;
_root.popup = this._checked;
if ((!this._checked) && (_root.popupIs)) {
removeMovieClip(_root.popupClp);
_root.popupIs = false;
}
if (this._checked) {
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
}
}
this._checked = true;
gotoAndStop (3);
Symbol 625 MovieClip Frame 2
stop();
Symbol 625 MovieClip Frame 3
stop();
Symbol 630 Button
on (release) {
_root.EditorMode();
}
Symbol 633 Button
on (release) {
if (_root.gameState == _root.gameStatePlaying) {
_root.gameState = _root.gameStateSolving;
if (!_root.checkCorrect()) {
_root.attachMovie("mtNoSol", "mtNoSol", 10005);
_root.gameState = _root.gameStateWindow;
return(undefined);
}
} else if (_root.gameState == _root.gameStateSolving) {
_root.gameState = _root.gameStatePlaying;
}
}