Instance of Symbol 12 MovieClip "loading_mc" in Frame 1
//component parameters
onClipEvent (initialize) {
mcLoader = "_root";
}
onClipEvent (load) {
_root.stop();
}
onClipEvent (enterFrame) {
this.percentloaded = Math.floor((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (percentloaded >= 100) {
_root.play();
} else {
this.percentMC.percentdisplay = percentloaded + "%";
this.loaderbalken._xscale = percentloaded;
_root.stop();
}
}
Frame 5
stop();
Frame 7
cw = new Array(3, 4, 4);
ch = new Array(2, 2, 3);
if (diff == 2) {
topLeft = topLeft1;
bottomRight = bottomRight1;
} else {
topLeft = topLeft0;
bottomRight = bottomRight0;
}
seconds = 0;
startTimer = false;
time = "00:00";
pauseTime = 24;
playBack = false;
match = false;
timer = 0;
card_total = 8;
cardsWide = cw[diff];
cardsHigh = ch[diff];
cardMargin = 10;
totalWidth = (cardsWide * cardMaster._width) + ((cardsWide - 1) * cardMargin);
totalHeight = (cardsHigh * cardMaster._height) + ((cardsHigh - 1) * cardMargin);
availWidth = bottomRight._x - topLeft._x;
availHeight = bottomRight._y - topLeft._y;
trace((totalWidth + " ") + availWidth);
trace((totalHeight + " ") + availHeight);
xscale = availWidth / totalWidth;
yscale = availHeight / totalHeight;
if (xscale < yscale) {
xOff = 0;
scale = xscale;
} else {
xOff = (availWidth - (totalWidth * yscale)) / 2;
trace("xOff = " + xOff);
scale = yscale;
}
trace(scale);
cx = topLeft._x + xOff;
dx = (cardMaster._width + cardMargin) * scale;
dy = (cardMaster._height + cardMargin) * scale;
c = 0;
card = new Array();
i = 0;
while (i < cardsWide) {
cy = topLeft._y;
j = 0;
while (j < cardsHigh) {
cardMaster.duplicateMovieClip("cardGraphic" + c, c);
obj = eval ("cardGraphic" + c);
obj._x = cx;
obj._y = cy;
obj._xscale = scale * 100;
obj._yscale = scale * 100;
trace((obj._name + " ") + obj._xscale);
cy = cy + dy;
card[c] = obj;
card[c].frame = 0;
c++;
j++;
}
cx = cx + dx;
i++;
}
numCards = cardsWide * cardsHigh;
f = new Array();
i = 0;
while (i < card_total) {
f[i] = i + 3;
i++;
}
i = 0;
while (i < 100) {
r1 = random(card_total);
r2 = random(card_total);
t = f[r1];
f[r1] = f[r2];
f[r2] = t;
i++;
}
fc = 0;
i = 0;
while (i < numCards) {
card[i].frame = f[fc];
card[i + 1].frame = f[fc];
fc++;
i = i + 2;
}
i = 0;
while (i < numCards) {
card[i].done = false;
i++;
}
i = 0;
while (i < 500) {
r1 = random(numCards);
r2 = random(numCards);
t = card[r1].frame;
card[r1].frame = card[r2].frame;
card[r2].frame = t;
i++;
}
pressNum = 0;
pressed = new Array();
Frame 8
if (pressNum && (!startTimer)) {
startTimer = getTimer();
}
if (startTimer) {
seconds = int((getTimer() - startTimer) / 1000);
}
mins = int(seconds / 60);
secs = seconds % 60;
if (mins == 0) {
mins = "00";
} else if (mins < 10) {
mins = "0" + mins;
}
if (secs == 0) {
secs = "00";
} else if (secs < 10) {
secs = "0" + secs;
}
time = (mins + ":") + secs;
if (pressNum == 2) {
i = 0;
while (i < numCards) {
if (card[i]._currentFrame == 1) {
card[i].gotoAndStop(2);
}
i++;
}
pressNum = 0;
if (pressed[0].frame == pressed[1].frame) {
pressed[0].done = true;
pressed[1].done = true;
match = true;
timer = 1;
} else {
timer = pauseTime;
}
}
if ((!pressNum) and timer) {
timer--;
if (!timer) {
if (match) {
match = false;
i = 0;
while (i < numCards) {
if (!card[i].done) {
card[i].gotoAndStop(1);
}
i++;
}
} else {
playBack = true;
}
}
}
if (playBack) {
i = 0;
while (i < 2) {
if (pressed[i].anim._currentFrame > 1) {
pressed[i].anim.gotoAndStop(pressed[i].anim._currentFrame - 1);
}
i++;
}
if ((pressed[0].anim._currentFrame == 1) && (pressed[1].anim._currentFrame == 1)) {
i = 0;
while (i < numCards) {
if (!card[i].done) {
card[i].gotoAndStop(1);
}
i++;
}
playBack = false;
}
}
finished = true;
i = 0;
while (i < numCards) {
finished = finished && (card[i].done);
i++;
}
if (((finished && (!timer)) && (pressed[0].anim._currentFrame == 20)) && (pressed[1].anim._currentFrame == 20)) {
gotoAndStop (10);
}
Frame 9
gotoAndPlay (8);
Frame 10
speech.duplicateMovieClip("speech1", 32000);
Instance of Symbol 6 MovieClip "percentMC" in Symbol 12 MovieClip Frame 1
onClipEvent (enterFrame) {
this._x = _parent.percentloaded;
}
Symbol 16 Button
on (release) {
gotoAndStop(frame);
_root.pressed[_root.pressNum] = this;
_root.pressNum++;
}
Symbol 23 MovieClip Frame 20
stop();
Symbol 29 MovieClip Frame 20
stop();
Symbol 35 MovieClip Frame 20
stop();
Symbol 39 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 20
stop();
Symbol 47 MovieClip Frame 20
stop();
Symbol 52 MovieClip Frame 20
stop();
Symbol 56 MovieClip Frame 20
stop();
Symbol 60 MovieClip Frame 20
stop();
Symbol 61 MovieClip Frame 1
stop();
Symbol 71 Button
on (release) {
_parent.diff = 2;
_parent.play();
}
Symbol 72 Button
on (release) {
_parent.diff = 0;
_parent.play();
}
Symbol 73 Button
on (release) {
_parent.diff = 1;
_parent.play();
}
Symbol 77 MovieClip Frame 1
gotoAndPlay (2);
Symbol 77 MovieClip Frame 2
gotoAndPlay(random(50));
Symbol 77 MovieClip Frame 147
gotoAndPlay (2);
Symbol 84 Button
on (release) {
i = 0;
while (i < _parent.numCards) {
_parent.card[i].removeMovieClip();
i++;
}
_parent.gotoAndStop("restart");
gotoAndStop (1);
}
Symbol 88 MovieClip Frame 11
this.print_mc._visible = 0;
Symbol 88 MovieClip Frame 12
if (_parent.diff == 2) {
this.print_mc._visible = 1;
var file = "../images/download/";
var little = int(Math.random(20) + 1);
this.print_mc.print_litter2_mc._xscale = 40;
this.print_mc.print_litter2_mc._yscale = 40;
this.print_mc.print_litter_mc.loadMovie(file + "little01_570.jpg");
this.print_mc.print_litter2_mc.loadMovie(file + "little01_570.jpg");
}
stop();