Section 1
//ChunkUI (assets.effects.ChunkUI)
package assets.effects {
import flash.display.*;
public dynamic class ChunkUI extends MovieClip {
}
}//package assets.effects
Section 2
//ExplodeUI (assets.effects.ExplodeUI)
package assets.effects {
import flash.display.*;
public dynamic class ExplodeUI extends MovieClip {
}
}//package assets.effects
Section 3
//MapScar (assets.effects.MapScar)
package assets.effects {
import flash.display.*;
public dynamic class MapScar extends MovieClip {
}
}//package assets.effects
Section 4
//MortarExplosionAnim (assets.effects.MortarExplosionAnim)
package assets.effects {
import flash.display.*;
public dynamic class MortarExplosionAnim extends MovieClip {
}
}//package assets.effects
Section 5
//ParticleUI (assets.effects.ParticleUI)
package assets.effects {
import flash.display.*;
public dynamic class ParticleUI extends MovieClip {
}
}//package assets.effects
Section 6
//RocketExplosionAnim (assets.effects.RocketExplosionAnim)
package assets.effects {
import flash.display.*;
public dynamic class RocketExplosionAnim extends MovieClip {
}
}//package assets.effects
Section 7
//Brunt (assets.enemies.Brunt)
package assets.enemies {
import flash.display.*;
public dynamic class Brunt extends MovieClip {
}
}//package assets.enemies
Section 8
//Galvatron (assets.enemies.Galvatron)
package assets.enemies {
import flash.display.*;
public dynamic class Galvatron extends MovieClip {
public function Galvatron(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets.enemies
Section 9
//HealthBar (assets.enemies.HealthBar)
package assets.enemies {
import flash.display.*;
public dynamic class HealthBar extends MovieClip {
public var red_mc:MovieClip;
public var green_mc:MovieClip;
}
}//package assets.enemies
Section 10
//Insecticon (assets.enemies.Insecticon)
package assets.enemies {
import flash.display.*;
public dynamic class Insecticon extends MovieClip {
public function Insecticon(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets.enemies
Section 11
//Ravage (assets.enemies.Ravage)
package assets.enemies {
import flash.display.*;
public dynamic class Ravage extends MovieClip {
public function Ravage(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets.enemies
Section 12
//Shockwave (assets.enemies.Shockwave)
package assets.enemies {
import flash.display.*;
public dynamic class Shockwave extends MovieClip {
public function Shockwave(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets.enemies
Section 13
//Starscream (assets.enemies.Starscream)
package assets.enemies {
import flash.display.*;
public dynamic class Starscream extends MovieClip {
}
}//package assets.enemies
Section 14
//BlasterTowerIcon (assets.hud.BlasterTowerIcon)
package assets.hud {
import flash.display.*;
public dynamic class BlasterTowerIcon extends MovieClip {
}
}//package assets.hud
Section 15
//CenterPanel (assets.hud.CenterPanel)
package assets.hud {
import flash.display.*;
public dynamic class CenterPanel extends MovieClip {
public var ironhideOver:MovieClip;
public var ratchetDisabled:MovieClip;
public var jazzOver:MovieClip;
public var optimusOver:MovieClip;
public var jazzDisabled:MovieClip;
public var jazzEnabled:MovieClip;
public var optimusDisabled:MovieClip;
public var ratchetEnabled:MovieClip;
public var ironhideDisabled:MovieClip;
public var bumblebeeOver:MovieClip;
public var optimusEnabled:MovieClip;
public var divxDisabled:MovieClip;
public var bumblebeeEnabled:MovieClip;
public var ironhideEnabled:MovieClip;
public var bumblebeeDisabled:MovieClip;
public var ratchetOver:MovieClip;
}
}//package assets.hud
Section 16
//ConfirmExitScreen (assets.hud.ConfirmExitScreen)
package assets.hud {
import flash.display.*;
public dynamic class ConfirmExitScreen extends MovieClip {
public var yesGlow:MovieClip;
public var noButton:MovieClip;
public var mapCover:MovieClip;
public var noGlow:MovieClip;
public var yesButton:MovieClip;
}
}//package assets.hud
Section 17
//GameDefeatScreen (assets.hud.GameDefeatScreen)
package assets.hud {
import flash.display.*;
public dynamic class GameDefeatScreen extends MovieClip {
public var mapCover:MovieClip;
}
}//package assets.hud
Section 18
//GamePauseScreen (assets.hud.GamePauseScreen)
package assets.hud {
import flash.display.*;
public dynamic class GamePauseScreen extends MovieClip {
public var pauseGlow:MovieClip;
public var mapCover:MovieClip;
public var pauseButton:MovieClip;
}
}//package assets.hud
Section 19
//GameVictoryScreen (assets.hud.GameVictoryScreen)
package assets.hud {
import flash.display.*;
public dynamic class GameVictoryScreen extends MovieClip {
public var mapCover:MovieClip;
}
}//package assets.hud
Section 20
//HoverAllowed (assets.hud.HoverAllowed)
package assets.hud {
import flash.display.*;
public dynamic class HoverAllowed extends MovieClip {
}
}//package assets.hud
Section 21
//HoverDenied (assets.hud.HoverDenied)
package assets.hud {
import flash.display.*;
public dynamic class HoverDenied extends MovieClip {
}
}//package assets.hud
Section 22
//HudBG (assets.hud.HudBG)
package assets.hud {
import flash.display.*;
public dynamic class HudBG extends MovieClip {
}
}//package assets.hud
Section 23
//LaserTowerIcon (assets.hud.LaserTowerIcon)
package assets.hud {
import flash.display.*;
public dynamic class LaserTowerIcon extends MovieClip {
}
}//package assets.hud
Section 24
//LivesPanelGraphic (assets.hud.LivesPanelGraphic)
package assets.hud {
import flash.display.*;
public dynamic class LivesPanelGraphic extends MovieClip {
public var livesProgress:MovieClip;
}
}//package assets.hud
Section 25
//MortarTowerIcon (assets.hud.MortarTowerIcon)
package assets.hud {
import flash.display.*;
public dynamic class MortarTowerIcon extends MovieClip {
}
}//package assets.hud
Section 26
//NoSelectionPanel (assets.hud.NoSelectionPanel)
package assets.hud {
import flash.display.*;
public dynamic class NoSelectionPanel extends MovieClip {
}
}//package assets.hud
Section 27
//PauseMenuGraphic (assets.hud.PauseMenuGraphic)
package assets.hud {
import flash.display.*;
public dynamic class PauseMenuGraphic extends MovieClip {
public var menuButton:MovieClip;
public var pauseButton:MovieClip;
}
}//package assets.hud
Section 28
//PreviewPanel (assets.hud.PreviewPanel)
package assets.hud {
import flash.display.*;
import flash.text.*;
public dynamic class PreviewPanel extends MovieClip {
public var cost_txt:TextField;
public var towerType_txt:TextField;
public var statBar:StatBar;
public var disc:MovieClip;
}
}//package assets.hud
Section 29
//RightPanel (assets.hud.RightPanel)
package assets.hud {
import flash.display.*;
import flash.text.*;
public dynamic class RightPanel extends MovieClip {
public var wave_txt:TextField;
public var sendNextWave:MovieClip;
public var score_txt:TextField;
public var nextWaveGlow:MovieClip;
public var bonus_txt:TextField;
public var waveProgress:MovieClip;
public var sparks_txt:TextField;
}
}//package assets.hud
Section 30
//RocketTowerIcon (assets.hud.RocketTowerIcon)
package assets.hud {
import flash.display.*;
public dynamic class RocketTowerIcon extends MovieClip {
}
}//package assets.hud
Section 31
//SelectedPanel (assets.hud.SelectedPanel)
package assets.hud {
import flash.display.*;
import flash.text.*;
public dynamic class SelectedPanel extends MovieClip {
public var upgradeOver:MovieClip;
public var towerType_txt:TextField;
public var responseCheckbox:MovieClip;
public var statBar:StatBar;
public var rangeCheckbox:MovieClip;
public var frequencyCheckbox:MovieClip;
public var sellOver:MovieClip;
public var upgradeOff:MovieClip;
public var sellOff:MovieClip;
}
}//package assets.hud
Section 32
//SlowdownTowerIcon (assets.hud.SlowdownTowerIcon)
package assets.hud {
import flash.display.*;
public dynamic class SlowdownTowerIcon extends MovieClip {
}
}//package assets.hud
Section 33
//StatBar (assets.hud.StatBar)
package assets.hud {
import flash.display.*;
public dynamic class StatBar extends MovieClip {
public var range:MovieClip;
public var response:MovieClip;
public var frequency:MovieClip;
public var damage:MovieClip;
}
}//package assets.hud
Section 34
//UpgradePanel (assets.hud.UpgradePanel)
package assets.hud {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradePanel extends MovieClip {
public var title_txt:TextField;
public var tooltip:MovieClip;
public var levelUnavailable:MovieClip;
public var statBar:StatBar;
public var frequencyUsed:MovieClip;
public var frequencyOver:MovieClip;
public var frequencyUnavailable:MovieClip;
public var levelOff:MovieClip;
public var levelUsed:MovieClip;
public var responseUnavailable:MovieClip;
public var responseOff:MovieClip;
public var levelOver:MovieClip;
public var cancelOver:MovieClip;
public var frequencyOff:MovieClip;
public var rangeUsed:MovieClip;
public var rangeOver:MovieClip;
public var responseOver:MovieClip;
public var cancelOff:MovieClip;
public var rangeUnavailable:MovieClip;
public var responseUsed:MovieClip;
public var rangeOff:MovieClip;
}
}//package assets.hud
Section 35
//BruntExplosion (assets.sfx.explosions.BruntExplosion)
package assets.sfx.explosions {
import flash.media.*;
public dynamic class BruntExplosion extends Sound {
}
}//package assets.sfx.explosions
Section 36
//EnemyObjective (assets.sfx.explosions.EnemyObjective)
package assets.sfx.explosions {
import flash.media.*;
public dynamic class EnemyObjective extends Sound {
}
}//package assets.sfx.explosions
Section 37
//GalvatronExplosion (assets.sfx.explosions.GalvatronExplosion)
package assets.sfx.explosions {
import flash.media.*;
public dynamic class GalvatronExplosion extends Sound {
}
}//package assets.sfx.explosions
Section 38
//InsecticonExplosion (assets.sfx.explosions.InsecticonExplosion)
package assets.sfx.explosions {
import flash.media.*;
public dynamic class InsecticonExplosion extends Sound {
}
}//package assets.sfx.explosions
Section 39
//RavageExplosion (assets.sfx.explosions.RavageExplosion)
package assets.sfx.explosions {
import flash.media.*;
public dynamic class RavageExplosion extends Sound {
}
}//package assets.sfx.explosions
Section 40
//ShockwaveExplosion (assets.sfx.explosions.ShockwaveExplosion)
package assets.sfx.explosions {
import flash.media.*;
public dynamic class ShockwaveExplosion extends Sound {
}
}//package assets.sfx.explosions
Section 41
//StarscreamExplosion (assets.sfx.explosions.StarscreamExplosion)
package assets.sfx.explosions {
import flash.media.*;
public dynamic class StarscreamExplosion extends Sound {
}
}//package assets.sfx.explosions
Section 42
//TransformersLoop (assets.sfx.music.TransformersLoop)
package assets.sfx.music {
import flash.media.*;
public dynamic class TransformersLoop extends Sound {
}
}//package assets.sfx.music
Section 43
//TowerBonus (assets.sfx.towers.TowerBonus)
package assets.sfx.towers {
import flash.media.*;
public dynamic class TowerBonus extends Sound {
}
}//package assets.sfx.towers
Section 44
//TowerBuild (assets.sfx.towers.TowerBuild)
package assets.sfx.towers {
import flash.media.*;
public dynamic class TowerBuild extends Sound {
}
}//package assets.sfx.towers
Section 45
//TowerSell (assets.sfx.towers.TowerSell)
package assets.sfx.towers {
import flash.media.*;
public dynamic class TowerSell extends Sound {
}
}//package assets.sfx.towers
Section 46
//TowerUpgrade (assets.sfx.towers.TowerUpgrade)
package assets.sfx.towers {
import flash.media.*;
public dynamic class TowerUpgrade extends Sound {
}
}//package assets.sfx.towers
Section 47
//BlasterFire (assets.sfx.weapons.BlasterFire)
package assets.sfx.weapons {
import flash.media.*;
public dynamic class BlasterFire extends Sound {
}
}//package assets.sfx.weapons
Section 48
//LaserFire (assets.sfx.weapons.LaserFire)
package assets.sfx.weapons {
import flash.media.*;
public dynamic class LaserFire extends Sound {
}
}//package assets.sfx.weapons
Section 49
//MortarExplosion (assets.sfx.weapons.MortarExplosion)
package assets.sfx.weapons {
import flash.media.*;
public dynamic class MortarExplosion extends Sound {
}
}//package assets.sfx.weapons
Section 50
//MortarLaunch (assets.sfx.weapons.MortarLaunch)
package assets.sfx.weapons {
import flash.media.*;
public dynamic class MortarLaunch extends Sound {
}
}//package assets.sfx.weapons
Section 51
//RocketExplosion (assets.sfx.weapons.RocketExplosion)
package assets.sfx.weapons {
import flash.media.*;
public dynamic class RocketExplosion extends Sound {
}
}//package assets.sfx.weapons
Section 52
//SlowdownFire (assets.sfx.weapons.SlowdownFire)
package assets.sfx.weapons {
import flash.media.*;
public dynamic class SlowdownFire extends Sound {
}
}//package assets.sfx.weapons
Section 53
//BlasterTowerL1 (assets.towers.BlasterTowerL1)
package assets.towers {
import flash.display.*;
public dynamic class BlasterTowerL1 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 54
//BlasterTowerL2 (assets.towers.BlasterTowerL2)
package assets.towers {
import flash.display.*;
public dynamic class BlasterTowerL2 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 55
//BlasterTowerL3 (assets.towers.BlasterTowerL3)
package assets.towers {
import flash.display.*;
public dynamic class BlasterTowerL3 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 56
//LaserTowerL1 (assets.towers.LaserTowerL1)
package assets.towers {
import flash.display.*;
public dynamic class LaserTowerL1 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 57
//LaserTowerL2 (assets.towers.LaserTowerL2)
package assets.towers {
import flash.display.*;
public dynamic class LaserTowerL2 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 58
//LaserTowerL3 (assets.towers.LaserTowerL3)
package assets.towers {
import flash.display.*;
public dynamic class LaserTowerL3 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 59
//MortarTowerL1 (assets.towers.MortarTowerL1)
package assets.towers {
import flash.display.*;
public dynamic class MortarTowerL1 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 60
//MortarTowerL2 (assets.towers.MortarTowerL2)
package assets.towers {
import flash.display.*;
public dynamic class MortarTowerL2 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 61
//MortarTowerL3 (assets.towers.MortarTowerL3)
package assets.towers {
import flash.display.*;
public dynamic class MortarTowerL3 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 62
//RocketTowerL1 (assets.towers.RocketTowerL1)
package assets.towers {
import flash.display.*;
public dynamic class RocketTowerL1 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 63
//RocketTowerL2 (assets.towers.RocketTowerL2)
package assets.towers {
import flash.display.*;
public dynamic class RocketTowerL2 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 64
//RocketTowerL3 (assets.towers.RocketTowerL3)
package assets.towers {
import flash.display.*;
public dynamic class RocketTowerL3 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 65
//SlowdownTowerL1 (assets.towers.SlowdownTowerL1)
package assets.towers {
import flash.display.*;
public dynamic class SlowdownTowerL1 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 66
//SlowdownTowerL2 (assets.towers.SlowdownTowerL2)
package assets.towers {
import flash.display.*;
public dynamic class SlowdownTowerL2 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 67
//SlowdownTowerL3 (assets.towers.SlowdownTowerL3)
package assets.towers {
import flash.display.*;
public dynamic class SlowdownTowerL3 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets.towers
Section 68
//GameMask (assets.ui.GameMask)
package assets.ui {
import flash.display.*;
public dynamic class GameMask extends MovieClip {
}
}//package assets.ui
Section 69
//MortarProjectileL1 (assets.weapons.MortarProjectileL1)
package assets.weapons {
import flash.display.*;
public dynamic class MortarProjectileL1 extends MovieClip {
}
}//package assets.weapons
Section 70
//MortarProjectileL2 (assets.weapons.MortarProjectileL2)
package assets.weapons {
import flash.display.*;
public dynamic class MortarProjectileL2 extends MovieClip {
}
}//package assets.weapons
Section 71
//MortarProjectileL3 (assets.weapons.MortarProjectileL3)
package assets.weapons {
import flash.display.*;
public dynamic class MortarProjectileL3 extends MovieClip {
}
}//package assets.weapons
Section 72
//RocketProjectileL1 (assets.weapons.RocketProjectileL1)
package assets.weapons {
import flash.display.*;
public dynamic class RocketProjectileL1 extends MovieClip {
}
}//package assets.weapons
Section 73
//RocketProjectileL2 (assets.weapons.RocketProjectileL2)
package assets.weapons {
import flash.display.*;
public dynamic class RocketProjectileL2 extends MovieClip {
}
}//package assets.weapons
Section 74
//RocketProjectileL3 (assets.weapons.RocketProjectileL3)
package assets.weapons {
import flash.display.*;
public dynamic class RocketProjectileL3 extends MovieClip {
}
}//package assets.weapons
Section 75
//SlowdownExplosion (assets.weapons.SlowdownExplosion)
package assets.weapons {
import flash.display.*;
public dynamic class SlowdownExplosion extends MovieClip {
}
}//package assets.weapons
Section 76
//SlowdownProjectile (assets.weapons.SlowdownProjectile)
package assets.weapons {
import flash.display.*;
public dynamic class SlowdownProjectile extends MovieClip {
}
}//package assets.weapons
Section 77
//CreditsUI (assets.CreditsUI)
package assets {
import flash.display.*;
public dynamic class CreditsUI extends MovieClip {
public var uiframe:MovieClip;
public var footerUI:MovieClip;
public var header:MovieClip;
public var content_panel:MovieClip;
}
}//package assets
Section 78
//GameOverUI (assets.GameOverUI)
package assets {
import flash.display.*;
public dynamic class GameOverUI extends MovieClip {
public var uiframe:MovieClip;
public var footerUI:MovieClip;
public var header:MovieClip;
public var content_panel:MovieClip;
public var form:MovieClip;
}
}//package assets
Section 79
//GameUI (assets.GameUI)
package assets {
import flash.display.*;
public dynamic class GameUI extends MovieClip {
public var uiframe:MovieClip;
}
}//package assets
Section 80
//HelpUI (assets.HelpUI)
package assets {
import flash.display.*;
public dynamic class HelpUI extends MovieClip {
public var uiframe:MovieClip;
public var footerUI:MovieClip;
public var viewerClip:MovieClip;
public var header:MovieClip;
public var content_panel:MovieClip;
}
}//package assets
Section 81
//IntroUI (assets.IntroUI)
package assets {
import flash.display.*;
public dynamic class IntroUI extends MovieClip {
public var vidClip:MovieClip;
public var uiframe:MovieClip;
public var footerUI:MovieClip;
public var skipButton:MovieClip;
public var header:MovieClip;
}
}//package assets
Section 82
//Level01 (assets.Level01)
package assets {
import flash.display.*;
public dynamic class Level01 extends MovieClip {
}
}//package assets
Section 83
//Level01_animated (assets.Level01_animated)
package assets {
import flash.display.*;
public dynamic class Level01_animated extends MovieClip {
}
}//package assets
Section 84
//PreloaderUI (assets.PreloaderUI)
package assets {
import flash.display.*;
import flash.text.*;
public dynamic class PreloaderUI extends MovieClip {
public var label:TextField;
public var hexAnimation:MovieClip;
public var hexBg:MovieClip;
}
}//package assets
Section 85
//PrizesUI (assets.PrizesUI)
package assets {
import flash.display.*;
public dynamic class PrizesUI extends MovieClip {
public var uiframe:MovieClip;
public var footerUI:MovieClip;
public var viewerClip:MovieClip;
public var header:MovieClip;
public var content_panel:MovieClip;
}
}//package assets
Section 86
//ScoresUI (assets.ScoresUI)
package assets {
import flash.display.*;
public dynamic class ScoresUI extends MovieClip {
public var highScore:MovieClip;
public var uiframe:MovieClip;
public var footerUI:MovieClip;
public var header:MovieClip;
public var content_panel:MovieClip;
}
}//package assets
Section 87
//TitleUI (assets.TitleUI)
package assets {
import flash.display.*;
public dynamic class TitleUI extends MovieClip {
public var nav:MovieClip;
public var uiframe:MovieClip;
public var footerUI:MovieClip;
}
}//package assets
Section 88
//BlasterGunfire1_blue2_127 (assets_fla.BlasterGunfire1_blue2_127)
package assets_fla {
import flash.display.*;
public dynamic class BlasterGunfire1_blue2_127 extends MovieClip {
public var gunfire:MovieClip;
}
}//package assets_fla
Section 89
//BlasterGunfire1_rocket_109 (assets_fla.BlasterGunfire1_rocket_109)
package assets_fla {
import flash.display.*;
public dynamic class BlasterGunfire1_rocket_109 extends MovieClip {
public function BlasterGunfire1_rocket_109(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets_fla
Section 90
//discIcons_35 (assets_fla.discIcons_35)
package assets_fla {
import flash.display.*;
public dynamic class discIcons_35 extends MovieClip {
public function discIcons_35(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package assets_fla
Section 91
//fx_143 (assets_fla.fx_143)
package assets_fla {
import flash.events.*;
import flash.display.*;
public dynamic class fx_143 extends MovieClip {
public var train:MovieClip;
public function fx_143(){
addFrameScript(108, frame109);
}
public function resumePlay(_arg1:Event):void{
play();
train.removeEventListener("TRAIN", resumePlay);
}
function frame109(){
if (Math.random() < 0.5){
stop();
train.play();
train.addEventListener("TRAIN", resumePlay);
};
}
}
}//package assets_fla
Section 92
//fx_149 (assets_fla.fx_149)
package assets_fla {
import flash.events.*;
import flash.display.*;
public dynamic class fx_149 extends MovieClip {
public var t2:MovieClip;
public var t3:MovieClip;
public var t1:MovieClip;
public function fx_149(){
addFrameScript(0, frame1, 95, frame96, 222, frame223);
}
function frame223(){
dispatchEvent(new Event("TRAIN"));
}
function frame1(){
stop();
t1.nextFrame();
t2.nextFrame();
t3.nextFrame();
}
function frame96(){
stop();
dispatchEvent(new Event("TRAIN"));
}
}
}//package assets_fla
Section 93
//fx_150 (assets_fla.fx_150)
package assets_fla {
import flash.display.*;
public dynamic class fx_150 extends MovieClip {
public function fx_150(){
addFrameScript(0, frame1, 7, frame8);
}
function frame1(){
stop();
}
function frame8(){
gotoAndStop(2);
}
}
}//package assets_fla
Section 94
//fx_151 (assets_fla.fx_151)
package assets_fla {
import flash.display.*;
public dynamic class fx_151 extends MovieClip {
public function fx_151(){
addFrameScript(15, frame16);
}
function frame16(){
stop();
}
}
}//package assets_fla
Section 95
//LivesProgressBar_52 (assets_fla.LivesProgressBar_52)
package assets_fla {
import flash.display.*;
public dynamic class LivesProgressBar_52 extends MovieClip {
public var deadMask:MovieClip;
public var aliveMask:MovieClip;
}
}//package assets_fla
Section 96
//SelectedPanelBtnOff_38 (assets_fla.SelectedPanelBtnOff_38)
package assets_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SelectedPanelBtnOff_38 extends MovieClip {
public var txt:TextField;
}
}//package assets_fla
Section 97
//SelectedPanelBtnOver_39 (assets_fla.SelectedPanelBtnOver_39)
package assets_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SelectedPanelBtnOver_39 extends MovieClip {
public var txt:TextField;
}
}//package assets_fla
Section 98
//SelectedPanelCheckbox_37 (assets_fla.SelectedPanelCheckbox_37)
package assets_fla {
import flash.display.*;
public dynamic class SelectedPanelCheckbox_37 extends MovieClip {
public function SelectedPanelCheckbox_37(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets_fla
Section 99
//StatBarClip_33 (assets_fla.StatBarClip_33)
package assets_fla {
import flash.display.*;
public dynamic class StatBarClip_33 extends MovieClip {
public var upgradeBar:MovieClip;
public var currentBar:MovieClip;
}
}//package assets_fla
Section 100
//UpgradePanelOptionsAvailable_45 (assets_fla.UpgradePanelOptionsAvailable_45)
package assets_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradePanelOptionsAvailable_45 extends MovieClip {
public var txt:TextField;
}
}//package assets_fla
Section 101
//UpgradePanelOptionsOver_46 (assets_fla.UpgradePanelOptionsOver_46)
package assets_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradePanelOptionsOver_46 extends MovieClip {
public var txt:TextField;
}
}//package assets_fla
Section 102
//UpgradePanelOptionsUnavailable_43 (assets_fla.UpgradePanelOptionsUnavailable_43)
package assets_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradePanelOptionsUnavailable_43 extends MovieClip {
public var txt:TextField;
}
}//package assets_fla
Section 103
//UpgradePanelOptionsUsed_44 (assets_fla.UpgradePanelOptionsUsed_44)
package assets_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradePanelOptionsUsed_44 extends MovieClip {
public var txt:TextField;
}
}//package assets_fla
Section 104
//UpgradeTooltip_47 (assets_fla.UpgradeTooltip_47)
package assets_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradeTooltip_47 extends MovieClip {
public var title_txt:TextField;
public var info:MovieClip;
}
}//package assets_fla
Section 105
//UpgradeTooltipInfo_48 (assets_fla.UpgradeTooltipInfo_48)
package assets_fla {
import flash.display.*;
public dynamic class UpgradeTooltipInfo_48 extends MovieClip {
public function UpgradeTooltipInfo_48(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package assets_fla
Section 106
//WaveProgressBar_9 (assets_fla.WaveProgressBar_9)
package assets_fla {
import flash.display.*;
public dynamic class WaveProgressBar_9 extends MovieClip {
public var minMask:MovieClip;
public var maxMask:MovieClip;
}
}//package assets_fla
Section 107
//xplode1_83 (assets_fla.xplode1_83)
package assets_fla {
import flash.display.*;
public dynamic class xplode1_83 extends MovieClip {
public function xplode1_83(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package assets_fla
Section 108
//xplode2_79 (assets_fla.xplode2_79)
package assets_fla {
import flash.display.*;
public dynamic class xplode2_79 extends MovieClip {
public function xplode2_79(){
addFrameScript(18, frame19);
}
function frame19(){
stop();
}
}
}//package assets_fla
Section 109
//common_21 (assets_ui_fla.common_21)
package assets_ui_fla {
import flash.display.*;
import flash.text.*;
public dynamic class common_21 extends MovieClip {
public var bestScoreText:TextField;
}
}//package assets_ui_fla
Section 110
//common_22 (assets_ui_fla.common_22)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_22 extends MovieClip {
public function common_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets_ui_fla
Section 111
//common_28 (assets_ui_fla.common_28)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_28 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 112
//common_35 (assets_ui_fla.common_35)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_35 extends MovieClip {
public function common_35(){
addFrameScript(91, frame92);
}
function frame92(){
stop();
gotoAndPlay("loop");
}
}
}//package assets_ui_fla
Section 113
//common_41 (assets_ui_fla.common_41)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_41 extends MovieClip {
public function common_41(){
addFrameScript(37, frame38);
}
function frame38(){
stop();
}
}
}//package assets_ui_fla
Section 114
//common_50 (assets_ui_fla.common_50)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_50 extends MovieClip {
public var miniTrailer:MovieClip;
public var findOutMore:MovieClip;
public var viewTrailer:MovieClip;
}
}//package assets_ui_fla
Section 115
//common_54 (assets_ui_fla.common_54)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_54 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 116
//common_55 (assets_ui_fla.common_55)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_55 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 117
//common_56 (assets_ui_fla.common_56)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_56 extends MovieClip {
public var panel:MovieClip;
public var ui_bottom_frame:MovieClip;
public var ui_mid:MovieClip;
public var ui_top_frame1:MovieClip;
public var ui_hor_bar2:MovieClip;
public var ui_hor_bar3:MovieClip;
public var ui_hor_bar1:MovieClip;
public var ui_top:MovieClip;
public var ui_hor_bar4:MovieClip;
public var ui_bottom_hud:MovieClip;
public var ui_top_half:MovieClip;
public var masker:MovieClip;
public var ui_side_right_1:MovieClip;
public var footer:MovieClip;
public var ui_side_left_1:MovieClip;
public var slider_masker:MovieClip;
public function common_56(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets_ui_fla
Section 118
//common_57 (assets_ui_fla.common_57)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_57 extends MovieClip {
public var termsButton:SimpleButton;
}
}//package assets_ui_fla
Section 119
//common_58 (assets_ui_fla.common_58)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_58 extends MovieClip {
public function common_58(){
addFrameScript(43, frame44);
}
function frame44(){
stop();
}
}
}//package assets_ui_fla
Section 120
//common_60 (assets_ui_fla.common_60)
package assets_ui_fla {
import flash.display.*;
public dynamic class common_60 extends MovieClip {
public function common_60(){
addFrameScript(33, frame34);
}
function frame34(){
stop();
}
}
}//package assets_ui_fla
Section 121
//Comp2_40 (assets_ui_fla.Comp2_40)
package assets_ui_fla {
import flash.display.*;
public dynamic class Comp2_40 extends MovieClip {
public function Comp2_40(){
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package assets_ui_fla
Section 122
//form_13 (assets_ui_fla.form_13)
package assets_ui_fla {
import flash.display.*;
public dynamic class form_13 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 123
//form_14 (assets_ui_fla.form_14)
package assets_ui_fla {
import flash.display.*;
public dynamic class form_14 extends MovieClip {
public function form_14(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package assets_ui_fla
Section 124
//form_15 (assets_ui_fla.form_15)
package assets_ui_fla {
import flash.display.*;
public dynamic class form_15 extends MovieClip {
public function form_15(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package assets_ui_fla
Section 125
//form_3 (assets_ui_fla.form_3)
package assets_ui_fla {
import flash.display.*;
public dynamic class form_3 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 126
//form_5 (assets_ui_fla.form_5)
package assets_ui_fla {
import flash.display.*;
public dynamic class form_5 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 127
//form_6 (assets_ui_fla.form_6)
package assets_ui_fla {
import flash.display.*;
public dynamic class form_6 extends MovieClip {
public var quizText:MovieClip;
public var opt1:MovieClip;
public var opt3:MovieClip;
public var opt4:MovieClip;
public var opt2:MovieClip;
}
}//package assets_ui_fla
Section 128
//HighScore_75 (assets_ui_fla.HighScore_75)
package assets_ui_fla {
import flash.display.*;
public dynamic class HighScore_75 extends MovieClip {
public var userScoreBg:MovieClip;
public var header:TableHeader;
}
}//package assets_ui_fla
Section 129
//intro_84 (assets_ui_fla.intro_84)
package assets_ui_fla {
import flash.events.*;
import flash.display.*;
public dynamic class intro_84 extends MovieClip {
public function intro_84(){
addFrameScript(946, frame947, 960, frame961);
}
function frame961(){
stop();
}
function frame947(){
dispatchEvent(new Event("VIDEO_FINISHED"));
}
}
}//package assets_ui_fla
Section 130
//MiddlePanel_69 (assets_ui_fla.MiddlePanel_69)
package assets_ui_fla {
import flash.display.*;
public dynamic class MiddlePanel_69 extends MovieClip {
public var btn_next:MovieClip;
public var btn_prev:MovieClip;
public var mhs:MovieClip;
public var lhs:MovieClip;
public var btn_main:MovieClip;
public var rhs:MovieClip;
public function MiddlePanel_69(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package assets_ui_fla
Section 131
//midpanel_main_button_70 (assets_ui_fla.midpanel_main_button_70)
package assets_ui_fla {
import flash.display.*;
public dynamic class midpanel_main_button_70 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 132
//nav_embed_49 (assets_ui_fla.nav_embed_49)
package assets_ui_fla {
import flash.display.*;
public dynamic class nav_embed_49 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 133
//nav_howto_45 (assets_ui_fla.nav_howto_45)
package assets_ui_fla {
import flash.display.*;
public dynamic class nav_howto_45 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 134
//nav_play_44 (assets_ui_fla.nav_play_44)
package assets_ui_fla {
import flash.display.*;
public dynamic class nav_play_44 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 135
//nav_prizes_48 (assets_ui_fla.nav_prizes_48)
package assets_ui_fla {
import flash.display.*;
public dynamic class nav_prizes_48 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 136
//nav_score_46 (assets_ui_fla.nav_score_46)
package assets_ui_fla {
import flash.display.*;
public dynamic class nav_score_46 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 137
//nav_send_47 (assets_ui_fla.nav_send_47)
package assets_ui_fla {
import flash.display.*;
public dynamic class nav_send_47 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 138
//preloader_91 (assets_ui_fla.preloader_91)
package assets_ui_fla {
import flash.display.*;
public dynamic class preloader_91 extends MovieClip {
public var hex0:MovieClip;
public var hex1:MovieClip;
public var hex2:MovieClip;
public var hex6:MovieClip;
public var hex12:MovieClip;
public var hex15:MovieClip;
public var hex19:MovieClip;
public var hex13:MovieClip;
public var hex3:MovieClip;
public var hex11:MovieClip;
public var hex17:MovieClip;
public var hex4:MovieClip;
public var hex8:MovieClip;
public var hex16:MovieClip;
public var hex20:MovieClip;
public var hex21:MovieClip;
public var hex5:MovieClip;
public var hex7:MovieClip;
public var hex18:MovieClip;
public var hex22:MovieClip;
public var hex14:MovieClip;
public var hex23:MovieClip;
public var hex10:MovieClip;
public var hex9:MovieClip;
}
}//package assets_ui_fla
Section 139
//prizes_94 (assets_ui_fla.prizes_94)
package assets_ui_fla {
import flash.display.*;
public dynamic class prizes_94 extends MovieClip {
public var backBtn:MovieClip;
public var secondPage:MovieClip;
public var firstPage:MovieClip;
public var termsBtn:MovieClip;
public var thirdPage:MovieClip;
}
}//package assets_ui_fla
Section 140
//prizes_95 (assets_ui_fla.prizes_95)
package assets_ui_fla {
import flash.display.*;
public dynamic class prizes_95 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 141
//prizes_96 (assets_ui_fla.prizes_96)
package assets_ui_fla {
import flash.display.*;
public dynamic class prizes_96 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 142
//prizes_97 (assets_ui_fla.prizes_97)
package assets_ui_fla {
import flash.display.*;
public dynamic class prizes_97 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 143
//prizes_98 (assets_ui_fla.prizes_98)
package assets_ui_fla {
import flash.display.*;
public dynamic class prizes_98 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 144
//prizes_99 (assets_ui_fla.prizes_99)
package assets_ui_fla {
import flash.display.*;
public dynamic class prizes_99 extends MovieClip {
public var nav_glow:NavGlow;
}
}//package assets_ui_fla
Section 145
//sliders_62 (assets_ui_fla.sliders_62)
package assets_ui_fla {
import flash.display.*;
public dynamic class sliders_62 extends MovieClip {
public var slider1:MovieClip;
public var slider2:MovieClip;
}
}//package assets_ui_fla
Section 146
//Timeline_11 (assets_ui_fla.Timeline_11)
package assets_ui_fla {
import flash.display.*;
public dynamic class Timeline_11 extends MovieClip {
public var termsButton:SimpleButton;
public var t_name_bg:MovieClip;
}
}//package assets_ui_fla
Section 147
//TitleNav_43 (assets_ui_fla.TitleNav_43)
package assets_ui_fla {
import flash.display.*;
public dynamic class TitleNav_43 extends MovieClip {
public var btn_prizes:MovieClip;
public var btn_embed:MovieClip;
public var btn_play:MovieClip;
public var btn_howto:MovieClip;
public var btn_send:MovieClip;
public var btn_score:MovieClip;
}
}//package assets_ui_fla
Section 148
//UI_77 (assets_ui_fla.UI_77)
package assets_ui_fla {
import flash.display.*;
public dynamic class UI_77 extends MovieClip {
public var headertxt:MovieClip;
public function UI_77(){
addFrameScript(40, frame41);
}
function frame41(){
stop();
}
}
}//package assets_ui_fla
Section 149
//UI_78 (assets_ui_fla.UI_78)
package assets_ui_fla {
import flash.display.*;
public dynamic class UI_78 extends MovieClip {
public var masker:MovieClip;
public function UI_78(){
addFrameScript(39, frame40);
}
function frame40(){
stop();
}
}
}//package assets_ui_fla
Section 150
//UI_79 (assets_ui_fla.UI_79)
package assets_ui_fla {
import flash.display.*;
import flash.text.*;
public dynamic class UI_79 extends MovieClip {
public var txt:TextField;
}
}//package assets_ui_fla
Section 151
//ui4_25 (assets_ui_fla.ui4_25)
package assets_ui_fla {
import flash.display.*;
public dynamic class ui4_25 extends MovieClip {
public var moreGamesBtn:MovieClip;
}
}//package assets_ui_fla
Section 152
//ui9_20 (assets_ui_fla.ui9_20)
package assets_ui_fla {
import flash.display.*;
public dynamic class ui9_20 extends MovieClip {
public var bestScore:MovieClip;
public var soundControl:MovieClip;
}
}//package assets_ui_fla
Section 153
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){
_empty = _arg1;
_new = _arg2;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function isEmpty():Boolean{
return (_empty);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
_local1.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
_local1.utmcr = utmcr;
};
return (_local1);
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 154
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
}
}//package com.google.analytics.campaign
Section 155
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_domainHash = _arg4;
_referrer = _arg5;
_timeStamp = _arg6;
}
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{
var _local4:CampaignTracker;
var _local8:CampaignTracker;
var _local9:int;
var _local3:CampaignInfo = new CampaignInfo();
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (_local3);
};
};
_local4 = getTrackerFromSearchString(_arg1);
if (isValid(_local4)){
_local6 = hasNoOverride(_arg1);
if (((_local6) && (!(_buffer.hasUTMZ())))){
return (_local3);
};
};
if (!isValid(_local4)){
_local4 = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){
return (_local3);
};
};
if (((!(isValid(_local4))) && (_arg2))){
_local4 = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){
return (_local3);
};
};
if (!isValid(_local4)){
if (((!(_buffer.hasUTMZ())) && (_arg2))){
_local4 = getDirectCampaign();
};
};
if (!isValid(_local4)){
return (_local3);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
_local8 = new CampaignTracker();
_local8.fromTrackerString(_buffer.utmz.campaignTracking);
_local5 = (_local8.toTrackerString() == _local4.toTrackerString());
_local7 = _buffer.utmz.responseCount;
};
if (((!(_local5)) || (_arg2))){
_local9 = _buffer.utma.sessionCount;
_local7++;
if (_local9 == 0){
_local9 = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = _local9;
_buffer.utmz.responseCount = _local7;
_buffer.utmz.campaignTracking = _local4.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
_local3 = new CampaignInfo(false, true);
} else {
_local3 = new CampaignInfo(false, false);
};
return (_local3);
}
public function hasNoOverride(_arg1:String):Boolean{
var _local2:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (false);
};
var _local3:Variables = new Variables(_arg1);
var _local4 = "";
if (_local3.hasOwnProperty(_local2.UCNO)){
_local4 = _local3[_local2.UCNO];
switch (_local4){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{
var _local2:CampaignTracker = getOrganicCampaign();
var _local3:CampaignTracker = new CampaignTracker();
var _local4:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (_local3);
};
var _local5:Variables = new Variables(_arg1);
if (_local5.hasOwnProperty(_local4.UCID)){
_local3.id = _local5[_local4.UCID];
};
if (_local5.hasOwnProperty(_local4.UCSR)){
_local3.source = _local5[_local4.UCSR];
};
if (_local5.hasOwnProperty(_local4.UGCLID)){
_local3.clickId = _local5[_local4.UGCLID];
};
if (_local5.hasOwnProperty(_local4.UCCN)){
_local3.name = _local5[_local4.UCCN];
} else {
_local3.name = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCMD)){
_local3.medium = _local5[_local4.UCMD];
} else {
_local3.medium = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCTR)){
_local3.term = _local5[_local4.UCTR];
} else {
if (((_local2) && (!((_local2.term == ""))))){
_local3.term = _local2.term;
};
};
if (_local5.hasOwnProperty(_local4.UCCT)){
_local3.content = _local5[_local4.UCCT];
};
return (_local3);
}
public function getOrganicCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local4:Array;
var _local5:OrganicReferrer;
var _local6:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3 = "";
if (_local2.hostName != ""){
if (_local2.hostName.indexOf(".") > -1){
_local4 = _local2.hostName.split(".");
switch (_local4.length){
case 2:
_local3 = _local4[0];
break;
case 3:
_local3 = _local4[1];
break;
};
};
};
if (_config.organic.match(_local3)){
_local5 = _config.organic.getReferrerByName(_local3);
_local6 = _config.organic.getKeywordValue(_local5, _local2.search);
_local1 = new CampaignTracker();
_local1.source = _local5.engine;
_local1.name = "(organic)";
_local1.medium = "organic";
_local1.term = _local6;
};
return (_local1);
}
public function getDirectCampaign():CampaignTracker{
var _local1:CampaignTracker = new CampaignTracker();
_local1.source = "(direct)";
_local1.name = "(direct)";
_local1.medium = "(none)";
return (_local1);
}
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(_arg1.term));
};
return (false);
}
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "referral")))){
return (_config.organic.isIgnoredReferral(_arg1.source));
};
return (false);
}
public function isValid(_arg1:CampaignTracker):Boolean{
if (((_arg1) && (_arg1.isValid()))){
return (true);
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var _local1:CampaignTracker;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3:String = _local2.hostName;
var _local4:String = _local2.path;
if (_local3.indexOf("www.") == 0){
_local3 = _local3.substr(4);
};
_local1 = new CampaignTracker();
_local1.source = _local3;
_local1.name = "(referral)";
_local1.medium = "referral";
_local1.content = _local4;
return (_local1);
}
public static function isInvalidReferrer(_arg1:String):Boolean{
var _local2:URL;
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){
return (true);
};
if (_arg1.indexOf("://") > -1){
_local2 = new URL(_arg1);
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{
var _local3:URL = new URL(_arg1);
if (_local3.hostName.indexOf(_arg2.google) > -1){
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){
if (_local3.path == ("/" + _arg2.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 156
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:String="", _arg5:String="", _arg6:String="", _arg7:String=""){
this.id = _arg1;
this.source = _arg2;
this.clickId = _arg3;
this.name = _arg4;
this.medium = _arg5;
this.term = _arg6;
this.content = _arg7;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var _local1:Array = [];
_addIfNotEmpty(_local1, "utmcid=", id);
_addIfNotEmpty(_local1, "utmcsr=", source);
_addIfNotEmpty(_local1, "utmgclid=", clickId);
_addIfNotEmpty(_local1, "utmccn=", name);
_addIfNotEmpty(_local1, "utmcmd=", medium);
_addIfNotEmpty(_local1, "utmctr=", term);
_addIfNotEmpty(_local1, "utmcct=", content);
return (_local1.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(_arg1:Array, _arg2:String, _arg3:String):void{
if (_arg3 != ""){
_arg3 = _arg3.split("+").join("%20");
_arg3 = _arg3.split(" ").join("%20");
_arg1.push((_arg2 + _arg3));
};
}
public function fromTrackerString(_arg1:String):void{
var _local2:String = _arg1.split(CampaignManager.trackingDelimiter).join("&");
var _local3:Variables = new Variables(_local2);
if (_local3.hasOwnProperty("utmcid")){
this.id = _local3["utmcid"];
};
if (_local3.hasOwnProperty("utmcsr")){
this.source = _local3["utmcsr"];
};
if (_local3.hasOwnProperty("utmccn")){
this.name = _local3["utmccn"];
};
if (_local3.hasOwnProperty("utmcmd")){
this.medium = _local3["utmcmd"];
};
if (_local3.hasOwnProperty("utmctr")){
this.term = _local3["utmctr"];
};
if (_local3.hasOwnProperty("utmcct")){
this.content = _local3["utmcct"];
};
if (_local3.hasOwnProperty("utmgclid")){
this.clickId = _local3["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 157
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){
_config = _arg1;
_info = _arg2;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmfl():String{
var _local1:Version;
if (_config.detectFlash){
_local1 = _info.flashVersion;
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build));
};
return ("-");
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmcs = utmcs;
_local1.utmsr = utmsr;
_local1.utmsc = utmsc;
_local1.utmul = utmul;
_local1.utmje = utmje;
_local1.utmfl = utmfl;
return (_local1);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 158
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _data:Object;
private var _OBJ:Object;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _utma:UTMA;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmx:UTMX;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Boolean=false, _arg4:Object=null){
var _local5:String;
super();
_config = _arg1;
_debug = _arg2;
_data = _arg4;
_volatile = _arg3;
if (_volatile){
_OBJ = new Object();
if (_data){
for (_local5 in _data) {
_OBJ[_local5] = _data[_local5];
};
};
};
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
try {
flushStatus = _SO.flush();
} catch(e:Error) {
_debug.warning("Error...Could not write SharedObject to disk");
};
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmx():UTMX{
if (!hasUTMX()){
_createUMTX();
};
return (_utmx);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
var _local3:String = toLinkerParams();
var _local4:String = _arg1;
var _local5:Array = _arg1.split("#");
if (_local3){
if (_arg2){
if (1 >= _local5.length){
_local4 = (_local4 + ("#" + _local3));
} else {
_local4 = (_local4 + ("&" + _local3));
};
} else {
if (1 >= _local5.length){
if (_arg1.indexOf("?") > -1){
_local4 = (_local4 + "&");
} else {
_local4 = (_local4 + "?");
};
_local4 = (_local4 + _local3);
} else {
_local4 = _local5[0];
if (_arg1.indexOf("?") > -1){
_local4 = (_local4 + "&");
} else {
_local4 = (_local4 + "?");
};
_local4 = (_local4 + ((_local3 + "#") + _local5[1]));
};
};
};
return (_local4);
}
public function generateCookiesHash():Number{
var _local1 = "";
_local1 = (_local1 + utma.valueOf());
_local1 = (_local1 + utmb.valueOf());
_local1 = (_local1 + utmc.valueOf());
_local1 = (_local1 + utmx.valueOf());
_local1 = (_local1 + utmz.valueOf());
_local1 = (_local1 + utmv.valueOf());
return (Utils.generateHash(_local1));
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMX():Boolean{
if (_utmx){
return (true);
};
return (false);
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _createUMTX():void{
_utmx = new UTMX();
_utmx.proxy = this;
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(_arg1:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + _arg1) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = _arg1;
};
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
private function _onFlushStatus(_arg1:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
public function toLinkerParams():String{
var _local1 = "";
_local1 = (_local1 + utma.toURLString());
_local1 = (_local1 + ("&" + utmb.toURLString()));
_local1 = (_local1 + ("&" + utmc.toURLString()));
_local1 = (_local1 + ("&" + utmx.toURLString()));
_local1 = (_local1 + ("&" + utmz.toURLString()));
_local1 = (_local1 + ("&" + utmv.toURLString()));
_local1 = (_local1 + ("&__utmk=" + generateCookiesHash()));
return (_local1);
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(_arg1:String, _arg2):void{
if (isVolatile()){
_OBJ[_arg1] = _arg2;
} else {
_SO.data[_arg1] = _arg2;
};
}
public function createSO():void{
var saveSO:Boolean;
UTMZ.defaultTimespan = _config.conversionTimeout;
UTMB.defaultTimespan = _config.sessionTimeout;
if (!_volatile){
try {
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
} catch(e:Error) {
if (_debug.active){
_debug.warning(((("Shared Object " + _config.cookieName) + " failed to be set\nreason: ") + e.message));
};
};
saveSO = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
saveSO = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
saveSO = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
saveSO = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (!hasUTMX()){
_createUMTX();
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
saveSO = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
saveSO = true;
};
};
if (saveSO){
save();
};
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 159
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
public class DocumentInfo {
private var _pageURL:String;
private var _utmr:String;
private var _config:Configuration;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){
_config = _arg1;
_info = _arg2;
_utmr = _arg3;
_pageURL = _arg4;
_adSense = _arg5;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
private function _renderPageURL(_arg1:String=""):String{
var _local2:String = _info.locationPath;
var _local3:String = _info.locationSearch;
if (((!(_arg1)) || ((_arg1 == "")))){
_arg1 = (_local2 + unescape(_local3));
if (_arg1 == ""){
_arg1 = "/";
};
};
return (_arg1);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
public function get utmhid():String{
return (String(_generateHitId()));
}
private function _generateHitId():Number{
var _local1:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
_local1 = Number(_adSense.hid);
} else {
_local1 = Math.round((Math.random() * 2147483647));
_adSense.hid = String(_local1);
};
return (_local1);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
_local1.utmdt = utmdt;
};
_local1.utmhid = utmhid;
_local1.utmr = utmr;
_local1.utmp = utmp;
return (_local1);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 160
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(_arg1:DomainNameMode=null, _arg2:String="", _arg3:DebugConfiguration=null){
_debug = _arg3;
if (_arg1 == null){
_arg1 = DomainNameMode.auto;
};
_mode = _arg1;
if (_arg1 == DomainNameMode.custom){
this.name = _arg2;
} else {
_name = _arg2;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(_arg1:DomainNameMode):void{
_mode = _arg1;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(_arg1:String):void{
if (((!((_arg1.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + _arg1), VisualDebugMode.geek);
};
_name = _arg1;
}
}
}//package com.google.analytics.core
Section 161
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 162
//Ecommerce (com.google.analytics.core.Ecommerce)
package com.google.analytics.core {
import com.google.analytics.debug.*;
import com.google.analytics.ecommerce.*;
public class Ecommerce {
private var _debug:DebugConfiguration;
private var _trans:Array;
public function Ecommerce(_arg1:DebugConfiguration){
this._debug = _arg1;
_trans = new Array();
}
public function getTransLength():Number{
return (_trans.length);
}
public function getTransFromArray(_arg1:Number):Transaction{
return (_trans[_arg1]);
}
public function addTransaction(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String, _arg8:String):Transaction{
var _local9:Transaction;
_local9 = getTransaction(_arg1);
if (_local9 == null){
_local9 = new Transaction(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
_trans.push(_local9);
} else {
_local9.affiliation = _arg2;
_local9.total = _arg3;
_local9.tax = _arg4;
_local9.shipping = _arg5;
_local9.city = _arg6;
_local9.state = _arg7;
_local9.country = _arg8;
};
return (_local9);
}
public function getTransaction(_arg1:String):Transaction{
var _local2:Number;
_local2 = 0;
while (_local2 < _trans.length) {
if (_trans[_local2].id == _arg1){
return (_trans[_local2]);
};
_local2++;
};
return (null);
}
}
}//package com.google.analytics.core
Section 163
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.data.*;
import com.google.analytics.utils.*;
public class EventInfo {
private var _ext10:X10;
private var _isEventHit:Boolean;
private var _x10:X10;
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){
_isEventHit = _arg1;
_x10 = _arg2;
_ext10 = _arg3;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (_isEventHit){
_local1.utmt = utmt;
};
_local1.utme = utme;
return (_local1);
}
}
}//package com.google.analytics.core
Section 164
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){
this.name = _arg1;
_parent = _arg2;
}
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{
return (_parent.trackEvent(name, _arg1, _arg2, _arg3));
}
}
}//package com.google.analytics.core
Section 165
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 166
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.utils.*;
import flash.system.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Environment){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_info = _arg4;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(_arg1:IOErrorEvent):void{
var _local2:String = _lastRequest.url;
var _local3:String = String((_requests.length - 1));
var _local4 = (("Gif Request #" + _local3) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local2.indexOf("?") > -1){
_local2 = _local2.split("?")[0];
};
_local2 = _shortenURL(_local2);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local4 = (_local4 + ((" \"" + _local2) + "\" does not exists or is unreachable"));
};
_debug.failure(_local4);
} else {
_debug.warning(_local4);
};
_removeListeners(_arg1.target);
}
public function send(_arg1:String, _arg2:Variables=null, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:String;
var _local6:URLRequest;
var _local7:URLRequest;
_utmac = _arg1;
if (!_arg2){
_arg2 = new Variables();
};
_arg2.URIencode = false;
_arg2.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
_arg2.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (_arg3))){
if (_arg4){
updateToken();
};
if (((((_arg3) || (!(_arg4)))) || ((_buffer.utmb.token >= 1)))){
if (((!(_arg3)) && (_arg4))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
_arg2.utmwv = utmwv;
_arg2.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
_arg2.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
_arg2.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
_local5 = _info.locationSWFPath;
if (_local5.lastIndexOf("/") > 0){
_local5 = _local5.substring(0, _local5.lastIndexOf("/"));
};
_local6 = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
_local6.url = _config.localGIFpath;
} else {
_local6.url = (_local5 + _config.localGIFpath);
};
_local6.url = (_local6.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local6);
} else {
sendRequest(_local6);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
_local7 = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
_local7.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
_local7.url = _config.remoteGIFpath;
} else {
_local7.url = _config.remoteGIFpath;
};
};
_arg2.utmac = utmac;
_arg2.utmcc = encodeURIComponent(utmcc);
_local7.url = (_local7.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local7);
} else {
sendRequest(_local7);
};
};
};
};
}
public function onSecurityError(_arg1:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(_arg1.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var _local1:Array = [];
if (_buffer.hasUTMA()){
_local1.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
_local1.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
_local1.push((_buffer.utmv.toURLString() + ";"));
};
return (_local1.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(_arg1:URLRequest):void{
var request = _arg1;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
try {
loader.load(request, context);
} catch(e:Error) {
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
};
}
private function _removeListeners(_arg1:Object):void{
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
_arg1.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var _local2:Number;
var _local1:Number = new Date().getTime();
_local2 = ((_local1 - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + _local2), VisualDebugMode.geek);
};
if (_local2 >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + _local2)), _config.bucketCapacity);
_buffer.utmb.lastTime = _local1;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(_arg1:String):String{
var _local2:Array;
if (_arg1.length > 60){
_local2 = _arg1.split("/");
while (_arg1.length > 60) {
_local2.shift();
_arg1 = ("../" + _local2.join("/"));
};
};
return (_arg1);
}
private function _debugSend(_arg1:URLRequest):void{
var _local3:String;
var _local2 = "";
switch (_debug.mode){
case VisualDebugMode.geek:
_local2 = ((("Gif Request #" + _alertcount) + ":\n") + _arg1.url);
break;
case VisualDebugMode.advanced:
_local3 = _arg1.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
_local2 = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
_local2 = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(_local2, _arg1, this);
_alertcount++;
}
public function onComplete(_arg1:Event):void{
var _local2:String = _arg1.target.loader.name;
_requests[_local2].complete();
var _local3 = (("Gif Request #" + _local2) + " sent");
var _local4:String = _requests[_local2].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local4.indexOf("?") > -1){
_local4 = _local4.split("?")[0];
};
_local4 = _shortenURL(_local4);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local3 = (_local3 + ((" to \"" + _local4) + "\""));
};
_debug.success(_local3);
} else {
_debug.info(_local3);
};
_removeListeners(_arg1.target);
}
}
}//package com.google.analytics.core
Section 167
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public class IdleTimer {
private var _stage:Stage;
private var _loop:Timer;
private var _lastMove:int;
private var _inactivity:Number;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _buffer:Buffer;
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){
var _local5:Number = _arg1.idleLoop;
var _local6:Number = _arg1.idleTimeout;
var _local7:Number = _arg1.sessionTimeout;
_loop = new Timer((_local5 * 1000));
_session = new Timer((_local7 * 1000), 1);
_debug = _arg2;
_stage = _arg3.stage;
_buffer = _arg4;
_lastMove = getTimer();
_inactivity = (_local6 * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(_arg1:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(_arg1:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(_arg1:TimerEvent):void{
var _local2:int = getTimer();
if ((_local2 - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 168
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function isIgnoredKeyword(_arg1:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{
var _local3:String = _arg1.keyword;
return (getKeywordValueFromPath(_local3, _arg2));
}
public function isIgnoredReferral(_arg1:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get count():int{
return (_sources.length);
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(_arg1:String):Boolean{
if (_arg1 == ""){
return (false);
};
_arg1 = _arg1.toLowerCase();
if (_sourcesEngine[_arg1] != undefined){
return (true);
};
return (false);
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function addSource(_arg1:String, _arg2:String):void{
var _local3:OrganicReferrer = new OrganicReferrer(_arg1, _arg2);
if (_sourcesCache[_local3.toString()] == undefined){
_sources.push(_local3);
_sourcesCache[_local3.toString()] = (_sources.length - 1);
if (_sourcesEngine[_local3.engine] == undefined){
_sourcesEngine[_local3.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[_local3.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((_local3.toString() + " already exists, we don't add it.")));
};
};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(_arg1:String):void{
if (_ignoredReferralsCache[_arg1] == undefined){
_ignoredReferrals.push(_arg1);
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(_arg1:String):OrganicReferrer{
var _local2:int;
if (match(_arg1)){
_local2 = _sourcesEngine[_arg1][0];
return (_sources[_local2]);
};
return (null);
}
public function addIgnoredKeyword(_arg1:String):void{
if (_ignoredKeywordsCache[_arg1] == undefined){
_ignoredKeywords.push(_arg1);
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Variables;
if (_arg2.indexOf((_arg1 + "=")) > -1){
if (_arg2.charAt(0) == "?"){
_arg2 = _arg2.substr(1);
};
_arg2 = _arg2.split("+").join("%20");
_local4 = new Variables(_arg2);
_local3 = _local4[_arg1];
};
return (_local3);
}
}
}//package com.google.analytics.core
Section 169
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(_arg1:String, _arg2:String){
this.engine = _arg1;
this.keyword = _arg2;
}
public function get keyword():String{
return (_keyword);
}
public function get engine():String{
return (_engine);
}
public function set engine(_arg1:String):void{
_engine = _arg1.toLowerCase();
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function set keyword(_arg1:String):void{
_keyword = _arg1.toLowerCase();
}
}
}//package com.google.analytics.core
Section 170
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.utils.*;
import flash.net.*;
public class RequestObject {
public var start:int;
public var end:int;
public var request:URLRequest;
public function RequestObject(_arg1:URLRequest){
start = getTimer();
this.request = _arg1;
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function toString():String{
var _local1:Array = [];
_local1.push((("duration: " + duration) + "ms"));
_local1.push(("url: " + request.url));
return ((("{ " + _local1.join(", ")) + " }"));
}
public function complete():void{
end = getTimer();
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
}
}//package com.google.analytics.core
Section 171
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 172
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(_arg1:GoogleAnalyticsAPI=null){
this.tracker = _arg1;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:int;
if (tracker == null){
return;
};
if (size() > 0){
_local4 = _ar.length;
while (_local5 < _local4) {
_local1 = _ar.shift();
_local2 = (_local1.name as String);
_local3 = (_local1.args as Array);
if (((!((_local2 == null))) && ((_local2 in tracker)))){
(tracker[_local2] as Function).apply(tracker, _local3);
};
_local5++;
};
};
}
public function enqueue(_arg1:String, ... _args):Boolean{
if (_arg1 == null){
return (false);
};
_ar.push({name:_arg1, args:_args});
return (true);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
enqueue("link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
enqueue("addOrganic", _arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
enqueue("setAllowLinker", _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
enqueue("trackEvent", _arg1, _arg2, _arg3, _arg4);
return (true);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLinkerUrl' method for the moment."));
};
return ("");
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(_arg1:String=""):void{
enqueue("trackPageview", _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
enqueue("setClientInfo", _arg1);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
enqueue("linkByPost", _arg1, _arg2);
}
public function setCookieTimeout(_arg1:int):void{
enqueue("setCookieTimeout", _arg1);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(_arg1:Boolean):void{
enqueue("setDetectFlash", _arg1);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(_arg1:String):void{
enqueue("setCampNameKey", _arg1);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
enqueue("addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function createEventTracker(_arg1:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setVar(_arg1:String):void{
enqueue("setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
enqueue("setDomainName", _arg1);
}
public function setCampSourceKey(_arg1:String):void{
enqueue("setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
}
public function setCampContentKey(_arg1:String):void{
enqueue("setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(_arg1:Boolean):void{
enqueue("setAllowAnchor", _arg1);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(_arg1:String):void{
enqueue("setLocalGifPath", _arg1);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(_arg1:String):void{
enqueue("setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
enqueue("setSampleRate", _arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
enqueue("setDetectTitle", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
enqueue("setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
enqueue("addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
enqueue("setCampNOKey", _arg1);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(_arg1:String):void{
enqueue("cookiePathCopy", _arg1);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(_arg1:Boolean):void{
enqueue("setCampaignTrack", _arg1);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
enqueue("setCampTermKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
enqueue("addIgnoredRef", _arg1);
}
public function setCampMediumKey(_arg1:String):void{
enqueue("setCampMediumKey", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
enqueue("setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 173
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
}
}//package com.google.analytics.core
Section 174
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public static function trim(_arg1:String, _arg2:Boolean=false):String{
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg1 == ""){
return ("");
};
var _local3:Array = [" ", "\n", "\r", "\t"];
var _local4:String = _arg1;
if (_arg2){
_local5 = 0;
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) {
_local4 = _local4.split(_local3[_local5]).join("");
_local5++;
};
} else {
_local6 = 0;
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) {
_local6++;
};
_local4 = _local4.substr(_local6);
_local7 = (_local4.length - 1);
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) {
_local7--;
};
_local4 = _local4.substring(0, (_local7 + 1));
};
return (_local4);
}
public static function generateHash(_arg1:String):int{
var _local4:int;
var _local5:int;
var _local2 = 1;
var _local3:int;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
_local2 = 0;
_local4 = (_arg1.length - 1);
while (_local4 >= 0) {
_local5 = _arg1.charCodeAt(_local4);
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14));
_local3 = (_local2 & 266338304);
if (_local3 != 0){
_local2 = (_local2 ^ (_local3 >> 21));
};
_local4--;
};
};
return (_local2);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(_arg1:String):Boolean{
var _local2:RegExp = /^UA-[0-9]*-[0-9]*$/;
return (_local2.test(_arg1));
}
}
}//package com.google.analytics.core
Section 175
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(_arg1:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(_arg1:Date):void;
function set expiration(_arg1:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 176
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.sessionId = _arg2;
this.firstTime = _arg3;
this.lastTime = _arg4;
this.currentTime = _arg5;
this.sessionCount = _arg6;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function set currentTime(_arg1:Number):void{
_currentTime = _arg1;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set sessionId(_arg1:Number):void{
_sessionId = _arg1;
update();
}
public function set sessionCount(_arg1:Number):void{
_sessionCount = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(_arg1:Number):void{
_firstTime = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 177
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.trackCount = _arg2;
this.token = _arg3;
this.lastTime = _arg4;
}
public function set token(_arg1:Number):void{
_token = _arg1;
update();
}
public function set trackCount(_arg1:Number):void{
_trackCount = _arg1;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 178
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(_arg1:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = _arg1;
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 179
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
protected var fields:Array;
private var _timespan:Number;
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){
this.name = _arg1;
this.inURL = _arg2;
this.fields = _arg3;
_timestamp(_arg4);
}
public function isEmpty():Boolean{
var _local2:String;
var _local1:int;
var _local3:int;
while (_local3 < fields.length) {
_local2 = fields[_local3];
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){
_local1++;
} else {
if ((((this[_local2] is String)) && ((this[_local2] == "")))){
_local1++;
};
};
_local3++;
};
if (_local1 == fields.length){
return (true);
};
return (false);
}
public function resetTimestamp(_arg1:Number=NaN):void{
if (!isNaN(_arg1)){
_timespan = _arg1;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function reset():void{
var _local1:String;
var _local2:int;
while (_local2 < fields.length) {
_local1 = fields[_local2];
if ((this[_local1] is Number)){
this[_local1] = NaN;
} else {
if ((this[_local1] is String)){
this[_local1] = "";
};
};
_local2++;
};
resetTimestamp();
update();
}
public function fromSharedObject(_arg1:Object):void{
var _local2:String;
var _local3:int = fields.length;
var _local4:int;
while (_local4 < _local3) {
_local2 = fields[_local4];
if (_arg1[_local2]){
this[_local2] = _arg1[_local2];
};
_local4++;
};
if (_arg1.creation){
this.creation = _arg1.creation;
};
if (_arg1.expiration){
this.expiration = _arg1.expiration;
};
}
private function _timestamp(_arg1:Number):void{
creation = new Date();
_timespan = _arg1;
if (_arg1 > 0){
expiration = new Date((creation.valueOf() + _arg1));
};
}
public function isExpired():Boolean{
var _local1:Date = new Date();
var _local2:Number = (expiration.valueOf() - _local1.valueOf());
if (_local2 <= 0){
return (true);
};
return (false);
}
public function set expiration(_arg1:Date):void{
_expiration = _arg1;
}
public function get creation():Date{
return (_creation);
}
public function valueOf():String{
var _local2:String;
var _local3:*;
var _local4:Array;
var _local1:Array = [];
var _local5 = "";
var _local6:int;
while (_local6 < fields.length) {
_local2 = fields[_local6];
_local3 = this[_local2];
if ((_local3 is String)){
if (_local3 == ""){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
} else {
if ((_local3 is Number)){
if (_local3 == 0){
_local1.push(_local3);
} else {
if (isNaN(_local3)){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
};
};
};
_local6++;
};
if (isEmpty()){
return ("-");
};
return (("" + _local1.join(".")));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toSharedObject():Object{
var _local2:String;
var _local3:*;
var _local1:Object = {};
var _local4:int;
for (;_local4 < fields.length;_local4++) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
_local1[_local2] = _local3;
} else {
if (_local3 == 0){
_local1[_local2] = _local3;
} else {
if (isNaN(_local3)){
continue;
} else {
_local1[_local2] = _local3;
};
};
};
};
_local1.creation = creation;
_local1.expiration = expiration;
return (_local1);
}
public function toString(_arg1:Boolean=false):String{
var _local3:String;
var _local4:*;
var _local2:Array = [];
var _local5:int = fields.length;
var _local6:int;
for (;_local6 < _local5;_local6++) {
_local3 = fields[_local6];
_local4 = this[_local3];
if ((_local4 is String)){
_local2.push((((_local3 + ": \"") + _local4) + "\""));
} else {
if (_local4 == 0){
_local2.push(((_local3 + ": ") + _local4));
} else {
if (isNaN(_local4)){
continue;
} else {
_local2.push(((_local3 + ": ") + _local4));
};
};
};
};
var _local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}");
if (_arg1){
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (_local7);
}
public function set creation(_arg1:Date):void{
_creation = _arg1;
}
}
}//package com.google.analytics.data
Section 180
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(_arg1:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = _arg1;
}
public function set hash(_arg1:Number):void{
_hash = _arg1;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 181
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(_arg1:Number=NaN, _arg2:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.value = _arg2;
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set value(_arg1:String):void{
_value = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 182
//UTMX (com.google.analytics.data.UTMX)
package com.google.analytics.data {
public class UTMX extends UTMCookie {
private var _value:String;
public function UTMX(){
super("utmx", "__utmx", ["value"], 0);
_value = "-";
}
public function get value():String{
return (_value);
}
public function set value(_arg1:String):void{
_value = _arg1;
}
}
}//package com.google.analytics.data
Section 183
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.campaignCreation = _arg2;
this.campaignSessions = _arg3;
this.responseCount = _arg4;
this.campaignTracking = _arg5;
}
public function set responseCount(_arg1:Number):void{
_responseCount = _arg1;
update();
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set campaignCreation(_arg1:Number):void{
_campaignCreation = _arg1;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(_arg1:Number):void{
_campaignSessions = _arg1;
update();
}
public function set campaignTracking(_arg1:String):void{
_campaignTracking = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 184
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _minimum:int;
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _projectData:Object;
private var _value:String;// = "v"
public function X10(){
_set = [_key, _value];
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{
if (!hasProject(_arg1)){
_projectData[_arg1] = {};
};
if (_projectData[_arg1][_arg2] == undefined){
_projectData[_arg1][_arg2] = [];
};
_projectData[_arg1][_arg2][_arg3] = _arg4;
_hasData = (_hasData + 1);
}
private function _renderProject(_arg1:Object):String{
var _local4:int;
var _local5:Array;
var _local2 = "";
var _local3:Boolean;
var _local6:int = _set.length;
_local4 = 0;
while (_local4 < _local6) {
_local5 = _arg1[_set[_local4]];
if (_local5){
if (_local3){
_local2 = (_local2 + _set[_local4]);
};
_local2 = (_local2 + _renderDataType(_local5));
_local3 = false;
} else {
_local3 = true;
};
_local4++;
};
return (_local2);
}
public function hasProject(_arg1:Number):Boolean{
return (_projectData[_arg1]);
}
public function clearKey(_arg1:Number):void{
_clearInternal(_arg1, _key);
}
private function _renderDataType(_arg1:Array):String{
var _local3:String;
var _local4:int;
var _local2:Array = [];
_local4 = 0;
while (_local4 < _arg1.length) {
if (_arg1[_local4] != undefined){
_local3 = "";
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){
_local3 = (_local3 + _local4.toString());
_local3 = (_local3 + _delimNumValue);
};
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4]));
_local2.push(_local3);
};
_local4++;
};
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd));
}
public function getKey(_arg1:Number, _arg2:Number):String{
return ((_getInternal(_arg1, _key, _arg2) as String));
}
public function hasData():Boolean{
return ((_hasData > 0));
}
public function renderMergedUrlString(_arg1:X10=null):String{
var _local3:String;
if (!_arg1){
return (renderUrlString());
};
var _local2:Array = [_arg1.renderUrlString()];
for (_local3 in _projectData) {
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){
_local2.push((_local3 + _renderProject(_projectData[_local3])));
};
};
return (_local2.join(""));
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){
return (false);
};
_setInternal(_arg1, _value, _arg2, _arg3.toString());
return (true);
}
public function renderUrlString():String{
var _local2:String;
var _local1:Array = [];
for (_local2 in _projectData) {
if (hasProject(Number(_local2))){
_local1.push((_local2 + _renderProject(_projectData[_local2])));
};
};
return (_local1.join(""));
}
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
return (_projectData[_arg1][_arg2][_arg3]);
};
return (undefined);
}
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{
_setInternal(_arg1, _key, _arg2, _arg3);
return (true);
}
public function clearValue(_arg1:Number):void{
_clearInternal(_arg1, _value);
}
private function _clearInternal(_arg1:Number, _arg2:String):void{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
_projectData[_arg1][_arg2] = undefined;
_local3 = true;
_local5 = _set.length;
_local4 = 0;
while (_local4 < _local5) {
if (_projectData[_arg1][_set[_local4]] != undefined){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
_projectData[_arg1] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function getValue(_arg1:Number, _arg2:Number){
var _local3:* = _getInternal(_arg1, _value, _arg2);
if (_local3 == null){
return (null);
};
return (Number(_local3));
}
private function _escapeExtensibleValue(_arg1:String):String{
var _local3:int;
var _local4:String;
var _local5:String;
var _local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charAt(_local3);
_local5 = _escapeCharMap[_local4];
if (_local5){
_local2 = (_local2 + _local5);
} else {
_local2 = (_local2 + _local4);
};
_local3++;
};
return (_local2);
}
}
}//package com.google.analytics.data
Section 185
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.net.*;
import flash.text.*;
public class _Style {
public var failureColor:uint;
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var warningColor:uint;
public var infoColor:uint;
public var alertColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
private var _defaultSheet:String;
public function _Style(){
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(_arg1:String):void{
_sheet.parseCSS(_arg1);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 186
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var autoClose:Boolean;// = true
public var actionOnNextLine:Boolean;// = true
private var _actions:Array;
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){
if (_arg4 == 0){
_arg4 = Style.alertColor;
};
if (_arg5 == null){
_arg5 = Align.center;
};
super(_arg1, _arg3, _arg4, _arg5, _arg6);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = _arg7;
_actions = [];
var _local8:int;
while (_local8 < _arg2.length) {
_arg2[_local8].container = this;
_actions.push(_arg2[_local8]);
_local8++;
};
}
private function _defineActions():void{
var _local3:AlertAction;
var _local1 = "";
if (actionOnNextLine){
_local1 = (_local1 + "\n");
} else {
_local1 = (_local1 + " |");
};
_local1 = (_local1 + " ");
var _local2:Array = [];
var _local4:int;
while (_local4 < _actions.length) {
_local3 = _actions[_local4];
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>"));
_local4++;
};
_local1 = (_local1 + _local2.join(" | "));
appendText(_local1, "uiAlertAction");
}
protected function isValidAction(_arg1:String):Boolean{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (true);
};
_local2++;
};
return (false);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function getAction(_arg1:String):AlertAction{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (_actions[_local2]);
};
_local2++;
};
return (null);
}
protected function spaces(_arg1:int):String{
var _local2 = "";
var _local3 = " ";
var _local4:int;
while (_local4 < (_arg1 + 1)) {
_local2 = (_local2 + _local3);
_local4++;
};
return (_local2);
}
override public function onLink(_arg1:TextEvent):void{
var _local2:AlertAction;
if (isValidAction(_arg1.text)){
_local2 = getAction(_arg1.text);
if (_local2){
_local2.execute();
};
};
if (autoClose){
close();
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 187
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var activator:String;
public var name:String;
public function AlertAction(_arg1:String, _arg2:String, _arg3){
this.name = _arg1;
this.activator = _arg2;
_callback = _arg3;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 188
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 189
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint;
var _local6:uint;
var _local7:uint = Style.roundedCorner;
if ((((_arg3 > 0)) && ((_arg4 > 0)))){
_local5 = _arg3;
_local6 = _arg4;
} else {
_local5 = _arg1.width;
_local6 = _arg1.height;
};
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){
switch (_arg1.alignement){
case Align.top:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7);
break;
case Align.topLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7);
break;
case Align.topRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0);
break;
case Align.bottom:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0);
break;
case Align.bottomLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0);
break;
case Align.bottomRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0);
break;
case Align.left:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7);
break;
case Align.right:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0);
break;
case Align.center:
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
break;
};
} else {
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
};
}
}
}//package com.google.analytics.debug
Section 190
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint;
public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){
if (_arg2 == null){
_arg2 = Align.bottom;
};
super("", "uiLabel", _arg1, _arg2, _arg3);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(_arg1:String):void{
write(_arg1, true);
}
private function _getLinesToDisplay(_arg1:int=0):Array{
var _local2:Array;
var _local3:uint;
var _local4:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + _arg1);
} else {
if ((((_linediff > 0)) && ((_arg1 < 0)))){
_linediff = (_linediff + _arg1);
};
};
_local3 = ((_lines.length - maxLines) + _linediff);
_local4 = (_local3 + maxLines);
_local2 = _lines.slice(_local3, _local4);
} else {
_local2 = _lines;
};
return (_local2);
}
private function onKey(_arg1:KeyboardEvent=null):void{
var _local2:Array;
switch (_arg1.keyCode){
case Keyboard.DOWN:
_local2 = _getLinesToDisplay(1);
break;
case Keyboard.UP:
_local2 = _getLinesToDisplay(-1);
break;
default:
_local2 = null;
};
if (_local2 == null){
return;
};
text = _local2.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
//unresolved jump
};
return (super.forcedWidth);
}
public function write(_arg1:String, _arg2:Boolean=false):void{
var _local3:Array;
if (_arg1.indexOf("") > -1){
_local3 = _arg1.split("\n");
} else {
_local3 = [_arg1];
};
var _local4 = "";
var _local5 = "";
if (_arg2){
_local4 = "<b>";
_local5 = "</b>";
};
var _local6:int;
while (_local6 < _local3.length) {
_lines.push(((_local4 + _local3[_local6]) + _local5));
_local6++;
};
var _local7:Array = _getLinesToDisplay();
text = _local7.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 191
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import flash.utils.*;
import com.google.analytics.core.*;
import flash.net.*;
public class DebugConfiguration {
public var showHideKey:Number;// = 32
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;// = 8
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(_arg1:Boolean):void{
_verbose = _arg1;
}
public function set mode(_arg1):void{
if ((_arg1 is String)){
switch (_arg1){
case "geek":
_arg1 = VisualDebugMode.geek;
break;
case "advanced":
_arg1 = VisualDebugMode.advanced;
break;
case "basic":
default:
_arg1 = VisualDebugMode.basic;
};
};
_mode = _arg1;
}
public function success(_arg1:String):void{
if (layout){
layout.createSuccessAlert(_arg1);
};
if (traceOutput){
trace((("[+] " + _arg1) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(_arg1);
};
if (traceOutput){
trace((("## " + _arg1) + " ##"));
};
}
private function _filter(_arg1:VisualDebugMode=null):Boolean{
return (((_arg1) && ((int(_arg1) >= int(this.mode)))));
}
public function failure(_arg1:String):void{
if (layout){
layout.createFailureAlert(_arg1);
};
if (traceOutput){
trace((("[-] " + _arg1) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(_arg1:Boolean):void{
_active = _arg1;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(_arg1:String):void{
var _local7:Array;
var _local8:int;
var _local2:Array = [];
var _local3 = "";
var _local4 = "";
if (this.mode == VisualDebugMode.geek){
_local3 = (getTimer() + " - ");
_local4 = (new Array(_local3.length).join(" ") + " ");
};
if (_arg1.indexOf("\n") > -1){
_local7 = _arg1.split("\n");
_local8 = 0;
while (_local8 < _local7.length) {
if (_local7[_local8] == ""){
} else {
if (_local8 == 0){
_local2.push((_local3 + _local7[_local8]));
} else {
_local2.push((_local4 + _local7[_local8]));
};
};
_local8++;
};
} else {
_local2.push((_local3 + _arg1));
};
var _local5:int = _local2.length;
var _local6:int;
while (_local6 < _local5) {
trace(_local2[_local6]);
_local6++;
};
}
public function alert(_arg1:String):void{
if (layout){
layout.createAlert(_arg1);
};
if (traceOutput){
trace((("!! " + _arg1) + " !!"));
};
}
public function info(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(_arg1);
};
if (traceOutput){
trace(_arg1);
};
}
public function alertGifRequest(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(_arg1, _arg2, _arg3);
};
if (traceOutput){
trace(((">> " + _arg1) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 192
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 193
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(_arg1:String, _arg2:Array){
super(_arg1, _arg2);
}
}
}//package com.google.analytics.debug
Section 194
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
public interface ILayout {
function createAlert(_arg1:String):void;
function addToStage(_arg1:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createWarning(_arg1:String):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(_arg1:String):void;
function createFailureAlert(_arg1:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(_arg1:String):void;
function createVisualDebug():void;
function destroy():void;
function bringToFront(_arg1:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 195
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiInfo", Style.infoColor, Align.top, true);
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 196
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(_arg1:String="", _arg2:String="uiLabel", _arg3:uint=0, _arg4:Align=null, _arg5:Boolean=false){
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = _arg1;
_tag = _arg2;
if (_arg4 == null){
_arg4 = Align.none;
};
this.alignement = _arg4;
this.stickToEdge = _arg5;
if (_arg3 == 0){
_arg3 = Style.backgroundColor;
};
_color = _arg3;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var _local1:Graphics = _background.graphics;
_local1.clear();
_local1.beginFill(_color);
var _local2:uint = _textField.width;
var _local3:uint = _textField.height;
if (forcedWidth > 0){
_local2 = forcedWidth;
};
Background.drawRounded(this, _local1, _local2, _local3);
_local1.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(_arg1:String, _arg2:String=""):void{
if (_arg1 == ""){
return;
};
if (_arg2 == ""){
_arg2 = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + _arg2) + "\">") + _arg1) + "</span>"));
_text = (_text + _arg1);
_draw();
resize();
}
public function set text(_arg1:String):void{
if (_arg1 == ""){
_arg1 = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>");
_text = _arg1;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(_arg1:String):void{
_tag = _arg1;
text = "";
}
public function onLink(_arg1:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 197
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(_arg1:DebugConfiguration, _arg2:DisplayObject){
_display = _arg2;
_debug = _arg1;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(_arg1:KeyboardEvent=null):void{
switch (_arg1.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(_arg1:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasWarning = true;
var _local2:Warning = new Warning(_arg1, _debug.warningTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function bringToFront(_arg1:DisplayObject):void{
_display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1));
}
public function createFailureAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new FailureAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function init():void{
var _local1 = 10;
var _local2:uint = (_display.stage.stageWidth - (_local1 * 2));
var _local3:uint = (_display.stage.stageHeight - (_local1 * 2));
var _local4:Panel = new Panel("analytics", _local2, _local3);
_local4.alignement = Align.top;
_local4.stickToEdge = false;
_local4.title = ("Google Analytics v" + GATracker.version);
_mainPanel = _local4;
addToStage(_local4);
bringToFront(_local4);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(_arg1:String, _arg2:DisplayObject):void{
var _local4:Panel;
var _local3:DisplayObject = _display.stage.getChildByName(_arg1);
if (_local3){
_local4 = (_local3 as Panel);
_local4.addData(_arg2);
} else {
trace((("panel \"" + _arg1) + "\" not found"));
};
}
private function _clearInfo(_arg1:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(_arg1:String, _arg2:int=0):String{
var _local6:String;
var _local3 = "\n";
var _local4:Array = [];
var _local5:Array = _arg1.split(_local3);
if (_arg2 == 0){
_arg2 = _maxCharPerLine;
};
var _local7:int;
while (_local7 < _local5.length) {
_local6 = _local5[_local7];
while (_local6.length > _arg2) {
_local4.push(_local6.substr(0, _arg2));
_local6 = _local6.substring(_arg2);
};
_local4.push(_local6);
_local7++;
};
return (_local4.join(_local3));
}
private function _clearGRAlert(_arg1:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new SuccessAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(_arg1:String):void{
_arg1 = _filterMaxChars(_arg1);
var _local2:Alert = new Alert(_arg1, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", _local2);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function createInfo(_arg1:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasInfo = true;
var _local2:Info = new Info(_arg1, _debug.infoTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(_arg1);
};
}
public function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
var message = _arg1;
var request = _arg2;
var ref = _arg3;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(_arg1:DisplayObject):void{
_display.stage.addChild(_arg1);
}
private function _clearWarning(_arg1:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void{
var _local4:Panel = new Panel(_arg1, _arg2, _arg3);
_local4.alignement = Align.center;
_local4.stickToEdge = false;
addToStage(_local4);
bringToFront(_local4);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 198
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var top:int;
public var left:int;
public var bottom:int;
public var right:int;
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
}
}
}//package com.google.analytics.debug
Section 199
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:Number=0.3, _arg7:Align=null, _arg8:Boolean=false){
_name = _arg1;
this.name = _arg1;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = _arg2;
forcedHeight = _arg3;
this.baseAlpha = _arg6;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = _arg2;
_data.forcedHeight = _arg3;
_data.mouseEnabled = false;
_title = new Label(_arg1, "uiLabel", 0xFFFFFF, Align.topLeft, _arg8);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (_arg7 == null){
_arg7 = Align.none;
};
this.alignement = _arg7;
this.stickToEdge = _arg8;
if (_arg4 == 0){
_arg4 = Style.backgroundColor;
};
_backgroundColor = _arg4;
if (_arg5 == 0){
_arg5 = Style.borderColor;
};
_borderColor = _arg5;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(_arg1:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(_arg1:Boolean):void{
_stickToEdge = _arg1;
_title.stickToEdge = _arg1;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var _local1:uint;
var _local2:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
_local1 = forcedWidth;
_local2 = forcedHeight;
} else {
_local1 = _title.width;
_local2 = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = _local1;
forcedHeight = _local2;
};
var _local3:Graphics = _background.graphics;
_local3.clear();
_local3.beginFill(_backgroundColor);
Background.drawRounded(this, _local3, _local1, _local2);
_local3.endFill();
var _local4:Graphics = _data.graphics;
_local4.clear();
_local4.beginFill(_backgroundColor, 0);
Background.drawRounded(this, _local4, _local1, _local2);
_local4.endFill();
var _local5:Graphics = _border.graphics;
_local5.clear();
_local5.lineStyle(0.1, _borderColor);
Background.drawRounded(this, _local5, _local1, _local2);
_local5.endFill();
var _local6:Graphics = _mask.graphics;
_local6.clear();
_local6.beginFill(_backgroundColor);
Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1));
_local6.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(_arg1:DisplayObject):void{
_data.addChild(_arg1);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(_arg1:String):void{
_title.text = _arg1;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 200
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 201
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 202
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class UISprite extends Sprite {
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedHeight:uint;
public function UISprite(_arg1:DisplayObject=null){
listenResize = false;
alignement = Align.none;
this.alignTarget = _arg1;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
private function _onAddedToStage(_arg1:Event):void{
layout();
resize();
}
protected function dispose():void{
var _local1:DisplayObject;
var _local2:int;
while (_local2 < numChildren) {
_local1 = getChildAt(_local2);
if (_local1){
removeChild(_local1);
};
_local2++;
};
}
public function set forcedHeight(_arg1:uint):void{
_forcedHeight = _arg1;
}
public function set forcedWidth(_arg1:uint):void{
_forcedWidth = _arg1;
}
protected function layout():void{
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:UISprite;
if (_arg2 == null){
if ((parent is Stage)){
_arg2 = this.stage;
} else {
_arg2 = parent;
};
};
if (_arg2 == this.stage){
if (this.stage == null){
return;
};
_local3 = this.stage.stageHeight;
_local4 = this.stage.stageWidth;
_local5 = 0;
_local6 = 0;
} else {
_local7 = (_arg2 as UISprite);
if (_local7.forcedHeight){
_local3 = _local7.forcedHeight;
} else {
_local3 = _local7.height;
};
if (_local7.forcedWidth){
_local4 = _local7.forcedWidth;
} else {
_local4 = _local7.width;
};
_local5 = 0;
_local6 = 0;
};
switch (_arg1){
case Align.top:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (_local6 + margin.top);
break;
case Align.bottom:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (_local5 + margin.left);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((_local4 / 2) - (forcedWidth / 2));
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (_local5 + margin.left);
y = (_local6 + margin.top);
break;
case Align.topRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (_local6 + margin.top);
break;
case Align.bottomLeft:
x = (_local5 + margin.left);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((_arg1 == Align.none))))){
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = _arg1;
this.alignTarget = _arg2;
}
private function _onRemovedFromStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
protected function onResize(_arg1:Event):void{
resize();
}
}
}//package com.google.analytics.debug
Section 203
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 204
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 205
//Item (com.google.analytics.ecommerce.Item)
package com.google.analytics.ecommerce {
import com.google.analytics.utils.*;
public class Item {
private var _price:String;
private var _id:String;
private var _sku:String;
private var _category:String;
private var _quantity:String;
private var _name:String;
public function Item(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String){
this._id = _arg1;
this._sku = _arg2;
this._name = _arg3;
this._category = _arg4;
this._price = _arg5;
this._quantity = _arg6;
}
public function set sku(_arg1:String):void{
_sku = _arg1;
}
public function get price():String{
return (_price);
}
public function get name():String{
return (_name);
}
public function get quantity():String{
return (_quantity);
}
public function set name(_arg1:String):void{
_name = _arg1;
}
public function set price(_arg1:String):void{
_price = _arg1;
}
public function get id():String{
return (_id);
}
public function get sku():String{
return (_sku);
}
public function set quantity(_arg1:String):void{
_quantity = _arg1;
}
public function toGifParams():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.post = ["utmt", "utmtid", "utmipc", "utmipn", "utmiva", "utmipr", "utmiqt"];
_local1.utmt = "item";
_local1.utmtid = _id;
_local1.utmipc = _sku;
_local1.utmipn = _name;
_local1.utmiva = _category;
_local1.utmipr = _price;
_local1.utmiqt = _quantity;
return (_local1);
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function set category(_arg1:String):void{
_category = _arg1;
}
public function get category():String{
return (_category);
}
}
}//package com.google.analytics.ecommerce
Section 206
//Transaction (com.google.analytics.ecommerce.Transaction)
package com.google.analytics.ecommerce {
import com.google.analytics.utils.*;
public class Transaction {
private var _items:Array;
private var _total:String;
private var _vars:Variables;
private var _shipping:String;
private var _city:String;
private var _state:String;
private var _country:String;
private var _tax:String;
private var _affiliation:String;
private var _id:String;
public function Transaction(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String, _arg6:String, _arg7:String, _arg8:String){
this._id = _arg1;
this._affiliation = _arg2;
this._total = _arg3;
this._tax = _arg4;
this._shipping = _arg5;
this._city = _arg6;
this._state = _arg7;
this._country = _arg8;
_items = new Array();
}
public function get total():String{
return (_total);
}
public function getItemFromArray(_arg1:Number):Item{
return (_items[_arg1]);
}
public function set total(_arg1:String):void{
_total = _arg1;
}
public function getItem(_arg1:String):Item{
var _local2:Number;
_local2 = 0;
while (_local2 < _items.length) {
if (_items[_local2].sku == _arg1){
return (_items[_local2]);
};
_local2++;
};
return (null);
}
public function getItemsLength():Number{
return (_items.length);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:String):void{
var _local6:Item;
_local6 = getItem(_arg1);
if (_local6 == null){
_local6 = new Item(_id, _arg1, _arg2, _arg3, _arg4, _arg5);
_items.push(_local6);
} else {
_local6.name = _arg2;
_local6.category = _arg3;
_local6.price = _arg4;
_local6.quantity = _arg5;
};
}
public function set shipping(_arg1:String):void{
_shipping = _arg1;
}
public function get country():String{
return (_country);
}
public function get state():String{
return (_state);
}
public function set tax(_arg1:String):void{
_tax = _arg1;
}
public function set affiliation(_arg1:String):void{
_affiliation = _arg1;
}
public function set state(_arg1:String):void{
_state = _arg1;
}
public function get id():String{
return (_id);
}
public function get tax():String{
return (_tax);
}
public function toGifParams():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmt = "tran";
_local1.utmtid = id;
_local1.utmtst = affiliation;
_local1.utmtto = total;
_local1.utmttx = tax;
_local1.utmtsp = shipping;
_local1.utmtci = city;
_local1.utmtrg = state;
_local1.utmtco = country;
_local1.post = ["utmtid", "utmtst", "utmtto", "utmttx", "utmtsp", "utmtci", "utmtrg", "utmtco"];
return (_local1);
}
public function get affiliation():String{
return (_affiliation);
}
public function get city():String{
return (_city);
}
public function get shipping():String{
return (_shipping);
}
public function set id(_arg1:String):void{
_id = _arg1;
}
public function set city(_arg1:String):void{
_city = _arg1;
}
public function set country(_arg1:String):void{
_country = _arg1;
}
}
}//package com.google.analytics.ecommerce
Section 207
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.tracker = _arg2;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 208
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(_arg1:DebugConfiguration){
super(_arg1);
}
public function set vid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", _arg1);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function set hid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", _arg1);
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function set sid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", _arg1);
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
}
}//package com.google.analytics.external
Section 209
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _language:String;
private var _host:String;
private var _pathname:String;
private var _location:String;
private var _search:String;
private var _characterSet:String;
private var _title:String;
private var _protocol:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(_arg1:DebugConfiguration){
super(_arg1);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function cacheProperties():void{
if (!isAvailable()){
return;
};
var _local1:Object = call(cache_properties_js);
if (_local1){
_host = _local1.host;
_language = _local1.language;
_characterSet = _local1.characterSet;
_colorDepth = _local1.colorDepth;
_location = _local1.location;
_pathname = _local1.pathname;
_protocol = _local1.protocol;
_search = _local1.search;
_referrer = _local1.referrer;
_title = _local1.title;
};
}
public function get language():String{
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("navigator.language");
if (_local1 == null){
_local1 = getProperty("navigator.browserLanguage");
};
_language = _local1;
return (_language);
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("document.characterSet");
if (_local1 == null){
_local1 = getProperty("document.charset");
};
_characterSet = _local1;
return (_characterSet);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
}
}//package com.google.analytics.external
Section 210
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.system.*;
import flash.external.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(_arg1:DebugConfiguration){
_debug = _arg1;
}
public function getProperty(_arg1:String){
return (call((_arg1 + ".valueOf")));
}
public function hasProperty(_arg1:String):Boolean{
return (call(hasProperty_js, _arg1));
}
public function setProperty(_arg1:String, _arg2):void{
call(setProperty_js, _arg1, _arg2);
}
public function executeBlock(_arg1:String):void{
var data = _arg1;
if (isAvailable()){
try {
ExternalInterface.call(data);
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
}
public function getPropertyString(_arg1:String):String{
return (call((_arg1 + ".toString")));
}
public function setPropertyByReference(_arg1:String, _arg2:String):void{
call(setPropertyRef_js, _arg1, _arg2);
}
public function call(_arg1:String, ... _args){
var output:String;
var functionName = _arg1;
var args = _args;
if (isAvailable()){
try {
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
return (null);
}
public function isAvailable():Boolean{
var _local1:Boolean = ExternalInterface.available;
if (((_local1) && ((Capabilities.playerType == "External")))){
_local1 = false;
};
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (_local1);
}
}
}//package com.google.analytics.external
Section 211
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import flash.system.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){
var _local6:Version;
super();
if (_arg2 == ""){
if (isAIR()){
_arg2 = "AIR";
} else {
_arg2 = "Flash";
};
};
if (_arg3 == ""){
_local6 = flashVersion;
} else {
_local6 = Version.fromString(_arg3);
};
_url = _arg1;
_appName = _arg2;
_appVersion = _local6;
_debug = _arg4;
_dom = _arg5;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _local1:String = _dom.search;
if (_local1){
return (_local1);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var _local1:Version = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (_local1);
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
public function get languageEncoding():String{
var _local1:String;
if (System.useCodePage){
_local1 = _dom.characterSet;
if (_local1){
return (_local1);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var _local1:String;
switch (Capabilities.screenColor){
case "bw":
_local1 = "1";
break;
case "gray":
_local1 = "2";
break;
case "color":
default:
_local1 = "24";
};
var _local2:String = _dom.colorDepth;
if (_local2){
_local1 = _local2;
};
return (_local1);
}
private function _findProtocol():void{
var _local4:String;
var _local5:String;
var _local1:Protocols = Protocols.none;
if (_url != ""){
_local4 = _url.toLowerCase();
_local5 = _local4.substr(0, 5);
switch (_local5){
case "file:":
_local1 = Protocols.file;
break;
case "http:":
_local1 = Protocols.HTTP;
break;
case "https":
if (_local4.charAt(5) == ":"){
_local1 = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
var _local2:String = _dom.protocol;
var _local3:String = (_local1.toString() + ":").toLowerCase();
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2));
};
_protocol = _local1;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var _local1:String = Capabilities.manufacturer;
return (_local1.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(_arg1:String):void{
_appName = _arg1;
userAgent.applicationProduct = _arg1;
}
function set url(_arg1:String):void{
_url = _arg1;
}
public function get referrer():String{
var _local1:String = _dom.referrer;
if (_local1){
return (_local1);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _local1:String = _dom.language;
var _local2:String = Capabilities.language;
if (_local1){
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){
_local2 = _local1;
};
};
return (_local2);
}
public function get domainName():String{
var _local1:String;
var _local2:String;
var _local3:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
_local1 = _url.toLowerCase();
if (protocol == Protocols.HTTP){
_local2 = _local1.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
_local2 = _local1.split("https://").join("");
};
};
_local3 = _local2.indexOf("/");
if (_local3 > -1){
_local2 = _local2.substring(0, _local3);
};
return (_local2);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(_arg1:UserAgent):void{
_userAgent = _arg1;
}
public function set appVersion(_arg1:Version):void{
_appVersion = _arg1;
userAgent.applicationVersion = _arg1.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _local1:String = _dom.pathname;
if (_local1){
return (_local1);
};
return ("");
}
public function get documentTitle():String{
var _local1:String = _dom.title;
if (_local1){
return (_local1);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 212
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 213
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
}
}//package com.google.analytics.utils
Section 214
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(_arg1:String=""){
_url = _arg1.toLowerCase();
}
public function get domain():String{
var _local1:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
_local1 = hostName.split(".");
switch (_local1.length){
case 2:
return (hostName);
case 3:
if (_local1[1] == "co"){
return (hostName);
};
_local1.shift();
return (_local1.join("."));
case 4:
_local1.shift();
return (_local1.join("."));
};
};
return ("");
}
public function get path():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if (_local1.charAt(0) != "/"){
_local1 = ("/" + _local1);
};
return (_local1);
}
public function get protocol():Protocols{
var _local1:String = _url.split("://")[0];
switch (_local1){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf("/") > -1){
_local1 = _local1.split("/")[0];
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (_local1);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[1];
} else {
_local1 = "";
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 215
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import flash.system.*;
public class UserAgent {
private var _localInfo:Environment;
private var _applicationProduct:String;
private var _version:Version;
public static var minimal:Boolean = false;
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){
_localInfo = _arg1;
applicationProduct = _arg2;
_version = Version.fromString(_arg3);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get vendorProductToken():String{
var _local1 = "";
if (_localInfo.isAIR()){
_local1 = (_local1 + "AIR");
} else {
_local1 = (_local1 + "FlashPlayer");
};
_local1 = (_local1 + "/");
_local1 = (_local1 + _version.toString(3));
return (_local1);
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + applicationProductToken);
if (applicationComment != ""){
_local1 = (_local1 + (" " + applicationComment));
};
if (tamarinProductToken != ""){
_local1 = (_local1 + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
_local1 = (_local1 + (" " + vendorProductToken));
};
return (_local1);
}
public function get applicationComment():String{
var _local1:Array = [];
_local1.push(_localInfo.platform);
_local1.push(_localInfo.playerType);
if (!UserAgent.minimal){
_local1.push(_localInfo.operatingSystem);
_local1.push(_localInfo.language);
};
if (Capabilities.isDebugger){
_local1.push("DEBUG");
};
if (_local1.length > 0){
return ((("(" + _local1.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(_arg1:String):void{
_version = Version.fromString(_arg1);
}
public function get applicationProductToken():String{
var _local1:String = applicationProduct;
if (applicationVersion != ""){
_local1 = (_local1 + ("/" + applicationVersion));
};
return (_local1);
}
public function set applicationProduct(_arg1:String):void{
_applicationProduct = _arg1;
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 216
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(_arg1:String=null, _arg2:Array=null, _arg3:Array=null){
pre = [];
post = [];
super();
if (_arg1){
decode(_arg1);
};
if (_arg2){
this.pre = _arg2;
};
if (_arg3){
this.post = _arg3;
};
}
private function _join(_arg1:Variables):void{
var _local2:String;
if (!_arg1){
return;
};
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function join(... _args):void{
var _local2:int = _args.length;
var _local3:int;
while (_local3 < _local2) {
if (!(_args[_local3] is Variables)){
} else {
_join(_args[_local3]);
};
_local3++;
};
}
public function toString():String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:String;
var _local1:Array = [];
for (_local3 in this) {
_local2 = this[_local3];
if (URIencode){
_local2 = encodeURI(_local2);
};
_local1.push(((_local3 + "=") + _local2));
};
if (sort){
_local1.sort();
};
if (pre.length > 0){
pre.reverse();
_local5 = 0;
while (_local5 < pre.length) {
_local7 = pre[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local7) == 0){
_local1.unshift(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
pre.reverse();
};
if (post.length > 0){
_local5 = 0;
while (_local5 < post.length) {
_local8 = post[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local8) == 0){
_local1.push(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
};
return (_local1.join("&"));
}
public function decode(_arg1:String):void{
var _local2:Array;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Array;
if (_arg1 == ""){
return;
};
if (_arg1.charAt(0) == "?"){
_arg1 = _arg1.substr(1, _arg1.length);
};
if (_arg1.indexOf("&") > -1){
_local2 = _arg1.split("&");
} else {
_local2 = [_arg1];
};
var _local7:int;
while (_local7 < _local2.length) {
_local3 = _local2[_local7];
if (_local3.indexOf("=") > -1){
_local6 = _local3.split("=");
_local4 = _local6[0];
_local5 = decodeURI(_local6[1]);
this[_local4] = _local5;
};
_local7++;
};
}
public function toURLVariables():URLVariables{
var _local2:String;
var _local1:URLVariables = new URLVariables();
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 217
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _revision:uint;
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _major:uint;
private var _minor:uint;
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
var _local5:Version;
super();
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){
_local5 = Version.fromNumber(_arg1);
_arg1 = _local5.major;
_arg2 = _local5.minor;
_arg3 = _local5.build;
_arg4 = _local5.revision;
};
this.major = _arg1;
this.minor = _arg2;
this.build = _arg3;
this.revision = _arg4;
}
public function toString(_arg1:int=0):String{
var _local2:Array;
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){
_arg1 = getFields();
};
switch (_arg1){
case 1:
_local2 = [major];
break;
case 2:
_local2 = [major, minor];
break;
case 3:
_local2 = [major, minor, build];
break;
case 4:
default:
_local2 = [major, minor, build, revision];
};
return (_local2.join(_separator));
}
public function set revision(_arg1:uint):void{
_revision = Math.min(_arg1, _maxRevision);
}
public function get revision():uint{
return (_revision);
}
public function set build(_arg1:uint):void{
_build = Math.min(_arg1, _maxBuild);
}
public function set minor(_arg1:uint):void{
_minor = Math.min(_arg1, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(_arg1:uint):void{
_major = Math.min(_arg1, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
private function getFields():int{
var _local1 = 4;
if (revision == 0){
_local1--;
};
if ((((_local1 == 3)) && ((build == 0)))){
_local1--;
};
if ((((_local1 == 2)) && ((minor == 0)))){
_local1--;
};
return (_local1);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function equals(_arg1):Boolean{
if (!(_arg1 is Version)){
return (false);
};
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(_arg1:String="", _arg2:String="."):Version{
var _local4:Array;
var _local3:Version = new (Version);
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (_local3);
};
if (_arg1.indexOf(_arg2) > -1){
_local4 = _arg1.split(_arg2);
_local3.major = parseInt(_local4[0]);
_local3.minor = parseInt(_local4[1]);
_local3.build = parseInt(_local4[2]);
_local3.revision = parseInt(_local4[3]);
} else {
_local3.major = parseInt(_arg1);
};
return (_local3);
}
public static function fromNumber(_arg1:Number=0):Version{
var _local2:Version = new (Version);
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){
return (_local2);
};
_local2.major = (_arg1 >>> 28);
_local2.minor = ((_arg1 & 251658240) >>> 24);
_local2.build = ((_arg1 & 0xFF0000) >>> 16);
_local2.revision = (_arg1 & 0xFFFF);
return (_local2);
}
}
}//package com.google.analytics.utils
Section 218
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(_arg1:String, _arg2:DebugConfiguration, _arg3:JavascriptProxy){
var _local4:String;
var _local5:String;
var _local6:String;
super();
_account = _arg1;
_debug = _arg2;
_proxy = _arg3;
if (!_checkGAJS()){
_local4 = "";
_local4 = (_local4 + "ga.js not found, be sure to check if\n");
_local4 = (_local4 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
_local4 = (_local4 + "is included in the HTML.");
_debug.warning(_local4);
throw (new Error(_local4));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
_local5 = "";
_local5 = (_local5 + "The Google Analytics tracking code was not found on the container page\n");
_local5 = (_local5 + "we create it");
_debug.info(_local5, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(_arg1)){
_createTrackingObject(_arg1);
} else {
if (_checkTrackingObject(_arg1)){
_linkTrackingObject(_arg1);
} else {
_local6 = "";
_local6 = (_local6 + (("JS Object \"" + _arg1) + "\" doesn't exist in DOM\n"));
_local6 = (_local6 + "Bridge object not created.");
_debug.warning(_local6);
throw (new Error(_local6));
};
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.info((((("link( " + _arg1) + ", ") + _arg2) + " )"));
_call("_link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_call("_addOrganic", _arg1);
}
public function setAllowLinker(_arg1:Boolean):void{
_debug.info((("setAllowLinker( " + _arg1) + " )"));
_call("_setAllowLinker", _arg1);
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
_debug.info((((("getLinkerUrl(" + _arg1) + ", ") + _arg2) + ")"));
return (_call("_getLinkerUrl", _arg1, _arg2));
}
private function _linkTrackingObject(_arg1:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_debug.info((("setClientInfo( " + _arg1) + " )"));
_call("_setClientInfo", _arg1);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5 = 2;
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = 3;
};
if ((((_local5 == 3)) && (!(isNaN(_arg4))))){
_local5 = 4;
};
switch (_local5){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3, _arg4));
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3));
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2));
};
}
public function setCookieTimeout(_arg1:int):void{
_debug.info((("setCookieTimeout( " + _arg1) + " )"));
_call("_setCookieTimeout", _arg1);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
_call("_trackPageview", _arg1);
}
private function _checkValidTrackingObject(_arg1:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, _arg1));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((((("linkByPost( " + _arg1) + ", ") + _arg2) + " ) not implemented"));
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _call(_arg1:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + _arg1));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(_arg1:String):Boolean{
var _local2:Boolean = _proxy.hasProperty(_arg1);
var _local3:Boolean = _proxy.hasProperty((_arg1 + "._getAccount"));
return (((_local2) && (_local3)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(_arg1:String):void{
_debug.info((("setCampNameKey( " + _arg1) + " )"));
_call("_setCampNameKey", _arg1);
}
public function setDetectFlash(_arg1:Boolean):void{
_debug.info((("setDetectFlash( " + _arg1) + " )"));
_call("_setDetectFlash", _arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
_call("_addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(_arg1:String):void{
_debug.info((("setVar( " + _arg1) + " )"));
_call("_setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
_debug.info((("setDomainName( " + _arg1) + " )"));
_call("_setDomainName", _arg1);
}
public function hasTrackingAccount(_arg1:String):Boolean{
if (Utils.validateAccount(_arg1)){
return (_checkValidTrackingObject(_arg1));
};
return (_checkTrackingObject(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_debug.info((("setCampSourceKey( " + _arg1) + " )"));
_call("_setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " )"));
_call("_addTrans", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setCampContentKey(_arg1:String):void{
_debug.info((("setCampContentKey( " + _arg1) + " )"));
_call("_setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(_arg1:Boolean):void{
_debug.info((("setAllowAnchor( " + _arg1) + " )"));
_call("_setAllowAnchor", _arg1);
}
public function setLocalGifPath(_arg1:String):void{
_debug.info((("setLocalGifPath( " + _arg1) + " )"));
_call("_setLocalGifPath", _arg1);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(_arg1:String):void{
_debug.info((("setCookiePath( " + _arg1) + " )"));
_call("_setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
_debug.info((("setSampleRate( " + _arg1) + " )"));
_call("_setSampleRate", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_debug.info((("setAllowHash( " + _arg1) + " )"));
_call("_setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_call("_addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
_debug.info((("setCampNOKey( " + _arg1) + " )"));
_call("_setCampNOKey", _arg1);
}
public function cookiePathCopy(_arg1:String):void{
_debug.info((("cookiePathCopy( " + _arg1) + " )"));
_call("_cookiePathCopy", _arg1);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(_arg1:Boolean):void{
_debug.info((("setDetectTitle( " + _arg1) + " )"));
_call("_setDetectTitle", _arg1);
}
private function _createTrackingObject(_arg1:String):void{
_proxy.call(_createTrackingObject_js, _arg1);
}
public function setCampaignTrack(_arg1:Boolean):void{
_debug.info((("setCampaignTrack( " + _arg1) + " )"));
_call("_setCampaignTrack", _arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
_debug.info((("setCampTermKey( " + _arg1) + " )"));
_call("_setCampTermKey", _arg1);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(_arg1:String):void{
_debug.info((("setCampMediumKey( " + _arg1) + " )"));
_call("_setCampMediumKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_call("_addIgnoredRef", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
_debug.info((("setSessionTimeout( " + _arg1) + " )"));
_call("_setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 219
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var hasSiteOverlay:Boolean;// = false
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
public var allowAnchor:Boolean;// = false
private var _domain:Domain;
private var _trackingLimitPerSession:int;// = 500
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(_arg1:DebugConfiguration=null){
_organic = new Organic();
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
campaignKey = new CampaignKey();
serverMode = ServerOperationMode.remote;
super();
_debug = _arg1;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get cookieName():String{
return (_cookieName);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function addOrganicSource(_arg1:String, _arg2:String):void{
var engine = _arg1;
var keyword = _arg2;
try {
_organic.addSource(engine, keyword);
} catch(e:Error) {
if (((_debug) && (_debug.active))){
_debug.warning(e.message);
};
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0.1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = Number(_arg1.toFixed(2));
_sampleRate = _arg1;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 220
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(_arg1:String):void;
function setDetectTitle(_arg1:Boolean):void;
function setLocalRemoteServerMode():void;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(_arg1:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(_arg1:Boolean):void;
function setAllowLinker(_arg1:Boolean):void;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(_arg1:String):void;
function setCampNameKey(_arg1:String):void;
function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function clearIgnoredRef():void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void;
function getDetectFlash():Boolean;
function setCampaignTrack(_arg1:Boolean):void;
function createEventTracker(_arg1:String):EventTracker;
function setCookieTimeout(_arg1:int):void;
function setAllowAnchor(_arg1:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(_arg1:String=""):void;
function setLocalGifPath(_arg1:String):void;
function getVersion():String;
function getLocalGifPath():String;
function getServiceMode():ServerOperationMode;
function setVar(_arg1:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(_arg1:String):void;
function addIgnoredRef(_arg1:String):void;
function setClientInfo(_arg1:Boolean):void;
function setCookiePath(_arg1:String):void;
function setSampleRate(_arg1:Number):void;
function setSessionTimeout(_arg1:int):void;
function setRemoteServerMode():void;
function setDomainName(_arg1:String):void;
function addIgnoredOrganic(_arg1:String):void;
function setAllowHash(_arg1:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(_arg1:String):void;
function getClientInfo():Boolean;
function cookiePathCopy(_arg1:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 221
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.ecommerce.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _ecom:Ecommerce;
private var _account:String;
public function Tracker(_arg1:String, _arg2:Configuration, _arg3:DebugConfiguration, _arg4:Environment, _arg5:Buffer, _arg6:GIFRequest, _arg7:AdSenseGlobals, _arg8:Ecommerce){
var _local9:String;
super();
_account = _arg1;
_config = _arg2;
_debug = _arg3;
_info = _arg4;
_buffer = _arg5;
_gifRequest = _arg6;
_adSense = _arg7;
_ecom = _arg8;
if (!Utils.validateAccount(_arg1)){
_local9 = (("Account \"" + _arg1) + "\" is not valid.");
_debug.warning(_local9);
throw (new Error(_local9));
};
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_config.organic.addSource(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_config.allowLinker = _arg1;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
_initData();
_debug.info((((("getLinkerUrl( " + _arg1) + ", ") + _arg2.toString()) + " )"));
return (_buffer.getLinkerUrl(_arg1, _arg2));
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
_initData();
var _local5:Boolean;
var _local6 = 2;
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, _arg1);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, _arg2);
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, _arg3);
_local6 = 3;
if (!isNaN(_arg4)){
_local5 = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, _arg4);
_local6 = 4;
};
};
if (_local5){
_debug.info(((("valid event tracking call\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_local5 = false;
};
switch (_local6){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
};
return (_local5);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(_arg1);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + _arg1) + " ) failed"));
};
}
public function setCookieTimeout(_arg1:int):void{
_config.conversionTimeout = _arg1;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
var _local1:Number;
var _local2:Number;
var _local4:Transaction;
_initData();
var _local3:Array = new Array();
if (_takeSample()){
_local1 = 0;
while (_local1 < _ecom.getTransLength()) {
_local4 = _ecom.getTransFromArray(_local1);
_local3.push(_local4.toGifParams());
_local2 = 0;
while (_local2 < _local4.getItemsLength()) {
_local3.push(_local4.getItemFromArray(_local2).toGifParams());
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < _local3.length) {
_gifRequest.send(_account, _local3[_local1]);
_local1++;
};
};
}
public function setClientInfo(_arg1:Boolean):void{
_config.detectClientInfo = _arg1;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning("linkByPost not implemented in AS3 mode");
}
private function _initData():void{
var _local1:String;
var _local2:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "_initData 0");
_local1 = (_local1 + ("\ndomain name: " + _config.domainName));
_local1 = (_local1 + ("\ndomain hash: " + _domainHash));
_local1 = (_local1 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
_debug.info(("Search: " + _info.locationSearch));
_debug.info(("CampaignTrackig: " + _buffer.utmz.campaignTracking));
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "_initData (misc)");
_local2 = (_local2 + ("\nflash version: " + _info.flashVersion.toString(4)));
_local2 = (_local2 + ("\nprotocol: " + _info.protocol));
_local2 = (_local2 + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
_local2 = (_local2 + ("\nlanguage: " + _info.language));
_local2 = (_local2 + ("\ndomain hash: " + _getDomainHash()));
_local2 = (_local2 + ("\nuser-agent: " + _info.userAgent));
_debug.info(_local2, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(_arg1:X10=null):void{
var _local2:Variables;
var _local3:EventInfo;
var _local4:Variables;
var _local5:Variables;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
_local3 = new EventInfo(true, _x10Module, _arg1);
_local4 = _local3.toVariables();
_local5 = _renderMetricsSearchVariables();
_local2.join(_local4, _local5);
_gifRequest.send(_account, _local2, false, true);
};
}
public function setDetectFlash(_arg1:Boolean):void{
_config.detectFlash = _arg1;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(_arg1:String):void{
_config.campaignKey.UCCN = _arg1;
var _local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCN]"));
} else {
_debug.info(_local2);
};
}
private function _formatReferrer():String{
var _local2:String;
var _local3:URL;
var _local4:URL;
var _local1:String = _info.referrer;
if ((((_local1 == "")) || ((_local1 == "localhost")))){
_local1 = "-";
} else {
_local2 = _info.domainName;
_local3 = new URL(_local1);
_local4 = new URL(("http://" + _local2));
if (_local3.hostName == _local2){
return ("-");
};
if (_local4.domain == _local3.domain){
if (_local4.subDomain != _local3.subDomain){
_local1 = "0";
};
};
if ((((_local1.charAt(0) == "[")) && (_local1.charAt((_local1.length - 1))))){
_local1 = "-";
};
};
_debug.info(("formated referrer: " + _local1), VisualDebugMode.advanced);
return (_local1);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
var _local7:Transaction;
_local7 = _ecom.getTransaction(_arg1);
if (_local7 == null){
_local7 = _ecom.addTransaction(_arg1, "", "", "", "", "", "", "");
};
_local7.addItem(_arg2, _arg3, _arg4, _arg5.toString(), _arg6.toString());
if (_debug.active){
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
};
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(_arg1:String):void{
var _local2:Variables;
if (((!((_arg1 == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = encodeURI(_arg1);
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + _arg1) + " )"));
if (_takeSample()){
_local2 = new Variables();
_local2.utmt = "var";
_gifRequest.send(_account, _local2);
};
} else {
_debug.warning((("setVar \"" + _arg1) + "\" is ignored"));
};
}
public function setDomainName(_arg1:String):void{
if (_arg1 == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (_arg1 == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = _arg1;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var _local1:String;
if (_config.domain.mode == DomainNameMode.auto){
_local1 = _info.domainName;
if (_local1.substring(0, 4) == "www."){
_local1 = _local1.substring(4);
};
_config.domain.name = _local1;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_ecom.addTransaction(_arg1, _arg2, _arg3.toString(), _arg4.toString(), _arg5.toString(), _arg6, _arg7, _arg8);
if (_debug.active){
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " );"));
};
}
private function _renderMetricsSearchVariables(_arg1:String=""):Variables{
var _local4:Variables;
var _local2:Variables = new Variables();
_local2.URIencode = true;
var _local3:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense);
_debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
_local4 = _campaignInfo.toVariables();
};
var _local5:Variables = _browserInfo.toVariables();
_local2.join(_local3.toVariables(), _local5, _local4);
return (_local2);
}
public function setCampContentKey(_arg1:String):void{
_config.campaignKey.UCCT = _arg1;
var _local2 = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCT]"));
} else {
_debug.info(_local2);
};
}
private function _handleCookie():void{
var _local1:String;
var _local2:String;
var _local3:Array;
var _local4:String;
if (_config.allowLinker){
};
_buffer.createSO();
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "AdSense sid found\n");
_local1 = (_local1 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "AdSense sid found (new visitor)\n");
_local2 = (_local2 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local2, VisualDebugMode.geek);
};
};
if (_adSense.vid){
_local3 = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(_local3[0]);
_buffer.utma.firstTime = Number(_local3[1]);
if (_debug.verbose){
_local4 = "";
_local4 = (_local4 + "AdSense vid found (new visitor)\n");
_local4 = (_local4 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(_local3[0])) + ")\n"));
_local4 = (_local4 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(_local3[1])) + ")"));
_debug.info(_local4, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(_arg1:String):void{
_config.campaignKey.UCSR = _arg1;
var _local2 = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCSR]"));
} else {
_debug.info(_local2);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(_arg1:String):void{
_config.localGIFpath = _arg1;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(_arg1:Boolean):void{
_config.allowAnchor = _arg1;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var _local1:String = _config.domainName;
var _local2 = (_local1.indexOf("www.google.") < 0);
var _local3 = (_local1.indexOf(".google.") < 0);
var _local4 = (_local1.indexOf("google.") < 0);
var _local5 = (_local1.indexOf("google.org") > -1);
return (((((((((_local2) || (_local3))) || (_local4))) || (!((_config.cookiePath == "/"))))) || (_local5)));
}
public function setSampleRate(_arg1:Number):void{
if (_arg1 < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = _arg1;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(_arg1:String):void{
_config.cookiePath = _arg1;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(_arg1:Boolean):void{
_config.allowDomainHash = _arg1;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var _local1 = "";
_local1 = (_local1 + _info.appName);
_local1 = (_local1 + _info.appVersion);
_local1 = (_local1 + _info.language);
_local1 = (_local1 + _info.platform);
_local1 = (_local1 + _info.userAgent.toString());
_local1 = (_local1 + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
_local1 = (_local1 + _info.referrer);
return (Utils.generateHash(_local1));
}
public function setCampNOKey(_arg1:String):void{
_config.campaignKey.UCNO = _arg1;
var _local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCNO]"));
} else {
_debug.info(_local2);
};
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_config.organic.addIgnoredKeyword(_arg1);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(_arg1:String):void{
_debug.warning((("cookiePathCopy( " + _arg1) + " ) not implemented"));
}
public function setDetectTitle(_arg1:Boolean):void{
_config.detectTitle = _arg1;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(_arg1:String):void{
_config.campaignKey.UCTR = _arg1;
var _local2 = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCTR]"));
} else {
_debug.info(_local2);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(_arg1:String=""):void{
var _local2:Variables;
var _local3:Variables;
var _local4:Variables;
var _local5:EventInfo;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
_local5 = new EventInfo(false, _x10Module);
_local3 = _local5.toVariables();
};
_local4 = _renderMetricsSearchVariables(_arg1);
_local2.join(_local3, _local4);
_gifRequest.send(_account, _local2);
};
}
public function setCampaignTrack(_arg1:Boolean):void{
_config.campaignTracking = _arg1;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_config.organic.addIgnoredReferral(_arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(_arg1:String):void{
_config.campaignKey.UCMD = _arg1;
var _local2 = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCMD]"));
} else {
_debug.info(_local2);
};
}
private function _getUniqueSessionId():Number{
var _local1:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + _local1), VisualDebugMode.geek);
return (_local1);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(_arg1:int):void{
_config.sessionTimeout = _arg1;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
var targetUrl = _arg1;
var useHash = _arg2;
_initData();
var out:String = _buffer.getLinkerUrl(targetUrl, useHash);
var request:URLRequest = new URLRequest(out);
_debug.info((("link( " + [targetUrl, useHash].join(",")) + " )"));
try {
navigateToURL(request, "_top");
} catch(e:Error) {
_debug.warning(("An error occured in link() msg: " + e.message));
};
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 222
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set account(_arg1:String):void;
function get config():Configuration;
function get mode():String;
function set config(_arg1:Configuration):void;
function set mode(_arg1:String):void;
function set debug(_arg1:DebugConfiguration):void;
function get visualDebug():Boolean;
function get account():String;
function set visualDebug(_arg1:Boolean):void;
function isReady():Boolean;
function get debug():DebugConfiguration;
}
}//package com.google.analytics
Section 223
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 224
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import flash.events.*;
import flash.display.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _ecom:Ecommerce;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){
_display = _arg1;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = _arg2;
this.mode = _arg3;
this.visualDebug = _arg4;
if (!_arg6){
this.debug = new DebugConfiguration();
};
if (!_arg5){
this.config = new Configuration(_arg6);
};
if (autobuild){
_factory();
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function getLinkerUrl(_arg1:String="", _arg2:Boolean=false):String{
return (_tracker.getLinkerUrl(_arg1, _arg2));
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_eventDispatcher.dispatchEvent(_arg1));
}
public function get config():Configuration{
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):void{
_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function willTrigger(_arg1:String):Boolean{
return (_eventDispatcher.willTrigger(_arg1));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function isReady():Boolean{
return (_ready);
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function get mode():String{
return (_mode);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory():void{
var _local1:GoogleAnalyticsAPI;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
var _local2:TrackerCache = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local1 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local1 = _trackerFactory();
};
if (!_local2.isEmpty()){
_local2.tracker = _local1;
_local2.flush();
};
_tracker = _local1;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_ecom = new Ecommerce(_debug);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense, _ecom));
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 225
//LoaderEvent (com.malee.events.LoaderEvent)
package com.malee.events {
import flash.events.*;
public class LoaderEvent extends Event {
private var _item:IEventDispatcher;
public static const ITEM_SECURITY_ERROR:String = "itemSecurityError";
public static const ITEM_IO_ERROR:String = "itemIOError";
public static const ITEM_COMPLETE:String = "itemComplete";
public function LoaderEvent(_arg1:String, _arg2:IEventDispatcher, _arg3:Boolean=false, _arg4:Boolean=false):void{
super(_arg1, _arg3, _arg4);
_item = _arg2;
}
public function get item():IEventDispatcher{
return (_item);
}
override public function clone():Event{
return (new LoaderEvent(type, _item, bubbles, cancelable));
}
}
}//package com.malee.events
Section 226
//ClearSpringInterface (com.malee.net.clearspring.ClearSpringInterface)
package com.malee.net.clearspring {
import flash.display.*;
import flash.system.*;
public class ClearSpringInterface {
private var _ref:DisplayObject;
private var _api:Object;
public function ClearSpringInterface(_arg1:DisplayObject){
_ref = _arg1;
start();
}
public function start():void{
Security.allowDomain("bin.clearspring.com");
Security.allowDomain("widgets.clearspring.com");
try {
_api = _ref.loaderInfo.loader.root;
trace((("User has viewed me " + _api.context.user.WIDGET_VIEWS) + " times"));
} catch(e:Error) {
trace("WARNING: Not able to add loader event listener. Normal if not running in the Clearspring container.");
};
}
public function get api():Object{
if (_api != null){
return (_api);
};
return (null);
}
}
}//package com.malee.net.clearspring
Section 227
//SoapMenu (com.malee.soap.SoapMenu)
package com.malee.soap {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.ui.*;
public class SoapMenu {
private var _context:ContextMenu;
private var _object:InteractiveObject;
public function SoapMenu(_arg1:DisplayObject):void{
_object = (_arg1 as InteractiveObject);
_context = new ContextMenu();
_context.hideBuiltInItems();
_object.contextMenu = _context;
init();
}
public function addItem(_arg1:String):void{
var _local2:ContextMenuItem = new ContextMenuItem(_arg1);
_local2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, selectItem);
_context.customItems.push(_local2);
}
private function selectItem(_arg1:ContextMenuEvent):void{
switch (_arg1.target.caption){
case "Game by Soap Creative":
linkToSoap();
break;
case "High Quality":
toggleQuality("HIGH");
break;
case "Low Quality":
toggleQuality("LOW");
break;
};
}
private function linkToSoap():void{
SoapTracking.trackSite("click", "visit_SOAP");
navigateToURL(new URLRequest("http://www.soap.com.au"), "_blank");
}
private function toggleQuality(_arg1:String):void{
_object.stage.quality = _arg1;
}
private function init():void{
addItem("Game by Soap Creative");
addItem("High Quality");
addItem("Low Quality");
}
}
}//package com.malee.soap
Section 228
//SoapTracking (com.malee.soap.SoapTracking)
package com.malee.soap {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
public class SoapTracking {
private static var _shared:SharedObject;
public static var clientId:int;
private static var siteEVTTime:Number;
private static var _request:URLRequest;
public static var projectId:int;
private static var _tracking:URLLoader;
private static var siteStartTime:Number;
private static var returnVisitor:int;
private static function onError(_arg1:IOErrorEvent):void{
trace("Tracking Error");
}
private static function sendSiteStats(_arg1:DisplayObject):void{
var _local2:URLRequest = new URLRequest();
var _local3:URLLoader = new URLLoader();
var _local4:URLVariables = new URLVariables();
_local2.url = "http://stats.soap.com.au/usrinfo.php";
_local2.method = URLRequestMethod.POST;
var _local5:String = _arg1.loaderInfo.url;
if (_local5.substring(0, 4) == "http"){
_local4.url = _local5;
} else {
_local4.url = "local";
};
_local4.clientId = clientId;
_local4.projectId = projectId;
_local2.data = _local4;
_local3.load(_local2);
}
private static function initTracking():void{
siteStartTime = getTimer();
siteEVTTime = getTimer();
checkReturn();
}
private static function onComplete(_arg1:Event):void{
}
public static function trackSite(_arg1:String, ... _args):void{
if (_tracking == null){
trace("ERROR - SoapTracking has not been Initalised");
return;
};
var _local3:String = _args.join(",");
var _local4:int;
switch (_arg1){
case "impression":
break;
case "click":
break;
case "over":
break;
case "durationFromInit":
_local4 = ((getTimer() - siteStartTime) / 1000);
break;
case "durationEvent":
_local4 = ((getTimer() - siteEVTTime) / 1000);
break;
default:
_arg1 = "";
};
var _local5:URLVariables = new URLVariables();
_local5["return"] = returnVisitor;
_local5.clientId = clientId;
_local5.projectId = projectId;
_local5.actionType = _arg1;
_local5.pageId = _local3;
_local5.time = _local4;
_local5.user = _shared.data.userID;
_request.data = _local5;
_tracking.load(_request);
}
private static function checkReturn():void{
returnVisitor = ((_shared.data.userID == undefined)) ? 0 : 1;
_shared.data.userID = (Math.random() * 9999999999);
}
public static function INIT(_arg1:int, _arg2:int, _arg3:DisplayObject):void{
clientId = _arg1;
projectId = _arg2;
_tracking = new URLLoader();
_request = new URLRequest();
_shared = SharedObject.getLocal(((("siteTrackingStats_" + _arg1) + "_") + _arg2), "/");
_request.url = "http://stats.soap.com.au/pgtrack.php";
_request.method = URLRequestMethod.POST;
_tracking.dataFormat = URLLoaderDataFormat.TEXT;
_tracking.addEventListener(Event.COMPLETE, onComplete);
_tracking.addEventListener(IOErrorEvent.IO_ERROR, onError);
initTracking();
sendSiteStats(_arg3);
}
}
}//package com.malee.soap
Section 229
//Earthquake (com.markfennell.display.Earthquake)
package com.markfennell.display {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Earthquake {
private static const FRAME_RATE:int = 25;
private static var timer:Timer;
private static var originalX:int;
private static var originalY:int;
private static var horizontal:Boolean;
private static var intensityOffset:int;
private static var intensity:int;
private static var image:DisplayObject;
private static var vertical:Boolean;
private static function resetImage(_arg1:TimerEvent=null):void{
image.x = originalX;
image.y = originalY;
cleanup();
}
public static function temp():void{
}
public static function go(_arg1:DisplayObject, _arg2:Number=10, _arg3:Number=1, _arg4:Boolean=true, _arg5:Boolean=true):void{
if (timer){
timer.stop();
};
image = _arg1;
originalX = image.x;
originalY = image.y;
horizontal = _arg5;
vertical = _arg4;
intensity = _arg2;
intensityOffset = (intensity / 2);
var _local6:int = int((1000 / FRAME_RATE));
var _local7:int = int(((_arg3 * 1000) / _local6));
timer = new Timer(_local6, _local7);
timer.addEventListener(TimerEvent.TIMER, quake);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, resetImage);
timer.start();
}
private static function cleanup():void{
timer = null;
image = null;
}
private static function quake(_arg1:TimerEvent):void{
var _local2:int = ((originalX + (Math.random() * intensity)) - intensityOffset);
var _local3:int = ((originalY + (Math.random() * intensity)) - intensityOffset);
if (horizontal){
image.x = _local2;
};
if (vertical){
image.y = _local3;
};
}
}
}//package com.markfennell.display
Section 230
//TimeKeeper (com.markfennell.display.TimeKeeper)
package com.markfennell.display {
import flash.utils.*;
public class TimeKeeper {
private var oldTime:Number;// = 0
private var countdownTime:Number;// = 0
private var isCountdown:Boolean;// = false
private var totalTime:Number;// = 0
private var pause:Boolean;// = false
public function TimeKeeper(_arg1:Number=0){
if (_arg1 != 0){
isCountdown = true;
countdownTime = _arg1;
};
this.reset();
}
public function stop():void{
if (!this.pause){
this.pause = true;
this.totalTime = (this.totalTime + (getTimer() - this.oldTime));
};
}
public function getTime(_arg1:int):int{
if (isCountdown){
return ((countdownTime - _arg1));
};
return (_arg1);
}
public function displayHour():int{
var _local1:int = this.getMili();
var _local2:int = Math.floor((_local1 / 1000));
var _local3:int = Math.floor((_local2 / 60));
var _local4:int = Math.floor((_local3 / 60));
return (_local4);
}
public function reset():void{
this.oldTime = 0;
this.pause = true;
this.totalTime = 0;
}
public function getMili():int{
var _local1:int = this.totalTime;
if (!this.pause){
_local1 = (_local1 + (getTimer() - this.oldTime));
};
return (getTime(_local1));
}
public function getMins():int{
var _local1:int = (this.totalTime / 1000);
if (!this.pause){
_local1 = (_local1 + (((getTimer() - this.oldTime) / 1000) / 60));
};
return (Math.round(getTime(_local1)));
}
public function addMili(_arg1:int):void{
this.totalTime = Math.max(0, (this.totalTime + _arg1));
}
public function start():void{
if (this.pause){
this.pause = false;
this.oldTime = getTimer();
};
}
public function displaySec():int{
var _local1:int = this.getMili();
var _local2:int = Math.floor((_local1 / 1000));
_local2 = (_local2 % 60);
return (_local2);
}
public function elapsedTime():int{
if (isCountdown){
return ((countdownTime - getMili()));
};
return (getMili());
}
public function displayTime():String{
var _local1:String = three(displayMili());
_local1 = _local1.substring(0, 3);
var _local2:String = ((((displayMin() + "'") + two(displaySec())) + "\"") + _local1);
return (_local2);
}
public function displayMin():int{
var _local1:int = this.getMili();
var _local2:int = Math.floor((_local1 / 1000));
var _local3:int = Math.floor((_local2 / 60));
_local3 = (_local3 % 60);
return (_local3);
}
public function getSecs():int{
var _local1:int = (this.totalTime / 1000);
if (!this.pause){
_local1 = (_local1 + ((getTimer() - this.oldTime) / 1000));
};
if (isCountdown){
return (((countdownTime / 1000) - _local1));
};
return (_local1);
}
public function subMili(_arg1:int):void{
this.totalTime = (this.totalTime - _arg1);
}
public function displayMili():int{
var _local1:int = this.getMili();
_local1 = (_local1 % 1000);
return (_local1);
}
public static function display(_arg1:Number, _arg2:String="'", _arg3:String="""):String{
var _local4:int = Math.floor((_arg1 / 1000));
var _local5:int = Math.floor((_local4 / 60));
return ((((((_local5 % 60) + _arg2) + two((_local4 % 60))) + _arg3) + three((_arg1 % 1000))));
}
private static function two(_arg1:int):String{
return ((((_arg1)>9) ? "" : "0" + _arg1));
}
private static function three(_arg1:int):String{
return (((((_arg1)>99) ? "" : "0" + ((_arg1)>9) ? "" : "0") + _arg1));
}
}
}//package com.markfennell.display
Section 231
//FoleyOptions (com.markfennell.sound.FoleyOptions)
package com.markfennell.sound {
public class FoleyOptions {
public static var ONCE:String = "once";
public static var LOOP:String = "loop";
public static var SINGLE:String = "single";
}
}//package com.markfennell.sound
Section 232
//FoleySound (com.markfennell.sound.FoleySound)
package com.markfennell.sound {
import flash.events.*;
import flash.geom.*;
import flash.media.*;
public class FoleySound extends SoundPlayer {
private var m_hasPlayed:Boolean;// = false
private var m_range:Number;
private var m_options:String;
private var m_source:IFoleySource;
public function FoleySound(_arg1:Sound, _arg2:Number, _arg3:IFoleySource, _arg4:String):void{
super(_arg1, false);
m_range = _arg2;
m_source = _arg3;
m_options = _arg4;
}
public function render(_arg1:Number, _arg2:Point):void{
var _local3:Number;
var _local4:Number = Point.distance(_arg2, m_source.point);
if (m_source.isOn){
if (_local4 < m_range){
_local3 = ((_arg1 * (m_range - _local4)) / m_range);
if (m_soundState == PLAYING){
volume = _local3;
} else {
if (m_options == FoleyOptions.ONCE){
if (m_hasPlayed){
return;
};
play(_local3, 1);
} else {
play(_local3, 999);
};
};
m_hasPlayed = true;
} else {
if (m_soundState == STOPPED){
return;
};
if (m_options == FoleyOptions.SINGLE){
m_loops = 1;
} else {
stop();
};
};
} else {
if (m_soundState == STOPPED){
return;
};
if (m_options == FoleyOptions.SINGLE){
m_loops = 1;
} else {
stop();
};
};
}
public static function stopSounds():void{
var item:SoundPlayer;
for each (item in soundsDictionary) {
try {
if (item.stoppable){
item.destroy();
soundsDictionary[item] = null;
};
} catch(e:Error) {
};
};
}
}
}//package com.markfennell.sound
Section 233
//IFoleySource (com.markfennell.sound.IFoleySource)
package com.markfennell.sound {
import flash.geom.*;
public interface IFoleySource {
function get point():Point;
function get isOn():Boolean;
}
}//package com.markfennell.sound
Section 234
//SoundEvent (com.markfennell.sound.SoundEvent)
package com.markfennell.sound {
import flash.events.*;
public class SoundEvent extends Event {
public var force:Boolean;
public var delay:Number;
public var volume:Number;
public var name:String;
public var loops:int;
public static var DIALOG:String = "Sound Dialog";
public static var EFFECT:String = "Sound Effect";
public function SoundEvent(_arg1:String, _arg2:String, _arg3:Number, _arg4:int=1, _arg5:Boolean=false, _arg6:Number=0){
super(_arg1, true, true);
name = _arg2;
volume = _arg3;
loops = _arg4;
force = _arg5;
delay = _arg6;
}
override public function clone():Event{
return (new SoundEvent(type, name, volume, loops, force, delay));
}
}
}//package com.markfennell.sound
Section 235
//SoundPlayer (com.markfennell.sound.SoundPlayer)
package com.markfennell.sound {
import flash.events.*;
import flash.utils.*;
import flash.media.*;
public class SoundPlayer extends EventDispatcher {
protected var m_soundChannel:SoundChannel;
public var stoppable:Boolean;// = true
protected var m_timeout:int;
public var m_soundState:String;
protected var m_loops:int;
protected var m_volume:Number;
protected var m_destroy:Boolean;
protected var m_position:Number;// = 0
protected var m_sound:Sound;
protected static var soundsDictionary:Dictionary = new Dictionary();
public static var STOPPED:String = "stopped";
public static var PAUSED:String = "paused";
public static var FINISHED:String = "finished";
public static var INITIALIZED:String = "init";
public static var PLAYING:String = "playing";
public static var COMPLETE:String = "complete";
public function SoundPlayer(_arg1:Sound, _arg2:Boolean=true):void{
m_soundChannel = new SoundChannel();
super();
m_sound = _arg1;
m_soundState = INITIALIZED;
soundsDictionary[this] = this;
m_destroy = _arg2;
}
public function get soundState():String{
return (m_soundState);
}
public function play(_arg1:Number=1, _arg2:int=1, _arg3:Number=0):void{
var a_volume = _arg1;
var a_loops = _arg2;
var a_delay = _arg3;
try {
clearTimeout(m_timeout);
if (a_delay != 0){
m_timeout = setTimeout(play, (a_delay * 1000), a_volume, a_loops, 0);
return;
};
if ((((m_soundState == PLAYING)) || ((m_soundChannel == null)))){
return;
};
m_volume = a_volume;
m_loops = a_loops;
m_soundChannel.stop();
m_soundChannel = m_sound.play(m_position);
m_soundChannel.addEventListener(Event.SOUND_COMPLETE, soundComplete);
m_soundState = PLAYING;
volume = m_volume;
} catch(e:Error) {
};
}
public function set soundState(_arg1:String):void{
m_soundState = _arg1;
}
public function pause():void{
if (m_soundState == INITIALIZED){
return;
};
m_position = m_soundChannel.position;
m_soundChannel.stop();
m_soundChannel.removeEventListener(Event.SOUND_COMPLETE, soundComplete);
m_soundState = PAUSED;
}
public function stop():void{
m_position = 0;
m_soundState = STOPPED;
if (m_soundChannel){
m_soundChannel.stop();
m_soundChannel.removeEventListener(Event.SOUND_COMPLETE, soundComplete);
};
}
public function get leftPeak():Number{
return (m_soundChannel.leftPeak);
}
public function set position(_arg1:Number):void{
var _local2 = (m_soundState == PLAYING);
pause();
m_position = _arg1;
if (_local2){
play();
};
}
public function get volume():Number{
return (m_soundChannel.soundTransform.volume);
}
public function get rightPeak():Number{
return (m_soundChannel.rightPeak);
}
public function destroy():void{
stop();
clearTimeout(m_timeout);
m_sound = null;
m_soundChannel = null;
soundsDictionary[this] = null;
}
public function get duration():Number{
return (m_sound.length);
}
public function get position():Number{
return (m_soundChannel.position);
}
public function resume():void{
play(m_volume, m_loops);
}
public function get playing():Boolean{
return ((m_soundState == PLAYING));
}
public function set volume(_arg1:Number):void{
if (m_soundChannel == null){
return;
};
var _local2:SoundTransform = m_soundChannel.soundTransform;
_local2.volume = _arg1;
m_soundChannel.soundTransform = _local2;
}
private function soundComplete(_arg1:Event):void{
m_loops--;
m_soundState = FINISHED;
if (m_loops == 0){
dispatchEvent(new Event(COMPLETE));
if (m_destroy){
destroy();
};
} else {
play(volume, m_loops);
};
}
public static function stopSounds():void{
var item:SoundPlayer;
for each (item in soundsDictionary) {
try {
if (item.stoppable){
item.destroy();
soundsDictionary[item] = null;
};
} catch(e:Error) {
};
};
}
public static function pauseSounds():void{
var item:SoundPlayer;
for each (item in soundsDictionary) {
try {
if (soundsDictionary[item].stoppable){
soundsDictionary[item].pause();
};
} catch(e:Error) {
};
};
}
public static function resumeSounds():void{
var item:SoundPlayer;
for each (item in soundsDictionary) {
try {
soundsDictionary[item].resume();
} catch(e:Error) {
};
};
}
}
}//package com.markfennell.sound
Section 236
//MD5 (com.meychi.ascrypt3.MD5)
package com.meychi.ascrypt3 {
public class MD5 {
public function calculate(_arg1:String):String{
return (hex_md5(_arg1));
}
private static function md5_hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private static function md5_ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private static function md5_cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (safe_add(bit_rol(safe_add(safe_add(_arg2, _arg1), safe_add(_arg4, _arg6)), _arg5), _arg3));
}
private static function binl2hex(_arg1:Array):String{
var _local2:String = new String("");
var _local3:String = new String("0123456789abcdef");
var _local4:Number = 0;
while (_local4 < (_arg1.length * 4)) {
_local2 = (_local2 + (_local3.charAt(((_arg1[(_local4 >> 2)] >> (((_local4 % 4) * 8) + 4)) & 15)) + _local3.charAt(((_arg1[(_local4 >> 2)] >> ((_local4 % 4) * 8)) & 15))));
_local4++;
};
return (_local2);
}
private static function str2binl(_arg1:String):Array{
var _local2:Array = new Array();
var _local3:Number = ((1 << 8) - 1);
var _local4:Number = 0;
while (_local4 < (_arg1.length * 8)) {
_local2[(_local4 >> 5)] = (_local2[(_local4 >> 5)] | ((_arg1.charCodeAt((_local4 / 8)) & _local3) << (_local4 % 32)));
_local4 = (_local4 + 8);
};
return (_local2);
}
private static function md5_gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private static function md5_ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
private static function hex_md5(_arg1:String):String{
return (binl2hex(core_md5(str2binl(_arg1), (_arg1.length * 8))));
}
private static function bit_rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
private static function core_md5(_arg1:Array, _arg2:Number):Array{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
var _local3:Number = 1732584193;
var _local4:Number = -271733879;
var _local5:Number = -1732584194;
var _local6:Number = 271733878;
var _local7:Number = 0;
while (_local7 < _arg1.length) {
_local8 = _local3;
_local9 = _local4;
_local10 = _local5;
_local11 = _local6;
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 7, -680876936);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 1)], 12, -389564586);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 17, 606105819);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 3)], 22, -1044525330);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 7, -176418897);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 5)], 12, 1200080426);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 17, -1473231341);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 7)], 22, -45705983);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 7, 1770035416);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 9)], 12, -1958414417);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 17, -42063);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 11)], 22, -1990404162);
_local3 = md5_ff(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 7, 1804603682);
_local6 = md5_ff(_local6, _local3, _local4, _local5, _arg1[(_local7 + 13)], 12, -40341101);
_local5 = md5_ff(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 17, -1502002290);
_local4 = md5_ff(_local4, _local5, _local6, _local3, _arg1[(_local7 + 15)], 22, 1236535329);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 5, -165796510);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 6)], 9, -1069501632);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 14, 643717713);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 0)], 20, -373897302);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 5, -701558691);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 10)], 9, 38016083);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 14, -660478335);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 4)], 20, -405537848);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 5, 568446438);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 14)], 9, -1019803690);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 14, -187363961);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 8)], 20, 1163531501);
_local3 = md5_gg(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 5, -1444681467);
_local6 = md5_gg(_local6, _local3, _local4, _local5, _arg1[(_local7 + 2)], 9, -51403784);
_local5 = md5_gg(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 14, 1735328473);
_local4 = md5_gg(_local4, _local5, _local6, _local3, _arg1[(_local7 + 12)], 20, -1926607734);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 5)], 4, -378558);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 8)], 11, -2022574463);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 11)], 16, 1839030562);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 14)], 23, -35309556);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 1)], 4, -1530992060);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 4)], 11, 1272893353);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 7)], 16, -155497632);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 10)], 23, -1094730640);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 13)], 4, 681279174);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 0)], 11, -358537222);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 3)], 16, -722521979);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 6)], 23, 76029189);
_local3 = md5_hh(_local3, _local4, _local5, _local6, _arg1[(_local7 + 9)], 4, -640364487);
_local6 = md5_hh(_local6, _local3, _local4, _local5, _arg1[(_local7 + 12)], 11, -421815835);
_local5 = md5_hh(_local5, _local6, _local3, _local4, _arg1[(_local7 + 15)], 16, 530742520);
_local4 = md5_hh(_local4, _local5, _local6, _local3, _arg1[(_local7 + 2)], 23, -995338651);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 0)], 6, -198630844);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 7)], 10, 1126891415);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 14)], 15, -1416354905);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 5)], 21, -57434055);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 12)], 6, 1700485571);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 3)], 10, -1894986606);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 10)], 15, -1051523);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 1)], 21, -2054922799);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 8)], 6, 1873313359);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 15)], 10, -30611744);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 6)], 15, -1560198380);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 13)], 21, 1309151649);
_local3 = md5_ii(_local3, _local4, _local5, _local6, _arg1[(_local7 + 4)], 6, -145523070);
_local6 = md5_ii(_local6, _local3, _local4, _local5, _arg1[(_local7 + 11)], 10, -1120210379);
_local5 = md5_ii(_local5, _local6, _local3, _local4, _arg1[(_local7 + 2)], 15, 718787259);
_local4 = md5_ii(_local4, _local5, _local6, _local3, _arg1[(_local7 + 9)], 21, -343485551);
_local3 = safe_add(_local3, _local8);
_local4 = safe_add(_local4, _local9);
_local5 = safe_add(_local5, _local10);
_local6 = safe_add(_local6, _local11);
_local7 = (_local7 + 16);
};
return (new Array(_local3, _local4, _local5, _local6));
}
private static function safe_add(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
var _local4:Number = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
}
}//package com.meychi.ascrypt3
Section 237
//NavButtonSound (common.sound.NavButtonSound)
package common.sound {
import flash.media.*;
public dynamic class NavButtonSound extends Sound {
}
}//package common.sound
Section 238
//PanelSound (common.sound.PanelSound)
package common.sound {
import flash.media.*;
public dynamic class PanelSound extends Sound {
}
}//package common.sound
Section 239
//PanelSound2 (common.sound.PanelSound2)
package common.sound {
import flash.media.*;
public dynamic class PanelSound2 extends Sound {
}
}//package common.sound
Section 240
//Console (console.Console)
package console {
import flash.events.*;
import com.markfennell.sound.*;
import pages.*;
import interfaces.*;
import org.casalib.display.*;
import flash.net.*;
import com.google.analytics.*;
import org.casalib.util.*;
import game.*;
public class Console extends CasaSprite {
private var m_muted:Boolean;// = false
private var m_isGame:Boolean;// = false
private var m_currentClass:IConsoleSection;// = null
private var m_nextClass:IConsoleSection;// = null
private var m_callBack:Function;
private var m_soundController:SoundController;
private var m_transitioning:Boolean;// = false
public static var firstPlay:Boolean = true;
public static var GoogleAnalytics:AnalyticsTracker;
public static var paused:Boolean = false;
public static var currentState:String;
public function Console(){
m_soundController = new SoundController();
super();
GoogleAnalytics = new GATracker(StageReference.getStage(), Constants.GOOGLE, "AS3", false);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_CREDITS, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_HELP, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_PRIZES, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_VIDEO, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_INTRO, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_MORE, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_PLAYGAME, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_SHARE, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_EMBED, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_SCORES, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.DISPLAY_GAMEOVER, handleConsoleEvent);
addEventListener(ConsoleEvent.TRANSITION_COMPLETE, handleTransitionComplete);
GameBroadcaster.addEventListener(ConsoleEvent.PAUSE, handleConsoleEvent);
GameBroadcaster.addEventListener(ConsoleEvent.EXIT, handleConsoleEvent);
handleConsoleEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_INTRO));
GameBroadcaster.addEventListener(SoundEvent.EFFECT, handleSoundEffect);
GameBroadcaster.addEventListener(ConsoleEvent.GAME_COMPLETE, handleGameComplete);
Console.GoogleAnalytics.trackPageview((Constants.TRACKING_TITLE + "/game/index"));
}
override public function destroy():void{
GameBroadcaster.removeEventListener(ConsoleEvent.DISPLAY_CREDITS, handleConsoleEvent);
GameBroadcaster.removeEventListener(ConsoleEvent.DISPLAY_HELP, handleConsoleEvent);
GameBroadcaster.removeEventListener(ConsoleEvent.DISPLAY_INTRO, handleConsoleEvent);
GameBroadcaster.removeEventListener(ConsoleEvent.DISPLAY_GAMEOVER, handleConsoleEvent);
GameBroadcaster.removeEventListener(ConsoleEvent.DISPLAY_MORE, handleConsoleEvent);
GameBroadcaster.removeEventListener(ConsoleEvent.DISPLAY_PLAYGAME, handleConsoleEvent);
GameBroadcaster.removeEventListener(ConsoleEvent.DISPLAY_SHARE, handleConsoleEvent);
GameBroadcaster.removeEventListener(ConsoleEvent.DISPLAY_EMBED, handleConsoleEvent);
GameBroadcaster.removeEventListener(ConsoleEvent.TRANSITION_COMPLETE, handleTransitionComplete);
GameBroadcaster.removeEventListener(SoundEvent.EFFECT, handleSoundEffect);
GameBroadcaster.removeEventListener(ConsoleEvent.GAME_COMPLETE, handleGameComplete);
m_currentClass.destroy();
m_nextClass.destroy();
super.destroy();
}
private function handleConsoleEvent(_arg1:ConsoleEvent):void{
var e = _arg1;
trace(e.type, currentState, m_transitioning);
if ((((e.type == currentState)) && (!((e.type == ConsoleEvent.PAUSE))))){
return;
};
if (m_transitioning){
return;
};
m_transitioning = true;
if (((!((m_callBack == null))) && (!((e.type == ConsoleEvent.DISPLAY_MORE))))){
m_callBack();
m_callBack = null;
};
switch (e.type){
case ConsoleEvent.PAUSE:
m_transitioning = false;
if (!paused){
if (SoundController.getInstance().soundsEnabled == false){
m_muted = true;
} else {
m_muted = false;
};
m_nextClass.doPause();
SoundController.getInstance().pause_music(true);
SoundController.getInstance().stopSounds();
paused = true;
} else {
m_nextClass.doResume();
if (!m_muted){
SoundController.getInstance().pause_music(false);
SoundController.getInstance().resumeSounds();
};
paused = false;
};
break;
case ConsoleEvent.DISPLAY_INTRO:
if (currentState == ConsoleEvent.DISPLAY_INTRO){
return;
};
SoundController.getInstance().start_music(0, false);
currentState = ConsoleEvent.DISPLAY_INTRO;
m_nextClass = new Title();
addChild((m_nextClass as CasaSprite));
m_nextClass.transitionIn();
break;
case ConsoleEvent.DISPLAY_PRIZES:
if (currentState == ConsoleEvent.DISPLAY_PRIZES){
return;
};
SoundController.getInstance().start_music(0, false);
currentState = ConsoleEvent.DISPLAY_PRIZES;
m_nextClass = new Prizes();
addChild((m_nextClass as CasaSprite));
m_nextClass.transitionIn();
break;
case ConsoleEvent.DISPLAY_HELP:
if (currentState == ConsoleEvent.DISPLAY_HELP){
return;
};
Console.GoogleAnalytics.trackPageview((Constants.TRACKING_TITLE + "/menu/help"));
currentState = ConsoleEvent.DISPLAY_HELP;
m_nextClass = new Help();
addChild((m_nextClass as CasaSprite));
m_nextClass.transitionIn();
break;
case ConsoleEvent.DISPLAY_PLAYGAME:
if (currentState == ConsoleEvent.DISPLAY_PLAYGAME){
return;
};
SoundController.getInstance().resume_music();
currentState = ConsoleEvent.DISPLAY_PLAYGAME;
m_nextClass = new GameController();
addChild((m_nextClass as CasaSprite));
m_nextClass.transitionIn();
break;
case ConsoleEvent.DISPLAY_SCORES:
if (currentState == ConsoleEvent.DISPLAY_SCORES){
return;
};
Console.GoogleAnalytics.trackPageview((Constants.TRACKING_TITLE + "/menu/highScores"));
currentState = ConsoleEvent.DISPLAY_SCORES;
m_nextClass = new Scores();
addChild((m_nextClass as CasaSprite));
m_nextClass.transitionIn();
m_callBack = m_nextClass.hide;
break;
case ConsoleEvent.DISPLAY_CREDITS:
if (currentState == ConsoleEvent.DISPLAY_CREDITS){
return;
};
Console.GoogleAnalytics.trackPageview((Constants.TRACKING_TITLE + "/menu/credits"));
currentState = ConsoleEvent.DISPLAY_CREDITS;
m_nextClass = new Credits();
addChild((m_nextClass as CasaSprite));
m_nextClass.transitionIn();
m_callBack = m_nextClass.hide;
break;
case ConsoleEvent.DISPLAY_VIDEO:
if (currentState == ConsoleEvent.DISPLAY_VIDEO){
return;
};
SoundController.getInstance().pause_music(true);
currentState = ConsoleEvent.DISPLAY_VIDEO;
m_nextClass = new Intro();
addChild((m_nextClass as CasaSprite));
m_nextClass.transitionIn();
m_callBack = m_nextClass.hide;
break;
case ConsoleEvent.DISPLAY_GAMEOVER:
if (currentState == ConsoleEvent.DISPLAY_GAMEOVER){
return;
};
Console.GoogleAnalytics.trackPageview((Constants.TRACKING_TITLE + "/game/gameOver"));
currentState = ConsoleEvent.DISPLAY_GAMEOVER;
m_nextClass = new GameOver();
addChild((m_nextClass as CasaSprite));
m_nextClass.transitionIn();
m_callBack = m_nextClass.hide;
break;
case ConsoleEvent.DISPLAY_MORE:
currentState = ConsoleEvent.DISPLAY_MORE;
Console.GoogleAnalytics.trackPageview((Constants.TRACKING_TITLE + "/linkOut/displayMore"));
navigateToURL(new URLRequest(Constants.URL_MOREGAMES), "_blank");
m_transitioning = false;
break;
case ConsoleEvent.DISPLAY_SHARE:
currentState = ConsoleEvent.DISPLAY_SHARE;
m_transitioning = false;
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "linkOut", "share");
try {
LGAutobotStronghold.ClearSpring.api.menu.show("email");
} catch(e:TypeError) {
trace("could not open clearspring");
navigateToURL(new URLRequest(Constants.URL_MOREGAMES), "_blank");
};
break;
case ConsoleEvent.DISPLAY_EMBED:
currentState = ConsoleEvent.DISPLAY_EMBED;
m_transitioning = false;
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "linkOut", "embed");
try {
LGAutobotStronghold.ClearSpring.api.menu.show();
} catch(e:TypeError) {
trace("could not open clearspring");
navigateToURL(new URLRequest(Constants.URL_MOREGAMES), "_blank");
};
break;
};
}
private function handleGameComplete(_arg1:Event):void{
currentState = ConsoleEvent.GAME_COMPLETE;
}
private function handleSoundEffect(_arg1:SoundEvent):void{
switch (_arg1.type){
case SoundEvent.EFFECT:
SoundController.getInstance().playSound(_arg1);
break;
};
}
private function handleTransitionComplete(_arg1:ConsoleEvent):void{
m_transitioning = false;
if (m_currentClass){
m_currentClass.destroy();
};
m_currentClass = m_nextClass;
}
}
}//package console
Section 241
//ConsoleEvent (console.ConsoleEvent)
package console {
import flash.events.*;
public class ConsoleEvent extends Event {
public var data;
public static var DISPLAY_GAMEOVER:String = "ConsoleDisplayGameover";
public static var DISPLAY_VIDEO:String = "ConsoleDisplayVideo";
public static var DISPLAY_MORE:String = "ConsoleDisplayMore";
public static var PAUSE:String = "GamePause";
public static var DISPLAY_MEDALS:String = "ConsoleDisplayMedals";
public static var DISPLAY_EMBED:String = "ConsoleDisplayEmbed";
public static var DISPLAY_CREDITS:String = "ConsoleDisplayCredits";
public static var DISPLAY_SCORES:String = "ConsoleDisplayScores";
public static var STARTED:String = "GameStarted";
public static var DISPLAY_PLAYGAME:String = "ConsoleDisplayPlayGame";
public static var GAME_COMPLETE:String = "Game Completed";
public static var DISPLAY_EASTER:String = "ConsoleDisplayEaster";
public static var PAUSE_DISABLED:String = "PauseDisabled";
public static var DISPLAY_SHARE:String = "ConsoleDisplaySendToFriend";
public static var TRANSITION_COMPLETE:String = "Transition COmplete";
public static var DISPLAY_LEVELS:String = "ConsoleDisplayLevelSelect";
public static var DISPLAY_PRIZES:String = "ConsoleDisplayPrizes";
public static var DISPLAY_INTRO:String = "ConsoleDisplayIntro";
public static var RESUME:String = "GameResume";
public static var EXIT:String = "GameExit";
public static var DISPLAY_HELP:String = "ConsoleDisplayHelp";
public static var PAUSE_ENABLED:String = "PauseEnabled";
public function ConsoleEvent(_arg1:String, _arg2=null){
super(_arg1, true, true);
data = _arg2;
}
override public function clone():Event{
return (new ConsoleEvent(type, data));
}
}
}//package console
Section 242
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintColor:Number;// = 0
private var _tintMultiplier:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
private function deriveTintColor():uint{
var _local1:Number = (1 / this.tintMultiplier);
var _local2:uint = Math.round((this.redOffset * _local1));
var _local3:uint = Math.round((this.greenOffset * _local1));
var _local4:uint = Math.round((this.blueOffset * _local1));
var _local5:uint = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function set brightness(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
var _local2:Number = (1 - Math.abs(_arg1));
var _local3:Number = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
private function parseXML(_arg1:XML=null):Color{
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
var _local2:XML = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function setTint(_arg1:uint, _arg2:Number):void{
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
var _local3:uint = ((_arg1 >> 16) & 0xFF);
var _local4:uint = ((_arg1 >> 8) & 0xFF);
var _local5:uint = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = ((_arg1 >> 24) & 0xFF);
var _local6:uint = ((_arg1 >> 16) & 0xFF);
var _local7:uint = ((_arg1 >> 8) & 0xFF);
var _local8:uint = (_arg1 & 0xFF);
var _local9:uint = ((_arg2 >> 24) & 0xFF);
var _local10:uint = ((_arg2 >> 16) & 0xFF);
var _local11:uint = ((_arg2 >> 8) & 0xFF);
var _local12:uint = (_arg2 & 0xFF);
var _local13:uint = ((_local5 * _local4) + (_local9 * _arg3));
var _local14:uint = ((_local6 * _local4) + (_local10 * _arg3));
var _local15:uint = ((_local7 * _local4) + (_local11 * _arg3));
var _local16:uint = ((_local8 * _local4) + (_local12 * _arg3));
var _local17:uint = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number = (1 - _arg3);
var _local5:ColorTransform = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 243
//QuizScreen (form.screen.QuizScreen)
package form.screen {
import flash.display.*;
import flash.text.*;
public dynamic class QuizScreen extends MovieClip {
public var t_score:TextField;
public var error1:MovieClip;
public var submitScore:MovieClip;
public var t_name:TextField;
public var quizMain:MovieClip;
public var playAgain:MovieClip;
public var t_name_bg:MovieClip;
}
}//package form.screen
Section 244
//SubmitScreen (form.screen.SubmitScreen)
package form.screen {
import flash.display.*;
import flash.text.*;
public dynamic class SubmitScreen extends MovieClip {
public var submitDetails:MovieClip;
public var error1:MovieClip;
public var error3:MovieClip;
public var error4:MovieClip;
public var error5:MovieClip;
public var error6:MovieClip;
public var error2:MovieClip;
public var t_email:TextField;
public var t_firstname:TextField;
public var optionalUI:MovieClip;
public var selectYesNo:MovieClip;
public var tickPromo:MovieClip;
public var t_lastname:TextField;
public var t_mobile:TextField;
public var tickTerms:MovieClip;
public var t_essay:TextField;
}
}//package form.screen
Section 245
//Chunk (game.effects.Chunk)
package game.effects {
import flash.events.*;
import flash.display.*;
import assets.effects.*;
public class Chunk extends MovieClip {
private var m_angle:Number;
private var m_steps:int;
private var m_step:int;// = 0
private var m_vx:Number;
private var m_vy:Number;
private var m_chunkUI:ChunkUI;
private var m_force:Number;
private var m_chunkForceMax:Number;// = 12
private var m_gravity:Number;// = 1
private var m_angleInc:Number;
public function Chunk(_arg1:int, _arg2:int, _arg3:Number):void{
m_steps = ((Math.random() * 80) + 30);
m_angle = (Math.random() * Math.PI);
m_angleInc = ((Math.random() * 0.1) + 0.1);
super();
m_chunkUI = new ChunkUI();
m_chunkUI.x = (_arg1 + (Math.random() * 4));
m_chunkUI.y = _arg2;
m_chunkUI.scaleX = 0.4;
m_chunkUI.scaleY = 0.4;
m_force = ((Math.random() * 5) + 3);
m_chunkUI.rotation = (Math.random() * 360);
m_chunkUI.cacheAsBitmap = true;
addChild(m_chunkUI);
m_chunkUI.gotoAndStop((int((Math.random() * 10)) + 1));
m_vx = ((Math.random() * m_force) - (m_force / 2));
m_vy = ((Math.random() * m_force) - (m_force / 2));
addEventListener(Event.ENTER_FRAME, render);
}
private function render(_arg1:Event):void{
var _local2:Number = (Math.sin(m_angle) * 0.6);
m_step++;
if (_local2 <= 0){
removeEventListener(Event.ENTER_FRAME, render);
removeChild(m_chunkUI);
m_chunkUI = null;
if (this.parent != null){
this.parent.removeChild(this);
};
} else {
m_chunkUI.x = (m_chunkUI.x + m_vx);
m_chunkUI.y = (m_chunkUI.y + m_vy);
m_vx = (m_vx * 0.95);
m_vy = (m_vy * 0.95);
m_angle = (m_angle + m_angleInc);
m_chunkUI.scaleX = (0.2 + Math.abs(_local2));
m_chunkUI.scaleY = (0.2 + Math.abs(_local2));
};
}
}
}//package game.effects
Section 246
//EffectsController (game.effects.EffectsController)
package game.effects {
import flash.display.*;
import game.events.*;
import flash.geom.*;
import interfaces.*;
import org.casalib.display.*;
import game.enemies.*;
import game.*;
import assets.effects.*;
public class EffectsController extends CasaSprite {
private var m_fadeCountdown:int;
private var m_mapScarBitmapData:BitmapData;
private var m_map:CasaSprite;
private var m_explosionCountdownArray:Array;
private var m_explosionArray:Array;
private var m_scar:BitmapData;
private var m_mapScarContainer:CasaBitmap;
private var m_fadeFrequency:int;// = 600
private var m_explosionContainer:CasaSprite;
public function EffectsController(_arg1:CasaSprite){
m_map = _arg1;
m_fadeCountdown = m_fadeFrequency;
m_explosionArray = [];
m_explosionCountdownArray = [];
this.mouseChildren = false;
this.mouseEnabled = false;
var _local2:MovieClip = new MapScar();
m_scar = new BitmapData(_local2.width, _local2.height, true, 0);
m_scar.draw(_local2);
m_mapScarBitmapData = new BitmapData(m_map.width, m_map.height, true, 0);
m_mapScarContainer = new CasaBitmap(m_mapScarBitmapData);
m_map.addChild(m_mapScarContainer);
m_explosionContainer = new CasaSprite();
addChild(m_explosionContainer);
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_KILLED, enemyKilledHandler, false, 0, true);
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_OBJECTIVE, enemyKilledHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.ROCKET_DETONATE, rocketDetonationHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.MORTAR_DETONATE, mortarDetonationHandler, false, 0, true);
}
public function doRender():void{
var _local1:ColorTransform;
var _local2:Rectangle;
m_fadeCountdown--;
if (m_fadeCountdown == 0){
m_fadeCountdown = m_fadeFrequency;
_local1 = new ColorTransform();
_local1.alphaMultiplier = 0.9;
_local2 = new Rectangle(0, 0, m_map.width, m_map.height);
m_mapScarBitmapData.colorTransform(_local2, _local1);
};
}
override public function destroy():void{
var _local2:CasaSprite;
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_KILLED, enemyKilledHandler);
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_OBJECTIVE, enemyKilledHandler);
GameBroadcaster.removeEventListener(WeaponEvent.ROCKET_DETONATE, rocketDetonationHandler);
GameBroadcaster.removeEventListener(WeaponEvent.MORTAR_DETONATE, mortarDetonationHandler);
var _local1:int;
while (_local1 < m_explosionArray.length) {
_local2 = m_explosionArray[_local1];
m_explosionArray.splice(_local1, 1);
m_explosionCountdownArray.splice(_local1, 1);
_local2.destroy();
_local2 = null;
_local1++;
};
m_explosionContainer.destroy();
m_mapScarContainer.destroy();
}
private function rocketDetonationHandler(_arg1:WeaponEvent):void{
var _local6:RocketExplosion;
var _local2:IWeapon = _arg1.weaponObject;
var _local3:Object = _local2.getPosition();
var _local4:Number = _local3.x;
var _local5:Number = _local3.y;
_local6 = new RocketExplosion();
_local6.x = _local4;
_local6.y = _local5;
m_explosionContainer.addChild(_local6);
m_explosionArray.push(_local6);
m_explosionCountdownArray.push(20);
}
private function scarMap(_arg1:int, _arg2:int):void{
var _local3:Rectangle = new Rectangle(0, 0, m_scar.width, m_scar.height);
var _local4:Point = new Point(_arg1, _arg2);
m_mapScarBitmapData.copyPixels(m_scar, _local3, _local4, null, null, true);
}
private function enemyKilledHandler(_arg1:EnemyEvent):void{
var _local6:int;
var _local2:IEnemy = _arg1.enemyObject;
var _local3:Object = _local2.getPosition();
var _local4:Number = _local3.x;
var _local5:Number = _local3.y;
if ((_local2 is Insecticon)){
_local6 = 15;
} else {
if ((_local2 is Shockwave)){
_local6 = 19;
} else {
if ((_local2 is Galvatron)){
_local6 = 19;
} else {
if ((_local2 is Ravage)){
_local6 = 15;
} else {
if ((_local2 is Starscream)){
_local6 = 15;
} else {
if ((_local2 is Brunt)){
_local6 = 29;
};
};
};
};
};
};
var _local7:Explosion = new Explosion(this, (_local4 + Map.tileHalfW), (_local5 + Map.tileHalfH), _local6);
if ((_local2 is ILandEnemy)){
scarMap(_local4, _local5);
};
}
private function mortarDetonationHandler(_arg1:WeaponEvent):void{
var _local2:IWeapon = _arg1.weaponObject;
var _local3:Object = _local2.getPosition();
var _local4:Number = _local3.x;
var _local5:Number = _local3.y;
var _local6:MortarExplosion = new MortarExplosion();
_local6.x = _local4;
_local6.y = _local5;
m_explosionContainer.addChild(_local6);
m_explosionArray.push(_local6);
m_explosionCountdownArray.push(20);
}
public function doPhysics():void{
var _local2:CasaSprite;
var _local1:int;
while (_local1 < m_explosionArray.length) {
var _local3 = m_explosionCountdownArray;
var _local4 = _local1;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
if (m_explosionCountdownArray[_local1] <= 0){
_local2 = m_explosionArray[_local1];
m_explosionArray.splice(_local1, 1);
m_explosionCountdownArray.splice(_local1, 1);
_local2.destroy();
_local2 = null;
};
_local1++;
};
}
}
}//package game.effects
Section 247
//Explosion (game.effects.Explosion)
package game.effects {
import flash.events.*;
import flash.display.*;
import com.markfennell.display.*;
public class Explosion extends EventDispatcher {
private var m_particlePerCycle:Number;
private var m_particleCycles:Number;
private var m_rumbleForce:Number;
private var m_forceMax:Number;// = 100
private var m_particleCount:int;
private var m_chunkMax:int;// = 0
private var m_force:Number;
private var m_particleExplosion:Boolean;// = false
private var m_particleArray:Array;
private var m_container:Sprite;
private var m_particleCycle:Number;// = 0
private var m_sx:Number;
private var m_sy:Number;
private var m_forceMin:Number;// = 0
private var m_chunks:int;// = 0
public function Explosion(_arg1:Sprite, _arg2:int, _arg3:int, _arg4:Number){
m_particleArray = new Array();
super();
m_force = Math.min(m_forceMax, Math.max(m_forceMin, _arg4));
m_container = _arg1;
m_rumbleForce = (((m_force / 100) * 10) + 2);
m_sx = _arg2;
m_sy = _arg3;
if (m_force < 10){
m_particlePerCycle = 2;
m_particleCycles = 2;
m_chunkMax = 0;
} else {
if (m_force < 20){
m_particlePerCycle = 2;
m_particleCycles = 2;
m_chunkMax = 28;
} else {
if (m_force < 40){
m_particlePerCycle = 2;
m_particleCycles = 2;
m_chunkMax = 28;
} else {
if ((((m_force >= 40)) && ((m_force < 50)))){
m_particlePerCycle = 3;
m_particleCycles = 3;
m_chunkMax = 50;
} else {
m_particlePerCycle = 3;
m_particleCycles = 2;
m_chunkMax = 70;
};
};
};
};
m_container.addEventListener(Event.ENTER_FRAME, render);
}
public function render(_arg1:Event):void{
var _local3:Particle;
var _local4:Chunk;
m_particleCycle++;
if (m_particleCycle == 1){
Earthquake.go(m_container, m_rumbleForce, 0.15);
};
var _local2:int;
while (_local2 < m_particlePerCycle) {
m_chunks++;
if (m_chunks < m_chunkMax){
_local4 = new Chunk(m_sx, m_sy, m_force);
m_container.addChild(_local4);
};
_local3 = new Particle(m_sx, m_sy, m_force, true);
m_container.addChild(_local3);
_local2++;
};
if (m_particleCycle > m_particleCycles){
m_container.removeEventListener(Event.ENTER_FRAME, render);
};
}
}
}//package game.effects
Section 248
//MortarExplosion (game.effects.MortarExplosion)
package game.effects {
import flash.display.*;
import org.casalib.display.*;
import assets.effects.*;
public class MortarExplosion extends CasaSprite {
private var m_container:MovieClip;
public function MortarExplosion(){
m_container = new MortarExplosionAnim();
addChild(m_container);
}
override public function destroy():void{
m_container.stop();
removeChild(m_container);
super.destroy();
}
}
}//package game.effects
Section 249
//Particle (game.effects.Particle)
package game.effects {
import flash.events.*;
import flash.display.*;
import assets.effects.*;
public class Particle extends MovieClip {
private var m_explodeUI:ExplodeUI;
private var m_damping:Number;// = 0.3
private var m_vx:Number;
private var m_vy:Number;
private var m_vz:Number;
private var m_force:Number;
private var m_gravity:Number;
private var m_particleSprite:ParticleUI;
public function Particle(_arg1:int, _arg2:int, _arg3:Number, _arg4:Boolean):void{
m_force = _arg3;
m_particleSprite = new ParticleUI();
m_particleSprite.x = (_arg1 + (Math.random() * 4));
m_particleSprite.y = (_arg2 + (Math.random() * 4));
m_particleSprite.rotation = (Math.random() * 360);
m_particleSprite.scaleX = (m_particleSprite.scaleY = ((m_force + (Math.random() * -10)) / 60));
m_damping = (m_damping * ((m_force + (Math.random() * -10)) / 60));
_arg4 = true;
addChild(m_particleSprite);
if (Math.random() > 0.3){
m_particleSprite.blendMode = BlendMode.HARDLIGHT;
} else {
m_particleSprite.blendMode = BlendMode.ADD;
};
m_particleSprite.addEventListener(Event.ENTER_FRAME, render);
if (m_force < 10){
if (Math.random() > 0.8){
m_particleSprite.gotoAndPlay((int((Math.random() * 5)) + 15));
} else {
m_particleSprite.gotoAndPlay((int((Math.random() * 5)) + 15));
};
} else {
if (Math.random() > 0.8){
m_particleSprite.gotoAndPlay((int((Math.random() * 20)) + 1));
};
};
m_vx = (((Math.random() * 2) * m_force) - m_force);
m_vy = (Math.random() * -(m_force));
m_gravity = (Math.random() + 0.7);
m_explodeUI = new ExplodeUI();
m_explodeUI.x = (_arg1 + (Math.random() * 4));
m_explodeUI.y = (_arg2 + (Math.random() * 4));
addChild(m_explodeUI);
m_explodeUI.rotation = (Math.random() * 360);
m_explodeUI.scaleX = (m_explodeUI.scaleY = (m_force / 60));
m_explodeUI.cacheAsBitmap = true;
m_explodeUI.addEventListener(Event.ENTER_FRAME, renderExplosion);
if (Math.random() > 0.5){
m_explodeUI.blendMode = BlendMode.ADD;
} else {
m_explodeUI.blendMode = BlendMode.OVERLAY;
};
}
private function render(_arg1:Event):void{
if (m_particleSprite.currentFrame == m_particleSprite.totalFrames){
m_particleSprite.removeEventListener(Event.ENTER_FRAME, render);
removeChild(m_particleSprite);
m_particleSprite = null;
if (this.parent != null){
this.parent.removeChild(this);
};
} else {
m_particleSprite.x = (m_particleSprite.x + m_vx);
m_particleSprite.y = (m_particleSprite.y + m_vy);
if (m_explodeUI){
m_explodeUI.x = (m_explodeUI.x + m_vx);
m_explodeUI.y = (m_explodeUI.y + m_vy);
};
m_particleSprite.scaleX = (m_particleSprite.scaleX + 0.018);
m_particleSprite.scaleY = (m_particleSprite.scaleY + 0.018);
m_vx = (m_vx * m_damping);
m_vy = (m_vy * m_damping);
};
}
private function renderExplosion(_arg1:Event):void{
if (m_explodeUI.currentFrame == m_explodeUI.totalFrames){
m_explodeUI.removeEventListener(Event.ENTER_FRAME, renderExplosion);
removeChild(m_explodeUI);
m_explodeUI = null;
};
}
}
}//package game.effects
Section 250
//RocketExplosion (game.effects.RocketExplosion)
package game.effects {
import flash.display.*;
import org.casalib.display.*;
import assets.effects.*;
public class RocketExplosion extends CasaSprite {
private var m_container:MovieClip;
public function RocketExplosion(){
m_container = new RocketExplosionAnim();
addChild(m_container);
}
override public function destroy():void{
m_container.stop();
removeChild(m_container);
super.destroy();
}
}
}//package game.effects
Section 251
//BaseEnemy (game.enemies.BaseEnemy)
package game.enemies {
import flash.display.*;
import game.events.*;
import flash.geom.*;
import interfaces.*;
import org.casalib.display.*;
import fl.motion.*;
import game.*;
public class BaseEnemy extends CasaSprite implements IEnemy {
protected const m_FINISHED:int = 2;
protected const m_ALIVE:int = 0;
protected const m_DEAD:int = 1;
protected var m_slowdownCountdown:int;// = 0
protected var m_rotation:Number;
protected var m_ticksPerFrame:Number;
protected var m_routeArray:Array;
protected var m_speedFactor:Number;// = 1
protected var m_y:Number;
protected var m_x:Number;
protected var m_container:MovieClip;
protected var m_targetableCountdown:int;
protected var m_state:int;
protected var m_score:int;
protected var m_healthBar:HealthBar;
protected var m_isTargetable:Boolean;
protected var m_healthOriginal:Number;
protected var m_money:int;
protected var m_health:Number;
protected var m_speed:Number;
protected var m_ticksPerFrameCountdown:Number;// = 0
public function BaseEnemy(_arg1:Array, _arg2:Number, _arg3:int, _arg4:int, _arg5:int){
m_x = (Map.tileW * _arg1[0].x);
m_y = (Map.tileH * _arg1[0].y);
m_routeArray = _arg1;
m_speed = _arg2;
m_healthOriginal = _arg3;
m_health = m_healthOriginal;
m_money = _arg4;
m_score = _arg5;
m_state = m_ALIVE;
m_isTargetable = false;
m_targetableCountdown = int(((Map.tileW * 2) / m_speed));
}
public function doRender():void{
m_container.rotation = m_rotation;
this.x = m_x;
this.y = m_y;
}
override public function destroy():void{
m_healthBar.destroy();
super.destroy();
}
protected function navStep():void{
m_routeArray.shift();
if (m_routeArray.length == 1){
trace("BaseEnemy hit objective");
m_state = m_FINISHED;
GameBroadcaster.dispatchEvent(new EnemyEvent(EnemyEvent.ENEMY_OBJECTIVE, this));
playDeathSound();
};
}
public function getMoney():int{
return (m_money);
}
public function getPosition():Object{
var _local1:Object = {};
_local1.x = m_x;
_local1.y = m_y;
_local1.rotation = m_rotation;
return (_local1);
}
public function isTargetable():Boolean{
return (m_isTargetable);
}
public function doHurt(_arg1:int):void{
trace(("BaseEnemy hurt: " + _arg1));
m_health = (m_health - _arg1);
m_healthBar.setHealth((m_health / m_healthOriginal));
if (m_health <= 0){
m_state = m_DEAD;
trace("BaseEnemy dead");
GameBroadcaster.dispatchEvent(new EnemyEvent(EnemyEvent.ENEMY_KILLED, this));
playDeathSound();
};
}
public function doPhysics():void{
if (m_state == m_ALIVE){
doNavigation();
doWalk();
doAssessTargetability();
};
}
public function getSpeedFactor():Number{
return (m_speedFactor);
}
public function doSlowdown(_arg1:Number, _arg2:Number):void{
trace(((("BaseEnemy doSlowdown: " + _arg1) + " for: ") + _arg2));
m_slowdownCountdown = (m_slowdownCountdown + _arg2);
m_speedFactor = _arg1;
var _local3:Color = new Color();
_local3.setTint(0x6600, 0.4);
m_container.transform.colorTransform = _local3;
}
protected function playDeathSound():void{
}
public function getScore():int{
return (m_score);
}
protected function doAssessTargetability():void{
if (!m_isTargetable){
m_targetableCountdown--;
if (m_targetableCountdown <= 0){
m_isTargetable = true;
};
};
}
protected function doWalk():void{
var _local1:int;
m_ticksPerFrameCountdown--;
if (m_ticksPerFrameCountdown <= 0){
m_ticksPerFrameCountdown = m_ticksPerFrame;
_local1 = (m_container.currentFrame + 1);
if (_local1 > m_container.totalFrames){
_local1 = 1;
};
m_container.gotoAndStop(_local1);
};
}
protected function doNavigation():void{
if (m_slowdownCountdown > 0){
m_slowdownCountdown--;
if (m_slowdownCountdown == 0){
m_speedFactor = 1;
m_container.transform.colorTransform = new ColorTransform();
};
};
var _local1:Number = (m_speed * m_speedFactor);
var _local2:int = Map.tileW;
var _local3:int = Map.tileH;
if (m_routeArray[1].x < m_routeArray[0].x){
m_rotation = 270;
m_x = (m_x - _local1);
if (m_x < (m_routeArray[1].x * _local2)){
m_x = (m_routeArray[1].x * _local2);
navStep();
};
} else {
if (m_routeArray[1].x > m_routeArray[0].x){
m_rotation = 90;
m_x = (m_x + _local1);
if (m_x > (m_routeArray[1].x * _local2)){
m_x = (m_routeArray[1].x * _local2);
navStep();
};
} else {
if (m_routeArray[1].y > m_routeArray[0].y){
m_rotation = 180;
m_y = (m_y + _local1);
if (m_y > (m_routeArray[1].y * _local3)){
m_y = (m_routeArray[1].y * _local3);
navStep();
};
} else {
m_rotation = 0;
m_y = (m_y - _local1);
if (m_y < (m_routeArray[1].y * _local3)){
m_y = (m_routeArray[1].y * _local3);
navStep();
};
};
};
};
}
}
}//package game.enemies
Section 252
//Brunt (game.enemies.Brunt)
package game.enemies {
import com.markfennell.sound.*;
import interfaces.*;
import game.*;
import assets.enemies.*;
public class Brunt extends BaseEnemy implements ILandEnemy {
public function Brunt(_arg1:Array, _arg2:Number, _arg3:int, _arg4:int, _arg5:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
m_container = new Brunt();
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_ticksPerFrame = 8;
m_healthBar = new HealthBar();
addChild(m_healthBar);
m_healthBar.x = 5;
m_healthBar.y = 1;
}
override protected function playDeathSound():void{
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.explosions.BruntExplosion", 1, 1, false));
}
}
}//package game.enemies
Section 253
//EnemyController (game.enemies.EnemyController)
package game.enemies {
import flash.utils.*;
import game.events.*;
import org.casalib.display.*;
import game.*;
public class EnemyController extends CasaSprite {
private var m_landContainer:CasaSprite;
private var m_airContainer:CasaSprite;
public static const INSECTICON:String = "insecticon";
public static const STARSCREAM:String = "starscream";
public static const BRUNT:String = "brunt";
public static const RAVAGE:String = "ravage";
public static const GALVATRON:String = "galvatron";
public static const SHOCKWAVE:String = "shockwave";
public function EnemyController(_arg1:CasaSprite, _arg2:CasaSprite){
EnemyData.instance.emptyArray();
m_landContainer = _arg1;
m_airContainer = _arg2;
m_airContainer.mouseChildren = false;
m_airContainer.mouseEnabled = false;
initTables();
GameBroadcaster.addEventListener(EnemyEvent.SPAWN_ENEMY, spawnEnemyHandler, false, 0, true);
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_KILLED, enemyKilledHandler, false, 0, true);
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_OBJECTIVE, enemyObjectiveHandler, false, 0, true);
trace("EC online");
}
public function doRender():void{
var _local1:Array = EnemyData.instance.enemyArray;
var _local2:int;
while (_local2 < _local1.length) {
BaseEnemy(_local1[_local2]).doRender();
_local2++;
};
}
public function doPhysics():void{
var _local1:Array = EnemyData.instance.enemyArray;
var _local2:int;
while (_local2 < _local1.length) {
BaseEnemy(_local1[_local2]).doPhysics();
_local2++;
};
}
private function enemyKilledHandler(_arg1:EnemyEvent):void{
trace(("EC dead: " + _arg1.enemyObject));
var _local2:BaseEnemy = _arg1.enemyObject;
EnemyData.instance.enemyArray.splice(EnemyData.instance.enemyArray.indexOf(_local2), 1);
_local2.destroy();
}
private function initTables():void{
var _local1:Dictionary = EnemyData.instance.speedTable;
var _local2:Dictionary = EnemyData.instance.moneyTable;
var _local3:Dictionary = EnemyData.instance.scoreTable;
_local1[INSECTICON] = 1;
_local1[GALVATRON] = 0.75;
_local1[SHOCKWAVE] = 1;
_local1[STARSCREAM] = 0.75;
_local1[RAVAGE] = 2;
_local1[BRUNT] = 0.3;
_local2[INSECTICON] = 1;
_local2[GALVATRON] = 2;
_local2[SHOCKWAVE] = 2;
_local2[STARSCREAM] = 1;
_local2[RAVAGE] = 1;
_local2[BRUNT] = 10;
_local3[INSECTICON] = 100;
_local3[GALVATRON] = 500;
_local3[SHOCKWAVE] = 250;
_local3[STARSCREAM] = 350;
_local3[RAVAGE] = 400;
_local3[BRUNT] = 1000;
}
private function enemyObjectiveHandler(_arg1:EnemyEvent):void{
var _local2:BaseEnemy;
trace(("EC objective: " + _arg1.enemyObject));
if (EnemyData.instance.enemyArray.indexOf(_arg1.enemyObject) < 0){
trace("ERROR! this enemy is already out of our array!");
} else {
_local2 = _arg1.enemyObject;
EnemyData.instance.enemyArray.splice(EnemyData.instance.enemyArray.indexOf(_local2), 1);
_local2.destroy();
};
}
override public function destroy():void{
var _local1:Array = EnemyData.instance.enemyArray;
var _local2:int;
while (_local2 < _local1.length) {
BaseEnemy(_local1[_local2]).destroy();
_local1[_local2] = null;
_local2++;
};
GameBroadcaster.removeEventListener(EnemyEvent.SPAWN_ENEMY, spawnEnemyHandler);
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_KILLED, enemyKilledHandler);
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_OBJECTIVE, enemyObjectiveHandler);
EnemyData.instance.emptyArray();
trace("EnemyController destroy");
super.destroy();
}
private function spawnEnemyHandler(_arg1:EnemyEvent):void{
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:BaseEnemy;
var _local2:Array = Map.getRoutes();
var _local3:Array = [];
var _local4:int;
while (_local4 < _local2[_arg1.routeID].length) {
_local3[_local4] = _local2[_arg1.routeID][_local4];
_local4++;
};
_local9 = _arg1.health;
var _local5:Dictionary = EnemyData.instance.speedTable;
var _local6:Dictionary = EnemyData.instance.moneyTable;
var _local7:Dictionary = EnemyData.instance.scoreTable;
if (_arg1.enemyType == INSECTICON){
_local8 = _local5[INSECTICON];
_local10 = _local6[INSECTICON];
_local11 = _local7[INSECTICON];
_local12 = new Insecticon(_local3, _local8, _local9, _local10, _local11);
} else {
if (_arg1.enemyType == GALVATRON){
_local8 = _local5[GALVATRON];
_local10 = _local6[GALVATRON];
_local11 = _local7[GALVATRON];
_local12 = new Galvatron(_local3, _local8, _local9, _local10, _local11);
} else {
if (_arg1.enemyType == SHOCKWAVE){
_local8 = _local5[SHOCKWAVE];
_local10 = _local6[SHOCKWAVE];
_local11 = _local7[SHOCKWAVE];
_local12 = new Shockwave(_local3, _local8, _local9, _local10, _local11);
} else {
if (_arg1.enemyType == RAVAGE){
_local8 = _local5[RAVAGE];
_local10 = _local6[RAVAGE];
_local11 = _local7[RAVAGE];
_local12 = new Ravage(_local3, _local8, _local9, _local10, _local11);
} else {
if (_arg1.enemyType == STARSCREAM){
_local8 = _local5[STARSCREAM];
_local10 = _local6[STARSCREAM];
_local11 = _local7[STARSCREAM];
_local12 = new Starscream(_local3, _local8, _local9, _local10, _local11);
} else {
if (_arg1.enemyType == BRUNT){
_local8 = _local5[BRUNT];
_local10 = _local6[BRUNT];
_local11 = _local7[BRUNT];
_local12 = new Brunt(_local3, _local8, _local9, _local10, _local11);
};
};
};
};
};
};
trace(((("enemyController spawning new: " + _arg1.enemyType) + " on route: ") + _arg1.routeID));
if (_arg1.enemyType == STARSCREAM){
m_airContainer.addChild(_local12);
} else {
m_landContainer.addChild(_local12);
};
EnemyData.instance.enemyArray.push(_local12);
}
}
}//package game.enemies
Section 254
//EnemyData (game.enemies.EnemyData)
package game.enemies {
import flash.events.*;
import flash.utils.*;
public class EnemyData extends EventDispatcher {
private var m_moneyTable:Dictionary;
private var m_enemyArray:Array;
private var m_scoreTable:Dictionary;
private var m_speedTable:Dictionary;
private static var m_instance:EnemyData = new (EnemyData);
;
public function EnemyData(){
if (m_instance){
throw (new Error("Error: EnemyData is a Singleton, and can only be accessed through EnemyData.instance"));
};
m_instance = this;
m_enemyArray = [];
m_speedTable = new Dictionary();
m_moneyTable = new Dictionary();
m_scoreTable = new Dictionary();
}
public function get scoreTable():Dictionary{
return (m_scoreTable);
}
public function emptyArray():void{
m_enemyArray = [];
m_speedTable = new Dictionary();
m_moneyTable = new Dictionary();
m_scoreTable = new Dictionary();
}
public function get enemyArray():Array{
return (m_enemyArray);
}
public function get moneyTable():Dictionary{
return (m_moneyTable);
}
public function get speedTable():Dictionary{
return (m_speedTable);
}
public static function get instance():EnemyData{
return (m_instance);
}
}
}//package game.enemies
Section 255
//Galvatron (game.enemies.Galvatron)
package game.enemies {
import com.markfennell.sound.*;
import interfaces.*;
import game.*;
import assets.enemies.*;
public class Galvatron extends BaseEnemy implements ILandEnemy {
public function Galvatron(_arg1:Array, _arg2:Number, _arg3:int, _arg4:int, _arg5:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
m_container = new Galvatron();
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_ticksPerFrame = 8;
m_healthBar = new HealthBar();
addChild(m_healthBar);
m_healthBar.x = 5;
m_healthBar.y = 1;
}
override protected function playDeathSound():void{
var _local2:String;
var _local1:int = Math.round((Math.random() * 1));
if (_local1 == 0){
_local2 = "assets.sfx.explosions.StarscreamExplosion";
} else {
_local2 = "assets.sfx.explosions.GalvatronExplosion";
};
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, _local2, 1, 1, false));
}
}
}//package game.enemies
Section 256
//HealthBar (game.enemies.HealthBar)
package game.enemies {
import flash.display.*;
import org.casalib.display.*;
import assets.enemies.*;
public class HealthBar extends CasaSprite {
private var container:MovieClip;
public function HealthBar(){
container = new HealthBar();
this.addChild(container);
}
public function setHealth(_arg1:Number):void{
if ((((_arg1 >= 0)) && ((_arg1 <= 1)))){
container.green_mc.width = (container.red_mc.width * _arg1);
} else {
if (_arg1 > 1){
container.green_mc.width = container.red_mc.width;
} else {
container.green_mc.width = 0;
};
};
}
}
}//package game.enemies
Section 257
//Insecticon (game.enemies.Insecticon)
package game.enemies {
import com.markfennell.sound.*;
import interfaces.*;
import game.*;
import assets.enemies.*;
public class Insecticon extends BaseEnemy implements ILandEnemy {
public function Insecticon(_arg1:Array, _arg2:Number, _arg3:int, _arg4:int, _arg5:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
m_container = new Insecticon();
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_ticksPerFrame = 8;
m_healthBar = new HealthBar();
addChild(m_healthBar);
m_healthBar.x = 5;
m_healthBar.y = 1;
}
override public function destroy():void{
super.destroy();
}
override protected function playDeathSound():void{
var _local2:String;
var _local1:int = Math.round((Math.random() * 1));
if (_local1 == 0){
_local2 = "assets.sfx.explosions.InsecticonExplosion";
} else {
_local2 = "assets.sfx.explosions.ShockwaveExplosion";
};
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, _local2, 1, 1, false));
}
}
}//package game.enemies
Section 258
//Ravage (game.enemies.Ravage)
package game.enemies {
import com.markfennell.sound.*;
import interfaces.*;
import game.*;
import assets.enemies.*;
public class Ravage extends BaseEnemy implements ILandEnemy {
public function Ravage(_arg1:Array, _arg2:Number, _arg3:int, _arg4:int, _arg5:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
m_container = new Ravage();
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_ticksPerFrame = 8;
m_healthBar = new HealthBar();
addChild(m_healthBar);
m_healthBar.x = 5;
m_healthBar.y = 1;
}
override protected function playDeathSound():void{
var _local2:String;
var _local1:int = Math.round((Math.random() * 1));
if (_local1 == 0){
_local2 = "assets.sfx.explosions.ShockwaveExplosion";
} else {
_local2 = "assets.sfx.explosions.RavageExplosion";
};
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, _local2, 1, 1, false));
}
}
}//package game.enemies
Section 259
//Shockwave (game.enemies.Shockwave)
package game.enemies {
import com.markfennell.sound.*;
import interfaces.*;
import game.*;
import assets.enemies.*;
public class Shockwave extends BaseEnemy implements ILandEnemy {
public function Shockwave(_arg1:Array, _arg2:Number, _arg3:int, _arg4:int, _arg5:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
m_container = new Shockwave();
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_ticksPerFrame = 8;
m_healthBar = new HealthBar();
addChild(m_healthBar);
m_healthBar.x = 5;
m_healthBar.y = 1;
}
override protected function playDeathSound():void{
var _local2:String;
var _local1:int = Math.round((Math.random() * 2));
if (_local1 == 0){
_local2 = "assets.sfx.explosions.InsecticonExplosion";
} else {
if (_local1 == 1){
_local2 = "assets.sfx.explosions.ShockwaveExplosion";
} else {
_local2 = "assets.sfx.explosions.StarscreamExplosion";
};
};
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, _local2, 1, 1, false));
}
}
}//package game.enemies
Section 260
//Starscream (game.enemies.Starscream)
package game.enemies {
import com.markfennell.sound.*;
import interfaces.*;
import game.*;
import assets.enemies.*;
public class Starscream extends BaseEnemy implements IAirEnemy {
public function Starscream(_arg1:Array, _arg2:Number, _arg3:int, _arg4:int, _arg5:int){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
m_container = new Starscream();
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_ticksPerFrame = 8;
m_healthBar = new HealthBar();
addChild(m_healthBar);
m_healthBar.x = 5;
m_healthBar.y = 1;
}
override protected function playDeathSound():void{
var _local2:String;
var _local1:int = Math.round((Math.random() * 1));
if (_local1 == 0){
_local2 = "assets.sfx.explosions.InsecticonExplosion";
} else {
_local2 = "assets.sfx.explosions.StarscreamExplosion";
};
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, _local2, 1, 1, false));
}
}
}//package game.enemies
Section 261
//EnemyEvent (game.events.EnemyEvent)
package game.events {
import flash.events.*;
import game.enemies.*;
public class EnemyEvent extends Event {
public var enemyType:String;
public var enemyObject:BaseEnemy;
public var routeID:int;
public var health:int;
public static const ENEMY_OBJECTIVE:String = "enemyObjective";
public static const ENEMY_KILLED:String = "enemyKilled";
public static const SPAWN_ENEMY:String = "spawnEnemy";
public function EnemyEvent(_arg1:String, _arg2:BaseEnemy=null, _arg3:String="", _arg4:int=0, _arg5:int=0){
super(_arg1, true);
enemyObject = _arg2;
enemyType = _arg3;
health = _arg4;
routeID = _arg5;
}
}
}//package game.events
Section 262
//FinanceEvent (game.events.FinanceEvent)
package game.events {
import flash.events.*;
public class FinanceEvent extends Event {
public var playerFunds:int;
public static const UPDATE_FINANCE:String = "updateFinance";
public function FinanceEvent(_arg1:String, _arg2:int=0){
super(_arg1, true);
playerFunds = _arg2;
}
}
}//package game.events
Section 263
//GameEvent (game.events.GameEvent)
package game.events {
import flash.events.*;
public class GameEvent extends Event {
public var totalLives:int;
public var currentLives:int;
public static const GO_TO_GAME_OVER:String = "goToGameOver";
public static const GAME_LOST_WAIT:String = "gameLostWait";
public static const RESUME_GAME:String = "resumeGame";
public static const LIFE_LOST:String = "lifeLost";
public static const GAME_WON_WAIT:String = "gameWonWait";
public static const GAME_WON_DISPLAY:String = "gameWonDisplay";
public static const GAME_LOST_DISPLAY:String = "gameLostDisplay";
public static const PAUSE_GAME:String = "pauseGame";
public static const GO_TO_MAIN_MENU:String = "goToMainMenu";
public function GameEvent(_arg1:String, _arg2:int=0, _arg3:int=0){
super(_arg1, true);
currentLives = _arg2;
totalLives = _arg3;
}
}
}//package game.events
Section 264
//HUDEvent (game.events.HUDEvent)
package game.events {
import flash.events.*;
import interfaces.*;
public class HUDEvent extends Event {
public var rangeBonus:Boolean;
public var towerType:String;
public var towerObject:ITower;
public var frequencyBonus:Boolean;
public var towerLevel:String;
public var responseBonus:Boolean;
public static const PREVIEW_TOWER_ROLL_OUT:String = "previewTowerRollOut";
public static const APPLY_UPGRADE:String = "applyUpgrade";
public static const QUIT_GAME:String = "quitGame";
public static const SELECTED_TOWER_CLEAR_SELECTION:String = "selectedTowerClearSelection";
public static const PREVIEW_TOWER_ROLL_OVER:String = "previewTowerRollOver";
public static const CONFIRM_BACK_TO_MENU:String = "confirmBackToMenu";
public static const SELECTED_TOWER_DRAW_SELECTION:String = "selectedTowerDrawSelection";
public static const SELECTED_TOWER_SELL:String = "selectedTowerSell";
public static const PREVIEW_TOWER_MOUSE_DOWN:String = "previewTowerMouseDown";
public static const CLOSE_EXIT_PANEL:String = "closeExitPanel";
public static const CLOSE_UPGRADE_PANEL:String = "closeUpgradePanel";
public static const SELECTED_TOWER_SHOW_UPGRADES:String = "selectedTowershowUpgrades";
public function HUDEvent(_arg1:String, _arg2:String="", _arg3:ITower=null, _arg4:String="", _arg5:Boolean=false, _arg6:Boolean=false, _arg7:Boolean=false){
super(_arg1, true);
towerType = _arg2;
towerObject = _arg3;
towerLevel = _arg4;
frequencyBonus = _arg5;
responseBonus = _arg6;
rangeBonus = _arg7;
}
}
}//package game.events
Section 265
//ScoreEvent (game.events.ScoreEvent)
package game.events {
import flash.events.*;
public class ScoreEvent extends Event {
public var newScore:int;
public var bonusComponent:int;
public static const UPDATE_SCORE:String = "updateScore";
public function ScoreEvent(_arg1:String, _arg2:int=0, _arg3:int=0){
super(_arg1, true);
newScore = _arg2;
bonusComponent = _arg3;
}
}
}//package game.events
Section 266
//TowerEvent (game.events.TowerEvent)
package game.events {
import flash.events.*;
import interfaces.*;
public class TowerEvent extends Event {
public var towerType:String;
public var hasResponseBonus:Boolean;
public var towerObject:ITower;
public var tower_cell_x:Number;
public var tower_cell_y:Number;
public var hasRangeBonus:Boolean;
public var hasFrequencyBonus:Boolean;
public var levelID:int;
public static const UPGRADE_TOWER:String = "upgradeTower";
public static const BUILD_TOWER_COMPLETE:String = "buildTowerComplete";
public static const BUILD_TOWER:String = "buildTower";
public static const TOWER_UPGRADE_COMPLETE:String = "towerUpgradeComplete";
public static const SELL_TOWER:String = "sellTower";
public function TowerEvent(_arg1:String, _arg2:ITower=null, _arg3:int=0, _arg4:Boolean=false, _arg5:Boolean=false, _arg6:Boolean=false, _arg7:String="", _arg8:Number=0, _arg9:Number=0){
super(_arg1, true);
towerObject = _arg2;
towerType = _arg7;
levelID = _arg3;
hasFrequencyBonus = _arg4;
hasResponseBonus = _arg5;
hasRangeBonus = _arg6;
tower_cell_x = _arg8;
tower_cell_y = _arg9;
}
}
}//package game.events
Section 267
//WaveEvent (game.events.WaveEvent)
package game.events {
import flash.events.*;
public class WaveEvent extends Event {
public var previousWaveMaxTime:int;
public var timeTillNextWaveMin:int;
public var currentWaveID:int;
public var previousWaveTime:int;
public var totalWaves:int;
public var timeTillNextWaveMax:int;
public static const REQUEST_NEXT_WAVE:String = "requestNextWave";
public static const WAVE_LAUNCHED:String = "waveLaunched";
public static const ALL_WAVES_LAUNCHED:String = "allWavesLaunched";
public function WaveEvent(_arg1:String, _arg2:int=0, _arg3:int=0, _arg4:int=0, _arg5:int=0, _arg6:int=0, _arg7:int=0){
super(_arg1, true);
timeTillNextWaveMin = _arg2;
timeTillNextWaveMax = _arg3;
currentWaveID = _arg4;
totalWaves = _arg5;
previousWaveTime = _arg6;
previousWaveMaxTime = _arg7;
}
}
}//package game.events
Section 268
//WeaponEvent (game.events.WeaponEvent)
package game.events {
import flash.events.*;
import interfaces.*;
public class WeaponEvent extends Event {
public var towerLevel:int;
public var enemyObject:IEnemy;
public var towerObject:ITower;
public var weaponObject:IWeapon;
public static const ROCKET_FIRE:String = "rocketFire";
public static const MORTAR_FIRE:String = "mortarFire";
public static const MORTAR_DETONATE:String = "mortarDetonate";
public static const ROCKET_DETONATE:String = "rocketDetonate";
public static const BLASTER_FIRE:String = "blasterFire";
public static const LASER_FIRE:String = "laserFire";
public static const SLOWDOWN_FIRE:String = "slowdownFire";
public static const SLOWDOWN_DETONATE:String = "slowdownDetonate";
public static const LASER_STOP:String = "laserStop";
public function WeaponEvent(_arg1:String, _arg2:ITower=null, _arg3:IEnemy=null, _arg4:IWeapon=null, _arg5:int=0){
super(_arg1, true);
towerObject = _arg2;
enemyObject = _arg3;
weaponObject = _arg4;
towerLevel = _arg5;
}
}
}//package game.events
Section 269
//FinanceController (game.finance.FinanceController)
package game.finance {
import flash.utils.*;
import game.events.*;
import interfaces.*;
import game.towers.*;
import mochi.as3.*;
public class FinanceController {
private var m_md4:MochiDigits;
public function FinanceController(){
FinanceData.instance.emptyTable();
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_KILLED, enemyKilledHandler, false, 0, true);
GameBroadcaster.addEventListener(TowerEvent.BUILD_TOWER, towerBuildHandler, false, 0, true);
GameBroadcaster.addEventListener(TowerEvent.UPGRADE_TOWER, towerUpgradeHandler, false, 0, true);
GameBroadcaster.addEventListener(TowerEvent.SELL_TOWER, towerSellHandler, false, 0, true);
}
public function destroy():void{
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_KILLED, enemyKilledHandler);
GameBroadcaster.removeEventListener(TowerEvent.BUILD_TOWER, towerBuildHandler);
GameBroadcaster.removeEventListener(TowerEvent.UPGRADE_TOWER, towerUpgradeHandler);
GameBroadcaster.removeEventListener(TowerEvent.SELL_TOWER, towerSellHandler);
}
private function addPlayerFunds(_arg1:int):void{
(FinanceData.instance.playerFunds = (FinanceData.instance.playerFunds + _arg1));
m_md4.addValue(_arg1);
trace(("FC $ is now: " + FinanceData.instance.playerFunds));
GameBroadcaster.dispatchEvent(new FinanceEvent(FinanceEvent.UPDATE_FINANCE, FinanceData.instance.playerFunds));
}
private function enemyKilledHandler(_arg1:EnemyEvent):void{
trace(("FC enemy killed, value: " + _arg1.enemyObject.getMoney()));
addPlayerFunds(_arg1.enemyObject.getMoney());
}
public function freeze():void{
if (FinanceData.instance.playerFunds != m_md4.value){
(UserData.instance.md6 = 1);
} else {
(UserData.instance.md6 = 0);
};
}
private function removePlayerFunds(_arg1:int):void{
(FinanceData.instance.playerFunds = (FinanceData.instance.playerFunds - _arg1));
m_md4.addValue(-(_arg1));
trace(("FC $ is now: " + FinanceData.instance.playerFunds));
GameBroadcaster.dispatchEvent(new FinanceEvent(FinanceEvent.UPDATE_FINANCE, FinanceData.instance.playerFunds));
}
public function initFinance(_arg1:XML):void{
var _local5:*;
var _local6:int;
var _local7:*;
var _local2:XML = _arg1.towers[0];
var _local3:Dictionary = FinanceData.instance.costTable;
_local3[TowerController.BLASTER] = new Dictionary();
_local3[TowerController.BLASTER][TowerController.LEVEL_1] = int(_local2.blasterTower.@level1);
_local3[TowerController.BLASTER][TowerController.LEVEL_2] = int(_local2.blasterTower.@level2);
_local3[TowerController.BLASTER][TowerController.LEVEL_3] = int(_local2.blasterTower.@level3);
_local3[TowerController.BLASTER][TowerController.FREQUENCY_BONUS] = int(_local2.blasterTower.@frequencyBonus);
_local3[TowerController.BLASTER][TowerController.RESPONSE_BONUS] = int(_local2.blasterTower.@responseBonus);
_local3[TowerController.BLASTER][TowerController.RANGE_BONUS] = int(_local2.blasterTower.@rangeBonus);
_local3[TowerController.SLOWDOWN] = new Dictionary();
_local3[TowerController.SLOWDOWN][TowerController.LEVEL_1] = int(_local2.slowdownTower.@level1);
_local3[TowerController.SLOWDOWN][TowerController.LEVEL_2] = int(_local2.slowdownTower.@level2);
_local3[TowerController.SLOWDOWN][TowerController.LEVEL_3] = int(_local2.slowdownTower.@level3);
_local3[TowerController.SLOWDOWN][TowerController.FREQUENCY_BONUS] = int(_local2.slowdownTower.@frequencyBonus);
_local3[TowerController.SLOWDOWN][TowerController.RESPONSE_BONUS] = int(_local2.slowdownTower.@responseBonus);
_local3[TowerController.SLOWDOWN][TowerController.RANGE_BONUS] = int(_local2.slowdownTower.@rangeBonus);
_local3[TowerController.ROCKET] = new Dictionary();
_local3[TowerController.ROCKET][TowerController.LEVEL_1] = int(_local2.rocketTower.@level1);
_local3[TowerController.ROCKET][TowerController.LEVEL_2] = int(_local2.rocketTower.@level2);
_local3[TowerController.ROCKET][TowerController.LEVEL_3] = int(_local2.rocketTower.@level3);
_local3[TowerController.ROCKET][TowerController.FREQUENCY_BONUS] = int(_local2.rocketTower.@frequencyBonus);
_local3[TowerController.ROCKET][TowerController.RESPONSE_BONUS] = int(_local2.rocketTower.@responseBonus);
_local3[TowerController.ROCKET][TowerController.RANGE_BONUS] = int(_local2.rocketTower.@rangeBonus);
_local3[TowerController.MORTAR] = new Dictionary();
_local3[TowerController.MORTAR][TowerController.LEVEL_1] = int(_local2.mortarTower.@level1);
_local3[TowerController.MORTAR][TowerController.LEVEL_2] = int(_local2.mortarTower.@level2);
_local3[TowerController.MORTAR][TowerController.LEVEL_3] = int(_local2.mortarTower.@level3);
_local3[TowerController.MORTAR][TowerController.FREQUENCY_BONUS] = int(_local2.mortarTower.@frequencyBonus);
_local3[TowerController.MORTAR][TowerController.RESPONSE_BONUS] = int(_local2.mortarTower.@responseBonus);
_local3[TowerController.MORTAR][TowerController.RANGE_BONUS] = int(_local2.mortarTower.@rangeBonus);
_local3[TowerController.LASER] = new Dictionary();
_local3[TowerController.LASER][TowerController.LEVEL_1] = int(_local2.laserTower.@level1);
_local3[TowerController.LASER][TowerController.LEVEL_2] = int(_local2.laserTower.@level2);
_local3[TowerController.LASER][TowerController.LEVEL_3] = int(_local2.laserTower.@level3);
_local3[TowerController.LASER][TowerController.FREQUENCY_BONUS] = int(_local2.laserTower.@frequencyBonus);
_local3[TowerController.LASER][TowerController.RESPONSE_BONUS] = int(_local2.laserTower.@responseBonus);
_local3[TowerController.LASER][TowerController.RANGE_BONUS] = int(_local2.laserTower.@rangeBonus);
var _local4:Dictionary = FinanceData.instance.resaleTable;
_local4[TowerController.BLASTER] = Number(_local2.blasterTower.@resaleFraction);
_local4[TowerController.SLOWDOWN] = Number(_local2.slowdownTower.@resaleFraction);
_local4[TowerController.ROCKET] = Number(_local2.rocketTower.@resaleFraction);
_local4[TowerController.MORTAR] = Number(_local2.mortarTower.@resaleFraction);
_local4[TowerController.LASER] = Number(_local2.laserTower.@resaleFraction);
for (_local5 in _local3) {
for (_local7 in _local3[_local5]) {
};
};
_local6 = _arg1.player.startingFunds.@funds;
(FinanceData.instance.playerFunds = _local6);
(m_md4 = new MochiDigits(_local6));
trace(("$ is now " + FinanceData.instance.playerFunds));
}
private function towerBuildHandler(_arg1:TowerEvent):void{
var _local2:String = TowerController.getTowerLevelString(null, _arg1.levelID);
var _local3:Dictionary = FinanceData.instance.costTable;
var _local4:int = _local3[_arg1.towerType][_local2];
var _local5:int;
if (_arg1.hasFrequencyBonus){
_local5 = (_local5 + _local3[_arg1.towerType][TowerController.FREQUENCY_BONUS]);
_local5;
trace("FC build tower has frequency bonus");
};
if (_arg1.hasRangeBonus){
_local5 = (_local5 + _local3[_arg1.towerType][TowerController.RANGE_BONUS]);
_local5;
trace("FC build tower has range bonus");
};
if (_arg1.hasResponseBonus){
_local5 = (_local5 + _local3[_arg1.towerType][TowerController.RESPONSE_BONUS]);
_local5;
trace("FC build tower has response bonus");
};
var _local6:int = (_local4 + _local5);
trace(("FC build, final cost " + _local6));
removePlayerFunds(_local6);
}
private function towerUpgradeHandler(_arg1:TowerEvent):void{
var _local5:String;
var _local2:Dictionary = FinanceData.instance.costTable;
var _local3:int;
var _local4:String = TowerController.getTowerTypeString(_arg1.towerObject);
if (_arg1.levelID != 0){
_local5 = TowerController.getTowerLevelString(null, _arg1.levelID);
_local3 = (_local3 + _local2[_local4][_local5]);
_local3;
trace(("FC upgrade tower has level up, to: " + _local5));
};
if (_arg1.hasFrequencyBonus){
_local3 = (_local3 + _local2[_local4][TowerController.FREQUENCY_BONUS]);
_local3;
trace("FC upgrade tower has frequency bonus");
};
if (_arg1.hasRangeBonus){
_local3 = (_local3 + _local2[_local4][TowerController.RANGE_BONUS]);
_local3;
trace("FC upgrade tower has range bonus");
};
if (_arg1.hasResponseBonus){
_local3 = (_local3 + _local2[_local4][TowerController.RESPONSE_BONUS]);
_local3;
trace("FC upgrade tower has response bonus");
};
trace(("FC upgrade, final cost " + _local3));
removePlayerFunds(_local3);
}
private function towerSellHandler(_arg1:TowerEvent):void{
var _local2:int = evaluateTowerForSale(_arg1.towerObject);
trace(("FC sale, final value " + _local2));
addPlayerFunds(_local2);
}
public static function evaluateTowerForSale(_arg1:ITower):int{
var _local2:String = TowerController.getTowerTypeString(_arg1);
var _local3:String = TowerController.getTowerLevelString(_arg1);
var _local4:Dictionary = FinanceData.instance.costTable;
var _local5:int = _local4[_local2][_local3];
var _local6:Object = _arg1.getUpgrades();
if (_local6.hasFrequencyBonus){
_local5 = (_local5 + _local4[_local2][TowerController.FREQUENCY_BONUS]);
};
if (_local6.hasResponseBonus){
_local5 = (_local5 + _local4[_local2][TowerController.RESPONSE_BONUS]);
};
if (_local6.hasRangeBonus){
_local5 = (_local5 + _local4[_local2][TowerController.RANGE_BONUS]);
};
var _local7:int = Math.ceil((_local5 * FinanceData.instance.resaleTable[_local2]));
trace(((("FC evaluation, original value: " + _local5) + " resale: ") + _local7));
return (_local7);
}
}
}//package game.finance
Section 270
//FinanceData (game.finance.FinanceData)
package game.finance {
import flash.events.*;
import flash.utils.*;
public class FinanceData extends EventDispatcher {
private var m_resaleTable:Dictionary;
private var m_costTable:Dictionary;
private static var m_instance:FinanceData = new (FinanceData);
;
private static var m_playerFunds:int = 0;
public function FinanceData(){
if (m_instance){
throw (new Error("Error: FinanceData is a Singleton, and can only be accessed through FinanceData.instance"));
};
m_instance = this;
m_costTable = new Dictionary();
m_resaleTable = new Dictionary();
}
public function emptyTable():void{
m_costTable = new Dictionary();
m_resaleTable = new Dictionary();
}
public function get costTable():Dictionary{
return (m_costTable);
}
public function set playerFunds(_arg1:int):void{
if (_arg1 >= 0){
m_playerFunds = _arg1;
};
}
public function get resaleTable():Dictionary{
return (m_resaleTable);
}
public function get playerFunds():int{
return (m_playerFunds);
}
public static function get instance():FinanceData{
return (m_instance);
}
}
}//package game.finance
Section 271
//BasePanel (game.hud.BasePanel)
package game.hud {
import flash.display.*;
import interfaces.*;
import org.casalib.display.*;
import gs.*;
public class BasePanel extends CasaSprite implements IHUDPanel {
protected var m_transitionOut:Boolean;// = false
protected var m_transitionIn:Boolean;// = false
protected var m_container:MovieClip;
public function doRender():void{
}
override public function destroy():void{
super.destroy();
}
public function transitionOut():void{
TweenMax.to(this, 0.1, {alpha:0, onComplete:destroy});
}
public function transitionIn():void{
this.alpha = 0;
TweenMax.to(this, 0.1, {alpha:1});
}
public function doPhysics():void{
}
}
}//package game.hud
Section 272
//CentrePanel (game.hud.CentrePanel)
package game.hud {
import flash.events.*;
import flash.utils.*;
import game.events.*;
import game.finance.*;
import game.towers.*;
import assets.hud.*;
import gs.*;
public class CentrePanel extends BasePanel {
private var m_bumblebeeButton:TowerSelectionButton;
private var m_blasterSufficientFunds:Boolean;// = true
private var m_rocketSufficientFunds:Boolean;// = true
private var m_laserSufficientFunds:Boolean;// = true
private var m_slowdownSufficientFunds:Boolean;// = true
private var m_divxUnlocked:Boolean;// = false
private var m_jazzButton:TowerSelectionButton;
private var m_mortarSufficientFunds:Boolean;// = true
private var m_ironhideButton:TowerSelectionButton;
private var m_ratchetButton:TowerSelectionButton;
private var m_optimusButton:TowerSelectionButton;
public function CentrePanel(){
m_container = new CenterPanel();
addChild(m_container);
GameBroadcaster.addEventListener(FinanceEvent.UPDATE_FINANCE, onFinanceChange, false, 0, true);
GameBroadcaster.addEventListener(ScoreEvent.UPDATE_SCORE, onScoreUpdate, false, 0, true);
m_bumblebeeButton = new TowerSelectionButton(m_container.bumblebeeDisabled, m_container.bumblebeeEnabled, m_container.bumblebeeOver);
m_jazzButton = new TowerSelectionButton(m_container.jazzDisabled, m_container.jazzEnabled, m_container.jazzOver);
m_ironhideButton = new TowerSelectionButton(m_container.ironhideDisabled, m_container.ironhideEnabled, m_container.ironhideOver);
m_ratchetButton = new TowerSelectionButton(m_container.ratchetDisabled, m_container.ratchetEnabled, m_container.ratchetOver);
m_optimusButton = new TowerSelectionButton(m_container.optimusDisabled, m_container.optimusEnabled, m_container.optimusOver);
addTowerButtonListeners(m_bumblebeeButton);
addTowerButtonListeners(m_jazzButton);
addTowerButtonListeners(m_ironhideButton);
addTowerButtonListeners(m_ratchetButton);
addTowerButtonListeners(m_optimusButton);
evaluatePlayerFunds(FinanceData.instance.playerFunds);
}
private function onRollOverHandler(_arg1:Event):void{
var _local2:String;
switch (_arg1.target){
case m_bumblebeeButton:
_local2 = TowerController.BLASTER;
break;
case m_jazzButton:
_local2 = TowerController.SLOWDOWN;
break;
case m_ironhideButton:
_local2 = TowerController.ROCKET;
break;
case m_ratchetButton:
_local2 = TowerController.MORTAR;
break;
case m_optimusButton:
_local2 = TowerController.LASER;
break;
};
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.PREVIEW_TOWER_ROLL_OVER, _local2));
}
private function removeTowerButtonListeners(_arg1:TowerSelectionButton):void{
_arg1.removeEventListener(TowerSelectionButton.ROLL_OVER, onRollOverHandler);
_arg1.removeEventListener(TowerSelectionButton.ROLL_OUT, onRollOutHandler);
_arg1.removeEventListener(TowerSelectionButton.MOUSE_DOWN, onMouseDownHandler);
}
override public function destroy():void{
GameBroadcaster.removeEventListener(FinanceEvent.UPDATE_FINANCE, onFinanceChange);
GameBroadcaster.removeEventListener(ScoreEvent.UPDATE_SCORE, onScoreUpdate);
removeTowerButtonListeners(m_bumblebeeButton);
removeTowerButtonListeners(m_jazzButton);
removeTowerButtonListeners(m_ironhideButton);
removeTowerButtonListeners(m_ratchetButton);
removeTowerButtonListeners(m_optimusButton);
m_bumblebeeButton.destroy();
m_jazzButton.destroy();
m_ironhideButton.destroy();
m_ratchetButton.destroy();
m_optimusButton.destroy();
super.destroy();
}
private function onFinanceChange(_arg1:FinanceEvent):void{
evaluatePlayerFunds(_arg1.playerFunds);
}
private function addTowerButtonListeners(_arg1:TowerSelectionButton):void{
_arg1.addEventListener(TowerSelectionButton.ROLL_OVER, onRollOverHandler, false, 0, true);
_arg1.addEventListener(TowerSelectionButton.ROLL_OUT, onRollOutHandler, false, 0, true);
_arg1.addEventListener(TowerSelectionButton.MOUSE_DOWN, onMouseDownHandler, false, 0, true);
}
private function onScoreUpdate(_arg1:ScoreEvent):void{
if (((!(m_divxUnlocked)) && ((_arg1.newScore > TowerData.instance.laserLockoutScore)))){
m_divxUnlocked = true;
m_container.divxDisabled.mouseEnabled = false;
TweenMax.to(m_container.divxDisabled, 1, {autoAlpha:0});
};
}
private function evaluatePlayerFunds(_arg1:int):void{
var _local3:int;
var _local2:Dictionary = FinanceData.instance.costTable;
_local3 = _local2[TowerController.BLASTER][TowerController.LEVEL_1];
if ((((_arg1 < _local3)) && (m_blasterSufficientFunds))){
m_bumblebeeButton.disableButton();
m_blasterSufficientFunds = false;
} else {
if ((((_arg1 >= _local3)) && (!(m_blasterSufficientFunds)))){
m_bumblebeeButton.enableButton();
m_blasterSufficientFunds = true;
};
};
_local3 = _local2[TowerController.SLOWDOWN][TowerController.LEVEL_1];
if ((((_arg1 < _local3)) && (m_slowdownSufficientFunds))){
m_jazzButton.disableButton();
m_slowdownSufficientFunds = false;
} else {
if ((((_arg1 >= _local3)) && (!(m_slowdownSufficientFunds)))){
m_jazzButton.enableButton();
m_slowdownSufficientFunds = true;
};
};
_local3 = _local2[TowerController.ROCKET][TowerController.LEVEL_1];
if ((((_arg1 < _local3)) && (m_rocketSufficientFunds))){
m_ironhideButton.disableButton();
m_rocketSufficientFunds = false;
} else {
if ((((_arg1 >= _local3)) && (!(m_rocketSufficientFunds)))){
m_ironhideButton.enableButton();
m_rocketSufficientFunds = true;
};
};
_local3 = _local2[TowerController.MORTAR][TowerController.LEVEL_1];
if ((((_arg1 < _local3)) && (m_mortarSufficientFunds))){
m_ratchetButton.disableButton();
m_mortarSufficientFunds = false;
} else {
if ((((_arg1 >= _local3)) && (!(m_mortarSufficientFunds)))){
m_ratchetButton.enableButton();
m_mortarSufficientFunds = true;
};
};
_local3 = _local2[TowerController.LASER][TowerController.LEVEL_1];
if ((((_arg1 < _local3)) && (m_laserSufficientFunds))){
m_optimusButton.disableButton();
m_laserSufficientFunds = false;
} else {
if ((((_arg1 >= _local3)) && (!(m_laserSufficientFunds)))){
m_optimusButton.enableButton();
m_laserSufficientFunds = true;
};
};
}
private function onMouseDownHandler(_arg1:Event):void{
var _local2:String;
switch (_arg1.target){
case m_bumblebeeButton:
_local2 = TowerController.BLASTER;
break;
case m_jazzButton:
_local2 = TowerController.SLOWDOWN;
break;
case m_ironhideButton:
_local2 = TowerController.ROCKET;
break;
case m_ratchetButton:
_local2 = TowerController.MORTAR;
break;
case m_optimusButton:
_local2 = TowerController.LASER;
break;
};
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.PREVIEW_TOWER_MOUSE_DOWN, _local2));
}
private function onRollOutHandler(_arg1:Event):void{
var _local2:String;
switch (_arg1.target){
case m_bumblebeeButton:
_local2 = TowerController.BLASTER;
break;
case m_jazzButton:
_local2 = TowerController.SLOWDOWN;
break;
case m_ironhideButton:
_local2 = TowerController.ROCKET;
break;
case m_ratchetButton:
_local2 = TowerController.MORTAR;
break;
case m_optimusButton:
_local2 = TowerController.LASER;
break;
};
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.PREVIEW_TOWER_ROLL_OUT, _local2));
}
}
}//package game.hud
Section 273
//ConfirmExitPanel (game.hud.ConfirmExitPanel)
package game.hud {
import flash.events.*;
import game.events.*;
import ui.*;
import assets.hud.*;
import gs.*;
public class ConfirmExitPanel extends BasePanel {
private var m_noButton:SingleGraphicGlowButton;
private var m_yesButton:SingleGraphicGlowButton;
public function ConfirmExitPanel(){
m_container = new ConfirmExitScreen();
addChild(m_container);
m_container.alpha = 0;
TweenMax.to(m_container, 0.25, {alpha:1});
m_yesButton = new SingleGraphicGlowButton(m_container.yesButton, m_container.yesGlow);
m_noButton = new SingleGraphicGlowButton(m_container.noButton, m_container.noGlow);
m_yesButton.addEventListener(SingleGraphicGlowButton.CLICKED, yesClickHandler, false, 0, true);
m_noButton.addEventListener(SingleGraphicGlowButton.CLICKED, noClickHandler, false, 0, true);
}
private function yesClickHandler(_arg1:Event):void{
TweenMax.to(m_container, 0.25, {alpha:0, onComplete:yesDelayComplete});
}
override public function destroy():void{
m_yesButton.removeEventListener(SingleGraphicGlowButton.CLICKED, yesClickHandler);
m_noButton.removeEventListener(SingleGraphicGlowButton.CLICKED, noClickHandler);
m_yesButton.destroy();
m_noButton.destroy();
super.destroy();
}
private function noClickHandler(_arg1:Event):void{
TweenMax.to(m_container, 0.25, {alpha:0, onComplete:noDelayComplete});
}
private function yesDelayComplete():void{
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.QUIT_GAME));
}
private function noDelayComplete():void{
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.CLOSE_EXIT_PANEL));
}
}
}//package game.hud
Section 274
//GameOverPanel (game.hud.GameOverPanel)
package game.hud {
import flash.utils.*;
import game.events.*;
import assets.hud.*;
import gs.*;
public class GameOverPanel extends BasePanel {
private var delayInterval:int;
public function GameOverPanel(_arg1:String){
if (_arg1 == "won"){
m_container = new GameVictoryScreen();
} else {
m_container = new GameDefeatScreen();
};
addChild(m_container);
m_container.alpha = 0;
TweenMax.to(m_container, 0.25, {alpha:1});
delayInterval = setTimeout(delayComplete, 10000);
}
override public function destroy():void{
super.destroy();
}
private function fadeDownComplete():void{
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.GO_TO_GAME_OVER));
}
private function delayComplete():void{
TweenMax.to(m_container, 0.25, {alpha:0, onComplete:fadeDownComplete});
}
}
}//package game.hud
Section 275
//GamePausedPanel (game.hud.GamePausedPanel)
package game.hud {
import flash.events.*;
import game.events.*;
import ui.*;
import assets.hud.*;
import gs.*;
public class GamePausedPanel extends BasePanel {
private var m_pausedButton:SingleGraphicGlowButton;
public function GamePausedPanel(){
m_container = new GamePauseScreen();
addChild(m_container);
m_container.alpha = 0;
TweenMax.to(m_container, 0.25, {alpha:1});
m_pausedButton = new SingleGraphicGlowButton(m_container.pauseButton, m_container.pauseGlow);
m_pausedButton.addEventListener(SingleGraphicGlowButton.CLICKED, pausedClickHandler, false, 0, true);
m_container.mapCover.addEventListener(MouseEvent.CLICK, mapClickHandler, false, 0, true);
}
private function pausedClickHandler(_arg1:Event):void{
TweenMax.to(m_container, 0.25, {alpha:0, onComplete:fadeDownComplete});
}
override public function destroy():void{
m_pausedButton.removeEventListener(SingleGraphicGlowButton.CLICKED, pausedClickHandler);
m_container.mapCover.removeEventListener(MouseEvent.CLICK, mapClickHandler);
m_pausedButton.destroy();
super.destroy();
}
private function fadeDownComplete():void{
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.RESUME_GAME));
}
private function mapClickHandler(_arg1:Event):void{
TweenMax.to(m_container, 0.25, {alpha:0, onComplete:fadeDownComplete});
}
}
}//package game.hud
Section 276
//HUDBuildDisplay (game.hud.HUDBuildDisplay)
package game.hud {
import flash.display.*;
import org.casalib.display.*;
import game.*;
import assets.hud.*;
import flash.filters.*;
public class HUDBuildDisplay extends CasaSprite {
private var m_cellClip:MovieClip;
private var m_x:int;
private var m_array:Array;
private var m_filter:GlowFilter;
private var m_range:int;
private var m_y:int;
private var m_container:CasaSprite;
private var m_rangeShape:CasaSprite;
public function hideDisplay():void{
m_container.visible = false;
}
override public function destroy():void{
if (m_container != null){
m_container.destroy();
};
super.destroy();
}
public function newCell(_arg1:int, _arg2:int):void{
m_x = _arg1;
m_y = _arg2;
m_container.visible = true;
if (m_cellClip != null){
m_container.removeChild(m_cellClip);
m_cellClip = null;
};
if (m_rangeShape != null){
m_rangeShape.destroy();
m_rangeShape = null;
};
if (m_array[m_y][m_x] == true){
m_cellClip = new HoverAllowed();
} else {
m_cellClip = new HoverDenied();
};
m_cellClip.x = (m_x * Map.tileW);
m_cellClip.y = (m_y * Map.tileH);
m_container.addChild(m_cellClip);
drawRangeCircle((m_x * Map.tileW), (m_y * Map.tileH), m_range);
}
public function endDrag():void{
if (m_cellClip != null){
m_container.removeChild(m_cellClip);
m_cellClip = null;
};
if (m_rangeShape != null){
m_rangeShape.destroy();
m_rangeShape = null;
};
m_container.destroy();
}
private function drawRangeCircle(_arg1:int, _arg2:int, _arg3:int):void{
if (m_rangeShape != null){
m_rangeShape.destroy();
};
m_rangeShape = new CasaSprite();
m_container.addChild(m_rangeShape);
m_rangeShape.x = (_arg1 + Map.tileHalfW);
m_rangeShape.y = (_arg2 + Map.tileHalfH);
m_rangeShape.graphics.beginFill(0xFFFFFF, 0.05);
m_rangeShape.graphics.lineStyle(2, 4763837, 1);
m_rangeShape.graphics.drawCircle(0, 0, _arg3);
m_rangeShape.filters = [m_filter];
}
public function newDrag(_arg1:Array, _arg2:int):void{
if (m_container != null){
m_container.destroy();
};
m_array = _arg1;
m_range = _arg2;
m_filter = new GlowFilter(3714235, 1, 10, 10, 1, 1);
m_container = new CasaSprite();
addChild(m_container);
}
}
}//package game.hud
Section 277
//HUDController (game.hud.HUDController)
package game.hud {
import flash.events.*;
import flash.display.*;
import game.events.*;
import interfaces.*;
import game.towers.*;
import org.casalib.util.*;
import game.*;
import assets.hud.*;
public class HUDController extends Sprite {
private var m_draggingTowerType:String;
private var m_buildDisplay:HUDBuildDisplay;
private var m_placementOffsetX:int;
private var m_placementOffsetY:int;
private var m_draggingX:int;
private var m_draggingY:int;
private var m_pauseMenuPanel:BasePanel;
private var m_draggingTower:MovieClip;
private var m_mapRef:InteractiveObject;
private var m_confirmExitPanel:BasePanel;
private var m_state:String;
private var m_leftPanelFadeOut:BasePanel;
private var m_livesPanel:BasePanel;
private var m_gamePausedPanel:BasePanel;
private var m_draggingCellX:int;
private var m_rightPanel:BasePanel;
private var m_selectedTower:ITower;
private var m_centerPanel:BasePanel;
private var m_draggingCellY:int;
private var m_leftPanel:BasePanel;
private var m_gameOverPanel:BasePanel;
private var m_bgPanel:MovieClip;
private var m_availableMapCells:Array;
private static const TOWER_SELECTED:String = "towerSelected";
private static const TOWER_PREVIEW:String = "towerPreview";
private static const TOWER_SELECTED_UPGRADES:String = "towerSelectedUpgrades";
private static const TOWER_DRAG:String = "towerDrag";
private static const INACTIVE:String = "inactive";
public function HUDController(_arg1:InteractiveObject, _arg2:int, _arg3:int){
m_mapRef = _arg1;
m_placementOffsetX = _arg2;
m_placementOffsetY = _arg3;
m_bgPanel = new HudBG();
addChild(m_bgPanel);
m_rightPanel = new RightPanel();
addChild(m_rightPanel);
m_rightPanel.x = 431;
m_rightPanel.y = 0;
m_centerPanel = new CentrePanel();
addChild(m_centerPanel);
m_centerPanel.x = 250;
m_centerPanel.y = 0;
m_livesPanel = new LivesPanel();
addChild(m_livesPanel);
m_livesPanel.x = -2;
m_livesPanel.y = -28;
m_pauseMenuPanel = new PauseMenuPanel();
addChild(m_pauseMenuPanel);
m_pauseMenuPanel.x = 493;
m_pauseMenuPanel.y = -28;
m_buildDisplay = new HUDBuildDisplay();
m_buildDisplay.alpha = 1;
addChild(m_buildDisplay);
m_buildDisplay.x = m_placementOffsetX;
m_buildDisplay.y = m_placementOffsetY;
m_state = INACTIVE;
changePanel(m_state);
m_mapRef.addEventListener(MouseEvent.CLICK, onMapClick, false, 0, true);
GameBroadcaster.addEventListener(TowerEvent.BUILD_TOWER_COMPLETE, onAddTower, false, 0, true);
GameBroadcaster.addEventListener(TowerEvent.SELL_TOWER, onSellTower, false, 0, true);
GameBroadcaster.addEventListener(TowerEvent.TOWER_UPGRADE_COMPLETE, onUpgradeTowerComplete, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.PREVIEW_TOWER_ROLL_OVER, onTowerPreviewRollover, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.PREVIEW_TOWER_ROLL_OUT, onTowerPreviewRollout, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.PREVIEW_TOWER_MOUSE_DOWN, onTowerPreviewMouseDown, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.SELECTED_TOWER_SELL, onTowerSellHandler, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.SELECTED_TOWER_SHOW_UPGRADES, onTowerShowUpgradesHandler, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.CLOSE_UPGRADE_PANEL, onCloseTowerUpgradesHandler, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.APPLY_UPGRADE, onApplyUpgradeHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.PAUSE_GAME, pauseGameHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.RESUME_GAME, resumeGameHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.GAME_WON_DISPLAY, gameWonLostHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.GAME_LOST_DISPLAY, gameWonLostHandler, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.CONFIRM_BACK_TO_MENU, exitPanelConfirmHandler, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.CLOSE_EXIT_PANEL, onCloseExitPanelHandler, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.QUIT_GAME, quitGameHandler, false, 0, true);
trace("HUD online");
}
public function doRender():void{
m_rightPanel.doRender();
m_livesPanel.doRender();
if (m_state == TOWER_DRAG){
manageDraggingTowerRender();
};
}
private function onTowerPreviewMouseDown(_arg1:HUDEvent):void{
trace(("HUD tower preview mouse down " + _arg1.towerType));
if (m_selectedTower != null){
exitSelectionMode();
};
changePanel(TOWER_DRAG);
enterTowerDragMode(_arg1.towerType);
}
private function onMapClick(_arg1:MouseEvent):void{
var _local2:int = Math.floor((_arg1.localX / Map.tileW));
var _local3:int = Math.floor((_arg1.localY / Map.tileH));
trace((((((((("MAP CLICK! " + _arg1.localX) + ",") + _arg1.localY) + " (") + _local2) + ",") + _local3) + ")"));
if ((((m_state == TOWER_SELECTED)) || ((m_state == TOWER_SELECTED_UPGRADES)))){
exitSelectionMode();
};
changePanel(INACTIVE);
}
private function exitPanelConfirmHandler(_arg1:HUDEvent):void{
m_confirmExitPanel = new ConfirmExitPanel();
addChild(m_confirmExitPanel);
m_confirmExitPanel.x = 2;
m_confirmExitPanel.y = -414;
}
private function resumeGameHandler(_arg1:GameEvent):void{
if (m_gamePausedPanel != null){
m_gamePausedPanel.destroy();
};
}
private function pauseGameHandler(_arg1:GameEvent):void{
m_gamePausedPanel = new GamePausedPanel();
addChild(m_gamePausedPanel);
m_gamePausedPanel.x = 2;
m_gamePausedPanel.y = -414;
}
private function onCloseTowerUpgradesHandler(_arg1:HUDEvent):void{
changePanel(TOWER_SELECTED, "", m_selectedTower);
}
private function onUpgradeTowerComplete(_arg1:TowerEvent):void{
trace(("HUDController heard about an upgraded tower! " + _arg1.towerObject));
if ((((m_state == TOWER_SELECTED)) || ((m_state == TOWER_SELECTED_UPGRADES)))){
changePanel(TOWER_SELECTED, "", m_selectedTower);
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.SELECTED_TOWER_DRAW_SELECTION, "", m_selectedTower));
};
}
private function manageDraggingTowerRender():void{
m_draggingTower.x = m_draggingX;
m_draggingTower.y = m_draggingY;
}
private function enterTowerDragMode(_arg1:String):void{
var _local7:int;
var _local8:Object;
var _local9:int;
var _local10:int;
m_draggingTowerType = _arg1;
m_availableMapCells = [];
var _local2:Array = Map.getMap();
var _local3:int;
while (_local3 < _local2.length) {
m_availableMapCells[_local3] = [];
_local7 = 0;
while (_local7 < _local2[_local3].length) {
if (_local2[_local3][_local7] == Map.BUILDABLE){
m_availableMapCells[_local3][_local7] = true;
} else {
m_availableMapCells[_local3][_local7] = false;
};
_local7++;
};
_local3++;
};
var _local4:Array = TowerData.instance.towerArray;
var _local5:int;
while (_local5 < _local4.length) {
_local8 = ITower(_local4[_local5]).getPosition();
_local9 = (_local8.x / Map.tileW);
_local10 = (_local8.y / Map.tileH);
m_availableMapCells[_local10][_local9] = false;
_local5++;
};
m_buildDisplay.newDrag(m_availableMapCells, TowerData.instance.rangeTable[_arg1][TowerController.LEVEL_1]);
m_draggingCellX = 0;
m_draggingCellY = 0;
switch (_arg1){
case TowerController.BLASTER:
m_draggingTower = new BlasterTowerIcon();
break;
case TowerController.SLOWDOWN:
m_draggingTower = new SlowdownTowerIcon();
break;
case TowerController.ROCKET:
m_draggingTower = new RocketTowerIcon();
break;
case TowerController.MORTAR:
m_draggingTower = new MortarTowerIcon();
break;
case TowerController.LASER:
m_draggingTower = new LaserTowerIcon();
};
addChild(m_draggingTower);
m_draggingTower.x = this.mouseX;
m_draggingTower.y = this.mouseY;
var _local6:Stage = StageReference.getStage();
_local6.addEventListener(MouseEvent.MOUSE_UP, exitTowerDragMode, false, 0, true);
}
private function gameWonLostHandler(_arg1:GameEvent):void{
var _local2:String;
if (_arg1.type == GameEvent.GAME_WON_DISPLAY){
_local2 = "won";
} else {
if (_arg1.type == GameEvent.GAME_LOST_DISPLAY){
_local2 = "lost";
};
};
m_gameOverPanel = new GameOverPanel(_local2);
addChild(m_gameOverPanel);
m_gameOverPanel.x = 2;
m_gameOverPanel.y = -414;
}
private function changePanel(_arg1:String, _arg2:String="", _arg3:ITower=null):void{
trace(((((("HUD changePanel to: " + _arg1) + " towerType: ") + _arg2) + " tower: ") + _arg3));
if (m_leftPanel != null){
m_leftPanel.transitionOut();
m_leftPanel = null;
};
switch (_arg1){
case INACTIVE:
m_leftPanel = new NoSelectionPanel();
addChild(m_leftPanel);
m_leftPanel.transitionIn();
break;
case TOWER_PREVIEW:
m_leftPanel = new PreviewPanel(_arg2);
addChild(m_leftPanel);
m_leftPanel.transitionIn();
break;
case TOWER_DRAG:
break;
case TOWER_SELECTED:
m_leftPanel = new SelectedPanel(_arg3);
addChild(m_leftPanel);
m_leftPanel.transitionIn();
break;
case TOWER_SELECTED_UPGRADES:
m_leftPanel = new UpgradePanel(_arg3);
addChild(m_leftPanel);
m_leftPanel.transitionIn();
break;
};
m_state = _arg1;
}
public function doPhysics():void{
m_rightPanel.doPhysics();
m_livesPanel.doPhysics();
if (m_state == TOWER_DRAG){
manageDraggingTowerPhysics();
};
}
private function onApplyUpgradeHandler(_arg1:HUDEvent):void{
var _local2:int;
if (_arg1.towerLevel != null){
_local2 = (m_selectedTower.getLevel() + 1);
trace(((("upgrade is a level boost to: " + _arg1.towerLevel) + ", calc'd that as level: ") + _local2));
GameBroadcaster.dispatchEvent(new TowerEvent(TowerEvent.UPGRADE_TOWER, m_selectedTower, _local2, false, false, false));
} else {
if (_arg1.frequencyBonus != false){
trace("upgrade is a frequency boost");
GameBroadcaster.dispatchEvent(new TowerEvent(TowerEvent.UPGRADE_TOWER, m_selectedTower, 0, true, false, false));
} else {
if (_arg1.responseBonus != false){
trace("upgrade is a frequency boost");
GameBroadcaster.dispatchEvent(new TowerEvent(TowerEvent.UPGRADE_TOWER, m_selectedTower, 0, false, true, false));
} else {
if (_arg1.rangeBonus != false){
trace("upgrade is a frequency boost");
GameBroadcaster.dispatchEvent(new TowerEvent(TowerEvent.UPGRADE_TOWER, m_selectedTower, 0, false, false, true));
} else {
trace("wtf bonus is that!");
};
};
};
};
}
private function onTowerClick(_arg1:MouseEvent):void{
var _local2:Object = ITower(_arg1.target).getPosition();
var _local3:int = (_local2.x / Map.tileW);
var _local4:int = (_local2.y / Map.tileH);
trace(((((("TOWER CLICK!! " + _arg1.target) + " ") + _local3) + ",") + _local4));
if ((((m_state == TOWER_SELECTED)) || ((m_state == TOWER_SELECTED_UPGRADES)))){
exitSelectionMode();
};
enterSelectionMode(ITower(_arg1.target));
changePanel(TOWER_SELECTED, "", m_selectedTower);
}
private function quitGameHandler(_arg1:HUDEvent):void{
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.GO_TO_MAIN_MENU));
}
private function exitTowerDragMode(_arg1:MouseEvent):void{
var _local2:Stage = StageReference.getStage();
_local2.removeEventListener(MouseEvent.MOUSE_UP, exitTowerDragMode);
var _local3:int = (this.mouseX - m_placementOffsetX);
var _local4:int = (this.mouseY - m_placementOffsetY);
var _local5:int = Math.floor((_local3 / Map.tileW));
var _local6:int = Math.floor((_local4 / Map.tileH));
var _local7:Boolean;
if ((((((((_local5 > 1)) && ((_local5 < 25)))) && ((_local6 > 1)))) && ((_local6 < 15)))){
if (m_availableMapCells[_local6][_local5] == true){
_local7 = true;
};
};
removeChild(m_draggingTower);
m_draggingTower = null;
m_availableMapCells = null;
m_buildDisplay.endDrag();
changePanel(INACTIVE);
if (_local7){
trace(((((("build tower at " + _local5) + ",") + _local6) + " of type ") + m_draggingTowerType));
GameBroadcaster.dispatchEvent(new TowerEvent(TowerEvent.BUILD_TOWER, null, 1, false, false, false, m_draggingTowerType, _local5, _local6));
};
}
private function onTowerSellHandler(_arg1:HUDEvent):void{
var _local2:ITower = m_selectedTower;
if (m_state == TOWER_SELECTED){
exitSelectionMode();
};
changePanel(INACTIVE);
GameBroadcaster.dispatchEvent(new TowerEvent(TowerEvent.SELL_TOWER, _local2));
}
private function exitSelectionMode():void{
trace(("UNSELECTING " + m_selectedTower));
m_selectedTower = null;
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.SELECTED_TOWER_CLEAR_SELECTION));
}
private function onTowerPreviewRollout(_arg1:HUDEvent):void{
trace(("HUD tower preview rollout " + _arg1.towerType));
if (m_state == TOWER_DRAG){
} else {
if (m_selectedTower != null){
changePanel(TOWER_SELECTED, "", m_selectedTower);
} else {
if (m_state != TOWER_DRAG){
changePanel(INACTIVE);
};
};
};
}
private function enterSelectionMode(_arg1:ITower):void{
trace(("SELECTING " + _arg1));
m_selectedTower = _arg1;
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.SELECTED_TOWER_DRAW_SELECTION, "", m_selectedTower));
}
private function onCloseExitPanelHandler(_arg1:HUDEvent):void{
if (m_confirmExitPanel != null){
m_confirmExitPanel.destroy();
};
}
private function onAddTower(_arg1:TowerEvent):void{
trace(("HUDController heard about an build tower complete! " + _arg1.towerObject));
BaseTower(_arg1.towerObject).addEventListener(MouseEvent.CLICK, onTowerClick, false, 0, true);
}
private function onTowerPreviewRollover(_arg1:HUDEvent):void{
trace(("HUD tower preview rollover " + _arg1.towerType));
if ((((m_state == TOWER_SELECTED)) || ((m_state == TOWER_SELECTED_UPGRADES)))){
};
if (m_state != TOWER_DRAG){
changePanel(TOWER_PREVIEW, _arg1.towerType);
};
}
private function onSellTower(_arg1:TowerEvent):void{
trace(("HUDController heard about a sell tower! " + _arg1.towerObject));
BaseTower(_arg1.towerObject).removeEventListener(MouseEvent.CLICK, onTowerClick);
}
private function manageDraggingTowerPhysics():void{
var _local1:int = (this.mouseX - m_placementOffsetX);
var _local2:int = (this.mouseY - m_placementOffsetY);
var _local3:int = Math.floor((_local1 / Map.tileW));
var _local4:int = Math.floor((_local2 / Map.tileH));
if ((((((((_local3 > 1)) && ((_local3 < 25)))) && ((_local4 > 1)))) && ((_local4 < 15)))){
m_draggingX = (((_local3 * Map.tileW) + Map.tileHalfW) + m_placementOffsetX);
m_draggingY = (((_local4 * Map.tileH) + Map.tileHalfH) + m_placementOffsetY);
if (((!((_local3 == m_draggingCellX))) || (!((_local4 == m_draggingCellY))))){
m_draggingCellX = _local3;
m_draggingCellY = _local4;
m_buildDisplay.newCell(m_draggingCellX, m_draggingCellY);
};
} else {
m_draggingX = this.mouseX;
m_draggingY = this.mouseY;
m_buildDisplay.hideDisplay();
};
}
public function destroy():void{
m_mapRef.removeEventListener(MouseEvent.CLICK, onMapClick);
GameBroadcaster.removeEventListener(TowerEvent.BUILD_TOWER_COMPLETE, onAddTower);
GameBroadcaster.removeEventListener(TowerEvent.SELL_TOWER, onSellTower);
GameBroadcaster.removeEventListener(TowerEvent.TOWER_UPGRADE_COMPLETE, onUpgradeTowerComplete);
GameBroadcaster.removeEventListener(HUDEvent.PREVIEW_TOWER_ROLL_OVER, onTowerPreviewRollover);
GameBroadcaster.removeEventListener(HUDEvent.PREVIEW_TOWER_ROLL_OUT, onTowerPreviewRollout);
GameBroadcaster.removeEventListener(HUDEvent.PREVIEW_TOWER_MOUSE_DOWN, onTowerPreviewMouseDown);
GameBroadcaster.removeEventListener(HUDEvent.SELECTED_TOWER_SELL, onTowerSellHandler);
GameBroadcaster.removeEventListener(HUDEvent.SELECTED_TOWER_SHOW_UPGRADES, onTowerShowUpgradesHandler);
GameBroadcaster.removeEventListener(HUDEvent.CLOSE_UPGRADE_PANEL, onCloseTowerUpgradesHandler);
GameBroadcaster.removeEventListener(HUDEvent.APPLY_UPGRADE, onApplyUpgradeHandler);
GameBroadcaster.removeEventListener(GameEvent.PAUSE_GAME, pauseGameHandler);
GameBroadcaster.removeEventListener(GameEvent.RESUME_GAME, resumeGameHandler);
GameBroadcaster.removeEventListener(GameEvent.GAME_WON_DISPLAY, gameWonLostHandler);
GameBroadcaster.removeEventListener(GameEvent.GAME_LOST_DISPLAY, gameWonLostHandler);
GameBroadcaster.removeEventListener(HUDEvent.CONFIRM_BACK_TO_MENU, exitPanelConfirmHandler);
GameBroadcaster.removeEventListener(HUDEvent.CLOSE_EXIT_PANEL, onCloseExitPanelHandler);
GameBroadcaster.removeEventListener(HUDEvent.QUIT_GAME, quitGameHandler);
var _local1:Stage = StageReference.getStage();
_local1.removeEventListener(MouseEvent.MOUSE_UP, exitTowerDragMode);
if (m_state == TOWER_DRAG){
removeChild(m_draggingTower);
m_draggingTower = null;
m_availableMapCells = null;
m_buildDisplay.endDrag();
};
m_rightPanel.destroy();
m_centerPanel.destroy();
m_livesPanel.destroy();
m_pauseMenuPanel.destroy();
m_buildDisplay.destroy();
if (m_gamePausedPanel != null){
m_gamePausedPanel.destroy();
};
if (m_confirmExitPanel != null){
m_confirmExitPanel.destroy();
};
if (m_gameOverPanel != null){
m_gameOverPanel.destroy();
};
var _local2:Array = TowerData.instance.towerArray;
var _local3:int;
while (_local3 < _local2.length) {
_local2[_local3].removeEventListener(MouseEvent.CLICK, onTowerClick);
_local3++;
};
}
private function onTowerShowUpgradesHandler(_arg1:HUDEvent):void{
changePanel(TOWER_SELECTED_UPGRADES, "", m_selectedTower);
}
}
}//package game.hud
Section 278
//HUDRangeDisplay (game.hud.HUDRangeDisplay)
package game.hud {
import game.events.*;
import interfaces.*;
import org.casalib.display.*;
import game.*;
import gs.easing.*;
import gs.*;
public class HUDRangeDisplay extends CasaSprite {
private var m_shape:CasaSprite;
public function HUDRangeDisplay(){
GameBroadcaster.addEventListener(HUDEvent.SELECTED_TOWER_DRAW_SELECTION, drawSelectionHandler, false, 0, true);
GameBroadcaster.addEventListener(HUDEvent.SELECTED_TOWER_CLEAR_SELECTION, clearSelectionHandler, false, 0, true);
this.mouseEnabled = false;
this.mouseChildren = false;
}
private function clearRangeCircle():void{
m_shape.destroy();
}
override public function destroy():void{
GameBroadcaster.removeEventListener(HUDEvent.SELECTED_TOWER_DRAW_SELECTION, drawSelectionHandler);
GameBroadcaster.removeEventListener(HUDEvent.SELECTED_TOWER_CLEAR_SELECTION, clearSelectionHandler);
TweenMax.killTweensOf(this);
TweenMax.killTweensOf(m_shape);
if (m_shape != null){
m_shape.destroy();
};
super.destroy();
}
private function drawSelectionHandler(_arg1:HUDEvent):void{
var _local2:ITower = _arg1.towerObject;
var _local3:Object = _local2.getPosition();
var _local4:int = _local3.x;
var _local5:int = _local3.y;
var _local6:int = _local2.getRange();
drawRangeCircle(_local4, _local5, _local6);
}
private function drawRangeCircle(_arg1:int, _arg2:int, _arg3:int):void{
if (m_shape != null){
m_shape.destroy();
};
m_shape = new CasaSprite();
addChild(m_shape);
m_shape.x = (_arg1 + Map.tileHalfW);
m_shape.y = (_arg2 + Map.tileHalfH);
m_shape.graphics.beginFill(0xFFFFFF, 0.05);
m_shape.graphics.lineStyle(2, 4763837, 1);
m_shape.graphics.drawCircle(0, 0, _arg3);
TweenMax.to(m_shape, 0.25, {glowFilter:{color:3714235, alpha:1, blurX:10, blurY:10, strength:1, quality:1}});
}
private function clearSelectionHandler(_arg1:HUDEvent):void{
clearRangeCircle();
}
}
}//package game.hud
Section 279
//LivesPanel (game.hud.LivesPanel)
package game.hud {
import game.events.*;
import assets.hud.*;
public class LivesPanel extends BasePanel {
private var m_currentPercentage:Number;
private var m_isAnimating:Boolean;// = false
private var m_goalPercentage:Number;
public function LivesPanel(){
m_container = new LivesPanelGraphic();
addChild(m_container);
GameBroadcaster.addEventListener(GameEvent.LIFE_LOST, onLivesChange, false, 0, true);
m_goalPercentage = 1;
m_currentPercentage = 1;
m_isAnimating = false;
m_container.livesProgress.aliveMask.scaleX = m_currentPercentage;
m_container.livesProgress.deadMask.scaleX = (1 - m_currentPercentage);
}
override public function doPhysics():void{
if (m_isAnimating){
updateLivesProgress();
};
}
private function updateLivesProgress():void{
m_currentPercentage = (m_currentPercentage - 0.01);
if (m_currentPercentage < m_goalPercentage){
m_currentPercentage = m_goalPercentage;
m_isAnimating = false;
} else {
if (m_goalPercentage == 0){
m_currentPercentage = 0;
};
};
}
override public function doRender():void{
super.doRender();
if (m_isAnimating){
updateLivesRender();
};
}
private function updateLivesRender():void{
m_container.livesProgress.aliveMask.scaleX = m_currentPercentage;
m_container.livesProgress.deadMask.scaleX = (1 - m_currentPercentage);
}
private function onLivesChange(_arg1:GameEvent):void{
m_goalPercentage = (_arg1.currentLives / _arg1.totalLives);
m_isAnimating = true;
}
override public function destroy():void{
GameBroadcaster.removeEventListener(GameEvent.LIFE_LOST, onLivesChange);
super.destroy();
}
}
}//package game.hud
Section 280
//NoSelectionPanel (game.hud.NoSelectionPanel)
package game.hud {
import assets.hud.*;
public class NoSelectionPanel extends BasePanel {
public function NoSelectionPanel(){
m_container = new NoSelectionPanel();
addChild(m_container);
}
override public function destroy():void{
super.destroy();
}
}
}//package game.hud
Section 281
//PauseMenuPanel (game.hud.PauseMenuPanel)
package game.hud {
import flash.events.*;
import game.events.*;
import ui.*;
import assets.hud.*;
public class PauseMenuPanel extends BasePanel {
private var m_menuButton:BlueGlowButton;
private var m_pauseButton:BlueGlowButton;
public function PauseMenuPanel(){
m_container = new PauseMenuGraphic();
addChild(m_container);
GameBroadcaster.addEventListener(GameEvent.PAUSE_GAME, pauseGameHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.RESUME_GAME, resumeGameHandler, false, 0, true);
m_menuButton = new BlueGlowButton(m_container.menuButton);
m_menuButton.addEventListener(BlueGlowButton.CLICKED, onMenuClick, false, 0, true);
m_pauseButton = new BlueGlowButton(m_container.pauseButton);
m_pauseButton.addEventListener(BlueGlowButton.CLICKED, onPauseClick, false, 0, true);
}
private function pauseGameHandler(_arg1:GameEvent):void{
}
private function onMenuClick(_arg1:Event):void{
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.CONFIRM_BACK_TO_MENU));
}
private function onPauseClick(_arg1:Event):void{
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.PAUSE_GAME));
}
override public function destroy():void{
GameBroadcaster.removeEventListener(GameEvent.PAUSE_GAME, pauseGameHandler);
GameBroadcaster.removeEventListener(GameEvent.RESUME_GAME, resumeGameHandler);
m_menuButton.removeEventListener(BlueGlowButton.CLICKED, onMenuClick);
m_pauseButton.removeEventListener(BlueGlowButton.CLICKED, onPauseClick);
m_menuButton.destroy();
m_pauseButton.destroy();
super.destroy();
}
private function resumeGameHandler(_arg1:GameEvent):void{
}
}
}//package game.hud
Section 282
//PreviewPanel (game.hud.PreviewPanel)
package game.hud {
import game.finance.*;
import game.towers.*;
import assets.hud.*;
public class PreviewPanel extends BasePanel {
private var m_towerType:String;
private var m_stats:StatBar;
public function PreviewPanel(_arg1:String){
var _local2:String;
var _local3:int;
super();
m_towerType = _arg1;
m_container = new PreviewPanel();
addChild(m_container);
m_stats = new StatBar(m_container.statBar);
switch (m_towerType){
case TowerController.BLASTER:
_local2 = "BUMBLEBEE AUTOBOT (1)";
_local3 = FinanceData.instance.costTable[TowerController.BLASTER][TowerController.LEVEL_1];
m_container.disc.gotoAndStop("bumblebee");
break;
case TowerController.SLOWDOWN:
_local2 = "JAZZ AUTOBOT (1)";
_local3 = FinanceData.instance.costTable[TowerController.SLOWDOWN][TowerController.LEVEL_1];
m_container.disc.gotoAndStop("jazz");
break;
case TowerController.ROCKET:
_local2 = "IRONHIDE AUTOBOT (1)";
_local3 = FinanceData.instance.costTable[TowerController.ROCKET][TowerController.LEVEL_1];
m_container.disc.gotoAndStop("ironhide");
break;
case TowerController.MORTAR:
_local2 = "RATCHET AUTOBOT (1)";
_local3 = FinanceData.instance.costTable[TowerController.MORTAR][TowerController.LEVEL_1];
m_container.disc.gotoAndStop("ratchet");
break;
case TowerController.LASER:
_local2 = "OPTIMUS PRIME AUTOBOT (1)";
_local3 = FinanceData.instance.costTable[TowerController.LASER][TowerController.LEVEL_1];
m_container.disc.gotoAndStop("optimus");
break;
};
m_container.towerType_txt.text = _local2;
m_container.cost_txt.text = _local3;
m_stats.initialiseWithType(m_towerType, TowerController.LEVEL_1);
}
override public function destroy():void{
super.destroy();
}
}
}//package game.hud
Section 283
//RightPanel (game.hud.RightPanel)
package game.hud {
import flash.events.*;
import game.events.*;
import game.finance.*;
import org.casalib.util.*;
import ui.*;
import assets.hud.*;
import gs.*;
public class RightPanel extends BasePanel {
private var m_timeTillNextWaveMax:int;
private var m_waveCountdownActive:Boolean;// = false
private var m_timeTillNextWaveMin:int;
private var m_waveButton:SingleGraphicGlowButton;
private var m_canSendNextWave:Boolean;// = false
private var m_isAtLastWave:Boolean;// = false
private var m_timeTillNextWaveCounter:int;
public function RightPanel(){
m_container = new RightPanel();
addChild(m_container);
m_container.sparks_txt.text = NumberUtil.format(FinanceData.instance.playerFunds, 1, ",", "");
m_container.score_txt.text = "0";
m_container.bonus_txt.alpha = 0;
GameBroadcaster.addEventListener(FinanceEvent.UPDATE_FINANCE, onFinanceChange, false, 0, true);
GameBroadcaster.addEventListener(ScoreEvent.UPDATE_SCORE, onScoreChange, false, 0, true);
GameBroadcaster.addEventListener(WaveEvent.WAVE_LAUNCHED, onWaveLaunch, false, 0, true);
m_waveButton = new SingleGraphicGlowButton(m_container.sendNextWave, m_container.nextWaveGlow);
m_waveButton.addEventListener(SingleGraphicGlowButton.CLICKED, m_waveButtonHandler, false, 0, true);
m_waveButton.disableButton();
}
override public function doRender():void{
super.doRender();
if (m_waveCountdownActive){
updateWaveRender();
};
}
override public function destroy():void{
TweenMax.killTweensOf(m_container.bonus_txt);
GameBroadcaster.removeEventListener(FinanceEvent.UPDATE_FINANCE, onFinanceChange);
GameBroadcaster.removeEventListener(ScoreEvent.UPDATE_SCORE, onScoreChange);
GameBroadcaster.removeEventListener(WaveEvent.WAVE_LAUNCHED, onWaveLaunch);
m_waveButton.removeEventListener(SingleGraphicGlowButton.CLICKED, m_waveButtonHandler);
m_waveButton.destroy();
super.destroy();
}
private function onScoreChange(_arg1:ScoreEvent):void{
m_container.score_txt.text = NumberUtil.format(_arg1.newScore, 1, ",", "");
if (_arg1.bonusComponent != 0){
m_container.bonus_txt.text = ("+" + NumberUtil.format(_arg1.bonusComponent, 1, ",", ""));
m_container.bonus_txt.alpha = 1;
m_container.bonus_txt.y = 36;
TweenMax.to(m_container.bonus_txt, 1.5, {delay:0.5, alpha:0});
TweenMax.to(m_container.bonus_txt, 2, {y:26});
};
}
private function onFinanceChange(_arg1:FinanceEvent):void{
m_container.sparks_txt.text = NumberUtil.format(_arg1.playerFunds, 1, ",", "");
}
override public function doPhysics():void{
if (m_waveCountdownActive){
updateWaveProgress();
};
}
private function onWaveLaunch(_arg1:WaveEvent):void{
var _local2:int = (_arg1.currentWaveID + 1);
m_container.wave_txt.text = ((_local2 + " / ") + _arg1.totalWaves);
m_waveCountdownActive = true;
m_timeTillNextWaveCounter = 0;
m_timeTillNextWaveMin = _arg1.timeTillNextWaveMin;
m_timeTillNextWaveMax = _arg1.timeTillNextWaveMax;
m_canSendNextWave = false;
m_waveButton.disableButton();
if ((_arg1.currentWaveID + 1) == _arg1.totalWaves){
m_isAtLastWave = true;
};
trace(((("wave min time: " + m_timeTillNextWaveMin) + " wave max time: ") + m_timeTillNextWaveMax));
}
private function updateWaveRender():void{
var _local1:Number = (m_timeTillNextWaveCounter / m_timeTillNextWaveMin);
var _local2:Number = (m_timeTillNextWaveCounter / m_timeTillNextWaveMax);
_local1 = ((_local1)>1) ? 1 : _local1;
_local2 = ((_local2)>1) ? 1 : _local2;
m_container.waveProgress.minMask.scaleX = _local1;
m_container.waveProgress.maxMask.scaleX = _local2;
}
private function m_waveButtonHandler(_arg1:Event):void{
trace(((("RightPanel nextWaveButton click, timer: " + m_timeTillNextWaveCounter) + " min: ") + m_timeTillNextWaveMin));
GameBroadcaster.dispatchEvent(new WaveEvent(WaveEvent.REQUEST_NEXT_WAVE));
}
private function updateWaveProgress():void{
m_timeTillNextWaveCounter++;
if (((((!(m_isAtLastWave)) && (!(m_canSendNextWave)))) && ((m_timeTillNextWaveCounter >= m_timeTillNextWaveMin)))){
m_canSendNextWave = true;
m_waveButton.enableButton();
};
}
}
}//package game.hud
Section 284
//SelectedPanel (game.hud.SelectedPanel)
package game.hud {
import flash.events.*;
import game.events.*;
import interfaces.*;
import game.finance.*;
import game.towers.*;
import ui.*;
import assets.hud.*;
public class SelectedPanel extends BasePanel {
private var m_stats:StatBar;
private var m_towerType:String;
private var m_upgradeBtn:DoubleGraphicButton;
private var m_tower:ITower;
private var m_sellBtn:DoubleGraphicButton;
public function SelectedPanel(_arg1:ITower){
var _local3:String;
super();
m_container = new SelectedPanel();
addChild(m_container);
m_tower = _arg1;
m_towerType = TowerController.getTowerTypeString(m_tower);
var _local2 = (("(" + m_tower.getLevel()) + ")");
var _local4:int = FinanceController.evaluateTowerForSale(m_tower);
switch (m_towerType){
case TowerController.BLASTER:
_local3 = ("BUMBLEBEE AUTOBOT " + _local2);
break;
case TowerController.SLOWDOWN:
_local3 = ("JAZZ AUTOBOT " + _local2);
break;
case TowerController.ROCKET:
_local3 = ("IRONHIDE AUTOBOT " + _local2);
break;
case TowerController.MORTAR:
_local3 = ("RATCHET AUTOBOT " + _local2);
break;
case TowerController.LASER:
_local3 = ("OPTIMUS PRIME AUTOBOT " + _local2);
break;
};
m_container.towerType_txt.text = _local3;
m_stats = new StatBar(m_container.statBar);
m_stats.initialiseWithTower(m_tower);
var _local5:Object = m_tower.getUpgrades();
if (_local5.hasFrequencyBonus){
m_container.frequencyCheckbox.gotoAndStop("on");
} else {
m_container.frequencyCheckbox.gotoAndStop("off");
};
if (_local5.hasResponseBonus){
m_container.responseCheckbox.gotoAndStop("on");
} else {
m_container.responseCheckbox.gotoAndStop("off");
};
if (_local5.hasRangeBonus){
m_container.rangeCheckbox.gotoAndStop("on");
} else {
m_container.rangeCheckbox.gotoAndStop("off");
};
m_container.upgradeOver.txt.text = "UPGRADE";
m_container.upgradeOver.mouseChildren = false;
m_container.upgradeOff.txt.text = "UPGRADE";
m_container.upgradeOff.mouseChildren = false;
m_upgradeBtn = new DoubleGraphicButton(m_container.upgradeOff, m_container.upgradeOver);
m_upgradeBtn.addEventListener(DoubleGraphicButton.CLICKED, onUpgradeClick, false, 0, true);
if (((((((_local5.hasFrequencyBonus) && (_local5.hasResponseBonus))) && (_local5.hasRangeBonus))) && ((m_tower.getLevel() == 3)))){
m_container.upgradeOver.mouseEnabled = false;
m_container.upgradeOff.mouseEnabled = false;
m_container.upgradeOver.alpha = 0;
m_container.upgradeOff.alpha = 0.5;
};
m_container.sellOver.txt.text = (_local4 + " SPARKS");
m_container.sellOver.mouseChildren = false;
m_container.sellOff.txt.text = "SELL";
m_container.sellOff.mouseChildren = false;
m_sellBtn = new DoubleGraphicButton(m_container.sellOff, m_container.sellOver);
m_sellBtn.addEventListener(DoubleGraphicButton.CLICKED, onSellClick, false, 0, true);
}
override public function destroy():void{
m_upgradeBtn.removeEventListener(DoubleGraphicButton.CLICKED, onUpgradeClick);
m_sellBtn.removeEventListener(DoubleGraphicButton.CLICKED, onSellClick);
m_upgradeBtn.destroy();
m_sellBtn.destroy();
super.destroy();
}
private function onUpgradeClick(_arg1:Event):void{
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.SELECTED_TOWER_SHOW_UPGRADES));
}
private function onSellClick(_arg1:Event):void{
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.SELECTED_TOWER_SELL));
}
}
}//package game.hud
Section 285
//StatBar (game.hud.StatBar)
package game.hud {
import flash.events.*;
import flash.display.*;
import interfaces.*;
import game.towers.*;
import game.weapons.*;
import gs.easing.*;
import gs.*;
public class StatBar extends EventDispatcher {
private var m_hasRangeBonus:Boolean;
private var m_hasFrequencyBonus:Boolean;
private var m_towerLevel:String;
private var m_container:MovieClip;
private var m_towerType:String;
private var m_hasResponseBonus:Boolean;
private static const DAMAGE_MAX:int = 40;
private static const RANGE_BEST:int = 150;
private static const RANGE_WORST:int = 0;
private static const DAMAGE_WORST:int = 0;
public function StatBar(_arg1:MovieClip){
m_container = _arg1;
}
public function destroy():void{
}
public function showUpgrades(_arg1:String, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean):void{
displayUpgradeStats(m_towerType, _arg1, _arg2, _arg3, _arg4);
}
private function displayBaseStats(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean):void{
var _local6:Number = calculateFrequency(_arg1, _arg2, _arg3);
var _local7:Number = calculateResponse(_arg1, _arg2, _arg4);
var _local8:Number = calculateRange(_arg1, _arg2, _arg5);
var _local9:Number = calculateDamage(_arg1, _arg2);
m_container.frequency.currentBar.scaleX = _local6;
m_container.frequency.upgradeBar.scaleX = 0;
m_container.response.currentBar.scaleX = _local7;
m_container.response.upgradeBar.scaleX = 0;
m_container.range.currentBar.scaleX = _local8;
m_container.range.upgradeBar.scaleX = 0;
m_container.damage.currentBar.scaleX = _local9;
m_container.damage.upgradeBar.scaleX = 0;
}
private function displayUpgradeStats(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean):void{
var _local6:Number = calculateFrequency(_arg1, _arg2, _arg3);
var _local7:Number = calculateResponse(_arg1, _arg2, _arg4);
var _local8:Number = calculateRange(_arg1, _arg2, _arg5);
var _local9:Number = calculateDamage(_arg1, _arg2);
m_container.frequency.upgradeBar.scaleX = _local6;
m_container.response.upgradeBar.scaleX = _local7;
m_container.range.upgradeBar.scaleX = _local8;
m_container.damage.upgradeBar.scaleX = _local9;
}
private function calculateRange(_arg1:String, _arg2:String, _arg3:Boolean):Number{
var _local4:Number = TowerData.instance.rangeTable[_arg1][_arg2];
if (_arg3){
_local4 = (_local4 * TowerData.instance.rangeTable[_arg1][TowerController.RANGE_BONUS]);
};
var _local5:Number = percentageBetween(RANGE_WORST, RANGE_BEST, _local4);
if (_local5 > 1){
_local5 = 1;
} else {
if (_local5 < 0){
_local5 = 0;
};
};
return (_local5);
}
private function calculateResponse(_arg1:String, _arg2:String, _arg3:Boolean):Number{
var _local4:Number = TowerData.instance.responseTable[_arg1][_arg2];
if (_arg3){
_local4 = (_local4 * TowerData.instance.responseTable[_arg1][TowerController.RESPONSE_BONUS]);
};
var _local5:Number = (0.1 + (2 / _local4));
if (_local5 > 1){
_local5 = 1;
} else {
if (_local5 < 0){
_local5 = 0;
};
};
return (_local5);
}
private function calculateFrequency(_arg1:String, _arg2:String, _arg3:Boolean):Number{
var _local4:Number = TowerData.instance.frequencyTable[_arg1][_arg2];
if (_arg3){
_local4 = (_local4 * TowerData.instance.frequencyTable[_arg1][TowerController.FREQUENCY_BONUS]);
};
var _local5:Number = (0.1 + (2 / _local4));
if (_local5 > 1){
_local5 = 1;
} else {
if (_local5 < 0){
_local5 = 0;
};
};
return (_local5);
}
public function clearUpgradeStats():void{
m_container.frequency.upgradeBar.scaleX = 0;
m_container.response.upgradeBar.scaleX = 0;
m_container.range.upgradeBar.scaleX = 0;
m_container.damage.upgradeBar.scaleX = 0;
}
private function percentageBetween(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
var _local5:Number;
if (_arg2 >= _arg1){
_local4 = (_arg2 - _arg1);
_local5 = ((_arg3 - _arg1) / _local4);
} else {
_local4 = (_arg1 - _arg2);
_local5 = (1 - ((_arg3 - _arg2) / _local4));
};
return (_local5);
}
private function calculateDamage(_arg1:String, _arg2:String):Number{
var _local3:Number;
if (_arg1 == TowerController.SLOWDOWN){
_local3 = ((1 - WeaponData.instance.damageTable[_arg1][_arg2]) * DAMAGE_MAX);
} else {
_local3 = WeaponData.instance.damageTable[_arg1][_arg2];
};
var _local4:Number = percentageBetween(DAMAGE_WORST, DAMAGE_MAX, _local3);
if (_local4 > 1){
_local4 = 1;
} else {
if (_local4 < 0){
_local4 = 0;
};
};
return (_local4);
}
public function initialiseWithType(_arg1:String, _arg2:String):void{
m_towerType = _arg1;
m_towerLevel = _arg2;
m_hasFrequencyBonus = false;
m_hasResponseBonus = false;
m_hasRangeBonus = false;
displayBaseStats(m_towerType, m_towerLevel, m_hasFrequencyBonus, m_hasResponseBonus, m_hasRangeBonus);
}
public function initialiseWithTower(_arg1:ITower):void{
m_towerType = TowerController.getTowerTypeString(_arg1);
m_towerLevel = TowerController.getTowerLevelString(_arg1);
var _local2:Object = _arg1.getUpgrades();
m_hasFrequencyBonus = _local2.hasFrequencyBonus;
m_hasResponseBonus = _local2.hasResponseBonus;
m_hasRangeBonus = _local2.hasRangeBonus;
displayBaseStats(m_towerType, m_towerLevel, m_hasFrequencyBonus, m_hasResponseBonus, m_hasRangeBonus);
}
}
}//package game.hud
Section 286
//TowerSelectionButton (game.hud.TowerSelectionButton)
package game.hud {
import flash.events.*;
import flash.display.*;
import gs.*;
public class TowerSelectionButton extends EventDispatcher {
private var m_over:MovieClip;
private var m_disabled:MovieClip;
private var m_enabled:MovieClip;
private var m_disableClick:Boolean;// = false
public static var ROLL_OVER:String = "TowerSelectionRollover";
public static var MOUSE_DOWN:String = "TowerSelectionMouseDown";
public static var ROLL_OUT:String = "TowerSelectionRollout";
public function TowerSelectionButton(_arg1:MovieClip, _arg2:MovieClip, _arg3:MovieClip){
m_disabled = _arg1;
m_enabled = _arg2;
m_over = _arg3;
m_over.buttonMode = true;
m_over.alpha = 0;
m_over.addEventListener(MouseEvent.ROLL_OUT, handleRollOut, false, 0, true);
m_over.addEventListener(MouseEvent.ROLL_OVER, handleRollOver, false, 0, true);
m_over.addEventListener(MouseEvent.MOUSE_DOWN, handleMouseDown, false, 0, true);
}
public function destroy():void{
m_over.removeEventListener(MouseEvent.ROLL_OUT, handleRollOut);
m_over.removeEventListener(MouseEvent.ROLL_OVER, handleRollOver);
m_over.removeEventListener(MouseEvent.CLICK, handleMouseDown);
}
private function handleRollOut(_arg1:MouseEvent=null):void{
if (!m_disableClick){
TweenMax.to(m_over, 0.25, {alpha:0});
};
dispatchEvent(new Event(ROLL_OUT));
}
public function enableButton():void{
m_disableClick = false;
m_over.buttonMode = true;
TweenMax.to(m_enabled, 0.25, {alpha:1});
}
private function handleRollOver(_arg1:MouseEvent=null):void{
if (!m_disableClick){
TweenMax.to(m_over, 0.25, {alpha:1});
};
dispatchEvent(new Event(ROLL_OVER));
}
public function disableButton():void{
m_disableClick = true;
m_over.buttonMode = false;
TweenMax.to(m_over, 0.25, {alpha:0});
TweenMax.to(m_enabled, 0.25, {alpha:0});
}
private function handleMouseDown(_arg1:MouseEvent=null):void{
if (!m_disableClick){
dispatchEvent(new Event(MOUSE_DOWN));
};
}
}
}//package game.hud
Section 287
//UpgradeOptionsButton (game.hud.UpgradeOptionsButton)
package game.hud {
import flash.events.*;
import flash.display.*;
import gs.*;
public class UpgradeOptionsButton extends EventDispatcher {
private var m_over:MovieClip;
private var m_used:MovieClip;
private var m_disableClick:Boolean;// = false
private var m_off:MovieClip;
private var m_unavailable:MovieClip;
private var m_state:String;
public static const UPGRADE_AVAILABLE:String = "upgradeAvailable";
public static const CLICKED:String = "upgradeBtnClicked";
public static const OFF:String = "upgradeBtnOff";
public static const OVER:String = "upgradeBtnOver";
public static const UPGRADE_APPLIED:String = "upgradeApplied";
public static const UPGRADE_DISABLED:String = "upgradeDisabled";
public function UpgradeOptionsButton(_arg1:MovieClip, _arg2:MovieClip, _arg3:MovieClip, _arg4:MovieClip){
m_over = _arg1;
m_off = _arg2;
m_used = _arg3;
m_unavailable = _arg4;
m_over.addEventListener(MouseEvent.ROLL_OUT, handleRollOut, false, 0, true);
m_over.addEventListener(MouseEvent.ROLL_OVER, handleRollOver, false, 0, true);
m_over.addEventListener(MouseEvent.CLICK, handleClick, false, 0, true);
m_state = UPGRADE_DISABLED;
m_over.alpha = 0;
m_off.alpha = 0;
m_used.alpha = 0;
m_over.mouseEnabled = true;
m_over.mouseChildren = false;
}
private function handleClick(_arg1:MouseEvent=null):void{
if (!m_disableClick){
dispatchEvent(new Event(CLICKED));
};
}
public function destroy():void{
m_over.removeEventListener(MouseEvent.ROLL_OUT, handleRollOut);
m_over.removeEventListener(MouseEvent.ROLL_OVER, handleRollOver);
m_over.removeEventListener(MouseEvent.CLICK, handleClick);
}
public function updateState(_arg1:String):void{
trace(("updateState " + _arg1));
if (_arg1 == UPGRADE_DISABLED){
TweenMax.to(m_over, 0.25, {alpha:0});
TweenMax.to(m_off, 0.25, {alpha:0});
TweenMax.to(m_used, 0.25, {alpha:0});
m_disableClick = true;
m_over.buttonMode = false;
} else {
if (_arg1 == UPGRADE_APPLIED){
TweenMax.to(m_over, 0.25, {alpha:0});
TweenMax.to(m_off, 0.25, {alpha:0});
TweenMax.to(m_used, 0.25, {alpha:1});
m_disableClick = true;
m_over.buttonMode = false;
m_over.mouseEnabled = false;
} else {
if ((((_arg1 == UPGRADE_AVAILABLE)) && (!((m_state == UPGRADE_AVAILABLE))))){
TweenMax.to(m_off, 0.25, {alpha:1});
m_disableClick = false;
m_over.buttonMode = true;
};
};
};
m_state = _arg1;
}
private function handleRollOut(_arg1:MouseEvent=null):void{
if (!m_disableClick){
TweenMax.to(m_over, 0.25, {alpha:0});
};
dispatchEvent(new Event(OFF));
}
private function handleRollOver(_arg1:MouseEvent=null):void{
if (!m_disableClick){
TweenMax.to(m_over, 0.25, {alpha:1});
};
dispatchEvent(new Event(OVER));
}
}
}//package game.hud
Section 288
//UpgradePanel (game.hud.UpgradePanel)
package game.hud {
import flash.events.*;
import game.events.*;
import interfaces.*;
import game.finance.*;
import game.towers.*;
import ui.*;
import assets.hud.*;
import gs.*;
public class UpgradePanel extends BasePanel {
private var m_rangeOption:UpgradeOptionsButton;
private var m_frequencyCostText:String;
private var m_stats:StatBar;
private var m_towerType:String;
private var m_towerLevel:String;
private var m_levelOption:UpgradeOptionsButton;
private var m_responseCostText:String;
private var m_towerUpgradeLevelValid:Boolean;
private var m_frequencyOption:UpgradeOptionsButton;
private var m_rangeCostText:String;
private var m_towerUpgradeLevel:String;
private var m_responseOption:UpgradeOptionsButton;
private var m_levelCostText:String;
private var m_cancelBtn:DoubleGraphicButton;
private var m_tower:ITower;
public function UpgradePanel(_arg1:ITower){
var _local2:String;
super();
m_container = new UpgradePanel();
addChild(m_container);
m_tower = _arg1;
m_towerType = TowerController.getTowerTypeString(m_tower);
m_towerLevel = TowerController.getTowerLevelString(m_tower);
m_container.title_txt.text = "SELECT AN UPGRADE OPTION";
m_stats = new StatBar(m_container.statBar);
m_stats.initialiseWithTower(m_tower);
m_container.tooltip.alpha = 0;
m_container.tooltip.mouseEnabled = false;
m_container.tooltip.mouseChildren = false;
m_container.cancelOver.mouseChildren = false;
m_container.cancelOff.mouseChildren = false;
m_cancelBtn = new DoubleGraphicButton(m_container.cancelOff, m_container.cancelOver);
m_cancelBtn.addEventListener(DoubleGraphicButton.CLICKED, onCancelClick, false, 0, true);
_local2 = "200Hz TRUMOTION";
m_frequencyCostText = (FinanceData.instance.costTable[m_towerType][TowerController.FREQUENCY_BONUS] + " SPARKS");
m_container.frequencyOver.txt.text = _local2;
m_container.frequencyOff.txt.text = _local2;
m_container.frequencyUsed.txt.text = _local2;
m_container.frequencyUnavailable.txt.text = _local2;
m_frequencyOption = new UpgradeOptionsButton(m_container.frequencyOver, m_container.frequencyOff, m_container.frequencyUsed, m_container.frequencyUnavailable);
m_frequencyOption.addEventListener(UpgradeOptionsButton.CLICKED, optionClickHandler, false, 0, true);
m_frequencyOption.addEventListener(UpgradeOptionsButton.OVER, optionOverHandler, false, 0, true);
m_frequencyOption.addEventListener(UpgradeOptionsButton.OFF, optionOffHandler, false, 0, true);
_local2 = "2ms RESPONSE RATE";
m_responseCostText = (FinanceData.instance.costTable[m_towerType][TowerController.RESPONSE_BONUS] + " SPARKS");
m_container.responseOver.txt.text = _local2;
m_container.responseOff.txt.text = _local2;
m_container.responseUsed.txt.text = _local2;
m_container.responseUnavailable.txt.text = _local2;
m_responseOption = new UpgradeOptionsButton(m_container.responseOver, m_container.responseOff, m_container.responseUsed, m_container.responseUnavailable);
m_responseOption.addEventListener(UpgradeOptionsButton.CLICKED, optionClickHandler, false, 0, true);
m_responseOption.addEventListener(UpgradeOptionsButton.OVER, optionOverHandler, false, 0, true);
m_responseOption.addEventListener(UpgradeOptionsButton.OFF, optionOffHandler, false, 0, true);
_local2 = "SMART ENERGY SAVING";
m_rangeCostText = (FinanceData.instance.costTable[m_towerType][TowerController.RANGE_BONUS] + " SPARKS");
m_container.rangeOver.txt.text = _local2;
m_container.rangeOff.txt.text = _local2;
m_container.rangeUsed.txt.text = _local2;
m_container.rangeUnavailable.txt.text = _local2;
m_rangeOption = new UpgradeOptionsButton(m_container.rangeOver, m_container.rangeOff, m_container.rangeUsed, m_container.rangeUnavailable);
m_rangeOption.addEventListener(UpgradeOptionsButton.CLICKED, optionClickHandler, false, 0, true);
m_rangeOption.addEventListener(UpgradeOptionsButton.OVER, optionOverHandler, false, 0, true);
m_rangeOption.addEventListener(UpgradeOptionsButton.OFF, optionOffHandler, false, 0, true);
_local2 = "LEVEL UP (MAX 3)";
var _local3:int = (m_tower.getLevel() + 1);
if (_local3 > 3){
m_towerUpgradeLevelValid = false;
_local3 = 3;
} else {
m_towerUpgradeLevelValid = true;
};
m_towerUpgradeLevel = TowerController.getTowerLevelString(null, _local3);
m_levelCostText = (FinanceData.instance.costTable[m_towerType][m_towerUpgradeLevel] + " SPARKS");
m_container.levelOver.txt.text = _local2;
m_container.levelOff.txt.text = _local2;
m_container.levelUsed.txt.text = _local2;
m_container.levelUnavailable.txt.text = _local2;
m_levelOption = new UpgradeOptionsButton(m_container.levelOver, m_container.levelOff, m_container.levelUsed, m_container.levelUnavailable);
m_levelOption.addEventListener(UpgradeOptionsButton.CLICKED, optionClickHandler, false, 0, true);
m_levelOption.addEventListener(UpgradeOptionsButton.OVER, optionOverHandler, false, 0, true);
m_levelOption.addEventListener(UpgradeOptionsButton.OFF, optionOffHandler, false, 0, true);
refreshButtonStates();
GameBroadcaster.addEventListener(FinanceEvent.UPDATE_FINANCE, financeUpdateHandler, false, 0, true);
}
override public function destroy():void{
GameBroadcaster.removeEventListener(FinanceEvent.UPDATE_FINANCE, financeUpdateHandler);
m_cancelBtn.removeEventListener(DoubleGraphicButton.CLICKED, onCancelClick);
m_cancelBtn.destroy();
TweenMax.killTweensOf(m_container.tooltip);
m_frequencyOption.removeEventListener(UpgradeOptionsButton.CLICKED, optionClickHandler);
m_frequencyOption.removeEventListener(UpgradeOptionsButton.OVER, optionOverHandler);
m_frequencyOption.removeEventListener(UpgradeOptionsButton.OFF, optionOffHandler);
m_frequencyOption.destroy();
m_responseOption.removeEventListener(UpgradeOptionsButton.CLICKED, optionClickHandler);
m_responseOption.removeEventListener(UpgradeOptionsButton.OVER, optionOverHandler);
m_responseOption.removeEventListener(UpgradeOptionsButton.OFF, optionOffHandler);
m_responseOption.destroy();
m_rangeOption.removeEventListener(UpgradeOptionsButton.CLICKED, optionClickHandler);
m_rangeOption.removeEventListener(UpgradeOptionsButton.OVER, optionOverHandler);
m_rangeOption.removeEventListener(UpgradeOptionsButton.OFF, optionOffHandler);
m_rangeOption.destroy();
m_levelOption.removeEventListener(UpgradeOptionsButton.CLICKED, optionClickHandler);
m_levelOption.removeEventListener(UpgradeOptionsButton.OVER, optionOverHandler);
m_levelOption.removeEventListener(UpgradeOptionsButton.OFF, optionOffHandler);
m_levelOption.destroy();
super.destroy();
}
private function hideTooltip():void{
TweenMax.to(m_container.tooltip, 0.25, {alpha:0});
}
private function optionClickHandler(_arg1:Event):void{
if (_arg1.target == m_frequencyOption){
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.APPLY_UPGRADE, null, null, null, true, false, false));
} else {
if (_arg1.target == m_responseOption){
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.APPLY_UPGRADE, null, null, null, false, true, false));
} else {
if (_arg1.target == m_rangeOption){
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.APPLY_UPGRADE, null, null, null, false, false, true));
} else {
if (_arg1.target == m_levelOption){
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.APPLY_UPGRADE, null, null, m_towerUpgradeLevel, false, false, false));
};
};
};
};
}
private function onCancelClick(_arg1:Event):void{
GameBroadcaster.dispatchEvent(new HUDEvent(HUDEvent.CLOSE_UPGRADE_PANEL));
}
private function showTooltip(_arg1:String):void{
TweenMax.to(m_container.tooltip, 0.25, {alpha:1});
m_container.tooltip.info.gotoAndStop(_arg1);
if (_arg1 == "frequency"){
m_container.tooltip.y = int(m_container.frequencyOver.y);
m_container.tooltip.title_txt.text = m_frequencyCostText;
} else {
if (_arg1 == "response"){
m_container.tooltip.y = int(m_container.responseOver.y);
m_container.tooltip.title_txt.text = m_responseCostText;
} else {
if (_arg1 == "range"){
m_container.tooltip.y = int(m_container.rangeOver.y);
m_container.tooltip.title_txt.text = m_rangeCostText;
} else {
if (_arg1 == "level"){
m_container.tooltip.y = int(m_container.levelOver.y);
m_container.tooltip.title_txt.text = m_levelCostText;
};
};
};
};
}
private function refreshButtonStates():void{
var _local3:String;
var _local1:Object = m_tower.getUpgrades();
var _local2:int = FinanceData.instance.playerFunds;
if (_local1.hasFrequencyBonus){
_local3 = UpgradeOptionsButton.UPGRADE_APPLIED;
} else {
if (_local2 >= FinanceData.instance.costTable[m_towerType][TowerController.FREQUENCY_BONUS]){
_local3 = UpgradeOptionsButton.UPGRADE_AVAILABLE;
} else {
_local3 = UpgradeOptionsButton.UPGRADE_DISABLED;
};
};
m_frequencyOption.updateState(_local3);
if (_local1.hasResponseBonus){
_local3 = UpgradeOptionsButton.UPGRADE_APPLIED;
} else {
if (_local2 >= FinanceData.instance.costTable[m_towerType][TowerController.RESPONSE_BONUS]){
_local3 = UpgradeOptionsButton.UPGRADE_AVAILABLE;
} else {
_local3 = UpgradeOptionsButton.UPGRADE_DISABLED;
};
};
m_responseOption.updateState(_local3);
if (_local1.hasRangeBonus){
_local3 = UpgradeOptionsButton.UPGRADE_APPLIED;
} else {
if (_local2 >= FinanceData.instance.costTable[m_towerType][TowerController.RANGE_BONUS]){
_local3 = UpgradeOptionsButton.UPGRADE_AVAILABLE;
} else {
_local3 = UpgradeOptionsButton.UPGRADE_DISABLED;
};
};
m_rangeOption.updateState(_local3);
if (!m_towerUpgradeLevelValid){
_local3 = UpgradeOptionsButton.UPGRADE_APPLIED;
} else {
if (_local2 >= FinanceData.instance.costTable[m_towerType][m_towerUpgradeLevel]){
_local3 = UpgradeOptionsButton.UPGRADE_AVAILABLE;
} else {
_local3 = UpgradeOptionsButton.UPGRADE_DISABLED;
};
};
m_levelOption.updateState(_local3);
}
private function financeUpdateHandler(_arg1:FinanceEvent):void{
refreshButtonStates();
}
private function optionOverHandler(_arg1:Event):void{
if (_arg1.target == m_frequencyOption){
m_stats.showUpgrades(m_towerLevel, true, false, false);
showTooltip("frequency");
} else {
if (_arg1.target == m_responseOption){
m_stats.showUpgrades(m_towerLevel, false, true, false);
showTooltip("response");
} else {
if (_arg1.target == m_rangeOption){
m_stats.showUpgrades(m_towerLevel, false, false, true);
showTooltip("range");
} else {
if (_arg1.target == m_levelOption){
m_stats.showUpgrades(m_towerUpgradeLevel, false, false, false);
showTooltip("level");
};
};
};
};
}
private function optionOffHandler(_arg1:Event):void{
hideTooltip();
m_stats.clearUpgradeStats();
}
}
}//package game.hud
Section 289
//ScoreController (game.score.ScoreController)
package game.score {
import game.events.*;
import mochi.as3.*;
public class ScoreController {
private var m_score:int;
private var m_md1:MochiDigits;
private var m_md2:MochiDigits;
public function ScoreController(){
m_md1 = new MochiDigits(0);
m_md2 = new MochiDigits(0);
m_score = 0;
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_KILLED, enemyKilledHandler, false, 0, true);
GameBroadcaster.addEventListener(WaveEvent.WAVE_LAUNCHED, waveLaunchedHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.GAME_WON_WAIT, gameWonHandler, false, 0, true);
}
public function mdx():int{
return ((m_md1.value + m_md2.value));
}
private function enemyKilledHandler(_arg1:EnemyEvent):void{
m_md1.addValue(_arg1.enemyObject.getScore());
m_score = (m_score + _arg1.enemyObject.getScore());
GameBroadcaster.dispatchEvent(new ScoreEvent(ScoreEvent.UPDATE_SCORE, m_score));
}
private function gameWonHandler(_arg1:GameEvent):void{
var _local2 = 1000000;
m_score = (m_score + _local2);
m_md2.addValue(_local2);
GameBroadcaster.dispatchEvent(new ScoreEvent(ScoreEvent.UPDATE_SCORE, m_score, _local2));
}
public function score():int{
return (m_score);
}
public function destroy():void{
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_KILLED, enemyKilledHandler);
GameBroadcaster.removeEventListener(WaveEvent.WAVE_LAUNCHED, waveLaunchedHandler);
GameBroadcaster.removeEventListener(GameEvent.GAME_WON_WAIT, gameWonHandler);
}
private function waveLaunchedHandler(_arg1:WaveEvent):void{
var _local2:int;
var _local3:int;
var _local4 = 100;
var _local5 = 1000;
if (_arg1.currentWaveID <= 9){
_local4 = 100;
_local5 = 1000;
_local3 = _arg1.currentWaveID;
} else {
if (_arg1.currentWaveID <= 19){
_local4 = 1000;
_local5 = 5000;
_local3 = (_arg1.currentWaveID - 10);
} else {
if (_arg1.currentWaveID <= 29){
_local4 = 5000;
_local5 = 10000;
_local3 = (_arg1.currentWaveID - 20);
} else {
if (_arg1.currentWaveID <= 39){
_local4 = 10000;
_local5 = 30000;
_local3 = (_arg1.currentWaveID - 30);
} else {
_local4 = 30000;
_local5 = 70000;
_local3 = (_arg1.currentWaveID - 40);
};
};
};
};
_local2 = ((((_local5 - _local4) * _local3) / 10) + _local4);
var _local6:Number = (1 - (_arg1.previousWaveTime / _arg1.previousWaveMaxTime));
var _local7:int = int((_local6 * _local2));
m_score = (m_score + _local7);
m_md2.addValue(_local7);
GameBroadcaster.dispatchEvent(new ScoreEvent(ScoreEvent.UPDATE_SCORE, m_score, _local7));
}
}
}//package game.score
Section 290
//BaseTower (game.towers.BaseTower)
package game.towers {
import flash.display.*;
import game.events.*;
import interfaces.*;
import org.casalib.display.*;
import game.enemies.*;
import game.*;
public class BaseTower extends CasaSprite implements ITower {
protected const m_AIMING:int = 1;
protected const m_ATTACKING:int = 2;
protected const m_SEARCHING:int = 0;
protected const m_SEARCH_AND_ATTACK:int = 3;
protected var m_gunfireEffectDuration:int;
protected var m_frequency:int;
protected var m_hasFrequencyBonus:Boolean;
protected var m_range:int;
protected var m_rotation:Number;
protected var m_canTargetAir:Boolean;
protected var m_responseCountdown:int;
protected var m_x:Number;
protected var m_y:Number;
protected var m_target:IEnemy;
protected var m_container:MovieClip;
protected var m_level:int;
protected var m_canTargetLand:Boolean;
protected var m_rotationSpeedCap:Number;
protected var m_state:int;
protected var m_frequencyCountdown:int;
protected var m_hasRangeBonus:Boolean;
protected var m_response:int;
protected var m_frequencyLevel1:int;
protected var m_frequencyLevel2:int;
protected var m_frequencyLevel3:int;
protected var m_gunfireEffectCountdown:int;
protected var m_responseLevel1:int;
protected var m_responseLevel2:int;
protected var m_responseLevel3:int;
protected var m_rangeBonusFactor:Number;
protected var m_frequencyBonusFactor:Number;
protected var m_rangeLevel1:int;
protected var m_rangeLevel2:int;
protected var m_rangeLevel3:int;
protected var m_responseBonusFactor:Number;
protected var m_hasResponseBonus:Boolean;
public function BaseTower(){
trace("BaseTower, hear me roar");
this.mouseChildren = false;
}
protected function calculateDistance(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number = (((_arg3 - _arg1) * (_arg3 - _arg1)) + ((_arg4 - _arg2) * (_arg4 - _arg2)));
_local5 = Math.sqrt(_local5);
return (_local5);
}
public function getRange():int{
return (m_range);
}
public function doRender():void{
m_container.rotation = m_rotation;
this.x = m_x;
this.y = m_y;
}
public function doUpgrade(_arg1:int=0, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false):void{
trace(((((((("BaseTower doing upgrade. level: " + _arg1) + " frequencyBonus: ") + _arg2) + " responseBonus: ") + _arg3) + " rangeBonus: ") + _arg4));
var _local5:Boolean;
if (((!((_arg1 == 0))) && (!((_arg1 == m_level))))){
m_level = _arg1;
_local5 = true;
trace(("BaseTower level changed to " + m_level));
};
if (_arg2){
m_hasFrequencyBonus = true;
trace("BaseTower frequency bonus added");
};
if (_arg3){
m_hasResponseBonus = true;
trace("BaseTower response bonus added");
};
if (_arg4){
m_hasRangeBonus = true;
trace("BaseTower range bonus added");
};
recalculateStats();
if (_local5){
updateTowerGraphics();
};
GameBroadcaster.dispatchEvent(new TowerEvent(TowerEvent.TOWER_UPGRADE_COMPLETE, this));
}
override public function destroy():void{
super.destroy();
}
public function getPosition():Object{
var _local1:Object = {};
_local1.x = m_x;
_local1.y = m_y;
_local1.rotation = m_rotation;
return (_local1);
}
protected function drawRangeCircle():void{
this.graphics.clear();
this.graphics.beginFill(1144644, 0.2);
this.graphics.lineStyle(1, 10057489, 1);
this.graphics.drawCircle(Map.tileHalfW, Map.tileHalfH, m_range);
}
protected function updateTowerGraphics():void{
}
protected function getAngleDifference(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number = ((_arg3 * Math.PI) / 180);
var _local5:Number = (Math.PI * 2);
_local4 = (_local4 % _local5);
var _local6:Number = ((Math.PI / 2) + Math.atan2((_arg2 - m_y), (_arg1 - m_x)));
if (_local6 < 0){
_local6 = (_local6 + _local5);
};
var _local7:Number = (_local6 - _local4);
if (_local7 > Math.PI){
_local7 = (_local7 - _local5);
} else {
if (_local7 < -(Math.PI)){
_local7 = (_local7 + _local5);
};
};
return (_local7);
}
public function doPhysics():void{
m_frequencyCountdown--;
doFireEffect();
if (m_state == m_SEARCHING){
doSearchMode();
} else {
if (m_state == m_ATTACKING){
doAttackMode();
};
};
}
protected function doFireEffect():void{
}
public function getUpgrades():Object{
var _local1:Object = {};
_local1.hasFrequencyBonus = m_hasFrequencyBonus;
_local1.hasResponseBonus = m_hasResponseBonus;
_local1.hasRangeBonus = m_hasRangeBonus;
return (_local1);
}
public function getLevel():int{
return (m_level);
}
protected function rangeCheck(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
if (!(((((((_arg3 > (_arg1 - m_range))) && ((_arg3 < (_arg1 + m_range))))) && ((_arg4 > (_arg2 - m_range))))) && ((_arg4 < (_arg2 + m_range))))){
return (false);
};
var _local6:Number = (((_arg3 - _arg1) * (_arg3 - _arg1)) + ((_arg4 - _arg2) * (_arg4 - _arg2)));
var _local7:Number = (_arg5 * _arg5);
if (_local6 > _local7){
return (false);
};
var _local8:Number = Math.sqrt(_local6);
return (true);
}
protected function recalculateStats():void{
if (m_level == 1){
m_frequency = m_frequencyLevel1;
} else {
if (m_level == 2){
m_frequency = m_frequencyLevel2;
} else {
if (m_level == 3){
m_frequency = m_frequencyLevel3;
};
};
};
if (m_hasFrequencyBonus){
m_frequency = (m_frequency * m_frequencyBonusFactor);
};
if (m_level == 1){
m_response = m_responseLevel1;
} else {
if (m_level == 2){
m_response = m_responseLevel2;
} else {
if (m_level == 3){
m_response = m_responseLevel3;
};
};
};
if (m_hasResponseBonus){
m_response = (m_response * m_responseBonusFactor);
};
if (m_level == 1){
m_range = m_rangeLevel1;
} else {
if (m_level == 2){
m_range = m_rangeLevel2;
} else {
if (m_level == 3){
m_range = m_rangeLevel3;
};
};
};
if (m_hasRangeBonus){
m_range = (m_range * m_rangeBonusFactor);
};
trace(((("RECALD'd - we are " + m_level) + " and now have a range of ") + m_range));
}
protected function doFire():void{
}
protected function doAttackMode():void{
var _local7:Number;
var _local8:Boolean;
var _local1:Array = EnemyData.instance.enemyArray;
var _local2:Number = _local1.indexOf(m_target);
if (_local2 < 0){
m_target = null;
m_state = m_SEARCHING;
trace("Target dead whilst attacking");
return;
};
var _local3:Object = m_target.getPosition();
var _local4:Number = _local3.x;
var _local5:Number = _local3.y;
var _local6:Boolean = rangeCheck(m_x, m_y, _local4, _local5, m_range);
if (!_local6){
m_target = null;
m_state = m_SEARCHING;
trace("Target lost whilst aiming");
} else {
_local7 = ((getAngleDifference(_local4, _local5, m_rotation) * 180) / Math.PI);
_local8 = false;
if ((((_local7 > 0)) && ((_local7 > m_rotationSpeedCap)))){
_local7 = m_rotationSpeedCap;
_local8 = true;
} else {
if ((((_local7 < 0)) && ((_local7 < -(m_rotationSpeedCap))))){
_local7 = -(m_rotationSpeedCap);
_local8 = true;
};
};
m_rotation = (m_rotation + _local7);
if ((((m_frequencyCountdown <= 0)) && (!(_local8)))){
doFire();
m_frequencyCountdown = (m_frequency + m_response);
};
};
}
protected function doSearchMode():void{
var _local3:IEnemy;
var _local5:IEnemy;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Object;
var _local10:Number;
var _local11:Number;
var _local12:Boolean;
var _local1:Array = EnemyData.instance.enemyArray;
var _local2:Boolean;
var _local4:int;
while (_local4 < _local1.length) {
_local5 = IEnemy(_local1[_local4]);
_local6 = true;
if ((_local5 is ILandEnemy)){
if (!m_canTargetLand){
_local6 = false;
};
};
_local7 = true;
if ((_local5 is IAirEnemy)){
if (!m_canTargetAir){
_local7 = false;
};
};
_local8 = _local5.isTargetable();
if (((((_local6) && (_local7))) && (_local8))){
_local9 = _local5.getPosition();
_local10 = _local9.x;
_local11 = _local9.y;
_local12 = rangeCheck(m_x, m_y, _local10, _local11, m_range);
if (_local12){
trace(((((("Enemy " + _local4) + " at ") + _local9.x) + ",") + _local9.y));
_local2 = true;
_local3 = _local5;
break;
};
};
_local4++;
};
if (_local2){
m_target = _local3;
m_state = m_ATTACKING;
};
}
}
}//package game.towers
Section 291
//BlasterTower (game.towers.BlasterTower)
package game.towers {
import game.events.*;
import game.*;
import assets.towers.*;
public class BlasterTower extends BaseTower {
public function BlasterTower(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean){
m_x = _arg1;
m_y = _arg2;
m_rotation = 0;
m_rotationSpeedCap = 25;
m_level = _arg3;
m_gunfireEffectDuration = 2;
if (m_level == 1){
m_container = new BlasterTowerL1();
} else {
if (m_level == 2){
m_container = new BlasterTowerL2();
} else {
m_container = new BlasterTowerL3();
};
};
m_container.gunfire.visible = false;
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_canTargetLand = true;
m_canTargetAir = true;
m_frequencyLevel1 = TowerData.instance.frequencyTable[TowerController.BLASTER][TowerController.LEVEL_1];
m_frequencyLevel2 = TowerData.instance.frequencyTable[TowerController.BLASTER][TowerController.LEVEL_2];
m_frequencyLevel3 = TowerData.instance.frequencyTable[TowerController.BLASTER][TowerController.LEVEL_3];
m_frequencyBonusFactor = TowerData.instance.frequencyTable[TowerController.BLASTER][TowerController.FREQUENCY_BONUS];
m_hasFrequencyBonus = _arg4;
m_responseLevel1 = TowerData.instance.responseTable[TowerController.BLASTER][TowerController.LEVEL_1];
m_responseLevel2 = TowerData.instance.responseTable[TowerController.BLASTER][TowerController.LEVEL_1];
m_responseLevel3 = TowerData.instance.responseTable[TowerController.BLASTER][TowerController.LEVEL_1];
m_responseBonusFactor = TowerData.instance.responseTable[TowerController.BLASTER][TowerController.RESPONSE_BONUS];
m_hasResponseBonus = _arg5;
m_rangeLevel1 = TowerData.instance.rangeTable[TowerController.BLASTER][TowerController.LEVEL_1];
m_rangeLevel2 = TowerData.instance.rangeTable[TowerController.BLASTER][TowerController.LEVEL_2];
m_rangeLevel3 = TowerData.instance.rangeTable[TowerController.BLASTER][TowerController.LEVEL_3];
m_rangeBonusFactor = TowerData.instance.rangeTable[TowerController.BLASTER][TowerController.RANGE_BONUS];
m_hasRangeBonus = _arg6;
recalculateStats();
m_state = m_SEARCHING;
doRender();
}
override protected function doFire():void{
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.BLASTER_FIRE, this, m_target, null, m_level));
m_gunfireEffectCountdown = m_gunfireEffectDuration;
m_container.gunfire.visible = true;
}
override protected function doFireEffect():void{
if (m_gunfireEffectCountdown > 0){
m_gunfireEffectCountdown--;
if (m_gunfireEffectCountdown == 0){
m_container.gunfire.visible = false;
};
};
}
override public function destroy():void{
super.destroy();
}
override protected function updateTowerGraphics():void{
trace("BlasterTower update tower graphics");
removeChild(m_container);
m_container = null;
if (m_level == 1){
m_container = new BlasterTowerL1();
} else {
if (m_level == 2){
m_container = new BlasterTowerL2();
} else {
m_container = new BlasterTowerL3();
};
};
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_container.gunfire.visible = false;
}
}
}//package game.towers
Section 292
//LaserTower (game.towers.LaserTower)
package game.towers {
import game.events.*;
import interfaces.*;
import game.enemies.*;
import game.*;
import assets.towers.*;
public class LaserTower extends BaseTower {
protected const AIMING_MODE:String = "aimingMode";
protected const REATTACK_MODE:String = "reattackMode";
protected var m_maxTargets:int;// = 1
protected var m_maxTargetsLevel1:int;// = 1
protected var m_maxTargetsLevel3:int;// = 3
protected var m_targetTimeArray:Array;
protected var m_maxTargetsLevel2:int;// = 2
protected var m_targetObjectArray:Array;
public function LaserTower(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean){
m_x = _arg1;
m_y = _arg2;
m_rotation = 0;
m_rotationSpeedCap = 25;
m_level = _arg3;
m_gunfireEffectDuration = 0;
if (m_level == 1){
m_container = new LaserTowerL1();
} else {
if (m_level == 2){
m_container = new LaserTowerL2();
} else {
m_container = new LaserTowerL3();
};
};
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_canTargetLand = true;
m_canTargetAir = true;
m_frequencyLevel1 = TowerData.instance.frequencyTable[TowerController.LASER][TowerController.LEVEL_1];
m_frequencyLevel2 = TowerData.instance.frequencyTable[TowerController.LASER][TowerController.LEVEL_2];
m_frequencyLevel3 = TowerData.instance.frequencyTable[TowerController.LASER][TowerController.LEVEL_3];
m_frequencyBonusFactor = TowerData.instance.frequencyTable[TowerController.LASER][TowerController.FREQUENCY_BONUS];
m_hasFrequencyBonus = _arg4;
m_responseLevel1 = TowerData.instance.responseTable[TowerController.LASER][TowerController.LEVEL_1];
m_responseLevel2 = TowerData.instance.responseTable[TowerController.LASER][TowerController.LEVEL_2];
m_responseLevel3 = TowerData.instance.responseTable[TowerController.LASER][TowerController.LEVEL_3];
m_responseBonusFactor = TowerData.instance.responseTable[TowerController.LASER][TowerController.RESPONSE_BONUS];
m_hasResponseBonus = _arg5;
m_rangeLevel1 = TowerData.instance.rangeTable[TowerController.LASER][TowerController.LEVEL_1];
m_rangeLevel2 = TowerData.instance.rangeTable[TowerController.LASER][TowerController.LEVEL_2];
m_rangeLevel3 = TowerData.instance.rangeTable[TowerController.LASER][TowerController.LEVEL_3];
m_rangeBonusFactor = TowerData.instance.rangeTable[TowerController.LASER][TowerController.RANGE_BONUS];
m_hasRangeBonus = _arg6;
m_container.gunfire.visible = false;
recalculateStats();
m_targetObjectArray = [];
m_targetTimeArray = [];
m_state = m_SEARCH_AND_ATTACK;
doRender();
}
override protected function recalculateStats():void{
super.recalculateStats();
if (m_level == 1){
m_maxTargets = m_maxTargetsLevel1;
} else {
if (m_level == 2){
m_maxTargets = m_maxTargetsLevel2;
} else {
if (m_level == 3){
m_maxTargets = m_maxTargetsLevel3;
};
};
};
}
override protected function doSearchMode():void{
var _local3:IEnemy;
var _local5:IEnemy;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Object;
var _local10:Number;
var _local11:Number;
var _local12:Boolean;
var _local1:Array = EnemyData.instance.enemyArray;
var _local2:Boolean;
var _local4:int;
while (_local4 < _local1.length) {
_local5 = IEnemy(_local1[_local4]);
_local6 = true;
if ((_local5 is ILandEnemy)){
if (!m_canTargetLand){
_local6 = false;
};
};
_local7 = true;
if ((_local5 is IAirEnemy)){
if (!m_canTargetAir){
_local7 = false;
};
};
_local8 = _local5.isTargetable();
if (((((_local6) && (_local7))) && (_local8))){
if (m_targetObjectArray.indexOf(_local5) < 0){
_local9 = _local5.getPosition();
_local10 = _local9.x;
_local11 = _local9.y;
_local12 = rangeCheck(m_x, m_y, _local10, _local11, m_range);
if (_local12){
trace(((((("Enemy " + _local4) + " at ") + _local9.x) + ",") + _local9.y));
_local2 = true;
_local3 = _local5;
break;
};
};
};
_local4++;
};
if (_local2){
m_targetObjectArray.push(_local3);
m_targetTimeArray.push(0);
};
}
protected function doAttackAttempt(_arg1:IEnemy):Boolean{
var _local2:Array = EnemyData.instance.enemyArray;
var _local3:Number = _local2.indexOf(_arg1);
if (_local3 < 0){
trace("Laser target dead before doAttackAttempt");
return (false);
};
var _local4:Object = _arg1.getPosition();
var _local5:Number = _local4.x;
var _local6:Number = _local4.y;
var _local7:Boolean = rangeCheck(m_x, m_y, _local5, _local6, m_range);
if (!_local7){
trace("Laser target lost whilst doAttackAttempt");
return (false);
};
doLaserFire(_arg1);
return (true);
}
protected function doLaserRotation():void{
var _local1:IEnemy;
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (m_targetObjectArray.length > 0){
_local1 = m_targetObjectArray[0];
_local2 = _local1.getPosition();
_local3 = _local2.x;
_local4 = _local2.y;
_local5 = ((getAngleDifference(_local3, _local4, m_rotation) * 180) / Math.PI);
if ((((_local5 > 0)) && ((_local5 > m_rotationSpeedCap)))){
_local5 = m_rotationSpeedCap;
} else {
if ((((_local5 < 0)) && ((_local5 < -(m_rotationSpeedCap))))){
_local5 = -(m_rotationSpeedCap);
};
};
m_rotation = (m_rotation + _local5);
};
}
override protected function updateTowerGraphics():void{
trace("LaserTower update tower graphics");
removeChild(m_container);
m_container = null;
if (m_level == 1){
m_container = new LaserTowerL1();
} else {
if (m_level == 2){
m_container = new LaserTowerL2();
} else {
m_container = new LaserTowerL3();
};
};
addChild(m_container);
m_container.gunfire.visible = false;
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
}
protected function doLaserFire(_arg1:IEnemy):void{
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.LASER_FIRE, this, _arg1, null, m_level));
}
override public function destroy():void{
super.destroy();
}
override public function doPhysics():void{
var _local2:Boolean;
var _local1:int;
while (_local1 < m_targetTimeArray.length) {
var _local3 = m_targetTimeArray;
var _local4 = _local1;
var _local5 = (_local3[_local4] - 1);
_local3[_local4] = _local5;
if (m_targetTimeArray[_local1] <= 0){
_local2 = doAttackAttempt(m_targetObjectArray[_local1]);
if (_local2){
m_targetTimeArray[_local1] = (m_frequency + m_response);
} else {
m_targetTimeArray.splice(_local1, 1);
m_targetObjectArray.splice(_local1, 1);
_local1--;
};
};
_local1++;
};
if (m_targetObjectArray.length < m_maxTargets){
doSearchMode();
};
doLaserRotation();
}
}
}//package game.towers
Section 293
//MortarTower (game.towers.MortarTower)
package game.towers {
import game.events.*;
import game.*;
import assets.towers.*;
public class MortarTower extends BaseTower {
public function MortarTower(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean){
m_x = _arg1;
m_y = _arg2;
m_rotation = 0;
m_rotationSpeedCap = 25;
m_level = _arg3;
m_gunfireEffectDuration = 2;
if (m_level == 1){
m_container = new MortarTowerL1();
} else {
if (m_level == 2){
m_container = new MortarTowerL2();
} else {
m_container = new MortarTowerL3();
};
};
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_canTargetLand = true;
m_canTargetAir = false;
m_frequencyLevel1 = TowerData.instance.frequencyTable[TowerController.MORTAR][TowerController.LEVEL_1];
m_frequencyLevel2 = TowerData.instance.frequencyTable[TowerController.MORTAR][TowerController.LEVEL_2];
m_frequencyLevel3 = TowerData.instance.frequencyTable[TowerController.MORTAR][TowerController.LEVEL_3];
m_frequencyBonusFactor = TowerData.instance.frequencyTable[TowerController.MORTAR][TowerController.FREQUENCY_BONUS];
m_hasFrequencyBonus = _arg4;
m_responseLevel1 = TowerData.instance.responseTable[TowerController.MORTAR][TowerController.LEVEL_1];
m_responseLevel2 = TowerData.instance.responseTable[TowerController.MORTAR][TowerController.LEVEL_2];
m_responseLevel3 = TowerData.instance.responseTable[TowerController.MORTAR][TowerController.LEVEL_3];
m_responseBonusFactor = TowerData.instance.responseTable[TowerController.MORTAR][TowerController.RESPONSE_BONUS];
m_hasResponseBonus = _arg5;
m_rangeLevel1 = TowerData.instance.rangeTable[TowerController.MORTAR][TowerController.LEVEL_1];
m_rangeLevel2 = TowerData.instance.rangeTable[TowerController.MORTAR][TowerController.LEVEL_2];
m_rangeLevel3 = TowerData.instance.rangeTable[TowerController.MORTAR][TowerController.LEVEL_3];
m_rangeBonusFactor = TowerData.instance.rangeTable[TowerController.MORTAR][TowerController.RANGE_BONUS];
m_hasRangeBonus = _arg6;
m_container.gunfire.visible = false;
recalculateStats();
m_state = m_SEARCHING;
doRender();
trace(("mortar tower can target air: " + m_canTargetAir));
}
override protected function doFire():void{
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.MORTAR_FIRE, this, m_target, null, m_level));
m_gunfireEffectCountdown = m_gunfireEffectDuration;
m_container.gunfire.visible = true;
m_target = null;
m_state = m_SEARCHING;
}
override protected function doFireEffect():void{
if (m_gunfireEffectCountdown > 0){
m_gunfireEffectCountdown--;
if (m_gunfireEffectCountdown == 0){
m_container.gunfire.visible = false;
};
};
}
override public function destroy():void{
super.destroy();
}
override protected function updateTowerGraphics():void{
trace("MortarTower update tower graphics");
removeChild(m_container);
m_container = null;
if (m_level == 1){
m_container = new MortarTowerL1();
} else {
if (m_level == 2){
m_container = new MortarTowerL2();
} else {
m_container = new MortarTowerL3();
};
};
addChild(m_container);
m_container.gunfire.visible = false;
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
}
}
}//package game.towers
Section 294
//RocketTower (game.towers.RocketTower)
package game.towers {
import game.events.*;
import game.*;
import assets.towers.*;
public class RocketTower extends BaseTower {
public function RocketTower(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean){
m_x = _arg1;
m_y = _arg2;
m_rotation = 0;
m_rotationSpeedCap = 25;
m_level = _arg3;
m_gunfireEffectDuration = 0;
if (m_level == 1){
m_container = new RocketTowerL1();
} else {
if (m_level == 2){
m_container = new RocketTowerL2();
} else {
m_container = new RocketTowerL3();
};
};
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_canTargetLand = true;
m_canTargetAir = true;
m_frequencyLevel1 = TowerData.instance.frequencyTable[TowerController.ROCKET][TowerController.LEVEL_1];
m_frequencyLevel2 = TowerData.instance.frequencyTable[TowerController.ROCKET][TowerController.LEVEL_2];
m_frequencyLevel3 = TowerData.instance.frequencyTable[TowerController.ROCKET][TowerController.LEVEL_3];
m_frequencyBonusFactor = TowerData.instance.frequencyTable[TowerController.ROCKET][TowerController.FREQUENCY_BONUS];
m_hasFrequencyBonus = _arg4;
m_responseLevel1 = TowerData.instance.responseTable[TowerController.ROCKET][TowerController.LEVEL_1];
m_responseLevel2 = TowerData.instance.responseTable[TowerController.ROCKET][TowerController.LEVEL_2];
m_responseLevel3 = TowerData.instance.responseTable[TowerController.ROCKET][TowerController.LEVEL_3];
m_responseBonusFactor = TowerData.instance.responseTable[TowerController.ROCKET][TowerController.RESPONSE_BONUS];
m_hasResponseBonus = _arg5;
m_rangeLevel1 = TowerData.instance.rangeTable[TowerController.ROCKET][TowerController.LEVEL_1];
m_rangeLevel2 = TowerData.instance.rangeTable[TowerController.ROCKET][TowerController.LEVEL_2];
m_rangeLevel3 = TowerData.instance.rangeTable[TowerController.ROCKET][TowerController.LEVEL_3];
m_rangeBonusFactor = TowerData.instance.rangeTable[TowerController.ROCKET][TowerController.RANGE_BONUS];
m_hasRangeBonus = _arg6;
m_container.gunfire.visible = false;
recalculateStats();
m_state = m_SEARCHING;
doRender();
}
override protected function doFire():void{
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.ROCKET_FIRE, this, m_target, null, m_level));
m_container.gunfire.visible = true;
m_container.gunfire.gotoAndPlay("fire");
m_target = null;
m_state = m_SEARCHING;
}
override public function destroy():void{
super.destroy();
}
override protected function updateTowerGraphics():void{
trace("RocketTower update tower graphics");
removeChild(m_container);
m_container = null;
if (m_level == 1){
m_container = new RocketTowerL1();
} else {
if (m_level == 2){
m_container = new RocketTowerL2();
} else {
m_container = new RocketTowerL3();
};
};
addChild(m_container);
m_container.gunfire.visible = false;
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
}
}
}//package game.towers
Section 295
//SlowdownTower (game.towers.SlowdownTower)
package game.towers {
import game.events.*;
import interfaces.*;
import game.enemies.*;
import game.*;
import assets.towers.*;
public class SlowdownTower extends BaseTower {
public function SlowdownTower(_arg1:int, _arg2:int, _arg3:int, _arg4:Boolean, _arg5:Boolean, _arg6:Boolean){
m_x = _arg1;
m_y = _arg2;
m_rotation = 0;
m_rotationSpeedCap = 25;
m_level = _arg3;
m_gunfireEffectDuration = 4;
if (m_level == 1){
m_container = new SlowdownTowerL1();
} else {
if (m_level == 2){
m_container = new SlowdownTowerL2();
} else {
m_container = new SlowdownTowerL3();
};
};
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
m_canTargetLand = true;
m_canTargetAir = true;
m_frequencyLevel1 = TowerData.instance.frequencyTable[TowerController.SLOWDOWN][TowerController.LEVEL_1];
m_frequencyLevel2 = TowerData.instance.frequencyTable[TowerController.SLOWDOWN][TowerController.LEVEL_2];
m_frequencyLevel3 = TowerData.instance.frequencyTable[TowerController.SLOWDOWN][TowerController.LEVEL_3];
m_frequencyBonusFactor = TowerData.instance.frequencyTable[TowerController.SLOWDOWN][TowerController.FREQUENCY_BONUS];
m_hasFrequencyBonus = _arg4;
m_responseLevel1 = TowerData.instance.responseTable[TowerController.SLOWDOWN][TowerController.LEVEL_1];
m_responseLevel2 = TowerData.instance.responseTable[TowerController.SLOWDOWN][TowerController.LEVEL_2];
m_responseLevel3 = TowerData.instance.responseTable[TowerController.SLOWDOWN][TowerController.LEVEL_3];
m_responseBonusFactor = TowerData.instance.responseTable[TowerController.SLOWDOWN][TowerController.RESPONSE_BONUS];
m_hasResponseBonus = _arg5;
m_rangeLevel1 = TowerData.instance.rangeTable[TowerController.SLOWDOWN][TowerController.LEVEL_1];
m_rangeLevel2 = TowerData.instance.rangeTable[TowerController.SLOWDOWN][TowerController.LEVEL_2];
m_rangeLevel3 = TowerData.instance.rangeTable[TowerController.SLOWDOWN][TowerController.LEVEL_3];
m_rangeBonusFactor = TowerData.instance.rangeTable[TowerController.SLOWDOWN][TowerController.RANGE_BONUS];
m_hasRangeBonus = _arg6;
m_container.gunfire.visible = false;
recalculateStats();
m_state = m_SEARCHING;
doRender();
}
override public function destroy():void{
super.destroy();
}
override protected function doFireEffect():void{
if (m_gunfireEffectCountdown > 0){
m_gunfireEffectCountdown--;
if (m_gunfireEffectCountdown == 0){
m_container.gunfire.visible = false;
};
};
}
override protected function doSearchMode():void{
var _local3:IEnemy;
var _local6:IEnemy;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Boolean;
var _local10:Object;
var _local11:Number;
var _local12:Number;
var _local13:Boolean;
var _local14:Number;
var _local15:Object;
var _local16:IEnemy;
var _local1:Array = EnemyData.instance.enemyArray;
var _local2:Boolean;
var _local4:Array = [];
var _local5:int;
while (_local5 < _local1.length) {
_local6 = IEnemy(_local1[_local5]);
_local7 = true;
if ((_local6 is ILandEnemy)){
if (!m_canTargetLand){
_local7 = false;
};
};
_local8 = true;
if ((_local6 is IAirEnemy)){
if (!m_canTargetAir){
_local8 = false;
};
};
_local9 = _local6.isTargetable();
if (((((_local7) && (_local8))) && (_local9))){
_local10 = _local6.getPosition();
_local11 = _local10.x;
_local12 = _local10.y;
_local13 = rangeCheck(m_x, m_y, _local11, _local12, m_range);
if (_local13){
_local14 = calculateDistance(m_x, m_y, _local11, _local12);
_local15 = {};
_local15.enemy = _local6;
_local15.dist = _local14;
_local15.speedFactor = _local6.getSpeedFactor();
_local4.push(_local15);
trace(((((((((("Enemy " + _local5) + " at ") + _local10.x) + ",") + _local10.y) + " dist: ") + _local14) + " speedFactor: ") + _local15.speedFactor));
};
};
_local5++;
};
if (_local4.length > 0){
_local4.sortOn("dist", Array.NUMERIC);
_local16 = IEnemy(_local4[0].enemy);
_local5 = 0;
while (_local5 < _local4.length) {
trace(((((("enemy sorted " + _local5) + " dist ") + _local4[_local5].dist) + " speedFactor: ") + _local4[_local5].speedFactor));
_local5++;
};
_local5 = 0;
while (_local5 < _local4.length) {
if (_local4[_local5].speedFactor < 1){
_local4.splice(_local5, 1);
_local5--;
};
_local5++;
};
_local5 = 0;
while (_local5 < _local4.length) {
trace(((((("enemy no slow " + _local5) + " dist ") + _local4[_local5].dist) + " speedFactor: ") + _local4[_local5].speedFactor));
_local5++;
};
if (_local4.length > 0){
m_target = IEnemy(_local4[0].enemy);
trace(((("picked a non-slow enemy dist " + _local4[0].dist) + " speedFactor: ") + _local4[0].speedFactor));
} else {
m_target = _local16;
trace("picked the backup");
};
m_state = m_ATTACKING;
};
}
override protected function doFire():void{
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.SLOWDOWN_FIRE, this, m_target, null, m_level));
m_gunfireEffectCountdown = m_gunfireEffectDuration;
m_container.gunfire.visible = true;
m_target = null;
m_state = m_SEARCHING;
}
override protected function updateTowerGraphics():void{
trace("SlowdownTower update tower graphics");
removeChild(m_container);
m_container = null;
if (m_level == 1){
m_container = new SlowdownTowerL1();
} else {
if (m_level == 2){
m_container = new SlowdownTowerL2();
} else {
m_container = new SlowdownTowerL3();
};
};
addChild(m_container);
m_container.gunfire.visible = false;
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
}
}
}//package game.towers
Section 296
//TowerController (game.towers.TowerController)
package game.towers {
import flash.utils.*;
import com.markfennell.sound.*;
import game.events.*;
import interfaces.*;
import org.casalib.display.*;
import game.*;
public class TowerController extends CasaSprite {
public static const RESPONSE_BONUS:String = "ResponseBonus";
public static const SLOWDOWN:String = "Slowdown";
public static const RANGE_BONUS:String = "RangeBonus";
public static const BLASTER:String = "Blaster";
public static const LASER:String = "Laser";
public static const ROCKET:String = "Rocket";
public static const MORTAR:String = "Mortar";
public static const LEVEL_2:String = "Level2";
public static const LEVEL_3:String = "Level3";
public static const FREQUENCY_BONUS:String = "FrequencyBonus";
public static const LEVEL_1:String = "Level1";
public function TowerController(){
TowerData.instance.emptyArray();
initTables();
GameBroadcaster.addEventListener(TowerEvent.BUILD_TOWER, buildTowerHandler, false, 0, true);
GameBroadcaster.addEventListener(TowerEvent.SELL_TOWER, sellTowerHandler, false, 0, true);
GameBroadcaster.addEventListener(TowerEvent.UPGRADE_TOWER, upgradeTowerHandler, false, 0, true);
trace("TC online");
}
public function doRender():void{
var _local1:Array = TowerData.instance.towerArray;
var _local2:int;
while (_local2 < _local1.length) {
BaseTower(_local1[_local2]).doRender();
_local2++;
};
}
private function sellTowerHandler(_arg1:TowerEvent):void{
trace(("TC sell: " + _arg1.towerObject));
var _local2:ITower = _arg1.towerObject;
TowerData.instance.towerArray.splice(TowerData.instance.towerArray.indexOf(_local2), 1);
_local2.destroy();
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.towers.TowerSell", 0.7, 1, false));
}
private function initTables():void{
var _local1:Dictionary = TowerData.instance.frequencyTable;
var _local2:Dictionary = TowerData.instance.responseTable;
var _local3:Dictionary = TowerData.instance.rangeTable;
_local1[BLASTER] = new Dictionary();
_local1[BLASTER][LEVEL_1] = 5;
_local1[BLASTER][LEVEL_2] = 5;
_local1[BLASTER][LEVEL_3] = 5;
_local1[BLASTER][FREQUENCY_BONUS] = 0.5;
_local2[BLASTER] = new Dictionary();
_local2[BLASTER][LEVEL_1] = 5;
_local2[BLASTER][LEVEL_2] = 5;
_local2[BLASTER][LEVEL_3] = 5;
_local2[BLASTER][RESPONSE_BONUS] = 0.5;
_local3[BLASTER] = new Dictionary();
_local3[BLASTER][LEVEL_1] = 42;
_local3[BLASTER][LEVEL_2] = 42;
_local3[BLASTER][LEVEL_3] = 42;
_local3[BLASTER][RANGE_BONUS] = 1.6;
_local1[SLOWDOWN] = new Dictionary();
_local1[SLOWDOWN][LEVEL_1] = 30;
_local1[SLOWDOWN][LEVEL_2] = 30;
_local1[SLOWDOWN][LEVEL_3] = 30;
_local1[SLOWDOWN][FREQUENCY_BONUS] = 0.5;
_local2[SLOWDOWN] = new Dictionary();
_local2[SLOWDOWN][LEVEL_1] = 30;
_local2[SLOWDOWN][LEVEL_2] = 30;
_local2[SLOWDOWN][LEVEL_3] = 30;
_local2[SLOWDOWN][RESPONSE_BONUS] = 0.5;
_local3[SLOWDOWN] = new Dictionary();
_local3[SLOWDOWN][LEVEL_1] = 70;
_local3[SLOWDOWN][LEVEL_2] = 70;
_local3[SLOWDOWN][LEVEL_3] = 70;
_local3[SLOWDOWN][RANGE_BONUS] = 1.5;
_local1[ROCKET] = new Dictionary();
_local1[ROCKET][LEVEL_1] = 30;
_local1[ROCKET][LEVEL_2] = 30;
_local1[ROCKET][LEVEL_3] = 30;
_local1[ROCKET][FREQUENCY_BONUS] = 0.5;
_local2[ROCKET] = new Dictionary();
_local2[ROCKET][LEVEL_1] = 30;
_local2[ROCKET][LEVEL_2] = 30;
_local2[ROCKET][LEVEL_3] = 30;
_local2[ROCKET][RESPONSE_BONUS] = 0.5;
_local3[ROCKET] = new Dictionary();
_local3[ROCKET][LEVEL_1] = 70;
_local3[ROCKET][LEVEL_2] = 70;
_local3[ROCKET][LEVEL_3] = 70;
_local3[ROCKET][RANGE_BONUS] = 1.5;
_local1[MORTAR] = new Dictionary();
_local1[MORTAR][LEVEL_1] = 45;
_local1[MORTAR][LEVEL_2] = 45;
_local1[MORTAR][LEVEL_3] = 45;
_local1[MORTAR][FREQUENCY_BONUS] = 0.5;
_local2[MORTAR] = new Dictionary();
_local2[MORTAR][LEVEL_1] = 45;
_local2[MORTAR][LEVEL_2] = 45;
_local2[MORTAR][LEVEL_3] = 45;
_local2[MORTAR][RESPONSE_BONUS] = 0.5;
_local3[MORTAR] = new Dictionary();
_local3[MORTAR][LEVEL_1] = 98;
_local3[MORTAR][LEVEL_2] = 98;
_local3[MORTAR][LEVEL_3] = 98;
_local3[MORTAR][RANGE_BONUS] = 1.5;
_local1[LASER] = new Dictionary();
_local1[LASER][LEVEL_1] = 30;
_local1[LASER][LEVEL_2] = 30;
_local1[LASER][LEVEL_3] = 30;
_local1[LASER][FREQUENCY_BONUS] = 0.5;
_local2[LASER] = new Dictionary();
_local2[LASER][LEVEL_1] = 30;
_local2[LASER][LEVEL_2] = 30;
_local2[LASER][LEVEL_3] = 30;
_local2[LASER][RESPONSE_BONUS] = 0.5;
_local3[LASER] = new Dictionary();
_local3[LASER][LEVEL_1] = 98;
_local3[LASER][LEVEL_2] = 98;
_local3[LASER][LEVEL_3] = 98;
_local3[LASER][RANGE_BONUS] = 1.3;
TowerData.instance.laserLockoutScore = 100000;
}
override public function destroy():void{
var _local1:Array = TowerData.instance.towerArray;
var _local2:int;
while (_local2 < _local1.length) {
BaseTower(_local1[_local2]).destroy();
_local1[_local2] = null;
_local2++;
};
GameBroadcaster.removeEventListener(TowerEvent.BUILD_TOWER, buildTowerHandler);
GameBroadcaster.removeEventListener(TowerEvent.SELL_TOWER, sellTowerHandler);
GameBroadcaster.removeEventListener(TowerEvent.UPGRADE_TOWER, upgradeTowerHandler);
TowerData.instance.emptyArray();
trace("TowerData destroy");
super.destroy();
}
public function doPhysics():void{
var _local1:Array = TowerData.instance.towerArray;
var _local2:int;
while (_local2 < _local1.length) {
BaseTower(_local1[_local2]).doPhysics();
_local2++;
};
}
private function upgradeTowerHandler(_arg1:TowerEvent):void{
var _local2:ITower = _arg1.towerObject;
_local2.doUpgrade(_arg1.levelID, _arg1.hasFrequencyBonus, _arg1.hasResponseBonus, _arg1.hasRangeBonus);
if (((((_arg1.hasFrequencyBonus) || (_arg1.hasResponseBonus))) || (_arg1.hasRangeBonus))){
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.towers.TowerBonus", 0.7, 1, false));
} else {
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.towers.TowerUpgrade", 0.7, 1, false));
};
}
private function buildTowerHandler(_arg1:TowerEvent):void{
var _local4:BaseTower;
var _local2:int = (_arg1.tower_cell_x * Map.tileW);
var _local3:int = (_arg1.tower_cell_y * Map.tileH);
if (_arg1.towerType == BLASTER){
_local4 = new BlasterTower(_local2, _local3, _arg1.levelID, _arg1.hasFrequencyBonus, _arg1.hasResponseBonus, _arg1.hasRangeBonus);
} else {
if (_arg1.towerType == SLOWDOWN){
_local4 = new SlowdownTower(_local2, _local3, _arg1.levelID, _arg1.hasFrequencyBonus, _arg1.hasResponseBonus, _arg1.hasRangeBonus);
} else {
if (_arg1.towerType == MORTAR){
_local4 = new MortarTower(_local2, _local3, _arg1.levelID, _arg1.hasFrequencyBonus, _arg1.hasResponseBonus, _arg1.hasRangeBonus);
} else {
if (_arg1.towerType == ROCKET){
_local4 = new RocketTower(_local2, _local3, _arg1.levelID, _arg1.hasFrequencyBonus, _arg1.hasResponseBonus, _arg1.hasRangeBonus);
} else {
if (_arg1.towerType == LASER){
_local4 = new LaserTower(_local2, _local3, _arg1.levelID, _arg1.hasFrequencyBonus, _arg1.hasResponseBonus, _arg1.hasRangeBonus);
};
};
};
};
};
trace(((((("TowerController building new: " + _arg1.towerType) + " at: ") + _local2) + ",") + _local3));
addChild(_local4);
TowerData.instance.towerArray.push(_local4);
GameBroadcaster.dispatchEvent(new TowerEvent(TowerEvent.BUILD_TOWER_COMPLETE, _local4, _arg1.levelID, _arg1.hasFrequencyBonus, _arg1.hasResponseBonus, _arg1.hasRangeBonus, _arg1.towerType, _arg1.tower_cell_x, _arg1.tower_cell_y));
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.towers.TowerBuild", 0.7, 1, false));
}
public static function getTowerLevelString(_arg1:ITower=null, _arg2:int=0):String{
var _local4:int;
var _local3 = "";
if (_arg1 != null){
_local4 = _arg1.getLevel();
} else {
_local4 = _arg2;
};
if (_local4 == 1){
_local3 = TowerController.LEVEL_1;
} else {
if (_local4 == 2){
_local3 = TowerController.LEVEL_2;
} else {
_local3 = TowerController.LEVEL_3;
};
};
return (_local3);
}
public static function getTowerTypeString(_arg1:ITower):String{
var _local2:String;
if ((_arg1 is BlasterTower)){
_local2 = TowerController.BLASTER;
} else {
if ((_arg1 is SlowdownTower)){
_local2 = TowerController.SLOWDOWN;
} else {
if ((_arg1 is MortarTower)){
_local2 = TowerController.MORTAR;
} else {
if ((_arg1 is RocketTower)){
_local2 = TowerController.ROCKET;
} else {
if ((_arg1 is LaserTower)){
_local2 = TowerController.LASER;
};
};
};
};
};
return (_local2);
}
}
}//package game.towers
Section 297
//TowerData (game.towers.TowerData)
package game.towers {
import flash.events.*;
import flash.utils.*;
public class TowerData extends EventDispatcher {
private var m_towerArray:Array;
private var m_rangeTable:Dictionary;
private var m_frequencyTable:Dictionary;
private var m_laserLockoutScore:int;
private var m_responseTable:Dictionary;
private static var m_instance:TowerData = new (TowerData);
;
public function TowerData(){
if (m_instance){
throw (new Error("Error: TowerData is a Singleton, and can only be accessed through TowerData.instance"));
};
m_instance = this;
m_towerArray = [];
m_frequencyTable = new Dictionary();
m_responseTable = new Dictionary();
m_rangeTable = new Dictionary();
}
public function emptyArray():void{
m_towerArray = [];
m_frequencyTable = new Dictionary();
m_responseTable = new Dictionary();
m_rangeTable = new Dictionary();
}
public function get responseTable():Dictionary{
return (m_responseTable);
}
public function get rangeTable():Dictionary{
return (m_rangeTable);
}
public function get frequencyTable():Dictionary{
return (m_frequencyTable);
}
public function set laserLockoutScore(_arg1:int):void{
m_laserLockoutScore = _arg1;
}
public function get towerArray():Array{
return (m_towerArray);
}
public function get laserLockoutScore():int{
return (m_laserLockoutScore);
}
public static function get instance():TowerData{
return (m_instance);
}
}
}//package game.towers
Section 298
//Wave (game.waves.Wave)
package game.waves {
public class Wave {
public var timeToLaunchArray:Array;
public var routeArray:Array;
public var maxTime:int;
public var enemyTypeArray:Array;
public var healthArray:Array;
public var minTime:int;
public static const WAVE_NOT_LAUNCHED:String = "waveNotLaunched";
public static const WAVE_ACTIVE:String = "waveActive";
public static const WAVE_COMPLETE:String = "waveComplete";
public function Wave(){
enemyTypeArray = [];
healthArray = [];
routeArray = [];
timeToLaunchArray = [];
super();
}
}
}//package game.waves
Section 299
//WaveController (game.waves.WaveController)
package game.waves {
import flash.utils.*;
import game.events.*;
import game.enemies.*;
import game.*;
public class WaveController {
private var m_totalWaves:int;
private var m_currentWaveID:int;
private var m_inactiveWaves:Array;
private var m_currentWaveMinTime:int;
private var m_activeWaves:Array;
private var m_allWavesComplete:Boolean;// = false
private var m_currentWaveTime:int;
private var m_firstWaveLaunched:Boolean;// = false
private var m_currentWaveMaxTime:int;
private var m_allWavesLaunched:Boolean;// = false
public function WaveController(){
trace("WaveController online");
GameBroadcaster.addEventListener(WaveEvent.REQUEST_NEXT_WAVE, requestNextWaveHandler, false, 0, true);
}
private function incrementWaveAndLaunch():void{
m_currentWaveID++;
trace((("incrementWaveAndLaunch, now incremented to: " + m_currentWaveID) + ", launching.."));
newWave(m_currentWaveID);
}
public function calculateWaveTimes():void{
var _local2:Wave;
var _local3:int;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:String;
var _local9:int;
var _local10:Dictionary;
var _local11:Number;
var _local12:int;
var _local1:int;
while (_local1 < m_inactiveWaves.length) {
_local2 = m_inactiveWaves[_local1];
trace(("Calculating maxTime time for wave " + _local1));
_local3 = 0;
_local4 = Map.getRoutes();
_local5 = 0;
while (_local5 < _local2.timeToLaunchArray.length) {
_local6 = _local4[_local2.routeArray[_local5]].length;
_local7 = (_local6 * Map.tileW);
_local8 = _local2.enemyTypeArray[_local5];
_local9 = _local2.timeToLaunchArray[_local5];
_local10 = EnemyData.instance.speedTable;
_local11 = 0;
if (_local8 == EnemyController.INSECTICON){
_local11 = _local10[EnemyController.INSECTICON];
} else {
if (_local8 == EnemyController.GALVATRON){
_local11 = _local10[EnemyController.GALVATRON];
} else {
if (_local8 == EnemyController.SHOCKWAVE){
_local11 = _local10[EnemyController.SHOCKWAVE];
} else {
if (_local8 == EnemyController.RAVAGE){
_local11 = _local10[EnemyController.RAVAGE];
} else {
if (_local8 == EnemyController.STARSCREAM){
_local11 = _local10[EnemyController.STARSCREAM];
} else {
if (_local8 == EnemyController.BRUNT){
_local11 = _local10[EnemyController.BRUNT];
};
};
};
};
};
};
_local12 = ((_local7 / _local11) + _local9);
if (_local12 > _local3){
_local3 = _local12;
};
_local5++;
};
trace((">> maxTime: " + _local3));
_local2.maxTime = _local3;
_local1++;
};
}
private function launchEnemy(_arg1:String, _arg2:int, _arg3:int):void{
if ((((((((((((_arg1 == EnemyController.BRUNT)) || ((_arg1 == EnemyController.GALVATRON)))) || ((_arg1 == EnemyController.INSECTICON)))) || ((_arg1 == EnemyController.RAVAGE)))) || ((_arg1 == EnemyController.SHOCKWAVE)))) || ((_arg1 == EnemyController.STARSCREAM)))){
GameBroadcaster.dispatchEvent(new EnemyEvent(EnemyEvent.SPAWN_ENEMY, null, _arg1, _arg2, _arg3));
} else {
throw (new Error(("Unknown enemy type!: " + _arg1)));
};
}
private function requestNextWaveHandler(_arg1:WaveEvent):void{
if ((((m_currentWaveTime >= m_currentWaveMinTime)) && (!(m_allWavesLaunched)))){
trace("WaveController, requestNextWaveHandler");
if (m_inactiveWaves.length == 0){
throw (new Error("requestNextWaveHandler BUT ALL WAVES LAUNCHED"));
};
trace("WaveController granted launch next wave");
incrementWaveAndLaunch();
};
}
public function startWaves():void{
trace("WaveController is beginning the game");
m_currentWaveID = 0;
m_currentWaveTime = 0;
m_currentWaveMinTime = 0;
m_currentWaveMaxTime = 0;
m_firstWaveLaunched = true;
newWave(m_currentWaveID);
}
private function manageTime():void{
var _local2:Wave;
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:int;
m_currentWaveTime++;
if ((((m_currentWaveTime >= m_currentWaveMaxTime)) && (!(m_allWavesLaunched)))){
incrementWaveAndLaunch();
};
if ((((m_activeWaves.length == 0)) && ((m_inactiveWaves.length == 0)))){
m_allWavesComplete = true;
trace("manageTime ALL WAVES COMPLETE");
};
var _local1:int;
while (_local1 < m_activeWaves.length) {
_local2 = m_activeWaves[_local1];
_local3 = 0;
while (_local3 < _local2.timeToLaunchArray.length) {
var _local7 = _local2.timeToLaunchArray;
var _local8 = _local3;
var _local9 = (_local7[_local8] - 1);
_local7[_local8] = _local9;
if (_local2.timeToLaunchArray[_local3] <= 0){
_local4 = _local2.enemyTypeArray[_local3];
_local5 = _local2.healthArray[_local3];
_local6 = _local2.routeArray[_local3];
_local2.enemyTypeArray.splice(_local3, 1);
_local2.healthArray.splice(_local3, 1);
_local2.routeArray.splice(_local3, 1);
_local2.timeToLaunchArray.splice(_local3, 1);
launchEnemy(_local4, _local5, _local6);
_local3--;
};
_local3++;
};
if (_local2.timeToLaunchArray.length == 0){
trace("No enemies left in this wave");
m_activeWaves.splice(_local1, 1);
_local1--;
};
_local1++;
};
}
public function destroy():void{
GameBroadcaster.removeEventListener(WaveEvent.REQUEST_NEXT_WAVE, requestNextWaveHandler);
}
public function initWaves(_arg1:XML):void{
var _local4:Wave;
var _local5:XML;
var _local6:Array;
var _local7:int;
var _local8:String;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:Object;
var _local2:XML = _arg1;
m_inactiveWaves = [];
m_activeWaves = [];
m_totalWaves = _local2.wave.length();
var _local3:int;
while (_local3 < _local2.wave.length()) {
_local4 = new Wave();
m_inactiveWaves.push(_local4);
_local5 = _local2.wave[_local3];
_local4.minTime = int(_local5.@minTime);
_local4.maxTime = 0;
_local6 = [];
_local7 = 0;
while (_local7 < _local5.cluster.length()) {
_local8 = String(_local5.cluster[_local7].@type);
_local9 = int(_local5.cluster[_local7].@health);
_local10 = int(_local5.cluster[_local7].@routeid);
if ((((_local10 < 0)) || ((_local10 > 4)))){
trace(("WC ERROR: enemy had route outside of 0<route<4: " + _local10));
_local10 = 0;
};
_local11 = int(_local5.cluster[_local7].@units);
_local12 = int(_local5.cluster[_local7].@timeoffset);
_local13 = int(_local5.cluster[_local7].@timegap);
_local14 = 0;
while (_local14 < _local11) {
_local15 = {};
_local15.enemyType = _local8;
_local15.health = _local9;
_local15.routeID = _local10;
_local15.time = int((_local12 + (_local13 * _local14)));
_local6.push(_local15);
_local14++;
};
_local7++;
};
_local6.sortOn("time", [Array.NUMERIC]);
_local14 = 0;
while (_local14 < _local6.length) {
_local4.enemyTypeArray[_local14] = _local6[_local14].enemyType;
_local4.healthArray[_local14] = _local6[_local14].health;
_local4.routeArray[_local14] = _local6[_local14].routeID;
_local4.timeToLaunchArray[_local14] = _local6[_local14].time;
_local14++;
};
_local3++;
};
}
public function currentWaveID():int{
return (m_currentWaveID);
}
private function newWave(_arg1:int):void{
trace(("WaveController launching waveID: " + _arg1));
var _local2:Wave = m_inactiveWaves.shift();
m_activeWaves.push(_local2);
var _local3:int = m_currentWaveMaxTime;
var _local4:int = m_currentWaveTime;
m_currentWaveTime = 0;
m_currentWaveMinTime = _local2.minTime;
m_currentWaveMaxTime = _local2.maxTime;
GameBroadcaster.dispatchEvent(new WaveEvent(WaveEvent.WAVE_LAUNCHED, m_currentWaveMinTime, m_currentWaveMaxTime, m_currentWaveID, m_totalWaves, _local4, _local3));
if (m_inactiveWaves.length == 0){
trace("newWave ALL WAVES LAUNCHED");
m_allWavesLaunched = true;
};
}
public function checkAllWavesComplete():Boolean{
if (m_allWavesComplete){
return (true);
};
return (false);
}
public function doPhysics():void{
if (((!(m_allWavesComplete)) && (m_firstWaveLaunched))){
manageTime();
};
}
}
}//package game.waves
Section 300
//LaserBeam (game.weapons.LaserBeam)
package game.weapons {
import game.events.*;
import interfaces.*;
import org.casalib.display.*;
import game.*;
import gs.*;
public class LaserBeam extends CasaSprite implements IWeapon {
protected var m_laserDurationCountdown:int;
protected var level1LineWidth:Number;// = 1.25
protected var level2GlowColour:Number;// = 7227083
protected var m_rotation:Number;
protected var m_drawDeltaX:int;
protected var m_drawDeltaY:int;
protected var m_target:IEnemy;
protected var level2LineWidth:Number;// = 1.75
protected var m_x:Number;
protected var m_y:Number;
protected var level2BeamColour:Number;// = 15855853
protected var m_container:CasaSprite;
protected var m_level:int;
protected var m_tower:ITower;
protected var m_laserDurationLevel1:int;// = 20
protected var m_laserDurationLevel2:int;// = 15
protected var m_laserDurationLevel3:int;// = 25
protected var level3LineWidth:Number;// = 2.5
protected var level3GlowColour:Number;// = 15271685
protected var m_glowColour:Number;
protected var level1GlowColour:Number;// = 3714235
protected var m_lineWidth:Number;
protected var level1BeamColour:Number;// = 15855853
protected var level3BeamColour:Number;// = 15855853
protected var m_beamColour:Number;
public function LaserBeam(_arg1:IEnemy, _arg2:ITower, _arg3:int){
trace(((((((((((((("LaserBeam from tower " + _arg2) + " at (") + _arg2.getPosition().x) + ",") + _arg2.getPosition().y) + ") to enemy ") + _arg1) + " at (") + _arg1.getPosition().x) + ",") + _arg1.getPosition().y) + ") on level ") + _arg3));
m_level = _arg3;
m_target = _arg1;
m_tower = _arg2;
m_container = new CasaSprite();
addChild(m_container);
m_x = _arg2.getPosition().x;
m_y = _arg2.getPosition().y;
if (m_level == 1){
m_laserDurationCountdown = m_laserDurationLevel1;
m_beamColour = level1BeamColour;
m_glowColour = level1GlowColour;
m_lineWidth = level1LineWidth;
} else {
if (m_level == 2){
m_laserDurationCountdown = m_laserDurationLevel2;
m_beamColour = level2BeamColour;
m_glowColour = level2GlowColour;
m_lineWidth = level2LineWidth;
} else {
m_laserDurationCountdown = m_laserDurationLevel3;
m_beamColour = level3BeamColour;
m_glowColour = level3GlowColour;
m_lineWidth = level3LineWidth;
};
};
TweenMax.to(m_container, 0.25, {glowFilter:{color:m_glowColour, alpha:1, blurX:10, blurY:10, strength:1.7, quality:1}});
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_KILLED, enemyLostHandler, false, 0, true);
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_OBJECTIVE, enemyLostHandler, false, 0, true);
}
public function doRender():void{
this.x = m_x;
this.y = m_y;
m_container.graphics.clear();
m_container.graphics.lineStyle(m_lineWidth, m_beamColour, 1);
m_container.graphics.moveTo(Map.tileHalfW, Map.tileHalfH);
m_container.graphics.lineTo((m_drawDeltaX + Map.tileHalfW), (m_drawDeltaY + Map.tileHalfH));
}
override public function destroy():void{
TweenMax.killTweensOf(m_container);
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_KILLED, enemyLostHandler);
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_OBJECTIVE, enemyLostHandler);
m_container.destroy();
super.destroy();
}
public function getPosition():Object{
var _local1:Object = {};
_local1.x = m_x;
_local1.y = m_y;
_local1.rotation = m_rotation;
return (_local1);
}
public function getLevel():int{
return (m_level);
}
private function enemyLostHandler(_arg1:EnemyEvent):void{
if (_arg1.enemyObject == m_target){
trace("LaserProjectile target died whilst beaming, cease beam early now");
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.LASER_STOP, m_tower, null, this, m_level));
};
}
public function doPhysics():void{
if (m_target == null){
trace("ERROR: laserBeam do physics couldnt get the enemy");
};
var _local1:Object = m_target.getPosition();
var _local2:int = _local1.x;
var _local3:int = _local1.y;
m_drawDeltaX = (_local2 - m_x);
m_drawDeltaY = (_local3 - m_y);
m_laserDurationCountdown--;
if (m_laserDurationCountdown <= 0){
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.LASER_STOP, m_tower, m_target, this, m_level));
};
}
}
}//package game.weapons
Section 301
//MortarProjectile (game.weapons.MortarProjectile)
package game.weapons {
import flash.display.*;
import game.events.*;
import interfaces.*;
import org.casalib.display.*;
import game.*;
import assets.weapons.*;
public class MortarProjectile extends CasaSprite implements IWeapon {
protected var m_rotation:Number;
protected var m_targetX:Number;
protected var m_targetY:Number;
protected var m_x:Number;
protected var m_y:Number;
protected var m_container:MovieClip;
protected var m_level:int;
protected var m_speed:Number;// = 4
public function MortarProjectile(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number){
trace(((((((((("MortarProjectile at " + _arg1) + ",") + _arg2) + " rotation ") + _arg3) + " flying to ") + _arg5) + ",") + _arg6));
m_x = _arg1;
m_y = _arg2;
m_rotation = _arg3;
m_level = _arg4;
m_targetX = _arg5;
m_targetY = _arg6;
if (m_level == 1){
m_container = new MortarProjectileL1();
} else {
if (m_level == 2){
m_container = new MortarProjectileL2();
} else {
if (m_level == 3){
m_container = new MortarProjectileL3();
};
};
};
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
doPhysics();
doRender();
}
public function doRender():void{
m_container.rotation = m_rotation;
this.x = m_x;
this.y = m_y;
}
override public function destroy():void{
super.destroy();
}
public function getLevel():int{
return (m_level);
}
public function getPosition():Object{
var _local1:Object = {};
_local1.x = m_x;
_local1.y = m_y;
_local1.rotation = m_rotation;
return (_local1);
}
public function doPhysics():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
if ((((((((m_x <= (m_targetX + m_speed))) && ((m_x >= (m_targetX - m_speed))))) && ((m_y <= (m_targetY + m_speed))))) && ((m_y >= (m_targetY - m_speed))))){
m_container.alpha = 0.1;
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.MORTAR_DETONATE, null, null, this, m_level));
} else {
_local1 = (m_rotation * (Math.PI / 180));
_local2 = (m_speed * Math.sin(_local1));
_local3 = (m_speed * Math.cos(_local1));
m_x = (m_x + _local2);
m_y = (m_y - _local3);
};
}
}
}//package game.weapons
Section 302
//RocketProjectile (game.weapons.RocketProjectile)
package game.weapons {
import flash.display.*;
import game.events.*;
import interfaces.*;
import org.casalib.display.*;
import game.enemies.*;
import game.*;
import assets.weapons.*;
public class RocketProjectile extends CasaSprite implements IWeapon {
protected const m_searchTimeLevel1:int = 2;
protected const m_searchTimeLevel3:int = 240;
protected const m_searchTimeLevel2:int = 2;
protected const m_SEARCHING:int = 1;
protected const m_HOMING:int = 0;
protected const m_rangeLevel1:int = 20;
protected const m_rangeLevel2:int = 20;
protected const m_rangeLevel3:int = 100;
protected var m_rotation:Number;
protected var m_searchCountdown:int;
protected var m_yMove:Number;
protected var m_xMove:Number;
protected var m_target:IEnemy;
protected var m_x:Number;
protected var m_y:Number;
protected var m_searchTotal:int;
protected var m_rotationHomingCap:Number;// = 8
protected var m_container:MovieClip;
protected var m_speedHoming:Number;// = 6
protected var m_level:int;
protected var m_state:int;
protected var m_speedSearching:Number;// = 4
protected var m_rotationSearchingCap:Number;// = 6
protected var m_range:Number;
public function RocketProjectile(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:IEnemy){
trace(((((((((((("RocketProjectile at " + _arg1) + ",") + _arg2) + " rotation ") + _arg3) + " targetting ") + _arg5) + " at ") + _arg5.getPosition().x) + ",") + _arg5.getPosition().y));
m_x = _arg1;
m_y = _arg2;
m_rotation = _arg3;
m_level = _arg4;
m_target = _arg5;
m_state = m_HOMING;
if (m_level == 1){
m_container = new RocketProjectileL1();
m_range = m_rangeLevel1;
m_searchTotal = m_searchTimeLevel1;
} else {
if (m_level == 2){
m_container = new RocketProjectileL2();
m_range = m_rangeLevel2;
m_searchTotal = m_searchTimeLevel2;
} else {
if (m_level == 3){
m_container = new RocketProjectileL3();
m_range = m_rangeLevel3;
m_searchTotal = m_searchTimeLevel3;
};
};
};
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_KILLED, enemyLostHandler, false, 0, true);
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_OBJECTIVE, enemyLostHandler, false, 0, true);
}
public function doRender():void{
m_container.rotation = m_rotation;
this.x = m_x;
this.y = m_y;
}
override public function destroy():void{
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_KILLED, enemyLostHandler);
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_OBJECTIVE, enemyLostHandler);
super.destroy();
}
public function getPosition():Object{
var _local1:Object = {};
_local1.x = m_x;
_local1.y = m_y;
_local1.rotation = m_rotation;
return (_local1);
}
private function getAngleDifference(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number = ((_arg3 * Math.PI) / 180);
var _local5:Number = (Math.PI * 2);
_local4 = (_local4 % _local5);
var _local6:Number = ((Math.PI / 2) + Math.atan2((_arg2 - m_y), (_arg1 - m_x)));
if (_local6 < 0){
_local6 = (_local6 + _local5);
};
var _local7:Number = (_local6 - _local4);
if (_local7 > Math.PI){
_local7 = (_local7 - _local5);
} else {
if (_local7 < -(Math.PI)){
_local7 = (_local7 + _local5);
};
};
return (_local7);
}
public function doPhysics():void{
var _local1:Boolean;
if (m_state == m_HOMING){
doAttackMode();
} else {
if (m_state == m_SEARCHING){
_local1 = doSearchMode();
if (_local1){
doAttackMode();
} else {
doWaitMode();
};
};
};
}
private function rangeCheck(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
if (!(((((((_arg3 > (_arg1 - m_range))) && ((_arg3 < (_arg1 + m_range))))) && ((_arg4 > (_arg2 - m_range))))) && ((_arg4 < (_arg2 + m_range))))){
return (false);
};
var _local6:Number = (((_arg3 - _arg1) * (_arg3 - _arg1)) + ((_arg4 - _arg2) * (_arg4 - _arg2)));
var _local7:Number = (_arg5 * _arg5);
if (_local6 > _local7){
return (false);
};
var _local8:Number = Math.sqrt(_local6);
return (true);
}
public function getLevel():int{
return (m_level);
}
protected function doWaitMode():void{
m_rotation = (m_rotation + m_rotationSearchingCap);
var _local1:Number = (m_rotation * (Math.PI / 180));
m_xMove = (m_speedSearching * Math.sin(_local1));
m_yMove = (m_speedSearching * Math.cos(_local1));
m_x = (m_x + m_xMove);
m_y = (m_y - m_yMove);
m_searchCountdown--;
if (m_searchCountdown <= 0){
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.ROCKET_DETONATE, null, null, this, m_level));
};
}
protected function doSearchMode():Boolean{
var _local3:IEnemy;
var _local5:IEnemy;
var _local6:Boolean;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Boolean;
var _local1:Array = EnemyData.instance.enemyArray;
var _local2:Boolean;
var _local4:int;
while (_local4 < _local1.length) {
_local5 = IEnemy(_local1[_local4]);
_local6 = _local5.isTargetable();
if (_local6){
_local7 = _local5.getPosition();
_local8 = _local7.x;
_local9 = _local7.y;
_local10 = rangeCheck(m_x, m_y, _local8, _local9, m_range);
if (_local10){
trace(((((("RocketProjectile retarget enemy " + _local4) + " at ") + _local7.x) + ",") + _local7.y));
_local2 = true;
_local3 = _local5;
break;
};
};
_local4++;
};
if (_local2){
m_target = _local3;
m_state = m_HOMING;
return (true);
};
return (false);
}
private function enemyLostHandler(_arg1:EnemyEvent):void{
if (_arg1.enemyObject == m_target){
trace("RocketProjectile target died whilst in flight, enter search mode");
m_state = m_SEARCHING;
m_searchCountdown = m_searchTotal;
};
}
protected function doAttackMode():void{
var _local5:Number;
var _local1:Object = m_target.getPosition();
var _local2:int = _local1.x;
var _local3:int = _local1.y;
var _local4:Number = ((getAngleDifference(_local2, _local3, m_rotation) * 180) / Math.PI);
if ((((_local4 > 0)) && ((_local4 > m_rotationHomingCap)))){
_local4 = m_rotationHomingCap;
} else {
if ((((_local4 < 0)) && ((_local4 < -(m_rotationHomingCap))))){
_local4 = -(m_rotationHomingCap);
};
};
m_rotation = (m_rotation + _local4);
if ((((((((m_x <= (_local2 + m_speedHoming))) && ((m_x >= (_local2 - m_speedHoming))))) && ((m_y <= (_local3 + m_speedHoming))))) && ((m_y >= (_local3 - m_speedHoming))))){
m_container.alpha = 0.1;
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.ROCKET_DETONATE, null, null, this, m_level));
} else {
_local5 = (m_rotation * (Math.PI / 180));
m_xMove = (m_speedHoming * Math.sin(_local5));
m_yMove = (m_speedHoming * Math.cos(_local5));
m_x = (m_x + m_xMove);
m_y = (m_y - m_yMove);
};
}
}
}//package game.weapons
Section 303
//SlowdownProjectile (game.weapons.SlowdownProjectile)
package game.weapons {
import flash.display.*;
import game.events.*;
import interfaces.*;
import org.casalib.display.*;
import game.*;
import assets.weapons.*;
public class SlowdownProjectile extends CasaSprite implements IWeapon {
protected var m_rotation:Number;
protected var m_targetX:Number;
protected var m_targetY:Number;
protected var m_x:Number;
protected var m_y:Number;
protected var m_container:MovieClip;
protected var m_level:int;
protected var m_speed:Number;// = 5
public function SlowdownProjectile(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number){
trace(((((((((("SlowdownProjectile at " + _arg1) + ",") + _arg2) + " rotation ") + _arg3) + " flying to ") + _arg5) + ",") + _arg6));
m_x = _arg1;
m_y = _arg2;
m_rotation = _arg3;
m_level = _arg4;
m_targetX = _arg5;
m_targetY = _arg6;
m_container = new SlowdownProjectile();
addChild(m_container);
m_container.x = Map.tileHalfW;
m_container.y = Map.tileHalfH;
doPhysics();
doRender();
}
public function doRender():void{
m_container.rotation = m_rotation;
this.x = m_x;
this.y = m_y;
}
override public function destroy():void{
super.destroy();
}
public function getLevel():int{
return (m_level);
}
public function getPosition():Object{
var _local1:Object = {};
_local1.x = m_x;
_local1.y = m_y;
_local1.rotation = m_rotation;
return (_local1);
}
public function doPhysics():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
if ((((((((m_x <= (m_targetX + m_speed))) && ((m_x >= (m_targetX - m_speed))))) && ((m_y <= (m_targetY + m_speed))))) && ((m_y >= (m_targetY - m_speed))))){
m_container.alpha = 0.1;
GameBroadcaster.dispatchEvent(new WeaponEvent(WeaponEvent.SLOWDOWN_DETONATE, null, null, this, m_level));
} else {
_local1 = (m_rotation * (Math.PI / 180));
_local2 = (m_speed * Math.sin(_local1));
_local3 = (m_speed * Math.cos(_local1));
m_x = (m_x + _local2);
m_y = (m_y - _local3);
};
}
}
}//package game.weapons
Section 304
//WeaponController (game.weapons.WeaponController)
package game.weapons {
import flash.display.*;
import flash.utils.*;
import com.markfennell.sound.*;
import game.events.*;
import interfaces.*;
import org.casalib.display.*;
import game.enemies.*;
import game.towers.*;
import assets.weapons.*;
import gs.*;
public class WeaponController extends CasaSprite {
public function WeaponController(){
WeaponData.instance.emptyArray();
this.mouseChildren = false;
this.mouseEnabled = false;
initTables();
GameBroadcaster.addEventListener(WeaponEvent.BLASTER_FIRE, blasterFireHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.SLOWDOWN_FIRE, slowdownFireHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.SLOWDOWN_DETONATE, slowdownDetonationHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.MORTAR_FIRE, mortarFireHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.MORTAR_DETONATE, mortarDetonationHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.ROCKET_FIRE, rocketFireHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.ROCKET_DETONATE, rocketDetonationHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.LASER_FIRE, laserFireHandler, false, 0, true);
GameBroadcaster.addEventListener(WeaponEvent.LASER_STOP, laserStopHandler, false, 0, true);
trace("WC online");
}
private function rocketFireHandler(_arg1:WeaponEvent):void{
var _local2:IEnemy = _arg1.enemyObject;
var _local3:Number = _arg1.enemyObject.getPosition().x;
var _local4:Number = _arg1.enemyObject.getPosition().y;
var _local5:Number = _arg1.towerObject.getPosition().x;
var _local6:Number = _arg1.towerObject.getPosition().y;
var _local7:int = _arg1.towerLevel;
var _local8:Number = _arg1.towerObject.getPosition().rotation;
var _local9:RocketProjectile = new RocketProjectile(_local5, _local6, _local8, _local7, _local2);
addChild(_local9);
WeaponData.instance.weaponArray.push(_local9);
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.weapons.MortarLaunch", 0.4, 1, false));
}
public function doRender():void{
var _local1:Array = WeaponData.instance.weaponArray;
var _local2:int;
while (_local2 < _local1.length) {
IWeapon(_local1[_local2]).doRender();
_local2++;
};
}
private function rocketDetonationHandler(_arg1:WeaponEvent):void{
var _local11:IEnemy;
var _local12:Object;
var _local13:Number;
var _local14:Number;
var _local15:Boolean;
var _local16:IEnemy;
var _local17:Number;
var _local18:Number;
var _local2:IWeapon = _arg1.weaponObject;
var _local3:Number = _local2.getPosition().x;
var _local4:Number = _local2.getPosition().y;
var _local5:String = getLevelOfTower(_local2.getLevel());
WeaponData.instance.weaponArray.splice(WeaponData.instance.weaponArray.indexOf(_local2), 1);
_local2.destroy();
trace(((((("Rocket detonation @ " + _local3) + ",") + _local4) + " level ") + _local5));
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.weapons.RocketExplosion", 0.4, 1, false));
var _local6:Number = WeaponData.instance.rocketSplashRangeTable[_local5];
var _local7:Array = EnemyData.instance.enemyArray;
var _local8:Array = [];
var _local9:int;
while (_local9 < _local7.length) {
_local11 = IEnemy(_local7[_local9]);
_local12 = _local11.getPosition();
_local13 = _local12.x;
_local14 = _local12.y;
_local15 = rangeCheck(_local3, _local4, _local13, _local14, _local6);
if (_local15){
trace((((((">Enemy " + _local9) + " at ") + _local12.x) + ",") + _local12.y));
_local8.push(_local11);
};
_local9++;
};
var _local10:Number = WeaponData.instance.damageTable[TowerController.ROCKET][_local5];
_local9 = 0;
while (_local9 < _local8.length) {
_local16 = IEnemy(_local8[_local9]);
_local17 = WeaponData.instance.multiplierTable[TowerController.ROCKET][getTypeOfEnemy(_local16)];
_local18 = (_local10 * _local17);
trace((((">>>>mortarDetonation hitting " + getTypeOfEnemy(_local16)) + " applying hurt: ") + _local18));
_local16.doHurt(_local18);
_local9++;
};
}
private function rangeCheck(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Boolean{
if (!(((((((_arg3 > (_arg1 - _arg5))) && ((_arg3 < (_arg1 + _arg5))))) && ((_arg4 > (_arg2 - _arg5))))) && ((_arg4 < (_arg2 + _arg5))))){
return (false);
};
var _local6:Number = (((_arg3 - _arg1) * (_arg3 - _arg1)) + ((_arg4 - _arg2) * (_arg4 - _arg2)));
var _local7:Number = (_arg5 * _arg5);
if (_local6 > _local7){
return (false);
};
var _local8:Number = Math.sqrt(_local6);
return (true);
}
private function slowdownDetonationHandler(_arg1:WeaponEvent):void{
var _local5:String;
var _local6:MovieClip;
var _local13:IEnemy;
var _local14:Object;
var _local15:Number;
var _local16:Number;
var _local17:Boolean;
var _local18:IEnemy;
var _local19:Number;
var _local20:Number;
var _local2:IWeapon = _arg1.weaponObject;
var _local3:Number = _local2.getPosition().x;
var _local4:Number = _local2.getPosition().y;
_local5 = getLevelOfTower(_local2.getLevel());
WeaponData.instance.weaponArray.splice(WeaponData.instance.weaponArray.indexOf(_local2), 1);
_local2.destroy();
trace(((((("Slowdown detonation @ " + _local3) + ",") + _local4) + " level ") + _local5));
_local6 = new SlowdownExplosion();
addChild(_local6);
_local6.x = _local3;
_local6.y = _local4;
TweenMax.to(_local6, 1, {alpha:0, onComplete:killDebugExplosion, onCompleteParams:[_local6]});
var _local7:Number = WeaponData.instance.slowdownSplashRangeTable[_local5];
var _local8:Array = EnemyData.instance.enemyArray;
var _local9:Array = [];
var _local10:int;
while (_local10 < _local8.length) {
_local13 = IEnemy(_local8[_local10]);
_local14 = _local13.getPosition();
_local15 = _local14.x;
_local16 = _local14.y;
_local17 = rangeCheck(_local3, _local4, _local15, _local16, _local7);
if (_local17){
trace((((((">Enemy " + _local10) + " at ") + _local14.x) + ",") + _local14.y));
_local9.push(_local13);
};
_local10++;
};
var _local11:Number = WeaponData.instance.damageTable[TowerController.SLOWDOWN][_local5];
var _local12:Number = WeaponData.instance.slowdownDurationTable[_local5];
_local10 = 0;
while (_local10 < _local9.length) {
_local18 = IEnemy(_local9[_local10]);
_local19 = WeaponData.instance.multiplierTable[TowerController.SLOWDOWN][getTypeOfEnemy(_local18)];
_local20 = (_local11 * _local19);
trace((((((">>>>slowdownDetonation hitting " + getTypeOfEnemy(_local18)) + " applying slowdown: ") + _local20) + ", ") + _local12));
_local18.doSlowdown(_local20, _local12);
_local10++;
};
}
private function killDebugExplosion(_arg1):void{
trace(("KILL DEEEBUG EXPLOSION, obj " + _arg1));
removeChild(_arg1);
_arg1 = null;
}
private function getTypeOfEnemy(_arg1:IEnemy):String{
var _local2:String;
if ((_arg1 is Insecticon)){
_local2 = EnemyController.INSECTICON;
} else {
if ((_arg1 is Shockwave)){
_local2 = EnemyController.SHOCKWAVE;
} else {
if ((_arg1 is Galvatron)){
_local2 = EnemyController.GALVATRON;
} else {
if ((_arg1 is Ravage)){
_local2 = EnemyController.RAVAGE;
} else {
if ((_arg1 is Starscream)){
_local2 = EnemyController.STARSCREAM;
} else {
if ((_arg1 is Brunt)){
_local2 = EnemyController.BRUNT;
} else {
throw (new Error((("getTypeOfEnemy: " + _arg1) + " unknown!")));
};
};
};
};
};
};
return (_local2);
}
override public function destroy():void{
var _local1:Array = WeaponData.instance.weaponArray;
var _local2:int;
while (_local2 < _local1.length) {
IWeapon(_local1[_local2]).destroy();
_local1[_local2] = null;
_local2++;
};
GameBroadcaster.removeEventListener(WeaponEvent.BLASTER_FIRE, blasterFireHandler);
GameBroadcaster.removeEventListener(WeaponEvent.SLOWDOWN_FIRE, slowdownFireHandler);
GameBroadcaster.removeEventListener(WeaponEvent.SLOWDOWN_DETONATE, slowdownDetonationHandler);
GameBroadcaster.removeEventListener(WeaponEvent.MORTAR_FIRE, mortarFireHandler);
GameBroadcaster.removeEventListener(WeaponEvent.MORTAR_DETONATE, mortarDetonationHandler);
GameBroadcaster.removeEventListener(WeaponEvent.ROCKET_FIRE, rocketFireHandler);
GameBroadcaster.removeEventListener(WeaponEvent.ROCKET_DETONATE, rocketDetonationHandler);
GameBroadcaster.removeEventListener(WeaponEvent.LASER_FIRE, laserFireHandler);
GameBroadcaster.removeEventListener(WeaponEvent.LASER_STOP, laserStopHandler);
WeaponData.instance.emptyArray();
trace("WeaponController destroy");
super.destroy();
}
private function getLevelOfTower(_arg1:int):String{
if (_arg1 > 3){
throw (new Error((("getLevelOfTower: " + _arg1) + " unknown!")));
};
var _local2:String = TowerController.getTowerLevelString(null, _arg1);
return (_local2);
}
private function blasterFireHandler(_arg1:WeaponEvent):void{
var _local2:String = getTypeOfEnemy(_arg1.enemyObject);
var _local3:String = getLevelOfTower(_arg1.towerLevel);
var _local4:Number = WeaponData.instance.damageTable[TowerController.BLASTER][_local3];
var _local5:Number = WeaponData.instance.multiplierTable[TowerController.BLASTER][_local2];
var _local6:Number = (_local4 * _local5);
trace(((((((((("BLASTER firing, level " + _local3) + " against enemy type ") + _local2) + " doing damage ") + _local4) + " multiplier ") + _local5) + " finalDamage: ") + _local6));
IEnemy(_arg1.enemyObject).doHurt(_local6);
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.weapons.BlasterFire", 0.4, 1, false));
}
private function laserFireHandler(_arg1:WeaponEvent):void{
var _local2:String = getTypeOfEnemy(_arg1.enemyObject);
var _local3:String = getLevelOfTower(_arg1.towerLevel);
trace(((("Laser firing, level " + _local3) + " against enemy type ") + _local2));
var _local4:LaserBeam = new LaserBeam(_arg1.enemyObject, _arg1.towerObject, _arg1.towerLevel);
addChild(_local4);
WeaponData.instance.weaponArray.push(_local4);
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.weapons.LaserFire", 0.5, 1, false));
}
private function slowdownFireHandler(_arg1:WeaponEvent):void{
var _local2:Number = _arg1.enemyObject.getPosition().x;
var _local3:Number = _arg1.enemyObject.getPosition().y;
var _local4:Number = _arg1.towerObject.getPosition().x;
var _local5:Number = _arg1.towerObject.getPosition().y;
var _local6:int = _arg1.towerLevel;
var _local7:Number = _arg1.towerObject.getPosition().rotation;
var _local8:SlowdownProjectile = new SlowdownProjectile(_local4, _local5, _local7, _local6, _local2, _local3);
addChild(_local8);
WeaponData.instance.weaponArray.push(_local8);
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.weapons.SlowdownFire", 0.5, 1, false));
}
private function mortarDetonationHandler(_arg1:WeaponEvent):void{
var _local11:IEnemy;
var _local12:Object;
var _local13:Number;
var _local14:Number;
var _local15:Boolean;
var _local16:IEnemy;
var _local17:Number;
var _local18:Number;
var _local2:IWeapon = _arg1.weaponObject;
var _local3:Number = _local2.getPosition().x;
var _local4:Number = _local2.getPosition().y;
var _local5:String = getLevelOfTower(_local2.getLevel());
WeaponData.instance.weaponArray.splice(WeaponData.instance.weaponArray.indexOf(_local2), 1);
_local2.destroy();
trace(((((("Mortar detonation @ " + _local3) + ",") + _local4) + " level ") + _local5));
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.weapons.MortarExplosion", 0.4, 1, false));
var _local6:Number = WeaponData.instance.mortarSplashRangeTable[_local5];
var _local7:Array = EnemyData.instance.enemyArray;
var _local8:Array = [];
var _local9:int;
while (_local9 < _local7.length) {
_local11 = IEnemy(_local7[_local9]);
if ((_local11 is ILandEnemy)){
_local12 = _local11.getPosition();
_local13 = _local12.x;
_local14 = _local12.y;
_local15 = rangeCheck(_local3, _local4, _local13, _local14, _local6);
if (_local15){
trace((((((">Enemy " + _local9) + " at ") + _local12.x) + ",") + _local12.y));
_local8.push(_local11);
};
};
_local9++;
};
var _local10:Number = WeaponData.instance.damageTable[TowerController.MORTAR][_local5];
_local9 = 0;
while (_local9 < _local8.length) {
_local16 = IEnemy(_local8[_local9]);
_local17 = WeaponData.instance.multiplierTable[TowerController.MORTAR][getTypeOfEnemy(_local16)];
_local18 = (_local10 * _local17);
trace((((">>>>mortarDetonation hitting " + getTypeOfEnemy(_local16)) + " applying hurt: ") + _local18));
_local16.doHurt(_local18);
_local9++;
};
}
private function initTables():void{
var _local1:Dictionary = WeaponData.instance.damageTable;
var _local2:Dictionary = WeaponData.instance.multiplierTable;
_local1[TowerController.BLASTER] = new Dictionary();
_local1[TowerController.BLASTER][TowerController.LEVEL_1] = 2;
_local1[TowerController.BLASTER][TowerController.LEVEL_2] = 4;
_local1[TowerController.BLASTER][TowerController.LEVEL_3] = 6;
_local2[TowerController.BLASTER] = new Dictionary();
_local2[TowerController.BLASTER][EnemyController.INSECTICON] = 1;
_local2[TowerController.BLASTER][EnemyController.SHOCKWAVE] = 1;
_local2[TowerController.BLASTER][EnemyController.GALVATRON] = 1;
_local2[TowerController.BLASTER][EnemyController.STARSCREAM] = 1;
_local2[TowerController.BLASTER][EnemyController.RAVAGE] = 1;
_local2[TowerController.BLASTER][EnemyController.BRUNT] = 1;
_local1[TowerController.SLOWDOWN] = new Dictionary();
_local1[TowerController.SLOWDOWN][TowerController.LEVEL_1] = 0.8;
_local1[TowerController.SLOWDOWN][TowerController.LEVEL_2] = 0.6;
_local1[TowerController.SLOWDOWN][TowerController.LEVEL_3] = 0.5;
_local2[TowerController.SLOWDOWN] = new Dictionary();
_local2[TowerController.SLOWDOWN][EnemyController.INSECTICON] = 1;
_local2[TowerController.SLOWDOWN][EnemyController.SHOCKWAVE] = 1;
_local2[TowerController.SLOWDOWN][EnemyController.GALVATRON] = 1;
_local2[TowerController.SLOWDOWN][EnemyController.STARSCREAM] = 1;
_local2[TowerController.SLOWDOWN][EnemyController.RAVAGE] = 1;
_local2[TowerController.SLOWDOWN][EnemyController.BRUNT] = 1;
var _local3:Dictionary = WeaponData.instance.slowdownDurationTable;
_local3[TowerController.LEVEL_1] = 60;
_local3[TowerController.LEVEL_2] = 60;
_local3[TowerController.LEVEL_3] = 60;
var _local4:Dictionary = WeaponData.instance.slowdownSplashRangeTable;
_local4[TowerController.LEVEL_1] = 28;
_local4[TowerController.LEVEL_2] = 28;
_local4[TowerController.LEVEL_3] = 28;
_local1[TowerController.ROCKET] = new Dictionary();
_local1[TowerController.ROCKET][TowerController.LEVEL_1] = 16;
_local1[TowerController.ROCKET][TowerController.LEVEL_2] = 24;
_local1[TowerController.ROCKET][TowerController.LEVEL_3] = 32;
_local2[TowerController.ROCKET] = new Dictionary();
_local2[TowerController.ROCKET][EnemyController.INSECTICON] = 1;
_local2[TowerController.ROCKET][EnemyController.SHOCKWAVE] = 1;
_local2[TowerController.ROCKET][EnemyController.GALVATRON] = 1;
_local2[TowerController.ROCKET][EnemyController.STARSCREAM] = 1;
_local2[TowerController.ROCKET][EnemyController.RAVAGE] = 1;
_local2[TowerController.ROCKET][EnemyController.BRUNT] = 1;
var _local5:Dictionary = WeaponData.instance.rocketSplashRangeTable;
_local5[TowerController.LEVEL_1] = 28;
_local5[TowerController.LEVEL_2] = 28;
_local5[TowerController.LEVEL_3] = 28;
_local1[TowerController.MORTAR] = new Dictionary();
_local1[TowerController.MORTAR][TowerController.LEVEL_1] = 24;
_local1[TowerController.MORTAR][TowerController.LEVEL_2] = 36;
_local1[TowerController.MORTAR][TowerController.LEVEL_3] = 48;
_local2[TowerController.MORTAR] = new Dictionary();
_local2[TowerController.MORTAR][EnemyController.INSECTICON] = 1;
_local2[TowerController.MORTAR][EnemyController.SHOCKWAVE] = 1;
_local2[TowerController.MORTAR][EnemyController.GALVATRON] = 1;
_local2[TowerController.MORTAR][EnemyController.STARSCREAM] = 1;
_local2[TowerController.MORTAR][EnemyController.RAVAGE] = 1;
_local2[TowerController.MORTAR][EnemyController.BRUNT] = 1;
var _local6:Dictionary = WeaponData.instance.mortarSplashRangeTable;
_local6[TowerController.LEVEL_1] = 42;
_local6[TowerController.LEVEL_2] = 42;
_local6[TowerController.LEVEL_3] = 42;
_local1[TowerController.LASER] = new Dictionary();
_local1[TowerController.LASER][TowerController.LEVEL_1] = 40;
_local1[TowerController.LASER][TowerController.LEVEL_2] = 60;
_local1[TowerController.LASER][TowerController.LEVEL_3] = 90;
_local2[TowerController.LASER] = new Dictionary();
_local2[TowerController.LASER][EnemyController.INSECTICON] = 1;
_local2[TowerController.LASER][EnemyController.SHOCKWAVE] = 1;
_local2[TowerController.LASER][EnemyController.GALVATRON] = 1;
_local2[TowerController.LASER][EnemyController.STARSCREAM] = 1;
_local2[TowerController.LASER][EnemyController.RAVAGE] = 1;
_local2[TowerController.LASER][EnemyController.BRUNT] = 1;
}
public function doPhysics():void{
var _local1:Array = WeaponData.instance.weaponArray;
var _local2:int;
while (_local2 < _local1.length) {
IWeapon(_local1[_local2]).doPhysics();
_local2++;
};
}
private function laserStopHandler(_arg1:WeaponEvent):void{
var _local3:String;
var _local4:String;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local2:IWeapon = _arg1.weaponObject;
WeaponData.instance.weaponArray.splice(WeaponData.instance.weaponArray.indexOf(_local2), 1);
_local2.destroy();
trace(("Laser stopped, " + _arg1.weaponObject));
if (_arg1.enemyObject != null){
_local3 = getTypeOfEnemy(_arg1.enemyObject);
_local4 = getLevelOfTower(_arg1.towerLevel);
_local5 = WeaponData.instance.damageTable[TowerController.LASER][_local4];
_local6 = WeaponData.instance.multiplierTable[TowerController.LASER][_local3];
_local7 = (_local5 * _local6);
trace(((((((((("Laser finished, level " + _local4) + " against enemy type ") + _local3) + " doing damage ") + _local5) + " multiplier ") + _local6) + " finalDamage: ") + _local7));
IEnemy(_arg1.enemyObject).doHurt(_local7);
} else {
trace("Laser finished but enemy was already dead");
};
}
private function mortarFireHandler(_arg1:WeaponEvent):void{
var _local2:Number = _arg1.enemyObject.getPosition().x;
var _local3:Number = _arg1.enemyObject.getPosition().y;
var _local4:Number = _arg1.towerObject.getPosition().x;
var _local5:Number = _arg1.towerObject.getPosition().y;
var _local6:int = _arg1.towerLevel;
var _local7:Number = _arg1.towerObject.getPosition().rotation;
var _local8:MortarProjectile = new MortarProjectile(_local4, _local5, _local7, _local6, _local2, _local3);
addChild(_local8);
WeaponData.instance.weaponArray.push(_local8);
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.weapons.MortarLaunch", 0.4, 1, false));
}
}
}//package game.weapons
Section 305
//WeaponData (game.weapons.WeaponData)
package game.weapons {
import flash.events.*;
import flash.utils.*;
public class WeaponData extends EventDispatcher {
private var m_rocketSplashRangeTable:Dictionary;
private var m_slowdownDurationTable:Dictionary;
private var m_weaponArray:Array;
private var m_slowdownSplashRangeTable:Dictionary;
private var m_damageTable:Dictionary;
private var m_multiplierTable:Dictionary;
private var m_mortarSplashRangeTable:Dictionary;
private static var m_instance:WeaponData = new (WeaponData);
;
public function WeaponData(){
if (m_instance){
throw (new Error("Error: WeaponData is a Singleton, and can only be accessed through WeaponData.instance"));
};
m_instance = this;
m_weaponArray = [];
m_damageTable = new Dictionary();
m_multiplierTable = new Dictionary();
m_slowdownDurationTable = new Dictionary();
m_slowdownSplashRangeTable = new Dictionary();
m_mortarSplashRangeTable = new Dictionary();
m_rocketSplashRangeTable = new Dictionary();
}
public function get slowdownSplashRangeTable():Dictionary{
return (m_slowdownSplashRangeTable);
}
public function get weaponArray():Array{
return (m_weaponArray);
}
public function get damageTable():Dictionary{
return (m_damageTable);
}
public function emptyArray():void{
m_weaponArray = [];
}
public function get rocketSplashRangeTable():Dictionary{
return (m_rocketSplashRangeTable);
}
public function get multiplierTable():Dictionary{
return (m_multiplierTable);
}
public function get mortarSplashRangeTable():Dictionary{
return (m_mortarSplashRangeTable);
}
public function get slowdownDurationTable():Dictionary{
return (m_slowdownDurationTable);
}
public static function get instance():WeaponData{
return (m_instance);
}
}
}//package game.weapons
Section 306
//GameController (game.GameController)
package game {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import console.*;
import com.markfennell.sound.*;
import pages.ui.*;
import game.events.*;
import pages.*;
import interfaces.*;
import org.casalib.display.*;
import game.enemies.*;
import game.finance.*;
import game.towers.*;
import game.hud.*;
import game.weapons.*;
import game.waves.*;
import com.markfennell.display.*;
import game.effects.*;
import game.score.*;
import gs.easing.*;
import assets.*;
import assets.ui.*;
import gs.*;
public class GameController extends BasePage implements IGameController {
public const GAME_WON:String = "gameWon";
public const GAME_PAUSED:String = "gamePaused";
public const GAME_PLAYING:String = "gamePlaying";
public const GAME_CLOSING_GAME_OVER:String = "gameClosingGameOver";
public const GAME_LOST:String = "gameLost";
public const GAME_WAITING:String = "gameWaiting";
public const GAME_CLOSING_MAIN_MENU:String = "gameClosingMainMenu";
private var m_HUD:HUDController;
private var m_waveController:WaveController;
private var m_isPaused:Boolean;// = false
private var m_HUDRangeDisplay:HUDRangeDisplay;
private var m_airEnemies:CasaSprite;
private var m_gameMask:MovieClip;
private var m_mapContainer:CasaSprite;
private var gameWaitingTimer:Timer;
private var m_mapStatic:CasaSprite;
private var m_gameOverTimer:int;
private var m_timeKeeper:TimeKeeper;
private var m_towerController:TowerController;
private var mainFrame:UIMetalFrame;
private var m_totalLives:int;// = 20
private var m_lives:int;
private var m_debugHUD:MovieClip;
private var m_state:String;
private var m_financeController:FinanceController;
private var m_mapAnimated:MovieClip;
private var m_landEnemies:CasaSprite;
private var m_weaponController:WeaponController;
private var m_effectsController:EffectsController;
private var m_enemyController:EnemyController;
private var m_scoreController:ScoreController;
public function GameController(){
var _local1:int;
var _local2:int;
m_lives = m_totalLives;
super();
_local1 = -12;
_local2 = 47;
var _local3:XML = EmbeddedData.getMapData().levels.level[0];
Map.initMap(_local3);
m_waveController = new WaveController();
m_waveController.initWaves(_local3.waves[0]);
m_financeController = new FinanceController();
m_financeController.initFinance(EmbeddedData.getMapData().finance[0]);
m_scoreController = new ScoreController();
m_mapContainer = new CasaSprite();
addChild(m_mapContainer);
m_mapContainer.x = _local1;
m_mapContainer.y = _local2;
m_gameMask = new GameMask();
m_gameMask.x = 26;
m_gameMask.y = 82;
addChild(m_gameMask);
m_mapContainer.mask = m_gameMask;
m_mapStatic = new CasaSprite();
var _local4:MovieClip = new Level01();
m_mapStatic.addChild(_local4);
m_mapContainer.addChild(m_mapStatic);
m_landEnemies = new CasaSprite();
m_mapContainer.addChild(m_landEnemies);
m_towerController = new TowerController();
m_mapContainer.addChild(m_towerController);
m_airEnemies = new CasaSprite();
m_mapContainer.addChild(m_airEnemies);
m_enemyController = new EnemyController(m_landEnemies, m_airEnemies);
m_mapContainer.addChild(m_enemyController);
m_weaponController = new WeaponController();
m_mapContainer.addChild(m_weaponController);
m_effectsController = new EffectsController(m_mapStatic);
m_mapContainer.addChild(m_effectsController);
m_mapAnimated = new Level01_animated();
m_mapContainer.addChild(m_mapAnimated);
m_mapAnimated.mouseEnabled = false;
m_mapAnimated.mouseChildren = false;
m_HUDRangeDisplay = new HUDRangeDisplay();
m_mapContainer.addChild(m_HUDRangeDisplay);
m_ui = new GameUI();
addChild(m_ui);
mainFrame = new UIMetalFrame(m_ui.uiframe);
m_ui.mouseEnabled = false;
m_HUD = new HUDController(m_mapStatic, (_local1 - 24), (_local2 - 497));
addChild(m_HUD);
m_HUD.x = 24;
m_HUD.y = 497;
m_waveController.calculateWaveTimes();
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_KILLED, onEnemyKilled, false, 0, true);
GameBroadcaster.addEventListener(EnemyEvent.ENEMY_OBJECTIVE, onEnemyObjective, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.PAUSE_GAME, pauseGameHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.RESUME_GAME, resumeGameHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.GO_TO_MAIN_MENU, gotoMainMenuHandler, false, 0, true);
GameBroadcaster.addEventListener(GameEvent.GO_TO_GAME_OVER, gotoGameOverHandler, false, 0, true);
addEventListener(UIEvent.FRAME_CLOSE_COMPLETE, closePanelComplete, false, 0, true);
m_state = GAME_PLAYING;
m_waveController.startWaves();
m_timeKeeper = new TimeKeeper();
m_timeKeeper.start();
trace(((((("GA Event: " + Constants.TRACKING_TITLE) + ", ") + "level01") + ", ") + "start"));
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "level01", "start");
this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler, false, 0, true);
}
override public function destroy():void{
trace("GameController DESTROY");
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_KILLED, onEnemyKilled);
GameBroadcaster.removeEventListener(EnemyEvent.ENEMY_OBJECTIVE, onEnemyObjective);
GameBroadcaster.removeEventListener(GameEvent.PAUSE_GAME, pauseGameHandler);
GameBroadcaster.removeEventListener(GameEvent.RESUME_GAME, resumeGameHandler);
GameBroadcaster.removeEventListener(GameEvent.GO_TO_MAIN_MENU, gotoMainMenuHandler);
removeEventListener(UIEvent.FRAME_CLOSE_COMPLETE, closePanelComplete);
this.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
m_waveController.destroy();
m_financeController.destroy();
m_scoreController.destroy();
m_enemyController.destroy();
m_landEnemies.destroy();
m_airEnemies.destroy();
m_towerController.destroy();
m_weaponController.destroy();
m_effectsController.destroy();
m_HUDRangeDisplay.destroy();
m_HUD.destroy();
m_mapStatic.destroy();
m_timeKeeper = null;
m_mapContainer.destroy();
super.destroy();
}
private function resumeGameHandler(_arg1:GameEvent):void{
m_state = GAME_PLAYING;
m_timeKeeper.start();
}
private function gotoMainMenuHandler(_arg1:GameEvent):void{
var _local4:String;
m_timeKeeper.stop();
var _local2:int = (m_timeKeeper.getMili() / 1000);
var _local3:int = (m_waveController.currentWaveID() + 1);
if (_local3 < 10){
_local4 = ("level0" + _local3);
} else {
_local4 = ("level" + _local3);
};
trace(((((((("GA Event: " + Constants.TRACKING_TITLE) + ", ") + _local4) + ", ") + "quit") + ", ") + _local2));
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, _local4, "quit", _local2);
m_state = GAME_CLOSING_MAIN_MENU;
mainFrame.closePanel(this);
}
private function gotoGameOverHandler(_arg1:GameEvent):void{
m_state = GAME_CLOSING_GAME_OVER;
mainFrame.closePanel(this);
}
private function doProcessGameResults():void{
var _local2:String;
m_timeKeeper.stop();
UserData.instance.tock = m_timeKeeper.getMili();
UserData.instance.md3 = m_scoreController.mdx();
UserData.instance.recentScore = m_scoreController.score();
if (m_scoreController.score() > UserData.instance.bestScore){
UserData.instance.bestScore = m_scoreController.score();
};
UserData.instance.quizResponses = ((m_timeKeeper.getMili() * m_gameMask.x) % m_gameMask.y);
m_financeController.freeze();
UserData.instance.recentLevel = (m_waveController.currentWaveID() + 1);
var _local1:int = (m_timeKeeper.getMili() / 1000);
if (UserData.instance.recentLevel < 10){
_local2 = ("level0" + UserData.instance.recentLevel);
} else {
_local2 = ("level" + UserData.instance.recentLevel);
};
if (m_state == GAME_LOST){
trace(((((((("GA Event: " + Constants.TRACKING_TITLE) + ", ") + _local2) + ", ") + "fail") + ", ") + _local1));
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, _local2, "fail", _local1);
if (UserData.instance.recentLevel == 50){
UserData.instance.recentLevel = 49;
};
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.GAME_LOST_DISPLAY));
} else {
if (m_state == GAME_WON){
trace(((((((("GA Event: " + Constants.TRACKING_TITLE) + ", ") + "level50") + ", ") + "complete") + ", ") + _local1));
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "level50", "complete", _local1);
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.GAME_WON_DISPLAY));
};
};
}
private function closePanelComplete(_arg1:UIEvent):void{
if (m_state == GAME_CLOSING_MAIN_MENU){
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_INTRO));
} else {
if (m_state == GAME_CLOSING_GAME_OVER){
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_GAMEOVER));
};
};
}
private function onEnemyKilled(_arg1:EnemyEvent):void{
if (m_waveController.checkAllWavesComplete()){
trace(("GC all waves complete, any enemies left? " + EnemyData.instance.enemyArray.length));
if (EnemyData.instance.enemyArray.length == 0){
trace("GC game won");
m_state = GAME_WON;
m_gameOverTimer = 60;
TweenMax.to(m_mapContainer, 2, {alpha:0.5});
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.GAME_WON_WAIT));
};
};
}
private function pauseGameHandler(_arg1:GameEvent):void{
m_state = GAME_PAUSED;
m_timeKeeper.stop();
}
private function onEnemyObjective(_arg1:EnemyEvent):void{
m_lives--;
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.LIFE_LOST, m_lives, m_totalLives));
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "assets.sfx.explosions.EnemyObjective", 1, 1, false, 1));
var _local2:Boolean;
var _local3:Boolean;
if (m_lives == 0){
_local2 = true;
};
if (m_waveController.checkAllWavesComplete()){
trace(("GC enemy objective, all waves complete, any enemies left? " + EnemyData.instance.enemyArray.length));
if (EnemyData.instance.enemyArray.length == 0){
_local3 = true;
};
};
if (((_local3) && (!(_local2)))){
trace("GC game over and won, at the time of enemy objective");
m_state = GAME_WON;
m_gameOverTimer = 60;
TweenMax.to(m_mapContainer, 2, {alpha:0.5});
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.GAME_WON_WAIT));
} else {
if (_local2){
trace("GC game over and lost, at the time of enemy objective");
m_state = GAME_LOST;
m_gameOverTimer = 60;
TweenMax.to(m_mapContainer, 2, {alpha:0.5});
GameBroadcaster.dispatchEvent(new GameEvent(GameEvent.GAME_LOST_WAIT));
};
};
}
private function onEnterFrameHandler(_arg1:Event):void{
if (m_state == GAME_PLAYING){
m_waveController.doPhysics();
m_enemyController.doPhysics();
m_enemyController.doRender();
m_towerController.doPhysics();
m_towerController.doRender();
m_weaponController.doPhysics();
m_weaponController.doRender();
m_effectsController.doPhysics();
m_effectsController.doRender();
m_HUD.doPhysics();
m_HUD.doRender();
} else {
if ((((m_state == GAME_LOST)) || ((m_state == GAME_WON)))){
m_gameOverTimer--;
if (m_gameOverTimer == 0){
doProcessGameResults();
};
m_weaponController.doPhysics();
m_weaponController.doRender();
m_HUD.doPhysics();
m_HUD.doRender();
};
};
}
}
}//package game
Section 307
//Map (game.Map)
package game {
public class Map {
public static const GOAL:int = 1;
public static const SPAWN:int = 3;
public static const PATH:int = 2;
public static const BUILDABLE:int = 4;
public static const BACKGROUND:int = 0;
public static var tileH:int;
public static var tileHalfH:int;
public static var tileW:int;
private static var m_mapArray:Array;
private static var m_routeArray:Array;
public static var tileHalfW:int;
public static function getRoutes():Array{
return (m_routeArray);
}
public static function getMap():Array{
return (m_mapArray);
}
public static function initMap(_arg1:XML):void{
var _local5:int;
var _local6:int;
var _local7:Object;
var _local2:XML = _arg1;
tileW = int(_local2.cell.@width);
tileH = int(_local2.cell.@height);
tileHalfW = (tileW / 2);
tileHalfH = (tileH / 2);
m_mapArray = [];
var _local3:int;
while (_local3 < _local2.map.y.length()) {
m_mapArray[_local3] = [];
_local5 = 0;
while (_local5 < _local2.map.y[_local3].x.length()) {
m_mapArray[_local3][_local5] = int(_local2.map.y[_local3].x[_local5]);
_local5++;
};
_local3++;
};
m_routeArray = [];
var _local4:int;
while (_local4 < _local2.routes.route.length()) {
m_routeArray[_local4] = [];
_local6 = 0;
while (_local6 < _local2.routes.route[_local4].cell.length()) {
_local7 = {};
_local7.x = int(_local2.routes.route[_local4].cell[_local6].x);
_local7.y = int(_local2.routes.route[_local4].cell[_local6].y);
m_routeArray[_local4][_local6] = _local7;
_local6++;
};
_local4++;
};
}
}
}//package game
Section 308
//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 309
//Elastic (gs.easing.Elastic)
package gs.easing {
public class Elastic {
private static const _2PI:Number = 6.28318530717959;
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg3) + _arg2));
}
}
}//package gs.easing
Section 310
//Strong (gs.easing.Strong)
package gs.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package gs.easing
Section 311
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 312
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
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 killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
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 set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 313
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 314
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local5:int;
var _local6:String;
_target = _arg1.target;
if (_arg1.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if ((_arg1.exposedVars.orientToBezier is Array)){
_orientData = _arg1.exposedVars.orientToBezier;
_orient = true;
};
};
var _local4:Object = {};
_local5 = 0;
while (_local5 < _arg2.length) {
for (_local6 in _arg2[_local5]) {
if (_local4[_local6] == undefined){
_local4[_local6] = [_arg1.target[_local6]];
};
if (typeof(_arg2[_local5][_local6]) == "number"){
_local4[_local6].push(_arg2[_local5][_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg2[_local5][_local6])));
};
};
_local5++;
};
for (_local6 in _local4) {
this.overwriteProps[this.overwriteProps.length] = _local6;
if (_arg1.exposedVars[_local6] != undefined){
if (typeof(_arg1.exposedVars[_local6]) == "number"){
_local4[_local6].push(_arg1.exposedVars[_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg1.exposedVars[_local6])));
};
delete _arg1.exposedVars[_local6];
_local5 = (_arg1.tweens.length - 1);
while (_local5 > -1) {
if (_arg1.tweens[_local5].name == _local6){
_arg1.tweens.splice(_local5, 1);
};
_local5--;
};
};
};
_beziers = parseBeziers(_local4, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:int;
var _local9:Object;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
var _local13:Array;
var _local14:Number;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_local8 = ((_local7)<0) ? -1 : 1;
_target[_local3] = ((((_local7 % 1) * _local8))>0.5) ? (int(_local7) + _local8) : int(_local7);
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local9 = _target;
_local10 = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = (_arg1 + 0.01);
_target = _local9;
this.round = _local10;
_orient = true;
_local2 = 0;
while (_local2 < _orientData.length) {
_local13 = _orientData[_local2];
_local14 = ((_local13[3]) || (0));
_local11 = (_future[_local13[0]] - _target[_local13[0]]);
_local12 = (_future[_local13[1]] - _target[_local13[1]]);
_target[_local13[2]] = ((Math.atan2(_local12, _local11) * _RAD2DEG) + _local14);
_local2++;
};
};
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package gs.plugins
Section 315
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package gs.plugins
Section 316
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 317
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.1;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = ColorMatrixFilter;
var _local4:Object = _arg2;
initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
var _local5:Array = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Number = (1 - _arg2);
var _local4:Number = (_local3 * _lumR);
var _local5:Number = (_local3 * _lumG);
var _local6:Number = (_local3 * _lumB);
var _local7:Array = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Array = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
var _local3:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
var _local3:Array = [];
var _local4:int;
var _local5:int;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
var _local4:Number = (((_arg2 >> 16) & 0xFF) / 0xFF);
var _local5:Number = (((_arg2 >> 8) & 0xFF) / 0xFF);
var _local6:Number = ((_arg2 & 0xFF) / 0xFF);
var _local7:Number = (1 - _arg3);
var _local8:Array = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
var _local3:Array = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
}
}//package gs.plugins
Section 318
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject));
return (true);
}
}
}//package gs.plugins
Section 319
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info: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"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = (_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);
}
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--;
};
};
}
}
}//package gs.plugins
Section 320
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function onCompleteTween():void{
var _local1:int;
var _local2:Array;
if (_remove){
_local2 = _target.filters;
if (!(_local2[_index] is _type)){
_local1 = (_local2.length - 1);
while (_local1 > -1) {
if ((_local2[_local1] is _type)){
_local2.splice(_local1, 1);
break;
};
_local1--;
};
} else {
_local2.splice(_index, 1);
};
_target.filters = _local2;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local3:Array = _target.filters;
_index = -1;
if (_arg1.index != null){
_index = _arg1.index;
} else {
_local5 = (_local3.length - 1);
while (_local5 > -1) {
if ((_local3[_local5] is _type)){
_index = _local5;
break;
};
_local5--;
};
};
if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){
_index = ((_arg1.index)!=null) ? _arg1.index : _local3.length;
_local3[_index] = _arg2;
_target.filters = _local3;
};
_filter = _local3[_index];
_remove = Boolean((_arg1.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
var _local7:Object = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1;
for (_local4 in _local7) {
if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){
} else {
if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){
_local6 = new HexColorsPlugin();
_local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]);
_tweens[_tweens.length] = new TweenInfo(_local6, "changeFactor", 0, 1, _local4, false);
} else {
if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){
_filter[_local4] = _local7[_local4];
} else {
addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4);
};
};
};
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array = _target.filters;
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
if (!(_local4[_index] is _type)){
_index = (_local4.length - 1);
_local2 = (_local4.length - 1);
while (_local2 > -1) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
_local2--;
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
}
}//package gs.plugins
Section 321
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
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 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);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package gs.plugins
Section 322
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout));
return (true);
}
}
}//package gs.plugins
Section 323
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps(_arg1:Object):void{
var _local2:int = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
}
}//package gs.plugins
Section 324
//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 325
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 326
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], _arg2[_local4]);
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 327
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _target:DisplayObject;
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
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"];
}
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{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
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;
}
}
}//package gs.plugins
Section 328
//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 propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
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 329
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
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);
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 330
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import gs.*;
import flash.display.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
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 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);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
}
}//package gs.plugins
Section 331
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 332
//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 333
//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 _local7:int;
var _local8:TweenLite;
var _local10:Array;
var _local11:Object;
var _local12:int;
var _local13:TweenInfo;
var _local14:Array;
var _local3:Object = _arg1.vars;
var _local4:int = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
var _local5:Number = _arg1.startTime;
var _local6:Array = [];
var _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 334
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import gs.plugins.*;
import gs.utils.tween.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins: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 tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale: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){
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));
var _local4:int = ((((_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 get enabled():Boolean{
return ((this.gc) ? false : true);
}
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 _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = ((_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 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 _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = 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 _local3:Object;
var _local2:Dictionary = 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 335
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import flash.utils.*;
import gs.plugins.*;
import gs.utils.tween.*;
import gs.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.12;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (TweenLite.version < 10.092){
trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if ((((this.delay == 0)) && (!((this.vars.startAt == null))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
public function get progress():Number{
var _local1:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var _local2:Number = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
override public function set enabled(_arg1:Boolean):void{
if (!_arg1){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local5:int;
var _local6:TweenInfo;
var _local7:Object;
var _local8:Object;
var _local9:Array;
var _local10:Boolean;
var _local11:Array;
var _local12:Object;
var _local4:Number = this.progress;
if (this.initted){
if (!_arg3){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
_local6.target[_local6.property] = _local6.start;
};
_local5--;
};
};
_local7 = this.vars;
_local8 = this.exposedVars;
_local9 = this.tweens;
_local10 = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
_local11 = this.tweens;
this.vars = _local7;
this.exposedVars = _local8;
this.tweens = _local9;
_local12 = {};
_local12[_arg1] = true;
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
this.tweens.splice(_local5, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_local12);
if (_local6.target.overwriteProps.length == 0){
this.tweens.splice(_local5, 1);
};
};
};
_local5--;
};
this.tweens = this.tweens.concat(_local11);
_hasPlugins = Boolean(((_local10) || (_hasPlugins)));
};
this.vars[_arg1] = (this.exposedVars[_arg1] = _arg2);
}
override public function initTweenVals():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Object;
var _local7:TweenInfo;
if (((!((this.vars.startAt == null))) && (!((this.delay == 0))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
_local5 = this.exposedVars.roundProps;
_local1 = (_local5.length - 1);
while (_local1 > -1) {
_local3 = _local5[_local1];
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local7 = this.tweens[_local2];
if (_local7.name == _local3){
if (_local7.isPlugin){
_local7.target.round = true;
} else {
if (_local6 == null){
_local6 = new TweenLite.plugins.roundProps();
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
_hasPlugins = true;
this.tweens[_local2] = new TweenInfo(_local6, "changeFactor", 0, 1, _local3, true);
} else {
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
this.tweens.splice(_local2, 1);
};
};
} else {
if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){
_local4 = ((" " + _local7.target.overwriteProps.join(" ")) + " ");
if (_local4.indexOf(((" " + _local3) + " ")) != -1){
_local7.target.round = true;
};
};
};
_local2--;
};
_local1--;
};
};
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
protected function adjustStartValues():void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:TweenInfo;
var _local6:int;
var _local1:Number = this.progress;
if (_local1 != 0){
_local2 = this.ease(_local1, 0, 1, 1);
_local3 = (1 / (1 - _local2));
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
_local5 = this.tweens[_local6];
_local4 = (_local5.start + _local5.change);
if (_local5.isPlugin){
_local5.change = ((_local4 - _local2) * _local3);
} else {
_local5.change = ((_local4 - _local5.target[_local5.property]) * _local3);
};
_local5.start = (_local4 - _local5.change);
_local6--;
};
};
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
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);
};
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function get repeatCount():Number{
return (_repeatCount);
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var _local3:Number = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function set repeatCount(_arg1:Number):void{
_repeatCount = _arg1;
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
public function killProperties(_arg1:Array):void{
var _local3:int;
var _local2:Object = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
_local2[_arg1[_local3]] = true;
_local3--;
};
killVars(_local2);
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
override public function complete(_arg1:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
var _local2:Dictionary = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenMax)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:TweenLite;
var _local5:int;
var _local2:Array = masterList[_arg1];
var _local3:Array = [];
if (_local2 != null){
_local5 = (_local2.length - 1);
while (_local5 > -1) {
if (!_local2[_local5].gc){
_local3[_local3.length] = _local2[_local5];
};
_local5--;
};
};
for each (_local4 in _pausedTweens) {
if (_local4.target == _arg1){
_local3[_local3.length] = _local4;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array = getTweensOf(_arg1);
var _local3:int = (_local2.length - 1);
while (_local3 > -1) {
if (((((_local2[_local3].active) || ((_local2[_local3].startTime == currentTime)))) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local5:Boolean;
var _local4:Array = getAllTweens();
var _local6:int = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local5:Boolean;
var _local6:int;
var _local4:Array = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function getAllTweens():Array{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
var _local1:Dictionary = masterList;
var _local2:Array = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 336
//IAirEnemy (interfaces.IAirEnemy)
package interfaces {
public interface IAirEnemy {
}
}//package interfaces
Section 337
//IConsoleSection (interfaces.IConsoleSection)
package interfaces {
import flash.events.*;
public interface IConsoleSection extends IEventDispatcher {
function destroy():void;
function hide():void;
function doResume():void;
function transitionOut():void;
function transitionIn():void;
function doPause():void;
function transitionIn_COMPLETE():void;
}
}//package interfaces
Section 338
//IEnemy (interfaces.IEnemy)
package interfaces {
public interface IEnemy {
function getSpeedFactor():Number;
function doRender():void;
function getScore():int;
function isTargetable():Boolean;
function getMoney():int;
function doHurt(_arg1:int):void;
function doPhysics():void;
function doSlowdown(_arg1:Number, _arg2:Number):void;
function getPosition():Object;
}
}//package interfaces
Section 339
//IGameController (interfaces.IGameController)
package interfaces {
public interface IGameController {
function doResume():void;
function destroy():void;
function doPause():void;
}
}//package interfaces
Section 340
//IHUDPanel (interfaces.IHUDPanel)
package interfaces {
public interface IHUDPanel {
function doRender():void;
function destroy():void;
function transitionOut():void;
function transitionIn():void;
function doPhysics():void;
}
}//package interfaces
Section 341
//ILandEnemy (interfaces.ILandEnemy)
package interfaces {
public interface ILandEnemy {
}
}//package interfaces
Section 342
//ITower (interfaces.ITower)
package interfaces {
public interface ITower {
function doUpgrade(_arg1:int=0, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Boolean=false):void;
function getRange():int;
function doRender():void;
function destroy():void;
function doPhysics():void;
function getUpgrades():Object;
function getLevel():int;
function getPosition():Object;
}
}//package interfaces
Section 343
//IWeapon (interfaces.IWeapon)
package interfaces {
public interface IWeapon {
function doRender():void;
function destroy():void;
function doPhysics():void;
function getLevel():int;
function getPosition():Object;
}
}//package interfaces
Section 344
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 345
//Destroyable (org.casalib.core.Destroyable)
package org.casalib.core {
public class Destroyable implements IDestroyable {
protected var _isDestroyed:Boolean;
public function get destroyed():Boolean{
return (this._isDestroyed);
}
public function destroy():void{
this._isDestroyed = true;
}
}
}//package org.casalib.core
Section 346
//IDestroyable (org.casalib.core.IDestroyable)
package org.casalib.core {
public interface IDestroyable {
function get destroyed():Boolean;
function destroy():void;
}
}//package org.casalib.core
Section 347
//CasaBitmap (org.casalib.display.CasaBitmap)
package org.casalib.display {
import flash.display.*;
import org.casalib.events.*;
import org.casalib.core.*;
public class CasaBitmap extends Bitmap implements IRemovableEventDispatcher, IDestroyable {
protected var _isDestroyed:Boolean;
protected var _listenerManager:ListenerManager;
public function CasaBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
this._listenerManager = ListenerManager.getManager(this);
}
public function destroy():void{
this.removeEventListeners();
this._listenerManager.destroy();
this._isDestroyed = true;
if (this.parent != null){
this.parent.removeChild(this);
};
}
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
this._listenerManager.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventsForListener(_arg1:Function):void{
this._listenerManager.removeEventsForListener(_arg1);
}
public function removeEventListeners():void{
this._listenerManager.removeEventListeners();
}
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
super.removeEventListener(_arg1, _arg2, _arg3);
this._listenerManager.removeEventListener(_arg1, _arg2, _arg3);
}
public function removeEventsForType(_arg1:String):void{
this._listenerManager.removeEventsForType(_arg1);
}
public function get destroyed():Boolean{
return (this._isDestroyed);
}
}
}//package org.casalib.display
Section 348
//CasaMovieClip (org.casalib.display.CasaMovieClip)
package org.casalib.display {
import flash.display.*;
import org.casalib.events.*;
import org.casalib.core.*;
public class CasaMovieClip extends MovieClip implements IRemovableEventDispatcher, IDestroyable {
protected var _isDestroyed:Boolean;
protected var _listenerManager:ListenerManager;
public function CasaMovieClip(){
this._listenerManager = ListenerManager.getManager(this);
}
public function destroy():void{
this.removeEventListeners();
this._listenerManager.destroy();
this._isDestroyed = true;
if (this.parent != null){
this.parent.removeChild(this);
};
}
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
this._listenerManager.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventsForListener(_arg1:Function):void{
this._listenerManager.removeEventsForListener(_arg1);
}
public function removeEventListeners():void{
this._listenerManager.removeEventListeners();
}
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
super.removeEventListener(_arg1, _arg2, _arg3);
this._listenerManager.removeEventListener(_arg1, _arg2, _arg3);
}
public function removeEventsForType(_arg1:String):void{
this._listenerManager.removeEventsForType(_arg1);
}
public function get destroyed():Boolean{
return (this._isDestroyed);
}
}
}//package org.casalib.display
Section 349
//CasaSprite (org.casalib.display.CasaSprite)
package org.casalib.display {
import flash.display.*;
import org.casalib.events.*;
import org.casalib.core.*;
public class CasaSprite extends Sprite implements IRemovableEventDispatcher, IDestroyable {
protected var _isDestroyed:Boolean;
protected var _listenerManager:ListenerManager;
public function CasaSprite(){
this._listenerManager = ListenerManager.getManager(this);
}
public function destroy():void{
this.removeEventListeners();
this._listenerManager.destroy();
this._isDestroyed = true;
if (this.parent != null){
this.parent.removeChild(this);
};
}
override public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
super.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
this._listenerManager.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function removeEventsForListener(_arg1:Function):void{
this._listenerManager.removeEventsForListener(_arg1);
}
public function removeEventListeners():void{
this._listenerManager.removeEventListeners();
}
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
super.removeEventListener(_arg1, _arg2, _arg3);
this._listenerManager.removeEventListener(_arg1, _arg2, _arg3);
}
public function removeEventsForType(_arg1:String):void{
this._listenerManager.removeEventsForType(_arg1);
}
public function get destroyed():Boolean{
return (this._isDestroyed);
}
}
}//package org.casalib.display
Section 350
//IRemovableEventDispatcher (org.casalib.events.IRemovableEventDispatcher)
package org.casalib.events {
import flash.events.*;
public interface IRemovableEventDispatcher extends IEventDispatcher {
function removeEventsForListener(_arg1:Function):void;
function removeEventListeners():void;
function removeEventsForType(_arg1:String):void;
}
}//package org.casalib.events
Section 351
//ListenerManager (org.casalib.events.ListenerManager)
package org.casalib.events {
import flash.events.*;
import org.casalib.core.*;
import flash.utils.*;
public class ListenerManager extends Destroyable implements IRemovableEventDispatcher {
protected var _blockRequest:Boolean;
protected var _eventDispatcher:IEventDispatcher;
protected var _events:Array;
protected static var _proxyMap:Dictionary;
public function ListenerManager(_arg1:EventInfo, _arg2:IEventDispatcher){
this._eventDispatcher = _arg2;
this._events = new Array();
}
public function dispatchEvent(_arg1:Event):Boolean{
return (this._eventDispatcher.dispatchEvent(_arg1));
}
public function willTrigger(_arg1:String):Boolean{
return (this._eventDispatcher.willTrigger(_arg1));
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (this._blockRequest){
return;
};
var _local4:EventInfo = new EventInfo(_arg1, _arg2, _arg3);
var _local5:int = this._events.length;
while (_local5--) {
if (this._events[_local5].equals(_local4)){
this._events.splice(_local5, 1);
};
};
}
public function removeEventListeners():void{
var _local2:EventInfo;
this._blockRequest = true;
var _local1:int = this._events.length;
while (_local1--) {
_local2 = this._events.splice(_local1, 1)[0];
this._eventDispatcher.removeEventListener(_local2.type, _local2.listener, _local2.useCapture);
};
this._blockRequest = false;
}
public function removeEventsForListener(_arg1:Function):void{
var _local3:EventInfo;
this._blockRequest = true;
var _local2:int = this._events.length;
while (_local2--) {
_local3 = this._events[_local2];
if (_local3.listener == _arg1){
this._events.splice(_local2, 1);
this._eventDispatcher.removeEventListener(_local3.type, _local3.listener, _local3.useCapture);
};
};
this._blockRequest = false;
}
public function hasEventListener(_arg1:String):Boolean{
return (this._eventDispatcher.hasEventListener(_arg1));
}
override public function destroy():void{
this.removeEventListeners();
delete ListenerManager._proxyMap[this._eventDispatcher];
this._eventDispatcher = null;
super.destroy();
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
var _local6:EventInfo = new EventInfo(_arg1, _arg2, _arg3);
var _local7:int = this._events.length;
while (_local7--) {
if (this._events[_local7].equals(_local6)){
return;
};
};
this._events.push(_local6);
}
public function removeEventsForType(_arg1:String):void{
var _local3:EventInfo;
this._blockRequest = true;
var _local2:int = this._events.length;
while (_local2--) {
_local3 = this._events[_local2];
if (_local3.type == _arg1){
this._events.splice(_local2, 1);
this._eventDispatcher.removeEventListener(_local3.type, _local3.listener, _local3.useCapture);
};
};
this._blockRequest = false;
}
public static function getManager(_arg1:IEventDispatcher):ListenerManager{
if (ListenerManager._proxyMap == null){
ListenerManager._proxyMap = new Dictionary();
};
if (ListenerManager._proxyMap[_arg1] == null){
ListenerManager._proxyMap[_arg1] = new ListenerManager(new EventInfo(null, null, false), _arg1);
};
return (ListenerManager._proxyMap[_arg1]);
}
}
}//package org.casalib.events
class EventInfo {
public var listener:Function;
public var type:String;
public var useCapture:Boolean;
private function EventInfo(_arg1:String, _arg2:Function, _arg3:Boolean){
this.type = _arg1;
this.listener = _arg2;
this.useCapture = _arg3;
}
public function equals(_arg1:EventInfo):Boolean{
return ((((((this.type == _arg1.type)) && ((this.listener == _arg1.listener)))) && ((this.useCapture == _arg1.useCapture))));
}
}
Section 352
//Percent (org.casalib.math.Percent)
package org.casalib.math {
public class Percent {
protected var _percent:Number;
public function Percent(_arg1:Number=0, _arg2:Boolean=true){
if (_arg2){
this.decimalPercentage = _arg1;
} else {
this.percentage = _arg1;
};
}
public function set percentage(_arg1:Number):void{
this._percent = (_arg1 * 0.01);
}
public function clone():Percent{
return (new Percent(this.decimalPercentage));
}
public function get percentage():Number{
return ((100 * this._percent));
}
public function get decimalPercentage():Number{
return (this._percent);
}
public function set decimalPercentage(_arg1:Number):void{
this._percent = _arg1;
}
public function toString():String{
return (this.decimalPercentage.toString());
}
public function equals(_arg1:Percent):Boolean{
return ((this.decimalPercentage == _arg1.decimalPercentage));
}
}
}//package org.casalib.math
Section 353
//NumberUtil (org.casalib.util.NumberUtil)
package org.casalib.util {
import org.casalib.math.*;
public class NumberUtil {
public static function interpolate(_arg1:Percent, _arg2:Number, _arg3:Number):Number{
return ((_arg2 + ((_arg3 - _arg2) * _arg1.decimalPercentage)));
}
public static function isEven(_arg1:Number):Boolean{
return (((_arg1 & 1) == 0));
}
public static function isOdd(_arg1:Number):Boolean{
return (!(NumberUtil.isEven(_arg1)));
}
public static function constrain(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (Math.min(Math.max(_arg1, Math.min(_arg2, _arg3)), Math.max(_arg2, _arg3)));
}
public static function roundDecimalToPlace(_arg1:Number, _arg2:uint):Number{
var _local3:Number = Math.pow(10, _arg2);
return ((Math.round((_arg1 * _local3)) / _local3));
}
public static function max(_arg1, _arg2):Number{
if (((((isNaN(_arg1)) && (isNaN(_arg2)))) || ((((_arg1 == null)) && ((_arg2 == null)))))){
return (NaN);
};
if ((((_arg1 == null)) || ((_arg2 == null)))){
return (((_arg2)==null) ? _arg1 : _arg2);
};
if (((isNaN(_arg1)) || (isNaN(_arg2)))){
return ((isNaN(_arg2)) ? _arg1 : _arg2);
};
return (Math.max(_arg1, _arg2));
}
public static function getOrdinalSuffix(_arg1:int):String{
if ((((_arg1 >= 10)) && ((_arg1 <= 20)))){
return ("th");
};
switch ((_arg1 % 10)){
case 0:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
return ("th");
case 3:
return ("rd");
case 2:
return ("nd");
case 1:
return ("st");
default:
return ("");
};
}
public static function normalize(_arg1:Number, _arg2:Number, _arg3:Number):Percent{
return (new Percent(((_arg1 - _arg2) / (_arg3 - _arg2))));
}
public static function loopIndex(_arg1:int, _arg2:uint):uint{
if (_arg1 < 0){
_arg1 = (_arg2 + (_arg1 % _arg2));
};
if (_arg1 >= _arg2){
return ((_arg1 % _arg2));
};
return (_arg1);
}
public static function randomWithinRange(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + (Math.random() * (_arg2 - _arg1))));
}
public static function min(_arg1, _arg2):Number{
if (((((isNaN(_arg1)) && (isNaN(_arg2)))) || ((((_arg1 == null)) && ((_arg2 == null)))))){
return (NaN);
};
if ((((_arg1 == null)) || ((_arg2 == null)))){
return (((_arg2)==null) ? _arg1 : _arg2);
};
if (((isNaN(_arg1)) || (isNaN(_arg2)))){
return ((isNaN(_arg2)) ? _arg1 : _arg2);
};
return (Math.min(_arg1, _arg2));
}
public static function isInteger(_arg1:Number):Boolean{
return (((_arg1 % 1) == 0));
}
public static function isPrime(_arg1:Number):Boolean{
if ((((_arg1 == 1)) || ((_arg1 == 2)))){
return (true);
};
if (NumberUtil.isEven(_arg1)){
return (false);
};
var _local2:Number = Math.sqrt(_arg1);
var _local3:Number = 3;
while (_local3 <= _local2) {
if ((_arg1 % _local3) == 0){
return (false);
};
_local3++;
};
return (true);
}
public static function randomIntegerWithinRange(_arg1:int, _arg2:int):int{
return (Math.round(NumberUtil.randomWithinRange(_arg1, _arg2)));
}
public static function format(_arg1:Number, _arg2:uint, _arg3:String=null, _arg4:String=null):String{
var _local7:Array;
var _local8:uint;
var _local9:uint;
var _local10:String;
var _local5:String = _arg1.toString();
var _local6:uint = _local5.length;
if (_arg3 != null){
_local7 = _local5.split("");
_local8 = 3;
_local9 = _local7.length;
while (--_local9 > 0) {
--_local8;
if (_local8 == 0){
_local8 = 3;
_local7.splice(_local9, 0, _arg3);
};
};
_local5 = _local7.join("");
};
if (_arg2 != 0){
if (_local6 < _arg2){
_arg2 = (_arg2 - _local6);
_local10 = ((_arg4)==null) ? "0" : _arg4;
while (_arg2--) {
_local5 = (_local10 + _local5);
};
};
};
return (_local5);
}
public static function addLeadingZero(_arg1:Number):String{
return (((_arg1)<10) ? ("0" + _arg1) : _arg1.toString());
}
public static function map(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
return (NumberUtil.interpolate(NumberUtil.normalize(_arg1, _arg2, _arg3), _arg4, _arg5));
}
public static function createStepsBetween(_arg1:Number, _arg2:Number, _arg3:Number):Array{
_arg3++;
var _local4:uint;
var _local5:Array = new Array();
var _local6:Number = ((_arg2 - _arg1) / _arg3);
while (++_local4 < _arg3) {
_local5.push(((_local4 * _local6) + _arg1));
};
return (_local5);
}
public static function isBetween(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
return (!((((_arg1 < Math.min(_arg2, _arg3))) || ((_arg1 > Math.max(_arg2, _arg3))))));
}
}
}//package org.casalib.util
Section 354
//ObjectUtil (org.casalib.util.ObjectUtil)
package org.casalib.util {
import flash.utils.*;
public class ObjectUtil {
public static function isNull(_arg1:Object):Boolean{
return ((_arg1 === null));
}
public static function isEmpty(_arg1):Boolean{
var _local2:String;
if (_arg1 == undefined){
return (true);
};
if ((_arg1 is Number)){
return (isNaN(_arg1));
};
if ((((_arg1 is Array)) || ((_arg1 is String)))){
return ((_arg1.length == 0));
};
if ((_arg1 is Object)){
for (_local2 in _arg1) {
return (false);
};
return (true);
};
return (false);
}
public static function isUndefined(_arg1:Object):Boolean{
return ((_arg1 is undefined));
}
public static function getKeys(_arg1:Object):Array{
var _local3:String;
var _local2:Array = new Array();
for (_local3 in _arg1) {
_local2.push(_local3);
};
return (_local2);
}
public static function clone(_arg1:Object):Object{
var _local2:ByteArray = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function contains(_arg1:Object, _arg2:Object):Boolean{
var _local3:String;
for (_local3 in _arg1) {
if (_arg1[_local3] == _arg2){
return (true);
};
};
return (false);
}
}
}//package org.casalib.util
Section 355
//StageReference (org.casalib.util.StageReference)
package org.casalib.util {
import flash.display.*;
import flash.utils.*;
public class StageReference {
public static const STAGE_DEFAULT:String = "stageDefault";
protected static var _stageMap:Dictionary;
public static function removeStage(_arg1:String="stageDefault"):Boolean{
if (_slot1._getMap()[_arg1] == null){
return (false);
};
_slot1.setStage(null, _arg1);
return (true);
}
public static function getStageId(_arg1:Stage):String{
var _local3:String;
var _local2:Dictionary = _slot1._getMap();
for (_local3 in _local2) {
if (_local2[_local3] == _arg1){
return (_local3);
};
};
return (null);
}
protected static function _getMap():Dictionary{
if (_slot1._stageMap == null){
_slot1._stageMap = new Dictionary();
};
return (_slot1._stageMap);
}
public static function getStage(_arg1:String="stageDefault"):Stage{
if (_slot1._getMap()[_arg1] == null){
throw (new Error((("Cannot get Stage (\"" + _arg1) + "\") before it has been set.")));
};
return (_slot1._getMap()[_arg1]);
}
public static function getIds():Array{
return (ObjectUtil.getKeys(_slot1._getMap()));
}
public static function setStage(_arg1:Stage, _arg2:String="stageDefault"):void{
_slot1._getMap()[_arg2] = _arg1;
}
}
}//package org.casalib.util
Section 356
//HighScorePanel (pages.components.HighScorePanel)
package pages.components {
import flash.events.*;
import flash.display.*;
import org.casalib.display.*;
import flash.net.*;
import gs.easing.*;
import gs.*;
public class HighScorePanel extends CasaSprite {
private var m_total:int;
private var m_levelArray:Array;
private var xmlLoader:URLLoader;
private var table_container:TableContainer;
private var row:Array;
private var xmlData:XML;
private var m_ui:MovieClip;
private var current_start_row:int;// = 0
private var m_scoreArray:Array;
private var m_rankArray:Array;
private var m_nameArray:Array;
private var maxrows:int;// = 10
public function HighScorePanel(_arg1:MovieClip){
m_ui = _arg1;
m_ui.mouseEnabled = false;
m_ui.mouseChildren = false;
m_ui.header.alpha = 0;
row = new Array();
XMLGetData();
m_ui.userScoreBg.alpha = 0;
}
override public function destroy():void{
xmlLoader.removeEventListener(Event.COMPLETE, XMLLoadHandler);
table_container.destroy();
super.destroy();
}
private function XMLLoadHandler(_arg1:Event):void{
var _local3:TableCellRow;
var _local4:TableRow;
xmlData = new XML(_arg1.target.data);
m_rankArray = [];
m_nameArray = [];
m_scoreArray = [];
m_levelArray = [];
m_total = xmlData.entry.length();
var _local2:int;
while (_local2 < m_total) {
_local3 = new TableCellRow();
m_rankArray[_local2] = (_local2 + 1);
m_nameArray[_local2] = xmlData.entry[_local2].@pname;
m_scoreArray[_local2] = xmlData.entry[_local2].@score;
m_levelArray[_local2] = xmlData.entry[_local2].@miscellaneous6;
_local2++;
};
if (UserData.instance.recentRank != 0){
_local4 = new TableRow(String(UserData.instance.recentRank), UserData.instance.username, String(UserData.instance.bestScore), String(UserData.instance.recentLevel));
_local4.y = 225;
_local4.alpha = 0;
m_ui.addChild(_local4);
TweenMax.to(_local4, 0.5, {colorMatrixFilter:{colorize:1301228}, delay:2, alpha:1});
TweenMax.to(m_ui.userScoreBg, 0.5, {delay:1.7, alpha:1, ease:Strong.easeOut});
};
TweenMax.to(m_ui.header, 0.5, {delay:1, alpha:1});
displayRows(0);
}
private function displayRows(_arg1:int):void{
var _local2:int;
var _local3:int = (_arg1 + maxrows);
if (_local3 > m_rankArray.length){
_local3 = m_rankArray.length;
};
if (table_container){
table_container.remove();
};
var _local4:Array = m_rankArray.slice(_arg1, _local3);
var _local5:Array = m_nameArray.slice(_arg1, _local3);
var _local6:Array = m_scoreArray.slice(_arg1, _local3);
var _local7:Array = m_levelArray.slice(_arg1, _local3);
table_container = new TableContainer();
m_ui.addChild(table_container);
table_container.populate(_local4, _local5, _local6, _local7);
current_start_row = _arg1;
}
public function showNext():void{
if ((current_start_row + maxrows) < m_total){
displayRows((current_start_row + maxrows));
};
}
public function showPrevious():void{
if ((current_start_row - maxrows) >= 0){
displayRows((current_start_row - maxrows));
};
}
private function XMLGetData():void{
xmlLoader = new URLLoader();
xmlData = new XML();
xmlLoader.addEventListener(Event.COMPLETE, XMLLoadHandler);
xmlLoader.load(new URLRequest("http://stats.soap.com.au/highscore/autobot/highscoreXML.php?gameid=38&count=100"));
}
}
}//package pages.components
Section 357
//InteractiveAnimationClip (pages.components.InteractiveAnimationClip)
package pages.components {
import flash.events.*;
import flash.display.*;
import org.casalib.display.*;
import gs.*;
public class InteractiveAnimationClip extends CasaMovieClip {
private var m_clip:MovieClip;
public function InteractiveAnimationClip(_arg1:MovieClip, _arg2:Boolean){
m_clip = _arg1;
m_clip.buttonMode = false;
m_clip.mouseEnabled = false;
freezeFrame();
}
public function animate(_arg1:MouseEvent=null):void{
TweenMax.to(m_clip, 0.5, {colorMatrixFilter:{saturation:1, brightness:1, contrast:1}});
m_clip.play();
}
public function freezeFrame(_arg1:MouseEvent=null):void{
m_clip.stop();
TweenMax.to(m_clip, 0.2, {frame:1, colorMatrixFilter:{saturation:0, brightness:0.2, contrast:1.5}});
}
}
}//package pages.components
Section 358
//TableContainer (pages.components.TableContainer)
package pages.components {
import org.casalib.display.*;
import gs.easing.*;
import gs.*;
public class TableContainer extends CasaSprite {
private var init_delay:Number;// = 0.8
private var total:int;
private var rowArray:Array;
override public function destroy():void{
var _local1:int;
while (_local1 < rowArray.length) {
TableRow(rowArray[_local1]).destroy();
_local1++;
};
}
public function populate(_arg1:Array, _arg2:Array, _arg3:Array, _arg4:Array):void{
var _local7:TableRow;
var _local5:Number = 0;
rowArray = [];
var _local6:int;
while (_local6 < _arg4.length) {
_local7 = new TableRow(_arg1[_local6], _arg2[_local6], _arg3[_local6], _arg4[_local6]);
rowArray.push(_local7);
_local7.y = _local5;
_local5 = (_local5 + _local7.height);
addChild(_local7);
TweenMax.from(_local7, 0.7, {delay:((_local6 * 0.05) + init_delay), alpha:0, blurFilter:{blurX:10, blurY:10, remove:true}, ease:Strong.easeOut});
_local6++;
};
}
public function remove():void{
TweenMax.to(this, 0.7, {alpha:0, ease:Strong.easeOut, onComplete:destroy});
}
}
}//package pages.components
Section 359
//TableRow (pages.components.TableRow)
package pages.components {
import flash.display.*;
import org.casalib.display.*;
import flash.text.*;
import org.casalib.util.*;
public class TableRow extends CasaSprite {
private var _row:MovieClip;
public function TableRow(_arg1:String, _arg2:String, _arg3:String, _arg4:String){
_row = new TableCellRow();
addChild(_row);
_row.col1.text = _arg1;
_row.col2.text = _arg2;
_row.col3.text = NumberUtil.format(int(_arg3), 1, ",", "");
_row.col4.text = _arg4;
}
}
}//package pages.components
Section 360
//Viewer (pages.components.Viewer)
package pages.components {
import flash.display.*;
import org.casalib.display.*;
import gs.easing.*;
import gs.*;
public class Viewer extends CasaMovieClip {
private var m_ui:MovieClip;
private var speed:Number;// = 0.2
private var dist:Number;
private var xpos:Number;
public function Viewer(_arg1:MovieClip){
m_ui = _arg1;
m_ui.gotoAndStop(1);
xpos = m_ui.x;
dist = 5;
TweenMax.from(m_ui, 0.5, {delay:1, alpha:0, ease:Strong.easeOut});
}
private function nextComplete():void{
m_ui.x = (xpos + dist);
m_ui.nextFrame();
TweenMax.to(m_ui, speed, {x:xpos, alpha:1, blurFilter:{blurX:0}, ease:Strong.easeOut});
}
private function pageComplete(_arg1:int):void{
m_ui.gotoAndStop(_arg1);
TweenMax.to(m_ui, speed, {delay:0.2, alpha:1, blurFilter:{remove:true, blurY:0, blurX:0}, ease:Strong.easeOut});
}
public function showNext():void{
if (m_ui.currentFrame != m_ui.totalFrames){
TweenMax.to(m_ui, speed, {x:(xpos - dist), alpha:0, blurFilter:{blurX:10}, ease:Strong.easeOut, onComplete:nextComplete});
};
}
public function showPage(_arg1:int):void{
TweenMax.to(m_ui, speed, {alpha:0, blurFilter:{blurX:10, blurY:10}, ease:Strong.easeOut, onComplete:pageComplete, onCompleteParams:[_arg1]});
}
public function showPrevious():void{
if (m_ui.currentFrame != 1){
TweenMax.to(m_ui, speed, {x:(xpos + dist), alpha:0, blurFilter:{blurX:10}, ease:Strong.easeOut, onComplete:prevComplete});
};
}
private function prevComplete():void{
m_ui.x = (xpos - dist);
m_ui.prevFrame();
TweenMax.to(m_ui, speed, {x:xpos, alpha:1, blurFilter:{blurX:0}, ease:Strong.easeOut});
}
}
}//package pages.components
Section 361
//FormEvent (pages.form.FormEvent)
package pages.form {
import flash.events.*;
public class FormEvent extends Event {
public var data;
public static var FORM_SUBMITTED:String = "FormSubmitted";
public static var SHOW_SUBMIT_SCREEN:String = "ShowSubmitScreen";
public static var SHOW_GAMEOVER_SCREEN:String = "ShowGameOverScreen";
public function FormEvent(_arg1:String, _arg2=null){
super(_arg1, true, true);
data = _arg2;
}
}
}//package pages.form
Section 362
//FormInputField (pages.form.FormInputField)
package pages.form {
import flash.events.*;
import org.casalib.display.*;
import flash.text.*;
public class FormInputField extends CasaSprite {
private var m_txtfld:TextField;
private var m_initText:String;
private var m_defaultText:String;
public function FormInputField(_arg1:TextField, _arg2:String, _arg3:String){
m_txtfld = _arg1;
m_initText = _arg3;
if (_arg2 == null){
_arg2 = _arg3;
};
m_txtfld.text = (m_defaultText = _arg2);
enable();
}
public function enable():void{
m_txtfld.addEventListener(FocusEvent.FOCUS_IN, focusHandler);
m_txtfld.addEventListener(FocusEvent.FOCUS_OUT, focusHandler);
m_txtfld.selectable = true;
m_txtfld.tabEnabled = true;
m_txtfld.mouseEnabled = true;
m_txtfld.alpha = 1;
}
public function checkForMatch(_arg1:Array):Boolean{
var _local2:int;
while (_local2 < _arg1.length) {
if (String(m_txtfld.text).indexOf(_arg1[_local2]) == -1){
return (false);
};
_local2++;
};
if (m_txtfld.text == ""){
return (false);
};
if (m_txtfld.text == null){
return (false);
};
if (m_txtfld.text == m_initText){
return (false);
};
return (true);
}
public function disable():void{
m_txtfld.removeEventListener(FocusEvent.FOCUS_IN, focusHandler);
m_txtfld.removeEventListener(FocusEvent.FOCUS_OUT, focusHandler);
m_txtfld.selectable = false;
m_txtfld.tabEnabled = false;
m_txtfld.mouseEnabled = false;
m_txtfld.alpha = 0.2;
}
public function check():Boolean{
if (m_txtfld.text == ""){
return (false);
};
if (m_txtfld.text == null){
return (false);
};
if (m_txtfld.text == m_initText){
return (false);
};
return (true);
}
private function focusHandler(_arg1:FocusEvent):void{
if (_arg1.type == FocusEvent.FOCUS_IN){
if (m_txtfld.text == m_defaultText){
m_txtfld.text = "";
} else {
trace(((("looks like its not equal to default. \ndefault: \t" + m_defaultText) + " \nthis: \t\t") + m_txtfld.text));
};
} else {
if (m_txtfld.text == ""){
m_txtfld.text = m_defaultText;
};
};
}
public function getValue():String{
return (m_txtfld.text);
}
}
}//package pages.form
Section 363
//FormQuizScreen (pages.form.FormQuizScreen)
package pages.form {
import flash.events.*;
import flash.display.*;
import pages.ui.*;
import org.casalib.display.*;
import org.casalib.util.*;
import form.screen.*;
public class FormQuizScreen extends CasaMovieClip {
private var m_ui:MovieClip;
private var m_quiz:MovieClip;
private var m_name:FormInputField;
public function FormQuizScreen(){
m_ui = new QuizScreen();
addChild(m_ui);
m_ui.submitScore.buttonMode = true;
m_ui.playAgain.buttonMode = true;
var _local1:NavButton = new NavButton(m_ui.submitScore);
var _local2:NavButton = new NavButton(m_ui.playAgain);
_local1.addEventListener(UIEvent.CLICKED, submitScoreHandler);
_local2.addEventListener(UIEvent.CLICKED, playAgainHandler);
if (UserData.instance.username != null){
m_ui.t_name.text = UserData.instance.username;
};
if (UserData.instance.recentScore != 0){
m_ui.t_score.text = NumberUtil.format(UserData.instance.recentScore, 1, ",", "");
};
m_quiz = new Quiz(m_ui.quizMain);
var _local3 = "ENTER YOUR NAME";
m_name = new FormInputField(m_ui.t_name, UserData.instance.username, _local3);
m_ui.error1.visible = false;
}
private function submitScoreHandler(_arg1:UIEvent):void{
if (m_name.check()){
m_ui.error1.visible = false;
UserData.instance.username = m_ui.t_name.text;
dispatchEvent(new FormEvent(FormEvent.SHOW_SUBMIT_SCREEN));
} else {
m_ui.error1.visible = true;
};
}
override public function destroy():void{
removeChild(m_ui);
m_ui.submitScore.removeEventListener(MouseEvent.CLICK, submitScoreHandler);
m_ui.playAgain.removeEventListener(MouseEvent.CLICK, playAgainHandler);
super.destroy();
}
private function playAgainHandler(_arg1:UIEvent):void{
dispatchEvent(new UIEvent(UIEvent.NAVIGATE_TO_MAIN));
}
}
}//package pages.form
Section 364
//FormSubmitScreen (pages.form.FormSubmitScreen)
package pages.form {
import flash.events.*;
import flash.display.*;
import console.*;
import pages.ui.*;
import org.casalib.display.*;
import flash.net.*;
import gs.easing.*;
import form.screen.*;
import com.meychi.ascrypt3.*;
import gs.*;
public class FormSubmitScreen extends CasaMovieClip {
private var m_email:FormInputField;
private var m_tickTerms:ToggleUI;
private var m_selectYesNo:ToggleUI;
private var m_tickPromo:ToggleUI;
private var m_firstname:FormInputField;
private var m_essay:FormInputField;
private var m_ui:MovieClip;
private var m_lastname:FormInputField;
private var m_mobile:FormInputField;
public function FormSubmitScreen(){
m_ui = new SubmitScreen();
addChild(m_ui);
var _local1:NavButton = new NavButton(m_ui.submitDetails);
_local1.addEventListener(UIEvent.CLICKED, clickHandler);
m_ui.optionalUI.termsButton.addEventListener(MouseEvent.CLICK, openExternalLinkTerms);
m_firstname = new FormInputField(m_ui.t_firstname, UserData.instance.firstName, "");
m_lastname = new FormInputField(m_ui.t_lastname, UserData.instance.lastName, "");
m_email = new FormInputField(m_ui.t_email, UserData.instance.email, "");
m_mobile = new FormInputField(m_ui.t_mobile, UserData.instance.mobile, "");
m_essay = new FormInputField(m_ui.t_essay, UserData.instance.lgEssay, "In 25 words or less, tell us which LCD TV features are the most important to you and why?");
tabEnabled = true;
m_ui.t_firstname.tabIndex = 1;
m_ui.t_lastname.tabIndex = 2;
m_ui.t_email.tabIndex = 3;
m_ui.t_mobile.tabIndex = 4;
m_ui.t_essay.tabIndex = 5;
m_selectYesNo = new ToggleUI(m_ui.selectYesNo, 0);
m_tickPromo = new ToggleUI(m_ui.tickPromo, 1);
m_tickTerms = new ToggleUI(m_ui.tickTerms, 0);
UserData.instance.participateInCompetition = true;
m_selectYesNo.addEventListener(UIEvent.TOGGLE_BUTTON, toggleOptionalUI);
clearError();
}
override public function destroy():void{
removeChild(m_ui);
m_ui.submitDetails.removeEventListener(MouseEvent.CLICK, clickHandler);
}
private function clearError():void{
m_ui.error1.visible = false;
m_ui.error2.visible = false;
m_ui.error3.visible = false;
m_ui.error4.visible = false;
m_ui.error5.visible = false;
m_ui.error6.visible = false;
}
private function sendData():void{
var _local5:Date;
var _local1:URLVariables = new URLVariables();
var _local2:URLRequest = new URLRequest("http://boxofsoap.com/work/LG/submit.php");
var _local3:URLLoader = new URLLoader();
_local3.addEventListener(Event.COMPLETE, postURLCompleteHandler, false, 0, true);
if (UserData.instance.attainedQuizBonus){
UserData.instance.recentScore = (UserData.instance.recentScore + 10000);
UserData.instance.md3 = (UserData.instance.md3 + 10000);
};
if (UserData.instance.recentScore > UserData.instance.bestScore){
UserData.instance.bestScore = UserData.instance.recentScore;
};
clearError();
_local1.intGameId = "37";
_local1.intOptIn = (UserData.instance.contactOptIn = m_tickPromo.getValue());
UserData.instance.firstName = m_firstname.getValue();
UserData.instance.lastName = m_lastname.getValue();
_local1.strName = UserData.instance.username;
if (m_email.getValue()){
UserData.instance.email = (_local1.strEmail = m_email.getValue());
} else {
_local5 = new Date();
UserData.instance.email = (_local1.strEmail = (("optOut_" + _local5.getTime()) + "@mail.com"));
};
UserData.instance.mobile = (_local1.strMisc1 = m_mobile.getValue());
UserData.instance.lgEssay = (_local1.strMisc2 = m_essay.getValue());
_local1.strMisc3 = ((UserData.instance.firstName + " ") + UserData.instance.lastName);
_local1.strMisc4 = UserData.instance.tock;
var _local4:MD5 = new MD5();
if (((!((UserData.instance.md3 == UserData.instance.recentScore))) || ((UserData.instance.md6 == 1)))){
_local1.intScore = UserData.instance.recentScore;
_local1.strMisc5 = _local4.calculate((UserData.instance.quizResponses + UserData.instance.email));
} else {
_local1.intScore = UserData.instance.md3;
_local1.strMisc5 = _local4.calculate(((UserData.instance.quizResponses + UserData.instance.email) + UserData.instance.md3));
};
_local1.strMisc6 = UserData.instance.recentLevel;
_local2.data = _local1;
_local2.method = URLRequestMethod.POST;
_local3.load(_local2);
trace("SENDING VARS...");
TweenMax.to(m_ui, 0.3, {alpha:0.15, colorMatrixFilter:{saturation:0}, ease:Strong.easeInOut});
m_ui.mouseChildren = false;
}
private function postURLCompleteHandler(_arg1:Event):void{
var urlLoaderData:URLLoader;
var urlVarData:URLVariables;
var evt = _arg1;
urlLoaderData = URLLoader(evt.target);
try {
urlVarData = new URLVariables(urlLoaderData.data);
trace((">>>>>>>> " + urlVarData));
trace((">>>>>>>> " + urlVarData.result));
trace((">>>>>>>> " + urlVarData.rank));
trace((">>>>>>>> " + urlVarData.scoreID));
UserData.instance.recentRank = urlVarData.rank;
} catch(e) {
trace(("ERROR: " + e));
trace(("and the data was... " + urlLoaderData.data));
};
dispatchEvent(new FormEvent(FormEvent.FORM_SUBMITTED));
}
private function toggleOptionalUI(_arg1:UIEvent):void{
if (_arg1.target.getValue() == 0){
UserData.instance.participateInCompetition = false;
m_ui.optionalUI.alpha = 0.2;
m_tickPromo.disable();
m_tickTerms.disable();
m_firstname.disable();
m_lastname.disable();
m_email.disable();
m_mobile.disable();
m_essay.disable();
} else {
UserData.instance.participateInCompetition = true;
m_ui.optionalUI.alpha = 1;
m_tickPromo.enable();
m_tickTerms.enable();
m_firstname.enable();
m_lastname.enable();
m_email.enable();
m_mobile.enable();
m_essay.enable();
};
}
private function clickHandler(_arg1:UIEvent):void{
var _local2:int;
clearError();
if (UserData.instance.participateInCompetition){
_local2 = 1;
if (!m_firstname.check()){
_local2 = (_local2 * 0);
m_ui.error1.visible = true;
};
if (!m_lastname.check()){
_local2 = (_local2 * 0);
m_ui.error2.visible = true;
};
if (!m_email.checkForMatch(["@", "."])){
_local2 = (_local2 * 0);
m_ui.error3.visible = true;
};
if (!m_mobile.check()){
_local2 = (_local2 * 0);
m_ui.error4.visible = true;
};
if (!m_essay.check()){
_local2 = (_local2 * 0);
m_ui.error5.visible = true;
};
if (m_tickTerms.getValue() != 1){
_local2 = (_local2 * 0);
m_ui.error6.visible = true;
};
if (_local2 == 1){
sendData();
};
} else {
sendData();
};
}
private function openExternalLinkTerms(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.lge.com.au/transformers/autobot_promotion_TnC.html"), "_blank");
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "linkOut", "TnC");
}
}
}//package pages.form
Section 365
//Quiz (pages.form.Quiz)
package pages.form {
import flash.display.*;
import pages.ui.*;
import org.casalib.display.*;
import gs.*;
public class Quiz extends CasaMovieClip {
private var m_quiz:MovieClip;
private var color2:Number;// = 3898399
private var m_opt1:QuizButton;
private var m_opt2:QuizButton;
private var m_opt3:QuizButton;
private var m_opt4:QuizButton;
private var color1:Number;// = 11082780
private var optList:Array;
public function Quiz(_arg1:MovieClip){
m_quiz = _arg1;
m_quiz.quizText.mouseChildren = false;
m_quiz.quizText.mouseEnabled = false;
m_opt1 = new QuizButton(_arg1.opt1, false, 0);
m_opt2 = new QuizButton(_arg1.opt2, false, 1);
m_opt3 = new QuizButton(_arg1.opt3, true, 2);
m_opt4 = new QuizButton(_arg1.opt4, false, 3);
optList = [m_opt1, m_opt2, m_opt3, m_opt4];
m_opt1.addEventListener(UIEvent.CLICKED, selectAnswer);
m_opt2.addEventListener(UIEvent.CLICKED, selectAnswer);
m_opt3.addEventListener(UIEvent.CLICKED, selectAnswer);
m_opt4.addEventListener(UIEvent.CLICKED, selectAnswer);
UserData.instance.attainedQuizBonus = false;
}
private function selectAnswer(_arg1:UIEvent):void{
m_quiz.mouseChildren = false;
m_quiz.mouseEnabled = false;
if (_arg1.data){
UserData.instance.quizAnswer = _arg1.target.getID();
UserData.instance.attainedQuizBonus = true;
TweenMax.to(_arg1._target, 0.5, {tint:color2, glowFilter:{blurX:13, blurY:13, alpha:0.7}});
} else {
UserData.instance.attainedQuizBonus = false;
TweenMax.to(_arg1._target, 0.5, {tint:color1, glowFilter:{blurX:13, blurY:13, alpha:0.7}});
};
}
override public function destroy():void{
m_opt1.removeEventListener(UIEvent.CLICKED, selectAnswer);
m_opt2.removeEventListener(UIEvent.CLICKED, selectAnswer);
m_opt3.removeEventListener(UIEvent.CLICKED, selectAnswer);
m_opt4.removeEventListener(UIEvent.CLICKED, selectAnswer);
super.destroy();
}
}
}//package pages.form
Section 366
//QuizButton (pages.form.QuizButton)
package pages.form {
import flash.events.*;
import flash.display.*;
import pages.ui.*;
import org.casalib.display.*;
import gs.*;
public class QuizButton extends CasaSprite {
private var m_btn:Sprite;
private var index:int;
private var m_isCorrect:Boolean;// = true
public function QuizButton(_arg1:Sprite, _arg2:Boolean, _arg3:int){
m_btn = _arg1;
index = _arg3;
m_isCorrect = _arg2;
m_btn.buttonMode = true;
m_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
m_btn.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
m_btn.addEventListener(MouseEvent.CLICK, selectHandler);
}
private function mouseOutHandler(_arg1:MouseEvent):void{
TweenMax.to(_arg1.target, 0.5, {removeTint:true, glowFilter:{blurX:0, blurY:0, alpha:0, remove:true}});
}
public function selectHandler(_arg1:MouseEvent=null):void{
m_btn.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
m_btn.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
dispatchEvent(new UIEvent(UIEvent.CLICKED, m_btn, m_isCorrect));
}
public function getID():int{
return (index);
}
private function mouseOverHandler(_arg1:MouseEvent):void{
TweenMax.to(_arg1.target, 0.5, {tint:1734014, glowFilter:{blurX:13, blurY:13, alpha:0.7}});
}
override public function destroy():void{
m_btn.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
m_btn.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
m_btn.removeEventListener(MouseEvent.CLICK, selectHandler);
super.destroy();
}
public function preSelect():void{
trace("preselect this ");
selectHandler();
}
}
}//package pages.form
Section 367
//ToggleUI (pages.form.ToggleUI)
package pages.form {
import flash.events.*;
import flash.display.*;
import pages.ui.*;
import org.casalib.display.*;
public class ToggleUI extends CasaMovieClip {
private var i_initValue:int;
private var i_value:int;
private var m_ui:MovieClip;
public function ToggleUI(_arg1:MovieClip, _arg2:int){
m_ui = _arg1;
i_initValue = (i_value = _arg2);
m_ui.gotoAndStop((i_initValue + 1));
m_ui.buttonMode = true;
m_ui.mouseChildren = false;
m_ui.addEventListener(MouseEvent.CLICK, clickHandler);
}
public function enable():void{
m_ui.buttonMode = true;
m_ui.mouseChildren = false;
m_ui.mouseEnabled = true;
m_ui.addEventListener(MouseEvent.CLICK, clickHandler);
m_ui.alpha = 1;
}
public function disable():void{
m_ui.buttonMode = false;
m_ui.mouseEnabled = false;
m_ui.removeEventListener(MouseEvent.CLICK, clickHandler);
m_ui.alpha = 0.2;
}
private function clickHandler(_arg1:MouseEvent):void{
dispatchEvent(new UIEvent(UIEvent.TOGGLE_BUTTON));
if (i_value == 0){
i_value = 1;
m_ui.gotoAndStop(2);
} else {
i_value = 0;
m_ui.gotoAndStop(1);
};
}
public function getValue():int{
return (i_value);
}
}
}//package pages.form
Section 368
//BasicButton (pages.ui.BasicButton)
package pages.ui {
import flash.events.*;
import flash.display.*;
import org.casalib.display.*;
import gs.easing.*;
import gs.*;
public class BasicButton extends CasaMovieClip {
private var m_ui:MovieClip;
public var data;
public function BasicButton(_arg1:MovieClip, _arg2=null){
m_ui = _arg1;
data = _arg2;
_arg1.buttonMode = true;
_arg1.addEventListener(MouseEvent.CLICK, dispatchClick);
_arg1.addEventListener(MouseEvent.MOUSE_OVER, mouseRollHandler);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, mouseRollHandler);
if (_arg1.nav_glow){
_arg1.nav_glow.alpha = 0;
};
}
public function hide():void{
TweenMax.to(m_ui, 0.5, {autoAlpha:0, ease:Strong.easeOut});
}
private function mouseRollHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_OVER){
TweenMax.to(m_ui, 0.4, {colorMatrixFilter:{contrast:1.2, brightness:1.2}, glowFilter:{alpha:0.2, blurX:10, blurY:10, color:0xFFFFFF}, easing:Strong.easeOut});
if (m_ui.nav_glow){
TweenMax.to(m_ui.nav_glow, 0.4, {alpha:1, easing:Strong.easeOut});
};
} else {
TweenMax.to(m_ui, 0.4, {colorMatrixFilter:{contrast:1, brightness:1}, glowFilter:{alpha:0, remove:true}, easing:Strong.easeOut});
if (m_ui.nav_glow){
TweenMax.to(m_ui.nav_glow, 0.4, {alpha:0, easing:Strong.easeOut});
};
};
}
public function show():void{
TweenMax.to(m_ui, 0.5, {autoAlpha:1, ease:Strong.easeOut});
}
private function dispatchClick(_arg1:MouseEvent):void{
dispatchEvent(new UIEvent(UIEvent.CLICKED));
}
}
}//package pages.ui
Section 369
//ContentPanel (pages.ui.ContentPanel)
package pages.ui {
import flash.events.*;
import flash.display.*;
import com.markfennell.sound.*;
import org.casalib.display.*;
public class ContentPanel extends CasaMovieClip {
private var m_panel:MovieClip;
public function ContentPanel(_arg1:MovieClip){
m_panel = _arg1;
var _local2:NavButton = new NavButton(m_panel.btn_main);
_local2.addEventListener(UIEvent.CLICKED, clickHandler);
m_panel.btn_next.buttonMode = true;
m_panel.btn_prev.buttonMode = true;
m_panel.btn_next.addEventListener(MouseEvent.CLICK, nextNavHandler);
m_panel.btn_prev.addEventListener(MouseEvent.CLICK, prevNavHandler);
addEventListener(UIEvent.DISABLE_SIDE_BUTTONS, hideSideButtons);
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "common.sound.PanelSound2", 1, 1, false, 0.7));
}
private function nextNavHandler(_arg1:MouseEvent):void{
dispatchEvent(new UIEvent(UIEvent.NAVIGATE_RIGHT));
}
private function hideSideButtons(_arg1:UIEvent):void{
m_panel.btn_prev.visible = false;
m_panel.btn_next.visible = false;
}
private function clickHandler(_arg1:UIEvent):void{
dispatchEvent(new UIEvent(UIEvent.CLICKED, this));
}
private function prevNavHandler(_arg1:MouseEvent):void{
dispatchEvent(new UIEvent(UIEvent.NAVIGATE_LEFT));
}
}
}//package pages.ui
Section 370
//FooterUI (pages.ui.FooterUI)
package pages.ui {
import flash.display.*;
import console.*;
import org.casalib.display.*;
import flash.net.*;
import pages.components.*;
public class FooterUI extends CasaMovieClip {
private var m_trailer:InteractiveAnimationClip;
private var m_ui:MovieClip;
public function FooterUI(_arg1:MovieClip){
m_ui = _arg1;
var _local2:NavButton = new NavButton(m_ui.viewTrailer);
var _local3:NavButton = new NavButton(m_ui.findOutMore);
m_trailer = new InteractiveAnimationClip(m_ui.miniTrailer, false);
_local2.addEventListener(UIEvent.CLICKED, viewTrailerHandler);
_local2.addEventListener(UIEvent.ROLL_OVER, viewTrailerAnimationHandler);
_local2.addEventListener(UIEvent.ROLL_OUT, viewTrailerAnimationHandler);
_local3.addEventListener(UIEvent.CLICKED, findOutMoreHandler);
}
private function findOutMoreHandler(_arg1:UIEvent):void{
navigateToURL(new URLRequest("http://www.lge.com.au/transformers/#/home-entertainment-products"), "_blank");
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "linkOut", "findOutMore");
}
private function viewTrailerAnimationHandler(_arg1:UIEvent):void{
trace(_arg1.type);
if (_arg1.type == UIEvent.ROLL_OVER){
m_trailer.animate();
};
if (_arg1.type == UIEvent.ROLL_OUT){
m_trailer.freezeFrame();
};
}
private function viewTrailerHandler(_arg1:UIEvent):void{
navigateToURL(new URLRequest("http://www.lge.com.au/transformers/#/movie-trailer"), "_blank");
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "linkOut", "viewTrailer");
}
}
}//package pages.ui
Section 371
//NavButton (pages.ui.NavButton)
package pages.ui {
import flash.events.*;
import flash.display.*;
import com.markfennell.sound.*;
import gs.easing.*;
import gs.*;
public class NavButton extends MovieClip {
private var m_movieClip:MovieClip;
public function NavButton(_arg1:MovieClip){
m_movieClip = _arg1;
if (m_movieClip.nav_glow){
m_movieClip.nav_glow.alpha = 0;
};
m_movieClip.buttonMode = true;
m_movieClip.mouseChildren = false;
m_movieClip.addEventListener(MouseEvent.MOUSE_OVER, mouseRollHandler);
m_movieClip.addEventListener(MouseEvent.MOUSE_OUT, mouseRollHandler);
m_movieClip.addEventListener(MouseEvent.CLICK, mouseClickHandler);
}
public function mouseRollHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_OVER){
TweenMax.to(m_movieClip, 0.4, {colorMatrixFilter:{contrast:1.2, brightness:1.2}, glowFilter:{alpha:0.3, blurX:10, blurY:10, color:0xFFFFFF}, easing:Strong.easeOut});
if (m_movieClip.nav_glow){
TweenMax.to(m_movieClip.nav_glow, 0.4, {alpha:1, easing:Strong.easeOut});
};
dispatchEvent(new UIEvent(UIEvent.ROLL_OVER));
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "common.sound.NavButtonSound", 1, 1, false));
} else {
TweenMax.to(m_movieClip, 0.4, {colorMatrixFilter:{contrast:1, brightness:1}, glowFilter:{alpha:0, remove:true}, easing:Strong.easeOut});
if (m_movieClip.nav_glow){
TweenMax.to(m_movieClip.nav_glow, 0.4, {alpha:0, easing:Strong.easeOut});
};
dispatchEvent(new UIEvent(UIEvent.ROLL_OUT));
};
}
private function mouseClickHandler(_arg1:MouseEvent):void{
dispatchEvent(new UIEvent(UIEvent.CLICKED, m_movieClip));
}
}
}//package pages.ui
Section 372
//SoundControlButton (pages.ui.SoundControlButton)
package pages.ui {
import flash.events.*;
import flash.display.*;
import org.casalib.display.*;
public class SoundControlButton extends CasaMovieClip {
private var m_ui:MovieClip;
public var soundOn:Boolean;// = true
public function SoundControlButton(_arg1:MovieClip){
trace((">>>>> " + SoundController.getInstance().soundsEnabled));
soundOn = SoundController.getInstance().soundsEnabled;
m_ui = _arg1;
_arg1.buttonMode = true;
_arg1.addEventListener(MouseEvent.CLICK, toggleHandler);
if (!soundOn){
m_ui.gotoAndStop(2);
};
}
private function toggleHandler(_arg1:MouseEvent=null):void{
if (soundOn){
m_ui.gotoAndStop(2);
SoundController.getInstance().soundsEnabled = false;
} else {
m_ui.gotoAndStop(1);
SoundController.getInstance().soundsEnabled = true;
};
soundOn = SoundController.getInstance().soundsEnabled;
}
}
}//package pages.ui
Section 373
//UIEvent (pages.ui.UIEvent)
package pages.ui {
import flash.events.*;
import flash.display.*;
public class UIEvent extends Event {
public var _target:MovieClip;
public var data;
public static var TOGGLE_BUTTON:String = "ToggleButton";
public static var CLICKED:String = "NavButtonClicked";
public static var NAVIGATE_RIGHT:String = "NavigateRight";
public static var NAVIGATE_TO_MAIN:String = "NavigateToMain";
public static var DISABLE_SIDE_BUTTONS:String = "DisableSideButtons";
public static var FRAME_CLOSE_COMPLETE:String = "frameCloseComplete";
public static var ROLL_OUT:String = "NavButtonRollOut";
public static var NAVIGATE_LEFT:String = "NavigateLeft";
public static var ROLL_OVER:String = "NavButtonRollOver";
public function UIEvent(_arg1:String, _arg2=null, _arg3=null){
super(_arg1, true, false);
_target = _arg2;
data = _arg3;
}
}
}//package pages.ui
Section 374
//UIMetalFrame (pages.ui.UIMetalFrame)
package pages.ui {
import flash.events.*;
import flash.display.*;
import console.*;
import com.markfennell.sound.*;
import pages.*;
import org.casalib.display.*;
import flash.net.*;
import org.casalib.util.*;
import gs.easing.*;
import gs.*;
public class UIMetalFrame extends CasaMovieClip {
private var m_callbackPage:BasePage;
private var m_ui:MovieClip;
public function UIMetalFrame(_arg1:MovieClip){
m_ui = _arg1;
m_ui.mouseEnabled = false;
m_ui.ui_bottom_frame.mouseEnabled = false;
m_ui.ui_top_half.mouseEnabled = false;
m_ui.ui_mid.mouseEnabled = false;
var _local2:NavButton = new NavButton(m_ui.ui_bottom_hud.moreGamesBtn);
_local2.addEventListener(UIEvent.CLICKED, openExternalLink);
m_ui.footer.termsButton.addEventListener(MouseEvent.CLICK, openExternalLinkTerms);
m_ui.ui_top.bestScore.bestScoreText.text = NumberUtil.format(UserData.instance.bestScore, 1, ",", "");
var _local3:MovieClip = new SoundControlButton(m_ui.ui_top.soundControl);
}
public function closePanel(_arg1:BasePage):void{
m_callbackPage = _arg1;
TweenMax.to(m_ui.panel.slider1, 0.2, {blurFilter:{remove:true, blurX:0}, x:0, easing:Strong.easeOut});
TweenMax.to(m_ui.panel.slider2, 0.2, {blurFilter:{remove:true, blurX:0}, x:0, easing:Strong.easeOut});
TweenMax.to(m_ui.ui_hor_bar1, 0.1, {y:55, easing:Elastic.easeOut});
TweenMax.to(m_ui.ui_hor_bar2, 0.1, {y:55, easing:Elastic.easeOut});
TweenMax.to(m_ui.ui_side_right_1, 0.1, {x:712, easing:Strong.easeInOut});
TweenMax.to(m_ui.ui_side_left_1, 0.1, {x:14, easing:Strong.easeInOut});
TweenMax.to(m_ui.ui_bottom_hud, 0.1, {y:580, easing:Strong.easeInOut});
TweenMax.to(m_ui.ui_hor_bar3, 0.1, {y:567, easing:Strong.easeInOut});
TweenMax.to(m_ui.ui_hor_bar4, 0.1, {y:567, easing:Strong.easeInOut});
TweenMax.to(m_ui.ui_top_half, 0.1, {y:76, easing:Strong.easeInOut});
TweenMax.to(m_ui.ui_bottom_frame, 0.1, {y:585, easing:Strong.easeInOut});
TweenMax.to(this, 0.3, {onComplete:closePanel_COMPLETE});
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "common.sound.PanelSound", 1, 1, false));
}
private function openExternalLinkTerms(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.lge.com.au/transformers/autobot_promotion_TnC.html"), "_blank");
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "linkOut", "TnC");
}
public function openPanel():void{
}
private function closePanel_COMPLETE():void{
m_callbackPage.dispatchEvent(new UIEvent(UIEvent.FRAME_CLOSE_COMPLETE));
}
private function openExternalLink(_arg1:UIEvent):void{
navigateToURL(new URLRequest("http://www.lge.com.au/games"), "_blank");
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "linkOut", "moreGames");
}
}
}//package pages.ui
Section 375
//BasePage (pages.BasePage)
package pages {
import flash.display.*;
import console.*;
import com.markfennell.sound.*;
import interfaces.*;
import org.casalib.display.*;
import org.casalib.util.*;
import gs.easing.*;
import gs.*;
public class BasePage extends CasaSprite implements IConsoleSection {
protected var m_ui:MovieClip;
public function BasePage(){
StageReference.getStage().quality = "BEST";
}
public function hide():void{
}
public function transitionIn_COMPLETE():void{
}
public function doPause():void{
}
public function doResume():void{
}
public function transitionOut():void{
}
public function transitionIn():void{
dispatchEvent(new ConsoleEvent(ConsoleEvent.TRANSITION_COMPLETE));
TweenMax.to(m_ui.uiframe.panel.slider1, 0.3, {delay:0.3, blurFilter:{blurX:20}, x:-390, easing:Strong.easeOut});
TweenMax.to(m_ui.uiframe.panel.slider2, 0.3, {delay:0.3, blurFilter:{blurX:20}, x:390, easing:Strong.easeOut});
TweenMax.to(m_ui.uiframe.ui_hor_bar1, 0.1, {delay:0.6, y:65, easing:Strong.easeOut});
TweenMax.to(m_ui.uiframe.ui_hor_bar2, 0.1, {delay:0.6, y:65, easing:Strong.easeOut});
TweenMax.to(m_ui.uiframe.ui_side_right_1, 0.1, {delay:0.5, x:702, easing:Strong.easeInOut});
TweenMax.to(m_ui.uiframe.ui_side_left_1, 0.1, {delay:0.5, x:24, easing:Strong.easeInOut});
TweenMax.to(m_ui.uiframe.ui_bottom_hud, 0.1, {delay:0.7, y:570, easing:Bounce.easeOut});
TweenMax.to(m_ui.uiframe.ui_hor_bar3, 0.1, {delay:0.7, y:577, easing:Bounce.easeOut});
TweenMax.to(m_ui.uiframe.ui_hor_bar4, 0.1, {delay:0.7, y:577, easing:Bounce.easeOut});
TweenMax.to(m_ui.uiframe.ui_top_half, 0.1, {delay:0.6, y:66, easing:Strong.easeInOut});
TweenMax.to(m_ui.uiframe.ui_bottom_frame, 0.1, {delay:0.6, y:590, easing:Strong.easeInOut});
GameBroadcaster.dispatchEvent(new SoundEvent(SoundEvent.EFFECT, "common.sound.PanelSound", 1, 1, false, 0.4));
}
override public function destroy():void{
if (m_ui){
TweenMax.killTweensOf(m_ui);
removeChild(m_ui);
m_ui = null;
};
super.destroy();
}
}
}//package pages
Section 376
//Credits (pages.Credits)
package pages {
import flash.events.*;
import flash.display.*;
import console.*;
import pages.ui.*;
import org.casalib.display.*;
import assets.*;
public class Credits extends BasePage {
private var mainFrame:MovieClip;
private var contentPanel:CasaMovieClip;
public function Credits(){
m_ui = new CreditsUI();
addChild(m_ui);
m_ui.content_panel.addEventListener(UIEvent.CLICKED, handleBackClick);
m_ui.header.headertxt.masker.txt.text = "CREDITS";
contentPanel = new ContentPanel(m_ui.content_panel);
contentPanel.addEventListener(UIEvent.CLICKED, handleBackClick);
mainFrame = new UIMetalFrame(m_ui.uiframe);
var _local1:FooterUI = new FooterUI(m_ui.footerUI);
}
private function handleBackClick(_arg1:UIEvent):void{
addEventListener(UIEvent.FRAME_CLOSE_COMPLETE, closePanel_COMPLETE, false, 0, true);
mainFrame.closePanel(this);
}
override public function destroy():void{
m_ui.content_panel.removeEventListener(UIEvent.CLICKED, handleBackClick);
removeChild(m_ui);
m_ui = null;
super.destroy();
}
public function closePanel_COMPLETE(_arg1:UIEvent):void{
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_INTRO));
}
}
}//package pages
Section 377
//GameOver (pages.GameOver)
package pages {
import flash.events.*;
import flash.display.*;
import console.*;
import pages.ui.*;
import pages.form.*;
import org.casalib.display.*;
import gs.easing.*;
import assets.*;
import gs.*;
public class GameOver extends BasePage {
private var contentPanel:CasaMovieClip;
private var m_currentScreen:CasaMovieClip;
private var mainFrame:MovieClip;
public function GameOver(){
m_ui = new GameOverUI();
addChild(m_ui);
m_ui.header.headertxt.masker.txt.text = "GAME OVER";
contentPanel = new ContentPanel(m_ui.content_panel);
contentPanel.addEventListener(UIEvent.CLICKED, handleBackClick);
contentPanel.dispatchEvent(new UIEvent(UIEvent.DISABLE_SIDE_BUTTONS));
addEventListener(FormEvent.SHOW_GAMEOVER_SCREEN, showScreen);
addEventListener(FormEvent.SHOW_SUBMIT_SCREEN, showScreen);
addEventListener(FormEvent.FORM_SUBMITTED, formSubmitedHandler);
dispatchEvent(new FormEvent(FormEvent.SHOW_GAMEOVER_SCREEN));
mainFrame = new UIMetalFrame(m_ui.uiframe);
var _local1:FooterUI = new FooterUI(m_ui.footerUI);
}
private function showScoreBoardHandler():void{
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_SCORES));
}
override public function destroy():void{
m_ui.content_panel.removeEventListener(UIEvent.CLICKED, handleBackClick);
removeChild(m_ui);
m_ui = null;
super.destroy();
}
private function showScreen(_arg1:FormEvent):void{
if (m_currentScreen){
m_currentScreen.destroy();
};
switch (_arg1.type){
case FormEvent.SHOW_GAMEOVER_SCREEN:
trace("> GAEMOVER SCREEN");
m_currentScreen = new FormQuizScreen();
break;
case FormEvent.SHOW_SUBMIT_SCREEN:
trace("> SUBMIT SCREEN");
m_currentScreen = new FormSubmitScreen();
break;
};
m_ui.form.addChild(m_currentScreen);
m_currentScreen.addEventListener(UIEvent.NAVIGATE_TO_MAIN, handleBackClick);
TweenMax.from(m_currentScreen, 0.5, {delay:0.7, alpha:0, ease:Strong.easeOut});
}
private function closePanel_COMPLETE(_arg1:UIEvent):void{
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_INTRO));
}
private function formSubmitedHandler(_arg1:FormEvent):void{
TweenMax.to(m_ui.uiframe.panel.slider1, 0.2, {blurFilter:{remove:true, blurX:0}, x:0, easing:Strong.easeOut});
TweenMax.to(m_ui.uiframe.panel.slider2, 0.2, {blurFilter:{remove:true, blurX:0}, x:0, easing:Strong.easeOut, onComplete:showScoreBoardHandler});
}
private function handleBackClick(_arg1:UIEvent):void{
addEventListener(UIEvent.FRAME_CLOSE_COMPLETE, closePanel_COMPLETE, false, 0, true);
mainFrame.closePanel(this);
}
}
}//package pages
Section 378
//Help (pages.Help)
package pages {
import flash.events.*;
import flash.display.*;
import console.*;
import pages.ui.*;
import org.casalib.display.*;
import pages.components.*;
import assets.*;
public class Help extends BasePage {
private var m_viewer:MovieClip;
private var contentPanel:CasaMovieClip;
private var mainFrame:MovieClip;
public function Help(){
m_ui = new HelpUI();
addChild(m_ui);
m_ui.content_panel.addEventListener(UIEvent.CLICKED, handleBackClick);
m_ui.header.headertxt.masker.txt.text = "HOW TO PLAY";
contentPanel = new ContentPanel(m_ui.content_panel);
contentPanel.addEventListener(UIEvent.CLICKED, handleBackClick);
contentPanel.addEventListener(UIEvent.NAVIGATE_RIGHT, contentNavigationHandler);
contentPanel.addEventListener(UIEvent.NAVIGATE_LEFT, contentNavigationHandler);
m_viewer = new Viewer(m_ui.viewerClip);
mainFrame = new UIMetalFrame(m_ui.uiframe);
var _local1:FooterUI = new FooterUI(m_ui.footerUI);
}
private function closePanel_COMPLETE(_arg1:UIEvent):void{
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_INTRO));
}
private function handleBackClick(_arg1:UIEvent):void{
addEventListener(UIEvent.FRAME_CLOSE_COMPLETE, closePanel_COMPLETE, false, 0, true);
mainFrame.closePanel(this);
}
override public function destroy():void{
m_ui.content_panel.removeEventListener(UIEvent.CLICKED, handleBackClick);
removeChild(m_ui);
m_ui = null;
super.destroy();
}
private function contentNavigationHandler(_arg1:UIEvent):void{
if (_arg1.type == UIEvent.NAVIGATE_RIGHT){
m_viewer.showNext();
};
if (_arg1.type == UIEvent.NAVIGATE_LEFT){
m_viewer.showPrevious();
};
}
}
}//package pages
Section 379
//Intro (pages.Intro)
package pages {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import console.*;
import pages.ui.*;
import org.casalib.display.*;
import assets.*;
public class Intro extends BasePage {
private var contentPanel:CasaMovieClip;
private var startTime:int;
private var mainFrame:MovieClip;
public function Intro(){
m_ui = new IntroUI();
addChild(m_ui);
startTime = getTimer();
m_ui.vidClip.addEventListener("VIDEO_FINISHED", videoFinishHandler);
m_ui.skipButton.buttonMode = true;
m_ui.skipButton.addEventListener(MouseEvent.CLICK, videoSkipHandler);
var _local1:FooterUI = new FooterUI(m_ui.footerUI);
mainFrame = new UIMetalFrame(m_ui.uiframe);
}
public function closePanel_COMPLETE(_arg1:UIEvent):void{
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_PLAYGAME));
}
private function videoSkipHandler(_arg1:MouseEvent):void{
var _local2:int = ((getTimer() - startTime) / 1000);
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "video", "trailer01", _local2);
resumeGame();
}
override public function destroy():void{
m_ui.vidClip.removeEventListener("VIDEO_FINISHED", resumeGame);
removeChild(m_ui);
m_ui = null;
super.destroy();
}
private function videoFinishHandler(_arg1:Event):void{
var _local2:int = ((getTimer() - startTime) / 1000);
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "video", "trailer01", _local2);
resumeGame();
}
private function resumeGame():void{
m_ui.vidClip.stop();
addEventListener(UIEvent.FRAME_CLOSE_COMPLETE, closePanel_COMPLETE, false, 0, true);
mainFrame.closePanel(this);
}
}
}//package pages
Section 380
//Prizes (pages.Prizes)
package pages {
import flash.events.*;
import flash.display.*;
import console.*;
import pages.ui.*;
import org.casalib.display.*;
import flash.net.*;
import pages.components.*;
import assets.*;
public class Prizes extends BasePage {
private var m_backBtn:MovieClip;
private var m_viewer:MovieClip;
private var m_termsBtn:MovieClip;
private var m_page3Btn:MovieClip;
private var m_page2Btn:MovieClip;
private var m_page1Btn:MovieClip;
private var contentPanel:CasaMovieClip;
private var mainFrame:MovieClip;
public function Prizes(){
m_ui = new PrizesUI();
addChild(m_ui);
m_ui.content_panel.addEventListener(UIEvent.CLICKED, handleBackClick);
m_ui.header.headertxt.masker.txt.text = "PRIZES";
contentPanel = new ContentPanel(m_ui.content_panel);
contentPanel.addEventListener(UIEvent.CLICKED, handleBackClick);
contentPanel.dispatchEvent(new UIEvent(UIEvent.DISABLE_SIDE_BUTTONS));
m_viewer = new Viewer(m_ui.viewerClip);
m_page1Btn = new BasicButton(m_ui.viewerClip.firstPage, "page1");
m_page2Btn = new BasicButton(m_ui.viewerClip.secondPage, "page2");
m_page3Btn = new BasicButton(m_ui.viewerClip.thirdPage, "page3");
m_backBtn = new BasicButton(m_ui.viewerClip.backBtn, "back");
m_termsBtn = new BasicButton(m_ui.viewerClip.termsBtn, "terms");
m_page1Btn.addEventListener(UIEvent.CLICKED, contentNavigationHandler);
m_page2Btn.addEventListener(UIEvent.CLICKED, contentNavigationHandler);
m_page3Btn.addEventListener(UIEvent.CLICKED, contentNavigationHandler);
m_backBtn.addEventListener(UIEvent.CLICKED, contentNavigationHandler);
m_termsBtn.addEventListener(UIEvent.CLICKED, contentNavigationHandler);
showMainButtons();
mainFrame = new UIMetalFrame(m_ui.uiframe);
var _local1:FooterUI = new FooterUI(m_ui.footerUI);
}
override public function destroy():void{
m_ui.content_panel.removeEventListener(UIEvent.CLICKED, handleBackClick);
removeChild(m_ui);
m_ui = null;
super.destroy();
}
public function closePanel_COMPLETE(_arg1:UIEvent):void{
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_INTRO));
}
private function hideMainButtons():void{
m_page1Btn.hide();
m_page2Btn.hide();
m_page3Btn.hide();
m_backBtn.show();
m_termsBtn.hide();
}
private function contentNavigationHandler(_arg1:UIEvent):void{
switch (_arg1.currentTarget.data){
case "page1":
hideMainButtons();
m_viewer.showPage(2);
break;
case "page2":
hideMainButtons();
m_viewer.showPage(3);
break;
case "page3":
hideMainButtons();
m_viewer.showPage(4);
break;
case "back":
showMainButtons();
m_viewer.showPage(1);
break;
case "terms":
navigateToURL(new URLRequest("http://www.lge.com.au/transformers/autobot_promotion_TnC.html"), "_blank");
break;
};
}
private function handleBackClick(_arg1:UIEvent):void{
addEventListener(UIEvent.FRAME_CLOSE_COMPLETE, closePanel_COMPLETE, false, 0, true);
mainFrame.closePanel(this);
}
private function showMainButtons():void{
m_page1Btn.show();
m_page2Btn.show();
m_page3Btn.show();
m_backBtn.hide();
m_termsBtn.show();
}
}
}//package pages
Section 381
//Scores (pages.Scores)
package pages {
import flash.events.*;
import flash.display.*;
import console.*;
import pages.ui.*;
import org.casalib.display.*;
import pages.components.*;
import assets.*;
public class Scores extends BasePage {
private var m_highScorePanel:HighScorePanel;
private var contentPanel:CasaMovieClip;
private var mainFrame:UIMetalFrame;
public function Scores(){
m_ui = new ScoresUI();
addChild(m_ui);
m_ui.content_panel.addEventListener(UIEvent.CLICKED, handleBackClick);
m_ui.header.headertxt.masker.txt.text = "HIGH SCORES";
contentPanel = new ContentPanel(m_ui.content_panel);
contentPanel.addEventListener(UIEvent.CLICKED, handleBackClick);
contentPanel.addEventListener(UIEvent.NAVIGATE_RIGHT, contentNavigationHandler);
contentPanel.addEventListener(UIEvent.NAVIGATE_LEFT, contentNavigationHandler);
m_highScorePanel = new HighScorePanel(m_ui.highScore);
mainFrame = new UIMetalFrame(m_ui.uiframe);
var _local1:FooterUI = new FooterUI(m_ui.footerUI);
}
override public function destroy():void{
m_highScorePanel.destroy();
m_ui.content_panel.removeEventListener(UIEvent.CLICKED, handleBackClick);
removeChild(m_ui);
m_ui = null;
super.destroy();
}
private function handleBackClick(_arg1:UIEvent):void{
addEventListener(UIEvent.FRAME_CLOSE_COMPLETE, closePanel_COMPLETE, false, 0, true);
mainFrame.closePanel(this);
}
private function closePanel_COMPLETE(_arg1:UIEvent):void{
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_INTRO));
}
private function contentNavigationHandler(_arg1:UIEvent):void{
if (_arg1.type == UIEvent.NAVIGATE_RIGHT){
m_highScorePanel.showNext();
};
if (_arg1.type == UIEvent.NAVIGATE_LEFT){
m_highScorePanel.showPrevious();
};
}
}
}//package pages
Section 382
//Title (pages.Title)
package pages {
import flash.events.*;
import console.*;
import pages.ui.*;
import org.casalib.util.*;
import flash.ui.*;
import assets.*;
public class Title extends BasePage {
private var btnSend:NavButton;
private var curr_btn;
private var btnPlay:NavButton;
private var mainFrame:UIMetalFrame;
private var btnHelp:NavButton;
private var btnScore:NavButton;
private var btnPrizes:NavButton;
private var btnEmbed:NavButton;
public function Title(){
m_ui = new TitleUI();
addChild(m_ui);
btnPlay = new NavButton(m_ui.nav.btn_play);
btnScore = new NavButton(m_ui.nav.btn_score);
btnPrizes = new NavButton(m_ui.nav.btn_prizes);
btnHelp = new NavButton(m_ui.nav.btn_howto);
btnSend = new NavButton(m_ui.nav.btn_send);
btnEmbed = new NavButton(m_ui.nav.btn_embed);
btnPlay.addEventListener(UIEvent.CLICKED, clickHandler);
btnScore.addEventListener(UIEvent.CLICKED, clickHandler);
btnPrizes.addEventListener(UIEvent.CLICKED, clickHandler);
btnHelp.addEventListener(UIEvent.CLICKED, clickHandler);
btnEmbed.addEventListener(UIEvent.CLICKED, clickHandler);
btnSend.addEventListener(UIEvent.CLICKED, clickHandler);
mainFrame = new UIMetalFrame(m_ui.uiframe);
var _local1:FooterUI = new FooterUI(m_ui.footerUI);
}
private function clickHandler(_arg1:UIEvent):void{
curr_btn = _arg1._target;
if (curr_btn == m_ui.nav.btn_embed){
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_EMBED));
} else {
if (curr_btn == m_ui.nav.btn_send){
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_SHARE));
} else {
addEventListener(UIEvent.FRAME_CLOSE_COMPLETE, onFrameCloseComplete, false, 0, true);
mainFrame.closePanel(this);
};
};
}
private function onFrameCloseComplete(_arg1:UIEvent):void{
switch (curr_btn){
case m_ui.nav.btn_howto:
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_HELP));
break;
case m_ui.nav.btn_score:
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_SCORES));
break;
case m_ui.nav.btn_play:
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_VIDEO));
break;
case m_ui.nav.btn_prizes:
GameBroadcaster.dispatchEvent(new ConsoleEvent(ConsoleEvent.DISPLAY_PRIZES));
break;
case m_ui.nav.btn_embed:
break;
};
}
private function handleTitleKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
};
}
override public function destroy():void{
StageReference.getStage().removeEventListener(KeyboardEvent.KEY_DOWN, handleTitleKeyDown);
btnPlay.removeEventListener(UIEvent.CLICKED, clickHandler);
btnScore.removeEventListener(UIEvent.CLICKED, clickHandler);
btnPrizes.removeEventListener(UIEvent.CLICKED, clickHandler);
btnHelp.removeEventListener(UIEvent.CLICKED, clickHandler);
btnEmbed.removeEventListener(UIEvent.CLICKED, clickHandler);
removeChild(m_ui);
m_ui = null;
super.destroy();
}
}
}//package pages
Section 383
//AbstractPreloader (preloader.AbstractPreloader)
package preloader {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class AbstractPreloader extends MovieClip {
private var USE_EXTERNAL:Boolean;// = true
private var m_loadTime:int;
protected var VALID_URL:Array;
private var m_firstEnterFrame:Boolean;
public function AbstractPreloader(){
addEventListener(Event.ADDED_TO_STAGE, handleOnAddedToStage);
stop();
}
protected function endLoading():void{
}
public function start():void{
trace("start");
m_firstEnterFrame = true;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
protected function updateLoading(_arg1:Number):void{
}
private function handleOnAddedToStage(_arg1:Event):void{
stage.scaleMode = StageScaleMode.EXACT_FIT;
stage.align = StageAlign.TOP_LEFT;
m_loadTime = getTimer();
}
protected function run():void{
var _local1:Class = (getDefinitionByName(mainClassName) as Class);
if (_local1 == null){
throw (new Error("AbstractPreloader:initialize. There was no class matching that name. Did you remember to override mainClassName?"));
};
var _local2:DisplayObject = (new (_local1) as DisplayObject);
if (_local2 == null){
throw (new Error("AbstractPreloader:initialize. Main class needs to inherit from Sprite or MovieClip."));
};
_local1.loadTime = int(((getTimer() - m_loadTime) / 1000));
addChildAt(_local2, 0);
}
private function onEnterFrame(_arg1:Event):void{
var _local2:Number;
if (m_firstEnterFrame){
m_firstEnterFrame = false;
if (root.loaderInfo.bytesLoaded >= root.loaderInfo.bytesTotal){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
nextFrame();
run();
} else {
beginLoading();
};
return;
};
if (root.loaderInfo.bytesLoaded >= root.loaderInfo.bytesTotal){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
nextFrame();
run();
endLoading();
} else {
_local2 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
updateLoading(_local2);
};
}
protected function beginLoading():void{
}
protected function get mainClassName():String{
return ("LGAutobotStronghold");
}
}
}//package preloader
Section 384
//AbstractPreloaderView (preloader.AbstractPreloaderView)
package preloader {
import flash.events.*;
import com.malee.events.*;
import gs.*;
import assets.*;
public class AbstractPreloaderView extends AbstractPreloader {
private var m_ui:PreloaderUI;
private var m_embedded:Boolean;// = true
public function AbstractPreloaderView(){
stop();
m_ui = new PreloaderUI();
m_ui.alpha = 0;
TweenMax.to(m_ui, 0.75, {alpha:1});
addChild(m_ui);
var _local1:HexAnimation = new HexAnimation(m_ui.hexAnimation);
super.start();
}
override protected function endLoading():void{
}
private function onLevelLoaded(_arg1:LoaderEvent):void{
}
override protected function updateLoading(_arg1:Number):void{
m_ui.label.text = String(int((_arg1 * 100)));
}
override protected function run():void{
removeChild(m_ui);
m_ui = null;
super.run();
}
private function onDataComplete(_arg1:Event=null):void{
super.start();
}
override protected function beginLoading():void{
trace("begin Loading");
}
private function onAllLevelsLoaded(_arg1:Event):void{
onDataComplete();
}
}
}//package preloader
Section 385
//HexAnimation (preloader.HexAnimation)
package preloader {
import flash.events.*;
import gs.*;
import flash.display.*;
import org.casalib.display.*;
import flash.utils.*;
import gs.easing.*;
public class HexAnimation extends CasaMovieClip {
private var index:Number;// = 0
private var hex:Array;
private var speedTimer:Timer;
public function HexAnimation(_arg1:MovieClip){
hex = new Array(_arg1.hex0, _arg1.hex1, _arg1.hex2, _arg1.hex3, _arg1.hex4, _arg1.hex5, _arg1.hex6, _arg1.hex7, _arg1.hex8, _arg1.hex9, _arg1.hex10, _arg1.hex11, _arg1.hex12, _arg1.hex13, _arg1.hex14, _arg1.hex15, _arg1.hex16, _arg1.hex17, _arg1.hex18, _arg1.hex19, _arg1.hex20, _arg1.hex21, _arg1.hex22, _arg1.hex23);
speedTimer = new Timer(20);
speedTimer.addEventListener(TimerEvent.TIMER, animateNext);
speedTimer.start();
}
private function animateNext(_arg1:TimerEvent):void{
hex[index].alpha = 1;
TweenMax.to(hex[index], 0.7, {alpha:0, ease:Strong.easeOut});
index++;
if (index >= hex.length){
index = 0;
};
}
override public function destroy():void{
speedTimer.stop();
}
}
}//package preloader
Section 386
//BlueGlowButton (ui.BlueGlowButton)
package ui {
import flash.events.*;
import flash.display.*;
import gs.*;
public class BlueGlowButton extends EventDispatcher {
private var m_button:MovieClip;
public static var CLICKED:String = "GlowClicked";
public function BlueGlowButton(_arg1:MovieClip){
m_button = _arg1;
m_button.buttonMode = true;
m_button.addEventListener(MouseEvent.ROLL_OUT, handleRollOut, false, 0, true);
m_button.addEventListener(MouseEvent.ROLL_OVER, handleRollOver, false, 0, true);
m_button.addEventListener(MouseEvent.CLICK, handleClick, false, 0, true);
}
private function handleRollOver(_arg1:MouseEvent=null):void{
TweenMax.to(m_button, 0.25, {glowFilter:{color:0xFF, alpha:1, blurX:5, blurY:5, strength:1}});
}
public function destroy():void{
TweenMax.killTweensOf(m_button);
m_button.removeEventListener(MouseEvent.ROLL_OUT, handleRollOut);
m_button.removeEventListener(MouseEvent.ROLL_OVER, handleRollOver);
m_button.removeEventListener(MouseEvent.CLICK, handleClick);
}
public function enableButton():void{
m_button.mouseEnabled = true;
TweenMax.to(m_button, 0.25, {alpha:1});
}
private function handleClick(_arg1:MouseEvent=null):void{
dispatchEvent(new Event(CLICKED));
}
private function handleRollOut(_arg1:MouseEvent=null):void{
TweenMax.to(m_button, 0.25, {glowFilter:{color:0xFF, alpha:0, blurX:5, blurY:5, strength:1}});
}
public function disableButton():void{
m_button.mouseEnabled = false;
TweenMax.to(m_button, 0.25, {alpha:0});
}
}
}//package ui
Section 387
//DoubleGraphicButton (ui.DoubleGraphicButton)
package ui {
import flash.events.*;
import flash.display.*;
import gs.*;
public class DoubleGraphicButton extends EventDispatcher {
private var m_over:MovieClip;
private var m_off:MovieClip;
public static var CLICKED:String = "clicked";
public function DoubleGraphicButton(_arg1:MovieClip, _arg2:MovieClip){
m_off = _arg1;
m_over = _arg2;
m_over.buttonMode = true;
m_off.buttonMode = true;
m_over.alpha = 0;
m_over.addEventListener(MouseEvent.ROLL_OUT, handleRollOut, false, 0, true);
m_over.addEventListener(MouseEvent.ROLL_OVER, handleRollOver, false, 0, true);
m_over.addEventListener(MouseEvent.CLICK, handleClick, false, 0, true);
}
private function handleRollOver(_arg1:MouseEvent=null):void{
TweenMax.to(m_over, 0.25, {alpha:1});
}
public function destroy():void{
m_over.removeEventListener(MouseEvent.ROLL_OUT, handleRollOut);
m_over.removeEventListener(MouseEvent.ROLL_OVER, handleRollOver);
m_over.removeEventListener(MouseEvent.CLICK, handleClick);
}
public function enableButton():void{
m_over.mouseEnabled = true;
TweenMax.to(m_off, 0.25, {alpha:1});
}
private function handleClick(_arg1:MouseEvent=null):void{
dispatchEvent(new Event(CLICKED));
}
private function handleRollOut(_arg1:MouseEvent=null):void{
TweenMax.to(m_over, 0.25, {alpha:0});
}
public function disableButton():void{
m_over.mouseEnabled = false;
TweenMax.to(m_off, 0.25, {alpha:0});
TweenMax.to(m_over, 0.25, {alpha:0});
}
}
}//package ui
Section 388
//SingleGraphicGlowButton (ui.SingleGraphicGlowButton)
package ui {
import flash.events.*;
import flash.display.*;
import gs.easing.*;
import gs.*;
public class SingleGraphicGlowButton extends EventDispatcher {
private var m_button:MovieClip;
private var m_glow:MovieClip;
public static var CLICKED:String = "clicked";
public function SingleGraphicGlowButton(_arg1:MovieClip, _arg2:MovieClip){
m_button = _arg1;
m_glow = _arg2;
m_button.buttonMode = true;
m_glow.buttonMode = false;
m_glow.mouseEnabled = false;
m_glow.mouseChildren = false;
m_glow.alpha = 0;
m_button.addEventListener(MouseEvent.ROLL_OUT, handleRollOut, false, 0, true);
m_button.addEventListener(MouseEvent.ROLL_OVER, handleRollOver, false, 0, true);
m_button.addEventListener(MouseEvent.CLICK, handleClick, false, 0, true);
}
private function handleRollOver(_arg1:MouseEvent=null):void{
TweenMax.to(m_button, 0.4, {colorMatrixFilter:{contrast:1.2, brightness:1.2}, glowFilter:{alpha:0.3, blurX:10, blurY:10, color:0xFFFFFF}, easing:Strong.easeOut});
TweenMax.to(m_glow, 0.4, {alpha:1, easing:Strong.easeOut});
}
public function destroy():void{
TweenMax.killTweensOf(m_button);
TweenMax.killTweensOf(m_glow);
m_button.removeEventListener(MouseEvent.ROLL_OUT, handleRollOut);
m_button.removeEventListener(MouseEvent.ROLL_OVER, handleRollOver);
m_button.removeEventListener(MouseEvent.CLICK, handleClick);
}
public function enableButton():void{
m_button.mouseEnabled = true;
TweenMax.to(m_button, 0.25, {alpha:1});
}
private function handleClick(_arg1:MouseEvent=null):void{
dispatchEvent(new Event(CLICKED));
}
private function handleRollOut(_arg1:MouseEvent=null):void{
TweenMax.to(m_button, 0.4, {colorMatrixFilter:{contrast:1, brightness:1}, glowFilter:{alpha:0, remove:true}, easing:Strong.easeOut});
TweenMax.to(m_glow, 0.4, {alpha:0, easing:Strong.easeOut});
}
public function disableButton():void{
m_button.mouseEnabled = false;
TweenMax.to(m_button, 0.25, {alpha:0});
TweenMax.to(m_glow, 0.25, {alpha:0});
}
}
}//package ui
Section 389
//Constants (Constants)
package {
public class Constants {
public static var VOLUME_MUSIC:Number = 0.5;
public static var GOOGLE:String = "UA-6368558-13";
public static var URL_MOREGAMES:String = "http://www.lge.com.au/games";
public static var ANIMATION_FINISHED:String = "AnimationFinished";
public static var TRACKING_TITLE:String = "AutobotStronghold";
}
}//package
Section 390
//EmbeddedData (EmbeddedData)
package {
public class EmbeddedData {
private static const m_data:XML = <data>
<levels>
<level>
<title>Level 01.. testing</title>
<cell width="28" height="28"></cell>
<background asset="assets.level01" width="756" height="476" offsetCellX="-1" offsetCellY="-1"></background>
<map>
<!-- 0 is bg, non buildable, 1 is goal, 2 is path, 3 is spawn, 4 is buildable !-->
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>0</x><x>0</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>2</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>4</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>4</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>4</x><x>4</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>4</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>2</x><x>0</x><x>0</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>1</x><x>2</x><x>2</x><x>2</x><x>2</x><x>4</x><x>0</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>0</x><x>4</x><x>0</x><x>0</x><x>4</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>2</x><x>2</x><x>2</x><x>3</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>0</x><x>0</x><x>2</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>2</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>2</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>0</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>2</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>2</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>4</x><x>0</x><x>4</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>4</x><x>2</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>2</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x>
</y>
<y>
<x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>3</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x><x>0</x>
</y>
</map>
<routes>
<route>
<cell><x>26</x><y>9</y></cell>
<cell><x>25</x><y>9</y></cell>
<cell><x>24</x><y>9</y></cell>
<cell><x>23</x><y>9</y></cell>
<cell><x>23</x><y>10</y></cell>
<cell><x>23</x><y>11</y></cell>
<cell><x>23</x><y>12</y></cell>
<cell><x>22</x><y>12</y></cell>
<cell><x>21</x><y>12</y></cell>
<cell><x>20</x><y>12</y></cell>
<cell><x>19</x><y>12</y></cell>
<cell><x>18</x><y>12</y></cell>
<cell><x>17</x><y>12</y></cell>
<cell><x>16</x><y>12</y></cell>
<cell><x>15</x><y>12</y></cell>
<cell><x>14</x><y>12</y></cell>
<cell><x>13</x><y>12</y></cell>
<cell><x>12</x><y>12</y></cell>
<cell><x>12</x><y>11</y></cell>
<cell><x>12</x><y>10</y></cell>
<cell><x>12</x><y>9</y></cell>
<cell><x>12</x><y>8</y></cell>
<cell><x>12</x><y>7</y></cell>
<cell><x>12</x><y>6</y></cell>
<cell><x>13</x><y>6</y></cell>
<cell><x>14</x><y>6</y></cell>
<cell><x>15</x><y>6</y></cell>
<cell><x>16</x><y>6</y></cell>
<cell><x>17</x><y>6</y></cell>
<cell><x>18</x><y>6</y></cell>
<cell><x>19</x><y>6</y></cell>
<cell><x>20</x><y>6</y></cell>
<cell><x>21</x><y>6</y></cell>
<cell><x>22</x><y>6</y></cell>
<cell><x>22</x><y>5</y></cell>
<cell><x>22</x><y>4</y></cell>
<cell><x>22</x><y>3</y></cell>
<cell><x>21</x><y>3</y></cell>
<cell><x>20</x><y>3</y></cell>
<cell><x>19</x><y>3</y></cell>
<cell><x>18</x><y>3</y></cell>
<cell><x>17</x><y>3</y></cell>
<cell><x>16</x><y>3</y></cell>
<cell><x>15</x><y>3</y></cell>
<cell><x>14</x><y>3</y></cell>
<cell><x>13</x><y>3</y></cell>
<cell><x>12</x><y>3</y></cell>
<cell><x>11</x><y>3</y></cell>
<cell><x>10</x><y>3</y></cell>
<cell><x>9</x><y>3</y></cell>
<cell><x>8</x><y>3</y></cell>
<cell><x>7</x><y>3</y></cell>
<cell><x>7</x><y>4</y></cell>
<cell><x>7</x><y>5</y></cell>
<cell><x>7</x><y>6</y></cell>
<cell><x>7</x><y>7</y></cell>
<cell><x>7</x><y>8</y></cell>
<cell><x>6</x><y>8</y></cell>
<cell><x>5</x><y>8</y></cell>
<cell><x>4</x><y>8</y></cell>
<cell><x>3</x><y>8</y></cell>
</route>
<route>
<cell><x>20</x><y>16</y></cell>
<cell><x>20</x><y>15</y></cell>
<cell><x>20</x><y>14</y></cell>
<cell><x>20</x><y>13</y></cell>
<cell><x>20</x><y>12</y></cell>
<cell><x>19</x><y>12</y></cell>
<cell><x>18</x><y>12</y></cell>
<cell><x>17</x><y>12</y></cell>
<cell><x>16</x><y>12</y></cell>
<cell><x>15</x><y>12</y></cell>
<cell><x>14</x><y>12</y></cell>
<cell><x>13</x><y>12</y></cell>
<cell><x>12</x><y>12</y></cell>
<cell><x>12</x><y>11</y></cell>
<cell><x>12</x><y>10</y></cell>
<cell><x>12</x><y>9</y></cell>
<cell><x>12</x><y>8</y></cell>
<cell><x>12</x><y>7</y></cell>
<cell><x>12</x><y>6</y></cell>
<cell><x>13</x><y>6</y></cell>
<cell><x>14</x><y>6</y></cell>
<cell><x>15</x><y>6</y></cell>
<cell><x>16</x><y>6</y></cell>
<cell><x>17</x><y>6</y></cell>
<cell><x>18</x><y>6</y></cell>
<cell><x>19</x><y>6</y></cell>
<cell><x>20</x><y>6</y></cell>
<cell><x>21</x><y>6</y></cell>
<cell><x>22</x><y>6</y></cell>
<cell><x>22</x><y>5</y></cell>
<cell><x>22</x><y>4</y></cell>
<cell><x>22</x><y>3</y></cell>
<cell><x>21</x><y>3</y></cell>
<cell><x>20</x><y>3</y></cell>
<cell><x>19</x><y>3</y></cell>
<cell><x>18</x><y>3</y></cell>
<cell><x>17</x><y>3</y></cell>
<cell><x>16</x><y>3</y></cell>
<cell><x>15</x><y>3</y></cell>
<cell><x>14</x><y>3</y></cell>
<cell><x>13</x><y>3</y></cell>
<cell><x>12</x><y>3</y></cell>
<cell><x>11</x><y>3</y></cell>
<cell><x>10</x><y>3</y></cell>
<cell><x>9</x><y>3</y></cell>
<cell><x>8</x><y>3</y></cell>
<cell><x>7</x><y>3</y></cell>
<cell><x>7</x><y>4</y></cell>
<cell><x>7</x><y>5</y></cell>
<cell><x>7</x><y>6</y></cell>
<cell><x>7</x><y>7</y></cell>
<cell><x>7</x><y>8</y></cell>
<cell><x>6</x><y>8</y></cell>
<cell><x>5</x><y>8</y></cell>
<cell><x>4</x><y>8</y></cell>
<cell><x>3</x><y>8</y></cell>
</route>
<route>
<cell><x>26</x><y>3</y></cell>
<cell><x>25</x><y>3</y></cell>
<cell><x>24</x><y>3</y></cell>
<cell><x>23</x><y>3</y></cell>
<cell><x>22</x><y>3</y></cell>
<cell><x>21</x><y>3</y></cell>
<cell><x>20</x><y>3</y></cell>
<cell><x>19</x><y>3</y></cell>
<cell><x>18</x><y>3</y></cell>
<cell><x>17</x><y>3</y></cell>
<cell><x>16</x><y>3</y></cell>
<cell><x>15</x><y>3</y></cell>
<cell><x>14</x><y>3</y></cell>
<cell><x>13</x><y>3</y></cell>
<cell><x>12</x><y>3</y></cell>
<cell><x>11</x><y>3</y></cell>
<cell><x>10</x><y>3</y></cell>
<cell><x>9</x><y>3</y></cell>
<cell><x>8</x><y>3</y></cell>
<cell><x>7</x><y>3</y></cell>
<cell><x>7</x><y>4</y></cell>
<cell><x>7</x><y>5</y></cell>
<cell><x>7</x><y>6</y></cell>
<cell><x>7</x><y>7</y></cell>
<cell><x>7</x><y>8</y></cell>
<cell><x>6</x><y>8</y></cell>
<cell><x>5</x><y>8</y></cell>
<cell><x>4</x><y>8</y></cell>
<cell><x>3</x><y>8</y></cell>
</route>
<route>
<cell><x>27</x><y>7</y></cell>
<cell><x>26</x><y>7</y></cell>
<cell><x>25</x><y>7</y></cell>
<cell><x>24</x><y>7</y></cell>
<cell><x>23</x><y>7</y></cell>
<cell><x>22</x><y>7</y></cell>
<cell><x>21</x><y>7</y></cell>
<cell><x>20</x><y>7</y></cell>
<cell><x>19</x><y>7</y></cell>
<cell><x>18</x><y>7</y></cell>
<cell><x>17</x><y>7</y></cell>
<cell><x>16</x><y>7</y></cell>
<cell><x>15</x><y>7</y></cell>
<cell><x>14</x><y>7</y></cell>
<cell><x>13</x><y>7</y></cell>
<cell><x>12</x><y>7</y></cell>
<cell><x>11</x><y>7</y></cell>
<cell><x>10</x><y>7</y></cell>
<cell><x>9</x><y>7</y></cell>
<cell><x>8</x><y>7</y></cell>
<cell><x>7</x><y>7</y></cell>
<cell><x>6</x><y>7</y></cell>
<cell><x>5</x><y>7</y></cell>
<cell><x>4</x><y>7</y></cell>
<cell><x>3</x><y>7</y></cell>
</route>
<route>
<cell><x>27</x><y>9</y></cell>
<cell><x>26</x><y>9</y></cell>
<cell><x>25</x><y>9</y></cell>
<cell><x>24</x><y>9</y></cell>
<cell><x>23</x><y>9</y></cell>
<cell><x>22</x><y>9</y></cell>
<cell><x>21</x><y>9</y></cell>
<cell><x>20</x><y>9</y></cell>
<cell><x>19</x><y>9</y></cell>
<cell><x>18</x><y>9</y></cell>
<cell><x>17</x><y>9</y></cell>
<cell><x>16</x><y>9</y></cell>
<cell><x>15</x><y>9</y></cell>
<cell><x>14</x><y>9</y></cell>
<cell><x>13</x><y>9</y></cell>
<cell><x>12</x><y>9</y></cell>
<cell><x>11</x><y>9</y></cell>
<cell><x>10</x><y>9</y></cell>
<cell><x>9</x><y>9</y></cell>
<cell><x>8</x><y>9</y></cell>
<cell><x>7</x><y>9</y></cell>
<cell><x>6</x><y>9</y></cell>
<cell><x>5</x><y>9</y></cell>
<cell><x>4</x><y>9</y></cell>
<cell><x>3</x><y>9</y></cell>
</route>
</routes>
<waves>
<!--
<wave id = "1" minTime = "60">
<cluster type = "insecticon" health = "30" routeid = "2" units = "8" timeoffset = "150" timegap = "45" />
</wave>
<wave id = "2" minTime = "60">
<cluster type = "starscream" health = "30" routeid = "3" units = "2" timeoffset = "20" timegap = "120" />
<cluster type = "shockwave" health = "30" routeid = "0" units = "8" timeoffset = "200" timegap = "60" />
</wave>
<wave id = "3" minTime = "60">
<cluster type = "brunt" health = "50" routeid = "1" units = "4" timeoffset = "0" timegap = "240" />
<cluster type = "starscream" health = "30" routeid = "3" units = "5" timeoffset = "20" timegap = "120" />
<cluster type = "starscream" health = "30" routeid = "4" units = "4" timeoffset = "60" timegap = "120" />
</wave>
<wave id = "4" minTime = "60">
<cluster type = "ravage" health = "30" routeid = "1" units = "8" timeoffset = "20" timegap = "30" />
</wave>
<wave id = "4" minTime = "60">
<cluster type = "galvatron" health = "50" routeid = "1" units = "8" timeoffset = "20" timegap = "60" />
</wave>
<wave id = "5" minTime = "60">
<cluster type = "ravage" health = "50" routeid = "1" units = "20" timeoffset = "20" timegap = "10" />
</wave>
!-->
<wave id="1" minTime="150">
<cluster type="insecticon" health="10" routeid="0" units="2" timeoffset="150" timegap="60"/>
</wave>
<wave id="2" minTime="150">
<cluster type="insecticon" health="15" routeid="1" units="4" timeoffset="20" timegap="60"/>
</wave>
<wave id="3" minTime="150">
<cluster type="shockwave" health="20" routeid="0" units="4" timeoffset="20" timegap="60"/>
</wave>
<wave id="4" minTime="150">
<cluster type="insecticon" health="20" routeid="1" units="6" timeoffset="20" timegap="60"/>
</wave>
<wave id="5" minTime="150">
<cluster type="shockwave" health="35" routeid="0" units="6" timeoffset="60" timegap="60"/>
<cluster type="insecticon" health="35" routeid="1" units="4" timeoffset="20" timegap="60"/>
</wave>
<wave id="6" minTime="150">
<cluster type="insecticon" health="25" routeid="1" units="8" timeoffset="20" timegap="45"/>
</wave>
<wave id="7" minTime="150">
<cluster type="insecticon" health="30" routeid="1" units="12" timeoffset="20" timegap="45"/>
</wave>
<wave id="8" minTime="150">
<cluster type="shockwave" health="50" routeid="0" units="10" timeoffset="20" timegap="60"/>
</wave>
<wave id="9" minTime="150">
<cluster type="insecticon" health="40" routeid="0" units="15" timeoffset="20" timegap="45"/>
<cluster type="shockwave" health="50" routeid="1" units="4" timeoffset="20" timegap="45"/>
</wave>
<wave id="10" minTime="150">
<cluster type="starscream" health="30" routeid="3" units="2" timeoffset="20" timegap="120"/>
<cluster type="starscream" health="30" routeid="4" units="2" timeoffset="60" timegap="120"/>
<cluster type="insecticon" health="30" routeid="1" units="8" timeoffset="20" timegap="45"/>
</wave>
<wave id="11" minTime="150">
<cluster type="ravage" health="30" routeid="0" units="6" timeoffset="20" timegap="30"/>
</wave>
<wave id="12" minTime="150">
<cluster type="shockwave" health="65" routeid="1" units="10" timeoffset="20" timegap="60"/>
</wave>
<wave id="13" minTime="150">
<cluster type="shockwave" health="70" routeid="1" units="15" timeoffset="20" timegap="60"/>
<cluster type="ravage" health="35" routeid="0" units="8" timeoffset="20" timegap="30"/>
</wave>
<wave id="14" minTime="150">
<cluster type="insecticon" health="60" routeid="1" units="10" timeoffset="20" timegap="45"/>
</wave>
<wave id="15" minTime="150">
<cluster type="ravage" health="40" routeid="1" units="10" timeoffset="180" timegap="30"/>
<cluster type="starscream" health="30" routeid="3" units="2" timeoffset="20" timegap="120"/>
<cluster type="starscream" health="30" routeid="4" units="2" timeoffset="60" timegap="120"/>
</wave>
<wave id="16" minTime="150">
<cluster type="shockwave" health="100" routeid="0" units="15" timeoffset="20" timegap="60"/>
<cluster type="insecticon" health="45" routeid="1" units="10" timeoffset="20" timegap="45"/>
</wave>
<wave id="17" minTime="150">
<cluster type="insecticon" health="130" routeid="0" units="20" timeoffset="20" timegap="45"/>
</wave>
<wave id="18" minTime="150">
<cluster type="shockwave" health="120" routeid="0" units="20" timeoffset="20" timegap="60"/>
<cluster type="insecticon" health="100" routeid="1" units="8" timeoffset="20" timegap="45"/>
</wave>
<wave id="19" minTime="150">
<cluster type="ravage" health="70" routeid="0" units="20" timeoffset="20" timegap="30"/>
</wave>
<wave id="20" minTime="150">
<cluster type="starscream" health="160" routeid="3" units="3" timeoffset="20" timegap="120"/>
<cluster type="starscream" health="160" routeid="4" units="3" timeoffset="60" timegap="120"/>
<cluster type="ravage" health="100" routeid="1" units="6" timeoffset="250" timegap="30"/>
</wave>
<wave id="21" minTime="150">
<cluster type="insecticon" health="160" routeid="0" units="20" timeoffset="20" timegap="45"/>
</wave>
<wave id="22" minTime="150">
<cluster type="ravage" health="100" routeid="0" units="15" timeoffset="20" timegap="30"/>
<cluster type="insecticon" health="100" routeid="1" units="10" timeoffset="20" timegap="45"/>
</wave>
<wave id="23" minTime="150">
<cluster type="insecticon" health="180" routeid="1" units="20" timeoffset="20" timegap="45"/>
</wave>
<wave id="24" minTime="150">
<cluster type="shockwave" health="230" routeid="1" units="15" timeoffset="20" timegap="60"/>
</wave>
<wave id="25" minTime="150">
<cluster type="galvatron" health="300" routeid="0" units="20" timeoffset="20" timegap="60"/>
<cluster type="starscream" health="120" routeid="3" units="3" timeoffset="150" timegap="120"/>
<cluster type="starscream" health="120" routeid="4" units="3" timeoffset="190" timegap="120"/>
</wave>
<wave id="26" minTime="150">
<cluster type="ravage" health="150" routeid="1" units="25" timeoffset="20" timegap="30"/>
</wave>
<wave id="27" minTime="150">
<cluster type="starscream" health="180" routeid="3" units="5" timeoffset="20" timegap="120"/>
<cluster type="starscream" health="180" routeid="4" units="5" timeoffset="60" timegap="120"/>
<cluster type="insecticon" health="140" routeid="1" units="8" timeoffset="20" timegap="45"/>
</wave>
<wave id="28" minTime="150">
<cluster type="shockwave" health="260" routeid="0" units="20" timeoffset="20" timegap="60"/>
</wave>
<wave id="29" minTime="150">
<cluster type="galvatron" health="350" routeid="1" units="15" timeoffset="20" timegap="60"/>
<cluster type="ravage" health="140" routeid="0" units="8" timeoffset="250" timegap="120"/>
</wave>
<wave id="30" minTime="150">
<cluster type="brunt" health="4400" routeid="1" units="1" timeoffset="0" timegap="30"/>
</wave>
<wave id="31" minTime="150">
<cluster type="shockwave" health="320" routeid="1" units="15" timeoffset="20" timegap="60"/>
<cluster type="insecticon" health="190" routeid="0" units="10" timeoffset="20" timegap="45"/>
</wave>
<wave id="32" minTime="150">
<cluster type="starscream" health="150" routeid="3" units="4" timeoffset="20" timegap="60"/>
<cluster type="starscream" health="150" routeid="4" units="4" timeoffset="60" timegap="60"/>
<cluster type="ravage" health="125" routeid="1" units="8" timeoffset="60" timegap="90"/>
</wave>
<wave id="33" minTime="150">
<cluster type="galvatron" health="500" routeid="1" units="20" timeoffset="20" timegap="60"/>
</wave>
<wave id="34" minTime="150">
<cluster type="insecticon" health="80" routeid="2" units="2" timeoffset="200" timegap="120"/>
<cluster type="insecticon" health="450" routeid="0" units="30" timeoffset="20" timegap="45"/>
</wave>
<wave id="35" minTime="150">
<cluster type="ravage" health="200" routeid="1" units="30" timeoffset="200" timegap="30"/>
<cluster type="starscream" health="150" routeid="3" units="5" timeoffset="20" timegap="50"/>
<cluster type="starscream" health="150" routeid="4" units="5" timeoffset="60" timegap="50"/>
</wave>
<wave id="36" minTime="150">
<cluster type="starscream" health="260" routeid="3" units="5" timeoffset="20" timegap="50"/>
<cluster type="starscream" health="260" routeid="4" units="5" timeoffset="60" timegap="50"/>
</wave>
<wave id="37" minTime="150">
<cluster type="brunt" health="1800" routeid="1" units="5" timeoffset="0" timegap="300"/>
<cluster type="starscream" health="190" routeid="3" units="4" timeoffset="1600" timegap="50"/>
<cluster type="starscream" health="190" routeid="4" units="4" timeoffset="1600" timegap="50"/>
</wave>
<wave id="38" minTime="150">
<cluster type="galvatron" health="600" routeid="0" units="15" timeoffset="20" timegap="30"/>
</wave>
<wave id="39" minTime="150">
<cluster type="ravage" health="250" routeid="1" units="30" timeoffset="20" timegap="20"/>
</wave>
<wave id="40" minTime="150">
<cluster type="brunt" health="3000" routeid="1" units="5" timeoffset="0" timegap="300"/>
<cluster type="insecticon" health="120" routeid="2" units="10" timeoffset="300" timegap="60"/>
</wave>
<wave id="41" minTime="150">
<cluster type="insecticon" health="460" routeid="0" units="30" timeoffset="20" timegap="45"/>
</wave>
<wave id="42" minTime="150">
<cluster type="shockwave" health="500" routeid="1" units="20" timeoffset="20" timegap="60"/>
</wave>
<wave id="43" minTime="150">
<cluster type="brunt" health="2000" routeid="2" units="3" timeoffset="0" timegap="160"/>
<cluster type="starscream" health="250" routeid="3" units="4" timeoffset="600" timegap="100"/>
<cluster type="starscream" health="250" routeid="4" units="4" timeoffset="600" timegap="100"/>
</wave>
<wave id="44" minTime="150">
<cluster type="starscream" health="400" routeid="3" units="5" timeoffset="20" timegap="120"/>
<cluster type="starscream" health="400" routeid="4" units="5" timeoffset="60" timegap="120"/>
</wave>
<wave id="45" minTime="150">
<cluster type="galvatron" health="700" routeid="1" units="15" timeoffset="20" timegap="60"/>
<cluster type="ravage" health="300" routeid="0" units="10" timeoffset="200" timegap="20"/>
</wave>
<wave id="46" minTime="150">
<cluster type="brunt" health="3000" routeid="1" units="4" timeoffset="0" timegap="200"/>
<cluster type="insecticon" health="450" routeid="2" units="10" timeoffset="600" timegap="45"/>
</wave>
<wave id="47" minTime="150">
<cluster type="ravage" health="500" routeid="0" units="15" timeoffset="20" timegap="45"/>
<cluster type="shockwave" health="500" routeid="1" units="5" timeoffset="20" timegap="60"/>
<cluster type="starscream" health="600" routeid="3" units="4" timeoffset="20" timegap="120"/>
<cluster type="starscream" health="600" routeid="4" units="4" timeoffset="60" timegap="120"/>
</wave>
<wave id="48" minTime="150">
<cluster type="galvatron" health="800" routeid="1" units="13" timeoffset="120" timegap="45"/>
<cluster type="galvatron" health="800" routeid="2" units="13" timeoffset="30" timegap="45"/>
</wave>
<wave id="49" minTime="150">
<cluster type="starscream" health="600" routeid="3" units="10" timeoffset="20" timegap="80"/>
<cluster type="starscream" health="600" routeid="4" units="10" timeoffset="60" timegap="80"/>
<cluster type="ravage" health="500" routeid="0" units="10" timeoffset="210" timegap="45"/>
<cluster type="insecticon" health="450" routeid="1" units="10" timeoffset="170" timegap="45"/>
</wave>
<wave id="50" minTime="150">
<cluster type="ravage" health="450" routeid="0" units="20" timeoffset="120" timegap="30"/>
<cluster type="galvatron" health="650" routeid="2" units="10" timeoffset="120" timegap="60"/>
<cluster type="starscream" health="500" routeid="3" units="5" timeoffset="120" timegap="120"/>
<cluster type="starscream" health="500" routeid="4" units="5" timeoffset="160" timegap="120"/>
<cluster type="brunt" health="2000" routeid="2" units="2" timeoffset="0" timegap="300"/>
</wave>
</waves>
</level>
</levels>
<finance>
<player>
<startingFunds funds="30"/>
</player>
<towers>
<blasterTower level1="10" level2="8" level3="10" frequencyBonus="10" responseBonus="10" rangeBonus="10" resaleFraction="0.6"/>
<slowdownTower level1="15" level2="12" level3="15" frequencyBonus="15" responseBonus="15" rangeBonus="15" resaleFraction="0.6"/>
<rocketTower level1="20" level2="15" level3="20" frequencyBonus="20" responseBonus="20" rangeBonus="20" resaleFraction="0.6"/>
<mortarTower level1="30" level2="24" level3="30" frequencyBonus="30" responseBonus="30" rangeBonus="20" resaleFraction="0.6"/>
<laserTower level1="50" level2="50" level3="50" frequencyBonus="50" responseBonus="50" rangeBonus="50" resaleFraction="0.6"/>
</towers>
</finance>
</data>
;
public static function getMapData():XML{
return (m_data);
}
}
}//package
Section 391
//GameBroadcaster (GameBroadcaster)
package {
import flash.events.*;
public class GameBroadcaster {
private static var eventDispatcher:EventDispatcher;
public static function dispatchEvent(_arg1:Event):void{
if (eventDispatcher){
eventDispatcher.dispatchEvent(_arg1);
};
}
public static function broadcast(_arg1:Event):void{
trace(("Event Broadcast " + _arg1.type));
dispatchEvent(_arg1);
}
public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (eventDispatcher){
eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=true):void{
if (!eventDispatcher){
eventDispatcher = new EventDispatcher();
};
eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
}
}//package
Section 392
//LGAutobotStronghold (LGAutobotStronghold)
package {
import flash.events.*;
import flash.display.*;
import console.*;
import com.malee.soap.*;
import org.casalib.util.*;
import com.malee.net.clearspring.*;
public class LGAutobotStronghold extends Sprite {
private var m_menu:SoapMenu;
private var m_console:Console;
public static var ClearSpring:ClearSpringInterface;
public static var loadTime:int;
public function LGAutobotStronghold(){
addEventListener(Event.ADDED_TO_STAGE, handleOnAddedToStage);
}
public function init():void{
ClearSpring = new ClearSpringInterface(this);
removeEventListener(Event.ADDED_TO_STAGE, handleOnAddedToStage);
StageReference.setStage(stage);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.quality = StageQuality.MEDIUM;
this.x = 10;
stage.stageFocusRect = false;
m_console = new Console();
addChild(m_console);
Console.GoogleAnalytics.trackEvent(Constants.TRACKING_TITLE, "load", "gameIndex", loadTime);
m_menu = new SoapMenu(this);
m_menu.addItem("v1.1");
MochiBot.track(this, "ea177f4b");
}
private function handleOnAddedToStage(_arg1:Event):void{
init();
}
public function destroy():void{
m_console.destroy();
}
}
}//package
Section 393
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 394
//NavGlow (NavGlow)
package {
import flash.display.*;
public dynamic class NavGlow extends MovieClip {
}
}//package
Section 395
//SoundController (SoundController)
package {
import flash.events.*;
import flash.utils.*;
import com.markfennell.sound.*;
import flash.geom.*;
import assets.sfx.weapons.*;
import assets.sfx.towers.*;
import assets.sfx.explosions.*;
import common.sound.*;
import assets.sfx.music.*;
public class SoundController {
private var embed_weapon_slowdown:SlowdownFire;
private var embed_tower_bonus:TowerBonus;
private var embed_explosion_ravage:RavageExplosion;
private var embed_ui_panel_sound2:PanelSound2;
private var m_soundsEnabled:Boolean;// = true
private var embed_weapon_laser:LaserFire;
private var embed_explosion_shockwave:ShockwaveExplosion;
private var m_music_position:Number;// = 0
private var embed_tower_upgrade:TowerUpgrade;
private var embed_explosion_brunt:BruntExplosion;
private var embed_ui_panel_sound:PanelSound;
private var embed_weapon_mortarexplosion:MortarExplosion;
private var embed_weapon_blaster:BlasterFire;
private var m_soundsArray:Array;
private var m_atmosphericWater:SoundPlayer;
private var m_soundDictionary:Dictionary;
private var m_volumeEffects:Number;// = 1
private var embed_ui_nav_button_sound:NavButtonSound;
private var embed_weapon_rocketexplosion:RocketExplosion;
private var m_musicArray:Array;
private var embed_explosion_galvatron:GalvatronExplosion;
private var embed_explosion_starscream:StarscreamExplosion;
private var embed_tower_build:TowerBuild;
private var m_music:SoundPlayer;
private var m_volumeMusic:Number;// = 0.6
public var musicEnabled:Boolean;// = true
private var embed_sfx_game_track:TransformersLoop;
private var m_currentTrack:int;// = -1
private var embed_weapon_mortarlaunch:MortarLaunch;
private var embed_enemy_objective:EnemyObjective;
private var embed_tower_sell:TowerSell;
private var embed_explosion_insecticon:InsecticonExplosion;
private var m_foleyArray:Array;
private static var m_instance:SoundController = null;
public function SoundController(){
m_instance = this;
m_musicArray = ["assets.sfx.music.TransformersLoop"];
m_soundsArray = [];
m_foleyArray = [];
}
public function resume_music():void{
start_music(m_currentTrack, true);
}
public function start_music(_arg1:int=0, _arg2:Boolean=false):void{
var _local3:*;
if ((((m_currentTrack == _arg1)) && (!(_arg2)))){
return;
};
if (m_soundsEnabled){
m_currentTrack = _arg1;
if (m_music){
m_music.destroy();
};
_local3 = getDefinitionByName(m_musicArray[m_currentTrack]);
m_music = new SoundPlayer(new (_local3));
m_music.stoppable = false;
_local3 = null;
m_music.play((Constants.VOLUME_MUSIC * m_volumeMusic), 999);
};
}
public function set volumeEffects(_arg1:Number):void{
m_volumeEffects = Math.max(0, Math.min(1, _arg1));
}
public function get volumeEffects():Number{
return (m_volumeEffects);
}
public function get volumeMusic():Number{
return (m_volumeMusic);
}
public function stop_music():void{
if (m_music){
m_music.stop();
};
}
public function pause_music(_arg1:Boolean):void{
if (_arg1){
m_music.pause();
} else {
m_music.resume();
};
}
public function stopWater():void{
}
public function musicRestart(_arg1:Event):void{
if (musicEnabled){
m_music.stop();
m_music.play((Constants.VOLUME_MUSIC * m_volumeMusic), 999);
};
}
public function set soundsEnabled(_arg1:Boolean):void{
if (((_arg1) && (!(m_soundsEnabled)))){
pause_music(false);
m_soundsEnabled = _arg1;
};
if (((!(_arg1)) && (m_soundsEnabled))){
pause_music(true);
m_soundsEnabled = _arg1;
};
}
public function playSound(_arg1:SoundEvent):void{
var _local2:*;
var _local3:SoundPlayer;
if (soundsEnabled){
if (_arg1.force){
stopSounds();
};
_local2 = getDefinitionByName(_arg1.name);
_local3 = new SoundPlayer(new (_local2));
_local3.play((_arg1.volume * m_volumeEffects), _arg1.loops, _arg1.delay);
_local2 = null;
};
}
public function renderFoley(_arg1:Point, _arg2:Boolean=false):void{
var _local3:Number;
if (((_arg2) || (!(soundsEnabled)))){
_local3 = 0;
} else {
_local3 = m_volumeEffects;
};
var _local4:int;
while (_local4 < m_foleyArray.length) {
m_foleyArray[_local4].render(_local3, _arg1);
_local4++;
};
}
public function createFoley(_arg1:String, _arg2:Number, _arg3:IFoleySource, _arg4:String="loop"):void{
var _local5:* = getDefinitionByName(_arg1);
var _local6:FoleySound = new FoleySound(new (_local5), _arg2, _arg3, _arg4);
m_foleyArray.push(_local6);
}
public function set volumeMusic(_arg1:Number):void{
m_volumeMusic = Math.max(0, Math.min(1, _arg1));
}
public function playWater():void{
}
public function get soundsEnabled():Boolean{
return (m_soundsEnabled);
}
public function resumeSounds():void{
SoundPlayer.resumeSounds();
}
public function stopSounds():void{
trace("Stop sounds");
SoundPlayer.pauseSounds();
}
public static function getInstance():SoundController{
if (m_instance == null){
m_instance = new (SoundController);
};
return (m_instance);
}
}
}//package
Section 396
//TableCellRow (TableCellRow)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TableCellRow extends MovieClip {
public var col1:TextField;
public var col3:TextField;
public var col2:TextField;
public var col4:TextField;
}
}//package
Section 397
//TableHeader (TableHeader)
package {
import flash.display.*;
public dynamic class TableHeader extends MovieClip {
}
}//package
Section 398
//UserData (UserData)
package {
import flash.events.*;
import mochi.as3.*;
public class UserData extends EventDispatcher {
private var m_quizAnswer:int;
private var m_firstName:String;
private var m_contactOptIn:int;
private var m_recentLevel:int;
private var m_hash:String;
private var m_recentScore:int;
private var m_md3:MochiDigits;
private var m_quizResponses:int;
private var m_md6:MochiDigits;
private var m_mobile:String;
private var m_tock:MochiDigits;
private var m_recentRank:int;
private var m_bestScore:int;
private var m_participateInCompetition:Boolean;
private var m_email:String;
private var m_lastName:String;
private var m_username:String;
private var m_lgEssay:String;
private var m_attainedQuizBonus:Boolean;
private static var _instance:UserData = new (UserData);
;
public function UserData(){
if (_instance){
trace("ERROR: UserData is a singleton and can only be accessed through UserData.instance");
} else {
_instance = this;
};
}
public function set lastName(_arg1:String):void{
m_lastName = _arg1;
}
public function set lgEssay(_arg1:String):void{
m_lgEssay = _arg1;
}
public function get contactOptIn():int{
return (m_contactOptIn);
}
public function set contactOptIn(_arg1:int):void{
m_contactOptIn = _arg1;
}
public function set attainedQuizBonus(_arg1:Boolean):void{
m_attainedQuizBonus = _arg1;
}
public function set md6(_arg1:int):void{
m_md6 = null;
m_md6 = new MochiDigits(_arg1);
}
public function get bestScore():int{
return (m_bestScore);
}
public function set md3(_arg1:int):void{
m_md3 = null;
m_md3 = new MochiDigits(_arg1);
}
public function get hash():String{
return (m_hash);
}
public function get participateInCompetition():Boolean{
return (m_participateInCompetition);
}
public function get mobile():String{
return (m_mobile);
}
public function get email():String{
return (m_email);
}
public function get recentRank():int{
return (m_recentRank);
}
public function set username(_arg1:String):void{
m_username = _arg1;
}
public function get tock():Number{
return (m_tock.value);
}
public function set firstName(_arg1:String):void{
m_firstName = _arg1;
}
public function set participateInCompetition(_arg1:Boolean):void{
m_participateInCompetition = _arg1;
}
public function set bestScore(_arg1:int):void{
m_bestScore = _arg1;
}
public function set email(_arg1:String):void{
m_email = _arg1;
}
public function get lastName():String{
return (m_lastName);
}
public function get lgEssay():String{
return (m_lgEssay);
}
public function set mobile(_arg1:String):void{
m_mobile = _arg1;
}
public function get attainedQuizBonus():Boolean{
return (m_attainedQuizBonus);
}
public function set hash(_arg1:String):void{
m_hash = _arg1;
}
public function set tock(_arg1:Number):void{
m_tock = null;
m_tock = new MochiDigits(_arg1);
}
public function set recentRank(_arg1:int):void{
m_recentRank = _arg1;
}
public function set recentLevel(_arg1:int):void{
m_recentLevel = _arg1;
}
public function get firstName():String{
return (m_firstName);
}
public function get username():String{
return (m_username);
}
public function set quizAnswer(_arg1:int):void{
m_quizAnswer = _arg1;
}
public function get recentLevel():int{
return (m_recentLevel);
}
public function set recentScore(_arg1:int):void{
m_recentScore = _arg1;
}
public function get quizAnswer():int{
return (m_quizAnswer);
}
public function set quizResponses(_arg1:int):void{
m_quizResponses = _arg1;
}
public function get md3():int{
return (m_md3.value);
}
public function get quizResponses():int{
return (m_quizResponses);
}
public function get recentScore():int{
return (m_recentScore);
}
public function get md6():int{
return (m_md6.value);
}
public static function get instance():UserData{
return (_instance);
}
}
}//package