Frame 12
preloader_mc.sessionStart();
Frame 22
mainMenu_mc.startNewGame();
Frame 31
if (bakeryScreen_mc != undefined) {
bakeryScreen_mc.showMenu();
}
Frame 40
_global.sound.mute = true;
Frame 47
_global.sound.mute = false;
Frame 54
_global.cakeMania.showShopScreen();
Symbol 21 MovieClip [Preloader] Frame 1
#initclip 28
Object.registerClass("Preloader", classes.Preloader);
#endinitclip
init();
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 10
_global.cakeMania.processGoto();
Symbol 30 MovieClip Frame 18
this._visible = false;
Symbol 563 MovieClip [__Packages.classes.Preloader] Frame 0
class classes.Preloader extends MovieClip
{
var _parent, startingBytes, error_mc, progressBar_mc, phase, callMSZone, sandlotLogo_mc, data_xml, intermixPhase, finalDelayInterval, door_mc, createEmptyMovieClip, logo_mc;
function Preloader () {
super();
_parent.stop();
_global.cakeMania = new classes.CakeMania(_parent);
startingBytes = _root.getBytesLoaded();
error_mc._visible = false;
}
function init() {
progressBar_mc.stop();
phase = -1;
callMSZone = false;
sandlotLogo_mc._visible = false;
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.owner = this;
counter = 0;
data_xml.onLoad = function (success) {
this.owner.processLoadedXML(success);
};
if (_root.assetURL == undefined) {
data_xml.load("config.xml");
} else {
intermixPhase = 0;
data_xml.load(_root.assetURL + "/config.xml");
}
}
function loadingFinished() {
if (flashLoaded && (configLoaded)) {
if ((_global.external.loadingDelay != undefined) && (_global.external.loadingDelay > 0)) {
if (_global.external.MSZone) {
callMSZone = true;
fscommand ("SessionReady", "<data></data>");
} else {
createFinalInterval();
}
} else {
proceedToMainMenu();
}
}
}
function sessionStart() {
callMSZone = false;
createFinalInterval();
}
function createFinalInterval() {
finalDelayInterval = setInterval(function (link) {
clearInterval(link.finalDelayInterval);
link.proceedToMainMenu();
}, _global.external.loadingDelay, this);
}
function proceedToMainMenu() {
_global.cakeMania.goto("Main Menu");
}
function processLoadedXML(success, timeout) {
if (!success) {
if (intermixPhase == 0) {
intermixPhase = 1;
data_xml.load(_root.assetURL + "/config.xml");
} else {
configLoading = false;
if (timeout) {
error_mc.text_txt.text = "Error loading config file (connection timed out).";
} else {
error_mc.text_txt.text = "Error loading config file (file not found).";
}
error_mc._visible = true;
}
} else {
configLoading = false;
configLoaded = true;
parseConfigXML();
loadingFinished();
}
}
function displayProgress(currentProgress) {
door_mc._alpha = (1 - currentProgress) * 100;
progressBar_mc.gotoAndStop(Math.floor(currentProgress * (progressBar_mc._totalframes - 1)) + 1);
}
function onEnterFrame() {
if (configLoading) {
if (!callMSZone) {
counter++;
}
if (counter == maxCounter) {
processLoadedXML(false, true);
}
}
if (flashLoading && (!callMSZone)) {
var _local3 = (_root.getBytesLoaded() - startingBytes) / (_root.getBytesTotal() - startingBytes);
displayProgress(_local3);
if (_local3 >= 1) {
flashLoading = false;
flashLoaded = true;
loadingFinished();
}
}
}
function processLogo(data_xml) {
sandlotLogo_mc._visible = true;
createEmptyMovieClip("logo_mc", 1);
var _local4 = 0;
while (_local4 < data_xml.childNodes.length) {
var _local3 = data_xml.childNodes[_local4];
if (_local3.nodeName == "logo") {
logo_mc._x = Number(_local3.attributes.x);
logo_mc._y = Number(_local3.attributes.y);
if (_root.assetURL == undefined) {
logo_mc.loadMovie(_local3.attributes.src);
} else {
logo_mc.loadMovie((_root.assetURL + "/") + _local3.attributes.src);
}
}
if (_local3.nodeName == "sandlotlogo") {
sandlotLogo_mc._x = Number(_local3.attributes.x);
sandlotLogo_mc._y = Number(_local3.attributes.y);
}
_local4++;
}
}
function parseConfigXML() {
parseConfig(data_xml);
if (_global.external.MSZone) {
callMSZone = true;
fscommand ("SessionReady", "<data></data>");
}
}
function parseConfig(data_xml) {
var _local5 = 0;
while (_local5 < data_xml.firstChild.childNodes.length) {
var _local4 = data_xml.firstChild.childNodes[_local5];
if (_local4.nodeName == "Game") {
_global.external = new Object();
var _local3 = 0;
while (_local3 < _local4.childNodes.length) {
switch (_local4.childNodes[_local3].nodeName) {
case "MSZone" :
_global.external.MSZone = ((_local4.childNodes[_local3].firstChild.nodeValue == "1") ? true : false);
break;
case "HelpButtonEnabled" :
_global.external.helpEnabled = ((_local4.childNodes[_local3].firstChild.nodeValue == "1") ? true : false);
break;
case "HelpURL" :
_global.external.helpLink = _local4.childNodes[_local3].firstChild.nodeValue;
break;
case "HelpWindow" :
_global.external.helpWindow = _local4.childNodes[_local3].firstChild.nodeValue;
break;
case "DownloadURL" :
_global.external.downloadLink = _local4.childNodes[_local3].firstChild.nodeValue;
break;
case "DownloadWindow" :
_global.external.downloadWindow = _local4.childNodes[_local3].firstChild.nodeValue;
break;
case "LoadingDelay" :
_global.external.loadingDelay = Number(_local4.childNodes[_local3].firstChild.nodeValue);
}
_local3++;
}
}
if (_local4.nodeName == "Logo") {
processLogo(_local4);
}
_local5++;
}
}
var counter = 0;
var maxCounter = 450;
var flashLoaded = false;
var configLoaded = false;
var flashLoading = true;
var configLoading = true;
}
Symbol 564 MovieClip [__Packages.classes.CakeMania] Frame 0
class classes.CakeMania
{
var root, labels, hud_mc, bakery_mc, data, nextLabel;
function CakeMania (rootLink) {
root = rootLink;
_global.sound = new Object();
_global.sound.mute = false;
_global.sound.fxVolume = 70;
_global.data = new Object();
_global.data.loading = true;
labels = new Object();
labels.Preloader = 1;
labels["Main Menu"] = 3;
labels.Tutorial = 4;
labels.Start = 5;
labels["Map Screen"] = 6;
labels["Bakery Screen"] = 7;
labels["Shop Screen"] = 8;
labels["Finish Screen"] = 9;
labels["GameOver Screen"] = 10;
labels.Preview = 11;
generateData();
Stage.showMenu = false;
Object.prototype.toString = function () {
var _local2 = "{";
for (var _local3 in this) {
_local2 = _local2 + (((_local3 + ":") + this[_local3]) + ",");
}
_local2 = _local2.slice(0, _local2.length - 1) + "}";
return(_local2);
};
_global.duplicateObject = function (obj) {
var _local1 = new Object();
var _local3 = new Object();
for (var _local4 in obj) {
_local1[_local4] = obj[_local4];
}
for (var _local4 in _local1) {
_local3[_local4] = _local1[_local4];
}
return(_local3);
};
root.transition_mc._visible = false;
root.transition_mc.blocker_btn.useHandCursor = false;
_global.setMouseCursor = function (type) {
_root.mouse_mc.gotoAndStop(type);
};
_root.mouse_mc.onEnterFrame = function () {
this._x = this._parent._xmouse;
this._y = this._parent._ymouse;
Mouse.hide();
};
_global.setMouseCursor(1);
}
function restartLevel() {
clearLevel();
goto("Map Screen");
}
function nextLevel() {
_global.gameData.level++;
newLevel();
if (_global.gameData.level == 6) {
_global.cakeMania.endGame();
goto("Finish Screen");
} else if (_global.external.MSZone) {
fscommand ("GameBreak", ("<data><breakpoint>" + _global.gameData.level) + "</breakpoint></data>");
goto("Shop Screen", "delay");
} else {
goto("Shop Screen");
}
}
function showShopScreen() {
}
function setHud(hudClip_mc) {
hud_mc = hudClip_mc;
updateHud();
}
function setBakery(bakeryClip_mc) {
bakery_mc = bakeryClip_mc;
}
function updateHud() {
var _local3 = 0;
while (_local3 < 4) {
hud_mc[("star" + String(_local3 + 1)) + "_mc"]._visible = _local3 < _global.gameData.lives;
_local3++;
}
hud_mc.month_txt.text = months[_global.gameData.level];
hud_mc.monthShadow_txt.text = months[_global.gameData.level];
hud_mc.cash_txt.text = "Cash:$" + String(_global.gameData.cash);
hud_mc.cashShadow_txt.text = "Cash:$" + String(_global.gameData.cash);
if (_global.gameData.cash < data.goals[_global.gameData.level]) {
hud_mc.goal_txt.text = "Baker Goal $" + data.goals[_global.gameData.level];
hud_mc.goalShadow_txt.text = "Baker Goal $" + data.goals[_global.gameData.level];
} else {
hud_mc.goal_txt.text = "Baker Goal Complete!";
hud_mc.goalShadow_txt.text = "Baker Goal Complete!";
}
_global.cakeMania.submitScore("ScoreBroadcast");
}
function goto(label, param) {
_global.setMouseCursor(1);
nextLabel = labels[label];
root.transition_mc._visible = true;
root.transition_mc.play();
}
function processGoto() {
if (!delayFlag) {
root.gotoAndStop(nextLabel);
}
}
function newGame() {
_global.gameData = new Object();
_global.gameData.level = 0;
_global.gameData.money = 0;
_global.gameData.lives = 4;
_global.gameData.cash = 0;
_global.gameData.timer = getTimer();
}
function clearLevel() {
_global.gameData.cash = 0;
_global.gameData.customersLost = 0;
_global.gameData.cakesServed = 0;
_global.gameData.cakesLost = 0;
_global.gameData.customersTips = 0;
_global.gameData.customerNum = 0;
}
function newLevel() {
_global.gameData.money = _global.gameData.money + _global.gameData.cash;
clearLevel();
}
function addCake(price, tip) {
if ((_global.gameData.cash < goal) && (((_global.gameData.cash + price) + tip) >= goal)) {
bakery_mc.playBakerGoal();
}
_global.gameData.cash = _global.gameData.cash + (price + tip);
_global.gameData.cakesServed = _global.gameData.cakesServed + price;
_global.gameData.customersTips = _global.gameData.customersTips + tip;
updateHud();
}
function trashCake(price) {
_global.gameData.cash = _global.gameData.cash - price;
if (_global.gameData.cash < 0) {
_global.gameData.cash = 0;
}
_global.gameData.cakesLost = _global.gameData.cakesLost + price;
updateHud();
}
function addLostCustomer() {
_global.gameData.cash = _global.gameData.cash - 60;
if (_global.gameData.cash < 0) {
_global.gameData.cash = 0;
}
_global.gameData.customersLost = _global.gameData.customersLost + 60;
updateHud();
}
function getInitObj(customerType, enabledFlag) {
var _local1 = new Object();
_local1.enabled = enabledFlag;
switch (customerType) {
case "delivery" :
_local1.startHearts = 5;
_local1.maxHearts = 5;
_local1.menu = 5;
_local1.menuHearts = 1;
_local1.patience = 25;
_local1.tip = 1;
break;
case "cupid" :
_local1.startHearts = 3;
_local1.maxHearts = 5;
_local1.menu = 5;
_local1.menuHearts = 1;
_local1.patience = 20;
_local1.tip = 1;
break;
case "granny" :
_local1.startHearts = 5;
_local1.maxHearts = 5;
_local1.menu = 5;
_local1.menuHearts = 1;
_local1.patience = 30;
_local1.patience = 10;
_local1.tip = 2;
break;
case "rabbit" :
_local1.startHearts = 4;
_local1.maxHearts = 5;
_local1.menu = 5;
_local1.menuHearts = 1;
_local1.patience = 20;
_local1.tip = 1;
break;
case "tutorial" :
_local1.startHearts = 2;
_local1.maxHearts = 5;
_local1.menu = 2;
_local1.menuHearts = 1;
_local1.patience = 1000000 /* 0x0F4240 */;
_local1.tip = 1;
}
return(_local1);
}
function get levelData() {
return(data.levels[_global.gameData.level]);
}
function get goal() {
return(data.goals[_global.gameData.level]);
}
function get description() {
return(data.desctiptions[_global.gameData.level]);
}
function get winText() {
return(data.winText[_global.gameData.level]);
}
function get loseText() {
return(data.loseText[_global.gameData.level]);
}
function download() {
if (_global.external.MSZone) {
fscommand ("CustomEvent", "<gamedata>CustomEvent</gamedata>");
} else {
_root.getURL(_global.external.downloadLink, _global.external.downloadWindow);
}
}
function help() {
if (!_global.external.MSZone) {
_root.getURL(_global.external.helpLink, _global.external.helpWindow);
}
}
function endGame() {
if (_global.external.MSZone) {
submitScore();
fscommand ("GameEnd", "<gamedata></gamedata>");
}
}
function submitScore(callName) {
if (callName == undefined) {
callName = "ScoreSubmit";
}
if (_global.external.MSZone) {
var _local4 = _global.gameData.money + _global.gameData.cash;
var _local2 = Math.floor((getTimer() - _global.gameData.timer) / 1000);
fscommand (callName, ((("<game><score>" + _local4) + "</score><time>") + _local2) + "</time></game>");
}
}
function generateData() {
data = new Object();
data.goals = [200, 250, 300, 400, 500, 600];
data.desctiptions = new Array();
data.desctiptions.push("JANUARY. What better way to ring in the New Year than with the Grand Opening of my bakery? For now, supermarket delivery men are the only customers, but I'm sure word will spread!");
data.desctiptions.push("FEBRUARY. Love is in the air, and sweet cakes are the perfect gift for sweethearts. But poor Cupid's working overtime, so he needs to be served ASAP!");
data.desctiptions.push("MARCH. Now we're cooking! I just bought a second oven hopefully this will help with the flood of customers we're getting!");
data.desctiptions.push("APRIL. Easter Bunnies look adorable, but Grampa says they always have short tempers. I'll need to rely on fast service, and maybe invest in a cupcake microwave.");
data.desctiptions.push("MAY. Bless Gran, she told all the little old ladies in her windsurfing club about our humble bakery. My new froster should help stem the tide of these new customers!");
data.desctiptions.push("JUNE. Business is Booming and all our previous customers are back in full force! Those Rabbits and Cupids are here and hungry!");
data.winText = new Array();
data.winText.push("That was... a piece of cake! It's a simple trick to keep an eye on the customers' hearts; fewer means I'd better serve them quick, and more means I can expect a good tip!");
data.winText.push("High-fives all around! We came through our first big holiday with flying colors!");
data.winText.push("While I'm waiting for a cake to bake or frost, there are lots of other things to do: hand out menus, collect cash, even deliver finished orders. By clicking on several of these, I can start on a whole string of jobs without wasting time!");
data.winText.push("The bunnies weren't so bad! So what if they're a little impatient, when they're so darn cute? They sure don't like it when you tell them that, though.");
data.winText.push("Gran's pals were a breeze to serve! So nice and patient, I'll even try and overlook them bringing their dogs into the shop...");
data.winText.push("We're doing great now! If I can handle crazy cupids and raving rabbits I can handle anything!");
data.loseText = new Array();
data.loseText.push("Yikes! Running a bakery is harder than I thought! I'll have to be a little faster on my feet. Meeting my Baker Goal is crucial if I'm to make enough to run the shop, plus put something away in the Evans Bakery Rescue Fund!");
data.loseText.push("Fudge, those cranky cherubs really set us back! I'll have to keep a close watch on their patience level.");
data.loseText.push("Hmmm. We came up a little short this month. Perhaps I'd better start looking into some equipment upgrades...");
data.loseText.push("Wow, Grampa wasn't kidding about those Easter Bunnies! If we're to keep them smiling and satisfied, we'll really have to hop to it! And maybe I'll tuck my lucky rabbit's foot out of sight, just for this month.");
data.loseText.push("Drat! We didn't make our Goal this month. Perhaps I should take Gran's advice and make sure not to make any wrong cakes!");
data.loseText.push("All those colorful customers got me a tad flustered! If I focus on one customer at a time I should be able to meet my sales goal.");
data.levels = new Array();
data.levels.push({types:["delivery", "delivery", "delivery", "delivery", "delivery", "delivery", "delivery", "delivery"], amount:8, times:[1, 10, 30, 10, 30, 10, 30, 10], maxCustomers:2});
data.levels.push({types:["delivery", "cupid", "delivery", "cupid", "delivery", "delivery", "cupid", "delivery", "delivery", "cupid"], amount:10, times:[1, 10, 30, 5, 10, 30, 5, 10, 30, 10], maxCustomers:3});
data.levels.push({types:["delivery", "delivery", "delivery", "delivery", "delivery", "delivery", "delivery", "delivery", "delivery", "delivery", "delivery"], amount:11, times:[1, 10, 10, 30, 10, 10, 30, 10, 10, 30, 5], maxCustomers:3});
data.levels.push({types:["delivery", "delivery", "rabbit", "delivery", "rabbit", "delivery", "delivery", "rabbit", "delivery", "rabbit", "delivery", "delivery", "rabbit", "delivery"], amount:14, times:[1, 5, 10, 10, 30, 5, 10, 10, 30, 5, 10, 5, 30, 5], maxCustomers:4});
data.levels.push({types:["granny", "delivery", "delivery", "granny", "delivery", "delivery", "granny", "granny", "delivery", "delivery", "granny", "delivery", "granny", "delivery", "delivery", "granny"], amount:16, times:[1, 10, 5, 10, 35, 5, 10, 10, 35, 5, 10, 5, 35, 5, 10, 5], maxCustomers:4});
data.levels.push({types:["delivery", "cupid", "delivery", "rabbit", "delivery", "cupid", "cupid", "delivery", "delivery", "delivery", "granny", "rabbit", "granny", "cupid", "granny", "delivery", "cupid", "granny", "delivery", "rabbit"], amount:20, times:[1, 5, 30, 10, 5, 10, 10, 10, 30, 5, 30, 10, 30, 30, 5, 5, 10, 10, 10, 10], maxCustomers:4});
}
var months = ["January", "February", "March", "April", "May", "June"];
var delayFlag = false;
}
Symbol 565 MovieClip [__Packages.classes.util.ToggleButton] Frame 0
class classes.util.ToggleButton extends MovieClip
{
var stop, listener, overSoundObj, hitSoundObj, text_txt, textValue, gotoAndStop, hintText, hintAppearDelay, _parent, hint_mc, hintDisplayDelay;
function ToggleButton () {
super();
(stop());// not popped
listener = new Object();
if (overSound != "") {
overSoundObj = new Sound(this);
overSoundObj.attachSound(overSound);
}
if (hitSound != "") {
hitSoundObj = new Sound(_root);
hitSoundObj.attachSound(hitSound);
}
text_txt.variable = "textValue";
}
function set text(value) {
textValue = value;
updateText();
//return(text);
}
function get text() {
return(textValue);
}
function updateText() {
if (textValue != undefined) {
text_txt.text = textValue;
} else {
text_txt.text = "";
}
}
function get selected() {
return(isSelected);
}
function set selected(value) {
isSelected = value;
if (!isEnabled) {
(gotoAndStop(disabledFrame));// not popped
} else if (isSelected) {
(gotoAndStop(selectedFrame));// not popped
} else if (isRollOver) {
(gotoAndStop(rollOverFrame));// not popped
} else {
(gotoAndStop(normalFrame));// not popped
}
//return(selected);
}
function get enabled() {
return(isEnabled);
}
function set enabled(value) {
isEnabled = value;
if (isEnabled) {
if (!isSelected) {
if (isRollOver) {
(gotoAndStop(rollOverFrame));// not popped
} else {
(gotoAndStop(normalFrame));// not popped
}
} else {
(gotoAndStop(selectedFrame));// not popped
}
} else {
isRollOver = false;
(gotoAndStop(disabledFrame));// not popped
}
//return(enabled);
}
function initHint() {
if (hintText == undefined) {
return(undefined);
}
if (_global.hint.startingDelay == 0) {
displayHint();
} else {
hintAppearDelay = setInterval(function (link_mc) {
link_mc.displayHint();
clearInterval(link_mc.hintAppearDelay);
}, _global.hint.startingDelay, this);
}
}
function displayHint() {
_parent.createEmptyMovieClip("hint_mc", _parent.getNextHighestDepth());
hint_mc = _parent.hint_mc;
hint_mc.attachMovie("hintBGLeft", "left_mc", 1);
hint_mc.attachMovie("hintBGCenter", "center_mc", 2);
hint_mc.attachMovie("hintBGRight", "right_mc", 3);
hint_mc.createTextField("text_txt", 4, 2, 2, 10, 20);
hint_mc.text_txt.embedFonts = true;
hint_mc.text_txt.autoSize = "left";
var _local3 = new TextFormat();
_local3.font = _global.hint.fontName;
_local3.size = _global.hint.fontSize;
hint_mc.text_txt.setNewTextFormat(_local3);
hint_mc.text_txt.text = hintText;
var _local4 = hint_mc.text_txt._width + 4;
hint_mc.center_mc._x = hint_mc.left_mc._x + hint_mc.left_mc._width;
hint_mc.center_mc._width = _local4 - (hint_mc.left_mc._width + hint_mc.right_mc._width);
hint_mc.right_mc._x = hint_mc.center_mc._x + hint_mc.center_mc._width;
hint_mc._x = ((_parent._xmouse >= hint_mc._width) ? (_parent._xmouse - hint_mc._width) : (_parent._xmouse));
hint_mc._y = _parent._ymouse - hint_mc._height;
hint_mc.onMouseMove = function () {
this._x = ((this._parent._xmouse >= this._width) ? (this._parent._xmouse - this._width) : (this._parent._xmouse));
this._y = this._parent._ymouse - this._height;
};
if (_global.hint.lifeTime > 0) {
hintDisplayDelay = setInterval(function (link_mc) {
link_mc.removeHint();
clearInterval(link_mc.hintDisplayDelay);
}, _global.hint.lifeTime, this);
}
}
function removeHint() {
hint_mc.removeMovieClip();
clearInterval(hintAppearDelay);
clearInterval(hintDisplayDelay);
}
function onRollOver() {
if (enabled && (!selected)) {
_global.setMouseCursor(2);
(gotoAndStop(rollOverFrame));// not popped
}
isRollOver = true;
if (enabled) {
if ((!_global.sound.mute) && (!mute)) {
if (overSound != "") {
overSoundObj.setVolume(_global.sound.fxVolume);
overSoundObj.start();
}
}
initHint();
callEventListener("rollOver");
}
}
function onRollOut() {
if (enabled && (!selected)) {
_global.setMouseCursor(1);
(gotoAndStop(normalFrame));// not popped
}
isRollOver = false;
if (enabled) {
removeHint();
callEventListener("rollOut");
}
}
function onDragOut() {
if (enabled && (!selected)) {
(gotoAndStop(normalFrame));// not popped
}
isRollOver = false;
if (enabled) {
removeHint();
callEventListener("rollOut");
}
}
function onPress() {
if (enabled && (!selected)) {
(gotoAndStop(pressFrame));// not popped
}
if (enabled) {
if ((!_global.sound.mute) && (!mute)) {
if (hitSound != "") {
hitSoundObj.setVolume(_global.sound.fxVolume);
hitSoundObj.start();
}
}
removeHint();
callEventListener("press");
_global.setMouseCursor(3);
}
}
function onRelease() {
if (enabled && (!selected)) {
if (isRollOver) {
(gotoAndStop(rollOverFrame));// not popped
} else {
(gotoAndStop(normalFrame));// not popped
}
}
if (enabled) {
callEventListener("release");
_global.setMouseCursor(2);
}
}
function onReleaseOutside() {
if (enabled && (!selected)) {
isRollOver = false;
(gotoAndStop(normalFrame));// not popped
}
if (enabled) {
_global.setMouseCursor(1);
}
}
function addEventListener(eventName, callFunction, callObject) {
listener[eventName] = new Object();
listener[eventName].func = callFunction;
listener[eventName].obj = callObject;
}
function callEventListener(eventName) {
if (listener[eventName] != undefined) {
var _local3 = {event:eventName, target:this, selected:selected};
listener[eventName].obj[listener[eventName].func].apply(listener[eventName].obj, [_local3]);
}
}
var isEnabled = true;
var isSelected = false;
var isRollOver = false;
var normalFrame = 1;
var rollOverFrame = 2;
var pressFrame = 3;
var selectedFrame = 4;
var disabledFrame = 5;
var hintBGLeft = "hintBGLeft";
var hintBGCenter = "hintBGCenter";
var hintBGRight = "hintBGRight";
var overSound = "";
var hitSound = "select";
var mute = false;
}
Symbol 566 MovieClip [__Packages.classes.util.ListenerMovieClip] Frame 0
class classes.util.ListenerMovieClip extends MovieClip
{
var listener, customParams;
function ListenerMovieClip () {
super();
listener = new Object();
customParams = new Array();
}
function addEventListener(eventName, callFunction, callObject) {
listener[eventName] = new Object();
listener[eventName].func = callFunction;
listener[eventName].obj = callObject;
}
function callEventListener(eventName, paramObj) {
if (listener[eventName] != undefined) {
var _local3 = {event:eventName, target:this};
var _local2 = 0;
while (_local2 < customParams.length) {
_local3[customParams[_local2]] = this[customParams[_local2]];
_local2++;
}
for (var _local5 in paramObj) {
_local3[_local5] = paramObj[_local5];
}
listener[eventName].obj[listener[eventName].func].apply(listener[eventName].obj, [_local3]);
}
}
}
Symbol 567 MovieClip [__Packages.classes.Customer] Frame 0
class classes.Customer extends classes.util.ListenerMovieClip
{
var menuSoundObj, cashSoundObj, arriveSoundObj, leaveBadSoundObj, leaveGoodSoundObj, happySoundObj, wrongCakeSoundObj, angrySoundObj, rollOverFlag, bubble_mc, customer_mc, money_mc, cake_mc, boxBottom_mc, _visible, enabled, hearts, pic_mc, status, startHearts, heartsInterval, patience, gotoAndStop, forceCake, attachMovie, interval, menuInterval, cakeInterval, frostingInterval, glowInterval, puffAngry_mc, _parent, _x, _y, glowValue, glowSign, glowDiff, maxHearts, menu, boxTop_mc, cakePrice, puffHappy_mc, tip;
function Customer () {
super();
menuSoundObj = new Sound(this);
menuSoundObj.attachSound(menuSound);
cashSoundObj = new Sound(_root);
cashSoundObj.attachSound(cashSound);
arriveSoundObj = new Sound(this);
arriveSoundObj.attachSound(arriveSound);
leaveBadSoundObj = new Sound(this);
leaveBadSoundObj.attachSound(leaveBadSound);
leaveGoodSoundObj = new Sound(this);
leaveGoodSoundObj.attachSound(leaveGoodSound);
happySoundObj = new Sound(this);
happySoundObj.attachSound(happySound);
wrongCakeSoundObj = new Sound(this);
wrongCakeSoundObj.attachSound(wrongCakeSound);
angrySoundObj = new Sound(this);
angrySoundObj.attachSound(angrySound);
rollOverFlag = false;
}
function init() {
bubble_mc.addEventListener("release", "bubblePressed", this);
customer_mc.addEventListener("release", "customerPressed", this);
bubble_mc.addEventListener("rollOver", "customerRollOver", this);
bubble_mc.addEventListener("rollOut", "customerRollOut", this);
customer_mc.addEventListener("rollOver", "customerRollOver", this);
customer_mc.addEventListener("rollOut", "customerRollOut", this);
money_mc.addEventListener("release", "moneyPressed", this);
customer_mc.mute = true;
bubble_mc.mute = true;
money_mc.mute = true;
bubble_mc._visible = false;
money_mc._visible = false;
cake_mc._visible = false;
boxBottom_mc._visible = false;
customer_mc.__set__enabled(true);
_visible = false;
if (enabled) {
initCustomer();
}
}
function customerRollOver() {
if (hearts == 1) {
return(undefined);
}
rollOverFlag = true;
setRollOverTransform();
}
function setRollOverTransform() {
var _local2 = new Color(pic_mc);
var _local3 = {ra:100, rb:100, ga:100, gb:100, ba:100, bb:70, aa:100, ab:0};
_local2.setTransform(_local3);
}
function checkRollOver() {
if (rollOverFlag) {
setRollOverTransform();
}
}
function customerRollOut() {
if (hearts == 1) {
return(undefined);
}
rollOverFlag = false;
var _local2 = new Color(pic_mc);
var _local3 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_local2.setTransform(_local3);
}
function initCustomer() {
if (!_global.sound.mute) {
arriveSoundObj.setVolume(_global.sound.fxVolume);
arriveSoundObj.start();
}
_visible = true;
enabled = true;
status = "new";
hearts = startHearts;
createHearts();
clearInterval(heartsInterval);
heartsInterval = setInterval(function (link) {
link.removeHeart();
}, patience * 1000, this);
(gotoAndStop(staticFrame));// not popped
}
function setForceCake(type, frosting) {
forceCake = new Object();
forceCake.type = type;
forceCake.frosting = frosting;
}
function createHearts(num) {
if (num == undefined) {
var _local2 = 0;
while (_local2 < hearts) {
var _local4 = attachMovie("Heart", ("heart" + _local2) + "_mc", _local2 + 5);
_local4._x = ((-_local2) * 5) - 10;
_local4._y = 10;
_local2++;
}
} else {
var _local4 = attachMovie("Heart", ("heart" + num) + "_mc", num + 5);
_local4._x = ((-num) * 5) - 10;
_local4._y = 10;
}
}
function removeHearts(num) {
if (num == undefined) {
var _local2 = 0;
while (_local2 < hearts) {
var _local3 = this[("heart" + _local2) + "_mc"];
_local3.removeMovieClip();
_local2++;
}
} else {
var _local3 = this[("heart" + num) + "_mc"];
_local3.removeMovieClip();
}
}
function removeHeart() {
hearts--;
removeHearts(hearts);
if (hearts == 1) {
(gotoAndStop(angryFrame));// not popped
if (!_global.sound.mute) {
angrySoundObj.setVolume(_global.sound.fxVolume);
angrySoundObj.start();
}
createGlow();
}
if (hearts == 0) {
(gotoAndStop(moneyFrame));// not popped
bubble_mc._visible = false;
cake_mc._visible = false;
status = "puff";
customer_mc.__set__enabled(false);
clearInterval(interval);
clearInterval(menuInterval);
clearInterval(cakeInterval);
clearInterval(frostingInterval);
clearInterval(heartsInterval);
clearInterval(glowInterval);
puffAngry_mc.play();
if (!_global.sound.mute) {
leaveBadSoundObj.setVolume(_global.sound.fxVolume);
leaveBadSoundObj.start();
}
}
}
function bubblePressed() {
if (status == "waiting") {
_parent.moveJill(_x + 160, _y + 90);
_parent.setJillAction(this, "checkCake", []);
} else {
_parent.moveJill(_x + 160, _y + 90);
}
}
function customerPressed() {
if (status == "new") {
_parent.moveJill(_x + 160, _y + 90);
_parent.setJillAction(this, "giveMenu", []);
} else if (status == "waiting") {
_parent.moveJill(_x + 160, _y + 90);
_parent.setJillAction(this, "checkCake", []);
} else {
_parent.moveJill(_x + 160, _y + 90);
}
}
function createGlow() {
glowValue = 0;
glowSign = 1;
glowDiff = 10;
glowInterval = setInterval(function (link) {
link.glowValue = link.glowValue + (link.glowDiff * link.glowSign);
if (link.glowValue == 100) {
link.glowSign = -1;
}
if (link.glowValue == 0) {
link.glowSign = 1;
}
link.setGlow(link.glowValue);
}, 50, this);
}
function setGlow(degree) {
var _local2 = new Color(pic_mc);
var _local3 = {ra:100, rb:200 * (degree / 100), ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_local2.setTransform(_local3);
}
function removeGlow() {
var _local2 = new Color(pic_mc);
var _local3 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
_local2.setTransform(_local3);
clearInterval(glowInterval);
delete glowInterval;
}
function giveMenu() {
if (status != "new") {
return(undefined);
}
if (!_global.sound.mute) {
menuSoundObj.setVolume(_global.sound.fxVolume);
menuSoundObj.start();
}
if (hearts == 1) {
(gotoAndStop("staticFrame"));// not popped
if (glowInterval != undefined) {
removeGlow();
}
}
hearts++;
if (hearts > maxHearts) {
hearts = maxHearts;
}
createHearts(hearts - 1);
status = "reading";
(gotoAndStop(readingFrame));// not popped
menuInterval = setInterval(function (link) {
link.finishReadingMenu();
clearInterval(link.menuInterval);
}, menu * 1000, this);
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
}
function finishReadingMenu() {
status = "waiting";
(gotoAndStop(staticFrame));// not popped
bubble_mc._visible = true;
cakeInterval = setInterval(function (link) {
link.showCake();
clearInterval(link.cakeInterval);
}, 500, this);
}
function showCake() {
var _local2 = ["Triangle", "Square", "Star", "Round"];
cake_mc._visible = true;
if (forceCake == undefined) {
cake_mc.setCake(_local2[Math.floor(Math.random() * _local2.length)]);
} else {
cake_mc.setCake(forceCake.type);
}
frostingInterval = setInterval(function (link) {
link.showFrosting();
clearInterval(link.frostingInterval);
}, 1000, this);
}
function showFrosting() {
var _local3 = ["Purple", "Chocolate", "Red", "Cream"];
if (forceCake == undefined) {
cake_mc.setFrosting(_local3[Math.floor(Math.random() * _local3.length)]);
} else {
cake_mc.setFrosting(forceCake.frosting);
}
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
}
function checkCake() {
var _local3 = _parent.getCurrentCake();
if (_local3 == undefined) {
return(undefined);
}
if (hearts == 0) {
return(undefined);
}
if ((_local3.cakeType == cake_mc.cakeType) && (_local3.cakeFrosting == cake_mc.cakeFrosting)) {
clearInterval(heartsInterval);
(gotoAndStop(happyFrame));// not popped
removeHearts();
boxTop_mc.play();
cake_mc._x = 97;
cake_mc._y = 29;
status = "puff";
customer_mc.__set__enabled(false);
bubble_mc._visible = false;
cakePrice = _local3.getPrice();
_parent.removeCake(true);
if (!_global.sound.mute) {
happySoundObj.setVolume(_global.sound.fxVolume);
happySoundObj.start();
}
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
} else if (!_global.sound.mute) {
wrongCakeSoundObj.setVolume(_global.sound.fxVolume);
wrongCakeSoundObj.start();
}
}
function happyAnimationDone() {
}
function endPuffHappy() {
(gotoAndStop(moneyFrame));// not popped
money_mc._visible = true;
}
function hideBoxBottom() {
boxBottom_mc._visible = false;
cake_mc._visible = false;
}
function showBoxBottom() {
boxBottom_mc._visible = true;
}
function cakePackingDone() {
(gotoAndStop(moneyFrame));// not popped
puffHappy_mc.play();
if (!_global.sound.mute) {
leaveGoodSoundObj.setVolume(_global.sound.fxVolume);
leaveGoodSoundObj.start();
}
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
}
function endPuffAngry() {
_parent.customerLeft(this);
}
function moneyPressed() {
_parent.moveJill(_x + 160, _y + 90);
_parent.setJillAction(this, "moneyTaken", []);
}
function moneyTaken() {
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
if (!_global.sound.mute) {
cashSoundObj.setVolume(_global.sound.fxVolume);
cashSoundObj.start();
}
money_mc._visible = false;
if (_parent._name != "tutorial_mc") {
var _local3 = cakePrice + (tip * hearts);
_parent.createFloatingText(_x + money_mc._x, _y + money_mc._y, "$" + String(_local3));
_global.cakeMania.addCake(cakePrice, tip * hearts);
}
_parent.customerServed(this);
}
var initFrame = 1;
var staticFrame = 2;
var readingFrame = 3;
var angryFrame = 4;
var happyFrame = 5;
var moneyFrame = 6;
var menuSound = "paper";
var cashSound = "cash";
var arriveSound = "customerarrives";
var leaveBadSound = "customerleavesunhappy";
var leaveGoodSound = "happyleaving";
var happySound = "happy";
var wrongCakeSound = "wrongcake";
var angrySound = "angry";
}
Symbol 568 MovieClip [__Packages.classes.Cake] Frame 0
class classes.Cake extends classes.util.ListenerMovieClip
{
var takeSoundObj, placeSoundObj, types, frostings, tray_mc, cakeType, cakeFrosting, __get__tray, stop, gotoAndStop, intervalData, _x, _y, interval, _parent, id, removeMovieClip;
function Cake () {
super();
takeSoundObj = new Sound(this);
takeSoundObj.attachSound(takeSound);
placeSoundObj = new Sound(this);
placeSoundObj.attachSound(placeSound);
types = new Object();
types.Triangle = 1;
types.Square = 2;
types.Star = 3;
types.Round = 4;
frostings = new Object();
frostings.Purple = 1;
frostings.Chocolate = 2;
frostings.Red = 3;
frostings.Cream = 4;
tray_mc._visible = false;
}
function getPrice() {
if (cakeType == undefined) {
return(0);
}
if ((cakeFrosting == undefined) || (cakeFrosting == 0)) {
return(15);
}
return(30);
}
function takeCake() {
if (!_global.sound.mute) {
takeSoundObj.setVolume(_global.sound.fxVolume);
takeSoundObj.start();
}
}
function placeCake() {
if (!_global.sound.mute) {
placeSoundObj.setVolume(_global.sound.fxVolume);
placeSoundObj.start();
}
}
function set tray(flag) {
tray_mc._visible = flag;
//return(__get__tray());
}
function init() {
if (cakeType != undefined) {
setCake(cakeType, cakeFrosting);
} else {
(stop());// not popped
}
}
function setCake(type, frosting) {
cakeType = type;
cakeFrosting = frosting;
var _local3 = (types[cakeType] - 1) * 5;
var _local2 = ((cakeFrosting == undefined) ? 0 : (frostings[cakeFrosting]));
(gotoAndStop((_local3 + _local2) + 2));// not popped
}
function setFrosting(frosting) {
cakeFrosting = frosting;
var _local3 = (types[cakeType] - 1) * 5;
var _local2 = ((cakeFrosting == undefined) ? 0 : (frostings[cakeFrosting]));
(gotoAndStop((_local3 + _local2) + 2));// not popped
}
function moveCake(startCoords, diffCoords, iterations, destroyFlag) {
intervalData = new Object();
intervalData.counter = 0;
intervalData.maxCounter = iterations;
intervalData.diffCoords = diffCoords;
intervalData.destroyFlag = destroyFlag;
_x = startCoords.x;
_y = startCoords.y;
interval = setInterval(function (link) {
link.intervalData.counter++;
link._x = link._x + link.intervalData.diffCoords.x;
link._y = link._y + link.intervalData.diffCoords.y;
if (link.intervalData.counter == link.intervalData.maxCounter) {
link.callEventListener("Moving Finished");
clearInterval(link.interval);
if (link.intervalData.destroyFlag) {
link.destroyCake();
}
}
}, 100, this);
}
function destroyCake() {
_parent.cakesList.removeItemByID(id);
removeMovieClip();
}
var takeSound = "pickup";
var placeSound = "placedown";
}
Symbol 569 MovieClip [__Packages.classes.SliderBar] Frame 0
class classes.SliderBar extends MovieClip
{
var stop, gotoAndStop, _totalframes;
function SliderBar () {
super();
(stop());// not popped
}
function setValue(num) {
gotoAndStop(Math.floor((num * (_totalframes - 1)) + 1));
}
}
Symbol 570 MovieClip [__Packages.classes.MainMenu] Frame 0
class classes.MainMenu extends MovieClip
{
var sun_mc, sun2_mc, menuFrame, gotoAndStop, finishSoundObj, stop, download_mc, play_mc, options_mc, help_mc, back_mc, rollOverText, defaultText, hint_txt, slider_mc;
function MainMenu () {
super();
sun_mc.onEnterFrame = function () {
this._rotation = this._rotation - 2;
};
sun2_mc.onEnterFrame = function () {
this._rotation = this._rotation + 2;
};
if (_global.data.loading) {
_global.data.loading = false;
loadingFinished();
}
if (_global.external.helpEnabled) {
menuFrame = 1;
} else {
menuFrame = 2;
}
(gotoAndStop(menuFrame));// not popped
}
function loadingFinished() {
if (!_global.sound.mute) {
finishSoundObj = new Sound(this);
finishSoundObj.attachSound(finishSound);
finishSoundObj.setVolume(_global.sound.fxVolume);
finishSoundObj.start();
}
}
function init() {
(stop());// not popped
download_mc.__set__text("Download CakeMania");
play_mc.__set__text("Play");
options_mc.__set__text("Options");
help_mc.__set__text("Help");
back_mc.__set__text("Back");
help_mc.__set__enabled(_global.external.helpEnabled);
var _local5 = [download_mc, play_mc, options_mc, help_mc, back_mc];
var _local4 = 0;
while (_local4 < _local5.length) {
var _local3 = _local5[_local4];
_local3.addEventListener("release", "buttonEvent", this);
_local3.addEventListener("rollOver", "buttonEvent", this);
_local3.addEventListener("rollOut", "buttonEvent", this);
_local4++;
}
rollOverText = new Object();
rollOverText.download_mc = "Download CakeMania";
rollOverText.play_mc = "Play the Game";
rollOverText.options_mc = "Game options";
rollOverText.help_mc = "Game Help";
defaultText = "Cake Mania Main Menu";
hint_txt.text = defaultText;
slider_mc.setValue(_global.sound.fxVolume / 100);
slider_mc.onPress = function () {
_global.setMouseCursor(3);
this.drag = true;
};
slider_mc.onRelease = function () {
_global.setMouseCursor(2);
this.drag = false;
};
slider_mc.onRollOver = function () {
_global.setMouseCursor(2);
};
slider_mc.onRollOut = function () {
_global.setMouseCursor(1);
};
slider_mc.onReleaseOutside = function () {
_global.setMouseCursor(1);
this.drag = false;
};
slider_mc.onEnterFrame = function () {
if (this.drag) {
var _local3 = this._xmouse;
if (_local3 < 0) {
_local3 = 0;
}
if (_local3 > this._width) {
_local3 = this._width;
}
var _local4 = _local3 / this._width;
this.setValue(_local4);
_global.sound.fxVolume = Math.floor(_local4 * 100);
}
};
}
function buttonEvent(eventObj) {
if (eventObj.event == "release") {
if (eventObj.target == download_mc) {
_global.cakeMania.download();
}
if (eventObj.target == play_mc) {
if (_global.external.MSZone) {
fscommand ("GameReady", "<data></data>");
} else {
startNewGame();
}
}
if (eventObj.target == options_mc) {
(gotoAndStop(optionsFrame));// not popped
}
if (eventObj.target == help_mc) {
_global.cakeMania.help();
}
if (eventObj.target == back_mc) {
(gotoAndStop(menuFrame));// not popped
}
}
if (eventObj.event == "rollOver") {
hint_txt.text = rollOverText[eventObj.target._name];
}
if (eventObj.event == "rollOut") {
hint_txt.text = defaultText;
}
}
function startNewGame() {
_global.cakeMania.newGame();
_global.cakeMania.goto("Start");
}
var optionsFrame = 3;
var finishSound = "cakeready";
}
Symbol 571 MovieClip [__Packages.classes.util.RandomStartAnimation] Frame 0
class classes.util.RandomStartAnimation extends MovieClip
{
var gotoAndPlay, _totalframes;
function RandomStartAnimation () {
super();
(gotoAndPlay(Math.floor(Math.random() * _totalframes) + 1));// not popped
}
}
Symbol 572 MovieClip [__Packages.classes.TrashCan] Frame 0
class classes.TrashCan extends classes.util.ListenerMovieClip
{
var trashSoundObj, stop, trash_mc, check_mc, _parent, _x, _y;
function TrashCan () {
super();
trashSoundObj = new Sound(this);
trashSoundObj.attachSound(trashSound);
}
function init() {
(stop());// not popped
trash_mc.addEventListener("release", "buttonEvent", this);
trash_mc.mute = true;
check_mc._visible = false;
}
function removeCake() {
if (!_global.sound.mute) {
trashSoundObj.setVolume(_global.sound.fxVolume);
trashSoundObj.start();
}
_parent.trashCake(true);
}
function trashCake() {
_parent.trashCake();
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
}
function buttonEvent(eventObj) {
_parent.moveJill(_x - 20, _y + 60);
_parent.setJillAction(this, "trashCake", [], {x:_x + check_mc._x, y:_y + check_mc._y});
}
var trashSound = "trash";
}
Symbol 573 MovieClip [__Packages.classes.Jill] Frame 0
class classes.Jill extends classes.util.ListenerMovieClip
{
var stop, frames, cakeDepth, cakeid, _parent, tableBorders, jillDepthLine, track, moving, _x, _y, cakePlace_mc, gotoAndStop;
function Jill () {
super();
(stop());// not popped
frames = new Object();
frames.stat = 2;
frames.north = 3;
frames.south = 4;
frames.east = 5;
frames.west = 6;
frames.statCake = 7;
frames.northCake = 8;
frames.southCake = 9;
frames.eastCake = 10;
frames.westCake = 11;
cakeDepth = new Object();
cakeDepth.statCake = "above";
cakeDepth.northCake = "above";
cakeDepth.southCake = "above";
cakeDepth.eastCake = "above";
cakeDepth.westCake = "below";
cakeid = "";
var _local3 = _parent.table_mc.tableZone_mc;
var _local4 = _parent.table_mc._x + _local3._x;
var _local6 = _parent.table_mc._y + _local3._y;
var _local7 = (_parent.table_mc._x + _local3._x) + _local3._width;
var _local5 = (_parent.table_mc._y + _local3._y) + _local3._height;
tableBorders = new Array();
tableBorders.push({x1:_local4, y1:_local5, x2:_local4, y2:_local6, d:_local5 - _local6, type:"left"});
tableBorders.push({x1:_local4, y1:_local6, x2:_local7, y2:_local6, d:_local7 - _local4, type:"top"});
tableBorders.push({x1:_local7, y1:_local6, x2:_local7, y2:_local5, d:_local5 - _local6, type:"right"});
tableBorders.push({x1:_local7, y1:_local5, x2:_local4, y2:_local5, d:_local7 - _local4, type:"bottom"});
jillDepthLine = (_local6 + _local5) / 2;
}
function init() {
clearTrack();
}
function set cake(id) {
var _local2 = _parent.getCake(id);
if (cakeid != "") {
_parent.setCakeDepth(cakeid, "normal");
}
cakeid = id;
_local2.tray = cakeid != "";
displayAnimation("stat");
//return(cake);
}
function get cake() {
return(cakeid);
}
function onEnterFrame() {
if (track.length > 0) {
if (track[0].desc == "move") {
if (moving == false) {
moving = true;
displayAnimation(track[0].type);
}
var _local6 = _x;
var _local7 = _y;
var _local5 = track[0].dest.x;
var _local4 = track[0].dest.y;
var _local3 = _local6;
var _local2 = _local7;
if (_local6 != _local5) {
if (Math.abs(_local6 - _local5) < speed) {
_local3 = _local5;
} else if (_local6 < _local5) {
_local3 = _local3 + speed;
} else {
_local3 = _local3 - speed;
}
}
if (_local7 != _local4) {
if (Math.abs(_local7 - _local4) < speed) {
_local2 = _local4;
} else if (_local7 < _local4) {
_local2 = _local2 + speed;
} else {
_local2 = _local2 - speed;
}
}
_x = _local3;
_y = _local2;
if ((_local3 == _local5) && (_local2 == _local4)) {
track.shift();
if (track.length > 0) {
if (track[0].desc == "move") {
displayAnimation(track[0].type);
} else if (track[0].desc == "action") {
displayAnimation("stat");
}
} else {
moving = false;
displayAnimation("stat");
}
}
} else if (track[0].desc == "action") {
processJillAction(track.shift());
if (track.length > 0) {
if (track[0].desc == "move") {
displayAnimation(track[0].type);
} else if (track[0].desc == "action") {
displayAnimation("stat");
}
} else {
moving = false;
displayAnimation("stat");
}
updateChecks();
}
}
if (cakeid != "") {
var _local8 = _parent.getCake(cakeid);
_local8._x = _x + cakePlace_mc._x;
_local8._y = _y + cakePlace_mc._y;
}
if (_y < jillDepthLine) {
_parent.setTable("above");
} else {
_parent.setTable("below");
}
}
function processJillAction(actionObj) {
actionObj.obj[actionObj.func].apply(actionObj.obj, actionObj.paramList);
}
function displayAnimation(type) {
if (cakeid == "") {
(gotoAndStop(frames[type]));// not popped
} else {
_parent.setCakeDepth(cakeid, cakeDepth[type + "Cake"]);
(gotoAndStop(frames[type + "Cake"]));// not popped
}
}
function clearTrack(nostat) {
moving = false;
if (nostat != true) {
displayAnimation("stat");
}
track = new Array();
updateChecks();
}
function moveJill(fromX, fromY, toX, toY) {
var _local7 = fromX;
var _local8 = fromY;
var _local4 = toX - _local7;
var _local3 = toY - _local8;
if ((_local4 == 0) && (_local3 == 0)) {
return(undefined);
}
var _local2 = new Object();
_local2.desc = "move";
if (_local4 == 0) {
if (_local3 > 0) {
_local2.type = "south";
} else {
_local2.type = "north";
}
_local2.dest = {x:toX, y:toY};
track.push(_local2);
return(undefined);
}
if (_local3 == 0) {
if (_local4 > 0) {
_local2.type = "east";
} else {
_local2.type = "west";
}
_local2.dest = {x:toX, y:toY};
track.push(_local2);
return(undefined);
}
if (Math.abs(_local4) > (Math.abs(_local3) + 10)) {
if (_local4 > 0) {
_local2.type = "east";
} else {
_local2.type = "west";
}
} else if (_local3 > 0) {
_local2.type = "south";
} else {
_local2.type = "north";
}
_local2.dest = {x:toX, y:toY};
track.push(_local2);
}
function createTrack(toX, toY) {
var _local2 = new Array();
var _local4 = 0;
while (_local4 < track.length) {
if (track[_local4].desc == "move") {
_local2.push(track[_local4]);
}
_local4++;
}
if (_local2.length == 0) {
var _local5 = Math.floor(_x);
var _local6 = Math.floor(_y);
} else {
var _local13 = _local2.pop();
var _local5 = _local13.dest.x;
var _local6 = _local13.dest.y;
}
_local4 = 0;
while (_local4 < tableBorders.length) {
if ((tableBorders[_local4].x1 == tableBorders[_local4].x2) && (_local5 == tableBorders[_local4].x1)) {
if (tableBorders[_local4].type == "left") {
var _local5 = _local5 - 2;
}
if (tableBorders[_local4].type == "right") {
var _local5 = _local5 + 2;
}
}
if ((tableBorders[_local4].y1 == tableBorders[_local4].y2) && (_local6 == tableBorders[_local4].y1)) {
if (tableBorders[_local4].type == "top") {
var _local6 = _local6 - 2;
}
if (tableBorders[_local4].type == "bottom") {
var _local6 = _local6 + 2;
}
}
_local4++;
}
var _local10 = toX - _local5;
var _local9 = toY - _local6;
_local2 = new Array();
if (Math.abs(_local10) > Math.abs(_local9)) {
var _local17 = Math.abs(_local10) - Math.abs(_local9);
if (_local10 > 0) {
var _local15 = _local5 + _local17;
} else {
var _local15 = _local5 - _local17;
}
_local2.push({x1:_local5, y1:_local6, x2:_local15, y2:_local6});
_local2.push({x1:_local15, y1:_local6, x2:toX, y2:toY});
} else {
var _local16 = Math.abs(_local9) - Math.abs(_local10);
if (_local9 > 0) {
var _local14 = _local6 + _local16;
} else {
var _local14 = _local6 - _local16;
}
_local2.push({x1:_local5, y1:_local6, x2:_local5, y2:_local14});
_local2.push({x1:_local5, y1:_local14, x2:toX, y2:toY});
}
var _local7 = new Array();
_local4 = 0;
while (_local4 < _local2.length) {
var _local3 = _local2[_local4];
var _local8 = getIntersectionWithBox(_local3.x1, _local3.y1, _local3.x2, _local3.y2);
_local7 = _local7.concat(_local8);
_local4++;
}
if (_local7.length > 0) {
var _local20 = getTableRoute(_local7[0], _local7[1]);
var _local11 = _local2.shift();
_local11.x2 = _local7[0].x;
_local11.y2 = _local7[0].y;
var _local12 = _local2.pop();
_local12.x1 = _local7[1].x;
_local12.y1 = _local7[1].y;
_local2 = new Array();
_local2.push(_local11);
_local2 = _local2.concat(_local20);
_local2.push(_local12);
}
_local4 = 0;
while (_local4 < _local2.length) {
var _local3 = _local2[_local4];
moveJill(_local3.x1, _local3.y1, _local3.x2, _local3.y2);
_local4++;
}
}
function getTableRoute(startPoint, endPoint) {
var _local10 = new Array();
var _local3 = 0;
while (_local3 < tableBorders.length) {
var _local7 = checkPoint(startPoint, tableBorders[_local3]);
if (_local7 != undefined) {
var _local13 = _local3;
break;
}
_local3++;
}
if (_local7 == undefined) {
trace("Track error 1");
return(undefined);
}
var _local14 = false;
var _local5 = _local13;
_local10.push(_local7[1]);
var _local12 = _local7[1].d;
while (!_local14) {
_local5++;
if (_local5 == tableBorders.length) {
_local5 = 0;
}
var _local6 = checkPoint(endPoint, tableBorders[_local5]);
if (_local6 == undefined) {
_local10.push(_global.duplicateObject(tableBorders[_local5]));
_local12 = _local12 + tableBorders[_local5].d;
} else {
_local10.push(_local6[0]);
_local12 = _local12 + _local6[0].d;
_local14 = true;
}
}
var _local4 = new Array();
_local14 = false;
_local5 = _local13;
_local4.push(_local7[0]);
var _local11 = _local7[0].d;
while (!_local14) {
_local5--;
if (_local5 == -1) {
_local5 = tableBorders.length - 1;
}
var _local6 = checkPoint(endPoint, tableBorders[_local5]);
if (_local6 == undefined) {
_local4.push(_global.duplicateObject(tableBorders[_local5]));
_local11 = _local11 + tableBorders[_local5].d;
} else {
_local4.push(_local6[1]);
_local11 = _local11 + _local6[1].d;
_local14 = true;
}
}
_local3 = 0;
while (_local3 < _local4.length) {
var _local9 = _local4[_local3].x1;
var _local8 = _local4[_local3].y1;
_local4[_local3].x1 = _local4[_local3].x2;
_local4[_local3].y1 = _local4[_local3].y2;
_local4[_local3].x2 = _local9;
_local4[_local3].y2 = _local8;
_local3++;
}
if (_local12 < _local11) {
return(_local10);
}
return(_local4);
}
function setJillAction(obj, func, paramList, checkPos) {
var _local2 = new Object();
_local2.desc = "action";
_local2.obj = obj;
_local2.func = func;
_local2.paramList = paramList;
_local2.checkPos = checkPos;
track.push(_local2);
updateChecks();
}
function getIntersectionWithBox(x1, y1, x2, y2) {
var _local4 = new Array();
var _local2 = 0;
while (_local2 < tableBorders.length) {
var _local3 = checkIntersection({x:x1, y:y1}, {x:x2, y:y2}, {x:tableBorders[_local2].x1, y:tableBorders[_local2].y1}, {x:tableBorders[_local2].x2, y:tableBorders[_local2].y2});
if (_local3 != undefined) {
_local4.push(_local3);
}
_local2++;
}
if (_local4.length > 1) {
var _local12 = findDistance(x1, y1, _local4[0].x, _local4[0].y);
var _local11 = findDistance(x1, y1, _local4[1].x, _local4[1].y);
if (_local12 > _local11) {
_local4.reverse();
}
}
return(_local4);
}
function findDistance(x1, y1, x2, y2) {
var _local2 = x1 - x2;
var _local1 = y1 - y2;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
return(_local3);
}
function checkPoint(point1, line1) {
if ((line1.x1 == line1.x2) && (point1.x == line1.x1)) {
var _local3 = new Array();
_local3.push({x1:line1.x1, y1:line1.y1, x2:line1.x1, y2:point1.y, d:Math.abs(point1.y - line1.y1), type:line1.type});
_local3.push({x1:line1.x1, y1:point1.y, x2:line1.x1, y2:line1.y2, d:Math.abs(line1.y2 - point1.y), type:line1.type});
return(_local3);
}
if ((line1.y1 == line1.y2) && (point1.y == line1.y1)) {
var _local3 = new Array();
_local3.push({x1:line1.x1, y1:line1.y1, x2:point1.x, y2:line1.y1, d:Math.abs(point1.x - line1.x1), type:line1.type});
_local3.push({x1:point1.x, y1:line1.y1, x2:line1.x2, y2:line1.y1, d:Math.abs(line1.x2 - point1.x), type:line1.type});
return(_local3);
}
return(undefined);
}
function checkIntersection(a1, a2, b1, b2) {
var _local10 = 0.0001;
var _local5 = ((a1.x - a2.x) * (b2.y - b1.y)) - ((a1.y - a2.y) * (b2.x - b1.x));
var _local12 = ((a1.x - b1.x) * (b2.y - b1.y)) - ((a1.y - b1.y) * (b2.x - b1.x));
var _local11 = ((a1.x - a2.x) * (a1.y - b1.y)) - ((a1.y - a2.y) * (a1.x - b1.x));
if (Math.abs(_local5) < _local10) {
return(undefined);
}
var _local4 = _local12 / _local5;
var _local7 = _local11 / _local5;
if ((((0 <= _local4) && (_local4 <= 1)) && (0 <= _local7)) && (_local7 <= 1)) {
var _local9 = a1.x + (_local4 * (a2.x - a1.x));
var _local8 = a1.y + (_local4 * (a2.y - a1.y));
return({x:Math.round(_local9), y:Math.round(_local8)});
}
return(undefined);
}
function updateChecks() {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < track.length) {
if (track[_local2].desc == "action") {
if (track[_local2].checkPos != undefined) {
_local3.push(track[_local2].checkPos);
}
}
_local2++;
}
_parent.updateChecks(_local3);
}
var speed = 7;
}
Symbol 574 MovieClip [__Packages.classes.ReadyCircle] Frame 0
class classes.ReadyCircle extends classes.util.ListenerMovieClip
{
var stop, currentTime, finishTime, oldTime, timeInterval, breakPointInterval, callEventListener, gotoAndStop, _totalframes;
function ReadyCircle () {
super();
(stop());// not popped
}
function start(time, breakPoint) {
currentTime = 0;
finishTime = time;
oldTime = getTimer();
timeInterval = setInterval(function (link) {
link.processIteration();
}, timeDiff, this);
if (breakPoint != undefined) {
breakPointInterval = setInterval(function (link) {
link.processBreakpoint();
}, breakPoint, this);
}
}
function processIteration() {
var _local3 = getTimer();
var _local4 = _local3 - oldTime;
oldTime = _local3;
currentTime = currentTime + _local4;
var _local2 = currentTime / finishTime;
if (_local2 > 1) {
_local2 = 1;
}
if (_local2 == 1) {
clearInterval(timeInterval);
callEventListener("finish");
(gotoAndStop(1));// not popped
} else {
(gotoAndStop(2 + Math.floor((_totalframes - 2) * _local2)));// not popped
}
}
function processBreakpoint() {
clearInterval(breakPointInterval);
callEventListener("breakpoint");
}
var timeDiff = 50;
}
Symbol 575 MovieClip [__Packages.classes.CakeOven] Frame 0
class classes.CakeOven extends classes.util.ListenerMovieClip
{
var check0_mc, check1_mc, check2_mc, check3_mc, check4_mc, baking, trayBusy, cookingSoundObj, finishSoundObj, doorSoundObj, tray_mc, blocker_btn, buttonsByType, round_mc, square_mc, triangle_mc, star_mc, flame_mc, __get__flame, cakeOnTrayid, trayButton_mc, readyCircle_mc, door_mc, bakingCakeType, _parent, callEventListener, _x, _y, _xscale;
function CakeOven () {
super();
check0_mc._visible = false;
check1_mc._visible = false;
check2_mc._visible = false;
check3_mc._visible = false;
check4_mc._visible = false;
baking = false;
trayBusy = false;
cookingSoundObj = new Sound(this);
cookingSoundObj.attachSound(cookingSound);
finishSoundObj = new Sound(this);
finishSoundObj.attachSound(finishSound);
doorSoundObj = new Sound(tray_mc);
doorSoundObj.attachSound(doorSound);
blocker_btn.useHandCursor = false;
blocker_btn._visible = false;
setDoor("closed");
buttonsByType = new Object();
buttonsByType.Round = round_mc;
buttonsByType.Square = square_mc;
buttonsByType.Triangle = triangle_mc;
buttonsByType.Star = star_mc;
cakeOnTray = ("");
}
function set flame(clip_mc) {
flame_mc = clip_mc;
//return(__get__flame());
}
function set cakeOnTray(id) {
cakeOnTrayid = id;
//return(cakeOnTray);
}
function get cakeOnTray() {
return(cakeOnTrayid);
}
function get newCakeCoords() {
return({x:48, y:95});
}
function init() {
trayButton_mc.mute = true;
var _local4 = [round_mc, square_mc, triangle_mc, star_mc];
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local3.addEventListener("release", "buttonEvent", this);
_local3.mute = true;
_local2++;
}
readyCircle_mc.addEventListener("finish", "finishBaking", this);
readyCircle_mc.addEventListener("breakpoint", "clearTray", this);
trayButton_mc.addEventListener("release", "trayClick", this);
}
function openDoor() {
door_mc.gotoAndStop(2);
if (!_global.sound.mute) {
doorSoundObj.setVolume(_global.sound.fxVolume);
doorSoundObj.start();
}
}
function closeDoor() {
door_mc.gotoAndStop(1);
}
function setDoor(state) {
if (state == "open") {
openDoor();
} else {
closeDoor();
}
}
function bakeCake(type) {
if (baking) {
return(undefined);
}
baking = true;
bakingCakeType = type;
readyCircle_mc.start(6000, 4000);
buttonsByType[bakingCakeType].selected = true;
blocker_btn._visible = true;
if (!_global.sound.mute) {
cookingSoundObj.setVolume(_global.sound.fxVolume);
cookingSoundObj.start();
}
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
}
function clearTray() {
trayBusy = true;
if (cakeOnTray != "") {
tray_mc.play();
}
}
function burnCake() {
flame_mc.play();
var _local3 = _parent.cakesList.getItemByID(cakeOnTray);
_local3.moveCake(newCakeCoords(), {x:0, y:1}, 5, true);
cakeOnTray = ("");
var _local4 = _local3.getPrice();
_parent.createFloatingText(_local3._x, _local3._y, ("-" + String(_local4)) + "$");
_global.cakeMania.trashCake(_local4);
}
function finishBaking() {
baking = false;
trayBusy = false;
buttonsByType[bakingCakeType].selected = false;
callEventListener("Create Cake", {type:bakingCakeType});
if (!_global.sound.mute) {
cookingSoundObj.stop();
finishSoundObj.setVolume(_global.sound.fxVolume);
finishSoundObj.start();
}
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
}
}
function unlockButtons() {
blocker_btn._visible = false;
}
function buttonEvent(eventObj) {
_parent.moveJill(_x, _y + 155);
switch (eventObj.target) {
case triangle_mc :
var _local2 = check1_mc;
var _local3 = "Triangle";
break;
case square_mc :
_local2 = check2_mc;
_local3 = "Square";
break;
case star_mc :
_local2 = check3_mc;
_local3 = "Star";
break;
case round_mc :
_local2 = check4_mc;
_local3 = "Round";
}
_parent.setJillAction(this, "bakeCake", [_local3], {x:_x + ((_local2._x * _xscale) / 100), y:_y + _local2._y});
}
function trayClick() {
_parent.moveJill(_x, _y + 155);
var _local2 = _parent.getCurrentCake();
_parent.setJillAction(this, "cakeAction", [], {x:_x + check0_mc._x, y:_y + check0_mc._y});
}
function cakeAction() {
var _local2 = _parent.getCurrentCake();
if (_local2 == undefined) {
takeCake();
} else {
placeCake();
}
}
function placeCake() {
if (((cakeOnTray == "") && (_parent.getCurrentCake().type == "plain")) && (!trayBusy)) {
_parent.placeCake(_x + newCakeCoords.x, _y + newCakeCoords.y, "normal", this);
}
}
function takeCake() {
if (cakeOnTray != "") {
_parent.jillTakeCake(cakeOnTray, this);
}
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_parent.createTutorialCustomer();
_global.setMouseCursor(1);
_parent.tutorial_mc.ovenBlocker_btn._visible = true;
}
}
var cookingSound = "ovenrunning";
var finishSound = "cakeready";
var doorSound = "cakeovenopen";
}
Symbol 576 MovieClip [__Packages.classes.Froster] Frame 0
class classes.Froster extends classes.util.ListenerMovieClip
{
var check0_mc, check1_mc, check2_mc, check3_mc, check4_mc, blocker_btn, frostingNames, checkNames, inProgress, frostingSoundObj, trayButton_mc, purple_mc, red_mc, chocolate_mc, cream_mc, cakeOnTrayid, frostingsClip_mc, __get__frostings, _parent, _x, _y, frostingType;
function Froster () {
super();
check0_mc._visible = false;
check1_mc._visible = false;
check2_mc._visible = false;
check3_mc._visible = false;
check4_mc._visible = false;
blocker_btn.useHandCursor = false;
blocker_btn._visible = false;
frostingNames = new Object();
frostingNames.purple_mc = "Purple";
frostingNames.red_mc = "Red";
frostingNames.chocolate_mc = "Chocolate";
frostingNames.cream_mc = "Cream";
checkNames = new Object();
checkNames.cream_mc = check1_mc;
checkNames.chocolate_mc = check2_mc;
checkNames.red_mc = check3_mc;
checkNames.purple_mc = check4_mc;
inProgress = false;
frostingSoundObj = new Sound(this);
frostingSoundObj.attachSound(frostingSound);
}
function init() {
trayButton_mc.mute = true;
trayButton_mc.addEventListener("release", "trayClick", this);
var _local4 = [purple_mc, red_mc, chocolate_mc, cream_mc];
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local3.addEventListener("release", "buttonEvent", this);
_local3.mute = true;
_local2++;
}
cakeOnTrayid = "";
}
function set frostings(clip) {
frostingsClip_mc = clip;
frostingsClip_mc.readyCircle_mc.addEventListener("breakpoint", "endFrostingAnimation", this);
frostingsClip_mc.readyCircle_mc.addEventListener("finish", "finishFrosting", this);
//return(__get__frostings());
}
function set cakeOnTray(id) {
cakeOnTrayid = id;
//return(cakeOnTray);
}
function get cakeOnTray() {
return(cakeOnTrayid);
}
function trayClick(noCheck) {
_parent.moveJill(_x + 20, _y + 50);
if (noCheck == true) {
var _local2;
} else {
var _local2 = {x:_x + check0_mc._x, y:_y + check0_mc._y};
}
_parent.setJillAction(this, "cakeAction", [], _local2);
}
function cakeAction() {
var _local2 = _parent.getCurrentCake();
if (_local2 == undefined) {
takeCake();
} else {
placeCake();
}
}
function placeCake() {
if ((_parent.getCurrentCake().type == "plain") || (_parent.getCurrentCake().type == "frosting")) {
if (cakeOnTray == "") {
_parent.placeCake(_x + 50, _y + 18, "top", this);
}
}
}
function takeCake() {
if (cakeOnTray != "") {
if (!inProgress) {
_parent.jillTakeCake(cakeOnTray, this);
}
}
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
_parent.tutorial_mc.frosterBlocker_btn._visible = true;
}
}
function buttonEvent(eventObj) {
trayClick(true);
var _local2 = checkNames[eventObj.target._name];
_parent.setJillAction(this, "setFrosting", [frostingNames[eventObj.target._name]], {x:_x + _local2._x, y:_y + _local2._y});
}
function setFrosting(type) {
if (inProgress) {
return(undefined);
}
if (cakeOnTray == "") {
if (_parent.getCurrentCake() != undefined) {
if (_parent.getCurrentCake().type == "plain") {
_parent.placeCake(_x + 50, _y + 18, "top", this);
}
}
}
if (cakeOnTray != "") {
if (_parent.getCake(cakeOnTray).type == "plain") {
blocker_btn._visible = true;
frostingType = type;
frostingsClip_mc.startFrosting(type);
frostingsClip_mc.readyCircle_mc.start(6000, 5000);
inProgress = true;
if (!_global.sound.mute) {
frostingSoundObj.setVolume(_global.sound.fxVolume);
frostingSoundObj.start();
}
}
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
}
}
function frostingDone() {
if (_parent._name == "tutorial_mc") {
_parent.nextTutorialStep();
_global.setMouseCursor(1);
}
}
function endFrostingAnimation() {
_parent.getCake(cakeOnTray).setFrosting(frostingType);
frostingsClip_mc.endFrosting();
}
function finishFrosting() {
blocker_btn._visible = false;
inProgress = false;
_parent.getCake(cakeOnTray).type = "frosting";
}
var frostingSound = "frostingtable";
}
Symbol 577 MovieClip [__Packages.classes.Frostings] Frame 0
class classes.Frostings extends classes.util.ListenerMovieClip
{
var frostingClips, purple_mc, red_mc, chocolate_mc, cream_mc, currentFrosting_mc, frostingDoneFlag, frosterClip_mc, __get__froster;
function Frostings () {
super();
frostingClips = new Object();
frostingClips.Purple = purple_mc;
frostingClips.Red = red_mc;
frostingClips.Chocolate = chocolate_mc;
frostingClips.Cream = cream_mc;
hideFrostings();
}
function hideFrostings() {
var _local3 = [purple_mc, red_mc, chocolate_mc, cream_mc];
var _local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2]._visible = false;
_local3[_local2].gotoAndStop(1);
_local2++;
}
}
function startFrosting(type) {
currentFrosting_mc = frostingClips[type];
currentFrosting_mc._visible = true;
currentFrosting_mc.play();
frostingDoneFlag = false;
}
function set froster(clip) {
frosterClip_mc = clip;
//return(__get__froster());
}
function endFrosting() {
frostingDoneFlag = true;
currentFrosting_mc.gotoAndPlay("Done");
}
function frostingDone() {
hideFrostings();
frosterClip_mc.frostingDone();
}
}
Symbol 578 MovieClip [__Packages.classes.Tutorial] Frame 0
class classes.Tutorial extends MovieClip
{
var checks, stop, cakeid, cakesList, jill_mc, table_mc, foreground_mc, froster1_mc, frostings1_mc, tutorial_mc, customerNames, customers, levelData, customerCoords, oven1_mc, flame1_mc, jillMoveZone_btn, customerInterval, attachMovie, timeInterval, _xmouse, _ymouse, trash_mc;
function Tutorial () {
super();
checks = new Array();
(stop());// not popped
cakeid = 10;
cakesList = new classes.util.IDCollection();
jill_mc.swapDepths(15000);
table_mc.swapDepths(30000);
table_mc.blocker_btn.useHandCursor = false;
foreground_mc.swapDepths(20001);
froster1_mc.swapDepths(20002);
frostings1_mc.swapDepths(40002);
tutorial_mc.swapDepths(99999);
customerNames = new Object();
customerNames.delivery = "DeliveryMan";
customerNames.cupid = "Cupid";
customerNames.rabbit = "Rabbit";
customerNames.granny = "Granny";
customers = new Array();
_global.cakeMania.newLevel();
levelData = _global.cakeMania.levelData;
customerCoords = new Array();
customerCoords.push({x:66, y:275});
customerCoords.push({x:56, y:227});
customerCoords.push({x:47, y:177});
customerCoords.push({x:38, y:125});
_global.cakeMania.setBakery(this);
}
function init() {
oven1_mc.addEventListener("Create Cake", "createCake", this);
flame1_mc.swapDepths(10000);
oven1_mc.__set__flame(flame1_mc);
froster1_mc.__set__frostings(frostings1_mc);
frostings1_mc.__set__froster(froster1_mc);
jillMoveZone_btn.useHandCursor = false;
jillMoveZone_btn.onRelease = function () {
this._parent.moveJill();
};
customerInterval = setInterval(function (link) {
clearInterval(link.customerInterval);
link.tutorial_mc.play();
}, 1000, this);
}
function createTutorialCustomer() {
createCustomer();
}
function nextTutorialStep() {
tutorial_mc.play();
}
function updateChecks(checkList) {
var _local2 = 0;
while (_local2 < checks.length) {
checks[_local2].removeMovieClip();
_local2++;
}
checks = new Array();
_local2 = 0;
while (_local2 < checkList.length) {
var _local3 = attachMovie("Check", ("check" + _local2) + "_mc", 45000 + _local2);
_local3._x = checkList[_local2].x;
_local3._y = checkList[_local2].y;
checks.push(_local3);
_local2++;
}
}
function endTutorial() {
_global.cakeMania.goto("Bakery Screen");
}
function createCustomer() {
if (customers.length > 0) {
return(undefined);
}
var _local6 = "delivery";
var _local8 = customers.length;
var _local5 = ("customer" + _global.gameData.customerNum) + "_mc";
var _local7 = 25000 - _global.gameData.customerNum;
var _local4 = customers.length < levelData.maxCustomers;
var _local3 = attachMovie(customerNames[_local6], _local5, _local7, _global.cakeMania.getInitObj("tutorial", _local4));
_local3.setForceCake("Triangle", "Red");
customers.push(_local3);
if (_local4) {
repositionCustomers();
}
_global.gameData.customerNum++;
if (_global.gameData.customerNum < levelData.amount) {
customerInterval = setInterval(function (link) {
clearInterval(link.customerInterval);
link.createCustomer();
}, levelData.times[_global.gameData.customerNum] * 1000, this);
}
}
function repositionCustomers() {
var _local2 = 0;
while (_local2 < customers.length) {
if (_local2 < levelData.maxCustomers) {
customers[_local2]._x = customerCoords[_local2].x;
customers[_local2]._y = customerCoords[_local2].y;
if (customers[_local2].enabled == false) {
customers[_local2].initCustomer();
}
}
_local2++;
}
}
function customerLeft(link) {
_global.cakeMania.addLostCustomer();
createFloatingText(link._x + 50, link._y + 50, "-60$");
customerServed(link);
}
function customerServed(link) {
var _local2 = 0;
while (_local2 < customers.length) {
if (customers[_local2] == link) {
customers.splice(_local2, 1);
break;
}
_local2++;
}
link.removeMovieClip();
repositionCustomers();
timeInterval = setInterval(function (link) {
link.endTutorial();
clearInterval(link.timeInterval);
}, 2000, this);
}
function setTable(type) {
if ((type == "above") && (table_mc.getDepth() < 15000)) {
table_mc.swapDepths(30000);
}
if ((type == "below") && (table_mc.getDepth() > 15000)) {
table_mc.swapDepths(2);
}
}
function createCake(eventObj) {
cakeid++;
var _local2 = attachMovie("Cake", ("cake" + cakeid) + "_mc", cakeid, {cakeType:eventObj.type});
_local2.id = String(cakeid);
_local2.depth = cakeid;
var _local6 = {x:eventObj.target._x, y:eventObj.target._y};
var _local7 = eventObj.target.newCakeCoords;
var _local5 = 5;
var _local4 = {x:0.5, y:2};
var _local8 = {x:(_local6.x + _local7.x) - (_local4.x * _local5), y:(_local6.y + _local7.y) - (_local4.y * _local5)};
_local2.moveCake(_local8, _local4, _local5);
eventObj.target.setDoor("open");
timeInterval = setInterval(function (link, link1) {
link.closeDoor();
link.unlockButtons();
clearInterval(link1.timeInterval);
}, 200, eventObj.target, this);
eventObj.target.cakeOnTray = cakeid;
_local2.type = "plain";
cakesList.addItem(_local2);
}
function moveJill(toX, toY) {
if (toX == undefined) {
toX = Math.floor(_xmouse);
}
if (toY == undefined) {
toY = Math.floor(_ymouse);
if (toY < 220) {
toY = 220;
}
}
jill_mc.createTrack(toX, toY);
}
function setJillAction(obj, func, paramList, checkPos) {
jill_mc.setJillAction(obj, func, paramList, checkPos);
}
function jillTakeCake(cakeid, from_mc) {
if (jill_mc.__get__cake() == "") {
jill_mc.__set__cake(cakeid);
from_mc.cakeOnTray = "";
var _local2 = getCurrentCake();
_local2._xscale = 80;
_local2._yscale = 80;
_local2.takeCake();
}
}
function getCake(id) {
return(cakesList.getItemByID(id));
}
function getCurrentCake() {
if (jill_mc.__get__cake() != "") {
return(cakesList.getItemByID(jill_mc.__get__cake()));
}
return(undefined);
}
function setCakeDepth(cakeid, factor) {
var _local2 = cakesList.getItemByID(cakeid);
if (factor == "above") {
_local2.swapDepths(15000 + _local2.depth);
} else if (factor == "top") {
_local2.swapDepths(30000 + _local2.depth);
} else if (factor == "below") {
_local2.swapDepths(3);
} else {
_local2.swapDepths(_local2.depth);
}
}
function trashCake(removeFlag) {
if (removeFlag) {
removeCake();
} else if (jill_mc.__get__cake() != "") {
trash_mc.play();
}
}
function removeCake() {
var _local2 = getCurrentCake();
jill_mc.__set__cake("");
_local2.destroyCake();
}
function placeCake(posX, posY, placing, link) {
if (jill_mc.__get__cake() != "") {
var _local2 = getCurrentCake();
_local2._xscale = 100;
_local2._yscale = 100;
_local2.placeCake();
jill_mc.__set__cake("");
_local2.tray = false;
_local2._x = posX;
_local2._y = posY;
link.cakeOnTray = _local2.id;
if (placing == "above") {
_local2.swapDepths(15000 + _local2.depth);
} else if (placing == "top") {
_local2.swapDepths(30000 + _local2.depth);
} else if (placing == "below") {
_local2.swapDepths(3);
} else {
_local2.swapDepths(_local2.depth);
}
}
}
function createFloatingText(x, y, text) {
var _local2 = attachMovie("FlyingText", ("floatingText" + (moneyCounter++)) + "_mc", 60000 + moneyCounter);
_local2._x = x;
_local2._y = y;
_local2.text_mc.text_txt.text = text;
}
var moneyCounter = 1;
}
Symbol 579 MovieClip [__Packages.classes.util.Collection] Frame 0
class classes.util.Collection
{
var __dataArray;
function Collection () {
__dataArray = new Array();
}
function addItem(obj) {
__dataArray.push(obj);
}
function addItemAt(index, obj) {
if ((index >= 0) && (index <= length)) {
__dataArray.splice(index, 0, obj);
return(true);
}
return(false);
}
function getItemAt(index) {
return(__dataArray[index]);
}
function replaceItemAt(index, obj) {
if ((index >= 0) && (index <= length)) {
__dataArray[index] = obj;
return(true);
}
return(false);
}
function sortUp() {
__dataArray.sortOn(arguments);
}
function sortDown() {
__dataArray.sortOn(arguments, Array.DESCENDING);
}
function contains(obj) {
var _local2 = 0;
while (_local2 < __dataArray.length) {
if (__dataArray[_local2] == obj) {
return(true);
}
_local2++;
}
return(false);
}
function removeAll() {
__dataArray = new Array();
}
function removeItem(obj) {
var _local2 = indexOf(obj);
if (_local2 == -1) {
return(false);
}
__dataArray.splice(_local2, 1);
return(true);
}
function removeItemAt(index) {
if ((index >= 0) && (index < length)) {
__dataArray.splice(index, 1);
return(true);
}
return(false);
}
function indexOf(obj) {
var _local2 = 0;
while (_local2 < length) {
if (__dataArray[_local2] == obj) {
return(_local2);
}
_local2++;
}
return(-1);
}
function lastIndexOf(obj) {
var _local2 = length - 1;
while (_local2 >= 0) {
if (__dataArray[_local2] == obj) {
return(_local2);
}
_local2--;
}
return(-1);
}
function getItemByProperty(propName, propValue) {
var _local2 = 0;
while (_local2 < length) {
if (__dataArray[_local2][propName] == propValue) {
return(__dataArray[_local2]);
}
_local2++;
}
return(undefined);
}
function getItemsByProperty(propName, propValue) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < length) {
if (__dataArray[_local2][propName] == propValue) {
_local3.push(__dataArray[_local2]);
}
_local2++;
}
return(_local3);
}
function get length() {
return(__dataArray.length);
}
function get dataArray() {
return(__dataArray);
}
function set dataArray(val) {
if (val.length != undefined) {
__dataArray = val;
}
//return(dataArray);
}
}
Symbol 580 MovieClip [__Packages.classes.util.IDCollection] Frame 0
class classes.util.IDCollection extends classes.util.Collection
{
var __idList, __dataArray, __get__length, getItemAt;
function IDCollection (data_xml, constructor) {
super();
__idList = new Object();
if (data_xml != undefined) {
parseXML(data_xml, constructor);
}
}
function rebuildIDList() {
__idList = new Object();
var _local2 = 0;
while (_local2 < __dataArray.length) {
__idList[__dataArray[_local2].id] = _local2;
_local2++;
}
}
function addItem(obj) {
super.addItem(obj);
__idList[__dataArray[__get__length() - 1].id] = __get__length() - 1;
}
function addItemAt(index, obj) {
var _local3 = super.addItemAt(index, obj);
if (_local3) {
rebuildIDList();
}
return(_local3);
}
function replaceItemAt(index, obj) {
var _local3 = super.replaceItemAt(index, obj);
rebuildIDList();
return(_local3);
}
function sortUp() {
__dataArray.sortOn(arguments);
rebuildIDList();
}
function sortNumericUp() {
__dataArray.sortOn(arguments, Array.NUMERIC);
rebuildIDList();
}
function sortDown() {
__dataArray.sortOn(arguments);
rebuildIDList();
}
function sortNumericDown() {
__dataArray.sortOn(arguments, Array.NUMERIC | Array.DESCENDING);
rebuildIDList();
}
function removeItem(obj) {
var _local3 = super.removeItem(obj);
rebuildIDList();
return(_local3);
}
function removeItemAt(index) {
var _local3 = super.removeItemAt(index);
rebuildIDList();
return(_local3);
}
function removeAll() {
__dataArray = new Array();
__idList = new Object();
}
function getItemByID(id) {
return(__dataArray[__idList[id]]);
}
function getIndexByID(id) {
return(__idList[id]);
}
function removeItemByID(id) {
removeItemAt(__idList[id]);
}
function getPropertyArray(property) {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < __get__length()) {
_local3.push(getItemAt(_local2)[property]);
_local2++;
}
return(_local3);
}
function set dataArray(val) {
if (val.length != undefined) {
__dataArray = val;
}
rebuildIDList();
//return(dataArray);
}
function get dataArray() {
return(__dataArray);
}
function parseXML(data_xml, constructor) {
removeAll();
var _local2 = 0;
while (_local2 < data_xml.childNodes.length) {
addItem(new constructor[undefined](data_xml.childNodes[_local2]));
_local2++;
}
}
function toXML(nodeName) {
var _local3 = new XML().createElement(nodeName);
var _local2 = 0;
while (_local2 < __get__length()) {
_local3.appendChild(getItemAt(_local2).toXML());
_local2++;
}
return(_local3);
}
}
Symbol 581 MovieClip [__Packages.classes.StartComics] Frame 0
class classes.StartComics extends MovieClip
{
var playing, button_btn, hitSoundObj, arrow_mc, play, stop;
function StartComics () {
super();
playing = true;
button_btn.useHandCursor = false;
button_btn.onPress = function () {
this._parent.playIntro();
};
hitSoundObj = new Sound(this);
hitSoundObj.attachSound(hitSound);
}
function init() {
arrow_mc.addEventListener("release", "playIntro", this);
arrow_mc.mute = true;
pauseIntro();
}
function playIntro() {
if (!playing) {
(play());// not popped
if (!_global.data.mute) {
hitSoundObj.setVolume(_global.sound.fxVolume);
hitSoundObj.start();
}
}
}
function pauseIntro() {
playing = false;
(stop());// not popped
}
function endIntro() {
_global.cakeMania.goto("Map Screen");
}
var hitSound = "select";
}
Symbol 582 MovieClip [__Packages.classes.MapScreen] Frame 0
class classes.MapScreen extends MovieClip
{
var stop, play_mc, text_txt, jill_mc, goal_txt;
function MapScreen () {
super();
(stop());// not popped
}
function init() {
play_mc.__set__text("Let's Play!");
play_mc.addEventListener("release", "startLevel", this);
text_txt.text = _global.cakeMania.description;
setGoal(_global.cakeMania.goal);
var _local3 = 0;
while (_local3 <= 5) {
this[("star" + _local3) + "_mc"]._visible = _local3 <= _global.gameData.level;
_local3++;
}
jill_mc._x = this[("star" + _global.gameData.level) + "_mc"]._x;
jill_mc._y = this[("star" + _global.gameData.level) + "_mc"]._y;
}
function startLevel() {
if (_global.gameData.level == 0) {
_global.cakeMania.goto("Tutorial");
} else {
_global.cakeMania.goto("Bakery Screen");
}
}
function setGoal(goal) {
goal_txt.text = "Baker's Goal: $" + String(goal);
}
}
Symbol 583 MovieClip [__Packages.classes.StatsScreenClip] Frame 0
class classes.StatsScreenClip extends classes.util.ListenerMovieClip
{
var _visible, blocker_btn, stop, play, text_txt, row1_txt, row2_txt, row3_txt, row4_txt, row5_txt, continue_mc, download_mc;
function StatsScreenClip () {
super();
_visible = false;
blocker_btn.useHandCursor = false;
}
function init() {
_global.cakeMania.submitScore("ScoreBroadcast");
(stop());// not popped
}
function show() {
_visible = true;
(play());// not popped
}
function showStuff() {
(stop());// not popped
text_txt.text = _global.cakeMania.winText;
row1_txt.text = "Customers Lost: $" + String(_global.gameData.customersLost);
row2_txt.text = "Cakes Served: $" + String(_global.gameData.cakesServed);
row3_txt.text = "Cakes Lost: $" + String(_global.gameData.cakesLost);
row4_txt.text = "Customers tips: $" + String(_global.gameData.customersTips);
row5_txt.text = "Total Money: $" + String(_global.gameData.cash);
continue_mc.__set__text("Continue");
continue_mc.addEventListener("release", "buttonEvent", this);
download_mc.__set__text("Download Cake Mania");
download_mc.addEventListener("release", "downloadEvent", this);
}
function buttonEvent(eventObj) {
_global.cakeMania.nextLevel();
}
function downloadEvent(eventObj) {
_global.cakeMania.download();
}
}
Symbol 584 MovieClip [__Packages.classes.EndScreenClip] Frame 0
class classes.EndScreenClip extends classes.util.ListenerMovieClip
{
var _visible, blocker_btn, stop, play, text_txt, again_mc, download_mc;
function EndScreenClip () {
super();
_visible = false;
blocker_btn.useHandCursor = false;
}
function init() {
_global.cakeMania.submitScore("ScoreBroadcast");
(stop());// not popped
}
function show() {
_visible = true;
(play());// not popped
}
function showStuff() {
(stop());// not popped
text_txt.text = _global.cakeMania.loseText;
if (_global.gameData.lives < 0) {
again_mc.__set__text("Game Over");
} else {
again_mc.__set__text("Try again!");
}
again_mc.addEventListener("release", "buttonEvent", this);
download_mc.__set__text("Download Cake Mania");
download_mc.addEventListener("release", "downloadEvent", this);
}
function buttonEvent(eventObj) {
if (_global.gameData.lives >= 0) {
_global.cakeMania.restartLevel();
} else {
_global.cakeMania.goto("GameOver Screen");
}
}
function downloadEvent(eventObj) {
_global.cakeMania.download();
}
}
Symbol 585 MovieClip [__Packages.classes.Bakery] Frame 0
class classes.Bakery extends MovieClip
{
var checks, goalSoundObj, winSoundObj, loseSoundObj, stop, cakeid, cakesList, jill_mc, table_mc, foreground_mc, froster1_mc, frostings1_mc, froster2_mc, frostings2_mc, hud_mc, menu_mc, bakerGoal_mc, options_mc, endScreen_mc, statsScreen_mc, customerNames, customers, levelData, customerCoords, oven2_mc, flame2_mc, oven1_mc, flame1_mc, jillMoveZone_btn, customerInterval, attachMovie, timeInterval, _xmouse, _ymouse, trash_mc;
function Bakery () {
super();
checks = new Array();
goalSoundObj = new Sound(this);
goalSoundObj.attachSound(goalSound);
winSoundObj = new Sound(this);
winSoundObj.attachSound(winSound);
loseSoundObj = new Sound(this);
loseSoundObj.attachSound(loseSound);
(stop());// not popped
cakeid = 10;
cakesList = new classes.util.IDCollection();
jill_mc.swapDepths(15000);
table_mc.swapDepths(30000);
table_mc.blocker_btn.useHandCursor = false;
foreground_mc.swapDepths(20001);
froster1_mc.swapDepths(20002);
frostings1_mc.swapDepths(40002);
froster2_mc.swapDepths(20003);
frostings2_mc.swapDepths(40003);
hud_mc.swapDepths(50001);
menu_mc.swapDepths(50002);
bakerGoal_mc.swapDepths(60000);
options_mc.swapDepths(80000);
endScreen_mc.swapDepths(80001);
statsScreen_mc.swapDepths(80002);
customerNames = new Object();
customerNames.delivery = "DeliveryMan";
customerNames.cupid = "Cupid";
customerNames.rabbit = "Rabbit";
customerNames.granny = "Granny";
customers = new Array();
_global.cakeMania.newLevel();
levelData = _global.cakeMania.levelData;
customerCoords = new Array();
customerCoords.push({x:66, y:275});
customerCoords.push({x:56, y:227});
customerCoords.push({x:47, y:177});
customerCoords.push({x:38, y:125});
_global.cakeMania.setHud(hud_mc);
_global.cakeMania.setBakery(this);
oven2_mc._visible = _global.gameData.level >= 2;
flame2_mc._visible = _global.gameData.level >= 2;
froster2_mc._visible = _global.gameData.level >= 4;
frostings2_mc._visible = _global.gameData.level >= 4;
}
function init() {
oven1_mc.addEventListener("Create Cake", "createCake", this);
flame1_mc.swapDepths(10000);
oven2_mc.addEventListener("Create Cake", "createCake", this);
flame2_mc.swapDepths(10001);
oven1_mc.__set__flame(flame1_mc);
oven2_mc.__set__flame(flame2_mc);
froster1_mc.__set__frostings(frostings1_mc);
frostings1_mc.__set__froster(froster1_mc);
froster2_mc.__set__frostings(frostings2_mc);
frostings2_mc.__set__froster(froster2_mc);
menu_mc.addEventListener("release", "showMenu", this);
options_mc.yes_mc.addEventListener("release", "endGame", this);
options_mc.no_mc.addEventListener("release", "hideMenu", this);
options_mc.yes_mc.text = "Yes";
options_mc.no_mc.text = "No";
options_mc._visible = false;
jillMoveZone_btn.useHandCursor = false;
jillMoveZone_btn.onRelease = function () {
this._parent.moveJill();
};
customerInterval = setInterval(function (link) {
clearInterval(link.customerInterval);
link.createCustomer();
}, 1000, this);
}
function updateChecks(checkList) {
var _local2 = 0;
while (_local2 < checks.length) {
checks[_local2].removeMovieClip();
_local2++;
}
checks = new Array();
_local2 = 0;
while (_local2 < checkList.length) {
var _local3 = attachMovie("Check", ("check" + _local2) + "_mc", 45000 + _local2);
_local3._x = checkList[_local2].x;
_local3._y = checkList[_local2].y;
checks.push(_local3);
_local2++;
}
}
function showMenu() {
options_mc._visible = true;
}
function hideMenu() {
options_mc._visible = false;
}
function endGame() {
_global.cakeMania.goto("Main Menu");
}
function createCustomer() {
var _local3 = levelData.types[_global.gameData.customerNum];
var _local8 = customers.length;
var _local5 = ("customer" + _global.gameData.customerNum) + "_mc";
var _local6 = 25000 - _global.gameData.customerNum;
var _local4 = customers.length < levelData.maxCustomers;
var _local7 = attachMovie(customerNames[_local3], _local5, _local6, _global.cakeMania.getInitObj(_local3, _local4));
customers.push(_local7);
if (_local4) {
repositionCustomers();
}
_global.gameData.customerNum++;
if (_global.gameData.customerNum < levelData.amount) {
customerInterval = setInterval(function (link) {
clearInterval(link.customerInterval);
link.createCustomer();
}, levelData.times[_global.gameData.customerNum] * 1000, this);
}
}
function repositionCustomers() {
var _local2 = 0;
while (_local2 < customers.length) {
if (_local2 < levelData.maxCustomers) {
customers[_local2]._x = customerCoords[_local2].x;
customers[_local2]._y = customerCoords[_local2].y;
if (customers[_local2].enabled == false) {
customers[_local2].initCustomer();
}
}
_local2++;
}
}
function customerLeft(link) {
_global.cakeMania.addLostCustomer();
createFloatingText(link._x + 50, link._y + 50, "-$60");
customerServed(link);
}
function customerServed(link) {
var _local3 = 0;
while (_local3 < customers.length) {
if (customers[_local3] == link) {
customers.splice(_local3, 1);
break;
}
_local3++;
}
link.removeMovieClip();
repositionCustomers();
if ((customers.length == 0) && (_global.gameData.customerNum == levelData.amount)) {
timeInterval = setInterval(function (link) {
link.finishLevel();
clearInterval(link.timeInterval);
}, 2000, this);
}
}
function finishLevel() {
var _local3 = 0;
while (_local3 < cakesList.__get__length()) {
var _local4 = cakesList.getItemAt(_local3).getPrice();
_global.cakeMania.trashCake(_local4);
_local3++;
}
while (cakesList.__get__length() > 0) {
cakesList.getItemAt(0).destroyCake();
}
if (_global.gameData.cash >= _global.cakeMania.goal) {
statsScreen_mc.show();
if (!_global.sound.mute) {
winSoundObj.setVolume(_global.sound.fxVolume);
winSoundObj.start();
}
} else {
_global.gameData.lives--;
endScreen_mc.show();
if (!_global.sound.mute) {
loseSoundObj.setVolume(_global.sound.fxVolume);
loseSoundObj.start();
}
}
}
function playBakerGoal() {
if (!_global.sound.mute) {
goalSoundObj.setVolume(_global.sound.fxVolume);
goalSoundObj.start();
}
bakerGoal_mc.play();
}
function setTable(type) {
if ((type == "above") && (table_mc.getDepth() < 15000)) {
table_mc.swapDepths(30000);
}
if ((type == "below") && (table_mc.getDepth() > 15000)) {
table_mc.swapDepths(2);
}
}
function createCake(eventObj) {
cakeid++;
var _local2 = attachMovie("Cake", ("cake" + cakeid) + "_mc", cakeid, {cakeType:eventObj.type});
_local2.id = String(cakeid);
_local2.depth = cakeid;
var _local6 = {x:eventObj.target._x, y:eventObj.target._y};
var _local7 = eventObj.target.newCakeCoords;
var _local5 = 5;
var _local4 = {x:0.5, y:2};
var _local8 = {x:(_local6.x + _local7.x) - (_local4.x * _local5), y:(_local6.y + _local7.y) - (_local4.y * _local5)};
_local2.moveCake(_local8, _local4, _local5);
eventObj.target.setDoor("open");
timeInterval = setInterval(function (link, link1) {
link.closeDoor();
link.unlockButtons();
clearInterval(link1.timeInterval);
}, 200, eventObj.target, this);
eventObj.target.cakeOnTray = cakeid;
_local2.type = "plain";
cakesList.addItem(_local2);
}
function moveJill(toX, toY) {
if (toX == undefined) {
toX = Math.floor(_xmouse);
}
if (toY == undefined) {
toY = Math.floor(_ymouse);
if (toY < 220) {
toY = 220;
}
}
jill_mc.createTrack(toX, toY);
}
function setJillAction(obj, func, paramList, checkPos) {
jill_mc.setJillAction(obj, func, paramList, checkPos);
}
function jillTakeCake(cakeid, from_mc) {
if (jill_mc.__get__cake() == "") {
jill_mc.__set__cake(cakeid);
from_mc.cakeOnTray = "";
var _local2 = getCurrentCake();
_local2._xscale = 80;
_local2._yscale = 80;
_local2.takeCake();
}
}
function getCake(id) {
return(cakesList.getItemByID(id));
}
function getCurrentCake() {
if (jill_mc.__get__cake() != "") {
return(cakesList.getItemByID(jill_mc.__get__cake()));
}
return(undefined);
}
function setCakeDepth(cakeid, factor) {
var _local2 = cakesList.getItemByID(cakeid);
if (factor == "above") {
_local2.swapDepths(15000 + _local2.depth);
} else if (factor == "top") {
_local2.swapDepths(30000 + _local2.depth);
} else if (factor == "below") {
_local2.swapDepths(3);
} else {
_local2.swapDepths(_local2.depth);
}
}
function trashCake(removeFlag) {
if (removeFlag) {
var _local3 = getCurrentCake().getPrice();
_global.cakeMania.trashCake(_local3);
createFloatingText(trash_mc._x, trash_mc._y, "-$" + String(_local3));
removeCake();
} else if (jill_mc.__get__cake() != "") {
trash_mc.play();
}
}
function removeCake() {
var _local2 = getCurrentCake();
jill_mc.__set__cake("");
_local2.destroyCake();
}
function placeCake(posX, posY, placing, link) {
if (jill_mc.__get__cake() != "") {
var _local2 = getCurrentCake();
_local2._xscale = 100;
_local2._yscale = 100;
_local2.placeCake();
jill_mc.__set__cake("");
_local2.tray = false;
_local2._x = posX;
_local2._y = posY;
link.cakeOnTray = _local2.id;
if (placing == "above") {
_local2.swapDepths(15000 + _local2.depth);
} else if (placing == "top") {
_local2.swapDepths(30000 + _local2.depth);
} else if (placing == "below") {
_local2.swapDepths(3);
} else {
_local2.swapDepths(_local2.depth);
}
}
}
function createFloatingText(x, y, text) {
var _local2 = attachMovie("FlyingText", ("floatingText" + (moneyCounter++)) + "_mc", 60000 + moneyCounter);
_local2._x = x;
_local2._y = y;
_local2.text_mc.text_txt.text = text;
}
var moneyCounter = 1;
var goalSound = "bakergoalreached";
var winSound = "winlevel";
var loseSound = "loselife";
}
Symbol 586 MovieClip [__Packages.classes.ShopScreen] Frame 0
class classes.ShopScreen extends classes.util.ListenerMovieClip
{
var itemImage_mc, tv_btn, cookie_btn, decor1_btn, decor2_btn, shoes_btn, oven1_btn, oven2_btn, oven3_btn, froster1_btn, froster2_btn, froster3_btn, case_btn, links, oven2_mc, froster2_mc, stop, buy_mc, finish_mc, lives_txt, points_txt, money_txt;
function ShopScreen () {
super();
itemImage_mc.stop();
var _local5 = [tv_btn, cookie_btn, decor1_btn, decor2_btn, shoes_btn, oven1_btn, oven2_btn, oven3_btn, froster1_btn, froster2_btn, froster3_btn, case_btn];
var _local4 = 0;
while (_local4 < _local5.length) {
_local5[_local4].onRollOver = function () {
this._parent.show(this._name);
};
_local5[_local4].onRollOut = function () {
this._parent.hide();
};
_local4++;
}
links = new Object();
links.case_btn = 2;
links.shoes_btn = 3;
links.cookie_btn = 4;
links.tv_btn = 5;
links.decor1_btn = 6;
links.decor2_btn = 7;
links.oven1_btn = 9;
links.oven2_btn = ((_global.gameData.level >= 2) ? 9 : 8);
links.oven3_btn = 8;
links.froster1_btn = 11;
links.froster2_btn = ((_global.gameData.level >= 4) ? 11 : 10);
links.froster3_btn = 10;
oven2_mc._visible = _global.gameData.level >= 2;
froster2_mc._visible = _global.gameData.level >= 4;
}
function init() {
(stop());// not popped
buy_mc.__set__text("Buy");
finish_mc.__set__text("Finish");
buy_mc.addEventListener("release", "buttonEvent", this);
finish_mc.addEventListener("release", "buttonEvent", this);
buy_mc.__set__enabled(false);
lives_txt.text = "Lives: " + _global.gameData.lives;
points_txt.text = "Points: " + _global.gameData.money;
money_txt.text = "Money: $" + _global.gameData.money;
}
function show(item) {
itemImage_mc.gotoAndStop(links[item]);
}
function hide() {
itemImage_mc.gotoAndStop(1);
}
function buttonEvent(eventObj) {
_global.cakeMania.goto("Map Screen");
}
}
Symbol 587 MovieClip [__Packages.classes.TrialEnd] Frame 0
class classes.TrialEnd extends MovieClip
{
var sun_mc, sun2_mc, stop, download_mc, view_mc, back_mc;
function TrialEnd () {
super();
sun_mc.onEnterFrame = function () {
this._rotation = this._rotation - 2;
};
sun2_mc.onEnterFrame = function () {
this._rotation = this._rotation + 2;
};
}
function init() {
(stop());// not popped
download_mc.__set__text("Download CakeMania");
view_mc.__set__text("View Screenshots");
back_mc.__set__text("Back to Main Menu");
var _local4 = [download_mc, back_mc, view_mc];
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local3.addEventListener("release", "buttonEvent", this);
_local2++;
}
}
function buttonEvent(eventObj) {
if (eventObj.target == download_mc) {
_global.cakeMania.download();
}
if (eventObj.target == back_mc) {
_global.cakeMania.goto("Main Menu");
}
if (eventObj.target == view_mc) {
_global.cakeMania.goto("Preview");
}
}
}
Symbol 588 MovieClip [__Packages.classes.GameOver] Frame 0
class classes.GameOver extends MovieClip
{
var button_btn;
function GameOver () {
super();
button_btn.useHandCursor = false;
button_btn.onPress = function () {
this._parent.closeStuff();
};
_global.cakeMania.endGame();
}
function closeStuff() {
_global.cakeMania.goto("Main Menu");
}
}
Symbol 589 MovieClip [__Packages.classes.Preview] Frame 0
class classes.Preview extends MovieClip
{
var playing, button_btn, hitSoundObj, arrow_mc, play, stop;
function Preview () {
super();
playing = true;
button_btn.useHandCursor = false;
button_btn.onPress = function () {
this._parent.playIntro();
};
hitSoundObj = new Sound(this);
hitSoundObj.attachSound(hitSound);
}
function init() {
arrow_mc.addEventListener("release", "playIntro", this);
arrow_mc.mute = true;
pauseIntro();
}
function playIntro() {
if (!playing) {
(play());// not popped
if (!_global.data.mute) {
hitSoundObj.setVolume(_global.sound.fxVolume);
hitSoundObj.start();
}
}
}
function pauseIntro() {
playing = false;
(stop());// not popped
}
function endIntro() {
_global.cakeMania.goto("Finish Screen");
}
var hitSound = "select";
}
Symbol 74 MovieClip [Cake] Frame 1
#initclip 36
Object.registerClass("Cake", classes.Cake);
#endinitclip
init();
Symbol 83 MovieClip [Customer Button] Frame 1
#initclip 29
Object.registerClass("Customer Button", classes.util.ToggleButton);
#endinitclip
Symbol 88 MovieClip [MoneyButton] Frame 1
#initclip 30
Object.registerClass("MoneyButton", classes.util.ToggleButton);
#endinitclip
Symbol 93 MovieClip [Customer Bubble] Frame 1
#initclip 31
Object.registerClass("Customer Bubble", classes.util.ToggleButton);
#endinitclip
Symbol 100 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 7
_parent.showBoxBottom();
Symbol 100 MovieClip Frame 18
_parent.hideBoxBottom();
Symbol 100 MovieClip Frame 22
_parent.cakePackingDone();
Symbol 103 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 6
_parent.endPuffAngry();
Symbol 106 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 6
_parent.endPuffHappy();
Symbol 115 MovieClip Frame 21
_parent.happyAnimationDone();
Symbol 116 MovieClip [DeliveryMan] Frame 1
#initclip 32
Object.registerClass("DeliveryMan", classes.Customer);
#endinitclip
init();
Symbol 116 MovieClip [DeliveryMan] Frame 2
checkRollOver();
Symbol 116 MovieClip [DeliveryMan] Frame 3
checkRollOver();
Symbol 116 MovieClip [DeliveryMan] Frame 5
checkRollOver();
Symbol 120 MovieClip [FlyingText] Frame 20
this.removeMovieClip();
Symbol 132 MovieClip Frame 24
_parent.happyAnimationDone();
Symbol 133 MovieClip [Cupid] Frame 1
#initclip 33
Object.registerClass("Cupid", classes.Customer);
#endinitclip
init();
Symbol 133 MovieClip [Cupid] Frame 2
checkRollOver();
Symbol 133 MovieClip [Cupid] Frame 3
checkRollOver();
Symbol 133 MovieClip [Cupid] Frame 5
checkRollOver();
Symbol 145 MovieClip Frame 23
_parent.happyAnimationDone();
Symbol 146 MovieClip [Rabbit] Frame 1
#initclip 34
Object.registerClass("Rabbit", classes.Customer);
#endinitclip
init();
Symbol 146 MovieClip [Rabbit] Frame 2
checkRollOver();
Symbol 146 MovieClip [Rabbit] Frame 3
checkRollOver();
Symbol 146 MovieClip [Rabbit] Frame 5
checkRollOver();
Symbol 158 MovieClip Frame 13
_parent.happyAnimationDone();
Symbol 159 MovieClip [Granny] Frame 1
#initclip 35
Object.registerClass("Granny", classes.Customer);
#endinitclip
init();
Symbol 159 MovieClip [Granny] Frame 2
checkRollOver();
Symbol 159 MovieClip [Granny] Frame 3
checkRollOver();
Symbol 159 MovieClip [Granny] Frame 5
checkRollOver();
Symbol 201 MovieClip [Main Menu Fire1] Frame 1
#initclip 40
Object.registerClass("Main Menu Fire1", classes.util.RandomStartAnimation);
#endinitclip
Symbol 215 MovieClip [Main Menu Button] Frame 1
#initclip 37
Object.registerClass("Main Menu Button", classes.util.ToggleButton);
#endinitclip
updateText();
Symbol 215 MovieClip [Main Menu Button] Frame 2
updateText();
Symbol 215 MovieClip [Main Menu Button] Frame 3
updateText();
Symbol 215 MovieClip [Main Menu Button] Frame 4
updateText();
Symbol 215 MovieClip [Main Menu Button] Frame 5
updateText();
Symbol 226 MovieClip [Slider Clip] Frame 1
#initclip 38
Object.registerClass("Slider Clip", classes.SliderBar);
#endinitclip
Symbol 227 MovieClip [Main Menu] Frame 1
#initclip 39
Object.registerClass("Main Menu", classes.MainMenu);
#endinitclip
init();
Symbol 227 MovieClip [Main Menu] Frame 2
init();
Symbol 227 MovieClip [Main Menu] Frame 3
init();
Symbol 233 MovieClip [Trash Can Button] Frame 1
#initclip 60
Object.registerClass("Trash Can Button", classes.util.ToggleButton);
#endinitclip
Symbol 237 MovieClip [Trash Can] Frame 1
#initclip 41
Object.registerClass("Trash Can", classes.TrashCan);
#endinitclip
init();
Symbol 237 MovieClip [Trash Can] Frame 4
removeCake();
Symbol 243 MovieClip [JillStatic] Frame 1
#initclip 42
Object.registerClass("JillStatic", classes.util.RandomStartAnimation);
#endinitclip
Symbol 258 MovieClip [JillStaticCake] Frame 1
#initclip 43
Object.registerClass("JillStaticCake", classes.util.RandomStartAnimation);
#endinitclip
Symbol 272 MovieClip [Jill] Frame 1
#initclip 44
Object.registerClass("Jill", classes.Jill);
#endinitclip
init();
Symbol 277 MovieClip Frame 1
stop();
Symbol 277 MovieClip Frame 4
_parent.burnCake();
Symbol 289 MovieClip [Oven Button Triangle] Frame 1
#initclip 45
Object.registerClass("Oven Button Triangle", classes.util.ToggleButton);
#endinitclip
Symbol 294 MovieClip [Oven Button Square] Frame 1
#initclip 46
Object.registerClass("Oven Button Square", classes.util.ToggleButton);
#endinitclip
Symbol 299 MovieClip [Oven Button Star] Frame 1
#initclip 47
Object.registerClass("Oven Button Star", classes.util.ToggleButton);
#endinitclip
Symbol 304 MovieClip [Oven Button Round] Frame 1
#initclip 48
Object.registerClass("Oven Button Round", classes.util.ToggleButton);
#endinitclip
Symbol 305 MovieClip [CakeOven Tray Button] Frame 1
#initclip 49
Object.registerClass("CakeOven Tray Button", classes.util.ToggleButton);
#endinitclip
Symbol 309 MovieClip [ReadyCircle] Frame 1
#initclip 50
Object.registerClass("ReadyCircle", classes.ReadyCircle);
#endinitclip
Symbol 310 MovieClip [CakeOven] Frame 1
#initclip 51
Object.registerClass("CakeOven", classes.CakeOven);
#endinitclip
init();
Symbol 313 MovieClip Frame 1
stop();
Symbol 328 MovieClip [Froster Purple Button] Frame 1
#initclip 52
Object.registerClass("Froster Purple Button", classes.util.ToggleButton);
#endinitclip
Symbol 333 MovieClip [Froster Red Button] Frame 1
#initclip 53
Object.registerClass("Froster Red Button", classes.util.ToggleButton);
#endinitclip
Symbol 338 MovieClip [Froster Chocolate Button] Frame 1
#initclip 54
Object.registerClass("Froster Chocolate Button", classes.util.ToggleButton);
#endinitclip
Symbol 343 MovieClip [Froster Cream Button] Frame 1
#initclip 55
Object.registerClass("Froster Cream Button", classes.util.ToggleButton);
#endinitclip
Symbol 345 MovieClip [Froster Tray Button] Frame 1
#initclip 56
Object.registerClass("Froster Tray Button", classes.util.ToggleButton);
#endinitclip
Symbol 346 MovieClip [Froster] Frame 1
#initclip 57
Object.registerClass("Froster", classes.Froster);
#endinitclip
init();
Symbol 349 MovieClip Frame 1
stop();
Symbol 349 MovieClip Frame 36
if (!_parent.frostingDoneFlag) {
gotoAndPlay ("Frosting");
}
Symbol 349 MovieClip Frame 59
_parent.frostingDone();
Symbol 352 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 36
if (!_parent.frostingDoneFlag) {
gotoAndPlay ("Frosting");
}
Symbol 352 MovieClip Frame 59
_parent.frostingDone();
Symbol 355 MovieClip Frame 1
stop();
Symbol 355 MovieClip Frame 36
if (!_parent.frostingDoneFlag) {
gotoAndPlay ("Frosting");
}
Symbol 355 MovieClip Frame 59
_parent.frostingDone();
Symbol 358 MovieClip Frame 1
stop();
Symbol 358 MovieClip Frame 36
if (!_parent.frostingDoneFlag) {
gotoAndPlay ("Frosting");
}
Symbol 358 MovieClip Frame 59
_parent.frostingDone();
Symbol 359 MovieClip [Frostings] Frame 1
#initclip 58
Object.registerClass("Frostings", classes.Frostings);
#endinitclip
Symbol 388 MovieClip Frame 1
stop();
Symbol 388 MovieClip Frame 6
stop();
ovenBlocker1_btn._visible = false;
ovenBlocker3_btn._visible = false;
frosterBlocker1_btn._visible = false;
frosterBlocker2_btn._visible = false;
frosterBlockerA_btn._visible = false;
frosterBlockerB_btn._visible = false;
frosterBlockerC_btn._visible = false;
frosterBlockerD_btn._visible = false;
Symbol 388 MovieClip Frame 12
stop();
ovenBlocker2_btn._visible = false;
Symbol 388 MovieClip Frame 18
stop();
ovenBlocker_btn._visible = false;
ovenBlocker1_btn._visible = true;
Symbol 388 MovieClip Frame 24
stop();
ovenBlocker_btn._visible = true;
Symbol 388 MovieClip Frame 30
stop();
Symbol 388 MovieClip Frame 36
stop();
trashCanBlocker_btn._visible = false;
Symbol 388 MovieClip Frame 42
stop();
trashCanBlocker_btn._visible = true;
ovenBlocker1_btn._visible = false;
ovenBlocker3_btn._visible = true;
Symbol 388 MovieClip Frame 48
stop();
ovenBlocker1_btn._visible = true;
ovenBlocker3_btn._visible = false;
Symbol 388 MovieClip Frame 54
stop();
ovenBlocker_btn._visible = false;
ovenBlocker1_btn._visible = true;
Symbol 388 MovieClip Frame 60
stop();
ovenBlocker_btn._visible = true;
frosterBlocker_btn._visible = false;
frosterBlocker1_btn._visible = true;
frosterBlocker2_btn._visible = true;
Symbol 388 MovieClip Frame 66
stop();
frosterBlocker_btn._visible = true;
frosterBlocker1_btn._visible = false;
frosterBlocker2_btn._visible = false;
Symbol 388 MovieClip Frame 72
stop();
frosterBlocker_btn._visible = false;
frosterBlockerA_btn._visible = true;
frosterBlockerB_btn._visible = true;
frosterBlockerC_btn._visible = true;
frosterBlockerD_btn._visible = true;
Symbol 388 MovieClip Frame 78
stop();
frosterBlocker_btn._visible = true;
frosterBlockerA_btn._visible = false;
frosterBlockerB_btn._visible = false;
frosterBlockerC_btn._visible = false;
frosterBlockerD_btn._visible = false;
Symbol 388 MovieClip Frame 84
stop();
Symbol 388 MovieClip Frame 90
stop();
Symbol 388 MovieClip Frame 96
stop();
Symbol 389 MovieClip [Tutorial Screen] Frame 1
#initclip 59
Object.registerClass("Tutorial Screen", classes.Tutorial);
#endinitclip
init();
Symbol 396 MovieClip [Comics Arrow] Frame 1
#initclip 62
Object.registerClass("Comics Arrow", classes.util.ToggleButton);
#endinitclip
updateText();
Symbol 396 MovieClip [Comics Arrow] Frame 2
updateText();
Symbol 396 MovieClip [Comics Arrow] Frame 3
updateText();
Symbol 396 MovieClip [Comics Arrow] Frame 4
updateText();
Symbol 396 MovieClip [Comics Arrow] Frame 5
updateText();
Symbol 401 MovieClip [Start Comics] Frame 1
#initclip 61
Object.registerClass("Start Comics", classes.StartComics);
#endinitclip
init();
Symbol 401 MovieClip [Start Comics] Frame 9
pauseIntro();
Symbol 401 MovieClip [Start Comics] Frame 17
pauseIntro();
Symbol 401 MovieClip [Start Comics] Frame 18
stop();
endIntro();
Symbol 411 MovieClip [Map Screen Button] Frame 1
#initclip 64
Object.registerClass("Map Screen Button", classes.util.ToggleButton);
#endinitclip
updateText();
Symbol 411 MovieClip [Map Screen Button] Frame 2
updateText();
Symbol 411 MovieClip [Map Screen Button] Frame 3
updateText();
Symbol 411 MovieClip [Map Screen Button] Frame 4
updateText();
Symbol 411 MovieClip [Map Screen Button] Frame 5
updateText();
Symbol 418 MovieClip [Map Screen] Frame 1
#initclip 63
Object.registerClass("Map Screen", classes.MapScreen);
#endinitclip
init();
Symbol 421 MovieClip Frame 1
stop();
Symbol 440 MovieClip [HUD Menu Button] Frame 1
#initclip 69
Object.registerClass("HUD Menu Button", classes.util.ToggleButton);
#endinitclip
Symbol 451 MovieClip [Bakery Options Button] Frame 1
#initclip 65
Object.registerClass("Bakery Options Button", classes.util.ToggleButton);
#endinitclip
updateText();
Symbol 451 MovieClip [Bakery Options Button] Frame 2
updateText();
Symbol 451 MovieClip [Bakery Options Button] Frame 3
updateText();
Symbol 451 MovieClip [Bakery Options Button] Frame 4
updateText();
Symbol 451 MovieClip [Bakery Options Button] Frame 5
updateText();
Symbol 462 MovieClip [StatsScreenClip] Frame 1
#initclip 66
Object.registerClass("StatsScreenClip", classes.StatsScreenClip);
#endinitclip
init();
Symbol 462 MovieClip [StatsScreenClip] Frame 20
showStuff();
Symbol 466 MovieClip [EndScreenClip] Frame 1
#initclip 67
Object.registerClass("EndScreenClip", classes.EndScreenClip);
#endinitclip
init();
Symbol 466 MovieClip [EndScreenClip] Frame 20
showStuff();
Symbol 467 MovieClip [Bakery Screen] Frame 1
#initclip 68
Object.registerClass("Bakery Screen", classes.Bakery);
#endinitclip
init();
Symbol 490 MovieClip [Shop Screen Button] Frame 1
#initclip 71
Object.registerClass("Shop Screen Button", classes.util.ToggleButton);
#endinitclip
updateText();
Symbol 490 MovieClip [Shop Screen Button] Frame 2
updateText();
Symbol 490 MovieClip [Shop Screen Button] Frame 3
updateText();
Symbol 490 MovieClip [Shop Screen Button] Frame 4
updateText();
Symbol 490 MovieClip [Shop Screen Button] Frame 5
updateText();
Instance of Symbol 186 MovieClip in Symbol 528 MovieClip Frame 2
onClipEvent (enterFrame) {
this._rotation = this._rotation + 2;
}
Instance of Symbol 189 MovieClip in Symbol 528 MovieClip Frame 2
onClipEvent (enterFrame) {
this._rotation = this._rotation - 2;
}
Symbol 533 MovieClip [Shop Screen] Frame 1
#initclip 70
Object.registerClass("Shop Screen", classes.ShopScreen);
#endinitclip
init();
Symbol 535 MovieClip [Trial End] Frame 1
#initclip 72
Object.registerClass("Trial End", classes.TrialEnd);
#endinitclip
init();
Symbol 540 MovieClip [Cloud3Clip] Frame 1
#initclip 78
Object.registerClass("Cloud3Clip", classes.util.RandomStartAnimation);
#endinitclip
Symbol 543 MovieClip [Cloud5Clip] Frame 1
#initclip 73
Object.registerClass("Cloud5Clip", classes.util.RandomStartAnimation);
#endinitclip
Symbol 546 MovieClip [Cloud4Clip] Frame 1
#initclip 74
Object.registerClass("Cloud4Clip", classes.util.RandomStartAnimation);
#endinitclip
Symbol 549 MovieClip [Cloud1Clip] Frame 1
#initclip 75
Object.registerClass("Cloud1Clip", classes.util.RandomStartAnimation);
#endinitclip
Symbol 552 MovieClip [Cloud2Clip] Frame 1
#initclip 76
Object.registerClass("Cloud2Clip", classes.util.RandomStartAnimation);
#endinitclip
Symbol 555 MovieClip [GameOver Screen] Frame 1
#initclip 77
Object.registerClass("GameOver Screen", classes.GameOver);
#endinitclip
Symbol 562 MovieClip [Preview] Frame 1
#initclip 79
Object.registerClass("Preview", classes.Preview);
#endinitclip
init();
Symbol 562 MovieClip [Preview] Frame 9
pauseIntro();
Symbol 562 MovieClip [Preview] Frame 17
pauseIntro();
Symbol 562 MovieClip [Preview] Frame 18
stop();
endIntro();