Frame 1
texts = new Array();
paths = new Array();
var myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("texts.xml");
myXML.onLoad = function (success) {
if (success) {
var _local1 = myXML.firstChild.childNodes;
i = 0;
while (i < _local1.length) {
var _local3 = _local1[i].firstChild;
var _local2 = _local3.firstChild.nodeValue;
var _local4 = _local1[i].attributes.name;
texts.push({name:_local4, text:_local2});
i++;
}
}
};
mcGame._visible = false;
mcGame.textos = texts;
var _oPreloaderScreen = (new com.disney.gem.games.woodyTowerRescue.screens.PreloaderScreen(mcScreens.mcPreloader));
com.sarbakan.BaseDisneyController.bDEBUG = false;
new com.disney.gem.games.woodyTowerRescue.Controller(this, _oPreloaderScreen);
Instance of Symbol 1110 MovieClip "mcGame" in Frame 1
onClipEvent (load) {
trace("//////////// " + this);
}
Frame 41
mcGame._visible = true;
Instance of Symbol 7 MovieClip in Symbol 8 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10);
this.removeMovieClip();
}
Instance of Symbol 20 MovieClip in Symbol 24 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10);
this.removeMovieClip();
}
Symbol 28 MovieClip Frame 1
this._visible = false;
Symbol 67 MovieClip Frame 1
nextFrame();
Symbol 67 MovieClip Frame 2
stop();
Symbol 199 MovieClip Frame 1
this._visible = false;
Symbol 201 MovieClip Frame 1
this._visible = false;
Symbol 207 MovieClip Frame 1
stop();
Symbol 207 MovieClip Frame 2
stop();
Symbol 417 MovieClip Frame 23
gotoAndPlay (1);
Symbol 417 MovieClip Frame 79
stop();
Symbol 417 MovieClip Frame 80
veces = 0;
Symbol 417 MovieClip Frame 170
stop();
Symbol 417 MovieClip Frame 207
stop();
Symbol 420 MovieClip Frame 1
this._visible = false;
Symbol 874 MovieClip Frame 1
this._visible = false;
Symbol 1107 MovieClip Frame 1
stop();
Symbol 1107 MovieClip Frame 8
gotoAndStop ("empty");
Symbol 1107 MovieClip Frame 55
gotoAndStop ("empty");
Symbol 1107 MovieClip Frame 101
gotoAndStop ("empty");
Symbol 1107 MovieClip Frame 148
gotoAndStop ("empty");
Instance of Symbol 1109 MovieClip in Symbol 1110 MovieClip Frame 1
onClipEvent (load) {
var newPaths = new Array();
_parent._parent.paths = [{name:"main score", path:_level0.mcGame.mcHud.score}, {name:"main menu", path:_level0.mcGame.mcHud.menubtn}];
this.onEnterFrame = function () {
function buscarTexto(n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < _parent._parent.texts.length) {
if (_parent._parent.texts[_local2].name == n) {
_local3 = _parent._parent.texts[_local2].text;
break;
}
_local2++;
}
return(_local3);
}
if (_parent._parent.paths.length == 0) {
delete this.onEnterFrame;
return(undefined);
}
if (_parent._parent.texts.length == 0) {
return(undefined);
}
while (_parent._parent.paths.length > 0) {
var _local3 = _parent._parent.paths.pop();
if (_local3.path) {
texto = buscarTexto(_local3.name);
if (texto != "") {
_local3.path.text = texto;
}
} else {
newPaths.push(_local3);
}
}
while (newPaths.length > 0) {
var _local5 = newPaths.pop();
_parent._parent.paths.push(_local5);
}
};
}
Symbol 1170 MovieClip Frame 1
stop();
Symbol 1172 MovieClip Frame 1
function localTrace(_sText) {
_host.txtTrace.text = _sText;
}
var _host = this;
_global.superTrace = localTrace;
Symbol 1422 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 1423 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 1424 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.screens.PreloaderScreen] Frame 0
class com.disney.gem.games.woodyTowerRescue.screens.PreloaderScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function PreloaderScreen (_mcRef) {
super(_mcRef);
}
function state_idle() {
var _local2 = com.disney.gem.games.woodyTowerRescue.Controller(oController).mcTimeline.getBytesLoaded() / com.disney.gem.games.woodyTowerRescue.Controller(oController).mcTimeline.getBytesTotal();
mcRef.mcState.txtPercent.text = Math.round(_local2 * 100) + "%";
mcRef.mcState.mcLoadingBar.gotoAndStop(Math.ceil(_local2 * 10));
if (_local2 == 1) {
com.disney.gem.games.woodyTowerRescue.Controller(oController).onPreloadingDone();
}
}
}
Symbol 1425 MovieClip [__Packages.com.sarbakan.BaseDisneyController] Frame 0
class com.sarbakan.BaseDisneyController
{
static var oInstance;
var mcTimeline, oPreloaderScreen, oMainBroadcaster, oFrameRate, aPopups, oTransitionManager, bSoundMuted, nLastSoundToggleTimer, bPaused, oDXDControllerWrapper, nGamePhase, oCurrentScreen, fScreenShowTransitionCallBack, fScreenHideCallBack, nLevel, nScore, bInstructionCanBeDisplayed, bInstructionActive, nLastUpdateTimer;
function BaseDisneyController (_mcTimeline, _oPreloaderScreen) {
oInstance = this;
mcTimeline = _mcTimeline;
_mcTimeline.stop();
oPreloaderScreen = _oPreloaderScreen;
oMainBroadcaster = new Object();
AsBroadcaster.initialize(oMainBroadcaster);
oMainBroadcaster.addListener(this);
if (bDEBUG) {
oFrameRate = new com.sarbakan.utils.FrameRateDisplayer(_mcTimeline, nFRAME_RATE, nGAME_STAGE_WIDTH);
oMainBroadcaster.addListener(oFrameRate);
} else {
Stage.showMenu = false;
mcTimeline._focusrect = false;
}
aPopups = new Array();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
setDXDCallback();
} else {
initStandAloneController();
}
}
static function getInstance() {
return(oInstance);
}
function init() {
setGamePhase(nGAME_PHASE_PACKAGING);
stopScreenContainers();
oTransitionManager = new com.sarbakan.utils.TransitionManager(mcTimeline.mcTransitions);
oMainBroadcaster.addListener(oTransitionManager);
bSoundMuted = false;
nLastSoundToggleTimer = getTimer();
}
function update(_nElapsed) {
if (bPaused) {
oMainBroadcaster.broadcastMessage("onUpdatePaused", _nElapsed);
} else {
oMainBroadcaster.broadcastMessage("onUpdate", _nElapsed);
}
checkGlobalKeys();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
bSoundMuted = oDXDControllerWrapper.isMuted();
}
}
function pause() {
if (!bPaused) {
bPaused = true;
oMainBroadcaster.broadcastMessage("onPause");
}
}
function unpause() {
if (bPaused) {
bPaused = false;
oMainBroadcaster.broadcastMessage("onUnPause");
}
}
function togglePause() {
if (bPaused) {
unpause();
} else {
pause();
}
}
function getControllerMode() {
var _local1;
if (com.disney.gem.base.BaseObject == undefined) {
_local1 = nCONTROLLER_MODE_STANDALONE;
} else {
_local1 = nCONTROLLER_MODE_DXD;
}
return(_local1);
}
function setGamePhase(_nPhase) {
nGamePhase = _nPhase;
switch (_nPhase) {
case nGAME_PHASE_PRELOADER :
mcTimeline.gotoAndStop("preloader");
break;
case nGAME_PHASE_PACKAGING :
mcTimeline.gotoAndStop("packaging");
break;
case nGAME_PHASE_INGAME :
mcTimeline.gotoAndStop("game");
}
}
function getGamePhase() {
return(nGamePhase);
}
function gameLog(_sText) {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.gameLog(_sText);
} else {
trace(_sText);
}
}
function showScreen(_oScreenController, _bInOut, _sTransitionID, _fMidTransitionCallBack) {
if (oCurrentScreen) {
hideCurrentScreen(com.sarbakan.utils.Delegate.create(this, showScreen, _oScreenController, _bInOut, null, _fMidTransitionCallBack), _sTransitionID);
} else {
oCurrentScreen = _oScreenController;
oCurrentScreen.setGameController(this);
if (_sTransitionID != undefined) {
fScreenShowTransitionCallBack = _fMidTransitionCallBack;
oTransitionManager.playTransition(_sTransitionID, com.sarbakan.utils.Delegate.create(this, onScreenShowTransitionMiddle, _bInOut));
} else {
oCurrentScreen.show(_bInOut);
_fMidTransitionCallBack();
}
oMainBroadcaster.addListener(oCurrentScreen);
}
}
function hideCurrentScreen(_fHideCallBack, _sTransition, _fEndCallBack) {
fScreenHideCallBack = _fHideCallBack;
if (_sTransition != undefined) {
oTransitionManager.playTransition(_sTransition, com.sarbakan.utils.Delegate.create(oCurrentScreen, oCurrentScreen.hide, com.sarbakan.utils.Delegate.create(this, onScreenHidden)), _fEndCallBack);
} else {
oCurrentScreen.hide(com.sarbakan.utils.Delegate.create(this, onScreenHidden));
}
}
function showPopup(_oPopupController, _bInOut) {
var _local5 = false;
var _local2 = aPopups.length - 1;
while (_local2 >= 0) {
var _local3 = aPopups[_local2];
if (_oPopupController.getRef() == _local3.getRef()) {
_local5 = true;
_local3.destroy();
oMainBroadcaster.removeListener(_local3);
aPopups[_local2] = _oPopupController;
break;
}
_local2--;
}
if (!_local5) {
aPopups.push(_oPopupController);
}
_oPopupController.setGameController(this);
_oPopupController.show(_bInOut);
oMainBroadcaster.addListener(_oPopupController);
}
function setLevel(_nLevel) {
nLevel = _nLevel;
}
function getLevel() {
return(nLevel);
}
function setScore(_nScore) {
nScore = _nScore;
}
function increaseScore(_nIncrement) {
nScore = nScore + _nIncrement;
}
function getScore() {
return(nScore);
}
function allowInstructions() {
bInstructionCanBeDisplayed = true;
}
function disallowInstructions() {
bInstructionCanBeDisplayed = false;
}
function showInstructions() {
if (canShowInstructions()) {
bInstructionActive = true;
showInstructionsScreen();
}
}
function hideInstructions() {
if (canHideInstructions()) {
bInstructionActive = false;
hideInstructionsScreen();
}
}
function toggleSound() {
if ((getTimer() - nLastSoundToggleTimer) >= nSOUND_TOGGLE_DELAY) {
bSoundMuted = !bSoundMuted;
nLastSoundToggleTimer = getTimer();
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.toggleSound();
} else {
toggleSoundStandalone();
}
}
}
function onPreloadingDone() {
hideCurrentScreen();
init();
}
function onGameStart() {
setLevel(1);
setScore(0);
}
function onLevelStart() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.startLevel(nLevel, nScore);
}
}
function onLevelEnd() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.endLevel(nLevel, nScore);
}
}
function onGameEnd() {
if (getControllerMode() == nCONTROLLER_MODE_DXD) {
oDXDControllerWrapper.endGame(nLevel, nScore);
}
}
function onTransitionStart(_mcTransition) {
}
function onTransitionMiddle(_mcTransition) {
}
function onEnterFrame() {
var _local2 = getTimer();
update(_local2 - nLastUpdateTimer);
nLastUpdateTimer = _local2;
}
function onScreenShowTransitionMiddle(_bInOut) {
fScreenShowTransitionCallBack();
oCurrentScreen.show(_bInOut);
}
function onScreenHidden() {
oMainBroadcaster.removeListener(oCurrentScreen);
delete oCurrentScreen;
fScreenHideCallBack();
}
function setDXDCallback() {
mcTimeline.init = com.sarbakan.utils.Delegate.create(this, initDXDController);
}
function initDXDController(_oOwner) {
oDXDControllerWrapper = new com.sarbakan.DXDControllerWrapper(this, mcTimeline, _oOwner);
return(oDXDControllerWrapper);
}
function initStandAloneController() {
mcTimeline.onEnterFrame = com.sarbakan.utils.Delegate.create(this, onEnterFrame);
nLastUpdateTimer = getTimer();
initPreloader();
}
function initPreloader() {
setGamePhase(nGAME_PHASE_PRELOADER);
showScreen(oPreloaderScreen);
}
function checkGlobalKeys() {
if (Key.isDown(nKEY_INSTRUCTIONS)) {
if (!bInstructionActive) {
showInstructions();
} else {
hideInstructions();
}
}
if (Key.isDown(nKEY_SOUND)) {
toggleSound();
}
}
function toggleSoundStandalone() {
var _local2 = new Sound(mcTimeline);
if (!bSoundMuted) {
_local2.setVolume(100);
} else {
_local2.setVolume(0);
}
}
function canShowInstructions() {
return((((!bInstructionActive) && (bInstructionCanBeDisplayed)) && (!oCurrentScreen.isInOutTransitionning())) && (!oTransitionManager.isTransitionning()));
}
function canHideInstructions() {
return(((bInstructionActive && (bInstructionCanBeDisplayed)) && (!oCurrentScreen.isInOutTransitionning())) && (!oTransitionManager.isTransitionning()));
}
function showInstructionsScreen() {
}
function hideInstructionsScreen() {
}
function stopScreenContainers() {
var _local3 = [mcTimeline.mcPopups, mcTimeline.mcScreens];
var _local2 = _local3.length - 1;
while (_local2 >= 0) {
for (var _local4 in _local3[_local2]) {
_local3[_local2][_local4].stop();
}
_local2--;
}
}
function get TryNo() {
return(nTryNo);
}
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;
var nTryNo = 0;
}
Symbol 1426 MovieClip [__Packages.com.sarbakan.utils.TransitionManager] Frame 0
class com.sarbakan.utils.TransitionManager extends com.sarbakan.utils.StateManaged
{
var setPausable, mcTransitionContainer, oController, mcTransition, fMiddleCallBack, fEndCallBack, bTransitionning, setMC, setState, stateFinished, mcRef;
function TransitionManager (_mcTransition) {
super();
setPausable(false);
mcTransitionContainer = _mcTransition;
oController = com.disney.gem.games.woodyTowerRescue.Controller.getInstance();
for (var _local3 in mcTransitionContainer) {
mcTransitionContainer[_local3].stop();
}
}
function playTransition(_sTransitionID, _fMiddleCallBack, _fEndCallBack) {
mcTransition = mcTransitionContainer["mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)];
fMiddleCallBack = _fMiddleCallBack;
fEndCallBack = _fEndCallBack;
if (mcTransition == undefined) {
trace(("TransitionManager error: Unable to find mc" + com.sarbakan.utils.MoreString.upperFirstChar(_sTransitionID)) + " in transition movieclip");
} else {
bTransitionning = true;
setMC(mcTransition);
setState(sSTATE_IN);
}
}
function isTransitionning() {
return(bTransitionning);
}
function state_in() {
if (stateFinished()) {
setState(sSTATE_OUT);
fMiddleCallBack();
}
}
function state_out() {
if (mcRef.mcState._currentframe == nFRAME_OUT1) {
oController.oSoundPlayer.playTransitionOut(1);
} else if (mcRef.mcState._currentframe == nFRAME_OUT2) {
oController.oSoundPlayer.playTransitionOut(2);
} else if (mcRef.mcState._currentframe == nFRAME_OUT3) {
oController.oSoundPlayer.playTransitionOut(3);
}
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";
static var nFRAME_OUT1 = 13;
static var nFRAME_OUT2 = 27;
static var nFRAME_OUT3 = 50;
}
Symbol 1427 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 1428 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 1429 MovieClip [__Packages.com.disney.gem.games.GameContainer] Frame 0
interface com.disney.gem.games.GameContainer
{
}
Symbol 1430 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 1431 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 1432 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.Controller] Frame 0
class com.disney.gem.games.woodyTowerRescue.Controller extends com.sarbakan.BaseDisneyController
{
var bDeleteOldGame, oSoundPlayer, nTryNo, sGameStep, endScreen, mcTimeline, disallowInstructions, pause, showPopup, showScreen, allowInstructions, setLevel, bPaused, unpause, setScore, onGameStart, oGame, oMainBroadcaster, score, nGamePhase, hideCurrentScreen, 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.woodyTowerRescue.GameData.sCAT_MUSIC, com.disney.gem.games.woodyTowerRescue.GameData.nMUSIC_CAT_VOLUME);
com.sarbakan.sound.SoundManager.setCategoryVolume(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, com.disney.gem.games.woodyTowerRescue.GameData.nSOUND_CAT_VOLUME);
oSoundPlayer = new com.disney.gem.games.woodyTowerRescue.SoundPlayer("oSoundPlayer");
}
static function getInstance() {
return(com.disney.gem.games.woodyTowerRescue.Controller(com.sarbakan.BaseDisneyController.oInstance));
}
function init() {
super.init();
nTryNo = 0;
sGameStep = sSTEP_INIT;
manageGameStep();
endScreen = new com.disney.gem.games.woodyTowerRescue.screens.EndScreen(mcTimeline.mcScreens.mcLose);
endScreen.setGameController(this);
}
function manageGameStep() {
this[sGameStep]();
}
function callPopup(_sPopupName) {
switch (_sPopupName) {
case "Menu" :
oSoundPlayer.stopAllSFX();
disallowInstructions();
pause();
showPopup(new com.disney.gem.games.woodyTowerRescue.popups.MenuPopup(mcTimeline.mcPopups.mcMenu), true);
break;
case "Quit" :
showPopup(new com.disney.gem.games.woodyTowerRescue.popups.ConfirmPopup(mcTimeline.mcPopups.mcQuitConfirm));
break;
}
}
function showTitleScreen(_bShowTransition) {
if (_bShowTransition) {
showScreen(new com.disney.gem.games.woodyTowerRescue.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.woodyTowerRescue.screens.TitleScreen(mcTimeline.mcScreens.mcTitle));
}
allowInstructions();
}
function startNewGame() {
setLevel(0);
if (bPaused) {
unpause();
}
resetTries();
trace("************ SETTING SCORE 0 *************");
setScore(0);
onGameStart();
sGameStep = sSTEP_INITGAME;
manageGameStep();
}
function createGame() {
if (oGame == undefined) {
oGame = new com.disney.gem.games.woodyTowerRescue.GameEngine(this, mcTimeline.mcGame);
oMainBroadcaster.addListener(oGame);
oGame.init();
}
score = new com.disney.gem.games.woodyTowerRescue.game.ScoresManager(oGame.__get__getHud(), "oScoresManager", this);
}
function startNextLevel() {
sGameStep = sSTEP_RESETGAME;
manageGameStep();
}
function showInstructionsScreen() {
pause();
showScreen(new com.disney.gem.games.woodyTowerRescue.screens.HelpScreen(mcTimeline.mcScreens.mcHelp), false, sTRANSITION_DEFAULT);
}
function hideInstructionsScreen() {
if (nGamePhase == com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME) {
unpause();
hideCurrentScreen(null, sTRANSITION_DEFAULT);
} else {
showScreen(new com.disney.gem.games.woodyTowerRescue.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), false, sTRANSITION_DEFAULT);
}
}
function setCurrentTry(_bSuccess) {
if (_bSuccess) {
aTries[nTryNo] = nTRY_SUCCESS;
} else {
aTries[nTryNo] = nTRY_FAIL;
}
oGame.updateTries();
nTryNo++;
}
function resetTries() {
var _local2 = 0;
while (_local2 < aTries.length) {
aTries[_local2] = 0;
_local2++;
}
nTryNo = 0;
}
function checkTries() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < aTries.length) {
if (aTries[_local2] == nTRY_SUCCESS) {
_local3++;
}
_local2++;
}
if (nTryNo >= aTries.length) {
if (_local3 >= com.disney.gem.games.woodyTowerRescue.GameData.nMIN_SUCCESS_TO_WIN) {
onGameWon();
} else {
onGameLose();
}
} else {
manageGameStep();
}
}
function onLevelTransitionClose() {
hideCurrentScreen();
pause();
manageGameStep();
}
function onLevelTransitionDone() {
if (sGameStep == sSTEP_LASSO) {
manageGameStep();
}
}
function onPlayerFalls() {
setCurrentTry(false);
sGameStep = sSTEP_PREPARE_RESETPLAYER;
}
function onPlayerSucceeds() {
setCurrentTry(true);
sGameStep = sSTEP_SHOWLEVELCOMPLETED;
}
function onGameQuit() {
oSoundPlayer.stopAllSFX();
allowInstructions();
oSoundPlayer.playPackMusic();
setScore(0);
onLevelEnd();
onGameEnd();
oGame.deleteObject();
showScreen(new com.disney.gem.games.woodyTowerRescue.screens.TitleScreen(mcTimeline.mcScreens.mcTitle), true, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, setGamePhase, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
if (bPaused) {
unpause();
}
}
function onGameLose() {
oSoundPlayer.stopAllSFX();
oSoundPlayer.playPackMusic();
onLevelEnd();
onGameEnd();
oGame.deleteObject();
showScreen(new com.disney.gem.games.woodyTowerRescue.screens.EndScreen(mcTimeline.mcScreens.mcLose), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, setGamePhase, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
if (bPaused) {
unpause();
}
}
function onGameWon() {
oSoundPlayer.stopAllSFX();
oSoundPlayer.playPackMusic();
onLevelEnd();
onGameEnd();
oGame.deleteObject();
showScreen(new com.disney.gem.games.woodyTowerRescue.screens.EndScreen(mcTimeline.mcScreens.mcWin), false, sTRANSITION_DEFAULT, com.sarbakan.utils.Delegate.create(this, setGamePhase, com.sarbakan.BaseDisneyController.nGAME_PHASE_PACKAGING));
if (bPaused) {
unpause();
}
}
function step_loseScreen() {
endScreen.show(false);
oMainBroadcaster.addListener(endScreen);
}
function step_Init() {
sGameStep = sSTEP_TITLE_SCREEN;
manageGameStep();
}
function step_TitleScreen() {
oSoundPlayer.playPackMusic();
showTitleScreen(true);
}
function step_initGame() {
sGameStep = sSTEP_GAME;
setLevel(1);
onLevelStart();
oTransitionManager.playTransition("default", com.sarbakan.utils.Delegate.create(this, onLevelTransitionClose), com.sarbakan.utils.Delegate.create(this, onLevelTransitionDone));
}
function step_Game() {
oSoundPlayer.playInGameMusic();
setGamePhase(com.sarbakan.BaseDisneyController.nGAME_PHASE_INGAME);
createGame();
oGame.resetPlayer();
sGameStep = sSTEP_LASSO;
}
function step_Lasso() {
oGame.throwLasso();
sGameStep = sSTEP_LAUNCH;
manageGameStep();
}
function step_LaunchPhase() {
unpause();
onLevelStart();
sGameStep = sSTEP_AIR;
}
function step_AirPhase() {
oGame.lockControls();
sGameStep = sSTEP_SHOWLEVELCOMPLETED;
}
function step_beforeResetPlayer() {
sGameStep = sSTEP_RESETPLAYER;
checkTries();
}
function step_showLevelCompleted() {
sGameStep = sSTEP_RESETGAME;
checkTries();
}
function step_ResetGame() {
pause();
oSoundPlayer.stopAllSFX();
sGameStep = sSTEP_INITGAME;
oGame.deleteObject();
manageGameStep();
}
function step_ResetPlayer() {
sGameStep = sSTEP_GAME;
oGame.resetRope();
oGame.rewindCamera();
}
function step_ResetDone() {
}
function get Tries() {
return(aTries);
}
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_LASSO = "step_Lasso";
static var sSTEP_INITGAME = "step_initGame";
static var sSTEP_LAUNCH = "step_LaunchPhase";
static var sSTEP_AIR = "step_AirPhase";
static var sSTEP_PREPARE_RESETPLAYER = "step_beforeResetPlayer";
static var sSTEP_LOSE_SCREEN = "step_loseScreen";
static var sSTEP_RESETPLAYER = "step_ResetPlayer";
static var sSTEP_RESETGAME = "step_ResetGame";
static var sSTEP_RESET_DONE = "step_ResetDone";
static var sSTEP_STARTNEXTLEVEL = "step_startNextLevel";
static var sSTEP_SHOWLEVELCOMPLETED = "step_showLevelCompleted";
static var sSTEP_SHOWLEVELFAILED = "step_showLevelCompleted";
static var sSTEP_LOSE = "step_Lose";
static var sSTEP_WIN = "step_Win";
static var nTRY_SUCCESS = 2;
static var nTRY_FAIL = 1;
var multiplier = 1;
var aTries = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
}
Symbol 1433 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.GameEngine] Frame 0
class com.disney.gem.games.woodyTowerRescue.GameEngine
{
var oController, mcGame, enemy, enemyCopy, platformEnd, mcRope, oHud, oPlayer, oCam, oCamParallax;
function GameEngine (_oController, _mcGame) {
oController = _oController;
mcGame = _mcGame;
trace("-------------> " + mcGame.textos);
mcGame.mcHud.btMenu.onRelease = com.sarbakan.utils.Delegate.create(this, onBtMenu);
mcGame.mcHud.btMenu.onRollOver = com.sarbakan.utils.Delegate.create(this, onMenuBtRollOver);
mcGame.mcHud.btMenu.onRollOut = com.sarbakan.utils.Delegate.create(this, onMenuBtRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcGame.mcHud.btMenu);
mcGame.btWin.onRelease = com.sarbakan.utils.Delegate.create(this, onBtWin);
mcGame.btWin.onRollOver = com.sarbakan.utils.Delegate.create(this, onWinBtRollOver);
mcGame.btWin.onRollOut = com.sarbakan.utils.Delegate.create(this, onWinBtRollOut);
mcGame.btLose.onRelease = com.sarbakan.utils.Delegate.create(this, onBtLose);
mcGame.btLose.onRollOver = com.sarbakan.utils.Delegate.create(this, onLoseBtRollOver);
mcGame.btLose.onRollOut = com.sarbakan.utils.Delegate.create(this, onLoseBtRollOut);
}
function init() {
enemy = new com.disney.gem.games.woodyTowerRescue.game.Enemy(mcGame.mcBg.enemies);
enemyCopy = new com.disney.gem.games.woodyTowerRescue.game.Enemy(mcGame.mcBg.enemiesCopy);
platformEnd = mcGame.mcBg.platformend;
mcRope = mcGame.mcBg.mcRope;
oHud = new com.disney.gem.games.woodyTowerRescue.game.Hud(mcGame.mcHud);
oPlayer = new com.disney.gem.games.woodyTowerRescue.game.Player(mcGame.mcBg.mcPlayerItem.mcPlayer, "oPlayer", this);
oCam = new com.disney.gem.games.woodyTowerRescue.game.backgrounds.Cam(mcGame.mcBg, mcGame.loopFg, oPlayer, "oCam", this);
oCamParallax = new com.disney.gem.games.woodyTowerRescue.game.backgrounds.CamParallax(mcGame.mcBgParallaxCtn, mcGame.mcBg, "oCamParallax", this);
}
function throwLasso() {
oPlayer.setState(com.disney.gem.games.woodyTowerRescue.game.Player.sSTATE_THROWLASSO);
}
function unlockControls() {
oPlayer.unlockControls();
}
function lockControls() {
oPlayer.lockControls();
}
function updateTries() {
oHud.updateTries();
}
function resetRope() {
oPlayer.resetRope();
oPlayer.setState(com.disney.gem.games.woodyTowerRescue.game.Player.sSTATE_HIDDEN, true);
}
function resetPlayer() {
oPlayer.resetPlayer();
oPlayer.setState(com.disney.gem.games.woodyTowerRescue.game.Player.sSTATE_CLIMB);
}
function rewindCamera() {
oCam.startRewind();
}
function deleteObject() {
oPlayer.deleteObject();
oCam.deleteObject();
oCamParallax.deleteObject();
delete oController.oGame;
}
function onUpdate() {
}
function onPause() {
mcGame.mcMouth.stop();
}
function onUnPause() {
mcGame.mcMouth.play();
}
function onBtLose() {
oController.onGameLose();
}
function onBtWin() {
oController.onGameWon();
}
function getText(n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < mcGame.textos.length) {
if (mcGame.textos[_local2].name == n) {
_local3 = mcGame.textos[_local2].text;
break;
}
_local2++;
}
return(_local3);
}
function onMenuBtRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcGame.mcHud.menubtn.setTextFormat(_local2);
}
function onMenuBtRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcGame.mcHud.menubtn.setTextFormat(_local2);
}
function onWinBtRollOver() {
trace("onWinBtRollOver called");
}
function onWinBtRollOut() {
trace("onWinBtRollOut called");
}
function onLoseBtRollOver() {
trace("onLoseBtRollOver called");
}
function onLoseBtRollOut() {
trace("onLoseBtRollOut called");
}
function onBtMenu() {
oController.pause();
oController.callPopup("Menu");
}
function get Mc() {
return(mcGame);
}
function get getHud() {
return(oHud);
}
static var nCHICKEN_SPEED = 4;
}
Symbol 1434 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.game.Player] Frame 0
class com.disney.gem.games.woodyTowerRescue.game.Player extends com.sarbakan.utils.StateManaged
{
var oOwner, sName, oKeyboardManager, oController, setState, nRotation, nPosX, nPosY, mcRef, bAllowControls, stateFinished, justStarted, animLeft, nFrame, nDirection, nOldDir, nMomentum, bInAir, nAmplitude, bRopeSlowed, bCamFollow, nJumpDuration, nJumpFrame, nJumpSpeed, nJumpAmplitude, nEndTowerPos, bPlayerRopeSFX, enemies, jumpsLeft, gonnaWin, checkAllWon, points, sState, getState, oJumpStart, collideFrame, oJumpEnd, oInterpolationPt;
function Player (_mcRef, _sName, _oOwner) {
super(_mcRef);
oOwner = _oOwner;
sName = _sName;
oKeyboardManager = new com.disney.gem.games.woodyTowerRescue.library.KeyboardManager();
oKeyboardManager.addArrowKeys();
oKeyboardManager.addKey(32);
oKeyboardManager.addKey(com.disney.gem.games.woodyTowerRescue.library.KeyboardManager.nKEY_US_W);
oKeyboardManager.addKey(com.disney.gem.games.woodyTowerRescue.library.KeyboardManager.nKEY_US_L);
oController = com.disney.gem.games.woodyTowerRescue.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
setState(sSTATE_LASSOIDLE, true);
initVars();
}
function setPosition(_nPosX, _nPosY) {
trace("------------> rotation " + nRotation);
nPosX = int(_nPosX * 10) / 10;
nPosY = int(_nPosY * 10) / 10;
mcRef._x = nPosX;
mcRef._y = nPosY;
}
function resetPlayer() {
initVars();
}
function unlockControls() {
bAllowControls = true;
}
function lockControls() {
bAllowControls = false;
}
function deleteObject() {
setState(sSTATE_HIDDEN);
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function onPause() {
super.onPause();
mcRef.mcState.mcHead.stop();
mcRef.mcState.mcHead.mcEyeR.stop();
mcRef.mcState.mcHead.mcEyeL.stop();
mcRef.mcState.mcEyeR.stop();
mcRef.mcState.mcEyeL.stop();
}
function onUnPause() {
super.onUnPause();
mcRef.mcState.mcHead.play();
mcRef.mcState.mcHead.mcEyeR.play();
mcRef.mcState.mcHead.mcEyeL.play();
mcRef.mcState.mcEyeR.play();
mcRef.mcState.mcEyeL.play();
}
function state_hidden() {
lockControls();
}
function state_climb() {
if (mcRef.mcState._currentframe == nFRAME_CLIMB1) {
oController.oSoundPlayer.playClimbing(1);
} else if (mcRef.mcState._currentframe == nFRAME_CLIMB2) {
oController.oSoundPlayer.playClimbing(2);
} else if (mcRef.mcState._currentframe == nFRAME_CLIMB3) {
oController.oSoundPlayer.playClimbing(3);
} else if (mcRef.mcState._currentframe == nFRAME_CLIMB4) {
oController.oSoundPlayer.playClimbing(4);
} else if (mcRef.mcState._currentframe == nFRAME_CLIMB5) {
oController.oSoundPlayer.playClimbing(5);
}
if (stateFinished()) {
setState(sSTATE_THROWLASSO);
}
}
function state_lassoIdle() {
}
function state_throwLasso_init() {
oController.oSoundPlayer.playPlayerThrowLasso();
}
function state_throwLasso() {
if (stateFinished()) {
setState(sSTATE_IDLE);
}
}
function state_idle_init() {
if (!justStarted) {
unlockControls();
} else {
var _local2 = oOwner.getText("level");
oOwner.__get__getHud().showBigText(_local2 + (oController.__get__TryNo() + 1));
animLeft--;
}
}
function state_idle() {
if (justStarted) {
if (oOwner.__get__getHud().__get__popText()._currentframe == 1) {
if (animLeft == 1) {
var _local2 = oOwner.getText("start");
oOwner.__get__getHud().showBigText(_local2);
animLeft--;
} else if (animLeft == 0) {
unlockControls();
justStarted = false;
}
} else {
oOwner.__get__getHud().__get__popText().play();
}
}
}
function state_swingStart() {
if (mcRef.mcState._currentframe == nFRAME_STARTSWING1) {
oController.oSoundPlayer.playPlayerStartSwing();
}
if (stateFinished()) {
setState(sSTATE_SWITCH_FORWARDSLOW);
}
}
function state_switchForwardSlow() {
if (stateFinished()) {
setState(sSTATE_SWING_FORWARDSLOW);
}
}
function state_swingForwardSlow() {
}
function state_switchForwardFast() {
if (stateFinished()) {
setState(sSTATE_SWING_FORWARDFAST);
}
}
function state_swingForwardFast() {
}
function state_switchBackSlow() {
if (stateFinished()) {
setState(sSTATE_SWING_BACKSLOW);
}
}
function state_swingBackSlow() {
if ((nFrame == 0) && (nRotation == 0)) {
setState(sSTATE_SWITCH_FORWARDSLOW, true);
}
}
function state_switchBackFast() {
if (stateFinished()) {
setState(sSTATE_SWING_BACKFAST);
}
}
function state_swingBackFast() {
}
function state_getInGood_init() {
oController.oSoundPlayer.playGetInGood();
}
function state_getInGood() {
if (stateFinished()) {
setState(sSTATE_HIDDEN, true);
oController.onPlayerSucceeds();
oController.manageGameStep();
}
}
function state_dontGetIn_init() {
oController.onPlayerFalls();
}
function state_dontGetIn() {
if (stateFinished()) {
setState(sSTATE_HIDDEN, true);
oController.manageGameStep();
}
}
function state_fallOut_init() {
nRotation = nSTART_ANGLE;
applyAngle();
lockControls();
oController.onPlayerFalls();
}
function state_fallOut() {
if (mcRef.mcState._currentframe == nFRAME_FALLOUT1) {
oController.oSoundPlayer.playFallOut(1);
} else if (mcRef.mcState._currentframe == nFRAME_FALLOUT2) {
oController.oSoundPlayer.playFallOut(2);
}
if (stateFinished()) {
setState(sSTATE_HIDDEN, true);
oController.manageGameStep();
}
}
function state_hitWall_init() {
oController.onPlayerFalls();
}
function state_hitWall() {
if (mcRef.mcState._currentframe == nFRAME_HITWALL1) {
} else if (mcRef.mcState._currentframe == nFRAME_HITWALL2) {
}
if (stateFinished()) {
setState(sSTATE_HIDDEN, true);
oController.manageGameStep();
}
}
function state_jump_init() {
oController.oSoundPlayer.playJump();
}
function state_jump() {
applyGravity();
}
function state_jumpShort_init() {
oController.onPlayerFalls();
}
function state_jumpShort() {
if (mcRef.mcState._currentframe == nFRAME_JUMPSHORT1) {
oController.oSoundPlayer.playJumpShort();
}
if (stateFinished()) {
setState(sSTATE_IDLE, true);
oController.manageGameStep();
}
}
function resetRope() {
oOwner.mcRope._x = nSTART_POS_X;
}
function initVars() {
oController.multiplier = 1;
setPosition(nSTART_POS_X, nSTART_POS_Y);
nDirection = 1;
nOldDir = 1;
nRotation = 0;
nMomentum = 0;
bInAir = false;
nAmplitude = nSTART_ANGLE;
nFrame = 0;
bRopeSlowed = false;
bAllowControls = false;
bCamFollow = false;
nJumpDuration = 0;
nJumpFrame = 0;
nJumpSpeed = 0;
nJumpAmplitude = 0;
nEndTowerPos = 0;
bPlayerRopeSFX = false;
var _local3 = oController.__get__TryNo();
if (!_local3) {
_local3 = 0;
}
trace("try num = " + _local3);
ROPE_DIF = com.disney.gem.games.woodyTowerRescue.GameData.ROPE_DIFS[_local3];
enemies = com.disney.gem.games.woodyTowerRescue.GameData.ENEMIES[_local3].concat();
enemies.reverse();
jumpsLeft = enemies.length;
oOwner.mcRope._x = nSTART_POS_X + ROPE_DIF;
oOwner.enemy.setX(nSTART_POS_X + (ROPE_DIF * enemyPos));
oOwner.enemy.setAnimal(enemies[jumpsLeft - 1]);
oOwner.enemyCopy.setAnimal(0);
oOwner.platformEnd._x = nSTART_POS_X + (ROPE_DIF * jumpsLeft);
oOwner.platformEnd.terk.gotoAndStop(1);
var _local4 = oController.__get__Tries();
var _local6 = _local4.length;
_local6--;
if (_local3 == _local6) {
trace("LAST LEVEL");
var _local5 = false;
var _local2 = 0;
while (_local2 < (_local3 - 1)) {
if (_local4[_local2] != 2) {
trace(("level " + _local2) + " faled");
_local5 = true;
}
_local2++;
}
if (!_local5) {
trace("last level and previous levels were won");
oOwner.platformEnd.bananas.gotoAndStop(2);
}
} else {
trace("current level: " + _local3);
}
gonnaWin = false;
checkAllWon = false;
justStarted = true;
animLeft = 2;
points = 0;
}
function onUpdate() {
super.onUpdate();
if (com.disney.gem.games.woodyTowerRescue.GameData.CHEATS) {
if (oKeyboardManager.isKeyJustPressed(com.disney.gem.games.woodyTowerRescue.library.KeyboardManager.nKEY_US_W)) {
setState(sSTATE_GETINGOOD);
return(undefined);
}
if (oKeyboardManager.isKeyJustPressed(com.disney.gem.games.woodyTowerRescue.library.KeyboardManager.nKEY_US_L)) {
setState(sSTATE_DONTGETIN);
return(undefined);
}
}
checkKeys();
if ((((((((sState == sSTATE_SWING_BACKFAST) || (sState == sSTATE_SWING_BACKSLOW)) || (sState == sSTATE_SWING_FORWARDFAST)) || (sState == sSTATE_SWING_FORWARDSLOW)) || (sState == sSTATE_SWITCH_BACKFAST)) || (sState == sSTATE_SWITCH_BACKSLOW)) || (sState == sSTATE_SWITCH_FORWARDFAST)) || (sState == sSTATE_SWITCH_FORWARDSLOW)) {
doPendulum();
applyAirFriction();
applyMomentum();
checkAmplitudeLimits();
applyAngle();
setDirection();
checkRopeSFX();
}
}
function setDirection() {
var _local2 = Math.sin(com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_FREQ * nFrame);
if (_local2 > 0) {
nDirection = 1;
} else {
nDirection = -1;
}
if (nOldDir != nDirection) {
changeSwingState();
nOldDir = nDirection;
}
}
function checkKeys() {
nMomentum = 0;
if (bAllowControls) {
oKeyboardManager.doUpdate(1);
switch (getState()) {
case sSTATE_IDLE :
if ((oKeyboardManager.isKeyJustPressed(37) || (oKeyboardManager.isKeyJustPressed(39))) || (oKeyboardManager.isKeyJustPressed(32))) {
setState(sSTATE_SWINGSTART);
}
break;
case sSTATE_SWING_BACKFAST :
case sSTATE_SWING_BACKSLOW :
case sSTATE_SWING_FORWARDFAST :
case sSTATE_SWING_FORWARDSLOW :
case sSTATE_SWITCH_BACKFAST :
case sSTATE_SWITCH_BACKSLOW :
case sSTATE_SWITCH_FORWARDFAST :
case sSTATE_SWITCH_FORWARDSLOW :
if (nAmplitude == 0) {
if (oKeyboardManager.isKeyDown(39)) {
doStartupKick(1);
} else if (oKeyboardManager.isKeyDown(37)) {
doStartupKick(-1);
}
} else if ((oKeyboardManager.isKeyJustPressed(32) && (nDirection == 1)) && (nRotation < 0)) {
setJumpStartPoint();
checkJumpMode();
} else {
if (!(((nDirection == 1) && (oKeyboardManager.isKeyDown(39))) || ((nDirection == -1) && (oKeyboardManager.isKeyDown(37))))) {
break;
}
doMomentum();
}
}
}
}
function doMomentum() {
var _local2 = Math.abs(Math.sin(com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_FREQ * nFrame));
nMomentum = _local2 * com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MOMENTUM;
}
function doStartupKick(_nDirection) {
if (_nDirection > 0) {
nFrame = Math.round(Math.PI / (2 * com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_FREQ));
} else {
nFrame = Math.round(9.42477796076938 / (2 * com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_FREQ));
}
nAmplitude = com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_INIT_SPEED;
}
function doPendulum() {
if (nAmplitude == com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MIN_AMPLITUDE) {
nFrame = 0;
nRotation = 0;
} else {
nRotation = nAmplitude * Math.cos(com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_FREQ * nFrame);
nFrame++;
}
}
function checkRopeSFX() {
var _local3 = 0;
var _local4 = 0;
var _local2 = 0;
if (!bPlayerRopeSFX) {
if ((Math.abs(nRotation) <= com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ANGLE_TO_SWING_FAST) && (Math.abs(nRotation) <= com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ANGLE_TO_SWING_SLOW)) {
bPlayerRopeSFX = true;
oController.oSoundPlayer.playSwing(2, com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_SWING_SLOW_VOLUME);
} else {
_local4 = (nAmplitude - com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MIN_AMPLITUDE) / (com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MAX_AMPLITUDE - com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MIN_AMPLITUDE);
_local3 = (_local4 * (com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MAX_SWING_VOLUME - com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MIN_SWING_VOLUME)) + com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MIN_SWING_VOLUME;
if ((Math.cos(com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_FREQ * nFrame) > 0) && (nAmplitude > 0)) {
_local2 = nSWING_ANGLE_RATIO * nAmplitude;
if (nRotation < _local2) {
bPlayerRopeSFX = true;
oController.oSoundPlayer.playSwing(0, _local3);
}
} else if ((Math.cos(com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_FREQ * nFrame) < 0) && (nAmplitude > 0)) {
_local2 = (-1 * nSWING_ANGLE_RATIO) * nAmplitude;
if (nRotation > _local2) {
bPlayerRopeSFX = true;
oController.oSoundPlayer.playSwing(1, _local3);
}
}
}
}
}
function applyAirFriction() {
nAmplitude = nAmplitude + com.disney.gem.games.woodyTowerRescue.GameData.nAIR_FRICTION;
}
function applyMomentum() {
nAmplitude = nAmplitude + nMomentum;
}
function checkAmplitudeLimits() {
if (nAmplitude < com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MIN_AMPLITUDE) {
nAmplitude = com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MIN_AMPLITUDE;
} else if (nAmplitude > com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MAX_AMPLITUDE) {
nAmplitude = com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MAX_AMPLITUDE;
if ((nDirection == 1) && (nRotation <= com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ANGLE_TO_BREAK_ROPE)) {
setState(sSTATE_FALLOUT);
}
}
}
function applyAngle() {
mcRef._rotation = nRotation - nSTART_ANGLE;
if (!bCamFollow) {
if ((nRotation <= 0) && (nDirection > 0)) {
bCamFollow = true;
}
}
}
function changeSwingState() {
if (Math.abs(nRotation) > com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ANGLE_TO_SWING_FAST) {
if (nOldDir == 1) {
bPlayerRopeSFX = false;
setState(sSTATE_SWITCH_BACKFAST, true);
} else {
bPlayerRopeSFX = false;
setState(sSTATE_SWITCH_FORWARDFAST, true);
}
} else if (Math.abs(nRotation) > com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ANGLE_TO_SWING_SLOW) {
if (nOldDir == 1) {
bPlayerRopeSFX = false;
setState(sSTATE_SWITCH_BACKSLOW, true);
} else {
bPlayerRopeSFX = false;
setState(sSTATE_SWITCH_FORWARDSLOW, true);
}
} else {
bPlayerRopeSFX = false;
setState(sSTATE_SWING_FORWARDSLOW, true);
}
}
function getAngleInRadian(_nAngle) {
var _local1 = (_nAngle * Math.PI) / 180;
return(_local1);
}
function getAngleInDegree(_nRad) {
var _local1 = (_nRad * 180) / Math.PI;
return(_local1);
}
function setJumpStartPoint() {
var _local2 = com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ROPE_LENGTH * Math.sin(-getAngleInRadian(nRotation));
if (nRotation > 0) {
_local2 = -1 * _local2;
}
_local2 = _local2 + nPosX;
var _local3 = nPosY + (com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ROPE_LENGTH * Math.abs(Math.cos(getAngleInRadian(nRotation))));
oJumpStart = new flash.geom.Point(_local2, _local3);
}
function checkJumpMode() {
collideFrame = 10000;
var _local3 = nRotation;
bInAir = true;
oJumpEnd = new flash.geom.Point(nPosX + ROPE_DIF, nSTART_POS_Y + com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ROPE_LENGTH);
setPosition(oJumpStart.x, oJumpStart.y);
nRotation = nSTART_ANGLE;
applyAngle();
if (_local3 > com.disney.gem.games.woodyTowerRescue.GameData.ANGLE_TO_FALL) {
setState(sSTATE_JUMPSHORT, true);
} else {
setState(sSTATE_JUMP, true);
setJumpSpeed(_local3);
setJumpAmplitude();
setJumpDuration();
var _local2 = 1 - (((1 - enemyPos) * ROPE_DIF) / (oJumpEnd.x - oJumpStart.x));
var _local4 = ((Math.sin(_local2 * Math.PI) * nJumpAmplitude) + (oJumpEnd.y * _local2)) + (oJumpStart.y * (1 - _local2));
jumpsLeft--;
if (oOwner.enemy.__get__visible() && (oOwner.enemy.gonnaCollide(_local4))) {
collideFrame = int(_local2 * nJumpDuration);
} else if (jumpsLeft == 0) {
gonnaWin = true;
oJumpEnd.y = oJumpEnd.y - 50;
}
if (jumpsLeft == 1) {
checkAllWon = true;
}
if (collideFrame == 10000) {
points = points + (500 * oController.multiplier);
}
}
}
function setJumpSpeed(_nRotation) {
var _local2 = (nAmplitude - nRotation) / (com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_MAX_AMPLITUDE - com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MIN_ANGLE_TO_BOTTOM_WINDOW);
nJumpSpeed = (_local2 * (com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MAX_JUMP_SPEED - com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MIN_JUMP_SPEED)) + com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MIN_JUMP_SPEED;
}
function setJumpDuration() {
var _local2 = oJumpEnd.x - oJumpStart.x;
nJumpDuration = Math.round(_local2 / nJumpSpeed);
}
function setJumpAmplitude() {
var _local2 = Math.abs(nRotation / (com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MAX_ANGLE_TO_TOP_WINDOW - com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MIN_ANGLE_TO_BOTTOM_WINDOW));
nJumpAmplitude = (_local2 * (com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MAX_JUMP_AMPLITUDE - com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MIN_JUMP_AMPLITUDE)) + com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_MIN_JUMP_AMPLITUDE;
}
function applyGravity() {
var _local4 = 0;
var _local3 = 0;
var _local2 = 0;
var _local5 = "";
if (nJumpFrame >= collideFrame) {
oOwner.enemy.attack();
setState(sSTATE_DONTGETIN, true);
return(undefined);
}
if (nJumpFrame <= nJumpDuration) {
oInterpolationPt = flash.geom.Point.interpolate(oJumpEnd, oJumpStart, nJumpFrame / nJumpDuration);
_local3 = oInterpolationPt.x;
_local4 = Math.sin((nJumpFrame / nJumpDuration) * Math.PI) * nJumpAmplitude;
_local2 = oInterpolationPt.y + _local4;
setPosition(_local3, _local2);
nJumpFrame++;
} else {
catchNewRope();
}
}
function catchNewRope() {
if (gonnaWin) {
setState(sSTATE_GETINGOOD);
oOwner.platformEnd.terk.gotoAndPlay("leaving");
gonnaWin = false;
var _local4 = oOwner.getText("great1");
var _local3 = oOwner.getText("great2");
oOwner.__get__getHud().showLittleText((_local4 + com.sarbakan.utils.Tools.getFormatedNumber(points, 1)) + _local3);
oController.score.addPoints(points);
return(undefined);
}
var _local2 = AbsoluteX;
nRotation = 0;
nFrame = int(Math.PI / (2 * com.disney.gem.games.woodyTowerRescue.GameData.nPENDULUM_FREQ));
nAmplitude = nSTART_ANGLE;
bInAir = false;
bAllowControls = true;
bCamFollow = false;
nJumpDuration = 0;
nJumpFrame = 0;
nJumpSpeed = 0;
nJumpAmplitude = 0;
nEndTowerPos = 0;
setPosition((nPosX + _local2) - AbsoluteX, nSTART_POS_Y);
setState(sSTATE_SWING_FORWARDFAST, true);
oOwner.mcRope._x = oOwner.mcRope._x + ROPE_DIF;
if (jumpsLeft == 1) {
oOwner.mcRope._x = 0;
}
oOwner.enemyCopy.setX(oOwner.enemy.__get__x());
oOwner.enemyCopy.setAnimal(enemies[jumpsLeft]);
oOwner.enemy.setX(oOwner.enemy.__get__x() + ROPE_DIF);
oOwner.enemy.setAnimal(enemies[jumpsLeft - 1]);
oController.multiplier++;
oOwner.__get__getHud().showPopUpMult(oController.multiplier);
}
function get AbsoluteX() {
var _local2 = 0;
var _local3 = 0;
if (!bCamFollow) {
_local2 = oOwner.__get__Mc().mcBg._x + nPosX;
} else if ((sState == sSTATE_FALLOUT) || (sState == sSTATE_JUMPSHORT)) {
_local3 = mcRef.mcState.mcCamPos._x + mcRef.mcState._x;
_local2 = (oOwner.__get__Mc().mcBg._x + nPosX) + _local3;
} else if (bInAir) {
_local2 = oOwner.__get__Mc().mcBg._x + nPosX;
} else {
_local3 = com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_ROPE_LENGTH * Math.sin(getAngleInRadian(-nRotation));
_local2 = (oOwner.__get__Mc().mcBg._x + nPosX) + _local3;
}
return(_local2);
}
function get AbsoluteY() {
var _local2 = 0;
_local2 = oOwner.__get__Mc().mcBg._y + nPosY;
return(_local2);
}
function get Rotation() {
return(nRotation);
}
function get IsLaunched() {
return(bInAir);
}
static var sSTATE_HIDDEN = "hidden";
static var sSTATE_IDLE = "idle";
static var sSTATE_THROWLASSO = "throwLasso";
static var sSTATE_CLIMB = "climb";
static var sSTATE_LASSOIDLE = "lassoIdle";
static var sSTATE_SWINGSTART = "swingStart";
static var sSTATE_SWITCH_FORWARDFAST = "switchForwardFast";
static var sSTATE_SWING_FORWARDFAST = "swingForwardFast";
static var sSTATE_SWITCH_FORWARDSLOW = "switchForwardSlow";
static var sSTATE_SWING_FORWARDSLOW = "swingForwardSlow";
static var sSTATE_SWITCH_BACKFAST = "switchBackFast";
static var sSTATE_SWING_BACKFAST = "swingBackFast";
static var sSTATE_SWITCH_BACKSLOW = "switchBackSlow";
static var sSTATE_SWING_BACKSLOW = "swingBackSlow";
static var sSTATE_GETINGOOD = "getInGood";
static var sSTATE_DONTGETIN = "dontGetIn";
static var sSTATE_FALLOUT = "fallOut";
static var sSTATE_HITWALL = "hitWall";
static var sSTATE_JUMP = "jump";
static var sSTATE_JUMPSHORT = "jumpShort";
static var nSTART_ANGLE = 25;
static var nSTART_POS_X = 199.8;
static var nSTART_POS_Y = -11.6;
static var nFRAME_CLIMB1 = 17;
static var nFRAME_CLIMB2 = 28;
static var nFRAME_CLIMB3 = 55;
static var nFRAME_CLIMB4 = 68;
static var nFRAME_CLIMB5 = 97;
static var nFRAME_DONTGETIN1 = 1;
static var nFRAME_DONTGETIN2 = 3;
static var nFRAME_DONTGETIN3 = 34;
static var nFRAME_FALLOUT1 = 1;
static var nFRAME_FALLOUT2 = 23;
static var nFRAME_JUMPSHORT1 = 19;
static var nFRAME_STARTSWING1 = 10;
static var nFRAME_HITWALL1 = 1;
static var nFRAME_HITWALL2 = 28;
static var nSWING_ANGLE_RATIO = 0.6;
var ROPE_DIF = 520;
var enemyPos = 0.5;
}
Symbol 1435 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.library.KeyboardManager] Frame 0
class com.disney.gem.games.woodyTowerRescue.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 1436 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.GameData] Frame 0
class com.disney.gem.games.woodyTowerRescue.GameData
{
function GameData () {
}
static var ROPE_DIFS = [600, 605, 612, 621, 630, 642, 653, 667, 680, 695, 708, 718, 728, 735, 740];
static var ENEMIES = [[0, 0, 0], [0, 1, 0], [0, 1, 0, 0], [0, 0, 2, 0], [0, 1, 1, 0], [0, 2, 0, 1, 0], [0, 0, 1, 2, 0], [0, 2, 0, 0, 1], [0, 0, 1, 0, 0, 2], [0, 1, 0, 2, 0, 1], [0, 0, 2, 1, 0, 2, 0], [0, 1, 0, 2, 0, 0, 1], [0, 0, 0, 2, 1, 0, 2, 0], [0, 2, 0, 0, 1, 2, 1, 0], [0, 0, 1, 0, 2, 0, 1, 2, 1]];
static var SNAKE_MIN_VALUE = 200;
static var MONKEY_MAX_VALUE = 220;
static var ANGLE_TO_FALL = -14;
static var CHEATS = false;
static var STG_FPS = 30;
static var nSTG_HEIGHT = 410;
static var nSTG_WIDTH = 580;
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 = 50;
static var nTRANSIT_IN_VOLUME = 60;
static var nTRANSIT_OUT1_VOLUME = 70;
static var nTRANSIT_OUT2_VOLUME = 80;
static var nTRANSIT_OUT3_VOLUME = 65;
static var nBUTTON_CLICK_VOLUME = 90;
static var nBUTTON_OVER_VOLUME = 70;
static var nPLAYER_CLIMB1_VOLUME = 90;
static var nPLAYER_CLIMB2_VOLUME = 90;
static var nPLAYER_CLIMB3_VOLUME = 90;
static var nPLAYER_CLIMB4_VOLUME = 100;
static var nPLAYER_CLIMB5_VOLUME = 100;
static var nPLAYER_DONTGETIN1_VOLUME = 100;
static var nPLAYER_DONTGETIN2_VOLUME = 60;
static var nPLAYER_DONTGETIN3_VOLUME = 80;
static var nPLAYER_FALLOUT1_VOLUME = 100;
static var nPLAYER_THROWLASSO_VOLUME = 100;
static var nPLAYER_STARTSWING_VOLUME = 100;
static var nPLAYER_MAX_SWING_VOLUME = 100;
static var nPLAYER_MIN_SWING_VOLUME = 30;
static var nPLAYER_SWING_SLOW_VOLUME = 50;
static var nPLAYER_GETINGOOD_VOLUME = 120;
static var nPLAYER_HITWALL_VOLUME = 100;
static var nPLAYER_HITSNAKE_VOLUME = 100;
static var nPLAYER_HITMONKEY_VOLUME = 100;
static var nPLAYER_JUMP_VOLUME = 80;
static var nSHEEP_OUT_VOLUME = 50;
static var nSHEEP_SCARED_VOLUME = 110;
static var nSHEEP_IDLE1_VOLUME = 200;
static var nSHEEP_IDLE2_VOLUME = 200;
static var nSHEEP_IDLE3_VOLUME = 160;
static var nSHEEP_IDLE4_VOLUME = 120;
static var nBO_LAUGH_VOLUME = 100;
static var nBO_IDLE1_VOLUME = 60;
static var nBO_IDLE2_VOLUME = 80;
static var nKISSES_VOLUME = 120;
static var nMIN_SUCCESS_TO_WIN = 15;
static var nPENDULUM_FREQ = 0.1;
static var nPENDULUM_MAX_AMPLITUDE = 100;
static var nPENDULUM_MIN_AMPLITUDE = 0;
static var nAIR_FRICTION = -0.35;
static var nPLAYER_INIT_SPEED = 5;
static var nPLAYER_MIN_ROTATION = 0.4;
static var nPLAYER_MIN_SPEED = 0.4;
static var nPLAYER_ANGLE_TO_SWING_FAST = 40;
static var nPLAYER_ANGLE_TO_SWING_SLOW = 10;
static var nPLAYER_MIN_ANGLE_TO_BOTTOM_WINDOW = -10;
static var nPLAYER_MAX_ANGLE_TO_BOTTOM_WINDOW = -25;
static var nPLAYER_MIN_ANGLE_TO_MIDDLE_WINDOW = -40;
static var nPLAYER_MAX_ANGLE_TO_MIDDLE_WINDOW = -55;
static var nPLAYER_MIN_ANGLE_TO_TOP_WINDOW = -70;
static var nPLAYER_MAX_ANGLE_TO_TOP_WINDOW = -100;
static var nPLAYER_MOMENTUM = 1.02;
static var nPLAYER_ANGLE_TO_BREAK_ROPE = -35;
static var nPLAYER_ROPE_LENGTH = 340;
static var nPLAYER_MAX_JUMP_SPEED = 40;
static var nPLAYER_MIN_JUMP_SPEED = 20;
static var nPLAYER_MAX_JUMP_AMPLITUDE = -200;
static var nPLAYER_MIN_JUMP_AMPLITUDE = -30;
static var aBO_DELAYS_OUT = [undefined, 65, 60, 55, 50, 45, 40, 35, 30, 30, 30, 30, 30, 30, 30];
static var aBO_DELAYS_IN = [undefined, 65, 60, 55, 50, 45, 40, 35, 30, 30, 30, 30, 30, 30, 30];
static var aSHEEP_DELAYS_OUT = [60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32];
static var aSHEEP_DELAYS_IN = [60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32];
static var nTOWER_VIEW_LIMIT_X = 510;
static var nPOINTS_GOOD_HOLE = 500;
static var nPOINTS_SHEEP_HOLE = -100;
}
Symbol 1437 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 1438 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.game.backgrounds.Cam] Frame 0
class com.disney.gem.games.woodyTowerRescue.game.backgrounds.Cam
{
var mcRef, mcRefLoop, oOwner, oPlayer, nScrollingSpeedX, nScrollingSpeedY, bRewindMode, oController, oTween;
function Cam (_mcRef, mcLoop, _oPlayer, _sName, _oOwner) {
mcRef = _mcRef;
mcRefLoop = mcLoop;
mcRef._x = 0;
moveLoop();
sName = _sName;
oOwner = _oOwner;
oPlayer = _oPlayer;
nScrollingSpeedX = 0;
nScrollingSpeedY = 0;
bRewindMode = false;
oController = com.disney.gem.games.woodyTowerRescue.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
}
function onUpdate() {
if (!bRewindMode) {
setScrollingSpeed(oPlayer.__get__AbsoluteX(), oPlayer.__get__AbsoluteY());
moveBG();
} else if (oTween != undefined) {
oTween.nextFrame();
moveLoop();
}
}
function startRewind() {
bRewindMode = true;
oTween = new mx.transitions.Tween(mcRef, "_x", mx.transitions.easing.Regular.easeInOut, mcRef._x, 0, 60);
oTween.stop();
oTween.onMotionFinished = com.sarbakan.utils.Delegate.create(this, onEndRewind);
}
function setScrollingSpeed(_nAbsX, _nAbsY) {
nScrollingSpeedX = nSPEED_PERCENTAGE * (nPLAYER_CENTER_X - _nAbsX);
nScrollingSpeedY = nSPEED_PERCENTAGE * ((com.disney.gem.games.woodyTowerRescue.GameData.nSTG_HEIGHT / 2) - _nAbsY);
}
function deleteObject() {
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function onEndRewind() {
bRewindMode = false;
delete oTween;
oController.manageGameStep();
}
function moveBG() {
var _local2 = mcRef._x;
var _local3 = mcRef._y;
_local2 = _local2 + nScrollingSpeedX;
mcRef._x = Math.min(Math.max(_local2, SCROLL_LIMIT_UP), SCROLL_LIMIT_DOWN);
moveLoop();
}
function moveLoop() {
mcRefLoop._x = int(mcRef._x * 0.75) % pixelsToLoop;
}
var SCROLL_LIMIT_UP = -30000;
var SCROLL_LIMIT_DOWN = 1000;
var nSPEED_PERCENTAGE = 1;
var nPLAYER_CENTER_X = 200;
var sName = "";
var bPausable = true;
var pixelsToLoop = 1780;
}
Symbol 1439 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 1440 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 1441 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 1442 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 1443 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.game.backgrounds.CamParallax] Frame 0
class com.disney.gem.games.woodyTowerRescue.game.backgrounds.CamParallax
{
var mcRef, oOwner, mcBg, nScrollingSpeedX, nScrollingSpeedY, oController;
function CamParallax (_mcRef, _mcBg, _sName, _oOwner) {
mcRef = _mcRef;
mcRef._x = 0;
sName = _sName;
oOwner = _oOwner;
mcBg = _mcBg;
nScrollingSpeedX = 0;
nScrollingSpeedY = 0;
oController = com.disney.gem.games.woodyTowerRescue.Controller.getInstance();
oController.oMainBroadcaster.addListener(this);
}
function onUpdate() {
setScrollingSpeed(mcBg._x, mcBg._y);
moveBG();
}
function setScrollingSpeed(_nAbsX, _nAbsY) {
nScrollingSpeedX = nSPEED_PERCENTAGE * _nAbsX;
nScrollingSpeedY = nSPEED_PERCENTAGE * ((com.disney.gem.games.woodyTowerRescue.GameData.nSTG_HEIGHT / 2) - _nAbsY);
}
function deleteObject() {
delete oOwner[sName];
oController.oMainBroadcaster.removeListener(this);
}
function moveBG() {
var _local2 = mcRef._x;
var _local3 = mcRef._y;
_local2 = nScrollingSpeedX % 1056;
mcRef._x = _local2;
mcRef._x = Math.min(Math.max(_local2, SCROLL_LIMIT_UP), SCROLL_LIMIT_DOWN);
}
var SCROLL_LIMIT_UP = -1800;
var SCROLL_LIMIT_DOWN = 1300;
var nSPEED_PERCENTAGE = 0.2;
var nPLAYER_CENTER_X = 0;
var sName = "";
var bPausable = true;
}
Symbol 1444 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.game.Hud] Frame 0
class com.disney.gem.games.woodyTowerRescue.game.Hud extends com.sarbakan.utils.StateManaged
{
var mcRef, oController, mcTriesBar;
function Hud (_mcRef) {
super(_mcRef);
mcRef.poptext.mc.field.selectable = false;
mcRef.poptext.mc.field.multiline = true;
oController = com.disney.gem.games.woodyTowerRescue.Controller.getInstance();
mcTriesBar = mcRef.mcTriesBar;
updateTries();
updateScore(oController.getScore());
}
function updateScore(_nScore) {
mcRef.txtScore.text = com.sarbakan.utils.Tools.getFormatedNumber(_nScore, 1);
}
function showPopUpPoints(_nScore) {
mcRef.poptext.gotoAndPlay("points");
mcRef.poptext.mc.field.text = com.sarbakan.utils.Tools.getFormatedNumber(_nScore, 1);
}
function showLittleText(text) {
mcRef.poptext.gotoAndPlay("message");
mcRef.poptext.mc.field.text = text;
}
function showBigText(points) {
mcRef.poptext.gotoAndPlay("points");
mcRef.poptext.mc.field.text = points;
}
function showPopUpMult(_n) {
mcRef.poptext.gotoAndPlay("multiplier");
mcRef.poptext.mc.field.text = "x" + _n;
}
function get popText() {
return(mcRef.poptext);
}
function updateTries() {
var _local3 = oController.__get__Tries();
var _local2 = 0;
while (_local2 < _local3.length) {
if (_local3[_local2] == 0) {
mcTriesBar[sCUBE_NAME + (_local2 + 1)].gotoAndStop(_local2 + 1);
} else {
mcTriesBar[sCUBE_NAME + (_local2 + 1)].gotoAndStop(_local3.length + 1);
}
mcTriesBar[sCUBE_NAME + (_local2 + 1)].mcState.gotoAndStop(_local3[_local2] + 1);
_local2++;
}
}
var sCUBE_NAME = "mcCube";
}
Symbol 1445 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.game.Enemy] Frame 0
class com.disney.gem.games.woodyTowerRescue.game.Enemy extends com.sarbakan.utils.StateManaged
{
var oOwner, mcRef, sState, stateFinished;
function Enemy (_mcRef, owner) {
super(_mcRef);
oOwner = owner;
setState(sSTATE_SNAKE_IDLE, true);
mcRef.stop();
}
function setState(sState, _bInstant, _bForce) {
super.setState(sState, _bInstant, _bForce);
mcRef.stop();
}
function setAnimal(n) {
switch (n) {
case 0 :
visible = (false);
return(undefined);
case 2 :
visible = (true);
setState(sSTATE_MONKEY_IDLE, true);
return(undefined);
case 1 :
visible = (true);
setState(sSTATE_SNAKE_IDLE, true);
return(undefined);
}
}
function switchAnimals() {
switch (sState) {
case sSTATE_SNAKE_IDLE :
setState(sSTATE_MONKEY_IDLE, true);
break;
case sSTATE_SNAKE_HIT :
setState(sSTATE_MONKEY_IDLE, true);
break;
case sSTATE_MONKEY_IDLE :
setState(sSTATE_SNAKE_IDLE, true);
break;
case sSTATE_MONKEY_HIT :
setState(sSTATE_SNAKE_IDLE, true);
}
}
function gonnaCollide(posY) {
switch (sState) {
case sSTATE_SNAKE_IDLE :
return(posY < com.disney.gem.games.woodyTowerRescue.GameData.SNAKE_MIN_VALUE);
case sSTATE_MONKEY_IDLE :
return(posY > com.disney.gem.games.woodyTowerRescue.GameData.MONKEY_MAX_VALUE);
}
return(false);
}
function state_snake_hit() {
if (stateFinished()) {
setState(sSTATE_SNAKE_IDLE);
}
}
function set visible(b) {
mcRef._visible = b;
//return(visible);
}
function get visible() {
return(mcRef._visible);
}
function attack() {
switch (sState) {
case sSTATE_SNAKE_IDLE :
com.disney.gem.games.woodyTowerRescue.Controller.getInstance().oSoundPlayer.playHitSnake();
setState(sSTATE_SNAKE_HIT, true);
break;
case sSTATE_MONKEY_IDLE :
com.disney.gem.games.woodyTowerRescue.Controller.getInstance().oSoundPlayer.playHitMonkey();
setState(sSTATE_MONKEY_HIT, true);
}
}
function state_monkey_hit() {
if (stateFinished()) {
setState(sSTATE_MONKEY_IDLE);
}
}
function setX(val) {
mcRef._x = val;
}
function get x() {
return(mcRef._x);
}
static var sSTATE_HIDDEN = "hidden";
static var sSTATE_SNAKE_IDLE = "snake_idle";
static var sSTATE_MONKEY_IDLE = "monkey_idle";
static var sSTATE_SNAKE_HIT = "snake_hit";
static var sSTATE_MONKEY_HIT = "monkey_hit";
}
Symbol 1446 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.game.Buttons] Frame 0
class com.disney.gem.games.woodyTowerRescue.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.woodyTowerRescue.game.Buttons, triggerEvent, _oBtnRef, "Release");
var _local4 = com.sarbakan.utils.Delegate.create(com.disney.gem.games.woodyTowerRescue.game.Buttons, triggerEvent, _oBtnRef, "RollOver");
var _local3 = com.sarbakan.utils.Delegate.create(com.disney.gem.games.woodyTowerRescue.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.woodyTowerRescue.GameData.sCAT_SOUND, "sndButtonClick", com.disney.gem.games.woodyTowerRescue.GameData.nBUTTON_CLICK_VOLUME, 1, true);
break;
case "RollOver" :
if (oRollSound != undefined) {
oRollSound.doStop();
}
oRollSound = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndButtonOver", com.disney.gem.games.woodyTowerRescue.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 1447 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 1448 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);
} else {
trace("**** BAD SOUND LINKAGE : " + _sLinkage);
}
_local1.doAddListener(com.sarbakan.sound.SoundManager);
aSounds.push(_local1);
}
} else {
trace("ERROR - ***** - MAX SOUND NUM REACHED : " + nMAX_SOUNDS_PLAYING);
}
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) {
trace("**** NORMAL SM ERROR, NEED TO INIT SOUND MANAGER FIRST");
}
}
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 1449 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 1450 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.SoundPlayer] Frame 0
class com.disney.gem.games.woodyTowerRescue.SoundPlayer
{
var sName, oPlayer, oClimbing1, oClimbing2, oClimbing3, oClimbing4, oClimbing5, oDontGetIn1, oDontGetIn2, oDontGetIn3, oFallOut1, oTransition1, oTransition2, oTransition3, oSheep, oBo, oMusicInGame, oMusicPack;
function SoundPlayer (_sName) {
sName = _sName;
}
function playPlayerThrowLasso() {
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerThrowLasso", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_THROWLASSO_VOLUME, 1, true);
}
function playPlayerStartSwing() {
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerStartSwing", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_STARTSWING_VOLUME, 1, true);
}
function playPlayerSwing() {
}
function stopPlayer() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
}
function playClimbing(_nSoundNo) {
switch (_nSoundNo) {
case 1 :
if (oClimbing1 != undefined) {
oClimbing1.doStop();
}
oClimbing1 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerClimb1", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_CLIMB1_VOLUME, 1, true);
break;
case 2 :
if (oClimbing2 != undefined) {
oClimbing2.doStop();
}
oClimbing2 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerClimb2", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_CLIMB2_VOLUME, 1, true);
break;
case 3 :
if (oClimbing3 != undefined) {
oClimbing3.doStop();
}
oClimbing3 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerClimb3", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_CLIMB3_VOLUME, 1, true);
break;
case 4 :
if (oClimbing4 != undefined) {
oClimbing4.doStop();
}
oClimbing4 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerClimb4", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_CLIMB4_VOLUME, 1, true);
break;
case 5 :
if (oClimbing5 != undefined) {
oClimbing5.doStop();
}
oClimbing5 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerClimb5", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_CLIMB5_VOLUME, 1, true);
}
}
function playDontGetIn(_nSoundNo) {
stopPlayer();
switch (_nSoundNo) {
case 1 :
if (oDontGetIn1 != undefined) {
oDontGetIn1.doStop();
}
oDontGetIn1 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerDontGetIn1", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_DONTGETIN1_VOLUME, 1, true);
break;
case 2 :
if (oDontGetIn2 != undefined) {
oDontGetIn2.doStop();
}
oDontGetIn2 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerDontGetIn2", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_DONTGETIN2_VOLUME, 1, true);
break;
case 3 :
if (oDontGetIn3 != undefined) {
oDontGetIn3.doStop();
}
oDontGetIn3 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerDontGetIn3", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_DONTGETIN3_VOLUME, 1, true);
}
}
function stopDontGetIn() {
if (oDontGetIn1 != undefined) {
oDontGetIn1.doStop();
}
if (oDontGetIn2 != undefined) {
oDontGetIn2.doStop();
}
if (oDontGetIn3 != undefined) {
oDontGetIn3.doStop();
}
}
function playJump() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerJump", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_JUMP_VOLUME, 1, true);
}
function playGetInGood() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerHitSnake", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_HITSNAKE_VOLUME, 1, true);
}
function playHitMonkey() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerHitMonkey", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_HITMONKEY_VOLUME, 1, true);
}
function playHitSnake() {
if (oPlayer != undefined) {
oPlayer.doStop();
}
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerGetInGood", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_GETINGOOD_VOLUME, 1, true);
}
function playHitWall(_nSoundNo) {
trace("SoundPlayer.playHitWall > _nSoundNo : " + _nSoundNo);
switch (_nSoundNo) {
case 1 :
if (oPlayer != undefined) {
oPlayer.doStop();
}
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerHitWall", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_HITWALL_VOLUME, 1, true);
break;
case 2 :
if (oDontGetIn3 != undefined) {
oDontGetIn3.doStop();
}
oDontGetIn3 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerDontGetIn3", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_DONTGETIN3_VOLUME, 1, true);
}
}
function playFallOut(_nSoundNo) {
switch (_nSoundNo) {
case 1 :
if (oFallOut1 != undefined) {
oFallOut1.doStop();
}
oFallOut1 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerFallOut1", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_FALLOUT1_VOLUME, 1, true);
break;
case 2 :
if (oDontGetIn3 != undefined) {
oDontGetIn3.doStop();
}
oDontGetIn3 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerDontGetIn3", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_DONTGETIN3_VOLUME, 1, true);
}
}
function playJumpShort() {
if (oDontGetIn3 != undefined) {
oDontGetIn3.doStop();
}
oDontGetIn3 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerDontGetIn3", com.disney.gem.games.woodyTowerRescue.GameData.nPLAYER_DONTGETIN3_VOLUME, 1, true);
}
function playSwing(_nSwingStyle, _nVolume) {
switch (_nSwingStyle) {
case 0 :
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerSwingFF", _nVolume, 1, true);
break;
case 1 :
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerSwingBF", _nVolume, 1, true);
break;
case 2 :
oPlayer = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndPlayerSwingSlow", _nVolume, 1, true);
}
}
function stopAllSFX() {
stopPlayer();
if (oTransition1 != undefined) {
oTransition1.doStop();
}
if (oTransition2 != undefined) {
oTransition2.doStop();
}
if (oTransition3 != undefined) {
oTransition3.doStop();
}
if (oClimbing1 != undefined) {
oClimbing1.doStop();
}
if (oClimbing2 != undefined) {
oClimbing2.doStop();
}
if (oClimbing3 != undefined) {
oClimbing3.doStop();
}
if (oClimbing4 != undefined) {
oClimbing4.doStop();
}
if (oClimbing5 != undefined) {
oClimbing5.doStop();
}
stopDontGetIn();
stopSheep();
stopBo();
}
function playSheepOut() {
if (oSheep != undefined) {
oSheep.doStop();
}
oSheep = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndSheepOut", com.disney.gem.games.woodyTowerRescue.GameData.nSHEEP_OUT_VOLUME, 1, true);
}
function playSheepScared() {
if (oSheep != undefined) {
oSheep.doStop();
}
oSheep = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndSheepScared", com.disney.gem.games.woodyTowerRescue.GameData.nSHEEP_SCARED_VOLUME, 1, true);
}
function playSheepIdle(_nSoundNo) {
var _local3 = Math.floor(Math.random() * 4) + 1;
trace("_nRandom : " + _local3);
var _local2 = 0;
if (oSheep != undefined) {
oSheep.doStop();
}
switch (_local3) {
case 1 :
_local2 = com.disney.gem.games.woodyTowerRescue.GameData.nSHEEP_IDLE1_VOLUME;
break;
case 2 :
_local2 = com.disney.gem.games.woodyTowerRescue.GameData.nSHEEP_IDLE2_VOLUME;
break;
case 3 :
_local2 = com.disney.gem.games.woodyTowerRescue.GameData.nSHEEP_IDLE3_VOLUME;
break;
case 4 :
_local2 = com.disney.gem.games.woodyTowerRescue.GameData.nSHEEP_IDLE4_VOLUME;
}
trace("_nVolume : " + _local2);
oSheep = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndSheepIdle" + _local3, _local2, 1, true);
}
function stopSheep() {
if (oSheep != undefined) {
oSheep.doStop();
}
}
function playBoLaugh() {
trace("playBoLaugh : " + playBoLaugh);
if (oBo != undefined) {
oBo.doStop();
}
oBo = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndBoLaugh", com.disney.gem.games.woodyTowerRescue.GameData.nBO_LAUGH_VOLUME, 1, true);
}
function playBoIdle(_nSoundNo) {
switch (_nSoundNo) {
case 1 :
if (oBo != undefined) {
oBo.doStop();
}
oBo = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndBoIdle1", com.disney.gem.games.woodyTowerRescue.GameData.nBO_IDLE1_VOLUME, 1, true);
break;
case 2 :
if (oBo != undefined) {
oBo.doStop();
}
oBo = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndBoIdle2", com.disney.gem.games.woodyTowerRescue.GameData.nBO_IDLE2_VOLUME, 1, true);
}
}
function playKisses() {
if (oBo != undefined) {
oBo.doStop();
}
oBo = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndKisses", com.disney.gem.games.woodyTowerRescue.GameData.nKISSES_VOLUME, 1, true);
}
function stopBo() {
if (oBo != undefined) {
oBo.doStop();
}
}
function playPackMusic() {
if (oMusicInGame != undefined) {
oMusicInGame.doFadeTo(0, true);
}
oMusicPack = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_MUSIC, "musicPack", 0, 9999, true);
oMusicPack.doFadeTo(com.disney.gem.games.woodyTowerRescue.GameData.nMUSIC_PACK_VOLUME, false);
}
function playInGameMusic() {
if (oMusicPack != undefined) {
oMusicPack.doFadeTo(0, true);
}
oMusicInGame = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_MUSIC, "musicInGame", 0, 9999, true);
oMusicInGame.doFadeTo(com.disney.gem.games.woodyTowerRescue.GameData.nMUSIC_GAME_VOLUME, false);
}
function playTransitionOut(_nSoundNo) {
switch (_nSoundNo) {
case 1 :
if (oTransition1 != undefined) {
oTransition1.doStop();
}
oTransition1 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndTransitionOut1", com.disney.gem.games.woodyTowerRescue.GameData.nTRANSIT_OUT1_VOLUME, 1, true);
break;
case 2 :
if (oTransition2 != undefined) {
oTransition2.doStop();
}
oTransition2 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndTransitionOut2", com.disney.gem.games.woodyTowerRescue.GameData.nTRANSIT_OUT2_VOLUME, 1, true);
break;
case 3 :
if (oTransition3 != undefined) {
oTransition3.doStop();
}
oTransition3 = com.sarbakan.sound.SoundManager.doPlaySoundInCat(com.disney.gem.games.woodyTowerRescue.GameData.sCAT_SOUND, "sndTransitionOut3", com.disney.gem.games.woodyTowerRescue.GameData.nTRANSIT_OUT3_VOLUME, 1, true);
}
}
}
Symbol 1451 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.game.ScoresManager] Frame 0
class com.disney.gem.games.woodyTowerRescue.game.ScoresManager
{
var sName, oHud, oController;
function ScoresManager (_oHud, _sName, _oOwner) {
sName = _sName;
oHud = _oHud;
oController = com.disney.gem.games.woodyTowerRescue.Controller.getInstance();
}
function addPoints(_nScore) {
oController.increaseScore(_nScore);
if (oController.getScore() < 0) {
oController.setScore(0);
}
oHud.updateScore(oController.getScore());
}
function deleteObject() {
}
static var sPTS_TYPE_GOOD = "good";
static var sPTS_TYPE_SHEEP = "sheep";
}
Symbol 1452 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.screens.EndScreen] Frame 0
class com.disney.gem.games.woodyTowerRescue.screens.EndScreen extends com.sarbakan.utils.ScreenController
{
var oController, hide, mcRef;
function EndScreen (_mcRef) {
super(_mcRef);
}
function onBtPlay() {
com.disney.gem.games.woodyTowerRescue.Controller(oController).startNewGame();
hide(null, false);
com.disney.gem.games.woodyTowerRescue.Controller(oController).sGameStep = com.disney.gem.games.woodyTowerRescue.Controller.sSTEP_GAME;
com.disney.gem.games.woodyTowerRescue.Controller(oController).manageGameStep();
}
function onBtPlayRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.playbtn.setTextFormat(_local2);
mcRef.mcState.mcContent.againbtn.setTextFormat(_local2);
if (mcRef.mcState.mcContent.playbtn) {
mcRef.mcState.mcContent.playbtn.setTextFormat(_local2);
}
if (mcRef.mcState.mcContent.trybtn) {
mcRef.mcState.mcContent.trybtn.setTextFormat(_local2);
}
}
function onBtPlayRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.playbtn.setTextFormat(_local2);
mcRef.mcState.mcContent.againbtn.setTextFormat(_local2);
if (mcRef.mcState.mcContent.playbtn) {
mcRef.mcState.mcContent.playbtn.setTextFormat(_local2);
}
if (mcRef.mcState.mcContent.trybtn) {
mcRef.mcState.mcContent.trybtn.setTextFormat(_local2);
}
}
function state_idle_init() {
super.state_idle_init();
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtPlayRollOver);
mcRef.mcState.mcContent.btPlay.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtPlayRollOut);
mcRef.mcState.mcContent.mcScore.txtScore.text = com.sarbakan.utils.Tools.getFormatedNumber(oController.getScore(), 1);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btPlay);
}
}
Symbol 1453 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.popups.MenuPopup] Frame 0
class com.disney.gem.games.woodyTowerRescue.popups.MenuPopup extends com.sarbakan.utils.ScreenController
{
var oController, hide, mcRef;
function MenuPopup (_mcRef) {
super(_mcRef);
}
function onBtSound() {
com.disney.gem.games.woodyTowerRescue.Controller(oController).toggleSound();
updateSoundGroup();
}
function onBtHelp() {
com.disney.gem.games.woodyTowerRescue.Controller(oController).allowInstructions();
com.disney.gem.games.woodyTowerRescue.Controller(oController).showInstructions();
hide(null, true);
}
function onBtQuit() {
com.disney.gem.games.woodyTowerRescue.Controller(oController).showPopup(new com.disney.gem.games.woodyTowerRescue.popups.ConfirmPopup(com.disney.gem.games.woodyTowerRescue.Controller(oController).mcTimeline.mcPopups.mcConfirm, this), true);
}
function onBtSoundRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.mcSoundToggle.soundonn.setTextFormat(_local2);
}
function onBtHelpRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.helpbtn.setTextFormat(_local2);
}
function onBtQuitRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.quitbtn.setTextFormat(_local2);
}
function onBtResumeRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.resumebtn.setTextFormat(_local2);
}
function onBtSoundRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.mcSoundToggle.soundonn.setTextFormat(_local2);
}
function onBtHelpRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.helpbtn.setTextFormat(_local2);
}
function onBtQuitRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.quitbtn.setTextFormat(_local2);
}
function onBtResumeRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.resumebtn.setTextFormat(_local2);
}
function onBtResume() {
com.disney.gem.games.woodyTowerRescue.Controller(oController).allowInstructions();
com.disney.gem.games.woodyTowerRescue.Controller(oController).unpause();
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.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtHelpRollOver);
mcRef.mcState.mcContent.btHelp.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtHelpRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btHelp);
mcRef.mcState.mcContent.btQuit.onRelease = com.sarbakan.utils.Delegate.create(this, onBtQuit);
mcRef.mcState.mcContent.btQuit.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtQuitRollOver);
mcRef.mcState.mcContent.btQuit.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtQuitRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btQuit);
mcRef.mcState.mcContent.btResume.onRelease = com.sarbakan.utils.Delegate.create(this, onBtResume);
mcRef.mcState.mcContent.btResume.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtResumeRollOver);
mcRef.mcState.mcContent.btResume.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtResumeRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btResume);
updateSoundGroup();
}
function updateSoundGroup() {
var _local2 = "On";
if (com.disney.gem.games.woodyTowerRescue.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, onBtSoundRollOver);
mcRef.mcState.mcContent.mcSoundToggle.btSound.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtSoundRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.mcSoundToggle.btSound);
}
}
Symbol 1454 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.popups.ConfirmPopup] Frame 0
class com.disney.gem.games.woodyTowerRescue.popups.ConfirmPopup extends com.sarbakan.utils.ScreenController
{
var oMenuOrigin, hide, mcRef, oController;
function ConfirmPopup (_mcRef, _oMenuOrigin) {
super(_mcRef);
oMenuOrigin = _oMenuOrigin;
}
function onBtNo() {
hide();
}
function onBtNoRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.quit_no.setTextFormat(_local2);
}
function onBtNoRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.quit_no.setTextFormat(_local2);
}
function onBtYesRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.quit_yes.setTextFormat(_local2);
}
function onBtYesRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.quit_yes.setTextFormat(_local2);
}
function onBtYes() {
hide();
com.disney.gem.games.woodyTowerRescue.Controller(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.btYes.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtYesRollOver);
mcRef.mcState.mcContent.btYes.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtYesRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btYes);
mcRef.mcState.mcContent.btNo.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNo);
mcRef.mcState.mcContent.btNo.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtNoRollOver);
mcRef.mcState.mcContent.btNo.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtNoRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btNo);
}
}
Symbol 1455 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.screens.TitleScreen] Frame 0
class com.disney.gem.games.woodyTowerRescue.screens.TitleScreen extends com.sarbakan.utils.ScreenController
{
var oController, mcRef;
function TitleScreen (_mcRef) {
super(_mcRef);
}
function onBtHelp() {
com.disney.gem.games.woodyTowerRescue.Controller(oController).showInstructions();
}
function onBtHelpRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.howbtn.setTextFormat(_local2);
mcRef.mcState.mcContent.toplaybtn.setTextFormat(_local2);
}
function onBtHelpRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.howbtn.setTextFormat(_local2);
mcRef.mcState.mcContent.toplaybtn.setTextFormat(_local2);
}
function onBtPlayRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.playbtn.setTextFormat(_local2);
}
function onBtPlayRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.playbtn.setTextFormat(_local2);
}
function onBtPlay() {
com.disney.gem.games.woodyTowerRescue.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.btHelp.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtHelpRollOver);
mcRef.mcState.mcContent.btHelp.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtHelpRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btHelp);
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtPlayRollOver);
mcRef.mcState.mcContent.btPlay.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtPlayRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btPlay);
}
}
Symbol 1456 MovieClip [__Packages.com.disney.gem.games.woodyTowerRescue.screens.HelpScreen] Frame 0
class com.disney.gem.games.woodyTowerRescue.screens.HelpScreen extends com.sarbakan.utils.ScreenController
{
var nCurrentPage, oController, mcRef;
function HelpScreen (_mcRef) {
super(_mcRef);
nCurrentPage = 1;
}
function onBtBack() {
changeScreen(1);
}
function onBtNext() {
changeScreen(2);
}
function onBtPlay() {
oController.hideInstructions();
}
function onBtPlayRollOver() {
var _local2 = new TextFormat();
_local2.color = 16777164 /* 0xFFFFCC */;
mcRef.mcState.mcContent.playbtn.setTextFormat(_local2);
}
function onBtPlayRollOut() {
var _local2 = new TextFormat();
_local2.color = 0;
mcRef.mcState.mcContent.playbtn.setTextFormat(_local2);
}
function state_idle_init() {
super.state_idle_init();
setUpScreen();
}
function setUpScreen() {
mcRef.mcState.mcContent.gotoAndStop("Help" + nCurrentPage);
if (nCurrentPage == 1) {
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
mcRef.mcState.mcContent.btPlay.onRollOver = com.sarbakan.utils.Delegate.create(this, onBtPlayRollOver);
mcRef.mcState.mcContent.btPlay.onRollOut = com.sarbakan.utils.Delegate.create(this, onBtPlayRollOut);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btPlay);
mcRef.mcState.mcContent.btNext.onRelease = com.sarbakan.utils.Delegate.create(this, onBtNext);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btNext);
} else {
mcRef.mcState.mcContent.btBack.onRelease = com.sarbakan.utils.Delegate.create(this, onBtBack);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btBack);
mcRef.mcState.mcContent.btPlay.onRelease = com.sarbakan.utils.Delegate.create(this, onBtPlay);
com.disney.gem.games.woodyTowerRescue.game.Buttons.patch(mcRef.mcState.mcContent.btPlay);
}
}
function changeScreen(_nFrameNo) {
nCurrentPage = _nFrameNo;
setUpScreen();
}
}
Instance of Symbol 1109 MovieClip "title_text_manager" in Symbol 1235 MovieClip Frame 10
onClipEvent (load) {
var newPaths = new Array();
_parent._parent._parent.paths = [{name:"how", path:_level0.mcScreens.mcTitle.mcState.mcContent.howbtn}, {name:"to play", path:_level0.mcScreens.mcTitle.mcState.mcContent.toplaybtn}, {name:"play", path:_level0.mcScreens.mcTitle.mcState.mcContent.playbtn}];
this.onEnterFrame = function () {
function buscarTexto(n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < _parent._parent._parent.texts.length) {
if (_parent._parent._parent.texts[_local2].name == n) {
_local3 = _parent._parent._parent.texts[_local2].text;
break;
}
_local2++;
}
return(_local3);
}
if (_parent._parent._parent.paths.length == 0) {
delete this.onEnterFrame;
return(undefined);
}
if (_parent._parent._parent.texts.length == 0) {
return(undefined);
}
while (_parent._parent._parent.paths.length > 0) {
var _local3 = _parent._parent._parent.paths.pop();
if (_local3.path) {
texto = buscarTexto(_local3.name);
if (texto != "") {
_local3.path.text = texto;
}
} else {
newPaths.push(_local3);
}
}
while (newPaths.length > 0) {
var _local5 = newPaths.pop();
_parent._parent._parent.paths.push(_local5);
}
};
}
Instance of Symbol 1109 MovieClip in Symbol 1266 MovieClip Frame 10
onClipEvent (load) {
var newPaths = new Array();
_parent._parent._parent.paths = [{name:"big title", path:_level0.mcScreens.mcHelp.mcState.mcContent.helptitle.bigtitle}, {name:"text 1", path:_level0.mcScreens.mcHelp.mcState.mcContent.helptext.title1}, {name:"text 2", path:_level0.mcScreens.mcHelp.mcState.mcContent.helptext.text1}, {name:"text 3", path:_level0.mcScreens.mcHelp.mcState.mcContent.helptext.title2}, {name:"text 4", path:_level0.mcScreens.mcHelp.mcState.mcContent.helptext.text2}, {name:"swing", path:_level0.mcScreens.mcHelp.mcState.mcContent.swing}, {name:"release", path:_level0.mcScreens.mcHelp.mcState.mcContent.releasevine}, {name:"backbtn", path:_level0.mcScreens.mcHelp.mcState.mcContent.playbtn}];
this.onEnterFrame = function () {
function buscarTexto(n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < _parent._parent._parent.texts.length) {
if (_parent._parent._parent.texts[_local2].name == n) {
_local3 = _parent._parent._parent.texts[_local2].text;
break;
}
_local2++;
}
return(_local3);
}
if (_parent._parent._parent.paths.length == 0) {
delete this.onEnterFrame;
return(undefined);
}
if (_parent._parent._parent.texts.length == 0) {
return(undefined);
}
while (_parent._parent._parent.paths.length > 0) {
var _local3 = _parent._parent._parent.paths.pop();
if (_local3.path) {
texto = buscarTexto(_local3.name);
if (texto != "") {
_local3.path.text = texto;
}
} else {
newPaths.push(_local3);
}
}
while (newPaths.length > 0) {
var _local5 = newPaths.pop();
_parent._parent._parent.paths.push(_local5);
}
};
}
Instance of Symbol 1109 MovieClip in Symbol 1280 MovieClip Frame 10
onClipEvent (load) {
var newPaths = new Array();
_parent._parent._parent.paths = [{name:"well done", path:_level0.mcScreens.mcWin.mcState.mcContent.wintitle}, {name:"win text", path:_level0.mcScreens.mcWin.mcState.mcContent.wintext}, {name:"final score", path:_level0.mcScreens.mcWin.mcState.mcContent.finalscore}, {name:"win play", path:_level0.mcScreens.mcWin.mcState.mcContent.playbtn}, {name:"win again", path:_level0.mcScreens.mcWin.mcState.mcContent.againbtn}];
this.onEnterFrame = function () {
function buscarTexto(n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < _parent._parent._parent.texts.length) {
if (_parent._parent._parent.texts[_local2].name == n) {
_local3 = _parent._parent._parent.texts[_local2].text;
break;
}
_local2++;
}
return(_local3);
}
if (_parent._parent._parent.paths.length == 0) {
delete this.onEnterFrame;
return(undefined);
}
if (_parent._parent._parent.texts.length == 0) {
return(undefined);
}
while (_parent._parent._parent.paths.length > 0) {
var _local3 = _parent._parent._parent.paths.pop();
if (_local3.path) {
texto = buscarTexto(_local3.name);
if (texto != "") {
_local3.path.text = texto;
}
} else {
newPaths.push(_local3);
}
}
while (newPaths.length > 0) {
var _local5 = newPaths.pop();
_parent._parent._parent.paths.push(_local5);
}
};
}
Instance of Symbol 1109 MovieClip in Symbol 1292 MovieClip Frame 10
onClipEvent (load) {
var newPaths = new Array();
_parent._parent._parent.paths = [{name:"you lose", path:_level0.mcScreens.mcLose.mcState.mcContent.losetitle}, {name:"lose text", path:_level0.mcScreens.mcLose.mcState.mcContent.losetext}, {name:"lose score", path:_level0.mcScreens.mcLose.mcState.mcContent.lose_score}, {name:"try", path:_level0.mcScreens.mcLose.mcState.mcContent.trybtn}, {name:"again", path:_level0.mcScreens.mcLose.mcState.mcContent.againbtn}];
this.onEnterFrame = function () {
function buscarTexto(n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < _parent._parent._parent.texts.length) {
if (_parent._parent._parent.texts[_local2].name == n) {
_local3 = _parent._parent._parent.texts[_local2].text;
break;
}
_local2++;
}
return(_local3);
}
if (_parent._parent._parent.paths.length == 0) {
delete this.onEnterFrame;
return(undefined);
}
if (_parent._parent._parent.texts.length == 0) {
return(undefined);
}
while (_parent._parent._parent.paths.length > 0) {
var _local3 = _parent._parent._parent.paths.pop();
if (_local3.path) {
texto = buscarTexto(_local3.name);
if (texto != "") {
_local3.path.text = texto;
}
} else {
newPaths.push(_local3);
}
}
while (newPaths.length > 0) {
var _local5 = newPaths.pop();
_parent._parent._parent.paths.push(_local5);
}
};
}
Instance of Symbol 1109 MovieClip in Symbol 1326 MovieClip Frame 20
onClipEvent (load) {
var newPaths = new Array();
_parent._parent._parent.paths = [{name:"main title", path:_level0.mcPopups.mcMenu.mcState.mcContent.menu.title}, {name:"main sound", path:_level0.mcPopups.mcMenu.mcState.mcContent.mcSoundToggle.soundonn}, {name:"main help", path:_level0.mcPopups.mcMenu.mcState.mcContent.helpbtn}, {name:"main quit", path:_level0.mcPopups.mcMenu.mcState.mcContent.quitbtn}, {name:"main resume", path:_level0.mcPopups.mcMenu.mcState.mcContent.resumebtn}];
this.onEnterFrame = function () {
function buscarTexto(n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < _parent._parent._parent.texts.length) {
if (_parent._parent._parent.texts[_local2].name == n) {
_local3 = _parent._parent._parent.texts[_local2].text;
break;
}
_local2++;
}
return(_local3);
}
if (_parent._parent._parent.paths.length == 0) {
delete this.onEnterFrame;
return(undefined);
}
if (_parent._parent._parent.texts.length == 0) {
return(undefined);
}
while (_parent._parent._parent.paths.length > 0) {
var _local3 = _parent._parent._parent.paths.pop();
if (_local3.path) {
texto = buscarTexto(_local3.name);
if (texto != "") {
_local3.path.text = texto;
}
} else {
newPaths.push(_local3);
}
}
while (newPaths.length > 0) {
var _local5 = newPaths.pop();
_parent._parent._parent.paths.push(_local5);
}
};
}
Instance of Symbol 1109 MovieClip in Symbol 1340 MovieClip Frame 20
onClipEvent (load) {
var newPaths = new Array();
_parent._parent._parent.paths = [{name:"quit title", path:_level0.mcPopups.mcConfirm.mcState.mcContent.quit.title}, {name:"quit text", path:_level0.mcPopups.mcConfirm.mcState.mcContent.areyousure.text}, {name:"quit no", path:_level0.mcPopups.mcConfirm.mcState.mcContent.quit_no}, {name:"quit yes", path:_level0.mcPopups.mcConfirm.mcState.mcContent.quit_yes}];
this.onEnterFrame = function () {
function buscarTexto(n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < _parent._parent._parent.texts.length) {
if (_parent._parent._parent.texts[_local2].name == n) {
_local3 = _parent._parent._parent.texts[_local2].text;
break;
}
_local2++;
}
return(_local3);
}
if (_parent._parent._parent.paths.length == 0) {
delete this.onEnterFrame;
return(undefined);
}
if (_parent._parent._parent.texts.length == 0) {
return(undefined);
}
while (_parent._parent._parent.paths.length > 0) {
var _local3 = _parent._parent._parent.paths.pop();
if (_local3.path) {
texto = buscarTexto(_local3.name);
if (texto != "") {
_local3.path.text = texto;
}
} else {
newPaths.push(_local3);
}
}
while (newPaths.length > 0) {
var _local5 = newPaths.pop();
_parent._parent._parent.paths.push(_local5);
}
};
}