Frame 1
_root._quality = "high";
Frame 2
if (this.getBytesLoaded() >= this.getBytesTotal()) {
gotoAndPlay (21);
}
Frame 5
stop();
Frame 12
play();
Frame 17
gotoAndPlay (31);
Frame 23
gotoAndPlay (31);
Frame 37
imageNums = new Array();
allBubbles = new Array();
soundBites = new Sound("sounds");
ulX = 225;
ulY = 100;
lrX = 575;
lrY = 325;
currentlyClickedBubble = null;
currentlyClickedBubbleNum = -1;
lastPairOne = null;
lastPairTwo = null;
currentLevel = 1;
totalLevels = 3;
levelOverAnim = 0;
levelOverWait = 0;
levelOverWaitBetweenBubbles = 1;
gameOn = 0;
totalRandomAudiClips = 6;
randomAudioWaitMin = 225;
randomAudioWaitMax = 300;
randomAudioWait = randomAudioWaitMin + (Math.random() * (randomAudioWaitMax - randomAudioWaitMin));
randomAudioWaitCounter = randomAudioWaitMin / 2;
timeModEasy = 1;
timeModMedium = 0.75;
timeModHard = 0.55;
timeMod = timeModEasy;
allAudio = new Sound(_root);
mailer.loadMovie("mailer-memory.swf");
Instance of Symbol 138 MovieClip "timer" in Frame 37
onClipEvent (load) {
function startTimer(totalSeconds) {
startMilli = getTimer();
totalMilli = totalSeconds * 1000;
timerOn = 1;
this._alpha = 100;
this.gotoAndStop(1);
}
function stopTimer() {
this._alpha = 100;
timerOn = 0;
}
startMilli = 0;
totalMilli = 0;
alphaDim = 65;
}
onClipEvent (enterFrame) {
if (timerOn == 1) {
currentMilli = getTimer();
percentPassed = (currentMilli - startMilli) / totalMilli;
this.gotoAndStop(Math.round(percentPassed * this._totalframes));
if (percentPassed >= 0.75) {
this._alpha = ((this._alpha == 100) ? (alphaDim) : 100);
}
if (percentPassed >= 1) {
timerOn = 0;
_parent.timeUp();
}
}
}
Frame 38
function bubbleClicked(whichBubble, bubbleImageNum) {
if (currentlyClickedBubble == null) {
currentlyClickedBubble = whichBubble;
currentlyClickedBubbleNum = bubbleImageNum;
whichBubble.showImage();
} else {
whichBubble.showImage();
if (bubbleImageNum == currentlyClickedBubbleNum) {
whichBubble.foundMatch();
currentlyClickedBubble.foundMatch();
currentlyClickedBubble = null;
poppedBubbles = poppedBubbles + 2;
if (poppedBubbles >= totalBubbles) {
levelWon();
}
} else {
currentlyClickedBubble.delayBackToBubble();
currentlyClickedBubble = whichBubble;
currentlyClickedBubbleNum = bubbleImageNum;
}
}
}
function generateImageNums(pTotalBubbles) {
var tempNumberUsed = new Array();
var i = 0;
while (i < masterBubble.images._totalframes) {
tempNumberUsed[i] = 0;
i++;
}
var i = 0;
while (i < pTotalBubbles) {
imageNums[i] = -1;
i++;
}
var i = 0;
while (i < (pTotalBubbles / 2)) {
do {
var insertNum = Math.ceil(Math.random() * tempNumberUsed.length);
} while (tempNumberUsed[insertNum - 1] == 1);
tempNumberUsed[insertNum - 1] = 1;
var j = 0;
while (j < 2) {
var insertIndex;
do {
insertIndex = Math.floor(Math.random() * pTotalBubbles);
} while (imageNums[insertIndex] != -1);
imageNums[insertIndex] = insertNum;
j++;
}
i++;
}
delete tempNumberUsed;
}
function startNewLevel(whichLevel) {
switch (whichLevel) {
case 1 :
ulX = 225;
ulY = 100;
lrX = 575;
lrY = 325;
currentCols = 4;
currentRows = 3;
bubbleScale = 100;
timer.startTimer(35 * timeMod);
break;
case 2 :
ulX = 220;
ulY = 95;
lrX = 580;
lrY = 330;
currentCols = 5;
currentRows = 4;
bubbleScale = 75;
timer.startTimer(50 * timeMod);
break;
case 3 :
ulX = 215;
ulY = 90;
lrX = 585;
lrY = 340;
currentCols = 6;
currentRows = 4;
bubbleScale = 75;
timer.startTimer(75 * timeMod);
}
totalBubbles = currentCols * currentRows;
poppedBubbles = 0;
dupeCounter = 0;
colWidth = (lrX - ulX) / (currentCols - 1);
rowHeight = (lrY - ulY) / (currentRows - 1);
generateImageNums(totalBubbles);
currentBubbleNum = 0;
var i = 0;
while (i < currentCols) {
var j = 0;
while (j < currentRows) {
newBubbleName = (("bubblec" add i) add "r") add j;
masterBubble.duplicateMovieClip(newBubbleName, dupeCounter + 100);
this[newBubbleName]._x = ulX + (i * colWidth);
this[newBubbleName]._y = ulY + (j * rowHeight);
this[newBubbleName]._xscale = bubbleScale;
this[newBubbleName]._yscale = bubbleScale;
this[newBubbleName]._visible = 0;
this[newBubbleName].myImageNum = imageNums[currentBubbleNum];
allBubbles[allBubbles.length] = this[newBubbleName];
currentBubbleNum++;
dupeCounter++;
j++;
}
i++;
}
currentlyClickedBubble = null;
currentlyClickedBubbleNum = -1;
lastPairOne = null;
lastPairTwo = null;
_root._quality = "medium";
gameOn = 1;
}
function levelWon() {
trace("good job!");
textScreenToShow = "win" add currentLevel;
currentLevel++;
timer.stopTimer();
if (currentLevel > totalLevels) {
currentLevel = 1;
switch (timeMod) {
case timeModEasy :
timeMod = timeModMedium;
textScreenToShow = "win3em";
break;
case timeModMedium :
timeMod = timeModHard;
textScreenToShow = "win3em";
break;
case timeModHard :
timeMod = timeModEasy;
textScreenToShow = "win3h";
}
}
levelOverWait = 6;
levelOverAnim = 1;
gameOn = 0;
}
function timeUp() {
trace("time's up!");
textScreenToShow = "lose" add currentLevel;
levelOverWait = 0;
levelOverAnim = 1;
gameOn = 0;
}
function cleanUpFinishedLevel() {
textScreens.gotoAndPlay(textScreenToShow);
var i = 0;
while (i < allBubbles.length) {
allBubbles.pop();
i++;
}
_root._quality = "high";
}
function setDifficulty(difficultyLevel) {
switch (difficultyLevel) {
case "easy" :
timeMod = timeModEasy;
return;
case "medium" :
timeMod = timeModMedium;
return;
case "hard" :
timeMod = timeModHard;
}
}
function muteSoundBites() {
soundBites.setVolume(0);
}
function unmuteSoundBites() {
soundBites.setVolume(100);
}
function audioOn() {
allAudio.setVolume(100);
}
function audioOff() {
allAudio.setVolume(0);
}
function textScreenClick() {
startNewLevel(currentLevel);
}
Frame 39
randNum.setHistoryLength(Math.floor(totalRandomAudiClips / 2));
sounds.gotoAndPlay("hi");
textScreens.gotoAndStop("instructions");
Frame 41
if (levelOverAnim == 1) {
if (allBubbles.length > 0) {
if (levelOverWait == 0) {
if (allBubbles.length == 1) {
bubbleToPopRef = allBubbles.pop();
} else {
bubbleToPopNum = Math.floor(Math.random() * allBubbles.length);
bubbleToPopRef = allBubbles[bubbleToPopNum];
allBubbles[bubbleToPopNum] = allBubbles.pop();
}
levelOverWait = Math.floor(Math.random() * 2);
bubbleToPopRef.popBubble();
} else {
levelOverWait--;
}
} else {
levelOverAnim = 0;
cleanUpFinishedLevel();
}
}
if (randomAudioWaitcounter >= randomAudioWait) {
randomAudioWait = randomAudioWaitMin + (Math.random() * (randomAudioWaitMax - randomAudioWaitMin));
randomAudioWaitCounter = 0;
randomSound = "random" add randNum.getRandomNum(1, totalRandomAudiClips);
trace(randomSound);
sounds.gotoAndPlay(randomSound);
} else {
randomAudioWaitCounter++;
}
gotoAndPlay (40);
Symbol 5 MovieClip Frame 1
stop();
Symbol 6 MovieClip Frame 1
doneLoading = 0;
Symbol 6 MovieClip Frame 3
derPercentLoaded = (_parent.getBytesLoaded() / _parent.getBytesTotal()) * 100;
if ((derPercentLoaded >= 100) and (doneLoading == 0)) {
trace("all done");
doneLoading = 1;
_parent.gotoAndPlay("doneLoading");
} else {
loadingProgress.gotoAndStop(Math.round(derPercentLoaded));
}
gotoAndPlay (2);
Symbol 18 Button
on (release) {
getURL ("http://www.findingnemo.com", "_blank");
}
Symbol 19 Button
on (release) {
getURL ("javascript:window.close();", "_self");
}
Symbol 22 Button
on (release) {
_parent.audioOff();
gotoAndStop (5);
}
Symbol 24 Button
on (release) {
_parent.audioOn();
gotoAndStop (1);
}
Symbol 25 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 5
stop();
Symbol 27 MovieClip Frame 1
Symbol 54 MovieClip Frame 1
stop();
Symbol 75 Button
on (release) {
if ((buttonActive == 1) and (_root.gameOn == 1)) {
clickedMe();
}
}
Symbol 78 MovieClip Frame 1
buttonActive = 1;
delayToBubbleCounter = 0;
delayToBubbleWait = 5;
timetoPopBubble = 0;
this._visible = 0;
images._visible = 0;
names._visible = 0;
Instance of Symbol 27 MovieClip "bubble" in Symbol 78 MovieClip Frame 1
onClipEvent (load) {
gotoAndPlay(Math.ceil(Math.random() * this._totalframes));
}
Instance of Symbol 76 MovieClip in Symbol 78 MovieClip Frame 1
onClipEvent (load) {
function getNewXParams() {
xDev = xDevMin + (Math.random() * (xDevMax - xDevMin));
xAngleIncr = xAngleIncrMin + (Math.random() * (xAngleIncrMax - xAngleIncrMin));
}
function getNewYParams() {
yDev = yDevMin + (Math.random() * (yDevMax - yDevMin));
yAngleIncr = yAngleIncrMin + (Math.random() * (yAngleIncrMax - yAngleIncrMin));
}
this._visible = 0;
dragApproach = 0.3;
xAngle = 0;
yAngle = 0;
xDev = 0;
xDevmin = 0.5;
xDevmax = 0.75;
xAngle = 0;
xAngleIncr = 0;
xAngleIncrMin = 5;
xAngleIncrMax = 10;
yDev = 0;
yDevmin = 0.1;
yDevmax = 0.5;
yAngle = 0;
yAngleIncr = 0;
yAngleIncrMin = 15;
yAngleIncrMax = 20;
if (Math.random() < 0.5) {
xAngle = 180;
}
if (Math.random() < 0.5) {
yAngle = 180;
}
getNewXParams();
getNewYParams();
}
onClipEvent (enterFrame) {
if (_parent.images._visible == 0) {
_parent._x = _parent._x + (Math.sin((xAngle / 180) * Math.PI) * xDev);
_parent._y = _parent._y + (Math.sin((yAngle / 180) * Math.PI) * yDev);
xAngle = xAngle + xAngleIncr;
yAngle = yAngle + yAngleIncr;
if (xAngle > 360) {
xAngle = xAngle - 360;
}
if (yAngle > 360) {
yAngle = yAngle - 360;
}
if (((Math.abs(180 - xAngle) <= (xAngleIncr / 2)) or (Math.abs(360 - xAngle) <= (xAngleIncr / 2))) or (xAngle <= (xAngleIncr / 2))) {
getNewXParams();
}
if (((Math.abs(180 - yAngle) <= (yAngleIncr / 2)) or (Math.abs(360 - yAngle) <= (yAngleIncr / 2))) or (yAngle <= (yAngleIncr / 2))) {
getNewYParams();
}
}
}
Symbol 78 MovieClip Frame 2
function clickedMe() {
trace(this._name add " clicked");
buttonActive = 0;
bubble.stop();
delayToBubbleCounter = -1;
_parent.bubbleClicked(this, myImageNum);
}
function delayBackToBubble() {
buttonActive = 1;
bubble.play();
images._alpha = 100;
images._visible = 1;
delayToBubbleCounter = delayToBubbleWait;
}
function showImage() {
images._alpha = 100;
images._visible = 1;
trace(this._name add " show");
}
function popBubble() {
timetoPopBubble = 1;
}
function hideImage() {
images._alpha = 100;
images._visible = 0;
delayToBubbleCounter = 0;
}
function foundMatch() {
names._visible = 1;
}
Symbol 78 MovieClip Frame 3
images.gotoAndStop(myImageNum);
names.gotoAndStop(myImageNum);
this._visible = 1;
Symbol 78 MovieClip Frame 5
if (delayToBubbleCounter > 0) {
trace((this._name add " dtbc=") add delayToBubbleCounter);
delayToBubbleCounter--;
if (delayToBubbleCounter == 1) {
images._alpha = 50;
} else if (delayToBubbleCounter == 0) {
images._visible = 0;
trace("setting 0");
}
}
if (timetoPopBubble == 1) {
gotoAndPlay (10);
} else {
gotoAndPlay (4);
}
Symbol 78 MovieClip Frame 12
this.removeMovieClip();
stop();
Symbol 84 Button
on (release) {
_parent.textScreenClick();
gotoAndStop (1);
}
Symbol 92 Button
on (release) {
getURL ("http://www.findingnemo.com", "_blank");
}
Symbol 96 Button
on (release) {
_root.setDifficulty("easy");
gotoAndStop (1);
}
Symbol 97 Button
on (release) {
_root.setDifficulty("medium");
gotoAndStop (5);
}
Symbol 98 Button
on (release) {
_root.setDifficulty("hard");
gotoAndStop (10);
}
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 5
stop();
Symbol 102 MovieClip Frame 10
stop();
Symbol 104 Button
on (release) {
sendToAFriend.gotoAndPlay("sendOpen");
}
Symbol 117 Button
on (release) {
gotoAndPlay (45);
}
Symbol 118 Button
on (release) {
sendStartTime = getTimer();
getURL ("javascript:trackMemoryGameSend();");
_parent._parent.mailer.sendMail(escape(sourceName), escape(targetName), targetEmail, "");
gotoAndPlay (24);
}
Symbol 126 MovieClip Frame 1
sendErrorText = "";
sourceName = "";
targetName = "";
targetEmail = "";
stop();
Symbol 126 MovieClip Frame 17
stop();
Symbol 126 MovieClip Frame 25
if (_parent._parent.mailer.sendStatus == "sent") {
sendErrorText = "";
gotoAndStop (35);
} else if ((_parent._parent.mailer.sendStatus == "error") || ((getTimer() - sendStartTime) > 10000)) {
sendErrorText = "Error, please try again";
gotoAndStop (17);
} else {
gotoAndPlay (24);
}
Symbol 126 MovieClip Frame 51
gotoAndStop (1);
Symbol 136 MovieClip Frame 1
stop();
Symbol 136 MovieClip Frame 6
stop();
Symbol 136 MovieClip Frame 16
stop();
Symbol 136 MovieClip Frame 26
stop();
Symbol 136 MovieClip Frame 36
stop();
Symbol 136 MovieClip Frame 46
stop();
Symbol 136 MovieClip Frame 56
stop();
Symbol 136 MovieClip Frame 66
_parent.mutesoundBites();
Symbol 136 MovieClip Frame 136
_parent.unmutesoundBites();
Symbol 136 MovieClip Frame 138
stop();
Symbol 136 MovieClip Frame 145
stop();
Symbol 138 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 1
function clearHistory() {
var i = 0;
while (i < randomHistory.length) {
randomHistory.pop();
i++;
}
}
function setHistoryLength(historyLength) {
historyInsert = 0;
clearHistory();
var i = 0;
while (i < historyLength) {
randomHistory[i] = null;
i++;
}
}
function getRandomNum(lowestInt, highestInt) {
var newRandNum = 0;
var randNumGood = 1;
do {
newRandNum = lowestInt + Math.floor(Math.random() * ((highestInt - lowestInt) + 1));
randNumGood = 1;
var i = 0;
while (i < randomHistory.length) {
if (newRandNum == randomHistory[i]) {
randNumGood = 0;
}
i++;
}
} while (randNumGood == 0);
randomHistory[historyInsert] = newRandNum;
historyInsert++;
if (historyInsert >= randomHistory.length) {
historyInsert = 0;
}
return(newRandNum);
}
randomHistory = new Array();
historyInsert = 0;
Symbol 139 MovieClip Frame 3
stop();
Symbol 150 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 7
gotoAndStop (1);
Symbol 150 MovieClip Frame 27
gotoAndStop (1);
Symbol 150 MovieClip Frame 37
gotoAndStop (1);
Symbol 150 MovieClip Frame 47
gotoAndStop (1);
Symbol 150 MovieClip Frame 57
gotoAndStop (1);
Symbol 150 MovieClip Frame 67
gotoAndStop (1);
Symbol 150 MovieClip Frame 77
gotoAndStop (1);
Symbol 150 MovieClip Frame 96
gotoAndStop (1);