Frame 1
Stage.showMenu = false;
maxTime = 30;
stop();
Frame 2
function nextStage() {
gotoAndStop (3);
}
function gameContinue() {
this.gameover_.removeMovieClip();
gotoAndPlay (1);
}
puzzleDw = 5;
puzzleDh = 4;
clearFlag = 0;
startTargetlayer = 100;
startLocklayer = 200;
startPuzzlelayer = 300;
nowDraglayer = 400;
infolayer = 1000;
maxTime = maxTime + 150;
dragNo = -1;
catchPuzzle = new Array();
puzzleRotation = new Array();
clearPuzzle = new Array();
i = 0;
while (i < (puzzleDw * puzzleDh)) {
catchPuzzle[i] = -1;
clearPuzzle[i] = -1;
i++;
}
soundRotation = new Sound();
soundRotation.attachSound("rotationsound");
soundRotation.setVolume(100);
stop();
Instance of Symbol 19 MovieClip "target" in Frame 2
onClipEvent (load) {
if (_name == "target") {
maxNum = _parent.puzzleDw * _parent.puzzleDh;
num = 0;
while (num < maxNum) {
this.duplicateMovieClip("target" + num, _parent.startTargetlayer - num);
_parent["target" + num].myNum = num;
num++;
}
_visible = false;
} else {
_x = (_parent.target._x + (Math.floor(myNum % _parent.puzzleDw) * _parent.puzzleW));
_y = (_parent.target._y + (Math.floor(myNum / _parent.puzzleDw) * _parent.puzzleH));
}
}
Instance of Symbol 54 MovieClip "chip" in Frame 2
onClipEvent (load) {
function hitChecker() {
var _local3;
_local3 = 0;
while (_local3 < (_parent.puzzleDw * _parent.puzzleDh)) {
if (_parent["chip" + _local3].hitTest(_root._xmouse, _root._ymouse, true) && (_parent.viewTime > 0)) {
if (_parent["chip" + _local3].catchStatus == -1) {
return(_local3);
}
}
_local3++;
}
_local3 = 0;
while (_local3 < (_parent.puzzleDw * _parent.puzzleDh)) {
if (_parent["chip" + _local3].hitTest(_root._xmouse, _root._ymouse, true) && (_parent.viewTime > 0)) {
return(_local3);
}
_local3++;
}
}
if (_name == "chip") {
var maxNum = (_parent.puzzleDw * _parent.puzzleDh);
num = 0;
while (num < maxNum) {
this.duplicateMovieClip("chip" + num, _parent.startPuzzlelayer - num);
_parent["chip" + num].puzzleNo = num;
_parent["chip" + num].catchStatus = -1;
_parent.puzzleX = -this.graphic._x;
_parent.puzzleY = -this.graphic._y;
_parent.puzzleW = _parent.target._xscale;
_parent.puzzleH = _parent.target._yscale;
num++;
}
_visible = false;
} else {
_x = ((Math.random() * 700) + 50);
_y = ((Math.random() * 500) + 50);
_parent.puzzleRotation[this.puzzleNo] = Math.floor(Math.random() * 4);
nowRotation = Math.floor(_parent.puzzleRotation[num] * 3) * 90;
this.graphic._x = (-_parent.puzzleX) - (Math.floor(this.puzzleNo % _parent.puzzleDw) * _parent.puzzleW);
this.graphic._y = (-_parent.puzzleY) - (Math.floor(this.puzzleNo / _parent.puzzleDw) * _parent.puzzleH);
this.Noclearflag = 1;
this.Rotclearflag = 1;
}
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true) && (_name != "chip")) {
if (hitChecker() == this.puzzleNo) {
this.startDrag();
this.catchStatus = -1;
_parent.dragsabunX = _x - _parent._xmouse;
_parent.dragsabunY = _y - _parent._ymouse;
this.swapDepths(_parent.nowDraglayer);
_parent.dragNo = this.puzzleNo;
oldX = _root._xmouse;
oldY = _root._ymouse;
_parent.clearPuzzle[num] = -1;
maxNum = _parent.puzzleDw * _parent.puzzleDh;
num = 0;
while (num < maxNum) {
if (_parent.catchPuzzle[num] == this.puzzleNo) {
_parent.catchPuzzle[num] = -1;
_visible = true;
break;
}
num++;
}
}
}
}
onClipEvent (mouseUp) {
var tmpX = (oldX - _root._xmouse);
var tmpY = (oldY - _root._ymouse);
if (((tmpX * tmpX) + (tmpY * tmpY)) < 4) {
_parent.puzzleRotation[this.puzzleNo] = (_parent.puzzleRotation[this.puzzleNo] + 1) % 4;
}
if ((_parent.dragNo == this.puzzleNo) && (_name != "chip")) {
this.stopDrag();
_parent.dragNo = -1;
this.swapDepths(_parent.startPuzzlelayer - this.puzzleNo);
maxNum = _parent.puzzleDw * _parent.puzzleDh;
num = 0;
while (num < maxNum) {
var tmpX = (_parent.target._x + (Math.floor(num % _parent.puzzleDw) * _parent.puzzleW));
var tmpY = (_parent.target._y + (Math.floor(num / _parent.puzzleDw) * _parent.puzzleH));
if ((Math.abs(_x - tmpX) < (_parent.puzzleW / 4)) && (Math.abs(_y - tmpY) < (_parent.puzzleH / 4))) {
if (_parent.catchPuzzle[num] == -1) {
_x = tmpX;
_y = tmpY;
_parent.catchPuzzle[num] = this.puzzleNo;
this.catchStatus = num;
if (this.puzzleNo == num) {
this.Noclearflag = 0;
} else {
this.Noclearflag = 1;
}
this.swapDepths(_parent.startLocklayer - this.puzzleNo);
this._x = tmpX;
this._y = tmpY;
break;
}
}
num++;
}
}
}
onClipEvent (enterFrame) {
if (_parent.puzzleRotation[this.puzzleNo] == 0) {
this.Rotclearfag = 0;
} else {
this.Rotclearfag = 1;
}
if ((Math.floor(_parent.puzzleRotation[this.puzzleNo]) * 90) != ((_rotation + 360) % 360)) {
_rotation = (_rotation + 30);
if ((Math.floor(_parent.puzzleRotation[this.puzzleNo]) * 90) == ((_rotation + 360) % 360)) {
_parent.soundRotation.start(Math.random() * 0.1, 1);
}
}
}
Instance of Symbol 55 MovieClip in Frame 2
onClipEvent (load) {
_visible = false;
startDate = new Date();
}
onClipEvent (enterFrame) {
nonclear = 0;
tmp = 0;
while (tmp < (_parent.puzzleDw * _parent.puzzleDh)) {
nonclear = (nonclear + _parent["chip" + tmp].Noclearflag) + ((_parent["chip" + tmp]._rotation + 360) % 360);
tmp++;
}
tmp = 0;
while (tmp < (_parent.puzzleDw * _parent.puzzleDh)) {
if (_parent.catchPuzzle[tmp] == -1) {
nonclear = -1;
}
tmp++;
}
if (nonclear == 0) {
var maxNum = (_parent.puzzleDw * _parent.puzzleDh);
var num = 0;
while (num < maxNum) {
_parent["target" + num].removeMovieClip();
_parent["chip" + num].removeMovieClip();
num++;
}
_parent.clearFlag = 1;
_parent.nextStage();
}
var nowDate = new Date();
_parent.viewTime = _parent.maxTime - Math.floor((nowDate.getTime() - startDate.getTime()) / 1000);
if (_parent.viewTime <= 0) {
_parent.viewTime = 0;
_parent.gameover_._visible = true;
}
}
Instance of Symbol 59 MovieClip "gameover" in Frame 2
onClipEvent (load) {
if (_name == "gameover") {
this.duplicateMovieClip("gameover_", _parent.infolayer);
}
_visible = false;
}
onClipEvent (mouseDown) {
if (_visible == true) {
var maxNum = (_parent.puzzleDw * _parent.puzzleDh);
var num = 0;
while (num < maxNum) {
_parent["target" + num].removeMovieClip();
_parent["chip" + num].removeMovieClip();
num++;
}
_parent.gameContinue();
}
}
Frame 3
if ((clearFlag = 0)) {
gotoAndPlay (1);
}
maxTime = viewTime;
stop();
Frame 4
function nextStage() {
gotoAndStop (5);
}
function gameContinue() {
this.gameover_.removeMovieClip();
gotoAndPlay (1);
}
puzzleDw = 5;
puzzleDh = 4;
clearFlag = 0;
startTargetlayer = 100;
startLocklayer = 200;
startPuzzlelayer = 300;
nowDraglayer = 400;
infolayer = 1000;
maxTime = maxTime + 150;
dragNo = -1;
catchPuzzle = new Array();
puzzleRotation = new Array();
clearPuzzle = new Array();
i = 0;
while (i < (puzzleDw * puzzleDh)) {
catchPuzzle[i] = -1;
clearPuzzle[i] = -1;
i++;
}
soundRotation = new Sound();
soundRotation.attachSound("rotationsound");
soundRotation.setVolume(100);
stop();
Instance of Symbol 19 MovieClip "target" in Frame 4
onClipEvent (load) {
if (_name == "target") {
maxNum = _parent.puzzleDw * _parent.puzzleDh;
num = 0;
while (num < maxNum) {
this.duplicateMovieClip("target" + num, _parent.startTargetlayer - num);
_parent["target" + num].myNum = num;
num++;
}
_visible = false;
} else {
_x = (_parent.target._x + (Math.floor(myNum % _parent.puzzleDw) * _parent.puzzleW));
_y = (_parent.target._y + (Math.floor(myNum / _parent.puzzleDw) * _parent.puzzleH));
}
}
Instance of Symbol 89 MovieClip "chip" in Frame 4
onClipEvent (load) {
function hitChecker() {
var _local3;
_local3 = 0;
while (_local3 < (_parent.puzzleDw * _parent.puzzleDh)) {
if (_parent["chip" + _local3].hitTest(_root._xmouse, _root._ymouse, true) && (_parent.viewTime > 0)) {
if (_parent["chip" + _local3].catchStatus == -1) {
return(_local3);
}
}
_local3++;
}
_local3 = 0;
while (_local3 < (_parent.puzzleDw * _parent.puzzleDh)) {
if (_parent["chip" + _local3].hitTest(_root._xmouse, _root._ymouse, true) && (_parent.viewTime > 0)) {
return(_local3);
}
_local3++;
}
}
if (_name == "chip") {
var maxNum = (_parent.puzzleDw * _parent.puzzleDh);
num = 0;
while (num < maxNum) {
this.duplicateMovieClip("chip" + num, _parent.startPuzzlelayer - num);
_parent["chip" + num].puzzleNo = num;
_parent["chip" + num].catchStatus = -1;
_parent.puzzleX = -this.graphic._x;
_parent.puzzleY = -this.graphic._y;
_parent.puzzleW = _parent.target._xscale;
_parent.puzzleH = _parent.target._yscale;
num++;
}
_visible = false;
} else {
_x = ((Math.random() * 700) + 50);
_y = ((Math.random() * 500) + 50);
_parent.puzzleRotation[this.puzzleNo] = Math.floor(Math.random() * 4);
nowRotation = Math.floor(_parent.puzzleRotation[num] * 3) * 90;
this.graphic._x = (-_parent.puzzleX) - (Math.floor(this.puzzleNo % _parent.puzzleDw) * _parent.puzzleW);
this.graphic._y = (-_parent.puzzleY) - (Math.floor(this.puzzleNo / _parent.puzzleDw) * _parent.puzzleH);
this.Noclearflag = 1;
this.Rotclearflag = 1;
}
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true) && (_name != "chip")) {
if (hitChecker() == this.puzzleNo) {
this.startDrag();
this.catchStatus = -1;
_parent.dragsabunX = _x - _parent._xmouse;
_parent.dragsabunY = _y - _parent._ymouse;
this.swapDepths(_parent.nowDraglayer);
_parent.dragNo = this.puzzleNo;
oldX = _root._xmouse;
oldY = _root._ymouse;
_parent.clearPuzzle[num] = -1;
maxNum = _parent.puzzleDw * _parent.puzzleDh;
num = 0;
while (num < maxNum) {
if (_parent.catchPuzzle[num] == this.puzzleNo) {
_parent.catchPuzzle[num] = -1;
_visible = true;
break;
}
num++;
}
}
}
}
onClipEvent (mouseUp) {
var tmpX = (oldX - _root._xmouse);
var tmpY = (oldY - _root._ymouse);
if (((tmpX * tmpX) + (tmpY * tmpY)) < 4) {
_parent.puzzleRotation[this.puzzleNo] = (_parent.puzzleRotation[this.puzzleNo] + 1) % 4;
}
if ((_parent.dragNo == this.puzzleNo) && (_name != "chip")) {
this.stopDrag();
_parent.dragNo = -1;
this.swapDepths(_parent.startPuzzlelayer - this.puzzleNo);
maxNum = _parent.puzzleDw * _parent.puzzleDh;
num = 0;
while (num < maxNum) {
var tmpX = (_parent.target._x + (Math.floor(num % _parent.puzzleDw) * _parent.puzzleW));
var tmpY = (_parent.target._y + (Math.floor(num / _parent.puzzleDw) * _parent.puzzleH));
if ((Math.abs(_x - tmpX) < (_parent.puzzleW / 4)) && (Math.abs(_y - tmpY) < (_parent.puzzleH / 4))) {
if (_parent.catchPuzzle[num] == -1) {
_x = tmpX;
_y = tmpY;
_parent.catchPuzzle[num] = this.puzzleNo;
this.catchStatus = num;
if (this.puzzleNo == num) {
this.Noclearflag = 0;
} else {
this.Noclearflag = 1;
}
this.swapDepths(_parent.startLocklayer - this.puzzleNo);
this._x = tmpX;
this._y = tmpY;
break;
}
}
num++;
}
}
}
onClipEvent (enterFrame) {
if (_parent.puzzleRotation[this.puzzleNo] == 0) {
this.Rotclearfag = 0;
} else {
this.Rotclearfag = 1;
}
if ((Math.floor(_parent.puzzleRotation[this.puzzleNo]) * 90) != ((_rotation + 360) % 360)) {
_rotation = (_rotation + 30);
if ((Math.floor(_parent.puzzleRotation[this.puzzleNo]) * 90) == ((_rotation + 360) % 360)) {
_parent.soundRotation.start(Math.random() * 0.1, 1);
}
}
}
Instance of Symbol 59 MovieClip "gameover" in Frame 4
onClipEvent (load) {
if (_name == "gameover") {
this.duplicateMovieClip("gameover_", _parent.infolayer);
}
_visible = false;
}
onClipEvent (mouseDown) {
if (_visible == true) {
var maxNum = (_parent.puzzleDw * _parent.puzzleDh);
var num = 0;
while (num < maxNum) {
_parent["target" + num].removeMovieClip();
_parent["chip" + num].removeMovieClip();
num++;
}
_parent.gameContinue();
}
}
Frame 5
if ((clearFlag = 0)) {
gotoAndPlay (1);
}
maxTime = viewTime;
stop();
Frame 6
function nextStage() {
gotoAndStop (7);
}
function gameContinue() {
this.gameover_.removeMovieClip();
gotoAndPlay (1);
}
puzzleDw = 5;
puzzleDh = 4;
clearFlag = 0;
startTargetlayer = 100;
startLocklayer = 200;
startPuzzlelayer = 300;
nowDraglayer = 400;
infolayer = 1000;
maxTime = maxTime + 150;
dragNo = -1;
catchPuzzle = new Array();
puzzleRotation = new Array();
clearPuzzle = new Array();
i = 0;
while (i < (puzzleDw * puzzleDh)) {
catchPuzzle[i] = -1;
clearPuzzle[i] = -1;
i++;
}
soundRotation = new Sound();
soundRotation.attachSound("rotationsound");
soundRotation.setVolume(100);
stop();
Symbol 8 Button
on (release) {
gotoAndStop (2);
}
Symbol 15 Button
on (release) {
getURL ("http://www.sexflash.pp.ua", "_self");
}
Symbol 63 Button
on (release) {
gotoAndStop (4);
}
Symbol 91 Button
on (release) {
gotoAndStop (6);
}
Symbol 94 Button
on (release, keyPress "1") {
gotoAndStop (2);
}
Symbol 95 Button
on (release, keyPress "2") {
gotoAndStop (4);
}