Frame 1
stop();
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 2
stop();
Symbol 29 MovieClip Frame 3
stop();
Symbol 29 MovieClip Frame 4
stop();
Symbol 29 MovieClip Frame 5
stop();
Symbol 29 MovieClip Frame 6
stop();
Symbol 29 MovieClip Frame 7
stop();
Symbol 29 MovieClip Frame 8
stop();
Symbol 29 MovieClip Frame 9
stop();
Symbol 29 MovieClip Frame 10
stop();
Symbol 29 MovieClip Frame 11
stop();
Symbol 29 MovieClip Frame 12
stop();
Symbol 29 MovieClip Frame 13
stop();
Symbol 30 MovieClip Frame 1
_parent._visible = false;
stop();
Symbol 30 MovieClip Frame 2
out = false;
_parent._visible = true;
tellTarget ("ThisCard") {
gotoAndStop ("BackOfCard");
};
Symbol 30 MovieClip Frame 9
stop();
Symbol 30 MovieClip Frame 10
out = true;
Symbol 30 MovieClip Frame 13
tellTarget ("ThisCard") {
gotoAndStop(_parent._parent._parent.cardArray[_parent._parent.ThisCardNumber - 1] + 1);
};
Symbol 30 MovieClip Frame 16
stop();
Symbol 30 MovieClip Frame 20
tellTarget ("ThisCard") {
gotoAndStop ("BackOfCard");
};
Symbol 30 MovieClip Frame 23
out = false;
stop();
Symbol 30 MovieClip Frame 36
stop();
_parent._visible = false;
Symbol 32 Button
on (release) {
if (_parent.PlayingGame) {
if (_parent.CurrentFlipsCount < 999) {
if (!CardMotion.out) {
_parent.CurrentFlipsCount++;
_parent.CurrentFlips = "Flips: " add _parent.CurrentFlipsCount;
if (_parent.NoOfCardsOut == 0) {
tellTarget ("CardMotion") {
gotoAndPlay ("SpinFront");
};
_parent.NoOfCardsOut = 1;
_parent.FirstCard = _parent.cardArray[ThisCardNumber - 1];
_parent.FirstCardName = this._name;
} else if (_parent.NoOfCardsOut == 1) {
tellTarget ("CardMotion") {
gotoAndPlay ("SpinFront");
};
_parent.NoOfCardsOut = 2;
_parent.SecondCard = _parent.cardArray[ThisCardNumber - 1];
_parent.SecondCardName = this._name;
if (_parent.CurrentPairsCount == 11) {
gotoAndPlay (30);
} else {
gotoAndPlay (2);
}
} else if (_parent.NoOfCardsOut == 2) {
tellTarget ("_parent." add _parent.SecondCardName) {
gotoAndStop ("DoNothing");
};
_parent.NoOfCardsOut = 3;
gotoAndPlay (30);
}
}
} else {
_parent.GameOverPage = "ExcessFlips";
_parent.gotoAndStop("GameOver");
}
}
}
Symbol 33 MovieClip Frame 1
ThisCardNumber = int(this._name.substr(4, 2));
stop();
Symbol 33 MovieClip Frame 30
if (_parent.FirstCard == _parent.SecondCard) {
if (_parent.CurrentPairsCount == 11) {
_parent.FinalTime = "Your time: " add _parent.Timer.time;
_parent.FinalFlips = "Flip count: " add _parent.CurrentFlipsCount;
_parent.FinalTimeNum = ((int(_parent.Timer.atime[2]) * 60) + int(_parent.Timer.atime[4])) + (int(_parent.Timer.atime[6]) / 10);
_parent.FinalFlipsNum = _parent.CurrentFlipsCount;
if (_parent.UsePersonalBest) {
_parent.UpdateCookies = false;
if ((_parent.FinalTimeNum < _parent.CookieGameTime) | (_parent.CookieGameTime == 0)) {
_parent.PersonalBestTime = _parent.FinalTimeNum;
_parent.UpdateCookies = true;
} else {
_parent.PersonalBestTime = _parent.CookieGameTime;
}
if ((_parent.FinalFlipsNum < _parent.CookieGameFlips) | (_parent.CookieGameFlips == 0)) {
_parent.PersonalBestFlips = _parent.FinalFlipsNum;
_parent.UpdateCookies = true;
} else {
_parent.PersonalBestFlips = _parent.CookieGameFlips;
}
if (_parent.UpdateCookies) {
_parent.PersonalRecords.gotoAndPlay("SetCookies");
}
}
if (_parent.UseScoreboard) {
_parent.GameOverPage = "GameComplete";
_parent.gotoAndPlay("GameOver");
} else {
_parent.GameOverPage = "CompleteNoScoreboard";
_parent.gotoAndPlay("GameOver");
}
} else {
tellTarget (("_parent." add _parent.FirstCardName) add ".CardMotion") {
gotoAndPlay ("CardFadeOut");
};
tellTarget (("_parent." add _parent.SecondCardName) add ".CardMotion") {
gotoAndPlay ("CardFadeOut");
};
_parent.matchedArray[_parent.FirstCard] = true;
var TempPairsCount = 0;
x = 1;
while (x < 13) {
if (_parent.matchedArray[x]) {
TempPairsCount++;
}
x++;
}
_parent.CurrentPairsCount = TempPairsCount;
_parent.CurrentPairs = "Pairs Matched: " add _parent.CurrentPairsCount;
}
} else {
tellTarget (("_parent." add _parent.FirstCardName) add ".CardMotion") {
gotoAndPlay ("SpinBack");
};
tellTarget (("_parent." add _parent.SecondCardName) add ".CardMotion") {
gotoAndPlay ("SpinBack");
};
}
Symbol 33 MovieClip Frame 31
if (_parent.NoOfCardsOut == 3) {
tellTarget ("CardMotion") {
gotoAndPlay ("SpinFront");
};
_parent.NoOfCardsOut = 1;
_parent.FirstCard = _parent.cardArray[ThisCardNumber - 1];
_parent.FirstCardName = this._name;
_parent.SecondCard = 0;
_parent.SecondCardName = "";
} else {
_parent.NoOfCardsOut = 0;
_parent.FirstCard = 0;
_parent.FirstCardName = "";
_parent.SecondCard = 0;
_parent.SecondCardName = "";
}
Symbol 36 MovieClip Frame 1
function StopWatch() {
see = microtime;
if (pickup) {
freeze = microtime;
timeBase = getTimer();
}
if (reset) {
freeze = 0;
time = atime.join("").substr(3, 7);
reset = 0;
}
if (timerOn) {
if (check) {
timeBase = getTimer();
check = 0;
}
timeNow = getTimer();
microtime = (Number(timeNow) - Number(timeBase)) + Number(freeze);
mts = (microtime / 1000).toString().split(".");
atime[6] = mts[1].substr(0, 1);
if (atime[6].toString().length < 1) {
atime[6] = "0";
}
atime[4] = mts[0];
if (atime[4] == "60") {
atime[4] = "00";
atime[2] = Number(atime[2]) + Number(1);
}
if (atime[4].toString().length < 2) {
atime[4] = "0" add atime[4];
}
if (atime[4].toString().length < 1) {
atime[4] = "00";
}
if (atime[2].toString().length < 2) {
atime[2] = "0" add atime[2].toString();
}
if (59 < atime[2]) {
atime[0] = Number(atime[0]) + Number(1);
atime[2] = "00";
}
if (atime[0].toString().length < 2) {
atime[0] = "0" add atime[0];
}
if (atime[0].toString().length < 1) {
atime[0] = "00";
}
if (0 < atime[0]) {
_parent.GameOverPage = "ExcessTime";
_parent.gotoAndStop("GameOver");
}
time = atime.join("").substr(3, 7);
if (60000 < microtime) {
microtime = microtime - 60000;
check = 1;
freeze = 0;
}
seconds = ((Number(atime[0]) * 3600) + (Number(atime[2]) * 60)) + Number(atime[4]);
}
}
stop();
timerON = 0;
check = 1;
reset = 1;
pickUp = 0;
atime = new Array();
atime[0] = "00";
atime[1] = ":";
atime[2] = "00";
atime[3] = ":";
atime[4] = "00";
atime[5] = ".";
atime[6] = "0";
Symbol 36 MovieClip Frame 2
stop();
timerON = 1;
check = 1;
pickUp = 0;
Symbol 36 MovieClip Frame 3
stop();
timerON = 0;
check = 1;
pickUp = 1;
Symbol 42 MovieClip Frame 1
stop();
Symbol 42 MovieClip Frame 10
stop();
Symbol 43 Button
on (rollOver) {
tellTarget ("NewGameText") {
gotoAndPlay (2);
};
}
on (rollOut) {
tellTarget ("NewGameText") {
gotoAndPlay (11);
};
}
on (release) {
tellTarget ("_parent") {
gotoAndStop ("StartGame");
};
}
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 2
stop();
Symbol 50 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 10
stop();
Symbol 50 MovieClip Frame 20
stop();
gotoAndStop (1);
Symbol 51 Button
on (rollOver) {
PauseText.gotoAndPlay(2);
}
on (rollOut) {
PauseText.gotoAndPlay(11);
}
on (release) {
if (_parent.PlayingGame) {
_parent.PlayingGame = false;
_parent.Timer.gotoAndStop("TimerPause");
PauseText.ButtonText.gotoAndStop(2);
} else if (_parent._currentframe == 3) {
_parent.PlayingGame = true;
_parent.Timer.gotoAndStop("TimerOn");
PauseText.ButtonText.gotoAndStop(1);
}
}
Symbol 56 MovieClip Frame 1
function getCookie(name) {
var cname = (name + "=");
var clen = _root.CookieString.length;
var cbegin = 0;
do {
if (cbegin >= clen) {
break;
}
var vbegin = (cbegin + cname.length);
if (_root.CookieString.substring(cbegin, vbegin) == cname) {
var vend = _root.CookieString.indexOf(";", vbegin);
if (vend == -1) {
vend = clen;
}
return(unescape(_root.CookieString.substring(vbegin, vend)));
}
cbegin = _root.CookieString.indexOf(" ", cbegin) + 1;
} while (cbegin != 0);
return(null);
}
if (_parent.UsePersonalBest) {
CookieReadTimeout = 0;
_root.CookieString = null;
getURL (("javascript:document." add _parent.MovieTitle) add ".SetVariable('_root.CookieString',(document.cookie) ? document.cookie : '');");
} else {
this._visible = false;
}
Symbol 56 MovieClip Frame 5
if (CookieReadTimeout < 300) {
if (_root.CookieString == null) {
CookieReadTimeout++;
gotoAndPlay (2);
} else {
gotoAndPlay (7);
}
} else {
gotoAndPlay (6);
}
Symbol 56 MovieClip Frame 6
_parent.CookieGameTime = 0;
_parent.CookieGameFlips = 0;
_parent.RecordTime = "Fastest Time: Unknown";
_parent.RecordFlips = "Lowest Flips: Unknown";
stop();
Symbol 56 MovieClip Frame 7
_parent.CookieGameTime = getCookie(_parent.TimeCookieName);
_parent.CookieGameFlips = getCookie(_parent.FlipsCookieName);
if (_parent.CheckNull(_parent.CookieGameTime)) {
_parent.CookieGameTime = 0;
_parent.RecordTime = "Fastest Time: Unknown";
} else {
_parent.RecordTime = "Fastest Time: " add _parent.ConvertTimeToText(_parent.CookieGameTime);
}
if (_parent.CheckNull(_parent.CookieGameFlips)) {
_parent.CookieGameFlips = 0;
_parent.RecordFlips = "Lowest Flips: Unknown";
} else {
_parent.RecordFlips = "Lowest Flips: " add _parent.CookieGameFlips;
}
stop();
Symbol 56 MovieClip Frame 8
getURL (((((((("javascript:expires = new Date(); expires.setTime(expires.getTime() + (24 * 60 * 60 * 1000 * 365)); document.cookie = '" add _parent.TimeCookieName) add "=") add escape(_parent.PersonalBestTime)) add "; expires=' + expires.toGMTString(); document.cookie = '") add _parent.FlipsCookieName) add "=") add escape(_parent.PersonalBestFlips)) add "; expires=' + expires.toGMTString(); void(0);");
Symbol 57 MovieClip Frame 1
CardCount = 1;
Symbol 57 MovieClip Frame 2
n = 1;
while (n < 25) {
if (n < 10) {
CardTarget = ("_parent.Card0" add n) add ".CardMotion";
} else {
CardTarget = ("_parent.Card" add n) add ".CardMotion";
}
tellTarget (CardTarget) {
gotoAndStop ("CardInvisible");
};
n++;
}
Symbol 57 MovieClip Frame 3
if (CardCount < 25) {
if (CardCount < 10) {
CardTarget = ("_parent.Card0" add CardCount) add ".CardMotion";
} else {
CardTarget = ("_parent.Card" add CardCount) add ".CardMotion";
}
tellTarget (CardTarget) {
gotoAndPlay ("CardFadeIn");
};
CardCount++;
} else {
gotoAndPlay (6);
}
Symbol 57 MovieClip Frame 5
gotoAndPlay (3);
Symbol 57 MovieClip Frame 6
CardCount = 1;
stop();
tellTarget ("_parent") {
gotoAndStop ("GameLoaded");
};
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 10
stop();
Symbol 85 Button
on (rollOver) {
HighScoreText.gotoAndPlay(2);
}
on (rollOut) {
HighScoreText.gotoAndPlay(11);
}
on (release) {
if (_parent._parent.CheckNull(_parent.UserRealName)) {
_parent.gotoAndStop("MissingFields");
} else {
_parent.gotoAndPlay("SubmitScores");
}
}
Symbol 118 MovieClip Frame 1
function FillHighScoreVariables(ConvertTimes) {
BestTimeNames0 = BestTimeNames[0];
BestTimeNames1 = BestTimeNames[1];
BestTimeNames2 = BestTimeNames[2];
BestTimeNames3 = BestTimeNames[3];
BestTimeNames4 = BestTimeNames[4];
if (ConvertTimes) {
BestTimes0 = _parent.ConvertTimeToText(BestTimes[0]);
BestTimes1 = _parent.ConvertTimeToText(BestTimes[1]);
BestTimes2 = _parent.ConvertTimeToText(BestTimes[2]);
BestTimes3 = _parent.ConvertTimeToText(BestTimes[3]);
BestTimes4 = _parent.ConvertTimeToText(BestTimes[4]);
} else {
BestTimes0 = BestTimes[0];
BestTimes1 = BestTimes[1];
BestTimes2 = BestTimes[2];
BestTimes3 = BestTimes[3];
BestTimes4 = BestTimes[4];
}
BestFlipNames0 = BestFlipNames[0];
BestFlipNames1 = BestFlipNames[1];
BestFlipNames2 = BestFlipNames[2];
BestFlipNames3 = BestFlipNames[3];
BestFlipNames4 = BestFlipNames[4];
BestFlips0 = BestFlips[0];
BestFlips1 = BestFlips[1];
BestFlips2 = BestFlips[2];
BestFlips3 = BestFlips[3];
BestFlips4 = BestFlips[4];
}
stop();
Symbol 118 MovieClip Frame 2
stop();
Symbol 118 MovieClip Frame 3
stop();
Symbol 118 MovieClip Frame 4
writing = "false";
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages", "GET");
TimeoutCount = 0;
play();
Symbol 118 MovieClip Frame 9
TimeoutCount++;
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages");
answer = "Sending";
Symbol 118 MovieClip Frame 14
if (TimeoutCount < 150) {
if (answer != "Sending") {
gotoAndPlay (15);
} else {
gotoAndPlay (5);
}
} else {
gotoAndStop (113);
}
Symbol 118 MovieClip Frame 15
BestTimeNames = timenames.split("¬");
BestTimes = recordtimes.split("¬");
BestFlipNames = flipnames.split("¬");
BestFlips = recordflips.split("¬");
HighScore = false;
t = 0;
while (t < 5) {
if (BestTimes[t] >= _parent.FinalTimeNum) {
HighScore = true;
}
t++;
}
t = 0;
while (t < 5) {
if (BestFlips[t] >= _parent.FinalFlipsNum) {
HighScore = true;
}
t++;
}
if (HighScore) {
gotoAndPlay (87);
} else {
gotoAndPlay (16);
}
Symbol 118 MovieClip Frame 86
gotoAndStop (112);
Symbol 118 MovieClip Frame 87
stop();
Symbol 118 MovieClip Frame 88
stop();
Symbol 118 MovieClip Frame 89
writing = "false";
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages", "GET");
TimeoutCount = 0;
play();
Symbol 118 MovieClip Frame 94
TimeoutCount++;
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages");
answer = "Sending";
Symbol 118 MovieClip Frame 99
if (TimeoutCount < 150) {
if (answer != "Sending") {
gotoAndPlay (100);
} else {
gotoAndPlay (90);
}
} else {
gotoAndStop (113);
}
Symbol 118 MovieClip Frame 100
BestTimeNames = timenames.split("¬");
BestTimes = recordtimes.split("¬");
BestFlipNames = flipnames.split("¬");
BestFlips = recordflips.split("¬");
HighScoreTime = 5;
HighScoreFlips = 5;
t = 0;
while (t < 5) {
if (BestTimes[t] >= _parent.FinalTimeNum) {
if (HighScoreTime == 5) {
HighScoreTime = t;
}
}
t++;
}
if (HighScoreTime < 5) {
BestTimes.splice(HighScoreTime, 0, _parent.FinalTimeNum);
BestTimeNames.splice(HighScoreTime, 0, UserRealName);
}
t = 0;
while (t < 5) {
if (BestFlips[t] >= _parent.FinalFlipsNum) {
if (HighScoreFlips == 5) {
HighScoreFlips = t;
}
}
t++;
}
if (HighScoreFlips < 5) {
BestFlips.splice(HighScoreFlips, 0, _parent.FinalFlipsNum);
BestFlipNames.splice(HighScoreFlips, 0, UserRealName);
}
TestMessages = HighScoreTime;
if ((HighScoreTime < 5) | (HighScoreFlips < 5)) {
gotoAndPlay (101);
} else {
gotoAndPlay (112);
}
Symbol 118 MovieClip Frame 101
FillHighScoreVariables(false);
writing = "true";
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages", "GET");
TimeoutCount = 0;
play();
Symbol 118 MovieClip Frame 106
TimeoutCount++;
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages");
answer = "Sending";
Symbol 118 MovieClip Frame 111
if (TimeoutCount < 150) {
if (answer != "Sending") {
gotoAndPlay (112);
} else {
gotoAndPlay (102);
}
} else {
gotoAndStop (113);
}
Symbol 118 MovieClip Frame 112
FillHighScoreVariables(true);
stop();
Symbol 118 MovieClip Frame 113
stop();
Symbol 119 MovieClip Frame 1
function ShuffleCards() {
cardArray = new Array();
var startArray = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12];
var placeArray = new Array();
a = 0;
while (a < startArray.length) {
placeArray.push(a);
a++;
}
a = 0;
while (a < startArray.length) {
do {
trg = random(placeArray.length);
newplace = placeArray[trg];
} while ((startArray[a] == startArray[newplace]) && (a != (startArray.length - 1)));
placeArray.splice(trg, 1);
if (startArray[a] != startArray[newplace]) {
cardArray.push(startArray[newplace]);
} else {
cardArray.unshift(startArray[newplace]);
}
a++;
}
}
function ConvertTimeToText(ConvertNumber) {
if (ConvertNumber) {
var tempMinutes = String(int(Math.floor(Number(ConvertNumber / 60))));
var tempSeconds = String(int(Math.floor(Number(ConvertNumber))) - (int(Math.floor(Number(ConvertNumber / 60))) * 60));
var tempTenths = ConvertNumber.toString().split(".");
if (tempMinutes.length < 2) {
tempMinutes = "0" add tempMinutes;
}
if (tempSeconds.length < 2) {
tempSeconds = "0" add tempSeconds;
}
if (!tempTenths[1]) {
tempTenths[1] = 0;
} else {
tempTenths[1] = tempTenths[1].charAt(0);
}
return((((tempMinutes add ":") add tempSeconds) add ".") add tempTenths[1]);
}
return("00:00.0");
}
function CheckNull(checkstring) {
if (checkstring.length < 1) {
return(true);
}
if (checkstring == "") {
return(true);
}
if (checkstring == null) {
return(true);
}
return(false);
}
UseScoreboard = false;
UsePersonalBest = false;
MovieTitle = "CardGame";
ScoreboardScriptFile = "highscores.php";
ScoreboardScoresFile = "highscores.txt";
TimeCookieName = "RecordGameTime";
FlipsCookieName = "RecordFlipsTime";
stop();
Instance of Symbol 36 MovieClip "Timer" in Symbol 119 MovieClip Frame 1
onClipEvent (enterFrame) {
StopWatch();
}
Symbol 119 MovieClip Frame 2
FirstCard = 0;
SecondCard = 0;
FirstCardName = "";
SecondCardName = "";
NoOfCardsOut = 0;
ShuffleCards();
CurrentFlipsCount = 0;
CurrentFlips = "Flips: 0";
CurrentPairsCount = 0;
CurrentPairs = "Pairs Matched: 0";
matchedArray = new Array();
n = 1;
while (n < 13) {
matchedArray[n] = false;
n++;
}
PauseButton.PauseText.ButtonText.gotoAndStop(1);
Timer.gotoAndStop("TimerOff");
CardActions.gotoAndPlay("TurnCards");
stop();
Symbol 119 MovieClip Frame 3
PlayingGame = true;
tellTarget ("Timer") {
gotoAndStop ("TimerOn");
};
stop();
Symbol 119 MovieClip Frame 4
PlayingGame = false;
CurrentFlipsCount = 0;
CurrentFlips = "Flips: 0";
CurrentPairsCount = 0;
CurrentPairs = "Pairs Matched: 0";
n = 1;
while (n < 25) {
if (n < 10) {
CardTarget = ("Card0" add n) add ".CardMotion";
} else {
CardTarget = ("Card" add n) add ".CardMotion";
}
tellTarget (CardTarget) {
gotoAndStop ("CardInvisible");
};
n++;
}
Timer.gotoAndStop("TimerOff");
PauseButton.PauseText.ButtonText.gotoAndStop(1);
PauseButton.PauseText.gotoAndStop(1);
UserMessages.gotoAndPlay(GameOverPage);
stop();
Symbol 122 Button
on (release) {
getURL ("http://www.urgames.com", "_blank");
}
Symbol 127 Button
on (release) {
getURL ("http://www.gamesforyourwebsite.com/", "_blank");
}