Frame 1
if (_framesloaded >= 2) {
nextFrame();
}
Frame 2
Object.prototype.gameTimeline = this;
gGameID = "ScoobySnack";
function update() {
mcScreen.mcLoading.gotoAndStop(nFakePc + 1);
}
Stage.showMenu = false;
_focusrect = false;
stop();
var MAX_LOAD_SPEED = 3;
var TARGET_LABEL = "start";
var nFakePc = 0;
var nPc;
var sPc;
var nFrame;
this.onEnterFrame = function () {
var _local2 = getBytesLoaded() / getBytesTotal();
nPc = Math.floor(_local2 * 100);
nFakePc = nFakePc + MAX_LOAD_SPEED;
if (nFakePc > nPc) {
nFakePc = nPc;
}
update();
if (nFakePc == 100) {
delete this.onEnterFrame;
gotoAndStop(TARGET_LABEL);
}
};
Frame 11
GC = new HighScore.BaseGameController(this);
GC.start();
_global.GC = GC;
play();
stop();
new Main(this);
Frame 21
play();
Frame 22
GC.title();
stop();
_global.HS_Score = 0;
_global.HS_Level = 1;
Frame 31
GC.instructions();
Frame 32
stop();
Frame 41
GC.play();
play();
Frame 42
if (Game.__get__Instance() == undefined) {
GC.levelStart(_global.HS_Level, _global.HS_Score);
}
Frame 43
stop();
Instance of Symbol 1151 MovieClip in Frame 43
onClipEvent (enterFrame) {
GC.mainLoop();
}
Frame 44
stop();
Frame 51
GC.levelComplete();
Frame 52
stop();
Frame 61
if (Main.__get__Instance().__get__Section() != "win") {
GC.win(_global.HS_Level, _global.HS_Score);
}
Frame 62
stop();
Frame 71
if (Main.__get__Instance().__get__Section() != "gameOver") {
GC.gameOver(_global.HS_Level, _global.HS_Score);
}
Frame 72
stop();
Symbol 13 MovieClip [Dynamic_Hit] Frame 1
this._visible = false;
Symbol 67 MovieClip [SarbakanLibrary] Frame 1
#initclip 1
Object.registerClass("SarbakanLibrary", LibCompileHookComponent);
#endinitclip
Symbol 1212 MovieClip [__Packages.HighScore.BaseGameController] Frame 0
class HighScore.BaseGameController
{
var gameTimeline, containerTimeline, engineClip, levelPauseTimer, inputTimer, mcHS, debugMsgList, mclListenerHS, mclHS, ScoresLevel, ScoresTotal;
function BaseGameController (game_timeline, engine_clip) {
gameTimeline = game_timeline;
containerTimeline = gameTimeline._parent;
if ((containerTimeline == undefined) && (gameTimeline != _level0)) {
containerTimeline = _level0;
}
if ((containerTimeline != undefined) && (containerTimeline.AC == undefined)) {
containerTimeline = _level10;
}
if ((containerTimeline != undefined) && (containerTimeline.AC == undefined)) {
containerTimeline = _level10;
}
engineClip = engine_clip;
engineClip._visible = false;
levelPauseTimer = new HighScore.Timer();
inputTimer = new HighScore.Timer();
}
function onHSReady() {
mcHS.HS.loading();
}
function onHSLoadError(error_code) {
mcHS.HS = undefined;
}
function start() {
debugMsgList = new Array();
if (containerTimeline != undefined) {
containerTimeline.AC.gameStart(gameTimeline, this);
} else {
gameDebug("Container: undefined");
}
mclListenerHS = new Object();
mclListenerHS.owner = this;
mclHS = new MovieClipLoader();
mclListenerHS.onLoadComplete = function (target_mc) {
target_mc.owner = this.owner;
};
mclListenerHS.onLoadError = function (target_mc, errorCode) {
this.owner.onHSLoadError(errorCode);
};
mclHS.addListener(mclListenerHS);
if (gameTimeline.gGameID == undefined) {
gameTimeline.gGameID = "na.no_id.fla";
}
if (gameTimeline.gHSRoot_swf == undefined) {
gameTimeline.gHSRoot_swf = "";
}
if (gameTimeline.gHSRoot_jsp == undefined) {
gameTimeline.gHSRoot_jsp = "/web/load_variables/games/";
}
if (gameTimeline.gHSRoot_top100 == undefined) {
gameTimeline.gHSRoot_top100 = "/web/games/";
}
if (gameTimeline.gDB_domain == undefined) {
gameTimeline.gDB_domain = "http://looneytunes2.warnerbros.com";
}
mcHS = gameTimeline.createEmptyMovieClip("hs_scripts2", 24000);
mclHS.loadClip(gameTimeline.gHSRoot_swf + filenameHS, mcHS);
}
function title() {
if (containerTimeline != undefined) {
containerTimeline.AC.gameTitle();
}
ScoresLevel = 0;
ScoresTotal = 0;
mcHS.HS.loaded();
}
function instructions() {
if (containerTimeline != undefined) {
containerTimeline.AC.gameInstructions();
}
}
function play() {
if (containerTimeline != undefined) {
containerTimeline.AC.gamePlay();
}
mcHS.HS.play();
}
function levelStart(level, score) {
if (containerTimeline != undefined) {
containerTimeline.AC.gameLevelStart(level, score);
}
ScoresTotal = score;
mcHS.HS.levelStart(level, score);
}
function mainLoop() {
ScoresLevel = _global.HS_Score - ScoresTotal;
HighScore.FrameTimeManager.calculateFrameTime();
}
function checkLevelComplete() {
return(false);
}
function checkGameOver() {
return(false);
}
function levelComplete() {
if (containerTimeline != undefined) {
containerTimeline.AC.gameLevelComplete();
}
levelPauseTimer.restartTimer();
}
function win(level, score) {
if (containerTimeline != undefined) {
containerTimeline.AC.gameWin(level, score);
}
mcHS.HS.gameOver(level, score);
levelPauseTimer.restartTimer();
}
function gameOver(level, score) {
if (containerTimeline != undefined) {
containerTimeline.AC.gameGameOver(level, score);
}
mcHS.HS.gameOver(level, score);
levelPauseTimer.restartTimer();
}
function handleInput() {
if (Key.isDown(HighScore.BaseInputManager.keyMap[HighScore.BaseInputManager.QUIT])) {
gameTimeline.gotoAndPlay("gameOver");
}
if (Key.getCode() == 13) {
consoleCode = "";
} else if ((Key.getAscii() > 45) && (Key.getAscii() != prevConsoleCodeChar)) {
consoleCode = consoleCode + (Key.getAscii() + ":");
prevConsoleCodeChar = Key.getAscii();
}
if (consoleCode == "126:119:98:100:98:") {
mcHS.HS.showDebugConsole();
consoleCode = "";
}
}
function getScore() {
return(0);
}
function setScore(value) {
}
function getTotalScore() {
return(_global.HS_Score);
}
function getLevel() {
return(_global.HS_Level);
}
function setLevel(value) {
}
function getFrameTime() {
return(HighScore.FrameTimeManager.getFrameMilliseconds());
}
function getLevelScore() {
return(ScoresLevel);
}
function gameDebug(msg) {
if (gameTimeline.gDebug == undefined) {
gameTimeline.gDebug = "";
}
gameTimeline.gDebug = (gameTimeline.gDebug + msg) + newline;
debugMsgList.push(msg);
}
var filenameHS = "HSScripts2.swf";
var consoleCode = "";
var prevConsoleCodeChar = 0;
}
Symbol 1213 MovieClip [__Packages.HighScore.Timer] Frame 0
class HighScore.Timer
{
function Timer () {
startTime = getTimer();
}
function restartTimer() {
startTime = getTimer();
}
function milliseconds() {
return(getTimer() - startTime);
}
function seconds() {
return(getSeconds());
}
function getSeconds() {
return(Math.floor((getTimer() - startTime) / 1000));
}
function minutes() {
return(Math.floor(getSeconds() / 60));
}
function remaining(time_allowed) {
return(time_allowed - milliseconds());
}
function expire() {
startTime = -100000;
}
function display() {
var _local2;
var _local3;
_local2 = "00" + minutes();
_local2 = _local2.substr(_local2.length - 2, 2);
_local3 = "00" + seconds();
_local3 = _local3.substr(_local3.length - 2, 2);
return((_local2 + ":") + _local3);
}
function displayRemaining(time_allowed) {
var _local2;
var _local3;
var _local4 = time_allowed - milliseconds();
var _local5 = Math.floor(_local4 / 1000);
var _local6 = Math.floor(_local5 / 60);
if (_local4 >= 0) {
_local2 = "00" + _local6;
_local2 = _local2.substr(_local2.length - 2, 2);
_local3 = "00" + _local5;
_local3 = _local3.substr(_local3.length - 2, 2);
} else {
_local2 = "00";
_local3 = "00";
}
return((_local2 + ":") + _local3);
}
var startTime = 0;
}
Symbol 1214 MovieClip [__Packages.HighScore.FrameTimeManager] Frame 0
class HighScore.FrameTimeManager
{
static var frameTimeMilliseconds;
function FrameTimeManager () {
}
static function calculateFrameTime() {
frameTimeMilliseconds = frameTimeTimer.milliseconds();
frameTimeTimer.restartTimer();
}
static function getFrameMilliseconds() {
return(frameTimeMilliseconds);
}
static function getFrameSeconds() {
return(frameTimeMilliseconds / 1000);
}
static var frameTimeTimer = new HighScore.Timer();
}
Symbol 1215 MovieClip [__Packages.HighScore.BaseInputManager] Frame 0
class HighScore.BaseInputManager
{
static var keyMap, inputState;
function BaseInputManager () {
}
static function init() {
keyMap = new Array(NUM_STATES);
inputState = new Array(NUM_STATES);
keyMap[QUIT] = 81;
inputState[QUIT] = false;
initialized = true;
}
static function processInput() {
if (!initialized) {
init();
}
processKeyboardInput();
}
static function processKeyboardInput() {
inputState[QUIT] = Key.isDown(keyMap[QUIT]);
}
static function checkInputState(keyMapIndex) {
return(inputState[keyMapIndex]);
}
static function showInputState() {
}
static var QUIT = 0;
static var NUM_STATES = 1;
static var initialized = false;
}
Symbol 79 MovieClip [__Packages.Library.DispatcherBase] Frame 0
class Library.DispatcherBase
{
var bPaused, aListeners;
function DispatcherBase () {
bPaused = false;
aListeners = new Array();
}
function doEnterFrame() {
if (!bPaused) {
doDispatchMessage("doEnterFrame");
}
}
function doAddListener(__oRef) {
aListeners.push(__oRef);
}
function doRemoveListener(__oRef) {
for (var _local2 in aListeners) {
if (aListeners[_local2] == __oRef) {
delete aListeners[_local2];
aListeners.splice(Number(_local2), 1);
}
}
}
function doPause() {
bPaused = true;
doDispatchMessage("doPause");
}
function doResume() {
bPaused = false;
doDispatchMessage("doResume");
}
function doDestroy() {
doDispatchMessage("doDestroy");
delete aListeners;
}
function doDispatchMessage(__sMessage) {
for (var _local3 in aListeners) {
aListeners[_local3][__sMessage]();
}
}
}
Symbol 1216 MovieClip [__Packages.Main] Frame 0
class Main extends Library.DispatcherBase
{
static var oCtrl;
var mcRef, oMusicPack, oMusicGame, oTransition, doAddListener, sCurrentSection, sTargetSection, nScoreShow, oGame, bHardDifficultyCompleted;
function Main (__mcRef) {
super();
mcRef = __mcRef;
var _local3 = mcRef.createEmptyMovieClip("SOUND_MANAGER", SOUND_MANAGER_DEPTH);
Library.Sound.SoundManager.doInit(_local3);
Library.Sound.SoundManager.setCategoryVolume(SOUND_CATEGORY_SFX, 100);
Library.Sound.SoundManager.setCategoryVolume(SOUND_CATEGORY_MUSIC, 45);
oMusicPack = Library.Sound.SoundManager.doPlaySoundInCat(SOUND_CATEGORY_MUSIC, "Packaging.wav", 0, 9999999);
oMusicGame = Library.Sound.SoundManager.doPlaySoundInCat(SOUND_CATEGORY_MUSIC, "Game.wav", 0, 9999999);
oMusicPack.setFadeRate(2.25);
oMusicGame.setFadeRate(2.25);
oMusicPack.doFadeTo(100);
mcRef.onEnterFrame = Library.Utils.Delegate.create(this, doEnterFrame);
oCtrl = this;
mcRef.mcTransition.swapDepths(50000);
oTransition = new Library.Transition(mcRef.mcTransition);
oTransition.__set__Listener(this);
doAddListener(oTransition);
doTransitionTo(SECTION_TITLE);
}
static function get Instance() {
return(oCtrl);
}
function doEnterFrame() {
super.doEnterFrame();
}
function onTransitionEvent(__nEvent, __oTransition) {
switch (__nEvent) {
case Library.Transition.TRANSITION_SCREEN_COVERED :
doUnloadSection(sCurrentSection);
doSetSection(sTargetSection);
Library.Sound.SoundManager.doPlaySoundInCat(SOUND_CATEGORY_SFX, "TransitionOut.wav");
break;
case Library.Transition.TRANSITION_COMPLETE :
}
}
function doInstructionPageChange(__nChange) {
doClickSound();
mcRef.mcSection.gotoAndStop(mcRef.mcSection._currentframe + __nChange);
doSetUpInstructions();
}
function doRollSound() {
Library.Sound.SoundManager.doPlaySoundInCat(SOUND_CATEGORY_SFX, "RollOver.wav");
}
function doClickSound() {
Library.Sound.SoundManager.doPlaySoundInCat(SOUND_CATEGORY_SFX, "Click.wav");
}
function doSwitchMusicToGame() {
oMusicPack.doFadeTo(0, false);
oMusicGame.doFadeTo(85);
}
function doSwitchMusicToPack() {
oMusicGame.doFadeTo(0, false);
oMusicPack.doFadeTo(100);
}
function onTitleClickInstructions() {
doClickSound();
doTransitionTo(SECTION_INSTRUCTIONS);
}
function onTitleClickTitle() {
doClickSound();
doTransitionTo(SECTION_TITLE);
}
function onTitleClickGame() {
doClickSound();
doTransitionTo(SECTION_GAME);
}
function doQuitGame() {
nScoreShow = oGame.__get__Status().TotalScore;
var _local2 = oGame.isPlayerWinner();
bHardDifficultyCompleted = oGame.__get__Difficulty() == Game.DIFFICULTY_MEDIUM;
if (_local2) {
doTransitionTo(SECTION_WIN);
} else {
doTransitionTo(SECTION_LOSE);
}
doSwitchMusicToPack();
}
function get Section() {
return(sCurrentSection);
}
function doSetUpTitle() {
mcRef.mcSection.btnPlay.onRelease = Library.Utils.Delegate.create(this, onTitleClickGame);
mcRef.mcSection.btnInstructions.onRelease = Library.Utils.Delegate.create(this, onTitleClickInstructions);
mcRef.mcSection.btnPlay.onRollOver = Library.Utils.Delegate.create(Instance, Instance.doRollSound);
mcRef.mcSection.btnInstructions.onRollOver = Library.Utils.Delegate.create(Instance, Instance.doRollSound);
}
function doSetUpInstructions() {
mcRef.mcSection.stop();
mcRef.mcSection.btnPlay.onRelease = Library.Utils.Delegate.create(this, onTitleClickGame);
mcRef.mcSection.btnNext.onRelease = Library.Utils.Delegate.create(this, doInstructionPageChange, 1);
mcRef.mcSection.btnMenu.onRelease = Library.Utils.Delegate.create(this, onTitleClickTitle);
mcRef.mcSection.btnBack.onRelease = Library.Utils.Delegate.create(this, doInstructionPageChange, -1);
mcRef.mcSection.btnPlay.onRollOver = Library.Utils.Delegate.create(Instance, Instance.doRollSound);
mcRef.mcSection.btnNext.onRollOver = Library.Utils.Delegate.create(Instance, Instance.doRollSound);
mcRef.mcSection.btnMenu.onRollOver = Library.Utils.Delegate.create(Instance, Instance.doRollSound);
mcRef.mcSection.btnBack.onRollOver = Library.Utils.Delegate.create(Instance, Instance.doRollSound);
}
function doWinLoseShared() {
mcRef.mcSection.btnContinue.onRelease = Library.Utils.Delegate.create(this, onTitleClickTitle);
mcRef.mcSection.btnContinue.onRollOver = Library.Utils.Delegate.create(Instance, Instance.doRollSound);
mcRef.mcSection.txtScore.text = Library.Utils.Tools.returnFormatedNumber(nScoreShow, 9);
_global.HS_Score = nScoreShow;
}
function doSetUpWin() {
mcRef.mcSection.stop();
if (bHardDifficultyCompleted) {
mcRef.mcSection.gotoAndStop(2);
}
Library.Sound.SoundManager.doPlaySoundInCat(SOUND_CATEGORY_SFX, "ScoobyWin.wav");
doWinLoseShared();
_global.GC.win(1, _global.HS_Score);
}
function doSetUpLose() {
doWinLoseShared();
_global.GC.gameOver(1, _global.HS_Score);
}
function doCreateGame() {
oGame = new Game(mcRef.mcSection);
}
function doUnloadGame() {
oGame.doDestroy();
delete oGame;
}
function doSetSection(__sSection) {
sCurrentSection = __sSection;
mcRef.gotoAndStop(sCurrentSection);
switch (sCurrentSection) {
case SECTION_INSTRUCTIONS :
doSetUpInstructions();
break;
case SECTION_TITLE :
doSetUpTitle();
break;
case SECTION_WIN :
doSetUpWin();
break;
case SECTION_LOSE :
doSetUpLose();
break;
case SECTION_GAME :
doCreateGame();
}
}
function doUnloadSection(__sSection) {
switch (__sSection) {
case SECTION_WIN :
case SECTION_LOSE :
_global.GC.mcHS.HS.HSD.hideDialog();
break;
case SECTION_GAME :
doUnloadGame();
}
}
function doTransitionTo(__sSection) {
sTargetSection = __sSection;
oTransition.doStart();
Library.Sound.SoundManager.doPlaySoundInCat(SOUND_CATEGORY_SFX, "TransitionIn.wav");
}
static var FRAME_RATE = 30;
static var SOUND_MANAGER_DEPTH = 25000;
static var SOUND_CATEGORY_SFX = "SFX";
static var SOUND_CATEGORY_MUSIC = "MUSIC";
static var SECTION_TITLE = "title";
static var SECTION_INSTRUCTIONS = "instruction";
static var SECTION_GAME = "play";
static var SECTION_LEVEL_COMPLETE = "levelComplete";
static var SECTION_WIN = "win";
static var SECTION_LOSE = "gameOver";
}
Symbol 77 MovieClip [__Packages.Library.State] Frame 0
class Library.State
{
var mcRef, bStateLocked, bPaused, sState, nStateTotalFrame;
function State (__mcRef) {
mcRef = __mcRef;
bStateLocked = false;
bPaused = false;
}
function doEnterFrame() {
this["do" + sState]();
}
function doPause() {
bPaused = true;
mcRef.mcState.stop();
}
function doResume() {
bPaused = false;
mcRef.mcState.play();
}
function setState(__sState) {
if (!bStateLocked) {
doForcedSetState(__sState);
}
}
function doForcedSetState(__sState) {
if (sState != __sState) {
doUnLoadStateAction(sState);
sState = __sState;
mcRef.gotoAndStop(sState);
nStateTotalFrame = mcRef.mcState._totalframes;
doLoadStateAction(sState);
}
}
function get Paused() {
return(bPaused);
}
function get CurrentState() {
return(sState);
}
function doLoadStateAction() {
}
function doUnLoadStateAction() {
}
function doLockState() {
bStateLocked = true;
}
function doUnlockState() {
bStateLocked = false;
}
function isStateComplete() {
var _local2 = false;
if (mcRef.mcState._currentframe == nStateTotalFrame) {
_local2 = true;
}
return(_local2);
}
function isStateStarting() {
var _local2 = false;
if (mcRef.mcState._currentframe == 1) {
_local2 = true;
}
return(_local2);
}
}
Symbol 80 MovieClip [__Packages.Library.Transition] Frame 0
class Library.Transition extends Library.State
{
var setState, isStateComplete, oListener, __get__Listener, mcRef;
function Transition (__mcRef) {
super(__mcRef);
setState("Hidden");
}
function doStart() {
setState("In");
}
function doDestroy() {
}
function doIn() {
if (isStateComplete()) {
oListener.onTransitionEvent(TRANSITION_SCREEN_COVERED, this);
setState("Out");
}
}
function doOut() {
if (isStateComplete()) {
oListener.onTransitionEvent(TRANSITION_COMPLETE, this);
setState("Hidden");
}
}
function set Listener(_o) {
oListener = _o;
//return(__get__Listener());
}
function doLoadStateAction() {
mcRef.mcState.btnBlock.useHandCursor = false;
}
static var TRANSITION_SCREEN_COVERED = 1;
static var TRANSITION_COMPLETE = 2;
}
Symbol 1217 MovieClip [__Packages.Game] Frame 0
class Game
{
static var oCtrl;
var mcRef, oTransition, oPlayerStatus, oMenuPopUp, oLoosePopUp, oWinPopUp, oProgressClearPopUp, oGameQuitPopUp, oGameInstructionsPopUp, sCurrentSection, oTargetLevelData, nDifficulty, oLevel, oLevelStatistics, bBestTimeRecorded, nPreviousBestTime, sTargetSection, oLevelSelector;
function Game (__mcRef) {
oCtrl = this;
mcRef = __mcRef;
oTransition = new Library.Transition(mcRef.mcTransition);
oTransition.__set__Listener(this);
Main.__get__Instance().doAddListener(oTransition);
oPlayerStatus = new PlayerStatus();
oMenuPopUp = new Library.BasicPopUp(mcRef.mcPopUps.mcMenu);
oMenuPopUp.__set__Listener(this);
Main.__get__Instance().doAddListener(oMenuPopUp);
oLoosePopUp = new Library.BasicPopUp(mcRef.mcPopUps.mcLoose);
oLoosePopUp.__set__Listener(this);
Main.__get__Instance().doAddListener(oLoosePopUp);
oWinPopUp = new Library.BasicPopUp(mcRef.mcPopUps.mcWin);
oWinPopUp.__set__Listener(this);
Main.__get__Instance().doAddListener(oWinPopUp);
oProgressClearPopUp = new Library.BasicPopUp(mcRef.mcPopUps.mcProgressClear);
oProgressClearPopUp.__set__Listener(this);
Main.__get__Instance().doAddListener(oProgressClearPopUp);
oGameQuitPopUp = new Library.BasicPopUp(mcRef.mcPopUps.mcGameQuit);
oGameQuitPopUp.__set__Listener(this);
Main.__get__Instance().doAddListener(oGameQuitPopUp);
oGameInstructionsPopUp = new Library.BasicPopUp(mcRef.mcPopUps.mcInstructions);
oGameInstructionsPopUp.__set__Listener(this);
Main.__get__Instance().doAddListener(oGameInstructionsPopUp);
doSetSection(SECTION_DIFFICULTY);
Main.__get__Instance().doAddListener(this);
}
static function get Instance() {
return(oCtrl);
}
function doEnterFrame() {
super.doEnterFrame();
if (sCurrentSection == SECTION_GAME) {
doUpdateHud();
}
}
function doToggleMute(__sCategoryName) {
if (Library.Sound.SoundManager.isCategoryMuted(__sCategoryName)) {
Library.Sound.SoundManager.doUnMuteCategory(__sCategoryName);
} else {
Library.Sound.SoundManager.doMuteCategory(__sCategoryName);
}
Main.__get__Instance().doClickSound();
doUpdateSoundMusicToggle();
}
function doProgressToNext() {
oTargetLevelData = oPlayerStatus.getNextIncompleteLevelFor(Difficulty);
doTransitionTo(SECTION_GAME);
}
function doConfirmProgressClear() {
oProgressClearPopUp.doOpen();
}
function doClearProgressUserAnswer(__bAnswer) {
if (__bAnswer) {
oPlayerStatus.doFlushProgression();
doCreateDifficultyScreen();
}
oProgressClearPopUp.doClose();
}
function doConfirmExit() {
oGameQuitPopUp.doOpen();
}
function doGameQuitUserAnswer(__bAnswer) {
if (__bAnswer) {
Main.__get__Instance().doQuitGame();
} else {
oGameQuitPopUp.doClose();
}
Main.__get__Instance().doClickSound();
}
function doStartLevel(__oLevel) {
oTargetLevelData = __oLevel;
doTransitionTo(SECTION_GAME);
}
function doUseDifficulty(__nDifficulty) {
nDifficulty = __nDifficulty;
Main.__get__Instance().doClickSound();
doTransitionTo(SECTION_LEVEL_SELECT);
}
function doOpenInstructions() {
oGameInstructionsPopUp.doOpen();
Main.__get__Instance().doClickSound();
}
function doInstructionPageChange(__nChange) {
oGameInstructionsPopUp.__get__Ref().mcData.gotoAndStop(oGameInstructionsPopUp.__get__Ref().mcData._currentframe + __nChange);
doUpdateInstructions();
Main.__get__Instance().doClickSound();
}
function doResumeFromInstructions() {
var _local2 = oGameInstructionsPopUp.__get__Ref().mcData._currentframe;
oGameInstructionsPopUp.doClose();
oGameInstructionsPopUp.__get__Ref().mcData.gotoAndStop(_local2);
Main.__get__Instance().doClickSound();
}
function doResumeFromMenu() {
oLevel.doResume();
oMenuPopUp.doClose();
Main.__get__Instance().doClickSound();
}
function doOpenMenu() {
oLevel.doPause();
oMenuPopUp.doOpen();
Main.__get__Instance().doClickSound();
}
function doPlayerWon() {
oLevelStatistics = oLevel.Statistics;
bBestTimeRecorded = false;
nPreviousBestTime = oTargetLevelData.BestTime;
if (oLevelStatistics.__get__FinalTime() < nPreviousBestTime) {
oTargetLevelData.doSaveFromStatistics(oLevelStatistics);
bBestTimeRecorded = true;
}
oWinPopUp.doOpen();
}
function doPlayerLost() {
oLoosePopUp.doOpen();
}
function doChooseAnotherLevel() {
if (sCurrentSection != SECTION_LEVEL_SELECT) {
doTransitionTo(SECTION_LEVEL_SELECT);
}
}
function doRestartLevel() {
doTransitionTo(SECTION_GAME);
}
function onPopUpEvent(__nEvent, __oPopUp) {
if (!(__nEvent === Library.BasicPopUp.NEED_UPDATE)) {
} else {
switch (__oPopUp) {
case oLoosePopUp :
doUpdateLoosePopUp();
break;
case oWinPopUp :
doUpdateWinPopUp();
break;
case oMenuPopUp :
doUpdateMenuPopUp();
break;
case oProgressClearPopUp :
doUpdateProgressClear();
break;
case oGameQuitPopUp :
doUpdateGameQuit();
break;
case oGameInstructionsPopUp :
doUpdateInstructions();
}
}
}
function onTransitionEvent(__nEvent, __oTransition) {
switch (__nEvent) {
case Library.Transition.TRANSITION_SCREEN_COVERED :
doUnloadSection(sCurrentSection);
doSetSection(sTargetSection);
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "TransitionOut.wav");
break;
case Library.Transition.TRANSITION_COMPLETE :
}
}
function isPlayerWinner() {
return(Status.isFirstCompletionFor(Difficulty));
}
function doDestroy() {
oLevel.doDestroy();
oTransition.doDestroy();
oLevelSelector.doDestroy();
oPlayerStatus.doDestroy();
delete oLoosePopUp;
delete oWinPopUp;
delete oMenuPopUp;
delete oProgressClearPopUp;
Main.__get__Instance().doRemoveListener(this);
}
function get Status() {
return(oPlayerStatus);
}
function get Difficulty() {
return(nDifficulty);
}
function doCreateDifficultyScreen() {
mcRef.mcSection.btnDiffEasy.onRelease = Library.Utils.Delegate.create(this, doUseDifficulty, DIFFICULTY_EASY);
mcRef.mcSection.btnDiffMedium.onRelease = Library.Utils.Delegate.create(this, doUseDifficulty, DIFFICULTY_MEDIUM);
mcRef.mcSection.btnClearProgress.onRelease = Library.Utils.Delegate.create(this, doConfirmProgressClear);
mcRef.mcSection.txtStatusEasy.text = Library.Utils.Tools.returnFormatedNumber(oPlayerStatus.getCompletedQuantityFor(DIFFICULTY_EASY), 2);
mcRef.mcSection.txtStatusMedium.text = Library.Utils.Tools.returnFormatedNumber(oPlayerStatus.getCompletedQuantityFor(DIFFICULTY_MEDIUM), 2);
mcRef.mcSection.txtTotalEasy.text = Library.Utils.Tools.returnFormatedNumber(oPlayerStatus.getLevelQuantityFor(DIFFICULTY_EASY), 2);
mcRef.mcSection.txtTotalMedium.text = Library.Utils.Tools.returnFormatedNumber(oPlayerStatus.getLevelQuantityFor(DIFFICULTY_MEDIUM), 2);
mcRef.mcSection.btnDiffEasy.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
mcRef.mcSection.btnDiffMedium.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
mcRef.mcSection.btnClearProgress.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
}
function doCreateLevel() {
mcRef.mcSection.gotoAndStop(oTargetLevelData.__get__LevelNumber());
oLevel = new Level(mcRef.mcSection.mcLevel, oTargetLevelData);
Main.__get__Instance().doSwitchMusicToGame();
}
function doCreateLevelSelector() {
oLevelSelector = new LevelSelector(mcRef.mcSection);
mcRef.mcSection.btnMenu.onRelease = Library.Utils.Delegate.create(this, doOpenMenu);
mcRef.mcSection.btnMenu.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
}
function doUpdateHud() {
mcRef.mcSection.mcHud.btnMenu.onRelease = Library.Utils.Delegate.create(this, doOpenMenu);
mcRef.mcSection.mcHud.btnMenu.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
mcRef.mcSection.mcHud.txtTime.text = Library.Utils.Tools.getFormatedTime(oLevel.__get__Statistics().__get__TimeSpent(), true);
var _local4 = oLevel.__get__Statistics().__get__MedalsCollected();
var _local2 = oTargetLevelData.__get__MedalsQuantity();
mcRef.mcSection.mcHud.txtMedals.text = (_local4 + " / ") + _local2;
var _local3 = oLevel.__get__Statistics().__get__UserClicks();
var _local5 = oTargetLevelData.__get__NormalClicks();
mcRef.mcSection.mcHud.txtClicks.text = (_local3 + " / ") + _local5;
}
function doUpdateInstructions() {
oGameInstructionsPopUp.__get__Ref().mcData.stop();
oGameInstructionsPopUp.__get__Ref().mcData.btnPlay.onRelease = Library.Utils.Delegate.create(this, doResumeFromInstructions);
oGameInstructionsPopUp.__get__Ref().mcData.btnNext.onRelease = Library.Utils.Delegate.create(this, doInstructionPageChange, 1);
oGameInstructionsPopUp.__get__Ref().mcData.btnMenu.onRelease = Library.Utils.Delegate.create(this, doResumeFromInstructions);
oGameInstructionsPopUp.__get__Ref().mcData.btnBack.onRelease = Library.Utils.Delegate.create(this, doInstructionPageChange, -1);
oGameInstructionsPopUp.__get__Ref().mcData.btnPlay.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oGameInstructionsPopUp.__get__Ref().mcData.btnNext.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oGameInstructionsPopUp.__get__Ref().mcData.btnMenu.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oGameInstructionsPopUp.__get__Ref().mcData.btnBack.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
}
function doUpdateGameQuit() {
oGameQuitPopUp.__get__Ref().btnYes.onRelease = Library.Utils.Delegate.create(this, doGameQuitUserAnswer, true);
oGameQuitPopUp.__get__Ref().btnNo.onRelease = Library.Utils.Delegate.create(this, doGameQuitUserAnswer, false);
oGameQuitPopUp.__get__Ref().btnYes.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oGameQuitPopUp.__get__Ref().btnNo.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
}
function doUpdateProgressClear() {
oProgressClearPopUp.__get__Ref().btnYes.onRelease = Library.Utils.Delegate.create(this, doClearProgressUserAnswer, true);
oProgressClearPopUp.__get__Ref().btnNo.onRelease = Library.Utils.Delegate.create(this, doClearProgressUserAnswer, false);
oProgressClearPopUp.__get__Ref().btnYes.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oProgressClearPopUp.__get__Ref().btnNo.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
}
function doUpdateMenuPopUp() {
oMenuPopUp.__get__Ref().btnResume.onRelease = Library.Utils.Delegate.create(this, doResumeFromMenu);
oMenuPopUp.__get__Ref().btnHelp.onRelease = Library.Utils.Delegate.create(this, doOpenInstructions);
oMenuPopUp.__get__Ref().btnLevelMap.onRelease = Library.Utils.Delegate.create(this, doChooseAnotherLevel);
oMenuPopUp.__get__Ref().btnQuit.onRelease = Library.Utils.Delegate.create(this, doConfirmExit);
doUpdateSoundMusicToggle();
oMenuPopUp.__get__Ref().btnResume.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oMenuPopUp.__get__Ref().btnLevelMap.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oMenuPopUp.__get__Ref().btnHelp.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oMenuPopUp.__get__Ref().btnQuit.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
}
function doUpdateSoundMusicToggle() {
var _local3 = "On";
if (Library.Sound.SoundManager.isCategoryMuted(Main.SOUND_CATEGORY_MUSIC)) {
_local3 = "Off";
}
var _local2 = "On";
if (Library.Sound.SoundManager.isCategoryMuted(Main.SOUND_CATEGORY_SFX)) {
_local2 = "Off";
}
oMenuPopUp.__get__Ref().mcMusicGroup.gotoAndStop(_local3);
oMenuPopUp.__get__Ref().mcSoundGroup.gotoAndStop(_local2);
oMenuPopUp.__get__Ref().mcMusicGroup.btnToggle.onRelease = Library.Utils.Delegate.create(this, doToggleMute, Main.SOUND_CATEGORY_MUSIC);
oMenuPopUp.__get__Ref().mcSoundGroup.btnToggle.onRelease = Library.Utils.Delegate.create(this, doToggleMute, Main.SOUND_CATEGORY_SFX);
oMenuPopUp.__get__Ref().mcMusicGroup.btnToggle.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oMenuPopUp.__get__Ref().mcSoundGroup.btnToggle.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
}
function doUpdateLoosePopUp() {
oLoosePopUp.__get__Ref().btnRestart.onRelease = Library.Utils.Delegate.create(this, doRestartLevel);
oLoosePopUp.__get__Ref().btnChooseAnother.onRelease = Library.Utils.Delegate.create(this, doChooseAnotherLevel);
oLoosePopUp.__get__Ref().btnQuit.onRelease = Library.Utils.Delegate.create(this, doConfirmExit);
oLoosePopUp.__get__Ref().btnRestart.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oLoosePopUp.__get__Ref().btnChooseAnother.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oLoosePopUp.__get__Ref().btnQuit.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
}
function doUpdateWinPopUp() {
var _local6 = false;
var _local10 = oPlayerStatus.getCompletedQuantityFor(Difficulty);
var _local11 = oPlayerStatus.getLevelQuantityFor(Difficulty);
if (_local10 >= _local11) {
_local6 = true;
}
oWinPopUp.__get__Ref().btnRestart.onRelease = Library.Utils.Delegate.create(this, doRestartLevel);
oWinPopUp.__get__Ref().btnChooseAnother.onRelease = Library.Utils.Delegate.create(this, doChooseAnotherLevel);
oWinPopUp.__get__Ref().btnNextLevel.onRelease = Library.Utils.Delegate.create(this, doProgressToNext);
if (_local6) {
oWinPopUp.__get__Ref().btnNextLevel._visible = false;
}
oWinPopUp.__get__Ref().btnRestart.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oWinPopUp.__get__Ref().btnChooseAnother.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
oWinPopUp.__get__Ref().btnNextLevel.onRollOver = Library.Utils.Delegate.create(Main.__get__Instance(), Main.__get__Instance().doRollSound);
var _local9 = oLevelStatistics.__get__TimeSpent();
var _local13 = oLevelStatistics.__get__UserClicks();
var _local12 = oLevelStatistics.__get__MedalsCollected();
var _local7 = oLevelStatistics.__get__ClicksPenality();
var _local5 = oLevelStatistics.__get__MedalsPenality();
var _local14 = oLevelStatistics.__get__FinalTime();
var _local8;
var _local4;
if (bBestTimeRecorded) {
if (oWinPopUp.__get__CurrentState() != "Idle") {
oWinPopUp.__get__Ref().mcBest._visible = false;
} else {
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "RecordBeaten.wav");
}
_local8 = oLevelStatistics.FinalTime;
if (nPreviousBestTime != Number.POSITIVE_INFINITY) {
_local4 = Library.Utils.Tools.getFormatedTime(nPreviousBestTime, true);
} else {
_local4 = "00:00:00";
}
} else {
oWinPopUp.__get__Ref().mcBest._visible = false;
_local8 = nPreviousBestTime;
_local4 = Library.Utils.Tools.getFormatedTime(_local8, true);
}
var _local3 = Library.Utils.Tools.getFormatedTime(_local5, true);
var _local2 = Library.Utils.Tools.getFormatedTime(_local7, true);
if (_local5 > 0) {
_local3 = ("(+" + _local3) + ")";
} else {
_local3 = "";
}
if (_local7 > 0) {
_local2 = ("(+" + _local2) + ")";
} else {
_local2 = "";
}
oWinPopUp.__get__Ref().txtLevelNumber.text = Library.Utils.Tools.returnFormatedNumber(oTargetLevelData.__get__DisplayNumber(), 2);
oWinPopUp.__get__Ref().txtTime.text = Library.Utils.Tools.getFormatedTime(_local9, true);
oWinPopUp.__get__Ref().txtTimeFinal.text = Library.Utils.Tools.getFormatedTime(_local14, true);
oWinPopUp.__get__Ref().txtTimeBest.text = _local4;
oWinPopUp.__get__Ref().txtClicks.text = (Library.Utils.Tools.returnFormatedNumber(_local13, 2) + " / ") + Library.Utils.Tools.returnFormatedNumber(oTargetLevelData.__get__NormalClicks(), 2);
oWinPopUp.__get__Ref().txtClicksPenality.text = _local2;
oWinPopUp.__get__Ref().txtMedals.text = (Library.Utils.Tools.returnFormatedNumber(_local12, 2) + " / ") + Library.Utils.Tools.returnFormatedNumber(oTargetLevelData.__get__MedalsQuantity(), 2);
oWinPopUp.__get__Ref().txtMedalsPenality.text = _local3;
oWinPopUp.__get__Ref().txtScore.text = Library.Utils.Tools.returnFormatedNumber(oTargetLevelData.getScoreForTime(oLevelStatistics.__get__FinalTime(), 6));
}
function doUnloadLevel() {
oLevel.doDestroy();
delete oLevel;
mcRef.gotoAndStop("CleanUp");
oLoosePopUp.doHide();
oWinPopUp.doHide();
oMenuPopUp.doHide();
Main.__get__Instance().doSwitchMusicToPack();
}
function doSetSection(__sSection) {
sCurrentSection = __sSection;
mcRef.gotoAndStop(sCurrentSection);
switch (sCurrentSection) {
case SECTION_LEVEL_SELECT :
doCreateLevelSelector();
break;
case SECTION_DIFFICULTY :
doCreateDifficultyScreen();
break;
case SECTION_GAME :
doCreateLevel();
}
}
function doUnloadSection(__sSection) {
if (!(__sSection === SECTION_GAME)) {
} else {
doUnloadLevel();
}
}
function doTransitionTo(__sSection) {
sTargetSection = __sSection;
oTransition.doStart();
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "TransitionIn.wav");
}
static var SECTION_DIFFICULTY = "Difficulty";
static var SECTION_LEVEL_SELECT = "LevelSelect";
static var SECTION_GAME = "Game";
static var DIFFICULTY_EASY = 1;
static var DIFFICULTY_MEDIUM = 2;
}
Symbol 1218 MovieClip [__Packages.LevelDataBase] Frame 0
class LevelDataBase
{
var nStatus, nBestTime, nMedalsEarned, nMadeClicks, nMinimumTime, nNormalTime, nMaximumTime, nSnackQuantity, nDifficulty, nNormalClicks, nLevelNumber, nDisplayNumber, nMedalsQuantity, nSnackEntryRate, __get__MinimumTime, __get__MaximumTime, __get__NormalTime;
function LevelDataBase () {
doReset();
}
function doSaveFromStatistics(__oStatistics) {
nStatus = STATUS_COMPLETED;
nBestTime = __oStatistics.FinalTime;
nMedalsEarned = __oStatistics.MedalsCollected;
nMadeClicks = __oStatistics.UserClicks;
doSaveData();
}
function doReset() {
nStatus = STATUS_INCOMPLETE;
nBestTime = Number.POSITIVE_INFINITY;
nMedalsEarned = 0;
nMadeClicks = 0;
}
function doDestroy() {
}
function getScoreForTime(__nTime) {
var _local6 = POINTS_MINIMUM;
var _local3 = POINTS_NORMAL;
var _local5 = POINTS_MAXIMUM;
var _local15 = nMinimumTime;
var _local4 = nNormalTime;
var _local13 = nMaximumTime;
var _local7 = __nTime;
var _local2;
var _local8 = Math.abs(_local4 - _local7);
if (_local7 < _local4) {
var _local17 = Math.abs(_local4 - _local15);
var _local10 = Math.abs(_local3 - _local5);
var _local9 = _local8 / _local17;
var _local12 = getExpValFor(_local9) * _local10;
_local2 = _local3 + _local12;
if (_local2 > _local5) {
var _local11 = _local2 - _local5;
var _local16 = _local3 / _local4;
var _local14 = _local11 * _local16;
_local2 = _local5 + _local14;
}
} else if (_local7 > _local4) {
var _local17 = Math.abs(_local4 - _local13);
var _local10 = Math.abs(_local3 - _local6);
var _local9 = _local8 / _local17;
var _local12 = getExpValFor(_local9) * _local10;
_local2 = _local3 - _local12;
if (_local2 < _local6) {
_local2 = _local6;
}
} else {
_local2 = _local3;
}
_local2 = Math.round(_local2);
return(_local2);
}
function get Status() {
return(nStatus);
}
function set SnackQuantity(__nSnackQuantity) {
nSnackQuantity = __nSnackQuantity;
//return(SnackQuantity);
}
function get SnackQuantity() {
return(nSnackQuantity);
}
function set Difficulty(__nDifficulty) {
nDifficulty = __nDifficulty;
//return(Difficulty);
}
function get Difficulty() {
return(nDifficulty);
}
function set NormalClicks(__nNormalClicks) {
nNormalClicks = __nNormalClicks;
//return(NormalClicks);
}
function get NormalClicks() {
return(nNormalClicks);
}
function get MadeClicks() {
return(nMadeClicks);
}
function set LevelNumber(__nLevelNumber) {
nLevelNumber = __nLevelNumber;
//return(LevelNumber);
}
function get LevelNumber() {
return(nLevelNumber);
}
function set DisplayNumber(__nDisplayNumber) {
nDisplayNumber = __nDisplayNumber;
//return(DisplayNumber);
}
function get DisplayNumber() {
return(nDisplayNumber);
}
function set MedalsQuantity(__nMedalsQuantity) {
nMedalsQuantity = __nMedalsQuantity;
//return(MedalsQuantity);
}
function get MedalsQuantity() {
return(nMedalsQuantity);
}
function get MedalsEarned() {
return(nMedalsEarned);
}
function set SnackEntryRate(__nSnackEntryRate) {
nSnackEntryRate = Math.floor(__nSnackEntryRate);
//return(SnackEntryRate);
}
function get SnackEntryRate() {
return(nSnackEntryRate);
}
function get Score() {
return(getScoreForTime(BestTime));
}
function get BestTime() {
return(nBestTime);
}
function set MinimumTime(__nMinimumTime) {
nMinimumTime = __nMinimumTime;
//return(__get__MinimumTime());
}
function set MaximumTime(__nMaximumTime) {
nMaximumTime = __nMaximumTime;
//return(__get__MaximumTime());
}
function set NormalTime(__nNormalTime) {
nNormalTime = __nNormalTime;
//return(__get__NormalTime());
}
function doSaveData() {
var _local2 = SharedObject.getLocal(PlayerStatus.SO_NAME);
if (_local2.data["Level" + nLevelNumber] == undefined) {
_local2.data["Level" + nLevelNumber] = new Object();
}
if (_local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty] == undefined) {
_local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty] = new Object();
}
_local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty].nStatus = nStatus;
_local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty].nBestTime = nBestTime;
_local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty].nMedalsEarned = nMedalsEarned;
_local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty].nMadeClicks = nMadeClicks;
_local2.flush();
}
function doLoadData() {
var _local2 = SharedObject.getLocal(PlayerStatus.SO_NAME);
if (_local2.data["Level" + nLevelNumber] != undefined) {
if (_local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty] != undefined) {
nStatus = _local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty].nStatus;
nBestTime = _local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty].nBestTime;
nMedalsEarned = _local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty].nMedalsEarned;
nMadeClicks = _local2.data["Level" + nLevelNumber]["Difficulty" + nDifficulty].nMadeClicks;
}
}
}
function getExpValFor(__nPercent) {
var _local6 = CONST_A;
var _local5 = CONST_B;
var _local4 = CONST_C;
var _local3 = CONST_D;
var _local2 = CONST_E;
__nPercent = __nPercent * 100;
var _local7 = __nPercent + _local4;
var _local8 = _local2 * _local7;
var _local9 = Math.pow(_local5, _local8);
var _local1 = (_local6 * _local9) + _local3;
_local1 = _local1 / 100;
return(_local1);
}
static var CONST_A = 1.05;
static var CONST_B = 1.22;
static var CONST_C = 20;
static var CONST_D = -2.2;
static var CONST_E = 0.19185825759442;
static var POINTS_MINIMUM = 100;
static var POINTS_NORMAL = 15000;
static var POINTS_MAXIMUM = 50000;
static var SECONDS = Main.FRAME_RATE;
static var FRAMES = 1;
static var STATUS_COMPLETED = 1;
static var STATUS_INCOMPLETE = 2;
}
Symbol 1219 MovieClip [__Packages.LevelStatistics] Frame 0
class LevelStatistics
{
var oLevelData, nMedalsCollected, nUserClicks, nTimeSpent, bTimerActive;
function LevelStatistics (__oLevelData) {
oLevelData = __oLevelData;
nMedalsCollected = 0;
nUserClicks = 0;
nTimeSpent = 0;
bTimerActive = false;
Level.__get__Instance().doAddListener(this);
}
function doEnterFrame() {
if (bTimerActive) {
nTimeSpent++;
}
}
function doStartTimer() {
nTimeSpent = 0;
bTimerActive = true;
}
function doStopTimer() {
bTimerActive = false;
}
function doUserClick() {
nUserClicks++;
}
function doMedalCollected() {
nMedalsCollected++;
}
function doDestroy() {
delete oLevelData;
Level.__get__Instance().doRemoveListener(this);
}
function get TimeSpent() {
return(Math.round(nTimeSpent / (Main.FRAME_RATE / 1000)));
}
function get MedalsPenality() {
var _local3 = oLevelData.__get__MedalsQuantity() - MedalsCollected;
var _local2 = _local3 * PENALITY_PER_MEDALS;
_local2 = Math.max(0, _local2);
return(_local2);
}
function get ClicksPenality() {
var _local3 = UserClicks - oLevelData.__get__NormalClicks();
var _local2 = _local3 * PENALITY_PER_CLICKS;
_local2 = Math.max(0, _local2);
return(_local2);
}
function get FinalTime() {
return((TimeSpent + MedalsPenality) + ClicksPenality);
}
function get MedalsCollected() {
return(nMedalsCollected);
}
function get UserClicks() {
return(nUserClicks);
}
static var PENALITY_PER_MEDALS = 5000;
static var PENALITY_PER_CLICKS = 1000;
}
Symbol 1220 MovieClip [__Packages.Level] Frame 0
class Level extends Library.DispatcherBase
{
static var oLevel;
var mcRef, bLevelOver, oLevelData, aObjects, oLevelStatistics, nAttachNext, nSnackEated, aFilters, oSnackDispenser, doPause, oDoorExit, oDoorEntry;
function Level (__mcRef, __oLevel) {
super();
mcRef = __mcRef;
oLevel = this;
bLevelOver = false;
oLevelData = __oLevel;
_global.HS_Score = Game.__get__Instance().__get__Status().TotalScore;
_global.HS_Level = oLevelData.LevelNumber;
_global.GC.levelStart(_global.HS_Level, _global.HS_Score);
mcRef.gotoAndStop("Data");
aObjects = new Array();
oLevelStatistics = new LevelStatistics(oLevelData);
oLevelStatistics.doStartTimer();
nAttachNext = 0;
nSnackEated = 0;
var _local4 = new flash.filters.DropShadowFilter(DROPSHADOW_DISTANCE, DROPSHADOW_ANGLE, 0, DROPSHADOW_ALPHA, DROPSHADOW_BLUR, DROPSHADOW_BLUR, DROPSHADOW_STRENGTH, DROPSHADOW_QUALITY, false, false, false);
aFilters = new Array();
aFilters.push(_local4);
Main.__get__Instance().doAddListener(this);
}
function doEnterFrame() {
super.doEnterFrame();
for (var _local3 in aObjects) {
if (aObjects[_local3].AdjustDepth) {
doManageObjectDepth(aObjects[_local3]);
}
}
}
function doSnackExploded() {
bLevelOver = true;
oLevelStatistics.doStopTimer();
oSnackDispenser.doUnhappy();
}
function onSnackLostComplete() {
doPause();
Game.__get__Instance().doPlayerLost();
}
function doSnackGiven(__bScoobyNeedToEatMore) {
if ((nSnackEated >= oLevelData.__get__SnackQuantity()) && (!__bScoobyNeedToEatMore)) {
doPause();
Game.__get__Instance().doPlayerWon();
}
}
function doSnackPassedDoor(__nSnackType) {
oSnackDispenser.doReceiveSnack(__nSnackType);
nSnackEated++;
if (nSnackEated >= oLevelData.__get__SnackQuantity()) {
bLevelOver = true;
oLevelStatistics.doStopTimer();
}
}
function doCreateSnack(__nX, __nY, __nSnackType) {
var _local2 = mcRef.attachMovie(SNACK_LINKAGE, "mcSnack" + NextDepth, NextDepth);
_local2._x = __nX;
_local2._y = __nY;
doAddShadow(_local2);
var _local3 = new Snack(_local2, __nSnackType);
_local3.doSetSpeeds(0, 0);
aObjects.push(_local3);
}
function doSetSnackDispenser(__mcRef) {
oSnackDispenser = new SnackDispenser(__mcRef);
}
function doCreateDoorExit(__mcPositionRef) {
var _local5 = __mcPositionRef._x;
var _local4 = __mcPositionRef._y;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local2 = mcRef.attachMovie(DOOR_EXIT_LINKAGE, "mcDoorExit", NextDepth);
_local2._x = _local5;
_local2._y = _local4;
oDoorExit = new DoorExit(_local2);
}
function doCreateDoorSwitch(__mcPositionRef) {
var _local7 = __mcPositionRef._x;
var _local6 = __mcPositionRef._y;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local3 = NextDepth;
var _local2 = mcRef.attachMovie(DOOR_SWITCH_LINKAGE, "mcObject" + _local3, _local3);
_local2._x = _local7;
_local2._y = _local6;
doAddShadow(_local2);
var _local5 = new DoorSwitch(_local2);
aObjects.push(_local5);
}
function doCreateMedal(__mcPositionRef) {
var _local7 = __mcPositionRef._x;
var _local6 = __mcPositionRef._y;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local3 = NextDepth;
var _local2 = mcRef.attachMovie(MEDAL_LINKAGE, "mcObject" + _local3, _local3);
_local2._x = _local7;
_local2._y = _local6;
doAddShadow(_local2);
var _local5 = new Medal(_local2);
aObjects.push(_local5);
}
function doCreateDoorEntry(__mcPositionRef) {
var _local5 = __mcPositionRef._x;
var _local4 = __mcPositionRef._y;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local2 = mcRef.attachMovie(DOOR_ENTRY_LINKAGE, "mcDoorEntry", NextDepth);
_local2._x = _local5;
_local2._y = _local4;
oDoorEntry = new DoorEntry(_local2);
oDoorEntry.setEntryRate(oLevelData.__get__SnackEntryRate());
oDoorEntry.setSnackQuantity(oLevelData.__get__SnackQuantity());
}
function doCreateTreadMill(__mcPositionRef, __nRollDirection, __nSize) {
var _local7 = __mcPositionRef._x;
var _local6 = __mcPositionRef._y;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local4 = NextDepth;
var _local2 = mcRef.attachMovie(TREADMILL_LINKAGE, "mcObject" + _local4, _local4);
_local2._x = _local7;
_local2._y = _local6;
doAddShadow(_local2);
var _local3 = new TreadMill(_local2);
_local3.setRollDirection(__nRollDirection);
_local3.setThreadSize(__nSize);
aObjects.push(_local3);
}
function doCreateWheelRail(__mcPositionRef, __nInitialDirection) {
var _local8 = __mcPositionRef._x;
var _local7 = __mcPositionRef._y;
var _local6 = __mcPositionRef._rotation;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local4 = NextDepth;
var _local2 = mcRef.attachMovie(WHEEL_RAIL_LINKAGE, "mcObject" + _local4, _local4);
_local2._x = _local8;
_local2._y = _local7;
var _local5 = new WheelRail(_local2);
_local5.setRotation(_local6);
_local5.setInitialDirection(__nInitialDirection);
}
function doCreateWheel(__mcPositionRef, __nRollDirection, __nSpeed) {
var _local7 = __mcPositionRef._x;
var _local6 = __mcPositionRef._y;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local4 = NextDepth;
var _local2 = mcRef.attachMovie(WHEEL_LINKAGE, "mcObject" + _local4, _local4);
_local2._x = _local7;
_local2._y = _local6;
doAddShadow(_local2);
var _local3 = new Wheel(_local2);
_local3.setRollDirection(__nRollDirection);
_local3.setRollSpeed(__nSpeed);
aObjects.push(_local3);
}
function doCreateCruncher(__mcPositionRef) {
var _local6 = __mcPositionRef._x;
var _local5 = __mcPositionRef._y;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local3 = NextDepth;
var _local2 = mcRef.attachMovie(CRUNCHER_LINKAGE, "mcObject" + _local3, _local3);
_local2._x = _local6;
_local2._y = _local5;
doAddShadow(_local2);
var _local7 = new Cruncher(_local2);
aObjects.push(_local7);
}
function doCreateCradle(__mcPositionRef, __nRollDirection, __nCradleType) {
var _local7 = __mcPositionRef._x;
var _local6 = __mcPositionRef._y;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local4 = NextDepth;
var _local2 = mcRef.attachMovie(CRADLE_LINKAGE, "mcObject" + _local4, _local4);
_local2._x = _local7;
_local2._y = _local6;
doAddShadow(_local2);
var _local3 = new Cradle(_local2);
_local3.setRollDirection(__nRollDirection);
_local3.setCradleType(__nCradleType);
aObjects.push(_local3);
}
function doCreateCradleRail(__mcPositionRef, __nRailSize) {
var _local8 = __mcPositionRef._x;
var _local7 = __mcPositionRef._y;
var _local6 = __mcPositionRef._rotation;
__mcPositionRef.swapDepths(REMOVE_DEPTH);
__mcPositionRef.removeMovieClip();
var _local4 = NextDepth;
var _local2 = mcRef.attachMovie(CRADLE_RAIL_LINKAGE, "mcObject" + _local4, _local4);
_local2._x = _local8;
_local2._y = _local7;
var _local5 = new CradleRail(_local2);
_local5.setRotation(_local6);
_local5.setSize(__nRailSize);
}
function doRemoveObject(__oObject) {
for (var _local3 in aObjects) {
if (aObjects[_local3] == __oObject) {
aObjects.splice(_local3, 1);
}
}
}
function doManageObjectDepth(__oObject) {
var _local2;
var _local4 = 0;
do {
_local2 = (DEPTH_MAX - getDepthForPositions(__oObject.__get__Ref()._x, __oObject.__get__Ref()._y)) - _local4;
_local2 = _local2 + __oObject.DepthModifier;
_local4++;
} while (!isDepthFree(_local2));
__oObject.__get__Ref().swapDepths(_local2);
}
function doDestroy() {
_global.HS_Score = Game.__get__Instance().__get__Status().TotalScore;
_global.GC.levelComplete();
super.doDestroy();
for (var _local4 in aObjects) {
aObjects[_local4].doDestroy();
aObjects.splice(_local4, 1);
}
oDoorExit.doDestroy();
oDoorEntry.doDestroy();
oSnackDispenser.doDestroy();
oLevelStatistics.doDestroy();
delete oLevelStatistics;
delete oDoorExit;
delete oDoorEntry;
delete oSnackDispenser;
delete aObjects;
delete mcRef;
delete oLevel;
}
static function get Instance() {
return(oLevel);
}
function get Statistics() {
return(oLevelStatistics);
}
function get ExitDoor() {
return(oDoorExit);
}
function get Ref() {
return(mcRef);
}
function get Objects() {
var _local2 = Library.Utils.Tools.doCopyArray(aObjects);
_local2.push(oDoorExit);
return(_local2);
}
function get Boundaries() {
return(LEVEL_BOUNDARIES);
}
function get Active() {
return(!bLevelOver);
}
function get NextDepth() {
var _local2;
do {
_local2 = ATTACH_START_DEPTH + (nAttachNext++);
if (_local2 > DEPTH_MAX) {
nAttachNext = 0;
_local2 = ATTACH_START_DEPTH + nAttachNext;
}
} while (!isDepthFree(_local2));
return(_local2);
}
function doAddShadow(__mc) {
}
function getDepthForPositions(__nX, __nY) {
var _local1 = __nY * 100;
return(_local1);
}
function isDepthFree(__nDepth) {
return(mcRef.getInstanceAtDepth(__nDepth) == undefined);
}
static var OBJECT_TYPE_SNACK = 1;
static var OBJECT_TYPE_TREADMILL = 2;
static var OBJECT_TYPE_EXIT_DOOR = 3;
static var OBJECT_TYPE_WHEEL = 4;
static var OBJECT_TYPE_CRUNCHER = 5;
static var OBJECT_TYPE_DOOR_SWITCH = 6;
static var OBJECT_TYPE_CRADLE = 7;
static var OBJECT_TYPE_MEDAL = 8;
static var MIN_DOOR_FALLING_TIME = 5;
static var FALLING_DOOR_PIXEL_PER_FRAME = 10;
static var ATTACH_START_DEPTH = 150;
static var REMOVE_DEPTH = 25;
static var DEPTH_MAX = 1010000;
static var LEVEL_BOUNDARIES = {top:3, bottom:450, left:3, right:392};
static var SNACK_LINKAGE = "Dynamic_Snack";
static var TREADMILL_LINKAGE = "Dynamic_TreadMill";
static var DOOR_ENTRY_LINKAGE = "Dynamic_DoorEntry";
static var DOOR_EXIT_LINKAGE = "Dynamic_DoorExit";
static var SNACK_DISPENSER_LINKAGE = "Dynamic_SnackDispenser";
static var WHEEL_LINKAGE = "Dynamic_Wheel";
static var WHEEL_RAIL_LINKAGE = "Dynamic_WheelRail";
static var CRUNCHER_LINKAGE = "Dynamic_Cruncher";
static var DOOR_SWITCH_LINKAGE = "Dynamic_DoorSwitch";
static var CRADLE_LINKAGE = "Dynamic_CradleBody";
static var CRADLE_RAIL_LINKAGE = "Dynamic_CradleRail";
static var MEDAL_LINKAGE = "Dynamic_Medal";
static var DROPSHADOW_DISTANCE = 5;
static var DROPSHADOW_ANGLE = 270;
static var DROPSHADOW_ALPHA = 1;
static var DROPSHADOW_BLUR = 8;
static var DROPSHADOW_STRENGTH = 0.5;
static var DROPSHADOW_QUALITY = 1;
}
Symbol 1221 MovieClip [__Packages.BaseObject] Frame 0
class BaseObject extends Library.State
{
var bNeedDepthAdjustement, nOriginalScaleX, mcRef, nOriginalScaleY, oTweenListener, twX, twY, nDepthModifier, nObjectType, nCheckDistance, bPaused;
function BaseObject (__mcRef) {
super(__mcRef);
bNeedDepthAdjustement = true;
nOriginalScaleX = mcRef._xscale;
nOriginalScaleY = mcRef._yscale;
oTweenListener = new Object();
oTweenListener.onMotionFinished = Library.Utils.Delegate.create(this, onTweenComplete);
Level.__get__Instance().doAddListener(this);
}
function onTweenComplete(__twTween) {
if (__twTween == twX) {
delete twX;
} else if (__twTween == twY) {
delete twY;
}
}
function doReactVerticalHit(__nSpeed) {
doBounce(0, Math.abs(__nSpeed));
}
function doReactHorizontalHit(__nSpeed) {
doBounce(Math.abs(__nSpeed), 0);
}
function doRemoveAffectedSnack() {
}
function doSnackExploded() {
}
function doAffectSnack() {
}
function doPause() {
super.doPause();
twX.stop();
twY.stop();
}
function doResume() {
super.doResume();
twX.resume();
twY.resume();
}
function doDestroy() {
Level.__get__Instance().doRemoveListener(this);
twX.stop();
twY.stop();
mcRef.swapDepths(Level.REMOVE_DEPTH);
mcRef.removeMovieClip();
delete mcRef;
delete twX;
delete twY;
}
function get AdjustDepth() {
return(bNeedDepthAdjustement);
}
function get DepthModifier() {
if (nDepthModifier == undefined) {
nDepthModifier = 0;
}
return(nDepthModifier);
}
function get ObjectType() {
return(nObjectType);
}
function get CheckDistance() {
return(nCheckDistance);
}
function get Hit() {
return(Ref.mcState.mcHit);
}
function get Ref() {
return(mcRef);
}
function doBounce(__nXStrength, __nYStrength) {
if (!bPaused) {
var _local2 = 100 - (Math.abs(__nXStrength) * BOUNCE_HORIZONTAL_SPEED_RATIO);
var _local3 = 100 - (Math.abs(__nYStrength) * BOUNCE_VERTICAL_SPEED_RATIO);
if ((_local2 < BOUNCE_HORIZONTAL_STRETCH) || (_local2 > 100)) {
_local2 = BOUNCE_HORIZONTAL_STRETCH;
}
if ((_local3 < BOUNCE_VERTICAL_STRETCH) || (_local3 > 100)) {
_local3 = BOUNCE_VERTICAL_STRETCH;
}
doReinitScale();
if (twX != undefined) {
twX.stop();
}
if (twY != undefined) {
twY.stop();
}
twX = new mx.transitions.Tween(mcRef, "_xscale", mx.transitions.easing.Elastic.easeOut, _local2, mcRef._xscale, BOUNCE_DURATION, false);
twY = new mx.transitions.Tween(mcRef, "_yscale", mx.transitions.easing.Elastic.easeOut, _local3, mcRef._yscale, BOUNCE_DURATION, false);
twX.addListener(oTweenListener);
twY.addListener(oTweenListener);
}
}
function doReinitScale() {
mcRef._xscale = nOriginalScaleX;
mcRef._yscale = nOriginalScaleY;
}
static var BOUNCE_DURATION = 15;
static var BOUNCE_VERTICAL_STRETCH = 65;
static var BOUNCE_HORIZONTAL_STRETCH = 60;
static var BOUNCE_VERTICAL_SPEED_RATIO = 2;
static var BOUNCE_HORIZONTAL_SPEED_RATIO = 2;
}
Symbol 1222 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 1223 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 1224 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 70 MovieClip [__Packages.Library.Utils.Delegate] Frame 0
class Library.Utils.Delegate extends Object
{
var func;
function Delegate () {
super();
}
function DelegateArgs(f) {
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local3 = arguments.callee.target;
func = arguments.callee.func;
var _local2 = arguments.callee.arg;
_local2 = _local2.concat(arguments);
return(func.apply(_local3, _local2));
};
_local2.target = obj;
_local2.func = func;
_local2.arg = arguments.slice(2);
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1225 MovieClip [__Packages.mx.transitions.easing.Elastic] Frame 0
class mx.transitions.easing.Elastic
{
function Elastic () {
}
static function easeIn(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
t = t - 1;
return((-((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
static function easeOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / d;
if (t == 1) {
return(b + c);
}
if (!p) {
p = d * 0.3;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
return((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) + c) + b);
}
static function easeInOut(t, b, c, d, a, p) {
if (t == 0) {
return(b);
}
t = t / (d / 2);
if (t == 2) {
return(b + c);
}
if (!p) {
p = d * 0.45;
}
if ((!a) || (a < Math.abs(c))) {
a = c;
var _local7 = p / 4;
} else {
var _local7 = (p / (Math.PI*2)) * Math.asin(c / a);
}
if (t < 1) {
t = t - 1;
return((-0.5 * ((a * Math.pow(2, 10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p))) + b);
}
t = t - 1;
return(((((a * Math.pow(2, -10 * t)) * Math.sin((((t * d) - _local7) * (Math.PI*2)) / p)) * 0.5) + c) + b);
}
static var version = "1.1.0.52";
}
Symbol 1226 MovieClip [__Packages.DoorEntry] Frame 0
class DoorEntry extends BaseObject
{
var setState, nNextDelivery, nSnackType, nEntryRate, nSnackQuantity, isStateComplete, mcRef;
function DoorEntry (__mcRef) {
super(__mcRef);
setState("Idle");
nNextDelivery = FIRST_DELIVERY_WAIT;
}
function doEnterFrame() {
super.doEnterFrame();
nNextDelivery--;
if (nNextDelivery == 0) {
nSnackType = Library.Utils.MoreMath.getRandomRange(1, Snack.SNACK_TYPES_NUMBER);
doGiveSnack();
}
}
function setEntryRate(__nEntryRate) {
nEntryRate = __nEntryRate;
}
function setSnackQuantity(__nQuantity) {
nSnackQuantity = __nQuantity;
}
function doGiveStart() {
if (isStateComplete()) {
doCreateNewSnack();
setState("GiveEnd");
}
}
function doGiveEnd() {
if (isStateComplete()) {
setState("Idle");
}
}
function doLoadStateAction() {
mcRef.mcState.mcSnack.gotoAndStop(nSnackType);
}
function doGiveSnack() {
setState("GiveStart");
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "SnackEntry.wav");
nSnackQuantity--;
if (nSnackQuantity > 0) {
nNextDelivery = nEntryRate;
}
}
function doCreateNewSnack() {
var _local2 = Library.Utils.MoreMath.getBoundsCenter(mcRef.mcState.mcPointRef.getBounds(Level.__get__Instance().__get__Ref()));
Level.__get__Instance().doCreateSnack(_local2.x, _local2.y, nSnackType);
}
static var FIRST_DELIVERY_WAIT = 15;
}
Symbol 72 MovieClip [__Packages.Library.Utils.MoreMath] Frame 0
class Library.Utils.MoreMath
{
function MoreMath () {
}
static function getRandomRange(__nMin, __nMax) {
return(Math.floor(Math.random() * ((__nMax + 1) - __nMin)) + __nMin);
}
static function getPolarity(__nNum) {
var _local1 = 0;
if (__nNum < 0) {
_local1 = -1;
} else if (__nNum > 0) {
_local1 = 1;
}
return(_local1);
}
static function getReachZero(__nNum, __nReducer) {
return(getReachNum(__nNum, 0, __nReducer));
}
static function getReachNum(__nNum, __nTargetNum, __nReducer) {
var _local1 = __nNum;
if (_local1 != __nTargetNum) {
if (_local1 < __nTargetNum) {
_local1 = _local1 + __nReducer;
if (_local1 > __nTargetNum) {
_local1 = __nTargetNum;
}
} else {
_local1 = _local1 - __nReducer;
if (_local1 < __nTargetNum) {
_local1 = __nTargetNum;
}
}
}
return(_local1);
}
static function getDistance(__nX1, __nY1, __nX2, __nY2) {
return(Math.sqrt(Math.pow(Math.abs(__nX2 - __nX1), 2) + Math.pow(Math.abs(__nY2 - __nY1), 2)));
}
static function getHypotenuse(__nDX, __nDY) {
return(Math.sqrt(Math.pow(__nDX, 2) + Math.pow(__nDY, 2)));
}
static function getAngle(__nX1, __nY1, __nX2, __nY2) {
var _local2;
var _local1;
var _local4;
var _local3;
_local2 = __nX2 - __nX1;
_local1 = __nY2 - __nY1;
_local4 = Math.atan2(_local1, _local2);
_local3 = getDegreeFromRadius(_local4);
return(_local3);
}
static function getDegreeFromRadius(__nRadius) {
var _local1 = (__nRadius / Math.PI) * 180;
return(_local1);
}
static function getRadianFromDegree(__nDegree) {
var _local1 = __nDegree * (Math.PI/180);
return(_local1);
}
static function getBoundsCenter(_oBox) {
var _local3 = (_oBox.xMin + _oBox.xMax) / 2;
var _local2 = (_oBox.yMin + _oBox.yMax) / 2;
return({x:_local3, y:_local2});
}
}
Symbol 1227 MovieClip [__Packages.Snack] Frame 0
class Snack extends BaseObject
{
var nSpeedX, nSpeedY, nSnackType, nCheckDistance, nObjectType, bRessourceDependant, setState, oDependency, mcRef, __get__Ref, isStateComplete, __get__Hit, doReactVerticalHit, doReactHorizontalHit;
function Snack (__mcRef, __nSnackType) {
super(__mcRef);
nSpeedX = 0;
nSpeedY = 0;
nSnackType = __nSnackType;
nCheckDistance = SNACK_CHECK_DISTANCE;
nObjectType = Level.OBJECT_TYPE_SNACK;
bRessourceDependant = false;
setState("Idle" + nSnackType);
}
function doCradleDepends(__oCradle) {
doSetRotation(0);
doDependOn(BaseObject(__oCradle));
}
function doSnackExplode() {
if (bRessourceDependant) {
oDependency.doSnackExploded(this);
delete oDependency;
}
nSpeedX = 0;
nSpeedY = 0;
setState("Explode" + nSnackType);
}
function doReleaseFromObject() {
bRessourceDependant = false;
delete oDependency;
}
function doSetRotation(__nRotation, __bRelative) {
if (__bRelative == undefined) {
__bRelative = false;
}
if (__bRelative) {
mcRef._rotation = mcRef._rotation + __nRotation;
} else {
mcRef._rotation = __nRotation;
}
}
function doMove(__nSX, __nSY, __bRelative) {
if (__bRelative == undefined) {
__bRelative = true;
}
if (__bRelative) {
doMoveHorizontalTo(__get__Ref()._x + __nSX);
doMoveVerticalTo(__get__Ref()._y + __nSY);
} else {
doMoveHorizontalTo(__nSX);
doMoveVerticalTo(__nSY);
}
}
function doSetSpeeds(__nSX, __nSY, __bRelative) {
if (__bRelative == undefined) {
__bRelative = false;
}
if (__bRelative) {
nSpeedX = nSpeedX + __nSX;
nSpeedY = nSpeedY + __nSY;
} else {
nSpeedX = __nSX;
nSpeedY = __nSY;
}
}
function doEnterFrame() {
super.doEnterFrame();
if (!bRessourceDependant) {
doMoveBothDirections();
} else {
nSpeedX = 0;
nSpeedY = 0;
}
doCheckObjects();
}
function doDestroy() {
Level.__get__Instance().doRemoveObject(this);
mcRef.swapDepths(Level.REMOVE_DEPTH);
mcRef.removeMovieClip();
super.doDestroy();
}
function get SnackType() {
return(nSnackType);
}
function doExplode1() {
doExplode();
}
function doExplode2() {
doExplode();
}
function doExplode3() {
doExplode();
}
function doExplode() {
if (isStateComplete()) {
Level.__get__Instance().doSnackExploded();
doDestroy();
}
}
function doMoveBothDirections() {
doMoveHorizontalTo(__get__Ref()._x + nSpeedX);
doMoveVerticalTo(__get__Ref()._y + nSpeedY);
}
function doCheckObjects() {
var _local4 = Level.__get__Instance().__get__Objects();
for (var _local5 in _local4) {
var _local2 = _local4[_local5];
if (_local2 != this) {
var _local3 = Library.Utils.MoreMath.getDistance(mcRef._x, mcRef._y, _local2.__get__Ref()._x, _local2.__get__Ref()._y);
if (_local3 <= _local2.__get__CheckDistance()) {
if (_local2.__get__Hit().hitTest(__get__Hit())) {
switch (_local2.__get__ObjectType()) {
case Level.OBJECT_TYPE_EXIT_DOOR :
if (DoorExit(_local2).__get__Opened()) {
DoorExit(_local2).doTakeSnack(nSnackType);
doDestroy();
}
break;
case Level.OBJECT_TYPE_SNACK :
Snack(_local2).doSnackExplode();
doSnackExplode();
break;
case Level.OBJECT_TYPE_TREADMILL :
if (!bRessourceDependant) {
doCheckThreadMillHit(_local2);
}
break;
case Level.OBJECT_TYPE_WHEEL :
if (!bRessourceDependant) {
doDependOn(_local2);
}
break;
case Level.OBJECT_TYPE_CRADLE :
break;
case Level.OBJECT_TYPE_CRUNCHER :
doSnackExplode();
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "SnackDestroy.wav");
break;
case Level.OBJECT_TYPE_MEDAL :
Medal(_local2).doReactSnack();
break;
case Level.OBJECT_TYPE_DOOR_SWITCH :
DoorSwitch(_local2).doReactSnack();
}
}
}
}
}
}
function doDependOn(__oObject) {
nSpeedY = 0;
nSpeedX = 0;
if (oDependency != undefined) {
oDependency.doRemoveAffectedSnack(this);
}
bRessourceDependant = true;
oDependency = __oObject;
if (!(__oObject.__get__ObjectType() === Level.OBJECT_TYPE_TREADMILL)) {
} else {
__get__Ref()._y = __oObject.__get__Ref()._y - __oObject.__get__Hit()._height;
}
__oObject.doAffectSnack(this);
}
function doCheckThreadMillHit(_oTM) {
if (Library.Utils.MoreMath.getPolarity(nSpeedY) == -1) {
__get__Ref()._y = (_oTM.__get__Ref()._y + __get__Hit()._height) + (__get__Ref()._y - _oTM.__get__Ref()._y);
doVerticalBounce();
_oTM.doReactVerticalHit(nSpeedY);
} else if ((__get__Ref()._x < (_oTM.__get__Ref()._x + (_oTM.__get__Hit()._width / 2))) && (__get__Ref()._x > (_oTM.__get__Ref()._x - (_oTM.__get__Hit()._width / 2)))) {
doReactVerticalHit(nSpeedY);
_oTM.doReactVerticalHit(nSpeedY);
doDependOn(_oTM);
} else {
doHorizontalBounce();
_oTM.doReactHorizontalHit(nSpeedX);
}
}
function doMoveHorizontalTo(__nFuturePosition) {
var _local2 = false;
if (__nFuturePosition > Level.__get__Instance().__get__Boundaries().right) {
_local2 = true;
__nFuturePosition = Level.__get__Instance().__get__Boundaries().right - (mcRef._width / 2);
nSpeedX = Library.Utils.MoreMath.getReachZero(nSpeedX, BOUNCE_LOSS_HORIZONTAL);
} else if ((__nFuturePosition - (mcRef._width / 2)) < Level.__get__Instance().__get__Boundaries().left) {
_local2 = true;
__nFuturePosition = Level.__get__Instance().__get__Boundaries().left + (mcRef._width / 2);
nSpeedX = Library.Utils.MoreMath.getReachZero(nSpeedX, BOUNCE_LOSS_HORIZONTAL);
}
if (_local2) {
if (nSpeedX != 0) {
doHorizontalBounce();
}
}
mcRef._x = __nFuturePosition;
}
function doMoveVerticalTo(__nFuturePosition) {
var _local2 = false;
if (__nFuturePosition > Level.__get__Instance().__get__Boundaries().bottom) {
doSnackExplode();
} else if ((__nFuturePosition - mcRef._height) < Level.__get__Instance().__get__Boundaries().top) {
_local2 = true;
__nFuturePosition = Level.__get__Instance().__get__Boundaries().top + mcRef._height;
nSpeedY = Library.Utils.MoreMath.getReachZero(nSpeedY, BOUNCE_LOSS_VERTICAL_CEILING);
}
if (!_local2) {
nSpeedY = nSpeedY + ACCELERATION_VERTICAL;
if (Math.abs(nSpeedY) < MINIMUM_SPEED_VERTICAL) {
nSpeedY = 0;
}
} else {
if (nSpeedY != 0) {
doVerticalBounce();
}
doHorizontalFriction();
}
mcRef._y = __nFuturePosition;
}
function doHorizontalFriction() {
nSpeedX = Library.Utils.MoreMath.getReachZero(nSpeedX, FLOOR_FRICTION_HORIZONTAL);
if (Math.abs(nSpeedX) < MINIMUM_SPEED_HORIZONTAL) {
nSpeedX = 0;
}
}
function doHorizontalBounce() {
nSpeedX = nSpeedX * -1;
doReactHorizontalHit(nSpeedX);
}
function doVerticalBounce() {
nSpeedY = nSpeedY * -1;
doReactVerticalHit(nSpeedY);
}
static var SNACK_TYPES_NUMBER = 3;
static var SNACK_CHECK_DISTANCE = 50;
static var BOUNCE_LOSS_VERTICAL_FLOOR = 14;
static var BOUNCE_LOSS_VERTICAL_CEILING = 12;
static var BOUNCE_LOSS_HORIZONTAL = 6;
static var ACCELERATION_VERTICAL = 2.5;
static var FLOOR_FRICTION_HORIZONTAL = 0.4;
static var MINIMUM_SPEED_VERTICAL = 0.2;
static var MINIMUM_SPEED_HORIZONTAL = 0.4;
}
Symbol 1228 MovieClip [__Packages.Cradle] Frame 0
class Cradle extends BaseObject
{
var nRollDirection, nInitialRollDirection, nCradleType, nActionState, nClawMoveSpeed, bNeedToGoBackInitial, nClawInitialPosition, mcRef, nSlowFactor, nDistanceMade, nMaxDistance, nAngle, nObjectType, oClaw, oDropSound, mcRail, oAffectedSnack, nInitialDistanceMade;
function Cradle (__mcRef) {
super(__mcRef);
nRollDirection = DIRECTION_LEFT;
nInitialRollDirection = nRollDirection;
nCradleType = CRADLE_FIXED;
nActionState = ACTION_STATE_IDLE;
nClawMoveSpeed = 0;
bNeedToGoBackInitial = false;
nClawInitialPosition = mcRef.mcState.mcClaw._y;
nSlowFactor = 0;
nDistanceMade = 0;
nMaxDistance = 0;
nAngle = 0;
nObjectType = Level.OBJECT_TYPE_CRADLE;
oClaw = new Library.State(mcRef.mcState.mcClaw);
oClaw.setState("Closed");
doAdjustRopeLength();
doCreateClickEvents();
}
function doPause() {
super.doPause();
oDropSound.doPause();
oClaw.doPause();
}
function doResume() {
super.doResume();
oDropSound.doResume();
oClaw.doResume();
}
function doEnterFrame() {
var _local2 = false;
if (nActionState == ACTION_STATE_MOVING_SNACK) {
_local2 = true;
} else if ((mcRail != undefined) && (nActionState == ACTION_STATE_IDLE)) {
if ((nCradleType == CRADLE_MOVING) || (bNeedToGoBackInitial)) {
_local2 = true;
}
}
if (_local2) {
doMoveCradle();
}
if (HasSnack) {
doManageSnack();
}
if (nActionState == ACTION_STATE_CLAW_DROP) {
doDropClaw();
} else if (nActionState == ACTION_STATE_CLAW_GET_UP) {
doGetClawUp();
}
if (oClaw.__get__CurrentState() == "Release") {
if (oClaw.isStateComplete()) {
oClaw.setState("Closed");
}
}
}
function doReleaseClaw() {
if (Level.__get__Instance().__get__Active()) {
if (nActionState == ACTION_STATE_IDLE) {
Level.__get__Instance().__get__Statistics().doUserClick();
nActionState = ACTION_STATE_CLAW_DROP;
nClawMoveSpeed = 0;
oClaw.setState("Opened");
doCreateClickEvents();
}
}
}
function doUserRelease() {
if (Level.__get__Instance().__get__Active()) {
Level.__get__Instance().__get__Statistics().doUserClick();
oAffectedSnack.__get__Ref()._visible = true;
oAffectedSnack.doSetSpeeds(0, 0);
oAffectedSnack.doReleaseFromObject();
delete oAffectedSnack;
nActionState = ACTION_STATE_IDLE;
oClaw.setState("Release");
nClawMoveSpeed = 0;
if (nCradleType == CRADLE_FIXED) {
bNeedToGoBackInitial = true;
}
doCreateClickEvents();
}
}
function doSnackExploded(__oSnack) {
oAffectedSnack.__get__Ref()._visible = true;
delete oAffectedSnack;
oClaw.setState("Closed");
if (nActionState == ACTION_STATE_MOVING_SNACK) {
nActionState = ACTION_STATE_IDLE;
}
if (nCradleType == CRADLE_FIXED) {
bNeedToGoBackInitial = true;
}
doCreateClickEvents();
}
function doAffectSnack(__oSnack) {
oAffectedSnack = __oSnack;
doManageSnack();
}
function setRollDirection(__nDirection) {
nRollDirection = __nDirection;
nInitialRollDirection = nRollDirection;
}
function setCradleType(__nType) {
nCradleType = __nType;
}
function doUseRail(__mcRail, __nDistance) {
mcRail = __mcRail;
nAngle = mcRail._rotation;
nMaxDistance = __nDistance / 2;
nDistanceMade = Library.Utils.MoreMath.getDistance(mcRef._x, mcRef._y, mcRail._x, mcRail._y);
var _local2 = Library.Utils.MoreMath.getPolarity(mcRef._x - mcRail._x);
nDistanceMade = nDistanceMade * _local2;
nInitialDistanceMade = nDistanceMade;
doMoveCradle();
}
function doSoundEvent(__nEvent, __oSound) {
delete oDropSound;
}
function doDestroy() {
super.doDestroy();
}
function get HasSnack() {
return(oAffectedSnack != undefined);
}
function doGetClawUp() {
nClawMoveSpeed = nClawMoveSpeed + CLAW_GET_UP_ACCELERATION;
if (nClawMoveSpeed > CLAW_GET_UP_SPEED_MAX) {
nClawMoveSpeed = CLAW_GET_UP_SPEED_MAX;
}
mcRef.mcState.mcClaw._y = mcRef.mcState.mcClaw._y - nClawMoveSpeed;
if (mcRef.mcState.mcClaw._y <= nClawInitialPosition) {
mcRef.mcState.mcClaw._y = nClawInitialPosition;
nClawMoveSpeed = 0;
if (HasSnack) {
nActionState = ACTION_STATE_MOVING_SNACK;
} else {
nActionState = ACTION_STATE_IDLE;
if (nCradleType == CRADLE_FIXED) {
bNeedToGoBackInitial = true;
}
}
doCreateClickEvents();
}
doAdjustRopeLength();
}
function doDropClaw() {
nClawMoveSpeed = nClawMoveSpeed + CLAW_DROP_ACCELERATION;
if (nClawMoveSpeed > CLAW_DROP_SPEED_MAX) {
nClawMoveSpeed = CLAW_DROP_SPEED_MAX;
}
mcRef.mcState.mcClaw._y = mcRef.mcState.mcClaw._y + nClawMoveSpeed;
var _local6 = Level.__get__Instance().__get__Objects();
var _local3;
_local3 = 0;
while (_local3 <= (_local6.length - 1)) {
var _local2 = _local6[_local3];
if (_local2 != this) {
var _local4 = Library.Utils.MoreMath.getBoundsCenter(mcRef.mcState.mcClaw.getBounds(Level.__get__Instance().__get__Ref()));
var _local5 = Library.Utils.MoreMath.getDistance(_local4.x, _local4.y, _local2.__get__Ref()._x, _local2.__get__Ref()._y);
if (_local5 <= _local2.__get__CheckDistance()) {
if (_local2.__get__Hit().hitTest(mcRef.mcState.mcClaw.mcState.mcHit)) {
switch (_local2.__get__ObjectType()) {
case Level.OBJECT_TYPE_SNACK :
Snack(_local2).doCradleDepends(this);
oAffectedSnack.__get__Ref()._visible = false;
nClawMoveSpeed = 0;
bNeedToGoBackInitial = false;
nActionState = ACTION_STATE_CLAW_GET_UP;
oClaw.setState("WithSnack");
oDropSound = Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "Cradle.wav");
oDropSound.doAddListener(this);
mcRef.mcState.mcClaw.mcState.mcSnack.gotoAndStop(oAffectedSnack.__get__SnackType());
break;
case Level.OBJECT_TYPE_TREADMILL :
case Level.OBJECT_TYPE_WHEEL :
case Level.OBJECT_TYPE_CRUNCHER :
nClawMoveSpeed = 0;
nActionState = ACTION_STATE_CLAW_GET_UP;
oClaw.setState("Closed");
oDropSound = Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "Cradle.wav");
oDropSound.doAddListener(this);
}
}
}
}
_local3++;
}
doAdjustRopeLength();
}
function doMoveCradle() {
var _local2;
var _local3;
if (nRollDirection == DIRECTION_LEFT) {
_local3 = -1;
} else {
_local3 = 1;
}
if (bNeedToGoBackInitial) {
if (Library.Utils.MoreMath.getPolarity(nInitialDistanceMade) == 1) {
nRollDirection = DIRECTION_RIGHT;
} else {
nRollDirection = DIRECTION_LEFT;
}
_local2 = nInitialDistanceMade;
} else if (nRollDirection == DIRECTION_LEFT) {
_local2 = -nMaxDistance;
} else {
_local2 = nMaxDistance;
}
var _local5 = _local3 * MOVE_SPEED;
if (Math.abs(nDistanceMade) >= (Math.abs(_local2) * PERCENT_DIST_MADE_DECEL)) {
if (_local3 == Library.Utils.MoreMath.getPolarity(nDistanceMade)) {
nSlowFactor = nSlowFactor - DECEL_ON_EDGES;
if (nSlowFactor < MAX_SLOW_FACTOR) {
nSlowFactor = MAX_SLOW_FACTOR;
}
} else {
nSlowFactor = nSlowFactor + DECEL_ON_EDGES;
if (nSlowFactor > 1) {
nSlowFactor = 1;
}
}
_local5 = _local5 * nSlowFactor;
} else {
nSlowFactor = 1;
}
nDistanceMade = nDistanceMade + _local5;
var _local6 = Library.Utils.MoreMath.getRadianFromDegree(nAngle);
var _local7 = Math.cos(_local6) * nDistanceMade;
var _local8 = Math.sin(_local6) * nDistanceMade;
mcRef._x = mcRail._x + _local7;
mcRef._y = mcRail._y + _local8;
if (nRollDirection == DIRECTION_LEFT) {
if (nDistanceMade < _local2) {
nRollDirection = DIRECTION_RIGHT;
}
} else if (nDistanceMade > _local2) {
nRollDirection = DIRECTION_LEFT;
}
if (bNeedToGoBackInitial) {
var _local4 = false;
if (nRollDirection == DIRECTION_LEFT) {
if (nDistanceMade < (_local2 + ACCEPTED_RETURN_POS_DISTANCE)) {
_local4 = true;
}
} else if (nDistanceMade > (_local2 - ACCEPTED_RETURN_POS_DISTANCE)) {
_local4 = true;
}
if (_local4) {
nActionState = ACTION_STATE_IDLE;
bNeedToGoBackInitial = false;
nRollDirection = nInitialRollDirection;
}
}
}
function doAdjustRopeLength() {
var _local3 = mcRef.mcState.mcRopeStart._y;
var _local4 = mcRef.mcState.mcClaw._y;
var _local2 = _local4 - _local3;
mcRef.mcState.mcRope._height = _local2;
}
function doManageSnack() {
var _local3;
if (nRollDirection == DIRECTION_LEFT) {
_local3 = -1;
} else {
_local3 = 1;
}
var _local2 = Library.Utils.MoreMath.getBoundsCenter(mcRef.mcState.mcClaw.getBounds(Level.__get__Instance().__get__Ref()));
oAffectedSnack.__get__Ref()._x = _local2.x;
oAffectedSnack.__get__Ref()._y = _local2.y;
}
function doCreateClickEvents() {
if (HasSnack) {
mcRef.mcState.btnGeneralClick.onRelease = Library.Utils.Delegate.create(this, doUserRelease);
} else if (nActionState == ACTION_STATE_IDLE) {
mcRef.mcState.btnGeneralClick.onRelease = Library.Utils.Delegate.create(this, doReleaseClaw);
} else {
delete mcRef.mcState.btnGeneralClick.onRelease;
}
}
static var CRADLE_CHECK_DISTANCE = 0;
static var DIRECTION_LEFT = 1;
static var DIRECTION_RIGHT = 2;
static var ACTION_STATE_IDLE = 1;
static var ACTION_STATE_CLAW_DROP = 2;
static var ACTION_STATE_MOVING_SNACK = 3;
static var ACTION_STATE_CLAW_GET_UP = 4;
static var CRADLE_FIXED = 1;
static var CRADLE_MOVING = 2;
static var ACCEPTED_RETURN_POS_DISTANCE = 5;
static var MOVE_SPEED = 1.2;
static var CLAW_DROP_SPEED_MAX = 13;
static var CLAW_DROP_ACCELERATION = 1.4;
static var CLAW_GET_UP_SPEED_MAX = 4;
static var CLAW_GET_UP_ACCELERATION = 0.1;
static var PERCENT_DIST_MADE_DECEL = 0.8;
static var DECEL_ON_EDGES = 0.06;
static var MAX_SLOW_FACTOR = 0.5;
}
Symbol 69 MovieClip [__Packages.Library.Sound.SoundItem] Frame 0
class Library.Sound.SoundItem
{
var sndObj, sLinkage, mcRef, nRemainingLoop, nCurrentVolume, nTargetVolume, nFadeRate, sCategory, bFadeAtEnd, bMuted, bPaused, bNeedFreshStart, nCurrentTime, aEventListeners, bStopAfterFade;
function SoundItem (__sndObject, __sLinkage, __nVolume, __nLoop, __sCategory, __mc) {
sndObj = __sndObject;
sLinkage = __sLinkage;
mcRef = __mc;
nRemainingLoop = __nLoop;
nCurrentVolume = __nVolume;
nTargetVolume = __nVolume;
nFadeRate = FADE_RATE;
sCategory = __sCategory;
bFadeAtEnd = false;
bMuted = false;
bPaused = false;
bNeedFreshStart = false;
sndObj.onSoundComplete = mx.utils.Delegate.create(this, doSoundComplete);
sndObj.start(0, __nLoop);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
nCurrentTime = 0;
aEventListeners = new Array();
}
function doEnterFrame() {
if (!bPaused) {
if (nCurrentTime > sndObj.position) {
nRemainingLoop--;
}
nCurrentTime = sndObj.position;
}
doCheckFadeAtEnd();
doManageFade();
}
function doAddListener(__oListener) {
aEventListeners.push(__oListener);
}
function doRemoveListener(__oListener) {
var _local2 = 0;
while (_local2 < aEventListeners.length) {
if (aEventListeners[_local2] == __oListener) {
delete aEventListeners[_local2];
aEventListeners.splice(_local2, 1);
}
_local2++;
}
}
function doSoundComplete() {
if (bNeedFreshStart && (nRemainingLoop > 1)) {
sndObj.start(0, nRemainingLoop - 1);
} else {
doManageEndEvent();
}
}
function doUpdateSound() {
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
function doMute() {
bMuted = true;
doUpdateSound();
}
function doUnMute() {
bMuted = false;
doUpdateSound();
}
function doPause() {
sndObj.stop();
bPaused = true;
}
function doResume() {
bPaused = false;
bNeedFreshStart = true;
sndObj.start(nCurrentTime / 1000, 1);
}
function doStop() {
sndObj.stop();
doManageEndEvent();
}
function doFadeTo(__nVolume, __bStopAndDelete) {
if (__bStopAndDelete == undefined) {
__bStopAndDelete = true;
}
bStopAfterFade = __bStopAndDelete;
nTargetVolume = __nVolume;
}
function setFadeRate(__nRate) {
if (__nRate == undefined) {
__nRate = FADE_RATE;
}
nFadeRate = __nRate;
}
function setFadeAtEnd(__bFadeAtEnd) {
bFadeAtEnd = true;
}
function setPan(__nPan) {
sndObj.setPan(__nPan);
}
function get Category() {
return(sCategory);
}
function get LinkageName() {
return(sLinkage);
}
function doDestroy() {
sndObj.stop();
delete sndObj;
mcRef.removeMovieClip();
}
function doCheckFadeAtEnd() {
if (bFadeAtEnd) {
if (nRemainingLoop == 1) {
if ((sndObj.duration - nCurrentTime) <= FADE_AT_END_TIME) {
doFadeTo(0);
}
}
}
}
function doManageEndEvent() {
var _local2 = 0;
while (_local2 < aEventListeners.length) {
aEventListeners[_local2].doSoundEvent(Library.Sound.SoundManager.EVENT_SOUND_COMPLETE, this);
_local2++;
}
aEventListeners = new Array();
mcRef.removeMovieClip();
delete mcRef;
delete aEventListeners;
delete sndObj.onSoundComplete;
delete sndObj;
}
function doManageFade() {
if (nCurrentVolume != nTargetVolume) {
nCurrentVolume = Library.Utils.MoreMath.getReachNum(nCurrentVolume, nTargetVolume, nFadeRate);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
if ((nCurrentVolume <= 0) && (bStopAfterFade)) {
sndObj.stop();
doManageEndEvent();
}
}
function returnComputedVolume(__nVolume) {
var _local2;
if ((!bMuted) && (!Library.Sound.SoundManager.isCategoryMuted(sCategory))) {
var _local3 = Library.Sound.SoundManager.__get__MasterVolume() / 100;
var _local4 = Library.Sound.SoundManager.getCategoryVolume(sCategory) / 100;
_local2 = __nVolume;
_local2 = _local2 * _local4;
_local2 = _local2 * _local3;
} else {
_local2 = 0;
}
return(_local2);
}
static var FADE_RATE = 8;
static var FADE_AT_END_TIME = 800;
}
Symbol 71 MovieClip [__Packages.Library.Sound.SoundManager] Frame 0
class Library.Sound.SoundManager
{
static var aSounds, mcAttach, nSoundNum, aSoundCategories, nMasterVolume, oEnterFrameListener;
function SoundManager () {
}
static function doPlaySound(__sLinkage, __nVolume, __nLoop, __bUnique) {
return(doPlaySoundInCat(DEFAULT_CATEGORY, __sLinkage, __nVolume, __nLoop, __bUnique));
}
static function doPlaySoundInCat(__sCategoryName, __sLinkage, __nVolume, __nLoop, __bUnique) {
doCheckInit();
var _local1;
if (NewSoundAllowed) {
if (__nVolume == undefined) {
__nVolume = 100;
}
if (__nLoop == undefined) {
__nLoop = 1;
}
if (__bUnique == undefined) {
__bUnique = false;
}
var _local2;
if (__bUnique) {
var _local4 = isSoundPlaying(__sLinkage);
_local2 = _local4.bPlaying;
if (!_local2) {
_local1 = _local4.oSound;
}
} else {
_local2 = true;
}
if (_local2) {
doManageCategory(__sCategoryName);
var _local5 = getMCForSound();
var _local3 = new Sound(_local5);
_local3.attachSound(__sLinkage);
if (_local3.duration != undefined) {
_local1 = new Library.Sound.SoundItem(_local3, __sLinkage, __nVolume, __nLoop, __sCategoryName, _local5);
}
_local1.doAddListener(Library.Sound.SoundManager);
aSounds.push(_local1);
}
}
return(_local1);
}
static function isSoundPlaying(__sLinkageName) {
var _local1 = new Object();
_local1.bPlaying = false;
_local1.oSound = undefined;
for (var _local3 in aSounds) {
if (aSounds[_local3].LinkageName == __sLinkageName) {
_local1.oSound = aSounds[_local3];
_local1.bPlaying = true;
}
}
return(_local1);
}
static function doManageExternalSound(__oSound) {
doCheckInit();
doManageCategory(__oSound.__get__Category());
__oSound.doAddListener(Library.Sound.SoundManager);
aSounds.push(__oSound);
}
static function getMCForSound() {
var _local1 = getNextDepth();
var _local2 = mcAttach.createEmptyMovieClip("Snd" + _local1, _local1);
return(_local2);
}
static function getNextDepth() {
nSoundNum++;
return(nSoundNum);
}
static function doInit(__mcAttach) {
mcAttach = __mcAttach;
if (!bInited) {
bInited = true;
nSoundNum = 0;
aSounds = new Array();
aSoundCategories = new Array();
nMasterVolume = 100;
_global.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = Library.Utils.Delegate.create(Library.Sound.SoundManager, doEnterFrame);
_global.MovieClip.addListener(oEnterFrameListener);
}
}
static function doEnterFrame() {
for (var _local1 in aSounds) {
aSounds[_local1].doEnterFrame();
}
}
static function setCategoryVolume(__sCategoryName, __nVol) {
doManageCategory(__sCategoryName);
for (var _local3 in aSoundCategories) {
if (aSoundCategories[_local3].sName == __sCategoryName) {
aSoundCategories[_local3].nVolume = __nVol;
}
}
doUpdateAllSoundsVolume();
}
static function getCategoryVolume(__sCategoryName) {
doManageCategory(__sCategoryName);
var _local1;
for (var _local3 in aSoundCategories) {
if (aSoundCategories[_local3].sName == __sCategoryName) {
_local1 = aSoundCategories[_local3].nVolume;
}
}
return(_local1);
}
static function isCategoryMuted(__sCategoryName) {
doManageCategory(__sCategoryName);
var _local1;
for (var _local3 in aSoundCategories) {
if (aSoundCategories[_local3].sName == __sCategoryName) {
_local1 = aSoundCategories[_local3].bMuted;
}
}
return(_local1);
}
static function doSoundEvent(__nEvent, __oSound) {
if (!(__nEvent === EVENT_SOUND_COMPLETE)) {
} else {
var _local1 = false;
for (var _local3 in aSounds) {
if (!_local1) {
if (aSounds[_local3] == __oSound) {
_local1 = true;
delete aSounds[_local3];
aSounds.splice(Number(_local3), 1);
}
}
}
}
}
static function doMuteCategory(__sCategoryName) {
for (var _local2 in aSoundCategories) {
if (aSoundCategories[_local2].sName == __sCategoryName) {
aSoundCategories[_local2].bMuted = true;
}
}
doUpdateAllSoundsVolume();
}
static function doUnMuteCategory(__sCategoryName) {
for (var _local2 in aSoundCategories) {
if (aSoundCategories[_local2].sName == __sCategoryName) {
aSoundCategories[_local2].bMuted = false;
}
}
doUpdateAllSoundsVolume();
}
static function setMasterVolume(__nVol) {
nMasterVolume = __nVol;
doUpdateAllSoundsVolume();
}
static function get NewSoundAllowed() {
return(aSounds.length < MAX_SOUNDS_PLAYING);
}
static function get MasterVolume() {
return(nMasterVolume);
}
static function doRemoveListenerFromAllSounds(__oListener) {
for (var _local2 in aSounds) {
aSounds[_local2].doRemoveListener(__oListener);
}
}
static function doDestroy() {
doRemoveListenerFromAllSounds();
for (var _local1 in aSounds) {
aSounds[_local1].doDestroy();
}
}
static function doUpdateAllSoundsVolume() {
for (var _local1 in aSounds) {
aSounds[_local1].doUpdateSound();
}
}
static function doCheckInit() {
if (!bInited) {
}
}
static function doManageCategory(__sCategoryName) {
doCheckInit();
var _local1 = false;
for (var _local4 in aSoundCategories) {
if (aSoundCategories[_local4].sName == __sCategoryName) {
_local1 = true;
}
}
if (!_local1) {
var _local3 = new Object();
_local3.sName = __sCategoryName;
_local3.nVolume = 100;
_local3.bMuted = false;
aSoundCategories.push(_local3);
}
}
static var EVENT_SOUND_COMPLETE = 1;
static var DEFAULT_CATEGORY = "SFX";
static var MAX_SOUNDS_PLAYING = 8;
static var bInited = false;
}
Symbol 1229 MovieClip [__Packages.DoorExit] Frame 0
class DoorExit extends BaseObject
{
var nCheckDistance, nObjectType, aSwitches, setState, nSnackType, __get__CurrentState, mcRef, isStateComplete;
function DoorExit (__mcRef) {
super(__mcRef);
nCheckDistance = EXIT_DOOR_CHECK_DISTANCE;
nObjectType = Level.OBJECT_TYPE_EXIT_DOOR;
aSwitches = new Array();
setState("Opened");
}
function doSwitchToggled() {
var _local3 = true;
var _local2 = 0;
while (_local2 <= (aSwitches.length - 1)) {
if (!aSwitches[_local2].Active) {
_local3 = false;
}
_local2++;
}
if (_local3) {
setState("Opened");
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "DoorOpen.wav");
} else {
setState("Closed");
}
}
function doAddSwitch(__oSwitch) {
aSwitches.push(__oSwitch);
doSwitchToggled();
}
function doTakeSnack(__nSnackType) {
nSnackType = __nSnackType;
setState("SnackEnter");
}
function get Opened() {
return(__get__CurrentState() == "Opened");
}
function doSnackEnter() {
mcRef.mcState.mcSnack.gotoAndStop(nSnackType);
if (isStateComplete()) {
setState("Opened");
Level.__get__Instance().doSnackPassedDoor(nSnackType);
}
}
function doLoadStateAction() {
mcRef.mcState.mcSnack.gotoAndStop(nSnackType);
}
static var EXIT_DOOR_CHECK_DISTANCE = 50;
}
Symbol 1230 MovieClip [__Packages.DoorSwitch] Frame 0
class DoorSwitch extends BaseObject
{
var nCheckDistance, nObjectType, bNeedDepthAdjustement, bSearchingForAffectation, nSearchedTime, setState, __get__CurrentState, isStateComplete;
function DoorSwitch (__mcRef) {
super(__mcRef);
nCheckDistance = SWITCH_CHECK_DISTANCE;
nObjectType = Level.OBJECT_TYPE_DOOR_SWITCH;
bNeedDepthAdjustement = false;
bSearchingForAffectation = true;
nSearchedTime = SEARCH_MAX_TIME;
setState("Off");
}
function doReactSnack() {
if (__get__CurrentState() == "Off") {
setState("OffToOn");
}
}
function doEnterFrame() {
super.doEnterFrame();
if (bSearchingForAffectation) {
if (nSearchedTime > 0) {
nSearchedTime--;
doSearchExitDoor();
} else {
bSearchingForAffectation = false;
}
}
}
function doDestroy() {
super.doDestroy();
}
function get Active() {
return(__get__CurrentState() == "On");
}
function doOffToOn() {
if (isStateComplete()) {
setState("On");
Level.__get__Instance().__get__ExitDoor().doSwitchToggled();
}
}
function doSearchExitDoor() {
if (Level.__get__Instance().__get__ExitDoor() != undefined) {
bSearchingForAffectation = false;
Level.__get__Instance().__get__ExitDoor().doAddSwitch(this);
}
}
static var SWITCH_CHECK_DISTANCE = 60;
static var SEARCH_MAX_TIME = 2;
}
Symbol 1231 MovieClip [__Packages.Medal] Frame 0
class Medal extends BaseObject
{
var nCheckDistance, nObjectType, bNeedDepthAdjustement, nDepthModifier, setState, __get__CurrentState, isStateComplete;
function Medal (__mcRef) {
super(__mcRef);
nCheckDistance = MEDAL_CHECK_DISTANCE;
nObjectType = Level.OBJECT_TYPE_MEDAL;
bNeedDepthAdjustement = false;
nDepthModifier = 5500;
Level.__get__Instance().doManageObjectDepth(this);
setState("Idle");
}
function doReactSnack() {
if (__get__CurrentState() == "Idle") {
Level.__get__Instance().__get__Statistics().doMedalCollected();
setState("Out");
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "Medal.wav");
}
}
function doDestroy() {
super.doDestroy();
}
function doOut() {
if (isStateComplete()) {
doDestroy();
}
}
static var MEDAL_CHECK_DISTANCE = 60;
}
Symbol 1232 MovieClip [__Packages.SnackDispenser] Frame 0
class SnackDispenser extends BaseObject
{
var nSnackToEat, nDepth, mcRef, aFallingSnacks, setState, doLockState, isStateComplete, __get__CurrentState, sState;
function SnackDispenser (__mcRef) {
super(__mcRef);
nSnackToEat = 0;
nDepth = 0;
mcRef.mcScoobyBowlFront.swapDepths(250000);
aFallingSnacks = new Array();
setState("Idle");
}
function doEnterFrame() {
super.doEnterFrame();
var _local3;
_local3 = 0;
while (_local3 <= aFallingSnacks.length) {
if (aFallingSnacks[_local3].nFrames != undefined) {
if (aFallingSnacks[_local3].nFrames <= 0) {
aFallingSnacks[_local3].mc.removeMovieClip();
onSnackFallComplete(aFallingSnacks[_local3].nSnackType, aFallingSnacks[_local3].nRotateRate * aFallingSnacks[_local3].nFrames);
aFallingSnacks.splice(_local3, 1);
} else {
aFallingSnacks[_local3].nFrames--;
aFallingSnacks[_local3].mc._x = aFallingSnacks[_local3].mc._x + aFallingSnacks[_local3].nSpeedX;
aFallingSnacks[_local3].mc._y = aFallingSnacks[_local3].mc._y + aFallingSnacks[_local3].nSpeedY;
if (aFallingSnacks[_local3].bRotation) {
aFallingSnacks[_local3].mc._rotation = aFallingSnacks[_local3].mc._rotation + aFallingSnacks[_local3].nRotateRate;
}
}
}
_local3++;
}
}
function doReceiveSnack(__nSnackType) {
var _local5 = Library.Utils.MoreMath.getBoundsCenter(Level.__get__Instance().__get__ExitDoor().__get__Ref().getBounds(mcRef));
var _local4 = mcRef.attachMovie("Dynamic_Snack", "Snack" + nDepth, nDepth);
_local4.gotoAndStop("Idle" + __nSnackType);
_local4._x = _local5.x;
_local4._y = _local5.y;
var _local2 = new Object();
_local2.mc = _local4;
var _local8 = 25;
var _local7 = mcRef.mcSnackTarget._x - _local5.x;
var _local6 = mcRef.mcSnackTarget._y - _local5.y;
var _local3 = Library.Utils.MoreMath.getHypotenuse(_local7, _local6) / _local8;
_local3 = Math.round(_local3);
_local2.nFrames = _local3;
_local2.nSnackType = __nSnackType;
_local2.nSpeedX = _local7 / _local3;
_local2.nSpeedY = _local6 / _local3;
if (_local6 < 50) {
_local2.bRotation = false;
_local2.nRotateRate = 0;
} else {
_local2.bRotation = true;
_local2.nRotateRate = Library.Utils.MoreMath.getRandomRange(180, 360) / _local3;
}
aFallingSnacks.push(_local2);
}
function doUnhappy() {
setState("Frightfull");
doLockState();
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "ScoobyScared.wav");
}
function doFrightfull() {
if (isStateComplete()) {
mcRef.mcState.stop();
Level.__get__Instance().onSnackLostComplete();
}
}
function doSnackArrives() {
if (isStateComplete()) {
nSnackToEat--;
var _local2 = true;
if (nSnackToEat <= 0) {
if (aFallingSnacks.length == 0) {
_local2 = false;
}
setState("Idle");
} else {
if (__get__CurrentState() == "SnackArrives") {
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "ScoobyEat.wav");
}
setState("SnackArrives");
}
Level.__get__Instance().doSnackGiven(_local2);
}
}
function onSnackFallComplete(__nSnackType, __nRotation) {
nSnackToEat++;
if (__get__CurrentState() != "SnackArrives") {
setState("SnackArrives");
}
mcRef.mcState.mcSnack._visible = true;
mcRef.mcState.mcSnack.gotoAndStop("Idle" + __nSnackType);
mcRef.mcState.mcSnack._rotation = __nRotation;
}
function doLoadStateAction() {
if (!(sState === "SnackArrives")) {
} else {
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "ScoobyEat.wav");
}
}
}
Symbol 1233 MovieClip [__Packages.TreadMill] Frame 0
class TreadMill extends BaseObject
{
var nRollDirection, nTreadSize, nCheckDistance, nObjectType, aAffectedSnacks, doBounce, __get__Ref, setState, mcRef;
function TreadMill (__mcRef) {
super(__mcRef);
nRollDirection = ROLL_LEFT;
nTreadSize = SIZE_SMALL;
nCheckDistance = TREAD_CHECK_DISTANCE[nTreadSize];
nObjectType = Level.OBJECT_TYPE_TREADMILL;
aAffectedSnacks = new Array();
doChangeVisual();
}
function doUserRelease() {
if (Level.__get__Instance().__get__Active()) {
Level.__get__Instance().__get__Statistics().doUserClick();
var _local2 = Library.Utils.Tools.doCopyArray(aAffectedSnacks);
for (var _local3 in _local2) {
doReleaseSnack(_local2[_local3], RELEASE_USER);
}
}
}
function doAffectSnack(__oSnack) {
aAffectedSnacks.push(__oSnack);
doVerifySnack(__oSnack);
}
function setThreadSize(__nSize) {
nTreadSize = __nSize;
doChangeVisual();
}
function doUserToggleDirection() {
if (Level.__get__Instance().__get__Active()) {
Level.__get__Instance().__get__Statistics().doUserClick();
if (nRollDirection == ROLL_LEFT) {
setRollDirection(ROLL_RIGHT);
} else {
setRollDirection(ROLL_LEFT);
}
}
}
function setRollDirection(__nDirection) {
nRollDirection = __nDirection;
doChangeVisual();
}
function doEnterFrame() {
super.doEnterFrame();
for (var _local3 in aAffectedSnacks) {
doVerifySnack(aAffectedSnacks[_local3]);
}
}
function doSnackExploded(__oSnack) {
doRemoveAffectedSnack(__oSnack);
}
function doRemoveAffectedSnack(__oSnack) {
for (var _local2 in aAffectedSnacks) {
if (aAffectedSnacks[_local2] == __oSnack) {
aAffectedSnacks.splice(_local2, 1);
}
}
}
function doDestroy() {
super.doDestroy();
}
function doReleaseSnack(__oSnack, __nReleaseMethod) {
var _local4;
var _local3;
var _local2;
if (nRollDirection == ROLL_LEFT) {
_local2 = -1;
} else {
_local2 = 1;
}
switch (__nReleaseMethod) {
case RELEASE_AUTO :
_local4 = (_local2 * TREAD_ROLL_SPEED) * AUTOMATIC_RELEASE_HORIZONTAL_SPEED_RATIO;
_local3 = -AUTOMATIC_RELEASE_VERTICAL_SPEED;
break;
case RELEASE_USER :
_local4 = (_local2 * TREAD_ROLL_SPEED) * USER_RELEASE_HORIZONTAL_SPEED_RATIO;
_local3 = -USER_RELEASE_VERTICAL_SPEED;
}
__oSnack.doReleaseFromObject();
__oSnack.doSetSpeeds(_local4, _local3);
doRemoveAffectedSnack(__oSnack);
doBounce(_local4, _local3);
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "BoingTreadMill.wav");
}
function doVerifySnack(__oSnack) {
var _local3;
if (nRollDirection == ROLL_LEFT) {
_local3 = -1;
} else {
_local3 = 1;
}
__oSnack.doMove(_local3 * TREAD_ROLL_SPEED);
var _local2 = false;
if (nRollDirection == ROLL_LEFT) {
var _local6 = (__get__Ref()._x - (__get__Ref()._width / 2)) + SNACK_AUTO_RELEASE_DISTANCE;
if (__oSnack.__get__Ref()._x < _local6) {
_local2 = true;
}
} else {
var _local5 = (__get__Ref()._x + (__get__Ref()._width / 2)) - SNACK_AUTO_RELEASE_DISTANCE;
if (__oSnack.__get__Ref()._x > _local5) {
_local2 = true;
}
}
if (_local2) {
doReleaseSnack(__oSnack, RELEASE_AUTO);
}
}
function doChangeVisual() {
var _local2;
var _local3;
switch (nTreadSize) {
case SIZE_SMALL :
_local2 = "Small";
break;
case SIZE_MEDIUM :
_local2 = "Medium";
break;
case SIZE_BIG :
_local2 = "Long";
}
switch (nRollDirection) {
case ROLL_LEFT :
_local3 = "Left";
break;
case ROLL_RIGHT :
_local3 = "Right";
}
var _local4 = ("Roll" + _local3) + _local2;
setState(_local4);
}
function doLoadStateAction() {
var _local2;
switch (nRollDirection) {
case ROLL_LEFT :
_local2 = "Left";
break;
case ROLL_RIGHT :
_local2 = "Right";
}
mcRef.mcState.mcSide1.gotoAndStop(_local2);
mcRef.mcState.mcSide2.gotoAndStop(_local2);
doCreateClickEvents();
}
function doCreateClickEvents() {
mcRef.mcState.btnGeneralClick.onRelease = Library.Utils.Delegate.create(this, doUserRelease);
mcRef.mcState.mcSide1.btnChange.onRelease = Library.Utils.Delegate.create(this, doUserToggleDirection);
mcRef.mcState.mcSide2.btnChange.onRelease = Library.Utils.Delegate.create(this, doUserToggleDirection);
}
static var TREAD_CHECK_DISTANCE = [80, 130, 180];
static var TREAD_ROLL_SPEED = 0.85;
static var SNACK_AUTO_RELEASE_DISTANCE = 2;
static var USER_RELEASE_VERTICAL_SPEED = 14;
static var AUTOMATIC_RELEASE_VERTICAL_SPEED = 10;
static var USER_RELEASE_HORIZONTAL_SPEED_RATIO = 6;
static var AUTOMATIC_RELEASE_HORIZONTAL_SPEED_RATIO = 4;
static var RELEASE_AUTO = 1;
static var RELEASE_USER = 2;
static var ROLL_LEFT = 1;
static var ROLL_RIGHT = 2;
static var SIZE_SMALL = 1;
static var SIZE_MEDIUM = 2;
static var SIZE_BIG = 3;
}
Symbol 75 MovieClip [__Packages.Library.Utils.Tools] Frame 0
class Library.Utils.Tools
{
function Tools () {
}
static function isItemInArray(__aArray, __oItem) {
var _local2 = false;
for (var _local4 in __aArray) {
if (__aArray[_local4] == __oItem) {
_local2 = true;
}
}
return(_local2);
}
static function doCopyArray(__aArraySource) {
var _local3 = new Array();
var _local1 = 0;
_local1 = 0;
while (_local1 < __aArraySource.length) {
if (__aArraySource[_local1] instanceof Array) {
_local3.push(doCopyArray(__aArraySource[_local1]));
} else {
_local3.push(__aArraySource[_local1]);
}
_local1++;
}
return(_local3);
}
static function getFormatedNumber(__nNumber, __nMinimumChar) {
return(returnFormatedNumber(__nNumber, __nMinimumChar));
}
static function returnFormatedNumber(__nNumber, __nMinimumChar) {
var _local1 = String(__nNumber);
while (_local1.length < __nMinimumChar) {
_local1 = "0" + _local1;
}
var _local3 = new Array();
var _local6 = _local1.length - 1;
var _local2;
_local2 = 0;
while (_local2 <= _local6) {
var _local5 = _local1.charAt(_local2);
_local3.push(_local5);
_local2++;
}
_local1 = "";
var _local4 = 0;
_local2 = _local3.length - 1;
while (_local2 >= 0) {
if (((_local4 % 3) == 0) && (_local4 != 0)) {
_local1 = " " + _local1;
}
_local1 = _local3[_local2] + _local1;
_local4++;
_local2--;
}
return(_local1);
}
static function getFormatedTime(__nTime, __bIncludeMilliseconds) {
if (__bIncludeMilliseconds == undefined) {
__bIncludeMilliseconds = false;
}
var _local6 = false;
if (__nTime < 0) {
_local6 = true;
__nTime = Math.abs(__nTime);
}
var _local4 = Math.floor(__nTime / 1000);
var _local3;
if (__bIncludeMilliseconds) {
var _local5;
if (__nTime >= 1000) {
_local5 = __nTime % (_local4 * 1000);
} else {
_local5 = __nTime;
}
_local3 = String(_local5).substr(0, 2);
if (_local3.length <= 1) {
_local3 = "0" + _local3;
}
}
var _local8 = Math.floor(_local4 / 60);
var _local9 = Math.floor(_local4 % 60);
var _local11 = "";
var _local10 = "";
if (_local9 < 10) {
_local10 = "0";
}
if (_local8 < 10) {
_local11 = "0";
}
var _local2 = String((((_local11 + _local8) + ":") + _local10) + _local9);
if (__bIncludeMilliseconds) {
_local2 = _local2 + (":" + _local3);
}
if (_local6) {
_local2 = "-" + _local2;
}
return(_local2);
}
}
Symbol 1234 MovieClip [__Packages.WheelRail] Frame 0
class WheelRail
{
var mcRef, nSlowFactor, nAngle, nDistanceMade, nDirection, nMaxDistance, bSearchingForAffectation, nSearchedTime, oWheelAffected;
function WheelRail (__mcRef) {
mcRef = __mcRef;
nSlowFactor = 1;
nAngle = 0;
nDistanceMade = 0;
nDirection = DIRECTION_LEFT;
nMaxDistance = (mcRef._width / 2) - EDGE_BUFFER;
bSearchingForAffectation = true;
nSearchedTime = SEARCH_MAX_TIME;
Level.__get__Instance().doAddListener(this);
}
function setRotation(__nAngle) {
nAngle = __nAngle;
mcRef._rotation = nAngle;
}
function setInitialDirection(__nDirection) {
nDirection = __nDirection;
}
function doEnterFrame() {
if (bSearchingForAffectation) {
if (nSearchedTime > 0) {
nSearchedTime--;
doSearchWheel();
} else {
bSearchingForAffectation = false;
}
} else {
doMoveWheel();
}
}
function doDestroy() {
delete oWheelAffected;
}
function doMoveWheel() {
var _local2;
if (nDirection == DIRECTION_LEFT) {
_local2 = -1;
} else {
_local2 = 1;
}
var _local3 = _local2 * MOVE_SPEED;
if (Math.abs(nDistanceMade) >= (nMaxDistance * PERCENT_DIST_MADE_DECEL)) {
if (_local2 == Library.Utils.MoreMath.getPolarity(nDistanceMade)) {
nSlowFactor = nSlowFactor - DECEL_ON_EDGES;
if (nSlowFactor < MAX_SLOW_FACTOR) {
nSlowFactor = MAX_SLOW_FACTOR;
}
} else {
nSlowFactor = nSlowFactor + DECEL_ON_EDGES;
if (nSlowFactor > 1) {
nSlowFactor = 1;
}
}
_local3 = _local3 * nSlowFactor;
} else {
nSlowFactor = 1;
}
nDistanceMade = nDistanceMade + _local3;
var _local4 = Library.Utils.MoreMath.getRadianFromDegree(nAngle);
var _local5 = Math.cos(_local4) * nDistanceMade;
var _local6 = Math.sin(_local4) * nDistanceMade;
oWheelAffected.__get__Ref()._x = mcRef._x + _local5;
oWheelAffected.__get__Ref()._y = mcRef._y + _local6;
if (Math.abs(nDistanceMade) > nMaxDistance) {
if (nDirection == DIRECTION_LEFT) {
nDirection = DIRECTION_RIGHT;
} else {
nDirection = DIRECTION_LEFT;
}
}
}
function doSearchWheel() {
var _local3 = Level.__get__Instance().__get__Objects();
var _local7 = mcRef._x;
var _local8 = mcRef._y;
var _local2 = 0;
while (_local2 <= (_local3.length - 1)) {
if (_local3[_local2].ObjectType == Level.OBJECT_TYPE_WHEEL) {
var _local5 = _local3[_local2].Ref._x;
var _local6 = _local3[_local2].Ref._y;
var _local4 = Library.Utils.MoreMath.getDistance(_local7, _local8, _local5, _local6);
if (_local4 <= (AFFECT_DISTANCE_ADDON + Math.max(mcRef._width / 2, mcRef._height / 2))) {
oWheelAffected = _local3[_local2];
oWheelAffected.__get__Ref()._x = mcRef._x;
oWheelAffected.__get__Ref()._y = mcRef._y;
doMoveWheel();
bSearchingForAffectation = false;
_local2 = _local3.length;
}
}
_local2++;
}
}
static var DIRECTION_LEFT = 1;
static var DIRECTION_RIGHT = 2;
static var AFFECT_DISTANCE_ADDON = 35;
static var SEARCH_MAX_TIME = 2;
static var MOVE_SPEED = 1.2;
static var EDGE_BUFFER = 10;
static var PERCENT_DIST_MADE_DECEL = 0.5;
static var DECEL_ON_EDGES = 0.08;
static var MAX_SLOW_FACTOR = 0.1;
}
Symbol 1235 MovieClip [__Packages.Wheel] Frame 0
class Wheel extends BaseObject
{
var mcRef, nRollDirection, nRollSpeed, nCheckDistance, nObjectType, nWheelNextDepth, aAffectedSnacksAssociation, doBounce, nWheelRadius, setState;
function Wheel (__mcRef) {
super(__mcRef);
mcRef._x = mcRef._x + 4;
nRollDirection = ROLL_LEFT;
nRollSpeed = SPEED_SLOW;
nCheckDistance = WHEEL_CHECK_DISTANCE;
nObjectType = Level.OBJECT_TYPE_WHEEL;
nWheelNextDepth = 0;
aAffectedSnacksAssociation = new Array();
doChangeVisual();
}
function doUserRelease() {
if (Level.__get__Instance().__get__Active()) {
Level.__get__Instance().__get__Statistics().doUserClick();
var _local3 = Library.Utils.Tools.doCopyArray(aAffectedSnacksAssociation);
var _local2 = 0;
while (_local2 <= (_local3.length - 1)) {
doReleaseSnackAssociation(_local3[_local2]);
_local2++;
}
doBounce(USER_RELEASE_SPEED, USER_RELEASE_SPEED);
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "BoingWheel.wav");
}
}
function doAffectSnack(__oSnack) {
var _local2 = new Object();
_local2.oSnack = __oSnack;
var _local3 = getReferencePointFor(__oSnack);
_local2.mcPointRef = _local3;
aAffectedSnacksAssociation.push(_local2);
doVerifySnackAssociation(_local2);
}
function setRollSpeed(__nSpeed) {
nRollSpeed = __nSpeed;
doChangeVisual();
}
function setRollDirection(__nDirection) {
nRollDirection = __nDirection;
doChangeVisual();
}
function doEnterFrame() {
super.doEnterFrame();
var _local3 = 0;
while (_local3 <= (aAffectedSnacksAssociation.length - 1)) {
doVerifySnackAssociation(aAffectedSnacksAssociation[_local3]);
_local3++;
}
}
function doSnackExploded(__oSnack) {
doRemoveAffectedSnackAssociation(__oSnack);
}
function doRemoveAffectedSnack(__oSnack) {
doRemoveAffectedSnackAssociation(__oSnack);
}
function doDestroy() {
super.doDestroy();
}
function doReleaseSnackAssociation(__oAssociation) {
var _local2 = __oAssociation.oSnack;
_local2.doSetRotation(0);
var _local4;
var _local3;
var _local9 = __oAssociation.mcPointRef;
var _local7 = _local9.getBounds(mcRef);
var _local5 = Library.Utils.MoreMath.getBoundsCenter(_local7);
var _local6 = Library.Utils.MoreMath.getRadianFromDegree(Library.Utils.MoreMath.getAngle(0, 0, _local5.x, _local5.y));
_local4 = Math.cos(_local6) * USER_RELEASE_SPEED;
_local3 = Math.sin(_local6) * USER_RELEASE_SPEED;
_local2.doReleaseFromObject();
_local2.doSetSpeeds(_local4, _local3);
_local2.doMove(_local4, _local3, true);
doRemoveAffectedSnackAssociation(__oAssociation.oSnack);
}
function doVerifySnackAssociation(__oAssociation) {
var _local2 = __oAssociation.oSnack;
var _local5 = __oAssociation.mcPointRef;
var _local8 = _local5.getBounds(Level.__get__Instance().__get__Ref());
var _local7 = _local5.getBounds(mcRef);
var _local6 = Library.Utils.MoreMath.getBoundsCenter(_local8);
var _local3 = Library.Utils.MoreMath.getBoundsCenter(_local7);
_local2.__get__Ref()._x = _local6.x;
_local2.__get__Ref()._y = _local6.y;
var _local4 = Library.Utils.MoreMath.getAngle(0, 0, _local3.x, _local3.y);
_local4 = _local4 + 90;
_local2.doSetRotation(_local4);
}
function doRemoveAffectedSnackAssociation(__oSnack) {
var _local2 = 0;
while (_local2 <= aAffectedSnacksAssociation.length) {
if (aAffectedSnacksAssociation[_local2].oSnack == __oSnack) {
aAffectedSnacksAssociation[_local2].mcPointRef.removeMovieClip();
aAffectedSnacksAssociation.splice(_local2, 1);
}
_local2++;
}
}
function getReferencePointFor(__oSnack) {
var _local10 = __oSnack.__get__Ref().getBounds(mcRef.mcState.mcWheel);
var _local3 = Library.Utils.MoreMath.getBoundsCenter(_local10);
var _local2 = mcRef.mcState.mcWheel.createEmptyMovieClip("mcPointRef" + nWheelNextDepth, nWheelNextDepth);
nWheelNextDepth++;
var _local4 = Library.Utils.MoreMath.getDistance(0, 0, _local3.x, _local3.y);
var _local6 = 0;
var _local5 = 0;
var _local8 = _local3.x / _local4;
var _local9 = _local3.y / _local4;
var _local7 = _local4 - nWheelRadius;
_local6 = _local7 * _local8;
_local5 = _local7 * _local9;
_local2._x = _local3.x - _local6;
_local2._y = _local3.y - _local5;
_local2.moveTo(-1, -1);
_local2.beginFill(0, 100);
_local2.lineTo(-1, 1);
_local2.lineTo(1, 1);
_local2.lineTo(1, -1);
_local2.lineTo(-1, -1);
_local2.endFill();
_local2._visible = false;
return(_local2);
}
function doChangeVisual() {
var _local2;
var _local3;
switch (nRollSpeed) {
case SPEED_SLOW :
_local2 = "Slow";
break;
case SPEED_FAST :
_local2 = "Fast";
}
switch (nRollDirection) {
case ROLL_LEFT :
_local3 = "Left";
break;
case ROLL_RIGHT :
_local3 = "Right";
}
var _local4 = ("Roll" + _local3) + _local2;
setState(_local4);
doCreateClickEvents();
nWheelRadius = mcRef.mcState.mcWheel._width / 2;
mcRef.mcState.mcWheel._visible = false;
}
function doCreateClickEvents() {
mcRef.mcState.btnGeneralClick.onRelease = Library.Utils.Delegate.create(this, doUserRelease);
}
static var WHEEL_CHECK_DISTANCE = 120;
static var USER_RELEASE_SPEED = 14;
static var ROLL_LEFT = 1;
static var ROLL_RIGHT = 2;
static var SPEED_SLOW = 1;
static var SPEED_FAST = 3;
}
Symbol 1236 MovieClip [__Packages.Cruncher] Frame 0
class Cruncher extends BaseObject
{
var bNeedDepthAdjustement, nCheckDistance, nObjectType;
function Cruncher (__mcRef) {
super(__mcRef);
bNeedDepthAdjustement = false;
nCheckDistance = CRUNCHER_CHECK_DISTANCE;
nObjectType = Level.OBJECT_TYPE_CRUNCHER;
}
function doDestroy() {
super.doDestroy();
}
static var CRUNCHER_CHECK_DISTANCE = 60;
}
Symbol 1237 MovieClip [__Packages.CradleRail] Frame 0
class CradleRail
{
var mcRef, bSearchingForAffectation, nSearchedTime, nRailSize, nInitialWidth;
function CradleRail (__mcRef) {
mcRef = __mcRef;
bSearchingForAffectation = true;
nSearchedTime = SEARCH_MAX_TIME;
nRailSize = SIZE_SMALL;
mcRef.gotoAndStop(nRailSize);
nInitialWidth = mcRef._width - EDGE_BUFFER;
Level.__get__Instance().doAddListener(this);
}
function setSize(__nSize) {
nRailSize = __nSize;
mcRef.gotoAndStop(nRailSize);
var _local2 = mcRef._rotation;
mcRef._rotation = 0;
nInitialWidth = mcRef._width - EDGE_BUFFER;
mcRef._rotation = _local2;
}
function setRotation(__nAngle) {
mcRef._rotation = __nAngle;
}
function doEnterFrame() {
if (bSearchingForAffectation) {
if (nSearchedTime > 0) {
nSearchedTime--;
doSearchCradle();
} else {
bSearchingForAffectation = false;
}
}
}
function doDestroy() {
delete mcRef;
Level.__get__Instance().doRemoveListener(this);
}
function doSearchCradle() {
var _local3 = Level.__get__Instance().__get__Objects();
var _local7 = mcRef._x;
var _local8 = mcRef._y;
var _local2 = 0;
while (_local2 <= (_local3.length - 1)) {
if (_local3[_local2].ObjectType == Level.OBJECT_TYPE_CRADLE) {
var _local5 = _local3[_local2].Ref._x;
var _local6 = _local3[_local2].Ref._y;
var _local4 = Library.Utils.MoreMath.getDistance(_local7, _local8, _local5, _local6);
if (_local4 <= (AFFECT_DISTANCE_ADDON + Math.max(mcRef._width / 2, mcRef._height / 2))) {
_local3[_local2].doUseRail(mcRef, nInitialWidth);
bSearchingForAffectation = false;
doDestroy();
_local2 = Number.POSITIVE_INFINITY;
}
}
_local2++;
}
}
static var AFFECT_DISTANCE_ADDON = 35;
static var SEARCH_MAX_TIME = 5;
static var EDGE_BUFFER = 5;
static var SIZE_SMALL = 1;
static var SIZE_MEDIUM = 2;
static var SIZE_LARGE = 2;
}
Symbol 1238 MovieClip [__Packages.PlayerStatus] Frame 0
class PlayerStatus
{
var aLevels;
function PlayerStatus () {
doGenerateNewLevels();
}
function isFirstCompletionFor(__nDifficultyNum) {
var _local2 = SharedObject.getLocal(SO_NAME);
var _local1 = _local2.data["FirstCompletion" + __nDifficultyNum];
if (_local1 == undefined) {
_local1 = false;
}
return(_local1);
}
function setFirstCompletionFor(__nDifficultyNum) {
var _local1 = SharedObject.getLocal(SO_NAME);
_local1.data["FirstCompletion" + __nDifficultyNum] = true;
}
function getCompletedQuantityFor(__nDifficultyNum) {
var _local4 = 0;
var _local2 = 0;
while (_local2 <= (aLevels.length - 1)) {
var _local3 = aLevels[_local2];
if ((_local3.__get__Difficulty() == __nDifficultyNum) && (_local3.__get__Status() == LevelDataBase.STATUS_COMPLETED)) {
_local4++;
}
_local2++;
}
return(_local4);
}
function getLevelQuantityFor(__nDifficultyNum) {
var _local4 = 0;
var _local2 = 0;
while (_local2 <= (aLevels.length - 1)) {
var _local3 = aLevels[_local2];
if (_local3.__get__Difficulty() == __nDifficultyNum) {
_local4++;
}
_local2++;
}
return(_local4);
}
function getLevelData(__nLevelNum) {
var _local4;
var _local2 = 0;
while (_local2 <= (aLevels.length - 1)) {
var _local3 = aLevels[_local2];
if (_local3.__get__LevelNumber() == __nLevelNum) {
_local4 = _local3;
_local2 = aLevels.length;
}
_local2++;
}
return(_local4);
}
function getNextIncompleteLevelFor(__nDifficulty) {
var _local4;
var _local2 = 0;
while (_local2 <= (aLevels.length - 1)) {
var _local3 = aLevels[_local2];
if ((_local3.__get__Difficulty() == __nDifficulty) && (_local3.__get__Status() == LevelDataBase.STATUS_INCOMPLETE)) {
_local4 = _local3;
_local2 = aLevels.length;
}
_local2++;
}
return(_local4);
}
function doFlushProgression() {
var _local3 = SharedObject.getLocal(SO_NAME);
_local3.clear();
for (var _local2 in aLevels) {
aLevels[_local2].doReset();
}
}
function doDestroy() {
for (var _local2 in aLevels) {
aLevels[_local2].doDestroy();
}
aLevels = new Array();
delete aLevels;
}
function get TotalScore() {
var _local4 = 0;
var _local2 = 0;
while (_local2 <= (aLevels.length - 1)) {
var _local3 = aLevels[_local2];
if (_local3.__get__Status() == LevelDataBase.STATUS_COMPLETED) {
_local4 = _local4 + _local3.Score;
}
_local2++;
}
return(_local4);
}
function doGenerateNewLevels() {
aLevels = new Array();
aLevels.push(new Levels.LevelData_01());
aLevels.push(new Levels.LevelData_02());
aLevels.push(new Levels.LevelData_03());
aLevels.push(new Levels.LevelData_04());
aLevels.push(new Levels.LevelData_05());
aLevels.push(new Levels.LevelData_06());
aLevels.push(new Levels.LevelData_07());
aLevels.push(new Levels.LevelData_08());
aLevels.push(new Levels.LevelData_09());
aLevels.push(new Levels.LevelData_10());
aLevels.push(new Levels.LevelData_11());
aLevels.push(new Levels.LevelData_12());
aLevels.push(new Levels.LevelData_13());
aLevels.push(new Levels.LevelData_14());
aLevels.push(new Levels.LevelData_15());
aLevels.push(new Levels.LevelData_16());
aLevels.push(new Levels.LevelData_17());
aLevels.push(new Levels.LevelData_18());
aLevels.push(new Levels.LevelData_19());
aLevels.push(new Levels.LevelData_20());
aLevels.push(new Levels.LevelData_21());
aLevels.push(new Levels.LevelData_22());
aLevels.push(new Levels.LevelData_23());
aLevels.push(new Levels.LevelData_24());
aLevels.push(new Levels.LevelData_25());
aLevels.push(new Levels.LevelData_26());
aLevels.push(new Levels.LevelData_27());
aLevels.push(new Levels.LevelData_28());
aLevels.push(new Levels.LevelData_29());
aLevels.push(new Levels.LevelData_30());
aLevels.push(new Levels.LevelData_31());
aLevels.push(new Levels.LevelData_32());
aLevels.push(new Levels.LevelData_33());
aLevels.push(new Levels.LevelData_34());
aLevels.push(new Levels.LevelData_35());
aLevels.push(new Levels.LevelData_36());
aLevels.push(new Levels.LevelData_37());
aLevels.push(new Levels.LevelData_38());
aLevels.push(new Levels.LevelData_39());
aLevels.push(new Levels.LevelData_40());
}
static var SO_NAME = "WBScoobySnackProgressSave";
}
Symbol 1239 MovieClip [__Packages.Levels.LevelData_01] Frame 0
class Levels.LevelData_01 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_01 () {
super();
__set__LevelNumber(1);
__set__DisplayNumber(1);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(2);
__set__NormalClicks(3);
__set__SnackEntryRate(3.5 * LevelDataBase.SECONDS);
__set__MinimumTime(5000);
__set__NormalTime(13000);
__set__MaximumTime(20000);
doLoadData();
}
}
Symbol 1240 MovieClip [__Packages.Levels.LevelData_02] Frame 0
class Levels.LevelData_02 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_02 () {
super();
__set__LevelNumber(2);
__set__DisplayNumber(2);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(12000);
__set__NormalTime(25000);
__set__MaximumTime(35000);
doLoadData();
}
}
Symbol 1241 MovieClip [__Packages.Levels.LevelData_03] Frame 0
class Levels.LevelData_03 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_03 () {
super();
__set__LevelNumber(3);
__set__DisplayNumber(3);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(2);
__set__NormalClicks(3);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(9000);
__set__NormalTime(20000);
__set__MaximumTime(31000);
doLoadData();
}
}
Symbol 1242 MovieClip [__Packages.Levels.LevelData_04] Frame 0
class Levels.LevelData_04 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_04 () {
super();
__set__LevelNumber(4);
__set__DisplayNumber(4);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(4);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(13000);
__set__NormalTime(26000);
__set__MaximumTime(39000);
doLoadData();
}
}
Symbol 1243 MovieClip [__Packages.Levels.LevelData_05] Frame 0
class Levels.LevelData_05 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_05 () {
super();
__set__LevelNumber(5);
__set__DisplayNumber(5);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(8);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(26000);
__set__NormalTime(40000);
__set__MaximumTime(65000);
doLoadData();
}
}
Symbol 1244 MovieClip [__Packages.Levels.LevelData_06] Frame 0
class Levels.LevelData_06 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_06 () {
super();
__set__LevelNumber(6);
__set__DisplayNumber(6);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(5);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(8000);
__set__NormalTime(16000);
__set__MaximumTime(24000);
doLoadData();
}
}
Symbol 1245 MovieClip [__Packages.Levels.LevelData_07] Frame 0
class Levels.LevelData_07 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_07 () {
super();
__set__LevelNumber(7);
__set__DisplayNumber(7);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(6);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(15000);
__set__NormalTime(30000);
__set__MaximumTime(45000);
doLoadData();
}
}
Symbol 1246 MovieClip [__Packages.Levels.LevelData_08] Frame 0
class Levels.LevelData_08 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_08 () {
super();
__set__LevelNumber(8);
__set__DisplayNumber(8);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(4);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(3000);
__set__NormalTime(11000);
__set__MaximumTime(20000);
doLoadData();
}
}
Symbol 1247 MovieClip [__Packages.Levels.LevelData_09] Frame 0
class Levels.LevelData_09 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_09 () {
super();
__set__LevelNumber(9);
__set__DisplayNumber(9);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(6);
__set__NormalClicks(9);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(12000);
__set__NormalTime(24000);
__set__MaximumTime(36000);
doLoadData();
}
}
Symbol 1248 MovieClip [__Packages.Levels.LevelData_10] Frame 0
class Levels.LevelData_10 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_10 () {
super();
__set__LevelNumber(10);
__set__DisplayNumber(10);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(5);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(11000);
__set__NormalTime(22000);
__set__MaximumTime(33000);
doLoadData();
}
}
Symbol 1249 MovieClip [__Packages.Levels.LevelData_11] Frame 0
class Levels.LevelData_11 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_11 () {
super();
__set__LevelNumber(11);
__set__DisplayNumber(11);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(16000);
__set__NormalTime(30000);
__set__MaximumTime(44000);
doLoadData();
}
}
Symbol 1250 MovieClip [__Packages.Levels.LevelData_12] Frame 0
class Levels.LevelData_12 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_12 () {
super();
__set__LevelNumber(12);
__set__DisplayNumber(12);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(7);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(10000);
__set__NormalTime(22000);
__set__MaximumTime(34000);
doLoadData();
}
}
Symbol 1251 MovieClip [__Packages.Levels.LevelData_13] Frame 0
class Levels.LevelData_13 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_13 () {
super();
__set__LevelNumber(13);
__set__DisplayNumber(13);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(2);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(9000);
__set__NormalTime(18000);
__set__MaximumTime(27000);
doLoadData();
}
}
Symbol 1252 MovieClip [__Packages.Levels.LevelData_14] Frame 0
class Levels.LevelData_14 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_14 () {
super();
__set__LevelNumber(14);
__set__DisplayNumber(14);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(9);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(14000);
__set__NormalTime(26000);
__set__MaximumTime(40000);
doLoadData();
}
}
Symbol 1253 MovieClip [__Packages.Levels.LevelData_15] Frame 0
class Levels.LevelData_15 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_15 () {
super();
__set__LevelNumber(15);
__set__DisplayNumber(15);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(7);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(22000);
__set__NormalTime(41000);
__set__MaximumTime(60000);
doLoadData();
}
}
Symbol 1254 MovieClip [__Packages.Levels.LevelData_16] Frame 0
class Levels.LevelData_16 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_16 () {
super();
__set__LevelNumber(16);
__set__DisplayNumber(16);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(9);
__set__NormalClicks(9);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(16000);
__set__NormalTime(36000);
__set__MaximumTime(56000);
doLoadData();
}
}
Symbol 1255 MovieClip [__Packages.Levels.LevelData_17] Frame 0
class Levels.LevelData_17 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_17 () {
super();
__set__LevelNumber(17);
__set__DisplayNumber(17);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(17000);
__set__NormalTime(29000);
__set__MaximumTime(40000);
doLoadData();
}
}
Symbol 1256 MovieClip [__Packages.Levels.LevelData_18] Frame 0
class Levels.LevelData_18 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_18 () {
super();
__set__LevelNumber(18);
__set__DisplayNumber(18);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(5);
__set__NormalClicks(5);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(14000);
__set__NormalTime(28000);
__set__MaximumTime(40000);
doLoadData();
}
}
Symbol 1257 MovieClip [__Packages.Levels.LevelData_19] Frame 0
class Levels.LevelData_19 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_19 () {
super();
__set__LevelNumber(19);
__set__DisplayNumber(19);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(2);
__set__NormalClicks(4);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(9000);
__set__NormalTime(35000);
__set__MaximumTime(60000);
doLoadData();
}
}
Symbol 1258 MovieClip [__Packages.Levels.LevelData_20] Frame 0
class Levels.LevelData_20 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_20 () {
super();
__set__LevelNumber(20);
__set__DisplayNumber(20);
__set__Difficulty(Game.DIFFICULTY_EASY);
__set__SnackQuantity(1);
__set__MedalsQuantity(6);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(10000);
__set__NormalTime(32000);
__set__MaximumTime(54000);
doLoadData();
}
}
Symbol 1259 MovieClip [__Packages.Levels.LevelData_21] Frame 0
class Levels.LevelData_21 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_21 () {
super();
__set__LevelNumber(21);
__set__DisplayNumber(1);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(4);
__set__SnackEntryRate(5 * LevelDataBase.SECONDS);
__set__MinimumTime(5000);
__set__NormalTime(16000);
__set__MaximumTime(22000);
doLoadData();
}
}
Symbol 1260 MovieClip [__Packages.Levels.LevelData_22] Frame 0
class Levels.LevelData_22 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_22 () {
super();
__set__LevelNumber(22);
__set__DisplayNumber(2);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(7);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(11000);
__set__NormalTime(22000);
__set__MaximumTime(33000);
doLoadData();
}
}
Symbol 1261 MovieClip [__Packages.Levels.LevelData_23] Frame 0
class Levels.LevelData_23 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_23 () {
super();
__set__LevelNumber(23);
__set__DisplayNumber(3);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(22000);
__set__NormalTime(42000);
__set__MaximumTime(75000);
doLoadData();
}
}
Symbol 1262 MovieClip [__Packages.Levels.LevelData_24] Frame 0
class Levels.LevelData_24 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_24 () {
super();
__set__LevelNumber(24);
__set__DisplayNumber(4);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(2);
__set__NormalClicks(2);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(4000);
__set__NormalTime(15000);
__set__MaximumTime(26000);
doLoadData();
}
}
Symbol 1263 MovieClip [__Packages.Levels.LevelData_25] Frame 0
class Levels.LevelData_25 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_25 () {
super();
__set__LevelNumber(25);
__set__DisplayNumber(5);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(7);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(13000);
__set__NormalTime(40000);
__set__MaximumTime(67000);
doLoadData();
}
}
Symbol 1264 MovieClip [__Packages.Levels.LevelData_26] Frame 0
class Levels.LevelData_26 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_26 () {
super();
__set__LevelNumber(26);
__set__DisplayNumber(6);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(10000);
__set__NormalTime(20000);
__set__MaximumTime(30000);
doLoadData();
}
}
Symbol 1265 MovieClip [__Packages.Levels.LevelData_27] Frame 0
class Levels.LevelData_27 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_27 () {
super();
__set__LevelNumber(27);
__set__DisplayNumber(7);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(2);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(7000);
__set__NormalTime(15000);
__set__MaximumTime(23000);
doLoadData();
}
}
Symbol 1266 MovieClip [__Packages.Levels.LevelData_28] Frame 0
class Levels.LevelData_28 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_28 () {
super();
__set__LevelNumber(28);
__set__DisplayNumber(8);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(17000);
__set__NormalTime(30000);
__set__MaximumTime(45000);
doLoadData();
}
}
Symbol 1267 MovieClip [__Packages.Levels.LevelData_29] Frame 0
class Levels.LevelData_29 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_29 () {
super();
__set__LevelNumber(29);
__set__DisplayNumber(9);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(7);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(6000);
__set__NormalTime(15000);
__set__MaximumTime(24000);
doLoadData();
}
}
Symbol 1268 MovieClip [__Packages.Levels.LevelData_30] Frame 0
class Levels.LevelData_30 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_30 () {
super();
__set__LevelNumber(30);
__set__DisplayNumber(10);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(6);
__set__NormalClicks(10);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(16000);
__set__NormalTime(39000);
__set__MaximumTime(62000);
doLoadData();
}
}
Symbol 1269 MovieClip [__Packages.Levels.LevelData_31] Frame 0
class Levels.LevelData_31 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_31 () {
super();
__set__LevelNumber(31);
__set__DisplayNumber(11);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(11000);
__set__NormalTime(41000);
__set__MaximumTime(71000);
doLoadData();
}
}
Symbol 1270 MovieClip [__Packages.Levels.LevelData_32] Frame 0
class Levels.LevelData_32 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_32 () {
super();
__set__LevelNumber(32);
__set__DisplayNumber(12);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(5);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(18000);
__set__NormalTime(40000);
__set__MaximumTime(60000);
doLoadData();
}
}
Symbol 1271 MovieClip [__Packages.Levels.LevelData_33] Frame 0
class Levels.LevelData_33 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_33 () {
super();
__set__LevelNumber(33);
__set__DisplayNumber(13);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(9);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(13000);
__set__NormalTime(27000);
__set__MaximumTime(39000);
doLoadData();
}
}
Symbol 1272 MovieClip [__Packages.Levels.LevelData_34] Frame 0
class Levels.LevelData_34 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_34 () {
super();
__set__LevelNumber(34);
__set__DisplayNumber(14);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(5);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(12000);
__set__NormalTime(24000);
__set__MaximumTime(37000);
doLoadData();
}
}
Symbol 1273 MovieClip [__Packages.Levels.LevelData_35] Frame 0
class Levels.LevelData_35 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_35 () {
super();
__set__LevelNumber(35);
__set__DisplayNumber(15);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(2);
__set__NormalClicks(7);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(18000);
__set__NormalTime(34000);
__set__MaximumTime(56000);
doLoadData();
}
}
Symbol 1274 MovieClip [__Packages.Levels.LevelData_36] Frame 0
class Levels.LevelData_36 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_36 () {
super();
__set__LevelNumber(36);
__set__DisplayNumber(16);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(11);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(25000);
__set__NormalTime(50000);
__set__MaximumTime(75000);
doLoadData();
}
}
Symbol 1275 MovieClip [__Packages.Levels.LevelData_37] Frame 0
class Levels.LevelData_37 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_37 () {
super();
__set__LevelNumber(37);
__set__DisplayNumber(17);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(6);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(9000);
__set__NormalTime(25000);
__set__MaximumTime(42000);
doLoadData();
}
}
Symbol 1276 MovieClip [__Packages.Levels.LevelData_38] Frame 0
class Levels.LevelData_38 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_38 () {
super();
__set__LevelNumber(38);
__set__DisplayNumber(18);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(3);
__set__NormalClicks(4);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(11000);
__set__NormalTime(37000);
__set__MaximumTime(63000);
doLoadData();
}
}
Symbol 1277 MovieClip [__Packages.Levels.LevelData_39] Frame 0
class Levels.LevelData_39 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_39 () {
super();
__set__LevelNumber(39);
__set__DisplayNumber(19);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(4);
__set__NormalClicks(7);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(6000);
__set__NormalTime(17000);
__set__MaximumTime(28000);
doLoadData();
}
}
Symbol 1278 MovieClip [__Packages.Levels.LevelData_40] Frame 0
class Levels.LevelData_40 extends LevelDataBase
{
var __set__LevelNumber, __set__DisplayNumber, __set__Difficulty, __set__SnackQuantity, __set__MedalsQuantity, __set__NormalClicks, __set__SnackEntryRate, __set__MinimumTime, __set__NormalTime, __set__MaximumTime, doLoadData;
function LevelData_40 () {
super();
__set__LevelNumber(40);
__set__DisplayNumber(20);
__set__Difficulty(Game.DIFFICULTY_MEDIUM);
__set__SnackQuantity(1);
__set__MedalsQuantity(2);
__set__NormalClicks(7);
__set__SnackEntryRate(2.5 * LevelDataBase.SECONDS);
__set__MinimumTime(9000);
__set__NormalTime(30000);
__set__MaximumTime(51000);
doLoadData();
}
}
Symbol 1279 MovieClip [__Packages.LevelSelector] Frame 0
class LevelSelector
{
static var oCtrl;
var mcRef, oAllClearPop, bUnlock1, bUnlock2, bUnlock3, bUnlock4, nUnlockTimer1, oRow2, nUnlockTimer2, oRow3, nUnlockTimer3, oRow4, nUnlockTimer4, oRow5, oRow1;
function LevelSelector (__mcRef) {
oCtrl = this;
mcRef = __mcRef;
oAllClearPop = new Library.BasicPopUp(mcRef.mcPop);
oAllClearPop.__set__Listener(this);
Main.__get__Instance().doAddListener(oAllClearPop);
bUnlock1 = false;
bUnlock2 = false;
bUnlock3 = false;
bUnlock4 = false;
doHideStatistics();
doGenerateGrid();
Main.__get__Instance().doAddListener(this);
}
static function get Instance() {
return(oCtrl);
}
function doEnterFrame() {
if (bUnlock1) {
if (nUnlockTimer1 == 0) {
oRow2.doSlideIn();
bUnlock1 = false;
} else {
nUnlockTimer1--;
}
}
if (bUnlock2) {
if (nUnlockTimer2 == 0) {
oRow3.doSlideIn();
bUnlock2 = false;
} else {
nUnlockTimer2--;
}
}
if (bUnlock3) {
if (nUnlockTimer3 == 0) {
oRow4.doSlideIn();
bUnlock3 = false;
} else {
nUnlockTimer3--;
}
}
if (bUnlock4) {
if (nUnlockTimer4 == 0) {
oRow5.doSlideIn();
bUnlock4 = false;
} else {
nUnlockTimer4--;
}
}
}
function onPopUpEvent(__nEvent, __oPopUp) {
if (!(__nEvent === Library.BasicPopUp.NEED_UPDATE)) {
} else if (!(__oPopUp === oAllClearPop)) {
} else if (oAllClearPop.__get__CurrentState() == "Idle") {
Main.__get__Instance().doQuitGame();
}
}
function doPlayLevel(__oLevel) {
Game.__get__Instance().doStartLevel(__oLevel);
}
function doShowStatistics(__oLevel) {
mcRef.mcStats.txtLevel.text = Library.Utils.Tools.returnFormatedNumber(__oLevel.__get__DisplayNumber(), 2);
mcRef.mcStats.txtMedalsTotal.text = Library.Utils.Tools.returnFormatedNumber(__oLevel.__get__MedalsQuantity(), 2);
mcRef.mcStats.txtClicksTotal.text = Library.Utils.Tools.returnFormatedNumber(__oLevel.__get__NormalClicks(), 2);
if (__oLevel.__get__Status() == LevelDataBase.STATUS_COMPLETED) {
mcRef.mcStats.txtMedals.text = Library.Utils.Tools.returnFormatedNumber(__oLevel.__get__MedalsEarned(), 2);
mcRef.mcStats.txtClicks.text = Library.Utils.Tools.returnFormatedNumber(__oLevel.__get__MadeClicks(), 2);
mcRef.mcStats.txtTotalTime.text = Library.Utils.Tools.getFormatedTime(__oLevel.__get__BestTime(), true);
mcRef.mcStats.txtScore.text = Library.Utils.Tools.returnFormatedNumber(__oLevel.__get__Score(), 6);
} else {
mcRef.mcStats.txtMedals.text = "00";
mcRef.mcStats.txtClicks.text = "00";
mcRef.mcStats.txtTotalTime.text = "00:00:00";
mcRef.mcStats.txtScore.text = "000 000";
}
}
function doHideStatistics() {
mcRef.mcStats.txtLevel.text = "00";
mcRef.mcStats.txtMedals.text = "00";
mcRef.mcStats.txtMedalsTotal.text = "00";
mcRef.mcStats.txtClicks.text = "00";
mcRef.mcStats.txtClicksTotal.text = "00";
mcRef.mcStats.txtTotalTime.text = "00:00:00";
mcRef.mcStats.txtScore.text = "000 000";
}
function doDestroy() {
Main.__get__Instance().doRemoveListener(this);
}
function doGenerateGrid() {
var _local3;
var _local2;
var _local4 = 0;
if (Game.__get__Instance().__get__Difficulty() == Game.DIFFICULTY_MEDIUM) {
_local4 = 20;
}
oRow1 = new LevelSelectRow(mcRef.mcRow1);
_local2 = 0;
_local3 = 1;
while (_local3 <= 4) {
var _local5 = Game.__get__Instance().__get__Status().getLevelData((_local4 + _local2) + _local3);
oRow1.setLevelData(_local3, _local5);
_local3++;
}
oRow2 = new LevelSelectRow(mcRef.mcRow2);
_local2 = 4;
_local3 = 1;
while (_local3 <= 4) {
var _local5 = Game.__get__Instance().__get__Status().getLevelData((_local4 + _local2) + _local3);
oRow2.setLevelData(_local3, _local5);
_local3++;
}
oRow3 = new LevelSelectRow(mcRef.mcRow3);
_local2 = 8;
_local3 = 1;
while (_local3 <= 4) {
var _local5 = Game.__get__Instance().__get__Status().getLevelData((_local4 + _local2) + _local3);
oRow3.setLevelData(_local3, _local5);
_local3++;
}
oRow4 = new LevelSelectRow(mcRef.mcRow4);
_local2 = 12;
_local3 = 1;
while (_local3 <= 4) {
var _local5 = Game.__get__Instance().__get__Status().getLevelData((_local4 + _local2) + _local3);
oRow4.setLevelData(_local3, _local5);
_local3++;
}
oRow5 = new LevelSelectRow(mcRef.mcRow5);
_local2 = 16;
_local3 = 1;
while (_local3 <= 4) {
var _local5 = Game.__get__Instance().__get__Status().getLevelData((_local4 + _local2) + _local3);
oRow5.setLevelData(_local3, _local5);
_local3++;
}
oRow1.doSlideIn();
var _local6 = Library.Utils.Tools.returnFormatedNumber(Game.__get__Instance().__get__Status().getCompletedQuantityFor(Game.__get__Instance().__get__Difficulty()), 2);
var _local7 = Library.Utils.Tools.returnFormatedNumber(Game.__get__Instance().__get__Status().getLevelQuantityFor(Game.__get__Instance().__get__Difficulty()), 2);
mcRef.mcDiffStats.txtCleared.text = (_local6 + "/") + _local7;
if (_local6 >= ROW_1_UNLOCK_NUM) {
bUnlock1 = true;
nUnlockTimer1 = UNLOCK_DELAY * 1;
}
if (_local6 >= ROW_2_UNLOCK_NUM) {
bUnlock2 = true;
nUnlockTimer2 = UNLOCK_DELAY * 2;
}
if (_local6 >= ROW_3_UNLOCK_NUM) {
bUnlock3 = true;
nUnlockTimer3 = UNLOCK_DELAY * 3;
}
if (_local6 >= ROW_4_UNLOCK_NUM) {
bUnlock4 = true;
nUnlockTimer4 = UNLOCK_DELAY * 4;
}
mcRef.mcDiffStats.txtTotalScore.text = Library.Utils.Tools.returnFormatedNumber(Game.__get__Instance().__get__Status().__get__TotalScore(), 9);
checkAllCompleted();
}
function checkAllCompleted() {
var _local3 = Game.__get__Instance().__get__Status().getCompletedQuantityFor(Game.__get__Instance().__get__Difficulty());
var _local2 = Game.__get__Instance().__get__Status().getLevelQuantityFor(Game.__get__Instance().__get__Difficulty());
if (_local3 >= _local2) {
if (!Game.__get__Instance().__get__Status().isFirstCompletionFor(Game.__get__Instance().__get__Difficulty())) {
Game.__get__Instance().__get__Status().setFirstCompletionFor(Game.__get__Instance().__get__Difficulty());
oAllClearPop.doOpen();
}
}
}
static var UNLOCK_DELAY = 8;
static var ROW_1_UNLOCK_NUM = 2;
static var ROW_2_UNLOCK_NUM = 5;
static var ROW_3_UNLOCK_NUM = 9;
static var ROW_4_UNLOCK_NUM = 14;
}
Symbol 1280 MovieClip [__Packages.LevelSelectRow] Frame 0
class LevelSelectRow extends Library.State
{
var setState, mcRef, isStateComplete;
function LevelSelectRow (__mcRef) {
super(__mcRef);
setState("Hidden");
Main.__get__Instance().doAddListener(this);
}
function setLevelData(__nBoxNum, __oLevelData) {
this[("oBox" + __nBoxNum) + "Data"] = __oLevelData;
}
function onClickBox(__nBox) {
var _local2 = this[("oBox" + __nBox) + "Data"];
LevelSelector.__get__Instance().doPlayLevel(_local2);
}
function onRollOverBox(__nBox) {
Ref["mcBox" + __nBox].mcLightFront._visible = true;
Ref["mcBox" + __nBox].mcLightBack._visible = true;
var _local3 = this[("oBox" + __nBox) + "Data"];
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "RollOverBox.wav");
LevelSelector.__get__Instance().doShowStatistics(_local3);
}
function onRollOutBox(__nBox) {
Ref["mcBox" + __nBox].mcLightFront._visible = false;
Ref["mcBox" + __nBox].mcLightBack._visible = false;
LevelSelector.__get__Instance().doHideStatistics();
}
function doSlideIn() {
setState("In");
Library.Sound.SoundManager.doPlaySoundInCat(Main.SOUND_CATEGORY_SFX, "SnackMachineRoll.wav");
}
function doDestroy() {
Main.__get__Instance().doRemoveListener(this);
}
function get Ref() {
return(mcRef.mcState);
}
function doIn() {
if (isStateComplete()) {
setState("Idle");
}
}
function doBuildVisual() {
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = Ref["mcBox" + _local3];
var _local4 = this[("oBox" + _local3) + "Data"];
_local2.gotoAndStop(_local4.__get__DisplayNumber());
_local2.mcLightFront._visible = false;
_local2.mcLightBack._visible = false;
if (_local4.__get__Status() == LevelDataBase.STATUS_INCOMPLETE) {
_local2.mcSnack._visible = false;
} else {
var _local5 = "Normal";
if (_local4.__get__MedalsEarned() >= _local4.__get__MedalsQuantity()) {
_local5 = "Golden";
}
_local2.mcSnack._visible = true;
_local2.mcSnack.gotoAndStop(_local5);
}
_local2.onRelease = Library.Utils.Delegate.create(this, onClickBox, _local3);
_local2.onRollOver = Library.Utils.Delegate.create(this, onRollOverBox, _local3);
_local2.onRollOut = Library.Utils.Delegate.create(this, onRollOutBox, _local3);
_local2.onReleaseOutside = Library.Utils.Delegate.create(this, onRollOutBox, _local3);
_local3++;
}
}
function doLoadStateAction() {
doBuildVisual();
}
}
Symbol 78 MovieClip [__Packages.Library.BasicPopUp] Frame 0
class Library.BasicPopUp extends Library.State
{
var setState, __get__CurrentState, mcRef, oListener, __get__Listener, isStateComplete;
function BasicPopUp (__mcRef) {
super(__mcRef);
setState("Hidden");
}
function doHide() {
setState("Hidden");
}
function doClose() {
if (__get__CurrentState() == "Idle") {
setState("Out");
}
}
function doOpen() {
setState("In");
}
function get Ref() {
return(mcRef.mcState.mcBox);
}
function set Listener(__o) {
oListener = __o;
//return(__get__Listener());
}
function doIn() {
if (isStateComplete()) {
setState("Idle");
}
}
function doOut() {
if (isStateComplete()) {
setState("Hidden");
}
}
function doLoadStateAction() {
mcRef.mcState.btnBlock.onRelease = function () {
};
mcRef.mcState.btnBlock.useHandCursor = false;
if (__get__CurrentState() != "Hidden") {
oListener.onPopUpEvent(NEED_UPDATE, this);
}
}
static var NEED_UPDATE = 1;
}
Symbol 65 MovieClip [__Packages.LibCompileHookComponent] Frame 0
class LibCompileHookComponent extends MovieClip
{
function LibCompileHookComponent () {
super();
}
function LibCompileHook() {
}
}
Symbol 68 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 73 MovieClip [__Packages.Library.Utils.Debug] Frame 0
class Library.Utils.Debug
{
static var lc;
function Debug () {
}
static function clear() {
lc = new LocalConnection();
lc.send("trace", "clear");
}
static function setLevel(pLvl) {
level = pLvl;
}
static function trace(pMsg, pLvl) {
var _local1;
if (pLvl != undefined) {
_local1 = pLvl;
} else {
_local1 = level;
}
lc = new LocalConnection();
lc.send("trace", "trace", pMsg, _local1);
}
static function traceObject(o, pRecurseDepth, pLvl, pIndent) {
var _local7;
var _local5;
var _local6;
if (pLvl != undefined) {
_local6 = pLvl;
} else {
_local6 = level;
}
if (pRecurseDepth == undefined) {
_local7 = 0;
} else {
_local7 = pRecurseDepth;
}
if (pIndent == undefined) {
_local5 = 0;
} else {
_local5 = pIndent;
}
for (var _local8 in o) {
var _local3 = "";
var _local1 = 0;
while (_local1 < _local5) {
_local3 = _local3 + " ";
_local1++;
}
var _local2 = o[_local8].toString();
if (o[_local8] instanceof Array) {
_local2 = "[Array]";
}
if (_local2 == "[object Object]") {
_local2 = "[Object]";
}
trace(((_local3 + _local8) + ": ") + _local2, _local6);
if (_local7 > 0) {
traceObject(o[_local8], _local7 - 1, _local6, _local5 + 1);
}
}
}
static var level = 0;
static var DEBUG = 0;
static var INFO = 1;
static var WARN = 2;
static var ERROR = 3;
static var FATAL = 4;
}
Symbol 74 MovieClip [__Packages.Library.Utils.KeysManager] Frame 0
class Library.Utils.KeysManager
{
var aKeys;
function KeysManager () {
aKeys = new Array();
_global.OnEnterFrameBeacon.init();
_global.MovieClip.addListener(this);
}
function setListenerForKey(__oListener, __nKeyCode) {
var _local2 = false;
for (var _local6 in aKeys) {
if (aKeys[_local6].nCode == __nKeyCode) {
aKeys[_local6].aListeners.push(__oListener);
_local2 = true;
}
}
if (!_local2) {
var _local3 = new Object();
_local3.bPressed = false;
_local3.nCode = __nKeyCode;
_local3.aListeners = new Array();
_local3.aListeners.push(__oListener);
aKeys.push(_local3);
}
}
function onEnterFrame() {
for (var _local5 in aKeys) {
var _local3 = Key.isDown(aKeys[_local5].nCode);
if (aKeys[_local5].bPressed != _local3) {
aKeys[_local5].bPressed = _local3;
for (var _local4 in aKeys[_local5].aListeners) {
var _local2;
if (_local3) {
_local2 = EVENT_KEY_DOWN;
} else {
_local2 = EVENT_KEY_UP;
}
aKeys[_local5].aListeners[_local4].onKeyManagerEvent(_local2, aKeys[_local5].nCode);
}
}
}
}
function doDestroy() {
for (var _local3 in aKeys) {
for (var _local2 in aKeys[_local3].aListeners) {
delete aKeys[_local3].aListeners[_local2];
}
aKeys[_local3].aListeners = new Array();
delete aKeys[_local3].aListeners;
}
aKeys = new Array();
delete aKeys;
MovieClip.removeListener(this);
}
static var EVENT_KEY_DOWN = 1;
static var EVENT_KEY_UP = 2;
}
Symbol 76 MovieClip [__Packages.Library.Utils.XmlTool] Frame 0
class Library.Utils.XmlTool
{
var xmlData, sXmlFileName, bNoLoad, oListener;
function XmlTool (_sXmlName) {
if (_sXmlName.length != undefined) {
xmlData = new XML();
sXmlFileName = _sXmlName;
xmlData.ignoreWhite = true;
xmlData.onLoad = Library.Utils.Delegate.create(this, doInformListener);
xmlData.load(sXmlFileName);
bNoLoad = false;
} else {
bNoLoad = true;
}
}
function doSetListener(__oListener) {
oListener = __oListener;
}
function doInformListener(__bSuccess) {
oListener.onXMLLoadComplete(this, __bSuccess);
}
function isLoaded() {
var _local2 = false;
if (bNoLoad || ((xmlData.getBytesLoaded() >= xmlData.getBytesTotal()) && (xmlData.getBytesTotal() > 2))) {
_local2 = true;
}
return(_local2);
}
function getSubXml(_sNodeName, _xmlRef) {
var _local2 = new XMLNode();
if (isLoaded()) {
var _local5 = xmlData;
if (_xmlRef != undefined) {
_local5 = _xmlRef;
}
var _local3 = 0;
_local2 = _local5.firstChild;
while ((((_local2.nodeName != _sNodeName) && (_local2.hasChildNodes())) && (_local2 != undefined)) && (_local3 < 256)) {
_local2 = _local2.firstChild;
_local3++;
}
}
return(_local2);
}
function getLevelNode(_sNodeName, _xmlRef) {
var _local4 = new XMLNode();
if (isLoaded()) {
var _local3 = xmlData.firstChild;
if (_xmlRef != undefined) {
_local3 = _xmlRef;
}
var _local2 = 0;
while (_local2 < _local3.childNodes.length) {
if (_local3.childNodes[_local2].nodeName == _sNodeName) {
_local4 = _local3.childNodes[_local2];
_local2 = _local3.childNodes.length;
}
_local2++;
}
}
return(_local4);
}
function getLevelNodeData(_sNodeName, _xmlRef) {
var _local4 = new String();
if (isLoaded()) {
var _local2 = 0;
while (_local2 < _xmlRef.childNodes.length) {
if (_xmlRef.childNodes[_local2].nodeName == _sNodeName) {
_local4 = _xmlRef.childNodes[_local2].childNodes[0].nodeValue;
_local2 = _xmlRef.childNodes.length;
}
_local2++;
}
}
return(_local4);
}
function getLevelNodeAttribute(_sNodeName, _sAttributeName, _xmlRef) {
var _local4 = new String();
if (isLoaded()) {
var _local2 = 0;
while (_local2 < _xmlRef.childNodes.length) {
if (_xmlRef.childNodes[_local2].nodeName == _sNodeName) {
_local4 = _xmlRef.childNodes[_local2].attributes[_sAttributeName];
_local2 = _xmlRef.childNodes.length;
}
_local2++;
}
}
return(_local4);
}
function doDestroy() {
delete oListener;
delete xmlData;
}
function valueOf() {
return(xmlData.toString());
}
}
Symbol 473 MovieClip Frame 1
stop();
Symbol 664 MovieClip Frame 23
stop();
Symbol 850 MovieClip Frame 1
stop();
this.hitArea = mcHit;
Symbol 945 MovieClip Frame 1
mcSnack._visible = true;
Symbol 945 MovieClip Frame 30
mcSnack._visible = false;
Symbol 961 MovieClip [Dynamic_SnackDispenser] Frame 1
Level.__get__Instance().doSetSnackDispenser(this);
Symbol 973 MovieClip Frame 1
Level.__get__Instance().doCreateDoorEntry(this);
Symbol 975 MovieClip Frame 1
Level.__get__Instance().doCreateDoorExit(this);
Symbol 978 MovieClip Frame 1
Level.__get__Instance().doCreateWheel(this, Wheel.ROLL_RIGHT, Wheel.SPEED_SLOW);
Symbol 981 MovieClip Frame 1
Level.__get__Instance().doCreateWheel(this, Wheel.ROLL_RIGHT, Wheel.SPEED_FAST);
Symbol 983 MovieClip Frame 1
Level.__get__Instance().doCreateTreadMill(this, TreadMill.ROLL_RIGHT, TreadMill.SIZE_SMALL);
Symbol 984 MovieClip Frame 1
Level.__get__Instance().doCreateTreadMill(this, TreadMill.ROLL_RIGHT, TreadMill.SIZE_MEDIUM);
Symbol 986 MovieClip Frame 1
Level.__get__Instance().doCreateTreadMill(this, TreadMill.ROLL_LEFT, TreadMill.SIZE_MEDIUM);
Symbol 987 MovieClip Frame 1
Level.__get__Instance().doCreateCruncher(this);
Symbol 989 MovieClip Frame 1
Level.__get__Instance().doCreateMedal(this);
Symbol 1001 MovieClip Frame 1
Level.__get__Instance().doCreateTreadMill(this, TreadMill.ROLL_LEFT, TreadMill.SIZE_SMALL);
Symbol 1005 MovieClip Frame 1
Level.__get__Instance().doCreateWheel(this, Wheel.ROLL_LEFT, Wheel.SPEED_SLOW);
Symbol 1011 MovieClip Frame 1
Level.__get__Instance().doCreateCradleRail(this, CradleRail.SIZE_LARGE);
Symbol 1014 MovieClip Frame 1
Level.__get__Instance().doCreateCradle(this, Cradle.DIRECTION_RIGHT, Cradle.CRADLE_FIXED);
Symbol 1017 MovieClip Frame 1
Level.__get__Instance().doCreateWheel(this, Wheel.ROLL_LEFT, Wheel.SPEED_FAST);
Symbol 1024 MovieClip Frame 1
Level.__get__Instance().doCreateCradleRail(this, CradleRail.SIZE_MEDIUM);
Symbol 1027 MovieClip Frame 1
Level.__get__Instance().doCreateCradle(this, Cradle.DIRECTION_LEFT, Cradle.CRADLE_MOVING);
Symbol 1028 MovieClip Frame 1
Level.__get__Instance().doCreateTreadMill(this, TreadMill.ROLL_RIGHT, TreadMill.SIZE_BIG);
Symbol 1030 MovieClip Frame 1
Level.__get__Instance().doCreateCradle(this, Cradle.DIRECTION_LEFT, Cradle.CRADLE_FIXED);
Symbol 1033 MovieClip Frame 1
Level.__get__Instance().doCreateWheelRail(this, WheelRail.DIRECTION_RIGHT);
Symbol 1038 MovieClip Frame 1
Level.__get__Instance().doCreateWheelRail(this, WheelRail.DIRECTION_LEFT);
Symbol 1043 MovieClip Frame 1
Level.__get__Instance().doCreateDoorSwitch(this);
Symbol 1047 MovieClip Frame 1
Level.__get__Instance().doCreateCradleRail(this, CradleRail.SIZE_SMALL);
Symbol 1079 MovieClip Frame 1
Level.__get__Instance().doCreateCradle(this, Cradle.DIRECTION_RIGHT, Cradle.CRADLE_MOVING);
Symbol 1147 MovieClip Frame 1
stop();