Section 1
//fondo_intro_mc_7 (BomberSanta_fla.fondo_intro_mc_7)
package BomberSanta_fla {
import flash.display.*;
public dynamic class fondo_intro_mc_7 extends MovieClip {
public function fondo_intro_mc_7(){
addFrameScript(1411, frame1412);
}
function frame1412(){
stop();
MovieClip(root).gotoAndPlay("mainMenu");
}
}
}//package BomberSanta_fla
Section 2
//gameClip_MovieClassroom1_143 (BomberSanta_fla.gameClip_MovieClassroom1_143)
package BomberSanta_fla {
import flash.display.*;
import game.*;
public dynamic class gameClip_MovieClassroom1_143 extends MovieClip {
public var instChar3:gameClip_Student2_Class1;
public var instChar1:gameClip_Leader_Class1;
public var instChar2:gameClip_Student1_Class1;
public var instChar4:gameClip_Student3_Class1;
public function gameClip_MovieClassroom1_143(){
addFrameScript(0, frame1, 43, frame44, 104, frame105, 207, frame208);
}
function frame208(){
parent.visible = false;
stop();
}
function frame105(){
instChar1.instCircle.visible = false;
}
function frame1(){
instChar1.instCircle.visible = false;
}
function frame44(){
instChar1.instCircle.visible = false;
}
}
}//package BomberSanta_fla
Section 3
//gameClip_MovieClassroom2_391 (BomberSanta_fla.gameClip_MovieClassroom2_391)
package BomberSanta_fla {
import flash.display.*;
import game.*;
public dynamic class gameClip_MovieClassroom2_391 extends MovieClip {
public var instChar3:gameClip_Student2_Class2;
public var instChar1:gameClip_Leader_Class2;
public var instChar2:gameClip_Student1_Class2;
public var instChar4:gameClip_Student3_Class2;
public function gameClip_MovieClassroom2_391(){
addFrameScript(0, frame1, 65, frame66, 149, frame150, 268, frame269);
}
function frame150(){
instChar1.instCircle.visible = false;
}
function frame1(){
instChar1.instCircle.visible = false;
}
function frame269(){
parent.visible = false;
stop();
}
function frame66(){
instChar1.instCircle.visible = false;
}
}
}//package BomberSanta_fla
Section 4
//gameClip_MovieClassroom3_633 (BomberSanta_fla.gameClip_MovieClassroom3_633)
package BomberSanta_fla {
import flash.display.*;
import game.*;
public dynamic class gameClip_MovieClassroom3_633 extends MovieClip {
public var instChar3:gameClip_Student2_Class3;
public var instChar1:gameClip_Leader_Class3;
public var instChar2:gameClip_Student1_Class3;
public var instChar4:gameClip_Student3_Class3;
public function gameClip_MovieClassroom3_633(){
addFrameScript(224, frame225);
}
function frame225(){
parent.visible = false;
stop();
}
}
}//package BomberSanta_fla
Section 5
//gameClip_MovieClassroom4_874 (BomberSanta_fla.gameClip_MovieClassroom4_874)
package BomberSanta_fla {
import flash.display.*;
import game.*;
public dynamic class gameClip_MovieClassroom4_874 extends MovieClip {
public var instChar3:gameClip_Student2_Class4;
public var instChar1:gameClip_Leader_Class4;
public var instChar2:gameClip_Student1_Class4;
public var instChar4:gameClip_Student3_Class4;
public function gameClip_MovieClassroom4_874(){
addFrameScript(226, frame227);
}
function frame227(){
parent.visible = false;
stop();
}
}
}//package BomberSanta_fla
Section 6
//gameClip_MovieClassroom5_1115 (BomberSanta_fla.gameClip_MovieClassroom5_1115)
package BomberSanta_fla {
import flash.display.*;
import game.*;
public dynamic class gameClip_MovieClassroom5_1115 extends MovieClip {
public var instChar3:gameClip_Student2_Class5;
public var instChar1:gameClip_Leader_Class5;
public var instChar2:gameClip_Student1_Class5;
public var instChar4:gameClip_Student3_Class5;
public function gameClip_MovieClassroom5_1115(){
addFrameScript(239, frame240);
}
function frame240(){
parent.visible = false;
stop();
}
}
}//package BomberSanta_fla
Section 7
//gameClip_MovieClassroom6_1356 (BomberSanta_fla.gameClip_MovieClassroom6_1356)
package BomberSanta_fla {
import flash.display.*;
import game.*;
public dynamic class gameClip_MovieClassroom6_1356 extends MovieClip {
public var instChar3:gameClip_Student2_Class6;
public var instChar1:gameClip_Leader_Class6;
public var instChar2:gameClip_Student1_Class6;
public var instChar4:gameClip_Student3_Class6;
public function gameClip_MovieClassroom6_1356(){
addFrameScript(289, frame290);
}
function frame290(){
stop();
}
}
}//package BomberSanta_fla
Section 8
//gameClip_MovieClassroom7_1597 (BomberSanta_fla.gameClip_MovieClassroom7_1597)
package BomberSanta_fla {
import flash.display.*;
import game.*;
public dynamic class gameClip_MovieClassroom7_1597 extends MovieClip {
public var instChar3:gameClip_Student2_Class7;
public var instChar1:gameClip_Leader_Class7;
public var instChar2:gameClip_Student1_Class7;
public var instChar4:gameClip_Student3_Class7;
public function gameClip_MovieClassroom7_1597(){
addFrameScript(302, frame303);
}
function frame303(){
parent.visible = false;
stop();
}
}
}//package BomberSanta_fla
Section 9
//gc_Leader_Class1_Dissapear_168 (BomberSanta_fla.gc_Leader_Class1_Dissapear_168)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Leader_Class1_Dissapear_168 extends MovieClip {
public function gc_Leader_Class1_Dissapear_168(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 10
//gc_Leader_Class2_Dissapear_410 (BomberSanta_fla.gc_Leader_Class2_Dissapear_410)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Leader_Class2_Dissapear_410 extends MovieClip {
public function gc_Leader_Class2_Dissapear_410(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 11
//gc_Leader_Class3_Dissapear_651 (BomberSanta_fla.gc_Leader_Class3_Dissapear_651)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Leader_Class3_Dissapear_651 extends MovieClip {
public function gc_Leader_Class3_Dissapear_651(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 12
//gc_Leader_Class4_Dissapear_892 (BomberSanta_fla.gc_Leader_Class4_Dissapear_892)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Leader_Class4_Dissapear_892 extends MovieClip {
public function gc_Leader_Class4_Dissapear_892(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 13
//gc_Leader_Class5_Dissapear_1133 (BomberSanta_fla.gc_Leader_Class5_Dissapear_1133)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Leader_Class5_Dissapear_1133 extends MovieClip {
public function gc_Leader_Class5_Dissapear_1133(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 14
//gc_Leader_Class6_Dissapear_1374 (BomberSanta_fla.gc_Leader_Class6_Dissapear_1374)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Leader_Class6_Dissapear_1374 extends MovieClip {
public function gc_Leader_Class6_Dissapear_1374(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 15
//gc_Leader_Class7_Dissapear_1615 (BomberSanta_fla.gc_Leader_Class7_Dissapear_1615)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Leader_Class7_Dissapear_1615 extends MovieClip {
public function gc_Leader_Class7_Dissapear_1615(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 16
//gc_Santa_Class1__FinalGift_1864 (BomberSanta_fla.gc_Santa_Class1__FinalGift_1864)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Santa_Class1__FinalGift_1864 extends MovieClip {
public function gc_Santa_Class1__FinalGift_1864(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package BomberSanta_fla
Section 17
//gc_Student1_Class1_Dissapear_288 (BomberSanta_fla.gc_Student1_Class1_Dissapear_288)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student1_Class1_Dissapear_288 extends MovieClip {
public function gc_Student1_Class1_Dissapear_288(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 18
//gc_Student1_Class2_Dissapear_530 (BomberSanta_fla.gc_Student1_Class2_Dissapear_530)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student1_Class2_Dissapear_530 extends MovieClip {
public function gc_Student1_Class2_Dissapear_530(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 19
//gc_Student1_Class3_Dissapear_771 (BomberSanta_fla.gc_Student1_Class3_Dissapear_771)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student1_Class3_Dissapear_771 extends MovieClip {
public function gc_Student1_Class3_Dissapear_771(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 20
//gc_Student1_Class4_Dissapear_1012 (BomberSanta_fla.gc_Student1_Class4_Dissapear_1012)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student1_Class4_Dissapear_1012 extends MovieClip {
public function gc_Student1_Class4_Dissapear_1012(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 21
//gc_Student1_Class5_Dissapear_1253 (BomberSanta_fla.gc_Student1_Class5_Dissapear_1253)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student1_Class5_Dissapear_1253 extends MovieClip {
public function gc_Student1_Class5_Dissapear_1253(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 22
//gc_Student1_Class6_Dissapear_1494 (BomberSanta_fla.gc_Student1_Class6_Dissapear_1494)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student1_Class6_Dissapear_1494 extends MovieClip {
public function gc_Student1_Class6_Dissapear_1494(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 23
//gc_Student1_Class7_Dissapear_1735 (BomberSanta_fla.gc_Student1_Class7_Dissapear_1735)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student1_Class7_Dissapear_1735 extends MovieClip {
public function gc_Student1_Class7_Dissapear_1735(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 24
//gc_Student2_Class1_Dissapear_348 (BomberSanta_fla.gc_Student2_Class1_Dissapear_348)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student2_Class1_Dissapear_348 extends MovieClip {
public function gc_Student2_Class1_Dissapear_348(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 25
//gc_Student2_Class2_Dissapear_590 (BomberSanta_fla.gc_Student2_Class2_Dissapear_590)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student2_Class2_Dissapear_590 extends MovieClip {
public function gc_Student2_Class2_Dissapear_590(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 26
//gc_Student2_Class3_Dissapear_831 (BomberSanta_fla.gc_Student2_Class3_Dissapear_831)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student2_Class3_Dissapear_831 extends MovieClip {
public function gc_Student2_Class3_Dissapear_831(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 27
//gc_Student2_Class4_Dissapear_1072 (BomberSanta_fla.gc_Student2_Class4_Dissapear_1072)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student2_Class4_Dissapear_1072 extends MovieClip {
public function gc_Student2_Class4_Dissapear_1072(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 28
//gc_Student2_Class5_Dissapear_1313 (BomberSanta_fla.gc_Student2_Class5_Dissapear_1313)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student2_Class5_Dissapear_1313 extends MovieClip {
public function gc_Student2_Class5_Dissapear_1313(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 29
//gc_Student2_Class6_Dissapear_1554 (BomberSanta_fla.gc_Student2_Class6_Dissapear_1554)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student2_Class6_Dissapear_1554 extends MovieClip {
public function gc_Student2_Class6_Dissapear_1554(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 30
//gc_Student2_Class7_Dissapear_1795 (BomberSanta_fla.gc_Student2_Class7_Dissapear_1795)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student2_Class7_Dissapear_1795 extends MovieClip {
public function gc_Student2_Class7_Dissapear_1795(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 31
//gc_Student3_Class1_Dissapear_228 (BomberSanta_fla.gc_Student3_Class1_Dissapear_228)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student3_Class1_Dissapear_228 extends MovieClip {
public function gc_Student3_Class1_Dissapear_228(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 32
//gc_Student3_Class2_Dissapear_470 (BomberSanta_fla.gc_Student3_Class2_Dissapear_470)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student3_Class2_Dissapear_470 extends MovieClip {
public function gc_Student3_Class2_Dissapear_470(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 33
//gc_Student3_Class3_Dissapear_711 (BomberSanta_fla.gc_Student3_Class3_Dissapear_711)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student3_Class3_Dissapear_711 extends MovieClip {
public function gc_Student3_Class3_Dissapear_711(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 34
//gc_Student3_Class4_Dissapear_952 (BomberSanta_fla.gc_Student3_Class4_Dissapear_952)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student3_Class4_Dissapear_952 extends MovieClip {
public function gc_Student3_Class4_Dissapear_952(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 35
//gc_Student3_Class5_Dissapear_1193 (BomberSanta_fla.gc_Student3_Class5_Dissapear_1193)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student3_Class5_Dissapear_1193 extends MovieClip {
public function gc_Student3_Class5_Dissapear_1193(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 36
//gc_Student3_Class6_Dissapear_1434 (BomberSanta_fla.gc_Student3_Class6_Dissapear_1434)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student3_Class6_Dissapear_1434 extends MovieClip {
public function gc_Student3_Class6_Dissapear_1434(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 37
//gc_Student3_Class7_Dissapear_1675 (BomberSanta_fla.gc_Student3_Class7_Dissapear_1675)
package BomberSanta_fla {
import flash.display.*;
public dynamic class gc_Student3_Class7_Dissapear_1675 extends MovieClip {
public function gc_Student3_Class7_Dissapear_1675(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package BomberSanta_fla
Section 38
//logojuego_108 (BomberSanta_fla.logojuego_108)
package BomberSanta_fla {
import flash.display.*;
public dynamic class logojuego_108 extends MovieClip {
public function logojuego_108(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package BomberSanta_fla
Section 39
//MainTimeline (BomberSanta_fla.MainTimeline)
package BomberSanta_fla {
import flash.display.*;
import flash.events.*;
import mochiads.*;
public dynamic class MainTimeline extends MovieClip {
public var instMainMenu:MovieClip;
public var instFondoIntroMC:MovieClip;
public var instSkipIntroBut:SimpleButton;
public function MainTimeline(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 35, frame36, 44, frame45, 54, frame55);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame20(){
MochiAd.showPreGameAd({clip:root, id:"05944f263a4fc7ac", res:"550x550", background:7895240, color:0xFFFF, outline:5323989, no_bg:false});
}
public function releaseButtonsIntroBomber(_arg1:MouseEvent):void{
instFondoIntroMC.gotoAndStop("endIntroBomberXX");
gotoAndStop("mainMenu");
}
function frame36(){
stop();
}
function frame45(){
instSkipIntroBut.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtonsIntroBomber);
stop();
}
function frame55(){
stage.quality = StageQuality.MEDIUM;
stop();
}
}
}//package BomberSanta_fla
Section 40
//menuClip_MainMenu_97 (BomberSanta_fla.menuClip_MainMenu_97)
package BomberSanta_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import sounds.*;
import game.*;
import common.*;
import flash.utils.*;
import fontsGame.*;
import flash.media.*;
import flash.system.*;
import flash.net.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class menuClip_MainMenu_97 extends MovieClip {
public var instLockedLevel3:TextField;
public var instLockedLevel5:TextField;
public var instLockedLevel7:TextField;
public var instLockedLevel4:TextField;
public var instButtonHistory:SimpleButton;
public var instLockedPlayer1:TextField;
public var instLockedPlayer2:TextField;
public var instLockedPlayer3:TextField;
public var instLockedPlayer4:TextField;
public var instButtonLevel2:SimpleButton;
public var instButtonLevel3:SimpleButton;
public var instButtonLevel4:SimpleButton;
public var instButtonLevel5:SimpleButton;
public var instButtonLevel6:SimpleButton;
public var instButtonLevel1:SimpleButton;
public var instLockedLevel6:TextField;
public var instButtonLevel7:SimpleButton;
public var m_isHistoryMode:Boolean;
public var instLife:gameClip_Item;
public var instButtonHelp:SimpleButton;
public var instStrength:gameClip_Item;
public var instButtonBack_LevelSelection:SimpleButton;
public var m_indexPlayerTwoSelected:Number;
public var m_numberOfPlayers:Number;
public var m_indexPlayerOneSelected:Number;
public var m_playersUnlocked:Number;
public var currentPlayerSelection:Number;
public var instButtonDeathmatch:SimpleButton;
public var instButtonPlayerClass1:SimpleButton;
public var instButtonPlayerClass2:SimpleButton;
public var instButtonPlayerClass4:SimpleButton;
public var instButtonPlayerClass5:SimpleButton;
public var instButtonPlayerClass3:SimpleButton;
public var instButtonPlayerClass6:SimpleButton;
public var instButtonBack_About:SimpleButton;
public var instShield:gameClip_Item;
public var instButtonAbout:SimpleButton;
public var instButtonBack_PlayerSelection:SimpleButton;
public var m_globalSounds:SoundsGame;
public var instButtonPlayerTwo:SimpleButton;
public var instButtonBack_Help:SimpleButton;
public var m_levelsUnlocked:Number;
public var instButtonPlayerOne:SimpleButton;
public var instSpeed:gameClip_Item;
public var instTextPlayer_Title:TextField;
public var instButtonBack_PlayerNumber:SimpleButton;
public var alphaForButtonLevel:Number;
public var m_gameClip:gameClip;
public function menuClip_MainMenu_97(){
addFrameScript(0, frame1, 12, frame13, 24, frame25, 37, frame38, 49, frame50, 61, frame62, 72, frame73, 100, frame101);
}
public function listenGameFinish(_arg1:Event):void{
if (m_gameClip != null){
if (m_gameClip.m_state == gameClip.STATE_GAME_NONE){
removeEventListener(Event.ENTER_FRAME, listenGameFinish);
gotoAndStop("mainMenu");
};
};
}
function frame25(){
currentPlayerSelection = 1;
instButtonBack_PlayerSelection.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
if (m_playersUnlocked > 0){
instButtonPlayerClass1.enabled = true;
instButtonPlayerClass1.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
} else {
instButtonPlayerClass1.enabled = false;
};
if (m_playersUnlocked > 1){
instButtonPlayerClass2.enabled = true;
instButtonPlayerClass2.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
} else {
instButtonPlayerClass2.enabled = false;
};
if (m_playersUnlocked > 2){
instLockedPlayer1.visible = false;
instButtonPlayerClass3.enabled = true;
instButtonPlayerClass3.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
} else {
instLockedPlayer1.visible = true;
instButtonPlayerClass3.enabled = false;
};
if (m_playersUnlocked > 3){
instLockedPlayer2.visible = false;
instButtonPlayerClass4.enabled = true;
instButtonPlayerClass4.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
} else {
instLockedPlayer2.visible = true;
instButtonPlayerClass4.enabled = false;
};
if (m_playersUnlocked > 4){
instLockedPlayer3.visible = false;
instButtonPlayerClass5.enabled = true;
instButtonPlayerClass5.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
} else {
instLockedPlayer3.visible = true;
instButtonPlayerClass5.enabled = false;
};
if (m_playersUnlocked > 5){
instLockedPlayer4.visible = false;
instButtonPlayerClass6.enabled = true;
instButtonPlayerClass6.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
} else {
instLockedPlayer4.visible = true;
instButtonPlayerClass6.enabled = false;
};
if (m_numberOfPlayers == 1){
instTextPlayer_Title.text = "SELECT PLAYER";
} else {
instTextPlayer_Title.text = "SELECT PLAYER 1";
};
stop();
}
public function releaseButtons_About(_arg1:MouseEvent):void{
if (_arg1.currentTarget == instButtonBack_About){
m_globalSounds.stopGameSound(SoundsGame.SOUNDS_MELODY_MENU);
gotoAndStop("mainMenu");
};
m_globalSounds.playGameSound(SoundsGame.SOUNDS_SELECTION, 1);
}
public function releaseButtons_PlayerNumber(_arg1:MouseEvent):void{
m_globalSounds.playGameSound(SoundsGame.SOUNDS_SELECTION, 1);
if (_arg1.currentTarget == instButtonBack_PlayerNumber){
m_globalSounds.stopGameSound(SoundsGame.SOUNDS_MELODY_MENU);
gotoAndStop("mainMenu");
};
if (_arg1.currentTarget == instButtonPlayerOne){
m_numberOfPlayers = 1;
gotoAndStop("playerSelection");
};
if (_arg1.currentTarget == instButtonPlayerTwo){
m_numberOfPlayers = 2;
gotoAndStop("playerSelection");
};
}
function frame13(){
instButtonBack_PlayerNumber.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerNumber);
instButtonPlayerOne.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerNumber);
instButtonPlayerTwo.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerNumber);
stop();
}
function frame38(){
alphaForButtonLevel = 20;
instButtonBack_LevelSelection.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_LevelSelection);
if (m_levelsUnlocked > 0){
instButtonLevel1.enabled = true;
instButtonLevel1.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_LevelSelection);
} else {
instButtonLevel1.enabled = false;
};
if (m_levelsUnlocked > 1){
instButtonLevel2.enabled = true;
instButtonLevel2.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_LevelSelection);
} else {
instButtonLevel2.enabled = false;
};
if (m_levelsUnlocked > 2){
instButtonLevel3.enabled = true;
instLockedLevel3.visible = false;
instButtonLevel3.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_LevelSelection);
} else {
instButtonLevel3.enabled = false;
instLockedLevel3.visible = true;
};
if (m_levelsUnlocked > 3){
instButtonLevel4.enabled = true;
instLockedLevel4.visible = false;
instButtonLevel4.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_LevelSelection);
} else {
instButtonLevel4.enabled = false;
instLockedLevel4.visible = true;
};
if (m_levelsUnlocked > 4){
instButtonLevel5.enabled = true;
instLockedLevel5.visible = false;
instButtonLevel5.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_LevelSelection);
} else {
instButtonLevel5.enabled = false;
instLockedLevel5.visible = true;
};
if (m_levelsUnlocked > 5){
instButtonLevel6.enabled = true;
instLockedLevel6.visible = false;
instButtonLevel6.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_LevelSelection);
} else {
instButtonLevel6.enabled = false;
instLockedLevel6.visible = true;
};
if (m_levelsUnlocked > 6){
instButtonLevel7.enabled = true;
instLockedLevel7.visible = false;
instButtonLevel7.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_LevelSelection);
} else {
instButtonLevel7.enabled = false;
instLockedLevel7.visible = true;
};
stop();
}
function frame1(){
m_globalSounds = new SoundsGame();
m_isHistoryMode = false;
m_numberOfPlayers = 0;
m_indexPlayerOneSelected = -1;
m_indexPlayerTwoSelected = -1;
m_playersUnlocked = 2;
m_levelsUnlocked = 2;
instButtonHistory.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instButtonDeathmatch.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instButtonHelp.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instButtonAbout.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
if (m_gameClip == null){
m_globalSounds.playGameSound(SoundsGame.SOUNDS_MELODY_MENU, 1);
} else {
if (m_gameClip.m_state == gameClip.STATE_GAME_NONE){
m_globalSounds.playGameSound(SoundsGame.SOUNDS_MELODY_MENU, 1);
};
};
stop();
}
public function releaseButtons_PlayerSelection(_arg1:MouseEvent):void{
m_globalSounds.playGameSound(SoundsGame.SOUNDS_SELECTION, 1);
if (_arg1.currentTarget == instButtonBack_PlayerSelection){
m_globalSounds.stopGameSound(SoundsGame.SOUNDS_MELODY_MENU);
gotoAndStop("mainMenu");
};
if (_arg1.currentTarget == instButtonPlayerClass1){
instButtonPlayerClass1.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
instButtonPlayerClass1.enabled = false;
testToChangeState(0);
};
if (_arg1.currentTarget == instButtonPlayerClass2){
instButtonPlayerClass2.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
instButtonPlayerClass2.enabled = false;
testToChangeState(1);
};
if (_arg1.currentTarget == instButtonPlayerClass3){
instButtonPlayerClass3.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
instButtonPlayerClass3.enabled = false;
testToChangeState(2);
};
if (_arg1.currentTarget == instButtonPlayerClass4){
instButtonPlayerClass4.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
instButtonPlayerClass4.enabled = false;
testToChangeState(3);
};
if (_arg1.currentTarget == instButtonPlayerClass5){
instButtonPlayerClass5.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
instButtonPlayerClass5.enabled = false;
testToChangeState(4);
};
if (_arg1.currentTarget == instButtonPlayerClass6){
instButtonPlayerClass6.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_PlayerSelection);
instButtonPlayerClass6.enabled = false;
testToChangeState(5);
};
}
function frame50(){
instSpeed.gotoAndStop("item_1");
instStrength.gotoAndStop("item_2");
instShield.gotoAndStop("item_3");
instLife.gotoAndStop("item_4");
instButtonBack_Help.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_Help);
stop();
}
public function loadSharedObjectData(){
var bomberSantaSO:SharedObject;
var tmp_playersUnlocked:Number;
var tmp_levelsUnlocked:Number;
try {
bomberSantaSO = SharedObject.getLocal(Define.RECORDSET_BOMBERSANTA);
tmp_playersUnlocked = bomberSantaSO.data.levelData.numberOfUsersUnlocked;
if (isNaN(tmp_playersUnlocked)){
m_playersUnlocked = 2;
} else {
m_playersUnlocked = tmp_playersUnlocked;
};
tmp_levelsUnlocked = bomberSantaSO.data.levelData.numberOfLevelsUnlocked;
if (isNaN(tmp_levelsUnlocked)){
m_levelsUnlocked = 2;
} else {
m_levelsUnlocked = tmp_levelsUnlocked;
};
} catch(err:Error) {
};
bomberSantaSO.close();
if (Define.ENABLE_ALL_LEVELS_UNLOCKED){
m_playersUnlocked = 8;
m_levelsUnlocked = 8;
};
}
function frame62(){
instButtonBack_About.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_About);
stop();
}
public function releaseButtons_Help(_arg1:MouseEvent):void{
if (_arg1.currentTarget == instButtonBack_Help){
m_globalSounds.stopGameSound(SoundsGame.SOUNDS_MELODY_MENU);
gotoAndStop("mainMenu");
};
m_globalSounds.playGameSound(SoundsGame.SOUNDS_SELECTION, 1);
}
function frame73(){
addEventListener(Event.ENTER_FRAME, listenGameFinish);
m_globalSounds.stopGameSound(SoundsGame.SOUNDS_MELODY_MENU);
stop();
}
function frame101(){
stop();
}
public function releaseButtons(_arg1:MouseEvent):void{
var event = _arg1;
m_globalSounds.playGameSound(SoundsGame.SOUNDS_SELECTION, 1);
try {
if (m_gameClip != null){
removeChild(m_gameClip);
m_gameClip = null;
};
} catch(err:Error) {
};
if (event.currentTarget == instButtonHistory){
m_isHistoryMode = true;
gotoAndStop("playerNumber");
loadSharedObjectData();
};
if (event.currentTarget == instButtonDeathmatch){
m_isHistoryMode = false;
gotoAndStop("playerNumber");
loadSharedObjectData();
};
if (event.currentTarget == instButtonHelp){
gotoAndStop("Help");
};
if (event.currentTarget == instButtonAbout){
gotoAndStop("About");
};
}
public function testToChangeState(_arg1:Number):Boolean{
var isTransition:Boolean;
var p_indexSelected = _arg1;
isTransition = false;
if (m_numberOfPlayers == 1){
m_indexPlayerOneSelected = p_indexSelected;
isTransition = true;
} else {
if (currentPlayerSelection == 1){
currentPlayerSelection = 2;
m_indexPlayerOneSelected = p_indexSelected;
instTextPlayer_Title.text = "SELECT PLAYER 2";
} else {
m_indexPlayerTwoSelected = p_indexSelected;
isTransition = true;
};
};
if (isTransition){
if (m_isHistoryMode){
try {
if (m_gameClip != null){
removeChild(m_gameClip);
m_gameClip = null;
};
} catch(err:Error) {
};
m_gameClip = new gameClip(m_globalSounds, 0, m_indexPlayerOneSelected, m_indexPlayerTwoSelected, true, m_playersUnlocked, m_levelsUnlocked);
addChild(m_gameClip);
gotoAndStop("WaitToFinish");
} else {
gotoAndStop("levelSelection");
};
};
return (isTransition);
}
public function initGameByLevel(_arg1:Number):void{
var p_levelSelected = _arg1;
try {
if (m_gameClip != null){
removeChild(m_gameClip);
m_gameClip = null;
};
} catch(err:Error) {
};
m_gameClip = new gameClip(m_globalSounds, p_levelSelected, m_indexPlayerOneSelected, m_indexPlayerTwoSelected, false, m_playersUnlocked, m_levelsUnlocked);
addChild(m_gameClip);
gotoAndStop("WaitToFinish");
}
public function releaseButtons_LevelSelection(_arg1:MouseEvent):void{
if (_arg1.currentTarget == instButtonBack_LevelSelection){
m_globalSounds.stopGameSound(SoundsGame.SOUNDS_MELODY_MENU);
gotoAndStop("mainMenu");
return;
};
m_globalSounds.playGameSound(SoundsGame.SOUNDS_SELECTION, 1);
if (_arg1.currentTarget == instButtonLevel1){
initGameByLevel(0);
};
if (_arg1.currentTarget == instButtonLevel2){
initGameByLevel(1);
};
if (_arg1.currentTarget == instButtonLevel3){
initGameByLevel(2);
};
if (_arg1.currentTarget == instButtonLevel4){
initGameByLevel(3);
};
if (_arg1.currentTarget == instButtonLevel5){
initGameByLevel(4);
};
if (_arg1.currentTarget == instButtonLevel6){
initGameByLevel(5);
};
if (_arg1.currentTarget == instButtonLevel7){
initGameByLevel(6);
};
}
}
}//package BomberSanta_fla
Section 41
//Define (common.Define)
package common {
import flash.geom.*;
public class Define {
public static var ITERATIONS_STRENGTH_CHARACTER_INCREMENT:Number = 4;
public static var TIMER_AREA_HEIGHT:Number = 40;
public static var TIMEOUT_OF_THE_ITEMS:Number = 10;
public static var ITERATIONS_STRENGTH_CHARACTER_MINIM:Number = 20;
public static var SPEED_CHARACTER_MINIM:Number = 5;
public static var SCREEN_WIDTH:Number = 550;
public static var DIRECTION_NONE:Number = -1;
public static var TOTAL_NUMBER_OF_LEVELS_BOMBERSANTA:Number = 7;
public static var DIRECTION_RIGHT:Number = 1;
public static var BOMB_LEVEL_CONFIGURATION:Array = [9, 10, 11, 12, 13, 14, 16];
public static var STRENGTH_CHARACTER_MINIM:Number = 15;
public static var ENABLE_SOUND:Boolean = true;
public static var ENABLE_ALL_LEVELS_UNLOCKED:Boolean = false;
public static var DIRECTION_UP_RIGHT:Number = 5;
public static var LIFE_CHARACTER_MAXIMUM:Number = 10;
public static var DEBUG_STUDENT_IA:Boolean = false;
public static var DIRECTION_UP_LEFT:Number = 4;
public static var GAME_AREA_HEIGHT:Number = 510;
public static var TOTAL_NUMBER_OF_ITEMS:Number = 10;
public static var SCREEN_HEIGHT:Number = 550;
public static var CIRCLE_DETECTION_BOMB_HEIGHT:Number = 30;
public static var STRENGTH_CHARACTER_MAXIMUM:Number = 25;
public static var GAME_PLAYERS_CHARACTERIST:Array = [[6, 3, 15, 7.5, 24, 6], [6.5, 3.3, 16, 8, 28, 5], [7, 3.5, 17, 8.5, 32, 4], [8, 4, 18, 9, 36, 3], [9, 4.5, 19, 9.5, 40, 2], [9.5, 4.8, 20, 10, 44, 1]];
public static var DISABLE_DOMAIN_PROTECTION:Boolean = false;
public static var SPEED_CHARACTER_INCREMENT:Number = 1;
public static var DIRECTION_DOWN:Number = 3;
public static var TOTAL_NUMBER_OF_BOMBS_X:Number = 20;
public static var DIRECTION_UP:Number = 2;
public static var STRENGTH_CHARACTER_INCREMENT:Number = 1;
public static var DIRECTION_DOWN_LEFT:Number = 6;
public static var SPEED_CHARACTER_MAXIMUM:Number = 15;
public static var DEBUG_GENERAL:Boolean = false;
public static var TIMER_AREA_WIDTH:Number = 550;
public static var RECORDSET_BOMBERSANTA:String = "BombersantaAd";
public static var LIFE_CHARACTER_INCREMENT:Number = 1;
public static var LIFE_CHARACTER_MINIM:Number = 1;
public static var GAME_AREA_WIDTH:Number = 550;
public static var GAME_INITIAL_POSITIONS:Array = [[[150, 450], [400, 450], [0, 275, 125, 2, 6.5, 3.8, 10, 5, 25, 3], [1, 100, 150, 1, 6, 3, 10, 5, 20, 2], [2, 175, 275, 1, 5, 2.5, 10, 5, 15, 2], [3, 400, 250, 0, 4, 2, 10, 5, 15, 1]], [[150, 450], [400, 450], [0, 275, 125, 2, 7.5, 3.8, 12, 6, 26, 4], [1, 100, 150, 1, 7, 3.5, 12, 6, 21, 4], [2, 175, 275, 1, 6, 3, 12, 6, 16, 3], [3, 400, 250, 0, 5, 2.5, 12, 6, 16, 2]], [[150, 450], [400, 450], [0, 275, 125, 2, 8, 4, 14, 7, 27, 6], [1, 100, 150, 1, 7.5, 3.8, 14, 7, 22, 5], [2, 175, 275, 1, 7, 3.5, 14, 7, 17, 4], [3, 400, 250, 0, 5, 2.5, 14, 7, 17, 3]], [[150, 450], [400, 450], [0, 275, 125, 2, 8.5, 4.3, 16, 8, 27, 7], [1, 100, 150, 1, 8, 4, 16, 8, 22, 6], [2, 175, 275, 1, 7, 3.5, 16, 8, 17, 5], [3, 400, 250, 0, 6, 3, 16, 8, 17, 4]], [[150, 450], [400, 450], [0, 275, 125, 2, 9, 4.5, 18, 9, 28, 8], [1, 100, 150, 1, 8.5, 4.3, 18, 9, 23, 7], [2, 175, 275, 1, 7.5, 3.8, 18, 9, 18, 6], [3, 400, 250, 0, 6, 3, 18, 9, 18, 5]], [[150, 450], [400, 450], [0, 275, 125, 2, 9.5, 4.8, 18, 9, 29, 9], [1, 100, 150, 1, 9, 4.8, 18, 9, 24, 8], [2, 175, 275, 1, 8, 4, 18, 9, 19, 7], [3, 400, 250, 0, 7, 3.5, 18, 9, 19, 6]], [[150, 450], [400, 450], [0, 275, 125, 2, 10, 5, 20, 10, 30, 12], [1, 100, 150, 1, 9, 4.5, 20, 10, 30, 10], [2, 175, 275, 1, 8, 4, 16, 8, 20, 10], [3, 400, 250, 0, 7, 3.5, 16, 8, 20, 10]]];
public static var DIRECTION_LEFT:Number = 0;
public static var CIRCLE_DETECTION_BOMB_WIDTH:Number = 70;
public static var ITERATIONS_STRENGTH_CHARACTER_MAXIMUM:Number = 60;
public static var TIME_UNTIL_CHARACTERS_PRESENTATIONS:Number = 3000;
public static var DIRECTION_DOWN_RIGHT:Number = 7;
public static function getDirectionPlus(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
if (Math.abs(_local3) < 10){
if (_local4 > 0){
return (DIRECTION_UP);
};
return (DIRECTION_DOWN);
};
if (Math.abs(_local4) < 10){
if (_local3 > 0){
return (DIRECTION_LEFT);
};
return (DIRECTION_RIGHT);
};
if (_local3 > 0){
if (_local4 > 0){
return (DIRECTION_UP_LEFT);
};
return (DIRECTION_DOWN_LEFT);
//unresolved jump
};
if (_local4 > 0){
return (DIRECTION_UP_RIGHT);
};
return (DIRECTION_DOWN_RIGHT);
}
public static function randRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = (Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1);
return (_local3);
}
public static function randRangeFloat(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = ((Math.random() * ((_arg2 - _arg1) + 1)) + _arg1);
return (_local3);
}
public static function isInsideBox(_arg1:Point, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
return ((((((((_arg1.x > _arg2)) && ((_arg1.y > _arg3)))) && ((_arg1.x < _arg4)))) && ((_arg1.y < _arg5))));
}
public static function askDirectionPoint(_arg1:Point, _arg2:Number, _arg3:Point):Number{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local4 = new Array(_arg1.x, 0, _arg1.y);
_local5 = new Array((_arg1.x + Math.cos(_arg2)), 0, (_arg1.y + Math.sin(_arg2)));
_local6 = new Array(_arg1.x, 1, _arg1.y);
_local7 = new Array(0, 0, 0);
_local8 = new Array(0, 0, 0);
_local9 = new Array(0, 0, 0);
_local7[0] = (_local5[0] - _local4[0]);
_local7[1] = (_local5[1] - _local4[1]);
_local7[2] = (_local5[2] - _local4[2]);
_local8[0] = (_local6[0] - _local4[0]);
_local8[1] = (_local6[1] - _local4[1]);
_local8[2] = (_local6[2] - _local4[2]);
_local9[0] = ((_local7[1] * _local8[2]) - (_local7[2] * _local8[1]));
_local9[1] = ((_local7[2] * _local8[0]) - (_local7[0] * _local8[2]));
_local9[2] = ((_local7[0] * _local8[1]) - (_local7[1] * _local8[0]));
_local10 = Math.sqrt((((_local9[0] * _local9[0]) + (_local9[1] * _local9[1])) + (_local9[2] * _local9[2])));
if (_local10 == 0){
_local9[0] = 0;
_local9[1] = 0;
_local9[2] = 0;
} else {
_local9[0] = (_local9[0] / _local10);
_local9[1] = (_local9[1] / _local10);
_local9[2] = (_local9[2] / _local10);
};
_local11 = -((((_local9[0] * _local4[0]) + (_local9[1] * _local4[1])) + (_local9[2] * _local4[2])));
return ((((_arg3.x * _local9[0]) + (_arg3.y * _local9[2])) + _local11));
}
public static function getFactorVelocity(_arg1:Number):Point{
var _local2:Point;
_local2 = new Point(1, 1);
switch (_arg1){
case DIRECTION_UP:
_local2.x = 0;
_local2.y = (_local2.y * -1);
break;
case DIRECTION_DOWN:
_local2.x = 0;
_local2.y = (_local2.y * 1);
break;
case DIRECTION_RIGHT:
_local2.x = (_local2.x * 1);
_local2.y = 0;
break;
case DIRECTION_LEFT:
_local2.x = (_local2.x * -1);
_local2.y = 0;
break;
case DIRECTION_UP_LEFT:
_local2.x = (_local2.x * -1);
_local2.y = (_local2.y * -1);
break;
case DIRECTION_UP_RIGHT:
_local2.x = (_local2.x * 1);
_local2.y = (_local2.y * -1);
break;
case DIRECTION_DOWN_LEFT:
_local2.x = (_local2.x * -1);
_local2.y = (_local2.y * 1);
break;
case DIRECTION_DOWN_RIGHT:
_local2.x = (_local2.x * 1);
_local2.y = (_local2.y * 1);
break;
case DIRECTION_NONE:
_local2.x = (_local2.x * 0);
_local2.y = (_local2.y * 0);
break;
};
return (_local2);
}
public static function getRadians(_arg1:Number):Number{
return (((_arg1 * Math.PI) / 180));
}
public static function getDistancePlanePoint(_arg1:Point, _arg2:Number, _arg3:Point):Number{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local4 = new Array(_arg1.x, 0, _arg1.y);
_local5 = new Array((_arg1.x + Math.cos((_arg2 + (Math.PI / 2)))), 0, (_arg1.y + Math.sin((_arg2 + (Math.PI / 2)))));
_local6 = new Array(_arg1.x, 1, _arg1.y);
_local7 = new Array(0, 0, 0);
_local8 = new Array(0, 0, 0);
_local9 = new Array(0, 0, 0);
_local7[0] = (_local5[0] - _local4[0]);
_local7[1] = (_local5[1] - _local4[1]);
_local7[2] = (_local5[2] - _local4[2]);
_local8[0] = (_local6[0] - _local4[0]);
_local8[1] = (_local6[1] - _local4[1]);
_local8[2] = (_local6[2] - _local4[2]);
_local9[0] = ((_local7[1] * _local8[2]) - (_local7[2] * _local8[1]));
_local9[1] = ((_local7[2] * _local8[0]) - (_local7[0] * _local8[2]));
_local9[2] = ((_local7[0] * _local8[1]) - (_local7[1] * _local8[0]));
_local10 = Math.sqrt((((_local9[0] * _local9[0]) + (_local9[1] * _local9[1])) + (_local9[2] * _local9[2])));
if (_local10 == 0){
_local9[0] = 0;
_local9[1] = 0;
_local9[2] = 0;
} else {
_local9[0] = (_local9[0] / _local10);
_local9[1] = (_local9[1] / _local10);
_local9[2] = (_local9[2] / _local10);
};
_local11 = -((((_local9[0] * _local4[0]) + (_local9[1] * _local4[1])) + (_local9[2] * _local4[2])));
return (Math.abs((((_arg3.x * _local9[0]) + (_arg3.y * _local9[2])) + _local11)));
}
public static function distancePoint(_arg1:Point, _arg2:Point):Number{
return (Point.distance(_arg1, _arg2));
}
public static function getGrados(_arg1:Number):Number{
return (((_arg1 * 180) / Math.PI));
}
public static function incrementAngle(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + _arg2));
}
public static function moveDirection(_arg1:Point, _arg2:Number, _arg3:Number, _arg4:Number):Point{
var _local5:*;
_local5 = new Point(_arg1.x, _arg1.y);
switch (_arg2){
case Define.DIRECTION_LEFT:
_local5.x = (_local5.x - _arg3);
break;
case Define.DIRECTION_RIGHT:
_local5.x = (_local5.x + _arg3);
break;
case Define.DIRECTION_UP:
_local5.y = (_local5.y - _arg4);
break;
case Define.DIRECTION_DOWN:
_local5.y = (_local5.y + _arg4);
break;
case Define.DIRECTION_UP_LEFT:
_local5.x = (_local5.x - _arg3);
_local5.y = (_local5.y - _arg4);
break;
case Define.DIRECTION_UP_RIGHT:
_local5.x = (_local5.x + _arg3);
_local5.y = (_local5.y - _arg4);
break;
case Define.DIRECTION_DOWN_LEFT:
_local5.x = (_local5.x - _arg3);
_local5.y = (_local5.y + _arg4);
break;
case Define.DIRECTION_DOWN_RIGHT:
_local5.x = (_local5.x + _arg3);
_local5.y = (_local5.y + _arg4);
break;
};
return (_local5);
}
public static function movePointYaw(_arg1:Point, _arg2:Number, _arg3:Number):Point{
var _local4:Point;
_local4 = new Point(_arg1.x, _arg1.y);
new Point(_arg1.x, _arg1.y).x = (_local4.x + (_arg3 * Math.cos(_arg2)));
_local4.y = (_local4.y + (_arg3 * Math.sin(_arg2)));
return (_local4);
}
public static function getDirection(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
var _local4:Number;
if ((((_arg1.x == _arg2.x)) && ((_arg1.y == _arg2.y)))){
return (DIRECTION_NONE);
};
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
if (Math.abs(_local3) > Math.abs(_local4)){
if (_local3 > 0){
return (DIRECTION_LEFT);
};
return (DIRECTION_RIGHT);
//unresolved jump
};
if (_local4 > 0){
return (DIRECTION_UP);
};
return (DIRECTION_DOWN);
}
public static function getDirectionOpposite(_arg1:Number):Number{
switch (_arg1){
case DIRECTION_UP:
return (DIRECTION_DOWN);
case DIRECTION_DOWN:
return (DIRECTION_UP);
case DIRECTION_RIGHT:
return (DIRECTION_LEFT);
case DIRECTION_LEFT:
return (DIRECTION_RIGHT);
case DIRECTION_UP_LEFT:
return (DIRECTION_DOWN_RIGHT);
case DIRECTION_UP_RIGHT:
return (DIRECTION_DOWN_LEFT);
case DIRECTION_DOWN_LEFT:
return (DIRECTION_UP_RIGHT);
case DIRECTION_DOWN_RIGHT:
return (DIRECTION_UP_LEFT);
};
return (DIRECTION_NONE);
}
public static function getOrientationToPoint(_arg1:Point, _arg2:Point):Number{
return (Math.atan2((_arg2.y - _arg1.y), (_arg2.x - _arg1.x)));
}
public static function moveYaw(_arg1:Point, _arg2:Number, _arg3:Number):Point{
return (new Point((_arg1.x + (_arg3 * Math.cos(_arg2))), (_arg1.y + (_arg3 * Math.sin(_arg2)))));
}
public static function getDirectionByVelocity(_arg1:Number, _arg2:Number):Number{
var _local3:Point;
_local3 = new Point(1, 1);
if ((((_arg1 == 0)) && ((_arg2 > 0)))){
return (DIRECTION_DOWN);
};
if ((((_arg1 == 0)) && ((_arg2 < 0)))){
return (DIRECTION_UP);
};
if ((((_arg1 > 0)) && ((_arg2 == 0)))){
return (DIRECTION_RIGHT);
};
if ((((_arg1 < 0)) && ((_arg2 == 0)))){
return (DIRECTION_LEFT);
};
if ((((_arg1 > 0)) && ((_arg2 < 0)))){
return (DIRECTION_UP_RIGHT);
};
if ((((_arg1 < 0)) && ((_arg2 < 0)))){
return (DIRECTION_UP_LEFT);
};
if ((((_arg1 > 0)) && ((_arg2 > 0)))){
return (DIRECTION_DOWN_RIGHT);
};
if ((((_arg1 < 0)) && ((_arg2 > 0)))){
return (DIRECTION_DOWN_LEFT);
};
return (DIRECTION_NONE);
}
}
}//package common
Section 42
//gameClip_EndGame (common.gameClip_EndGame)
package common {
import flash.display.*;
import flash.events.*;
public dynamic class gameClip_EndGame extends MovieClip {
public var instButton_EndGame:SimpleButton;
public var instButton_EndGame_Photo:SimpleButton;
public function gameClip_EndGame(){
addFrameScript(0, frame1, 13, frame14);
}
public function releaseButtons_EndGame_Staff(_arg1:MouseEvent):void{
if (_arg1.currentTarget == instButton_EndGame){
alpha = 99;
};
}
function frame14(){
instButton_EndGame.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_EndGame_Staff);
stop();
}
function frame1(){
instButton_EndGame_Photo.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons_EndGame);
stop();
}
public function releaseButtons_EndGame(_arg1:MouseEvent):void{
if (_arg1.currentTarget == instButton_EndGame_Photo){
gotoAndStop("staff");
};
}
}
}//package common
Section 43
//gameClip_FacesPlayers (common.gameClip_FacesPlayers)
package common {
import flash.display.*;
import game.*;
public dynamic class gameClip_FacesPlayers extends MovieClip {
public var instStud_1_1:gameClip_Leader_Class1;
public var instStud_1_3:gameClip_Student2_Class1;
public var instStud_1_2:gameClip_Student1_Class1;
public var instStud_7_1:gameClip_Leader_Class7;
public var instStud_7_4:gameClip_Student3_Class7;
public var instStud_7_2:gameClip_Student1_Class7;
public var instStud_7_3:gameClip_Student2_Class7;
public var instStud_6_1:gameClip_Leader_Class6;
public var instStud_6_3:gameClip_Student2_Class6;
public var instStud_6_4:gameClip_Student3_Class6;
public var instStud_6_2:gameClip_Student1_Class6;
public var instStud_5_4:gameClip_Student3_Class5;
public var instStud_5_1:gameClip_Leader_Class5;
public var instStud_5_2:gameClip_Student1_Class5;
public var instStud_5_3:gameClip_Student2_Class5;
public var instStud_4_1:gameClip_Leader_Class4;
public var instStud_4_2:gameClip_Student1_Class4;
public var instStud_4_3:gameClip_Student2_Class4;
public var instStud_4_4:gameClip_Student3_Class4;
public var instStud_3_2:gameClip_Student1_Class3;
public var instStud_3_4:gameClip_Student3_Class3;
public var instStud_3_1:gameClip_Leader_Class3;
public var instStud_3_3:gameClip_Student2_Class3;
public var instStud_2_1:gameClip_Leader_Class2;
public var instStud_2_2:gameClip_Student1_Class2;
public var instStud_2_3:gameClip_Student2_Class2;
public var instStud_2_4:gameClip_Student3_Class2;
public var instStud_1_4:gameClip_Student3_Class1;
public function gameClip_FacesPlayers(){
addFrameScript(0, frame1, 5, frame6, 10, frame11, 15, frame16, 20, frame21, 25, frame26, 30, frame31, 35, frame36, 40, frame41, 45, frame46, 50, frame51, 55, frame56, 61, frame62, 66, frame67, 71, frame72, 76, frame77, 81, frame82, 86, frame87, 91, frame92, 96, frame97, 101, frame102, 106, frame107, 111, frame112, 116, frame117, 121, frame122, 126, frame127, 131, frame132, 136, frame137);
}
function frame16(){
instStud_1_4.instShield.visible = false;
stop();
}
function frame11(){
instStud_1_3.instShield.visible = false;
stop();
}
function frame6(){
instStud_1_2.instShield.visible = false;
stop();
}
function frame1(){
instStud_1_1.instShield.visible = false;
stop();
}
function frame26(){
instStud_2_2.instShield.visible = false;
stop();
}
function frame21(){
instStud_2_1.instShield.visible = false;
stop();
}
function frame36(){
instStud_2_4.instShield.visible = false;
stop();
}
function frame31(){
instStud_2_3.instShield.visible = false;
stop();
}
function frame46(){
instStud_3_2.instShield.visible = false;
stop();
}
function frame41(){
instStud_3_1.instShield.visible = false;
stop();
}
function frame51(){
instStud_3_3.instShield.visible = false;
stop();
}
function frame56(){
instStud_3_4.instShield.visible = false;
stop();
}
function frame62(){
instStud_4_1.instShield.visible = false;
stop();
}
function frame67(){
instStud_4_2.instShield.visible = false;
stop();
}
function frame72(){
instStud_4_3.instShield.visible = false;
stop();
}
function frame77(){
instStud_4_4.instShield.visible = false;
stop();
}
function frame87(){
instStud_5_2.instShield.visible = false;
stop();
}
function frame82(){
instStud_5_1.instShield.visible = false;
stop();
}
function frame92(){
instStud_5_3.instShield.visible = false;
stop();
}
function frame97(){
instStud_5_4.instShield.visible = false;
stop();
}
function frame102(){
instStud_6_1.instShield.visible = false;
stop();
}
function frame107(){
instStud_6_2.instShield.visible = false;
stop();
}
function frame117(){
instStud_6_4.instShield.visible = false;
stop();
}
function frame112(){
instStud_6_3.instShield.visible = false;
stop();
}
function frame122(){
instStud_7_1.instShield.visible = false;
stop();
}
function frame127(){
instStud_7_2.instShield.visible = false;
stop();
}
function frame132(){
instStud_7_3.instShield.visible = false;
stop();
}
function frame137(){
instStud_7_4.instShield.visible = false;
stop();
}
}
}//package common
Section 44
//gameClip_ShortLevelIntro (common.gameClip_ShortLevelIntro)
package common {
import flash.display.*;
import flash.events.*;
public class gameClip_ShortLevelIntro extends MovieClip {
public var instSkipButtonIntro:SimpleButton;
public function gameClip_ShortLevelIntro(_arg1:Number){
addFrameScript(0, frame1, 10, frame11, 20, frame21, 30, frame31, 40, frame41, 50, frame51, 60, frame61);
this.gotoAndStop(("classroom" + (_arg1 + 1)));
instSkipButtonIntro.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtonsIntroMovie);
}
public function releaseButtonsIntroMovie(_arg1:MouseEvent):void{
if (_arg1.currentTarget == instSkipButtonIntro){
visible = false;
};
}
function frame1(){
stop();
}
function frame21(){
stop();
}
function frame31(){
stop();
}
function frame11(){
stop();
}
function frame41(){
stop();
}
function frame51(){
stop();
}
function frame61(){
stop();
}
}
}//package common
Section 45
//gameInterfaceInGame (common.gameInterfaceInGame)
package common {
import flash.display.*;
public dynamic class gameInterfaceInGame extends MovieClip {
}
}//package common
Section 46
//gameLoader (common.gameLoader)
package common {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class gameLoader extends MovieClip {
public var instLoadingBarProgress:loadingBarProgress;
public var m_dataCollected:String;
public var m_accessCompleted:Boolean;
public var PASS_KEYWORD_WEBSITE:String;// = "variable1=gromenauerl"
public function gameLoader(){
PASS_KEYWORD_WEBSITE = "variable1=gromenauerl";
super();
addEventListener(Event.ENTER_FRAME, logicGameLoader);
}
function errorInform(_arg1:Event):void{
MovieClip(root).gotoAndStop("not_allowed");
}
function completeWebAccess(_arg1:Event):void{
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
m_dataCollected = new String(_local2.data);
m_accessCompleted = true;
}
function logicGameLoader(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (root.loaderInfo.bytesLoaded / 0x0400);
_local3 = (root.loaderInfo.bytesTotal / 0x0400);
_local4 = Math.floor(((_local2 * 100) / _local3));
instLoadingBarProgress.instText.text = (("LOADING " + _local4) + "%");
instLoadingBarProgress.instMaskLoadingBarProgress.width = ((_local4 * 508) / 100);
if (_local2 >= _local3){
removeEventListener(Event.ENTER_FRAME, logicGameLoader);
MovieClip(root).gotoAndStop("mochiads");
};
}
}
}//package common
Section 47
//gameResult (common.gameResult)
package common {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import game.*;
import fontsGame.*;
public class gameResult extends Sprite {
var m_gameClip:gameClip;
public var m_TextFieldFactory:TextFieldFactory;
var m_interfacePretty:gameInterfaceInGame;
var m_instButtonExit:gameButton_Exit;
public var m_resultTextField:TextField;
var m_instButtonRetry:gameButton_Retry;
var m_type:Number;
var m_instButtonContinue:gameButton_Continue;
public static var RESULT_VICTORY:Number = 0;
public static var RESULT_PAUSE:Number = 2;
public static var RESULT_LOSE:Number = 1;
public function gameResult(_arg1:gameClip, _arg2:Number, _arg3:Number, _arg4:String){
var _local5:gameClip_EndText_Win;
var _local6:gameClip_EndText_Lose;
super();
m_gameClip = _arg1;
m_type = _arg2;
m_interfacePretty = new gameInterfaceInGame();
addChild(m_interfacePretty);
m_interfacePretty.y = -10;
m_TextFieldFactory = new TextFieldFactory("Adore64");
switch (m_type){
case RESULT_VICTORY:
setButtonsOfVictory();
_local5 = new gameClip_EndText_Win();
addChild(_local5);
_local5.x = 170;
_local5.y = 7;
break;
case RESULT_LOSE:
setButtonsOfLose();
_local6 = new gameClip_EndText_Lose();
addChild(_local6);
_local6.x = 170;
_local6.y = 5;
break;
case RESULT_PAUSE:
break;
};
}
public function setButtonsOfLose(){
m_instButtonRetry = new gameButton_Retry();
m_instButtonRetry.height = (m_interfacePretty.height - 4);
m_instButtonRetry.x = ((this.width - m_instButtonRetry.width) - 2);
m_instButtonRetry.y = ((this.height - m_instButtonRetry.height) - 2);
m_interfacePretty.addChild(m_instButtonRetry);
m_instButtonExit = new gameButton_Exit();
m_instButtonExit.height = (m_interfacePretty.height - 4);
m_instButtonExit.x = 2;
m_instButtonExit.y = ((this.height - m_instButtonExit.height) - 2);
m_interfacePretty.addChild(m_instButtonExit);
m_instButtonRetry.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
m_instButtonExit.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
}
public function setButtonsOfVictory(){
m_instButtonContinue = new gameButton_Continue();
m_instButtonContinue.height = (m_interfacePretty.height - 4);
m_instButtonContinue.x = ((this.width - m_instButtonContinue.width) - 2);
m_instButtonContinue.y = ((this.height - m_instButtonContinue.height) - 2);
m_interfacePretty.addChild(m_instButtonContinue);
m_instButtonExit = new gameButton_Exit();
m_instButtonExit.height = (m_interfacePretty.height - 4);
m_instButtonExit.x = 2;
m_instButtonExit.y = ((this.height - m_instButtonExit.height) - 2);
m_interfacePretty.addChild(m_instButtonExit);
m_instButtonContinue.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
m_instButtonExit.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
}
public function releaseButtons(_arg1:MouseEvent):void{
if (_arg1.currentTarget == m_instButtonRetry){
m_gameClip.retryLevel();
};
if (_arg1.currentTarget == m_instButtonContinue){
if (m_gameClip.m_isHistoryMode){
m_gameClip.changeState(gameClip.STATE_GAME_UPGRADE_PLAYER);
} else {
m_gameClip.stopGame(false);
};
};
if (_arg1.currentTarget == m_instButtonExit){
m_gameClip.m_soundManager.stopAllGameSounds();
m_gameClip.stopGame(false);
};
}
}
}//package common
Section 48
//gameTimer (common.gameTimer)
package common {
import flash.display.*;
import flash.text.*;
import fontsGame.*;
public class gameTimer extends Sprite {
public var m_currentDate:Date;
public var m_timeTextField:TextField;
public var m_TextFieldFactory:TextFieldFactory;
public var m_time:Number;
public var m_initialTime:Number;
public var m_timeLastCycle:Number;
public var m_playerTwo:gameClip_FacesPlayers;
public var m_listEnemyFaces:Array;
public var m_playerOne:gameClip_FacesPlayers;
public var m_listEnemyLifes:Array;
public var m_timeDif:Number;
public var m_lifePlayerTwo:TextField;
public var m_lifePlayerOne:TextField;
public static var SQUARE_SIZE_FACE:Number = 50;
public static var WIDTH_TEXT_LIFES:Number = 20;
public function gameTimer(_arg1:Number){
var _local2:gameInterfaceInGame;
super();
_local2 = new gameInterfaceInGame();
addChild(_local2);
_local2.y = -10;
m_TextFieldFactory = new TextFieldFactory("impact");
m_listEnemyFaces = new Array();
m_listEnemyLifes = new Array();
m_currentDate = new Date();
m_timeLastCycle = m_currentDate.getTime();
m_time = _arg1;
m_initialTime = m_time;
}
public function pushNewEnemy(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:gameClip_FacesPlayers;
var _local5:TextField;
_local4 = new gameClip_FacesPlayers();
addChild(_local4);
m_listEnemyFaces.push(_local4);
_local4.gotoAndStop(((_arg2 + "_") + _arg1));
_local4.x = ((m_listEnemyFaces.length * ((SQUARE_SIZE_FACE + WIDTH_TEXT_LIFES) + 4)) + 50);
_local4.y = 0;
_local5 = m_TextFieldFactory.getNewTextField(("" + _arg3), 0xFFFFFF, 18);
addChild(_local5);
m_listEnemyLifes.push(_local5);
_local5.x = (_local4.x + (SQUARE_SIZE_FACE + 2));
_local5.y = ((Define.TIMER_AREA_HEIGHT - _local5.textHeight) / 2);
}
public function updateEnemyLifeInfo(_arg1:Number, _arg2:Number){
var _local3:gameClip_FacesPlayers;
var _local4:TextField;
_local3 = gameClip_FacesPlayers(m_listEnemyFaces[_arg1]);
_local4 = TextField(m_listEnemyLifes[_arg1]);
if (_arg2 <= 0){
_local3.visible = false;
_local4.visible = false;
} else {
_local4.text = ("" + _arg2);
};
}
public function updateTime(){
var _local1:Number;
if (m_timeLastCycle == -1){
m_currentDate = new Date();
m_timeLastCycle = m_currentDate.getTime();
m_timeDif = 0;
} else {
m_currentDate = new Date();
_local1 = m_currentDate.getTime();
m_timeDif = Math.abs((_local1 - m_timeLastCycle));
m_time = (m_time - m_timeDif);
m_timeLastCycle = _local1;
};
}
public function setUpPlayers(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
m_playerOne = new gameClip_FacesPlayers();
m_playerOne.gotoAndStop((((_arg2 + 1) + "_") + _arg1));
addChild(m_playerOne);
m_playerOne.x = 2;
m_playerOne.y = 0;
m_lifePlayerOne = m_TextFieldFactory.getNewTextField("XX", 0xFFFFFF, 18);
addChild(m_lifePlayerOne);
m_lifePlayerOne.x = (m_lifePlayerOne.x + (SQUARE_SIZE_FACE + 4));
m_lifePlayerOne.y = ((Define.TIMER_AREA_HEIGHT - m_lifePlayerOne.textHeight) / 2);
if (_arg4 != -1){
m_playerTwo = new gameClip_FacesPlayers();
m_playerTwo.gotoAndStop((((_arg4 + 1) + "_") + _arg3));
addChild(m_playerTwo);
m_playerTwo.x = (Define.TIMER_AREA_WIDTH - ((SQUARE_SIZE_FACE + WIDTH_TEXT_LIFES) + 2));
m_playerTwo.y = 0;
m_lifePlayerTwo = m_TextFieldFactory.getNewTextField("XX", 0xFFFFFF, 18);
addChild(m_lifePlayerTwo);
m_lifePlayerTwo.x = (m_playerTwo.x + (SQUARE_SIZE_FACE + 2));
m_lifePlayerTwo.y = ((Define.TIMER_AREA_HEIGHT - m_lifePlayerTwo.textHeight) / 2);
};
}
public function updatePlayers(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
m_lifePlayerOne.text = ("" + _arg2);
if (_arg3 != -1){
m_lifePlayerTwo.text = ("" + _arg4);
};
}
}
}//package common
Section 49
//pauseScreen (common.pauseScreen)
package common {
import flash.display.*;
public class pauseScreen extends MovieClip {
public var m_gameClip:gameClip;
public function pauseScreen(_arg1:gameClip){
m_gameClip = _arg1;
}
}
}//package common
Section 50
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import fl.events.*;
import flash.utils.*;
public class BaseButton extends UIComponent {
protected var _selected:Boolean;// = false
private var unlockedMouseState:String;
protected var pressTimer:Timer;
protected var mouseState:String;
protected var background:DisplayObject;
private var _mouseStateLocked:Boolean;// = false
protected var _autoRepeat:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
_selected = false;
_autoRepeat = false;
_mouseStateLocked = false;
super();
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function get selected():Boolean{
return (_selected);
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
protected function drawBackground():void{
var _local1:String;
var _local2:DisplayObject;
_local1 = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
_local2 = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 51
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var emphasizedBorder:DisplayObject;
protected var _emphasized:Boolean;// = false
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function Button(){
_emphasized = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local1:Object;
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
_local1 = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 52
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 53
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.text.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _labelPlacement:String;// = "right"
protected var _toggle:Boolean;// = false
protected var icon:DisplayObject;
protected var oldMouseState:String;
protected var mode:String;// = "center"
public var textField:TextField;
protected var _label:String;// = "Label"
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function LabelButton(){
_labelPlacement = ButtonLabelPlacement.RIGHT;
_toggle = false;
_label = "Label";
mode = "center";
super();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
public function get labelPlacement():String{
return (_labelPlacement);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
public function get label():String{
return (_label);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
public function get toggle():Boolean{
return (_toggle);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:String;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
_local3 = (textField.textWidth + 4);
_local4 = (textField.textHeight + 4);
_local5 = ((icon)==null) ? 0 : (icon.width + _local1);
_local6 = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
protected function drawIcon():void{
var _local1:DisplayObject;
var _local2:String;
var _local3:Object;
_local1 = icon;
_local2 = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
_local3 = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 54
//ScrollBar (fl.controls.ScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import fl.events.*;
public class ScrollBar extends UIComponent {
private var _direction:String;// = "vertical"
protected var inDrag:Boolean;// = false
protected var upArrow:BaseButton;
private var _pageScrollSize:Number;// = 0
protected var downArrow:BaseButton;
private var _pageSize:Number;// = 10
private var thumbScrollOffset:Number;
private var _maxScrollPosition:Number;// = 0
private var _scrollPosition:Number;// = 0
protected var track:BaseButton;
private var _minScrollPosition:Number;// = 0
private var _lineScrollSize:Number;// = 1
protected var thumb:LabelButton;
protected static const THUMB_STYLES:Object = {disabledSkin:"thumbDisabledSkin", downSkin:"thumbDownSkin", overSkin:"thumbOverSkin", upSkin:"thumbUpSkin", icon:"thumbIcon", textPadding:0};
public static const WIDTH:Number = 15;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TRACK_STYLES:Object = {disabledSkin:"trackDisabledSkin", downSkin:"trackDownSkin", overSkin:"trackOverSkin", upSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"ScrollArrowDown_disabledSkin", downArrowDownSkin:"ScrollArrowDown_downSkin", downArrowOverSkin:"ScrollArrowDown_overSkin", downArrowUpSkin:"ScrollArrowDown_upSkin", thumbDisabledSkin:"ScrollThumb_upSkin", thumbDownSkin:"ScrollThumb_downSkin", thumbOverSkin:"ScrollThumb_overSkin", thumbUpSkin:"ScrollThumb_upSkin", trackDisabledSkin:"ScrollTrack_skin", trackDownSkin:"ScrollTrack_skin", trackOverSkin:"ScrollTrack_skin", trackUpSkin:"ScrollTrack_skin", upArrowDisabledSkin:"ScrollArrowUp_disabledSkin", upArrowDownSkin:"ScrollArrowUp_downSkin", upArrowOverSkin:"ScrollArrowUp_overSkin", upArrowUpSkin:"ScrollArrowUp_upSkin", thumbIcon:"ScrollBar_thumbIcon", repeatDelay:500, repeatInterval:35};
public function ScrollBar(){
_pageSize = 10;
_pageScrollSize = 0;
_lineScrollSize = 1;
_minScrollPosition = 0;
_maxScrollPosition = 0;
_scrollPosition = 0;
_direction = ScrollBarDirection.VERTICAL;
inDrag = false;
super();
setStyles();
focusEnabled = false;
}
public function get minScrollPosition():Number{
return (_minScrollPosition);
}
public function set minScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _arg1, _maxScrollPosition);
}
public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
_local3 = scrollPosition;
_scrollPosition = Math.max(_minScrollPosition, Math.min(_maxScrollPosition, _arg1));
if (_local3 == _scrollPosition){
return;
};
if (_arg2){
dispatchEvent(new ScrollEvent(_direction, (scrollPosition - _local3), scrollPosition));
};
updateThumb();
}
public function set scrollPosition(_arg1:Number):void{
setScrollPosition(_arg1, true);
}
public function get pageScrollSize():Number{
return (((_pageScrollSize)==0) ? _pageSize : _pageScrollSize);
}
public function set pageSize(_arg1:Number):void{
if (_arg1 > 0){
_pageSize = _arg1;
};
}
public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
this.pageSize = _arg1;
_minScrollPosition = _arg2;
_maxScrollPosition = _arg3;
if (_arg4 >= 0){
_pageScrollSize = _arg4;
};
enabled = (_maxScrollPosition > _minScrollPosition);
setScrollPosition(_scrollPosition, false);
updateThumb();
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
downArrow.enabled = (track.enabled = (thumb.enabled = (upArrow.enabled = ((enabled) && ((_maxScrollPosition > _minScrollPosition))))));
updateThumb();
}
protected function updateThumb():void{
var _local1:Number;
_local1 = ((_maxScrollPosition - _minScrollPosition) + _pageSize);
if ((((((track.height <= 12)) || ((_maxScrollPosition <= _minScrollPosition)))) || ((((_local1 == 0)) || (isNaN(_local1)))))){
thumb.height = 12;
thumb.visible = false;
} else {
thumb.height = Math.max(13, ((_pageSize / _local1) * track.height));
thumb.y = (track.y + ((track.height - thumb.height) * ((_scrollPosition - _minScrollPosition) / (_maxScrollPosition - _minScrollPosition))));
thumb.visible = enabled;
};
}
protected function thumbPressHandler(_arg1:MouseEvent):void{
inDrag = true;
thumbScrollOffset = (mouseY - thumb.y);
thumb.mouseStateLocked = true;
mouseChildren = false;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler, false, 0, true);
}
protected function thumbReleaseHandler(_arg1:MouseEvent):void{
inDrag = false;
mouseChildren = true;
thumb.mouseStateLocked = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleThumbDrag);
stage.removeEventListener(MouseEvent.MOUSE_UP, thumbReleaseHandler);
}
public function set pageScrollSize(_arg1:Number):void{
if (_arg1 >= 0){
_pageScrollSize = _arg1;
};
}
protected function handleThumbDrag(_arg1:MouseEvent):void{
var _local2:Number;
_local2 = Math.max(0, Math.min((track.height - thumb.height), ((mouseY - track.y) - thumbScrollOffset)));
setScrollPosition((((_local2 / (track.height - thumb.height)) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition));
}
public function set direction(_arg1:String):void{
var _local2:Boolean;
if (_direction == _arg1){
return;
};
_direction = _arg1;
if (isLivePreview){
return;
};
setScaleY(1);
_local2 = (_direction == ScrollBarDirection.HORIZONTAL);
if (((_local2) && (componentInspectorSetting))){
if (rotation == 90){
return;
};
setScaleX(-1);
rotation = -90;
};
if (!componentInspectorSetting){
if (((_local2) && ((rotation == 0)))){
rotation = -90;
setScaleX(-1);
} else {
if (((!(_local2)) && ((rotation == -90)))){
rotation = 0;
setScaleX(1);
};
};
};
invalidate(InvalidationType.SIZE);
}
public function set lineScrollSize(_arg1:Number):void{
if (_arg1 > 0){
_lineScrollSize = _arg1;
};
}
override public function get height():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.width : super.height);
}
protected function scrollPressHandler(_arg1:ComponentEvent):void{
var _local2:Number;
var _local3:Number;
_arg1.stopImmediatePropagation();
if (_arg1.currentTarget == upArrow){
setScrollPosition((_scrollPosition - _lineScrollSize));
} else {
if (_arg1.currentTarget == downArrow){
setScrollPosition((_scrollPosition + _lineScrollSize));
} else {
_local2 = (((track.mouseY / track.height) * (_maxScrollPosition - _minScrollPosition)) + _minScrollPosition);
_local3 = ((pageScrollSize)==0) ? pageSize : pageScrollSize;
if (_scrollPosition < _local2){
setScrollPosition(Math.min(_local2, (_scrollPosition + _local3)));
} else {
if (_scrollPosition > _local2){
setScrollPosition(Math.max(_local2, (_scrollPosition - _local3)));
};
};
};
};
}
public function get pageSize():Number{
return (_pageSize);
}
public function set maxScrollPosition(_arg1:Number):void{
setScrollProperties(_pageSize, _minScrollPosition, _arg1);
}
public function get scrollPosition():Number{
return (_scrollPosition);
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
var _local1:Number;
if (isInvalid(InvalidationType.SIZE)){
_local1 = super.height;
downArrow.move(0, Math.max(upArrow.height, (_local1 - downArrow.height)));
track.setSize(WIDTH, Math.max(0, (_local1 - (downArrow.height + upArrow.height))));
updateThumb();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
};
downArrow.drawNow();
upArrow.drawNow();
track.drawNow();
thumb.drawNow();
validate();
}
override protected function configUI():void{
super.configUI();
track = new BaseButton();
track.move(0, 14);
track.useHandCursor = false;
track.autoRepeat = true;
track.focusEnabled = false;
addChild(track);
thumb = new LabelButton();
thumb.label = "";
thumb.setSize(WIDTH, 15);
thumb.move(0, 15);
thumb.focusEnabled = false;
addChild(thumb);
downArrow = new BaseButton();
downArrow.setSize(WIDTH, 14);
downArrow.autoRepeat = true;
downArrow.focusEnabled = false;
addChild(downArrow);
upArrow = new BaseButton();
upArrow.setSize(WIDTH, 14);
upArrow.move(0, 0);
upArrow.autoRepeat = true;
upArrow.focusEnabled = false;
addChild(upArrow);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
track.addEventListener(ComponentEvent.BUTTON_DOWN, scrollPressHandler, false, 0, true);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbPressHandler, false, 0, true);
enabled = false;
}
public function get direction():String{
return (_direction);
}
public function get lineScrollSize():Number{
return (_lineScrollSize);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
if (_direction == ScrollBarDirection.HORIZONTAL){
super.setSize(_arg2, _arg1);
} else {
super.setSize(_arg1, _arg2);
};
}
public function get maxScrollPosition():Number{
return (_maxScrollPosition);
}
override public function get width():Number{
return (((_direction)==ScrollBarDirection.HORIZONTAL) ? super.height : super.width);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(thumb, THUMB_STYLES);
copyStylesToChild(track, TRACK_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 55
//ScrollBarDirection (fl.controls.ScrollBarDirection)
package fl.controls {
public class ScrollBarDirection {
public static const HORIZONTAL:String = "horizontal";
public static const VERTICAL:String = "vertical";
}
}//package fl.controls
Section 56
//ScrollPolicy (fl.controls.ScrollPolicy)
package fl.controls {
public class ScrollPolicy {
public static const OFF:String = "off";
public static const ON:String = "on";
public static const AUTO:String = "auto";
}
}//package fl.controls
Section 57
//TextArea (fl.controls.TextArea)
package fl.controls {
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.text.*;
import fl.managers.*;
import fl.events.*;
import flash.system.*;
import flash.ui.*;
public class TextArea extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _verticalScrollBar:UIScrollBar;
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _horizontalScrollBar:UIScrollBar;
protected var _horizontalScrollPolicy:String;// = "auto"
protected var _editable:Boolean;// = true
protected var textHasChanged:Boolean;// = false
public var textField:TextField;
protected var _wordWrap:Boolean;// = true
protected var _verticalScrollPolicy:String;// = "auto"
protected static const SCROLL_BAR_STYLES:Object = {downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", thumbDisabledSkin:"thumbDisabledSkin", thumbDownSkin:"thumbDownSkin", thumbOverSkin:"thumbOverSkin", thumbUpSkin:"thumbUpSkin", thumbIcon:"thumbIcon", trackDisabledSkin:"trackDisabledSkin", trackDownSkin:"trackDownSkin", trackOverSkin:"trackOverSkin", trackUpSkin:"trackUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {upSkin:"TextArea_upSkin", disabledSkin:"TextArea_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:3, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextArea(){
_editable = true;
_wordWrap = true;
_horizontalScrollPolicy = ScrollPolicy.AUTO;
_verticalScrollPolicy = ScrollPolicy.AUTO;
_html = false;
textHasChanged = false;
super();
}
override public function drawFocus(_arg1:Boolean):void{
if (focusTarget != null){
focusTarget.drawFocus(_arg1);
return;
};
super.drawFocus(_arg1);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
protected function handleWheel(_arg1:MouseEvent):void{
if (((!(enabled)) || (!(_verticalScrollBar.visible)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * _verticalScrollBar.lineScrollSize));
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, (_arg1.delta * _verticalScrollBar.lineScrollSize), _verticalScrollBar.scrollPosition));
}
public function get verticalScrollPosition():Number{
return (textField.scrollV);
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_arg1))));
}
public function set verticalScrollPosition(_arg1:Number):void{
drawNow();
textField.scrollV = _arg1;
}
protected function handleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
dispatchEvent(new ComponentEvent(ComponentEvent.ENTER, true));
};
}
public function set text(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
return;
};
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
textHasChanged = true;
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (_editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
textField.wordWrap = _wordWrap;
textField.multiline = true;
}
public function get selectionEndIndex():int{
return (textField.selectionEndIndex);
}
public function get editable():Boolean{
return (_editable);
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
setIMEMode(true);
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (_local2){
if (editable){
_local2.showFocusIndicator = true;
};
_local2.defaultButtonEnabled = false;
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get wordWrap():Boolean{
return (_wordWrap);
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function get horizontalScrollBar():UIScrollBar{
return (_horizontalScrollBar);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseChildren = enabled;
invalidate(InvalidationType.STATE);
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():Number{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
invalidate(InvalidationType.DATA);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function get maxVerticalScrollPosition():int{
return (textField.maxScrollV);
}
public function set horizontalScrollPosition(_arg1:Number):void{
drawNow();
textField.scrollH = _arg1;
}
public function get textHeight():Number{
drawNow();
return (textField.textHeight);
}
public function get textWidth():Number{
drawNow();
return (textField.textWidth);
}
public function get restrict():String{
return (textField.restrict);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
invalidate(InvalidationType.STATE);
}
protected function updateScrollBars(){
_horizontalScrollBar.update();
_verticalScrollBar.update();
_verticalScrollBar.enabled = enabled;
_horizontalScrollBar.enabled = enabled;
_horizontalScrollBar.drawNow();
_verticalScrollBar.drawNow();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():Number{
return (textField.text.length);
}
public function set wordWrap(_arg1:Boolean):void{
_wordWrap = _arg1;
invalidate(InvalidationType.STATE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (IME.conversionMode);
}
protected function handleScroll(_arg1:ScrollEvent):void{
dispatchEvent(_arg1);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
_local2 = focusManager;
if (_local2){
_local2.defaultButtonEnabled = true;
};
setSelection(0, 0);
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
protected function delayedLayoutUpdate(_arg1:Event):void{
if (textHasChanged){
textHasChanged = false;
drawLayout();
return;
};
removeEventListener(Event.ENTER_FRAME, delayedLayoutUpdate);
}
public function set htmlText(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
return;
};
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
textHasChanged = true;
}
public function get text():String{
return (textField.text);
}
public function get verticalScrollBar():UIScrollBar{
return (_verticalScrollBar);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function set horizontalScrollPolicy(_arg1:String):void{
_horizontalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STATE)){
updateTextFieldType();
};
if (isInvalid(InvalidationType.STYLES)){
setStyles();
setEmbedFont();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.DATA)){
drawLayout();
};
super.draw();
}
protected function handleTextInput(_arg1:TextEvent):void{
_arg1.stopPropagation();
dispatchEvent(new TextEvent(TextEvent.TEXT_INPUT, true, false, _arg1.text));
}
override protected function configUI():void{
super.configUI();
tabChildren = true;
textField = new TextField();
addChild(textField);
updateTextFieldType();
_verticalScrollBar = new UIScrollBar();
_verticalScrollBar.name = "V";
_verticalScrollBar.visible = false;
_verticalScrollBar.focusEnabled = false;
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
addChild(_verticalScrollBar);
_horizontalScrollBar = new UIScrollBar();
_horizontalScrollBar.name = "H";
_horizontalScrollBar.visible = false;
_horizontalScrollBar.focusEnabled = false;
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
addChild(_horizontalScrollBar);
textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput, false, 0, true);
textField.addEventListener(Event.CHANGE, handleChange, false, 0, true);
textField.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown, false, 0, true);
_horizontalScrollBar.scrollTarget = textField;
_verticalScrollBar.scrollTarget = textField;
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function setTextSize(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number;
var _local5:Number;
_local4 = (_arg1 - (_arg3 * 2));
_local5 = (_arg2 - (_arg3 * 2));
if (_local4 != textField.width){
textField.width = _local4;
};
if (_local5 != textField.height){
textField.height = _local5;
};
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
invalidate(InvalidationType.DATA);
}
protected function needVScroll():Boolean{
if (_verticalScrollPolicy == ScrollPolicy.OFF){
return (false);
};
if (_verticalScrollPolicy == ScrollPolicy.ON){
return (true);
};
return ((textField.maxScrollV > 1));
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
public function get htmlText():String{
return (textField.htmlText);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background != null){
addChildAt(background, 0);
};
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
var _local5:Boolean;
_local1 = Number(getStyleValue("textPadding"));
textField.x = (textField.y = _local1);
background.width = width;
background.height = height;
_local2 = height;
_local3 = needVScroll();
_local4 = (width - (_local3) ? _verticalScrollBar.width : 0);
_local5 = needHScroll();
if (_local5){
_local2 = (_local2 - _horizontalScrollBar.height);
};
setTextSize(_local4, _local2, _local1);
if (((((_local5) && (!(_local3)))) && (needVScroll()))){
_local3 = true;
_local4 = (_local4 - _verticalScrollBar.width);
setTextSize(_local4, _local2, _local1);
};
if (_local3){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = (width - _verticalScrollBar.width);
_verticalScrollBar.height = _local2;
_verticalScrollBar.visible = true;
_verticalScrollBar.enabled = enabled;
} else {
_verticalScrollBar.visible = false;
};
if (_local5){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.y = (height - _horizontalScrollBar.height);
_horizontalScrollBar.width = _local4;
_horizontalScrollBar.visible = true;
_horizontalScrollBar.enabled = enabled;
} else {
_horizontalScrollBar.visible = false;
};
updateScrollBars();
addEventListener(Event.ENTER_FRAME, delayedLayoutUpdate, false, 0, true);
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function needHScroll():Boolean{
if (_horizontalScrollPolicy == ScrollPolicy.OFF){
return (false);
};
if (_horizontalScrollPolicy == ScrollPolicy.ON){
return (true);
};
return ((textField.maxScrollH > 0));
}
protected function drawTextFormat():void{
var _local1:Object;
var _local2:TextFormat;
var _local3:TextFormat;
_local1 = UIComponent.getStyleDefinition();
_local2 = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
_local3 = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
if (_html){
textField.htmlText = _savedHTML;
};
}
public function set verticalScrollPolicy(_arg1:String):void{
_verticalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
invalidate(InvalidationType.DATA);
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 58
//UIScrollBar (fl.controls.UIScrollBar)
package fl.controls {
import fl.core.*;
import flash.events.*;
import flash.text.*;
import fl.events.*;
public class UIScrollBar extends ScrollBar {
protected var inScroll:Boolean;// = false
protected var _scrollTarget:TextField;
protected var inEdit:Boolean;// = false
private static var defaultStyles:Object = {};
public function UIScrollBar(){
inEdit = false;
inScroll = false;
super();
}
protected function handleTargetScroll(_arg1:Event):void{
if (inDrag){
return;
};
if (!enabled){
return;
};
inEdit = true;
updateScrollTargetProperties();
scrollPosition = ((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV;
inEdit = false;
}
override public function set minScrollPosition(_arg1:Number):void{
super.minScrollPosition = ((_arg1)<0) ? 0 : _arg1;
}
override public function setScrollPosition(_arg1:Number, _arg2:Boolean=true):void{
super.setScrollPosition(_arg1, _arg2);
if (!_scrollTarget){
inScroll = false;
return;
};
updateTargetScroll();
}
override public function setScrollProperties(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
var _local5:Number;
var _local6:Number;
_local5 = _arg3;
_local6 = ((_arg2)<0) ? 0 : _arg2;
if (_scrollTarget != null){
if (direction == ScrollBarDirection.HORIZONTAL){
_local5 = ((_arg3)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local5;
} else {
_local5 = ((_arg3)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local5;
};
};
super.setScrollProperties(_arg1, _local6, _local5, _arg4);
}
public function get scrollTargetName():String{
return (_scrollTarget.name);
}
public function get scrollTarget():TextField{
return (_scrollTarget);
}
protected function updateScrollTargetProperties():void{
var _local1:Boolean;
var _local2:Number;
if (_scrollTarget == null){
setScrollProperties(pageSize, minScrollPosition, maxScrollPosition, pageScrollSize);
scrollPosition = 0;
} else {
_local1 = (direction == ScrollBarDirection.HORIZONTAL);
_local2 = (_local1) ? _scrollTarget.width : 10;
setScrollProperties(_local2, (_local1) ? 0 : 1, (_local1) ? _scrollTarget.maxScrollH : _scrollTarget.maxScrollV, pageScrollSize);
scrollPosition = (_local1) ? _scrollTarget.scrollH : _scrollTarget.scrollV;
};
}
public function update():void{
inEdit = true;
updateScrollTargetProperties();
inEdit = false;
}
public function set scrollTargetName(_arg1:String):void{
var target = _arg1;
try {
scrollTarget = (parent.getChildByName(target) as TextField);
} catch(error:Error) {
throw (new Error("ScrollTarget not found, or is not a TextField"));
};
}
override public function set direction(_arg1:String):void{
if (isLivePreview){
return;
};
super.direction = _arg1;
updateScrollTargetProperties();
}
protected function handleTargetChange(_arg1:Event):void{
inEdit = true;
setScrollPosition(((direction)==ScrollBarDirection.HORIZONTAL) ? _scrollTarget.scrollH : _scrollTarget.scrollV, true);
updateScrollTargetProperties();
inEdit = false;
}
override public function set maxScrollPosition(_arg1:Number):void{
var _local2:Number;
_local2 = _arg1;
if (_scrollTarget != null){
if (direction == ScrollBarDirection.HORIZONTAL){
_local2 = ((_local2)>_scrollTarget.maxScrollH) ? _scrollTarget.maxScrollH : _local2;
} else {
_local2 = ((_local2)>_scrollTarget.maxScrollV) ? _scrollTarget.maxScrollV : _local2;
};
};
super.maxScrollPosition = _local2;
}
protected function updateTargetScroll(_arg1:ScrollEvent=null):void{
if (inEdit){
return;
};
if (direction == ScrollBarDirection.HORIZONTAL){
_scrollTarget.scrollH = scrollPosition;
} else {
_scrollTarget.scrollV = scrollPosition;
};
}
override protected function draw():void{
if (isInvalid(InvalidationType.DATA)){
updateScrollTargetProperties();
};
super.draw();
}
public function set scrollTarget(_arg1:TextField):void{
if (_scrollTarget != null){
_scrollTarget.removeEventListener(Event.CHANGE, handleTargetChange, false);
_scrollTarget.removeEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false);
_scrollTarget.removeEventListener(Event.SCROLL, handleTargetScroll, false);
removeEventListener(ScrollEvent.SCROLL, updateTargetScroll, false);
};
_scrollTarget = _arg1;
if (_scrollTarget != null){
_scrollTarget.addEventListener(Event.CHANGE, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(TextEvent.TEXT_INPUT, handleTargetChange, false, 0, true);
_scrollTarget.addEventListener(Event.SCROLL, handleTargetScroll, false, 0, true);
addEventListener(ScrollEvent.SCROLL, updateTargetScroll, false, 0, true);
};
invalidate(InvalidationType.DATA);
}
override public function get direction():String{
return (super.direction);
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 59
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 60
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 61
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import fl.managers.*;
import fl.events.*;
import flash.utils.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _enabled:Boolean;// = true
private var _mouseFocusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var _oldIMEMode:String;// = null
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var uiFocusRect:DisplayObject;
protected var _width:Number;
public var version:String;// = "3.0.0.15"
protected var isFocused:Boolean;// = false
protected var callLaterMethods:Dictionary;
private var _focusEnabled:Boolean;// = true
private var tempText:TextField;
protected var invalidateFlag:Boolean;// = false
protected var _inspector:Boolean;// = false
protected var sharedStyles:Object;
protected var invalidHash:Object;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var instanceStyles:Object;
protected var _x:Number;
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
version = "3.0.0.15";
isLivePreview = false;
invalidateFlag = false;
_enabled = true;
isFocused = false;
_focusEnabled = true;
_mouseFocusEnabled = true;
_imeMode = null;
_oldIMEMode = null;
errorCaught = false;
_inspector = false;
super();
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
private function callLaterDispatcher(_arg1:Event):void{
var _local2:Dictionary;
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
_local2 = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
override public function get scaleX():Number{
return ((width / startWidth));
}
override public function get scaleY():Number{
return ((height / startHeight));
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var classDef:Object;
var skin = _arg1;
classDef = null;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
override public function set visible(_arg1:Boolean):void{
var _local2:String;
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
_local2 = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
protected function validate():void{
invalidHash = {};
}
override public function get height():Number{
return (_height);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
protected function configUI():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
isLivePreview = checkLivePreview();
_local1 = rotation;
rotation = 0;
_local2 = super.width;
_local3 = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject;
_local1 = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:Object;
var _local6:String;
_local2 = {};
_local3 = _args.length;
_local4 = 0;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 62
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 63
//ScrollEvent (fl.events.ScrollEvent)
package fl.events {
import flash.events.*;
public class ScrollEvent extends Event {
private var _position:Number;
private var _direction:String;
private var _delta:Number;
public static const SCROLL:String = "scroll";
public function ScrollEvent(_arg1:String, _arg2:Number, _arg3:Number){
super(ScrollEvent.SCROLL, false, false);
_direction = _arg1;
_delta = _arg2;
_position = _arg3;
}
override public function clone():Event{
return (new ScrollEvent(_direction, _delta, _position));
}
public function get position():Number{
return (_position);
}
override public function toString():String{
return (formatToString("ScrollEvent", "type", "bubbles", "cancelable", "direction", "delta", "position"));
}
public function get delta():Number{
return (_delta);
}
public function get direction():String{
return (_direction);
}
}
}//package fl.events
Section 64
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import fl.core.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
activated = false;
calculateCandidates = true;
_showFocusIndicator = true;
_defaultButtonEnabled = true;
super();
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local5:int;
var _local6:int;
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
_local5 = focusableCandidates.length;
_local6 = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
_local2 = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject;
_local2 = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject;
_local2 = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
var _local2:DisplayObjectContainer;
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
_local2 = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject;
_local1 = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
var _local3:TextField;
var _local4:SimpleButton;
_local2 = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button;
_local2 = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
if (!hasFocusableObjects()){
return;
};
_local2 = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int;
var _local3:int;
_local2 = focusableCandidates.length;
_local3 = 0;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local3:DisplayObject;
var _local4:InteractiveObject;
_local3 = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:String;
var _local7:String;
var _local8:String;
var _local9:DisplayObject;
var _local10:DisplayObject;
_local3 = "";
_local4 = "";
_local8 = "0000";
_local9 = DisplayObject(_arg1);
_local10 = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject;
_local2 = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local2:DisplayObject;
var _local3:String;
var _local4:int;
var _local5:Boolean;
var _local6:int;
var _local7:int;
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
_local2 = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
_local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
_local4 = getIndexOfFocusedObject(_local2);
_local5 = false;
_local6 = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
_local7 = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
var _local2:InteractiveObject;
if (_arg1.isDefaultPrevented()){
return;
};
_local2 = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer;
_local2 = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject;
var _local3:Button;
_local2 = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
var _local2:InteractiveObject;
var _local3:Boolean;
calculateCandidates = true;
_local2 = InteractiveObject(_arg1.target);
_local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
}
}//package fl.managers
Section 65
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:InteractiveObject):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 66
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 67
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
function get groupName():String;
function get selected():Boolean;
}
}//package fl.managers
Section 68
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.text.*;
import flash.utils.*;
public class StyleManager {
private var globalStyles:Object;
private var classToDefaultStylesDict:Dictionary;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToInstancesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class;
var _local5:Object;
_local4 = getClassDef(_arg1);
_local5 = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local2:StyleManager;
var _local3:Class;
var _local4:Object;
var _local5:String;
_local2 = getInstance();
_local3 = getClassDef(_arg1);
_local4 = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class;
var _local4:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:UIComponent;
_local3 = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var inst:StyleManager;
var classDef:Class;
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
inst = getInstance();
classDef = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
inst.classToStylesDict[classDef] = {};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class;
var _local4:StyleManager;
var _local5:Object;
_local3 = getClassDef(_arg1);
_local4 = getInstance();
_local5 = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object;
_local3 = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 69
//TextFieldFactory (fontsGame.TextFieldFactory)
package fontsGame {
import flash.text.*;
public class TextFieldFactory {
private static var embeddedFont:Font = null;
public function TextFieldFactory(_arg1:String){
var _local2:Array;
var _local3:*;
super();
_local2 = Font.enumerateFonts(false);
_local3 = 0;
while (_local3 < _local2.length) {
if (Font(_local2[_local3]).fontName == _arg1){
embeddedFont = Font(_local2[_local3]);
break;
};
_local3++;
};
}
public function getNewTextField(_arg1:String, _arg2:uint, _arg3:uint, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:Number=-1):TextField{
if (((!((embeddedFont == null))) && (embeddedFont.hasGlyphs(_arg1)))){
return (getNewTextFieldEmbeddedFont(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6));
};
return (getNewTextFieldDeviceFont(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6));
}
public function getNewTextFieldDeviceFont(_arg1:String, _arg2:uint, _arg3:uint, _arg4:Boolean, _arg5:Boolean, _arg6:Number):TextField{
var _local7:TextField;
var _local8:TextFormat;
_local7 = new TextField();
_local8 = new TextFormat();
_local8.font = "_serif";
_local8.color = _arg2;
_local8.size = _arg3;
_local7.defaultTextFormat = _local8;
_local7.autoSize = TextFieldAutoSize.LEFT;
_local7.type = TextFieldType.DYNAMIC;
_local7.multiline = _arg4;
_local7.selectable = false;
_local7.textColor = _arg2;
_local7.embedFonts = false;
_local7.border = false;
_local7.wordWrap = _arg5;
if (_arg6 != -1){
_local7.width = _arg6;
};
_local7.text = _arg1;
return (_local7);
}
public function getNewTextFieldEmbeddedFont(_arg1:String, _arg2:uint, _arg3:uint, _arg4:Boolean, _arg5:Boolean, _arg6:Number):TextField{
var _local7:TextField;
var _local8:TextFormat;
_local7 = new TextField();
_local8 = new TextFormat();
_local8.font = embeddedFont.fontName;
_local8.color = _arg2;
_local8.size = _arg3;
_local7.defaultTextFormat = _local8;
_local7.autoSize = TextFieldAutoSize.LEFT;
_local7.type = TextFieldType.DYNAMIC;
_local7.multiline = _arg4;
_local7.selectable = false;
_local7.textColor = _arg2;
_local7.embedFonts = true;
_local7.antiAliasType = AntiAliasType.ADVANCED;
_local7.border = false;
_local7.wordWrap = _arg5;
if (_arg6 != -1){
_local7.width = _arg6;
};
_local7.text = _arg1;
return (_local7);
}
}
}//package fontsGame
Section 70
//Bomb (game.Bomb)
package game {
import flash.geom.*;
import sounds.*;
import common.*;
public class Bomb extends Character {
public var m_isTaken:Boolean;
public var m_iterationsMovement:Number;
public var m_timerActivated:Boolean;
public var m_timerMiliseconds:Number;
public var m_typeBomb:Number;
public var m_marketAsTarget:Number;
public var m_timer:Number;
public static var BOMB_TYPE_1_EXPLOSION_WIDTH:Number = 110;
public static var BOMB_TYPE_1_EXPLOSION_HEIGHT:Number = 90;
public static var BOMB_TYPE_1:Number = 1;
public static var BOMB_TYPE_2:Number = 2;
public static var BOMB_TYPE_2_EXPLOSION_HEIGHT:Number = 90;
public static var BOMB_TYPE_2_EXPLOSION_WIDTH:Number = 110;
public function Bomb(_arg1:Number, _arg2:gameClip){
var _local3:gameClip_Bomb;
m_type = TYPE_BOMB;
m_marketAsTarget = -1;
_local3 = new gameClip_Bomb();
super(_arg1, _arg2, gameClip_MovieCharacter(_local3));
m_timerActivated = false;
}
public function logic():void{
if (!m_active){
return;
};
if (m_timerActivated){
m_timerMiliseconds = (m_timerMiliseconds - m_gameClip.m_gameTimer.m_timeDif);
if (Math.floor((m_timerMiliseconds / 1000)) < m_timer){
m_timer--;
m_clip.instText.text = ("" + m_timer);
};
if (m_timer <= 0){
m_timerActivated = false;
changeState(EXPLOTED);
};
};
switch (m_state){
case PRESENTATION:
m_iterator++;
if (m_iterator == 1){
m_marketAsTarget = -1;
};
break;
case RUN:
m_iterator++;
if (m_iterator == 1){
m_marketAsTarget = -1;
};
if (m_iterationsMovement > 0){
m_iterationsMovement--;
moveBounce(false, m_clip.width, m_clip.height);
} else {
changeState(PRESENTATION);
};
break;
case EXPLOTED:
m_iterator++;
if (m_iterator == 1){
m_gameClip.m_soundManager.playGameSound(SoundsGame.SOUNDS_FX_BOMB_EXPLOSION, 1);
m_marketAsTarget = -1;
m_timerActivated = false;
m_clip.instText.text = "";
changeSection(("explosion_" + m_typeBomb));
switch (m_typeBomb){
case BOMB_TYPE_1:
m_gameClip.exploteBombsAffected(m_pos, BOMB_TYPE_1_EXPLOSION_WIDTH, BOMB_TYPE_1_EXPLOSION_HEIGHT);
m_gameClip.explotePlayersAffected(m_pos, BOMB_TYPE_1, BOMB_TYPE_1_EXPLOSION_WIDTH, BOMB_TYPE_1_EXPLOSION_HEIGHT);
break;
case BOMB_TYPE_2:
m_gameClip.exploteAllBombsAffected();
m_gameClip.explotePlayersAffected(m_pos, BOMB_TYPE_2, BOMB_TYPE_2_EXPLOSION_WIDTH, BOMB_TYPE_2_EXPLOSION_HEIGHT);
break;
};
};
if (m_clip.visible == false){
m_active = false;
};
break;
case DISSAPPEAR:
m_iterator++;
if (m_iterator == 1){
m_marketAsTarget = -1;
};
break;
case VICTORY:
break;
};
}
public function throwBomb(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:Point;
_local5 = Define.getFactorVelocity(_arg1);
m_marketAsTarget = -1;
m_vel.x = (_arg2 * _local5.x);
m_vel.y = (_arg3 * _local5.y);
m_iterationsMovement = _arg4;
m_isTaken = false;
if (m_state == PRESENTATION){
if (!m_timerActivated){
changeSection(("init_" + m_typeBomb));
};
m_timerActivated = true;
changeState(RUN);
};
}
public function takeBomb(){
m_marketAsTarget = -1;
m_isTaken = true;
}
public function initPositionBomb(_arg1:Point, _arg2:Number, _arg3:Number){
changeSection(("quiet_" + _arg3));
initPosition(_arg1);
m_typeBomb = _arg3;
m_isTaken = false;
m_iterationsMovement = 0;
m_timer = _arg2;
m_clip.instText.text = ("" + m_timer);
m_timerMiliseconds = (m_timer * 1000);
m_timerActivated = false;
changeState(PRESENTATION);
}
public function updatePos(_arg1:Number, _arg2:Number){
m_posLast.x = m_pos.x;
m_posLast.y = m_pos.y;
m_pos.x = _arg1;
m_pos.y = _arg2;
x = m_pos.x;
y = m_pos.y;
}
}
}//package game
Section 71
//Character (game.Character)
package game {
import flash.display.*;
import flash.geom.*;
import common.*;
public class Character extends Sprite {
public var m_iterator:Number;
public var m_gameClip:gameClip;
public var m_direction:Number;
public var m_iterations_throw:Number;
public var m_posLast:Point;
public var m_velBase:Point;
public var m_lastDirection:Number;
public var m_state:Number;
public var m_active:Boolean;
public var m_lastState:Number;
public var m_impact:Number;
public var m_posInitial:Point;
public var m_time:Number;
public var m_applyItem:Number;
public var m_shield:Boolean;
public var m_pos:Point;
public var m_index:Number;
public var m_vel_throw:Point;
public var m_timeLastCycle:Number;
public var m_lifes:Number;
public var POS_NULL:Point;
public var m_initialLifes:Number;
public var m_type:Number;
public var m_timeoutOfShield:Number;
public var m_vel:Point;
public var m_clip:gameClip_MovieCharacter;
public static var DISSAPPEAR:Number = 3;
public static var TYPE_PLAYER:Number = 0;
public static var TYPE_BOMB:Number = 3;
public static var TYPE_STUDENT:Number = 2;
public static var PRESENTATION:Number = 0;
public static var TYPE_SANTAK:Number = 1;
public static var RUN:Number = 1;
public static var WALL_SPACE:Number = 30;
public static var VICTORY:Number = 4;
public static var EXPLOTED:Number = 2;
public static var CHARACTER_HEIGHT:Number = 110;
public static var CHARACTER_WIDTH:Number = 70;
public static var NONE:Number = -1;
public static var TYPE_ITEM:Number = 4;
public function Character(_arg1:Number, _arg2:gameClip, _arg3:gameClip_MovieCharacter, _arg4:Number=-1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0, _arg9:Number=14, _arg10:Number=7, _arg11:Number=20, _arg12:Number=-1, _arg13:Number=2){
POS_NULL = new Point(0, 0);
super();
m_index = _arg1;
m_gameClip = _arg2;
m_clip = _arg3;
m_direction = _arg12;
m_pos = new Point(_arg5, _arg6);
m_posLast = new Point(_arg5, _arg6);
m_posInitial = new Point(_arg5, _arg6);
m_vel = new Point(0, 0);
m_velBase = new Point(_arg7, _arg8);
m_direction = _arg12;
m_lastDirection = _arg12;
m_lifes = _arg13;
m_initialLifes = _arg13;
m_vel_throw = new Point(_arg9, _arg10);
m_iterations_throw = _arg11;
m_clip.x = m_pos.x;
m_clip.y = m_pos.y;
addChild(m_clip);
m_active = false;
m_clip.visible = false;
visible = false;
m_time = -1;
m_impact = 0;
m_applyItem = -1;
m_shield = false;
m_timeoutOfShield = 0;
changeState(_arg4);
}
public function changeSection(_arg1:String){
m_clip.gotoAndStop(_arg1);
}
public function dissapear(){
m_active = false;
m_clip.visible = false;
visible = false;
}
public function initPosition(_arg1:Point){
m_shield = false;
m_active = true;
m_clip.visible = true;
visible = true;
m_pos.x = _arg1.x;
m_pos.y = _arg1.y;
m_posLast.x = _arg1.x;
m_posLast.y = _arg1.y;
m_posInitial.x = _arg1.x;
m_posInitial.y = _arg1.y;
x = m_pos.x;
y = m_pos.y;
}
public function moveCharacter(){
var _local1:Number;
var _local2:Number;
_local1 = (m_pos.x + m_vel.x);
_local2 = (m_pos.y + m_vel.y);
if (_local1 < ((CHARACTER_WIDTH >> 1) + WALL_SPACE)){
_local1 = (WALL_SPACE + (CHARACTER_WIDTH >> 1));
};
if (_local1 > (Define.GAME_AREA_WIDTH - ((CHARACTER_WIDTH >> 1) + WALL_SPACE))){
_local1 = (Define.GAME_AREA_WIDTH - ((CHARACTER_WIDTH >> 1) + WALL_SPACE));
};
if (_local2 < CHARACTER_HEIGHT){
_local2 = CHARACTER_HEIGHT;
};
if (_local2 > (Define.GAME_AREA_HEIGHT - WALL_SPACE)){
_local2 = (Define.GAME_AREA_HEIGHT - WALL_SPACE);
};
m_posLast.x = m_pos.x;
m_posLast.y = m_pos.y;
m_pos.x = _local1;
m_pos.y = _local2;
x = m_pos.x;
y = m_pos.y;
}
public function evalutionItem(){
try {
if (m_applyItem != -1){
switch (m_applyItem){
case Item.ITEM_SPEED:
if ((Define.SPEED_CHARACTER_MAXIMUM + (4 * Define.SPEED_CHARACTER_INCREMENT)) > m_vel.x){
m_vel.x = (m_vel.x + (2 * Define.SPEED_CHARACTER_INCREMENT));
m_vel.y = (m_vel.y + Define.SPEED_CHARACTER_INCREMENT);
m_velBase.x = (m_velBase.x + (2 * Define.SPEED_CHARACTER_INCREMENT));
m_velBase.y = (m_velBase.y + Define.SPEED_CHARACTER_INCREMENT);
};
break;
case Item.ITEM_STRENGH:
if ((Define.STRENGTH_CHARACTER_MAXIMUM + (4 * Define.STRENGTH_CHARACTER_INCREMENT)) > m_vel_throw.x){
m_vel_throw.x = (m_vel_throw.x + (2 * Define.STRENGTH_CHARACTER_INCREMENT));
m_vel_throw.y = (m_vel_throw.y + Define.STRENGTH_CHARACTER_INCREMENT);
m_iterations_throw = (m_iterations_throw + (Define.ITERATIONS_STRENGTH_CHARACTER_INCREMENT * 2));
};
break;
case Item.ITEM_SHIELD:
m_shield = true;
m_clip.instShield.visible = true;
break;
case Item.ITEM_LIFE:
m_lifes++;
if (m_type == TYPE_PLAYER){
m_gameClip.m_updatePlayersInfo = true;
} else {
m_gameClip.m_gameTimer.updateEnemyLifeInfo((m_index - (1 + m_gameClip.m_numberUserPlaying)), m_lifes);
};
break;
};
m_applyItem = -1;
};
} catch(err:Error) {
trace(" **DANGER** Character.evalutionItem ERROR");
m_applyItem = -1;
};
}
public function changeDirection(_arg1:String, _arg2:Number){
var _local3:Point;
m_lastDirection = m_direction;
m_direction = _arg2;
_local3 = Define.getFactorVelocity(_arg2);
m_vel.x = (m_velBase.x * _local3.x);
m_vel.y = (m_velBase.y * _local3.y);
m_clip.gotoAndStop((_arg1 + (_arg2 + 1)));
}
public function timeUpdatedCharacter():Number{
var _local1:Date;
var _local2:Date;
if (m_time == -1){
_local2 = new Date();
m_timeLastCycle = _local2.getTime();
} else {
m_timeLastCycle = m_time;
};
_local1 = new Date();
m_time = _local1.getTime();
return (Math.abs((m_time - m_timeLastCycle)));
}
public function changeState(_arg1:Number){
m_iterator = 0;
m_lastState = m_state;
m_state = _arg1;
}
public function moveBounce(_arg1:Boolean, _arg2:Number, _arg3:Number){
var _local4:Point;
_local4 = new Point((m_pos.x + m_vel.x), (m_pos.y + m_vel.y));
if (((((_local4.x - (_arg2 >> 1)) < WALL_SPACE)) || (((_local4.x + (_arg2 >> 1)) > (Define.GAME_AREA_WIDTH - WALL_SPACE))))){
m_vel.x = -(m_vel.x);
if (_arg1){
changeSection(("run_" + (Define.getDirectionByVelocity(m_vel.x, m_vel.y) + 1)));
};
return;
};
if ((((_local4.y < CHARACTER_HEIGHT)) || ((_local4.y > (Define.GAME_AREA_HEIGHT - (WALL_SPACE - 10)))))){
m_vel.y = -(m_vel.y);
if (_arg1){
changeSection(("run_" + (Define.getDirectionByVelocity(m_vel.x, m_vel.y) + 1)));
};
return;
};
m_posLast.x = m_pos.x;
m_posLast.y = m_pos.y;
m_pos.x = _local4.x;
m_pos.y = _local4.y;
x = m_pos.x;
y = m_pos.y;
}
}
}//package game
Section 72
//gameButton_Continue (game.gameButton_Continue)
package game {
import flash.display.*;
public dynamic class gameButton_Continue extends SimpleButton {
}
}//package game
Section 73
//gameButton_Exit (game.gameButton_Exit)
package game {
import flash.display.*;
public dynamic class gameButton_Exit extends SimpleButton {
}
}//package game
Section 74
//gameButton_Retry (game.gameButton_Retry)
package game {
import flash.display.*;
public dynamic class gameButton_Retry extends SimpleButton {
}
}//package game
Section 75
//gameCircleGetWall (game.gameCircleGetWall)
package game {
import flash.display.*;
public dynamic class gameCircleGetWall extends MovieClip {
}
}//package game
Section 76
//gameClip_Bomb (game.gameClip_Bomb)
package game {
public dynamic class gameClip_Bomb extends gameClip_MovieCharacter {
public function gameClip_Bomb(){
addFrameScript(0, frame1, 14, frame15, 29, frame30, 51, frame52, 52, frame53, 64, frame65, 74, frame75, 94, frame95);
}
function frame65(){
stop();
}
function frame75(){
play();
}
function frame95(){
visible = false;
stop();
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame30(){
play();
}
function frame52(){
visible = false;
stop();
}
function frame53(){
stop();
}
}
}//package game
Section 77
//gameClip_EndText_Lose (game.gameClip_EndText_Lose)
package game {
import flash.display.*;
public dynamic class gameClip_EndText_Lose extends MovieClip {
public function gameClip_EndText_Lose(){
addFrameScript(336, frame337);
}
function frame337(){
stop();
}
}
}//package game
Section 78
//gameClip_EndText_Win (game.gameClip_EndText_Win)
package game {
import flash.display.*;
public dynamic class gameClip_EndText_Win extends MovieClip {
public function gameClip_EndText_Win(){
addFrameScript(340, frame341);
}
function frame341(){
alpha = 99;
stop();
}
}
}//package game
Section 79
//gameClip_Item (game.gameClip_Item)
package game {
public dynamic class gameClip_Item extends gameClip_MovieCharacter {
public function gameClip_Item(){
addFrameScript(0, frame1, 12, frame13, 24, frame25);
}
function frame1(){
stop();
}
function frame25(){
stop();
}
function frame13(){
stop();
}
}
}//package game
Section 80
//gameClip_Leader_Class1 (game.gameClip_Leader_Class1)
package game {
public dynamic class gameClip_Leader_Class1 extends gameClip_MovieCharacter {
public function gameClip_Leader_Class1(){
addFrameScript(0, frame1, 9, frame10, 21, frame22, 58, frame59, 59, frame60, 81, frame82, 82, frame83, 90, frame91);
}
function frame82(){
m_endAnimation = true;
stop();
}
function frame91(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame83(){
stop();
}
function frame59(){
m_endAnimation = true;
stop();
}
function frame60(){
play();
}
}
}//package game
Section 81
//gameClip_Leader_Class2 (game.gameClip_Leader_Class2)
package game {
public dynamic class gameClip_Leader_Class2 extends gameClip_MovieCharacter {
public function gameClip_Leader_Class2(){
addFrameScript(0, frame1, 10, frame11, 24, frame25, 49, frame50, 50, frame51, 75, frame76, 76, frame77, 84, frame85);
}
function frame77(){
stop();
}
function frame76(){
m_endAnimation = true;
stop();
}
function frame85(){
stop();
}
function frame1(){
stop();
}
function frame25(){
play();
}
function frame11(){
stop();
}
function frame51(){
play();
}
function frame50(){
m_endAnimation = true;
stop();
}
}
}//package game
Section 82
//gameClip_Leader_Class3 (game.gameClip_Leader_Class3)
package game {
public dynamic class gameClip_Leader_Class3 extends gameClip_MovieCharacter {
public function gameClip_Leader_Class3(){
addFrameScript(0, frame1, 9, frame10, 21, frame22, 43, frame44, 44, frame45, 71, frame72, 72, frame73, 80, frame81);
}
function frame72(){
m_endAnimation = true;
stop();
}
function frame73(){
stop();
}
function frame81(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame45(){
play();
}
function frame44(){
m_endAnimation = true;
stop();
}
}
}//package game
Section 83
//gameClip_Leader_Class4 (game.gameClip_Leader_Class4)
package game {
public dynamic class gameClip_Leader_Class4 extends gameClip_MovieCharacter {
public function gameClip_Leader_Class4(){
addFrameScript(0, frame1, 11, frame12, 25, frame26, 53, frame54, 54, frame55, 79, frame80, 80, frame81, 88, frame89);
}
function frame80(){
m_endAnimation = true;
stop();
}
function frame81(){
stop();
}
function frame89(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame26(){
play();
}
function frame54(){
m_endAnimation = true;
stop();
}
function frame55(){
play();
}
}
}//package game
Section 84
//gameClip_Leader_Class5 (game.gameClip_Leader_Class5)
package game {
public dynamic class gameClip_Leader_Class5 extends gameClip_MovieCharacter {
public function gameClip_Leader_Class5(){
addFrameScript(0, frame1, 11, frame12, 24, frame25, 50, frame51, 51, frame52, 70, frame71, 71, frame72, 79, frame80);
}
function frame72(){
stop();
}
function frame71(){
m_endAnimation = true;
stop();
}
function frame80(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame25(){
play();
}
function frame51(){
m_endAnimation = true;
stop();
}
function frame52(){
play();
}
}
}//package game
Section 85
//gameClip_Leader_Class6 (game.gameClip_Leader_Class6)
package game {
public dynamic class gameClip_Leader_Class6 extends gameClip_MovieCharacter {
public function gameClip_Leader_Class6(){
addFrameScript(0, frame1, 10, frame11, 21, frame22, 48, frame49, 49, frame50, 77, frame78, 78, frame79, 86, frame87);
}
function frame78(){
m_endAnimation = true;
stop();
}
function frame79(){
stop();
}
function frame87(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame11(){
stop();
}
function frame49(){
m_endAnimation = true;
stop();
}
function frame50(){
play();
}
}
}//package game
Section 86
//gameClip_Leader_Class7 (game.gameClip_Leader_Class7)
package game {
public dynamic class gameClip_Leader_Class7 extends gameClip_MovieCharacter {
public function gameClip_Leader_Class7(){
addFrameScript(0, frame1, 10, frame11, 23, frame24, 51, frame52, 52, frame53, 82, frame83, 83, frame84, 91, frame92);
}
function frame84(){
stop();
}
function frame1(){
stop();
}
function frame24(){
play();
}
function frame83(){
m_endAnimation = true;
stop();
}
function frame92(){
stop();
}
function frame11(){
stop();
}
function frame52(){
m_endAnimation = true;
stop();
}
function frame53(){
play();
}
}
}//package game
Section 87
//gameClip_MovieCharacter (game.gameClip_MovieCharacter)
package game {
import flash.display.*;
import flash.text.*;
public class gameClip_MovieCharacter extends MovieClip {
public var instShield:MovieClip;
public var m_endAnimation:Boolean;
public var instText:TextField;
public var instCircle:gameCircleGetWall;
public function gameClip_MovieCharacter(){
super();
m_endAnimation = false;
try {
instShield.visible = false;
} catch(err:Error) {
};
}
}
}//package game
Section 88
//gameClip_santaKK (game.gameClip_santaKK)
package game {
public dynamic class gameClip_santaKK extends gameClip_MovieCharacter {
public function gameClip_santaKK(){
addFrameScript(0, frame1, 13, frame14, 40, frame41, 41, frame42, 51, frame52, 65, frame66);
}
function frame14(){
play();
}
function frame1(){
stop();
}
function frame41(){
m_endAnimation = true;
stop();
}
function frame42(){
stop();
}
function frame52(){
stop();
}
function frame66(){
stop();
}
}
}//package game
Section 89
//gameClip_StartText (game.gameClip_StartText)
package game {
import flash.display.*;
public dynamic class gameClip_StartText extends MovieClip {
public function gameClip_StartText(){
addFrameScript(118, frame119);
}
function frame119(){
stop();
visible = false;
}
}
}//package game
Section 90
//gameClip_Student1_Class1 (game.gameClip_Student1_Class1)
package game {
public dynamic class gameClip_Student1_Class1 extends gameClip_MovieCharacter {
public function gameClip_Student1_Class1(){
addFrameScript(0, frame1, 9, frame10, 21, frame22, 58, frame59, 59, frame60, 81, frame82, 82, frame83, 90, frame91);
}
function frame82(){
m_endAnimation = true;
stop();
}
function frame91(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame83(){
stop();
}
function frame59(){
m_endAnimation = true;
stop();
}
function frame60(){
play();
}
}
}//package game
Section 91
//gameClip_Student1_Class2 (game.gameClip_Student1_Class2)
package game {
public dynamic class gameClip_Student1_Class2 extends gameClip_MovieCharacter {
public function gameClip_Student1_Class2(){
addFrameScript(0, frame1, 9, frame10, 21, frame22, 58, frame59, 59, frame60, 81, frame82, 82, frame83, 90, frame91);
}
function frame82(){
m_endAnimation = true;
stop();
}
function frame91(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame83(){
stop();
}
function frame59(){
m_endAnimation = true;
stop();
}
function frame60(){
play();
}
}
}//package game
Section 92
//gameClip_Student1_Class3 (game.gameClip_Student1_Class3)
package game {
public dynamic class gameClip_Student1_Class3 extends gameClip_MovieCharacter {
public function gameClip_Student1_Class3(){
addFrameScript(0, frame1, 9, frame10, 20, frame21, 49, frame50, 50, frame51, 75, frame76, 76, frame77, 84, frame85);
}
function frame77(){
stop();
}
function frame76(){
m_endAnimation = true;
stop();
}
function frame85(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame21(){
play();
}
function frame51(){
play();
}
function frame50(){
m_endAnimation = true;
stop();
}
}
}//package game
Section 93
//gameClip_Student1_Class4 (game.gameClip_Student1_Class4)
package game {
public dynamic class gameClip_Student1_Class4 extends gameClip_MovieCharacter {
public function gameClip_Student1_Class4(){
addFrameScript(0, frame1, 10, frame11, 23, frame24, 47, frame48, 48, frame49, 75, frame76, 76, frame77, 84, frame85);
}
function frame77(){
stop();
}
function frame76(){
m_endAnimation = true;
stop();
}
function frame85(){
stop();
}
function frame1(){
stop();
}
function frame24(){
play();
}
function frame11(){
stop();
}
function frame48(){
m_endAnimation = true;
stop();
}
function frame49(){
play();
}
}
}//package game
Section 94
//gameClip_Student1_Class5 (game.gameClip_Student1_Class5)
package game {
public dynamic class gameClip_Student1_Class5 extends gameClip_MovieCharacter {
public function gameClip_Student1_Class5(){
addFrameScript(0, frame1, 10, frame11, 22, frame23, 48, frame49, 49, frame50, 72, frame73, 73, frame74, 81, frame82);
}
function frame73(){
m_endAnimation = true;
stop();
}
function frame74(){
stop();
}
function frame82(){
stop();
}
function frame1(){
stop();
}
function frame23(){
play();
}
function frame11(){
stop();
}
function frame49(){
m_endAnimation = true;
stop();
}
function frame50(){
play();
}
}
}//package game
Section 95
//gameClip_Student1_Class6 (game.gameClip_Student1_Class6)
package game {
public dynamic class gameClip_Student1_Class6 extends gameClip_MovieCharacter {
public function gameClip_Student1_Class6(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 48, frame49, 49, frame50, 76, frame77, 77, frame78, 85, frame86);
}
function frame77(){
m_endAnimation = true;
stop();
}
function frame78(){
stop();
}
function frame86(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame20(){
play();
}
function frame49(){
m_endAnimation = true;
stop();
}
function frame50(){
play();
}
}
}//package game
Section 96
//gameClip_Student1_Class7 (game.gameClip_Student1_Class7)
package game {
public dynamic class gameClip_Student1_Class7 extends gameClip_MovieCharacter {
public function gameClip_Student1_Class7(){
addFrameScript(0, frame1, 10, frame11, 25, frame26, 54, frame55, 55, frame56, 82, frame83, 83, frame84, 91, frame92);
}
function frame84(){
stop();
}
function frame1(){
stop();
}
function frame83(){
m_endAnimation = true;
stop();
}
function frame92(){
stop();
}
function frame11(){
stop();
}
function frame26(){
play();
}
function frame55(){
m_endAnimation = true;
stop();
}
function frame56(){
play();
}
}
}//package game
Section 97
//gameClip_Student2_Class1 (game.gameClip_Student2_Class1)
package game {
public dynamic class gameClip_Student2_Class1 extends gameClip_MovieCharacter {
public function gameClip_Student2_Class1(){
addFrameScript(0, frame1, 9, frame10, 21, frame22, 58, frame59, 59, frame60, 81, frame82, 82, frame83, 90, frame91);
}
function frame82(){
m_endAnimation = true;
stop();
}
function frame91(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame83(){
stop();
}
function frame59(){
m_endAnimation = true;
stop();
}
function frame60(){
play();
}
}
}//package game
Section 98
//gameClip_Student2_Class2 (game.gameClip_Student2_Class2)
package game {
public dynamic class gameClip_Student2_Class2 extends gameClip_MovieCharacter {
public function gameClip_Student2_Class2(){
addFrameScript(0, frame1, 9, frame10, 21, frame22, 58, frame59, 59, frame60, 81, frame82, 82, frame83, 90, frame91);
}
function frame82(){
m_endAnimation = true;
stop();
}
function frame91(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame83(){
stop();
}
function frame59(){
m_endAnimation = true;
stop();
}
function frame60(){
play();
}
}
}//package game
Section 99
//gameClip_Student2_Class3 (game.gameClip_Student2_Class3)
package game {
public dynamic class gameClip_Student2_Class3 extends gameClip_MovieCharacter {
public function gameClip_Student2_Class3(){
addFrameScript(0, frame1, 9, frame10, 22, frame23, 50, frame51, 51, frame52, 78, frame79, 79, frame80, 87, frame88);
}
function frame79(){
m_endAnimation = true;
stop();
}
function frame80(){
stop();
}
function frame88(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame23(){
play();
}
function frame51(){
m_endAnimation = true;
stop();
}
function frame52(){
play();
}
}
}//package game
Section 100
//gameClip_Student2_Class4 (game.gameClip_Student2_Class4)
package game {
public dynamic class gameClip_Student2_Class4 extends gameClip_MovieCharacter {
public function gameClip_Student2_Class4(){
addFrameScript(0, frame1, 10, frame11, 22, frame23, 52, frame53, 53, frame54, 81, frame82, 82, frame83, 90, frame91);
}
function frame82(){
m_endAnimation = true;
stop();
}
function frame91(){
stop();
}
function frame1(){
stop();
}
function frame23(){
play();
}
function frame83(){
stop();
}
function frame11(){
stop();
}
function frame54(){
play();
}
function frame53(){
m_endAnimation = true;
stop();
}
}
}//package game
Section 101
//gameClip_Student2_Class5 (game.gameClip_Student2_Class5)
package game {
public dynamic class gameClip_Student2_Class5 extends gameClip_MovieCharacter {
public function gameClip_Student2_Class5(){
addFrameScript(0, frame1, 11, frame12, 25, frame26, 52, frame53, 53, frame54, 79, frame80, 80, frame81, 88, frame89);
}
function frame80(){
m_endAnimation = true;
stop();
}
function frame81(){
stop();
}
function frame89(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame26(){
play();
}
function frame54(){
play();
}
function frame53(){
m_endAnimation = true;
stop();
}
}
}//package game
Section 102
//gameClip_Student2_Class6 (game.gameClip_Student2_Class6)
package game {
public dynamic class gameClip_Student2_Class6 extends gameClip_MovieCharacter {
public function gameClip_Student2_Class6(){
addFrameScript(0, frame1, 9, frame10, 23, frame24, 51, frame52, 52, frame53, 79, frame80, 80, frame81, 88, frame89);
}
function frame80(){
m_endAnimation = true;
stop();
}
function frame81(){
stop();
}
function frame89(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame24(){
play();
}
function frame52(){
m_endAnimation = true;
stop();
}
function frame53(){
play();
}
}
}//package game
Section 103
//gameClip_Student2_Class7 (game.gameClip_Student2_Class7)
package game {
public dynamic class gameClip_Student2_Class7 extends gameClip_MovieCharacter {
public function gameClip_Student2_Class7(){
addFrameScript(0, frame1, 11, frame12, 23, frame24, 52, frame53, 53, frame54, 80, frame81, 81, frame82, 89, frame90);
}
function frame81(){
m_endAnimation = true;
stop();
}
function frame82(){
stop();
}
function frame90(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame24(){
play();
}
function frame54(){
play();
}
function frame53(){
m_endAnimation = true;
stop();
}
}
}//package game
Section 104
//gameClip_Student3_Class1 (game.gameClip_Student3_Class1)
package game {
public dynamic class gameClip_Student3_Class1 extends gameClip_MovieCharacter {
public function gameClip_Student3_Class1(){
addFrameScript(0, frame1, 9, frame10, 21, frame22, 44, frame45, 45, frame46, 64, frame65, 65, frame66, 73, frame74);
}
function frame65(){
m_endAnimation = true;
stop();
}
function frame74(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame46(){
play();
}
function frame45(){
m_endAnimation = true;
stop();
}
function frame66(){
stop();
}
}
}//package game
Section 105
//gameClip_Student3_Class2 (game.gameClip_Student3_Class2)
package game {
public dynamic class gameClip_Student3_Class2 extends gameClip_MovieCharacter {
public function gameClip_Student3_Class2(){
addFrameScript(0, frame1, 11, frame12, 25, frame26, 48, frame49, 49, frame50, 75, frame76, 76, frame77, 84, frame85);
}
function frame77(){
stop();
}
function frame76(){
m_endAnimation = true;
stop();
}
function frame85(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame26(){
play();
}
function frame49(){
m_endAnimation = true;
stop();
}
function frame50(){
play();
}
}
}//package game
Section 106
//gameClip_Student3_Class3 (game.gameClip_Student3_Class3)
package game {
public dynamic class gameClip_Student3_Class3 extends gameClip_MovieCharacter {
public function gameClip_Student3_Class3(){
addFrameScript(0, frame1, 9, frame10, 20, frame21, 47, frame48, 48, frame49, 72, frame73, 73, frame74, 81, frame82);
}
function frame73(){
m_endAnimation = true;
stop();
}
function frame74(){
stop();
}
function frame82(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame21(){
play();
}
function frame48(){
m_endAnimation = true;
stop();
}
function frame49(){
play();
}
}
}//package game
Section 107
//gameClip_Student3_Class4 (game.gameClip_Student3_Class4)
package game {
public dynamic class gameClip_Student3_Class4 extends gameClip_MovieCharacter {
public function gameClip_Student3_Class4(){
addFrameScript(0, frame1, 9, frame10, 22, frame23, 48, frame49, 49, frame50, 74, frame75, 75, frame76, 83, frame84);
}
function frame75(){
m_endAnimation = true;
stop();
}
function frame76(){
stop();
}
function frame84(){
stop();
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame23(){
play();
}
function frame49(){
m_endAnimation = true;
stop();
}
function frame50(){
play();
}
}
}//package game
Section 108
//gameClip_Student3_Class5 (game.gameClip_Student3_Class5)
package game {
public dynamic class gameClip_Student3_Class5 extends gameClip_MovieCharacter {
public function gameClip_Student3_Class5(){
addFrameScript(0, frame1, 11, frame12, 25, frame26, 52, frame53, 53, frame54, 75, frame76, 76, frame77, 84, frame85);
}
function frame77(){
stop();
}
function frame76(){
m_endAnimation = true;
stop();
}
function frame85(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame26(){
play();
}
function frame54(){
play();
}
function frame53(){
m_endAnimation = true;
stop();
}
}
}//package game
Section 109
//gameClip_Student3_Class6 (game.gameClip_Student3_Class6)
package game {
public dynamic class gameClip_Student3_Class6 extends gameClip_MovieCharacter {
public function gameClip_Student3_Class6(){
addFrameScript(0, frame1, 10, frame11, 21, frame22, 50, frame51, 51, frame52, 79, frame80, 80, frame81, 88, frame89);
}
function frame80(){
m_endAnimation = true;
stop();
}
function frame81(){
stop();
}
function frame89(){
stop();
}
function frame1(){
stop();
}
function frame22(){
play();
}
function frame11(){
stop();
}
function frame51(){
m_endAnimation = true;
stop();
}
function frame52(){
play();
}
}
}//package game
Section 110
//gameClip_Student3_Class7 (game.gameClip_Student3_Class7)
package game {
public dynamic class gameClip_Student3_Class7 extends gameClip_MovieCharacter {
public function gameClip_Student3_Class7(){
addFrameScript(0, frame1, 11, frame12, 25, frame26, 51, frame52, 52, frame53, 79, frame80, 80, frame81, 88, frame89);
}
function frame80(){
m_endAnimation = true;
stop();
}
function frame81(){
stop();
}
function frame89(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
function frame26(){
play();
}
function frame52(){
m_endAnimation = true;
stop();
}
function frame53(){
play();
}
}
}//package game
Section 111
//Item (game.Item)
package game {
import flash.geom.*;
import sounds.*;
import common.*;
public class Item extends Character {
public var m_timerMiliseconds:Number;
public var m_timer:Number;
public var m_typeItem:Number;
public static var ITEM_SHIELD:Number = 2;
public static var ITEM_LIFE:Number = 3;
public static var ITEM_SPEED:Number = 0;
public static var ITEM_STRENGH:Number = 1;
public function Item(_arg1:Number, _arg2:gameClip){
var _local3:gameClip_Item;
m_type = TYPE_ITEM;
_local3 = new gameClip_Item();
super(_arg1, _arg2, gameClip_MovieCharacter(_local3));
}
public function initItem(_arg1:Point, _arg2:Number, _arg3:Number){
m_typeItem = _arg2;
changeSection(("item_" + (m_typeItem + 1)));
initPosition(_arg1);
m_clip.alpha = 100;
m_timer = _arg3;
m_timerMiliseconds = (m_timer * 1000);
changeState(PRESENTATION);
}
public function logic():void{
var _local1:Character;
if (!m_active){
return;
};
m_timerMiliseconds = (m_timerMiliseconds - m_gameClip.m_gameTimer.m_timeDif);
if (Math.floor((m_timerMiliseconds / 1000)) < m_timer){
m_timer--;
};
switch (m_state){
case PRESENTATION:
_local1 = m_gameClip.getNearestCharacter(m_pos);
if ((((Math.abs((_local1.m_pos.x - m_pos.x)) < (Define.CIRCLE_DETECTION_BOMB_WIDTH >> 1))) && ((Math.abs((_local1.m_pos.y - m_pos.y)) < (Define.CIRCLE_DETECTION_BOMB_HEIGHT >> 1))))){
_local1.m_applyItem = m_typeItem;
if (_local1.m_type == TYPE_PLAYER){
switch (m_typeItem){
case ITEM_SPEED:
m_gameClip.m_soundManager.playGameSound(SoundsGame.SOUNDS_FX_ITEM_SPEEDUP, 1);
break;
case ITEM_STRENGH:
m_gameClip.m_soundManager.playGameSound(SoundsGame.SOUNDS_FX_ITEM_STRENGTH, 1);
break;
case ITEM_SHIELD:
m_gameClip.m_soundManager.playGameSound(SoundsGame.SOUNDS_FX_ITEM_SHIELD, 1);
break;
case ITEM_LIFE:
m_gameClip.m_soundManager.playGameSound(SoundsGame.SOUNDS_FX_ITEM_LIFE, 1);
break;
};
};
changeState(DISSAPPEAR);
return;
};
if (m_timer < 5){
if (m_clip.alpha > 20){
m_clip.alpha = (m_clip.alpha - 10);
} else {
m_clip.alpha = 100;
};
};
if (m_timer <= 0){
changeState(DISSAPPEAR);
};
break;
case DISSAPPEAR:
m_iterator++;
if (m_iterator == 1){
dissapear();
};
break;
};
}
}
}//package game
Section 112
//Player_Santa (game.Player_Santa)
package game {
import common.*;
public class Player_Santa extends Character {
public var m_timerToChangeDirection:Number;
public var m_timerToBomb:Number;
public var m_initialTimerToBomb:Number;
public var m_initalTimerToChangeDirection:Number;
public var m_activatedBombTimeReduction:Boolean;
public static var WAIT_FOR_CHANGE_DIRECTION:Number = 5;
public function Player_Santa(_arg1:Number, _arg2:gameClip, _arg3:Number=6, _arg4:Number=3, _arg5:Number=2000, _arg6:Number=12000){
var _local7:gameClip_santaKK;
_local7 = new gameClip_santaKK();
super(_arg1, _arg2, gameClip_MovieCharacter(_local7), -1, 0, 0, _arg4, _arg4, -1, -1, -1, Define.DIRECTION_NONE, 10000);
m_type = TYPE_SANTAK;
m_vel.x = _arg3;
m_vel.y = _arg4;
m_timerToBomb = _arg5;
m_initialTimerToBomb = _arg5;
m_timerToChangeDirection = _arg6;
m_initalTimerToChangeDirection = _arg6;
m_activatedBombTimeReduction = false;
changeState(PRESENTATION);
}
public function logic(){
if (m_impact > 0){
m_lifes = (m_lifes - m_impact);
m_impact = 0;
changeState(EXPLOTED);
};
switch (m_state){
case PRESENTATION:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
changeSection("presentation");
};
break;
case WAIT_FOR_CHANGE_DIRECTION:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
m_timerToBomb = Math.floor((m_initialTimerToBomb / 2));
changeSection("presentation");
};
m_timerToBomb = (m_timerToBomb - m_gameClip.m_gameTimer.m_timeDif);
if (m_timerToBomb <= 0){
if (Define.randRange(0, 10) < 5){
m_vel.x = -(m_vel.x);
};
if (Define.randRange(0, 10) < 5){
m_vel.y = -(m_vel.y);
};
m_clip.alpha = 100;
if (Define.randRange(0, 10) < 8){
m_gameClip.insertNewItem(m_pos.x, m_pos.y, Define.randRange(0, 3), Define.TIMEOUT_OF_THE_ITEMS);
} else {
m_gameClip.insertNewBomb(m_pos.x, m_pos.y, Define.randRange(6, 20), 2);
};
changeState(RUN);
};
break;
case RUN:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
changeSection(("run_" + (Define.getDirectionByVelocity(m_vel.x, m_vel.y) + 1)));
};
moveBounce(true, Character.CHARACTER_WIDTH, Character.CHARACTER_HEIGHT);
m_timerToBomb = (m_timerToBomb - m_gameClip.m_gameTimer.m_timeDif);
if (!m_activatedBombTimeReduction){
if (m_gameClip.getNumberOfActiveBombs() < ((2 * m_gameClip.m_listBombs.length) / 3)){
m_timerToBomb = (m_timerToBomb / 4);
m_activatedBombTimeReduction = true;
};
};
if (m_timerToBomb <= 0){
m_activatedBombTimeReduction = false;
m_timerToBomb = m_initialTimerToBomb;
m_gameClip.insertNewBomb(m_pos.x, m_pos.y, Define.randRange(6, 20), 1);
};
m_timerToChangeDirection = (m_timerToChangeDirection - m_gameClip.m_gameTimer.m_timeDif);
if (m_timerToChangeDirection <= 0){
m_timerToChangeDirection = m_initalTimerToChangeDirection;
changeState(WAIT_FOR_CHANGE_DIRECTION);
};
break;
case EXPLOTED:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
m_clip.gotoAndPlay("exploded");
m_clip.m_endAnimation = false;
};
if (m_clip.m_endAnimation){
m_clip.m_endAnimation = false;
m_direction = Define.DIRECTION_NONE;
m_gameClip.insertNewItem(m_pos.x, m_pos.y, Define.randRange(0, 3), Define.TIMEOUT_OF_THE_ITEMS);
changeState(RUN);
};
break;
case DISSAPPEAR:
break;
case VICTORY:
break;
};
}
}
}//package game
Section 113
//Player_Student (game.Player_Student)
package game {
import common.*;
public class Player_Student extends Character {
var m_subIterator:Number;
var m_level:Number;
var m_timeToFollowGoal:Number;
var m_characterTarget:Character;
var m_inteligence:Number;
var m_itemTarget:Item;
var m_subState:Number;
var m_bombTarget:Bomb;
var m_student:Number;
public static var SUB_SEARCH_FOR_BOMB:Number = 0;
public static var SUB_GO_FOR_ITEM:Number = 4;
public static var SUB_GO_FOR_CHARACTER:Number = 2;
public static var SUB_GO_TO_INITIAL_POSITION:Number = 3;
public static var SUB_GO_FOR_BOMB:Number = 1;
public function Player_Student(_arg1:Number, _arg2:gameClip, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=4, _arg7:Number=2, _arg8:Number=14, _arg9:Number=7, _arg10:Number=30, _arg11:Number=20){
var _local12:gameClip_MovieCharacter;
var _local13:gameClip_Leader_Class1;
var _local14:gameClip_Student1_Class1;
var _local15:gameClip_Student2_Class1;
var _local16:gameClip_Student3_Class1;
var _local17:gameClip_Leader_Class2;
var _local18:gameClip_Student1_Class2;
var _local19:gameClip_Student2_Class2;
var _local20:gameClip_Student3_Class2;
var _local21:gameClip_Leader_Class3;
var _local22:gameClip_Student1_Class3;
var _local23:gameClip_Student2_Class3;
var _local24:gameClip_Student3_Class3;
var _local25:gameClip_Leader_Class4;
var _local26:gameClip_Student1_Class4;
var _local27:gameClip_Student2_Class4;
var _local28:gameClip_Student3_Class4;
var _local29:gameClip_Leader_Class5;
var _local30:gameClip_Student1_Class5;
var _local31:gameClip_Student2_Class5;
var _local32:gameClip_Student3_Class5;
var _local33:gameClip_Leader_Class6;
var _local34:gameClip_Student1_Class6;
var _local35:gameClip_Student2_Class6;
var _local36:gameClip_Student3_Class6;
var _local37:gameClip_Leader_Class7;
var _local38:gameClip_Student1_Class7;
var _local39:gameClip_Student2_Class7;
var _local40:gameClip_Student3_Class7;
m_level = _arg3;
m_student = _arg4;
m_inteligence = _arg5;
m_timeToFollowGoal = 0;
switch (m_level){
case 0:
switch (m_student){
case 0:
_local13 = new gameClip_Leader_Class1();
_local12 = gameClip_MovieCharacter(_local13);
_local12.instCircle.visible = false;
break;
case 1:
_local14 = new gameClip_Student1_Class1();
_local12 = gameClip_MovieCharacter(_local14);
break;
case 2:
_local15 = new gameClip_Student2_Class1();
_local12 = gameClip_MovieCharacter(_local15);
break;
case 3:
_local16 = new gameClip_Student3_Class1();
_local12 = gameClip_MovieCharacter(_local16);
break;
};
break;
case 1:
switch (m_student){
case 0:
_local17 = new gameClip_Leader_Class2();
_local12 = gameClip_MovieCharacter(_local17);
_local12.instCircle.visible = false;
break;
case 1:
_local18 = new gameClip_Student1_Class2();
_local12 = gameClip_MovieCharacter(_local18);
break;
case 2:
_local19 = new gameClip_Student2_Class2();
_local12 = gameClip_MovieCharacter(_local19);
break;
case 3:
_local20 = new gameClip_Student3_Class2();
_local12 = gameClip_MovieCharacter(_local20);
break;
};
break;
case 2:
switch (m_student){
case 0:
_local21 = new gameClip_Leader_Class3();
_local12 = gameClip_MovieCharacter(_local21);
_local12.instCircle.visible = false;
break;
case 1:
_local22 = new gameClip_Student1_Class3();
_local12 = gameClip_MovieCharacter(_local22);
break;
case 2:
_local23 = new gameClip_Student2_Class3();
_local12 = gameClip_MovieCharacter(_local23);
break;
case 3:
_local24 = new gameClip_Student3_Class3();
_local12 = gameClip_MovieCharacter(_local24);
break;
};
break;
case 3:
switch (m_student){
case 0:
_local25 = new gameClip_Leader_Class4();
_local12 = gameClip_MovieCharacter(_local25);
_local12.instCircle.visible = false;
break;
case 1:
_local26 = new gameClip_Student1_Class4();
_local12 = gameClip_MovieCharacter(_local26);
break;
case 2:
_local27 = new gameClip_Student2_Class4();
_local12 = gameClip_MovieCharacter(_local27);
break;
case 3:
_local28 = new gameClip_Student3_Class4();
_local12 = gameClip_MovieCharacter(_local28);
break;
};
break;
case 4:
switch (m_student){
case 0:
_local29 = new gameClip_Leader_Class5();
_local12 = gameClip_MovieCharacter(_local29);
_local12.instCircle.visible = false;
break;
case 1:
_local30 = new gameClip_Student1_Class5();
_local12 = gameClip_MovieCharacter(_local30);
break;
case 2:
_local31 = new gameClip_Student2_Class5();
_local12 = gameClip_MovieCharacter(_local31);
break;
case 3:
_local32 = new gameClip_Student3_Class5();
_local12 = gameClip_MovieCharacter(_local32);
break;
};
break;
case 5:
switch (m_student){
case 0:
_local33 = new gameClip_Leader_Class6();
_local12 = gameClip_MovieCharacter(_local33);
_local12.instCircle.visible = false;
break;
case 1:
_local34 = new gameClip_Student1_Class6();
_local12 = gameClip_MovieCharacter(_local34);
break;
case 2:
_local35 = new gameClip_Student2_Class6();
_local12 = gameClip_MovieCharacter(_local35);
break;
case 3:
_local36 = new gameClip_Student3_Class6();
_local12 = gameClip_MovieCharacter(_local36);
break;
};
break;
case 6:
switch (m_student){
case 0:
_local37 = new gameClip_Leader_Class7();
_local12 = gameClip_MovieCharacter(_local37);
_local12.instCircle.visible = false;
break;
case 1:
_local38 = new gameClip_Student1_Class7();
_local12 = gameClip_MovieCharacter(_local38);
break;
case 2:
_local39 = new gameClip_Student2_Class7();
_local12 = gameClip_MovieCharacter(_local39);
break;
case 3:
_local40 = new gameClip_Student3_Class7();
_local12 = gameClip_MovieCharacter(_local40);
break;
};
break;
};
super(_arg1, _arg2, _local12, -1, 0, 0, _arg7, _arg7, _arg8, _arg9, _arg10, Define.DIRECTION_NONE, _arg11);
m_type = TYPE_STUDENT;
m_clip.instShield.visible = false;
m_bombTarget = null;
changeSubState(SUB_SEARCH_FOR_BOMB);
changeState(PRESENTATION);
}
public function changeSubState(_arg1:Number){
m_subIterator = 0;
m_subState = _arg1;
}
public function freeEverythingAttached():void{
if (m_bombTarget != null){
try {
m_bombTarget.m_marketAsTarget = -1;
} catch(error:Error) {
};
m_bombTarget = null;
};
if (m_itemTarget != null){
m_itemTarget = null;
};
if (m_characterTarget != null){
m_characterTarget = null;
};
}
public function logic():Number{
var sbomb:Bomb;
var sdir:Number;
if (!m_active){
return (0);
};
if (m_impact > 0){
if (!m_shield){
m_lifes = (m_lifes - m_impact);
m_gameClip.m_gameTimer.updateEnemyLifeInfo((m_index - (1 + m_gameClip.m_numberUserPlaying)), m_lifes);
};
m_impact = 0;
changeState(EXPLOTED);
};
evalutionItem();
try {
switch (m_state){
case PRESENTATION:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
changeSection("presentation");
};
break;
case RUN:
switch (m_subState){
case SUB_SEARCH_FOR_BOMB:
if (Define.DEBUG_STUDENT_IA){
trace("0-SUB_SEARCH_FOR_BOMB");
};
m_bombTarget = m_gameClip.getNearestBombToTake(m_pos, m_inteligence);
if (m_inteligence > 1){
m_itemTarget = m_gameClip.getNearestItem(m_pos);
if (m_itemTarget != null){
if (Define.randRange(0, 10) < 4){
m_bombTarget = null;
changeSubState(SUB_GO_FOR_ITEM);
return (1);
};
};
};
if (m_bombTarget != null){
m_bombTarget.m_marketAsTarget = m_index;
sdir = Define.getDirectionPlus(m_pos, m_bombTarget.m_pos);
if (m_direction != sdir){
changeDirection("run_", sdir);
};
changeSubState(SUB_GO_FOR_BOMB);
} else {
m_timeToFollowGoal = Define.randRange(500, 3000);
if (Define.randRange(0, 10) < 5){
m_characterTarget = Character(m_gameClip.m_playerSanta);
changeSubState(SUB_GO_FOR_CHARACTER);
} else {
changeSubState(SUB_GO_TO_INITIAL_POSITION);
};
};
break;
case SUB_GO_FOR_BOMB:
if (Define.DEBUG_STUDENT_IA){
trace("1-SUB_GO_FOR_BOMB");
};
if (m_bombTarget != null){
if (((((!(m_bombTarget.m_isTaken)) && ((m_bombTarget.m_iterationsMovement == 0)))) && ((m_bombTarget.m_timer >= m_inteligence)))){
sdir = Define.getDirectionPlus(m_pos, m_bombTarget.m_pos);
if (m_direction != sdir){
changeDirection("run_", sdir);
};
moveCharacter();
if ((((Math.abs((m_bombTarget.m_pos.x - m_pos.x)) < (Define.CIRCLE_DETECTION_BOMB_WIDTH >> 1))) && ((Math.abs((m_bombTarget.m_pos.y - m_pos.y)) < (Define.CIRCLE_DETECTION_BOMB_HEIGHT >> 1))))){
m_bombTarget.takeBomb();
m_timeToFollowGoal = Define.randRange(200, 2000);
m_characterTarget = m_gameClip.getRandomCharacterTarget(m_index, Define.randRange(0, 20));
if (m_characterTarget != null){
changeSubState(SUB_GO_FOR_CHARACTER);
} else {
m_characterTarget = Character(m_gameClip.m_playerSanta);
changeSubState(SUB_GO_FOR_CHARACTER);
};
};
} else {
m_bombTarget.m_marketAsTarget = -1;
m_bombTarget = null;
changeSubState(SUB_SEARCH_FOR_BOMB);
};
} else {
m_bombTarget = null;
changeSubState(SUB_SEARCH_FOR_BOMB);
};
break;
case SUB_GO_FOR_CHARACTER:
if (Define.DEBUG_STUDENT_IA){
trace("2-SUB_GO_FOR_CHARACTER");
};
if (m_characterTarget != null){
sdir = Define.getDirectionPlus(m_pos, m_characterTarget.m_pos);
if (m_direction != sdir){
changeDirection("run_", sdir);
};
};
moveCharacter();
if (m_bombTarget != null){
m_bombTarget.updatePos(m_pos.x, (m_pos.y + 10));
if (m_bombTarget.m_timer <= 1){
m_timeToFollowGoal = 0;
};
};
m_timeToFollowGoal = (m_timeToFollowGoal - m_gameClip.m_gameTimer.m_timeDif);
if (m_characterTarget != null){
if ((((Math.abs((m_pos.x - m_characterTarget.m_pos.x)) < (Define.CIRCLE_DETECTION_BOMB_WIDTH * 3))) && ((Math.abs((m_pos.y - m_characterTarget.m_pos.y)) < (Define.CIRCLE_DETECTION_BOMB_HEIGHT * 3))))){
m_timeToFollowGoal = 0;
};
};
if (m_timeToFollowGoal <= 0){
if (m_bombTarget != null){
m_bombTarget.throwBomb(m_direction, m_vel_throw.x, m_vel_throw.y, m_iterations_throw);
m_bombTarget = null;
};
changeSubState(SUB_SEARCH_FOR_BOMB);
};
break;
case SUB_GO_TO_INITIAL_POSITION:
if (Define.DEBUG_STUDENT_IA){
trace("3-SUB_GO_TO_INITIAL_POSITION");
};
sdir = Define.getDirectionPlus(m_pos, m_posInitial);
if (m_direction != sdir){
changeDirection("run_", sdir);
};
moveCharacter();
m_timeToFollowGoal = (m_timeToFollowGoal - m_gameClip.m_gameTimer.m_timeDif);
if ((((m_timeToFollowGoal <= 0)) || ((Define.distancePoint(m_pos, m_posInitial) < (Define.CIRCLE_DETECTION_BOMB_WIDTH >> 2))))){
m_bombTarget = null;
changeSubState(SUB_SEARCH_FOR_BOMB);
};
break;
case SUB_GO_FOR_ITEM:
if (Define.DEBUG_STUDENT_IA){
trace("***************** 4-SUB_GO_FOR_ITEM");
};
if (m_itemTarget != null){
if (m_itemTarget.m_active){
sdir = Define.getDirectionPlus(m_pos, m_itemTarget.m_pos);
if (m_direction != sdir){
changeDirection("run_", sdir);
};
moveCharacter();
} else {
m_itemTarget = null;
changeSubState(SUB_SEARCH_FOR_BOMB);
};
} else {
m_itemTarget = null;
changeSubState(SUB_SEARCH_FOR_BOMB);
};
break;
};
break;
case EXPLOTED:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
if (m_shield){
m_timeoutOfShield = 1000;
} else {
m_clip.gotoAndPlay("exploded");
m_clip.m_endAnimation = false;
};
if (m_bombTarget != null){
m_bombTarget.throwBomb(Define.DIRECTION_LEFT, 0, 0, 0);
m_bombTarget = null;
};
};
if (m_shield){
m_timeoutOfShield = (m_timeoutOfShield - m_gameClip.m_gameTimer.m_timeDif);
};
if (((m_clip.m_endAnimation) || (((m_shield) && ((m_timeoutOfShield <= 0)))))){
m_shield = false;
m_clip.instShield.visible = false;
m_clip.m_endAnimation = false;
if (m_lifes <= 0){
changeState(DISSAPPEAR);
} else {
m_direction = Define.DIRECTION_NONE;
changeState(RUN);
changeSubState(SUB_SEARCH_FOR_BOMB);
freeEverythingAttached();
};
};
break;
case DISSAPPEAR:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
m_clip.gotoAndPlay("disappear");
m_clip.m_endAnimation = false;
};
if (m_clip.m_endAnimation){
m_clip.m_endAnimation = false;
freeEverythingAttached();
dissapear();
changeState(NONE);
};
break;
case VICTORY:
break;
};
} catch(error:Error) {
if (m_lifes <= 0){
changeState(DISSAPPEAR);
} else {
m_direction = Define.DIRECTION_NONE;
changeState(RUN);
changeSubState(SUB_SEARCH_FOR_BOMB);
freeEverythingAttached();
};
};
return (1);
}
}
}//package game
Section 114
//Player_User (game.Player_User)
package game {
import common.*;
public class Player_User extends Character {
public var m_bomb:Bomb;
public var m_player_mode:Number;
public var m_type_player:Number;
public static var PLAYER_TWO_REFERENCE:Number = 1;
public static var PLAYER_ONE_REFERENCE:Number = 0;
public function Player_User(_arg1:Number, _arg2:gameClip, _arg3:Number, _arg4:Number=0, _arg5:Number=6, _arg6:Number=3, _arg7:Number=18, _arg8:Number=9, _arg9:Number=30, _arg10:Number=20){
var _local11:gameClip_MovieCharacter;
var _local12:gameClip_Leader_Class1;
var _local13:gameClip_Leader_Class2;
var _local14:gameClip_Leader_Class3;
var _local15:gameClip_Leader_Class4;
var _local16:gameClip_Leader_Class5;
var _local17:gameClip_Leader_Class6;
var _local18:gameClip_Leader_Class7;
m_player_mode = _arg4;
m_type_player = _arg3;
switch (m_type_player){
case 0:
_local12 = new gameClip_Leader_Class1();
_local11 = gameClip_MovieCharacter(_local12);
break;
case 1:
_local13 = new gameClip_Leader_Class2();
_local11 = gameClip_MovieCharacter(_local13);
break;
case 2:
_local14 = new gameClip_Leader_Class3();
_local11 = gameClip_MovieCharacter(_local14);
break;
case 3:
_local15 = new gameClip_Leader_Class4();
_local11 = gameClip_MovieCharacter(_local15);
break;
case 4:
_local16 = new gameClip_Leader_Class5();
_local11 = gameClip_MovieCharacter(_local16);
break;
case 5:
_local17 = new gameClip_Leader_Class6();
_local11 = gameClip_MovieCharacter(_local17);
break;
case 6:
_local18 = new gameClip_Leader_Class7();
_local11 = gameClip_MovieCharacter(_local18);
break;
};
super(_arg1, _arg2, _local11, -1, 0, 0, _arg6, _arg6, _arg7, _arg8, _arg9, Define.DIRECTION_NONE, _arg10);
m_type = TYPE_PLAYER;
m_clip.instShield.visible = false;
m_clip.instCircle.visible = false;
m_bomb = null;
changeState(PRESENTATION);
}
public function getInputAction():Boolean{
if (m_player_mode == PLAYER_ONE_REFERENCE){
if (m_gameClip.m_PlayerOne_key_Action_pressed){
m_gameClip.m_PlayerOne_key_Action_pressed = false;
return (true);
};
} else {
if (m_gameClip.m_PlayerTwo_key_Action_pressed){
m_gameClip.m_PlayerTwo_key_Action_pressed = false;
return (true);
};
};
return (false);
}
public function logic():Number{
var _local1:Number;
var _local2:*;
var _local3:Bomb;
if (!m_active){
return (0);
};
if (m_impact > 0){
if (!m_shield){
m_lifes--;
m_gameClip.m_updatePlayersInfo = true;
};
m_impact = 0;
changeState(EXPLOTED);
};
evalutionItem();
switch (m_state){
case PRESENTATION:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
changeSection("presentation");
};
break;
case RUN:
_local1 = getInputDirection();
if (_local1 != m_direction){
if (_local1 != Define.DIRECTION_NONE){
changeDirection("run_", _local1);
} else {
changeDirection("quiet_", _local1);
};
};
moveCharacter();
if (m_bomb != null){
m_bomb.updatePos(m_pos.x, (m_pos.y + 10));
if (getInputAction()){
_local2 = m_direction;
if (_local2 == Define.DIRECTION_NONE){
_local2 = m_lastDirection;
};
m_bomb.throwBomb(_local2, m_vel_throw.x, m_vel_throw.y, m_iterations_throw);
m_bomb = null;
};
} else {
_local3 = m_gameClip.isBombInsideRangeToTake(m_pos, (Define.CIRCLE_DETECTION_BOMB_WIDTH >> 1), (Define.CIRCLE_DETECTION_BOMB_HEIGHT >> 1));
if (_local3 != null){
m_clip.instCircle.visible = true;
if (getInputAction()){
m_bomb = _local3;
m_bomb.takeBomb();
};
} else {
m_clip.instCircle.visible = false;
};
};
break;
case EXPLOTED:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
if (m_shield){
m_timeoutOfShield = 1000;
} else {
m_clip.gotoAndPlay("exploded");
m_clip.m_endAnimation = false;
};
if (m_bomb != null){
m_bomb.throwBomb(Define.DIRECTION_LEFT, 0, 0, 0);
m_bomb = null;
};
};
if (m_shield){
m_timeoutOfShield = (m_timeoutOfShield - m_gameClip.m_gameTimer.m_timeDif);
};
if (((m_clip.m_endAnimation) || (((m_shield) && ((m_timeoutOfShield <= 0)))))){
m_clip.m_endAnimation = false;
m_shield = false;
m_clip.instShield.visible = false;
if (m_lifes <= 0){
changeState(DISSAPPEAR);
} else {
m_direction = Define.DIRECTION_NONE;
changeDirection("run_", Define.DIRECTION_NONE);
changeSection(("run_" + Define.DIRECTION_DOWN));
changeState(RUN);
};
};
break;
case DISSAPPEAR:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
m_clip.gotoAndPlay("disappear");
m_clip.m_endAnimation = false;
};
if (m_clip.m_endAnimation){
m_clip.m_endAnimation = false;
dissapear();
changeState(NONE);
return (0);
};
break;
case VICTORY:
break;
default:
return (0);
};
return (1);
}
public function getInputDirection():Number{
var _local1:Number;
_local1 = Define.DIRECTION_NONE;
if (m_player_mode == PLAYER_ONE_REFERENCE){
if (m_gameClip.m_PlayerOne_key_up_pressed){
_local1 = Define.DIRECTION_UP;
};
if (m_gameClip.m_PlayerOne_key_down_pressed){
_local1 = Define.DIRECTION_DOWN;
};
if (m_gameClip.m_PlayerOne_key_left_pressed){
if (_local1 == Define.DIRECTION_NONE){
_local1 = Define.DIRECTION_LEFT;
} else {
if (_local1 == Define.DIRECTION_UP){
_local1 = Define.DIRECTION_UP_LEFT;
} else {
_local1 = Define.DIRECTION_DOWN_LEFT;
};
};
};
if (m_gameClip.m_PlayerOne_key_right_pressed){
if (_local1 == Define.DIRECTION_NONE){
_local1 = Define.DIRECTION_RIGHT;
} else {
if (_local1 == Define.DIRECTION_UP){
_local1 = Define.DIRECTION_UP_RIGHT;
} else {
_local1 = Define.DIRECTION_DOWN_RIGHT;
};
};
};
} else {
if (m_gameClip.m_PlayerTwo_key_up_pressed){
_local1 = Define.DIRECTION_UP;
};
if (m_gameClip.m_PlayerTwo_key_down_pressed){
_local1 = Define.DIRECTION_DOWN;
};
if (m_gameClip.m_PlayerTwo_key_left_pressed){
if (_local1 == Define.DIRECTION_NONE){
_local1 = Define.DIRECTION_LEFT;
} else {
if (_local1 == Define.DIRECTION_UP){
_local1 = Define.DIRECTION_UP_LEFT;
} else {
_local1 = Define.DIRECTION_DOWN_LEFT;
};
};
};
if (m_gameClip.m_PlayerTwo_key_right_pressed){
if (_local1 == Define.DIRECTION_NONE){
_local1 = Define.DIRECTION_RIGHT;
} else {
if (_local1 == Define.DIRECTION_UP){
_local1 = Define.DIRECTION_UP_RIGHT;
} else {
_local1 = Define.DIRECTION_DOWN_RIGHT;
};
};
};
};
return (_local1);
}
}
}//package game
Section 115
//clipLogo (miscelanea.clipLogo)
package miscelanea {
import flash.display.*;
public dynamic class clipLogo extends MovieClip {
public function clipLogo(){
addFrameScript(228, frame229);
}
function frame229(){
stop();
MovieClip(root).gotoAndPlay("introBomber");
}
}
}//package miscelanea
Section 116
//MochiAd (mochiads.MochiAd)
package mochiads {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.1");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package mochiads
Section 117
//Sound_FxBombExplosion (sounds.Sound_FxBombExplosion)
package sounds {
import flash.media.*;
public class Sound_FxBombExplosion extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 118
//Sound_FxItemLife (sounds.Sound_FxItemLife)
package sounds {
import common.*;
import flash.media.*;
public class Sound_FxItemLife extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
if (Define.DEBUG_GENERAL){
trace((("Sound_FxItemLife: PLAY SOUND(" + _arg1) + ")"));
};
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 119
//Sound_FxItemShield (sounds.Sound_FxItemShield)
package sounds {
import common.*;
import flash.media.*;
public class Sound_FxItemShield extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
if (Define.DEBUG_GENERAL){
trace((("Sound_FxItemShield: PLAY SOUND(" + _arg1) + ")"));
};
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 120
//Sound_FxItemSpeedUp (sounds.Sound_FxItemSpeedUp)
package sounds {
import common.*;
import flash.media.*;
public class Sound_FxItemSpeedUp extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
if (Define.DEBUG_GENERAL){
trace((("Sound_FxItemSpeedUp: PLAY SOUND(" + _arg1) + ")"));
};
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 121
//Sound_FxItemStrength (sounds.Sound_FxItemStrength)
package sounds {
import common.*;
import flash.media.*;
public class Sound_FxItemStrength extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
if (Define.DEBUG_GENERAL){
trace((("Sound_FxItemStrength: PLAY SOUND(" + _arg1) + ")"));
};
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 122
//Sound_FxSelection (sounds.Sound_FxSelection)
package sounds {
import flash.media.*;
public class Sound_FxSelection extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 123
//Sound_Loop_1 (sounds.Sound_Loop_1)
package sounds {
import flash.media.*;
public class Sound_Loop_1 extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 124
//Sound_Loop_2 (sounds.Sound_Loop_2)
package sounds {
import flash.media.*;
public class Sound_Loop_2 extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 125
//Sound_Loop_3 (sounds.Sound_Loop_3)
package sounds {
import flash.media.*;
public class Sound_Loop_3 extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 126
//Sound_MelodyLose (sounds.Sound_MelodyLose)
package sounds {
import flash.media.*;
public class Sound_MelodyLose extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 127
//Sound_MelodyMenu (sounds.Sound_MelodyMenu)
package sounds {
import flash.media.*;
public class Sound_MelodyMenu extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 128
//Sound_MelodyPresentationClubs (sounds.Sound_MelodyPresentationClubs)
package sounds {
import flash.media.*;
public class Sound_MelodyPresentationClubs extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 129
//Sound_MelodyVictory (sounds.Sound_MelodyVictory)
package sounds {
import flash.media.*;
public class Sound_MelodyVictory extends Sound {
public var sound:SoundChannel;
public function playSound(_arg1:Number){
sound = play(0, _arg1);
}
public function stopSound(){
sound.stop();
}
}
}//package sounds
Section 130
//SoundsGame (sounds.SoundsGame)
package sounds {
import common.*;
public class SoundsGame {
public var m_consumedMainMelodyMenu:Boolean;
public var m_soundEnabled:Boolean;
public var m_indexCurrentSound:Number;
public var m_sounds:Array;
public static var SOUNDS_SELECTION:Number = 1;
public static var SOUNDS_FX_ITEM_SHIELD:Number = 8;
public static var SOUNDS_PRESENTATION_CLUB:Number = 12;
public static var SOUNDS_MELODY_MENU:Number = 0;
public static var SOUNDS_FX_ITEM_LIFE:Number = 9;
public static var SOUNDS_FX_ITEM_STRENGTH:Number = 7;
public static var SOUNDS_FX_ITEM_SPEEDUP:Number = 6;
public static var SOUNDS_FX_BOMB_EXPLOSION:Number = 5;
public static var SOUNDS_LOSE:Number = 11;
public static var SOUNDS_LOOP_2:Number = 3;
public static var SOUNDS_LOOP_3:Number = 4;
public static var SOUNDS_VICTORY:Number = 10;
public static var SOUNDS_LOOP_1:Number = 2;
public function SoundsGame(){
m_sounds = new Array();
m_indexCurrentSound = -1;
m_soundEnabled = true;
m_consumedMainMelodyMenu = true;
loadGameSound(SOUNDS_MELODY_MENU);
loadGameSound(SOUNDS_SELECTION);
loadGameSound(SOUNDS_LOOP_1);
loadGameSound(SOUNDS_LOOP_2);
loadGameSound(SOUNDS_LOOP_3);
loadGameSound(SOUNDS_FX_BOMB_EXPLOSION);
loadGameSound(SOUNDS_FX_ITEM_SPEEDUP);
loadGameSound(SOUNDS_FX_ITEM_STRENGTH);
loadGameSound(SOUNDS_FX_ITEM_SHIELD);
loadGameSound(SOUNDS_FX_ITEM_LIFE);
loadGameSound(SOUNDS_VICTORY);
loadGameSound(SOUNDS_LOSE);
loadGameSound(SOUNDS_PRESENTATION_CLUB);
}
public function playGameSound(_arg1:Number, _arg2:Number){
m_indexCurrentSound = _arg1;
if (Define.ENABLE_SOUND){
switch (_arg1){
case SOUNDS_MELODY_MENU:
Sound_MelodyMenu(m_sounds[SOUNDS_MELODY_MENU]).playSound(_arg2);
break;
case SOUNDS_SELECTION:
Sound_FxSelection(m_sounds[SOUNDS_SELECTION]).playSound(_arg2);
break;
case SOUNDS_LOOP_1:
Sound_Loop_1(m_sounds[SOUNDS_LOOP_1]).playSound(_arg2);
break;
case SOUNDS_LOOP_2:
Sound_Loop_2(m_sounds[SOUNDS_LOOP_2]).playSound(_arg2);
break;
case SOUNDS_LOOP_3:
Sound_Loop_3(m_sounds[SOUNDS_LOOP_3]).playSound(_arg2);
break;
case SOUNDS_FX_BOMB_EXPLOSION:
Sound_FxBombExplosion(m_sounds[SOUNDS_FX_BOMB_EXPLOSION]).playSound(_arg2);
break;
case SOUNDS_FX_ITEM_SPEEDUP:
Sound_FxItemSpeedUp(m_sounds[SOUNDS_FX_ITEM_SPEEDUP]).playSound(_arg2);
break;
case SOUNDS_FX_ITEM_STRENGTH:
Sound_FxItemStrength(m_sounds[SOUNDS_FX_ITEM_STRENGTH]).playSound(_arg2);
break;
case SOUNDS_FX_ITEM_SHIELD:
Sound_FxItemShield(m_sounds[SOUNDS_FX_ITEM_SHIELD]).playSound(_arg2);
break;
case SOUNDS_FX_ITEM_LIFE:
Sound_FxItemLife(m_sounds[SOUNDS_FX_ITEM_LIFE]).playSound(_arg2);
break;
case SOUNDS_VICTORY:
Sound_MelodyVictory(m_sounds[SOUNDS_VICTORY]).playSound(_arg2);
break;
case SOUNDS_LOSE:
Sound_MelodyLose(m_sounds[SOUNDS_LOSE]).playSound(_arg2);
break;
case SOUNDS_PRESENTATION_CLUB:
Sound_MelodyPresentationClubs(m_sounds[SOUNDS_PRESENTATION_CLUB]).playSound(_arg2);
break;
};
};
}
public function stopGameSound(_arg1:Number){
var p_index = _arg1;
try {
switch (p_index){
case SOUNDS_MELODY_MENU:
Sound_MelodyMenu(m_sounds[SOUNDS_MELODY_MENU]).stopSound();
break;
case SOUNDS_SELECTION:
Sound_FxSelection(m_sounds[SOUNDS_SELECTION]).stopSound();
break;
case SOUNDS_LOOP_1:
Sound_Loop_1(m_sounds[SOUNDS_LOOP_1]).stopSound();
break;
case SOUNDS_LOOP_2:
Sound_Loop_2(m_sounds[SOUNDS_LOOP_2]).stopSound();
break;
case SOUNDS_LOOP_3:
Sound_Loop_3(m_sounds[SOUNDS_LOOP_3]).stopSound();
break;
case SOUNDS_FX_BOMB_EXPLOSION:
Sound_FxBombExplosion(m_sounds[SOUNDS_FX_BOMB_EXPLOSION]).stopSound();
break;
case SOUNDS_FX_ITEM_SPEEDUP:
Sound_FxItemSpeedUp(m_sounds[SOUNDS_FX_ITEM_SPEEDUP]).stopSound();
break;
case SOUNDS_FX_ITEM_STRENGTH:
Sound_FxItemStrength(m_sounds[SOUNDS_FX_ITEM_STRENGTH]).stopSound();
break;
case SOUNDS_FX_ITEM_SHIELD:
Sound_FxItemShield(m_sounds[SOUNDS_FX_ITEM_SHIELD]).stopSound();
break;
case SOUNDS_FX_ITEM_LIFE:
Sound_FxItemLife(m_sounds[SOUNDS_FX_ITEM_LIFE]).stopSound();
break;
case SOUNDS_VICTORY:
Sound_MelodyVictory(m_sounds[SOUNDS_VICTORY]).stopSound();
break;
case SOUNDS_LOSE:
Sound_MelodyLose(m_sounds[SOUNDS_LOSE]).stopSound();
break;
case SOUNDS_PRESENTATION_CLUB:
Sound_MelodyPresentationClubs(m_sounds[SOUNDS_PRESENTATION_CLUB]).stopSound();
break;
};
} catch(err:Error) {
if (Define.DEBUG_GENERAL){
trace(((("SoundsGame. Error en sound(" + p_index) + ")=") + err.toString()));
};
};
}
public function stopAllGameSounds(){
var _local1:*;
_local1 = 0;
while (_local1 < m_sounds.length) {
stopGameSound(_local1);
_local1++;
};
}
public function loadGameSound(_arg1:Number){
switch (_arg1){
case SOUNDS_MELODY_MENU:
m_sounds.push(new Sound_MelodyMenu());
break;
case SOUNDS_SELECTION:
m_sounds.push(new Sound_FxSelection());
break;
case SOUNDS_LOOP_1:
m_sounds.push(new Sound_Loop_1());
break;
case SOUNDS_LOOP_2:
m_sounds.push(new Sound_Loop_2());
break;
case SOUNDS_LOOP_3:
m_sounds.push(new Sound_Loop_3());
break;
case SOUNDS_FX_BOMB_EXPLOSION:
m_sounds.push(new Sound_FxBombExplosion());
break;
case SOUNDS_FX_ITEM_SPEEDUP:
m_sounds.push(new Sound_FxItemSpeedUp());
break;
case SOUNDS_FX_ITEM_STRENGTH:
m_sounds.push(new Sound_FxItemStrength());
break;
case SOUNDS_FX_ITEM_SHIELD:
m_sounds.push(new Sound_FxItemShield());
break;
case SOUNDS_FX_ITEM_LIFE:
m_sounds.push(new Sound_FxItemLife());
break;
case SOUNDS_VICTORY:
m_sounds.push(new Sound_MelodyVictory());
break;
case SOUNDS_LOSE:
m_sounds.push(new Sound_MelodyLose());
break;
case SOUNDS_PRESENTATION_CLUB:
m_sounds.push(new Sound_MelodyPresentationClubs());
break;
};
}
}
}//package sounds
Section 131
//gameClip_Upgrade (upgrade.gameClip_Upgrade)
package upgrade {
import flash.display.*;
import flash.events.*;
import sounds.*;
import common.*;
public class gameClip_Upgrade extends MovieClip {
public var m_numberOfUpgradesAvailable_A:Number;
public var m_numberOfUpgradesAvailable_B:Number;
public var instPlayUpgrade:gameClip_Upgrade_Play;
public var m_gameClip:gameClip;
public var instUpgradePanel1:gameClip_UpgradePanel;
public var instUpgradePanel2:gameClip_UpgradePanel;
public function gameClip_Upgrade(_arg1:gameClip, _arg2:Number=1){
m_gameClip = _arg1;
m_numberOfUpgradesAvailable_A = _arg2;
m_numberOfUpgradesAvailable_B = _arg2;
instPlayUpgrade.visible = false;
instPlayUpgrade.enabled = false;
instUpgradePanel1.instSpeed.gotoAndStop((Math.floor(((m_gameClip.m_s1_velBase_x - Define.SPEED_CHARACTER_MINIM) / Define.SPEED_CHARACTER_INCREMENT)) + 1));
instUpgradePanel1.instStrength.gotoAndStop((Math.floor(((m_gameClip.m_s1_velThrow_x - Define.STRENGTH_CHARACTER_MINIM) / Define.STRENGTH_CHARACTER_INCREMENT)) + 1));
instUpgradePanel1.instLifes.gotoAndStop(m_gameClip.m_s1_initalLifes);
instUpgradePanel1.intCharacterToUpgrade.gotoAndStop(("player" + (m_gameClip.m_playerOneCharacter + 1)));
if (m_gameClip.m_numberUserPlaying == 2){
instUpgradePanel2.intCharacterToUpgrade.gotoAndStop(("player" + (m_gameClip.m_playerTwoCharacter + 1)));
instUpgradePanel2.instSpeed.gotoAndStop((Math.floor(((m_gameClip.m_s2_velBase_x - Define.SPEED_CHARACTER_MINIM) / Define.SPEED_CHARACTER_INCREMENT)) + 1));
instUpgradePanel2.instStrength.gotoAndStop((Math.floor(((m_gameClip.m_s2_velThrow_x - Define.STRENGTH_CHARACTER_MINIM) / Define.STRENGTH_CHARACTER_INCREMENT)) + 1));
instUpgradePanel2.instLifes.gotoAndStop(m_gameClip.m_s2_initalLifes);
} else {
instUpgradePanel2.visible = false;
};
instPlayUpgrade.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel1.instAddSpeed.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel1.instAddStrength.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel1.instAddLifes.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
if (m_gameClip.m_numberUserPlaying == 2){
instUpgradePanel2.instAddSpeed.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel2.instAddStrength.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel2.instAddLifes.addEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
};
}
public function disableButtons(_arg1:Number):void{
if (_arg1 == 0){
instUpgradePanel1.instAddSpeed.enabled = false;
instUpgradePanel1.instAddSpeed.visible = false;
instUpgradePanel1.instAddSpeed.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel1.instAddStrength.enabled = false;
instUpgradePanel1.instAddStrength.visible = false;
instUpgradePanel1.instAddStrength.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel1.instAddLifes.enabled = false;
instUpgradePanel1.instAddLifes.visible = false;
instUpgradePanel1.instAddLifes.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
} else {
instUpgradePanel2.instAddSpeed.enabled = false;
instUpgradePanel2.instAddSpeed.visible = false;
instUpgradePanel2.instAddSpeed.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel2.instAddStrength.enabled = false;
instUpgradePanel2.instAddStrength.visible = false;
instUpgradePanel2.instAddStrength.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
instUpgradePanel2.instAddLifes.enabled = false;
instUpgradePanel2.instAddLifes.visible = false;
instUpgradePanel2.instAddLifes.removeEventListener(MouseEvent.MOUSE_DOWN, releaseButtons);
};
if (m_gameClip.m_numberUserPlaying == 2){
if ((((m_numberOfUpgradesAvailable_A <= 0)) && ((m_numberOfUpgradesAvailable_B <= 0)))){
instPlayUpgrade.visible = true;
instPlayUpgrade.enabled = true;
};
} else {
instPlayUpgrade.visible = true;
instPlayUpgrade.enabled = true;
};
}
public function releaseButtons(_arg1:MouseEvent):void{
m_gameClip.m_soundManager.playGameSound(SoundsGame.SOUNDS_SELECTION, 1);
if (_arg1.currentTarget == instPlayUpgrade){
alpha = 99;
};
if (_arg1.currentTarget == instUpgradePanel1.instAddSpeed){
if (Define.DEBUG_GENERAL){
trace("**gameClip_Upgrade: PRESSED instUpgradePanel1.instAddSpeed");
};
m_gameClip.m_s1_velBase_x = (m_gameClip.m_s1_velBase_x + Define.SPEED_CHARACTER_INCREMENT);
m_gameClip.m_s1_velBase_y = (m_gameClip.m_s1_velBase_y + (Define.SPEED_CHARACTER_INCREMENT / 2));
instUpgradePanel1.instSpeed.gotoAndStop((Math.floor(((m_gameClip.m_s1_velBase_x - Define.SPEED_CHARACTER_MINIM) / Define.SPEED_CHARACTER_INCREMENT)) + 1));
m_numberOfUpgradesAvailable_A--;
if (m_numberOfUpgradesAvailable_A <= 0){
disableButtons(0);
};
};
if (_arg1.currentTarget == instUpgradePanel1.instAddStrength){
if (Define.DEBUG_GENERAL){
trace("**gameClip_Upgrade: PRESSED instUpgradePanel1.instAddStrength");
};
m_gameClip.m_s1_velThrow_x = (m_gameClip.m_s1_velThrow_x + Define.STRENGTH_CHARACTER_INCREMENT);
m_gameClip.m_s1_velThrow_y = (m_gameClip.m_s1_velThrow_y + (Define.STRENGTH_CHARACTER_INCREMENT / 2));
m_gameClip.m_s1_iterations_throw = (m_gameClip.m_s1_iterations_throw + Define.ITERATIONS_STRENGTH_CHARACTER_INCREMENT);
if (m_gameClip.m_s1_iterations_throw > Define.ITERATIONS_STRENGTH_CHARACTER_MAXIMUM){
m_gameClip.m_s1_iterations_throw = Define.ITERATIONS_STRENGTH_CHARACTER_MAXIMUM;
};
instUpgradePanel1.instStrength.gotoAndStop((Math.floor(((m_gameClip.m_s1_velThrow_x - Define.STRENGTH_CHARACTER_MINIM) / Define.STRENGTH_CHARACTER_INCREMENT)) + 1));
m_numberOfUpgradesAvailable_A--;
if (m_numberOfUpgradesAvailable_A <= 0){
disableButtons(0);
};
};
if (_arg1.currentTarget == instUpgradePanel1.instAddLifes){
if (Define.DEBUG_GENERAL){
trace("**gameClip_Upgrade: PRESSED instUpgradePanel1.instAddLifes");
};
m_gameClip.m_s1_initalLifes = (m_gameClip.m_s1_initalLifes + Define.LIFE_CHARACTER_INCREMENT);
instUpgradePanel1.instLifes.gotoAndStop(m_gameClip.m_s1_initalLifes);
m_numberOfUpgradesAvailable_A--;
if (m_numberOfUpgradesAvailable_A <= 0){
disableButtons(0);
};
};
if (_arg1.currentTarget == instUpgradePanel2.instAddSpeed){
if (Define.DEBUG_GENERAL){
trace("**gameClip_Upgrade: PRESSED instUpgradePanel2.instAddSpeed");
};
m_gameClip.m_s2_velBase_x = (m_gameClip.m_s2_velBase_x + Define.SPEED_CHARACTER_INCREMENT);
m_gameClip.m_s2_velBase_y = (m_gameClip.m_s2_velBase_y + (Define.SPEED_CHARACTER_INCREMENT / 2));
instUpgradePanel2.instSpeed.gotoAndStop((Math.floor(((m_gameClip.m_s2_velBase_x - Define.SPEED_CHARACTER_MINIM) / Define.SPEED_CHARACTER_INCREMENT)) + 1));
m_numberOfUpgradesAvailable_B--;
if (m_numberOfUpgradesAvailable_B <= 0){
disableButtons(1);
};
};
if (_arg1.currentTarget == instUpgradePanel2.instAddStrength){
if (Define.DEBUG_GENERAL){
trace("**gameClip_Upgrade: PRESSED instUpgradePanel2.instAddStrength");
};
m_gameClip.m_s2_velThrow_x = (m_gameClip.m_s2_velThrow_x + Define.STRENGTH_CHARACTER_INCREMENT);
m_gameClip.m_s2_velThrow_y = (m_gameClip.m_s2_velThrow_y + (Define.STRENGTH_CHARACTER_INCREMENT / 2));
m_gameClip.m_s2_iterations_throw = (m_gameClip.m_s2_iterations_throw + Define.ITERATIONS_STRENGTH_CHARACTER_INCREMENT);
if (m_gameClip.m_s2_iterations_throw > Define.ITERATIONS_STRENGTH_CHARACTER_MAXIMUM){
m_gameClip.m_s2_iterations_throw = Define.ITERATIONS_STRENGTH_CHARACTER_MAXIMUM;
};
instUpgradePanel2.instStrength.gotoAndStop((Math.floor(((m_gameClip.m_s2_velThrow_x - Define.STRENGTH_CHARACTER_MINIM) / Define.STRENGTH_CHARACTER_INCREMENT)) + 1));
m_numberOfUpgradesAvailable_B--;
if (m_numberOfUpgradesAvailable_B <= 0){
disableButtons(1);
};
};
if (_arg1.currentTarget == instUpgradePanel2.instAddLifes){
if (Define.DEBUG_GENERAL){
trace("**gameClip_Upgrade: PRESSED instUpgradePanel2.instAddLifes");
};
m_gameClip.m_s2_initalLifes = (m_gameClip.m_s2_initalLifes + Define.LIFE_CHARACTER_INCREMENT);
instUpgradePanel2.instLifes.gotoAndStop(m_gameClip.m_s2_initalLifes);
m_numberOfUpgradesAvailable_B--;
if (m_numberOfUpgradesAvailable_B <= 0){
disableButtons(1);
};
};
}
}
}//package upgrade
Section 132
//gameClip_Upgrade_Add (upgrade.gameClip_Upgrade_Add)
package upgrade {
import flash.display.*;
public dynamic class gameClip_Upgrade_Add extends SimpleButton {
}
}//package upgrade
Section 133
//gameClip_Upgrade_DataBar (upgrade.gameClip_Upgrade_DataBar)
package upgrade {
import flash.display.*;
public dynamic class gameClip_Upgrade_DataBar extends MovieClip {
}
}//package upgrade
Section 134
//gameClip_Upgrade_Play (upgrade.gameClip_Upgrade_Play)
package upgrade {
import flash.display.*;
public dynamic class gameClip_Upgrade_Play extends SimpleButton {
}
}//package upgrade
Section 135
//gameClip_UpgradePanel (upgrade.gameClip_UpgradePanel)
package upgrade {
import flash.display.*;
public dynamic class gameClip_UpgradePanel extends MovieClip {
public var instAddStrength:gameClip_Upgrade_Add;
public var instAddLifes:gameClip_Upgrade_Add;
public var intCharacterToUpgrade:MovieClip;
public var instLifes:gameClip_Upgrade_DataBar;
public var instSpeed:gameClip_Upgrade_DataBar;
public var instStrength:gameClip_Upgrade_DataBar;
public var instAddSpeed:gameClip_Upgrade_Add;
}
}//package upgrade
Section 136
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 137
//gameBackgrounds (gameBackgrounds)
package {
import flash.display.*;
public dynamic class gameBackgrounds extends MovieClip {
}
}//package
Section 138
//gameClip (gameClip)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import fl.managers.*;
import sounds.*;
import game.*;
import common.*;
import flash.media.*;
import upgrade.*;
import flash.net.*;
import flash.ui.*;
public class gameClip extends Sprite {
public var m_iterator:Number;
public var m_gameClip_EndGame:gameClip_EndGame;
public var m_soundManager:SoundsGame;
public var m_PlayerOne_key_right_pressed:Boolean;
public var m_PlayerOne_key_left_pressed:Boolean;
public var m_s1_velBase_x:Number;
public var m_state:Number;
public var m_lastState:Number;
public var m_playerTwo:Player_User;
public var m_s1_velBase_y:Number;
public var m_listPlayers:Array;
public var m_s2_initalLifes:Number;
public var m_listItems:Array;
public var m_isHistoryMode:Boolean;
public var m_playerOne:Player_User;
public var m_PlayerOne_key_Action_pressed:Boolean;
public var m_PlayerTwo_key_right_pressed:Boolean;
public var m_timeAcumulated:Number;
public var m_PlayerTwo_key_down_pressed:Boolean;
public var m_gameClip_Upgrade:gameClip_Upgrade;
public var m_listBombs:Array;
public var m_playerTwoCharacter:Number;
public var m_s2_velThrow_y:Number;
public var m_s2_velThrow_x:Number;
public var m_PlayerTwo_key_Action_pressed:Boolean;
public var m_presentationShortMovie:gameClip_ShortLevelIntro;
public var m_playersUnlocked:Number;
public var m_s2_velBase_x:Number;
public var m_s2_velBase_y:Number;
public var m_PlayerTwo_key_left_pressed:Boolean;
public var m_playerSanta:Player_Santa;
public var m_PlayerTwo_key_up_pressed:Boolean;
public var m_gameTimer:gameTimer;
public var m_maximumNumberOfBombs:Number;
public var m_startText:gameClip_StartText;
public var m_gameLevel:Number;
public var m_s1_velThrow_x:Number;
public var m_s1_velThrow_y:Number;
public var m_levelsUnlocked:Number;
public var m_numberUserPlaying:Number;
public var m_updatePlayersInfo:Boolean;
public var m_moviePause:pauseScreen;
public var m_PlayerOne_key_up_pressed:Boolean;
public var m_s1_iterations_throw:Number;
public var m_PlayerOne_key_down_pressed:Boolean;
public var m_gameBackgrounds:gameBackgrounds;
public var m_s2_iterations_throw:Number;
public var m_s1_initalLifes:Number;
public var m_playerOneCharacter:Number;
public static var STATE_GAME_UPGRADE_PLAYER:Number = 5;
public static var STATE_GAME_LOADING:Number = 0;
public static var STATE_GAME_RUN:Number = 2;
public static var STATE_GAME_LOSE:Number = 4;
public static var STATE_GAME_NONE:Number = -1;
public static var STATE_GAME_PRESENTATION:Number = 1;
public static var STATE_GAME_END:Number = 7;
public static var STATE_GAME_WIN:Number = 3;
public static var STATE_GAME_PAUSE:Number = 6;
public function gameClip(_arg1:SoundsGame=null, _arg2:Number=0, _arg3:Number=-1, _arg4:Number=-1, _arg5:Boolean=true, _arg6:Number=2, _arg7:Number=2){
m_playersUnlocked = _arg6;
m_levelsUnlocked = _arg7;
m_isHistoryMode = _arg5;
m_gameLevel = _arg2;
m_playerOneCharacter = _arg3;
m_playerTwoCharacter = _arg4;
if (m_playerTwoCharacter == -1){
m_numberUserPlaying = 1;
} else {
m_numberUserPlaying = 2;
};
m_soundManager = _arg1;
m_updatePlayersInfo = false;
m_PlayerOne_key_up_pressed = false;
m_PlayerOne_key_down_pressed = false;
m_PlayerOne_key_left_pressed = false;
m_PlayerOne_key_right_pressed = false;
m_PlayerOne_key_Action_pressed = false;
m_PlayerTwo_key_up_pressed = false;
m_PlayerTwo_key_down_pressed = false;
m_PlayerTwo_key_left_pressed = false;
m_PlayerTwo_key_right_pressed = false;
m_PlayerTwo_key_Action_pressed = false;
m_s1_velBase_x = Define.GAME_PLAYERS_CHARACTERIST[m_playerOneCharacter][0];
m_s1_velBase_y = Define.GAME_PLAYERS_CHARACTERIST[m_playerOneCharacter][1];
m_s1_velThrow_x = Define.GAME_PLAYERS_CHARACTERIST[m_playerOneCharacter][2];
m_s1_velThrow_y = Define.GAME_PLAYERS_CHARACTERIST[m_playerOneCharacter][3];
m_s1_iterations_throw = Define.GAME_PLAYERS_CHARACTERIST[m_playerOneCharacter][4];
m_s1_initalLifes = Define.GAME_PLAYERS_CHARACTERIST[m_playerOneCharacter][5];
if (m_numberUserPlaying == 2){
m_s2_velBase_x = Define.GAME_PLAYERS_CHARACTERIST[m_playerTwoCharacter][0];
m_s2_velBase_y = Define.GAME_PLAYERS_CHARACTERIST[m_playerTwoCharacter][1];
m_s2_velThrow_x = Define.GAME_PLAYERS_CHARACTERIST[m_playerTwoCharacter][2];
m_s2_velThrow_y = Define.GAME_PLAYERS_CHARACTERIST[m_playerTwoCharacter][3];
m_s2_iterations_throw = Define.GAME_PLAYERS_CHARACTERIST[m_playerTwoCharacter][4];
m_s2_initalLifes = Define.GAME_PLAYERS_CHARACTERIST[m_playerTwoCharacter][5];
};
changeState(STATE_GAME_LOADING);
addEventListener(Event.ENTER_FRAME, mainGameLogic);
}
public function isBombInsideRangeToTake(_arg1:Point, _arg2:int, _arg3:int):Bomb{
var _local4:Bomb;
_local4 = getNearestBombToTake(_arg1, 0, false);
if (_local4 != null){
if ((((Math.abs((_local4.m_pos.x - _arg1.x)) < _arg2)) && ((Math.abs((_local4.m_pos.y - _arg1.y)) < _arg3)))){
return (_local4);
};
};
return (null);
}
public function initPlayfieldElements():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:int;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Player_Student;
var _local16:Bomb;
var _local17:int;
var _local18:int;
var _local19:Item;
m_gameBackgrounds = new gameBackgrounds();
addChild(m_gameBackgrounds);
m_gameBackgrounds.x = 0;
m_gameBackgrounds.y = 0;
m_gameBackgrounds.gotoAndStop(("classroom" + (m_gameLevel + 1)));
m_listPlayers = new Array();
if (Define.DEBUG_GENERAL){
trace(("+A+ m_playerOneCharacter=" + m_playerOneCharacter));
};
m_playerOne = new Player_User(m_listPlayers.length, this, m_playerOneCharacter, 0, m_s1_velBase_x, m_s1_velBase_y, m_s1_velThrow_x, m_s1_velThrow_y, m_s1_iterations_throw, m_s1_initalLifes);
m_listPlayers.push(m_playerOne);
m_gameBackgrounds.addChild(m_playerOne);
m_playerOne.initPosition(new Point(Define.GAME_INITIAL_POSITIONS[m_gameLevel][0][0], Define.GAME_INITIAL_POSITIONS[m_gameLevel][0][1]));
if (m_numberUserPlaying == 2){
if (Define.DEBUG_GENERAL){
trace(("+B+ m_playerTwoCharacter=" + m_playerTwoCharacter));
};
m_playerTwo = new Player_User(m_listPlayers.length, this, m_playerTwoCharacter, 1, m_s2_velBase_x, m_s2_velBase_y, m_s2_velThrow_x, m_s2_velThrow_y, m_s2_iterations_throw, m_s2_initalLifes);
m_listPlayers.push(m_playerTwo);
m_gameBackgrounds.addChild(m_playerTwo);
m_playerTwo.initPosition(new Point(Define.GAME_INITIAL_POSITIONS[m_gameLevel][1][0], Define.GAME_INITIAL_POSITIONS[m_gameLevel][1][1]));
};
m_gameTimer.setUpPlayers(1, m_playerOneCharacter, 1, m_playerTwoCharacter);
m_gameTimer.updatePlayers(m_playerOneCharacter, m_s1_initalLifes, m_playerTwoCharacter, m_s2_initalLifes);
_local2 = 7.5;
_local3 = 3.5;
switch (m_gameLevel){
default:
break;
};
if (Define.randRange(0, 10) < 5){
_local2 = -(_local2);
};
if (Define.randRange(0, 10) < 5){
_local3 = -(_local3);
};
m_playerSanta = new Player_Santa(m_listPlayers.length, this, _local2, _local3);
m_listPlayers.push(m_playerSanta);
m_gameBackgrounds.addChild(m_playerSanta);
m_playerSanta.initPosition(new Point((Define.GAME_AREA_WIDTH / 2), ((Define.GAME_AREA_HEIGHT / 2) + Define.TIMER_AREA_HEIGHT)));
_local1 = 2;
while (_local1 < Define.GAME_INITIAL_POSITIONS[m_gameLevel].length) {
_local5 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][0];
_local6 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][1];
_local7 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][2];
_local8 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][3];
_local9 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][4];
_local10 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][5];
_local11 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][6];
_local12 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][7];
_local13 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][8];
_local14 = Define.GAME_INITIAL_POSITIONS[m_gameLevel][_local1][9];
_local15 = new Player_Student(m_listPlayers.length, this, m_gameLevel, _local5, _local8, _local9, _local10, _local11, _local12, _local13, _local14);
m_listPlayers.push(_local15);
m_gameBackgrounds.addChild(_local15);
_local15.initPosition(new Point(_local6, _local7));
m_gameTimer.pushNewEnemy((_local5 + 1), (m_gameLevel + 1), _local14);
_local1++;
};
m_maximumNumberOfBombs = Define.BOMB_LEVEL_CONFIGURATION[m_gameLevel];
m_listBombs = new Array();
_local1 = 0;
while (_local1 < m_maximumNumberOfBombs) {
_local16 = new Bomb(_local1, this);
m_listBombs.push(_local16);
m_gameBackgrounds.addChild(_local16);
_local1++;
};
_local4 = Define.randRange(4, m_maximumNumberOfBombs);
while (_local4 > 0) {
_local17 = Define.randRange((Character.WALL_SPACE * 2), (Define.GAME_AREA_WIDTH - (Character.WALL_SPACE * 2)));
_local18 = Define.randRange(Character.CHARACTER_HEIGHT, (Define.GAME_AREA_HEIGHT - (Character.WALL_SPACE * 2)));
insertNewBomb(_local17, _local18, Define.randRange(6, 20), 1);
_local4--;
};
m_listItems = new Array();
_local1 = 0;
while (_local1 < Define.TOTAL_NUMBER_OF_ITEMS) {
_local19 = new Item(_local1, this);
m_listItems.push(_local19);
m_gameBackgrounds.addChild(_local19);
_local1++;
};
}
public function starNewLevel():void{
m_gameLevel++;
changeState(STATE_GAME_LOADING);
}
public function exploteBombsAffected(_arg1:Point, _arg2:Number, _arg3:Number):void{
var _local4:*;
do {
_local4 = isBombInsideRangeActive(_arg1, _arg2, _arg3);
if (_local4 != null){
_local4.changeState(Character.EXPLOTED);
};
} while (_local4 != null);
}
public function resetInputKeys(){
m_PlayerOne_key_up_pressed = false;
m_PlayerOne_key_down_pressed = false;
m_PlayerOne_key_left_pressed = false;
m_PlayerOne_key_right_pressed = false;
m_PlayerOne_key_Action_pressed = false;
m_PlayerTwo_key_up_pressed = false;
m_PlayerTwo_key_down_pressed = false;
m_PlayerTwo_key_left_pressed = false;
m_PlayerTwo_key_right_pressed = false;
}
public function getNumberOfActiveBombs():Number{
var _local1:int;
var _local2:int;
var _local3:Bomb;
_local2 = 0;
_local1 = 0;
while (_local1 < m_listBombs.length) {
_local3 = Bomb(m_listBombs[_local1]);
if (_local3.m_active){
_local2++;
};
_local1++;
};
return (_local2);
}
public function exploteAllBombsAffected():void{
var _local1:*;
var _local2:Bomb;
_local1 = 0;
while (_local1 < m_listBombs.length) {
_local2 = Bomb(m_listBombs[_local1]);
if (((_local2.m_active) && (!((_local2.m_state == Character.EXPLOTED))))){
_local2.changeState(Character.EXPLOTED);
};
_local1++;
};
}
public function getNearestBombActive(_arg1:Point):Bomb{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Bomb;
var _local6:Bomb;
_local4 = 100000000;
_local2 = 0;
while (_local2 < m_listBombs.length) {
_local6 = Bomb(m_listBombs[_local2]);
if (((_local6.m_active) && (!((_local6.m_state == Character.EXPLOTED))))){
_local3 = Point.distance(_arg1, _local6.m_pos);
if (_local3 < _local4){
_local4 = _local3;
_local5 = _local6;
};
};
_local2++;
};
return (_local5);
}
public function changeState(_arg1:Number){
m_iterator = 0;
m_lastState = m_state;
m_state = _arg1;
m_timeAcumulated = 0;
if (Define.DEBUG_GENERAL){
switch (m_state){
case STATE_GAME_NONE:
trace("m_state=STATE_GAME_NONE");
break;
case STATE_GAME_LOADING:
trace("m_state=STATE_GAME_LOADING");
break;
case STATE_GAME_PRESENTATION:
trace("m_state=STATE_GAME_PRESENTATION");
break;
case STATE_GAME_RUN:
trace("m_state=STATE_GAME_RUN");
break;
case STATE_GAME_WIN:
trace("m_state=STATE_GAME_WIN");
break;
case STATE_GAME_LOSE:
trace("m_state=STATE_GAME_LOSE");
break;
case STATE_GAME_PAUSE:
trace("m_state=STATE_GAME_PAUSE");
break;
};
};
}
public function mainGameLogic(_arg1:Event):void{
var i:int;
var stud:Player_Student;
var sbomb:Bomb;
var sitem:Item;
var sNumberActiveUsers:Number;
var sNumberActiveStudents:Number;
var tmpInitial:Number;
var fm:FocusManager;
var selChar:Character;
var gameResultVictory:gameResult;
var gameResultLose:gameResult;
var numOfUpgradesLocal:Number;
var evt = _arg1;
sNumberActiveUsers = 0;
sNumberActiveStudents = 0;
switch (m_state){
case STATE_GAME_LOADING:
if (m_gameClip_Upgrade != null){
try {
removeChild(m_gameClip_Upgrade);
} catch(error:Error) {
};
if (Define.DEBUG_GENERAL){
trace("gameClip.logic: Deleting m_gameClip_Upgrade");
};
m_gameClip_Upgrade = null;
};
if (m_gameTimer != null){
try {
removeChild(m_gameTimer);
} catch(error:Error) {
};
if (Define.DEBUG_GENERAL){
trace("gameClip.logic: Deleting GAME TIMER");
};
m_gameTimer = null;
};
tmpInitial = 10000;
m_gameTimer = new gameTimer(tmpInitial);
resetInputKeys();
removePlayfieldElements();
if (m_isHistoryMode){
if (m_gameLevel == m_playerOneCharacter){
m_gameLevel++;
};
if (m_gameLevel == m_playerTwoCharacter){
m_gameLevel++;
};
};
initPlayfieldElements();
stage.addEventListener(KeyboardEvent.KEY_DOWN, getKeysPressedInGame);
stage.addEventListener(KeyboardEvent.KEY_UP, getKeysReleasedInGame);
addChild(m_gameTimer);
m_gameTimer.y = (Define.SCREEN_HEIGHT - Define.TIMER_AREA_HEIGHT);
changeState(STATE_GAME_PRESENTATION);
m_presentationShortMovie = new gameClip_ShortLevelIntro(m_gameLevel);
addChild(m_presentationShortMovie);
m_soundManager.stopAllGameSounds();
playGameSound(SoundsGame.SOUNDS_PRESENTATION_CLUB, 1);
break;
case STATE_GAME_PRESENTATION:
if (!m_presentationShortMovie.visible){
m_gameTimer.updateTime();
m_timeAcumulated = (m_timeAcumulated + m_gameTimer.m_timeDif);
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
m_timeAcumulated = 0;
m_soundManager.stopAllGameSounds();
m_startText = new gameClip_StartText();
addChild(m_startText);
m_startText.x = 50;
m_startText.y = 10;
};
m_playerOne.logic();
if (m_numberUserPlaying == 2){
m_playerTwo.logic();
};
m_playerSanta.logic();
i = (1 + m_numberUserPlaying);
while (i < m_listPlayers.length) {
stud = Player_Student(m_listPlayers[i]);
if (stud != null){
stud.logic();
};
i = (i + 1);
};
sortChildrenByY(m_gameBackgrounds);
if (!m_startText.visible){
i = 0;
while (i < m_listPlayers.length) {
selChar = Character(m_listPlayers[i]);
selChar.changeState(Character.RUN);
i = (i + 1);
};
switch (m_gameLevel){
case 0:
case 1:
case 2:
m_soundManager.playGameSound(SoundsGame.SOUNDS_LOOP_1, 1000);
break;
case 3:
case 4:
case 5:
m_soundManager.playGameSound(SoundsGame.SOUNDS_LOOP_2, 1000);
break;
case 6:
m_soundManager.playGameSound(SoundsGame.SOUNDS_LOOP_3, 1000);
break;
};
removeChild(m_startText);
m_playerOne.changeSection("quiet");
if (m_numberUserPlaying == 2){
m_playerTwo.changeSection("quiet");
};
fm = new FocusManager(this);
fm.setFocus(stage);
changeState(STATE_GAME_RUN);
};
};
break;
case STATE_GAME_RUN:
m_gameTimer.updateTime();
sNumberActiveUsers = 0;
sNumberActiveUsers = m_playerOne.logic();
if (m_numberUserPlaying == 2){
sNumberActiveUsers = (sNumberActiveUsers + m_playerTwo.logic());
};
if (sNumberActiveUsers <= 0){
changeState(STATE_GAME_LOSE);
return;
};
if (m_updatePlayersInfo){
m_updatePlayersInfo = false;
if (m_numberUserPlaying == 1){
m_gameTimer.updatePlayers(m_playerOneCharacter, m_playerOne.m_lifes, m_playerTwoCharacter, -1);
} else {
m_gameTimer.updatePlayers(m_playerOneCharacter, m_playerOne.m_lifes, m_playerTwoCharacter, m_playerTwo.m_lifes);
};
};
m_playerSanta.logic();
try {
i = (1 + m_numberUserPlaying);
while (i < m_listPlayers.length) {
stud = Player_Student(m_listPlayers[i]);
if (stud != null){
sNumberActiveStudents = (sNumberActiveStudents + stud.logic());
};
i = (i + 1);
};
} catch(error:Error) {
};
i = 0;
while (i < m_maximumNumberOfBombs) {
sbomb = Bomb(m_listBombs[i]);
sbomb.logic();
i = (i + 1);
};
i = 0;
while (i < Define.TOTAL_NUMBER_OF_ITEMS) {
sitem = Item(m_listItems[i]);
sitem.logic();
i = (i + 1);
};
sortChildrenByY(m_gameBackgrounds);
if (sNumberActiveStudents <= 0){
if (m_isHistoryMode){
changeState(STATE_GAME_WIN);
return;
};
if (sNumberActiveUsers <= 1){
changeState(STATE_GAME_WIN);
return;
};
};
break;
case STATE_GAME_WIN:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
m_soundManager.stopAllGameSounds();
m_soundManager.playGameSound(SoundsGame.SOUNDS_VICTORY, 1);
i = 0;
while (i < m_maximumNumberOfBombs) {
sbomb = Bomb(m_listBombs[i]);
sbomb.dissapear();
i = (i + 1);
};
gameResultVictory = new gameResult(this, gameResult.RESULT_VICTORY, 0xFFFFFF, "VICTORY");
addChild(gameResultVictory);
gameResultVictory.y = (Define.SCREEN_HEIGHT - Define.TIMER_AREA_HEIGHT);
m_playerSanta.changeSection("final_gift");
if (((m_playerOne.m_active) && ((m_playerOne.m_lifes > 0)))){
m_playerOne.changeSection("victory");
};
if (m_numberUserPlaying == 2){
if (((m_playerTwo.m_active) && ((m_playerTwo.m_lifes > 0)))){
m_playerTwo.changeSection("victory");
};
};
};
break;
case STATE_GAME_LOSE:
if (m_iterator < 10){
m_iterator++;
};
if (m_iterator == 1){
m_soundManager.stopAllGameSounds();
m_soundManager.playGameSound(SoundsGame.SOUNDS_LOSE, 1);
i = 0;
while (i < m_maximumNumberOfBombs) {
sbomb = Bomb(m_listBombs[i]);
sbomb.dissapear();
i = (i + 1);
};
gameResultLose = new gameResult(this, gameResult.RESULT_LOSE, 0x666666, "LOSE");
addChild(gameResultLose);
gameResultLose.y = (Define.SCREEN_HEIGHT - Define.TIMER_AREA_HEIGHT);
m_playerSanta.changeSection("laugh_of_player");
i = (1 + m_numberUserPlaying);
while (i < m_listPlayers.length) {
stud = Player_Student(m_listPlayers[i]);
if (stud != null){
stud.changeSection("victory");
};
i = (i + 1);
};
};
break;
case STATE_GAME_UPGRADE_PLAYER:
if (m_iterator < 10){
m_iterator++;
};
switch (m_iterator){
case 1:
if (m_gameLevel >= (Define.TOTAL_NUMBER_OF_LEVELS_BOMBERSANTA - 1)){
stopGame(true);
return;
};
numOfUpgradesLocal = 1;
if (m_gameLevel >= (Define.TOTAL_NUMBER_OF_LEVELS_BOMBERSANTA - 3)){
numOfUpgradesLocal = 2;
};
m_gameClip_Upgrade = new gameClip_Upgrade(this, numOfUpgradesLocal);
addChild(m_gameClip_Upgrade);
break;
case 2:
if (m_isHistoryMode){
if (m_playersUnlocked < (m_gameLevel + 1)){
m_playersUnlocked = (m_gameLevel + 1);
};
if (m_levelsUnlocked < (m_gameLevel + 1)){
m_levelsUnlocked = (m_gameLevel + 1);
};
saveSharedObjectData();
};
break;
};
if (m_gameClip_Upgrade.alpha == 99){
starNewLevel();
};
break;
case STATE_GAME_PAUSE:
break;
case STATE_GAME_END:
if (m_iterator < 10){
m_iterator++;
};
switch (m_iterator){
case 1:
m_gameClip_EndGame = new gameClip_EndGame();
addChild(m_gameClip_EndGame);
break;
case 2:
if (m_isHistoryMode){
if (m_playersUnlocked < (m_gameLevel + 1)){
m_playersUnlocked = (m_gameLevel + 1);
};
if (m_levelsUnlocked < (m_gameLevel + 1)){
m_levelsUnlocked = (m_gameLevel + 1);
};
saveSharedObjectData();
};
break;
};
if (m_gameClip_EndGame.alpha == 99){
this.visible = false;
m_soundManager.playGameSound(SoundsGame.SOUNDS_MELODY_MENU, 1);
changeState(STATE_GAME_NONE);
};
break;
};
}
public function changeKeyCodeState(_arg1:Number, _arg2:Boolean){
switch (_arg1){
case Keyboard.UP:
m_PlayerOne_key_up_pressed = _arg2;
break;
case Keyboard.DOWN:
m_PlayerOne_key_down_pressed = _arg2;
break;
case Keyboard.LEFT:
m_PlayerOne_key_left_pressed = _arg2;
break;
case Keyboard.RIGHT:
m_PlayerOne_key_right_pressed = _arg2;
break;
case Keyboard.ENTER:
m_PlayerOne_key_Action_pressed = _arg2;
break;
case Keyboard.SPACE:
if (m_numberUserPlaying == 1){
m_PlayerOne_key_Action_pressed = _arg2;
};
break;
case 87:
m_PlayerTwo_key_up_pressed = _arg2;
break;
case 83:
m_PlayerTwo_key_down_pressed = _arg2;
break;
case 65:
m_PlayerTwo_key_left_pressed = _arg2;
break;
case 68:
m_PlayerTwo_key_right_pressed = _arg2;
break;
case 82:
m_PlayerTwo_key_Action_pressed = _arg2;
break;
};
}
public function stopGame(_arg1:Boolean):void{
removePlayfieldElements();
if (_arg1){
changeState(STATE_GAME_END);
} else {
this.visible = false;
m_soundManager.playGameSound(SoundsGame.SOUNDS_MELODY_MENU, 1);
changeState(STATE_GAME_NONE);
};
}
public function getNearestBombToTake(_arg1:Point, _arg2:Number=0, _arg3:Boolean=true):Bomb{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Bomb;
var _local8:Bomb;
var _local9:Boolean;
_local6 = 100000000;
_local4 = 0;
while (_local4 < m_listBombs.length) {
_local8 = Bomb(m_listBombs[_local4]);
_local9 = ((((((((_local8.m_active) && ((_local8.m_isTaken == false)))) && ((_local8.m_iterationsMovement <= 0)))) && ((_local8.m_state == Character.PRESENTATION)))) && ((_local8.m_timer >= _arg2)));
if (_arg3){
_local9 = ((_local9) && ((_local8.m_marketAsTarget == -1)));
};
if (_local9){
_local5 = Point.distance(_arg1, _local8.m_pos);
if (_local5 < _local6){
_local6 = _local5;
_local7 = _local8;
};
};
_local4++;
};
return (_local7);
}
public function getKeysPressedInGame(_arg1:KeyboardEvent):void{
if (m_state == STATE_GAME_RUN){
changeKeyCodeState(_arg1.keyCode, true);
};
}
public function explotePlayersAffected(_arg1:Point, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:int;
var _local6:Character;
_local5 = 0;
_local5 = 0;
while (_local5 < m_listPlayers.length) {
_local6 = Character(m_listPlayers[_local5]);
if (_local6.m_state != Character.EXPLOTED){
if ((((Math.abs((_local6.m_pos.x - _arg1.x)) < _arg3)) && ((Math.abs((_local6.m_pos.y - _arg1.y)) < _arg4)))){
_local6.m_impact = 1;
};
};
_local5++;
};
}
public function removePlayfieldElements():void{
var i:*;
if (m_listPlayers != null){
try {
i = 0;
while (i < m_listPlayers.length) {
m_gameBackgrounds.removeChild(Character(m_listPlayers[i]));
i = (i + 1);
};
} catch(error:Error) {
};
if (Define.DEBUG_GENERAL){
trace((("gameClip.initPlayfieldElements: Deleting Character(m_listPlayers[" + i) + "])"));
};
m_listPlayers.splice(0, m_listPlayers.length);
m_listPlayers = null;
};
if (m_listBombs != null){
try {
i = 0;
while (i < m_listBombs.length) {
m_gameBackgrounds.removeChild(Bomb(m_listBombs[i]));
i = (i + 1);
};
} catch(error:Error) {
};
if (Define.DEBUG_GENERAL){
trace((("gameClip.initPlayfieldElements: Deleting Bomb(m_listBombs[" + i) + "])"));
};
m_listBombs.splice(0, m_listBombs.length);
m_listBombs = null;
};
if (m_listItems != null){
try {
i = 0;
while (i < m_listItems.length) {
m_gameBackgrounds.removeChild(Item(m_listItems[i]));
i = (i + 1);
};
} catch(error:Error) {
};
if (Define.DEBUG_GENERAL){
trace((("gameClip.initPlayfieldElements: Deleting Item(m_listItems[" + i) + "])"));
};
m_listItems.splice(0, m_listItems.length);
m_listItems = null;
};
if (m_gameBackgrounds != null){
try {
removeChild(m_gameBackgrounds);
} catch(error:Error) {
};
if (Define.DEBUG_GENERAL){
trace("gameClip.initPlayfieldElements: Deleting m_gameBackgrounds");
};
m_gameBackgrounds = null;
};
}
public function getRandomCharacterTarget(_arg1:Number, _arg2:Number):Character{
var _local3:Number;
var _local4:Character;
var _local5:Boolean;
var _local6:*;
_local3 = 0;
_local4 = null;
_local5 = false;
_local6 = Math.floor((_arg2 % m_listPlayers.length));
do {
if (_local6 == _arg1){
_local6++;
};
if (_local6 >= m_listPlayers.length){
_local6 = 0;
_local3++;
};
_local4 = Character(m_listPlayers[_local6]);
if ((((((_local4.m_state == Character.RUN)) && (_local4.m_active))) && (!((_local4.m_type == Character.TYPE_SANTAK))))){
_local5 = true;
} else {
_local6++;
};
} while (((!(_local5)) && ((_local3 < 2))));
if (_local3 < 2){
return (_local4);
};
return (null);
}
public function getNearestItem(_arg1:Point):Item{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Item;
var _local6:Item;
_local4 = 100000000;
_local2 = 0;
while (_local2 < m_listItems.length) {
_local6 = Item(m_listItems[_local2]);
if (_local6.m_active){
_local3 = Point.distance(_arg1, _local6.m_pos);
if (_local3 < _local4){
_local4 = _local3;
_local5 = _local6;
};
};
_local2++;
};
return (_local5);
}
public function getKeysReleasedInGame(_arg1:KeyboardEvent):void{
if (m_state == STATE_GAME_RUN){
changeKeyCodeState(_arg1.keyCode, false);
};
}
public function playGameSound(_arg1:Number, _arg2:Number){
if (m_soundManager != null){
m_soundManager.playGameSound(_arg1, _arg2);
};
}
public function saveSharedObjectData(){
var bomberSantaSO:SharedObject;
var levelData:*;
levelData = new Object();
levelData.numberOfUsersUnlocked = m_playersUnlocked;
levelData.numberOfLevelsUnlocked = m_levelsUnlocked;
try {
bomberSantaSO = SharedObject.getLocal(Define.RECORDSET_BOMBERSANTA);
bomberSantaSO.data.levelData = levelData;
bomberSantaSO.flush();
} catch(err:Error) {
if (Define.DEBUG_GENERAL){
trace(("ERROR: Saving to shared object; err=" + err.toString()));
};
};
bomberSantaSO.close();
}
public function stopGameSounds(){
if (m_soundManager != null){
m_soundManager.stopAllGameSounds();
};
}
public function isBombInsideRangeActive(_arg1:Point, _arg2:int, _arg3:int):Bomb{
var _local4:Bomb;
_local4 = getNearestBombActive(_arg1);
if (_local4 != null){
if ((((Math.abs((_local4.m_pos.x - _arg1.x)) < _arg2)) && ((Math.abs((_local4.m_pos.y - _arg1.y)) < _arg3)))){
return (_local4);
};
};
return (null);
}
public function insertNewBomb(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Boolean{
var _local5:int;
var _local6:Bomb;
_local5 = 0;
while (_local5 < m_listBombs.length) {
_local6 = Bomb(m_listBombs[_local5]);
if (_local6 != null){
if (!_local6.m_active){
_local6.initPositionBomb(new Point(_arg1, _arg2), _arg3, _arg4);
return (true);
};
};
_local5++;
};
return (false);
}
public function retryLevel():void{
changeState(STATE_GAME_LOADING);
}
public function sortChildrenByY(_arg1:MovieClip):void{
var _local2:int;
var _local3:Array;
_local3 = new Array();
_local2 = _arg1.numChildren;
while (_local2--) {
_local3[_local2] = _arg1.getChildAt(_local2);
};
_local3.sortOn("y", Array.NUMERIC);
_local2 = _arg1.numChildren;
while (_local2--) {
if (_local3[_local2] != _arg1.getChildAt(_local2)){
_arg1.setChildIndex(_local3[_local2], _local2);
};
};
}
public function getNearestCharacter(_arg1:Point):Character{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Character;
var _local6:Character;
_local4 = 100000000;
_local2 = 0;
while (_local2 < m_listPlayers.length) {
_local6 = Character(m_listPlayers[_local2]);
if (((_local6.m_active) && (!((_local6.m_type == Character.TYPE_SANTAK))))){
_local3 = Point.distance(_arg1, _local6.m_pos);
if (_local3 < _local4){
_local4 = _local3;
_local5 = _local6;
};
};
_local2++;
};
return (_local5);
}
public function insertNewItem(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Boolean{
var _local5:int;
var _local6:Item;
_local5 = 0;
while (_local5 < m_listItems.length) {
_local6 = Item(m_listItems[_local5]);
if (_local6 != null){
if (!_local6.m_active){
_local6.initItem(new Point(_arg1, _arg2), _arg3, _arg4);
return (true);
};
};
_local5++;
};
return (false);
}
}
}//package
Section 139
//loaderOfSounds (loaderOfSounds)
package {
import flash.display.*;
public dynamic class loaderOfSounds extends MovieClip {
}
}//package
Section 140
//loadingBarProgress (loadingBarProgress)
package {
import flash.display.*;
import flash.text.*;
public dynamic class loadingBarProgress extends MovieClip {
public var instMaskLoadingBarProgress:maskLoadingBarProgress;
public var instText:TextField;
}
}//package
Section 141
//maskLoadingBarProgress (maskLoadingBarProgress)
package {
import flash.display.*;
public dynamic class maskLoadingBarProgress extends MovieClip {
}
}//package
Section 142
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 143
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 144
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 145
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 146
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 147
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 148
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 149
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 150
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 151
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 152
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 153
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 154
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 155
//TextArea_disabledSkin (TextArea_disabledSkin)
package {
import flash.display.*;
public dynamic class TextArea_disabledSkin extends MovieClip {
}
}//package
Section 156
//TextArea_upSkin (TextArea_upSkin)
package {
import flash.display.*;
public dynamic class TextArea_upSkin extends MovieClip {
}
}//package