Frame 1
function LoadLogoAndURL() {
var _local1 = new XML();
_local1.ignoreWhite = true;
_local1.onLoad = ProcessLogo;
_local1.load("CookingAcademy.xml");
}
function ProcessLogo() {
if (_root.REAL_API_ENABLED) {
if (_root.numTrialLevels == undefined) {
_root.numTrialLevels = GetValue(FindNode(this.firstChild, "numTrialLevels"));
}
if (_root.comInterval == undefined) {
_root.comInterval = GetValue(FindNode(this.firstChild, "comInterval"));
}
if (_root.numAdLevels == undefined) {
_root.numAdLevels = GetValue(FindNode(this.firstChild, "numAdLevels"));
}
if (_root.showAds == undefined) {
_root.showAds = GetValue(FindNode(this.firstChild, "showAds"));
}
if (_root.hasDownloadable == undefined) {
_root.hasDownloadable = GetValue(FindNode(this.firstChild, "hasDownloadable"));
}
}
var _local5 = GetValue(FindNode(this.firstChild, "downloadableURL"));
var _local6 = GetValue(FindNode(this.firstChild, "show_time"));
showTime = parseInt(_local6) / 1000;
if (_local5.length > 0) {
_root.FREE_DOWNLOAD_URL = _local5;
}
if (_root.REAL_API_ENABLED) {
if (_root.downloadableURL != undefined) {
_root.FREE_DOWNLOAD_URL = _root.downloadableURL;
}
}
var _local4 = FindNode(this.firstChild, "logo");
while (true) {
var _local3 = new Object();
_local3.img_url = GetValue(FindNode(_local4.childNodes[logosToDisplay], "image_url"));
if (_local3.img_url == "") {
break;
}
splashLogosList[logosToDisplay] = _local3;
logosToDisplay++;
}
ShowLogos();
}
function ShowLogos() {
currentLogoIndex++;
if (currentLogoIndex >= logosToDisplay) {
splashLogosList.splice(0, splashLogosListLength);
_root.gotoAndStop(_root.FRAME_TITLE_SCREEN);
return(undefined);
}
_root.fadeInOutCountDown = showTime * 24;
var _local2 = new MovieClipLoader();
var _local3 = new Object();
_local3.onLoadInit = function (target_mc) {
_root.SplashScreenMC.FugazoLogoMC._visible = false;
_root.SplashScreenMC.PublisherLogoMC._x = (Stage.width - target_mc._width) / 2;
_root.SplashScreenMC.PublisherLogoMC._y = (Stage.height - target_mc._height) / 2;
_root.SplashScreenMC.PublisherLogoMC._alpha = 10;
};
_local2.addListener(_local3);
_local2.loadClip(splashLogosList[currentLogoIndex].img_url, _root.SplashScreenMC.PublisherLogoMC);
_root.SplashScreenMC.onEnterFrame = FadeInOutImage;
}
function FadeInOutImage() {
_root.fadeInOutCountDown--;
if (_root.fadeInOutCountDown < 0) {
_root.SplashScreenMC.onEnterFrame = undefined;
ShowLogos();
} else if ((_root.fadeInOutCountDown / (showTime * 24)) > 0.6) {
_root.SplashScreenMC.PublisherLogoMC._alpha = _root.SplashScreenMC.PublisherLogoMC._alpha + 5;
} else if ((_root.fadeInOutCountDown / (showTime * 24)) < 0.4) {
_root.SplashScreenMC.PublisherLogoMC._alpha = _root.SplashScreenMC.PublisherLogoMC._alpha - 5;
}
}
function FindNode(node, nodeName) {
if (node.nodeName == nodeName) {
return(node);
}
var _local1 = 0;
while (node.childNodes && (_local1 < node.childNodes.length)) {
var _local2 = FindNode(node.childNodes[_local1], nodeName);
if (_local2 != null) {
return(_local2);
}
_local1++;
}
return(null);
}
function GetValue(node) {
if (node && (node.firstChild)) {
return(node.firstChild.nodeValue);
}
return("");
}
function PlaySound(arrayPos, skipIfSameSoundPlaying, loop, stopBeforePlaying) {
currArrayPos = arrayPos;
if (skipIfSameSoundPlaying and (currArrayPos == arrayPos)) {
trace((("Sound ->>>>>>>> " + sound.position) + ", ") + sound.duration);
if (sound.position < sound.duration) {
return(undefined);
}
}
if (stopBeforePlaying == true) {
sound.stop();
}
sound.attachSound(soundArray[arrayPos]);
if ((loop == undefined) or (loop == false)) {
sound.start();
} else {
trace((("Sound->>" + arrayPos) + ", ") + loop);
sound.start(0, 2147483647);
}
}
function StopSound() {
sound.stop();
}
function SetVolume(newVolume) {
trace("SetVolume: " + newVolume);
sound.setVolume(newVolume);
}
function GetVolume() {
return(sound.getVolume());
}
function Mute(isInternalMute) {
if (_root.isGamePaused) {
return(undefined);
}
if (GetVolume() == 0) {
return(undefined);
}
oldVolume = GetVolume();
SetVolume(0);
if (!isInternalMute) {
_root.isGameMute = true;
} else {
_root.isGameMute = false;
}
}
function Unmute(isInternalUnMute) {
if (_root.isGamePaused) {
return(undefined);
}
if (isInternalUnMute) {
if (_root.isGameMute) {
return(undefined);
}
}
SetVolume(oldVolume);
_root.isGameMute = false;
}
function Init() {
CreateHatMC();
finishedMC = _root.attachMovie("Finished", "FinishedMC", _root.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2, _visible:false});
finishedMC.addEventListener(_root.EVENT_FINISHED_MC_COMPLETE, FinishedMCCompleteHandler);
scoreboardMC = _root.attachMovie("Scoreboard", "ScoreboardMC", _root.getNextHighestDepth(), {_visible:false});
scoreboardMC._x = (scoreboardMC._width / 2) - 4;
scoreboardMC._y = (scoreboardMC._height / 2) - 1;
stepChefFaceMC = _root.attachMovie("HudBetterpotNeutral", "StepChefFaceMC", _root.getNextHighestDepth(), {_x:0, _y:0, _visible:false});
progressMC = _root.attachMovie("Progress", "ProgressMC", _root.getNextHighestDepth(), {_x:0, _y:334, _visible:false});
timerMC = _root.attachMovie("CATimer", "TimerMC", _root.getNextHighestDepth(), {_x:457, _y:0, _visible:false});
timerMC.addEventListener(CATimer.EVENT_TIME_OUT, TimeUpHandlerCore);
mouseMC = _root.attachMovie("MouseCursor", "MouseMC", _root.getNextHighestDepth());
mouseMC._x = _xmouse;
mouseMC._y = _ymouse;
Mouse.hide();
}
function CreateHatMC() {
hatMC = _root.attachMovie("HatAnimation", "HatMC", _root.getNextHighestDepth());
hatMC._visible = false;
hatMC._x = (Stage.width - hatMC._width) / 2;
hatMC._y = (Stage.height - hatMC._height) / 2;
}
function GotoFrame(newNextframe, isQuitPlaying) {
hatMC.swapDepths(_root.getNextHighestDepth());
hatMC.nextframe = newNextframe;
hatMC.isQuitPlaying = isQuitPlaying;
hatMC.play();
}
function GetMouseOnTop() {
mouseMC.swapDepths(_root.getNextHighestDepth());
}
function ShowFinishedMC() {
if (_root.isTimeUp) {
return(undefined);
}
_root.isMinigameFinished = true;
_root.minigameMC.BackgroundMC.TopHudMC.OptionsBtn.onPress = undefined;
_root.minigameMC.BackgroundMC.TopHudMC.HowToPlayBtn.onPress = undefined;
_root.timerMC.StopTimer();
_root.finishedMC._visible = true;
_root.finishedMC.swapDepths(_root.getNextHighestDepth());
_root.finishedMC.gotoAndPlay(2);
_root.PlaySound(SND_TIMEUP, false, false);
}
function FinishedMCCompleteHandler() {
MiniGameDone(false);
}
function ShowScoreboard() {
_root.scoreboardMC._visible = true;
_root.scoreboardMC.ShowScoreboard(_root.selectedRecipeName, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, timerMC.timeLeft, minigameProgress);
}
function PlayMiniGame() {
_root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepFunctionName();
SetupMiniGame();
GetMouseOnTop();
}
function SetupMiniGame() {
_root.isTimeUp = false;
_root.isMinigameFinished = false;
_root.minigameMC.BackgroundMC.TopHudMC._y = -_root.minigameMC._y;
_root.minigameMC.BackgroundMC.TopHudMC.OptionsBtn.onPress = MiniGameOptionsBtnOnPressHandler;
_root.minigameMC.BackgroundMC.TopHudMC.HowToPlayBtn.onPress = MiniGameHowToPlayBtnOnPressHandler;
_root.minigameMC.BackgroundMC.TopHudMC.OptionsBtn.onRollOver = MiniGameOptionsHowToPlayBtnOnRollOverHandler;
_root.minigameMC.BackgroundMC.TopHudMC.HowToPlayBtn.onRollOver = MiniGameOptionsHowToPlayBtnOnRollOverHandler;
_root.minigameMC.BackgroundMC.TopHudMC.OptionsBtn.onRollOut = MiniGameOptionsHowToPlayBtnOnRollOverHandler;
_root.minigameMC.BackgroundMC.TopHudMC.HowToPlayBtn.onRollOut = MiniGameOptionsHowToPlayBtnOnRollOverHandler;
_root.stepChefFaceMC._visible = true;
_root.stepChefFaceMC.swapDepths(_root.getNextHighestDepth());
_root.minigameMC.calloutMC.swapDepths(_root.minigameMC.calloutMC._parent.getNextHighestDepth());
if (_root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].showProgress) {
_root.progressMC._visible = true;
_root.progressMC.swapDepths(_root.getNextHighestDepth());
_root.progressMC.ResetProgress();
}
_root.timerMC._visible = true;
_root.timerMC.swapDepths(_root.getNextHighestDepth());
_root.timerMC.ResetTimer(_root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].allottedTime);
}
function MiniGameDone(isQuitPlaying) {
_root.StopSound();
minigameProgress = minigameMC.mProgress;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
_root.RemoveHintArrow();
_root.minigameMC.calloutMC._visible = false;
_root.minigameMC.calloutMC.swapDepths(minigameMC.calloutMC._parent.getNextHighestDepth());
_root.minigameMC.calloutMC.removeMovieClip();
_root.minigameMC.removeEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
_root.minigameMC.swapDepths(_root.getNextHighestDepth());
_root.minigameMC._visible = false;
_root.minigameMC.removeMovieClip();
_root.minigameMC = undefined;
_root.stepChefFaceMC._visible = false;
_root.progressMC._visible = false;
_root.timerMC._visible = false;
_root.isTimeUp = false;
_root.finishedMC._visible = false;
if (isQuitPlaying) {
_root.totalScore = 0;
} else {
_root.ShowScoreboard();
}
}
function ShowGoMC(additionalOnCompleteHandler, param1) {
var _local2 = _root.attachMovie("Go", "GoMC", _root.getNextHighestDepth());
_local2._x = (Stage.width - _local2._width) / 2;
_local2._y = (Stage.height - _local2._height) / 2;
_local2.onCompleteHandler = GoMCCompleteHandler;
_local2.additionalOnCompleteHandler = additionalOnCompleteHandler;
_local2.param1 = param1;
_local2.emptyMC = CreateEmptyMC();
_root.PlaySound(SND_TIMEUP, false, false);
}
function GoMCCompleteHandler(goMC) {
if (goMC.additionalOnCompleteHandler != undefined) {
goMC.additionalOnCompleteHandler(goMC.param1);
}
_root.RemoveGoMC(goMC);
}
function RemoveGoMC(goMC) {
removeMovieClip(goMC.emptyMC);
_root.timerMC.StartTimer(_root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].allottedTime);
removeMovieClip(goMC);
}
function ShowTimeUpMC() {
if (_root.isMinigameFinished) {
return(undefined);
}
_root.isTimeUp = true;
if (_root.minigameMC.TimeUpHandler != undefined) {
_root.minigameMC.TimeUpHandler();
}
_root.minigameMC.BackgroundMC.TopHudMC.OptionsBtn.onPress = undefined;
_root.minigameMC.BackgroundMC.TopHudMC.HowToPlayBtn.onPress = undefined;
timeUpMC = _root.attachMovie("TimeUp", "TimeUpMC", _root.getNextHighestDepth());
timeUpMC.emptyMC = CreateEmptyMC();
timeUpMC._x = (Stage.width - timeUpMC._width) / 2;
timeUpMC._y = (Stage.height - timeUpMC._height) / 2;
timeUpMC.gotoAndPlay(2);
_root.PlaySound(SND_TIMEUP, false, false);
}
function TimeUpHandlerCore() {
ShowTimeUpMC();
}
function TimeUpMCCompleteHandler() {
removeMovieClip(timeUpMC.emptyMC);
timeUpMC.swapDepths(_root.getNextHighestDepth());
timeUpMC.removeMovieClip();
timeUpMC = undefined;
MiniGameDone(false);
}
function ShowFinishScreen() {
var _local2 = _root.attachMovie("FinishScreen", "FinishScreenMC", _root.getNextHighestDepth(), {_x:0, _y:0});
_local2.emptyMC = CreateEmptyMC();
_local2.emptyMC._name = "EmptyMCFinishScreen";
_local2.swapDepths(_root.getNextHighestDepth());
_local2.Init(_root.selectedRecipeName, _root.recipeInfo[_root.selectedRecipeName][0].finalPictureMCName, _root.recipeInfo[_root.selectedRecipeName][0].finalPictureMCXPos, _root.recipeInfo[_root.selectedRecipeName][0].finalPictureMCYPos, totalScore, _root.recipeInfo[_root.selectedRecipeName][0].maxScore);
GetMouseOnTop();
}
function DoKneadMeat() {
var _local2 = _root.attachMovie("KneadMeat", "KneadMeatMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
var _local4 = (_local2._width / 2) - 10;
var _local3 = (_local2._height / 2) - 50;
stepsArray = new Array();
stepsArray = [{movieName:"KneadMeatStep1", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"KneadMeatStep2", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"KneadMeatStep3", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"KneadMeatStep4", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}];
_local2.Init(stepsArray, 12, _root.selectedRecipeName);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoGyozaFold() {
var _local3 = new Array();
_local3 = [{movieName:"GyozaWrapperAngle", xPos:365, yPos:108, functionType:GyozaFold.FUNCTION_TYPE_ONPRESS, numSteps:1, hintArrowDir:HINT_ARROW_DOWN, hintArrowXPos:400, hintArrowYPos:70}, {movieName:"GyozaFoldStep2", xPos:35, yPos:115, functionType:GyozaFold.FUNCTION_TYPE_ONPRESS, numSteps:1, hintArrowDir:HINT_ARROW_DOWN, hintArrowXPos:95, hintArrowYPos:85}, {movieName:"GyozaFoldStep3", xPos:185, yPos:190, functionParam1:undefined, functionType:undefined, numSteps:7}];
var _local2 = _root.attachMovie("GyozaFold", "GyozaFoldMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
_local2.Init(_local3, 5);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoGreenOnionCut() {
var _local2 = _root.attachMovie("GreenOnionCut", "GreenOnionCutMC", _root.getNextHighestDepth(), {_x:MINIGAME_XPOS, _y:MINIGAME_YPOS});
minigameMC = _local2;
_local2.Init(2);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoDiceGarlic() {
var _local2 = _root.attachMovie("Garlic_Dice", "GarlicDiceMC", _root.getNextHighestDepth(), {_x:MINIGAME_XPOS, _y:MINIGAME_YPOS});
minigameMC = _local2;
_local2.Init(2);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoAddIngredientsGyoza() {
var _local2 = new Array();
_local2[0] = {containerName:"Bowl", containerX:333, containerY:248, itemName:"GreenonionBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Green Onion!"};
_local2[1] = {containerName:"Bowl", containerX:300, containerY:172, itemName:"SoySauceBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Soy Sauce!"};
_local2[2] = {containerName:"Bowl", containerX:248, containerY:105, itemName:"GarlicBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Garlic!"};
_local2[3] = {containerName:"Teaspoon", containerX:118, containerY:125, itemName:"SugarTeaspoon", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Sugar!"};
_local2[4] = {containerName:"SaltShaker", containerX:48, containerY:168, itemName:"SaltPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Salt!"};
_local2[5] = {containerName:"BlackPepperShaker", containerX:32, containerY:244, itemName:"BlackPepperPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Black Pepper!"};
var _local3 = _root.attachMovie("AddIngredients", "AddIngredientsMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, "GroundPorkBigBowl", "That's Ground Pork!", _local3.HINT_FRAME_ANIMATE_SIZE);
_local3.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoDeepFryGyoza() {
var _local2 = new Array();
_local2[0] = {foodName:"DeepFryGyozaPiece", xPos:39, yPos:125, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:18, yPosInProgress:348};
_local2[1] = {foodName:"DeepFryGyozaPiece", xPos:36, yPos:158, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:268.6, yPosInProgress:348};
_local2[2] = {foodName:"DeepFryGyozaPiece", xPos:72, yPos:125, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:101.6, yPosInProgress:348};
_local2[3] = {foodName:"DeepFryGyozaPiece", xPos:69, yPos:158, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:352.2, yPosInProgress:348};
_local2[4] = {foodName:"DeepFryGyozaPiece", xPos:105, yPos:125, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:185.1, yPosInProgress:348};
_local2[5] = {foodName:"DeepFryGyozaPiece", xPos:102, yPos:158, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:435.8, yPosInProgress:348};
var _local4 = {maskName:"Mask", xPos:270, yPos:110, maskWidth:140, maskHeight:80};
var _local3 = _root.attachMovie("DeepFry", "DeepFryGyozaMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, _local4, -10, 100);
}
function DoAddIngredientsBruschetta() {
var _local2 = new Array();
_local2[0] = {containerName:"BlackPepperShaker", containerX:32, containerY:244, itemName:"BlackPepperPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Black Pepper!"};
_local2[1] = {containerName:"SaltShaker", containerX:80, containerY:120, itemName:"SaltPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Salt!"};
_local2[2] = {containerName:"Bowl", containerX:260, containerY:135, itemName:"DicedOnionBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Diced Onion!"};
_local2[3] = {containerName:"Bowl", containerX:330, containerY:230, itemName:"OliveOilBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Olive Oil!"};
var _local3 = _root.attachMovie("AddIngredients", "AddIngredientsMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, "DicedTomatoesBigBowl", "That's Diced Tomatoes!", _local3.HINT_FRAME_ANIMATE_QUESTION_MARK);
_local3.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoBaguetteSlice() {
var _local2 = _root.attachMovie("BaguetteSlice", "BaguetteSliceMC", _root.getNextHighestDepth(), {_x:MINIGAME_XPOS, _y:MINIGAME_YPOS});
minigameMC = _local2;
_local2.Init(2);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoOnionDice() {
var _local2 = _root.attachMovie("OnionDice", "OnionDiceMC", _root.getNextHighestDepth(), {_x:MINIGAME_XPOS, _y:MINIGAME_YPOS});
minigameMC = _local2;
_local2.Init(2);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoTomatoDice() {
var _local2 = _root.attachMovie("TomatoDice", "TomatoDiceMC", _root.getNextHighestDepth(), {_x:MINIGAME_XPOS, _y:MINIGAME_YPOS});
minigameMC = _local2;
_local2.Init();
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoBaguetteBake() {
var _local2 = new Array();
_local2[0] = {foodName:"BaguetteBake", xPos:181, yPos:165};
_local2[1] = {foodName:"BaguetteBake", xPos:281, yPos:165};
_local2[2] = {foodName:"BaguetteBake", xPos:381, yPos:165};
var _local3 = _root.attachMovie("Bake", "BakeBaguetteMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, "425");
}
function DoAvocadoSlice() {
var _local2 = _root.attachMovie("AvocadoSlice", "AvocadoSliceMC", _root.getNextHighestDepth(), {_x:MINIGAME_XPOS, _y:MINIGAME_YPOS});
minigameMC = _local2;
_local2.Init(2);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
_root.mouseMC.swapDepths(_root.getNextHighestDepth());
}
function DoMashAvocado() {
var _local2 = new Array();
_local2[0] = {foodName:"AvocadoMash", xPos:144, yPos:164};
_local2[1] = {foodName:"AvocadoMash", xPos:232, yPos:164};
_local2[2] = {foodName:"AvocadoMash", xPos:310, yPos:164};
_local2[3] = {foodName:"AvocadoMash", xPos:144, yPos:211};
_local2[4] = {foodName:"AvocadoMash", xPos:232, yPos:211};
_local2[5] = {foodName:"AvocadoMash", xPos:310, yPos:211};
_local2[6] = {foodName:"AvocadoMash", xPos:144, yPos:256};
_local2[7] = {foodName:"AvocadoMash", xPos:232, yPos:256};
_local2[8] = {foodName:"AvocadoMash", xPos:310, yPos:256};
var _local9 = {maskName:"Mask", xPos:220, yPos:110, maskWidth:320, maskHeight:80};
var _local3 = _root.attachMovie("Mash", "MashAvocadoMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2);
_local3.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoAddIngredientsGuacamole() {
var _local2 = new Array();
_local2[0] = {containerName:"Bowl", containerX:32, containerY:244, itemName:"DicedTomatoesBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Diced Tomatoes!"};
_local2[1] = {containerName:"Bowl", containerX:55, containerY:175, itemName:"DicedOnionBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Diced Onion!"};
_local2[2] = {containerName:"Bowl", containerX:110, containerY:125, itemName:"LimeJuiceBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Lime Juice!"};
_local2[3] = {containerName:"Bowl", containerX:185, containerY:90, itemName:"GarlicBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Garlic!"};
_local2[4] = {containerName:"Bowl", containerX:260, containerY:125, itemName:"OilBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Oil!"};
_local2[5] = {containerName:"SaltShaker", containerX:290, containerY:185, itemName:"SaltPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Salt!"};
_local2[6] = {containerName:"BlackPepperShaker", containerX:320, containerY:250, itemName:"BlackPepperPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Black Pepper!"};
var _local3 = _root.attachMovie("AddIngredients", "AddIngredientsMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, "AvocadoBigBowl", "That's Avocado!", _local3.HINT_FRAME_ANIMATE_MASK);
_local3.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoGuacamoleStirIngredients() {
var _local2 = _root.attachMovie("GuacamoleStir", "GuacamoleStirMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
var _local4 = (_local2._width / 2) - 10;
var _local3 = (_local2._height / 2) - 50;
stepsArray = new Array();
stepsArray = [{movieName:"GuacamoleStirStep1", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"GuacamoleStirStep2", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"GuacamoleStirStep6", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"GuacamoleStirStep8", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"GuacamoleStirStep3", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"GuacamoleStirStep4", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"GuacamoleStirStep5", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"GuacamoleStirStep7", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}];
_local2.Init(stepsArray, 12, _root.selectedRecipeName);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoAddIngredientsSpinachTriangles1() {
var _local2 = new Array();
_local2[0] = {containerName:"Bowl", containerX:350, containerY:230, itemName:"FetaBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Feta!"};
_local2[1] = {containerName:"SaltShaker", containerX:95, containerY:105, itemName:"SaltPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Salt!"};
_local2[2] = {containerName:"BlackPepperShaker", containerX:265, containerY:110, itemName:"BlackPepperPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Black Pepper!"};
_local2[3] = {containerName:"Teaspoon", containerX:20, containerY:260, itemName:"OreganoTeaspoon", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Oregano!"};
var _local3 = _root.attachMovie("AddIngredients", "AddIngredientsMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, "SpinachBigBowl", "That's Spinach!", _local3.HINT_FRAME_ANIMATE_QUESTION_MARK);
_local3.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoAddIngredientsSpinachTriangles2() {
var _local2 = new Array();
_local2[0] = {containerName:"Bowl", containerX:305, containerY:255, itemName:"OilBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Cooking Oil!"};
_local2[1] = {containerName:"SaltShaker", containerX:45, containerY:250, itemName:"SaltPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Salt!"};
_local2[2] = {containerName:"Bowl", containerX:170, containerY:95, itemName:"WaterBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Water!"};
var _local3 = _root.attachMovie("AddIngredients", "AddIngredientsMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, "FlourBigBowl", "That's Flour!", _local3.HINT_FRAME_ANIMATE_MASK);
_local3.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoKneadDough() {
var _local2 = _root.attachMovie("KneadDough", "KneadDoughMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
var _local4 = (_local2._width / 2) - 10;
var _local3 = (_local2._height / 2) - 50;
stepsArray = new Array();
stepsArray = [{movieName:"KneadDoughStep1", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"KneadDoughStep2", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"KneadDoughStep3", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}, {movieName:"KneadDoughStep4", xPos:_local4, yPos:_local3, eventName:KneadStep.KNEAD_STEP_COMPLETE}];
_local2.Init(stepsArray, 12, _root.selectedRecipeName);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoDoughRoll() {
var _local2 = _root.attachMovie("DoughRoll", "DoughRollMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
_local2.Init();
}
function DoDoughSlice() {
var _local2 = _root.attachMovie("DoughSlice", "DoughSliceMC", _root.getNextHighestDepth(), {_x:MINIGAME_XPOS, _y:MINIGAME_YPOS});
minigameMC = _local2;
_local2.Init(4);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoPhylloTrianglesFold() {
var _local3 = new Array();
_local3 = [{movieName:"SpinachTrianglesFoldStep1", xPos:285, yPos:95, functionType:GyozaFold.FUNCTION_TYPE_ONPRESS, numSteps:1, hintArrowDir:HINT_ARROW_LEFT, hintArrowXPos:442, hintArrowYPos:160}, {movieName:"SpinachTrianglesFoldStep2", xPos:65, yPos:240, functionType:"", numSteps:7, verticalTween:true}];
var _local2 = _root.attachMovie("SpinachTrianglesFold", "SpinachTrianglesFoldMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
_local2.Init(_local3, 5);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoBakePhylloTriangles() {
var _local2 = new Array();
_local2[0] = {foodName:"SpinachPhylloTrianglesBake", xPos:187, yPos:142};
_local2[1] = {foodName:"SpinachPhylloTrianglesBake", xPos:267, yPos:142};
_local2[2] = {foodName:"SpinachPhylloTrianglesBake", xPos:347, yPos:142};
_local2[3] = {foodName:"SpinachPhylloTrianglesBake", xPos:182, yPos:211};
_local2[4] = {foodName:"SpinachPhylloTrianglesBake", xPos:267, yPos:211};
_local2[5] = {foodName:"SpinachPhylloTrianglesBake", xPos:349, yPos:211};
var _local3 = _root.attachMovie("Bake", "BakePhylloTrianglesMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, "450");
}
function DoGrateGinger() {
var _local2 = _root.attachMovie("Grate", "GrateGingerMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
_local2.Init("GingerChunk", "GrateGinger", "GrateGingerFall", "GrateGingerFallParticle", Grate.GRATE_FOOD_TYPE_GINGER);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoGrateCarrot() {
var _local2 = _root.attachMovie("Grate", "GrateGingerMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
_local2.Init("CarrotChunk", "GrateCarrot", "GrateCarrotFall", "GrateCarrotFallParticle", Grate.GRATE_FOOD_TYPE_CARROT);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoBokChoyCut() {
var _local2 = _root.attachMovie("BokChoyCut", "BokChoyCutMC", _root.getNextHighestDepth(), {_x:MINIGAME_XPOS, _y:MINIGAME_YPOS});
minigameMC = _local2;
_local2.Init(2);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoAddIngredientsEggRolls() {
var _local2 = new Array();
_local2[0] = {containerName:"Bowl", containerX:320, containerY:255, itemName:"OilBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Cooking Oil!"};
_local2[1] = {containerName:"SaltShaker", containerX:160, containerY:95, itemName:"SaltPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Salt!"};
_local2[2] = {containerName:"BlackPepperShaker", containerX:25, containerY:170, itemName:"BlackPepperPour", itemType:AddIngredients.TYPE_SHAKE, calloutText:"That's Black Pepper!"};
_local2[3] = {containerName:"Teaspoon", containerX:25, containerY:290, itemName:"SugarTeaspoon", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Sugar!"};
_local2[4] = {containerName:"Bowl", containerX:290, containerY:160, itemName:"OysterSauceBowl", itemType:AddIngredients.TYPE_POUR, calloutText:"That's Oyster Sauce!"};
var _local3 = _root.attachMovie("AddIngredients", "AddIngredientsMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, "SoySauceBigBowl", "That's Soy Sauce!", _local3.HINT_FRAME_ANIMATE_QUESTION_MARK);
_local3.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoEggRollsFold() {
var _local3 = new Array();
_local3 = [{movieName:"EggRollsFoldStep1", xPos:42, yPos:90, functionType:GyozaFold.FUNCTION_TYPE_ONPRESS, numSteps:1, hintArrowDir:HINT_ARROW_DOWN, hintArrowXPos:95, hintArrowYPos:68}, {movieName:"EggRollsFoldStep2", xPos:265, yPos:140, functionType:"", numSteps:7, verticalTween:true}];
var _local2 = _root.attachMovie("EggRollsFold", "EggRollsFoldMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local2;
_local2.Init(_local3, 5);
_local2.addEventListener(_root.EVENT_PROGRESS_UPDATE, ProgressUpdateHandler);
}
function DoDeepFryEggRolls() {
var _local2 = new Array();
_local2[0] = {foodName:"DeepFryEggRolls", xPos:34, yPos:130, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:7, yPosInProgress:358};
_local2[1] = {foodName:"DeepFryEggRolls", xPos:34, yPos:147, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:70, yPosInProgress:358};
_local2[2] = {foodName:"DeepFryEggRolls", xPos:34, yPos:165, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:133, yPosInProgress:358};
_local2[3] = {foodName:"DeepFryEggRolls", xPos:34, yPos:183, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:196, yPosInProgress:358};
_local2[4] = {foodName:"DeepFryEggRolls", xPos:102, yPos:130, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:259, yPosInProgress:358};
_local2[5] = {foodName:"DeepFryEggRolls", xPos:102, yPos:147, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:322, yPosInProgress:358};
_local2[6] = {foodName:"DeepFryEggRolls", xPos:102, yPos:165, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:385, yPosInProgress:358};
_local2[7] = {foodName:"DeepFryEggRolls", xPos:102, yPos:183, foodCorrectStateFrame:FRAME_FOOD_GYOZA_DEEP_FRIED, xPosInProgress:448, yPosInProgress:358};
var _local4 = {maskName:"Mask", xPos:270, yPos:110, maskWidth:140, maskHeight:80};
var _local3 = _root.attachMovie("DeepFry", "DeepFryGyozaMC", _root.getNextHighestDepth(), {_x:0, _y:0});
minigameMC = _local3;
_local3.Init(_local2, _local4, -10, 99);
}
function ProgressUpdateHandler() {
_root.progressMC.Update(this.mProgress, this.mBadProgress);
_root.minigameProgress = this.mProgress;
}
function RandRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function ShuffleArray(array) {
var _local3 = array.length;
var _local1 = array.slice();
var _local5;
var _local2;
var _local4;
_local2 = 0;
while (_local2 < _local3) {
_local4 = _local1[_local2];
_local5 = random(_local3);
_local1[_local2] = _local1[_local5];
_local1[_local5] = _local4;
_local2++;
}
return(_local1);
}
function RoundTo(num, roundToInterval) {
if (roundToInterval == undefined) {
roundToInterval = 1;
}
return(Math.round(num / roundToInterval) * roundToInterval);
}
function IsNumBetween(numToCheck, fromNum, toNum) {
if ((numToCheck >= fromNum) && (numToCheck <= toNum)) {
return(true);
}
return(false);
}
function ChangeMouseCursorToHand(operatingMC) {
if (IsNumBetween(_xmouse, operatingMC._x, operatingMC._x + operatingMC._width)) {
if (IsNumBetween(_ymouse, operatingMC._y, operatingMC._y + operatingMC._height)) {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
}
}
function CreateCalloutMC(parentMC, calloutText, calloutMaxWidth, calloutType, xPos, yPos) {
parentMC = _root;
var _local2 = parentMC.attachMovie("Callout", "CalloutMC", parentMC.getNextHighestDepth(), {_x:xPos, _y:yPos});
_local2.Init(calloutText, calloutMaxWidth, calloutType);
return(_local2);
}
function ChangeCalloutMCText(calloutMC, newCallOutText) {
var _local6 = calloutMC._parent;
var _local5 = calloutMC.calloutWidth;
var _local2 = calloutMC.calloutType;
var _local4 = calloutMC._x;
var _local3 = calloutMC._y;
calloutMC.swapDepths(calloutMC._parent.getNextHighestDepth());
calloutMC.removeMovieClip();
calloutMC = undefined;
calloutMC = CreateCalloutMC(_local6, newCallOutText, _local5, _local2, _local4, _local3);
}
function CreateEmptyMC() {
var _local2 = _root.attachMovie("EmptyMC", "EmptyMC", _root.getNextHighestDepth(), {_x:0, _y:0, _width:Stage.width, _height:Stage.height, _alpha:0});
_local2.onPress = function () {
};
return(_local2);
}
function RemoveMovieClip(mcToRemove) {
trace((("Core: RemoveMovieClip: mcToRemove = " + mcToRemove) + ", ") + mcToRemove._parent);
mcToRemove._visible = false;
mcToRemove.swapDepths(mcToRemove._parent.getNextHighestDepth());
mcToRemove.removeMovieClip();
mcToRemove = undefined;
trace("Core: RemoveMovieClip: after mcToRemove = " + mcToRemove);
}
function ShowHintArrow(direction, xPos, yPos) {
var _local2 = "HintArrow" + direction;
hintArrowMC = _root.attachMovie(_local2, _local2 + "MC", _root.getNextHighestDepth(), {_x:xPos, _y:yPos});
}
function RemoveHintArrow() {
if (hintArrowMC == undefined) {
return(undefined);
}
hintArrowMC._visible = false;
hintArrowMC.swapDepths(_root.getNextHighestDepth());
hintArrowMC.removeMovieClip();
hintArrowMC = undefined;
}
function ShowUpsellScreen(headingText) {
trace("Core: ShowUpsellScreen: headingText = " + headingText);
var _local4 = CreateEmptyMC();
var _local3 = _root.attachMovie("UpsellScreen", "UpsellScreenMC", _root.getNextHighestDepth(), {_x:0, _y:0});
_local3.emptyMC = _local4;
var _local2 = new TextFormat();
if (headingText != undefined) {
_local3.HeadingText.text = headingText;
_local2.align = "center";
}
_local2.font = "TimesNewRomanBold";
_local2.bold = true;
_local2.size = 14;
_local3.HeadingText.setTextFormat(_local2);
_root.GetMouseOnTop();
_root.PlaySound(SND_BUTTON, false, false);
}
function OnPressHandler() {
_root.PlaySound(_root.SND_BUTTON, false, false);
}
function GetTotalScoreForAllRecipes() {
var _local2 = 0;
if (_root.recipeInfo[_root.RECIPE_NAME_GYOZA][0].totalScore != -1) {
_local2 = _local2 + _root.recipeInfo[_root.RECIPE_NAME_GYOZA][0].totalScore;
}
if (_root.recipeInfo[_root.RECIPE_NAME_BRUSCHETTA][0].totalScore != -1) {
_local2 = _local2 + _root.recipeInfo[_root.RECIPE_NAME_BRUSCHETTA][0].totalScore;
}
if (_root.recipeInfo[_root.RECIPE_NAME_GUACAMOLE][0].totalScore != -1) {
_local2 = _local2 + _root.recipeInfo[_root.RECIPE_NAME_GUACAMOLE][0].totalScore;
}
if (_root.recipeInfo[_root.RECIPE_NAME_SPINACH_TRIANGLES][0].totalScore != -1) {
_local2 = _local2 + _root.recipeInfo[_root.RECIPE_NAME_SPINACH_TRIANGLES][0].totalScore;
}
if (_root.recipeInfo[_root.RECIPE_NAME_EGG_ROLLS][0].totalScore != -1) {
_local2 = _local2 + _root.recipeInfo[_root.RECIPE_NAME_EGG_ROLLS][0].totalScore;
}
return(_local2);
}
function GetCurrentLevel() {
var _local2 = 0;
if (_root.recipeInfo[_root.RECIPE_NAME_GYOZA][0].totalScore != -1) {
_local2++;
}
if (_root.recipeInfo[_root.RECIPE_NAME_BRUSCHETTA][0].totalScore != -1) {
_local2++;
}
if (_root.recipeInfo[_root.RECIPE_NAME_GUACAMOLE][0].totalScore != -1) {
_local2++;
}
if (_root.recipeInfo[_root.RECIPE_NAME_SPINACH_TRIANGLES][0].totalScore != -1) {
_local2++;
}
if (_root.recipeInfo[_root.RECIPE_NAME_EGG_ROLLS][0].totalScore != -1) {
_local2++;
}
return(_local2);
}
function SubmitTotalScoreToPublishersAPI(scoreToSubmit) {
trace("Core: SubmitTotalScoreToPublishersAPI: totalScoreForAllRecipes = " + totalScoreForAllRecipes);
if (_root.REFLEXIVE_API_ENABLED) {
trace("Core: SubmitTotalScoreToPublishersAPI: reflexiveAPI = " + reflexiveAPI);
if (reflexiveAPI == undefined) {
reflexiveAPI = com.reflexive.as2.ReflexiveAPI.getInstance();
}
trace("Core: SubmitTotalScoreToPublishersAPI: 2 reflexiveAPI = " + reflexiveAPI);
reflexiveAPI.submitScore(scoreToSubmit);
}
if (_root.MSN_API_ENABLED) {
fscommand ("ScoreSubmit", ("<game><score>" + scoreToSubmit) + "</score><time></time></game>");
fscommand ("GameBreak", ("<data><breakpoint>" + _root.GetCurrentLevel()) + "</breakpoint></data>");
}
if (_root.REAL_API_ENABLED) {
fscommand ("ScoreSubmit", ("<game><score>" + scoreToSubmit) + "</score><time></time></game>");
_global.rgdata.rgfscommand("ScoreSubmit", ("<game><score>" + scoreToSubmit) + "</score><time></time></game>");
fscommand ("GameBreak", ("<data><breakpoint>" + _root.GetCurrentLevel()) + "</breakpoint></data>");
_global.rgdata.rgfscommand("GameBreak", ("<data><breakpoint>" + _root.GetCurrentLevel()) + "</breakpoint></data>");
}
}
function SubmitScoreToPublishersAPI(scoreToSubmit) {
trace("Core: SubmitScoreToPublishersAPI: totalScoreForAllRecipes = " + totalScoreForAllRecipes);
if (_root.MSN_API_ENABLED) {
fscommand ("ScoreBroadcast", ("<game><score>" + scoreToSubmit) + "</score><time></time></game>");
}
if (_root.REAL_API_ENABLED) {
fscommand ("ScoreBroadcast", ("<game><score>" + scoreToSubmit) + "</score><time></time></game>");
_global.rgdata.rgfscommand("ScoreBroadcast", ("<game><score>" + scoreToSubmit) + "</score><time></time></game>");
}
}
function AddPauseFunctionality() {
var _local2 = new Object();
_local2.onKeyUp = function () {
if (Key.getCode() == 80) {
_root.PauseGame();
} else if (Key.getCode() == 82) {
_root.ResumeGame();
}
};
Key.addListener(_local2);
}
function PauseGame() {
if (isGamePaused) {
return(undefined);
}
smokeScreen = _root.attachMovie("SmokeScreen", "SmokeScreenMC", _root.getNextHighestDepth(), {_x:0, _y:0, _width:Stage.width, _height:Stage.height});
smokeScreen.onPress = function () {
};
_root.GetMouseOnTop();
_root.Mute(true);
isGamePaused = true;
_root.timerMC.PauseTimer();
if (hintArrowMC != undefined) {
hintArrowMC._visible = false;
}
if (_root.minigameMC != undefined) {
for (var _local2 in _root.minigameMC.tweensObj) {
tween = _root.minigameMC.tweensObj[_local2];
trace("Core: PauseGame: pause tween " + _local2);
if (tween.time < tween.duration) {
trace((("Core: PauseGame: " + _root.minigameMC.tweensObj[_local2].time) + ", ") + _root.minigameMC.tweensObj[_local2].duration);
tween.stop();
}
trace("Core: PauseGame: ------------------");
}
}
}
function ResumeGame() {
if (!isGamePaused) {
return(undefined);
}
smokeScreen.onPress = undefined;
smokeScreen.swapDepths(_root.getNextHighestDepth());
smokeScreen.removeMovieClip();
smokeScreen = undefined;
if (hintArrowMC != undefined) {
hintArrowMC._visible = true;
}
isGamePaused = false;
_root.Unmute(true);
if (_root.minigameMC != undefined) {
trace(_root.minigameMC);
if ((_root.optionsMC == undefined) && (_root.HelpBoxMC == undefined)) {
_root.timerMC.ResumeTimer();
}
for (var _local2 in _root.minigameMC.tweensObj) {
tween = _root.minigameMC.tweensObj[_local2];
if (tween.time < tween.duration) {
tween.resume();
}
}
}
}
function CreateOptionsBox(isInMiniGame) {
if (isInMiniGame) {
_root.timerMC.PauseTimer();
if (_root.minigameMC.miniGamePaused != undefined) {
_root.minigameMC.miniGamePaused = true;
}
}
_root.emptyMC = CreateEmptyMC();
optionsMC = _root.attachMovie("Options", "OptionsMC", _root.getNextHighestDepth());
trace("CreateOptionsBox " + optionsMC);
optionsMC._x = (Stage.width - optionsMC._width) / 2;
optionsMC._y = Stage.height;
GetMouseOnTop();
optionsMC.CloseBtn._visible = !isInMiniGame;
optionsMC.BackBtn._visible = isInMiniGame;
optionsMC.QuitBtn._visible = isInMiniGame;
var _local3 = new mx.transitions.Tween(optionsMC, "_y", mx.transitions.easing.None.easeNone, optionsMC._y, (Stage.height - optionsMC._height) / 2, 6, false);
_local3.onMotionFinished = OptionsTweenFinishHandler;
if (isInMiniGame) {
optionsMC.BackBtn.onPress = OptionsBackBtnOnPressHandler;
optionsMC.QuitBtn.onPress = OptionsQuitBtnOnPressHandler;
optionsMC.BackBtn.onRollOver = OnRollOverHandler;
optionsMC.QuitBtn.onRollOver = OnRollOverHandler;
optionsMC.BackBtn.onRollOut = OnRollOutHandler;
optionsMC.QuitBtn.onRollOut = OnRollOutHandler;
} else {
optionsMC.CloseBtn.onPress = OptionsCloseBtnOnPressHandler;
}
optionsMC.CloseBtn.onRollOver = OnRollOverHandler;
optionsMC.CloseBtn.onRollOut = OnRollOutHandler;
}
function OptionsTweenFinishHandler() {
optionsMC.MusicVolumeSliderMC.Init(1, 100, undefined);
optionsMC.SoundVolumeSliderMC.Init(1, 100, UpdateSoundVolume);
optionsMC.CustomCursorsMC.isChecked = _root.useCustomCursors;
var _local2 = _root.GetVolume();
trace("GetVolume " + _local2);
optionsMC.SoundVolumeSliderMC.SliderThumbMC._x = ((_local2 / 100) * optionsMC.SoundVolumeSliderMC._width) - (optionsMC.SoundVolumeSliderMC.SliderThumbMC._width - 2);
if (optionsMC.SoundVolumeSliderMC.SliderThumbMC._x < 0) {
optionsMC.SoundVolumeSliderMC.SliderThumbMC._x = 0;
}
}
function UpdateSoundVolume() {
_root.SetVolume(optionsMC.SoundVolumeSliderMC.sliderValue);
}
function CreateQuitPlayingDialogBox(isInMiniGame) {
quitPlayingMC = _root.attachMovie("QuitPlaying", "QuitPlayingMC", _root.getNextHighestDepth());
quitPlayingMC._x = (Stage.width - optionsMC._width) / 2;
quitPlayingMC._y = Stage.height;
GetMouseOnTop();
var _local2 = new mx.transitions.Tween(quitPlayingMC, "_y", mx.transitions.easing.None.easeNone, quitPlayingMC._y, (Stage.height - quitPlayingMC._height) / 2, 6, false);
quitPlayingMC.CancelBtn.onPress = QuitPlayingCancelBtnOnPressHandler;
quitPlayingMC.QuitBtn.onPress = QuitPlayingQuitBtnOnPressHandler;
quitPlayingMC.CancelBtn.onRollOver = OnRollOverHandler;
quitPlayingMC.QuitBtn.onRollOver = OnRollOverHandler;
}
function OptionsQuitBtnOnPressHandler() {
CreateQuitPlayingDialogBox();
}
function OptionsBackBtnOnPressHandler() {
_root.PlaySound(SND_BUTTON, false, false);
ApplyOptions();
removeMovieClip(_root.emptyMC);
removeMovieClip(_root.optionsMC);
_root.optionsMC = undefined;
_root.timerMC.ResumeTimer();
if (_root.minigameMC.miniGamePaused != undefined) {
_root.minigameMC.miniGamePaused = false;
}
}
function OptionsCloseBtnOnPressHandler() {
_root.PlaySound(SND_BUTTON, false, false);
ApplyOptions();
_root.RemoveMovieClip(_root.emptyMC);
_root.RemoveMovieClip(_root.optionsMC);
_root.optionsMC = undefined;
}
function QuitPlayingCancelBtnOnPressHandler() {
_root.PlaySound(SND_BUTTON, false, false);
removeMovieClip(_root.quitPlayingMC);
}
function QuitPlayingQuitBtnOnPressHandler() {
_root.PlaySound(SND_BUTTON, false, false);
ApplyOptions();
removeMovieClip(_root.emptyMC);
removeMovieClip(_root.quitPlayingMC);
removeMovieClip(_root.optionsMC);
_root.optionsMC = undefined;
_root.GotoFrame(FRAME_MAINMENU, true);
}
function MiniGameOptionsBtnOnPressHandler() {
_root.PlaySound(SND_BUTTON, false, false);
trace("Options: MiniGameOptionsBtnOnPressHandler");
CreateOptionsBox(true);
}
function MiniGameOptionsHowToPlayBtnOnRollOverHandler() {
_root.PlaySound(SND_HIGHLIGHT, false, false);
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
function MiniGameOptionsHowToPlayBtnOnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function MiniGameHowToPlayBtnOnPressHandler() {
_root.PlaySound(SND_BUTTON, false, false);
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
CreateHelpBox();
}
function CreateHelpBox() {
_root.timerMC.PauseTimer();
if (_root.minigameMC.miniGamePaused != undefined) {
_root.minigameMC.miniGamePaused = true;
}
emptyMC = CreateEmptyMC();
helpBoxMC = _root.attachMovie("HelpBox", "HelpBoxMC", _root.getNextHighestDepth());
helpBoxMC.BackBtn.onPress = HelpBoxBackBtnOnPressHandler;
helpBoxMC.BackBtn.onRollOver = OnRollOverHandler;
_root.HelpBoxMC = helpBoxMC;
trace("CreateHelpBox " + helpBoxMC);
helpBoxMC._x = (Stage.width - helpBoxMC._width) / 2;
helpBoxMC._y = (Stage.height - helpBoxMC._height) / 2;
GetMouseOnTop();
helpBoxMC.TitleText.text = _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle;
helpBoxMC.DetailsText.text = _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepDetails;
}
function HelpBoxBackBtnOnPressHandler() {
_root.PlaySound(SND_BUTTON, false, false);
removeMovieClip(_root.emptyMC);
trace("Helpbox MC to be removed : " + _root.HelpBoxMC);
removeMovieClip(helpBoxMC);
trace("Helpbox MC Removed : " + _root.HelpBoxMC);
_root.HelpBoxMC = undefined;
_root.timerMC.ResumeTimer();
if (_root.minigameMC.miniGamePaused != undefined) {
_root.minigameMC.miniGamePaused = false;
}
}
function ApplyOptions() {
_root.useCustomCursors = optionsMC.CustomCursorsMC.isChecked;
if (_root.useCustomCursors) {
Mouse.hide();
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
} else {
Mouse.show();
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_EMPTY);
}
}
function OnRollOverHandler() {
_root.PlaySound(_root.SND_HIGHLIGHT, false, false);
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
function OnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function MSNCallSessionReady() {
if (_root.sessionStartCalled) {
return(undefined);
}
fscommand ("SessionReady", "<data></data>");
setTimeout(CallSessionReady, 5000);
}
function RealCallSessionReady() {
if (_root.sessionStartCalled) {
return(undefined);
}
fscommand ("SessionReady", "<data></data>");
_global.rgdata.rgfscommand("SessionReady", "<data></data>");
setTimeout(CallSessionReady, 5000);
}
stop();
Stage.showMenu = false;
this._lockroot = true;
var VERSION_MAJOR = "1";
var VERSION_MINOR = "0";
var VERSION_REVISION = "10";
var REFLEXIVE_API_ENABLED = false;
var MSN_API_ENABLED = false;
var REAL_API_ENABLED = false;
var AOL_API_ENABLED = false;
var FREE_DOWNLOAD_URL = "http://www.gamecentersolution.com/downloadgame.aspx?AID=1114&CID=23460";
var UPSELL_WEBGAME_COMPLETED_STRING = "You have completed the Cooking Academy Web Demo!";
var UPSELL_UNLOCK_MORE_FEATURES_STRING_START = "Unlock ";
var UPSELL_UNLOCK_MORE_FEATURES_STRING_END = " and much, much more!";
var FRAME_FUGAZOLOGO = "FrameFugazoLogo";
var FRAME_TITLE_SCREEN = "FrameTitleScreen";
var FRAME_MAINMENU = "FrameMainMenu";
var FRAME_RECIPE_BOOK = "FrameRecipeBook";
var FRAME_INSTRUCTIONS = "FrameInstructions";
var FRAME_MINIGAME = "FrameMiniGame";
var FRAME_MOUSEMC_POINTER = "FrameMouseMCPointer";
var FRAME_MOUSEMC_HAND = "FrameMouseMCHand";
var FRAME_MOUSEMC_KNIFE = "FrameMouseMCKnife";
var FRAME_MOUSEMC_DRAGGING = "FrameMouseMCDragging";
var FRAME_MOUSEMC_EMPTY = "FrameMouseMCEmpty";
var FRAME_REDCURSOR_POINTER = "FrameRedCursorPointer";
var FRAME_REDCURSOR_HAND = "FrameRedCursorHand";
var FRAME_REDCURSOR_DRAGGING = "FrameRedCursorDragging";
var FRAME_SB_CHEF_NATURAL = "FrameSBChefNatural";
var FRAME_SB_CHEF_HAPPY = "FrameSBChefHappy";
var FRAME_SB_CHEF_UPSET = "FrameSBChefUpset";
var FRAME_FOOD_GYOZA_RAW = "FrameFoodGyozaRaw";
var FRAME_FOOD_GYOZA_FRY = "FrameFoodGyozaFry";
var FRAME_FOOD_GYOZA_DEEP_FRIED = "FrameFoodGyozaDeepFried";
var FRAME_FOOD_GYOZA_BURNT = "FrameFoodGyozaBurnt";
var FRAME_BAKE_FOOD_RAW = "FrameBakeFoodRaw";
var FRAME_BAKE_FOOD_GOOD = "FrameBakeFoodGood";
var FRAME_BAKE_FOOD_GREAT = "FrameBakeFoodGreat";
var FRAME_BAKE_FOOD_GOOD2 = "FrameBakeFoodGood2";
var FRAME_BAKE_FOOD_BURNT = "FrameBakeFoodBurnt";
var GAMEPLAY_MODE_NONE = 0;
var GAMEPLAY_MODE_PRACTICE = 1;
var GAMEPLAY_MODE_COOK = 2;
var MINIGAME_XPOS = 0;
var MINIGAME_YPOS = 15;
var MINIGAME_CALLOUT_WIDTH = 160;
var MINIGAME_ADDINGREDIENTS_CALLOUT_WIDTH = 150;
var MINIGAME_CALLOUT_XPOS = 80;
var MINIGAME_CALLOUT_YPOS = 6;
var SCOREBOARD_CALLOUT_TEXT_UPSET = "I'm sure you can do better than that...";
var SCOREBOARD_CALLOUT_TEXT_NEUTRAL = "Very good.";
var SCOREBOARD_CALLOUT_TEXT_HAPPY = "Excellent!";
var FINALSCREEN_CALLOUT_TEXT_UPSET = "Don't worry, you will get it eventually with practice.";
var FINALSCREEN_CALLOUT_TEXT_NEUTRAL = "Good work, you are coming along quite well.";
var FINALSCREEN_CALLOUT_TEXT_HAPPY = "That is absolutely delicious!";
var HINT_ARROW_UP = "Up";
var HINT_ARROW_DOWN = "Down";
var HINT_ARROW_LEFT = "Left";
var HINT_ARROW_RIGHT = "Right";
var EVENT_PROGRESS_UPDATE = "ProgressUpdate";
var EVENT_FINISHED_MC_COMPLETE = "EventFinishedMCComplete";
var RECIPE_NAME_GYOZA = "Gyoza";
var RECIPE_NAME_BRUSCHETTA = "Bruschetta";
var RECIPE_NAME_GUACAMOLE = "Guacamole";
var RECIPE_NAME_SPINACH_TRIANGLES = "Spinach Triangles";
var RECIPE_NAME_EGG_ROLLS = "Egg Rolls";
var recipeInfo = new Object();
recipeInfo.selectedRecipeName = "";
recipeInfo.currentStep = "";
recipeInfo[RECIPE_NAME_GYOZA] = new Array();
recipeInfo[RECIPE_NAME_GYOZA][0] = {stepTitle:"Gyoza", stepDetails:"Did you know that Gyoza dates back to the Song Dynasty in Ancient China, where it was known as \"guotie\"? That makes it over 1000 years old!", stepFunctionName:null, allottedTime:0, showProgress:false, maxScore:600, totalScore:-1, gradeStr:(String = ""), finalPictureMCName:"GyozaFinal", finalPictureMCXPos:135, finalPictureMCYPos:135, recipeBookXPos:285, recipeBookYPos:200};
recipeInfo[RECIPE_NAME_GYOZA][1] = {stepTitle:"Dice the Garlic!", stepDetails:"Click the knife to dice up the Garlic.", stepFunctionName:DoDiceGarlic, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_GYOZA][2] = {stepTitle:"Dice the Green Onion!", stepDetails:"Click the knife to dice up the Green Onion.", stepFunctionName:DoGreenOnionCut, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_GYOZA][3] = {stepTitle:"Add the Ingredients!", stepDetails:"Click and drag to add the Ingredients into into the red bowl. Add the Ingredients in the correct order by using the visual clues.", stepFunctionName:DoAddIngredientsGyoza, allottedTime:40000, showProgress:true};
recipeInfo[RECIPE_NAME_GYOZA][4] = {stepTitle:"Knead the Gyoza Meat!", stepDetails:"Trace the lines to Knead the Gyoza Meat.", stepFunctionName:DoKneadMeat, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_GYOZA][5] = {stepTitle:"Fold Gyoza!", stepDetails:"Follow the steps to learn how to fold Gyoza.", stepFunctionName:DoGyozaFold, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_GYOZA][6] = {stepTitle:"Deep Fry Gyoza!", stepDetails:"Grab the food and drop it into the pot. Don't remove the food too quickly! Wait for the food to turn golden brown, then grab it and place it on the lower tray.", stepFunctionName:DoDeepFryGyoza, allottedTime:60000, showProgress:false};
recipeInfo[RECIPE_NAME_BRUSCHETTA] = new Array();
recipeInfo[RECIPE_NAME_BRUSCHETTA][0] = {stepTitle:"Bruschetta", stepDetails:"Did you know that people have been eating bruschetta since the 15th Century? That's over 500 years!", stepFunctionName:null, allottedTime:0, showProgress:false, maxScore:500, totalScore:-1, gradeStr:(String = ""), finalPictureMCName:"BruschettaFinal", finalPictureMCXPos:145, finalPictureMCYPos:160, recipeBookXPos:295, recipeBookYPos:220};
recipeInfo[RECIPE_NAME_BRUSCHETTA][1] = {stepTitle:"Dice the Tomato!", stepDetails:"Trace the lines to dice up Tomato.", stepFunctionName:DoTomatoDice, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_BRUSCHETTA][2] = {stepTitle:"Dice the Onion!", stepDetails:"Trace the lines to slice. Then click the knife to dice up Onion.", stepFunctionName:DoOnionDice, allottedTime:45000, showProgress:true};
recipeInfo[RECIPE_NAME_BRUSCHETTA][3] = {stepTitle:"Add the Ingredients!", stepDetails:"Click and drag to add the Ingredients into into the red bowl. Add the Ingredients in the correct order by using the visual clues.", stepFunctionName:DoAddIngredientsBruschetta, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_BRUSCHETTA][4] = {stepTitle:"Slice the Baguette!", stepDetails:"Trace the lines to slice up the Baguette.", stepFunctionName:DoBaguetteSlice, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_BRUSCHETTA][5] = {stepTitle:"Bake Baguette!", stepDetails:"Enter the correct baking temperature and press \"On\". Then press \"Off\" when the meter is in the dark green zone. Hit \"Reset\" if you enter the wrong temperature.", stepFunctionName:DoBaguetteBake, allottedTime:30000, showProgress:false};
recipeInfo[RECIPE_NAME_GUACAMOLE] = new Array();
recipeInfo[RECIPE_NAME_GUACAMOLE][0] = {stepTitle:"Guacamole", stepDetails:"Guacamole was invented thousands of years ago by the ancient Aztecs. The Aztecs did not use mayonnaise in their Guacamole and neither will we.", stepFunctionName:null, allottedTime:0, showProgress:false, maxScore:500, totalScore:-1, gradeStr:(String = ""), finalPictureMCName:"GuacamoleFinal", finalPictureMCXPos:140, finalPictureMCYPos:106, recipeBookXPos:285, recipeBookYPos:180};
recipeInfo[RECIPE_NAME_GUACAMOLE][1] = {stepTitle:"Slice the Avocado!", stepDetails:"Trace the lines to slice up the Avocado.", stepFunctionName:DoAvocadoSlice, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_GUACAMOLE][2] = {stepTitle:"Dice the Garlic!", stepDetails:"Click the knife to dice up the Garlic.", stepFunctionName:DoDiceGarlic, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_GUACAMOLE][3] = {stepTitle:"Mash the Avocado!", stepDetails:"Watch for the shadow. When you see the shadow click on it to mash Avocado", stepFunctionName:DoMashAvocado, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_GUACAMOLE][4] = {stepTitle:"Add the Ingredients!", stepDetails:"Click and drag to add the Ingredients into into the red bowl. Add the Ingredients in the correct order by using the visual clues.", stepFunctionName:DoAddIngredientsGuacamole, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_GUACAMOLE][5] = {stepTitle:"Stir the Ingredients!", stepDetails:"Trace the green lines to stir the ingredients together.", stepFunctionName:DoGuacamoleStirIngredients, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES] = new Array();
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][0] = {stepTitle:"Spinach Triangles", stepDetails:"Would you believe that in 1937, American spinach growers erected a statue in honor of Popeye the Sailor Man?", stepFunctionName:null, allottedTime:0, showProgress:false, maxScore:900, totalScore:-1, gradeStr:(String = ""), finalPictureMCName:"SpinachTrianglesFinal", finalPictureMCXPos:140, finalPictureMCYPos:160, recipeBookXPos:291, recipeBookYPos:221};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][1] = {stepTitle:"Dice the Garlic!", stepDetails:"Click the knife to dice up the Garlic.", stepFunctionName:DoDiceGarlic, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][2] = {stepTitle:"Dice the Onion!", stepDetails:"Trace the lines to slice. Then click the knife to dice up Onion.", stepFunctionName:DoOnionDice, allottedTime:45000, showProgress:true};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][3] = {stepTitle:"Add the Ingredients!", stepDetails:"Click and drag to add the Ingredients into into the red bowl. Add the Ingredients in the correct order by using the visual clues.", stepFunctionName:DoAddIngredientsSpinachTriangles1, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][4] = {stepTitle:"Add the Ingredients!", stepDetails:"Click and drag to add the Ingredients into into the red bowl. Add the Ingredients in the correct order by using the visual clues.", stepFunctionName:DoAddIngredientsSpinachTriangles2, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][5] = {stepTitle:"Knead the Dough!", stepDetails:"Trace the lines to Knead the Dough.", stepFunctionName:DoKneadDough, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][6] = {stepTitle:"Roll the Dough!", stepDetails:"Move the mouse horizontaly and vertically to roll out dough. Try to match the recommanded vertical and horizontal size.", stepFunctionName:DoDoughRoll, allottedTime:40000, showProgress:false};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][7] = {stepTitle:"Slice the Dough!", stepDetails:"Trace the lines to silce up the Dough.", stepFunctionName:DoDoughSlice, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][8] = {stepTitle:"Fold Phyllo Triangles!", stepDetails:"Follow the steps to learn how to fold Phyllo Triangles.", stepFunctionName:DoPhylloTrianglesFold, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_SPINACH_TRIANGLES][9] = {stepTitle:"Bake Phyllo Triangles!", stepDetails:"Enter the correct baking temperature and press \"On\". Then press \"Off\" when the meter is in the dark green zone. Hit \"Reset\" if you enter the wrong temperature.", stepFunctionName:DoBakePhylloTriangles, allottedTime:30000, showProgress:false};
recipeInfo[RECIPE_NAME_EGG_ROLLS] = new Array();
recipeInfo[RECIPE_NAME_EGG_ROLLS][0] = {stepTitle:"Egg Rolls", stepDetails:"In Chinese, the word, \"dan juan\" literally translates to \"egg scroll\".", stepFunctionName:null, allottedTime:0, showProgress:false, maxScore:600, totalScore:-1, gradeStr:(String = ""), finalPictureMCName:"EggRollsFinal", finalPictureMCXPos:160, finalPictureMCYPos:141, recipeBookXPos:312, recipeBookYPos:206};
recipeInfo[RECIPE_NAME_EGG_ROLLS][1] = {stepTitle:"Dice the Garlic!", stepDetails:"Click the knife to dice up the Garlic.", stepFunctionName:DoDiceGarlic, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_EGG_ROLLS][2] = {stepTitle:"Dice the Onion!", stepDetails:"Trace the lines to slice. Then click the knife to dice up Onion.", stepFunctionName:DoOnionDice, allottedTime:45000, showProgress:true};
recipeInfo[RECIPE_NAME_EGG_ROLLS][3] = {stepTitle:"Chop the Bok Choy!", stepDetails:"Click the knife to chop up the Bok Choy.", stepFunctionName:DoBokChoyCut, allottedTime:30000, showProgress:true};
recipeInfo[RECIPE_NAME_EGG_ROLLS][4] = {stepTitle:"Add the Ingredients!", stepDetails:"Click and drag to add the Ingredients into into the red bowl. Add the Ingredients in the correct order by using the visual clues.", stepFunctionName:DoAddIngredientsEggRolls, allottedTime:40000, showProgress:true};
recipeInfo[RECIPE_NAME_EGG_ROLLS][5] = {stepTitle:"Fold Eggrolls!", stepDetails:"Follow the steps to learn how to fold Eggrolls.", stepFunctionName:DoEggRollsFold, allottedTime:60000, showProgress:true};
recipeInfo[RECIPE_NAME_EGG_ROLLS][6] = {stepTitle:"Deep Fry Eggrolls!", stepDetails:"Grab the food and drop it into the pot. Don't remove the food too quickly! Wait for the food to turn golden brown, then grab it and place it on the lower tray.", stepFunctionName:DoDeepFryEggRolls, allottedTime:60000, showProgress:false};
var splashLogosList = new Array();
var logosToDisplay = 0;
var currentLogoIndex = -1;
var showTime = 2;
var fadeInOutCountDown;
var sound = new Sound();
var currArrayPos = 0;
var oldVolume = 100;
var isGameMute = false;
var soundArray = new Array("bakeloop", "Button", "chop", "correct", "cymbal", "digitalbutton", "drumroll", "emptybowl", "foodhit", "grate1", "happyfanfare", "Highlight", "incorrect", "rollingdough", "saltshaker1", "stir", "squish", "stovetoplow", "timeup1", "cut");
var SND_BAKELOOP = 0;
var SND_BUTTON = 1;
var SND_CHOP = 2;
var SND_CORRECT = 3;
var SND_CYMBAL = 4;
var SND_DIGITALBUTTON = 5;
var SND_DRUMROLL = 6;
var SND_EMPTYBOWL = 7;
var SND_FOODHIT = 8;
var SND_GRATE = 9;
var SND_HAPPYFANFARE = 10;
var SND_HIGHLIGHT = 11;
var SND_INCORRECT = 12;
var SND_ROLLINGDOUGH = 13;
var SND_SALTSHAKER = 14;
var SND_STIR = 15;
var SND_SQUISH = 16;
var SND_STOVETOPLOW = 17;
var SND_TIMEUP = 18;
var SND_CUT = 19;
var mouseMC;
var hatMC;
var finishedMC;
var scoreboardMC;
var stepChefFaceMC;
var progressMC;
var minigameMC;
var timeUpMC;
var isTimeUp = false;
var isMinigameFinished = false;
var selectedRecipeName = "";
var currentStepNo = 0;
var gamePlayMode = GAMEPLAY_MODE_NONE;
var minigameProgress = 0;
var totalScore = 0;
var totalScoreForAllRecipes = 0;
var hintArrowMC = undefined;
var useCustomCursors = true;
var isGamePaused = false;
var smokeScreen = undefined;
var currentLevel = 0;
_root.tabChildren = false;
_root.tabEnabled = false;
Init();
_root.onMouseMove = function () {
mouseMC._x = _xmouse;
mouseMC._y = _ymouse;
updateAfterEvent();
};
var optionsMC = undefined;
var quitPlayingMC;
var helpBoxMC = undefined;
var emptyMC;
if (!_root.AOL_API_ENABLED) {
_root.BackgroundAOLMC._visible = false;
}
if (_root.REFLEXIVE_API_ENABLED) {
var reflexiveAPI = com.reflexive.as2.ReflexiveAPI.getInstance();
trace((("Frame1: Reflexive API Initialized. reflexiveAPI = " + reflexiveAPI) + ", ") + com.reflexive.as2.ReflexiveAPI);
}
if (_root.MSN_API_ENABLED) {
var MSNGDK_WAITING_FOR_SESSIONSTART = 1;
var MSNGDK_WAITING_FOR_GAMESTART = 2;
var MSNGDK_SESSIONSTARTED = 3;
fscommand ("LoadBroadcast", "<data><percentcomplete>100</percentcomplete></data>");
setTimeout(MSNCallSessionReady, 1);
var msnGameState = MSNGDK_WAITING_FOR_SESSIONSTART;
var sessionStartCalled = false;
} else if (_root.REAL_API_ENABLED) {
var MSNGDK_WAITING_FOR_SESSIONSTART = 1;
var MSNGDK_WAITING_FOR_GAMESTART = 2;
var MSNGDK_SESSIONSTARTED = 3;
fscommand ("LoadBroadcast", "<data><percentcomplete>100</percentcomplete></data>");
_global.rgdata.rgfscommand("LoadBroadcast", "<data><percentcomplete>100</percentcomplete></data>");
setTimeout(RealCallSessionReady, 1);
var msnGameState = MSNGDK_WAITING_FOR_SESSIONSTART;
var sessionStartCalled = false;
} else {
gotoAndStop ("FrameFugazoLogo");
}
Frame 2
stop();
if (_root.MSN_API_ENABLED) {
_root.sessionStartCalled = true;
fscommand ("GameReady", "<data><mode></mode></data>");
_root.msnGameState = MSNGDK_WAITING_FOR_GAMESTART;
}
if (_root.REAL_API_ENABLED) {
_root.sessionStartCalled = true;
fscommand ("GameReady", "<data></data>");
_global.rgdata.rgfscommand("GameReady", "<data><mode></mode></data>");
_root.msnGameState = MSNGDK_WAITING_FOR_GAMESTART;
}
Frame 3
stop();
_root.gotoAndStop("FrameFugazoLogo");
Frame 4
stop();
_root.PauseGame();
Frame 5
stop();
_root.ResumeGame();
Frame 6
stop();
_root.Mute();
Frame 7
stop();
_root.Unmute();
Frame 8
stop();
Frame 9
stop();
Frame 10
stop();
var waitTime = 0;
_root.onEnterFrame = function () {
_root.waitTime++;
if (_root.waitTime >= 24) {
_root.onEnterFrame = undefined;
LoadLogoAndURL();
}
};
Frame 11
function MouseHandOnRollOverHandler() {
_root.PlaySound(SND_HIGHLIGHT, false, false);
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
function MouseHandOnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
stop();
VersionInfoText.text = (("Ver " + VERSION_MAJOR) + ".") + VERSION_MINOR;
TitleScreenMC.PlayGameBtn.onRollOver = MouseHandOnRollOverHandler;
TitleScreenMC.PlayGameBtn.onRollOut = MouseHandOnRollOutHandler;
TitleScreenMC.PlayGameBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
GotoFrame(FRAME_MAINMENU);
};
Frame 12
stop();
if (_root.REAL_API_ENABLED) {
if (_root.hasDownloadable == false) {
MainMenuMC.FreeDownloadBtn._visible = false;
}
}
MainMenuMC.FreeDownloadBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
getURL (_root.FREE_DOWNLOAD_URL, "_blank");
};
MainMenuMC.CookBtn.onRollOver = MouseHandOnRollOverHandler;
MainMenuMC.ExamBtn.onRollOver = MouseHandOnRollOverHandler;
MainMenuMC.OptionsBtn.onRollOver = MouseHandOnRollOverHandler;
MainMenuMC.FreeDownloadBtn.onRollOver = MouseHandOnRollOverHandler;
MainMenuMC.CookBtn.onRollOut = MouseHandOnRollOutHandler;
MainMenuMC.ExamBtn.onRollOut = MouseHandOnRollOutHandler;
MainMenuMC.OptionsBtn.onRollOut = MouseHandOnRollOutHandler;
MainMenuMC.FreeDownloadBtn.onRollOut = MouseHandOnRollOutHandler;
MainMenuMC.CookBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
GotoFrame(FRAME_RECIPE_BOOK);
};
MainMenuMC.OptionsBtn.onPress = function () {
trace("options");
_root.PlaySound(SND_BUTTON, false, false);
CreateOptionsBox(false);
};
MainMenuMC.ExamBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
_root.ShowUpsellScreen((UPSELL_UNLOCK_MORE_FEATURES_STRING_START + "Exams") + UPSELL_UNLOCK_MORE_FEATURES_STRING_END);
};
Frame 13
function Init() {
var _local2 = new TextFormat();
_local2.font = "ErasDemiITC";
RecipeBookMC.GyozaTextMC.TextBox.setTextFormat(_local2);
RecipeBookMC.BrushettaTextMC.TextBox.setTextFormat(_local2);
RecipeBookMC.GuacamoleTextMC.TextBox.setTextFormat(_local2);
RecipeBookMC.SpinachTrianglesTextMC.TextBox.setTextFormat(_local2);
RecipeBookMC.EggRollTextMC.TextBox.setTextFormat(_local2);
RecipeBookMC.RecipeTextMC.setTextFormat(_local2);
RecipeBookMC.ScoreTextMC.setTextFormat(_local2);
RecipeBookMC.GyozaGradeMC.gotoAndStop(_root.recipeInfo[_root.RECIPE_NAME_GYOZA][0].gradeStr);
RecipeBookMC.BruschettaGradeMC.gotoAndStop(_root.recipeInfo[_root.RECIPE_NAME_BRUSCHETTA][0].gradeStr);
RecipeBookMC.GuacamoleGradeMC.gotoAndStop(_root.recipeInfo[_root.RECIPE_NAME_GUACAMOLE][0].gradeStr);
RecipeBookMC.SpinachTriangleGradeMC.gotoAndStop(_root.recipeInfo[_root.RECIPE_NAME_SPINACH_TRIANGLES][0].gradeStr);
RecipeBookMC.EggRollGradeMC.gotoAndStop(_root.recipeInfo[_root.RECIPE_NAME_EGG_ROLLS][0].gradeStr);
RecipeBookMC.GyozaTextMC.onPress = RecipeTextOnPressHandler;
RecipeBookMC.BrushettaTextMC.onPress = RecipeTextOnPressHandler;
RecipeBookMC.GuacamoleTextMC.onPress = RecipeTextOnPressHandler;
RecipeBookMC.SpinachTrianglesTextMC.onPress = RecipeTextOnPressHandler;
RecipeBookMC.EggRollTextMC.onPress = RecipeTextOnPressHandler;
RecipeBookMC.GyozaTextMC.onRollOver = RecipeTextOnRollOverHandler;
RecipeBookMC.BrushettaTextMC.onRollOver = RecipeTextOnRollOverHandler;
RecipeBookMC.GuacamoleTextMC.onRollOver = RecipeTextOnRollOverHandler;
RecipeBookMC.SpinachTrianglesTextMC.onRollOver = RecipeTextOnRollOverHandler;
RecipeBookMC.EggRollTextMC.onRollOver = RecipeTextOnRollOverHandler;
RecipeBookMC.GyozaTextMC.onRollOut = RecipeTextOnRollOutHandler;
RecipeBookMC.BrushettaTextMC.onRollOut = RecipeTextOnRollOutHandler;
RecipeBookMC.GuacamoleTextMC.onRollOut = RecipeTextOnRollOutHandler;
RecipeBookMC.SpinachTrianglesTextMC.onRollOut = RecipeTextOnRollOutHandler;
RecipeBookMC.EggRollTextMC.onRollOut = RecipeTextOnRollOutHandler;
RecipeBookMC.BackBtn.onRelease = RecipeBackBtnOnReleaseHandler;
RecipeBookMC.BackBtn.onRollOver = MouseHandOnRollOverHandler;
RecipeBookMC.BackBtn.onRollOut = MouseHandOnRollOutHandler;
RecipeBookMC.BreakfastBtn.onRelease = DeluxeFeaturesButtonReleaseHandler;
RecipeBookMC.BreakfastBtn.onRollOver = MouseHandOnRollOverHandler;
RecipeBookMC.BreakfastBtn.onRollOut = MouseHandOnRollOutHandler;
RecipeBookMC.LunchBtn.onRelease = DeluxeFeaturesButtonReleaseHandler;
RecipeBookMC.LunchBtn.onRollOver = MouseHandOnRollOverHandler;
RecipeBookMC.LunchBtn.onRollOut = MouseHandOnRollOutHandler;
RecipeBookMC.DinnerBtn.onRelease = DeluxeFeaturesButtonReleaseHandler;
RecipeBookMC.DinnerBtn.onRollOver = MouseHandOnRollOverHandler;
RecipeBookMC.DinnerBtn.onRollOut = MouseHandOnRollOutHandler;
RecipeBookMC.DessertBtn.onRelease = DeluxeFeaturesButtonReleaseHandler;
RecipeBookMC.DessertBtn.onRollOver = MouseHandOnRollOverHandler;
RecipeBookMC.DessertBtn.onRollOut = MouseHandOnRollOutHandler;
RecipeBookMC.ExamBtn.onRelease = DeluxeFeaturesButtonReleaseHandler;
RecipeBookMC.ExamBtn.onRollOver = MouseHandOnRollOverHandler;
RecipeBookMC.ExamBtn.onRollOut = MouseHandOnRollOutHandler;
}
function DeluxeFeaturesButtonReleaseHandler() {
var _local3 = this._name.slice(0, this._name.length - 3);
if (_local3 == "Exam") {
_local3 = "Exams";
}
trace("MainMenuFrame: DeluxeFeaturesButtonReleaseHandler: " + _local3);
_root.ShowUpsellScreen((UPSELL_UNLOCK_MORE_FEATURES_STRING_START + _local3) + UPSELL_UNLOCK_MORE_FEATURES_STRING_END);
}
function RecipeBackBtnOnReleaseHandler() {
_root.GotoFrame(FRAME_MAINMENU);
}
function RecipeTextOnPressHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
_root.selectedRecipeName = this.TextBox.text;
_root.gamePlayMode = _root.GAMEPLAY_MODE_NONE;
_root.currentStepNo = 0;
_root.totalScore = 0;
trace("Frame 3 " + _root.selectedRecipeName);
_root.gotoAndStop(FRAME_INSTRUCTIONS);
}
function RecipeTextOnRollOverHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
UpdateRecipeInfo(this);
}
function RecipeTextOnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function UpdateRecipeInfo(recipeMC) {
RecipeBookMC.RecipeTextMC.text = recipeMC.TextBox.text;
if (RecipeBookMC.foodMC != undefined) {
RecipeBookMC.foodMC.swapDepths(RecipeBookMC.getNextHighestDepth());
RecipeBookMC.foodMC.removeMovieClip();
RecipeBookMC.foodMC = undefined;
}
RecipeBookMC.ScoreTextMC.text = "";
if ((_root.recipeInfo[recipeMC.TextBox.text][0].gradeStr != "") && (_root.recipeInfo[recipeMC.TextBox.text][0].gradeStr != undefined)) {
RecipeBookMC.ScoreTextMC.text = (_root.recipeInfo[recipeMC.TextBox.text][0].totalScore + "/") + _root.recipeInfo[recipeMC.TextBox.text][0].maxScore;
if (_root.recipeInfo[recipeMC.TextBox.text][0].gradeStr == "D") {
RecipeBookMC.foodMC = RecipeBookMC.attachMovie("StomachMedicine", "FoodMC", RecipeBookMC.getNextHighestDepth(), {_x:335, _y:190, _xscale:65, _yscale:65});
} else {
RecipeBookMC.foodMC = RecipeBookMC.attachMovie(_root.recipeInfo[recipeMC.TextBox.text][0].finalPictureMCName, "FoodMC", RecipeBookMC.getNextHighestDepth(), {_x:_root.recipeInfo[recipeMC.TextBox.text][0].recipeBookXPos, _y:_root.recipeInfo[recipeMC.TextBox.text][0].recipeBookYPos, _xscale:65, _yscale:65});
}
}
}
stop();
Init();
Frame 14
function SetFontOfTextFields() {
var _local1 = new TextFormat();
_local1.font = "SegoeUI";
InstructionsMC.RecipeNameText.setTextFormat(_local1);
InstructionsMC.StepsInfoText.setTextFormat(_local1);
InstructionsMC.TitleText.setTextFormat(_local1);
InstructionsMC.DetailsText.setTextFormat(_local1);
}
function UpdateStepsInfo() {
if (_root.gamePlayMode == _root.GAMEPLAY_MODE_NONE) {
InstructionsMC.CookBtn._visible = true;
InstructionsMC.PracticeBtn._visible = true;
InstructionsMC.ArrowDownBtn._visible = false;
InstructionsMC.ArrowUpBtn._visible = false;
} else if (_root.gamePlayMode == _root.GAMEPLAY_MODE_PRACTICE) {
InstructionsMC.CookBtn._visible = false;
InstructionsMC.ArrowDownBtn._visible = true;
InstructionsMC.ArrowUpBtn._visible = true;
} else if (_root.gamePlayMode == _root.GAMEPLAY_MODE_COOK) {
InstructionsMC.PracticeBtn._visible = false;
InstructionsMC.ArrowDownBtn._visible = false;
InstructionsMC.ArrowUpBtn._visible = false;
}
if (_root.currentStepNo == 0) {
InstructionsMC.RecipeNameText._visible = false;
InstructionsMC.StepsInfoText._visible = false;
} else {
InstructionsMC.RecipeNameText._visible = true;
InstructionsMC.StepsInfoText._visible = true;
InstructionsMC.RecipeNameText.text = _root.selectedRecipeName;
InstructionsMC.StepsInfoText.text = (("Step " + _root.currentStepNo) + " of ") + totalSteps;
}
InstructionsMC.TitleText.text = _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle;
InstructionsMC.DetailsText.text = _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepDetails;
SetFontOfTextFields();
}
function ShowNextInstruction() {
if (_root.currentStepNo < _root.totalSteps) {
_root.InstructionsMC.InstructionsFlipMC.gotoAndStop(_root.InstructionsMC.InstructionsFlipMC._totalframes);
_root.InstructionsMC.InstructionsFlipMC.onEnterFrame = _root.InstructionsFlipEnterFrameHandler;
_root.currentStepNo++;
UpdateStepsInfo();
} else if (_root.gamePlayMode == _root.GAMEPLAY_MODE_COOK) {
ShowFinishScreen();
}
}
function ShowPreviousInstruction() {
if (_root.currentStepNo > 1) {
_root.InstructionsMC.InstructionsFlipMC.onEnterFrame = _root.InstructionsFlipPrevEnterFrameHandler;
_root.InstructionsMC.InstructionsFlipMC.gotoAndPlay(2);
_root.currentStepNo--;
}
}
function InstructionsFlipEnterFrameHandler() {
this.gotoAndStop(this.prevFrame());
if (this._currentframe == 1) {
this.onEnterFrame = undefined;
}
}
function InstructionsFlipPrevEnterFrameHandler() {
if (this._currentframe >= (this._totalframes - 2)) {
this.onEnterFrame = undefined;
UpdateStepsInfo();
}
}
if (_root.REAL_API_ENABLED) {
if (_root.hasDownloadable == false) {
InstructionsMC.FreeDownloadBtn._visible = false;
}
}
InstructionsMC.FreeDownloadBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
getURL (_root.FREE_DOWNLOAD_URL, "_blank");
};
InstructionsMC.FreeDownloadBtn.onRollOver = function () {
_root.PlaySound(SND_HIGHLIGHT, false, false);
};
var totalSteps = (_root.recipeInfo[_root.selectedRecipeName].length - 1);
InstructionsMC.BackBtn.onRollOver = MouseHandOnRollOverHandler;
InstructionsMC.PracticeBtn.onRollOver = MouseHandOnRollOverHandler;
InstructionsMC.CookBtn.onRollOver = MouseHandOnRollOverHandler;
InstructionsMC.BackBtn.onRollOut = MouseHandOnRollOutHandler;
InstructionsMC.PracticeBtn.onRollOut = MouseHandOnRollOutHandler;
InstructionsMC.CookBtn.onRollOut = MouseHandOnRollOutHandler;
UpdateStepsInfo();
InstructionsMC.ArrowDownBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
ShowNextInstruction();
};
InstructionsMC.ArrowDownBtn.onRollOver = function () {
_root.PlaySound(SND_HIGHLIGHT, false, false);
};
InstructionsMC.ArrowUpBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
ShowPreviousInstruction();
};
InstructionsMC.ArrowUpBtn.onRollOver = function () {
_root.PlaySound(SND_HIGHLIGHT, false, false);
};
InstructionsMC.BackBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
if (_root.currentStepNo == 0) {
_root.totalScore = 0;
_root.GotoFrame(FRAME_RECIPE_BOOK);
} else {
_root.currentStepNo = 0;
_root.gamePlayMode = _root.GAMEPLAY_MODE_NONE;
UpdateStepsInfo();
}
};
InstructionsMC.PracticeBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
if (_root.currentStepNo == 0) {
_root.gamePlayMode = GAMEPLAY_MODE_PRACTICE;
this._parent.CookBtn._visible = false;
this._parent.ArrowDownBtn._visible = true;
this._parent.ArrowUpBtn._visible = true;
_root.InstructionsMC.InstructionsFlipMC.gotoAndStop(_root.InstructionsMC.InstructionsFlipMC._totalframes);
_root.InstructionsMC.InstructionsFlipMC.onEnterFrame = _root.InstructionsFlipEnterFrameHandler;
_root.currentStepNo++;
UpdateStepsInfo();
} else {
_root.gotoAndStop(_root.FRAME_MINIGAME);
}
};
InstructionsMC.CookBtn.onPress = function () {
_root.PlaySound(SND_BUTTON, false, false);
if (_root.currentStepNo == 0) {
_root.gamePlayMode = GAMEPLAY_MODE_COOK;
this._parent.PracticeBtn._visible = false;
_root.InstructionsMC.InstructionsFlipMC.gotoAndStop(_root.InstructionsMC.InstructionsFlipMC._totalframes);
_root.InstructionsMC.InstructionsFlipMC.onEnterFrame = _root.InstructionsFlipEnterFrameHandler;
_root.currentStepNo++;
UpdateStepsInfo();
} else {
_root.gotoAndStop(_root.FRAME_MINIGAME);
}
};
Frame 15
PlayMiniGame();
Symbol 51 MovieClip [Go] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 51 MovieClip [Go] Frame 20
this.onEnterFrame = undefined;
stop();
this.onCompleteHandler(this);
Symbol 55 MovieClip [Grate] Frame 1
#initclip 86
Object.registerClass("Grate", Grate);
#endinitclip
Symbol 167 MovieClip [ArrowBlue] Frame 1
#initclip 37
Object.registerClass("ArrowBlue", ArrowBlue);
#endinitclip
Symbol 171 MovieClip [DoughRoll] Frame 1
#initclip 38
Object.registerClass("DoughRoll", DoughRoll);
#endinitclip
Symbol 177 MovieClip [DeepFryEggRolls] Frame 1
stop();
Symbol 207 MovieClip [CASlider] Frame 1
#initclip 39
Object.registerClass("CASlider", CASlider);
#endinitclip
Symbol 223 MovieClip [CACheckBox] Frame 1
#initclip 40
Object.registerClass("CACheckBox", CACheckBox);
#endinitclip
stop();
Symbol 260 MovieClip [Callout] Frame 1
#initclip 41
Object.registerClass("Callout", Callout);
#endinitclip
Symbol 272 MovieClip Frame 1
stop();
Symbol 276 MovieClip [cover_A] Frame 1
stop();
Symbol 276 MovieClip [cover_A] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 276 MovieClip [cover_A] Frame 12
this.onEnterFrame = undefined;
stop();
Symbol 295 MovieClip Frame 1
stop();
Symbol 296 MovieClip Frame 1
stop();
Symbol 296 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 296 MovieClip Frame 6
this.onEnterFrame = undefined;
stop();
Symbol 305 MovieClip [FinishScreen] Frame 1
#initclip 42
Object.registerClass("FinishScreen", FinishScreen);
#endinitclip
OptionBtn.onRollOver = _root.MouseHandOnRollOverHandler;
ContinueBtn.onRollOver = _root.MouseHandOnRollOverHandler;
OptionBtn.onRollOut = _root.MouseHandOnRollOutHandler;
ContinueBtn.onRollOut = _root.MouseHandOnRollOutHandler;
Symbol 338 MovieClip [GuacamoleStir] Frame 1
#initclip 43
Object.registerClass("GuacamoleStir", KneadMeat);
#endinitclip
Symbol 345 MovieClip Frame 1
stop();
Symbol 345 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 345 MovieClip Frame 15
this.onEnterFrame = undefined;
trace("Guacamole Food MC " + this);
this._parent._parent.FoodMCPlayComplete();
Symbol 346 MovieClip Frame 1
stop();
Symbol 346 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 346 MovieClip Frame 15
this.onEnterFrame = undefined;
trace("Guacamole Food MC " + this);
this._parent._parent.FoodMCPlayComplete();
Symbol 347 MovieClip Frame 1
stop();
Symbol 347 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 347 MovieClip Frame 15
this.onEnterFrame = undefined;
trace("Guacamole Food MC " + this);
this._parent._parent.FoodMCPlayComplete();
Symbol 348 MovieClip Frame 1
stop();
Symbol 348 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 348 MovieClip Frame 15
this.onEnterFrame = undefined;
trace("Guacamole Food MC " + this);
this._parent._parent.FoodMCPlayComplete();
Symbol 352 MovieClip Frame 1
stop();
Symbol 352 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 352 MovieClip Frame 17
this.onEnterFrame = undefined;
stop();
Symbol 365 MovieClip Frame 1
stop();
Symbol 366 MovieClip [Zigzag] Frame 1
#initclip 44
Object.registerClass("Zigzag", Circle);
#endinitclip
Symbol 367 MovieClip [GuacamoleStirStep8] Frame 1
#initclip 45
Object.registerClass("GuacamoleStirStep8", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_NONE);
Symbol 368 MovieClip [GuacamoleStirStep6] Frame 1
#initclip 46
Object.registerClass("GuacamoleStirStep6", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_HORIZONTAL);
Symbol 369 MovieClip Frame 1
stop();
Symbol 369 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 369 MovieClip Frame 17
this.onEnterFrame = undefined;
stop();
Symbol 370 MovieClip [GuacamoleStirStep7] Frame 1
#initclip 47
Object.registerClass("GuacamoleStirStep7", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_BOTH);
Symbol 371 MovieClip [GuacamoleStirStep5] Frame 1
#initclip 48
Object.registerClass("GuacamoleStirStep5", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_VERTICAL);
Symbol 372 MovieClip Frame 1
stop();
Symbol 372 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 372 MovieClip Frame 15
this.onEnterFrame = undefined;
stop();
Symbol 378 MovieClip [CircularAnimation] Frame 1
stop();
Symbol 379 MovieClip [Circle] Frame 1
#initclip 49
Object.registerClass("Circle", Circle);
#endinitclip
Symbol 380 MovieClip [GuacamoleStirStep2] Frame 1
#initclip 50
Object.registerClass("GuacamoleStirStep2", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_HORIZONTAL);
Symbol 381 MovieClip Frame 1
stop();
Symbol 381 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 381 MovieClip Frame 15
this.onEnterFrame = undefined;
stop();
Symbol 382 MovieClip [GuacamoleStirStep4] Frame 1
#initclip 51
Object.registerClass("GuacamoleStirStep4", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_BOTH);
Symbol 383 MovieClip Frame 1
stop();
Symbol 383 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 383 MovieClip Frame 15
this.onEnterFrame = undefined;
stop();
Symbol 384 MovieClip [GuacamoleStirStep3] Frame 1
#initclip 52
Object.registerClass("GuacamoleStirStep3", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_VERTICAL);
Symbol 385 MovieClip Frame 1
stop();
Symbol 385 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 385 MovieClip Frame 15
this.onEnterFrame = undefined;
stop();
Symbol 386 MovieClip [GuacamoleStirStep1] Frame 1
#initclip 53
Object.registerClass("GuacamoleStirStep1", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_NONE);
Symbol 407 MovieClip [KnifeSide] Frame 1
#initclip 54
Object.registerClass("KnifeSide", KnifeSide);
#endinitclip
Symbol 415 MovieClip [AvocadoSliceCore] Frame 1
stop();
Symbol 415 MovieClip [AvocadoSliceCore] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 415 MovieClip [AvocadoSliceCore] Frame 28
this.onEnterFrame = undefined;
stop();
Symbol 415 MovieClip [AvocadoSliceCore] Frame 30
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 415 MovieClip [AvocadoSliceCore] Frame 61
this.onEnterFrame = undefined;
stop();
Symbol 415 MovieClip [AvocadoSliceCore] Frame 62
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 415 MovieClip [AvocadoSliceCore] Frame 68
this.onEnterFrame = undefined;
stop();
Symbol 420 MovieClip [AvocadoMash] Frame 1
stop();
Symbol 428 MovieClip [Masher] Frame 1
stop();
Symbol 428 MovieClip [Masher] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 428 MovieClip [Masher] Frame 25
this.onEnterFrame = undefined;
Symbol 432 MovieClip [Mash] Frame 1
#initclip 55
Object.registerClass("Mash", Mash);
#endinitclip
Symbol 497 MovieClip [Bake] Frame 1
#initclip 56
Object.registerClass("Bake", Bake);
#endinitclip
Symbol 508 MovieClip [BaguetteBake] Frame 1
stop();
Symbol 527 MovieClip Frame 1
stop();
Symbol 527 MovieClip Frame 2
stop();
Symbol 527 MovieClip Frame 3
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 527 MovieClip Frame 6
this.onEnterFrame = undefined;
stop();
Symbol 527 MovieClip Frame 7
stop();
Symbol 527 MovieClip Frame 8
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 527 MovieClip Frame 11
this.onEnterFrame = undefined;
stop();
Symbol 527 MovieClip Frame 12
stop();
Symbol 527 MovieClip Frame 13
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 527 MovieClip Frame 17
this.onEnterFrame = undefined;
stop();
Symbol 527 MovieClip Frame 18
stop();
Symbol 555 MovieClip Frame 1
stop();
Symbol 556 MovieClip [TomatoDice] Frame 1
#initclip 57
Object.registerClass("TomatoDice", TomatoDice);
#endinitclip
Symbol 572 MovieClip [LimeJuiceBowl] Frame 1
stop();
Symbol 572 MovieClip [LimeJuiceBowl] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
this.play();
Symbol 572 MovieClip [LimeJuiceBowl] Frame 10
this.onEnterFrame = undefined;
stop();
Symbol 576 MovieClip [WaterBowl] Frame 1
stop();
Symbol 576 MovieClip [WaterBowl] Frame 2
this.play();
Symbol 576 MovieClip [WaterBowl] Frame 10
stop();
Symbol 580 MovieClip [OilBowl] Frame 1
stop();
Symbol 580 MovieClip [OilBowl] Frame 2
this.play();
Symbol 580 MovieClip [OilBowl] Frame 10
stop();
Symbol 584 MovieClip [OysterSauceBowl] Frame 1
stop();
Symbol 584 MovieClip [OysterSauceBowl] Frame 2
this.play();
Symbol 584 MovieClip [OysterSauceBowl] Frame 10
stop();
Symbol 588 MovieClip [OliveOilBowl] Frame 1
stop();
Symbol 588 MovieClip [OliveOilBowl] Frame 2
this.play();
Symbol 588 MovieClip [OliveOilBowl] Frame 10
stop();
Symbol 606 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 606 MovieClip Frame 20
this.onEnterFrame = undefined;
Symbol 618 MovieClip Frame 1
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 619 MovieClip Frame 1
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 620 MovieClip Frame 1
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 621 MovieClip Frame 1
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 622 MovieClip Frame 1
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 634 MovieClip Frame 1
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 635 MovieClip [DeepFry] Frame 1
#initclip 58
Object.registerClass("DeepFry", DeepFry);
#endinitclip
Symbol 643 MovieClip [DeepFryGyozaPiece] Frame 1
stop();
Symbol 646 MovieClip [TimeUp] Frame 1
stop();
Symbol 646 MovieClip [TimeUp] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 646 MovieClip [TimeUp] Frame 24
this.onEnterFrame = undefined;
trace("TimeUp: " + this);
_root.TimeUpMCCompleteHandler();
Symbol 668 MovieClip Frame 1
stop();
Symbol 673 MovieClip [UpsellScreen] Frame 1
function ShowContinueButton() {
ContinueBtn._visible = true;
}
if (_root.REAL_API_ENABLED) {
ContinueBtn._visible = false;
if (_root.comInterval == undefined) {
}
if (_root.comInterval != 0) {
setTimeout(ShowContinueButton, _root.comInterval * 1000);
}
}
FreeDownloadURLBtn.onRollOver = _root.MouseHandOnRollOverHandler;
FreeDownloadURLBtn.onRollOut = _root.MouseHandOnRollOutHandler;
ContinueBtn.onRollOver = _root.MouseHandOnRollOverHandler;
ContinueBtn.onRollOut = _root.MouseHandOnRollOutHandler;
FreeDownloadURLBtn.onPress = function () {
_root.PlaySound(_root.SND_BUTTON);
getURL (_root.FREE_DOWNLOAD_URL, "_blank");
removeMovieClip(this._parent.emptyMC);
this._parent.swapDepths(this._parent._parent.getNextHighestDepth());
this._parent.removeMovieClip();
};
ContinueBtn.onPress = function () {
_root.PlaySound(_root.SND_BUTTON);
if (this._parent.HeadingText.text == _root.UPSELL_WEBGAME_COMPLETED_STRING) {
if (_root.MSN_API_ENABLED) {
fscommand ("ScoreSubmit", ("<game><score>" + _root.totalScoreForAllRecipes) + "</score><time></time></game>");
fscommand ("GameEnd", "<gamedata></gamedata>");
} else if (_root.REAL_API_ENABLED) {
fscommand ("ScoreSubmit", ("<game><score>" + _root.totalScoreForAllRecipes) + "</score><time></time></game>");
_global.rgdata.rgfscommand("ScoreSubmit", ("<game><score>" + _root.totalScoreForAllRecipes) + "</score><time></time></game>");
fscommand ("GameEnd", "<gamedata></gamedata>");
_global.rgdata.rgfscommand("GameEnd", "<gamedata></gamedata>");
}
}
removeMovieClip(this._parent.emptyMC);
this._parent.swapDepths(this._parent._parent.getNextHighestDepth());
this._parent.removeMovieClip();
};
Symbol 678 MovieClip Frame 1
stop();
Symbol 681 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 681 MovieClip Frame 15
this.onEnterFrame = undefined;
Symbol 697 MovieClip [Scoreboard] Frame 1
#initclip 59
Object.registerClass("Scoreboard", Scoreboard);
#endinitclip
stop();
Symbol 697 MovieClip [Scoreboard] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
ScoreText._visible = false;
BonusText._visible = false;
SubTotalText._visible = false;
TotalText._visible = false;
ScoreLabel._visible = false;
BonusLabel._visible = false;
SubTotalLabel._visible = false;
TotalLabel._visible = false;
Symbol 697 MovieClip [Scoreboard] Frame 9
ScoreText._visible = true;
ScoreLabel._visible = true;
Symbol 697 MovieClip [Scoreboard] Frame 16
BonusText._visible = true;
BonusLabel._visible = true;
Symbol 697 MovieClip [Scoreboard] Frame 24
SubTotalText._visible = true;
SubTotalLabel._visible = true;
Symbol 697 MovieClip [Scoreboard] Frame 31
TotalText._visible = true;
TotalLabel._visible = true;
Symbol 697 MovieClip [Scoreboard] Frame 39
this.onEnterFrame = undefined;
stop();
Symbol 703 MovieClip [CATimer] Frame 1
#initclip 60
Object.registerClass("CATimer", CATimer);
#endinitclip
Symbol 710 MovieClip [AddIngredients] Frame 1
#initclip 61
Object.registerClass("AddIngredients", AddIngredients);
#endinitclip
Symbol 715 MovieClip [Bowl] Frame 1
stop();
Symbol 720 MovieClip [Teaspoon] Frame 1
stop();
Symbol 725 MovieClip [SaltShaker] Frame 1
stop();
Symbol 730 MovieClip [BlackPepperShaker] Frame 1
stop();
Symbol 736 MovieClip [SoySauceBowl] Frame 1
stop();
Symbol 736 MovieClip [SoySauceBowl] Frame 2
play();
Symbol 736 MovieClip [SoySauceBowl] Frame 10
stop();
Symbol 746 MovieClip [KneadDough] Frame 1
#initclip 62
Object.registerClass("KneadDough", KneadMeat);
#endinitclip
Symbol 747 MovieClip [KneadMeat] Frame 1
#initclip 63
Object.registerClass("KneadMeat", KneadMeat);
#endinitclip
Symbol 750 MovieClip Frame 1
stop();
Symbol 750 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 750 MovieClip Frame 16
this.onEnterFrame = undefined;
this._parent.FoodMCPlayComplete();
Symbol 761 MovieClip Frame 1
stop();
Symbol 761 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 761 MovieClip Frame 6
this.onEnterFrame = undefined;
Symbol 762 MovieClip [Arrow] Frame 1
#initclip 64
Object.registerClass("Arrow", Arrow);
#endinitclip
Symbol 763 MovieClip [KneadDoughStep4] Frame 1
#initclip 65
Object.registerClass("KneadDoughStep4", KneadStep);
#endinitclip
function InitPathMC() {
PathMC.Init(180, true, 45, 0, 0, false);
trace((((("KneadMeatStep3 PathMC = " + PathMC) + ", ") + this._parent._width) + ", ") + PathMC._width);
}
InitPathMC();
Symbol 766 MovieClip Frame 1
stop();
Symbol 766 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 766 MovieClip Frame 15
this.onEnterFrame = undefined;
this._parent.FoodMCPlayComplete();
Symbol 767 MovieClip [KneadMeatStep4] Frame 1
#initclip 66
Object.registerClass("KneadMeatStep4", KneadStep);
#endinitclip
function InitPathMC() {
PathMC.Init(180, true, 45, 0, 0, false);
trace((((("KneadMeatStep3 PathMC = " + PathMC) + ", ") + this._parent._width) + ", ") + PathMC._width);
}
InitPathMC();
Symbol 768 MovieClip Frame 1
stop();
Symbol 768 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 768 MovieClip Frame 16
this.onEnterFrame = undefined;
this._parent.FoodMCPlayComplete();
Symbol 769 MovieClip Frame 1
stop();
Symbol 769 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 769 MovieClip Frame 6
this.onEnterFrame = undefined;
Symbol 770 MovieClip [KneadDoughStep3] Frame 1
#initclip 67
Object.registerClass("KneadDoughStep3", KneadStep);
#endinitclip
function InitPathMC() {
PathMC.Init(180, true, 135, 0, 0, false);
trace((((("KneadMeatStep3 PathMC = " + PathMC) + ", ") + this._parent._width) + ", ") + PathMC._width);
}
InitPathMC();
Symbol 771 MovieClip [KneadMeatStep3] Frame 1
#initclip 68
Object.registerClass("KneadMeatStep3", KneadStep);
#endinitclip
function InitPathMC() {
PathMC.Init(180, true, 135, 0, 0, false);
trace((((("KneadMeatStep3 PathMC = " + PathMC) + ", ") + this._parent._width) + ", ") + PathMC._width);
}
InitPathMC();
Symbol 772 MovieClip Frame 1
stop();
Symbol 772 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 772 MovieClip Frame 15
this.onEnterFrame = undefined;
this._parent.FoodMCPlayComplete();
Symbol 773 MovieClip Frame 1
stop();
Symbol 773 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 773 MovieClip Frame 12
this.onEnterFrame = undefined;
Symbol 774 MovieClip [KneadDoughStep2] Frame 1
#initclip 69
Object.registerClass("KneadDoughStep2", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_HORIZONTAL);
Symbol 775 MovieClip [KneadMeatStep2] Frame 1
#initclip 70
Object.registerClass("KneadMeatStep2", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_HORIZONTAL);
Symbol 776 MovieClip Frame 1
stop();
Symbol 776 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
play();
Symbol 776 MovieClip Frame 15
this.onEnterFrame = undefined;
this._parent.FoodMCPlayComplete();
Symbol 777 MovieClip Frame 1
stop();
Symbol 777 MovieClip Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 777 MovieClip Frame 12
this.onEnterFrame = undefined;
Symbol 778 MovieClip [KneadDoughStep1] Frame 1
#initclip 71
Object.registerClass("KneadDoughStep1", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_NONE);
Symbol 779 MovieClip [KneadMeatStep1] Frame 1
#initclip 72
Object.registerClass("KneadMeatStep1", KneadStep);
#endinitclip
PathMC.Init(Circle.FLIP_NONE);
Symbol 782 MovieClip [KnifeRotated] Frame 1
#initclip 73
Object.registerClass("KnifeRotated", Knife);
#endinitclip
stop();
Symbol 782 MovieClip [KnifeRotated] Frame 4
stop();
this.numClicksDone++;
dispatchEvent({type:Knife.MOUSECLICK, target:this});
Symbol 785 MovieClip [Knife] Frame 1
#initclip 74
Object.registerClass("Knife", Knife);
#endinitclip
stop();
Symbol 785 MovieClip [Knife] Frame 3
this.numClicksDone++;
if (this.numClicksDone < this.numClicksReq) {
this._x = this._x + gapBetweenTwoClicks;
_root.ChangeMouseCursorToHand(this);
}
dispatchEvent({type:Knife.MOUSECLICK, target:this});
Symbol 789 MovieClip [EggRollsFold] Frame 1
#initclip 75
Object.registerClass("EggRollsFold", GyozaFold);
#endinitclip
Symbol 790 MovieClip [SpinachTrianglesFold] Frame 1
#initclip 76
Object.registerClass("SpinachTrianglesFold", GyozaFold);
#endinitclip
Symbol 791 MovieClip [GyozaFold] Frame 1
#initclip 77
Object.registerClass("GyozaFold", GyozaFold);
#endinitclip
Symbol 805 MovieClip [GyozaCrimp1] Frame 1
stop();
Symbol 811 MovieClip [GyozaCrimp2] Frame 1
stop();
Symbol 814 MovieClip [GyozaCrimp3] Frame 1
stop();
Symbol 817 MovieClip [GyozaCrimp4] Frame 1
stop();
Symbol 820 MovieClip [GyozaCrimp5] Frame 1
stop();
Symbol 823 MovieClip [GyozaCrimp6] Frame 1
stop();
Symbol 824 MovieClip [GyozaFoldStep3] Frame 1
stop();
Symbol 824 MovieClip [GyozaFoldStep3] Frame 2
stop();
Symbol 824 MovieClip [GyozaFoldStep3] Frame 3
function InitArrow() {
ArrowMC.Init(145, true, 270, 67, 67, true);
trace("ArrowMC = " + ArrowMC._width);
ArrowMC.addEventListener(ArrowMC.PATH_TRACE_COMPLETE, ArrowTraceCompleteHandler);
}
function ArrowTraceCompleteHandler() {
this._parent.nextFrame();
}
function GyozaFoldStep3TweenFinishHandler() {
this.parentMC.swapDepths(this.parentMC.getNextHighestDepth());
this.parentMC.removeMovieClip();
}
function CrimpClickHandler() {
trace((("CrimpClickHandler " + this) + ", ") + this._parent.HintArrowMC);
this._parent._parent.UpdateProgress();
this._parent.HintArrowMC._visible = false;
this.nextFrame();
this.onRelease = undefined;
if (this._parent._currentframe == this._parent._totalframes) {
this._parent._parent.ChildMCStepsComplete();
var _local2 = new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.None.easeNone, this._parent._x, -this._parent._width, 12, false);
_local2.parentMC = this._parent;
_local2.onMotionFinished = GyozaFoldStep3TweenFinishHandler;
} else {
this._parent.gotoAndStop(this._parent._currentframe + 1);
this._parent.HintArrowMC._visible = true;
}
}
stop();
InitArrow();
Symbol 824 MovieClip [GyozaFoldStep3] Frame 4
this._parent.UpdateProgress();
this.GyozaCrimpMC1.onRelease = CrimpClickHandler;
Symbol 824 MovieClip [GyozaFoldStep3] Frame 5
this.GyozaCrimpMC2.onRelease = CrimpClickHandler;
Symbol 824 MovieClip [GyozaFoldStep3] Frame 6
this.GyozaCrimpMC3.onRelease = CrimpClickHandler;
Symbol 824 MovieClip [GyozaFoldStep3] Frame 7
this.GyozaCrimpMC4.onRelease = CrimpClickHandler;
Symbol 824 MovieClip [GyozaFoldStep3] Frame 8
this.GyozaCrimpMC5.onRelease = CrimpClickHandler;
Symbol 824 MovieClip [GyozaFoldStep3] Frame 9
this.GyozaCrimpMC6.onRelease = CrimpClickHandler;
Symbol 842 MovieClip [Finished] Frame 1
stop();
Symbol 842 MovieClip [Finished] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
Symbol 842 MovieClip [Finished] Frame 24
this.onEnterFrame = undefined;
trace("FinishedMC; Will dispatch event = " + _root.EVENT_FINISHED_MC_COMPLETE);
_root.FinishedMCCompleteHandler();
Symbol 843 MovieClip [Garlic_Dice] Frame 1
#initclip 78
Object.registerClass("Garlic_Dice", GarlicDice);
#endinitclip
Symbol 851 MovieClip [Garlic] Frame 1
stop();
Symbol 894 MovieClip [GreenOnionCore] Frame 1
stop();
Symbol 895 MovieClip [BokChoyCut] Frame 1
#initclip 79
Object.registerClass("BokChoyCut", BokChoyCut);
#endinitclip
Symbol 896 MovieClip [GreenOnionCut] Frame 1
#initclip 80
Object.registerClass("GreenOnionCut", GreenOnionCut);
#endinitclip
Symbol 900 MovieClip [HatAnimation] Frame 1
stop();
Symbol 900 MovieClip [HatAnimation] Frame 2
this.onEnterFrame = function () {
if (!this._visible) {
return(undefined);
}
if (_root.isGamePaused) {
this.stop();
} else {
this.play();
}
};
this._visible = true;
Symbol 900 MovieClip [HatAnimation] Frame 17
if (this.isQuitPlaying == true) {
_root.MiniGameDone(true);
}
_root.gotoAndStop(this.nextframe);
Symbol 900 MovieClip [HatAnimation] Frame 41
this.onEnterFrame = undefined;
this._visible = false;
Symbol 908 MovieClip [MouseCursor] Frame 1
function MouseValidateForCustomCursors(forceCustomCursor, frameLabel) {
Mouse.hide();
if (!_root.useCustomCursors) {
trace("MouseValidateForCustomCursors");
if (!forceCustomCursor) {
this.gotoAndStop(_root.FRAME_MOUSEMC_EMPTY);
}
Mouse.show();
}
if ((_root.optionsMC != undefined) || (_root.HelpBoxMC != undefined)) {
if (_root.useCustomCursors) {
} else {
this.gotoAndStop(_root.FRAME_MOUSEMC_EMPTY);
Mouse.show();
}
}
}
MouseValidateForCustomCursors(false, "FrameMouseMCPointer");
stop();
Symbol 908 MovieClip [MouseCursor] Frame 2
MouseValidateForCustomCursors(false, "FrameMouseMCHand");
Symbol 908 MovieClip [MouseCursor] Frame 3
MouseValidateForCustomCursors(false, "FrameMouseMCEmpty");
Symbol 908 MovieClip [MouseCursor] Frame 4
MouseValidateForCustomCursors(false, "FrameMouseMCDragging");
Symbol 908 MovieClip [MouseCursor] Frame 5
MouseValidateForCustomCursors(true, "FrameMouseMCKnife");
Mouse.hide();
Instance of Symbol 907 MovieClip "KnifeTopMC" in Symbol 908 MovieClip [MouseCursor] Frame 5
onClipEvent (load) {
function RotateKnife() {
var _local4 = _root._xmouse - oldX;
var _local3 = _root._ymouse - oldY;
if (oldPosStored == 0) {
oldX = _root._xmouse;
oldY = _root._ymouse;
oldPosStored = 20;
} else {
oldPosStored--;
}
var _local5 = Math.atan2(_local3, _local4);
var _local6 = (180 * (_local5 / Math.PI)) - 90;
this._rotation = _local6;
}
var oldX = 0;
var oldX = 0;
var oldPosStored = 0;
Mouse.hide();
}
onClipEvent (mouseMove) {
RotateKnife();
}
Symbol 911 MovieClip [HudBetterpotNeutral] Frame 1
stop();
Symbol 911 MovieClip [HudBetterpotNeutral] Frame 2
play();
Symbol 920 MovieClip [Progress] Frame 1
#initclip 81
Object.registerClass("Progress", Progress);
#endinitclip
Symbol 927 MovieClip [DoughSlice] Frame 1
#initclip 82
Object.registerClass("DoughSlice", DoughSlice);
#endinitclip
Symbol 928 MovieClip [BaguetteSlice] Frame 1
#initclip 83
Object.registerClass("BaguetteSlice", BaguetteSlice);
#endinitclip
Symbol 945 MovieClip [OnionDice] Frame 1
#initclip 84
Object.registerClass("OnionDice", OnionDice);
#endinitclip
Symbol 946 MovieClip [AvocadoSlice] Frame 1
#initclip 85
Object.registerClass("AvocadoSlice", AvocadoSlice);
#endinitclip
Symbol 981 MovieClip Frame 6
stop();
Symbol 991 MovieClip Frame 1
stop();
Symbol 991 MovieClip Frame 11
stop();
this._parent.WaterStopAnimationComplete();
Symbol 996 MovieClip [EggRollsFoldStep2] Frame 1
stop();
Symbol 996 MovieClip [EggRollsFoldStep2] Frame 2
function InitArrow() {
trace("Will create arrow for " + arrowPathIndex);
arrowPathInfoArray[arrowPathIndex].arrowMC = this.attachMovie("Arrow", "ArrowMC" + arrowPathIndex, this.getNextHighestDepth());
arrowPathInfoArray[arrowPathIndex].arrowMC.Init(arrowPathInfoArray[arrowPathIndex].arrowLength, true, arrowPathInfoArray[arrowPathIndex].arrowRotation, arrowPathInfoArray[arrowPathIndex].xPos, arrowPathInfoArray[arrowPathIndex].yPos);
arrowPathInfoArray[arrowPathIndex].arrowMC.addEventListener(arrowPathInfoArray[arrowPathIndex].arrowMC.PATH_TRACE_COMPLETE, ArrowTraceCompleteHandler);
}
function ArrowTraceCompleteHandler() {
this._parent._parent.UpdateProgress();
if (arrowPathIndex == 4) {
this._parent.EggRollMC7.WaterSpotMC._visible = true;
this._parent.EggRollMC7.gotoAndPlay(2);
} else {
this._parent.nextFrame();
}
arrowPathIndex++;
if (arrowPathIndex >= arrowPathInfoArray.length) {
this._parent._parent.ChildMCStepsComplete();
var _local2 = new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.None.easeNone, this._parent._x, -this._parent._width, 12, false);
_local2.parentMC = this._parent;
_local2.onMotionFinished = EggRollsFoldStep2TweenFinishHandler;
} else if (arrowPathIndex != 5) {
InitArrow();
}
arrowPathInfoArray[arrowPathIndex - 1].arrowMC.swapDepths(this.getNextHighestDepth());
arrowPathInfoArray[arrowPathIndex - 1].arrowMC.removeMovieClip();
}
function EggRollsFoldStep2TweenFinishHandler() {
this.parentMC.swapDepths(this.parentMC.getNextHighestDepth());
this.parentMC.removeMovieClip();
}
function WaterStopAnimationComplete() {
trace("WaterSpot " + this);
this.EggRollMC7.WaterSpotMC._visible = false;
InitArrow();
this.nextFrame();
}
stop();
var arrowPathInfoArray = new Array();
var arrowPathIndex = 0;
arrowPathInfoArray[0] = {xPos:95, yPos:145, arrowLength:85, arrowRotation:270};
arrowPathInfoArray[1] = {xPos:30, yPos:90, arrowLength:80, arrowRotation:360};
arrowPathInfoArray[2] = {xPos:160, yPos:90, arrowLength:80, arrowRotation:180};
arrowPathInfoArray[3] = {xPos:95, yPos:99, arrowLength:62, arrowRotation:270};
arrowPathInfoArray[4] = {xPos:95, yPos:62, arrowLength:125, arrowRotation:180};
arrowPathInfoArray[5] = {xPos:95, yPos:75, arrowLength:60, arrowRotation:270};
arrowPathInfoArray[6] = {xPos:95, yPos:16, arrowLength:48, arrowRotation:90};
InitArrow();
Symbol 1003 MovieClip [SpinachTrianglesFoldStep2] Frame 1
stop();
Symbol 1003 MovieClip [SpinachTrianglesFoldStep2] Frame 2
function InitArrow() {
trace("Will create arrow for " + arrowPathIndex);
arrowPathInfoArray[arrowPathIndex].arrowMC = this.attachMovie("Arrow", "ArrowMC", this.getNextHighestDepth());
arrowPathInfoArray[arrowPathIndex].arrowMC.Init(arrowPathInfoArray[arrowPathIndex].arrowLength, true, arrowPathInfoArray[arrowPathIndex].arrowRotation, arrowPathInfoArray[arrowPathIndex].xPos, arrowPathInfoArray[arrowPathIndex].yPos);
arrowPathInfoArray[arrowPathIndex].arrowMC.addEventListener(ArrowMC.PATH_TRACE_COMPLETE, ArrowTraceCompleteHandler);
}
function ArrowTraceCompleteHandler() {
this._parent._parent.UpdateProgress();
arrowPathIndex++;
this._parent.nextFrame();
if (arrowPathIndex >= arrowPathInfoArray.length) {
this._parent._parent.ChildMCStepsComplete();
var _local2 = new mx.transitions.Tween(this._parent, "_x", mx.transitions.easing.None.easeNone, this._parent._x, -this._parent._width, 12, false);
_local2.parentMC = this._parent;
_local2.onMotionFinished = SpinachTrainglesFoldStep2TweenFinishHandler;
} else {
InitArrow();
}
arrowPathInfoArray[arrowPathIndex - 1].arrowMC.swapDepths(this.getNextHighestDepth());
arrowPathInfoArray[arrowPathIndex - 1].arrowMC.removeMovieClip();
}
function SpinachTrainglesFoldStep2TweenFinishHandler() {
this.parentMC.swapDepths(this.parentMC.getNextHighestDepth());
this.parentMC.removeMovieClip();
}
stop();
var arrowPathInfoArray = new Array();
var arrowPathIndex = 0;
arrowPathInfoArray[0] = {xPos:340, yPos:45, arrowLength:120, arrowRotation:125};
arrowPathInfoArray[1] = {xPos:326, yPos:80, arrowLength:110, arrowRotation:180};
arrowPathInfoArray[2] = {xPos:250, yPos:45, arrowLength:110, arrowRotation:225};
arrowPathInfoArray[3] = {xPos:235, yPos:2, arrowLength:110, arrowRotation:180};
arrowPathInfoArray[4] = {xPos:180, yPos:45, arrowLength:110, arrowRotation:125};
arrowPathInfoArray[5] = {xPos:160, yPos:80, arrowLength:110, arrowRotation:180};
arrowPathInfoArray[6] = {xPos:60, yPos:45, arrowLength:120, arrowRotation:225};
InitArrow();
Symbol 1010 MovieClip [SpinachPhylloTrianglesBake] Frame 1
stop();
Symbol 1056 MovieClip [RedCursor] Frame 1
stop();
Symbol 1072 MovieClip [InstructionsFlip] Frame 1
stop();
Symbol 1189 MovieClip [__Packages.Circle] Frame 0
class Circle extends MovieClip
{
var traceStatus, thisMC, _parent, _xscale, _yscale, onMouseMove, onMouseUp, onPress, _visible, swapDepths, getNextHighestDepth, removeMovieClip, attachMovie, _rotation, redCursorTweenY, _totalframes, _currentframe, onEnterFrame;
function Circle () {
super();
mx.events.EventDispatcher.initialize(this);
traceStatus = TRACE_IDLE;
thisMC = MovieClip(this);
_parent.AddPathEventListener();
}
function dispatchEvent() {
}
function Init(newFlip) {
flip = newFlip;
if (flip == FLIP_HORIZONTAL) {
_xscale = -100;
} else if (flip == FLIP_VERTICAL) {
_yscale = -100;
} else if (flip == FLIP_BOTH) {
_xscale = -100;
_yscale = -100;
}
AddMouseEventListeners();
}
function AddMouseEventListeners() {
thisMC.StartMarkMC.onPress = StartMarkMCOnPressHandler;
onMouseMove = OnMouseMoveHandler;
onMouseUp = PathMCOnMouseUpHandler;
thisMC.PathMC.onReleaseOutside = PathMCOnReleaseOutsideHandler;
thisMC.PathMC.onDragOut = PathMCOnDragOutHandler;
thisMC.StartMarkMC.onRollOver = StartMarkOnRollOverHandler;
thisMC.StartMarkMC.onRollOut = StartMarkOnRollOutHandler;
}
function RemoveMouseEventListeners() {
thisMC.StartMarkMC.onPress = undefined;
onMouseMove = undefined;
onMouseUp = undefined;
thisMC.PathMC.onReleaseOutside = undefined;
thisMC.PathMC.onDragOut = undefined;
thisMC.StartMarkMC.onRollOver = undefined;
thisMC.StartMarkMC.onRollOut = undefined;
}
function StartMarkMCOnPressHandler() {
_parent.traceStatus = TRACE_START;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_DRAGGING);
_parent.isMouseDown = true;
}
function OnMouseMoveHandler() {
if (!isMouseDown) {
return(undefined);
}
if (!thisMC.StartMarkMC.hitTest(_root._xmouse, _root._ymouse, true)) {
RemoveRedCursor();
}
if (thisMC.EndMarkMC.hitTest(_root._xmouse, _root._ymouse, false)) {
if (traceStatus == TRACE_START) {
isMouseDown = false;
traceStatus = TRACE_DONE;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
RemoveRedCursor();
dispatchEvent({type:PATH_TRACE_COMPLETE, target:this});
if ((((_root.selectedRecipeName == _root.RECIPE_NAME_GYOZA) and (_root.currentStepNo == 4)) or ((_root.selectedRecipeName == _root.RECIPE_NAME_GUACAMOLE) and (_root.currentStepNo == 5))) or ((_root.selectedRecipeName == _root.RECIPE_NAME_SPINACH_TRIANGLES) and (_root.currentStepNo == 5))) {
_root.PlaySound(_root.SND_SQUISH, false, false);
}
}
} else if (!thisMC.PathMC.hitTest(_root._xmouse, _root._ymouse, true)) {
if (traceStatus == TRACE_START) {
traceStatus = TRACE_INVALID;
isMouseDown = false;
CreateRedCursor();
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
return(undefined);
}
}
}
function PathMCOnReleaseOutsideHandler() {
_parent.isMouseDown = false;
_parent.traceStatus = TRACE_INVALID;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function PathMCOnMouseUpHandler() {
isMouseDown = false;
traceStatus = TRACE_INVALID;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
CreateRedCursor();
}
function PathMCOnDragOutHandler() {
_parent.isMouseDown = false;
_parent.traceStatus = TRACE_INVALID;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function StartMarkOnRollOverHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
function StartMarkOnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function RemoveMovieClip() {
RemoveRedCursor();
onPress = undefined;
_visible = false;
swapDepths(getNextHighestDepth());
removeMovieClip();
}
function CreateRedCursor() {
if (!_visible) {
return(undefined);
}
if (isRedCursorAnimationRunning) {
return(undefined);
}
isRedCursorAnimationRunning = true;
var _local3 = this;
if (redCursorPointerMC == undefined) {
redCursorPointerMC = attachMovie("RedCursor", "RedCursorMC", getNextHighestDepth(), {_x:_local3.StartMarkMC._x, _y:_local3.StartMarkMC._y});
}
redCursorPointerMC._x = _local3.StartMarkMC._x;
redCursorPointerMC._y = _local3.StartMarkMC._y;
_local3.RedCursorCircularMotionMC._visible = false;
redCursorPointerMC._visible = false;
redCursorPointerMC._rotation = -_rotation;
if (flip == FLIP_HORIZONTAL) {
redCursorPointerMC._xscale = -100;
} else if (flip == FLIP_VERTICAL) {
redCursorPointerMC._yscale = -100;
} else if (flip == FLIP_BOTH) {
redCursorPointerMC._xscale = -100;
redCursorPointerMC._yscale = -100;
}
redCursorTweenY = new mx.transitions.Tween(_root, "_y", mx.transitions.easing.None.easeNone, _root._y, _root._y, 2, true);
var _local4 = mx.utils.Delegate.create(this, RedCursorWaitTweenFinishHandler);
redCursorTweenY.onMotionFinished = _local4;
}
function RedCursorWaitTweenFinishHandler() {
StartRedCursorAnimation(true);
}
function StartRedCursorAnimation(skipChecking) {
var _local3 = this;
if (flip == FLIP_NONE) {
redCursorPointerMC._y = redCursorPointerMC._y + 30;
} else if (flip == FLIP_HORIZONTAL) {
redCursorPointerMC._y = redCursorPointerMC._y + 30;
} else if (flip == FLIP_VERTICAL) {
redCursorPointerMC._y = redCursorPointerMC._y - 30;
} else if (flip == FLIP_BOTH) {
redCursorPointerMC._y = redCursorPointerMC._y - 30;
}
redCursorPointerMC._visible = true;
redCursorTweenY = new mx.transitions.Tween(redCursorPointerMC, "_y", mx.transitions.easing.None.easeNone, redCursorPointerMC._y, _local3.StartMarkMC._x, 18, false);
var _local2 = mx.utils.Delegate.create(this, RedCursorPointerTweenFinishHandler);
redCursorTweenY.onMotionFinished = _local2;
}
function RedCursorPointerTweenFinishHandler() {
redCursorTweenY = new mx.transitions.Tween(redCursorPointerMC, "_y", mx.transitions.easing.None.easeNone, redCursorPointerMC._y, redCursorPointerMC._y, 12, false);
var _local2 = mx.utils.Delegate.create(this, RedCursorHandTweenFinishHandler);
redCursorTweenY.onMotionFinished = _local2;
}
function RedCursorHandTweenFinishHandler() {
var _local2 = this;
redCursorPointerMC._visible = false;
_local2.RedCursorCircularMotionMC._visible = true;
_local2.RedCursorCircularMotionMC.RedCursorDragMC.RedCursorDragNormalMC._visible = flip == FLIP_NONE;
_local2.RedCursorCircularMotionMC.RedCursorDragMC.RedCursorDragHorizontalMC._visible = flip == FLIP_HORIZONTAL;
_local2.RedCursorCircularMotionMC.RedCursorDragMC.RedCursorDragVerticalMC._visible = flip == FLIP_VERTICAL;
_local2.RedCursorCircularMotionMC.RedCursorDragMC.RedCursorDragBothMC._visible = flip == FLIP_BOTH;
_local2.RedCursorCircularMotionMC.onEnterFrame = RedCursorCircularMotionOnEnterFrameHandler;
_local2.RedCursorCircularMotionMC.gotoAndPlay(2);
}
function RedCursorCircularMotionOnEnterFrameHandler() {
if (_currentframe == _totalframes) {
_parent.isRedCursorAnimationRunning = false;
_visible = false;
onEnterFrame = undefined;
_parent.CreateRedCursor();
}
}
function RemoveRedCursor() {
if (redCursorPointerMC == undefined) {
isRedCursorAnimationRunning = false;
return(undefined);
}
var _local2 = this;
redCursorTweenY.stop();
redCursorTweenY.onMotionFinished = undefined;
redCursorTweenY = undefined;
_local2.RedCursorCircularMotionMC.onEnterFrame = undefined;
_local2.RedCursorCircularMotionMC.gotoAndStop(1);
_local2.RedCursorCircularMotionMC._visible = false;
redCursorPointerMC.swapDepths(redCursorPointerMC._parent.getNextHighestDepth());
redCursorPointerMC.removeMovieClip();
redCursorPointerMC = undefined;
isRedCursorAnimationRunning = false;
}
static var FLIP_NONE = 1;
static var FLIP_HORIZONTAL = 2;
static var FLIP_VERTICAL = 3;
static var FLIP_BOTH = 4;
var PATH_TRACE_COMPLETE = "PathTraceComplete";
static var TRACE_IDLE = 0;
static var TRACE_START = 1;
static var TRACE_STOP = 2;
static var TRACE_INVALID = 3;
static var TRACE_DONE = 4;
var redCursorPointerMC = undefined;
var flip = FLIP_NONE;
var isMouseDown = false;
var isRedCursorAnimationRunning = false;
}
Symbol 1190 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 1191 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 1192 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1193 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 1194 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 1195 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1196 MovieClip [__Packages.Knife] Frame 0
class Knife extends MovieClip
{
var _x, _y, numClicksReq, gapBetweenTwoClicks, numClicksDone, onPress, onRollOver, onRollOut, play, _visible, swapDepths, getNextHighestDepth, removeMovieClip;
function Knife () {
super();
mx.events.EventDispatcher.initialize(this);
}
function dispatchEvent() {
}
function Init(startXPos, startYPos, newNumClicksReq, newGapBetweenTwoClicks) {
_x = startXPos;
_y = startYPos;
numClicksReq = newNumClicksReq;
gapBetweenTwoClicks = newGapBetweenTwoClicks;
numClicksDone = 0;
onPress = OnClickHandler;
onRollOver = OnRollOverHandler;
onRollOut = OnRollOutHandler;
_root.ChangeMouseCursorToHand(this);
}
function OnClickHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
play();
}
function OnRollOverHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
function OnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function RemoveMovieClip() {
onPress = undefined;
_visible = false;
swapDepths(getNextHighestDepth());
removeMovieClip();
}
static var MOUSECLICK = "mouseClick";
}
Symbol 1197 MovieClip [__Packages.KneadStep] Frame 0
class KneadStep extends MovieClip
{
var _parent, _visible;
function KneadStep () {
super();
mx.events.EventDispatcher.initialize(this);
}
function dispatchEvent() {
}
function Init() {
}
function AddPathEventListener() {
var _local2 = this;
_local2.PathMC.addEventListener(_local2.PathMC.PATH_TRACE_COMPLETE, PathTraceCompleteHandler);
}
function PathTraceCompleteHandler() {
if (_root.selectedRecipeName == _root.RECIPE_NAME_GUACAMOLE) {
_parent._parent.selectedFoodMC.gotoAndPlay(2);
} else {
_parent.FoodMC.gotoAndPlay(2);
}
_parent.HandMC.gotoAndPlay(2);
_visible = false;
}
function FoodMCPlayComplete() {
dispatchEvent({type:KNEAD_STEP_COMPLETE, target:this});
}
static var KNEAD_STEP_COMPLETE = "kneadStepComplete";
}
Symbol 1198 MovieClip [__Packages.Grate] Frame 0
class Grate extends MovieClip
{
var foodChunkYPos, foodChunkMaxYPos, foodChunkYPosShift, grateFoodYPosShift, grateFoodFallYPosShift, graterFrontMC, attachMovie, graterBackMC, foodChunkMC, grateFoodMC, grateFoodFallMC, foodChunkArrowMC, foodChunkMask, grateFoodMask, particalName, calloutMC, grateStatus, onMouseMove, _parent, _x, onEnterFrame, onPress, onRelease, onReleaseOutside, _y, swapDepths, removeMovieClip;
function Grate () {
super();
mx.events.EventDispatcher.initialize(this);
}
function dispatchEvent() {
}
function Init(foodChunkName, grateFoodName, grateFoodFallName, grateFoodFallParticalName, grateFoodType) {
if (grateFoodType == GRATE_FOOD_TYPE_GINGER) {
foodChunkYPos = GINGER_CHUNK_INIT_YPOS;
foodChunkMaxYPos = GINGER_CHUNK_INIT_YPOS + 85;
foodChunkYPosShift = GINGER_CHUNK_YPOS_SHIFT;
grateFoodYPosShift = GRATE_GINGER_FOOD_YPOS_SHIFT;
grateFoodFallYPosShift = GRATE_GINGER_FOOD_FALL_YPOS_SHIFT;
var _local3 = GINGER_ARROW_BLUE_LENGTH;
} else if (grateFoodType == GRATE_FOOD_TYPE_CARROT) {
foodChunkYPos = CARROT_CHUNK_INIT_YPOS;
foodChunkMaxYPos = CARROT_CHUNK_INIT_YPOS + 70;
foodChunkYPosShift = CARROT_CHUNK_YPOS_SHIFT;
grateFoodYPosShift = GRATE_CARROT_FOOD_YPOS_SHIFT;
grateFoodFallYPosShift = GRATE_CARROT_FOOD_FALL_YPOS_SHIFT;
var _local3 = CARROT_ARROW_BLUE_LENGTH;
}
graterFrontMC = attachMovie("GraterFront", "GraterFrontMC", DEPTH_GRATE_FRONT, {_x:130, _y:212});
graterBackMC = attachMovie("GraterBack", "GraterBackMC", DEPTH_GRATE_BACK, {_x:142.8, _y:68});
MovieClip(this).BackgroundMC.attachMovie("TopHud", "TopHudMC", MovieClip(this).BackgroundMC.getNextHighestDepth(), {_x:0, _y:0});
foodChunkMC = attachMovie(foodChunkName, foodChunkName + "MC", DEPTH_FOOD_CHUNK, {_x:251.5, _y:foodChunkYPos});
grateFoodMC = attachMovie(grateFoodName, grateFoodName + "MC", DEPTH_GRATE_FOOD, {_x:142, _y:323});
grateFoodFallMC = attachMovie(grateFoodFallName, grateFoodFallName + "MC", DEPTH_GRATE_FOOD_FALL, {_x:142, _y:GRATE_FOOD_FALL_INIT_YPOS});
foodChunkArrowMC = attachMovie("ArrowBlue", "ArrowBlueMC", DEPTH_FOOD_CHUNK_ARROW_BLUE, {_x:foodChunkMC._x + FOOD_CHUNK_ARROW_BLUE_XPOS_OFFSET, _y:195});
foodChunkArrowMC.Init(_local3, false, 180);
foodChunkArrowMC._visible = false;
foodChunkMask = attachMovie("Mask2", "FoodChunkMask", DEPTH_FOOD_CHUNK + 1, {_x:127, _y:80, _alpha:50, _width:255, _height:140});
grateFoodMask = attachMovie("Mask2", "GrateFoodMask", DEPTH_GRATE_FOOD_FALL + 1, {_x:142, _y:250, _alpha:50, _width:220, _height:75});
foodChunkMC.setMask(foodChunkMask);
grateFoodMC.setMask(grateFoodMask);
particalName = grateFoodFallParticalName;
foodChunkMC.onPress = FoodChunkOnPressHandler;
foodChunkMC.onRelease = FoodChunkOnReleaseHandler;
foodChunkMC.onReleaseOutside = FoodChunkOnReleaseHandler;
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
grateStatus = GRATE_STATUS_READY;
_root.ShowGoMC(GoMCCompleteHandler, foodChunkArrowMC);
}
function GoMCCompleteHandler(foodChunkArrowMC) {
foodChunkArrowMC._visible = true;
}
function FoodChunkOnPressHandler() {
onMouseMove = _parent.FoodChunkOnMouseMoveHandler;
_parent.foodChunkArrowMC._visible = false;
}
function FoodChunkOnReleaseHandler() {
onMouseMove = undefined;
_parent.foodChunkArrowMC._x = _x + FOOD_CHUNK_ARROW_BLUE_XPOS_OFFSET;
if (_parent.grateStatus == GRATE_STATUS_READY) {
_parent.foodChunkArrowMC._visible = true;
}
}
function FoodChunkOnMouseMoveHandler() {
if (_parent.grateStatus != GRATE_STATUS_READY) {
return(undefined);
}
var _local4 = _parent._xmouse;
var _local6 = _parent.graterFrontMC._y;
if ((_parent._xmouse < 160) || (_parent._xmouse > 350)) {
_local4 = _x;
} else {
_x = _parent._xmouse;
}
var _local9 = Math.abs(_parent.oldXPos - _parent._xmouse);
var _local3 = new Date();
var _local5 = Math.abs(_parent.oldTime - _local3.getTime());
var _local7 = Math.abs(_parent._xmouse - _parent.oldXPos);
if (((_local5 < MIN_MOUSE_MOVE_SPEED) && (_local7 > MIN_X_DIFF)) && (Math.random() < PARTICAL_FALL_PROBABLITY)) {
var _local8 = _parent.attachMovie(_parent.particalName, _parent.particalName + _parent.counter, DEPTH_GRATE_FOOD_FALL_PARTICAL + _parent.counter, {_x:_local4, _y:_local6});
_local8.onEnterFrame = _parent.ParticalOnEnterFrameHandler;
_root.PlaySound(_root.SND_GRATE, false, false);
_parent.foodChunkMC._y = _parent.foodChunkMC._y + _parent.foodChunkYPosShift;
_parent.grateFoodMC._y = _parent.grateFoodMC._y + _parent.grateFoodYPosShift;
_parent.grateFoodFallMC._y = _parent.grateFoodFallMC._y + _parent.grateFoodFallYPosShift;
_parent.UpdateProgress();
if (_parent.grateFoodFallMC._y >= GRATE_FOOD_FALL_MAX_YPOS_FOR_CLEANUP) {
_parent.grateStatus = GRATE_STATUS_CLEANUP_FOOD_FALL;
_root.ShowHintArrow(_root.HINT_ARROW_RIGHT, 70, 222);
_parent.grateFoodFallMC.onPress = _parent.GrateFoodFallOnPressHandler;
}
if (_parent.foodChunkMC._y >= _parent.foodChunkMaxYPos) {
trace("Grating Complete.");
_parent.grateStatus = GRATE_STATUS_COMPLETE;
onEnterFrame = undefined;
onPress = undefined;
onRelease = undefined;
onReleaseOutside = undefined;
_parent.mProgress = 100;
_root.ShowFinishedMC();
}
_parent.counter++;
}
_parent.oldXPos = _parent._xmouse;
_parent.oldTime = _local3.getTime();
}
function ParticalOnEnterFrameHandler() {
_y = _y + PARTICAL_YPOS_FALL_SPEED;
if (_y >= PARTICAL_FALL_MAX_YPOS) {
onEnterFrame = undefined;
swapDepths(_parent.getNextHighestDepth());
removeMovieClip();
}
}
function GrateFoodFallOnPressHandler() {
_root.RemoveHintArrow();
onEnterFrame = _parent.GrateFoodFallOnEnterFrameHandler;
onPress = undefined;
}
function GrateFoodFallOnEnterFrameHandler() {
_y = _y + GRATE_FOOD_FALL_YPOS_FALL_SPEED;
if (_y >= GRATE_FOOD_FALL_MAX_YPOS) {
onEnterFrame = undefined;
_parent.grateStatus = GRATE_STATUS_READY;
_y = GRATE_FOOD_FALL_INIT_YPOS;
_parent.foodChunkArrowMC._visible = true;
}
}
function UpdateProgress() {
var _local3 = foodChunkMaxYPos - foodChunkYPos;
mProgress = ((foodChunkMC._y - foodChunkYPos) / _local3) * 100;
_root.PlaySound(_root.SND_GRATE, false, false);
trace((((this + " Progerss ->>>>>>>>>>> ") + mProgress) + ", ") + _root.EVENT_PROGRESS_UPDATE);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
static var GRATE_FOOD_TYPE_GINGER = 1;
static var GRATE_FOOD_TYPE_CARROT = 2;
var mProgress = 0;
static var DEPTH_GRATE_BACK = 100;
static var DEPTH_TOPHUD = 105;
static var DEPTH_GRATE_FOOD = 110;
static var DEPTH_GRATE_FOOD_FALL = 120;
static var DEPTH_FOOD_CHUNK = 200;
static var DEPTH_GRATE_FOOD_FALL_PARTICAL = 500;
static var DEPTH_GRATE_FRONT = 10000;
static var DEPTH_FOOD_CHUNK_ARROW_BLUE = 10010;
static var MIN_X_DIFF = 3;
static var MIN_MOUSE_MOVE_SPEED = 0.6;
static var PARTICAL_FALL_PROBABLITY = 0.35;
static var PARTICAL_YPOS_FALL_SPEED = 6;
static var GRATE_FOOD_FALL_YPOS_FALL_SPEED = 16;
static var GRATE_FOOD_FALL_MAX_YPOS = 315;
static var PARTICAL_FALL_MAX_YPOS = 310;
static var GRATE_FOOD_FALL_INIT_YPOS = 213.4;
static var FOOD_CHUNK_ARROW_BLUE_XPOS_OFFSET = 40;
static var GINGER_CHUNK_INIT_YPOS = 159.4;
static var CARROT_CHUNK_INIT_YPOS = 143;
static var GINGER_ARROW_BLUE_LENGTH = 76;
static var CARROT_ARROW_BLUE_LENGTH = 78;
static var GINGER_CHUNK_YPOS_SHIFT = 0.55;
static var GRATE_GINGER_FOOD_YPOS_SHIFT = -0.22;
static var GRATE_GINGER_FOOD_FALL_YPOS_SHIFT = 0.55;
static var CARROT_CHUNK_YPOS_SHIFT = 0.73;
static var GRATE_CARROT_FOOD_YPOS_SHIFT = -0.31;
static var GRATE_CARROT_FOOD_FALL_YPOS_SHIFT = 0.64;
static var GRATE_FOOD_FALL_MAX_YPOS_FOR_CLEANUP = GRATE_FOOD_FALL_INIT_YPOS + 18;
static var GRATE_STATUS_READY = 1;
static var GRATE_STATUS_CLEANUP_FOOD_FALL = 2;
static var GRATE_STATUS_COMPLETE = 3;
var oldXPos = MovieClip.prototype._xmouse;
var counter = 0;
}
Symbol 1199 MovieClip [__Packages.Callout] Frame 0
class Callout extends MovieClip
{
var calloutMessage, maxCalloutWidth, calloutType, fontSize, createEmptyMovieClip, getNextHighestDepth, createTextField;
function Callout () {
super();
}
function Init(newCalloutMessage, newMaxCalloutWidth, newCalloutType, newFontSize) {
calloutMessage = newCalloutMessage;
maxCalloutWidth = newMaxCalloutWidth;
calloutType = newCalloutType;
fontSize = newFontSize;
if (fontSize == undefined) {
fontSize = CALLOUT_TEXT_DEFAULT_FONT_SIZE;
}
SetCalloutTextBox();
}
function SetCalloutTextBox() {
var _local3;
var _local5;
var _local4;
var _local7;
var _local2;
var _local10;
_local3 = createEmptyMovieClip("CalloutConatainer", getNextHighestDepth());
_local5 = _local3.attachMovie(calloutType + "Left", "calloutLeftMC", _local3.getNextHighestDepth(), {_x:0, _y:0});
_local4 = _local3.attachMovie(calloutType + "Middle", "CalloutSmallMiddle", _local3.getNextHighestDepth(), {_x:_local5._width, _y:_local5._y});
_local7 = _local3.attachMovie(calloutType + "Right", "calloutSmallRightMC", _local3.getNextHighestDepth(), {_x:0, _y:_local5._y});
_local2 = createTextField("CalloutTextBoxMC", getNextHighestDepth(), 0, 0, maxCalloutWidth, _local5._height);
_local2.text = calloutMessage;
_local2.autoSize = true;
_local2.wordWrap = false;
_local2.selectable = false;
_local2.embedFonts = true;
var _local6 = new TextFormat();
_local6.font = "ErasDemiITC";
_local6.size = fontSize;
_local2.setTextFormat(_local6);
if (_local2._width > maxCalloutWidth) {
_local2.wordWrap = true;
_local2._width = maxCalloutWidth;
}
_local4._width = _local2._width - (_local5._width + _local7._width);
if (calloutType == CALLOUT_CHEF) {
_local2._x = 20;
_local4._width = _local4._width + 30;
} else {
_local2._x = _local2._x + 10;
_local4._width = _local4._width + 20;
}
_local7._x = _local4._x + _local4._width;
if (calloutType != CALLOUT_CHEF) {
}
_local2._y = ((_local3._height - _local2._height) / 2) - 5;
}
static var CALLOUT_CHEF = "CalloutChef";
static var CALLOUT_SMALL = "CalloutSmall";
static var CALLOUT_TINY = "CalloutTiny";
static var CALLOUT_INCREASE_HEIGHT_OFFSET = 50;
static var CALLOUT_TEXT_DEFAULT_FONT_SIZE = 15;
}
Symbol 1200 MovieClip [__Packages.AddIngredients] Frame 0
class AddIngredients extends MovieClip
{
var ingredientsArray, currentIndex, mistake, animationType, maskInfo, bigBowlItemMC, getNextHighestDepth, calloutMC, _parent, swapDepths, startDrag, stopDrag, _x, _y, _width, _height, gotoAndPlay, onEnterFrame, stop, _totalframes, _currentframe, play, hintClipWidth, hintClipHeight, spotLightMaskMC, spotLightPiAngle, _visible, removeMovieClip;
function AddIngredients () {
super();
mx.events.EventDispatcher.initialize(this);
ingredientsArray = new Array();
currentIndex = 0;
mistake = false;
mProgress = 0;
mBadProgress = 0;
}
function dispatchEvent() {
}
function Init(newIngredientsArray, bigBowlItem, calloutText, newAnimationType) {
var _local4 = this;
minigameInit = false;
animationType = newAnimationType;
maskInfo = {maskName:"Mask2", xPos:15, yPos:25};
ingredientsArray = _root.ShuffleArray(newIngredientsArray);
bigBowlItemMC = _local4.BigBowl.attachMovie(bigBowlItem, bigBowlItem + "MC", getNextHighestDepth(), {_x:0, _y:0});
var _local3 = 0;
while (_local3 < ingredientsArray.length) {
ingredientsArray[_local3].containerMC = BuildContainerMC(this, _local3);
ingredientsArray[_local3].containerMC.arrayIndex = _local3;
ingredientsArray[_local3].containerMC.onPress = ContainerMCOnPressHandler;
ingredientsArray[_local3].containerMC.onRelease = ContainerMCOnReleaseHandler;
_local3++;
}
calloutMC = _root.CreateCalloutMC(this, calloutText, _root.MINIGAME_ADDINGREDIENTS_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
hintFrameWidth = _local4.HintFrame._width;
hintFrameHeight = _local4.HintFrame._height;
_local4 = this;
_local4.HintFrame.hintMC = BuildContainerMC(_local4.HintFrame, 0);
_local4.HintFrame.hintMC._x = (hintFrameWidth - _local4.HintFrame.hintMC._width) / 2;
_local4.HintFrame.hintMC._y = (hintFrameHeight - _local4.HintFrame.hintMC._height) / 2;
_local4.HintFrame._visible = false;
_root.ShowGoMC(GoMCCompleteHandler, _local4.HintFrame);
}
function GoMCCompleteHandler(hintFrameMC) {
hintFrameMC._visible = true;
_root.minigameMC.minigameInit = true;
_root.minigameMC.SetHintFrameAnimation();
}
function BuildContainerMC(thisMC, ingredientsArrayIndex) {
var _local3;
var _local2 = ingredientsArrayIndex;
_local3 = thisMC.attachMovie(ingredientsArray[_local2].containerName, ingredientsArray[_local2].containerName + _local2, thisMC.getNextHighestDepth(), {_x:ingredientsArray[_local2].containerX, _y:ingredientsArray[_local2].containerY});
if (ingredientsArray[_local2].itemType == TYPE_POUR) {
_local3.itemMC = _local3.attachMovie(ingredientsArray[_local2].itemName, ingredientsArray[_local2].itemName + _local2, ingredientsArray[_local2].containerMC.getNextHighestDepth(), {_x:0, _y:0});
}
return(_local3);
}
function ContainerMCOnPressHandler() {
if (!_parent.minigameInit) {
return(undefined);
}
swapDepths(_parent.getNextHighestDepth());
startDrag();
}
function ContainerMCOnReleaseHandler() {
stopDrag();
var _local4 = this;
var _local3 = _parent;
var _local5 = false;
if (_local3.isAddingFood) {
_x = _parent.ingredientsArray[_local4.arrayIndex].containerX;
_y = _parent.ingredientsArray[_local4.arrayIndex].containerY;
return(undefined);
}
_local3.isAddingFood = true;
if (_root.IsNumBetween(_x, _local3.BigBowl._x, _local3.BigBowl._x + _local3.BigBowl._width) && (_root.IsNumBetween(_y, _parent.BigBowl._y, _local3.BigBowl._y + _local3.BigBowl._height))) {
_local5 = true;
} else if (_root.IsNumBetween(_x + _width, _local3.BigBowl._x, _local3.BigBowl._x + _local3.BigBowl._width) && (_root.IsNumBetween(_y + _height, _parent.BigBowl._y, _local3.BigBowl._y + _local3.BigBowl._height))) {
_local5 = true;
}
if (_local5) {
if (_x < 145) {
_x = 145;
} else if (_x > 210) {
_x = 210;
}
if (_y < 220) {
_y = 220;
} else if (_y > 240) {
_y = 240;
}
if (_local3.currentIndex != _local4.arrayIndex) {
_x = _local3.ingredientsArray[_local4.arrayIndex].containerX;
_y = _local3.ingredientsArray[_local4.arrayIndex].containerY;
_root.PlaySound(_root.SND_INCORRECT, false, false);
trace("This is not correct item.");
if (!_local3.mistake) {
_local3.UpdateProgress(false);
_local3.mistake = true;
}
_local3.isAddingFood = false;
return(undefined);
}
_local3.currentIndex++;
gotoAndPlay(1);
_root.PlaySound(_root.SND_CORRECT, false, false);
onEnterFrame = _local3.ContainerEnterFrameHandler;
if (_local3.ingredientsArray[_local4.arrayIndex].itemType == TYPE_POUR) {
_local4.itemMC._visible = false;
_local4.itemMC.swapDepths(getNextHighestDepth());
_local4.itemMC.removeMovieClip();
_local3.BigBowl.itemMCBigBowl = _local3.BigBowl.attachMovie(_local3.ingredientsArray[_local4.arrayIndex].itemName, _local3.ingredientsArray[_local4.arrayIndex].itemName, _local3.BigBowl.getNextHighestDepth(), {_x:_x - _local3.BigBowl._x, _y:_y - _local3.BigBowl._y});
} else if (_local3.ingredientsArray[_local4.arrayIndex].itemType == TYPE_SHAKE) {
_root.PlaySound(_root.SND_SALTSHAKER, false, false);
}
if (_local3.mistake) {
_local3.mistake = false;
} else {
_local3.UpdateProgress(true);
}
_local3.CleanUpHintFrameAnimation();
_local3.HintFrame.hintMC.swapDepths(_parent.HintFrame.getNextHighestDepth());
_local3.HintFrame.hintMC.removeMovieClip();
trace((((("Build Width-" + _parent.hintFrameWidth) + ",") + _local3.HintFrame.hintMC._width) + ",") + _local4.HintFrame.hintMC._parent);
trace((("Build Height-" + _parent.hintFrameHeight) + ",") + _local3.HintFrame.hintMC._height);
_local3.HintFrame.hintMC = _local3.BuildContainerMC(_local3.HintFrame, _local3.currentIndex);
_local3.HintFrame.hintMC._x = (_parent.hintFrameWidth - _local3.HintFrame.hintMC._width) / 2;
_local3.HintFrame.hintMC._y = (_parent.hintFrameHeight - _local3.HintFrame.hintMC._height) / 2;
if (_local3.currentIndex < _local3.ingredientsArray.length) {
_local3.SetHintFrameAnimation();
}
trace("callout : " + _local3.currentIndex);
_root.ChangeCalloutMCText(_local3.calloutMC, _local3.ingredientsArray[_local3.currentIndex - 1].calloutText);
} else {
_x = _parent.ingredientsArray[_local4.arrayIndex].containerX;
_y = _parent.ingredientsArray[_local4.arrayIndex].containerY;
_local3.isAddingFood = false;
}
}
function ContainerEnterFrameHandler() {
if (_root.isGamePaused) {
stop();
return(undefined);
}
if (_currentframe == _totalframes) {
var _local3 = this;
_x = _parent.ingredientsArray[_local3.arrayIndex].containerX;
_y = _parent.ingredientsArray[_local3.arrayIndex].containerY;
if (_parent.BigBowl.itemMCBigBowl._totalframes > 1) {
_parent.BigBowl.itemMCBigBowl.gotoAndPlay(2);
}
_parent.isAddingFood = false;
onEnterFrame = undefined;
if (_parent.currentIndex >= _parent.ingredientsArray.length) {
trace("No more items");
_root.ShowFinishedMC();
return(undefined);
}
} else {
play();
}
}
function UpdateProgress(isGoodProgress) {
if (isGoodProgress) {
mProgress = mProgress + ((1 / ingredientsArray.length) * 100);
} else {
mBadProgress = mBadProgress + ((1 / ingredientsArray.length) * 100);
trace((((("Bad Progerss ->>>>>>>>>>> " + mProgress) + ", ") + mBadProgress) + ", ") + currentIndex);
}
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
function SetHintFrameAnimation() {
var _local2 = this;
if (animationType == HINT_FRAME_ANIMATE_SIZE) {
hintClipWidth = 0;
hintClipHeight = 0;
_local2.HintFrame.hintMC._visible = false;
_local2.HintFrame.onEnterFrame = HintFrameAnimateSizeOnEnterFrameHandler;
} else if (animationType == HINT_FRAME_ANIMATE_QUESTION_MARK) {
SetQuestionMarkOnFrame();
} else if (animationType == HINT_FRAME_ANIMATE_MASK) {
AnimateMask();
}
}
function CleanUpHintFrameAnimation() {
var _local3 = this;
if (animationType == HINT_FRAME_ANIMATE_QUESTION_MARK) {
clearInterval(intervalID);
trace("CleanUpHintFrameAnimation " + this);
var _local2 = 0;
while (_local2 <= 24) {
trace((("Cleanup before " + _local3.HintFrame["QueMark" + _local2]) + ", ") + _local3.HintFrame["Mask_" + _local2]);
_local3.HintFrame["QueMark" + _local2].tween.stop();
_local3.HintFrame["QueMark" + _local2].setMask(null);
_local3.HintFrame["QueMark" + _local2].swapDepths(_local3.HintFrame.getNextHighestDepth());
_local3.HintFrame["QueMark" + _local2].removeMovieClip();
_local3.HintFrame["Mask_" + _local2].swapDepths(_local3.HintFrame.getNextHighestDepth());
_local3.HintFrame["Mask_" + _local2].removeMovieClip();
trace((("Cleanup " + _local3.HintFrame["QueMark" + _local2]) + ", ") + _local3.HintFrame["Mask_" + _local2]);
_local2++;
}
queMark.splice(0, queMark.length);
} else if (animationType == HINT_FRAME_ANIMATE_MASK) {
spotLightMaskMC.onEnterFrame = undefined;
spotLightMaskMC.swapDepths(_parent.HintFrame.getNextHighestDepth());
spotLightMaskMC.removeMovieClip();
spotLightMaskMC = undefined;
}
}
function AnimateMask() {
var _local2;
spotLightMaskMC = MovieClip(this).HintFrame.attachMovie("SpotLightMask", "SpotLightMaskMC", MovieClip(this).HintFrame.getNextHighestDepth(), {_x:15, _y:24});
spotLightMaskMC._x = -26;
spotLightMaskMC._y = -20;
spotLightMaskMC._visible = true;
_local2 = MovieClip(this).HintFrame.attachMovie(maskInfo.maskName, "MaskMC", MovieClip(this).HintFrame.getNextHighestDepth(), {_x:maskInfo.xPos, _y:maskInfo.yPos - 2});
_local2._width = 80;
_local2._height = 78;
_local2._visible = false;
spotLightMaskMC.setMask(_local2);
spotLightAngle = Math.floor(Math.random() * 360) + 1;
spotLightPiAngle = Math.PI * (spotLightAngle / 180);
spotLightMaskMC.onEnterFrame = OnEnterFrameHandlerSpotLightMaskMC;
}
function OnEnterFrameHandlerSpotLightMaskMC() {
if (_root.isGamePaused) {
return(undefined);
}
if (_parent._parent.x_mov == 0) {
_x = _x + 1;
} else if (_parent._parent.x_mov == 1) {
_x = _x - 1;
}
if (_x >= 8) {
_parent._parent.x_mov = 1;
} else if (_x <= -55) {
_parent._parent.x_mov = 0;
}
if (_parent._parent.y_mov == 0) {
_y = _y + 1;
} else if (_parent._parent.y_mov == 1) {
_y = _y - 1;
}
if (_y >= 8) {
_parent._parent.y_mov = 1;
} else if (_y <= -44) {
_parent._parent.y_mov = 0;
}
}
function SetQuestionMarkOnFrame() {
if (_root.isGamePaused) {
return(undefined);
}
var _local4 = this;
var _local3 = 0;
var _local6 = 0;
var _local10 = 23.5;
var _local9 = 0;
while (_local9 <= 4) {
_local6 = 15;
var _local5 = 0;
while (_local5 <= 4) {
queMark[_local3] = _local4.HintFrame.attachMovie("QueMark", "QueMark" + _local3, _local4.HintFrame.getNextHighestDepth(), {_x:_local6, _y:_local10});
_local6 = _local6 + queMark[_local3]._width;
queMark[_local3].maskMC = _local4.HintFrame.attachMovie(maskInfo.maskName, "Mask_" + _local3, _local4.HintFrame.getNextHighestDepth(), {_x:maskInfo.xPos, _y:maskInfo.yPos - 2});
queMark[_local3].maskMC._width = 80;
queMark[_local3].maskMC._height = 80;
queMark[_local3].setMask(queMark[_local3].maskMC);
trace((("hello " + queMark[_local3]._name) + ", ") + queMark[_local3].maskMC);
_local3++;
_local5++;
}
_local10 = _local10 + queMark[_local3 - 1]._height;
_local9++;
}
intervalID = setInterval(this, "DropConcealFood", 500);
}
function DropConcealFood() {
if (_root.isGamePaused) {
return(undefined);
}
var _local3 = Math.floor(Math.random() * queMark.length);
queMark[_local3].swapDepths(MovieClip(this).HintFrame.getNextHighestDepth());
queMark[_local3].tween = new mx.transitions.Tween(queMark[_local3], "_y", mx.transitions.easing.None.easeNone, queMark[_local3]._y, 110, 24, false);
queMark.splice(_local3, 1);
if (queMark.length == 0) {
clearInterval(intervalID);
}
}
function HintFrameAnimateSizeOnEnterFrameHandler() {
if (_root.isGamePaused) {
return(undefined);
}
if ((_parent.hintClipWidth <= 0) && (_parent.hintClipHeight <= 0)) {
_parent.hintClipWidth = Math.round(_parent.HintFrame.hintMC._width);
_parent.hintClipHeight = Math.round(_parent.HintFrame.hintMC._height);
_parent.HintFrame.hintMC._width = 0;
_parent.HintFrame.hintMC._height = 0;
_parent.HintFrame.hintMC._visible = true;
}
if (Math.round(_parent.HintFrame.hintMC._width) != Math.round(_parent.hintClipWidth)) {
_parent.HintFrame.hintMC._xscale = _parent.HintFrame.hintMC._xscale + 0.5;
}
if (Math.round(_parent.HintFrame.hintMC._height) != Math.round(_parent.hintClipHeight)) {
_parent.HintFrame.hintMC._yscale = _parent.HintFrame.hintMC._yscale + 0.5;
}
_parent.HintFrame.hintMC._x = (_parent.HintFrame._width - _parent.HintFrame.hintMC._width) / 2;
_parent.HintFrame.hintMC._y = (_parent.HintFrame._height - _parent.HintFrame.hintMC._height) / 2;
if ((_parent.HintFrame.hintMC._width >= _parent.hintClipWidth) && (_parent.HintFrame.hintMC._height >= _parent.hintClipHeight)) {
_parent.HintFrame.onEnterFrame = undefined;
}
}
function RemoveMovieClip() {
_visible = false;
swapDepths(getNextHighestDepth());
removeMovieClip();
}
static var TYPE_POUR = 1;
static var TYPE_SHAKE = 2;
var HINT_FRAME_ANIMATE_SIZE = 1;
var HINT_FRAME_ANIMATE_QUESTION_MARK = 2;
var HINT_FRAME_ANIMATE_MASK = 3;
var HINT_FRAME_ANIMATE_PIXELATE = 4;
var mProgress = 0;
var mBadProgress = 0;
var queMark = new Array();
var intervalID = 0;
var isAngleSet = false;
var spotLightAngle = 0;
var x_mov = 0;
var y_mov = 0;
var hintFrameWidth = 0;
var hintFrameHeight = 0;
var isAddingFood = false;
var minigameInit = false;
}
Symbol 1201 MovieClip [__Packages.GyozaFold] Frame 0
class GyozaFold extends MovieClip
{
var firstTime, mTotalSubSteps, mSubStepsCompleted, numRepeatCount, stepsArray, attachMovie, getNextHighestDepth, maxRepeatCount, calloutMC, stepsArrayIndex, _parent, _visible, swapDepths, removeMovieClip;
function GyozaFold () {
super();
firstTime = true;
mx.events.EventDispatcher.initialize(this);
mTotalSubSteps = 0;
mSubStepsCompleted = 0;
numRepeatCount = 0;
mProgress = 0;
}
function dispatchEvent() {
}
function Init(newStepsArray, newMaxRepeatCount) {
stepsArray = newStepsArray.concat();
var _local3 = 0;
while (_local3 < stepsArray.length) {
stepsArray[_local3].movieMC = attachMovie(stepsArray[_local3].movieName, stepsArray[_local3].movieName + "MC", getNextHighestDepth(), {_x:stepsArray[_local3].xPos, _y:stepsArray[_local3].yPos});
if (stepsArray[_local3].verticalTween == true) {
var _local4 = new mx.transitions.Tween(stepsArray[_local3].movieMC, "_x", mx.transitions.easing.None.easeNone, Stage.width, stepsArray[_local3].xPos, 12, false);
}
trace("GyozaFold: Init: create movie clip " + stepsArray[_local3].movieMC);
_local3++;
}
maxRepeatCount = newMaxRepeatCount;
_local3 = 0;
while (_local3 < stepsArray.length) {
mTotalSubSteps = mTotalSubSteps + stepsArray[_local3].numSteps;
_local3++;
}
mTotalSubSteps = mTotalSubSteps * maxRepeatCount;
trace((("mTotalSubSteps " + mTotalSubSteps) + ", ") + mSubStepsCompleted);
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
stepsArrayIndex = -1;
ShowNextStep();
if (firstTime) {
_root.ShowGoMC(GoMCCompleteHandler, stepsArray[stepsArrayIndex]);
firstTime = false;
}
}
function GoMCCompleteHandler(stepsArrayObject) {
if (stepsArrayObject.hintArrowDir != undefined) {
_root.ShowHintArrow(stepsArrayObject.hintArrowDir, stepsArrayObject.hintArrowXPos, stepsArrayObject.hintArrowYPos);
}
}
function GyozaFoldClickHandler() {
_parent.UpdateProgress();
if (_parent.stepsArray[_parent.stepsArrayIndex].hintArrowDir != undefined) {
_root.RemoveHintArrow();
}
trace((("GyozaFold: GyozaFoldClickHandler: " + this) + ", ") + _parent.stepsArray[_parent.stepsArray.length - 1].movieMC);
_parent.stepsArray[_parent.stepsArray.length - 1].movieMC.nextFrame();
_parent.ShowNextStep();
}
function ShowNextStep() {
stepsArray[stepsArrayIndex].movieMC.onPress = undefined;
stepsArrayIndex++;
if (stepsArrayIndex >= stepsArray.length) {
return(undefined);
}
if ((stepsArray[stepsArrayIndex].hintArrowDir != undefined) && (firstTime == false)) {
_root.ShowHintArrow(stepsArray[stepsArrayIndex].hintArrowDir, stepsArray[stepsArrayIndex].hintArrowXPos, stepsArray[stepsArrayIndex].hintArrowYPos);
}
if (stepsArray[stepsArrayIndex].movieName != "") {
if (stepsArray[stepsArrayIndex].movieMC == undefined) {
stepsArray[stepsArrayIndex].movieMC = attachMovie(stepsArray[stepsArrayIndex].movieName, stepsArray[stepsArrayIndex].movieName + "MC", getNextHighestDepth(), {_x:stepsArray[stepsArrayIndex].xPos, _y:stepsArray[stepsArrayIndex].yPos});
trace("GyozaFold: ShowNextStep: new movie clip created " + stepsArray[stepsArrayIndex].movieMC);
}
}
if (stepsArray[stepsArrayIndex].functionType == FUNCTION_TYPE_ONPRESS) {
stepsArray[stepsArrayIndex].movieMC.onPress = GyozaFoldClickHandler;
trace("GyozaFold: ShowNextStep: added onPress event handler on movie clip " + stepsArray[stepsArrayIndex].movieMC);
}
}
function ChildMCStepsComplete() {
stepsArray[stepsArrayIndex].movieMC = undefined;
numRepeatCount++;
if (numRepeatCount < maxRepeatCount) {
var _local3 = stepsArray.length - 1;
stepsArray[_local3].movieMC = attachMovie(stepsArray[_local3].movieName, stepsArray[_local3].movieName + "MC", getNextHighestDepth(), {_x:stepsArray[_local3].xPos, _y:stepsArray[_local3].yPos});
if (stepsArray[_local3].verticalTween == true) {
var _local4 = new mx.transitions.Tween(stepsArray[_local3].movieMC, "_x", mx.transitions.easing.None.easeNone, Stage.width, stepsArray[_local3].xPos, 12, false);
}
stepsArrayIndex = -1;
ShowNextStep();
} else {
_root.ShowFinishedMC();
return(undefined);
}
}
function UpdateProgress() {
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
trace((("Progerss ->>>>>>>>>>> " + mProgress) + ", ") + mSubStepsCompleted);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
function RemoveMovieClip() {
_visible = false;
swapDepths(getNextHighestDepth());
removeMovieClip();
}
var mProgress = 0;
static var FUNCTION_TYPE_ONPRESS = 1;
static var FUNCTION_TYPE_ONPRESS_CHILD = 2;
static var FUNCTION_TYPE_EVENT = 3;
}
Symbol 1202 MovieClip [__Packages.com.reflexive.as2.ReflexiveAPI] Frame 0
class com.reflexive.as2.ReflexiveAPI extends MovieClip
{
static var obj;
var connected, useAPI, connectionString, conn, oldMouseX, oldMouseY;
function ReflexiveAPI () {
super();
connected = false;
useAPI = int(_root.useReflexiveAPI) == 1;
if (useAPI) {
connectionString = _root.connectionString;
conn = new LocalConnection();
conn.onStatus = mx.utils.Delegate.create(this, onStatus);
initConnection();
setInterval(mx.utils.Delegate.create(this, checkActivity), 5000);
setInterval(mx.utils.Delegate.create(this, submitScoreHelper), 1000);
}
}
static function getInstance() {
if (obj == null) {
obj = new com.reflexive.as2.ReflexiveAPI();
}
return(obj);
}
function initConnection() {
if (useAPI) {
if (!connected) {
conn.send(connectionString, "initToolbar");
_global.setTimeout(mx.utils.Delegate.create(this, initConnection), 500);
}
}
}
function onStatus(obj) {
switch (obj.level) {
case "status" :
connected = true;
break;
case "error" :
}
}
function checkActivity() {
if ((_root._xmouse != oldMouseX) || (_root._ymouse != oldMouseY)) {
oldMouseX = _root._xmouse;
oldMouseY = _root._ymouse;
setIsActive();
}
}
function setIsActive() {
if (useAPI) {
if (!connected) {
_global.setTimeout(mx.utils.Delegate.create(this, setIsActive), 500);
} else {
conn.send(connectionString, "setIsActive", null);
}
}
}
function submitScore(score) {
if (useAPI) {
lastScore = score;
}
}
function submitScoreHelper() {
if ((useAPI && (connected)) && (lastScore != null)) {
conn.send(connectionString, "submitScore", lastScore);
lastScore = null;
}
}
var lastScore = null;
}
Symbol 1203 MovieClip [__Packages.CATimer] Frame 0
class CATimer extends MovieClip
{
var intervalID, currentRotation, timeLeft, oldTime;
function CATimer () {
super();
mx.events.EventDispatcher.initialize(this);
intervalID = 0;
currentRotation = 0;
isPaused = true;
}
function dispatchEvent() {
}
function ResetTimer(time) {
MovieClip(this).TimerDialMC._rotation = 0.006 * time;
isPaused = false;
}
function StartTimer(allottedTime) {
timerExpired = false;
timeLeft = allottedTime;
isPaused = false;
MovieClip(this).TimerDialMC._rotation = 0.006 * allottedTime;
intervalID = setInterval(this, "RotateDial", TIMER_INTERVAL);
trace("Starting Timer" + intervalID);
var _local2 = new Date();
oldTime = _local2.getTime();
}
function StopTimer() {
timerExpired = true;
clearInterval(intervalID);
}
function PauseTimer() {
if (isPaused) {
return(undefined);
}
trace("Pausing this " + intervalID);
clearInterval(intervalID);
isPaused = true;
}
function ResumeTimer() {
if (timerExpired) {
return(undefined);
}
if (!isPaused) {
return(undefined);
}
var _local2 = new Date();
oldTime = _local2.getTime();
intervalID = setInterval(this, "RotateDial", TIMER_INTERVAL);
trace("Resuming this " + intervalID);
isPaused = false;
}
function RotateDial() {
var _local3 = MovieClip(this);
var _local2 = new Date();
timeLeft = timeLeft - (_local2.getTime() - oldTime);
if (timeLeft < 0) {
timeLeft = 0;
}
_local3.TimerDialMC._rotation = 0.006 * timeLeft;
_local3.TimerDialMC.cacheAsBitmap = true;
oldTime = _local2.getTime();
if (timeLeft <= 0) {
timerExpired = true;
clearInterval(intervalID);
dispatchEvent({type:EVENT_TIME_OUT, target:this});
}
}
static var EVENT_TIME_OUT = "eventTimeOut";
static var TIMER_INTERVAL = 100;
var timerExpired = true;
var isPaused = false;
}
Symbol 1204 MovieClip [__Packages.ArrowBlue] Frame 0
class ArrowBlue extends MovieClip
{
var tailMC, attachMovie, getNextHighestDepth, bodyMC, headMC, _rotation, _x, _width, _y, _height;
function ArrowBlue () {
super();
trace("ArrowBlue");
}
function Init(arrowLength, createTail, arrowRotation) {
trace("ArrowBlue: Init: " + this);
if (createTail) {
tailMC = attachMovie("ArrowBlueTail", "TailMC", getNextHighestDepth(), {_x:0, _y:0});
} else {
tailMC = attachMovie("ArrowBlueHeadLeft", "TailMC", getNextHighestDepth(), {_x:0, _y:0});
}
bodyMC = attachMovie("ArrowBlueBody", "BodyMC", getNextHighestDepth(), {_x:tailMC._width, _y:0});
headMC = attachMovie("ArrowBlueHeadRight", "HeadMC", getNextHighestDepth(), {_x:bodyMC._x + bodyMC._width, _y:0});
var _local2 = arrowLength - (tailMC._width + headMC._width);
bodyMC._xscale = (_local2 / bodyMC._width) * 100;
headMC._x = bodyMC._x + bodyMC._width;
_rotation = arrowRotation;
}
function ResizeWidth(newWidth) {
_x = _x + ((newWidth - _width) / 2);
var _local2 = newWidth - (tailMC._width + headMC._width);
bodyMC._width = _local2;
headMC._x = bodyMC._x + bodyMC._width;
}
function ResizeHeight(arrowHeight) {
_y = _y + ((arrowHeight - _height) / 2);
var _local2 = arrowHeight - (tailMC._width + headMC._width);
bodyMC._width = _local2;
headMC._x = bodyMC._x + bodyMC._width;
}
}
Symbol 1205 MovieClip [__Packages.DoughRoll] Frame 0
class DoughRoll extends MovieClip
{
var firstTime, rollingPinDirection, isWidthLimitCross, isHeightLimitCross, thisMC, calloutMC, _parent;
function DoughRoll () {
super();
firstTime = true;
rollingPinDirection = ROLLING_PIN_NONE;
isWidthLimitCross = false;
isHeightLimitCross = false;
}
function Init() {
thisMC = this;
thisMC.OutlineMC._visible = false;
thisMC.RollingPinMC._visible = false;
thisMC.ArrowCrossMC._visible = false;
thisMC.ArrowVerticalMC._visible = false;
thisMC.ArrowHorizontalMC._visible = false;
thisMC.onEnterFrame = OnEnterFrameHandler;
thisMC.EmptyMC.onPress = EmptyMCOnPressHandler;
thisMC.EmptyMC.onRelease = EmptyMCOnReleaseHandler;
thisMC.EmptyMC.onReleaseOutside = OnReleaseOutsideHandler;
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
}
function OnEnterFrameHandler() {
thisMC.DoughMC._x = thisMC.DoughMC._x - DOUGH_X_MOVEMENT;
if (thisMC.DoughMC._x <= DOUGH_INIT_X_POSITION) {
thisMC.onEnterFrame = undefined;
thisMC.ArrowHorizontalMC.Init(100, false, 180);
thisMC.ArrowHorizontalMC._x = ARROW_HORIZONTAL_X_POSITION;
thisMC.ArrowHorizontalMC._y = ARROW_HORIZONTAL_Y_POSITION;
thisMC.ArrowVerticalMC.Init(140, false, 270);
thisMC.ArrowVerticalMC._x = ARROW_VERTICAL_X_POSITION;
thisMC.ArrowVerticalMC._y = ARROW_VERTICAL_Y_POSITION;
thisMC.DoughMC._x = DOUGH_INIT_X_POSITION;
if (firstTime) {
_root.ShowGoMC(GoMCCompleteHandler);
firstTime = false;
}
}
}
function OnReleaseOutsideHandler() {
var _local2 = new MovieClip();
_local2 = MovieClip(_parent);
trace("NewMC->>" + _local2);
_parent.ReleaseOutSide(_local2);
}
function ReleaseOutSide(newMC) {
trace("ReleaseOutSide");
newMC.RollingPinMC._visible = false;
newMC.RollingPinMC._rotation = -1;
newMC.onMouseMove = undefined;
newMC.boolTop = false;
newMC.boolBot = false;
newMC.boolLeft = false;
newMC.boolRight = false;
newMC.isMouseDown = false;
IsDoughReady();
if (newMC.isDoughPrepared == false) {
if (newMC.isHeightWidthLimitCross == false) {
newMC.ArrowCrossMC._visible = true;
newMC.ArrowVerticalMC._visible = false;
newMC.ArrowHorizontalMC._visible = false;
}
if (newMC.isWidthLimitCross == true) {
newMC.ArrowCrossMC._visible = false;
newMC.ArrowVerticalMC._visible = true;
} else if (newMC.isHeightLimitCross == true) {
newMC.ArrowCrossMC._visible = false;
newMC.ArrowHorizontalMC._visible = true;
}
} else {
newMC.ArrowCrossMC._visible = false;
newMC.ArrowVerticalMC._visible = false;
newMC.ArrowHorizontalMC._visible = false;
}
newMC.prevX = 0;
newMC.prevY = 0;
}
function GoMCCompleteHandler() {
_root.minigameMC.GoMCCompleteHandlerDough();
}
function GoMCCompleteHandlerDough() {
thisMC.ArrowCrossMC._visible = true;
thisMC.OutlineMC._visible = true;
intervalID = setInterval(this, "ShowOutline", SHOW_OUTLINE_INTERVAL_TIME);
}
function EmptyMCOnPressHandler() {
_parent.OnPressHandler();
}
function EmptyMCOnReleaseHandler() {
_parent.OnReleaseHandler();
}
function OnPressHandler() {
if (isDoughPrepared == false) {
prevX = _root._xmouse;
prevY = _root._ymouse;
isMouseDown = true;
rollingPinDirection = ROLLING_PIN_NONE;
thisMC.RollingPinMC._rotation = -1;
thisMC.onMouseMove = OnMouseMoveHandler;
}
}
function OnReleaseHandler() {
trace("OnReleaseHandler->" + this);
ReleaseOutSide(thisMC);
}
function OnMouseMoveHandler() {
var _local4 = 0;
var _local3 = 0;
if (isMouseDown == true) {
if (isHeightWidthLimitCross == true) {
clearInterval(intervalID);
thisMC.RollingPinMC._visible = false;
thisMC.ArrowHorizontalMC._visible = false;
thisMC.ArrowVerticalMC._visible = false;
thisMC.OutlineMC._visible = false;
thisMC.onMouseMove = undefined;
thisMC.onPress = undefined;
thisMC.onRelease = undefined;
mProgress = 0;
_root.ShowFinishedMC();
return(undefined);
}
if (rollingPinDirection == ROLLING_PIN_NONE) {
_local4 = _root._xmouse - prevX;
_local3 = _root._ymouse - prevY;
if (_local3 < 0) {
_local3 = _local3 * -1;
}
if (_local4 < 0) {
_local4 = _local4 * -1;
}
if ((_local4 >= X_Y_DIFFRENCE) || (_local3 == 0)) {
rollingPinDirection = ROLLING_PIN_VERTICAL;
} else if ((_local3 >= X_Y_DIFFRENCE) || (_local4 == 0)) {
rollingPinDirection = ROLLING_PIN_HORIZONTAL;
}
prevX = _root._xmouse;
prevY = _root._ymouse;
}
if (rollingPinDirection == ROLLING_PIN_HORIZONTAL) {
thisMC.ArrowCrossMC._visible = false;
thisMC.ArrowVerticalMC._visible = false;
thisMC.RollingPinMC._visible = true;
if (thisMC.RollingPinMC._rotation == -1) {
thisMC.RollingPinMC._rotation = 0;
}
thisMC.RollingPinMC._x = ROLLINGPIN_INIT_X_POS;
thisMC.MoveTheRollingPinMCVertically();
} else if (rollingPinDirection == ROLLING_PIN_VERTICAL) {
thisMC.ArrowCrossMC._visible = false;
thisMC.ArrowVerticalMC._visible = false;
thisMC.RollingPinMC._visible = true;
if (thisMC.RollingPinMC._rotation == -1) {
thisMC.RollingPinMC._rotation = 90;
}
thisMC.RollingPinMC._y = ROLLINGPIN_INIT_Y_POS;
thisMC.MoveTheRollingPinMCHorizontally();
}
updateAfterEvent();
}
}
function MoveTheRollingPinMCVertically() {
if ((thisMC.OutlineMC._height - thisMC.DoughMC._height) > 0) {
thisMC.ArrowVerticalMC._visible = true;
} else {
thisMC.ArrowVerticalMC._visible = false;
}
if (thisMC.RollingPinMC._rotation == 0) {
thisMC.RollingPinMC._y = _root._ymouse;
if (thisMC.RollingPinMC._y <= (thisMC.DoughMC._y + ((-thisMC.DoughMC._height) / 2))) {
boolTop = true;
} else if (thisMC.RollingPinMC._y >= (thisMC.DoughMC._y + (thisMC.DoughMC._height / 2))) {
boolBot = true;
}
if (thisMC.RollingPinMC._y <= MIN_Y_POS) {
thisMC.RollingPinMC._y = MIN_Y_POS;
} else if (thisMC.RollingPinMC._y >= MAX_Y_POS) {
thisMC.RollingPinMC._y = MAX_Y_POS;
}
if ((boolTop == true) && (boolBot == true)) {
if ((thisMC.OutlineMC._height - thisMC.DoughMC._height) < DOUGH_MAX_WIDTH_HEIGHT_VARIANCE) {
trace("Max Height Crossed-Finished");
thisMC.RollingPinMC._visible = false;
isHeightWidthLimitCross = true;
return(undefined);
}
thisMC.DoughMC._height = thisMC.DoughMC._height + INCREASING_HEIGHT;
thisMC.DoughMC._width = thisMC.DoughMC._width;
boolTop = false;
boolBot = false;
_root.PlaySound(_root.SND_ROLLINGDOUGH, false, false);
}
}
}
function MoveTheRollingPinMCHorizontally() {
if ((thisMC.OutlineMC._width - thisMC.DoughMC._width) > 0) {
thisMC.ArrowHorizontalMC.ResizeWidth(thisMC.DoughMC._width);
thisMC.ArrowHorizontalMC._visible = true;
} else {
thisMC.ArrowHorizontalMC._visible = false;
}
if (thisMC.RollingPinMC._rotation == 90) {
thisMC.RollingPinMC._x = _root._xmouse;
if (thisMC.RollingPinMC._x <= (thisMC.DoughMC._x + ((-thisMC.DoughMC._width) / 2))) {
thisMC.RollingPinMC._x = thisMC.DoughMC._x + ((-thisMC.DoughMC._width) / 2);
boolLeft = true;
} else if (thisMC.RollingPinMC._x >= (thisMC.DoughMC._x + (thisMC.DoughMC._width / 2))) {
thisMC.RollingPinMC._x = thisMC.DoughMC._x + (thisMC.DoughMC._width / 2);
boolRight = true;
}
if ((boolLeft == true) && (boolRight == true)) {
if ((thisMC.OutlineMC._width - thisMC.DoughMC._width) < DOUGH_MAX_WIDTH_HEIGHT_VARIANCE) {
trace("Max Width Crossed-Finished");
thisMC.RollingPinMC._visible = false;
isHeightWidthLimitCross = true;
return(undefined);
}
thisMC.DoughMC._width = thisMC.DoughMC._width + INCREASING_WIDTH;
thisMC.DoughMC._height = thisMC.DoughMC._height;
boolLeft = false;
boolRight = false;
_root.PlaySound(_root.SND_ROLLINGDOUGH, false, false);
}
}
}
function IsDoughReady() {
var _local2 = Math.round(thisMC.OutlineMC._height - thisMC.DoughMC._height);
var _local3 = Math.round(thisMC.OutlineMC._width - thisMC.DoughMC._width);
trace("Height Diffrence " + _local2);
trace("Width Diffrence " + _local3);
if (_local2 <= 0) {
isHeightLimitCross = true;
}
if (_local3 <= 0) {
isWidthLimitCross = true;
}
if ((((_local2 <= 0) && (_local2 >= -4)) && (_local3 <= 0)) && (_local3 >= -4)) {
trace("100 Score will be set bonus points will be given on how much time is elapsed.");
mProgress = 100;
thisMC.FinalizeTheDoughRoll();
} else if ((((_local2 >= (DOUGH_MAX_WIDTH_HEIGHT_VARIANCE / 2)) && (_local2 < -4)) && (_local3 <= 0)) && (_local3 >= -4)) {
trace("Width ok, 50 Score will be set bonus points will be given on how much time is elapsed.");
mProgress = 76;
thisMC.FinalizeTheDoughRoll();
} else if ((((_local2 <= 0) && (_local2 >= -4)) && (_local3 >= (DOUGH_MAX_WIDTH_HEIGHT_VARIANCE / 2))) && (_local3 < -4)) {
trace("Height ok,50 Score will be set bonus points will be given on how much time is elapsed.");
mProgress = 76;
thisMC.FinalizeTheDoughRoll();
} else if ((((_local2 >= (DOUGH_MAX_WIDTH_HEIGHT_VARIANCE / 2)) && (_local2 < -4)) && (_local3 >= (DOUGH_MAX_WIDTH_HEIGHT_VARIANCE / 2))) && (_local3 < -4)) {
trace("Height & width are both out of boudry but ok,50 Score will be set bonus points will be given on how much time is elapsed.");
mProgress = 76;
thisMC.FinalizeTheDoughRoll();
} else if ((_local2 < (DOUGH_MAX_WIDTH_HEIGHT_VARIANCE / 2)) or (_local3 < (DOUGH_MAX_WIDTH_HEIGHT_VARIANCE / 2))) {
mProgress = 0;
thisMC.FinalizeTheDoughRoll();
} else if ((_local2 > 0) || (_local3 > 0)) {
trace("Unfinalize");
}
}
function FinalizeTheDoughRoll() {
trace("Finalize");
isDoughPrepared = true;
clearInterval(intervalID);
thisMC.OutlineMC._visible = false;
thisMC.ArrowCrossMC._visible = false;
thisMC.ArrowHorizontalMC._visible = false;
thisMC.ArrowVerticalMC._visible = false;
_root.ShowFinishedMC();
}
function ShowOutline() {
thisMC.OutlineMC._visible = !thisMC.OutlineMC._visible;
}
var mProgress = 0;
static var ROLLINGPIN_INIT_X_POS = 250;
static var ROLLINGPIN_INIT_Y_POS = 235;
static var MIN_Y_POS = 180;
static var MAX_Y_POS = 285;
static var X_Y_OFFSET = 5;
static var X_Y_DIFFRENCE = 100;
static var INCREASING_WIDTH = 8;
static var INCREASING_HEIGHT = 4;
static var DOUGH_X_MOVEMENT = 20;
static var DOUGH_INIT_X_POSITION = 250;
static var DOUGH_MAX_WIDTH_HEIGHT_VARIANCE = -30;
static var ARROW_VERTICAL_X_POSITION = 240;
static var ARROW_VERTICAL_Y_POSITION = 305;
static var ARROW_HORIZONTAL_X_POSITION = 297;
static var ARROW_HORIZONTAL_Y_POSITION = 242;
static var SHOW_OUTLINE_INTERVAL_TIME = 500;
static var ROLLING_PIN_NONE = 0;
static var ROLLING_PIN_HORIZONTAL = 1;
static var ROLLING_PIN_VERTICAL = 2;
var prevX = 0;
var prevY = 0;
var boolTop = false;
var boolBot = false;
var boolLeft = false;
var boolRight = false;
var isDoughPrepared = false;
var isHeightWidthLimitCross = false;
var isMouseDown = false;
var intervalID = 0;
}
Symbol 1206 MovieClip [__Packages.CASlider] Frame 0
class CASlider extends MovieClip
{
var minValue, maxValue, functionToCallOnChange, isMouseDown, _parent, _width, _x;
function CASlider () {
super();
}
function Init(newMinValue, newMaxValue, newFunctionToCallOnChange) {
var _local2 = this;
minValue = newMinValue;
maxValue = newMaxValue;
functionToCallOnChange = newFunctionToCallOnChange;
_local2.SliderThumbMC.onMouseMove = SliderThumbOnMouseMoveHandler;
_local2.SliderThumbMC.onPress = SliderThumbOnPressHandler;
_local2.SliderThumbMC.onRelease = SliderThumbOnReleaseHandler;
_local2.SliderThumbMC.onReleaseOutside = SliderThumbOnReleaseHandler;
_local2.SliderThumbMC.onRollOver = SliderThumbOnRollOverHandler;
_local2.SliderThumbMC.onRollOut = SliderThumbOnRollOutHandler;
isMouseDown = false;
}
function SliderThumbOnMouseMoveHandler() {
if (!_parent.isMouseDown) {
return(undefined);
}
if ((_parent._xmouse < 0) || (_parent._xmouse >= (_parent._width - _width))) {
return(undefined);
}
_x = _parent._xmouse;
var _local2 = _parent._width - _width;
_parent.sliderValue = Math.round((_x / _local2) * 100);
trace((((((("This.x -> " + this) + ",") + _x) + ",") + _local2) + ",") + _parent.sliderValue);
if (_parent.functionToCallOnChange != undefined) {
_parent.functionToCallOnChange();
}
updateAfterEvent();
}
function SliderThumbOnPressHandler() {
_parent.isMouseDown = true;
}
function SliderThumbOnReleaseHandler() {
_parent.isMouseDown = false;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
_root.PlaySound(_root.SND_BUTTON, false, false);
}
function SliderThumbOnRollOverHandler() {
trace("CASlider: changing mouse to dragging.");
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_DRAGGING);
}
function SliderThumbOnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
var sliderValue = 0;
}
Symbol 1207 MovieClip [__Packages.CACheckBox] Frame 0
class CACheckBox extends MovieClip
{
var onPress, onRollOver, onRollOut, gotoAndStop;
function CACheckBox () {
super();
onPress = OnPressHandler;
onRollOver = OnRollOver;
onRollOut = OnRollOut;
}
function get isChecked() {
return(__isChecked);
}
function set isChecked(newStatus) {
__isChecked = newStatus;
OnRollOut();
//return(isChecked);
}
function OnPressHandler() {
__isChecked = !__isChecked;
if (__isChecked) {
gotoAndStop("CheckboxCheckedOver");
} else {
gotoAndStop("CheckboxUncheckedOver");
}
_root.PlaySound(_root.SND_BUTTON, false, false);
}
function OnRollOver() {
if (__isChecked) {
gotoAndStop("CheckboxCheckedOver");
} else {
gotoAndStop("CheckboxUncheckedOver");
}
_root.PlaySound(_root.SND_HIGHLIGHT, false, false);
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
function OnRollOut() {
if (__isChecked) {
gotoAndStop("CheckboxCheckedUp");
} else {
gotoAndStop("CheckboxUncheckedUp");
}
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
var __isChecked = false;
}
Symbol 1208 MovieClip [__Packages.FinishScreen] Frame 0
class FinishScreen extends MovieClip
{
var scoreMCArray, scoreContainerMC, createEmptyMovieClip, getNextHighestDepth, CalloutMC, attachMovie, recipeNameTextMC, _parent;
function FinishScreen () {
super();
mx.events.EventDispatcher.initialize(this);
}
function dispatchEvent() {
}
function Init(newRecipeName, newRecipeMCName, recipeMCXPos, recipeMCYPos, newScore, newMaxScore) {
recipeName = newRecipeName;
score = newScore;
maxScore = newMaxScore;
scoreMCArray = new Array();
SetRecipeNameAndMC(recipeName, newRecipeMCName, recipeMCXPos, recipeMCYPos);
scoreContainerMC = createEmptyMovieClip("ScoreContainerMC", getNextHighestDepth());
SetMaxScore(maxScore);
scoreContainerMC._x = SCORE_CONTAINER_MC_X;
scoreContainerMC._y = SCORE_CONTAINER_MC_Y;
scoreContainerMC.onEnterFrame = ScoreContainerOnEnterFrameHandler;
CalloutMC = attachMovie("Callout", "CalloutMC", getNextHighestDepth(), {_x:CALLOUT_CHEF_XPOS, _y:CALLOUT_CHEF_YPOS});
CalloutMC._visible = false;
SetGrade();
var _local3 = this;
_local3.ContinueBtn.onRollOver = _root.MouseHandOnRollOverHandler;
_local3.OptionBtn.onRollOver = _root.MouseHandOnRollOverHandler;
_local3.ContinueBtn.onRollOut = _root.MouseHandOnRollOutHandler;
_local3.OptionBtn.onRollOut = _root.MouseHandOnRollOutHandler;
_local3.ContinueBtn.onPress = ContinueBtnHandler;
_local3.OptionBtn.onPress = OptionBtnHandler;
_root.PlaySound(_root.SND_DRUMROLL, false, true, true);
}
function SetRecipeNameAndMC(recipeName, recipeMCName, recipeMCXPos, recipeMCYPos) {
var _local2;
var _local4 = (score / maxScore) * 100;
if (_local4 < 70) {
_local2 = attachMovie("StomachMedicine", "StomachMedicineMC", getNextHighestDepth(), {_x:212, _y:114});
} else {
_local2 = attachMovie(recipeMCName, recipeMCName + "MC", getNextHighestDepth(), {_x:recipeMCXPos, _y:recipeMCYPos});
}
trace((("FinishScreen: SetRecipeNameAndMC: recipeMCName = " + recipeMCName) + ", ") + _local2);
MovieClip(this).CoverMC.swapDepths(getNextHighestDepth());
recipeNameTextMC = attachMovie("Callout", "ContainerText", getNextHighestDepth(), {_x:0, _y:0});
recipeNameTextMC._visible = false;
recipeNameTextMC.Init(recipeName, 150, Callout.CALLOUT_SMALL);
recipeNameTextMC._x = (Stage.width - recipeNameTextMC._width) / 2;
recipeNameTextMC._y = 310;
}
function SetMaxScore(maxScore) {
var _local6 = maxScore.toString();
var _local9 = 29;
var _local5 = 40;
var _local3 = 0;
var _local4 = "";
scoreContainerMC.attachMovie("Slash", "SlashMC", scoreContainerMC.getNextHighestDepth(), {_x:_local9, _y:0});
var _local2 = 0;
while (_local2 < _local6.length) {
_local4 = _local6.charAt(_local2);
_local3 = int(_local4);
scoreContainerMC.attachMovie("Num" + _local3, "NumMC" + _local3, scoreContainerMC.getNextHighestDepth(), {_x:_local5, _y:0});
_local5 = _local5 + GAP_BETWEEN_SCORE_NUMBERS;
_local2++;
}
scoreContainerMC._width = scoreContainerMC._width * 1.8;
scoreContainerMC._height = scoreContainerMC._height * 1.8;
}
function SetGrade() {
var _local4 = this;
var _local3 = GetGrade(score, maxScore);
if ((_root.recipeInfo[_root.selectedRecipeName][0].totalScore == -1) or (_root.recipeInfo[_root.selectedRecipeName][0].totalScore < score)) {
_root.recipeInfo[_root.selectedRecipeName][0].gradeStr = _local3;
_root.recipeInfo[_root.selectedRecipeName][0].totalScore = score;
}
_root.totalScoreForAllRecipes = _root.GetTotalScoreForAllRecipes();
trace((((((("FinalScreen: SetGrade: recipeInfo " + _root.recipeInfo[_root.selectedRecipeName][0].totalScore) + ", ") + maxScore) + ", ") + _root.recipeInfo[_root.selectedRecipeName][0].gradeStr) + ", ") + _root.selectedRecipeName);
trace((((((("FinalScreen: SetGrade: " + score) + ", ") + maxScore) + ", ") + _local3) + ", ") + _root.recipeInfo[_root.selectedRecipeName][0]);
_local4.GradeMC.GradeTweenMC.gotoAndStop(_local3);
if (((_local3 == "A+") || (_local3 == "A")) || (_local3 == "A-")) {
_local4.BetterPotMC.gotoAndStop("FrameChefHappy");
_local4.CalloutMC.Init(_root.FINALSCREEN_CALLOUT_TEXT_HAPPY, CALLOUT_CHEF_WIDTH_HAPPY, Callout.CALLOUT_CHEF);
} else if (((_local3 == "B+") || (_local3 == "B")) || (_local3 == "B-")) {
_local4.BetterPotMC.gotoAndStop("FrameChefNatural");
_local4.CalloutMC.Init(_root.FINALSCREEN_CALLOUT_TEXT_NEUTRAL, CALLOUT_CHEF_WIDTH_NEUTRAL, Callout.CALLOUT_CHEF);
} else if (((_local3 == "C+") || (_local3 == "C")) || (_local3 == "C-")) {
_local4.BetterPotMC.gotoAndStop("FrameChefNatural");
_local4.CalloutMC.Init(_root.FINALSCREEN_CALLOUT_TEXT_NEUTRAL, CALLOUT_CHEF_WIDTH_NEUTRAL, Callout.CALLOUT_CHEF);
} else if (_local3 == "D") {
_local4.BetterPotMC.gotoAndStop("FrameChefUpset");
_local4.CalloutMC.Init(_root.FINALSCREEN_CALLOUT_TEXT_UPSET, CALLOUT_CHEF_WIDTH_UPSET, Callout.CALLOUT_CHEF);
}
}
function ScoreContainerOnEnterFrameHandler() {
if (_root.isGamePaused) {
return(undefined);
}
_parent.scoreTmp = _parent.scoreTmp + SCORE_ROLL_INCREMENT;
if (_parent.scoreTmp > _parent.score) {
var _local8;
_local8 = _parent.scoreTmp - _parent.score;
_parent.scoreTmp = _parent.scoreTmp - _local8;
}
_parent.scoreStr = _parent.scoreTmp.toString();
var _local4 = 0;
var _local5 = "";
var _local3 = 0;
while (_local3 < _parent.scoreStr.length) {
var _local7 = new MovieClip();
_local5 = _parent.scoreStr.charAt(_local3);
_local4 = int(_local5);
if (_parent.scoreMCArray[_local3] != undefined) {
_parent.scoreMCArray[_local3].swapDepths(_parent.scoreContainerMC.getNextHighestDepth());
_parent.scoreMCArray[_local3].removeMovieClip();
}
_parent.scoreMCArray[_local3] = _parent.scoreContainerMC.attachMovie("Num" + _local4, "NumMC" + _local4, _parent.scoreContainerMC.getNextHighestDepth(), {_x:_parent.prevX, _y:0});
_parent.prevX = _parent.prevX + GAP_BETWEEN_SCORE_NUMBERS;
_local3++;
}
if (_local3 == _parent.scoreStr.length) {
_parent.prevX = 0;
}
if (_parent.scoreTmp >= _parent.score) {
_parent.scoreContainerMC.onEnterFrame = undefined;
_parent.scoreTextContainerMC = _parent.attachMovie("Callout", "ScoreTextContainerMC", _parent.getNextHighestDepth(), {_y:355});
_parent.scoreTextContainerMC.Init(" ", 200, Callout.CALLOUT_TINY);
_parent.scoreTextContainerMC._x = (Stage.width - _parent.scoreTextContainerMC._width) / 2;
_parent.scoreTextContainerMC.swapDepths(_parent.scoreContainerMC);
_parent.onEnterFrame = _parent.OnEnterFrameHandler;
}
}
function OnEnterFrameHandler() {
if (_root.isGamePaused) {
return(undefined);
}
var _local3 = this;
scoreContainerMC._x = scoreContainerMC._x + SCORE_X_INCREMENT;
scoreContainerMC._y = scoreContainerMC._y + SCORE_Y_INCREMENT;
scoreContainerMC._xscale = scoreContainerMC._xscale - SCORE_XSCALE_DECREMENT;
scoreContainerMC._yscale = scoreContainerMC._yscale - SCORE_YSCALE_DECREMENT;
if (scoreContainerMC._y >= _local3.scoreTextContainerMC._y) {
scoreContainerMC._y = scoreContainerMC._y - 4.5;
_local3.onEnterFrame = undefined;
recipeNameTextMC._visible = true;
var _local4 = new mx.transitions.Tween(_local3.CoverMC, "_y", mx.transitions.easing.None.easeNone, _local3.CoverMC._y, -354, 12, false);
var _local5 = mx.utils.Delegate.create(this, CoverTweenFinishHandler);
_local4.onMotionFinished = _local5;
}
}
function CoverTweenFinishHandler() {
CalloutMC._visible = true;
_root.StopSound();
_root.PlaySound(_root.SND_CYMBAL, false, false, true);
MovieClip(this).GradeMC.gotoAndPlay(1);
}
function ContinueBtnHandler() {
_root.PlaySound(_root.SND_BUTTON, false, false, true);
_root.gotoAndStop(_root.FRAME_RECIPE_BOOK);
var _local3 = true;
_local3 = _root.recipeInfo[_root.RECIPE_NAME_GYOZA][0].totalScore != -1;
_local3 = _local3 & (_root.recipeInfo[_root.RECIPE_NAME_BRUSCHETTA][0].totalScore != -1);
_local3 = _local3 & (_root.recipeInfo[_root.RECIPE_NAME_GUACAMOLE][0].totalScore != -1);
_local3 = _local3 & (_root.recipeInfo[_root.RECIPE_NAME_SPINACH_TRIANGLES][0].totalScore != -1);
_local3 = _local3 & (_root.recipeInfo[_root.RECIPE_NAME_EGG_ROLLS][0].totalScore != -1);
_root.currentLevel = _root.GetCurrentLevel();
if (_root.REAL_API_ENABLED) {
trace((_root.currentLevel + " ") + _root.numTrialLevels);
if ((_root.currentLevel >= _root.numTrialLevels) or _local3) {
_root.ShowUpsellScreen(_root.UPSELL_WEBGAME_COMPLETED_STRING);
} else if ((_root.showAds != false) and (_root.currentLevels >= _root.numAdLevels)) {
_root.ShowUpsellScreen();
}
} else if (_local3) {
_root.ShowUpsellScreen(_root.UPSELL_WEBGAME_COMPLETED_STRING);
} else {
_root.ShowUpsellScreen();
}
_root.MouseHandOnRollOutHandler();
_root.SubmitTotalScoreToPublishersAPI(_root.totalScoreForAllRecipes);
_root.RemoveMovieClip(_parent.emptyMC);
_parent.swapDepths(_parent.getNextHighestDepth());
_parent.removeMovieClip();
}
function OptionBtnHandler() {
_root.PlaySound(_root.SND_BUTTON, false, false, true);
_root.CreateOptionsBox(false);
_root.MouseHandOnRollOutHandler();
}
function GetGrade(totalScore, maxScore) {
var _local2 = Math.round((totalScore / maxScore) * 100);
trace("FinishScreen: GetGrade: scorePercent = " + _local2);
if (_local2 >= 100) {
return("A+");
}
if (_root.IsNumBetween(_local2, 93, 99)) {
return("A");
}
if (_root.IsNumBetween(_local2, 90, 92)) {
return("A-");
}
if (_root.IsNumBetween(_local2, 87, 89)) {
return("B+");
}
if (_root.IsNumBetween(_local2, 83, 86)) {
return("B");
}
if (_root.IsNumBetween(_local2, 80, 82)) {
return("B-");
}
if (_root.IsNumBetween(_local2, 77, 79)) {
return("C+");
}
if (_root.IsNumBetween(_local2, 73, 76)) {
return("C");
}
if (_root.IsNumBetween(_local2, 70, 72)) {
return("C-");
}
if (_local2 < 70) {
return("D");
}
trace("FinishScreen: GetGrade: In else condition");
}
static var GAP_BETWEEN_SCORE_NUMBERS = 10;
static var SCORE_ROLL_INCREMENT = 21;
static var SCORE_X_INCREMENT = 0.9;
static var SCORE_Y_INCREMENT = 10;
static var SCORE_XSCALE_DECREMENT = 3.5;
static var SCORE_YSCALE_DECREMENT = 3.5;
static var SCORE_CONTAINER_MC_X = 202;
static var SCORE_CONTAINER_MC_Y = 150;
static var CALLOUT_CHEF_XPOS = 80;
static var CALLOUT_CHEF_YPOS = 20;
static var CALLOUT_CHEF_WIDTH_HAPPY = 230;
static var CALLOUT_CHEF_WIDTH_NEUTRAL = 230;
static var CALLOUT_CHEF_WIDTH_UPSET = 230;
static var CALLOUT_CHEF_FONT_SIZE = 16;
var score = 0;
var scoreStr = "";
var scoreTmp = 0;
var maxScore = 0;
var prevX = 0;
var recipeName = "";
}
Symbol 1209 MovieClip [__Packages.KneadMeat] Frame 0
class KneadMeat extends MovieClip
{
var selectedRecipeName, guacamoleFoodAfterMCAlpha, stepsArray, maxSteps, numSteps, attachMovie, getNextHighestDepth, _parent, calloutMC;
function KneadMeat () {
super();
mx.events.EventDispatcher.initialize(this);
}
function dispatchEvent() {
}
function Init(newStepsArray, newMaxSteps, newSelectedRecipeName) {
selectedRecipeName = newSelectedRecipeName;
guacamoleFoodAfterMCAlpha = 0;
stepsArray = newStepsArray.concat();
if (newMaxSteps != undefined) {
maxSteps = newMaxSteps;
}
numSteps = 0;
var _local8 = this;
var _local3 = 0;
while (_local3 < stepsArray.length) {
stepsArray[_local3].stepMC = attachMovie(stepsArray[_local3].movieName, stepsArray[_local3].movieName + "MC", getNextHighestDepth(), {_visible:false, _x:stepsArray[_local3].xPos, _y:stepsArray[_local3].yPos});
stepsArray[_local3].stepMC.addEventListener(stepsArray[_local3].eventName, StepMCEventHandler);
stepsArray[_local3].stepMC.PathMC._visible = false;
stepsArray[_local3].stepMC.FoodAllMC.Food1MC._visible = false;
stepsArray[_local3].stepMC.FoodAllMC.Food1ReverseMC._visible = false;
stepsArray[_local3].stepMC.FoodAllMC.Food2MC._visible = false;
stepsArray[_local3].stepMC.FoodAllMC.Food2ReverseMC._visible = false;
_local3++;
}
prevStepIndex = _parent.RandRange(0, _parent.stepsArray.length - 1);
stepsArray[prevStepIndex].stepMC._visible = true;
stepsArray[prevStepIndex].stepMC.PathMC._visible = false;
_root.ShowGoMC(GoMCCompleteHandler, stepsArray[prevStepIndex].stepMC.PathMC);
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
ShowFoodMC(prevStepIndex);
}
function ShowFoodMC(stepIndex) {
if (_root.selectedRecipeName != _root.RECIPE_NAME_GUACAMOLE) {
return(undefined);
}
if (selectedFoodMC != undefined) {
selectedFoodMC._visible = false;
}
switch (stepsArray[stepIndex].movieName) {
case "GuacamoleStirStep1" :
trace((("KneadMeat: ShowFoodMC: selectedFoodMC = " + selectedFoodMC) + ", ") + stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC);
if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food1ReverseMC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC;
} else if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC;
} else {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food1ReverseMC;
}
break;
case "GuacamoleStirStep2" :
trace((("KneadMeat: ShowFoodMC: selectedFoodMC = " + selectedFoodMC) + ", ") + stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC);
if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC;
} else if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC;
} else {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC;
}
break;
case "GuacamoleStirStep3" :
trace((("KneadMeat: ShowFoodMC: selectedFoodMC = " + selectedFoodMC) + ", ") + stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC);
if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC;
} else if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC;
} else {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC;
}
break;
case "GuacamoleStirStep4" :
trace((("KneadMeat: ShowFoodMC: selectedFoodMC = " + selectedFoodMC) + ", ") + stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC);
if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food1ReverseMC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC;
} else if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC;
} else {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food1ReverseMC;
}
break;
case "GuacamoleStirStep5" :
trace((("KneadMeat: ShowFoodMC: selectedFoodMC = " + selectedFoodMC) + ", ") + stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC);
if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC;
} else if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC;
} else {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC;
}
break;
case "GuacamoleStirStep6" :
trace((("KneadMeat: ShowFoodMC: selectedFoodMC = " + selectedFoodMC) + ", ") + stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC);
if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food1ReverseMC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC;
} else if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC;
} else {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food1ReverseMC;
}
break;
case "GuacamoleStirStep7" :
trace((("KneadMeat: ShowFoodMC: selectedFoodMC = " + selectedFoodMC) + ", ") + stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC);
if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food1ReverseMC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC;
} else if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC;
} else {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food1ReverseMC;
}
break;
case "GuacamoleStirStep8" :
trace((("KneadMeat: ShowFoodMC: selectedFoodMC = " + selectedFoodMC) + ", ") + stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC);
if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC;
} else if (selectedFoodMC._name == stepsArray[stepIndex].stepMC.FoodAllMC.Food2ReverseMC._name) {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food2MC;
} else {
selectedFoodMC = stepsArray[stepIndex].stepMC.FoodAllMC.Food1MC;
}
}
selectedFoodMC._visible = true;
}
function CreateStepMC(i) {
stepsArray[i].stepMC = attachMovie(stepsArray[i].movieName, stepsArray[i].movieName + "MC", getNextHighestDepth(), {_visible:false, _x:stepsArray[i].xPos, _y:stepsArray[i].yPos});
stepsArray[i].stepMC.addEventListener(stepsArray[i].eventName, StepMCEventHandler);
}
function GoMCCompleteHandler(stepPathMC) {
stepPathMC._visible = true;
stepPathMC.CreateRedCursor();
}
function StepMCEventHandler() {
_parent.UpdateProgress();
if (_parent.numSteps < _parent.maxSteps) {
var _local4 = _parent.RandRange(0, _parent.stepsArray.length - 1);
if (_parent.selectedRecipeName == _root.RECIPE_NAME_GUACAMOLE) {
if ((((_parent.prevStepIndex == 2) || (_parent.prevStepIndex == 3)) || (_parent.prevStepIndex == 4)) || (_parent.prevStepIndex == 5)) {
_local4 = _parent.RandRange(4, _parent.stepsArray.length - 1);
} else if ((((_parent.prevStepIndex == 6) || (_parent.prevStepIndex == 7)) || (_parent.prevStepIndex == 0)) || (_parent.prevStepIndex == 1)) {
_local4 = _parent.RandRange(0, (_parent.stepsArray.length / 2) - 1);
}
} else {
_parent.prevStepIndex = undefined;
}
var _local3 = 0;
while (_local3 < _parent.stepsArray.length) {
_parent.stepsArray[_local3].stepMC._visible = _local3 == _local4;
if (_parent.stepsArray[_local3].stepMC._visible) {
_parent.ShowFoodMC(_local3);
_parent.stepsArray[_local3].stepMC.HandMC.gotoAndStop(1);
_parent.stepsArray[_local3].stepMC.PathMC._visible = true;
_parent.stepsArray[_local3].stepMC.PathMC.AddMouseEventListeners();
_parent.stepsArray[_local3].stepMC.PathMC.CreateRedCursor();
if (_parent.selectedRecipeName == _root.RECIPE_NAME_GUACAMOLE) {
_parent.guacamoleFoodAfterMCAlpha = _parent.guacamoleFoodAfterMCAlpha + ((1 / _parent.maxSteps) * 100);
_parent.selectedFoodMC.GuacamoleFoodMC.GuacamoleFoodAfterMC._alpha = _parent.guacamoleFoodAfterMCAlpha;
}
_parent.prevStepIndex = _local4;
} else {
_parent.stepsArray[_local3].stepMC.PathMC.RemoveMouseEventListeners();
_parent.stepsArray[_local3].stepMC.PathMC._visible = false;
}
_local3++;
}
}
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
numSteps++;
mProgress = (numSteps / maxSteps) * 100;
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
if (numSteps >= maxSteps) {
_root.ShowFinishedMC();
}
}
function TimeUpHandler() {
stepsArray[prevStepIndex].stepMC.PathMC.RemoveMovieClip();
}
function RandRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
var mProgress = 0;
var prevStepIndex = 0;
var selectedFoodMC = undefined;
}
Symbol 1210 MovieClip [__Packages.KnifeSide] Frame 0
class KnifeSide extends MovieClip
{
var numPixelsToMove, numPixelsMoved, onPress, onRelease, onMouseMove, onRollOver, onRollOut, isMouseDown, oldMouseX, _xmouse, oldMouseY, _ymouse, _x;
function KnifeSide () {
super();
mx.events.EventDispatcher.initialize(this);
}
function dispatchEvent() {
}
function Init(newNumPixelsToMove) {
trace("KnifeSide: Init");
numPixelsToMove = newNumPixelsToMove;
numPixelsMoved = 0;
onPress = OnPressHandler;
onRelease = OnReleaseHandler;
onMouseMove = OnMoveHandler;
onRollOver = OnRollOverHandler;
onRollOut = OnRollOutHandler;
}
function OnPressHandler() {
isMouseDown = true;
oldMouseX = _xmouse;
oldMouseY = _ymouse;
dispatchEvent({type:KNIFE_SIDE_ONPRESS, target:this});
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function OnReleaseHandler() {
isMouseDown = false;
}
function OnMoveHandler() {
if (!isMouseDown) {
return(undefined);
}
if ((oldMouseX - _xmouse) > 0) {
numPixelsMoved = numPixelsMoved + (oldMouseX - _xmouse);
_x = _x - (oldMouseX - _xmouse);
}
if (numPixelsMoved >= numPixelsToMove) {
dispatchEvent({type:KNIFE_SIDE_DONE_EVENT, target:this});
onMouseMove = undefined;
return(undefined);
}
oldMouseX = _xmouse;
oldMouseY = _ymouse;
}
function OnRollOverHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
function OnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
static var KNIFE_SIDE_ONPRESS = "eventKnifeSideOnPress";
static var KNIFE_SIDE_DONE_EVENT = "eventKnifeSideDone";
}
Symbol 1211 MovieClip [__Packages.Mash] Frame 0
class Mash extends MovieClip
{
var miniGamePaused, randomArray, mashTheFood, tweensObj, foodArray, mTotalSubSteps, mSubStepsCompleted, attachMovie, getNextHighestDepth, calloutMC, onEnterFrame, randomArrayIndex, selectedFoodIndex, selectedFoodMC, _parent, _x, _y, onPress, _xscale, _yscale, _height, _width, _visible, masherTweenState;
function Mash () {
super();
miniGamePaused = false;
mx.events.EventDispatcher.initialize(this);
randomArray = new Array();
mashTheFood = false;
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init(newFoodArray) {
var _local6 = this;
foodArray = newFoodArray;
mTotalSubSteps = foodArray.length;
mSubStepsCompleted = 0;
var _local3 = 0;
while (_local3 < foodArray.length) {
foodArray[_local3].foodMC = attachMovie(foodArray[_local3].foodName, (foodArray[_local3].foodName + "MC") + _local3, getNextHighestDepth(), {_x:foodArray[_local3].xPos, _y:foodArray[_local3].yPos});
foodArray[_local3].foodMC.onPress = FoodMCOnPressHandler;
randomArray[_local3] = _local3;
_local3++;
}
_local6.MasherShadowMC.swapDepths(getNextHighestDepth());
_root.ShuffleArray(randomArray);
_local6.MasherMC.swapDepths(getNextHighestDepth());
_local6.MasherMC.gotoAndPlay(2);
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
onEnterFrame = OnEnterFrameHandler;
_root.ShowGoMC();
}
function OnEnterFrameHandler() {
if (_root.isGamePaused) {
return(undefined);
}
var _local3 = this;
if (_local3.MasherMC._currentframe == _local3.MasherMC._totalframes) {
onEnterFrame = undefined;
HighlightFood();
}
}
function HighlightFood() {
var _local3 = this;
if (randomArray.length == 0) {
_root.ShowFinishedMC();
return(undefined);
}
randomArrayIndex = _root.RandRange(0, randomArray.length - 1);
selectedFoodIndex = randomArray[randomArrayIndex];
selectedFoodMC = foodArray[selectedFoodIndex].foodMC;
mashTheFood = false;
_local3.MasherShadowMC._xscale = 0.25;
_local3.MasherShadowMC._yscale = 0.25;
_local3.MasherShadowMC._alpha = 20;
_local3.MasherShadowMC._x = selectedFoodMC._x + (selectedFoodMC._width / 2);
_local3.MasherShadowMC._y = selectedFoodMC._y + (selectedFoodMC._height / 2);
_local3.MasherShadowMC.onEnterFrame = MasherShadowOnEnterFrameHandler;
_local3.MasherShadowMC._visible = true;
_local3.MasherMC._x = _local3.foodArray[_local3.selectedFoodIndex].foodMC._x;
_local3.MasherMC._y = -_local3.MasherMC._height;
_local3.MasherMC.destY = _local3.foodArray[_local3.selectedFoodIndex].foodMC._y - _local3.MasherMC._height;
}
function FoodMCOnPressHandler() {
var _local2 = _parent;
if (_local2.isFoodClicked) {
return(undefined);
}
_local2.isFoodClicked = true;
_local2.MasherShadowMC.onEnterFrame = undefined;
_local2.MasherMC._x = _x - 10;
_local2.MasherMC._y = -_local2.MasherMC._height;
var _local3 = _y - _local2.MasherMC._height;
if (this == _local2.selectedFoodMC) {
_local2.mashTheFood = true;
_local2.randomArray.splice(_local2.randomArrayIndex, 1);
trace("clicked on correct food. " + _local2.randomArray);
onPress = undefined;
_local3 = _local3 + 40;
}
_local2.masherTweenState = MASHER_TWEEN_STATE_NORMAL;
_local2.tweensObj.masherTween = new mx.transitions.Tween(_local2.MasherMC, "_y", mx.transitions.easing.None.easeNone, _local2.MasherMC._y, _local3, 14, false);
var _local4 = mx.utils.Delegate.create(_local2, _local2.MasherTweenFinishHandler);
_local2.tweensObj.masherTween.onMotionFinished = _local4;
}
function MasherShadowOnEnterFrameHandler() {
if (_root.isGamePaused) {
return(undefined);
}
var _local3 = _parent;
if (_local3.miniGamePaused) {
return(undefined);
}
_xscale = _xscale + 1;
_yscale = _yscale + 1;
_local3.MasherShadowMC._alpha = _local3.MasherShadowMC._alpha + 1;
trace((((("Masher shadow movie clip alpha " + _local3.MasherShadowMC._alpha) + ", ") + _width) + ", ") + _height);
if ((_width >= MASHER_SHADOW_MAX_WIDTH) && (_height >= MASHER_SHADOW_MAX_HEIGHT)) {
onEnterFrame = undefined;
trace("Will do masher tween");
_local3.masherTweenState = MASHER_TWEEN_STATE_NORMAL;
_local3.tweensObj.masherTween = new mx.transitions.Tween(_local3.MasherMC, "_y", mx.transitions.easing.None.easeNone, _local3.MasherMC._y, _local3.MasherMC.destY, 10, false);
var _local4 = mx.utils.Delegate.create(_local3, _local3.MasherTweenFinishHandler);
_local3.tweensObj.masherTween.onMotionFinished = _local4;
}
}
function MasherShadowOnEnterFrameReverseHandler() {
if (_root.isGamePaused) {
return(undefined);
}
_xscale = _xscale - 5;
_yscale = _yscale - 5;
if ((_width <= MASHER_SHADOW_MIN_WIDTH) && (_height <= MASHER_SHADOW_MIN_HEIGHT)) {
onEnterFrame = undefined;
_visible = false;
}
}
function MasherTweenFinishHandler() {
var _local3 = this;
trace("Mash: MasherTweenFinishHandler: " + masherTweenState);
if (masherTweenState == MASHER_TWEEN_STATE_NORMAL) {
if (mashTheFood) {
foodArray[selectedFoodIndex].foodMC.gotoAndStop(2);
UpdateProgress();
} else {
_root.PlaySound(_root.SND_INCORRECT, false, false);
_root.stepChefFaceMC.gotoAndPlay(2);
}
masherTweenState = MASHER_TWEEN_STATE_YOYO;
_local3.MasherShadowMC.onEnterFrame = MasherShadowOnEnterFrameReverseHandler;
tweensObj.masherTween.yoyo();
} else if (masherTweenState == MASHER_TWEEN_STATE_YOYO) {
isFoodClicked = false;
HighlightFood();
}
}
function UpdateProgress() {
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
_root.PlaySound(_root.SND_SQUISH, false, false);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
var mProgress = 0;
static var MASHER_SHADOW_MIN_WIDTH = 17.5;
static var MASHER_SHADOW_MIN_HEIGHT = 12.5;
static var MASHER_SHADOW_MAX_WIDTH = 70;
static var MASHER_SHADOW_MAX_HEIGHT = 50;
static var MASHER_TWEEN_STATE_NORMAL = 1;
static var MASHER_TWEEN_STATE_YOYO = 2;
var isFoodClicked = false;
}
Symbol 1212 MovieClip [__Packages.Bake] Frame 0
class Bake extends MovieClip
{
var miniGamePaused, selectedTempArray, foodArray, correctBakingTemp, attachMovie, getNextHighestDepth, defaultTempMC, calloutMC, _parent, _name, stepMarkerIncValue, onEnterFrame;
function Bake () {
super();
miniGamePaused = false;
mx.events.EventDispatcher.initialize(this);
var _local4 = this;
var _local3 = 0;
while (_local3 < 10) {
_local4["NumBtn" + _local3].onPress = NumBtnOnPressHandler;
_local3++;
}
_local4.OnBtn.onPress = OnBtnOnPressHandler;
_local4.OffBtn.onPress = OffBtnOnPressHandler;
_local4.ResetBtn.onPress = ResetBtnOnPressHandler;
selectedTempArray = new Array();
_local4.StepMarkerMC.cacheAsBitmap = true;
}
function dispatchEvent() {
}
function Init(newFoodArray, newCorrectBakingTemp) {
foodArray = newFoodArray;
correctBakingTemp = newCorrectBakingTemp;
var _local3 = 0;
while (_local3 < foodArray.length) {
foodArray[_local3].foodMC = attachMovie(foodArray[_local3].foodName, foodArray[_local3].foodName + "MC", getNextHighestDepth(), {_x:foodArray[_local3].xPos, _y:foodArray[_local3].yPos});
_local3++;
}
attachMovie("OvenDoor", "OvenDoorMC", getNextHighestDepth(), {_x:118.8, _y:112.8});
defaultTempMC = attachMovie("Num0", "NumMC0", getNextHighestDepth(), {_x:75, _y:154});
calloutMC = _root.CreateCalloutMC(this, "Set Oven to " + correctBakingTemp, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
_root.ShowGoMC();
}
function NumBtnOnPressHandler() {
var _local3 = _parent;
_root.PlaySound(_root.SND_DIGITALBUTTON, false, false);
if (_local3.defaultTempMC != undefined) {
_local3.defaultTempMC.swapDepths(_local3.getNextHighestDepth());
_local3.defaultTempMC.removeMovieClip();
_local3.defaultTempMC = undefined;
}
var _local5 = _name.charAt(_name.length - 1);
if (_local3.selectedTempArray.length >= 3) {
return(undefined);
}
_local3.selectedTempArray[_local3.selectedTempArray.length] = _local3.attachMovie("Num" + _local5, "NumMC" + _local5, _local3.getNextHighestDepth(), {_x:75, _y:154});
_local3.selectedTempArray[_local3.selectedTempArray.length - 1].textValue = _local5;
var _local4 = 0;
while (_local4 < (_local3.selectedTempArray.length - 1)) {
_local3.selectedTempArray[_local4]._x = _local3.selectedTempArray[_local4]._x - (_local3.selectedTempArray[_local3.selectedTempArray.length - 1]._width - 4);
_local4++;
}
}
function OnBtnOnPressHandler() {
var _local4 = _parent;
var _local5 = "";
var _local3 = 0;
while (_local3 < _local4.selectedTempArray.length) {
_local5 = _local5 + _local4.selectedTempArray[_local3].textValue;
_local3++;
}
if (_local4.correctBakingTemp == _local5) {
trace("on");
_root.PlaySound(_root.SND_DIGITALBUTTON, false, false);
_local4.stepMarkerIncValue = STEP_MARKER_INC_VALUE;
_local4.onEnterFrame = _local4.OnEnterFrameHandler;
_root.PlaySound(_root.SND_BAKELOOP, false, true);
} else {
_root.PlaySound(_root.SND_INCORRECT, false, false);
_root.ShowFinishedMC();
}
}
function OffBtnOnPressHandler() {
var _local3 = _parent;
_root.StopSound();
_root.PlaySound(_root.SND_DIGITALBUTTON, false, false);
if (_local3.onEnterFrame == undefined) {
return(undefined);
}
_local3.onEnterFrame = undefined;
var _local4 = _local3.GetFoodStatus();
trace("foodStatus " + _local4);
if (_local4 == _root.FRAME_BAKE_FOOD_RAW) {
_local3.mProgress = 0;
} else if (_local4 == _root.FRAME_BAKE_FOOD_GOOD) {
_local3.mProgress = 76;
} else if (_local4 == _root.FRAME_BAKE_FOOD_GREAT) {
_local3.mProgress = 100;
} else if (_local4 == _root.FRAME_BAKE_FOOD_GOOD2) {
_local3.mProgress = 76;
} else if (_local4 == _root.FRAME_BAKE_FOOD_BURNT) {
_local3.mProgress = 0;
}
trace("parentMC.mProgress " + _local3.mProgress);
_root.ShowFinishedMC();
}
function ResetBtnOnPressHandler() {
var _local4 = _parent;
_root.PlaySound(_root.SND_DIGITALBUTTON, false, false);
var _local3 = 0;
while (_local3 < _local4.selectedTempArray.length) {
_local4.selectedTempArray[_local3].swapDepths(_local4.getNextHighestDepth());
_local4.selectedTempArray[_local3].removeMovieClip();
_local3++;
}
_local4.selectedTempArray.splice(0);
_local4.defaultTempMC = _local4.attachMovie("Num0", "NumMC0", _local4.getNextHighestDepth(), {_x:75, _y:154});
}
function OnEnterFrameHandler() {
if (_root.isGamePaused) {
return(undefined);
}
if (miniGamePaused) {
return(undefined);
}
var _local4 = this;
stepMarkerIncValue = stepMarkerIncValue + 0.15;
_local4.StepMarkerMC._x = _local4.StepMarkerMC._x + stepMarkerIncValue;
if (_local4.StepMarkerMC._x >= 480) {
onEnterFrame = undefined;
_root.ShowFinishedMC();
}
var _local6;
var _local5;
var _local3 = 0;
while (_local3 < foodArray.length) {
foodArray[_local3].foodMC.gotoAndStop(GetFoodStatus());
_local3++;
}
updateAfterEvent();
}
function GetFoodStatus() {
var _local3 = this;
var _local4 = _local3.StepMarkerMC._x + 3;
if (_local4 >= (_local3.BakingProgressGoodMC2._x + _local3.BakingProgressGoodMC2._width)) {
return(_root.FRAME_BAKE_FOOD_BURNT);
}
if (_local4 >= _local3.BakingProgressGoodMC2._x) {
return(_root.FRAME_BAKE_FOOD_GOOD2);
}
if (_local4 >= _local3.BakingProgressGreatMC._x) {
return(_root.FRAME_BAKE_FOOD_GREAT);
}
if (_local4 >= _local3.BakingProgressGoodMC._x) {
return(_root.FRAME_BAKE_FOOD_GOOD);
}
if (_local4 < _local3.BakingProgressGoodMC._x) {
return(_root.FRAME_BAKE_FOOD_RAW);
}
}
var mProgress = 0;
static var STEP_MARKER_INC_VALUE = 5;
}
Symbol 1213 MovieClip [__Packages.TomatoDice] Frame 0
class TomatoDice extends MovieClip
{
var onMouseDown, onMouseUp, arrowPathInfoArray, tweensObj, arrowPathMaxRepeatCount, arrowPathNumRepeatCount, mTotalSubSteps, currentArrowPathIndex, mSubStepsCompleted, arrowPathMC, calloutMC, attachMovie, getNextHighestDepth, _parent, _visible;
function TomatoDice () {
super();
var _local3 = MovieClip(this);
mx.events.EventDispatcher.initialize(this);
onMouseDown = ArrowOnPressHandler;
onMouseUp = ArrowOnReleaseHandler;
arrowPathInfoArray = new Array();
arrowPathInfoArray[0] = {xPos:190, yPos:200, arrowLength:100, createTail:false, arrowRotation:90};
arrowPathInfoArray[1] = {xPos:280, yPos:193, arrowLength:100, createTail:false, arrowRotation:90};
arrowPathInfoArray[2] = {xPos:265, yPos:193, arrowLength:100, createTail:false, arrowRotation:90};
arrowPathInfoArray[3] = {xPos:282, yPos:185, arrowLength:114, createTail:false, arrowRotation:360};
arrowPathInfoArray[4] = {xPos:282, yPos:205, arrowLength:114, createTail:false, arrowRotation:360};
_local3.TomatoPiece.origX = _local3.TomatoPiece._x;
_local3.TomatoPiece.origY = _local3.TomatoPiece._y;
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init() {
arrowPathMaxRepeatCount = 4;
arrowPathNumRepeatCount = 0;
mTotalSubSteps = arrowPathInfoArray.length * arrowPathMaxRepeatCount;
currentArrowPathIndex = 0;
mSubStepsCompleted = 0;
CreateArrowPath();
arrowPathMC._visible = false;
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
MovieClip(this).TomatoPiece._visible = false;
_root.ShowGoMC(GoMCCompleteHandler, arrowPathMC);
}
function GoMCCompleteHandler(arrowPathMC) {
arrowPathMC._visible = true;
}
function CreateArrowPath() {
arrowPathMC = attachMovie("Arrow", "ArrowMC" + currentArrowPathIndex, getNextHighestDepth());
arrowPathMC.addEventListener(arrowPathMC.PATH_TRACE_COMPLETE, ArrowPathTraceCompleteHandler);
arrowPathMC.Init(arrowPathInfoArray[currentArrowPathIndex].arrowLength, arrowPathInfoArray[currentArrowPathIndex].createTail, arrowPathInfoArray[currentArrowPathIndex].arrowRotation, arrowPathInfoArray[currentArrowPathIndex].xPos, arrowPathInfoArray[currentArrowPathIndex].yPos);
}
function ArrowPathTraceCompleteHandler() {
trace("TomatoDice: ArrowPathTraceCompleteHandler " + this);
var _local3 = _parent;
_local3.currentArrowPathIndex++;
_local3.UpdateProgress();
if (_local3.currentArrowPathIndex == 1) {
_local3.TomatoPetal.nextFrame();
_local3.tweensObj.tomatoPieceTween.stop();
_local3.TomatoPiece._x = _local3.TomatoPiece.origX;
_local3.TomatoPiece._y = _local3.TomatoPiece.origY;
_local3.TomatoPiece._visible = true;
trace((("TomatoDice: Changing tomato piece position " + _local3.TomatoPiece._x) + ", ") + _local3.TomatoPiece._y);
} else {
_local3.TomatoPiece.nextFrame();
}
if (_local3.currentArrowPathIndex == _local3.arrowPathInfoArray.length) {
trace("hello last arow path");
_visible = false;
_local3.arrowPathNumRepeatCount++;
_local3.currentArrowPathIndex = 0;
_local3.tweensObj.tomatoPieceTween = new mx.transitions.Tween(_local3.TomatoPiece, "_y", mx.transitions.easing.None.easeNone, _local3.TomatoPiece._y, Stage.height, 12, false);
var _local4 = mx.utils.Delegate.create(_local3, _local3.TomatoPieceTweenFinishHandler);
_local3.tweensObj.tomatoPieceTween.onMotionFinished = _local4;
if (_local3.arrowPathNumRepeatCount == _local3.arrowPathMaxRepeatCount) {
_root.ShowFinishedMC();
return(undefined);
}
_local3.TomatoPetal.gotoAndPlay(_local3.TomatoPetal._currentframe + 1);
}
if (_local3.currentArrowPathIndex != 0) {
_local3.CreateArrowPath();
} else {
trace("hello first arrow");
}
MovieClip(this).RemoveMovieClip();
}
function TomatoPieceTweenFinishHandler() {
var _local2 = MovieClip(this);
trace((("TomatoDice: Tomato piece tween complete " + _local2.TomatoPiece._x) + ", ") + _local2.TomatoPiece._y);
_local2.TomatoPiece.gotoAndStop(1);
if (arrowPathNumRepeatCount != arrowPathMaxRepeatCount) {
CreateArrowPath();
}
}
function ArrowOnPressHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_KNIFE);
}
function ArrowOnReleaseHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
_root.PlaySound(_root.SND_CUT, false, false);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
var mProgress = 0;
static var NUM_CLICKS_REQ = 8;
}
Symbol 1214 MovieClip [__Packages.DeepFry] Frame 0
class DeepFry extends MovieClip
{
var miniGamePaused, foodDropCounter, wobbleUp, totalDroppedCount, foodArray, maskInfo, firedFoodXPosOffset, firedFoodYPosOffset, potMC, attachMovie, getNextHighestDepth, calloutMC, _parent, startDrag, stopDrag, _x, _y, onEnterFrame, onPress, onRelease, setMask;
function DeepFry () {
super();
miniGamePaused = false;
mx.events.EventDispatcher.initialize(this);
foodDropCounter = 0;
wobbleUp = false;
totalDroppedCount = 0;
if (_root.selectedRecipeName == _root.RECIPE_NAME_EGG_ROLLS) {
MAX_Y_POS_FOR_RAW_TO_FRIED_FOOD = MAX_Y_POS_FOR_RAW_TO_FRIED_FOOD + 12;
WOBBLE_MAX_Y_POS = WOBBLE_MAX_Y_POS + 12;
WOBBLE_MIN_Y_POS = WOBBLE_MIN_Y_POS + 12;
}
}
function dispatchEvent() {
}
function Init(newFoodArray, newMaskObject, newFiredFoodXPosOffset, newFiredFoodYPosOffset) {
foodArray = newFoodArray;
maskInfo = newMaskObject;
firedFoodXPosOffset = newFiredFoodXPosOffset;
firedFoodYPosOffset = newFiredFoodYPosOffset;
potMC = potMC;
var _local3 = 0;
while (_local3 < foodArray.length) {
foodArray[_local3].foodMC = attachMovie(foodArray[_local3].foodName, "Food_" + _local3, getNextHighestDepth(), {_x:foodArray[_local3].xPos, _y:foodArray[_local3].yPos});
foodArray[_local3].foodMC.arrayIndex = _local3;
foodArray[_local3].foodMC.waitTime = 0;
foodArray[_local3].foodMC.friedStatus = FOOD_STATUS_RAW;
foodArray[_local3].foodMC.droppedStatus = false;
foodArray[_local3].foodMC.dropIndex = 0;
foodArray[_local3].foodMC.onPress = OnPressHandler;
foodArray[_local3].foodMC.onRelease = OnReleaseHandler;
foodArray[_local3].maskMC = attachMovie(maskInfo.maskName, "Mask_" + _local3, getNextHighestDepth(), {_x:maskInfo.xPos, _y:maskInfo.yPos});
foodArray[_local3].maskMC._width = maskInfo.maskWidth;
foodArray[_local3].maskMC._height = maskInfo.maskHeight;
foodArray[_local3].maskMC._visible = false;
foodArray[_local3].foodProgressMC = attachMovie(foodArray[_local3].foodName, "Food_Progress_" + _local3, getNextHighestDepth(), {_x:foodArray[_local3].xPosInProgress, _y:foodArray[_local3].yPosInProgress});
foodArray[_local3].foodProgressMC.gotoAndStop(foodArray[_local3].foodCorrectStateFrame);
_local3++;
}
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
_root.ShowGoMC();
_root.PlaySound(_root.SND_STOVETOPLOW, false, true, false);
}
function OnPressHandler() {
var _local3 = MovieClip(this);
_local3.swapDepths(_parent.getNextHighestDepth());
startDrag();
if ((_local3.friedStatus == FOOD_STATUS_FRIED) || (_local3.friedStatus == FOOD_STATUS_DEEP_FRIED)) {
_root.ShowHintArrow(_root.HINT_ARROW_LEFT, 175, 248);
_parent.foodArray[_local3.arrayIndex].foodMC.onEnterFrame = undefined;
_parent.foodArray[_local3.arrayIndex].foodMC.setMask(null);
}
}
function OnReleaseHandler() {
_root.RemoveHintArrow(_root.HINT_ARROW_LEFT, 170, 260);
stopDrag();
var _local4 = this;
if (_local4.friedStatus == FOOD_STATUS_RAW) {
if (_x <= MIN_VALID_TRAY_X) {
_x = _parent.foodArray[_local4.arrayIndex].xPos;
_y = _parent.foodArray[_local4.arrayIndex].yPos;
} else if (_root.IsNumBetween(_local4._x, 285, 360) and (_local4._y < 190)) {
foodDropCorrect = true;
_local4.droppedStatus = true;
_parent.totalDroppedCount++;
_local4.dropIndex = _parent.totalDroppedCount;
var _local3 = 0;
while (_local3 < _parent.foodArray.length) {
if (_parent.foodArray[_local3].foodMC.droppedStatus) {
_parent.foodArray[_local3].foodMC.swapDepths(_parent.getNextHighestDepth() - _parent.foodArray[_local3].foodMC.dropIndex);
}
_local3++;
}
onEnterFrame = _parent.OnEnterFrameHandler;
} else {
foodDropCorrect = false;
onEnterFrame = _parent.OnEnterFrameHandler;
_parent.UpdateProgress(_local4.friedStatus);
}
} else if ((_local4.friedStatus == FOOD_STATUS_FRIED) || (_local4.friedStatus == FOOD_STATUS_DEEP_FRIED)) {
if (((_x >= MIN_VALID_FRIED_TRAY_X) && (_x <= MAX_VALID_FRIED_TRAY_X)) && ((_y >= MIN_VALID_FRIED_TRAY_Y) && (_y <= MAX_VALID_FRIED_TRAY_Y))) {
_x = _parent.foodArray[_parent.foodDropCounter].xPos + _parent.firedFoodXPosOffset;
_y = _parent.foodArray[_parent.foodDropCounter].yPos + _parent.firedFoodYPosOffset;
_parent.foodDropCounter++;
onPress = undefined;
onRelease = undefined;
_parent.UpdateProgress(_local4.friedStatus);
} else {
foodDropCorrect = false;
onEnterFrame = _parent.OnEnterFrameHandler;
_parent.UpdateProgress(FOOD_STATUS_RAW);
}
}
}
function OnEnterFrameHandler(thisMC) {
if (_root.isGamePaused) {
return(undefined);
}
if (_parent.miniGamePaused) {
return(undefined);
}
thisMC = this;
thisMC.waitTime = thisMC.waitTime + 1;
if (foodDropCorrect == true) {
if (_parent.foodArray[thisMC.arrayIndex].foodMC.friedStatus == FOOD_STATUS_RAW) {
_parent.foodArray[thisMC.arrayIndex].foodMC._y = _parent.foodArray[thisMC.arrayIndex].foodMC._y + 6;
if (_parent.foodArray[thisMC.arrayIndex].foodMC._y >= _parent.potMC._y) {
_parent.foodArray[thisMC.arrayIndex].foodMC.setMask(_parent.foodArray[thisMC.arrayIndex].maskMC);
if (_parent.foodArray[thisMC.arrayIndex].foodMC._y >= _parent.potMC._height) {
_parent.foodArray[thisMC.arrayIndex].foodMC._visible = true;
_parent.foodArray[thisMC.arrayIndex].foodMC._y = 240;
if ((thisMC.waitTime >= STARTING_WAIT_TIME) && (thisMC.waitTime < (STARTING_WAIT_TIME + 130))) {
_parent.foodArray[thisMC.arrayIndex].foodMC.gotoAndStop(_root.FRAME_FOOD_GYOZA_FRY);
_parent.foodArray[thisMC.arrayIndex].foodMC.friedStatus = FOOD_STATUS_FRIED;
}
}
}
} else if (_parent.foodArray[thisMC.arrayIndex].foodMC.friedStatus == FOOD_STATUS_FRIED) {
if (_parent.foodArray[thisMC.arrayIndex].foodMC._y <= _parent.MAX_Y_POS_FOR_RAW_TO_FRIED_FOOD) {
if (wobbleUp) {
thisMC._y = thisMC._y - _parent.WOBBLE_Y_VALUE;
if (thisMC._y <= _parent.WOBBLE_MIN_Y_POS) {
wobbleUp = false;
}
} else {
thisMC._y = thisMC._y + _parent.WOBBLE_Y_VALUE;
if (thisMC._y >= _parent.WOBBLE_MAX_Y_POS) {
wobbleUp = true;
}
}
} else {
_parent.foodArray[thisMC.arrayIndex].foodMC._y = _parent.foodArray[thisMC.arrayIndex].foodMC._y - 1.3;
_parent.foodArray[thisMC.arrayIndex].foodMC._visible = true;
}
if (thisMC.waitTime >= FRIED_WAIT_TIME) {
_parent.foodArray[thisMC.arrayIndex].foodMC.friedStatus = FOOD_STATUS_DEEP_FRIED;
_parent.foodArray[thisMC.arrayIndex].foodMC.gotoAndStop(_root.FRAME_FOOD_GYOZA_DEEP_FRIED);
}
} else if (_parent.foodArray[thisMC.arrayIndex].foodMC.friedStatus == FOOD_STATUS_DEEP_FRIED) {
if (wobbleUp) {
thisMC._y = thisMC._y - _parent.WOBBLE_Y_VALUE;
if (thisMC._y <= _parent.WOBBLE_MIN_Y_POS) {
wobbleUp = false;
}
} else {
thisMC._y = thisMC._y + _parent.WOBBLE_Y_VALUE;
if (thisMC._y >= _parent.WOBBLE_MAX_Y_POS) {
wobbleUp = true;
}
}
if (thisMC.waitTime == DEEP_FRIED_WAIT_TIME) {
_parent.foodArray[thisMC.arrayIndex].foodMC.friedStatus = FOOD_STATUS_BURNT;
_parent.foodArray[thisMC.arrayIndex].foodMC.gotoAndStop(_root.FRAME_FOOD_GYOZA_BURNT);
}
} else if (_parent.foodArray[thisMC.arrayIndex].foodMC.friedStatus == FOOD_STATUS_BURNT) {
trace("Food Burnt");
foodDropCorrect = false;
onPress = undefined;
_parent.UpdateProgress(thisMC.friedStatus);
}
} else if (foodDropCorrect == false) {
if (_parent.foodArray[thisMC.arrayIndex].foodMC.friedStatus == FOOD_STATUS_BURNT) {
thisMC._y = thisMC._y + 5;
} else {
setMask(null);
thisMC._y = thisMC._y + 15;
}
if (thisMC._y >= (Stage.height - 60)) {
thisMC._visible = false;
thisMC.onPress = undefined;
thisMC.onRelease = undefined;
onEnterFrame = undefined;
}
}
updateAfterEvent();
}
function UpdateProgress(friedStatus) {
var _local4 = MovieClip(this);
var _local3 = correctHitNo + incorrectHitNo;
if (friedStatus == FOOD_STATUS_DEEP_FRIED) {
correctHitNo++;
mProgress = (correctHitNo / foodArray.length) * 100;
_root.PlaySound(_root.SND_CORRECT, false, false, false);
attachMovie("CheckmarkIcon", "CheckmarkIconMC" + _local3, getNextHighestDepth(), {_x:_local4.foodArray[_local3].foodProgressMC._x + 12, _y:CORRECT_ICON_YPOS});
} else {
incorrectHitNo++;
mBadProgress = (incorrectHitNo / foodArray.length) * 100;
_root.PlaySound(_root.SND_INCORRECT, false, false, false);
attachMovie("ErrorIcon", "ErrorIconMC" + _local3, getNextHighestDepth(), {_x:_local4.foodArray[_local3].foodProgressMC._x + 14, _y:ERROR_ICON_YPOS});
}
trace((("DeepFry: progress " + correctHitNo) + ", ") + incorrectHitNo);
if (_local3 >= (foodArray.length - 1)) {
if (correctHitNo == 4) {
mProgress = 76;
}
_root.ShowFinishedMC();
}
}
var mBadProgress = 0;
var mProgress = 0;
static var FOOD_STATUS_RAW = 1;
static var FOOD_STATUS_FRIED = 2;
static var FOOD_STATUS_DEEP_FRIED = 3;
static var FOOD_STATUS_BURNT = 4;
static var MIN_VALID_TRAY_X = 195;
static var MIN_VALID_FRIED_TRAY_X = 11;
static var MAX_VALID_FRIED_TRAY_X = 176;
static var MIN_VALID_FRIED_TRAY_Y = 210;
static var MAX_VALID_FRIED_TRAY_Y = 298;
static var STARTING_WAIT_TIME = 150;
static var FRIED_WAIT_TIME = STARTING_WAIT_TIME + 180;
static var DEEP_FRIED_WAIT_TIME = STARTING_WAIT_TIME + 230;
var MAX_Y_POS_FOR_RAW_TO_FRIED_FOOD = 144;
var WOBBLE_MAX_Y_POS = 141;
var WOBBLE_MIN_Y_POS = 136;
var WOBBLE_Y_VALUE = 0.3;
static var CORRECT_ICON_YPOS = 350;
static var ERROR_ICON_YPOS = 350;
var foodDropCorrect = false;
var correctHitNo = 0;
var incorrectHitNo = 0;
}
Symbol 1215 MovieClip [__Packages.Scoreboard] Frame 0
class Scoreboard extends MovieClip
{
var CalloutMC, attachMovie, getNextHighestDepth, gotoAndPlay, _parent;
function Scoreboard () {
super();
mx.events.EventDispatcher.initialize(this);
var _local4 = MovieClip(this);
_local4.ContinueBtn.onPress = ContinueBtnOnPressHandler;
_local4.RetryBtn.onPress = RetryBtnOnPressHandler;
_local4.QuitBtn.onPress = QuitBtnOnPressHandler;
_local4.ContinueBtn.onRollOver = _root.MouseHandOnRollOverHandler;
_local4.RetryBtn.onRollOver = _root.MouseHandOnRollOverHandler;
_local4.QuitBtn.onRollOver = _root.MouseHandOnRollOverHandler;
_local4.ContinueBtn.onRollOut = _root.MouseHandOnRollOutHandler;
_local4.RetryBtn.onRollOut = _root.MouseHandOnRollOutHandler;
_local4.QuitBtn.onRollOut = _root.MouseHandOnRollOutHandler;
}
function dispatchEvent() {
}
function ShowScoreboard(recipeName, stepTitle, timeLeft, mProgress) {
CalloutMC = attachMovie("Callout", "CalloutMC", getNextHighestDepth(), {_x:-146, _y:-156});
trace((("Scoreboard: ShowScoreboard: mProgress = " + mProgress) + "timeLeft") + timeLeft);
var _local2 = this;
_local2.ContinueBtn._x = 190;
_local2.QuitBtn._x = -12;
_local2.RecipeNameText.text = recipeName;
_local2.StepTitleText.text = stepTitle;
CalculateScore(timeLeft, mProgress);
gotoAndPlay(2);
}
function CalculateScore(timeLeft, mProgress) {
var _local6 = 0;
var _local7 = 0;
var _local5 = 0;
var _local3 = MovieClip(this);
trace("Scoreboard: CalculateScore: mProgress = " + mProgress);
mProgress = CorrectFloatingPointError(mProgress, 2);
if ((mProgress >= 75) && (mProgress < 100)) {
trace("Scoreboard: CalculateScore: first condition mProgress = " + mProgress);
_local6 = 50;
_local3.RetryBtn._visible = false;
_local3.ContinueBtn._x = _local3.ContinueBtn._x - (_local3.RetryBtn._width / 2);
_local3.QuitBtn._x = _local3.QuitBtn._x + (_local3.RetryBtn._width / 2);
_local3.ChefMC.gotoAndStop(_root.FRAME_SB_CHEF_NATURAL);
_local3.CalloutMC.Init(_root.SCOREBOARD_CALLOUT_TEXT_NEUTRAL, 100, Callout.CALLOUT_CHEF);
} else if (mProgress >= 100) {
trace("Scoreboard: CalculateScore: second condition mProgress = " + mProgress);
_local6 = 100;
_local7 = Math.floor((BONUS_POINT / BONUS_POINT_TIME) * timeLeft);
_local3.RetryBtn._visible = false;
_local3.ContinueBtn._x = _local3.ContinueBtn._x - (_local3.RetryBtn._width / 2);
_local3.QuitBtn._x = _local3.QuitBtn._x + (_local3.RetryBtn._width / 2);
_local3.ChefMC.gotoAndStop(_root.FRAME_SB_CHEF_HAPPY);
_local3.CalloutMC.Init(_root.SCOREBOARD_CALLOUT_TEXT_HAPPY, 100, Callout.CALLOUT_CHEF);
} else {
_local6 = 0;
trace("mProgress ->>" + mProgress);
_local3.RetryBtn._visible = true;
_local3.ChefMC.gotoAndStop(_root.FRAME_SB_CHEF_UPSET);
_local3.CalloutMC.Init(_root.SCOREBOARD_CALLOUT_TEXT_UPSET, 320, Callout.CALLOUT_CHEF);
}
_local5 = _local6 + _local7;
trace((("Scoreboard: CalculateScore: subtotal = " + _local5) + ", ") + _local3.RecipeNameText.text);
_parent.ScoreboardMC.ScoreText.text = _local6;
_parent.ScoreboardMC.BonusText.text = _local7;
_parent.ScoreboardMC.SubTotalText.text = _local5;
if (_root.gamePlayMode == _root.GAMEPLAY_MODE_COOK) {
_root.totalScore = _root.totalScore + _local5;
_parent.ScoreboardMC.TotalText.text = _root.totalScore;
} else {
_parent.ScoreboardMC.TotalText.text = _local5;
}
}
function ContinueBtnOnPressHandler() {
_root.StopSound();
_root.PlaySound(_root.SND_BUTTON, false, false, true);
_root.MouseHandOnRollOutHandler();
_parent.RemoveChefCalloutMC();
_parent._visible = false;
_root.gotoAndStop(_root.FRAME_INSTRUCTIONS);
if (_root.gamePlayMode == _root.GAMEPLAY_MODE_COOK) {
_root.SubmitScoreToPublishersAPI(_root.totalScore);
_root.ShowNextInstruction();
}
}
function RetryBtnOnPressHandler() {
_root.StopSound();
_root.PlaySound(_root.SND_BUTTON, false, false, true);
_root.MouseHandOnRollOutHandler();
_parent.RemoveChefCalloutMC();
_parent._visible = false;
_root.PlayMiniGame();
}
function QuitBtnOnPressHandler() {
_root.StopSound();
_root.PlaySound(_root.SND_BUTTON, false, false, true);
_root.MouseHandOnRollOutHandler();
_parent.RemoveChefCalloutMC();
_parent._visible = false;
_root.gotoAndStop(_root.FRAME_RECIPE_BOOK);
}
function RemoveChefCalloutMC() {
CalloutMC._visible = false;
CalloutMC.swapDepths(getNextHighestDepth());
CalloutMC.removeMovieClip();
CalloutMC = undefined;
}
function CorrectFloatingPointError(number, precision) {
var _local1 = Math.pow(10, precision);
return(Math.round(_local1 * number) / _local1);
}
static var BONUS_POINT = 10;
static var BONUS_POINT_TIME = 60000;
}
Symbol 1216 MovieClip [__Packages.Arrow] Frame 0
class Arrow extends MovieClip
{
var _parent, redCursorMC, arrowLength, emptyContainerMC, createEmptyMovieClip, getNextHighestDepth, pathMC, isBiDirectional, tailMC, bodyMC, headMC, endMarkMC, startMarkMC, endMarkMCToCheckWith, _x, _y, _rotation, traceStatus, onMouseMove, onMouseUp, attachMovie, _totalframes, _currentframe, onEnterFrame, swapDepths, removeMovieClip, _name, onPress, _visible, globalToLocal, redCursorTweenX, redCursorTweenY;
function Arrow () {
super();
mx.events.EventDispatcher.initialize(this);
_parent.AddPathEventListener();
redCursorMC = undefined;
}
function dispatchEvent() {
}
function Init(newArrowLength, createTail, arrowRotation, xPos, yPos, createRedCursor) {
arrowLength = newArrowLength;
emptyContainerMC = createEmptyMovieClip("container", getNextHighestDepth());
pathMC = emptyContainerMC.attachMovie("EmptyMC", "EmptyMC1", emptyContainerMC.getNextHighestDepth(), {_x:0, _y:0, _alpha:0});
isBiDirectional = !createTail;
if (createTail) {
tailMC = emptyContainerMC.attachMovie("ArrowTail", "TailMC", emptyContainerMC.getNextHighestDepth(), {_x:0, _y:0});
} else {
tailMC = emptyContainerMC.attachMovie("ArrowHeadLeft", "TailMC", emptyContainerMC.getNextHighestDepth(), {_x:0, _y:0});
}
bodyMC = emptyContainerMC.attachMovie("ArrowBody", "BodyMC", emptyContainerMC.getNextHighestDepth(), {_x:tailMC._width, _y:0});
headMC = emptyContainerMC.attachMovie("ArrowHeadRight", "HeadMC", emptyContainerMC.getNextHighestDepth(), {_x:bodyMC._x + bodyMC._width, _y:0});
var _local2 = arrowLength - (tailMC._width + headMC._width);
bodyMC._xscale = (_local2 / bodyMC._width) * 100;
headMC._x = bodyMC._x + bodyMC._width;
pathMC._width = arrowLength + PATH_WIDTH_MARGIN;
pathMC._height = PATH_HEIGHT_MARGIN;
pathMC._x = -(PATH_WIDTH_MARGIN / 2);
pathMC._y = (-(PATH_HEIGHT_MARGIN / 2)) + (headMC._height / 2);
emptyContainerMC._x = emptyContainerMC._x - pathMC._x;
emptyContainerMC._y = emptyContainerMC._y - pathMC._y;
endMarkMC = emptyContainerMC.attachMovie("ArrowMarker", "EndMarkMC", emptyContainerMC.getNextHighestDepth(), {_width:MARKER_WIDTH, _height:MARKER_HEIGHT, _x:((pathMC._x + pathMC._width) - MARKER_WIDTH) - (PATH_WIDTH_MARGIN / 2), _y:pathMC._y, _alpha:0});
startMarkMC = emptyContainerMC.attachMovie("ArrowMarker", "StartMarkMC", emptyContainerMC.getNextHighestDepth(), {_width:MARKER_WIDTH, _height:MARKER_HEIGHT, _x:pathMC._x, _y:pathMC._y, _alpha:0});
endMarkMCToCheckWith = endMarkMC;
AddMouseEventListeners();
emptyContainerMC._x = emptyContainerMC._x - (emptyContainerMC._width / 2);
emptyContainerMC._y = emptyContainerMC._y - (emptyContainerMC._height / 2);
_x = xPos;
_y = yPos;
_rotation = arrowRotation;
if ((createRedCursor == undefined) or (createRedCursor == true)) {
CreateRedCursor();
}
traceStatus = TRACE_IDLE;
}
function AddMouseEventListeners() {
startMarkMC.onPress = StartMarkMCOnPressHandler;
startMarkMC.onRollOver = StartMarkOnRollOverHandler;
startMarkMC.onRollOut = StartMarkOnRollOutHandler;
if (isBiDirectional) {
endMarkMC.onPress = StartMarkMCOnPressHandler;
endMarkMC.onRollOver = StartMarkOnRollOverHandler;
endMarkMC.onRollOut = StartMarkOnRollOutHandler;
}
onMouseMove = OnMouseMoveHandler;
onMouseUp = PathMCOnMouseUpHandler;
pathMC.onReleaseOutside = PathMCOnReleaseOutsideHandler;
pathMC.onDragOut = PathMCOnReleaseOutsideHandler;
}
function RemoveMouseEventListeners() {
startMarkMC.onPress = undefined;
startMarkMC.onRollOver = undefined;
startMarkMC.onRollOut = undefined;
if (isBiDirectional) {
endMarkMC.onPress = undefined;
endMarkMC.onRollOver = undefined;
endMarkMC.onRollOut = undefined;
}
onMouseMove = undefined;
onMouseUp = undefined;
pathMC.onReleaseOutside = undefined;
pathMC.onDragOut = undefined;
}
function StartMarkMCOnPressHandler() {
_parent._parent.traceStatus = TRACE_START;
if (this == _parent._parent.startMarkMC) {
_parent._parent.endMarkMCToCheckWith = _parent._parent.endMarkMC;
} else {
_parent._parent.endMarkMCToCheckWith = _parent._parent.startMarkMC;
}
if (!_parent._parent.isBiDirectional) {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_DRAGGING);
}
_parent._parent.isMouseDown = true;
}
function OnMouseMoveHandler() {
if (!isMouseDown) {
return(undefined);
}
if (!startMarkMC.hitTest(_root._xmouse, _root._ymouse, true)) {
trace("Arrow: OnMouseMoveHandler: mouse is outside start mark");
RemoveRedCursor();
}
if (endMarkMCToCheckWith.hitTest(_root._xmouse, _root._ymouse, false)) {
if (traceStatus == TRACE_START) {
traceStatus = TRACE_DONE;
isMouseDown = false;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
RemoveRedCursor();
if (isBiDirectional) {
ShowKnifeSliceFlash();
} else {
dispatchEvent({type:PATH_TRACE_COMPLETE, target:this});
if ((((_root.selectedRecipeName == _root.RECIPE_NAME_GYOZA) and (_root.currentStepNo == 4)) or ((_root.selectedRecipeName == _root.RECIPE_NAME_GUACAMOLE) and (_root.currentStepNo == 5))) or ((_root.selectedRecipeName == _root.RECIPE_NAME_SPINACH_TRIANGLES) and (_root.currentStepNo == 5))) {
_root.PlaySound(_root.SND_SQUISH, false, false);
}
}
}
} else if (!pathMC.hitTest(_root._xmouse, _root._ymouse, true)) {
if (traceStatus == TRACE_START) {
trace("Arrow: OnMouseMoveHandler: Tracing Incorrect. Will call StartRed...");
traceStatus = TRACE_INVALID;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
isMouseDown = false;
CreateRedCursor();
return(undefined);
}
}
}
function PathMCOnReleaseOutsideHandler() {
trace("Arrow: PathMCOnReleaseOutsideHandler: Will calll StartRed..., " + this);
_parent._parent.isMouseDown = false;
_parent._parent.traceStatus = TRACE_INVALID;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
_parent._parent.CreateRedCursor();
}
function PathMCOnMouseUpHandler() {
isMouseDown = false;
traceStatus = TRACE_INVALID;
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
CreateRedCursor();
}
function StartMarkOnRollOverHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_HAND);
}
function StartMarkOnRollOutHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function ShowKnifeSliceFlash() {
emptyContainerMC._visible = false;
var _local2 = attachMovie("KnifeSliceFlash", "KnifeSliceFlashMC", getNextHighestDepth(), {_x:0, _y:0});
_local2._width = arrowLength;
_local2.onEnterFrame = KnifeSliceFlashOnEnterFrameHandler;
}
function KnifeSliceFlashOnEnterFrameHandler() {
if (_currentframe == _totalframes) {
onEnterFrame = undefined;
_parent.dispatchEvent({type:_parent.PATH_TRACE_COMPLETE, target:_parent});
swapDepths(getNextHighestDepth());
removeMovieClip();
}
}
function RemoveMovieClip() {
trace("Arrow: RemoveMovieClip: this.name " + _name);
RemoveRedCursor();
onPress = undefined;
_visible = false;
swapDepths(getNextHighestDepth());
removeMovieClip();
}
function CreateRedCursor() {
trace("Arrow: CreateRedCursor: " + this);
if (isRedCursorAnimationRunning) {
return(undefined);
}
var _local2 = new mx.transitions.Tween(this, "_y", mx.transitions.easing.None.easeNone, _y, _y, 2, true);
var _local3 = mx.utils.Delegate.create(this, RedCursorArrowWaitTweenFinishHandler);
_local2.onMotionFinished = _local3;
}
function RedCursorArrowWaitTweenFinishHandler() {
StartRedCursorAnimation();
}
function StartRedCursorAnimation() {
if (!_visible) {
return(undefined);
}
if (isRedCursorAnimationRunning) {
return(undefined);
}
trace("Arrow: StartRedCursorAnimation: Enter");
isRedCursorAnimationRunning = true;
piAngle = Math.PI * ((90 - _rotation) / 180);
if (redCursorMC == undefined) {
redCursorMC = attachMovie("RedCursor", "RedCursorMC", getNextHighestDepth());
redCursorMC._rotation = -_rotation;
}
redCursorMC.gotoAndStop(_root.FRAME_REDCURSOR_POINTER);
var _local3 = {x:tailMC._width / 2, y:tailMC._height / 2};
tailMC.localToGlobal(_local3);
globalToLocal(_local3);
redCursorMC._x = _local3.x;
redCursorMC._y = _local3.y;
redCursorMC._x = redCursorMC._x + (Math.cos(piAngle) * 30);
redCursorMC._y = redCursorMC._y + (Math.sin(piAngle) * 30);
redCursorTweenX = new mx.transitions.Tween(redCursorMC, "_y", mx.transitions.easing.None.easeNone, redCursorMC._y, _local3.y, 18, false);
redCursorTweenY = new mx.transitions.Tween(redCursorMC, "_x", mx.transitions.easing.None.easeNone, redCursorMC._x, _local3.x, 18, false);
var _local4 = mx.utils.Delegate.create(this, RedCursorPointerTweenFinishHandler);
redCursorTweenY.onMotionFinished = _local4;
}
function RedCursorPointerTweenFinishHandler() {
redCursorTweenX.stop();
redCursorMC.gotoAndStop(_root.FRAME_REDCURSOR_HAND);
redCursorTweenY = new mx.transitions.Tween(redCursorMC, "_y", mx.transitions.easing.None.easeNone, redCursorMC._y, redCursorMC._y, 12, false);
var _local3 = mx.utils.Delegate.create(this, RedCursorHandTweenFinishHandler);
redCursorTweenY.onMotionFinished = _local3;
}
function RedCursorHandTweenFinishHandler() {
redCursorMC.gotoAndStop(_root.FRAME_REDCURSOR_DRAGGING);
var _local3 = {x:tailMC._width / 2, y:tailMC._height / 2};
headMC.localToGlobal(_local3);
globalToLocal(_local3);
redCursorTweenX = new mx.transitions.Tween(redCursorMC, "_x", mx.transitions.easing.None.easeNone, redCursorMC._x, _local3.x, 18, false);
redCursorTweenY = new mx.transitions.Tween(redCursorMC, "_y", mx.transitions.easing.None.easeNone, redCursorMC._y, _local3.y, 18, false);
var _local4 = mx.utils.Delegate.create(this, RedCursorDraggingTweenFinishHandler);
redCursorTweenY.onMotionFinished = _local4;
}
function RedCursorDraggingTweenFinishHandler() {
redCursorTweenY.onMotionFinished = undefined;
isRedCursorAnimationRunning = false;
trace("Arrow: RedCursorDraggingTweenFinishHandler: will call StartRed...");
StartRedCursorAnimation();
}
function RemoveRedCursor() {
trace("Arrow: RemoveRedCursor");
if (redCursorMC == undefined) {
isRedCursorAnimationRunning = false;
return(undefined);
}
redCursorTweenX.stop();
redCursorTweenY.stop();
redCursorTweenX.onMotionFinished = undefined;
redCursorTweenY.onMotionFinished = undefined;
redCursorTweenX = undefined;
redCursorTweenY = undefined;
redCursorMC.swapDepths(redCursorMC._parent.getNextHighestDepth());
redCursorMC.removeMovieClip();
redCursorMC = undefined;
isRedCursorAnimationRunning = false;
}
var PATH_TRACE_COMPLETE = "ArrowTraceComplete";
static var PATH_WIDTH_MARGIN = 80;
static var PATH_HEIGHT_MARGIN = 80;
static var MARKER_WIDTH = 80;
static var MARKER_HEIGHT = 70;
static var TRACE_IDLE = 0;
static var TRACE_START = 1;
static var TRACE_STOP = 2;
static var TRACE_INVALID = 3;
static var TRACE_DONE = 4;
var isMouseDown = false;
var isRedCursorAnimationRunning = false;
var angle = 0;
var piAngle = 0;
}
Symbol 1217 MovieClip [__Packages.GarlicDice] Frame 0
class GarlicDice extends MovieClip
{
var firstTime, garlics, numRepeatCount, mSubStepsCompleted, tweensObj, maxRepeatCount, mTotalSubSteps, calloutMC, attachMovie, getNextHighestDepth, knifeRotatedMC, _parent, knifeMC, _visible;
function GarlicDice () {
super();
firstTime = true;
mx.events.EventDispatcher.initialize(this);
garlics = new Array();
numRepeatCount = 1;
mSubStepsCompleted = 0;
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init(newMaxRepeatCount) {
maxRepeatCount = newMaxRepeatCount;
mTotalSubSteps = NUM_CLICKS_REQ * maxRepeatCount;
CreateGarlic();
CreateKnifeRotated();
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
}
function CreateGarlic() {
garlics[numRepeatCount] = attachMovie("Garlic", "GarlicMC" + numRepeatCount, getNextHighestDepth(), {_x:Stage.width, _y:180});
garlics[numRepeatCount].attachMovie("DicedGarlic", "DicedGarlicMC", getNextHighestDepth(), {_x:0, _y:0});
var _local2 = garlics[numRepeatCount];
_local2.DicedGarlicMC._visible = false;
tweensObj["tween" + numRepeatCount] = new mx.transitions.Tween(garlics[numRepeatCount], "_x", mx.transitions.easing.None.easeNone, garlics[numRepeatCount]._x, 220, 12, false);
}
function CreateKnifeRotated() {
trace("CreateKnifeRotated " + this);
knifeRotatedMC = attachMovie("KnifeRotated", "KnifeRotatedMC", getNextHighestDepth(), {_x:160, _y:Stage.height});
tweensObj.knifeRotatedTween = new mx.transitions.Tween(knifeRotatedMC, "_y", mx.transitions.easing.None.easeNone, knifeRotatedMC._y, 178, 12, false);
var _local2 = mx.utils.Delegate.create(this, KnifeTweenFinishHandler);
tweensObj.knifeRotatedTween.onMotionFinished = _local2;
}
function KnifeTweenFinishHandler() {
trace("Knife tween finished " + this);
var _local3 = knifeRotatedMC._x;
var _local4 = knifeRotatedMC._y;
var _local5 = 1;
var _local6 = 0;
knifeRotatedMC.Init(_local3, _local4, _local5, _local6);
knifeRotatedMC.addEventListener(Knife.MOUSECLICK, KnifeRotatedClickHandler);
if (firstTime) {
firstTime = false;
_root.ShowGoMC(GoMCCompleteHandler);
} else {
_root.ShowHintArrow(_root.HINT_ARROW_DOWN, 250, 150);
}
}
function GoMCCompleteHandler(arrowPathMC) {
_root.ShowHintArrow(_root.HINT_ARROW_DOWN, 250, 150);
}
function KnifeRotatedClickHandler() {
_parent.KnifeRotatedClicked();
_root.PlaySound(_root.SND_CUT, false, false);
MovieClip(this).RemoveMovieClip();
}
function KnifeRotatedClicked() {
_root.RemoveHintArrow();
garlics[numRepeatCount].gotoAndStop("CrushedGarlic");
knifeMC = attachMovie("Knife", "KnifeMC", getNextHighestDepth(), {_x:0, _y:0});
var _local3 = (garlics[numRepeatCount]._x + garlics[numRepeatCount]._width) - 112;
var _local4 = 115;
var _local5 = NUM_CLICKS_REQ;
var _local6 = -6;
knifeMC.Init(_local3, _local4, _local5, _local6);
knifeMC.addEventListener(Knife.MOUSECLICK, KnifeClickHandler);
}
function KnifeClickHandler() {
var _local3 = MovieClip(this);
var _local2 = _parent;
_local2.UpdateProgress();
var _local4 = _local2.garlics[_local2.numRepeatCount];
_local4.CrushedGarlicMask._x = _local4.CrushedGarlicMask._x - 7;
_local4.DicedGarlicMask._x = _local4.DicedGarlicMask._x - 7;
if (_local3.numClicksDone >= _local3.numClicksReq) {
_visible = false;
_local2.tweensObj.tween = new mx.transitions.Tween(_local2.garlics[_local2.numRepeatCount], "_x", mx.transitions.easing.None.easeNone, _local2.garlics[_local2.numRepeatCount]._x, -_local2.garlics[_local2.numRepeatCount]._width, 12, false);
var _local5 = mx.utils.Delegate.create(_local2, _local2.GarlicTweenFinishHandler);
_local2.tweensObj.tween.onMotionFinished = _local5;
_local2.numRepeatCount++;
if (_local2.numRepeatCount <= _local2.maxRepeatCount) {
_local2.CreateGarlic();
_local2.CreateKnifeRotated();
}
_local3.RemoveMovieClip();
}
}
function GarlicTweenFinishHandler() {
if (numRepeatCount > maxRepeatCount) {
_root.ShowFinishedMC();
}
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
_root.PlaySound(_root.SND_CUT, false, false);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
var mProgress = 0;
static var NUM_CLICKS_REQ = 9;
}
Symbol 1218 MovieClip [__Packages.BokChoyCut] Frame 0
class BokChoyCut extends MovieClip
{
var firstTime, bokChoyCore, numRepeatCount, tweensObj, maxRepeatCount, knifeMC, attachMovie, getNextHighestDepth, knifeXPos, knifeYPos, numClicksReq, gapBetweenTwoClicks, mTotalSubSteps, mSubStepsCompleted, calloutMC, _parent, _visible;
function BokChoyCut () {
super();
firstTime = true;
mx.events.EventDispatcher.initialize(this);
bokChoyCore = new Array();
numRepeatCount = 1;
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init(newMaxRepeatCount) {
maxRepeatCount = newMaxRepeatCount;
CreateBokChoyCoreMC();
knifeMC = attachMovie("Knife", "KnifeMC", getNextHighestDepth(), {_x:0, _y:0, _visible:false});
knifeXPos = bokChoyCore[numRepeatCount]._width + 100;
knifeYPos = 110;
numClicksReq = 13;
gapBetweenTwoClicks = -14;
knifeMC.Init(knifeXPos, knifeYPos, numClicksReq, gapBetweenTwoClicks);
knifeMC.addEventListener(Knife.MOUSECLICK, KnifeClickHandler);
mTotalSubSteps = numClicksReq * maxRepeatCount;
mSubStepsCompleted = 0;
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
}
function CreateBokChoyCoreMC() {
bokChoyCore[numRepeatCount] = attachMovie("BokChoyCore", "BokChoyCoreMC" + numRepeatCount, getNextHighestDepth(), {_x:Stage.width, _y:180});
tweensObj["tween" + numRepeatCount] = new mx.transitions.Tween(bokChoyCore[numRepeatCount], "_x", mx.transitions.easing.None.easeNone, bokChoyCore[numRepeatCount]._x, 140, 12, false);
var _local2 = mx.utils.Delegate.create(this, BokChoyInitTweenFinishHandler);
tweensObj["tween" + numRepeatCount].onMotionFinished = _local2;
}
function BokChoyInitTweenFinishHandler() {
knifeMC._visible = true;
if (firstTime) {
_root.ShowGoMC();
firstTime = false;
}
}
function KnifeClickHandler() {
_parent.UpdateProgress();
var _local3 = _parent.bokChoyCore[_parent.numRepeatCount];
var _local4 = MovieClip(this);
var _local2 = 1;
while (_local2 <= _local4.numClicksDone) {
_local3["BokChoySliceMC" + _local2]._x = _local3["BokChoySliceMC" + _local2]._x + 3;
_local2++;
}
if (_local4.numClicksDone >= _local4.numClicksReq) {
_visible = false;
_parent.tweensObj.tween = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.None.easeNone, _local3._x, -_local3._width, 12, false);
var _local5 = mx.utils.Delegate.create(this, _parent.BokChoyTweenFinishHandler);
_parent.tweensObj.tween.onMotionFinished = _local5;
_parent.numRepeatCount++;
if (_parent.numRepeatCount <= _parent.maxRepeatCount) {
_parent.CreateBokChoyCoreMC();
_parent.knifeMC.Init(_parent.knifeXPos, _parent.knifeYPos, _parent.numClicksReq, _parent.gapBetweenTwoClicks);
_parent.knifeMC.swapDepths(_parent.bokChoyCore[_parent.numRepeatCount]);
}
}
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
_root.PlaySound(_root.SND_CHOP, false, false);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
function BokChoyTweenFinishHandler() {
if (_parent.numRepeatCount > _parent.maxRepeatCount) {
_root.ShowFinishedMC();
}
}
var mProgress = 0;
}
Symbol 1219 MovieClip [__Packages.GreenOnionCut] Frame 0
class GreenOnionCut extends MovieClip
{
var greenOnionCore, numRepeatCount, tweensObj, maxRepeatCount, attachMovie, getNextHighestDepth, knifeMC, knifeXPos, knifeYPos, numClicksReq, gapBetweenTwoClicks, mTotalSubSteps, mSubStepsCompleted, calloutMC, _parent, _visible;
function GreenOnionCut () {
super();
mx.events.EventDispatcher.initialize(this);
greenOnionCore = new Array();
numRepeatCount = 1;
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init(newMaxRepeatCount) {
maxRepeatCount = newMaxRepeatCount;
greenOnionCore[numRepeatCount] = attachMovie("GreenOnionCore", "GreenOnionCoreMC" + numRepeatCount, getNextHighestDepth(), {_x:40, _y:180});
knifeMC = attachMovie("Knife", "KnifeMC", getNextHighestDepth(), {_x:0, _y:0});
knifeXPos = greenOnionCore[numRepeatCount]._width;
knifeYPos = 110;
numClicksReq = 12;
gapBetweenTwoClicks = -18;
knifeMC.Init(knifeXPos, knifeYPos, numClicksReq, gapBetweenTwoClicks);
knifeMC.addEventListener(Knife.MOUSECLICK, KnifeClickHandler);
mTotalSubSteps = numClicksReq * maxRepeatCount;
mSubStepsCompleted = 0;
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, 110, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
_root.ShowGoMC();
}
function KnifeClickHandler() {
_parent.UpdateProgress();
_root.PlaySound(_root.SND_CUT, false, false);
var _local4 = _parent.greenOnionCore[_parent.numRepeatCount];
var _local5 = MovieClip(this);
var _local3 = 1;
while (_local3 <= _local5.numClicksDone) {
_local4["GreenOnionSlice" + _local3]._x = _local4["GreenOnionSlice" + _local3]._x + 3;
_local3++;
}
if (_local5.numClicksDone >= _local5.numClicksReq) {
_visible = false;
_parent.tweensObj.tween = new mx.transitions.Tween(_local4, "_x", mx.transitions.easing.None.easeNone, _local4._x, -_local4._width, 12, false);
var _local6 = mx.utils.Delegate.create(this, _parent.GreenOnionTweenFinishHandler);
_parent.tweensObj.tween.onMotionFinished = _local6;
_parent.numRepeatCount++;
if (_parent.numRepeatCount <= _parent.maxRepeatCount) {
_parent.greenOnionCore[_parent.numRepeatCount] = _parent.attachMovie("GreenOnionCore", "GreenOnionCoreMC" + _parent.numRepeatCount, _parent.getNextHighestDepth(), {_x:Stage.width, _y:180});
_local4 = _parent.greenOnionCore[_parent.numRepeatCount];
_parent.tweensObj["tween" + _parent.numRepeatCount] = new mx.transitions.Tween(_local4, "_x", mx.transitions.easing.None.easeNone, _local4._x, 40, 12, false);
_visible = true;
_parent.knifeMC.Init(_parent.knifeXPos, _parent.knifeYPos, _parent.numClicksReq, _parent.gapBetweenTwoClicks);
_parent.knifeMC.swapDepths(_parent.greenOnionCore[_parent.numRepeatCount]);
}
}
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
function GreenOnionTweenFinishHandler() {
if (_parent.numRepeatCount > _parent.maxRepeatCount) {
_root.ShowFinishedMC();
}
}
var mProgress = 0;
}
Symbol 1220 MovieClip [__Packages.Progress] Frame 0
class Progress extends MovieClip
{
var goodProgress, badProgress;
function Progress () {
super();
mx.events.EventDispatcher.initialize(this);
goodProgress = 0;
badProgress = 0;
var _local3 = MovieClip(this);
_local3.GoodProgressMask.baseX = _local3.GoodProgressMask._x;
_local3.BadProgressMask.baseX = _local3.BadProgressMask._x;
}
function dispatchEvent() {
}
function Update(newGoodProgress, newBadProgress) {
var _local2 = this;
var _local3;
if (goodProgress != newGoodProgress) {
_local3 = _local2.GoodProgressMask.baseX + ((_local2.GoodProgressMask._width * newGoodProgress) / 100);
var _local6 = new mx.transitions.Tween(_local2.GoodProgressMask, "_x", mx.transitions.easing.None.easeNone, _local2.GoodProgressMask._x, _local3, 6, false);
goodProgress = newGoodProgress;
} else if (badProgress != newBadProgress) {
_local3 = _local2.BadProgressMask.baseX - ((_local2.BadProgressMask._width * newBadProgress) / 100);
var _local6 = new mx.transitions.Tween(_local2.BadProgressMask, "_x", mx.transitions.easing.None.easeNone, _local2.BadProgressMask._x, _local3, 6, false);
badProgress = newBadProgress;
}
}
function ResetProgress() {
var _local2 = this;
_local2.GoodProgressMask._x = _local2.GoodProgressMask.baseX;
_local2.BadProgressMask._x = _local2.BadProgressMask.baseX;
goodProgress = 0;
badProgress = 0;
}
}
Symbol 1221 MovieClip [__Packages.DoughSlice] Frame 0
class DoughSlice extends MovieClip
{
var firstTime, doughSliceCore, numRepeatCount, arrowPathInfoArray, tweensObj, maxRepeatCount, mTotalSubSteps, currentArrowPathIndex, mSubStepsCompleted, calloutMC, attachMovie, getNextHighestDepth, arrowPathMC, onMouseDown, onMouseUp, _parent;
function DoughSlice () {
super();
firstTime = true;
var _local7 = MovieClip(this);
mx.events.EventDispatcher.initialize(this);
doughSliceCore = new Array();
numRepeatCount = 1;
arrowPathInfoArray = new Array();
arrowPathInfoArray[0] = {xPos:260, yPos:160, arrowLength:330, createTail:false, arrowRotation:360};
arrowPathInfoArray[1] = {xPos:260, yPos:240, arrowLength:330, createTail:false, arrowRotation:360};
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init(newMaxRepeatCount) {
maxRepeatCount = newMaxRepeatCount;
mTotalSubSteps = arrowPathInfoArray.length * maxRepeatCount;
currentArrowPathIndex = 0;
mSubStepsCompleted = 0;
CreateDoughCoreMC();
CreateArrowPath();
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
}
function GoMCCompleteHandler(arrowPathMC) {
arrowPathMC._visible = true;
}
function CreateDoughCoreMC() {
doughSliceCore[numRepeatCount] = attachMovie("DoughSliceCore", "DoughSliceCoreMC" + numRepeatCount, getNextHighestDepth(), {_x:Stage.width, _y:85});
var _local2 = doughSliceCore[numRepeatCount];
trace("Dough Y-" + doughSliceCore[numRepeatCount]._y);
doughSliceCore[numRepeatCount]._width = 319.16;
doughSliceCore[numRepeatCount]._y = 78;
tweensObj["tween" + numRepeatCount] = new mx.transitions.Tween(_local2, "_x", mx.transitions.easing.None.easeNone, _local2._x, 100, 12, false);
var _local3 = mx.utils.Delegate.create(this, DoughInitTweenFinishHandler);
tweensObj["tween" + numRepeatCount].onMotionFinished = _local3;
}
function DoughInitTweenFinishHandler() {
if (firstTime) {
_root.ShowGoMC(GoMCCompleteHandler, arrowPathMC);
firstTime = false;
} else {
arrowPathMC._visible = true;
}
}
function CreateArrowPath() {
arrowPathMC = attachMovie("Arrow", "ArrowMC" + currentArrowPathIndex, getNextHighestDepth());
arrowPathMC.addEventListener(arrowPathMC.PATH_TRACE_COMPLETE, ArrowPathTraceCompleteHandler);
arrowPathMC.Init(arrowPathInfoArray[currentArrowPathIndex].arrowLength, arrowPathInfoArray[currentArrowPathIndex].createTail, arrowPathInfoArray[currentArrowPathIndex].arrowRotation, arrowPathInfoArray[currentArrowPathIndex].xPos, arrowPathInfoArray[currentArrowPathIndex].yPos);
if (currentArrowPathIndex == 0) {
arrowPathMC._visible = false;
}
onMouseDown = ArrowOnPressHandler;
onMouseUp = ArrowOnReleaseHandler;
}
function ArrowOnPressHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_KNIFE);
}
function ArrowOnReleaseHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function ArrowPathTraceCompleteHandler() {
var _local2 = _parent.doughSliceCore[_parent.numRepeatCount];
if (_parent.currentArrowPathIndex == 0) {
_local2.DoughStripMC1._y = _local2.DoughStripMC1._y - 15;
} else if (_parent.currentArrowPathIndex == 1) {
_local2.DoughStripMC3._y = _local2.DoughStripMC3._y + 15;
}
_parent.currentArrowPathIndex++;
_parent.UpdateProgress();
if (_parent.currentArrowPathIndex >= _parent.arrowPathInfoArray.length) {
_parent.tweensObj.tween = new mx.transitions.Tween(_local2, "_x", mx.transitions.easing.None.easeNone, _local2._x, -_local2._width, 12, false);
var _local3 = mx.utils.Delegate.create(_parent, _parent.DoughTweenFinishHandler);
_parent.tweensObj.tween.onMotionFinished = _local3;
_parent.numRepeatCount++;
if (_parent.numRepeatCount <= _parent.maxRepeatCount) {
_parent.currentArrowPathIndex = 0;
_parent.CreateDoughCoreMC();
_parent.CreateArrowPath();
}
} else {
_parent.CreateArrowPath();
}
MovieClip(this).RemoveMovieClip();
}
function DoughTweenFinishHandler() {
if (numRepeatCount > maxRepeatCount) {
_root.ShowFinishedMC();
}
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
_root.PlaySound(_root.SND_CUT, false, false);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
function TimeUpHandler() {
arrowPathMC.RemoveMovieClip();
}
var mProgress = 0;
}
Symbol 1222 MovieClip [__Packages.BaguetteSlice] Frame 0
class BaguetteSlice extends MovieClip
{
var firstTime, baguetteSliceCore, numRepeatCount, arrowPathInfoArray, tweensObj, maxRepeatCount, mTotalSubSteps, currentArrowPathIndex, mSubStepsCompleted, calloutMC, attachMovie, getNextHighestDepth, arrowPathMC, onMouseDown, onMouseUp, _parent, _x;
function BaguetteSlice () {
super();
firstTime = true;
var _local9 = MovieClip(this);
mx.events.EventDispatcher.initialize(this);
baguetteSliceCore = new Array();
numRepeatCount = 1;
arrowPathInfoArray = new Array();
arrowPathInfoArray[0] = {xPos:335, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC1"};
arrowPathInfoArray[1] = {xPos:318, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC2"};
arrowPathInfoArray[2] = {xPos:298, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC3"};
arrowPathInfoArray[3] = {xPos:278, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC4"};
arrowPathInfoArray[4] = {xPos:258, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC5"};
arrowPathInfoArray[5] = {xPos:238, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC6"};
arrowPathInfoArray[6] = {xPos:218, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC7"};
arrowPathInfoArray[7] = {xPos:198, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC8"};
arrowPathInfoArray[8] = {xPos:178, yPos:210, arrowLength:100, createTail:false, arrowRotation:90, sliceMC:"BaguetteSliceMC9", sliceMC2:"BaguetteSliceMC10"};
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init(newMaxRepeatCount) {
maxRepeatCount = newMaxRepeatCount;
mTotalSubSteps = arrowPathInfoArray.length * maxRepeatCount;
currentArrowPathIndex = 0;
mSubStepsCompleted = 0;
CreateBaguetteCoreMC();
CreateArrowPath();
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
}
function GoMCCompleteHandler(arrowPathMC) {
arrowPathMC._visible = true;
}
function CreateBaguetteCoreMC() {
baguetteSliceCore[numRepeatCount] = attachMovie("BaguetteSliceCore", "BaguetteSliceCoreMC" + numRepeatCount, getNextHighestDepth(), {_x:Stage.width, _y:180});
var _local3 = baguetteSliceCore[numRepeatCount];
var _local2 = 0;
while (_local2 < arrowPathInfoArray.length) {
_local3[arrowPathInfoArray[_local2].sliceMC]._visible = false;
if (_local2 == (arrowPathInfoArray.length - 1)) {
_local3[arrowPathInfoArray[_local2].sliceMC2]._visible = false;
}
_local2++;
}
tweensObj["tween" + numRepeatCount] = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.None.easeNone, _local3._x, 160, 12, false);
var _local4 = mx.utils.Delegate.create(this, BaguetteInitTweenFinishHandler);
tweensObj["tween" + numRepeatCount].onMotionFinished = _local4;
}
function BaguetteInitTweenFinishHandler() {
if (firstTime) {
_root.ShowGoMC(GoMCCompleteHandler, arrowPathMC);
firstTime = false;
} else {
arrowPathMC._visible = true;
}
}
function CreateArrowPath() {
arrowPathMC = attachMovie("Arrow", "ArrowMC" + currentArrowPathIndex, getNextHighestDepth());
arrowPathMC.addEventListener(arrowPathMC.PATH_TRACE_COMPLETE, ArrowPathTraceCompleteHandler);
arrowPathMC.Init(arrowPathInfoArray[currentArrowPathIndex].arrowLength, arrowPathInfoArray[currentArrowPathIndex].createTail, arrowPathInfoArray[currentArrowPathIndex].arrowRotation, arrowPathInfoArray[currentArrowPathIndex].xPos, arrowPathInfoArray[currentArrowPathIndex].yPos);
if (currentArrowPathIndex == 0) {
arrowPathMC._visible = false;
}
onMouseDown = ArrowOnPressHandler;
onMouseUp = ArrowOnReleaseHandler;
}
function ArrowOnPressHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_KNIFE);
}
function ArrowOnReleaseHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function ArrowPathTraceCompleteHandler() {
var _local3 = _parent.baguetteSliceCore[_parent.numRepeatCount];
_local3.BaguetteLoafMaskMC._x = _local3.BaguetteLoafMaskMC._x - 20;
var _local4 = _parent.currentArrowPathIndex;
_local3[_parent.arrowPathInfoArray[_local4].sliceMC]._visible = true;
trace((_local3 + " ArrowPathTraceCompleteHandler ") + _parent.arrowPathInfoArray[_local4].sliceMC);
_parent.currentArrowPathIndex++;
_parent.UpdateProgress();
if (_parent.currentArrowPathIndex >= _parent.arrowPathInfoArray.length) {
_local3.BaguetteLoafMaskMC._x = _local3.BaguetteLoafMaskMC._x - 20;
_local3[_parent.arrowPathInfoArray[_local4].sliceMC2]._visible = true;
_parent.tweensObj.waitTween = new mx.transitions.Tween(this, "_x", mx.transitions.easing.None.easeNone, _x, _x, 12, false);
_parent.tweensObj.waitTween.onMotionChanged = function () {
if (_root.isGamePaused) {
this.stop();
} else {
this.resume();
}
};
var _local5 = mx.utils.Delegate.create(this, _parent.BaguetteSliceCompleteWaitTweenHandler);
_parent.tweensObj.waitTween.onMotionFinished = _local5;
MovieClip(this)._visible = false;
} else {
_parent.CreateArrowPath();
MovieClip(this).RemoveMovieClip();
}
}
function BaguetteSliceCompleteWaitTweenHandler() {
var _local2 = _parent.baguetteSliceCore[_parent.numRepeatCount];
_parent.tweensObj.tween = new mx.transitions.Tween(_local2, "_x", mx.transitions.easing.None.easeNone, _local2._x, -_local2._width, 12, false);
var _local3 = mx.utils.Delegate.create(_parent, _parent.BaguetteTweenFinishHandler);
_parent.tweensObj.tween.onMotionFinished = _local3;
_parent.numRepeatCount++;
if (_parent.numRepeatCount <= _parent.maxRepeatCount) {
_parent.currentArrowPathIndex = 0;
_parent.CreateBaguetteCoreMC();
_parent.CreateArrowPath();
}
MovieClip(this).RemoveMovieClip();
}
function BaguetteTweenFinishHandler() {
if (numRepeatCount > maxRepeatCount) {
_root.ShowFinishedMC();
}
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
_root.PlaySound(_root.SND_CUT, false, false);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
var mProgress = 0;
}
Symbol 1223 MovieClip [__Packages.OnionDice] Frame 0
class OnionDice extends MovieClip
{
var firstTime, onionDiceCore, numRepeatCount, arrowPathInfoArray, tweensObj, maxRepeatCount, mTotalSubSteps, currentArrowPathIndex, mSubStepsCompleted, calloutMC, attachMovie, getNextHighestDepth, onMouseDown, onMouseUp, arrowPathMC, _parent, knifeMC;
function OnionDice () {
super();
firstTime = true;
var _local7 = MovieClip(this);
mx.events.EventDispatcher.initialize(this);
onionDiceCore = new Array();
numRepeatCount = 1;
arrowPathInfoArray = new Array();
arrowPathInfoArray[0] = {xPos:270, yPos:152, arrowLength:100, createTail:false, arrowRotation:360};
arrowPathInfoArray[1] = {xPos:265, yPos:255, arrowLength:100, createTail:false, arrowRotation:360};
arrowPathInfoArray[2] = {xPos:310, yPos:202, arrowLength:115, createTail:false, arrowRotation:90};
arrowPathInfoArray[3] = {xPos:300, yPos:204, arrowLength:130, createTail:false, arrowRotation:90};
arrowPathInfoArray[4] = {xPos:285, yPos:204, arrowLength:130, createTail:false, arrowRotation:90};
arrowPathInfoArray[5] = {xPos:270, yPos:204, arrowLength:130, createTail:false, arrowRotation:90};
arrowPathInfoArray[6] = {xPos:255, yPos:204, arrowLength:130, createTail:false, arrowRotation:90};
arrowPathInfoArray[7] = {xPos:240, yPos:204, arrowLength:130, createTail:false, arrowRotation:90};
arrowPathInfoArray[8] = {xPos:225, yPos:204, arrowLength:130, createTail:false, arrowRotation:90};
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init(newMaxRepeatCount) {
maxRepeatCount = newMaxRepeatCount;
mTotalSubSteps = arrowPathInfoArray.length + NUM_CLICKS_REQ;
mTotalSubSteps = mTotalSubSteps * maxRepeatCount;
currentArrowPathIndex = 0;
mSubStepsCompleted = 0;
CreateOnionDiceCoreMC();
CreateArrowPath();
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
}
function GoMCCompleteHandler(arrowPathMC) {
arrowPathMC._visible = true;
}
function CreateOnionDiceCoreMC() {
onionDiceCore[numRepeatCount] = attachMovie("OnionDiceCore", "OnionDiceCoreMC" + numRepeatCount, getNextHighestDepth(), {_x:Stage.width, _y:120});
var _local2 = onionDiceCore[numRepeatCount];
_local2.OnionSliced.setMask(_local2.OnionSlicedMaskMC);
tweensObj["tween" + numRepeatCount] = new mx.transitions.Tween(_local2, "_x", mx.transitions.easing.None.easeNone, _local2._x, 200, 12, false);
var _local3 = mx.utils.Delegate.create(this, OnionDiceInitTweenFinishHandler);
tweensObj["tween" + numRepeatCount].onMotionFinished = _local3;
onMouseDown = ArrowOnPressHandler;
onMouseUp = ArrowOnReleaseHandler;
}
function CreateArrowPath() {
arrowPathMC = attachMovie("Arrow", "ArrowMC" + currentArrowPathIndex, getNextHighestDepth());
arrowPathMC.addEventListener(arrowPathMC.PATH_TRACE_COMPLETE, ArrowPathTraceCompleteHandler);
arrowPathMC.Init(arrowPathInfoArray[currentArrowPathIndex].arrowLength, arrowPathInfoArray[currentArrowPathIndex].createTail, arrowPathInfoArray[currentArrowPathIndex].arrowRotation, arrowPathInfoArray[currentArrowPathIndex].xPos, arrowPathInfoArray[currentArrowPathIndex].yPos, true);
if (currentArrowPathIndex < 3) {
arrowPathMC._visible = false;
}
trace((("ArrowPathXY-" + arrowPathMC._x) + ",") + arrowPathMC._y);
}
function ArrowPathTraceCompleteHandler() {
var _local2 = _parent;
var _local3 = _local2.onionDiceCore[_local2.numRepeatCount];
_local2.currentArrowPathIndex++;
_local2.UpdateProgress();
if (_local2.currentArrowPathIndex == 1) {
_local2.tweensObj.onionTopTween = new mx.transitions.Tween(_local3.OnionTop, "_x", mx.transitions.easing.None.easeNone, _local3.OnionTop._x, -(_local3._x + _local3.OnionTop._width), 12, false);
_local2.CreateArrowPath();
var _local4 = mx.utils.Delegate.create(_parent, _local2.OnionDiceInitTweenFinishHandler);
_local2.tweensObj.onionTopTween.onMotionFinished = _local4;
} else if (_local2.currentArrowPathIndex == 2) {
_local2.tweensObj.onionBottomTween = new mx.transitions.Tween(_local3.OnionBottom, "_x", mx.transitions.easing.None.easeNone, _local3.OnionBottom._x, -(_local3._x + _local3.OnionBottom._width), 12, false);
_local2.CreateArrowPath();
var _local4 = mx.utils.Delegate.create(_parent, _local2.OnionDiceInitTweenFinishHandler);
_local2.tweensObj.onionBottomTween.onMotionFinished = _local4;
} else if (_local2.currentArrowPathIndex >= 3) {
_local3.OnionBaseMaskMC._x = _local3.OnionBaseMaskMC._x - 16.4;
_local3.OnionSlicedMaskMC._x = _local3.OnionSlicedMaskMC._x - 16.4;
if (_local2.currentArrowPathIndex >= _local2.arrowPathInfoArray.length) {
_local3.OnionBase._visible = false;
_local2.StartThirdSection();
} else {
_local2.CreateArrowPath();
}
}
MovieClip(this).RemoveMovieClip();
}
function OnionDiceInitTweenFinishHandler() {
if (firstTime) {
_root.ShowGoMC(GoMCCompleteHandler, arrowPathMC);
firstTime = false;
} else {
arrowPathMC._visible = true;
}
}
function OnionDiceTweenFinishHandler() {
if (numRepeatCount > maxRepeatCount) {
_root.ShowFinishedMC();
}
}
function StartThirdSection() {
var _local2 = onionDiceCore[numRepeatCount];
_local2.OnionSlicedMaskMC._rotation = 90;
_local2.OnionSlicedMaskMC._x = _local2.OnionSlicedMaskMC._width + 4;
_local2.OnionSlicedMaskMC._y = 14;
tweensObj.onionSliceTween = new mx.transitions.Tween(_local2.OnionSliced, "_rotation", mx.transitions.easing.None.easeNone, _local2.OnionSliced._rotation, 90, 12, false);
onMouseDown = undefined;
onMouseUp = undefined;
ArrowOnReleaseHandler();
knifeMC = attachMovie("Knife", "KnifeMC", getNextHighestDepth(), {_x:0, _y:0});
var _local3 = 295;
var _local4 = 100;
var _local5 = NUM_CLICKS_REQ;
var _local6 = -12;
knifeMC.Init(_local3, _local4, _local5, _local6);
knifeMC.addEventListener(Knife.MOUSECLICK, KnifeClickHandler);
}
function KnifeClickHandler() {
var _local5 = MovieClip(this);
var _local4 = _parent;
var _local3 = _local4.onionDiceCore[_local4.numRepeatCount];
_local4.UpdateProgress();
_local3.OnionDicedMaskMC._x = _local3.OnionDicedMaskMC._x - 12;
_local3.OnionSlicedMaskMC._x = _local3.OnionSlicedMaskMC._x - 12;
if (_local5.numClicksDone >= _local5.numClicksReq) {
_local3.OnionDicedMaskMC._x = _local3.OnionDicedMaskMC._x - 48;
_local3.OnionSlicedMaskMC._x = _local3.OnionSlicedMaskMC._x - 48;
_local4.tweensObj.waitTween = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.None.easeNone, _local3._x, _local3._x, 12, false);
_local4.tweensObj.waitTween.onMotionChanged = function () {
if (_root.isGamePaused) {
this.stop();
} else {
this.resume();
}
};
var _local6 = mx.utils.Delegate.create(this, _local4.OnionDiceCompleteWaitTweenHandler);
_local4.tweensObj.waitTween.onMotionFinished = _local6;
_local5._visible = false;
}
}
function OnionDiceCompleteWaitTweenHandler() {
var _local5 = MovieClip(this);
var _local2 = _parent;
var _local3 = _local2.onionDiceCore[_local2.numRepeatCount];
_local2.tweensObj.tween = new mx.transitions.Tween(_local3, "_x", mx.transitions.easing.None.easeNone, _local3._x, -_local3._width, 12, false);
var _local4 = mx.utils.Delegate.create(_local2, _local2.OnionDiceTweenFinishHandler);
_local2.tweensObj.tween.onMotionFinished = _local4;
_local2.numRepeatCount++;
if (_local2.numRepeatCount <= _local2.maxRepeatCount) {
_local2.currentArrowPathIndex = 0;
_local2.CreateOnionDiceCoreMC();
_local2.CreateArrowPath();
}
_local5.RemoveMovieClip();
}
function ArrowOnPressHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_KNIFE);
}
function ArrowOnReleaseHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
_root.PlaySound(_root.SND_CUT, false, false);
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
var mProgress = 0;
static var NUM_CLICKS_REQ = 8;
}
Symbol 1224 MovieClip [__Packages.AvocadoSlice] Frame 0
class AvocadoSlice extends MovieClip
{
var firstTime, avocadoSliceCore, numRepeatCount, arrowPathInfoArray, tweensObj, maxRepeatCount, mTotalSubSteps, mSubStepsCompleted, onEnterFrame, monitorEnterFrame, createNewAvocadoCoreMCCounter, calloutMC, onMouseDown, onMouseUp, attachMovie, getNextHighestDepth, _parent, swapDepths, removeMovieClip, knifeTopMC, circleMC, _visible, currentArrowPathIndex, arrowPathMC;
function AvocadoSlice () {
super();
firstTime = true;
mx.events.EventDispatcher.initialize(this);
avocadoSliceCore = new Array();
numRepeatCount = 1;
arrowPathInfoArray = new Array();
arrowPathInfoArray[0] = {xPos:270, yPos:193, arrowLength:176, createTail:false, arrowRotation:90, sliceMC:"AvocadoSliceMC1"};
arrowPathInfoArray[1] = {xPos:255, yPos:192, arrowLength:198, createTail:false, arrowRotation:90, sliceMC:"AvocadoSliceMC2"};
arrowPathInfoArray[2] = {xPos:240, yPos:188, arrowLength:202, createTail:false, arrowRotation:90, sliceMC:"AvocadoSliceMC3"};
arrowPathInfoArray[3] = {xPos:225, yPos:192, arrowLength:195, createTail:false, arrowRotation:90, sliceMC:"AvocadoSliceMC4"};
arrowPathInfoArray[4] = {xPos:210, yPos:195, arrowLength:180, createTail:false, arrowRotation:90, sliceMC:"AvocadoSliceMC5"};
arrowPathInfoArray[5] = {xPos:195, yPos:205, arrowLength:140, createTail:false, arrowRotation:90, sliceMC:"AvocadoSliceMC6", sliceMC2:"AvocadoSliceMC7"};
tweensObj = new Object();
}
function dispatchEvent() {
}
function Init(newMaxRepeatCount) {
maxRepeatCount = newMaxRepeatCount;
mTotalSubSteps = (4 + arrowPathInfoArray.length) * maxRepeatCount;
mSubStepsCompleted = 0;
onEnterFrame = OnEnterFrameHandler;
monitorEnterFrame = false;
createNewAvocadoCoreMCCounter = -1;
calloutMC = _root.CreateCalloutMC(this, _root.recipeInfo[_root.selectedRecipeName][_root.currentStepNo].stepTitle, _root.MINIGAME_CALLOUT_WIDTH, Callout.CALLOUT_CHEF, _root.MINIGAME_CALLOUT_XPOS, _root.MINIGAME_CALLOUT_YPOS);
CreateAvocadoSliceCoreMC();
}
function CreateAvocadoSliceCoreMC() {
ArrowOnReleaseHandler();
onMouseDown = undefined;
onMouseUp = undefined;
avocadoSliceCore[numRepeatCount] = attachMovie("AvocadoSliceCore", "AvocadoSliceCoreMC", getNextHighestDepth(), {_x:180, _y:100});
var _local2 = avocadoSliceCore[numRepeatCount];
_local2.AvocadoMC._y = 88.5;
tweensObj.avocadoTween = new mx.transitions.Tween(_local2.AvocadoMC, "_x", mx.transitions.easing.None.easeNone, Stage.width, 58, 12, false);
var _local3 = mx.utils.Delegate.create(this, AvocadeTweenFinishHandler);
tweensObj.avocadoTween.onMotionFinished = _local3;
}
function AvocadeTweenFinishHandler() {
var _local2 = avocadoSliceCore[numRepeatCount];
_local2.KnifeSideMC._x = 135;
tweensObj.knifeSideTween = new mx.transitions.Tween(_local2.KnifeSideMC, "_y", mx.transitions.easing.None.easeNone, Stage.height, 0, 8, false);
var _local3 = mx.utils.Delegate.create(this, KnifeSideTweenFinishHandler);
tweensObj.knifeSideTween.onMotionFinished = _local3;
}
function KnifeSideTweenFinishHandler() {
var _local3 = avocadoSliceCore[numRepeatCount];
_local3.KnifeSideMC.Init(50);
_local3.KnifeSideMC.addEventListener(KnifeSide.KNIFE_SIDE_ONPRESS, KnifeSideOnPressHandler);
_local3.KnifeSideMC.addEventListener(KnifeSide.KNIFE_SIDE_DONE_EVENT, KnifeSideDoneHandler);
_local3.ArrowBlueMC._x = _local3.ArrowBlueMC._x + 20;
_local3.ArrowBlueMC._y = _local3.ArrowBlueMC._y + 20;
_local3.ArrowBlueMC.Init(60, true, 180);
_local3.ArrowBlueMC._visible = true;
if (firstTime) {
_local3.ArrowBlueMC._visible = false;
_root.ShowGoMC(GoMCCompleteHandler, _local3.ArrowBlueMC);
firstTime = false;
}
}
function GoMCCompleteHandler(arrowMC) {
arrowMC._visible = true;
}
function KnifeSideOnPressHandler() {
_parent._parent.avocadoSliceCore[_parent._parent.numRepeatCount].ArrowBlueMC._visible = false;
}
function KnifeSideDoneHandler() {
_parent._parent.UpdateProgress();
_root.PlaySound(_root.SND_CUT, false, false);
_parent._parent.circleMC = _parent._parent.attachMovie("Circle", "CircleMC1", _parent._parent.getNextHighestDepth(), {_x:240, _y:190});
_parent._parent.circleMC.Init(Circle.FLIP_NONE);
_parent._parent.circleMC.CreateRedCursor();
_parent._parent.circleMC.addEventListener(_parent._parent.circleMC.PATH_TRACE_COMPLETE, _parent._parent.CircleMC1TraceCompleteHandle);
}
function CircleMC1TraceCompleteHandle() {
_parent.UpdateProgress();
var _local2 = _parent.avocadoSliceCore[_parent.numRepeatCount];
_local2.gotoAndPlay("FrameAvocadoSliceAvocadoRoll");
_parent.monitorEnterFrame = true;
swapDepths(_parent.getNextHighestDepth());
removeMovieClip();
_parent.circleMC = undefined;
}
function AvocadoPitMCOnPressHandler() {
_root.RemoveHintArrow();
_root.PlaySound(_root.SND_CUT, false, false);
_parent._parent.CreateAndMoveKnifeTopAndPitMC();
}
function CreateAndMoveKnifeTopAndPitMC() {
knifeTopMC = attachMovie("Knife", "KnifeTopMC", getNextHighestDepth());
knifeTopMC.Init(220, 120, 1, 1);
UpdateProgress();
var _local2 = avocadoSliceCore[numRepeatCount];
tweensObj.avocadoPitTween = new mx.transitions.Tween(_local2.PitMC, "_x", mx.transitions.easing.None.easeNone, _local2.PitMC._x, -(_local2._x + _local2.PitMC._width), 8, false);
tweensObj.knifeTopTween = new mx.transitions.Tween(knifeTopMC, "_x", mx.transitions.easing.None.easeNone, knifeTopMC._x, -knifeTopMC._width, 8, false);
var _local3 = mx.utils.Delegate.create(this, KnifeTopTweenFinishHandler);
tweensObj.knifeTopTween.onMotionFinished = _local3;
}
function KnifeTopTweenFinishHandler() {
var _local2 = avocadoSliceCore[numRepeatCount];
tweensObj.spoonTween = new mx.transitions.Tween(_local2.SpoonMC, "_x", mx.transitions.easing.None.easeNone, _local2.SpoonMC._x, 72.3, 8, false);
var _local3 = mx.utils.Delegate.create(this, SpoonTweenFinishHandler);
tweensObj.spoonTween.onMotionFinished = _local3;
}
function SpoonTweenFinishHandler() {
circleMC = attachMovie("Circle", "CircleMC2", getNextHighestDepth(), {_x:240, _y:190});
circleMC.Init(Circle.FLIP_BOTH);
circleMC.CreateRedCursor();
circleMC.addEventListener(circleMC.PATH_TRACE_COMPLETE, CircleMC2TraceCompleteHandle);
}
function CircleMC2TraceCompleteHandle() {
_parent.UpdateProgress();
_visible = false;
var _local2 = _parent.avocadoSliceCore[_parent.numRepeatCount];
_local2.gotoAndPlay("FrameAvocadoSliceSpoonRoll");
_parent.monitorEnterFrame = true;
}
function AvocadoShellTweenFinishHandler() {
var _local2 = avocadoSliceCore[numRepeatCount];
_local2.gotoAndPlay(FRAMENO_AVOCADO_SLICE_HALF2_FADE);
monitorEnterFrame = true;
}
function OnEnterFrameHandler() {
if (_root.isGamePaused) {
return(undefined);
}
var _local4 = avocadoSliceCore[numRepeatCount];
if (createNewAvocadoCoreMCCounter != -1) {
trace("countdown started " + createNewAvocadoCoreMCCounter);
createNewAvocadoCoreMCCounter--;
if (createNewAvocadoCoreMCCounter == 0) {
tweensObj.tween = new mx.transitions.Tween(_local4, "_x", mx.transitions.easing.None.easeNone, _local4._x, -_local4._width, 12, false);
var _local5 = mx.utils.Delegate.create(this, AvocadeCoreTweenFinishHandler);
tweensObj.tween.onMotionFinished = _local5;
numRepeatCount++;
if (numRepeatCount <= maxRepeatCount) {
currentArrowPathIndex = 0;
CreateAvocadoSliceCoreMC();
}
createNewAvocadoCoreMCCounter = -1;
}
}
if (!monitorEnterFrame) {
return(undefined);
}
if (_local4._currentframe == FRAMENO_AVOCADO_SLICE_PIT) {
monitorEnterFrame = false;
_root.ShowHintArrow(_root.HINT_ARROW_DOWN, 220, 140);
_local4.PitMC.onPress = AvocadoPitMCOnPressHandler;
} else if (_local4._currentframe == FRAMENO_AVOCADO_SLICE_SPOON_ROLLEND) {
monitorEnterFrame = false;
circleMC.swapDepths(getNextHighestDepth());
circleMC.removeMovieClip();
tweensObj.avocadoSpoonTween = new mx.transitions.Tween(_local4.SpoonMC, "_x", mx.transitions.easing.None.easeNone, _local4.SpoonMC._x, (Stage.width + _local4.SpoonMC._width) + 100, 12, false);
tweensObj.avocadoShell = new mx.transitions.Tween(_local4.AvocadoShellMC, "_x", mx.transitions.easing.None.easeNone, _local4.AvocadoShellMC._x, -((_local4._x + _local4.AvocadoShellMC._width) + 100), 12, false);
var _local6 = mx.utils.Delegate.create(this, AvocadoShellTweenFinishHandler);
tweensObj.avocadoShell.onMotionFinished = _local6;
} else if (_local4._currentframe == FRAMENO_AVOCADO_SLICE_END) {
monitorEnterFrame = false;
var _local3 = 0;
while (_local3 <= 7) {
_local4["AvocadoSliceMC" + _local3]._visible = false;
if (_local3 == (arrowPathInfoArray.length - 1)) {
_local4[arrowPathInfoArray[_local3].sliceMC2]._visible = false;
}
_local3++;
}
currentArrowPathIndex = 0;
CreateArrowPath();
}
}
function CreateArrowPath() {
arrowPathMC = attachMovie("Arrow", "ArrowMC" + currentArrowPathIndex, getNextHighestDepth());
arrowPathMC.addEventListener(arrowPathMC.PATH_TRACE_COMPLETE, ArrowPathTraceCompleteHandler);
arrowPathMC.Init(arrowPathInfoArray[currentArrowPathIndex].arrowLength, arrowPathInfoArray[currentArrowPathIndex].createTail, arrowPathInfoArray[currentArrowPathIndex].arrowRotation, arrowPathInfoArray[currentArrowPathIndex].xPos, arrowPathInfoArray[currentArrowPathIndex].yPos);
onMouseDown = ArrowOnPressHandler;
onMouseUp = ArrowOnReleaseHandler;
}
function ArrowOnPressHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_KNIFE);
}
function ArrowOnReleaseHandler() {
_root.mouseMC.gotoAndStop(_root.FRAME_MOUSEMC_POINTER);
}
function ArrowPathTraceCompleteHandler() {
var _local3 = _parent.avocadoSliceCore[_parent.numRepeatCount];
_local3.AvocadoHalf2MaskMC._x = _local3.AvocadoHalf2MaskMC._x - 17;
var _local4 = _parent.currentArrowPathIndex;
_local3[_parent.arrowPathInfoArray[_local4].sliceMC]._visible = true;
if (_local4 == (_parent.arrowPathInfoArray.length - 1)) {
_local3[_parent.arrowPathInfoArray[_local4].sliceMC2]._visible = true;
_local3.AvocadoHalf2MaskMC._x = _local3.AvocadoHalf2MaskMC._x - 100;
}
_parent.currentArrowPathIndex++;
_parent.UpdateProgress();
_root.PlaySound(_root.SND_CUT, false, false);
if (_parent.currentArrowPathIndex >= _parent.arrowPathInfoArray.length) {
_parent.createNewAvocadoCoreMCCounter = 10;
trace("countdown set to " + _parent.createNewAvocadoCoreMCCounter);
} else {
_parent.CreateArrowPath();
}
MovieClip(this).RemoveMovieClip();
}
function AvocadeCoreTweenFinishHandler() {
trace("AvocadeCoreTweenFinishHandler " + this);
if (numRepeatCount > maxRepeatCount) {
_root.ShowFinishedMC();
}
}
function UpdateProgress() {
if (_root.isTimeUp) {
return(undefined);
}
mSubStepsCompleted++;
mProgress = (mSubStepsCompleted / mTotalSubSteps) * 100;
dispatchEvent({type:_root.EVENT_PROGRESS_UPDATE, target:this});
}
var mProgress = 0;
static var FRAMENO_AVOCADO_SLICE_START = 1;
static var FRAMENO_AVOCADO_SLICE_AVOCADO_ROLL = 2;
static var FRAMENO_AVOCADO_SLICE_PIT = 28;
static var FRAMENO_AVOCADO_SLICE_SPOON_ROLL = 29;
static var FRAMENO_AVOCADO_SLICE_SPOON_ROLLEND = 61;
static var FRAMENO_AVOCADO_SLICE_HALF2_FADE = 62;
static var FRAMENO_AVOCADO_SLICE_END = 68;
}
Symbol 1157 MovieClip Frame 1
stop();