Frame 1
function _getHighScore(Void) {
return(nScore);
}
function ShowHighScore() {
if (NGameID != undefined) {
loadMovie ((("WBHighScores.swf?GameID=" + NGameID) + "&GameScore=") + _getHighScore(), this.createEmptyMovieClip("mcHSBoard", this.getNextHighestDepth()));
}
}
var sScore;
var nScore;
var bAnimDone = false;
stop();
_root.onEnterFrame = function () {
pctLoaded = Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
mcScrLoad.mcTxtLoad.txtPct = pctLoaded;
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
delete this.onEnterFrame;
gotoAndPlay ("initAtStart");
}
};
Frame 9
new MainCTRL(this);
Frame 46
_root.bAnimDone = true;
if (_root.bAnimDone) {
_root.sScore = _root.mcState.mcHud.txtBest.text;
_root.nScore = parseFloat(_root.sScore);
_root.ShowHighScore();
trace(_root.nScore + "in here");
}
Symbol 5 MovieClip Frame 1
stop();
Symbol 5 MovieClip Frame 2
MainCTRL.oSounds.playSound("Intro_Logo_fade", 30);
Symbol 5 MovieClip Frame 60
stop();
MainCTRL.oMainCTRL.launchTitleScr();
Symbol 9 MovieClip Frame 1
stop();
Symbol 9 MovieClip Frame 2
MainCTRL.oSounds.playSound("Intro_Batman_fade", 20);
Symbol 9 MovieClip Frame 45
stop();
_parent.mcBackground.play();
Symbol 653 MovieClip [__Packages.State] Frame 0
class State
{
var mcRef, oRefMainCTRL, oRefGameCTRL, atState, nFrTotalAnim;
function State (_mcRef) {
mcRef = _mcRef;
MainCTRL.addToBroadcaster(this);
oRefMainCTRL = MainCTRL.oMainCTRL;
oRefGameCTRL = MainCTRL.oGameCTRL;
}
function doAction() {
this[atState]();
}
function doPause() {
mcRef.mcState.stop();
}
function doUnPause() {
mcRef.mcState.play();
}
function setState(_sState) {
if (atState != _sState) {
atState = _sState;
mcRef.gotoAndStop(atState);
nFrTotalAnim = mcRef.mcState._totalframes;
doStateInit(atState);
}
}
function doStateInit() {
}
function get _atState() {
return(atState);
}
}
Symbol 654 MovieClip [__Packages.MainCTRL] Frame 0
class MainCTRL extends State
{
static var oMainCTRL, mcScreen, oPopUp, bAtPause, sResetType, sMusicAtPlay, oSounds, __get___sResetType, nBestScore, oGameCTRL;
var bFirstLoad, setState, mcRef, atState, nFrTotalAnim;
function MainCTRL (_mcRef) {
super(_mcRef);
initSounds();
oMainCTRL = this;
bFirstLoad = true;
setState("TitleCard");
mcScreen = _mcRef.mcState;
initBroadcaster();
initVars();
}
function launchTitleScr() {
playMusic("Screen");
addToBroadcaster(this);
addToBroadcaster(oPopUp);
mcRef.mcScrLoad.swapDepths(mcRef.getNextHighestDepth());
mcRef.mcScrLoad.removeMovieClip();
mcRef.mcState.play();
}
static function randomNumber(nMin, nMax) {
var _local1 = Math.round(Math.random() * (nMax - nMin)) + nMin;
return(_local1);
}
static function addToBroadcaster(_oToAdd) {
oMainBroadcaster.addListener(_oToAdd);
}
static function removeFromBroadcaster(_oToRemove) {
oMainBroadcaster.removeListener(_oToRemove);
}
static function setPause() {
bAtPause = true;
oMainBroadcaster.broadcastMessage("doPause");
}
static function setUnPause() {
bAtPause = false;
oMainBroadcaster.broadcastMessage("doUnPause");
}
function endWinScreen() {
sResetType = "playAgain";
setState("Reset");
}
function playMusic(_sType) {
if ((_sType == "Screen") && (sMusicAtPlay != "Screen")) {
oSounds.fadeOutAMusic("Music_Game");
oSounds.fadeInAMusic("Music_Screen");
sMusicAtPlay = "Screen";
} else if ((_sType == "Game") && (sMusicAtPlay != "Game")) {
oSounds.fadeOutAMusic("Music_Screen");
oSounds.fadeInAMusic("Music_Game");
sMusicAtPlay = "Game";
}
}
function backGameMusic() {
oSounds.fadeOutAMusic("Music_End");
playMusic("Screen");
}
static function set _sResetType(_sNewValue) {
sResetType = _sNewValue;
//return(__get___sResetType());
}
static function get _sMusicAtPlay() {
return(sMusicAtPlay);
}
static function get _nBestScore() {
return(nBestScore);
}
static function set _nBestScore(_nNewValue) {
nBestScore = _nNewValue;
//return(_nBestScore);
}
function initVars() {
oPopUp = new PopUp(mcRef.mcPopUp);
bAtPause = false;
}
function initSounds() {
oSounds = new Sounds(mcRef);
sMusicAtPlay = undefined;
oSounds.playMusic("Music_Screen", 0, -1, 30);
oSounds.playMusic("Music_Game", 0, -1, 10);
}
function EnterFrame() {
if (!bAtPause) {
oMainBroadcaster.broadcastMessage("doAction");
} else {
oMainBroadcaster.broadcastMessage("doPauseAction");
}
}
function initBroadcaster() {
oMainBroadcaster = {};
AsBroadcaster.initialize(oMainBroadcaster);
mcRef.onEnterFrame = Delegate.create(this, EnterFrame);
}
static function clearBroadcaster() {
for (var _local1 in oMainBroadcaster._listeners) {
if (!oMainBroadcaster._listeners[_local1].bTransition) {
oMainBroadcaster.removeListener(oMainBroadcaster._listeners[_local1]);
}
}
}
function doStateInit() {
switch (atState) {
case "TitleCard" :
nBestScore = 0;
if (bFirstLoad) {
mcRef.mcState.stop();
mcRef.mcScrLoad.mcTxtLoad._visible = false;
mcRef.mcScrLoad.mcBatman.play();
bFirstLoad = false;
} else {
playMusic("Screen");
}
break;
case "Game" :
oPopUp.openPopUp("FadeIn");
oGameCTRL = new GameCTRL(mcScreen);
oGameCTRL.initGameCTRL();
playMusic("Game");
break;
case "EndAnim" :
oSounds.playSound("EndAnim", 100);
break;
case "WinScreen" :
nBestScore = 0;
mcScreen.btnPlayAgain.onRelease = Delegate.create(this, doRelease, "btnPlayAgain");
mcScreen.btnPlayAgain.onRollOver = Delegate.create(this, doRollOverSnd);
mcScreen.btnPlayAgain.onPress = Delegate.create(this, doPressSnd);
break;
case "Reset" :
removeFromBroadcaster(oGameCTRL);
for (var _local2 in oGameCTRL) {
removeFromBroadcaster(oGameCTRL[_local2]);
if (_local2.substr(0, 1) == "o") {
delete oGameCTRL[_local2];
}
}
delete oGameCTRL;
if (sResetType == "playAgain") {
setState("Game");
} else if (sResetType == "EndAnim") {
setState("EndAnim");
} else {
setState("TitleCard");
mcRef.mcScrLoad.swapDepths(mcRef.getNextHighestDepth());
mcRef.mcScrLoad.removeMovieClip();
oPopUp.setState("FadeIn");
}
Obstacle.nLastPosY = undefined;
}
}
function doRelease(_btnType) {
switch (_btnType) {
case "Play" :
case "Continue" :
oSounds.playSound("Intro_Screen_move", 50);
mcRef.mcState.play();
break;
case "btnPlayAgain" :
mcScreen.mcBatman.play();
oSounds.playSound("WinScr_Batman_jump", 100);
}
}
function doRollOverSnd() {
oSounds.btnRoll();
}
function doPressSnd() {
oSounds.btnClick();
}
function TitleCard() {
if (mcRef.mcState._currentframe == 16) {
oSounds.playSound("Intro_RayLight_Flash", 30);
}
if (mcRef.mcState._currentframe == 47) {
oSounds.playSound("Intro_item_4", 80);
}
if (mcRef.mcState._currentframe == 192) {
oSounds.playSound("Obs_GasMove", 0, -1, 10);
oSounds.fadeInASound("Obs_GasMove");
}
if (mcRef.mcState._currentframe == 244) {
oSounds.fadeOutASound("Obs_GasMove");
}
if (mcRef.mcState._currentframe == 66) {
mcRef.mcState.stop();
mcRef.mcState.btnPlay.onRelease = Delegate.create(this, doRelease, "Play");
mcRef.mcState.btnPlay.onRollOver = Delegate.create(this, doRollOverSnd);
mcRef.mcState.btnPlay.onPress = Delegate.create(this, doPressSnd);
}
if (mcRef.mcState._currentframe == 145) {
mcRef.mcState.stop();
mcRef.mcState.mcInstruction.btnContinue.onRelease = Delegate.create(this, doRelease, "Continue");
mcRef.mcState.mcInstruction.btnContinue.onRollOver = Delegate.create(this, doRollOverSnd);
mcRef.mcState.mcInstruction.btnContinue.onPress = Delegate.create(this, doPressSnd);
}
if (mcRef.mcState._currentframe == 191) {
mcRef.mcState.stop();
mcRef.mcState.mcInstruction.btnContinue.onRelease = Delegate.create(this, doRelease, "Continue");
mcRef.mcState.mcInstruction.btnContinue.onRollOver = Delegate.create(this, doRollOverSnd);
mcRef.mcState.mcInstruction.btnContinue.onPress = Delegate.create(this, doPressSnd);
}
if (mcRef.mcState._currentframe == 243) {
mcRef.mcState.stop();
mcRef.mcState.mcInstruction.btnContinue.onRelease = Delegate.create(this, doRelease, "Continue");
mcRef.mcState.mcInstruction.btnContinue.onRollOver = Delegate.create(this, doRollOverSnd);
mcRef.mcState.mcInstruction.btnContinue.onPress = Delegate.create(this, doPressSnd);
}
if (mcRef.mcState._currentframe == nFrTotalAnim) {
setState("Game");
}
}
function EndAnim() {
if (mcRef.mcState._currentframe == 240) {
backGameMusic();
}
if (mcRef.mcState._currentframe == nFrTotalAnim) {
setState("WinScreen");
}
}
static var oMainBroadcaster = {};
}
Symbol 655 MovieClip [__Packages.GameCTRL] Frame 0
class GameCTRL
{
static var oRefKeys, aLockKey, oLastCreateObstacle;
var mcRef, nAtTimeLaunch, nTimeLaunchObs, nAtObstacle, nJumpDone, mcScreen, __get___nJumpDone, oBatman, oBackground, oHud, oGasBomb;
function GameCTRL (_mcRef) {
mcRef = _mcRef;
MainCTRL.addToBroadcaster(this);
}
function doAction() {
nAtTimeLaunch++;
if (nAtTimeLaunch == nTimeLaunchObs) {
nAtTimeLaunch = 0;
setTimeLaunchObs();
createObstacle();
}
checkKey();
}
function doPauseAction() {
checkKey();
}
function initGameCTRL() {
oRefKeys = {bKeyLeft:false, bKeyUp:false, bKeyRight:false, bKeyDown:false, bR:false};
nTimeLaunchObs = 1;
nAtTimeLaunch = 0;
nAtObstacle = 0;
aLockKey = false;
nJumpDone = false;
mcScreen = MainCTRL.mcScreen.mcWorld;
createObject();
}
function checkKeyUp() {
if (!Key.isDown(38)) {
nJumpDone = false;
oRefKeys.bKeyUp = false;
}
if (!Key.isDown(39)) {
oRefKeys.bKeyRight = false;
}
if (!Key.isDown(40)) {
oRefKeys.bKeyDown = false;
}
if (!Key.isDown(37)) {
oRefKeys.bKeyLeft = false;
}
if (!Key.isDown(82)) {
oRefKeys.bR = false;
}
}
function checkKeyDown() {
if (Key.isDown(38) && (!nJumpDone)) {
oRefKeys.bKeyUp = true;
}
if (Key.isDown(39)) {
oRefKeys.bKeyRight = true;
}
if (Key.isDown(40)) {
oRefKeys.bKeyDown = true;
}
if (Key.isDown(37)) {
oRefKeys.bKeyLeft = true;
}
if (Key.isDown(82)) {
oRefKeys.bR = true;
}
}
static function checkIfNoKey() {
for (var _local1 in oRefKeys) {
if (oRefKeys[_local1]) {
return(false);
}
}
return(true);
}
function get _nAtObstacle() {
return(nAtObstacle);
}
static function get _aLockKey() {
return(aLockKey);
}
static function set _aLockKey(_aNewValue) {
aLockKey = _aNewValue;
//return(_aLockKey);
}
static function get _oRefKeys() {
return(oRefKeys);
}
function set _nJumpDone(_aNewValue) {
nJumpDone = _aNewValue;
//return(__get___nJumpDone());
}
static function get _nBOTTOM_LIMIT() {
return(nBOTTOM_LIMIT);
}
static function get _oLastCreateObstacle() {
return(oLastCreateObstacle);
}
function createObject() {
oBatman = new Batman(mcScreen.mcBatman);
mcScreen.createEmptyMovieClip("mcObstacleCtn", mcScreen.getNextHighestDepth());
oBatman.mcRef.swapDepths(mcScreen.mcObstacleCtn);
mcScreen.mcWires.swapDepths(mcScreen.getNextHighestDepth());
oBackground = new Background(mcRef.mcWorld, mcRef.mcWorld.mcBatman);
oHud = new Hud(mcRef.mcHud);
}
function createObstacle() {
nAtObstacle++;
nAtTNTonWall++;
var _local2;
if (nAtObstacle == nNBR_LAUNCH_BOMB) {
_local2 = "GasBomb";
} else if (nAtTNTonWall == nTNT_ON_WALL) {
_local2 = "TNT";
nAtTNTonWall = 0;
} else {
_local2 = findObsType();
}
if ((_local2 != "TNT") && (_local2 != "GasBomb")) {
mcScreen.mcObstacleCtn.attachMovie(_local2, "mcObstacle_" + nAtObstacle, mcScreen.mcObstacleCtn.getNextHighestDepth());
this["oObstacle_" + nAtObstacle] = new Obstacle(mcScreen.mcObstacleCtn["mcObstacle_" + nAtObstacle], nAtObstacle, _local2);
oLastCreateObstacle = this["oObstacle_" + nAtObstacle];
} else if (_local2 == "TNT") {
mcScreen.mcObstacleCtn.attachMovie(_local2, "mcObstacle_" + nAtObstacle, mcScreen.mcObstacleCtn.getNextHighestDepth());
this["oObstacle_" + nAtObstacle] = new TNT(mcScreen.mcObstacleCtn["mcObstacle_" + nAtObstacle], nAtObstacle, ((nAtTNTonWall == 0) ? true : false));
oLastCreateObstacle = this["oObstacle_" + nAtObstacle];
} else if (_local2 == "GasBomb") {
mcScreen.mcObstacleCtn.attachMovie(_local2, "mcGasBomb", mcScreen.mcObstacleCtn.getNextHighestDepth());
oGasBomb = new GasBomb(mcScreen.mcObstacleCtn.mcGasBomb, nAtObstacle);
oLastCreateObstacle = oGasBomb;
}
}
function setTimeLaunchObs() {
nTimeLaunchObs = MainCTRL.randomNumber(oTIME_LAUNCH_RANGE.Min, oTIME_LAUNCH_RANGE.Max);
}
function checkKey() {
checkKeyUp();
checkKeyDown();
}
function resetAllKey() {
for (var _local1 in oRefKeys) {
oRefKeys[_local1] = false;
}
}
function findObsType() {
var _local4 = oHud.__get___atHeight();
var _local2;
var _local5;
var _local3;
if (_local4 < aObstacleRange[0]) {
_local2 = oObstacleRangeType.range_1;
} else if (_local4 < aObstacleRange[1]) {
_local2 = oObstacleRangeType.range_2;
} else if (_local4 < aObstacleRange[2]) {
_local2 = oObstacleRangeType.range_3;
} else {
_local2 = oObstacleRangeType.range_4;
}
_local5 = MainCTRL.randomNumber(1, 100);
if (_local5 < _local2[0]) {
_local3 = aObstacleType[0];
} else if (_local5 < _local2[1]) {
_local3 = aObstacleType[1];
} else if (_local5 < _local2[2]) {
_local3 = aObstacleType[2];
} else {
_local3 = aObstacleType[3];
}
return(_local3);
}
static var oTIME_LAUNCH_RANGE = {Min:50, Max:105};
static var nBOTTOM_LIMIT = -27;
static var nNBR_LAUNCH_BOMB = 1;
static var aObstacleType = ["Rock_Big", "Rock_Bigger", "SteelBar", "TNT"];
static var aObstacleRange = [200, 600, 800];
static var oObstacleRangeType = {range_1:[50, 90, 95], range_2:[50, 85, 90], range_3:[45, 80, 85], range_4:[40, 70, 80]};
static var nTNT_ON_WALL = 5;
var nAtTNTonWall = 0;
static var oMAX_RANGE = {Left:50, Right:450};
}
Symbol 656 MovieClip [__Packages.Background] Frame 0
class Background
{
var mcRef, mcTarget;
function Background (_mcRef, _mcTarget) {
mcRef = _mcRef;
mcTarget = _mcTarget;
MainCTRL.addToBroadcaster(this);
}
function changeTarget(_mcRef) {
mcTarget = _mcRef;
}
function doAction() {
checkTargetPos();
moveFog();
}
function checkTargetPos() {
var _local3 = 0;
var _local2 = 0;
var _local7 = nSTAGE_WIDTH / 2;
var _local6 = nSTAGE_HEIGTH / 1.3;
var _local5 = getMainGameCoord().x;
var _local4 = getMainGameCoord().y;
if ((_local5 < _local7) && (mcRef._x < nMAX_X_POS)) {
_local3 = (_local7 - _local5) / nSLOW_DOWN_RATIO;
} else if ((_local5 > _local7) && (mcRef._x > nMIN_X_POS)) {
_local3 = (-(_local5 - _local7)) / nSLOW_DOWN_RATIO;
}
if ((_local3 > 0) && (_local3 <= nSPEED_MIN)) {
_local3 = 0;
} else if ((_local3 < 0) && (_local3 >= (-nSPEED_MIN))) {
_local3 = 0;
}
if ((_local4 < _local6) && (mcRef._y < nMAX_Y_POS)) {
_local2 = (_local6 - _local4) / nSLOW_DOWN_RATIO;
} else if ((_local4 > _local6) && (mcRef._y > nMIN_Y_POS)) {
_local2 = (-(_local4 - _local6)) / nSLOW_DOWN_RATIO;
}
if ((_local2 > 0) && (_local2 <= nSPEED_MIN)) {
_local2 = 0;
} else if ((_local2 < 0) && (_local2 >= (-nSPEED_MIN))) {
_local2 = 0;
}
if ((_local3 != 0) || (_local2 != 0)) {
move(_local3, _local2);
}
}
function getMainGameCoord() {
var _local2 = new Object();
_local2.x = 0;
_local2.y = 0;
_local2.x = mcTarget._x;
_local2.y = mcTarget._y;
mcRef.localToGlobal(_local2);
return(_local2);
}
function move(_nXSpeed, _nYSpeed) {
mcRef._x = mcRef._x + _nXSpeed;
mcRef._y = mcRef._y + _nYSpeed;
mcRef.mcCity_1._y = mcRef.mcCity_1._y - (_nYSpeed / 2);
mcRef.mcCity_2._y = mcRef.mcCity_2._y - (_nYSpeed / 1.95);
mcRef.mcCity_3._y = mcRef.mcCity_3._y - (_nYSpeed / 1.9);
mcRef.mcFog_1._y = mcRef.mcFog_1._y - (_nYSpeed / 3);
mcRef.mcFog_2._y = mcRef.mcFog_2._y - (_nYSpeed / 2.5);
mcRef.mcFog_3._y = mcRef.mcFog_3._y - (_nYSpeed / 2.2);
mcRef.mcSky._y = mcRef.mcSky._y - (_nYSpeed / 1.6);
if (mcRef._x < nMIN_X_POS) {
mcRef._x = nMIN_X_POS;
} else if (mcRef._x > nMAX_X_POS) {
mcRef._x = nMAX_X_POS;
}
if (mcRef._y < nMIN_Y_POS) {
mcRef._y = nMIN_Y_POS;
} else if (mcRef._y > nMAX_Y_POS) {
mcRef._y = nMAX_Y_POS;
}
}
function moveFog() {
if (mcRef.mcFog_1._x > 0) {
mcRef.mcFog_1._x = mcRef.mcFog_1._x - nSPEED_FOG;
} else {
mcRef.mcFog_1._x = nRestartFogPos;
}
if (mcRef.mcFog_2._x > 0) {
mcRef.mcFog_2._x = mcRef.mcFog_2._x - nSPEED_FOG;
} else {
mcRef.mcFog_2._x = nRestartFogPos;
}
if (mcRef.mcFog_3._x > 0) {
mcRef.mcFog_3._x = mcRef.mcFog_3._x - nSPEED_FOG;
} else {
mcRef.mcFog_3._x = nRestartFogPos;
}
}
var nSLOW_DOWN_RATIO = 3;
var nSPEED_MIN = 0.5;
var nMAX_X_POS = 0;
var nMIN_X_POS = 0;
var nSTAGE_WIDTH = 600;
var nSTAGE_HEIGTH = 400;
var nMIN_Y_POS = 0;
var nMAX_Y_POS = 2800;
var nSPEED_FOG = 0.1;
var nRATIO_CITY = 2;
var nRestartFogPos = 1400;
}
Symbol 657 MovieClip [__Packages.Batman] Frame 0
class Batman extends State
{
var nAtHorSpeed, nAtDuration, bStopRun, bIsHit, bAtDeath, bGrabSndAtPlay, SjumpRight, SjumpLeft, EjumpRight, EjumpLeft, DeadGrdLeft, DeadGasLeft, DeadGrdRight, DeadGasRight, IdleRight, IdleLeft, FallDownLeft, HitTopLeft, FallDownRight, HitTopRight, mcRef, sDir, atState, sCurrentState, nAjustSpeed, __get___nAtHorSpeed, __get___bStopRun, bIsTNT, __get___bIsTNT, nAtTimeBeforeCTRL, setState, oRefGameCTRL, sBlockSideMove, nFrTotalAnim;
function Batman (_mcRef) {
super(_mcRef);
nAtHorSpeed = 3;
nAtDuration = 0;
bStopRun = false;
bIsHit = false;
bAtDeath = false;
bGrabSndAtPlay = false;
oRefKeys = GameCTRL._oRefKeys;
SjumpRight = Delegate.create(this, Sjump);
SjumpLeft = Delegate.create(this, Sjump);
EjumpRight = Delegate.create(this, Ejump);
EjumpLeft = Delegate.create(this, Ejump);
DeadGrdLeft = Delegate.create(this, Dead);
DeadGasLeft = Delegate.create(this, Dead);
DeadGrdRight = Delegate.create(this, Dead);
DeadGasRight = Delegate.create(this, Dead);
IdleRight = Delegate.create(this, Idle);
IdleLeft = Delegate.create(this, Idle);
FallDownLeft = Delegate.create(this, FallDown);
HitTopLeft = Delegate.create(this, HitTop);
FallDownRight = Delegate.create(this, FallDown);
HitTopRight = Delegate.create(this, HitTop);
changeDir("Idle", "Right");
}
function findPosition() {
return({x:mcRef._x, y:mcRef._y});
}
function changeDir(_sState, _sDir) {
if (_sState == "Idle") {
nAtHorSpeed = 3;
}
if (_sDir != undefined) {
if (((sDir == "Left") && (_sDir == "Right")) || ((sDir == "Right") && (_sDir == "Left"))) {
if (nAtHorSpeed > 5) {
nAtHorSpeed = 5;
}
}
}
bStopRun = false;
changeState(_sState, _sDir);
}
function doAction() {
this[atState]();
doKeyAction();
}
function doPauseAction() {
if ((sCurrentState == "DeadGrd") || (sCurrentState == "DeadGas")) {
this[atState]();
}
}
function startJump() {
var _local2 = checkHit();
if ((_local2.length == 0) || (1(_local2.length = _local2[0] == "Bottom"))) {
nAjustSpeed = nJUMP_MAX_SPEED;
changeState("Sjump", sDir);
}
}
function ajustPosition(_mcObstacleHit, _sHitType, _sObstacleType) {
if (_sObstacleType != "TNT") {
var _local2 = getGlobalCoordinate(_mcObstacleHit, true);
switch (_sHitType) {
case "Bottom" :
nAjustSpeed = 0;
changeDir("Idle");
mcRef._y = _local2.y + 5;
break;
case "Side" :
changeState("Grab", sDir);
var _local3 = getGlobalCoordinate(mcRef[("mcSideHit_" + sDir) + "_1"], true);
var _local4 = (_mcObstacleHit._width / 2) - 2;
if (sDir == "Right") {
mcRef._x = mcRef._x + ((_local2.x - _local4) - _local3.x);
} else {
mcRef._x = mcRef._x - (_local3.x - (_local2.x + _local4));
}
}
}
}
function doHitAction(_oObstacleHit, _sHitDir) {
var _local3 = _oObstacleHit.__get___atState();
switch (_sHitDir) {
case "Top" :
if (_local3 == "Fall") {
if (_oObstacleHit.sOBSTACLE_TYPE != "GasBomb") {
changeState("DeadGrd");
if (_oObstacleHit.sOBSTACLE_TYPE == "TNT") {
_oObstacleHit.setState("Hit");
}
}
}
break;
case "Jump" :
if (_local3 == "Fall") {
if (_oObstacleHit.sOBSTACLE_TYPE == "TNT") {
_oObstacleHit.setState("Hit");
changeState("DeadGrd");
} else {
nAjustSpeed = 10;
nAtHorSpeed = 10;
changeState("HitTop", sDir);
}
} else {
nAjustSpeed = 5;
nAtHorSpeed = 10;
changeState("HitTop", sDir);
}
}
}
function set _nAtHorSpeed(_nNewValue) {
nAtHorSpeed = _nNewValue;
//return(__get___nAtHorSpeed());
}
function set _bStopRun(_bNewValue) {
bStopRun = _bNewValue;
//return(__get___bStopRun());
}
function get _oBatPos() {
var _local2 = getGlobalCoordinate(mcRef, false);
return(_local2);
}
function set _bIsTNT(_bNewValue) {
bIsTNT = _bNewValue;
//return(__get___bIsTNT());
}
function get _sCurrentState() {
return(sCurrentState);
}
function get _sBatmanDir() {
return(sDir);
}
function changeState(_sNewState, _sDir) {
if (!bAtDeath) {
if (_sNewState == "HitTop") {
nAtTimeBeforeCTRL = 0;
}
if (_sNewState == "DeadGrd") {
bAtDeath = true;
}
sCurrentState = _sNewState;
if (_sDir != undefined) {
sDir = _sDir;
}
setState(_sNewState + sDir);
}
}
function checkHitIdle() {
var _local2 = new Library.ArrayCollection(checkHit(true, true, false));
if (_local2.contains("Top")) {
var _local3 = getGlobalCoordinate(mcRef.mcTopHit_1, false);
MainCTRL.oMainBroadcaster.broadcastMessage("checkObjHitBatman", _local3, "Top");
}
if (mcRef._y < nBOTTOM_LIMIT) {
if (!_local2.contains("Bottom")) {
bIsHit = false;
nAtHorSpeed = 10;
changeState("FallDown", sDir);
}
}
}
function checkHitObstacle() {
var _local2 = new Library.ArrayCollection(checkHit());
if (_local2.contains("Side")) {
setHit();
} else if (_local2.contains("Top")) {
var _local3 = getGlobalCoordinate(mcRef.mcTopHit_1, false);
MainCTRL.oMainBroadcaster.broadcastMessage("checkObjHitBatman", _local3, "Top");
}
if (mcRef.hitTest(oRefGameCTRL.mcRef["mcHitWall_" + sDir])) {
setHit();
return(undefined);
}
if (mcRef._y < nBOTTOM_LIMIT) {
if (!_local2.contains("Bottom")) {
changeState("Ejump", sDir);
}
}
}
function checkJumpHit(_sVertDir) {
checkHitGround();
if (mcRef[("mcSideHit_" + sDir) + "_1"].hitTest(oRefGameCTRL.mcRef["mcHitWall_" + sDir]) || (mcRef[("mcSideHit_" + sDir) + "_2"].hitTest(oRefGameCTRL.mcRef["mcHitWall_" + sDir]))) {
if (sDir == "Right") {
mcRef._x = oRefGameCTRL.mcRef["mcHitWall_" + sDir]._x - (mcRef._width / 5);
} else {
mcRef._x = oRefGameCTRL.mcRef["mcHitWall_" + sDir]._x + (mcRef._width / 5);
}
changeState("Grab", sDir);
}
var _local2;
if (_sVertDir == "Up") {
_local2 = checkHit();
} else {
_local2 = checkHit(true, true, true);
}
if (_local2.length > 0) {
if (_local2.length == 1) {
switch (_local2[0]) {
case "Bottom" :
if (sCurrentState == "Ejump") {
var _local3 = getGlobalCoordinate(mcRef.mcBottomHit_1, false);
MainCTRL.oMainBroadcaster.broadcastMessage("checkClipHitBatman", _local3, "Bottom");
}
break;
case "Top" :
var _local3 = getGlobalCoordinate(mcRef.mcTopHit_1, false);
MainCTRL.oMainBroadcaster.broadcastMessage("checkObjHitBatman", _local3, "Jump");
break;
case "Side" :
_local3 = getGlobalCoordinate(mcRef[("mcSideHit_" + sDir) + "_1"], false);
MainCTRL.oMainBroadcaster.broadcastMessage("checkClipHitBatman", _local3, "Side");
}
} else {
nAtHorSpeed = 10;
changeState("HitTop", sDir);
}
}
}
function checkGrabHit() {
if (!checkHitGround()) {
var _local2 = new Library.ArrayCollection(checkHit());
if (_local2.contains("Top")) {
var _local3 = getGlobalCoordinate(mcRef.mcTopHit_1, false);
MainCTRL.oMainBroadcaster.broadcastMessage("checkObjHitBatman", _local3, "Jump");
}
if ((_local2.__get__length() == 0) || ((_local2.__get__length() == 1) && (_local2.contains("Top")))) {
if (!mcRef[("mcSideHit_" + sDir) + "_1"].hitTest(oRefGameCTRL.mcRef["mcHitWall_" + sDir])) {
nAtHorSpeed = 10;
nAjustSpeed = 0;
changeState("FallDown", sDir);
}
} else if (mcRef._y < nBOTTOM_LIMIT) {
if (_local2.contains("Bottom")) {
nAjustSpeed = 0;
changeDir("Idle");
}
}
}
}
function checkFallDown() {
if (!checkHitGround()) {
var _local2 = new Library.ArrayCollection(checkHit(true, false, true));
if (_local2.__get__length() > 1) {
setHit();
} else if (_local2.contains("Top")) {
var _local3 = getGlobalCoordinate(mcRef.mcTopHit_1, false);
MainCTRL.oMainBroadcaster.broadcastMessage("checkObjHitBatman", _local3, "Jump");
} else if (_local2.contains("Bottom")) {
nAjustSpeed = 0;
changeDir("Idle");
var _local3 = getGlobalCoordinate(mcRef.mcBottomHit_1, false);
MainCTRL.oMainBroadcaster.broadcastMessage("checkClipHitBatman", _local3, "Bottom");
}
}
}
function checkHit(_bNoBottom, _bNoTop, _bNoSide) {
var _local4 = [];
var _local2;
var _local3;
if (_bNoBottom == undefined) {
_bNoSide = true;
_bNoTop = _bNoSide;
_bNoBottom = _bNoTop;
}
if (_bNoBottom) {
_local2 = getGlobalCoordinate(mcRef.mcBottomHit_1, false);
_local3 = getGlobalCoordinate(mcRef.mcBottomHit_2, false);
if (oRefGameCTRL.mcScreen.mcObstacleCtn.hitTest(_local2.x, _local2.y, true) || (oRefGameCTRL.mcScreen.mcObstacleCtn.hitTest(_local3.x, _local3.y, true))) {
_local4.push("Bottom");
}
}
if (_bNoTop) {
_local2 = getGlobalCoordinate(mcRef.mcTopHit_1, false);
if (oRefGameCTRL.mcScreen.mcObstacleCtn.hitTest(_local2.x, _local2.y, true)) {
_local4.push("Top");
}
}
if (_bNoSide) {
_local2 = getGlobalCoordinate(mcRef[("mcSideHit_" + sDir) + "_1"], false);
_local3 = getGlobalCoordinate(mcRef[("mcSideHit_" + sDir) + "_2"], false);
if (oRefGameCTRL.mcScreen.mcObstacleCtn.hitTest(_local2.x, _local2.y, true) || (oRefGameCTRL.mcScreen.mcObstacleCtn.hitTest(_local3.x, _local3.y, true))) {
sBlockSideMove = sDir;
_local4.push("Side");
} else {
sBlockSideMove = null;
}
}
return(_local4);
}
function checkHitGround() {
if (mcRef._y >= GameCTRL.__get___nBOTTOM_LIMIT()) {
mcRef._y = GameCTRL._nBOTTOM_LIMIT;
MainCTRL.oSounds.playSound("Batman_landing", 20);
nAjustSpeed = 0;
changeDir("Idle");
return(true);
}
return(false);
}
function setHit() {
nAtHorSpeed = 3;
bStopRun = false;
GameCTRL.__set___aLockKey(true);
bIsHit = true;
changeState("Hit", sDir);
}
function ajustSpeed() {
if (bStopRun) {
if (nAtHorSpeed > 3) {
nAtHorSpeed = nAtHorSpeed - 0.5;
} else {
bStopRun = false;
changeDir("Idle");
}
} else if (nAtHorSpeed < nMaxHorSPEED) {
nAtHorSpeed = nAtHorSpeed + 0.5;
}
}
function getGlobalCoordinate(_mcRef, _bSetLocal) {
var _local2 = {x:_mcRef._x, y:_mcRef._y};
_mcRef._parent.localToGlobal(_local2);
if (_bSetLocal) {
oRefGameCTRL.mcScreen.globalToLocal(_local2);
}
return(_local2);
}
function doKeyAction() {
if (!bIsHit) {
switch (sCurrentState) {
case "Idle" :
case "Run" :
if (oRefKeys.bKeyRight) {
changeDir("Run", "Right");
}
if (oRefKeys.bKeyLeft) {
changeDir("Run", "Left");
}
if (oRefKeys.bKeyUp) {
startJump();
}
if (!GameCTRL.checkIfNoKey()) {
break;
}
_bStopRun = (true);
}
if (oRefKeys.bR) {
GasBomb.stopGasSound();
MainCTRL.__set___sResetType("playAgain");
MainCTRL.oPopUp.openPopUp("FadeOut");
}
}
}
function doStateInit() {
stopSound();
switch (sCurrentState) {
case "DeadGas" :
MainCTRL.oSounds.playSound("Batman_HurtGas", 30);
GasBomb.stopGasSound();
MainCTRL.oMainCTRL.playMusic("Screen");
MainCTRL.setPause();
mcRef.mcState.play();
break;
case "DeadGrd" :
MainCTRL.oSounds.playSound("Batman_HurtObs", 40);
GasBomb.stopGasSound();
MainCTRL.oMainCTRL.playMusic("Screen");
MainCTRL.setPause();
mcRef.mcState.play();
break;
case "Sjump" :
MainCTRL.oSounds.playSound("Batman_StartJump", 10);
break;
case "Ejump" :
MainCTRL.oSounds.stopSound("Batman_StartJump");
MainCTRL.oSounds.playSound("Batman_EndJump", 50);
break;
case "Hit" :
MainCTRL.oSounds.playSound("Batman_Hit", 8);
break;
case "VertJump" :
MainCTRL.oSounds.playSound("Batman_EndJump", 50);
break;
case "FallDown" :
MainCTRL.oSounds.playSound("Batman_EndJump", 50);
}
}
function stopSound() {
MainCTRL.oSounds.stopSound("Batman_EndJump");
MainCTRL.oSounds.stopSound("Batman_Run1");
MainCTRL.oSounds.stopSound("Batman_Run2");
if (sCurrentState != "Grab") {
stopGrabSnd();
}
}
function playWalkSnd() {
if (mcRef.mcState._currentframe == 6) {
MainCTRL.oSounds.playSound("Batman_Run1", 5);
}
if (mcRef.mcState._currentframe == 12) {
MainCTRL.oSounds.playSound("Batman_Run2", 5);
}
}
function stopGrabSnd() {
bGrabSndAtPlay = false;
MainCTRL.oSounds.stopSound("Batman_Grab");
}
function Idle() {
bIsHit = false;
checkHitIdle();
}
function RunRight() {
if (!bIsHit) {
playWalkSnd();
ajustSpeed();
checkHitObstacle();
mcRef._x = mcRef._x + nAtHorSpeed;
}
}
function RunLeft() {
if (!bIsHit) {
playWalkSnd();
ajustSpeed();
checkHitObstacle();
mcRef._x = mcRef._x - nAtHorSpeed;
}
}
function HitRight() {
nAtDuration++;
if (nAtDuration < nHIT_DURATION) {
mcRef._x = mcRef._x - 1;
} else {
bIsHit = false;
changeDir("Idle");
nAtDuration = 0;
}
checkHitIdle();
}
function HitTop() {
nAtTimeBeforeCTRL++;
if (nAtTimeBeforeCTRL > nTIME_BEFORE_CTRL) {
if (GameCTRL.__get___oRefKeys().bKeyRight) {
if (sDir == "Left") {
changeState("FallDown", "Right");
}
mcRef._x = mcRef._x + nJUMP_SPEED;
if (mcRef._x > oMAX_RANGE.right) {
mcRef._x = oMAX_RANGE.right;
}
} else if (GameCTRL.__get___oRefKeys().bKeyLeft) {
if (sDir == "Right") {
changeState("FallDown", "Left");
}
mcRef._x = mcRef._x - nJUMP_SPEED;
if (mcRef._x < oMAX_RANGE.left) {
mcRef._x = oMAX_RANGE.left;
}
}
}
nAjustSpeed = nAjustSpeed + nJUMP_SPEED_MODIF;
if (nAjustSpeed > nMAX_FALL_SPEED) {
nAjustSpeed = nMAX_FALL_SPEED;
}
mcRef._y = mcRef._y + nAjustSpeed;
checkFallDown();
}
function HitLeft() {
nAtDuration++;
if (nAtDuration < nHIT_DURATION) {
mcRef._x = mcRef._x + 1;
} else {
bIsHit = false;
changeDir("Idle");
nAtDuration = 0;
}
checkHitIdle();
}
function Sjump() {
nAjustSpeed = nAjustSpeed - nJUMP_SPEED_MODIF;
if (nAjustSpeed > 0) {
mcRef._y = mcRef._y - nAjustSpeed;
} else {
nAjustSpeed = 0;
changeState("Ejump", sDir);
}
if (GameCTRL.__get___oRefKeys().bKeyRight) {
if (sDir == "Left") {
changeState("Sjump", "Right");
}
mcRef._x = mcRef._x + nJUMP_SPEED;
} else if (GameCTRL.__get___oRefKeys().bKeyLeft) {
if (sDir == "Right") {
changeState("Sjump", "Left");
}
mcRef._x = mcRef._x - nJUMP_SPEED;
}
checkJumpHit("Up");
}
function Ejump() {
nAjustSpeed = nAjustSpeed + nJUMP_SPEED_MODIF;
if (nAjustSpeed > nMAX_FALL_SPEED) {
nAjustSpeed = nMAX_FALL_SPEED;
}
mcRef._y = mcRef._y + nAjustSpeed;
if (GameCTRL.__get___oRefKeys().bKeyRight) {
if (sDir == "Left") {
changeState("Ejump", "Right");
}
if (sBlockSideMove != sDir) {
mcRef._x = mcRef._x + nJUMP_SPEED;
}
} else if (GameCTRL.__get___oRefKeys().bKeyLeft) {
if (sDir == "Right") {
changeState("Ejump", "Left");
}
if (sBlockSideMove != sDir) {
mcRef._x = mcRef._x - nJUMP_SPEED;
}
}
checkJumpHit("Down");
}
function GrabRight() {
if (mcRef.mcState._currentframe == 10) {
if (!bGrabSndAtPlay) {
bGrabSndAtPlay = true;
MainCTRL.oSounds.playSound("Batman_Grab", 5, -1);
}
}
if (oRefKeys.bKeyLeft && (!oRefKeys.bKeyRight)) {
nAjustSpeed = 0;
changeState("Ejump", "Left");
} else if (oRefKeys.bKeyUp && (oRefKeys.bKeyRight)) {
nAjustSpeed = nVERT_JUMP_MAX_SPEED;
nAtHorSpeed = 6;
oRefKeys.bKeyUp = false;
MainCTRL.oGameCTRL.__set___nJumpDone(true);
changeState("VertJump", "Right");
} else if (oRefKeys.bKeyRight) {
mcRef._y = mcRef._y + nGRAB_DOWN_SPEED;
} else if (GameCTRL.checkIfNoKey()) {
nAjustSpeed = 0;
changeState("FallDown", "Right");
}
checkGrabHit();
}
function GrabLeft() {
if (mcRef.mcState._currentframe == 10) {
if (!bGrabSndAtPlay) {
bGrabSndAtPlay = true;
MainCTRL.oSounds.playSound("Batman_Grab", 5, -1);
}
}
if (oRefKeys.bKeyRight && (!oRefKeys.bKeyLeft)) {
nAjustSpeed = 0;
changeState("Ejump", "Right");
} else if (oRefKeys.bKeyUp && (oRefKeys.bKeyLeft)) {
nAjustSpeed = nVERT_JUMP_MAX_SPEED;
nAtHorSpeed = 6;
oRefKeys.bKeyUp = false;
MainCTRL.oGameCTRL.__set___nJumpDone(true);
changeState("VertJump", "Left");
} else if (oRefKeys.bKeyLeft) {
mcRef._y = mcRef._y + nGRAB_DOWN_SPEED;
} else if (GameCTRL.checkIfNoKey()) {
nAjustSpeed = 0;
changeState("FallDown", "Left");
}
checkGrabHit();
}
function VertJumpLeft() {
if (nAtHorSpeed != 0) {
nAtHorSpeed = nAtHorSpeed - nJUMP_VERT_SPEED_MODIF;
mcRef._x = mcRef._x + nAtHorSpeed;
} else if (oRefKeys.bKeyRight) {
changeState("Sjump", "Right");
} else if (oRefKeys.bKeyLeft) {
changeState("Sjump", "Left");
}
nAjustSpeed = nAjustSpeed - nJUMP_VERT_SPEED_MODIF;
if (nAjustSpeed > 0) {
mcRef._y = mcRef._y - nAjustSpeed;
} else {
changeState("FallDown", "Left");
}
checkJumpHit("Up");
}
function VertJumpRight() {
if (nAtHorSpeed != 0) {
nAtHorSpeed = nAtHorSpeed - nJUMP_VERT_SPEED_MODIF;
mcRef._x = mcRef._x - nAtHorSpeed;
} else if (oRefKeys.bKeyLeft) {
changeState("Sjump", "Left");
} else if (oRefKeys.bKeyRight) {
changeState("Sjump", "Right");
}
nAjustSpeed = nAjustSpeed - nJUMP_VERT_SPEED_MODIF;
if (nAjustSpeed > 0) {
mcRef._y = mcRef._y - nAjustSpeed;
} else {
changeState("FallDown", "Right");
}
checkJumpHit("Up");
}
function Dead() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
mcRef.mcState.stop();
if (MainCTRL.oPopUp.__get___atState() == "Idle") {
MainCTRL.oPopUp.openPopUp("MenuIn", "Lose");
bAtDeath = false;
}
}
}
function FallDown() {
if (oRefKeys.bKeyLeft) {
nAjustSpeed = 5;
changeState("Ejump", "Left");
return(undefined);
}
if (oRefKeys.bKeyRight) {
nAjustSpeed = 5;
changeState("Ejump", "Right");
return(undefined);
}
nAjustSpeed = nAjustSpeed + nJUMP_SPEED_MODIF;
if (nAjustSpeed > nMAX_FALL_SPEED) {
nAjustSpeed = nMAX_FALL_SPEED;
}
mcRef._y = mcRef._y + nAjustSpeed;
checkFallDown();
}
var nMaxHorSPEED = 12;
var nJUMP_SPEED = 5;
var nVERT_JUMP_SPEED = 5;
var nGRAB_DOWN_SPEED = 2;
static var nHIT_DURATION = 12;
var nBOTTOM_LIMIT = -27;
static var nMAX_FALL_SPEED = 16;
var nJUMP_MAX_SPEED = 10;
var nVERT_JUMP_MAX_SPEED = 10;
var nJUMP_SPEED_MODIF = 0.8;
var nJUMP_VERT_SPEED_MODIF = 0.5;
static var oMAX_RANGE = {left:68, right:433};
var oRefKeys = {};
var nTIME_BEFORE_CTRL = 10;
}
Symbol 658 MovieClip [__Packages.Delegate] Frame 0
class 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 659 MovieClip [__Packages.Obstacle] Frame 0
class Obstacle extends State
{
static var nLastPosY;
var nRefNbr, sMaterialType, setState, mcRef, oRefGameCTRL, nAtSpeed, atState, nFrTotalAnim;
function Obstacle (_mcRef, _nRefNbr, _sMaterialType) {
super(_mcRef);
nRefNbr = _nRefNbr;
sMaterialType = _sMaterialType;
setState("Idle");
fallDown();
}
function checkClipHitBatman(_oBatmanPos, _sHitType) {
if (sOBSTACLE_TYPE != "TNT") {
if (mcRef.hitTest(_oBatmanPos.x, _oBatmanPos.y, true)) {
switch (_sHitType) {
case "Bottom" :
oRefGameCTRL.oBatman.ajustPosition(mcRef.mcHitZone, _sHitType, sOBSTACLE_TYPE);
break;
case "Side" :
oRefGameCTRL.oBatman.ajustPosition(mcRef, _sHitType, sOBSTACLE_TYPE);
}
}
}
}
function checkObjHitBatman(_oBatmanPos, _sHitDir) {
if (mcRef.hitTest(_oBatmanPos.x, _oBatmanPos.y, true)) {
oRefGameCTRL.oBatman.doHitAction(this, _sHitDir);
}
}
function fallDown() {
var _local2 = oRefGameCTRL.oBatman.findPosition();
mcRef._y = findVertPos();
mcRef._x = findHorPos();
nAtSpeed = nFALL_START_SPEED;
setState("Fall");
}
function findHorPos() {
var _local5 = oRefGameCTRL.oBatman.findPosition();
var _local4 = _local5.x;
var _local3 = mcRef._width / 2;
var _local2;
do {
_local2 = MainCTRL.randomNumber(_local4 - nHOR_DROP_RANGE, _local4 + nHOR_DROP_RANGE);
} while (((_local2 - _local3) < oMAX_RANGE.left) || ((_local2 + _local3) > oMAX_RANGE.right));
return(_local2);
}
function findVertPos() {
var _local1 = (-MainCTRL.oGameCTRL.mcScreen._y) - nSTART_POSITION;
if (_local1 > nLastPosY) {
_local1 = nLastPosY;
}
nLastPosY = _local1;
return(_local1);
}
function checkHit() {
var _local2 = 1;
while (_local2 <= oRefGameCTRL._nAtObstacle) {
if (_local2 != nRefNbr) {
if (mcRef.mcHitZone.hitTest(oRefGameCTRL.mcScreen.mcObstacleCtn["mcObstacle_" + _local2].mcHitZone)) {
var _local3 = getGlobalCoordinate(oRefGameCTRL.mcScreen.mcObstacleCtn["mcObstacle_" + _local2].mcHitZone, true);
mcRef._y = _local3.y;
setState("Hit");
}
}
_local2++;
}
if (mcRef._y >= GameCTRL.__get___nBOTTOM_LIMIT()) {
setState("Hit");
}
}
function getGlobalCoordinate(_mcRef, _bSetLocal) {
var _local2 = {x:_mcRef._x, y:_mcRef._y};
_mcRef._parent.localToGlobal(_local2);
if (_bSetLocal) {
oRefGameCTRL.mcScreen.mcObstacleCtn.globalToLocal(_local2);
}
return(_local2);
}
function doStateInit() {
switch (atState) {
case "Fall" :
var _local2 = "Obs_Falling_" + MainCTRL.randomNumber(1, 4);
MainCTRL.oSounds.playSound(_local2, 0, 0, 20);
MainCTRL.oSounds.fadeInASound(_local2);
break;
case "Hit" :
if (sMaterialType == "SteelBar") {
MainCTRL.oSounds.playSound("Obs_Hit_metal", 20);
} else {
MainCTRL.oSounds.playSound("Obs_Hit_rock", 20);
}
}
}
function Fall() {
if (nAtSpeed < nFALL_MAX_SPEED) {
nAtSpeed = nAtSpeed + nFALL_MODIF_SPEED;
}
mcRef._y = mcRef._y + nAtSpeed;
updateAfterEvent();
checkHit();
}
function Hit() {
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
setState("Idle");
}
}
function Idle() {
}
static var nFALL_MAX_SPEED = 5;
static var nFALL_START_SPEED = 1;
static var nFALL_MODIF_SPEED = 1;
static var nHOR_DROP_RANGE = 300;
static var oMAX_RANGE = {left:50, right:450};
static var nSTART_POSITION = 600;
var sOBSTACLE_TYPE = "Materials";
}
Symbol 660 MovieClip [__Packages.mx.utils.Collection] Frame 0
interface mx.utils.Collection
{
}
Symbol 661 MovieClip [__Packages.mx.utils.Iterator] Frame 0
interface mx.utils.Iterator
{
}
Symbol 662 MovieClip [__Packages.mx.utils.CollectionImpl] Frame 0
class mx.utils.CollectionImpl extends Object implements mx.utils.Collection
{
var _items;
function CollectionImpl () {
super();
_items = new Array();
}
function addItem(item) {
var _local2 = false;
if (item != null) {
_items.push(item);
_local2 = true;
}
return(_local2);
}
function clear() {
_items = new Array();
}
function contains(item) {
return(internalGetItem(item) > -1);
}
function getItemAt(index) {
return(_items[index]);
}
function getIterator() {
return(new mx.utils.IteratorImpl(this));
}
function getLength() {
return(_items.length);
}
function isEmpty() {
return(_items.length == 0);
}
function removeItem(item) {
var _local2 = false;
var _local3 = internalGetItem(item);
if (_local3 > -1) {
_items.splice(_local3, 1);
_local2 = true;
}
return(_local2);
}
function internalGetItem(item) {
var _local3 = -1;
var _local2 = 0;
while (_local2 < _items.length) {
if (_items[_local2] == item) {
_local3 = _local2;
break;
}
_local2++;
}
return(_local3);
}
}
Symbol 663 MovieClip [__Packages.mx.utils.IteratorImpl] Frame 0
class mx.utils.IteratorImpl implements mx.utils.Iterator
{
var _collection, _cursor;
function IteratorImpl (coll) {
_collection = coll;
_cursor = 0;
}
function hasNext() {
return(_cursor < _collection.getLength());
}
function next() {
return(_collection.getItemAt(_cursor++));
}
}
Symbol 664 MovieClip [__Packages.Library.ArrayCollection] Frame 0
class Library.ArrayCollection extends mx.utils.CollectionImpl implements mx.utils.Collection
{
var _items, removeItem, getItemAt, contains;
function ArrayCollection (_aArray) {
super();
_items = ((_aArray == null) ? (new Array()) : (_aArray));
}
function addItemAt(_oItem, _nIndex) {
var _local2 = false;
if (_oItem != null) {
_items.splice(_nIndex, 0, _oItem);
_local2 = true;
}
return(_local2);
}
function addMultiItems(_oItems) {
var _local2 = false;
if (_oItems != undefined) {
var _local3 = objToArray(_oItems);
_items = _items.concat(_local3);
_local2 = true;
}
return(_local2);
}
function getItemIndex(_oItem) {
var _local3 = -1;
var _local4 = length;
var _local2 = 0;
while (_local2 < _local4) {
if (_items[_local2] == _oItem) {
_local3 = _local2;
break;
}
_local2++;
}
return(_local3);
}
function removeItemAt(_nIndex) {
return(removeItem(getItemAt(_nIndex)));
}
function containsAll(_oItems) {
var _local3 = true;
var _local2 = objToArray(_oItems);
for (var _local4 in _local2) {
if (!contains(_local2[_local4])) {
_local3 = false;
break;
}
}
return(_local3);
}
function equals(_oItems) {
var _local2 = false;
if (findNbrSameItems(_oItems) == _items.length) {
_local2 = true;
}
return(_local2);
}
function toArray() {
return(_items);
}
function sortAsc() {
_items.sort();
}
function sortDes() {
_items.sort(Array.DESCENDING);
}
function sortByAsc(_oField) {
var _local2 = false;
if (_oField != null) {
_items.sortOn(_oField);
_local2 = true;
}
return(_local2);
}
function sortByDes(_oField) {
var _local2 = false;
if (_oField != null) {
_items.sortOn(_oField, Array.DESCENDING);
_local2 = true;
}
return(_local2);
}
function mixAll() {
var _local2 = _items.slice();
var _local5 = [];
var _local4;
var _local3;
for (var _local6 in _local2) {
_local4 = _local2.length - 1;
_local3 = randomNumber(0, _local4);
_local5.push(_local2[_local3]);
_local2.splice(_local3, 1);
}
_items = _local5;
}
function rndPop(_oExclude) {
var _local5 = new Library.ArrayCollection(objToArray(_oExclude));
var _local4 = [];
do {
var _local3 = _items.length - 1;
var _local2 = randomNumber(0, _local3);
_local4 = _items.slice(_local2, _local2 + 1);
} while (_local5.contains(_local4[0]));
return(_local4[0]);
}
function rndPopMulti(_nTotPop, _oExclude) {
var _local4 = 0;
var _local6 = [];
var _local2 = {};
var _local3 = [];
var _local7 = 0;
if (_oExclude != undefined) {
_local3 = objToArray(_oExclude);
_local7 = findNbrSameItems(_local3);
}
var _local8 = _items.length - _local7;
if (_nTotPop == undefined) {
_nTotPop = 1;
} else if (_nTotPop > _local8) {
_nTotPop = _local8;
}
do {
_local2 = rndPop(_local3);
_local3.push(_local2);
_local6.push(_local2);
_local4++;
} while (_local4 < _nTotPop);
return(_local6);
}
function switchValue(_oFirstVal, _oSecondVal, _oSwitchType) {
var _local6 = false;
if (((_oFirstVal != undefined) && (_oSecondVal != undefined)) && (_oSwitchType != undefined)) {
var _local3 = {};
var _local2 = {};
switch (_oSwitchType) {
case "Index" :
case 1 :
_local3 = _items[_oFirstVal];
_local2 = _items[_oSecondVal];
_items[_oFirstVal] = _local2;
_items[_oSecondVal] = _local3;
break;
case "Element" :
case 2 :
_local3 = getItemIndex(_oFirstVal);
_local2 = getItemIndex(_oSecondVal);
_items[_local3] = _oSecondVal;
_items[_local2] = _oFirstVal;
}
_local6 = true;
}
return(_local6);
}
function findNbrSameItems(_oItems) {
var _local4 = 0;
var _local3 = objToArray(_oItems);
var _local2 = 0;
while (_local2 < _local3.length) {
if (contains(_local3[_local2])) {
_local4++;
}
_local2++;
}
return(_local4);
}
function duplicate() {
var _local2 = new Library.ArrayCollection(_items.slice());
return(_local2);
}
function changeItemAt(_oItems, _nIndex) {
var _local2 = false;
if (_nIndex < _items.length) {
_items[_nIndex] = _oItems;
_local2 = true;
}
return(_local2);
}
function get length() {
return(_items.length);
}
static function randomNumber(nMin, nMax) {
var _local1 = Math.round(Math.random() * (nMax - nMin)) + nMin;
return(_local1);
}
static function checkIfCollection(_oData) {
return(_oData instanceof Library.ArrayCollection);
}
static function objToArray(_oData) {
return((checkIfCollection(_oData) ? (_oData.toArray()) : (Array(_oData))));
}
function traceAll() {
trace(" ");
trace("---- COLLECTION ----");
if (_items[0] instanceof Object) {
for (var _local3 in _items) {
trace((" * AtIndex : " + _local3) + " *");
for (var _local2 in _items[_local3]) {
trace((("key: " + _local2) + ", value: ") + _items[_local3][_local2]);
}
}
} else {
trace("_items : " + _items);
}
trace(" ");
}
}
Symbol 665 MovieClip [__Packages.GasBomb] Frame 0
class GasBomb extends Obstacle
{
var nRefNbr, setState, bGasActive, mcGasClip, mcRef, fallDown, atState, nAtSpeed, nFrTotalAnim;
function GasBomb (_mcRef, _nRefNbr) {
super(_mcRef);
nRefNbr = _nRefNbr;
setState("Idle");
bGasActive = false;
mcGasClip = mcRef._parent._parent.mcGas;
fallDown();
}
function doAction() {
this[atState]();
if (bGasActive) {
moveGas();
}
}
static function stopGasSound() {
MainCTRL.oSounds.stopSound("Obs_GasMove");
}
function checkHit() {
if (mcRef._y >= GameCTRL.__get___nBOTTOM_LIMIT()) {
setState("Hit");
}
}
function moveGas() {
mcGasClip._y = mcGasClip._y - nGAS_SPEED;
checkHitBatman();
}
function launchGas() {
mcGasClip.swapDepths(mcRef._parent._parent.getNextHighestDepth());
mcGasClip.mcGas_1.play();
mcGasClip.mcGas_2.play();
mcGasClip._visible = true;
bGasActive = true;
MainCTRL.oSounds.playSound("Obs_GasMove", 0, -1, 2);
MainCTRL.oSounds.fadeInASound("Obs_GasMove");
}
function checkHitBatman() {
var _local2 = getGlobalCoordinate(MainCTRL.oGameCTRL.oBatman.mcRef.mcTopHit_1);
if (mcGasClip.hitTest(_local2.x, _local2.y - nAJUST_HIT_DETECT, false)) {
MainCTRL.oGameCTRL.oBatman.changeState("DeadGas");
MainCTRL.removeFromBroadcaster(this);
}
}
function getGlobalCoordinate(_mcRef) {
var _local1 = {x:_mcRef._x, y:_mcRef._y};
_mcRef._parent.localToGlobal(_local1);
return(_local1);
}
function doStateInit() {
switch (atState) {
case "Fall" :
MainCTRL.oSounds.playSound("Obs_Falling_3", 0, 0, 20);
MainCTRL.oSounds.fadeInASound("Obs_Falling_3");
break;
case "Hit" :
MainCTRL.oSounds.playSound("Obs_Gas_explosion", 30);
}
}
function Fall() {
if (mcRef.mcState._currentframe == 10) {
MainCTRL.oSounds.playSound("Obs_GasBomb_Bip", 10);
}
if (nAtSpeed < Obstacle.nFALL_MAX_SPEED) {
nAtSpeed = nAtSpeed + Obstacle.nFALL_MODIF_SPEED;
}
mcRef._y = mcRef._y + nAtSpeed;
updateAfterEvent();
checkHit();
}
function Hit() {
if (mcRef.mcState._currentframe == 2) {
launchGas();
}
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
mcRef.removeMovieClip();
}
}
var nGAS_SPEED = 0.3;
var nAJUST_HIT_DETECT = 50;
var sOBSTACLE_TYPE = "GasBomb";
}
Symbol 666 MovieClip [__Packages.Hud] Frame 0
class Hud
{
var mcRef, txtHeight, txtBest, nHeight, oPoints;
function Hud (_mcRef) {
MainCTRL.__set___nBestScore(0);
mcRef = _mcRef;
MainCTRL.addToBroadcaster(this);
txtHeight = mcRef.txtHeight;
txtHeight.text = "0";
txtBest = mcRef.txtBest;
txtBest.text = String(MainCTRL.__get___nBestScore());
mcRef.btnHelp.onRelease = Delegate.create(this, doRelease, "Help");
mcRef.btnHelp.onRollOver = Delegate.create(this, doRollOverSnd);
mcRef.btnMenu.onRelease = Delegate.create(this, doRelease, "Menu");
mcRef.btnMenu.onRollOver = Delegate.create(this, doRollOverSnd);
}
function doAction() {
setHeight();
}
function get _atHeight() {
return(nHeight);
}
function setHeight() {
oPoints = MainCTRL.oGameCTRL.oBatman._oBatPos;
MainCTRL.oGameCTRL.mcScreen.globalToLocal(oPoints);
nHeight = Math.floor((Math.abs(oPoints.y) - nSTART_POS_PERSO) / nNBR_DIV);
txtHeight.text = String(nHeight);
if (nHeight > MainCTRL.__get___nBestScore()) {
MainCTRL.__set___nBestScore(nHeight);
txtBest.text = String(MainCTRL.__get___nBestScore());
}
if (nHeight >= nHEIGHT_TO_REACH) {
MainCTRL.removeFromBroadcaster(this);
MainCTRL.__set___sResetType("EndAnim");
MainCTRL.oMainCTRL.setState("Reset");
}
}
function doRelease(_sBtnType) {
switch (_sBtnType) {
case "Help" :
MainCTRL.oPopUp.setState("HelpIn");
break;
case "Menu" :
MainCTRL.oPopUp.openPopUp("MenuIn", "Help");
}
}
function doRollOverSnd() {
MainCTRL.oSounds.btnRoll();
}
static var nSTART_POS_PERSO = 27;
static var nHEIGHT_TO_REACH = 1000;
var nNBR_DIV = 3.143;
}
Symbol 667 MovieClip [__Packages.TNT] Frame 0
class TNT extends Obstacle
{
var bHitHard, nRefNbr, setState, bSetBatmanDeath, fallDown, mcRef, atState, oRefGameCTRL, nAtSpeed, checkHit, nFrTotalAnim;
function TNT (_mcRef, _nRefNbr, _bHitHard) {
super(_mcRef);
bHitHard = _bHitHard;
nRefNbr = _nRefNbr;
setState("Idle");
bSetBatmanDeath = false;
fallDown();
}
function checkIfTNT(_mcClipGenBatman) {
return(mcRef.hitTest(_mcClipGenBatman));
}
function doPauseAction() {
if (atState == "Hit") {
this[atState]();
}
}
function doStateInit() {
switch (atState) {
case "Fall" :
MainCTRL.oSounds.playSound("Obs_Falling_4", 0, 0, 10);
MainCTRL.oSounds.fadeInASound("Obs_Falling_4");
break;
case "Hit" :
MainCTRL.oSounds.playSound("Obs_TNT_explosion", 30);
}
}
function checkHitBatman() {
if (mcRef.mcExplosionHit.hitTest(MainCTRL.oGameCTRL.oBatman.mcRef.mcHitZoneGen)) {
bSetBatmanDeath = true;
}
}
function checkHitBatmanOnWall() {
if (mcRef.hitTest(MainCTRL.oGameCTRL.oBatman.mcRef)) {
setState("Hit");
bSetBatmanDeath = true;
}
}
function findHorPos() {
var _local2;
if (bHitHard) {
_local2 = oWALL_DROP_POS[oRefGameCTRL.oBatman._sBatmanDir];
} else {
var _local3 = oRefGameCTRL.oBatman.findPosition();
_local2 = _local3.x;
}
return(_local2);
}
function Fall() {
if (nAtSpeed < Obstacle.nFALL_MAX_SPEED) {
nAtSpeed = nAtSpeed + Obstacle.nFALL_MODIF_SPEED;
}
mcRef._y = mcRef._y + nAtSpeed;
updateAfterEvent();
if (bHitHard) {
checkHitBatmanOnWall();
}
checkHit();
}
function Hit() {
if (mcRef.mcState._currentframe == 7) {
if (bSetBatmanDeath) {
MainCTRL.oGameCTRL.oBatman.changeState("DeadGrd");
}
}
if (mcRef.mcState._currentframe >= nFrTotalAnim) {
MainCTRL.removeFromBroadcaster(this);
mcRef.removeMovieClip();
}
checkHitBatman();
}
static var oWALL_DROP_POS = {Left:50, Right:450};
var sOBSTACLE_TYPE = "TNT";
}
Symbol 668 MovieClip [__Packages.PopUp] Frame 0
class PopUp extends State
{
var setState, sMenuType, atState, mcRef, mcBtnSound, nFrTotalAnim;
function PopUp (_mcRef) {
super(_mcRef);
setState("Idle");
}
function openPopUp(_sPopToCall, _sMenuType) {
MainCTRL.setPause();
sMenuType = ((_sMenuType != undefined) ? (_sMenuType) : "");
setState(_sPopToCall);
}
function closePopUp(_sPopToCall) {
if (_sPopToCall != "MenuOut") {
MainCTRL.setUnPause();
}
setState(_sPopToCall);
}
function resumeGame() {
MainCTRL.setUnPause();
setState("Idle");
}
function outHowTo() {
if (MainCTRL.oMainCTRL.__get___atState() == "TitleCard") {
setState("Idle");
} else {
setState("MnShow");
}
}
function setMenu(_mcRef) {
_mcRef.gotoAndStop(sMenuType);
if (atState == "Menu") {
switch (sMenuType) {
case "Help" :
_mcRef.btnResume.onRelease = Delegate.create(this, doRelease, "resume");
_mcRef.btnResume.onRollOver = Delegate.create(this, doRollOverSnd);
_mcRef.btnResume.onPress = Delegate.create(this, doPressSnd);
_mcRef.btnQuit.onRelease = Delegate.create(this, doRelease, "quit");
_mcRef.btnQuit.onRollOver = Delegate.create(this, doRollOverSnd);
_mcRef.btnQuit.onPress = Delegate.create(this, doPressSnd);
break;
case "Lose" :
_mcRef.btnQuit.onRelease = Delegate.create(this, doRelease, "quit");
_mcRef.btnQuit.onRollOver = Delegate.create(this, doRollOverSnd);
_mcRef.btnQuit.onPress = Delegate.create(this, doPressSnd);
}
}
}
function doPauseAction() {
this[atState]();
}
function doStateInit(_sState) {
switch (_sState) {
case "Black" :
MainCTRL.oMainCTRL.setState("Reset");
break;
case "HelpIn" :
case "HelpOut" :
MainCTRL.oSounds.playSound("PopUp_CTRL", 15);
break;
case "Help" :
mcRef.mcState.mcHelp.btnClose.onRelease = Delegate.create(this, doRelease, "close");
mcRef.mcState.mcHelp.btnClose.onRollOver = Delegate.create(this, doRollOverSnd);
break;
case "MenuIn" :
MainCTRL.oSounds.playSound("PopUp_Menu_in", 20);
break;
case "MenuOut" :
MainCTRL.oSounds.playSound("PopUp_Menu_out", 20);
}
}
function doRelease(_sBtnType) {
switch (_sBtnType) {
case "close" :
setState("HelpOut");
break;
case "resume" :
closePopUp("MenuOut");
break;
case "quit" :
mcRef.mcState.mcMenu.gotoAndStop("Quit");
mcRef.mcState.mcMenu.btnYes.onRelease = Delegate.create(this, doRelease, "yes");
mcRef.mcState.mcMenu.btnYes.onRollOver = Delegate.create(this, doRollOverSnd);
mcRef.mcState.mcMenu.btnYes.onPress = Delegate.create(this, doPressSnd);
mcRef.mcState.mcMenu.btnNo.onRelease = Delegate.create(this, doRelease, "no");
mcRef.mcState.mcMenu.btnNo.onRollOver = Delegate.create(this, doRollOverSnd);
mcRef.mcState.mcMenu.btnNo.onPress = Delegate.create(this, doPressSnd);
break;
case "yes" :
MainCTRL.__set___sResetType("quit");
setState("FadeOut");
break;
case "no" :
if (sMenuType == "Help") {
mcRef.mcState.mcMenu.gotoAndStop("Help");
mcRef.mcState.mcMenu.btnResume.onRelease = Delegate.create(this, doRelease, "resume");
mcRef.mcState.mcMenu.btnQuit.onRelease = Delegate.create(this, doRelease, "quit");
} else {
mcRef.mcState.mcMenu.gotoAndStop("Lose");
mcRef.mcState.mcMenu.btnQuit.onRelease = Delegate.create(this, doRelease, "quit");
}
break;
case "SndOff" :
MainCTRL.oSounds.fadeOutAMusic("Music_Game");
MainCTRL.oSounds.muteAll();
initBtnSound();
break;
case "SndOn" :
MainCTRL.oSounds.unMuteAll();
MainCTRL.oSounds.fadeInAMusic("Music_Game");
initBtnSound();
}
}
function initBtnSound(_mcRef) {
if (_mcRef != undefined) {
mcBtnSound = _mcRef;
}
if (!MainCTRL.oSounds.bMuted) {
mcBtnSound.gotoAndStop("On");
mcBtnSound.btnSndOff.onRelease = Delegate.create(this, doRelease, "SndOff");
mcBtnSound.btnSndOff.onRollOver = Delegate.create(this, doRollOverSnd);
mcBtnSound.btnSndOff.onPress = Delegate.create(this, doPressSnd);
} else {
mcBtnSound.gotoAndStop("Off");
mcBtnSound.btnSndOn.onRelease = Delegate.create(this, doRelease, "SndOn");
mcBtnSound.btnSndOn.onRollOver = Delegate.create(this, doRollOverSnd);
mcBtnSound.btnSndOn.onPress = Delegate.create(this, doPressSnd);
}
}
function Idle() {
}
function Black() {
}
function FadeIn() {
if (mcRef.mcState._currentframe == nFrTotalAnim) {
MainCTRL.setUnPause();
setState("Idle");
}
}
function FadeOut() {
if (mcRef.mcState._currentframe == nFrTotalAnim) {
setState("Black");
}
}
function HelpIn() {
if (mcRef.mcState._currentframe == nFrTotalAnim) {
setState("Help");
}
}
function Help() {
}
function HelpOut() {
if (mcRef.mcState._currentframe == nFrTotalAnim) {
setState("Idle");
}
}
function MenuIn() {
if (mcRef.mcState._currentframe == nFrTotalAnim) {
setState("Menu");
}
}
function Menu() {
if (GameCTRL.__get___oRefKeys().bR) {
MainCTRL.__set___sResetType("playAgain");
MainCTRL.oPopUp.openPopUp("FadeOut");
}
}
function MenuOut() {
if (mcRef.mcState._currentframe == nFrTotalAnim) {
MainCTRL.setUnPause();
setState("Idle");
}
}
function doRollOverSnd() {
MainCTRL.oSounds.btnRoll();
}
function doPressSnd() {
MainCTRL.oSounds.btnClick();
}
}
Symbol 669 MovieClip [__Packages.Sounds] Frame 0
class Sounds
{
var mcRef, nSoundsVolume, nMusicsVolume, aSounds, aMusics, bMuted;
function Sounds (_mcRef) {
mcRef = _mcRef;
nSoundsVolume = 100;
nMusicsVolume = 100;
aSounds = new Array();
aMusics = new Array();
bMuted = false;
}
function playSound(_sLinkage, _nVolume, _nLoop, _nMaxVolume) {
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_nVolume > 0) {
_nMaxVolume = _nVolume;
}
if (_nLoop == undefined) {
_nLoop = 0;
} else if (_nLoop == -1) {
_nLoop = 99999999 /* 0x5F5E0FF */;
}
var _local2 = findSound(_sLinkage);
if (_local2 == -1) {
var _local6 = new Sound(mcRef.createEmptyMovieClip(_sLinkage, mcRef.getNextHighestDepth()));
_local6.attachSound(_sLinkage);
var _local7 = new Object({name:_sLinkage, sound:_local6, maxVolume:_nMaxVolume});
_local7.volume = _nVolume;
aSounds.push(_local7);
_local2 = aSounds.length - 1;
}
aSounds[_local2].sound.setVolume(aSounds[_local2].volume);
aSounds[_local2].maxVolume = _nMaxVolume;
if (!bMuted) {
aSounds[_local2].sound.start(0, _nLoop);
}
}
function playMusic(_sLinkage, _nVolume, _nLoop, _nMaxVolume) {
if (_nVolume == undefined) {
_nVolume = 100;
}
if (_nVolume > 0) {
_nMaxVolume = _nVolume;
}
if (_nLoop == undefined) {
_nLoop = 0;
} else if (_nLoop == -1) {
_nLoop = 99999999 /* 0x5F5E0FF */;
}
var _local2 = findMusic(_sLinkage);
if (_local2 == -1) {
var _local7 = new Sound(mcRef.createEmptyMovieClip(_sLinkage, mcRef.getNextHighestDepth()));
_local7.attachSound(_sLinkage);
var _local6 = new Object({name:_sLinkage, sound:_local7, maxVolume:_nMaxVolume});
_local6.volume = _nVolume;
aMusics.push(_local6);
_local2 = aMusics.length - 1;
}
aMusics[_local2].sound.setVolume(aMusics[_local2].volume);
aMusics[_local2].maxVolume = _nMaxVolume;
if (bMuted) {
aMusics[_local2].sound.setVolume(0);
aMusics[_local2].volume = 0;
}
aMusics[_local2].sound.start(0, _nLoop);
}
function stopMusic(_sLinkage) {
var _local2 = findMusic(_sLinkage);
aMusics[_local2].sound.stop();
}
function stopSound(_sLinkage) {
var _local2 = findSound(_sLinkage);
aSounds[_local2].sound.stop();
}
function setSoundsVolume(_nVolume) {
for (var _local4 in aSounds) {
var _local2 = aSounds[_local4];
_local2.volume = (_nVolume * _local2.maxVolume) / 100;
changeVolume(_local2);
}
nSoundsVolume = _nVolume;
}
function setMusicVolume(_nVolume) {
for (var _local4 in aMusics) {
var _local2 = aMusics[_local4];
_local2.volume = (_nVolume * _local2.maxVolume) / 100;
changeVolume(_local2);
}
nMusicsVolume = _nVolume;
}
function fadeInMusic() {
for (var _local4 in aMusics) {
var _local2 = aMusics[_local4];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, 0, _local2.maxVolume, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutMusic() {
for (var _local4 in aMusics) {
var _local2 = aMusics[_local4];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeInSound() {
for (var _local4 in aSounds) {
var _local2 = aSounds[_local4];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, 0, _local2.maxVolume, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeInASound(_sLinkage) {
if (!bMuted) {
var _local2 = aSounds[findSound(_sLinkage)];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.volume, _local2.maxVolume, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutSound() {
for (var _local4 in aSounds) {
var _local2 = aSounds[_local4];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutASound(_sLinkage) {
if (!bMuted) {
var _local2 = aSounds[findSound(_sLinkage)];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeInAMusic(_sLinkage) {
if (!bMuted) {
var _local2 = aMusics[findMusic(_sLinkage)];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.volume, _local2.maxVolume, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutAMusic(_sLinkage) {
if (!bMuted) {
var _local2 = aMusics[findMusic(_sLinkage)];
var _local3 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local3.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeInAll() {
for (var _local5 in aSounds) {
var _local3 = aSounds[_local5];
var _local4 = new mx.transitions.Tween(_local3, "volume", mx.transitions.easing.Regular.easeOut, 0, _local3.maxVolume, 2, true);
_local4.onMotionChanged = Delegate.create(this, changeVolume, _local3);
}
for (var _local5 in aMusics) {
var _local2 = aMusics[_local5];
var _local4 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, 0, _local2.maxVolume, 2, true);
_local4.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function fadeOutAll() {
for (var _local5 in aSounds) {
var _local3 = aSounds[_local5];
var _local4 = new mx.transitions.Tween(_local3, "volume", mx.transitions.easing.Regular.easeOut, _local3.sound.getVolume(), 0, 2, true);
_local4.onMotionChanged = Delegate.create(this, changeVolume, _local3);
}
for (var _local5 in aMusics) {
var _local2 = aMusics[_local5];
var _local4 = new mx.transitions.Tween(_local2, "volume", mx.transitions.easing.Regular.easeOut, _local2.sound.getVolume(), 0, 2, true);
_local4.onMotionChanged = Delegate.create(this, changeVolume, _local2);
}
}
function muteAll() {
bMuted = true;
}
function unMuteAll() {
bMuted = false;
}
function btnClick() {
playSound("BTN_Click", 10);
}
function btnRoll() {
playSound("BTN_Roll", 20);
}
function get muted() {
return(bMuted);
}
function findSound(_sLinkage) {
var _local2 = -1;
for (var _local4 in aSounds) {
if (aSounds[_local4].name == _sLinkage) {
_local2 = _local4;
break;
}
}
return(_local2);
}
function findMusic(_sLinkage) {
var _local2 = -1;
for (var _local4 in aMusics) {
if (aMusics[_local4].name == _sLinkage) {
_local2 = _local4;
break;
}
}
return(_local2);
}
function changeVolume(_oSound) {
_oSound.sound.setVolume(_oSound.volume);
}
}
Symbol 670 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 671 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 672 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 673 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 21 MovieClip Frame 1
_visible = false;
Symbol 82 MovieClip Frame 1
Symbol 132 MovieClip Frame 1
stop();
Symbol 167 MovieClip Frame 15
MainCTRL.oSounds.playSound("Obs_Falling_1", 20);
Symbol 167 MovieClip Frame 22
MainCTRL.oSounds.playSound("Obs_Falling_2", 20);
Symbol 167 MovieClip Frame 66
MainCTRL.oSounds.playSound("Obs_Falling_4", 20);
Symbol 167 MovieClip Frame 81
MainCTRL.oSounds.playSound("Obs_Falling_3", 20);
Symbol 167 MovieClip Frame 96
MainCTRL.oSounds.playSound("Obs_Falling_3", 20);
Symbol 167 MovieClip Frame 131
MainCTRL.oSounds.playSound("Obs_Falling_1", 20);
Symbol 167 MovieClip Frame 136
MainCTRL.oSounds.playSound("Obs_Falling_4", 20);
Symbol 194 MovieClip Frame 1
if (MainCTRL.oMainCTRL.__get___atState() == "Game") {
stop();
}
Symbol 194 MovieClip Frame 699
gotoAndPlay (2);
Symbol 202 MovieClip Frame 1
btnBlock.enabled = false;
Symbol 248 MovieClip Frame 1
MainCTRL.oPopUp.initBtnSound(this);
trace("frame on");
Symbol 248 MovieClip Frame 5
trace("frame off");
Symbol 253 MovieClip Frame 1
MainCTRL.oPopUp.setMenu(this);
Symbol 253 MovieClip Frame 13
if (_root.bAnimDone) {
_root.sScore = _root.mcState.mcHud.txtBest.text;
_root.nScore = parseFloat(_root.sScore);
_root.ShowHighScore();
trace(_root.nScore + "in here");
}
Symbol 254 MovieClip Frame 20
_root.bAnimDone = true;
Symbol 255 MovieClip Frame 5
stop();
Symbol 323 MovieClip Frame 1
_visible = false;
Symbol 324 MovieClip Frame 1
_visible = false;
Symbol 401 MovieClip Frame 14
gotoAndPlay (3);
Symbol 448 MovieClip Frame 10
stop();
Symbol 463 MovieClip Frame 21
gotoAndPlay (6);
Symbol 487 MovieClip Frame 48
stop();
Symbol 525 MovieClip Frame 1
_visible = false;
Symbol 649 MovieClip Frame 1
stop();
Symbol 649 MovieClip Frame 28
MainCTRL.oMainCTRL.endWinScreen();