Frame 1
stop();
fscommand ("showmenu", false);
_root.sunet = 1;
_root.best = 32;
logo.onEnterFrame = function () {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
this.play();
} else {
tgFrame = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
this.progress.gotoAndStop(tgFrame);
}
};
Frame 2
stop();
son = new Sound();
son.attachSound("muzica");
son.setVolume(40);
if (_root.kx == null) {
son.start(1, 9999);
_root.kx = 1;
}
Frame 3
stop();
_root.bestScore.text = _root.best;
this.calcMoves = function () {
moves = 0;
i = 1;
while (i <= 7) {
j = 1;
while (j <= 7) {
ok1 = true;
iniPosX1 = i;
iniPosY1 = j;
finPosX1 = i;
finPosY1 = j + 2;
if (_root.hole[iniPosX1][iniPosY1] != 1) {
ok1 = false;
}
if (_root.hole[finPosX1][finPosY1] != 0) {
ok1 = false;
}
if (_root.hole[(finPosX1 + iniPosX1) / 2][(finPosY1 + iniPosY1) / 2] != 1) {
ok1 = false;
}
if (ok1 == true) {
moves++;
}
ok1 = true;
iniPosX1 = i;
iniPosY1 = j;
finPosX1 = i + 2;
finPosY1 = j + 2;
if (_root.hole[iniPosX1][iniPosY1] != 1) {
ok1 = false;
}
if (_root.hole[finPosX1][finPosY1] != 0) {
ok1 = false;
}
if (_root.hole[(finPosX1 + iniPosX1) / 2][(finPosY1 + iniPosY1) / 2] != 1) {
ok1 = false;
}
if (ok1 == true) {
moves++;
}
ok1 = true;
iniPosX1 = i;
iniPosY1 = j;
finPosX1 = i + 2;
finPosY1 = j;
if (_root.hole[iniPosX1][iniPosY1] != 1) {
ok1 = false;
}
if (_root.hole[finPosX1][finPosY1] != 0) {
ok1 = false;
}
if (_root.hole[(finPosX1 + iniPosX1) / 2][(finPosY1 + iniPosY1) / 2] != 1) {
ok1 = false;
}
if (ok1 == true) {
moves++;
}
ok1 = true;
iniPosX1 = i;
iniPosY1 = j;
finPosX1 = i + 2;
finPosY1 = j - 2;
if (_root.hole[iniPosX1][iniPosY1] != 1) {
ok1 = false;
}
if (_root.hole[finPosX1][finPosY1] != 0) {
ok1 = false;
}
if (_root.hole[(finPosX1 + iniPosX1) / 2][(finPosY1 + iniPosY1) / 2] != 1) {
ok1 = false;
}
if (ok1 == true) {
moves++;
}
ok1 = true;
iniPosX1 = i;
iniPosY1 = j;
finPosX1 = i;
finPosY1 = j - 2;
if (_root.hole[iniPosX1][iniPosY1] != 1) {
ok1 = false;
}
if (_root.hole[finPosX1][finPosY1] != 0) {
ok1 = false;
}
if (_root.hole[(finPosX1 + iniPosX1) / 2][(finPosY1 + iniPosY1) / 2] != 1) {
ok1 = false;
}
if (ok1 == true) {
moves++;
}
ok1 = true;
iniPosX1 = i;
iniPosY1 = j;
finPosX1 = i - 2;
finPosY1 = j - 2;
if (_root.hole[iniPosX1][iniPosY1] != 1) {
ok1 = false;
}
if (_root.hole[finPosX1][finPosY1] != 0) {
ok1 = false;
}
if (_root.hole[(finPosX1 + iniPosX1) / 2][(finPosY1 + iniPosY1) / 2] != 1) {
ok1 = false;
}
if (ok1 == true) {
moves++;
}
ok1 = true;
iniPosX1 = i;
iniPosY1 = j;
finPosX1 = i - 2;
finPosY1 = j;
if (_root.hole[iniPosX1][iniPosY1] != 1) {
ok1 = false;
}
if (_root.hole[finPosX1][finPosY1] != 0) {
ok1 = false;
}
if (_root.hole[(finPosX1 + iniPosX1) / 2][(finPosY1 + iniPosY1) / 2] != 1) {
ok1 = false;
}
if (ok1 == true) {
moves++;
}
ok1 = true;
iniPosX1 = i;
iniPosY1 = j;
finPosX1 = i - 2;
finPosY1 = j + 2;
if (_root.hole[iniPosX1][iniPosY1] != 1) {
ok1 = false;
}
if (_root.hole[finPosX1][finPosY1] != 0) {
ok1 = false;
}
if (_root.hole[(finPosX1 + iniPosX1) / 2][(finPosY1 + iniPosY1) / 2] != 1) {
ok1 = false;
}
if (ok1 == true) {
moves++;
}
j++;
}
i++;
}
return(moves);
};
hole = new Array();
_root.movesM = 0;
_root.piecesL = 32;
i = 1;
while (i <= 7) {
hole[i] = new Array();
i++;
}
i = 1;
while (i <= 7) {
j = 1;
while (j <= 7) {
hole[i][j] = 1;
j++;
}
i++;
}
hole[1][1] = -1;
hole[1][2] = -1;
hole[2][1] = -1;
hole[2][2] = -1;
hole[1][6] = -1;
hole[1][7] = -1;
hole[2][6] = -1;
hole[2][7] = -1;
hole[6][1] = -1;
hole[6][2] = -1;
hole[7][1] = -1;
hole[7][2] = -1;
hole[6][6] = -1;
hole[6][7] = -1;
hole[7][6] = -1;
hole[7][7] = -1;
hole[4][4] = 0;
piece = new Array();
i = 1;
while (i <= 7) {
piece[i] = new Array();
i++;
}
i = 1;
while (i <= 7) {
j = 1;
while (j <= 7) {
piece[i][j] = 0;
j++;
}
i++;
}
piece[1][3] = 1;
piece[1][4] = 2;
piece[1][5] = 3;
piece[2][3] = 4;
piece[2][4] = 5;
piece[2][5] = 6;
piece[3][1] = 7;
piece[3][2] = 8;
piece[3][3] = 9;
piece[3][4] = 10;
piece[3][5] = 11;
piece[3][6] = 12;
piece[3][7] = 13;
piece[4][1] = 14;
piece[4][2] = 15;
piece[4][3] = 16;
piece[4][5] = 17;
piece[4][6] = 18;
piece[4][7] = 19;
piece[5][1] = 20;
piece[5][2] = 21;
piece[5][3] = 22;
piece[5][4] = 23;
piece[5][5] = 24;
piece[5][6] = 25;
piece[5][7] = 26;
piece[6][3] = 27;
piece[6][4] = 28;
piece[6][5] = 29;
piece[7][3] = 30;
piece[7][4] = 31;
piece[7][5] = 32;
Symbol 9 MovieClip Frame 1
stop();
Symbol 13 MovieClip Frame 36
stop();
Symbol 13 MovieClip Frame 155
_root.gotoAndStop(2);
Symbol 22 Button
on (release) {
_root.gotoAndStop(3);
}
Symbol 26 Button
on (release) {
if (_root.sunet == 0) {
_root.sunet = 1;
_root.son.start(0, 100);
} else {
_root.sunet = 0;
_root.son.stop();
}
}
Symbol 30 MovieClip Frame 1
this.onPress = function () {
this._visible = 0;
oldX = this._x;
oldY = this._y;
iniPosX = Math.round((this._y - 72) / 40) + 1;
iniPosY = Math.round((this._x - 72) / 40) + 1;
_root.masca._x = this._x;
_root.masca._y = this._y;
_root.masca.startDrag();
};
this.onRelease = function () {
ok = true;
finPosX = Math.round((this._y - 72) / 40) + 1;
finPosY = Math.round((this._x - 72) / 40) + 1;
if (_root.hole[finPosX][finPosY] != 0) {
ok = false;
}
if (_root.hole[(finPosX + iniPosX) / 2][(finPosY + iniPosY) / 2] != 1) {
ok = false;
}
_root.masca.stopDrag();
this._visible = 1;
_root.masca._x = -1000;
_root.masca._y = -1000;
if (ok == true) {
this._x = 72 + ((finPosY + 1) * 40);
this._y = 72 + ((finPosX + 1) * 40);
} else {
this._x = iniPosX;
this._y = iniPosY;
}
};
this.onReleaseOutside = function () {
ok = true;
finPosX = Math.round((_root.masca._y - 72) / 40) + 1;
finPosY = Math.round((_root.masca._x - 72) / 40) + 1;
if (_root.hole[finPosX][finPosY] != 0) {
ok = false;
}
if (_root.hole[(finPosX + iniPosX) / 2][(finPosY + iniPosY) / 2] != 1) {
ok = false;
}
_root.masca.stopDrag();
this._visible = 1;
_root.masca._x = -1000;
_root.masca._y = -1000;
if (ok == true) {
_root.hole[iniPosX][iniPosY] = 0;
_root.hole[finPosX][finPosY] = 1;
_root.hole[(finPosX + iniPosX) / 2][(finPosY + iniPosY) / 2] = 0;
_root.piece[finPosX][finPosY] = _root.piece[iniPosX][iniPosY];
_root.piece[iniPosX][iniPosY] = 0;
kk1 = (finPosX + iniPosX) / 2;
kk2 = (finPosY + iniPosY) / 2;
kk3 = _root.piece[kk1][kk2];
_root["p" + kk3]._visible = 0;
_root.piece[kk1][kk2] = 0;
this._x = 72 + ((finPosY - 1) * 40);
this._y = 72 + ((finPosX - 1) * 40);
_root.movesM++;
_root.movesMade.text = _root.movesM;
_root.piecesL--;
_root.piecesLeft.text = _root.piecesL;
if (_root.piecesL < _root.best) {
_root.best = _root.piecesL;
_root.bestScore.text = _root.best;
}
xxx = _root.calcMoves();
_root.movesLeft.text = xxx;
if (xxx == 0) {
_root.gameOver.play();
}
} else {
this._x = oldX;
this._y = oldY;
}
};
Symbol 31 MovieClip Frame 1
this.onPress = function () {
this.startDrag();
masca._x = this._x;
masca._y = this._y;
};
this.onRelease = function () {
this.stopDrag();
masca._x = -1000;
masca._y = -1000;
};
Symbol 48 Button
on (release) {
_root.gotoAndStop(2);
}
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 2
stop();
Symbol 53 Button
on (release) {
_root.gotoAndStop(2);
}