Frame 1
var _oPreloaderScreen = (new com.disney.gem.games.ocean_cleaning.screens.PreloaderScreen(mcScreens.mcPreloader));
com.sarbakan.BaseDisneyController.bDEBUG = false;
new com.disney.gem.games.ocean_cleaning.Controller(this, _oPreloaderScreen);
Symbol 1008 MovieClip [__Packages.com.sarbakan.utils.StateManaged] Frame 0
class com.sarbakan.utils.StateManaged
{
var mcRef, bPausable, sNextState, sState;
function StateManaged (_mcRef) {
setMC(_mcRef);
setPausable(true);
}
function setMC(_mcRef) {
mcRef = _mcRef;
}
function setPausable(_bPausable) {
bPausable = _bPausable;
}
function setState(_sState, _bInstant, _bForce) {
sNextState = _sState;
if (_bInstant) {
checkStateChange();
}
if (_bForce) {
mcRef.mcState.gotoAndPlay(1);
}
}
function getState() {
return(sState);
}
function stateStarting() {
return(mcRef.mcState._currentframe == 1);
}
function stateFinished() {
return(mcRef.mcState._currentframe == mcRef.mcState._totalframes);
}
function stateCurrentFrame() {
return(mcRef.mcState._currentframe);
}
function stateIsNot() {
var _local4 = false;
var _local3 = arguments.length - 1;
while (_local3 >= 0) {
if (arguments[_local3] == sState) {
_local4 = true;
break;
}
_local3--;
}
return(!_local4);
}
function destroy() {
delete mcRef;
}
function get Mc() {
return(mcRef);
}
function onUpdate() {
checkStateChange();
this["state_" + sState]();
}
function checkStateChange() {
if ((sNextState != undefined) && (sNextState != sState)) {
this[("state_" + sState) + "_end"]();
sState = sNextState;
sNextState = undefined;
mcRef.gotoAndStop(sState);
this[("state_" + sState) + "_init"]();
}
}
function onUpdatePaused() {
if (bPausable == false) {
onUpdate();
}
}
function onPause() {
if (bPausable) {
mcRef.mcState.stop();
}
}
function onUnPause() {
if (bPausable) {
mcRef.mcState.play();
}
}
}
Symbol 1009 MovieClip [__Packages.com.sarbakan.utils.ScreenController] Frame 0
class com.sarbakan.utils.ScreenController extends com.sarbakan.utils.StateManaged
{
var setMC, setState, setPausable, oController, bInOut, fHideCallBack, mcRef, sState, stateFinished;
function ScreenController (_mcRef) {
super();
setMC(_mcRef);
setState(sSTATE_HIDDEN);
setPausable(false);
}
function setGameController(_oController) {
oController = _oController;
}
function show(_bInOut) {
bInOut = _bInOut;
if (bInOut) {
setState(sSTATE_IN, true);
} else {
setState(sSTATE_IDLE, true);
}
}
function hide(_fHideCallBack, _bInOutOverride) {
fHideCallBack = _fHideCallBack;
var _local2 = bInOut;
if (_bInOutOverride != undefined) {
_local2 = _bInOutOverride;
}
if (_local2) {
setState(sSTATE_OUT);
} else {
setState(sSTATE_HIDDEN, true);
fHideCallBack();
}
}
function getRef() {
return(mcRef);
}
function isInOutTransitionning() {
return((sState == sSTATE_IN) || (sState == sSTATE_OUT));
}
function state_in() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function state_out() {
if (stateFinished()) {
setState(sSTATE_HIDDEN, true);
fHideCallBack();
}
}
function state_in_init() {
mcRef.btBlocker.useHandCursor = false;
}
function state_idle_init() {
mcRef.btBlocker.useHandCursor = false;
}
function state_out_init() {
mcRef.btBlocker.useHandCursor = false;
}
static var sSTATE_HIDDEN = "hidden";
static var sSTATE_IN = "in";
static var sSTATE_IDLE = "idle";
static var sSTATE_OUT = "out";
}
Symbol 1010 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.screens.PreloaderScreen] Frame 0
class com.disney.gem.games.ocean_cleaning.screens.PreloaderScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function PreloaderScreen (_mcRef) {
super(_mcRef);
}
function state_idle() {
var _local2 = com.disney.gem.games.ocean_cleaning.Controller(oController).mcTimeline.getBytesLoaded() / com.disney.gem.games.ocean_cleaning.Controller(oController).mcTimeline.getBytesTotal();
mcRef.mcState.mcBar.mcProgress._xscale = _local2 * 100;
mcRef.mcState.txtLoading.text = Math.round(_local2 * 100) + "%";
if (_local2 == 1) {
com.disney.gem.games.ocean_cleaning.Controller(oController).onPreloadingDone();
}
}
}
Symbol 1011 MovieClip [__Packages.com.sarbakan.BaseDisneyController] Frame 0
class com.sarbakan.BaseDisneyController
{
static var oInstance;
var mcTimeline, oPreloaderScreen, oMainBroadcaster, oFrameRate, aPopups, oTransitionManager, bSoundMuted, nLastSoundToggleTimer, bPaused, oDXDControllerWrapper, nGamePhase, oCurrentScreen, fScreenShowTransitionCallBack, fScreenHideCallBack, nLevel, nScore, bInstructionCanBeDisplayed, bInstructionActive, nLastUpdateTimer;
function BaseDisneyController (_mcTimeline, _oPreloaderScreen) {
oInstance = this;
mcTimeline = _mcTimeline;
_mcTimeline.stop();
oPreloaderScreen = _oPreloaderScreen;
oMainBroadcaster = new Object();
AsBroadcaster.initialize(oMainBroadcaster);
oMainBroadcaster.addListener(this);
if (bDEBUG) {
oFrameRate = new com.sarbakan.utils.FrameRateDisplayer(_mcTimeline, nFRAME_RATE, nGAME_STAGE_WIDTH);
oMainBroadcaster.addListener(oFrameRate);
} else {
Stage.showMenu = false;
mcTimeline._focusrect = false;
}
aPopups = new Array();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
setDXDCallback();
} else {
initStandAloneController();
}
}
static function getInstance() {
return(oInstance);
}
function init() {
setGamePhase(nGAME_PHASE_PACKAGING);
stopScreenContainers();
oTransitionManager = new com.sarbakan.utils.TransitionManager(mcTimeline.mcTransitions);
oMainBroadcaster.addListener(oTransitionManager);
bSoundMuted = false;
nLastSoundToggleTimer = getTimer();
}
function update(_nElapsed) {
if (bPaused) {
oMainBroadcaster.broadcastMessage("onUpdatePaused", _nElapsed);
} else {
oMainBroadcaster.broadcastMessage("onUpdate", _nElapsed);
}
checkGlobalKeys();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
bSoundMuted = oDXDControllerWrapper.isMuted();
}
}
function pause() {
if (!bPaused) {
bPaused = true;
oMainBroadcaster.broadcastMessage("onPause");
}
}
function unpause() {
if (bPaused) {
bPaused = false;
oMainBroadcaster.broadcastMessage("onUnPause");
}
}
function togglePause() {
if (bPaused) {
unpause();
} else {
pause();
}
}
function getControllerMode() {
var _local1;
if (com.disney.gem.base.BaseObject == undefined) {
_local1 = nCONTROLLER_MODE_STANDALONE;
} else {
_local1 = nCONTROLLER_MODE_DXD;
}
return(_local1);
}
function setGamePhase(_nPhase) {
nGamePhase = _nPhase;
switch (_nPhase) {
case nGAME_PHASE_PRELOADER :
mcTimeline.gotoAndStop("preloader");
break;
case nGAME_PHASE_PACKAGING :
mcTimeline.gotoAndStop("packaging");
break;
case nGAME_PHASE_INGAME :
mcTimeline.gotoAndStop("game");
}
}
function getGamePhase() {
return(nGamePhase);
}
function gameLog(_sText) {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.gameLog(_sText);
} else {
trace(_sText);
}
}
function showScreen(_oScreenController, _bInOut, _sTransitionID, _fMidTransitionCallBack) {
if (oCurrentScreen) {
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, showScreen, _oScreenController, _bInOut, null, _fMidTransitionCallBack), _sTransitionID);
} else {
oCurrentScreen = _oScreenController;
oCurrentScreen.setGameController(this);
if (_sTransitionID != undefined) {
fScreenShowTransitionCallBack = _fMidTransitionCallBack;
oTransitionManager.playTransition(_sTransitionID, com.sarbakan.utils.Delegate.create(this, onScreenShowTransitionMiddle, _bInOut));
} else {
oCurrentScreen.show(_bInOut);
_fMidTransitionCallBack();
}
oMainBroadcaster.addListener(oCurrentScreen);
}
}
function hideCurrentScreen(_fHideCallBack, _sTransition, _fEndCallBack) {
fScreenHideCallBack = _fHideCallBack;
if (_sTransition != undefined) {
oTransitionManager.playTransition(_sTransition, com.sarbakan.utils.Delegate.create(oCurrentScreen, oCurrentScreen.hide, com.sarbakan.utils.Delegate.create(this, onScreenHidden)), _fEndCallBack);
} else {
oCurrentScreen.hide(com.sarbakan.utils.Delegate.create(this, onScreenHidden));
}
}
function showPopup(_oPopupController, _bInOut) {
var _local5 = false;
var _local2 = aPopups.length - 1;
while (_local2 >= 0) {
var _local3 = aPopups[_local2];
if (_oPopupController.getRef() == _local3.getRef()) {
_local5 = true;
_local3.destroy();
oMainBroadcaster.removeListener(_local3);
aPopups[_local2] = _oPopupController;
break;
}
_local2--;
}
if (!_local5) {
aPopups.push(_oPopupController);
}
_oPopupController.setGameController(this);
_oPopupController.show(_bInOut);
oMainBroadcaster.addListener(_oPopupController);
}
function setLevel(_nLevel) {
nLevel = _nLevel;
}
function getLevel() {
return(nLevel);
}
function setScore(_nScore) {
nScore = _nScore;
}
function increaseScore(_nIncrement) {
nScore = nScore + _nIncrement;
}
function getScore() {
return(nScore);
}
function allowInstructions() {
bInstructionCanBeDisplayed = true;
}
function disallowInstructions() {
bInstructionCanBeDisplayed = false;
}
function showInstructions() {
if (canShowInstructions()) {
bInstructionActive = true;
showInstructionsScreen();
}
}
function hideInstructions() {
if (canHideInstructions()) {
bInstructionActive = false;
hideInstructionsScreen();
}
}
function toggleSound() {
if ((getTimer() - nLastSoundToggleTimer) >= nSOUND_TOGGLE_DELAY) {
bSoundMuted = !bSoundMuted;
nLastSoundToggleTimer = getTimer();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.toggleSound();
} else {
toggleSoundStandalone();
}
}
}
function onPreloadingDone() {
hideCurrentScreen();
init();
}
function onGameStart() {
setLevel(1);
setScore(0);
}
function onLevelStart() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.startLevel(nLevel, nScore);
}
}
function onLevelEnd() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.endLevel(nLevel, nScore);
}
}
function onGameEnd() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.endGame(nLevel, nScore);
}
}
function onTransitionStart(_mcTransition) {
}
function onTransitionMiddle(_mcTransition) {
}
function onEnterFrame() {
var _local2 = getTimer();
update(_local2 - nLastUpdateTimer);
nLastUpdateTimer = _local2;
}
function onScreenShowTransitionMiddle(_bInOut) {
fScreenShowTransitionCallBack();
oCurrentScreen.show(_bInOut);
}
function onScreenHidden() {
oMainBroadcaster.removeListener(oCurrentScreen);
delete oCurrentScreen;
fScreenHideCallBack();
}
function setDXDCallback() {
mcTimeline.init = com.sarbakan.utils.Delegate.create(this, initDXDController);
}
function initDXDController(_oOwner) {
oDXDControllerWrapper = new com.sarbakan.DXDControllerWrapper(this, mcTimeline, _oOwner);
return(oDXDControllerWrapper);
}
function initStandAloneController() {
mcTimeline.onEnterFrame = com.sarbakan.utils.Delegate.create(this, onEnterFrame);
nLastUpdateTimer = getTimer();
initPreloader();
}
function initPreloader() {
setGamePhase(nGAME_PHASE_PRELOADER);
showScreen(oPreloaderScreen);
}
function checkGlobalKeys() {
if (Key.isDown(nKEY_INSTRUCTIONS)) {
if (!bInstructionActive) {
showInstructions();
} else {
hideInstructions();
}
}
if (Key.isDown(nKEY_SOUND)) {
toggleSound();
}
}
function toggleSoundStandalone() {
var _local2 = new Sound(mcTimeline);
if (!bSoundMuted) {
_local2.setVolume(100);
} else {
_local2.setVolume(0);
}
}
function canShowInstructions() {
return((((!bInstructionActive) && (bInstructionCanBeDisplayed)) && (!oCurrentScreen.isInOutTransitionning())) && (!oTransitionManager.isTransitionning()));
}
function canHideInstructions() {
return(((bInstructionActive && (bInstructionCanBeDisplayed)) && (!oCurrentScreen.isInOutTransitionning())) && (!oTransitionManager.isTransitionning()));
}
function showInstructionsScreen() {
}
function hideInstructionsScreen() {
}
function stopScreenContainers() {
var _local3 = [mcTimeline.mcPopups, mcTimeline.mcScreens];
var _local2 = _local3.length - 1;
while (_local2 >= 0) {
for (var _local4 in _local3[_local2]) {
_local3[_local2][_local4].stop();
}
_local2--;
}
}
static var bDEBUG = true;
static var nFRAME_RATE = 30;
static var nCONTROLLER_MODE_STANDALONE = 1;
static var nCONTROLLER_MODE_DXD = 2;
static var nGAME_PHASE_PRELOADER = 1;
static var nGAME_PHASE_PACKAGING = 2;
static var nGAME_PHASE_INGAME = 3;
static var nKEY_INSTRUCTIONS = 72;
static var nKEY_SOUND = 77;
static var nGAME_STAGE_WIDTH = 580;
static var nGAME_STAGE_HEIGHT = 400;
static var nSOUND_TOGGLE_DELAY = 100;
}
Symbol 1012 MovieClip [__Packages.com.sarbakan.utils.TransitionManager] Frame 0
class com.sarbakan.utils.TransitionManager extends com.sarbakan.utils.StateManaged
{
var setPausable, mcTransitionContainer, mcTransition, fMiddleCallBack, fEndCallBack, bTransitionning, setMC, setState, stateFinished, mcRef;
function TransitionManager (_mcTransition) {
super();
setPausable(false);
mcTransitionContainer = _mcTransition;
for (var _local3 in mcTransitionContainer) {
mcTransitionContainer[_local3].stop();
}
}
function playTransition(_sTransitionID, _fMiddleCallBack, _fEndCallBack) {
mcTransition = mcTransitionContainer["mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)];
fMiddleCallBack = _fMiddleCallBack;
fEndCallBack = _fEndCallBack;
if (mcTransition == undefined) {
trace(("TransitionManager error: Unable to find mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)) + " in transition movieclip");
} else {
bTransitionning = true;
setMC(mcTransition);
setState(sSTATE_IN);
}
}
function isTransitionning() {
return(bTransitionning);
}
function state_in() {
if (stateFinished()) {
setState(sSTATE_OUT);
fMiddleCallBack();
}
}
function state_out() {
if (stateFinished()) {
bTransitionning = false;
setState(sSTATE_HIDDEN);
fEndCallBack();
}
}
function state_in_init() {
com.sarbakan.BaseDisneyController.getInstance().onTransitionStart(mcTransition);
mcRef.btBlocker.useHandCursor = false;
}
function state_out_init() {
com.sarbakan.BaseDisneyController.getInstance().onTransitionMiddle(mcTransition);
mcRef.btBlocker.useHandCursor = false;
}
static var sSTATE_IN = "in";
static var sSTATE_OUT = "out";
static var sSTATE_HIDDEN = "hidden";
}
Symbol 1013 MovieClip [__Packages.com.sarbakan.utils.MoreString] Frame 0
class com.sarbakan.utils.MoreString
{
function MoreString () {
}
static function pad(_sToPad, _sCharPad, _nMinLength, _sSideToPad) {
var _local1 = String(_sToPad);
while (_local1.length < _nMinLength) {
if (_sSideToPad == "RIGHT") {
_local1 = _local1 + _sCharPad;
} else {
_local1 = _sCharPad + _local1;
}
}
return(_local1);
}
static function trim(_sToTrim, _sCharTrim, _sSideToTrim) {
var _local1 = String(_sToTrim);
if (_sSideToTrim == "RIGHT") {
while (_local1.substr(_local1.length - 2, 1) == _sCharTrim) {
_local1 = _local1.slice(-1);
}
} else {
while (_local1.substr(0, 1) == _sCharTrim) {
_local1 = _local1.slice(1);
}
}
return(_local1);
}
static function replace(_sString, _sFind, _sReplace) {
return(_sString.split(_sFind).join(_sReplace));
}
static function formatTime(_nTime) {
var _local2 = _nTime;
var _local1 = Math.floor(_local2 / 60);
var _local3 = Math.round(_local2 - (_local1 * 60));
return((pad(String(_local1), "0", 2) + ":") + pad(String(_local3), "0", 2));
}
static function formatNumber(__sNumber, __nMinimumChar) {
var _local1 = String(__sNumber);
var _local3 = "";
var _local4 = _local1.length;
_local4 = _local4 / 3;
var _local5;
var _local2;
if (_local4 <= 1) {
_local5 = _local1;
if (_local5.length < __nMinimumChar) {
_local5 = "0" + _local5;
}
} else {
_local2 = _local4;
while (_local2 > 1) {
_local3 = (" " + _local1.substr(-3)) + _local3;
_local1 = _local1.substr(0, -3);
_local2--;
}
_local5 = _local1 + _local3;
if (_local5.length < __nMinimumChar) {
_local5 = "0" + _local5;
}
}
return(_local5);
}
static function upperFirstChar(_sString) {
return(_sString.substr(0, 1).toUpperCase() + _sString.substr(1));
}
static function lowerFirstChar(_sString) {
return(_sString.substr(0, 1).toLowerCase() + _sString.substr(1));
}
static function convertToBoolean(_sString) {
return(_sString.toLowerCase() == "true");
}
static function formatMoney(_nMoney, _sDelimiteur, _bDecimalOpt) {
var _local5;
var _local3;
var _local2;
var _local1;
var _local6;
if (_bDecimalOpt == undefined) {
_local6 = true;
} else {
_local6 = _bDecimalOpt;
}
_local5 = String(_nMoney).split(".");
if (_local5[1] != undefined) {
_local3 = _local5[1].substr(0, 2);
switch (_local3.length) {
case 0 :
_local3 = _local3 + "00";
break;
case 1 :
_local3 = _local3 + "0";
break;
case 2 :
break;
default :
_local3 = "00";
}
} else {
_local3 = "00";
}
_local1 = _local5[0];
_local2 = "";
while (_local1.length > 3) {
_local2 = (_sDelimiteur + _local1.substr(_local1.length - 3)) + _local2;
_local1 = _local1.substr(0, _local1.length - 3);
}
_local2 = _local1 + _local2;
if (_local6) {
return(((_local2 + ".") + _local3) + "$");
}
return(_local2 + " $");
}
static function getOrdinalSuffix(_nNumber) {
var _local2;
var _local1 = String(_nNumber);
if (((_local1.substr(-2, 2) == 11) || (_local1.substr(-2, 2) == 12)) || (_local1.substr(-2, 2) == 13)) {
_local2 = "th";
} else if (_local1.substr(-1, 1) == 1) {
_local2 = "st";
} else if (_local1.substr(-1, 1) == 2) {
_local2 = "nd";
} else if (_local1.substr(-1, 1) == 3) {
_local2 = "rd";
} else {
_local2 = "th";
}
return(_local2);
}
}
Symbol 1014 MovieClip [__Packages.com.sarbakan.DXDControllerWrapper] Frame 0
class com.sarbakan.DXDControllerWrapper extends com.disney.gem.games.BaseGameController
{
var oRealController, __owner;
function DXDControllerWrapper (_oRealController, _mcTimeline, _oOwner) {
super(_mcTimeline, _oOwner);
oRealController = _oRealController;
}
function init() {
super.init();
oRealController.init();
}
function update(_nElapsed) {
oRealController.update(_nElapsed);
}
function toggleSound() {
__owner.onToggleSound();
}
function isMuted() {
return(!__owner.__soundOn);
}
function gameLog(_sText) {
__owner.gameLog(_sText, "game");
}
}
Symbol 1015 MovieClip [__Packages.com.disney.gem.games.GameContainer] Frame 0
interface com.disney.gem.games.GameContainer
{
}
Symbol 1016 MovieClip [__Packages.com.sarbakan.utils.FrameRateDisplayer] Frame 0
class com.sarbakan.utils.FrameRateDisplayer
{
var nMovieFPS, nUpdateCounter, nAverageFps, nCurrentFPS, nUpdateCount, mcDebug, nLastGetTimer;
function FrameRateDisplayer (_mcTimeline, _nMovieFPS, _nStageWidth) {
nMovieFPS = _nMovieFPS;
nUpdateCounter = 0;
nAverageFps = 0;
nCurrentFPS = nMovieFPS;
reset();
startDebug(_mcTimeline, _nStageWidth);
}
function get fps() {
return(nCurrentFPS);
}
function onUpdate() {
if ((++nUpdateCount) == nMovieFPS) {
computeFrameRate();
updateDebug();
}
}
function onUpdatePaused() {
onUpdate();
}
function startDebug(_mcTimeline, _nStageWidth) {
mcDebug = _mcTimeline.createEmptyMovieClip("PerformanceWatcherDebug", DEBUG_DEPTH);
mcDebug._x = (_nStageWidth - DEBUG_RIGHT_MARGIN) - 400;
mcDebug._y = DEBUG_TOP_MARGIN;
mcDebug.createTextField("field", 2, 0, 0, 400, 50);
var _local2 = new TextFormat();
_local2.font = DEBUG_FONT;
_local2.size = DEBUG_FONT_SIZE;
_local2.color = DEBUG_FONT_COLOR;
_local2.align = "right";
mcDebug.field.setNewTextFormat(_local2);
mcDebug.field.selectable = false;
mcDebug.createTextField("fieldShadow", 1, 1, 1, 400, 50);
var _local3 = new TextFormat();
_local3.font = DEBUG_FONT;
_local3.size = DEBUG_FONT_SIZE;
_local3.color = DEBUG_FONT_SHADOW_COLOR;
_local3.align = "right";
mcDebug.fieldShadow.setNewTextFormat(_local3);
mcDebug.fieldShadow.selectable = false;
}
function reset() {
nUpdateCount = 0;
nLastGetTimer = getTimer();
}
function computeFrameRate() {
var _local2 = getTimer() - nLastGetTimer;
var _local3 = _local2 / 1000;
nCurrentFPS = Math.round(nMovieFPS / _local3);
reset();
}
function updateDebug() {
if (mcDebug != undefined) {
nUpdateCounter++;
var _local2 = ((nCurrentFPS + " fps (avg ") + getAverage()) + ")";
mcDebug.field.text = _local2;
mcDebug.fieldShadow.text = _local2;
}
}
function getAverage() {
nAverageFps = nAverageFps + ((nCurrentFPS - nAverageFps) * (1 / nUpdateCounter));
var _local3 = "";
var _local2 = String(nAverageFps).split(".");
if (_local2[1] == undefined) {
_local3 = nAverageFps + ".00";
} else if (_local2[1].length == 1) {
_local3 = (_local2[0] + ".0") + _local2[1];
} else {
_local3 = (_local2[0] + ".") + _local2[1].substr(0, 2);
}
return(_local3);
}
static var DEBUG_DEPTH = 123456;
static var DEBUG_RIGHT_MARGIN = 0;
static var DEBUG_TOP_MARGIN = 0;
static var DEBUG_FONT = "Verdana";
static var DEBUG_FONT_SIZE = 10;
static var DEBUG_FONT_COLOR = 16777215;
static var DEBUG_FONT_SHADOW_COLOR = 0;
}
Symbol 1017 MovieClip [__Packages.com.sarbakan.utils.Delegate] Frame 0
class com.sarbakan.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;
var _local4 = arguments.callee.func;
var _local2 = arguments.callee.arg;
_local2 = _local2.concat(arguments);
return(_local4.apply(_local3, _local2));
};
_local2.target = obj;
_local2.func = func;
_local2.arg = arguments.slice(2);
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 1018 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.Controller] Frame 0
class com.disney.gem.games.ocean_cleaning.Controller extends com.sarbakan.BaseDisneyController
{
var nIndex, mcTimeline, oTransitionManager, bIn, showScreen, onGameStart, setLevel, setGamePhase, nLevel, oGame, oMainBroadcaster, hideCurrentScreen, onLevelStart, pause, nGamePhase, unpause;
function Controller (_mcTimeline, _oPreloaderScreen) {
super(_mcTimeline, _oPreloaderScreen);
nIndex = 0;
var _local3 = mcTimeline.createEmptyMovieClip("mcSound", mcTimeline.getNextHighestDepth());
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doInit(_local3);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.setCategoryVolume(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_CAT_NAME, com.disney.gem.games.ocean_cleaning.utility.Sounds.nMUSIC_CAT_VOLUME);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.setCategoryVolume(com.disney.gem.games.ocean_cleaning.utility.Sounds.sAMBIENT_CAT_NAME, com.disney.gem.games.ocean_cleaning.utility.Sounds.nAMBIENT_CAT_VOLUME);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.setCategoryVolume(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSOUND_CAT_NAME, com.disney.gem.games.ocean_cleaning.utility.Sounds.nSOUND_CAT_VOLUME);
}
static function getInstance() {
return(com.disney.gem.games.ocean_cleaning.Controller(com.sarbakan.BaseDisneyController.oInstance));
}
function update(_nElapsed) {
super.update(_nElapsed);
if ((oTransitionManager.getState() == "in") && (!bIn)) {
bIn = true;
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_TRANSITION_IN, true, false);
} else if ((oTransitionManager.getState() == "out") && (bIn)) {
bIn = false;
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_TRANSITION_OUT, true, false);
}
}
function init() {
super.init();
showTitleScreen();
com.disney.gem.games.ocean_cleaning.utility.Sounds.setMusic(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_PACKAGING);
}
function showTitleScreen(_bShowTransition) {
if (_bShowTransition) {
showScreen(new com.disney.gem.games.ocean_cleaning.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.ocean_cleaning.screens.TitleScreen(mcTimeline.mcScreens.mcTitle));
}
}
function startNewGame() {
onGameStart();
setLevel(0);
com.disney.gem.games.ocean_cleaning.Stats.reset();
startNextLevel();
}
function startNextLevel() {
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
setLevel(nLevel + 1);
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, restartLevel));
}
function restartLevel(_bRestart) {
if (_bRestart) {
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, restartLevel));
} else {
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
setLevel(nLevel);
if (oGame != undefined) {
oGame.deleteAll();
oMainBroadcaster.removeListener(oGame);
delete oGame;
}
oGame = new com.disney.gem.games.ocean_cleaning.GameEngine(this, mcTimeline.mcGame.mcGame);
oMainBroadcaster.addListener(oGame);
hideCurrentScreen();
onLevelStart();
onLevelTransitionDone();
}
}
function showInstructionScreen() {
pause();
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, showHelpScreen));
} else {
showScreen(new com.disney.gem.games.ocean_cleaning.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false, sTRANSITION_DEFAULT);
}
}
function hideInstructionScreen() {
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, hideHelpScreen), com.sarbakan.utils.Delegate.create(this, unpause));
} else {
showScreen(new com.disney.gem.games.ocean_cleaning.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
}
}
function showHelpScreen() {
showScreen(new com.disney.gem.games.ocean_cleaning.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false);
}
function hideHelpScreen() {
hideCurrentScreen(null);
}
function onLevelTransitionDone() {
oGame.init();
}
function onGameLose() {
showScreen(new com.disney.gem.games.ocean_cleaning.screens.EndScreen(mcTimeline.mcScreens.mcLose), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, clearLevel, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
}
function onGameWon() {
showScreen(new com.disney.gem.games.ocean_cleaning.screens.EndScreen(mcTimeline.mcScreens.mcWin), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, clearLevel, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
}
function clearLevel(_nGamePhase) {
setGamePhase(_nGamePhase);
if (oGame != undefined) {
oGame.deleteAll();
oMainBroadcaster.removeListener(oGame);
delete oGame;
}
}
function getGenericName(_sName) {
_sName = (_sName + "_") + (nIndex++).toString();
return(_sName);
}
static var sTRANSITION_DEFAULT = "default";
}
Symbol 1019 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.GameEngine] Frame 0
class com.disney.gem.games.ocean_cleaning.GameEngine
{
static var oInstance;
var oController, mcGame, oHud, oCam, aEventDispatcher, oPlayerDispatcher, aCollidersGroup, aObjects, bInited, nItems, nMaxItems, nFrame, nMinItems;
function GameEngine (_oController, _mcGame) {
oController = _oController;
mcGame = _mcGame;
oHud = new com.disney.gem.games.ocean_cleaning.Hud(oController, mcGame._parent.mcHud, this);
oCam = new com.disney.gem.games.ocean_cleaning.Cameras(mcGame);
aEventDispatcher = new Array();
oPlayerDispatcher = new com.disney.gem.games.ocean_cleaning.events.EventDispatcher();
aCollidersGroup = new Array();
aObjects = new Array();
bInited = false;
nItems = 0;
nMaxItems = 0;
nFrame = 0;
oInstance = this;
}
function init() {
oHud.init();
com.disney.gem.games.ocean_cleaning.utility.Sounds.setMusic(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_INGAME);
mcGame.gotoAndStop("Level" + com.disney.gem.games.ocean_cleaning.Controller.getInstance().getLevel());
bInited = false;
buildLevel(com.disney.gem.games.ocean_cleaning.Controller.getInstance().getLevel());
com.disney.gem.games.ocean_cleaning.Controller(oController).unpause();
oCam.update();
}
function onGameEnd() {
oHud.pause();
if (nMaxItems <= 0) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.StopAll(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.StopAll(com.disney.gem.games.ocean_cleaning.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doMuteCategory(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_WIN, true, false);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_WIN).oSound.onComplete = function () {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doUnMuteCategory(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_CAT_NAME);
};
oController.increaseScore(Math.floor(oHud.nTime / 30) * 10);
if (com.disney.gem.games.ocean_cleaning.Controller.getInstance().getLevel() == 3) {
oController.onGameWon();
} else {
com.disney.gem.games.ocean_cleaning.Controller.getInstance().startNextLevel();
}
} else {
com.disney.gem.games.ocean_cleaning.utility.Sounds.StopAll(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.StopAll(com.disney.gem.games.ocean_cleaning.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doMuteCategory(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_LOSE, true, false);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_LOSE).oSound.onComplete = function () {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doUnMuteCategory(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_CAT_NAME);
};
com.disney.gem.games.ocean_cleaning.Stats.__set__tries((com.disney.gem.games.ocean_cleaning.Stats.__get__tries()-1));
if (com.disney.gem.games.ocean_cleaning.Stats.__get__tries() > 0) {
oController.restartLevel(true);
} else {
oController.onGameLose();
}
}
}
function deleteAll() {
var _local3 = aObjects.length;
var _local2 = _local3 - 1;
while (_local2 >= 0) {
aObjects[_local2].destroy();
aObjects.splice(_local2, 1);
_local2--;
}
_local2 = 0;
while (_local2 < aEventDispatcher.length) {
aEventDispatcher[_local2].clearListeners();
_local2++;
}
oPlayerDispatcher.clearListeners();
delete aEventDispatcher;
delete oPlayerDispatcher;
aCollidersGroup = new Array();
}
function createBubble(_nX, _nY, _nWidth, _nHeight, _nXscale) {
var _local2 = new Array(["x", _nX], ["y", _nY], ["xscale", _nXscale]);
aObjects.push(new com.disney.gem.games.ocean_cleaning.bonus.Bubble(mcGame, aCollidersGroup, _local2));
}
function onUpdate() {
if (!com.disney.gem.games.ocean_cleaning.Controller.getInstance().oTransitionManager.isTransitionning()) {
oHud.update();
oCam.update();
if ((nMaxItems <= 0) && (bInited)) {
bInited = false;
com.disney.gem.games.ocean_cleaning.Controller.getInstance().pause();
onGameEnd();
}
}
}
function onPause() {
}
function onUnpause() {
}
function buildLevel(_nLevel) {
var _local2 = com.disney.gem.games.ocean_cleaning.utility.ClassFinder.find("com.disney.gem.games.ocean_cleaning.levels.level" + _nLevel);
var _local14 = _local2.Info.colliders;
var _local15 = _local2.Info.items;
var _local3;
nMinItems = _local2.Info.minimum;
oCam.__set__limits(_local2.Limits);
var _local6 = 1;
while (_local6 <= _local15) {
_local3 = getProperties(_local2["oItem" + _local6]);
var _local4 = com.disney.gem.games.ocean_cleaning.utility.ClassFinder.find((("com.disney.gem.games.ocean_cleaning." + _local2["oItem" + _local6].type) + ".") + _local2["oItem" + _local6].item);
var _local5 = _local2["oItem" + _local6].depth;
if ((_local2["oItem" + _local6].type == "friends") || (_local2["oItem" + _local6].type == "enemies")) {
var _local9 = {startX:_local2["oItem" + _local6].startx, startY:_local2["oItem" + _local6].starty, endX:_local2["oItem" + _local6].endx, endY:_local2["oItem" + _local6].endy};
var _local8 = _local2["oItem" + _local6].delay;
var _local7 = _local2["oItem" + _local6].speed;
aObjects.push(new _local4[undefined](mcGame, aCollidersGroup, _local3, _local9, _local8, _local5, _local7, 0));
} else {
if (_local2["oItem" + _local6].item == "Flounder") {
aObjects.push(new _local4[undefined](mcGame, aCollidersGroup, _local3, _local2["oItem" + _local6].delay, _local5));
} else if ((_local2["oItem" + _local6].item == "Starfish") && (com.disney.gem.games.ocean_cleaning.Stats.__get__stars()["level" + _nLevel] == true)) {
} else {
aObjects.push(new _local4[undefined](mcGame, aCollidersGroup, _local3, _local5));
}
if (_local2["oItem" + _local6].item == "Ariel") {
oCam.__set__follow(aObjects[aObjects.length - 1].Mc);
}
if (_local2["oItem" + _local6].type == "items") {
aEventDispatcher.push(new com.disney.gem.games.ocean_cleaning.events.EventDispatcher());
aObjects[aObjects.length - 1].setDispatcher(aEventDispatcher[aEventDispatcher.length - 1]);
nMaxItems++;
}
}
_local6++;
}
_local6 = 1;
while (_local6 <= _local14) {
_local3 = getProperties(_local2["oCollider" + _local6]);
aObjects.push(new com.disney.gem.games.ocean_cleaning.colliders.AllSide(mcGame, aCollidersGroup, _local3));
_local6++;
}
bInited = true;
}
function getProperties(_oItem) {
var _local4 = new Array();
var _local2 = new Array("x", "y", "xscale", "yscale", "rotation", "width", "height");
var _local1 = 0;
while (_local1 < _local2.length) {
if (_oItem[_local2[_local1]] != undefined) {
_local4.push([_local2[_local1], _oItem[_local2[_local1]]]);
}
_local1++;
}
return(_local4);
}
function get items() {
return(nItems);
}
function set items(_nItems) {
nItems = _nItems;
//return(items);
}
function get maxItems() {
return(nMaxItems);
}
function set maxItems(_nMaxItems) {
nMaxItems = _nMaxItems;
//return(maxItems);
}
function get minItems() {
return(nMinItems);
}
static function get Instance() {
return(oInstance);
}
}
Symbol 1020 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.Cameras] Frame 0
class com.disney.gem.games.ocean_cleaning.Cameras
{
var mcRef, mcFollow, oLimits, __get__follow, __get__limits;
function Cameras (_mcRef) {
mcRef = _mcRef;
}
function update() {
if (mcFollow != undefined) {
if (((mcFollow._x - 290) * -1) > oLimits.left) {
mcRef._x = oLimits.left;
} else if (((mcFollow._x - 290) * -1) < ((-oLimits.right) + 580)) {
mcRef._x = (-oLimits.right) + 580;
} else {
mcRef._x = (mcFollow._x - 290) * -1;
}
if (((mcFollow._y - 205) * -1) > oLimits.up) {
mcRef._y = oLimits.up;
} else if (((mcFollow._y - 205) * -1) < ((-oLimits.down) + 410)) {
mcRef._y = (-oLimits.down) + 410;
} else {
mcRef._y = (mcFollow._y - 205) * -1;
}
}
}
function set follow(_mcFollow) {
mcFollow = _mcFollow;
//return(__get__follow());
}
function set limits(_oLimits) {
oLimits = _oLimits;
//return(__get__limits());
}
}
Symbol 1021 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.levels.level1] Frame 0
class com.disney.gem.games.ocean_cleaning.levels.level1
{
function level1 () {
}
static var Info = {minimum:5, items:17, colliders:16};
static var Limits = {up:0, down:860, left:0, right:870};
static var oItem1 = {type:"bonus", item:"Flounder", x:132, y:675, yscale:99.7, xscale:-100.1, delay:300, depth:220};
static var oItem2 = {type:"bonus", item:"Sebastian", x:526.2, y:540.4, yscale:99.9, delay:200, depth:230};
static var oItem3 = {type:"bonus", item:"Starfish", x:746.4, y:515.3, yscale:100, xscale:100, rotation:15, depth:210};
static var oItem4 = {type:"bonus", item:"Stopwatch", x:56.4, y:810, yscale:100.3, xscale:100, rotation:-45, depth:200};
static var oItem5 = {type:"characters", item:"Ariel", x:450.8, y:323.1, yscale:100.1, depth:500};
static var oItem6 = {type:"characters", item:"Scuttle", x:816.2, y:241.7, yscale:100, depth:400};
static var oItem7 = {type:"items", item:"Boot", x:689.7, y:742.8, xscale:100.1, depth:180};
static var oItem8 = {type:"items", item:"Candelabra", x:782.8, y:768.4, yscale:100, xscale:100, rotation:-30, depth:160};
static var oItem9 = {type:"items", item:"Goblet", x:590.1, y:772.4, yscale:100.2, xscale:100.3, depth:140};
static var oItem10 = {type:"items", item:"Lamp", x:152.7, y:780.5, yscale:100.1, xscale:100.4, rotation:30, depth:150};
static var oItem11 = {type:"items", item:"Spyglass", x:397.4, y:739.1, yscale:100, xscale:100.5, rotation:135, depth:110};
static var oItem12 = {type:"items", item:"Wheel", x:66.5, y:594.1, yscale:99.9, depth:100};
static var oItem13 = {type:"enemies", item:"Flotsam", x:-246.5, y:649.5, startx:-246.5, starty:649.5, endx:1034.3, endy:649.5, yscale:100.1, delay:90, speed:5, depth:350};
static var oItem14 = {type:"friends", item:"Fish1", x:990.1, y:504, startx:990.1, starty:504, endx:-150, endy:504, delay:90, speed:5, depth:310};
static var oItem15 = {type:"friends", item:"Fish2", x:989.4, y:760.2, startx:989.4, starty:760.2, endx:-150.6, endy:760.2, yscale:100.1, xscale:100.1, delay:90, speed:5, depth:320};
static var oItem16 = {type:"friends", item:"Turtle", x:-152.6, y:406.4, startx:-152.6, starty:406.4, endx:987.4, endy:406.4, delay:90, speed:5, depth:330};
static var oItem17 = {type:"friends", item:"Fish3", x:986.2, y:307.8, startx:986.2, starty:307.8, endx:-153.8, endy:307.8, delay:70, speed:4, depth:300};
static var oCollider1 = {type:"AllSide", x:74, y:630.8, width:86, height:21.9};
static var oCollider2 = {type:"AllSide", x:19.4, y:595.6, width:44, height:92.1};
static var oCollider3 = {type:"AllSide", x:14.9, y:782, width:29.9, height:109.8};
static var oCollider4 = {type:"AllSide", x:595, y:814.6, width:497.7, height:21.6};
static var oCollider5 = {type:"AllSide", x:242.7, y:836.4, width:497.7, height:21.6};
static var oCollider6 = {type:"AllSide", x:42, y:683, width:96, height:93.1};
static var oCollider7 = {type:"AllSide", x:429.4, y:785.4, width:168.5, height:52};
static var oCollider8 = {type:"AllSide", x:848, y:755.5, width:44, height:140};
static var oCollider9 = {type:"AllSide", x:786, y:630, width:44, height:140};
static var oCollider10 = {type:"AllSide", x:820, y:687, width:44, height:44.1};
static var oCollider11 = {type:"AllSide", x:355.4, y:770.4, width:48.2, height:133.5};
static var oCollider12 = {type:"AllSide", x:435, y:218.3, width:870, height:50};
static var oCollider13 = {type:"AllSide", x:713.6, y:542.1, width:325.8, height:41.9};
static var oCollider14 = {type:"AllSide", x:652.4, y:566.4, width:312.1, height:23.9};
static var oCollider15 = {type:"AllSide", x:-5, y:433.3, width:10, height:400.3};
static var oCollider16 = {type:"AllSide", x:875, y:432.4, width:10, height:400.3};
}
Symbol 1022 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.levels.level2] Frame 0
class com.disney.gem.games.ocean_cleaning.levels.level2
{
function level2 () {
}
static var Info = {minimum:7, items:20, colliders:15};
static var Limits = {up:0, down:860, left:0, right:870};
static var oItem1 = {type:"bonus", item:"Sebastian", x:124, y:771.4, yscale:99.9, delay:200, depth:230};
static var oItem2 = {type:"bonus", item:"Starfish", x:632, y:779, yscale:100, xscale:100, rotation:30, depth:210};
static var oItem3 = {type:"bonus", item:"Stopwatch", x:789.5, y:774.7, yscale:100.3, depth:200};
static var oItem4 = {type:"characters", item:"Ariel", x:479, y:285.3, yscale:100.1, depth:500};
static var oItem5 = {type:"characters", item:"Scuttle", x:816.2, y:241.7, yscale:100, depth:400};
static var oItem6 = {type:"items", item:"Boot", x:724, y:650.4, xscale:100.1, depth:180};
static var oItem7 = {type:"items", item:"Candelabra", x:111.9, y:624.4, yscale:100, xscale:100, rotation:-15, depth:160};
static var oItem8 = {type:"items", item:"Fork", x:179.6, y:791.1, yscale:100, xscale:100, rotation:60, depth:170};
static var oItem9 = {type:"items", item:"Goblet", x:510.4, y:707.6, yscale:100.2, xscale:100.3, rotation:-15, depth:140};
static var oItem10 = {type:"items", item:"Lamp", x:357.9, y:772.4, yscale:100.1, xscale:100.4, depth:150};
static var oItem11 = {type:"items", item:"Mirror", x:713.8, y:553.7, yscale:100, xscale:100, rotation:60, depth:120};
static var oItem12 = {type:"items", item:"Spyglass", x:779, y:655.3, yscale:100, xscale:100.5, rotation:75, depth:110};
static var oItem13 = {type:"items", item:"Wheel", x:714.3, y:779.6, yscale:99.9, xscale:100, rotation:90, depth:100};
static var oItem14 = {type:"enemies", item:"Jetsam", x:1002.8, y:646.5, startx:1002.8, starty:646.5, endx:-145.7, endy:646.5, yscale:100.1, delay:80, speed:5, depth:360};
static var oItem15 = {type:"friends", item:"Fish1", x:-150, y:579.8, startx:-150, starty:579.8, endx:990.1, endy:570.6, delay:30, speed:4, depth:310};
static var oItem16 = {type:"friends", item:"Fish2", x:-150.6, y:296.4, startx:-150.6, starty:296.4, endx:989.4, endy:296.4, yscale:100.1, xscale:100.1, delay:90, speed:6, depth:320};
static var oItem17 = {type:"friends", item:"Fish3", x:977.4, y:758.6, startx:977.4, starty:758.6, endx:-162.6, endy:758.6, delay:70, speed:4, depth:300};
static var oItem18 = {type:"friends", item:"Turtle", x:987.4, y:501.8, startx:987.4, starty:501.8, endx:-152.6, endy:501.8, delay:10, speed:2, depth:330};
static var oItem19 = {type:"enemies", item:"Shark", x:979, y:395.7, startx:979, starty:395.7, endx:-161.1, endy:395.7, xscale:100, delay:150, speed:7, depth:340};
static var oItem20 = {type:"bonus", item:"Flounder", x:111.7, y:468.8, yscale:99.7, xscale:-100.1, delay:300, depth:220};
static var oCollider1 = {type:"AllSide", x:45.5, y:598.5, width:43.8, height:154};
static var oCollider2 = {type:"AllSide", x:131.3, y:651.5, width:155.7, height:22.1};
static var oCollider3 = {type:"AllSide", x:57.5, y:729.5, width:39.6, height:158.4};
static var oCollider4 = {type:"AllSide", x:480.4, y:765.4, width:203.8, height:64.3};
static var oCollider5 = {type:"AllSide", x:444.4, y:687.3, width:45.9, height:98.1};
static var oCollider6 = {type:"AllSide", x:448.4, y:812.5, width:771.2, height:30.3};
static var oCollider7 = {type:"AllSide", x:828.5, y:752.4, width:45.9, height:182.4};
static var oCollider8 = {type:"AllSide", x:749.5, y:675.5, width:117, height:25.9};
static var oCollider9 = {type:"AllSide", x:827.5, y:616, width:31.1, height:93.5};
static var oCollider10 = {type:"AllSide", x:733, y:574.5, width:263.1, height:23.6};
static var oCollider11 = {type:"AllSide", x:807.5, y:551, width:141.4, height:23.6};
static var oCollider12 = {type:"AllSide", x:435.1, y:217.4, width:870, height:50};
static var oCollider13 = {type:"AllSide", x:-5, y:433.4, width:10, height:400.3};
static var oCollider14 = {type:"AllSide", x:875, y:433.4, width:10, height:400.3};
static var oCollider15 = {type:"AllSide", x:144.3, y:513.4, width:341.6, height:38.1};
}
Symbol 1023 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.levels.level3] Frame 0
class com.disney.gem.games.ocean_cleaning.levels.level3
{
function level3 () {
}
static var Info = {minimum:9, items:22, colliders:14};
static var Limits = {up:0, down:860, left:0, right:870};
static var oItem1 = {type:"bonus", item:"Flounder", x:784.2, y:746.6, yscale:99.8, xscale:100.1, delay:300, depth:220};
static var oItem2 = {type:"bonus", item:"Starfish", x:824.3, y:551.2, yscale:100, xscale:100, rotation:-15, depth:210};
static var oItem3 = {type:"bonus", item:"Stopwatch", x:146.9, y:768.8, yscale:100.3, depth:200};
static var oItem4 = {type:"characters", item:"Ariel", x:479, y:285.3, yscale:100.1, depth:500};
static var oItem5 = {type:"characters", item:"Scuttle", x:816.2, y:241.7, yscale:100, depth:400};
static var oItem6 = {type:"items", item:"Boot", x:639, y:431.8, xscale:100.1, depth:180};
static var oItem7 = {type:"items", item:"Candelabra", x:190.4, y:779.4, yscale:100, xscale:100, rotation:-15, depth:160};
static var oItem8 = {type:"items", item:"Fork", x:427.1, y:756.2, yscale:100, xscale:100, rotation:45, depth:170};
static var oItem9 = {type:"items", item:"Goblet", x:567, y:560.7, yscale:100, xscale:100, rotation:-15, depth:140};
static var oItem10 = {type:"items", item:"Lamp", x:261.3, y:682.5, yscale:100.1, xscale:100.4, depth:150};
static var oItem11 = {type:"items", item:"Mirror", x:654.9, y:783.9, depth:120};
static var oItem12 = {type:"items", item:"Pipe", x:250.3, y:733.1, depth:130};
static var oItem13 = {type:"items", item:"Spyglass", x:816.9, y:671.5, yscale:100, xscale:100.5, rotation:90, depth:110};
static var oItem14 = {type:"items", item:"Wheel", x:710, y:556.4, yscale:99.9, xscale:100, rotation:90, depth:100};
static var oItem15 = {type:"enemies", item:"Flotsam", x:994.3, y:643.4, startx:994.3, starty:643.4, endx:-145.7, endy:643.4, yscale:100.1, delay:80, speed:4.8, depth:350};
static var oItem16 = {type:"enemies", item:"Jetsam", x:-145.7, y:763.9, startx:-145.7, starty:763.9, endx:994.3, endy:763.9, yscale:100.1, delay:50, speed:5, depth:360};
static var oItem17 = {type:"enemies", item:"Shark", x:983.5, y:367.1, startx:983.5, starty:367.1, endx:-156.6, endy:367.1, xscale:100, delay:150, speed:7, depth:340};
static var oItem18 = {type:"friends", item:"Fish1", x:-150, y:701.8, startx:-150, starty:701.8, endx:990.1, endy:701.8, delay:45, speed:6, depth:310};
static var oItem19 = {type:"friends", item:"Fish2", x:989.4, y:465.3, startx:989.4, starty:465.3, endx:-150.6, endy:465.3, yscale:100.1, xscale:100.1, delay:90, speed:4, depth:320};
static var oItem20 = {type:"friends", item:"Fish3", x:-150.8, y:548.2, startx:-150.8, starty:548.2, endx:989.2, endy:548.2, delay:40, speed:4.3, depth:300};
static var oItem21 = {type:"friends", item:"Turtle", x:987.4, y:294.1, startx:987.4, starty:294.1, endx:-152.6, endy:294.1, delay:25, speed:2.4, depth:330};
static var oItem22 = {type:"bonus", item:"Sebastian", x:36.4, y:647.2, yscale:99.9, delay:200, depth:230};
static var oCollider1 = {type:"AllSide", x:875, y:382.4, width:10, height:300.3};
static var oCollider2 = {type:"AllSide", x:435, y:217.3, width:870, height:50};
static var oCollider3 = {type:"AllSide", x:-5, y:383.4, width:10, height:300.3};
static var oCollider4 = {type:"AllSide", x:703.5, y:460.4, width:359.3, height:31.6};
static var oCollider5 = {type:"AllSide", x:701.1, y:574.5, width:314.9, height:23.6};
static var oCollider6 = {type:"AllSide", x:-37, y:744.5, width:39.6, height:158.4};
static var oCollider7 = {type:"AllSide", x:857.5, y:519.8, width:31.1, height:133.3};
static var oCollider8 = {type:"AllSide", x:543.4, y:607.6, width:29.1, height:89.9};
static var oCollider9 = {type:"AllSide", x:862.5, y:667.5, width:15.8, height:311.9};
static var oCollider10 = {type:"AllSide", x:437.9, y:831.6, width:974, height:30.3};
static var oCollider11 = {type:"AllSide", x:18.4, y:676.5, width:77.8, height:22.1};
static var oCollider12 = {type:"AllSide", x:-29.6, y:594.5, width:43.8, height:154};
static var oCollider13 = {type:"AllSide", x:246.8, y:787.7, width:53.8, height:98.1};
static var oCollider14 = {type:"AllSide", x:100.3, y:531.6, width:267, height:36.3};
}
Symbol 1024 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.collision.CollideItem] Frame 0
class com.disney.gem.games.ocean_cleaning.collision.CollideItem extends com.sarbakan.utils.StateManaged
{
var mcTopLeft, mcBottomRight, nSpeedX, nSpeedY, oTarget, mcRef;
function CollideItem (_mcRef, _mcTopLeft, _mcBottomRight) {
super(_mcRef);
mcTopLeft = _mcTopLeft;
mcBottomRight = _mcBottomRight;
nSpeedX = 0;
nSpeedY = 0;
}
function topLeft(_mc) {
mcTopLeft = _mc;
}
function bottomRight(_mc) {
mcBottomRight = _mc;
}
function setTarget(_oTarget) {
oTarget = _oTarget;
oTarget.addEventListener(com.disney.gem.games.ocean_cleaning.events.Event.TEST, Collide, this);
}
function Collide(_oEvt, _oObj) {
var _local9 = left + speedX;
var _local10 = top + speedY;
var _local11 = right + speedX;
var _local12 = bottom + speedY;
var _local4 = _oObj.left + _oObj.speedX;
var _local5 = _oObj.top + _oObj.speedY;
var _local6 = _oObj.right + _oObj.speedX;
var _local8 = _oObj.bottom + _oObj.speedY;
var _local3 = testCollide(_local9, _local10, _local11, _local12, _local4, _local5, _local6, _local8);
if (_local3 > -1) {
var _local7 = fromWhere(_local3);
_oEvt.__get__target().dispatchEvent(new com.disney.gem.games.ocean_cleaning.events.Event(com.disney.gem.games.ocean_cleaning.events.Event.COLLIDE, _local7), this);
}
}
function fromWhere(_nFrom) {
var _local1;
switch (_nFrom) {
case 0 :
case 1 :
case 2 :
case 9 :
_local1 = "top";
break;
case 3 :
case 11 :
case 14 :
case 16 :
_local1 = "left";
break;
case 5 :
case 12 :
case 15 :
case 17 :
_local1 = "right";
break;
case 6 :
case 7 :
case 8 :
case 10 :
_local1 = "bottom";
break;
case 4 :
_local1 = "center";
break;
case 13 :
_local1 = "over";
break;
default :
_local1 = "undefined";
}
return(_local1);
}
function testCollide(_nX1A, _nY1A, _nX2A, _nY2A, _nX1B, _nY1B, _nX2B, _nY2B) {
var _local2 = ((_nX1A < _nX2A) ? (_nX1A) : (_nX2A));
var _local6 = ((_nX1A < _nX2A) ? (_nX2A) : (_nX1A));
var _local4 = ((_nY1A < _nY2A) ? (_nY1A) : (_nY2A));
var _local8 = ((_nY1A < _nY2A) ? (_nY2A) : (_nY1A));
var _local1 = ((_nX1B < _nX2B) ? (_nX1B) : (_nX2B));
var _local5 = ((_nX1B < _nX2B) ? (_nX2B) : (_nX1B));
var _local3 = ((_nY1B < _nY2B) ? (_nY1B) : (_nY2B));
var _local7 = ((_nY1B < _nY2B) ? (_nY2B) : (_nY1B));
var _local9 = -1;
if ((((_local5 > _local2) && (_local7 > _local4)) && (_local1 < _local2)) && (_local3 < _local4)) {
_local9 = (((_local5 - _local2) > (_local7 - _local4)) ? 0 : 14);
} else if ((((_local5 < _local6) && (_local7 > _local4)) && (_local1 > _local2)) && (_local3 < _local4)) {
_local9 = 1;
} else if ((((_local5 > _local6) && (_local7 > _local4)) && (_local1 < _local6)) && (_local3 < _local4)) {
_local9 = (((_local6 - _local1) > (_local7 - _local4)) ? 2 : 15);
} else if ((((_local5 > _local2) && (_local7 < _local8)) && (_local1 < _local2)) && (_local3 > _local4)) {
_local9 = 3;
} else if ((((_local5 < _local6) && (_local7 < _local8)) && (_local1 > _local2)) && (_local3 > _local4)) {
_local9 = 4;
} else if ((((_local5 > _local6) && (_local7 < _local8)) && (_local1 < _local6)) && (_local3 > _local4)) {
_local9 = 5;
} else if ((((_local5 > _local2) && (_local7 > _local8)) && (_local1 < _local2)) && (_local3 < _local8)) {
_local9 = (((_local5 - _local2) > (_local8 - _local3)) ? 6 : 16);
} else if ((((_local5 < _local6) && (_local7 > _local8)) && (_local1 > _local2)) && (_local3 < _local8)) {
_local9 = 7;
} else if ((((_local5 > _local6) && (_local7 > _local8)) && (_local1 < _local6)) && (_local3 < _local8)) {
_local9 = (((_local6 - _local1) > (_local8 - _local3)) ? 8 : 17);
} else if ((((_local5 > _local6) && (_local1 < _local2)) && (_local7 > _local4)) && (_local3 < _local4)) {
_local9 = 9;
} else if ((((_local5 > _local6) && (_local1 < _local2)) && (_local3 < _local8)) && (_local7 > _local8)) {
_local9 = 10;
} else if ((((_local5 > _local2) && (_local1 < _local2)) && (_local3 < _local4)) && (_local7 > _local8)) {
_local9 = 11;
} else if ((((_local5 > _local6) && (_local1 < _local6)) && (_local3 < _local4)) && (_local7 > _local8)) {
_local9 = 12;
} else if ((((_local5 > _local6) && (_local1 < _local2)) && (_local3 < _local4)) && (_local7 > _local8)) {
_local9 = 13;
}
return(_local9);
}
function startListening() {
oTarget.addEventListener(com.disney.gem.games.ocean_cleaning.events.Event.TEST, Collide, this);
}
function stopListening() {
oTarget.removeEventListener(com.disney.gem.games.ocean_cleaning.events.Event.TEST, Collide, this);
}
function destroy() {
stopListening();
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.removeListener(this);
super.destroy();
}
function get x() {
return(mcRef._x);
}
function get y() {
return(mcRef._y);
}
function get top() {
return(mcTopLeft._y + y);
}
function get bottom() {
return(mcBottomRight._y + y);
}
function get left() {
return(mcTopLeft._x + x);
}
function get right() {
return(mcBottomRight._x + x);
}
function get speedX() {
return(nSpeedX);
}
function get speedY() {
return(nSpeedY);
}
function set x(_nX) {
mcRef._x = _nX;
//return(x);
}
function set y(_nY) {
mcRef._y = _nY;
//return(y);
}
}
Symbol 1025 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.events.EventDispatcher] Frame 0
class com.disney.gem.games.ocean_cleaning.events.EventDispatcher
{
var oListener, bEnabled;
function EventDispatcher () {
oListener = new Object();
bEnabled = true;
}
function dispatchEvent(_oEvt, _oOwner) {
if (bEnabled) {
_oEvt.__set__target(this);
var _local4 = oListener[_oEvt.__get__type()];
var _local6 = _local4.length;
var _local2 = _local6 - 1;
while (_local2 > -1) {
var _local3 = _local4[_local2];
_local3.func.apply(_local3.owner, [_oEvt, _oOwner]);
_local2--;
}
}
}
function addEventListener(_sType, _fFunc, _oOwner) {
if (oListener[_sType] == undefined) {
oListener[_sType] = new Array();
}
if (findListener(_sType, _fFunc, _oOwner) == -1) {
oListener[_sType].push({func:_fFunc, owner:_oOwner});
}
}
function removeEventListener(_sType, _fFunc, _oOwner) {
if (((_sType != undefined) && (_fFunc != undefined)) && (_oOwner != undefined)) {
var _local2 = findListener(_sType, _fFunc, _oOwner);
if (_local2 > -1) {
oListener[_sType].splice(_local2, 1);
}
}
}
function clearListeners() {
oListener = new Object();
}
function hasEventListener(_sType) {
return(oListener[_sType].length > 0);
}
function findListener(_sType, _fFunc, _oOwner) {
var _local3 = oListener[_sType];
var _local5 = _local3.length;
var _local4 = -1;
var _local2 = _local5 - 1;
while (_local2 > -1) {
if ((_local3[_local2].owner == _oOwner) && (_local3[_local2].func == _fFunc)) {
_local4 = _local2;
break;
}
_local2--;
}
return(_local4);
}
function set enabled(_bEnabled) {
bEnabled = _bEnabled;
//return(enabled);
}
function get enabled() {
return(bEnabled);
}
}
Symbol 1026 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.events.Event] Frame 0
class com.disney.gem.games.ocean_cleaning.events.Event
{
var sType, sFrom, oTarget;
function Event (_sType, _sFrom) {
sType = _sType;
sFrom = _sFrom;
}
function set target(_oTarget) {
oTarget = _oTarget;
//return(target);
}
function get target() {
return(oTarget);
}
function get type() {
return(sType);
}
function get from() {
return(sFrom);
}
function toString() {
return(((("[Event type=\"" + sType) + "\" from=\"") + sFrom) + "\"]");
}
static var COLLIDE = "collide";
static var TEST = "test";
}
Symbol 1027 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.characters.BaseChar] Frame 0
class com.disney.gem.games.ocean_cleaning.characters.BaseChar extends com.disney.gem.games.ocean_cleaning.collision.CollideItem
{
var sType, mcRef, oBox;
function BaseChar (_mcRef, _oTarget, _mcTopLeft, _mcBottomRight) {
super(_mcRef, _mcTopLeft, _mcBottomRight);
sType = "character";
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.addListener(this);
}
function setProperties(_aProperties) {
var _local2 = 0;
while (_local2 < _aProperties.length) {
mcRef["_" + _aProperties[_local2][0]] = _aProperties[_local2][1];
_local2++;
}
}
function get type() {
return(sType);
}
function get box() {
return(oBox);
}
function destroy() {
mcRef.removeMovieClip();
super.destroy();
}
}
Symbol 1028 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.characters.Ariel] Frame 0
class com.disney.gem.games.ocean_cleaning.characters.Ariel extends com.disney.gem.games.ocean_cleaning.characters.BaseChar
{
var setMC, mcRef, topLeft, bottomRight, setProperties, bShield, bSpeed, oItem, bCanSwitch, bSwitched, bCanMove, bCanTake, bOccupied, nSpeedX, nSpeedY, nAccelX, nAccelY, nDecelX, nDecelY, nMaxSpeedX, nMaxSpeedY, nMinSpeedX, nMinSpeedY, nShieldTime, nSpeedTime, aControl, nPosition, setState, sCollideFrom, getState, __get__y, __get__x, stateFinished, stateCurrentFrame;
function Ariel (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcChar");
_mcGame.attachMovie("mcAriel", _local3, _nDepth);
setMC(_mcGame[_local3]);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setProperties(_aProperties);
bShield = false;
bSpeed = false;
oItem = null;
bCanSwitch = false;
bSwitched = false;
bCanMove = true;
bCanTake = true;
bOccupied = false;
nSpeedX = 0;
nSpeedY = 0;
nAccelX = 1;
nAccelY = 1;
nDecelX = 0.5;
nDecelY = 0.5;
nMaxSpeedX = 10;
nMaxSpeedY = 10;
nMinSpeedX = 0;
nMinSpeedY = 0;
nShieldTime = 0;
nSpeedTime = 0;
aControl = new Array(37, 39, 38, 40);
nPosition = nPOSITION_LEFT;
setState(sSTATE_IDLE, true);
setHoldingObject();
setShield();
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher.addEventListener(com.disney.gem.games.ocean_cleaning.events.Event.COLLIDE, collideWith, this);
}
function collideWith(_oEvt, _oObj) {
if (_oEvt.__get__from() != undefined) {
if ((_oObj.type == "bonus") && (!bOccupied)) {
sCollideFrom = undefined;
switch (_oObj.name) {
case "Bubble" :
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUBBLE, true, false);
bShield = true;
nShieldTime = com.disney.gem.games.ocean_cleaning.Config.Bubble.Time;
_oObj.destroy();
break;
case "Sebastian" :
if (_oObj.enabled) {
bOccupied = true;
bSpeed = true;
nSpeedTime = com.disney.gem.games.ocean_cleaning.Config.Sebastian.Time;
if (oItem != undefined) {
setState(sSTATE_HIGHFIVE_OBJECT, true);
} else {
setState(sSTATE_HIGHFIVE, true);
}
_oObj.setState("highfive");
}
break;
case "Stopwatch" :
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_STOPWATCH, true, false);
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oHud.nTime = com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oHud.nTime + com.disney.gem.games.ocean_cleaning.Config.Stopwatch.Time;
_oObj.destroy();
break;
case "Starfish" :
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_STARFISH, true, false);
com.disney.gem.games.ocean_cleaning.Stats.tries = com.disney.gem.games.ocean_cleaning.Stats.tries + com.disney.gem.games.ocean_cleaning.Config.Starfish.Try;
com.disney.gem.games.ocean_cleaning.Stats.__get__stars()["level" + com.disney.gem.games.ocean_cleaning.Controller.getInstance().getLevel()] = true;
_oObj.destroy();
}
} else if (_oObj.type == "character") {
sCollideFrom = undefined;
if (((_oObj.name == "Scuttle") && (oItem != undefined)) && (com.disney.gem.games.ocean_cleaning.characters.Scuttle.__get__Instance().bCanReceive)) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_ARIEL_GIVES, true, false);
setState(sSTATE_GIVES, true);
_oObj.item = oItem.name;
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_SCUTTLE_GRABS);
_oObj.setScuttleState("grabs", true);
oItem.destroy();
}
} else if (_oObj.type == "enemy") {
sCollideFrom = undefined;
if ((((((getState() != sSTATE_HURT) && (getState() != sSTATE_BOUNCE)) && (getState() != sSTATE_BOUNCE_OBJECT)) && (getState() != sSTATE_GRABS_OBJECT)) && (getState() != sSTATE_HIGHFIVE)) && (getState() != sSTATE_HIGHFIVE_OBJECT)) {
bounceFrom(_oObj, true);
}
} else if (_oObj.type == "friend") {
sCollideFrom = undefined;
if (((((((getState() != sSTATE_HURT) && (getState() != sSTATE_BOUNCE)) && (getState() != sSTATE_BOUNCE_OBJECT)) && (getState() != sSTATE_GIVES)) && (getState() != sSTATE_GRABS_OBJECT)) && (getState() != sSTATE_HIGHFIVE)) && (getState() != sSTATE_HIGHFIVE_OBJECT)) {
bounceFrom(_oObj, false);
}
} else if (_oObj.type == "collider") {
sCollideFrom = _oEvt.from;
switch (_oEvt.__get__from()) {
case "top" :
mcRef._y = _oObj.top - mcRef.mcBoxBottomRight._y;
nSpeedY = 0;
break;
case "left" :
mcRef._x = _oObj.left - mcRef.mcBoxBottomRight._x;
nSpeedX = 0;
break;
case "right" :
mcRef._x = _oObj.right - mcRef.mcBoxTopLeft._x;
nSpeedX = 0;
break;
case "bottom" :
mcRef._y = _oObj.bottom - mcRef.mcBoxTopLeft._y;
nSpeedY = 0;
}
} else if ((((_oObj.type == "item") && (oItem == undefined)) && (bCanTake)) && (!bOccupied)) {
sCollideFrom = undefined;
bOccupied = true;
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_ARIEL_GRABS, true, false);
setState(sSTATE_GRABS_OBJECT, true);
oItem = _oObj;
oItem.stopListening();
}
} else {
trace(((("=== " + _oObj.name) + " : ") + _oEvt.__get__from()) + " ===");
}
setHoldingObject();
setShield();
}
function onUpdate() {
super.onUpdate();
if (!com.disney.gem.games.ocean_cleaning.Controller.getInstance().oTransitionManager.isTransitionning()) {
checkMovement();
move();
resetSpeed();
sCollideFrom = "";
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher.dispatchEvent(new com.disney.gem.games.ocean_cleaning.events.Event(com.disney.gem.games.ocean_cleaning.events.Event.TEST), this);
if (bShield) {
nShieldTime--;
if (nShieldTime <= 0) {
bShield = false;
}
}
if (bSpeed) {
nSpeedTime--;
if (nSpeedTime <= 0) {
bSpeed = false;
nAccelX = com.disney.gem.games.ocean_cleaning.Config.Ariel.Acceleration;
nAccelY = com.disney.gem.games.ocean_cleaning.Config.Ariel.Acceleration;
nMaxSpeedX = com.disney.gem.games.ocean_cleaning.Config.Ariel.MaximumSpeedX;
nMaxSpeedY = com.disney.gem.games.ocean_cleaning.Config.Ariel.MaximumSpeedY;
} else {
nMaxSpeedX = com.disney.gem.games.ocean_cleaning.Config.Sebastian.MaximumSpeedX;
nMaxSpeedY = com.disney.gem.games.ocean_cleaning.Config.Sebastian.MaximumSpeedY;
nAccelX = com.disney.gem.games.ocean_cleaning.Config.Sebastian.Acceleration;
nAccelY = com.disney.gem.games.ocean_cleaning.Config.Sebastian.Acceleration;
}
}
if (__get__y() <= 260) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.setAmbient(com.disney.gem.games.ocean_cleaning.utility.Sounds.sAMBIENT_SURFACE);
} else {
com.disney.gem.games.ocean_cleaning.utility.Sounds.setAmbient(com.disney.gem.games.ocean_cleaning.utility.Sounds.sAMBIENT_UNDERWATER);
}
setShield();
setHoldingObject();
}
}
function onPause() {
super.onPause();
mcRef.mcState.mcHead.stop();
}
function onUnPause() {
super.onUnPause();
mcRef.mcState.mcHead.play();
}
function setItem(_oItem) {
oItem = _oItem;
}
function dropItem() {
bCanTake = false;
var _local2;
if (mcRef._xscale == -100) {
_local2 = (mcRef._x - mcRef.mcState._x) - mcRef.mcState.mcObject._x;
} else {
_local2 = (mcRef._x + mcRef.mcState._x) + mcRef.mcState.mcObject._x;
}
var _local3 = (mcRef._y + mcRef.mcState._y) + mcRef.mcState.mcObject._y;
oItem.mcRef._x = _local2;
oItem.mcRef._y = _local3;
oItem.startListening();
oItem.took();
setState(sSTATE_HURT, true);
oItem = undefined;
}
function bounceFrom(_oObj, bEnemy) {
if (bEnemy) {
var _local3 = getAngle(__get__x(), __get__y(), _oObj.x, _oObj.y) + 180;
nSpeedX = Math.sin(_local3 * (Math.PI/180)) * com.disney.gem.games.ocean_cleaning.Config.Ariel.Bounce;
nSpeedY = (Math.cos(_local3 * (Math.PI/180)) * com.disney.gem.games.ocean_cleaning.Config.Ariel.Bounce) * -1;
if (nShieldTime > 0) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_ARIEL_BOUNCES, true, true);
if (oItem != undefined) {
setState(sSTATE_BOUNCE_OBJECT, true);
} else {
setState(sSTATE_BOUNCE, true);
}
bShield = false;
nShieldTime = 0;
} else {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_ARIEL_HURT, true, true);
dropItem();
setState(sSTATE_HURT, true);
}
} else if (nShieldTime == 0) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_ARIEL_BOUNCES, true, true);
var _local3 = getAngle(__get__x(), __get__y(), _oObj.x, _oObj.y) + 180;
nSpeedX = Math.sin(_local3 * (Math.PI/180)) * com.disney.gem.games.ocean_cleaning.Config.Ariel.Bounce;
nSpeedY = (Math.cos(_local3 * (Math.PI/180)) * com.disney.gem.games.ocean_cleaning.Config.Ariel.Bounce) * -1;
if (oItem != undefined) {
setState(sSTATE_BOUNCE_OBJECT, true);
} else {
setState(sSTATE_BOUNCE, true);
}
slowMo();
}
}
function slowMo() {
if (bSpeed) {
bSpeed = false;
nMaxSpeedX = com.disney.gem.games.ocean_cleaning.Config.Sebastian.MaximumSpeedX / 2;
nMaxSpeedY = com.disney.gem.games.ocean_cleaning.Config.Sebastian.MaximumSpeedY / 2;
nAccelX = com.disney.gem.games.ocean_cleaning.Config.Sebastian.Acceleration / 2;
nAccelY = com.disney.gem.games.ocean_cleaning.Config.Sebastian.Acceleration / 2;
} else {
nMaxSpeedX = com.disney.gem.games.ocean_cleaning.Config.Ariel.MaximumSpeedX / 2;
nMaxSpeedY = com.disney.gem.games.ocean_cleaning.Config.Ariel.MaximumSpeedY / 2;
nAccelX = com.disney.gem.games.ocean_cleaning.Config.Ariel.Acceleration / 2;
nAccelY = com.disney.gem.games.ocean_cleaning.Config.Ariel.Acceleration / 2;
}
}
function resetSpeed() {
if (nSpeedTime > 0) {
bSpeed = true;
}
nMaxSpeedX = com.disney.gem.games.ocean_cleaning.Config.Ariel.MaximumSpeedX;
nMaxSpeedY = com.disney.gem.games.ocean_cleaning.Config.Ariel.MaximumSpeedY;
nAccelX = com.disney.gem.games.ocean_cleaning.Config.Ariel.Acceleration;
nAccelY = com.disney.gem.games.ocean_cleaning.Config.Ariel.Acceleration;
}
function setHoldingObject() {
mcRef.mcState.mcObject.gotoAndStop(oItem.name);
}
function setShield() {
mcRef.mcState.mcShield._visible = bShield;
}
function setPosition(_sState) {
var _local2;
switch (_sState) {
case sSTATE_IDLE :
_local2 = (bSwitched ? (nPOSITION_RIGHT) : (nPOSITION_LEFT));
break;
case sSTATE_IDLE_DOWN :
_local2 = (bSwitched ? (nPOSITION_DOWN_RIGHT) : (nPOSITION_DOWN_LEFT));
break;
case sSTATE_IDLE_UP :
_local2 = (bSwitched ? (nPOSITION_UP_RIGHT) : (nPOSITION_UP_LEFT));
break;
case sSTATE_DOWN :
_local2 = nPOSITION_DOWN;
break;
case sSTATE_DOWN_IDLE :
_local2 = (bSwitched ? (nPOSITION_DOWN_RIGHT) : (nPOSITION_DOWN_LEFT));
break;
case sSTATE_UP :
_local2 = nPOSITION_UP;
break;
case sSTATE_UP_IDLE :
_local2 = (bSwitched ? (nPOSITION_UP_RIGHT) : (nPOSITION_UP_LEFT));
}
nPosition = _local2;
}
function switchSide() {
if (!bSwitched) {
bSwitched = true;
nPosition = nPOSITION_RIGHT;
mcRef._xscale = -100;
} else {
bSwitched = false;
nPosition = nPOSITION_LEFT;
mcRef._xscale = 100;
}
}
function checkControl() {
if (key(37)) {
if ((nPosition == nPOSITION_UP) && (bSwitched)) {
setState(chooseState(sSTATE_UP_IDLE_OBJECT, sSTATE_UP_IDLE), true);
} else if ((nPosition == nPOSITION_DOWN) && (bSwitched)) {
setState(chooseState(sSTATE_DOWN_IDLE_OBJECT, sSTATE_DOWN_IDLE), true);
} else if (nPosition == nPOSITION_RIGHT) {
bCanMove = false;
setState(chooseState(sSTATE_TURNOVER_OBJECT, sSTATE_TURNOVER), true);
}
} else if (key(39)) {
if ((nPosition == nPOSITION_UP) && (!bSwitched)) {
setState(chooseState(sSTATE_UP_IDLE_OBJECT, sSTATE_UP_IDLE), true);
} else if ((nPosition == nPOSITION_DOWN) && (!bSwitched)) {
setState(chooseState(sSTATE_DOWN_IDLE_OBJECT, sSTATE_DOWN_IDLE), true);
} else if (nPosition == nPOSITION_LEFT) {
bCanMove = false;
setState(chooseState(sSTATE_TURNOVER_OBJECT, sSTATE_TURNOVER), true);
}
} else if ((key(38) && (none(40))) && (nPosition != nPOSITION_UP)) {
setState(chooseState(sSTATE_IDLE_UP_OBJECT, sSTATE_IDLE_UP), true);
setPosition(sSTATE_IDLE_UP);
} else if ((key(40) && (none(38))) && (nPosition != nPOSITION_DOWN)) {
setState(chooseState(sSTATE_IDLE_DOWN_OBJECT, sSTATE_IDLE_DOWN), true);
setPosition(sSTATE_IDLE_DOWN);
} else if (none(40) && (nPosition == nPOSITION_DOWN)) {
setState(chooseState(sSTATE_DOWN_IDLE_OBJECT, sSTATE_DOWN_IDLE), true);
setPosition(sSTATE_DOWN_IDLE);
} else if (none(38) && (nPosition == nPOSITION_UP)) {
setState(chooseState(sSTATE_UP_IDLE_OBJECT, sSTATE_UP_IDLE), true);
setPosition(sSTATE_UP_IDLE);
} else if ((key(38) && (key(40))) && ((nPosition == nPOSITION_DOWN) || (nPosition == nPOSITION_UP))) {
if (nPosition == nPOSITION_DOWN) {
setState(chooseState(sSTATE_DOWN_IDLE_OBJECT, sSTATE_DOWN_IDLE), true);
} else if (nPosition == nPOSITION_UP) {
setState(chooseState(sSTATE_UP_IDLE_OBJECT, sSTATE_UP_IDLE), true);
}
}
}
function chooseState(_sWith, _sWithout) {
var _local2;
if (oItem == undefined) {
_local2 = _sWithout;
} else {
_local2 = _sWith;
}
return(_local2);
}
function checkMovement() {
if (bCanMove) {
if ((key(37) && (!key(39))) && (((sCollideFrom != "right") && (sCollideFrom != "topright")) && (sCollideFrom != "bottomright"))) {
increaseSpeedX(-nAccelX);
if ((getState() == sSTATE_IDLE) || (getState() == sSTATE_IDLE_OBJECT)) {
setState(chooseState(sSTATE_FORWARD_OBJECT, sSTATE_FORWARD), true);
}
} else if ((key(39) && (!key(37))) && (((sCollideFrom != "left") && (sCollideFrom != "topleft")) && (sCollideFrom != "bottomleft"))) {
increaseSpeedX(nAccelX);
if ((getState() == sSTATE_IDLE) || (getState() == sSTATE_IDLE_OBJECT)) {
setState(chooseState(sSTATE_FORWARD_OBJECT, sSTATE_FORWARD), true);
}
} else {
decreaseSpeedX(nDecelX);
if ((getState() == sSTATE_FORWARD) || (getState() == sSTATE_FORWARD_OBJECT)) {
setState(chooseState(sSTATE_IDLE_OBJECT, sSTATE_IDLE), true);
}
}
if ((key(38) && (!key(40))) && (((sCollideFrom != "bottom") && (sCollideFrom != "bottomleft")) && (sCollideFrom != "bottomright"))) {
increaseSpeedY(-nAccelY);
} else if ((key(40) && (!key(38))) && (((sCollideFrom != "top") && (sCollideFrom != "topright")) && (sCollideFrom != "topleft"))) {
increaseSpeedY(nAccelY);
} else {
decreaseSpeedY(nDecelY);
}
}
}
function increaseSpeedX(_nAccel) {
if (_nAccel > 0) {
nSpeedX = nSpeedX + _nAccel;
if (nSpeedX >= nMaxSpeedX) {
nSpeedX = nMaxSpeedX;
}
} else if (_nAccel < 0) {
nSpeedX = nSpeedX + _nAccel;
if (nSpeedX <= (-nMaxSpeedX)) {
nSpeedX = -nMaxSpeedX;
}
}
}
function increaseSpeedY(_nAccel) {
if (_nAccel > 0) {
nSpeedY = nSpeedY + _nAccel;
if (nSpeedY >= nMaxSpeedY) {
nSpeedY = nMaxSpeedY;
}
} else if (_nAccel < 0) {
nSpeedY = nSpeedY + _nAccel;
if (nSpeedY <= (-nMaxSpeedY)) {
nSpeedY = -nMaxSpeedY;
}
}
}
function decreaseSpeedX(_nDecel) {
if (nSpeedX > nMinSpeedX) {
nSpeedX = nSpeedX - _nDecel;
if (nSpeedX <= nMinSpeedX) {
nSpeedX = nMinSpeedX;
}
} else if (nSpeedX < nMinSpeedX) {
nSpeedX = nSpeedX + _nDecel;
if (nSpeedX >= nMinSpeedX) {
nSpeedX = nMinSpeedX;
}
}
}
function decreaseSpeedY(_nDecel) {
if (nSpeedY > nMinSpeedY) {
nSpeedY = nSpeedY - _nDecel;
if (nSpeedY <= nMinSpeedY) {
nSpeedY = nMinSpeedY;
}
} else if (nSpeedY < nMinSpeedY) {
nSpeedY = nSpeedY + _nDecel;
if (nSpeedY >= nMinSpeedY) {
nSpeedY = nMinSpeedY;
}
}
}
function move() {
mcRef._x = mcRef._x + nSpeedX;
mcRef._y = mcRef._y + nSpeedY;
}
function only(_nKey) {
var _local3 = Key.isDown(_nKey);
if (_local3) {
var _local2 = 0;
while (_local2 < aControl.length) {
if ((aControl[_local2] != _nKey) && (Key.isDown(aControl[_local2]))) {
_local3 = false;
break;
}
_local2++;
}
}
return(_local3);
}
function none() {
var _local4 = true;
if (arguments.length > 0) {
var _local3 = 0;
while (_local3 < arguments.length) {
if (Key.isDown(arguments[_local3])) {
_local4 = false;
break;
}
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < aControl.length) {
if (Key.isDown(aControl[_local3])) {
_local4 = false;
break;
}
_local3++;
}
}
return(_local4);
}
function key(_nKey) {
var _local1 = Key.isDown(_nKey);
return(_local1);
}
function state_idle() {
checkControl();
bCanSwitch = true;
}
function state_forward() {
checkControl();
bCanSwitch = true;
}
function state_turnover() {
if (stateFinished()) {
switchSide();
setState(sSTATE_IDLE, true);
bCanMove = true;
}
}
function state_highfive() {
nSpeedX = 0;
nSpeedY = 0;
if (stateCurrentFrame() == 11) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_ARIEL_HIGHFIVE, true, false);
}
if (stateFinished()) {
bOccupied = false;
setState(sSTATE_IDLE, true);
setPosition(sSTATE_IDLE);
}
}
function state_idle_up() {
if (stateFinished()) {
setState(sSTATE_UP, true);
setPosition(sSTATE_UP);
}
}
function state_up() {
checkControl();
bCanSwitch = true;
}
function state_up_idle() {
if (stateFinished()) {
setState(sSTATE_IDLE, true);
setPosition(sSTATE_IDLE);
}
}
function state_idle_down() {
if (stateFinished()) {
setState(sSTATE_DOWN, true);
setPosition(sSTATE_DOWN);
}
}
function state_down() {
checkControl();
bCanSwitch = true;
}
function state_down_idle() {
if (stateFinished()) {
setState(sSTATE_IDLE, true);
setPosition(sSTATE_IDLE);
}
}
function state_bounce() {
if (stateFinished()) {
bCanMove = true;
setState(sSTATE_IDLE, true);
setPosition(sSTATE_IDLE);
}
}
function state_hurt() {
if (stateFinished()) {
bCanMove = true;
setState(sSTATE_IDLE, true);
setPosition(sSTATE_IDLE);
bCanTake = true;
}
}
function state_grabs_object() {
nSpeedX = 0;
nSpeedY = 0;
if (stateCurrentFrame() == 12) {
oItem.hide();
oItem.stopListening();
}
if (stateFinished()) {
bCanMove = true;
bCanSwitch = true;
bOccupied = false;
setState(sSTATE_IDLE_OBJECT, true);
setPosition(sSTATE_IDLE);
}
}
function state_highfive_object() {
nSpeedX = 0;
nSpeedY = 0;
if (stateCurrentFrame() == 11) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_ARIEL_HIGHFIVE, true, false);
}
if (stateFinished()) {
bOccupied = false;
setState(sSTATE_IDLE_OBJECT, true);
setPosition(sSTATE_IDLE);
}
}
function state_turnover_object() {
if (stateFinished()) {
switchSide();
setState(sSTATE_IDLE_OBJECT, true);
bCanMove = true;
}
}
function state_idle_object() {
checkControl();
bCanSwitch = true;
}
function state_forward_object() {
checkControl();
bCanSwitch = true;
}
function state_idle_up_object() {
if (stateFinished()) {
setState(sSTATE_UP_OBJECT, true);
setPosition(sSTATE_UP);
}
}
function state_up_object() {
checkControl();
bCanSwitch = true;
}
function state_up_idle_object() {
if (stateFinished()) {
setState(sSTATE_IDLE_OBJECT, true);
setPosition(sSTATE_IDLE);
}
}
function state_idle_down_object() {
if (stateFinished()) {
setState(sSTATE_DOWN_OBJECT, true);
setPosition(sSTATE_DOWN);
}
}
function state_down_object() {
checkControl();
bCanSwitch = true;
}
function state_down_idle_object() {
if (stateFinished()) {
setState(sSTATE_IDLE_OBJECT, true);
setPosition(sSTATE_IDLE);
}
}
function state_bounce_object() {
if (stateFinished()) {
bCanMove = true;
setState(sSTATE_IDLE_OBJECT, true);
setPosition(sSTATE_IDLE);
}
}
function state_gives() {
nSpeedX = 0;
nSpeedY = 0;
if (stateFinished()) {
oItem = undefined;
setState(sSTATE_IDLE, true);
bCanMove = true;
setPosition(sSTATE_IDLE);
}
}
function getAngle(_nX1, _nY1, _nX2, _nY2) {
var _local1 = ((Math.atan2(_nY2 - _nY1, _nX2 - _nX1) * 180) / Math.PI) + 90;
if (_local1 > 180) {
_local1 = -360 + _local1;
}
return(_local1);
}
static var sSTATE_IDLE = "idle";
static var sSTATE_FORWARD = "forward";
static var sSTATE_IDLE_OBJECT = "idle_object";
static var sSTATE_FORWARD_OBJECT = "forward_object";
static var sSTATE_IDLE_UP = "idle_up";
static var sSTATE_IDLE_UP_OBJECT = "idle_up_object";
static var sSTATE_UP = "up";
static var sSTATE_UP_OBJECT = "up_object";
static var sSTATE_UP_IDLE = "up_idle";
static var sSTATE_UP_IDLE_OBJECT = "up_idle_object";
static var sSTATE_IDLE_DOWN = "idle_down";
static var sSTATE_IDLE_DOWN_OBJECT = "idle_down_object";
static var sSTATE_DOWN = "down";
static var sSTATE_DOWN_OBJECT = "down_object";
static var sSTATE_DOWN_IDLE = "down_idle";
static var sSTATE_DOWN_IDLE_OBJECT = "down_idle_object";
static var sSTATE_GRABS_OBJECT = "grabs_object";
static var sSTATE_TURNOVER = "turnover";
static var sSTATE_TURNOVER_OBJECT = "turnover_object";
static var sSTATE_BOUNCE = "bounce";
static var sSTATE_BOUNCE_OBJECT = "bounce_object";
static var sSTATE_HURT = "hurt";
static var sSTATE_GIVES = "gives";
static var sSTATE_HIGHFIVE = "highfive";
static var sSTATE_HIGHFIVE_OBJECT = "highfive_object";
static var nPOSITION_IDLE = 0;
static var nPOSITION_LEFT = 1;
static var nPOSITION_RIGHT = 2;
static var nPOSITION_UP = 3;
static var nPOSITION_DOWN = 4;
static var nPOSITION_UP_LEFT = 5;
static var nPOSITION_UP_RIGHT = 6;
static var nPOSITION_DOWN_LEFT = 7;
static var nPOSITION_DOWN_RIGHT = 8;
}
Symbol 1029 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.utility.Sounds] Frame 0
class com.disney.gem.games.ocean_cleaning.utility.Sounds
{
static var sCurrentMusic, sCurrentAmbient;
function Sounds () {
}
static function Play(_sSound, _bUnique, _bOverride) {
var _local1 = true;
if (_bUnique) {
if (com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(_sSound).bPlaying) {
_local1 = false;
}
}
if (_bOverride && (!_local1)) {
Stop(_sSound);
_local1 = true;
}
if (_local1) {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doPlaySoundInCat(sSOUND_CAT_NAME, _sSound, 100, 1);
}
}
static function Stop(_sSound) {
if (com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(_sSound).bPlaying) {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(_sSound).oSound.doStop();
}
}
static function Pause(_sCategory) {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doPauseCategory(_sCategory);
}
static function Unpause(_sCategory) {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doUnPauseCategory(_sCategory);
}
static function StopAll(_sCategory) {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doStopCategory(_sCategory);
}
static function setMusic(_sSound) {
if ((sCurrentMusic != undefined) && (sCurrentMusic != _sSound)) {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(sCurrentMusic).oSound.doFadeTo(0);
}
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doPlaySoundInCat(sMUSIC_CAT_NAME, _sSound, 0, 655336, true);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(_sSound).oSound.doFadeTo(100, false);
sCurrentMusic = _sSound;
}
static function setAmbient(_sSound) {
if (com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGamePhase() == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
if ((sCurrentAmbient != undefined) && (sCurrentAmbient != _sSound)) {
com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(sCurrentAmbient).oSound.doFadeTo(0);
}
com.disney.gem.games.ocean_cleaning.utility.sndEngine.doPlaySoundInCat(sAMBIENT_CAT_NAME, _sSound, 0, 655336, true);
com.disney.gem.games.ocean_cleaning.utility.sndEngine.isSoundPlaying(_sSound).oSound.doFadeTo(100, false);
sCurrentAmbient = _sSound;
} else {
StopAll(sAMBIENT_CAT_NAME);
}
}
static var sSOUND_CAT_NAME = "SFX";
static var sAMBIENT_CAT_NAME = "Ambient";
static var sMUSIC_CAT_NAME = "Music";
static var nSOUND_CAT_VOLUME = 80;
static var nAMBIENT_CAT_VOLUME = 50;
static var nMUSIC_CAT_VOLUME = 25;
static var sMUSIC_PACKAGING = "sMu_pack";
static var sMUSIC_INGAME = "sMu_game";
static var sAMBIENT_SURFACE = "sAm_surface";
static var sAMBIENT_UNDERWATER = "sAm_underwater1,sAm_underwater2";
static var sSFX_ARIEL_BOUNCES = "sSfx_ariel_bounce1,sSfx_ariel_bounce2,sSfx_ariel_bounce3";
static var sSFX_ARIEL_GIVES = "sSfx_ariel_gives1,sSfx_ariel_gives2,sSfx_ariel_gives3,sSfx_ariel_gives4,sSfx_ariel_gives5,sSfx_ariel_gives6,sSfx_ariel_gives7";
static var sSFX_ARIEL_GRABS = "sSfx_ariel_grabs1,sSfx_ariel_grabs2,sSfx_ariel_grabs3";
static var sSFX_ARIEL_HIGHFIVE = "sSfx_ariel_highfive";
static var sSFX_ARIEL_HURT = "sSfx_ariel_hurt";
static var sSFX_BOOT_GROUND = "sSfx_boot_ground1,sSfx_boot_ground2";
static var sSFX_BUBBLE = "sSfx_bubble";
static var sSFX_CANDELABRA_GROUND = "sSfx_candelabra_ground";
static var sSFX_FLOUNDER_BUBBLE = "sSfx_flounder_bubble";
static var sSFX_FORK_GROUND = "sSfx_fork_ground";
static var sSFX_GOBLET_GROUND = "sSfx_goblet_ground";
static var sSFX_LAMP_GROUND = "sSfx_lamp_ground";
static var sSFX_MIRROR_GROUND = "sSfx_mirror_ground";
static var sSFX_OBJECT_BAGS = "sSfx_object_bags1,sSfx_object_bags2";
static var sSFX_PIPE_GROUND = "sSfx_pipe_ground";
static var sSFX_POPUP = "sSfx_popup";
static var sSFX_SCUTTLE_BAGS = "sSfx_scuttle_bags1,sSfx_scuttle_bags2,sSfx_scuttle_bags3";
static var sSFX_SCUTTLE_GRABS = "sSfx_scuttle_grabs1,sSfx_scuttle_grabs2";
static var sSFX_SEBASTIAN_HIGHFIVE = "sSfx_sebastian_highfive";
static var sSFX_SPYGLASS_GROUND = "sSfx_spyglass_ground";
static var sSFX_STARFISH = "sSfx_starfish";
static var sSFX_STOPWATCH = "sSfx_stopwatch";
static var sSFX_WHEEL_GROUND = "sSfx_wheel_ground";
static var sSFX_BUTTON_CLICK = "sSfx_button_click";
static var sSFX_BUTTON_ROLLOVER = "sSfx_button_rollover";
static var sSFX_TRANSITION_IN = "sSfx_transition_in";
static var sSFX_TRANSITION_OUT = "sSfx_transition_out";
static var sSFX_LOSE = "sSfx_lose";
static var sSFX_WIN = "sSfx_win";
}
Symbol 1030 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.utility.sndEngine] Frame 0
class com.disney.gem.games.ocean_cleaning.utility.sndEngine
{
static var aSounds, mcAttach, nSoundNum, aSoundCategories, nMasterVolume;
function sndEngine () {
}
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;
var _local4 = new Array();
if (__nVolume == undefined) {
__nVolume = 100;
}
if (__nLoop == undefined) {
__nLoop = 1;
}
if (__bUnique == undefined) {
__bUnique = false;
}
var _local3;
if (__sLinkage.indexOf(",") > 0) {
_local4 = __sLinkage.split(",");
_local3 = _local4[Math.floor(Math.random() * (_local4.length - 1))];
} else {
_local3 = __sLinkage;
}
var _local2;
if (__bUnique) {
var _local7 = isSoundPlaying(__sLinkage);
if (_local7.bPlaying) {
_local2 = false;
_local1 = _local7.oSound;
} else {
_local2 = true;
}
} else {
_local2 = true;
}
if (_local2) {
doManageCategory(__sCategoryName);
var _local8 = getMCForSound();
var _local6 = new Sound(_local8);
_local6.attachSound(_local3);
if (_local6.duration != undefined) {
_local1 = new com.disney.gem.games.ocean_cleaning.utility.sndItem(_local6, _local3, __nVolume, __nLoop, __sCategoryName, _local8);
} else {
trace("***** BAD SOUND LINKAGE : " + __sLinkage);
}
_local1.doAddListener(com.disney.gem.games.ocean_cleaning.utility.sndEngine);
aSounds.push(_local1);
}
return(_local1);
}
static function isSoundPlaying(__sLinkageName) {
var _local2 = new Object();
var _local4 = new Array();
_local2.bPlaying = false;
_local2.oSound = undefined;
if (__sLinkageName.indexOf(",") > 0) {
_local4 = __sLinkageName.split(",");
}
if (_local4.length > 0) {
var _local3 = 0;
while (_local3 < aSounds.length) {
var _local1 = 0;
while (_local1 < _local4.length) {
if (aSounds[_local3].LinkageName == _local4[_local1]) {
_local2.oSound = aSounds[_local3];
_local2.bPlaying = true;
break;
}
_local1++;
}
if (_local2.bPlaying) {
break;
}
_local3++;
}
} else {
var _local3 = 0;
while (_local3 < aSounds.length) {
if (aSounds[_local3].LinkageName == __sLinkageName) {
_local2.oSound = aSounds[_local3];
_local2.bPlaying = true;
break;
}
_local3++;
}
}
return(_local2);
}
static function doManageExternalSound(__oSound) {
doCheckInit();
doManageCategory(__oSound.__get__Category());
__oSound.doAddListener(com.disney.gem.games.ocean_cleaning.utility.sndEngine);
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;
mcAttach.onEnterFrame = com.sarbakan.utils.Delegate.create(com.disney.gem.games.ocean_cleaning.utility.sndEngine, doEnterFrame);
}
}
static function doEnterFrame() {
var _local1 = 0;
while (_local1 < aSounds.length) {
aSounds[_local1].doEnterFrame();
_local1++;
}
}
static function setCategoryVolume(__sCategoryName, __nVol) {
doManageCategory(__sCategoryName);
var _local1 = 0;
while (_local1 < aSoundCategories.length) {
if (aSoundCategories[_local1].sName == __sCategoryName) {
aSoundCategories[_local1].nVolume = __nVol;
}
_local1++;
}
doUpdateAllSoundsVolume();
}
static function getCategoryVolume(__sCategoryName) {
doManageCategory(__sCategoryName);
var _local2;
var _local1 = 0;
while (_local1 < aSoundCategories.length) {
if (aSoundCategories[_local1].sName == __sCategoryName) {
_local2 = aSoundCategories[_local1].nVolume;
}
_local1++;
}
return(_local2);
}
static function isCategoryMuted(__sCategoryName) {
doManageCategory(__sCategoryName);
var _local2;
var _local1 = 0;
while (_local1 < aSoundCategories.length) {
if (aSoundCategories[_local1].sName == __sCategoryName) {
_local2 = aSoundCategories[_local1].bMuted;
}
_local1++;
}
return(_local2);
}
static function doSoundEvent(__nEvent, __oSound) {
if (!(__nEvent === EVENT_SOUND_COMPLETE)) {
} else {
var _local2 = false;
var _local1 = 0;
while (_local1 < aSounds.length) {
if (!_local2) {
if (aSounds[_local1] == __oSound) {
_local2 = true;
delete aSounds[_local1];
aSounds.splice(_local1, 1);
}
}
_local1++;
}
}
}
static function doMuteCategory(__sCategoryName) {
var _local1 = 0;
while (_local1 < aSoundCategories.length) {
if (aSoundCategories[_local1].sName == __sCategoryName) {
aSoundCategories[_local1].bMuted = true;
}
_local1++;
}
doUpdateAllSoundsVolume();
}
static function doUnMuteCategory(__sCategoryName) {
var _local1 = 0;
while (_local1 < aSoundCategories.length) {
if (aSoundCategories[_local1].sName == __sCategoryName) {
aSoundCategories[_local1].bMuted = false;
}
_local1++;
}
doUpdateAllSoundsVolume();
}
static function doPauseCategory(__sCategoryName) {
var _local1 = 0;
while (_local1 < aSounds.length) {
if (aSounds[_local1].Category == __sCategoryName) {
aSounds[_local1].doPause();
}
_local1++;
}
}
static function doUnPauseCategory(__sCategoryName) {
var _local1 = 0;
while (_local1 < aSounds.length) {
if (aSounds[_local1].Category == __sCategoryName) {
aSounds[_local1].doResume();
}
_local1++;
}
}
static function doStopCategory(__sCategoryName) {
var _local1 = 0;
while (_local1 < aSounds.length) {
if (aSounds[_local1].Category == __sCategoryName) {
aSounds[_local1].doStop();
}
_local1++;
}
}
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) {
var _local1 = 0;
while (_local1 < aSounds.length) {
aSounds[_local1].doRemoveListener(__oListener);
_local1++;
}
}
static function clearData() {
doRemoveListenerFromAllSounds();
var _local1 = 0;
while (_local1 < aSounds.length) {
aSounds[_local1].clearData();
_local1++;
}
}
static function doUpdateAllSoundsVolume() {
var _local1 = 0;
while (_local1 < aSounds.length) {
aSounds[_local1].doUpdateSound();
_local1++;
}
}
static function doCheckInit() {
if (!bInited) {
trace("***** ERROR, NEED TO INIT SOUND MANAGER FIRST *****");
}
}
static function doManageCategory(__sCategoryName) {
doCheckInit();
var _local2 = false;
var _local1 = 0;
while (_local1 < aSoundCategories.length) {
if (aSoundCategories[_local1].sName == __sCategoryName) {
_local2 = true;
}
_local1++;
}
if (!_local2) {
var _local4 = new Object();
_local4.sName = __sCategoryName;
_local4.nVolume = 100;
_local4.bMuted = false;
aSoundCategories.push(_local4);
}
}
static var EVENT_SOUND_COMPLETE = 1;
static var DEFAULT_CATEGORY = "SFX";
static var MAX_SOUNDS_PLAYING = 128;
static var bInited = false;
}
Symbol 1031 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.utility.sndItem] Frame 0
class com.disney.gem.games.ocean_cleaning.utility.sndItem
{
var sndObj, sLinkage, mcRef, nRemainingLoop, nCurrentVolume, nTargetVolume, nFadeRate, sCategory, bFadeAtEnd, bMuted, bPaused, bNeedFreshStart, nCurrentTime, aEventListeners, onComplete, bStopAfterFade;
function sndItem (__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 = com.sarbakan.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 {
if (onComplete != undefined) {
onComplete();
}
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 = __bFadeAtEnd;
}
function setPan(__nPan) {
sndObj.setPan(__nPan);
}
function get Category() {
return(sCategory);
}
function get LinkageName() {
return(sLinkage);
}
function get Volume() {
return(sndObj.getVolume());
}
function get Position() {
return(sndObj.position);
}
function get SoundObject() {
return(sndObj);
}
function clearData() {
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(com.disney.gem.games.ocean_cleaning.utility.sndEngine.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 = com.sarbakan.utils.MoreMath.getReachNum(nCurrentVolume, nTargetVolume, nFadeRate);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
if ((nCurrentVolume <= 0) && (bStopAfterFade)) {
sndObj.stop();
doManageEndEvent();
}
}
function returnComputedVolume(__nVolume) {
var _local2;
if ((!bMuted) && (!com.disney.gem.games.ocean_cleaning.utility.sndEngine.isCategoryMuted(sCategory))) {
var _local3 = com.disney.gem.games.ocean_cleaning.utility.sndEngine.__get__MasterVolume() / 100;
var _local4 = com.disney.gem.games.ocean_cleaning.utility.sndEngine.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 1032 MovieClip [__Packages.com.sarbakan.utils.MoreMath] Frame 0
class com.sarbakan.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 getManhattanDistance(_x1, _y1, _x2, _y2) {
return(Math.abs(_x1 - _x2) + Math.abs(_y1 - _y2));
}
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 getCleanedAngle(_nAngle) {
while (_nAngle < 360) {
_nAngle = _nAngle + 360;
}
_nAngle = _nAngle % 360;
return(_nAngle);
}
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});
}
static var MATH_PI = Math.PI;
}
Symbol 1033 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.Config] Frame 0
class com.disney.gem.games.ocean_cleaning.Config
{
function Config () {
}
static var nGRAVITY = 0.8;
static var nFRICTION = 0.95;
static var CLD_SOLID = "Solid";
static var CLD_FORCE = "Force";
static var CLD_LINE = "Line";
static var CLD_SKIP = 0;
static var nGAME_TIME = 120;
static var nDEFAULT_TRIES = 1;
static var PopUp = {Objects:{Time:30}};
static var Ariel = {Acceleration:1, Deceleration:0.5, MinimumSpeedY:0.15, MaximumSpeedY:8, MaximumSpeedX:8, Bounce:10};
static var Scuttle = {Acceleration:0, Deceleration:0, MinimumSpeedY:0, MaximumSpeedY:0, MaximumSpeedX:0};
static var Fish1 = {Acceleration:1, Deceleration:0.5, MinimumSpeedY:0.15, MaximumSpeedY:8, MaximumSpeedX:8};
static var Fish2 = {Acceleration:1, Deceleration:0.5, MinimumSpeedY:0.15, MaximumSpeedY:8, MaximumSpeedX:8};
static var Fish3 = {Acceleration:1, Deceleration:0.5, MinimumSpeedY:0.15, MaximumSpeedY:8, MaximumSpeedX:8};
static var Turtle = {Acceleration:1, Deceleration:0.5, MinimumSpeedY:0.15, MaximumSpeedY:8, MaximumSpeedX:8};
static var Shark = {Acceleration:1, Deceleration:0.5, MinimumSpeedY:0.15, MaximumSpeedY:8, MaximumSpeedX:8};
static var Jetsam = {Acceleration:1, Deceleration:0.5, MinimumSpeedY:0.15, MaximumSpeedY:8, MaximumSpeedX:8};
static var Flotsam = {Acceleration:1, Deceleration:0.5, MinimumSpeedY:0.15, MaximumSpeedY:8, MaximumSpeedX:8};
static var Sebastian = {MaximumSpeedY:12, MaximumSpeedX:12, Acceleration:1.5, Time:175};
static var Starfish = {Try:1};
static var Stopwatch = {Time:350};
static var Bubble = {Distance:150, FadeRate:10, SpeedX:0.1, SpeedXMax:2, SpeedY:0.8, Shield:true, Time:175};
static var Boot = {Name:"Boot", Score:500, Mass:200};
static var Candelabra = {Name:"Candelabra", Score:350, Mass:125};
static var Fork = {Name:"Fork", Score:250, Mass:50};
static var Goblet = {Name:"Goblet", Score:350, Mass:100};
static var Lamp = {Name:"Lamp", Score:350, Mass:150};
static var Mirror = {Name:"Mirror", Score:250, Mass:75};
static var Pipe = {Name:"Pipe", Score:250, Mass:50};
static var Spyglass = {Name:"Spyglass", Score:350, Mass:150};
static var Wheel = {Name:"Wheel", Score:500, Mass:250};
}
Symbol 1034 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.Stats] Frame 0
class com.disney.gem.games.ocean_cleaning.Stats
{
function Stats () {
}
static function reset() {
nTries = nTRIES_DEFAULT;
oStar = {level1:false, level2:false, level3:false};
}
static function get tries() {
return(nTries);
}
static function set tries(_nTries) {
nTries = _nTries;
//return(tries);
}
static function get stars() {
return(oStar);
}
static function set stars(_oStar) {
oStar = _oStar;
//return(stars);
}
static var nTRIES_DEFAULT = com.disney.gem.games.ocean_cleaning.Config.nDEFAULT_TRIES;
static var nTries = com.disney.gem.games.ocean_cleaning.Config.nDEFAULT_TRIES;
static var oStar = {level1:false, level2:false, level3:false};
}
Symbol 1035 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.characters.Scuttle] Frame 0
class com.disney.gem.games.ocean_cleaning.characters.Scuttle extends com.disney.gem.games.ocean_cleaning.characters.BaseChar
{
static var oInstance;
var setMC, setProperties, mcRef, sName, bCanReceive, topLeft, bottomRight, setTarget, mcScuttle, sItem, oObjectPopup, sNextScuttleState, sNextBagState, mcBag, sScuttleState, sBagState, bPausable, __get__item;
function Scuttle (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcChar");
_mcGame.attachMovie("mcScuttle", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setMCScuttle(mcRef.mcScuttle);
setMCBag(mcRef.mcBag);
sName = "Scuttle";
bCanReceive = true;
setScuttleState(sSTATE_SCUTTLE_IDLE, true);
setBagState(sSTATE_BAG_IDLE, true);
mcRef.mcScuttle.mcBoxTopLeft._visible = false;
mcRef.mcScuttle.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcScuttle.mcBoxTopLeft);
bottomRight(mcRef.mcScuttle.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
oInstance = this;
}
function state_bag_bump() {
if (stateBagFinished()) {
setBagState(sSTATE_BAG_IDLE, true);
}
}
function state_scuttle_grabs() {
bCanReceive = false;
mcScuttle.mcState.mcObject.gotoAndStop(sItem);
if (stateScuttleFinished()) {
setScuttleState(sSTATE_SCUTTLE_EXAMINE, true);
mcScuttle.mcState.mcObject.gotoAndStop(sItem);
oObjectPopup = new com.disney.gem.games.ocean_cleaning.popups.ObjectPopup(com.disney.gem.games.ocean_cleaning.Controller.getInstance().mcTimeline.mcPopups.mcObject, sItem);
com.disney.gem.games.ocean_cleaning.Controller.getInstance().showPopup(oObjectPopup, true);
}
}
function state_scuttle_examine() {
mcScuttle.mcState.mcObject.gotoAndStop(sItem);
if (stateScuttleFinished()) {
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.__set__items((com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.__get__items()+1));
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.__set__maxItems((com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.__get__maxItems()-1));
com.disney.gem.games.ocean_cleaning.Controller.getInstance().increaseScore(com.disney.gem.games.ocean_cleaning.Config[sItem].Score);
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_SCUTTLE_BAGS, true, false);
setScuttleState(sSTATE_SCUTTLE_BAGS, true);
oObjectPopup.hide(null, true);
mcScuttle.mcState.mcObject.gotoAndStop(sItem);
}
}
function state_scuttle_bags() {
mcScuttle.mcState.mcObject.gotoAndStop(sItem);
if (stateScuttleFinished()) {
bCanReceive = true;
setScuttleState(sSTATE_SCUTTLE_IDLE, true);
}
if (stateScuttleCurrentFrame() == 27) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_OBJECT_BAGS, true, false);
setBagState(sSTATE_BAG_BUMP, true);
}
}
function sendToBag() {
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.__set__items((com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.__get__items()+1));
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.__set__maxItems((com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.__get__maxItems()-1));
com.disney.gem.games.ocean_cleaning.Controller.getInstance().increaseScore(com.disney.gem.games.ocean_cleaning.Config[sItem].Score);
setScuttleState(sSTATE_SCUTTLE_BAGS, true);
mcScuttle.mcState.mcObject.gotoAndStop(sItem);
}
function setScuttleState(_sState, _bInstant, _bForce) {
sNextScuttleState = _sState;
if (_bInstant) {
checkScuttleStateChange();
}
if (_bForce) {
mcScuttle.mcState.gotoAndPlay(1);
}
}
function setBagState(_sState, _bInstant, _bForce) {
sNextBagState = _sState;
if (_bInstant) {
checkBagStateChange();
}
if (_bForce) {
mcBag.mcState.gotoAndPlay(1);
}
}
function getScuttleState() {
return(sScuttleState);
}
function getBagState() {
return(sBagState);
}
function stateScuttleStarting() {
return(mcScuttle.mcState._currentframe == 1);
}
function stateBagStarting() {
return(mcScuttle.mcState._currentframe == 1);
}
function stateScuttleFinished() {
return(mcScuttle.mcState._currentframe == mcScuttle.mcState._totalframes);
}
function stateBagFinished() {
return(mcBag.mcState._currentframe == mcBag.mcState._totalframes);
}
function stateScuttleCurrentFrame() {
return(mcScuttle.mcState._currentframe);
}
function stateBagCurrentFrame() {
return(mcBag.mcState._currentframe);
}
function onUpdate() {
checkScuttleStateChange();
checkBagStateChange();
this["state_scuttle_" + sScuttleState]();
this["state_bag_" + sBagState]();
}
function checkScuttleStateChange() {
if ((sNextScuttleState != undefined) && (sNextScuttleState != sScuttleState)) {
this[("state_scuttle_" + sScuttleState) + "_end"]();
sScuttleState = sNextScuttleState;
sNextScuttleState = undefined;
mcScuttle.gotoAndStop(sScuttleState);
this[("state_scuttle_" + sScuttleState) + "_init"]();
}
}
function checkBagStateChange() {
if ((sNextBagState != undefined) && (sNextBagState != sBagState)) {
this[("state_bag_" + sBagState) + "_end"]();
sBagState = sNextBagState;
sNextBagState = undefined;
mcBag.gotoAndStop(sBagState);
this[("state_bag_" + sBagState) + "_init"]();
}
}
function onPause() {
if (bPausable) {
mcScuttle.mcState.stop();
mcScuttle.mcState.mcHead.stop();
mcBag.mcState.stop();
mcRef.stop();
}
}
function onUnPause() {
if (bPausable) {
mcScuttle.mcState.play();
mcScuttle.mcState.mcHead.stop();
mcBag.mcState.play();
mcRef.play();
}
}
function setMCScuttle(_mcRef) {
mcScuttle = _mcRef;
}
function setMCBag(_mcRef) {
mcBag = _mcRef;
}
function get name() {
return(sName);
}
function set item(_sItem) {
sItem = _sItem;
//return(__get__item());
}
static function get Instance() {
return(oInstance);
}
static var sSTATE_BAG_IDLE = "idle";
static var sSTATE_BAG_BUMP = "bump";
static var sSTATE_SCUTTLE_IDLE = "idle";
static var sSTATE_SCUTTLE_GRABS = "grabs";
static var sSTATE_SCUTTLE_EXAMINE = "examine";
static var sSTATE_SCUTTLE_BAGS = "bags";
}
Symbol 1036 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.popups.ObjectPopup] Frame 0
class com.disney.gem.games.ocean_cleaning.popups.ObjectPopup extends com.sarbakan.utils.ScreenController
{
var sItem, stateFinished, setState, nFrame, mcRef;
function ObjectPopup (_mcRef, _sItem) {
super(_mcRef);
sItem = _sItem;
}
function state_in_init() {
super.state_in_init();
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_POPUP, true, false);
}
function state_in() {
setObject();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_IDLE, true);
setObject();
}
}
function state_idle_init() {
super.state_idle_init();
nFrame = 0;
}
function state_idle() {
nFrame++;
if (nFrame >= com.disney.gem.games.ocean_cleaning.Config.PopUp.Objects.Time) {
setState(com.sarbakan.utils.ScreenController.sSTATE_OUT, true);
setObject();
com.disney.gem.games.ocean_cleaning.characters.Scuttle.__get__Instance().sendToBag();
}
}
function state_out() {
setObject();
if (stateFinished()) {
setState(com.sarbakan.utils.ScreenController.sSTATE_HIDDEN, true);
}
}
function setObject() {
mcRef.mcState.mcObject.gotoAndStop(sItem);
}
}
Symbol 1037 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.bonus.BaseBonus] Frame 0
class com.disney.gem.games.ocean_cleaning.bonus.BaseBonus extends com.disney.gem.games.ocean_cleaning.collision.CollideItem
{
var sType, mcRef, nDelay;
function BaseBonus (_mcRef, _aCollidersGroup) {
super(undefined, undefined, undefined);
sType = "bonus";
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.addListener(this);
}
function setProperties(_aProperties) {
var _local2 = 0;
while (_local2 < _aProperties.length) {
mcRef["_" + _aProperties[_local2][0]] = _aProperties[_local2][1];
_local2++;
}
}
function setDelay(_nDelay) {
nDelay = _nDelay;
}
function get type() {
return(sType);
}
function destroy() {
mcRef.removeMovieClip();
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.removeListener(this);
super.destroy();
}
}
Symbol 1038 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.bonus.Flounder] Frame 0
class com.disney.gem.games.ocean_cleaning.bonus.Flounder extends com.disney.gem.games.ocean_cleaning.bonus.BaseBonus
{
var setMC, setProperties, setDelay, setState, nFrame, nDelay, mcRef, stateFinished;
function Flounder (_mcGame, _aCollidersGroup, _aProperties, _nDelay, _nDepth) {
super(undefined, _aCollidersGroup);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcBonus");
_mcGame.attachMovie("mcFlounder", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setDelay(_nDelay);
setState("idle", true);
}
function state_idle_init() {
nFrame = 0;
}
function state_idle() {
nFrame++;
if (nFrame >= nDelay) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_FLOUNDER_BUBBLE, true, false);
setState("bubble");
}
}
function onPause() {
super.onPause();
mcRef.mcState.mcEyeRight.stop();
mcRef.mcState.mcEyeLeft.stop();
}
function onUnPause() {
super.onUnPause();
mcRef.mcState.mcEyeRight.play();
mcRef.mcState.mcEyeLeft.play();
}
function state_bubble() {
if (stateFinished()) {
var _local3;
var _local2;
if (mcRef._xscale < 0) {
_local3 = (mcRef._x - mcRef.mcState._x) - mcRef.mcState.mcBubble._x;
_local2 = (mcRef.mcState.mcBubble._y + mcRef._y) + mcRef.mcState._y;
} else {
_local3 = (mcRef.mcState.mcBubble._x + mcRef._x) + mcRef.mcState._x;
_local2 = (mcRef.mcState.mcBubble._y + mcRef._y) + mcRef.mcState._y;
}
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.createBubble(_local3, _local2, mcRef.mcState.mcBubble._width, mcRef.mcState.mcBubble._height, mcRef._xscale);
setState("idle");
}
}
}
Symbol 1039 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.bonus.Sebastian] Frame 0
class com.disney.gem.games.ocean_cleaning.bonus.Sebastian extends com.disney.gem.games.ocean_cleaning.bonus.BaseBonus
{
var setMC, setProperties, setDelay, mcRef, topLeft, bottomRight, sName, bEnabled, setState, setTarget, nFrame, nDelay, stateCurrentFrame, stateFinished;
function Sebastian (_mcGame, _aCollidersGroup, _aProperties, _nDelay, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcBonus");
_mcGame.attachMovie("mcSebastian", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setDelay(_nDelay);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
sName = "Sebastian";
bEnabled = false;
setState("idle", true);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.addListener(this);
}
function state_idle_init() {
nFrame = 0;
bEnabled = false;
}
function state_idle() {
if (!bEnabled) {
nFrame++;
if (nFrame >= nDelay) {
bEnabled = true;
}
}
}
function state_highfive() {
bEnabled = false;
if (stateCurrentFrame() == 11) {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_SEBASTIAN_HIGHFIVE, true, false);
}
if (stateFinished()) {
setState("idle", true);
}
}
function onPause() {
super.onPause();
mcRef.mcState.mcHead.stop();
}
function onUnPause() {
super.onUnPause();
mcRef.mcState.mcHead.play();
}
function get enabled() {
return(bEnabled);
}
function get name() {
return(sName);
}
}
Symbol 1040 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.bonus.Starfish] Frame 0
class com.disney.gem.games.ocean_cleaning.bonus.Starfish extends com.disney.gem.games.ocean_cleaning.bonus.BaseBonus
{
var setMC, setState, mcRef, topLeft, bottomRight, sName, setTarget, setProperties;
function Starfish (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcBonus");
_mcGame.attachMovie("mcStarfish", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
sName = "Starfish";
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
setProperties(_aProperties);
}
function get box() {
var _local2 = {x:mcRef.mcBoxTopLeft._x, y:mcRef.mcBoxTopLeft._y};
var _local3 = {x:mcRef.mcBoxBottomRight._x, y:mcRef.mcBoxBottomRight._y};
mcRef._parent.localToGlobal(_local2);
mcRef._parent.localToGlobal(_local3);
var _local4 = new Object();
_local4.left = ((_local2.x < _local3.x) ? (_local2.x) : (_local3.x));
_local4.right = ((_local2.x < _local3.x) ? (_local3.x) : (_local2.x));
_local4.top = _local2.y;
_local4.bottom = _local3.y;
return(_local4);
}
function get name() {
return(sName);
}
}
Symbol 1041 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.bonus.Stopwatch] Frame 0
class com.disney.gem.games.ocean_cleaning.bonus.Stopwatch extends com.disney.gem.games.ocean_cleaning.bonus.BaseBonus
{
var setMC, setState, mcRef, topLeft, bottomRight, sName, setTarget, setProperties;
function Stopwatch (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcBonus");
_mcGame.attachMovie("mcStopwatch", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
sName = "Stopwatch";
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
setProperties(_aProperties);
}
function get box() {
var _local2 = {x:mcRef.mcBoxTopLeft._x, y:mcRef.mcBoxTopLeft._y};
var _local3 = {x:mcRef.mcBoxBottomRight._x, y:mcRef.mcBoxBottomRight._y};
mcRef._parent.localToGlobal(_local2);
mcRef._parent.localToGlobal(_local3);
var _local4 = new Object();
_local4.left = ((_local2.x < _local3.x) ? (_local2.x) : (_local3.x));
_local4.right = ((_local2.x < _local3.x) ? (_local3.x) : (_local2.x));
_local4.top = _local2.y;
_local4.bottom = _local3.y;
return(_local4);
}
function get name() {
return(sName);
}
}
Symbol 1042 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.enemies.BaseEnemy] Frame 0
class com.disney.gem.games.ocean_cleaning.enemies.BaseEnemy extends com.disney.gem.games.ocean_cleaning.collision.CollideItem
{
var sType, mcRef, nSpeedX, nSpeedY, oActions, __get__Mc, nDelay, nFrame, setState, sName;
function BaseEnemy (_mcRef, _aCollidersGroup) {
super(_mcRef, undefined, undefined);
sType = "enemy";
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.addListener(this);
}
function setProperties(_aProperties) {
var _local2 = 0;
while (_local2 < _aProperties.length) {
mcRef["_" + _aProperties[_local2][0]] = _aProperties[_local2][1];
_local2++;
}
}
function setSpeed(_nSpeedX, _nSpeedY) {
nSpeedX = _nSpeedX;
nSpeedY = _nSpeedY;
if (oActions.startX >= oActions.endX) {
nSpeedX = nSpeedX * -1;
} else {
__get__Mc()._xscale = -100;
}
}
function setActions(_oActions) {
oActions = _oActions;
}
function setDelay(_nDelay) {
nDelay = _nDelay;
}
function state_wait_init() {
nFrame = 0;
}
function state_wait() {
nFrame++;
if (nFrame >= nDelay) {
setState("idle");
}
}
function state_idle_init() {
__get__Mc()._x = oActions.startX;
__get__Mc()._y = oActions.startY;
}
function state_idle() {
__get__Mc()._x = __get__Mc()._x + nSpeedX;
__get__Mc()._y = __get__Mc()._y + nSpeedY;
if (hasFinished()) {
setState("wait");
}
}
function destroy() {
mcRef.removeMovieClip();
super.destroy();
}
function hasFinished() {
var _local2 = false;
if (oActions.startX >= oActions.endX) {
if (__get__Mc()._x <= oActions.endX) {
_local2 = true;
}
} else if (oActions.startX <= oActions.endX) {
if (__get__Mc()._x >= oActions.endX) {
_local2 = true;
}
}
return(_local2);
}
function get type() {
return(sType);
}
function get name() {
return(sName);
}
}
Symbol 1043 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.enemies.Flotsam] Frame 0
class com.disney.gem.games.ocean_cleaning.enemies.Flotsam extends com.disney.gem.games.ocean_cleaning.enemies.BaseEnemy
{
var setMC, setProperties, setActions, setDelay, setSpeed, setState, sName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Flotsam (_mcGame, _aCollidersGroup, _aProperties, _oActions, _nDelay, _nDepth, _nSpeedX, _nSpeedY) {
super(undefined, _aCollidersGroup);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcEnemy");
_mcGame.attachMovie("mcFlotsam", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setActions(_oActions);
setDelay(_nDelay);
setSpeed(_nSpeedX, _nSpeedY);
setState("wait", true);
sName = "Flotsam";
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
}
Symbol 1044 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.enemies.Jetsam] Frame 0
class com.disney.gem.games.ocean_cleaning.enemies.Jetsam extends com.disney.gem.games.ocean_cleaning.enemies.BaseEnemy
{
var setMC, setProperties, setActions, setDelay, setSpeed, setState, sName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Jetsam (_mcGame, _aCollidersGroup, _aProperties, _oActions, _nDelay, _nDepth, _nSpeedX, _nSpeedY) {
super(undefined, _aCollidersGroup);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcEnemy");
_mcGame.attachMovie("mcJetsam", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setActions(_oActions);
setDelay(_nDelay);
setSpeed(_nSpeedX, _nSpeedY);
setState("wait", true);
sName = "Jetsam";
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
}
Symbol 1045 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.enemies.Shark] Frame 0
class com.disney.gem.games.ocean_cleaning.enemies.Shark extends com.disney.gem.games.ocean_cleaning.enemies.BaseEnemy
{
var setMC, setProperties, setActions, setDelay, setSpeed, setState, sName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Shark (_mcGame, _aCollidersGroup, _aProperties, _oActions, _nDelay, _nDepth, _nSpeedX, _nSpeedY) {
super(undefined, _aCollidersGroup);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcEnemey");
_mcGame.attachMovie("mcShark", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setActions(_oActions);
setDelay(_nDelay);
setSpeed(_nSpeedX, _nSpeedY);
setState("wait", true);
sName = "Shark";
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
}
Symbol 1046 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.friends.BaseFriend] Frame 0
class com.disney.gem.games.ocean_cleaning.friends.BaseFriend extends com.disney.gem.games.ocean_cleaning.collision.CollideItem
{
var sType, mcRef, nSpeedX, nSpeedY, oActions, __get__Mc, nDelay, nFrame, setState;
function BaseFriend (_mcRef, _aCollidersGroup) {
super(_mcRef, undefined, undefined);
sType = "friend";
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.addListener(this);
}
function setProperties(_aProperties) {
var _local2 = 0;
while (_local2 < _aProperties.length) {
mcRef["_" + _aProperties[_local2][0]] = _aProperties[_local2][1];
_local2++;
}
}
function setSpeed(_nSpeedX, _nSpeedY) {
nSpeedX = _nSpeedX;
nSpeedY = _nSpeedY;
if (oActions.startX >= oActions.endX) {
nSpeedX = nSpeedX * -1;
} else {
__get__Mc()._xscale = -100;
}
}
function setActions(_oActions) {
oActions = _oActions;
}
function setDelay(_nDelay) {
nDelay = _nDelay;
}
function state_wait_init() {
nFrame = 0;
}
function state_wait() {
nFrame++;
if (nFrame >= nDelay) {
setState("idle", true);
}
}
function state_idle_init() {
__get__Mc()._x = oActions.startX;
__get__Mc()._y = oActions.startY;
}
function state_idle() {
__get__Mc()._x = __get__Mc()._x + nSpeedX;
__get__Mc()._y = __get__Mc()._y + nSpeedY;
if (hasFinished()) {
setState("wait");
}
}
function destroy() {
mcRef.removeMovieClip();
super.destroy();
}
function hasFinished() {
var _local2 = false;
if (oActions.startX >= oActions.endX) {
if (__get__Mc()._x <= oActions.endX) {
_local2 = true;
}
} else if (oActions.startX <= oActions.endX) {
if (__get__Mc()._x >= oActions.endX) {
_local2 = true;
}
}
return(_local2);
}
function get type() {
return(sType);
}
}
Symbol 1047 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.friends.Fish1] Frame 0
class com.disney.gem.games.ocean_cleaning.friends.Fish1 extends com.disney.gem.games.ocean_cleaning.friends.BaseFriend
{
var setMC, setProperties, setActions, setDelay, setSpeed, setState, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Fish1 (_mcGame, _aCollidersGroup, _aProperties, _oActions, _nDelay, _nDepth, _nSpeedX, _nSpeedY) {
super(undefined, _aCollidersGroup);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcFriend");
_mcGame.attachMovie("mcFish1", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setActions(_oActions);
setDelay(_nDelay);
setSpeed(_nSpeedX, _nSpeedY);
setState("wait", true);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function onPause() {
super.onPause();
mcRef.mcState.mcEye.stop();
}
function onUnPause() {
super.onUnPause();
mcRef.mcState.mcEye.play();
}
}
Symbol 1048 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.friends.Fish2] Frame 0
class com.disney.gem.games.ocean_cleaning.friends.Fish2 extends com.disney.gem.games.ocean_cleaning.friends.BaseFriend
{
var setMC, setProperties, setActions, setDelay, setSpeed, setState, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Fish2 (_mcGame, _aCollidersGroup, _aProperties, _oActions, _nDelay, _nDepth, _nSpeedX, _nSpeedY) {
super(undefined, _aCollidersGroup);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcFriend");
_mcGame.attachMovie("mcFish2", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setActions(_oActions);
setDelay(_nDelay);
setSpeed(_nSpeedX, _nSpeedY);
setState("wait", true);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function onPause() {
super.onPause();
mcRef.mcState.mcEyes.stop();
}
function onUnPause() {
super.onUnPause();
mcRef.mcState.mcEyes.play();
}
}
Symbol 1049 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.friends.Fish3] Frame 0
class com.disney.gem.games.ocean_cleaning.friends.Fish3 extends com.disney.gem.games.ocean_cleaning.friends.BaseFriend
{
var setMC, setProperties, setActions, setDelay, setSpeed, setState, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Fish3 (_mcGame, _aCollidersGroup, _aProperties, _oActions, _nDelay, _nDepth, _nSpeedX, _nSpeedY) {
super(undefined, _aCollidersGroup);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcFriend");
_mcGame.attachMovie("mcFish3", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setActions(_oActions);
setDelay(_nDelay);
setSpeed(_nSpeedX, _nSpeedY);
setState("wait", true);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
}
Symbol 1050 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.friends.Turtle] Frame 0
class com.disney.gem.games.ocean_cleaning.friends.Turtle extends com.disney.gem.games.ocean_cleaning.friends.BaseFriend
{
var setMC, setProperties, setActions, setDelay, setSpeed, setState, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Turtle (_mcGame, _aCollidersGroup, _aProperties, _oActions, _nDelay, _nDepth, _nSpeedX, _nSpeedY) {
super(undefined, _aCollidersGroup);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcFriend");
_mcGame.attachMovie("mcTurtle", _local3, _nDepth);
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setActions(_oActions);
setDelay(_nDelay);
setSpeed(_nSpeedX, _nSpeedY);
setState("wait", true);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function onPause() {
super.onPause();
mcRef.mcState.mcEye.stop();
}
function onUnPause() {
super.onUnPause();
mcRef.mcState.mcEye.play();
}
}
Symbol 1051 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.BaseItem] Frame 0
class com.disney.gem.games.ocean_cleaning.items.BaseItem extends com.disney.gem.games.ocean_cleaning.collision.CollideItem
{
var bTaken, bHold, nSpeedX, sType, nAccel, oItemDispatcher, mcRef, nSpeedY, nMass, nValue, sName;
function BaseItem (_mcRef, _aCollidersGroup, _mcTopLeft, _mcBottomRight) {
super(_mcRef, undefined, undefined);
bTaken = false;
bHold = false;
nSpeedX = 0;
sType = "item";
nAccel = 0.4;
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.addListener(this);
}
function setDispatcher(_oItemDispatcher) {
oItemDispatcher = _oItemDispatcher;
oItemDispatcher.addEventListener(com.disney.gem.games.ocean_cleaning.events.Event.COLLIDE, collideWith, this);
}
function setProperties(_aProperties) {
var _local2 = 0;
while (_local2 < _aProperties.length) {
mcRef["_" + _aProperties[_local2][0]] = _aProperties[_local2][1];
_local2++;
}
}
function collideWith(_oEvt, _oObj) {
switch (_oEvt.__get__from()) {
case "top" :
mcRef._y = _oObj.top - mcRef.mcBoxBottomRight._y;
nSpeedY = 0;
break;
case "left" :
mcRef._x = _oObj.left - mcRef.mcBoxBottomRight._x;
nSpeedX = 0;
break;
case "right" :
mcRef._x = _oObj.right - mcRef.mcBoxTopLeft._x;
nSpeedX = 0;
break;
case "bottom" :
mcRef._y = _oObj.bottom - mcRef.mcBoxTopLeft._y;
nSpeedY = 0;
}
playGround();
bTaken = false;
}
function playGround() {
}
function hide() {
mcRef._x = -1000;
}
function show() {
}
function took() {
bTaken = true;
}
function setMass(_nMass) {
nMass = _nMass;
}
function setValue(_nValue) {
nValue = _nValue;
}
function setName(_sName) {
sName = _sName;
}
function defineAccel() {
nAccel = com.disney.gem.games.ocean_cleaning.Config.nGRAVITY / nMass;
}
function state_idle() {
if (bHold) {
mcRef._visible = false;
} else {
mcRef._visible = true;
}
if (bTaken) {
oItemDispatcher.dispatchEvent(new com.disney.gem.games.ocean_cleaning.events.Event(com.disney.gem.games.ocean_cleaning.events.Event.TEST), this);
nSpeedY = nSpeedY + nAccel;
mcRef._y = mcRef._y + nSpeedY;
}
}
function destroy() {
mcRef.removeMovieClip();
super.destroy();
}
function get name() {
return(sName);
}
function get type() {
return(sType);
}
}
Symbol 1052 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Boot] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Boot extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget;
function Boot (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcBoot", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Boot.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Boot.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Boot.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BOOT_GROUND, true, false);
}
}
Symbol 1053 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Candelabra] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Candelabra extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Candelabra (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcCandelabra", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Candelabra.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Candelabra.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Candelabra.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_CANDELABRA_GROUND, true, false);
}
}
Symbol 1054 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Fork] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Fork extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Fork (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcFork", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Fork.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Fork.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Fork.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_FORK_GROUND, true, false);
}
}
Symbol 1055 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Goblet] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Goblet extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Goblet (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcGoblet", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Goblet.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Goblet.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Goblet.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_GOBLET_GROUND, true, false);
}
}
Symbol 1056 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Lamp] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Lamp extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Lamp (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcLamp", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Lamp.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Lamp.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Lamp.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_LAMP_GROUND, true, false);
}
}
Symbol 1057 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Mirror] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Mirror extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Mirror (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcMirror", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Mirror.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Mirror.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Mirror.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_MIRROR_GROUND, true, false);
}
}
Symbol 1058 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Pipe] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Pipe extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Pipe (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcPipe", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Pipe.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Pipe.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Pipe.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_PIPE_GROUND, true, false);
}
}
Symbol 1059 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Spyglass] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Spyglass extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Spyglass (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcSpyglass", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Spyglass.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Spyglass.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Spyglass.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_SPYGLASS_GROUND, true, false);
}
}
Symbol 1060 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.items.Wheel] Frame 0
class com.disney.gem.games.ocean_cleaning.items.Wheel extends com.disney.gem.games.ocean_cleaning.items.BaseItem
{
var setMC, setState, setProperties, setMass, setValue, setName, mcRef, topLeft, bottomRight, setTarget, stopListening;
function Wheel (_mcGame, _aCollidersGroup, _aProperties, _nDepth) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcItem");
_mcGame.attachMovie("mcWheel", _local3, _nDepth);
setMC(_mcGame[_local3]);
setState("idle", true);
setProperties(_aProperties);
setMass(com.disney.gem.games.ocean_cleaning.Config.Wheel.Mass);
setValue(com.disney.gem.games.ocean_cleaning.Config.Wheel.Score);
setName(com.disney.gem.games.ocean_cleaning.Config.Wheel.Name);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
}
function removeFromEvent() {
stopListening();
}
function playGround() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_WHEEL_GROUND, true, false);
}
}
Symbol 1061 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.Hud] Frame 0
class com.disney.gem.games.ocean_cleaning.Hud
{
var oController, mcHud, oGame, nTime, bPause;
function Hud (_oController, _mcHud, _oGame) {
oController = _oController;
mcHud = _mcHud;
oGame = _oGame;
nTime = com.disney.gem.games.ocean_cleaning.Config.nGAME_TIME * 30;
bPause = true;
mcHud.txtTime.text = formatTime(nTime);
mcHud.btMenu.onRelease = com.sarbakan.utils.Delegate.create(this, onBtMenu);
}
function update() {
if (!bPause) {
nTime--;
if (nTime == -1) {
oGame.onGameEnd();
} else {
mcHud.txtTime.text = formatTime(nTime);
}
mcHud.txtItems.text = oGame.__get__maxItems().toString();
mcHud.txtScore.text = formatScore(oController.getScore());
mcHud.txtTries.text = com.disney.gem.games.ocean_cleaning.Stats.tries;
}
}
function init() {
bPause = false;
mcHud.txtItems.text = oGame.__get__maxItems().toString();
mcHud.txtScore.text = formatScore(oController.getScore());
mcHud.txtTries.text = com.disney.gem.games.ocean_cleaning.Stats.tries;
}
function pause() {
bPause = true;
}
function onBtMenu() {
com.disney.gem.games.ocean_cleaning.Controller.getInstance().pause();
com.disney.gem.games.ocean_cleaning.Controller.getInstance().showPopup(new com.disney.gem.games.ocean_cleaning.popups.MenuPopup(com.disney.gem.games.ocean_cleaning.Controller.getInstance().mcTimeline.mcPopups.mcMenu), true);
}
function formatTime(_nTime) {
var _local4;
_nTime = Math.floor(_nTime / 30);
var _local3 = Math.floor(_nTime / 60);
var _local1 = _nTime - (_local3 * 60);
var _local5 = _local3.toString();
var _local6 = ((_local1 < 10) ? ("0" + _local1.toString()) : (_local1)).toString();
_local4 = (_local5 + ":") + _local6;
return(_local4);
}
function formatScore(_nScore) {
var _local1 = _nScore.toString();
return(_local1);
}
}
Symbol 1062 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.popups.MenuPopup] Frame 0
class com.disney.gem.games.ocean_cleaning.popups.MenuPopup extends com.sarbakan.utils.ScreenController
{
var oController, hide, mcRef;
function MenuPopup (_mcRef) {
super(_mcRef);
}
function onBtSound() {
playClick();
com.disney.gem.games.ocean_cleaning.Controller(oController).toggleSound();
updateSoundGroup();
}
function onBtHelp() {
playClick();
hide(null, true);
com.disney.gem.games.ocean_cleaning.Controller(oController).showInstructionScreen();
}
function onBtQuit() {
playClick();
hide(com.sarbakan.utils.Delegate.create(this, onHide), true);
}
function onBtResume() {
playClick();
com.disney.gem.games.ocean_cleaning.Controller(oController).unpause();
com.disney.gem.games.ocean_cleaning.utility.Sounds.Unpause(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.Unpause(com.disney.gem.games.ocean_cleaning.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.setMusic(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_INGAME);
hide();
}
function state_in_init() {
super.state_in_init();
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_POPUP, true, false);
setBts();
com.disney.gem.games.ocean_cleaning.utility.Sounds.Pause(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSOUND_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.Pause(com.disney.gem.games.ocean_cleaning.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.setMusic(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_PACKAGING);
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_out_init() {
super.state_out_init();
setBts();
}
function onHide() {
com.disney.gem.games.ocean_cleaning.Controller(oController).showPopup(new com.disney.gem.games.ocean_cleaning.popups.ConfirmPopup(com.disney.gem.games.ocean_cleaning.Controller(oController).mcTimeline.mcPopups.mcConfirm, this), true);
}
function setBts() {
mcRef.mcState.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
mcRef.mcState.btQuit.onRelease = com.sarbakan.utils.Delegate.create(this, onBtQuit);
mcRef.mcState.btQuit.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
mcRef.mcState.btResume.onRelease = com.sarbakan.utils.Delegate.create(this, onBtResume);
mcRef.mcState.btResume.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
updateSoundGroup();
}
function updateSoundGroup() {
if (com.disney.gem.games.ocean_cleaning.Controller(oController).bSoundMuted) {
mcRef.mcState.btSoundOn._visible = false;
mcRef.mcState.btSoundOff._visible = true;
} else {
mcRef.mcState.btSoundOn._visible = true;
mcRef.mcState.btSoundOff._visible = false;
}
mcRef.mcState.btSoundOn.onRelease = com.sarbakan.utils.Delegate.create(this, onBtSound);
mcRef.mcState.btSoundOn.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
mcRef.mcState.btSoundOff.onRelease = com.sarbakan.utils.Delegate.create(this, onBtSound);
mcRef.mcState.btSoundOff.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
}
function playClick() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_CLICK, true, true);
}
function playOver() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
}
Symbol 1063 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.popups.ConfirmPopup] Frame 0
class com.disney.gem.games.ocean_cleaning.popups.ConfirmPopup extends com.sarbakan.utils.ScreenController
{
var oMenuOrigin, hide, oController, mcRef;
function ConfirmPopup (_mcRef, _oMenuOrigin) {
super(_mcRef);
oMenuOrigin = _oMenuOrigin;
}
function onBtNo() {
playClick();
hide(com.sarbakan.utils.Delegate.create(this, onHide));
}
function onBtYes() {
playClick();
hide();
com.disney.gem.games.ocean_cleaning.Controller(oController).onGameLose();
}
function state_in_init() {
super.state_in_init();
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_POPUP, true, false);
setBts();
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_out_init() {
super.state_out_init();
setBts();
}
function onHide() {
oMenuOrigin.show(true);
}
function setBts() {
mcRef.mcState.btNo.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNo);
mcRef.mcState.btNo.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
mcRef.mcState.btYes.onRelease = com.sarbakan.utils.Delegate.create(this, onBtYes);
mcRef.mcState.btYes.onRollOver = com.sarbakan.utils.Delegate.create(this, playOver);
}
function playClick() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_CLICK, true, true);
}
function playOver() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
}
Symbol 1064 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.bonus.Bubble] Frame 0
class com.disney.gem.games.ocean_cleaning.bonus.Bubble extends com.disney.gem.games.ocean_cleaning.collision.CollideItem
{
var setMC, topLeft, mcRef, bottomRight, nDistance, sType, sName, setState, setTarget, nSpeed, __get__Mc, bLeft;
function Bubble (_mcGame, _aCollidersGroup, _aProperties) {
super(undefined, undefined, undefined);
var _local3 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcBubble");
_mcGame.attachMovie("mcBubble", _local3, _mcGame.getNextHighestDepth());
setMC(_mcGame[_local3]);
setProperties(_aProperties);
setSpeed(0);
topLeft(mcRef.mcBoxTopLeft);
bottomRight(mcRef.mcBoxBottomRight);
nDistance = 0;
sType = "bonus";
sName = "Bubble";
setState("idle", true);
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.addListener(this);
}
function setProperties(_aProperties) {
var _local2 = 0;
while (_local2 < _aProperties.length) {
mcRef["_" + _aProperties[_local2][0]] = _aProperties[_local2][1];
_local2++;
}
}
function setSpeed(_nSpeed) {
nSpeed = _nSpeed;
}
function state_idle() {
__get__Mc()._x = __get__Mc()._x + getSpeed();
__get__Mc()._y = __get__Mc()._y - com.disney.gem.games.ocean_cleaning.Config.nGRAVITY;
nDistance = nDistance + com.disney.gem.games.ocean_cleaning.Config.nGRAVITY;
if (nDistance >= com.disney.gem.games.ocean_cleaning.Config.Bubble.Distance) {
setState("fade");
}
}
function state_fade() {
__get__Mc()._x = __get__Mc()._x + getSpeed();
__get__Mc()._y = __get__Mc()._y - com.disney.gem.games.ocean_cleaning.Config.nGRAVITY;
__get__Mc()._alpha = __get__Mc()._alpha - com.disney.gem.games.ocean_cleaning.Config.Bubble.FadeRate;
if (__get__Mc()._alpha <= 0) {
destroy();
}
}
function destroy() {
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oMainBroadcaster.removeListener(this);
mcRef.removeMovieClip();
super.destroy();
}
function getSpeed() {
if (nSpeed >= com.disney.gem.games.ocean_cleaning.Config.Bubble.SpeedXMax) {
bLeft = true;
} else if (nSpeed <= (-com.disney.gem.games.ocean_cleaning.Config.Bubble.SpeedXMax)) {
bLeft = false;
}
if (bLeft) {
nSpeed = nSpeed - com.disney.gem.games.ocean_cleaning.Config.Bubble.SpeedX;
} else {
nSpeed = nSpeed + com.disney.gem.games.ocean_cleaning.Config.Bubble.SpeedX;
}
return(nSpeed);
}
function get box() {
var _local2 = {x:mcRef.mcBoxTopLeft._x, y:mcRef.mcBoxTopLeft._y};
var _local3 = {x:mcRef.mcBoxBottomRight._x, y:mcRef.mcBoxBottomRight._y};
mcRef._parent.localToGlobal(_local2);
mcRef._parent.localToGlobal(_local3);
var _local4 = new Object();
_local4.left = ((_local2.x < _local3.x) ? (_local2.x) : (_local3.x));
_local4.right = ((_local2.x < _local3.x) ? (_local3.x) : (_local2.x));
_local4.top = _local2.y;
_local4.bottom = _local3.y;
return(_local4);
}
function get name() {
return(sName);
}
function get type() {
return(sType);
}
function get bottom() {
return(__get__Mc()._y + (__get__Mc()._height / 2));
}
function get top() {
return(__get__Mc()._y - (__get__Mc()._height / 2));
}
function get left() {
return(__get__Mc()._x - (__get__Mc()._width / 2));
}
function get right() {
return(__get__Mc()._x + (__get__Mc()._width / 2));
}
}
Symbol 1065 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.utility.ClassFinder] Frame 0
class com.disney.gem.games.ocean_cleaning.utility.ClassFinder
{
function ClassFinder () {
}
static function find(_sPackage) {
var _local3 = _global;
var _local4 = _sPackage.split(".");
var _local2 = 0;
while (_local2 < _local4.length) {
_local3 = _local3[_local4[_local2]];
_local2++;
}
return(Function(_local3));
}
}
Symbol 1066 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.colliders.AllSide] Frame 0
class com.disney.gem.games.ocean_cleaning.colliders.AllSide extends com.disney.gem.games.ocean_cleaning.collision.CollideItem
{
var setMC, __get__Mc, mcRef, sType, topLeft, bottomRight, setTarget, Collide;
function AllSide (_mcGame, _aCollidersGroup, _aProperties) {
super(undefined, undefined, undefined);
var _local5 = com.disney.gem.games.ocean_cleaning.Controller.getInstance().getGenericName("mcAllSide");
_mcGame.attachMovie("mcAllSide", _local5, _mcGame.getNextHighestDepth());
setMC(_mcGame[_local5]);
__get__Mc().sName = _local5;
var _local3 = 0;
while (_local3 < _aProperties.length) {
mcRef["_" + _aProperties[_local3][0]] = _aProperties[_local3][1];
_local3++;
}
__get__Mc()._visible = false;
sType = "collider";
mcRef.mcBoxTopLeft._visible = false;
mcRef.mcBoxBottomRight._visible = false;
var _local7 = new Object();
var _local6 = new Object();
_local7._x = (mcRef._width / 2) * -1;
_local7._y = (mcRef._height / 2) * -1;
_local6._x = mcRef._width / 2;
_local6._y = mcRef._height / 2;
topLeft(_local7);
bottomRight(_local6);
setTarget(com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.oPlayerDispatcher);
_local3 = 0;
while (_local3 < com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.aEventDispatcher.length) {
com.disney.gem.games.ocean_cleaning.Controller.getInstance().oGame.aEventDispatcher[_local3].addEventListener(com.disney.gem.games.ocean_cleaning.events.Event.TEST, Collide, this);
_local3++;
}
}
function onCollide(_oObj) {
if (!(_oObj.sType === "characters")) {
}
}
function destroy() {
mcRef.removeMovieClip();
super.destroy();
}
function get type() {
return(sType);
}
function get nextMoveX() {
return(__get__Mc()._x);
}
function get nextMoveY() {
return(__get__Mc()._y);
}
function get bottom() {
return(__get__Mc()._y + (__get__Mc()._height / 2));
}
function get top() {
return(__get__Mc()._y - (__get__Mc()._height / 2));
}
function get left() {
return(__get__Mc()._x - (__get__Mc()._width / 2));
}
function get right() {
return(__get__Mc()._x + (__get__Mc()._width / 2));
}
function get name() {
return(__get__Mc()._name);
}
function get box() {
var _local2 = {x:mcRef.mcBoxTopLeft._x, y:mcRef.mcBoxTopLeft._y};
var _local3 = {x:mcRef.mcBoxBottomRight._x, y:mcRef.mcBoxBottomRight._y};
mcRef._parent.localToGlobal(_local2);
mcRef._parent.localToGlobal(_local3);
var _local4 = new Object();
_local4.left = ((_local2.x < _local3.x) ? (_local2.x) : (_local3.x));
_local4.right = ((_local2.x < _local3.x) ? (_local3.x) : (_local2.x));
_local4.top = _local2.y;
_local4.bottom = _local3.y;
return(_local4);
}
}
Symbol 1067 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.screens.TitleScreen] Frame 0
class com.disney.gem.games.ocean_cleaning.screens.TitleScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function TitleScreen (_mcRef) {
super(_mcRef);
}
function onBtHelp() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_CLICK, true, true);
com.disney.gem.games.ocean_cleaning.Controller(oController).showInstructionScreen();
}
function onBtPlay() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_CLICK, true, true);
com.disney.gem.games.ocean_cleaning.Controller(oController).startNewGame();
}
function onBtOver() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
}
}
Symbol 1068 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.screens.HelpScreen] Frame 0
class com.disney.gem.games.ocean_cleaning.screens.HelpScreen extends com.sarbakan.utils.ScreenController
{
var setState, oController, mcRef;
function HelpScreen (_mcRef) {
super(_mcRef);
setState("idle");
}
function onBtPlay() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_CLICK, true, true);
if (com.disney.gem.games.ocean_cleaning.Controller(oController).getGamePhase() == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
com.disney.gem.games.ocean_cleaning.Controller(oController).hideInstructionScreen();
} else {
com.disney.gem.games.ocean_cleaning.Controller(oController).startNewGame();
}
}
function onBtNext() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_CLICK, true, true);
setState("idle2");
}
function onBtBack() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_CLICK, true, true);
setState("idle");
}
function onBtOver() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btNext.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNext);
mcRef.mcState.mcContent.btNext.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
}
function state_idle2_init() {
mcRef.btBlocker.useHandCursor = false;
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
mcRef.mcState.mcContent.btBack.onRelease = com.sarbakan.utils.Delegate.create(this, onBtBack);
mcRef.mcState.mcContent.btBack.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
}
}
Symbol 1069 MovieClip [__Packages.com.disney.gem.games.ocean_cleaning.screens.EndScreen] Frame 0
class com.disney.gem.games.ocean_cleaning.screens.EndScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function EndScreen (_mcRef) {
super(_mcRef);
com.disney.gem.games.ocean_cleaning.utility.Sounds.StopAll(com.disney.gem.games.ocean_cleaning.utility.Sounds.sAMBIENT_CAT_NAME);
com.disney.gem.games.ocean_cleaning.utility.Sounds.setMusic(com.disney.gem.games.ocean_cleaning.utility.Sounds.sMUSIC_PACKAGING);
}
function onBtPlay() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_CLICK, true, true);
com.disney.gem.games.ocean_cleaning.Controller(oController).showTitleScreen(true);
}
function onBtOver() {
com.disney.gem.games.ocean_cleaning.utility.Sounds.Play(com.disney.gem.games.ocean_cleaning.utility.Sounds.sSFX_BUTTON_ROLLOVER, true, false);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.mcNormal.txtScore.text = formatScore(com.disney.gem.games.ocean_cleaning.Controller.getInstance().getScore());
mcRef.mcState.mcContent.mcShadow.txtScore.text = formatScore(com.disney.gem.games.ocean_cleaning.Controller.getInstance().getScore());
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtOver);
}
function formatScore(_nScore) {
var _local1 = _nScore.toString();
return(_local1);
}
}
Symbol 626 MovieClip Frame 1
stop();
Symbol 626 MovieClip Frame 2
gotoAndStop (1);