Section 1
//BonusSelect_109 (AssaultCarnivale_fla.BonusSelect_109)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class BonusSelect_109 extends MovieClip {
public var bonus4:BonusPower;
public var bonus2:Bonus45Degree;
public var bonus3:BonusDouble;
public var bonus:Bonus2X;
public var bonus1:Bonus3X;
public function BonusSelect_109(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package AssaultCarnivale_fla
Section 2
//busur20_18 (AssaultCarnivale_fla.busur20_18)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class busur20_18 extends MovieClip {
public function busur20_18(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 3
//busur30_19 (AssaultCarnivale_fla.busur30_19)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class busur30_19 extends MovieClip {
public function busur30_19(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 4
//busur40_20 (AssaultCarnivale_fla.busur40_20)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class busur40_20 extends MovieClip {
public function busur40_20(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 5
//busur50_21 (AssaultCarnivale_fla.busur50_21)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class busur50_21 extends MovieClip {
public function busur50_21(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 6
//CharacterSelect_108 (AssaultCarnivale_fla.CharacterSelect_108)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class CharacterSelect_108 extends MovieClip {
public var character2:Pin2MC;
public var character:PinMC;
public var characterCurLevel:int;
public var character1:Pin1MC;
public function CharacterSelect_108(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
MovieClip(getChildAt(0)).gotoAndStop(characterCurLevel);
}
function frame1(){
stop();
MovieClip(getChildAt(0)).gotoAndStop(characterCurLevel);
}
function frame2(){
MovieClip(getChildAt(0)).gotoAndStop(characterCurLevel);
}
}
}//package AssaultCarnivale_fla
Section 7
//Combo1HitKill_74 (AssaultCarnivale_fla.Combo1HitKill_74)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class Combo1HitKill_74 extends MovieClip {
public function Combo1HitKill_74(){
addFrameScript(49, frame50);
}
function frame50(){
gotoAndStop(1);
this.parent.visible = false;
MovieClip(this.parent).gotoAndStop("reset");
}
}
}//package AssaultCarnivale_fla
Section 8
//ComboJackMC_70 (AssaultCarnivale_fla.ComboJackMC_70)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class ComboJackMC_70 extends MovieClip {
public function ComboJackMC_70(){
addFrameScript(49, frame50);
}
function frame50(){
gotoAndStop(1);
this.parent.visible = false;
MovieClip(this.parent).gotoAndStop("reset");
}
}
}//package AssaultCarnivale_fla
Section 9
//ComboKingMC_72 (AssaultCarnivale_fla.ComboKingMC_72)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class ComboKingMC_72 extends MovieClip {
public function ComboKingMC_72(){
addFrameScript(49, frame50);
}
function frame50(){
gotoAndStop(1);
this.parent.visible = false;
MovieClip(this.parent).gotoAndStop("reset");
}
}
}//package AssaultCarnivale_fla
Section 10
//ComboMasterMC_71 (AssaultCarnivale_fla.ComboMasterMC_71)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class ComboMasterMC_71 extends MovieClip {
public function ComboMasterMC_71(){
addFrameScript(49, frame50);
}
function frame50(){
gotoAndStop(1);
this.parent.visible = false;
MovieClip(this.parent).gotoAndStop("reset");
}
}
}//package AssaultCarnivale_fla
Section 11
//ComboMC_69 (AssaultCarnivale_fla.ComboMC_69)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.filters.*;
import flash.errors.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class ComboMC_69 extends MovieClip {
public function ComboMC_69(){
addFrameScript(0, frame1, 5, frame6, 10, frame11, 15, frame16, 20, frame21, 25, frame26);
}
function frame6(){
MovieClip(this.parent).isComboRecord = true;
if (MovieClip(this.parent).highestRecord < 1){
MovieClip(this.parent).highestRecord = 1;
};
}
function frame16(){
MovieClip(this.parent).isComboRecord = true;
if (MovieClip(this.parent).highestRecord < 3){
MovieClip(this.parent).highestRecord = 3;
};
}
function frame1(){
stop();
MovieClip(this.parent).isComboRecord = false;
}
function frame26(){
MovieClip(this.parent).isComboRecord = true;
if (MovieClip(this.parent).highestRecord < 5){
MovieClip(this.parent).highestRecord = 5;
};
}
function frame21(){
MovieClip(this.parent).isComboRecord = true;
if (MovieClip(this.parent).highestRecord < 4){
MovieClip(this.parent).highestRecord = 4;
};
}
function frame11(){
MovieClip(this.parent).isComboRecord = true;
if (MovieClip(this.parent).highestRecord < 2){
MovieClip(this.parent).highestRecord = 2;
};
}
}
}//package AssaultCarnivale_fla
Section 12
//ComboSaintMC_73 (AssaultCarnivale_fla.ComboSaintMC_73)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class ComboSaintMC_73 extends MovieClip {
public function ComboSaintMC_73(){
addFrameScript(49, frame50);
}
function frame50(){
gotoAndStop(1);
this.parent.visible = false;
MovieClip(this.parent).gotoAndStop("reset");
}
}
}//package AssaultCarnivale_fla
Section 13
//DialogMC_82 (AssaultCarnivale_fla.DialogMC_82)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.text.*;
public dynamic class DialogMC_82 extends MovieClip {
public var dialogTxt:TextField;
public var dialogBackMc:MovieClip;
}
}//package AssaultCarnivale_fla
Section 14
//FailedPuzzleScreen_98 (AssaultCarnivale_fla.FailedPuzzleScreen_98)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class FailedPuzzleScreen_98 extends MovieClip {
public var returnBtn:SimpleButton;
public var retryBtn:SimpleButton;
}
}//package AssaultCarnivale_fla
Section 15
//fb_star_97 (AssaultCarnivale_fla.fb_star_97)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class fb_star_97 extends MovieClip {
public function fb_star_97(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package AssaultCarnivale_fla
Section 16
//fb_window_92 (AssaultCarnivale_fla.fb_window_92)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.filters.*;
import flash.errors.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class fb_window_92 extends MovieClip {
public var star4:MovieClip;
public var star5:MovieClip;
public var star1:MovieClip;
public var star3:MovieClip;
public var sended:Number;
public var star2:MovieClip;
public var btn_close:SimpleButton;
public var feedback_input:TextField;
public var btn_send:SimpleButton;
public var gameid:String;
public var rate:Number;
public function fb_window_92(){
addFrameScript(0, frame1);
}
public function closeWindow(_arg1:MouseEvent){
removeHandles();
this.visible = false;
}
public function removeHandles(){
if (sended == 0){
btn_send.removeEventListener(MouseEvent.MOUSE_UP, SendFeedback);
star1.removeEventListener(MouseEvent.MOUSE_UP, rate1);
star2.removeEventListener(MouseEvent.MOUSE_UP, rate2);
star3.removeEventListener(MouseEvent.MOUSE_UP, rate3);
star4.removeEventListener(MouseEvent.MOUSE_UP, rate4);
star5.removeEventListener(MouseEvent.MOUSE_UP, rate5);
star1.removeEventListener(MouseEvent.MOUSE_OVER, starto1);
star2.removeEventListener(MouseEvent.MOUSE_OVER, starto2);
star3.removeEventListener(MouseEvent.MOUSE_OVER, starto3);
star4.removeEventListener(MouseEvent.MOUSE_OVER, starto4);
star5.removeEventListener(MouseEvent.MOUSE_OVER, starto5);
star1.removeEventListener(MouseEvent.MOUSE_OUT, starreset);
star2.removeEventListener(MouseEvent.MOUSE_OUT, starreset);
star3.removeEventListener(MouseEvent.MOUSE_OUT, starreset);
star4.removeEventListener(MouseEvent.MOUSE_OUT, starreset);
star5.removeEventListener(MouseEvent.MOUSE_OUT, starreset);
btn_close.removeEventListener(MouseEvent.MOUSE_UP, closeWindow);
btn_close.addEventListener(MouseEvent.MOUSE_UP, closeWindow);
};
btn_close.addEventListener(MouseEvent.MOUSE_UP, closeWindow);
}
public function starreset(_arg1:MouseEvent){
updateRate(rate);
}
public function updateRate(_arg1:Number){
if (_arg1 > 0){
star1.gotoAndStop(2);
} else {
star1.gotoAndStop(1);
};
if (_arg1 > 1){
star2.gotoAndStop(2);
} else {
star2.gotoAndStop(1);
};
if (_arg1 > 2){
star3.gotoAndStop(2);
} else {
star3.gotoAndStop(1);
};
if (_arg1 > 3){
star4.gotoAndStop(2);
} else {
star4.gotoAndStop(1);
};
if (_arg1 > 4){
star5.gotoAndStop(2);
} else {
star5.gotoAndStop(1);
};
}
public function rate4(_arg1:MouseEvent){
rate = 4;
updateRate(rate);
}
public function rate1(_arg1:MouseEvent){
rate = 1;
updateRate(rate);
}
public function rate2(_arg1:MouseEvent){
rate = 2;
updateRate(rate);
}
public function rate3(_arg1:MouseEvent){
rate = 3;
updateRate(rate);
}
public function rate5(_arg1:MouseEvent){
rate = 5;
updateRate(rate);
}
function frame1(){
stop();
gameid = "assaultcarnivale";
rate = 0;
sended = 0;
btn_send.addEventListener(MouseEvent.MOUSE_UP, SendFeedback);
btn_close.addEventListener(MouseEvent.MOUSE_UP, closeWindow);
star1.addEventListener(MouseEvent.MOUSE_UP, rate1);
star2.addEventListener(MouseEvent.MOUSE_UP, rate2);
star3.addEventListener(MouseEvent.MOUSE_UP, rate3);
star4.addEventListener(MouseEvent.MOUSE_UP, rate4);
star5.addEventListener(MouseEvent.MOUSE_UP, rate5);
star1.addEventListener(MouseEvent.MOUSE_OVER, starto1);
star2.addEventListener(MouseEvent.MOUSE_OVER, starto2);
star3.addEventListener(MouseEvent.MOUSE_OVER, starto3);
star4.addEventListener(MouseEvent.MOUSE_OVER, starto4);
star5.addEventListener(MouseEvent.MOUSE_OVER, starto5);
star1.addEventListener(MouseEvent.MOUSE_OUT, starreset);
star2.addEventListener(MouseEvent.MOUSE_OUT, starreset);
star3.addEventListener(MouseEvent.MOUSE_OUT, starreset);
star4.addEventListener(MouseEvent.MOUSE_OUT, starreset);
star5.addEventListener(MouseEvent.MOUSE_OUT, starreset);
}
public function starto1(_arg1:MouseEvent){
updateRate(1);
}
public function starto4(_arg1:MouseEvent){
updateRate(4);
}
public function starto3(_arg1:MouseEvent){
updateRate(3);
}
public function starto5(_arg1:MouseEvent){
updateRate(5);
}
public function starto2(_arg1:MouseEvent){
updateRate(2);
}
public function SendFeedback(_arg1:MouseEvent){
var _local2:URLVariables;
var _local3:URLRequest;
var _local4:URLLoader;
Security.allowDomain("*");
Security.loadPolicyFile("http://feedback.g-bot.net/crossdomain.xml");
_local2 = new URLVariables();
_local2.id = gameid;
_local2.rates = rate;
_local2.feed = feedback_input.text;
_local3 = new URLRequest("http://feedback.g-bot.net/addfeed.php");
_local3.method = "POST";
_local3.data = _local2;
_local4 = new URLLoader();
_local4.load(_local3);
_local4.addEventListener(Event.COMPLETE, goodjob);
}
public function goodjob(_arg1:Event):void{
removeHandles();
sended++;
this.gotoAndStop(2);
}
}
}//package AssaultCarnivale_fla
Section 17
//gamesfre_pre_b_sprite43_63 (AssaultCarnivale_fla.gamesfre_pre_b_sprite43_63)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class gamesfre_pre_b_sprite43_63 extends MovieClip {
public function gamesfre_pre_b_sprite43_63(){
addFrameScript(20, frame21);
}
function frame21(){
stop();
}
}
}//package AssaultCarnivale_fla
Section 18
//gamesfre_pre_dragon_animation_29 (AssaultCarnivale_fla.gamesfre_pre_dragon_animation_29)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.media.*;
public dynamic class gamesfre_pre_dragon_animation_29 extends MovieClip {
public var clickSND:Sound;
public function gamesfre_pre_dragon_animation_29(){
addFrameScript(19, frame20, 97, frame98, 112, frame113);
}
function frame98(){
clickSND = new gamesfree2();
clickSND.play(0, 1);
trace(("clickSND=" + clickSND));
}
function frame20(){
clickSND = new gamesfree1();
clickSND.play(0, 1);
trace(("clickSND=" + clickSND));
}
function frame113(){
stop();
MovieClip(MovieClip(parent).parent).gotoAndStop(11);
}
}
}//package AssaultCarnivale_fla
Section 19
//gamesfre_pre_mendengus_37 (AssaultCarnivale_fla.gamesfre_pre_mendengus_37)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class gamesfre_pre_mendengus_37 extends MovieClip {
public function gamesfre_pre_mendengus_37(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package AssaultCarnivale_fla
Section 20
//GXEntryMC_27 (AssaultCarnivale_fla.GXEntryMC_27)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class GXEntryMC_27 extends MovieClip {
public var developerMc:MovieClip;
public var sponsorMc:MovieClip;
public function GXEntryMC_27(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
sponsorMc.buttonMode = true;
sponsorMc.addEventListener(MouseEvent.CLICK, function ():void{
navigateToURL(new URLRequest("http://www.gamesfree.com"), "_blank");
});
}
function frame11(){
developerMc.buttonMode = true;
developerMc.addEventListener(MouseEvent.CLICK, function ():void{
navigateToURL(new URLRequest("http://gxgs.gamexeon.com"), "_blank");
});
}
}
}//package AssaultCarnivale_fla
Section 21
//GXGSPreloader_46 (AssaultCarnivale_fla.GXGSPreloader_46)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class GXGSPreloader_46 extends MovieClip {
public function GXGSPreloader_46(){
addFrameScript(69, frame70);
}
function frame70(){
stop();
MovieClip(MovieClip(this.parent).parent).gotoAndPlay("initData");
}
}
}//package AssaultCarnivale_fla
Section 22
//HolderMC_2 (AssaultCarnivale_fla.HolderMC_2)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class HolderMC_2 extends MovieClip {
public function HolderMC_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package AssaultCarnivale_fla
Section 23
//InputCode_103 (AssaultCarnivale_fla.InputCode_103)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public dynamic class InputCode_103 extends MovieClip {
public var returnBtn:SimpleButton;
public var theText:TextField;
public var playCustomBtn:SimpleButton;
public function InputCode_103(){
addFrameScript(0, frame1);
}
function frame1(){
returnBtn.addEventListener(MouseEvent.CLICK, onClose);
}
public function onClose(_arg1:MouseEvent):void{
this.visible = false;
}
}
}//package AssaultCarnivale_fla
Section 24
//kapakijo20_23 (AssaultCarnivale_fla.kapakijo20_23)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class kapakijo20_23 extends MovieClip {
public function kapakijo20_23(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 25
//kapakijo30_24 (AssaultCarnivale_fla.kapakijo30_24)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class kapakijo30_24 extends MovieClip {
public function kapakijo30_24(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 26
//kapakijo40_25 (AssaultCarnivale_fla.kapakijo40_25)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class kapakijo40_25 extends MovieClip {
public function kapakijo40_25(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 27
//kapakijo50_26 (AssaultCarnivale_fla.kapakijo50_26)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class kapakijo50_26 extends MovieClip {
public function kapakijo50_26(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 28
//MainTimeline (AssaultCarnivale_fla.MainTimeline)
package AssaultCarnivale_fla {
import fl.controls.*;
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import code.*;
import flash.utils.*;
import gs.easing.*;
import com.adobe.crypto.*;
import flash.media.*;
import flash.net.*;
import flash.filters.*;
import flash.errors.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public const maxLevel:int = 20;
public var loadingMc:MovieClip;
public var loader:URLLoader;
public var characterUpBtn:SimpleButton;
public var comboCount:int;
public var powerCountNum:int;
public var penyihir_mc:MovieClip;
public var power_txt:TextField;
public var percent:Number;
public var tempItems:Array;
public var recordBtn:SimpleButton;
public var totalClick_txt:TextField;
public var __setPropDict:Dictionary;
public var totalScore_txt:TextField;
public var i:int;
public var testBtn:SimpleButton;
public var puzzleItem:Object;
public var tempWalls:Array;
public var constChance:int;
public var mainMenuBtn:SimpleButton;
public var pauseBtn:SimpleButton;
public var feedbackBtn:SimpleButton;
public var creditBtn:SimpleButton;
public var mainmenuBtn:SimpleButton;
public var scoreGetLoader:URLLoader;
public var totalClick:int;
public var selectGlow:GlowFilter;
public var helpMc:MovieClip;
public var loaderSprite:Sprite;
public var transition_mc:MovieClip;
public var isPuzzleWin:Boolean;
public var winTimer:Timer;
public var pin_arr:Array;
public var isTest:Boolean;
public var sponsorBtn:SimpleButton;
public var characterRightBtn:SimpleButton;
public var dialogMc:MovieClip;
public var isTitlePlaying:Boolean;
public var customCode:String;
public var titleContainer:MovieClip;
public var customBtn:SimpleButton;
public var otherBtn:SimpleButton;
public var codeBtn:SimpleButton;
public var loseTimer:Timer;
public var win_snd_buf:SoundChannel;
public var modeFastBtn:SimpleButton;
public var lose_snd:Sound;
public var createLevelBtn:SimpleButton;
public var characterLeftBtn:SimpleButton;
public var variables:URLVariables;
public var characterSelect:MovieClip;
public var modeNormalBtn:SimpleButton;
public var comboScore:int;
public var totalHit:int;
public var audioOnBtn:SimpleButton;
public var hitPerClick_txt:TextField;
public var beam_arr:Array;
public var comboAchievement_mc:ComboAchievementMC;
public var beamSpeed:int;
public var audioOffBtn:SimpleButton;
public var puzzleLevel:int;
public var combo_mc:MovieClip;
public var timesClick:int;
public var bonusSelect:MovieClip;
public var time_txt:TextField;
public var pauseScreen:MovieClip;
public var puzzle2Btn:SimpleButton;
public var isPuzzle:Boolean;
public var codeDisplay:MovieClip;
public var comboScore_mc:MovieClip;
public var highestRecord:int;
public var customItem:Object;
public var click_snd:Sound;
public var isMusicOn:Boolean;
public var score_mc:MovieClip;
public var wall_arr:Array;
public var win_snd:Sound;
public var wallRightBtn:SimpleButton;
public var playBtn:SimpleButton;
public var maxCombo:int;
public var request:URLRequest;
public var score:int;
public var resultMc:MovieClip;
public var scoreGetRequest:URLRequest;
public var beamCount:int;
public var incorrectTimer:Timer;
public var mainMenu:MovieClip;
public var name_txt:TextField;
public var time:int;
public var levelObj:Level;
public var chance_arr:Array;
public var failedPuzzle:MovieClip;
public var characterDownBtn:SimpleButton;
public var customCode2:String;
public var title_snd:Sound;
public var unlockedPuzzleLevel:int;
public var viewscores:MovieClip;
public var powerCount:NumericStepper;
public var submitBtn:SimpleButton;
public var arcadeBtn:SimpleButton;
public var level_txt:TextField;
public var maxCombo_txt:TextField;
public var urlVar:URLVariables;
public var chance:int;
public var timer:Timer;
public var game_snd_buf:SoundChannel;
public var is1HitKill:Boolean;
public var wallSelect:WallMC;
public var totalDay_txt:TextField;
public var characterCurLevel:int;
public var lose_snd_buf:SoundChannel;
public var targetScore:int;
public var loadmode:int;
public var level:int;
public var playLevelBtn:SimpleButton;
public var puzzleAwards:Array;
public var puzzleComplete:Boolean;
public var gameTransform:SoundTransform;
public var game_snd:Sound;
public var bufferObject:String;
public var wallLeftBtn:SimpleButton;
public var bonusLeftBtn:SimpleButton;
public var title_snd_buf:SoundChannel;
public var bufferBonus:String;
public var websiteBtn:SimpleButton;
public var isRetry:Boolean;
public var delayScreen:MovieClip;
public var bonusRightBtn:SimpleButton;
public var totalHit_txt:TextField;
public var puzzleBtn_arr:Array;
public var codeIncorrectMc:MovieClip;
public var isComboRecord:Boolean;
public var feedbackMc:MovieClip;
public function MainTimeline(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(0, frame1, 8, frame9, 10, frame11, 15, frame16, 20, frame21, 25, frame26, 30, frame31, 35, frame36, 40, frame41, 45, frame46, 50, frame51, 55, frame56, 60, frame61, 65, frame66, 70, frame71, 71, frame72, 72, frame73, 73, frame74, 74, frame75);
}
public function clearPin():void{
var _local1:int;
trace("cleanPin");
_local1 = (pin_arr.length - 1);
while (_local1 >= 0) {
removePin(pin_arr[_local1]);
_local1--;
};
}
public function onTitlePClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEventP();
if (game_snd_buf){
game_snd_buf.stop();
};
gotoAndStop("initData", "Scene 1");
}
public function onTick(_arg1:TimerEvent):void{
time--;
time_txt.text = ("Time " + String(time));
if ((((time == 0)) && ((pin_arr.length > 0)))){
if (pin_arr.length > 0){
gameOver();
} else {
nextLevel();
};
};
}
public function removeMainEvent():void{
stage.removeEventListener(Event.ENTER_FRAME, onUpdate);
stage.removeEventListener(Event.ENTER_FRAME, onUpdateP);
stage.removeEventListener(Event.ENTER_FRAME, onUpdateC);
timer.stop();
if (comboScore_mc){
comboScore_mc.removeEventListener(Event.ENTER_FRAME, fadeUp);
comboScore_mc.removeEventListener(Event.ENTER_FRAME, onComboAnimation);
comboScore_mc.parent.removeChild(comboScore_mc);
comboScore_mc = null;
};
}
public function showProgress(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = Math.round(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
loaderSprite.graphics.clear();
loaderSprite.graphics.lineStyle(1, 0, 1);
loaderSprite.graphics.drawRect(0, 195, 500, 10);
loaderSprite.graphics.lineStyle(1, 0, 1);
loaderSprite.graphics.beginFill(6499854);
loaderSprite.graphics.drawRect(0, 195, (5 * _local2), 10);
}
function frame11(){
OverwriteManager.init();
stop();
trace(("isTitlePlaying =" + isTitlePlaying));
if (((isMusicOn) && (!(isTitlePlaying)))){
isTitlePlaying = true;
title_snd_buf = title_snd.play(0, 999);
};
isPuzzle = false;
highestRecord = 0;
audioOffBtn.addEventListener(MouseEvent.CLICK, onMusicClickTitle);
audioOnBtn.addEventListener(MouseEvent.CLICK, onMusicClickTitle);
if (isMusicOn){
audioOffBtn.visible = true;
audioOnBtn.visible = false;
} else {
audioOffBtn.visible = false;
audioOnBtn.visible = true;
};
maxCombo = 0;
totalHit = 0;
totalClick = 0;
if (customCode != ""){
gotoAndStop("customPlay", "Scene 4");
} else {
mainMenu.visible = (arcadeBtn.visible = (puzzle2Btn.visible = (customBtn.visible = (recordBtn.visible = (creditBtn.visible = (otherBtn.visible = false))))));
TweenLite.from(titleContainer, 0.6, {scaleY:0.01, ease:Bounce.easeOut, onComplete:function ():void{
mainMenu.visible = true;
}});
TweenLite.from(mainMenu, 0.6, {delay:0.6, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut, onComplete:function ():void{
arcadeBtn.visible = true;
}});
TweenLite.from(arcadeBtn, 0.6, {delay:0.7, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut, onComplete:function ():void{
puzzle2Btn.visible = true;
}});
TweenLite.from(puzzle2Btn, 0.6, {delay:0.8, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut, onComplete:function ():void{
customBtn.visible = true;
}});
TweenLite.from(customBtn, 0.6, {delay:0.9, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut, onComplete:function ():void{
recordBtn.visible = true;
}});
TweenLite.from(recordBtn, 0.6, {delay:1, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut, onComplete:function ():void{
creditBtn.visible = true;
}});
TweenLite.from(creditBtn, 0.6, {delay:1.1, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut, onComplete:function ():void{
otherBtn.visible = true;
}});
TweenLite.from(otherBtn, 0.6, {delay:1.2, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut, onComplete:initTitleBtnEvent});
};
sponsorBtn.addEventListener(MouseEvent.CLICK, function ():void{
navigateToURL(new URLRequest("http://www.gamesfree.com"), "_blank");
});
}
public function nextLevel():void{
if (level < 20){
level++;
};
if (comboCount > maxCombo){
maxCombo = comboCount;
};
chance = chance_arr.length;
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEvent();
setChildIndex(transition_mc, (numChildren - 1));
transition_mc.gotoAndPlay("turun");
stage.addEventListener(Event.ENTER_FRAME, onTransition);
}
function frame16(){
TweenLite.from(mainMenuBtn, 1, {scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
TweenLite.from(playBtn, 1, {scaleX:0.1, scaleY:0.1, delay:0.1, ease:Bounce.easeOut});
mainMenuBtn.addEventListener(MouseEvent.CLICK, onReturnTitleClick);
playBtn.addEventListener(MouseEvent.CLICK, onHelpPlay);
}
public function updateCharacter(_arg1:Event=null):void{
wallSelect.filters = [];
characterSelect.filters = [selectGlow];
if (characterSelect.currentFrame == 1){
bufferObject = "PinMC";
} else {
if (characterSelect.currentFrame == 2){
bufferObject = "Pin1MC";
} else {
if (characterSelect.currentFrame == 3){
bufferObject = "Pin2MC";
};
};
};
if (characterCurLevel == 1){
bufferObject = (bufferObject + "1");
} else {
if (characterCurLevel == 6){
bufferObject = (bufferObject + "2");
} else {
if (characterCurLevel == 11){
bufferObject = (bufferObject + "3");
} else {
if (characterCurLevel == 16){
bufferObject = (bufferObject + "4");
};
};
};
};
removeEventListener(Event.ENTER_FRAME, updateCharacter);
}
public function onLoseClick(_arg1:MouseEvent):void{
if (((isMusicOn) && (_arg1))){
click_snd.play(0, 1);
};
loseTimer.stop();
loseTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onLoseTimer);
stage.removeEventListener(MouseEvent.CLICK, onLoseClick);
gotoAndStop("inputScore");
}
public function initChance(_arg1:int):void{
var _local2:int;
_local2 = 0;
while (_local2 < _arg1) {
addChance();
_local2++;
};
}
function frame1(){
stop();
if (loaderInfo.url.substring(0, 4) != "file"){
Security.allowDomain("*");
Security.loadPolicyFile("http://track.g-bot.net/crossdomain.xml");
variables = new URLVariables();
variables.id = "assaultcarnivale";
variables.ui = loaderInfo.url;
request = new URLRequest("http://track.g-bot.net/track.php");
request.method = "POST";
request.data = variables;
loader = new URLLoader();
loader.load(request);
};
isMusicOn = true;
stage.showDefaultContextMenu = false;
loaderSprite = new Sprite();
addChildAt(loaderSprite, 2);
this.loaderInfo.addEventListener(Event.COMPLETE, initApplication);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
customCode = ((this.loaderInfo.parameters.levelCode == null)) ? "" : this.loaderInfo.parameters.levelCode;
}
public function encodeDebugCustomLevel():String{
var _local1:String;
var _local2:int;
var _local3:MovieClip;
var _local4:WallMC;
_local1 = "";
if (tempItems.length == 0){
return ("You need at least 1 Soldier unit to generate the level code!");
};
_local2 = 0;
while (_local2 < tempItems.length) {
_local3 = tempItems[_local2];
_local1 = (_local1 + "puzzleItems.push({");
if ((_local3 is PinMC)){
_local1 = (_local1 + "type:0,");
} else {
if ((_local3 is Pin1MC)){
_local1 = (_local1 + "type:1,");
} else {
if ((_local3 is Pin2MC)){
_local1 = (_local1 + "type:2,");
};
};
};
if (_local3.currentFrame == 1){
_local1 = (_local1 + "level:1,");
} else {
if (_local3.currentFrame == 6){
_local1 = (_local1 + "level:2,");
} else {
if (_local3.currentFrame == 11){
_local1 = (_local1 + "level:3,");
} else {
if (_local3.currentFrame == 16){
_local1 = (_local1 + "level:4,");
};
};
};
};
_local1 = (_local1 + (("x:" + ((_local3.x - 46) / 61)) + ","));
_local1 = (_local1 + (("y:" + ((_local3.y - 46) / 61)) + ","));
if (_local3.bonus){
if ((_local3.bonus is Bonus2X)){
_local1 = (_local1 + "bonusType:BonusType.BONUS_2X");
} else {
if ((_local3.bonus is Bonus3X)){
_local1 = (_local1 + "bonusType:BonusType.BONUS_3X");
} else {
if ((_local3.bonus is Bonus45Degree)){
_local1 = (_local1 + "bonusType:BonusType.BONUS_45_DEGREE");
} else {
if ((_local3.bonus is BonusDouble)){
_local1 = (_local1 + "bonusType:BonusType.BONUS_DOUBLE_ATTACK");
} else {
if ((_local3.bonus is BonusPower)){
_local1 = (_local1 + "bonusType:BonusType.BONUS_POWER_ATTACK");
};
};
};
};
};
} else {
_local1 = (_local1 + "bonusType:null");
};
_local1 = (_local1 + "}); \n");
_local2++;
};
_local2 = 0;
while (_local2 < tempWalls.length) {
_local4 = tempWalls[_local2];
_local1 = (_local1 + "wallItems.push({");
if (_local4.currentFrame == 1){
_local1 = (_local1 + "type:'v',");
} else {
if (_local4.currentFrame == 2){
_local1 = (_local1 + "type:'h',");
};
};
_local1 = (_local1 + (("x:" + (((_local4.x - 18) / 60) - 1)) + ","));
_local1 = (_local1 + ("y:" + (((_local4.y - 17) / 60) - 1)));
_local1 = (_local1 + "}); \n");
_local2++;
};
_local1 = (_local1 + (((("puzzle_arr.push({pin:puzzleItems,wall:" + ((tempWalls.length == 0)) ? "null" : "wallItems") + ",chance:") + powerCount.value) + "});"));
return (_local1);
}
function frame9(){
game_snd = new GameSND();
title_snd = new TitleSND();
lose_snd = new LoseSND();
win_snd = new WinSND();
click_snd = new CLICK();
gotoAndStop("title");
}
public function onPuzzleReturnTitleClick(_arg1:MouseEvent):void{
var _local2:int;
if (isMusicOn){
click_snd.play(0, 1);
};
mainMenuBtn.removeEventListener(MouseEvent.CLICK, onReturnTitleClick);
if (puzzleBtn_arr){
_local2 = 0;
while (_local2 < puzzleBtn_arr.length) {
puzzleBtn_arr[_local2].removeEventListener(MouseEvent.CLICK, onPuzzleSelect);
removeChild(puzzleBtn_arr[_local2]);
_local2++;
};
};
puzzleBtn_arr = null;
gotoAndStop("initData", "Scene 1");
}
public function initWallC():void{
var _local1:Array;
var _local2:int;
var _local3:MovieClip;
if (customItem.wall){
_local1 = customItem.wall;
trace(("WALL-" + _local2));
_local2 = 0;
while (_local2 < _local1.length) {
_local3 = new WallMC();
_local3.x = ((_local1[_local2].x * 60) + 18);
_local3.y = ((_local1[_local2].y * 60) + 17);
if ((_local1[_local2].type == "h")){
_local3.gotoAndStop(2);
} else {
_local3.stop();
};
addChildAt(_local3, (numChildren - 1));
wall_arr.push(_local3);
_local2++;
};
};
}
function frame31(){
stop();
loadingMc.visible = true;
Security.allowDomain("*");
Security.loadPolicyFile("http://hiscore.gamesfree.com/crossdomain.xml");
loadmode = 1;
scoreGetRequest = new URLRequest("http://hiscore.gamesfree.com/assaultcarnivale_get.php");
scoreGetLoader = new URLLoader();
urlVar = new URLVariables();
urlVar.m = loadmode;
scoreGetRequest.data = urlVar;
scoreGetRequest.method = URLRequestMethod.POST;
scoreGetLoader.addEventListener(Event.COMPLETE, handleComplete);
scoreGetLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
scoreGetLoader.load(scoreGetRequest);
trace("load score");
viewscores.button1.addEventListener(MouseEvent.MOUSE_UP, linkPressed);
viewscores.button2.addEventListener(MouseEvent.MOUSE_UP, allscoresPressed);
mainMenuBtn.addEventListener(MouseEvent.CLICK, onScoreClick);
TweenLite.from(mainMenuBtn, 0.5, {scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
}
function frame21(){
stop();
title_snd_buf.stop();
isTitlePlaying = false;
if (isMusicOn){
game_snd_buf = game_snd.play(0, 999);
};
audioOnBtn.visible = false;
modeNormalBtn.visible = false;
pauseScreen.visible = false;
TweenLite.from(pauseBtn, 1, {scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
if (isMusicOn){
TweenLite.from(audioOffBtn, 1, {delay:0.1, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
} else {
audioOffBtn.visible = false;
audioOnBtn.visible = true;
TweenLite.from(audioOnBtn, 1, {delay:0.1, scaleX:0.2, scaleY:0.1, ease:Bounce.easeOut});
};
TweenLite.from(modeFastBtn, 1, {delay:0.3, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
mainMenuBtn.x = 441;
mainMenuBtn.y = 362;
TweenLite.from(mainMenuBtn, 1, {delay:0.4, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
dialogMc.visible = false;
dialogMc.mouseEnabled = false;
dialogMc.dialogTxt.mouseEnabled = false;
dialogMc.dialogBackMc.mouseEnabled = false;
level_txt.selectable = false;
time_txt.selectable = false;
score_mc.score_txt.selectable = false;
combo_mc.visible = false;
combo_mc.mouseEnabled = false;
isComboRecord = false;
timesClick = 2;
levelObj = new Level();
beamSpeed = 8;
level = 1;
time = 120;
pin_arr = [];
wall_arr = [];
constChance = 5;
chance = 20;
chance_arr = [];
beam_arr = [];
beamCount = 0;
score = 0;
targetScore = 0;
comboScore = 0;
comboScore_mc = null;
comboCount = 0;
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onTick);
init();
delayScreen.addEventListener(MouseEvent.CLICK, onDelayRemoved);
audioOffBtn.addEventListener(MouseEvent.CLICK, onMusicClick);
audioOnBtn.addEventListener(MouseEvent.CLICK, onMusicClick);
modeFastBtn.addEventListener(MouseEvent.CLICK, onModeClick);
modeNormalBtn.addEventListener(MouseEvent.CLICK, onModeClick);
mainMenuBtn.addEventListener(MouseEvent.CLICK, onTitleClick);
pauseBtn.addEventListener(MouseEvent.CLICK, onPause);
pauseScreen.addEventListener(MouseEvent.CLICK, onPause);
}
function frame36(){
stop();
game_snd_buf.stop();
if (isMusicOn){
win_snd_buf = win_snd.play(0, 999);
};
stage.addEventListener(MouseEvent.CLICK, onWinClick);
winTimer = new Timer(3000, 1);
winTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onWinTimer);
winTimer.start();
}
function frame26(){
stop();
websiteBtn.addEventListener(MouseEvent.CLICK, function ():void{
navigateToURL(new URLRequest("http://gxgs.gamexeon.com"));
});
mainmenuBtn.addEventListener(MouseEvent.CLICK, onCreditClick);
}
public function onTransition(_arg1:Event):void{
if (transition_mc.doneTurun == true){
if (level <= maxLevel){
chance = (chance + constChance);
transition_mc.gotoAndPlay("naik");
init();
} else {
stage.removeEventListener(Event.ENTER_FRAME, onTransition);
removeChild(transition_mc);
removeChild(penyihir_mc);
gotoAndStop("win");
};
} else {
if (transition_mc.doneNaik == true){
transition_mc.gotoAndStop("turun");
stage.removeEventListener(Event.ENTER_FRAME, onTransition);
};
};
}
public function goTarget(_arg1:SimpleButton):void{
switch (_arg1){
case arcadeBtn:
gotoAndStop("help");
break;
case puzzle2Btn:
gotoAndStop("puzzleSelect", "Scene 2");
break;
case customBtn:
gotoAndStop("customSelect", "Scene 4");
break;
case recordBtn:
gotoAndStop("score");
break;
case creditBtn:
gotoAndStop("credit");
break;
case otherBtn:
navigateToURL(new URLRequest("http://www.gamesfree.com"), "_blank");
break;
};
}
public function initWallP():void{
var _local1:Array;
var _local2:int;
var _local3:MovieClip;
if (puzzleItem.wall){
_local1 = puzzleItem.wall;
trace(("WALL-" + _local2));
_local2 = 0;
while (_local2 < _local1.length) {
_local3 = new WallMC();
_local3.x = ((_local1[_local2].x * 60) + 78);
_local3.y = ((_local1[_local2].y * 60) + 77);
if ((_local1[_local2].type == "h")){
_local3.gotoAndStop(2);
} else {
_local3.stop();
};
addChildAt(_local3, (numChildren - 1));
wall_arr.push(_local3);
_local2++;
};
};
}
public function onIncorrectClick(_arg1:Event=null):void{
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEventC();
removeEventListener(MouseEvent.CLICK, onIncorrectClick);
incorrectTimer.stop();
incorrectTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onIncorrectClick);
if (game_snd_buf){
game_snd_buf.stop();
};
gotoAndStop("customSelect", "Scene 4");
}
function frame46(){
Security.allowDomain("*");
Security.loadPolicyFile("http://hiscore.gamesfree.com/crossdomain.xml");
totalDay_txt.text = ("Total Day : " + level);
totalScore_txt.text = ("Total Score : " + score);
maxCombo_txt.text = ("Max Combo : " + maxCombo);
totalHit_txt.text = ("Total Hit : " + totalHit);
totalClick_txt.text = ("Total Click : " + totalClick);
percent = Number((totalHit / totalClick));
percent = (percent * 100);
percent = Math.round(percent);
hitPerClick_txt.text = (("Hit/Click Ratio : " + percent) + "%");
comboAchievement_mc.gotoAndStop("none");
TweenLite.from(submitBtn, 0.5, {scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
TweenLite.from(mainMenuBtn, 0.5, {scaleX:0.1, scaleY:0.1, delay:0.1, ease:Bounce.easeOut});
TweenLite.from(feedbackBtn, 0.5, {scaleX:0.1, scaleY:0.1, delay:0.2, ease:Bounce.easeOut});
submitBtn.addEventListener(MouseEvent.CLICK, onSubmitClick);
mainMenuBtn.addEventListener(MouseEvent.CLICK, onReturnTitleClick);
feedbackBtn.addEventListener(MouseEvent.CLICK, onFeedbackClick);
addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
feedbackMc.visible = false;
}
function frame41(){
stop();
game_snd_buf.stop();
if (isMusicOn){
lose_snd_buf = lose_snd.play(0, 999);
};
stage.addEventListener(MouseEvent.CLICK, onLoseClick);
loseTimer = new Timer(3000, 1);
loseTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onLoseTimer);
loseTimer.start();
}
public function onKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 13){
if (name_txt.text != ""){
submitBtn.removeEventListener(MouseEvent.CLICK, onSubmitClick);
removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
sendScore();
};
};
}
public function initCreateCustom():void{
mainMenuBtn.addEventListener(MouseEvent.CLICK, onCustomCreateBtnClick);
codeBtn.addEventListener(MouseEvent.CLICK, onCustomCreateBtnClick);
testBtn.addEventListener(MouseEvent.CLICK, onCustomCreateBtnClick);
characterLeftBtn.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
characterRightBtn.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
characterUpBtn.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
characterDownBtn.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
bonusRightBtn.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
bonusLeftBtn.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
wallRightBtn.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
wallLeftBtn.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
characterSelect.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
bonusSelect.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
wallSelect.addEventListener(MouseEvent.CLICK, onCustomCreateClick);
stage.addEventListener(MouseEvent.CLICK, onAddCustomObject);
}
public function allscoresPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://hiscore.gamesfree.com/assaultcarnivale.php"));
}
function frame56(){
stop();
title_snd_buf.stop();
isTitlePlaying = false;
if (isMusicOn){
game_snd_buf = game_snd.play(0, 999);
};
audioOnBtn.visible = false;
modeNormalBtn.visible = false;
pauseScreen.visible = false;
failedPuzzle.visible = false;
TweenLite.from(pauseBtn, 1, {scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
if (isMusicOn){
TweenLite.from(audioOffBtn, 1, {delay:0.1, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
} else {
audioOffBtn.visible = false;
audioOnBtn.visible = true;
TweenLite.from(audioOnBtn, 1, {delay:0.1, scaleX:0.2, scaleY:0.1, ease:Bounce.easeOut});
};
TweenLite.from(modeFastBtn, 1, {delay:0.3, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
mainMenuBtn.x = 441;
mainMenuBtn.y = 362;
TweenLite.from(mainMenuBtn, 1, {delay:0.4, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
level_txt.selectable = false;
time_txt.selectable = false;
score_mc.score_txt.selectable = false;
combo_mc.visible = false;
combo_mc.mouseEnabled = false;
isComboRecord = true;
timesClick = 2;
is1HitKill = false;
levelObj = new Level();
beamSpeed = 8;
level = 1;
time = 120;
pin_arr = [];
wall_arr = [];
constChance = 15;
chance = constChance;
chance_arr = [];
beam_arr = [];
beamCount = 0;
score = 0;
targetScore = 0;
comboScore = 0;
comboScore_mc = null;
comboCount = 0;
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onTickP);
trace("init");
puzzleComplete = false;
initP();
isPuzzleWin = false;
audioOffBtn.addEventListener(MouseEvent.CLICK, onMusicClick);
audioOnBtn.addEventListener(MouseEvent.CLICK, onMusicClick);
modeFastBtn.addEventListener(MouseEvent.CLICK, onModeClick);
modeNormalBtn.addEventListener(MouseEvent.CLICK, onModeClick);
mainMenuBtn.addEventListener(MouseEvent.CLICK, onTitlePClick);
pauseBtn.addEventListener(MouseEvent.CLICK, onPause);
pauseScreen.addEventListener(MouseEvent.CLICK, onPause);
}
function frame51(){
stop();
isPuzzle = true;
if (((isMusicOn) && (!(isTitlePlaying)))){
isTitlePlaying = true;
title_snd_buf = title_snd.play(0, 999);
};
trace(("isTitlePlaying=" + isTitlePlaying));
puzzleLevel = 1;
unlockedPuzzleLevel = 1;
puzzleAwards = [];
puzzleBtn_arr = [];
checkSharedObject();
initPuzzleButton();
mainMenuBtn.x = 241;
mainMenuBtn.y = 360;
mainMenuBtn.addEventListener(MouseEvent.CLICK, onPuzzleReturnTitleClick);
TweenLite.from(mainMenuBtn, 1, {scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
}
public function updateBonus(_arg1:Event=null):void{
updateCharacter();
wallSelect.filters = [];
bufferBonus = "";
bonusSelect.filters = [selectGlow];
if (bonusSelect.currentFrame == 1){
bufferBonus = BonusType.BONUS_2X;
} else {
if (bonusSelect.currentFrame == 2){
bufferBonus = BonusType.BONUS_3X;
} else {
if (bonusSelect.currentFrame == 3){
bufferBonus = BonusType.BONUS_45_DEGREE;
} else {
if (bonusSelect.currentFrame == 4){
bufferBonus = BonusType.BONUS_DOUBLE_ATTACK;
} else {
if (bonusSelect.currentFrame == 5){
bufferBonus = BonusType.BONUS_POWER_ATTACK;
};
};
};
};
};
removeEventListener(Event.ENTER_FRAME, updateBonus);
}
public function onDelayRemoved(_arg1:MouseEvent):void{
dialogMc.visible = false;
delayScreen.visible = false;
timer.start();
}
public function removeChance():void{
chance_arr.pop();
power_txt.text = ("Power\n" + chance_arr.length);
}
public function initTitleBtnEvent():void{
arcadeBtn.addEventListener(MouseEvent.CLICK, onTitleBtn);
puzzle2Btn.addEventListener(MouseEvent.CLICK, onTitleBtn);
customBtn.addEventListener(MouseEvent.CLICK, onTitleBtn);
recordBtn.addEventListener(MouseEvent.CLICK, onTitleBtn);
creditBtn.addEventListener(MouseEvent.CLICK, onTitleBtn);
otherBtn.addEventListener(MouseEvent.CLICK, onTitleBtn);
}
function frame61(){
stop();
if (((isMusicOn) && (!(isTitlePlaying)))){
isTitlePlaying = true;
title_snd_buf = title_snd.play(0, 999);
};
tempItems = [];
tempWalls = [];
powerCountNum = 1;
isTest = false;
customCode2 = "";
if (customCode != ""){
customCode2 = customCode;
customCode = "";
};
codeDisplay.visible = false;
mainMenuBtn.x = 250;
mainMenuBtn.y = 360;
mainMenuBtn.addEventListener(MouseEvent.CLICK, onCustomReturnTitleClick);
createLevelBtn.addEventListener(MouseEvent.CLICK, onCustomButtonClick);
playLevelBtn.addEventListener(MouseEvent.CLICK, onCustomButtonClick);
TweenLite.from(mainMenuBtn, 0.5, {scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
TweenLite.from(createLevelBtn, 0.5, {scaleX:0.1, scaleY:0.1, delay:0.1, ease:Bounce.easeOut});
TweenLite.from(playLevelBtn, 0.5, {scaleX:0.1, scaleY:0.1, delay:0.2, ease:Bounce.easeOut});
}
function frame66(){
stop();
if (customCode != ""){
customCode2 = customCode;
customCode = "";
};
title_snd_buf.stop();
isTitlePlaying = false;
if (isMusicOn){
if (game_snd_buf){
game_snd_buf.stop();
};
game_snd_buf = game_snd.play(0, 999);
};
codeIncorrectMc.mouseEnabled = false;
codeIncorrectMc.visible = false;
resultMc.mouseEnabled = false;
resultMc.visible = false;
audioOnBtn.visible = false;
modeNormalBtn.visible = false;
pauseScreen.visible = false;
TweenLite.from(pauseBtn, 1, {scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
if (isMusicOn){
TweenLite.from(audioOffBtn, 1, {delay:0.1, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
} else {
audioOffBtn.visible = false;
audioOnBtn.visible = true;
TweenLite.from(audioOnBtn, 1, {delay:0.1, scaleX:0.2, scaleY:0.1, ease:Bounce.easeOut});
};
TweenLite.from(modeFastBtn, 1, {delay:0.3, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
mainMenuBtn.x = 441;
mainMenuBtn.y = 362;
TweenLite.from(mainMenuBtn, 1, {delay:0.4, scaleX:0.1, scaleY:0.1, ease:Bounce.easeOut});
level_txt.selectable = false;
time_txt.selectable = false;
score_mc.score_txt.selectable = false;
combo_mc.visible = false;
combo_mc.mouseEnabled = false;
isComboRecord = true;
timesClick = 2;
levelObj = new Level();
beamSpeed = 8;
level = 1;
time = 120;
pin_arr = [];
wall_arr = [];
constChance = 15;
chance = constChance;
chance_arr = [];
beam_arr = [];
beamCount = 0;
score = 0;
targetScore = 0;
comboScore = 0;
comboScore_mc = null;
comboCount = 0;
timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onTickC);
initC();
isRetry = false;
audioOffBtn.addEventListener(MouseEvent.CLICK, onMusicClick);
audioOnBtn.addEventListener(MouseEvent.CLICK, onMusicClick);
modeFastBtn.addEventListener(MouseEvent.CLICK, onModeClick);
modeNormalBtn.addEventListener(MouseEvent.CLICK, onModeClick);
mainMenuBtn.addEventListener(MouseEvent.CLICK, onTitleClick);
pauseBtn.addEventListener(MouseEvent.CLICK, onPause);
pauseScreen.addEventListener(MouseEvent.CLICK, onPause);
}
public function initBonus(_arg1:int):MovieClip{
var _local2:MovieClip;
var _local3:String;
if (_arg1 < level){
_local3 = BonusType.getRandomBonus();
if (_local3 == BonusType.BONUS_2X){
_local2 = new Bonus2X();
} else {
if (_local3 == BonusType.BONUS_3X){
_local2 = new Bonus3X();
} else {
if (_local3 == BonusType.BONUS_DOUBLE_ATTACK){
_local2 = new BonusDouble();
} else {
if (_local3 == BonusType.BONUS_POWER_ATTACK){
_local2 = new BonusPower();
} else {
if (_local3 == BonusType.BONUS_45_DEGREE){
_local2 = new Bonus45Degree();
};
};
};
};
};
};
return (_local2);
}
public function onSubmitClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
if (name_txt.text != ""){
submitBtn.removeEventListener(MouseEvent.CLICK, onSubmitClick);
removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
sendScore();
};
}
public function onCloseCodeDisplay(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
codeDisplay.returnBtn.removeEventListener(MouseEvent.CLICK, onCloseCodeDisplay);
_arg1.stopPropagation();
stage.addEventListener(MouseEvent.CLICK, onAddCustomObject);
}
public function hitPin(_arg1:MovieClip, _arg2:Boolean):void{
var _local3:Sound;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:MovieClip;
var _local9:Sound;
totalHit++;
if (!_arg2){
comboCount++;
switch (comboCount){
case 40:
if (!combo_mc.visible){
combo_mc.visible = true;
setChildIndex(combo_mc, (numChildren - 2));
};
combo_mc.gotoAndStop("comboJack");
break;
case 50:
if (!combo_mc.visible){
combo_mc.visible = true;
setChildIndex(combo_mc, (numChildren - 2));
};
combo_mc.gotoAndStop("comboMaster");
break;
case 60:
if (!combo_mc.visible){
combo_mc.visible = true;
setChildIndex(combo_mc, (numChildren - 2));
};
combo_mc.gotoAndStop("comboKing");
break;
case 70:
if (!combo_mc.visible){
combo_mc.visible = true;
setChildIndex(combo_mc, (numChildren - 2));
};
combo_mc.gotoAndStop("comboSaint");
break;
};
if (isMusicOn){
_local3 = new SHOCK();
_local3.play(100, 1);
};
if (_arg1.bonus){
if ((_arg1.bonus is Bonus2X)){
comboScore = (comboScore * 2);
} else {
if ((_arg1.bonus is Bonus3X)){
comboScore = (comboScore * 3);
} else {
comboScore = (comboScore + 10);
};
};
} else {
comboScore = (comboScore + 10);
};
if ((comboCount % 5) == 0){
addChance();
};
cekComboScore();
};
if (_arg1.value < 4){
_arg1.gotoAndStop(("pin" + (_arg1.value + 1)));
_arg1.value = (_arg1.value + 1);
if (!_arg2){
createPinScore(_arg1, comboScore);
};
} else {
if (_arg2){
timesClick--;
};
comboScore = (comboScore + 10);
_local4 = _arg1.x;
_local5 = _arg1.y;
if (_arg1.bonus){
if ((_arg1.bonus is BonusDouble)){
_local7 = 1;
} else {
if ((_arg1.bonus is Bonus45Degree)){
_local7 = 2;
} else {
if ((_arg1.bonus is BonusPower)){
_local7 = 3;
};
};
};
};
if ((_arg1 is PinMC)){
_local6 = 0;
} else {
if ((_arg1 is Pin1MC)){
_local6 = 1;
} else {
if ((_arg1 is Pin2MC)){
_local6 = 2;
};
};
};
if (!_arg2){
createPinScore(_arg1, comboScore);
};
if (isMusicOn){
_local9 = new DEADGUY();
_local9.play(0, 1);
};
removePin(_arg1);
if (_local7 > 0){
if (_local7 == 1){
addBeam(_local4, _local5, _local6, 0, 15);
addBeam(_local4, _local5, _local6);
} else {
if (_local7 == 2){
addBeam(_local4, _local5, _local6, 45);
} else {
if (_local7 == 3){
addBeam(_local4, _local5, _local6, 0, 0, true);
};
};
};
} else {
addBeam(_local4, _local5, _local6);
};
_local8 = new LedakanMC();
_local8.mouseEnabled = false;
addChild(_local8);
_local8.x = _local4;
_local8.y = _local5;
};
if (!_arg2){
addScore(comboScore);
};
}
function __setProp_powerCount_Scene4_interface_71(){
try {
powerCount["componentInspectorSetting"] = true;
} catch(e:Error) {
};
powerCount.enabled = true;
powerCount.maximum = 50;
powerCount.minimum = 1;
powerCount.stepSize = 1;
powerCount.value = 1;
powerCount.visible = true;
try {
powerCount["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame71(){
if ((((__setPropDict[powerCount] == undefined)) || (!((((int(__setPropDict[powerCount]) >= 71)) && ((int(__setPropDict[powerCount]) <= 75))))))){
__setPropDict[powerCount] = currentFrame;
__setProp_powerCount_Scene4_interface_71();
};
if (title_snd_buf){
isTitlePlaying = false;
title_snd_buf.stop();
};
mainMenuBtn.x = 442;
mainMenuBtn.y = 378;
codeDisplay.visible = false;
TweenLite.from(codeBtn, 1, {y:500, ease:Bounce.easeOut});
TweenLite.from(testBtn, 1, {delay:0.1, y:500, ease:Bounce.easeOut});
TweenLite.from(mainMenuBtn, 1, {delay:0.2, y:500, ease:Bounce.easeOut});
bufferObject = "";
bufferBonus = "";
selectGlow = new GlowFilter(0xFFFF00, 1, 6, 6, 3, 3);
if (isMusicOn){
if (game_snd_buf){
game_snd_buf.stop();
};
gameTransform = new SoundTransform(0.4);
game_snd_buf = game_snd.play(0, 999, gameTransform);
};
if (tempItems.length > 0){
helpMc.visible = false;
i = 0;
while (i < tempItems.length) {
addChildAt(tempItems[i], (numChildren - 1));
i++;
};
i = 0;
while (i < tempWalls.length) {
addChildAt(tempWalls[i], (numChildren - 1));
i++;
};
powerCount.value = powerCountNum;
initCreateCustom();
} else {
helpMc.addEventListener(MouseEvent.CLICK, onHelpClick);
};
characterCurLevel = 1;
}
function frame72(){
if ((((__setPropDict[powerCount] == undefined)) || (!((((int(__setPropDict[powerCount]) >= 71)) && ((int(__setPropDict[powerCount]) <= 75))))))){
__setPropDict[powerCount] = currentFrame;
__setProp_powerCount_Scene4_interface_71();
};
}
function frame75(){
if ((((__setPropDict[powerCount] == undefined)) || (!((((int(__setPropDict[powerCount]) >= 71)) && ((int(__setPropDict[powerCount]) <= 75))))))){
__setPropDict[powerCount] = currentFrame;
__setProp_powerCount_Scene4_interface_71();
};
}
public function init():void{
stage.addEventListener(Event.ENTER_FRAME, onUpdate);
timesClick = 2;
time = 120;
time_txt.text = ("Time " + String(time));
timer.start();
score = targetScore;
level_txt.text = ("Day " + level);
score_mc.score_txt.text = ("Score " + score);
initChance(chance);
initPin();
initWall();
initDialog();
}
function frame73(){
if ((((__setPropDict[powerCount] == undefined)) || (!((((int(__setPropDict[powerCount]) >= 71)) && ((int(__setPropDict[powerCount]) <= 75))))))){
__setPropDict[powerCount] = currentFrame;
__setProp_powerCount_Scene4_interface_71();
};
}
function frame74(){
if ((((__setPropDict[powerCount] == undefined)) || (!((((int(__setPropDict[powerCount]) >= 71)) && ((int(__setPropDict[powerCount]) <= 75))))))){
__setPropDict[powerCount] = currentFrame;
__setProp_powerCount_Scene4_interface_71();
};
}
public function gameOverP():void{
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEventP();
failedPuzzle.visible = true;
failedPuzzle.retryBtn.addEventListener(MouseEvent.CLICK, onFailedPuzzle);
failedPuzzle.returnBtn.addEventListener(MouseEvent.CLICK, onFailedPuzzle);
}
public function onCustomButtonClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
switch (_arg1.currentTarget){
case createLevelBtn:
gotoAndStop("customCreate", "Scene 4");
break;
case playLevelBtn:
codeDisplay.visible = true;
codeDisplay.theText.text = customCode2;
codeDisplay.playCustomBtn.addEventListener(MouseEvent.CLICK, onNextClick);
break;
};
}
public function checkSharedObject():void{
var _local1:SharedObject;
_local1 = SharedObject.getLocal("assaultcarnivale");
if (_local1.data.unlockedPuzzleLevel){
unlockedPuzzleLevel = _local1.data.unlockedPuzzleLevel;
puzzleAwards = _local1.data.puzzleAwards;
} else {
_local1.data.unlockedPuzzleLevel = unlockedPuzzleLevel;
_local1.data.puzzleAwards = puzzleAwards;
_local1.flush();
};
}
public function initBonusC(_arg1:String):MovieClip{
var _local2:MovieClip;
if (_arg1 == BonusType.BONUS_2X){
_local2 = new Bonus2X();
} else {
if (_arg1 == BonusType.BONUS_3X){
_local2 = new Bonus3X();
} else {
if (_arg1 == BonusType.BONUS_DOUBLE_ATTACK){
_local2 = new BonusDouble();
} else {
if (_arg1 == BonusType.BONUS_POWER_ATTACK){
_local2 = new BonusPower();
} else {
if (_arg1 == BonusType.BONUS_45_DEGREE){
_local2 = new Bonus45Degree();
};
};
};
};
};
return (_local2);
}
public function onHelpPlay(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
playBtn.removeEventListener(MouseEvent.CLICK, onHelpPlay);
gotoAndStop("game");
}
public function initBonusP(_arg1:String):MovieClip{
var _local2:MovieClip;
if (_arg1 == BonusType.BONUS_2X){
_local2 = new Bonus2X();
} else {
if (_arg1 == BonusType.BONUS_3X){
_local2 = new Bonus3X();
} else {
if (_arg1 == BonusType.BONUS_DOUBLE_ATTACK){
_local2 = new BonusDouble();
} else {
if (_arg1 == BonusType.BONUS_POWER_ATTACK){
_local2 = new BonusPower();
} else {
if (_arg1 == BonusType.BONUS_45_DEGREE){
_local2 = new Bonus45Degree();
};
};
};
};
};
return (_local2);
}
public function initC():void{
initCuzzleItem();
timesClick = 2;
if (customItem == null){
codeIncorrectMc.visible = true;
addEventListener(MouseEvent.CLICK, onIncorrectClick);
incorrectTimer = new Timer(2000, 1);
incorrectTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onIncorrectClick);
incorrectTimer.start();
return;
};
stage.addEventListener(Event.ENTER_FRAME, onUpdateC);
time = 120;
time_txt.text = ("Time " + time);
timer.start();
score = targetScore;
level_txt.text = ("Day " + level);
score_mc.score_txt.text = ("Score " + score);
initChance(customItem.chance);
initPinC();
initWallC();
}
public function gameOverC():void{
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEventC();
resultMc.visible = true;
resultMc.retryBtn.addEventListener(MouseEvent.CLICK, onCustomResult);
resultMc.exitBtn.addEventListener(MouseEvent.CLICK, onCustomResult);
}
public function onComboAnimation(_arg1:Event):void{
if (comboScore_mc){
if (comboScore_mc.width > (65 + 2)){
comboScore_mc.width = (comboScore_mc.width + ((65 - comboScore_mc.width) / 5));
};
if (comboScore_mc.height > (24 + 2)){
comboScore_mc.height = (comboScore_mc.height + ((24 - comboScore_mc.height) / 5));
};
if ((((comboScore_mc.width <= 67)) && ((comboScore_mc.height <= 26)))){
comboScore_mc.removeEventListener(Event.ENTER_FRAME, onComboAnimation);
};
} else {
_arg1.target.removeEventListener(Event.ENTER_FRAME, onComboAnimation);
};
}
public function onTitleClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
if (dialogMc){
dialogMc.visible = false;
};
if (penyihir_mc){
removeChild(penyihir_mc);
};
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEvent();
if (game_snd_buf){
game_snd_buf.stop();
};
gotoAndStop("initData", "Scene 1");
}
public function initP():void{
initPuzzleItem();
puzzleComplete = false;
is1HitKill = false;
timesClick = 2;
stage.addEventListener(Event.ENTER_FRAME, onUpdateP);
time = 120;
time_txt.text = ("Time " + time);
timer.start();
score = targetScore;
level_txt.text = ("Day " + puzzleLevel);
score_mc.score_txt.text = ("Score " + score);
initChance(puzzleItem.chance);
initPinP();
initWallP();
}
public function onScoreClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
switch (_arg1.currentTarget){
case mainMenuBtn:
closeLeaderboard();
break;
};
}
public function onFeedbackClick(_arg1:MouseEvent):void{
feedbackMc.visible = true;
}
public function onAddCustomObject(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
var _local4:WallMC;
var _local5:int;
var _local6:MovieClip;
var _local7:MovieClip;
_local2 = _arg1.stageX;
_local3 = _arg1.stageY;
if ((((((((_local2 > 380)) || ((_local3 > 382)))) || ((_local2 < 16)))) || ((_local3 < 16)))){
return;
};
if (bufferObject != ""){
if (isMusicOn){
click_snd.play(0, 1);
};
trace(("bufferObject=" + bufferObject));
trace(("bufferBonus=" + bufferBonus));
if ((((bufferObject == "v")) || ((bufferObject == "h")))){
if ((((((_local2 < 78)) && ((bufferObject == "v")))) || ((((_local3 < 77)) && ((bufferObject == "h")))))){
return;
};
if (bufferObject == "v"){
_local4 = new WallMC();
_local4.stop();
} else {
_local4 = new WallMC();
_local4.gotoAndStop(2);
};
_local4.x = ((Math.floor(((_local2 - 18) / 60)) * 60) + 18);
_local4.y = ((Math.floor(((_local3 - 17) / 60)) * 60) + 17);
_local5 = 0;
while (_local5 < tempWalls.length) {
if ((((((tempWalls[_local5].x == _local4.x)) && ((tempWalls[_local5].y == _local4.y)))) && ((tempWalls[_local5].currentFrame == _local4.currentFrame)))){
removeChild(tempWalls[_local5]);
tempWalls.splice(_local5, 1);
};
_local5++;
};
addChild(_local4);
tempWalls.push(_local4);
} else {
trace(bufferObject.substring(0, (bufferObject.length - 1)));
trace(bufferObject.substring((bufferObject.length - 1), bufferObject.length));
if (bufferObject.substring(0, (bufferObject.length - 1)) == "PinMC"){
_local6 = new PinMC();
} else {
if (bufferObject.substring(0, (bufferObject.length - 1)) == "Pin1MC"){
_local6 = new Pin1MC();
} else {
if (bufferObject.substring(0, (bufferObject.length - 1)) == "Pin2MC"){
_local6 = new Pin2MC();
};
};
};
if (bufferObject.substring((bufferObject.length - 1), bufferObject.length) == "1"){
_local6.gotoAndStop("pin1");
} else {
if (bufferObject.substring((bufferObject.length - 1), bufferObject.length) == "2"){
_local6.gotoAndStop("pin2");
} else {
if (bufferObject.substring((bufferObject.length - 1), bufferObject.length) == "3"){
_local6.gotoAndStop("pin3");
} else {
if (bufferObject.substring((bufferObject.length - 1), bufferObject.length) == "4"){
_local6.gotoAndStop("pin4");
};
};
};
};
if (bufferBonus != ""){
_local7 = initBonusC(bufferBonus);
_local6.bonusHolder_mc.addChild(_local7);
_local7.x = -20;
_local7.y = 10;
_local6.bonus = _local7;
};
_local6.x = (48 + (61 * Math.floor(((_local2 - 18) / 61))));
_local6.y = (48 + (61 * Math.floor(((_local3 - 18) / 61))));
_local5 = 0;
while (_local5 < tempItems.length) {
if ((((tempItems[_local5].x == _local6.x)) && ((tempItems[_local5].y == _local6.y)))){
removeChild(tempItems[_local5]);
tempItems.splice(_local5, 1);
};
_local5++;
};
addChild(_local6);
tempItems.push(_local6);
};
} else {
trace(("remove event.target=" + _arg1.target));
if ((((((_arg1.target is PinMC)) || ((_arg1.target is Pin1MC)))) || ((_arg1.target is Pin2MC)))){
_local5 = 0;
while (_local5 < tempItems.length) {
if (tempItems[_local5] == _arg1.target){
removeChild(tempItems[_local5]);
tempItems.splice(_local5, 1);
};
_local5++;
};
} else {
if ((_arg1.target is WallMC)){
_local5 = 0;
while (_local5 < tempWalls.length) {
if (tempWalls[_local5] == _arg1.target){
removeChild(tempWalls[_local5]);
tempWalls.splice(_local5, 1);
};
_local5++;
};
};
};
};
}
public function onCustomCreateClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
trace(_arg1.currentTarget);
switch (_arg1.currentTarget){
case characterLeftBtn:
if (characterSelect.currentFrame > 1){
characterSelect.prevFrame();
};
if (characterSelect.filters.length > 0){
addEventListener(Event.ENTER_FRAME, updateCharacter);
};
break;
case characterRightBtn:
if (characterSelect.currentFrame < 3){
characterSelect.nextFrame();
};
if (characterSelect.filters.length > 0){
addEventListener(Event.ENTER_FRAME, updateCharacter);
};
break;
case characterUpBtn:
if (MovieClip(characterSelect.getChildAt(0)).currentFrame < 16){
characterCurLevel = (characterCurLevel + 5);
characterSelect.characterCurLevel = characterCurLevel;
MovieClip(characterSelect.getChildAt(0)).gotoAndStop((MovieClip(characterSelect.getChildAt(0)).currentFrame + 5));
};
if (characterSelect.filters.length > 0){
addEventListener(Event.ENTER_FRAME, updateCharacter);
};
break;
case characterDownBtn:
if (MovieClip(characterSelect.getChildAt(0)).currentFrame > 1){
characterCurLevel = (characterCurLevel - 5);
characterSelect.characterCurLevel = characterCurLevel;
MovieClip(characterSelect.getChildAt(0)).gotoAndStop((MovieClip(characterSelect.getChildAt(0)).currentFrame - 5));
};
if (characterSelect.filters.length > 0){
addEventListener(Event.ENTER_FRAME, updateCharacter);
};
break;
case bonusRightBtn:
if (bonusSelect.currentFrame < 5){
bonusSelect.nextFrame();
};
if (bonusSelect.filters.length > 0){
addEventListener(Event.ENTER_FRAME, updateBonus);
};
break;
case bonusLeftBtn:
if (bonusSelect.currentFrame > 1){
bonusSelect.prevFrame();
};
if (bonusSelect.filters.length > 0){
addEventListener(Event.ENTER_FRAME, updateBonus);
};
break;
case wallRightBtn:
if (wallSelect.currentFrame < 2){
wallSelect.nextFrame();
};
if (wallSelect.filters.length > 0){
updateWall();
};
break;
case wallLeftBtn:
if (wallSelect.currentFrame > 1){
wallSelect.prevFrame();
};
if (wallSelect.filters.length > 0){
updateWall();
};
break;
case characterSelect:
if (characterSelect.filters.length > 0){
characterSelect.filters = [];
bufferObject = "";
bonusSelect.filters = [];
bufferBonus = "";
} else {
updateCharacter();
};
break;
case bonusSelect:
if (bonusSelect.filters.length > 0){
bonusSelect.filters = [];
bufferBonus = "";
} else {
updateBonus();
};
break;
case wallSelect:
if (wallSelect.filters.length > 0){
wallSelect.filters = [];
bufferObject = "";
} else {
updateWall();
};
break;
};
}
public function initPuzzleItem():void{
puzzleItem = levelObj.getPuzzleObject(puzzleLevel);
}
public function onMusicClick(_arg1:MouseEvent):void{
if (isMusicOn){
isMusicOn = false;
game_snd_buf.stop();
audioOffBtn.visible = false;
audioOnBtn.visible = true;
} else {
if (isMusicOn){
click_snd.play(0, 1);
};
isMusicOn = true;
game_snd_buf = game_snd.play(0, 999);
audioOnBtn.visible = false;
audioOffBtn.visible = true;
};
}
public function onCustomReturnTitleClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
gotoAndStop("initData", "Scene 1");
}
public function clearWall():void{
var _local1:int;
trace("cleanPin");
_local1 = (wall_arr.length - 1);
while (_local1 >= 0) {
removeChild(wall_arr[_local1]);
wall_arr.splice(_local1, 1);
_local1--;
};
}
public function onUpdateC(_arg1:Event):void{
if (score < targetScore){
score = (score + ((targetScore - score) / 10));
score_mc.score_txt.text = ("SCORE " + this.score);
};
if (pin_arr.length == 0){
trace(("timesClick=" + timesClick));
if (timesClick == 1){
is1HitKill = true;
timesClick = (timesClick - 1);
if (!combo_mc.visible){
combo_mc.visible = true;
};
setChildIndex(combo_mc, (numChildren - 2));
combo_mc.gotoAndStop("1HitKill");
isComboRecord = true;
};
if (is1HitKill){
resultMc.gotoAndStop(3);
} else {
resultMc.gotoAndStop(2);
};
if (!isComboRecord){
nextLevelC();
};
};
if ((((((chance_arr.length == 0)) && ((pin_arr.length > 0)))) && ((beamCount == 0)))){
resultMc.gotoAndStop(1);
if (!isComboRecord){
gameOverC();
};
};
}
public function onIOError(_arg1:IOErrorEvent):void{
trace("Error loading URL.");
}
public function onUpdateP(_arg1:Event):void{
if (score < targetScore){
score = (score + ((targetScore - score) / 10));
score_mc.score_txt.text = ("SCORE " + this.score);
};
if (pin_arr.length == 0){
if (timesClick == 1){
is1HitKill = true;
timesClick = (timesClick - 1);
if (!combo_mc.visible){
combo_mc.visible = true;
};
setChildIndex(combo_mc, (numChildren - 2));
combo_mc.gotoAndStop("1HitKill");
isComboRecord = true;
};
if (!isComboRecord){
nextLevelP();
};
};
if ((((((chance_arr.length == 0)) && ((pin_arr.length > 0)))) && ((beamCount == 0)))){
if (!isComboRecord){
gameOverP();
};
};
}
public function onMusicClickTitle(_arg1:MouseEvent):void{
if (isMusicOn){
isMusicOn = false;
audioOffBtn.visible = false;
audioOnBtn.visible = true;
if (title_snd_buf){
title_snd_buf.stop();
};
isTitlePlaying = false;
} else {
if (isMusicOn){
click_snd.play(0, 1);
};
isTitlePlaying = true;
isMusicOn = true;
audioOffBtn.visible = true;
audioOnBtn.visible = false;
if (title_snd_buf){
title_snd_buf.stop();
};
title_snd_buf = title_snd.play(0, 999);
};
}
public function goodjob(_arg1:Event):void{
closeLeaderboard();
}
public function removeTitleBtnEvent():void{
arcadeBtn.removeEventListener(MouseEvent.CLICK, onTitleBtn);
puzzle2Btn.removeEventListener(MouseEvent.CLICK, onTitleBtn);
customBtn.removeEventListener(MouseEvent.CLICK, onTitleBtn);
recordBtn.removeEventListener(MouseEvent.CLICK, onTitleBtn);
creditBtn.removeEventListener(MouseEvent.CLICK, onTitleBtn);
otherBtn.removeEventListener(MouseEvent.CLICK, onTitleBtn);
}
public function onWinClick(_arg1:MouseEvent):void{
if (((isMusicOn) && (_arg1))){
click_snd.play(0, 1);
};
winTimer.stop();
winTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onWinTimer);
stage.removeEventListener(MouseEvent.CLICK, onWinClick);
gotoAndStop("inputScore");
}
public function initApplication(_arg1:Event):void{
loaderSprite.graphics.clear();
removeChild(loaderSprite);
gotoAndStop("entry");
}
public function nextLevelC():void{
trace("nextLevelC");
chance = chance_arr.length;
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEventC();
resultMc.visible = true;
resultMc.retryBtn.addEventListener(MouseEvent.CLICK, onCustomResult);
resultMc.exitBtn.addEventListener(MouseEvent.CLICK, onCustomResult);
}
public function nextLevelP():void{
var _local1:SharedObject;
_local1 = SharedObject.getLocal("assaultcarnivale");
trace(("timesClick=" + timesClick));
if (_local1.data.unlockedPuzzleLevel <= puzzleLevel){
_local1.data.unlockedPuzzleLevel = (puzzleLevel + 1);
(_local1.data.puzzleAwards as Array).push(is1HitKill);
} else {
if ((_local1.data.puzzleAwards as Array)[(puzzleLevel - 1)] != true){
(_local1.data.puzzleAwards as Array)[(puzzleLevel - 1)] = is1HitKill;
};
};
_local1.flush();
if (puzzleLevel <= 29){
puzzleLevel++;
} else {
puzzleComplete = true;
};
isPuzzleWin = true;
chance = chance_arr.length;
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEventP();
setChildIndex(transition_mc, (numChildren - 1));
transition_mc.gotoAndPlay("turun");
stage.addEventListener(Event.ENTER_FRAME, onTransitionP);
}
public function onLoseTimer(_arg1:TimerEvent):void{
onLoseClick(null);
}
public function onTransitionC(_arg1:Event):void{
if (transition_mc.doneTurun == true){
if (isRetry){
initC();
} else {
if (game_snd_buf){
game_snd_buf.stop();
};
if (isTest){
gotoAndStop("customCreate", "Scene 4");
} else {
gotoAndStop("customSelect");
};
};
transition_mc.gotoAndPlay("naik");
} else {
if (transition_mc.doneNaik == true){
transition_mc.gotoAndStop("turun");
stage.removeEventListener(Event.ENTER_FRAME, onTransitionC);
};
};
}
public function updateWall():void{
characterSelect.filters = [];
bonusSelect.filters = [];
bufferBonus = "";
wallSelect.filters = [selectGlow];
if (wallSelect.currentFrame == 1){
bufferObject = "v";
} else {
if (wallSelect.currentFrame == 2){
bufferObject = "h";
};
};
}
public function fadeUp(_arg1:Event):void{
var _local2:MovieClip;
_local2 = MovieClip(_arg1.target);
if (_local2.alpha <= 0){
_local2.removeEventListener(Event.ENTER_FRAME, fadeUp);
_local2.parent.removeChild(_local2);
if ((_local2 is ComboScoreMC)){
comboScore_mc = null;
};
} else {
_local2.y = (_local2.y - 1);
_local2.alpha = (_local2.alpha - 0.03);
};
}
public function onTransitionP(_arg1:Event):void{
if (transition_mc.doneTurun == true){
if (((isPuzzleWin) && (!(puzzleComplete)))){
initP();
} else {
if (game_snd_buf){
game_snd_buf.stop();
};
gotoAndStop("puzzleSelect");
};
transition_mc.gotoAndPlay("naik");
} else {
if (transition_mc.doneNaik == true){
transition_mc.gotoAndStop("turun");
stage.removeEventListener(Event.ENTER_FRAME, onTransitionP);
};
};
}
public function initPuzzleButton():void{
var _local1:int;
var _local2:PuzzleBtn;
var _local3:uint;
puzzleBtn_arr = [];
_local1 = 29;
while (_local1 >= 0) {
_local2 = new PuzzleBtn();
_local3 = 0xFFFFFF;
addChildAt(_local2, (numChildren - 1));
_local2.x = (((_local1 % 6) * 60) + 95);
_local2.y = ((Math.floor((_local1 / 6)) * 50) + 110);
if (_local1 < unlockedPuzzleLevel){
_local2.gotoAndStop("active");
_local2.buttonMode = (_local2.mouseEnabled = true);
_local2.theText.mouseEnabled = false;
_local2.addEventListener(MouseEvent.CLICK, onPuzzleSelect);
_local3 = 0xD28E00;
} else {
_local2.gotoAndStop("nonactive");
_local3 = 9079177;
};
if (puzzleAwards){
if (puzzleAwards[_local1] == true){
_local2.gotoAndStop("perfect");
_local3 = 0xEBE300;
};
};
_local2.theText.textColor = _local3;
_local2.theText.text = ("" + (_local1 + 1));
puzzleBtn_arr.push(_local2);
_local1--;
};
}
public function removeBeam(_arg1:MovieClip):void{
var _local2:int;
trace("removeBeam");
_arg1.removeEventListener(Event.ENTER_FRAME, onBeamMove);
_arg1.parent.removeChild(_arg1);
beamCount--;
_local2 = 0;
while (_local2 < beam_arr.length) {
if (beam_arr[_local2] == _arg1){
beam_arr.splice(_local2, 1);
};
_local2++;
};
trace(("beamCount=" + beamCount));
if (beamCount == 0){
trace("removeChild");
if (comboScore_mc){
comboScore_mc.width = 65;
comboScore_mc.height = 24;
comboScore_mc.addEventListener(Event.ENTER_FRAME, fadeUp);
comboScore_mc.removeEventListener(Event.ENTER_FRAME, onComboAnimation);
};
};
}
public function onPuzzleSelect(_arg1:MouseEvent):void{
var _local2:int;
if (isMusicOn){
click_snd.play(0, 1);
};
puzzleLevel = int(PuzzleBtn(_arg1.currentTarget).theText.text);
_local2 = 0;
while (_local2 < puzzleBtn_arr.length) {
puzzleBtn_arr[_local2].removeEventListener(MouseEvent.CLICK, onPuzzleSelect);
removeChild(puzzleBtn_arr[_local2]);
_local2++;
};
puzzleBtn_arr = null;
gotoAndStop("puzzle");
}
public function initPin():void{
var _local1:Object;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:MovieClip;
var _local10:int;
var _local11:int;
var _local12:Object;
var _local13:MovieClip;
var _local14:MovieClip;
_local1 = levelObj.getLevelObject(level);
_local2 = _local1.type0;
_local3 = _local1.type1;
_local4 = _local1.type2;
_local5 = _local1.level;
_local6 = (36 - ((_local2 + _local3) + _local4));
_local7 = 0;
while (_local7 < 36) {
_local9 = null;
if (_local2 > 0){
_local8 = 0;
_local2--;
} else {
if (_local3 > 0){
_local8 = 1;
_local3--;
} else {
if (_local4 > 0){
_local8 = 2;
_local4--;
} else {
if (_local6 > 0){
_local8 = 3;
_local6--;
};
};
};
};
if (_local8 == 0){
_local9 = new PinMC();
} else {
if (_local8 == 1){
_local9 = new Pin1MC();
} else {
if (_local8 == 2){
_local9 = new Pin2MC();
};
};
};
if (_local9 != null){
if (_local13){
_local9.bonusHolder_mc.addChild(_local13);
_local13.x = -20;
_local13.y = 10;
_local9.bonus = _local13;
};
_local9.addEventListener(MouseEvent.CLICK, onPinClick);
_local10 = (Math.random() * 100);
if (_local10 < 20){
_local10 = 1;
} else {
if (_local10 < 45){
_local10 = 2;
} else {
if (_local10 < 75){
_local10 = 3;
} else {
_local10 = 4;
};
};
};
if (_local10 < _local5){
_local10 = _local5;
};
_local9.gotoAndStop(("pin" + _local10));
};
pin_arr.push(_local9);
_local7++;
};
_local7 = 0;
while (_local7 < pin_arr.length) {
_local11 = (Math.random() * 36);
_local12 = pin_arr[_local11];
pin_arr[_local11] = pin_arr[_local7];
pin_arr[_local7] = _local12;
_local13 = initBonus(_local7);
if (((_local13) && (!((pin_arr[_local7] == null))))){
pin_arr[_local7].bonusHolder_mc.addChild(_local13);
_local13.x = -20;
_local13.y = 10;
pin_arr[_local7].bonus = _local13;
};
_local7++;
};
_local7 = 0;
while (_local7 < 36) {
_local14 = pin_arr[_local7];
if (_local14 != null){
addChildAt(_local14, (numChildren - 2));
_local14.x = (48 + (61 * (_local7 % 6)));
_local14.y = (48 + (61 * Math.floor((_local7 / 6))));
};
_local7++;
};
_local7 = pin_arr.length;
while (_local7 >= 0) {
if (pin_arr[_local7] == null){
pin_arr.splice(_local7, 1);
};
_local7--;
};
if (_local1.dialog){
setChildIndex(dialogMc, (numChildren - 2));
dialogMc.visible = true;
dialogMc.alpha = 1;
dialogMc.dialogTxt.text = _local1.dialog;
dialogMc.dialogTxt.autoSize = TextFieldAutoSize.LEFT;
dialogMc.dialogBackMc.height = (dialogMc.dialogTxt.height + 10);
};
}
public function onFailedPuzzle(_arg1:MouseEvent=null):void{
switch (_arg1.currentTarget){
case failedPuzzle.retryBtn:
isPuzzleWin = true;
setChildIndex(transition_mc, (numChildren - 1));
transition_mc.gotoAndPlay("turun");
stage.addEventListener(Event.ENTER_FRAME, onTransitionP);
break;
case failedPuzzle.returnBtn:
trueGameOverP();
break;
};
failedPuzzle.visible = false;
}
public function onCustomResult(_arg1:MouseEvent):void{
switch (_arg1.currentTarget){
case resultMc.retryBtn:
isRetry = true;
onFinished(null);
break;
case resultMc.exitBtn:
isRetry = false;
trueGameOverC();
break;
};
resultMc.visible = false;
}
public function removePin(_arg1:MovieClip):void{
var _local2:int;
_local2 = 0;
while (_local2 < pin_arr.length) {
if (pin_arr[_local2] == _arg1){
_arg1.removeEventListener(MouseEvent.CLICK, onPinClick);
removeChild(_arg1);
pin_arr.splice(_local2, 1);
break;
};
_local2++;
};
}
public function initDialog():void{
timer.stop();
delayScreen.visible = true;
setChildIndex(dialogMc, (numChildren - 2));
setChildIndex(penyihir_mc, (numChildren - 2));
setChildIndex(delayScreen, (numChildren - 4));
}
public function addScore(_arg1:int):void{
this.targetScore = (this.targetScore + _arg1);
}
public function initPinC():void{
var _local1:Array;
var _local2:int;
var _local3:Object;
var _local4:int;
var _local5:MovieClip;
var _local6:int;
var _local7:MovieClip;
_local1 = customItem.pin;
_local2 = 0;
while (_local2 < _local1.length) {
_local3 = _local1[_local2];
_local4 = _local3.type;
_local5 = null;
if (_local4 == 0){
_local5 = new PinMC();
} else {
if (_local4 == 1){
_local5 = new Pin1MC();
} else {
if (_local4 == 2){
_local5 = new Pin2MC();
};
};
};
if (_local5 != null){
if (_local3.bonusType != null){
_local7 = initBonusC(_local3.bonusType);
_local5.bonusHolder_mc.addChild(_local7);
_local7.x = -20;
_local7.y = 10;
_local5.bonus = _local7;
};
_local5.addEventListener(MouseEvent.CLICK, onPinClick);
_local6 = _local3.level;
_local5.gotoAndStop(("pin" + _local6));
_local5.x = (48 + (61 * _local3.x));
_local5.y = (48 + (61 * _local3.y));
};
addChildAt(_local5, (numChildren - 1));
pin_arr.push(_local5);
_local2++;
};
}
public function closeLeaderboard():void{
if (lose_snd_buf){
lose_snd_buf.stop();
};
if (win_snd_buf){
win_snd_buf.stop();
};
gotoAndStop("title");
}
public function onModeClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
if (beamSpeed == 8){
beamSpeed = 15;
modeFastBtn.visible = false;
modeNormalBtn.visible = true;
} else {
beamSpeed = 8;
modeNormalBtn.visible = false;
modeFastBtn.visible = true;
};
}
public function encodeCustomLevel():String{
var _local1:String;
var _local2:int;
var _local3:MovieClip;
var _local4:WallMC;
_local1 = "";
if (tempItems.length == 0){
return ("You need at least 1 Soldier unit to generate the level code!");
};
_local2 = 0;
while (_local2 < tempItems.length) {
_local3 = tempItems[_local2];
_local1 = (_local1 + "p");
if ((_local3 is PinMC)){
_local1 = (_local1 + "0");
} else {
if ((_local3 is Pin1MC)){
_local1 = (_local1 + "1");
} else {
if ((_local3 is Pin2MC)){
_local1 = (_local1 + "2");
};
};
};
if (_local3.currentFrame == 1){
_local1 = (_local1 + "1");
} else {
if (_local3.currentFrame == 6){
_local1 = (_local1 + "2");
} else {
if (_local3.currentFrame == 11){
_local1 = (_local1 + "3");
} else {
if (_local3.currentFrame == 16){
_local1 = (_local1 + "4");
};
};
};
};
_local1 = (_local1 + ("" + ((_local3.x - 48) / 61)));
_local1 = (_local1 + ("" + ((_local3.y - 48) / 61)));
if (_local3.bonus){
if ((_local3.bonus is Bonus2X)){
_local1 = (_local1 + "1");
} else {
if ((_local3.bonus is Bonus3X)){
_local1 = (_local1 + "2");
} else {
if ((_local3.bonus is Bonus45Degree)){
_local1 = (_local1 + "3");
} else {
if ((_local3.bonus is BonusDouble)){
_local1 = (_local1 + "4");
} else {
if ((_local3.bonus is BonusPower)){
_local1 = (_local1 + "5");
};
};
};
};
};
} else {
_local1 = (_local1 + "0");
};
_local1 = (_local1 + "r");
_local2++;
};
_local2 = 0;
while (_local2 < tempWalls.length) {
_local4 = tempWalls[_local2];
_local1 = (_local1 + "w");
if (_local4.currentFrame == 1){
_local1 = (_local1 + "v");
} else {
if (_local4.currentFrame == 2){
_local1 = (_local1 + "h");
};
};
_local1 = (_local1 + ("" + ((_local4.x - 18) / 60)));
_local1 = (_local1 + ("" + ((_local4.y - 17) / 60)));
_local1 = (_local1 + "r");
_local2++;
};
powerCountNum = powerCount.value;
_local1 = (_local1 + ("c" + powerCount.value));
return (_local1);
}
public function initPinP():void{
var _local1:Array;
var _local2:int;
var _local3:Object;
var _local4:int;
var _local5:MovieClip;
var _local6:int;
var _local7:MovieClip;
_local1 = puzzleItem.pin;
_local2 = 0;
while (_local2 < _local1.length) {
_local3 = _local1[_local2];
_local4 = _local3.type;
_local5 = null;
if (_local4 == 0){
_local5 = new PinMC();
} else {
if (_local4 == 1){
_local5 = new Pin1MC();
} else {
if (_local4 == 2){
_local5 = new Pin2MC();
};
};
};
if (_local5 != null){
if (_local3.bonusType != null){
_local7 = initBonusP(_local3.bonusType);
_local5.bonusHolder_mc.addChild(_local7);
_local7.x = -20;
_local7.y = 10;
_local5.bonus = _local7;
};
_local5.addEventListener(MouseEvent.CLICK, onPinClick);
_local6 = _local3.level;
_local5.gotoAndStop(("pin" + _local6));
_local5.x = (48 + (61 * _local3.x));
_local5.y = (48 + (61 * _local3.y));
};
addChildAt(_local5, (numChildren - 1));
pin_arr.push(_local5);
_local2++;
};
}
public function onCreditClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
stage.removeEventListener(MouseEvent.CLICK, onCreditClick);
gotoAndStop("title");
}
public function linkPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.gamesfree.com"));
}
public function cekComboScore():void{
if (comboScore_mc == null){
trace("create comboScore");
comboScore_mc = new ComboScoreMC();
addChild(comboScore_mc);
comboScore_mc.x = 200;
comboScore_mc.y = 199;
comboScore_mc.comboScore_txt.selectable = false;
comboScore_mc.comboScore_txt.text = String(comboCount);
comboScore_mc.addEventListener(Event.ENTER_FRAME, onComboAnimation);
comboScore_mc.width = 300;
comboScore_mc.height = 300;
} else {
comboScore_mc.comboScore_txt.text = String(comboCount);
comboScore_mc.removeEventListener(Event.ENTER_FRAME, fadeUp);
comboScore_mc.alpha = 1;
comboScore_mc.removeEventListener(Event.ENTER_FRAME, onComboAnimation);
comboScore_mc.width = 300;
comboScore_mc.height = 300;
comboScore_mc.x = 200;
comboScore_mc.y = 199;
comboScore_mc.addEventListener(Event.ENTER_FRAME, onComboAnimation);
};
}
public function initWall():void{
var _local1:int;
var _local2:int;
var _local3:MovieClip;
_local1 = (Math.floor((level / 2)) - 4);
_local2 = 0;
while (_local2 < _local1) {
_local3 = new WallMC();
_local3.x = ((int((Math.random() * 5)) * 60) + 78);
_local3.y = ((int((Math.random() * 4)) * 60) + 77);
if ((int((Math.random() * 2)) == 1)){
_local3.gotoAndStop(2);
} else {
_local3.stop();
};
addChildAt(_local3, (getChildIndex(dialogMc) - 1));
wall_arr.push(_local3);
_local2++;
};
}
public function initCuzzleItem():void{
customItem = decodeCustomLevel(customCode2);
}
public function createPinScore(_arg1:MovieClip, _arg2:int):void{
var _local3:PinScoreMC;
_local3 = new PinScoreMC();
_local3.mouseEnabled = false;
_local3.pinScore_txt.mouseEnabled = false;
_local3.pinScore_txt.selectable = false;
addChild(_local3);
_local3.x = _arg1.x;
_local3.y = _arg1.y;
_local3.pinScore_txt.text = String(_arg2);
_local3.addEventListener(Event.ENTER_FRAME, fadeUp);
}
public function onBeamMove(_arg1:Event):void{
var _local2:BeamMC;
var _local3:int;
_local2 = BeamMC(_arg1.target);
_local2.x = (_local2.x + (Math.sin((_local2.rotation * (Math.PI / 180))) * _local2.speed));
_local2.y = (_local2.y - (Math.cos((_local2.rotation * (Math.PI / 180))) * _local2.speed));
if ((((((((_local2.x < 10)) || ((_local2.x > 385)))) || ((_local2.y < 10)))) || ((_local2.y > 380)))){
trace("BeamMC out of bound");
removeBeam(_local2);
} else {
_local3 = (wall_arr.length - 1);
while (_local3 >= 0) {
if (PixelCollision.isColliding(_local2, wall_arr[_local3], this, true)){
trace("hitWall");
removeBeam(_local2);
};
_local3--;
};
_local3 = (pin_arr.length - 1);
while (_local3 >= 0) {
if (PixelCollision.isColliding(_local2, pin_arr[_local3], this, true)){
if (_local2.power){
trace(("hitPower-" + _local3));
hitPin(pin_arr[_local3], false);
removeBeam(_local2);
} else {
if ((((_local2.filters[0].color == 0xFF0000)) && (!((pin_arr[_local3] is Pin2MC))))){
trace(("hitPin1-" + _local3));
hitPin(pin_arr[_local3], false);
removeBeam(_local2);
} else {
if ((((_local2.filters[0].color == 0xFF)) && (!((pin_arr[_local3] is PinMC))))){
trace(("hitPin2-" + _local3));
hitPin(pin_arr[_local3], false);
removeBeam(_local2);
} else {
if ((((_local2.filters[0].color == 0xFFFF00)) && (!((pin_arr[_local3] is Pin1MC))))){
trace(("hitPin3-" + _local3));
hitPin(pin_arr[_local3], false);
removeBeam(_local2);
} else {
trace(("noHit-" + _local3));
removeBeam(_local2);
};
};
};
};
};
_local3--;
};
};
}
public function onLeaderboardClosed():void{
gotoAndStop("score", "Scene 1");
}
public function onNextClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
customCode2 = codeDisplay.theText.text;
trace(("customCode=" + customCode2));
codeDisplay.visible = false;
codeDisplay.playCustomBtn.removeEventListener(MouseEvent.CLICK, onNextClick);
gotoAndStop("customPlay", "Scene 4");
}
public function addChance():void{
chance_arr.push({chance:"chance"});
power_txt.text = ("Power\n" + chance_arr.length);
}
public function trueGameOverC():void{
trace("gameOverC");
if (comboCount > maxCombo){
maxCombo = comboCount;
};
if (game_snd_buf){
game_snd_buf.stop();
};
onFinished(null);
}
public function trueGameOverP():void{
if (comboCount > maxCombo){
maxCombo = comboCount;
};
isPuzzleWin = false;
if (game_snd_buf){
game_snd_buf.stop();
};
setChildIndex(transition_mc, (numChildren - 1));
transition_mc.gotoAndPlay("turun");
stage.addEventListener(Event.ENTER_FRAME, onTransitionP);
}
public function onPause(_arg1:MouseEvent):void{
if (timer.running){
setChildIndex(pauseScreen, (numChildren - 1));
pauseScreen.visible = true;
timer.stop();
} else {
pauseScreen.visible = false;
timer.start();
};
}
public function onReturnTitleClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
_arg1.currentTarget.removeEventListener(MouseEvent.CLICK, onReturnTitleClick);
if (lose_snd_buf){
lose_snd_buf.stop();
};
if (win_snd_buf){
win_snd_buf.stop();
};
gotoAndStop("initData", "Scene 1");
}
public function onFinished(_arg1:TimerEvent):void{
trace("onFinished");
resultMc.visible = false;
if (incorrectTimer){
incorrectTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onFinished);
};
if (transition_mc.parent == this){
setChildIndex(transition_mc, (numChildren - 1));
transition_mc.gotoAndPlay("turun");
};
stage.addEventListener(Event.ENTER_FRAME, onTransitionC);
}
public function onUpdate(_arg1:Event):void{
if (score < targetScore){
score = (score + ((targetScore - score) / 10));
score_mc.score_txt.text = ("SCORE " + this.score);
};
if (pin_arr.length == 0){
trace(("timesClick=" + timesClick));
if (timesClick == 1){
timesClick = (timesClick - 1);
if (!combo_mc.visible){
combo_mc.visible = true;
};
setChildIndex(combo_mc, (numChildren - 2));
combo_mc.gotoAndStop("1HitKill");
isComboRecord = true;
};
if (!isComboRecord){
nextLevel();
};
};
if ((((((chance_arr.length == 0)) && ((pin_arr.length > 0)))) && ((beamCount == 0)))){
if (!isComboRecord){
gameOver();
};
};
}
public function handleComplete(_arg1:Event):void{
var _local2:URLLoader;
var _local3:Array;
trace("score loaded");
_local2 = URLLoader(_arg1.target);
trace(viewscores);
trace(_local2.data);
_local3 = String(_local2.data).split("&");
loadingMc.visible = false;
viewscores.name1.text = _local3[0].split("=")[1];
viewscores.score1.text = _local3[1].split("=")[1];
viewscores.name2.text = _local3[2].split("=")[1];
viewscores.score2.text = _local3[3].split("=")[1];
viewscores.name3.text = _local3[4].split("=")[1];
viewscores.score3.text = _local3[5].split("=")[1];
viewscores.name4.text = _local3[6].split("=")[1];
viewscores.score4.text = _local3[7].split("=")[1];
viewscores.name5.text = _local3[8].split("=")[1];
viewscores.score5.text = _local3[9].split("=")[1];
viewscores.name6.text = _local3[10].split("=")[1];
viewscores.score6.text = _local3[11].split("=")[1];
viewscores.name7.text = _local3[12].split("=")[1];
viewscores.score7.text = _local3[13].split("=")[1];
viewscores.name8.text = _local3[14].split("=")[1];
viewscores.score8.text = _local3[15].split("=")[1];
viewscores.name9.text = _local3[16].split("=")[1];
viewscores.score9.text = _local3[17].split("=")[1];
viewscores.name10.text = _local3[18].split("=")[1];
viewscores.score10.text = _local3[19].split("=")[1];
viewscores.name11.text = _local3[20].split("=")[1];
viewscores.score11.text = _local3[21].split("=")[1];
viewscores.name12.text = _local3[22].split("=")[1];
viewscores.score12.text = _local3[23].split("=")[1];
viewscores.name13.text = _local3[24].split("=")[1];
viewscores.score13.text = _local3[25].split("=")[1];
viewscores.name14.text = _local3[26].split("=")[1];
viewscores.score14.text = _local3[27].split("=")[1];
viewscores.name15.text = _local3[28].split("=")[1];
viewscores.score15.text = _local3[29].split("=")[1];
viewscores.name16.text = _local3[30].split("=")[1];
viewscores.score16.text = _local3[31].split("=")[1];
viewscores.name17.text = _local3[32].split("=")[1];
viewscores.score17.text = _local3[33].split("=")[1];
viewscores.name18.text = _local3[34].split("=")[1];
viewscores.score18.text = _local3[35].split("=")[1];
viewscores.name19.text = _local3[36].split("=")[1];
viewscores.score19.text = _local3[37].split("=")[1];
viewscores.name20.text = _local3[38].split("=")[1];
viewscores.score20.text = _local3[39].split("=")[1];
}
public function clearBeam():void{
var _local1:int;
trace("cleanBeam");
_local1 = (beamCount - 1);
while (_local1 >= 0) {
removeBeam(beam_arr[_local1]);
_local1--;
};
}
public function removeMainEventC():void{
stage.removeEventListener(Event.ENTER_FRAME, onUpdateC);
timer.stop();
if (comboScore_mc){
comboScore_mc.removeEventListener(Event.ENTER_FRAME, fadeUp);
comboScore_mc.removeEventListener(Event.ENTER_FRAME, onComboAnimation);
comboScore_mc.parent.removeChild(comboScore_mc);
comboScore_mc = null;
};
}
public function onTickC(_arg1:TimerEvent):void{
time--;
time_txt.text = ("Time " + String(time));
if ((((time == 0)) && ((pin_arr.length > 0)))){
if (pin_arr.length > 0){
gameOverC();
} else {
nextLevelC();
};
};
}
public function onHelpClick(_arg1:MouseEvent):void{
if (isMusicOn){
click_snd.play(0, 1);
};
helpMc.removeEventListener(MouseEvent.CLICK, onHelpClick);
helpMc.visible = false;
initCreateCustom();
}
public function removeMainEventP():void{
stage.removeEventListener(Event.ENTER_FRAME, onUpdateP);
timer.stop();
if (comboScore_mc){
comboScore_mc.removeEventListener(Event.ENTER_FRAME, fadeUp);
comboScore_mc.removeEventListener(Event.ENTER_FRAME, onComboAnimation);
comboScore_mc.parent.removeChild(comboScore_mc);
comboScore_mc = null;
};
}
public function onTickP(_arg1:TimerEvent):void{
time--;
time_txt.text = ("Time " + String(time));
if ((((time == 0)) && ((pin_arr.length > 0)))){
if (pin_arr.length > 0){
gameOverP();
} else {
nextLevelP();
};
};
}
public function decodeCustomLevel(_arg1:String):Object{
var tempLevel:Object;
var tempPin:Array;
var tempWall:Array;
var customObjects:Array;
var i:int;
var tempString:String;
var bonus:String;
var tempCode = _arg1;
tempLevel = {};
tempPin = [];
tempWall = [];
customObjects = tempCode.split("r");
try {
i = 0;
while (i < customObjects.length) {
tempString = customObjects[i];
trace(("tempString=" + tempString));
if (tempString.charAt(0) == "p"){
switch (tempString.charAt(5)){
case "0":
bonus = null;
break;
case "1":
bonus = BonusType.BONUS_2X;
break;
case "2":
bonus = BonusType.BONUS_3X;
break;
case "3":
bonus = BonusType.BONUS_45_DEGREE;
break;
case "4":
bonus = BonusType.BONUS_DOUBLE_ATTACK;
break;
case "5":
bonus = BonusType.BONUS_POWER_ATTACK;
break;
default:
return (null);
break;
};
tempPin.push({type:tempString.charAt(1), level:tempString.charAt(2), x:tempString.charAt(3), y:tempString.charAt(4), bonusType:bonus});
} else {
if (tempString.charAt(0) == "w"){
tempWall.push({type:tempString.charAt(1), x:tempString.charAt(2), y:tempString.charAt(3)});
} else {
if (tempString.charAt(0) == "c"){
tempLevel.chance = int(tempString.substr(1, tempString.length));
} else {
return (null);
};
};
};
i = (i + 1);
};
} catch(error:Error) {
return (null);
};
tempLevel.pin = tempPin;
tempLevel.wall = tempWall;
return (tempLevel);
}
public function onWinTimer(_arg1:TimerEvent):void{
onWinClick(null);
}
public function clearChance():void{
while (chance_arr.length > 0) {
removeChance();
};
}
public function onTitleBtn(_arg1:MouseEvent):void{
var event = _arg1;
if (isMusicOn){
click_snd.play(0, 1);
};
if (event.currentTarget == otherBtn){
navigateToURL(new URLRequest("http://www.gamesfree.com"));
} else {
removeTitleBtnEvent();
TweenLite.to(otherBtn, 0.6, {scaleX:0.2, scaleY:0.2, onComplete:function ():void{
otherBtn.visible = false;
}});
TweenLite.to(creditBtn, 0.6, {delay:0.1, scaleX:0.2, scaleY:0.2, onComplete:function ():void{
creditBtn.visible = false;
}});
TweenLite.to(recordBtn, 0.6, {delay:0.1, scaleX:0.2, scaleY:0.2, onComplete:function ():void{
recordBtn.visible = false;
}});
TweenLite.to(customBtn, 0.6, {delay:0.2, scaleX:0.2, scaleY:0.2, onComplete:function ():void{
customBtn.visible = false;
}});
TweenLite.to(puzzle2Btn, 0.6, {delay:0.3, scaleX:0.2, scaleY:0.2, onComplete:function ():void{
puzzle2Btn.visible = false;
}});
TweenLite.to(arcadeBtn, 0.6, {delay:0.4, scaleX:0.2, scaleY:0.2, onComplete:function ():void{
arcadeBtn.visible = false;
}});
TweenLite.to(mainMenu, 0.6, {delay:0.5, scaleX:0.2, scaleY:0.2, onComplete:function ():void{
mainMenu.visible = false;
}});
TweenLite.to(titleContainer, 0.7, {delay:1, scaleY:0.01, onComplete:goTarget, onCompleteParams:[event.currentTarget]});
};
}
public function gameOver():void{
if (comboCount > maxCombo){
maxCombo = comboCount;
};
trace("GameOver");
clearChance();
clearBeam();
clearPin();
clearWall();
removeMainEvent();
removeChild(penyihir_mc);
gotoAndStop("lose");
}
public function sendScore():void{
var _local1:URLVariables;
var _local2:URLRequest;
var _local3:URLLoader;
_local1 = new URLVariables();
_local1.n = name_txt.text;
_local1.s = score;
_local1.k = MD5.hash(("" + (score + 1518)));
_local1.m = 1;
trace(_local1);
_local2 = new URLRequest("http://hiscore.gamesfree.com/assaultcarnivale_submit.php");
_local2.method = "POST";
_local2.data = _local1;
_local3 = new URLLoader();
_local3.load(_local2);
_local3.addEventListener(Event.COMPLETE, goodjob);
}
public function addBeam(_arg1:int, _arg2:int, _arg3:int, _arg4:int=0, _arg5:int=0, _arg6:Boolean=false):void{
var _local7:GlowFilter;
var _local8:BeamMC;
_local7 = new GlowFilter();
if (_arg3 == 1){
_local7.color = 0xFF;
} else {
if (_arg3 == 2){
_local7.color = 0xFFFF00;
} else {
_local7.color = 0xFF0000;
};
};
_local7.alpha = 1;
_local7.blurX = 7;
_local7.blurY = 7;
_local7.strength = 45;
_local8 = new BeamMC();
addChild(_local8);
_local8.x = _arg1;
_local8.y = _arg2;
_local8.speed = beamSpeed;
_local8.filters = [_local7];
if (_arg3 == 1){
_local8.rotation = (45 + _arg4);
} else {
if (_arg3 == 2){
_local8.rotation = (90 + _arg4);
} else {
_local8.rotation = (0 + _arg4);
};
};
if (_arg6){
_local8.power = true;
};
_local8.addEventListener(Event.ENTER_FRAME, onBeamMove);
beam_arr.push(_local8);
if (_arg5 > 0){
_local8.x = (_local8.x + (Math.sin((_local8.rotation * (Math.PI / 180))) * _arg5));
_local8.y = (_local8.y - (Math.cos((_local8.rotation * (Math.PI / 180))) * _arg5));
};
_local8 = new BeamMC();
addChild(_local8);
_local8.x = _arg1;
_local8.y = _arg2;
_local8.speed = beamSpeed;
_local8.filters = [_local7];
if (_arg3 == 1){
_local8.rotation = (135 + _arg4);
} else {
if (_arg3 == 2){
_local8.rotation = (135 + _arg4);
} else {
_local8.rotation = (90 + _arg4);
};
};
if (_arg6){
_local8.power = true;
};
_local8.addEventListener(Event.ENTER_FRAME, onBeamMove);
beam_arr.push(_local8);
if (_arg5 > 0){
_local8.x = (_local8.x + (Math.sin((_local8.rotation * (Math.PI / 180))) * _arg5));
_local8.y = (_local8.y - (Math.cos((_local8.rotation * (Math.PI / 180))) * _arg5));
};
_local8 = new BeamMC();
addChild(_local8);
_local8.x = _arg1;
_local8.y = _arg2;
_local8.speed = beamSpeed;
_local8.filters = [_local7];
if (_arg3 == 1){
_local8.rotation = (225 + _arg4);
} else {
if (_arg3 == 2){
_local8.rotation = (270 + _arg4);
} else {
_local8.rotation = (180 + _arg4);
};
};
if (_arg6){
_local8.power = true;
};
_local8.addEventListener(Event.ENTER_FRAME, onBeamMove);
beam_arr.push(_local8);
if (_arg5 > 0){
_local8.x = (_local8.x + (Math.sin((_local8.rotation * (Math.PI / 180))) * _arg5));
_local8.y = (_local8.y - (Math.cos((_local8.rotation * (Math.PI / 180))) * _arg5));
};
_local8 = new BeamMC();
addChild(_local8);
_local8.x = _arg1;
_local8.y = _arg2;
_local8.speed = beamSpeed;
_local8.filters = [_local7];
if (_arg3 == 1){
_local8.rotation = (315 + _arg4);
} else {
if (_arg3 == 2){
_local8.rotation = (315 + _arg4);
} else {
_local8.rotation = (270 + _arg4);
};
};
if (_arg6){
_local8.power = true;
};
_local8.addEventListener(Event.ENTER_FRAME, onBeamMove);
beam_arr.push(_local8);
if (_arg5 > 0){
_local8.x = (_local8.x + (Math.sin((_local8.rotation * (Math.PI / 180))) * _arg5));
_local8.y = (_local8.y - (Math.cos((_local8.rotation * (Math.PI / 180))) * _arg5));
};
beamCount = (beamCount + 4);
}
public function onPinClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:Sound;
trace(_arg1.target);
if (dialogMc){
dialogMc.alpha = 0;
};
if ((((chance_arr.length > 0)) && ((beamCount == 0)))){
if (isMusicOn){
_local4 = new BUMP();
_local4.play(100, 1);
};
penyihir_mc.gotoAndPlay(2);
totalClick++;
comboScore = 100;
if (comboCount > maxCombo){
maxCombo = comboCount;
};
comboCount = 0;
removeChance();
_local2 = MovieClip(_arg1.target);
hitPin(_local2, true);
_local3 = new KilatMC();
_local3.x = _local2.x;
_local3.y = _local2.y;
addChild(_local3);
};
}
public function onCustomCreateBtnClick(_arg1:MouseEvent):void{
var _local2:int;
if (isMusicOn){
click_snd.play(0, 1);
};
stage.removeEventListener(MouseEvent.CLICK, onAddCustomObject);
switch (_arg1.currentTarget){
case codeBtn:
codeDisplay.theText.text = encodeCustomLevel();
setChildIndex(codeDisplay, (numChildren - 1));
codeDisplay.visible = true;
codeDisplay.returnBtn.addEventListener(MouseEvent.CLICK, onCloseCodeDisplay);
if (codeDisplay.theText.text == "You need at least 1 Soldier unit to generate the level code!"){
codeDisplay.facebookBtn.mouseEnabled = false;
codeDisplay.twitterBtn.mouseEnabled = false;
} else {
codeDisplay.facebookBtn.mouseEnabled = true;
codeDisplay.twitterBtn.mouseEnabled = true;
};
break;
case testBtn:
if (tempItems.length > 0){
_local2 = 0;
while (_local2 < tempItems.length) {
removeChild(tempItems[_local2]);
_local2++;
};
_local2 = 0;
while (_local2 < tempWalls.length) {
removeChild(tempWalls[_local2]);
_local2++;
};
customCode2 = encodeCustomLevel();
isTest = true;
gotoAndStop("customPlay", "Scene 4");
} else {
stage.addEventListener(MouseEvent.CLICK, onAddCustomObject);
};
break;
case mainMenuBtn:
_local2 = 0;
while (_local2 < tempItems.length) {
removeChild(tempItems[_local2]);
_local2++;
};
_local2 = 0;
while (_local2 < tempWalls.length) {
removeChild(tempWalls[_local2]);
_local2++;
};
if (isMusicOn){
click_snd.play(0, 1);
};
if (game_snd_buf){
game_snd_buf.stop();
};
gotoAndStop("title", "Scene 1");
break;
};
}
}
}//package AssaultCarnivale_fla
Section 29
//pedangmerah20_12 (AssaultCarnivale_fla.pedangmerah20_12)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class pedangmerah20_12 extends MovieClip {
public function pedangmerah20_12(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 30
//pedangmerah30_14 (AssaultCarnivale_fla.pedangmerah30_14)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class pedangmerah30_14 extends MovieClip {
public function pedangmerah30_14(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 31
//pedangmerah40_15 (AssaultCarnivale_fla.pedangmerah40_15)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class pedangmerah40_15 extends MovieClip {
public function pedangmerah40_15(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 32
//pedangmerah50_16 (AssaultCarnivale_fla.pedangmerah50_16)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class pedangmerah50_16 extends MovieClip {
public function pedangmerah50_16(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
stop();
}
function frame50(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 33
//ResultCode_128 (AssaultCarnivale_fla.ResultCode_128)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.media.*;
import flash.net.*;
import flash.filters.*;
import flash.errors.*;
import flash.ui.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.external.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class ResultCode_128 extends MovieClip {
public const WINDOW_OPEN_FUNCTION:String = "window.open";
public var returnBtn:SimpleButton;
public var theText:TextField;
public var facebookBtn:SimpleButton;
public var twitterBtn:SimpleButton;
public function ResultCode_128(){
addFrameScript(0, frame1);
}
public function onClick(_arg1:MouseEvent):void{
var _local2:URLRequest;
var _local3:URLLoader;
switch (_arg1.currentTarget){
case returnBtn:
this.visible = false;
break;
case facebookBtn:
navigateToURL(new URLRequest((("http://www.facebook.com/sharer.php?u=http://gxgs.gamexeon.com/games/assaultcarnivale/index.php?levelCode=" + theText.text) + "&t=My Assault Carnivale Custom Level!")));
break;
case twitterBtn:
_local2 = new URLRequest();
_local2.url = (("http://api.bit.ly/shorten?format=xml&version=2.0.1&longUrl=http://gxgs.gamexeon.com/games/assaultcarnivale/index.php?levelCode=" + theText.text) + "&login=turna&apiKey=R_26d84a6dd3f83aa84ed01b8626b575de");
_local3 = new URLLoader();
_local3.addEventListener(Event.COMPLETE, onGetShortURLComplete);
_local3.load(_local2);
break;
};
}
function frame1(){
returnBtn.addEventListener(MouseEvent.CLICK, onClick);
facebookBtn.addEventListener(MouseEvent.CLICK, onClick);
twitterBtn.addEventListener(MouseEvent.CLICK, onClick);
}
public function onGetShortURLComplete(_arg1:Event):void{
var _local2:XML;
var _local3:String;
trace(("Twitter link=" + _arg1.target.data));
_local2 = new XML(_arg1.target.data);
_local3 = _local2.results.nodeKeyVal.shortUrl;
navigateToURL(new URLRequest(("http://twitter.com/home?status=I challenge you to solve my Assault Carnivale level! " + _local3)));
}
public function openWindow(_arg1:String, _arg2:String="_blank", _arg3:String=""):void{
ExternalInterface.call(WINDOW_OPEN_FUNCTION, _arg1, _arg2, _arg3);
}
}
}//package AssaultCarnivale_fla
Section 34
//ResultMC_106 (AssaultCarnivale_fla.ResultMC_106)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class ResultMC_106 extends MovieClip {
public var exitBtn:SimpleButton;
public var retryBtn:SimpleButton;
public function ResultMC_106(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package AssaultCarnivale_fla
Section 35
//ScoreMC_76 (AssaultCarnivale_fla.ScoreMC_76)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreMC_76 extends MovieClip {
public var score_txt:TextField;
public var score:int;
public function ScoreMC_76(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
gotoAndStop("normal");
}
function frame1(){
stop();
score_txt.text = ("SCORE " + score);
}
}
}//package AssaultCarnivale_fla
Section 36
//TransitionMC_75 (AssaultCarnivale_fla.TransitionMC_75)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class TransitionMC_75 extends MovieClip {
public var doneTurun:Boolean;
public var doneNaik:Boolean;
public function TransitionMC_75(){
addFrameScript(0, frame1, 19, frame20, 20, frame21, 45, frame46);
}
function frame1(){
doneTurun = false;
doneNaik = false;
stop();
}
function frame21(){
doneTurun = false;
}
function frame20(){
stop();
doneTurun = true;
}
function frame46(){
stop();
doneNaik = true;
}
}
}//package AssaultCarnivale_fla
Section 37
//view_scores_87 (AssaultCarnivale_fla.view_scores_87)
package AssaultCarnivale_fla {
import flash.display.*;
import flash.text.*;
public dynamic class view_scores_87 extends MovieClip {
public var name11:TextField;
public var name20:TextField;
public var score10:TextField;
public var score11:TextField;
public var score12:TextField;
public var score13:TextField;
public var score14:TextField;
public var score15:TextField;
public var score16:TextField;
public var score17:TextField;
public var score18:TextField;
public var score19:TextField;
public var score20:TextField;
public var name1:TextField;
public var name3:TextField;
public var name4:TextField;
public var name6:TextField;
public var name8:TextField;
public var name2:TextField;
public var name7:TextField;
public var name9:TextField;
public var name5:TextField;
public var button1:SimpleButton;
public var button2:SimpleButton;
public var score1:TextField;
public var score3:TextField;
public var score5:TextField;
public var score6:TextField;
public var score7:TextField;
public var score9:TextField;
public var score4:TextField;
public var name12:TextField;
public var score8:TextField;
public var name14:TextField;
public var name15:TextField;
public var name17:TextField;
public var name18:TextField;
public var name19:TextField;
public var name16:TextField;
public var score2:TextField;
public var name10:TextField;
public var name13:TextField;
}
}//package AssaultCarnivale_fla
Section 38
//witch_mc_64 (AssaultCarnivale_fla.witch_mc_64)
package AssaultCarnivale_fla {
import flash.display.*;
public dynamic class witch_mc_64 extends MovieClip {
public function witch_mc_64(){
addFrameScript(0, frame1, 21, frame22);
}
function frame1(){
stop();
}
function frame22(){
gotoAndStop(1);
}
}
}//package AssaultCarnivale_fla
Section 39
//BonusType (code.BonusType)
package code {
public class BonusType {
public static const BONUS_45_DEGREE:String = "bonus45Degree";
public static const BONUS_3X:String = "bonus3X";
public static const BONUS_DOUBLE_ATTACK:String = "bonusDoubleAttack";
public static const BONUS_POWER_ATTACK:String = "bonusPowerAttack";
public static const BONUS_2X:String = "bonus2X";
public static function getRandomBonus():String{
var _local1:int;
_local1 = (Math.random() * 5);
switch (_local1){
case 0:
return (BONUS_2X);
case 1:
return (BONUS_3X);
case 2:
return (BONUS_DOUBLE_ATTACK);
case 3:
return (BONUS_POWER_ATTACK);
default:
return (BONUS_45_DEGREE);
};
}
}
}//package code
Section 40
//Level (code.Level)
package code {
public class Level {
private var puzzle_arr:Array;
private var level_arr:Array;
public function Level(){
level_arr = [];
puzzle_arr = [];
super();
initLevelArray();
initPuzzleArray();
}
private function initLevelArray():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:String;
_local1 = 32;
_local2 = 0;
_local3 = 0;
_local4 = 2;
_local5 = "Help me repel enemy attack!\nUse my power to enlarge and explode enemy by clicking on them.\nBeware that my Power is limited.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 24;
_local2 = 0;
_local3 = 0;
_local4 = 1;
_local5 = "Red Swordsman is easy enough to handle. They affect vertically & horizontally.\nTips: We only have 120 seconds to repel those enemies!";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 0;
_local2 = 24;
_local3 = 0;
_local4 = 2;
_local5 = "Green Berserker is a bit tricky as they only affect their surrounding diagonally.\nTips: More chain = more combo = more score for you!";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 0;
_local2 = 0;
_local3 = 24;
_local4 = 2;
_local5 = "Gray Archer is the trickiest. They only affect left, top left, right, & bottom right soldier.\nTips: Each 5 combo will give me additional power!";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 28;
_local2 = 6;
_local3 = 0;
_local4 = 1;
_local5 = "You can use Red Swordsman to destroy Green Berserker, but not vice versa.\nTips: On each day, I'll recover 5 power.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 0;
_local2 = 28;
_local3 = 6;
_local4 = 2;
_local5 = "Green Berserker can destroy Gray Archer, but not vice versa.\nTips: Use Fast Mode button to fasten the animation.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 6;
_local2 = 0;
_local3 = 28;
_local4 = 1;
_local5 = "Gray Archer can be used to destroy Red Swordsman, but not vice versa.\nTips: Use Special Bonuses to maximize your damage.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 22;
_local2 = 10;
_local3 = 0;
_local4 = 1;
_local5 = "You have learn all that needed to know. Just remember this economy principal, Use minimum Power to achieve maximum Combo!";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 10;
_local2 = 0;
_local3 = 22;
_local4 = 2;
_local5 = "Looks like they don't let down their attack. Better focus on those archer!";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 0;
_local2 = 22;
_local3 = 10;
_local4 = 2;
_local5 = "Those berserkers are essential in winning this battle.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 18;
_local2 = 14;
_local3 = 0;
_local4 = 2;
_local5 = "Be careful with your choice now...";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 0;
_local2 = 18;
_local3 = 14;
_local4 = 3;
_local5 = "Those berserkers looks stupid.\nBut beware of their power.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 14;
_local2 = 0;
_local3 = 18;
_local4 = 2;
_local5 = "I can't believe those archer allowed to have such disastrous moustache! (unlike my beard!)";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 24;
_local2 = 4;
_local3 = 4;
_local4 = 2;
_local5 = "So they already decide to send all of soldier type, huh? We'll see the result...";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 10;
_local2 = 16;
_local3 = 0;
_local4 = 2;
_local5 = "This will be tricky.\nThere are more Green Berserker than Red Swordsman.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 0;
_local2 = 10;
_local3 = 16;
_local4 = 2;
_local5 = "Another tricky battle.\nBe careful when attacking the Green Berserker.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 16;
_local2 = 0;
_local3 = 10;
_local4 = 2;
_local5 = "Looks like we need to either kill all Red Swordsman first, or do clean kill with those Gray Archer.";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 6;
_local2 = 22;
_local3 = 6;
_local4 = 1;
_local5 = "Another all out attack by enemy.\nHold the fort, and focus your attack on those swordsman!";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 19;
_local2 = 7;
_local3 = 11;
_local4 = 1;
_local5 = "For each soldier slayed, the enemy grow desperate. We must keep this up for another day!";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
_local1 = 12;
_local2 = 12;
_local3 = 12;
_local4 = 1;
_local5 = "This is it friend. Let us get rid of them once and for all. The glory awaits you!";
level_arr.push({type0:_local1, type1:_local2, type2:_local3, level:_local4, dialog:_local5});
}
public function getPuzzleObject(_arg1:int):Object{
return (puzzle_arr[(_arg1 - 1)]);
}
private function initPuzzleArray():void{
var _local1:Array;
var _local2:Array;
_local1 = [];
_local2 = [];
_local1.push({x:1, y:2, type:0, level:3, bonusType:null});
_local1.push({x:2, y:2, type:0, level:4, bonusType:null});
_local1.push({x:3, y:2, type:0, level:3, bonusType:null});
_local1.push({x:2, y:3, type:0, level:3, bonusType:null});
_local1.push({x:3, y:3, type:0, level:4, bonusType:null});
_local1.push({x:3, y:4, type:0, level:3, bonusType:null});
puzzle_arr.push({pin:_local1, wall:null, chance:2});
_local1 = [];
_local2 = [];
_local1.push({x:0, y:2, type:0, level:4, bonusType:null});
_local1.push({x:1, y:2, type:0, level:4, bonusType:null});
_local1.push({x:2, y:2, type:0, level:3, bonusType:null});
_local1.push({x:3, y:2, type:0, level:2, bonusType:null});
_local1.push({x:4, y:2, type:0, level:3, bonusType:null});
_local1.push({x:5, y:2, type:0, level:4, bonusType:null});
puzzle_arr.push({pin:_local1, wall:null, chance:3});
_local1 = [];
_local2 = [];
_local1.push({x:3, y:0, type:1, level:4, bonusType:null});
_local1.push({x:2, y:1, type:1, level:3, bonusType:null});
_local1.push({x:4, y:1, type:1, level:4, bonusType:null});
_local1.push({x:1, y:2, type:1, level:4, bonusType:null});
_local1.push({x:3, y:2, type:1, level:1, bonusType:null});
_local1.push({x:5, y:2, type:1, level:4, bonusType:null});
_local1.push({x:2, y:3, type:1, level:4, bonusType:null});
_local1.push({x:4, y:3, type:1, level:3, bonusType:null});
_local1.push({x:3, y:4, type:1, level:4, bonusType:null});
puzzle_arr.push({pin:_local1, wall:null, chance:2});
_local1 = [];
_local2 = [];
_local1.push({x:0, y:1, type:2, level:4, bonusType:null});
_local1.push({x:3, y:1, type:2, level:3, bonusType:null});
_local1.push({x:1, y:2, type:0, level:3, bonusType:null});
_local1.push({x:4, y:2, type:2, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:1, y:3, type:0, level:4, bonusType:null});
_local1.push({x:4, y:3, type:2, level:3, bonusType:null});
_local1.push({x:5, y:3, type:2, level:4, bonusType:null});
_local2.push({x:1, y:1, type:"v"});
puzzle_arr.push({pin:_local1, wall:_local2, chance:1});
_local1 = [];
_local2 = [];
_local1.push({x:2, y:0, type:1, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:0, type:1, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:1, type:1, level:3, bonusType:null});
_local1.push({x:5, y:1, type:1, level:3, bonusType:null});
_local1.push({x:2, y:2, type:1, level:2, bonusType:null});
_local1.push({x:4, y:2, type:1, level:3, bonusType:null});
_local1.push({x:3, y:3, type:1, level:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({x:4, y:4, type:1, level:3, bonusType:null});
puzzle_arr.push({pin:_local1, wall:null, chance:2});
_local1 = [];
_local2 = [];
_local1.push({x:1, y:1, type:0, level:4, bonusType:null});
_local1.push({x:2, y:1, type:0, level:2, bonusType:null});
_local1.push({x:3, y:1, type:0, level:4, bonusType:null});
_local1.push({x:4, y:1, type:0, level:3, bonusType:null});
_local1.push({x:1, y:2, type:0, level:3, bonusType:null});
_local1.push({x:4, y:2, type:0, level:3, bonusType:null});
_local1.push({x:1, y:3, type:0, level:4, bonusType:null});
_local1.push({x:2, y:3, type:0, level:3, bonusType:null});
_local1.push({x:3, y:3, type:0, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:3, type:0, level:4, bonusType:BonusType.BONUS_45_DEGREE});
puzzle_arr.push({pin:_local1, wall:null, chance:2});
_local1 = [];
_local2 = [];
_local1.push({x:1, y:1, type:1, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:1, type:1, level:3, bonusType:null});
_local1.push({x:4, y:1, type:1, level:4, bonusType:null});
_local1.push({x:1, y:2, type:1, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:2, type:1, level:3, bonusType:null});
_local1.push({x:1, y:3, type:1, level:4, bonusType:null});
_local1.push({x:2, y:3, type:1, level:3, bonusType:null});
puzzle_arr.push({pin:_local1, wall:null, chance:2});
_local1 = [];
_local2 = [];
_local1.push({x:0, y:0, type:0, level:4, bonusType:null});
_local1.push({x:2, y:0, type:0, level:3, bonusType:null});
_local1.push({x:0, y:1, type:1, level:3, bonusType:null});
_local1.push({x:2, y:2, type:0, level:4, bonusType:null});
_local1.push({x:2, y:3, type:1, level:2, bonusType:null});
_local1.push({x:3, y:1, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({x:0, y:0, type:"h"});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({x:4, y:0, type:0, level:4, bonusType:null});
_local1.push({x:5, y:0, type:0, level:2, bonusType:null});
_local1.push({x:3, y:2, type:0, level:4, bonusType:null});
_local1.push({x:5, y:2, type:0, level:4, bonusType:null});
_local1.push({x:3, y:3, type:0, level:2, bonusType:null});
_local1.push({x:4, y:3, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:4, type:0, level:3, bonusType:null});
_local1.push({x:5, y:4, type:0, level:3, bonusType:null});
_local2.push({x:3, y:0, type:"v"});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({x:1, y:1, type:0, level:4, bonusType:null});
_local1.push({x:2, y:1, type:0, level:2, bonusType:null});
_local1.push({x:3, y:1, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:1, type:1, level:4, bonusType:null});
_local1.push({x:1, y:2, type:0, level:2, bonusType:null});
_local1.push({x:4, y:2, type:0, level:3, bonusType:null});
_local1.push({x:1, y:3, type:0, level:4, bonusType:null});
_local1.push({x:2, y:3, type:0, level:3, bonusType:null});
_local1.push({x:3, y:3, type:0, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:3, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:2, y:4, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:4, type:0, level:4, bonusType:null});
puzzle_arr.push({pin:_local1, wall:null, chance:2});
_local1 = [];
_local2 = [];
_local1.push({x:1, y:1, type:0, level:4, bonusType:null});
_local1.push({x:2, y:2, type:0, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:1, y:3, type:0, level:2, bonusType:null});
_local1.push({x:1, y:4, type:0, level:4, bonusType:null});
_local1.push({x:2, y:4, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:4, type:0, level:3, bonusType:null});
_local1.push({x:3, y:5, type:0, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:4, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
puzzle_arr.push({pin:_local1, wall:null, chance:2});
_local1 = [];
_local2 = [];
_local1.push({x:3, y:0, type:1, level:3, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({x:4, y:0, type:0, level:3, bonusType:null});
_local1.push({x:0, y:1, type:0, level:4, bonusType:null});
_local1.push({x:4, y:1, type:0, level:4, bonusType:null});
_local1.push({x:3, y:1, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:2, type:1, level:2, bonusType:null});
_local1.push({x:2, y:3, type:2, level:3, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({x:4, y:3, type:0, level:4, bonusType:null});
_local1.push({x:2, y:4, type:2, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({x:2, y:1, type:"h"});
puzzle_arr.push({pin:_local1, wall:_local2, chance:4});
_local1 = [];
_local2 = [];
_local1.push({x:1, y:1, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:3, y:1, type:1, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:1, type:1, level:3, bonusType:null});
_local1.push({x:2, y:2, type:2, level:2, bonusType:null});
_local1.push({x:4, y:2, type:2, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:3, type:0, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:2, y:4, type:0, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:4, type:1, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:5, type:1, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local2.push({x:2, y:2, type:"v"});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({x:1, y:1, type:2, level:3, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({x:2, y:1, type:0, level:2, bonusType:null});
_local1.push({x:3, y:1, type:0, level:3, bonusType:null});
_local1.push({x:4, y:1, type:0, level:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({x:1, y:2, type:2, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:2, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:1, y:3, type:2, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:3, type:0, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:1, y:4, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:2, y:4, type:1, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:4, type:2, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:4, type:1, level:1, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({x:1, y:1, type:"h"});
_local2.push({x:2, y:1, type:"h"});
_local2.push({x:1, y:3, type:"h"});
_local2.push({x:2, y:3, type:"h"});
puzzle_arr.push({pin:_local1, wall:_local2, chance:2});
_local1 = [];
_local2 = [];
_local1.push({x:0, y:3, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:1, y:3, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:2, y:3, type:0, level:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({x:3, y:3, type:2, level:3, bonusType:null});
_local1.push({x:4, y:2, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:5, y:1, type:1, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:2, y:4, type:2, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:4, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:0, y:4, type:2, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:1, y:5, type:2, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:5, type:2, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({x:2, y:2, type:"v"});
puzzle_arr.push({pin:_local1, wall:_local2, chance:4});
_local1 = [];
_local2 = [];
_local1.push({x:3, y:1, type:1, level:3, bonusType:null});
_local1.push({x:2, y:2, type:1, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:2, type:2, level:3, bonusType:null});
_local1.push({x:1, y:3, type:0, level:2, bonusType:null});
_local1.push({x:3, y:3, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:2, y:4, type:1, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:4, type:2, level:4, bonusType:BonusType.BONUS_45_DEGREE});
puzzle_arr.push({pin:_local1, wall:null, chance:4});
_local1 = [];
_local2 = [];
_local1.push({x:1, y:0, type:1, level:3, bonusType:null});
_local1.push({x:2, y:0, type:0, level:4, bonusType:null});
_local1.push({x:3, y:0, type:2, level:3, bonusType:null});
_local1.push({x:4, y:0, type:0, level:4, bonusType:null});
_local1.push({x:1, y:1, type:0, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:2, y:1, type:1, level:3, bonusType:null});
_local1.push({x:3, y:1, type:0, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:1, type:1, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:0, y:2, type:1, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:2, y:2, type:2, level:4, bonusType:null});
_local1.push({x:4, y:2, type:2, level:3, bonusType:null});
_local1.push({x:1, y:3, type:2, level:4, bonusType:null});
_local1.push({x:2, y:3, type:2, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:3, y:3, type:1, level:4, bonusType:null});
_local1.push({x:4, y:3, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:2, y:4, type:1, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:3, y:4, type:0, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:0, y:5, type:1, level:3, bonusType:null});
_local1.push({x:1, y:5, type:2, level:4, bonusType:null});
_local1.push({x:2, y:5, type:0, level:4, bonusType:null});
_local1.push({x:3, y:5, type:1, level:3, bonusType:null});
_local1.push({x:4, y:5, type:0, level:4, bonusType:null});
_local1.push({x:5, y:5, type:1, level:3, bonusType:null});
_local2.push({x:2, y:0, type:"v"});
_local2.push({x:2, y:2, type:"v"});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({x:1, y:0, type:0, level:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:5, y:0, type:1, level:4, bonusType:null});
_local1.push({x:1, y:1, type:0, level:4, bonusType:null});
_local1.push({x:2, y:1, type:0, level:2, bonusType:null});
_local1.push({x:3, y:1, type:0, level:3, bonusType:null});
_local1.push({x:4, y:1, type:1, level:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:1, y:2, type:0, level:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({x:4, y:2, type:2, level:3, bonusType:null});
_local1.push({x:1, y:3, type:0, level:4, bonusType:null});
_local1.push({x:2, y:3, type:0, level:3, bonusType:null});
_local1.push({x:3, y:3, type:0, level:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:4, y:3, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:1, y:4, type:0, level:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({x:5, y:4, type:0, level:4, bonusType:null});
puzzle_arr.push({pin:_local1, wall:null, chance:4});
_local1 = [];
_local2 = [];
_local1.push({type:0, level:3, x:1, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:0, level:3, x:4, y:1, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:4, x:4, y:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:3, y:4, bonusType:null});
_local1.push({type:1, level:3, x:2, y:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:1, level:4, x:1, y:4, bonusType:null});
_local1.push({type:1, level:3, x:3, y:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:1, level:3, x:3, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:1, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({type:"h", x:0, y:0});
_local2.push({type:"v", x:1, y:0});
_local2.push({type:"h", x:1, y:1});
_local2.push({type:"h", x:2, y:2});
_local2.push({type:"h", x:3, y:3});
_local2.push({type:"h", x:4, y:4});
_local2.push({type:"v", x:3, y:2});
_local2.push({type:"v", x:4, y:3});
_local2.push({type:"v", x:0, y:-1});
_local2.push({type:"h", x:-1, y:-1});
puzzle_arr.push({pin:_local1, wall:_local2, chance:4});
_local1 = [];
_local2 = [];
_local1.push({type:0, level:4, x:1, y:4, bonusType:null});
_local1.push({type:1, level:3, x:3, y:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:1, level:4, x:2, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:3, x:3, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:2, y:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:4, x:4, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:1, y:1, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:4, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:3, x:4, y:5, bonusType:null});
_local1.push({type:2, level:4, x:1, y:0, bonusType:null});
_local2.push({type:"v", x:0, y:0});
_local2.push({type:"v", x:0, y:1});
_local2.push({type:"v", x:0, y:2});
_local2.push({type:"v", x:0, y:3});
_local2.push({type:"v", x:4, y:0});
_local2.push({type:"v", x:4, y:1});
_local2.push({type:"v", x:4, y:2});
_local2.push({type:"v", x:4, y:3});
_local2.push({type:"h", x:1, y:0});
_local2.push({type:"h", x:2, y:0});
_local2.push({type:"h", x:1, y:4});
_local2.push({type:"h", x:2, y:4});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({type:2, level:3, x:1, y:2, bonusType:null});
_local1.push({type:0, level:3, x:5, y:2, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:4, x:3, y:2, bonusType:null});
_local1.push({type:1, level:3, x:1, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:2, x:3, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:3, x:5, y:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local2.push({type:"h", x:1, y:1});
_local2.push({type:"h", x:1, y:4});
_local2.push({type:"h", x:2, y:4});
_local2.push({type:"h", x:0, y:4});
_local2.push({type:"h", x:0, y:1});
_local2.push({type:"h", x:2, y:1});
_local2.push({type:"h", x:3, y:4});
_local2.push({type:"h", x:4, y:4});
_local2.push({type:"h", x:3, y:1});
_local2.push({type:"h", x:4, y:1});
_local2.push({type:"h", x:-1, y:1});
_local2.push({type:"h", x:-1, y:4});
puzzle_arr.push({pin:_local1, wall:_local2, chance:4});
_local1 = [];
_local2 = [];
_local1.push({type:2, level:3, x:3, y:5, bonusType:null});
_local1.push({type:2, level:3, x:1, y:5, bonusType:null});
_local1.push({type:2, level:2, x:4, y:0, bonusType:null});
_local1.push({type:1, level:4, x:1, y:4, bonusType:null});
_local1.push({type:1, level:4, x:3, y:4, bonusType:null});
_local1.push({type:2, level:3, x:1, y:0, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:0, level:3, x:2, y:1, bonusType:null});
_local1.push({type:0, level:3, x:4, y:1, bonusType:null});
_local1.push({type:0, level:3, x:3, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:0, level:4, x:1, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:3, x:2, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:4, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:3, x:4, y:5, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:2, y:5, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:3, y:0, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:2, x:2, y:0, bonusType:null});
_local2.push({type:"v", x:0, y:2});
_local2.push({type:"v", x:0, y:1});
_local2.push({type:"v", x:4, y:2});
_local2.push({type:"v", x:4, y:1});
_local2.push({type:"h", x:-1, y:3});
_local2.push({type:"h", x:4, y:3});
_local2.push({type:"h", x:-1, y:1});
_local2.push({type:"h", x:4, y:1});
puzzle_arr.push({pin:_local1, wall:_local2, chance:4});
_local1 = [];
_local2 = [];
_local1.push({type:0, level:3, x:2, y:1, bonusType:null});
_local1.push({type:0, level:2, x:1, y:1, bonusType:null});
_local1.push({type:0, level:2, x:1, y:2, bonusType:null});
_local1.push({type:0, level:2, x:1, y:3, bonusType:null});
_local1.push({type:0, level:2, x:1, y:4, bonusType:null});
_local1.push({type:0, level:3, x:2, y:4, bonusType:null});
_local1.push({type:0, level:2, x:3, y:4, bonusType:null});
_local1.push({type:0, level:2, x:3, y:1, bonusType:null});
_local1.push({type:1, level:3, x:3, y:2, bonusType:null});
_local1.push({type:2, level:3, x:3, y:3, bonusType:null});
_local1.push({type:0, level:3, x:2, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:2, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:3, x:4, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:4, x:4, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
puzzle_arr.push({pin:_local1, wall:null, chance:3});
_local1 = [];
_local2 = [];
_local1.push({type:0, level:3, x:0, y:0, bonusType:null});
_local1.push({type:0, level:3, x:5, y:0, bonusType:null});
_local1.push({type:0, level:3, x:5, y:5, bonusType:null});
_local1.push({type:0, level:4, x:0, y:5, bonusType:null});
_local1.push({type:1, level:4, x:1, y:4, bonusType:null});
_local1.push({type:1, level:3, x:4, y:1, bonusType:null});
_local1.push({type:2, level:3, x:1, y:1, bonusType:null});
_local1.push({type:2, level:4, x:4, y:4, bonusType:null});
_local1.push({type:0, level:3, x:3, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:0, level:3, x:2, y:3, bonusType:null});
_local1.push({type:0, level:3, x:2, y:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:0, level:3, x:3, y:2, bonusType:null});
_local1.push({type:0, level:4, x:3, y:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:2, y:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:2, y:1, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:3, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local2.push({type:"v", x:0, y:1});
_local2.push({type:"v", x:0, y:2});
_local2.push({type:"v", x:4, y:1});
_local2.push({type:"v", x:4, y:2});
puzzle_arr.push({pin:_local1, wall:_local2, chance:2});
_local1 = [];
_local2 = [];
_local1.push({type:0, level:3, x:4, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:4, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:3, x:5, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:4, x:5, y:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:3, y:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:4, x:2, y:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:4, x:3, y:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:3, x:4, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:3, x:3, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:1, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:4, x:1, y:3, bonusType:null});
_local1.push({type:2, level:4, x:5, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:5, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:5, y:0, bonusType:null});
_local1.push({type:0, level:4, x:5, y:5, bonusType:null});
_local2.push({type:"h", x:3, y:0});
_local2.push({type:"h", x:2, y:0});
_local2.push({type:"h", x:1, y:0});
_local2.push({type:"h", x:3, y:4});
_local2.push({type:"h", x:2, y:4});
_local2.push({type:"h", x:1, y:4});
_local2.push({type:"v", x:1, y:3});
_local2.push({type:"v", x:1, y:0});
_local2.push({type:"h", x:0, y:3});
_local2.push({type:"h", x:-1, y:3});
_local2.push({type:"h", x:0, y:1});
_local2.push({type:"h", x:-1, y:1});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({type:2, level:4, x:1, y:3, bonusType:null});
_local1.push({type:2, level:2, x:2, y:4, bonusType:null});
_local1.push({type:2, level:4, x:2, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:3, x:3, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:4, x:2, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:3, x:4, y:3, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:3, x:1, y:1, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:4, x:4, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:3, y:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:4, x:3, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:4, x:4, y:2, bonusType:null});
_local1.push({type:2, level:3, x:2, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({type:"v", x:2, y:0});
_local2.push({type:"h", x:0, y:2});
_local2.push({type:"v", x:2, y:3});
_local2.push({type:"h", x:3, y:2});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({type:1, level:4, x:1, y:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:0, level:4, x:4, y:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:4, x:4, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:4, x:1, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:4, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:4, x:1, y:2, bonusType:null});
_local1.push({type:2, level:3, x:3, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:2, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:4, x:3, y:1, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:2, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:4, x:3, y:5, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({type:"v", x:0, y:3});
_local2.push({type:"v", x:0, y:2});
_local2.push({type:"v", x:0, y:1});
_local2.push({type:"v", x:0, y:0});
_local2.push({type:"v", x:4, y:3});
_local2.push({type:"v", x:4, y:2});
_local2.push({type:"v", x:4, y:1});
_local2.push({type:"v", x:4, y:0});
_local2.push({type:"h", x:0, y:2});
_local2.push({type:"h", x:3, y:2});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({type:2, level:3, x:4, y:2, bonusType:null});
_local1.push({type:1, level:4, x:2, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:4, y:3, bonusType:null});
_local1.push({type:2, level:4, x:4, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:2, y:2, bonusType:null});
_local1.push({type:1, level:3, x:3, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:3, x:3, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:4, x:2, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:2, y:1, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:4, x:1, y:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:4, x:1, y:2, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:4, x:4, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({type:"v", x:4, y:-1});
_local2.push({type:"v", x:4, y:0});
_local2.push({type:"v", x:4, y:3});
_local2.push({type:"v", x:4, y:4});
_local2.push({type:"v", x:-1, y:-1});
_local2.push({type:"v", x:-1, y:0});
_local2.push({type:"v", x:-1, y:1});
_local2.push({type:"v", x:-1, y:2});
_local2.push({type:"v", x:-1, y:3});
_local2.push({type:"v", x:-1, y:4});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({type:0, level:4, x:1, y:4, bonusType:null});
_local1.push({type:0, level:2, x:1, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:2, y:2, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:4, x:3, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:3, x:2, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:1, level:3, x:4, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:4, y:2, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:2, x:3, y:3, bonusType:null});
_local1.push({type:2, level:3, x:4, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:2, x:3, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:1, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:2, x:3, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:4, x:1, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:4, y:5, bonusType:null});
_local1.push({type:1, level:4, x:2, y:0, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local2.push({type:"v", x:0, y:3});
_local2.push({type:"v", x:0, y:1});
_local2.push({type:"v", x:0, y:-1});
_local2.push({type:"v", x:4, y:0});
_local2.push({type:"v", x:4, y:2});
_local2.push({type:"v", x:4, y:4});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
_local1 = [];
_local2 = [];
_local1.push({type:0, level:4, x:2, y:4, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:2, y:1, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:2, y:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:4, x:2, y:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:3, y:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:3, x:3, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:4, x:3, y:2, bonusType:null});
_local1.push({type:2, level:4, x:3, y:3, bonusType:null});
_local1.push({type:1, level:2, x:4, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:4, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:2, x:4, y:2, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:4, y:1, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:1, level:2, x:1, y:1, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:3, x:1, y:3, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:0, level:3, x:1, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:3, x:1, y:4, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:4, x:2, y:5, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:4, x:4, y:5, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:4, x:5, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:5, y:2, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:3, x:5, y:0, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:3, x:3, y:0, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:0, level:4, x:1, y:0, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:2, level:4, x:0, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:3, x:0, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:2, level:3, x:0, y:5, bonusType:null});
_local1.push({type:0, level:3, x:3, y:5, bonusType:BonusType.BONUS_DOUBLE_ATTACK});
_local1.push({type:1, level:4, x:5, y:3, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:4, y:0, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:0, y:2, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:1, y:5, bonusType:null});
_local1.push({type:1, level:4, x:5, y:5, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:0, y:0, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:0, level:3, x:2, y:0, bonusType:BonusType.BONUS_POWER_ATTACK});
_local1.push({type:2, level:4, x:0, y:4, bonusType:BonusType.BONUS_45_DEGREE});
_local1.push({type:1, level:3, x:5, y:1, bonusType:BonusType.BONUS_45_DEGREE});
_local2.push({type:"v", x:0, y:3});
_local2.push({type:"v", x:0, y:0});
_local2.push({type:"h", x:0, y:0});
_local2.push({type:"h", x:0, y:4});
_local2.push({type:"h", x:3, y:4});
_local2.push({type:"h", x:3, y:0});
_local2.push({type:"v", x:4, y:0});
_local2.push({type:"v", x:4, y:3});
puzzle_arr.push({pin:_local1, wall:_local2, chance:3});
}
public function getLevelObject(_arg1:int):Object{
return (level_arr[(_arg1 - 1)]);
}
}
}//package code
Section 41
//PixelCollision (code.PixelCollision)
package code {
import flash.display.*;
import flash.geom.*;
public class PixelCollision {
public static function getCollisionRect(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Rectangle{
var _local6:Rectangle;
var _local7:Rectangle;
var _local8:Rectangle;
var _local9:BitmapData;
var _local10:BitmapData;
var _local11:uint;
var _local12:Rectangle;
var _local13:int;
_local6 = _arg1.getBounds(_arg3);
_local7 = _arg2.getBounds(_arg3);
_local8 = _local6.intersection(_local7);
if (_local8.size.length > 0){
if (_arg4){
_local8.width = Math.ceil(_local8.width);
_local8.height = Math.ceil(_local8.height);
_local9 = getAlphaMap(_arg1, _local8, BitmapDataChannel.RED, _arg3);
_local10 = getAlphaMap(_arg2, _local8, BitmapDataChannel.GREEN, _arg3);
_local9.draw(_local10, null, null, BlendMode.LIGHTEN);
if (_arg5 <= 0){
_local11 = 65792;
} else {
if (_arg5 > 1){
_arg5 = 1;
};
_local13 = Math.round((_arg5 * 0xFF));
_local11 = (((_local13 << 16) | (_local13 << 8)) | 0);
};
_local12 = _local9.getColorBoundsRect(_local11, _local11);
_local9.getColorBoundsRect(_local11, _local11).x = (_local12.x + _local8.x);
_local12.y = (_local12.y + _local8.y);
return (_local12);
} else {
return (_local8);
};
//unresolved jump
};
return (null);
}
public static function isColliding(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Boolean{
var _local6:Rectangle;
_local6 = getCollisionRect(_arg1, _arg2, _arg3, _arg4, _arg5);
if (((!((_local6 == null))) && ((_local6.size.length > 0)))){
return (true);
};
return (false);
}
public static function getCollisionPoint(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:DisplayObjectContainer, _arg4:Boolean=false, _arg5:Number=0):Point{
var _local6:Rectangle;
var _local7:Number;
var _local8:Number;
_local6 = getCollisionRect(_arg1, _arg2, _arg3, _arg4, _arg5);
if (((!((_local6 == null))) && ((_local6.size.length > 0)))){
_local7 = ((_local6.left + _local6.right) / 2);
_local8 = ((_local6.top + _local6.bottom) / 2);
return (new Point(_local7, _local8));
};
return (null);
}
private static function getAlphaMap(_arg1:DisplayObject, _arg2:Rectangle, _arg3:uint, _arg4:DisplayObjectContainer):BitmapData{
var _local5:Matrix;
var _local6:Matrix;
var _local7:BitmapData;
var _local8:BitmapData;
_local5 = _arg4.transform.concatenatedMatrix.clone();
_local5.invert();
_local6 = _arg1.transform.concatenatedMatrix.clone();
_local6.concat(_local5);
_local6.translate(-(_arg2.x), -(_arg2.y));
_local7 = new BitmapData(_arg2.width, _arg2.height, true, 0);
_local7.draw(_arg1, _local6);
_local8 = new BitmapData(_arg2.width, _arg2.height, false, 0);
_local8.copyChannel(_local7, _local7.rect, new Point(0, 0), BitmapDataChannel.ALPHA, _arg3);
return (_local8);
}
}
}//package code
Section 42
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import com.adobe.utils.*;
public class MD5 {
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32)));
_local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3;
return (_local2);
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hash(_arg1:String):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
}
}//package com.adobe.crypto
Section 43
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.adobe.utils
Section 44
//BaseScrollPane (fl.containers.BaseScrollPane)
package fl.containers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.events.*;
public class BaseScrollPane extends UIComponent {
protected var defaultLineScrollSize:Number;// = 4
protected var _maxHorizontalScrollPosition:Number;// = 0
protected var vScrollBar:Boolean;
protected var disabledOverlay:Shape;
protected var hScrollBar:Boolean;
protected var availableWidth:Number;
protected var _verticalPageScrollSize:Number;// = 0
protected var vOffset:Number;// = 0
protected var _verticalScrollBar:ScrollBar;
protected var useFixedHorizontalScrolling:Boolean;// = false
protected var contentWidth:Number;// = 0
protected var contentHeight:Number;// = 0
protected var _horizontalPageScrollSize:Number;// = 0
protected var background:DisplayObject;
protected var _useBitmpScrolling:Boolean;// = false
protected var contentPadding:Number;// = 0
protected var availableHeight:Number;
protected var _horizontalScrollBar:ScrollBar;
protected var contentScrollRect:Rectangle;
protected var _horizontalScrollPolicy:String;
protected var _verticalScrollPolicy:String;
protected static const SCROLL_BAR_STYLES:Object = {upArrowDisabledSkin:"upArrowDisabledSkin", upArrowDownSkin:"upArrowDownSkin", upArrowOverSkin:"upArrowOverSkin", upArrowUpSkin:"upArrowUpSkin", downArrowDisabledSkin:"downArrowDisabledSkin", downArrowDownSkin:"downArrowDownSkin", downArrowOverSkin:"downArrowOverSkin", downArrowUpSkin:"downArrowUpSkin", 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 = {repeatDelay:500, repeatInterval:35, skin:"ScrollPane_upSkin", contentPadding:0, disabledAlpha:0.5};
public function BaseScrollPane(){
contentWidth = 0;
contentHeight = 0;
contentPadding = 0;
vOffset = 0;
_maxHorizontalScrollPosition = 0;
_horizontalPageScrollSize = 0;
_verticalPageScrollSize = 0;
defaultLineScrollSize = 4;
useFixedHorizontalScrolling = false;
_useBitmpScrolling = false;
super();
}
protected function handleWheel(_arg1:MouseEvent):void{
if (((((!(enabled)) || (!(_verticalScrollBar.visible)))) || ((contentHeight <= availableHeight)))){
return;
};
_verticalScrollBar.scrollPosition = (_verticalScrollBar.scrollPosition - (_arg1.delta * verticalLineScrollSize));
setVerticalScrollPosition(_verticalScrollBar.scrollPosition);
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _arg1.delta, horizontalScrollPosition));
}
public function get verticalScrollPosition():Number{
return (_verticalScrollBar.scrollPosition);
}
protected function drawDisabledOverlay():void{
if (enabled){
if (contains(disabledOverlay)){
removeChild(disabledOverlay);
};
} else {
disabledOverlay.x = (disabledOverlay.y = contentPadding);
disabledOverlay.width = availableWidth;
disabledOverlay.height = availableHeight;
disabledOverlay.alpha = (getStyleValue("disabledAlpha") as Number);
addChild(disabledOverlay);
};
}
public function set verticalScrollPosition(_arg1:Number):void{
drawNow();
_verticalScrollBar.scrollPosition = _arg1;
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
}
protected function setContentSize(_arg1:Number, _arg2:Number):void{
if ((((((contentWidth == _arg1)) || (useFixedHorizontalScrolling))) && ((contentHeight == _arg2)))){
return;
};
contentWidth = _arg1;
contentHeight = _arg2;
invalidate(InvalidationType.SIZE);
}
public function get horizontalScrollPosition():Number{
return (_horizontalScrollBar.scrollPosition);
}
public function get horizontalScrollBar():ScrollBar{
return (_horizontalScrollBar);
}
override public function set enabled(_arg1:Boolean):void{
if (enabled == _arg1){
return;
};
_verticalScrollBar.enabled = _arg1;
_horizontalScrollBar.enabled = _arg1;
super.enabled = _arg1;
}
public function get verticalLineScrollSize():Number{
return (_verticalScrollBar.lineScrollSize);
}
public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
protected function calculateAvailableSize():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = ScrollBar.WIDTH;
_local2 = (contentPadding = Number(getStyleValue("contentPadding")));
_local3 = ((height - (2 * _local2)) - vOffset);
vScrollBar = (((_verticalScrollPolicy == ScrollPolicy.ON)) || ((((_verticalScrollPolicy == ScrollPolicy.AUTO)) && ((contentHeight > _local3)))));
_local4 = ((width - (vScrollBar) ? _local1 : 0) - (2 * _local2));
_local5 = (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - _local4);
hScrollBar = (((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_local5 > 0)))));
if (hScrollBar){
_local3 = (_local3 - _local1);
};
if (((((((hScrollBar) && (!(vScrollBar)))) && ((_verticalScrollPolicy == ScrollPolicy.AUTO)))) && ((contentHeight > _local3)))){
vScrollBar = true;
_local4 = (_local4 - _local1);
};
availableHeight = (_local3 + vOffset);
availableWidth = _local4;
}
public function get maxVerticalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentHeight - availableHeight)));
}
public function set horizontalScrollPosition(_arg1:Number):void{
drawNow();
_horizontalScrollBar.scrollPosition = _arg1;
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
}
public function get horizontalLineScrollSize():Number{
return (_horizontalScrollBar.lineScrollSize);
}
public function set verticalPageScrollSize(_arg1:Number):void{
_verticalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
public function get verticalScrollPolicy():String{
return (_verticalScrollPolicy);
}
protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function get useBitmapScrolling():Boolean{
return (_useBitmpScrolling);
}
protected function handleScroll(_arg1:ScrollEvent):void{
if (_arg1.target == _verticalScrollBar){
setVerticalScrollPosition(_arg1.position);
} else {
setHorizontalScrollPosition(_arg1.position);
};
}
public function set verticalLineScrollSize(_arg1:Number):void{
_verticalScrollBar.lineScrollSize = _arg1;
}
public function get verticalScrollBar():ScrollBar{
return (_verticalScrollBar);
}
protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
}
public function set horizontalPageScrollSize(_arg1:Number):void{
_horizontalPageScrollSize = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STATE)){
drawLayout();
};
updateChildren();
super.draw();
}
public function set horizontalScrollPolicy(_arg1:String):void{
_horizontalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function configUI():void{
var _local1:Graphics;
super.configUI();
contentScrollRect = new Rectangle(0, 0, 85, 85);
_verticalScrollBar = new ScrollBar();
_verticalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_verticalScrollBar.visible = false;
_verticalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_verticalScrollBar);
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
_horizontalScrollBar = new ScrollBar();
_horizontalScrollBar.direction = ScrollBarDirection.HORIZONTAL;
_horizontalScrollBar.addEventListener(ScrollEvent.SCROLL, handleScroll, false, 0, true);
_horizontalScrollBar.visible = false;
_horizontalScrollBar.lineScrollSize = defaultLineScrollSize;
addChild(_horizontalScrollBar);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
disabledOverlay = new Shape();
_local1 = disabledOverlay.graphics;
_local1.beginFill(0xFFFFFF);
_local1.drawRect(0, 0, width, height);
_local1.endFill();
addEventListener(MouseEvent.MOUSE_WHEEL, handleWheel, false, 0, true);
}
protected function calculateContentWidth():void{
}
public function get verticalPageScrollSize():Number{
if (isNaN(availableHeight)){
drawNow();
};
return (((((_verticalPageScrollSize == 0)) && (!(isNaN(availableHeight))))) ? availableHeight : _verticalPageScrollSize);
}
protected function drawLayout():void{
calculateAvailableSize();
calculateContentWidth();
background.width = width;
background.height = height;
if (vScrollBar){
_verticalScrollBar.visible = true;
_verticalScrollBar.x = ((width - ScrollBar.WIDTH) - contentPadding);
_verticalScrollBar.y = contentPadding;
_verticalScrollBar.height = availableHeight;
} else {
_verticalScrollBar.visible = false;
};
_verticalScrollBar.setScrollProperties(availableHeight, 0, (contentHeight - availableHeight), verticalPageScrollSize);
setVerticalScrollPosition(_verticalScrollBar.scrollPosition, false);
if (hScrollBar){
_horizontalScrollBar.visible = true;
_horizontalScrollBar.x = contentPadding;
_horizontalScrollBar.y = ((height - ScrollBar.WIDTH) - contentPadding);
_horizontalScrollBar.width = availableWidth;
} else {
_horizontalScrollBar.visible = false;
};
_horizontalScrollBar.setScrollProperties(availableWidth, 0, (useFixedHorizontalScrolling) ? _maxHorizontalScrollPosition : (contentWidth - availableWidth), horizontalPageScrollSize);
setHorizontalScrollPosition(_horizontalScrollBar.scrollPosition, false);
drawDisabledOverlay();
}
protected function drawBackground():void{
var _local1:DisplayObject;
_local1 = background;
background = getDisplayObjectInstance(getStyleValue("skin"));
background.width = width;
background.height = height;
addChildAt(background, 0);
if (((!((_local1 == null))) && (!((_local1 == background))))){
removeChild(_local1);
};
}
public function set horizontalLineScrollSize(_arg1:Number):void{
_horizontalScrollBar.lineScrollSize = _arg1;
}
public function get horizontalPageScrollSize():Number{
if (isNaN(availableWidth)){
drawNow();
};
return (((((_horizontalPageScrollSize == 0)) && (!(isNaN(availableWidth))))) ? availableWidth : _horizontalPageScrollSize);
}
public function get maxHorizontalScrollPosition():Number{
drawNow();
return (Math.max(0, (contentWidth - availableWidth)));
}
protected function setStyles():void{
copyStylesToChild(_verticalScrollBar, SCROLL_BAR_STYLES);
copyStylesToChild(_horizontalScrollBar, SCROLL_BAR_STYLES);
}
protected function updateChildren():void{
_verticalScrollBar.enabled = (_horizontalScrollBar.enabled = enabled);
_verticalScrollBar.drawNow();
_horizontalScrollBar.drawNow();
}
public function set verticalScrollPolicy(_arg1:String):void{
_verticalScrollPolicy = _arg1;
invalidate(InvalidationType.SIZE);
}
public function set useBitmapScrolling(_arg1:Boolean):void{
_useBitmpScrolling = _arg1;
invalidate(InvalidationType.STATE);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, ScrollBar.getStyleDefinition()));
}
}
}//package fl.containers
Section 45
//DataGridCellEditor (fl.controls.dataGridClasses.DataGridCellEditor)
package fl.controls.dataGridClasses {
import fl.controls.listClasses.*;
import fl.controls.*;
public class DataGridCellEditor extends TextInput implements ICellRenderer {
protected var _data:Object;
protected var _listData:ListData;
private static var defaultStyles:Object = {textPadding:1, textFormat:null, upSkin:"DataGridCellEditor_skin"};
public function DataGridCellEditor():void{
}
public function get selected():Boolean{
return (false);
}
public function set listData(_arg1:ListData):void{
_listData = _arg1;
text = _listData.label;
}
public function setMouseState(_arg1:String):void{
}
public function set selected(_arg1:Boolean):void{
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get listData():ListData{
return (_listData);
}
public function get data():Object{
return (_data);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls.dataGridClasses
Section 46
//DataGridColumn (fl.controls.dataGridClasses.DataGridColumn)
package fl.controls.dataGridClasses {
import fl.core.*;
import fl.controls.*;
public class DataGridColumn {
private var _headerText:String;
public var editorDataField:String;// = "text"
private var forceImport:DataGridCellEditor;
private var _headerRenderer:Object;
public var sortOptions:uint;// = 0
private var _cellRenderer:Object;
private var _columnName:String;
public var resizable:Boolean;// = true
private var _sortCompareFunction:Function;
private var _visible:Boolean;// = true
public var sortDescending:Boolean;// = false
public var owner:DataGrid;
private var _imeMode:String;
private var _width:Number;// = 100
public var editable:Boolean;// = true
public var itemEditor:Object;// = "fl.controls.dataGridClasses.DataGridCellEditor"
public var explicitWidth:Number;
private var _minWidth:Number;// = 20
private var _labelFunction:Function;
public var sortable:Boolean;// = true
public var colNum:Number;
public var dataField:String;
public function DataGridColumn(_arg1:String=null){
_minWidth = 20;
_width = 100;
_visible = true;
sortable = true;
resizable = true;
editable = true;
itemEditor = "fl.controls.dataGridClasses.DataGridCellEditor";
editorDataField = "text";
sortDescending = false;
sortOptions = 0;
super();
if (_arg1){
dataField = _arg1;
headerText = _arg1;
};
}
public function set headerRenderer(_arg1:Object):void{
_headerRenderer = _arg1;
if (owner){
owner.invalidate(InvalidationType.DATA);
};
}
public function get imeMode():String{
return (_imeMode);
}
public function setWidth(_arg1:Number):void{
_width = _arg1;
}
public function set width(_arg1:Number):void{
var _local2:Boolean;
explicitWidth = _arg1;
if (owner != null){
_local2 = resizable;
resizable = false;
owner.resizeColumn(colNum, _arg1);
resizable = _local2;
} else {
_width = _arg1;
};
}
public function set cellRenderer(_arg1:Object):void{
_cellRenderer = _arg1;
if (owner){
owner.invalidate(InvalidationType.DATA);
};
}
public function get minWidth():Number{
return (_minWidth);
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
public function toString():String{
return ("[object DataGridColumn]");
}
public function get visible():Boolean{
return (_visible);
}
public function itemToLabel(_arg1:Object):String{
var data = _arg1;
if (!data){
return (" ");
};
if (labelFunction != null){
return (labelFunction(data));
};
if (owner.labelFunction != null){
return (owner.labelFunction(data, this));
};
if ((((typeof(data) == "object")) || ((typeof(data) == "xml")))){
try {
data = data[dataField];
} catch(e:Error) {
data = null;
};
};
if ((data is String)){
return (String(data));
};
try {
return (data.toString());
} catch(e:Error) {
};
return (" ");
}
public function set minWidth(_arg1:Number):void{
_minWidth = _arg1;
if (_width < _arg1){
_width = _arg1;
};
if (owner){
owner.invalidate(InvalidationType.SIZE);
};
}
public function set headerText(_arg1:String):void{
_headerText = _arg1;
if (owner){
owner.invalidate(InvalidationType.DATA);
};
}
public function set sortCompareFunction(_arg1:Function):void{
_sortCompareFunction = _arg1;
}
public function get width():Number{
return (_width);
}
public function get cellRenderer():Object{
return (_cellRenderer);
}
public function set labelFunction(_arg1:Function):void{
if (_labelFunction == _arg1){
return;
};
_labelFunction = _arg1;
if (owner){
owner.invalidate(InvalidationType.DATA);
};
}
public function get headerText():String{
return (((_headerText)!=null) ? _headerText : dataField);
}
public function get sortCompareFunction():Function{
return (_sortCompareFunction);
}
public function get headerRenderer():Object{
return (_headerRenderer);
}
public function get labelFunction():Function{
return (_labelFunction);
}
public function set visible(_arg1:Boolean):void{
if (_visible != _arg1){
_visible = _arg1;
if (owner){
owner.invalidate(InvalidationType.SIZE);
};
};
}
}
}//package fl.controls.dataGridClasses
Section 47
//HeaderRenderer (fl.controls.dataGridClasses.HeaderRenderer)
package fl.controls.dataGridClasses {
import fl.controls.*;
public class HeaderRenderer extends LabelButton {
public var _column:uint;
private static var defaultStyles:Object = {upSkin:"HeaderRenderer_upSkin", downSkin:"HeaderRenderer_downSkin", overSkin:"HeaderRenderer_overSkin", disabledSkin:"HeaderRenderer_disabledSkin", selectedDisabledSkin:"HeaderRenderer_selectedDisabledSkin", selectedUpSkin:"HeaderRenderer_selectedUpSkin", selectedDownSkin:"HeaderRenderer_selectedDownSkin", selectedOverSkin:"HeaderRenderer_selectedOverSkin", textFormat:null, disabledTextFormat:null, textPadding:5};
public function HeaderRenderer():void{
focusEnabled = false;
}
public function set column(_arg1:uint):void{
_column = _arg1;
}
public function get column():uint{
return (_column);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = Number(getStyleValue("textPadding"));
textField.height = (textField.textHeight + 4);
textField.visible = (label.length > 0);
_local2 = (textField.textWidth + 4);
_local3 = (textField.textHeight + 4);
_local4 = ((icon)==null) ? 0 : (icon.width + 4);
_local5 = Math.max(0, Math.min(_local2, ((width - (2 * _local1)) - _local4)));
if (icon != null){
icon.x = (((width - _local1) - icon.width) - 2);
icon.y = Math.round(((height - icon.height) / 2));
};
textField.width = _local5;
textField.x = _local1;
textField.y = Math.round(((height - textField.height) / 2));
background.width = width;
background.height = height;
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls.dataGridClasses
Section 48
//CellRenderer (fl.controls.listClasses.CellRenderer)
package fl.controls.listClasses {
import fl.controls.*;
import flash.events.*;
public class CellRenderer extends LabelButton implements ICellRenderer {
protected var _data:Object;
protected var _listData:ListData;
private static var defaultStyles:Object = {upSkin:"CellRenderer_upSkin", downSkin:"CellRenderer_downSkin", overSkin:"CellRenderer_overSkin", disabledSkin:"CellRenderer_disabledSkin", selectedDisabledSkin:"CellRenderer_selectedDisabledSkin", selectedUpSkin:"CellRenderer_selectedUpSkin", selectedDownSkin:"CellRenderer_selectedDownSkin", selectedOverSkin:"CellRenderer_selectedOverSkin", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public function CellRenderer():void{
toggle = true;
focusEnabled = false;
}
override protected function toggleSelected(_arg1:MouseEvent):void{
}
override public function get selected():Boolean{
return (super.selected);
}
public function set listData(_arg1:ListData):void{
_listData = _arg1;
label = _listData.label;
setStyle("icon", _listData.icon);
}
override public function set selected(_arg1:Boolean):void{
super.selected = _arg1;
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get listData():ListData{
return (_listData);
}
override public function setSize(_arg1:Number, _arg2:Number):void{
super.setSize(_arg1, _arg2);
}
override protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = Number(getStyleValue("textPadding"));
_local2 = 0;
if (icon != null){
icon.x = _local1;
icon.y = Math.round(((height - icon.height) >> 1));
_local2 = (icon.width + _local1);
};
if (label.length > 0){
textField.visible = true;
_local3 = Math.max(0, ((width - _local2) - (_local1 * 2)));
textField.width = _local3;
textField.height = (textField.textHeight + 4);
textField.x = (_local2 + _local1);
textField.y = Math.round(((height - textField.height) >> 1));
} else {
textField.visible = false;
};
background.width = width;
background.height = height;
}
public function get data():Object{
return (_data);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls.listClasses
Section 49
//ICellRenderer (fl.controls.listClasses.ICellRenderer)
package fl.controls.listClasses {
public interface ICellRenderer {
function setSize(_arg1:Number, _arg2:Number):void;
function get listData():ListData;
function get data():Object;
function setMouseState(_arg1:String):void;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function set data(_arg1:Object):void;
function set selected(_arg1:Boolean):void;
function set listData(_arg1:ListData):void;
function get selected():Boolean;
}
}//package fl.controls.listClasses
Section 50
//ListData (fl.controls.listClasses.ListData)
package fl.controls.listClasses {
import fl.core.*;
public class ListData {
protected var _index:uint;
protected var _owner:UIComponent;
protected var _label:String;
protected var _icon:Object;// = null
protected var _row:uint;
protected var _column:uint;
public function ListData(_arg1:String, _arg2:Object, _arg3:UIComponent, _arg4:uint, _arg5:uint, _arg6:uint=0){
_icon = null;
super();
_label = _arg1;
_icon = _arg2;
_owner = _arg3;
_index = _arg4;
_row = _arg5;
_column = _arg6;
}
public function get owner():UIComponent{
return (_owner);
}
public function get label():String{
return (_label);
}
public function get row():uint{
return (_row);
}
public function get index():uint{
return (_index);
}
public function get icon():Object{
return (_icon);
}
public function get column():uint{
return (_column);
}
}
}//package fl.controls.listClasses
Section 51
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
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 52
//Button (fl.controls.Button)
package fl.controls {
import fl.core.*;
import flash.display.*;
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 53
//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 54
//DataGrid (fl.controls.DataGrid)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.data.*;
import fl.managers.*;
import fl.events.*;
import fl.controls.dataGridClasses.*;
import flash.utils.*;
import flash.ui.*;
public class DataGrid extends SelectableList implements IFocusManagerComponent {
protected var _showHeaders:Boolean;// = true
protected var _sortIndex:int;// = -1
protected var _minColumnWidth:Number;
protected var _headerRenderer:Object;
public var sortableColumns:Boolean;// = true
protected var activeCellRenderersMap:Dictionary;
protected var _labelFunction:Function;
protected var headerSortArrow:Sprite;
protected var _sortDescending:Boolean;// = false
protected var losingFocus:Boolean;// = false
protected var maxHeaderHeight:Number;// = 25
protected var minColumnWidthInvalid:Boolean;// = false
protected var _rowHeight:Number;// = 20
protected var _cellRenderer:Object;
protected var proposedEditedItemPosition;
public var editable:Boolean;// = false
protected var dragHandlesMap:Dictionary;
protected var header:Sprite;
protected var availableCellRenderersMap:Dictionary;
protected var _columns:Array;
public var resizableColumns:Boolean;// = true
protected var columnStretchStartWidth:Number;
protected var actualRowIndex:int;
protected var _editedItemPosition:Object;
protected var editedItemPositionChanged:Boolean;// = false
protected var actualColIndex:int;
protected var columnStretchCursor:Sprite;
protected var visibleColumns:Array;
protected var headerMask:Sprite;
public var itemEditorInstance:Object;
protected var displayableColumns:Array;
protected var columnStretchIndex:Number;// = -1
protected var columnsInvalid:Boolean;// = true
protected var currentHoveredRow:int;// = -1
protected var isPressed:Boolean;// = false
protected var lastSortIndex:int;// = -1
protected var columnStretchStartX:Number;
protected var _headerHeight:Number;// = 25
protected static const HEADER_STYLES:Object = {disabledSkin:"headerDisabledSkin", downSkin:"headerDownSkin", overSkin:"headerOverSkin", upSkin:"headerUpSkin", textFormat:"headerTextFormat", disabledTextFormat:"headerDisabledTextFormat", textPadding:"headerTextPadding"};
private static var defaultStyles:Object = {headerUpSkin:"HeaderRenderer_upSkin", headerDownSkin:"HeaderRenderer_downSkin", headerOverSkin:"HeaderRenderer_overSkin", headerDisabledSkin:"HeaderRenderer_disabledSkin", headerSortArrowDescSkin:"HeaderSortArrow_descIcon", headerSortArrowAscSkin:"HeaderSortArrow_ascIcon", columnStretchCursorSkin:"ColumnStretch_cursor", columnDividerSkin:null, headerTextFormat:null, headerDisabledTextFormat:null, headerTextPadding:5, headerRenderer:HeaderRenderer, focusRectSkin:null, focusRectPadding:null, skin:"DataGrid_skin"};
public static var createAccessibilityImplementation:Function;
public function DataGrid(){
_rowHeight = 20;
_headerHeight = 25;
_showHeaders = true;
columnsInvalid = true;
minColumnWidthInvalid = false;
columnStretchIndex = -1;
_sortIndex = -1;
lastSortIndex = -1;
_sortDescending = false;
editedItemPositionChanged = false;
isPressed = false;
losingFocus = false;
maxHeaderHeight = 25;
currentHoveredRow = -1;
editable = false;
resizableColumns = true;
sortableColumns = true;
super();
if (_columns == null){
_columns = [];
};
_horizontalScrollPolicy = ScrollPolicy.OFF;
activeCellRenderersMap = new Dictionary(true);
availableCellRenderersMap = new Dictionary(true);
addEventListener(DataGridEvent.ITEM_EDIT_BEGINNING, itemEditorItemEditBeginningHandler, false, -50);
addEventListener(DataGridEvent.ITEM_EDIT_BEGIN, itemEditorItemEditBeginHandler, false, -50);
addEventListener(DataGridEvent.ITEM_EDIT_END, itemEditorItemEditEndHandler, false, -50);
addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
}
override protected function drawList():void{
var _local1:uint;
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:uint;
var _local6:Object;
var _local7:ICellRenderer;
var _local8:Array;
var _local9:DataGridColumn;
var _local10:Boolean;
var _local11:Dictionary;
var _local12:DataGridColumn;
var _local13:Sprite;
var _local14:UIComponent;
var _local15:Array;
var _local16:uint;
var _local17:uint;
var _local18:Number;
var _local19:DataGridColumn;
var _local20:Object;
var _local21:Array;
var _local22:Dictionary;
var _local23:Object;
var _local24:HeaderRenderer;
var _local25:Sprite;
var _local26:Graphics;
var _local27:Boolean;
var _local28:String;
if (showHeaders){
header.visible = true;
header.x = (contentPadding - _horizontalScrollPosition);
header.y = contentPadding;
listHolder.y = (contentPadding + headerHeight);
_local18 = Math.floor((availableHeight - headerHeight));
_verticalScrollBar.setScrollProperties(_local18, 0, (contentHeight - _local18), _verticalScrollBar.pageScrollSize);
} else {
header.visible = false;
listHolder.y = contentPadding;
};
listHolder.x = contentPadding;
contentScrollRect = listHolder.scrollRect;
contentScrollRect.x = _horizontalScrollPosition;
contentScrollRect.y = (vOffset + (Math.floor(_verticalScrollPosition) % rowHeight));
listHolder.scrollRect = contentScrollRect;
listHolder.cacheAsBitmap = useBitmapScrolling;
_local1 = Math.min(Math.max((length - 1), 0), Math.floor((_verticalScrollPosition / rowHeight)));
_local2 = Math.min(Math.max((length - 1), 0), ((_local1 + rowCount) + 1));
_local10 = list.hitTestPoint(stage.mouseX, stage.mouseY);
calculateColumnSizes();
_local11 = (renderedItems = new Dictionary(true));
if (length > 0){
_local5 = _local1;
while (_local5 <= _local2) {
_local11[_dataProvider.getItemAt(_local5)] = true;
_local5++;
};
};
_local3 = 0;
_local12 = (visibleColumns[0] as DataGridColumn);
_local5 = 0;
while (_local5 < displayableColumns.length) {
_local19 = (displayableColumns[_local5] as DataGridColumn);
if (_local19 != _local12){
_local3 = (_local3 + _local19.width);
} else {
break;
};
_local5++;
};
while (header.numChildren > 0) {
header.removeChildAt(0);
};
dragHandlesMap = new Dictionary(true);
_local15 = [];
_local16 = visibleColumns.length;
_local17 = 0;
while (_local17 < _local16) {
_local9 = (visibleColumns[_local17] as DataGridColumn);
_local15.push(_local9.colNum);
if (showHeaders){
_local23 = ((_local9.headerRenderer)!=null) ? _local9.headerRenderer : _headerRenderer;
_local24 = (getDisplayObjectInstance(_local23) as HeaderRenderer);
if (_local24 != null){
_local24.addEventListener(MouseEvent.CLICK, handleHeaderRendererClick, false, 0, true);
_local24.x = _local3;
_local24.y = 0;
_local24.setSize(_local9.width, headerHeight);
_local24.column = _local9.colNum;
_local24.label = _local9.headerText;
header.addChildAt(_local24, _local17);
copyStylesToChild(_local24, HEADER_STYLES);
if ((((((sortIndex == -1)) && ((lastSortIndex == -1)))) || (!((_local9.colNum == sortIndex))))){
_local24.setStyle("icon", null);
} else {
_local24.setStyle("icon", (sortDescending) ? getStyleValue("headerSortArrowAscSkin") : getStyleValue("headerSortArrowDescSkin"));
};
if ((((((_local17 < (_local16 - 1))) && (resizableColumns))) && (_local9.resizable))){
_local25 = new Sprite();
_local26 = _local25.graphics;
_local26.beginFill(0, 0);
_local26.drawRect(0, 0, 3, headerHeight);
_local26.endFill();
_local25.x = ((_local3 + _local9.width) - 2);
_local25.y = 0;
_local25.alpha = 0;
_local25.addEventListener(MouseEvent.MOUSE_OVER, handleHeaderResizeOver, false, 0, true);
_local25.addEventListener(MouseEvent.MOUSE_OUT, handleHeaderResizeOut, false, 0, true);
_local25.addEventListener(MouseEvent.MOUSE_DOWN, handleHeaderResizeDown, false, 0, true);
header.addChild(_local25);
dragHandlesMap[_local25] = _local9.colNum;
};
if ((((((_local17 == (_local16 - 1))) && ((_horizontalScrollPosition == 0)))) && ((availableWidth > (_local3 + _local9.width))))){
_local4 = Math.floor((availableWidth - _local3));
_local24.setSize(_local4, headerHeight);
} else {
_local4 = _local9.width;
};
_local24.drawNow();
};
};
_local20 = ((_local9.cellRenderer)!=null) ? _local9.cellRenderer : _cellRenderer;
_local21 = availableCellRenderersMap[_local9];
_local8 = activeCellRenderersMap[_local9];
if (_local8 == null){
_local8 = [];
activeCellRenderersMap[_local9] = _local8;
};
if (_local21 == null){
_local21 = [];
availableCellRenderersMap[_local9] = _local21;
};
_local22 = new Dictionary(true);
while (_local8.length > 0) {
_local7 = _local8.pop();
_local6 = _local7.data;
if ((((_local11[_local6] == null)) || ((invalidItems[_local6] == true)))){
_local21.push(_local7);
} else {
_local22[_local6] = _local7;
invalidItems[_local6] = true;
};
list.removeChild((_local7 as DisplayObject));
};
if (length > 0){
_local5 = _local1;
while (_local5 <= _local2) {
_local27 = false;
_local6 = _dataProvider.getItemAt(_local5);
if (_local22[_local6] != null){
_local27 = true;
_local7 = _local22[_local6];
delete _local22[_local6];
} else {
if (_local21.length > 0){
_local7 = (_local21.pop() as ICellRenderer);
} else {
_local7 = (getDisplayObjectInstance(_local20) as ICellRenderer);
_local13 = (_local7 as Sprite);
if (_local13 != null){
_local13.addEventListener(MouseEvent.CLICK, handleCellRendererClick, false, 0, true);
_local13.addEventListener(MouseEvent.ROLL_OVER, handleCellRendererMouseEvent, false, 0, true);
_local13.addEventListener(MouseEvent.ROLL_OUT, handleCellRendererMouseEvent, false, 0, true);
_local13.addEventListener(Event.CHANGE, handleCellRendererChange, false, 0, true);
_local13.doubleClickEnabled = true;
_local13.addEventListener(MouseEvent.DOUBLE_CLICK, handleCellRendererDoubleClick, false, 0, true);
if (_local13["setStyle"] != null){
for (_local28 in rendererStyles) {
var _local31 = _local13;
_local31["setStyle"](_local28, rendererStyles[_local28]);
};
};
};
};
};
list.addChild((_local7 as Sprite));
_local8.push(_local7);
_local7.x = _local3;
_local7.y = (rowHeight * (_local5 - _local1));
_local7.setSize(((_local17)==(_local16 - 1)) ? _local4 : _local9.width, rowHeight);
if (!_local27){
_local7.data = _local6;
};
_local7.listData = new ListData(columnItemToLabel(_local9.colNum, _local6), null, this, _local5, _local5, _local17);
if (((_local10) && (isHovered(_local7)))){
_local7.setMouseState("over");
currentHoveredRow = _local5;
} else {
_local7.setMouseState("up");
};
_local7.selected = !((_selectedIndices.indexOf(_local5) == -1));
if ((_local7 is UIComponent)){
_local14 = (_local7 as UIComponent);
_local14.drawNow();
};
_local5++;
};
};
_local3 = (_local3 + _local9.width);
_local17++;
};
_local5 = 0;
while (_local5 < _columns.length) {
if (_local15.indexOf(_local5) == -1){
removeCellRenderersByColumn((_columns[_local5] as DataGridColumn));
};
_local5++;
};
if (editedItemPositionChanged){
editedItemPositionChanged = false;
commitEditedItemPosition(proposedEditedItemPosition);
proposedEditedItemPosition = undefined;
};
invalidItems = new Dictionary(true);
}
protected function itemEditorItemEditBeginningHandler(_arg1:DataGridEvent):void{
if (!_arg1.isDefaultPrevented()){
setEditedItemPosition({columnIndex:_arg1.columnIndex, rowIndex:uint(_arg1.rowIndex)});
} else {
if (!itemEditorInstance){
_editedItemPosition = null;
editable = false;
setFocus();
editable = true;
};
};
}
protected function itemEditorItemEditEndHandler(_arg1:DataGridEvent):void{
var _local2:Boolean;
var _local3:Object;
var _local4:String;
var _local5:Object;
var _local6:String;
var _local7:XML;
var _local8:IFocusManager;
if (!_arg1.isDefaultPrevented()){
_local2 = false;
if (((itemEditorInstance) && (!((_arg1.reason == DataGridEventReason.CANCELLED))))){
_local3 = itemEditorInstance[_columns[_arg1.columnIndex].editorDataField];
_local4 = _columns[_arg1.columnIndex].dataField;
_local5 = _arg1.itemRenderer.data;
_local6 = "";
for each (_local7 in describeType(_local5).variable) {
if (_local4 == _local7.@name.toString()){
_local6 = _local7.@type.toString();
break;
};
};
switch (_local6){
case "String":
if (!(_local3 is String)){
_local3 = _local3.toString();
};
break;
case "uint":
if (!(_local3 is uint)){
_local3 = uint(_local3);
};
break;
case "int":
if (!(_local3 is int)){
_local3 = int(_local3);
};
break;
case "Number":
if (!(_local3 is Number)){
_local3 = Number(_local3);
};
break;
};
if (_local5[_local4] != _local3){
_local2 = true;
_local5[_local4] = _local3;
};
_arg1.itemRenderer.data = _local5;
};
} else {
if (_arg1.reason != DataGridEventReason.OTHER){
if (((itemEditorInstance) && (_editedItemPosition))){
if (selectedIndex != _editedItemPosition.rowIndex){
selectedIndex = _editedItemPosition.rowIndex;
};
_local8 = focusManager;
if ((itemEditorInstance is IFocusManagerComponent)){
_local8.setFocus(InteractiveObject(itemEditorInstance));
};
};
};
};
if ((((_arg1.reason == DataGridEventReason.OTHER)) || (!(_arg1.isDefaultPrevented())))){
destroyItemEditor();
};
}
public function get editedItemPosition():Object{
if (_editedItemPosition){
return ({rowIndex:_editedItemPosition.rowIndex, columnIndex:_editedItemPosition.columnIndex});
};
return (_editedItemPosition);
}
protected function setEditedItemPosition(_arg1:Object):void{
editedItemPositionChanged = true;
proposedEditedItemPosition = _arg1;
if (((_arg1) && (!((_arg1.rowIndex == selectedIndex))))){
selectedIndex = _arg1.rowIndex;
};
invalidate(InvalidationType.DATA);
}
public function set headerHeight(_arg1:Number):void{
maxHeaderHeight = _arg1;
_headerHeight = Math.max(0, _arg1);
invalidate(InvalidationType.SIZE);
}
protected function handleHeaderResizeDown(_arg1:MouseEvent):void{
var _local2:Sprite;
var _local3:Number;
var _local4:DataGridColumn;
_local2 = (_arg1.currentTarget as Sprite);
_local3 = dragHandlesMap[_local2];
_local4 = getColumnAt(_local3);
columnStretchIndex = _local3;
columnStretchStartX = _arg1.stageX;
columnStretchStartWidth = _local4.width;
stage.addEventListener(MouseEvent.MOUSE_MOVE, handleHeaderResizeMove, false, 0, true);
stage.addEventListener(MouseEvent.MOUSE_UP, handleHeaderResizeUp, false, 0, true);
}
protected function deactivateHandler(_arg1:Event):void{
if (itemEditorInstance){
endEdit(DataGridEventReason.OTHER);
losingFocus = true;
setFocus();
};
}
protected function keyFocusChangeHandler(_arg1:FocusEvent):void{
if ((((((_arg1.keyCode == Keyboard.TAB)) && (!(_arg1.isDefaultPrevented())))) && (findNextItemRenderer(_arg1.shiftKey)))){
_arg1.preventDefault();
};
}
override protected function handleDataChange(_arg1:DataChangeEvent):void{
super.handleDataChange(_arg1);
if (_columns == null){
_columns = [];
};
if (_columns.length == 0){
createColumnsFromDataProvider();
};
}
public function set editedItemPosition(_arg1:Object):void{
var _local2:Object;
_local2 = {rowIndex:_arg1.rowIndex, columnIndex:_arg1.columnIndex};
setEditedItemPosition(_local2);
}
override public function itemToCellRenderer(_arg1:Object):ICellRenderer{
return (null);
}
public function getCellRendererAt(_arg1:uint, _arg2:uint):ICellRenderer{
var _local3:DataGridColumn;
var _local4:Array;
var _local5:uint;
var _local6:ICellRenderer;
_local3 = (_columns[_arg2] as DataGridColumn);
if (_local3 != null){
_local4 = (activeCellRenderersMap[_local3] as Array);
if (_local4 != null){
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = (_local4[_local5] as ICellRenderer);
if (_local6.listData.row == _arg1){
return (_local6);
};
_local5++;
};
};
};
return (null);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (((!(selectable)) || (itemEditorInstance))){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
break;
case Keyboard.SPACE:
if (caretIndex == -1){
caretIndex = 0;
};
scrollToIndex(caretIndex);
doKeySelection(caretIndex, _arg1.shiftKey, _arg1.ctrlKey);
break;
default:
break;
};
_arg1.stopPropagation();
}
protected function handleHeaderResizeUp(_arg1:MouseEvent):void{
var _local2:Sprite;
var _local3:DataGridColumn;
var _local4:HeaderRenderer;
var _local5:uint;
var _local6:DataGridEvent;
_local2 = (_arg1.currentTarget as Sprite);
_local3 = (_columns[columnStretchIndex] as DataGridColumn);
_local5 = 0;
while (_local5 < header.numChildren) {
_local4 = (header.getChildAt(_local5) as HeaderRenderer);
if (((_local4) && ((_local4.column == columnStretchIndex)))){
break;
};
_local5++;
};
_local6 = new DataGridEvent(DataGridEvent.COLUMN_STRETCH, false, true, columnStretchIndex, -1, _local4, (_local3) ? _local3.dataField : null);
dispatchEvent(_local6);
columnStretchIndex = -1;
showColumnStretchCursor(false);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, handleHeaderResizeMove, false);
stage.removeEventListener(MouseEvent.MOUSE_UP, handleHeaderResizeUp, false);
}
protected function handleHeaderResizeOver(_arg1:MouseEvent):void{
if (columnStretchIndex == -1){
showColumnStretchCursor();
};
}
override protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:Boolean;
var _local3:DataGridColumn;
if (_arg1.target != this){
return;
};
if (losingFocus){
losingFocus = false;
return;
};
setIMEMode(true);
super.focusInHandler(_arg1);
if (((editable) && (!(isPressed)))){
_local2 = !((editedItemPosition == null));
if (!_editedItemPosition){
_editedItemPosition = {rowIndex:0, columnIndex:0};
while (_editedItemPosition.columnIndex < _columns.length) {
_local3 = (_columns[_editedItemPosition.columnIndex] as DataGridColumn);
if (((_local3.editable) && (_local3.visible))){
_local2 = true;
break;
};
_editedItemPosition.columnIndex++;
};
};
if (_local2){
setEditedItemPosition(_editedItemPosition);
};
};
if (editable){
addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
addEventListener(MouseEvent.MOUSE_DOWN, mouseFocusChangeHandler);
};
}
public function createItemEditor(_arg1:uint, _arg2:uint):void{
var _local3:DataGridColumn;
var _local4:ICellRenderer;
var _local5:Sprite;
var _local6:int;
if (displayableColumns.length != _columns.length){
_local6 = 0;
while (_local6 < displayableColumns.length) {
if (displayableColumns[_local6].colNum >= _arg1){
_arg1 = displayableColumns[_local6].colNum;
break;
};
_local6++;
};
if (_local6 == displayableColumns.length){
_arg1 = 0;
};
};
_local3 = (_columns[_arg1] as DataGridColumn);
_local4 = getCellRendererAt(_arg2, _arg1);
if (!itemEditorInstance){
itemEditorInstance = getDisplayObjectInstance(_local3.itemEditor);
itemEditorInstance.tabEnabled = false;
list.addChild(DisplayObject(itemEditorInstance));
};
list.setChildIndex(DisplayObject(itemEditorInstance), (list.numChildren - 1));
_local5 = (_local4 as Sprite);
itemEditorInstance.visible = true;
itemEditorInstance.move(_local5.x, _local5.y);
itemEditorInstance.setSize(_local3.width, rowHeight);
itemEditorInstance.drawNow();
DisplayObject(itemEditorInstance).addEventListener(FocusEvent.FOCUS_OUT, itemEditorFocusOutHandler);
_local5.visible = false;
DisplayObject(itemEditorInstance).addEventListener(KeyboardEvent.KEY_DOWN, editorKeyDownHandler);
stage.addEventListener(MouseEvent.MOUSE_DOWN, editorMouseDownHandler, true, 0, true);
}
private function itemEditorFocusOutHandler(_arg1:FocusEvent):void{
if (((_arg1.relatedObject) && (contains(_arg1.relatedObject)))){
return;
};
if (!_arg1.relatedObject){
return;
};
if (itemEditorInstance){
endEdit(DataGridEventReason.OTHER);
};
}
override public function get horizontalScrollPolicy():String{
return (_horizontalScrollPolicy);
}
override protected function updateRendererStyles():void{
var _local1:Array;
var _local2:Object;
var _local3:uint;
var _local4:uint;
var _local5:String;
_local1 = [];
for (_local2 in availableCellRenderersMap) {
_local1 = _local1.concat(availableCellRenderersMap[_local2]);
};
for (_local2 in activeCellRenderersMap) {
_local1 = _local1.concat(activeCellRenderersMap[_local2]);
};
_local3 = _local1.length;
_local4 = 0;
while (_local4 < _local3) {
if (_local1[_local4]["setStyle"] == null){
} else {
for (_local5 in updatedRendererStyles) {
_local1[_local4].setStyle(_local5, updatedRendererStyles[_local5]);
};
_local1[_local4].drawNow();
};
_local4++;
};
updatedRendererStyles = {};
}
public function set minColumnWidth(_arg1:Number):void{
_minColumnWidth = _arg1;
columnsInvalid = true;
minColumnWidthInvalid = true;
invalidate(InvalidationType.SIZE);
}
protected function showColumnStretchCursor(_arg1:Boolean=true):void{
if (columnStretchCursor == null){
columnStretchCursor = (getDisplayObjectInstance(getStyleValue("columnStretchCursorSkin")) as Sprite);
columnStretchCursor.mouseEnabled = false;
};
if (_arg1){
Mouse.hide();
stage.addChild(columnStretchCursor);
stage.addEventListener(MouseEvent.MOUSE_MOVE, positionColumnStretchCursor, false, 0, true);
columnStretchCursor.x = stage.mouseX;
columnStretchCursor.y = stage.mouseY;
} else {
stage.removeEventListener(MouseEvent.MOUSE_MOVE, positionColumnStretchCursor, false);
if (stage.contains(columnStretchCursor)){
stage.removeChild(columnStretchCursor);
};
Mouse.show();
};
}
protected function findNextEnterItemRenderer(_arg1:KeyboardEvent):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:DataGridEvent;
if (proposedEditedItemPosition !== undefined){
return;
};
_local2 = _editedItemPosition.rowIndex;
_local3 = _editedItemPosition.columnIndex;
_local4 = (_editedItemPosition.rowIndex + (_arg1.shiftKey) ? -1 : 1);
if ((((_local4 >= 0)) && ((_local4 < length)))){
_local2 = _local4;
};
_local5 = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING, false, true, _local3, _local2);
_local5.dataField = _columns[_local3].dataField;
dispatchEvent(_local5);
}
protected function mouseFocusChangeHandler(_arg1:MouseEvent):void{
if (((((itemEditorInstance) && (!(_arg1.isDefaultPrevented())))) && (itemRendererContains(itemEditorInstance, DisplayObject(_arg1.target))))){
_arg1.preventDefault();
};
}
public function get imeMode():String{
return (_imeMode);
}
public function editField(_arg1:uint, _arg2:String, _arg3:Object):void{
var _local4:Object;
_local4 = getItemAt(_arg1);
_local4[_arg2] = _arg3;
replaceItemAt(_local4, _arg1);
}
protected function calculateAvailableHeight():Number{
var _local1:Number;
var _local2:Number;
_local1 = Number(getStyleValue("contentPadding"));
_local2 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && ((_maxHorizontalScrollPosition > 0)))))) ? 15 : 0;
return ((((height - (_local1 * 2)) - _local2) - (showHeaders) ? headerHeight : 0));
}
protected function mouseUpHandler(_arg1:MouseEvent):void{
if (((!(enabled)) || (!(selectable)))){
return;
};
isPressed = false;
}
override protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
public function resizeColumn(_arg1:int, _arg2:Number):void{
var _local3:DataGridColumn;
var _local4:int;
var _local5:Number;
var _local6:int;
var _local7:DataGridColumn;
var _local8:DataGridColumn;
var _local9:int;
var _local10:Number;
var _local11:Number;
var _local12:Number;
if (_columns.length == 0){
return;
};
_local3 = (_columns[_arg1] as DataGridColumn);
if (!_local3){
return;
};
if (((!(visibleColumns)) || ((visibleColumns.length == 0)))){
_local3.setWidth(_arg2);
return;
};
if (_arg2 < _local3.minWidth){
_arg2 = _local3.minWidth;
};
if ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((_horizontalScrollPolicy == ScrollPolicy.AUTO)))){
_local3.setWidth(_arg2);
_local3.explicitWidth = _arg2;
} else {
_local4 = getVisibleColumnIndex(_local3);
if (_local4 != -1){
_local5 = 0;
_local6 = visibleColumns.length;
_local9 = (_local4 + 1);
while (_local9 < _local6) {
_local7 = (visibleColumns[_local9] as DataGridColumn);
if (((_local7) && (_local7.resizable))){
_local5 = (_local5 + _local7.width);
};
_local9++;
};
_local11 = ((_local3.width - _arg2) + _local5);
if (_local5){
_local3.setWidth(_arg2);
_local3.explicitWidth = _arg2;
};
_local12 = 0;
_local9 = (_local4 + 1);
while (_local9 < _local6) {
_local7 = (visibleColumns[_local9] as DataGridColumn);
if (_local7.resizable){
_local10 = ((_local7.width * _local11) / _local5);
if (_local10 < _local7.minWidth){
_local10 = _local7.minWidth;
};
_local7.setWidth(_local10);
_local12 = (_local12 + _local7.width);
_local8 = _local7;
};
_local9++;
};
if (_local12 > _local11){
_local10 = ((_local3.width - _local12) + _local11);
if (_local10 < _local3.minWidth){
_local10 = _local3.minWidth;
};
_local3.setWidth(_local10);
} else {
if (_local8){
_local8.setWidth(((_local8.width - _local12) + _local11));
};
};
} else {
_local3.setWidth(_arg2);
_local3.explicitWidth = _arg2;
};
};
columnsInvalid = true;
invalidate(InvalidationType.SIZE);
}
protected function itemEditorItemEditBeginHandler(_arg1:DataGridEvent):void{
var _local2:IFocusManager;
if (stage){
stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
};
if (!_arg1.isDefaultPrevented()){
createItemEditor(_arg1.columnIndex, uint(_arg1.rowIndex));
ICellRenderer(itemEditorInstance).listData = ICellRenderer(editedItemRenderer).listData;
ICellRenderer(itemEditorInstance).data = editedItemRenderer.data;
itemEditorInstance.imeMode = ((columns[_arg1.columnIndex].imeMode)==null) ? _imeMode : columns[_arg1.columnIndex].imeMode;
_local2 = focusManager;
if ((itemEditorInstance is IFocusManagerComponent)){
_local2.setFocus(InteractiveObject(itemEditorInstance));
};
_local2.defaultButtonEnabled = false;
_arg1 = new DataGridEvent(DataGridEvent.ITEM_FOCUS_IN, false, false, _editedItemPosition.columnIndex, _editedItemPosition.rowIndex, itemEditorInstance);
dispatchEvent(_arg1);
};
}
override protected function draw():void{
var _local1:Boolean;
_local1 = !((contentHeight == (rowHeight * length)));
contentHeight = (rowHeight * length);
if (isInvalid(InvalidationType.STYLES)){
setStyles();
drawBackground();
if (contentPadding != getStyleValue("contentPadding")){
invalidate(InvalidationType.SIZE, false);
};
if (((!((_cellRenderer == getStyleValue("cellRenderer")))) || (!((_headerRenderer == getStyleValue("headerRenderer")))))){
_invalidateList();
_cellRenderer = getStyleValue("cellRenderer");
_headerRenderer = getStyleValue("headerRenderer");
};
};
if (isInvalid(InvalidationType.SIZE)){
columnsInvalid = true;
};
if (((isInvalid(InvalidationType.SIZE, InvalidationType.STATE)) || (_local1))){
drawLayout();
drawDisabledOverlay();
};
if (isInvalid(InvalidationType.RENDERER_STYLES)){
updateRendererStyles();
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.SIZE, InvalidationType.DATA, InvalidationType.SCROLL, InvalidationType.SELECTED)){
drawList();
};
updateChildren();
validate();
}
override public function set horizontalScrollPolicy(_arg1:String):void{
super.horizontalScrollPolicy = _arg1;
columnsInvalid = true;
}
protected function getVisibleColumnIndex(_arg1:DataGridColumn):int{
var _local2:uint;
_local2 = 0;
while (_local2 < visibleColumns.length) {
if (_arg1 == visibleColumns[_local2]){
return (_local2);
};
_local2++;
};
return (-1);
}
protected function itemRendererContains(_arg1:Object, _arg2:DisplayObject):Boolean{
if (((((!(_arg2)) || (!(_arg1)))) || (!((_arg1 is DisplayObjectContainer))))){
return (false);
};
return (DisplayObjectContainer(_arg1).contains(_arg2));
}
override protected function configUI():void{
var _local1:Graphics;
useFixedHorizontalScrolling = false;
super.configUI();
headerMask = new Sprite();
_local1 = headerMask.graphics;
_local1.beginFill(0, 0.3);
_local1.drawRect(0, 0, 100, 100);
_local1.endFill();
headerMask.visible = false;
addChild(headerMask);
header = new Sprite();
addChild(header);
header.mask = headerMask;
_horizontalScrollPolicy = ScrollPolicy.OFF;
_verticalScrollPolicy = ScrollPolicy.AUTO;
}
public function columnItemToLabel(_arg1:uint, _arg2:Object):String{
var _local3:DataGridColumn;
_local3 = (_columns[_arg1] as DataGridColumn);
if (_local3 != null){
return (_local3.itemToLabel(_arg2));
};
return (" ");
}
protected function endEdit(_arg1:String):Boolean{
var _local2:DataGridEvent;
if (!editedItemRenderer){
return (true);
};
_local2 = new DataGridEvent(DataGridEvent.ITEM_EDIT_END, false, true, editedItemPosition.columnIndex, editedItemPosition.rowIndex, editedItemRenderer, _columns[editedItemPosition.columnIndex].dataField, _arg1);
dispatchEvent(_local2);
return (!(_local2.isDefaultPrevented()));
}
override protected function drawLayout():void{
vOffset = (showHeaders) ? headerHeight : 0;
super.drawLayout();
contentScrollRect = listHolder.scrollRect;
if (showHeaders){
headerHeight = maxHeaderHeight;
if (Math.floor((availableHeight - headerHeight)) <= 0){
_headerHeight = availableHeight;
};
list.y = headerHeight;
contentScrollRect = listHolder.scrollRect;
contentScrollRect.y = (contentPadding + headerHeight);
contentScrollRect.height = (availableHeight - headerHeight);
listHolder.y = (contentPadding + headerHeight);
headerMask.x = contentPadding;
headerMask.y = contentPadding;
headerMask.width = availableWidth;
headerMask.height = headerHeight;
} else {
contentScrollRect.y = contentPadding;
listHolder.y = 0;
};
listHolder.scrollRect = contentScrollRect;
}
protected function commitEditedItemPosition(_arg1:Object):void{
var _local2:ICellRenderer;
var _local3:DataGridEvent;
var _local4:String;
var _local5:int;
if (((!(enabled)) || (!(editable)))){
return;
};
if (((((((((itemEditorInstance) && (_arg1))) && ((itemEditorInstance is IFocusManagerComponent)))) && ((_editedItemPosition.rowIndex == _arg1.rowIndex)))) && ((_editedItemPosition.columnIndex == _arg1.columnIndex)))){
IFocusManagerComponent(itemEditorInstance).setFocus();
return;
};
if (itemEditorInstance){
if (!_arg1){
_local4 = DataGridEventReason.OTHER;
} else {
if (((!(editedItemPosition)) || ((_arg1.rowIndex == editedItemPosition.rowIndex)))){
_local4 = DataGridEventReason.NEW_COLUMN;
} else {
_local4 = DataGridEventReason.NEW_ROW;
};
};
if (((!(endEdit(_local4))) && (!((_local4 == DataGridEventReason.OTHER))))){
return;
};
};
_editedItemPosition = _arg1;
if (!_arg1){
return;
};
actualRowIndex = _arg1.rowIndex;
actualColIndex = _arg1.columnIndex;
if (displayableColumns.length != _columns.length){
_local5 = 0;
while (_local5 < displayableColumns.length) {
if (displayableColumns[_local5].colNum >= actualColIndex){
actualColIndex = displayableColumns[_local5].colNum;
break;
};
_local5++;
};
if (_local5 == displayableColumns.length){
actualColIndex = 0;
};
};
scrollToPosition(actualRowIndex, actualColIndex);
_local2 = getCellRendererAt(actualRowIndex, actualColIndex);
_local3 = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGIN, false, true, actualColIndex, actualRowIndex, _local2);
dispatchEvent(_local3);
if (editedItemPositionChanged){
editedItemPositionChanged = false;
commitEditedItemPosition(proposedEditedItemPosition);
proposedEditedItemPosition = undefined;
};
if (!itemEditorInstance){
commitEditedItemPosition(null);
};
}
protected function handleHeaderRendererClick(_arg1:MouseEvent):void{
var _local2:HeaderRenderer;
var _local3:uint;
var _local4:DataGridColumn;
var _local5:uint;
var _local6:DataGridEvent;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as HeaderRenderer);
_local3 = _local2.column;
_local4 = (_columns[_local3] as DataGridColumn);
if (((sortableColumns) && (_local4.sortable))){
_local5 = _sortIndex;
_sortIndex = _local3;
_local6 = new DataGridEvent(DataGridEvent.HEADER_RELEASE, false, true, _local3, -1, _local2, (_local4) ? _local4.dataField : null);
if (((!(dispatchEvent(_local6))) || (!(_selectable)))){
_sortIndex = lastSortIndex;
return;
};
lastSortIndex = _local5;
sortByColumn(_local3);
invalidate(InvalidationType.DATA);
};
}
public function get showHeaders():Boolean{
return (_showHeaders);
}
public function get sortIndex():int{
return (_sortIndex);
}
public function set labelFunction(_arg1:Function):void{
if (_labelFunction == _arg1){
return;
};
_labelFunction = _arg1;
invalidate(InvalidationType.DATA);
}
public function getColumnIndex(_arg1:String):int{
var _local2:uint;
var _local3:DataGridColumn;
_local2 = 0;
while (_local2 < _columns.length) {
_local3 = (_columns[_local2] as DataGridColumn);
if (_local3.dataField == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
protected function createColumnsFromDataProvider():void{
var _local1:Object;
var _local2:String;
_columns = [];
if (length > 0){
_local1 = _dataProvider.getItemAt(0);
for (_local2 in _local1) {
addColumn(_local2);
};
};
}
protected function editorMouseDownHandler(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
if (!itemRendererContains(itemEditorInstance, DisplayObject(_arg1.target))){
if ((((_arg1.target is ICellRenderer)) && (contains(DisplayObject(_arg1.target))))){
_local2 = (_arg1.target as ICellRenderer);
_local3 = _local2.listData.row;
if (_editedItemPosition.rowIndex == _local3){
endEdit(DataGridEventReason.NEW_COLUMN);
} else {
endEdit(DataGridEventReason.NEW_ROW);
};
} else {
endEdit(DataGridEventReason.OTHER);
};
};
}
public function addColumnAt(_arg1, _arg2:uint):DataGridColumn{
var _local3:DataGridColumn;
var _local4:*;
var _local5:uint;
if (_arg2 < _columns.length){
_columns.splice(_arg2, 0, "");
_local5 = (_arg2 + 1);
while (_local5 < _columns.length) {
_local3 = (_columns[_local5] as DataGridColumn);
_local3.colNum = _local5;
_local5++;
};
};
_local4 = _arg1;
if (!(_local4 is DataGridColumn)){
if ((_local4 is String)){
_local4 = new DataGridColumn(_local4);
} else {
_local4 = new DataGridColumn();
};
};
_local3 = (_local4 as DataGridColumn);
_local3.owner = this;
_local3.colNum = _arg2;
_columns[_arg2] = _local3;
invalidate(InvalidationType.SIZE);
columnsInvalid = true;
return (_local3);
}
public function destroyItemEditor():void{
var _local1:DataGridEvent;
if (itemEditorInstance){
DisplayObject(itemEditorInstance).removeEventListener(KeyboardEvent.KEY_DOWN, editorKeyDownHandler);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, editorMouseDownHandler, true);
_local1 = new DataGridEvent(DataGridEvent.ITEM_FOCUS_OUT, false, false, _editedItemPosition.columnIndex, _editedItemPosition.rowIndex, itemEditorInstance);
dispatchEvent(_local1);
if (((itemEditorInstance) && ((itemEditorInstance is UIComponent)))){
UIComponent(itemEditorInstance).drawFocus(false);
};
list.removeChild(DisplayObject(itemEditorInstance));
DisplayObject(editedItemRenderer).visible = true;
itemEditorInstance = null;
};
}
public function set imeMode(_arg1:String):void{
_imeMode = _arg1;
}
protected function doKeySelection(_arg1:int, _arg2:Boolean, _arg3:Boolean):void{
var _local4:Boolean;
var _local5:int;
var _local6:Array;
var _local7:int;
var _local8:int;
_local4 = false;
if (_arg2){
_local6 = [];
_local7 = lastCaretIndex;
_local8 = _arg1;
if (_local7 == -1){
_local7 = ((caretIndex)!=-1) ? caretIndex : _arg1;
};
if (_local7 > _local8){
_local8 = _local7;
_local7 = _arg1;
};
_local5 = _local7;
while (_local5 <= _local8) {
_local6.push(_local5);
_local5++;
};
selectedIndices = _local6;
caretIndex = _arg1;
_local4 = true;
} else {
if (_arg3){
caretIndex = _arg1;
} else {
selectedIndex = _arg1;
caretIndex = (lastCaretIndex = _arg1);
_local4 = true;
};
};
if (_local4){
dispatchEvent(new Event(Event.CHANGE));
};
invalidate(InvalidationType.DATA);
}
public function get headerHeight():Number{
return (_headerHeight);
}
public function getColumnCount():uint{
return (_columns.length);
}
protected function sortByColumn(_arg1:int):void{
var _local2:DataGridColumn;
var _local3:Boolean;
var _local4:uint;
_local2 = (columns[_arg1] as DataGridColumn);
if (((((!(enabled)) || (!(_local2)))) || (!(_local2.sortable)))){
return;
};
_local3 = _local2.sortDescending;
_local4 = _local2.sortOptions;
if (_local3){
_local4 = (_local4 | Array.DESCENDING);
} else {
_local4 = (_local4 & ~(Array.DESCENDING));
};
if (_local2.sortCompareFunction != null){
sortItems(_local2.sortCompareFunction, _local4);
} else {
sortItemsOn(_local2.dataField, _local4);
};
_sortDescending = (_local2.sortDescending = !(_local3));
if ((((lastSortIndex >= 0)) && (!((lastSortIndex == sortIndex))))){
_local2 = (columns[lastSortIndex] as DataGridColumn);
if (_local2 != null){
_local2.sortDescending = false;
};
};
}
public function get minColumnWidth():Number{
return (_minColumnWidth);
}
protected function isHovered(_arg1:ICellRenderer):Boolean{
var _local2:uint;
var _local3:Number;
var _local4:Point;
_local2 = Math.min(Math.max((length - 1), 0), Math.floor((_verticalScrollPosition / rowHeight)));
_local3 = ((_arg1.listData.row - _local2) * rowHeight);
_local4 = list.globalToLocal(new Point(0, stage.mouseY));
return ((((_local4.y > _local3)) && ((_local4.y < (_local3 + rowHeight)))));
}
protected function mouseDownHandler(_arg1:MouseEvent):void{
if (((!(enabled)) || (!(selectable)))){
return;
};
isPressed = true;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
header.mouseChildren = _enabled;
}
override protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
var _local4:int;
var _local5:int;
var _local6:int;
_local4 = Math.max(Math.floor((calculateAvailableHeight() / rowHeight)), 1);
_local5 = -1;
_local6 = 0;
switch (_arg1){
case Keyboard.UP:
if (caretIndex > 0){
_local5 = (caretIndex - 1);
};
break;
case Keyboard.DOWN:
if (caretIndex < (length - 1)){
_local5 = (caretIndex + 1);
};
break;
case Keyboard.PAGE_UP:
if (caretIndex > 0){
_local5 = Math.max((caretIndex - _local4), 0);
};
break;
case Keyboard.PAGE_DOWN:
if (caretIndex < (length - 1)){
_local5 = Math.min((caretIndex + _local4), (length - 1));
};
break;
case Keyboard.HOME:
if (caretIndex > 0){
_local5 = 0;
};
break;
case Keyboard.END:
if (caretIndex < (length - 1)){
_local5 = (length - 1);
};
break;
};
if (_local5 >= 0){
doKeySelection(_local5, _arg2, _arg3);
scrollToSelected();
};
}
protected function handleHeaderResizeOut(_arg1:MouseEvent):void{
if (columnStretchIndex == -1){
showColumnStretchCursor(false);
};
}
public function removeAllColumns():void{
if (_columns.length > 0){
removeCellRenderers();
_columns = [];
invalidate(InvalidationType.SIZE);
columnsInvalid = true;
};
}
public function set rowCount(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
_local2 = Number(getStyleValue("contentPadding"));
_local3 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && (hScrollBar))))) ? 15 : 0;
height = ((((rowHeight * _arg1) + (2 * _local2)) + _local3) + (showHeaders) ? headerHeight : 0);
}
protected function removeCellRenderers():void{
var _local1:uint;
_local1 = 0;
while (_local1 < _columns.length) {
removeCellRenderersByColumn((_columns[_local1] as DataGridColumn));
_local1++;
};
}
public function removeColumnAt(_arg1:uint):DataGridColumn{
var _local2:DataGridColumn;
var _local3:uint;
_local2 = (_columns[_arg1] as DataGridColumn);
if (_local2 != null){
removeCellRenderersByColumn(_local2);
_columns.splice(_arg1, 1);
_local3 = _arg1;
while (_local3 < _columns.length) {
_local2 = (_columns[_local3] as DataGridColumn);
if (_local2){
_local2.colNum = _local3;
};
_local3++;
};
invalidate(InvalidationType.SIZE);
columnsInvalid = true;
};
return (_local2);
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
if (_arg1 == _horizontalScrollPosition){
return;
};
contentScrollRect = listHolder.scrollRect;
contentScrollRect.x = _arg1;
listHolder.scrollRect = contentScrollRect;
list.x = 0;
header.x = -(_arg1);
super.setHorizontalScrollPosition(_arg1, true);
invalidate(InvalidationType.SCROLL);
columnsInvalid = true;
}
public function get labelFunction():Function{
return (_labelFunction);
}
override protected function handleCellRendererClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:DataGridColumn;
var _local4:DataGridEvent;
super.handleCellRendererClick(_arg1);
_local2 = (_arg1.currentTarget as ICellRenderer);
if (((((_local2) && (_local2.data))) && (!((_local2 == itemEditorInstance))))){
_local3 = (_columns[_local2.listData.column] as DataGridColumn);
if (((((editable) && (_local3))) && (_local3.editable))){
_local4 = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING, false, true, _local2.listData.column, _local2.listData.row, _local2, _local3.dataField);
dispatchEvent(_local4);
};
};
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
setIMEMode(false);
if (_arg1.target == this){
super.focusOutHandler(_arg1);
};
if ((((_arg1.relatedObject == this)) && (itemRendererContains(itemEditorInstance, DisplayObject(_arg1.target))))){
return;
};
if ((((_arg1.relatedObject == null)) && (itemRendererContains(editedItemRenderer, DisplayObject(_arg1.target))))){
return;
};
if ((((_arg1.relatedObject == null)) && (itemRendererContains(itemEditorInstance, DisplayObject(_arg1.target))))){
return;
};
if (((itemEditorInstance) && (((!(_arg1.relatedObject)) || (!(itemRendererContains(itemEditorInstance, _arg1.relatedObject))))))){
endEdit(DataGridEventReason.OTHER);
removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
removeEventListener(MouseEvent.MOUSE_DOWN, mouseFocusChangeHandler);
};
}
protected function positionColumnStretchCursor(_arg1:MouseEvent):void{
columnStretchCursor.x = _arg1.stageX;
columnStretchCursor.y = _arg1.stageY;
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
if (itemEditorInstance){
endEdit(DataGridEventReason.OTHER);
};
invalidate(InvalidationType.SCROLL);
super.setVerticalScrollPosition(_arg1, true);
}
public function get sortDescending():Boolean{
return (_sortDescending);
}
protected function editorKeyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ESCAPE){
endEdit(DataGridEventReason.CANCELLED);
} else {
if (((_arg1.ctrlKey) && ((_arg1.charCode == 46)))){
endEdit(DataGridEventReason.CANCELLED);
} else {
if ((((_arg1.charCode == Keyboard.ENTER)) && (!((_arg1.keyCode == 229))))){
if (endEdit(DataGridEventReason.NEW_ROW)){
findNextEnterItemRenderer(_arg1);
};
};
};
};
}
override protected function calculateContentWidth():void{
var _local1:int;
var _local2:int;
var _local3:DataGridColumn;
if (_columns.length == 0){
contentWidth = 0;
return;
};
if (minColumnWidthInvalid){
_local1 = _columns.length;
_local2 = 0;
while (_local2 < _local1) {
_local3 = (_columns[_local2] as DataGridColumn);
_local3.minWidth = minColumnWidth;
_local2++;
};
minColumnWidthInvalid = false;
};
if (horizontalScrollPolicy == ScrollPolicy.OFF){
contentWidth = availableWidth;
} else {
contentWidth = 0;
_local1 = _columns.length;
_local2 = 0;
while (_local2 < _local1) {
_local3 = (_columns[_local2] as DataGridColumn);
if (_local3.visible){
contentWidth = (contentWidth + _local3.width);
};
_local2++;
};
if (((!(isNaN(_horizontalScrollPosition))) && (((_horizontalScrollPosition + availableWidth) > contentWidth)))){
setHorizontalScrollPosition((contentWidth - availableWidth));
};
};
}
override public function get rowCount():uint{
return (Math.ceil((calculateAvailableHeight() / rowHeight)));
}
public function addColumn(_arg1):DataGridColumn{
return (addColumnAt(_arg1, _columns.length));
}
protected function removeCellRenderersByColumn(_arg1:DataGridColumn):void{
var _local2:Array;
if (_arg1 == null){
return;
};
_local2 = activeCellRenderersMap[_arg1];
if (_local2 != null){
while (_local2.length > 0) {
list.removeChild((_local2.pop() as DisplayObject));
};
};
}
override protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:int;
var _local4:String;
var _local5:uint;
var _local6:DataGridColumn;
var _local7:ICellRenderer;
_local2 = (_arg1.target as ICellRenderer);
if (_local2){
_local3 = _local2.listData.row;
if (_arg1.type == MouseEvent.ROLL_OVER){
_local4 = "over";
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
_local4 = "up";
};
};
if (_local4){
_local5 = 0;
while (_local5 < visibleColumns.length) {
_local6 = (visibleColumns[_local5] as DataGridColumn);
_local7 = getCellRendererAt(_local3, _local6.colNum);
if (_local7){
_local7.setMouseState(_local4);
};
if (_local3 != currentHoveredRow){
_local7 = getCellRendererAt(currentHoveredRow, _local6.colNum);
if (_local7){
_local7.setMouseState("up");
};
};
_local5++;
};
};
};
super.handleCellRendererMouseEvent(_arg1);
}
protected function handleHeaderResizeMove(_arg1:MouseEvent):void{
var _local2:Number;
var _local3:Number;
_local2 = (_arg1.stageX - columnStretchStartX);
_local3 = (columnStretchStartWidth + _local2);
resizeColumn(columnStretchIndex, _local3);
}
public function set rowHeight(_arg1:Number):void{
_rowHeight = Math.max(0, _arg1);
invalidate(InvalidationType.SIZE);
}
protected function scrollToPosition(_arg1:int, _arg2:int):void{
var _local3:Number;
var _local4:Number;
var _local5:uint;
var _local6:Number;
var _local7:DataGridColumn;
var _local8:DataGridColumn;
_local3 = verticalScrollPosition;
_local4 = horizontalScrollPosition;
scrollToIndex(_arg1);
_local6 = 0;
_local7 = (_columns[_arg2] as DataGridColumn);
_local5 = 0;
while (_local5 < displayableColumns.length) {
_local8 = (displayableColumns[_local5] as DataGridColumn);
if (_local8 != _local7){
_local6 = (_local6 + _local8.width);
} else {
break;
};
_local5++;
};
if (horizontalScrollPosition > _local6){
horizontalScrollPosition = _local6;
} else {
if ((horizontalScrollPosition + availableWidth) < (_local6 + _local7.width)){
horizontalScrollPosition = -((availableWidth - (_local6 + _local7.width)));
};
};
if (((!((_local3 == verticalScrollPosition))) || (!((_local4 == horizontalScrollPosition))))){
drawNow();
};
}
protected function findNextItemRenderer(_arg1:Boolean):Boolean{
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:DataGridEvent;
if (!_editedItemPosition){
return (false);
};
if (proposedEditedItemPosition !== undefined){
return (false);
};
_local2 = _editedItemPosition.rowIndex;
_local3 = _editedItemPosition.columnIndex;
_local4 = false;
_local5 = (_arg1) ? -1 : 1;
_local6 = (length - 1);
while (!(_local4)) {
_local3 = (_local3 + _local5);
if ((((_local3 < 0)) || ((_local3 >= _columns.length)))){
_local3 = ((_local3)<0) ? (_columns.length - 1) : 0;
_local2 = (_local2 + _local5);
if ((((_local2 < 0)) || ((_local2 > _local6)))){
setEditedItemPosition(null);
losingFocus = true;
setFocus();
return (false);
};
};
if (((_columns[_local3].editable) && (_columns[_local3].visible))){
_local4 = true;
if (_local2 == _editedItemPosition.rowIndex){
_local7 = DataGridEventReason.NEW_COLUMN;
} else {
_local7 = DataGridEventReason.NEW_ROW;
};
if (((!(itemEditorInstance)) || (endEdit(_local7)))){
_local8 = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING, false, true, _local3, _local2);
_local8.dataField = _columns[_local3].dataField;
dispatchEvent(_local8);
};
};
};
return (_local4);
}
override public function set dataProvider(_arg1:DataProvider):void{
super.dataProvider = _arg1;
if (_columns == null){
_columns = [];
};
if (_columns.length == 0){
createColumnsFromDataProvider();
};
removeCellRenderers();
}
override public function setSize(_arg1:Number, _arg2:Number):void{
super.setSize(_arg1, _arg2);
columnsInvalid = true;
}
override public function scrollToIndex(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:Number;
drawNow();
_local2 = (Math.floor(((_verticalScrollPosition + availableHeight) / rowHeight)) - 1);
_local3 = Math.ceil((_verticalScrollPosition / rowHeight));
if (_arg1 < _local3){
verticalScrollPosition = (_arg1 * rowHeight);
} else {
if (_arg1 >= _local2){
_local4 = ((((_horizontalScrollPolicy == ScrollPolicy.ON)) || ((((_horizontalScrollPolicy == ScrollPolicy.AUTO)) && (hScrollBar))))) ? 15 : 0;
verticalScrollPosition = (((((_arg1 + 1) * rowHeight) - availableHeight) + _local4) + (showHeaders) ? headerHeight : 0);
};
};
}
protected function calculateColumnSizes():void{
var _local1:Number;
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:DataGridColumn;
var _local6:DataGridColumn;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local4 = 0;
if (_columns.length == 0){
visibleColumns = [];
displayableColumns = [];
return;
};
if (columnsInvalid){
columnsInvalid = false;
visibleColumns = [];
if (minColumnWidthInvalid){
_local2 = _columns.length;
_local3 = 0;
while (_local3 < _local2) {
_columns[_local3].minWidth = minColumnWidth;
_local3++;
};
minColumnWidthInvalid = false;
};
displayableColumns = null;
_local2 = _columns.length;
_local3 = 0;
while (_local3 < _local2) {
if (((displayableColumns) && (_columns[_local3].visible))){
displayableColumns.push(_columns[_local3]);
} else {
if (((!(displayableColumns)) && (!(_columns[_local3].visible)))){
displayableColumns = new Array(_local3);
_local8 = 0;
while (_local8 < _local3) {
displayableColumns[_local8] = _columns[_local8];
_local8++;
};
};
};
_local3++;
};
if (!displayableColumns){
displayableColumns = _columns;
};
if (horizontalScrollPolicy == ScrollPolicy.OFF){
_local2 = displayableColumns.length;
_local3 = 0;
while (_local3 < _local2) {
visibleColumns.push(displayableColumns[_local3]);
_local3++;
};
} else {
_local2 = displayableColumns.length;
_local9 = 0;
_local3 = 0;
while (_local3 < _local2) {
_local5 = (displayableColumns[_local3] as DataGridColumn);
if (((((_local9 + _local5.width) > _horizontalScrollPosition)) && ((_local9 < (_horizontalScrollPosition + availableWidth))))){
visibleColumns.push(_local5);
};
_local9 = (_local9 + _local5.width);
_local3++;
};
};
};
if (horizontalScrollPolicy == ScrollPolicy.OFF){
_local10 = 0;
_local11 = 0;
_local2 = visibleColumns.length;
_local3 = 0;
while (_local3 < _local2) {
_local5 = (visibleColumns[_local3] as DataGridColumn);
if (_local5.resizable){
if (!isNaN(_local5.explicitWidth)){
_local11 = (_local11 + _local5.width);
} else {
_local10++;
_local11 = (_local11 + _local5.minWidth);
};
} else {
_local11 = (_local11 + _local5.width);
};
_local4 = (_local4 + _local5.width);
_local3++;
};
_local13 = availableWidth;
if ((((availableWidth > _local11)) && (_local10))){
_local2 = visibleColumns.length;
_local3 = 0;
while (_local3 < _local2) {
_local5 = (visibleColumns[_local3] as DataGridColumn);
if (((_local5.resizable) && (isNaN(_local5.explicitWidth)))){
_local6 = _local5;
if (_local4 > availableWidth){
_local12 = ((_local6.width - _local6.minWidth) / (_local4 - _local11));
} else {
_local12 = (_local6.width / _local4);
};
_local7 = (_local6.width - ((_local4 - availableWidth) * _local12));
_local14 = _local5.minWidth;
_local5.setWidth(Math.max(_local7, _local14));
};
_local13 = (_local13 - _local5.width);
_local3++;
};
if (((_local13) && (_local6))){
_local6.setWidth((_local6.width + _local13));
};
} else {
_local2 = visibleColumns.length;
_local3 = 0;
while (_local3 < _local2) {
_local6 = (visibleColumns[_local3] as DataGridColumn);
_local12 = (_local6.width / _local4);
_local7 = (availableWidth * _local12);
_local6.setWidth(_local7);
_local6.explicitWidth = NaN;
_local13 = (_local13 - _local7);
_local3++;
};
if (((_local13) && (_local6))){
_local6.setWidth((_local6.width + _local13));
};
};
};
}
public function set showHeaders(_arg1:Boolean):void{
_showHeaders = _arg1;
invalidate(InvalidationType.SIZE);
}
override protected function initializeAccessibility():void{
if (DataGrid.createAccessibilityImplementation != null){
DataGrid.createAccessibilityImplementation(this);
};
}
public function getColumnAt(_arg1:uint):DataGridColumn{
return ((_columns[_arg1] as DataGridColumn));
}
public function get rowHeight():Number{
return (_rowHeight);
}
public function set columns(_arg1:Array):void{
var _local2:uint;
removeCellRenderers();
_columns = [];
_local2 = 0;
while (_local2 < _arg1.length) {
addColumn(_arg1[_local2]);
_local2++;
};
}
public function get editedItemRenderer():ICellRenderer{
if (!itemEditorInstance){
return (null);
};
return (getCellRendererAt(actualRowIndex, actualColIndex));
}
public function get columns():Array{
return (_columns.slice(0));
}
public function spaceColumnsEqually():void{
var _local1:Number;
var _local2:int;
var _local3:DataGridColumn;
drawNow();
if (displayableColumns.length > 0){
_local1 = (availableWidth / displayableColumns.length);
_local2 = 0;
while (_local2 < displayableColumns.length) {
_local3 = (displayableColumns[_local2] as DataGridColumn);
_local3.width = _local1;
_local2++;
};
invalidate(InvalidationType.SIZE);
columnsInvalid = true;
};
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, SelectableList.getStyleDefinition(), ScrollBar.getStyleDefinition()));
}
}
}//package fl.controls
Section 55
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
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 56
//NumericStepper (fl.controls.NumericStepper)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.ui.*;
public class NumericStepper extends UIComponent implements IFocusManagerComponent {
protected var upArrow:BaseButton;
protected var _stepSize:Number;// = 1
protected var downArrow:BaseButton;
protected var _value:Number;// = 1
protected var _minimum:Number;// = 0
protected var _maximum:Number;// = 10
protected var _precision:Number;
protected var inputField:TextInput;
protected static const DOWN_ARROW_STYLES:Object = {disabledSkin:"downArrowDisabledSkin", downSkin:"downArrowDownSkin", overSkin:"downArrowOverSkin", upSkin:"downArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
protected static const TEXT_INPUT_STYLES:Object = {upSkin:"upSkin", disabledSkin:"disabledSkin", textPadding:"textPadding", textFormat:"textFormat", disabledTextFormat:"disabledTextFormat", embedFonts:"embedFonts"};
protected static const UP_ARROW_STYLES:Object = {disabledSkin:"upArrowDisabledSkin", downSkin:"upArrowDownSkin", overSkin:"upArrowOverSkin", upSkin:"upArrowUpSkin", repeatDelay:"repeatDelay", repeatInterval:"repeatInterval"};
private static var defaultStyles:Object = {downArrowDisabledSkin:"NumericStepperDownArrow_disabledSkin", downArrowDownSkin:"NumericStepperDownArrow_downSkin", downArrowOverSkin:"NumericStepperDownArrow_overSkin", downArrowUpSkin:"NumericStepperDownArrow_upSkin", upArrowDisabledSkin:"NumericStepperUpArrow_disabledSkin", upArrowDownSkin:"NumericStepperUpArrow_downSkin", upArrowOverSkin:"NumericStepperUpArrow_overSkin", upArrowUpSkin:"NumericStepperUpArrow_upSkin", upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRect:null, focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35, embedFonts:false};
public function NumericStepper(){
_maximum = 10;
_minimum = 0;
_value = 1;
_stepSize = 1;
super();
setStyles();
stepSize = _stepSize;
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
};
}
public function get minimum():Number{
return (_minimum);
}
public function set imeMode(_arg1:String):void{
inputField.imeMode = _arg1;
}
public function set minimum(_arg1:Number):void{
_minimum = _arg1;
if (_value < _minimum){
setValue(_minimum, false);
};
}
public function get maximum():Number{
return (_maximum);
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == inputField)) || (super.isOurFocus(_arg1))));
}
public function get nextValue():Number{
var _local1:Number;
_local1 = (_value + _stepSize);
return ((inRange(_local1)) ? _local1 : _value);
}
public function set maximum(_arg1:Number):void{
_maximum = _arg1;
if (_value > _maximum){
setValue(_maximum, false);
};
}
protected function setValue(_arg1:Number, _arg2:Boolean=true):void{
var _local3:Number;
if (_arg1 == _value){
return;
};
_local3 = _value;
_value = getValidValue(_arg1);
inputField.text = _value.toString();
if (_arg2){
dispatchEvent(new Event(Event.CHANGE, true));
};
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
var _local2:Number;
if (!enabled){
return;
};
_arg1.stopImmediatePropagation();
_local2 = Number(inputField.text);
switch (_arg1.keyCode){
case Keyboard.END:
setValue(maximum);
break;
case Keyboard.HOME:
setValue(minimum);
break;
case Keyboard.UP:
setValue(nextValue);
break;
case Keyboard.DOWN:
setValue(previousValue);
break;
case Keyboard.ENTER:
setValue(_local2);
break;
};
}
override public function set enabled(_arg1:Boolean):void{
if (_arg1 == enabled){
return;
};
super.enabled = _arg1;
upArrow.enabled = (downArrow.enabled = (inputField.enabled = _arg1));
}
protected function onTextChange(_arg1:Event):void{
_arg1.stopImmediatePropagation();
}
public function get previousValue():Number{
var _local1:Number;
_local1 = (_value - _stepSize);
return ((inRange(_local1)) ? _local1 : _value);
}
protected function getValidValue(_arg1:Number):Number{
var _local2:Number;
if (isNaN(_arg1)){
return (_value);
};
_local2 = Number((_stepSize * Math.round((_arg1 / _stepSize))).toFixed(_precision));
if (_local2 > maximum){
return (maximum);
};
if (_local2 < minimum){
return (minimum);
};
return (_local2);
}
public function set value(_arg1:Number):void{
setValue(_arg1, false);
}
public function get stepSize():Number{
return (_stepSize);
}
protected function passEvent(_arg1:Event):void{
dispatchEvent(_arg1);
}
public function get imeMode():String{
return (inputField.imeMode);
}
protected function stepperPressHandler(_arg1:ComponentEvent):void{
setValue(Number(inputField.text), false);
switch (_arg1.currentTarget){
case upArrow:
setValue(nextValue);
break;
case downArrow:
setValue(previousValue);
};
inputField.setFocus();
inputField.textField.setSelection(0, 0);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
if (_arg1.eventPhase == 3){
setValue(Number(inputField.text));
};
super.focusOutHandler(_arg1);
}
protected function inRange(_arg1:Number):Boolean{
return ((((_arg1 >= _minimum)) && ((_arg1 <= _maximum))));
}
override public function get enabled():Boolean{
return (super.enabled);
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
setStyles();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
validate();
}
override protected function configUI():void{
super.configUI();
upArrow = new BaseButton();
copyStylesToChild(upArrow, UP_ARROW_STYLES);
upArrow.autoRepeat = true;
upArrow.setSize(21, 12);
upArrow.focusEnabled = false;
addChild(upArrow);
downArrow = new BaseButton();
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
downArrow.autoRepeat = true;
downArrow.setSize(21, 12);
downArrow.focusEnabled = false;
addChild(downArrow);
inputField = new TextInput();
copyStylesToChild(inputField, TEXT_INPUT_STYLES);
inputField.restrict = "0-9\\-\\.\\,";
inputField.text = _value.toString();
inputField.setSize(21, 24);
inputField.focusTarget = (this as IFocusManagerComponent);
inputField.focusEnabled = false;
inputField.addEventListener(FocusEvent.FOCUS_IN, passEvent);
inputField.addEventListener(FocusEvent.FOCUS_OUT, passEvent);
addChild(inputField);
inputField.addEventListener(Event.CHANGE, onTextChange, false, 0, true);
upArrow.addEventListener(ComponentEvent.BUTTON_DOWN, stepperPressHandler, false, 0, true);
downArrow.addEventListener(ComponentEvent.BUTTON_DOWN, stepperPressHandler, false, 0, true);
}
public function get value():Number{
return (_value);
}
protected function inStep(_arg1:Number):Boolean{
return ((((_arg1 - _minimum) % _stepSize) == 0));
}
protected function drawLayout():void{
var _local1:Number;
var _local2:Number;
_local1 = (width - upArrow.width);
_local2 = (height / 2);
inputField.setSize(_local1, height);
upArrow.height = _local2;
downArrow.height = Math.floor(_local2);
downArrow.move(_local1, _local2);
upArrow.move(_local1, 0);
downArrow.drawNow();
upArrow.drawNow();
inputField.drawNow();
}
override public function setFocus():void{
if (stage){
stage.focus = inputField.textField;
};
}
protected function getPrecision():Number{
var _local1:String;
_local1 = _stepSize.toString();
if (_local1.indexOf(".") == -1){
return (0);
};
return (_local1.split(".").pop().length);
}
public function get textField():TextInput{
return (inputField);
}
public function set stepSize(_arg1:Number):void{
_stepSize = _arg1;
_precision = getPrecision();
setValue(_value);
}
protected function setStyles():void{
copyStylesToChild(downArrow, DOWN_ARROW_STYLES);
copyStylesToChild(upArrow, UP_ARROW_STYLES);
copyStylesToChild(inputField, TEXT_INPUT_STYLES);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 57
//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 58
//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 59
//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 60
//SelectableList (fl.controls.SelectableList)
package fl.controls {
import fl.controls.listClasses.*;
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.data.*;
import fl.managers.*;
import fl.events.*;
import flash.utils.*;
import fl.containers.*;
import flash.ui.*;
public class SelectableList extends BaseScrollPane implements IFocusManagerComponent {
protected var invalidItems:Dictionary;
protected var renderedItems:Dictionary;
protected var listHolder:Sprite;
protected var _allowMultipleSelection:Boolean;// = false
protected var lastCaretIndex:int;// = -1
protected var _selectedIndices:Array;
protected var availableCellRenderers:Array;
protected var list:Sprite;
protected var caretIndex:int;// = -1
protected var updatedRendererStyles:Object;
protected var preChangeItems:Array;
protected var activeCellRenderers:Array;
protected var rendererStyles:Object;
protected var _verticalScrollPosition:Number;
protected var _dataProvider:DataProvider;
protected var _horizontalScrollPosition:Number;
private var collectionItemImport:SimpleCollectionItem;
protected var _selectable:Boolean;// = true
private static var defaultStyles:Object = {skin:"List_skin", cellRenderer:CellRenderer, contentPadding:null, disabledAlpha:null};
public static var createAccessibilityImplementation:Function;
public function SelectableList(){
_allowMultipleSelection = false;
_selectable = true;
caretIndex = -1;
lastCaretIndex = -1;
super();
activeCellRenderers = [];
availableCellRenderers = [];
invalidItems = new Dictionary(true);
renderedItems = new Dictionary(true);
_selectedIndices = [];
if (dataProvider == null){
dataProvider = new DataProvider();
};
verticalScrollPolicy = ScrollPolicy.AUTO;
rendererStyles = {};
updatedRendererStyles = {};
}
protected function drawList():void{
}
public function set allowMultipleSelection(_arg1:Boolean):void{
if (_arg1 == _allowMultipleSelection){
return;
};
_allowMultipleSelection = _arg1;
if (((!(_arg1)) && ((_selectedIndices.length > 1)))){
_selectedIndices = [_selectedIndices.pop()];
invalidate(InvalidationType.DATA);
};
}
public function sortItemsOn(_arg1:String, _arg2:Object=null){
return (_dataProvider.sortOn(_arg1, _arg2));
}
public function removeItemAt(_arg1:uint):Object{
return (_dataProvider.removeItemAt(_arg1));
}
public function get selectedItem():Object{
return (((_selectedIndices.length)==0) ? null : _dataProvider.getItemAt(selectedIndex));
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!selectable){
return;
};
switch (_arg1.keyCode){
case Keyboard.UP:
case Keyboard.DOWN:
case Keyboard.END:
case Keyboard.HOME:
case Keyboard.PAGE_UP:
case Keyboard.PAGE_DOWN:
moveSelectionVertically(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
case Keyboard.LEFT:
case Keyboard.RIGHT:
moveSelectionHorizontally(_arg1.keyCode, ((_arg1.shiftKey) && (_allowMultipleSelection)), ((_arg1.ctrlKey) && (_allowMultipleSelection)));
_arg1.stopPropagation();
break;
};
}
public function get selectable():Boolean{
return (_selectable);
}
public function itemToCellRenderer(_arg1:Object):ICellRenderer{
var _local2:*;
var _local3:ICellRenderer;
if (_arg1 != null){
for (_local2 in activeCellRenderers) {
_local3 = (activeCellRenderers[_local2] as ICellRenderer);
if (_local3.data == _arg1){
return (_local3);
};
};
};
return (null);
}
public function getNextIndexAtLetter(_arg1:String, _arg2:int=-1):int{
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Object;
var _local7:String;
if (length == 0){
return (-1);
};
_arg1 = _arg1.toUpperCase();
_local3 = (length - 1);
_local4 = 0;
while (_local4 < _local3) {
_local5 = ((_arg2 + 1) + _local4);
if (_local5 > (length - 1)){
_local5 = (_local5 - length);
};
_local6 = getItemAt(_local5);
if (_local6 == null){
break;
};
_local7 = itemToLabel(_local6);
if (_local7 == null){
} else {
if (_local7.charAt(0).toUpperCase() == _arg1){
return (_local5);
};
};
_local4++;
};
return (-1);
}
public function invalidateList():void{
_invalidateList();
invalidate(InvalidationType.DATA);
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
list.mouseChildren = _enabled;
}
public function get selectedIndices():Array{
return (_selectedIndices.concat());
}
public function set selectable(_arg1:Boolean):void{
if (_arg1 == _selectable){
return;
};
if (!_arg1){
selectedIndices = [];
};
_selectable = _arg1;
}
public function itemToLabel(_arg1:Object):String{
return (_arg1["label"]);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
_dataProvider.addItemAt(_arg1, _arg2);
invalidateList();
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
return (_dataProvider.replaceItemAt(_arg1, _arg2));
}
protected function handleDataChange(_arg1:DataChangeEvent):void{
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:uint;
_local2 = _arg1.startIndex;
_local3 = _arg1.endIndex;
_local4 = _arg1.changeType;
if (_local4 == DataChangeType.INVALIDATE_ALL){
clearSelection();
invalidateList();
} else {
if (_local4 == DataChangeType.INVALIDATE){
_local5 = 0;
while (_local5 < _arg1.items.length) {
invalidateItem(_arg1.items[_local5]);
_local5++;
};
} else {
if (_local4 == DataChangeType.ADD){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
_selectedIndices[_local5] = (_selectedIndices[_local5] + (_local2 - _local3));
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE){
_local5 = 0;
while (_local5 < _selectedIndices.length) {
if (_selectedIndices[_local5] >= _local2){
if (_selectedIndices[_local5] <= _local3){
delete _selectedIndices[_local5];
} else {
_selectedIndices[_local5] = (_selectedIndices[_local5] - ((_local2 - _local3) + 1));
};
};
_local5++;
};
} else {
if (_local4 == DataChangeType.REMOVE_ALL){
clearSelection();
} else {
if (_local4 == DataChangeType.REPLACE){
} else {
selectedItems = preChangeItems;
preChangeItems = null;
};
};
};
};
};
};
invalidate(InvalidationType.DATA);
}
protected function _invalidateList():void{
availableCellRenderers = [];
while (activeCellRenderers.length > 0) {
list.removeChild((activeCellRenderers.pop() as DisplayObject));
};
}
protected function updateRendererStyles():void{
var _local1:Array;
var _local2:uint;
var _local3:uint;
var _local4:String;
_local1 = availableCellRenderers.concat(activeCellRenderers);
_local2 = _local1.length;
_local3 = 0;
while (_local3 < _local2) {
if (_local1[_local3].setStyle == null){
} else {
for (_local4 in updatedRendererStyles) {
_local1[_local3].setStyle(_local4, updatedRendererStyles[_local4]);
};
_local1[_local3].drawNow();
};
_local3++;
};
updatedRendererStyles = {};
}
public function set selectedItem(_arg1:Object):void{
var _local2:int;
_local2 = _dataProvider.getItemIndex(_arg1);
selectedIndex = _local2;
}
public function sortItems(... _args){
return (_dataProvider.sort.apply(_dataProvider, _args));
}
public function removeAll():void{
_dataProvider.removeAll();
}
protected function handleCellRendererChange(_arg1:Event):void{
var _local2:ICellRenderer;
var _local3:uint;
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
_dataProvider.invalidateItemAt(_local3);
}
protected function moveSelectionVertically(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
override protected function setHorizontalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _horizontalScrollPosition){
return;
};
_local3 = (_arg1 - _horizontalScrollPosition);
_horizontalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.HORIZONTAL, _local3, _arg1));
};
}
public function scrollToSelected():void{
scrollToIndex(selectedIndex);
}
public function invalidateItem(_arg1:Object):void{
if (renderedItems[_arg1] == null){
return;
};
invalidItems[_arg1] = true;
invalidate(InvalidationType.DATA);
}
protected function handleCellRendererClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
var _local4:int;
var _local5:int;
var _local6:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
if (((!(dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data)))) || (!(_selectable)))){
return;
};
_local4 = selectedIndices.indexOf(_local3);
if (!_allowMultipleSelection){
if (_local4 != -1){
return;
};
_local2.selected = true;
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
} else {
if (_arg1.shiftKey){
_local6 = ((_selectedIndices.length)>0) ? _selectedIndices[0] : _local3;
_selectedIndices = [];
if (_local6 > _local3){
_local5 = _local6;
while (_local5 >= _local3) {
_selectedIndices.push(_local5);
_local5--;
};
} else {
_local5 = _local6;
while (_local5 <= _local3) {
_selectedIndices.push(_local5);
_local5++;
};
};
caretIndex = _local3;
} else {
if (_arg1.ctrlKey){
if (_local4 != -1){
_local2.selected = false;
_selectedIndices.splice(_local4, 1);
} else {
_local2.selected = true;
_selectedIndices.push(_local3);
};
caretIndex = _local3;
} else {
_selectedIndices = [_local3];
lastCaretIndex = (caretIndex = _local3);
};
};
};
dispatchEvent(new Event(Event.CHANGE));
invalidate(InvalidationType.DATA);
}
public function get length():uint{
return (_dataProvider.length);
}
public function get allowMultipleSelection():Boolean{
return (_allowMultipleSelection);
}
protected function onPreChange(_arg1:DataChangeEvent):void{
switch (_arg1.changeType){
case DataChangeType.REMOVE:
case DataChangeType.ADD:
case DataChangeType.INVALIDATE:
case DataChangeType.REMOVE_ALL:
case DataChangeType.REPLACE:
case DataChangeType.INVALIDATE_ALL:
break;
default:
preChangeItems = selectedItems;
break;
};
}
public function getRendererStyle(_arg1:String, _arg2:int=-1):Object{
return (rendererStyles[_arg1]);
}
override protected function setVerticalScrollPosition(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
if (_arg1 == _verticalScrollPosition){
return;
};
_local3 = (_arg1 - _verticalScrollPosition);
_verticalScrollPosition = _arg1;
if (_arg2){
dispatchEvent(new ScrollEvent(ScrollBarDirection.VERTICAL, _local3, _arg1));
};
}
protected function moveSelectionHorizontally(_arg1:uint, _arg2:Boolean, _arg3:Boolean):void{
}
public function set selectedIndices(_arg1:Array):void{
if (!_selectable){
return;
};
_selectedIndices = ((_arg1)==null) ? [] : _arg1.concat();
invalidate(InvalidationType.SELECTED);
}
public function get selectedIndex():int{
return (((_selectedIndices.length)==0) ? -1 : _selectedIndices[(_selectedIndices.length - 1)]);
}
override protected function draw():void{
super.draw();
}
override protected function configUI():void{
super.configUI();
listHolder = new Sprite();
addChild(listHolder);
listHolder.scrollRect = contentScrollRect;
list = new Sprite();
listHolder.addChild(list);
}
public function addItem(_arg1:Object):void{
_dataProvider.addItem(_arg1);
invalidateList();
}
protected function handleCellRendererMouseEvent(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:String;
_local2 = (_arg1.target as ICellRenderer);
_local3 = ((_arg1.type)==MouseEvent.ROLL_OVER) ? ListEvent.ITEM_ROLL_OVER : ListEvent.ITEM_ROLL_OUT;
dispatchEvent(new ListEvent(_local3, false, false, _local2.listData.column, _local2.listData.row, _local2.listData.index, _local2.data));
}
public function clearRendererStyle(_arg1:String, _arg2:int=-1):void{
delete rendererStyles[_arg1];
updatedRendererStyles[_arg1] = null;
invalidate(InvalidationType.RENDERER_STYLES);
}
protected function handleCellRendererDoubleClick(_arg1:MouseEvent):void{
var _local2:ICellRenderer;
var _local3:uint;
if (!_enabled){
return;
};
_local2 = (_arg1.currentTarget as ICellRenderer);
_local3 = _local2.listData.index;
dispatchEvent(new ListEvent(ListEvent.ITEM_DOUBLE_CLICK, false, true, _local2.listData.column, _local2.listData.row, _local3, _local2.data));
}
public function get rowCount():uint{
return (0);
}
public function isItemSelected(_arg1:Object):Boolean{
return ((selectedItems.indexOf(_arg1) > -1));
}
public function set dataProvider(_arg1:DataProvider):void{
if (_dataProvider != null){
_dataProvider.removeEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange);
_dataProvider.removeEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange);
};
_dataProvider = _arg1;
_dataProvider.addEventListener(DataChangeEvent.DATA_CHANGE, handleDataChange, false, 0, true);
_dataProvider.addEventListener(DataChangeEvent.PRE_DATA_CHANGE, onPreChange, false, 0, true);
clearSelection();
invalidateList();
}
override protected function drawLayout():void{
super.drawLayout();
contentScrollRect = listHolder.scrollRect;
contentScrollRect.width = availableWidth;
contentScrollRect.height = availableHeight;
listHolder.scrollRect = contentScrollRect;
}
public function getItemAt(_arg1:uint):Object{
return (_dataProvider.getItemAt(_arg1));
}
override protected function initializeAccessibility():void{
if (SelectableList.createAccessibilityImplementation != null){
SelectableList.createAccessibilityImplementation(this);
};
}
public function scrollToIndex(_arg1:int):void{
}
public function removeItem(_arg1:Object):Object{
return (_dataProvider.removeItem(_arg1));
}
public function get dataProvider():DataProvider{
return (_dataProvider);
}
public function set maxHorizontalScrollPosition(_arg1:Number):void{
_maxHorizontalScrollPosition = _arg1;
invalidate(InvalidationType.SIZE);
}
public function setRendererStyle(_arg1:String, _arg2:Object, _arg3:uint=0):void{
if (rendererStyles[_arg1] == _arg2){
return;
};
updatedRendererStyles[_arg1] = _arg2;
rendererStyles[_arg1] = _arg2;
invalidate(InvalidationType.RENDERER_STYLES);
}
public function invalidateItemAt(_arg1:uint):void{
var _local2:Object;
_local2 = _dataProvider.getItemAt(_arg1);
if (_local2 != null){
invalidateItem(_local2);
};
}
public function set selectedItems(_arg1:Array):void{
var _local2:Array;
var _local3:uint;
var _local4:int;
if (_arg1 == null){
selectedIndices = null;
return;
};
_local2 = [];
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _dataProvider.getItemIndex(_arg1[_local3]);
if (_local4 != -1){
_local2.push(_local4);
};
_local3++;
};
selectedIndices = _local2;
}
public function clearSelection():void{
selectedIndex = -1;
}
override public function get maxHorizontalScrollPosition():Number{
return (_maxHorizontalScrollPosition);
}
public function get selectedItems():Array{
var _local1:Array;
var _local2:uint;
_local1 = [];
_local2 = 0;
while (_local2 < _selectedIndices.length) {
_local1.push(_dataProvider.getItemAt(_selectedIndices[_local2]));
_local2++;
};
return (_local1);
}
public function set selectedIndex(_arg1:int):void{
selectedIndices = ((_arg1)==-1) ? null : [_arg1];
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseScrollPane.getStyleDefinition()));
}
}
}//package fl.controls
Section 61
//TextInput (fl.controls.TextInput)
package fl.controls {
import fl.core.*;
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class TextInput extends UIComponent implements IFocusManagerComponent {
protected var _html:Boolean;// = false
protected var _savedHTML:String;
protected var background:DisplayObject;
protected var _editable:Boolean;// = true
public var textField:TextField;
private static var defaultStyles:Object = {upSkin:"TextInput_upSkin", disabledSkin:"TextInput_disabledSkin", focusRectSkin:null, focusRectPadding:null, textFormat:null, disabledTextFormat:null, textPadding:0, embedFonts:false};
public static var createAccessibilityImplementation:Function;
public function TextInput(){
_editable = true;
_html = 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;
}
override protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((((_arg1 == textField)) || (super.isOurFocus(_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{
textField.text = _arg1;
_html = false;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
protected function updateTextFieldType():void{
textField.type = (((enabled) && (editable))) ? TextFieldType.INPUT : TextFieldType.DYNAMIC;
textField.selectable = enabled;
}
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;
if (_arg1.target == this){
stage.focus = textField;
};
_local2 = focusManager;
if (((editable) && (_local2))){
_local2.showFocusIndicator = true;
if (((textField.selectable) && ((textField.selectionBeginIndex == textField.selectionBeginIndex)))){
setSelection(0, textField.length);
};
};
super.focusInHandler(_arg1);
if (editable){
setIMEMode(true);
};
}
public function get selectionBeginIndex():int{
return (textField.selectionBeginIndex);
}
public function set alwaysShowSelection(_arg1:Boolean):void{
textField.alwaysShowSelection = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
updateTextFieldType();
}
protected function setEmbedFont(){
var _local1:Object;
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
public function get horizontalScrollPosition():int{
return (textField.scrollH);
}
public function set condenseWhite(_arg1:Boolean):void{
textField.condenseWhite = _arg1;
}
public function set displayAsPassword(_arg1:Boolean):void{
textField.displayAsPassword = _arg1;
}
public function set horizontalScrollPosition(_arg1:int):void{
textField.scrollH = _arg1;
}
public function get restrict():String{
return (textField.restrict);
}
public function get textWidth():Number{
return (textField.textWidth);
}
public function get textHeight():Number{
return (textField.textHeight);
}
public function set editable(_arg1:Boolean):void{
_editable = _arg1;
updateTextFieldType();
}
public function get maxChars():int{
return (textField.maxChars);
}
public function get length():int{
return (textField.length);
}
public function getLineMetrics(_arg1:int):TextLineMetrics{
return (textField.getLineMetrics(_arg1));
}
public function get imeMode():String{
return (_imeMode);
}
override protected function focusOutHandler(_arg1:FocusEvent):void{
super.focusOutHandler(_arg1);
if (editable){
setIMEMode(false);
};
}
public function set htmlText(_arg1:String):void{
if (_arg1 == ""){
text = "";
return;
};
_html = true;
_savedHTML = _arg1;
textField.htmlText = _arg1;
invalidate(InvalidationType.DATA);
invalidate(InvalidationType.STYLES);
}
public function get text():String{
return (textField.text);
}
override public function get enabled():Boolean{
return (super.enabled);
}
public function get condenseWhite():Boolean{
return (textField.condenseWhite);
}
public function get alwaysShowSelection():Boolean{
return (textField.alwaysShowSelection);
}
override protected function draw():void{
var _local1:Object;
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawTextFormat();
drawBackground();
_local1 = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
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();
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);
}
public function setSelection(_arg1:int, _arg2:int):void{
textField.setSelection(_arg1, _arg2);
}
public function get displayAsPassword():Boolean{
return (textField.displayAsPassword);
}
public function appendText(_arg1:String):void{
textField.appendText(_arg1);
}
public function set restrict(_arg1:String):void{
if (((componentInspectorSetting) && ((_arg1 == "")))){
_arg1 = null;
};
textField.restrict = _arg1;
}
public function get htmlText():String{
return (textField.htmlText);
}
protected function drawBackground():void{
var _local1:DisplayObject;
var _local2:String;
_local1 = background;
_local2 = (enabled) ? "upSkin" : "disabledSkin";
background = getDisplayObjectInstance(getStyleValue(_local2));
if (background == null){
return;
};
addChildAt(background, 0);
if (((((!((_local1 == null))) && (!((_local1 == background))))) && (contains(_local1)))){
removeChild(_local1);
};
}
override public function setFocus():void{
stage.focus = textField;
}
protected function drawLayout():void{
var _local1:Number;
_local1 = Number(getStyleValue("textPadding"));
if (background != null){
background.width = width;
background.height = height;
};
textField.width = (width - (2 * _local1));
textField.height = (height - (2 * _local1));
textField.x = (textField.y = _local1);
}
public function set maxChars(_arg1:int):void{
textField.maxChars = _arg1;
}
public function get maxHorizontalScrollPosition():int{
return (textField.maxScrollH);
}
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;
};
}
protected function handleChange(_arg1:Event):void{
_arg1.stopPropagation();
dispatchEvent(new Event(Event.CHANGE, true));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 62
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 63
//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 64
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
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 65
//DataProvider (fl.data.DataProvider)
package fl.data {
import flash.events.*;
import fl.events.*;
public class DataProvider extends EventDispatcher {
protected var data:Array;
public function DataProvider(_arg1:Object=null){
if (_arg1 == null){
data = [];
} else {
data = getDataFromObject(_arg1);
};
}
protected function dispatchPreChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.PRE_DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
public function invalidateItemAt(_arg1:int):void{
checkIndex(_arg1, (data.length - 1));
dispatchChangeEvent(DataChangeType.INVALIDATE, [data[_arg1]], _arg1, _arg1);
}
public function getItemIndex(_arg1:Object):int{
return (data.indexOf(_arg1));
}
protected function getDataFromObject(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:uint;
var _local5:Object;
var _local6:XML;
var _local7:XMLList;
var _local8:XML;
var _local9:XMLList;
var _local10:XML;
var _local11:XMLList;
var _local12:XML;
if ((_arg1 is Array)){
_local3 = (_arg1 as Array);
if (_local3.length > 0){
if ((((_local3[0] is String)) || ((_local3[0] is Number)))){
_local2 = [];
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = {label:String(_local3[_local4]), data:_local3[_local4]};
_local2.push(_local5);
_local4++;
};
return (_local2);
};
};
return (_arg1.concat());
//unresolved jump
};
if ((_arg1 is DataProvider)){
return (_arg1.toArray());
};
if ((_arg1 is XML)){
_local6 = (_arg1 as XML);
_local2 = [];
_local7 = _local6.*;
for each (_local8 in _local7) {
_arg1 = {};
_local9 = _local8.attributes();
for each (_local10 in _local9) {
_arg1[_local10.localName()] = _local10.toString();
};
_local11 = _local8.*;
for each (_local12 in _local11) {
if (_local12.hasSimpleContent()){
_arg1[_local12.localName()] = _local12.toString();
};
};
_local2.push(_arg1);
};
return (_local2);
//unresolved jump
};
throw (new TypeError((("Error: Type Coercion failed: cannot convert " + _arg1) + " to Array or DataProvider.")));
}
public function removeItemAt(_arg1:uint):Object{
var _local2:Array;
checkIndex(_arg1, (data.length - 1));
dispatchPreChangeEvent(DataChangeType.REMOVE, data.slice(_arg1, (_arg1 + 1)), _arg1, _arg1);
_local2 = data.splice(_arg1, 1);
dispatchChangeEvent(DataChangeType.REMOVE, _local2, _arg1, _arg1);
return (_local2[0]);
}
public function addItem(_arg1:Object):void{
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
data.push(_arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], (data.length - 1), (data.length - 1));
}
public function sortOn(_arg1:Object, _arg2:Object=null){
var _local3:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local3 = data.sortOn(_arg1, _arg2);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local3);
}
public function sort(... _args){
var _local2:Array;
dispatchPreChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
_local2 = data.sort.apply(data, _args);
dispatchChangeEvent(DataChangeType.SORT, data.concat(), 0, (data.length - 1));
return (_local2);
}
public function addItems(_arg1:Object):void{
addItemsAt(_arg1, data.length);
}
public function concat(_arg1:Object):void{
addItems(_arg1);
}
public function clone():DataProvider{
return (new DataProvider(data));
}
public function toArray():Array{
return (data.concat());
}
public function get length():uint{
return (data.length);
}
public function addItemAt(_arg1:Object, _arg2:uint):void{
checkIndex(_arg2, data.length);
dispatchPreChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
data.splice(_arg2, 0, _arg1);
dispatchChangeEvent(DataChangeType.ADD, [_arg1], _arg2, _arg2);
}
public function getItemAt(_arg1:uint):Object{
checkIndex(_arg1, (data.length - 1));
return (data[_arg1]);
}
override public function toString():String{
return ((("DataProvider [" + data.join(" , ")) + "]"));
}
public function invalidateItem(_arg1:Object):void{
var _local2:uint;
_local2 = getItemIndex(_arg1);
if (_local2 == -1){
return;
};
invalidateItemAt(_local2);
}
protected function dispatchChangeEvent(_arg1:String, _arg2:Array, _arg3:int, _arg4:int):void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, _arg1, _arg2, _arg3, _arg4));
}
protected function checkIndex(_arg1:int, _arg2:int):void{
if ((((_arg1 > _arg2)) || ((_arg1 < 0)))){
throw (new RangeError((((("DataProvider index (" + _arg1) + ") is not in acceptable range (0 - ") + _arg2) + ")")));
};
}
public function addItemsAt(_arg1:Object, _arg2:uint):void{
var _local3:Array;
checkIndex(_arg2, data.length);
_local3 = getDataFromObject(_arg1);
dispatchPreChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
data.splice.apply(data, [_arg2, 0].concat(_local3));
dispatchChangeEvent(DataChangeType.ADD, _local3, _arg2, ((_arg2 + _local3.length) - 1));
}
public function replaceItem(_arg1:Object, _arg2:Object):Object{
var _local3:int;
_local3 = getItemIndex(_arg2);
if (_local3 != -1){
return (replaceItemAt(_arg1, _local3));
};
return (null);
}
public function removeItem(_arg1:Object):Object{
var _local2:int;
_local2 = getItemIndex(_arg1);
if (_local2 != -1){
return (removeItemAt(_local2));
};
return (null);
}
public function merge(_arg1:Object):void{
var _local2:Array;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:Object;
_local2 = getDataFromObject(_arg1);
_local3 = _local2.length;
_local4 = data.length;
dispatchPreChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
_local5 = 0;
while (_local5 < _local3) {
_local6 = _local2[_local5];
if (getItemIndex(_local6) == -1){
data.push(_local6);
};
_local5++;
};
if (data.length > _local4){
dispatchChangeEvent(DataChangeType.ADD, data.slice(_local4, data.length), _local4, (this.data.length - 1));
} else {
dispatchChangeEvent(DataChangeType.ADD, [], -1, -1);
};
}
public function replaceItemAt(_arg1:Object, _arg2:uint):Object{
var _local3:Array;
checkIndex(_arg2, (data.length - 1));
_local3 = [data[_arg2]];
dispatchPreChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
data[_arg2] = _arg1;
dispatchChangeEvent(DataChangeType.REPLACE, _local3, _arg2, _arg2);
return (_local3[0]);
}
public function invalidate():void{
dispatchEvent(new DataChangeEvent(DataChangeEvent.DATA_CHANGE, DataChangeType.INVALIDATE_ALL, data.concat(), 0, data.length));
}
public function removeAll():void{
var _local1:Array;
_local1 = data.concat();
dispatchPreChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
data = [];
dispatchChangeEvent(DataChangeType.REMOVE_ALL, _local1, 0, _local1.length);
}
}
}//package fl.data
Section 66
//SimpleCollectionItem (fl.data.SimpleCollectionItem)
package fl.data {
public dynamic class SimpleCollectionItem {
public var label:String;
public var data:String;
public function toString():String{
return ((((("[SimpleCollectionItem: " + label) + ",") + data) + "]"));
}
}
}//package fl.data
Section 67
//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 68
//DataChangeEvent (fl.events.DataChangeEvent)
package fl.events {
import flash.events.*;
public class DataChangeEvent extends Event {
protected var _items:Array;
protected var _endIndex:uint;
protected var _changeType:String;
protected var _startIndex:uint;
public static const PRE_DATA_CHANGE:String = "preDataChange";
public static const DATA_CHANGE:String = "dataChange";
public function DataChangeEvent(_arg1:String, _arg2:String, _arg3:Array, _arg4:int=-1, _arg5:int=-1):void{
super(_arg1);
_changeType = _arg2;
_startIndex = _arg4;
_items = _arg3;
_endIndex = ((_arg5)==-1) ? _startIndex : _arg5;
}
public function get changeType():String{
return (_changeType);
}
public function get startIndex():uint{
return (_startIndex);
}
public function get items():Array{
return (_items);
}
override public function clone():Event{
return (new DataChangeEvent(type, _changeType, _items, _startIndex, _endIndex));
}
override public function toString():String{
return (formatToString("DataChangeEvent", "type", "changeType", "startIndex", "endIndex", "bubbles", "cancelable"));
}
public function get endIndex():uint{
return (_endIndex);
}
}
}//package fl.events
Section 69
//DataChangeType (fl.events.DataChangeType)
package fl.events {
public class DataChangeType {
public static const ADD:String = "add";
public static const REMOVE:String = "remove";
public static const REMOVE_ALL:String = "removeAll";
public static const CHANGE:String = "change";
public static const REPLACE:String = "replace";
public static const INVALIDATE:String = "invalidate";
public static const INVALIDATE_ALL:String = "invalidateAll";
public static const SORT:String = "sort";
}
}//package fl.events
Section 70
//DataGridEvent (fl.events.DataGridEvent)
package fl.events {
import flash.events.*;
public class DataGridEvent extends ListEvent {
protected var _itemRenderer:Object;
protected var _reason:String;
protected var _dataField:String;
public static const ITEM_EDIT_BEGIN:String = "itemEditBegin";
public static const ITEM_EDIT_END:String = "itemEditEnd";
public static const ITEM_EDIT_BEGINNING:String = "itemEditBeginning";
public static const HEADER_RELEASE:String = "headerRelease";
public static const ITEM_FOCUS_IN:String = "itemFocusIn";
public static const ITEM_FOCUS_OUT:String = "itemFocusOut";
public static const COLUMN_STRETCH:String = "columnStretch";
public function DataGridEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:Object=null, _arg7:String=null, _arg8:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
_itemRenderer = _arg6;
_dataField = _arg7;
_reason = _arg8;
}
public function get reason():String{
return (_reason);
}
public function set dataField(_arg1:String):void{
_dataField = _arg1;
}
override public function toString():String{
return (formatToString("DataGridEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "itemRenderer", "dataField", "reason"));
}
public function get dataField():String{
return (_dataField);
}
override public function clone():Event{
return (new DataGridEvent(type, bubbles, cancelable, columnIndex, int(rowIndex), _itemRenderer, _dataField, _reason));
}
public function get itemRenderer():Object{
return (_itemRenderer);
}
}
}//package fl.events
Section 71
//DataGridEventReason (fl.events.DataGridEventReason)
package fl.events {
public final class DataGridEventReason {
public static const OTHER:String = "other";
public static const CANCELLED:String = "cancelled";
public static const NEW_COLUMN:String = "newColumn";
public static const NEW_ROW:String = "newRow";
}
}//package fl.events
Section 72
//ListEvent (fl.events.ListEvent)
package fl.events {
import flash.events.*;
public class ListEvent extends Event {
protected var _index:int;
protected var _item:Object;
protected var _columnIndex:int;
protected var _rowIndex:int;
public static const ITEM_DOUBLE_CLICK:String = "itemDoubleClick";
public static const ITEM_ROLL_OUT:String = "itemRollOut";
public static const ITEM_ROLL_OVER:String = "itemRollOver";
public static const ITEM_CLICK:String = "itemClick";
public function ListEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=-1, _arg5:int=-1, _arg6:int=-1, _arg7:Object=null){
super(_arg1, _arg2, _arg3);
_rowIndex = _arg5;
_columnIndex = _arg4;
_index = _arg6;
_item = _arg7;
}
public function get rowIndex():Object{
return (_rowIndex);
}
public function get index():int{
return (_index);
}
public function get item():Object{
return (_item);
}
public function get columnIndex():int{
return (_columnIndex);
}
override public function clone():Event{
return (new ListEvent(type, bubbles, cancelable, _columnIndex, _rowIndex));
}
override public function toString():String{
return (formatToString("ListEvent", "type", "bubbles", "cancelable", "columnIndex", "rowIndex", "index", "item"));
}
}
}//package fl.events
Section 73
//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 74
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.core.*;
import fl.controls.*;
import flash.display.*;
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 75
//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 76
//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 77
//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 78
//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 79
//Bounce (gs.easing.Bounce)
package gs.easing {
public class Bounce {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 - easeOut((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeIn((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOut(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
}
}//package gs.easing
Section 80
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
}
}//package gs.plugins
Section 81
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _info:Array;
protected var _a:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function init(_arg1:Array, _arg2:Array):void{
var _local3:int;
_a = _arg1;
_local3 = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
}
}//package gs.plugins
Section 82
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
public var frame:int;
protected var _target:MovieClip;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
}
}//package gs.plugins
Section 83
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 84
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
protected var _target:DisplayObject;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:ColorTransform;
if (!(_arg1 is DisplayObject)){
return (false);
};
_local4 = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package gs.plugins
Section 85
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var round:Boolean;
public var onComplete:Function;
public var propName:String;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
_changeFactor = 0;
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 86
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
}
}//package gs.plugins
Section 87
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _st:SoundTransform;
protected var _target:Object;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
}
}//package gs.plugins
Section 88
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var index:uint;
public var start:Number;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 89
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 90
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
import gs.utils.tween.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array):void{
var _local4:int;
var _local5:String;
var _local6:TweenInfo;
_local4 = (_arg3.length - 1);
while (_local4 > -1) {
_local6 = _arg3[_local4];
if ((_local6.name in _arg1)){
_arg3.splice(_local4, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_arg1);
if (_local6.target.overwriteProps.length == 0){
_arg3.splice(_local4, 1);
};
};
};
_local4--;
};
for (_local5 in _arg1) {
delete _arg2[_local5];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local3:Object;
var _local4:int;
var _local5:Number;
var _local6:Array;
var _local7:int;
var _local8:TweenLite;
var _local9:int;
var _local10:Array;
var _local11:Object;
var _local12:int;
var _local13:TweenInfo;
var _local14:Array;
_local3 = _arg1.vars;
_local4 = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
_local5 = _arg1.startTime;
_local6 = [];
_local9 = -1;
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (_local8 == _arg1){
_local9 = _local7;
} else {
if ((((((_local7 < _local9)) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
};
_local7--;
};
if ((((_local6.length == 0)) || ((_arg1.tweens.length == 0)))){
return;
};
if (_local4 == AUTO){
_local10 = _arg1.tweens;
_local11 = {};
_local7 = (_local10.length - 1);
while (_local7 > -1) {
_local13 = _local10[_local7];
if (_local13.isPlugin){
if (_local13.name == "_MULTIPLE_"){
_local14 = _local13.target.overwriteProps;
_local12 = (_local14.length - 1);
while (_local12 > -1) {
_local11[_local14[_local12]] = true;
_local12--;
};
} else {
_local11[_local13.name] = true;
};
_local11[_local13.target.propName] = true;
} else {
_local11[_local13.name] = true;
};
_local7--;
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
killVars(_local11, _local6[_local7].exposedVars, _local6[_local7].tweens);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 91
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var started:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
public var exposedVars:Object;
public var combinedTimeScale:Number;
public var initTime:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
super();
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
_local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
_local2 = (currentTime = getTimer());
_local3 = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 92
//BeamMC (BeamMC)
package {
import flash.display.*;
public dynamic class BeamMC extends MovieClip {
}
}//package
Section 93
//Bonus2X (Bonus2X)
package {
import flash.display.*;
public dynamic class Bonus2X extends MovieClip {
}
}//package
Section 94
//Bonus3X (Bonus3X)
package {
import flash.display.*;
public dynamic class Bonus3X extends MovieClip {
}
}//package
Section 95
//Bonus45Degree (Bonus45Degree)
package {
import flash.display.*;
public dynamic class Bonus45Degree extends MovieClip {
}
}//package
Section 96
//BonusDouble (BonusDouble)
package {
import flash.display.*;
public dynamic class BonusDouble extends MovieClip {
}
}//package
Section 97
//BonusPower (BonusPower)
package {
import flash.display.*;
public dynamic class BonusPower extends MovieClip {
}
}//package
Section 98
//BUMP (BUMP)
package {
import flash.media.*;
public dynamic class BUMP extends Sound {
}
}//package
Section 99
//CellRenderer_disabledSkin (CellRenderer_disabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_disabledSkin extends MovieClip {
}
}//package
Section 100
//CellRenderer_downSkin (CellRenderer_downSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_downSkin extends MovieClip {
}
}//package
Section 101
//CellRenderer_overSkin (CellRenderer_overSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_overSkin extends MovieClip {
}
}//package
Section 102
//CellRenderer_selectedDisabledSkin (CellRenderer_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDisabledSkin extends MovieClip {
}
}//package
Section 103
//CellRenderer_selectedDownSkin (CellRenderer_selectedDownSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedDownSkin extends MovieClip {
}
}//package
Section 104
//CellRenderer_selectedOverSkin (CellRenderer_selectedOverSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedOverSkin extends MovieClip {
}
}//package
Section 105
//CellRenderer_selectedUpSkin (CellRenderer_selectedUpSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_selectedUpSkin extends MovieClip {
}
}//package
Section 106
//CellRenderer_upSkin (CellRenderer_upSkin)
package {
import flash.display.*;
public dynamic class CellRenderer_upSkin extends MovieClip {
}
}//package
Section 107
//ChancePinMC (ChancePinMC)
package {
import flash.display.*;
public dynamic class ChancePinMC extends MovieClip {
}
}//package
Section 108
//CLICK (CLICK)
package {
import flash.media.*;
public dynamic class CLICK extends Sound {
}
}//package
Section 109
//ColumnStretch_cursor (ColumnStretch_cursor)
package {
import flash.display.*;
public dynamic class ColumnStretch_cursor extends MovieClip {
}
}//package
Section 110
//ComboAchievementMC (ComboAchievementMC)
package {
import flash.display.*;
public dynamic class ComboAchievementMC extends MovieClip {
public function ComboAchievementMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 111
//ComboScoreMC (ComboScoreMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ComboScoreMC extends MovieClip {
public var comboScore_txt:TextField;
}
}//package
Section 112
//DataGrid_skin (DataGrid_skin)
package {
import flash.display.*;
public dynamic class DataGrid_skin extends MovieClip {
}
}//package
Section 113
//DataGridCellEditor_skin (DataGridCellEditor_skin)
package {
import flash.display.*;
public dynamic class DataGridCellEditor_skin extends MovieClip {
}
}//package
Section 114
//DEADGUY (DEADGUY)
package {
import flash.media.*;
public dynamic class DEADGUY extends Sound {
}
}//package
Section 115
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 116
//gamesfree1 (gamesfree1)
package {
import flash.media.*;
public dynamic class gamesfree1 extends Sound {
}
}//package
Section 117
//gamesfree2 (gamesfree2)
package {
import flash.media.*;
public dynamic class gamesfree2 extends Sound {
}
}//package
Section 118
//GameSND (GameSND)
package {
import flash.media.*;
public dynamic class GameSND extends Sound {
}
}//package
Section 119
//HeaderRenderer_disabledSkin (HeaderRenderer_disabledSkin)
package {
import flash.display.*;
public dynamic class HeaderRenderer_disabledSkin extends MovieClip {
}
}//package
Section 120
//HeaderRenderer_downSkin (HeaderRenderer_downSkin)
package {
import flash.display.*;
public dynamic class HeaderRenderer_downSkin extends MovieClip {
}
}//package
Section 121
//HeaderRenderer_overSkin (HeaderRenderer_overSkin)
package {
import flash.display.*;
public dynamic class HeaderRenderer_overSkin extends MovieClip {
}
}//package
Section 122
//HeaderRenderer_selectedDisabledSkin (HeaderRenderer_selectedDisabledSkin)
package {
import flash.display.*;
public dynamic class HeaderRenderer_selectedDisabledSkin extends MovieClip {
}
}//package
Section 123
//HeaderRenderer_selectedDownSkin (HeaderRenderer_selectedDownSkin)
package {
import flash.display.*;
public dynamic class HeaderRenderer_selectedDownSkin extends MovieClip {
}
}//package
Section 124
//HeaderRenderer_selectedOverSkin (HeaderRenderer_selectedOverSkin)
package {
import flash.display.*;
public dynamic class HeaderRenderer_selectedOverSkin extends MovieClip {
}
}//package
Section 125
//HeaderRenderer_selectedUpSkin (HeaderRenderer_selectedUpSkin)
package {
import flash.display.*;
public dynamic class HeaderRenderer_selectedUpSkin extends MovieClip {
}
}//package
Section 126
//HeaderRenderer_upSkin (HeaderRenderer_upSkin)
package {
import flash.display.*;
public dynamic class HeaderRenderer_upSkin extends MovieClip {
}
}//package
Section 127
//HeaderSortArrow_ascIcon (HeaderSortArrow_ascIcon)
package {
import flash.display.*;
public dynamic class HeaderSortArrow_ascIcon extends MovieClip {
}
}//package
Section 128
//HeaderSortArrow_descIcon (HeaderSortArrow_descIcon)
package {
import flash.display.*;
public dynamic class HeaderSortArrow_descIcon extends MovieClip {
}
}//package
Section 129
//KilatMC (KilatMC)
package {
import flash.display.*;
public dynamic class KilatMC extends MovieClip {
public function KilatMC(){
addFrameScript(4, frame5);
}
function frame5(){
stop();
MovieClip(this.parent).removeChild(this);
}
}
}//package
Section 130
//LedakanMC (LedakanMC)
package {
import flash.display.*;
public dynamic class LedakanMC extends MovieClip {
public function LedakanMC(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
MovieClip(this.parent).removeChild(this);
}
}
}//package
Section 131
//LoseSND (LoseSND)
package {
import flash.media.*;
public dynamic class LoseSND extends Sound {
}
}//package
Section 132
//NumericStepperDownArrow_disabledSkin (NumericStepperDownArrow_disabledSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_disabledSkin extends MovieClip {
}
}//package
Section 133
//NumericStepperDownArrow_downSkin (NumericStepperDownArrow_downSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_downSkin extends MovieClip {
}
}//package
Section 134
//NumericStepperDownArrow_overSkin (NumericStepperDownArrow_overSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_overSkin extends MovieClip {
}
}//package
Section 135
//NumericStepperDownArrow_upSkin (NumericStepperDownArrow_upSkin)
package {
import flash.display.*;
public dynamic class NumericStepperDownArrow_upSkin extends MovieClip {
}
}//package
Section 136
//NumericStepperUpArrow_disabledSkin (NumericStepperUpArrow_disabledSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_disabledSkin extends MovieClip {
}
}//package
Section 137
//NumericStepperUpArrow_downSkin (NumericStepperUpArrow_downSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_downSkin extends MovieClip {
}
}//package
Section 138
//NumericStepperUpArrow_overSkin (NumericStepperUpArrow_overSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_overSkin extends MovieClip {
}
}//package
Section 139
//NumericStepperUpArrow_upSkin (NumericStepperUpArrow_upSkin)
package {
import flash.display.*;
public dynamic class NumericStepperUpArrow_upSkin extends MovieClip {
}
}//package
Section 140
//Pin1MC (Pin1MC)
package {
import flash.display.*;
import flash.events.*;
public dynamic class Pin1MC extends MovieClip {
public var value:int;
public var bonusHolder_mc:MovieClip;
public function Pin1MC(){
addFrameScript(0, frame1, 5, frame6, 10, frame11, 15, frame16);
}
function frame6(){
value = 2;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
function frame16(){
value = 4;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
public function onOver(_arg1:MouseEvent):void{
trace(this.getChildAt(0));
MovieClip(this.getChildAt(0)).gotoAndPlay(1);
}
function frame1(){
stop();
value = 1;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
function frame11(){
value = 3;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
}
}//package
Section 141
//Pin2MC (Pin2MC)
package {
import flash.display.*;
import flash.events.*;
public dynamic class Pin2MC extends MovieClip {
public var value:int;
public var bonusHolder_mc:MovieClip;
public function Pin2MC(){
addFrameScript(0, frame1, 5, frame6, 10, frame11, 15, frame16);
}
function frame6(){
value = 2;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
function frame16(){
value = 4;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
public function onOver(_arg1:MouseEvent):void{
trace(this.getChildAt(0));
MovieClip(this.getChildAt(0)).gotoAndPlay(1);
}
function frame1(){
stop();
value = 1;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
function frame11(){
value = 3;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
}
}//package
Section 142
//PinMC (PinMC)
package {
import flash.display.*;
import flash.events.*;
public dynamic class PinMC extends MovieClip {
public var value:int;
public var bonusHolder_mc:MovieClip;
public function PinMC(){
addFrameScript(0, frame1, 5, frame6, 10, frame11, 15, frame16);
}
function frame6(){
value = 2;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
function frame16(){
value = 4;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
public function onOver(_arg1:MouseEvent):void{
trace(this.getChildAt(0));
MovieClip(this.getChildAt(0)).gotoAndPlay(1);
}
function frame1(){
stop();
value = 1;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
function frame11(){
value = 3;
this.addEventListener(MouseEvent.ROLL_OVER, onOver);
this.mouseChildren = false;
}
}
}//package
Section 143
//PinScoreMC (PinScoreMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PinScoreMC extends MovieClip {
public var pinScore_txt:TextField;
}
}//package
Section 144
//PuzzleBtn (PuzzleBtn)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PuzzleBtn extends MovieClip {
public var theText:TextField;
}
}//package
Section 145
//PuzzleButtonMC (PuzzleButtonMC)
package {
import flash.display.*;
import flash.text.*;
public dynamic class PuzzleButtonMC extends MovieClip {
public var puzzle_txt:TextField;
public function PuzzleButtonMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 146
//PuzzleComboAward (PuzzleComboAward)
package {
import flash.display.*;
public dynamic class PuzzleComboAward extends MovieClip {
}
}//package
Section 147
//ScrollArrowDown_disabledSkin (ScrollArrowDown_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_disabledSkin extends MovieClip {
}
}//package
Section 148
//ScrollArrowDown_downSkin (ScrollArrowDown_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_downSkin extends MovieClip {
}
}//package
Section 149
//ScrollArrowDown_overSkin (ScrollArrowDown_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_overSkin extends MovieClip {
}
}//package
Section 150
//ScrollArrowDown_upSkin (ScrollArrowDown_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowDown_upSkin extends MovieClip {
}
}//package
Section 151
//ScrollArrowUp_disabledSkin (ScrollArrowUp_disabledSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_disabledSkin extends MovieClip {
}
}//package
Section 152
//ScrollArrowUp_downSkin (ScrollArrowUp_downSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_downSkin extends MovieClip {
}
}//package
Section 153
//ScrollArrowUp_overSkin (ScrollArrowUp_overSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_overSkin extends MovieClip {
}
}//package
Section 154
//ScrollArrowUp_upSkin (ScrollArrowUp_upSkin)
package {
import flash.display.*;
public dynamic class ScrollArrowUp_upSkin extends MovieClip {
}
}//package
Section 155
//ScrollBar_thumbIcon (ScrollBar_thumbIcon)
package {
import flash.display.*;
public dynamic class ScrollBar_thumbIcon extends MovieClip {
}
}//package
Section 156
//ScrollThumb_downSkin (ScrollThumb_downSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_downSkin extends MovieClip {
}
}//package
Section 157
//ScrollThumb_overSkin (ScrollThumb_overSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_overSkin extends MovieClip {
}
}//package
Section 158
//ScrollThumb_upSkin (ScrollThumb_upSkin)
package {
import flash.display.*;
public dynamic class ScrollThumb_upSkin extends MovieClip {
}
}//package
Section 159
//ScrollTrack_skin (ScrollTrack_skin)
package {
import flash.display.*;
public dynamic class ScrollTrack_skin extends MovieClip {
}
}//package
Section 160
//SHOCK (SHOCK)
package {
import flash.media.*;
public dynamic class SHOCK extends Sound {
}
}//package
Section 161
//TextInput_disabledSkin (TextInput_disabledSkin)
package {
import flash.display.*;
public dynamic class TextInput_disabledSkin extends MovieClip {
}
}//package
Section 162
//TextInput_upSkin (TextInput_upSkin)
package {
import flash.display.*;
public dynamic class TextInput_upSkin extends MovieClip {
}
}//package
Section 163
//TitleSND (TitleSND)
package {
import flash.media.*;
public dynamic class TitleSND extends Sound {
}
}//package
Section 164
//WallMC (WallMC)
package {
import flash.display.*;
public dynamic class WallMC extends MovieClip {
public function WallMC(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 165
//WinSND (WinSND)
package {
import flash.media.*;
public dynamic class WinSND extends Sound {
}
}//package