Frame 1
function atualizar() {
_root.grade._visible = ((gradeShow == 1) ? 1 : 0);
_root.McMini._visible = ((MiniShow == 1) ? 1 : 0);
_root.mc._visible = ((sombraShow == 1) ? 1 : 0);
}
function dragFunc(mcToDrag, SimNao) {
if (SimNao) {
aMc++;
with (eval ("mc" + mcToDrag)) {
imgInv._visible = 1;
startDrag(false);
swapDepths(aMc);
}
} else if (!SimNao) {
with (eval ("mc" + mcToDrag)) {
imgInv._visible = 0;
stopDrag();
}
}
}
function checkPlace(McC) {
if (eval ("mcC" + McC).mask.hitTest(eval ("mc" + McC).hit)) {
eval ("mc" + McC)._x = eval ("mcC" + McC)._x;
eval ("mc" + McC)._y = eval ("mcC" + McC)._y;
eval ("mc" + McC).jogando = 0;
acertos++;
menu.statusMc.pE = acertos;
menu.statusMc.pR = (col * lin) - acertos;
}
if (acertos == (col * lin)) {
gotoAndPlay (3);
jogando = 0;
mc._alpha = 0;
mc._visible = 0;
McMini._visible = 0;
menu.menu2._visible = 1;
menu.bN._visible = 0;
menu.statusMc._visible = 0;
menu.parabensMc._visible = 1;
tempoT.removeMovieClip();
grade.clear();
aMc = 1;
while (aMc <= (col * lin)) {
eval ("mc" + aMc).removeMovieClip();
eval ("mcc" + aMc).removeMovieClip();
aMc++;
}
}
}
function misturar() {
col = ((colS >= 1) ? (Number(colS)) : 1);
lin = ((linS >= 1) ? (Number(linS)) : 1);
col = ((colS <= 10) ? (col) : 10);
lin = ((linS <= 10) ? (lin) : 10);
jogando = 1;
acertos = 0;
gradeShow = -1;
MiniShow = -1;
sombraShow = -1;
menu.statusMc.pE = 0;
menu.statusMc.pR = col * lin;
_root.createEmptyMovieClip("tempoT", 3);
tempoT.onEnterFrame = function () {
this.tempo = this.tempo + 0.0333333333333333;
_root.menu.statusMc.tT = Math.floor(this.tempo);
};
menu.statusMc._visible = 1;
menu.parabensMc._visible = 0;
mc._alpha = 30;
mc._visible = 0;
menu.menu2._visible = 0;
menu.bN._visible = 1;
_root.createEmptyMovieClip("grade", 0);
with (grade) {
moveTo(10, 10);
V = 1;
while (V <= col) {
lineStyle(1, 13158, 0);
lineto(((_root.mc.mask._width / col) * V) + 10, _root.mc.mask._height + 10);
lineStyle(1, 13158, 100);
lineto(((_root.mc.mask._width / col) * V) + 10, 10);
V++;
}
V = 1;
while (V <= lin) {
lineStyle(1, 13158, 0);
lineto(10, ((_root.mc.mask._height / lin) * V) + 10);
lineStyle(1, 13158, 100);
lineto(_root.mc.mask._width + 10, ((_root.mc.mask._height / lin) * V) + 10);
V++;
}
_visible = 0;
}
aMc = 1;
while (aMc <= (col * lin)) {
if (aCol == (col + 1)) {
aCol = 1;
aLin++;
}
_root.attachMovie("mc", "mc" + aMc, aMc + 10);
eval ("mc" + aMc).onPress = function () {
if (this.jogando) {
dragFunc(this.selfMc, 1);
}
};
eval ("mc" + aMc).onRelease = function () {
if (this.jogando) {
dragFunc(this.selfMc, 0);
checkPlace(this.selfMc);
}
};
eval ("mc" + aMc).onReleaseOutside = function () {
if (this.jogando) {
dragFunc(this.selfMc, 0);
checkPlace(this.selfMc);
}
};
eval ("mc" + aMc).selfMc = aMc;
eval ("mc" + aMc).jogando = 1;
eval ("mc" + aMc).useHandCursor = 0;
_root.attachMovie("mc", "mcC" + aMc, (Amc + (col * lin)) + 10);
with (eval ("mc" + aMc)) {
imgInv._visible = 0;
hit._visible = 0;
mask._height = mask._height / lin;
mask._width = mask._width / col;
maskInv._height = maskInv._height / lin;
maskInv._width = maskInv._width / col;
hit._xscale = mask._xscale;
hit._yscale = mask._yscale;
borda.moveTo(0, 0);
borda.lineStyle(1, 13158, 100);
borda.lineTo(0, mask._height);
borda.lineTo(mask._width, mask._height);
borda.lineTo(mask._width, 0);
borda.lineTo(0, 0);
img._x = (mask._width * (aCol - 1)) * -1;
img._y = (mask._height * (aLin - 1)) * -1;
imgInv._x = (mask._width * (aCol - 1)) * -1;
imgInv._y = (mask._height * (aLin - 1)) * -1;
_x = random(780 - mask._width) + 10;
_y = random(270 - mask._height) + 320;
with (eval ("mcC" + aMc)) {
_visible = 0;
mask._height = mask._height / lin;
mask._width = 470 / col;
maskInv._height = 300 / lin;
maskInv._width = 470 / col;
hit._xscale = mask._xscale;
hit._yscale = mask._yscale;
_x = 10 + (mask._width * (aCol - 1));
_y = 10 + (mask._height * (aLin - 1));
img._x = (_x * -1) + 10;
img._y = (_y * -1) + 10;
imgInv._x = (_x * -1) + 10;
imgInv._y = (_y * -1) + 10;
}
}
aCol++;
aMc++;
}
aMc = (col * lin) + 1;
aCol = 1;
aLin = 1;
}
aCol = 1;
aLin = 1;
colS = 5;
linS = 5;
jogando = 0;
gradeShow = -1;
MiniShow = -1;
sombraShow = -1;
_root.attachMovie("mc", "McMini", 2);
with (McMini) {
_xscale = 30;
_yscale = 30;
_x = 650;
_y = 220;
hit._visible = 0;
imgInv._visible = 0;
_visible = 0;
}
_root.attachMovie("mc", "mc", 1);
with (mc) {
_y = 10;
_x = 10;
imgInv._visible = 0;
hit._visible = 0;
}
menu.statusMc._visible = 0;
menu.parabensMc._visible = 0;
menu.bN.onRelease = function () {
gotoAndPlay (2);
acertos = col * lin;
checkPlace();
};
menu.bn._visible = 0;
menu.menu2.bm.onRelease = function () {
misturar();
};
menu.bm1.onRelease = function () {
if (jogando) {
gradeShow = gradeShow * -1;
atualizar();
}
};
menu.bm2.onRelease = function () {
if (jogando) {
MiniShow = MiniShow * -1;
atualizar();
}
};
menu.bm3.onRelease = function () {
if (jogando) {
sombraShow = sombraShow * -1;
atualizar();
}
};
stop();
Frame 2
gotoAndPlay (1);