Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("fccb7acc", this, 10301, true);
mochi.MochiServices.connect("5ecc1a17144b7ee0");
Instance of Symbol 7 MovieClip "rightsClip" in Frame 1
onClipEvent (load) {
this._visible = false;
}
Frame 2
_root.locateURL = _url;
stop();
nextFrame();
if (_root.locateURL.indexOf("www.yougame.com", 0) != -1) {
nextFrame();
} else {
rightsClip._visible = true;
stop();
}
Frame 3
stop();
Instance of Symbol 28 MovieClip "preloaderClip" in Frame 3
onClipEvent (load) {
total = _parent.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _parent.getBytesLoaded();
percent = int((loaded / total) * 100);
gotoAndStop(percent);
perText = percent + "%";
if (percent >= 100) {
_parent.gotoAndStop("logoanimation");
}
}
Frame 7
stop();
Frame 8
MochiAd.showPreGameAd({id:"5ecc1a17144b7ee0", res:"600x400"});
Frame 10
stop();
Instance of Symbol 77 MovieClip in Frame 10
onClipEvent (load) {
this.swapDepths(60000);
}
Frame 11
fscommand ("showmenu", false);
_root.slidemusic_X = 0;
_root.slidesound_X = 0;
countmain = 0;
countsound = 0;
activate = 0;
flag = new Array();
stopAllSounds();
gotoAndPlay (14);
Instance of Symbol 118 MovieClip "muteClip" in Frame 11
onClipEvent (load) {
function muteSounds(num) {
if (num == 0) {
volumeVal = 0;
crowdVolume = 0;
gotoAndStop ("off");
_root.snd1.musicObj.setVolume(0);
}
if (num == 1) {
volumeVal = 100;
crowdVolume = 100;
gotoAndStop ("on");
_root.snd1.musicObj.setVolume(100);
}
}
if (_root.muteallSounds == true) {
muteSounds(0);
}
}
Frame 14
function cardsCompare() {
cornertile();
oneObject = one;
twoObject = two;
if (oneObject._currentframe == twoObject._currentframe) {
one = null;
two = null;
clearMe = setInterval(FadeMe, 10, oneObject, twoObject);
count = count + 50;
balanceCards = balanceCards - 2;
if ((balanceCards == 0) && (timer._x < 450)) {
levelNumber = 1;
timeRemaining = 450 - Math.round(timer._x);
count = count + ((250 * levelNumber) + timeRemaining);
}
timer._x = timer._x - 7;
if (timer._x <= 290) {
timer._x = 293;
}
if (balanceCards == 0) {
_root.gotoAndStop(12);
}
} else {
_root.snd3.wrongObj.start(0, 1);
oneObject.highLight.gotoAndPlay(3);
twoObject.highLight.gotoAndPlay(3);
one = null;
two = null;
}
}
function FadeMe(oneObj, twoObj) {
if (oneObj._alpha > 0) {
oneObj._alpha = oneObj._alpha - decrement;
twoObj._alpha = twoObj._alpha - decrement;
} else {
_root.snd2.correctObj.start(0, 1);
trace("---------------");
trace("removed ");
trace("---------------");
removeMovieClip(oneObj);
removeMovieClip(twoObj);
cornertile();
clearInterval(clearMe);
}
}
_root.snd1.musicObj.start(0, 10000);
var one = null;
var two = null;
count = 0;
_root.dbInterface.updateScore(_root.count);
maxCards = 72;
levelNumber = 1;
balanceCards = maxCards;
yAdjust = 6.4;
i = 1;
while (i <= 3) {
this["cornertile" + i] = 0;
i++;
}
cornertile1 = 1;
cornertile6 = 1;
cornertile7 = 1;
cornertile11 = 1;
cornertile12 = 1;
cornertile15 = 1;
cornertile16 = 1;
cornertile20 = 1;
cornertile21 = 1;
cornertile24 = 1;
cornertile25 = 1;
cornertile30 = 1;
cornertile31 = 1;
cornertile34 = 1;
cornertile35 = 1;
cornertile37 = 1;
cornertile38 = 1;
cornertile42 = 1;
cornertile43 = 1;
cornertile45 = 1;
cornertile46 = 1;
cornertile49 = 1;
cornertile50 = 1;
cornertile52 = 1;
cornertile53 = 1;
cornertile55 = 1;
cornertile56 = 1;
cornertile57 = 1;
cornertile58 = 1;
cornertile60 = 1;
cornertile61 = 1;
cornertile62 = 1;
cornertile63 = 1;
cornertile64 = 1;
cornertile65 = 1;
cornertile66 = 1;
cornertile68 = 1;
cornertile69 = 1;
cornertile70 = 1;
cornertile71 = 1;
cornertile72 = 1;
decrement = 10;
Frame 16
function findVisible(num) {
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
firstCards = new Array();
firstInvisibleCards = new Array();
remainingCards = new Array();
var _local2 = 1;
while (_local2 <= num) {
var _local3 = 1;
while (_local3 <= num) {
if (_local2 != _local3) {
if (_local2 > _local3) {
if (_root["card" + _local2].hitClip.hitTest(_root["card" + _local3].hitClip)) {
if (_root["card" + _local2].getDepth() > _root["card" + _local3].getDepth()) {
firstCards.push(_local2);
firstInvisibleCards.push(_local3);
}
}
}
}
_local3++;
}
_local2++;
}
newVisibleCards = new Array();
firstCards.sort();
_local2 = 0;
while (_local2 < firstCards.length) {
if (temp != firstCards[_local2]) {
temp = firstCards[_local2];
newVisibleCards.push(temp);
}
_local2++;
}
trace("newVisibleCards = " + newVisibleCards);
newInvisibleCards = new Array();
trace("firstInvisibleCards1 = " + firstInvisibleCards);
firstInvisibleCards.sort();
_local2 = 0;
while (_local2 < firstInvisibleCards.length) {
if (tempVar != firstInvisibleCards[_local2]) {
tempVar = firstInvisibleCards[_local2];
newInvisibleCards.push(tempVar);
}
_local2++;
}
newInvisibleCards.sort(numericalSort);
trace("newInvisibleCards = " + newInvisibleCards);
findSecondVisible(newVisibleCards.length);
middleCornerTiles();
}
function findSecondVisible(num1) {
visibleCards = new Array();
invisibleCards = new Array();
var _local3 = 0;
while (_local3 < num1) {
var _local2 = 0;
while (_local2 < num1) {
if (newVisibleCards[_local3] != newVisibleCards[_local2]) {
if (newVisibleCards[_local3] > newVisibleCards[_local2]) {
if (_root["card" + newVisibleCards[_local3]].hitClip.hitTest(_root["card" + newVisibleCards[_local2]].hitClip)) {
if (_root["card" + newVisibleCards[_local3]].getDepth() > _root["card" + newVisibleCards[_local2]].getDepth()) {
visibleCards.push(newVisibleCards[_local3]);
invisibleCards.push(newVisibleCards[_local2]);
}
}
}
}
_local2++;
}
_local3++;
}
trace("visibleCards = " + visibleCards);
trace("invisibleCards = " + invisibleCards);
}
function checkInvisibleCards(param1) {
var _local1 = 0;
while (_local1 < invisibleCards.length) {
if (invisibleCards[_local1] == param1) {
return(true);
}
_local1++;
}
}
function middleCornerTiles() {
midCorTiles = new Array();
middleTiles = newVisibleCards.length;
var _local2 = 0;
while (_local2 < middleTiles) {
if (_root["cornertile" + newVisibleCards[_local2]] == 1) {
if (checkInvisibleCards(newVisibleCards[_local2]) != true) {
midCorTiles.push(newVisibleCards[_local2]);
}
}
_local2++;
}
trace("midCorTiles = " + midCorTiles);
calIndividualCards();
}
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
function calIndividualCards() {
remCards = newInvisibleCards.concat(newVisibleCards);
remCards.sort(numericalSort);
nonIndividualCards = [];
i = 0;
while (i < remCards.length) {
if (tempVar != remCards[i]) {
tempVar = remCards[i];
nonIndividualCards.push(tempVar);
}
i++;
}
trace("nonIndividualCards = " + nonIndividualCards);
maxnumber = maxCards;
bottomIndCards = [];
arrayCompare();
}
function arrayCompare() {
var _local1 = 0;
while (_local1 < maxnumber) {
diff = nonIndividualCards[_local1 + 1] - nonIndividualCards[_local1];
if (diff != 1) {
missingValue = nonIndividualCards[_local1] + 1;
bottomIndCards.push(missingValue);
nonIndividualCards.push(missingValue);
nonIndividualCards.sort(numericalSort);
checkLength();
break;
}
_local1++;
}
}
function checkLength() {
if (nonIndividualCards.length != maxnumber) {
arrayCompare();
} else {
trace("bottomIndCards = " + bottomIndCards);
bottomCornerTiles();
}
}
function bottomCornerTiles() {
botCorTiles = new Array();
bottomTiles = bottomIndCards.length;
var _local2 = 0;
while (_local2 < bottomTiles) {
if (_root["cornertile" + bottomIndCards[_local2]] == 1) {
if (checkInvisibleCards(bottomIndCards[_local2]) != true) {
botCorTiles.push(bottomIndCards[_local2]);
}
}
_local2++;
}
totalCornerTIles = botCorTiles.concat(midCorTiles);
totalCornerTIles.sort(numericalSort);
trace("totalCornerTIles = " + totalCornerTIles);
checkwhichisliving();
}
function checkwhichisliving() {
liveCards = [];
currentFrameArray = [];
var _local2 = 0;
while (_local2 < totalCornerTIles.length) {
if (typeof(_root["card" + totalCornerTIles[_local2]]) == "movieclip") {
liveCards.push(totalCornerTIles[_local2]);
curFrame = _root["card" + totalCornerTIles[_local2]]._currentframe;
currentFrameArray.push(curFrame);
}
_local2++;
}
trace("--------------------------------");
trace("totalCornerTIles = " + totalCornerTIles);
trace("LiveCards = " + liveCards);
trace("currentFrameArray = " + currentFrameArray);
trace("--------------------------------");
CheckPairs();
}
function CheckPairs() {
newLengthVar = currentFrameArray.length;
totalPairs = [];
hintArray = [];
var _local3 = 0;
while (_local3 < newLengthVar) {
if (hintArray.length < 2) {
var _local2 = 0;
while (_local2 < newLengthVar) {
if (currentFrameArray[_local3] == currentFrameArray[_local2]) {
if (_local3 != _local2) {
trace(currentFrameArray[_local3]);
trace(currentFrameArray[_local2]);
hintArray.push(liveCards[_local3]);
hintArray.push(liveCards[_local2]);
break;
}
}
_local2++;
}
}
_local3++;
}
trace("hintArray = " + hintArray);
if (hintArray.length == 2) {
_root["card" + hintArray[0]].hint.gotoAndStop(2);
_root["card" + hintArray[1]].hint.gotoAndStop(2);
} else {
noHint.gotoAndStop(2);
}
}
function cardCreator() {
i = 1;
while (i <= (maxCards / 2)) {
duplicateMovieClip (card, "card" + i, i);
ran = random(18) + 2;
this["card" + i].gotoAndStop(ran);
i++;
}
i = (maxCards / 2) + 1;
while (i <= maxCards) {
duplicateMovieClip (card, "card" + i, i);
this["card" + i].gotoAndStop(this["card" + (i - (maxCards / 2))]._currentframe);
i++;
}
i = 1;
while (i <= maxCards) {
if (i <= 6) {
this["card" + i]._x = 120 + ((i - 1) * 30);
this["card" + i]._y = 250 - yAdjust;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 7) && (i <= 11)) {
this["card" + i]._x = 120 + ((i - 7) * 30);
this["card" + i]._y = 198.8;
this["card" + i].swapDepths(10600 + i);
}
if ((i >= 12) && (i <= 15)) {
this["card" + i]._x = 120 + ((i - 12) * 30);
this["card" + i]._y = 154;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 16) && (i <= 20)) {
this["card" + i]._x = 150 + ((i - 16) * 30);
this["card" + i]._y = 288.4;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 21) && (i <= 24)) {
this["card" + i]._x = 180 + ((i - 21) * 30);
this["card" + i]._y = 332.6;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 25) && (i <= 30)) {
this["card" + i]._x = 118 + ((i - 25) * 30);
this["card" + i]._y = 240.6;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 31) && (i <= 34)) {
this["card" + i]._x = 118 + ((i - 31) * 30);
this["card" + i]._y = 196;
this["card" + i].swapDepths(11500 + i);
}
if ((i >= 35) && (i <= 37)) {
this["card" + i]._x = 120 + ((i - 35) * 30);
this["card" + i]._y = 151.5;
this["card" + i].swapDepths(11200 + i);
}
if ((i >= 38) && (i <= 42)) {
this["card" + i]._x = 148 + ((i - 38) * 30);
this["card" + i]._y = 284.6;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 43) && (i <= 45)) {
this["card" + i]._x = 208 + ((i - 43) * 30);
this["card" + i]._y = 328.5;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 46) && (i <= 49)) {
this["card" + i]._x = 142 + ((i - 46) * 30);
this["card" + i]._y = 242 - yAdjust;
this["card" + i].swapDepths(13000 + i);
}
if ((i >= 50) && (i <= 52)) {
this["card" + i]._x = 142 + ((i - 50) * 30);
this["card" + i]._y = 191.3;
this["card" + i].swapDepths(12800 + i);
}
if ((i >= 53) && (i <= 55)) {
this["card" + i]._x = 170 + ((i - 53) * 30);
this["card" + i]._y = 280;
this["card" + i].swapDepths(17000 + i);
}
if (i == 56) {
this["card" + i]._x = 80;
this["card" + i]._y = 200;
this["card" + i].swapDepths(10000 + i);
}
if (i == 57) {
this["card" + i]._x = 40;
this["card" + i]._y = 150;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 58) && (i <= 60)) {
this["card" + i]._x = 10 + ((i - 58) * 30);
this["card" + i]._y = 250;
this["card" + i].swapDepths(11000 + i);
}
if (i == 61) {
this["card" + i]._x = 2;
this["card" + i]._y = 245;
this["card" + i].swapDepths(11000 + i);
}
if (i == 62) {
this["card" + i]._x = 90;
this["card" + i]._y = 330;
this["card" + i].swapDepths(10000 + i);
}
if (i == 63) {
this["card" + i]._x = 55;
this["card" + i]._y = 370;
this["card" + i].swapDepths(11000 + i);
}
if (i == 64) {
this["card" + i]._x = 310;
this["card" + i]._y = 200;
this["card" + i].swapDepths(10000 + i);
}
if (i == 65) {
this["card" + i]._x = 340;
this["card" + i]._y = 150;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 66) && (i <= 68)) {
this["card" + i]._x = 330 + ((i - 66) * 30);
this["card" + i]._y = 250;
this["card" + i].swapDepths(11000 + i);
}
if (i == 69) {
this["card" + i]._x = 387;
this["card" + i]._y = 246;
this["card" + i].swapDepths(12500 + i);
}
if (i == 70) {
this["card" + i]._x = 340;
this["card" + i]._y = 340;
this["card" + i].swapDepths(10000 + i);
}
if (i == 71) {
this["card" + i]._x = 384;
this["card" + i]._y = 380;
this["card" + i].swapDepths(11000 + i);
}
if (i == 72) {
this["card" + i]._x = 380;
this["card" + i]._y = 375;
this["card" + i].swapDepths(14000 + i);
}
i++;
}
}
function cornertile() {
i = 1;
while (i <= maxCards) {
if (i <= 5) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 8) && (i <= 10)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 13) && (i <= 14)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 17) && (i <= 19)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 22) && (i <= 23)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 26) && (i <= 29)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 32) && (i <= 33)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 36) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 39) && (i <= 41)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 44) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 47) && (i <= 48)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 51) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 54) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 59) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 67) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
i++;
}
}
function shuffleCard() {
tileCurrentFrame = new Array();
i = 1;
while (i <= maxCards) {
flag[i] = 0;
i++;
}
i = 1;
while (i <= maxCards) {
tileCurrentFrame[i] = this["card" + i]._currentframe;
i++;
}
cardsRemoved = 0;
j = 1;
while (j <= maxCards) {
if (this["card" + j]._currentframe != undefined) {
swapRandom = undefined;
while (tileCurrentFrame[swapRandom] == undefined) {
swapRandom = Randomgenerator();
if (tileCurrentFrame[swapRandom] != undefined) {
this["card" + j].gotoAndStop(tileCurrentFrame[swapRandom]);
}
}
} else {
cardsRemoved++;
}
j++;
}
if (((maxCards - cardsRemoved) == 4) || ((maxCards - cardsRemoved) < 4)) {
cardReposition();
}
}
function cardReposition() {
trace("inside card position");
var _local3 = 0;
i = 1;
while (i <= maxCards) {
if (this["card" + i]._currentframe != undefined) {
this["card" + i]._x = 120 + (_local3 * 60);
this["card" + i]._y = 250 - yAdjust;
this["card" + i].swapDepths(1000 + _local3);
_root["cornertile" + i] = 1;
_local3++;
}
i++;
}
}
function Randomgenerator() {
ran = random(maxCards) + 1;
if (flag[ran] == 0) {
flag[ran] = 1;
return(ran);
}
i = 1;
while (i <= maxCards) {
if (flag[i] == 0) {
flag[i] = 1;
return(i);
}
i++;
}
}
stop();
cardCreator();
cornertile();
var cardsRemoved = 0;
Instance of Symbol 134 MovieClip "timer" in Frame 16
onClipEvent (load) {
once = 0;
temptimerX = this._x;
trace("temptimerX = " + temptimerX);
}
onClipEvent (enterFrame) {
if (_root.options != 0) {
this._x = this._x + 0.05;
temptimerX = this._x;
if ((this._x >= 450) && (once == 0)) {
i = 1;
while (i <= _parent.maxCards) {
removeMovieClip(_parent["card" + i]);
i++;
}
once = 1;
_root.gotoAndStop(101);
}
}
}
Instance of Symbol 204 MovieClip "card" in Frame 16
onClipEvent (load) {
this.a = substring(this._name, 5, -1);
}
Instance of Symbol 209 MovieClip "noHint" in Frame 16
onClipEvent (load) {
this.swapDepths(250000);
}
Frame 23
function Randomgenerator() {
ran = random(maxCards) + 1;
if (flag[ran] == 0) {
flag[ran] = 1;
return(ran);
}
i = 1;
while (i <= maxCards) {
if (flag[i] == 0) {
flag[i] = 1;
return(i);
}
i++;
}
}
flag = new Array();
gotoAndStop (29);
Frame 24
options_bt._visible = false;
Frame 26
function cardsCompare() {
cornertile();
oneObject = one;
twoObject = two;
if (oneObject._currentframe == twoObject._currentframe) {
one = null;
two = null;
clearMe = setInterval(FadeMe, 10, oneObject, twoObject);
count = count + 100;
_root.dbInterface.updateScore(_root.count);
balanceCards = balanceCards - 2;
if ((balanceCards == 0) && (timer._x < 450)) {
levelNumber = 2;
timeRemaining = 450 - Math.round(timer._x);
count = count + ((250 * levelNumber) + timeRemaining);
_root.dbInterface.updateScore(_root.count);
}
timer._x = timer._x - 7;
if (timer._x <= 290) {
timer._x = 293;
}
if (balanceCards == 0) {
_root.gotoAndStop(24);
}
} else {
_root.snd3.wrongObj.start(0, 1);
oneObject.highLight.gotoAndPlay(3);
twoObject.highLight.gotoAndPlay(3);
one = null;
two = null;
}
}
function FadeMe(oneObj, twoObj) {
trace(oneObj._alpha);
if (oneObj._alpha > 0) {
oneObj._alpha = oneObj._alpha - decrement;
twoObj._alpha = twoObj._alpha - decrement;
} else {
_root.snd2.correctObj.start(0, 1);
trace("---------------");
trace("removed ");
trace("---------------");
removeMovieClip(oneObj);
removeMovieClip(twoObj);
cornertile();
clearInterval(clearMe);
}
}
var one = null;
var two = null;
maxCards = 122;
levelNumber = 2;
balanceCards = maxCards;
yAdjust = 6.4;
i = 1;
while (i <= 3) {
this["cornertile" + i] = 0;
i++;
}
cornertile1 = 1;
cornertile16 = 1;
cornertile17 = 1;
cornertile32 = 1;
cornertile33 = 1;
cornertile48 = 1;
cornertile49 = 1;
cornertile58 = 1;
cornertile59 = 1;
cornertile64 = 1;
cornertile65 = 1;
cornertile67 = 1;
cornertile68 = 1;
cornertile70 = 1;
cornertile71 = 1;
cornertile78 = 1;
cornertile79 = 1;
cornertile90 = 1;
cornertile91 = 1;
cornertile104 = 1;
cornertile105 = 1;
cornertile108 = 1;
cornertile109 = 1;
cornertile114 = 1;
cornertile115 = 1;
cornertile122 = 1;
decrement = 10;
Frame 29
MochiAd.showInterLevelAd({id:"5ecc1a17144b7ee0", res:"600x400"});
Frame 30
function findVisible(num) {
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
firstCards = new Array();
firstInvisibleCards = new Array();
remainingCards = new Array();
var _local2 = 1;
while (_local2 <= num) {
var _local3 = 1;
while (_local3 <= num) {
if (_local2 != _local3) {
if (_local2 > _local3) {
if (_root["card" + _local2].hitClip.hitTest(_root["card" + _local3].hitClip)) {
if (_root["card" + _local2].getDepth() > _root["card" + _local3].getDepth()) {
firstCards.push(_local2);
firstInvisibleCards.push(_local3);
}
}
}
}
_local3++;
}
_local2++;
}
newVisibleCards = new Array();
firstCards.sort();
_local2 = 0;
while (_local2 < firstCards.length) {
if (temp != firstCards[_local2]) {
temp = firstCards[_local2];
newVisibleCards.push(temp);
}
_local2++;
}
newInvisibleCards = new Array();
firstInvisibleCards.sort();
_local2 = 0;
while (_local2 < firstInvisibleCards.length) {
if (tempVar != firstInvisibleCards[_local2]) {
tempVar = firstInvisibleCards[_local2];
newInvisibleCards.push(tempVar);
}
_local2++;
}
newInvisibleCards.sort(numericalSort);
findSecondVisible(newVisibleCards.length);
middleCornerTiles();
}
function findSecondVisible(num1) {
visibleCards = new Array();
invisibleCards = new Array();
var _local3 = 0;
while (_local3 < num1) {
var _local2 = 0;
while (_local2 < num1) {
if (newVisibleCards[_local3] != newVisibleCards[_local2]) {
if (newVisibleCards[_local3] > newVisibleCards[_local2]) {
if (_root["card" + newVisibleCards[_local3]].hitClip.hitTest(_root["card" + newVisibleCards[_local2]].hitClip)) {
if (_root["card" + newVisibleCards[_local3]].getDepth() > _root["card" + newVisibleCards[_local2]].getDepth()) {
visibleCards.push(newVisibleCards[_local3]);
invisibleCards.push(newVisibleCards[_local2]);
}
}
}
}
_local2++;
}
_local3++;
}
}
function checkInvisibleCards(param1) {
var _local1 = 0;
while (_local1 < invisibleCards.length) {
if (invisibleCards[_local1] == param1) {
return(true);
}
_local1++;
}
}
function middleCornerTiles() {
midCorTiles = new Array();
middleTiles = newVisibleCards.length;
var _local2 = 0;
while (_local2 < middleTiles) {
if (_root["cornertile" + newVisibleCards[_local2]] == 1) {
if (checkInvisibleCards(newVisibleCards[_local2]) != true) {
midCorTiles.push(newVisibleCards[_local2]);
}
}
_local2++;
}
calIndividualCards();
}
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
function calIndividualCards() {
remCards = newInvisibleCards.concat(newVisibleCards);
remCards.sort(numericalSort);
nonIndividualCards = [];
i = 0;
while (i < remCards.length) {
if (tempVar != remCards[i]) {
tempVar = remCards[i];
nonIndividualCards.push(tempVar);
}
i++;
}
maxnumber = maxCards;
bottomIndCards = [];
arrayCompare();
}
function arrayCompare() {
var _local1 = 0;
while (_local1 < maxnumber) {
diff = nonIndividualCards[_local1 + 1] - nonIndividualCards[_local1];
if (diff != 1) {
missingValue = nonIndividualCards[_local1] + 1;
bottomIndCards.push(missingValue);
nonIndividualCards.push(missingValue);
nonIndividualCards.sort(numericalSort);
checkLength();
break;
}
_local1++;
}
}
function checkLength() {
if (nonIndividualCards.length != maxnumber) {
arrayCompare();
} else {
bottomCornerTiles();
}
}
function bottomCornerTiles() {
botCorTiles = new Array();
bottomTiles = bottomIndCards.length;
var _local2 = 0;
while (_local2 < bottomTiles) {
if (_root["cornertile" + bottomIndCards[_local2]] == 1) {
if (checkInvisibleCards(bottomIndCards[_local2]) != true) {
botCorTiles.push(bottomIndCards[_local2]);
}
}
_local2++;
}
totalCornerTIles = botCorTiles.concat(midCorTiles);
totalCornerTIles.sort(numericalSort);
checkwhichisliving();
}
function checkwhichisliving() {
liveCards = [];
currentFrameArray = [];
var _local2 = 0;
while (_local2 < totalCornerTIles.length) {
if (typeof(_root["card" + totalCornerTIles[_local2]]) == "movieclip") {
liveCards.push(totalCornerTIles[_local2]);
curFrame = _root["card" + totalCornerTIles[_local2]]._currentframe;
currentFrameArray.push(curFrame);
}
_local2++;
}
CheckPairs();
}
function CheckPairs() {
newLengthVar = currentFrameArray.length;
totalPairs = [];
hintArray = [];
var _local3 = 0;
while (_local3 < newLengthVar) {
if (hintArray.length < 2) {
var _local2 = 0;
while (_local2 < newLengthVar) {
if (currentFrameArray[_local3] == currentFrameArray[_local2]) {
if (_local3 != _local2) {
hintArray.push(liveCards[_local3]);
hintArray.push(liveCards[_local2]);
break;
}
}
_local2++;
}
}
_local3++;
}
if (hintArray.length == 2) {
_root["card" + hintArray[0]].hint.gotoAndStop(2);
_root["card" + hintArray[1]].hint.gotoAndStop(2);
} else {
noHint.gotoAndStop(2);
}
}
function cardCreator() {
i = 1;
while (i <= (maxCards / 2)) {
duplicateMovieClip (card, "card" + i, i);
ran = random(18) + 2;
this["card" + i].gotoAndStop(ran);
i++;
}
i = (maxCards / 2) + 1;
while (i <= maxCards) {
duplicateMovieClip (card, "card" + i, i);
this["card" + i].gotoAndStop(this["card" + (i - (maxCards / 2))]._currentframe);
i++;
}
i = 1;
while (i <= maxCards) {
if (i <= 16) {
this["card" + i]._x = -30 + ((i - 1) * 30);
this["card" + i]._y = 350 - yAdjust;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 17) && (i <= 32)) {
this["card" + i]._x = -30 + ((i - 17) * 30);
this["card" + i]._y = 298;
this["card" + i].swapDepths(9500 + i);
}
if ((i >= 33) && (i <= 48)) {
this["card" + i]._x = -30 + ((i - 33) * 30);
this["card" + i]._y = 253;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 49) && (i <= 58)) {
this["card" + i]._x = 60 + ((i - 49) * 30);
this["card" + i]._y = 208;
this["card" + i].swapDepths(8500 + i);
}
if ((i >= 59) && (i <= 64)) {
this["card" + i]._x = 120 + ((i - 59) * 30);
this["card" + i]._y = 164;
this["card" + i].swapDepths(8000 + i);
}
if ((i >= 65) && (i <= 67)) {
this["card" + i]._x = 30 + ((i - 65) * 30);
this["card" + i]._y = 388;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 68) && (i <= 70)) {
this["card" + i]._x = 300 + ((i - 68) * 30);
this["card" + i]._y = 388;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 71) && (i <= 78)) {
this["card" + i]._x = 86 + ((i - 71) * 30);
this["card" + i]._y = 202;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 79) && (i <= 90)) {
this["card" + i]._x = 24 + ((i - 79) * 30);
this["card" + i]._y = 247;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 91) && (i <= 104)) {
this["card" + i]._x = -5 + ((i - 91) * 30);
this["card" + i]._y = 292;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 105) && (i <= 108)) {
this["card" + i]._x = 140 + ((i - 105) * 30);
this["card" + i]._y = 196;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 109) && (i <= 114)) {
this["card" + i]._x = 110 + ((i - 109) * 30);
this["card" + i]._y = 241;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 115) && (i <= 122)) {
this["card" + i]._x = 80 + ((i - 115) * 30);
this["card" + i]._y = 286;
this["card" + i].swapDepths(11000 + i);
}
i++;
}
}
function cornertile() {
i = 1;
while (i <= maxCards) {
if (i <= 15) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 18) && (i <= 31)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 34) && (i <= 47)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 50) && (i <= 57)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 60) && (i <= 63)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 66) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 69) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 72) && (i <= 77)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 80) && (i <= 89)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 92) && (i <= 103)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 106) && (i <= 107)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 110) && (i <= 113)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 116) && (i <= 121)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
i++;
}
}
removeMovieClip(noHint);
options_bt._visible = true;
stop();
cardCreator();
cornertile();
Instance of Symbol 215 MovieClip "timer" in Frame 30
onClipEvent (load) {
once = 0;
}
onClipEvent (enterFrame) {
if (_root.options != 0) {
this._x = this._x + 0.05;
if ((this._x >= 450) && (once == 0)) {
i = 1;
while (i <= _parent.maxCards) {
removeMovieClip(_parent["card" + i]);
i++;
}
once = 1;
_root.gotoAndStop(101);
}
}
}
Instance of Symbol 209 MovieClip "noHint" in Frame 30
onClipEvent (load) {
this.swapDepths(250000);
}
Frame 35
function Randomgenerator() {
ran = random(maxCards) + 1;
if (flag[ran] == 0) {
flag[ran] = 1;
return(ran);
}
i = 1;
while (i <= maxCards) {
if (flag[i] == 0) {
flag[i] = 1;
return(i);
}
i++;
}
}
flag = new Array();
gotoAndStop (41);
Frame 36
options_bt._visible = false;
Frame 38
function cardsCompare() {
cornertile();
oneObject = one;
twoObject = two;
if (oneObject._currentframe == twoObject._currentframe) {
one = null;
two = null;
clearMe = setInterval(FadeMe, 10, oneObject, twoObject);
count = count + 150;
_root.dbInterface.updateScore(_root.count);
balanceCards = balanceCards - 2;
if ((balanceCards == 0) && (timer._x < 450)) {
levelNumber = 3;
timeRemaining = 450 - Math.round(timer._x);
count = count + ((250 * levelNumber) + timeRemaining);
_root.dbInterface.updateScore(_root.count);
}
cornertile();
timer._x = timer._x - 7;
if (timer._x <= 290) {
timer._x = 293;
}
if (balanceCards == 0) {
_root.gotoAndStop(36);
}
} else {
_root.snd3.wrongObj.start(0, 1);
oneObject.highLight.gotoAndPlay(3);
twoObject.highLight.gotoAndPlay(3);
one = null;
two = null;
}
}
function FadeMe(oneObj, twoObj) {
trace(oneObj._alpha);
if (oneObj._alpha > 0) {
oneObj._alpha = oneObj._alpha - decrement;
twoObj._alpha = twoObj._alpha - decrement;
} else {
_root.snd2.correctObj.start(0, 1);
trace("---------------");
trace("removed ");
trace("---------------");
removeMovieClip(oneObj);
removeMovieClip(twoObj);
cornertile();
clearInterval(clearMe);
}
}
var one = null;
var two = null;
maxCards = 126;
levelNumber = 3;
balanceCards = maxCards;
yAdjust = 6.4;
i = 1;
while (i <= 3) {
this["cornertile" + i] = 0;
i++;
}
cornertile1 = 1;
cornertile16 = 1;
cornertile17 = 1;
cornertile30 = 1;
cornertile31 = 1;
cornertile42 = 1;
cornertile43 = 1;
cornertile52 = 1;
cornertile53 = 1;
cornertile60 = 1;
cornertile61 = 1;
cornertile66 = 1;
cornertile67 = 1;
cornertile68 = 1;
cornertile69 = 1;
cornertile76 = 1;
cornertile77 = 1;
cornertile84 = 1;
cornertile85 = 1;
cornertile92 = 1;
cornertile93 = 1;
cornertile100 = 1;
cornertile101 = 1;
cornertile104 = 1;
cornertile105 = 1;
cornertile108 = 1;
cornertile109 = 1;
cornertile112 = 1;
cornertile113 = 1;
cornertile115 = 1;
cornertile116 = 1;
cornertile118 = 1;
cornertile119 = 1;
cornertile121 = 1;
cornertile122 = 1;
cornertile124 = 1;
cornertile125 = 1;
cornertile126 = 1;
decrement = 10;
Frame 41
MochiAd.showInterLevelAd({id:"5ecc1a17144b7ee0", res:"600x400"});
Instance of Symbol 226 MovieClip "timer" in Frame 41
onClipEvent (load) {
once = 0;
}
onClipEvent (enterFrame) {
if (_root.options != 0) {
this._x = this._x + 0.05;
if ((this._x >= 450) && (once == 0)) {
i = 1;
while (i <= _parent.maxCards) {
removeMovieClip(_parent["card" + i]);
i++;
}
once = 1;
_root.gotoAndStop(101);
}
}
}
Frame 42
function findVisible(num) {
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
firstCards = new Array();
firstInvisibleCards = new Array();
remainingCards = new Array();
var _local2 = 1;
while (_local2 <= num) {
var _local3 = 1;
while (_local3 <= num) {
if (_local2 != _local3) {
if (_local2 > _local3) {
if (_root["card" + _local2].hitClip.hitTest(_root["card" + _local3].hitClip)) {
if (_root["card" + _local2].getDepth() > _root["card" + _local3].getDepth()) {
firstCards.push(_local2);
firstInvisibleCards.push(_local3);
}
}
}
}
_local3++;
}
_local2++;
}
newVisibleCards = new Array();
firstCards.sort();
_local2 = 0;
while (_local2 < firstCards.length) {
if (temp != firstCards[_local2]) {
temp = firstCards[_local2];
newVisibleCards.push(temp);
}
_local2++;
}
newInvisibleCards = new Array();
firstInvisibleCards.sort();
_local2 = 0;
while (_local2 < firstInvisibleCards.length) {
if (tempVar != firstInvisibleCards[_local2]) {
tempVar = firstInvisibleCards[_local2];
newInvisibleCards.push(tempVar);
}
_local2++;
}
newInvisibleCards.sort(numericalSort);
findSecondVisible(newVisibleCards.length);
middleCornerTiles();
}
function findSecondVisible(num1) {
visibleCards = new Array();
invisibleCards = new Array();
var _local3 = 0;
while (_local3 < num1) {
var _local2 = 0;
while (_local2 < num1) {
if (newVisibleCards[_local3] != newVisibleCards[_local2]) {
if (newVisibleCards[_local3] > newVisibleCards[_local2]) {
if (_root["card" + newVisibleCards[_local3]].hitClip.hitTest(_root["card" + newVisibleCards[_local2]].hitClip)) {
if (_root["card" + newVisibleCards[_local3]].getDepth() > _root["card" + newVisibleCards[_local2]].getDepth()) {
visibleCards.push(newVisibleCards[_local3]);
invisibleCards.push(newVisibleCards[_local2]);
}
}
}
}
_local2++;
}
_local3++;
}
}
function checkInvisibleCards(param1) {
var _local1 = 0;
while (_local1 < invisibleCards.length) {
if (invisibleCards[_local1] == param1) {
return(true);
}
_local1++;
}
}
function middleCornerTiles() {
midCorTiles = new Array();
middleTiles = newVisibleCards.length;
var _local2 = 0;
while (_local2 < middleTiles) {
if (_root["cornertile" + newVisibleCards[_local2]] == 1) {
if (checkInvisibleCards(newVisibleCards[_local2]) != true) {
midCorTiles.push(newVisibleCards[_local2]);
}
}
_local2++;
}
calIndividualCards();
}
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
function calIndividualCards() {
remCards = newInvisibleCards.concat(newVisibleCards);
remCards.sort(numericalSort);
nonIndividualCards = [];
i = 0;
while (i < remCards.length) {
if (tempVar != remCards[i]) {
tempVar = remCards[i];
nonIndividualCards.push(tempVar);
}
i++;
}
maxnumber = maxCards;
bottomIndCards = [];
arrayCompare();
}
function arrayCompare() {
var _local1 = 0;
while (_local1 < maxnumber) {
diff = nonIndividualCards[_local1 + 1] - nonIndividualCards[_local1];
if (diff != 1) {
missingValue = nonIndividualCards[_local1] + 1;
bottomIndCards.push(missingValue);
nonIndividualCards.push(missingValue);
nonIndividualCards.sort(numericalSort);
checkLength();
break;
}
_local1++;
}
}
function checkLength() {
if (nonIndividualCards.length != maxnumber) {
arrayCompare();
} else {
bottomCornerTiles();
}
}
function bottomCornerTiles() {
botCorTiles = new Array();
bottomTiles = bottomIndCards.length;
var _local2 = 0;
while (_local2 < bottomTiles) {
if (_root["cornertile" + bottomIndCards[_local2]] == 1) {
if (checkInvisibleCards(bottomIndCards[_local2]) != true) {
botCorTiles.push(bottomIndCards[_local2]);
}
}
_local2++;
}
totalCornerTIles = botCorTiles.concat(midCorTiles);
totalCornerTIles.sort(numericalSort);
checkwhichisliving();
}
function checkwhichisliving() {
liveCards = [];
currentFrameArray = [];
var _local2 = 0;
while (_local2 < totalCornerTIles.length) {
if (typeof(_root["card" + totalCornerTIles[_local2]]) == "movieclip") {
liveCards.push(totalCornerTIles[_local2]);
curFrame = _root["card" + totalCornerTIles[_local2]]._currentframe;
currentFrameArray.push(curFrame);
}
_local2++;
}
CheckPairs();
}
function CheckPairs() {
newLengthVar = currentFrameArray.length;
totalPairs = [];
hintArray = [];
var _local3 = 0;
while (_local3 < newLengthVar) {
if (hintArray.length < 2) {
var _local2 = 0;
while (_local2 < newLengthVar) {
if (currentFrameArray[_local3] == currentFrameArray[_local2]) {
if (_local3 != _local2) {
hintArray.push(liveCards[_local3]);
hintArray.push(liveCards[_local2]);
break;
}
}
_local2++;
}
}
_local3++;
}
if (hintArray.length == 2) {
_root["card" + hintArray[0]].hint.gotoAndStop(2);
_root["card" + hintArray[1]].hint.gotoAndStop(2);
} else {
noHint.gotoAndStop(2);
}
}
function cardCreator() {
i = 1;
while (i <= (maxCards / 2)) {
duplicateMovieClip (card, "card" + i, i);
ran = random(18) + 2;
this["card" + i].gotoAndStop(ran);
i++;
}
i = (maxCards / 2) + 1;
while (i <= maxCards) {
duplicateMovieClip (card, "card" + i, i);
this["card" + i].gotoAndStop(this["card" + (i - (maxCards / 2))]._currentframe);
i++;
}
i = 1;
while (i <= maxCards) {
if (i <= 16) {
this["card" + i]._x = -30 + ((i - 1) * 30);
this["card" + i]._y = 400 - yAdjust;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 17) && (i <= 30)) {
this["card" + i]._x = 0 + ((i - 17) * 30);
this["card" + i]._y = 349;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 31) && (i <= 42)) {
this["card" + i]._x = 30 + ((i - 31) * 30);
this["card" + i]._y = 304.5;
this["card" + i].swapDepths(8000 + i);
}
if ((i >= 43) && (i <= 52)) {
this["card" + i]._x = 60 + ((i - 43) * 30);
this["card" + i]._y = 260;
this["card" + i].swapDepths(7000 + i);
}
if ((i >= 53) && (i <= 60)) {
this["card" + i]._x = 90 + ((i - 53) * 30);
this["card" + i]._y = 215.5;
this["card" + i].swapDepths(6000 + i);
}
if ((i >= 61) && (i <= 66)) {
this["card" + i]._x = 120 + ((i - 61) * 30);
this["card" + i]._y = 171;
this["card" + i].swapDepths(5000 + i);
}
if ((i >= 67) && (i <= 68)) {
this["card" + i]._x = 180 + ((i - 67) * 30);
this["card" + i]._y = 130;
this["card" + i].swapDepths(4000 + i);
}
if ((i >= 69) && (i <= 76)) {
this["card" + i]._x = 86 + ((i - 69) * 30);
this["card" + i]._y = 254;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 77) && (i <= 84)) {
this["card" + i]._x = 86 + ((i - 77) * 30);
this["card" + i]._y = 298.4;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 85) && (i <= 92)) {
this["card" + i]._x = 86 + ((i - 85) * 30);
this["card" + i]._y = 343;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 93) && (i <= 100)) {
this["card" + i]._x = 86 + ((i - 93) * 30);
this["card" + i]._y = 388;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 101) && (i <= 104)) {
this["card" + i]._x = 142 + ((i - 101) * 30);
this["card" + i]._y = 250;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 105) && (i <= 108)) {
this["card" + i]._x = 142 + ((i - 105) * 30);
this["card" + i]._y = 294.5;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 109) && (i <= 112)) {
this["card" + i]._x = 142 + ((i - 109) * 30);
this["card" + i]._y = 339;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 113) && (i <= 115)) {
this["card" + i]._x = -25 + ((i - 113) * 30);
this["card" + i]._y = 160;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 116) && (i <= 118)) {
this["card" + i]._x = -25 + ((i - 116) * 30);
this["card" + i]._y = 205;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 119) && (i <= 121)) {
this["card" + i]._x = 355 + ((i - 119) * 30);
this["card" + i]._y = 160;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 122) && (i <= 124)) {
this["card" + i]._x = 355 + ((i - 122) * 30);
this["card" + i]._y = 205;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 125) && (i <= 126)) {
this["card" + i]._x = 166 + ((i - 125) * 30);
this["card" + i]._y = 290;
this["card" + i].swapDepths(13000 + i);
}
i++;
}
}
function cornertile() {
i = 1;
while (i <= maxCards) {
if (i <= 15) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 18) && (i <= 29)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 32) && (i <= 41)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 44) && (i <= 51)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 54) && (i <= 59)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 62) && (i <= 65)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 70) && (i <= 75)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 78) && (i <= 83)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 86) && (i <= 91)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 94) && (i <= 99)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 102) && (i <= 103)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 106) && (i <= 107)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 110) && (i <= 111)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 114) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 117) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 120) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 123) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
i++;
}
}
removeMovieClip(noHint);
options_bt._visible = true;
stop();
cardCreator();
cornertile();
Frame 47
function Randomgenerator() {
ran = random(maxCards) + 1;
if (flag[ran] == 0) {
flag[ran] = 1;
return(ran);
}
i = 1;
while (i <= maxCards) {
if (flag[i] == 0) {
flag[i] = 1;
return(i);
}
i++;
}
}
flag = new Array();
gotoAndStop (53);
Frame 48
options_bt._visible = false;
Frame 49
options_bt._visible = true;
Frame 50
function cardsCompare() {
cornertile();
oneObject = one;
twoObject = two;
if (oneObject._currentframe == twoObject._currentframe) {
one = null;
two = null;
clearMe = setInterval(FadeMe, 10, oneObject, twoObject);
count = count + 200;
_root.dbInterface.updateScore(_root.count);
balanceCards = balanceCards - 2;
if ((balanceCards == 0) && (timer._x < 450)) {
levelNumber = 4;
timeRemaining = 450 - Math.round(timer._x);
count = count + ((250 * levelNumber) + timeRemaining);
_root.dbInterface.updateScore(_root.count);
}
cornertile();
timer._x = timer._x - 7;
if (timer._x <= 290) {
timer._x = 293;
}
if (balanceCards == 0) {
_root.gotoAndStop(48);
}
} else {
_root.snd3.wrongObj.start(0, 1);
oneObject.highLight.gotoAndPlay(3);
twoObject.highLight.gotoAndPlay(3);
trace("bad");
one = null;
two = null;
}
}
function FadeMe(oneObj, twoObj) {
if (oneObj._alpha > 0) {
oneObj._alpha = oneObj._alpha - decrement;
twoObj._alpha = twoObj._alpha - decrement;
} else {
_root.snd2.correctObj.start(0, 1);
trace("---------------");
trace("removed ");
trace("---------------");
removeMovieClip(oneObj);
removeMovieClip(twoObj);
cornertile();
clearInterval(clearMe);
}
}
var one = null;
var two = null;
maxCards = 126;
levelNumber = 4;
balanceCards = maxCards;
yAdjust = 6.4;
i = 1;
while (i <= 3) {
this["cornertile" + i] = 0;
i++;
}
cornertile1 = 1;
cornertile12 = 1;
cornertile13 = 1;
cornertile24 = 1;
cornertile25 = 1;
cornertile36 = 1;
cornertile37 = 1;
cornertile48 = 1;
cornertile49 = 1;
cornertile60 = 1;
cornertile61 = 1;
cornertile72 = 1;
cornertile73 = 1;
cornertile84 = 1;
cornertile85 = 1;
cornertile92 = 1;
cornertile93 = 1;
cornertile98 = 1;
cornertile99 = 1;
cornertile102 = 1;
cornertile103 = 1;
cornertile110 = 1;
cornertile111 = 1;
cornertile122 = 1;
cornertile123 = 1;
cornertile124 = 1;
cornertile125 = 1;
cornertile126 = 1;
decrement = 10;
Frame 53
MochiAd.showInterLevelAd({id:"5ecc1a17144b7ee0", res:"600x400"});
Instance of Symbol 237 MovieClip "timer" in Frame 53
onClipEvent (load) {
once = 0;
}
onClipEvent (enterFrame) {
if (_root.options != 0) {
this._x = this._x + 0.1;
if ((this._x >= 450) && (once == 0)) {
i = 1;
while (i <= _parent.maxCards) {
removeMovieClip(_parent["card" + i]);
i++;
}
once = 1;
_root.gotoAndStop(101);
}
}
}
Instance of Symbol 209 MovieClip "noHint" in Frame 53
onClipEvent (load) {
this.swapDepths(250000);
}
Frame 54
function findVisible(num) {
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
firstCards = new Array();
firstInvisibleCards = new Array();
remainingCards = new Array();
var _local2 = 1;
while (_local2 <= num) {
var _local3 = 1;
while (_local3 <= num) {
if (_local2 != _local3) {
if (_local2 > _local3) {
if (_root["card" + _local2].hitClip.hitTest(_root["card" + _local3].hitClip)) {
if (_root["card" + _local2].getDepth() > _root["card" + _local3].getDepth()) {
firstCards.push(_local2);
firstInvisibleCards.push(_local3);
}
}
}
}
_local3++;
}
_local2++;
}
newVisibleCards = new Array();
firstCards.sort();
_local2 = 0;
while (_local2 < firstCards.length) {
if (temp != firstCards[_local2]) {
temp = firstCards[_local2];
newVisibleCards.push(temp);
}
_local2++;
}
newInvisibleCards = new Array();
firstInvisibleCards.sort();
_local2 = 0;
while (_local2 < firstInvisibleCards.length) {
if (tempVar != firstInvisibleCards[_local2]) {
tempVar = firstInvisibleCards[_local2];
newInvisibleCards.push(tempVar);
}
_local2++;
}
newInvisibleCards.sort(numericalSort);
findSecondVisible(newVisibleCards.length);
middleCornerTiles();
}
function findSecondVisible(num1) {
visibleCards = new Array();
invisibleCards = new Array();
var _local3 = 0;
while (_local3 < num1) {
var _local2 = 0;
while (_local2 < num1) {
if (newVisibleCards[_local3] != newVisibleCards[_local2]) {
if (newVisibleCards[_local3] > newVisibleCards[_local2]) {
if (_root["card" + newVisibleCards[_local3]].hitClip.hitTest(_root["card" + newVisibleCards[_local2]].hitClip)) {
if (_root["card" + newVisibleCards[_local3]].getDepth() > _root["card" + newVisibleCards[_local2]].getDepth()) {
visibleCards.push(newVisibleCards[_local3]);
invisibleCards.push(newVisibleCards[_local2]);
}
}
}
}
_local2++;
}
_local3++;
}
}
function checkInvisibleCards(param1) {
var _local1 = 0;
while (_local1 < invisibleCards.length) {
if (invisibleCards[_local1] == param1) {
return(true);
}
_local1++;
}
}
function middleCornerTiles() {
midCorTiles = new Array();
middleTiles = newVisibleCards.length;
var _local2 = 0;
while (_local2 < middleTiles) {
if (_root["cornertile" + newVisibleCards[_local2]] == 1) {
if (checkInvisibleCards(newVisibleCards[_local2]) != true) {
midCorTiles.push(newVisibleCards[_local2]);
}
}
_local2++;
}
calIndividualCards();
}
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
function calIndividualCards() {
remCards = newInvisibleCards.concat(newVisibleCards);
remCards.sort(numericalSort);
nonIndividualCards = [];
i = 0;
while (i < remCards.length) {
if (tempVar != remCards[i]) {
tempVar = remCards[i];
nonIndividualCards.push(tempVar);
}
i++;
}
maxnumber = maxCards;
bottomIndCards = [];
arrayCompare();
}
function arrayCompare() {
var _local1 = 0;
while (_local1 < maxnumber) {
diff = nonIndividualCards[_local1 + 1] - nonIndividualCards[_local1];
if (diff != 1) {
missingValue = nonIndividualCards[_local1] + 1;
bottomIndCards.push(missingValue);
nonIndividualCards.push(missingValue);
nonIndividualCards.sort(numericalSort);
checkLength();
break;
}
_local1++;
}
}
function checkLength() {
if (nonIndividualCards.length != maxnumber) {
arrayCompare();
} else {
bottomCornerTiles();
}
}
function bottomCornerTiles() {
botCorTiles = new Array();
bottomTiles = bottomIndCards.length;
var _local2 = 0;
while (_local2 < bottomTiles) {
if (_root["cornertile" + bottomIndCards[_local2]] == 1) {
if (checkInvisibleCards(bottomIndCards[_local2]) != true) {
botCorTiles.push(bottomIndCards[_local2]);
}
}
_local2++;
}
totalCornerTIles = botCorTiles.concat(midCorTiles);
totalCornerTIles.sort(numericalSort);
checkwhichisliving();
}
function checkwhichisliving() {
liveCards = [];
currentFrameArray = [];
var _local2 = 0;
while (_local2 < totalCornerTIles.length) {
if (typeof(_root["card" + totalCornerTIles[_local2]]) == "movieclip") {
liveCards.push(totalCornerTIles[_local2]);
curFrame = _root["card" + totalCornerTIles[_local2]]._currentframe;
currentFrameArray.push(curFrame);
}
_local2++;
}
CheckPairs();
}
function CheckPairs() {
newLengthVar = currentFrameArray.length;
totalPairs = [];
hintArray = [];
var _local3 = 0;
while (_local3 < newLengthVar) {
if (hintArray.length < 2) {
var _local2 = 0;
while (_local2 < newLengthVar) {
if (currentFrameArray[_local3] == currentFrameArray[_local2]) {
if (_local3 != _local2) {
hintArray.push(liveCards[_local3]);
hintArray.push(liveCards[_local2]);
break;
}
}
_local2++;
}
}
_local3++;
}
if (hintArray.length == 2) {
_root["card" + hintArray[0]].hint.gotoAndStop(2);
_root["card" + hintArray[1]].hint.gotoAndStop(2);
} else {
noHint.gotoAndStop(2);
}
}
function cardCreator() {
i = 1;
while (i <= (maxCards / 2)) {
duplicateMovieClip (card, "card" + i, i);
ran = random(18) + 2;
this["card" + i].gotoAndStop(ran);
i++;
}
i = (maxCards / 2) + 1;
while (i <= maxCards) {
duplicateMovieClip (card, "card" + i, i);
this["card" + i].gotoAndStop(this["card" + (i - (maxCards / 2))]._currentframe);
i++;
}
i = 1;
while (i <= maxCards) {
if (i <= 12) {
this["card" + i]._x = 0 + ((i - 1) * 30);
this["card" + i]._y = 145 - yAdjust;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 13) && (i <= 24)) {
this["card" + i]._x = 0 + ((i - 13) * 30);
this["card" + i]._y = 183.1;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 25) && (i <= 36)) {
this["card" + i]._x = 0 + ((i - 25) * 30);
this["card" + i]._y = 228;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 37) && (i <= 48)) {
this["card" + i]._x = 0 + ((i - 37) * 30);
this["card" + i]._y = 273;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 49) && (i <= 60)) {
this["card" + i]._x = 0 + ((i - 49) * 30);
this["card" + i]._y = 318;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 61) && (i <= 72)) {
this["card" + i]._x = 0 + ((i - 61) * 30);
this["card" + i]._y = 363;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 73) && (i <= 84)) {
this["card" + i]._x = -5 + ((i - 73) * 30);
this["card" + i]._y = 140 - yAdjust;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 85) && (i <= 92)) {
this["card" + i]._x = 52 + ((i - 85) * 30);
this["card" + i]._y = 178.1;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 93) && (i <= 98)) {
this["card" + i]._x = 82 + ((i - 93) * 30);
this["card" + i]._y = 223;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 99) && (i <= 102)) {
this["card" + i]._x = 112 + ((i - 99) * 30);
this["card" + i]._y = 268;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 103) && (i <= 110)) {
this["card" + i]._x = 54 + ((i - 103) * 30);
this["card" + i]._y = 313.4;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 111) && (i <= 122)) {
this["card" + i]._x = 0 + ((i - 111) * 30);
this["card" + i]._y = 358;
this["card" + i].swapDepths(11000 + i);
}
if (i == 123) {
this["card" + i]._x = 370;
this["card" + i]._y = 370;
this["card" + i].swapDepths(11000 + i);
}
if (i == 124) {
this["card" + i]._x = 408;
this["card" + i]._y = 400;
this["card" + i].swapDepths(11000 + i);
}
if (i == 125) {
this["card" + i]._x = 448;
this["card" + i]._y = 400;
this["card" + i].swapDepths(10000 + i);
}
if (i == 126) {
this["card" + i]._x = 448;
this["card" + i]._y = 400;
this["card" + i].swapDepths(11000 + i);
}
i++;
}
}
function cornertile() {
i = 1;
while (i <= maxCards) {
if (i <= 11) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 14) && (i <= 23)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 26) && (i <= 35)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 38) && (i <= 47)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 50) && (i <= 59)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 62) && (i <= 71)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 74) && (i <= 83)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 86) && (i <= 91)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 94) && (i <= 97)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 100) && (i <= 101)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 104) && (i <= 109)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 112) && (i <= 121)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
i++;
}
}
removeMovieClip(noHint);
options_bt._visible = true;
stop();
cardCreator();
cornertile();
Frame 59
function Randomgenerator() {
ran = random(maxCards) + 1;
if (flag[ran] == 0) {
flag[ran] = 1;
return(ran);
}
i = 1;
while (i <= maxCards) {
if (flag[i] == 0) {
flag[i] = 1;
return(i);
}
i++;
}
}
flag = new Array();
gotoAndStop (65);
Frame 60
options_bt._visible = false;
Frame 62
function cardsCompare() {
cornertile();
oneObject = one;
twoObject = two;
if (oneObject._currentframe == twoObject._currentframe) {
trace("good");
one = null;
two = null;
clearMe = setInterval(FadeMe, 10, oneObject, twoObject);
count = count + 250;
_root.dbInterface.updateScore(_root.count);
balanceCards = balanceCards - 2;
if ((balanceCards == 0) && (timer._x < 451)) {
levelNumber = 5;
timeRemaining = 450 - Math.round(timer._x);
count = count + ((250 * levelNumber) + timeRemaining);
_root.dbInterface.updateScore(_root.count);
}
cornertile();
timer._x = timer._x - 7;
if (timer._x <= 290) {
timer._x = 293;
}
if (balanceCards == 0) {
_root.gotoAndStop(60);
}
} else {
_root.snd3.wrongObj.start(0, 1);
oneObject.highLight.gotoAndPlay(3);
twoObject.highLight.gotoAndPlay(3);
trace("bad");
one = null;
two = null;
}
}
function FadeMe(oneObj, twoObj) {
trace(oneObj._alpha);
if (oneObj._alpha > 0) {
oneObj._alpha = oneObj._alpha - decrement;
twoObj._alpha = twoObj._alpha - decrement;
} else {
_root.snd2.correctObj.start(0, 1);
trace("---------------");
trace("removed ");
trace("---------------");
removeMovieClip(oneObj);
removeMovieClip(twoObj);
cornertile();
clearInterval(clearMe);
}
}
var one = null;
var two = null;
maxCards = 126;
levelNumber = 5;
balanceCards = maxCards;
yAdjust = 6.4;
i = 1;
while (i <= 3) {
this["cornertile" + i] = 0;
i++;
}
cornertile1 = 1;
cornertile16 = 1;
cornertile17 = 1;
cornertile30 = 1;
cornertile31 = 1;
cornertile42 = 1;
cornertile43 = 1;
cornertile52 = 1;
cornertile53 = 1;
cornertile60 = 1;
cornertile61 = 1;
cornertile66 = 1;
cornertile67 = 1;
cornertile68 = 1;
cornertile69 = 1;
cornertile76 = 1;
cornertile77 = 1;
cornertile84 = 1;
cornertile85 = 1;
cornertile92 = 1;
cornertile93 = 1;
cornertile100 = 1;
cornertile101 = 1;
cornertile104 = 1;
cornertile105 = 1;
cornertile108 = 1;
cornertile109 = 1;
cornertile112 = 1;
cornertile113 = 1;
cornertile115 = 1;
cornertile116 = 1;
cornertile118 = 1;
cornertile119 = 1;
cornertile121 = 1;
cornertile122 = 1;
cornertile124 = 1;
cornertile125 = 1;
cornertile126 = 1;
decrement = 10;
Frame 65
MochiAd.showInterLevelAd({id:"5ecc1a17144b7ee0", res:"600x400"});
Instance of Symbol 248 MovieClip "timer" in Frame 65
onClipEvent (load) {
once = 0;
}
onClipEvent (enterFrame) {
if (_root.options != 0) {
this._x = this._x + 0.1;
if ((this._x >= 450) && (once == 0)) {
i = 1;
while (i <= _parent.maxCards) {
removeMovieClip(_parent["card" + i]);
i++;
}
once = 1;
_root.gotoAndStop(101);
}
}
}
Instance of Symbol 209 MovieClip "noHint" in Frame 65
onClipEvent (load) {
this.swapDepths(250000);
}
Frame 66
function findVisible(num) {
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
firstCards = new Array();
firstInvisibleCards = new Array();
remainingCards = new Array();
var _local2 = 1;
while (_local2 <= num) {
var _local3 = 1;
while (_local3 <= num) {
if (_local2 != _local3) {
if (_local2 > _local3) {
if (_root["card" + _local2].hitClip.hitTest(_root["card" + _local3].hitClip)) {
if (_root["card" + _local2].getDepth() > _root["card" + _local3].getDepth()) {
firstCards.push(_local2);
firstInvisibleCards.push(_local3);
}
}
}
}
_local3++;
}
_local2++;
}
newVisibleCards = new Array();
firstCards.sort();
_local2 = 0;
while (_local2 < firstCards.length) {
if (temp != firstCards[_local2]) {
temp = firstCards[_local2];
newVisibleCards.push(temp);
}
_local2++;
}
newInvisibleCards = new Array();
firstInvisibleCards.sort();
_local2 = 0;
while (_local2 < firstInvisibleCards.length) {
if (tempVar != firstInvisibleCards[_local2]) {
tempVar = firstInvisibleCards[_local2];
newInvisibleCards.push(tempVar);
}
_local2++;
}
newInvisibleCards.sort(numericalSort);
findSecondVisible(newVisibleCards.length);
middleCornerTiles();
}
function findSecondVisible(num1) {
visibleCards = new Array();
invisibleCards = new Array();
var _local3 = 0;
while (_local3 < num1) {
var _local2 = 0;
while (_local2 < num1) {
if (newVisibleCards[_local3] != newVisibleCards[_local2]) {
if (newVisibleCards[_local3] > newVisibleCards[_local2]) {
if (_root["card" + newVisibleCards[_local3]].hitClip.hitTest(_root["card" + newVisibleCards[_local2]].hitClip)) {
if (_root["card" + newVisibleCards[_local3]].getDepth() > _root["card" + newVisibleCards[_local2]].getDepth()) {
visibleCards.push(newVisibleCards[_local3]);
invisibleCards.push(newVisibleCards[_local2]);
}
}
}
}
_local2++;
}
_local3++;
}
}
function checkInvisibleCards(param1) {
var _local1 = 0;
while (_local1 < invisibleCards.length) {
if (invisibleCards[_local1] == param1) {
return(true);
}
_local1++;
}
}
function middleCornerTiles() {
midCorTiles = new Array();
middleTiles = newVisibleCards.length;
var _local2 = 0;
while (_local2 < middleTiles) {
if (_root["cornertile" + newVisibleCards[_local2]] == 1) {
if (checkInvisibleCards(newVisibleCards[_local2]) != true) {
midCorTiles.push(newVisibleCards[_local2]);
}
}
_local2++;
}
calIndividualCards();
}
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
function calIndividualCards() {
remCards = newInvisibleCards.concat(newVisibleCards);
remCards.sort(numericalSort);
nonIndividualCards = [];
i = 0;
while (i < remCards.length) {
if (tempVar != remCards[i]) {
tempVar = remCards[i];
nonIndividualCards.push(tempVar);
}
i++;
}
maxnumber = maxCards;
bottomIndCards = [];
arrayCompare();
}
function arrayCompare() {
var _local1 = 0;
while (_local1 < maxnumber) {
diff = nonIndividualCards[_local1 + 1] - nonIndividualCards[_local1];
if (diff != 1) {
missingValue = nonIndividualCards[_local1] + 1;
bottomIndCards.push(missingValue);
nonIndividualCards.push(missingValue);
nonIndividualCards.sort(numericalSort);
checkLength();
break;
}
_local1++;
}
}
function checkLength() {
if (nonIndividualCards.length != maxnumber) {
arrayCompare();
} else {
bottomCornerTiles();
}
}
function bottomCornerTiles() {
botCorTiles = new Array();
bottomTiles = bottomIndCards.length;
var _local2 = 0;
while (_local2 < bottomTiles) {
if (_root["cornertile" + bottomIndCards[_local2]] == 1) {
if (checkInvisibleCards(bottomIndCards[_local2]) != true) {
botCorTiles.push(bottomIndCards[_local2]);
}
}
_local2++;
}
totalCornerTIles = botCorTiles.concat(midCorTiles);
totalCornerTIles.sort(numericalSort);
checkwhichisliving();
}
function checkwhichisliving() {
liveCards = [];
currentFrameArray = [];
var _local2 = 0;
while (_local2 < totalCornerTIles.length) {
if (typeof(_root["card" + totalCornerTIles[_local2]]) == "movieclip") {
liveCards.push(totalCornerTIles[_local2]);
curFrame = _root["card" + totalCornerTIles[_local2]]._currentframe;
currentFrameArray.push(curFrame);
}
_local2++;
}
CheckPairs();
}
function CheckPairs() {
newLengthVar = currentFrameArray.length;
totalPairs = [];
hintArray = [];
var _local3 = 0;
while (_local3 < newLengthVar) {
if (hintArray.length < 2) {
var _local2 = 0;
while (_local2 < newLengthVar) {
if (currentFrameArray[_local3] == currentFrameArray[_local2]) {
if (_local3 != _local2) {
hintArray.push(liveCards[_local3]);
hintArray.push(liveCards[_local2]);
break;
}
}
_local2++;
}
}
_local3++;
}
if (hintArray.length == 2) {
_root["card" + hintArray[0]].hint.gotoAndStop(2);
_root["card" + hintArray[1]].hint.gotoAndStop(2);
} else {
noHint.gotoAndStop(2);
}
}
function cardCreator() {
i = 1;
while (i <= (maxCards / 2)) {
duplicateMovieClip (card, "card" + i, i);
ran = random(18) + 2;
this["card" + i].gotoAndStop(ran);
i++;
}
i = (maxCards / 2) + 1;
while (i <= maxCards) {
duplicateMovieClip (card, "card" + i, i);
this["card" + i].gotoAndStop(this["card" + (i - (maxCards / 2))]._currentframe);
i++;
}
i = 1;
while (i <= maxCards) {
if (i <= 16) {
this["card" + i]._x = -30 + ((i - 1) * 30);
this["card" + i]._y = 140 - yAdjust;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 17) && (i <= 30)) {
this["card" + i]._x = 0 + ((i - 17) * 30);
this["card" + i]._y = 177.5;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 31) && (i <= 42)) {
this["card" + i]._x = 30 + ((i - 31) * 30);
this["card" + i]._y = 222.1;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 43) && (i <= 52)) {
this["card" + i]._x = 60 + ((i - 43) * 30);
this["card" + i]._y = 266.6;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 53) && (i <= 60)) {
this["card" + i]._x = 90 + ((i - 53) * 30);
this["card" + i]._y = 311.1;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 61) && (i <= 66)) {
this["card" + i]._x = 120 + ((i - 61) * 30);
this["card" + i]._y = 356.2;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 67) && (i <= 68)) {
this["card" + i]._x = 180 + ((i - 67) * 30);
this["card" + i]._y = 400.8;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 69) && (i <= 76)) {
this["card" + i]._x = 86 + ((i - 69) * 30);
this["card" + i]._y = 263;
this["card" + i].swapDepths(13000 + i);
}
if ((i >= 77) && (i <= 84)) {
this["card" + i]._x = 86 + ((i - 77) * 30);
this["card" + i]._y = 218.6;
this["card" + i].swapDepths(12600 + i);
}
if ((i >= 85) && (i <= 92)) {
this["card" + i]._x = 86 + ((i - 85) * 30);
this["card" + i]._y = 174;
this["card" + i].swapDepths(12200 + i);
}
if ((i >= 93) && (i <= 100)) {
this["card" + i]._x = 86 + ((i - 93) * 30);
this["card" + i]._y = 129;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 101) && (i <= 104)) {
this["card" + i]._x = 142 + ((i - 101) * 30);
this["card" + i]._y = 170;
this["card" + i].swapDepths(14000 + i);
}
if ((i >= 105) && (i <= 108)) {
this["card" + i]._x = 142 + ((i - 105) * 30);
this["card" + i]._y = 214.6;
this["card" + i].swapDepths(14000 + i);
}
if ((i >= 109) && (i <= 112)) {
this["card" + i]._x = 142 + ((i - 109) * 30);
this["card" + i]._y = 258.5;
this["card" + i].swapDepths(14000 + i);
}
if ((i >= 113) && (i <= 115)) {
this["card" + i]._x = -25 + ((i - 113) * 30);
this["card" + i]._y = 330;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 116) && (i <= 118)) {
this["card" + i]._x = -25 + ((i - 116) * 30);
this["card" + i]._y = 374.6;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 119) && (i <= 121)) {
this["card" + i]._x = 355 + ((i - 119) * 30);
this["card" + i]._y = 330;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 122) && (i <= 124)) {
this["card" + i]._x = 355 + ((i - 122) * 30);
this["card" + i]._y = 374.6;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 125) && (i <= 126)) {
this["card" + i]._x = 166 + ((i - 125) * 30);
this["card" + i]._y = 210;
this["card" + i].swapDepths(15000 + i);
}
i++;
}
}
function cornertile() {
i = 1;
while (i <= maxCards) {
if (i <= 15) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 18) && (i <= 29)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 32) && (i <= 41)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 44) && (i <= 51)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 54) && (i <= 59)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 62) && (i <= 65)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 70) && (i <= 75)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 78) && (i <= 83)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 86) && (i <= 91)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 94) && (i <= 99)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 102) && (i <= 103)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 106) && (i <= 107)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 110) && (i <= 111)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 114) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 117) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 120) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if (i == 123) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
i++;
}
}
removeMovieClip(noHint);
options_bt._visible = true;
stop();
cardCreator();
cornertile();
Frame 71
function Randomgenerator() {
ran = random(maxCards) + 1;
if (flag[ran] == 0) {
flag[ran] = 1;
return(ran);
}
i = 1;
while (i <= maxCards) {
if (flag[i] == 0) {
flag[i] = 1;
return(i);
}
i++;
}
}
flag = new Array();
gotoAndStop (77);
Frame 72
options_bt._visible = false;
Frame 74
function cardsCompare() {
cornertile();
oneObject = one;
twoObject = two;
if (oneObject._currentframe == twoObject._currentframe) {
trace("good");
one = null;
two = null;
clearMe = setInterval(FadeMe, 10, oneObject, twoObject);
count = count + 300;
_root.dbInterface.updateScore(_root.count);
balanceCards = balanceCards - 2;
if ((balanceCards == 0) && (timer._x < 450)) {
levelNumber = 6;
timeRemaining = 450 - Math.round(timer._x);
count = count + ((250 * levelNumber) + timeRemaining);
_root.dbInterface.updateScore(_root.count);
}
cornertile();
timer._x = timer._x - 7;
if (timer._x <= 290) {
timer._x = 293;
}
if (balanceCards == 0) {
_root.gotoAndStop(72);
}
} else {
_root.snd3.wrongObj.start(0, 1);
oneObject.highLight.gotoAndPlay(3);
twoObject.highLight.gotoAndPlay(3);
trace("bad");
one = null;
two = null;
}
}
function FadeMe(oneObj, twoObj) {
trace(oneObj._alpha);
if (oneObj._alpha > 0) {
oneObj._alpha = oneObj._alpha - decrement;
twoObj._alpha = twoObj._alpha - decrement;
} else {
_root.snd2.correctObj.start(0, 1);
trace("---------------");
trace("removed ");
trace("---------------");
removeMovieClip(oneObj);
removeMovieClip(twoObj);
cornertile();
clearInterval(clearMe);
}
}
var one = null;
var two = null;
maxCards = 128;
levelNumber = 6;
balanceCards = maxCards;
yAdjust = 6.4;
i = 1;
while (i <= 3) {
this["cornertile" + i] = 0;
i++;
}
cornertile1 = 1;
cornertile12 = 1;
cornertile13 = 1;
cornertile16 = 1;
cornertile17 = 1;
cornertile22 = 1;
cornertile23 = 1;
cornertile28 = 1;
cornertile29 = 1;
cornertile34 = 1;
cornertile35 = 1;
cornertile48 = 1;
cornertile49 = 1;
cornertile62 = 1;
cornertile63 = 1;
cornertile66 = 1;
cornertile67 = 1;
cornertile70 = 1;
cornertile71 = 1;
cornertile74 = 1;
cornertile75 = 1;
cornertile78 = 1;
cornertile79 = 1;
cornertile80 = 1;
cornertile81 = 1;
cornertile82 = 1;
cornertile83 = 1;
cornertile84 = 1;
cornertile85 = 1;
cornertile86 = 1;
cornertile87 = 1;
cornertile96 = 1;
cornertile97 = 1;
cornertile106 = 1;
cornertile107 = 1;
cornertile110 = 1;
cornertile111 = 1;
cornertile114 = 1;
cornertile115 = 1;
cornertile118 = 1;
cornertile119 = 1;
cornertile126 = 1;
cornertile127 = 1;
cornertile128 = 1;
decrement = 10;
Frame 77
MochiAd.showInterLevelAd({id:"5ecc1a17144b7ee0", res:"600x400"});
Instance of Symbol 259 MovieClip "timer" in Frame 77
onClipEvent (load) {
once = 0;
}
onClipEvent (enterFrame) {
if (_root.options != 0) {
this._x = this._x + 0.1;
if ((this._x >= 450) && (once == 0)) {
i = 1;
while (i <= _parent.maxCards) {
removeMovieClip(_parent["card" + i]);
i++;
}
once = 1;
_root.gotoAndStop(101);
}
}
}
Instance of Symbol 209 MovieClip "noHint" in Frame 77
onClipEvent (load) {
this.swapDepths(250000);
}
Frame 78
function findVisible(num) {
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
firstCards = new Array();
firstInvisibleCards = new Array();
remainingCards = new Array();
var _local2 = 1;
while (_local2 <= num) {
var _local3 = 1;
while (_local3 <= num) {
if (_local2 != _local3) {
if (_local2 > _local3) {
if (_root["card" + _local2].hitClip.hitTest(_root["card" + _local3].hitClip)) {
if (_root["card" + _local2].getDepth() > _root["card" + _local3].getDepth()) {
firstCards.push(_local2);
firstInvisibleCards.push(_local3);
}
}
}
}
_local3++;
}
_local2++;
}
newVisibleCards = new Array();
firstCards.sort();
_local2 = 0;
while (_local2 < firstCards.length) {
if (temp != firstCards[_local2]) {
temp = firstCards[_local2];
newVisibleCards.push(temp);
}
_local2++;
}
newInvisibleCards = new Array();
firstInvisibleCards.sort();
_local2 = 0;
while (_local2 < firstInvisibleCards.length) {
if (tempVar != firstInvisibleCards[_local2]) {
tempVar = firstInvisibleCards[_local2];
newInvisibleCards.push(tempVar);
}
_local2++;
}
newInvisibleCards.sort(numericalSort);
findSecondVisible(newVisibleCards.length);
middleCornerTiles();
}
function findSecondVisible(num1) {
visibleCards = new Array();
invisibleCards = new Array();
var _local3 = 0;
while (_local3 < num1) {
var _local2 = 0;
while (_local2 < num1) {
if (newVisibleCards[_local3] != newVisibleCards[_local2]) {
if (newVisibleCards[_local3] > newVisibleCards[_local2]) {
if (_root["card" + newVisibleCards[_local3]].hitClip.hitTest(_root["card" + newVisibleCards[_local2]].hitClip)) {
if (_root["card" + newVisibleCards[_local3]].getDepth() > _root["card" + newVisibleCards[_local2]].getDepth()) {
visibleCards.push(newVisibleCards[_local3]);
invisibleCards.push(newVisibleCards[_local2]);
}
}
}
}
_local2++;
}
_local3++;
}
}
function checkInvisibleCards(param1) {
var _local1 = 0;
while (_local1 < invisibleCards.length) {
if (invisibleCards[_local1] == param1) {
return(true);
}
_local1++;
}
}
function middleCornerTiles() {
midCorTiles = new Array();
middleTiles = newVisibleCards.length;
var _local2 = 0;
while (_local2 < middleTiles) {
if (_root["cornertile" + newVisibleCards[_local2]] == 1) {
if (checkInvisibleCards(newVisibleCards[_local2]) != true) {
midCorTiles.push(newVisibleCards[_local2]);
}
}
_local2++;
}
calIndividualCards();
}
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
function calIndividualCards() {
remCards = newInvisibleCards.concat(newVisibleCards);
remCards.sort(numericalSort);
nonIndividualCards = [];
i = 0;
while (i < remCards.length) {
if (tempVar != remCards[i]) {
tempVar = remCards[i];
nonIndividualCards.push(tempVar);
}
i++;
}
maxnumber = maxCards;
bottomIndCards = [];
arrayCompare();
}
function arrayCompare() {
var _local1 = 0;
while (_local1 < maxnumber) {
diff = nonIndividualCards[_local1 + 1] - nonIndividualCards[_local1];
if (diff != 1) {
missingValue = nonIndividualCards[_local1] + 1;
bottomIndCards.push(missingValue);
nonIndividualCards.push(missingValue);
nonIndividualCards.sort(numericalSort);
checkLength();
break;
}
_local1++;
}
}
function checkLength() {
if (nonIndividualCards.length != maxnumber) {
arrayCompare();
} else {
bottomCornerTiles();
}
}
function bottomCornerTiles() {
botCorTiles = new Array();
bottomTiles = bottomIndCards.length;
var _local2 = 0;
while (_local2 < bottomTiles) {
if (_root["cornertile" + bottomIndCards[_local2]] == 1) {
if (checkInvisibleCards(bottomIndCards[_local2]) != true) {
botCorTiles.push(bottomIndCards[_local2]);
}
}
_local2++;
}
totalCornerTIles = botCorTiles.concat(midCorTiles);
totalCornerTIles.sort(numericalSort);
checkwhichisliving();
}
function checkwhichisliving() {
liveCards = [];
currentFrameArray = [];
var _local2 = 0;
while (_local2 < totalCornerTIles.length) {
if (typeof(_root["card" + totalCornerTIles[_local2]]) == "movieclip") {
liveCards.push(totalCornerTIles[_local2]);
curFrame = _root["card" + totalCornerTIles[_local2]]._currentframe;
currentFrameArray.push(curFrame);
}
_local2++;
}
CheckPairs();
}
function CheckPairs() {
newLengthVar = currentFrameArray.length;
totalPairs = [];
hintArray = [];
var _local3 = 0;
while (_local3 < newLengthVar) {
if (hintArray.length < 2) {
var _local2 = 0;
while (_local2 < newLengthVar) {
if (currentFrameArray[_local3] == currentFrameArray[_local2]) {
if (_local3 != _local2) {
hintArray.push(liveCards[_local3]);
hintArray.push(liveCards[_local2]);
break;
}
}
_local2++;
}
}
_local3++;
}
if (hintArray.length == 2) {
_root["card" + hintArray[0]].hint.gotoAndStop(2);
_root["card" + hintArray[1]].hint.gotoAndStop(2);
} else {
noHint.gotoAndStop(2);
}
}
function cardCreator() {
i = 1;
while (i <= (maxCards / 2)) {
duplicateMovieClip (card, "card" + i, i);
ran = random(18) + 2;
this["card" + i].gotoAndStop(ran);
i++;
}
i = (maxCards / 2) + 1;
while (i <= maxCards) {
duplicateMovieClip (card, "card" + i, i);
this["card" + i].gotoAndStop(this["card" + (i - (maxCards / 2))]._currentframe);
i++;
}
i = 1;
while (i <= maxCards) {
if (i <= 12) {
this["card" + i]._x = 40 + ((i - 1) * 30);
this["card" + i]._y = 180 - yAdjust;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 13) && (i <= 16)) {
this["card" + i]._x = 160 + ((i - 13) * 30);
this["card" + i]._y = 130;
this["card" + i].swapDepths(9500 + i);
}
if ((i >= 17) && (i <= 22)) {
this["card" + i]._x = 130 + ((i - 17) * 30);
this["card" + i]._y = 218;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 23) && (i <= 28)) {
this["card" + i]._x = 130 + ((i - 23) * 30);
this["card" + i]._y = 263;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 29) && (i <= 34)) {
this["card" + i]._x = 130 + ((i - 29) * 30);
this["card" + i]._y = 308;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 35) && (i <= 48)) {
this["card" + i]._x = 10 + ((i - 35) * 30);
this["card" + i]._y = 353;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 49) && (i <= 62)) {
this["card" + i]._x = 10 + ((i - 49) * 30);
this["card" + i]._y = 398;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 63) && (i <= 66)) {
this["card" + i]._x = -30 + ((i - 63) * 30);
this["card" + i]._y = 238;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 67) && (i <= 70)) {
this["card" + i]._x = -30 + ((i - 67) * 30);
this["card" + i]._y = 283;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 71) && (i <= 74)) {
this["card" + i]._x = 350 + ((i - 71) * 30);
this["card" + i]._y = 238;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 75) && (i <= 78)) {
this["card" + i]._x = 350 + ((i - 75) * 30);
this["card" + i]._y = 283;
this["card" + i].swapDepths(9000 + i);
}
if ((i >= 79) && (i <= 80)) {
this["card" + i]._x = -4 + ((i - 79) * 30);
this["card" + i]._y = 232;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 81) && (i <= 82)) {
this["card" + i]._x = -4 + ((i - 81) * 30);
this["card" + i]._y = 277;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 83) && (i <= 84)) {
this["card" + i]._x = 376 + ((i - 83) * 30);
this["card" + i]._y = 232;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 85) && (i <= 86)) {
this["card" + i]._x = 376 + ((i - 85) * 30);
this["card" + i]._y = 277;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 87) && (i <= 96)) {
this["card" + i]._x = 65 + ((i - 87) * 30);
this["card" + i]._y = 345;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 97) && (i <= 106)) {
this["card" + i]._x = 65 + ((i - 97) * 30);
this["card" + i]._y = 390;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 107) && (i <= 110)) {
this["card" + i]._x = 156 + ((i - 107) * 30);
this["card" + i]._y = 210;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 111) && (i <= 114)) {
this["card" + i]._x = 156 + ((i - 111) * 30);
this["card" + i]._y = 255;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 115) && (i <= 118)) {
this["card" + i]._x = 156 + ((i - 115) * 30);
this["card" + i]._y = 300;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 119) && (i <= 126)) {
this["card" + i]._x = 96 + ((i - 119) * 30);
this["card" + i]._y = 165;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 127) && (i <= 128)) {
this["card" + i]._x = 186 + ((i - 127) * 30);
this["card" + i]._y = 120;
this["card" + i].swapDepths(9600 + i);
}
i++;
}
}
function cornertile() {
i = 1;
while (i <= maxCards) {
if (i <= 11) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 14) && (i <= 15)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 18) && (i <= 21)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 24) && (i <= 27)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 30) && (i <= 33)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 36) && (i <= 47)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 50) && (i <= 61)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 64) && (i <= 65)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 68) && (i <= 69)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 72) && (i <= 73)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 76) && (i <= 77)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 88) && (i <= 95)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 98) && (i <= 105)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 108) && (i <= 109)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 112) && (i <= 113)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 116) && (i <= 117)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 120) && (i <= 125)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
i++;
}
}
removeMovieClip(noHint);
options_bt._visible = true;
stop();
cardCreator();
cornertile();
Frame 83
function Randomgenerator() {
ran = random(maxCards) + 1;
if (flag[ran] == 0) {
flag[ran] = 1;
return(ran);
}
i = 1;
while (i <= maxCards) {
if (flag[i] == 0) {
flag[i] = 1;
return(i);
}
i++;
}
}
flag = new Array();
gotoAndStop (89);
Frame 84
options_bt._visible = false;
Frame 86
function cardsCompare() {
cornertile();
oneObject = one;
twoObject = two;
if (oneObject._currentframe == twoObject._currentframe) {
one = null;
two = null;
clearMe = setInterval(FadeMe, 10, oneObject, twoObject);
count = count + 350;
_root.dbInterface.updateScore(_root.count);
balanceCards = balanceCards - 2;
if ((balanceCards == 0) && (timer._x < 450)) {
levelNumber = 7;
timeRemaining = 450 - Math.round(timer._x);
count = count + ((250 * levelNumber) + timeRemaining);
_root.dbInterface.updateScore(_root.count);
}
cornertile();
timer._x = timer._x - 7;
if (timer._x <= 290) {
timer._x = 293;
}
if (balanceCards == 0) {
_root.gotoAndStop(84);
}
} else {
_root.snd3.wrongObj.start(0, 1);
oneObject.highLight.gotoAndPlay(3);
twoObject.highLight.gotoAndPlay(3);
trace("bad");
one = null;
two = null;
}
}
function FadeMe(oneObj, twoObj) {
trace(oneObj._alpha);
if (oneObj._alpha > 0) {
oneObj._alpha = oneObj._alpha - decrement;
twoObj._alpha = twoObj._alpha - decrement;
} else {
_root.snd2.correctObj.start(0, 1);
trace("---------------");
trace("removed ");
trace("---------------");
removeMovieClip(oneObj);
removeMovieClip(twoObj);
cornertile();
clearInterval(clearMe);
}
}
var one = null;
var two = null;
maxCards = 150;
levelNumber = 7;
balanceCards = maxCards;
yAdjust = 6.4;
i = 1;
while (i <= 3) {
this["cornertile" + i] = 0;
i++;
}
cornertile1 = 1;
cornertile14 = 1;
cornertile15 = 1;
cornertile26 = 1;
cornertile27 = 1;
cornertile36 = 1;
cornertile37 = 1;
cornertile44 = 1;
cornertile45 = 1;
cornertile54 = 1;
cornertile55 = 1;
cornertile66 = 1;
cornertile67 = 1;
cornertile80 = 1;
cornertile81 = 1;
cornertile88 = 1;
cornertile89 = 1;
cornertile96 = 1;
cornertile97 = 1;
cornertile104 = 1;
cornertile105 = 1;
cornertile112 = 1;
cornertile113 = 1;
cornertile120 = 1;
cornertile121 = 1;
cornertile126 = 1;
cornertile127 = 1;
cornertile132 = 1;
cornertile133 = 1;
cornertile138 = 1;
cornertile139 = 1;
cornertile142 = 1;
cornertile143 = 1;
cornertile146 = 1;
cornertile147 = 1;
cornertile150 = 1;
decrement = 10;
Frame 89
MochiAd.showInterLevelAd({id:"5ecc1a17144b7ee0", res:"600x400"});
Instance of Symbol 270 MovieClip "timer" in Frame 89
onClipEvent (load) {
once = 0;
}
onClipEvent (enterFrame) {
if (_root.options != 0) {
this._x = this._x + 0.15;
if ((this._x >= 450) && (once == 0)) {
i = 1;
while (i <= _parent.maxCards) {
removeMovieClip(_parent["card" + i]);
i++;
}
once = 1;
_root.gotoAndStop(101);
}
}
}
Instance of Symbol 209 MovieClip "noHint" in Frame 89
onClipEvent (load) {
this.swapDepths(250000);
}
Frame 90
function findVisible(num) {
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
firstCards = new Array();
firstInvisibleCards = new Array();
remainingCards = new Array();
var _local2 = 1;
while (_local2 <= num) {
var _local3 = 1;
while (_local3 <= num) {
if (_local2 != _local3) {
if (_local2 > _local3) {
if (_root["card" + _local2].hitClip.hitTest(_root["card" + _local3].hitClip)) {
if (_root["card" + _local2].getDepth() > _root["card" + _local3].getDepth()) {
firstCards.push(_local2);
firstInvisibleCards.push(_local3);
}
}
}
}
_local3++;
}
_local2++;
}
newVisibleCards = new Array();
firstCards.sort();
_local2 = 0;
while (_local2 < firstCards.length) {
if (temp != firstCards[_local2]) {
temp = firstCards[_local2];
newVisibleCards.push(temp);
}
_local2++;
}
newInvisibleCards = new Array();
firstInvisibleCards.sort();
_local2 = 0;
while (_local2 < firstInvisibleCards.length) {
if (tempVar != firstInvisibleCards[_local2]) {
tempVar = firstInvisibleCards[_local2];
newInvisibleCards.push(tempVar);
}
_local2++;
}
newInvisibleCards.sort(numericalSort);
findSecondVisible(newVisibleCards.length);
middleCornerTiles();
}
function findSecondVisible(num1) {
visibleCards = new Array();
invisibleCards = new Array();
var _local3 = 0;
while (_local3 < num1) {
var _local2 = 0;
while (_local2 < num1) {
if (newVisibleCards[_local3] != newVisibleCards[_local2]) {
if (newVisibleCards[_local3] > newVisibleCards[_local2]) {
if (_root["card" + newVisibleCards[_local3]].hitClip.hitTest(_root["card" + newVisibleCards[_local2]].hitClip)) {
if (_root["card" + newVisibleCards[_local3]].getDepth() > _root["card" + newVisibleCards[_local2]].getDepth()) {
visibleCards.push(newVisibleCards[_local3]);
invisibleCards.push(newVisibleCards[_local2]);
}
}
}
}
_local2++;
}
_local3++;
}
}
function checkInvisibleCards(param1) {
var _local1 = 0;
while (_local1 < invisibleCards.length) {
if (invisibleCards[_local1] == param1) {
return(true);
}
_local1++;
}
}
function middleCornerTiles() {
midCorTiles = new Array();
middleTiles = newVisibleCards.length;
var _local2 = 0;
while (_local2 < middleTiles) {
if (_root["cornertile" + newVisibleCards[_local2]] == 1) {
if (checkInvisibleCards(newVisibleCards[_local2]) != true) {
midCorTiles.push(newVisibleCards[_local2]);
}
}
_local2++;
}
calIndividualCards();
}
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
function calIndividualCards() {
remCards = newInvisibleCards.concat(newVisibleCards);
remCards.sort(numericalSort);
nonIndividualCards = [];
i = 0;
while (i < remCards.length) {
if (tempVar != remCards[i]) {
tempVar = remCards[i];
nonIndividualCards.push(tempVar);
}
i++;
}
maxnumber = maxCards;
bottomIndCards = [];
arrayCompare();
}
function arrayCompare() {
var _local1 = 0;
while (_local1 < maxnumber) {
diff = nonIndividualCards[_local1 + 1] - nonIndividualCards[_local1];
if (diff != 1) {
missingValue = nonIndividualCards[_local1] + 1;
bottomIndCards.push(missingValue);
nonIndividualCards.push(missingValue);
nonIndividualCards.sort(numericalSort);
checkLength();
break;
}
_local1++;
}
}
function checkLength() {
if (nonIndividualCards.length != maxnumber) {
arrayCompare();
} else {
bottomCornerTiles();
}
}
function bottomCornerTiles() {
botCorTiles = new Array();
bottomTiles = bottomIndCards.length;
var _local2 = 0;
while (_local2 < bottomTiles) {
if (_root["cornertile" + bottomIndCards[_local2]] == 1) {
if (checkInvisibleCards(bottomIndCards[_local2]) != true) {
botCorTiles.push(bottomIndCards[_local2]);
}
}
_local2++;
}
totalCornerTIles = botCorTiles.concat(midCorTiles);
totalCornerTIles.sort(numericalSort);
checkwhichisliving();
}
function checkwhichisliving() {
liveCards = [];
currentFrameArray = [];
var _local2 = 0;
while (_local2 < totalCornerTIles.length) {
if (typeof(_root["card" + totalCornerTIles[_local2]]) == "movieclip") {
liveCards.push(totalCornerTIles[_local2]);
curFrame = _root["card" + totalCornerTIles[_local2]]._currentframe;
currentFrameArray.push(curFrame);
}
_local2++;
}
CheckPairs();
}
function CheckPairs() {
newLengthVar = currentFrameArray.length;
totalPairs = [];
hintArray = [];
var _local3 = 0;
while (_local3 < newLengthVar) {
if (hintArray.length < 2) {
var _local2 = 0;
while (_local2 < newLengthVar) {
if (currentFrameArray[_local3] == currentFrameArray[_local2]) {
if (_local3 != _local2) {
hintArray.push(liveCards[_local3]);
hintArray.push(liveCards[_local2]);
break;
}
}
_local2++;
}
}
_local3++;
}
if (hintArray.length == 2) {
_root["card" + hintArray[0]].hint.gotoAndStop(2);
_root["card" + hintArray[1]].hint.gotoAndStop(2);
} else {
noHint.gotoAndStop(2);
}
}
function cardCreator() {
i = 1;
while (i <= (maxCards / 2)) {
duplicateMovieClip (card, "card" + i, i);
ran = random(18) + 2;
this["card" + i].gotoAndStop(ran);
i++;
}
i = (maxCards / 2) + 1;
while (i <= maxCards) {
duplicateMovieClip (card, "card" + i, i);
this["card" + i].gotoAndStop(this["card" + (i - (maxCards / 2))]._currentframe);
i++;
}
i = 1;
while (i <= maxCards) {
if (i <= 14) {
this["card" + i]._x = 0 + ((i - 1) * 30);
this["card" + i]._y = 140 - yAdjust;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 15) && (i <= 26)) {
this["card" + i]._x = 30 + ((i - 15) * 30);
this["card" + i]._y = 178;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 27) && (i <= 36)) {
this["card" + i]._x = 60 + ((i - 27) * 30);
this["card" + i]._y = 222.2;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 37) && (i <= 44)) {
this["card" + i]._x = 90 + ((i - 37) * 30);
this["card" + i]._y = 267;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 45) && (i <= 54)) {
this["card" + i]._x = 60 + ((i - 45) * 30);
this["card" + i]._y = 312;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 55) && (i <= 66)) {
this["card" + i]._x = 30 + ((i - 55) * 30);
this["card" + i]._y = 356.4;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 67) && (i <= 80)) {
this["card" + i]._x = 0 + ((i - 67) * 30);
this["card" + i]._y = 401;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 81) && (i <= 88)) {
this["card" + i]._x = 84 + ((i - 81) * 30);
this["card" + i]._y = 172;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 89) && (i <= 96)) {
this["card" + i]._x = 84 + ((i - 89) * 30);
this["card" + i]._y = 216.4;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 97) && (i <= 104)) {
this["card" + i]._x = 84 + ((i - 97) * 30);
this["card" + i]._y = 261;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 105) && (i <= 112)) {
this["card" + i]._x = 84 + ((i - 105) * 30);
this["card" + i]._y = 305.5;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 113) && (i <= 120)) {
this["card" + i]._x = 84 + ((i - 113) * 30);
this["card" + i]._y = 350;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 121) && (i <= 126)) {
this["card" + i]._x = 108 + ((i - 121) * 30);
this["card" + i]._y = 210;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 127) && (i <= 132)) {
this["card" + i]._x = 108 + ((i - 127) * 30);
this["card" + i]._y = 254.4;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 133) && (i <= 138)) {
this["card" + i]._x = 108 + ((i - 133) * 30);
this["card" + i]._y = 299;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 139) && (i <= 142)) {
this["card" + i]._x = 133 + ((i - 139) * 30);
this["card" + i]._y = 204;
this["card" + i].swapDepths(13000 + i);
}
if ((i >= 143) && (i <= 146)) {
this["card" + i]._x = 133 + ((i - 143) * 30);
this["card" + i]._y = 248.4;
this["card" + i].swapDepths(13000 + i);
}
if ((i >= 147) && (i <= 150)) {
this["card" + i]._x = 133 + ((i - 147) * 30);
this["card" + i]._y = 293.2;
this["card" + i].swapDepths(13000 + i);
}
i++;
}
}
function cornertile() {
i = 1;
while (i <= maxCards) {
if (i <= 13) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 16) && (i <= 25)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 28) && (i <= 35)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 38) && (i <= 43)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 46) && (i <= 53)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 56) && (i <= 65)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 68) && (i <= 79)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 82) && (i <= 87)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 90) && (i <= 95)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 98) && (i <= 103)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 106) && (i <= 111)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 114) && (i <= 119)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 122) && (i <= 125)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 128) && (i <= 131)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 134) && (i <= 137)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 140) && (i <= 141)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 144) && (i <= 145)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 148) && (i <= 149)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
i++;
}
}
removeMovieClip(noHint);
options_bt._visible = true;
stop();
cardCreator();
cornertile();
Frame 94
function Randomgenerator() {
ran = random(maxCards) + 1;
if (flag[ran] == 0) {
flag[ran] = 1;
return(ran);
}
i = 1;
while (i <= maxCards) {
if (flag[i] == 0) {
flag[i] = 1;
return(i);
}
i++;
}
}
flag = new Array();
gotoAndStop (100);
Frame 95
options_bt._visible = false;
stop();
setDeactive();
Frame 97
function cardsCompare() {
cornertile();
oneObject = one;
twoObject = two;
if (oneObject._currentframe == twoObject._currentframe) {
one = null;
two = null;
clearMe = setInterval(FadeMe, 10, oneObject, twoObject);
count = count + 400;
_root.dbInterface.updateScore(_root.count);
balanceCards = balanceCards - 2;
if ((balanceCards == 0) && (timer._x < 451)) {
levelNumber = 8;
timeRemaining = 450 - Math.round(timer._x);
count = count + ((250 * levelNumber) + timeRemaining);
_root.dbInterface.updateScore(_root.count);
}
cornertile();
timer._x = timer._x - 7;
if (timer._x <= 290) {
timer._x = 293;
}
if (balanceCards == 0) {
_root.gotoAndStop(95);
}
} else {
_root.snd3.wrongObj.start(0, 1);
oneObject.highLight.gotoAndPlay(3);
twoObject.highLight.gotoAndPlay(3);
trace("bad");
one = null;
two = null;
}
}
function FadeMe(oneObj, twoObj) {
trace(oneObj._alpha);
if (oneObj._alpha > 0) {
oneObj._alpha = oneObj._alpha - decrement;
twoObj._alpha = twoObj._alpha - decrement;
} else {
_root.snd2.correctObj.start(0, 1);
trace("---------------");
trace("removed ");
trace("---------------");
removeMovieClip(oneObj);
removeMovieClip(twoObj);
cornertile();
clearInterval(clearMe);
}
}
var one = null;
var two = null;
maxCards = 200;
levelNumber = 8;
balanceCards = maxCards;
yAdjust = 6.4;
i = 1;
while (i <= 3) {
this["cornertile" + i] = 0;
i++;
}
cornertile1 = 1;
cornertile14 = 1;
cornertile15 = 1;
cornertile28 = 1;
cornertile29 = 1;
cornertile42 = 1;
cornertile43 = 1;
cornertile56 = 1;
cornertile57 = 1;
cornertile70 = 1;
cornertile71 = 1;
cornertile84 = 1;
cornertile85 = 1;
cornertile98 = 1;
cornertile99 = 1;
cornertile110 = 1;
cornertile111 = 1;
cornertile122 = 1;
cornertile123 = 1;
cornertile134 = 1;
cornertile135 = 1;
cornertile146 = 1;
cornertile147 = 1;
cornertile158 = 1;
cornertile159 = 1;
cornertile168 = 1;
cornertile169 = 1;
cornertile178 = 1;
cornertile179 = 1;
cornertile188 = 1;
cornertile189 = 1;
cornertile192 = 1;
cornertile193 = 1;
cornertile196 = 1;
cornertile197 = 1;
cornertile200 = 1;
decrement = 10;
Frame 100
function findVisible(num) {
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
firstCards = new Array();
firstInvisibleCards = new Array();
remainingCards = new Array();
var _local2 = 1;
while (_local2 <= num) {
var _local3 = 1;
while (_local3 <= num) {
if (_local2 != _local3) {
if (_local2 > _local3) {
if (_root["card" + _local2].hitClip.hitTest(_root["card" + _local3].hitClip)) {
if (_root["card" + _local2].getDepth() > _root["card" + _local3].getDepth()) {
firstCards.push(_local2);
firstInvisibleCards.push(_local3);
}
}
}
}
_local3++;
}
_local2++;
}
newVisibleCards = new Array();
firstCards.sort();
_local2 = 0;
while (_local2 < firstCards.length) {
if (temp != firstCards[_local2]) {
temp = firstCards[_local2];
newVisibleCards.push(temp);
}
_local2++;
}
newInvisibleCards = new Array();
firstInvisibleCards.sort();
_local2 = 0;
while (_local2 < firstInvisibleCards.length) {
if (tempVar != firstInvisibleCards[_local2]) {
tempVar = firstInvisibleCards[_local2];
newInvisibleCards.push(tempVar);
}
_local2++;
}
newInvisibleCards.sort(numericalSort);
findSecondVisible(newVisibleCards.length);
middleCornerTiles();
}
function findSecondVisible(num1) {
visibleCards = new Array();
invisibleCards = new Array();
var _local3 = 0;
while (_local3 < num1) {
var _local2 = 0;
while (_local2 < num1) {
if (newVisibleCards[_local3] != newVisibleCards[_local2]) {
if (newVisibleCards[_local3] > newVisibleCards[_local2]) {
if (_root["card" + newVisibleCards[_local3]].hitClip.hitTest(_root["card" + newVisibleCards[_local2]].hitClip)) {
if (_root["card" + newVisibleCards[_local3]].getDepth() > _root["card" + newVisibleCards[_local2]].getDepth()) {
visibleCards.push(newVisibleCards[_local3]);
invisibleCards.push(newVisibleCards[_local2]);
}
}
}
}
_local2++;
}
_local3++;
}
}
function checkInvisibleCards(param1) {
var _local1 = 0;
while (_local1 < invisibleCards.length) {
if (invisibleCards[_local1] == param1) {
return(true);
}
_local1++;
}
}
function middleCornerTiles() {
midCorTiles = new Array();
middleTiles = newVisibleCards.length;
var _local2 = 0;
while (_local2 < middleTiles) {
if (_root["cornertile" + newVisibleCards[_local2]] == 1) {
if (checkInvisibleCards(newVisibleCards[_local2]) != true) {
midCorTiles.push(newVisibleCards[_local2]);
}
}
_local2++;
}
calIndividualCards();
}
function numericalSort(a, b) {
if (Number(a) > Number(b)) {
return(1);
}
return(-1);
}
function calIndividualCards() {
remCards = newInvisibleCards.concat(newVisibleCards);
remCards.sort(numericalSort);
nonIndividualCards = [];
i = 0;
while (i < remCards.length) {
if (tempVar != remCards[i]) {
tempVar = remCards[i];
nonIndividualCards.push(tempVar);
}
i++;
}
maxnumber = maxCards;
bottomIndCards = [];
arrayCompare();
}
function arrayCompare() {
var _local1 = 0;
while (_local1 < maxnumber) {
diff = nonIndividualCards[_local1 + 1] - nonIndividualCards[_local1];
if (diff != 1) {
missingValue = nonIndividualCards[_local1] + 1;
bottomIndCards.push(missingValue);
nonIndividualCards.push(missingValue);
nonIndividualCards.sort(numericalSort);
checkLength();
break;
}
_local1++;
}
}
function checkLength() {
if (nonIndividualCards.length != maxnumber) {
arrayCompare();
} else {
bottomCornerTiles();
}
}
function bottomCornerTiles() {
botCorTiles = new Array();
bottomTiles = bottomIndCards.length;
var _local2 = 0;
while (_local2 < bottomTiles) {
if (_root["cornertile" + bottomIndCards[_local2]] == 1) {
if (checkInvisibleCards(bottomIndCards[_local2]) != true) {
botCorTiles.push(bottomIndCards[_local2]);
}
}
_local2++;
}
totalCornerTIles = botCorTiles.concat(midCorTiles);
totalCornerTIles.sort(numericalSort);
checkwhichisliving();
}
function checkwhichisliving() {
liveCards = [];
currentFrameArray = [];
var _local2 = 0;
while (_local2 < totalCornerTIles.length) {
if (typeof(_root["card" + totalCornerTIles[_local2]]) == "movieclip") {
liveCards.push(totalCornerTIles[_local2]);
curFrame = _root["card" + totalCornerTIles[_local2]]._currentframe;
currentFrameArray.push(curFrame);
}
_local2++;
}
CheckPairs();
}
function CheckPairs() {
newLengthVar = currentFrameArray.length;
totalPairs = [];
hintArray = [];
var _local3 = 0;
while (_local3 < newLengthVar) {
if (hintArray.length < 2) {
var _local2 = 0;
while (_local2 < newLengthVar) {
if (currentFrameArray[_local3] == currentFrameArray[_local2]) {
if (_local3 != _local2) {
hintArray.push(liveCards[_local3]);
hintArray.push(liveCards[_local2]);
break;
}
}
_local2++;
}
}
_local3++;
}
if (hintArray.length == 2) {
_root["card" + hintArray[0]].hint.gotoAndStop(2);
_root["card" + hintArray[1]].hint.gotoAndStop(2);
} else {
noHint.gotoAndStop(2);
}
}
function cardCreator() {
i = 1;
while (i <= (maxCards / 2)) {
duplicateMovieClip (card, "card" + i, i);
ran = random(18) + 2;
this["card" + i].gotoAndStop(ran);
i++;
}
i = (maxCards / 2) + 1;
while (i <= maxCards) {
duplicateMovieClip (card, "card" + i, i);
this["card" + i].gotoAndStop(this["card" + (i - (maxCards / 2))]._currentframe);
i++;
}
i = 1;
while (i <= maxCards) {
if (i <= 14) {
this["card" + i]._x = 0 + ((i - 1) * 30);
this["card" + i]._y = 145 - yAdjust;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 15) && (i <= 28)) {
this["card" + i]._x = 0 + ((i - 15) * 30);
this["card" + i]._y = 183.1;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 29) && (i <= 42)) {
this["card" + i]._x = 0 + ((i - 29) * 30);
this["card" + i]._y = 228;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 43) && (i <= 56)) {
this["card" + i]._x = 0 + ((i - 43) * 30);
this["card" + i]._y = 273;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 57) && (i <= 70)) {
this["card" + i]._x = 0 + ((i - 57) * 30);
this["card" + i]._y = 318;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 71) && (i <= 84)) {
this["card" + i]._x = 0 + ((i - 71) * 30);
this["card" + i]._y = 363;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 85) && (i <= 98)) {
this["card" + i]._x = 0 + ((i - 85) * 30);
this["card" + i]._y = 408;
this["card" + i].swapDepths(10000 + i);
}
if ((i >= 99) && (i <= 110)) {
this["card" + i]._x = 24 + ((i - 99) * 30);
this["card" + i]._y = 180;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 111) && (i <= 122)) {
this["card" + i]._x = 24 + ((i - 111) * 30);
this["card" + i]._y = 225;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 123) && (i <= 134)) {
this["card" + i]._x = 24 + ((i - 123) * 30);
this["card" + i]._y = 270;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 135) && (i <= 146)) {
this["card" + i]._x = 24 + ((i - 135) * 30);
this["card" + i]._y = 315;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 147) && (i <= 158)) {
this["card" + i]._x = 24 + ((i - 147) * 30);
this["card" + i]._y = 360;
this["card" + i].swapDepths(11000 + i);
}
if ((i >= 159) && (i <= 168)) {
this["card" + i]._x = 50 + ((i - 159) * 30);
this["card" + i]._y = 218;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 169) && (i <= 178)) {
this["card" + i]._x = 50 + ((i - 169) * 30);
this["card" + i]._y = 263;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 179) && (i <= 188)) {
this["card" + i]._x = 50 + ((i - 179) * 30);
this["card" + i]._y = 308;
this["card" + i].swapDepths(12000 + i);
}
if ((i >= 189) && (i <= 192)) {
this["card" + i]._x = 135 + ((i - 189) * 30);
this["card" + i]._y = 211.6;
this["card" + i].swapDepths(13000 + i);
}
if ((i >= 193) && (i <= 196)) {
this["card" + i]._x = 135 + ((i - 193) * 30);
this["card" + i]._y = 256;
this["card" + i].swapDepths(13000 + i);
}
if ((i >= 197) && (i <= 200)) {
this["card" + i]._x = 135 + ((i - 197) * 30);
this["card" + i]._y = 301.2;
this["card" + i].swapDepths(13000 + i);
}
i++;
}
}
function cornertile() {
i = 1;
while (i <= maxCards) {
if (i <= 13) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 16) && (i <= 27)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 30) && (i <= 41)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 44) && (i <= 55)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 58) && (i <= 69)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 72) && (i <= 83)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 86) && (i <= 97)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 100) && (i <= 109)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 112) && (i <= 121)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 124) && (i <= 133)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 136) && (i <= 145)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 148) && (i <= 157)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 160) && (i <= 167)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 170) && (i <= 177)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 180) && (i <= 187)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 190) && (i <= 191)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 194) && (i <= 195)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
if ((i >= 198) && (i <= 199)) {
if ((typeof(this["card" + (i + 1)]) == "undefined") || (typeof(this["card" + (i - 1)]) == "undefined")) {
_root["cornertile" + i] = 1;
} else {
_root["cornertile" + i] = 0;
}
}
i++;
}
}
removeMovieClip(noHint);
options_bt._visible = true;
stop();
cardCreator();
cornertile();
Instance of Symbol 283 MovieClip "timer" in Frame 100
onClipEvent (load) {
once = 0;
}
onClipEvent (enterFrame) {
if (_root.options != 0) {
this._x = this._x + 0.15;
if ((this._x >= 450) && (once == 0)) {
i = 1;
while (i <= _parent.maxCards) {
removeMovieClip(_parent["card" + i]);
i++;
}
once = 1;
_root.gotoAndStop(101);
}
}
}
Instance of Symbol 209 MovieClip "noHint" in Frame 100
onClipEvent (load) {
this.swapDepths(250000);
}
Frame 101
setDeactive();
levelNumberText = "level " + levelNumber;
Symbol 15 Button
on (release) {
getURL ("http:\\www.yougame.com", "_blank");
}
Symbol 300 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.31");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 301 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 302 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 28 MovieClip Frame 1
stop();
Instance of Symbol 23 MovieClip in Symbol 28 MovieClip Frame 1
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 48 MovieClip Frame 1
Symbol 48 MovieClip Frame 140
stop();
_parent.gotoAndPlay("splash2");
Symbol 60 Button
on (press) {
if (_root.options != 0) {
if (count > 500) {
count = count - 500;
}
timer._x = timer._x + 10;
shuffleCard();
noHint.gotoAndStop(1);
}
}
Symbol 63 Button
on (release) {
if (count > 10) {
count = count - 10;
}
findVisible(maxCards);
}
Symbol 67 MovieClip Frame 1
musicObj = new Sound(this);
musicObj.attachSound("bgmusic");
Symbol 68 MovieClip Frame 1
correctObj = new Sound(this);
correctObj.attachSound("correct");
Symbol 69 MovieClip Frame 1
wrongObj = new Sound(this);
wrongObj.attachSound("wrong");
Symbol 70 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 74 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 89 Button
on (release) {
_root.gotoAndPlay("start");
}
Symbol 94 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 98 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 102 Button
on (release) {
mochi.MochiScores.showLeaderboard({boardID:"3422d9729fd96f18", onClose:function () {
}});
}
Symbol 112 Button
on (release) {
muteSounds(0);
}
Symbol 117 Button
on (release) {
muteSounds(1);
}
Symbol 118 MovieClip Frame 1
stop();
Symbol 125 Button
on (release) {
_root.snd1.musicObj.stop();
_root.gotoAndPlay(2);
}
Symbol 127 Button
on (release) {
_root.gotoAndPlay(26);
}
Symbol 131 MovieClip Frame 25
stop();
Symbol 136 Button
on (release) {
myname = _name;
mynum = Number(myname.substr(4));
if (_parent["cornertile" + mynum] == 1) {
if (_root.options != 0) {
if (_parent.one == null) {
_parent.one = this;
highLight.gotoAndStop(2);
} else if (_parent.one != this) {
trace("two");
highLight.gotoAndPlay(3);
_parent.two = this;
trace("_parent.one = " + _parent.one);
_parent.cardsCompare();
} else {
highLight.gotoAndStop(1);
_parent.one = null;
}
}
}
}
Symbol 139 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 2
stop();
Symbol 149 MovieClip Frame 17
_parent.gotoAndStop(1);
Symbol 150 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 2
stop();
Symbol 203 MovieClip Frame 1
var cornertile = false;
Symbol 204 MovieClip Frame 1
myname = "";
stop();
t1.a1._visible = false;
Symbol 209 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 2
stop();
Symbol 210 Button
on (press) {
_root.gotoAndPlay(38);
}
Symbol 214 MovieClip Frame 19
stop();
Symbol 217 Button
on (release) {
myname = _name;
trace(myname);
mynum = Number(myname.substr(4));
trace(mynum);
trace(_parent["cornertile" + mynum]);
if (_parent["cornertile" + mynum] == 1) {
if (_root.options != 0) {
if (_parent.one == null) {
_parent.one = this;
highLight.gotoAndStop(2);
} else if (_parent.one != this) {
highLight.gotoAndPlay(3);
_parent.two = this;
_parent.cardsCompare();
} else {
highLight.gotoAndStop(1);
_parent.one = null;
}
} else {
trace("red glow");
}
}
}
Symbol 219 MovieClip Frame 1
stop();
Symbol 219 MovieClip Frame 2
stop();
Symbol 220 MovieClip Frame 1
myname = "";
stop();
t1.a1._visible = false;
Symbol 221 Button
on (release) {
_root.gotoAndPlay(50);
}
Symbol 225 MovieClip Frame 25
stop();
Symbol 228 Button
on (release) {
myname = _name;
trace(myname);
mynum = Number(myname.substr(4));
trace(mynum);
trace(_parent["cornertile" + mynum]);
if (_parent["cornertile" + mynum] == 1) {
if (_root.options != 0) {
if (_parent.one == null) {
_parent.one = this;
highLight.gotoAndStop(2);
} else if (_parent.one != this) {
highLight.gotoAndPlay(3);
_parent.two = this;
_parent.cardsCompare();
} else {
highLight.gotoAndStop(1);
_parent.one = null;
}
} else {
trace("red glow");
}
}
}
Symbol 230 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 2
stop();
Symbol 231 MovieClip Frame 1
myname = "";
stop();
t1.a1._visible = false;
Symbol 232 Button
on (release) {
_root.gotoAndPlay(62);
}
Symbol 236 MovieClip Frame 25
stop();
Symbol 239 Button
on (release) {
myname = _name;
trace(myname);
mynum = Number(myname.substr(4));
trace(mynum);
trace(_parent["cornertile" + mynum]);
if (_parent["cornertile" + mynum] == 1) {
if (_root.options != 0) {
if (_parent.one == null) {
_parent.one = this;
highLight.gotoAndStop(2);
} else if (_parent.one != this) {
highLight.gotoAndPlay(3);
_parent.two = this;
_parent.cardsCompare();
} else {
highLight.gotoAndStop(1);
_parent.one = null;
}
} else {
trace("red glow");
}
}
}
Symbol 241 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 2
stop();
Symbol 242 MovieClip Frame 1
myname = "";
stop();
t1.a1._visible = false;
Symbol 243 Button
on (release) {
_root.gotoAndPlay(74);
}
Symbol 247 MovieClip Frame 25
stop();
Symbol 250 Button
on (release) {
myname = _name;
trace(myname);
mynum = Number(myname.substr(4));
trace(mynum);
trace(_parent["cornertile" + mynum]);
if (_parent["cornertile" + mynum] == 1) {
if (_root.options != 0) {
if (_parent.one == null) {
_parent.one = this;
highLight.gotoAndStop(2);
} else if (_parent.one != this) {
highLight.gotoAndPlay(3);
_parent.two = this;
_parent.cardsCompare();
} else {
highLight.gotoAndStop(1);
_parent.one = null;
}
} else {
trace("red glow");
}
}
}
Symbol 252 MovieClip Frame 1
stop();
Symbol 252 MovieClip Frame 2
stop();
Symbol 253 MovieClip Frame 1
myname = "";
stop();
t1.a1._visible = false;
Symbol 254 Button
on (release) {
_root.gotoAndPlay(86);
}
Symbol 258 MovieClip Frame 25
stop();
Symbol 261 Button
on (release) {
myname = _name;
trace(myname);
mynum = Number(myname.substr(4));
trace(mynum);
trace(_parent["cornertile" + mynum]);
if (_parent["cornertile" + mynum] == 1) {
if (_root.options != 0) {
if (_parent.one == null) {
_parent.one = this;
highLight.gotoAndStop(2);
} else if (_parent.one != this) {
highLight.gotoAndPlay(3);
_parent.two = this;
_parent.cardsCompare();
} else {
highLight.gotoAndStop(1);
_parent.one = null;
}
} else {
trace("red glow");
}
}
}
Symbol 263 MovieClip Frame 1
stop();
Symbol 263 MovieClip Frame 2
stop();
Symbol 264 MovieClip Frame 1
myname = "";
stop();
t1.a1._visible = false;
Symbol 265 Button
on (release) {
_root.gotoAndPlay(97);
}
Symbol 269 MovieClip Frame 25
stop();
Symbol 272 Button
on (release) {
myname = _name;
trace(myname);
mynum = Number(myname.substr(4));
trace(mynum);
trace(_parent["cornertile" + mynum]);
if (_parent["cornertile" + mynum] == 1) {
if (_root.options != 0) {
if (_parent.one == null) {
_parent.one = this;
highLight.gotoAndStop(2);
} else if (_parent.one != this) {
highLight.gotoAndPlay(3);
_parent.two = this;
_parent.cardsCompare();
} else {
highLight.gotoAndStop(1);
_parent.one = null;
}
} else {
trace("red glow");
}
}
}
Symbol 274 MovieClip Frame 1
stop();
Symbol 274 MovieClip Frame 2
stop();
Symbol 275 MovieClip Frame 1
myname = "";
stop();
t1.a1._visible = false;
Symbol 276 Button
on (release) {
_root.snd1.musicObj.stop();
_root.gotoAndPlay(2);
}
Symbol 282 MovieClip Frame 25
stop();
Symbol 285 Button
on (release) {
myname = _name;
trace(myname);
mynum = Number(myname.substr(4));
trace(mynum);
trace(_parent["cornertile" + mynum]);
if (_parent["cornertile" + mynum] == 1) {
if (_root.options != 0) {
if (_parent.one == null) {
_parent.one = this;
highLight.gotoAndStop(2);
} else if (_parent.one != this) {
highLight.gotoAndPlay(3);
_parent.two = this;
_parent.cardsCompare();
} else {
highLight.gotoAndStop(1);
_parent.one = null;
}
} else {
trace("red glow");
}
}
}
Symbol 287 MovieClip Frame 1
stop();
Symbol 287 MovieClip Frame 2
stop();
Symbol 288 MovieClip Frame 1
myname = "";
stop();
t1.a1._visible = false;
Symbol 292 Button
on (release) {
_root.snd1.musicObj.stop();
_root.gotoAndPlay(11);
}
Symbol 295 Button
on (release) {
mochi.MochiScores.showLeaderboard({boardID:"3422d9729fd96f18", score:_root.count, onClose:function () {
_root.snd1.musicObj.stop();
_root.gotoAndStop("landing");
}});
}
Symbol 299 MovieClip Frame 25
stop();