Frame 1
var _oPreloaderScreen = (new com.disney.gem.games.mulanMushuJungleJump.screens.PreloaderScreen(mcScreens.mcPreloader));
com.sarbakan.BaseDisneyController.bDEBUG = false;
new com.disney.gem.games.mulanMushuJungleJump.Controller(this, _oPreloaderScreen);
Instance of Symbol 59 MovieClip in Frame 1
/* no clip actions */
Symbol 53 MovieClip Frame 1
function localTrace(_sText) {
_host.txtTrace.text = _sText;
}
var _host = this;
_global.superTrace = localTrace;
Symbol 56 MovieClip Frame 1
function getReport() {
if (frate < minForBest) {
if (frate < minForHigh) {
vQuality = "MEDIUM";
} else {
vQuality = "HIGH";
}
} else {
vQuality = "BEST";
}
nbReport++;
_parent.txtFrameRate.text = frate;
_parent.txtQuality.text = vQuality;
_parent.txtFrameRate.textColor = "0";
_parent.txtQuality.textColor = "0";
_quality = vQuality;
enableReport = false;
gotoAndStop (2);
}
fcount = 0;
offset = getTimer();
_visible = false;
minForMedium = 0;
minForHigh = 22;
minForBest = 30;
nbReport = 0;
enableReport = false;
Symbol 56 MovieClip Frame 2
fcount = 0;
offset = getTimer();
Symbol 56 MovieClip Frame 3
fcount++;
Symbol 56 MovieClip Frame 4
call(3);
Symbol 56 MovieClip Frame 5
call(3);
Symbol 56 MovieClip Frame 6
call(3);
Symbol 56 MovieClip Frame 7
call(3);
Symbol 56 MovieClip Frame 8
call(3);
Symbol 56 MovieClip Frame 9
call(3);
Symbol 56 MovieClip Frame 10
call(3);
Symbol 56 MovieClip Frame 11
call(3);
Symbol 56 MovieClip Frame 12
call(3);
Symbol 56 MovieClip Frame 13
call(3);
Symbol 56 MovieClip Frame 14
call(3);
Symbol 56 MovieClip Frame 15
call(3);
Symbol 56 MovieClip Frame 16
call(3);
Symbol 56 MovieClip Frame 17
call(3);
Symbol 56 MovieClip Frame 18
call(3);
Symbol 56 MovieClip Frame 19
call(3);
Symbol 56 MovieClip Frame 20
call(3);
Symbol 56 MovieClip Frame 21
call(3);
Symbol 56 MovieClip Frame 22
call(3);
Symbol 56 MovieClip Frame 23
call(3);
Symbol 56 MovieClip Frame 24
call(3);
Symbol 56 MovieClip Frame 25
call(3);
Symbol 56 MovieClip Frame 26
call(3);
Symbol 56 MovieClip Frame 27
call(3);
Symbol 56 MovieClip Frame 28
call(3);
Symbol 56 MovieClip Frame 29
call(3);
Symbol 56 MovieClip Frame 30
call(3);
Symbol 56 MovieClip Frame 31
call(3);
curtime = (getTimer() - offset) / 1000;
frate = Math.ceil(fcount / curtime);
_parent.pointer.play();
if (enableReport) {
getReport();
} else {
_parent.txtFrameRate.text = frate;
_parent.txtQuality.text = _quality;
_parent.txtFrameRate.textColor = "16777215";
_parent.txtQuality.textColor = "16777215";
gotoAndPlay (2);
}
Symbol 83 MovieClip Frame 1
stop();
Symbol 846 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);
}
}
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 847 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 848 MovieClip [__Packages.com.sarbakan.utils.TransitionManager] Frame 0
class com.sarbakan.utils.TransitionManager extends com.sarbakan.utils.StateManaged
{
var setPausable, mcTransitionContainer, oSoundPlayer, mcTransition, fMiddleCallBack, fEndCallBack, bTransitionning, setMC, setState, stateFinished, mcRef;
function TransitionManager (_mcTransition) {
super();
setPausable(false);
mcTransitionContainer = _mcTransition;
for (var _local3 in mcTransitionContainer) {
mcTransitionContainer[_local3].stop();
}
oSoundPlayer = new com.disney.gem.games.mulanMushuJungleJump.SoundPlayer("oSoundPlayer");
}
function playTransition(_sTransitionID, _fMiddleCallBack, _fEndCallBack) {
mcTransition = mcTransitionContainer["mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)];
fMiddleCallBack = _fMiddleCallBack;
fEndCallBack = _fEndCallBack;
oSoundPlayer.playTransition();
if (mcTransition == undefined) {
} 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 849 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.SoundPlayer] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.SoundPlayer
{
var sName, oRocketFuse, oPlayer, oLaunch, oWindWeak, oWindStrong, oWindBoost, oObstacle, oBoost, oPopup, oMusicInGame, oMusicPack, oTransition;
function SoundPlayer (_sName) {
sName = _sName;
}
function playFuse() {
if (oRocketFuse == undefined) {
oRocketFuse = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndRocketFuse", com.disney.gem.games.mulanMushuJungleJump.GameData.nROCKETFUSE_VOLUME, 99999, true);
}
}
function stopFuse() {
oRocketFuse.doStop();
oRocketFuse.doDestroy();
oRocketFuse = undefined;
}
function playLaunchFailed() {
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndLaunchFailed", com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_FAILED_VOLUME);
}
function playStretch(_nVolume) {
if (oLaunch == undefined) {
oLaunch = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndStretching", _nVolume, 99999, true);
}
oLaunch.doFadeTo(_nVolume, false);
}
function playLaunch() {
oLaunch = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndLaunch", com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_VOLUME);
}
function playLaunchTooHard() {
oLaunch = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndLaunchTooHard", com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_TOOHARD_VOLUME);
}
function stopLaunch() {
oLaunch.doStop();
oLaunch.doDestroy();
oLaunch = undefined;
}
function startAllWinds() {
if (oWindWeak != undefined) {
oWindWeak.doStop();
}
oWindWeak = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndPlayerWindWeak", com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_WINDWEAK_VOLUME, 99999, true);
oWindWeak.doMute();
if (oWindStrong != undefined) {
oWindStrong.doStop();
}
oWindStrong = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndPlayerWindStrong", com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_WINDSTRONG_VOLUME, 99999, true);
oWindStrong.doMute();
if (oWindBoost != undefined) {
oWindBoost.doStop();
}
oWindBoost = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndPlayerWindBoost", com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_WINDBOOST_VOLUME, 99999, true);
oWindBoost.doMute();
}
function stopAllWinds() {
oWindWeak.doStop();
oWindStrong.doStop();
oWindBoost.doStop();
}
function muteAllWinds() {
oWindWeak.doMute();
oWindStrong.doMute();
oWindBoost.doMute();
}
function playWind(_bStrongWind, _nSpeed) {
if (_nSpeed >= com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MIN_SPEED_FOR_WIND_BOOST) {
playWindBoost();
} else if (_bStrongWind) {
playWindStrong();
} else {
playWindWeak();
}
}
function playWindWeak() {
muteAllWinds();
oWindWeak.doUnMute();
}
function playWindStrong() {
muteAllWinds();
oWindStrong.doUnMute();
}
function playWindBoost() {
muteAllWinds();
oWindBoost.doUnMute();
}
function playLandingBoost() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndLandingBoost", com.disney.gem.games.mulanMushuJungleJump.GameData.nLANDING_BOOST_VOLUME);
}
function playLandingHorizontal() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndLandingHorizontal", com.disney.gem.games.mulanMushuJungleJump.GameData.nLANDING_HORIZONTAL_VOLUME);
}
function playRebound() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndPlayerRebound", com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_REBOUND_VOLUME);
}
function stopAllSFX() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
if (oRocketFuse != undefined) {
stopFuse();
}
if (oLaunch != undefined) {
stopLaunch();
}
if (oObstacle != undefined) {
oObstacle.doStop();
}
if (oBoost != undefined) {
oBoost.doStop();
}
if (oPopup != undefined) {
oPopup.doStop();
}
muteAllWinds();
}
function playHitTree() {
if (oObstacle != undefined) {
oObstacle.doStop();
}
oObstacle = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndHitTree", com.disney.gem.games.mulanMushuJungleJump.GameData.nHIT_TREE_VOLUME);
}
function playHitBanner() {
if (oObstacle != undefined) {
oObstacle.doStop();
}
oObstacle = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndHitBanner", com.disney.gem.games.mulanMushuJungleJump.GameData.nHIT_BANNER_VOLUME);
}
function playHorseBoost() {
if (oBoost != undefined) {
oBoost.doStop();
}
oBoost = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndHorseBoost", com.disney.gem.games.mulanMushuJungleJump.GameData.nBOOST_HORSE_VOLUME);
}
function playFireworksBoost() {
if (oBoost != undefined) {
oBoost.doStop();
}
oBoost = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndFireworksBoost", com.disney.gem.games.mulanMushuJungleJump.GameData.nBOOST_FIREWORKS_VOLUME);
}
function playEndPopup() {
oPopup = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndEndPopup", com.disney.gem.games.mulanMushuJungleJump.GameData.nENDPOPUP_VOLUME);
}
function playPackMusic() {
if (oMusicInGame != undefined) {
oMusicInGame.doFadeTo(0, true);
}
oMusicPack = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_MUSIC, "musicPack", 0, 9999, true);
oMusicPack.doFadeTo(com.disney.gem.games.mulanMushuJungleJump.GameData.nMUSIC_PACK_VOLUME, false);
}
function playInGameMusic() {
if (oMusicPack != undefined) {
oMusicPack.doFadeTo(0, true);
}
oMusicInGame = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_MUSIC, "musicInGame", 0, 9999, true);
oMusicInGame.doFadeTo(com.disney.gem.games.mulanMushuJungleJump.GameData.nMUSIC_GAME_VOLUME, false);
}
function playTransition() {
if (oTransition != undefined) {
oTransition.doStop();
}
oTransition = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndTransition", com.disney.gem.games.mulanMushuJungleJump.GameData.nTRANSIT_VOLUME, 1, true);
}
}
Symbol 850 MovieClip [__Packages.com.sarbakan.sound.SoundItem] Frame 0
class com.sarbakan.sound.SoundItem
{
var sndObj, sLinkage, mcRef, nRemainingLoop, nCurrentVolume, nTargetVolume, nFadeRate, sCategory, bFadeAtEnd, bMuted, bPaused, bNeedFreshStart, nCurrentTime, aEventListeners, bStopAfterFade;
function SoundItem (_sndObject, _sLinkage, _nVolume, _nLoop, _sCategory, _mc) {
sndObj = _sndObject;
sLinkage = _sLinkage;
mcRef = _mc;
nRemainingLoop = _nLoop;
nCurrentVolume = _nVolume;
nTargetVolume = _nVolume;
nFadeRate = nFADE_RATE;
sCategory = _sCategory;
bFadeAtEnd = false;
bMuted = false;
bPaused = false;
bNeedFreshStart = false;
sndObj.onSoundComplete = com.sarbakan.utils.Delegate.create(this, doSoundComplete);
doStart(_nLoop);
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
nCurrentTime = 0;
aEventListeners = new Array();
}
function doEnterFrame() {
if (!bPaused) {
if (nCurrentTime > sndObj.position) {
nRemainingLoop--;
}
nCurrentTime = sndObj.position;
}
doCheckFadeAtEnd();
doManageFade();
}
function doAddListener(_oListener) {
aEventListeners.push(_oListener);
}
function doRemoveListener(_oListener) {
var _local2 = 0;
while (_local2 < aEventListeners.length) {
if (aEventListeners[_local2] == _oListener) {
delete aEventListeners[_local2];
aEventListeners.splice(_local2, 1);
}
_local2++;
}
}
function doSoundComplete() {
if (bNeedFreshStart && (nRemainingLoop > 1)) {
sndObj.start(0, nRemainingLoop - 1);
} else {
doManageEndEvent();
}
}
function doUpdateSound() {
sndObj.setVolume(returnComputedVolume(nCurrentVolume));
}
function doMute() {
bMuted = true;
doUpdateSound();
}
function doUnMute() {
bMuted = false;
doUpdateSound();
}
function doPause() {
sndObj.stop();
bPaused = true;
}
function doResume() {
bPaused = false;
bNeedFreshStart = true;
sndObj.start(nCurrentTime / 1000, 1);
}
function doStart(_nLoop) {
if (_nLoop == undefined) {
_nLoop = 1;
}
if (sLinkage.indexOf(".mp3") != -1) {
sndObj.start(0.015, _nLoop);
} else {
sndObj.start(0, _nLoop);
}
}
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 = nFADE_RATE;
}
nFadeRate = _nRate;
}
function setFadeAtEnd(_bFadeAtEnd) {
bFadeAtEnd = true;
}
function setPan(_nPan) {
sndObj.setPan(_nPan);
}
function get Category() {
return(sCategory);
}
function get LinkageName() {
return(sLinkage);
}
function doDestroy() {
sndObj.stop();
delete sndObj;
mcRef.removeMovieClip();
}
function doCheckFadeAtEnd() {
if (bFadeAtEnd) {
if (nRemainingLoop == 1) {
if ((sndObj.duration - nCurrentTime) <= nFADE_AT_END_TIME) {
doFadeTo(0);
}
}
}
}
function doManageEndEvent() {
var _local2 = 0;
while (_local2 < aEventListeners.length) {
aEventListeners[_local2].doSoundEvent(com.sarbakan.sound.SoundManager.nEVENT_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.sarbakan.sound.SoundManager.isCategoryMuted(sCategory))) {
var _local3 = com.sarbakan.sound.SoundManager.__get__MasterVolume() / 100;
var _local4 = com.sarbakan.sound.SoundManager.getCategoryVolume(sCategory) / 100;
_local2 = _nVolume;
_local2 = _local2 * _local4;
_local2 = _local2 * _local3;
} else {
_local2 = 0;
}
return(_local2);
}
static var nFADE_RATE = 8;
static var nFADE_AT_END_TIME = 800;
}
Symbol 851 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 852 MovieClip [__Packages.com.sarbakan.sound.SoundManager] Frame 0
class com.sarbakan.sound.SoundManager
{
static var aSounds, mcAttach, nSoundNum, aSoundCategories, nMasterVolume, oEnterFrameListener;
function SoundManager () {
}
static function doPlaySound(_sLinkage, _nVolume, _nLoop, _bUnique) {
return(doPlaySoundInCat(sDEFAULT_CATEGORY, _sLinkage, _nVolume, _nLoop, _bUnique));
}
static function doPlaySoundInCat(_sCategoryName, _sLinkage, _nVolume, _nLoop, _bUnique) {
doCheckInit();
var _local1;
if (NewSoundAllowed) {
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_nLoop == undefined) {
_nLoop = 1;
}
if (_bUnique == undefined) {
_bUnique = false;
}
var _local2;
if (_bUnique) {
var _local4 = isSoundPlaying(_sLinkage);
if (_local4.bPlaying) {
_local2 = false;
_local1 = _local4.oSound;
} else {
_local2 = true;
}
} else {
_local2 = true;
}
if (_local2) {
doManageCategory(_sCategoryName);
var _local5 = getMCForSound();
var _local3 = new Sound(_local5);
_local3.attachSound(_sLinkage);
if (_local3.duration != undefined) {
_local1 = new com.sarbakan.sound.SoundItem(_local3, _sLinkage, _nVolume, _nLoop, _sCategoryName, _local5);
}
_local1.doAddListener(com.sarbakan.sound.SoundManager);
aSounds.push(_local1);
}
}
return(_local1);
}
static function isSoundPlaying(_sLinkageName) {
var _local2 = new Object();
_local2.bPlaying = false;
_local2.oSound = undefined;
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
if (aSounds[_local1].LinkageName == _sLinkageName) {
_local2.oSound = aSounds[_local1];
_local2.bPlaying = true;
}
_local1--;
}
return(_local2);
}
function getPlayingQty(_sLinkageName) {
var _local2 = 0;
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
if (aSounds[_local1].LinkageName == _sLinkageName) {
_local2++;
}
_local1--;
}
return(_local2);
}
static function doManageExternalSound(_oSound) {
doCheckInit();
doManageCategory(_oSound.__get__Category());
_oSound.doAddListener(com.sarbakan.sound.SoundManager);
aSounds.push(_oSound);
}
static function getMCForSound() {
var _local1 = getNextDepth();
var _local2 = mcAttach.createEmptyMovieClip("Snd" + _local1, _local1);
return(_local2);
}
static function getNextDepth() {
nSoundNum++;
return(nSoundNum);
}
static function doInit(_mcAttach) {
if (!bInited) {
mcAttach = _mcAttach;
bInited = true;
nSoundNum = 0;
aSounds = new Array();
aSoundCategories = new Array();
nMasterVolume = 100;
mx.transitions.OnEnterFrameBeacon.init();
oEnterFrameListener = new Object();
oEnterFrameListener.onEnterFrame = com.sarbakan.utils.Delegate.create(com.sarbakan.sound.SoundManager, doEnterFrame);
MovieClip.addListener(oEnterFrameListener);
}
}
static function doEnterFrame() {
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
aSounds[_local1].doEnterFrame();
_local1--;
}
}
static function setCategoryVolume(_sCategoryName, _nVol) {
doManageCategory(_sCategoryName);
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
aSoundCategories[_local1].nVolume = _nVol;
}
_local1--;
}
doUpdateAllSoundsVolume();
}
static function getCategoryVolume(_sCategoryName) {
doManageCategory(_sCategoryName);
var _local2;
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
_local2 = aSoundCategories[_local1].nVolume;
}
_local1--;
}
return(_local2);
}
static function isCategoryMuted(_sCategoryName) {
doManageCategory(_sCategoryName);
var _local2;
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
_local2 = aSoundCategories[_local1].bMuted;
}
_local1--;
}
return(_local2);
}
static function doSoundEvent(_nEvent, _oSound) {
if (!(_nEvent === nEVENT_SOUND_COMPLETE)) {
} else {
var _local2 = false;
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
if (!_local2) {
if (aSounds[_local1] == _oSound) {
_local2 = true;
delete aSounds[_local1];
aSounds.splice(Number(_local1), 1);
}
}
_local1--;
}
}
}
static function doMuteCategory(_sCategoryName) {
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
aSoundCategories[_local1].bMuted = true;
}
_local1--;
}
doUpdateAllSoundsVolume();
}
static function doUnMuteCategory(_sCategoryName) {
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
if (aSoundCategories[_local1].sName == _sCategoryName) {
aSoundCategories[_local1].bMuted = false;
}
_local1--;
}
doUpdateAllSoundsVolume();
}
static function setMasterVolume(_nVol) {
nMasterVolume = _nVol;
doUpdateAllSoundsVolume();
}
static function get NewSoundAllowed() {
return(aSounds.length < nMAX_SOUNDS_PLAYING);
}
static function get MasterVolume() {
return(nMasterVolume);
}
static function doRemoveListenerFromAllSounds(_oListener) {
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
aSounds[_local1].doRemoveListener(_oListener);
_local1--;
}
}
static function doDestroy() {
doRemoveListenerFromAllSounds();
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
aSounds[_local1].doDestroy();
_local1--;
}
mcAttach.removeMovieClip();
delete mcAttach;
nSoundNum = 0;
bInited = false;
nMasterVolume = 100;
delete aSounds;
delete aSoundCategories;
delete oEnterFrameListener;
}
static function get Inited() {
return(bInited);
}
static function doUpdateAllSoundsVolume() {
var _local1 = aSounds.length - 1;
while (_local1 >= 0) {
aSounds[_local1].doUpdateSound();
_local1--;
}
}
static function doCheckInit() {
if (!bInited) {
}
}
static function doManageCategory(_sCategoryName) {
doCheckInit();
var _local2 = false;
var _local1 = aSoundCategories.length - 1;
while (_local1 >= 0) {
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 nEVENT_SOUND_COMPLETE = 1;
static var sDEFAULT_CATEGORY = "SFX";
static var nMAX_SOUNDS_PLAYING = 32;
static var bInited = false;
}
Symbol 853 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 854 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 855 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 856 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.GameData] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.GameData
{
function GameData () {
}
static var bCHEATS = false;
static var STG_FPS = 30;
static var nSTG_HEIGHT = 410;
static var nSTG_WIDTH = 580;
static var bUSE_METRIC_SYSTEM = true;
static var sMETRIC_UNIT = "m";
static var sIMPERIAL_UNIT = "ft";
static var sCAT_SOUND = "SFX";
static var nSOUND_CAT_VOLUME = 85;
static var sCAT_MUSIC = "Music";
static var nMUSIC_CAT_VOLUME = 60;
static var nMUSIC_PACK_VOLUME = 70;
static var nMUSIC_GAME_VOLUME = 55;
static var nTRANSIT_VOLUME = 60;
static var nBUTTON_CLICK_VOLUME = 70;
static var nBUTTON_OVER_VOLUME = 60;
static var nROCKETFUSE_VOLUME = 20;
static var nLAUNCH_FAILED_VOLUME = 55;
static var nLAUNCH_STRETCH_MAX_VOLUME = 65;
static var nLAUNCH_STRETCH_MIN_VOLUME = 20;
static var nLAUNCH_VOLUME = 70;
static var nLAUNCH_TOOHARD_VOLUME = 90;
static var nPLAYER_REBOUND_VOLUME = 90;
static var nPLAYER_WINDWEAK_VOLUME = 70;
static var nPLAYER_WINDSTRONG_VOLUME = 70;
static var nPLAYER_WINDBOOST_VOLUME = 70;
static var nPLAYER_MIN_SPEED_FOR_WIND_BOOST = 55;
static var nHIT_TREE_VOLUME = 110;
static var nHIT_BANNER_VOLUME = 100;
static var nBOOST_HORSE_VOLUME = 100;
static var nBOOST_FIREWORKS_VOLUME = 120;
static var nLANDING_BOOST_VOLUME = 120;
static var nLANDING_HORIZONTAL_VOLUME = 120;
static var nENDPOPUP_VOLUME = 60;
static var nBACKGROUND_DEPTH = 10;
static var nBGPARALLAX_DEPTH = 10;
static var nLAUNCH_LIMIT1 = 122;
static var nLAUNCH_LIMIT2 = 80;
static var nLAUNCH_LIMIT3 = 30;
static var nMAX_BUNGEE_RESISTANCE = 0.68;
static var nMIN_BUNGEE_RESISTANCE = 0.5;
static var nMAX_REWIND_FORCE = 2.5;
static var nMAX_BUNGEE_REWIND = -3.55;
static var nMIN_BUNGEE_REWIND = -0.001;
static var nLAUNCH_MAX_ANGLE = -50;
static var nLAUNCH_MIN_ANGLE = -30;
static var nLAUNCH_MAX_SPEED = 100;
static var nLAUNCH_MIN_SPEED = 60;
static var nPLAYER_TURN_ANGLE_MIN = 1.2;
static var nPLAYER_TURN_ANGLE_MAX = 5;
static var nPLAYER_MAX_ANGLE = 60;
static var nPLAYER_MIN_ANGLE = -60;
static var nPLAYER_ANGLE_FASTTOSLOW = -20;
static var nPLAYER_ANGLE_SLOWTOFAST = 20;
static var nGRAVITY = 1.3;
static var nAIR_FRICTION_MIN = -0.06;
static var nAIR_FRICTION_MAX = -0.4;
static var nGROUND_FRICTION = -2;
static var nPLAYER_MAX_SPEED_X = 100;
static var nPLAYER_MAX_SPEED_Y = 100;
static var nPLAYER_MIN_SPEED_X = 0.5;
static var nPLAYER_MIN_SPEED_Y = 0.5;
static var nPLAYER_MAX_TOTAL_SPEED = 100;
static var nPLAYER_MIN_TOTAL_SPEED = 0;
static var nPLAYER_MIN_ANGLE_TO_CRASH_V = 40;
static var nPLAYER_MIN_SPEEDX_TO_REBOUND = 80;
static var nGROUND_Y = 340;
static var nREBOUND_SPEED = -20;
static var nPLAYER_MAX_ALTITUDE = -3200;
static var nTIME_FOR_NEW_SMOKE_TRAIL = 3;
static var nOBS_FIREWORKS_SPEED_BOOST = 1.45;
static var nOBS_HORSE_SPEED_BOOST = 1.1;
static var nOBS_FIREWORKS_ANGLE = -50;
static var nOBS_HORSE_ANGLE = -30;
static var sLINKAGE_NAME_TREE = "mcTree";
static var sLINKAGE_NAME_BANNER = "mcBanner";
static var sLINKAGE_NAME_FIREWORKS = "mcFireworks";
static var sLINKAGE_NAME_HORSE = "mcHorse";
static var nMIN_DIST_TO_ADD_OBS = 3000;
static var nMAX_DIST_TO_ADD_OBS = 5000;
static var nPERCENT_BOOST_OBSTACLE = 0.5;
static var nPERCENT_FIREWORKS_OBSTACLE = 0.6;
static var nPERCENT_BANNER_OBSTACLE = 0.5;
}
Symbol 857 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 858 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 859 MovieClip [__Packages.com.disney.gem.games.GameContainer] Frame 0
interface com.disney.gem.games.GameContainer
{
}
Symbol 860 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 861 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 862 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.Controller] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.Controller extends com.sarbakan.BaseDisneyController
{
var bDeleteOldGame, oSoundPlayer, sGameStep, disallowInstructions, pause, showPopup, mcTimeline, showScreen, allowInstructions, bPaused, unpause, onGameStart, oGame, oMainBroadcaster, nGamePhase, hideCurrentScreen, getScore, setScore, onLevelEnd, onGameEnd, setGamePhase, onLevelStart, oTransitionManager;
function Controller (_mcTimeline, _oPreloaderScreen) {
super(_mcTimeline, _oPreloaderScreen);
bDeleteOldGame = false;
com.sarbakan.sound.SoundManager.doInit(_mcTimeline.mcSound);
com.sarbakan.sound.SoundManager.setCategoryVolume(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_MUSIC, com.disney.gem.games.mulanMushuJungleJump.GameData.nMUSIC_CAT_VOLUME);
com.sarbakan.sound.SoundManager.setCategoryVolume(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, com.disney.gem.games.mulanMushuJungleJump.GameData.nSOUND_CAT_VOLUME);
oSoundPlayer = new com.disney.gem.games.mulanMushuJungleJump.SoundPlayer("oSoundPlayer");
}
static function getInstance() {
return(com.disney.gem.games.mulanMushuJungleJump.Controller(com.sarbakan.BaseDisneyController.oInstance));
}
function init() {
super.init();
sGameStep = sSTEP_INIT;
manageGameStep();
}
function manageGameStep() {
this[sGameStep]();
}
function callPopup(_sPopupName) {
switch (_sPopupName) {
case "Menu" :
oSoundPlayer.stopAllSFX();
disallowInstructions();
pause();
showPopup(new com.disney.gem.games.mulanMushuJungleJump.popups.MenuPopup(mcTimeline.mcPopups.mcMenu), true);
break;
case "Quit" :
showPopup(new com.disney.gem.games.mulanMushuJungleJump.popups.ConfirmPopup(mcTimeline.mcPopups.mcQuitConfirm));
break;
case "LevelCompleted" :
pause();
showPopup(new com.disney.gem.games.mulanMushuJungleJump.popups.LevelCompleted(mcTimeline.mcPopups.mcLevelCompleted), true);
break;
}
}
function showTitleScreen(_bShowTransition) {
if (_bShowTransition) {
showScreen(new com.disney.gem.games.mulanMushuJungleJump.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), true, sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.mulanMushuJungleJump.screens.TitleScreen(mcTimeline.mcScreens.mcTitle));
}
allowInstructions();
}
function startNewGame() {
if (bPaused) {
unpause();
}
sGameStep = sSTEP_INITGAME;
onGameStart();
manageGameStep();
}
function createGame() {
if (oGame == undefined) {
oGame = new com.disney.gem.games.mulanMushuJungleJump.GameEngine(this, mcTimeline.mcGame);
oMainBroadcaster.addListener(oGame);
oGame.init();
}
}
function startNextLevel() {
sGameStep = sSTEP_SHOWLEVELCOMPLETED;
manageGameStep();
}
function showInstructionsScreen() {
oSoundPlayer.stopAllSFX();
pause();
showScreen(new com.disney.gem.games.mulanMushuJungleJump.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false, sTRANSITION_DEFAULT);
}
function hideInstructionsScreen() {
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
unpause();
hideCurrentScreen(null, sTRANSITION_DEFAULT);
} else {
startNewGame();
}
}
function checkDistance() {
var _local2 = oGame.__get__LastDistance();
if (getScore() < _local2) {
setScore(_local2);
oGame.updateMaxDistance(getScore());
}
}
function onLevelTransitionClose() {
hideCurrentScreen();
pause();
manageGameStep();
}
function onLevelTransitionDone() {
}
function onGameQuit() {
oSoundPlayer.stopAllSFX();
allowInstructions();
oSoundPlayer.stopAllWinds();
oSoundPlayer.playPackMusic();
setScore(0);
onLevelEnd();
onGameEnd();
oGame.deleteObject();
showScreen(new com.disney.gem.games.mulanMushuJungleJump.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, setGamePhase, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
if (bPaused) {
unpause();
}
}
function step_Init() {
com.sarbakan.BaseDisneyController.oInstance = this;
sGameStep = sSTEP_TITLE_SCREEN;
manageGameStep();
}
function step_TitleScreen() {
oSoundPlayer.playPackMusic();
showTitleScreen(false);
}
function step_initGame() {
sGameStep = sSTEP_GAME;
if (bDeleteOldGame) {
bDeleteOldGame = false;
sGameStep = sSTEP_DELETEGAME;
}
onLevelStart();
oTransitionManager.playTransition("default", com.sarbakan.utils.Delegate.create(this, onLevelTransitionClose), com.sarbakan.utils.Delegate.create(this, onLevelTransitionDone));
}
function step_deleteOldGame() {
oGame.deleteObject();
sGameStep = sSTEP_GAME;
manageGameStep();
}
function step_Game() {
oSoundPlayer.playInGameMusic();
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
createGame();
sGameStep = sSTEP_LAUNCH;
manageGameStep();
}
function step_LaunchPhase() {
oSoundPlayer.stopAllSFX();
unpause();
onLevelStart();
sGameStep = sSTEP_AIR;
}
function step_AirPhase() {
oGame.deleteLauncher();
oGame.allowControls();
oGame.showPlayer(true);
sGameStep = sSTEP_SHOWLEVELCOMPLETED;
}
function step_showLevelCompleted() {
oSoundPlayer.stopAllSFX();
oSoundPlayer.stopAllWinds();
oSoundPlayer.playEndPopup();
checkDistance();
sGameStep = sSTEP_RESETGAME;
callPopup("LevelCompleted");
}
function step_ResetGame() {
pause();
sGameStep = sSTEP_INITGAME;
bDeleteOldGame = true;
manageGameStep();
}
function step_ResetPlayer() {
oGame.resetPlayer();
}
function step_ResetDone() {
}
static var sTRANSITION_DEFAULT = "default";
static var sSTEP_INIT = "step_Init";
static var sSTEP_TITLE_SCREEN = "step_TitleScreen";
static var sSTEP_GAME = "step_Game";
static var sSTEP_INITGAME = "step_initGame";
static var sSTEP_DELETEGAME = "step_deleteOldGame";
static var sSTEP_LAUNCH = "step_LaunchPhase";
static var sSTEP_AIR = "step_AirPhase";
static var sSTEP_RESETGAME = "step_ResetGame";
static var sSTEP_RESET_DONE = "step_ResetDone";
static var sSTEP_RESETPLAYER = "step_ResetPlayer";
static var sSTEP_STARTNEXTLEVEL = "step_startNextLevel";
static var sSTEP_SHOWLEVELCOMPLETED = "step_showLevelCompleted";
static var sSTEP_LOSE = "step_Lose";
static var sSTEP_WIN = "step_Win";
}
Symbol 863 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.GameEngine] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.GameEngine
{
var oController, mcGame, oHud, oPlayer, oLaunchManager, oCameraShaker, oBGManager, oCam, oTrailManager, oObstacleManager;
function GameEngine (_oController, _mcGame) {
oController = _oController;
mcGame = _mcGame;
createPlayer();
oHud = new com.disney.gem.games.mulanMushuJungleJump.game.Hud(mcGame.mcHud, oPlayer, "oHud", this);
oHud.updateDistance(0);
oHud.updateMaxDistance(oController.getScore());
oLaunchManager = new com.disney.gem.games.mulanMushuJungleJump.game.LaunchManager(mcGame.mcBg.mcLauncher, mcGame.mcBg.mcLauncherShadow, oPlayer, "oLaunchManager", this);
oCameraShaker = new com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.CameraShaker(mcGame.mcBg, mcGame.mcBg.mcLauncher, "oCameraShaker", this);
oBGManager = new com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.BGManager(mcGame.mcBg, "oBGManager", this);
oCam = new com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.Cam(mcGame.mcBg, mcGame.mcBgParallaxCtn, "oCam", this);
oTrailManager = new com.disney.gem.games.mulanMushuJungleJump.game.TrailManager(mcGame.mcBg, oPlayer, "oTrailManager", this);
oObstacleManager = new com.disney.gem.games.mulanMushuJungleJump.game.obstacles.ObstacleManager(mcGame.mcBg.mcObstacleItems, mcGame.mcBg, oPlayer, oHud, "oObstacleManager", this);
mcGame.mcHud.btMenu.onRelease = com.sarbakan.utils.Delegate.create(this, onBtMenu);
}
function init() {
}
function updateMaxDistance(_nDistance) {
oHud.updateMaxDistance(_nDistance);
}
function allowControls() {
oPlayer.unlockControls();
}
function showPlayer(_bShow) {
if (_bShow) {
oPlayer.__get__Mc()._visible = true;
oPlayer.startFlying();
} else {
oPlayer.__get__Mc()._visible = false;
oPlayer.setState(com.disney.gem.games.mulanMushuJungleJump.game.Player.sSTATE_HIDDEN);
}
}
function resetPlayer() {
oPlayer.resetPlayer();
}
function showHudCricketSad() {
oHud.updateCricketFace(com.disney.gem.games.mulanMushuJungleJump.game.CricketHud.sSTATE_MISS);
}
function deleteShaker() {
oCameraShaker.deleteObject();
}
function deleteLauncher() {
oLaunchManager.deleteObject();
}
function deleteObject() {
oHud.deleteObject();
oLaunchManager.deleteObject();
oPlayer.deleteObject();
oCam.deleteObject();
oBGManager.deleteObject();
oTrailManager.deleteObject();
oObstacleManager.deleteObject();
oCameraShaker.deleteObject();
delete oController.oGame;
}
function onUpdate() {
if (oPlayer.__get__IsLaunched()) {
oCam.setScrollingSpeed(oPlayer.__get__AbsoluteX(), oPlayer.__get__AbsoluteY());
if (!oPlayer.__get__IsHitting()) {
oHud.updateDistance(oPlayer.__get__Distance());
}
}
}
function onBtMenu() {
oController.callPopup("Menu");
}
function createPlayer() {
var _local2 = mcGame.mcBg.mcPlayerItem.attachMovie("mcPlayer", "mcPlayer", mcGame.mcBg.mcPlayerItem.getNextHighestDepth(), {_x:0, _y:0});
oPlayer = new com.disney.gem.games.mulanMushuJungleJump.game.Player(_local2, "oPlayer", this);
}
function get Mc() {
return(mcGame);
}
function get LastDistance() {
return(oPlayer.__get__Distance());
}
function get getTrailManager() {
return(oTrailManager);
}
}
Symbol 864 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.Hud] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.Hud extends com.sarbakan.utils.StateManaged
{
var oPlayer, sName, oOwner, oController, oAltitudeGauge, mcRef, oCricketHud, sUnit;
function Hud (_mcRef, _oPlayer, _sName, _oOwner) {
super(_mcRef);
oPlayer = _oPlayer;
sName = _sName;
oOwner = _oOwner;
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oAltitudeGauge = new com.disney.gem.games.mulanMushuJungleJump.game.AltitudeGauge(mcRef.mcAltitude, oPlayer, "oAltitudeGauge", this);
oCricketHud = new com.disney.gem.games.mulanMushuJungleJump.game.CricketHud(mcRef.mcCricketHead, "oCricketHud", this);
if (com.disney.gem.games.mulanMushuJungleJump.GameData.bUSE_METRIC_SYSTEM) {
sUnit = com.disney.gem.games.mulanMushuJungleJump.GameData.sMETRIC_UNIT;
} else {
sUnit = com.disney.gem.games.mulanMushuJungleJump.GameData.sIMPERIAL_UNIT;
}
}
function updateDistance(_nDist) {
mcRef.mcDistances.txtCurrentDist.text = (com.sarbakan.utils.Tools.getFormatedNumber(_nDist, 1) + " ") + sUnit;
}
function updateMaxDistance(_nDist) {
mcRef.mcDistances.txtMaxDist.text = (com.sarbakan.utils.Tools.getFormatedNumber(_nDist, 1) + " ") + sUnit;
}
function updateCricketFace(_sState) {
oCricketHud.changeFace(_sState);
}
function deleteObject() {
oCricketHud.deleteObject();
oAltitudeGauge.deleteObject();
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
}
Symbol 865 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.Player] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.Player extends com.sarbakan.utils.StateManaged
{
var oOwner, sName, nPosX, nPosY, nStartX, nSpdX, nSpdY, nSpeed, nAngle, nOldAngle, nGravity, nGravityAngle, nAirFriction, nTimeAddSmoke, nLastDistance, nSmokeAngle, nSmokeDistance, bAllowControls, bRebounding, oKeyboardManager, nVerticalDir, bOnGround, bInAir, bIsBoosting, oController, setState, bIsHitting, mcRef, stateFinished, getState, sState;
function Player (_mcRef, _sName, _oOwner) {
super(_mcRef);
oOwner = _oOwner;
sName = _sName;
nPosX = 0;
nPosY = 0;
nStartX = 0;
nSpdX = 0;
nSpdY = 0;
nSpeed = 0;
nAngle = 0;
nOldAngle = 0;
nGravity = 0;
nGravityAngle = 0;
nAirFriction = 0;
nTimeAddSmoke = 0;
nLastDistance = 0;
nSmokeAngle = 0;
nSmokeDistance = 0;
bAllowControls = false;
bRebounding = false;
oKeyboardManager = new com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager();
oKeyboardManager.addArrowKeys();
oKeyboardManager.addKey(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_2);
oKeyboardManager.addKey(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_8);
nVerticalDir = -1;
bOnGround = false;
bInAir = false;
bIsBoosting = false;
setSmokeDistAngle();
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
setState(sSTATE_HIDDEN);
}
function startFlying() {
setState(sSTATE_FLYSLOW);
bInAir = true;
}
function stopFlying(_bBoost) {
setState(sSTATE_HIDDEN, true);
if (_bBoost) {
bIsBoosting = true;
oController.oSoundPlayer.muteAllWinds();
} else {
oOwner.showHudCricketSad();
bIsHitting = true;
}
nSpeed = 0;
nSpdX = 0;
nSpdY = 0;
}
function resumeFlying(_sFlyingState) {
setState(_sFlyingState);
bIsBoosting = false;
}
function setPosition(_nPosX, _nPosY, _bSetStart) {
nPosX = int(_nPosX * 10) / 10;
if (_nPosY > com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_Y) {
_nPosY = com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_Y;
}
nPosY = int(_nPosY * 10) / 10;
if (_bSetStart) {
nStartX = nPosX;
}
mcRef._x = nPosX;
mcRef._y = nPosY;
}
function setSpeedRotation(_nSpeed, _nRotation) {
nSpeed = _nSpeed;
nAngle = _nRotation;
nSpdX = getSpeedXFromTotal(_nSpeed, _nRotation);
nSpdY = getSpeedYFromTotal(_nSpeed, _nRotation);
applyAngle();
}
function resetPlayer() {
}
function unlockControls() {
bAllowControls = true;
}
function lockControls() {
bAllowControls = false;
}
function deleteObject() {
setState(sSTATE_HIDDEN, true);
mcRef.swapDepths(10);
mcRef.removeMovieClip();
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function state_hidden() {
}
function state_flyFast() {
checkAddSmoke();
oController.oSoundPlayer.playWind(true, nSpeed);
}
function state_flySlow() {
checkAddSmoke();
oController.oSoundPlayer.playWind(false, nSpeed);
}
function state_fastToSlow() {
checkAddSmoke();
oController.oSoundPlayer.playWind(true, nSpeed);
if (stateFinished()) {
setState(sSTATE_FLYSLOW);
}
}
function state_slowToFast() {
checkAddSmoke();
oController.oSoundPlayer.playWind(false, nSpeed);
if (stateFinished()) {
setState(sSTATE_FLYFAST);
}
}
function state_rebound_init() {
oController.oSoundPlayer.playRebound();
}
function state_rebound() {
checkAddSmoke();
applyGroundFriction();
if (stateFinished()) {
bRebounding = false;
nAngle = -1 * nOldAngle;
applyAngle();
nSpdY = com.disney.gem.games.mulanMushuJungleJump.GameData.nREBOUND_SPEED;
unlockControls();
setState(sSTATE_FLYFAST);
}
}
function state_landHorizontal_init() {
oController.oSoundPlayer.stopAllWinds();
oController.oSoundPlayer.playLandingHorizontal();
}
function state_landHorizontal() {
applyGroundFriction();
}
function state_landVertical_init() {
oController.oSoundPlayer.stopAllWinds();
oController.oSoundPlayer.playLandingBoost();
}
function state_landVertical() {
if (stateFinished()) {
mcRef.mcState.stop();
oController.manageGameStep();
}
}
function setSmokeDistAngle() {
nSmokeDistance = Math.sqrt(Math.pow(mcRef.mcSmokeStart._x, 2) + Math.pow(mcRef.mcSmokeStart._y, 2));
nSmokeAngle = getAngleInDegree(Math.atan(Math.abs(mcRef.mcSmokeStart._y) / Math.abs(mcRef.mcSmokeStart._x)));
}
function onUpdate() {
super.onUpdate();
if ((bInAir && (!bIsBoosting)) && (!bIsHitting)) {
if (!bOnGround) {
checkKeys();
applyGravity();
applyAirFriction();
applyAngle();
checkSlowFastAngle();
applyNewSpeedsXY();
doMove();
} else {
doMove();
}
}
}
function checkKeys() {
if (bAllowControls) {
oKeyboardManager.doUpdate(1);
switch (getState()) {
case sSTATE_FLYFAST :
case sSTATE_FLYSLOW :
case sSTATE_FASTTOSLOW :
case sSTATE_SLOWTOFAST :
if (oKeyboardManager.isKeyDown(38) || (oKeyboardManager.isKeyDown(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_8))) {
turnUp();
} else {
if (!(oKeyboardManager.isKeyDown(40) || (oKeyboardManager.isKeyDown(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_2)))) {
break;
}
turnDown();
}
}
}
}
function turnUp() {
var _local2 = 0;
if (nPosY > com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_ALTITUDE) {
nAngle = nAngle - getAngleFromSpeed();
}
}
function turnDown() {
nAngle = nAngle + getAngleFromSpeed();
}
function applyGravity() {
if (!bRebounding) {
var _local3 = getSpeedXFromTotal(nSpeed, nAngle);
var _local2 = getSpeedYFromTotal(nSpeed, nAngle);
_local2 = _local2 + com.disney.gem.games.mulanMushuJungleJump.GameData.nGRAVITY;
setNewSpeedAngle(_local3, _local2);
}
}
function applyGroundFriction() {
nSpdX = nSpdX + com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_FRICTION;
if (nSpdX <= com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MIN_SPEED_X) {
nSpdX = 0;
oController.manageGameStep();
}
}
function applyAirFriction() {
var _local2 = getSpeedXFromTotal(nSpeed, nAngle);
var _local4 = getSpeedYFromTotal(nSpeed, nAngle);
var _local3 = 0;
_local3 = (Math.abs(Math.sin(getAngleInRadian(nAngle))) * (com.disney.gem.games.mulanMushuJungleJump.GameData.nAIR_FRICTION_MAX - com.disney.gem.games.mulanMushuJungleJump.GameData.nAIR_FRICTION_MIN)) + com.disney.gem.games.mulanMushuJungleJump.GameData.nAIR_FRICTION_MIN;
_local2 = _local2 + _local3;
setNewSpeedAngle(_local2, _local4);
}
function setNewSpeedAngle(_nSpdX, _nSpdY) {
nSpeed = getTotalSpeed(_nSpdX, _nSpdY);
nAngle = getAngleInDegree(Math.atan(_nSpdY / _nSpdX));
}
function checkSlowFastAngle() {
if ((nAngle > com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_ANGLE_SLOWTOFAST) && (sState == sSTATE_FLYSLOW)) {
setState(sSTATE_SLOWTOFAST);
} else if ((nAngle < com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_ANGLE_FASTTOSLOW) && (sState == sSTATE_FLYFAST)) {
setState(sSTATE_FASTTOSLOW);
}
}
function applyAngle() {
if (nAngle < com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MIN_ANGLE) {
nAngle = com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MIN_ANGLE;
} else if (nAngle > com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_ANGLE) {
nAngle = com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_ANGLE;
}
mcRef._rotation = nAngle;
}
function applyNewSpeedsXY() {
nSpdX = getSpeedXFromTotal(nSpeed, nAngle);
nSpdY = getSpeedYFromTotal(nSpeed, nAngle);
}
function doMove() {
nPosX = nPosX + nSpdX;
nPosX = int(nPosX * 10) / 10;
nPosY = nPosY + nSpdY;
if (nPosY < com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_ALTITUDE) {
nPosY = com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_ALTITUDE;
}
nPosY = int(nPosY * 10) / 10;
checkGround();
mcRef._x = nPosX;
mcRef._y = nPosY;
}
function checkAddSmoke() {
nTimeAddSmoke++;
if (nTimeAddSmoke >= com.disney.gem.games.mulanMushuJungleJump.GameData.nTIME_FOR_NEW_SMOKE_TRAIL) {
oOwner.__get__getTrailManager().addSmoke();
nTimeAddSmoke = 0;
}
}
function checkGround() {
if ((nPosY > com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_Y) && (!bRebounding)) {
nPosY = com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_Y;
if (nSpdX >= com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MIN_SPEEDX_TO_REBOUND) {
bRebounding = true;
lockControls();
nOldAngle = nAngle;
nSpdY = 0;
nAngle = 0;
applyAngle();
setState(sSTATE_REBOUND);
} else if (nAngle >= com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MIN_ANGLE_TO_CRASH_V) {
bOnGround = true;
nSpdX = 0;
nSpdY = 0;
setState(sSTATE_LANDVERTIC);
oOwner.showHudCricketSad();
} else {
bOnGround = true;
nSpdY = 0;
nAngle = 0;
applyAngle();
setState(sSTATE_LANDHORIZ);
oOwner.showHudCricketSad();
}
}
}
function getAngleFromSpeed() {
var _local2 = 0;
var _local3 = (nSpeed - com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MIN_TOTAL_SPEED) / (com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_TOTAL_SPEED - com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MIN_TOTAL_SPEED);
_local2 = (_local3 * (com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_TURN_ANGLE_MAX - com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_TURN_ANGLE_MIN)) + com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_TURN_ANGLE_MIN;
return(_local2);
}
function getTotalSpeed(_nSpdX, _nSpdY) {
var _local1 = Math.sqrt(Math.pow(_nSpdX, 2) + Math.pow(_nSpdY, 2));
return(_local1);
}
function getSpeedXFromTotal(_nSpeed, _nAngle) {
var _local2 = Math.abs(_nSpeed * Math.cos(Math.abs(getAngleInRadian(_nAngle))));
if (_local2 > com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_SPEED_X) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_SPEED_X;
}
return(_local2);
}
function getSpeedYFromTotal(_nSpeed, _nAngle) {
var _local2 = _nSpeed * Math.sin(Math.abs(getAngleInRadian(_nAngle)));
if ((_nAngle < 0) && (_local2 > 0)) {
_local2 = -1 * _local2;
}
if (_local2 > com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_SPEED_Y) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_SPEED_Y;
} else if (_local2 < (-1 * com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_SPEED_Y)) {
_local2 = -1 * com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_SPEED_Y;
}
return(_local2);
}
function get Speed() {
return(nSpeed);
}
function get SpeedX() {
return(nSpdX);
}
function get SpeedY() {
return(nSpdY);
}
function get AbsoluteX() {
return(oOwner.__get__Mc().mcBg._x + nPosX);
}
function get AbsoluteY() {
return(oOwner.__get__Mc().mcBg._y + nPosY);
}
function get PosX() {
return(nPosX);
}
function get PosY() {
return(nPosY);
}
function get IsLaunched() {
return(bInAir);
}
function get IsHitting() {
return(bIsHitting);
}
function get IsRebounding() {
return(bRebounding);
}
function get IsOnGround() {
return(bOnGround);
}
function get Distance() {
var _local2 = 0;
if (bIsHitting) {
_local2 = nLastDistance;
} else {
_local2 = Math.round(nPosX - nStartX);
nLastDistance = _local2;
}
return(_local2);
}
function get Rotation() {
return(nAngle);
}
function get SmokeDistance() {
return(nSmokeDistance);
}
function get SmokeAngle() {
return(nSmokeAngle);
}
function getAngleInRadian(_nAngle) {
var _local1 = (_nAngle * Math.PI) / 180;
return(_local1);
}
function getAngleInDegree(_nRad) {
var _local1 = (_nRad * 180) / Math.PI;
return(_local1);
}
static var sSTATE_HIDDEN = "hidden";
static var sSTATE_FLYFAST = "flyFast";
static var sSTATE_FLYSLOW = "flySlow";
static var sSTATE_FASTTOSLOW = "fastToSlow";
static var sSTATE_SLOWTOFAST = "slowToFast";
static var sSTATE_LANDHORIZ = "landHorizontal";
static var sSTATE_LANDVERTIC = "landVertical";
static var sSTATE_REBOUND = "rebound";
}
Symbol 866 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager
{
var aKeyNextId, bAnyKeyPress, aKeyId, aKeyMap, aKeyStates;
function KeyboardManager () {
aKeyNextId = 0;
bAnyKeyPress = false;
aKeyId = new Array();
aKeyMap = new Array();
aKeyStates = new Array();
}
function doUpdate(_nDeltaTime) {
var _local4;
bAnyKeyPress = false;
for (var _local2 in aKeyMap) {
if (Key.isDown(aKeyMap[_local2])) {
if (aKeyStates[_local2] == nKEY_UP) {
aKeyStates[_local2] = nKEY_PRESS;
bAnyKeyPress = true;
} else {
aKeyStates[_local2] = aKeyStates[_local2] + _nDeltaTime;
}
} else {
aKeyStates[_local2] = nKEY_UP;
}
}
}
function addKey(_nKeyCode) {
aKeyId[String(_nKeyCode)] = aKeyNextId;
aKeyMap[aKeyNextId] = _nKeyCode;
aKeyStates[aKeyNextId] = nKEY_UP;
aKeyNextId++;
}
function addArrowKeys() {
addKey(38);
addKey(40);
addKey(37);
addKey(39);
}
function addLetterKeys() {
addKey(nKEY_US_Q);
addKey(nKEY_US_W);
addKey(nKEY_US_E);
addKey(nKEY_US_R);
addKey(nKEY_US_T);
addKey(nKEY_US_Y);
addKey(nKEY_US_U);
addKey(nKEY_US_I);
addKey(nKEY_US_O);
addKey(nKEY_US_P);
addKey(nKEY_US_A);
addKey(nKEY_US_S);
addKey(nKEY_US_D);
addKey(nKEY_US_F);
addKey(nKEY_US_G);
addKey(nKEY_US_H);
addKey(nKEY_US_J);
addKey(nKEY_US_K);
addKey(nKEY_US_L);
addKey(nKEY_US_Z);
addKey(nKEY_US_X);
addKey(nKEY_US_C);
addKey(nKEY_US_V);
addKey(nKEY_US_B);
addKey(nKEY_US_N);
addKey(nKEY_US_M);
}
function addNumericKeys() {
addKey(nKEY_NUM_0);
addKey(nKEY_NUM_1);
addKey(nKEY_NUM_2);
addKey(nKEY_NUM_3);
addKey(nKEY_NUM_4);
addKey(nKEY_NUM_5);
addKey(nKEY_NUM_6);
addKey(nKEY_NUM_7);
addKey(nKEY_NUM_8);
addKey(nKEY_NUM_9);
addKey(nKEY_US_0);
addKey(nKEY_US_1);
addKey(nKEY_US_2);
addKey(nKEY_US_3);
addKey(nKEY_US_4);
addKey(nKEY_US_5);
addKey(nKEY_US_6);
addKey(nKEY_US_7);
addKey(nKEY_US_8);
addKey(nKEY_US_9);
}
function addSpecialKeys() {
addKey(32);
addKey(8);
addKey(13);
addKey(35);
addKey(36);
addKey(45);
addKey(46);
addKey(34);
addKey(33);
addKey(18);
addKey(17);
addKey(20);
addKey(16);
addKey(27);
addKey(9);
addKey(nKEY_US_WINDOWS_R);
addKey(nKEY_US_WINDOWS_L);
addKey(nKEY_US_MENU);
addKey(nKEY_US_PRINTSCREEN);
addKey(nKEY_US_SCROLLLOCK);
addKey(nKEY_US_PAUSE);
}
function addOperatorKeys() {
addKey(nKEY_NUM_LOCK);
addKey(nKEY_NUM_DIVIDE);
addKey(nKEY_NUM_MULTIPLY);
addKey(nKEY_NUM_MINUS);
addKey(nKEY_NUM_PLUS);
addKey(nKEY_NUM_DOT);
addKey(nKEY_US_SHARP);
addKey(nKEY_US_DASH);
addKey(nKEY_US_EQUALS);
}
function addPunctuationKeys() {
addKey(nKEY_US_CIRC);
addKey(nKEY_US_CEDIL);
addKey(nKEY_US_SEMICOLON);
addKey(nKEY_US_EGRAVE);
addKey(nKEY_US_AGRAVE);
addKey(nKEY_US_COMA);
addKey(nKEY_US_PERIOD);
addKey(nKEY_US_EACUTE);
addKey(nKEY_US_QUOTES);
}
function addFunctionKeys() {
addKey(nKEY_US_F1);
addKey(nKEY_US_F2);
addKey(nKEY_US_F3);
addKey(nKEY_US_F4);
addKey(nKEY_US_F5);
addKey(nKEY_US_F6);
addKey(nKEY_US_F7);
addKey(nKEY_US_F8);
addKey(nKEY_US_F9);
addKey(nKEY_US_F10);
addKey(nKEY_US_F11);
addKey(nKEY_US_F12);
}
function addAllKeys() {
addLetterKeys();
addSpecialKeys();
addOperatorKeys();
addPunctuationKeys();
addFunctionKeys();
addNumericKeys();
addArrowKeys();
}
function clearAllKeys() {
aKeyMap.splice(0);
aKeyId.splice(0);
aKeyStates.splice(0);
}
function isKeyJustPressed(_nKey) {
var _local3 = String(_nKey);
var _local2 = aKeyId[_local3];
if (_local2 == null) {
return(false);
}
return(aKeyStates[_local2] == nKEY_PRESS);
}
function isAnyKeyJustPressed() {
return(bAnyKeyPress);
}
function isKeyDown(_nKey) {
var _local3 = String(_nKey);
var _local2 = aKeyId[_local3];
if (_local2 == null) {
return(false);
}
return(aKeyStates[_local2] >= nKEY_PRESS);
}
function keyHoldTime(_nKey) {
var _local4 = String(_nKey);
var _local2 = aKeyId[_local4];
if (_local2 == null) {
return(0);
}
var _local3 = 0;
if (aKeyStates[_local2] != nKEY_UP) {
_local3 = aKeyStates[_local2];
}
return(_local3);
}
function resetKeys() {
for (var _local2 in aKeyMap) {
aKeyStates[_local2] = nKEY_UP;
}
}
static var nKEY_UP = -1;
static var nKEY_PRESS = 0;
static var nKEY_US_1 = 49;
static var nKEY_US_2 = 50;
static var nKEY_US_3 = 51;
static var nKEY_US_4 = 52;
static var nKEY_US_5 = 53;
static var nKEY_US_6 = 54;
static var nKEY_US_7 = 55;
static var nKEY_US_8 = 56;
static var nKEY_US_9 = 57;
static var nKEY_US_0 = 48;
static var nKEY_US_SHARP = 222;
static var nKEY_US_DASH = 189;
static var nKEY_US_EQUALS = 187;
static var nKEY_NUM_0 = 96;
static var nKEY_NUM_1 = 97;
static var nKEY_NUM_2 = 98;
static var nKEY_NUM_3 = 99;
static var nKEY_NUM_4 = 100;
static var nKEY_NUM_5 = 101;
static var nKEY_NUM_6 = 102;
static var nKEY_NUM_7 = 103;
static var nKEY_NUM_8 = 104;
static var nKEY_NUM_9 = 105;
static var nKEY_NUM_LOCK = 144;
static var nKEY_NUM_DIVIDE = 111;
static var nKEY_NUM_MULTIPLY = 106;
static var nKEY_NUM_MINUS = 109;
static var nKEY_NUM_PLUS = 107;
static var nKEY_NUM_DOT = 110;
static var nKEY_US_Q = 81;
static var nKEY_US_W = 87;
static var nKEY_US_E = 69;
static var nKEY_US_R = 82;
static var nKEY_US_T = 84;
static var nKEY_US_Y = 89;
static var nKEY_US_U = 85;
static var nKEY_US_I = 73;
static var nKEY_US_O = 79;
static var nKEY_US_P = 80;
static var nKEY_US_A = 65;
static var nKEY_US_S = 83;
static var nKEY_US_D = 68;
static var nKEY_US_F = 70;
static var nKEY_US_G = 71;
static var nKEY_US_H = 72;
static var nKEY_US_J = 74;
static var nKEY_US_K = 75;
static var nKEY_US_L = 76;
static var nKEY_US_Z = 90;
static var nKEY_US_X = 88;
static var nKEY_US_C = 67;
static var nKEY_US_V = 86;
static var nKEY_US_B = 66;
static var nKEY_US_N = 78;
static var nKEY_US_M = 77;
static var nKEY_US_CIRC = 219;
static var nKEY_US_CEDIL = 221;
static var nKEY_US_SEMICOLON = 186;
static var nKEY_US_EGRAVE = 192;
static var nKEY_US_AGRAVE = 220;
static var nKEY_US_COMA = 188;
static var nKEY_US_PERIOD = 190;
static var nKEY_US_EACUTE = 191;
static var nKEY_US_QUOTES = 226;
static var nKEY_US_WINDOWS_L = 91;
static var nKEY_US_WINDOWS_R = 92;
static var nKEY_US_MENU = 93;
static var nKEY_US_PRINTSCREEN = 44;
static var nKEY_US_SCROLLLOCK = 145;
static var nKEY_US_PAUSE = 19;
static var nKEY_US_F1 = 112;
static var nKEY_US_F2 = 113;
static var nKEY_US_F3 = 114;
static var nKEY_US_F4 = 115;
static var nKEY_US_F5 = 116;
static var nKEY_US_F6 = 117;
static var nKEY_US_F7 = 118;
static var nKEY_US_F8 = 119;
static var nKEY_US_F9 = 120;
static var nKEY_US_F10 = 121;
static var nKEY_US_F11 = 122;
static var nKEY_US_F12 = 123;
}
Symbol 867 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.AltitudeGauge] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.AltitudeGauge extends com.sarbakan.utils.StateManaged
{
var oPlayer, sName, oOwner, oController, setState, sNextState, sState, mcRef;
function AltitudeGauge (_mcRef, _oPlayer, _sName, _oOwner) {
super(_mcRef);
oPlayer = _oPlayer;
sName = _sName;
oOwner = _oOwner;
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
setState(sSTATE_IDLE, true);
}
function deleteObject() {
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function onUpdate() {
super.onUpdate();
checkAltitude();
}
function checkStateChange() {
if ((sNextState != undefined) && (sNextState != sState)) {
this[("state_" + sState) + "_end"]();
sState = sNextState;
sNextState = undefined;
mcRef.gotoAndStop(sState);
if (sState == sSTATE_MOVING) {
mcRef.mcState.stop();
}
this[("state_" + sState) + "_init"]();
}
}
function checkAltitude() {
switch (sState) {
case sSTATE_IDLE :
if ((oPlayer.__get__Mc()._y < com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_Y) && (oPlayer.__get__IsLaunched())) {
setState(sSTATE_MOVING);
}
break;
case sSTATE_MOVING :
if (oPlayer.__get__Mc()._y >= com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_Y) {
setState(sSTATE_IDLE);
} else {
findFrameAltitude(oPlayer.__get__Mc()._y);
}
}
}
function findFrameAltitude(_nAltitude) {
var _local2 = (com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_Y - _nAltitude) / (com.disney.gem.games.mulanMushuJungleJump.GameData.nGROUND_Y - com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_ALTITUDE);
var _local3 = Math.ceil(Math.abs(_local2) * mcRef.mcState._totalframes);
mcRef.mcState.gotoAndStop(_local3);
}
function state_idle() {
}
function state_moving() {
}
static var sSTATE_IDLE = "idle";
static var sSTATE_MOVING = "moving";
}
Symbol 868 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.CricketHud] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.CricketHud extends com.sarbakan.utils.StateManaged
{
var sName, oOwner, oController, setState, sState;
function CricketHud (_mcRef, _sName, _oOwner) {
super(_mcRef);
sName = _sName;
oOwner = _oOwner;
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
setState(sSTATE_IDLE, true);
}
function changeFace(_sNewState) {
if (sState != sSTATE_MISS) {
setState(_sNewState, true);
}
}
function deleteObject() {
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function state_idle() {
}
function state_boost() {
}
function state_obstacles() {
}
function state_miss() {
}
static var sSTATE_IDLE = "idle";
static var sSTATE_BOOST = "boost";
static var sSTATE_OBSTACLE = "obstacles";
static var sSTATE_MISS = "miss";
}
Symbol 869 MovieClip [__Packages.com.sarbakan.utils.Tools] Frame 0
class com.sarbakan.utils.Tools
{
function Tools () {
}
static function isItemInArray(_aArray, _oItem) {
var _local3 = false;
var _local1 = _aArray.length - 1;
while (_local1 >= 0) {
if (_aArray[_local1] == _oItem) {
_local3 = true;
}
_local1--;
}
return(_local3);
}
static function doCopyArray(_aArraySource) {
var _local3 = new Array();
var _local1 = 0;
_local1 = 0;
while (_local1 < _aArraySource.length) {
if (_aArraySource[_local1] instanceof Array) {
_local3.push(doCopyArray(_aArraySource[_local1]));
} else {
_local3.push(_aArraySource[_local1]);
}
_local1++;
}
return(_local3);
}
static function getFormatedNumber(_nNumber, _nMinimumChar) {
return(returnFormatedNumber(_nNumber, _nMinimumChar));
}
static function returnFormatedNumber(_nNumber, _nMinimumChar) {
var _local1 = String(_nNumber);
while (_local1.length < _nMinimumChar) {
_local1 = "0" + _local1;
}
var _local3 = new Array();
var _local6 = _local1.length - 1;
var _local2;
_local2 = 0;
while (_local2 <= _local6) {
var _local5 = _local1.charAt(_local2);
_local3.push(_local5);
_local2++;
}
_local1 = "";
var _local4 = 0;
_local2 = _local3.length - 1;
while (_local2 >= 0) {
if (((_local4 % 3) == 0) && (_local4 != 0)) {
_local1 = "," + _local1;
}
_local1 = _local3[_local2] + _local1;
_local4++;
_local2--;
}
return(_local1);
}
static function getFormatedTime(_nTime, _bIncludeMilliseconds, _bShowMinutes) {
if (_bIncludeMilliseconds == undefined) {
_bIncludeMilliseconds = false;
}
if (_bShowMinutes == undefined) {
_bShowMinutes = true;
}
var _local6 = false;
if (_nTime < 0) {
_local6 = true;
_nTime = Math.abs(_nTime);
}
var _local4 = Math.floor(_nTime / 1000);
var _local3;
if (_bIncludeMilliseconds) {
var _local5;
if (_nTime >= 1000) {
_local5 = _nTime % (_local4 * 1000);
} else {
_local5 = _nTime;
}
_local3 = String(_local5).substr(0, 2);
if (_local3.length <= 1) {
_local3 = "0" + _local3;
}
}
var _local7 = Math.floor(_local4 / 60);
var _local8 = Math.floor(_local4 % 60);
var _local11 = "";
var _local9 = "";
if (_local8 < 10) {
_local9 = "0";
}
if (_local7 < 10) {
_local11 = "0";
}
var _local1 = "";
if (_bShowMinutes) {
_local1 = _local1 + String((_local11 + _local7) + ":");
}
_local1 = _local1 + (_local9 + _local8);
if (_bIncludeMilliseconds) {
_local1 = _local1 + (":" + _local3);
}
if (_local6) {
_local1 = "-" + _local1;
}
return(_local1);
}
static function getTrimmedString(_sStr) {
while (_sStr.charAt(0) == " ") {
_sStr = _sStr.substring(1, _sStr.length);
}
while (_sStr.charAt(_sStr.length - 1) == " ") {
_sStr = _sStr.substring(0, _sStr.length - 1);
}
return(_sStr);
}
}
Symbol 870 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.LaunchManager] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.LaunchManager extends com.sarbakan.utils.StateManaged
{
var mcRef, mcRefShadow, oPlayer, oOwner, nFrameMod, nResistance, nNewFrame, nFuseTime, bStretchSling, bLaunched, oKeyboardManager, setState, oController, sNextState, sState, bPausable, getState, stateCurrentFrame, stateFinished;
function LaunchManager (_mcRef, _mcRefShadow, _oPlayer, _sName, _oOwner) {
super(_mcRef);
mcRef = _mcRef;
mcRefShadow = _mcRefShadow;
oPlayer = _oPlayer;
sName = _sName;
oOwner = _oOwner;
nFrameMod = 0;
nResistance = 0;
nNewFrame = 1;
nFuseTime = 1;
bStretchSling = false;
bLaunched = false;
oKeyboardManager = new com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager();
oKeyboardManager.addArrowKeys();
oKeyboardManager.addKey(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_4);
oKeyboardManager.addKey(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_6);
setState(sSTATE_IDLE, true);
setTotalFuseTime();
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
}
function checkStateChange() {
if ((sNextState != undefined) && (sNextState != sState)) {
this[("state_" + sState) + "_end"]();
sState = sNextState;
sNextState = undefined;
mcRef.gotoAndStop(sState);
mcRefShadow.gotoAndStop(sState);
if (sState == sSTATE_START) {
mcRef.mcState.stop();
mcRefShadow.mcState.stop();
}
this[("state_" + sState) + "_init"]();
}
}
function deleteObject() {
setState(sSTATE_HIDDEN, true);
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function onPause() {
if (bPausable) {
mcRef.mcState.stop();
mcRef.mcState.mcRocket.stop();
mcRefShadow.mcState.stop();
}
}
function onUnPause() {
if (bPausable) {
mcRef.mcState.play();
mcRef.mcState.mcRocket.play();
mcRefShadow.mcState.play();
}
}
function getCurrentFrameVolume() {
var _local3 = 0;
var _local2 = nNewFrame;
if (_local2 > com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT1) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT1;
} else if (_local2 < com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT3) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT3;
}
var _local4 = (_local2 - com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT3) / (com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT1 - com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT3);
_local3 = Math.floor((_local4 * (com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_STRETCH_MAX_VOLUME - com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_STRETCH_MIN_VOLUME)) + com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_STRETCH_MIN_VOLUME);
return(_local3);
}
function setTotalFuseTime() {
nTOTAL_FUSE_TIME = mcRef.mcState.mcRocket._totalframes;
}
function saveFuseTime() {
nFuseTime = mcRef.mcState.mcRocket._currentframe;
}
function setFusetime() {
if (nFuseTime > 0) {
mcRef.mcState.mcRocket.gotoAndPlay(nFuseTime);
}
}
function checkFuseTime() {
if (mcRef.mcState.mcRocket._currentframe >= nTOTAL_FUSE_TIME) {
launchPlayerCheckup();
}
}
function checkKeys() {
oKeyboardManager.doUpdate(1);
bStretchSling = false;
switch (getState()) {
case sSTATE_IDLE :
if (oKeyboardManager.isKeyJustPressed(37) || (oKeyboardManager.isKeyJustPressed(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_4))) {
nFrameMod = com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_REWIND_FORCE;
setState(sSTATE_START);
mcRef.mcState.stop();
mcRefShadow.mcState.stop();
bStretchSling = true;
} else if (oKeyboardManager.isKeyJustPressed(39) || (oKeyboardManager.isKeyJustPressed(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_6))) {
launchPlayerCheckup();
}
break;
case sSTATE_START :
if (oKeyboardManager.isKeyJustPressed(37) || (oKeyboardManager.isKeyJustPressed(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_4))) {
nFrameMod = com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_REWIND_FORCE;
bStretchSling = true;
} else {
if (!(oKeyboardManager.isKeyJustPressed(39) || (oKeyboardManager.isKeyJustPressed(com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager.nKEY_NUM_6)))) {
break;
}
launchPlayerCheckup();
}
}
}
function launchPlayerCheckup() {
bLaunched = true;
switch (getState()) {
case sSTATE_IDLE :
oOwner.deleteShaker();
setState(sSTATE_LAUNCHFAILED);
break;
case sSTATE_START :
if (stateCurrentFrame() >= com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT1) {
oOwner.deleteShaker();
setState(sSTATE_LAUNCH1, true);
} else if (stateCurrentFrame() >= com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT2) {
oOwner.deleteShaker();
setState(sSTATE_LAUNCH2, true);
} else if (stateCurrentFrame() >= com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT3) {
oOwner.deleteShaker();
setState(sSTATE_LAUNCH3, true);
} else {
oOwner.deleteShaker();
setState(sSTATE_LAUNCHFAILED);
}
}
}
function setNewResistance() {
nResistance = (mcRef.mcState._currentframe * com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_BUNGEE_RESISTANCE) / mcRef.mcState._totalframes;
if (nResistance < com.disney.gem.games.mulanMushuJungleJump.GameData.nMIN_BUNGEE_RESISTANCE) {
nResistance = com.disney.gem.games.mulanMushuJungleJump.GameData.nMIN_BUNGEE_RESISTANCE;
} else if (nResistance > com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_BUNGEE_RESISTANCE) {
nResistance = com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_BUNGEE_RESISTANCE;
}
}
function setMaxRewind() {
var _local2 = (mcRef.mcState._currentframe * com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_BUNGEE_REWIND) / mcRef.mcState._totalframes;
if (_local2 > com.disney.gem.games.mulanMushuJungleJump.GameData.nMIN_BUNGEE_REWIND) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nMIN_BUNGEE_REWIND;
} else if (_local2 < com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_BUNGEE_REWIND) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_BUNGEE_REWIND;
}
if (nFrameMod < _local2) {
nFrameMod = _local2;
}
}
function moveFrame() {
nFrameMod = nFrameMod - nResistance;
setMaxRewind();
nNewFrame = Math.floor(nNewFrame + nFrameMod);
if (nNewFrame > mcRef.mcState._totalframes) {
oOwner.deleteShaker();
setState(sSTATE_TOOHARD, true);
} else if (nNewFrame < 1) {
nNewFrame = 1;
setState(sSTATE_IDLE, true);
} else {
mcRef.mcState.gotoAndStop(nNewFrame);
mcRefShadow.mcState.gotoAndStop(nNewFrame);
}
}
function launchPlayer() {
oController.oSoundPlayer.startAllWinds();
var _local2 = nNewFrame;
if (_local2 > com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT1) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT1;
}
var _local5 = (_local2 - com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT3) / (com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT1 - com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_LIMIT3);
var _local4 = (_local5 * (com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_MAX_ANGLE - com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_MIN_ANGLE)) + com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_MIN_ANGLE;
var _local3 = (_local5 * (com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_MAX_SPEED - com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_MIN_SPEED)) + com.disney.gem.games.mulanMushuJungleJump.GameData.nLAUNCH_MIN_SPEED;
oPlayer.setSpeedRotation(_local3, _local4);
}
function state_idle_init() {
setFusetime();
oController.oSoundPlayer.playStretch(0);
}
function state_idle() {
oController.oSoundPlayer.playFuse();
checkKeys();
checkFuseTime();
}
function state_idle_end() {
saveFuseTime();
}
function state_launchFailed_init() {
oController.oSoundPlayer.stopAllSFX();
oController.oSoundPlayer.playLaunchFailed();
}
function state_launchFailed() {
if (stateFinished()) {
oController.startNextLevel();
}
}
function state_start_init() {
setFusetime();
}
function state_start() {
oController.oSoundPlayer.playFuse();
oController.oSoundPlayer.playStretch(getCurrentFrameVolume());
checkKeys();
checkFuseTime();
if (!bLaunched) {
setNewResistance();
moveFrame();
}
}
function state_start_end() {
saveFuseTime();
}
function state_launch1_init() {
oController.oSoundPlayer.stopAllSFX();
oPlayer.setPosition(mcRef._x + mcRef.mcPlayerPos._x, mcRef._y + mcRef.mcPlayerPos._y, true);
oController.oSoundPlayer.playLaunch();
}
function state_launch1() {
if (stateFinished()) {
setState(sSTATE_LAUNCHED1);
launchPlayer();
oController.manageGameStep();
}
}
function state_launched1() {
if (stateFinished()) {
setState(sSTATE_LAUNCHED);
}
}
function state_launch2_init() {
oController.oSoundPlayer.stopAllSFX();
oPlayer.setPosition(mcRef._x + mcRef.mcPlayerPos._x, mcRef._y + mcRef.mcPlayerPos._y, true);
oController.oSoundPlayer.playLaunch();
}
function state_launch2() {
if (stateFinished()) {
setState(sSTATE_LAUNCHED2);
launchPlayer();
oController.manageGameStep();
}
}
function state_launched2() {
if (stateFinished()) {
setState(sSTATE_LAUNCHED);
}
}
function state_launch3_init() {
oController.oSoundPlayer.stopAllSFX();
oPlayer.setPosition(mcRef._x + mcRef.mcPlayerPos._x, mcRef._y + mcRef.mcPlayerPos._y, true);
oController.oSoundPlayer.playLaunch();
}
function state_launch3() {
if (stateFinished()) {
setState(sSTATE_LAUNCHED3);
launchPlayer();
oController.manageGameStep();
}
}
function state_launched3() {
if (stateFinished()) {
setState(sSTATE_LAUNCHED);
}
}
function state_launched() {
}
function state_tooHard_init() {
oController.oSoundPlayer.stopAllSFX();
oController.oSoundPlayer.playLaunchTooHard();
setFusetime();
}
function state_tooHard() {
if (stateFinished()) {
oController.startNextLevel();
}
}
static var sSTATE_HIDDEN = "hidden";
static var sSTATE_IDLE = "idle";
static var sSTATE_START = "start";
static var sSTATE_LAUNCH1 = "launch1";
static var sSTATE_LAUNCH2 = "launch2";
static var sSTATE_LAUNCH3 = "launch3";
static var sSTATE_LAUNCHED1 = "launched1";
static var sSTATE_LAUNCHED2 = "launched2";
static var sSTATE_LAUNCHED3 = "launched3";
static var sSTATE_LAUNCHED = "launched";
static var sSTATE_LAUNCHFAILED = "launchFailed";
static var sSTATE_TOOHARD = "tooHard";
static var nTOTAL_FUSE_TIME = 0;
var sName = "";
}
Symbol 871 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.Cam] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.Cam
{
var mcRef, mcParallax, oOwner, nScrollingSpeedX, nScrollingSpeedY, oController, oSceneryFGManager;
function Cam (_mcRef, _mcParallax, _sName, _oOwner) {
mcRef = _mcRef;
mcParallax = _mcParallax;
sName = _sName;
oOwner = _oOwner;
nScrollingSpeedX = 0;
nScrollingSpeedY = 0;
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
oSceneryFGManager = new com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.SceneryFGManager(mcParallax, "oSceneryFGManager", this);
}
function onUpdate() {
moveBG();
}
function setScrollingSpeed(_nAbsX, _nAbsY) {
nScrollingSpeedX = nSPEED_PERCENTAGE * (nCENTER_SCREEN - _nAbsX);
nScrollingSpeedY = nSPEED_PERCENTAGE * ((com.disney.gem.games.mulanMushuJungleJump.GameData.nSTG_HEIGHT / 2) - _nAbsY);
oSceneryFGManager.setScrollingSpeed(nScrollingSpeedX);
}
function deleteObject() {
oSceneryFGManager.deleteObject();
mcRef._x = 0;
mcRef._y = 0;
mcParallax._y = 0;
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function moveBG() {
var _local3 = mcRef._x;
var _local2 = mcRef._y;
_local3 = _local3 + nScrollingSpeedX;
_local2 = _local2 + nScrollingSpeedY;
mcRef._x = _local3;
mcRef._y = Math.min(Math.max(_local2, SCROLL_LIMIT_UP), SCROLL_LIMIT_DOWN);
mcParallax._y = Math.min(Math.max(_local2, SCROLL_LIMIT_UP), SCROLL_LIMIT_DOWN);
}
var SCROLL_LIMIT_UP = 0;
var SCROLL_LIMIT_DOWN = 4100;
var nSPEED_PERCENTAGE = 0.6;
var nCENTER_SCREEN = 220;
var sName = "";
var bPausable = true;
}
Symbol 872 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.ParallaxManager] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.ParallaxManager
{
var mcRef, oOwner, nScrollingSpeed, nShift, nNoBG, aBackgrounds, nCurrentBG, oController;
function ParallaxManager (_mcRef, _sName, _oOwner) {
mcRef = _mcRef;
sName = _sName;
oOwner = _oOwner;
nScrollingSpeed = 0;
nShift = 0;
nNoBG = 0;
aBackgrounds = new Array();
addBackground(0);
nCurrentBG = 0;
addBackground(nBG_WIDTH);
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
}
function setScrollingSpeed(_nSpeed) {
if (((_nSpeed < 0) && (Math.abs(_nSpeed) <= nSPEED_MIN_TO_SCROLL)) || ((_nSpeed > 0) && (_nSpeed <= nSPEED_MIN_TO_SCROLL))) {
_nSpeed = 0;
}
nScrollingSpeed = Math.floor(_nSpeed * nSPEED_PERCENTAGE);
}
function onUpdate() {
moveBG();
manageBG();
}
function deleteObject() {
mcRef._x = 0;
var _local2 = aBackgrounds.length - 1;
while (_local2 >= 0) {
aBackgrounds[_local2].swapDepths(10);
aBackgrounds[_local2].removeMovieClip();
_local2--;
}
aBackgrounds.splice(0);
delete aBackgrounds;
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function moveBG() {
mcRef._x = mcRef._x + nScrollingSpeed;
}
function addBackground(_nPosX) {
var _local2 = "";
if ((nNoBG % 2) == 0) {
_local2 = sLINKAGE1;
} else {
_local2 = sLINKAGE2;
}
var _local3 = mcRef.attachMovie(_local2, (_local2 + "_") + nNoBG, mcRef.getNextHighestDepth(), {_x:_nPosX + nShift, _y:0});
aBackgrounds.push(_local3);
nNoBG++;
findNewRandomPosition();
}
function manageBG() {
if (((aBackgrounds[nCurrentBG]._x + mcRef._x) + nBG_WIDTH) <= nSCROLL_LIMIT) {
aBackgrounds[nCurrentBG].swapDepths(10);
aBackgrounds[nCurrentBG].removeMovieClip();
addBackground(aBackgrounds[nCurrentBG + 1]._x + nBG_WIDTH);
aBackgrounds.splice(nCurrentBG, 1);
}
}
function findNewRandomPosition() {
nShift = Math.floor((Math.random() * Math.abs(nSHIFT_MAX - nSHIFT_MIN)) + nSHIFT_MIN);
}
var nSCROLL_LIMIT = -2000;
var nSHIFT_MIN = 2000;
var nSHIFT_MAX = 2000;
var sLINKAGE1 = "mcBush1";
var sLINKAGE2 = "mcBush2";
var nBG_WIDTH = 1600;
var nSPEED_PERCENTAGE = 2.5;
var nSPEED_MIN_TO_SCROLL = 0.5;
var sName = "";
}
Symbol 873 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.SceneryFGManager] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.SceneryFGManager extends com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.ParallaxManager
{
function SceneryFGManager (_mcRef, _sName, _oOwner) {
super(_mcRef, _sName, _oOwner);
}
}
Symbol 874 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.BGManager] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.BGManager
{
var mcRef, oOwner, nNoBG, aBackgrounds, bInitialized, nCurrentBG, oController;
function BGManager (_mcRef, _sName, _oOwner) {
mcRef = _mcRef;
sName = _sName;
oOwner = _oOwner;
nNoBG = 0;
aBackgrounds = new Array();
bInitialized = false;
nCurrentBG = 0;
var _local2 = 0;
while (_local2 < aLINKAGE_NAMES.length) {
addBackground(0);
_local2++;
}
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
}
function onUpdate() {
if (!bInitialized) {
var _local2 = 0;
while (_local2 < aBackgrounds.length) {
aBackgrounds[_local2]._x = nSHIFT + (_local2 * nBG_WIDTH);
_local2++;
}
bInitialized = true;
}
manageBG();
}
function deleteObject() {
var _local2 = 0;
while (_local2 < aBackgrounds.length) {
aBackgrounds[_local2].swapDepths(10);
aBackgrounds[_local2].removeMovieClip();
_local2++;
}
aBackgrounds.splice(0);
delete aBackgrounds;
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function addBackground(_nPosX) {
var _local2 = "";
_local2 = aLINKAGE_NAMES[nNoBG];
var _local3 = mcRef.mcBgContainer.attachMovie(_local2, (_local2 + "_") + nNoBG, mcRef.mcBgContainer.getNextHighestDepth(), {_x:nSHIFT + _nPosX, _y:0});
aBackgrounds.push(_local3);
nNoBG++;
}
function manageBG() {
var _local2 = 0;
if (((aBackgrounds[nCurrentBG]._x + mcRef._x) + nBG_WIDTH) <= nSCROLL_START) {
_local2 = getNextBGIndex(nCurrentBG);
aBackgrounds[nCurrentBG]._x = aBackgrounds[_local2]._x + nBG_WIDTH;
nCurrentBG++;
if (nCurrentBG >= aBackgrounds.length) {
nCurrentBG = 0;
}
}
}
function getNextBGIndex(_nIndex) {
var _local2 = (_nIndex + aBackgrounds.length) - 1;
if (_local2 >= aBackgrounds.length) {
_local2 = _local2 - aBackgrounds.length;
}
return(_local2);
}
var nSCROLL_START = -290;
var aLINKAGE_NAMES = ["mcBG1", "mcBG2", "mcBG3", "mcBG4"];
var nBG_WIDTH = 850;
var nSHIFT = -50;
var sName = "";
var bPausable = true;
}
Symbol 875 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.TrailManager] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.TrailManager
{
var mcBg, mcBackItems, oPlayer, oOwner, sName, nSmokeNo, aSmokeItems, oController;
function TrailManager (_mcRef, _oPlayer, _sName, _oOwner) {
mcBg = _mcRef;
mcBackItems = _mcRef.mcBackItems;
oPlayer = _oPlayer;
oOwner = _oOwner;
sName = _sName;
nSmokeNo = 0;
aSmokeItems = new Array();
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
}
function addSmoke() {
var _local4 = 0;
var _local3 = 0;
var _local5 = 0;
var _local6 = 0;
_local5 = oPlayer.__get__Mc()._x - (Math.cos(oPlayer.getAngleInRadian(oPlayer.__get__SmokeAngle() + oPlayer.__get__Rotation())) * oPlayer.__get__SmokeDistance());
_local6 = oPlayer.__get__Mc()._y - (Math.sin(oPlayer.getAngleInRadian(oPlayer.__get__SmokeAngle() + oPlayer.__get__Rotation())) * oPlayer.__get__SmokeDistance());
_local4 = _local5;
_local3 = _local6;
var _local2 = mcBackItems.attachMovie(sSMOKE_LINKAGE_NAME, sSMOKE_LINKAGE_NAME + nSmokeNo, mcBackItems.getNextHighestDepth());
_local2._x = _local4;
_local2._y = _local3;
aSmokeItems.push(new com.disney.gem.games.mulanMushuJungleJump.game.Smoke(_local2, sSMOKE_OBJECT_NAME + nSmokeNo, this));
nSmokeNo++;
}
function removeSmokeFromArray(_sName) {
var _local2 = aSmokeItems.length - 1;
while (_local2 >= 0) {
if (aSmokeItems[_local2].Name == _sName) {
aSmokeItems.splice(_local2, 1);
}
_local2--;
}
}
function deleteObject() {
var _local2 = aSmokeItems.length - 1;
while (_local2 >= 0) {
aSmokeItems[_local2].deleteObject();
_local2--;
}
aSmokeItems.splice(0);
delete oOwner[sName];
}
static var sSTATE_HIDDEN = "hidden";
static var sSMOKE_LINKAGE_NAME = "mcSmoke";
static var sSMOKE_OBJECT_NAME = "oSmoke";
}
Symbol 876 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.Smoke] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.Smoke extends com.sarbakan.utils.StateManaged
{
var oOwner, sName, oController, setState, mcRef, stateFinished;
function Smoke (_mcRef, _sName, _oOwner) {
super(_mcRef);
oOwner = _oOwner;
sName = _sName;
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
setState(sSTATE_IDLE);
}
function deleteObject() {
oOwner.removeSmokeFromArray(sName);
mcRef.swapDepths(10);
mcRef.removeMovieClip();
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function state_hidden() {
}
function state_idle() {
if (stateFinished()) {
setState(sSTATE_HIDDEN);
deleteObject();
}
}
function get Name() {
return(sName);
}
static var sSTATE_HIDDEN = "hidden";
static var sSTATE_IDLE = "idle";
}
Symbol 877 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.obstacles.ObstacleManager] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.obstacles.ObstacleManager
{
var mcContainer, oOwner, sName, mcBg, oPlayer, oHud, nBgDestination, nObstacleNo, aObstacles, oController;
function ObstacleManager (_mcRef, _mcBg, _oPlayer, _oHud, _sName, _oOwner) {
mcContainer = _mcRef;
oOwner = _oOwner;
sName = _sName;
mcBg = _mcBg;
oPlayer = _oPlayer;
oHud = _oHud;
nBgDestination = 0;
nObstacleNo = 0;
aObstacles = new Array();
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
findNewDestination();
}
function removeObstacleFromArray(_sName) {
var _local2 = aObstacles.length - 1;
while (_local2 >= 0) {
if (aObstacles[_local2].Name == _sName) {
aObstacles.splice(_local2, 1);
}
_local2--;
}
}
function deleteObject() {
var _local2 = aObstacles.length - 1;
while (_local2 >= 0) {
aObstacles[_local2].deleteObject();
_local2--;
}
aObstacles.splice(0);
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function onUpdate() {
checkAddingObstacle();
}
function checkAddingObstacle() {
if (mcBg._x <= nBgDestination) {
addObstacle();
findNewDestination();
}
}
function addObstacle() {
var _local3 = Math.random();
var _local5 = (com.disney.gem.games.mulanMushuJungleJump.GameData.nSTG_WIDTH + nLIMIT_ATTACH_OBSTACLE) - mcBg._x;
var _local4 = nATTACH_POS_Y;
var _local2;
var _local6 = "";
if (_local3 <= com.disney.gem.games.mulanMushuJungleJump.GameData.nPERCENT_BOOST_OBSTACLE) {
_local3 = Math.random();
if (_local3 <= com.disney.gem.games.mulanMushuJungleJump.GameData.nPERCENT_FIREWORKS_OBSTACLE) {
_local2 = mcContainer.attachMovie(com.disney.gem.games.mulanMushuJungleJump.GameData.sLINKAGE_NAME_FIREWORKS, com.disney.gem.games.mulanMushuJungleJump.GameData.sLINKAGE_NAME_FIREWORKS + nObstacleNo, mcContainer.getNextHighestDepth());
_local2._x = _local5;
_local2._y = _local4;
aObstacles.push(new com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Charriot(_local2, mcBg, oPlayer, "oBoost" + nObstacleNo, this));
} else {
_local2 = mcContainer.attachMovie(com.disney.gem.games.mulanMushuJungleJump.GameData.sLINKAGE_NAME_HORSE, com.disney.gem.games.mulanMushuJungleJump.GameData.sLINKAGE_NAME_HORSE + nObstacleNo, mcContainer.getNextHighestDepth());
_local2._x = _local5;
_local2._y = _local4;
aObstacles.push(new com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Horse(_local2, mcBg, oPlayer, "oBoost" + nObstacleNo, this));
}
_local6 = com.disney.gem.games.mulanMushuJungleJump.game.CricketHud.sSTATE_BOOST;
} else {
_local3 = Math.random();
if (_local3 <= com.disney.gem.games.mulanMushuJungleJump.GameData.nPERCENT_BANNER_OBSTACLE) {
_local2 = mcContainer.attachMovie(com.disney.gem.games.mulanMushuJungleJump.GameData.sLINKAGE_NAME_BANNER, com.disney.gem.games.mulanMushuJungleJump.GameData.sLINKAGE_NAME_BANNER + nObstacleNo, mcContainer.getNextHighestDepth());
_local2._x = _local5;
_local2._y = _local4;
aObstacles.push(new com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Banner(_local2, mcBg, oPlayer, "oHit" + nObstacleNo, this));
} else {
_local2 = mcContainer.attachMovie(com.disney.gem.games.mulanMushuJungleJump.GameData.sLINKAGE_NAME_TREE, com.disney.gem.games.mulanMushuJungleJump.GameData.sLINKAGE_NAME_TREE + nObstacleNo, mcContainer.getNextHighestDepth());
_local2._x = _local5;
_local2._y = _local4;
aObstacles.push(new com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Tree(_local2, mcBg, oPlayer, "oHit" + nObstacleNo, this));
}
_local6 = com.disney.gem.games.mulanMushuJungleJump.game.CricketHud.sSTATE_OBSTACLE;
}
oHud.updateCricketFace(_local6);
nObstacleNo++;
}
function findNewDestination() {
var _local2 = (Math.random() * (com.disney.gem.games.mulanMushuJungleJump.GameData.nMAX_DIST_TO_ADD_OBS - com.disney.gem.games.mulanMushuJungleJump.GameData.nMIN_DIST_TO_ADD_OBS)) + com.disney.gem.games.mulanMushuJungleJump.GameData.nMIN_DIST_TO_ADD_OBS;
nBgDestination = mcBg._x - _local2;
}
static var nLIMIT_ATTACH_OBSTACLE = com.disney.gem.games.mulanMushuJungleJump.GameData.nMIN_DIST_TO_ADD_OBS;
static var nATTACH_POS_Y = 380;
}
Symbol 878 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.obstacles.ActiveObstacle] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.obstacles.ActiveObstacle extends com.sarbakan.utils.StateManaged
{
var oOwner, sName, mcBg, oPlayer, nHitTop, nHitBottom, nHitLeft, nHitRight, oController, setState, mcRef;
function ActiveObstacle (_mcRef, _mcBg, _oPlayer, _sName, _oOwner) {
super(_mcRef);
oOwner = _oOwner;
sName = _sName;
mcBg = _mcBg;
oPlayer = _oPlayer;
nHitTop = 0;
nHitBottom = 0;
nHitLeft = 0;
nHitRight = 0;
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
setState(sSTATE_IDLE, true);
}
function deleteObject() {
oOwner.removeObstacleFromArray(sName);
mcRef.swapDepths(10);
mcRef.removeMovieClip();
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function state_idle() {
checkCollision();
}
function onUpdate() {
super.onUpdate();
checkOutOfScreen();
}
function setRealHitzones() {
nHitTop = mcRef._y + nHITZONE_TOP;
nHitBottom = mcRef._y + nHITZONE_BOTTOM;
nHitLeft = mcRef._x + nHITZONE_LEFT;
nHitRight = mcRef._x + nHITZONE_RIGHT;
}
function checkOutOfScreen() {
if ((mcBg._x + nHitRight) <= nLIMIT_DELETE_OBSTACLE) {
deleteObject();
}
}
function checkCollision() {
var _local2 = false;
if ((((oPlayer.__get__PosX() >= nHitLeft) && (oPlayer.__get__PosX() <= nHitRight)) && (oPlayer.__get__PosY() >= nHitTop)) && (oPlayer.__get__PosY() <= nHitBottom)) {
_local2 = true;
}
if (_local2) {
doCollision();
}
}
function doCollision() {
}
function get Name() {
return(sName);
}
static var sSTATE_IDLE = "idle";
var nHITZONE_TOP = 0;
var nHITZONE_BOTTOM = 0;
var nHITZONE_LEFT = 0;
var nHITZONE_RIGHT = 0;
static var nLIMIT_DELETE_OBSTACLE = -400;
}
Symbol 879 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.obstacles.BoostObstacle] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.obstacles.BoostObstacle extends com.disney.gem.games.mulanMushuJungleJump.game.obstacles.ActiveObstacle
{
var nNewPlayerSpeed, oController, stateFinished, oPlayer, setState;
function BoostObstacle (_mcRef, _mcBg, _oPlayer, _sName, _oOwner) {
super(_mcRef, _mcBg, _oPlayer, _sName, _oOwner);
nNewPlayerSpeed = 0;
}
function state_boost_init() {
oController.oSoundPlayer.playLandingBoost();
}
function state_boost() {
if (stateFinished()) {
setNewPlayer();
oPlayer.resumeFlying(sPLAYER_FLYING_STATE);
setState(sSTATE_AFTERBOOST);
}
}
function state_afterBoost() {
if (stateFinished()) {
setState(sSTATE_IDLEAFTERBOOST);
}
}
function state_idleAfterBoost() {
}
function doCollision() {
if ((!oPlayer.__get__IsRebounding()) && (!oPlayer.__get__IsOnGround())) {
findPlayerAngleSpeed();
oPlayer.stopFlying(true);
setState(sSTATE_BOOST);
}
}
function findPlayerAngleSpeed() {
}
function setNewPlayer() {
oPlayer.setSpeedRotation(nNewPlayerSpeed, nPLAYER_FLYING_ANGLE);
}
static var sSTATE_IDLE = "idle";
static var sSTATE_BOOST = "boost";
static var sSTATE_AFTERBOOST = "afterBoost";
static var sSTATE_IDLEAFTERBOOST = "idleAfterBoost";
var sPLAYER_FLYING_STATE = com.disney.gem.games.mulanMushuJungleJump.game.Player.sSTATE_FLYSLOW;
var nPLAYER_FLYING_ANGLE = com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_ANGLE_FASTTOSLOW;
}
Symbol 880 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Charriot] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Charriot extends com.disney.gem.games.mulanMushuJungleJump.game.obstacles.BoostObstacle
{
var oController, mcRef, oPlayer, nNewPlayerSpeed;
function Charriot (_mcRef, _mcBg, _oPlayer, _sName, _oOwner) {
super(_mcRef, _mcBg, _oPlayer, _sName, _oOwner);
super.setRealHitzones();
}
function state_afterBoost_init() {
oController.oSoundPlayer.playFireworksBoost();
}
function findPlayerAngleSpeed() {
var _local2 = 0;
var _local4 = mcRef.mcAfterBoostPoint._x + mcRef._x;
var _local3 = mcRef.mcAfterBoostPoint._y + mcRef._y;
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nOBS_FIREWORKS_SPEED_BOOST * oPlayer.__get__Speed();
if (_local2 > com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_TOTAL_SPEED) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_TOTAL_SPEED;
}
nNewPlayerSpeed = _local2;
oPlayer.setPosition(_local4, _local3, false);
}
var nHITZONE_TOP = -186;
var nHITZONE_BOTTOM = -47;
var nHITZONE_LEFT = -115;
var nHITZONE_RIGHT = 75;
var sPLAYER_FLYING_STATE = com.disney.gem.games.mulanMushuJungleJump.game.Player.sSTATE_FLYFAST;
var nPLAYER_FLYING_ANGLE = com.disney.gem.games.mulanMushuJungleJump.GameData.nOBS_FIREWORKS_ANGLE;
}
Symbol 881 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Horse] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Horse extends com.disney.gem.games.mulanMushuJungleJump.game.obstacles.BoostObstacle
{
var oController, mcRef, oPlayer, nNewPlayerSpeed;
function Horse (_mcRef, _mcBg, _oPlayer, _sName, _oOwner) {
super(_mcRef, _mcBg, _oPlayer, _sName, _oOwner);
super.setRealHitzones();
}
function state_afterBoost_init() {
oController.oSoundPlayer.playHorseBoost();
}
function findPlayerAngleSpeed() {
var _local2 = 0;
var _local4 = mcRef.mcAfterBoostPoint._x + mcRef._x;
var _local3 = mcRef.mcAfterBoostPoint._y + mcRef._y;
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nOBS_FIREWORKS_SPEED_BOOST * oPlayer.__get__Speed();
if (_local2 > com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_TOTAL_SPEED) {
_local2 = com.disney.gem.games.mulanMushuJungleJump.GameData.nPLAYER_MAX_TOTAL_SPEED;
}
nNewPlayerSpeed = _local2;
oPlayer.setPosition(_local4, _local3, false);
}
var nHITZONE_TOP = -225;
var nHITZONE_BOTTOM = -40;
var nHITZONE_LEFT = -150;
var nHITZONE_RIGHT = 78;
var sPLAYER_FLYING_STATE = com.disney.gem.games.mulanMushuJungleJump.game.Player.sSTATE_FLYFAST;
var nPLAYER_FLYING_ANGLE = com.disney.gem.games.mulanMushuJungleJump.GameData.nOBS_HORSE_ANGLE;
}
Symbol 882 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.obstacles.HitObstacle] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.obstacles.HitObstacle extends com.disney.gem.games.mulanMushuJungleJump.game.obstacles.ActiveObstacle
{
var oPlayer, mcRef, stateFinished, setState, oController;
function HitObstacle (_mcRef, _mcBg, _oPlayer, _sName, _oOwner) {
super(_mcRef, _mcBg, _oPlayer, _sName, _oOwner);
}
function state_hit() {
oPlayer.setPosition((mcRef._x + mcRef.mcState._x) + mcRef.mcState.mcCamera._x, (mcRef._y + mcRef.mcState._y) + mcRef.mcState.mcCamera._y, false);
if (stateFinished()) {
setState(sSTATE_HITIDLE);
oController.manageGameStep();
}
}
function state_hitIdle() {
}
function doCollision() {
oPlayer.stopFlying(false);
oController.oSoundPlayer.stopAllSFX();
oController.oSoundPlayer.stopAllWinds();
setState(sSTATE_HIT);
}
static var sSTATE_IDLE = "idle";
static var sSTATE_HIT = "hit";
static var sSTATE_HITIDLE = "hitIdle";
}
Symbol 883 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Banner] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Banner extends com.disney.gem.games.mulanMushuJungleJump.game.obstacles.HitObstacle
{
var oController;
function Banner (_mcRef, _mcBg, _oPlayer, _sName, _oOwner) {
super(_mcRef, _mcBg, _oPlayer, _sName, _oOwner);
super.setRealHitzones();
}
function state_hit_init() {
oController.oSoundPlayer.playLaunchFailed();
oController.oSoundPlayer.playHitBanner();
}
var nHITZONE_TOP = -352;
var nHITZONE_BOTTOM = -66;
var nHITZONE_LEFT = -60;
var nHITZONE_RIGHT = 40;
}
Symbol 884 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Tree] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.obstacles.Tree extends com.disney.gem.games.mulanMushuJungleJump.game.obstacles.HitObstacle
{
var oController;
function Tree (_mcRef, _mcBg, _oPlayer, _sName, _oOwner) {
super(_mcRef, _mcBg, _oPlayer, _sName, _oOwner);
super.setRealHitzones();
}
function state_hit_init() {
oController.oSoundPlayer.playLaunchFailed();
oController.oSoundPlayer.playHitTree();
}
var nHITZONE_TOP = -317;
var nHITZONE_BOTTOM = -108;
var nHITZONE_LEFT = -317;
var nHITZONE_RIGHT = 320;
}
Symbol 885 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.CameraShaker] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.backgrounds.CameraShaker
{
var mcRef, mcLauncher, oOwner, nMovingX, nShakeAmp, oController;
function CameraShaker (_mcRef, _mcLauncher, _sName, _oOwner) {
mcRef = _mcRef;
mcLauncher = _mcLauncher;
sName = _sName;
oOwner = _oOwner;
nMovingX = 0;
nShakeAmp = 0;
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
}
function onUpdate() {
setAmplitude(mcLauncher.mcState._currentframe);
moveBG();
}
function deleteObject() {
mcRef._x = 0;
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function setAmplitude(_nValue) {
if (_nValue > nFRAME_SHAKE_MAX) {
_nValue = nFRAME_SHAKE_MAX;
} else if (_nValue < nFRAME_SHAKE_MIN) {
_nValue = nFRAME_SHAKE_MIN;
}
nShakeAmp = (nMAX_AMPLITUDE * (_nValue - nFRAME_SHAKE_MIN)) / (nFRAME_SHAKE_MAX - nFRAME_SHAKE_MIN);
}
function moveBG() {
var _local2 = 0;
_local2 = Math.random() * nMAX_ANGLE;
nMovingX = Math.cos((_local2 * Math.PI) / 180) * nShakeAmp;
mcRef._x = nMovingX;
}
static var nMAX_AMPLITUDE = 4;
static var nMAX_ANGLE = 180;
static var nFRAME_SHAKE_MIN = 25;
static var nFRAME_SHAKE_MAX = 155;
var sName = "";
var bPausable = true;
}
Symbol 886 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.popups.MenuPopup] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.popups.MenuPopup extends com.sarbakan.utils.ScreenController
{
var oController, hide, mcRef;
function MenuPopup (_mcRef) {
super(_mcRef);
}
function onBtSound() {
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).toggleSound();
updateSoundGroup();
}
function onBtHelp() {
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).allowInstructions();
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).showInstructions();
hide(null, true);
}
function onBtQuit() {
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).showPopup(new com.disney.gem.games.mulanMushuJungleJump.popups.ConfirmPopup(com.disney.gem.games.mulanMushuJungleJump.Controller(oController).mcTimeline.mcPopups.mcConfirm, this), true);
}
function onBtResume() {
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).unpause();
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).allowInstructions();
hide();
}
function state_in_init() {
super.state_in_init();
setBts();
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_idle() {
updateSoundGroup();
}
function state_out_init() {
super.state_out_init();
setBts();
}
function setBts() {
mcRef.mcState.mcContent.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.mcContent.btQuit.onRelease = com.sarbakan.utils.Delegate.create(this, onBtQuit);
mcRef.mcState.mcContent.btResume.onRelease = com.sarbakan.utils.Delegate.create(this, onBtResume);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.btHelp);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.btQuit);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.btResume);
updateSoundGroup();
}
function updateSoundGroup() {
var _local2 = "On";
if (com.disney.gem.games.mulanMushuJungleJump.Controller(oController).bSoundMuted) {
_local2 = "Off";
}
mcRef.mcState.mcContent.mcSoundToggle.gotoAndStop(_local2);
mcRef.mcState.mcContent.mcSoundToggle.btSound.onRelease = com.sarbakan.utils.Delegate.create(this, onBtSound);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.mcSoundToggle.btSound);
}
}
Symbol 887 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.popups.ConfirmPopup] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.popups.ConfirmPopup extends com.sarbakan.utils.ScreenController
{
var oMenuOrigin, hide, oController, mcRef;
function ConfirmPopup (_mcRef, _oMenuOrigin) {
super(_mcRef);
oMenuOrigin = _oMenuOrigin;
}
function onBtNo() {
hide();
}
function onBtYes() {
hide();
oController.onGameQuit();
oMenuOrigin.hide();
}
function state_in_init() {
super.state_in_init();
setBts();
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_out_init() {
super.state_out_init();
setBts();
}
function setBts() {
mcRef.mcState.mcContent.btYes.onRelease = com.sarbakan.utils.Delegate.create(this, onBtYes);
mcRef.mcState.mcContent.btNo.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNo);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.btYes);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.btNo);
}
}
Symbol 888 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.game.Buttons] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.game.Buttons
{
static var oClickCatchers, oClickSound, oRollSound;
function Buttons () {
}
static function patch(_oBtnRef) {
if (oClickCatchers == undefined) {
oClickCatchers = {};
}
var _local2 = com.sarbakan.utils.Delegate.create(com.disney.gem.games.mulanMushuJungleJump.game.Buttons, triggerEvent, _oBtnRef, "Release");
var _local4 = com.sarbakan.utils.Delegate.create(com.disney.gem.games.mulanMushuJungleJump.game.Buttons, triggerEvent, _oBtnRef, "RollOver");
var _local3 = com.sarbakan.utils.Delegate.create(com.disney.gem.games.mulanMushuJungleJump.game.Buttons, triggerEvent, _oBtnRef, "RollOut");
if (oClickCatchers[_oBtnRef] == undefined) {
oClickCatchers[_oBtnRef] = {mc:_oBtnRef, fOnRelease:undefined, bReleaseTriggered:false, fOnRollOver:undefined, bRollOverTriggered:false, fOnRollOut:undefined, bRollOutTriggered:false};
}
if (_oBtnRef.onRelease != _local2) {
oClickCatchers[_oBtnRef].fOnRelease = _oBtnRef.onPress;
_oBtnRef.onPress = _local2;
}
if (_oBtnRef.onRollOver != _local4) {
oClickCatchers[_oBtnRef].fOnRollOver = _oBtnRef.onRollOver;
_oBtnRef.onRollOver = _local4;
}
if (_oBtnRef.onRollOut != _local3) {
oClickCatchers[_oBtnRef].fOnRollOut = _oBtnRef.onRollOut;
_oBtnRef.onRollOut = _local3;
}
clearUnexistingButtons();
}
static function showAllCatchers() {
var _local1 = "";
var _local2 = 0;
for (var _local3 in oClickCatchers) {
_local2++;
_local1 = _local1 + "\t- catcher : ";
if (_local3.length > 40) {
_local1 = _local1 + ("_root[...]" + _local3.substr(_local3.length - 38, 38));
} else {
_local1 = _local1 + _local3;
}
_local1 = _local1 + ((" OnStage ? : " + ((oClickCatchers[_local3].mc._x != undefined) && (oClickCatchers[_local3].mc._y != undefined))) + newline);
}
_local1 = (("Click catchers amount : " + _local2) + "\n\r") + _local1;
}
static function triggerEvent(_sButtonId, _sEvent) {
if (oClickCatchers[_sButtonId][("b" + _sEvent) + "Triggered"] == false) {
oClickCatchers[_sButtonId][("b" + _sEvent) + "Triggered"] = true;
oClickCatchers[_sButtonId]["fOn" + _sEvent]();
onEvent(_sEvent);
oClickCatchers[_sButtonId][("b" + _sEvent) + "Triggered"] = false;
}
}
static function onEvent(_sEvent) {
switch (_sEvent) {
case "Release" :
if (oClickSound != undefined) {
oClickSound.doStop();
}
oClickSound = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndButtonClick", com.disney.gem.games.mulanMushuJungleJump.GameData.nBUTTON_CLICK_VOLUME, 1, true);
break;
case "RollOver" :
if (oRollSound != undefined) {
oRollSound.doStop();
}
oRollSound = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.mulanMushuJungleJump.GameData.sCAT_SOUND, "sndButtonOver", com.disney.gem.games.mulanMushuJungleJump.GameData.nBUTTON_OVER_VOLUME, 1, true);
break;
case "RollOut" :
}
}
static function clearUnexistingButtons() {
if (oClickCatchers != undefined) {
var _local2 = new Array();
for (var _local1 in oClickCatchers) {
if ((oClickCatchers[_local1].mc._x == undefined) && (oClickCatchers[_local1].mc._y == undefined)) {
_local2.push(_local1);
}
}
var _local1 = _local2.length - 1;
while (_local1 >= 0) {
oClickCatchers[_local2[_local1]] = {};
delete oClickCatchers[_local2[_local1]];
_local1--;
}
}
}
static function doDestroy() {
oClickCatchers = {};
delete oClickCatchers;
}
}
Symbol 889 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.popups.LevelCompleted] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.popups.LevelCompleted extends com.sarbakan.utils.ScreenController
{
var oController, oKeyboardManager, sUnit, hide, mcRef;
function LevelCompleted (_mcRef) {
super(_mcRef);
oController = com.disney.gem.games.mulanMushuJungleJump.Controller.getInstance();
oKeyboardManager = new com.disney.gem.games.mulanMushuJungleJump.library.KeyboardManager();
oKeyboardManager.addAllKeys();
if (com.disney.gem.games.mulanMushuJungleJump.GameData.bUSE_METRIC_SYSTEM) {
sUnit = com.disney.gem.games.mulanMushuJungleJump.GameData.sMETRIC_UNIT;
} else {
sUnit = com.disney.gem.games.mulanMushuJungleJump.GameData.sIMPERIAL_UNIT;
}
}
function state_idle_init() {
super.state_idle_init();
setScores();
}
function state_idle() {
checkKeys();
}
function state_in_init() {
super.state_in_init();
setScores();
}
function state_out_init() {
super.state_out_init();
setScores();
}
function checkKeys() {
oKeyboardManager.doUpdate(1);
if (oKeyboardManager.isAnyKeyJustPressed()) {
hide(com.sarbakan.utils.Delegate.create(oController, oController.manageGameStep), true);
}
}
function setScores() {
var _local2 = oController.oGame.__get__LastDistance();
mcRef.mcState.mcContent.txtCurrentScore.text = (com.sarbakan.utils.Tools.getFormatedNumber(_local2, 1) + " ") + sUnit;
if (_local2 > nSCORE_BEST_COMMENT) {
mcRef.mcState.mcContent.mcEndScreenTexts.gotoAndStop(nFRAME_BEST_COMMENT);
} else if (_local2 > nSCORE_MEDIUM_COMMENT) {
mcRef.mcState.mcContent.mcEndScreenTexts.gotoAndStop(nFRAME_GOOD_COMMENT);
} else if (_local2 > nSCORE_POOR_COMMENT) {
mcRef.mcState.mcContent.mcEndScreenTexts.gotoAndStop(nFRAME_MEDIUM_COMMENT);
} else if (_local2 > nSCORE_WORST_COMMENT) {
mcRef.mcState.mcContent.mcEndScreenTexts.gotoAndStop(nFRAME_POOR_COMMENT);
} else {
mcRef.mcState.mcContent.mcEndScreenTexts.gotoAndStop(nFRAME_WORST_COMMENT);
}
}
static var nSCORE_WORST_COMMENT = 0;
static var nSCORE_POOR_COMMENT = 25000;
static var nSCORE_MEDIUM_COMMENT = 50000;
static var nSCORE_BEST_COMMENT = 100000;
static var nFRAME_WORST_COMMENT = 1;
static var nFRAME_POOR_COMMENT = 11;
static var nFRAME_MEDIUM_COMMENT = 21;
static var nFRAME_GOOD_COMMENT = 31;
static var nFRAME_BEST_COMMENT = 41;
}
Symbol 890 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.screens.TitleScreen] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.screens.TitleScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function TitleScreen (_mcRef) {
super(_mcRef);
}
function onBtHelp() {
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).showInstructions();
}
function onBtPlay() {
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).startNewGame();
}
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);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.btHelp);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.btPlay);
}
}
Symbol 891 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.screens.HelpScreen] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.screens.HelpScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function HelpScreen (_mcRef) {
super(_mcRef);
}
function onBtBack() {
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).hideInstructions();
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btBack.onRelease = com.sarbakan.utils.Delegate.create(this, onBtBack);
com.disney.gem.games.mulanMushuJungleJump.game.Buttons.patch(mcRef.mcState.mcContent.btBack);
}
}
Symbol 892 MovieClip [__Packages.com.disney.gem.games.mulanMushuJungleJump.screens.PreloaderScreen] Frame 0
class com.disney.gem.games.mulanMushuJungleJump.screens.PreloaderScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function PreloaderScreen (_mcRef) {
super(_mcRef);
}
function state_idle() {
var _local2 = com.disney.gem.games.mulanMushuJungleJump.Controller(oController).mcTimeline.getBytesLoaded() / com.disney.gem.games.mulanMushuJungleJump.Controller(oController).mcTimeline.getBytesTotal();
mcRef.mcState.txtLoading.text = Math.round(_local2 * 100);
mcRef.mcState.mcLoading.gotoAndStop(Math.round(_local2 * 100));
if (_local2 == 1) {
com.disney.gem.games.mulanMushuJungleJump.Controller(oController).onPreloadingDone();
}
}
}
Symbol 144 MovieClip Frame 1
this._visible = false;
Symbol 230 MovieClip Frame 1
this._visible = false;
Symbol 260 MovieClip Frame 1
this._visible = false;
Symbol 594 MovieClip Frame 10
LockBtn.useHandCursor = false;
Symbol 594 MovieClip Frame 20
LockBtn.useHandCursor = false;
Symbol 594 MovieClip Frame 30
LockBtn.useHandCursor = false;
Instance of Symbol 614 MovieClip in Symbol 615 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10);
this.removeMovieClip();
}
Symbol 618 MovieClip Frame 1
this._visible = false;
Symbol 621 MovieClip Frame 1
this._visible = false;
Symbol 624 MovieClip Frame 1
this._visible = false;
Symbol 727 MovieClip Frame 1
this._visible = false;
Instance of Symbol 809 MovieClip in Symbol 810 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10);
this.removeMovieClip();
}
Symbol 811 MovieClip Frame 1
stop();