Frame 1
var _oPreloaderScreen = (new com.disney.gem.games.PoohMarathon.screens.PreloaderScreen(mcScreens.mcPreloader));
com.sarbakan.BaseDisneyController.bDEBUG = false;
new com.disney.gem.games.PoohMarathon.Controller(this, _oPreloaderScreen);
Symbol 712 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() {
if (com.disney.gem.base.BaseObject == undefined) {
var _local2 = nCONTROLLER_MODE_STANDALONE;
} else {
var _local2 = nCONTROLLER_MODE_DXD;
}
return(_local2);
}
function setGamePhase(_nPhase) {
nGamePhase = _nPhase;
switch (_nPhase) {
case nGAME_PHASE_PRELOADER :
mcTimeline.gotoAndStop("preloader");
break;
case nGAME_PHASE_PACKAGING :
mcTimeline.gotoAndStop("packaging");
break;
case nGAME_PHASE_INGAME :
mcTimeline.gotoAndStop("game");
}
}
function getGamePhase() {
return(nGamePhase);
}
function gameLog(_sText) {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.gameLog(_sText);
} else {
org.flashdevelop.utils.FlashConnect.trace(_sText, "com.sarbakan.BaseDisneyController::gameLog", "C:\\Documents and Settings\\karlb\\Bureau\\Stuff\\Pooh\\dxd_template\\src/com/sarbakan/BaseDisneyController.as", 314);
}
}
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 _local4 = false;
var _local5 = aPopups.length - 1;
for ( ; _local5 >= 0 ; _local5--) {
var _local6 = aPopups[_local5];
if (_oPopupController.getRef() == _local6.getRef()) {
_local4 = true;
_local6.destroy();
oMainBroadcaster.removeListener(_local6);
aPopups[_local5] = _oPopupController;
break;
}
}
if (!_local4) {
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 && ((!oCurrentScreen.isInOutTransitionning()) && (!oTransitionManager.isTransitionning())));
}
function showInstructionsScreen() {
}
function hideInstructionsScreen() {
}
function stopScreenContainers() {
var _local2 = [mcTimeline.mcPopups, mcTimeline.mcScreens];
var _local3 = _local2.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
for (var j in _local2[_local3]) {
_local2[_local3][j].stop();
}
}
}
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 713 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 _local2 = false;
var _local3 = arguments.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
if (arguments[_local3] == sState) {
_local2 = true;
break;
}
}
return(!_local2);
}
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 714 MovieClip [__Packages.com.sarbakan.utils.TransitionManager] Frame 0
class com.sarbakan.utils.TransitionManager extends com.sarbakan.utils.StateManaged
{
var setPausable, mcTransitionContainer, mcTransition, fMiddleCallBack, fEndCallBack, bTransitionning, setMC, setState, stateFinished, mcRef;
function TransitionManager (_mcTransition) {
super();
setPausable(false);
mcTransitionContainer = _mcTransition;
for (var i in mcTransitionContainer) {
mcTransitionContainer[i].stop();
}
}
function playTransition(_sTransitionID, _fMiddleCallBack, _fEndCallBack) {
mcTransition = mcTransitionContainer["mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)];
fMiddleCallBack = _fMiddleCallBack;
fEndCallBack = _fEndCallBack;
if (mcTransition == undefined) {
org.flashdevelop.utils.FlashConnect.trace(("TransitionManager error: Unable to find mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)) + " in transition movieclip", "com.sarbakan.utils.TransitionManager::playTransition", "C:\\Documents and Settings\\karlb\\Bureau\\Stuff\\Pooh\\dxd_template\\src/com/sarbakan/utils/TransitionManager.as", 77);
} 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 715 MovieClip [__Packages.com.sarbakan.utils.MoreString] Frame 0
class com.sarbakan.utils.MoreString
{
function MoreString () {
}
static function pad(_sToPad, _sCharPad, _nMinLength, _sSideToPad) {
var _local6 = String(_sToPad);
while (_local6.length < _nMinLength) {
if (_sSideToPad == "RIGHT") {
_local6 = _local6 + _sCharPad;
} else {
_local6 = _sCharPad + _local6;
}
}
return(_local6);
}
static function trim(_sToTrim, _sCharTrim, _sSideToTrim) {
var _local5 = String(_sToTrim);
if (_sSideToTrim == "RIGHT") {
while (_local5.substr(_local5.length - 2, 1) == _sCharTrim) {
_local5 = _local5.slice(-1);
}
} else {
while (_local5.substr(0, 1) == _sCharTrim) {
_local5 = _local5.slice(1);
}
}
return(_local5);
}
static function replace(_sString, _sFind, _sReplace) {
return(_sString.split(_sFind).join(_sReplace));
}
static function formatTime(_nTime) {
var _local3 = _nTime;
var _local4 = Math.floor(_local3 / 60);
var _local5 = Math.round(_local3 - (_local4 * 60));
return((pad(String(_local4), "0", 2) + ":") + pad(String(_local5), "0", 2));
}
static function formatNumber(__sNumber, __nMinimumChar) {
var _local4 = String(__sNumber);
var _local5 = "";
var _local6 = _local4.length;
_local6 = _local6 / 3;
if (_local6 <= 1) {
var _local7 = _local4;
if (_local7.length < __nMinimumChar) {
_local7 = "0" + _local7;
}
} else {
var _local8 = _local6;
for ( ; _local8 > 1 ; _local8--) {
_local5 = (" " + _local4.substr(-3)) + _local5;
_local4 = _local4.substr(0, -3);
}
var _local7 = _local4 + _local5;
if (_local7.length < __nMinimumChar) {
_local7 = "0" + _local7;
}
}
return(_local7);
}
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) {
if (_bDecimalOpt == undefined) {
var _local9 = true;
} else {
var _local9 = _bDecimalOpt;
}
var _local5 = String(_nMoney).split(".");
if (_local5[1] != undefined) {
var _local6 = _local5[1].substr(0, 2);
switch (_local6.length) {
case 0 :
_local6 = _local6 + "00";
break;
case 1 :
_local6 = _local6 + "0";
break;
case 2 :
break;
default :
_local6 = "00";
}
} else {
var _local6 = "00";
}
var _local8 = _local5[0];
var _local7 = "";
while (_local8.length > 3) {
_local7 = (_sDelimiteur + _local8.substr(_local8.length - 3)) + _local7;
_local8 = _local8.substr(0, _local8.length - 3);
}
_local7 = _local8 + _local7;
if (_local9) {
return(((_local7 + ".") + _local6) + "$");
}
return(_local7 + " $");
}
static function getOrdinalSuffix(_nNumber) {
var _local4 = String(_nNumber);
if ((_local4.substr(-2, 2) == 11) || ((_local4.substr(-2, 2) == 12) || (_local4.substr(-2, 2) == 13))) {
var _local3 = "th";
} else if (_local4.substr(-1, 1) == 1) {
var _local3 = "st";
} else if (_local4.substr(-1, 1) == 2) {
var _local3 = "nd";
} else if (_local4.substr(-1, 1) == 3) {
var _local3 = "rd";
} else {
var _local3 = "th";
}
return(_local3);
}
}
Symbol 716 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 717 MovieClip [__Packages.com.disney.gem.games.GameContainer] Frame 0
class com.disney.gem.games.GameContainer
{
function GameContainer () {
}
}
Symbol 718 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 _local4 = new TextFormat();
_local4.font = DEBUG_FONT;
_local4.size = DEBUG_FONT_SIZE;
_local4.color = DEBUG_FONT_COLOR;
_local4.align = "right";
mcDebug.field.setNewTextFormat(_local4);
mcDebug.field.selectable = false;
mcDebug.createTextField("fieldShadow", 1, 1, 1, 400, 50);
var _local5 = new TextFormat();
_local5.font = DEBUG_FONT;
_local5.size = DEBUG_FONT_SIZE;
_local5.color = DEBUG_FONT_SHADOW_COLOR;
_local5.align = "right";
mcDebug.fieldShadow.setNewTextFormat(_local5);
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 _local2 = "";
var _local3 = String(nAverageFps).split(".");
if (_local3[1] == undefined) {
_local2 = nAverageFps + ".00";
} else if (_local3[1].length == 1) {
_local2 = (_local3[0] + ".0") + _local3[1];
} else {
_local2 = (_local3[0] + ".") + _local3[1].substr(0, 2);
}
return(_local2);
}
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 719 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 _local4 = bInOut;
if (_bInOutOverride != undefined) {
_local4 = _bInOutOverride;
}
if (_local4) {
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 720 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 _local4 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
var _local4 = arguments.callee.arg;
_local4 = _local4.concat(arguments);
return(_local3.apply(_local2, _local4));
};
_local4.target = obj;
_local4.func = func;
_local4.arg = arguments.slice(2);
return(_local4);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 721 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.Controller] Frame 0
class com.disney.gem.games.PoohMarathon.Controller extends com.sarbakan.BaseDisneyController
{
static var oGame;
var mcTimeline, showScreen, allowInstructions, oCurrentMusic, onGameStart, setLevel, bPaused, unpause, oMainBroadcaster, nLevel, hideCurrentScreen, onLevelStart, oTransitionManager, pause, nGamePhase, setGamePhase;
function Controller (_mcTimeline, _oPreloaderScreen) {
super(_mcTimeline, _oPreloaderScreen);
mcTimeline = _mcTimeline;
com.sarbakan.sound.SoundManager.doInit(_mcTimeline);
}
static function getInstance() {
return(com.disney.gem.games.PoohMarathon.Controller(com.sarbakan.BaseDisneyController.oInstance));
}
static function __get__game() {
return(oGame);
}
function init() {
super.init();
showTitleScreen();
}
function showTitleScreen(_bShowTransition) {
if (_bShowTransition) {
com.sarbakan.sound.SoundManager.doPlaySound("Transition", 100, 1, true);
showScreen(new com.disney.gem.games.PoohMarathon.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.PoohMarathon.screens.TitleScreen(mcTimeline.mcScreens.mcTitle));
}
allowInstructions();
oCurrentMusic.doStop();
oCurrentMusic = com.sarbakan.sound.SoundManager.doPlaySound("PackagingTrack", 80, 1000, true);
}
function startNewGame() {
com.sarbakan.sound.SoundManager.doPlaySound("Transition", 100, 1, true);
onGameStart();
setLevel(0);
startNextLevel();
}
function startNextLevel() {
oCurrentMusic.doStop();
oCurrentMusic = com.sarbakan.sound.SoundManager.doPlaySound("GameTrack", 80, 1000, true);
if (bPaused) {
unpause();
}
oMainBroadcaster.removeListener(oGame);
oGame.destroy();
setLevel(nLevel + 1);
if (nLevel > com.disney.gem.games.PoohMarathon.GameData.nLEVEL_TOTAL) {
onGameWon();
} else {
com.sarbakan.sound.SoundManager.doPlaySound("Transition", 100, 1, true);
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, onLevelTransitionDone), sTRANSITION_DEFAULT);
}
onLevelStart();
}
function restartLevel() {
oGame.destroy();
oGame.init();
oMainBroadcaster.addListener(oGame);
oCurrentMusic.doStop();
oCurrentMusic = com.sarbakan.sound.SoundManager.doPlaySound("GameTrack", 80, 1000, true);
}
function startTransition() {
com.sarbakan.sound.SoundManager.doPlaySound("Transition", 100, 1, true);
oTransitionManager.playTransition(sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, restartLevel));
}
function showInstructionsScreen() {
pause();
com.sarbakan.sound.SoundManager.doPlaySound("Transition", 100, 1, true);
showScreen(new com.disney.gem.games.PoohMarathon.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false, sTRANSITION_DEFAULT);
}
function hideInstructionsScreen() {
com.sarbakan.sound.SoundManager.doPlaySound("Transition", 100, 1, true);
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
unpause();
hideCurrentScreen(null, sTRANSITION_DEFAULT);
} else {
startNewGame();
}
}
function onLevelTransitionDone() {
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
if (nLevel == 1) {
oGame = new com.disney.gem.games.PoohMarathon.GameEngine(mcTimeline.mcGame);
}
oMainBroadcaster.addListener(oGame);
oGame.init();
}
function onGameLose() {
oMainBroadcaster.removeListener(oGame);
com.sarbakan.sound.SoundManager.doPlaySound("Transition", 100, 1, true);
showScreen(new com.disney.gem.games.PoohMarathon.screens.EndScreen(mcTimeline.mcScreens.mcLose), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, onGameLoseCallBack));
}
function onGameWon() {
oMainBroadcaster.removeListener(oGame);
oCurrentMusic.doStop();
oCurrentMusic = com.sarbakan.sound.SoundManager.doPlaySound("Win", 100, 1, true);
showScreen(new com.disney.gem.games.PoohMarathon.screens.WinScreen(mcTimeline.mcScreens.mcWin), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, setGamePhase, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
}
function onLevelEnd() {
oCurrentMusic.doStop();
oCurrentMusic = com.sarbakan.sound.SoundManager.doPlaySound("Win", 100, 1, true);
showScreen(new com.disney.gem.games.PoohMarathon.screens.LevelEndScreen(mcTimeline.mcScreens.mcLevelEnd), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, setGamePhase, com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME));
}
function onGameLoseCallBack() {
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING);
oGame.destroy();
}
static var sTRANSITION_DEFAULT = "default";
}
Symbol 722 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.GameEngine] Frame 0
class com.disney.gem.games.PoohMarathon.GameEngine
{
var mcGame, nTotalLosts, bisGameOver, nLevelTimerFrames, nLevelTimeLeft, oWorld, nCurrentLevelScore;
function GameEngine (_mcGame) {
mcGame = _mcGame;
nTotalLosts = 0;
bisGameOver = false;
}
function init() {
nLevelTimerFrames = 0;
var _local2 = com.disney.gem.games.PoohMarathon.Controller.getInstance().getLevel();
nLevelTimeLeft = getLevelTotalTime(_local2);
mcGame.mcHud.mcScore.txtScore.text = com.disney.gem.games.PoohMarathon.Controller.getInstance().getScore();
mcGame.mcHud.mcLevel.txtLevel.text = _local2;
mcGame.mcHud.mcTime.txtTime.text = nLevelTimeLeft;
mcGame.mcHud.btMenu.onRelease = com.sarbakan.utils.Delegate.create(this, onBtMenu);
mcGame.mcHud.btMenu.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
oWorld = new com.disney.gem.games.PoohMarathon.content.World(mcGame.mcWorld);
changeLevel();
oWorld.init();
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.addListener(oWorld);
nCurrentLevelScore = 0;
}
function destroy() {
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(oWorld);
oWorld.destroy();
delete oWorld;
}
function getRef() {
return(mcGame);
}
function getWorld() {
return(oWorld);
}
function changeLevel() {
var _local2 = com.disney.gem.games.PoohMarathon.Controller.getInstance().getLevel();
oWorld.setLevel(_local2);
}
function isGameOver() {
return(bisGameOver);
}
function setTriesLeft() {
com.disney.gem.games.PoohMarathon.Controller.game.getRef().mcHud.mcTries.txtTries.text = (com.disney.gem.games.PoohMarathon.GameData.nMAX_LOSTS - nTotalLosts) - 1;
}
function increaseCurrentLevelScore(_nPoints) {
nCurrentLevelScore = nCurrentLevelScore + _nPoints;
var _local3 = com.disney.gem.games.PoohMarathon.Controller.getInstance().getScore() + nCurrentLevelScore;
com.disney.gem.games.PoohMarathon.Controller.game.getRef().mcHud.mcScore.txtScore.text = _local3;
}
function getCurrentLevelScore() {
return(nCurrentLevelScore);
}
function checkKeys() {
if (!oWorld.getPooh().isPoohInvincible()) {
if (Key.isDown(String("C").charCodeAt(0))) {
oWorld.getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_CROUCH, true);
} else {
oWorld.getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALK, true);
}
if (Key.isDown(Key.SPACE)) {
oWorld.checkNearObstacles();
oWorld.getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMPSTART, true);
}
} else {
if (Key.isDown(String("C").charCodeAt(0))) {
oWorld.getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_CROUCHINVINCIBLE, true);
} else {
oWorld.getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALKINVINCIBLE, true);
}
if (Key.isDown(Key.SPACE)) {
oWorld.checkNearObstacles();
oWorld.getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMPSTARTINVINCIBLE, true);
}
}
}
function checkDirection() {
if (Key.isDown(Key.UP)) {
oWorld.getPooh().setSpeed(com.disney.gem.games.PoohMarathon.GameData.nDIRECTION_UP);
} else if (Key.isDown(Key.DOWN)) {
oWorld.getPooh().setSpeed(com.disney.gem.games.PoohMarathon.GameData.nDIRECTION_DOWN);
} else {
oWorld.getPooh().setSpeed(com.disney.gem.games.PoohMarathon.GameData.nDIRECTION_NONE);
}
}
function addtime() {
nLevelTimeLeft = nLevelTimeLeft + com.disney.gem.games.PoohMarathon.GameData.nGREEN_POT_TIME_ADDING;
mcGame.mcHud.mcTime.txtTime.text = nLevelTimeLeft;
}
function getTimeLeft() {
return(nLevelTimeLeft);
}
function onUpdate() {
if (!bisGameOver) {
checkFrames();
}
}
function onPause() {
}
function onUnPause() {
}
function onBtMenu() {
com.disney.gem.games.PoohMarathon.Controller.getInstance().pause();
com.disney.gem.games.PoohMarathon.Controller.getInstance().showPopup(new com.disney.gem.games.PoohMarathon.popups.MenuPopup(com.disney.gem.games.PoohMarathon.Controller.getInstance().mcTimeline.mcPopups.mcMenu), true);
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtRoll() {
com.sarbakan.sound.SoundManager.doPlaySound("ButtonRoll", 100, 1, false);
}
function checkFrames() {
if (nLevelTimerFrames <= com.disney.gem.games.PoohMarathon.GameData.nONE_SECOND_IN_FRAMES) {
nLevelTimerFrames++;
} else {
nLevelTimerFrames = 0;
checkTimeSeconds();
}
}
function checkTimeSeconds() {
nLevelTimeLeft--;
mcGame.mcHud.mcTime.txtTime.text = nLevelTimeLeft;
if (nLevelTimeLeft == 0) {
nTotalLosts++;
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(this);
oWorld.getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_DIESTART, true);
if (nTotalLosts == com.disney.gem.games.PoohMarathon.GameData.nMAX_LOSTS) {
bisGameOver = true;
}
}
}
function getLevelTotalTime(_nNextLevel) {
switch (_nNextLevel) {
case 1 :
return(com.disney.gem.games.PoohMarathon.GameData.nLEVEL_1_TOTAL_TIME);
case 2 :
return(com.disney.gem.games.PoohMarathon.GameData.nLEVEL_2_TOTAL_TIME);
case 3 :
return(com.disney.gem.games.PoohMarathon.GameData.nLEVEL_3_TOTAL_TIME);
}
}
}
Symbol 723 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.content.World] Frame 0
class com.disney.gem.games.PoohMarathon.content.World extends com.sarbakan.utils.StateManaged
{
var mcRef, aHoneyPots, aObstacles, oPooh, oLumpy, oSideScroller, nObstaclesCounter, nHoneyPotsCounter, bLevelEnded, setState, oHoneyPot, oObstacle, aTemporaryObstacles;
function World (_mcRef) {
super();
mcRef = _mcRef;
aHoneyPots = new Array();
aObstacles = new Array();
}
function init(_nLevel) {
oPooh = new com.disney.gem.games.PoohMarathon.content.Pooh(mcRef.mcState.mcPooh);
oLumpy = new com.disney.gem.games.PoohMarathon.content.Lumpy(mcRef.mcState.mcLumpy);
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.addListener(oPooh);
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.addListener(oLumpy);
com.disney.gem.games.PoohMarathon.Controller.game.setTriesLeft();
var _local3 = com.disney.gem.games.PoohMarathon.Controller.getInstance().getLevel();
var _local4 = 0;
switch (_local3) {
case 1 :
_local4 = com.disney.gem.games.PoohMarathon.GameData.nSCREEN_MAX_POSITIONX_LEVEL1;
break;
case 2 :
_local4 = com.disney.gem.games.PoohMarathon.GameData.nSCREEN_MAX_POSITIONX_LEVEL2;
break;
case 3 :
_local4 = com.disney.gem.games.PoohMarathon.GameData.nSCREEN_MAX_POSITIONX_LEVEL3;
}
oSideScroller = new com.disney.gem.games.PoohMarathon.content.SideScroller(mcRef, _local4);
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.addListener(oSideScroller);
nObstaclesCounter = 0;
nHoneyPotsCounter = 0;
bLevelEnded = false;
}
function onUpdate() {
checkLevelEnd();
checkCollisions();
}
function destroy() {
setState("destroy", true);
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(oSideScroller);
delete oSideScroller;
var _local2 = 0;
for ( ; _local2 < aHoneyPots.length ; _local2++) {
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(aHoneyPots[_local2]);
delete aHoneyPots[_local2];
}
aHoneyPots = new Array();
var _local3 = 0;
for ( ; _local3 < aObstacles.length ; _local3++) {
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(aObstacles[_local3]);
delete aObstacles[_local3];
}
aObstacles = new Array();
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(oLumpy);
oLumpy.destroy();
delete oLumpy;
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(oPooh);
delete oPooh;
}
function getPooh() {
return(oPooh);
}
function getLumpy() {
return(oLumpy);
}
function getRef() {
return(mcRef);
}
function getObstacles() {
return(aObstacles);
}
function getLevelEnd() {
return(mcRef.mcState.mcEndLevelHitZone);
}
function addHoneyPots(_mcHoneyPot, _sType) {
nHoneyPotsCounter++;
oHoneyPot = new com.disney.gem.games.PoohMarathon.content.HoneyPot(_mcHoneyPot, _sType, nHoneyPotsCounter);
aHoneyPots.push(oHoneyPot);
}
function addObstacles(_mcObstacle, _sType) {
nObstaclesCounter++;
var _local4 = new flash.geom.Point();
var _local5 = 0;
_local4.y = _mcObstacle._y;
_local4.x = _mcObstacle._x;
_local5 = Math.round((_local4.y * mcRef._width) + _local4.x);
oObstacle = new com.disney.gem.games.PoohMarathon.content.Obstacle(_mcObstacle, _sType, _local5, nObstaclesCounter);
aObstacles.push(oObstacle);
}
function setLevel(_nLevel) {
setState("level" + _nLevel, true);
}
function checkNearObstacles() {
var _local2 = new Array();
var _local3 = 0;
for ( ; _local3 <= aObstacles.length ; _local3++) {
if (getPooh().getRef().mcObstaclesCollider.hitTest(aObstacles[_local3].getRef().mcObstacleWCollider)) {
_local2.push(aObstacles[_local3]);
}
}
setJumpPossibleCollisions(_local2);
}
function setJumpPossibleCollisions(_aPossibleCollidingObstacles) {
var _local3 = 0;
for ( ; _local3 < aTemporaryObstacles.length ; _local3++) {
delete aTemporaryObstacles[_local3];
}
aTemporaryObstacles = new Array();
aTemporaryObstacles = _aPossibleCollidingObstacles.slice();
}
function checkLevelEnd() {
if (!bLevelEnded) {
if (oPooh.getRef().mcWalkingCollider.hitTest(mcRef.mcState.mcEndLevelHitZone)) {
bLevelEnded = true;
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(com.disney.gem.games.PoohMarathon.Controller.game);
if (com.disney.gem.games.PoohMarathon.Controller.getInstance().getLevel() == com.disney.gem.games.PoohMarathon.GameData.nLEVEL_TOTAL) {
com.disney.gem.games.PoohMarathon.Controller.getInstance().onGameWon();
} else {
com.disney.gem.games.PoohMarathon.Controller.getInstance().onLevelEnd();
}
}
}
}
function checkCollisions() {
if ((oPooh.getState() != com.disney.gem.games.PoohMarathon.GameData.sSTATE_FLY) && ((oPooh.getState() != com.disney.gem.games.PoohMarathon.GameData.sSTATE_FLYSTART) && ((oPooh.getState() != com.disney.gem.games.PoohMarathon.GameData.sSTATE_FLYDROP) && (oPooh.getState() != com.disney.gem.games.PoohMarathon.GameData.sSTATE_FLYEND)))) {
if (!oPooh.isPoohInvincible()) {
if ((oPooh.getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALK) || (oPooh.getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_CROUCH)) {
getHoneyPot();
hitObstacle();
}
if (oPooh.getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMP) {
checkJumpPossibleCollisions();
}
if (oLumpy.getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_IDLE) {
checkWaterCollision();
}
} else {
getHoneyPot();
}
if (oPooh.checkPowerUp()) {
if (oPooh.getState() != com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMPINVINCIBLE) {
hitObstacle();
getHoneyPot();
}
}
}
}
function getHoneyPot() {
var _local2 = 0;
for ( ; _local2 < aHoneyPots.length ; _local2++) {
if (oPooh.getRef().mcWalkingCollider.hitTest(aHoneyPots[_local2].getRef().mcPotCollider)) {
aHoneyPots[_local2].checkType();
}
}
}
function hitObstacle() {
var _local2 = new flash.geom.Point();
var _local3 = 0;
for ( ; _local3 < aObstacles.length ; _local3++) {
_local2.x = aObstacles[_local3].getRef()._x;
aObstacles[_local3].getRef()._parent.localToGlobal(_local2);
com.disney.gem.games.PoohMarathon.Controller.game.getRef().globalToLocal(_local2);
if ((_local2.x > 0) && (_local2.x < Stage.width)) {
if (oPooh.getRef().mcWalkingCollider.hitTest(aObstacles[_local3].getRef().mcObstacleWCollider)) {
if (!oPooh.checkPowerUp()) {
if (aObstacles[_local3].getType() == "clothesline") {
if (oPooh.getState() != com.disney.gem.games.PoohMarathon.GameData.sSTATE_CROUCH) {
var _local4 = aObstacles[_local3].getClothesLineWColliders();
var _local5 = 0;
for ( ; _local5 < _local4.length ; _local5++) {
if (oPooh.getRef().mcWalkingCollider.hitTest(_local4[_local5])) {
oPooh.setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_COLLIDESTART, true);
}
}
}
} else {
oPooh.setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_COLLIDESTART, true);
}
} else if (aObstacles[_local3].getType() == "clothesline") {
if (oPooh.getState() != com.disney.gem.games.PoohMarathon.GameData.sSTATE_CROUCH) {
if (!aObstacles[_local3].checkIfShrinked()) {
var _local6 = aObstacles[_local3].getClothesLineWColliders();
var _local7 = 0;
for ( ; _local7 < _local6.length ; _local7++) {
if (oPooh.getRef().mcWalkingCollider.hitTest(_local6[_local7])) {
com.sarbakan.sound.SoundManager.doPlaySound("GenericShrink", 100, 1, true);
aObstacles[_local3].setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_SHRINK);
}
}
}
}
} else if (!aObstacles[_local3].checkIfShrinked()) {
switch (aObstacles[_local3].getType()) {
case "trunk" :
com.sarbakan.sound.SoundManager.doPlaySound("GenericShrink", 100, 1, true);
break;
case "puddle" :
com.sarbakan.sound.SoundManager.doPlaySound("PuddleShrink", 100, 1, true);
break;
case "scarecrow" :
com.sarbakan.sound.SoundManager.doPlaySound("ScarecrowShrink", 100, 1, true);
break;
case "fruitcart" :
com.sarbakan.sound.SoundManager.doPlaySound("GenericShrink", 100, 1, true);
break;
case "unicycle" :
com.sarbakan.sound.SoundManager.doPlaySound("UnicycleShrink", 100, 1, true);
}
aObstacles[_local3].setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_SHRINK);
}
}
}
}
}
function checkJumpPossibleCollisions() {
var _local2 = 0;
for ( ; _local2 < aTemporaryObstacles.length ; _local2++) {
if (aTemporaryObstacles[_local2].getType() == "clothesline") {
var _local3 = aTemporaryObstacles[_local2].getClothesLineJColliders();
var _local4 = 0;
for ( ; _local4 < _local3.length ; _local4++) {
if (oPooh.getRef().mcJumpCollider.hitTest(_local3[_local4])) {
oPooh.setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_COLLIDESTART, true);
}
}
} else if (oPooh.getRef().mcJumpCollider.hitTest(aTemporaryObstacles[_local2].getRef().mcObstacleJCollider)) {
oPooh.setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_COLLIDESTART, true);
}
}
}
function checkWaterCollision() {
if (oPooh.getRef().mcWalkCollider.hitTest(oLumpy.getRef().mcLumpyCollider) || (oPooh.getRef().mcJumpCollider.hitTest(oLumpy.getRef().mcLumpyCollider))) {
if (oPooh.getState() != com.disney.gem.games.PoohMarathon.GameData.sSTATE_CROUCH) {
oPooh.setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_COLLIDESTART, true);
}
}
}
}
Symbol 724 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.content.Pooh] Frame 0
class com.disney.gem.games.PoohMarathon.content.Pooh extends com.sarbakan.utils.StateManaged
{
var mcRef, nCurrentSpeed, nDropSpeed, nInvincibilityTimer, nInvincibleAnimTimer, nFlyTimer, nFloorPosition, nActualJumpingSpeed, bisJumping, bisOnPowerUp, bisFlying, bisInvincible, setState, nInvincibiltyLength, stateFinished, getState;
function Pooh (_mcRef) {
super();
mcRef = _mcRef;
mcRef._visible = true;
mcRef.mcWalkingCollider._visible = false;
mcRef.mcObstaclesCollider._visible = false;
mcRef.mcJumpCollider._visible = false;
nCurrentSpeed = 0;
nDropSpeed = 0;
nInvincibilityTimer = 0;
nInvincibleAnimTimer = 0;
nFlyTimer = 0;
nFloorPosition = mcRef._y;
nActualJumpingSpeed = 0;
bisJumping = false;
bisOnPowerUp = false;
bisFlying = false;
bisInvincible = false;
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALK, true);
}
function onUpdate() {
super.onUpdate();
}
function getRef() {
return(mcRef);
}
function isPoohInvincible() {
return(bisInvincible);
}
function setSpeed(_nDirection) {
nCurrentSpeed = com.disney.gem.games.PoohMarathon.GameData.nPOOH_VERTICAL_SPEED * _nDirection;
}
function setInvincible(_nWhatLength) {
nInvincibiltyLength = _nWhatLength;
nInvincibilityTimer = 0;
bisInvincible = true;
}
function checkPowerUp() {
return(bisOnPowerUp);
}
function getPowerUp() {
bisOnPowerUp = true;
}
function state_walk() {
nFloorPosition = mcRef._y;
bisJumping = false;
moveHorizontally();
moveVertically();
com.disney.gem.games.PoohMarathon.Controller.game.checkDirection();
com.disney.gem.games.PoohMarathon.Controller.game.checkKeys();
checkInvincibility();
}
function state_walkInvincible() {
nFloorPosition = mcRef._y;
bisJumping = false;
moveHorizontally();
moveVertically();
com.disney.gem.games.PoohMarathon.Controller.game.checkDirection();
com.disney.gem.games.PoohMarathon.Controller.game.checkKeys();
checkInvincibility();
}
function state_crouch() {
nFloorPosition = mcRef._y;
bisJumping = false;
moveHorizontally();
moveVertically();
com.disney.gem.games.PoohMarathon.Controller.game.checkDirection();
com.disney.gem.games.PoohMarathon.Controller.game.checkKeys();
checkInvincibility();
}
function state_crouchInvincible() {
nFloorPosition = mcRef._y;
bisJumping = false;
moveHorizontally();
moveVertically();
com.disney.gem.games.PoohMarathon.Controller.game.checkDirection();
com.disney.gem.games.PoohMarathon.Controller.game.checkKeys();
checkInvincibility();
}
function state_jumpStart() {
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMP, true);
com.sarbakan.sound.SoundManager.doPlaySound("PoohJump", 100, 1, true);
}
moveHorizontally();
checkInvincibility();
}
function state_jumpStartInvincible() {
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMPINVINCIBLE, true);
com.sarbakan.sound.SoundManager.doPlaySound("PoohJump", 100, 1, true);
}
moveHorizontally();
checkInvincibility();
}
function state_jump() {
if (!bisJumping) {
nActualJumpingSpeed = com.disney.gem.games.PoohMarathon.GameData.nJUMPING_HEIGHT;
}
bisJumping = true;
moveHorizontally();
jumpMove();
checkFloor();
checkInvincibility();
}
function state_jumpInvincible() {
if (!bisJumping) {
nActualJumpingSpeed = com.disney.gem.games.PoohMarathon.GameData.nJUMPING_HEIGHT;
}
bisJumping = true;
moveHorizontally();
jumpMove();
checkFloor();
checkInvincibility();
}
function state_jumpEnd() {
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALK, true);
}
moveHorizontally();
checkInvincibility();
}
function state_jumpEndInvincible() {
if (stateFinished()) {
if (!bisInvincible) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALK, true);
} else {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALKINVINCIBLE, true);
}
}
moveHorizontally();
checkInvincibility();
}
function state_getUp() {
if (stateFinished()) {
setInvincible(com.disney.gem.games.PoohMarathon.GameData.nCOLLISION_INVINCIBLE_LENGTH);
com.sarbakan.sound.SoundManager.doPlaySound("InvincibleShort", 100, 1, true);
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALKINVINCIBLE, true);
}
}
function state_collideStart() {
com.sarbakan.sound.SoundManager.doPlaySound("PoohHurt", 100, 1, true);
if (bisJumping) {
if (nActualJumpingSpeed < 0) {
nActualJumpingSpeed = 0;
}
jumpMove();
} else {
nFloorPosition = mcRef._y;
}
collideEffect();
checkFloor();
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_COLLIDE, true);
}
}
function state_collide() {
if (bisJumping) {
if (nActualJumpingSpeed < 0) {
nActualJumpingSpeed = 0;
}
jumpMove();
}
collideEffect();
checkFloor();
}
function state_flyStart() {
nDropSpeed = 1;
moveHorizontally();
bisFlying = true;
checkInvincibility();
if (mcRef._y >= com.disney.gem.games.PoohMarathon.GameData.nFLY_POSITION) {
mcRef._y = mcRef._y - com.disney.gem.games.PoohMarathon.GameData.nPOOH_VERTICAL_SPEED;
} else {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_FLY, true);
}
}
function state_fly() {
if (nFlyTimer >= com.disney.gem.games.PoohMarathon.GameData.nFLY_LENGTH) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_FLYEND, true);
}
com.sarbakan.sound.SoundManager.doPlaySound("PoohFly", 100, 1, true);
nFlyTimer++;
org.flashdevelop.utils.FlashConnect.trace(mcRef.getDepth(), "com.disney.gem.games.PoohMarathon.content.Pooh::state_fly", "C:\\Documents and Settings\\karlb\\Bureau\\Stuff\\Pooh\\dxd_template\\src/com/disney/gem/games/PoohMarathon/content/Pooh.as", 246);
moveHorizontally();
checkInvincibility();
}
function state_flyEnd() {
com.sarbakan.sound.SoundManager.doPlaySound("PoohFlyEnd", 100, 1, true);
if (mcRef._y <= nFloorPosition) {
dropMove();
} else {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALK, true);
nFlyTimer = 0;
mcRef._y = nFloorPosition;
}
moveHorizontally();
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_FLYDROP);
}
}
function state_flyDrop() {
if (mcRef._y <= nFloorPosition) {
dropMove();
} else {
bisFlying = false;
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALK, true);
nFlyTimer = 0;
mcRef._y = nFloorPosition;
}
moveHorizontally();
}
function state_dieStart() {
com.sarbakan.sound.SoundManager.doPlaySound("PoohDie", 100, 1, true);
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_DIE, true);
com.disney.gem.games.PoohMarathon.Controller.getInstance().oCurrentMusic.doStop();
com.sarbakan.sound.SoundManager.doPlaySound("Die", 100, 1, true);
}
if (mcRef._y <= nFloorPosition) {
collideEffect();
checkFloor();
mcRef._y = mcRef._y + com.disney.gem.games.PoohMarathon.GameData.nPOOH_VERTICAL_SPEED;
}
}
function state_die() {
if (stateFinished()) {
com.sarbakan.sound.SoundManager.doDestroy();
com.sarbakan.sound.SoundManager.doInit(com.disney.gem.games.PoohMarathon.Controller.getInstance().mcTimeline);
mcRef.mcState.stop();
if (com.disney.gem.games.PoohMarathon.Controller.game.isGameOver()) {
com.disney.gem.games.PoohMarathon.Controller.getInstance().onGameLose();
} else {
com.disney.gem.games.PoohMarathon.Controller.getInstance().startTransition();
}
setState("destroy");
}
if (mcRef._y <= nFloorPosition) {
collideEffect();
checkFloor();
mcRef._y = mcRef._y + com.disney.gem.games.PoohMarathon.GameData.nPOOH_VERTICAL_SPEED;
}
}
function moveVertically() {
if (checkYPosition()) {
mcRef._y = mcRef._y + nCurrentSpeed;
var _local2 = changeDepth();
mcRef.swapDepths(_local2);
}
}
function moveHorizontally() {
mcRef._x = mcRef._x + com.disney.gem.games.PoohMarathon.GameData.nHORIZONTAL_SPEED;
}
function collideEffect() {
mcRef._x = mcRef._x - com.disney.gem.games.PoohMarathon.GameData.nHORIZONTAL_SPEED;
}
function jumpGravity() {
nActualJumpingSpeed = nActualJumpingSpeed + com.disney.gem.games.PoohMarathon.GameData.nJUMPING_GRAVITY;
}
function jumpMove() {
jumpGravity();
mcRef._y = mcRef._y + nActualJumpingSpeed;
}
function dropMove() {
nDropSpeed = nDropSpeed + com.disney.gem.games.PoohMarathon.GameData.nJUMPING_GRAVITY;
mcRef._y = mcRef._y + nDropSpeed;
}
function checkFloor() {
if (mcRef._y >= nFloorPosition) {
mcRef._y = nFloorPosition;
if (getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_COLLIDE) {
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_GETUP, true);
}
}
if (getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMP) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMPEND, true);
}
if (getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMPINVINCIBLE) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_JUMPENDINVINCIBLE, true);
}
}
}
function runInvincibleTimer() {
nInvincibilityTimer++;
if (nInvincibilityTimer >= nInvincibiltyLength) {
nInvincibilityTimer = 0;
bisInvincible = false;
bisOnPowerUp = false;
if (!bisFlying) {
if (getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_CROUCHINVINCIBLE) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_CROUCH);
}
if (getState() == com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALKINVINCIBLE) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALK, true);
}
}
}
}
function checkInvincibility() {
if (bisInvincible) {
runInvincibleTimer();
}
}
function checkYPosition() {
var _local2 = new flash.geom.Point();
var _local3 = false;
_local2.y = mcRef._y + nCurrentSpeed;
if ((_local2.y < com.disney.gem.games.PoohMarathon.GameData.nPOOH_MIN_Y_POSITION) && (_local2.y > com.disney.gem.games.PoohMarathon.GameData.nPOOH_MAX_Y_POSITION)) {
_local3 = true;
}
return(_local3);
}
function changeDepth() {
var _local2 = new flash.geom.Point();
var _local3 = 0;
var _local4 = com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getRef()._width;
_local2.y = mcRef._y;
_local2.x = mcRef._x;
_local3 = Math.round(((_local2.y * _local4) + _local4) - 1);
return(_local3);
}
}
Symbol 725 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.GameData] Frame 0
class com.disney.gem.games.PoohMarathon.GameData
{
function GameData () {
}
static var sSTATE_IDLE = "idle";
static var sSTATE_APPEAR = "appear";
static var sSTATE_DISAPPEAR = "disappear";
static var sSTATE_WALK = "walk";
static var sSTATE_WALKINVINCIBLE = "walkInvincible";
static var sSTATE_CROUCH = "crouch";
static var sSTATE_CROUCHINVINCIBLE = "crouchInvincible";
static var sSTATE_JUMP = "jump";
static var sSTATE_JUMPINVINCIBLE = "jumpInvincible";
static var sSTATE_JUMPSTART = "jumpStart";
static var sSTATE_JUMPSTARTINVINCIBLE = "jumpStartInvincible";
static var sSTATE_JUMPEND = "jumpEnd";
static var sSTATE_JUMPENDINVINCIBLE = "jumpEndInvincible";
static var sSTATE_FLY = "fly";
static var sSTATE_FLYSTART = "flyStart";
static var sSTATE_FLYEND = "flyEnd";
static var sSTATE_FLYDROP = "flyDrop";
static var sSTATE_GETUP = "getUp";
static var sSTATE_COLLIDESTART = "collideStart";
static var sSTATE_COLLIDE = "collide";
static var sSTATE_HIDE = "hide";
static var sSTATE_DIE = "die";
static var sSTATE_DIESTART = "dieStart";
static var sSTATE_INVINCIBLE = "invincible";
static var sSTATE_THROWWATER = "throwwater";
static var sSTATE_SHRINK = "shrink";
static var sSTATE_SHRINKED = "shrinked";
static var nDIRECTION_DOWN = 1;
static var nDIRECTION_UP = -1;
static var nDIRECTION_NONE = 0;
static var nPOOH_VERTICAL_SPEED = 5;
static var nHORIZONTAL_SPEED = 4;
static var nJUMPING_HEIGHT = -8.1;
static var nJUMPING_GRAVITY = 0.4;
static var nREGULAR_POT_SCORE = 500;
static var nPOWERUP_POT_SCORE = 1000;
static var nGREEN_POT_TIME_ADDING = 10;
static var nTIME_LEFT_SCORE_PER_SECOND = 250;
static var nLEVEL_TOTAL = 3;
static var nLEVEL_1_TOTAL_TIME = 70;
static var nLEVEL_2_TOTAL_TIME = 85;
static var nLEVEL_3_TOTAL_TIME = 90;
static var nMAX_LOSTS = 3;
static var nFLY_LENGTH = 100;
static var nLUMPY_APPEAR_MAX_TIME = 210;
static var nLUMPY_APPEAR_MIN_TIME = 75;
static var nCOLLISION_INVINCIBLE_LENGTH = 35;
static var nRED_POT_INVINCIBLE_LENGTH = 120;
static var nONE_SECOND_IN_FRAMES = 30;
static var nLUMPY_DISTANCE_FROM_POOH = 600;
static var nLUMPY_DISTANCE_FROM_LEVEL_END = 400;
static var nLUMPY_DISTANCE_TO_DISAPPEAR = 550;
static var ptSCREEN_CENTER = new flash.geom.Point(130, 205);
static var nSCREEN_MAX_POSITIONX_LEVEL1 = -6500;
static var nSCREEN_MAX_POSITIONX_LEVEL2 = -9530;
static var nSCREEN_MAX_POSITIONX_LEVEL3 = -9530;
static var nPOOH_MAX_Y_POSITION = 150;
static var nPOOH_MIN_Y_POSITION = 375;
static var nFLY_POSITION = 160;
}
Symbol 726 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();
if (NewSoundAllowed) {
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_nLoop == undefined) {
_nLoop = 1;
}
if (_bUnique == undefined) {
_bUnique = false;
}
if (_bUnique) {
var _local9 = isSoundPlaying(_sLinkage);
if (_local9.bPlaying) {
var _local8 = false;
var _local7 = _local9.oSound;
} else {
var _local8 = true;
}
} else {
var _local8 = true;
}
if (_local8) {
doManageCategory(_sCategoryName);
var _local10 = getMCForSound();
var _local11 = new Sound(_local10);
_local11.attachSound(_sLinkage);
if (_local11.duration != undefined) {
var _local7 = new com.sarbakan.sound.SoundItem(_local11, _sLinkage, _nVolume, _nLoop, _sCategoryName, _local10);
} else {
org.flashdevelop.utils.FlashConnect.trace("**** BAD SOUND LINKAGE : " + _sLinkage, "com.sarbakan.sound.SoundManager::doPlaySoundInCat", "C:\\Documents and Settings\\karlb\\Bureau\\Stuff\\Pooh\\dxd_template\\src/com/sarbakan/sound/SoundManager.as", 131);
}
_local7.doAddListener(com.sarbakan.sound.SoundManager);
aSounds.push(_local7);
}
} else {
org.flashdevelop.utils.FlashConnect.trace("ERROR - ***** - MAX SOUND NUM REACHED : " + nMAX_SOUNDS_PLAYING, "com.sarbakan.sound.SoundManager::doPlaySoundInCat", "C:\\Documents and Settings\\karlb\\Bureau\\Stuff\\Pooh\\dxd_template\\src/com/sarbakan/sound/SoundManager.as", 140);
}
return(_local7);
}
static function isSoundPlaying(_sLinkageName) {
var _local3 = new Object();
_local3.bPlaying = false;
_local3.oSound = undefined;
var _local4 = aSounds.length - 1;
for ( ; _local4 >= 0 ; _local4--) {
if (aSounds[_local4].LinkageName == _sLinkageName) {
_local3.oSound = aSounds[_local4];
_local3.bPlaying = true;
}
}
return(_local3);
}
function getPlayingQty(_sLinkageName) {
var _local3 = 0;
var _local4 = aSounds.length - 1;
for ( ; _local4 >= 0 ; _local4--) {
if (aSounds[_local4].LinkageName == _sLinkageName) {
_local3++;
}
}
return(_local3);
}
static function doManageExternalSound(_oSound) {
doCheckInit();
doManageCategory(_oSound.Category);
_oSound.doAddListener(com.sarbakan.sound.SoundManager);
aSounds.push(_oSound);
}
static function getMCForSound() {
var _local2 = getNextDepth();
var _local3 = mcAttach.createEmptyMovieClip("Snd" + _local2, _local2);
return(_local3);
}
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 _local2 = aSounds.length - 1;
for ( ; _local2 >= 0 ; _local2--) {
aSounds[_local2].doEnterFrame();
}
}
static function setCategoryVolume(_sCategoryName, _nVol) {
doManageCategory(_sCategoryName);
var _local4 = aSoundCategories.length - 1;
for ( ; _local4 >= 0 ; _local4--) {
if (aSoundCategories[_local4].sName == _sCategoryName) {
aSoundCategories[_local4].nVolume = _nVol;
}
}
doUpdateAllSoundsVolume();
}
static function getCategoryVolume(_sCategoryName) {
doManageCategory(_sCategoryName);
var _local4 = aSoundCategories.length - 1;
for ( ; _local4 >= 0 ; _local4--) {
if (aSoundCategories[_local4].sName == _sCategoryName) {
var _local3 = aSoundCategories[_local4].nVolume;
}
}
return(_local3);
}
static function isCategoryMuted(_sCategoryName) {
doManageCategory(_sCategoryName);
var _local4 = aSoundCategories.length - 1;
for ( ; _local4 >= 0 ; _local4--) {
if (aSoundCategories[_local4].sName == _sCategoryName) {
var _local3 = aSoundCategories[_local4].bMuted;
}
}
return(_local3);
}
static function doSoundEvent(_nEvent, _oSound) {
if (!(_nEvent === nEVENT_SOUND_COMPLETE)) {
} else {
var _local4 = false;
var _local5 = aSounds.length - 1;
for ( ; _local5 >= 0 ; _local5--) {
if (!_local4) {
if (aSounds[_local5] == _oSound) {
_local4 = true;
delete aSounds[_local5];
aSounds.splice(Number(_local5), 1);
}
}
}
}
}
static function doMuteCategory(_sCategoryName) {
var _local3 = aSoundCategories.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
if (aSoundCategories[_local3].sName == _sCategoryName) {
aSoundCategories[_local3].bMuted = true;
}
}
doUpdateAllSoundsVolume();
}
static function doUnMuteCategory(_sCategoryName) {
var _local3 = aSoundCategories.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
if (aSoundCategories[_local3].sName == _sCategoryName) {
aSoundCategories[_local3].bMuted = false;
}
}
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 _local3 = aSounds.length - 1;
for ( ; _local3 >= 0 ; _local3--) {
aSounds[_local3].doRemoveListener(_oListener);
}
}
static function doDestroy() {
doRemoveListenerFromAllSounds();
var _local2 = aSounds.length - 1;
for ( ; _local2 >= 0 ; _local2--) {
aSounds[_local2].doDestroy();
}
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 _local2 = aSounds.length - 1;
for ( ; _local2 >= 0 ; _local2--) {
aSounds[_local2].doUpdateSound();
}
}
static function doCheckInit() {
if (!bInited) {
org.flashdevelop.utils.FlashConnect.trace("**** NORMAL SM ERROR, NEED TO INIT SOUND MANAGER FIRST", "com.sarbakan.sound.SoundManager::doCheckInit", "C:\\Documents and Settings\\karlb\\Bureau\\Stuff\\Pooh\\dxd_template\\src/com/sarbakan/sound/SoundManager.as", 496);
}
}
static function doManageCategory(_sCategoryName) {
doCheckInit();
var _local3 = false;
var _local4 = aSoundCategories.length - 1;
for ( ; _local4 >= 0 ; _local4--) {
if (aSoundCategories[_local4].sName == _sCategoryName) {
_local3 = true;
}
}
if (!_local3) {
var _local5 = new Object();
_local5.sName = _sCategoryName;
_local5.nVolume = 100;
_local5.bMuted = false;
aSoundCategories.push(_local5);
}
}
static var nEVENT_SOUND_COMPLETE = 1;
static var sDEFAULT_CATEGORY = "SFX";
static var nMAX_SOUNDS_PLAYING = 32;
static var bInited = false;
}
Symbol 727 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 _local3 = 0;
for ( ; _local3 < aEventListeners.length ; _local3++) {
if (aEventListeners[_local3] == _oListener) {
delete aEventListeners[_local3];
aEventListeners.splice(_local3, 1);
}
}
}
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(15 / 1000, _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;
for ( ; _local2 < aEventListeners.length ; _local2++) {
aEventListeners[_local2].doSoundEvent(com.sarbakan.sound.SoundManager.nEVENT_SOUND_COMPLETE, this);
}
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) {
if ((!bMuted) && (!com.sarbakan.sound.SoundManager.isCategoryMuted(sCategory))) {
var _local4 = com.sarbakan.sound.SoundManager.MasterVolume / 100;
var _local5 = com.sarbakan.sound.SoundManager.getCategoryVolume(sCategory) / 100;
var _local3 = _nVolume;
_local3 = _local3 * _local5;
_local3 = _local3 * _local4;
} else {
var _local3 = 0;
}
return(_local3);
}
static var nFADE_RATE = 8;
static var nFADE_AT_END_TIME = 800;
}
Symbol 728 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 _local3 = 0;
if (__nNum < 0) {
_local3 = -1;
} else if (__nNum > 0) {
_local3 = 1;
}
return(_local3);
}
static function getReachZero(__nNum, __nReducer) {
return(getReachNum(__nNum, 0, __nReducer));
}
static function getReachNum(__nNum, __nTargetNum, __nReducer) {
var _local5 = __nNum;
if (_local5 != __nTargetNum) {
if (_local5 < __nTargetNum) {
_local5 = _local5 + __nReducer;
if (_local5 > __nTargetNum) {
_local5 = __nTargetNum;
}
} else {
_local5 = _local5 - __nReducer;
if (_local5 < __nTargetNum) {
_local5 = __nTargetNum;
}
}
}
return(_local5);
}
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 _local6 = __nX2 - __nX1;
var _local7 = __nY2 - __nY1;
var _local8 = Math.atan2(_local7, _local6);
var _local9 = getDegreeFromRadius(_local8);
return(_local9);
}
static function getCleanedAngle(_nAngle) {
while (_nAngle < 360) {
_nAngle = _nAngle + 360;
}
_nAngle = _nAngle % 360;
return(_nAngle);
}
static function getDegreeFromRadius(__nRadius) {
var _local3 = (__nRadius / MATH_PI) * 180;
return(_local3);
}
static function getRadianFromDegree(__nDegree) {
var _local3 = __nDegree * (MATH_PI / 180);
return(_local3);
}
static function getBoundsCenter(_oBox) {
var _local3 = (_oBox.xMin + _oBox.xMax) / 2;
var _local4 = (_oBox.yMin + _oBox.yMax) / 2;
return({x:_local3, y:_local4});
}
static var MATH_PI = Math.PI;
}
Symbol 729 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local2 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local2);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
}
Symbol 730 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 _local3 = _listeners;
var _local4 = _local3.length;
while (_local4--) {
if (_local3[_local4] == o) {
_local3.splice(_local4, 1);
if (!_local3.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local2 = String(arguments.shift());
var _local3 = _listeners.concat();
var _local4 = _local3.length;
var _local5 = 0;
for ( ; _local5 < _local4 ; _local5++) {
_local3[_local5][_local2].apply(_local3[_local5], arguments);
}
}
}
Symbol 731 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.content.Lumpy] Frame 0
class com.disney.gem.games.PoohMarathon.content.Lumpy extends com.sarbakan.utils.StateManaged
{
var mcRef, nTimerPosition, nRandomAppearTime, setState, oWaterFlow, bStartingPositionIsSet, sndWaterThrowSound, mcBush, stateFinished, nStartingPosition;
function Lumpy (_mcRef) {
super();
mcRef = _mcRef;
nTimerPosition = 0;
mcRef.swapDepths(4999999);
mcRef.mcLumpyCollider._visible = false;
nRandomAppearTime = Math.floor(Math.random() * ((com.disney.gem.games.PoohMarathon.GameData.nLUMPY_APPEAR_MAX_TIME - com.disney.gem.games.PoohMarathon.GameData.nLUMPY_APPEAR_MIN_TIME) + 1)) + com.disney.gem.games.PoohMarathon.GameData.nLUMPY_APPEAR_MIN_TIME;
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_HIDE);
oWaterFlow = new com.disney.gem.games.PoohMarathon.content.WaterFlow(mcRef.mcWaterFlow);
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.addListener(oWaterFlow);
bStartingPositionIsSet = false;
}
function init() {
}
function onUpdate() {
super.onUpdate();
}
function getRef() {
return(mcRef);
}
function destroy() {
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.removeListener(oWaterFlow);
sndWaterThrowSound.doStop();
delete oWaterFlow;
}
function state_appear() {
mcBush._x = mcRef._x;
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_IDLE);
sndWaterThrowSound = com.sarbakan.sound.SoundManager.doPlaySound("Waterflow", 100, 1000, true);
oWaterFlow.setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_APPEAR);
}
}
function state_idle() {
checkDisappearMoment();
mcBush._x = mcRef._x;
}
function state_hide() {
checkAppearMoment();
move();
}
function state_disappear() {
oWaterFlow.setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_DISAPPEAR);
sndWaterThrowSound.doStop();
com.sarbakan.sound.SoundManager.doPlaySound("LumpyDisappear", 100, 1, true);
if (stateFinished()) {
mcBush.removeMovieClip();
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_HIDE);
}
}
function move() {
var _local2 = com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getPooh().getRef()._x;
mcRef._x = _local2 + com.disney.gem.games.PoohMarathon.GameData.nLUMPY_DISTANCE_FROM_POOH;
}
function checkAppearMoment() {
nTimerPosition++;
if (nTimerPosition >= nRandomAppearTime) {
nTimerPosition = 0;
var _local2 = com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getLevelEnd()._x;
if ((_local2 - mcRef._x) > com.disney.gem.games.PoohMarathon.GameData.nLUMPY_DISTANCE_FROM_LEVEL_END) {
com.sarbakan.sound.SoundManager.doPlaySound("LumpyAppear", 100, 1, true);
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_APPEAR);
mcBush = com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getRef().mcState.attachMovie("mcLumpyBush", "LumpyBush", 25, {_x:mcRef._x, _y:mcRef._y});
nRandomAppearTime = Math.floor(Math.random() * ((com.disney.gem.games.PoohMarathon.GameData.nLUMPY_APPEAR_MAX_TIME - com.disney.gem.games.PoohMarathon.GameData.nLUMPY_APPEAR_MIN_TIME) + 1)) + com.disney.gem.games.PoohMarathon.GameData.nLUMPY_APPEAR_MIN_TIME;
}
}
}
function checkDisappearMoment() {
var _local2 = new flash.geom.Point();
_local2.x = mcRef._x;
mcRef._parent.globalToLocal(_local2);
if (!bStartingPositionIsSet) {
nStartingPosition = _local2.x;
}
bStartingPositionIsSet = true;
var _local3 = nStartingPosition + com.disney.gem.games.PoohMarathon.GameData.nLUMPY_DISTANCE_TO_DISAPPEAR;
if (_local2.x >= _local3) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_DISAPPEAR);
bStartingPositionIsSet = false;
}
}
}
Symbol 732 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.content.WaterFlow] Frame 0
class com.disney.gem.games.PoohMarathon.content.WaterFlow extends com.sarbakan.utils.StateManaged
{
var mcRef, setState, stateFinished;
function WaterFlow (_mcRef) {
super();
mcRef = _mcRef;
mcRef._visible = false;
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_HIDE);
}
function init() {
}
function onUpdate() {
super.onUpdate();
}
function getRef() {
return(mcRef);
}
function state_appear() {
mcRef._visible = true;
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_IDLE);
}
}
function state_disappear() {
if (stateFinished()) {
mcRef._visible = false;
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_HIDE);
}
}
function state_idle() {
}
function state_hide() {
}
}
Symbol 733 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.content.SideScroller] Frame 0
class com.disney.gem.games.PoohMarathon.content.SideScroller
{
var mcRef, nLevelLength;
function SideScroller (_mcRef, _nLevelLength) {
mcRef = _mcRef;
mcRef._x = 0;
nLevelLength = _nLevelLength;
}
function init() {
}
function onUpdate() {
checkCamera();
checkBackgrounds(mcRef.mcBackground1, mcRef.mcBackground2);
checkBackgrounds(mcRef.mcBushes1, mcRef.mcBushes2);
}
function checkCamera() {
var _local2 = new flash.geom.Point();
_local2.x = mcRef.mcState.mcPooh._x;
mcRef.mcState.mcPooh._parent.localToGlobal(_local2);
com.disney.gem.games.PoohMarathon.Controller.game.getRef().globalToLocal(_local2);
var _local3 = com.disney.gem.games.PoohMarathon.GameData.ptSCREEN_CENTER.x - _local2.x;
var _local4 = mcRef._x + (com.disney.gem.games.PoohMarathon.GameData.ptSCREEN_CENTER.x - _local2.x);
if (_local3 < 0) {
if (_local4 < nLevelLength) {
_local4 = nLevelLength;
}
mcRef._x = _local4;
}
}
function checkBackgrounds(_mcBG1, _mcBG2) {
var _local4 = new flash.geom.Point();
_local4.x = _mcBG1._x;
_mcBG1._parent.localToGlobal(_local4);
com.disney.gem.games.PoohMarathon.Controller.game.getRef().globalToLocal(_local4);
if (_local4.x <= 0) {
_mcBG1._x = (_mcBG2._x + _mcBG1._width) - 1;
}
var _local5 = new flash.geom.Point();
_local5.x = _mcBG2._x;
_mcBG2._parent.localToGlobal(_local5);
com.disney.gem.games.PoohMarathon.Controller.game.getRef().globalToLocal(_local5);
if (_local5.x <= 0) {
_mcBG2._x = (_mcBG1._x + _mcBG2._width) - 1;
}
}
}
Symbol 734 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.content.HoneyPot] Frame 0
class com.disney.gem.games.PoohMarathon.content.HoneyPot extends com.sarbakan.utils.StateManaged
{
var mcRef, sType, setState, stateFinished;
function HoneyPot (_mcRef, _sType, _nNumber) {
super();
mcRef = _mcRef;
mcRef.swapDepths(200 + _nNumber);
mcRef.mcPotCollider._visible = false;
sType = _sType;
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.addListener(this);
setState(sSTATE_IDLE, true);
}
function init() {
}
function onUpdate() {
super.onUpdate();
}
function getRef() {
return(mcRef);
}
function getType() {
return(sType);
}
function state_hide() {
if (stateFinished()) {
mcRef.swapDepths(500);
mcRef.removeMovieClip();
}
}
function checkType() {
switch (sType) {
case "red" :
setState(sSTATE_HIDE, true);
com.disney.gem.games.PoohMarathon.Controller.game.increaseCurrentLevelScore(com.disney.gem.games.PoohMarathon.GameData.nPOWERUP_POT_SCORE);
com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getPooh().setInvincible(com.disney.gem.games.PoohMarathon.GameData.nRED_POT_INVINCIBLE_LENGTH);
com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_WALKINVINCIBLE);
com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getPooh().getPowerUp();
com.sarbakan.sound.SoundManager.doPlaySound("InvincibleLong", 100, 1, false);
break;
case "blue" :
com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getPooh().getRef().swapDepths(5000000);
setState(sSTATE_HIDE, true);
com.disney.gem.games.PoohMarathon.Controller.game.increaseCurrentLevelScore(com.disney.gem.games.PoohMarathon.GameData.nPOWERUP_POT_SCORE);
com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getPooh().setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_FLYSTART);
com.sarbakan.sound.SoundManager.doPlaySound("PoohFlyStart", 100, 1, true);
break;
case "green" :
setState(sSTATE_HIDE, true);
com.disney.gem.games.PoohMarathon.Controller.game.increaseCurrentLevelScore(com.disney.gem.games.PoohMarathon.GameData.nPOWERUP_POT_SCORE);
com.disney.gem.games.PoohMarathon.Controller.game.addtime();
break;
case "regular" :
setState(sSTATE_HIDE, true);
com.disney.gem.games.PoohMarathon.Controller.game.increaseCurrentLevelScore(com.disney.gem.games.PoohMarathon.GameData.nREGULAR_POT_SCORE);
}
com.sarbakan.sound.SoundManager.doPlaySound("PoohGetHP", 100, 1, false);
}
static var sSTATE_IDLE = "idle";
static var sSTATE_HIDE = "hide";
}
Symbol 735 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.content.Obstacle] Frame 0
class com.disney.gem.games.PoohMarathon.content.Obstacle extends com.sarbakan.utils.StateManaged
{
var mcRef, sType, bisShrinked, aClothesLineWColliders, aClothesLineJColliders, setState, stateFinished;
function Obstacle (_mcRef, _sType, _nDepth, _nCounter) {
super();
mcRef = _mcRef;
sType = _sType;
mcRef.swapDepths(_nDepth);
bisShrinked = false;
mcRef.mcObstacleWCollider._visible = false;
mcRef.mcObstacleJCollider._visible = false;
if (sType == "clothesline") {
aClothesLineWColliders = new Array();
mcRef.mcClothesWCollider1._visible = false;
aClothesLineWColliders.push(mcRef.mcClothesWCollider1);
mcRef.mcClothesWCollider2._visible = false;
aClothesLineWColliders.push(mcRef.mcClothesWCollider2);
mcRef.mcClothesWCollider3._visible = false;
aClothesLineWColliders.push(mcRef.mcClothesWCollider3);
aClothesLineJColliders = new Array();
mcRef.mcClothesJCollider1._visible = false;
aClothesLineJColliders.push(mcRef.mcClothesJCollider1);
mcRef.mcClothesJCollider2._visible = false;
aClothesLineJColliders.push(mcRef.mcClothesJCollider2);
mcRef.mcClothesJCollider3._visible = false;
aClothesLineJColliders.push(mcRef.mcClothesJCollider3);
com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getRef().mcState.attachMovie("mcClotheslineShadow", "mcCLShadow" + _nCounter, 500 + _nCounter, {_x:mcRef._x, _y:mcRef._y});
}
if (sType == "scarecrow") {
com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getRef().mcState.attachMovie("mcScarecrowShadow", "mcSCShadow" + _nCounter, 500 + _nCounter, {_x:mcRef._x, _y:mcRef._y});
}
if (sType == "fruitcart") {
com.disney.gem.games.PoohMarathon.Controller.game.getWorld().getRef().mcState.attachMovie("mcFruitcartShadow", "mcFCShadow" + _nCounter, 500 + _nCounter, {_x:mcRef._x, _y:mcRef._y});
}
if (sType == "puddle") {
mcRef._y = mcRef._y - 10;
}
com.disney.gem.games.PoohMarathon.Controller.getInstance().oMainBroadcaster.addListener(this);
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_IDLE);
}
function init() {
}
function onUpdate() {
super.onUpdate();
}
function getRef() {
return(mcRef);
}
function getType() {
return(sType);
}
function checkIfShrinked() {
return(bisShrinked);
}
function getClothesLineWColliders() {
return(aClothesLineWColliders);
}
function getClothesLineJColliders() {
return(aClothesLineJColliders);
}
function state_shrink() {
if (!bisShrinked) {
bisShrinked = true;
}
if (stateFinished()) {
setState(com.disney.gem.games.PoohMarathon.GameData.sSTATE_SHRINKED);
}
}
function state_shrinked() {
}
}
Symbol 736 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.popups.MenuPopup] Frame 0
class com.disney.gem.games.PoohMarathon.popups.MenuPopup extends com.sarbakan.utils.ScreenController
{
var oController, hide, mcRef;
function MenuPopup (_mcRef) {
super(_mcRef);
}
function onBtSound() {
com.disney.gem.games.PoohMarathon.Controller(oController).toggleSound();
updateSoundGroup();
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtHelp() {
com.disney.gem.games.PoohMarathon.Controller(oController).showInstructions();
hide(null, true);
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtQuit() {
com.disney.gem.games.PoohMarathon.Controller(oController).showPopup(new com.disney.gem.games.PoohMarathon.popups.ConfirmPopup(com.disney.gem.games.PoohMarathon.Controller(oController).mcTimeline.mcPopups.mcConfirm, this), true);
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtResume() {
com.disney.gem.games.PoohMarathon.Controller(oController).unpause();
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
hide();
}
function state_in_init() {
super.state_in_init();
com.sarbakan.sound.SoundManager.doPlaySound("PopupIn", 100, 1, true);
setBts();
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_idle() {
updateSoundGroup();
}
function state_out_init() {
super.state_out_init();
com.sarbakan.sound.SoundManager.doPlaySound("PopupOut", 100, 1, true);
setBts();
}
function setBts() {
mcRef.mcState.mcContent.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.mcContent.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
mcRef.mcState.mcContent.btQuit.onRelease = com.sarbakan.utils.Delegate.create(this, onBtQuit);
mcRef.mcState.mcContent.btQuit.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
mcRef.mcState.mcContent.btResume.onRelease = com.sarbakan.utils.Delegate.create(this, onBtResume);
mcRef.mcState.mcContent.btResume.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
updateSoundGroup();
}
function updateSoundGroup() {
var _local2 = "On";
if (com.disney.gem.games.PoohMarathon.Controller(oController).bSoundMuted) {
_local2 = "Off";
}
mcRef.mcState.mcContent.mcSoundToggle.gotoAndStop(_local2);
mcRef.mcState.mcContent.mcSoundToggle.btSound.onRelease = com.sarbakan.utils.Delegate.create(this, onBtSound);
mcRef.mcState.mcContent.mcSoundToggle.btSound.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
}
function onBtRoll() {
com.sarbakan.sound.SoundManager.doPlaySound("ButtonRoll", 100, 1, false);
}
}
Symbol 737 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.popups.ConfirmPopup] Frame 0
class com.disney.gem.games.PoohMarathon.popups.ConfirmPopup extends com.sarbakan.utils.ScreenController
{
var oMenuOrigin, hide, oController, mcRef;
function ConfirmPopup (_mcRef, _oMenuOrigin) {
super(_mcRef);
oMenuOrigin = _oMenuOrigin;
}
function onBtNo() {
hide();
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtYes() {
hide();
com.disney.gem.games.PoohMarathon.Controller(oController).onGameLose();
oMenuOrigin.hide();
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function state_in_init() {
super.state_in_init();
com.sarbakan.sound.SoundManager.doPlaySound("PopupIn", 100, 1, true);
setBts();
}
function state_idle_init() {
super.state_idle_init();
setBts();
}
function state_out_init() {
super.state_out_init();
com.sarbakan.sound.SoundManager.doPlaySound("PopupOut", 100, 1, true);
setBts();
}
function setBts() {
mcRef.mcState.mcContent.btYes.onRelease = com.sarbakan.utils.Delegate.create(this, onBtYes);
mcRef.mcState.mcContent.btYes.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
mcRef.mcState.mcContent.btNo.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNo);
mcRef.mcState.mcContent.btNo.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
}
function onBtRoll() {
com.sarbakan.sound.SoundManager.doPlaySound("ButtonRoll", 100, 1, false);
}
}
Symbol 738 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.screens.TitleScreen] Frame 0
class com.disney.gem.games.PoohMarathon.screens.TitleScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function TitleScreen (_mcRef) {
super(_mcRef);
}
function onBtHelp() {
com.disney.gem.games.PoohMarathon.Controller(oController).showInstructions();
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtPlay() {
com.disney.gem.games.PoohMarathon.Controller(oController).startNewGame();
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtRoll() {
com.sarbakan.sound.SoundManager.doPlaySound("ButtonRoll", 100, 1, false);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btHelp.onRelease = com.sarbakan.utils.Delegate.create(this, onBtHelp);
mcRef.mcState.mcContent.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
}
}
Symbol 739 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.screens.HelpScreen] Frame 0
class com.disney.gem.games.PoohMarathon.screens.HelpScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function HelpScreen (_mcRef) {
super(_mcRef);
}
function onBtBack() {
com.disney.gem.games.PoohMarathon.Controller(oController).hideInstructions();
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtRoll() {
com.sarbakan.sound.SoundManager.doPlaySound("ButtonRoll", 100, 1, false);
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btBack.onRelease = com.sarbakan.utils.Delegate.create(this, onBtBack);
mcRef.mcState.mcContent.btBack.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
}
}
Symbol 740 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.screens.EndScreen] Frame 0
class com.disney.gem.games.PoohMarathon.screens.EndScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function EndScreen (_mcRef) {
super(_mcRef);
}
function onBtPlay() {
com.disney.gem.games.PoohMarathon.Controller(oController).showTitleScreen(true);
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtRoll() {
com.sarbakan.sound.SoundManager.doPlaySound("ButtonRoll", 100, 1, false);
}
function state_idle_init() {
super.state_idle_init();
var _local3 = com.disney.gem.games.PoohMarathon.Controller.game.getCurrentLevelScore();
com.disney.gem.games.PoohMarathon.Controller.getInstance().increaseScore(_local3);
mcRef.mcState.mcContent.mcFinalScore.txtFinalScore.text = com.disney.gem.games.PoohMarathon.Controller.getInstance().getScore();
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
}
}
Symbol 741 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.screens.WinScreen] Frame 0
class com.disney.gem.games.PoohMarathon.screens.WinScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function WinScreen (_mcRef) {
super(_mcRef);
}
function onBtNext() {
com.disney.gem.games.PoohMarathon.Controller(oController).showTitleScreen(true);
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtRoll() {
com.sarbakan.sound.SoundManager.doPlaySound("ButtonRoll", 100, 1, false);
}
function state_idle_init() {
var _local2 = com.disney.gem.games.PoohMarathon.Controller.game.getCurrentLevelScore();
com.disney.gem.games.PoohMarathon.Controller.getInstance().increaseScore(_local2);
var _local3 = com.disney.gem.games.PoohMarathon.Controller.game.getTimeLeft();
var _local4 = _local3 * com.disney.gem.games.PoohMarathon.GameData.nTIME_LEFT_SCORE_PER_SECOND;
var _local5 = com.disney.gem.games.PoohMarathon.Controller.getInstance().getScore() + _local4;
mcRef.mcState.mcContent.mcFinalScore.txtFinalScore.text = _local5;
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNext);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
}
}
Symbol 742 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.screens.LevelEndScreen] Frame 0
class com.disney.gem.games.PoohMarathon.screens.LevelEndScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function LevelEndScreen (_mcRef) {
super(_mcRef);
}
function onBtNextLevel() {
com.disney.gem.games.PoohMarathon.Controller(oController).startNextLevel();
com.sarbakan.sound.SoundManager.doPlaySound("ButtonClick", 100, 1, false);
}
function onBtRoll() {
com.sarbakan.sound.SoundManager.doPlaySound("ButtonRoll", 100, 1, false);
}
function state_idle_init() {
super.state_idle_init();
var _local3 = com.disney.gem.games.PoohMarathon.Controller.game.getCurrentLevelScore();
com.disney.gem.games.PoohMarathon.Controller.getInstance().increaseScore(_local3);
var _local4 = com.disney.gem.games.PoohMarathon.Controller.game.getTimeLeft();
mcRef.mcState.mcContent.txtTimeLeft.text = _local4;
mcRef.mcState.mcContent.txtTimePoints.text = com.disney.gem.games.PoohMarathon.GameData.nTIME_LEFT_SCORE_PER_SECOND;
var _local5 = _local4 * com.disney.gem.games.PoohMarathon.GameData.nTIME_LEFT_SCORE_PER_SECOND;
mcRef.mcState.mcContent.txtTimeScore.text = _local5;
var _local6 = com.disney.gem.games.PoohMarathon.Controller.getInstance().getScore() + _local5;
mcRef.mcState.mcContent.mcScore.txtScore.text = _local6;
com.disney.gem.games.PoohMarathon.Controller.getInstance().setScore(_local6);
mcRef.mcState.mcContent.btNextLevel.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNextLevel);
mcRef.mcState.mcContent.btNextLevel.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtRoll);
}
}
Symbol 743 MovieClip [__Packages.com.disney.gem.games.PoohMarathon.screens.PreloaderScreen] Frame 0
class com.disney.gem.games.PoohMarathon.screens.PreloaderScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function PreloaderScreen (_mcRef) {
super(_mcRef);
}
function state_idle() {
var _local2 = com.disney.gem.games.PoohMarathon.Controller(oController).mcTimeline.getBytesLoaded() / com.disney.gem.games.PoohMarathon.Controller(oController).mcTimeline.getBytesTotal();
mcRef.mcState.txtLoading.text = Math.round(_local2 * 100) + "%";
if (_local2 == 1) {
com.disney.gem.games.PoohMarathon.Controller(oController).onPreloadingDone();
}
}
}
Symbol 20480 MovieClip [__Packages.org.flashdevelop.utils.TraceLevel] Frame 0
class org.flashdevelop.utils.TraceLevel
{
function TraceLevel () {
}
static var INFO = 0;
static var DEBUG = 1;
static var WARNING = 2;
static var ERROR = 3;
static var FATAL = 4;
}
Symbol 20481 MovieClip [__Packages.org.flashdevelop.utils.FlashConnect] Frame 0
class org.flashdevelop.utils.FlashConnect
{
static var messages, counter, socket, interval;
function FlashConnect () {
}
static function send(message) {
if (messages == null) {
initialize();
}
messages.push(message);
}
static function trace(message, level) {
var _local4 = createMsgNode(message, level);
send(_local4);
}
static function mtrace(message, method, path, line) {
if (path.charAt(1) != ":") {
path = "~/" + path;
}
var _local6 = (((path + ":") + line) + ":") + message;
trace(_local6, org.flashdevelop.utils.TraceLevel.DEBUG);
}
static function initialize() {
counter = 0;
messages = new Array();
socket = new XMLSocket();
socket.onData = function (data) {
org.flashdevelop.utils.FlashConnect.onReturnData(data);
};
socket.onConnect = function (success) {
if (success) {
org.flashdevelop.utils.FlashConnect.status = 1;
} else {
org.flashdevelop.utils.FlashConnect.status = -1;
}
org.flashdevelop.utils.FlashConnect.onConnection();
};
interval = _global.setInterval(sendStack, 50);
socket.connect(host, port);
}
static function createMsgNode(message, level) {
if (_global.isNaN(level)) {
level = org.flashdevelop.utils.TraceLevel.DEBUG;
}
var _local4 = new XMLNode(1, null);
var _local5 = new XMLNode(3, _global.escape(message));
_local4.attributes.state = level.toString();
_local4.attributes.cmd = "trace";
_local4.nodeName = "message";
_local4.appendChild(_local5);
return(_local4);
}
static function sendStack() {
if ((messages.length > 0) && (status == 1)) {
var _local2 = new XML();
var _local3 = _local2.createElement("flashconnect");
while (messages.length != 0) {
counter++;
if (counter > limit) {
_global.clearInterval(interval);
var _local4 = new String("FlashConnect aborted. You have reached the limit of maximum messages.");
var _local5 = createMsgNode(_local4, org.flashdevelop.utils.TraceLevel.ERROR);
_local3.appendChild(_local5);
break;
}
var _local6 = XMLNode(messages.shift());
_local3.appendChild(_local6);
}
_local2.appendChild(_local3);
socket.send(_local2);
}
}
static var status = 0;
static var limit = 1000;
static var host = "localhost";
static var port = 1978;
}
Symbol 476 MovieClip Frame 8
stop();
Symbol 557 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addHoneyPots(this, "regular");
Symbol 581 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addObstacles(this, "fruitcart");
Symbol 600 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addObstacles(this, "puddle");
Symbol 619 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addObstacles(this, "clothesline");
Symbol 637 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addObstacles(this, "trunk");
Symbol 641 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addHoneyPots(this, "green");
Symbol 645 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addHoneyPots(this, "blue");
Symbol 649 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addHoneyPots(this, "red");
Symbol 660 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addObstacles(this, "unicycle");
Symbol 685 MovieClip Frame 1
com.disney.gem.games.PoohMarathon.Controller.__get__game().getWorld().addObstacles(this, "scarecrow");