Frame 1
fscommand ("allowScale", false);
stop();
System.security.allowDomain("69.16.232.36", "http://69.16.232.36/", "http://69.16.232.36/tracker/trackme.swf", "*");
System.security.allowDomain("mediatonic1.com", "http://mediatonic1.com", "http://mediatonic1.com/tracker/trackme.swf", "*");
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
_root.__tt_ident = "{6E285DDE-91B7-456A-AAF2-2014B51FF8CB}";
this.createEmptyMovieClip("tonictrack", 999999);
__trackref = this.tonictrack;
__trackref.loadMovie("http://mediatonic1.com/tracker/trackme.swf");
Frame 2
function moveParts() {
this.onEnterFrame = function () {
moveParticles();
if (spawnstars) {
spawnStar(_xmouse, _ymouse);
}
};
}
function killStars() {
for (myp in particlesOnStage) {
pRef = particlesOnStage[myp];
pRef.removeMovieClip();
}
particlesOnStage = [];
}
function spawnStar(sx, sy) {
sName = "star" + depth;
attachMovie("star", sName, depth);
depth++;
sRef = this[sName];
sRef._x = sx;
sRef._y = sy;
sRef.gotoAndStop(random(3) + 1);
sRef.xmov = random(2) + 3;
sRef.ymov = (random(4) + 2) * -1;
sRef.rot = random(10) + 5;
if (random(2) == 1) {
sRef.myDir = 1;
} else {
sRef.myDir = -1;
}
particlesOnStage.push(sRef);
}
function moveParticles() {
for (myp in particlesOnStage) {
pRef = particlesOnStage[myp];
pRef._x = pRef._x + (pRef.xmov * pRef.myDir);
pRef._y = pRef._y + pRef.ymov;
pRef.ymov = pRef.ymov + 0.25;
pRef.xmov = pRef.xmov - 0.1;
if (pRef.xmov < 0) {
pRef.removeMovieClip();
particlesOnStage.splice(myp, 1);
}
}
}
particlesOnStage = [];
depth = 100;
spawnstars = false;
moveParts();
function playSound(sname) {
mysounds[sname].playme();
}
function stopSound(sname) {
mysounds[sname].stopme();
}
function muteSounds() {
mute = true;
mysounds.gotoAndStop(2);
stopAllSounds();
}
function unMuteSounds() {
mute = false;
mysounds.gotoAndStop(1);
}
mute = false;
Symbol 28 MovieClip [star] Frame 1
stop();
Symbol 35 MovieClip Frame 1
stop();
Symbol 40 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 1
stop();
Symbol 55 MovieClip Frame 1
stop();
Symbol 58 Button
on (rollOver, dragOver) {
_parent._parent.highLightBalloon(this);
}
on (rollOut, dragOut) {
_parent._parent.stopHighlight(this);
}
Symbol 59 MovieClip [balloon] Frame 1
hitsq._visible = false;
ballbut.useHandCursor = false;
Symbol 59 MovieClip [balloon] Frame 18
gotoAndPlay ("rotate");
Symbol 115 MovieClip [prize] Frame 1
stop();
Symbol 115 MovieClip [prize] Frame 33
gotoAndPlay ("float");
Symbol 120 MovieClip [bfloat] Frame 201
this.removeMovieClip();
Symbol 124 MovieClip [star1] Frame 1
stop();
Symbol 125 MovieClip [star7] Frame 1
stop();
Symbol 126 MovieClip [star6] Frame 1
stop();
Symbol 127 MovieClip [star5] Frame 1
stop();
Symbol 128 MovieClip [star4] Frame 1
stop();
Symbol 129 MovieClip [star3] Frame 1
stop();
Symbol 130 MovieClip [star2] Frame 1
stop();
Symbol 159 MovieClip Frame 1
this.onEnterFrame = function () {
var _local1 = _root;
bl = _local1.getBytesLoaded();
bt = _local1.getBytesTotal();
if (bl == bt) {
_local1.gotoAndStop(2);
delete this.onEnterFrame;
}
perloaded = (bl / bt) * 100;
gotoAndStop(int(perloaded));
};
Symbol 160 MovieClip Frame 20
stop();
Symbol 161 MovieClip Frame 160
stop();
Symbol 170 Button
on (release) {
valido = true;
if (validateEmail(youremail) == false) {
entmail1.play();
valido = false;
}
if ((validateEmail(f1name) == false) && (f1name != "")) {
entmail2.play();
valido = false;
}
if ((validateEmail(f2name) == false) && (f2name != "")) {
entmail3.play();
valido = false;
}
if (((yourname != "") && (youremail != "")) && (valido == true)) {
this.yourname = yourname;
this.youremail = youremail;
friendsnames = [];
friendsemails = [];
numfriends = 3;
f = 1;
while (f < (numfriends + 1)) {
if (this[("f" + f) + "name"] != "") {
friendsemails.push(this[("f" + f) + "name"]);
friendsnames.push("");
}
f++;
}
subject = "Check out Poppit! Stress Buster!";
mymessage = "Hi!<br><br>I've been popping balloons like crazy to help me de-stress! Check out the Poppit! Stress Buster!, a super fun popping game, at Pogo.com. <br><br><a href='http://www.pogo.com/poppit-stress-buster?sourceid=stressbuster_poppit_ftaf'>http://www.pogo.com/poppit-stress-buster?sourceid=stressbuster_poppit_ftaf</a><br><br>It's popilicious!<br><br><br>*Pogo.com offers 80+ FREE online games, including the original Poppit! game!<br><br><br><br>Your email address was used only to forward this game and was not retained by EA for any other use<br><br>PRIVACY POLICY: Our ESRB Privacy Online Certified Policy gives you confidence whenever you play EA games. To view our complete Privacy Policy, go to www.ea.com/global/legal/privacy.jsp or write to: Privacy Policy Administrator, Electronic Arts Inc., 209 Redwood Shores Parkway, Redwood City, CA 94065";
_root.__trackref.emailFriends(yourname, youremail, friendsnames, friendsemails, subject, mymessage);
_root.__trackref.hitPage("{879FF41A-544A-4B21-995A-59E455C09452}");
_parent.play();
}
}
Symbol 175 Button
on (release) {
_parent.play();
}
Symbol 187 MovieClip Frame 1
stop();
Symbol 188 MovieClip Frame 1
function validateEmail(email) {
indexOfAt = email.indexOf("@");
lastIndexOfDot = email.lastIndexOf(".");
if ((indexOfAt != -1) && (lastIndexOfDot != -1)) {
if (lastIndexOfDot > indexOfAt) {
return(true);
}
return(false);
}
return(false);
}
yourname = "";
youremail = "";
f1name = "";
f2name = "";
in1.tabIndex = 1;
in2.tabIndex = 2;
in3.tabIndex = 3;
in4.tabIndex = 4;
Symbol 189 MovieClip Frame 1
stop();
Symbol 189 MovieClip Frame 2
mbut2.useHandCursor = false;
mbut.useHandCursor = false;
Symbol 189 MovieClip Frame 15
stop();
Symbol 189 MovieClip Frame 16
mbut2.useHandCursor = false;
Symbol 205 MovieClip Frame 1
stop();
Symbol 210 Button
on (release) {
play();
}
Symbol 211 MovieClip Frame 1
stop();
Symbol 211 MovieClip Frame 5
_parent.quitb.gotoAndStop(1);
Symbol 211 MovieClip Frame 38
_root.playSound("welldone");
Symbol 211 MovieClip Frame 53
stop();
rrtimer = 0;
this.onEnterFrame = function () {
rrtimer++;
if (rrtimer > 200) {
this.play();
delete this.onEnterFrame;
}
};
Symbol 211 MovieClip Frame 54
this.onEnterFrame = function () {
};
delete this.onEnterFrame;
Symbol 211 MovieClip Frame 101
_parent._parent.gamey.displayStats();
Symbol 222 Button
on (release) {
if (_parent.gamePhase == "pick") {
_parent.undoMove();
_root.playSound("dlog");
}
}
Symbol 223 MovieClip Frame 1
stop();
Symbol 230 Button
on (release) {
if (_parent.gamePhase == "pick") {
_parent.popBoard("quit");
_parent.leveleOut();
_root.playSound("dlog");
gotoAndStop (1);
}
}
Symbol 231 MovieClip Frame 1
stop();
_parent.resetb.gotoAndStop(1);
Symbol 231 MovieClip Frame 2
_parent.resetb.gotoAndStop(2);
Symbol 237 MovieClip Frame 18
gotoAndPlay (1);
Symbol 254 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 2
l22.play();
l23.play();
Symbol 255 MovieClip Frame 4
l20.play();
l21.play();
Symbol 255 MovieClip Frame 6
l18.play();
l19.play();
Symbol 255 MovieClip Frame 8
l16.play();
l17.play();
Symbol 255 MovieClip Frame 10
l14.play();
l15.play();
Symbol 255 MovieClip Frame 12
l12.play();
l13.play();
Symbol 255 MovieClip Frame 14
l10.play();
l11.play();
Symbol 255 MovieClip Frame 16
l8.play();
l9.play();
Symbol 255 MovieClip Frame 18
l6.play();
l7.play();
Symbol 255 MovieClip Frame 20
l4.play();
l5.play();
Symbol 255 MovieClip Frame 22
l2.play();
l3.play();
Symbol 255 MovieClip Frame 24
l1.play();
Symbol 259 MovieClip Frame 1
stop();
Symbol 272 MovieClip Frame 1
gotoAndPlay(random(_totalframes) + 1);
Symbol 272 MovieClip Frame 23
gotoAndPlay (2);
Symbol 275 MovieClip Frame 1
gotoAndPlay(random(_totalframes) + 1);
Symbol 275 MovieClip Frame 27
gotoAndPlay (2);
Symbol 278 MovieClip Frame 1
gotoAndPlay(random(_totalframes) + 1);
Symbol 278 MovieClip Frame 21
gotoAndPlay (2);
Symbol 303 MovieClip Frame 1
if (fplay == undefined) {
fplay = true;
gotoAndPlay(random(_totalframes) + 1);
}
Symbol 307 MovieClip Frame 1
gotoAndPlay(random(_totalframes) + 1);
Symbol 310 MovieClip Frame 1
gotoAndPlay(random(_totalframes) + 1);
Symbol 313 MovieClip Frame 1
gotoAndPlay(random(_totalframes) + 1);
Symbol 316 MovieClip Frame 1
gotoAndPlay(random(_totalframes) + 1);
Symbol 333 MovieClip Frame 2
_parent.play();
Symbol 333 MovieClip Frame 31
_parent.play();
Symbol 333 MovieClip Frame 37
gotoAndStop (1);
Symbol 333 MovieClip Frame 39
_parent.play();
Symbol 333 MovieClip Frame 68
_parent.play();
Symbol 333 MovieClip Frame 73
gotoAndStop (1);
Symbol 334 MovieClip Frame 1
this.onEnterFrame = function () {
if ((spikejumpy._currentframe == 1) && (_currentframe != 1)) {
nextFrame();
}
};
stop();
Symbol 334 MovieClip Frame 5
stop();
Symbol 334 MovieClip Frame 9
gotoAndStop (1);
Symbol 335 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 15
stop();
Symbol 344 Button
on (release) {
_parent._parent.popBoard("restart");
_parent._parent.leveleOut();
_root.playSound("dlog");
}
Symbol 349 Button
on (release) {
_parent._parent._parent.popBoard("restart");
_parent._parent._parent.leveleOut();
_root.playSound("dlog");
}
Symbol 354 Button
on (release) {
if (_parent._parent._parent.gamePhase == "pick") {
_parent._parent._parent.undoMove();
}
_root.playSound("dlog");
}
Symbol 355 MovieClip Frame 1
stop();
Symbol 355 MovieClip Frame 5
stop();
Symbol 363 Button
on (release) {
_parent._parent._parent.leveleOut();
_root.playSound("dlog");
}
Symbol 364 MovieClip Frame 1
stop();
Symbol 364 MovieClip Frame 5
stop();
Symbol 369 MovieClip Frame 20
stop();
Symbol 370 MovieClip Frame 158
_parent._parent._parent.popBoard("carryon");
_parent._parent._parent.leveleOut();
_root.playSound("dlog");
Symbol 372 Button
on (release) {
_parent._parent._parent.popBoard("carryon");
_parent._parent._parent.leveleOut();
_root.playSound("dlog");
}
Symbol 373 MovieClip Frame 1
stop();
Symbol 373 MovieClip Frame 5
stop();
Symbol 375 MovieClip Frame 1
stop();
Symbol 375 MovieClip Frame 2
amin = true;
lend.butfade.gotoAndStop(1);
mbut2.useHandCursor = false;
Symbol 375 MovieClip Frame 16
stop();
Symbol 375 MovieClip Frame 17
amin = false;
lend.butfade.play();
mbut2.useHandCursor = false;
Symbol 381 Button
on (release) {
getURL ("http://www.pogo.com/home/home.do?sourceid=viralgame_poppit_gotopogo", "_blank");
_root.__trackref.hitPage("{74230C16-DF01-4655-8DF3-026554374099}");
}
Symbol 386 MovieClip Frame 1
gotoAndStop(random(3) + 1);
Symbol 396 Button
on (release) {
_parent.gotoAndPlay("lout");
_root.playSound("dlog");
}
Symbol 404 Button
on (rollOver) {
_root.spawnstars = true;
}
on (rollOut, dragOut) {
_root.spawnstars = false;
}
on (release) {
getURL ("http://www.pogo.com", "_blank");
_root.__trackref.hitPage("{74230C16-DF01-4655-8DF3-026554374099}");
}
Symbol 407 MovieClip Frame 1
screenies.gotoAndStop(random(screenies._totalframes) + 1);
gotoAndStop(_parent._parent.levelon - 1);
Symbol 408 MovieClip Frame 1
stop();
Symbol 408 MovieClip Frame 2
_root.playSound("dappear");
mbut2.useHandCursor = false;
mbut.useHandCursor = false;
Symbol 408 MovieClip Frame 16
stop();
Symbol 408 MovieClip Frame 17
mbut2.useHandCursor = false;
Symbol 408 MovieClip Frame 30
if (_parent.flagMyStart == true) {
_parent.displayStart();
_parent.flagMyStart = false;
} else {
_parent.buildLevel(_parent.levelon);
}
Symbol 416 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 2
mbut.useHandCursor = false;
Symbol 416 MovieClip Frame 3
_parent.quitb.gotoAndStop(1);
Symbol 416 MovieClip Frame 111
_parent.spawnPrizes();
Symbol 416 MovieClip Frame 126
_parent.resumeGame("pick");
_parent.quitb.gotoAndStop(2);
Symbol 424 Button
on (release) {
if (_root.nodialog == true) {
_parent.gotoAndPlay("lout");
} else {
play();
}
_root.playSound("bp1");
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
embut._visible = false;
}
Symbol 433 MovieClip Frame 1
stop();
Symbol 434 Button
on (release) {
if (checkbox._currentframe == 2) {
_root.nodialog = true;
}
_parent.gotoAndPlay("lout");
_root.playSound("bp1");
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
_root.spawnStar(_root._xmouse, _root._ymouse);
embut._visible = false;
}
Symbol 435 Button
on (release) {
if (checkbox._currentframe == 1) {
checkbox.nextFrame();
} else {
checkbox.prevFrame();
}
_root.playSound("dlog");
}
Symbol 436 MovieClip Frame 1
_root.__trackref.hitPage("{8F4F77BC-080B-400E-B736-D73C8BFBF30F}");
stop();
Symbol 436 MovieClip Frame 9
stop();
_root.__trackref.hitPage("{E36A7FE4-87AB-477F-8F6C-E96BE16DEE40}");
Symbol 437 MovieClip Frame 1
stop();
Symbol 437 MovieClip Frame 2
_root.playSound("dappear");
mbut2.useHandCursor = false;
mbut.useHandCursor = false;
Symbol 437 MovieClip Frame 15
stop();
Symbol 437 MovieClip Frame 16
mbut2.useHandCursor = false;
Symbol 437 MovieClip Frame 40
_parent.startGame();
Symbol 440 Button
on (rollOver) {
_root.spawnstars = true;
}
on (rollOut, dragOut) {
_root.spawnstars = false;
}
on (release) {
getURL ("http://www.pogo.com/home/home.do?sourceid=viralgame_poppit_gotopogo", "_blank");
_root.__trackref.hitPage("{12291D46-F619-4B0A-91AD-4E7582F17457}");
}
Symbol 445 Button
on (release) {
_parent.gotoAndPlay("lout");
_root.playSound("dlog");
}
Symbol 454 MovieClip Frame 1
stop();
Symbol 454 MovieClip Frame 2
_root.playSound("dappear");
mbut2.useHandCursor = false;
mbut.useHandCursor = false;
Symbol 454 MovieClip Frame 15
stop();
Symbol 454 MovieClip Frame 16
mbut2.useHandCursor = false;
Symbol 454 MovieClip Frame 30
_parent.displayStart();
Symbol 457 Button
on (release) {
_parent.butchoosen = "yes";
_parent.gotoAndPlay("lout");
_root.playSound("dlog");
}
Symbol 459 MovieClip Frame 1
stop();
Symbol 459 MovieClip Frame 2
mbut2.useHandCursor = false;
mbut.useHandCursor = false;
Symbol 459 MovieClip Frame 15
stop();
Symbol 459 MovieClip Frame 16
mbut2.useHandCursor = false;
Symbol 459 MovieClip Frame 30
if (butchoosen == "no") {
_parent.popBoard("quit");
_parent.leveleOut();
}
mytimer = 0;
Symbol 462 MovieClip Frame 1
function killStars() {
for (myp in particlesOnStage) {
pRef = particlesOnStage[myp];
pRef.removeMovieClip();
}
particlesOnStage = [];
}
function spawnStar(sx, sy) {
sName = "star" + depth;
attachMovie(mys, sName, depth);
depth++;
sRef = this[sName];
sRef._x = sx;
sRef._y = sy;
sRef.gotoAndStop(random(3) + 1);
sRef.xmov = random(2) + 3;
sRef.ymov = (random(4) + 2) * -1;
sRef.rot = random(10) + 5;
if (random(2) == 1) {
sRef.myDir = 1;
} else {
sRef.myDir = -1;
}
particlesOnStage.push(sRef);
}
function moveParticles() {
for (myp in particlesOnStage) {
pRef = particlesOnStage[myp];
pRef._x = pRef._x + (pRef.xmov * pRef.myDir);
pRef._y = pRef._y + pRef.ymov;
pRef._rotation = pRef._rotation + (pRef.rot * pRef.myDir);
pRef.ymov = pRef.ymov + 0.45;
pRef.xmov = pRef.xmov - 0.2;
if (pRef.xmov < 0) {
pRef.removeMovieClip();
particlesOnStage.splice(myp, 1);
}
}
}
particlesOnStage = [];
depth = 100;
runtimer = false;
moveParts();
this.onEnterFrame = function () {
moveParticles();
if ((random(5) == 1) && (particlesOnStage.length < 40)) {
myx = random(400);
myy = random(200);
mys = "star" + (random(7) + 1);
k = 1;
while (k < 20) {
spawnStar(myx, myy, mys);
k++;
}
}
};
Symbol 464 MovieClip Frame 1
stop();
Symbol 464 MovieClip Frame 2
_root.playSound("clap");
_root.__trackref.hitPage("{C9B3743D-1E95-49AE-B304-F738447628C2}");
Symbol 464 MovieClip Frame 113
_parent.curtainsForYou();
_parent.gamePhase = "interim";
_root.__trackref.hitPage("{0961F363-8A9A-4C2D-BF36-99851A218ADE}");
Symbol 465 MovieClip Frame 2
stop();
levelon = 3;
totallevels = 3;
level1_balloonsOn = 4;
level1_prizemin = 5;
level1_prizemax = 8;
level1_stressLevel = 600;
level1_maxStressLevel = 600;
level2_balloonsOn = 4;
level2_prizemin = 2;
level2_prizemax = 6;
level2_stressLevel = 750;
level2_maxStressLevel = 750;
level3_balloonsOn = 4;
level3_prizemin = 1;
level3_prizemax = 4;
level3_stressLevel = 900;
level3_maxStressLevel = 900;
depth = 100;
gamePhase = "pick";
gamemsg = "";
balloonsOn = 4;
boardOnStage = [];
boardWidth = 16;
boardHeight = 10;
boardMiddleX = 0;
margin = 2;
compSpeed = 7;
prizedepth = 30000;
prizeOnStage = [];
prizemin = 6;
prizemax = 8;
prizesFalling = [];
prizesOnBottom = [];
prizeBotDis = 22;
prizeSpeed = 3;
groundy = 348;
numPrizePics = 17;
undoBoards = [];
undoPrizes = [];
undoPrizesDropped = [];
undoBoost = [];
undoDynamic = [];
undoStressM = [];
undoSuper = [];
undoLimit = 100;
boostX = 0;
dynamicWidth = boardWidth;
particlesOnStage = [];
balloonWidth = 22;
balloonHeight = 28;
balloonHighlight = "";
highLightGroup = [];
mouseHold = false;
mouseOverBal = "";
cascadeArray = [];
cascadetimer = 0;
cascadegap = 1;
cascadenum = 1;
supersy = 450;
stressLevel = 500;
maxStressLevel = 500;
stressLevels = ["I'm going crazy!", "AAAArghhh!", "All worked up", "Tense", "Same Ole Same Ole", "Calm", "Feeling Groovy", "At ease with the world", "Chillin like a Sea Bass", "Cool as a cucumber"];
flagMeter = false;
lendon = "";
displaystattimer = 0;
displaystaton = 200;
storephase = "";
totalpopped = 0;
totalsuper = 0;
totalstresslevel = 0;
totalstressmax = 0;
moodLevel = 4;
levelLimits = [30, 45, 65, 85];
targFrames = [1, 8, 15, 22, 29];
isMood = true;
hitlevel = false;
function buildLevel(levelnum) {
var _local1 = levelnum;
var _local2 = this;
var _local3 = _root;
stressmeter.gotoAndStop(1);
if (_local1 == 1) {
_local3.__trackref.hitPage("{EFA6FE64-D121-423B-BB3E-CD9AE0430FEA}");
} else if (_local1 == 2) {
_local3.__trackref.hitPage("{4D4DACD7-6406-4089-8947-97189F1329D1}");
} else if (_local1 == 3) {
_local3.__trackref.hitPage("{88460139-11ED-44F5-9086-F726A3E7B16F}");
}
clearBoard(true);
boardMiddleX = 0;
undoBoards = [];
undoPrizes = [];
undoPrizesDropped = [];
undoBoost = [];
undoDynamic = [];
undoStressM = [];
undoSuper = [];
prizesFalling = [];
prizesOnBottom = [];
boostX = 0;
dynamicWidth = boardWidth;
flagMeter = false;
flagCheck = false;
flagDrop = false;
flagMove = false;
flagLevEnd = false;
flagPCascade = false;
flagSH = false;
bpopped = 0;
spopped = 0;
balloonsOn = _local2[("level" + _local1) + "_balloonsOn"];
prizemin = _local2[("level" + _local1) + "_prizemin"];
prizemax = _local2[("level" + _local1) + "_prizemax"];
stressLevel = _local2[("level" + _local1) + "_stressLevel"];
maxStressLevel = _local2[("level" + _local1) + "_maxStressLevel"];
gamePhase = "levelintro";
buildBoard();
levelpopin.gotoAndPlay("levn");
levelpopin.mylevelp.gotoAndStop(_local1);
setupSpike();
}
function streamBalloons() {
dropBalloons.push(streamon.pop());
dropBalloons.push(streamon.pop());
dropBalloons.push(streamon.pop());
flagDrop = true;
flagSH = true;
if (streamon.length < 1) {
spikeonoff.gotoAndPlay("spikein");
}
}
function buildBoard(presetBoard, dontreset, presetPrizes) {
var _local1 = presetBoard;
boardOnStage = [];
prizeOnStage = [];
boostyCalc = [];
streamon = [];
calcBoost();
r = 0;
while (r < boardHeight) {
thisRow = [];
prizeRow = [];
c = 0;
while (c < boardWidth) {
if ((_local1 != undefined) && (_local1[r][c] == 0)) {
thisRow.push(0);
} else {
bname = "balloon" + depth;
board.attachMovie("balloon", bname, depth);
depth++;
bRef = board[bname];
bRef.bclip.gotoAndStop(random(balloonsOn) + 1);
if (_local1 != undefined) {
bRef.bclip.gotoAndStop(_local1[r][c]);
}
bRef.myColour = bRef.bclip._currentframe;
bRef.myRow = r;
bRef.myCol = c;
bRef.gotoAndStop("still");
bRef._x = c * (balloonWidth + margin);
if (_local1 != undefined) {
bRef._x = bRef._x + boostX;
}
bRef._y = r * (balloonHeight + margin);
if (gamePhase == "levelintro") {
bRef._y = 430;
bRef._x = 190;
streamon.push(bRef);
}
thisRow.push(bRef);
}
prizeRow.push(0);
c++;
}
boardOnStage.push(thisRow);
prizeOnStage.push(prizeRow);
r++;
}
streamon.reverse();
bycount = 0;
c = 0;
while (c < boardWidth) {
prizesOnBottom.push(0);
c++;
}
if (dontreset != true) {
boardMiddleX = board._width / 2;
dynamicWidth = boardWidth;
_root.playSound("balloonsin");
}
if (gamePhase != "levelintro") {
spawnPrizes(presetPrizes, _local1);
} else {
boardMiddleX = ((boardWidth * (balloonWidth + margin)) + (balloonWidth + margin)) / 2;
}
}
function spawnPrizes(pPrizes, fixedB) {
var _local1 = pPrizes;
var _local2 = fixedB;
rowRange = prizemax - prizemin;
c = 0;
while (c < boardWidth) {
if (_local1 != undefined) {
myRow = _local1[c];
} else {
myRow = random(rowRange) + prizemin;
}
if (myRow != 100) {
pName = "prize" + prizedepth;
board.attachMovie("prize", pName, prizedepth);
prizedepth++;
pRef = board[pName];
pRef._x = (c * (balloonWidth + margin)) + (balloonWidth / 2);
pRef._y = (myRow * (balloonHeight + margin)) + (balloonHeight / 2);
if (_local2 != undefined) {
pRef._x = pRef._x + boostX;
}
prizeOnStage[myRow][c] = pRef;
}
c++;
}
}
function clearBoard(clearbot) {
rd = 0;
while (rd < boardHeight) {
cd = 0;
while (cd < boardWidth) {
remBRef = boardOnStage[rd][cd];
if (remBRef != 0) {
remBRef.removeMovieClip();
}
remPRef = prizeOnStage[rd][cd];
if (remPRef != 0) {
remPRef.removeMovieClip();
}
cd++;
}
rd++;
}
if (clearbot == true) {
for (pr in prizesOnBottom) {
prRef = prizesOnBottom[pr];
if (prRef != 0) {
prRef.removeMovieClip();
}
}
}
}
function undoMove() {
if (undoBoards.length > 0) {
clearBoard(true);
prevBoard = undoBoards.pop();
prevPrizes = undoPrizes.pop();
prevDrop = undoPrizesDropped.pop();
spopped = undoSuper.pop();
boostX = undoBoost.pop();
dynamicWidth = undoDynamic.pop();
stressLevel = undoStressM.pop();
if (boostX == undefined) {
boostX = 0;
}
buildBoard(prevBoard, true, prevPrizes);
flagMeter = true;
replaceDropped(prevDrop);
leveleOut();
if (undoBoards.length == 0) {
undob.gotoAndStop(1);
}
}
}
function replaceDropped(dropAr) {
var _local1 = dropAr;
prizesOnBottom = [];
myd = 0;
while (myd < _local1.length) {
ddRef = _local1[myd];
if (ddRef != 0) {
pName = "prize" + prizedepth;
board.attachMovie("prize", pName, prizedepth);
prizedepth++;
rpRef = board[pName];
startX = boardMiddleX - (prizeBotDis * (boardWidth / 2));
targX = startX + (myd * prizeBotDis);
rpRef._x = targX;
rpRef._y = groundy;
rpRef.myPrize = ddRef;
rpRef.gotoAndStop("bottom");
rpRef.prizes.gotoAndStop(ddRef);
prizesOnBottom.push(rpRef);
} else {
prizesOnBottom.push(0);
}
myd++;
}
}
function logMove() {
myBoard = copyBoard();
myPrizes = copyPrizes();
myDropped = copyDropped();
undoBoards.push(myBoard);
undoPrizes.push(myPrizes);
undoPrizesDropped.push(myDropped);
undoBoost.push(boostX);
undoDynamic.push(dynamicWidth);
undoStressM.push(stressLevel);
undoSuper.push(spopped);
if (undoBoards.length > undoLimit) {
undoBoards.splice(0, 1);
undoPrizes.splice(0, 1);
undoPrizesDropped.splice(0, 1);
undoBoost.splice(0, 1);
undoDynamic.splice(0, 1);
undoStressM.splice(0, 1);
undoSuper.splice(0, 1);
}
undob.gotoAndStop(2);
}
function copyBoard() {
copyB = [];
ffd = 0;
while (ffd < boardHeight) {
tRow = [];
ffc = 0;
while (ffc < boardWidth) {
ffRef = boardOnStage[ffd][ffc];
if ((ffRef != 0) && (ffRef != undefined)) {
tRow.push(ffRef.myColour);
} else {
tRow.push(0);
}
ffc++;
}
copyB.push(tRow);
ffd++;
}
return(copyB);
}
function copyPrizes() {
copyP = [];
fpd = 0;
while (fpd < boardWidth) {
pfound = false;
fpr = 0;
while (fpr < boardHeight) {
fpRef = prizeOnStage[fpr][fpd];
if ((((fpRef != 0) && (fpRef != undefined)) && (fpRef != "")) && (fpRef._x > 0)) {
copyP.push(fpr);
pfound = true;
}
fpr++;
}
if (pfound == false) {
copyP.push(100);
}
fpd++;
}
return(copyP);
}
function copyDropped() {
storeD = [];
dp = 0;
while (dp < prizesOnBottom.length) {
if ((prizesOnBottom[dp] != 0) && (prizesOnBottom[dp].myPrize != undefined)) {
storeD.push(prizesOnBottom[dp].myPrize);
} else {
storeD.push(0);
}
dp++;
}
return(storeD);
}
function popBoard(afteraction) {
afterpBoard = afteraction;
bbBalloons = [];
for (myr in boardOnStage) {
for (myc in boardOnStage[myr]) {
myRef = boardOnStage[myr][myc];
if ((((myRef != 0) && (myRef != "gap")) && (myRef != "x")) && (myRef != undefined)) {
bbBalloons.push(myRef);
prizeOnStage[myr][myc].removeMovieClip();
}
}
}
balloonsremain = bbBalloons.length;
cascadePop(bbBalloons, true);
flagPCascade = true;
spikeonoff.gotoAndPlay("spikeout");
undob.gotoAndStop(1);
quitb.gotoAndStop(1);
}
function cascadePop(ctpArray, levend) {
var _local1 = ctpArray;
var _local2 = levend;
logMove();
totx = 0;
cascadeArray = [];
while (_local1.length > 0) {
lowesty = 9999;
lowestypos = 0;
for (cfy in _local1) {
cfRef = _local1[cfy];
if (cfRef._y < lowesty) {
lowesty = cfRef._y;
lowestypos = cfy;
}
}
inarray = false;
for (che in cascadeArray) {
if (cascadeArray[che] == _local1[lowestypos]) {
inarray = true;
}
}
if (inarray == false) {
cascadeArray.push(_local1[lowestypos]);
totx = totx + _local1[lowestypos]._x;
if (_local2 != true) {
bpopped++;
}
}
_local1.splice(lowestypos, 1);
}
if ((cascadeArray.length > 8) && (_local2 != true)) {
sname = "super" + depth;
attachMovie("bfloat", sname, depth);
depth++;
spRef = this[sname];
spRef._y = supersy;
avx = totx / cascadeArray.length;
spRef._x = (avx + board._x) + 20;
spopped++;
_root.playSound("superpop");
deductStress(cascadeArray.length * 3);
stressmeter.meterlights.play();
}
if (cascadeArray.length < 5) {
cascadenum = 1;
} else if (cascadeArray.length < 10) {
cascadenum = 2;
} else if (cascadeArray.length < 15) {
cascadenum = 3;
} else if (cascadeArray.length < 25) {
cascadenum = 5;
} else if (cascadeArray.length < 35) {
cascadenum = 6;
} else {
cascadenum = 10;
}
calcStress = (cascadeArray.length * 5) - 5;
if (calcStress > 35) {
calcStress = 35;
}
deductStress(calcStress);
cascadetimer = 0;
soundcount = 1;
gamePhase = "cascade";
if (_local2 != true) {
flagLevEnd = false;
} else {
flagLevEnd = true;
}
if (lendon == "lcomplete") {
leveleOut();
}
}
function runCascade() {
var _local1 = _root;
if (cascadeArray.length > 0) {
cascadetimer--;
if (cascadetimer < 0) {
cs = 0;
while (cs < cascadenum) {
cBalloon = cascadeArray.pop();
popBalloons([cBalloon]);
cascadetimer = cascadegap;
soundcount++;
cs++;
}
if (soundcount > 10) {
soundcount = 10;
}
_local1.playSound("bp" + soundcount);
}
} else if (flagLevEnd == true) {
if (afterpBoard == "restart") {
gamePhase = "upsell";
restartlev = true;
_local1.__trackref.hitPage("{F2313A64-9465-4715-9792-59DBBE66F2C3}");
} else if (afterpBoard == "quit") {
gamePhase = "upsell";
displayStart();
_local1.__trackref.hitPage("{0422F7F2-6CA7-41F0-AA8C-7A356E1D347E}");
} else {
curtainsForYou();
gamePhase = "interim";
if (perfectpop._currentframe > 1) {
perfectpop.gotoAndPlay("lout");
}
_local1.__trackref.hitPage("{0961F363-8A9A-4C2D-BF36-99851A218ADE}");
}
} else {
gamePhase = "pick";
sortGrid();
flagDrop = true;
flagCheck = true;
stopHighlight(mouseOverBal);
highLightBalloon(mouseOverBal);
}
}
function popBalloons(bToPop) {
var _local1 = bToPop;
for (pp in _local1) {
pRef = _local1[pp];
if (pRef.myRow != undefined) {
spawnStar(pRef._x, pRef._y + 10);
spawnStar(pRef._x, pRef._y + 10);
}
boardOnStage[pRef.myRow][pRef.myCol] = "gap";
pRef.removeMovieClip();
}
}
function mouseOverHighLighted() {
if (highLightGroup.length < 2) {
return(false);
}
boardMX = board._xmouse;
boardMY = board._ymouse;
for (hc in highLightGroup) {
hcRef = highLightGroup[hc];
leftbound = hcRef._x;
rightbound = hcRef._x + hcRef._width;
topbound = hcRef._y;
botbound = hcRef._y + hcRef._height;
if ((((boardMX > leftbound) && (boardMX < rightbound)) && (boardMY > topbound)) && (boardMY < botbound)) {
return(true);
}
}
return(false);
}
function amHighlighted(checkMe) {
var _local1 = checkMe;
if (highLightGroup.length < 2) {
return(false);
}
for (zz in highLightGroup) {
checkHi = highLightGroup[zz];
if (checkHi == _local1) {
return(true);
}
}
return(false);
}
function stopHighlight(thisBal) {
if (mouseHold != true) {
if (balloonHighlight == thisBal) {
deHi = highLightGroup;
balloonHighlight = "";
} else {
deHi = findMyMates(thisBal);
}
for (dd in deHi) {
dRef = deHi[dd];
dRef.gotoAndStop("still");
dRef.bclip.inbal.gotoAndStop("norm");
}
}
}
function highLightBalloon(thisBal) {
var _local1 = thisBal;
mouseOverBal = _local1;
if (gamePhase == "pick") {
if (mouseHold != true) {
if (balloonHighlight != _local1) {
for (hh in highLightGroup) {
thisHi = highLightGroup[hh];
thisHi.gotoAndStop("still");
thisHi.bclip.inbal.gotoAndStop("norm");
}
balloonHighlight = _local1;
myMates = findMyMates(_local1);
if (myMates.length > 1) {
for (mm in myMates) {
mRef = myMates[mm];
mRef.gotoAndPlay("rotate");
mRef.bclip.inbal.gotoAndStop("high");
}
}
highLightGroup = myMates;
}
}
}
}
function findMyMates(balloonClip) {
var _local1 = balloonClip;
balloonsToCheck = [_local1];
balloonsHaveChecked = [];
balloonsFound = [_local1];
colourNeed = _local1.myColour;
while (balloonsToCheck.length != 0) {
checkBal = balloonsToCheck[0];
checkBal.haveChecked = true;
balloonsHaveChecked.push(checkBal);
myNeighbours = getNeighbours(checkBal);
for (n in myNeighbours) {
neighRef = myNeighbours[n];
if ((neighRef.myColour == colourNeed) && (neighRef.haveChecked != true)) {
balloonsToCheck.push(neighRef);
balloonsFound.push(neighRef);
}
}
balloonsToCheck.splice(0, 1);
}
for (bn in balloonsHaveChecked) {
bnRef = balloonsHaveChecked[bn];
bnRef.haveChecked = false;
}
return(balloonsFound);
}
function getNeighbours(myBalloon) {
var _local1 = myBalloon;
neigh = [];
topClip = boardOnStage[_local1.myRow - 1][_local1.myCol];
if ((topClip != undefined) && (topClip != 0)) {
neigh.push(topclip);
}
botClip = boardOnStage[_local1.myRow + 1][_local1.myCol];
if ((botClip != undefined) && (botClip != 0)) {
neigh.push(botClip);
}
leftClip = boardOnStage[_local1.myRow][_local1.myCol - 1];
if ((leftClip != undefined) && (leftClip != 0)) {
neigh.push(leftClip);
}
rightClip = boardOnStage[_local1.myRow][_local1.myCol + 1];
if ((rightClip != undefined) && (rightClip != 0)) {
neigh.push(rightClip);
}
return(neigh);
}
this.onMouseDown = function () {
mouseHold = true;
if ((balloonHighlight != "") && (highLightGroup.length > 1)) {
for (gg in highLightGroup) {
hiRef = highLightGroup[gg];
hiRef.bclip.inbal.gotoAndStop("squeeze");
}
}
};
this.onMouseUp = function () {
amHi = mouseOverHighLighted(mouseOverBal);
if ((amHi == true) && (gamePhase == "pick")) {
cascadePop(highLightGroup);
} else if ((gamePhase == "pick") && (mouseOverBal.hitTest(_xmouse + 10, _ymouse + 10))) {
_root.playSound("rejection");
}
for (gg in highLightGroup) {
hiRef = highLightGroup[gg];
hiRef.gotoAndStop("still");
hiRef.bclip.inbal.gotoAndStop("norm");
}
mouseHold = false;
};
function startHorz() {
for (dd in dropBalloons) {
dBal = dropBalloons[dd];
ddTarg = (dBal.myCol * (balloonWidth + margin)) + boostX;
dist = ddTarg - dBal._x;
moveme = dist / compSpeed;
if (moveme < 0) {
moveme = moveme - 0.5;
} else {
moveme = moveme + 0.5;
}
dBal._x = dBal._x + moveme;
if ((dBal._x < (ddTarg + 0.6)) && (dBal._x > (ddTarg - 0.6))) {
dBal._x = ddTarg;
}
}
if (dropBalloons.length < 1) {
flagSH = false;
}
}
function dropColumns() {
for (dd in dropBalloons) {
dBal = dropBalloons[dd];
targY = dBal.myRow * (balloonHeight + margin);
dist = dBal._y - targY;
moveMe = dist / compSpeed;
if (moveMe < 0.5) {
moveMe = 0.5;
}
dBal._y = dBal._y - moveMe;
if ((dBal._y - 1) < targY) {
dBal._y = targY;
dropBalloons.splice(dd, 1);
} else if (dBal._y == undefined) {
dropBalloons.splice(dd, 1);
}
}
if (dropBalloons.length < 1) {
flagDrop = false;
}
}
function sortGrid() {
mc = 0;
while (mc < dynamicWidth) {
gaps = true;
while (gaps == true) {
gaps = false;
mr = 0;
while (mr < (boardHeight + 1)) {
thisGrid = boardOnStage[mr][mc];
if (gaps == true) {
boardOnStage[mr - 1][mc] = thisGrid;
thisGrid.tagMe = true;
}
if ((thisGrid == "gap") && (gaps == false)) {
gaps = true;
allgaps = true;
addme = 1;
while (boardOnStage[mr + addme][mc] != undefined) {
if (boardOnStage[mr + addme][mc] != "gap") {
allgaps = false;
}
addme++;
}
if (allgaps == true) {
mrrr = 0;
while (mrrr < boardHeight) {
if (boardOnStage[mrrr][mc] == "gap") {
boardOnStage[mrrr][mc] = 0;
}
mrrr++;
}
}
}
mr++;
}
}
mr = 0;
while (mr < boardHeight) {
thisRef = boardOnStage[mr][mc];
thisRef.myRow = mr;
if (thisRef.tagMe == true) {
thisRef.tagMe = false;
dropBalloons.push(thisRef);
}
if (((((thisRef == boardOnStage[mr - 1][mc]) or (boardOnStage[mr - 1][mc] == 0)) or (boardOnStage[mr][mc] == "gap")) or (boardOnStage[mr][mc] == "")) or (boardOnStage[mr][mc] == undefined)) {
boardOnStage[mr][mc] = 0;
}
if ((boardOnStage[mr][mc] == 0) || (boardOnStage[mr][mc] == "gap")) {
releasePrize(mr, mc);
}
mr++;
}
mc++;
}
mc = 0;
while (mc < dynamicWidth) {
if ((boardOnStage[0][mc] == 0) && (boardOnStage[0][mc] != undefined)) {
compressBoard(mc);
mc = mc - 2;
}
mc++;
}
}
function compressBoard(targCol) {
var _local1 = targCol;
rCount = 0;
while (rCount < (boardHeight + 1)) {
boardOnStage[rCount].splice(_local1, 1);
prizeOnStage[rCount].splice(_local1, 1);
rCount++;
}
r = 0;
while (r < boardHeight) {
c = 0;
while (c < dynamicWidth) {
nbRef = boardOnStage[r][c];
nbRef.myRow = r;
nbRef.myCol = c;
c++;
}
r++;
}
boostX = boostX + ((balloonWidth / 2) + margin);
dynamicWidth--;
flagMove = true;
}
function moveColumns() {
allDone = true;
ccCount = 0;
while (ccCount < dynamicWidth) {
bCheck = boardOnStage[0][ccCount];
bTarg = (ccCount * (balloonWidth + margin)) + boostX;
if (((bCheck._x != bTarg) && (bCheck != undefined)) && (bCheck != "gap")) {
dist = bTarg - bCheck._x;
moveme = dist / compSpeed;
if (moveme < 0) {
moveme = moveme - 0.5;
} else {
moveme = moveme + 0.5;
}
bCheck._x = bCheck._x + moveme;
if ((bCheck._x < (bTarg + 0.5)) && (bCheck._x > (bTarg - 0.5))) {
bCheck._x = bTarg;
} else {
allDone = false;
}
finalx = bCheck._x;
rcCount = 0;
while (rcCount < boardHeight) {
if (rcCount > 0) {
bcRef = boardOnStage[rcCount][ccCount];
bcRef._x = finalx;
}
if (prizeOnStage[rcCount][ccCount] != 0) {
prizeOnStage[rcCount][ccCount]._x = finalx + (balloonWidth / 2);
}
rcCount++;
}
}
ccCount++;
}
if (allDone == true) {
flagMove = false;
}
}
dropBalloons = [];
function checkGameOver() {
if (checkMoves() == false) {
if (checkWin() == true) {
countleft = bOnBoard();
if (countleft < 1) {
perfectpop.play();
balloonsremain = countleft;
spikeonoff.gotoAndPlay("spikeout");
flagPCascade = true;
undob.gotoAndStop(1);
quitb.gotoAndStop(1);
} else {
leveleIn("ldone");
_root.playSound("gamewon");
}
} else {
leveleIn("nomoves");
_root.playSound("gamelost");
}
}
flagCheck = false;
}
function bOnBoard() {
bon = 0;
for (myr in boardOnStage) {
for (myc in boardOnStage[myr]) {
myRef = boardOnStage[myr][myc];
if ((((myRef != 0) && (myRef != "gap")) && (myRef != "x")) && (myRef != undefined)) {
bon++;
}
}
}
return(bon);
}
function checkMoves() {
esr = 0;
while (esr < boardHeight) {
if ((esr % 2) == 0) {
sOn = 0;
} else {
sOn = 1;
}
eoCol = sOn;
while (eoCol < dynamicWidth) {
chRef = boardOnStage[esr][eoCol];
if (chRef != 0) {
needCol = chRef.myColour;
nextTo = getNeighbours(chRef);
for (nn in nextTo) {
thisNe = nextTo[nn];
if (thisNe.myColour == needCol) {
return(true);
}
}
}
eoCol = eoCol + 2;
}
esr++;
}
return(false);
}
function checkWin() {
for (sp in prizesOnBottom) {
if (prizesOnBottom[sp] == 0) {
return(false);
}
}
return(true);
}
function releasePrize(pRow, pCol) {
pClip = prizeOnStage[pRow][pCol];
if ((pClip != 0) && (pClip != undefined)) {
pClip.swapDepths(depth);
depth++;
pClip.gotoAndPlay("float");
_root.playSound("prizechute");
freepos = [];
for (pf in prizesOnBottom) {
if (((prizesOnBottom[pf] == 0) || (prizesOnBottom[pf].myPrize == undefined)) || (prizesOnBottom[pf] == "")) {
freepos.push(pf);
}
}
myPosition = freepos[random(freepos.length)];
prizesOnBottom[myPosition] = pClip;
startX = boardMiddleX - (prizeBotDis * (boardWidth / 2));
targX = startX + (myPosition * prizeBotDis);
dx = targX - pClip._x;
dy = groundy - pClip._y;
myAngle = Math.atan2(dy, dx);
pClip.xmov = prizeSpeed * Math.cos(myAngle);
pClip.ymov = prizeSpeed * Math.sin(myAngle);
pClip.xTarg = targX;
pClip.yTarg = groundy;
pClip.myPrize = random(numPrizePics) + 1;
pClip.pfloat.prizes.gotoAndStop(pClip.myPrize);
prizesFalling.push(pClip);
prizeOnStage[pRow][pCol] = 0;
if (checkWin() == true) {
leveleIn("lcomplete");
jumpSpike("superjumpspike");
} else {
jumpSpike("jumpspike");
}
deductStress(10);
}
}
function dropPrizes() {
var _local1 = _root;
for (pp in prizesFalling) {
moveP = prizesFalling[pp];
moveP._x = moveP._x + moveP.xmov;
moveP._y = moveP._y + moveP.ymov;
if (moveP._y > moveP.yTarg) {
moveP._y = moveP.yTarg;
moveP._x = moveP.xTarg;
moveP.gotoAndStop("bottom");
moveP.prizes.gotoAndStop(moveP.myPrize);
prizesFalling.splice(pp, 1);
_local1.playSound("prizedrop");
}
}
}
function spawnStar(sx, sy) {
sName = "star" + depth;
board.attachMovie("star", sName, depth);
depth++;
sRef = board[sName];
sRef._x = sx;
sRef._y = sy;
sRef.xmov = random(2) + 3;
sRef.ymov = (random(4) + 2) * -1;
sRef.rot = random(10) + 5;
sRef.gotoAndStop(random(3) + 1);
if (random(2) == 1) {
sRef.myDir = 1;
} else {
sRef.myDir = -1;
}
particlesOnStage.push(sRef);
}
function cascadePrizes() {
pOffTimer++;
if (pOffTimer > pOffbetween) {
pfound = false;
pc = 0;
while (pc < prizesOnBottom.length) {
if (pfound == false) {
if (prizesOnBottom[pc] != 0) {
prizeOff(pc);
pfound = true;
}
}
pc++;
}
if (pfound == false) {
flagPCascade = false;
}
pOffTimer = 0;
}
}
function prizeOff(parRef) {
myCPrize = prizesOnBottom[parRef];
myCPrize.xmov = 0;
myCPrize.ymov = -5;
myCPrize.rot = 0;
myCPrize.amPart = true;
particlesOnStage.push(myCPrize);
prizesOnBottom.splice(parRef, 1);
}
function moveParticles() {
for (myp in particlesOnStage) {
pRef = particlesOnStage[myp];
pRef._x = pRef._x + (pRef.xmov * pRef.myDir);
pRef._y = pRef._y + pRef.ymov;
if (pRef.amPart == true) {
pRef.ymov = pRef.ymov + 0.5;
if (pRef._y > 450) {
pRef.removeMovieClip();
particlesOnStage.splice(myp, 1);
}
} else {
pRef.ymov = pRef.ymov + 0.25;
pRef.xmov = pRef.xmov - 0.1;
if (pRef.xmov < 0) {
pRef.removeMovieClip();
particlesOnStage.splice(myp, 1);
}
}
}
if (particlesOnStage.length < 1) {
if (restartlev == true) {
buildLevel(levelon);
restartlev = false;
}
}
}
pOffTimer = 0;
pOffbetween = 2;
flagPCascade = false;
function manageSpikeMood() {
sLevel = (stressLevel / maxStressLevel) * 100;
moodLevel = 4;
for (se in levelLimits) {
if (sLevel < levelLimits[se]) {
moodLevel = se;
}
}
tFrame = targFrames[moodLevel];
if (spikeonoff.spikestuff.spikemoods._currentframe > tFrame) {
spikeonoff.spikestuff.spikemoods.prevFrame();
} else if (spikemoods._currentframe < tFrame) {
spikeonoff.spikestuff.spikemoods.nextFrame();
}
}
function jumpSpike(jtype) {
if (spikeonoff.spikestuff._currentframe == 1) {
spikeonoff.spikestuff.spikejumpy.gotoAndPlay(jtype);
}
}
function setupSpike() {
spikeonoff.spikestuff.spikemoods.gotoAndStop("mental");
isMood = true;
hitlevel = false;
}
function displayStart() {
gamePhase = "start";
startin.gotoAndPlay("lin");
}
function startGame() {
levelon = 1;
totalpopped = 0;
totalsuper = 0;
totalstresslevel = 0;
totalstressmax = 0;
buildLevel(levelon);
}
function pauseGame() {
storephase = gamePhase;
gamePhase = "paused";
}
function resumeGame(fphase) {
if (fphase == undefined) {
gamePhase = storephase;
} else {
gamePhase = fphase;
}
}
function displayUpsell(gameo) {
upsellpop.gotoAndPlay("lin");
if (gameo == true) {
upsellpop.upsellframe = 3;
} else {
upsellpop.upsellframe = levelon - 1;
}
}
function displaycount() {
displaystattimer++;
if (displaystattimer == displaystaton) {
displayStats();
}
}
function displayStats() {
if (levelon == totallevels) {
_root.__trackref.hitPage("{60928521-2B07-4F95-A353-1BD6FD3903B4}");
youwinpop.gotoAndPlay("lin");
youwinpop.bpop = totalpopped + ((boardWidth * boardHeight) - balloonsremain);
youwinpop.spop = totalsuper + spopped;
totalstresslevel = totalstresslevel + stressLevel;
totalstressmax = totalstressmax + maxStressLevel;
sper = (totalstresslevel / totalstressmax) * 100;
txtinc = int(100 / stressLevels.length);
tcount = txtinc;
arpos = 0;
while (tcount < sper) {
tcount = tcount + txtinc;
arpos++;
}
youwinpop.chiltxt = stressLevels[(stressLevels.length - 1) - arpos];
} else {
_root.__trackref.hitPage("{28CA7E18-20CD-480D-B825-99B10BF1F5B5}");
lstats.gotoAndPlay("lin");
lstats.bpop = balloonsremain;
totalpopped = totalpopped + ((boardWidth * boardHeight) - balloonsremain);
lstats.spop = spopped;
totalsuper = totalsuper + spopped;
sper = (stressLevel / maxStressLevel) * 100;
totalstresslevel = totalstresslevel + stressLevel;
totalstressmax = totalstressmax + maxStressLevel;
txtinc = int(100 / stressLevels.length);
tcount = txtinc;
arpos = 0;
while (tcount < sper) {
tcount = tcount + txtinc;
arpos++;
}
lstats.chiltxt = stressLevels[(stressLevels.length - 1) - arpos];
levelon++;
}
}
function curtainsForYou() {
_parent.gamebg.curtains.gotoAndPlay("copen");
_parent.gamebg.curtains.curtainimage.gotoAndStop(levelon);
displaystattimer = 0;
}
function closeCurtains() {
_parent.gamebg.curtains.gotoAndPlay("cclose");
}
function leveleIn(lframe) {
lendon = lframe;
if (lendin.amin != true) {
lendin.gotoAndPlay("lin");
}
lendin.lend.gotoAndStop(lframe);
}
function leveleOut() {
if (lendin.amin == true) {
lendin.gotoAndPlay("lout");
}
}
function deductStress(sAmount) {
stressLevel = stressLevel - sAmount;
flagMeter = true;
}
function moveStressMeter() {
targFrame = 1000 - ((stressLevel / maxStressLevel) * 1000);
if (stressmeter._currentframe != targFrame) {
dif = stressmeter._currentframe - targFrame;
if (dif < 0) {
dif = dif * -1;
}
amm = int(dif / 10) + 1;
f = 0;
while (f < amm) {
if (targFrame > stressmeter._currentframe) {
stressmeter.nextFrame();
} else {
stressmeter.prevFrame();
}
f++;
}
} else {
flagMeter = false;
}
}
setupSpike();
displayStart();
this.onEnterFrame = function () {
if (gamePhase == "pick") {
} else if (gamePhase == "cascade") {
runCascade();
} else if (gamePhase == "interim") {
} else if (gamePhase == "levelintro") {
streamBalloons();
}
if (flagCheck == true) {
checkGameOver();
}
if (flagSH == true) {
startHorz();
}
if (flagDrop == true) {
dropColumns();
}
if (flagMove == true) {
moveColumns();
}
if (flagMeter == true) {
moveStressMeter();
}
if (flagPCascade == true) {
cascadePrizes();
}
moveParticles();
dropPrizes();
manageSpikeMood();
};
Symbol 466 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp1");
_parent.titlemus.stopme();
Symbol 467 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp2");
_parent.titlemus.stopme();
Symbol 468 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp3");
_parent.titlemus.stopme();
Symbol 469 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp4");
_parent.titlemus.stopme();
Symbol 470 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp5");
_parent.titlemus.stopme();
Symbol 471 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp6");
_parent.titlemus.stopme();
Symbol 472 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp7");
_parent.titlemus.stopme();
Symbol 473 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp8");
_parent.titlemus.stopme();
Symbol 474 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp9");
_parent.titlemus.stopme();
Symbol 475 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("bp10");
_parent.titlemus.stopme();
Symbol 476 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("gamelost");
_parent.titlemus.stopme();
Symbol 477 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("gamewon");
_parent.titlemus.stopme();
Symbol 478 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("prizechute");
_parent.titlemus.stopme();
Symbol 479 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("prizedrop");
_parent.titlemus.stopme();
Symbol 480 MovieClip Frame 1
function playme() {
mysound.start(0.4, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("rejection");
mysound.setVolume(95);
_parent.titlemus.stopme();
Symbol 481 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("superpop");
_parent.titlemus.stopme();
Symbol 482 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("dlog");
_parent.titlemus.stopme();
Symbol 483 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("dappear");
_parent.titlemus.stopme();
Symbol 484 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("wand");
_parent.titlemus.stopme();
Symbol 485 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("benter");
_parent.titlemus.stopme();
Symbol 486 MovieClip Frame 1
function playme() {
mysound.start(0, 1);
mysound.onSoundComplete = function () {
_parent.soundtrack.playme();
};
}
function stopme() {
delete mysound.onSoundComplete;
mysound.stop();
}
mysound = new Sound(this);
mysound.attachSound("clapsound");
_parent.titlemus.stopme();
Symbol 487 MovieClip Frame 1
stop();
Symbol 495 Button
on (release) {
_root.muteSounds();
gotoAndStop (2);
}
Symbol 499 Button
on (release) {
_root.unMuteSounds();
gotoAndStop (1);
}
Symbol 500 MovieClip Frame 1
stop();
Symbol 506 Button
on (rollOver) {
_root.spawnstars = true;
}
on (rollOut, dragOut) {
_root.spawnstars = false;
}
on (release) {
getURL ("http://www.pogo.com/home/home.do?sourceid=viralgame_poppit_gotopogo", "_blank");
_root.__trackref.hitPage("{E1CD924C-7097-4BDF-A50A-D29E0666B396}");
}
Symbol 511 Button
on (release) {
stain.gotoAndPlay("lin");
}