Frame 2
function _doGameOver(score, gamestate, showskip, delay) {
trace((((("CALLED : _doGameOver : score:" + score) + " gamestate:") + gamestate) + " showskip: ") + showskip);
clearInterval(_gameoverinterval);
if (delay == undefined) {
delay = 3000;
}
if ((score != undefined) and (gamestate != undefined)) {
_root.partner_score = score;
_root.obj_game._gstatus = gamestate;
_gameoverinterval = setInterval(attachGameOverMc, delay, showskip);
} else {
trace("Could Not Load GAMEOVER!!!");
}
}
function attachGameOverMc(showskip) {
stopAllSounds();
var _local2 = flash.external.ExternalInterface.call("document.URL.toString");
if ((_local2 != null) && (_local2.indexOf("games2win.com") != -1)) {
trace(_local2.indexOf("games2win.com"));
flash.external.ExternalInterface.call("inviziShowHtmlPlaceHolder", "");
}
clearInterval(_gameoverinterval);
_root.__gameover_mc = _root.attachMovie("_g2w_gameover_mc", "mc_gameover", _root.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
if (_root.obj_game._gstatus == "gameover") {
_root.__gameover_mc.gotoAndStop("g2w_gameover");
if (showskip) {
_root.__gameover_mc.panel_btn.gotoAndStop("skip");
}
}
}
function g2w_playagain(resetlevel) {
_root.__gameover_mc.removeMovieClip();
_root.gotoAndStop("jumpframe");
if (resetlevel) {
_root.current_level = 0;
_root.restartGame();
} else {
_root.restartLevel();
}
}
function g2w_skiplevel() {
_root.__gameover_mc.removeMovieClip();
_root.nextLevel(_root.levelCompleted);
}
var obj_game = new Array();
obj_game._host = "g2w";
obj_game._gameName = "ultimate_babysitter_2";
obj_game._gameTitle = "Ultimate Babysitter 2";
obj_game._g2wGameId = "1184";
obj_game._partnerGameId = "ultimatebabysitter2";
obj_game._gstatus = "gameover";
obj_game._googleText = "Ultimate Babysitter 2";
obj_game._gameStageW = 800;
obj_game._gameStageH = 600;
obj_game._gameScoreOrder = "desc";
obj_game._gameResolution = (Stage.width + "x") + Stage.height;
obj_game.g2wBot = "";
obj_game.g2wBotId = 10301;
obj_game.inviziads = ((("http://s1.inviziads.com/lookup.html?g=" + obj_game._g2wGameId) + "&h=") + obj_game._host) + "&v=4_3";
var obj_partner = new Array();
obj_partner.partner_name = "g2w";
obj_partner.partner_id = 1;
obj_partner.invalid_txt = "Invalid Nickname!";
obj_partner.show_submit = false;
obj_partner.submitURL = "/submit_score.asp";
obj_partner.top10URL = "/get_top_scorer.asp";
obj_partner.lblsubmit = "Enter your Games2win Nickname below";
obj_partner.show_g2w_slate = true;
obj_partner.show_register = true;
obj_partner.text_register = "Create Nickname";
obj_partner.url_register = "http://www.games2win.com/register.asp";
obj_partner.clickthru = "http://www.games2win.com/";
obj_partner._allowclick = true;
_validateHost = function (mcpath) {
var _local2 = mcpath;
_local2.overlay_btn.useHandCursor = false;
if (_root.obj_game._gstatus == "gameover") {
_initGameOver(_local2);
} else if (_root.checkhost()) {
_initLoginPanel(_local2);
} else {
_initAlientHost(_local2);
}
};
_initGameOver = function (mcpath) {
var _local2 = mcpath;
_local2.gotoAndStop("g2w_gameover");
_local2.panel_btn.playagain_btn.onRelease = function () {
_root.g2w_playagain();
};
_local2.panel_btn.skiplvl_btn.onRelease = function () {
_root.g2w_skiplevel();
};
};
_initLoginPanel = function (mcpath) {
var mc = mcpath;
mc.gotoAndStop("g2w_login");
Selection.setFocus("username_txt");
mc.username_txt.onSetFocus = function () {
if (this.text == obj_partner.invalid_txt) {
this.text = "";
}
};
mc.playagain_btn.onRelease = function () {
_root.g2w_playagain(true);
};
mc.nickname_btn.onRelease = function () {
getURL (_root.obj_partner.url_register, "_blank");
};
mc.submit_btn.onRelease = function () {
_root._scoreSubmit(mc);
};
};
_initAlientHost = function (mcpath) {
var _local2 = mcpath;
_local2.gotoAndStop("g2w_alienhost");
_local2.playagain_btn.onRelease = function () {
trace("CALLING : _root.g2w_playagain()");
_root.g2w_playagain(true);
};
};
_scoreSubmit = function (mcpath) {
var mc = mcpath;
myname = _root.partner_uname;
myscore = _root.partner_score;
mygameid = _root.obj_game._g2wGameId;
myname = myname.trim();
if (((myname.length == 0) or (myname == obj_partner.invalid_txt)) or (myname == undefined)) {
_root.partner_uname = obj_partner.invalid_txt;
} else {
mc.gotoAndStop("g2w_status");
mc.tryagain_btn._visible = false;
_root.send_lv = new LoadVars();
_root.send_lv.onLoad = function (success) {
if (success) {
if (_root.send_lv.isreg == 0) {
mc.status_txt.text = obj_partner.invalid_txt;
mc.tryagain_btn._visible = true;
mc.tryagain_btn.onRelease = function () {
_initLoginPanel(mc);
};
} else if (_root.send_lv.isreg == 1) {
mc.status_txt.text = "";
_root._getTop10(mc);
}
} else {
mc.status_txt.text = "Error in Connection...!";
mc.tryagain_btn._visible = true;
mc.tryagain_btn.onRelease = function () {
_initLoginPanel(mc);
};
}
};
_root.send_lv.nickname = myname;
_root.send_lv.points = myscore;
_root.send_lv.gameid = mygameid;
_root.send_lv.sendAndLoad(obj_partner.submitURL, _root.send_lv, "POST");
mc.status_txt.text = "Connecting to Server...";
}
};
c_fail = 0;
_getTop10 = function (mcpath) {
var mc = mcpath;
_root.send_lv = new XML();
_root.rst_lv = new XML();
mc.gotoAndStop("g2w_status");
_root.rst_lv.onLoad = function (success) {
if (success) {
var _local3 = new it.sephiroth.XML2Object();
mc.status_txt.text = "";
var _local4 = _local3.parseXML(this);
_initTop10(mc, _local4);
} else {
_root.c_fail++;
if (_root.c_fail >= 3) {
mc.status_txt.text = "Error!";
tryagain_btn._visible = true;
mc.tryagain_btn.onRelease = function () {
_initLoginPanel(mc);
};
} else {
_root.send_lv.sendAndLoad(url, _root.rst_lv, "POST");
}
}
};
var url = ((((((obj_partner.top10URL + "?game_id=") + _root.obj_game._g2wGameId) + "&order=") + obj_game._gameScoreOrder) + "&timspam") + getTimer());
mc.status_txt.text = "Connecting to Server...";
_root.send_lv.sendAndLoad(url, _root.rst_lv, "POST");
};
_initTop10 = function (mcpath, list) {
var _local3 = mcpath;
_local3.gotoAndStop("g2w_top10");
if ((list.top_score.status.data == 0) or (list.top_score.user[0].score.data == 0)) {
_top10_lbl._visible = false;
var _local2 = 0;
while (_local2 < 10) {
_local3["row" + _local2]._visible = false;
_local2++;
}
} else {
_noscore_mc._visible = false;
var _local2 = 0;
while (_local2 < 10) {
if ((list.top_score.user[_local2] == undefined) or (list.top_score.user[_local2].score.data == 0)) {
_local3["row" + _local2].txtrollno.text = "";
_local3["row" + _local2].txtusername.text = "";
_local3["row" + _local2].txtscore.text = "";
} else {
_local3["row" + _local2].txtrollno.text = _local2 + 1;
_local3["row" + _local2].txtusername.text = list.top_score.user[_local2].nick_name.data;
_local3["row" + _local2].txtscore.text = list.top_score.user[_local2].score.data;
}
_local2++;
}
}
_local3.playagain_btn.onRelease = function () {
_root.g2w_playagain(true);
};
};
var g2w_menu = new ContextMenu();
g2w_menu.hideBuiltInItems();
g2w_menu.customItems.push(new ContextMenuItem("Games2win.com", itemHandler));
itemHandler = function (obj, item) {
getURL (obj_partner.clickthru, "_blank");
};
this.menu = g2w_menu;
checkhost = function () {
trace("CALL CHECKHOST");
swfurl = this._url;
if (swfurl.indexOf("games2win.com") == -1) {
return(false);
}
return(true);
};
_trackClickThru = function (mc) {
if (obj_partner._allowclick) {
mc.hit_area.onRelease = function () {
getURL (obj_partner.clickthru, "_blank");
};
} else {
mc.hit_area.useHandCursor = false;
}
};
String.prototype.trim = function () {
var _local3 = 0;
var _local2 = this.length;
white = new Object();
white._32 = 1;
_local2--;
while (white["_" + ord(this.charAt(_local2))]) {
}
while (white["_" + ord(this.charAt(_local3++))]) {
}
return(this.slice(_local3 - 1, _local2 + 1));
};
Frame 10
stop();
Frame 20
stop();
preloaderMc.gotoAndStop(1);
per = Math.floor((getBytesLoaded() / getBytesTotal()) * 100);
preloaderMc.loadTxtMc.perTxt.text = per + "%";
onEnterFrame = function () {
per = Math.floor((getBytesLoaded() / getBytesTotal()) * 100);
preloaderMc.loadTxtMc.perTxt.text = per + "%";
preloaderMc.gotoAndStop(per);
if (per == 100) {
preloaderMc.gotoAndPlay(101);
delete onEnterFrame;
}
};
Frame 27
var introS = new Sound();
introS.attachSound("intro");
_root.introS.start(0, 999);
function createSoundInstance(soundName, soundLinkageName, loopable, passedVolume) {
soundHolderMc = soundMc.createEmptyMovieClip(soundName + "HolderMc", soundMc.getNextHighestDepth());
this[soundName] = new Sound(soundHolderMc);
this[soundName].attachSound(soundLinkageName);
this[soundName + "Start"] = function () {
this[soundName].setVolume(passedVolume);
this[soundName].start();
if (loopable == true) {
toLoopSound = this[soundName];
toLoopSound.onSoundComplete = function () {
toLoopSound.start();
trace("looped " + this);
};
}
};
this[soundName + "Stop"] = function () {
trace("stopping " + this[soundName]);
this[soundName].stop();
trace("stopped " + soundName);
};
trace("done" + soundName);
}
stop();
_root.createEmptyMovieClip("soundMc", _root.getNextHighestDepth());
createSoundInstance("collectedSnd", "collectedsfx", false, 100);
createSoundInstance("whooshSnd", "whooshsfx", false, 100);
createSoundInstance("coinInsertSnd", "coinInsertSfx", false, 100);
createSoundInstance("invSnd", "invSfx", false, 100);
createSoundInstance("crySnd", "crysfx", true, 100);
createSoundInstance("giggleSnd", "gigglesfx", false, 100);
createSoundInstance("laughSnd", "laughsfx", true, 100);
createSoundInstance("firstwordsSnd", "firstwordssfx", true, 100);
createSoundInstance("eatSnd", "eatSfx", false, 100);
_root.createEmptyMovieClip("gameLoopMC", _root.getNextHighestDepth());
var gameLoop = new Sound(_root);
gameLoop.attachSound("lvlsnd");
gameLoopStart = function () {
trace("starting gameLoop");
gameLoop.start();
};
gameLoop.onSoundComplete = function () {
gameLoop.start();
trace("looped " + this);
};
gameLoopStop = function () {
trace("stopping gameLoop");
gameLoop.stop();
trace("stopped gameLoop");
};
Frame 37
gameLoopStart();
var endS = new Sound();
endS.attachSound("end");
introS.stop();
function cacheAllAsBitmap(target) {
for (var _local2 in target) {
if (typeof(target[_local2]) == "movieclip") {
target[_local2].cacheAsBitmap = true;
cacheAllAsBitmap(target[_local2]);
}
}
}
function initLevelFlags(passedLevelNumber) {
switch (passedLevelNumber) {
case 1 :
fruitBreakTinCollected = false;
fruitBreakTinSelected = false;
tinOpenerCollected = false;
tinOpenerSelected = false;
openTinCollected = false;
openTinSelected = false;
spoonCollected = false;
spoonMcSelected = false;
break;
case 2 :
moneySelected = false;
horseCollected = false;
horseSelected = false;
break;
case 3 :
candyCollected = false;
candySelected = false;
shoesCollected = false;
shoesSelected = false;
dirtyDiaperCollected = false;
dirtyDiaperSelected = false;
dirtyDiaperThrown = false;
break;
case 4 :
cradleClosed = false;
hotdogCollected = false;
hotdogEaten = false;
bugSprayCollected = false;
bugSpraySelected = false;
}
}
function restartGame() {
gameLoopStop();
resetInvBlocks();
l = 1;
while (l < 5) {
initLevelFlags(l);
l++;
}
_root.partner_score = 0;
_focusrect = false;
if ((_root.current_level == 0) || (_root.current_level == undefined)) {
_root.current_level = 1;
}
gameState = "INIT";
onEnterFrame = gameFn;
gameLoopStart();
}
function restartLevel() {
gameLoopStop();
stopAllSounds();
resetInvBlocks();
_focusrect = false;
_root.partner_score = 0;
initLevelFlags(current_level);
gameState = "INIT";
onEnterFrame = gameFn;
gameLoopStart();
}
function nextLevel(passedLevelCompleted) {
gameLoopStop();
stopAllSounds();
_focusrect = false;
if (passedLevelCompleted == false) {
_root.partner_score = 0;
}
_root.current_level++;
trace("called" + _root.current_level);
gameState = "INIT";
onEnterFrame = gameFn;
gameLoopStart();
}
function gameOverAction() {
gameLoopStop();
stopAllSounds();
endS.start(0, 999);
crySndStart();
notepadMc._visible = false;
inventoryMc._visible = false;
doneBtn._visible = false;
gameMc.gotoAndStop("LEVEL_INCOMPLETE");
delete onEnterFrame;
}
function bagFSM() {
if (gameState == "PLAYING") {
switch (bagState) {
case "INIT" :
bagState = "IDLE";
break;
case "AWAIT_GAME_START" :
if (gameState == "PLAYING") {
bagState = "IDLE";
}
break;
case "IDLE" :
if (bagMc.hitTest(_xmouse, _ymouse, true)) {
if (currentRoom == "BABY_SHOP") {
delete candyMc.onPress;
}
bagMc.gotoAndPlay("OPEN");
hideTravelButtons();
bagState = "BAG_OPEN_ANIM";
}
break;
case "BAG_OPEN_ANIM" :
if (!bagMc.hitTest(_xmouse, _ymouse, true)) {
showTravelButtons();
if (currentRoom == "BABY_SHOP") {
checkCandyAction();
}
bagState = "BAG_CLOSE_ANIM";
}
break;
case "BAG_CLOSE_ANIM" :
if (bagMc._currentframe > 1) {
bagMc.gotoAndStop(bagMc._currentframe - 1);
} else {
bagState = "IDLE";
}
break;
case "ITEM_SELECTED" :
if (bagMc._currentframe > 1) {
bagMc.gotoAndStop(bagMc._currentframe - 1);
} else {
bagState = "IDLE";
}
}
} else {
bagMc.gotoAndStop("IDLE");
bagState = "IDLE";
}
}
function bagItemSelect(passedItemTxt, itemIndex) {
setInInventory(passedItemTxt);
bagItems[itemIndex - 1] = "Empty";
updateBagItems();
}
function updateBagItems() {
i = 1;
while (i < 7) {
currentItemMc = bagMc[("item" + i) + "Mc"];
currentItemMc.gotoAndStop("NOT_SELECTED");
currentItemMc.itemTxt.text = _root.bagItems[i - 1];
currentItemMc.itemIndex = i;
if (!(currentItemMc.itemTxt.text === "Empty")) {
currentItemMc.onRollOver = function () {
this.gotoAndStop("SELECTED");
};
currentItemMc.onRollOut = function () {
this.gotoAndStop("NOT_SELECTED");
};
currentItemMc.onPress = function () {
_root.bagItemSelect(this.itemTxt.text, this.itemIndex);
};
} else {
delete currentItemMc.onRollOver;
delete currentItemMc.onRollOut;
delete currentItemMc.onPress;
}
i++;
}
}
function shiftItemsRight() {
j = invArray.length - 1;
while (j > -1) {
if (j == (invArray.length - 1)) {
currentRightItemName = invArray[j][0];
currentRightItemIndex = invArray[j][1];
currentRightItemSelection = invArray[j][2];
} else {
currentItemName = invArray[j][0];
currentItemIndex = invArray[j][1];
currentItemSelection = invArray[j][2];
previousInvBlkMc = inventoryMc[("invBlock" + currentItemIndex) + "Mc"];
targetInvBlkMc = inventoryMc[("invBlock" + (currentItemIndex + 1)) + "Mc"];
targetInvBlkMc.itemName = currentItemName;
targetInvBlkMc.invIndex = currentItemIndex + 1;
targetInvBlkMc.currentSelection = currentItemSelection;
invArray[j + 1][0] = invArray[j][0];
invArray[j + 1][2] = invArray[j][2];
previousInvBlkMc.gotoAndStop("BLANK");
invArray[j][0] = 0;
invArray[j][2] = 0;
if (invArray[j + 1][0] == 0) {
targetInvBlkMc.gotoAndStop("BLANK");
}
invItemFn(targetInvBlkMc);
}
j--;
}
targetInvBlkMc = inventoryMc.invBlock1Mc;
targetInvBlkMc.itemName = currentRightItemName;
targetInvBlkMc.invIndex = 1;
targetInvBlkMc.currentSelection = currentRightItemSelection;
invArray[0][0] = currentRightItemName;
invArray[0][2] = currentRightItemSelection;
invItemFn(targetInvBlkMc);
}
function shiftItemsLeft() {
j = 0;
while (j < invArray.length) {
if (j == 0) {
currentLeftItemName = invArray[j][0];
currentLefttItemIndex = invArray[j][1];
currentLeftItemSelection = invArray[j][2];
} else {
currentItemName = invArray[j][0];
currentItemIndex = invArray[j][1];
currentItemSelection = invArray[j][2];
previousInvBlkMc = inventoryMc[("invBlock" + currentItemIndex) + "Mc"];
targetInvBlkMc = inventoryMc[("invBlock" + (currentItemIndex - 1)) + "Mc"];
targetInvBlkMc.itemName = currentItemName;
targetInvBlkMc.invIndex = currentItemIndex - 1;
targetInvBlkMc.currentSelection = currentItemSelection;
invArray[j - 1][0] = invArray[j][0];
invArray[j - 1][2] = invArray[j][2];
previousInvBlkMc.gotoAndStop("BLANK");
invArray[j][0] = 0;
invArray[j][2] = 0;
if (invArray[j - 1][0] == 0) {
targetInvBlkMc.gotoAndStop("BLANK");
}
invItemFn(targetInvBlkMc);
}
j++;
}
targetInvBlkMc = inventoryMc[("invBlock" + invArray.length) + "Mc"];
targetInvBlkMc.itemName = currentLeftItemName;
targetInvBlkMc.invIndex = invArray.length;
targetInvBlkMc.currentSelection = currentLeftItemSelection;
invArray[invArray.length - 1][0] = currentLeftItemName;
invArray[invArray.length - 1][2] = currentLeftItemSelection;
invItemFn(targetInvBlkMc);
}
function levelComplete() {
if (current_level < 4) {
laughSndStart();
babyMc.gotoAndStop("HAPPY");
} else {
babyMc.gotoAndStop("SLEPT");
}
doneBtn._visible = true;
doneBtn.gotoAndStop(2);
gameLoopStop();
levelCompleted = true;
gameState = "COMPLETED";
delete onEnterFrame;
}
function gameFn() {
bagFSM();
switch (gameState) {
case "INIT" :
levelCompleted = false;
bagMc = inventoryMc.bagMc;
bagMc.gotoAndStop("IDLE");
bagState = "INIT";
current_level_part = 1;
setCurrentRoom("MAIN_MALL");
hideTravelButtons();
rightArrowMc = inventoryMc.rightArrowMc;
rightArrowMc.onPress = function () {
if (gameState == "PLAYING") {
invSndStart();
shiftItemsRight();
}
};
leftArrowMc = inventoryMc.leftArrowMc;
leftArrowMc.onPress = function () {
if (gameState == "PLAYING") {
invSndStart();
shiftItemsLeft();
}
};
inventoryMc._visible = true;
doneBtn._visible = false;
doneBtn.gotoAndStop(1);
notepadMc._visible = true;
notepadMc.gotoAndPlay("FADE_IN");
gameState = "NOTEPAD_ANIM";
return;
case "NOTEPAD_ANIM" :
if ((notepadMc.descriptionMc != undefined) && (notepadMc.descriptionMc._currentframe == notepadMc.descriptionMc._totalframes)) {
notepadMc.descriptionMc.startBtn.onRelease = function () {
whooshSndStart();
doneBtn._visible = true;
notepadMc.gotoAndPlay("HIDE");
showTravelButtons();
gameState = "PLAYING";
};
gameState = "NOTEPAD_DISPLAY";
}
return;
case "PLAYING" :
return;
case "NOTEPAD_COMMENT_SHOW" :
if (notepadMc._currentframe == 60) {
notepadMc.commentTxt.text = commentVar;
notepadMc.hideBtn.onPress = continueGame;
gameState = "NOTEPAD_COMMENT_DISPLAY";
}
return;
case "NOTEPAD_COMMENT_DISPLAY" :
return;
case "NOTEPAD_TASK_SHOW" :
if (notepadMc._currentframe == 50) {
notepadMc.hideBtn.onPress = continueGame;
gameState = "NOTEPAD_COMMENT_DISPLAY";
}
return;
case "GIVING_TO_CHILD_ANIM" :
if (giveToChildAnimMc._currentframe == giveToChildAnimMc._totalframes) {
giveToChildAnimMc.gotoAndStop(1);
switch (current_level) {
case 1 :
switch (current_level_part) {
case 1 :
giggleSndStart();
babyMc.gotoAndStop("WITH_SIPPY_CUP");
gameState = "EXPRESSION_DISPLAY";
break;
case 2 :
levelComplete();
}
break;
case 2 :
if (!(current_level_part === 2)) {
} else {
crySndStop();
levelComplete();
}
break;
case 3 :
switch (current_level_part) {
case 1 :
crySndStop();
giggleSndStart();
babyMc.gotoAndStop("CALM");
timer = 100;
gameState = "BABY_CANDY_HAPPY";
break;
case 2 :
laughSndStart();
babyMc.gotoAndStop("baby wth shoe");
timer = 100;
gameState = "BABY_SHOE_HAPPY";
break;
case 3 :
crySndStop();
levelComplete();
babyMc.gotoAndStop("baby wth shoe");
}
break;
case 4 :
switch (current_level_part) {
case 1 :
babyMc.gotoAndStop("BABY_WITH_JACKET");
timer = 100;
gameState = "BABY_WITH_JACKET";
break;
case 2 :
babyMc.gotoAndStop("earpludge");
timer = 100;
gameState = "BABY_WITH_EAR_PLUG";
break;
case 5 :
levelComplete();
}
}
}
return;
case "EXPRESSION_DISPLAY" :
timer = 60;
gameState = "EXPRESSION_DISPLAY_2";
return;
case "EXPRESSION_DISPLAY_2" :
timer--;
if (timer < 0) {
displayNextTask();
}
return;
case "SHOP_ZOOM_ANIM" :
if (kidZoneMc._currentframe == 20) {
gameMc.currentRoomMc._visible = false;
setCurrentRoom("BABY_SHOP");
gameState = "PLAYING";
}
return;
case "SHOP_ZOOM_OUT_ANIM" :
if (kidZoneMc._currentframe == 1) {
kidZoneMc.onPress = kidZoneBtnFn;
toMainMallBtn._visible = true;
kidZoneMc.stop();
setCurrentRoom("KID_ZONE");
gameState = "PLAYING";
}
return;
case "SHELF_ZOOM_ANIM" :
if (shelfMc._currentframe == 29) {
gameMc.currentRoomMc._visible = false;
shelfMc.stop();
trace(sndplay);
setCurrentRoom("APPLIANCE_SHELF");
gameState = "PLAYING";
}
return;
case "SHELF_ZOOM_OUT_ANIM" :
if (shelfMc._currentframe == 1) {
shelfMc.stop();
toMainMallBtn._visible = true;
shelfMc.onPress = shelfMcFn;
setCurrentRoom("APPLIANCE_STORE");
gameState = "PLAYING";
}
return;
case "FADING_ITEMS" :
alphaCounter = alphaCounter - 5;
e = 0;
while (e < invIndexTofade.length) {
inventoryMc[("invBlock" + invIndexTofade[e]) + "Mc"]._alpha = alphaCounter;
e++;
}
if (alphaCounter <= 0) {
f = 0;
while (f < invIndexTofade.length) {
currentTargetBlkMc = inventoryMc[("invBlock" + invIndexTofade[f]) + "Mc"];
currentTargetBlkMc.gotoAndStop("BLANK");
currentTargetBlkMc._alpha = 100;
invIndexTofade[f] = invIndexTofade[f] - f;
currentTargetBlkMc = inventoryMc[("invBlock" + invIndexTofade[f]) + "Mc"];
removeInvItem(currentTargetBlkMc.itemName);
f++;
}
showTravelButtons();
gameState = "PLAYING";
setInInventory(newItemName);
}
return;
case "HORSE_PLAYING" :
timer--;
if (timer <= 0) {
setCurrentRoom("MAIN_MALL");
timer = 100;
babyMc.gotoAndStop("CALM");
hideTravelButtons();
gameState = "BABY_HORSE_HAPPY";
}
return;
case "BABY_HORSE_HAPPY" :
timer--;
if (timer <= 0) {
crySndStart();
babyMc.gotoAndStop("CRYING");
displayNextTask();
}
return;
case "BABY_CANDY_HAPPY" :
timer--;
if (timer <= 0) {
displayNextTask();
}
return;
case "BABY_SHOE_HAPPY" :
timer--;
if (timer <= 0) {
laughSndStop();
crySndStart();
babyMc.gotoAndStop("BABY_SHOE_CRY");
displayNextTask();
}
return;
case "TRASH_THROW_ANIM" :
if (trashCanMc._currentframe == 1) {
showTravelButtons();
notepadMc._visible = true;
gameState = "PLAYING";
}
return;
case "BABY_WITH_JACKET" :
timer--;
if (timer <= 0) {
displayNextTask();
}
return;
case "BABY_WITH_EAR_PLUG" :
timer--;
if (timer <= 0) {
displayNextTask();
}
return;
case "BABY_ASLEEP" :
timer--;
if (timer <= 0) {
displayNextTask();
}
return;
case "HOT_DOG_DISAPPEAR" :
hotdogInvMc._alpha = hotdogInvMc._alpha - 5;
if (hotdogInvMc._alpha <= 0) {
gameState = "PLAYING";
removeInvItem("hotdogMc");
hotdogInvMc._alpha = 100;
displayNextTask();
}
return;
case "BUG_SPRAY" :
timer--;
if (timer > 0) {
break;
}
bugSprayMc.gotoAndStop("BLANK");
levelComplete();
}
}
function cradleCloseFn() {
if (gameState == "PLAYING") {
cradleMc.gotoAndStop("CLOSE");
delete cradleMc.onPress;
cradleClosed = true;
babyMc.gotoAndStop("SLEPT");
timer = 100;
hideTravelButtons();
notepadMc._visible = false;
gameState = "BABY_ASLEEP";
}
}
function setCurrentRoom(passedRoom) {
lastRoom = currentRoom;
currentRoom = passedRoom;
travelButtons = [];
if ((((passedRoom != "BABY_SHOP") && (lastRoom != "BABY_SHOP")) && (passedRoom != "APPLIANCE_SHELF")) && (lastRoom != "APPLIANCE_SHELF")) {
fadeInMc.gotoAndPlay("FADE_IN");
gameMc.gotoAndStop(currentRoom);
}
crySndStop();
firstwordsSndStop();
gameMc.cacheAsBitmap = true;
currentRoomName = currentRoom;
switch (passedRoom) {
case "MAIN_MALL" :
bugSprayMc = gameMc.bugSprayMc;
bugSprayMc.gotoAndStop("BLANK");
babyMc = gameMc.babyMc.innerBabyMc;
switch (current_level) {
case 1 :
switch (current_level_part) {
case 1 :
babyMc.gotoAndStop("HUNGRY");
break;
case 2 :
babyMc.gotoAndStop("FOOD_WAIT");
break;
case 3 :
babyMc.gotoAndStop("FOOD_WAIT");
}
break;
case 2 :
switch (current_level_part) {
case 1 :
if (gameState != "HORSE_PLAYING") {
crySndStart();
} else {
giggleSndStart();
}
babyMc.gotoAndStop("DISTRESSED");
break;
case 2 :
crySndStart();
babyMc.gotoAndStop("CRYING");
}
break;
case 3 :
switch (current_level_part) {
case 1 :
crySndStart();
babyMc.gotoAndStop("DISTRESSED");
break;
case 2 :
babyMc.gotoAndStop("CALM");
break;
case 3 :
crySndStart();
babyMc.gotoAndStop("BABY_SHOE_CRY");
dirtyDiaperChkFn();
}
break;
case 4 :
switch (current_level_part) {
case 1 :
firstwordsSndStart();
babyMc.gotoAndStop("SLEEPY");
break;
case 2 :
babyMc.gotoAndStop("BABY_WITH_JACKET");
break;
case 3 :
babyMc.gotoAndStop("earpludge");
break;
case 4 :
babyMc.gotoAndStop("SLEPT");
break;
case 5 :
babyMc.gotoAndStop("SLEPT");
}
}
cradleMc = gameMc.babyMc.cradleMc;
cradleMc.gotoAndStop("OPEN");
if (current_level == 4) {
if (cradleClosed == false) {
cradleMc.gotoAndStop("OPEN");
if (current_level_part == 3) {
cradleMc.onPress = cradleCloseFn;
}
} else {
cradleMc.gotoAndStop("CLOSE");
}
}
toKidZoneBtn = gameMc.toKidZoneBtn;
toKidZoneBtn.onPress = function () {
setCurrentRoom("KID_ZONE");
};
travelButtons.push(toKidZoneBtn);
toFoodCourtBtn = gameMc.toFoodCourtBtn;
toFoodCourtBtn.onPress = function () {
setCurrentRoom("FOOD_COURT");
};
travelButtons.push(toFoodCourtBtn);
toApplianceStoreBtn = gameMc.toApplianceStoreBtn;
toApplianceStoreBtn.onPress = function () {
setCurrentRoom("APPLIANCE_STORE");
};
travelButtons.push(toApplianceStoreBtn);
break;
case "KID_ZONE" :
sprayMc = gameMc.currentRoomMc.sprayMc;
if (bugSprayCollected == false) {
sprayMc._visible = true;
} else {
sprayMc._visible = false;
}
trashCanMc = gameMc.currentRoomMc.trashCanMc;
if (((current_level == 3) && (current_level_part == 3)) && (dirtyDiaperSelected == true)) {
trashCanMc.onPress = trashCanFn;
}
shoesMc = gameMc.currentRoomMc.shoesMc;
if (shoesCollected == false) {
shoesMc._visible = true;
} else {
shoesMc._visible = false;
}
candyMc = gameMc.currentRoomMc.candyMc;
if (candyCollected == false) {
candyMc._visible = true;
} else {
candyMc._visible = false;
}
horseToyMc = gameMc.currentRoomMc.horseToyMc;
if (horseCollected == false) {
horseToyMc._visible = true;
} else {
horseToyMc._visible = false;
}
mechanicalHorseMc = gameMc.currentRoomMc.mechanicalHorseMc;
mechanicalHorseMc.gotoAndStop("IDLE");
if ((_root.current_level == 2) && (current_level_part == 1)) {
mechanicalHorseMc.onPress = mechanicalHorseFn;
}
toMainMallBtn = gameMc.toMainMallBtn;
toMainMallBtn.onPress = function () {
setCurrentRoom("MAIN_MALL");
};
kidZoneMc = gameMc.kidZoneMc;
kidZoneMc.onPress = kidZoneBtnFn;
backBtn = gameMc.backBtn;
backBtn._visible = false;
travelButtons.push(toMainMallBtn);
travelButtons.push(kidZoneMc);
break;
case "BABY_SHOP" :
sprayMc = gameMc.kidZoneMc.currentRoomMc.sprayMc;
if (bugSprayCollected == false) {
sprayMc._visible = true;
if ((_root.current_level == 4) && (current_level_part == 5)) {
sprayMc.onPress = function () {
setInInventory("sprayMc");
};
}
} else {
sprayMc._visible = false;
}
shoesMc = gameMc.kidZoneMc.currentRoomMc.shoesMc;
if (shoesCollected == false) {
shoesMc._visible = true;
if ((current_level == 3) && (current_level_part == 2)) {
shoesMc.onPress = function () {
setInInventory("shoesMc");
};
}
} else {
shoesMc._visible = false;
}
candyMc = gameMc.kidZoneMc.currentRoomMc.candyMc;
checkCandyAction();
horseToyMc = gameMc.kidZoneMc.currentRoomMc.horseToyMc;
if (horseCollected == false) {
horseToyMc._visible = true;
if ((current_level == 2) && (current_level_part == 2)) {
horseToyMc.onPress = function () {
setInInventory("horseToyMc");
};
}
} else {
horseToyMc._visible = false;
}
backBtn._visible = true;
backBtn.onPress = function () {
whooshSndStart();
gameMc.currentRoomMc._visible = true;
kidZoneMc.gotoAndPlay("ZOOM_OUT");
gameState = "SHOP_ZOOM_OUT_ANIM";
backBtn._visible = false;
};
travelButtons.push(backBtn);
break;
case "FOOD_COURT" :
hotdogMc = gameMc.currentRoomMc.hotdogMc;
if (hotdogCollected) {
hotdogMc._visible = false;
} else {
hotdogMc._visible = true;
if (current_level == 4) {
if (current_level_part == 4) {
hotdogMc.onPress = function () {
setInInventory("hotdogMc");
};
}
}
}
spoonMc = gameMc.currentRoomMc.spoonMc;
if (spoonCollected) {
} else {
spoonMc._visible = true;
if (current_level == 1) {
if (current_level_part == 2) {
if (openTinCollected == true) {
spoonMc.onPress = spoonFn;
}
}
}
}
toMainMallBtn = gameMc.toMainMallBtn;
toMainMallBtn.onPress = function () {
setCurrentRoom("MAIN_MALL");
};
travelButtons.push(toMainMallBtn);
fruitBreakTinMc = gameMc.currentRoomMc.fruitBreakTinMc;
if (fruitBreakTinCollected) {
fruitBreakTinMc._visible = false;
} else {
fruitBreakTinMc._visible = true;
if (current_level == 1) {
if (current_level_part == 2) {
fruitBreakTinMc.onPress = function () {
setInInventory("fruitBreakTinMc");
};
}
}
}
break;
case "APPLIANCE_STORE" :
tinOpenerMc = gameMc.currentRoomMc.tinOpenerMc;
if (tinOpenerCollected == false) {
tinOpenerMc._visible = true;
} else {
tinOpenerMc._visible = false;
}
toMainMallBtn = gameMc.toMainMallBtn;
toMainMallBtn.onPress = function () {
setCurrentRoom("MAIN_MALL");
};
travelButtons.push(toMainMallBtn);
shelfMc = gameMc.shelfMc;
shelfMc.onPress = shelfMcFn;
travelButtons.push(shelfMc);
backBtn = gameMc.backBtn;
backBtn._visible = false;
break;
case "APPLIANCE_SHELF" :
tinOpenerMc = gameMc.shelfMc.currentRoomMc.tinOpenerMc;
backBtn._visible = true;
if (tinOpenerCollected == false) {
tinOpenerMc._visible = true;
if (current_level == 1) {
if (current_level_part == 2) {
tinOpenerMc.onPress = function () {
setInInventory("tinOpenerMc");
};
}
}
} else {
tinOpenerMc._visible = false;
}
backBtn.onPress = function () {
whooshSndStart();
gameMc.currentRoomMc._visible = true;
shelfMc.gotoAndPlay("ZOOM_OUT");
gameState = "SHELF_ZOOM_OUT_ANIM";
backBtn._visible = false;
};
travelButtons.push(backBtn);
}
}
function checkCandyAction() {
if (candyCollected == false) {
candyMc._visible = true;
if ((current_level == 3) && (current_level_part == 1)) {
candyMc.onPress = function () {
setInInventory("candyMc");
};
}
} else {
candyMc._visible = false;
}
}
function shelfMcFn() {
whooshSndStart();
toMainMallBtn._visible = false;
shelfMc.gotoAndPlay("ZOOM_IN");
gameState = "SHELF_ZOOM_ANIM";
delete shelfMc.onPress;
}
function kidZoneBtnFn() {
whooshSndStart();
toMainMallBtn._visible = false;
kidZoneMc.gotoAndPlay("ZOOM_IN");
gameState = "SHOP_ZOOM_ANIM";
delete kidZoneMc.onPress;
}
function showTravelButtons() {
doneBtn._visible = true;
for (t in travelButtons) {
travelButtons[t]._visible = true;
}
}
function hideTravelButtons() {
doneBtn._visible = false;
for (t in travelButtons) {
travelButtons[t]._visible = false;
}
}
function displayComment(passedComment) {
whooshSndStart();
commentVar = passedComment;
hideTravelButtons();
notepadMc.gotoAndPlay("COMMENT_SHOW");
gameState = "NOTEPAD_COMMENT_SHOW";
}
function displayNextTask() {
whooshSndStart();
if (!(current_level === 1)) {
} else if (!(current_level_part === 1)) {
} else {
babyMc.gotoAndStop("FOOD_WAIT");
}
notepadMc._visible = true;
current_level_part++;
hideTravelButtons();
notepadMc.gotoAndPlay("SHOW");
gameState = "NOTEPAD_TASK_SHOW";
}
function displayHelp() {
gameState = "HELP_DISPLAY";
hideTravelButtons();
notepadMc.gotoAndPlay("SHOW");
}
function dirtyDiaperChkFn() {
if ((current_level == 3) && (current_level_part == 3)) {
if (dirtyDiaperCollected == false) {
babyMc.onPress = function () {
if (gameState == "PLAYING") {
setInInventory("dirtyDiaperMc");
}
};
}
}
}
function continueGame() {
whooshSndStart();
notepadMc.gotoAndPlay("HIDE");
showTravelButtons();
dirtyDiaperChkFn();
if ((current_level == 4) && (current_level_part == 3)) {
cradleMc.onPress = cradleCloseFn;
}
gameState = "PLAYING";
}
function setCurrentInvBlk() {
allFull = false;
i = 0;
while (i < invArray.length) {
if (invArray[i][0] == 0) {
currentInvBlkMc = inventoryMc[("invBlock" + (i + 1)) + "Mc"];
currentInvBlkMc.invIndex = i + 1;
allFull = false;
return;
}
allFull = true;
i++;
}
}
function resetInvBlocks() {
bagItems = ["Sippy Cup", "Ear Plug", "Money", "Jacket", "Clean Nappy", "Keys"];
earPlugCollected = false;
earPlugSelected = false;
jacketCollected = false;
jacketSelected = false;
cleanDiaperCollected = false;
cleanDiaperSelected = false;
jacketCollected = false;
jacketSelected = false;
invArray = [];
i = 1;
while (i < 6) {
inventoryMc[("invBlock" + i) + "Mc"].gotoAndStop("BLANK");
inventoryMc[("invBlock" + i) + "Mc"].currentSelection = false;
invArray.push([0, i, 0]);
i++;
}
}
function giveToKid(toGiveItem) {
whooshSndStart();
totalItemsToFind--;
giveToChildAnimMc.gotoAndPlay(2);
giveToChildAnimMc.itemMc.gotoAndStop(toGiveItem);
this.gotoAndStop("BLANK");
hideTravelButtons();
notepadMc._visible = false;
gameState = "GIVING_TO_CHILD_ANIM";
delete this.onPress;
}
function removeInvItem(toRemoveItemName) {
shiftIndex = 0;
if (invArray.length > 5) {
toPop = true;
} else {
toPop = false;
}
e = 0;
while (e < invArray.length) {
if (invArray[e][0] == toRemoveItemName) {
invArray[e][0] = 0;
invArray[e][2] = 0;
inventoryMc[("invBlock" + invArray[e][1]) + "Mc"].gotoAndStop("BLANK");
shiftIndex = e + 1;
break;
}
e++;
}
j = shiftIndex;
while (j < invArray.length) {
currentItemName = invArray[j][0];
currentItemIndex = invArray[j][1];
currentItemSelection = invArray[j][2];
previousInvBlkMc = inventoryMc[("invBlock" + currentItemIndex) + "Mc"];
targetInvBlkMc = inventoryMc[("invBlock" + (currentItemIndex - 1)) + "Mc"];
targetInvBlkMc.itemName = currentItemName;
targetInvBlkMc.invIndex = currentItemIndex - 1;
targetInvBlkMc.currentSelection = currentItemSelection;
invArray[j - 1][0] = invArray[j][0];
invArray[j - 1][2] = invArray[j][2];
previousInvBlkMc.gotoAndStop("BLANK");
invArray[j][0] = 0;
invArray[j][2] = 0;
if (invArray[j - 1][0] == 0) {
targetInvBlkMc.gotoAndStop("BLANK");
}
invItemFn(targetInvBlkMc);
j++;
}
if (toPop) {
invArray.pop();
}
}
function setInInventory(passedName) {
if (gameState == "PLAYING") {
collectedSndStart();
switch (passedName) {
case "Sippy Cup" :
break;
case "fruitBreakTinMc" :
fruitBreakTinCollected = true;
fruitBreakTinMc._visible = false;
delete fruitBreakTinMc.onPress;
break;
case "tinOpenerMc" :
tinOpenerCollected = true;
tinOpenerMc._visible = false;
tinOpenerMc = gameMc.currentRoomMc.tinOpenerMc;
tinOpenerMc._visible = false;
delete tinOpenerMc.onPress;
break;
case "openTinMc" :
openTinCollected = true;
if (currentRoom == "FOOD_COURT") {
spoonMc.onPress = spoonFn;
}
break;
case "spoonMc" :
spoonCollected = true;
delete spoonMc.onPress;
break;
case "horseToyMc" :
horseCollected = true;
horseToyMc._visible = false;
horseToyMc = gameMc.currentRoomMc.horseToyMc;
horseToyMc._visible = false;
delete horseToyMc.onPress;
break;
case "candyMc" :
candyCollected = true;
candyMc._visible = false;
delete candyMc.onPress;
candyMc = gameMc.currentRoomMc.candyMc;
candyMc._visible = false;
break;
case "shoesMc" :
shoesCollected = true;
shoesMc._visible = false;
delete shoesMc.onPress;
shoesMc = gameMc.currentRoomMc.shoesMc;
shoesMc._visible = false;
break;
case "dirtyDiaperMc" :
dirtyDiaperCollected = true;
delete babyMc.onPress;
break;
case "Clean Nappy" :
cleanDiaperCollected = true;
break;
case "Jacket" :
jacketCollected = true;
break;
case "Ear Plug" :
earPlugCollected = true;
break;
case "hotdogMc" :
hotdogCollected = true;
hotdogMc._visible = false;
delete hotdogMc.onPress;
break;
case "sprayMc" :
bugSprayCollected = true;
sprayMc._visible = false;
sprayMc = gameMc.currentRoomMc.sprayMc;
sprayMc._visible = false;
}
insertInInvArray(passedName);
invItemFn(currentInvBlkMc);
if (invArray.length > 5) {
n = 0;
while (n < (invArray.length - 5)) {
shiftItemsLeft();
n++;
}
}
_root.partner_score = _root.partner_score + 500;
}
}
function insertInInvArray(passedInvItemName) {
insertionComplete = false;
i = 0;
while (i < invArray.length) {
if (invArray[i][0] == 0) {
invArray[i][0] = passedInvItemName;
invArray[i][2] = false;
currentInvBlkMc = inventoryMc[("invBlock" + (i + 1)) + "Mc"];
currentInvBlkMc.invIndex = i + 1;
insertionComplete = true;
break;
}
insertionComplete = false;
i++;
}
if (insertionComplete == false) {
temp = invArray.length + 1;
invArray.push([passedInvItemName, temp, false]);
currentInvBlkMc = inventoryMc[("invBlock" + temp) + "Mc"];
currentInvBlkMc.invIndex = temp;
}
currentInvBlkMc.itemName = passedInvItemName;
currentInvBlkMc.currentSelection = false;
}
function invItemFn(targetInvMc) {
targetInvMc.gotoAndStop(targetInvMc.itemName);
if (targetInvMc == undefined) {
delete targetInvMc.onPress;
} else if (targetInvMc.currentSelection == false) {
targetInvMc.onPress = function () {
if (gameState == "PLAYING") {
switch (targetInvMc.itemName) {
case "Sippy Cup" :
if ((current_level == 1) && (current_level_part == 1)) {
if (currentRoomName == "MAIN_MALL") {
giveToKid(targetInvMc.itemName);
removeInvItem("Sippy Cup");
} else {
displayComment("This cannot be use here.");
}
} else {
displayComment("This cannot be use here.");
}
break;
case "fruitBreakTinMc" :
fruitBreakTinInvMc = this;
if (tinOpenerCollected == false) {
displayComment("The food can needs an opener.");
} else {
tinOpenerSelected = true;
targetInvMc.currentMc.gotoAndStop("SELECTED");
collectedSndStart();
targetInvMc.currentSelection = true;
invArray[targetInvMc.invIndex - 1][2] = true;
checkFruitTinCombo();
delete this.onPress;
}
break;
case "tinOpenerMc" :
if (fruitBreakTinCollected == false) {
displayComment("This cannot be used now.");
} else {
fruitBreakTinSelected = true;
targetInvMc.currentMc.gotoAndStop("SELECTED");
collectedSndStart();
targetInvMc.currentSelection = true;
invArray[targetInvMc.invIndex - 1][2] = true;
checkFruitTinCombo();
delete this.onPress;
}
break;
case "openTinMc" :
if ((current_level == 1) && (current_level_part == 2)) {
if (spoonCollected) {
if (currentRoomName == "MAIN_MALL") {
openTinSelected = true;
targetInvMc.currentMc.gotoAndStop("SELECTED");
collectedSndStart();
targetInvMc.currentSelection = true;
invArray[targetInvMc.invIndex - 1][2] = true;
checkSpoonTinCombo();
delete this.onPress;
} else {
displayComment("This cannot be use here.");
}
} else {
displayComment("But you cannot feed the baby without a spoon.");
}
}
break;
case "spoonMc" :
if ((current_level == 1) && (current_level_part == 2)) {
if (openTinCollected) {
if (currentRoomName == "MAIN_MALL") {
spoonSelected = true;
targetInvMc.currentMc.gotoAndStop("SELECTED");
collectedSndStart();
targetInvMc.currentSelection = true;
invArray[targetInvMc.invIndex - 1][2] = true;
checkSpoonTinCombo();
delete this.onPress;
} else {
displayComment("This cannot be use here.");
}
} else {
displayComment("But you cannot feed the baby without a spoon.");
}
}
break;
case "Money" :
trace((((("current_level " + current_level) + " current_level_part ") + current_level_part) + " currentRoom ") + currentRoom);
if (((current_level == 2) && (current_level_part == 1)) && (currentRoom == "KID_ZONE")) {
targetInvMc.currentMc.gotoAndStop("SELECTED");
collectedSndStart();
targetInvMc.currentSelection = true;
invArray[targetInvMc.invIndex - 1][2] = true;
moneySelected = true;
delete this.onPress;
} else {
displayComment("This cannot be use here.");
}
break;
case "horseToyMc" :
if ((current_level == 2) && (current_level_part == 2)) {
if (currentRoomName == "MAIN_MALL") {
giveToKid(targetInvMc.itemName);
removeInvItem("horseToyMc");
} else {
displayComment("This cannot be used here.");
}
}
break;
case "candyMc" :
if ((current_level == 3) && (current_level_part == 1)) {
if (currentRoomName == "MAIN_MALL") {
giveToKid(targetInvMc.itemName);
removeInvItem("candyMc");
} else {
displayComment("This cannot be used here.");
}
}
break;
case "shoesMc" :
if ((current_level == 3) && (current_level_part == 2)) {
if (currentRoomName == "MAIN_MALL") {
giveToKid(targetInvMc.itemName);
removeInvItem("shoesMc");
} else {
displayComment("This cannot be used here.");
}
}
break;
case "dirtyDiaperMc" :
if ((current_level == 3) && (current_level_part == 3)) {
dirtyDiaperSelected = true;
targetInvMc.currentMc.gotoAndStop("SELECTED");
collectedSndStart();
targetInvMc.currentSelection = true;
invArray[targetInvMc.invIndex - 1][2] = true;
trashCanMc.onPress = trashCanFn;
delete this.onPress;
}
break;
case "Clean Nappy" :
if ((current_level == 3) && (current_level_part == 3)) {
if (dirtyDiaperThrown) {
if (currentRoomName == "MAIN_MALL") {
cleanDiaperSelected = true;
giveToKid(targetInvMc.itemName);
removeInvItem("Clean Nappy");
} else {
displayComment("This cannot be used here.");
}
} else {
displayComment("First throw the used diaper.");
}
} else {
displayComment("This cannot be used here. ");
}
break;
case "Jacket" :
if ((current_level == 4) && (current_level_part == 1)) {
firstwordsSndStop();
jacketSelected = true;
giveToKid(targetInvMc.itemName);
removeInvItem("Jacket");
} else {
displayComment("This cannot be used here.");
}
break;
case "Ear Plug" :
if ((current_level == 4) && (current_level_part == 2)) {
earPlugCollected = true;
giveToKid(targetInvMc.itemName);
removeInvItem("Ear Plug");
} else {
displayComment("This cannot be used here.");
}
break;
case "hotdogMc" :
eatSndStart();
hotdogInvMc = this;
hotDogEaten = true;
hideTravelButtons();
notepadMc._visible = false;
gameState = "HOT_DOG_DISAPPEAR";
delete this.onPress;
break;
case "sprayMc" :
if (currentRoomName == "MAIN_MALL") {
bugSpraySelected = true;
giveToKid(targetInvMc.itemName);
removeInvItem("sprayMc");
} else {
displayComment("This cannot be used here.");
}
break;
case "Keys" :
displayComment("This cannot be used here.");
}
}
};
} else if (targetInvMc.currentSelection == true) {
targetInvMc.currentMc.gotoAndStop("SELECTED");
delete targetInvMc.onPress;
}
}
function trashCanFn() {
removeInvItem("dirtyDiaperMc");
hideTravelButtons();
notepadMc._visible = false;
trashCanMc.gotoAndPlay("THROW_ANIM");
dirtyDiaperThrown = true;
gameState = "TRASH_THROW_ANIM";
delete trashCanMc.onPress;
}
function checkFruitTinCombo() {
if (fruitBreakTinSelected && (tinOpenerSelected)) {
createNewItem(["tinOpenerMc", "fruitBreakTinMc"], "openTinMc");
}
}
function checkSpoonTinCombo() {
if (openTinSelected && (spoonSelected)) {
giveToKid("openTinMc");
removeInvItem("openTinMc");
removeInvItem("spoonMc");
}
}
function spoonFn() {
setInInventory("spoonMc");
}
function mechanicalHorseFn() {
if (gameState == "PLAYING") {
if (moneySelected) {
coinInsertSndStart();
mechanicalHorseMc.gotoAndStop("PLAYING");
timer = 60;
removeInvItem("Money");
hideTravelButtons();
notepadMc._visible = false;
gameState = "HORSE_PLAYING";
delete mechanicalHorseMc.onPress;
} else {
displayComment("But you need some money to make it play.");
}
}
}
function createNewItem(passedElementsArray, passedItemName) {
newItemName = passedItemName;
invIndexTofade = [];
for (e in passedElementsArray) {
for (f in invArray) {
if (invArray[f][0] == passedElementsArray[e]) {
invIndexTofade.push(Number(f) + 1);
}
}
}
hideTravelButtons();
alphaCounter = 100;
gameState = "FADING_ITEMS";
}
stop();
doneBtn._visible = false;
doneBtn.onPress = function () {
if (levelCompleted) {
laughSndStop();
inventoryMc._visible = false;
doneBtn._visible = false;
_root.partner_score = _root.partner_score + 5000;
if (current_level < 4) {
stopAllSounds();
gameLoopStop();
endS.start(0, 999);
laughSndStart();
gameMc.gotoAndStop("LEVEL_COMPLETE");
} else {
stopAllSounds();
gameLoopStop();
endS.start(0, 999);
gameMc.gotoAndStop("GAME_COMPLETE");
}
delete onEnterFrame;
} else {
gameOverAction();
}
};
restartGame();
gameLoopStart();
Frame 49
gotoAndStop ("lblgame");
Symbol 952 MovieClip Frame 1
function brain() {
create_assets(myself, _global.obj_iads.type);
switch (_global.obj_iads.type) {
case "FULL" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main);
break;
case "EMBED" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main.trgt_ads);
if (_global.obj_iads.link ne undefined) {
trgt_main.onRelease = function () {
getURL (_global.obj_iads.link, "_blank");
};
}
break;
case "NOOP" :
clearInterval(int1);
_root.play();
break;
}
}
function get_iads() {
lv_iads = new XML();
lv_result = new XML();
lv_result.ignoreWhite = true;
lv_result.onLoad = function (success) {
if (success) {
parse_iads(lv_result);
} else {
_root.play();
}
};
lv_iads.sendAndLoad(adurl, lv_result, "POST");
}
function parse_iads(lv_result) {
_global.obj_iads = new Array();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes.length) {
if (lv_result.firstChild.childNodes[_local2].firstChild.nodeValue != null) {
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = lv_result.firstChild.childNodes[_local2].firstChild.nodeValue;
} else if (lv_result.firstChild.childNodes[_local2].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local4 = 0;
while (_local4 < lv_result.firstChild.childNodes[_local2].childNodes.length) {
_local5[lv_result.firstChild.childNodes[_local2].childNodes[_local4].nodeName] = lv_result.firstChild.childNodes[_local2].childNodes[_local4].firstChild.nodeValue;
_local4++;
}
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = _local5;
}
_local2++;
}
show_time = int(_global.obj_iads.t);
check_type();
}
function time_delay() {
tim = 0;
int1 = setInterval(timespam, 1000);
}
function timespam() {
tim++;
trace(tim);
if (tim == show_time) {
clearInterval(int1);
_root.play();
}
}
function create_assets(mc, _type) {
mc.createEmptyMovieClip("whitebg", 0);
whitebg.beginFill(16777215);
whitebg.moveTo(0, 0);
whitebg.lineTo(0, 0);
whitebg.lineTo(Stage.width, 0);
whitebg.lineTo(Stage.width, Stage.height + 20);
whitebg.lineTo(0, Stage.height + 20);
whitebg.endFill();
mc.createEmptyMovieClip("trgt_main", 4);
mcLoader = new MovieClipLoader();
mcLoader.addListener(mc);
if (_type != "FULL") {
mc.createEmptyMovieClip("square_mc", 5);
var _local4 = trgt_main.createEmptyMovieClip("trgt_ads", getNextHighestDepth());
var _local3 = new TextFormat();
_local3.align = "center";
_local3.font = "Verdana";
_local3.size = 10;
var _local2 = new TextFormat();
_local2.align = "right";
_local2.font = "Verdana";
_local2.size = 10;
_local2.underline = true;
mc.createTextField("h_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("b_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("m_txt", mc.getNextHighestDepth(), 0, 0, 120, 22);
b_txt.autoSize = true;
m_txt.autoSize = true;
b_txt.selectable = false;
h_txt.selectable = false;
m_txt.selectable = false;
m_txt.html = true;
b_txt.multiline = true;
b_txt.setNewTextFormat(_local3);
h_txt.autoSize = true;
h_txt.setNewTextFormat(_local3);
m_txt.setNewTextFormat(_local2);
h_txt.text = "";
mc.createEmptyMovieClip("progressBar", 500);
}
}
function onLoadInit(mc) {
ad_width = int(_global.obj_iads.x);
ad_height = int(_global.obj_iads.y);
h_txt.text = "Advertisement";
loadMessages();
progressBar.tim = show_time;
progressBar.width = _global.obj_iads.x;
progressBar.height = 15;
progressBar.start = function () {
game_fps = getFps();
maxw = this.width - 2;
this.ad = maxw / (this.tim + 1);
this.ad = this.ad / game_fps;
};
progressBar.onEnterFrame = function () {
if (this.bar._width < (this.width - 2)) {
this.bar._width = this.bar._width + this.ad;
} else {
this.bar._width = this.width;
}
};
progressBar._x = 100;
progressBar._y = 100;
bar_mc = progressBar.createEmptyMovieClip("bar", 1);
box_mc = progressBar.createEmptyMovieClip("box", 2);
bar_mc.beginFill(26112);
bar_mc.moveTo(0, 0);
bar_mc.lineTo(1, 0);
bar_mc.lineTo(1, progressBar.height - 2);
bar_mc.lineTo(0, progressBar.height - 2);
bar_mc.lineTo(0, 0);
bar_mc.endFill();
bar_mc._x = 1.5;
bar_mc._y = 1.5;
box_mc.lineStyle(1, 3355443, 100, true, "none", "round", "miter", 1);
box_mc.lineTo(progressBar.width, 0);
box_mc.lineTo(progressBar.width, progressBar.height);
box_mc.lineTo(0, progressBar.height);
box_mc.lineTo(0, 0);
box_mc._x = 0;
box_mc._y = 0;
progressBar.start();
b_txt.text = "Note\rClicking on the above Ad won't interrupt your game.\rAd link opens in a new window.";
myself._y = b_txt._y - 10;
x = (Stage.width / 2) - (ad_width / 2);
y = (Stage.height / 2) - (ad_height / 2);
mc._x = x;
mc._y = y;
h_txt._x = (x + (ad_width / 2)) - (h_txt._width / 2);
h_txt._y = y - 20;
progressBar._x = (x + (ad_width / 2)) - (progressBar._width / 2);
progressBar._y = (y + 5) + ad_height;
myself.invizi_logo.swapDepths(myself.getNextHighestDepth());
myself.invizi_logo._alpha = 100;
myself.invizi_logo._x = int(progressBar._x);
myself.invizi_logo._y = int(progressBar._y + progressBar._height) + 5;
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 3;
myself.invizi_logo.onRelease = function () {
getURL ("http://www.inviziads.com/index.html?utm_source=4_1&utm_medium=logo&utm_content=default&utm_campaign=invizi", "_blank");
};
b_txt._x = (x + (ad_width / 2)) - (b_txt._width / 2);
b_txt._y = progressBar._y + 38;
square_mc.beginFill(16711680);
square_mc.moveTo(0, 0);
square_mc.lineTo(ad_width, 0);
square_mc.lineTo(ad_width, ad_height);
square_mc.lineTo(0, ad_height);
square_mc.lineTo(0, 0);
square_mc.endFill();
square_mc._x = x;
square_mc._y = y;
trgt_main.setMask(square_mc);
}
function loadMessages() {
lv_messages = new XML();
lv_messages.ignoreWhite = true;
lv_messages.onLoad = function (success) {
if (success) {
totalNodes = lv_messages.firstChild.childNodes.length;
ran = Math.floor(Math.random() * totalNodes);
if (lv_messages.firstChild.childNodes[ran].firstChild == undefined) {
m_txt.htmlText = "<font color='#0066CC'><a href='http://www.inviziads.com/adv-starter-pack.html' target='_blank'>Advertisers, try us out for US$250</a></font>";
} else {
m_txt.htmlText = ((("<font color='#0066CC'><a href='" + lv_messages.firstChild.childNodes[ran].attributes.link) + "' target='_blank'>") + lv_messages.firstChild.childNodes[ran].firstChild) + "</a></font>";
}
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 2;
} else {
m_txt.htmlText = "<font color='#0066CC'><a href='http://inviziads.com' target='_blank'>Advertisers, try us out for US$250</a></font>";
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 2;
}
};
lv_messages.load(messageURL);
}
function pushdata() {
holder.obj_iads = _global.obj_iads;
}
function startdatapush(mc) {
var _local2;
_local2 = setInterval(this, "pushdata", 10);
}
function check_type() {
if (_global.obj_iads.type eq "UPDATE") {
myself.createEmptyMovieClip("holder", 100);
var _local3 = _global.obj_iads.url;
obj_iads = _global.obj_iads;
var _local2 = new MovieClipLoader();
_local2.loadClip(_global.obj_iads.url, holder);
} else {
brain();
time_delay();
}
}
function parse_xml(mydata) {
var _local4 = new Array();
var _local1 = 0;
while (_local1 < mydata.firstChild.childNodes.length) {
if (mydata.firstChild.childNodes[_local1].firstChild.nodeValue != null) {
_local4[mydata.firstChild.childNodes[_local1].nodeName] = mydata.firstChild.childNodes[_local1].firstChild.nodeValue;
} else if (mydata.firstChild.childNodes[_local1].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes[_local1].childNodes.length) {
_local4[lv_result.firstChild.childNodes[_local1].childNodes[_local2].nodeName] = mydata.firstChild.childNodes[_local1].childNodes[_local2].firstChild.nodeValue;
_local2++;
}
_local4[lv_result.firstChild.childNodes[_local1].nodeName] = _local5;
}
_local1++;
}
return(_local4);
}
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
var time = 0;
var tim = 0;
var show_time = 0;
var tempo = 0;
var int1;
getFps = function () {
if (signal == true) {
time = getTimer();
} else {
tempo = int(1000 / (getTimer() - time));
}
signal = !signal;
return(tempo);
};
this.onEnterFrame = function () {
game_fps = getFps();
if ((game_fps != 0) && (game_fps != undefined)) {
this.onEnterFrame = null;
}
};
myself = this;
signal = true;
var purl = flash.external.ExternalInterface.call("document.URL.toString");
var hurl = escape(_root._url);
var adurl = "http://s1.inviziads.com/lookup.html?";
adurl = adurl + "g=1184";
adurl = adurl + "&h=g2w";
adurl = adurl + "&type=pre";
adurl = adurl + "&v=4_3";
adurl = adurl + ("&purl=" + escape(purl));
adurl = adurl + ("&hurl=" + hurl);
var my_date = new Date();
adurl = adurl + ("&ts=" + my_date.getSeconds());
var messageURL = "http://s1.inviziads.com/template/invizi_messages.xml";
get_iads();
_root.stop();
Symbol 5 MovieClip Frame 1
stop();
Symbol 5 MovieClip Frame 2
stop();
Symbol 35 MovieClip Frame 1
_root._trackClickThru(this);
Symbol 44 MovieClip Frame 1
function brain() {
create_assets(myself, _global.obj_iads.type);
switch (_global.obj_iads.type) {
case "FULL" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main);
break;
case "EMBED" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main.trgt_ads);
if (_global.obj_iads.link ne undefined) {
trgt_main.onRelease = function () {
trace("_global.obj_iads.link " + _global.obj_iads.link);
getURL (_global.obj_iads.link, "_blank");
};
}
break;
case "NOOP" :
_parent._parent._visible = 0;
break;
}
}
function get_iads() {
lv_iads = new XML();
lv_result = new XML();
lv_result.ignoreWhite = true;
lv_result.onLoad = function (success) {
trace("success " + success);
if (success) {
parse_iads(lv_result);
myself.attachMovie("invizi_logo", "invizi_logo", this.getNextHighestDepth(), {_x:Stage.width - 120, _y:Stage.height - 20});
}
};
lv_iads.sendAndLoad(adurl, lv_result, "POST");
}
function parse_iads(lv_result) {
_global.obj_iads = new Array();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes.length) {
if (lv_result.firstChild.childNodes[_local2].firstChild.nodeValue != null) {
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = lv_result.firstChild.childNodes[_local2].firstChild.nodeValue;
} else if (lv_result.firstChild.childNodes[_local2].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local4 = 0;
while (_local4 < lv_result.firstChild.childNodes[_local2].childNodes.length) {
_local5[lv_result.firstChild.childNodes[_local2].childNodes[_local4].nodeName] = lv_result.firstChild.childNodes[_local2].childNodes[_local4].firstChild.nodeValue;
_local4++;
}
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = _local5;
}
_local2++;
}
show_time = int(_global.obj_iads.t);
check_type();
}
function create_assets(mc, _type) {
trace((("Create _ assets " + mc) + " ") + _type);
mc.createEmptyMovieClip("trgt_main", 4);
mcLoader = new MovieClipLoader();
mcLoader.addListener(mc);
if (_type != "FULL") {
mc.createEmptyMovieClip("square_mc", 5);
var _local4 = trgt_main.createEmptyMovieClip("trgt_ads", getNextHighestDepth());
var _local2 = new TextFormat();
_local2.align = "center";
_local2.font = "Verdana";
_local2.size = 10;
mc.createTextField("h_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("b_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
b_txt.autoSize = true;
b_txt.selectable = false;
h_txt.selectable = false;
b_txt.multiline = true;
b_txt.setNewTextFormat(_local2);
h_txt.autoSize = true;
h_txt.setNewTextFormat(_local2);
h_txt.text = "";
}
}
function onLoadInit(mc) {
ad_width = int(_global.obj_iads.x);
ad_height = int(_global.obj_iads.y);
_x = ((336 - ad_width) / 2);
_y = ((280 - ad_height) / 2);
progressBar.tim = show_time;
progressBar.width = _global.obj_iads.x;
progressBar.height = 15;
progressBar.start = function () {
maxw = this.width - 2;
this.ad = maxw / (this.tim + 1);
this.ad = this.ad / game_fps;
};
progressBar.onEnterFrame = function () {
if (this.bar._width < (this.width - 2)) {
this.bar._width = this.bar._width + this.ad;
} else {
this.bar._width = this.width;
}
};
progressBar._x = 100;
progressBar._y = 100;
bar_mc = progressBar.createEmptyMovieClip("bar", 1);
box_mc = progressBar.createEmptyMovieClip("box", 2);
bar_mc.beginFill(26112);
bar_mc.moveTo(0, 0);
bar_mc.lineTo(1, 0);
bar_mc.lineTo(1, progressBar.height - 2);
bar_mc.lineTo(0, progressBar.height - 2);
bar_mc.lineTo(0, 0);
bar_mc.endFill();
bar_mc._x = 1.5;
bar_mc._y = 1.5;
box_mc.lineStyle(1, 3355443, 100, true, "none", "round", "miter", 1);
box_mc.lineTo(progressBar.width, 0);
box_mc.lineTo(progressBar.width, progressBar.height);
box_mc.lineTo(0, progressBar.height);
box_mc.lineTo(0, 0);
box_mc._x = 0;
box_mc._y = 0;
progressBar.start();
x = 0;
y = 0;
mc._x = x;
mc._y = y;
square_mc.beginFill(16711680);
square_mc.moveTo(0, 0);
square_mc.lineTo(ad_width, 0);
square_mc.lineTo(ad_width, ad_height);
square_mc.lineTo(0, ad_height);
square_mc.lineTo(0, 0);
square_mc.endFill();
square_mc._x = x;
square_mc._y = y;
trgt_main.setMask(square_mc);
}
function check_type() {
if (_global.obj_iads.type eq "UPDATE") {
this.createEmptyMovieClip("holder", 100);
var _local5 = _global.obj_iads.url;
_root.obj_iads = _global.obj_iads.payload;
holder.loadMovie(_global.obj_iads.url);
holder.obj_iads = _root.obj_iads;
show_time = 20;
} else {
if (((_global.obj_iads.htmlPostRoll != undefined) && (purl != null)) && (purl.indexOf("games2win.com") != -1)) {
trace(purl.indexOf("games2win.com") != -1);
var _local4 = flash.external.ExternalInterface.call("inviziShowHtmlPostRoll", _global.obj_iads.htmlPostRoll);
}
if (((_local4 != null) && (purl != null)) && (purl.indexOf("games2win.com") != -1)) {
this._parent._visible = false;
} else {
brain();
}
}
}
function parse_xml(mydata) {
var _local4 = new Array();
var _local1 = 0;
while (_local1 < mydata.firstChild.childNodes.length) {
if (mydata.firstChild.childNodes[_local1].firstChild.nodeValue != null) {
_local4[mydata.firstChild.childNodes[_local1].nodeName] = mydata.firstChild.childNodes[_local1].firstChild.nodeValue;
} else if (mydata.firstChild.childNodes[_local1].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes[_local1].childNodes.length) {
_local4[lv_result.firstChild.childNodes[_local1].childNodes[_local2].nodeName] = mydata.firstChild.childNodes[_local1].childNodes[_local2].firstChild.nodeValue;
_local2++;
}
_local4[lv_result.firstChild.childNodes[_local1].nodeName] = _local5;
}
_local1++;
}
return(_local4);
}
System.security.allowDomain("*");
this.getFps = function () {
if (signal == true) {
time = getTimer();
} else {
tempo = int(1000 / (getTimer() - time));
}
signal = !signal;
return(tempo);
};
this.onEnterFrame = function () {
game_fps = getFps();
if ((game_fps ne 0) and (game_fps ne undefined)) {
this.onEnterFrame = null;
}
};
myself = this;
signal = true;
var purl = flash.external.ExternalInterface.call("document.URL.toString");
var hurl = escape(_root._url);
adurl = _root.obj_game.inviziads;
adurl = adurl + "&type=post&v=2_0";
adurl = adurl + ("&purl=" + escape(purl));
adurl = adurl + ("&hurl=" + hurl);
adurl = adurl + ("&ts=" + getTimer());
trace(adurl);
get_iads();
stop();
Symbol 46 MovieClip Frame 1
invizi_logo.onRelease = function () {
getURL ("http://www.inviziads.com/", "_blank");
};
Symbol 57 Button
on (release) {
trace("CALLING : _root.g2w_playagain()");
_root.g2w_playagain();
}
Symbol 60 Button
on (release) {
trace("CALLING : _root.g2w_skiplevel()");
_root.g2w_skiplevel();
}
Symbol 61 MovieClip Frame 1
stop();
Symbol 78 MovieClip [_g2w_gameover_mc] Frame 1
stop();
_root._validateHost(this);
Symbol 78 MovieClip [_g2w_gameover_mc] Frame 2
stop();
Symbol 78 MovieClip [_g2w_gameover_mc] Frame 11
stop();
Symbol 78 MovieClip [_g2w_gameover_mc] Frame 20
stop();
Symbol 78 MovieClip [_g2w_gameover_mc] Frame 30
stop();
Symbol 78 MovieClip [_g2w_gameover_mc] Frame 41
stop();
Symbol 80 MovieClip [brain_inviziads] Frame 1
function brain() {
create_assets(myself, _global.obj_iads.type);
switch (_global.obj_iads.type) {
case "FULL" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main);
break;
case "EMBED" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main.trgt_ads);
if (_global.obj_iads.link ne undefined) {
trgt_main.onRelease = function () {
getURL (_global.obj_iads.link, "_blank");
};
}
break;
case "NOOP" :
clearInterval(int1);
_root.play();
break;
}
}
function get_iads() {
lv_iads = new XML();
lv_result = new XML();
lv_result.ignoreWhite = true;
lv_result.onLoad = function (success) {
if (success) {
parse_iads(lv_result);
} else {
_root.play();
}
};
lv_iads.g = game_id;
lv_iads.h = "as";
lv_iads.sendAndLoad(_root.adurl, lv_result, "POST");
}
function parse_iads(lv_result) {
_global.obj_iads = new Array();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes.length) {
if (lv_result.firstChild.childNodes[_local2].firstChild.nodeValue != null) {
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = lv_result.firstChild.childNodes[_local2].firstChild.nodeValue;
} else if (lv_result.firstChild.childNodes[_local2].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local4 = 0;
while (_local4 < lv_result.firstChild.childNodes[_local2].childNodes.length) {
_local5[lv_result.firstChild.childNodes[_local2].childNodes[_local4].nodeName] = lv_result.firstChild.childNodes[_local2].childNodes[_local4].firstChild.nodeValue;
_local4++;
}
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = _local5;
}
_local2++;
}
show_time = int(_global.obj_iads.t);
check_type();
}
function time_delay() {
tim = 0;
int1 = setInterval(timespam, 1000);
}
function timespam() {
tim++;
if (tim == show_time) {
clearInterval(int1);
_root.play();
}
}
function create_assets(mc, _type) {
mc.createEmptyMovieClip("whitebg", 0);
whitebg.beginFill(16777215);
whitebg.moveTo(0, 0);
whitebg.lineTo(0, 0);
whitebg.lineTo(Stage.width, 0);
whitebg.lineTo(Stage.width, Stage.height + 20);
whitebg.lineTo(0, Stage.height + 20);
whitebg.endFill();
mc.createEmptyMovieClip("trgt_main", 4);
mcLoader = new MovieClipLoader();
mcLoader.addListener(mc);
if (_type != "FULL") {
mc.createEmptyMovieClip("square_mc", 5);
var _local4 = trgt_main.createEmptyMovieClip("trgt_ads", getNextHighestDepth());
var _local3 = new TextFormat();
_local3.align = "center";
_local3.font = "Verdana";
_local3.size = 10;
var _local2 = new TextFormat();
_local2.align = "right";
_local2.font = "Verdana";
_local2.size = 10;
_local2.underline = true;
mc.createTextField("h_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("b_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("m_txt", mc.getNextHighestDepth(), 0, 0, 120, 22);
b_txt.autoSize = true;
m_txt.autoSize = true;
b_txt.selectable = false;
h_txt.selectable = false;
m_txt.selectable = false;
m_txt.html = true;
b_txt.multiline = true;
b_txt.setNewTextFormat(_local3);
h_txt.autoSize = true;
h_txt.setNewTextFormat(_local3);
m_txt.setNewTextFormat(_local2);
loadMessages();
h_txt.text = "";
mc.createEmptyMovieClip("progressBar", 500);
}
}
function onLoadInit(mc) {
ad_width = int(_global.obj_iads.x);
ad_height = int(_global.obj_iads.y);
h_txt.text = "Advertisement";
progressBar.tim = show_time;
progressBar.width = _global.obj_iads.x;
progressBar.height = 15;
progressBar.start = function () {
game_fps = getFps();
maxw = this.width - 2;
this.ad = maxw / (this.tim + 1);
this.ad = this.ad / game_fps;
};
progressBar.onEnterFrame = function () {
if (this.bar._width < (this.width - 2)) {
this.bar._width = this.bar._width + this.ad;
} else {
this.bar._width = this.width;
}
};
progressBar._x = 100;
progressBar._y = 100;
bar_mc = progressBar.createEmptyMovieClip("bar", 1);
box_mc = progressBar.createEmptyMovieClip("box", 2);
bar_mc.beginFill(26112);
bar_mc.moveTo(0, 0);
bar_mc.lineTo(1, 0);
bar_mc.lineTo(1, progressBar.height - 2);
bar_mc.lineTo(0, progressBar.height - 2);
bar_mc.lineTo(0, 0);
bar_mc.endFill();
bar_mc._x = 1.5;
bar_mc._y = 1.5;
box_mc.lineStyle(1, 3355443, 100, true, "none", "round", "miter", 1);
box_mc.lineTo(progressBar.width, 0);
box_mc.lineTo(progressBar.width, progressBar.height);
box_mc.lineTo(0, progressBar.height);
box_mc.lineTo(0, 0);
box_mc._x = 0;
box_mc._y = 0;
progressBar.start();
b_txt.text = "Note\rClicking on the above Ad won't interrupt your game.\rAd link opens in a new window.\rThanks to our sponsors, we provide you free games to play.";
myself._y = b_txt._y - 10;
x = (Stage.width / 2) - (ad_width / 2);
y = (Stage.height / 2) - (ad_height / 2);
mc._x = x;
mc._y = y;
h_txt._x = (x + (ad_width / 2)) - (h_txt._width / 2);
h_txt._y = y - 20;
progressBar._x = (x + (ad_width / 2)) - (progressBar._width / 2);
progressBar._y = (y + 5) + ad_height;
myself.attachMovie("invizi_logo", "invizi_logo", this.getNextHighestDepth() + 100);
myself.invizi_logo.swapDepths(myself.getNextHighestDepth());
myself.invizi_logo._x = int(progressBar._x);
myself.invizi_logo._y = int(progressBar._y + progressBar._height) + 5;
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 3;
myself.invizi_logo.onRelease = function () {
getURL ("http://www.inviziads.com", "_blank");
};
b_txt._x = (x + (ad_width / 2)) - (b_txt._width / 2);
b_txt._y = progressBar._y + 38;
square_mc.beginFill(16711680);
square_mc.moveTo(0, 0);
square_mc.lineTo(ad_width, 0);
square_mc.lineTo(ad_width, ad_height);
square_mc.lineTo(0, ad_height);
square_mc.lineTo(0, 0);
square_mc.endFill();
square_mc._x = x;
square_mc._y = y;
trgt_main.setMask(square_mc);
}
function loadMessages() {
lv_messages = new XML();
lv_messages.onLoad = function (success) {
if (success) {
totalNodes = lv_messages.firstChild.childNodes.length;
ran = Math.floor(Math.random() * totalNodes);
trace(lv_messages.firstChild);
if (lv_messages.firstChild.childNodes[ran].firstChild == undefined) {
m_txt.htmlText = "<font color='#ff0000'><a href='http://www.inviziads.com/adv-starter-pack.html' target='_blank'>Advertisers, try us out for US$250</a></font>";
} else {
m_txt.htmlText = ((("<font color='#ff0000'><a href='" + lv_messages.firstChild.childNodes[ran].attributes.link) + "' target='_blank'>") + lv_messages.firstChild.childNodes[ran].firstChild) + "</a></font>";
}
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 2;
} else {
m_txt.htmlText = "<font color='#ff0000'><a href='http://www.inviziads.com/adv-starter-pack.html' target='_blank'>Advertisers, try us out for US$250</a></font>";
m_txt._x = int(progressBar._x + progressBar._width) - m_txt._width;
m_txt._y = int(progressBar._y + progressBar._height) + 2;
}
};
lv_messages.load(_root.messageURL);
}
function pushdata() {
holder.obj_iads = _global.obj_iads;
}
function startdatapush(mc) {
var _local2;
_local2 = setInterval(this, "pushdata", 10);
}
function check_type() {
if (_global.obj_iads.type eq "UPDATE") {
myself.createEmptyMovieClip("holder", 100);
var _local4 = _global.obj_iads.url;
show_time = 15;
obj_iads = _global.obj_iads;
var _local2 = new Object();
_local2.onLoadComplete = function (target_mc) {
};
var _local3 = new MovieClipLoader();
_local3.addListener(_local2);
_local3.loadClip(_global.obj_iads.url, holder);
} else {
brain();
}
time_delay();
}
function parse_xml(mydata) {
var _local4 = new Array();
var _local1 = 0;
while (_local1 < mydata.firstChild.childNodes.length) {
if (mydata.firstChild.childNodes[_local1].firstChild.nodeValue != null) {
_local4[mydata.firstChild.childNodes[_local1].nodeName] = mydata.firstChild.childNodes[_local1].firstChild.nodeValue;
} else if (mydata.firstChild.childNodes[_local1].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes[_local1].childNodes.length) {
_local4[lv_result.firstChild.childNodes[_local1].childNodes[_local2].nodeName] = mydata.firstChild.childNodes[_local1].childNodes[_local2].firstChild.nodeValue;
_local2++;
}
_local4[lv_result.firstChild.childNodes[_local1].nodeName] = _local5;
}
_local1++;
}
return(_local4);
}
System.security.allowDomain("*");
getFps = function () {
if (signal == true) {
time = getTimer();
} else {
tempo = int(1000 / (getTimer() - time));
}
signal = !signal;
return(tempo);
};
this.onEnterFrame = function () {
game_fps = getFps();
if ((game_fps != 0) && (game_fps != undefined)) {
this.onEnterFrame = null;
}
};
myself = this;
signal = true;
if (_root.checkhost() == false) {
_root.stop();
var my_date = new Date();
_root.adurl = (_root.obj_game.inviziads + "&type=pre&ts=") + my_date.getSeconds();
_root.messageURL = "http://s1.inviziads.com/template/invizi_messages.xml";
get_iads();
} else {
_root.play();
}
Symbol 88 MovieClip [game_sound_ctrl] Frame 1
_gameSounds = new Sound();
var frame = "on";
changeVol = function (targetvol, step) {
this.onEnterFrame = function () {
var _local3 = _gameSounds.getVolume();
if ((step < 0) and (_local3 <= targetvol)) {
_local3 = targetvol;
delete this.onEnterFrame;
_root.so_sound = 1;
} else if ((step > 0) and (_local3 >= targetvol)) {
_local3 = targetvol;
delete this.onEnterFrame;
_root.so_sound = 0;
} else {
_gameSounds.setVolume(_local3 + step);
}
};
};
if (_root.so_sound == 1) {
frame = "off";
this.gotoAndPlay(frame);
}
this.onRelease = function () {
if (frame == "on") {
frame = "off";
} else {
frame = "on";
}
this.gotoAndPlay(frame);
};
Symbol 88 MovieClip [game_sound_ctrl] Frame 2
stop();
changeVol(100, 5);
Symbol 88 MovieClip [game_sound_ctrl] Frame 3
stop();
changeVol(0, -5);
Symbol 949 MovieClip [__Packages.it.sephiroth.XML2Object] Frame 0
class it.sephiroth.XML2Object
{
var oXML;
function XML2Object () {
}
function get xml() {
return(oXML);
}
function parseXML(sFile) {
oResult = new Object();
oXML = sFile;
oResult = translateXML();
return(oResult);
}
function translateXML(from, path, name, position) {
var _local2;
var _local9;
var _local4;
var _local10;
if (path == undefined) {
path = this;
name = "oResult";
}
path = path[name];
if (from == undefined) {
from = new XML(xml.toString());
from.ignoreWhite = true;
}
if (from.hasChildNodes()) {
_local9 = from.childNodes;
if (position != undefined) {
_local10 = path;
path = path[position];
}
while (_local9.length > 0) {
_local4 = _local9.shift();
_local2 = _local4.nodeName;
if (_local2 != undefined) {
var _local5 = new Object();
_local5.attributes = _local4.attributes;
_local5.data = _local4.firstChild.nodeValue;
if (position != undefined) {
_local10 = path;
}
if (path[_local2] != undefined) {
if (path[_local2].__proto__ == Array.prototype) {
path[_local2].push(_local5);
name = _local4.nodeName;
position = path[_local2].length - 1;
} else {
var _local8 = path[_local2];
path[_local2] = new Array();
path[_local2].push(_local8);
path[_local2].push(_local5);
name = _local2;
position = path[_local2].length - 1;
}
} else {
path[_local2] = _local5;
name = _local2;
position = undefined;
}
}
if (_local4.hasChildNodes()) {
translateXML(_local4, path, name, position);
}
}
}
return(oResult);
}
var oResult = new Object();
}
Symbol 129 MovieClip Frame 170
_root.gotoAndStop("lblloader");
Symbol 134 MovieClip Frame 58
stop();
Symbol 144 MovieClip Frame 117
stop();
_root.gotoAndStop("lblgameintro");
Symbol 158 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 20
stop();
Symbol 219 MovieClip Frame 5
stop();
Symbol 220 MovieClip Frame 19
stop();
Symbol 224 MovieClip Frame 1
this.cacheAsBitmap = true;
Symbol 275 MovieClip Frame 25
if (random(2) == 0) {
gotoAndPlay (10);
}
Symbol 318 MovieClip Frame 5
stop();
Symbol 342 MovieClip Frame 10
stop();
Symbol 348 MovieClip Frame 1
stop();
Symbol 349 MovieClip Frame 20
stop();
Symbol 383 MovieClip Frame 1
stop();
Symbol 387 MovieClip Frame 15
stop();
leftArrowMc.onPress = function () {
if (babyMc._currentframe == 1) {
babyMc.gotoAndStop(babyMc._totalframes);
} else {
babyMc.gotoAndStop(babyMc._currentframe - 1);
}
};
rightArrowMc.onPress = function () {
if (babyMc._currentframe == babyMc._totalframes) {
babyMc.gotoAndStop(1);
} else {
babyMc.gotoAndStop(babyMc._currentframe + 1);
}
};
Symbol 394 MovieClip Frame 14
stop();
this.gotoAndStop(this.destination);
trace(this.destination);
Symbol 398 MovieClip Frame 14
stop();
this.gotoAndStop(this.destination);
trace(this.destination);
Symbol 399 MovieClip Frame 58
stop();
started = false;
var press = 0;
startBtn.onPress = function () {
press++;
started = true;
gotoAndStop ("INSTRUCTIONS");
};
instructionsBtn.onPress = function () {
gotoAndStop ("INSTRUCTIONS");
};
storyBtn.onPress = function () {
gotoAndStop ("STORY");
};
Symbol 399 MovieClip Frame 59
dialogMc.destination = "INSTRUCTIONS";
dialogMc.gotoAndPlay(1);
var press = 0;
startBtn.onPress = function () {
gotoAndStop ("INSTRUCTIONS");
trace(press);
backBtn._visible = false;
if ((press == 0) && (started)) {
_root.gotoAndStop("lblgame");
}
if (press == 1) {
_root.gotoAndStop("lblgame");
}
press++;
};
instructionsBtn.onPress = function () {
gotoAndStop ("INSTRUCTIONS");
};
storyBtn.onPress = function () {
gotoAndStop ("STORY");
};
if (!started) {
backBtn.onPress = function () {
gotoAndStop ("MENU");
};
} else {
backBtn._visible = false;
}
Symbol 399 MovieClip Frame 71
dialogMc.destination = "STORY";
dialogMc.gotoAndPlay(1);
startBtn.onPress = function () {
press++;
started = true;
gotoAndStop ("INSTRUCTIONS");
};
instructionsBtn.onPress = function () {
gotoAndStop ("INSTRUCTIONS");
};
storyBtn.onPress = function () {
gotoAndStop ("STORY");
};
backBtn.onPress = function () {
gotoAndStop ("MENU");
};
Symbol 481 MovieClip Frame 5
stop();
Symbol 482 MovieClip Frame 32
stop();
Symbol 484 MovieClip Frame 32
stop();
Symbol 507 MovieClip Frame 19
stop();
Symbol 540 MovieClip Frame 11
_root.startSpraySnd();
Symbol 544 MovieClip Frame 49
stop();
Symbol 545 MovieClip Frame 1
stop();
Symbol 654 MovieClip Frame 1
stop();
Symbol 688 MovieClip Frame 1
if (_root.shoesCollected == false) {
shoesMc._visible = true;
} else {
shoesMc._visible = false;
}
if (_root.horseCollected == false) {
horseToyMc._visible = true;
} else {
horseToyMc._visible = false;
}
if (_root.bugSprayCollected == false) {
sprayMc._visible = true;
} else {
sprayMc._visible = false;
}
if (_root.candyCollected == false) {
candyMc._visible = true;
} else {
candyMc._visible = false;
}
Symbol 689 MovieClip Frame 1
stop();
Symbol 689 MovieClip Frame 20
stop();
trace("?");
Symbol 757 MovieClip Frame 1
stop();
Symbol 771 MovieClip Frame 1
if (_root.tinOpenerCollected) {
tinOpenerMc._visible = false;
} else {
tinOpenerMc._visible = true;
}
Symbol 772 MovieClip Frame 1
stop();
Instance of Symbol 771 MovieClip in Symbol 772 MovieClip Frame 28
/* no clip actions */
Symbol 785 MovieClip Frame 21
stop();
continueBtn.onPress = function () {
_root.nextLevel(_root.levelCompleted);
};
Symbol 802 MovieClip Frame 21
stop();
if (_root.current_level < 4) {
_root._doGameOver(_root.partner_score, "gameover", true, 3000);
} else {
_root._doGameOver(_root.partner_score, "gameover", false, 3000);
}
Symbol 807 MovieClip Frame 58
stop();
_root._doGameOver(_root.partner_score, "gamecomplete", false, 3000);
submitBtn.onPress = function () {
stopAllSounds();
_root.obj_game._gstatus = "gamecompleted";
_root.gameMc.gotoAndStop("lblgameover");
};
Symbol 810 MovieClip Frame 29
stop();
Symbol 819 MovieClip Frame 1
stop();
Symbol 820 MovieClip Frame 1
stop();
Symbol 828 MovieClip Frame 1
stop();
Symbol 834 MovieClip Frame 1
stop();
Symbol 840 MovieClip Frame 1
stop();
Symbol 841 MovieClip Frame 1
stop();
Symbol 844 MovieClip Frame 1
stop();
Symbol 867 MovieClip Frame 12
stop();
_root.updateBagItems();
Symbol 874 MovieClip Frame 10
stop();
Symbol 875 MovieClip Frame 110
stop();
Symbol 886 MovieClip Frame 1
this.gotoAndStop(_root.current_level_part);
Symbol 893 MovieClip Frame 1
this.gotoAndStop(_root.current_level_part);
Symbol 905 MovieClip Frame 1
this.gotoAndStop(_root.current_level_part);
Symbol 917 MovieClip Frame 1
this.gotoAndStop(_root.current_level_part);
Symbol 918 MovieClip Frame 1
gotoAndStop(_root.current_level);
Symbol 928 MovieClip Frame 112
stop();
Symbol 940 MovieClip Frame 26
stop();
Symbol 940 MovieClip Frame 37
stop();
helpBtn.onRelease = function () {
_root.displayHelp();
};
Symbol 940 MovieClip Frame 50
stop();
hideBtn.onRelease = function () {
_root.continueGame();
};
Symbol 940 MovieClip Frame 60
stop();
Symbol 941 MovieClip Frame 1
stop();
Symbol 941 MovieClip Frame 16
stop();
Symbol 948 MovieClip Frame 2
stop();