Frame 1
stop();
Frame 2
stop();
Symbol 3 MovieClip Frame 1
stop();
Symbol 13 MovieClip Frame 1
time_1 = int(getTimer() / 1000);
Symbol 13 MovieClip Frame 2
bytes_loaded = _root._root.getBytesLoaded();
bytes_total = _root._root.getBytesTotal();
time = (getTimer() / 1000) - teit_1;
bps = bytes_loaded / time;
bytes_left = bytes_total - bytes_loaded;
leftsek = Math.ceil(bytes_left / bps);
min = Math.floor(leftsek / 60);
if (min >= 1) {
leftsek = leftsek - Math.floor(min * 60);
if (leftsek < 10) {
leftsek = "0" add leftsek;
}
} else {
min = "0";
if (leftsek < 10) {
leftsek = "0" add leftsek;
}
}
percent = int((bytes_loaded / bytes_total) * 100) add "%";
leftTime = (min add ":") add leftsek;
bits = bps / 1024;
Kbps = Math.round(bits * 10) / 10;
Symbol 13 MovieClip Frame 3
gotoAndPlay (2);
Symbol 14 MovieClip Frame 1
total = int(_root.getBytesTotal() / 1000);
download = int(_root.getBytesLoaded() / 1000);
if (total == download) {
_parent._root.play();
} else {
play();
}
Instance of Symbol 3 MovieClip "bar" in Symbol 14 MovieClip Frame 1
onClipEvent (load) {
total = int(_root.getBytesTotal() / 1024);
}
onClipEvent (enterFrame) {
total = int(_root.getBytesTotal() / 1024);
loaded = int(_root.getBytesLoaded() / 1024);
left = ((total - loaded) add " Kb") add " left";
perc = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
with ("bar") {
gotoAndPlay(perc);
}
}
Symbol 14 MovieClip Frame 2
gotoAndPlay (1);
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 2
stop();
Symbol 82 MovieClip Frame 3
stop();
Symbol 82 MovieClip Frame 4
stop();
Symbol 82 MovieClip Frame 5
stop();
Symbol 82 MovieClip Frame 6
stop();
Symbol 82 MovieClip Frame 7
stop();
Symbol 82 MovieClip Frame 8
stop();
Symbol 82 MovieClip Frame 9
stop();
Symbol 82 MovieClip Frame 10
stop();
Symbol 82 MovieClip Frame 11
stop();
Symbol 82 MovieClip Frame 12
stop();
Symbol 82 MovieClip Frame 13
stop();
Symbol 82 MovieClip Frame 14
stop();
Symbol 82 MovieClip Frame 15
stop();
Symbol 82 MovieClip Frame 16
stop();
Symbol 82 MovieClip Frame 17
stop();
Symbol 82 MovieClip Frame 18
stop();
Symbol 82 MovieClip Frame 19
stop();
Symbol 82 MovieClip Frame 20
stop();
Symbol 82 MovieClip Frame 21
stop();
Symbol 82 MovieClip Frame 22
stop();
Symbol 82 MovieClip Frame 23
stop();
Symbol 82 MovieClip Frame 24
stop();
Symbol 82 MovieClip Frame 25
stop();
Symbol 82 MovieClip Frame 26
stop();
Symbol 82 MovieClip Frame 27
stop();
Symbol 82 MovieClip Frame 28
stop();
Symbol 82 MovieClip Frame 29
stop();
Symbol 82 MovieClip Frame 30
stop();
Symbol 82 MovieClip Frame 31
stop();
Symbol 129 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 2
stop();
Symbol 129 MovieClip Frame 3
stop();
Symbol 129 MovieClip Frame 4
stop();
Symbol 129 MovieClip Frame 5
stop();
Symbol 129 MovieClip Frame 6
stop();
Symbol 129 MovieClip Frame 7
stop();
Symbol 129 MovieClip Frame 8
stop();
Symbol 129 MovieClip Frame 9
stop();
Symbol 129 MovieClip Frame 10
stop();
Symbol 129 MovieClip Frame 11
stop();
Symbol 129 MovieClip Frame 12
stop();
Symbol 129 MovieClip Frame 13
stop();
Symbol 129 MovieClip Frame 14
stop();
Symbol 129 MovieClip Frame 15
stop();
Symbol 129 MovieClip Frame 16
stop();
Symbol 130 MovieClip Frame 1
_parent._visible = false;
stop();
Symbol 130 MovieClip Frame 2
out = false;
_parent._visible = true;
tellTarget (ThisCard.CardBack) {
gotoAndStop(_parent._parent._parent._parent.CardActions.CardCount);
};
Symbol 130 MovieClip Frame 9
stop();
Symbol 130 MovieClip Frame 10
out = true;
Symbol 130 MovieClip Frame 14
tellTarget ("ThisCard") {
gotoAndStop(_parent._parent._parent.cardArray[_parent._parent.ThisCardNumber - 1] + 1);
};
Symbol 130 MovieClip Frame 16
stop();
Symbol 130 MovieClip Frame 22
tellTarget (ThisCard) {
gotoAndStop ("BackOfCard");
};
tellTarget (ThisCard.CardBack) {
gotoAndStop(_parent._parent._parent.ThisCardNumber + 1);
};
Symbol 130 MovieClip Frame 23
out = false;
stop();
Symbol 130 MovieClip Frame 36
stop();
_parent._visible = false;
Symbol 132 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 == 15) {
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 135 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 2
stop();
Symbol 135 MovieClip Frame 3
stop();
Symbol 136 MovieClip Frame 1
ThisCardNumber = int(this._name.substr(4, 2));
stop();
Symbol 136 MovieClip Frame 30
if (_parent.FirstCard == _parent.SecondCard) {
tellTarget (SoundEffects) {
gotoAndPlay (2);
gotoAndPlay (1);
};
if (_parent.CurrentPairsCount == 14) {
_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 {
_parent.matchedArray[_parent.FirstCard] = true;
var TempPairsCount = 0;
x = 1;
while (x < 16) {
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 136 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 144 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 144 MovieClip Frame 2
stop();
timerON = 1;
check = 1;
pickUp = 0;
Symbol 144 MovieClip Frame 3
stop();
timerON = 0;
check = 1;
pickUp = 1;
Symbol 150 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 10
stop();
Symbol 151 Button
on (rollOver) {
tellTarget ("NewGameText") {
gotoAndPlay (2);
};
}
on (rollOut) {
tellTarget ("NewGameText") {
gotoAndPlay (11);
};
}
on (release) {
tellTarget ("_parent") {
gotoAndStop ("StartGame");
};
}
Symbol 157 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 2
stop();
Symbol 158 MovieClip Frame 1
stop();
Symbol 158 MovieClip Frame 10
stop();
Symbol 158 MovieClip Frame 20
stop();
gotoAndStop (1);
Symbol 159 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 161 MovieClip Frame 1
CardCount = 1;
Symbol 161 MovieClip Frame 2
n = 1;
while (n < 31) {
if (n < 10) {
CardTarget = ("_parent.Card0" add n) add ".CardMotion";
} else {
CardTarget = ("_parent.Card" add n) add ".CardMotion";
}
tellTarget (CardTarget) {
gotoAndStop ("CardInvisible");
};
n++;
}
Symbol 161 MovieClip Frame 3
if (CardCount < 31) {
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 161 MovieClip Frame 5
gotoAndPlay (3);
Symbol 161 MovieClip Frame 6
CardCount = 1;
stop();
tellTarget ("_parent") {
gotoAndStop ("GameLoaded");
};
Symbol 175 Button
on (release) {
getURL ("http://www.1-language.com/materials/memori/elementary/schoola/match1.swf", "_parent");
}
Symbol 177 MovieClip Frame 31
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 10
stop();
Symbol 195 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 227 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 227 MovieClip Frame 2
stop();
Symbol 227 MovieClip Frame 3
stop();
Symbol 227 MovieClip Frame 4
writing = "false";
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages", "GET");
TimeoutCount = 0;
play();
Symbol 227 MovieClip Frame 9
TimeoutCount++;
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages");
answer = "Sending";
Symbol 227 MovieClip Frame 14
if (TimeoutCount < 150) {
if (answer != "Sending") {
gotoAndPlay (15);
} else {
gotoAndPlay (5);
}
} else {
gotoAndStop (113);
}
Symbol 227 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 227 MovieClip Frame 86
gotoAndStop (112);
Symbol 227 MovieClip Frame 87
stop();
Symbol 227 MovieClip Frame 88
stop();
Symbol 227 MovieClip Frame 89
writing = "false";
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages", "GET");
TimeoutCount = 0;
play();
Symbol 227 MovieClip Frame 94
TimeoutCount++;
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages");
answer = "Sending";
Symbol 227 MovieClip Frame 99
if (TimeoutCount < 150) {
if (answer != "Sending") {
gotoAndPlay (100);
} else {
gotoAndPlay (90);
}
} else {
gotoAndStop (113);
}
Symbol 227 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 227 MovieClip Frame 101
FillHighScoreVariables(false);
writing = "true";
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages", "GET");
TimeoutCount = 0;
play();
Symbol 227 MovieClip Frame 106
TimeoutCount++;
loadVariables (_parent.ScoreboardScriptFile, "_parent.UserMessages");
answer = "Sending";
Symbol 227 MovieClip Frame 111
if (TimeoutCount < 150) {
if (answer != "Sending") {
gotoAndPlay (112);
} else {
gotoAndPlay (102);
}
} else {
gotoAndStop (113);
}
Symbol 227 MovieClip Frame 112
FillHighScoreVariables(true);
stop();
Symbol 227 MovieClip Frame 113
stop();
Symbol 228 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, 13, 13, 14, 14, 15, 15];
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";
Instance of Symbol 144 MovieClip "Timer" in Symbol 228 MovieClip Frame 1
onClipEvent (enterFrame) {
StopWatch();
}
Symbol 228 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 < 16) {
matchedArray[n] = false;
n++;
}
PauseButton.PauseText.ButtonText.gotoAndStop(1);
Timer.gotoAndStop("TimerOff");
CardActions.gotoAndPlay("TurnCards");
stop();
Symbol 228 MovieClip Frame 3
PlayingGame = true;
tellTarget ("Timer") {
gotoAndStop ("TimerOn");
};
stop();
Symbol 228 MovieClip Frame 4
PlayingGame = false;
CurrentFlipsCount = 0;
CurrentFlips = "Flips: 0";
CurrentPairsCount = 0;
CurrentPairs = "Pairs Matched: 0";
n = 1;
while (n < 31) {
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);
LevelUpArrow.gotoAndPlay(2);
stop();