Combined Code
frame 2 {
trycount = '0';
GameCount = 0;
CountX = 0;
CountY = 0;
Shuffle = '1122334455667788';
while (Number(CountX) < 4) {
while (Number(CountY) < 4) {
CurrentCount = Number(Number(CountX * 4) + Number(CountY)) + 1;
duplicateMovieClip('/Card0', 'Card' add CurrentCount, CurrentCount);
eval('/Card' add CurrentCount)._x = Number(CountX * 107) + 80;
eval('/Card' add CurrentCount)._y = Number(CountY * 145) + 80;
call('GetCard');
tellTarget (''/Card' add CurrentCount') {
MyCard = /:NewCard;
}
trace(CountY add ' ' add CountX add ' ' add CurrentCount);
CountY = Number(CountY) + 1;
trace('Card ' add CurrentCount add ' is number ' add MyCard);
}
CountY = 0;
CountX = Number(CountX) + 1;
}
ClickCount = '0';
FirstClick = '';
stop();
}
button 7 {
on (release) {
Display = 0;
/:trycount = Number(/:trycount) + 1;
/:trymatch = /:trycount / 2;
if (Number(Faceup) != 1) {
if (Number(/:ClickCount) == 0) {
Display = 1;
/:ClickCount = 1;
/:FirstClick = _target;
} else {
if (Number(/:ClickCount) == 1) {
if (!(_target eq /:FirstClick)) {
Display = 1;
if (MyCard != eval(/:FirstClick add '/:MyCard')) {
/:SecondClick = _target;
/:ClickCount = 2;
} else {
/:ClickCount = 0;
FaceUp = 1;
eval(eval(/:FirstClick add '/:Faceup')) = '1';
/:GameCount = Number(/:GameCount) + 1;
if (Number(/:GameCount) == 8) {
tellTarget ('/EOG') {
gotoAndPlay(2);
}
}
}
}
} else {
/:ClickCount = 0;
tellTarget ('/:FirstClick') {
gotoAndStop(1);
}
tellTarget ('/:SecondClick') {
gotoAndStop(1);
}
}
}
if (Number(Display) == 1) {
gotoAndStop(Number(MyCard) + 1);
}
}
}
}
movieClip 25 {
frame 1 {
stop();
}
}
button 29 {
on (release) {
tellTarget ('/') {
gotoAndPlay(1);
}
gotoAndStop(1);
}
}
movieClip 37 {
frame 1 {
stop();
}
frame 2 {
/:trymatch = int(/:trymatch);
}
frame 20 {
stop();
}
}
movieClip 39 {
}
frame 3 {
RandomPos = Number(random(length(Shuffle))) + 1;
NewCard = +Number(substring(Shuffle, RandomPos, 1));
NewShuffle = substring(Shuffle, 1, RandomPos - 1) add substring(Shuffle, RandomPos + 1, 99);
Shuffle = NewShuffle;
}
frame 4 {
stop();
}