Section 1
//BackgroundSpace (_backgrounds.BackgroundSpace)
package _backgrounds {
import flash.events.*;
import framework._flow.*;
import _game._world._meteors.*;
import _game._stats.*;
import assets.*;
import framework._utils._timer.*;
import gs.*;
import _components.*;
import gs.easing.*;
public class BackgroundSpace extends Screen {
private var callback:Function;
private var fireworks:FireworksManager;
private var circle:CircleAsset;
private var starysArr:Array;
public var mc:BackgroundSpaceAsset;
private var meteorsArr:Array;
private var timerStar2:TimerEx;
private var lastIndex1:int;// = -1
private var lastIndex2:int;// = -1
private var timerStar1:TimerEx;
private var giantMeteorTweenPosition:TweenMax;
private var stars1:Array;
private var stars2:Array;
private var meteor:GiantMeteorPassing;
public function BackgroundSpace(){
mc = new BackgroundSpaceAsset();
circle = new CircleAsset();
stars1 = new Array();
stars2 = new Array();
meteor = new GiantMeteorPassing();
meteorsArr = new Array();
fireworks = new FireworksManager();
starysArr = new Array();
super();
id = Components.BACKGROUND;
canvas.addChild(mc);
canvas.addChild(fireworks);
canvas.addChild(circle);
var _local1:int;
while (_local1 < mc.numChildren) {
if ((mc.getChildAt(_local1) is star1Asset)){
stars1.push(mc.getChildAt(_local1));
} else {
if ((mc.getChildAt(_local1) is star2Asset)){
stars2.push(mc.getChildAt(_local1));
} else {
if ((mc.getChildAt(_local1) is Starys)){
starysArr.push(mc.getChildAt(_local1));
};
};
};
_local1++;
};
circle.x = 300;
circle.y = 300;
circle.stop();
loadLastUnlockedBackground();
if (Stats.gameModeStatsArr[GameModes.CREDITS].unlocked){
Stats.gameMode = GameModes.CREDITS;
} else {
if (Stats.gameModeStatsArr[GameModes.VERY_HARD].unlocked){
Stats.gameMode = GameModes.VERY_HARD;
} else {
if (Stats.gameModeStatsArr[GameModes.HARD].unlocked){
Stats.gameMode = GameModes.HARD;
} else {
Stats.gameMode = GameModes.NORMAL;
};
};
};
mc.middle_rocks.visible = false;
}
override protected function onPaused():void{
if (giantMeteorTweenPosition){
giantMeteorTweenPosition.pause();
};
meteor.pause();
var _local1:int;
while (_local1 < meteorsArr.length) {
meteorsArr[_local1].pause();
_local1++;
};
}
private function onGiantMeteorPassed():void{
circle.width = (circle.height = 600);
meteor.removeEventListener(Event.COMPLETE, onGiantMeteorPassed);
meteor.visible = false;
canvas.removeChild(meteor);
if (callback != null){
callback();
};
}
public function showMeteorsPassing(_arg1:int, _arg2:int, _arg3:Boolean=false):void{
if (((Stats.inFinal) && (!(_arg3)))){
return;
};
switch (_arg1){
case MeteorShower.LINE_UP:
case MeteorShower.LINE_CENTER:
case MeteorShower.LINE_DOWN:
meteorsPassBack(_arg1, _arg2);
break;
case MeteorShower.LINES_CENTER_DOWN:
meteorsPassBack(MeteorShower.LINE_CENTER, (_arg2 / 2));
meteorsPassBack(MeteorShower.LINE_DOWN, (_arg2 / 2));
break;
case MeteorShower.LINES_UP_CENTER:
meteorsPassBack(MeteorShower.LINE_UP, (_arg2 / 2));
meteorsPassBack(MeteorShower.LINE_CENTER, (_arg2 / 2));
break;
case MeteorShower.LINES_UP_DOWN:
meteorsPassBack(MeteorShower.LINE_UP, (_arg2 / 2));
meteorsPassBack(MeteorShower.LINE_DOWN, (_arg2 / 2));
break;
case MeteorShower.CIRCLE:
meteorsPassBack(MeteorShower.LINE_UP, (_arg2 / 2));
meteorsPassBack(MeteorShower.LINE_CENTER, (_arg2 / 2));
meteorsPassBack(MeteorShower.LINE_DOWN, (_arg2 / 2));
break;
};
}
public function giantMeteorPassBack(_arg1:Function=null):void{
meteor.y = 300;
meteor.enable();
canvas.addChildAt(meteor, 1);
this.callback = _arg1;
giantMeteorTweenPosition = new TweenMax(meteor, 6, {x:800, onUpdate:updateGiantMeteorTween, onComplete:onGiantMeteorPassed, ease:Linear.easeOut});
}
public function disableFireworks():void{
fireworks.disable();
}
override protected function onInitialize(_arg1:String):void{
timerStar1 = new TimerEx(1, (2 + (Math.random() * 2)), onTimerStar1);
timerStar2 = new TimerEx(1, (2 + (Math.random() * 2)), onTimerStar2);
timerStar1.start();
timerStar2.start();
}
public function addCircle():void{
circle.visible = true;
mc.middle_rocks.visible = false;
}
private function updateGiantMeteorTween():void{
var _local1:Number = giantMeteorTweenPosition.progress;
var _local2:Number = (((-4 * _local1) * _local1) + (4 * _local1));
circle.width = (circle.height = (600 + (((Math.random() - 0.5) * _local2) * 10)));
}
private function onTimerStar1():void{
var _local1:int = (stars1.length * Math.random());
if (lastIndex1 == _local1){
_local1++;
};
if (_local1 == stars1.length){
_local1 = 0;
};
stars1[_local1].gotoAndPlay("shine");
timerStar1.setTimeAmount((1.5 + (Math.random() * 1.5)));
timerStar1.start();
}
public function stop():void{
if (giantMeteorTweenPosition){
giantMeteorTweenPosition.pause();
giantMeteorTweenPosition = null;
};
meteor.stop();
var _local1:int;
while (_local1 < meteorsArr.length) {
meteorsArr[_local1].stop();
meteorsArr[_local1].removeEventListener(Event.COMPLETE, onMeteorsPassed);
canvas.removeChild(meteorsArr[_local1]);
_local1++;
};
meteorsArr = new Array();
}
override protected function onResumed():void{
if (giantMeteorTweenPosition){
giantMeteorTweenPosition.resume();
};
meteor.resume();
var _local1:int;
while (_local1 < meteorsArr.length) {
meteorsArr[_local1].resume();
_local1++;
};
}
public function vibrateCircle():void{
circle.circle.gotoAndPlay("move");
}
public function meteorsVibrate():void{
if (circle.currentFrame != 1){
return;
};
circle.play();
}
private function onTimerStar2():void{
var _local1:int = (starysArr.length * Math.random());
if (lastIndex2 == _local1){
_local1++;
};
if (_local1 == stars1.length){
_local1 = 0;
};
starysArr[_local1].play();
timerStar2.setTimeAmount((4 + (Math.random() * 2)));
timerStar2.start();
starysArr[_local1].scaleX = (starysArr[_local1].scaleY = (0.5 + Math.random()));
if (Math.random() > 0.7){
_local1 = (starysArr.length * Math.random());
if (lastIndex2 == _local1){
_local1++;
};
if (_local1 == stars1.length){
_local1 = 0;
};
starysArr[_local1].play();
starysArr[_local1].scaleX = (starysArr[_local1].scaleY = (0.5 + Math.random()));
};
}
public function enableFireworks():void{
fireworks.enable();
}
public function removeCircle():void{
circle.visible = false;
if (Stats.gameMode == GameModes.HARD){
mc.middle_rocks.visible = true;
};
}
private function meteorsVibrateBack():void{
}
private function onMeteorsPassed(_arg1:Event):void{
var _local2:MeteorsPassing = MeteorsPassing(_arg1.target);
_local2.removeEventListener(Event.COMPLETE, onMeteorsPassed);
canvas.removeChild(_local2);
var _local3:int = meteorsArr.indexOf(_local2);
if (_local3 != -1){
meteorsArr.splice(_local3, 1);
};
}
public function loadBackground():void{
if (Stats.gameMode == GameModes.CREDITS){
mc.gotoAndStop(4);
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
mc.gotoAndStop(3);
} else {
if (Stats.gameMode == GameModes.HARD){
mc.gotoAndStop(2);
} else {
mc.gotoAndStop(1);
};
};
};
}
public function loadLastUnlockedBackground():void{
if (Stats.gameModeStatsArr[GameModes.CREDITS].unlocked){
mc.gotoAndStop(4);
} else {
if (Stats.gameModeStatsArr[GameModes.VERY_HARD].unlocked){
mc.gotoAndStop(3);
} else {
if (Stats.gameModeStatsArr[GameModes.HARD].unlocked){
mc.gotoAndStop(2);
} else {
mc.gotoAndStop(1);
};
};
};
}
private function meteorsPassBack(_arg1:int, _arg2:int):void{
var _local3:MeteorsPassing = new MeteorsPassing(_arg1, _arg2);
meteorsArr.push(_local3);
_local3.addEventListener(Event.COMPLETE, onMeteorsPassed);
canvas.addChildAt(_local3, 1);
}
}
}//package _backgrounds
Section 2
//Fireworks (_backgrounds.Fireworks)
package _backgrounds {
import flash.display.*;
import org.flintparticles.common.events.*;
import framework._sound.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import flash.filters.*;
import framework._utils._timer.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.renderers.*;
import _sound.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class Fireworks extends Sprite {
private var renderer:PixelRenderer;
private var timer:TimerEx;
private var colorInit:ColorInit;
private var rect:Rectangle;
private var emitter:Emitter2D;
private var colors:Array;
private var stopSounds:Boolean;// = false
private var soundTimer:TimerEx;
private var stopSoundsTimer:TimerEx;
public function Fireworks(){
emitter = new Emitter2D();
timer = new TimerEx(1, 0, onTimer);
colorInit = new ColorInit();
soundTimer = new TimerEx(1, 0, playSound);
stopSoundsTimer = new TimerEx(1, 1.5, onTimerStopSounds);
rect = new Rectangle(-250, -200, 500, 400);
colors = [0xFFAA00, 43775, 0xFFFF00, 16742399];
super();
emitter.counter = new Blast(400);
updateColors();
emitter.addInitializer(colorInit);
emitter.addInitializer(new Velocity(new DiscZone(new Point(0, 0), 80, 60)));
emitter.addInitializer(new Lifetime(4));
emitter.addAction(new Age());
emitter.addAction(new Move());
emitter.addAction(new Fade());
emitter.addAction(new Accelerate(0, 20));
emitter.addAction(new LinearDrag(0.7));
emitter.addEventListener(EmitterEvent.EMITTER_EMPTY, restart);
renderer = new PixelRenderer(rect);
renderer.addFilter(new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.95, 0]));
renderer.addEmitter(emitter);
addChild(renderer);
}
private function setRandomPosition():void{
x = ((Math.random() * 100) + 50);
if (Math.random() > 0.5){
x = (x + 400);
};
y = ((Math.random() * 100) + 50);
if (Math.random() > 0.5){
y = (y + 200);
};
}
private function restart(_arg1:EmitterEvent):void{
renderer.bitmapData.fillRect(rect, 0);
soundTimer.stop();
setRandomPosition();
timer.setTimeAmount((0.5 + (Math.random() * 1)));
timer.start();
updateColors();
}
public function enable():void{
stopSounds = false;
renderer.bitmapData.fillRect(rect, 0);
setRandomPosition();
timer.setTimeAmount((0.5 + (Math.random() * 1)));
timer.start();
}
private function updateColors():void{
var _local1:int = (Math.random() * colors.length);
colorInit.color = colors[_local1];
}
private function onTimer():void{
stopSounds = false;
var _local1:String = ("fireworksExplode" + String(int(((Math.random() * 3) + 1))));
SoundManager.getInstance().playSound(_local1, SoundGroups.GAME_SOUNDS, 1, (0.5 + (Math.random() * 0.5)));
emitter.start();
playSound();
stopSoundsTimer.start();
}
public function disable():void{
emitter.stop();
timer.stop();
stopSounds = true;
soundTimer.stop();
stopSoundsTimer.stop();
}
private function onTimerStopSounds():void{
stopSounds = true;
soundTimer.stop();
}
private function playSound():void{
if (stopSounds){
return;
};
var _local1:String = ("fireworks" + String(int(((Math.random() * 4) + 1))));
SoundManager.getInstance().playSound(_local1, SoundGroups.GAME_SOUNDS, 1, (0.5 + (Math.random() * 0.5)));
soundTimer.setTimeAmount((0.25 + (Math.random() * 0.3)));
soundTimer.start();
}
}
}//package _backgrounds
Section 3
//FireworksManager (_backgrounds.FireworksManager)
package _backgrounds {
import flash.display.*;
public class FireworksManager extends Sprite {
private var enabled:Boolean;// = false
private var fireworksArr:Array;
public function FireworksManager():void{
fireworksArr = new Array();
super();
var _local1:int;
while (_local1 < 4) {
fireworksArr[_local1] = new Fireworks();
addChild(fireworksArr[_local1]);
_local1++;
};
visible = false;
}
public function enable():void{
if (enabled){
return;
};
enabled = true;
visible = true;
var _local1:int;
while (_local1 < fireworksArr.length) {
fireworksArr[_local1].enable();
_local1++;
};
}
public function disable():void{
if (!enabled){
return;
};
enabled = false;
visible = false;
var _local1:int;
while (_local1 < fireworksArr.length) {
fireworksArr[_local1].disable();
_local1++;
};
}
}
}//package _backgrounds
Section 4
//GiantMeteorPassing (_backgrounds.GiantMeteorPassing)
package _backgrounds {
import flash.display.*;
import framework._sound.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import flash.filters.*;
import assets.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.renderers.*;
import _sound.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class GiantMeteorPassing extends Sprite {
private var renderer:PixelRenderer;
private var mc:GiantMeteorPassingAsset;
private var emitter:Emitter2D;
public function GiantMeteorPassing(){
mc = new GiantMeteorPassingAsset();
emitter = new Emitter2D();
super();
addChild(mc);
emitter.counter = new Steady(150);
emitter.addInitializer(new ColorInit(4294940928, 4294967040));
emitter.addInitializer(new Position(new DiscZone(new Point(0, 0), 42)));
emitter.addInitializer(new Lifetime(0.6, 1));
emitter.addAction(new Move());
emitter.addAction(new Age());
emitter.addAction(new Accelerate(-300, 0));
renderer = new PixelRenderer(new Rectangle(-200, -100, 300, 200));
renderer.addFilter(new BlurFilter(5, 5, 1));
renderer.addFilter(new ColorMatrixFilter([0.99, 0, 0, 0, 0, 0, 0.99, 0, 0, 0, 0, 0, 0.95, 0, 0, 0, 0, 0, 0.99, 0]));
renderer.addEmitter(emitter);
addChild(renderer);
}
public function enable():void{
emitter.start();
x = -200;
visible = true;
SoundManager.getInstance().playSound("meteor_passing", SoundGroups.GAME_SOUNDS);
}
public function resume():void{
emitter.resume();
}
public function pause():void{
emitter.pause();
}
public function stop():void{
emitter.stop();
visible = false;
}
}
}//package _backgrounds
Section 5
//MeteorPassing (_backgrounds.MeteorPassing)
package _backgrounds {
import flash.display.*;
import _game._world._meteors.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import flash.filters.*;
import assets.*;
import org.flintparticles.twoD.emitters.*;
import gs.*;
import org.flintparticles.twoD.renderers.*;
import gs.easing.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class MeteorPassing extends Sprite {
private var renderer:PixelRenderer;
private var tweenPosition:TweenMax;
private var mc:MeteorPassingAsset;
private var emitter:Emitter2D;
public function MeteorPassing(_arg1:int){
mc = new MeteorPassingAsset();
emitter = new Emitter2D();
super();
addChild(mc);
emitter.counter = new Steady(15);
emitter.addInitializer(new ColorInit(4294923520, 4294953984));
emitter.addInitializer(new Position(new DiscZone(new Point(-3, 0), 7.5)));
emitter.addInitializer(new Lifetime(0.4, 0.6));
emitter.addAction(new Move());
emitter.addAction(new Age());
emitter.addAction(new Accelerate(-200, 0));
renderer = new PixelRenderer(new Rectangle(-40, -20, 80, 40));
renderer.addFilter(new BlurFilter(2, 2, 1));
renderer.addFilter(new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 0.99, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.99, 0]));
renderer.addEmitter(emitter);
addChild(renderer);
emitter.start();
tweenPosition = new TweenMax(this, (5 + (Math.random() * 2)), {x:850, ease:Linear.easeOut});
x = -200;
switch (_arg1){
case MeteorShower.LINE_UP:
y = 200;
break;
case MeteorShower.LINE_CENTER:
y = 300;
break;
case MeteorShower.LINE_DOWN:
y = 400;
break;
};
}
public function stop():void{
emitter.stop();
if (tweenPosition){
tweenPosition.pause();
};
tweenPosition = null;
}
public function pause():void{
emitter.pause();
if (tweenPosition){
tweenPosition.pause();
};
}
public function resume():void{
emitter.resume();
if (tweenPosition){
tweenPosition.resume();
};
}
}
}//package _backgrounds
Section 6
//MeteorsPassing (_backgrounds.MeteorsPassing)
package _backgrounds {
import flash.display.*;
import flash.events.*;
import framework._sound.*;
import framework._utils._timer.*;
import _sound.*;
public class MeteorsPassing extends Sprite {
private var timer:TimerEx;
private var meteorArr:Array;
public function MeteorsPassing(_arg1:int, _arg2:int):void{
var _local4:MeteorPassing;
meteorArr = new Array();
timer = new TimerEx(1, 7, onTimer);
super();
var _local3:int;
while (_local3 < _arg2) {
_local4 = new MeteorPassing(_arg1);
new MeteorPassing(_arg1).x = (_local4.x + ((Math.random() * 80) - 40));
_local4.y = (_local4.y + ((Math.random() * 80) - 40));
meteorArr.push(_local4);
addChild(_local4);
_local3++;
};
timer.start();
SoundManager.getInstance().playSound("meteor_passing", SoundGroups.GAME_SOUNDS, 1, 0.5);
}
public function stop():void{
var _local1:int;
while (_local1 < meteorArr.length) {
meteorArr[_local1].stop();
_local1++;
};
timer.stop();
}
public function resume():void{
var _local1:int;
while (_local1 < meteorArr.length) {
meteorArr[_local1].resume();
_local1++;
};
timer.resume();
}
private function onTimer():void{
visible = false;
dispatchEvent(new Event(Event.COMPLETE));
}
public function pause():void{
var _local1:int;
while (_local1 < meteorArr.length) {
meteorArr[_local1].pause();
_local1++;
};
timer.pause();
}
}
}//package _backgrounds
Section 7
//Components (_components.Components)
package _components {
public class Components {
public static const GAME_OVER:int = 104;
public static const BLUE_ENERGY_EFFECT:int = 36;
public static const SPACE_SHIP:int = 31;
public static const SUPER_BOMB:int = 30;
public static const INGAME_MENU:int = 12;
public static const DIALOGS:int = 110;
public static const SELECT_MODE:int = 111;
public static const SHELL:int = 22;
public static const GUI:int = 11;
public static const GAME_COMPLETED:int = 34;
public static const CREDITS_IN_GAME:int = 114;
public static const KEYBOARD_CONTROLLER:int = 202;
public static const MAIN_MENU:int = 100;
public static const INVINCIBILITY:int = 200;
public static const SPIKES:int = 18;
public static const BACKGROUND:int = 109;
public static const ATRACTOR_ITEM_BEHAVIOR:int = 204;
public static const TITLE:int = 107;
public static const HIGHSCORES:int = 106;
public static const FINAL:int = 108;
public static const METEOR_SHOWER:int = 26;
public static const ITEM_MANAGER:int = 5;
public static const WHITE_SCREEN:int = 112;
public static const G5GLOGO:int = 115;
public static const HOW_TO_PLAY:int = 102;
public static const ENEMY:int = 4;
public static const WORLD:int = 7;
public static const EVOLUTION_ITEM:int = 23;
public static const SHIELD:int = 15;
public static const POSITION_CONTROLLER:int = 205;
public static const CREDITS:int = 101;
public static const OPTIONS:int = 105;
public static const PLAYER_FINAL:int = 35;
public static const METEORS_SHIELD:int = 37;
public static const GIANT_METEOR:int = 32;
public static const MOUSE_CONTROLLER:int = 201;
public static const BORDERLIGHT_MANAGER:int = 17;
public static const SHINY_BOBULOUS:int = 14;
public static const BOMB:int = 13;
public static const METEOR:int = 19;
public static const CANON_BALL:int = 27;
public static const ULTRA_SPEED:int = 28;
public static const ATRACTOR:int = 24;
public static const CIRCLE_SHIELD:int = 25;
public static const COLLISION_INFO:int = 20;
public static const ENEMY_MANAGER:int = 3;
public static const BLUE_ENERGY_CONTAINER:int = 113;
public static const EXPRESSIONS:int = 203;
public static const THUNDER:int = 29;
public static const START_GAME_INTRO:int = 103;
public static const PLAYER:int = 2;
public static const SHELL_ITEM:int = 21;
public static const SPIKE:int = 16;
public static const GAME:int = 1;
public static const EXPLOSION:int = 10;
public static const RED_SCREEN:int = 33;
}
}//package _components
Section 8
//GameEvents (_events.GameEvents)
package _events {
public class GameEvents {
public static const GAME_OVER:String = "gameOver";
public static const PLAYER_DEAD:String = "playerDead";
public static const READY_TO_EVOLVE:String = "readyToEvolve";
public static const ADD_SHIELD_TO_WORLD:String = "addShieldToWorld";
public static const PLAYER_ENDED_ANIM_DEAD:String = "playerEndedAnimDead";
public static const CHANGE_GENERATION_RATE:String = "changeGenerationRate";
public static const ENABLE_METEOR_SHOWER_NOW:String = "enableMeteorShowerNow";
public static const ADD_SUPER_BOMB_TO_WORLD:String = "addSuperBombToWorld";
public static const ENABLE_METEOR_SHOWER:String = "enableMeteorShower";
public static const ENERGY_GATHERED:String = "energyGathered";
public static const ADD_SCORE:String = "addScore";
public static const BONUS_SCORE:String = "bonusScore";
public static const BOMB_USED:String = "bombUsed";
public static const METEOR_SHOWER_ENABLED:String = "meteorShowerEnabled";
public static const PLAYER_GROWS:String = "playerGrows";
public static const SHIP_BOARDED:String = "shipBoarded";
public static const PLAYER_REGENERATE:String = "playerRegenerate";
public static const ADD_THUNDER_TO_WORLD:String = "addUltraSpeedToWorld";
public static const ADD_ENEMIES:String = "addEnemies";
public static const AUTO_BOMB:String = "autoBomb";
public static const ADD_BOMB_TO_PLAYER:String = "addBombToPlayer";
public static const START_GAME:String = "startGame";
public static const BLUE_ENERGY_GATHERED:String = "blueEnergyGathered";
public static const DESTROY_WORLD:String = "destroyWorld";
public static const END_BEHAVIOR:String = "endBehavior";
public static const ADD_ATRACTOR_TO_WORLD:String = "addAtractorToWorld";
public static const ENABLE_LIGHTS:String = "enableLights";
public static const ENABLE_SPIKES:String = "enableSpikes";
public static const ADD_BOMB_TO_WORLD:String = "addBombToWorld";
public static const CONTROLLER_CHANGED:String = "controllerChanged";
public static const LIVES_UP:String = "livesUp";
public static const ENERGY_FULL:String = "energyFull";
public static const ADD_PROGRESS_POINTS:String = "addProgressPoints";
public static const ADD_LIFE:String = "addLife";
public static const EXPLOSION_FINISHED:String = "explosionFinished";
}
}//package _events
Section 9
//BonusScore (_game._gui.BonusScore)
package _game._gui {
import flash.events.*;
import _game._stats.*;
import assets.gui.*;
import assets.*;
import flash.text.*;
public class BonusScore {
private var active:Array;
private var pool1:Array;
private var pool2:Array;
public function BonusScore(){
pool1 = new Array();
pool2 = new Array();
active = new Array();
super();
}
public function resume():void{
var _local1:int;
while (_local1 < active.length) {
active[_local1].resume();
_local1++;
};
}
private function onEndBonusScore(_arg1:Event):void{
var _local2:BonusScoreAsset = BonusScoreAsset(_arg1.target);
_local2.removeEventListener("end", onEndBonusScore);
pool1.push(_local2);
var _local3:int = active.indexOf(_local2);
if (_local3 != -1){
active.splice(_local3, 1);
};
}
private function onEndYellowLights(_arg1:Event):void{
var _local2:YellowEnergyAsset = YellowEnergyAsset(_arg1.target);
_local2.removeEventListener("end", onEndYellowLights);
pool2.push(_local2);
var _local3:int = active.indexOf(_local2);
if (_local3 != -1){
active.splice(_local3, 1);
};
}
public function pause():void{
var _local1:int;
while (_local1 < active.length) {
active[_local1].pause();
_local1++;
};
}
public function createYellowLights(_arg1:int, _arg2:int, _arg3:int):YellowEnergyAsset{
var _local4:YellowEnergyAsset;
if (pool2.length > 0){
_local4 = YellowEnergyAsset(pool2.shift());
} else {
_local4 = new YellowEnergyAsset();
_local4.amount_txt.amount_tf.defaultTextFormat = new TextFormat("ScienceProject", 24);
_local4.amount_txt.amount_tf.embedFonts = true;
};
_local4.amount_txt.amount_tf.text = FinalStats.getInstance().lightsCaught;
_local4.amount_txt.total_tf.gotoAndStop((Stats.gameMode + 1));
_local4.gotoAndPlay("start");
_local4.x = _arg2;
_local4.y = _arg3;
_local4.visible = true;
_local4.addEventListener("end", onEndYellowLights);
active.push(_local4);
return (_local4);
}
public function createBonusScore(_arg1:int, _arg2:int, _arg3:int):BonusScoreAsset{
var _local4:BonusScoreAsset;
if (pool1.length > 0){
_local4 = BonusScoreAsset(pool1.shift());
} else {
_local4 = new BonusScoreAsset();
_local4.tf_mc.tf.defaultTextFormat = new TextFormat("ScienceProject", 23);
_local4.tf_mc.tf.embedFonts = true;
_local4.tf_mc.tf.autoSize = TextFieldAutoSize.LEFT;
};
_local4.gotoAndPlay("start");
_local4.tf_mc.tf.text = _arg1.toString();
_local4.x = _arg2;
_local4.y = _arg3;
_local4.visible = true;
_local4.addEventListener("end", onEndBonusScore);
_local4.tf_mc.pts.x = (_local4.tf_mc.tf.width - 4);
active.push(_local4);
return (_local4);
}
}
}//package _game._gui
Section 10
//Dialogs (_game._gui.Dialogs)
package _game._gui {
import framework._flow.*;
import framework._sound.*;
import assets.*;
import framework._utils._timer.*;
import gs.*;
import _components.*;
import _sound.*;
import flash.text.*;
public class Dialogs extends Screen {
private var entering:Boolean;// = false
private var timerText:TimerEx;
private var volume:Number;
private var timerHide:TimerEx;
private var character:int;
private var tween:TweenMax;
private var text:String;// = ""
private var mc:MessagePanelAsset;
private var autohide:Boolean;
private var textDisplayed:String;// = ""
private var counter:int;// = 0
public function Dialogs(){
mc = new MessagePanelAsset();
timerText = new TimerEx(1, 0.005, onTimerText);
super();
id = Components.DIALOGS;
timerHide = new TimerEx(1, 0, onTimerHide);
canvas.addChild(mc);
mc.x = 300;
mc.y = 515;
canvas.visible = false;
mc.alpha = 0;
character = 1;
}
override protected function onRemoved():void{
canvas.visible = false;
timerHide.stop();
timerText.stop();
mc.alpha = 0;
}
private function onExited():void{
canvas.visible = false;
}
override protected function onPaused():void{
timerHide.pause();
timerText.pause();
}
private function onTimerHide():void{
if (!entering){
tween = new TweenMax(mc, 0.5, {alpha:0, onComplete:onExited});
};
}
private function onEntered():void{
entering = false;
timerText.start();
}
public function appendToDialog(_arg1:String, _arg2:Boolean, _arg3:Number=3):void{
this.text = (this.text + ("\n" + _arg1));
this.autohide = _arg2;
if (timerHide.isRunning()){
timerHide.stop();
};
if (timerHide.isRunning()){
timerHide.stop();
};
if (_arg2){
timerHide.setTimeAmount(_arg3);
};
if (!timerText.isRunning()){
timerText.start();
};
}
public function showDialog(_arg1:String, _arg2:int, _arg3:Boolean, _arg4:Number=3, _arg5:Number=0.55):void{
canvas.visible = true;
entering = true;
if (tween){
tween.pause();
};
this.text = _arg1;
this.autohide = _arg3;
this.volume = _arg5;
this.character = _arg2;
textDisplayed = "";
mc.dialog_txt.defaultTextFormat = new TextFormat("ScienceProject", 23);
mc.dialog_txt.embedFonts = true;
mc.dialog_txt.text = "";
mc.character.gotoAndStop(_arg2);
counter = 7;
if (timerHide.isRunning()){
timerHide.stop();
};
if (timerText.isRunning()){
timerText.stop();
};
if (_arg3){
timerHide.setTimeAmount(_arg4);
};
if (mc.alpha < 1){
tween = new TweenMax(mc, 0.5, {alpha:1, onComplete:onEntered});
} else {
onEntered();
};
}
private function onTimerText():void{
var _local2:String;
var _local1:int = textDisplayed.length;
textDisplayed = (textDisplayed + text.charAt(_local1));
mc.dialog_txt.text = textDisplayed;
counter++;
if (counter > 7){
if (character == 1){
_local2 = ("dialog_sound" + String(int(((Math.random() * 4) + 1))));
} else {
_local2 = ("dialog_bobulous_sound" + String(int(((Math.random() * 4) + 1))));
};
SoundManager.getInstance().playSound(_local2, SoundGroups.GAME_SOUNDS, 1, volume);
counter = 0;
};
if (textDisplayed.length == text.length){
if (autohide){
timerHide.start();
};
} else {
timerText.start();
};
}
override protected function onResumed():void{
timerHide.resume();
timerText.resume();
}
}
}//package _game._gui
Section 11
//Gui (_game._gui.Gui)
package _game._gui {
import flash.display.*;
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._sound.*;
import _game._world._meteors.*;
import _game._stats.*;
import flash.net.*;
import _game._phase.*;
import assets.gui.*;
import assets.*;
import framework._utils._timer.*;
import gs.*;
import framework._mcEx.*;
import _components.*;
import _sound.*;
import flash.text.*;
import _game.*;
import gs.easing.*;
import _events.*;
public class Gui extends Screen {
private var livesUp:LifeUp;
private var dangerUpCounter:int;// = 0
private var lastSeconds:int;// = -1
private var dangerCenterCounter:int;// = 0
private var currentLives:int;
private var tweenEnergyMax:TweenMax;
private var dangerDownAsset:MovieClipExCompo;
public var mc:GuiAsset;
private var getIn:GetInAsset;
private var unlockedMsg:UnlockedMsgAsset;
private var tweenScoreBar:TweenMax;
private var listenDangerSoundFrom:int;
private var timerMsg0:TimerEx;
private var bonusScore:BonusScore;
private var timerMsg1:TimerEx;
private var finalGuiElementsRemoved:Boolean;// = false
private var blueEnergyCount:int;// = 0
private var dangerDownCounter:int;// = 0
private var tweenFullScoreBar:TweenMax;
private var arrowPointingArr:Array;
private var tweenReadyToEvolve:TweenMax;
private var timerDialog:TimerEx;
private var getIn2:GetIn2Asset;
private var dangerCenterAsset:MovieClipExCompo;
private var dangerUpAsset:MovieClipExCompo;
public function Gui():void{
mc = new GuiAsset();
bonusScore = new BonusScore();
livesUp = new LifeUp();
unlockedMsg = new UnlockedMsgAsset();
arrowPointingArr = new Array();
getIn = new GetInAsset();
getIn2 = new GetIn2Asset();
timerMsg0 = new TimerEx(1, 1, onTimerMsg0);
timerMsg1 = new TimerEx(1, 2.5, onTimerMsg1);
super();
id = Components.GUI;
canvas.addChild(mc);
dangerDownAsset = new MovieClipExCompo(mc.danger_down);
dangerUpAsset = new MovieClipExCompo(mc.danger_up);
dangerCenterAsset = new MovieClipExCompo(mc.danger_center);
mc.danger_center.addEventListener("playDangerSound", onPlayDangerSound);
mc.danger_down.addEventListener("playDangerSound", onPlayDangerSound);
mc.danger_up.addEventListener("playDangerSound", onPlayDangerSound);
var _local1:TextField = mc.Score.score_txt;
var _local2:TextFormat = new TextFormat("ScienceProject", 30);
_local2.letterSpacing = 0.2;
_local2.align = TextFormatAlign.CENTER;
_local1.defaultTextFormat = _local2;
_local1.embedFonts = true;
_local1.autoSize = TextFieldAutoSize.CENTER;
_local1 = mc.counter.counter_tf.tf;
_local1.defaultTextFormat = new TextFormat("ScienceProject", 30);
_local1.embedFonts = true;
mc.menu_btn.addEventListener(MouseEvent.CLICK, onMenuBtnClick);
canvas.addChild(unlockedMsg);
unlockedMsg.gotoAndStop(1);
unlockedMsg.panel.gotoAndStop(1);
unlockedMsg.visible = false;
unlockedMsg.x = 300;
unlockedMsg.y = 640;
getIn.visible = false;
getIn.stop();
getIn2.visible = false;
getIn2.stop();
mc.g5g_btn.addEventListener(MouseEvent.CLICK, ong5glogoClick);
GlobalDispatcher.addEventListener(GameEvents.BONUS_SCORE, onBonusScore);
GlobalDispatcher.addEventListener(GameEvents.LIVES_UP, onLivesUp);
GlobalDispatcher.addEventListener(GameEvents.READY_TO_EVOLVE, onReadyToEvolve);
GlobalDispatcher.addEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
GlobalDispatcher.addEventListener(GameEvents.BLUE_ENERGY_GATHERED, onBlueEnergyGathered);
}
private function onPlayDangerSound(_arg1:Event):void{
if (Stats.inFinal){
return;
};
if (listenDangerSoundFrom == 1){
if (_arg1.target != mc.danger_down){
return;
};
} else {
if (listenDangerSoundFrom == 2){
if (_arg1.target != mc.danger_center){
return;
};
} else {
if (listenDangerSoundFrom == 3){
if (_arg1.target != mc.danger_up){
return;
};
};
};
};
SoundManager.getInstance().playSound("danger", SoundGroups.GAME_SOUNDS);
}
public function showCreditsUnlockedMsg():void{
TimerEx.start(1, 5, onHideUnlockedMsg);
unlockedMsg.gotoAndPlay("enter");
unlockedMsg.panel.gotoAndStop(4);
unlockedMsg.visible = true;
}
private function onReadyToEvolve(_arg1:Event):void{
tweenReadyToEvolve = new TweenMax(mc.readyToEvolve, 0.4, {colorMatrixFilter:{brightness:1.4}, glow:{color:0xFFFFFF, blurX:5, blurY:5, strength:3, ease:Quad.easeIn}, yoyo:true});
mc.readyToEvolve.visible = true;
if ((((Stats.gameMode == GameModes.NORMAL)) && ((Stats.playerLevel == 1)))){
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain! Now that your energy is full\nyou are ready to evolve!", 1, true, 4);
};
}
public function removeGetIn():void{
var _local1:int;
while (_local1 < canvas.numChildren) {
if (canvas.getChildAt(_local1) == getIn){
canvas.removeChild(getIn);
getIn.stop();
getIn.visible = false;
break;
};
_local1++;
};
}
public function addArrowPointing(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int):void{
var _local6:MovieClip;
if (_arg5 == 1){
_local6 = new ArrowPointingAsset();
} else {
_local6 = new ArrowPointing2Asset();
};
_local6.x = _arg2;
_local6.y = _arg3;
_local6.rotation = _arg4;
_local6.gotoAndPlay(1);
arrowPointingArr[_arg1] = _local6;
canvas.addChild(_local6);
}
private function onMenuBtnClick(_arg1:MouseEvent):void{
if (paused){
return;
};
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
if (parent.getChildById(Components.GAME)){
executeTransition("InGameMenu");
Game(parent.getChildById(Components.GAME)).pauseRecursively();
pause();
};
}
public function displayDanger(_arg1:int, _arg2:Boolean=false):void{
switch (_arg1){
case MeteorShower.LINE_DOWN:
dangerDownCounter = 0;
mc.danger_down.visible = true;
dangerDownAsset.gotoAndPlay(2);
mc.danger_down.addEventListener("complete", onDangerDownComplete);
listenDangerSoundFrom = 1;
break;
case MeteorShower.LINE_UP:
dangerUpCounter = 0;
mc.danger_up.visible = true;
dangerUpAsset.gotoAndPlay(2);
mc.danger_up.addEventListener("complete", onDangerUpComplete);
listenDangerSoundFrom = 3;
break;
case MeteorShower.LINE_CENTER:
dangerCenterCounter = 0;
mc.danger_center.visible = true;
dangerCenterAsset.gotoAndPlay(2);
mc.danger_center.addEventListener("complete", onDangerCenterComplete);
listenDangerSoundFrom = 2;
break;
case MeteorShower.CIRCLE:
dangerCenterCounter = 0;
dangerUpCounter = 0;
dangerDownCounter = 0;
mc.danger_center.visible = true;
dangerCenterAsset.gotoAndPlay(2);
mc.danger_down.visible = true;
dangerDownAsset.gotoAndPlay(2);
mc.danger_up.visible = true;
dangerUpAsset.gotoAndPlay(2);
mc.danger_down.addEventListener("complete", onDangerDownComplete);
mc.danger_up.addEventListener("complete", onDangerUpComplete);
mc.danger_center.addEventListener("complete", onDangerCenterComplete);
listenDangerSoundFrom = 1;
break;
case MeteorShower.LINES_CENTER_DOWN:
dangerDownCounter = 0;
mc.danger_down.visible = true;
dangerDownAsset.gotoAndPlay(2);
mc.danger_down.addEventListener("complete", onDangerDownComplete);
dangerCenterCounter = 0;
mc.danger_center.visible = true;
dangerCenterAsset.gotoAndPlay(2);
mc.danger_center.addEventListener("complete", onDangerCenterComplete);
listenDangerSoundFrom = 1;
break;
case MeteorShower.LINES_UP_CENTER:
dangerUpCounter = 0;
mc.danger_up.visible = true;
dangerUpAsset.gotoAndPlay(2);
mc.danger_up.addEventListener("complete", onDangerUpComplete);
dangerCenterCounter = 0;
mc.danger_center.visible = true;
dangerCenterAsset.gotoAndPlay(2);
mc.danger_center.addEventListener("complete", onDangerCenterComplete);
listenDangerSoundFrom = 2;
break;
case MeteorShower.LINES_UP_DOWN:
dangerUpCounter = 0;
mc.danger_up.visible = true;
dangerUpAsset.gotoAndPlay(2);
mc.danger_up.addEventListener("complete", onDangerUpComplete);
dangerDownCounter = 0;
mc.danger_down.visible = true;
dangerDownAsset.gotoAndPlay(2);
mc.danger_down.addEventListener("complete", onDangerDownComplete);
listenDangerSoundFrom = 3;
break;
};
if ((((Stats.playerLevel < 6)) && (!(_arg2)))){
SoundManager.getInstance().playSound("danger", SoundGroups.GAME_SOUNDS);
};
}
public function addGetIn2(_arg1:Number, _arg2:Number):void{
canvas.addChild(getIn2);
getIn2.gotoAndPlay(1);
getIn2.x = _arg1;
getIn2.y = _arg2;
getIn2.visible = true;
}
private function onTimerMsg0():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Greatly done captain!", 1, false, 3);
timerMsg1.start();
}
private function onDangerUpComplete(_arg1:Event):void{
dangerUpCounter++;
if (dangerUpCounter == 3){
mc.danger_up.visible = false;
mc.danger_up.removeEventListener("complete", onDangerUpComplete);
} else {
dangerUpAsset.gotoAndPlay(2);
};
}
public function deactivateProgressBarTweens():void{
if (tweenFullScoreBar){
mc.progress_bar_container.container.filters = [];
TweenMax.removeTween(tweenFullScoreBar);
tweenFullScoreBar = null;
};
if (tweenReadyToEvolve){
mc.readyToEvolve.filters = [];
TweenMax.removeTween(tweenReadyToEvolve);
tweenReadyToEvolve = null;
mc.readyToEvolve.visible = false;
};
}
public function updateProgressBar():void{
if (Stats.playerLevel == 6){
return;
};
var _local1:Number = PhaseManager.getInstance().getProgressPointsPercent();
TweenMax.to(mc.progress_bar_container.bar.bar_mask, 0.1, {x:((59.8 - mc.progress_bar_container.bar.bar_mask.width) + (_local1 * mc.progress_bar_container.bar.bar_mask.width))});
tweenScoreBar = new TweenMax(mc.progress_bar_container.bar.bar_masked, 0.2, {colorMatrixFilter:{brightness:1.5}, onComplete:revertBright});
}
public function removeFinalGuiElements():void{
if (finalGuiElementsRemoved){
return;
};
finalGuiElementsRemoved = true;
if (tweenEnergyMax){
mc.energyMax.filters = [];
TweenMax.removeTween(tweenEnergyMax);
tweenEnergyMax = null;
mc.energyMax.visible = false;
};
mc.blueEnergyMax.visible = false;
mc.gotoAndPlay("removeFinalGui");
}
private function onLivesUp(_arg1:EventValue):void{
var _local2:LivesUpAsset = livesUp.createLivesUp(_arg1.value.x, _arg1.value.y);
mc.addChild(_local2);
}
override protected function onExit(_arg1:String):void{
var _local2:MovieClipEx;
mc.readyToEvolve.visible = false;
mc.maxEvolution.visible = false;
if (timerDialog){
timerDialog.stop();
};
if (((getIn.visible) && ((getIn.parent == canvas)))){
canvas.removeChild(getIn);
getIn.visible = false;
};
if (((getIn2.visible) && ((getIn2.parent == canvas)))){
canvas.removeChild(getIn2);
getIn2.visible = false;
};
for each (_local2 in arrowPointingArr) {
canvas.removeChild(_local2);
};
arrowPointingArr = new Array();
}
private function showDialog():void{
switch (Stats.gameMode){
case GameModes.NORMAL:
if (Stats.reTry){
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain bobulous defeat the enemy!", 1, true, 3);
} else {
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("All our troops have been defeated!", 1, false);
timerDialog = new TimerEx(1, 2, onTimerDialog1);
timerDialog.start();
};
break;
case GameModes.HARD:
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Captain bobulous,' \neradicate the enemy!", 1, true);
timerDialog = new TimerEx(1, 4, onTimerDialog1);
timerDialog.start();
break;
case GameModes.VERY_HARD:
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("This is the last battle captain!", 1, true);
timerDialog = new TimerEx(1, 3, onTimerDialog1);
timerDialog.start();
break;
case GameModes.CREDITS:
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Captain bobulous, the universe\nis now safe thanks to you.", 1, false);
timerDialog = new TimerEx(1, 5, onTimerDialog1);
timerDialog.start();
break;
};
}
public function setCounterTime(_arg1:Number):void{
var _local2:int = _arg1;
if (lastSeconds > _local2){
lastSeconds = _local2;
if (_local2 <= 10){
mc.counter.gotoAndPlay(2);
};
} else {
if (lastSeconds == -1){
lastSeconds = _local2;
};
};
var _local3:int = ((_arg1 - _local2) * 100);
if (_local3 >= 10){
mc.counter.counter_tf.tf.text = ((_local2.toString() + ":") + _local3.toString());
} else {
mc.counter.counter_tf.tf.text = ((_local2.toString() + ":0") + _local3.toString());
};
}
public function removeGetIn2():void{
var _local1:int;
while (_local1 < canvas.numChildren) {
if (canvas.getChildAt(_local1) == getIn2){
canvas.removeChild(getIn2);
getIn2.stop();
getIn2.visible = false;
break;
};
_local1++;
};
}
public function onPlayerDead():void{
deactivateProgressBarTweens();
if (getIn.visible){
canvas.removeChild(getIn);
getIn.stop();
getIn.visible = false;
};
if (getIn2.visible){
canvas.removeChild(getIn2);
getIn2.stop();
getIn2.visible = false;
};
removeArrowPointing("shell");
}
override public function resume():void{
var _local1:MovieClipEx;
super.resume();
bonusScore.resume();
dangerCenterAsset.resume();
dangerUpAsset.resume();
dangerDownAsset.resume();
if (tweenFullScoreBar){
tweenFullScoreBar.resume();
};
if (tweenReadyToEvolve){
tweenReadyToEvolve.resume();
};
Dialogs(root.getDescendantById(Components.DIALOGS)).resume();
for each (_local1 in arrowPointingArr) {
_local1.resume();
};
getIn.resume();
getIn2.resume();
timerMsg1.resume();
timerMsg0.resume();
if (timerDialog){
timerDialog.resume();
};
}
private function onDangerCenterComplete(_arg1:Event):void{
dangerCenterCounter++;
if (dangerCenterCounter == 3){
mc.danger_center.visible = false;
mc.danger_center.removeEventListener("complete", onDangerCenterComplete);
} else {
dangerCenterAsset.gotoAndPlay(2);
};
}
private function ong5glogoClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gimme5games.com/?ref=bobulous_INGAMELOGO"));
}
private function onTimerMsg1():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("You are now stronger and\ncan eat bigger enemies!", 1, true, 3.5);
}
override protected function onEnter(_arg1:Screen):void{
if ((((Stats.gameMode == GameModes.NORMAL)) || ((Stats.gameMode == GameModes.HARD)))){
mc.Lives.face_1.visible = true;
mc.Lives.face_2.visible = true;
mc.Lives.face_4.visible = true;
mc.Lives.face_5.visible = true;
mc.Lives.face_1.gotoAndStop("full");
mc.Lives.face_2.gotoAndStop("full");
mc.Lives.face_3.gotoAndStop("full");
mc.Lives.face_4.gotoAndStop("empty");
mc.Lives.face_5.gotoAndStop("empty");
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
mc.Lives.face_1.visible = false;
mc.Lives.face_2.visible = true;
mc.Lives.face_4.visible = true;
mc.Lives.face_5.visible = false;
mc.Lives.face_2.gotoAndStop("full");
mc.Lives.face_3.gotoAndStop("empty");
mc.Lives.face_4.gotoAndStop("empty");
} else {
mc.Lives.face_1.visible = false;
mc.Lives.face_2.visible = false;
mc.Lives.face_4.visible = false;
mc.Lives.face_5.visible = false;
mc.Lives.face_3.gotoAndStop("full");
};
};
if (Stats.addLifeSecret){
Stats.addLifeSecret = false;
mc.Lives.plus.gotoAndStop("full");
} else {
mc.Lives.plus.gotoAndStop("empty");
};
currentLives = Stats.lives;
updateScore();
mc.progress_bar_container.bar.bar_mask.x = (59.8 - mc.progress_bar_container.bar.bar_mask.width);
mc.progress_bar_container.bar.bar_masked.gotoAndStop(1);
mc.readyToEvolve.visible = false;
mc.maxEvolution.visible = false;
mc.energyMax.visible = false;
mc.blueEnergyMax.visible = false;
mc.readyToEvolve.gotoAndStop(1);
mc.danger_center.visible = false;
dangerCenterAsset.gotoAndStop(1);
mc.danger_down.visible = false;
dangerDownAsset.gotoAndStop(1);
mc.danger_up.visible = false;
dangerUpAsset.gotoAndStop(1);
mc.counter.visible = false;
mc.avoid.gotoAndStop(1);
mc.avoid.container.gotoAndStop(1);
executeTransition("addDialogs");
TimerEx.start(1, 1, showDialog);
finalGuiElementsRemoved = false;
lastSeconds = -1;
blueEnergyCount = 0;
}
public function updateLives():void{
var _local2:MovieClip;
var _local1:Boolean;
if (Stats.lives > currentLives){
_local1 = true;
SoundManager.getInstance().playSound("player_wins_life", SoundGroups.GAME_SOUNDS);
} else {
_local1 = false;
};
currentLives = Stats.lives;
if ((((Stats.gameMode == GameModes.NORMAL)) || ((Stats.gameMode == GameModes.HARD)))){
if (_local1){
if (mc.Lives.plus.currentLabel == "full"){
_local2 = mc.Lives.plus;
if (Stats.lives == 3){
_local2 = mc.Lives.face_2;
} else {
if (Stats.lives == 4){
_local2 = mc.Lives.face_3;
} else {
if (Stats.lives == 5){
_local2 = mc.Lives.face_4;
} else {
if (Stats.lives == 6){
_local2 = mc.Lives.face_5;
};
};
};
};
} else {
if (Stats.lives == 2){
_local2 = mc.Lives.face_2;
} else {
if (Stats.lives == 3){
_local2 = mc.Lives.face_3;
} else {
if (Stats.lives == 4){
_local2 = mc.Lives.face_4;
} else {
if (Stats.lives == 5){
_local2 = mc.Lives.face_5;
};
};
};
};
};
} else {
if (mc.Lives.plus.currentLabel == "full"){
_local2 = mc.Lives.plus;
} else {
if (Stats.lives == 0){
_local2 = mc.Lives.face_1;
} else {
if (Stats.lives == 1){
_local2 = mc.Lives.face_2;
} else {
if (Stats.lives == 2){
_local2 = mc.Lives.face_3;
} else {
if (Stats.lives == 3){
_local2 = mc.Lives.face_4;
} else {
if (Stats.lives == 4){
_local2 = mc.Lives.face_5;
};
};
};
};
};
};
};
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
if (_local1){
if (mc.Lives.plus.currentLabel == "full"){
if (Stats.lives == 3){
_local2 = mc.Lives.face_3;
} else {
if (Stats.lives == 4){
_local2 = mc.Lives.face_4;
};
};
} else {
if (Stats.lives == 2){
_local2 = mc.Lives.face_3;
} else {
if (Stats.lives == 3){
_local2 = mc.Lives.face_4;
};
};
};
} else {
if (mc.Lives.plus.currentLabel == "full"){
_local2 = mc.Lives.plus;
} else {
if (Stats.lives == 0){
_local2 = mc.Lives.face_2;
} else {
if (Stats.lives == 1){
_local2 = mc.Lives.face_3;
} else {
if (Stats.lives == 2){
_local2 = mc.Lives.face_4;
};
};
};
};
};
};
};
if (_local1){
_local2.gotoAndPlay("win");
} else {
_local2.gotoAndPlay("lose");
};
}
private function onHideUnlockedMsg():void{
unlockedMsg.gotoAndPlay("exit");
}
private function onEnergyGathered(_arg1:EventValue):void{
var _local2:Number;
if (Stats.gameMode == GameModes.VERY_HARD){
return;
};
if (Stats.gameMode == GameModes.NORMAL){
if (_arg1.value == 1){
_local2 = 0.33;
} else {
if (_arg1.value == 2){
_local2 = 0.66;
} else {
if (_arg1.value == 3){
_local2 = 1;
tweenEnergyMax = new TweenMax(mc.energyMax, 0.4, {colorMatrixFilter:{brightness:1.4}, glow:{color:0xFFFFFF, blurX:5, blurY:5, strength:3, ease:Quad.easeIn}, yoyo:true});
mc.energyMax.visible = true;
};
};
};
} else {
if (Stats.gameMode == GameModes.HARD){
if (_arg1.value == 1){
_local2 = 0.2;
} else {
if (_arg1.value == 2){
_local2 = 0.4;
} else {
if (_arg1.value == 3){
_local2 = 0.6;
} else {
if (_arg1.value == 4){
_local2 = 0.8;
} else {
if (_arg1.value == 5){
_local2 = 1;
tweenEnergyMax = new TweenMax(mc.energyMax, 0.4, {colorMatrixFilter:{brightness:1.4}, glow:{color:0xFFFFFF, blurX:5, blurY:5, strength:3, ease:Quad.easeIn}, yoyo:true});
mc.energyMax.visible = true;
};
};
};
};
};
};
};
TweenMax.to(mc.progress_bar_container.bar.bar_mask, 0.4, {x:((59.8 - mc.progress_bar_container.bar.bar_mask.width) + (_local2 * mc.progress_bar_container.bar.bar_mask.width))});
tweenScoreBar = new TweenMax(mc.progress_bar_container.bar.bar_masked, 0.2, {colorMatrixFilter:{brightness:1.5}, onComplete:revertBright});
}
private function onBlueEnergyGathered(_arg1:Event):void{
blueEnergyCount++;
var _local2:Number = (blueEnergyCount / 67);
TweenMax.to(mc.progress_bar_container.bar.bar_mask, 0.4, {x:((59.8 - mc.progress_bar_container.bar.bar_mask.width) + (_local2 * mc.progress_bar_container.bar.bar_mask.width))});
tweenScoreBar = new TweenMax(mc.progress_bar_container.bar.bar_masked, 0.2, {colorMatrixFilter:{brightness:1.5}, onComplete:revertBright});
if (blueEnergyCount == 67){
mc.blueEnergyMax.visible = true;
};
}
public function showSurvivalUnlockedMsg():void{
TimerEx.start(1, 5, onHideUnlockedMsg);
unlockedMsg.gotoAndPlay("enter");
unlockedMsg.panel.gotoAndStop(3);
unlockedMsg.visible = true;
}
public function enableFinalDanger():void{
dangerCenterCounter = 0;
dangerUpCounter = 0;
dangerDownCounter = 0;
mc.danger_center.visible = true;
dangerCenterAsset.gotoAndPlay(1);
mc.danger_down.visible = true;
dangerDownAsset.gotoAndPlay(1);
mc.danger_up.visible = true;
dangerUpAsset.gotoAndPlay(1);
mc.danger_down.addEventListener("complete", onDangerDownComplete);
mc.danger_up.addEventListener("complete", onDangerUpComplete);
mc.danger_center.addEventListener("complete", onDangerCenterComplete);
}
public function showCounter():void{
mc.counter.visible = true;
mc.counter.alpha = 0;
TweenMax.to(mc.counter, 1, {alpha:1});
}
public function updateScore():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:int;
var _local5:int;
if (Stats.score < 10000000){
_local1 = 1;
_local2 = Stats.score;
_local3 = "0000000";
_local4 = _local3.length;
_local5 = 0;
while (_local5 < (_local4 + 1)) {
_local2 = (_local2 * 0.1);
if (_local2 < 1){
break;
} else {
_local1++;
_local3 = _local3.slice(1, _local3.length);
};
_local5++;
};
TextField(mc.Score.score_txt).text = (_local3 + String(Stats.score));
} else {
TextField(mc.Score.score_txt).text = String(Stats.score);
};
}
public function showHardUnlockedMsg():void{
TimerEx.start(1, 4, onHideUnlockedMsg);
unlockedMsg.gotoAndPlay("enter");
unlockedMsg.panel.gotoAndStop(1);
unlockedMsg.visible = true;
}
public function vibrateAvoid():void{
mc.avoid.gotoAndPlay("vibrate");
}
public function removeAvoid():void{
mc.gotoAndPlay("removeAvoid");
}
private function onCounterHided():void{
mc.counter.visible = false;
}
public function playerGrows():void{
mc.avoid.gotoAndPlay("evolution");
mc.avoid.container.play();
deactivateProgressBarTweens();
if (Stats.playerLevel < 6){
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
mc.progress_bar_container.bar.bar_masked.gotoAndStop(8);
} else {
mc.progress_bar_container.bar.bar_masked.gotoAndStop(1);
};
};
mc.progress_bar_container.bar.bar_mask.x = (61 - mc.progress_bar_container.bar.bar_mask.width);
if (getIn2.visible){
canvas.removeChild(getIn2);
getIn2.stop();
getIn2.visible = false;
};
removeArrowPointing("shell");
if ((((Stats.playerLevel == 2)) && ((Stats.gameMode == GameModes.NORMAL)))){
timerMsg0.start();
} else {
if ((((Stats.playerLevel == 4)) && ((Stats.gameMode == GameModes.NORMAL)))){
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain! You almost defeated the\nenemy on this space station!", 1, true, 4);
};
};
}
private function onTimerDialog1():void{
switch (Stats.gameMode){
case GameModes.NORMAL:
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("you are our last hope!", false);
timerDialog = new TimerEx(1, 3, onTimerDialog2);
timerDialog.start();
break;
case GameModes.HARD:
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("at your command princess!", 2, true, 2, 0.8);
break;
case GameModes.VERY_HARD:
break;
case GameModes.CREDITS:
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("please wait there until the \nspaceship is ready.", 1, true);
break;
};
}
public function showVeryHardUnlockedMsg():void{
TimerEx.start(1, 5, onHideUnlockedMsg);
unlockedMsg.gotoAndPlay("enter");
unlockedMsg.panel.gotoAndStop(2);
unlockedMsg.visible = true;
}
public function hideCounter(_arg1:Boolean=false):void{
if (_arg1){
TweenMax.to(mc.counter, 1, {delay:0.5, alpha:0, onComplete:onCounterHided});
} else {
mc.counter.visible = false;
};
}
private function onTimerDialog2():void{
switch (Stats.gameMode){
case GameModes.NORMAL:
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain bobulous, defeat the enemy!", 1, true, 2);
break;
case GameModes.HARD:
break;
case GameModes.VERY_HARD:
break;
case GameModes.CREDITS:
break;
};
}
public function removeArrowPointing(_arg1:String):void{
if (arrowPointingArr[_arg1]){
canvas.removeChild(arrowPointingArr[_arg1]);
delete arrowPointingArr[_arg1];
};
}
private function onBonusScore(_arg1:EventValue):void{
var _local2:YellowEnergyAsset = bonusScore.createYellowLights(_arg1.value.score, _arg1.value.x, _arg1.value.y);
mc.addChild(_local2);
}
override public function pause():void{
var _local1:MovieClipEx;
super.pause();
bonusScore.pause();
dangerCenterAsset.pause();
dangerUpAsset.pause();
dangerDownAsset.pause();
if (tweenFullScoreBar){
tweenFullScoreBar.pause();
};
if (tweenReadyToEvolve){
tweenReadyToEvolve.pause();
};
Dialogs(root.getDescendantById(Components.DIALOGS)).pause();
for each (_local1 in arrowPointingArr) {
_local1.pause();
};
getIn.pause();
getIn2.pause();
timerMsg1.pause();
timerMsg0.pause();
if (timerDialog){
timerDialog.pause();
};
}
public function addGetIn(_arg1:Number, _arg2:Number):void{
canvas.addChild(getIn);
getIn.gotoAndPlay(1);
getIn.x = _arg1;
getIn.y = _arg2;
getIn.visible = true;
}
private function onDangerDownComplete(_arg1:Event):void{
dangerDownCounter++;
if (dangerDownCounter == 3){
mc.danger_down.visible = false;
mc.danger_down.removeEventListener("complete", onDangerDownComplete);
} else {
dangerDownAsset.gotoAndPlay(2);
};
}
private function revertBright():void{
tweenScoreBar = new TweenMax(mc.progress_bar_container.bar.bar_masked, 0.3, {colorMatrixFilter:{brightness:1}});
}
}
}//package _game._gui
Section 12
//LifeUp (_game._gui.LifeUp)
package _game._gui {
import flash.events.*;
import assets.gui.*;
public class LifeUp {
private var pool:Array;
private var active:Array;
public function LifeUp(){
pool = new Array();
active = new Array();
super();
}
public function resume():void{
var _local1:int;
while (_local1 < active.length) {
LivesUpAsset(active[_local1]).resume();
_local1++;
};
}
public function pause():void{
var _local1:int;
while (_local1 < active.length) {
LivesUpAsset(active[_local1]).pause();
_local1++;
};
}
public function createLivesUp(_arg1:int, _arg2:int):LivesUpAsset{
var _local3:LivesUpAsset;
if (pool.length > 0){
_local3 = LivesUpAsset(pool.shift());
} else {
_local3 = new LivesUpAsset();
};
_local3.gotoAndPlay("start");
_local3.x = _arg1;
_local3.y = _arg2;
_local3.visible = true;
_local3.addEventListener("end", onEnd);
active.push(_local3);
return (_local3);
}
private function onEnd(_arg1:Event):void{
var _local2:LivesUpAsset = LivesUpAsset(_arg1.target);
_local2.removeEventListener("end", onEnd);
pool.push(_local2);
var _local3:int = active.indexOf(_local2);
if (_local3 != -1){
active.splice(_local3, 1);
};
}
}
}//package _game._gui
Section 13
//InGameMenu (_game._inGameMenu.InGameMenu)
package _game._inGameMenu {
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._sound.*;
import framework._core.*;
import _game._stats.*;
import framework._input.*;
import assets.*;
import _game._gui.*;
import _components.*;
import _sound.*;
import _game.*;
import _events.*;
public class InGameMenu extends Screen implements IUpdateable {
private var movingSoundSlider:Boolean;// = false
public var mc:InGameMenuAsset;
private var movingMusicSlider:Boolean;// = false
public function InGameMenu():void{
mc = new InGameMenuAsset();
super();
id = Components.INGAME_MENU;
canvas.addChild(mc);
mc.container.resumeBtn.addEventListener(MouseEvent.ROLL_OVER, onBtnRollOver);
mc.container.quitBtn.addEventListener(MouseEvent.ROLL_OVER, onBtnRollOver);
mc.container.resumeBtn.addEventListener(MouseEvent.CLICK, onResumeBtnClick);
mc.container.quitBtn.addEventListener(MouseEvent.CLICK, onQuitBtnClick);
mc.container.sound_slider.addEventListener(MouseEvent.MOUSE_DOWN, onSoundSliderMouseDown);
mc.container.music_slider.addEventListener(MouseEvent.MOUSE_DOWN, onMusicSliderMouseDown);
mc.container.mute_sound.addEventListener(MouseEvent.MOUSE_DOWN, onMuteSoundMouseDown);
mc.container.mute_music.addEventListener(MouseEvent.MOUSE_DOWN, onMuteMusicMouseDown);
mc.container.tick_sound.mouseEnabled = false;
mc.container.tick_music.mouseEnabled = false;
mc.container.mouse_btn.addEventListener(MouseEvent.CLICK, onMouseBtnClick);
mc.container.keyboard_btn.addEventListener(MouseEvent.CLICK, onKeyboardBtnClick);
}
private function onMusicSliderMouseDown(_arg1:MouseEvent):void{
movingMusicSlider = true;
}
private function onMuteSoundMouseDown(_arg1:MouseEvent):void{
if (mc.container.tick_sound.visible){
mc.container.tick_sound.visible = false;
SoundManager.getInstance().setGroupMute(SoundGroups.GAME_SOUNDS, true);
SoundManager.getInstance().setGroupMute(SoundGroups.SPLASH_SOUNDS, true);
} else {
mc.container.tick_sound.visible = true;
SoundManager.getInstance().setGroupMute(SoundGroups.GAME_SOUNDS, false);
SoundManager.getInstance().setGroupMute(SoundGroups.SPLASH_SOUNDS, false);
};
}
private function onSoundSliderMouseDown(_arg1:MouseEvent):void{
movingSoundSlider = true;
}
private function onMouseUp(_arg1:MouseEvent):void{
if (movingSoundSlider){
movingSoundSlider = false;
SoundManager.getInstance().playSound("bump_wall", SoundGroups.GAME_SOUNDS);
};
movingMusicSlider = false;
}
public function update():void{
if (keyDown(Keys.ESC)){
executeTransition("Resume");
deactivate();
};
}
private function onKeyboardBtnClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
mc.container.mouse_btn.visible = true;
mc.container.keyboard_btn.visible = false;
Stats.useMouse = true;
GlobalDispatcher.dispatchEvent(new Event(GameEvents.CONTROLLER_CHANGED));
}
private function onBtnRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
}
override protected function onInitialize(_arg1:String):void{
activate();
}
private function onMouseBtnClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
mc.container.mouse_btn.visible = false;
mc.container.keyboard_btn.visible = true;
Stats.useMouse = false;
GlobalDispatcher.dispatchEvent(new Event(GameEvents.CONTROLLER_CHANGED));
}
override protected function onFinalize(_arg1:String):void{
if (_arg1 == "Resume"){
Gui(parent.getChildById(Components.GUI)).resume();
Game(parent.getChildById(Components.GAME)).resumeRecursively();
canvas.stage.focus = null;
} else {
if (_arg1 == "Quit"){
Gui(parent.getChildById(Components.GUI)).resume();
Game(parent.getChildById(Components.GAME)).resumeRecursively();
Game(parent.getChildById(Components.GAME)).gameOver();
};
};
}
private function onMouseMove(_arg1:MouseEvent):void{
if (movingSoundSlider){
mc.container.sound_slider.x = (canvas.mouseX - mc.container.x);
if (mc.container.sound_slider.x < mc.container.sound_line.x){
mc.container.sound_slider.x = mc.container.sound_line.x;
} else {
if (mc.container.sound_slider.x > (mc.container.sound_line.x + mc.container.sound_line.width)){
mc.container.sound_slider.x = (mc.container.sound_line.x + mc.container.sound_line.width);
};
};
Stats.soundVolume = ((mc.container.sound_slider.x - mc.container.sound_line.x) / mc.container.sound_line.width);
SoundManager.getInstance().setGroupVolume(SoundGroups.GAME_SOUNDS, Stats.soundVolume);
SoundManager.getInstance().setGroupVolume(SoundGroups.SPLASH_SOUNDS, Stats.soundVolume);
} else {
if (movingMusicSlider){
mc.container.music_slider.x = (canvas.mouseX - mc.container.x);
if (mc.container.music_slider.x < mc.container.music_line.x){
mc.container.music_slider.x = mc.container.music_line.x;
} else {
if (mc.container.music_slider.x > (mc.container.music_line.x + mc.container.music_line.width)){
mc.container.music_slider.x = (mc.container.music_line.x + mc.container.music_line.width);
};
};
Stats.musicVolume = ((mc.container.music_slider.x - mc.container.music_line.x) / mc.container.music_line.width);
SoundManager.getInstance().setGroupVolume(SoundGroups.GAME_MUSIC, Stats.musicVolume);
SoundManager.getInstance().setGroupVolume(SoundGroups.SPLASH_MUSIC, Stats.musicVolume);
};
};
}
private function onResumeBtnClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
executeTransition("Resume");
}
override protected function onEnter(_arg1:Screen):void{
mc.container.sound_slider.x = (mc.container.sound_line.x + (mc.container.sound_line.width * Stats.soundVolume));
mc.container.music_slider.x = (mc.container.music_line.x + (mc.container.music_line.width * Stats.musicVolume));
canvas.stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
canvas.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
if (Stats.useMouse){
mc.container.mouse_btn.visible = true;
mc.container.keyboard_btn.visible = false;
} else {
mc.container.mouse_btn.visible = false;
mc.container.keyboard_btn.visible = true;
};
}
private function onQuitBtnClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
executeTransition("Quit");
}
private function onMuteMusicMouseDown(_arg1:MouseEvent):void{
if (mc.container.tick_music.visible){
mc.container.tick_music.visible = false;
SoundManager.getInstance().setGroupMute(SoundGroups.GAME_MUSIC, true);
SoundManager.getInstance().setGroupMute(SoundGroups.SPLASH_MUSIC, true);
} else {
mc.container.tick_music.visible = true;
SoundManager.getInstance().setGroupMute(SoundGroups.GAME_MUSIC, false);
SoundManager.getInstance().setGroupMute(SoundGroups.SPLASH_MUSIC, false);
};
}
override protected function onExit(_arg1:String):void{
canvas.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
canvas.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
}
}//package _game._inGameMenu
Section 14
//FinalLevel (_game._levels.FinalLevel)
package _game._levels {
import _game._phase.*;
public class FinalLevel extends LevelPhases {
public function FinalLevel():void{
name = "Credits";
}
override public function createLevel():void{
super.createLevel();
pointsToEvolve = [0, 280];
phaseManager.addingPhaseLevel = 0;
addPhaseEnemies(0, 7);
addPhaseEnemies(0.1, 10);
addPhaseEnemies(0.2, 15);
addPhaseEnemies(0.3, 20);
addPhaseEnemyGenerateTime(0, false, 0.1, 0.2);
var _local1:PhaseItem = addPhaseItem(0.02, 0, "bomb", 8, 12);
addPhaseItem(0.35, (1 + (Math.random() * 1)), "superBomb", 8, 9);
addPhaseItem(0.35, (1 + (Math.random() * 1)), "superBomb", 8, 11);
addPhaseItem(0.35, (1 + (Math.random() * 1)), "superBomb", 8, 12);
addPhaseBonusScore(0.1, 0, 8, 10, 14);
addPhaseBonusScore(0.25, 0, 14, 16, 14);
addPhaseBonusScore(0.45, 0.5, 12, 13, 14);
addPhaseBonusScore(0.6, 0, 30, 30, 20);
addPhaseBonusScore(0.85, 0, 67, 67, -1);
}
}
}//package _game._levels
Section 15
//Hard (_game._levels.Hard)
package _game._levels {
import _game._world._meteors.*;
import _game._phase.*;
public class Hard extends LevelPhases {
public function Hard(){
name = "Hard";
}
override public function createLevel():void{
super.createLevel();
pointsToEvolve = [0, 21, 75, 120, 270, 340];
phaseManager.addingPhaseLevel = 0;
addPhaseEnemies(0, 3);
addPhaseEnemies(0.1, 3, 1);
addPhaseEnemies(0.2, 4, 4);
addPhaseEnemies(0.3, 4, 6);
addPhaseEnemyGenerateTime(0, false, 0.3, 0.5);
addPhaseEnemyGenerateTime(0.1, true, 1.5, 0.7);
addPhaseEnemyGenerateTime(0.4, false, 0.8, 1.5);
addPhaseBonusScore((0.3 + (Math.random() * 0.1)), 1, 8, 10, 10);
phaseManager.addingPhaseLevel = 1;
addPhaseEnemies(0, 4, 5, 3);
addPhaseEnemies(0.1, 4, 5, 5);
addPhaseEnemies(0.15, 4, 5, 8);
addPhaseEnemyGenerateTime(0.3, false, 1, 0.3);
addPhaseEnemyGenerateTime(0.1, true, 1.3, 0.7);
addPhaseItem(0.5, (2 + (Math.random() * 2)), "superBomb", 80, 100);
var _local1:PhaseItem = addPhaseItem(0.05, 2, "bomb", 18, 23);
removeContinuousPhase(1, 0, _local1);
addPhaseBonusScore(0.15, 3, 13, 16, 15);
addPhaseBonusScore(0.75, 3, 7, 10, 11);
addPhaseMeteors(0.25, 0.5, MeteorShower.LINE_CENTER, 4, 4);
addPhaseMeteors(0.7, 0.5, MeteorShower.LINES_UP_DOWN, 5, 9);
phaseManager.addingPhaseLevel = 2;
addPhaseEnemies(0, 3, 5, 5, 4);
addPhaseEnemies(0.07, 2, 4, 5, 6);
addPhaseEnemies(0.15, 2, 4, 5, 8);
addPhaseEnemyGenerateTime(0, false, 0.7, 0.3);
addPhaseEnemyGenerateTime(0.35, true, 1.3, 0.3);
var _local2:PhaseItem = addPhaseItem(0.05, 3, "bomb", 25, 30);
removeContinuousPhase(1, 0, _local2);
addPhaseBonusScore(0.6, 4, 6, 9, 13);
addPhaseLife(0.4, 0, 10, 13);
var _local3:PhaseSpikes = addPhaseSpikes(0.2, 3, 6, 8, 4, 11);
var _local4:PhaseSpikes = addPhaseSpikes(0.4, 1, 9, 12, 5, 20);
phaseManager.addingPhaseLevel = 3;
removeContinuousPhase(0, 0, _local3);
removeContinuousPhase(0, 0, _local4);
addPhaseEnemies(0, 1, 3, 5, 5, 4);
addPhaseEnemies(0.07, 1, 3, 4, 5, 5);
addPhaseEnemies(0.15, 1, 3, 4, 5, 7);
addPhaseLife((0.45 + (Math.random() * 0.05)), 12, 13, 10);
var _local5:PhaseItem = addPhaseItem(0.05, 3, "bomb", 22, 30);
removeContinuousPhase(1, 0, _local5);
addPhaseEnemyGenerateTime(0.35, true, 1.5, 0.75);
addPhaseEnemyGenerateTime(0.5, false, 0.55, 0.3);
addPhaseBonusScore(0, 10, 8, 8, 10);
addPhaseBonusScore(0.8, 10, 8, 15, 17);
var _local6:PhaseSpikes = addPhaseSpikes(0.35, 1, 4, 7, 4, 15);
addPhaseMeteors(0, 1, MeteorShower.LINE_CENTER, 4.8, 3);
if (Math.random() < 0.5){
addPhaseMeteors(0, 7.5, MeteorShower.LINES_CENTER_DOWN, 4.8, 3);
addPhaseMeteors(0, 14, MeteorShower.LINES_UP_CENTER, 5, 3);
addPhaseMeteors(0, 22, MeteorShower.LINE_CENTER, 5, 5);
} else {
addPhaseMeteors(0, 7.5, MeteorShower.LINES_UP_CENTER, 4.8, 3);
addPhaseMeteors(0, 14, MeteorShower.LINES_CENTER_DOWN, 5, 3);
addPhaseMeteors(0, 22, MeteorShower.LINE_CENTER, 5, 5);
};
phaseManager.addingPhaseLevel = 4;
addPhaseEnemyGenerateTime(0, true, 1.25, 0.75);
removeContinuousPhase(0, 0, _local6);
addPhaseEnemies(0, 0, 2, 4, 5, 7, 3);
addPhaseEnemies(0.07, 0, 2, 4, 5, 7, 5);
addPhaseEnemies(0.15, 0, 2, 4, 5, 7, 7);
var _local7:PhaseItem = addPhaseItem(0.05, 3, "bomb", 22, 30);
removeContinuousPhase(1, 0, _local7);
addPhaseBonusScore(0.75, 8, 6, 9, 16);
if (Math.random() > 0.5){
addPhaseMeteors(0.07, 1, MeteorShower.LINE_UP, 5, 4);
addPhaseMeteors(0.23, 2, MeteorShower.LINE_DOWN, 5, 4);
} else {
addPhaseMeteors(0.07, 1, MeteorShower.LINE_DOWN, 5, 4);
addPhaseMeteors(0.23, 2, MeteorShower.LINE_UP, 5, 4);
};
if (Math.random() > 0.5){
addPhaseMeteors(0.42, 2, MeteorShower.LINES_CENTER_DOWN, 5, 10);
} else {
addPhaseMeteors(0.42, 2, MeteorShower.LINES_UP_CENTER, 5, 10);
};
addPhaseMeteors(0.67, 3, MeteorShower.LINES_UP_DOWN, 5, 5);
var _local8:PhaseMeteors = addPhaseMeteors(0.9, 0, MeteorShower.CIRCLE, 5, 8, 12, 15);
}
}
}//package _game._levels
Section 16
//Normal2 (_game._levels.Normal2)
package _game._levels {
import _game._phase.*;
public class Normal2 extends LevelPhases {
public function Normal2():void{
name = "Normal";
}
override public function createLevel():void{
super.createLevel();
pointsToEvolve = [0, 15, 65, 110, 210, 250];
phaseManager.addingPhaseLevel = 0;
addPhaseEnemies(0, 3);
addPhaseEnemies(0.1, 3, 1);
addPhaseEnemies(0.2, 4, 2);
addPhaseEnemies(0.4, 4, 4);
addPhaseEnemyGenerateTime(0, false, 0.3, 0.5);
addPhaseEnemyGenerateTime(0.1, true, 2, 1);
addPhaseEnemyGenerateTime(0.4, false, 0.8, 1.5);
phaseManager.addingPhaseLevel = 1;
addPhaseEnemies(0, 4, 5, 2);
addPhaseEnemies(0.1, 4, 5, 3);
addPhaseEnemies(0.15, 4, 5, 6);
addPhaseEnemyGenerateTime(0, false, 0.6, 0.3);
var _local1:PhaseItem = addPhaseItem(0.55, 3, "bomb", 25, 30);
removeContinuousPhase(1, 0, _local1);
addPhaseBonusScore(0.3, 2, 5, 8, 14);
phaseManager.addingPhaseLevel = 2;
addPhaseEnemies(0, 3, 5, 5, 2);
addPhaseEnemies(0.07, 2, 4, 5, 3);
addPhaseEnemies(0.15, 2, 4, 5, 5);
addPhaseLife(0.7, 0, 5, 10);
addPhaseEnemyGenerateTime(0.35, true, 1.5, 1);
var _local2:PhaseItem = addPhaseItem(0.05, 3, "bomb", 30, 40);
removeContinuousPhase(1, 0, _local2);
addPhaseBonusScore(0.2, 1, 6, 9, 16);
addPhaseBonusScore(0.7, 1, 8, 11, 16);
var _local3:PhaseSpikes = addPhaseSpikes(0.2, 3, 6, 8, 3, 11);
var _local4:PhaseSpikes = addPhaseSpikes(0.4, 1, 7, 9, 6, 22);
phaseManager.addingPhaseLevel = 3;
removeContinuousPhase(0, 0, _local3);
removeContinuousPhase(0, 0, _local4);
addPhaseEnemies(0, 1, 3, 5, 5, 2);
addPhaseEnemies(0.07, 1, 3, 4, 5, 4);
addPhaseEnemies(0.15, 1, 3, 4, 5, 7);
addPhaseLife((0.1 + (Math.random() * 0.05)), 5, 7, 10);
var _local5:PhaseItem = addPhaseItem(0.05, 3, "bomb", 22, 30);
removeContinuousPhase(1, 0, _local5);
addPhaseEnemyGenerateTime(0.35, true, 1.5, 0.75);
addPhaseEnemyGenerateTime(0.5, false, 0.55, 0.3);
addPhaseBonusScore(0.15, 1, 6, 9, 16);
addPhaseBonusScore(0.6, 1, 12, 12, 14);
var _local6:PhaseSpikes = addPhaseSpikes(0.15, 3, 8, 11, 4, 25);
var _local7:PhaseSpikes = addPhaseSpikes(0.35, 1, 4, 7, 4, 15);
var _local8:PhaseSpikes = addPhaseSpikes(0.6, 2, 11, 15, 6, 11);
removeContinuousPhase(0.9, 0, _local8);
phaseManager.addingPhaseLevel = 4;
addPhaseEnemyGenerateTime(0, true, 1.25, 0.75);
removeContinuousPhase(0, 0, _local6);
removeContinuousPhase(0, 0, _local7);
addPhaseEnemies(0, 0, 2, 4, 5, 7, 2);
addPhaseEnemies(0.07, 0, 2, 4, 5, 7, 5);
addPhaseEnemies(0.15, 0, 2, 4, 5, 7, 7);
var _local9:PhaseItem = addPhaseItem(0.05, 3, "bomb", 22, 30);
removeContinuousPhase(1, 0, _local9);
addPhaseBonusScore(0.75, 1, 6, 9, 16);
}
}
}//package _game._levels
Section 17
//VeryHard (_game._levels.VeryHard)
package _game._levels {
import _game._world._meteors.*;
import _game._phase.*;
public class VeryHard extends LevelPhases {
public function VeryHard(){
name = "VeryHard";
}
override public function createLevel():void{
super.createLevel();
pointsToEvolve = [0, 50, 100, 185, 270, 340];
phaseManager.addingPhaseLevel = 0;
addPhaseEnemies(0, 0, 13);
var _local1:PhaseItem = addPhaseItem(0, 7, "bomb", 5, 5.5);
addPhaseEnemyGenerateTime(0, false, 0.3, 0.5);
addPhaseEnemyGenerateTime(0, true, 0.4, 0.5);
addPhaseEnemyGenerateTime(0.4, false, 0.8, 1.5);
var _local2:PhaseSpikes = addPhaseSpikes(0, 5, 7, 10, 5, 7);
var _local3:PhaseSpikes = addPhaseSpikes(0, 7, 7, 10, 5, 7);
addPhaseBonusScore(0.8, 1, 8, 10, 10);
phaseManager.addingPhaseLevel = 1;
removeContinuousPhase(0, 0, _local1);
removeContinuousPhase(0, 1, _local2);
removeContinuousPhase(0, 1, _local3);
addPhaseEnemies(0, 4, 5, 3);
addPhaseEnemies(0.1, 4, 5, 9);
addPhaseEnemyGenerateTime(0.3, false, 1, 0.3);
addPhaseEnemyGenerateTime(0.1, true, 1, 0.5);
addPhaseItem(0.5, 2, "superBomb", 80, 100);
var _local4:PhaseItem = addPhaseItem(0.05, 2, "bomb", 18, 23);
removeContinuousPhase(1, 0, _local4);
addPhaseBonusScore(0.15, 3, 13, 16, 15);
addPhaseBonusScore(0.75, 1, 7, 10, 13);
addPhaseLife(0.75, 1, 12, 15);
addPhaseMeteors(0.25, 0.5, MeteorShower.LINE_CENTER, 4, 4);
if (Math.random() < 0.33){
addPhaseMeteors(0.7, 0.5, MeteorShower.LINES_UP_DOWN, 5, 9);
} else {
if (Math.random() < 0.66){
addPhaseMeteors(0.7, 0.5, MeteorShower.LINES_UP_CENTER, 5, 9);
} else {
addPhaseMeteors(0.7, 0.5, MeteorShower.LINES_CENTER_DOWN, 5, 9);
};
};
phaseManager.addingPhaseLevel = 2;
var _local5:PhaseItem = addPhaseItem(0, 7, "bomb", 9, 10);
addPhaseEnemies(0, 5, 0, 0, 12);
addPhaseEnemyGenerateTime(0, false, 0.7, 0.3);
addPhaseEnemyGenerateTime(0, true, 0.4, 0.3);
addPhaseBonusScore(0.5, 2, 13, 17, 17);
addPhaseBonusScore(0.6, 1, 7, 9, 13);
addPhaseBonusScore(0.8, 0, 16, 20, 17);
var _local6:PhaseSpikes = addPhaseSpikes(0.1, 1, 9, 12, 5, 11);
var _local7:PhaseSpikes = addPhaseSpikes(0.2, 1, 9, 12, 5, 20);
var _local8:PhaseSpikes = addPhaseSpikes(0.3, 1, 9, 12, 5, 13);
var _local9:PhaseSpikes = addPhaseSpikes(0.4, 1, 9, 12, 5, 8);
phaseManager.addingPhaseLevel = 3;
removeContinuousPhase(0, 0, _local5);
removeContinuousPhase(0, 0, _local6);
removeContinuousPhase(0, 0, _local7);
removeContinuousPhase(0, 0, _local8);
removeContinuousPhase(0, 0, _local9);
addPhaseEnemies(0, 1, 3, 5, 5, 4);
addPhaseEnemies(0.07, 1, 3, 4, 5, 5);
addPhaseEnemies(0.15, 1, 3, 4, 5, 7);
addPhaseLife((0.45 + (Math.random() * 0.05)), 12, 13, 10);
var _local10:PhaseItem = addPhaseItem(0.05, 3, "bomb", 22, 30);
removeContinuousPhase(1, 0, _local10);
addPhaseEnemyGenerateTime(0.35, true, 1.5, 0.75);
addPhaseEnemyGenerateTime(0.5, false, 0.55, 0.3);
addPhaseBonusScore(0, 10, 8, 8, 10);
addPhaseBonusScore(0.8, 10, 8, 15, 17);
var _local11:PhaseSpikes = addPhaseSpikes(0.35, 1, 10, 12, 4, 15);
addPhaseMeteors(0.35, 1, MeteorShower.LINE_CENTER, 4.8, 3);
if (Math.random() < 0.5){
addPhaseMeteors(0.35, 7, MeteorShower.LINES_CENTER_DOWN, 4.8, 3);
addPhaseMeteors(0.35, 13, MeteorShower.LINES_UP_CENTER, 5, 3);
} else {
addPhaseMeteors(0.35, 7, MeteorShower.LINES_UP_CENTER, 4.8, 3);
addPhaseMeteors(0.35, 13, MeteorShower.LINES_CENTER_DOWN, 5, 3);
};
addPhaseMeteors(0.35, 18.5, MeteorShower.LINE_CENTER, 4.8, 5);
addPhaseMeteors(0.35, 24, MeteorShower.CIRCLE, 4, 9);
phaseManager.addingPhaseLevel = 4;
var _local12:PhaseItem = addPhaseItem(0, 7, "bomb", 10, 11);
addPhaseEnemyGenerateTime(0, true, 0.7, 0.4);
removeContinuousPhase(0, 0, _local11);
addPhaseEnemies(0, 5, 3, 0, 0, 0, 14);
addPhaseBonusScore(0.75, 8, 6, 9, 16);
addPhaseSpikes(0, 3, 5, 7, 4, 7);
if (Math.random() > 0.5){
addPhaseMeteors(0.07, 1, MeteorShower.LINE_UP, 5, 4);
addPhaseMeteors(0.23, 2, MeteorShower.LINE_DOWN, 5, 4);
} else {
addPhaseMeteors(0.07, 1, MeteorShower.LINE_DOWN, 5, 4);
addPhaseMeteors(0.23, 2, MeteorShower.LINE_UP, 5, 4);
};
if (Math.random() > 0.5){
addPhaseMeteors(0.42, 2, MeteorShower.LINES_CENTER_DOWN, 5, 10);
} else {
addPhaseMeteors(0.42, 2, MeteorShower.LINES_UP_CENTER, 5, 10);
};
addPhaseMeteors(0.67, 3, MeteorShower.LINES_UP_DOWN, 5, 5);
var _local13:PhaseMeteors = addPhaseMeteors(0.9, 0, MeteorShower.RANDOM_LINE, 5, 8, 12, 15);
}
}
}//package _game._levels
Section 18
//ContinuousPhase (_game._phase.ContinuousPhase)
package _game._phase {
import framework._utils._timer.*;
public class ContinuousPhase extends Phase {
public var maxContinuousTime:Number;
public var minContinuousTime:Number;
public var timerRef:TimerEx;
public function ContinuousPhase(_arg1:Number, _arg2:Number, _arg3:Number=0, _arg4:Number=0){
super(_arg1, _arg2);
this.minContinuousTime = _arg3;
this.maxContinuousTime = ((_arg4 == 0)) ? _arg3 : _arg4;
}
}
}//package _game._phase
Section 19
//LevelPhases (_game._phase.LevelPhases)
package _game._phase {
public class LevelPhases {
public var name:String;
protected var phaseManager:PhaseManager;
public var pointsToEvolve:Array;
protected function addPhaseLife(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number):void{
phaseManager.addPhaseLife(_arg1, _arg2, _arg3, _arg4);
}
protected function addPhaseSpikes(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number=0):PhaseSpikes{
return (phaseManager.addPhaseSpikes(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6));
}
public function createLevel():void{
phaseManager = PhaseManager.getInstance();
}
protected function addPhaseEnemies(_arg1:Number, _arg2:int, _arg3:int=0, _arg4:int=0, _arg5:int=0, _arg6:int=0, _arg7:int=0, _arg8:int=0, _arg9:Number=0):void{
phaseManager.addPhaseEnemies(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9);
}
protected function addPhaseItem(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Number=0, _arg5:Number=0):PhaseItem{
return (phaseManager.addPhaseItem(_arg1, _arg2, _arg3, _arg4, _arg5));
}
protected function removeContinuousPhase(_arg1:Number, _arg2:Number, _arg3:ContinuousPhase):void{
phaseManager.removeContinuousPhase(_arg1, _arg2, _arg3);
}
protected function addPhaseEnemyGenerateTime(_arg1:Number, _arg2:Boolean, _arg3:Number, _arg4:Number, _arg5:Number=0):void{
phaseManager.addPhaseEnemyGenerateTime(_arg1, _arg2, _arg3, _arg4, _arg5);
}
protected function addPhaseBonusScore(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number=0, _arg7:Number=0):PhaseBonusScore{
return (phaseManager.addPhaseBonusScore(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
protected function addPhaseMeteors(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number=0, _arg7:Number=0):PhaseMeteors{
return (phaseManager.addPhaseMeteors(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
}
}//package _game._phase
Section 20
//Phase (_game._phase.Phase)
package _game._phase {
public class Phase {
public var progressPoints:Number;
public var delay:Number;
public function Phase(_arg1:Number, _arg2:Number){
this.progressPoints = _arg1;
this.delay = _arg2;
}
}
}//package _game._phase
Section 21
//PhaseBonusScore (_game._phase.PhaseBonusScore)
package _game._phase {
public class PhaseBonusScore extends ContinuousPhase {
public var minLightsAmount:int;
public var maxLightsAmount:int;
public var time:Number;
public function PhaseBonusScore(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number, _arg7:Number){
super(_arg1, _arg2, _arg6, _arg7);
this.minLightsAmount = _arg3;
this.maxLightsAmount = _arg4;
this.time = _arg5;
}
}
}//package _game._phase
Section 22
//PhaseEnemies (_game._phase.PhaseEnemies)
package _game._phase {
public class PhaseEnemies extends Phase {
public var enemiesArr:Array;
public function PhaseEnemies(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int=0, _arg5:int=0, _arg6:int=0, _arg7:int=0, _arg8:int=0, _arg9:int=0){
enemiesArr = new Array();
super(_arg1, _arg2);
enemiesArr[0] = _arg3;
enemiesArr[1] = _arg4;
enemiesArr[2] = _arg5;
enemiesArr[3] = _arg6;
enemiesArr[4] = _arg7;
enemiesArr[5] = _arg8;
enemiesArr[6] = _arg9;
}
}
}//package _game._phase
Section 23
//PhaseEnemyGenerateTime (_game._phase.PhaseEnemyGenerateTime)
package _game._phase {
public class PhaseEnemyGenerateTime extends Phase {
public var randomTime:Number;
public var baseTime:Number;
public var higher:Boolean;
public function PhaseEnemyGenerateTime(_arg1:Number, _arg2:Number, _arg3:Boolean, _arg4:Number, _arg5:Number){
super(_arg1, _arg2);
this.baseTime = _arg4;
this.randomTime = _arg5;
this.higher = _arg3;
}
}
}//package _game._phase
Section 24
//PhaseItem (_game._phase.PhaseItem)
package _game._phase {
public class PhaseItem extends ContinuousPhase {
public var itemName:String;
public function PhaseItem(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Number=0, _arg5:Number=0){
super(_arg1, _arg2, _arg4, _arg5);
this.itemName = _arg3;
}
}
}//package _game._phase
Section 25
//PhaseLife (_game._phase.PhaseLife)
package _game._phase {
public class PhaseLife extends Phase {
public var time:Number;
public var lightAmount:int;
public function PhaseLife(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number){
super(_arg1, _arg2);
this.lightAmount = _arg3;
this.time = _arg4;
}
}
}//package _game._phase
Section 26
//PhaseManager (_game._phase.PhaseManager)
package _game._phase {
import flash.events.*;
import framework._event.*;
import _game._world._meteors.*;
import _game._stats.*;
import _game._world._borderLights.*;
import framework._utils._timer.*;
import _events.*;
import _game._levels.*;
public class PhaseManager {
private var timerDelayArr:Array;
private var phaseSpikes:Array;
public var addingPhaseLevel:int;
private var timerContinuousArr:Array;
private var phaseProgress:Array;
public var pointsToEvolve:Array;
public var executePhases:Boolean;
public var progressPoints:int;
private static var instance:PhaseManager = new (PhaseManager);
;
public function stop():void{
var _local1:int = (timerDelayArr.length - 1);
while (_local1 > -1) {
timerDelayArr[_local1].stop();
_local1--;
};
_local1 = (timerContinuousArr.length - 1);
while (_local1 > -1) {
timerContinuousArr[_local1].stop();
_local1--;
};
}
public function addPhaseLife(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number):void{
phaseProgress[addingPhaseLevel].push(new PhaseLife(_arg1, _arg2, _arg3, _arg4));
}
private function addContinuousPhase(_arg1:ContinuousPhase):void{
var _local2:TimerEx;
var _local3:int;
while (_local3 < timerContinuousArr.length) {
if (!timerContinuousArr[_local3].isRunning()){
_local2 = timerContinuousArr[_local3];
_local2.setTimeAmount((_arg1.minContinuousTime + (Math.random() * (_arg1.maxContinuousTime - _arg1.minContinuousTime))));
_local2.callbackParams = [_arg1];
};
_local3++;
};
if (!_local2){
_local2 = new TimerEx(1, (_arg1.minContinuousTime + (Math.random() * (_arg1.maxContinuousTime - _arg1.minContinuousTime))), onTimerContinuous, [_arg1]);
timerContinuousArr.push(_local2);
};
_arg1.timerRef = _local2;
_local2.start();
}
public function pause():void{
var _local1:int = (timerDelayArr.length - 1);
while (_local1 > -1) {
timerDelayArr[_local1].pause();
_local1--;
};
_local1 = (timerContinuousArr.length - 1);
while (_local1 > -1) {
timerContinuousArr[_local1].pause();
_local1--;
};
}
public function addPhaseEnemyGenerateTime(_arg1:Number, _arg2:Boolean, _arg3:Number, _arg4:Number, _arg5:Number=0):void{
phaseProgress[addingPhaseLevel].push(new PhaseEnemyGenerateTime(_arg1, _arg5, _arg2, _arg3, _arg4));
}
private function executePhase(_arg1:Phase):void{
var _local2:PhaseItem;
var _local3:PhaseBonusScore;
var _local4:PhaseSpikes;
var _local5:PhaseMeteors;
var _local6:int;
var _local7:Number;
if (!executePhases){
return;
};
if ((_arg1 is PhaseEnemies)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_ENEMIES, PhaseEnemies(_arg1).enemiesArr));
} else {
if ((_arg1 is PhaseEnemyGenerateTime)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.CHANGE_GENERATION_RATE, {baseTime:PhaseEnemyGenerateTime(_arg1).baseTime, higher:PhaseEnemyGenerateTime(_arg1).higher, modTime:PhaseEnemyGenerateTime(_arg1).randomTime}));
} else {
if ((_arg1 is PhaseItem)){
if (Stats.cancelPhases){
return;
};
_local2 = PhaseItem(_arg1);
if (_local2.itemName == "bomb"){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ADD_BOMB_TO_WORLD));
} else {
if (_local2.itemName == "superBomb"){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ADD_SUPER_BOMB_TO_WORLD));
} else {
if (_local2.itemName == "shield"){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ADD_SHIELD_TO_WORLD));
} else {
if (_local2.itemName == "atractor"){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ADD_ATRACTOR_TO_WORLD));
} else {
if (_local2.itemName == "thunder"){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ADD_THUNDER_TO_WORLD));
};
};
};
};
};
if (_local2.minContinuousTime){
addContinuousPhase(_local2);
};
} else {
if ((_arg1 is PhaseBonusScore)){
if (Stats.cancelPhases){
return;
};
_local3 = PhaseBonusScore(_arg1);
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:(_local3.minLightsAmount + int((Math.random() * ((_local3.maxLightsAmount - _local3.minLightsAmount) + 1)))), type:BorderLightsType.SCORE, time:_local3.time}));
if (_local3.minContinuousTime > 0){
addContinuousPhase(_local3);
};
} else {
if ((_arg1 is PhaseLife)){
if (Stats.cancelPhases){
return;
};
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:PhaseLife(_arg1).lightAmount, type:BorderLightsType.LIFE, time:PhaseLife(_arg1).time}));
} else {
if ((_arg1 is PhaseSpikes)){
if (Stats.cancelPhases){
return;
};
_local4 = PhaseSpikes(_arg1);
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:(_local4.minLightsAmount + int((Math.random() * ((_local4.maxLightsAmount - _local4.minLightsAmount) + 1)))), type:BorderLightsType.SPIKE, time:_local4.time}));
if (_local4.minContinuousTime > 0){
addContinuousPhase(_local4);
};
} else {
if ((_arg1 is PhaseMeteors)){
if (Stats.cancelPhases){
return;
};
_local5 = PhaseMeteors(_arg1);
_local6 = _local5.type;
if (_local6 == MeteorShower.RANDOM_LINE){
_local7 = Math.random();
if (_local7 < 0.33){
_local6 = MeteorShower.LINE_UP;
} else {
if (_local7 < 0.66){
_local6 = MeteorShower.LINE_CENTER;
} else {
_local6 = MeteorShower.LINE_DOWN;
};
};
} else {
if (_local6 == MeteorShower.RANDOM){
if (_local7 < 0.15){
_local6 = MeteorShower.LINE_DOWN;
} else {
if (_local7 < 0.3){
_local6 = MeteorShower.LINE_CENTER;
} else {
if (_local7 < 0.45){
_local6 = MeteorShower.LINE_UP;
} else {
if (_local7 < 0.6){
_local6 = MeteorShower.LINES_CENTER_DOWN;
} else {
if (_local7 < 0.75){
_local6 = MeteorShower.LINES_UP_CENTER;
} else {
if (_local7 < 0.9){
_local6 = MeteorShower.LINES_UP_DOWN;
} else {
_local6 = MeteorShower.CIRCLE;
};
};
};
};
};
};
};
};
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER, {type:_local6, duration:_local5.duration, frequency:_local5.frequency}));
if (_local5.minContinuousTime > 0){
addContinuousPhase(_local5);
};
} else {
if ((_arg1 is RemoveContinuousPhase)){
if (RemoveContinuousPhase(_arg1).continuousPhase.timerRef){
RemoveContinuousPhase(_arg1).continuousPhase.timerRef.stop();
};
};
};
};
};
};
};
};
};
}
public function reset():void{
var _local2:LevelPhases;
executePhases = true;
addingPhaseLevel = 1;
progressPoints = 0;
phaseProgress = [];
phaseSpikes = [];
timerDelayArr = [];
timerContinuousArr = [];
var _local1:int;
while (_local1 < 6) {
phaseProgress[_local1] = [];
_local1++;
};
switch (Stats.gameMode){
case GameModes.NORMAL:
_local2 = new Normal2();
break;
case GameModes.HARD:
_local2 = new Hard();
break;
case GameModes.VERY_HARD:
_local2 = new VeryHard();
break;
case GameModes.CREDITS:
_local2 = new FinalLevel();
break;
};
_local2.createLevel();
pointsToEvolve = _local2.pointsToEvolve;
_local1 = 0;
while (_local1 < phaseProgress.length) {
phaseProgress[_local1].sortOn("progressPoints", Array.NUMERIC);
_local1++;
};
}
private function onTimerContinuous(_arg1:ContinuousPhase):void{
executePhase(_arg1);
}
public function checkNewPhase():void{
var _local3:Phase;
if (Stats.playerLevel < 6){
if (!Stats.readyToEvolve){
if (progressPoints >= pointsToEvolve[Stats.playerLevel]){
Stats.readyToEvolve = true;
GlobalDispatcher.dispatchEvent(new Event(GameEvents.READY_TO_EVOLVE));
};
};
};
var _local1:Number = getProgressPointsPercent();
var _local2:Array = phaseProgress[(Stats.playerLevel - 1)];
if (_local2.length > 0){
while (_local1 >= _local2[0].progressPoints) {
_local3 = _local2[0];
if (_local3.delay > 0){
addDelayedPhase(_local3);
} else {
executePhase(_local3);
};
_local2.shift();
if (_local2.length == 0){
break;
};
};
};
}
public function addPhaseItem(_arg1:Number, _arg2:Number, _arg3:String, _arg4:Number=0, _arg5:Number=0):PhaseItem{
var _local6:PhaseItem = new PhaseItem(_arg1, _arg2, _arg3, _arg4, _arg5);
phaseProgress[addingPhaseLevel].push(_local6);
return (_local6);
}
public function playerGrows():void{
progressPoints = 0;
if (Stats.playerLevel == 6){
executePhases = false;
GlobalDispatcher.dispatchEvent(new Event(GameEvents.DESTROY_WORLD));
} else {
Stats.cancelPhases = false;
checkNewPhase();
};
}
public function addPhaseSpikes(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number=0):PhaseSpikes{
var _local7:PhaseSpikes = new PhaseSpikes(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
phaseProgress[addingPhaseLevel].push(_local7);
return (_local7);
}
public function substractPointsPercent(_arg1:Number):void{
progressPoints = (progressPoints - ((pointsToEvolve[Stats.playerLevel] * _arg1) * 0.01));
if (progressPoints < 0){
progressPoints = 0;
};
}
public function removeContinuousPhase(_arg1:Number, _arg2:Number, _arg3:ContinuousPhase):void{
phaseProgress[addingPhaseLevel].push(new RemoveContinuousPhase(_arg1, _arg2, _arg3));
}
public function addPhaseEnemies(_arg1:Number, _arg2:int, _arg3:int=0, _arg4:int=0, _arg5:int=0, _arg6:int=0, _arg7:int=0, _arg8:int=0, _arg9:Number=0):void{
phaseProgress[addingPhaseLevel].push(new PhaseEnemies(_arg1, _arg9, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8));
}
public function addPhaseMeteors(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number=0, _arg7:Number=0):PhaseMeteors{
var _local8:PhaseMeteors = new PhaseMeteors(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
phaseProgress[addingPhaseLevel].push(_local8);
return (_local8);
}
public function addProgressPoints(_arg1:int):void{
progressPoints = (progressPoints + _arg1);
if (progressPoints > pointsToEvolve[Stats.playerLevel]){
progressPoints = pointsToEvolve[Stats.playerLevel];
};
checkNewPhase();
}
public function getTotalPointsForEvolution():int{
return (pointsToEvolve[Stats.playerLevel]);
}
public function addPhaseBonusScore(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number=0, _arg7:Number=0):PhaseBonusScore{
var _local8:PhaseBonusScore = new PhaseBonusScore(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
phaseProgress[addingPhaseLevel].push(_local8);
return (_local8);
}
private function addDelayedPhase(_arg1:Phase):void{
var _local2:TimerEx;
var _local3:int;
while (_local3 < timerDelayArr.length) {
if (!timerDelayArr[_local3].isRunning()){
_local2 = timerDelayArr[_local3];
_local2.setTimeAmount(_arg1.delay);
_local2.callbackParams = [_arg1];
};
_local3++;
};
if (!_local2){
_local2 = new TimerEx(1, _arg1.delay, onTimerDelay, [_arg1]);
timerDelayArr.push(_local2);
};
_local2.start();
}
public function resume():void{
var _local1:int = (timerDelayArr.length - 1);
while (_local1 > -1) {
timerDelayArr[_local1].resume();
_local1--;
};
_local1 = (timerContinuousArr.length - 1);
while (_local1 > -1) {
timerContinuousArr[_local1].resume();
_local1--;
};
}
private function onTimerDelay(_arg1:Phase):void{
executePhase(_arg1);
}
public function getProgressPointsPercent():Number{
return ((progressPoints / pointsToEvolve[Stats.playerLevel]));
}
public static function getInstance():PhaseManager{
return (instance);
}
}
}//package _game._phase
Section 27
//PhaseMeteors (_game._phase.PhaseMeteors)
package _game._phase {
public class PhaseMeteors extends ContinuousPhase {
public var duration:Number;
public var type:int;
public var frequency:Number;
public function PhaseMeteors(_arg1:Number, _arg2:Number, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number=0, _arg7:Number=0){
super(_arg1, _arg2, _arg6, _arg7);
this.type = _arg3;
this.duration = _arg4;
this.frequency = _arg5;
}
}
}//package _game._phase
Section 28
//PhaseSpikes (_game._phase.PhaseSpikes)
package _game._phase {
public class PhaseSpikes extends ContinuousPhase {
public var minLightsAmount:int;
public var maxLightsAmount:int;
public var time:Number;
public function PhaseSpikes(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Number, _arg6:Number=0, _arg7:Number=0){
super(_arg1, _arg2, _arg6, _arg7);
this.minLightsAmount = _arg3;
this.maxLightsAmount = _arg4;
this.time = _arg5;
}
}
}//package _game._phase
Section 29
//RemoveContinuousPhase (_game._phase.RemoveContinuousPhase)
package _game._phase {
public class RemoveContinuousPhase extends Phase {
public var continuousPhase:ContinuousPhase;
public function RemoveContinuousPhase(_arg1:Number, _arg2:Number, _arg3:ContinuousPhase){
super(_arg1, _arg2);
this.continuousPhase = _arg3;
}
}
}//package _game._phase
Section 30
//FinalStats (_game._stats.FinalStats)
package _game._stats {
import framework._utils._timer.*;
public class FinalStats {
public var gameCronometer:Cronometer;
public var gameTime:int;// = 0
public var lightsTotal:int;// = 0
public var score:int;// = 0
public var medal:int;// = 0
public var lightsCaught:int;// = 0
public var finalScore:Number;// = 0
public var livesTotal:int;// = 0
public var livesAmount:int;// = 0
private static var instance:FinalStats;
public function FinalStats(){
gameCronometer = new Cronometer();
super();
}
public function saveGameTime():void{
gameTime = gameCronometer.getCurrentTime();
gameCronometer.stop();
}
public function reset():void{
gameCronometer.stop();
gameCronometer.start();
lightsCaught = 0;
lightsTotal = 0;
livesAmount = 0;
livesTotal = 0;
gameTime = 0;
medal = 0;
finalScore = 0;
score = 0;
}
public static function getInstance():FinalStats{
if (!instance){
instance = new (FinalStats);
};
return (instance);
}
}
}//package _game._stats
Section 31
//GameModes (_game._stats.GameModes)
package _game._stats {
public class GameModes {
public static const VERY_HARD:int = 2;
public static const NORMAL:int = 0;
public static const CREDITS:int = 3;
public static const HARD:int = 1;
}
}//package _game._stats
Section 32
//GameModeStats (_game._stats.GameModeStats)
package _game._stats {
public class GameModeStats {
public var lightsCaught:int;// = 0
public var livesAmount:int;// = 0
public var unlocked:Boolean;// = false
public var lightsTotal:int;// = 0
public var isNew:Boolean;// = false
public var medal:int;// = 0
public var score:int;// = 0
public var finalScore:Number;// = 0
public var livesTotal:int;// = 0
public var gameTime:int;// = 0
public function copy(_arg1:Object):void{
this.unlocked = _arg1.unlocked;
this.medal = _arg1.medal;
this.score = _arg1.score;
this.gameTime = _arg1.gameTime;
this.lightsCaught = _arg1.lightsCaught;
this.lightsTotal = _arg1.lightsTotal;
this.livesAmount = _arg1.livesAmount;
this.livesTotal = _arg1.livesTotal;
this.finalScore = _arg1.finalScore;
}
}
}//package _game._stats
Section 33
//Stats (_game._stats.Stats)
package _game._stats {
import FGL.GameTracker.*;
public class Stats {
public static var zenergyMsgDisplayed:Boolean = false;
public static var diedOnce:Boolean = false;
public static var lives:int;
public static var reTry:Boolean = false;
public static var soundVolume:Number = 1;
public static var bombs:int;
public static var score:int;
public static var gameModeStatsArr:Array = [new GameModeStats(), new GameModeStats(), new GameModeStats(), new GameModeStats()];
public static var readyToEvolve:Boolean;
public static var overBombs:int = 0;
public static var musicVolume:Number = 1;
public static var playerLevel:int;
public static var gameMode:int = 0;
public static var kongAPI;
public static var godMode:Boolean = false;
public static var enemiesKilled:int = 0;
public static var addLifeSecret:Boolean = false;
public static var inFinal:Boolean = false;
public static var canvasScale:Number = 1;
public static var deadInFinal:Boolean = false;
public static var useMouse:Boolean = true;
public static var gameTracker:GameTracker = new GameTracker();
public static var cancelPhases:Boolean = false;
public static var firstBomb:Boolean = true;
public static function getGameMode():String{
switch (gameMode){
case GameModes.NORMAL:
return ("Normal");
case GameModes.HARD:
return ("Hard");
case GameModes.VERY_HARD:
return ("Very hard");
};
return ("Credits");
}
public static function submitKongStat(_arg1:String, _arg2:int):void{
if (kongAPI){
if (kongAPI.stats){
kongAPI.stats.submit(_arg1, _arg2);
};
};
}
public static function getLastModeUnlocked():int{
if (gameModeStatsArr[GameModes.CREDITS].unlocked){
return (GameModes.CREDITS);
};
if (gameModeStatsArr[GameModes.VERY_HARD].unlocked){
return (GameModes.VERY_HARD);
};
if (gameModeStatsArr[GameModes.HARD].unlocked){
return (GameModes.HARD);
};
return (GameModes.NORMAL);
}
}
}//package _game._stats
Section 34
//BaseLightGroup (_game._world._borderLights.BaseLightGroup)
package _game._world._borderLights {
import flash.events.*;
import framework._utils._timer.*;
public class BaseLightGroup extends EventDispatcher {
public var type:int;
protected var timerDeattachFromGroup:TimerEx;
public var time:Number;
protected var paused:Boolean;
public var lights:Array;
public static const RELEASED:String = "released";
public function BaseLightGroup(_arg1:Array, _arg2:int, _arg3:Number){
timerDeattachFromGroup = new TimerEx(1, 1, onTimerDeAttachFromGroup);
super();
this.lights = _arg1;
this.type = _arg2;
this.time = _arg3;
var _local4:int;
while (_local4 < _arg1.length) {
BorderLight(_arg1[_local4]).group = this;
_local4++;
};
paused = false;
}
public function disableLights():void{
var _local2:BorderLight;
var _local1:int;
while (_local1 < lights.length) {
_local2 = BorderLight(lights[_local1]);
if (_local2.enabled){
_local2.disable();
};
_local1++;
};
timerDeattachFromGroup.start();
}
public function resumeFromMeteorShower():void{
}
public function resume():void{
paused = false;
timerDeattachFromGroup.resume();
}
private function onTimerDeAttachFromGroup():void{
var _local1:int;
while (_local1 < lights.length) {
BorderLight(lights[_local1]).group = null;
_local1++;
};
dispatchEvent(new Event(RELEASED));
}
public function disableLightsNow():void{
var _local2:BorderLight;
timerDeattachFromGroup.stop();
var _local1:int;
while (_local1 < lights.length) {
_local2 = BorderLight(lights[_local1]);
if (_local2.enabled){
_local2.disable();
};
_local1++;
};
_local1 = 0;
while (_local1 < lights.length) {
BorderLight(lights[_local1]).group = null;
_local1++;
};
dispatchEvent(new Event(RELEASED));
}
public function pause():void{
paused = true;
timerDeattachFromGroup.pause();
}
public function pauseFromMeteorShower():void{
}
}
}//package _game._world._borderLights
Section 35
//BlueEnergyLightGroup (_game._world._borderLights.BlueEnergyLightGroup)
package _game._world._borderLights {
import flash.events.*;
import framework._event.*;
import _events.*;
public class BlueEnergyLightGroup extends LightGroup {
public function BlueEnergyLightGroup(_arg1:Array, _arg2:int, _arg3:Number){
super(_arg1, _arg2, _arg3);
}
override protected function onLightSwitched(_arg1:Event):void{
super.onLightSwitched(_arg1);
GlobalDispatcher.dispatchEvent(new Event(GameEvents.BLUE_ENERGY_GATHERED));
}
}
}//package _game._world._borderLights
Section 36
//BorderLight (_game._world._borderLights.BorderLight)
package _game._world._borderLights {
import flash.display.*;
import flash.events.*;
import framework._sound.*;
import flash.geom.*;
import flash.filters.*;
import _game._world._entity.*;
import framework._utils._timer.*;
import _game._world._collision.*;
import _game._world._player.*;
import gs.*;
import _sound.*;
public class BorderLight extends Entity {
public var enabled:Boolean;// = false
public var spikesRelated:Array;
private var tweenBright:TweenMax;
public var group:BaseLightGroup;// = null
public var tweenAlpha:TweenMax;
public var knockOutMc:MovieClip;
public var prev:BorderLight;// = null
public var mc:MovieClip;
public var isPlayerColliding:Boolean;
private var tweenGlow:TweenMax;
private var tweenSuperBright:TweenMax;
public var next:BorderLight;// = null
private var tweenColor:TweenMax;
private var timerCanCollide:TimerEx;
private var tweenBlueBright:TweenMax;
public function BorderLight(_arg1:MovieClip, _arg2:MovieClip):void{
spikesRelated = new Array();
super();
var _local3:MovieClip = MovieClip(_arg1.getChildByName("collider"));
position.x = (_arg1.x + _local3.x);
position.y = (_arg1.y + _local3.y);
radius = 3;
this.mc = _arg1;
this.knockOutMc = _arg2;
_arg1.visible = false;
_arg2.visible = false;
canvas.addChild(_arg2);
canvas.addChild(_arg1);
timerCanCollide = new TimerEx(1, 0.8, onTimer);
}
override protected function onResumed():void{
if (tweenColor){
tweenColor.resume();
};
if (tweenBright){
tweenBright.resume();
};
if (tweenGlow){
tweenGlow.resume();
};
if (tweenSuperBright){
tweenSuperBright.resume();
};
if (tweenBlueBright){
tweenBlueBright.resume();
};
timerCanCollide.resume();
}
private function onTimer():void{
setColor(0xFFFFFF);
enabled = false;
canCollide = true;
mc.filters = [];
knockOutMc.visible = false;
knockOutMc.alpha = 1;
knockOutMc.scaleX = (knockOutMc.scaleY = 1);
}
public function startTweenColor(_arg1:int, _arg2:int, _arg3:Number, _arg4:Function):void{
mc.transform.colorTransform = new ColorTransform((_arg1 >> 16), ((_arg1 & 0xFF00) >> 8), (_arg1 & 0xFF));
tweenColor = new TweenMax(mc, (_arg3 / 1000), {color:_arg2, onComplete:_arg4});
}
override protected function onPaused():void{
if (tweenColor){
tweenColor.pause();
};
if (tweenBright){
tweenBright.pause();
};
if (tweenGlow){
tweenGlow.pause();
};
if (tweenSuperBright){
tweenSuperBright.pause();
};
if (tweenBlueBright){
tweenBlueBright.pause();
};
timerCanCollide.pause();
}
private function onTweenBlueLightBright():void{
if (tweenBlueBright){
tweenBlueBright.pause();
};
tweenBlueBright = new TweenMax(mc, 0.3, {glowFilter:{blurX:5, blurY:5, color:0xFFFFFF, alpha:0, strength:1}, onComplete:enableBlueLightsBright});
}
public function enableSuperBright():void{
if (enabled){
if (tweenSuperBright){
tweenSuperBright.pause();
};
tweenSuperBright = new TweenMax(mc, 0.7, {delay:(Math.random() * 1.5), glowFilter:{blurX:20, blurY:20, color:0xFFFFFF, alpha:1, strength:8}, onComplete:onTweenSuperBright});
};
}
override public function draw():void{
}
private function onTweenBright():void{
if (enabled){
if (tweenBright){
tweenBright.pause();
};
tweenBright = new TweenMax(mc, 0.3, {glowFilter:{blurX:10, blurY:10, color:0xFFFFFF, alpha:0}, onComplete:enableBright});
};
}
private function enableBlueLightsBright():void{
if (tweenBlueBright){
tweenBlueBright.pause();
};
tweenBlueBright = new TweenMax(mc, 0.3, {glowFilter:{blurX:20, blurY:20, color:0xFFFFFF, alpha:1, strength:8}, onComplete:onTweenBlueLightBright});
}
public function enableBright():void{
if (enabled){
if (tweenBright){
tweenBright.pause();
};
tweenBright = new TweenMax(mc, 0.8, {glowFilter:{blurX:10, blurY:10, color:0xFFFFFF, alpha:1, strength:1}, onComplete:onTweenBright});
};
}
override public function onCollide(_arg1:Entity):void{
if (!(_arg1 is Player)){
return;
};
if (((!(enabled)) || (!(group)))){
mc.visible = true;
startTweenAlpha(0.5, 0, 500);
isPlayerColliding = true;
} else {
if (group.type == BorderLightsType.BLUE_ENERGY){
enableBlueLightsBright();
knockOutMc.filters = [new GlowFilter(0xFFFFFF, 1, 8, 8, 4, 1, false, true)];
tweenGlow = new TweenMax(knockOutMc, 0.5, {scaleX:2, scaleY:2, alpha:0});
dispatchEvent(new Event("switched"));
canCollide = false;
SoundManager.getInstance().playSound("hit_lights", SoundGroups.GAME_SOUNDS);
} else {
canCollide = false;
timerCanCollide.start();
destroyActiveTweens();
mc.alpha = 0.55;
startTweenAlpha(1, 0, 300);
knockOutMc.visible = true;
knockOutMc.filters = [new GlowFilter(0xFFFFFF, 1, 8, 8, 4, 1, false, true)];
mc.filters = [new GlowFilter(0xFFFFFF, 1, 10, 10, 5, 1, false, false)];
tweenGlow = new TweenMax(knockOutMc, 0.5, {scaleX:2, scaleY:2, alpha:0});
dispatchEvent(new Event("switched"));
SoundManager.getInstance().playSound("hit_lights", SoundGroups.GAME_SOUNDS);
};
};
}
public function setColor(_arg1:Number):void{
mc.transform.colorTransform = new ColorTransform(0, 0, 0, mc.alpha, (_arg1 >> 16), ((_arg1 & 0xFF00) >> 8), (_arg1 & 0xFF));
}
public function startTweenAlpha(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=0):void{
mc.alpha = _arg1;
tweenAlpha = new TweenMax(mc, (_arg3 / 1000), {alpha:_arg2, onComplete:onTweenAlpha, delay:(_arg4 / 1000)});
}
public function disable():void{
destroyActiveTweens();
enabled = false;
canCollide = true;
mc.visible = false;
knockOutMc.visible = false;
setColor(0xFFFFFF);
}
private function onTweenSuperBright():void{
if (enabled){
if (tweenSuperBright){
tweenSuperBright.pause();
};
tweenSuperBright = new TweenMax(mc, 0.7, {glowFilter:{blurX:5, blurY:5, color:0xFFFFFF, alpha:0, strength:1}, onComplete:enableSuperBright});
};
}
public function destroyActiveTweens():void{
if (tweenAlpha){
tweenAlpha.pause();
tweenAlpha = null;
};
if (tweenBright){
tweenBright.pause();
tweenBright = null;
};
if (tweenColor){
tweenColor.pause();
tweenColor = null;
};
if (tweenGlow){
tweenGlow.pause();
tweenGlow = null;
};
if (tweenSuperBright){
tweenSuperBright.pause();
tweenSuperBright = null;
};
if (tweenBlueBright){
tweenBlueBright.pause();
tweenBlueBright = null;
};
}
public function enableFinalBlueLightsBright():void{
if (tweenBlueBright){
tweenBlueBright.pause();
};
tweenBlueBright = new TweenMax(mc, 0.3, {glowFilter:{blurX:20, blurY:20, color:0xFFFFFF, alpha:1, strength:8}});
}
private function onTweenAlpha():void{
if (mc.alpha == 0){
mc.visible = false;
isPlayerColliding = false;
};
}
override protected function onAddedToRoute():void{
CollisionManager.getInstance().register(this, CollisionGroups.PLAYER_VS_ALL, false);
isPlayerColliding = false;
}
}
}//package _game._world._borderLights
Section 37
//BorderLightMgr (_game._world._borderLights.BorderLightMgr)
package _game._world._borderLights {
import flash.display.*;
import flash.events.*;
import framework._event.*;
import framework._component.*;
import framework._sound.*;
import _game._stats.*;
import flash.filters.*;
import _game._phase.*;
import assets.*;
import gs.*;
import _game._gui.*;
import _components.*;
import _sound.*;
import _events.*;
public class BorderLightMgr extends WorldObject {
private var pausedFromMeteorShower:Boolean;// = false
private var energyCounter:int;// = 0
private var tweenContainer:TweenMax;
private var scoreBonusLevel:int;// = 1
private var lightGroupArr:Array;
private var scheduledLightsArr:Array;
private var scheduledGroupArr:Array;
public function BorderLightMgr(){
scheduledGroupArr = new Array();
lightGroupArr = new Array();
scheduledLightsArr = new Array();
super();
id = Components.BORDERLIGHT_MANAGER;
}
private function enableLights(_arg1:int, _arg2:int, _arg3:Number, _arg4:int=-1):void{
var _local8:int;
var _local9:*;
var _local10:*;
if (_arg1 > children.length){
_arg1 = children.length;
};
var _local5:BorderLight;
if (_arg4 == -1){
if (((!((_arg2 == BorderLightsType.SPIKE))) && (!((_arg2 == BorderLightsType.ENERGY))))){
_local8 = 0;
while (_local8 < children.length) {
if (BorderLight(children[_local8]).group){
if (BorderLight(children[_local8]).group.type == BorderLightsType.SPIKE){
_local5 = children[_local8];
break;
};
};
_local8++;
};
} else {
if (_arg2 == BorderLightsType.SPIKE){
_local8 = 0;
while (_local8 < children.length) {
if (BorderLight(children[_local8]).group){
if ((((BorderLight(children[_local8]).group.type == BorderLightsType.SCORE)) || ((BorderLight(children[_local8]).group.type == BorderLightsType.LIFE)))){
_local5 = children[_local8];
break;
};
};
_local8++;
};
};
};
if (!_local5){
_local5 = children[int((Math.random() * children.length))];
};
} else {
_local5 = children[(_arg4 % 67)];
};
var _local6:int = children.length;
var _local7:BorderLight = _local5;
do {
if (checkLightsInactive(_local7, _arg1)){
_local9 = new Array();
_local8 = 0;
while (_local8 < _arg1) {
_local9.push(_local7);
_local7 = _local7.next;
_local8++;
};
if (_arg2 == BorderLightsType.SPIKE){
_local10 = new SpikesLightGroup(_local9, _arg2, _arg3);
_local10.addEventListener(BaseLightGroup.RELEASED, onLightGroupReleased);
} else {
if (_arg2 == BorderLightsType.BLUE_ENERGY){
_local10 = new BlueEnergyLightGroup(_local9, _arg2, _arg3);
_local10.addEventListener(LightGroup.COMPLETED, onLightGroupCompleted);
_local10.addEventListener(BaseLightGroup.RELEASED, onLightGroupReleased);
} else {
_local10 = new LightGroup(_local9, _arg2, _arg3);
_local10.addEventListener(LightGroup.COMPLETED, onLightGroupCompleted);
_local10.addEventListener(BaseLightGroup.RELEASED, onLightGroupReleased);
};
};
lightGroupArr.push(_local10);
switch (_arg2){
case BorderLightsType.LIFE:
enableLifeLights(_local10);
break;
case BorderLightsType.SCORE:
enableScoreLights(_local10);
break;
case BorderLightsType.SPIKE:
enableSpikesLights(_local10);
break;
case BorderLightsType.ENERGY:
enableEnergyLights(_local10);
break;
case BorderLightsType.BLUE_ENERGY:
enableBlueEnergyLights(_local10);
break;
};
return;
} else {
_local7 = _local7.next;
};
} while (_local7 != _local5);
scheduledLightsArr.push(new ScheduleLights(_arg1, _arg2, _arg3));
}
public function setLightsColor(_arg1:uint):void{
var _local2:int = children.length;
while (_local2 > -1) {
BorderLight(children[_local2]).setColor(_arg1);
_local2--;
};
}
public function setLightsAlpha(_arg1:Number):void{
var _local2:int = children.length;
while (_local2 > -1) {
BorderLight(children[_local2]).mc.alpha = _arg1;
_local2--;
};
}
private function enableScoreLights(_arg1:LightGroup):void{
var _local3:BorderLight;
var _local2:int;
while (_local2 < _arg1.lights.length) {
_local3 = BorderLight(_arg1.lights[_local2]);
_local3.destroyActiveTweens();
_local3.setColor(0xFFDD00);
_local3.mc.alpha = 0.65;
_local3.mc.visible = true;
_local3.knockOutMc.visible = true;
_local3.knockOutMc.alpha = 1;
_local3.knockOutMc.filters = [new GlowFilter(0xBB8800, 1, 6, 6, 3, 1, false)];
_local3.enabled = true;
_local3.enableBright();
_local2++;
};
if (pausedFromMeteorShower){
_arg1.pauseFromMeteorShower();
};
SoundManager.getInstance().playSound("border_lights_appear", SoundGroups.GAME_SOUNDS);
}
private function enableSpikesLights(_arg1:SpikesLightGroup):void{
var _local3:BorderLight;
var _local2:int;
while (_local2 < _arg1.lights.length) {
_local3 = BorderLight(_arg1.lights[_local2]);
_local3.destroyActiveTweens();
_local3.setColor(0xFF0000);
_local3.mc.visible = true;
_local3.mc.alpha = 0;
_local3.enabled = true;
_local3.canCollide = false;
_local3.knockOutMc.visible = true;
_local3.knockOutMc.alpha = 0;
_local3.knockOutMc.filters = [new GlowFilter(0x990000, 1, 6, 6, 2, 1, false, true)];
_local2++;
};
_arg1.startTween();
}
private function checkLightsInactive(_arg1:BorderLight, _arg2:int):Boolean{
var _local3:BorderLight = _arg1.prev;
_arg2 = (_arg2 + 2);
var _local4:int;
while (((!(_local3.enabled)) && (!(_local3.group)))) {
_local4++;
if (_local4 == _arg2){
return (true);
};
_local3 = _local3.next;
};
return (false);
}
public function getIsAnyActive():Boolean{
var _local1:int = children.length;
while (_local1 > -1) {
if (BorderLight(children[_local1]).enabled){
return (true);
};
_local1--;
};
return (false);
}
public function setLightsVisible(_arg1:Boolean):void{
var _local2:int = children.length;
while (_local2 > -1) {
BorderLight(children[_local2]).mc.visible = _arg1;
_local2--;
};
}
public function disableAll():void{
while (lightGroupArr.length) {
BaseLightGroup(lightGroupArr[0]).disableLightsNow();
};
}
private function enableLifeLights(_arg1:LightGroup):void{
var _local3:BorderLight;
var _local2:int;
while (_local2 < _arg1.lights.length) {
_local3 = BorderLight(_arg1.lights[_local2]);
_local3.destroyActiveTweens();
_local3.setColor(0xFF00);
_local3.mc.alpha = 0.65;
_local3.mc.visible = true;
_local3.knockOutMc.visible = true;
_local3.knockOutMc.alpha = 1;
_local3.knockOutMc.filters = [new GlowFilter(0x9900, 1, 5, 5, 4, 1, false)];
_local3.enabled = true;
_local3.enableBright();
_local2++;
};
if (pausedFromMeteorShower){
_arg1.pauseFromMeteorShower();
};
SoundManager.getInstance().playSound("border_lights_appear", SoundGroups.GAME_SOUNDS);
}
public function pauseFromMeteorShower():void{
if (pausedFromMeteorShower){
return;
};
pausedFromMeteorShower = true;
var _local1:int;
while (_local1 < lightGroupArr.length) {
if ((((lightGroupArr[_local1].type == BorderLightsType.SCORE)) || ((lightGroupArr[_local1].type == BorderLightsType.LIFE)))){
BaseLightGroup(lightGroupArr[_local1]).pauseFromMeteorShower();
};
_local1++;
};
}
private function enableBlueEnergyLights(_arg1:LightGroup):void{
var _local3:BorderLight;
var _local2:int;
while (_local2 < _arg1.lights.length) {
_local3 = BorderLight(_arg1.lights[_local2]);
_local3.destroyActiveTweens();
_local3.setColor(35071);
_local3.mc.alpha = 0.6;
_local3.mc.visible = true;
_local3.knockOutMc.visible = true;
_local3.knockOutMc.alpha = 1;
_local3.knockOutMc.filters = [new GlowFilter(21964, 1, 5, 5, 4, 1, false)];
_local3.enabled = true;
_local2++;
};
SoundManager.getInstance().playSound("border_lights_appear", SoundGroups.GAME_SOUNDS);
}
private function enableEnergyLights(_arg1:LightGroup):void{
var _local3:BorderLight;
var _local2:int;
while (_local2 < _arg1.lights.length) {
_local3 = BorderLight(_arg1.lights[_local2]);
_local3.destroyActiveTweens();
_local3.setColor(0xFFFF);
_local3.mc.alpha = 0.65;
_local3.mc.visible = true;
_local3.knockOutMc.visible = true;
_local3.knockOutMc.alpha = 1;
_local3.knockOutMc.filters = [new GlowFilter(0x9999, 1, 5, 5, 4, 1, false)];
_local3.enabled = true;
_local3.enableBright();
_local2++;
};
SoundManager.getInstance().playSound("border_lights_appear", SoundGroups.GAME_SOUNDS);
}
private function onLightGroupCompleted(_arg1:EventValue):void{
var _local4:int;
var _local5:Number;
var _local6:int;
var _local7:BorderLight;
var _local2:LightGroup = LightGroup(_arg1.target);
_local2.removeEventListener(LightGroup.COMPLETED, onLightGroupCompleted);
if (_local2.type == BorderLightsType.SCORE){
FinalStats.getInstance().lightsCaught++;
switch (scoreBonusLevel){
case 1:
_local4 = 1000;
break;
case 2:
_local4 = 2500;
break;
case 3:
_local4 = 5000;
break;
case 4:
_local4 = 7500;
break;
case 5:
_local4 = 10000;
break;
case 6:
_local4 = 15000;
break;
case 7:
_local4 = 20000;
break;
case 8:
_local4 = 25000;
break;
case 9:
_local4 = 30000;
break;
case 10:
_local4 = 40000;
break;
default:
_local4 = 50000;
};
scoreBonusLevel++;
if (((!((Stats.gameMode == GameModes.CREDITS))) && (!(Stats.zenergyMsgDisplayed)))){
Stats.zenergyMsgDisplayed = true;
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("right! gather all \nthe z-energy you can!", 1, true, 3);
};
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "ZEnergy!");
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.BONUS_SCORE, {score:_local4, x:(_arg1.value.x + canvas.x), y:(_arg1.value.y + canvas.y)}));
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_SCORE, _local4));
_local5 = 0;
switch (Stats.playerLevel){
case 1:
_local5 = 0.15;
break;
case 2:
_local5 = 0.1;
break;
case 3:
_local5 = 0.08;
break;
case 4:
_local5 = 0.06;
break;
case 5:
_local5 = 0.05;
break;
case 6:
_local5 = 0.04;
break;
case 7:
_local5 = 0.03;
};
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_PROGRESS_POINTS, (PhaseManager.getInstance().getTotalPointsForEvolution() * _local5)));
SoundManager.getInstance().playSound("yellow_lights_complete", SoundGroups.GAME_SOUNDS);
_local6 = 0;
if (Stats.gameMode == GameModes.NORMAL){
Stats.submitKongStat("YellowLightsLevel1", FinalStats.getInstance().lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.HARD].lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.VERY_HARD].lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.CREDITS].lightsCaught);
_local6 = (_local6 + FinalStats.getInstance().lightsCaught);
Stats.submitKongStat("YellowLightsTotal", _local6);
} else {
if (Stats.gameMode == GameModes.HARD){
Stats.submitKongStat("YellowLightsLevel2", FinalStats.getInstance().lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.NORMAL].lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.VERY_HARD].lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.CREDITS].lightsCaught);
_local6 = (_local6 + FinalStats.getInstance().lightsCaught);
Stats.submitKongStat("YellowLightsTotal", _local6);
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
Stats.submitKongStat("YellowLightsLevel3", FinalStats.getInstance().lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.NORMAL].lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.HARD].lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.CREDITS].lightsCaught);
_local6 = (_local6 + FinalStats.getInstance().lightsCaught);
Stats.submitKongStat("YellowLightsTotal", _local6);
} else {
Stats.submitKongStat("YellowLightsLevel4", FinalStats.getInstance().lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.NORMAL].lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.HARD].lightsCaught);
_local6 = (_local6 + Stats.gameModeStatsArr[GameModes.VERY_HARD].lightsCaught);
_local6 = (_local6 + FinalStats.getInstance().lightsCaught);
Stats.submitKongStat("YellowLightsTotal", _local6);
};
};
};
} else {
if (_local2.type == BorderLightsType.LIFE){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ADD_LIFE));
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.LIVES_UP, {x:(_arg1.value.x + canvas.x), y:(_arg1.value.y + canvas.y)}));
} else {
if (_local2.type == BorderLightsType.ENERGY){
energyCounter++;
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENERGY_GATHERED, energyCounter));
if (energyCounter == 3){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ENERGY_FULL));
};
SoundManager.getInstance().playSound("yellow_lights_complete", SoundGroups.GAME_SOUNDS);
} else {
if (_local2.type == BorderLightsType.BLUE_ENERGY){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENERGY_GATHERED, 1));
SoundManager.getInstance().playSound("yellow_lights_complete", SoundGroups.GAME_SOUNDS);
for each (_local7 in _local2.lights) {
_local7.enableFinalBlueLightsBright();
};
};
};
};
};
var _local3:int = lightGroupArr.indexOf(_local2);
if (_local3 != -1){
lightGroupArr.splice(_local3, 1);
};
checkScheduledGroups();
}
override protected function onAddedToRoute():void{
var _local5:BorderLight;
var _local1:BorderLights = new BorderLights();
var _local2:BorderLights = new BorderLights();
var _local3:int = _local1.numChildren;
var _local4:int;
while (_local4 < _local3) {
addChild(new BorderLight(MovieClip(_local1.getChildAt(0)), MovieClip(_local2.getChildAt(0))));
_local4++;
};
_local4 = 0;
while (_local4 < children.length) {
_local5 = BorderLight(children[_local4]);
if (_local4 == 0){
_local5.prev = children[(children.length - 1)];
} else {
_local5.prev = children[(_local4 - 1)];
};
if (_local4 == (children.length - 1)){
_local5.next = children[0];
} else {
_local5.next = children[(_local4 + 1)];
};
_local4++;
};
GlobalDispatcher.addEventListener(GameEvents.ENABLE_LIGHTS, onEnableLights);
pausedFromMeteorShower = false;
}
private function onLightGroupReleased(_arg1:Event):void{
var _local2:BaseLightGroup = BaseLightGroup(_arg1.target);
_local2.removeEventListener(BaseLightGroup.RELEASED, onLightGroupReleased);
var _local3:int = lightGroupArr.indexOf(_local2);
if (_local3 != -1){
lightGroupArr.splice(_local3, 1);
};
checkScheduledGroups();
}
private function checkScheduledGroups():void{
var _local4:ScheduleLights;
var _local1:int = scheduledLightsArr.length;
var _local2:Array = scheduledLightsArr.concat();
var _local3:int;
while (_local3 < _local1) {
_local4 = ScheduleLights(_local2[_local3]);
scheduledLightsArr.splice(0, 1);
enableLights(_local4.amount, _local4.type, _local4.time);
_local3++;
};
}
public function resumeFromMeteorShower():void{
if (!pausedFromMeteorShower){
return;
};
pausedFromMeteorShower = false;
var _local1:int;
while (_local1 < lightGroupArr.length) {
if ((((lightGroupArr[_local1].type == BorderLightsType.SCORE)) || ((lightGroupArr[_local1].type == BorderLightsType.LIFE)))){
BaseLightGroup(lightGroupArr[_local1]).resumeFromMeteorShower();
};
_local1++;
};
}
override public function resume():void{
super.resume();
if (tweenContainer){
tweenContainer.resume();
};
var _local1:int;
while (_local1 < lightGroupArr.length) {
BaseLightGroup(lightGroupArr[_local1]).resume();
_local1++;
};
}
override public function pause():void{
super.pause();
if (tweenContainer){
tweenContainer.pause();
};
var _local1:int;
while (_local1 < lightGroupArr.length) {
BaseLightGroup(lightGroupArr[_local1]).pause();
_local1++;
};
}
override protected function onRemovedFromRoute():void{
GlobalDispatcher.removeEventListener(GameEvents.ENABLE_LIGHTS, onEnableLights);
}
private function onEnableLights(_arg1:EventValue):void{
enableLights(_arg1.value.amount, _arg1.value.type, _arg1.value.time, (_arg1.value.startFrom) ? _arg1.value.startFrom : -1);
}
}
}//package _game._world._borderLights
Section 38
//BorderLightsType (_game._world._borderLights.BorderLightsType)
package _game._world._borderLights {
public class BorderLightsType {
public static const SCORE:int = 0;
public static const SPIKE:int = 2;
public static const LIFE:int = 1;
public static const BLUE_ENERGY:int = 4;
public static const ENERGY:int = 3;
}
}//package _game._world._borderLights
Section 39
//LightGroup (_game._world._borderLights.LightGroup)
package _game._world._borderLights {
import flash.events.*;
import framework._event.*;
import framework._utils._timer.*;
public class LightGroup extends BaseLightGroup {
private var timer:TimerEx;
private var pausedFromMeteorShower:Boolean;
private var deactiveCounter:int;// = 0
public static const COMPLETED:String = "completed";
public function LightGroup(_arg1:Array, _arg2:int, _arg3:Number){
super(_arg1, _arg2, _arg3);
if (_arg3 != -1){
timer = new TimerEx(1, _arg3, disableLights);
timer.start();
};
var _local4:int;
while (_local4 < _arg1.length) {
BorderLight(_arg1[_local4]).addEventListener("switched", onLightSwitched);
_local4++;
};
pausedFromMeteorShower = false;
}
override public function disableLights():void{
var _local2:BorderLight;
super.disableLights();
if (timer){
timer.stop();
};
var _local1:int;
while (_local1 < lights.length) {
_local2 = BorderLight(lights[_local1]);
_local2.removeEventListener("switched", onLightSwitched);
_local1++;
};
}
override public function resume():void{
super.resume();
if (((timer) && (!(pausedFromMeteorShower)))){
timer.resume();
};
}
override public function disableLightsNow():void{
var _local2:BorderLight;
var _local1:int;
while (_local1 < lights.length) {
_local2 = BorderLight(lights[_local1]);
_local2.removeEventListener("switched", onLightSwitched);
_local1++;
};
if (timer){
timer.stop();
};
super.disableLightsNow();
}
override public function resumeFromMeteorShower():void{
if (((paused) && ((((type == BorderLightsType.ENERGY)) || ((type == BorderLightsType.LIFE)))))){
return;
};
pausedFromMeteorShower = false;
if (timer){
timer.resume();
};
}
override public function pause():void{
super.pause();
if (timer){
timer.pause();
};
}
protected function onLightSwitched(_arg1:Event):void{
var _local2:BorderLight = BorderLight(_arg1.target);
_local2.enabled = false;
deactiveCounter++;
if (deactiveCounter == lights.length){
disableLights();
dispatchEvent(new EventValue(COMPLETED, {x:_local2.mc.x, y:_local2.mc.y}));
timerDeattachFromGroup.start();
};
}
override public function pauseFromMeteorShower():void{
if (((paused) && ((((type == BorderLightsType.ENERGY)) || ((type == BorderLightsType.LIFE)))))){
return;
};
pausedFromMeteorShower = true;
if (timer){
timer.pause();
};
}
}
}//package _game._world._borderLights
Section 40
//ScheduleLights (_game._world._borderLights.ScheduleLights)
package _game._world._borderLights {
public class ScheduleLights {
public var type:int;
public var amount:int;
public var time:Number;
public function ScheduleLights(_arg1:int, _arg2:int, _arg3:Number){
this.amount = _arg1;
this.type = _arg2;
this.time = _arg3;
}
}
}//package _game._world._borderLights
Section 41
//SpikesLightGroup (_game._world._borderLights.SpikesLightGroup)
package _game._world._borderLights {
import framework._event.*;
import framework._sound.*;
import gs.*;
import _sound.*;
import _events.*;
public class SpikesLightGroup extends BaseLightGroup {
private var enabled:Boolean;
private var tweenAlpha:TweenMax;
private var alerts:int;// = 0
public var alpha:Number;// = 0
public function SpikesLightGroup(_arg1:Array, _arg2:int, _arg3:Number){
super(_arg1, _arg2, _arg3);
enabled = true;
}
override public function disableLights():void{
super.disableLights();
enabled = false;
}
public function startTween():void{
var _local1:Array;
var _local2:int;
var _local3:int;
if (alerts == 2){
_local1 = new Array();
_local2 = 0;
while (_local2 < lights.length) {
_local3 = 0;
while (_local3 < BorderLight(lights[_local2]).spikesRelated.length) {
if (_local1.indexOf(BorderLight(lights[_local2]).spikesRelated[_local3]) == -1){
_local1.push(BorderLight(lights[_local2]).spikesRelated[_local3]);
};
_local3++;
};
_local2++;
};
tweenAlpha = new TweenMax(this, 0.4, {alpha:0.65, onUpdate:updateAlpha});
if (enabled){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_SPIKES, {lightGroup:this, spikesArr:_local1, time:this.time}));
};
} else {
alerts++;
tweenAlpha = new TweenMax(this, 0.6, {alpha:0.75, onUpdate:updateAlpha, onComplete:reverseTween});
SoundManager.getInstance().playSound("spikes_alert", SoundGroups.GAME_SOUNDS, 1, 1);
};
}
override public function resume():void{
super.resume();
if (tweenAlpha){
tweenAlpha.resume();
};
}
private function reverseTween():void{
tweenAlpha = new TweenMax(this, 0.4, {alpha:0.15, onUpdate:updateAlpha, onComplete:startTween});
}
override public function disableLightsNow():void{
super.disableLightsNow();
enabled = false;
}
private function updateAlpha():void{
var _local1:int;
while (_local1 < lights.length) {
BorderLight(lights[_local1]).mc.alpha = alpha;
BorderLight(lights[_local1]).knockOutMc.alpha = alpha;
_local1++;
};
}
override public function pause():void{
super.pause();
if (tweenAlpha){
tweenAlpha.pause();
};
}
}
}//package _game._world._borderLights
Section 42
//CircleBounds (_game._world._circleBounds.CircleBounds)
package _game._world._circleBounds {
import framework._utils._math.*;
import framework._sound.*;
import _game._world._entity.*;
import _game._world._enemy.*;
import _game._world._player.*;
import _components.*;
import _sound.*;
public class CircleBounds {
private const PI:Number = 3.14159265358979;
public var player:Player;// = null
public var enemyMgr:EnemyMgr;// = null
public static var y:int = 294;
public static var radius:Number = 216;
private static var instance:CircleBounds = new (CircleBounds);
;
public static var x:int = 303;
public function isEntityOutOfCircle(_arg1:Entity):Boolean{
var _local2:Number = (_arg1.position.x - x);
var _local3:Number = (_arg1.position.y - y);
var _local4:Number = ((_local2 * _local2) + (_local3 * _local3));
var _local5:Number = (radius - _arg1.radius);
return ((_local4 > (_local5 * _local5)));
}
public function update():void{
var _local3:Enemy;
if (isEntityOutOfCircle(player)){
rePositionIntoCircle(player);
bounce(player, 0.6);
};
if (isNearBorder(player)){
player.nearBorder = true;
} else {
player.nearBorder = false;
player.touchingWall = false;
};
var _local1:Array = enemyMgr.enemyArr;
var _local2:int = (_local1.length - 1);
while (_local2 > -1) {
_local3 = _local1[_local2];
if (_local3.dead){
} else {
if (isNearBorder(_local3)){
_local3.nearBorder = true;
} else {
_local3.nearBorder = false;
_local3.touchingWall = false;
};
if (isEntityOutOfCircle(_local3)){
rePositionIntoCircle(_local3);
bounce(_local3, 0.5);
_local3.onCollideWithWall();
};
};
_local2--;
};
}
public function rePositionIntoCircle(_arg1:Entity):void{
var _local2:Vector3 = new Vector3();
_local2.x = (_arg1.position.x - x);
_local2.y = (_arg1.position.y - y);
_local2.normalize();
var _local3:Number = (radius - _arg1.radius);
_local2.mult(_local3);
_arg1.position.x = (_local2.x + x);
_arg1.position.y = (_local2.y + y);
}
public function bounce(_arg1:Entity, _arg2:Number):void{
var _local11:Number;
var _local3:Number = _arg1.speed.length();
if (!_local3){
return;
};
var _local4:Vector3 = new Vector3();
_local4.x = (_arg1.position.x - x);
_local4.y = (_arg1.position.y - y);
var _local5:Vector3 = _local4.clone();
_local5.mult(-1);
_local5.normalize();
var _local6:Number = Vector3.angleBetween(_local5, _arg1.speed);
var _local7:Number = Math.cos(_local6);
var _local8:Number = Math.sin(_local6);
var _local9:Number = _arg1.speed.length();
var _local10:Vector3 = _local5.crossProduct(_arg1.speed);
if (_local10.z < 0){
_arg1.speed.x = ((-(_local5.x) * _local7) + (_local5.y * _local8));
_arg1.speed.y = ((-(_local5.x) * _local8) - (_local5.y * _local7));
} else {
_arg1.speed.x = ((-(_local5.x) * _local7) - (_local5.y * _local8));
_arg1.speed.y = ((_local5.x * _local8) - (_local5.y * _local7));
};
if (_arg1.id == Components.PLAYER){
if (((!(player.touchingWall)) && (player.nearBorder))){
player.touchingWall = true;
_local11 = ((_local9 / Player(_arg1).speedMax) * (_local6 / Math.PI));
_local11 = ((_local11 < 0.25)) ? 0.25 : _local11;
SoundManager.getInstance().playSound("bump_wall", SoundGroups.GAME_SOUNDS, 1, _local11);
};
};
if (_local6 < 1.9){
_arg2 = 1;
};
_arg1.speed.mult((_local3 * _arg2));
}
public function getRandomPosAwayFromPlayer(_arg1:Vector3, _arg2:Number):void{
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local3:int;
do {
_local4 = ((((Math.random() * (radius - _arg2)) * 2) - radius) + _arg2);
_local5 = Math.sqrt((((radius - _arg2) * (radius - _arg2)) - (_local4 * _local4)));
_local6 = (((Math.random() * _local5) * 2) - _local5);
_local7 = (_local4 + x);
_local8 = (_local6 + y);
_local9 = (player.position.x - _local7);
_local10 = (player.position.y - _local8);
_local11 = ((player.radius * 2) + (_arg2 * 2));
_local3++;
if ((_local3 % 5) == 0){
_arg2 = (_arg2 - 5);
};
} while (((_local9 * _local9) + (_local10 * _local10)) < (_local11 * _local11));
_arg1.x = _local7;
_arg1.y = _local8;
}
public function getRandomPos(_arg1:Number):Vector3{
var _local2:Number = ((((Math.random() * (radius - _arg1)) * 2) - radius) + _arg1);
var _local3:Number = Math.sqrt((((radius - _arg1) * (radius - _arg1)) - (_local2 * _local2)));
var _local4:Number = (((Math.random() * _local3) * 2) - _local3);
return (new Vector3((_local2 + x), (_local4 + y)));
}
private function isNearBorder(_arg1:Entity):Boolean{
var _local2:Number = (_arg1.position.x - x);
var _local3:Number = (_arg1.position.y - y);
var _local4:Number = ((radius * 0.98) - _arg1.radius);
return ((((_local2 * _local2) + (_local3 * _local3)) > (_local4 * _local4)));
}
public static function getInstance():CircleBounds{
return (instance);
}
}
}//package _game._world._circleBounds
Section 43
//CollisionGroup (_game._world._collision.CollisionGroup)
package _game._world._collision {
public class CollisionGroup {
public var list1:Array;
public var list2:Array;
public function CollisionGroup(){
list1 = [];
list2 = [];
super();
}
}
}//package _game._world._collision
Section 44
//CollisionGroups (_game._world._collision.CollisionGroups)
package _game._world._collision {
public class CollisionGroups {
public static const ENEMY_VS_ENEMY:int = 3;
public static const POWER_VS_PLAYER:int = 2;
public static const PLAYER_VS_ALL:int = 0;
public static const POWER_VS_ENEMIES:int = 1;
}
}//package _game._world._collision
Section 45
//CollisionManager (_game._world._collision.CollisionManager)
package _game._world._collision {
import framework._utils._math.*;
import _game._world._entity.*;
public class CollisionManager {
private var groupArr:Array;
private static var instance:CollisionManager = new (CollisionManager);
;
public function CollisionManager(){
groupArr = new Array();
super();
}
public function register(_arg1:Entity, _arg2:int, _arg3:Boolean):void{
if (!groupArr[_arg2]){
groupArr[_arg2] = new CollisionGroup();
};
var _local4:CollisionGroup = groupArr[_arg2];
if (_arg3){
_local4.list1.push(_arg1);
} else {
_local4.list2.push(_arg1);
};
}
public function update():void{
var _local1:CollisionGroup;
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:Entity;
var _local6:Vector3;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:Entity;
var _local12:Vector3;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
for each (_local1 in groupArr) {
_local2 = _local1.list1;
_local3 = _local1.list2;
_local4 = (_local2.length - 1);
while (_local4 > -1) {
_local5 = Entity(_local2[_local4]);
if (!_local5.canCollide){
} else {
_local6 = _local5.globalPosition;
_local7 = _local6.x;
_local8 = _local6.y;
_local9 = _local5.radius;
_local10 = (_local3.length - 1);
while (_local10 > -1) {
_local11 = Entity(_local3[_local10]);
if (!_local11.canCollide){
} else {
_local12 = _local11.globalPosition;
_local13 = (_local7 - _local12.x);
_local14 = (_local8 - _local12.y);
_local15 = ((_local13 * _local13) + (_local14 * _local14));
_local16 = (_local9 + _local11.radius);
if (_local15 < (_local16 * _local16)){
_local5.onCollide(_local11);
_local11.onCollide(_local5);
};
};
_local10--;
};
};
_local4--;
};
};
}
public function unRegister(_arg1:Entity, _arg2:int, _arg3:Boolean):void{
var _local5:int;
if (!groupArr[_arg2]){
return;
};
var _local4:CollisionGroup = groupArr[_arg2];
if (_arg3){
_local5 = _local4.list1.indexOf(_arg1);
if (_local5 != -1){
_local4.list1.splice(_local5, 1);
};
} else {
_local5 = _local4.list2.indexOf(_arg1);
if (_local5 != -1){
_local4.list2.splice(_local5, 1);
};
};
}
public function reset():void{
groupArr = [];
}
public static function getInstance():CollisionManager{
return (instance);
}
}
}//package _game._world._collision
Section 46
//AtractorItemBehavior (_game._world._enemy.AtractorItemBehavior)
package _game._world._enemy {
import flash.events.*;
import framework._event.*;
import framework._component.*;
import framework._utils._timer.*;
import _components.*;
import _events.*;
public class AtractorItemBehavior extends Behavior {
private var timerDisable:TimerEx;
public var enabled:Boolean;// = false
public function AtractorItemBehavior(){
id = Components.ATRACTOR_ITEM_BEHAVIOR;
timerDisable = new TimerEx(1, 3, onTimerDisable);
}
override protected function onRemoved():void{
GlobalDispatcher.removeEventListener(GameEvents.PLAYER_DEAD, onPlayerDead);
}
override protected function onAdded():void{
GlobalDispatcher.addEventListener(GameEvents.PLAYER_DEAD, onPlayerDead);
}
private function onPlayerDead(_arg1:Event):void{
disable();
}
private function onTimerDisable():void{
disable();
}
public function enable():void{
if (timerDisable.isRunning()){
timerDisable.stop();
};
timerDisable.start();
enabled = true;
}
public function disable():void{
EnemyMgr(parent).disableAtractorItem();
timerDisable.stop();
enabled = false;
}
}
}//package _game._world._enemy
Section 47
//Enemy (_game._world._enemy.Enemy)
package _game._world._enemy {
import flash.events.*;
import framework._event.*;
import framework._utils._math.*;
import framework._sound.*;
import framework._core.*;
import _game._stats.*;
import flash.geom.*;
import _game._world._entity.*;
import framework._utils._timer.*;
import _game._world._player.*;
import gs.*;
import framework._mcEx.*;
import _components.*;
import _sound.*;
import _events.*;
public class Enemy extends Entity implements IUpdateable {
private const radToGrad:Number = 57.2957795130823;
public var level:int;
private var direction:Point;
protected var totalStamina:Number;// = 10
public var scorePoints:int;
public var mc:MovieClipEx;
public var atractorItemEnabled:Boolean;// = false
protected var normalSpeedMax:Number;
public var touchingWall:Boolean;// = false
protected var avoidSpeedMax:Number;
private var tweenAlpha:TweenMax;
private var dist:Vector3;
public var currentSpeedMax:Number;
protected var followAccel:Number;// = 100
private var tweenAutoKill:TweenMax;
private var timerDirection:TimerEx;
protected var minDistAvoid:Number;// = 100
private var attractSpeedMax:Number;// = 160
protected var normalAccel:Number;// = 100
private var timerCanKill:TimerEx;
public var canKill:Boolean;// = false
private var angle:Number;// = 0
private var player:Player;
public var dead:Boolean;// = false
protected var minDistFollow:Number;// = 100
protected var followSpeedMax:Number;
private var currentAccel:Number;
public var progressPoints:int;
private var timerCanCollide:TimerEx;
public var nearBorder:Boolean;// = false
private var attractAccel:Number;// = 800
protected var avoidAccel:Number;// = 100
public var scoreBonusPoints:int;
public static const DEAD:String = "dead";
public function Enemy():void{
direction = new Point();
dist = new Vector3();
super();
id = Components.ENEMY;
timerCanKill = new TimerEx(1, 0.6, onTimerCanKill);
timerCanCollide = new TimerEx(1, 0.45, onTimerCanCollide);
timerDirection = new TimerEx(1, 0, onTimerDirection);
}
public function kill(_arg1:int=1):void{
if (dead){
return;
};
Stats.enemiesKilled++;
if (_arg1 == 1){
mc.addEventListener("exploded", onExploded);
mc.gotoAndPlay("explode");
mc.points.visible = true;
} else {
if (_arg1 == 2){
mc.addEventListener("exploded", onExploded);
mc.gotoAndPlay("explode2");
} else {
dead = true;
canvas.visible = false;
dispatchEvent(new Event(DEAD));
};
};
deactivate();
canCollide = false;
canKill = false;
timerDirection.stop();
timerCanKill.stop();
timerCanCollide.stop();
if (tweenAlpha){
tweenAlpha.pause();
};
}
private function randomDirection():void{
currentSpeedMax = normalSpeedMax;
currentAccel = normalAccel;
direction.x = (Math.random() - 0.5);
direction.y = (Math.random() - 0.5);
direction.normalize(1);
}
override protected function onPaused():void{
mc.pause();
timerCanKill.pause();
timerCanCollide.pause();
timerDirection.pause();
if (tweenAlpha){
tweenAlpha.pause();
};
if (tweenAutoKill){
tweenAutoKill.pause();
};
}
private function onTimerCanCollide():void{
canCollide = true;
activate();
}
private function isNearPlayer(_arg1:Number):Boolean{
var _local2:Number = (position.x - player.position.x);
var _local3:Number = (position.y - player.position.y);
return ((((_local2 * _local2) + (_local3 * _local3)) < (_arg1 * _arg1)));
}
private function onExploded(_arg1:Event):void{
dead = true;
deactivate();
canvas.visible = false;
if (mc.points){
mc.points.visible = false;
};
dispatchEvent(new Event(DEAD));
}
private function endAutoKillTween():void{
kill(2);
}
public function onCollideWithWall():void{
randomDirection();
}
public function autoKill():void{
mc.alpha = 1;
tweenAutoKill = new TweenMax(mc, 1, {alpha:0, onComplete:endAutoKillTween});
canCollide = false;
canKill = false;
}
public function update():void{
var _local1:Number = ProcessManager.DT;
var _local2:Boolean;
if (atractorItemEnabled){
direction.x = (player.position.x - position.x);
direction.y = (player.position.y - position.y);
currentSpeedMax = attractSpeedMax;
currentAccel = attractAccel;
_local2 = true;
} else {
if (player.isAlive()){
if (Stats.playerLevel > level){
if (isNearPlayer(minDistAvoid)){
direction.x = (position.x - player.position.x);
direction.y = (position.y - player.position.y);
currentSpeedMax = avoidSpeedMax;
currentAccel = avoidAccel;
_local2 = true;
};
} else {
if (isNearPlayer(minDistFollow)){
direction.x = (player.position.x - position.x);
direction.y = (player.position.y - position.y);
currentSpeedMax = followSpeedMax;
currentAccel = followAccel;
_local2 = true;
};
};
};
};
if (!_local2){
currentSpeedMax = normalSpeedMax;
currentAccel = normalAccel;
};
direction.normalize(1);
accel.x = (currentAccel * direction.x);
accel.y = (currentAccel * direction.y);
speed.x = (speed.x + (accel.x * _local1));
speed.y = (speed.y + (accel.y * _local1));
if (speed.lengthSquared() > (currentSpeedMax * currentSpeedMax)){
speed.normalize();
speed.mult(currentSpeedMax);
};
position.x = (position.x + ((speed.x * _local1) + (((0.5 * accel.x) * _local1) * _local1)));
position.y = (position.y + ((speed.y * _local1) + (((0.5 * accel.y) * _local1) * _local1)));
}
private function onTimerCanKill():void{
canKill = true;
}
override public function onCollide(_arg1:Entity):void{
var _local2:Number;
if ((((_arg1.id == Components.PLAYER)) || ((_arg1.id == Components.CIRCLE_SHIELD)))){
if (Stats.playerLevel > level){
kill(1);
SoundManager.getInstance().playSound("player_eats_enemy", SoundGroups.GAME_SOUNDS);
EnemyMgr(parent.parent).enemyKilled(this);
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_PROGRESS_POINTS, progressPoints));
};
} else {
if (_arg1.id == Components.ENEMY){
if (level >= Stats.playerLevel){
if (_arg1 != this){
if ((((Enemy(_arg1).level >= Stats.playerLevel)) && ((Enemy(_arg1).level == level)))){
dist.x = (position.x - _arg1.position.x);
dist.y = (position.y - _arg1.position.y);
_local2 = ((radius + _arg1.radius) - dist.length());
dist.normalize();
position.x = (position.x + ((dist.x * _local2) * 0.5));
position.y = (position.y + ((dist.y * _local2) * 0.5));
};
};
};
} else {
if (_arg1.id == Components.EXPLOSION){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_PROGRESS_POINTS, progressPoints));
kill(1);
EnemyMgr(parent.parent).enemyKilled(this);
} else {
if ((((((_arg1.id == Components.SHELL_ITEM)) || ((_arg1.id == Components.METEOR)))) || ((_arg1.id == Components.EVOLUTION_ITEM)))){
if ((((_arg1.id == Components.SHELL_ITEM)) || ((_arg1.id == Components.EVOLUTION_ITEM)))){
SoundManager.getInstance().playSound("enemy_dies", SoundGroups.GAME_SOUNDS);
};
kill(2);
};
};
};
};
}
public function start():void{
onTimerDirection();
canvas.visible = true;
canvas.x = position.x;
canvas.y = position.y;
mc.gotoAndPlay("idle");
timerCanKill.start();
deactivate();
timerCanCollide.start();
mc.alpha = 0;
mc.points.visible = false;
tweenAlpha = new TweenMax(this.mc, 0.1, {alpha:1});
player = Player(root.getDescendantById(Components.PLAYER));
}
override protected function onResumed():void{
mc.resume();
timerCanKill.resume();
timerCanCollide.resume();
timerDirection.resume();
if (tweenAlpha){
tweenAlpha.resume();
};
if (tweenAutoKill){
tweenAutoKill.resume();
};
}
private function onTimerDirection():void{
randomDirection();
timerDirection.setTimeAmount(((Math.random() * 2) + 3));
timerDirection.start();
}
}
}//package _game._world._enemy
Section 48
//Enemy0 (_game._world._enemy.Enemy0)
package _game._world._enemy {
import assets.entity.*;
public class Enemy0 extends Enemy {
public function Enemy0():void{
level = 0;
mc = new Enemy1Asset();
radius = 6;
scorePoints = 10;
scoreBonusPoints = 10;
progressPoints = 1;
normalSpeedMax = 25;
normalAccel = 60;
avoidSpeedMax = 35;
avoidAccel = 50;
followSpeedMax = 0;
followAccel = 0;
minDistAvoid = 70;
minDistFollow = 100;
canvas.visible = false;
canvas.addChild(mc);
}
}
}//package _game._world._enemy
Section 49
//Enemy1 (_game._world._enemy.Enemy1)
package _game._world._enemy {
import _game._stats.*;
import assets.entity.*;
public class Enemy1 extends Enemy {
public function Enemy1():void{
level = 1;
mc = new Enemy2Asset();
radius = 9;
scorePoints = 50;
scoreBonusPoints = 50;
progressPoints = 2;
if (Stats.gameMode == GameModes.NORMAL){
normalSpeedMax = 30;
normalAccel = 60;
avoidSpeedMax = 40;
avoidAccel = 70;
followSpeedMax = 40;
followAccel = 70;
minDistAvoid = 70;
minDistFollow = 60;
} else {
if (Stats.gameMode == GameModes.HARD){
normalSpeedMax = 45;
normalAccel = 70;
avoidSpeedMax = 50;
avoidAccel = 80;
followSpeedMax = 65;
followAccel = 120;
minDistAvoid = 70;
minDistFollow = 80;
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
normalSpeedMax = 50;
normalAccel = 70;
avoidSpeedMax = 50;
avoidAccel = 80;
followSpeedMax = 100;
followAccel = 120;
minDistAvoid = 70;
minDistFollow = 150;
};
};
};
canvas.visible = false;
canvas.addChild(mc);
}
}
}//package _game._world._enemy
Section 50
//Enemy2 (_game._world._enemy.Enemy2)
package _game._world._enemy {
import _game._stats.*;
import assets.entity.*;
public class Enemy2 extends Enemy {
public function Enemy2():void{
level = 2;
mc = new Enemy3Asset();
radius = 12.6;
scorePoints = 100;
scoreBonusPoints = 100;
progressPoints = 3;
if (Stats.gameMode == GameModes.NORMAL){
normalSpeedMax = 35;
normalAccel = 60;
avoidSpeedMax = 40;
avoidAccel = 70;
followSpeedMax = 45;
followAccel = 70;
minDistAvoid = 75;
minDistFollow = 65;
} else {
if (Stats.gameMode == GameModes.HARD){
normalSpeedMax = 50;
normalAccel = 65;
avoidSpeedMax = 60;
avoidAccel = 90;
followSpeedMax = 65;
followAccel = 110;
minDistAvoid = 85;
minDistFollow = 80;
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
normalSpeedMax = 50;
normalAccel = 65;
avoidSpeedMax = 60;
avoidAccel = 90;
followSpeedMax = 65;
followAccel = 110;
minDistAvoid = 85;
minDistFollow = 80;
};
};
};
canvas.visible = false;
canvas.addChild(mc);
}
}
}//package _game._world._enemy
Section 51
//Enemy3 (_game._world._enemy.Enemy3)
package _game._world._enemy {
import _game._stats.*;
import assets.entity.*;
public class Enemy3 extends Enemy {
public function Enemy3():void{
level = 3;
mc = new Enemy4Asset();
radius = 15.2;
scorePoints = 250;
scoreBonusPoints = 250;
progressPoints = 4;
if (Stats.gameMode == GameModes.NORMAL){
normalSpeedMax = 45;
normalAccel = 65;
avoidSpeedMax = 50;
avoidAccel = 80;
followSpeedMax = 45;
followAccel = 80;
minDistAvoid = 75;
minDistFollow = 60;
} else {
if (Stats.gameMode == GameModes.HARD){
normalSpeedMax = 65;
normalAccel = 100;
avoidSpeedMax = 55;
avoidAccel = 130;
followSpeedMax = 75;
followAccel = 115;
minDistAvoid = 100;
minDistFollow = 110;
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
normalSpeedMax = 70;
normalAccel = 100;
avoidSpeedMax = 55;
avoidAccel = 120;
followSpeedMax = 115;
followAccel = 115;
minDistAvoid = 100;
minDistFollow = 200;
};
};
};
canvas.visible = false;
canvas.addChild(mc);
}
}
}//package _game._world._enemy
Section 52
//Enemy4 (_game._world._enemy.Enemy4)
package _game._world._enemy {
import _game._stats.*;
import assets.entity.*;
public class Enemy4 extends Enemy {
public function Enemy4():void{
level = 4;
mc = new Enemy5Asset();
radius = 17;
scorePoints = 500;
scoreBonusPoints = 500;
progressPoints = 5;
if (Stats.gameMode == GameModes.NORMAL){
normalSpeedMax = 35;
normalAccel = 70;
avoidSpeedMax = 55;
avoidAccel = 100;
followSpeedMax = 40;
followAccel = 80;
minDistAvoid = 90;
minDistFollow = 75;
} else {
if (Stats.gameMode == GameModes.HARD){
normalSpeedMax = 65;
normalAccel = 100;
avoidSpeedMax = 55;
avoidAccel = 120;
followSpeedMax = 65;
followAccel = 100;
minDistAvoid = 100;
minDistFollow = 75;
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
normalSpeedMax = 65;
normalAccel = 100;
avoidSpeedMax = 55;
avoidAccel = 120;
followSpeedMax = 75;
followAccel = 100;
minDistAvoid = 100;
minDistFollow = 80;
};
};
};
canvas.visible = false;
canvas.addChild(mc);
}
}
}//package _game._world._enemy
Section 53
//Enemy5 (_game._world._enemy.Enemy5)
package _game._world._enemy {
import _game._stats.*;
import assets.entity.*;
public class Enemy5 extends Enemy {
public function Enemy5():void{
level = 5;
mc = new Enemy6Asset();
radius = 19;
scorePoints = 1000;
scoreBonusPoints = 1000;
progressPoints = 6;
if (Stats.gameMode == GameModes.NORMAL){
normalSpeedMax = 40;
normalAccel = 70;
avoidSpeedMax = 55;
avoidAccel = 100;
followSpeedMax = 45;
followAccel = 90;
minDistAvoid = 100;
minDistFollow = 80;
} else {
if (Stats.gameMode == GameModes.HARD){
normalSpeedMax = 70;
normalAccel = 100;
avoidSpeedMax = 55;
avoidAccel = 120;
followSpeedMax = 80;
followAccel = 100;
minDistAvoid = 100;
minDistFollow = 75;
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
normalSpeedMax = 70;
normalAccel = 100;
avoidSpeedMax = 55;
avoidAccel = 120;
followSpeedMax = 115;
followAccel = 120;
minDistAvoid = 100;
minDistFollow = 220;
};
};
};
canvas.visible = false;
canvas.addChild(mc);
}
}
}//package _game._world._enemy
Section 54
//Enemy6 (_game._world._enemy.Enemy6)
package _game._world._enemy {
import assets.entity.*;
public class Enemy6 extends Enemy {
public function Enemy6():void{
level = 6;
mc = new Enemy7Asset();
radius = 21.4;
scorePoints = 2500;
scoreBonusPoints = 2500;
progressPoints = 7;
normalSpeedMax = 70;
normalAccel = 100;
avoidSpeedMax = 55;
avoidAccel = 120;
followSpeedMax = 80;
followAccel = 110;
minDistAvoid = 100;
minDistFollow = 100;
canvas.visible = false;
canvas.addChild(mc);
}
}
}//package _game._world._enemy
Section 55
//EnemyMgr (_game._world._enemy.EnemyMgr)
package _game._world._enemy {
import flash.events.*;
import framework._event.*;
import framework._component.*;
import framework._sound.*;
import _game._stats.*;
import _game._world._circleBounds.*;
import framework._utils._timer.*;
import _game._world._collision.*;
import _components.*;
import _sound.*;
import flash.text.*;
import _events.*;
public class EnemyMgr extends WorldObject {
var bonusArr:Array;
private var timeGenerateLowerMod:Number;// = 0
private var enemyPool:EnemyPool;
private var txtFormat:TextFormat;
private var timeGenerateHigherBase:Number;// = 0
private var timerGenerateLowerLevel:TimerEx;
public var generationEnabled:Boolean;
private var bonusTimerArr:Array;
private var enemyTypeArr:Array;
private var timeGenerateLowerBase:Number;// = 0
private var timeGenerateHigherMod:Number;// = 0
public var enemyArr:Array;
private var timerGenerateHigherLevel:TimerEx;
public function EnemyMgr():void{
enemyArr = new Array();
enemyTypeArr = new Array();
bonusArr = new Array();
bonusTimerArr = new Array();
txtFormat = new TextFormat("ScienceProject");
super();
id = Components.ENEMY_MANAGER;
}
public function autoKillEnemies():void{
var _local1:int = (enemyArr.length - 1);
while (_local1 > -1) {
Enemy(enemyArr[_local1]).autoKill();
_local1--;
};
}
private function onUpdateTimeGenerate(_arg1:EventValue):void{
if (_arg1.value.higher){
timeGenerateHigherBase = _arg1.value.baseTime;
timeGenerateHigherMod = _arg1.value.modTime;
} else {
timeGenerateLowerBase = _arg1.value.baseTime;
timeGenerateLowerMod = _arg1.value.modTime;
};
}
public function resumeGenerating():void{
generationEnabled = true;
timerGenerateHigherLevel.resume();
timerGenerateLowerLevel.resume();
}
public function pauseGenerating():void{
generationEnabled = false;
timerGenerateHigherLevel.pause();
timerGenerateLowerLevel.pause();
}
public function stop():void{
timerGenerateLowerLevel.stop();
timerGenerateHigherLevel.stop();
killEnemies();
GlobalDispatcher.removeEventListener(GameEvents.ADD_ENEMIES, onAddEnemies);
GlobalDispatcher.removeEventListener(GameEvents.CHANGE_GENERATION_RATE, onUpdateTimeGenerate);
GlobalDispatcher.removeEventListener(GameEvents.PLAYER_GROWS, onPlayerGrows);
}
public function stopGenerating():void{
generationEnabled = false;
timerGenerateHigherLevel.stop();
timerGenerateLowerLevel.stop();
}
private function onPlayerGrows(_arg1:Event):void{
if (AtractorItemBehavior(getChildById(Components.ATRACTOR_ITEM_BEHAVIOR)).enabled){
enableAtractorItem(false);
};
var _local2:int = (enemyArr.length - 1);
while (_local2 > -1) {
if (enemyArr[_local2].level == (Stats.playerLevel - 1)){
CollisionManager.getInstance().unRegister(enemyArr[_local2], CollisionGroups.ENEMY_VS_ENEMY, true);
CollisionManager.getInstance().unRegister(enemyArr[_local2], CollisionGroups.ENEMY_VS_ENEMY, false);
};
_local2--;
};
}
private function generateEnemy(_arg1:int):void{
var _local2:int = enemyTypeArr.length;
var _local3:Array = enemyPool.getEnemy(_arg1);
var _local4:Enemy = Enemy(_local3[0]);
if (_local3[1] == true){
children[_arg1].addChild(_local4);
enemyArr.push(_local4);
CollisionManager.getInstance().register(_local4, CollisionGroups.PLAYER_VS_ALL, false);
if (_local4.level >= Stats.playerLevel){
CollisionManager.getInstance().register(_local4, CollisionGroups.ENEMY_VS_ENEMY, true);
CollisionManager.getInstance().register(_local4, CollisionGroups.ENEMY_VS_ENEMY, false);
};
CollisionManager.getInstance().register(_local4, CollisionGroups.POWER_VS_ENEMIES, false);
};
if (_local4.level < Stats.playerLevel){
if (AtractorItemBehavior(getChildById(Components.ATRACTOR_ITEM_BEHAVIOR)).enabled){
_local4.atractorItemEnabled = true;
};
CircleBounds.getInstance().getRandomPosAwayFromPlayer(_local4.position, _local4.radius);
} else {
CircleBounds.getInstance().getRandomPosAwayFromPlayer(_local4.position, (_local4.radius * 6));
};
_local4.start();
var _local5:Number = Math.random();
if (_local5 < 0.33){
SoundManager.getInstance().playSound("enemyAppear", SoundGroups.GAME_SOUNDS, 1, 0.5);
} else {
if (_local5 < 0.66){
SoundManager.getInstance().playSound("enemyAppear2", SoundGroups.GAME_SOUNDS, 1, 0.5);
} else {
SoundManager.getInstance().playSound("enemyAppear3", SoundGroups.GAME_SOUNDS, 1, 0.5);
};
};
}
private function onAddEnemies(_arg1:EventValue):void{
enemyTypeArr = (_arg1.value as Array);
}
public function disableAtractorItem():void{
var _local1:int = (enemyArr.length - 1);
while (_local1 > -1) {
enemyArr[_local1].atractorItemEnabled = false;
_local1--;
};
}
private function getTypesMissing():Array{
var _local1:Array = [0, 0, 0, 0, 0, 0, 0];
var _local2:int = (enemyArr.length - 1);
while (_local2 > -1) {
if (!enemyArr[_local2].dead){
var _local5 = _local1;
var _local6 = Enemy(enemyArr[_local2]).level;
var _local7 = (_local5[_local6] + 1);
_local5[_local6] = _local7;
};
_local2--;
};
var _local3:Array = [];
var _local4:int = enemyTypeArr.length;
_local2 = 0;
while (_local2 < _local4) {
if (int(enemyTypeArr[_local2]) > _local1[_local2]){
_local3.push(_local2);
};
_local2++;
};
return (_local3);
}
public function enableAtractorItem(_arg1:Boolean=true):void{
if (_arg1){
AtractorItemBehavior(getChildById(Components.ATRACTOR_ITEM_BEHAVIOR)).enable();
};
var _local2:int = Stats.playerLevel;
var _local3:int = (enemyArr.length - 1);
while (_local3 > -1) {
if (enemyArr[_local3].level < _local2){
enemyArr[_local3].atractorItemEnabled = true;
};
_local3--;
};
}
function enemyKilled(_arg1:Enemy):void{
var _local2:int = (_arg1.scorePoints + (bonusArr[_arg1.level] * _arg1.scoreBonusPoints));
txtFormat.size = (12 + bonusArr[_arg1.level]);
var _local3:TextField = _arg1.mc.points.tf;
_local3.embedFonts = true;
_local3.autoSize = TextFieldAutoSize.CENTER;
_local3.defaultTextFormat = txtFormat;
_local3.text = _local2.toString();
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_SCORE, _local2));
var _local4 = bonusArr;
var _local5 = _arg1.level;
var _local6 = (_local4[_local5] + 1);
_local4[_local5] = _local6;
if (bonusArr[_arg1.level] > 4){
bonusArr[_arg1.level] = 4;
};
bonusTimerArr[_arg1.level].stop();
bonusTimerArr[_arg1.level].start();
}
private function onGenerateHigherLevelEnemy():void{
timerGenerateHigherLevel.setTimeAmount(((Math.random() * timeGenerateHigherMod) + timeGenerateHigherBase));
timerGenerateHigherLevel.start();
if (!generationEnabled){
return;
};
if (enemyTypeArr == null){
return;
};
var _local1:Array = getTypesMissing();
if (_local1.length == 0){
return;
};
var _local2:Array = [];
var _local3:int = (_local1.length - 1);
while (_local3 > -1) {
if (_local1[_local3] >= Stats.playerLevel){
_local2.push(_local1[_local3]);
};
_local3--;
};
if (_local2.length == 0){
return;
};
var _local4:int = _local2[int((Math.random() * _local2.length))];
generateEnemy(_local4);
}
public function killEnemies():void{
var _local1:int = (enemyArr.length - 1);
while (_local1 > -1) {
Enemy(enemyArr[_local1]).kill(2);
_local1--;
};
}
private function onBonusTimer(_arg1:TimerEx):void{
var _local2:int;
while (_local2 < bonusTimerArr.length) {
if (_arg1 == bonusTimerArr[_local2]){
bonusArr[_local2] = 0;
break;
};
_local2++;
};
}
override protected function onAddedToRoute():void{
generationEnabled = true;
enemyPool = new EnemyPool();
enemyPool.reset();
GlobalDispatcher.addEventListener(GameEvents.ADD_ENEMIES, onAddEnemies);
GlobalDispatcher.addEventListener(GameEvents.CHANGE_GENERATION_RATE, onUpdateTimeGenerate);
GlobalDispatcher.addEventListener(GameEvents.PLAYER_GROWS, onPlayerGrows);
timerGenerateLowerLevel = new TimerEx(1, 2, onGenerateLowerLevelEnemy);
timerGenerateLowerLevel.start();
timerGenerateHigherLevel = new TimerEx(1, 2, onGenerateHigherLevelEnemy);
timerGenerateHigherLevel.start();
var _local1:int;
while (_local1 < 7) {
addChild(new WorldObject());
bonusTimerArr[_local1] = new TimerEx(1, 1, onBonusTimer);
bonusTimerArr[_local1].callbackParams = [bonusTimerArr[_local1]];
bonusArr[_local1] = 0;
_local1++;
};
addChild(new AtractorItemBehavior());
}
override protected function onPaused():void{
if (generationEnabled){
if (timerGenerateLowerLevel != null){
timerGenerateLowerLevel.pause();
};
if (timerGenerateHigherLevel != null){
timerGenerateHigherLevel.pause();
};
};
var _local1:int;
while (_local1 < bonusTimerArr.length) {
bonusTimerArr[_local1].pause();
_local1++;
};
}
private function onGenerateLowerLevelEnemy():void{
timerGenerateLowerLevel.setTimeAmount(((Math.random() * timeGenerateLowerMod) + timeGenerateLowerBase));
timerGenerateLowerLevel.start();
if (!generationEnabled){
return;
};
if (enemyTypeArr == null){
return;
};
var _local1:Array = getTypesMissing();
if (_local1.length == 0){
return;
};
var _local2:Array = [];
var _local3:int = (_local1.length - 1);
while (_local3 > -1) {
if (_local1[_local3] < Stats.playerLevel){
_local2.push(_local1[_local3]);
};
_local3--;
};
if (_local2.length == 0){
return;
};
var _local4:int = _local2[int((Math.random() * _local2.length))];
generateEnemy(_local4);
}
override protected function onResumed():void{
if (generationEnabled){
if (timerGenerateLowerLevel != null){
timerGenerateLowerLevel.resume();
};
if (timerGenerateHigherLevel != null){
timerGenerateHigherLevel.resume();
};
};
var _local1:int;
while (_local1 < bonusTimerArr.length) {
bonusTimerArr[_local1].resume();
_local1++;
};
}
}
}//package _game._world._enemy
Section 56
//EnemyPool (_game._world._enemy.EnemyPool)
package _game._world._enemy {
import _game._world._collision.*;
import framework._utils._global.*;
public class EnemyPool {
public var enemyArr:Array;
public var collMgr:CollisionManager;
public function EnemyPool(){
enemyArr = new Array();
super();
}
public function getEnemy(_arg1:int):Array{
var _local6:Enemy;
if (enemyArr[_arg1] == null){
enemyArr[_arg1] = new Array();
};
var _local2:Array = (enemyArr[_arg1] as Array);
var _local3:int = _local2.length;
var _local4:int;
while (_local4 < _local3) {
_local6 = Enemy(_local2[_local4]);
if (_local6.dead){
_local6.dead = false;
_local6.mc.alpha = 1;
return (new Array(_local6, false));
};
_local4++;
};
var _local5:Enemy = getClassInstance(("_game._world._enemy.Enemy" + _arg1));
_local2.push(_local5);
return ([_local5, true]);
}
public function reset():void{
enemyArr.splice(0, enemyArr.length);
}
}
}//package _game._world._enemy
Section 57
//Entity (_game._world._entity.Entity)
package _game._world._entity {
import framework._component.*;
import framework._utils._math.*;
public class Entity extends WorldObject {
public var size:Vector3;
public var speed:Vector3;
public var accel:Vector3;
public var canCollide:Boolean;// = true
public var radius:Number;// = 0
public function Entity(){
size = new Vector3();
speed = new Vector3();
accel = new Vector3();
super();
}
public function onCollide(_arg1:Entity):void{
}
}
}//package _game._world._entity
Section 58
//Explosion (_game._world._explosion.Explosion)
package _game._world._explosion {
import flash.display.*;
import flash.events.*;
import framework._sound.*;
import flash.geom.*;
import flash.filters.*;
import _game._world._entity.*;
import _game._world._circleBounds.*;
import _game._world._collision.*;
import gs.*;
import _components.*;
import _sound.*;
import gs.easing.*;
import _events.*;
public class Explosion extends Entity {
private var tween:TweenMax;
private var RADIUS:Number;// = 0
private var explosion:Shape;
private var tweenAlpha:TweenMax;
public function Explosion(_arg1:int):void{
explosion = new Shape();
super();
id = Components.EXPLOSION;
switch (_arg1){
case 1:
RADIUS = 80;
break;
case 2:
RADIUS = 150;
break;
case 3:
RADIUS = 300;
break;
case 4:
RADIUS = (CircleBounds.radius * 2);
break;
};
var _local2:Matrix = new Matrix();
_local2.createGradientBox(RADIUS, RADIUS, 0, (-(RADIUS) / 2), (-(RADIUS) / 2));
switch (_arg1){
case 1:
explosion.graphics.beginGradientFill(GradientType.RADIAL, [0x555500, 0xFFCC00], [1, 1], [0, 0xFF], _local2);
break;
case 2:
explosion.graphics.beginGradientFill(GradientType.RADIAL, [0x5500, 64068], [0.2, 0.8], [0, 0xFF], _local2);
break;
case 3:
explosion.graphics.beginGradientFill(GradientType.RADIAL, [0x5555, 52479], [1, 1], [0, 0xFF], _local2);
break;
case 4:
explosion.graphics.beginGradientFill(GradientType.RADIAL, [0x5555, 52479], [1, 1], [0, 0xFF], _local2);
break;
};
explosion.graphics.drawCircle(0, 0, (RADIUS * 0.7));
explosion.graphics.endFill();
explosion.filters = [new BlurFilter((15 + (3 * _arg1)), (15 + (3 * _arg1)))];
explosion.blendMode = BlendMode.HARDLIGHT;
var _local3:Shape = new Shape();
_local3.graphics.beginFill(0, 1);
_local3.graphics.drawCircle(0, 0, CircleBounds.radius);
_local3.graphics.endFill();
_local3.x = CircleBounds.x;
_local3.y = CircleBounds.y;
canvas.mask = _local3;
canvas.addChild(explosion);
canvas.visible = false;
deactivate();
}
override protected function onAdded():void{
CollisionManager.getInstance().register(this, CollisionGroups.POWER_VS_ENEMIES, true);
canCollide = true;
canvas.visible = true;
radius = (RADIUS * 0.08);
explosion.width = (explosion.height = (radius * 2));
tween = new TweenMax(this, 0.8, {radius:RADIUS, onUpdate:onUpdateTween, onComplete:onTweenComplete, ease:Cubic.easeIn});
canvas.alpha = 1;
SoundManager.getInstance().playSound("player_uses_bomb", SoundGroups.GAME_SOUNDS);
draw();
}
private function onUpdateTween():void{
explosion.width = (explosion.height = (radius * 2));
}
private function onTweenComplete():void{
canCollide = false;
tweenAlpha = new TweenMax(canvas, 0.5, {alpha:0, onComplete:onTweenAlphaComplete});
}
override protected function onRemoved():void{
CollisionManager.getInstance().unRegister(this, CollisionGroups.POWER_VS_ENEMIES, true);
}
private function onTweenAlphaComplete():void{
canvas.visible = false;
dispatchEvent(new Event(GameEvents.EXPLOSION_FINISHED));
}
override protected function onPaused():void{
if (tween){
tween.pause();
};
if (tweenAlpha){
tweenAlpha.pause();
};
}
override protected function onResumed():void{
if (tween){
tween.resume();
};
if (tweenAlpha){
tweenAlpha.resume();
};
}
}
}//package _game._world._explosion
Section 59
//Atractor (_game._world._item.Atractor)
package _game._world._item {
import flash.events.*;
import framework._sound.*;
import _game._world._entity.*;
import _game._world._enemy.*;
import framework._utils._timer.*;
import _components.*;
import _sound.*;
public class Atractor extends Entity {
private var timerRemove:TimerEx;
private static var lastAtractorEnabled:Atractor = null;
public function Atractor(){
timerRemove = new TimerEx(1, 10, onTimerRemove);
super();
id = Components.ATRACTOR;
radius = 5;
canvas.graphics.beginFill(30719, 1);
canvas.graphics.drawCircle(0, 0, radius);
canvas.graphics.endFill();
deactivate();
}
override protected function onAdded():void{
timerRemove.start();
}
override protected function onResumed():void{
timerRemove.resume();
}
override protected function onRemoved():void{
timerRemove.stop();
}
private function onTimerRemove():void{
canCollide = false;
dispatchEvent(new Event(ItemMgr.REMOVE_ITEM));
}
override protected function onPaused():void{
timerRemove.pause();
}
override public function onCollide(_arg1:Entity):void{
EnemyMgr(root.getDescendantById(Components.ENEMY_MANAGER)).enableAtractorItem();
SoundManager.getInstance().playSound("player_picks_up_bomb", SoundGroups.GAME_SOUNDS);
lastAtractorEnabled = this;
canCollide = false;
canvas.visible = false;
timerRemove.stop();
}
}
}//package _game._world._item
Section 60
//Bomb (_game._world._item.Bomb)
package _game._world._item {
import flash.events.*;
import framework._event.*;
import framework._sound.*;
import _game._stats.*;
import assets.*;
import _game._world._entity.*;
import framework._utils._timer.*;
import _components.*;
import _sound.*;
import _events.*;
public class Bomb extends Entity {
private var timer:TimerEx;
private var mc:BombAsset;
public function Bomb(){
mc = new BombAsset();
super();
id = Components.BOMB;
canvas.addChild(mc);
radius = 11;
timer = new TimerEx(1, 18, onTimer);
deactivate();
}
override protected function onAdded():void{
canCollide = true;
mc.gotoAndPlay("idle");
canvas.visible = true;
timer.start();
SoundManager.getInstance().playSound("enemyAppear", SoundGroups.GAME_SOUNDS, 1, 0.5);
}
private function onTimer():void{
canCollide = false;
mc.gotoAndPlay("caught");
mc.addEventListener("caught_anim_end", onCaughtAnimEnd);
dispatchEvent(new Event(ItemMgr.REMOVE_ITEM));
}
public function playCaughtAnim():void{
mc.gotoAndPlay("caught");
}
override public function resume():void{
super.resume();
mc.resume();
timer.resume();
}
private function onCaughtAnimEnd(_arg1:Event):void{
canvas.visible = false;
mc.stop();
dispatchEvent(new Event(ItemMgr.REMOVE_ITEM));
}
override public function pause():void{
super.pause();
mc.pause();
timer.pause();
}
public function playScoreAnim():void{
if (Stats.overBombs == 0){
Stats.overBombs++;
mc.gotoAndPlay("caught5000");
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_SCORE, 5000));
} else {
if (Stats.overBombs == 1){
Stats.overBombs++;
mc.gotoAndPlay("caught10000");
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_SCORE, 10000));
} else {
if (Stats.overBombs == 2){
mc.gotoAndPlay("caught25000");
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_SCORE, 25000));
};
};
};
}
override public function onCollide(_arg1:Entity):void{
SoundManager.getInstance().playSound("player_picks_up_bomb", SoundGroups.GAME_SOUNDS);
canCollide = false;
mc.addEventListener("caught_anim_end", onCaughtAnimEnd);
timer.stop();
}
}
}//package _game._world._item
Section 61
//ItemMgr (_game._world._item.ItemMgr)
package _game._world._item {
import flash.events.*;
import framework._event.*;
import framework._component.*;
import _game._world._entity.*;
import _game._world._circleBounds.*;
import _game._world._collision.*;
import _components.*;
import _events.*;
public class ItemMgr extends WorldObject {
public static const REMOVE_ITEM:String = "removeItem";
public function ItemMgr():void{
id = Components.ITEM_MANAGER;
}
private function onAddSuperBomb(_arg1:Event):void{
if (getChildrenByType(SuperBomb).length >= 10){
return;
};
var _local2:SuperBomb = new SuperBomb();
CircleBounds.getInstance().getRandomPosAwayFromPlayer(_local2.position, 60);
addItem(_local2);
}
private function addItem(_arg1:Entity):void{
_arg1.canvas.x = _arg1.position.x;
_arg1.canvas.y = _arg1.position.y;
_arg1.draw();
CollisionManager.getInstance().register(_arg1, CollisionGroups.PLAYER_VS_ALL, false);
_arg1.addEventListener(REMOVE_ITEM, onRemoveItem);
addChild(_arg1);
}
private function onRemoveItem(_arg1:Event):void{
removeChild(Entity(_arg1.target));
CollisionManager.getInstance().unRegister(Entity(_arg1.target), CollisionGroups.PLAYER_VS_ALL, false);
}
private function onAddAtractor(_arg1:Event):void{
var _local2:Atractor = new Atractor();
CircleBounds.getInstance().getRandomPosAwayFromPlayer(_local2.position, _local2.radius);
addItem(_local2);
}
private function onAddThunder(_arg1:Event):void{
var _local2:Thunder = new Thunder();
CircleBounds.getInstance().getRandomPosAwayFromPlayer(_local2.position, _local2.radius);
addItem(_local2);
}
private function onAddShield(_arg1:Event):void{
var _local2:Shield = new Shield();
CircleBounds.getInstance().getRandomPosAwayFromPlayer(_local2.position, _local2.radius);
addItem(_local2);
}
private function onAddBomb(_arg1:Event):void{
if (getChildrenByType(Bomb).length >= 10){
return;
};
var _local2:Bomb = new Bomb();
CircleBounds.getInstance().getRandomPosAwayFromPlayer(_local2.position, _local2.radius);
addItem(_local2);
}
public function removeAll():void{
while (children.length) {
CollisionManager.getInstance().unRegister(Entity(children[0]), CollisionGroups.PLAYER_VS_ALL, false);
removeChildAt(0);
};
}
override protected function onAddedToRoute():void{
GlobalDispatcher.addEventListener(GameEvents.ADD_BOMB_TO_WORLD, onAddBomb);
GlobalDispatcher.addEventListener(GameEvents.ADD_SHIELD_TO_WORLD, onAddShield);
GlobalDispatcher.addEventListener(GameEvents.ADD_ATRACTOR_TO_WORLD, onAddAtractor);
GlobalDispatcher.addEventListener(GameEvents.ADD_THUNDER_TO_WORLD, onAddThunder);
GlobalDispatcher.addEventListener(GameEvents.ADD_SUPER_BOMB_TO_WORLD, onAddSuperBomb);
}
override protected function onRemovedFromRoute():void{
GlobalDispatcher.removeEventListener(GameEvents.ADD_BOMB_TO_WORLD, onAddBomb);
GlobalDispatcher.removeEventListener(GameEvents.ADD_SHIELD_TO_WORLD, onAddShield);
GlobalDispatcher.removeEventListener(GameEvents.ADD_ATRACTOR_TO_WORLD, onAddAtractor);
GlobalDispatcher.removeEventListener(GameEvents.ADD_THUNDER_TO_WORLD, onAddThunder);
GlobalDispatcher.removeEventListener(GameEvents.ADD_SUPER_BOMB_TO_WORLD, onAddSuperBomb);
}
}
}//package _game._world._item
Section 62
//Shield (_game._world._item.Shield)
package _game._world._item {
import flash.events.*;
import framework._sound.*;
import assets.*;
import _game._world._entity.*;
import framework._utils._timer.*;
import _game._world._player.*;
import _components.*;
import _sound.*;
public class Shield extends Entity {
private var timer:TimerEx;
public function Shield(){
id = Components.SHIELD;
canvas.addChild(new ShieldAsset());
radius = 10;
timer = new TimerEx(1, 10, onTimer);
deactivate();
}
override protected function onRemoved():void{
timer.stop();
}
private function onTimer():void{
canCollide = false;
canvas.visible = false;
dispatchEvent(new Event(ItemMgr.REMOVE_ITEM));
}
override protected function onResumed():void{
timer.resume();
}
override protected function onAdded():void{
canCollide = true;
timer.start();
}
override protected function onPaused():void{
timer.pause();
}
override public function onCollide(_arg1:Entity):void{
if (!(_arg1 is Player)){
return;
};
SoundManager.getInstance().playSound("player_picks_up_bomb", SoundGroups.GAME_SOUNDS);
canCollide = false;
canvas.visible = false;
timer.stop();
dispatchEvent(new Event(ItemMgr.REMOVE_ITEM));
}
}
}//package _game._world._item
Section 63
//SuperBomb (_game._world._item.SuperBomb)
package _game._world._item {
import flash.events.*;
import framework._sound.*;
import framework._core.*;
import _game._stats.*;
import assets.*;
import _game._world._entity.*;
import _game._world._circleBounds.*;
import _components.*;
import _sound.*;
public class SuperBomb extends Entity implements IUpdateable {
private const SPEED_LENGTH:Number = 40;
private var mc:SuperBombAsset;
public function SuperBomb(){
mc = new SuperBombAsset();
super();
id = Components.SUPER_BOMB;
canvas.addChild(mc);
radius = 11;
}
override protected function onAdded():void{
canCollide = true;
mc.gotoAndPlay("idle");
canvas.visible = true;
var _local1:Number = ((Math.PI * 2) * Math.random());
speed.x = (Math.cos(_local1) * SPEED_LENGTH);
speed.y = (Math.sin(_local1) * SPEED_LENGTH);
SoundManager.getInstance().playSound("enemyAppear", SoundGroups.GAME_SOUNDS, 1, 1);
}
override public function resume():void{
super.resume();
mc.resume();
}
private function onCaughtAnimEnd(_arg1:Event):void{
mc.stop();
canvas.visible = false;
dispatchEvent(new Event(ItemMgr.REMOVE_ITEM));
}
public function update():void{
var _local1:Number = ProcessManager.DT;
if (CircleBounds.getInstance().isEntityOutOfCircle(this)){
CircleBounds.getInstance().bounce(this, 1);
};
position.x = (position.x + (speed.x * _local1));
position.y = (position.y + (speed.y * _local1));
}
override public function pause():void{
super.pause();
mc.pause();
}
override public function onCollide(_arg1:Entity):void{
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Super bomb");
SoundManager.getInstance().playSound("player_picks_up_bomb", SoundGroups.GAME_SOUNDS);
canCollide = false;
mc.gotoAndPlay("caught");
mc.addEventListener("caught_anim_end", onCaughtAnimEnd);
deactivate();
}
}
}//package _game._world._item
Section 64
//Thunder (_game._world._item.Thunder)
package _game._world._item {
import flash.events.*;
import framework._sound.*;
import assets.*;
import _game._world._entity.*;
import framework._utils._timer.*;
import _components.*;
import _sound.*;
public class Thunder extends Entity {
private var timer:TimerEx;
public function Thunder(){
id = Components.THUNDER;
canvas.addChild(new ShieldAsset());
radius = 10;
timer = new TimerEx(1, 10, onTimer);
deactivate();
}
override protected function onRemoved():void{
timer.stop();
}
private function onTimer():void{
canCollide = false;
canvas.visible = false;
dispatchEvent(new Event(ItemMgr.REMOVE_ITEM));
}
override protected function onResumed():void{
timer.resume();
}
override protected function onAdded():void{
canCollide = true;
timer.start();
}
override protected function onPaused():void{
timer.pause();
}
override public function onCollide(_arg1:Entity):void{
SoundManager.getInstance().playSound("player_picks_up_bomb", SoundGroups.GAME_SOUNDS);
canCollide = false;
canvas.visible = false;
timer.stop();
dispatchEvent(new Event(ItemMgr.REMOVE_ITEM));
}
}
}//package _game._world._item
Section 65
//Meteor (_game._world._meteors.Meteor)
package _game._world._meteors {
import flash.display.*;
import flash.events.*;
import framework._sound.*;
import framework._core.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import flash.filters.*;
import assets.*;
import _game._world._entity.*;
import framework._utils._timer.*;
import _game._world._collision.*;
import org.flintparticles.twoD.emitters.*;
import gs.*;
import _backgrounds.*;
import org.flintparticles.twoD.renderers.*;
import _screens._final.*;
import _components.*;
import _sound.*;
import gs.easing.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class Meteor extends Entity implements IUpdateable {
private const initialRadius:Number = 10;
public var enabled:Boolean;// = false
private var renderer:PixelRenderer;
private var meteorPieces:MeteorPieces;
private var explosion:Shape;
private var timerSound:TimerEx;
private var tweenRadius:TweenMax;
private var shadow:Shape;
private var exploded:Boolean;
private var rect:Rectangle;
private var rock:MeteorAsset1;
private var emitter:Emitter2D;
private var meteorsShieldRef:MeteorsShield;
private var tweenPosition:TweenMax;
private var finalY:Number;// = 0
public static const COMPLETE:String = "complete";
public static const EXPLOSION_RADIUS:Number = 76;
public function Meteor(){
explosion = new Shape();
rock = new MeteorAsset1();
emitter = new Emitter2D();
timerSound = new TimerEx(1, 0.2, onTimerSound);
rect = new Rectangle(-10, -40, 80, 50);
meteorPieces = new MeteorPieces();
shadow = new Shape();
super();
id = Components.METEOR;
CollisionManager.getInstance().register(this, CollisionGroups.POWER_VS_ENEMIES, true);
CollisionManager.getInstance().register(this, CollisionGroups.POWER_VS_PLAYER, true);
var _local1:Matrix = new Matrix();
_local1.createGradientBox((EXPLOSION_RADIUS * 2), (EXPLOSION_RADIUS * 2), 0, -(EXPLOSION_RADIUS), -(EXPLOSION_RADIUS));
explosion.graphics.beginGradientFill(GradientType.RADIAL, [0xFF4400, 0xCC4400], [0.2, 0.8], [0, 0xFF], _local1);
explosion.graphics.drawCircle(0, 0, EXPLOSION_RADIUS);
explosion.graphics.endFill();
explosion.filters = [new BlurFilter(13, 13)];
canvas.addChild(explosion);
explosion.visible = false;
emitter.counter = new Steady(30);
emitter.addInitializer(new ColorInit(4294923520, 4294953984));
emitter.addInitializer(new Position(new DiscZone(new Point(3, -3), initialRadius)));
emitter.addInitializer(new Lifetime(0.4, 0.6));
emitter.addAction(new Move());
emitter.addAction(new Age());
emitter.addAction(new Accelerate(300, -70));
renderer = new PixelRenderer(rect);
renderer.addFilter(new BlurFilter(3, 3, 1));
renderer.addFilter(new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 0.99, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.99, 0]));
renderer.addEmitter(emitter);
renderer.visible = false;
canvas.addChild(shadow);
canvas.addChild(rock);
rock.rotation = (Math.random() * 360);
canvas.addChild(renderer);
canvas.addChild(meteorPieces);
meteorPieces.visible = false;
shadow.graphics.beginFill(0);
shadow.graphics.drawCircle(0, 0, (initialRadius * 0.8));
shadow.graphics.endFill();
}
private function explodeToShield():void{
if (exploded){
return;
};
radius = initialRadius;
rock.visible = false;
renderer.visible = false;
emitter.stop();
var _local1:String = ("meteor_explode" + String(int(((Math.random() * 6) + 1))));
SoundManager.getInstance().playSound(_local1, SoundGroups.GAME_SOUNDS, 1, 1.5);
meteorPieces.visible = true;
meteorPieces.enable();
exploded = true;
tweenPosition.pause();
tweenPosition = null;
deactivate();
shadow.visible = false;
}
private function updateShadow():void{
shadow.y = (finalY - position.y);
shadow.alpha = (tweenPosition.progress * 0.25);
shadow.scaleX = (shadow.scaleY = tweenPosition.progress);
}
private function onAlphaTweenComplete():void{
enabled = false;
deactivate();
canvas.visible = false;
explosion.visible = false;
meteorPieces.visible = false;
dispatchEvent(new Event(COMPLETE));
}
public function update():void{
if (tweenPosition.progress >= 0.9){
if (meteorsShieldRef.enabled){
explodeToShield();
};
};
}
public function enable(_arg1:Number, _arg2:Number):void{
renderer.bitmapData.fillRect(rect, 0);
enabled = true;
position.x = (_arg1 + 500);
position.y = (_arg2 - 100);
draw();
tweenPosition = new TweenMax(position, 1.6, {x:_arg1, y:_arg2, onUpdate:updateShadow, onComplete:explode, ease:Sine.easeIn});
canCollide = false;
activate();
rock.visible = true;
canvas.alpha = 1;
canvas.visible = true;
renderer.visible = true;
emitter.start();
emitter.runAhead(10);
exploded = false;
if (Math.random() > 0.15){
timerSound.start();
};
finalY = _arg2;
shadow.alpha = 0;
shadow.scaleX = (shadow.scaleY = 0);
shadow.visible = true;
meteorsShieldRef = MeteorsShield(root.getDescendantById(Components.METEORS_SHIELD));
}
public function stop():void{
if (emitter){
emitter.stop();
};
if (tweenPosition){
tweenPosition.pause();
};
tweenPosition = null;
if (tweenRadius){
tweenRadius.pause();
};
tweenRadius = null;
deactivate();
}
private function onTimerSound():void{
SoundManager.getInstance().playSound("meteor_fall", SoundGroups.GAME_SOUNDS, 1, (0.3 + (Math.random() * 0.5)));
}
override public function resume():void{
super.resume();
if (emitter){
emitter.resume();
};
if (tweenPosition){
tweenPosition.resume();
};
if (tweenRadius){
tweenRadius.resume();
};
timerSound.resume();
}
public function disable():void{
canCollide = false;
TweenMax.to(canvas, 0.5, {alpha:0, onComplete:onAlphaTweenComplete});
}
private function explode():void{
if (exploded){
return;
};
canCollide = true;
radius = initialRadius;
rock.visible = false;
renderer.visible = false;
explosion.visible = true;
drawExplosion();
shadow.visible = false;
tweenRadius = new TweenMax(this, 0.5, {radius:EXPLOSION_RADIUS, onUpdate:drawExplosion, onComplete:disable});
emitter.stop();
var _local1:String = ("meteor_explode" + String(int(((Math.random() * 6) + 1))));
SoundManager.getInstance().playSound(_local1, SoundGroups.GAME_SOUNDS, 1, 1.5);
meteorPieces.visible = true;
meteorPieces.enable();
exploded = true;
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).meteorsVibrate();
}
private function drawExplosion():void{
explosion.scaleX = (explosion.scaleY = (radius / EXPLOSION_RADIUS));
}
override public function pause():void{
super.pause();
if (emitter){
emitter.pause();
};
if (tweenPosition){
tweenPosition.pause();
};
if (tweenRadius){
tweenRadius.pause();
};
timerSound.pause();
}
override protected function onRemovedFromRoute():void{
if (emitter){
emitter.stop();
};
}
}
}//package _game._world._meteors
Section 66
//MeteorPieces (_game._world._meteors.MeteorPieces)
package _game._world._meteors {
import flash.display.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import assets.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class MeteorPieces extends Sprite {
private var renderer:DisplayObjectRenderer;
private var counter:Blast;
private var smokeCounter:Blast;
private var emitter:Emitter2D;
private var explosion:Explosion;
private var smokeEmitter:Emitter2D;
public function MeteorPieces(){
emitter = new Emitter2D();
renderer = new DisplayObjectRenderer();
counter = new Blast();
explosion = new Explosion();
smokeEmitter = new Emitter2D();
smokeCounter = new Blast();
super();
emitter.counter = counter;
emitter.addInitializer(new Position(new DiscZone(new Point(), 10, 0)));
emitter.addInitializer(new ImageClasses([MeteorPiece1, MeteorPiece2, MeteorPiece3, MeteorPiece4, MeteorPiece5, MeteorPiece6]));
emitter.addInitializer(new Lifetime(1));
emitter.addInitializer(new Rotation(0, (Math.PI * 2)));
emitter.addAction(new Fade());
emitter.addAction(new Age());
emitter.addAction(new Move());
emitter.addAction(explosion);
smokeEmitter.counter = smokeCounter;
smokeEmitter.addInitializer(new Position(new DiscZone(new Point(), 10, 0)));
smokeEmitter.addInitializer(new Velocity(new DiscZone(new Point(), 100, 50)));
smokeEmitter.addInitializer(new ImageClasses([Smoke]));
smokeEmitter.addInitializer(new Lifetime(1));
smokeEmitter.addInitializer(new AlphaInit(0.6, 1));
smokeEmitter.addInitializer(new ScaleAllInit(0.6, 1));
smokeEmitter.addInitializer(new Rotation(0, (Math.PI * 2)));
smokeEmitter.addAction(new ScaleAll(1, 2));
smokeEmitter.addAction(new Fade());
smokeEmitter.addAction(new Age());
smokeEmitter.addAction(new Move());
renderer.addEmitter(emitter);
renderer.addEmitter(smokeEmitter);
addChild(renderer);
}
public function enable():void{
explosion.reset();
explosion.power = (0.4 + (Math.random() * 0.6));
counter.startCount = (3 + (Math.random() * 5));
emitter.start();
smokeCounter.startCount = (2 + (Math.random() * 3));
smokeEmitter.start();
}
}
}//package _game._world._meteors
Section 67
//MeteorShower (_game._world._meteors.MeteorShower)
package _game._world._meteors {
import flash.events.*;
import framework._event.*;
import framework._component.*;
import framework._utils._math.*;
import _game._stats.*;
import _game._world._circleBounds.*;
import framework._utils._timer.*;
import _backgrounds.*;
import _game._gui.*;
import _components.*;
import _events.*;
public class MeteorShower extends WorldObject {
private var enabled:Boolean;// = false
private var timerDanger:TimerEx;
private var radius:Number;
private var timerGenerate:TimerEx;
private var type:int;// = 0
private var timerDisable:TimerEx;
private var meteorsEnabled:int;// = 0
private var timerDelay:TimerEx;
public static const LINE_CENTER:int = 1;
public static const LINES_UP_DOWN:int = 4;
public static const COMPLETE:String = "complete";
public static const RANDOM:int = 9;
public static const LINE_UP:int = 3;
public static const CIRCLE:int = 7;
public static const LINES_CENTER_DOWN:int = 6;
public static const LINE_DOWN:int = 2;
public static const RANDOM_LINE:int = 8;
public static const LINES_UP_CENTER:int = 5;
public function MeteorShower(){
id = Components.METEOR_SHOWER;
deactivate();
timerGenerate = new TimerEx(1, 0, onTimerGenerate);
timerDisable = new TimerEx(1, 0, onTimerDisable);
timerDelay = new TimerEx(1, 5.4, onTimerDelay);
timerDanger = new TimerEx(1, 4.5, onTimerDanger);
}
public function enable(_arg1:int, _arg2:Number, _arg3:Number):void{
enabled = true;
this.type = _arg1;
meteorsEnabled = 0;
timerDisable.setTimeAmount(_arg2);
timerGenerate.setTimeAmount((1 / _arg3));
timerDanger.start();
timerDelay.start();
var _local4:int = ((_arg2 * _arg3) / 2);
if (_local4 < 3){
_local4 = 3;
};
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).showMeteorsPassing(_arg1, _local4);
}
private function onMeteorComplete(_arg1:Event):void{
meteorsEnabled--;
if (((!(enabled)) && ((meteorsEnabled == 0)))){
dispatchEvent(new Event(COMPLETE));
};
}
private function enableLinesUpDownMeteor(_arg1:Meteor):void{
if (Math.random() < 0.5){
_arg1.enable((CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 120))), (CircleBounds.y - 140));
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
} else {
_arg1.enable((CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 120))), (CircleBounds.y + 140));
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
};
}
override protected function onResumed():void{
timerGenerate.resume();
timerDisable.resume();
timerDelay.resume();
timerDanger.resume();
}
public function stop():void{
var _local1:int;
while (_local1 < children.length) {
Meteor(children[_local1]).stop();
_local1++;
};
disable();
timerDisable.stop();
timerDelay.stop();
}
private function enableCircleMeteor(_arg1:Meteor):void{
var _local2:Vector3 = CircleBounds.getInstance().getRandomPos((90 + (Stats.playerLevel * 4)));
_arg1.enable(_local2.x, _local2.y);
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
}
public function enableNow(_arg1:int, _arg2:Number, _arg3:Number):void{
enabled = true;
this.type = _arg1;
meteorsEnabled = 0;
timerDisable.setTimeAmount(_arg2);
timerGenerate.setTimeAmount((1 / _arg3));
onTimerGenerate();
timerDisable.start();
var _local4:int = ((_arg2 * _arg3) / 2);
if (_local4 < 3){
_local4 = 3;
};
}
private function enableLineCenterMeteor(_arg1:Meteor):void{
var _local2:Number = CircleBounds.y;
var _local3:Number = (CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 30)));
_arg1.enable(_local3, _local2);
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
}
private function enableLineUpMeteor(_arg1:Meteor):void{
var _local2:Number = (CircleBounds.y - 130);
var _local3:Number = (CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 120)));
_arg1.enable(_local3, _local2);
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
}
private function onTimerDisable():void{
disable();
}
private function enableLineDownMeteor(_arg1:Meteor):void{
var _local2:Number = (CircleBounds.y + 130);
var _local3:Number = (CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 120)));
_arg1.enable(_local3, _local2);
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
}
public function disable():void{
enabled = false;
timerDisable.stop();
timerGenerate.stop();
timerDelay.stop();
timerDanger.stop();
if (meteorsEnabled == 0){
dispatchEvent(new Event(COMPLETE));
};
}
private function onTimerDanger():void{
if (!root){
return;
};
Gui(root.getDescendantById(Components.GUI)).displayDanger(type, true);
}
override protected function onPaused():void{
timerGenerate.pause();
timerDisable.pause();
timerDelay.pause();
timerDanger.pause();
}
private function enableLinesUpCenterMeteor(_arg1:Meteor):void{
if (Math.random() < 0.33){
_arg1.enable((CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 120))), (CircleBounds.y - 130));
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
} else {
if (Math.random() < 0.66){
_arg1.enable((CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 75))), (CircleBounds.y - 70));
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
} else {
_arg1.enable((CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 30))), (CircleBounds.y - 20));
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
};
};
}
private function onTimerGenerate():void{
if (!enabled){
return;
};
var _local1:Meteor;
var _local2:int;
while (_local2 < children.length) {
if (!Meteor(children[_local2]).enabled){
_local1 = children[_local2];
break;
};
_local2++;
};
if (!_local1){
_local1 = new Meteor();
addChild(_local1);
};
switch (type){
case LINE_DOWN:
enableLineDownMeteor(_local1);
break;
case LINE_UP:
enableLineUpMeteor(_local1);
break;
case LINE_CENTER:
enableLineCenterMeteor(_local1);
break;
case LINES_UP_DOWN:
enableLinesUpDownMeteor(_local1);
break;
case LINES_UP_CENTER:
enableLinesUpCenterMeteor(_local1);
break;
case LINES_CENTER_DOWN:
enableLinesCenterDownMeteor(_local1);
break;
case CIRCLE:
enableCircleMeteor(_local1);
break;
};
meteorsEnabled++;
timerGenerate.start();
}
private function onTimerDelay():void{
GlobalDispatcher.dispatchEvent(new Event(GameEvents.METEOR_SHOWER_ENABLED));
timerGenerate.start();
timerDisable.start();
}
private function enableLinesCenterDownMeteor(_arg1:Meteor):void{
if (Math.random() < 0.33){
_arg1.enable((CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 120))), (CircleBounds.y + 130));
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
} else {
if (Math.random() < 0.66){
_arg1.enable((CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 75))), (CircleBounds.y + 70));
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
} else {
_arg1.enable((CircleBounds.x + ((Math.random() - 0.5) * ((CircleBounds.radius * 2) - 30))), (CircleBounds.y + 20));
_arg1.addEventListener(Meteor.COMPLETE, onMeteorComplete);
};
};
}
}
}//package _game._world._meteors
Section 68
//CircleShield (_game._world._player.CircleShield)
package _game._world._player {
import flash.events.*;
import framework._event.*;
import framework._core.*;
import _game._stats.*;
import assets.*;
import _game._world._entity.*;
import gs.*;
import _components.*;
import _events.*;
public class CircleShield extends Entity implements IUpdateable {
private var tweenAlpha:TweenMax;
public var pathRadius:Number;// = 0
private var pi:Number;// = 3.14159265358979
public var angle:Number;// = 0
public var w:Number;// = 200
public function CircleShield(_arg1:Number){
this.angle = _arg1;
id = Components.CIRCLE_SHIELD;
radius = 3;
canvas.addChild(new PlayerBombAsset());
canvas.visible = false;
canCollide = false;
deactivate();
}
private function onPlayerGrows(_arg1:Event):void{
updateRadius();
}
override protected function onAdded():void{
GlobalDispatcher.addEventListener(GameEvents.PLAYER_GROWS, onPlayerGrows);
updateRadius();
}
public function enable():void{
if (tweenAlpha){
tweenAlpha.pause();
};
tweenAlpha = new TweenMax(canvas, 0.2, {alpha:1});
canvas.visible = true;
canCollide = true;
activate();
updateRadius();
}
override public function draw():void{
canvas.x = (position.x + parentWorldObject.position.x);
canvas.y = (position.y + parentWorldObject.position.y);
}
private function onAlphaTweenComplete():void{
canvas.visible = false;
canCollide = false;
}
override protected function onRemoved():void{
GlobalDispatcher.removeEventListener(GameEvents.PLAYER_GROWS, onPlayerGrows);
}
public function update():void{
var _local1:Number = ProcessManager.DT;
angle = ((angle + (w * _local1)) % 360);
position.x = (Math.cos(((angle * pi) / 180)) * pathRadius);
position.y = (Math.sin(((angle * pi) / 180)) * pathRadius);
}
public function disable():void{
if (tweenAlpha){
tweenAlpha.pause();
};
tweenAlpha = new TweenMax(canvas, 0.2, {alpha:0, onComplete:onAlphaTweenComplete});
deactivate();
}
public function updateRadius():void{
if (Stats.bombs == 1){
pathRadius = ((Player(parent).radius + radius) + 4);
w = 180;
} else {
if (Stats.bombs == 2){
pathRadius = ((Player(parent).radius + radius) + 4.5);
w = 200;
} else {
pathRadius = ((Player(parent).radius + radius) + 5);
w = 220;
};
};
}
}
}//package _game._world._player
Section 69
//CircleShieldMgr (_game._world._player.CircleShieldMgr)
package _game._world._player {
import _game._stats.*;
public class CircleShieldMgr {
private var shieldsActive:int;// = 0
private var player:Player;
public function CircleShieldMgr(_arg1:Player){
this.player = _arg1;
_arg1.addChild(new CircleShield(0));
_arg1.addChild(new CircleShield(120));
_arg1.addChild(new CircleShield(240));
}
public function disableShields():void{
var _local1:Array = player.getChildrenByType(CircleShield);
var _local2:int;
while (_local2 < _local1.length) {
_local1[_local2].disable();
_local2++;
};
shieldsActive = 0;
}
public function addShield():void{
var _local1:Array = player.getChildrenByType(CircleShield);
if (shieldsActive == 0){
_local1[0].enable();
shieldsActive++;
} else {
if (shieldsActive == 1){
_local1[1].enable();
_local1[1].angle = (_local1[0].angle + 180);
_local1[0].updateRadius();
shieldsActive++;
} else {
if (shieldsActive == 2){
_local1[2].enable();
_local1[1].angle = (_local1[0].angle + 120);
_local1[2].angle = (_local1[1].angle + 120);
_local1[0].updateRadius();
_local1[1].updateRadius();
shieldsActive++;
};
};
};
}
public function removeShield():void{
var _local1:Array = player.getChildrenByType(CircleShield);
if (shieldsActive == 1){
_local1[0].disable();
shieldsActive--;
} else {
if (shieldsActive == 2){
_local1[1].disable();
_local1[0].updateRadius();
shieldsActive--;
} else {
if (shieldsActive == 3){
_local1[2].disable();
_local1[0].updateRadius();
_local1[1].updateRadius();
_local1[1].angle = (_local1[0].angle + 180);
shieldsActive--;
};
};
};
}
public function setActiveShieldsVisible(_arg1:Boolean):void{
var _local2:Array = player.getChildrenByType(CircleShield);
var _local3:int;
while (_local3 < Stats.bombs) {
_local2[_local3].canvas.visible = _arg1;
_local2[_local3].draw();
_local3++;
};
}
}
}//package _game._world._player
Section 70
//Expressions (_game._world._player.Expressions)
package _game._world._player {
import flash.display.*;
import flash.events.*;
import framework._event.*;
import framework._component.*;
import framework._sound.*;
import _game._stats.*;
import framework._utils._timer.*;
import _components.*;
import _sound.*;
import _events.*;
public class Expressions extends Behavior {
private var canBurp:Boolean;
private var timerWinkRight:TimerEx;
private var mc:MovieClip;
private var timerBlink:TimerEx;
private var killCount:int;// = 0
private var timerWinkLeft:TimerEx;
private var burp:int;
private var timerCanBurp:TimerEx;
private var timerBurp:TimerEx;
public function Expressions(){
timerCanBurp = new TimerEx(1, 2, onCanBurp);
timerBurp = new TimerEx(1, 1, onTimerBurp);
super();
id = Components.EXPRESSIONS;
timerWinkRight = new TimerEx(1, 0.1, winkRight);
timerWinkLeft = new TimerEx(1, 0.1, winkLeft);
timerBlink = new TimerEx(1, 5, blink);
}
private function winkLeft():void{
timerBlink.start();
if (mc.idle){
if (mc.idle.currentLabel == "idle"){
mc.idle.gotoAndPlay("wink_left");
};
};
}
override protected function onRemoved():void{
GlobalDispatcher.removeEventListener(GameEvents.BONUS_SCORE, onAddBonusScore);
GlobalDispatcher.removeEventListener(GameEvents.ADD_LIFE, onAddLife);
timerBlink.stop();
}
private function winkRight():void{
timerBlink.start();
if (mc.idle){
if (mc.idle.currentLabel == "idle"){
mc.idle.gotoAndPlay("wink_right");
};
};
}
override protected function onDeactivated():void{
timerBurp.stop();
timerCanBurp.stop();
timerBlink.stop();
timerWinkRight.stop();
timerWinkLeft.stop();
}
private function onAddBonusScore(_arg1:Event):void{
timerBlink.stop();
timerWinkRight.start();
}
private function blink():void{
if (mc.idle){
if (mc.idle.currentLabel == "idle"){
mc.idle.gotoAndPlay("blink");
};
};
timerBlink.start();
}
private function onAddLife(_arg1:Event):void{
timerBlink.stop();
timerWinkLeft.start();
}
public function eat():void{
if (((!(Player(parent).isEvolving())) && ((mc.currentLabel == ("idle_" + Stats.playerLevel))))){
mc.gotoAndPlay(("eat_" + Stats.playerLevel));
};
if (canBurp){
killCount++;
if (killCount >= burp){
burp = (((Math.random() * 10) * Stats.playerLevel) + (7 * Stats.playerLevel));
killCount = 0;
canBurp = false;
timerBurp.start();
timerCanBurp.start();
};
};
}
override protected function onAdded():void{
mc = Player(parent).mc;
GlobalDispatcher.addEventListener(GameEvents.BONUS_SCORE, onAddBonusScore);
GlobalDispatcher.addEventListener(GameEvents.ADD_LIFE, onAddLife);
timerBlink.start();
burp = (((Math.random() * 7) * Stats.playerLevel) + 15);
canBurp = true;
}
public function multiBlink():void{
timerBlink.stop();
timerBlink.start();
if (mc.idle){
if (mc.idle.currentLabel == "idle"){
mc.idle.gotoAndPlay("multi_blink");
};
};
}
private function onTimerBurp():void{
if (!Player(parent).isEvolving()){
SoundManager.getInstance().playSound("burp", SoundGroups.GAME_SOUNDS, 1, 2);
mc.gotoAndPlay(("burp_" + Stats.playerLevel));
};
}
override protected function onPaused():void{
timerCanBurp.pause();
timerBurp.pause();
timerBlink.pause();
}
private function onCanBurp():void{
canBurp = true;
}
override protected function onResumed():void{
timerCanBurp.resume();
timerBurp.resume();
timerBlink.resume();
}
}
}//package _game._world._player
Section 71
//Invincibility (_game._world._player.Invincibility)
package _game._world._player {
import framework._component.*;
import flash.filters.*;
import framework._utils._timer.*;
import gs.*;
import _components.*;
public class Invincibility extends Behavior {
private var timerDisable:TimerEx;
private var tweenGlow:TweenMax;
private var tweenBrightness:TweenMax;
public function Invincibility(){
id = Components.INVINCIBILITY;
timerDisable = new TimerEx(1, 2, onTimerDisable);
}
private function onTimerDisable():void{
if (tweenGlow){
tweenGlow.pause();
};
tweenGlow = new TweenMax(Player(parent).mc, 1, {glowFilter:{blurX:15, blurY:15, strength:3}, onComplete:removeGlow});
}
public function enable(_arg1:Number):void{
Player(parent).setInvincible(true);
if (timerDisable.isRunning()){
timerDisable.stop();
};
if (_arg1 > 1){
timerDisable.callback = onTimerDisable;
Player(parent).mc.filters = [new GlowFilter(0xFFFFFF, 1, 8, 8, 2)];
tweenBrightness = new TweenMax(Player(parent).mc, 0.2, {colorMatrixFilter:{brightness:1.3}});
} else {
timerDisable.callback = disable;
};
timerDisable.setTimeAmount(_arg1);
timerDisable.start();
}
override protected function onResumed():void{
timerDisable.resume();
if (tweenGlow){
tweenGlow.resume();
};
if (tweenBrightness){
tweenBrightness.resume();
};
}
public function disable():void{
if (timerDisable.isRunning()){
timerDisable.stop();
};
if (tweenGlow){
tweenGlow.pause();
tweenGlow = null;
};
if (tweenBrightness){
tweenBrightness.pause();
tweenBrightness = null;
};
Player(parent).mc.filters = [];
Player(parent).setInvincible(false);
}
override protected function onPaused():void{
timerDisable.pause();
if (tweenGlow){
tweenGlow.pause();
};
if (tweenBrightness){
tweenBrightness.pause();
};
}
private function removeGlow():void{
tweenGlow = new TweenMax(Player(parent).mc, 0.5, {glowFilter:{alpha:0, blurX:5, blurY:5, strength:1}, onComplete:disable});
tweenBrightness = new TweenMax(Player(parent).mc, 0.2, {colorMatrixFilter:{brightness:1}});
}
}
}//package _game._world._player
Section 72
//KeyboardController (_game._world._player.KeyboardController)
package _game._world._player {
import framework._component.*;
import framework._utils._math.*;
import framework._core.*;
import framework._input.*;
import _components.*;
public class KeyboardController extends Behavior implements IUpdateable {
private const ACCEL:Number = 600;
private const DRAG:Number = 100;
private var speed:Vector3;
private var accel:Vector3;
private var position:Vector3;
public function KeyboardController(){
id = Components.KEYBOARD_CONTROLLER;
}
override protected function onAdded():void{
accel = Player(parent).accel;
speed = Player(parent).speed;
position = parentWorldObject.position;
}
public function update():void{
var _local3:Number;
var _local1:Number = ProcessManager.DT;
if (keyDown(Keys.SPACEBAR)){
Player(parent).useBomb();
};
accel.x = (accel.y = 0);
if (keyPressed(Keys.LEFT)){
accel.x = -(ACCEL);
} else {
if (keyPressed(Keys.RIGHT)){
accel.x = ACCEL;
};
};
if (keyPressed(Keys.UP)){
accel.y = -(ACCEL);
} else {
if (keyPressed(Keys.DOWN)){
accel.y = ACCEL;
};
};
speed.x = (speed.x + (accel.x * _local1));
speed.y = (speed.y + (accel.y * _local1));
var _local2:Number = Player(parent).speedMax;
if (speed.lengthSquared() > (_local2 * _local2)){
speed.normalize();
speed.mult(_local2);
};
if (((speed.x) || (speed.y))){
_local3 = (1 - ((DRAG * _local1) / speed.length()));
if (_local3 < 0){
_local3 = 0;
};
speed.mult(_local3);
};
position.x = (position.x + ((speed.x * _local1) + (((0.5 * accel.x) * _local1) * _local1)));
position.y = (position.y + ((speed.y * _local1) + (((0.5 * accel.y) * _local1) * _local1)));
}
}
}//package _game._world._player
Section 73
//MouseController (_game._world._player.MouseController)
package _game._world._player {
import flash.display.*;
import flash.events.*;
import framework._component.*;
import framework._utils._math.*;
import framework._core.*;
import _components.*;
public class MouseController extends Behavior implements IUpdateable {
private var speed:Vector3;
private var position:Vector3;
private var mc:MovieClip;
public function MouseController(){
id = Components.MOUSE_CONTROLLER;
}
private function onMouseUp(_arg1:MouseEvent):void{
}
private function onMouseDown(_arg1:MouseEvent):void{
if ((_arg1.target is SimpleButton)){
return;
};
Player(parent).useBomb();
}
public function update():void{
var _local1:Number = ProcessManager.DT;
speed.x = (mc.mouseX * 4.2);
speed.y = (mc.mouseY * 4.2);
var _local2:Number = Player(parent).speedMax;
if (speed.lengthSquared() > (_local2 * _local2)){
speed.normalize();
speed.mult(_local2);
};
position.x = (position.x + (speed.x * _local1));
position.y = (position.y + (speed.y * _local1));
}
override protected function onAddedToRoute():void{
mc = Player(parent).mc;
speed = Player(parent).speed;
position = parentWorldObject.position;
}
override protected function onDeactivated():void{
if (root){
parentWorldObject.canvas.stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
};
}
override protected function onActivated():void{
if (root){
parentWorldObject.canvas.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
};
}
}
}//package _game._world._player
Section 74
//Player (_game._world._player.Player)
package _game._world._player {
import flash.events.*;
import framework._event.*;
import framework._sound.*;
import _game._stats.*;
import flash.filters.*;
import _game._world._entity.*;
import _game._world._enemy.*;
import framework._utils._timer.*;
import _game._world._collision.*;
import _game._gui.*;
import _components.*;
import _sound.*;
import gs.easing.*;
import _events.*;
import assets.entity.*;
import framework._utils._fx.*;
import _game._world._item.*;
public class Player extends Entity {
private var timerFirstBomb:TimerEx;
private var flags:int;
public var mc:PlayerAsset;
public var speedMax:Number;
private var timerReGenerate:TimerEx;
private var trailFx:TrailFx;
private var player_id:int;// = 0
public var nearBorder:Boolean;// = false
public var touchingWall:Boolean;// = false
private var circleShieldMgr:CircleShieldMgr;
private static const invincible_flag:int = 2;
public static const SLOW_SPEED_MAX:Number = 30;
private static const START_POS_X:Number = 300;
private static const START_POS_Y:Number = 299;
public static const NORMAL_SPEED_MAX:Number = 170;
private static const growValues:Array = new Array(8, 9.5, 11.5, 13.5, 15.5, 17.5);
private static const evolving_flag:int = 1;
public static const ULTRA_SPEED_MAX:Number = 300;
private static const alive_flag:int = 4;
public function Player(_arg1:int){
timerFirstBomb = new TimerEx(1, 2, onTimerFirstBomb);
super();
this.player_id = _arg1;
id = Components.PLAYER;
mc = new PlayerAsset();
trailFx = new TrailFx();
trailFx.setEasingFunc(Sine.easeIn);
canvas.addChild(trailFx);
canvas.addChild(mc);
timerReGenerate = new TimerEx(1, 2, onTimerReGenerate);
addChild(new Invincibility());
addChild(new UltraSpeed());
addChild(new Expressions());
addChild(new MouseController()).sleep();
addChild(new KeyboardController()).sleep();
addChild(new PositionController()).sleep();
circleShieldMgr = new CircleShieldMgr(this);
CollisionManager.getInstance().register(this, CollisionGroups.PLAYER_VS_ALL, true);
CollisionManager.getInstance().register(this, CollisionGroups.POWER_VS_PLAYER, false);
trailFx.filters = [new GlowFilter(0xAA00, 1, 2, 2)];
}
public function moveTo(_arg1:Number, _arg2:Number):void{
getChildById(Components.MOUSE_CONTROLLER).sleep();
getChildById(Components.KEYBOARD_CONTROLLER).sleep();
getChildById(Components.POSITION_CONTROLLER).wakeUp();
PositionController(getChildById(Components.POSITION_CONTROLLER)).setTargetPosition(_arg1, _arg2);
}
override protected function onPaused():void{
mc.pause();
timerReGenerate.pause();
timerFirstBomb.pause();
trailFx.pause();
}
public function stop():void{
deactivateRecursively();
Invincibility(getChildById(Components.INVINCIBILITY)).disable();
UltraSpeed(getChildById(Components.ULTRA_SPEED)).disable();
if (timerReGenerate){
timerReGenerate.stop();
};
timerFirstBomb.stop();
trailFx.stop();
mc.removeEventListener("endedAnimDead", onEndedAnimDead);
GlobalDispatcher.removeEventListener(GameEvents.CONTROLLER_CHANGED, onControllerChanged);
}
public function setInvincible(_arg1:Boolean):void{
if (_arg1){
flags = (flags | invincible_flag);
} else {
flags = (flags & ~(invincible_flag));
};
}
override public function draw():void{
mc.x = position.x;
mc.y = position.y;
trailFx.emitter.x = position.x;
trailFx.emitter.y = position.y;
}
public function useBomb():void{
if (Stats.bombs == 0){
return;
};
dispatchEvent(new EventValue(GameEvents.BOMB_USED, 2));
circleShieldMgr.removeShield();
Invincibility(getChildById(Components.INVINCIBILITY)).enable(1);
}
public function isEvolving():Boolean{
return (((flags & evolving_flag) == evolving_flag));
}
public function removeBombs():void{
circleShieldMgr.disableShields();
Stats.bombs = 0;
}
private function onEndedAnimDead(_arg1:Event):void{
mc.removeEventListener("endedAnimDead", onEndedAnimDead);
canvas.visible = false;
GlobalDispatcher.addEventListener(GameEvents.PLAYER_REGENERATE, onPlayerRegenerate);
GlobalDispatcher.dispatchEvent(new Event(GameEvents.PLAYER_ENDED_ANIM_DEAD));
}
public function setEvolving(_arg1:Boolean):void{
if (_arg1){
flags = (flags | evolving_flag);
} else {
flags = (flags & ~(evolving_flag));
};
}
private function grow():void{
if (Stats.gameMode == GameModes.CREDITS){
Stats.playerLevel = 5;
} else {
if ((((Stats.gameMode == GameModes.NORMAL)) && ((Stats.playerLevel == 4)))){
Stats.playerLevel = 5;
};
};
mc.addEventListener("evolution_complete", onEvolutionComplete);
mc.gotoAndPlay(("evolve_" + String(Stats.playerLevel)));
SoundManager.getInstance().playSound("player_evolves", SoundGroups.GAME_SOUNDS);
Stats.playerLevel++;
radius = growValues[(Stats.playerLevel - 1)];
updateTrailFx();
speedMax = (NORMAL_SPEED_MAX + ((NORMAL_SPEED_MAX * 0.02) * Stats.playerLevel));
setEvolving(true);
Invincibility(getChildById(Components.INVINCIBILITY)).enable(1);
mc.filters = [new GlowFilter(0xFFFFFF, 1, 4, 4, 2)];
}
private function onTimerFirstBomb():void{
if (!root){
return;
};
if (root.getDescendantById(Components.DIALOGS)){
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("press click to use it!", true, 3);
};
}
private function onTimerReGenerate():void{
setAlive(true);
activateRecursively();
mc.gotoAndStop(("idle_" + String(Stats.playerLevel)));
position.x = START_POS_X;
position.y = START_POS_Y;
draw();
canvas.visible = true;
canCollide = true;
updateTrailFx();
Invincibility(getChildById(Components.INVINCIBILITY)).enable(2);
Expressions(getChildById(Components.EXPRESSIONS)).multiBlink();
circleShieldMgr.setActiveShieldsVisible(true);
}
private function onControllerChanged(_arg1:Event):void{
if (Stats.useMouse){
getChildById(Components.MOUSE_CONTROLLER).wakeUp();
getChildById(Components.KEYBOARD_CONTROLLER).sleep();
} else {
getChildById(Components.MOUSE_CONTROLLER).sleep();
getChildById(Components.KEYBOARD_CONTROLLER).wakeUp();
};
}
public function isAlive():Boolean{
return (((flags & alive_flag) == alive_flag));
}
private function onTimerStart():void{
if (Stats.useMouse){
getChildById(Components.MOUSE_CONTROLLER).wakeUp();
} else {
getChildById(Components.KEYBOARD_CONTROLLER).wakeUp();
};
}
public function kill():void{
setAlive(false);
deactivateRecursively();
SoundManager.getInstance().playSound("player_dies", SoundGroups.GAME_SOUNDS);
mc.gotoAndPlay(("dead_" + String(Stats.playerLevel)));
canCollide = false;
speed.x = (speed.y = 0);
GlobalDispatcher.dispatchEvent(new Event(GameEvents.PLAYER_DEAD));
mc.addEventListener("endedAnimDead", onEndedAnimDead);
trailFx.stop();
circleShieldMgr.setActiveShieldsVisible(false);
UltraSpeed(getChildById(Components.ULTRA_SPEED)).disable();
}
override public function onCollide(_arg1:Entity):void{
if (_arg1.id == Components.ENEMY){
if (Enemy(_arg1).level >= Stats.playerLevel){
if (!isInvincible()){
if (Enemy(_arg1).canKill){
kill();
Gui(root.getDescendantById(Components.GUI)).vibrateAvoid();
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player killed by Enemy");
};
};
} else {
Expressions(getChildById(Components.EXPRESSIONS)).eat();
};
} else {
if (_arg1.id == Components.BOMB){
if (Stats.firstBomb){
Stats.firstBomb = false;
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Captain! You picked up a bomb!", 1, false);
timerFirstBomb.start();
};
if (Stats.bombs < 3){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ADD_BOMB_TO_PLAYER));
circleShieldMgr.addShield();
Bomb(_arg1).playCaughtAnim();
} else {
Bomb(_arg1).playScoreAnim();
};
} else {
if (_arg1.id == Components.SUPER_BOMB){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.AUTO_BOMB, {type:3, x:_arg1.position.x, y:_arg1.position.y}));
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player uses SuperBomb");
} else {
if ((((((_arg1.id == Components.SPIKE)) || ((_arg1.id == Components.SHELL_ITEM)))) || ((_arg1.id == Components.METEOR)))){
if (!isInvincible()){
kill();
};
if (_arg1.id == Components.SPIKE){
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player killed by Spikes");
} else {
if (_arg1.id == Components.SHELL_ITEM){
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player killed by Snake");
} else {
if (_arg1.id == Components.METEOR){
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player killed by Meteors");
};
};
};
} else {
if (_arg1.id == Components.EVOLUTION_ITEM){
grow();
GlobalDispatcher.dispatchEvent(new Event(GameEvents.PLAYER_GROWS));
};
};
};
};
};
}
public function killInFinal():void{
setAlive(false);
deactivateRecursively();
SoundManager.getInstance().playSound("player_dies", SoundGroups.GAME_SOUNDS);
mc.gotoAndPlay(("dead_" + String(Stats.playerLevel)));
canCollide = false;
speed.x = (speed.y = 0);
trailFx.stop();
circleShieldMgr.setActiveShieldsVisible(false);
UltraSpeed(getChildById(Components.ULTRA_SPEED)).disable();
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player killed at Final");
}
public function setAlive(_arg1:Boolean):void{
if (_arg1){
flags = (flags | alive_flag);
} else {
flags = (flags & ~(alive_flag));
};
}
public function setNormalSpeed():void{
speedMax = NORMAL_SPEED_MAX;
}
public function setSlowSpeed():void{
speedMax = SLOW_SPEED_MAX;
}
override protected function onAddedToRoute():void{
Stats.playerLevel = 1;
radius = growValues[(Stats.playerLevel - 1)];
position.x = START_POS_X;
position.y = START_POS_Y;
setAlive(true);
updateTrailFx();
mc.addMcRef(mc.idle);
Expressions(getChildById(Components.EXPRESSIONS)).multiBlink();
TimerEx.start(1, 0.3, onTimerStart);
GlobalDispatcher.addEventListener(GameEvents.CONTROLLER_CHANGED, onControllerChanged);
speedMax = NORMAL_SPEED_MAX;
draw();
}
private function onPlayerRegenerate(_arg1:Event):void{
GlobalDispatcher.removeEventListener(GameEvents.PLAYER_REGENERATE, onPlayerRegenerate);
timerReGenerate.start();
}
override protected function onResumed():void{
mc.resume();
timerReGenerate.resume();
timerFirstBomb.resume();
trailFx.resume();
}
private function onEvolutionComplete(_arg1:Event):void{
setEvolving(false);
mc.filters = [];
}
public function updateTrailFx():void{
trailFx.stop();
trailFx.setRadialDot((radius * 0.9), 0xFF00);
trailFx.setInitAlpha(1);
trailFx.start(200, (4 + Stats.playerLevel));
}
public function isInvincible():Boolean{
if (Stats.godMode){
return (true);
};
return (((flags & invincible_flag) == invincible_flag));
}
}
}//package _game._world._player
Section 75
//PositionController (_game._world._player.PositionController)
package _game._world._player {
import flash.display.*;
import framework._component.*;
import framework._utils._math.*;
import framework._core.*;
import flash.geom.*;
import _components.*;
public class PositionController extends Behavior implements IUpdateable {
private var speed:Vector3;
private var position:Vector3;
private var mc:MovieClip;
private var targetPosition:Point;
public function PositionController(){
targetPosition = new Point();
super();
id = Components.POSITION_CONTROLLER;
}
public function update():void{
var _local1:Number = ProcessManager.DT;
var _local2:Number = Player(parent).radius;
speed.x = ((targetPosition.x - parentWorldObject.position.x) * 1.7);
speed.y = ((targetPosition.y - parentWorldObject.position.y) * 1.7);
var _local3:Number = Player(parent).speedMax;
if (speed.lengthSquared() > (_local3 * _local3)){
speed.normalize();
speed.mult(_local3);
};
position.x = (position.x + (speed.x * _local1));
position.y = (position.y + (speed.y * _local1));
}
override protected function onAddedToRoute():void{
mc = Player(parent).mc;
speed = Player(parent).speed;
position = parentWorldObject.position;
}
public function setTargetPosition(_arg1:Number, _arg2:Number):void{
targetPosition.x = _arg1;
targetPosition.y = _arg2;
}
}
}//package _game._world._player
Section 76
//UltraSpeed (_game._world._player.UltraSpeed)
package _game._world._player {
import framework._component.*;
import framework._utils._timer.*;
import _components.*;
public class UltraSpeed extends Behavior {
private var timerDisable:TimerEx;
public function UltraSpeed(){
id = Components.ULTRA_SPEED;
timerDisable = new TimerEx(1, 2, onTimerDisable);
}
private function onTimerDisable():void{
disable();
}
public function disable():void{
if (timerDisable.isRunning()){
timerDisable.stop();
};
Player(parent).speedMax = Player.NORMAL_SPEED_MAX;
}
public function enable(_arg1:Number):void{
Player(parent).speedMax = Player.ULTRA_SPEED_MAX;
if (timerDisable.isRunning()){
timerDisable.stop();
};
timerDisable.setTimeAmount(_arg1);
timerDisable.start();
}
override protected function onPaused():void{
timerDisable.pause();
}
override protected function onResumed():void{
timerDisable.resume();
}
}
}//package _game._world._player
Section 77
//EvolutionItem (_game._world._shell.EvolutionItem)
package _game._world._shell {
import flash.display.*;
import framework._utils._console.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import flash.filters.*;
import assets.*;
import _game._world._entity.*;
import _game._world._collision.*;
import org.flintparticles.twoD.emitters.*;
import gs.*;
import org.flintparticles.twoD.renderers.*;
import _components.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class EvolutionItem extends Entity {
private var renderer:BitmapRenderer;
private var pixelEmitter:Emitter2D;
private var starsEmitter:Emitter2D;
private var rect:Rectangle;
private var pixelRenderer:PixelRenderer;
private var emitter:Emitter2D;
private var spiral:SpiralAsset;
private var colorInitializer:ColorInit;
public function EvolutionItem(){
spiral = new SpiralAsset();
pixelEmitter = new Emitter2D();
rect = new Rectangle(-60, -60, 120, 120);
super();
id = Components.EVOLUTION_ITEM;
radius = 8;
renderer = new BitmapRenderer(rect);
pixelRenderer = new PixelRenderer(rect);
renderer.addFilter(new ColorMatrixFilter([0.75, 0, 0, 0, 0, 0, 0.95, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.97, 0]));
pixelRenderer.addFilter(new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 0.99, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0.93, 0]));
pixelRenderer.addFilter(new BlurFilter(10, 10));
emitter = createEmitter();
starsEmitter = createStarsEmitter();
renderer.addEmitter(emitter);
renderer.addEmitter(starsEmitter);
pixelEmitter = createPixelEmitter();
pixelRenderer.addEmitter(pixelEmitter);
canCollide = false;
canvas.visible = false;
canvas.filters = [new GlowFilter(0xFFFFFF, 1, 20, 20, 0.2)];
deactivate();
canvas.addChild(pixelRenderer);
canvas.addChild(renderer);
canvas.addChild(spiral);
spiral.stop();
CollisionManager.getInstance().register(this, CollisionGroups.PLAYER_VS_ALL, false);
CollisionManager.getInstance().register(this, CollisionGroups.POWER_VS_ENEMIES, true);
Console.getInstance().registerCommand("spiral", spiralAlpha);
}
private function onAlphaTweenComplete():void{
if (emitter){
emitter.stop();
};
if (starsEmitter){
starsEmitter.stop();
};
if (pixelEmitter){
pixelEmitter.stop();
};
canvas.visible = false;
spiral.stop();
}
public function enable():void{
renderer.bitmapData.fillRect(rect, 0);
pixelRenderer.bitmapData.fillRect(rect, 0);
canCollide = true;
canvas.visible = true;
draw();
canvas.alpha = 0;
TweenMax.to(canvas, 0.3, {alpha:1});
spiral.play();
spiral.alpha = 0.3;
emitter.start();
emitter.runAhead(2);
starsEmitter.start();
pixelEmitter.start();
spiral.spiral_color.gotoAndStop(5);
}
private function createEmitter():Emitter2D{
var _local1:Shape = new Shape();
_local1.graphics.beginFill(15790335);
_local1.graphics.drawCircle(0, 0, (3 + (5 * 0.7)));
_local1.graphics.endFill();
var _local2:Emitter2D = new Emitter2D();
_local2.counter = new Steady(2.5);
_local2.addInitializer(new SharedImage(_local1));
_local2.addInitializer(new Lifetime(1));
_local2.addAction(new ScaleImage(1, 3.5));
_local2.addAction(new Age());
_local2.addAction(new Move());
_local2.addAction(new Fade());
return (_local2);
}
public function disable():void{
canCollide = false;
TweenMax.to(canvas, 0.2, {alpha:0, onComplete:onAlphaTweenComplete});
}
private function createPixelEmitter():Emitter2D{
var _local1:Emitter2D = new Emitter2D();
_local1.counter = new Steady(100);
_local1.addInitializer(new ColorInit(4294967295, 4278238207));
_local1.addInitializer(new Velocity(new DiscZone(new Point(), 40, 30)));
_local1.addInitializer(new Lifetime(1));
_local1.addAction(new Age());
_local1.addAction(new Move());
return (_local1);
}
override protected function onPaused():void{
if (emitter){
emitter.pause();
};
if (starsEmitter){
starsEmitter.pause();
};
if (pixelEmitter){
pixelEmitter.pause();
};
}
private function createStarsEmitter():Emitter2D{
var _local1:Emitter2D = new Emitter2D();
_local1.counter = new Steady((3 + (0.25 * 5)));
_local1.addInitializer(new SharedImage(new StarAsset()));
_local1.addInitializer(new Position(new DiscZone(new Point(), (40.25 + (0.75 * 5)), (4.25 + (0.75 * 5)))));
_local1.addInitializer(new Lifetime(0.3));
_local1.addAction(new ScaleAll(0.25, 1));
_local1.addAction(new Age());
_local1.addAction(new Move());
_local1.addAction(new Fade());
return (_local1);
}
private function spiralAlpha(_arg1:Number):void{
spiral.alpha = _arg1;
}
override protected function onResumed():void{
if (emitter){
emitter.resume();
};
if (starsEmitter){
starsEmitter.resume();
};
if (pixelEmitter){
pixelEmitter.resume();
};
}
}
}//package _game._world._shell
Section 78
//Shell (_game._world._shell.Shell)
package _game._world._shell {
import flash.events.*;
import framework._event.*;
import framework._component.*;
import framework._sound.*;
import _game._stats.*;
import _game._world._circleBounds.*;
import framework._utils._timer.*;
import _game._gui.*;
import _components.*;
import _sound.*;
import _events.*;
public class Shell extends WorldObject {
public var enabled:Boolean;// = false
private var evolutionItem:EvolutionItem;
private var timerEnableItem:TimerEx;
public function Shell(){
evolutionItem = new EvolutionItem();
super();
id = Components.SHELL;
addChild(evolutionItem);
timerEnableItem = new TimerEx(1, 0.2, onTimerEnableItem);
}
private function onTimerEnableItem():void{
evolutionItem.enable();
}
private function onPlayerDead(_arg1:Event):void{
disable();
}
public function disable():void{
if (!enabled){
return;
};
enabled = false;
timerEnableItem.stop();
var _local1:Array = getChildrenByType(ShellItem);
var _local2:int = (_local1.length - 1);
while (_local2 > -1) {
ShellItem(_local1[_local2]).disable();
_local2--;
};
evolutionItem.disable();
}
private function onDisable(_arg1:Event):void{
disable();
}
override protected function onAddedToRoute():void{
GlobalDispatcher.addEventListener(GameEvents.READY_TO_EVOLVE, onEnable);
GlobalDispatcher.addEventListener(GameEvents.PLAYER_GROWS, onDisable);
GlobalDispatcher.addEventListener(GameEvents.PLAYER_DEAD, onPlayerDead);
}
private function onEnable(_arg1:Event):void{
if (enabled){
return;
};
SoundManager.getInstance().playSound("yellow_lights_complete", SoundGroups.GAME_SOUNDS);
enabled = true;
var _local2:Number = 0;
var _local3:Number = 40;
if (Stats.gameMode == GameModes.NORMAL){
switch (Stats.playerLevel){
case 1:
createArc(130, (Math.random() * 360), 130, 50);
_local3 = 50;
break;
case 2:
_local2 = (Math.random() * 360);
createArc(90, _local2, 90, 60);
createArc(90, (180 + _local2), 90, 60);
_local3 = 50;
break;
case 3:
_local2 = (Math.random() * 360);
createArc(85, _local2, 90, 60);
createArc(85, (150 + _local2), 120, 60);
_local3 = 60;
break;
case 4:
_local2 = (Math.random() * 360);
createArc(70, _local2, 60, 65);
createArc(70, (120 + _local2), 60, 65);
createArc(70, (240 + _local2), 60, 65);
_local3 = 65;
break;
case 5:
_local2 = (Math.random() * 360);
createArc(75, _local2, 65, 65);
createArc(75, (120 + _local2), 65, 65);
createArc(75, (240 + _local2), 65, 65);
_local3 = 65;
break;
};
} else {
if (Stats.gameMode == GameModes.HARD){
switch (Stats.playerLevel){
case 1:
createArc(160, (Math.random() * 360), 160, 50);
_local3 = 50;
break;
case 2:
_local2 = (Math.random() * 360);
createArc(130, _local2, 110, 60);
createArc(-130, _local2, 110, 40);
_local3 = 60;
break;
case 3:
_local2 = (Math.random() * 360);
createArc(110, _local2, 90, 60);
createArc(110, (150 + _local2), 150, 60);
_local3 = 60;
break;
case 4:
_local2 = (Math.random() * 360);
createArc(80, _local2, 70, 70);
createArc(80, (120 + _local2), 70, 70);
createArc(80, (240 + _local2), 70, 70);
_local3 = 70;
break;
case 5:
_local2 = (Math.random() * 360);
createArc(90, _local2, 70, 65);
createArc(90, (120 + _local2), 70, 65);
createArc(90, (240 + _local2), 70, 65);
_local3 = 65;
break;
};
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
switch (Stats.playerLevel){
case 1:
createArc(180, (Math.random() * 360), 130, 50);
_local3 = 50;
break;
case 2:
_local2 = (Math.random() * 360);
createArc(130, _local2, 110, 60);
createArc(-130, (180 + _local2), 110, 60);
_local3 = 60;
break;
case 3:
_local2 = (Math.random() * 360);
createArc(150, _local2, 120, 60);
createArc(-130, (150 + _local2), 150, 40);
_local3 = 60;
break;
case 4:
_local2 = (Math.random() * 360);
createArc(90, _local2, 50, 70);
createArc(90, (90 + _local2), 50, 70);
createArc(90, (180 + _local2), 50, 70);
createArc(90, (270 + _local2), 50, 70);
_local3 = 70;
break;
case 5:
_local2 = (Math.random() * 360);
createArc(80, _local2, 90, 65);
createArc(-140, (120 + _local2), 70, 65);
createArc(80, (240 + _local2), 90, 65);
_local3 = 65;
break;
};
};
};
};
CircleBounds.getInstance().getRandomPosAwayFromPlayer(position, (_local3 + 10));
if (Stats.playerLevel == 1){
Gui(root.getDescendantById(Components.GUI)).addGetIn2((position.x + 40), (position.y + 8));
Gui(root.getDescendantById(Components.GUI)).addArrowPointing("shell", (position.x + 18), (position.y + 18), -45, 2);
};
timerEnableItem.start();
}
override protected function onPaused():void{
timerEnableItem.pause();
}
override protected function onResumed():void{
timerEnableItem.resume();
}
private function createArc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local8:ShellItem;
var _local9:Number;
var _local5:int = ((_arg4 * (Math.PI - ((((360 - _arg3) * 0.5) * Math.PI) / 180))) / ShellItem.RADIUS);
var _local6:Array = [];
var _local7:int = (children.length - 1);
while (_local7 > -1) {
if (children[_local7].id != Components.SHELL_ITEM){
} else {
if (!children[_local7].enabled){
_local6.push(children[_local7]);
if (_local5 == _local6.length){
break;
};
};
};
_local7--;
};
if (_local5 > _local6.length){
_local7 = ((_local5 - _local6.length) - 1);
while (_local7 > -1) {
_local8 = new ShellItem();
addChild(_local8);
_local6.push(_local8);
_local7--;
};
};
_local7 = 0;
while (_local7 < _local6.length) {
_local9 = (_arg2 + (_arg3 * (_local7 / _local5)));
_local6[_local7].enable(_local9, _arg1, _arg4, 0.4, (_local7 / (_local5 - 1)), ((_arg1 < 0)) ? false : true);
_local7++;
};
}
override protected function onRemovedFromRoute():void{
GlobalDispatcher.removeEventListener(GameEvents.READY_TO_EVOLVE, onEnable);
GlobalDispatcher.removeEventListener(GameEvents.PLAYER_GROWS, onDisable);
GlobalDispatcher.removeEventListener(GameEvents.PLAYER_DEAD, onPlayerDead);
}
}
}//package _game._world._shell
Section 79
//ShellItem (_game._world._shell.ShellItem)
package _game._world._shell {
import framework._core.*;
import assets.*;
import _game._world._entity.*;
import _game._world._collision.*;
import gs.*;
import _components.*;
public class ShellItem extends Entity implements IUpdateable {
public var enabled:Boolean;// = false
private var tweenPathRadius:TweenMax;
public var angle:Number;// = 0
private var followPath:Boolean;// = false
public var pathRadius:Number;
private var pi:Number;// = 3.14159265358979
public var mc:WormAsset;
public var w:Number;
static const TAIL_RADIUS:Number = 5;
static const RADIUS:Number = 7.5;
public function ShellItem(){
mc = new WormAsset();
super();
id = Components.SHELL_ITEM;
radius = RADIUS;
CollisionManager.getInstance().register(this, CollisionGroups.POWER_VS_PLAYER, true);
CollisionManager.getInstance().register(this, CollisionGroups.POWER_VS_ENEMIES, true);
canvas.addChild(mc);
}
public function enable(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean):void{
enabled = true;
canCollide = true;
canvas.visible = true;
canvas.alpha = 1;
this.pathRadius = 0;
this.w = _arg2;
this.angle = _arg1;
position.x = (Math.cos(((_arg1 * pi) / 180)) * this.pathRadius);
position.y = (Math.sin(((_arg1 * pi) / 180)) * this.pathRadius);
tweenPathRadius = new TweenMax(this, _arg4, {pathRadius:_arg3});
activate();
if (_arg6){
mc.scaleY = 1;
} else {
mc.scaleY = -1;
};
if (_arg5 == 1){
if (_arg6){
mc.gotoAndStop(1);
radius = RADIUS;
} else {
mc.gotoAndStop(3);
radius = TAIL_RADIUS;
canCollide = false;
};
} else {
if (_arg5 == 0){
if (_arg6){
mc.gotoAndStop(3);
radius = TAIL_RADIUS;
canCollide = false;
} else {
mc.gotoAndStop(1);
radius = RADIUS;
};
} else {
mc.gotoAndStop(2);
radius = RADIUS;
};
};
}
private function onAlphaTweenComplete():void{
enabled = false;
deactivate();
canvas.visible = false;
}
public function disable():void{
canCollide = false;
TweenMax.to(canvas, 0.2, {alpha:0, onComplete:onAlphaTweenComplete});
}
override protected function onPaused():void{
if (tweenPathRadius){
tweenPathRadius.pause();
};
}
public function update():void{
var _local1:Number = ProcessManager.DT;
angle = ((angle + (w * _local1)) % 360);
position.x = (Math.cos(((angle * pi) / 180)) * pathRadius);
position.y = (Math.sin(((angle * pi) / 180)) * pathRadius);
canvas.rotation = angle;
}
override protected function onResumed():void{
if (tweenPathRadius){
tweenPathRadius.resume();
};
}
}
}//package _game._world._shell
Section 80
//SpaceShipCollider (_game._world._spaceship.SpaceShipCollider)
package _game._world._spaceship {
import flash.events.*;
import framework._event.*;
import _game._world._entity.*;
import _game._world._collision.*;
import _components.*;
import _events.*;
public class SpaceShipCollider extends Entity {
public function SpaceShipCollider(){
id = Components.SPACE_SHIP;
radius = 30;
CollisionManager.getInstance().register(this, CollisionGroups.PLAYER_VS_ALL, false);
}
override public function onCollide(_arg1:Entity):void{
GlobalDispatcher.dispatchEvent(new Event(GameEvents.SHIP_BOARDED));
canCollide = false;
}
}
}//package _game._world._spaceship
Section 81
//Spike (_game._world._spikes.Spike)
package _game._world._spikes {
import flash.events.*;
import assets.*;
import _game._world._entity.*;
import _game._world._collision.*;
import _components.*;
public class Spike extends Entity {
public var enabled:Boolean;// = false
public var mc:SpikeAsset;
public var locked:Boolean;// = false
public var group:SpikeGroup;// = null
public function Spike(){
mc = new SpikeAsset();
super();
id = Components.SPIKE;
}
public function exit():void{
locked = true;
mc.addEventListener("unlock", onUnlock);
mc.gotoAndPlay("out");
}
private function onUnlock(_arg1:Event):void{
locked = false;
canvas.visible = false;
}
override protected function onAddedToRoute():void{
canvas.addChild(mc);
CollisionManager.getInstance().register(this, CollisionGroups.PLAYER_VS_ALL, false);
}
}
}//package _game._world._spikes
Section 82
//SpikeGroup (_game._world._spikes.SpikeGroup)
package _game._world._spikes {
import flash.events.*;
import framework._sound.*;
import _game._world._borderLights.*;
import framework._utils._timer.*;
import _sound.*;
public class SpikeGroup extends EventDispatcher {
private var timerDisable:TimerEx;
public var lightGroup:SpikesLightGroup;
public var spikesArr:Array;
public static const RELEASED:String = "released";
public function SpikeGroup(_arg1:SpikesLightGroup, _arg2:Array, _arg3:Number){
timerDisable = new TimerEx(1, 0, onTimerDisable);
super();
this.spikesArr = _arg2;
this.lightGroup = _arg1;
timerDisable.setTimeAmount(_arg3);
SoundManager.getInstance().playSound("spikes_appear", SoundGroups.GAME_SOUNDS);
TimerEx.start(1, 0.15, spikesAppear);
}
private function spikesAppear():void{
var _local2:Spike;
timerDisable.start();
var _local1:int;
while (_local1 < spikesArr.length) {
_local2 = Spike(spikesArr[_local1]);
if (!_local2.enabled){
Spike(spikesArr[_local1]).mc.gotoAndPlay("in");
_local2.enabled = true;
_local2.canvas.visible = true;
_local2.canCollide = true;
};
if (!_local2.locked){
_local2.group = this;
};
_local1++;
};
}
private function disable():void{
var _local2:Spike;
var _local1:int;
while (_local1 < spikesArr.length) {
_local2 = Spike(spikesArr[_local1]);
if (_local2.group == this){
_local2.enabled = false;
_local2.group = null;
_local2.canCollide = false;
_local2.exit();
};
_local1++;
};
lightGroup.disableLights();
}
private function onDelayedTimerDisable():void{
disable();
}
public function stop():void{
disable();
timerDisable.stop();
}
public function pause():void{
var _local2:Spike;
var _local1:int;
while (_local1 < spikesArr.length) {
_local2 = Spike(spikesArr[_local1]);
if (_local2.group == this){
_local2.mc.pause();
};
_local1++;
};
timerDisable.pause();
}
private function onTimerDisable():void{
SoundManager.getInstance().playSound("spikes_disappear", SoundGroups.GAME_SOUNDS);
TimerEx.start(1, 0.2, onDelayedTimerDisable);
}
public function resume():void{
var _local2:Spike;
var _local1:int;
while (_local1 < spikesArr.length) {
_local2 = Spike(spikesArr[_local1]);
if (_local2.group == this){
_local2.mc.resume();
};
_local1++;
};
timerDisable.resume();
}
}
}//package _game._world._spikes
Section 83
//Spikes (_game._world._spikes.Spikes)
package _game._world._spikes {
import flash.display.*;
import flash.events.*;
import framework._event.*;
import framework._component.*;
import _game._world._circleBounds.*;
import _components.*;
import _events.*;
public class Spikes extends WorldObject {
private const amount:int = 80;
private var groupArr:Array;
public function Spikes(){
groupArr = new Array();
super();
id = Components.SPIKES;
var _local1:Shape = new Shape();
_local1.graphics.beginFill(0, 1);
_local1.graphics.drawCircle(0, 0, (CircleBounds.radius - 4));
_local1.graphics.endFill();
_local1.x = CircleBounds.x;
_local1.y = CircleBounds.y;
canvas.mask = _local1;
}
override public function resume():void{
super.resume();
var _local1:int;
while (_local1 < groupArr.length) {
SpikeGroup(groupArr[_local1]).resume();
_local1++;
};
}
override public function pause():void{
super.pause();
var _local1:int;
while (_local1 < groupArr.length) {
SpikeGroup(groupArr[_local1]).pause();
_local1++;
};
}
public function stop():void{
while (groupArr.length) {
SpikeGroup(groupArr[0]).stop();
groupArr[0].removeEventListener(SpikeGroup.RELEASED, onGroupReleased);
groupArr.splice(0, 1);
};
}
private function onGroupReleased(_arg1:Event):void{
var _local2:SpikeGroup = SpikeGroup(_arg1.target);
_local2.removeEventListener(SpikeGroup.RELEASED, onGroupReleased);
var _local3:int = groupArr.indexOf(_local2);
if (_local3 != -1){
groupArr.splice(_local3, 1);
};
}
override protected function onAddedToRoute():void{
var _local1:int;
var _local2:Spike;
var _local3:Number;
GlobalDispatcher.addEventListener(GameEvents.ENABLE_SPIKES, onEnableSpikes);
_local1 = 0;
while (_local1 < amount) {
_local2 = new Spike();
_local3 = (((_local1 * Math.PI) * 2) / amount);
_local2.canvas.x = (CircleBounds.x + (CircleBounds.radius * Math.sin(_local3)));
_local2.canvas.y = (CircleBounds.y + (CircleBounds.radius * Math.cos(_local3)));
_local2.position.x = (CircleBounds.x + ((CircleBounds.radius - 15) * Math.sin(_local3)));
_local2.position.y = (CircleBounds.y + ((CircleBounds.radius - 15) * Math.cos(_local3)));
_local2.canvas.rotation = ((-(_local1) * 360) / amount);
_local2.canvas.visible = false;
_local2.radius = 8;
_local2.canCollide = false;
addChild(_local2);
_local1++;
};
}
override protected function onRemovedFromRoute():void{
GlobalDispatcher.removeEventListener(GameEvents.ENABLE_SPIKES, onEnableSpikes);
}
public function onEnableSpikes(_arg1:EventValue):void{
var _local2:SpikeGroup = new SpikeGroup(_arg1.value.lightGroup, _arg1.value.spikesArr, _arg1.value.time);
_local2.addEventListener(SpikeGroup.RELEASED, onGroupReleased);
groupArr.push(_local2);
}
}
}//package _game._world._spikes
Section 84
//World (_game._world.World)
package _game._world {
import flash.events.*;
import framework._event.*;
import framework._component.*;
import framework._core.*;
import _game._world._meteors.*;
import _game._stats.*;
import _game._phase.*;
import _game._world._circleBounds.*;
import _game._world._borderLights.*;
import _game._world._enemy.*;
import framework._utils._timer.*;
import _game._world._collision.*;
import _game._world._player.*;
import _game._gui.*;
import _screens._final.*;
import _components.*;
import _game.*;
import _events.*;
import _game._world._explosion.*;
import _game._world._shell.*;
import _game._world._spaceship.*;
import _game._world._item.*;
import _game._world._spikes.*;
public class World extends WorldObject implements IUpdateableLate {
private var firstMeteorShower:Boolean;// = true
private var timerFirstMeteorShower:TimerEx;
private var timerFirstSuperBomb:TimerEx;
private var canUseBomb:Boolean;// = true
private var collisionManager:CollisionManager;
private var circleBounds:CircleBounds;
private var firstSuperBomb:Boolean;// = true
public function World(){
timerFirstSuperBomb = new TimerEx(1, 0.2, onTimerFirstSuperBomb);
timerFirstMeteorShower = new TimerEx(1, 5, onTimerFirstMeteorShower);
super();
id = Components.WORLD;
}
private function onTimerFirstMeteorShower():void{
if (!root){
return;
};
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("watch out!!", 1, true);
}
override protected function onRemoved():void{
getChildById(Components.PLAYER).removeEventListener(GameEvents.BOMB_USED, onBombUsed);
GlobalDispatcher.removeEventListener(GameEvents.AUTO_BOMB, onAutoBomb);
}
public function stop():void{
getChildById(Components.PLAYER).removeEventListener(GameEvents.BOMB_USED, onBombUsed);
Player(getChildById(Components.PLAYER)).stop();
EnemyMgr(getChildById(Components.ENEMY_MANAGER)).stop();
Spikes(getChildById(Components.SPIKES)).stop();
var _local1:Array = getChildrenById(Components.METEOR_SHOWER);
var _local2:int;
while (_local2 < _local1.length) {
MeteorShower(_local1[_local2]).stop();
_local2++;
};
GlobalDispatcher.removeEventListener(GameEvents.AUTO_BOMB, onAutoBomb);
GlobalDispatcher.removeEventListener(GameEvents.ENABLE_METEOR_SHOWER, onEnableMeteorShower);
GlobalDispatcher.removeEventListener(GameEvents.ENABLE_METEOR_SHOWER_NOW, onEnableMeteorShowerNow);
GlobalDispatcher.removeEventListener(GameEvents.DESTROY_WORLD, onDestroyWorld);
GlobalDispatcher.removeEventListener(GameEvents.METEOR_SHOWER_ENABLED, onMeteorShowerEnabled);
}
public function onExplosionFinished(_arg1:Event):void{
_arg1.target.removeEventListener(GameEvents.EXPLOSION_FINISHED, onExplosionFinished);
EnemyMgr(getChildById(Components.ENEMY_MANAGER)).resumeGenerating();
removeChild(Explosion(_arg1.target));
canUseBomb = true;
}
private function onMeteorShowerComplete(_arg1:Event):void{
removeChild(MeteorShower(_arg1.target));
if (getChildrenById(Components.METEOR_SHOWER).length == 0){
BorderLightMgr(getChildById(Components.BORDERLIGHT_MANAGER)).resumeFromMeteorShower();
};
}
private function onMeteorShowerEnabled(_arg1:Event):void{
BorderLightMgr(getChildById(Components.BORDERLIGHT_MANAGER)).pauseFromMeteorShower();
}
private function relateBorderLightsWithSpikes():void{
var _local6:int;
var _local1:Array = getChildById(Components.BORDERLIGHT_MANAGER).children;
var _local2:Array = getChildById(Components.SPIKES).children;
var _local3:int = _local2.length;
var _local4:int = _local1.length;
var _local5:int;
while (_local5 < _local4) {
_local6 = 0;
while (_local6 < _local3) {
if (BorderLight(_local1[_local5]).mc.collider.hitTestObject(_local2[_local6].mc)){
BorderLight(_local1[_local5]).spikesRelated.push(_local2[_local6]);
};
_local6++;
};
_local5++;
};
}
public function updateLate():void{
collisionManager.update();
circleBounds.update();
}
private function onEnableMeteorShower(_arg1:EventValue):void{
if (Stats.inFinal){
return;
};
if (firstMeteorShower){
firstMeteorShower = false;
timerFirstMeteorShower.start();
};
var _local2:MeteorShower = new MeteorShower();
addChild(_local2);
_local2.enable(_arg1.value.type, _arg1.value.duration, _arg1.value.frequency);
_local2.addEventListener(MeteorShower.COMPLETE, onMeteorShowerComplete);
}
private function onEnableMeteorShowerNow(_arg1:EventValue):void{
var _local2:MeteorShower = new MeteorShower();
addChild(_local2);
_local2.enableNow(_arg1.value.type, _arg1.value.duration, _arg1.value.frequency);
_local2.addEventListener(MeteorShower.COMPLETE, onMeteorShowerComplete);
}
public function stopMeteorShower():void{
var _local1:Array = getChildrenById(Components.METEOR_SHOWER);
var _local2:int;
while (_local2 < _local1.length) {
MeteorShower(_local1[_local2]).disable();
_local2++;
};
}
public function gameOver():void{
EnemyMgr(getChildById(Components.ENEMY_MANAGER)).autoKillEnemies();
EnemyMgr(getChildById(Components.ENEMY_MANAGER)).pauseGenerating();
}
override protected function onAddedToRoute():void{
collisionManager = CollisionManager.getInstance();
collisionManager.reset();
addChild(new ItemMgr());
addChild(new EnemyMgr());
addChild(new Spikes());
addChild(new BorderLightMgr());
addChild(new Player(1));
addChild(new Shell());
addChild(new MeteorsShield());
relateBorderLightsWithSpikes();
circleBounds = CircleBounds.getInstance();
circleBounds.player = Player(getChildById(Components.PLAYER));
circleBounds.enemyMgr = EnemyMgr(getChildById(Components.ENEMY_MANAGER));
getChildById(Components.PLAYER).addEventListener(GameEvents.BOMB_USED, onBombUsed);
GlobalDispatcher.addEventListener(GameEvents.AUTO_BOMB, onAutoBomb);
GlobalDispatcher.addEventListener(GameEvents.ENABLE_METEOR_SHOWER, onEnableMeteorShower);
GlobalDispatcher.addEventListener(GameEvents.ENABLE_METEOR_SHOWER_NOW, onEnableMeteorShowerNow);
GlobalDispatcher.addEventListener(GameEvents.DESTROY_WORLD, onDestroyWorld);
GlobalDispatcher.addEventListener(GameEvents.METEOR_SHOWER_ENABLED, onMeteorShowerEnabled);
}
private function onAutoBomb(_arg1:EventValue):void{
if (((paused) || (!(canUseBomb)))){
return;
};
if (firstSuperBomb){
firstSuperBomb = false;
timerFirstSuperBomb.start();
};
var _local2:Explosion = new Explosion(_arg1.value.type);
_local2.position.x = _arg1.value.x;
_local2.position.y = _arg1.value.y;
_local2.addEventListener(GameEvents.EXPLOSION_FINISHED, onExplosionFinished);
addChild(_local2);
EnemyMgr(getChildById(Components.ENEMY_MANAGER)).pauseGenerating();
}
private function onTimerFirstSuperBomb():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("ka-boooom!", ((Stats.playerLevel < 5)) ? 2 : 3, true, 2);
}
public function addSpaceshipCollider():void{
var _local1:SpaceShipCollider = new SpaceShipCollider();
_local1.position.x = 296;
_local1.position.y = 296;
addChild(_local1);
}
private function onDestroyWorld(_arg1:Event):void{
PhaseManager.getInstance().stop();
EnemyMgr(getChildById(Components.ENEMY_MANAGER)).stopGenerating();
var _local2:Player = Player(getChildById(Components.PLAYER));
_local2.removeBombs();
Spikes(getChildById(Components.SPIKES)).stop();
ItemMgr(getChildById(Components.ITEM_MANAGER)).removeAll();
BorderLightMgr(getChildById(Components.BORDERLIGHT_MANAGER)).disableAll();
var _local3:Array = getChildrenById(Components.METEOR_SHOWER);
var _local4:int;
while (_local4 < _local3.length) {
MeteorShower(_local3[_local4]).disable();
_local4++;
};
finalExplosion(_local2.position.x, _local2.position.y);
Game(parent).startFinal();
}
override protected function onResumed():void{
timerFirstMeteorShower.resume();
timerFirstSuperBomb.resume();
}
override protected function onPaused():void{
timerFirstMeteorShower.pause();
timerFirstSuperBomb.pause();
}
private function onBombUsed(_arg1:EventValue):void{
if (((paused) || (!(canUseBomb)))){
return;
};
Stats.bombs--;
var _local2:Explosion = new Explosion(_arg1.value);
_local2.position.x = Player(_arg1.target).position.x;
_local2.position.y = Player(_arg1.target).position.y;
_local2.addEventListener(GameEvents.EXPLOSION_FINISHED, onExplosionFinished);
addChild(_local2);
EnemyMgr(getChildById(Components.ENEMY_MANAGER)).pauseGenerating();
}
private function finalExplosion(_arg1:Number, _arg2:Number):void{
var _local3:Explosion = new Explosion(4);
_local3.position.x = _arg1;
_local3.position.y = _arg2;
_local3.addEventListener(GameEvents.EXPLOSION_FINISHED, onExplosionFinished);
addChild(_local3);
}
}
}//package _game._world
Section 85
//Game (_game.Game)
package _game {
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._sound.*;
import framework._core.*;
import _game._world._meteors.*;
import _game._stats.*;
import framework._utils._console.*;
import framework._input.*;
import _game._phase.*;
import _game._world._borderLights.*;
import _backgrounds.*;
import _game._gui.*;
import _screens._final.*;
import _components.*;
import _events.*;
import _game._world.*;
import framework._utils._global.*;
public class Game extends Screen implements IUpdateable {
private var resetGame:Boolean;// = false
private var versionAccepted:Boolean;
private var pendingPause:Boolean;// = false
public function Game(){
id = Components.GAME;
versionAccepted = checkDeactivateEvent();
}
private function onAddBombToPlayer(_arg1:Event):void{
addBomb();
}
private function addBomb():void{
if (Stats.bombs < 3){
Stats.bombs++;
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player picks up bomb");
};
}
private function onPlayerDead(_arg1:Event):void{
Stats.diedOnce = true;
Stats.lives--;
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player dies");
Gui(parent.getChildById(Components.GUI)).updateLives();
if (Stats.lives <= 0){
gameOver();
} else {
switch (Stats.playerLevel){
case 1:
case 2:
PhaseManager.getInstance().substractPointsPercent(10);
break;
case 3:
case 4:
PhaseManager.getInstance().substractPointsPercent(7);
break;
case 5:
case 6:
PhaseManager.getInstance().substractPointsPercent(5);
break;
case 7:
PhaseManager.getInstance().substractPointsPercent(3);
};
Stats.readyToEvolve = false;
Gui(parent.getChildById(Components.GUI)).updateProgressBar();
GlobalDispatcher.dispatchEvent(new Event(GameEvents.PLAYER_REGENERATE));
Gui(parent.getChildById(Components.GUI)).onPlayerDead();
};
}
private function onPlayerGrows(_arg1:Event):void{
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player evolves");
Stats.readyToEvolve = false;
PhaseManager.getInstance().playerGrows();
Gui(parent.getChildById(Components.GUI)).playerGrows();
}
private function onDeactivate(_arg1:Event):void{
canvas.stage.removeEventListener(Event.DEACTIVATE, onDeactivate);
if (!paused){
pendingPause = true;
};
}
private function onAddLife(_arg1:Event):void{
Stats.lives++;
if ((((Stats.gameMode == GameModes.NORMAL)) || ((Stats.gameMode == GameModes.HARD)))){
if (Stats.lives > 6){
Stats.lives = 6;
} else {
Gui(parent.getChildById(Components.GUI)).updateLives();
};
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
if (Stats.lives > 4){
Stats.lives = 4;
} else {
Gui(parent.getChildById(Components.GUI)).updateLives();
};
} else {
if (Stats.lives > 2){
Stats.lives = 2;
} else {
Gui(parent.getChildById(Components.GUI)).updateLives();
};
};
};
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Player wins life");
}
private function checkCheatKeys():void{
if (Console.getInstance().getIsOpen()){
return;
};
if (keyDown(Keys.L)){
GlobalDispatcher.dispatchEvent(new Event(GameEvents.ADD_LIFE));
};
if (keyDown(Keys.B)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_BOMB_TO_WORLD));
};
if (keyDown(Keys.S)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_SUPER_BOMB_TO_WORLD));
};
if (keyDown(Keys.K)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:(7 + (Math.random() * 5)), type:BorderLightsType.SPIKE, time:999999}));
};
if (keyDown(Keys.G)){
Stats.godMode = !(Stats.godMode);
};
if (keyPressed(Keys.H)){
Stats.cancelPhases = true;
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ADD_PROGRESS_POINTS, 1000));
};
if (keyDown(Keys.NUMPAD_0)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER, {type:MeteorShower.LINE_CENTER, duration:8, frequency:7}));
};
if (keyDown(Keys.NUMPAD_1)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER, {type:MeteorShower.LINES_UP_CENTER, duration:8, frequency:7}));
};
if (keyDown(Keys.NUMPAD_2)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER, {type:MeteorShower.LINE_UP, duration:8, frequency:7}));
};
if (keyDown(Keys.ONE)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:4, type:BorderLightsType.SCORE, time:1}));
};
if (keyDown(Keys.TWO)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:7, type:BorderLightsType.SCORE, time:999999, startFrom:30}));
};
if (keyDown(Keys.THREE)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:10, type:BorderLightsType.SCORE, time:15}));
};
if (keyDown(Keys.FOUR)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:4, type:BorderLightsType.LIFE, time:1, startFrom:50}));
};
if (keyDown(Keys.FIVE)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:7, type:BorderLightsType.LIFE, time:12}));
};
if (keyDown(Keys.SIX)){
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:13, type:BorderLightsType.LIFE, time:20}));
};
}
override protected function onInitialize(_arg1:String):void{
canvas.stage.focus = null;
GlobalDispatcher.addEventListener(GameEvents.ADD_SCORE, onAddScore);
GlobalDispatcher.addEventListener(GameEvents.ADD_PROGRESS_POINTS, onAddProgressPoints);
GlobalDispatcher.addEventListener(GameEvents.ADD_LIFE, onAddLife);
GlobalDispatcher.addEventListener(GameEvents.PLAYER_ENDED_ANIM_DEAD, onPlayerDead);
GlobalDispatcher.addEventListener(GameEvents.ADD_BOMB_TO_PLAYER, onAddBombToPlayer);
GlobalDispatcher.addEventListener(GameEvents.PLAYER_GROWS, onPlayerGrows);
if (versionAccepted){
canvas.stage.addEventListener(Event.DEACTIVATE, onDeactivate);
};
addChild(new World());
PhaseManager.getInstance().reset();
PhaseManager.getInstance().checkNewPhase();
if (Stats.gameMode == GameModes.CREDITS){
executeTransition("addCredits");
};
Stats.reTry = false;
}
private function onAddScore(_arg1:EventValue):void{
Stats.score = (Stats.score + int(_arg1.value));
Gui(parent.getChildById(Components.GUI)).updateScore();
}
private function onAddProgressPoints(_arg1:EventValue):void{
if (Stats.readyToEvolve){
return;
};
PhaseManager.getInstance().addProgressPoints(_arg1.value);
Gui(parent.getChildById(Components.GUI)).updateProgressBar();
}
public function startFinal():void{
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Level Final started");
Stats.inFinal = true;
var _local1:int = SoundManager.getInstance().getSoundIdByName("gameMusic");
SoundManager.getInstance().fadeSound(_local1, 2.5, SoundEx.CURRENT_VOLUME, 0, SoundEx.EFFECT_END_STOP);
if (Stats.gameMode == GameModes.NORMAL){
executeTransition("Final");
} else {
if (Stats.gameMode == GameModes.HARD){
executeTransition("FinalHard");
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
executeTransition("FinalVeryHard");
} else {
if (Stats.gameMode == GameModes.CREDITS){
executeTransition("FinalCredits");
};
};
};
};
}
public function gameOver():void{
var _local1:int;
FinalStats.getInstance().gameCronometer.stop();
if (root.getDescendantById(Components.CREDITS_IN_GAME)){
executeTransition("removeCredits");
};
if (root.getDescendantById(Components.DIALOGS)){
executeTransition("removeDialogs");
};
if (!Stats.inFinal){
PhaseManager.getInstance().stop();
World(getChildById(Components.WORLD)).gameOver();
executeTransition("RemoveGui");
executeTransition("GameOver");
_local1 = SoundManager.getInstance().getSoundIdByName("gameMusic");
SoundManager.getInstance().fadeSound(_local1, 2.5, SoundEx.CURRENT_VOLUME, 0, SoundEx.EFFECT_END_STOP);
} else {
World(getChildById(Components.WORLD)).gameOver();
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).stop();
if (Stats.gameMode == GameModes.NORMAL){
FinalScreen(root.getDescendantById(Components.FINAL)).stop();
} else {
if (Stats.gameMode == GameModes.HARD){
FinalScreenHard(root.getDescendantById(Components.FINAL)).stop();
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
FinalScreenVeryHard(root.getDescendantById(Components.FINAL)).stop();
} else {
if (Stats.gameMode == GameModes.CREDITS){
FinalScreenCredits(root.getDescendantById(Components.FINAL)).stop();
};
};
};
};
Gui(root.getDescendantById(Components.GUI)).removeFinalGuiElements();
Stats.deadInFinal = true;
executeTransition("GameOver");
};
}
public function update():void{
if (((keyDown(Keys.ESC)) || (pendingPause))){
if (!paused){
pendingPause = false;
executeTransition("InGameMenu");
Gui(parent.getChildById(Components.GUI)).pause();
pauseRecursively();
};
};
}
override protected function onResumed():void{
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Resume");
FinalStats.getInstance().gameCronometer.resume();
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).resumeRecursively();
if (root.getDescendantById(Components.FINAL)){
root.getDescendantById(Components.FINAL).resumeRecursively();
};
if (root.getDescendantById(Components.RED_SCREEN)){
root.getDescendantById(Components.RED_SCREEN).resume();
};
if (root.getDescendantById(Components.CREDITS_IN_GAME)){
root.getDescendantById(Components.CREDITS_IN_GAME).resume();
};
if (versionAccepted){
canvas.stage.addEventListener(Event.DEACTIVATE, onDeactivate);
};
PhaseManager.getInstance().resume();
}
override protected function onPaused():void{
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Pause");
FinalStats.getInstance().gameCronometer.pause();
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).pauseRecursively();
if (root.getDescendantById(Components.FINAL)){
root.getDescendantById(Components.FINAL).pauseRecursively();
};
if (root.getDescendantById(Components.RED_SCREEN)){
root.getDescendantById(Components.RED_SCREEN).pause();
};
if (root.getDescendantById(Components.CREDITS_IN_GAME)){
root.getDescendantById(Components.CREDITS_IN_GAME).pause();
};
canvas.stage.removeEventListener(Event.DEACTIVATE, onDeactivate);
PhaseManager.getInstance().pause();
}
override protected function onExit(_arg1:String):void{
GlobalDispatcher.removeEventListener(GameEvents.ADD_SCORE, onAddScore);
GlobalDispatcher.removeEventListener(GameEvents.ADD_PROGRESS_POINTS, onAddProgressPoints);
GlobalDispatcher.removeEventListener(GameEvents.ADD_LIFE, onAddLife);
GlobalDispatcher.removeEventListener(GameEvents.ADD_BOMB_TO_PLAYER, onAddBombToPlayer);
GlobalDispatcher.removeEventListener(GameEvents.PLAYER_ENDED_ANIM_DEAD, onPlayerDead);
GlobalDispatcher.removeEventListener(GameEvents.PLAYER_GROWS, onPlayerGrows);
canvas.stage.removeEventListener(Event.DEACTIVATE, onDeactivate);
World(getChildById(Components.WORLD)).stop();
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).stop();
}
}
}//package _game
Section 86
//FinalScore (_screens._final.FinalScore)
package _screens._final {
import flash.events.*;
import framework._event.*;
import framework._component.*;
import framework._sound.*;
import _game._stats.*;
import assets.*;
import _sound.*;
import flash.text.*;
public class FinalScore extends WorldObject {
private var mc:FinalScoreAsset;
private var exitToHighscores:Boolean;// = false
public function FinalScore(){
mc = new FinalScoreAsset();
super();
canvas.addChild(mc);
}
protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
}
private function onClickBtnSubmit(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
mc.mainmenu_btn.removeEventListener(MouseEvent.CLICK, onClickBtnMainMenu);
mc.submit_btn.removeEventListener(MouseEvent.CLICK, onClickBtnSubmit);
mc.mainmenu_btn.removeEventListener(MouseEvent.ROLL_OVER, onButtonRollOver);
mc.submit_btn.removeEventListener(MouseEvent.ROLL_OVER, onButtonRollOver);
exitToHighscores = true;
mc.addEventListener("exited", onExited);
mc.gotoAndPlay("exit");
}
private function onEntered(_arg1:Event):void{
mc.mainmenu_btn.addEventListener(MouseEvent.CLICK, onClickBtnMainMenu);
mc.submit_btn.addEventListener(MouseEvent.CLICK, onClickBtnSubmit);
mc.mainmenu_btn.addEventListener(MouseEvent.ROLL_OVER, onButtonRollOver);
mc.submit_btn.addEventListener(MouseEvent.ROLL_OVER, onButtonRollOver);
mc.removeEventListener("entered", onEntered);
}
private function onClickBtnMainMenu(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
mc.mainmenu_btn.removeEventListener(MouseEvent.CLICK, onClickBtnMainMenu);
mc.submit_btn.removeEventListener(MouseEvent.CLICK, onClickBtnSubmit);
mc.mainmenu_btn.removeEventListener(MouseEvent.ROLL_OVER, onButtonRollOver);
mc.submit_btn.removeEventListener(MouseEvent.ROLL_OVER, onButtonRollOver);
exitToHighscores = false;
mc.addEventListener("exited", onExited);
mc.gotoAndPlay("exit");
}
override protected function onAddedToRoute():void{
var _local4:String;
var _local1:FinalStats = FinalStats.getInstance();
_local1.livesAmount = Stats.lives;
_local1.score = Stats.score;
_local1.finalScore = 0;
switch (Stats.gameMode){
case GameModes.NORMAL:
if (_local1.gameTime <= 185000){
_local1.finalScore = (_local1.finalScore + 1);
mc.time_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.gameTime <= 195000){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.time_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.gameTime <= 205000){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.time_qualif.qualif.gotoAndStop(2);
} else {
mc.time_qualif.qualif.gotoAndStop(1);
};
};
};
_local1.lightsTotal = 5;
if (_local1.lightsCaught == 5){
_local1.finalScore = (_local1.finalScore + 1);
mc.lights_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.lightsCaught == 4){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.lights_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.lightsCaught == 3){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.lights_qualif.qualif.gotoAndStop(2);
} else {
if (_local1.lightsCaught == 2){
mc.lights_qualif.qualif.gotoAndStop(1);
} else {
mc.lights_qualif.qualif.gotoAndStop(5);
};
};
};
};
_local1.livesTotal = 5;
if (_local1.livesAmount >= 5){
_local1.finalScore = (_local1.finalScore + 1);
mc.lives_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.livesAmount == 4){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.lives_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.livesAmount == 3){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.lives_qualif.qualif.gotoAndStop(2);
} else {
mc.lives_qualif.qualif.gotoAndStop(1);
};
};
};
break;
case GameModes.HARD:
if (_local1.gameTime <= 318000){
_local1.finalScore = (_local1.finalScore + 1);
mc.time_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.gameTime <= 325000){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.time_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.gameTime <= 340000){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.time_qualif.qualif.gotoAndStop(2);
} else {
mc.time_qualif.qualif.gotoAndStop(1);
};
};
};
_local1.lightsTotal = 7;
if (_local1.lightsCaught == 7){
_local1.finalScore = (_local1.finalScore + 1);
mc.lights_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.lightsCaught == 6){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.lights_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.lightsCaught >= 4){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.lights_qualif.qualif.gotoAndStop(2);
} else {
if (_local1.lightsCaught >= 1){
mc.lights_qualif.qualif.gotoAndStop(1);
} else {
mc.lights_qualif.qualif.gotoAndStop(5);
};
};
};
};
_local1.livesTotal = 5;
if (_local1.livesAmount >= 5){
_local1.finalScore = (_local1.finalScore + 1);
mc.lives_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.livesAmount == 4){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.lives_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.livesAmount == 3){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.lives_qualif.qualif.gotoAndStop(2);
} else {
mc.lives_qualif.qualif.gotoAndStop(1);
};
};
};
break;
case GameModes.VERY_HARD:
if (_local1.gameTime <= 395000){
_local1.finalScore = (_local1.finalScore + 1);
mc.time_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.gameTime <= 400000){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.time_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.gameTime <= 410000){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.time_qualif.qualif.gotoAndStop(2);
} else {
mc.time_qualif.qualif.gotoAndStop(1);
};
};
};
_local1.lightsTotal = 9;
if (_local1.lightsCaught == 9){
_local1.finalScore = (_local1.finalScore + 1);
mc.lights_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.lightsCaught >= 7){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.lights_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.lightsCaught >= 5){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.lights_qualif.qualif.gotoAndStop(2);
} else {
if (_local1.lightsCaught >= 3){
mc.lights_qualif.qualif.gotoAndStop(1);
} else {
mc.lights_qualif.qualif.gotoAndStop(5);
};
};
};
};
_local1.livesTotal = 3;
if (_local1.livesAmount >= 3){
_local1.finalScore = (_local1.finalScore + 1);
mc.lives_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.livesAmount == 2){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.lives_qualif.qualif.gotoAndStop(2);
} else {
mc.lives_qualif.qualif.gotoAndStop(1);
};
};
break;
case GameModes.CREDITS:
_local1.finalScore = (_local1.finalScore + 1);
mc.time_qualif.qualif.gotoAndStop(4);
_local1.lightsTotal = 5;
if (_local1.lightsCaught == 5){
_local1.finalScore = (_local1.finalScore + 1);
mc.lights_qualif.qualif.gotoAndStop(4);
} else {
if (_local1.lightsCaught == 4){
_local1.finalScore = (_local1.finalScore + 0.75);
mc.lights_qualif.qualif.gotoAndStop(3);
} else {
if (_local1.lightsCaught == 3){
_local1.finalScore = (_local1.finalScore + 0.5);
mc.lights_qualif.qualif.gotoAndStop(2);
} else {
if (_local1.lightsCaught == 2){
mc.lights_qualif.qualif.gotoAndStop(1);
} else {
mc.lights_qualif.qualif.gotoAndStop(5);
};
};
};
};
_local1.livesTotal = 1;
_local1.finalScore = (_local1.finalScore + 1);
mc.lives_qualif.qualif.gotoAndStop(4);
break;
};
if (_local1.finalScore == 3){
mc.medal.gotoAndStop("perfect");
mc.job_qualification.gotoAndStop("perfect");
_local1.medal = 4;
} else {
if (_local1.finalScore >= 2.25){
mc.medal.gotoAndStop("gold");
mc.job_qualification.gotoAndStop("excellent");
_local1.medal = 3;
} else {
if (_local1.finalScore >= 1.5){
mc.medal.gotoAndStop("silver");
mc.job_qualification.gotoAndStop("nice");
_local1.medal = 2;
} else {
mc.medal.gotoAndStop("bronce");
mc.job_qualification.gotoAndStop("good");
_local1.medal = 1;
};
};
};
var _local2:GameModeStats = Stats.gameModeStatsArr[Stats.gameMode];
if (_local1.score > _local2.score){
_local2.score = _local1.score;
mc.newHighscore.visible = true;
} else {
mc.newHighscore.visible = false;
};
if (_local1.finalScore > _local2.finalScore){
_local2.gameTime = _local1.gameTime;
_local2.lightsCaught = _local1.lightsCaught;
_local2.lightsTotal = _local1.lightsTotal;
_local2.livesAmount = _local1.livesAmount;
_local2.livesTotal = _local1.livesTotal;
_local2.medal = _local1.medal;
_local2.finalScore = _local1.finalScore;
} else {
if (_local1.finalScore == _local2.finalScore){
if ((((((_local1.gameTime >= _local2.gameTime)) && ((_local1.lightsCaught >= _local2.lightsCaught)))) && ((_local1.livesAmount >= _local2.livesAmount)))){
_local2.gameTime = _local1.gameTime;
_local2.lightsCaught = _local1.lightsCaught;
_local2.lightsTotal = _local1.lightsTotal;
_local2.livesAmount = _local1.livesAmount;
_local2.livesTotal = _local1.livesTotal;
_local2.medal = _local1.medal;
_local2.finalScore = _local1.finalScore;
};
};
};
mc.score.tf.defaultTextFormat = new TextFormat("ScienceProject", 43);
mc.score.tf.embedFonts = true;
mc.score.tf.text = _local1.score.toString();
var _local3:int = ((_local1.gameTime * 0.001) % 60);
if (_local3 < 10){
_local4 = ("0" + _local3.toString());
} else {
_local4 = _local3.toString();
};
var _local5:int = ((_local1.gameTime * 0.001) / 60);
var _local6:String = _local5.toString();
mc.time.tf.defaultTextFormat = new TextFormat("ScienceProject");
mc.time.tf.embedFonts = true;
mc.time.tf.text = ((_local6 + ":") + _local4);
mc.lives.tf_total.defaultTextFormat = new TextFormat("ScienceProject");
mc.lives.tf_total.embedFonts = true;
mc.lives.tf_total.autoSize = TextFieldAutoSize.RIGHT;
mc.lives.tf_total.text = _local1.livesTotal.toString();
mc.lives.bar.x = (mc.lives.tf_total.x - 7);
mc.lives.tf_amount.defaultTextFormat = new TextFormat("ScienceProject");
mc.lives.tf_amount.embedFonts = true;
mc.lives.tf_amount.autoSize = TextFieldAutoSize.RIGHT;
mc.lives.tf_amount.text = Stats.lives.toString();
mc.lives.tf_amount.x = ((mc.lives.bar.x - 8) - mc.lives.tf_amount.width);
mc.lights.tf_total.defaultTextFormat = new TextFormat("ScienceProject");
mc.lights.tf_total.embedFonts = true;
mc.lights.tf_total.autoSize = TextFieldAutoSize.RIGHT;
mc.lights.tf_total.text = _local1.lightsTotal.toString();
mc.lights.bar.x = (mc.lights.tf_total.x - 7);
mc.lights.tf_amount.defaultTextFormat = new TextFormat("ScienceProject");
mc.lights.tf_amount.embedFonts = true;
mc.lights.tf_amount.autoSize = TextFieldAutoSize.RIGHT;
mc.lights.tf_amount.text = _local1.lightsCaught.toString();
mc.lights.tf_amount.x = ((mc.lights.bar.x - 8) - mc.lights.tf_amount.width);
mc.time_qualif.gotoAndStop(1);
mc.lights_qualif.gotoAndStop(1);
mc.lives_qualif.gotoAndStop(1);
mc.newHighscore.gotoAndStop(1);
mc.addEventListener("entered", onEntered);
mc.gotoAndPlay("enter");
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Level finished");
Stats.gameTracker.endLevel(Stats.gameModeStatsArr[Stats.gameMode].score, Stats.gameModeStatsArr[Stats.gameMode].medal, ((((("time=" + Stats.gameModeStatsArr[Stats.gameMode].gameTime) + ", lives=") + Stats.gameModeStatsArr[Stats.gameMode].livesAmount) + ", zEnergy=") + Stats.gameModeStatsArr[Stats.gameMode].lightsCaught));
if (Stats.gameMode == GameModes.NORMAL){
Stats.submitKongStat("ScoreLevel1", Stats.score);
Stats.submitKongStat("TimeLevel1", int((_local1.gameTime / 1000)));
Stats.submitKongStat("LivesLevel1", Stats.lives);
Stats.submitKongStat("Level1WithoutLosingALife", (Stats.diedOnce) ? 0 : 1);
Stats.submitKongStat("MedalLevel1", _local1.medal);
} else {
if (Stats.gameMode == GameModes.HARD){
Stats.submitKongStat("ScoreLevel2", Stats.score);
Stats.submitKongStat("TimeLevel2", int((_local1.gameTime / 1000)));
Stats.submitKongStat("LivesLevel2", Stats.lives);
Stats.submitKongStat("Level2WithoutLosingALife", (Stats.diedOnce) ? 0 : 1);
Stats.submitKongStat("MedalLevel2", _local1.medal);
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
Stats.submitKongStat("ScoreLevel3", Stats.score);
Stats.submitKongStat("TimeLevel3", int((_local1.gameTime / 1000)));
Stats.submitKongStat("LivesLevel3", Stats.lives);
Stats.submitKongStat("Level3WithoutLosingALife", (Stats.diedOnce) ? 0 : 1);
Stats.submitKongStat("MedalLevel3", _local1.medal);
} else {
Stats.submitKongStat("ScoreLevel4", Stats.score);
Stats.submitKongStat("TimeLevel4", int((_local1.gameTime / 1000)));
Stats.submitKongStat("LivesLevel4", Stats.lives);
Stats.submitKongStat("Level4WithoutLosingALife", (Stats.diedOnce) ? 0 : 1);
Stats.submitKongStat("MedalLevel4", _local1.medal);
};
};
};
Stats.submitKongStat("EnemiesKilled", Stats.enemiesKilled);
var _local7:int;
if (Stats.gameMode == GameModes.NORMAL){
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.HARD].livesAmount);
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.VERY_HARD].livesAmount);
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.CREDITS].livesAmount);
_local7 = (_local7 + FinalStats.getInstance().livesAmount);
Stats.submitKongStat("LivesTotal", _local7);
} else {
if (Stats.gameMode == GameModes.HARD){
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.NORMAL].livesAmount);
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.VERY_HARD].livesAmount);
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.CREDITS].livesAmount);
_local7 = (_local7 + FinalStats.getInstance().livesAmount);
Stats.submitKongStat("LivesTotal", _local7);
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.NORMAL].livesAmount);
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.HARD].livesAmount);
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.CREDITS].livesAmount);
_local7 = (_local7 + FinalStats.getInstance().livesAmount);
Stats.submitKongStat("LivesTotal", _local7);
} else {
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.NORMAL].livesAmount);
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.HARD].livesAmount);
_local7 = (_local7 + Stats.gameModeStatsArr[GameModes.VERY_HARD].livesAmount);
_local7 = (_local7 + FinalStats.getInstance().livesAmount);
Stats.submitKongStat("LivesTotal", _local7);
};
};
};
}
private function onExited(_arg1:Event):void{
mc.removeEventListener("exited", onExited);
dispatchEvent(new EventValue("end", exitToHighscores));
}
}
}//package _screens._final
Section 87
//FinalScreen (_screens._final.FinalScreen)
package _screens._final {
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import flash.net.*;
import assets.*;
import _game._world._borderLights.*;
import framework._utils._timer.*;
import _backgrounds.*;
import _game._gui.*;
import _components.*;
import _sound.*;
import _game.*;
import _events.*;
import _game._world.*;
public class FinalScreen extends Screen {
private var giantMeteorAnim:GiantMeteorAnim;
private var explosionMc:GiantMeteorExplosion;
private var timer2:TimerEx;
private var musicId:int;
private var finalScore:FinalScore;
private var spaceship:Spaceship;
private var timer:TimerEx;
private var timersMod:Number;// = 1
private var gameCompleted:GameCompleted;
public function FinalScreen(){
giantMeteorAnim = new GiantMeteorAnim();
spaceship = new Spaceship();
explosionMc = new GiantMeteorExplosion();
gameCompleted = new GameCompleted();
finalScore = new FinalScore();
super();
id = Components.FINAL;
}
private function showDanger():void{
Gui(root.getDescendantById(Components.GUI)).enableFinalDanger();
}
private function startShipTeleport():void{
addChild(spaceship);
spaceship.startTeleport();
timer = new TimerEx(1, (3 * timersMod), startGiantMeteorAlarm);
timer.start();
}
private function playerWink():void{
spaceship.playerWink();
timer = new TimerEx(1, 0.1, startEngines);
timer.start();
}
private function msg1a():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("you did a great job!", 1, false);
timer = new TimerEx(1, (2 * timersMod), msg1aa);
timer.start();
}
private function msg1b():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("now, let's bring you back.", 1, false);
timer = new TimerEx(1, (3.2 * timersMod), msg2);
timer.start();
musicId = SoundManager.getInstance().playSound("gameMusic", SoundGroups.GAME_MUSIC, 9999, 0);
SoundManager.getInstance().fadeSound(musicId, 1, 0, 0.2);
}
private function onGameCompletedEnd(_arg1:Event):void{
removeChild(gameCompleted);
gameCompleted.removeEventListener("end", onGameCompletedEnd);
finalScore.addEventListener("end", onFinalScoreEnd);
addChild(finalScore);
var _local2:SharedObject = SharedObject.getLocal("Bobulous");
_local2.data.normal = Stats.gameModeStatsArr[GameModes.NORMAL];
_local2.data.hard = Stats.gameModeStatsArr[GameModes.HARD];
}
private function startGiantMeteorAlarm():void{
executeTransition("RedScreen");
timer = new TimerEx(1, (1 * timersMod), msg3);
timer.start();
SoundManager.getInstance().fadeSound(musicId, 1, 0.2, 0);
}
private function onGiantMeteorAppear(_arg1:Event):void{
spaceship.removeEventListener("enableGiantMeteor", onGiantMeteorAppear);
addChildAt(giantMeteorAnim, 0);
giantMeteorAnim.addEventListener("collided", onMeteorCollided);
giantMeteorAnim.start();
timer = new TimerEx(1, 2, msg8);
timer.start();
}
private function startEngines():void{
spaceship.startEngines();
spaceship.addEventListener("enableGiantMeteor", onGiantMeteorAppear);
timer = new TimerEx(1, 0.2, showDanger);
timer.start();
}
private function victorySound1():void{
SoundManager.getInstance().playSound("lastEvolution", SoundGroups.GAME_MUSIC, 1, 0.8);
timer = new TimerEx(1, (4 * timersMod), msg1a);
timer.start();
}
public function stop():void{
if (timer){
timer.pause();
};
if (timer2){
timer2.pause();
};
timer = null;
timer2 = null;
if (root.getDescendantById(Components.RED_SCREEN)){
RedScreen(root.getDescendantById(Components.RED_SCREEN)).stop();
};
spaceship.stop();
Gui(root.getDescendantById(Components.GUI)).removeArrowPointing("spaceship");
Gui(root.getDescendantById(Components.GUI)).removeGetIn();
spaceship.removeEventListener("enableGiantMeteor", onGiantMeteorAppear);
executeTransition("remove");
GlobalDispatcher.removeEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
GlobalDispatcher.removeEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
}
private function onEnergyGathered(_arg1:EventValue):void{
if (_arg1.value == ((timersMod < 1)) ? 1 : 3){
GlobalDispatcher.removeEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
timer = new TimerEx(1, 0.2, msg7);
timer.start();
spaceship.completeTeleport(onSpaceshipTeleportComplete);
} else {
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:10, type:BorderLightsType.ENERGY, time:-1}));
};
}
private function onSpaceshipTeleportComplete(_arg1:Event):void{
World(root.getDescendantById(Components.WORLD)).addSpaceshipCollider();
GlobalDispatcher.addEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
Gui(root.getDescendantById(Components.GUI)).addGetIn(295, 295);
Gui(root.getDescendantById(Components.GUI)).addArrowPointing("spaceship", 295, 310, 0, 1);
}
private function onShipBoarded(_arg1:Event):void{
GlobalDispatcher.removeEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
FinalStats.getInstance().saveGameTime();
Gui(root.getDescendantById(Components.GUI)).removeFinalGuiElements();
Game(root.getDescendantById(Components.GAME)).executeTransition("remove");
spaceship.playerBoarded();
timer = new TimerEx(1, 0.3, closeGlass);
timer.start();
Gui(root.getDescendantById(Components.GUI)).removeGetIn();
Gui(root.getDescendantById(Components.GUI)).removeArrowPointing("spaceship");
}
private function onExplosionComplete(_arg1:Event):void{
explosionMc.removeEventListener("complete", onExplosionComplete);
canvas.removeChild(explosionMc);
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Captain?!?!", 1, false);
timer = new TimerEx(1, 3, msg9);
timer.start();
}
private function msg1():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("you did it captain!", 1, false);
timer = new TimerEx(1, (0.2 * timersMod), victorySound1);
timer.start();
}
private function msg2():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("teleporting spaceship...", true);
timer = new TimerEx(1, (2 * timersMod), startShipTeleport);
timer.start();
}
private function msg3():void{
spaceship.stopTeleportingSound();
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("oh no!!", 1, false);
timer = new TimerEx(1, (2 * timersMod), msg4);
timer.start();
timer2 = new TimerEx(1, 1, showMeteorPassing);
timer2.start();
}
private function msg4():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("a giant meteor is approaching!", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg4b);
timer.start();
}
private function msg6():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("you need to gather more energy!", 1, true);
timer = new TimerEx(1, (4 * timersMod), turnEnergyLightsOn);
timer.start();
}
override protected function onInitialize(_arg1:String):void{
Gui(root.getDescendantById(Components.GUI)).removeAvoid();
timer = new TimerEx(1, (1 * timersMod), msg1);
timer.start();
}
private function msg8():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captaaaain!!!", 1, true, 2.2, 1);
}
private function msg9():void{
gameCompleted.addEventListener("end", onGameCompletedEnd);
addChild(gameCompleted);
timer = new TimerEx(1, 0.7, msg10);
timer.start();
timer2 = new TimerEx(1, 1.5, unlocked);
timer2.start();
SoundManager.getInstance().playSound("congratulations", SoundGroups.GAME_MUSIC);
}
private function msg5():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("but the spaceship will not \nteleport on time!", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg6);
timer.start();
}
private function msg7():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("that's it! now get into \nthe spaceship!", 1, true);
}
private function msg10():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Yeah!", 1, false);
timer = new TimerEx(1, 1.5, msg11);
timer.start();
}
private function turnEnergyLightsOn():void{
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:10, type:BorderLightsType.ENERGY, time:-1}));
GlobalDispatcher.addEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
}
private function unlocked():void{
if (!GameModeStats(Stats.gameModeStatsArr[GameModes.HARD]).unlocked){
GameModeStats(Stats.gameModeStatsArr[GameModes.HARD]).unlocked = true;
GameModeStats(Stats.gameModeStatsArr[GameModes.HARD]).isNew = true;
Gui(root.getDescendantById(Components.GUI)).showHardUnlockedMsg();
};
}
private function closeGlass():void{
spaceship.closeGlass();
timer = new TimerEx(1, 1.2, playerWink);
timer.start();
}
private function onFinalScoreEnd(_arg1:EventValue):void{
removeChild(finalScore);
if (_arg1.value == false){
executeTransition("WhiteScreenMainMenu");
} else {
executeTransition("HiScores");
};
}
private function msg11():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("you are alive!!!", true, 2.5);
}
private function onExplosionFullCanvas(_arg1:Event):void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).removeCircle();
spaceship.setInvisible();
}
override protected function onPaused():void{
if (timer){
timer.pause();
};
if (timer2){
timer2.pause();
};
}
private function showMeteorPassing():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).giantMeteorPassBack();
}
private function msg1aa():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("but the battle has just started!", false);
timer = new TimerEx(1, (4 * timersMod), msg1b);
timer.start();
}
private function onMeteorCollided(_arg1:Event):void{
giantMeteorAnim.removeEventListener("collided", onMeteorCollided);
RedScreen(root.getDescendantById(Components.RED_SCREEN)).stop();
explosionMc.addEventListener("fullExplosion", onExplosionFullCanvas);
explosionMc.addEventListener("complete", onExplosionComplete);
explosionMc.gotoAndPlay(1);
canvas.addChildAt(explosionMc, 1);
spaceship.vibrate();
removeChild(giantMeteorAnim);
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).vibrateCircle();
}
private function msg4b():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("collision is imminent!!", false);
timer = new TimerEx(1, (4 * timersMod), msg5);
timer.start();
}
override protected function onResumed():void{
if (timer){
timer.resume();
};
if (timer2){
timer2.resume();
};
}
}
}//package _screens._final
Section 88
//FinalScreenCredits (_screens._final.FinalScreenCredits)
package _screens._final {
import flash.display.*;
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import flash.net.*;
import framework._utils._timer.*;
import _screens.*;
import gs.*;
import _backgrounds.*;
import _game._gui.*;
import _components.*;
import _sound.*;
import _game.*;
import _events.*;
import _game._world.*;
public class FinalScreenCredits extends Screen {
private var spaceship:Spaceship;
private var timer:TimerEx;
private var timersMod:Number;// = 1
private var musicId:int;
private var whiteScreen:Shape;
private var gameCompleted:GameCompleted;
private var finalScore:FinalScore;
public function FinalScreenCredits(){
spaceship = new Spaceship();
gameCompleted = new GameCompleted();
finalScore = new FinalScore();
whiteScreen = new Shape();
super();
id = Components.FINAL;
whiteScreen.graphics.beginFill(0xFFFFFF);
whiteScreen.graphics.drawRect(0, 0, 600, 600);
whiteScreen.graphics.endFill();
whiteScreen.alpha = 0;
gameCompleted.mc.mission_txt.gotoAndStop(2);
}
private function startShipTeleport():void{
addChild(spaceship);
spaceship.startTeleport();
timer = new TimerEx(1, (3 * timersMod), spaceshipCompleteTeleport);
timer.start();
}
private function teleportComplete(_arg1:Event):void{
World(root.getDescendantById(Components.WORLD)).addSpaceshipCollider();
GlobalDispatcher.addEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
Gui(root.getDescendantById(Components.GUI)).addGetIn(295, 295);
Gui(root.getDescendantById(Components.GUI)).addArrowPointing("spaceship", 295, 310, 0, 1);
}
private function whiteScreenDelay():void{
TweenMax.to(whiteScreen, 5, {alpha:0, onComplete:whiteScreenOut});
}
override protected function onInitialize(_arg1:String):void{
Gui(root.getDescendantById(Components.GUI)).removeAvoid();
timer = new TimerEx(1, (1 * timersMod), msg1);
timer.start();
}
private function msg1():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain! \nyou have done an awesome job!", 1, false);
timer = new TimerEx(1, (0.2 * timersMod), victorySound1);
timer.start();
}
private function msg1a():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("i am very grateful.", 1, false);
timer = new TimerEx(1, (3 * timersMod), msg1b);
timer.start();
}
private function msg1b():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("now, let's bring you back!", 1, false);
timer = new TimerEx(1, (3.2 * timersMod), msg2);
timer.start();
musicId = SoundManager.getInstance().playSound("gameMusic", SoundGroups.GAME_MUSIC, 9999, 0);
SoundManager.getInstance().fadeSound(musicId, 1, 0, 0.2);
}
private function playerWink():void{
spaceship.playerWink();
timer = new TimerEx(1, 0.1, startEngines);
timer.start();
}
private function msg2():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("everyone is waiting for your arrival.", false);
timer = new TimerEx(1, (4 * timersMod), msg2a);
timer.start();
}
private function onShipBoarded(_arg1:Event):void{
GlobalDispatcher.removeEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
FinalStats.getInstance().saveGameTime();
Gui(root.getDescendantById(Components.GUI)).removeFinalGuiElements();
Game(root.getDescendantById(Components.GAME)).executeTransition("remove");
spaceship.playerBoarded();
timer = new TimerEx(1, 0.3, closeGlass);
timer.start();
Gui(root.getDescendantById(Components.GUI)).removeGetIn();
Gui(root.getDescendantById(Components.GUI)).removeArrowPointing("spaceship");
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("i will be waiting right here for you...", 1, true);
CreditsInGameScreen(root.getDescendantById(Components.CREDITS_IN_GAME)).showThanksForPlaying();
}
public function stop():void{
if (timer){
timer.pause();
};
timer = null;
spaceship.stop();
Gui(root.getDescendantById(Components.GUI)).removeArrowPointing("spaceship");
Gui(root.getDescendantById(Components.GUI)).removeGetIn();
GlobalDispatcher.removeEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
executeTransition("remove");
}
private function msg9():void{
gameCompleted.addEventListener("end", onGameCompletedEnd);
addChild(gameCompleted);
SoundManager.getInstance().playSound("congratulations", SoundGroups.GAME_MUSIC);
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).enableFireworks();
}
private function onGameCompletedEnd(_arg1:Event):void{
removeChild(gameCompleted);
gameCompleted.removeEventListener("end", onGameCompletedEnd);
finalScore.addEventListener("end", onFinalScoreEnd);
addChild(finalScore);
var _local2:SharedObject = SharedObject.getLocal("Bobulous");
_local2.data.credits = Stats.gameModeStatsArr[GameModes.CREDITS];
}
private function closeGlass():void{
spaceship.closeGlass();
timer = new TimerEx(1, 1.2, playerWink);
timer.start();
}
private function spaceshipCompleteTeleport():void{
spaceship.completeTeleport(teleportComplete);
}
private function onFinalScoreEnd(_arg1:EventValue):void{
removeChild(finalScore);
if (_arg1.value == false){
executeTransition("WhiteScreenMainMenu");
} else {
executeTransition("HiScores");
};
}
override protected function onPaused():void{
if (timer){
timer.pause();
};
}
private function startEngines():void{
spaceship.startEngines();
timer = new TimerEx(1, 1, whiteScreenIn);
timer.start();
}
private function msg2a():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("teleporting spaceship...", 1, true);
timer = new TimerEx(1, (2 * timersMod), startShipTeleport);
timer.start();
}
private function whiteScreenOut():void{
canvas.removeChild(whiteScreen);
timer = new TimerEx(1, 0.1, msg9);
timer.start();
}
private function victorySound1():void{
SoundManager.getInstance().playSound("lastEvolution", SoundGroups.GAME_MUSIC, 1, 0.8);
timer = new TimerEx(1, (5 * timersMod), msg1a);
timer.start();
}
private function whiteScreenIn():void{
canvas.addChild(whiteScreen);
whiteScreen.alpha = 0;
TweenMax.to(whiteScreen, 3, {alpha:1, onComplete:onWhiteScreenFullCanvas});
}
private function onWhiteScreenFullCanvas():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).removeCircle();
spaceship.setInvisible();
timer = new TimerEx(1, 4, whiteScreenDelay);
timer.start();
}
override protected function onResumed():void{
if (timer){
timer.resume();
};
}
}
}//package _screens._final
Section 89
//FinalScreenHard (_screens._final.FinalScreenHard)
package _screens._final {
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._sound.*;
import framework._core.*;
import _game._stats.*;
import flash.net.*;
import assets.*;
import _game._world._borderLights.*;
import framework._utils._timer.*;
import _game._world._player.*;
import _backgrounds.*;
import _game._gui.*;
import _components.*;
import _sound.*;
import _game.*;
import _events.*;
import _game._world.*;
public class FinalScreenHard extends Screen implements IUpdateable {
private var giantMeteorAnim:GiantMeteorAnim;
private var explosionMc:GiantMeteorExplosion;
private var timerCountDown:TimerEx;
private var timer2:TimerEx;
private var musicId:int;
private var shipBoarded:Boolean;
private var finalScore:FinalScore;
private var spaceship:Spaceship;
private var playerDiedAtEnd:Boolean;// = false
private var timer:TimerEx;
private var timersMod:Number;// = 1
private var gameCompleted:GameCompleted;
public function FinalScreenHard(){
giantMeteorAnim = new GiantMeteorAnim();
spaceship = new Spaceship();
explosionMc = new GiantMeteorExplosion();
gameCompleted = new GameCompleted();
finalScore = new FinalScore();
timerCountDown = new TimerEx(1, 35, onTimerCountDown);
super();
id = Components.FINAL;
}
private function showDanger():void{
Gui(root.getDescendantById(Components.GUI)).enableFinalDanger();
}
private function msg11():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("you are alive!!!", true, 2.5);
}
private function startShipTeleport():void{
addChild(spaceship);
spaceship.startTeleport();
timer = new TimerEx(1, (3 * timersMod), startGiantMeteorAlarm);
timer.start();
}
private function playerWink():void{
spaceship.playerWink();
timer = new TimerEx(1, 0.1, startEngines);
timer.start();
}
private function msg1a():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("you are really powerful!", 1, false);
timer = new TimerEx(1, (2 * timersMod), msg1aa);
timer.start();
}
private function msg1b():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("now, it's time to bring you back!", 1, false);
timer = new TimerEx(1, (3.2 * timersMod), msg2);
timer.start();
musicId = SoundManager.getInstance().playSound("gameMusic", SoundGroups.GAME_MUSIC, 9999, 0);
SoundManager.getInstance().fadeSound(musicId, 1, 0, 0.2);
}
private function onFinalScoreEnd(_arg1:EventValue):void{
removeChild(finalScore);
if (_arg1.value == false){
executeTransition("WhiteScreenMainMenu");
} else {
executeTransition("HiScores");
};
}
override protected function onExit(_arg1:String):void{
GlobalDispatcher.removeEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
}
private function onGameCompletedEnd(_arg1:Event):void{
removeChild(gameCompleted);
gameCompleted.removeEventListener("end", onGameCompletedEnd);
finalScore.addEventListener("end", onFinalScoreEnd);
addChild(finalScore);
var _local2:SharedObject = SharedObject.getLocal("Bobulous");
_local2.data.hard = Stats.gameModeStatsArr[GameModes.HARD];
_local2.data.veryhard = Stats.gameModeStatsArr[GameModes.VERY_HARD];
}
private function startGiantMeteorAlarm():void{
executeTransition("RedScreen");
timer = new TimerEx(1, (1 * timersMod), msg3);
timer.start();
SoundManager.getInstance().fadeSound(musicId, 1, 0.2, 0);
}
private function startEngines():void{
SoundManager.getInstance().playSound("bombAppears", SoundGroups.GAME_SOUNDS);
spaceship.startEngines();
spaceship.addEventListener("enableGiantMeteor", giantMeteorAppear);
timer = new TimerEx(1, 0.2, showDanger);
timer.start();
}
private function victorySound1():void{
SoundManager.getInstance().playSound("lastEvolution", SoundGroups.GAME_MUSIC, 1, 0.8);
timer = new TimerEx(1, (4 * timersMod), msg1a);
timer.start();
}
public function stop():void{
if (timer){
timer.pause();
};
if (timer2){
timer2.pause();
};
timerCountDown.stop();
timer = null;
timer2 = null;
if (root.getDescendantById(Components.RED_SCREEN)){
RedScreen(root.getDescendantById(Components.RED_SCREEN)).stop();
};
Gui(root.getDescendantById(Components.GUI)).hideCounter();
spaceship.stop();
GlobalDispatcher.removeEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
Gui(root.getDescendantById(Components.GUI)).removeArrowPointing("spaceship");
Gui(root.getDescendantById(Components.GUI)).removeGetIn();
executeTransition("remove");
}
private function onEnergyGathered(_arg1:EventValue):void{
if (_arg1.value == ((timersMod < 1)) ? 1 : 5){
GlobalDispatcher.removeEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
timer = new TimerEx(1, 0.2, msg7);
timer.start();
spaceship.completeTeleport(onSpaceshipTeleportComplete);
} else {
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:10, type:BorderLightsType.ENERGY, time:-1}));
};
}
private function giantMeteorAppear(_arg1:Event):void{
spaceship.removeEventListener("enableGiantMeteor", giantMeteorAppear);
if (playerDiedAtEnd){
addChild(giantMeteorAnim);
} else {
addChildAt(giantMeteorAnim, 0);
};
giantMeteorAnim.addEventListener("collided", onMeteorCollided);
giantMeteorAnim.start();
timer = new TimerEx(1, 2, msg8);
timer.start();
if (!shipBoarded){
GlobalDispatcher.removeEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
GlobalDispatcher.removeEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
};
}
private function onSpaceshipTeleportComplete(_arg1:Event):void{
World(root.getDescendantById(Components.WORLD)).addSpaceshipCollider();
GlobalDispatcher.addEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
Gui(root.getDescendantById(Components.GUI)).addGetIn(295, 295);
Gui(root.getDescendantById(Components.GUI)).addArrowPointing("spaceship", 295, 310, 0, 1);
}
public function update():void{
Gui(root.getDescendantById(Components.GUI)).setCounterTime((timerCountDown.getTimeAmount() - timerCountDown.getCurrentTimeInSeconds()));
}
private function onShipBoarded(_arg1:Event):void{
timerCountDown.stop();
GlobalDispatcher.removeEventListener(GameEvents.SHIP_BOARDED, onShipBoarded);
shipBoarded = true;
FinalStats.getInstance().saveGameTime();
Gui(root.getDescendantById(Components.GUI)).removeFinalGuiElements();
Game(root.getDescendantById(Components.GAME)).executeTransition("remove");
spaceship.playerBoarded();
Gui(root.getDescendantById(Components.GUI)).setCounterTime(0);
deactivate();
timer = new TimerEx(1, 0.3, closeGlass);
timer.start();
Gui(root.getDescendantById(Components.GUI)).removeGetIn();
Gui(root.getDescendantById(Components.GUI)).removeArrowPointing("spaceship");
}
private function onTimerCountDown():void{
playerDiedAtEnd = true;
Gui(root.getDescendantById(Components.GUI)).setCounterTime(0);
deactivate();
giantMeteorAppear(null);
Player(root.getDescendantById(Components.PLAYER)).canCollide = false;
Player(root.getDescendantById(Components.PLAYER)).setSlowSpeed();
BorderLightMgr(root.getDescendantById(Components.BORDERLIGHT_MANAGER)).disableAll();
Gui(root.getDescendantById(Components.GUI)).removeFinalGuiElements();
Gui(root.getDescendantById(Components.GUI)).removeGetIn();
Gui(root.getDescendantById(Components.GUI)).removeArrowPointing("spaceship");
}
override protected function onInitialize(_arg1:String):void{
Gui(root.getDescendantById(Components.GUI)).removeAvoid();
shipBoarded = false;
Stats.deadInFinal = false;
timer = new TimerEx(1, (1 * timersMod), msg1);
timer.start();
deactivate();
playerDiedAtEnd = false;
}
private function msg1():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("you did it captain!", 1, false);
timer = new TimerEx(1, (0.2 * timersMod), victorySound1);
timer.start();
}
private function msg2():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("teleporting spaceship...", 1, true);
timer = new TimerEx(1, (2 * timersMod), startShipTeleport);
timer.start();
}
private function msg4():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("a giant meteor is approaching!", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg4b);
timer.start();
}
private function msg6():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("you need to gather more energy!", 1, true);
timer = new TimerEx(1, (4 * timersMod), turnEnergyLightsOn);
timer.start();
}
private function msg7():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("that's it! now get into \nthe spaceship!", 1, true);
}
private function msg8():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captaaaain!!!", 1, true, 2.2, 1);
}
private function msg3():void{
spaceship.stopTeleportingSound();
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("oh no!!", 1, false);
timer = new TimerEx(1, (2 * timersMod), msg4);
timer.start();
timer2 = new TimerEx(1, 1, showMeteorPassing);
timer2.start();
activate();
timerCountDown.start();
Gui(root.getDescendantById(Components.GUI)).showCounter();
}
private function msg5():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("but the spaceship won't \nteleport on time!", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg6);
timer.start();
}
private function onExplosionFullCanvas(_arg1:Event):void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).removeCircle();
spaceship.setInvisible();
}
private function onExplosionComplete(_arg1:Event):void{
explosionMc.removeEventListener("complete", onExplosionComplete);
canvas.removeChild(explosionMc);
if (shipBoarded){
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Captain?!?!", 1, false);
timer = new TimerEx(1, 3, msg9);
timer.start();
} else {
gameOver();
};
}
private function killPlayer():void{
Player(root.getDescendantById(Components.PLAYER)).killInFinal();
}
private function msg10():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Yeah!", 1, false);
timer = new TimerEx(1, 1.5, msg11);
timer.start();
}
private function turnEnergyLightsOn():void{
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:10, type:BorderLightsType.ENERGY, time:-1}));
GlobalDispatcher.addEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
}
private function unlocked():void{
if (!GameModeStats(Stats.gameModeStatsArr[GameModes.VERY_HARD]).unlocked){
GameModeStats(Stats.gameModeStatsArr[GameModes.VERY_HARD]).unlocked = true;
GameModeStats(Stats.gameModeStatsArr[GameModes.VERY_HARD]).isNew = true;
Gui(root.getDescendantById(Components.GUI)).showVeryHardUnlockedMsg();
};
}
private function closeGlass():void{
spaceship.closeGlass();
timer = new TimerEx(1, 1.2, playerWink);
timer.start();
Gui(root.getDescendantById(Components.GUI)).hideCounter();
}
private function gameOver():void{
Game(root.getDescendantById(Components.GAME)).gameOver();
}
private function msg9():void{
gameCompleted.addEventListener("end", onGameCompletedEnd);
addChild(gameCompleted);
timer = new TimerEx(1, 0.7, msg10);
timer.start();
timer2 = new TimerEx(1, 1.5, unlocked);
timer2.start();
SoundManager.getInstance().playSound("congratulations", SoundGroups.GAME_MUSIC);
}
private function showMeteorPassing():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).giantMeteorPassBack();
}
override protected function onPaused():void{
if (timer){
timer.pause();
};
if (timer2){
timer2.pause();
};
timerCountDown.pause();
}
private function msg4b():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("collision is imminent!!", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg5);
timer.start();
}
private function msg1aa():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("almost as powerful as a space hero!", false);
timer = new TimerEx(1, (3.5 * timersMod), msg1b);
timer.start();
}
private function onMeteorCollided(_arg1:Event):void{
RedScreen(root.getDescendantById(Components.RED_SCREEN)).stop();
explosionMc.addEventListener("fullExplosion", onExplosionFullCanvas);
explosionMc.addEventListener("complete", onExplosionComplete);
explosionMc.gotoAndPlay(1);
if (playerDiedAtEnd){
canvas.addChild(explosionMc);
} else {
canvas.addChildAt(explosionMc, 0);
};
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).vibrateCircle();
if (!shipBoarded){
timer = new TimerEx(1, 0.6, killPlayer);
timer.start();
} else {
spaceship.vibrate();
};
spaceship.stop();
removeChild(giantMeteorAnim);
Gui(root.getDescendantById(Components.GUI)).hideCounter();
}
override protected function onResumed():void{
if (timer){
timer.resume();
};
if (timer2){
timer2.resume();
};
timerCountDown.resume();
}
}
}//package _screens._final
Section 90
//FinalScreenVeryHard (_screens._final.FinalScreenVeryHard)
package _screens._final {
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._sound.*;
import _game._world._meteors.*;
import _game._stats.*;
import flash.net.*;
import assets.*;
import _game._world._borderLights.*;
import framework._utils._timer.*;
import _game._world._player.*;
import gs.*;
import _backgrounds.*;
import _game._gui.*;
import _components.*;
import _sound.*;
import _game.*;
import _events.*;
import _game._world.*;
public class FinalScreenVeryHard extends Screen {
private var explosionMc:GiantMeteorExplosion;
private var timerCountDown:TimerEx;
private var timer2:TimerEx;
private var playerFinal:PlayerFinal;
private var musicId:int;
private var finalScore:FinalScore;
private var meteorExplosionMc:GiantMeteorExplosion;
private var spaceship:Spaceship;
private var playerGatheredEnergy:Boolean;
private var timer:TimerEx;
private var giantMeteor:GiantMeteor;
private var timersMod:Number;// = 1
private var playerExplosionMc:PlayerExplosionAsset;
private var gameCompleted:GameCompleted;
public function FinalScreenVeryHard(){
giantMeteor = new GiantMeteor();
meteorExplosionMc = new GiantMeteorExplosion();
playerExplosionMc = new PlayerExplosionAsset();
gameCompleted = new GameCompleted();
finalScore = new FinalScore();
playerFinal = new PlayerFinal();
spaceship = new Spaceship();
explosionMc = new GiantMeteorExplosion();
super();
id = Components.FINAL;
}
private function turnLightsOn():void{
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_LIGHTS, {amount:67, type:BorderLightsType.BLUE_ENERGY, time:9999999}));
GlobalDispatcher.addEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER_NOW, {type:MeteorShower.CIRCLE, duration:99999999999999, frequency:5}));
}
private function msg13ca():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Shields will not hold!!", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg13cb);
timer.start();
}
private function startGiantMeteorAlarm():void{
executeTransition("RedScreen");
timer = new TimerEx(1, (2 * timersMod), msg13a);
timer.start();
SoundManager.getInstance().fadeSound(musicId, 1, 0.2, 0);
World(root.getDescendantById(Components.WORLD)).stopMeteorShower();
}
private function msg13cc():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain!", 1, false);
timer = new TimerEx(1, (2.5 * timersMod), msg13cd);
timer.start();
}
private function msg13f():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Yeah!", 1, false);
timer = new TimerEx(1, 1.5, msg13g);
timer.start();
}
private function showDanger():void{
Gui(root.getDescendantById(Components.GUI)).enableFinalDanger();
timer = new TimerEx(1, 0.8, giantMeteorAppear);
timer.start();
}
private function msg16():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Yeah!", 1, false);
timer = new TimerEx(1, 1, msg17);
timer.start();
}
private function startShipTeleport():void{
addChild(spaceship);
spaceship.startTeleport();
timer = new TimerEx(1, (3 * timersMod), littleMeteorsAppear);
timer.start();
}
private function msg13d():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captaaaain!!!", 1, true, 3, 1);
}
private function msg21():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("you... you are alive!!", 1, false);
}
private function unlocked():void{
if (!GameModeStats(Stats.gameModeStatsArr[GameModes.CREDITS]).unlocked){
GameModeStats(Stats.gameModeStatsArr[GameModes.CREDITS]).unlocked = true;
GameModeStats(Stats.gameModeStatsArr[GameModes.CREDITS]).isNew = true;
Gui(root.getDescendantById(Components.GUI)).showCreditsUnlockedMsg();
};
}
private function msg1a():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("you defeated the enemy!!", false);
timer = new TimerEx(1, (3.5 * timersMod), msg1aa);
timer.start();
}
private function msg1b():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("now lets get you out of there.", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg2);
timer.start();
musicId = SoundManager.getInstance().playSound("gameMusic", SoundGroups.GAME_MUSIC, 9999, 0);
SoundManager.getInstance().fadeSound(musicId, 1, 0, 0.4);
}
private function msg13cd():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("please dont die!!", true);
timer = new TimerEx(1, (5 * timersMod), giantMeteorAppears);
timer.start();
}
private function removeGui():void{
Gui(root.getDescendantById(Components.GUI)).removeFinalGuiElements();
}
private function incrementShieldsPower():void{
MeteorsShield(World(root.getDescendantById(Components.WORLD)).getChildById(Components.METEORS_SHIELD)).enablePowerShields();
TweenMax.to(spaceship.canvas, 0.5, {alpha:0});
timer = new TimerEx(1, (2 * timersMod), msg13cc);
timer.start();
SoundManager.getInstance().playSound("meteorsShield2", SoundGroups.GAME_SOUNDS);
}
public function firstMeteorShower():void{
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER_NOW, {type:MeteorShower.CIRCLE, duration:5, frequency:3}));
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("watch out!", 1, false);
timer = new TimerEx(1, (5 * timersMod), msg5);
timer.start();
}
private function vibrateCircle():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).vibrateCircle();
timer = new TimerEx(1, 3, playerExplosion);
timer.start();
}
private function onGameCompletedEnd(_arg1:Event):void{
removeChild(gameCompleted);
gameCompleted.removeEventListener("end", onGameCompletedEnd);
finalScore.addEventListener("end", onFinalScoreEnd);
addChild(finalScore);
var _local2:SharedObject = SharedObject.getLocal("Bobulous");
_local2.data.veryhard = Stats.gameModeStatsArr[GameModes.VERY_HARD];
_local2.data.credits = Stats.gameModeStatsArr[GameModes.CREDITS];
}
private function onGiantMeteorPassed():void{
timer = new TimerEx(1, (2 * timersMod), msg13ca);
timer.start();
}
override protected function onResumed():void{
if (timer){
timer.resume();
};
if (timer2){
timer2.resume();
};
if (timerCountDown){
timerCountDown.resume();
};
}
private function onFinalScoreEnd(_arg1:EventValue):void{
removeChild(finalScore);
if (_arg1.value == false){
executeTransition("WhiteScreenMainMenu");
} else {
executeTransition("HiScores");
};
}
private function msg6b():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("what are we going to do!?", 1, false);
timer = new TimerEx(1, (2 * timersMod), msg6bb);
timer.start();
}
private function msg6c():void{
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER_NOW, {type:MeteorShower.CIRCLE, duration:5, frequency:5}));
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("i got it!!", 1, false);
timer = new TimerEx(1, (5 * timersMod), msg7);
timer.start();
}
private function msg13cb():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("i will try to increase their power!!", 1, false);
timer = new TimerEx(1, (2 * timersMod), incrementShieldsPower);
timer.start();
}
private function victorySound1():void{
SoundManager.getInstance().playSound("lastEvolution", SoundGroups.GAME_MUSIC, 1, 0.8);
timer = new TimerEx(1, (2.5 * timersMod), msg1a);
timer.start();
}
private function onPlayerExplosionComplete(_arg1:Event):void{
playerExplosionMc.removeEventListener("complete", onPlayerExplosionComplete);
canvas.removeChild(playerExplosionMc);
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Captain?!?!", 1, false);
timer = new TimerEx(1, 3, msg20);
timer.start();
}
private function onMeteorInPosition(_arg1:Event):void{
timer = new TimerEx(1, 2, msg18);
timer.start();
}
private function playerExplosion():void{
playerExplosionMc.addEventListener("fullExplosion", onPlayerExplosionFullCanvas);
playerExplosionMc.addEventListener("complete", onPlayerExplosionComplete);
playerExplosionMc.gotoAndPlay(1);
canvas.addChild(playerExplosionMc);
SoundManager.getInstance().playSound("bigMeteorExplosion", SoundGroups.GAME_SOUNDS);
}
private function msg19():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("ahhhhhhhhhhhhhhh!!!", 3, true, 3, 1);
timer = new TimerEx(1, 0.1, vibrateCircle);
timer.start();
}
private function onEnergyGathered(_arg1:EventValue):void{
GlobalDispatcher.removeEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
playerGatheredEnergy = true;
timer2 = new TimerEx(1, 2, msg11);
timer2.start();
MeteorsShield(World(root.getDescendantById(Components.WORLD)).getChildById(Components.METEORS_SHIELD)).enable();
SoundManager.getInstance().playSound("meteorsShield", SoundGroups.GAME_SOUNDS);
}
private function enableMeteors():void{
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER_NOW, {type:MeteorShower.CIRCLE, duration:99999999999999, frequency:5}));
}
private function giantMeteorAppear():void{
addChild(giantMeteor);
if (!playerGatheredEnergy){
GlobalDispatcher.removeEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
Player(root.getDescendantById(Components.PLAYER)).canCollide = false;
Player(root.getDescendantById(Components.PLAYER)).setSlowSpeed();
giantMeteor.addEventListener("collided", onMeteorCollided);
giantMeteor.start();
} else {
giantMeteor.addEventListener("inPosition", onMeteorInPosition);
giantMeteor.startVeryHard();
};
timer = new TimerEx(1, 2, msg14);
timer.start();
}
public function stop():void{
if (timer){
timer.pause();
};
if (timer2){
timer2.pause();
};
timer = null;
timer2 = null;
if (root.getDescendantById(Components.RED_SCREEN)){
RedScreen(root.getDescendantById(Components.RED_SCREEN)).stop();
};
Gui(root.getDescendantById(Components.GUI)).hideCounter();
playerFinal.stop();
Gui(root.getDescendantById(Components.GUI)).removeArrowPointing("spaceship");
Gui(root.getDescendantById(Components.GUI)).removeGetIn();
executeTransition("remove");
spaceship.stop();
GlobalDispatcher.removeEventListener(GameEvents.ENERGY_GATHERED, onEnergyGathered);
}
private function startShipTeleport2():void{
Gui(root.getDescendantById(Components.GUI)).removeFinalGuiElements();
addChild(spaceship);
spaceship.startTeleport();
spaceship.canvas.alpha = 0.25;
timer = new TimerEx(1, (5 * timersMod), startGiantMeteorAlarm);
timer.start();
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("I just want to say that i am \ntruly grateful for...!", 1, false);
}
private function secondMeteorShower():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("watch out!", 1, false);
GlobalDispatcher.dispatchEvent(new EventValue(GameEvents.ENABLE_METEOR_SHOWER_NOW, {type:MeteorShower.CIRCLE, duration:5, frequency:4}));
timer = new TimerEx(1, (6 * timersMod), msg6b);
timer.start();
}
private function msg18():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("impossible!!", 1, true, 3);
RedScreen(root.getDescendantById(Components.RED_SCREEN)).stop();
timer = new TimerEx(1, 2, msg19);
timer.start();
}
override protected function onInitialize(_arg1:String):void{
Gui(root.getDescendantById(Components.GUI)).removeAvoid();
playerGatheredEnergy = false;
Stats.deadInFinal = false;
deactivate();
timer = new TimerEx(1, (1 * timersMod), msg1);
timer.start();
}
private function msg1():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain bobulous! you did it!", 1, false);
timer = new TimerEx(1, (0.2 * timersMod), victorySound1);
timer.start();
}
private function msg3():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("a meteor shower is approaching!", false);
timer = new TimerEx(1, (4 * timersMod), msg4);
timer.start();
}
private function msg4():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("canceling teleport!", 1, false);
timer = new TimerEx(1, (2.5 * timersMod), msg4a);
timer.start();
spaceship.cancelTeleport();
}
private function msg6():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("what can i do?!", 3, false);
timer = new TimerEx(1, (4 * timersMod), secondMeteorShower);
timer.start();
}
private function msg7():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain!", 1, false);
timer = new TimerEx(1, (1 * timersMod), msg8);
timer.start();
}
private function msg8():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).showMeteorsPassing(MeteorShower.CIRCLE, 15, true);
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("activate the space station shields!", true, 4);
timer = new TimerEx(1, (4 * timersMod), turnLightsOn);
timer.start();
}
private function msg2():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("teleporting spaceship...", 1, true);
timer = new TimerEx(1, (2 * timersMod), startShipTeleport);
timer.start();
}
private function msg6bb():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).showMeteorsPassing(MeteorShower.CIRCLE, 15, true);
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("think janny! think!!", false);
timer = new TimerEx(1, (5.5 * timersMod), msg6c);
timer.start();
}
private function onExplosionFullCanvas(_arg1:Event):void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).removeCircle();
removeChild(giantMeteor);
spaceship.stop();
spaceship.setInvisible();
Game(root.getDescendantById(Components.GAME)).executeTransition("remove");
}
private function msg13a():void{
spaceship.stopTeleportingSound();
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("oh no!!", 1, false);
timer = new TimerEx(1, (2 * timersMod), msg13b);
timer.start();
timer2 = new TimerEx(1, 1, showMeteorPassing);
timer2.start();
}
private function msg13b():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("a giant meteor is approaching!", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg13c);
timer.start();
}
private function msg13c():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("collision is imminent!!", 1, false);
}
private function msg11():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Shields activated!", 1, false, 2, 1);
timer = new TimerEx(1, (3 * timersMod), msg12);
timer.start();
}
private function msg12():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("Now it is safe to send the spaceship.", true, 4);
timer = new TimerEx(1, (7 * timersMod), msg13);
timer.start();
}
private function msg5():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain! the meteor shower will most\nprobably destroy the spaceship!", 1, false);
timer = new TimerEx(1, (5 * timersMod), msg6);
timer.start();
timer2 = new TimerEx(1, (4 * timersMod), showMeteors2);
timer2.start();
}
private function msg13g():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("you are alive!!!", true, 2.5);
}
private function onMeteorExplosionComplete(_arg1:Event):void{
meteorExplosionMc.removeEventListener("complete", onMeteorExplosionComplete);
canvas.removeChild(meteorExplosionMc);
gameOver();
}
private function littleMeteorsAppear():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).showMeteorsPassing(MeteorShower.CIRCLE, 15, true);
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("no!!", 1, false);
timer = new TimerEx(1, (1 * timersMod), msg3);
timer.start();
}
private function onExplosionComplete(_arg1:Event):void{
explosionMc.removeEventListener("complete", onExplosionComplete);
canvas.removeChild(explosionMc);
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("Captain?!?!", 1, false);
timer = new TimerEx(1, 3, msg13e);
timer.start();
}
private function showMeteors2():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).showMeteorsPassing(MeteorShower.CIRCLE, 15, true);
}
private function msg13e():void{
gameCompleted.addEventListener("end", onGameCompletedEnd);
addChild(gameCompleted);
timer = new TimerEx(1, 0.7, msg13f);
timer.start();
timer2 = new TimerEx(1, 1.5, unlocked);
timer2.start();
SoundManager.getInstance().playSound("congratulations", SoundGroups.GAME_MUSIC);
}
private function msg14():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captaaaain!!!", 1, true, 3, 1);
}
private function msg15():void{
gameCompleted.addEventListener("end", onGameCompletedEnd);
addChild(gameCompleted);
timer = new TimerEx(1, 0.7, msg16);
timer.start();
timer2 = new TimerEx(1, 1.5, unlocked);
timer2.start();
SoundManager.getInstance().playSound("congratulations", SoundGroups.GAME_MUSIC);
}
private function giantMeteorAppears():void{
addChild(giantMeteor);
giantMeteor.addEventListener("collided", onMeteorCollided);
giantMeteor.start();
timer = new TimerEx(1, 1, msg13d);
timer.start();
}
private function msg4a():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("what is going on?!", 3, false);
timer = new TimerEx(1, (1.5 * timersMod), firstMeteorShower);
timer.start();
}
private function showMeteorPassing():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).giantMeteorPassBack(onGiantMeteorPassed);
}
private function msg1aa():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("i have always knew you would!!", 1, false);
timer = new TimerEx(1, (4 * timersMod), msg1b);
timer.start();
}
private function onMeteorCollided(_arg1:Event):void{
RedScreen(root.getDescendantById(Components.RED_SCREEN)).stop();
explosionMc.addEventListener("fullExplosion", onExplosionFullCanvas);
explosionMc.addEventListener("complete", onExplosionComplete);
explosionMc.gotoAndPlay(1);
canvas.addChild(explosionMc);
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).vibrateCircle();
}
override protected function onPaused():void{
if (timer){
timer.pause();
};
if (timer2){
timer2.pause();
};
if (timerCountDown){
timerCountDown.pause();
};
}
private function gameOver():void{
Game(root.getDescendantById(Components.GAME)).gameOver();
}
private function msg17():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).appendToDialog("you are alive!!!", true, 2.5);
}
private function killPlayer():void{
Player(root.getDescendantById(Components.PLAYER)).killInFinal();
}
private function msg13():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("teleporting spaceship...", 1, true);
timer = new TimerEx(1, (3 * timersMod), startShipTeleport2);
timer.start();
FinalStats.getInstance().saveGameTime();
}
private function onPlayerExplosionFullCanvas(_arg1:Event):void{
playerExplosionMc.removeEventListener("complete", onPlayerExplosionComplete);
executeTransition("removeBlueEnergyContainer");
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).removeCircle();
removeChild(giantMeteor);
playerFinal.setInvisible();
Gui(root.getDescendantById(Components.GUI)).hideCounter();
}
private function msg20():void{
Dialogs(root.getDescendantById(Components.DIALOGS)).showDialog("captain bobulous... \nyou will be always remembered...", 1, false);
gameCompleted.addEventListener("end", onGameCompletedEnd);
addChild(gameCompleted);
timer = new TimerEx(1, 0.7, msg21);
timer.start();
timer2 = new TimerEx(1, 1.5, unlocked);
timer2.start();
SoundManager.getInstance().playSound("congratulations", SoundGroups.GAME_MUSIC);
}
}
}//package _screens._final
Section 91
//GameCompleted (_screens._final.GameCompleted)
package _screens._final {
import flash.events.*;
import framework._component.*;
import framework._sound.*;
import assets.*;
import framework._utils._timer.*;
import _components.*;
import _sound.*;
public class GameCompleted extends WorldObject {
public var mc:GameCompletedAsset;
public function GameCompleted(){
mc = new GameCompletedAsset();
super();
id = Components.GAME_COMPLETED;
canvas.addChild(mc);
}
override protected function onAdded():void{
mc.addEventListener("entered", onEntered);
SoundManager.getInstance().playSound("spaceship_whoosh", SoundGroups.GAME_SOUNDS);
mc.addEventListener("spaceship_whoosh", onSpaceshipWhoosh);
TimerEx.start(1, 0.1, onTimerEnter);
}
private function onTimerEnter():void{
mc.gotoAndPlay("enter");
}
private function onEntered(_arg1:Event):void{
mc.removeEventListener("entered", onEntered);
TimerEx.start(1, 2, onTimer);
}
private function onSpaceshipWhoosh(_arg1:Event):void{
SoundManager.getInstance().playSound("spaceship_whoosh", SoundGroups.GAME_SOUNDS);
}
private function onExited(_arg1:Event):void{
mc.removeEventListener("exited", onExited);
dispatchEvent(new Event("end"));
mc.removeEventListener("spaceship_whoosh", onSpaceshipWhoosh);
}
private function onTimer():void{
mc.addEventListener("exited", onExited);
mc.gotoAndPlay("exit");
}
}
}//package _screens._final
Section 92
//GiantMeteor (_screens._final.GiantMeteor)
package _screens._final {
import flash.display.*;
import flash.events.*;
import framework._component.*;
import framework._sound.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import flash.filters.*;
import assets.*;
import framework._utils._timer.*;
import org.flintparticles.twoD.emitters.*;
import gs.*;
import org.flintparticles.twoD.renderers.*;
import _components.*;
import _sound.*;
import gs.easing.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class GiantMeteor extends WorldObject {
private var shadow:Shape;
private var renderer:PixelRenderer;
private var emitter:Emitter2D;
private var tweenPosition:TweenMax;
private var mc:GiantMeteorAsset;
public function GiantMeteor(){
mc = new GiantMeteorAsset();
emitter = new Emitter2D();
shadow = new Shape();
super();
id = Components.GIANT_METEOR;
emitter.counter = new Steady(700);
emitter.addInitializer(new ColorInit(4294940928, 4294967040));
emitter.addInitializer(new Position(new DiscZone(new Point(0, 0), 65)));
emitter.addInitializer(new Lifetime(0.8, 1.2));
emitter.addAction(new Move());
emitter.addAction(new Age());
emitter.addAction(new Accelerate(300, -250));
emitter.addAction(new GravityWell(50, 30, -25));
renderer = new PixelRenderer(new Rectangle(-100, -300, 400, 400));
renderer.addFilter(new BlurFilter(10, 10, 1));
renderer.addFilter(new ColorMatrixFilter([0.99, 0, 0, 0, 0, 0, 0.99, 0, 0, 0, 0, 0, 0.95, 0, 0, 0, 0, 0, 0.995, 0]));
renderer.addEmitter(emitter);
canvas.addChild(shadow);
canvas.addChild(mc);
canvas.addChild(renderer);
position.x = 750;
position.y = 50;
shadow.graphics.beginFill(0);
shadow.graphics.drawCircle(0, 0, 60);
shadow.graphics.endFill();
shadow.alpha = 0;
shadow.scaleX = (shadow.scaleY = 0);
shadow.visible = true;
}
public function start():void{
position.x = 750;
position.y = 50;
draw();
emitter.start();
tweenPosition = new TweenMax(position, 3.4, {x:296, y:296, onUpdate:updateShadow, onComplete:onTweenComplete, ease:Linear.easeOut});
TimerEx.start(1, 1.4, fallingSound);
}
private function onTweenComplete():void{
SoundManager.getInstance().playSound("bigMeteorExplosion", SoundGroups.GAME_SOUNDS);
emitter.stop();
dispatchEvent(new Event("collided"));
}
private function updateShadow():void{
shadow.y = (296 - position.y);
shadow.alpha = (tweenPosition.progress * 0.25);
shadow.scaleX = (shadow.scaleY = tweenPosition.progress);
}
public function startVeryHard():void{
position.x = 750;
position.y = 50;
draw();
emitter.start();
tweenPosition = new TweenMax(position, 3.25, {x:356, y:236, onUpdate:updateShadow, onComplete:onTweenVeryHardComplete, ease:Linear.easeOut});
TimerEx.start(1, 1.4, fallingSound);
}
private function onTweenVeryHardComplete():void{
dispatchEvent(new Event("inPosition"));
}
private function fallingSound():void{
SoundManager.getInstance().playSound("giant_meteor_falling", SoundGroups.GAME_SOUNDS);
}
}
}//package _screens._final
Section 93
//GiantMeteorAnim (_screens._final.GiantMeteorAnim)
package _screens._final {
import flash.events.*;
import framework._component.*;
import framework._sound.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import flash.filters.*;
import assets.*;
import org.flintparticles.twoD.emitters.*;
import org.flintparticles.twoD.renderers.*;
import _sound.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.initializers.*;
public class GiantMeteorAnim extends WorldObject {
private var renderer:PixelRenderer;
public var mc:GiantMeteorAnimAsset;
private var emitter:Emitter2D;
public function GiantMeteorAnim(){
mc = new GiantMeteorAnimAsset();
emitter = new Emitter2D();
super();
emitter.counter = new Steady(700);
emitter.addInitializer(new ColorInit(4294940928, 4294967040));
emitter.addInitializer(new Position(new DiscZone(new Point(0, 0), 65)));
emitter.addInitializer(new Lifetime(0.8, 1.2));
emitter.addAction(new Move());
emitter.addAction(new Age());
emitter.addAction(new Accelerate(300, -250));
emitter.addAction(new GravityWell(50, 30, -25));
renderer = new PixelRenderer(new Rectangle(-100, -300, 400, 400));
renderer.addFilter(new BlurFilter(10, 10, 1));
renderer.addFilter(new ColorMatrixFilter([0.99, 0, 0, 0, 0, 0, 0.99, 0, 0, 0, 0, 0, 0.95, 0, 0, 0, 0, 0, 0.995, 0]));
renderer.addEmitter(emitter);
mc.giantMeteor.addChild(renderer);
canvas.addChild(mc);
}
public function start():void{
emitter.start();
mc.gotoAndPlay("in");
mc.addEventListener("explosion", onExplode);
SoundManager.getInstance().playSound("giant_meteor_falling", SoundGroups.GAME_SOUNDS);
}
private function onExplode(_arg1:Event):void{
dispatchEvent(new Event("collided"));
mc.stop();
SoundManager.getInstance().playSound("bigMeteorExplosion", SoundGroups.GAME_SOUNDS);
}
}
}//package _screens._final
Section 94
//MeteorsShield (_screens._final.MeteorsShield)
package _screens._final {
import framework._component.*;
import assets.*;
import _game._world._circleBounds.*;
import _components.*;
public class MeteorsShield extends WorldObject {
private var meteorsShieldAsset:MeteorsShieldAsset;
public var enabled:Boolean;// = false
public function MeteorsShield(){
id = Components.METEORS_SHIELD;
meteorsShieldAsset = new MeteorsShieldAsset();
meteorsShieldAsset.stop();
canvas.addChild(meteorsShieldAsset);
deactivate();
position.x = CircleBounds.x;
position.y = CircleBounds.y;
draw();
meteorsShieldAsset.bright.stop();
meteorsShieldAsset.visible = false;
}
public function enablePowerShields():void{
meteorsShieldAsset.gotoAndPlay("power");
}
public function enable():void{
meteorsShieldAsset.gotoAndPlay("enable");
enabled = true;
meteorsShieldAsset.visible = true;
meteorsShieldAsset.bright.play();
}
}
}//package _screens._final
Section 95
//PlayerFinal (_screens._final.PlayerFinal)
package _screens._final {
import flash.events.*;
import framework._component.*;
import assets.*;
import _components.*;
public class PlayerFinal extends WorldObject {
private var doTransform:Boolean;// = false
public var mc:PlayerFinalAsset;
public function PlayerFinal(){
mc = new PlayerFinalAsset();
super();
id = Components.PLAYER_FINAL;
canvas.addChild(mc);
mc.addEventListener("transform_loop_end", onTransformLoopEnd);
}
public function transformLoop():void{
mc.gotoAndPlay("transform_loop");
}
public function stop():void{
mc.removeEventListener("transform_loop_end", onTransformLoopEnd);
}
private function onTransformLoopEnd(_arg1:Event):void{
if (doTransform){
mc.gotoAndPlay("transform");
mc.removeEventListener("transform_loop_end", onTransformLoopEnd);
} else {
mc.gotoAndPlay("transform_loop");
};
}
public function closeEyes():void{
mc.gotoAndPlay("close_eyes");
}
public function transform():void{
doTransform = true;
}
public function setInvisible():void{
mc.alpha = 0;
}
}
}//package _screens._final
Section 96
//RedScreen (_screens._final.RedScreen)
package _screens._final {
import framework._flow.*;
import framework._sound.*;
import gs.*;
import _components.*;
import _sound.*;
import gs.easing.*;
public class RedScreen extends Screen {
private var sndId:int;// = -1
private var tween:TweenMax;
public function RedScreen(){
id = Components.RED_SCREEN;
canvas.graphics.beginFill(0xFF0000, 1);
canvas.graphics.drawRect(0, 0, 600, 600);
canvas.graphics.endFill();
}
override protected function onAdded():void{
canvas.alpha = 0;
tween = new TweenMax(canvas, 1, {alpha:0.5, onComplete:startYoyoTween});
sndId = SoundManager.getInstance().playSound("alarm", SoundGroups.GAME_MUSIC, 999999, 0.75);
}
public function stop():void{
tween.pause();
tween = new TweenMax(canvas, canvas.alpha, {alpha:0, onComplete:onAlphaZero});
if (sndId != -1){
SoundManager.getInstance().stopSound(sndId);
};
}
private function onAlphaZero():void{
executeTransition("remove");
}
override protected function onPaused():void{
if (tween){
tween.pause();
};
}
private function startYoyoTween():void{
tween = new TweenMax(canvas, 0.6, {alpha:0.15, yoyo:true, ease:Linear.easeNone});
}
override protected function onResumed():void{
if (tween){
tween.resume();
};
}
}
}//package _screens._final
Section 97
//Spaceship (_screens._final.Spaceship)
package _screens._final {
import flash.events.*;
import framework._component.*;
import framework._sound.*;
import assets.*;
import framework._utils._timer.*;
import gs.*;
import _sound.*;
public class Spaceship extends WorldObject {
public var mc:SpaceshipAsset;
public function Spaceship(){
mc = new SpaceshipAsset();
super();
canvas.addChild(mc);
}
private function startEnginesSound():void{
}
public function stop():void{
mc.removeEventListener("teleport_complete", completeTeleport);
mc.removeEventListener("teleport_loop", onTeleportLoop);
mc.removeEventListener("teleport_loop", onTeleportLoop2);
mc.removeEventListener("giantMeteor", onEnableGiantMeteor);
}
public function playerBoarded():void{
mc.gotoAndStop("player_boarded");
}
public function cancelTeleport():void{
TweenMax.to(mc, 1, {alpha:0, blurFilter:{blurX:40, blurY:40}});
mc.removeEventListener("teleport_loop", onTeleportLoop);
}
public function completeTeleport(_arg1:Function):void{
mc.addEventListener("teleport_complete", _arg1);
mc.gotoAndPlay("teleportation_complete");
SoundManager.getInstance().playSound("teleport_complete", SoundGroups.GAME_SOUNDS);
}
private function onEnableGiantMeteor(_arg1:Event):void{
mc.removeEventListener("giantMeteor", onEnableGiantMeteor);
dispatchEvent(new Event("enableGiantMeteor"));
}
private function onTeleportLoop2(_arg1:Event):void{
SoundManager.getInstance().playSound("teletransporting", SoundGroups.GAME_SOUNDS, 1, 0.35);
}
public function startTeleport():void{
mc.alpha = 1;
mc.filters = [];
mc.addEventListener("teleport_loop", onTeleportLoop);
mc.gotoAndPlay("teleporting");
SoundManager.getInstance().playSound("teletransporting", SoundGroups.GAME_SOUNDS, 1, 0.5);
}
private function onTeleportLoop(_arg1:Event):void{
SoundManager.getInstance().playSound("teletransporting", SoundGroups.GAME_SOUNDS, 1, 0.5);
}
public function startEngines():void{
mc.gotoAndPlay("start_engines");
SoundManager.getInstance().playSound("spaceship_takeoff", SoundGroups.GAME_SOUNDS);
mc.addEventListener("turbines", turbines);
mc.addEventListener("giantMeteor", onEnableGiantMeteor);
}
public function playerWink():void{
mc.ship.player.gotoAndPlay("wink_right");
}
private function turbines(_arg1:Event):void{
mc.removeEventListener("turbines", turbines);
SoundManager.getInstance().playSound("start_turbines", SoundGroups.GAME_SOUNDS);
}
public function setInvisible():void{
mc.alpha = 0;
}
public function stopTeleportingSound():void{
mc.removeEventListener("teleport_loop", onTeleportLoop);
mc.addEventListener("teleport_loop", onTeleportLoop2);
}
public function closeGlass():void{
mc.ship.gotoAndPlay("glass");
SoundManager.getInstance().playSound("glass", SoundGroups.GAME_SOUNDS);
TimerEx.start(1, 0.8, startEnginesSound);
}
public function vibrate():void{
mc.ship.gotoAndPlay("vibrate");
}
}
}//package _screens._final
Section 98
//CreditsInGameScreen (_screens.CreditsInGameScreen)
package _screens {
import framework._flow.*;
import assets.*;
import framework._utils._timer.*;
import gs.*;
import _components.*;
public class CreditsInGameScreen extends Screen {
private var timer:TimerEx;
private var tween:TweenMax;
private var mc:CreditsScreenAsset;
private var timerDelay:TimerEx;
public function CreditsInGameScreen(){
timer = new TimerEx(1, 3.5, onTimer);
timerDelay = new TimerEx(1, 2, onTimerDelay);
mc = new CreditsScreenAsset();
super();
id = Components.CREDITS_IN_GAME;
mc.alpha = 0;
canvas.addChild(mc);
}
private function fadeIn():void{
tween = new TweenMax(mc, 1, {alpha:1, onComplete:onFadedIn});
}
private function onTimerDelay():void{
fadeIn();
}
private function onTimer():void{
tween = new TweenMax(mc, 1, {alpha:0, onComplete:onFadedOut});
}
override protected function onPaused():void{
if (tween){
tween.pause();
};
timer.pause();
timerDelay.pause();
}
private function onFadedIn():void{
timer.start();
}
override protected function onInitialize(_arg1:String):void{
mc.gotoAndStop(1);
timer.setTimeAmount(5);
timerDelay.setTimeAmount(4);
timerDelay.start();
}
public function showThanksForPlaying():void{
mc.gotoAndStop(mc.totalFrames);
timer.setTimeAmount(5);
fadeIn();
}
private function onFadedOut():void{
if (mc.currentFrame < (mc.totalFrames - 1)){
timerDelay.setTimeAmount(2);
timerDelay.start();
timer.setTimeAmount(3.5);
mc.nextFrame();
};
}
override protected function onExit(_arg1:String):void{
mc.alpha = 0;
if (tween){
tween.pause();
};
tween = null;
timer.stop();
timerDelay.stop();
}
override protected function onResumed():void{
if (tween){
tween.resume();
};
timer.resume();
timerDelay.resume();
}
}
}//package _screens
Section 99
//CreditsScreen (_screens.CreditsScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import assets.*;
import _components.*;
import _sound.*;
public class CreditsScreen extends Screen {
public var mc:CreditsAsset;
public function CreditsScreen(){
mc = new CreditsAsset();
super();
id = Components.CREDITS;
canvas.addChild(mc);
registerMovieClipAsButton(mc.back_btn);
}
override protected function onButtonRollOut(_arg1:MouseEvent):void{
_arg1.target.gotoAndPlay("out");
}
override protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
_arg1.target.gotoAndPlay("over");
}
override protected function onButtonClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
executeTransition("MainMenu");
}
}
}//package _screens
Section 100
//g5glogoScreen (_screens.g5glogoScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import flash.net.*;
import assets.*;
import _components.*;
public class g5glogoScreen extends Screen {
public var mc:g5glogoScreenAsset;
public function g5glogoScreen(){
mc = new g5glogoScreenAsset();
super();
id = Components.G5GLOGO;
canvas.addChild(mc);
mc.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gimme5games.com/?ref=bobulous_TITLE"));
}
}
}//package _screens
Section 101
//GameOverScreen (_screens.GameOverScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import flash.net.*;
import assets.*;
import framework._utils._timer.*;
import _components.*;
import _sound.*;
import flash.text.*;
public class GameOverScreen extends Screen {
public var mc:GameOverAsset;
public function GameOverScreen(){
mc = new GameOverAsset();
super();
id = Components.GAME_OVER;
var _local1:TextField = mc.score.score_tf;
_local1.embedFonts = true;
_local1.defaultTextFormat = new TextFormat("ScienceProject", 68);
canvas.addChild(mc);
registerMovieClipAsButton(mc.tryAgain_btn);
registerMovieClipAsButton(mc.submit_btn);
registerMovieClipAsButton(mc.quit_btn);
mc.g5g_btn.addEventListener(MouseEvent.CLICK, ong5glogoClick);
}
override protected function onButtonRollOut(_arg1:MouseEvent):void{
_arg1.target.gotoAndPlay("out");
}
override protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
_arg1.target.gotoAndPlay("over");
}
private function onTimer():void{
SoundManager.getInstance().playSound("game_over", SoundGroups.SPLASH_MUSIC);
}
override protected function onButtonClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
if (_arg1.target == mc.tryAgain_btn){
if (Stats.deadInFinal){
Stats.deadInFinal = false;
executeTransition("WhiteScreenStartGameIntro");
} else {
executeTransition("StartGameIntro");
};
Stats.reTry = true;
} else {
if (_arg1.target == mc.submit_btn){
executeTransition("SubmitScore");
} else {
if (_arg1.target == mc.quit_btn){
if (Stats.deadInFinal){
Stats.deadInFinal = false;
executeTransition("WhiteScreenMainMenu");
} else {
if (Stats.getLastModeUnlocked() != Stats.gameMode){
executeTransition("WhiteScreenGameOver");
} else {
executeTransition("MainMenu");
};
};
};
};
};
}
override protected function onEnter(_arg1:Screen):void{
var _local2:FinalStats;
_local2 = FinalStats.getInstance();
_local2.livesAmount = Stats.lives;
_local2.score = Stats.score;
_local2.finalScore = 0;
switch (Stats.gameMode){
case GameModes.NORMAL:
if (_local2.gameTime <= 185000){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.gameTime <= 195000){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.gameTime <= 205000){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
_local2.lightsTotal = 5;
if (_local2.lightsCaught == 5){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.lightsCaught == 4){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.lightsCaught == 3){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
_local2.livesTotal = 5;
if (_local2.livesAmount >= 5){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.livesAmount == 4){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.livesAmount == 3){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
break;
case GameModes.HARD:
if (_local2.gameTime <= 318000){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.gameTime <= 325000){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.gameTime <= 340000){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
_local2.lightsTotal = 7;
if (_local2.lightsCaught == 7){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.lightsCaught == 6){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.lightsCaught >= 4){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
_local2.livesTotal = 5;
if (_local2.livesAmount >= 5){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.livesAmount == 4){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.livesAmount == 3){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
break;
case GameModes.VERY_HARD:
if (_local2.gameTime <= 395000){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.gameTime <= 400000){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.gameTime <= 410000){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
_local2.lightsTotal = 9;
if (_local2.lightsCaught == 9){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.lightsCaught >= 7){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.lightsCaught >= 5){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
_local2.livesTotal = 3;
if (_local2.livesAmount >= 3){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.livesAmount == 2){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
break;
case GameModes.CREDITS:
_local2.finalScore = (_local2.finalScore + 1);
_local2.lightsTotal = 5;
if (_local2.lightsCaught == 5){
_local2.finalScore = (_local2.finalScore + 1);
} else {
if (_local2.lightsCaught == 4){
_local2.finalScore = (_local2.finalScore + 0.75);
} else {
if (_local2.lightsCaught == 3){
_local2.finalScore = (_local2.finalScore + 0.5);
};
};
};
_local2.livesTotal = 1;
_local2.finalScore = (_local2.finalScore + 1);
break;
};
var _local3:GameModeStats = Stats.gameModeStatsArr[Stats.gameMode];
if (_local2.score > _local3.score){
_local3.score = _local2.score;
mc.you_scored.visible = false;
mc.new_highscore.visible = true;
} else {
mc.you_scored.visible = true;
mc.new_highscore.visible = false;
};
if (_local2.finalScore > _local3.finalScore){
_local3.gameTime = _local2.gameTime;
_local3.lightsCaught = _local2.lightsCaught;
_local3.lightsTotal = _local2.lightsTotal;
_local3.livesAmount = _local2.livesAmount;
_local3.livesTotal = _local2.livesTotal;
_local3.medal = _local2.medal;
_local3.finalScore = _local2.finalScore;
} else {
if (_local2.finalScore == _local3.finalScore){
if ((((((_local2.gameTime >= _local3.gameTime)) && ((_local2.lightsCaught >= _local3.lightsCaught)))) && ((_local2.livesAmount >= _local3.livesAmount)))){
_local3.gameTime = _local2.gameTime;
_local3.lightsCaught = _local2.lightsCaught;
_local3.lightsTotal = _local2.lightsTotal;
_local3.livesAmount = _local2.livesAmount;
_local3.livesTotal = _local2.livesTotal;
_local3.medal = _local2.medal;
_local3.finalScore = _local2.finalScore;
};
};
};
mc.score.visible = true;
mc.score.score_tf.text = Stats.score.toString();
mc.comment1.visible = false;
mc.comment1.gotoAndStop(int(((Math.random() * 4) + 1)));
var _local4:TimerEx = new TimerEx(1, 1, onTimer);
_local4.start();
Stats.gameTracker.customMsg("alert", Stats.score, Stats.getGameMode(), "Game over");
Stats.gameTracker.endLevel();
var _local5:SharedObject = SharedObject.getLocal("Bobulous");
switch (Stats.gameMode){
case GameModes.NORMAL:
_local5.data.normal = Stats.gameModeStatsArr[Stats.gameMode];
break;
case GameModes.HARD:
_local5.data.hard = Stats.gameModeStatsArr[Stats.gameMode];
break;
case GameModes.VERY_HARD:
_local5.data.veryhard = Stats.gameModeStatsArr[Stats.gameMode];
break;
case GameModes.CREDITS:
_local5.data.credits = Stats.gameModeStatsArr[Stats.gameMode];
break;
};
if (Stats.gameMode == GameModes.NORMAL){
Stats.submitKongStat("ScoreLevel1", Stats.score);
Stats.submitKongStat("TimeLevel1", int((_local2.gameTime / 1000)));
} else {
if (Stats.gameMode == GameModes.HARD){
Stats.submitKongStat("ScoreLevel2", Stats.score);
Stats.submitKongStat("TimeLevel2", int((_local2.gameTime / 1000)));
} else {
if (Stats.gameMode == GameModes.VERY_HARD){
Stats.submitKongStat("ScoreLevel3", Stats.score);
Stats.submitKongStat("TimeLevel3", int((_local2.gameTime / 1000)));
} else {
Stats.submitKongStat("ScoreLevel4", Stats.score);
Stats.submitKongStat("TimeLevel4", int((_local2.gameTime / 1000)));
};
};
};
Stats.submitKongStat("EnemiesKilled", Stats.enemiesKilled);
}
private function ong5glogoClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.gimme5games.com/?ref=bobulous_GAMEOVER"));
}
}
}//package _screens
Section 102
//HighscoresScreen (_screens.HighscoresScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import assets.*;
import _components.*;
public class HighscoresScreen extends Screen {
public var mc:HighscoresAsset;
public function HighscoresScreen(){
mc = new HighscoresAsset();
super();
id = Components.HIGHSCORES;
canvas.addChild(mc);
mc.container.close_btn.addEventListener(MouseEvent.CLICK, onCloseBtnClick);
}
private function onCloseBtnClick(_arg1:MouseEvent):void{
executeTransition("exit");
}
}
}//package _screens
Section 103
//HiScoresGameoverScreen (_screens.HiScoresGameoverScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import assets.*;
import _sound.*;
public class HiScoresGameoverScreen extends Screen {
public var hiScores:ZattikkaHiScores;
public var mc:SubmitScoreScreenGameover;
public function HiScoresGameoverScreen(){
mc = new SubmitScoreScreenGameover();
super();
canvas.addChild(mc);
registerMovieClipAsButton(mc.tryAgain_btn);
registerMovieClipAsButton(mc.quit_btn);
}
override protected function onButtonRollOut(_arg1:MouseEvent):void{
_arg1.target.gotoAndPlay("out");
}
override protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
_arg1.target.gotoAndPlay("over");
}
override protected function onButtonClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
if (_arg1.target == mc.tryAgain_btn){
if (Stats.deadInFinal){
Stats.deadInFinal = false;
executeTransition("WhiteScreenStartGameIntro");
} else {
executeTransition("StartGameIntro");
};
Stats.reTry = true;
} else {
if (_arg1.target == mc.quit_btn){
mc.removeChild(hiScores);
executeTransition("WhiteScreenMainMenu");
if (Stats.deadInFinal){
Stats.deadInFinal = false;
executeTransition("WhiteScreenMainMenu");
} else {
if (Stats.getLastModeUnlocked() != Stats.gameMode){
executeTransition("WhiteScreenGameOver");
} else {
executeTransition("MainMenu");
};
};
};
};
}
override protected function onEnter(_arg1:Screen):void{
hiScores = new ZattikkaHiScores();
hiScores.x = (300 - (hiScores.width / 2));
hiScores.y = (300 - (hiScores.height / 2));
mc.addChild(hiScores);
hiScores.setDetails(251, Stats.gameMode, "bobulous", "q9tzNyNzeYikvuj", false, Stats.score, Stats.score.toString(), "points!");
}
}
}//package _screens
Section 104
//HiScoresScreen (_screens.HiScoresScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import assets.*;
import _sound.*;
public class HiScoresScreen extends Screen {
public var hiScores:ZattikkaHiScores;
public var mc:SubmitScoreScreen;
public function HiScoresScreen(){
mc = new SubmitScoreScreen();
super();
canvas.addChild(mc);
}
override protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
}
override protected function onEnter(_arg1:Screen):void{
hiScores = new ZattikkaHiScores();
hiScores.x = (300 - (hiScores.width / 2));
hiScores.y = (326 - (hiScores.height / 2));
mc.addChild(hiScores);
hiScores.setDetails(251, Stats.gameMode, "bobulous", "q9tzNyNzeYikvuj", false, Stats.score, Stats.score.toString(), "points!");
}
private function onMainMenuBtnClick(_arg1:MouseEvent):void{
mc.main_menu_btn.removeEventListener(MouseEvent.ROLL_OVER, onButtonRollOver);
mc.main_menu_btn.removeEventListener(MouseEvent.CLICK, onMainMenuBtnClick);
mc.removeChild(hiScores);
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
executeTransition("WhiteScreenMainMenu");
}
override protected function onInitialize(_arg1:String):void{
mc.main_menu_btn.addEventListener(MouseEvent.CLICK, onMainMenuBtnClick);
mc.main_menu_btn.addEventListener(MouseEvent.ROLL_OVER, onButtonRollOver);
}
}
}//package _screens
Section 105
//HowToPlayScreen (_screens.HowToPlayScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import assets.*;
import framework._utils._timer.*;
import _components.*;
import _sound.*;
public class HowToPlayScreen extends Screen {
private var timer:TimerEx;
private var animComplete:Boolean;
public var mc:HowToPlayAsset;
public function HowToPlayScreen(){
mc = new HowToPlayAsset();
super();
id = Components.HOW_TO_PLAY;
canvas.addChild(mc);
registerMovieClipAsButton(mc.back_btn);
mc.container.back_btn.addEventListener(MouseEvent.CLICK, onBackBtnClick);
mc.container.next_btn.addEventListener(MouseEvent.CLICK, onNextBtnClick);
}
override protected function onButtonRollOut(_arg1:MouseEvent):void{
_arg1.target.gotoAndPlay("out");
}
override protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
_arg1.target.gotoAndPlay("over");
}
private function onAnimEnd(_arg1:Event):void{
animComplete = true;
mc.container.back_btn.alpha = 0.6;
mc.container.next_btn.alpha = 1;
mc.container.next_btn.mouseEnabled = true;
}
private function onBackBtnClick(_arg1:MouseEvent):void{
if (!animComplete){
return;
};
if (mc.container.currentFrame == 45){
mc.container.back_btn.alpha = 0.6;
mc.container.back_btn.mouseEnabled = false;
} else {
if (mc.container.currentFrame == mc.container.totalFrames){
mc.container.next_btn.alpha = 1;
mc.container.next_btn.mouseEnabled = true;
};
};
mc.container.prevFrame();
}
override protected function onButtonClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
executeTransition("MainMenu");
}
override protected function onEnter(_arg1:Screen):void{
animComplete = false;
mc.container.addEventListener("animEnd", onAnimEnd);
mc.container.gotoAndPlay(2);
mc.container.back_btn.alpha = 0;
mc.container.back_btn.mouseEnabled = false;
mc.container.next_btn.alpha = 0;
}
private function onNextBtnClick(_arg1:MouseEvent):void{
if (!animComplete){
return;
};
if (mc.container.currentFrame == 44){
mc.container.back_btn.alpha = 1;
mc.container.back_btn.mouseEnabled = true;
} else {
if (mc.container.currentFrame == (mc.container.totalFrames - 1)){
mc.container.next_btn.alpha = 0.6;
mc.container.next_btn.mouseEnabled = false;
};
};
mc.container.nextFrame();
}
}
}//package _screens
Section 106
//MainMenuScreen (_screens.MainMenuScreen)
package _screens {
import flash.display.*;
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import flash.net.*;
import assets.*;
import _backgrounds.*;
import _components.*;
import _sound.*;
public class MainMenuScreen extends Screen {
public var mc:MainMenuAsset;
public function MainMenuScreen(){
mc = new MainMenuAsset();
super();
id = Components.MAIN_MENU;
canvas.addChild(mc);
registerMovieClipAsButton(mc.play_btn);
registerMovieClipAsButton(mc.howtoplay_btn);
registerMovieClipAsButton(mc.options_btn);
mc.jay_btn.addEventListener(MouseEvent.CLICK, onJayBtnClick);
mc.jay_btn.buttonMode = true;
mc.credits_btn.visible = false;
}
override protected function onButtonRollOut(_arg1:MouseEvent):void{
MovieClip(_arg1.target).gotoAndPlay("out");
}
override protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
MovieClip(_arg1.target).gotoAndPlay("over");
}
override protected function onButtonClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
if (_arg1.target == mc.play_btn){
executeTransition("SelectMode");
} else {
if (_arg1.target == mc.howtoplay_btn){
executeTransition("HowToPlay");
} else {
if (_arg1.target == mc.credits_btn){
executeTransition("Credits");
} else {
if (_arg1.target == mc.options_btn){
executeTransition("Options");
};
};
};
};
canvas.stage.focus = null;
}
override protected function onEnter(_arg1:Screen):void{
var _local2:int = SoundManager.getInstance().getSoundIdByName("splashMusic", SoundGroups.SPLASH_MUSIC);
if (!SoundManager.getInstance().getSoundIsPlaying(_local2)){
SoundManager.getInstance().playSound("splashMusic", SoundGroups.SPLASH_MUSIC, 999999);
};
if ((((_arg1.id == Components.GAME_OVER)) || ((_arg1.id == Components.WHITE_SCREEN)))){
executeTransition("addTitle");
executeTransition("addg5glogo");
};
mc.level_unlocked.visible = false;
if (((((Stats.gameModeStatsArr[GameModes.HARD].isNew) || (Stats.gameModeStatsArr[GameModes.VERY_HARD].isNew))) || (Stats.gameModeStatsArr[GameModes.CREDITS].isNew))){
mc.level_unlocked.visible = true;
};
if (Stats.gameModeStatsArr[GameModes.CREDITS].medal != 0){
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).enableFireworks();
};
Stats.gameMode = Stats.getLastModeUnlocked();
}
private function onJayBtnClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.jayisgames.com"));
}
}
}//package _screens
Section 107
//OptionsScreen (_screens.OptionsScreen)
package _screens {
import flash.display.*;
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import assets.*;
import _components.*;
import _sound.*;
public class OptionsScreen extends Screen {
private var movingSoundSlider:Boolean;// = false
private var movingZoomSlider:Boolean;// = false
private var movingMusicSlider:Boolean;// = false
public var mc:OptionsAsset;
public function OptionsScreen(){
mc = new OptionsAsset();
super();
id = Components.OPTIONS;
canvas.addChild(mc);
mc.container.sound_slider.addEventListener(MouseEvent.MOUSE_DOWN, onSoundSliderMouseDown);
mc.container.music_slider.addEventListener(MouseEvent.MOUSE_DOWN, onMusicSliderMouseDown);
mc.container.zoom5.addEventListener(MouseEvent.MOUSE_DOWN, onZoom5MouseDown);
mc.container.zoom75.addEventListener(MouseEvent.MOUSE_DOWN, onZoom75MouseDown);
mc.container.zoom1.addEventListener(MouseEvent.MOUSE_DOWN, onZoom1MouseDown);
mc.container.mute_sound.addEventListener(MouseEvent.MOUSE_DOWN, onMuteSoundMouseDown);
mc.container.mute_music.addEventListener(MouseEvent.MOUSE_DOWN, onMuteMusicMouseDown);
mc.container.tick_sound.mouseEnabled = false;
mc.container.tick_music.mouseEnabled = false;
mc.container.mouse_btn.addEventListener(MouseEvent.CLICK, onMouseBtnClick);
mc.container.keyboard_btn.addEventListener(MouseEvent.CLICK, onKeyboardBtnClick);
mc.container.controls_info.stop();
registerMovieClipAsButton(mc.back_btn);
}
private function onMusicSliderMouseDown(_arg1:MouseEvent):void{
movingMusicSlider = true;
}
private function onMouseUp(_arg1:MouseEvent):void{
if (movingSoundSlider){
movingSoundSlider = false;
SoundManager.getInstance().playSound("bump_wall", SoundGroups.GAME_SOUNDS);
};
movingMusicSlider = false;
}
override protected function onButtonClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
if (_arg1.target == mc.back_btn){
executeTransition("MainMenu");
};
}
override protected function onButtonRollOut(_arg1:MouseEvent):void{
MovieClip(_arg1.target).gotoAndPlay("out");
}
private function onZoom1MouseDown(_arg1:MouseEvent):void{
Stats.canvasScale = 1;
GlobalDispatcher.dispatchEvent(new EventValue("scaleCanvas", Stats.canvasScale));
}
private function onKeyboardBtnClick(_arg1:MouseEvent):void{
mc.container.mouse_btn.visible = true;
mc.container.keyboard_btn.visible = false;
mc.container.controls_info.gotoAndStop("mouse");
Stats.useMouse = true;
}
override protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
MovieClip(_arg1.target).gotoAndPlay("over");
}
private function onMouseBtnClick(_arg1:MouseEvent):void{
mc.container.mouse_btn.visible = false;
mc.container.keyboard_btn.visible = true;
mc.container.controls_info.gotoAndStop("keyboard");
Stats.useMouse = false;
}
override protected function onExit(_arg1:String):void{
canvas.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
canvas.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
private function onSoundSliderMouseDown(_arg1:MouseEvent):void{
movingSoundSlider = true;
}
private function onZoom75MouseDown(_arg1:MouseEvent):void{
Stats.canvasScale = 0.75;
GlobalDispatcher.dispatchEvent(new EventValue("scaleCanvas", Stats.canvasScale));
}
override protected function onEnter(_arg1:Screen):void{
mc.container.sound_slider.x = (mc.container.sound_line.x + (mc.container.sound_line.width * Stats.soundVolume));
mc.container.music_slider.x = (mc.container.music_line.x + (mc.container.music_line.width * Stats.musicVolume));
canvas.stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
canvas.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
if (Stats.useMouse){
mc.container.mouse_btn.visible = true;
mc.container.keyboard_btn.visible = false;
} else {
mc.container.mouse_btn.visible = false;
mc.container.keyboard_btn.visible = true;
};
}
private function onMuteMusicMouseDown(_arg1:MouseEvent):void{
if (mc.container.tick_music.visible){
mc.container.tick_music.visible = false;
SoundManager.getInstance().setGroupMute(SoundGroups.GAME_MUSIC, true);
SoundManager.getInstance().setGroupMute(SoundGroups.SPLASH_MUSIC, true);
} else {
mc.container.tick_music.visible = true;
SoundManager.getInstance().setGroupMute(SoundGroups.GAME_MUSIC, false);
SoundManager.getInstance().setGroupMute(SoundGroups.SPLASH_MUSIC, false);
};
}
private function onZoom5MouseDown(_arg1:MouseEvent):void{
Stats.canvasScale = 0.5;
GlobalDispatcher.dispatchEvent(new EventValue("scaleCanvas", Stats.canvasScale));
}
private function onMouseMove(_arg1:MouseEvent):void{
if (movingSoundSlider){
mc.container.sound_slider.x = (canvas.mouseX - mc.container.x);
if (mc.container.sound_slider.x < mc.container.sound_line.x){
mc.container.sound_slider.x = mc.container.sound_line.x;
} else {
if (mc.container.sound_slider.x > (mc.container.sound_line.x + mc.container.sound_line.width)){
mc.container.sound_slider.x = (mc.container.sound_line.x + mc.container.sound_line.width);
};
};
Stats.soundVolume = ((mc.container.sound_slider.x - mc.container.sound_line.x) / mc.container.sound_line.width);
SoundManager.getInstance().setGroupVolume(SoundGroups.GAME_SOUNDS, Stats.soundVolume);
SoundManager.getInstance().setGroupVolume(SoundGroups.SPLASH_SOUNDS, Stats.soundVolume);
} else {
if (movingMusicSlider){
mc.container.music_slider.x = (canvas.mouseX - mc.container.x);
if (mc.container.music_slider.x < mc.container.music_line.x){
mc.container.music_slider.x = mc.container.music_line.x;
} else {
if (mc.container.music_slider.x > (mc.container.music_line.x + mc.container.music_line.width)){
mc.container.music_slider.x = (mc.container.music_line.x + mc.container.music_line.width);
};
};
Stats.musicVolume = ((mc.container.music_slider.x - mc.container.music_line.x) / mc.container.music_line.width);
SoundManager.getInstance().setGroupVolume(SoundGroups.GAME_MUSIC, Stats.musicVolume);
SoundManager.getInstance().setGroupVolume(SoundGroups.SPLASH_MUSIC, Stats.musicVolume);
};
};
}
private function onMuteSoundMouseDown(_arg1:MouseEvent):void{
if (mc.container.tick_sound.visible){
mc.container.tick_sound.visible = false;
SoundManager.getInstance().setGroupMute(SoundGroups.GAME_SOUNDS, true);
SoundManager.getInstance().setGroupMute(SoundGroups.SPLASH_SOUNDS, true);
} else {
mc.container.tick_sound.visible = true;
SoundManager.getInstance().setGroupMute(SoundGroups.GAME_SOUNDS, false);
SoundManager.getInstance().setGroupMute(SoundGroups.SPLASH_SOUNDS, false);
};
}
}
}//package _screens
Section 108
//SelectModeScreen (_screens.SelectModeScreen)
package _screens {
import flash.display.*;
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import assets.*;
import gs.*;
import _backgrounds.*;
import _components.*;
import _sound.*;
import flash.text.*;
public class SelectModeScreen extends Screen {
private var tween:TweenMax;
public var mc:SelectModeAsset;
public function SelectModeScreen(){
mc = new SelectModeAsset();
super();
id = Components.SELECT_MODE;
canvas.addChild(mc);
registerMovieClipAsButton(mc.back_btn);
mc.container.normal_btn.addEventListener(MouseEvent.ROLL_OVER, onNormalBtnRollOver);
mc.container.hard_btn.addEventListener(MouseEvent.ROLL_OVER, onHardBtnRollOver);
mc.container.veryhard_btn.addEventListener(MouseEvent.ROLL_OVER, onVeryHardBtnRollOver);
mc.container.credits_btn.addEventListener(MouseEvent.ROLL_OVER, onCreditsBtnRollOut);
mc.container.normal_btn.addEventListener(MouseEvent.ROLL_OUT, onGameModeBtnRollOut);
mc.container.hard_btn.addEventListener(MouseEvent.ROLL_OUT, onGameModeBtnRollOut);
mc.container.veryhard_btn.addEventListener(MouseEvent.ROLL_OUT, onGameModeBtnRollOut);
mc.container.credits_btn.addEventListener(MouseEvent.ROLL_OUT, onGameModeBtnRollOut);
mc.container.normal_btn.addEventListener(MouseEvent.CLICK, onNormalBtnClick);
mc.container.hard_btn.addEventListener(MouseEvent.CLICK, onHardBtnClick);
mc.container.veryhard_btn.addEventListener(MouseEvent.CLICK, onVeryHardBtnClick);
mc.container.credits_btn.addEventListener(MouseEvent.CLICK, onCreditsBtnClick);
var _local1:TextField = mc.container.details.score_tf;
_local1.autoSize = TextFieldAutoSize.CENTER;
_local1.embedFonts = true;
_local1.defaultTextFormat = new TextFormat("ScienceProject", 14);
_local1 = mc.container.details.time_tf;
_local1.autoSize = TextFieldAutoSize.CENTER;
_local1.embedFonts = true;
_local1.defaultTextFormat = new TextFormat("ScienceProject", 14);
_local1 = mc.container.details.lights_amount_tf;
_local1.embedFonts = true;
_local1.defaultTextFormat = new TextFormat("ScienceProject", 14);
_local1 = mc.container.details.lights_total_tf;
_local1.embedFonts = true;
_local1.defaultTextFormat = new TextFormat("ScienceProject", 14);
_local1 = mc.container.details.lives_amount_tf;
_local1.embedFonts = true;
_local1.defaultTextFormat = new TextFormat("ScienceProject", 14);
_local1 = mc.container.details.lives_total_tf;
_local1.embedFonts = true;
_local1.defaultTextFormat = new TextFormat("ScienceProject", 14);
mc.container.medal_normal.visible = false;
mc.container.medal_hard.visible = false;
mc.container.medal_veryhard.visible = false;
mc.container.medal_credits.visible = false;
mc.container.medal_normal.gotoAndStop(1);
mc.container.medal_hard.gotoAndStop(1);
mc.container.medal_veryhard.gotoAndStop(1);
mc.container.medal_credits.gotoAndStop(1);
}
private function onGameModeBtnRollOver(_arg1:int):void{
var _local2:GameModeStats;
var _local4:String;
var _local6:String;
var _local7:int;
var _local8:int;
var _local9:String;
var _local10:int;
var _local11:int;
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
mc.container.details.gotoAndPlay("enter");
switch (_arg1){
case GameModes.NORMAL:
_local2 = Stats.gameModeStatsArr[GameModes.NORMAL];
mc.container.details.lights_total_tf.text = "5";
mc.container.details.lives_total_tf.text = "5";
break;
case GameModes.HARD:
_local2 = Stats.gameModeStatsArr[GameModes.HARD];
mc.container.details.lights_total_tf.text = "7";
mc.container.details.lives_total_tf.text = "5";
break;
case GameModes.VERY_HARD:
_local2 = Stats.gameModeStatsArr[GameModes.VERY_HARD];
mc.container.details.lights_total_tf.text = "9";
mc.container.details.lives_total_tf.text = "3";
break;
case GameModes.CREDITS:
_local2 = Stats.gameModeStatsArr[GameModes.CREDITS];
mc.container.details.lights_total_tf.text = "5";
mc.container.details.lives_total_tf.text = "1";
break;
};
if (Stats.score < 1000000){
_local7 = 1;
_local8 = _local2.score;
_local9 = "000000";
_local10 = _local9.length;
_local11 = 0;
while (_local11 < (_local10 + 1)) {
_local8 = (_local8 * 0.1);
if (_local8 < 1){
break;
} else {
_local7++;
_local9 = _local9.slice(1, _local9.length);
};
_local11++;
};
mc.container.details.score_tf.text = (_local9 + _local2.score.toString());
} else {
mc.container.details.score_tf.text = _local2.score.toString();
};
mc.container.details.lights_amount_tf.text = _local2.lightsCaught.toString();
mc.container.details.lives_amount_tf.text = _local2.livesAmount.toString();
var _local3:int = ((_local2.gameTime * 0.001) % 60);
if (_local3 < 10){
_local4 = ("0" + _local3.toString());
} else {
_local4 = _local3.toString();
};
var _local5:int = ((_local2.gameTime * 0.001) / 60);
_local6 = _local5.toString();
mc.container.details.time_tf.text = ((_local6 + ":") + _local4);
if (tween){
tween.pause();
};
tween = new TweenMax(mc.container.details, 0.4, {alpha:1});
}
private function onGameModeBtnClick2():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).disableFireworks();
SoundManager.getInstance().fadeGroup(SoundGroups.SPLASH_MUSIC, 1, SoundEx.CURRENT_VOLUME, 0, SoundEx.EFFECT_END_STOP);
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
TitleScreen(root.getDescendantById(Components.TITLE)).executeTransition("remove");
g5glogoScreen(root.getDescendantById(Components.G5GLOGO)).executeTransition("remove");
executeTransition("SelectModeWhiteScreen");
}
override protected function onButtonRollOver(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("rollover_button", SoundGroups.SPLASH_SOUNDS);
MovieClip(_arg1.target).gotoAndPlay("over");
}
private function onHardBtnRollOver(_arg1:MouseEvent):void{
onGameModeBtnRollOver(GameModes.HARD);
}
private function onNormalBtnRollOver(_arg1:MouseEvent):void{
onGameModeBtnRollOver(GameModes.NORMAL);
}
private function onGameModeBtnRollOut(_arg1:MouseEvent):void{
mc.container.details.gotoAndPlay("exit");
if (tween){
tween.pause();
};
tween = new TweenMax(mc.container.details, 0.4, {alpha:0});
}
private function onVeryHardBtnClick(_arg1:MouseEvent):void{
if (Stats.gameMode == GameModes.VERY_HARD){
Stats.gameMode = GameModes.VERY_HARD;
onGameModeBtnClick();
} else {
Stats.gameMode = GameModes.VERY_HARD;
onGameModeBtnClick2();
};
}
private function onVeryHardBtnRollOver(_arg1:MouseEvent):void{
onGameModeBtnRollOver(GameModes.VERY_HARD);
}
private function onCreditsBtnClick(_arg1:MouseEvent):void{
if (Stats.gameMode == GameModes.CREDITS){
Stats.gameMode = GameModes.CREDITS;
onGameModeBtnClick();
} else {
Stats.gameMode = GameModes.CREDITS;
onGameModeBtnClick2();
};
}
private function onGameModeBtnClick():void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).disableFireworks();
SoundManager.getInstance().fadeGroup(SoundGroups.SPLASH_MUSIC, 1, SoundEx.CURRENT_VOLUME, 0, SoundEx.EFFECT_END_STOP);
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
TitleScreen(root.getDescendantById(Components.TITLE)).executeTransition("remove");
g5glogoScreen(root.getDescendantById(Components.G5GLOGO)).executeTransition("remove");
executeTransition("StartGameIntro");
}
private function onCreditsBtnRollOut(_arg1:MouseEvent):void{
onGameModeBtnRollOver(GameModes.CREDITS);
}
private function onNormalBtnClick(_arg1:MouseEvent):void{
if (Stats.gameMode == GameModes.NORMAL){
Stats.gameMode = GameModes.NORMAL;
onGameModeBtnClick();
} else {
Stats.gameMode = GameModes.NORMAL;
onGameModeBtnClick2();
};
}
override protected function onButtonClick(_arg1:MouseEvent):void{
SoundManager.getInstance().playSound("click_button", SoundGroups.SPLASH_SOUNDS);
if (_arg1.target == mc.back_btn){
executeTransition("MainMenu");
};
}
override protected function onButtonRollOut(_arg1:MouseEvent):void{
MovieClip(_arg1.target).gotoAndPlay("out");
}
override protected function onEnter(_arg1:Screen):void{
mc.container.hard_btn.visible = false;
mc.container.veryhard_btn.visible = false;
mc.container.credits_btn.visible = false;
mc.container.new_hard.visible = false;
mc.container.new_veryhard.visible = false;
mc.container.new_credits.visible = false;
if (Stats.gameModeStatsArr[GameModes.HARD].unlocked){
mc.container.hard_non_select.visible = false;
mc.container.hard_btn.visible = true;
mc.container.lock_hard.visible = false;
};
if (Stats.gameModeStatsArr[GameModes.VERY_HARD].unlocked){
mc.container.veryhard_non_select.visible = false;
mc.container.veryhard_btn.visible = true;
mc.container.lock_veryhard.visible = false;
};
if (Stats.gameModeStatsArr[GameModes.CREDITS].unlocked){
mc.container.lock_credits.visible = false;
mc.container.credits_non_select.visible = false;
mc.container.credits_btn.visible = true;
};
mc.container.details.alpha = 0;
if (Stats.gameModeStatsArr[GameModes.NORMAL].medal){
mc.container.medal_normal.visible = true;
mc.container.medal_normal.gotoAndStop(Stats.gameModeStatsArr[GameModes.NORMAL].medal);
};
if (Stats.gameModeStatsArr[GameModes.HARD].medal){
mc.container.medal_hard.visible = true;
mc.container.medal_hard.gotoAndStop(Stats.gameModeStatsArr[GameModes.HARD].medal);
} else {
if (Stats.gameModeStatsArr[GameModes.HARD].isNew){
mc.container.new_hard.visible = true;
};
};
if (Stats.gameModeStatsArr[GameModes.VERY_HARD].medal){
mc.container.medal_veryhard.visible = true;
mc.container.medal_veryhard.gotoAndStop(Stats.gameModeStatsArr[GameModes.VERY_HARD].medal);
} else {
if (Stats.gameModeStatsArr[GameModes.VERY_HARD].isNew){
mc.container.new_veryhard.visible = true;
};
};
if (Stats.gameModeStatsArr[GameModes.CREDITS].medal){
mc.container.medal_credits.visible = true;
mc.container.medal_credits.gotoAndStop(Stats.gameModeStatsArr[GameModes.CREDITS].medal);
} else {
if (Stats.gameModeStatsArr[GameModes.CREDITS].isNew){
mc.container.new_credits.visible = true;
};
};
}
private function onHardBtnClick(_arg1:MouseEvent):void{
if (Stats.gameMode == GameModes.HARD){
Stats.gameMode = GameModes.HARD;
onGameModeBtnClick();
} else {
Stats.gameMode = GameModes.HARD;
onGameModeBtnClick2();
};
}
}
}//package _screens
Section 109
//StartGameIntroScreen (_screens.StartGameIntroScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import _game._stats.*;
import assets.*;
import framework._utils._timer.*;
import _components.*;
import _sound.*;
public class StartGameIntroScreen extends Screen {
public var mc:StartGameIntroAsset;
private var gameMusicId:int;// = -1
public function StartGameIntroScreen(){
mc = new StartGameIntroAsset();
super();
id = Components.START_GAME_INTRO;
canvas.addChild(mc);
mc.addEventListener("playerEnteredScreen", onPlayerEnteredScreen);
mc.addEventListener("playerReachedCenter", onPlayerReachedCenter);
}
private function playMusic():void{
if (!SoundManager.getInstance().getSoundIsPlaying(gameMusicId)){
gameMusicId = SoundManager.getInstance().playSound("gameMusic", SoundGroups.GAME_MUSIC, 999999);
};
}
private function onPlayerReachedCenter(_arg1:Event):void{
SoundManager.getInstance().playSound("player_evolves", SoundGroups.SPLASH_SOUNDS);
}
override protected function onEnter(_arg1:Screen):void{
var _local2:TimerEx = new TimerEx(1, 0.3, playMusic);
_local2.start();
Stats.playerLevel = 1;
Stats.score = 0;
Stats.overBombs = 0;
if ((((Stats.gameMode == GameModes.VERY_HARD)) || ((Stats.gameMode == GameModes.CREDITS)))){
Stats.lives = (Stats.addLifeSecret) ? 2 : 1;
} else {
Stats.lives = (Stats.addLifeSecret) ? 4 : 3;
};
Stats.inFinal = false;
Stats.cancelPhases = false;
Stats.bombs = 0;
Stats.enemiesKilled = 0;
Stats.diedOnce = false;
Stats.readyToEvolve = false;
Stats.gameModeStatsArr[Stats.gameMode].isNew = false;
FinalStats.getInstance().reset();
FinalStats.getInstance().livesTotal = Stats.lives;
Stats.gameTracker.beginLevel(Stats.gameMode, Stats.gameModeStatsArr[Stats.gameMode].score, Stats.gameModeStatsArr[Stats.gameMode].medal, ((((("time=" + Stats.gameModeStatsArr[Stats.gameMode].gameTime) + ", lives=") + Stats.gameModeStatsArr[Stats.gameMode].livesAmount) + ", zEnergy=") + Stats.gameModeStatsArr[Stats.gameMode].lightsCaught));
executeTransition("Gui");
}
private function onPlayerEnteredScreen(_arg1:Event):void{
var _local2:int = SoundManager.getInstance().playSound("player_enters_screen", SoundGroups.SPLASH_SOUNDS);
SoundManager.getInstance().fadeSound(_local2, 1);
}
override protected function onInitialize(_arg1:String):void{
executeTransition("Game");
}
}
}//package _screens
Section 110
//TitleScreen (_screens.TitleScreen)
package _screens {
import flash.events.*;
import framework._flow.*;
import framework._sound.*;
import framework._core.*;
import _game._stats.*;
import flash.geom.*;
import assets.*;
import framework._utils._timer.*;
import gs.*;
import _components.*;
import _sound.*;
public class TitleScreen extends Screen implements IUpdateable {
private var timerExtraLifeCheat:TimerEx;
private var dir:Point;
public var mc:TitleAsset;
private var initPosEye1:Point;
private var initPosEye2:Point;
private var initPlayerY:Number;
private var mousePos:Point;
private var firstTime:Boolean;// = true
private var playerClicks:int;// = 0
public function TitleScreen(){
mc = new TitleAsset();
mousePos = new Point();
dir = new Point();
initPosEye1 = new Point(-26.4, 8.2);
initPosEye2 = new Point(26.8, 13.2);
timerExtraLifeCheat = new TimerEx(1, 0.6, onTimerExtraLifeCheat);
super();
canvas.addChild(mc);
id = Components.TITLE;
mc.container.player.mouseEnabled = false;
mc.container.player.mouseChildren = false;
mc.container.hotspot.addEventListener(MouseEvent.ROLL_OVER, onPlayerRollOver);
mc.container.hotspot.addEventListener(MouseEvent.ROLL_OUT, onPlayerRollOut);
mc.container.hotspot.addEventListener(MouseEvent.CLICK, onPlayerClick);
initPlayerY = mc.container.player.y;
mc.addEventListener("backgroundEnter", onBackgroundEnter);
}
public function update():void{
dir.x = mc.container.player.mouseX;
dir.y = mc.container.player.mouseY;
dir.normalize(1);
mc.container.player.eye_1.x = (initPosEye1.x + (dir.x * 3.5));
mc.container.player.eye_1.y = (initPosEye1.y + (dir.y * 3.5));
dir.x = mc.container.player.mouseX;
dir.y = mc.container.player.mouseY;
dir.normalize(1);
mc.container.player.eye_2.x = (initPosEye2.x + (dir.x * 2.2));
mc.container.player.eye_2.y = (initPosEye2.y + (dir.y * 2.2));
}
override protected function onInitialize(_arg1:String):void{
playerClicks = 0;
if (firstTime){
executeTransition("MainMenu");
executeTransition("g5glogo");
firstTime = false;
};
}
private function onPlayerRollOut(_arg1:Event):void{
TweenMax.to(mc.container.player, 0.3, {y:initPlayerY});
}
private function onTimerExtraLifeCheat():void{
SoundManager.getInstance().playSound("player_wins_life", SoundGroups.SPLASH_SOUNDS);
Stats.addLifeSecret = true;
}
private function onPlayerClick(_arg1:Event):void{
playerClicks++;
if (playerClicks == 13){
timerExtraLifeCheat.start();
};
if (playerClicks > 13){
timerExtraLifeCheat.stop();
};
}
override protected function onExit(_arg1:String):void{
timerExtraLifeCheat.stop();
}
private function onBackgroundEnter(_arg1:Event):void{
mc.removeEventListener("backgroundEnter", onBackgroundEnter);
executeTransition("BackgroundSpace");
}
private function onPlayerRollOver(_arg1:Event):void{
TweenMax.to(mc.container.player, 0.3, {y:(initPlayerY + 23.6)});
}
override protected function onEnter(_arg1:Screen):void{
if (firstTime){
SoundManager.getInstance().playSound("splashMusic", SoundGroups.SPLASH_MUSIC, 999999, 1);
};
}
}
}//package _screens
Section 111
//WhiteScreen (_screens.WhiteScreen)
package _screens {
import framework._flow.*;
import framework._utils._timer.*;
import _backgrounds.*;
import _components.*;
public class WhiteScreen extends Screen {
public function WhiteScreen(){
id = Components.WHITE_SCREEN;
canvas.graphics.beginFill(0xFFFFFF, 1);
canvas.graphics.drawRect(0, 0, 600, 600);
canvas.graphics.endFill();
}
private function onStartGameIntro():void{
executeTransition("StartGameIntro");
}
private function onMainMenu():void{
executeTransition("MainMenu");
}
override protected function onInitialize(_arg1:String):void{
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).addCircle();
if (_arg1 == "WhiteScreenMainMenu"){
TimerEx.start(1, 0.4, onMainMenu);
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).loadLastUnlockedBackground();
} else {
if (_arg1 == "WhiteScreenStartGameIntro"){
TimerEx.start(1, 0.2, onStartGameIntro);
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).loadBackground();
} else {
if (_arg1 == "SelectModeWhiteScreen"){
TimerEx.start(1, 0.7, onStartGameIntro);
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).loadBackground();
} else {
if (_arg1 == "WhiteScreenGameOver"){
TimerEx.start(1, 0.3, onMainMenu);
BackgroundSpace(root.getDescendantById(Components.BACKGROUND)).loadLastUnlockedBackground();
};
};
};
};
}
}
}//package _screens
Section 112
//SoundGroups (_sound.SoundGroups)
package _sound {
public class SoundGroups {
public static const GAME_SOUNDS:String = "gameSounds";
public static const GAME_MUSIC:String = "gameMusic";
public static const SPLASH_SOUNDS:String = "splashSounds";
public static const SPLASH_MUSIC:String = "splashMusic";
}
}//package _sound
Section 113
//Enemy1Asset (assets.entity.Enemy1Asset)
package assets.entity {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class Enemy1Asset extends MovieClipEx {
public var points:MovieClip;
public var mc:MovieClip;
public function Enemy1Asset(){
addFrameScript(9, frame10, 26, frame27, 38, frame39);
}
function frame27(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame39(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame10(){
stop();
}
}
}//package assets.entity
Section 114
//Enemy2Asset (assets.entity.Enemy2Asset)
package assets.entity {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class Enemy2Asset extends MovieClipEx {
public var points:MovieClip;
public var mc:MovieClip;
public function Enemy2Asset(){
addFrameScript(9, frame10, 26, frame27, 37, frame38);
}
function frame27(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame38(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame10(){
stop();
}
}
}//package assets.entity
Section 115
//Enemy3Asset (assets.entity.Enemy3Asset)
package assets.entity {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class Enemy3Asset extends MovieClipEx {
public var mc:MovieClip;
public var points:MovieClip;
public function Enemy3Asset(){
addFrameScript(9, frame10, 27, frame28, 38, frame39);
}
function frame39(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame28(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame10(){
stop();
}
}
}//package assets.entity
Section 116
//Enemy4Asset (assets.entity.Enemy4Asset)
package assets.entity {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class Enemy4Asset extends MovieClipEx {
public var points:MovieClip;
public function Enemy4Asset(){
addFrameScript(9, frame10, 26, frame27, 37, frame38);
}
function frame38(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame27(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame10(){
stop();
}
}
}//package assets.entity
Section 117
//Enemy5Asset (assets.entity.Enemy5Asset)
package assets.entity {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class Enemy5Asset extends MovieClipEx {
public var points:MovieClip;
public function Enemy5Asset(){
addFrameScript(9, frame10, 26, frame27, 37, frame38);
}
function frame38(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame27(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame10(){
stop();
}
}
}//package assets.entity
Section 118
//Enemy6Asset (assets.entity.Enemy6Asset)
package assets.entity {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class Enemy6Asset extends MovieClipEx {
public var points:MovieClip;
public function Enemy6Asset(){
addFrameScript(9, frame10, 26, frame27, 37, frame38);
}
function frame38(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame27(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame10(){
stop();
}
}
}//package assets.entity
Section 119
//Enemy7Asset (assets.entity.Enemy7Asset)
package assets.entity {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class Enemy7Asset extends MovieClipEx {
public var points:MovieClip;
public function Enemy7Asset(){
addFrameScript(10, frame11, 21, frame22, 29, frame30, 38, frame39);
}
function frame39(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame11(){
stop();
}
function frame30(){
stop();
dispatchEvent(new Event("exploded"));
}
function frame22(){
stop();
dispatchEvent(new Event("exploded"));
}
}
}//package assets.entity
Section 120
//PlayerAsset (assets.entity.PlayerAsset)
package assets.entity {
import flash.display.*;
import flash.events.*;
import framework._event.*;
import framework._mcEx.*;
public dynamic class PlayerAsset extends MovieClipEx {
public var idle:MovieClip;
public function PlayerAsset(){
addFrameScript(0, frame1, 17, frame18, 27, frame28, 44, frame45, 105, frame106, 106, frame107, 121, frame122, 131, frame132, 148, frame149, 208, frame209, 209, frame210, 224, frame225, 234, frame235, 251, frame252, 310, frame311, 311, frame312, 326, frame327, 336, frame337, 353, frame354, 408, frame409, 409, frame410, 425, frame426, 435, frame436, 452, frame453, 509, frame510, 510, frame511, 526, frame527, 536, frame537, 553, frame554);
}
function frame252(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
dispatchEvent(new Event("endedAnimDead", true));
}
function frame132(){
stop();
gotoAndStop("idle_2");
}
function frame210(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
}
function frame354(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
dispatchEvent(new Event("endedAnimDead", true));
}
function frame311(){
dispatchEvent(new Event("evolution_complete"));
}
function frame235(){
stop();
gotoAndStop("idle_3");
}
function frame511(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
}
function frame337(){
stop();
gotoAndStop("idle_4");
}
function frame453(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
dispatchEvent(new Event("endedAnimDead", true));
}
function frame410(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
}
function frame312(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
}
function frame436(){
stop();
gotoAndStop("idle_5");
}
function frame537(){
stop();
gotoAndStop("idle_6");
}
function frame510(){
dispatchEvent(new Event("evolution_complete"));
}
function frame18(){
stop();
gotoAndStop("idle_1");
}
function frame554(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
dispatchEvent(new Event("endedAnimDead", true));
}
function frame1(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
}
function frame149(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
dispatchEvent(new Event("endedAnimDead", true));
}
function frame106(){
dispatchEvent(new Event("evolution_complete"));
}
function frame107(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
}
function frame527(){
stop();
gotoAndStop("idle_6");
}
function frame209(){
dispatchEvent(new Event("evolution_complete"));
}
function frame225(){
stop();
gotoAndStop("idle_3");
}
function frame409(){
dispatchEvent(new Event("evolution_complete"));
}
function frame327(){
stop();
gotoAndStop("idle_4");
}
function frame28(){
stop();
gotoAndStop("idle_1");
}
function frame45(){
dispatchEvent(new Event(EventsFw.STOP_FRAME, true));
dispatchEvent(new Event("endedAnimDead", true));
}
function frame426(){
stop();
gotoAndStop("idle_5");
}
function frame122(){
stop();
gotoAndStop("idle_2");
}
}
}//package assets.entity
Section 121
//BonusScoreAsset (assets.gui.BonusScoreAsset)
package assets.gui {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class BonusScoreAsset extends MovieClipEx {
public var tf_mc:MovieClip;
public function BonusScoreAsset(){
addFrameScript(1, frame2, 69, frame70);
}
function frame70(){
visible = false;
dispatchEvent(new Event("end"));
}
function frame2(){
stop();
}
}
}//package assets.gui
Section 122
//GuiAsset (assets.gui.GuiAsset)
package assets.gui {
import flash.display.*;
public dynamic class GuiAsset extends MovieClip {
public var blueEnergyMax:MovieClip;
public var progress_bar_container:MovieClip;
public var danger_down:MovieClip;
public var counter:MovieClip;
public var menu_btn:SimpleButton;
public var g5g_btn:SimpleButton;
public var readyToEvolve:MovieClip;
public var energyMax:MovieClip;
public var Lives:MovieClip;
public var danger_center:MovieClip;
public var Score:MovieClip;
public var avoid:MovieClip;
public var maxEvolution:MovieClip;
public var danger_up:MovieClip;
public function GuiAsset(){
addFrameScript(0, frame1, 45, frame46, 60, frame61);
}
function frame61(){
stop();
}
function frame1(){
stop();
}
function frame46(){
stop();
}
}
}//package assets.gui
Section 123
//LivesUpAsset (assets.gui.LivesUpAsset)
package assets.gui {
import flash.events.*;
import framework._mcEx.*;
public dynamic class LivesUpAsset extends MovieClipEx {
public function LivesUpAsset(){
addFrameScript(1, frame2, 67, frame68);
}
function frame2(){
stop();
}
function frame68(){
visible = false;
dispatchEvent(new Event("end"));
}
}
}//package assets.gui
Section 124
//ArrowPointing2Asset (assets.ArrowPointing2Asset)
package assets {
import framework._mcEx.*;
public dynamic class ArrowPointing2Asset extends MovieClipEx {
}
}//package assets
Section 125
//ArrowPointingAsset (assets.ArrowPointingAsset)
package assets {
import framework._mcEx.*;
public dynamic class ArrowPointingAsset extends MovieClipEx {
}
}//package assets
Section 126
//BackgroundSpaceAsset (assets.BackgroundSpaceAsset)
package assets {
import flash.display.*;
public dynamic class BackgroundSpaceAsset extends MovieClip {
public var s1_a:star1Asset;
public var s1_b:star1Asset;
public var s1_d:star1Asset;
public var s1_f:star1Asset;
public var s2_a:star2Asset;
public var s1_c:star1Asset;
public var s2_c:star2Asset;
public var s1_e:star1Asset;
public var s2_d:star2Asset;
public var middle_rocks:MovieClip;
public var s1_g:star1Asset;
public var s2b:star2Asset;
public function BackgroundSpaceAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 127
//BombAsset (assets.BombAsset)
package assets {
import framework._mcEx.*;
public dynamic class BombAsset extends MovieClipEx {
public function BombAsset(){
addFrameScript(0, frame1, 31, frame32, 50, frame51);
}
function frame51(){
stop();
}
function frame32(){
gotoAndPlay("idle");
}
function frame1(){
stop();
}
}
}//package assets
Section 128
//BorderLights (assets.BorderLights)
package assets {
import framework._mcEx.*;
public dynamic class BorderLights extends MovieClipEx {
}
}//package assets
Section 129
//CircleAsset (assets.CircleAsset)
package assets {
import flash.display.*;
public dynamic class CircleAsset extends MovieClip {
public var circle:MovieClip;
public function CircleAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 130
//CreditsAsset (assets.CreditsAsset)
package assets {
import flash.display.*;
public dynamic class CreditsAsset extends MovieClip {
public var back_btn:MovieClip;
public function CreditsAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 131
//CreditsScreenAsset (assets.CreditsScreenAsset)
package assets {
import flash.display.*;
public dynamic class CreditsScreenAsset extends MovieClip {
public function CreditsScreenAsset(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 132
//FinalScoreAsset (assets.FinalScoreAsset)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class FinalScoreAsset extends MovieClip {
public var lives:MovieClip;
public var time:MovieClip;
public var score:MovieClip;
public var lights_qualif:MovieClip;
public var lights:MovieClip;
public var time_qualif:MovieClip;
public var lives_qualif:MovieClip;
public var job_qualification:MovieClip;
public var newHighscore:MovieClip;
public var submit_btn:SimpleButton;
public var medal:MovieClip;
public var mainmenu_btn:SimpleButton;
public function FinalScoreAsset(){
addFrameScript(0, frame1, 14, frame15, 24, frame25, 34, frame35, 45, frame46, 105, frame106, 130, frame131, 146, frame147);
}
function frame131(){
stop();
dispatchEvent(new Event("exited"));
}
function frame35(){
lives_qualif.gotoAndPlay(2);
}
function frame15(){
newHighscore.gotoAndPlay(2);
}
function frame147(){
stop();
dispatchEvent(new Event("exited"));
}
function frame46(){
lights_qualif.gotoAndPlay(2);
}
function frame1(){
stop();
}
function frame106(){
stop();
dispatchEvent(new Event("entered"));
}
function frame25(){
time_qualif.gotoAndPlay(2);
}
}
}//package assets
Section 133
//g5glogoScreenAsset (assets.g5glogoScreenAsset)
package assets {
import flash.display.*;
public dynamic class g5glogoScreenAsset extends MovieClip {
public var g5g_btn:SimpleButton;
public function g5glogoScreenAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 134
//GameCompletedAsset (assets.GameCompletedAsset)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class GameCompletedAsset extends MovieClip {
public var mission_txt:MovieClip;
public function GameCompletedAsset(){
addFrameScript(0, frame1, 60, frame61, 124, frame125, 190, frame191, 207, frame208);
}
function frame1(){
stop();
}
function frame208(){
stop();
dispatchEvent(new Event("exited"));
}
function frame125(){
dispatchEvent(new Event("spaceship_whoosh"));
}
function frame61(){
dispatchEvent(new Event("spaceship_whoosh"));
}
function frame191(){
stop();
dispatchEvent(new Event("entered"));
}
}
}//package assets
Section 135
//GameOverAsset (assets.GameOverAsset)
package assets {
import flash.display.*;
public dynamic class GameOverAsset extends MovieClip {
public var comment1:MovieClip;
public var tryAgain_btn:MovieClip;
public var alphaScreen:MovieClip;
public var quit_btn:MovieClip;
public var new_highscore:MovieClip;
public var score:MovieClip;
public var submit_btn:MovieClip;
public var g5g_btn:SimpleButton;
public var you_scored:MovieClip;
public function GameOverAsset(){
addFrameScript(0, frame1, 58, frame59);
}
function frame59(){
new_highscore.play();
}
function frame1(){
stop();
}
}
}//package assets
Section 136
//GetIn2Asset (assets.GetIn2Asset)
package assets {
import framework._mcEx.*;
public dynamic class GetIn2Asset extends MovieClipEx {
}
}//package assets
Section 137
//GetInAsset (assets.GetInAsset)
package assets {
import framework._mcEx.*;
public dynamic class GetInAsset extends MovieClipEx {
}
}//package assets
Section 138
//GiantMeteorAnimAsset (assets.GiantMeteorAnimAsset)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class GiantMeteorAnimAsset extends MovieClip {
public var giantMeteor:GiantMeteorAsset;
public function GiantMeteorAnimAsset(){
addFrameScript(0, frame1, 108, frame109);
}
function frame1(){
stop();
}
function frame109(){
dispatchEvent(new Event("explosion"));
}
}
}//package assets
Section 139
//GiantMeteorAsset (assets.GiantMeteorAsset)
package assets {
import flash.display.*;
public dynamic class GiantMeteorAsset extends MovieClip {
public function GiantMeteorAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 140
//GiantMeteorExplosion (assets.GiantMeteorExplosion)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class GiantMeteorExplosion extends MovieClip {
public var meteor:GiantMeteorAsset;
public function GiantMeteorExplosion(){
addFrameScript(39, frame40, 250, frame251, 311, frame312);
}
function frame251(){
dispatchEvent(new Event("slideBackground"));
}
function frame312(){
stop();
dispatchEvent(new Event("complete"));
}
function frame40(){
dispatchEvent(new Event("fullExplosion"));
}
}
}//package assets
Section 141
//GiantMeteorPassingAsset (assets.GiantMeteorPassingAsset)
package assets {
import flash.display.*;
public dynamic class GiantMeteorPassingAsset extends MovieClip {
}
}//package assets
Section 142
//HighscoresAsset (assets.HighscoresAsset)
package assets {
import flash.display.*;
public dynamic class HighscoresAsset extends MovieClip {
public var container:MovieClip;
public function HighscoresAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 143
//HowToPlayAsset (assets.HowToPlayAsset)
package assets {
import flash.display.*;
public dynamic class HowToPlayAsset extends MovieClip {
public var container:MovieClip;
public var back_btn:MovieClip;
public function HowToPlayAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 144
//InGameMenuAsset (assets.InGameMenuAsset)
package assets {
import flash.display.*;
public dynamic class InGameMenuAsset extends MovieClip {
public var container:MovieClip;
public var alphaScreen:MovieClip;
public function InGameMenuAsset(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package assets
Section 145
//MainMenuAsset (assets.MainMenuAsset)
package assets {
import flash.display.*;
public dynamic class MainMenuAsset extends MovieClip {
public var level_unlocked:MovieClip;
public var play_btn:MovieClip;
public var credits_btn:MovieClip;
public var options_btn:MovieClip;
public var howtoplay_btn:MovieClip;
public var jay_btn:MovieClip;
public function MainMenuAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 146
//MessagePanelAsset (assets.MessagePanelAsset)
package assets {
import flash.display.*;
import flash.text.*;
public dynamic class MessagePanelAsset extends MovieClip {
public var character:MovieClip;
public var dialog_txt:TextField;
public function MessagePanelAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 147
//MeteorAsset1 (assets.MeteorAsset1)
package assets {
import flash.display.*;
public dynamic class MeteorAsset1 extends MovieClip {
}
}//package assets
Section 148
//MeteorPassingAsset (assets.MeteorPassingAsset)
package assets {
import flash.display.*;
public dynamic class MeteorPassingAsset extends MovieClip {
}
}//package assets
Section 149
//MeteorPiece1 (assets.MeteorPiece1)
package assets {
import flash.display.*;
public dynamic class MeteorPiece1 extends MovieClip {
}
}//package assets
Section 150
//MeteorPiece2 (assets.MeteorPiece2)
package assets {
import flash.display.*;
public dynamic class MeteorPiece2 extends MovieClip {
}
}//package assets
Section 151
//MeteorPiece3 (assets.MeteorPiece3)
package assets {
import flash.display.*;
public dynamic class MeteorPiece3 extends MovieClip {
}
}//package assets
Section 152
//MeteorPiece4 (assets.MeteorPiece4)
package assets {
import flash.display.*;
public dynamic class MeteorPiece4 extends MovieClip {
}
}//package assets
Section 153
//MeteorPiece5 (assets.MeteorPiece5)
package assets {
import flash.display.*;
public dynamic class MeteorPiece5 extends MovieClip {
}
}//package assets
Section 154
//MeteorPiece6 (assets.MeteorPiece6)
package assets {
import flash.display.*;
public dynamic class MeteorPiece6 extends MovieClip {
}
}//package assets
Section 155
//MeteorsShieldAsset (assets.MeteorsShieldAsset)
package assets {
import flash.display.*;
import framework._mcEx.*;
public dynamic class MeteorsShieldAsset extends MovieClipEx {
public var bright:MovieClip;
public function MeteorsShieldAsset(){
addFrameScript(0, frame1, 46, frame47, 71, frame72);
}
function frame47(){
stop();
}
function frame1(){
stop();
}
function frame72(){
stop();
}
}
}//package assets
Section 156
//OptionsAsset (assets.OptionsAsset)
package assets {
import flash.display.*;
public dynamic class OptionsAsset extends MovieClip {
public var container:MovieClip;
public var back_btn:MovieClip;
public function OptionsAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 157
//PlayerBombAsset (assets.PlayerBombAsset)
package assets {
import flash.display.*;
public dynamic class PlayerBombAsset extends MovieClip {
}
}//package assets
Section 158
//PlayerExplosionAsset (assets.PlayerExplosionAsset)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class PlayerExplosionAsset extends MovieClip {
public function PlayerExplosionAsset(){
addFrameScript(53, frame54, 264, frame265, 325, frame326);
}
function frame326(){
stop();
dispatchEvent(new Event("complete"));
}
function frame265(){
dispatchEvent(new Event("slideBackground"));
}
function frame54(){
dispatchEvent(new Event("fullExplosion"));
}
}
}//package assets
Section 159
//PlayerFinalAsset (assets.PlayerFinalAsset)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class PlayerFinalAsset extends MovieClip {
public function PlayerFinalAsset(){
addFrameScript(0, frame1, 39, frame40, 73, frame74, 119, frame120);
}
function frame40(){
stop();
}
function frame74(){
stop();
dispatchEvent(new Event("transform_loop_end"));
}
function frame1(){
stop();
}
function frame120(){
stop();
}
}
}//package assets
Section 160
//SelectModeAsset (assets.SelectModeAsset)
package assets {
import flash.display.*;
public dynamic class SelectModeAsset extends MovieClip {
public var container:MovieClip;
public var back_btn:MovieClip;
public function SelectModeAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 161
//ShieldAsset (assets.ShieldAsset)
package assets {
import flash.display.*;
public dynamic class ShieldAsset extends MovieClip {
}
}//package assets
Section 162
//Smoke (assets.Smoke)
package assets {
import flash.display.*;
public dynamic class Smoke extends MovieClip {
}
}//package assets
Section 163
//SpaceshipAsset (assets.SpaceshipAsset)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class SpaceshipAsset extends MovieClip {
public var ship:MovieClip;
public function SpaceshipAsset(){
addFrameScript(26, frame27, 58, frame59, 77, frame78, 136, frame137, 168, frame169, 305, frame306);
}
function frame59(){
gotoAndPlay("teleporting_loop");
dispatchEvent(new Event("teleport_loop"));
}
function frame27(){
dispatchEvent(new Event("teleport_loop"));
}
function frame306(){
stop();
}
function frame169(){
ship.gotoAndPlay("engines");
dispatchEvent(new Event("turbines"));
}
function frame78(){
stop();
dispatchEvent(new Event("teleport_complete"));
}
function frame137(){
dispatchEvent(new Event("giantMeteor"));
}
}
}//package assets
Section 164
//SpikeAsset (assets.SpikeAsset)
package assets {
import flash.events.*;
import framework._mcEx.*;
public dynamic class SpikeAsset extends MovieClipEx {
public function SpikeAsset(){
addFrameScript(0, frame1, 6, frame7, 16, frame17);
}
function frame7(){
stop();
}
function frame17(){
stop();
dispatchEvent(new Event("unlock"));
}
function frame1(){
stop();
}
}
}//package assets
Section 165
//SpiralAsset (assets.SpiralAsset)
package assets {
import flash.display.*;
public dynamic class SpiralAsset extends MovieClip {
public var spiral_color:MovieClip;
}
}//package assets
Section 166
//StarAsset (assets.StarAsset)
package assets {
import flash.display.*;
public dynamic class StarAsset extends MovieClip {
}
}//package assets
Section 167
//StartGameIntroAsset (assets.StartGameIntroAsset)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class StartGameIntroAsset extends MovieClip {
public function StartGameIntroAsset(){
addFrameScript(0, frame1, 14, frame15, 115, frame116);
}
function frame116(){
dispatchEvent(new Event("playerReachedCenter"));
}
function frame15(){
dispatchEvent(new Event("playerEnteredScreen"));
}
function frame1(){
stop();
}
}
}//package assets
Section 168
//Starys (assets.Starys)
package assets {
import flash.display.*;
public dynamic class Starys extends MovieClip {
public function Starys(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 169
//SubmitScoreScreen (assets.SubmitScoreScreen)
package assets {
import flash.display.*;
public dynamic class SubmitScoreScreen extends MovieClip {
public var main_menu_btn:SimpleButton;
public var hiscores_container:MovieClip;
public function SubmitScoreScreen(){
addFrameScript(0, frame1, 14, frame15, 33, frame34);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame34(){
stop();
}
}
}//package assets
Section 170
//SubmitScoreScreenGameover (assets.SubmitScoreScreenGameover)
package assets {
import flash.display.*;
public dynamic class SubmitScoreScreenGameover extends MovieClip {
public var tryAgain_btn:MovieClip;
public var alphaScreen:MovieClip;
public var quit_btn:MovieClip;
public function SubmitScoreScreenGameover(){
addFrameScript(0, frame1, 14, frame15, 33, frame34);
}
function frame15(){
stop();
}
function frame1(){
stop();
}
function frame34(){
stop();
}
}
}//package assets
Section 171
//SuperBombAsset (assets.SuperBombAsset)
package assets {
import flash.events.*;
import framework._mcEx.*;
public dynamic class SuperBombAsset extends MovieClipEx {
public function SuperBombAsset(){
addFrameScript(0, frame1, 29, frame30, 48, frame49);
}
function frame49(){
dispatchEvent(new Event("caught_anim_end"));
}
function frame30(){
gotoAndPlay("idle");
}
function frame1(){
stop();
}
}
}//package assets
Section 172
//TitleAsset (assets.TitleAsset)
package assets {
import flash.display.*;
import flash.events.*;
public dynamic class TitleAsset extends MovieClip {
public var container:MovieClip;
public function TitleAsset(){
addFrameScript(0, frame1, 44, frame45, 46, frame47);
}
function frame47(){
dispatchEvent(new Event("backgroundEnter"));
}
function frame1(){
stop();
}
function frame45(){
MovieClip(getChildByName("container")).gotoAndPlay("enter");
}
}
}//package assets
Section 173
//UnlockedMsgAsset (assets.UnlockedMsgAsset)
package assets {
import flash.display.*;
public dynamic class UnlockedMsgAsset extends MovieClip {
public var panel:MovieClip;
public function UnlockedMsgAsset(){
addFrameScript(0, frame1, 20, frame21, 49, frame50);
}
function frame1(){
stop();
}
function frame21(){
stop();
}
function frame50(){
stop();
visible = false;
}
}
}//package assets
Section 174
//WormAsset (assets.WormAsset)
package assets {
import flash.display.*;
public dynamic class WormAsset extends MovieClip {
public function WormAsset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package assets
Section 175
//YellowEnergyAsset (assets.YellowEnergyAsset)
package assets {
import flash.display.*;
import flash.events.*;
import framework._mcEx.*;
public dynamic class YellowEnergyAsset extends MovieClipEx {
public var amount_txt:MovieClip;
public function YellowEnergyAsset(){
addFrameScript(1, frame2, 69, frame70);
}
function frame2(){
stop();
}
function frame70(){
visible = false;
dispatchEvent(new Event("end"));
}
}
}//package assets
Section 176
//BinaryItem (br.com.stimuli.loading.loadingtypes.BinaryItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import br.com.stimuli.loading.*;
import flash.utils.*;
import flash.net.*;
import flash.display.*;
public class BinaryItem extends LoadingItem {
public var loader:URLLoader;
public function BinaryItem(_arg1:URLRequest, _arg2:String, _arg3:String){
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:ErrorEvent):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false);
};
}
override public function load():void{
super.load();
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false, 0, true);
try {
loader.load(url);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function onStartedHandler(_arg1:Event):void{
super.onStartedHandler(_arg1);
}
override public function onCompleteHandler(_arg1:Event):void{
_content = _arg1.target.data;
super.onCompleteHandler(_arg1);
}
override public function _parseOptions(_arg1:Object):Array{
return (super._parseOptions(_arg1));
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 177
//ImageItem (br.com.stimuli.loading.loadingtypes.ImageItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import br.com.stimuli.loading.*;
import flash.utils.*;
import flash.net.*;
import flash.display.*;
public class ImageItem extends LoadingItem {
public var loader:Loader;
public function ImageItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CONTEXT];
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:ErrorEvent):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function load():void{
super.load();
loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 100, true);
loader.contentLoaderInfo.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
try {
loader.load(url, _context);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
override public function _parseOptions(_arg1:Object):Array{
_context = ((_arg1[BulkLoader.CONTEXT]) || (null));
return (super._parseOptions(_arg1));
}
override public function isImage():Boolean{
return ((type == BulkLoader.TYPE_IMAGE));
}
override public function onCompleteHandler(_arg1:Event):void{
var evt = _arg1;
try {
_content = loader.content;
super.onCompleteHandler(evt);
} catch(e:SecurityError) {
_content = loader;
super.onCompleteHandler(evt);
};
}
override public function cleanListeners():void{
var _local1:Object;
if (loader){
_local1 = loader.contentLoaderInfo;
_local1.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
_local1.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
_local1.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
_local1.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
_local1.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
};
}
override public function isSWF():Boolean{
return ((type == BulkLoader.TYPE_MOVIECLIP));
}
public function _onHttpStatusHandler(_arg1:HTTPStatusEvent):void{
_httpStatus = _arg1.status;
dispatchEvent(_arg1);
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 178
//LoadingItem (br.com.stimuli.loading.loadingtypes.LoadingItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import br.com.stimuli.loading.*;
import flash.utils.*;
import flash.net.*;
import flash.display.*;
public class LoadingItem extends EventDispatcher {
public var _priority:int;// = 0
public var _type:String;
public var status:String;
public var _isLoaded:Boolean;
public var _isLoading:Boolean;
public var _additionIndex:int;
public var _bytesTotal:int;// = -1
public var _httpStatus:int;// = -1
public var _content;
public var _speed:Number;
public var _weightPercentLoaded:Number;
public var propertyParsingErrors:Array;
public var url:URLRequest;
public var errorEvent:ErrorEvent;
public var weight:int;// = 1
public var _addedTime:int;
public var _context;// = null
public var preventCache:Boolean;
public var _responseTime:Number;
public var _uid:String;
public var maxTries:int;// = 3
public var _bytesLoaded:int;// = 0
public var _percentLoaded:Number;
public var _totalTime:int;
public var numTries:int;// = 0
public var _id:String;
public var _latency:Number;
public var _startTime:int;
public var _bytesRemaining:int;// = 10000000
public var _timeToDownload:int;
public var specificAvailableProps:Array;
public static const STATUS_STOPPED:String = "stopped";
public static const STATUS_STARTED:String = "started";
public static const STATUS_ERROR:String = "error";
public static const STATUS_FINISHED:String = "finished";
public function LoadingItem(_arg1:URLRequest, _arg2:String, _arg3:String){
this._type = _arg2;
this.url = _arg1;
if (!specificAvailableProps){
specificAvailableProps = [];
};
this._uid = _arg3;
}
public function onSecurityErrorHandler(_arg1:ErrorEvent):void{
status = STATUS_ERROR;
errorEvent = (_arg1 as ErrorEvent);
_arg1.stopPropagation();
_dispatchErrorEvent(errorEvent);
}
public function stop():void{
if (_isLoaded){
return;
};
status = STATUS_STOPPED;
_isLoading = false;
}
public function isSound():Boolean{
return (false);
}
public function onCompleteHandler(_arg1:Event):void{
_totalTime = getTimer();
_timeToDownload = ((_totalTime - _responseTime) / 1000);
if (_timeToDownload == 0){
_timeToDownload = 0.2;
};
_speed = BulkLoader.truncateNumber(((bytesTotal / 0x0400) / _timeToDownload));
if (_timeToDownload == 0){
_speed = 3000;
};
status = STATUS_FINISHED;
_isLoaded = true;
dispatchEvent(_arg1);
_arg1.stopPropagation();
}
public function get weightPercentLoaded():Number{
return (_weightPercentLoaded);
}
public function get id():String{
return (_id);
}
public function _dispatchErrorEvent(_arg1:ErrorEvent):void{
status = STATUS_ERROR;
dispatchEvent(new ErrorEvent(BulkLoader.ERROR, true, false, _arg1.text));
}
public function onHttpStatusHandler(_arg1:HTTPStatusEvent):void{
_httpStatus = _arg1.status;
dispatchEvent(_arg1);
}
public function get totalTime():int{
return (_totalTime);
}
public function get type():String{
return (_type);
}
public function get speed():Number{
return (_speed);
}
public function _parseOptions(_arg1:Object):Array{
var _local3:String;
preventCache = _arg1[BulkLoader.PREVENT_CACHING];
_id = _arg1[BulkLoader.ID];
_priority = ((int(_arg1[BulkLoader.PRIORITY])) || (0));
maxTries = ((_arg1[BulkLoader.MAX_TRIES]) || (3));
weight = ((int(_arg1[BulkLoader.WEIGHT])) || (1));
var _local2:Array = BulkLoader.GENERAL_AVAILABLE_PROPS.concat(specificAvailableProps);
propertyParsingErrors = [];
for (_local3 in _arg1) {
if (_local2.indexOf(_local3) == -1){
propertyParsingErrors.push(((((this + ": got a wrong property name: ") + _local3) + ", with value:") + _arg1[_local3]));
};
};
return (propertyParsingErrors);
}
public function get startTime():int{
return (_startTime);
}
public function get bytesLoaded():int{
return (_bytesLoaded);
}
public function isImage():Boolean{
return (false);
}
public function onStartedHandler(_arg1:Event):void{
_responseTime = getTimer();
_latency = BulkLoader.truncateNumber(((_responseTime - _startTime) / 1000));
status = STATUS_STARTED;
dispatchEvent(_arg1);
}
override public function toString():String{
return (((((("LoadingItem url: " + url.url) + ", type:") + _type) + ", status: ") + status));
}
public function isVideo():Boolean{
return (false);
}
public function isText():Boolean{
return (false);
}
public function get content(){
return (_content);
}
public function onProgressHandler(_arg1):void{
_bytesLoaded = _arg1.bytesLoaded;
_bytesTotal = _arg1.bytesTotal;
_bytesRemaining = (_bytesTotal - bytesLoaded);
_percentLoaded = (_bytesLoaded / _bytesTotal);
_weightPercentLoaded = (_percentLoaded * weight);
dispatchEvent(_arg1);
}
public function isXML():Boolean{
return (false);
}
public function get bytesTotal():int{
return (_bytesTotal);
}
public function get httpStatus():int{
return (_httpStatus);
}
public function onErrorHandler(_arg1:ErrorEvent):void{
numTries++;
_arg1.stopPropagation();
if (numTries < maxTries){
status = null;
load();
} else {
status = STATUS_ERROR;
errorEvent = _arg1;
_dispatchErrorEvent(errorEvent);
};
}
public function isStreamable():Boolean{
return (false);
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function get responseTime():Number{
return (_responseTime);
}
public function get priority():int{
return (_priority);
}
public function get bytesRemaining():int{
return (_bytesRemaining);
}
public function get isLoaded():Boolean{
return (_isLoaded);
}
public function get timeToDownload():int{
return (_timeToDownload);
}
public function isLoader():Boolean{
return (false);
}
public function load():void{
var _local1:String;
if (preventCache){
_local1 = ((("BulkLoaderNoCache=" + _uid) + "_") + int(((Math.random() * 100) * getTimer())));
if (url.url.indexOf("?") == -1){
url.url = (url.url + ("?" + _local1));
} else {
url.url = (url.url + ("&" + _local1));
};
};
_isLoading = true;
_startTime = getTimer();
}
public function getStats():String{
return ((((((((((("Item url:" + url.url) + ", total time: ") + _timeToDownload) + "(s), latency:") + _latency) + "(s), speed: ") + _speed) + " kb/s, size: ") + BulkLoader.truncateNumber((_bytesTotal / 0x0400))) + " kb"));
}
public function get addedTime():int{
return (_addedTime);
}
public function _createErrorEvent(_arg1:Error):ErrorEvent{
return (new ErrorEvent(BulkLoader.ERROR, false, false, _arg1.message));
}
public function cleanListeners():void{
}
public function isSWF():Boolean{
return (false);
}
public function destroy():void{
_content = null;
}
public function get latency():Number{
return (_latency);
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 179
//SoundItem (br.com.stimuli.loading.loadingtypes.SoundItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import br.com.stimuli.loading.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.display.*;
public class SoundItem extends LoadingItem {
public var loader:Sound;
public function SoundItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CONTEXT];
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:ErrorEvent):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function isStreamable():Boolean{
return (true);
}
override public function isSound():Boolean{
return (true);
}
override public function load():void{
super.load();
loader = new Sound();
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false, 0, true);
try {
loader.load(url, _context);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function onStartedHandler(_arg1:Event):void{
_content = loader;
super.onStartedHandler(_arg1);
}
override public function destroy():void{
cleanListeners();
stop();
_content = null;
loader = null;
}
override public function _parseOptions(_arg1:Object):Array{
_context = ((_arg1[BulkLoader.CONTEXT]) || (null));
return (super._parseOptions(_arg1));
}
override public function onCompleteHandler(_arg1:Event):void{
_content = loader;
super.onCompleteHandler(_arg1);
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false);
};
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 180
//URLItem (br.com.stimuli.loading.loadingtypes.URLItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import br.com.stimuli.loading.*;
import flash.net.*;
public class URLItem extends LoadingItem {
public var loader:URLLoader;
public function URLItem(_arg1:URLRequest, _arg2:String, _arg3:String){
super(_arg1, _arg2, _arg3);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
};
}
override public function load():void{
super.load();
loader = new URLLoader();
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, super.onErrorHandler, false, 0, true);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
try {
loader.load(url);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function isText():Boolean{
return (true);
}
override public function onStartedHandler(_arg1:Event):void{
super.onStartedHandler(_arg1);
}
override public function onCompleteHandler(_arg1:Event):void{
_content = loader.data;
super.onCompleteHandler(_arg1);
}
override public function _parseOptions(_arg1:Object):Array{
return (super._parseOptions(_arg1));
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 181
//VideoItem (br.com.stimuli.loading.loadingtypes.VideoItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import br.com.stimuli.loading.*;
import flash.utils.*;
import flash.net.*;
import flash.display.*;
public class VideoItem extends LoadingItem {
public var stream:NetStream;
public var dummyEventTrigger:Sprite;
public var pausedAtStart:Boolean;// = false
public var _metaData:Object;
public var _canBeginStreaming:Boolean;// = false
private var nc:NetConnection;
public var _checkPolicyFile:Boolean;
public function VideoItem(_arg1:URLRequest, _arg2:String, _arg3:String){
specificAvailableProps = [BulkLoader.CHECK_POLICY_FILE, BulkLoader.PAUSED_AT_START];
super(_arg1, _arg2, _arg3);
_bytesTotal = (_bytesLoaded = 0);
}
public function get checkPolicyFile():Object{
return (_checkPolicyFile);
}
override public function onStartedHandler(_arg1:Event):void{
_content = stream;
if (((pausedAtStart) && (stream))){
stream.pause();
};
super.onStartedHandler(_arg1);
}
override public function stop():void{
try {
if (stream){
stream.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function _parseOptions(_arg1:Object):Array{
pausedAtStart = ((_arg1[BulkLoader.PAUSED_AT_START]) || (false));
_checkPolicyFile = ((_arg1[BulkLoader.CHECK_POLICY_FILE]) || (false));
return (super._parseOptions(_arg1));
}
private function fireCanBeginStreamingEvent():void{
if (_canBeginStreaming){
return;
};
_canBeginStreaming = true;
var _local1:Event = new Event(BulkLoader.CAN_BEGIN_PLAYING);
dispatchEvent(_local1);
}
public function get metaData():Object{
return (_metaData);
}
function onNetStatus(_arg1:NetStatusEvent):void{
var _local2:Event;
if (!stream){
return;
};
stream.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false);
if (_arg1.info.code == "NetStream.Play.Start"){
_content = stream;
_local2 = new Event(Event.OPEN);
onStartedHandler(_local2);
} else {
if (_arg1.info.code == "NetStream.Play.StreamNotFound"){
onErrorHandler(_createErrorEvent(new Error(("[VideoItem] NetStream not found at " + this.url.url))));
};
};
}
override public function isStreamable():Boolean{
return (true);
}
override public function load():void{
super.load();
nc = new NetConnection();
nc.connect(null);
stream = new NetStream(nc);
stream.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
stream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false, 0, true);
dummyEventTrigger = new Sprite();
dummyEventTrigger.addEventListener(Event.ENTER_FRAME, createNetStreamEvent, false, 0, true);
var customClient:Object = new Object();
customClient.onCuePoint = function (... _args):void{
};
customClient.onMetaData = onVideoMetadata;
customClient.onPlayStatus = function (... _args):void{
};
stream.client = customClient;
try {
stream.play(url.url, _checkPolicyFile);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
stream.seek(0);
}
public function get canBeginStreaming():Boolean{
return (_canBeginStreaming);
}
function onVideoMetadata(_arg1):void{
_metaData = _arg1;
}
override public function onCompleteHandler(_arg1:Event):void{
_content = stream;
super.onCompleteHandler(_arg1);
}
override public function cleanListeners():void{
if (stream){
stream.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
stream.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus, false);
};
if (dummyEventTrigger){
dummyEventTrigger.removeEventListener(Event.ENTER_FRAME, createNetStreamEvent, false);
dummyEventTrigger = null;
};
}
override public function isVideo():Boolean{
return (true);
}
public function createNetStreamEvent(_arg1:Event):void{
var _local2:Event;
var _local3:Event;
var _local4:ProgressEvent;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
if ((((_bytesTotal == _bytesLoaded)) && ((_bytesTotal > 8)))){
if (dummyEventTrigger){
dummyEventTrigger.removeEventListener(Event.ENTER_FRAME, createNetStreamEvent, false);
};
fireCanBeginStreamingEvent();
_local2 = new Event(Event.COMPLETE);
onCompleteHandler(_local2);
} else {
if ((((((_bytesTotal == 0)) && (stream))) && ((stream.bytesTotal > 4)))){
_local3 = new Event(Event.OPEN);
onStartedHandler(_local3);
_bytesLoaded = stream.bytesLoaded;
_bytesTotal = stream.bytesTotal;
} else {
if (stream){
_local4 = new ProgressEvent(ProgressEvent.PROGRESS, false, false, stream.bytesLoaded, stream.bytesTotal);
if (((((isVideo()) && (metaData))) && (!(_canBeginStreaming)))){
_local5 = (getTimer() - responseTime);
if (_local5 > 100){
_local6 = (bytesLoaded / (_local5 / 1000));
_bytesRemaining = (_bytesTotal - bytesLoaded);
_local7 = (_bytesRemaining / (_local6 * 0.8));
_local8 = (metaData.duration - stream.bufferLength);
if (_local8 > _local7){
fireCanBeginStreamingEvent();
};
};
};
super.onProgressHandler(_local4);
};
};
};
}
override public function destroy():void{
if (stream){
};
stop();
cleanListeners();
stream = null;
super.destroy();
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 182
//XMLItem (br.com.stimuli.loading.loadingtypes.XMLItem)
package br.com.stimuli.loading.loadingtypes {
import flash.events.*;
import br.com.stimuli.loading.*;
import flash.net.*;
public class XMLItem extends LoadingItem {
public var loader:URLLoader;
public function XMLItem(_arg1:URLRequest, _arg2:String, _arg3:String){
super(_arg1, _arg2, _arg3);
}
override public function onErrorHandler(_arg1:ErrorEvent):void{
super.onErrorHandler(_arg1);
}
override public function stop():void{
try {
if (loader){
loader.close();
};
} catch(e:Error) {
};
super.stop();
}
override public function cleanListeners():void{
if (loader){
loader.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler, false);
loader.removeEventListener(Event.COMPLETE, onCompleteHandler, false);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false);
loader.removeEventListener(BulkLoader.OPEN, onStartedHandler, false);
loader.removeEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false);
loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false);
};
}
override public function load():void{
super.load();
loader = new URLLoader();
loader.addEventListener(ProgressEvent.PROGRESS, onProgressHandler, false, 0, true);
loader.addEventListener(Event.COMPLETE, onCompleteHandler, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onErrorHandler, false, 0, true);
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, super.onHttpStatusHandler, false, 0, true);
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false, 0, true);
loader.addEventListener(Event.OPEN, onStartedHandler, false, 0, true);
try {
loader.load(url);
} catch(e:SecurityError) {
onSecurityErrorHandler(_createErrorEvent(e));
};
}
override public function isText():Boolean{
return (true);
}
override public function onStartedHandler(_arg1:Event):void{
super.onStartedHandler(_arg1);
}
override public function onCompleteHandler(_arg1:Event):void{
var evt = _arg1;
try {
_content = new XML(loader.data);
} catch(e:Error) {
_content = null;
status = STATUS_ERROR;
dispatchEvent(_createErrorEvent(e));
};
super.onCompleteHandler(evt);
}
override public function _parseOptions(_arg1:Object):Array{
return (super._parseOptions(_arg1));
}
override public function destroy():void{
stop();
cleanListeners();
_content = null;
loader = null;
}
}
}//package br.com.stimuli.loading.loadingtypes
Section 183
//BulkLoader (br.com.stimuli.loading.BulkLoader)
package br.com.stimuli.loading {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import br.com.stimuli.loading.loadingtypes.*;
import flash.media.*;
import flash.display.*;
public class BulkLoader extends EventDispatcher {
public var _itemsTotal:int;// = 0
public var speedAvg:Number;
public var _numConnections:int;// = 7
public var _totalWeight:int;// = 0
public var _bytesTotalCurrent:int;// = 0
public var _itemsLoaded:int;// = 0
public var totalTime:Number;
public var _additionIndex:int;// = 0
public var _bytesTotal:int;// = 0
public var _loadedRatio:Number;// = 0
public var _speed:Number;
public var _lastSpeedCheck:int;
public var _isPaused:Boolean;// = true
public var _isFinished:Boolean;
public var _name:String;
public var _allowsAutoIDFromFileName:Boolean;// = false
public var _contents:Dictionary;
public var _logFunction:Function;
public var _bytesLoaded:int;// = 0
public var _connections:Array;
public var logLevel:int;// = 4
public var _percentLoaded:Number;// = 0
public var _weightPercent:Number;
public var _lastBytesCheck:int;
public var _isRunning:Boolean;
public var _id:int;
public var _items:Array;
public var _stringSubstitutions:Object;
public var avgLatency:Number;
public var _startTime:int;
public var _speedTotal:Number;
public var _endTIme:int;
public static const CAN_BEGIN_PLAYING:String = "canBeginPlaying";
public static const TYPE_VIDEO:String = "video";
public static const PREVENT_CACHING:String = "preventCache";
public static const TYPE_TEXT:String = "text";
public static const ID:String = "id";
public static const PAUSED_AT_START:String = "pausedAtStart";
public static const SECURITY_ERROR:String = "securityError";
public static const LOG_WARNINGS:int = 3;
public static const PROGRESS:String = "progress";
public static const COMPLETE:String = "complete";
public static const AVAILABLE_TYPES:Array = [TYPE_VIDEO, TYPE_XML, TYPE_TEXT, TYPE_SOUND, TYPE_MOVIECLIP, TYPE_IMAGE, TYPE_BINARY];
public static const LOG_VERBOSE:int = 0;
public static const OPEN:String = "open";
public static const HEADERS:String = "headers";
public static const TYPE_XML:String = "xml";
public static const HTTP_STATUS:String = "httpStatus";
public static const CONTEXT:String = "context";
public static const WEIGHT:String = "weight";
public static const CHECK_POLICY_FILE:String = "checkPolicyFile";
public static const TYPE_MOVIECLIP:String = "movieclip";
public static const PRIORITY:String = "priority";
public static const TYPE_BINARY:String = "binary";
public static const TYPE_SOUND:String = "sound";
public static const MAX_TRIES:String = "maxTries";
public static const VERSION:String = "$Id$";
public static const GENERAL_AVAILABLE_PROPS:Array = [WEIGHT, MAX_TRIES, HEADERS, ID, PRIORITY, PREVENT_CACHING, "type"];
public static const DEFAULT_NUM_CONNECTIONS:int = 7;
public static const LOG_SILENT:int = 10;
public static const ERROR:String = "error";
public static const LOG_INFO:int = 2;
public static const DEFAULT_LOG_LEVEL:int = 4;
public static const LOG_ERRORS:int = 4;
public static const TYPE_IMAGE:String = "image";
public static var MOVIECLIP_EXTENSIONS:Array = ["swf"];
public static var XML_EXTENSIONS:Array = ["xml"];
public static var SOUND_EXTENSIONS:Array = ["mp3", "f4a", "f4b"];
public static var TEXT_EXTENSIONS:Array = ["txt", "js", "php", "asp", "py"];
public static var AVAILABLE_EXTENSIONS:Array = ["swf", "jpg", "jpeg", "gif", "png", "flv", "mp3", "xml", "txt", "js"];
public static var _allLoaders:Object = {};
public static var VIDEO_EXTENSIONS:Array = ["flv", "f4v", "f4p", "mp4"];
public static var IMAGE_EXTENSIONS:Array = ["jpg", "jpeg", "gif", "png"];
public static var _customTypesExtensions:Object;
public static var _typeClasses:Object = {image:ImageItem, movieclip:ImageItem, xml:XMLItem, video:VideoItem, sound:SoundItem, text:URLItem, binary:BinaryItem};
public static var _instancesCreated:int = 0;
public function BulkLoader(_arg1:String, _arg2:int=7, _arg3:int=4){
var name = _arg1;
var numConnections = _arg2;
var logLevel = _arg3;
_items = [];
_contents = new Dictionary(true);
_logFunction = trace;
super();
if (Boolean(_allLoaders[name])){
__debug_print_loaders();
throw (new Error((("BulkLoader with name'" + name) + "' has already been created.")));
};
if (!name){
throw (new Error("Cannot create a BulkLoader instance without a name"));
};
_allLoaders[name] = this;
if (numConnections > 0){
this._numConnections = numConnections;
};
this.logLevel = logLevel;
_name = name;
_instancesCreated++;
_id = _instancesCreated;
_additionIndex = 0;
addEventListener(BulkLoader.ERROR, function (_arg1:Event):void{
}, false, 1, true);
}
public function get allowsAutoIDFromFileName():Boolean{
return (_allowsAutoIDFromFileName);
}
public function set allowsAutoIDFromFileName(_arg1:Boolean):void{
_allowsAutoIDFromFileName = _arg1;
}
public function get loadedRatio():Number{
return (_loadedRatio);
}
public function loadNow(_arg1):Boolean{
var _local3:LoadingItem;
var _local2:LoadingItem = get(_arg1);
if (!_local2){
return (false);
};
if (!_connections){
_connections = [];
};
if ((((_local2.status == LoadingItem.STATUS_FINISHED)) || ((_local2.status == LoadingItem.STATUS_STARTED)))){
return (true);
};
if (_connections.length >= numConnections){
_local3 = _getLeastUrgentOpenedItem();
pause(_local3);
_removeFromConnections(_local3);
_local3.status = null;
};
_local2._priority = highestPriority;
_loadNext(_local2);
return (true);
}
public function _onItemComplete(_arg1:Event):void{
var _local2:LoadingItem = (_arg1.target as LoadingItem);
_removeFromConnections(_local2);
log("Loaded ", _local2, LOG_INFO);
log("Items to load", getNotLoadedItems(), LOG_VERBOSE);
_local2.cleanListeners();
_contents[_local2.url.url] = _local2.content;
var _local3:Boolean = _loadNext();
var _local4:Boolean = _isAllDoneP();
_itemsLoaded++;
if (_local4){
_onAllLoaded();
};
}
public function _getContentAsType(_arg1, _arg2:Class, _arg3:Boolean=false){
var res:*;
var key = _arg1;
var type = _arg2;
var clearMemory = _arg3;
if (!_name){
throw (new Error("[BulkLoader] Cannot use an instance that has been cleared from memory (.clear())"));
};
var item:LoadingItem = get(key);
if (!item){
return (null);
};
try {
if (((item._isLoaded) || (((item.isStreamable()) && ((item.status == LoadingItem.STATUS_STARTED)))))){
res = (item.content as type);
if (res == null){
throw (new Error("bad cast"));
};
if (clearMemory){
remove(key);
};
return (res);
};
} catch(e:Error) {
log((("Failed to get content with url: '" + key) + "'as type:"), type, LOG_ERRORS);
};
return (null);
}
public function set stringSubstitutions(_arg1:Object):void{
_stringSubstitutions = _arg1;
}
public function get contents():Object{
return (_contents);
}
public function get id():int{
return (_id);
}
public function getBitmap(_arg1:String, _arg2:Boolean=false):Bitmap{
return (Bitmap(_getContentAsType(_arg1, Bitmap, _arg2)));
}
public function _removeFromConnections(_arg1):Boolean{
if (!_connections){
return (false);
};
var _local2:int = _connections.indexOf(_arg1);
if (_local2 > -1){
_connections.splice(_local2, 1);
return (true);
};
return (false);
}
public function resume(_arg1):Boolean{
var _local2:LoadingItem = ((_arg1 is LoadingItem)) ? _arg1 : get(_arg1);
_isPaused = false;
if (((_local2) && ((_local2.status == LoadingItem.STATUS_STOPPED)))){
_local2.status = null;
_loadNext();
return (true);
};
return (false);
}
public function _onAllLoaded():void{
if (_isFinished){
return;
};
var _local1:BulkProgressEvent = new BulkProgressEvent(COMPLETE);
_local1.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
var _local2:BulkProgressEvent = new BulkProgressEvent(PROGRESS);
_local2.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, _itemsLoaded, itemsTotal, weightPercent);
_isRunning = false;
_endTIme = getTimer();
totalTime = BulkLoader.truncateNumber(((_endTIme - _startTime) / 1000));
_updateStats();
_connections = [];
getStats();
_isFinished = true;
log("Finished all", LOG_INFO);
dispatchEvent(_local2);
dispatchEvent(_local1);
}
public function removePausedItems():Boolean{
var stoppedLoads:Array = _items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_STOPPED));
});
stoppedLoads.forEach(function (_arg1:LoadingItem, ... _args):void{
remove(_arg1);
});
_loadNext();
return ((stoppedLoads.length > 0));
}
public function resumeAll():Boolean{
log("Resuming all items", LOG_VERBOSE);
var affected:Boolean;
_items.forEach(function (_arg1:LoadingItem, ... _args):void{
if (_arg1.status == LoadingItem.STATUS_STOPPED){
resume(_arg1);
affected = true;
};
});
_loadNext();
return (affected);
}
public function get isRunning():Boolean{
return (_isRunning);
}
public function getNetStreamMetaData(_arg1:String, _arg2:Boolean=false):Object{
var _local3:NetStream = getNetStream(_arg1, _arg2);
return ((Boolean(_local3)) ? (get(_arg1) as Object).metaData : null);
}
public function get logFunction():Function{
return (_logFunction);
}
public function getProgressForItems(_arg1:Array):BulkProgressEvent{
var _local11:LoadingItem;
var _local13:*;
_bytesLoaded = (_bytesTotal = (_bytesTotalCurrent = 0));
var _local2:Number = 0;
var _local3:int;
var _local4:int;
var _local5:Number = 0;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local12:Array = [];
for each (_local13 in _arg1) {
_local11 = get(_local13);
if (!_local11){
} else {
_local6++;
_local3 = (_local3 + _local11.weight);
if ((((((_local11.status == LoadingItem.STATUS_STARTED)) || ((_local11.status == LoadingItem.STATUS_FINISHED)))) || ((_local11.status == LoadingItem.STATUS_STOPPED)))){
_local8 = (_local8 + _local11._bytesLoaded);
_local10 = (_local10 + _local11._bytesTotal);
_local5 = (_local5 + ((_local11._bytesLoaded / _local11._bytesTotal) * _local11.weight));
if (_local11.status == LoadingItem.STATUS_FINISHED){
_local7++;
};
_local4++;
};
};
};
if (_local4 != _local6){
_local9 = Number.POSITIVE_INFINITY;
} else {
_local9 = _local10;
};
_local2 = (_local5 / _local3);
if (_local3 == 0){
_local2 = 0;
};
var _local14:BulkProgressEvent = new BulkProgressEvent(PROGRESS);
_local14.setInfo(_local8, _local9, _local9, _local7, _local6, _local2);
return (_local14);
}
public function getContent(_arg1:String, _arg2:Boolean=false){
return (_getContentAsType(_arg1, Object, _arg2));
}
public function getSerializedData(_arg1, _arg2:Boolean=false, _arg3:Function=null){
var raw:*;
var parsed:*;
var key = _arg1;
var clearMemory = _arg2;
var encodingFunction = _arg3;
try {
raw = _getContentAsType(key, Object, clearMemory);
parsed = encodingFunction.apply(null, [raw]);
return (parsed);
} catch(e:Error) {
log("Failed to parse key:", key, ("with encodingFunction:" + encodingFunction), LOG_ERRORS);
};
return (null);
}
public function log(... _args):void{
var _local2:int = (isNaN(_args[(_args.length - 1)])) ? 3 : int(_args.pop());
if (_local2 >= logLevel){
_logFunction(("[BulkLoader] " + _args.join(" ")));
};
}
public function clear():void{
removeAll();
delete _allLoaders[name];
_name = null;
}
public function get speed():Number{
var _local1:int = (getTimer() - _lastSpeedCheck);
var _local2:int = ((bytesLoaded - _lastBytesCheck) / 0x0400);
var _local3:int = (_local2 / (_local1 / 1000));
_lastSpeedCheck = _local1;
_lastBytesCheck = bytesLoaded;
return (_local3);
}
public function get bytesLoaded():int{
return (_bytesLoaded);
}
public function getFailedItems():Array{
return (_items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_ERROR));
}));
}
public function _loadNext(_arg1:LoadingItem=null):Boolean{
var checkItem:LoadingItem;
var toLoad = _arg1;
if (_isFinished){
return (false);
};
if (!_connections){
_connections = [];
};
_connections.forEach(function (_arg1:LoadingItem, ... _args):void{
if ((((_arg1.status == LoadingItem.STATUS_ERROR)) && ((_arg1.numTries < _arg1.maxTries)))){
_removeFromConnections(_arg1);
};
});
var next:Boolean;
if (!toLoad){
for each (checkItem in _items) {
if (((!(checkItem._isLoading)) && (!((checkItem.status == LoadingItem.STATUS_STOPPED))))){
toLoad = checkItem;
break;
};
};
};
if (toLoad){
next = true;
_isRunning = true;
if (_connections.length < numConnections){
_connections.push(toLoad);
toLoad.load();
log("Will load item:", toLoad, LOG_INFO);
};
if (_connections.length < numConnections){
_loadNext();
};
};
return (next);
}
public function getSound(_arg1, _arg2:Boolean=false):Sound{
return (Sound(_getContentAsType(_arg1, Sound, _arg2)));
}
public function removeFailedItems():int{
var numCleared:int;
var badItems:Array = _items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return ((_arg1.status == LoadingItem.STATUS_ERROR));
});
numCleared = badItems.length;
badItems.forEach(function (_arg1:LoadingItem, ... _args):void{
remove(_arg1);
});
_loadNext();
return (numCleared);
}
public function get(_arg1):LoadingItem{
var _local2:LoadingItem;
if (!_arg1){
return (null);
};
if ((_arg1 is LoadingItem)){
return (_arg1);
};
for each (_local2 in _items) {
if ((((((((_local2._id == _arg1)) || ((_local2.url.url == _arg1)))) || ((_local2.url == _arg1)))) || ((((_arg1 is URLRequest)) && ((_local2.url.url == _arg1.url)))))){
return (_local2);
};
};
return (null);
}
public function get highestPriority():int{
var _local2:LoadingItem;
var _local1:int = int.MIN_VALUE;
for each (_local2 in _items) {
if (_local2.priority > _local1){
_local1 = _local2.priority;
};
};
return (_local1);
}
public function start(_arg1:int=-1):void{
if (_arg1 > 0){
_numConnections = _arg1;
};
if (_connections){
_loadNext();
return;
};
_startTime = getTimer();
_connections = [];
_loadNext();
_isRunning = true;
_lastBytesCheck = 0;
_lastSpeedCheck = getTimer();
_isPaused = false;
}
public function _getLeastUrgentOpenedItem():LoadingItem{
var _local1:LoadingItem = LoadingItem(_connections.sortOn(["priority", "bytesRemaining", "_additionIndex"], [Array.NUMERIC, Array.DESCENDING, Array.NUMERIC, Array.NUMERIC])[0]);
return (_local1);
}
public function get itemsTotal():int{
return (items.length);
}
public function getBitmapData(_arg1, _arg2:Boolean=false):BitmapData{
var key = _arg1;
var clearMemory = _arg2;
try {
return (getBitmap(key, clearMemory).bitmapData);
} catch(e:Error) {
log("Failed to get bitmapData with url:", key, LOG_ERRORS);
};
return (null);
}
public function set logFunction(_arg1:Function):void{
_logFunction = _arg1;
}
override public function toString():String{
return (((((("[BulkLoader] name:" + name) + ", itemsTotal: ") + itemsTotal) + ", itemsLoaded: ") + _itemsLoaded));
}
public function sortItemsByPriority():void{
_items.sortOn(["priority", "_additionIndex"], [(Array.NUMERIC | Array.DESCENDING), Array.NUMERIC]);
}
public function get stringSubstitutions():Object{
return (_stringSubstitutions);
}
public function get name():String{
return (_name);
}
public function remove(_arg1, _arg2:Boolean=false):Boolean{
var item:LoadingItem;
var allDone:Boolean;
var key = _arg1;
var internalCall = _arg2;
try {
item = get(key);
if (!item){
return (false);
};
_removeFromItems(item);
_removeFromConnections(item);
item.destroy();
delete _contents[item.url.url];
if (internalCall){
return (true);
};
item = null;
_onProgress();
allDone = _isAllDoneP();
if (allDone){
_onAllLoaded();
};
return (true);
} catch(e:Error) {
log(("Error while removing item from key:" + key), e.getStackTrace(), LOG_ERRORS);
};
return (false);
}
public function removeAll():void{
var _local1:LoadingItem;
for each (_local1 in _items.slice()) {
remove(_local1, true);
};
_items = [];
_connections = [];
_contents = new Dictionary();
}
public function _updateStats():void{
var _local4:LoadingItem;
avgLatency = 0;
speedAvg = 0;
var _local1:Number = 0;
var _local2:int;
_speedTotal = 0;
var _local3:Number = 0;
for each (_local4 in _items) {
if (((_local4._isLoaded) && (!((_local4.status == LoadingItem.STATUS_ERROR))))){
_local1 = (_local1 + _local4.latency);
_local2 = (_local2 + _local4.bytesTotal);
_local3++;
};
};
_speedTotal = ((_local2 / 0x0400) / totalTime);
avgLatency = (_local1 / _local3);
speedAvg = (_speedTotal / _local3);
}
public function reload(_arg1):Boolean{
var _local2:LoadingItem = get(_arg1);
if (!_local2){
return (false);
};
_removeFromItems(_local2);
_removeFromConnections(_local2);
_local2.stop();
_local2.cleanListeners();
_local2.status = null;
_isFinished = false;
_local2._addedTime = getTimer();
_local2._additionIndex = _additionIndex++;
_local2.addEventListener(Event.COMPLETE, _onItemComplete, false, int.MIN_VALUE, true);
_local2.addEventListener(ERROR, _onItemError, false, 0, true);
_local2.addEventListener(Event.OPEN, _onItemStarted, false, 0, true);
_local2.addEventListener(ProgressEvent.PROGRESS, _onProgress, false, 0, true);
_items.push(_local2);
_itemsTotal = (_itemsTotal + 1);
_totalWeight = (_totalWeight + _local2.weight);
sortItemsByPriority();
_isFinished = false;
loadNow(_local2);
return (true);
}
public function _onItemStarted(_arg1:Event):void{
var _local2:LoadingItem = (_arg1.target as LoadingItem);
log("Started loading", _local2, LOG_INFO);
dispatchEvent(_arg1);
}
public function add(_arg1, _arg2:Object=null):LoadingItem{
var _local4:String;
var _local6:String;
if (!_name){
throw (new Error("[BulkLoader] Cannot use an instance that has been cleared from memory (.clear())"));
};
if (((!(_arg1)) || (!(String(_arg1))))){
throw (new Error("[BulkLoader] Cannot add an item with a null url"));
};
_arg2 = ((_arg2) || ({}));
if ((_arg1 is String)){
_arg1 = new URLRequest(BulkLoader.substituteURLString(_arg1, _stringSubstitutions));
if (_arg2[HEADERS]){
_arg1.requestHeaders = _arg2[HEADERS];
};
} else {
if ((!(_arg1) is URLRequest)){
throw (new Error(("[BulkLoader] cannot add object with bad type for url:'" + _arg1.url)));
};
};
var _local3:LoadingItem = get(_arg2[ID]);
if (_local3){
log((("Add received an already added id: " + _arg2[ID]) + ", not adding a new item"));
return (_local3);
};
if (_arg2["type"]){
_local4 = _arg2["type"].toLowerCase();
if (AVAILABLE_TYPES.indexOf(_local4) == -1){
log("add received an unknown type:", _local4, "and will cast it to text", LOG_WARNINGS);
};
};
if (!_local4){
_local4 = guessType(_arg1.url);
};
_additionIndex++;
_local3 = new _typeClasses[_local4](_arg1, _local4, ((_instancesCreated + "_") + String(_additionIndex)));
if (((!(_arg2["id"])) && (_allowsAutoIDFromFileName))){
_arg2["id"] = getFileName(_arg1.url);
log("Adding automatic id from file name for item:", _local3, (("( id= " + _arg2["id"]) + " )"));
};
var _local5:Array = _local3._parseOptions(_arg2);
for each (_local6 in _local5) {
log(_local6, LOG_WARNINGS);
};
log("Added", _local3, LOG_VERBOSE);
_local3._addedTime = getTimer();
_local3._additionIndex = _additionIndex;
_local3.addEventListener(Event.COMPLETE, _onItemComplete, false, int.MIN_VALUE, true);
_local3.addEventListener(ERROR, _onItemError, false, 0, true);
_local3.addEventListener(Event.OPEN, _onItemStarted, false, 0, true);
_local3.addEventListener(ProgressEvent.PROGRESS, _onProgress, false, 0, true);
_items.push(_local3);
_itemsTotal = (_itemsTotal + 1);
_totalWeight = (_totalWeight + _local3.weight);
sortItemsByPriority();
_isFinished = false;
if (!_isPaused){
_loadNext();
};
return (_local3);
}
public function getText(_arg1, _arg2:Boolean=false):String{
return (String(_getContentAsType(_arg1, String, _arg2)));
}
public function get bytesTotal():int{
return (_bytesTotal);
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function get weightPercent():Number{
return (_weightPercent);
}
public function get bytesTotalCurrent():int{
return (_bytesTotalCurrent);
}
public function getAVM1Movie(_arg1:String, _arg2:Boolean=false):AVM1Movie{
return (AVM1Movie(_getContentAsType(_arg1, AVM1Movie, _arg2)));
}
public function get isFinished():Boolean{
return (_isFinished);
}
public function changeItemPriority(_arg1:String, _arg2:int):Boolean{
var _local3:LoadingItem = get(_arg1);
if (!_local3){
return (false);
};
_local3._priority = _arg2;
sortItemsByPriority();
return (true);
}
public function get items():Array{
return (_items.slice());
}
public function getNetStream(_arg1:String, _arg2:Boolean=false):NetStream{
return (NetStream(_getContentAsType(_arg1, NetStream, _arg2)));
}
public function getHttpStatus(_arg1):int{
var _local2:LoadingItem = get(_arg1);
if (_local2){
return (_local2.httpStatus);
};
return (-1);
}
public function set itemsLoaded(_arg1:int):void{
_itemsLoaded = _arg1;
}
public function _onProgress(_arg1:Event=null):void{
var _local2:BulkProgressEvent = getProgressForItems(_items);
_bytesLoaded = _local2.bytesLoaded;
_bytesTotal = _local2.bytesTotal;
_weightPercent = _local2.weightPercent;
_percentLoaded = _local2.percentLoaded;
_bytesTotalCurrent = _local2.bytesTotalCurrent;
_loadedRatio = _local2.ratioLoaded;
dispatchEvent(_local2);
}
public function hasItem(_arg1, _arg2:Boolean=true):Boolean{
var _local3:*;
var _local4:BulkLoader;
if (_arg2){
_local3 = _allLoaders;
} else {
_local3 = [this];
};
for each (_local4 in _local3) {
if (_hasItemInBulkLoader(_arg1, _local4)){
return (true);
};
};
return (false);
}
public function _removeFromItems(_arg1:LoadingItem):Boolean{
var _local2:int = _items.indexOf(_arg1);
if (_local2 > -1){
_items.splice(_local2, 1);
} else {
return (false);
};
if (_arg1._isLoaded){
_itemsLoaded--;
};
_itemsTotal--;
_totalWeight = (_totalWeight - _arg1.weight);
log(("Removing " + _arg1), LOG_VERBOSE);
_arg1.removeEventListener(Event.COMPLETE, _onItemComplete, false);
_arg1.removeEventListener(ERROR, _onItemError, false);
_arg1.removeEventListener(Event.OPEN, _onItemStarted, false);
_arg1.removeEventListener(ProgressEvent.PROGRESS, _onProgress, false);
return (true);
}
public function _isAllDoneP():Boolean{
return (_items.every(function (_arg1:LoadingItem, ... _args):Boolean{
return (_arg1._isLoaded);
}));
}
public function _onItemError(_arg1:ErrorEvent):void{
var _local2:LoadingItem = (_arg1.target as LoadingItem);
log(((("After " + _local2.numTries) + " I am giving up on ") + _local2.url.url), LOG_ERRORS);
log("Error loading", _local2, _arg1.text, LOG_ERRORS);
_removeFromConnections(_local2);
_arg1.stopPropagation();
dispatchEvent(_arg1);
}
public function pauseAll():void{
var _local1:LoadingItem;
for each (_local1 in _items) {
pause(_local1);
};
_isRunning = false;
_isPaused = true;
log("Stopping all items", LOG_INFO);
}
public function getNotLoadedItems():Array{
return (_items.filter(function (_arg1:LoadingItem, ... _args):Boolean{
return (!((_arg1.status == LoadingItem.STATUS_FINISHED)));
}));
}
public function getXML(_arg1, _arg2:Boolean=false):XML{
return (XML(_getContentAsType(_arg1, XML, _arg2)));
}
public function get totalWeight():int{
return (_totalWeight);
}
public function get itemsLoaded():int{
return (_itemsLoaded);
}
public function getMovieClip(_arg1:String, _arg2:Boolean=false):MovieClip{
return (MovieClip(_getContentAsType(_arg1, MovieClip, _arg2)));
}
public function getDisplayObjectLoader(_arg1:String, _arg2:Boolean=false):Loader{
return (Loader(_getContentAsType(_arg1, Loader, _arg2)));
}
public function get numConnections():int{
return (_numConnections);
}
public function getStats():String{
var stats:Array = [];
stats.push("\n************************************");
stats.push((("All items loaded(" + itemsTotal) + ")"));
stats.push(("Total time(s): " + totalTime));
stats.push(("Average latency(s): " + truncateNumber(avgLatency)));
stats.push(("Average speed(kb/s): " + truncateNumber(speedAvg)));
stats.push(("Median speed(kb/s): " + truncateNumber(_speedTotal)));
stats.push(("KiloBytes total: " + truncateNumber((bytesTotal / 0x0400))));
var itemsInfo:Array = _items.map(function (_arg1:LoadingItem, ... _args):String{
return (("\t" + _arg1.getStats()));
});
stats.push(itemsInfo.join("\n"));
stats.push("************************************");
var statsString:String = stats.join("\n");
log(statsString, LOG_VERBOSE);
return (statsString);
}
public function pause(_arg1, _arg2:Boolean=false):Boolean{
var _local3:LoadingItem = get(_arg1);
if (!_local3){
return (false);
};
if (_local3.status != LoadingItem.STATUS_FINISHED){
_local3.stop();
};
log("STOPPED ITEM:", _local3, LOG_INFO);
var _local4:Boolean = _removeFromConnections(_local3);
if (_arg2){
_loadNext();
};
return (_local4);
}
public function getBinary(_arg1, _arg2:Boolean=false):ByteArray{
return (ByteArray(_getContentAsType(_arg1, ByteArray, _arg2)));
}
public static function getLoader(_arg1:String):BulkLoader{
return ((BulkLoader._allLoaders[_arg1] as BulkLoader));
}
public static function whichLoaderHasItem(_arg1):BulkLoader{
var _local2:BulkLoader;
for each (_local2 in _allLoaders) {
if (BulkLoader._hasItemInBulkLoader(_arg1, _local2)){
return (_local2);
};
};
return (null);
}
public static function truncateNumber(_arg1:Number, _arg2:int=2):Number{
var _local3:int = Math.pow(10, _arg2);
return ((Math.round((_arg1 * _local3)) / _local3));
}
public static function __debug_printStackTrace():void{
try {
throw (new Error("stack trace"));
} catch(e:Error) {
trace(e.getStackTrace());
};
}
public static function __debug_print_loaders():void{
var instNames:String;
var theNames:Array = [];
for each (instNames in BulkLoader._allLoaders) {
theNames.push(instNames);
};
theNames.sort();
trace("All loaders");
theNames.forEach(function (_arg1, ... _args):void{
trace("\t", _arg1);
});
trace("===========");
}
public static function pauseAllLoaders():void{
var _local1:BulkLoader;
for each (_local1 in _allLoaders) {
_local1.pauseAll();
};
}
public static function _hasItemInBulkLoader(_arg1, _arg2:BulkLoader):Boolean{
var _local3:LoadingItem = _arg2.get(_arg1);
if (_local3){
return (true);
};
return (false);
}
public static function createUniqueNamedLoader(_arg1:int=7, _arg2:int=4):BulkLoader{
return (new BulkLoader(BulkLoader.getUniqueName(), _arg1, _arg2));
}
public static function removeAllLoaders():void{
var _local1:BulkLoader;
for each (_local1 in _allLoaders) {
_local1.removeAll();
_local1.clear();
_local1 = null;
};
_allLoaders = {};
}
public static function getFileName(_arg1:String):String{
if (_arg1.lastIndexOf("/") == (_arg1.length - 1)){
return (getFileName(_arg1.substring(0, (_arg1.length - 1))));
};
var _local2:int = (_arg1.lastIndexOf("/") + 1);
var _local3:String = _arg1.substring(_local2);
var _local4:int = _local3.indexOf(".");
if (_local4 == -1){
if (_local3.indexOf("?") > -1){
_local4 = _local3.indexOf("?");
} else {
_local4 = _local3.length;
};
};
var _local5:String = _local3.substring(0, _local4);
return (_local5);
}
public static function __debug_print_num_loaders():void{
var _local2:String;
var _local1:int;
for each (_local2 in BulkLoader._allLoaders) {
_local1++;
};
trace("BulkLoader has ", _local1, "instances");
}
public static function guessType(_arg1:String):String{
var _local4:String;
var _local5:String;
var _local6:String;
var _local2:String = ((_arg1.indexOf("?") > -1)) ? _arg1.substring(0, _arg1.indexOf("?")) : _arg1;
var _local3:String = _local2.substring((_local2.lastIndexOf(".") + 1)).toLowerCase();
if (!Boolean(_local3)){
_local3 = BulkLoader.TYPE_TEXT;
};
if ((((_local3 == BulkLoader.TYPE_IMAGE)) || ((BulkLoader.IMAGE_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_IMAGE;
} else {
if ((((_local3 == BulkLoader.TYPE_SOUND)) || ((BulkLoader.SOUND_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_SOUND;
} else {
if ((((_local3 == BulkLoader.TYPE_VIDEO)) || ((BulkLoader.VIDEO_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_VIDEO;
} else {
if ((((_local3 == BulkLoader.TYPE_XML)) || ((BulkLoader.XML_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_XML;
} else {
if ((((_local3 == BulkLoader.TYPE_MOVIECLIP)) || ((BulkLoader.MOVIECLIP_EXTENSIONS.indexOf(_local3) > -1)))){
_local4 = BulkLoader.TYPE_MOVIECLIP;
} else {
for (_local5 in _customTypesExtensions) {
for each (_local6 in _customTypesExtensions[_local5]) {
if (_local6 == _local3){
_local4 = _local5;
break;
};
if (_local4){
break;
};
};
};
if (!_local4){
_local4 = BulkLoader.TYPE_TEXT;
};
};
};
};
};
};
return (_local4);
}
public static function registerNewType(_arg1:String, _arg2:String, _arg3:Class):Boolean{
var _local4:Array;
if (_arg1.charAt(0) == "."){
_arg1 = _arg1.substring(1);
};
if (AVAILABLE_TYPES.indexOf(_arg2) == -1){
if (!Boolean(_arg3)){
throw (new Error("[BulkLoader]: When adding a new type and extension, you must determine which class to use"));
};
_typeClasses[_arg2] = _arg3;
if (!_customTypesExtensions){
_customTypesExtensions = {};
};
if (!_customTypesExtensions[_arg2]){
_customTypesExtensions[_arg2] = [];
AVAILABLE_TYPES.push(_arg2);
};
_customTypesExtensions[_arg2].push(_arg1);
return (true);
} else {
_customTypesExtensions[_arg2].push(_arg1);
};
var _local5:Object = {IMAGE_EXTENSIONS:TYPE_IMAGE, VIDEO_EXTENSIONS:TYPE_VIDEO, SOUND_EXTENSIONS:TYPE_SOUND, TEXT_EXTENSIONS:TYPE_TEXT};
_local4 = _local5[_arg2];
if (((_local4) && ((_local4.indexOf(_arg1) == -1)))){
_local4.push(_arg1);
return (true);
};
return (false);
}
public static function substituteURLString(_arg1:String, _arg2:Object):String{
var _local9:Object;
var _local10:Object;
var _local12:String;
if (!_arg2){
return (_arg1);
};
var _local3:RegExp = /(?P<var_name>\{\s*[^\}]*\})/g;
var _local4:Object = _local3.exec(_arg1);
var _local5:String = (_local4) ? _local4.var_name : null;
var _local6:Array = [];
var _local7:int;
while (((Boolean(_local4)) && (Boolean(_local4.var_name)))) {
if (_local4.var_name){
_local5 = _local4.var_name;
_local5 = _local5.replace("{", "");
_local5 = _local5.replace("}", "");
_local5 = _local5.replace(/\s*/g, "");
};
_local6.push({start:_local4.index, end:(_local4.index + _local4.var_name.length), changeTo:_arg2[_local5]});
_local7++;
if (_local7 > 400){
break;
};
_local4 = _local3.exec(_arg1);
_local5 = (_local4) ? _local4.var_name : null;
};
if (_local6.length == 0){
return (_arg1);
};
var _local8:Array = [];
var _local11:String = _arg1.substr(0, _local6[0].start);
for each (_local10 in _local6) {
if (_local9){
_local11 = _arg1.substring(_local9.end, _local10.start);
};
_local8.push(_local11);
_local8.push(_local10.changeTo);
_local9 = _local10;
};
_local8.push(_arg1.substring(_local10.end));
return (_local8.join(""));
}
public static function getUniqueName():String{
return (("BulkLoader-" + _instancesCreated));
}
}
}//package br.com.stimuli.loading
Section 184
//BulkProgressEvent (br.com.stimuli.loading.BulkProgressEvent)
package br.com.stimuli.loading {
import flash.events.*;
public class BulkProgressEvent extends ProgressEvent {
public var bytesTotalCurrent:int;
public var itemsTotal:int;
public var itemsLoaded:int;
public var _percentLoaded:Number;
public var _weightPercent:Number;
public var _ratioLoaded:Number;
public var name:String;
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public function BulkProgressEvent(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
this.name = _arg1;
}
override public function clone():Event{
var _local1:BulkProgressEvent = new BulkProgressEvent(name, bubbles, cancelable);
_local1.setInfo(bytesLoaded, bytesTotal, bytesTotalCurrent, itemsLoaded, itemsTotal, weightPercent);
return (_local1);
}
public function get weightPercent():Number{
return (_weightPercent);
}
public function set ratioLoaded(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_ratioLoaded = _arg1;
}
public function setInfo(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:Number):void{
this.bytesLoaded = _arg1;
this.bytesTotal = _arg2;
this.bytesTotalCurrent = _arg3;
this.itemsLoaded = _arg4;
this.itemsTotal = _arg5;
this.weightPercent = _arg6;
this.percentLoaded = ((_arg2 > 0)) ? (_arg1 / _arg2) : 0;
ratioLoaded = ((_arg5 == 0)) ? 0 : (_arg4 / _arg5);
}
public function set percentLoaded(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_percentLoaded = _arg1;
}
public function loadingStatus():String{
var _local1:Array = [];
_local1.push(("bytesLoaded: " + bytesLoaded));
_local1.push(("bytesTotal: " + bytesTotal));
_local1.push(("itemsLoaded: " + itemsLoaded));
_local1.push(("itemsTotal: " + itemsTotal));
_local1.push(("bytesTotalCurrent: " + bytesTotalCurrent));
_local1.push(("percentLoaded: " + BulkLoader.truncateNumber(percentLoaded)));
_local1.push(("weightPercent: " + BulkLoader.truncateNumber(weightPercent)));
_local1.push(("ratioLoaded: " + BulkLoader.truncateNumber(ratioLoaded)));
return ((("BulkProgressEvent " + _local1.join(", ")) + ";"));
}
public function get ratioLoaded():Number{
return (_ratioLoaded);
}
public function get percentLoaded():Number{
return (_percentLoaded);
}
public function set weightPercent(_arg1:Number):void{
if (((isNaN(_arg1)) || (!(isFinite(_arg1))))){
_arg1 = 0;
};
_weightPercent = _arg1;
}
override public function toString():String{
return (super.toString());
}
}
}//package br.com.stimuli.loading
Section 185
//Debug (com.hexagonstar.util.debug.Debug)
package com.hexagonstar.util.debug {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public final class Debug {
public static const LEVEL_WARN:int = 2;
public static const LEVEL_DEBUG:int = 0;
public static const LEVEL_INFO:int = 1;
public static const LEVEL_FATAL:int = 4;
public static const LEVEL_ERROR:int = 3;
private static var _stage:Stage;
private static var _filterLevel:int = 0;
private static var _isEnabled:Boolean = true;
private static var _isConnected:Boolean = false;
private static var _isPollingFPS:Boolean = false;
private static var _stopWatch:StopWatch;
private static var _connection:LocalConnection;
private static var _fpsMeter:FPSMeter;
public static function forceGC():void{
try {
} catch(e1:Error) {
try {
new LocalConnection().connect("forceGC");
new LocalConnection().connect("forceGC");
} catch(e2:Error) {
};
};
}
private static function send(_arg1:String, _arg2, _arg3:int=1, _arg4:int=0):void{
var _local5:Number;
var _local6:ByteArray;
if (_isEnabled){
if (!_isConnected){
_isConnected = true;
_connection = new LocalConnection();
_connection.addEventListener(StatusEvent.STATUS, onStatus);
};
_local5 = 0;
if (typeof(_arg2) == "string"){
_local5 = String(_arg2).length;
} else {
if (typeof(_arg2) == "object"){
_local6 = new ByteArray();
_local6.writeObject(_arg2);
_local5 = _local6.length;
_local6 = null;
};
};
if (_local5 > 39000){
storeDataLSO(_arg1, _arg2);
_arg1 = "onLargeData";
_arg2 = null;
};
_connection.send("_alcon_lc", _arg1, _arg2, _arg3, _arg4, "");
};
}
public static function stop():void{
if (_fpsMeter){
_isPollingFPS = false;
_fpsMeter.stop();
_fpsMeter.removeEventListener(FPSMeter.FPS_UPDATE, onFPSUpdate);
_fpsMeter = null;
_stage = null;
};
}
public static function timerReset():void{
if (_stopWatch){
_stopWatch.reset();
};
}
private static function onFPSUpdate(_arg1:Event):void{
send("onFPS", ((((((_fpsMeter.fps + ",") + _stage.frameRate) + ",") + _fpsMeter.frt) + ",") + System.totalMemory));
}
public static function delimiter():void{
Debug.trace("[%DLT%]", 5);
}
public static function set enabled(_arg1:Boolean):void{
_isEnabled = _arg1;
}
public static function inspect(_arg1:Object):void{
send("onInspect", _arg1, 1, -1);
}
public static function timerStart(_arg1:String=""):void{
if (_isEnabled){
if (!_stopWatch){
_stopWatch = new StopWatch();
};
_stopWatch.start(_arg1);
};
}
public static function createCategory(_arg1:int, _arg2:String="", _arg3:uint=0, _arg4:uint=0xFFFF00):void{
send("onCategory", [_arg1, _arg2, _arg3, _arg4], 0, 0);
}
private static function storeDataLSO(_arg1:String, _arg2):void{
var flushResult:String;
var m = _arg1;
var d = _arg2;
var sharedObject:SharedObject = SharedObject.getLocal("alcon", "/");
sharedObject.data["alconMethod"] = m;
sharedObject.data["alconData"] = d;
try {
flushResult = sharedObject.flush();
if (flushResult == SharedObjectFlushStatus.FLUSHED){
return;
};
} catch(e:Error) {
Security.showSettings(SecurityPanel.LOCAL_STORAGE);
};
}
public static function hexDump(_arg1:Object):void{
send("onHexDump", _arg1, 0, 0);
}
private static function onStatus(_arg1:StatusEvent):void{
}
public static function get enabled():Boolean{
return (_isEnabled);
}
public static function trace(... _args):void{
var _local2:int = ((_args[1] is int)) ? _args[1] : 1;
if ((((_local2 >= _filterLevel)) && ((_local2 < 7)))){
send("onData", _args[0], _local2, 0);
};
}
public static function timerToString():void{
if (_stopWatch){
Debug.trace(_stopWatch.toString());
};
}
public static function mark(_arg1:uint=0xFF00FF):void{
send("onMarker", _arg1, 1, -1);
}
public static function timerInSeconds():void{
if (_stopWatch){
Debug.trace((_stopWatch.timeInSeconds + "s"));
};
}
public static function set filterLevel(_arg1:int):void{
if ((((_arg1 >= 0)) && ((_arg1 < 5)))){
_filterLevel = _arg1;
};
}
public static function monitor(_arg1:Stage, _arg2:int=500):void{
if (_isPollingFPS){
Debug.stop();
};
if (((_isEnabled) && (!(_fpsMeter)))){
_isPollingFPS = true;
_stage = _arg1;
sendCapabilities();
_fpsMeter = new FPSMeter(_stage, _arg2);
_fpsMeter.addEventListener(FPSMeter.FPS_UPDATE, onFPSUpdate);
_fpsMeter.start();
};
}
public static function time():void{
Debug.trace("[%TME%]", 5);
}
private static function sendCapabilities():void{
var _local3:XML;
var _local4:String;
var _local1:XML = describeType(Capabilities);
var _local2:Array = [];
for each (_local3 in _local1.*) {
_local4 = _local3.@name.toString();
if ((((((_local4.length > 0)) && (!((_local4 == "_internal"))))) && (!((_local4 == "prototype"))))){
_local2.push({p:_local4, v:Capabilities[_local4].toString()});
};
};
_local2.sortOn(["p"], Array.CASEINSENSITIVE);
send("onCap", _local2);
}
public static function clear():void{
Debug.trace("[%CLR%]", 5);
}
public static function timerStop():void{
if (_stopWatch){
_stopWatch.stop();
};
}
public static function timerInMilliSeconds():void{
if (_stopWatch){
Debug.trace((_stopWatch.timeInMilliSeconds + "ms"));
};
}
public static function get filterLevel():int{
return (_filterLevel);
}
public static function traceObj(_arg1:Object, _arg2:int=64, _arg3:int=1):void{
if ((((_arg3 >= _filterLevel)) && ((_arg3 < 7)))){
send("onData", _arg1, _arg3, _arg2);
};
}
public static function timerStopToString(_arg1:Boolean=false):void{
if (_stopWatch){
_stopWatch.stop();
Debug.trace(_stopWatch.toString());
if (_arg1){
_stopWatch.reset();
};
};
}
public static function pause():void{
Debug.trace("[%PSE%]", 5);
}
}
}//package com.hexagonstar.util.debug
Section 186
//FPSMeter (com.hexagonstar.util.debug.FPSMeter)
package com.hexagonstar.util.debug {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class FPSMeter extends EventDispatcher {
private var _delayMax:int;// = 10
private var _pollInterval:int;
private var _delay:int;
private var _ms:int;
private var _timer:Timer;
private var _prev:int;
private var _frt:int;
private var _fps:int;
private var _isRunning:Boolean;
private var _stage:Stage;
public static const FPS_UPDATE:String = "fpsUpdate";
public function FPSMeter(_arg1:Stage, _arg2:int=500){
_stage = _arg1;
_pollInterval = _arg2;
reset();
}
public function stop():void{
if (_isRunning){
_timer.stop();
_timer.removeEventListener(TimerEvent.TIMER, onTimer);
_stage.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
_timer = null;
reset();
};
}
public function reset():void{
_fps = 0;
_frt = 0;
_ms = 0;
_delay = 0;
_prev = 0;
_isRunning = false;
}
public function start():void{
if (!_isRunning){
_isRunning = true;
_timer = new Timer(_pollInterval, 0);
_timer.addEventListener(TimerEvent.TIMER, onTimer);
_stage.addEventListener(Event.ENTER_FRAME, onEnterFrame);
_timer.start();
};
}
private function onTimer(_arg1:TimerEvent):void{
dispatchEvent(new Event(FPSMeter.FPS_UPDATE));
}
public function get frt():int{
return (_frt);
}
public function get fps():int{
return (_fps);
}
private function onEnterFrame(_arg1:Event):void{
var _local2:Number = getTimer();
_delay++;
if (_delay >= _delayMax){
_delay = 0;
_fps = int(((1000 * _delayMax) / (_local2 - _prev)));
_prev = _local2;
};
_frt = (_local2 - _ms);
_ms = _local2;
}
}
}//package com.hexagonstar.util.debug
Section 187
//StopWatch (com.hexagonstar.util.debug.StopWatch)
package com.hexagonstar.util.debug {
import flash.utils.*;
public class StopWatch {
private var _stopTimeKeys:Array;
private var _startTimeKeys:Array;
private var _started:Boolean;// = false
private var _title:String;
public function StopWatch(){
reset();
}
public function get started():Boolean{
return (_started);
}
public function get timeInMilliSeconds():int{
if (_started){
_stopTimeKeys[(_startTimeKeys.length - 1)] = getTimer();
};
var _local1:int;
var _local2:int;
while (_local2 < _startTimeKeys.length) {
_local1 = (_local1 + (_stopTimeKeys[_local2] - _startTimeKeys[_local2]));
_local2++;
};
return (_local1);
}
public function stop():void{
var _local1:int;
if (_started){
_local1 = getTimer();
_stopTimeKeys[(_startTimeKeys.length - 1)] = _local1;
_started = false;
};
}
public function toString():String{
var _local3:int;
var _local4:int;
var _local1 = "\n ********************* [STOPWATCH] *********************";
if (_title != ""){
_local1 = (_local1 + ("\n * " + _title));
};
var _local2:int;
while (_local2 < _startTimeKeys.length) {
_local3 = _startTimeKeys[_local2];
_local4 = _stopTimeKeys[_local2];
_local1 = (_local1 + (((((("\n * started [" + format(_local3)) + "ms] stopped [") + format(_local4)) + "ms] time [") + format((_local4 - _local3))) + "ms]"));
_local2++;
};
if (_local2 == 0){
_local1 = (_local1 + "\n * never started.");
} else {
_local1 = (_local1 + (("\n * total runnning time: " + timeInSeconds) + "s"));
};
_local1 = (_local1 + "\n *******************************************************");
return (_local1);
}
public function get timeInSeconds():Number{
return ((timeInMilliSeconds / 1000));
}
public function reset():void{
_startTimeKeys = [];
_stopTimeKeys = [];
_started = false;
}
private function format(_arg1:int):String{
var _local2 = "";
var _local3:int = _arg1.toString().length;
var _local4:int;
while (_local4 < (5 - _local3)) {
_local2 = (_local2 + "0");
_local4++;
};
return ((_local2 + _arg1));
}
public function start(_arg1:String=""):void{
if (!_started){
_title = _arg1;
_started = true;
_startTimeKeys.push(getTimer());
};
}
}
}//package com.hexagonstar.util.debug
Section 188
//compareStringCaseInSensitive (de.polygonal.ds.sort.compare.compareStringCaseInSensitive)
package de.polygonal.ds.sort.compare {
public function compareStringCaseInSensitive(_arg1:String, _arg2:String):int{
var _local3:int;
var _local4:int;
var _local5:int;
_arg1 = _arg1.toLowerCase();
_arg2 = _arg2.toLowerCase();
if ((_arg1.length + _arg2.length) > 2){
_local3 = 0;
_local4 = ((_arg1.length > _arg2.length)) ? _arg1.length : _arg2.length;
_local5 = 0;
while (_local5 < _local4) {
_local3 = (_arg1.charCodeAt(_local5) - _arg2.charCodeAt(_local5));
if (_local3 != 0){
break;
};
_local5++;
};
return (_local3);
//unresolved jump
};
return ((_arg1.charCodeAt(0) - _arg2.charCodeAt(0)));
}
}//package de.polygonal.ds.sort.compare
Section 189
//compareStringCaseInSensitiveDesc (de.polygonal.ds.sort.compare.compareStringCaseInSensitiveDesc)
package de.polygonal.ds.sort.compare {
public function compareStringCaseInSensitiveDesc(_arg1:String, _arg2:String):int{
var _local3:int;
var _local4:int;
var _local5:int;
_arg1 = _arg1.toLowerCase();
_arg2 = _arg2.toLowerCase();
if ((_arg1.length + _arg2.length) > 2){
_local3 = 0;
_local4 = ((_arg1.length > _arg2.length)) ? _arg1.length : _arg2.length;
_local5 = 0;
while (_local5 < _local4) {
_local3 = (_arg2.charCodeAt(_local5) - _arg1.charCodeAt(_local5));
if (_local3 != 0){
break;
};
_local5++;
};
return (_local3);
//unresolved jump
};
return ((_arg2.charCodeAt(0) - _arg1.charCodeAt(0)));
}
}//package de.polygonal.ds.sort.compare
Section 190
//compareStringCaseSensitive (de.polygonal.ds.sort.compare.compareStringCaseSensitive)
package de.polygonal.ds.sort.compare {
public function compareStringCaseSensitive(_arg1:String, _arg2:String):int{
var _local3:int;
var _local4:int;
var _local5:int;
if ((_arg1.length + _arg2.length) > 2){
_local3 = 0;
_local4 = ((_arg1.length > _arg2.length)) ? _arg1.length : _arg2.length;
_local5 = 0;
while (_local5 < _local4) {
_local3 = (_arg1.charCodeAt(_local5) - _arg2.charCodeAt(_local5));
if (_local3 != 0){
break;
};
_local5++;
};
return (_local3);
//unresolved jump
};
return ((_arg1.charCodeAt(0) - _arg2.charCodeAt(0)));
}
}//package de.polygonal.ds.sort.compare
Section 191
//compareStringCaseSensitiveDesc (de.polygonal.ds.sort.compare.compareStringCaseSensitiveDesc)
package de.polygonal.ds.sort.compare {
public function compareStringCaseSensitiveDesc(_arg1:String, _arg2:String):int{
var _local3:int;
var _local4:int;
var _local5:int;
if ((_arg1.length + _arg2.length) > 2){
_local3 = 0;
_local4 = ((_arg1.length > _arg2.length)) ? _arg1.length : _arg2.length;
_local5 = 0;
while (_local5 < _local4) {
_local3 = (_arg2.charCodeAt(_local5) - _arg1.charCodeAt(_local5));
if (_local3 != 0){
break;
};
_local5++;
};
return (_local3);
//unresolved jump
};
return ((_arg2.charCodeAt(0) - _arg1.charCodeAt(0)));
}
}//package de.polygonal.ds.sort.compare
Section 192
//sLinkedInsertionSort (de.polygonal.ds.sort.sLinkedInsertionSort)
package de.polygonal.ds.sort {
import de.polygonal.ds.*;
public function sLinkedInsertionSort(_arg1:SListNode, _arg2:Boolean=false):SListNode{
var _local7:int;
var _local8:Number;
var _local3:Array = [];
var _local4:int;
var _local5:SListNode = _arg1;
var _local6:SListNode = _arg1;
while (_local6) {
var _temp1 = _local4;
_local4 = (_local4 + 1);
var _local10 = _temp1;
_local3[_local10] = _local6.data;
_local6 = _local6.next;
};
if (_local4 <= 1){
return (_local5);
};
var _local9 = 1;
while (_local9 < _local4) {
_local8 = _local3[_local9];
_local7 = _local9;
while ((((_local7 > 0)) && ((_local3[int((_local7 - 1))] > _local8)))) {
_local3[_local7] = _local3[int((_local7 - 1))];
_local7--;
};
_local3[_local7] = _local8;
_local9++;
};
_local6 = _local5;
_local9 = 0;
while (_local6) {
var _temp2 = _local9;
_local9 = (_local9 + 1);
_local6.data = _local3[_temp2];
_local6 = _local6.next;
};
return (_local5);
}
}//package de.polygonal.ds.sort
Section 193
//sLinkedInsertionSortCmp (de.polygonal.ds.sort.sLinkedInsertionSortCmp)
package de.polygonal.ds.sort {
import de.polygonal.ds.*;
public function sLinkedInsertionSortCmp(_arg1:SListNode, _arg2:Function, _arg3:Boolean=false):SListNode{
var _local8:int;
var _local9:int;
var _local10:*;
var _local4:Array = [];
var _local5:int;
var _local6:SListNode = _arg1;
var _local7:SListNode = _arg1;
while (_local7) {
var _temp1 = _local5;
_local5 = (_local5 + 1);
var _local11 = _temp1;
_local4[_local11] = _local7.data;
_local7 = _local7.next;
};
if (_arg3){
if (_local5 <= 1){
return (_local6);
};
_local9 = 1;
while (_local9 < _local5) {
_local10 = _local4[_local9];
_local8 = _local9;
while ((((_local8 > 0)) && ((_arg2(_local4[int((_local8 - 1))], _local10) < 0)))) {
_local4[_local8] = _local4[int((_local8 - 1))];
_local8--;
};
_local4[_local8] = _local10;
_local9++;
};
} else {
if (_local5 <= 1){
return (_local6);
};
_local9 = 1;
while (_local9 < _local5) {
_local10 = _local4[_local9];
_local8 = _local9;
while ((((_local8 > 0)) && ((_arg2(_local4[int((_local8 - 1))], _local10) > 0)))) {
_local4[_local8] = _local4[int((_local8 - 1))];
_local8--;
};
_local4[_local8] = _local10;
_local9++;
};
};
_local7 = _local6;
_local9 = 0;
while (_local7) {
var _temp2 = _local9;
_local9 = (_local9 + 1);
_local7.data = _local4[_temp2];
_local7 = _local7.next;
};
return (_local6);
}
}//package de.polygonal.ds.sort
Section 194
//sLinkedMergeSort (de.polygonal.ds.sort.sLinkedMergeSort)
package de.polygonal.ds.sort {
import de.polygonal.ds.*;
public function sLinkedMergeSort(_arg1:SListNode, _arg2:Boolean=false):SListNode{
var _local4:SListNode;
var _local5:SListNode;
var _local6:SListNode;
var _local7:SListNode;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
if (!_arg1){
return (null);
};
var _local3:SListNode = _arg1;
var _local8 = 1;
if (_arg2){
while (true) {
_local4 = _local3;
_local7 = null;
_local3 = _local7;
_local9 = 0;
while (_local4) {
_local9++;
_local12 = 0;
_local10 = 0;
_local5 = _local4;
while (_local12 < _local8) {
_local10++;
_local5 = _local5.next;
if (!_local5){
break;
};
_local12++;
};
_local11 = _local8;
while ((((_local10 > 0)) || ((((_local11 > 0)) && (_local5))))) {
if (_local10 == 0){
_local6 = _local5;
_local5 = _local5.next;
_local11--;
} else {
if ((((_local11 == 0)) || (!(_local5)))){
_local6 = _local4;
_local4 = _local4.next;
_local10--;
} else {
if ((_local4.data - _local5.data) >= 0){
_local6 = _local4;
_local4 = _local4.next;
_local10--;
} else {
_local6 = _local5;
_local5 = _local5.next;
_local11--;
};
};
};
if (_local7){
_local7.next = _local6;
} else {
_local3 = _local6;
};
_local7 = _local6;
};
_local4 = _local5;
};
_local7.next = null;
if (_local9 <= 1){
return (_local3);
};
_local8 = (_local8 << 1);
};
} else {
while (true) {
_local4 = _local3;
_local7 = null;
_local3 = _local7;
_local9 = 0;
while (_local4) {
_local9++;
_local12 = 0;
_local10 = 0;
_local5 = _local4;
while (_local12 < _local8) {
_local10++;
_local5 = _local5.next;
if (!_local5){
break;
};
_local12++;
};
_local11 = _local8;
while ((((_local10 > 0)) || ((((_local11 > 0)) && (_local5))))) {
if (_local10 == 0){
_local6 = _local5;
_local5 = _local5.next;
_local11--;
} else {
if ((((_local11 == 0)) || (!(_local5)))){
_local6 = _local4;
_local4 = _local4.next;
_local10--;
} else {
if ((_local4.data - _local5.data) <= 0){
_local6 = _local4;
_local4 = _local4.next;
_local10--;
} else {
_local6 = _local5;
_local5 = _local5.next;
_local11--;
};
};
};
if (_local7){
_local7.next = _local6;
} else {
_local3 = _local6;
};
_local7 = _local6;
};
_local4 = _local5;
};
_local7.next = null;
if (_local9 <= 1){
return (_local3);
};
_local8 = (_local8 << 1);
};
};
return (null);
}
}//package de.polygonal.ds.sort
Section 195
//sLinkedMergeSortCmp (de.polygonal.ds.sort.sLinkedMergeSortCmp)
package de.polygonal.ds.sort {
import de.polygonal.ds.*;
public function sLinkedMergeSortCmp(_arg1:SListNode, _arg2:Function, _arg3:Boolean=false):SListNode{
var _local5:SListNode;
var _local6:SListNode;
var _local7:SListNode;
var _local8:SListNode;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
if (((!(_arg1)) || ((_arg2 == null)))){
return (null);
};
var _local4:SListNode = _arg1;
var _local9 = 1;
if (_arg3){
while (true) {
_local5 = _local4;
_local8 = null;
_local4 = _local8;
_local10 = 0;
while (_local5) {
_local10++;
_local13 = 0;
_local11 = 0;
_local6 = _local5;
while (_local13 < _local9) {
_local11++;
_local6 = _local6.next;
if (!_local6){
break;
};
_local13++;
};
_local12 = _local9;
while ((((_local11 > 0)) || ((((_local12 > 0)) && (_local6))))) {
if (_local11 == 0){
_local7 = _local6;
_local6 = _local6.next;
_local12--;
} else {
if ((((_local12 == 0)) || (!(_local6)))){
_local7 = _local5;
_local5 = _local5.next;
_local11--;
} else {
if (_arg2(_local5.data, _local6.data) >= 0){
_local7 = _local5;
_local5 = _local5.next;
_local11--;
} else {
_local7 = _local6;
_local6 = _local6.next;
_local12--;
};
};
};
if (_local8){
_local8.next = _local7;
} else {
_local4 = _local7;
};
_local8 = _local7;
};
_local5 = _local6;
};
_local8.next = null;
if (_local10 <= 1){
return (_local4);
};
_local9 = (_local9 << 1);
};
} else {
while (true) {
_local5 = _local4;
_local8 = null;
_local4 = _local8;
_local10 = 0;
while (_local5) {
_local10++;
_local13 = 0;
_local11 = 0;
_local6 = _local5;
while (_local13 < _local9) {
_local11++;
_local6 = _local6.next;
if (!_local6){
break;
};
_local13++;
};
_local12 = _local9;
while ((((_local11 > 0)) || ((((_local12 > 0)) && (_local6))))) {
if (_local11 == 0){
_local7 = _local6;
_local6 = _local6.next;
_local12--;
} else {
if ((((_local12 == 0)) || (!(_local6)))){
_local7 = _local5;
_local5 = _local5.next;
_local11--;
} else {
if (_arg2(_local5.data, _local6.data) <= 0){
_local7 = _local5;
_local5 = _local5.next;
_local11--;
} else {
_local7 = _local6;
_local6 = _local6.next;
_local12--;
};
};
};
if (_local8){
_local8.next = _local7;
} else {
_local4 = _local7;
};
_local8 = _local7;
};
_local5 = _local6;
};
_local8.next = null;
if (_local10 <= 1){
return (_local4);
};
_local9 = (_local9 << 1);
};
};
return (null);
}
}//package de.polygonal.ds.sort
Section 196
//Collection (de.polygonal.ds.Collection)
package de.polygonal.ds {
public interface Collection {
function get size():int;
function isEmpty():Boolean;
function getIterator():Iterator;
function clear():void;
function toArray():Array;
function contains(_arg1):Boolean;
}
}//package de.polygonal.ds
Section 197
//Iterator (de.polygonal.ds.Iterator)
package de.polygonal.ds {
public interface Iterator {
function start():void;
function set data(_arg1):void;
function get data();
function next();
function hasNext():Boolean;
}
}//package de.polygonal.ds
Section 198
//LinkedListNode (de.polygonal.ds.LinkedListNode)
package de.polygonal.ds {
public interface LinkedListNode {
}
}//package de.polygonal.ds
Section 199
//SLinkedList (de.polygonal.ds.SLinkedList)
package de.polygonal.ds {
import de.polygonal.ds.sort.compare.*;
import de.polygonal.ds.sort.*;
public class SLinkedList implements Collection {
private var _count:int;
public var tail:SListNode;
public var head:SListNode;
public static const MERGE_SORT:int = (1 << 2);
public static const DESCENDING:int = (1 << 4);
public static const NUMERIC:int = (1 << 3);
public static const INSERTION_SORT:int = (1 << 1);
public function SLinkedList(... _args){
head = (tail = null);
_count = 0;
if (_args.length > 0){
append.apply(this, _args);
};
}
public function get size():int{
return (_count);
}
public function isEmpty():Boolean{
return ((_count == 0));
}
public function remove(_arg1:SListIterator):Boolean{
if (((!((_arg1.list == this))) || (!(_arg1.node)))){
return (false);
};
var _local2:SListNode = head;
if (_arg1.node == head){
_arg1.forth();
removeHead();
return (true);
};
while (_local2.next != _arg1.node) {
_local2 = _local2.next;
};
_arg1.forth();
if (_local2.next == tail){
tail = _local2;
};
_local2.next = _arg1.node;
_count--;
return (true);
}
public function removeHead(){
var _local1:*;
var _local2:SListNode;
if (head){
_local1 = head.data;
if (head == tail){
head = (tail = null);
} else {
_local2 = head;
head = head.next;
_local2.next = null;
if (head == null){
tail = null;
};
};
_count--;
return (_local1);
};
return (null);
}
public function clear():void{
var _local2:SListNode;
var _local1:SListNode = head;
head = null;
while (_local1) {
_local2 = _local1.next;
_local1.next = null;
_local1 = _local2;
};
_count = 0;
}
public function prepend(... _args):SListNode{
var _local4:SListNode;
var _local5:int;
var _local2:int = _args.length;
var _local3:SListNode = new SListNode(_args[int((_local2 - 1))]);
if (head){
_local3.next = head;
head = _local3;
} else {
head = (tail = _local3);
};
if (_local2 > 1){
_local4 = _local3;
_local5 = (_local2 - 2);
while (_local5 >= 0) {
_local3 = new SListNode(_args[_local5]);
_local3.next = head;
head = _local3;
_local5--;
};
_count = (_count + _local2);
return (_local4);
};
_count++;
return (_local3);
}
public function popDown():void{
var _local2:SListNode;
var _local1:SListNode = tail;
if (head.next == tail){
tail = head;
head = _local1;
tail.next = null;
head.next = tail;
} else {
_local2 = head;
while (_local2.next != tail) {
_local2 = _local2.next;
};
tail = _local2;
tail.next = null;
_local1.next = head;
head = _local1;
};
}
public function concat(... _args):SLinkedList{
var _local3:SLinkedList;
var _local4:SListNode;
var _local2:SLinkedList = new SLinkedList();
_local4 = head;
while (_local4) {
_local2.append(_local4.data);
_local4 = _local4.next;
};
var _local5:int = _args.length;
var _local6:int;
while (_local6 < _local5) {
_local3 = _args[_local6];
_local4 = _local3.head;
while (_local4) {
_local2.append(_local4.data);
_local4 = _local4.next;
};
_local6++;
};
return (_local2);
}
public function append(... _args):SListNode{
var _local4:SListNode;
var _local5:int;
var _local2:int = _args.length;
var _local3:SListNode = new SListNode(_args[0]);
if (head){
tail.next = _local3;
tail = _local3;
} else {
head = (tail = _local3);
};
if (_local2 > 1){
_local4 = _local3;
_local5 = 1;
while (_local5 < _local2) {
_local3 = new SListNode(_args[_local5]);
tail.next = _local3;
tail = _local3;
_local5++;
};
_count = (_count + _local2);
return (_local4);
};
_count++;
return (_local3);
}
public function sort(... _args):void{
var _local2:int;
var _local3:Function;
var _local4:*;
if (_count <= 1){
return;
};
if (_args.length > 0){
_local2 = 0;
_local3 = null;
_local4 = _args[0];
if ((_local4 is Function)){
_local3 = _local4;
if (_args.length > 1){
_local4 = _args[1];
if ((_local4 is int)){
_local2 = _local4;
};
};
} else {
if ((_local4 is int)){
_local2 = _local4;
};
};
if (Boolean(_local3)){
if ((_local2 & 2)){
head = sLinkedInsertionSortCmp(head, _local3, (_local2 == 18));
} else {
head = sLinkedMergeSortCmp(head, _local3, (_local2 == 16));
};
} else {
if ((_local2 & 2)){
if ((_local2 & 4)){
if (_local2 == 22){
head = sLinkedInsertionSortCmp(head, compareStringCaseSensitiveDesc);
} else {
if (_local2 == 14){
head = sLinkedInsertionSortCmp(head, compareStringCaseInSensitive);
} else {
if (_local2 == 30){
head = sLinkedInsertionSortCmp(head, compareStringCaseInSensitiveDesc);
} else {
head = sLinkedInsertionSortCmp(head, compareStringCaseSensitive);
};
};
};
} else {
head = sLinkedInsertionSort(head, (_local2 == 18));
};
} else {
if ((_local2 & 4)){
if (_local2 == 20){
head = sLinkedMergeSortCmp(head, compareStringCaseSensitiveDesc);
} else {
if (_local2 == 12){
head = sLinkedMergeSortCmp(head, compareStringCaseInSensitive);
} else {
if (_local2 == 28){
head = sLinkedMergeSortCmp(head, compareStringCaseInSensitiveDesc);
} else {
head = sLinkedMergeSortCmp(head, compareStringCaseSensitive);
};
};
};
} else {
if ((_local2 & 16)){
head = sLinkedMergeSort(head, true);
};
};
};
};
} else {
head = sLinkedMergeSort(head);
};
}
public function reverse():void{
if (_count == 0){
return;
};
var _local1:Array = new Array(_count);
var _local2:int;
var _local3:SListNode = head;
while (_local3) {
var _temp1 = _local2;
_local2 = (_local2 + 1);
var _local4 = _temp1;
_local1[_local4] = _local3;
_local3 = _local3.next;
};
_local1.reverse();
_local3 = (head = _local1[0]);
_local2 = 1;
while (_local2 < _count) {
_local3 = (_local3.next = _local1[_local2]);
_local2++;
};
_local3.next = null;
tail = _local3;
_local1 = null;
}
public function insertAfter(_arg1:SListIterator, _arg2):SListNode{
var _local3:SListNode;
if (_arg1.list != this){
return (null);
};
if (_arg1.node){
_local3 = new SListNode(_arg2);
_arg1.node.insertAfter(_local3);
if (_arg1.node == tail){
tail = _arg1.node.next;
};
_count++;
return (_local3);
//unresolved jump
};
return (append(_arg2));
}
public function getIterator():Iterator{
return (new SListIterator(this, head));
}
public function toArray():Array{
var _local1:Array = [];
var _local2:SListNode = head;
while (_local2) {
_local1.push(_local2.data);
_local2 = _local2.next;
};
return (_local1);
}
public function contains(_arg1):Boolean{
var _local2:SListNode = head;
while (_local2) {
if (_local2.data == _arg1){
return (true);
};
_local2 = _local2.next;
};
return (false);
}
public function getListIterator():SListIterator{
return (new SListIterator(this, head));
}
public function join(_arg1):String{
if (_count == 0){
return ("");
};
var _local2 = "";
var _local3:SListNode = head;
while (_local3.next) {
_local2 = (_local2 + (_local3.data + _arg1));
_local3 = _local3.next;
};
_local2 = (_local2 + _local3.data);
return (_local2);
}
public function toString():String{
return ((("[SlinkedList, size=" + size) + "]"));
}
public function removeTail(){
var _local1:*;
var _local2:SListNode;
if (tail){
_local1 = tail.data;
if (head == tail){
head = (tail = null);
} else {
_local2 = head;
while (_local2.next != tail) {
_local2 = _local2.next;
};
tail = _local2;
_local2.next = null;
};
_count--;
return (_local1);
};
return (null);
}
public function merge(... _args):void{
var _local2:SLinkedList;
if (_args.length == 0){
return;
};
_local2 = _args[0];
if (_local2.head){
if (head){
tail.next = _local2.head;
tail = _local2.tail;
} else {
head = _local2.head;
tail = _local2.tail;
};
_count = (_count + _local2.size);
};
var _local3:int = _args.length;
var _local4 = 1;
while (_local4 < _local3) {
_local2 = _args[_local4];
if (_local2.head){
tail.next = _local2.head;
tail = _local2.tail;
_count = (_count + _local2.size);
};
_local4++;
};
}
public function nodeOf(_arg1, _arg2:SListIterator=null):SListIterator{
if (_arg2 != null){
if (_arg2.list != null){
return (null);
};
};
var _local3:SListNode = ((_arg2)==null) ? head : _arg2.node;
while (_local3) {
if (_local3.data === _arg1){
return (new SListIterator(this, _local3));
};
_local3 = _local3.next;
};
return (null);
}
public function dump():String{
if (!head){
return ("SLinkedList: (empty)");
};
var _local1 = (((("SLinkedList: has " + _count) + " node") + ((_count == 1)) ? "" : "s") + "\n|< Head\n");
var _local2:SListIterator = getListIterator();
while (_local2.valid()) {
_local1 = (_local1 + (("\t" + _local2.data) + "\n"));
_local2.forth();
};
_local1 = (_local1 + "Tail >|");
return (_local1);
}
public function splice(_arg1:SListIterator, _arg2:uint=4294967295, ... _args):SLinkedList{
var _local4:SListNode;
var _local5:SListNode;
var _local6:SLinkedList;
var _local7:int;
var _local8:int;
var _local9:SListNode;
if (_arg1){
if (_arg1.list != this){
return (null);
};
};
if (_arg1.node){
_local4 = _arg1.node;
_local5 = head;
while (_local5.next != _local4) {
_local5 = _local5.next;
};
_local6 = new SLinkedList();
if (_arg2 == 4294967295){
if (_arg1.node == tail){
return (_local6);
};
while (_arg1.node) {
_local6.append(_arg1.node.data);
_arg1.remove();
};
_arg1.list = _local6;
_arg1.node = _local4;
return (_local6);
} else {
_local7 = 0;
while (_local7 < _arg2) {
if (_arg1.node){
_local6.append(_arg1.node.data);
_arg1.remove();
} else {
break;
};
_local7++;
};
};
_local8 = _args.length;
if (_local8 > 0){
if (_count == 0){
_local7 = 0;
while (_local7 < _local8) {
append(_args[_local7]);
_local7++;
};
} else {
if (_local5 == null){
_local9 = prepend(_args[0]);
_local7 = 1;
while (_local7 < _local8) {
_local9.insertAfter(new SListNode(_args[_local7]));
if (_local9 == tail){
tail = _local9.next;
};
_local9 = _local9.next;
_count++;
_local7++;
};
} else {
_local9 = _local5;
_local7 = 0;
while (_local7 < _local8) {
_local9.insertAfter(new SListNode(_args[_local7]));
if (_local9 == tail){
tail = _local9.next;
};
_local9 = _local9.next;
_count++;
_local7++;
};
};
};
_arg1.node = _local9;
} else {
_arg1.node = _local4;
};
_arg1.list = _local6;
return (_local6);
};
return (null);
}
public function shiftUp():void{
var _local1:SListNode = head;
if (head.next == tail){
head = tail;
tail = _local1;
tail.next = null;
head.next = tail;
} else {
head = head.next;
tail.next = _local1;
_local1.next = null;
tail = _local1;
};
}
}
}//package de.polygonal.ds
Section 200
//SListIterator (de.polygonal.ds.SListIterator)
package de.polygonal.ds {
public class SListIterator implements Iterator {
public var node:SListNode;
public var list:SLinkedList;
public function SListIterator(_arg1:SLinkedList=null, _arg2:SListNode=null){
this.list = _arg1;
this.node = _arg2;
}
public function remove():Boolean{
return (list.remove(this));
}
public function start():void{
if (list){
node = list.head;
};
}
public function get data(){
if (node){
return (node.data);
};
return (null);
}
public function forth():void{
if (node){
node = node.next;
};
}
public function toString():String{
return ((("{SListIterator: data=" + node.data) + "}"));
}
public function hasNext():Boolean{
return (Boolean(node));
}
public function valid():Boolean{
return (Boolean(node));
}
public function next(){
var _local1:*;
if (hasNext()){
_local1 = node.data;
node = node.next;
return (_local1);
};
return (null);
}
public function set data(_arg1):void{
node.data = _arg1;
}
public function end():void{
if (list){
node = list.tail;
};
}
}
}//package de.polygonal.ds
Section 201
//SListNode (de.polygonal.ds.SListNode)
package de.polygonal.ds {
public class SListNode implements LinkedListNode {
public var next:SListNode;
public var data;
public function SListNode(_arg1){
data = _arg1;
next = null;
}
public function insertAfter(_arg1:SListNode):void{
_arg1.next = next;
next = _arg1;
}
public function toString():String{
return ((("[SListNode, data=" + data) + "]"));
}
}
}//package de.polygonal.ds
Section 202
//GameTracker (FGL.GameTracker.GameTracker)
package FGL.GameTracker {
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.external.*;
public class GameTracker extends EventDispatcher {
protected var _passphrase:String;// = ""
protected var _responder:Responder;// = null
protected var _timer:Timer;// = null
protected var _serverVersionMajor:int;// = 0
protected var _conn:NetConnection;// = null
protected var _currentGame:int;// = 1
protected var _msg_queue:Array;
protected var _inGame:Boolean;// = false
protected var _inLevel:Boolean;// = false
protected var _serviceName:String;// = ""
protected var _currentLevel:int;// = 0
protected var _hostUrl:String;// = ""
protected var _sessionID:uint;
protected var _isEnabled:Boolean;// = false
protected var _serverVersionMinor:int;// = 0
public static const GAMETRACKER_SERVER_ERROR:String = "gametracker_server_error";
private static const TIMER_DELAY:int = 15000;
public static const GAMETRACKER_CODING_ERROR:String = "gametracker_coding_error";
public function GameTracker(){
_msg_queue = new Array();
super();
setGlobalConfig();
if (_isEnabled){
_responder = new Responder(onSuccess, onNetworkingError);
_conn = new NetConnection();
_conn.connect(_hostUrl);
_timer = new Timer(TIMER_DELAY);
_timer.addEventListener("timer", onTimer);
_timer.start();
_sessionID = Math.floor((new Date().getTime() / 1000));
addToMsgQueue("begin_app", null, 0, null, null);
};
}
public function beginGame(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
if (_inGame){
endGame(_arg1, _arg2, "AUTO:(this game automatically ended when new game was started)");
};
_currentGame++;
_inGame = true;
addToMsgQueue("begin_game", null, _arg1, _arg2, _arg3);
}
protected function setGlobalConfig():void{
var ret:Array;
_isEnabled = false;
_serverVersionMajor = 0;
_serverVersionMinor = 0;
_hostUrl = "";
_serviceName = "";
_passphrase = "";
try {
if (ExternalInterface.available){
ret = ExternalInterface.call("get_gametracker_info");
_serverVersionMajor = ret[0];
_serverVersionMinor = ret[1];
_hostUrl = ret[2];
_serviceName = ret[3];
_passphrase = ret[4];
_isEnabled = (_serverVersionMajor == 1);
};
} catch(e) {
};
}
public function checkpoint(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
if (!_inGame){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "checkpoint() called before startGame() was called!"));
} else {
addToMsgQueue("checkpoint", null, _arg1, _arg2, _arg3);
};
}
protected function onNetworkingError(_arg1):void{
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_SERVER_ERROR, "Networking error"));
}
protected function submitMsgQueue():void{
var _local1:Object;
if (((_isEnabled) && ((_msg_queue.length > 0)))){
_local1 = new Object();
_local1["actions"] = _msg_queue;
_local1["identifier"] = _passphrase;
_conn.call(_serviceName, _responder, _local1);
_msg_queue = new Array();
};
}
public function customMsg(_arg1:String, _arg2:Number=0, _arg3:String=null, _arg4:String=null):void{
addToMsgQueue("custom", _arg1, _arg2, _arg3, _arg4);
}
public function beginLevel(_arg1:int, _arg2:Number=0, _arg3:String=null, _arg4:String=null):void{
if (!_inGame){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "beginLevel() called before beginGame() was called!"));
} else {
if (_inLevel){
endLevel(_arg2, _arg3, "AUTO:(this level automatically ended when new level was started)");
} else {
_currentLevel = _arg1;
_inLevel = true;
addToMsgQueue("begin_level", null, _arg2, _arg3, _arg4);
};
};
}
public function alert(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
addToMsgQueue("alert", null, _arg1, _arg2, _arg3);
submitMsgQueue();
}
protected function onTimer(_arg1:TimerEvent):void{
submitMsgQueue();
}
public function endLevel(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
if (!_inLevel){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "endLevel() called before beginLevel() was called!"));
} else {
_inLevel = false;
addToMsgQueue("end_level", null, _arg1, _arg2, _arg3);
};
}
protected function onSuccess(_arg1):void{
if (_arg1.toString() != ""){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_SERVER_ERROR, _arg1.toString()));
};
}
protected function addToMsgQueue(_arg1:String, _arg2:String, _arg3:Number, _arg4:String, _arg5:String):void{
var _local6:Object;
if (_isEnabled){
_local6 = new Object();
_local6["action"] = _arg1;
_local6["custom_action"] = _arg2;
_local6["session_id"] = _sessionID;
_local6["game_idx"] = _currentGame;
_local6["level"] = _currentLevel;
_local6["score"] = _arg3;
_local6["game_state"] = _arg4;
_local6["time"] = Math.floor((new Date().getTime() / 1000));
_local6["msg"] = _arg5;
_msg_queue.push(_local6);
};
}
public function endGame(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
if (!_inGame){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "endGame() called before beginGame() was called!"));
} else {
if (_inLevel){
endLevel(_arg1, _arg2, "AUTO:(this level automatically ended when game ended)");
};
addToMsgQueue("end_game", null, _arg1, _arg2, _arg3);
_inGame = false;
submitMsgQueue();
};
}
public function isEnabled():Boolean{
return (_isEnabled);
}
}
}//package FGL.GameTracker
Section 203
//GameTrackerErrorEvent (FGL.GameTracker.GameTrackerErrorEvent)
package FGL.GameTracker {
import flash.events.*;
public class GameTrackerErrorEvent extends Event {
public var _msg:String;
public function GameTrackerErrorEvent(_arg1:String, _arg2:String){
_msg = _arg2;
super(_arg1, false, false);
}
}
}//package FGL.GameTracker
Section 204
//idle_6_10 (Final_fla.idle_6_10)
package Final_fla {
import flash.display.*;
public dynamic class idle_6_10 extends MovieClip {
public function idle_6_10(){
addFrameScript(0, frame1, 19, frame20, 37, frame38, 55, frame56, 73, frame74);
}
function frame38(){
stop();
gotoAndStop("idle");
}
function frame1(){
stop();
}
function frame74(){
stop();
gotoAndStop("idle");
}
function frame20(){
stop();
gotoAndStop("idle");
}
function frame56(){
stop();
gotoAndStop("idle");
}
}
}//package Final_fla
Section 205
//job_qualification_27 (Final_fla.job_qualification_27)
package Final_fla {
import flash.display.*;
public dynamic class job_qualification_27 extends MovieClip {
public function job_qualification_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Final_fla
Section 206
//level_tf_51 (Final_fla.level_tf_51)
package Final_fla {
import flash.display.*;
public dynamic class level_tf_51 extends MovieClip {
public function level_tf_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Final_fla
Section 207
//medal_24 (Final_fla.medal_24)
package Final_fla {
import flash.display.*;
public dynamic class medal_24 extends MovieClip {
public function medal_24(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Final_fla
Section 208
//newhighscore_anim_30 (Final_fla.newhighscore_anim_30)
package Final_fla {
import flash.display.*;
public dynamic class newhighscore_anim_30 extends MovieClip {
public function newhighscore_anim_30(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package Final_fla
Section 209
//score_qualif_28 (Final_fla.score_qualif_28)
package Final_fla {
import flash.display.*;
public dynamic class score_qualif_28 extends MovieClip {
public var qualif:MovieClip;
public function score_qualif_28(){
addFrameScript(0, frame1, 18, frame19);
}
function frame1(){
stop();
}
function frame19(){
stop();
}
}
}//package Final_fla
Section 210
//score_qualif_anim_29 (Final_fla.score_qualif_anim_29)
package Final_fla {
import flash.display.*;
public dynamic class score_qualif_anim_29 extends MovieClip {
public function score_qualif_anim_29(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Final_fla
Section 211
//spaceship_with_player_9 (Final_fla.spaceship_with_player_9)
package Final_fla {
import flash.display.*;
public dynamic class spaceship_with_player_9 extends MovieClip {
public var player:MovieClip;
public var fire:MovieClip;
public function spaceship_with_player_9(){
addFrameScript(17, frame18, 55, frame56, 70, frame71, 108, frame109);
}
function frame18(){
stop();
}
function frame71(){
stop();
}
function frame109(){
stop();
}
function frame56(){
stop();
}
}
}//package Final_fla
Section 212
//Behavior (framework._component.Behavior)
package framework._component {
public class Behavior extends Component {
public var parentWorldObject:WorldObject;
override public function addChild(_arg1:Component):Component{
throw (new Error("Un behavior no puede tener hijos"));
}
override public function addChildAt(_arg1:Component, _arg2:int):Component{
throw (new Error("Un behavior no puede tener hijos"));
}
}
}//package framework._component
Section 213
//Component (framework._component.Component)
package framework._component {
import flash.events.*;
public class Component extends EventDispatcher {
private var _sleeping:Boolean;// = false
public var name:String;
public var id:int;
private var _active:Boolean;// = true
private var _rootComponent:RootComponent;// = null
private var _parent:Component;// = null
private var _paused:Boolean;// = false
private var _wasActive:Boolean;// = true
public var children:Array;
public function Component(){
children = new Array();
super();
}
function added():void{
onAdded();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
children[_local1].added();
_local1--;
};
}
protected function onRemoved():void{
}
protected function onChildAdded(_arg1:Component):void{
}
public function getChildrenByType(_arg1:Class):Array{
var _local2:Array = new Array();
var _local3:int = (children.length - 1);
while (_local3 > -1) {
if ((children[_local3] is _arg1)){
_local2.push(children[_local3]);
};
_local3--;
};
return (_local2);
}
public function getChildByName(_arg1:String):Component{
var _local2:int = (children.length - 1);
while (_local2 > -1) {
if (_arg1 == children[_local2].name){
return (children[_local2]);
};
_local2--;
};
return (null);
}
public function get active():Boolean{
return (_active);
}
public function addChildAt(_arg1:Component, _arg2:int):Component{
var _local3:Array;
if ((((_arg2 < 0)) || ((_arg2 > children.length)))){
throw (new Error("El indice proporcionado esta fuera de los limites"));
};
if (_arg1.parent == this){
return (_arg1);
};
if (_arg1.parent){
_arg1.parent.removeChild(_arg1);
};
if (_arg2 == children.length){
children.push(_arg1);
} else {
if (_arg2 == 0){
children.unshift(_arg1);
} else {
_local3 = children.splice(_arg2);
children.push(_arg1);
children = children.concat(_local3);
};
};
_arg1.setParent(this);
if (_rootComponent){
_arg1.addToRoot(_rootComponent);
};
_arg1.added();
onChildAdded(_arg1);
return (_arg1);
}
protected function onResumed():void{
}
protected function onDeactivated():void{
}
public function getFirstChildByType(_arg1:Class):Component{
var _local2:int = (children.length - 1);
while (_local2 > -1) {
if ((children[_local2] is _arg1)){
return (children[_local2]);
};
_local2--;
};
return (null);
}
protected function onSlept():void{
}
protected function onChildRemoved(_arg1:Component):void{
}
public function getFirstDescendantByType(_arg1:Class):Component{
var _local4:Component;
var _local5:Component;
var _local2:int = children.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = children[_local3];
if ((_local4 is _arg1)){
return (_local4);
};
if (_local4.children.length){
_local5 = _local4.getFirstDescendantByType(_arg1);
if (_local5){
return (_local5);
};
};
_local3++;
};
return (null);
}
public function get parent():Component{
return (_parent);
}
public function deactivateRecursively():void{
deactivate();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
children[_local1].deactivateRecursively();
_local1--;
};
}
function setParent(_arg1:Component):void{
this._parent = _arg1;
}
public function resume():void{
if (!_paused){
return;
};
_paused = false;
if (!_sleeping){
if (_wasActive){
dispatchEvent(new Event(ComponentEvents.ACTIVATED));
_active = true;
onActivated();
};
};
onResumed();
}
public function get paused():Boolean{
return (_paused);
}
protected function onActivated():void{
}
protected function onWokeUp():void{
}
public function get sleeping():Boolean{
return (_sleeping);
}
protected function onRemovedFromRoute():void{
}
public function removeChildAt(_arg1:int):Component{
if ((((_arg1 < 0)) || ((_arg1 >= children.length)))){
throw (new Error("El indice proporcionado esta fuera de los limites"));
};
var _local2:Component = children[_arg1];
_local2.removeFromRoot();
_local2.removed();
_local2.setParent(null);
onChildRemoved(_local2);
return (children.splice(_arg1, 1)[0]);
}
public function activateRecursively():void{
activate();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
children[_local1].activateRecursively();
_local1--;
};
}
public function resumeRecursively():void{
resume();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
children[_local1].resumeRecursively();
_local1--;
};
}
public function getDescendantByName(_arg1:String):Component{
var _local3:Component;
var _local4:Component;
var _local2:int = (children.length - 1);
while (_local2 > -1) {
_local3 = children[_local2];
if (_local3.name == _arg1){
return (_local3);
};
if (_local3.children.length){
_local4 = _local3.getDescendantByName(_arg1);
if (_local4){
return (_local4);
};
};
_local2--;
};
return (null);
}
function removeFromRoot():void{
if (!_rootComponent){
return;
};
_rootComponent.removeComponentFromPM(this);
_rootComponent = null;
onRemovedFromRoute();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
Component(children[_local1]).removeFromRoot();
_local1--;
};
}
public function getChildById(_arg1:int):Component{
var _local2:int = (children.length - 1);
while (_local2 > -1) {
if (_arg1 == children[_local2].id){
return (children[_local2]);
};
_local2--;
};
return (null);
}
public function sleep():void{
if (_sleeping){
return;
};
_sleeping = true;
if (!paused){
_wasActive = _active;
if (_active){
dispatchEvent(new Event(ComponentEvents.DEACTIVATED));
_active = false;
onDeactivated();
};
};
onSlept();
}
public function wakeUp():void{
if (!_sleeping){
return;
};
_sleeping = false;
if (!paused){
if (_wasActive){
dispatchEvent(new Event(ComponentEvents.ACTIVATED));
_active = true;
onActivated();
};
};
onWokeUp();
}
function removed():void{
onRemoved();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
children[_local1].removed();
_local1--;
};
}
protected function onAdded():void{
}
public function get root():RootComponent{
return (_rootComponent);
}
public function getDescendantById(_arg1:int):Component{
var _local3:Component;
var _local4:Component;
var _local2:int = (children.length - 1);
while (_local2 > -1) {
_local3 = children[_local2];
if (_local3.id == _arg1){
return (_local3);
};
if (_local3.children.length){
_local4 = _local3.getDescendantById(_arg1);
if (_local4){
return (_local4);
};
};
_local2--;
};
return (null);
}
public function getChildrenById(_arg1:int):Array{
var _local2:Array = new Array();
var _local3:int = (children.length - 1);
while (_local3 > -1) {
if (children[_local3].id == _arg1){
_local2.push(children[_local3]);
};
_local3--;
};
return (_local2);
}
public function sleepRecursively():void{
sleep();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
children[_local1].sleepRecursively();
_local1--;
};
}
public function pauseRecursively():void{
pause();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
children[_local1].pauseRecursively();
_local1--;
};
}
protected function onAddedToRoute():void{
}
public function wakeUpRecursively():void{
wakeUp();
var _local1:int = (children.length - 1);
while (_local1 > -1) {
children[_local1].wakeUpRecursively();
_local1--;
};
}
public function activate():void{
if (((_paused) || (_sleeping))){
_wasActive = true;
return;
};
if (_active){
return;
};
dispatchEvent(new Event(ComponentEvents.ACTIVATED));
_active = true;
onActivated();
}
public function deactivate():void{
if (((_paused) || (_sleeping))){
_wasActive = false;
return;
};
if (!_active){
return;
};
dispatchEvent(new Event(ComponentEvents.DEACTIVATED));
_active = false;
onDeactivated();
}
public function pause():void{
if (_paused){
return;
};
_paused = true;
if (!_sleeping){
_wasActive = _active;
if (_active){
dispatchEvent(new Event(ComponentEvents.DEACTIVATED));
_active = false;
onDeactivated();
};
};
onPaused();
}
public function removeChild(_arg1:Component):Component{
var _local2:int = children.indexOf(_arg1);
if (_local2 == -1){
return (null);
};
_arg1 = children[_local2];
_arg1.removeFromRoot();
_arg1.removed();
_arg1.setParent(null);
onChildRemoved(_arg1);
return (children.splice(_local2, 1)[0]);
}
public function addChild(_arg1:Component):Component{
if (_arg1.parent == this){
return (_arg1);
};
if (_arg1.parent){
_arg1.parent.removeChild(_arg1);
};
children.push(_arg1);
_arg1.setParent(this);
if (_rootComponent){
_arg1.addToRoot(_rootComponent);
};
_arg1.added();
onChildAdded(_arg1);
return (_arg1);
}
protected function onPaused():void{
}
function addToRoot(_arg1:RootComponent):void{
_arg1.addComponentToPM(this);
this._rootComponent = _arg1;
var _local2:int = (children.length - 1);
while (_local2 > -1) {
Component(children[_local2]).addToRoot(_arg1);
_local2--;
};
onAddedToRoute();
}
}
}//package framework._component
Section 214
//ComponentEvents (framework._component.ComponentEvents)
package framework._component {
public class ComponentEvents {
public static const DEACTIVATED:String = "deactivated";
public static const ACTIVATED:String = "activated";
}
}//package framework._component
Section 215
//RootComponent (framework._component.RootComponent)
package framework._component {
import flash.display.*;
import framework._core.*;
public class RootComponent extends Component {
private var processManager:ProcessManager;
public var stage:Stage;
public function RootComponent(_arg1:ProcessManager, _arg2:Stage){
this.processManager = _arg1;
this.stage = _arg2;
}
function removeComponentFromPM(_arg1:Component):void{
processManager.removeComponent(_arg1);
}
function addComponentToPM(_arg1:Component):void{
processManager.addComponent(_arg1);
}
override public function addChild(_arg1:Component):Component{
if (_arg1.parent == this){
return (_arg1);
};
if (_arg1.parent){
_arg1.parent.removeChild(_arg1);
};
children.push(_arg1);
_arg1.setParent(this);
_arg1.addToRoot(this);
_arg1.added();
return (_arg1);
}
override public function addChildAt(_arg1:Component, _arg2:int):Component{
var _local3:Array;
if ((((_arg2 < 0)) || ((_arg2 > children.length)))){
throw (new Error("El indice proporcionado esta fuera de los limites"));
};
if (_arg1.parent == this){
return (_arg1);
};
if (_arg1.parent){
_arg1.parent.removeChild(_arg1);
};
if (_arg2 == children.length){
children.push(_arg1);
} else {
if (_arg2 == 0){
children.unshift(_arg1);
} else {
_local3 = children.splice(_arg2);
children.push(_arg1);
children = children.concat(_local3);
};
};
_arg1.setParent(this);
_arg1.addToRoot(this);
_arg1.added();
return (_arg1);
}
}
}//package framework._component
Section 216
//WorldObject (framework._component.WorldObject)
package framework._component {
import flash.display.*;
import framework._utils._math.*;
import framework._core.*;
public class WorldObject extends Component implements IDrawable {
public var parentWorldObject:WorldObject;// = null
public var position:Vector3;
public var canvas:Sprite;
public var rotation:Vector3;
public function WorldObject(){
position = new Vector3();
rotation = new Vector3();
canvas = new Sprite();
super();
}
public function draw():void{
canvas.x = position.x;
canvas.y = position.y;
}
override public function removeChildAt(_arg1:int):Component{
var _local2:Component = super.removeChildAt(_arg1);
if (_local2){
if ((_local2 is WorldObject)){
canvas.removeChild(WorldObject(_local2).canvas);
};
return (_local2);
};
return (null);
}
public function get globalPosition():Vector3{
if (parentWorldObject){
return (Vector3.add(parentWorldObject.globalPosition, position));
};
return (position);
}
override public function addChildAt(_arg1:Component, _arg2:int):Component{
if (!(((_arg1 is WorldObject)) || ((_arg1 is Behavior)))){
throw (new Error("Un WorldObject solo puede tener como hijo a otro WorldObject o un Behavior"));
};
if ((_arg1 is WorldObject)){
canvas.addChildAt(WorldObject(_arg1).canvas, _arg2);
WorldObject(_arg1).parentWorldObject = this;
} else {
Behavior(_arg1).parentWorldObject = this;
};
return (super.addChildAt(_arg1, _arg2));
}
override public function addChild(_arg1:Component):Component{
if (!(((_arg1 is WorldObject)) || ((_arg1 is Behavior)))){
throw (new Error("Un WorldObject solo puede tener como hijo a otro WorldObject o un Behavior"));
};
if ((_arg1 is WorldObject)){
canvas.addChild(WorldObject(_arg1).canvas);
WorldObject(_arg1).parentWorldObject = this;
} else {
Behavior(_arg1).parentWorldObject = this;
};
return (super.addChild(_arg1));
}
override public function removeChild(_arg1:Component):Component{
if (super.removeChild(_arg1)){
if ((_arg1 is WorldObject)){
canvas.removeChild(WorldObject(_arg1).canvas);
};
return (_arg1);
};
return (null);
}
}
}//package framework._component
Section 217
//Fandango (framework._core.Fandango)
package framework._core {
import flash.display.*;
import flash.events.*;
import framework._component.*;
import framework._flow.*;
import framework._flow._transitionMethod.*;
import framework._utils._console.*;
import framework._input.*;
import framework._utils._fps.*;
public class Fandango {
private var started:Boolean;// = false
private var root:RootComponent;
private var stage:Stage;// = null
private var firstTransition:Transition;
private var flow:Flow;
private var keys:Keys;
public var canvas:Sprite;
private var processManager:ProcessManager;
public function Fandango(_arg1:Stage){
canvas = new Sprite();
flow = new Flow();
firstTransition = new Transition();
keys = Keys.getInstance();
super();
this.stage = _arg1;
canvas.addChild(flow.canvas);
FandangoCfg.width = _arg1.stageWidth;
FandangoCfg.height = _arg1.stageHeight;
processManager = new ProcessManager();
root = new RootComponent(processManager, _arg1);
}
public function enableDebugMode():void{
if (((FandangoCfg.debug) || (started))){
return;
};
FandangoCfg.debug = true;
canvas.addChild(new FPS(FandangoCfg.width, FandangoCfg.height, true));
Console.getInstance().initialize(FandangoCfg.width, FandangoCfg.height);
canvas.addChild(Console.getInstance().canvas);
}
public function startAt(_arg1:Screen):void{
if (started){
return;
};
started = true;
Keys.getInstance().start(stage);
firstTransition.targetScreen = _arg1;
flow.start(firstTransition);
processManager.start();
root.addChild(flow);
if (!FandangoCfg.debug){
canvas.addEventListener(Event.ENTER_FRAME, onEnterFrame);
} else {
canvas.addEventListener(Event.ENTER_FRAME, onDebugEnterFrame);
};
}
private function onDebugEnterFrame(_arg1:Event):void{
if (keyDown(Keys.BACKWARD_SLASH)){
if (Console.getInstance().getIsOpen()){
Console.getInstance().close();
} else {
Console.getInstance().open();
};
};
processManager.update();
keys.update();
}
private function onEnterFrame(_arg1:Event):void{
processManager.update();
keys.update();
}
public function addEnterMethod(_arg1:TransitionMethod):void{
firstTransition.addEnterMethod(_arg1);
}
}
}//package framework._core
Section 218
//FandangoCfg (framework._core.FandangoCfg)
package framework._core {
public class FandangoCfg {
public static var debug:Boolean = false;
public static var width:int = 0;
public static var height:int = 0;
}
}//package framework._core
Section 219
//IDrawable (framework._core.IDrawable)
package framework._core {
public interface IDrawable {
function draw():void;
}
}//package framework._core
Section 220
//IUpdateable (framework._core.IUpdateable)
package framework._core {
public interface IUpdateable {
function update():void;
}
}//package framework._core
Section 221
//IUpdateableEarly (framework._core.IUpdateableEarly)
package framework._core {
public interface IUpdateableEarly {
function updateEarly():void;
}
}//package framework._core
Section 222
//IUpdateableLate (framework._core.IUpdateableLate)
package framework._core {
public interface IUpdateableLate {
function updateLate():void;
}
}//package framework._core
Section 223
//ProcessManager (framework._core.ProcessManager)
package framework._core {
import flash.events.*;
import framework._component.*;
import flash.utils.*;
public class ProcessManager {
private var previousTime:int;
private var updateEarlyArr:Array;
private var componentArr:Array;
private var updateLateArr:Array;
private var updateArr:Array;
private var drawArr:Array;
public static var DT:Number = 0;
public function ProcessManager(){
componentArr = new Array();
updateEarlyArr = new Array();
updateArr = new Array();
updateLateArr = new Array();
drawArr = new Array();
super();
}
private function onComponentDeactivated(_arg1:Event):void{
var _local3:int;
var _local2:Component = Component(_arg1.target);
if ((_local2 is IUpdateableEarly)){
_local3 = updateEarlyArr.indexOf(IUpdateableEarly(_local2).updateEarly);
if (_local3 != -1){
updateEarlyArr.splice(_local3, 1);
};
};
if ((_local2 is IUpdateable)){
_local3 = updateArr.indexOf(IUpdateable(_local2).update);
if (_local3 != -1){
updateArr.splice(_local3, 1);
};
};
if ((_local2 is IUpdateableLate)){
_local3 = updateLateArr.indexOf(IUpdateableLate(_local2).updateLate);
if (_local3 != -1){
updateLateArr.splice(_local3, 1);
};
};
if ((_local2 is IDrawable)){
_local3 = drawArr.indexOf(IDrawable(_local2).draw);
if (_local3 != -1){
drawArr.splice(_local3, 1);
};
};
}
public function start():void{
previousTime = getTimer();
}
public function update():void{
var _local1:int = getTimer();
DT = ((_local1 - previousTime) / 1000);
var _local2:int = (updateEarlyArr.length - 1);
while (_local2 > -1) {
var _local3 = updateEarlyArr;
_local3[_local2]();
_local2--;
};
_local2 = (updateArr.length - 1);
while (_local2 > -1) {
_local3 = updateArr;
_local3[_local2]();
_local2--;
};
_local2 = (updateLateArr.length - 1);
while (_local2 > -1) {
_local3 = updateLateArr;
_local3[_local2]();
_local2--;
};
_local2 = (drawArr.length - 1);
while (_local2 > -1) {
_local3 = drawArr;
_local3[_local2]();
_local2--;
};
previousTime = _local1;
}
private function onComponentActivated(_arg1:Event):void{
var _local2:Component = Component(_arg1.target);
if ((_local2 is IUpdateableEarly)){
updateEarlyArr.push(IUpdateableEarly(_local2).updateEarly);
};
if ((_local2 is IUpdateable)){
updateArr.push(IUpdateable(_local2).update);
};
if ((_local2 is IUpdateableLate)){
updateLateArr.push(IUpdateableLate(_local2).updateLate);
};
if ((_local2 is IDrawable)){
drawArr.push(IDrawable(_local2).draw);
};
}
public function removeComponent(_arg1:Component):Boolean{
var _local2:int = componentArr.indexOf(_arg1);
if (_local2 == -1){
return (false);
};
componentArr.splice(_local2, 1);
if ((_arg1 is IUpdateableEarly)){
_local2 = updateEarlyArr.indexOf(IUpdateableEarly(_arg1).updateEarly);
if (_local2 != -1){
updateEarlyArr.splice(_local2, 1);
};
};
if ((_arg1 is IUpdateable)){
_local2 = updateArr.indexOf(IUpdateable(_arg1).update);
if (_local2 != -1){
updateArr.splice(_local2, 1);
};
};
if ((_arg1 is IUpdateableLate)){
_local2 = updateLateArr.indexOf(IUpdateableLate(_arg1).updateLate);
if (_local2 != -1){
updateLateArr.splice(_local2, 1);
};
};
if ((_arg1 is IDrawable)){
_local2 = drawArr.indexOf(IDrawable(_arg1).draw);
if (_local2 != -1){
drawArr.splice(_local2, 1);
};
};
_arg1.removeEventListener(ComponentEvents.ACTIVATED, onComponentActivated);
_arg1.removeEventListener(ComponentEvents.DEACTIVATED, onComponentDeactivated);
return (true);
}
public function addComponent(_arg1:Component):void{
if (componentArr.indexOf(_arg1) != -1){
return;
};
componentArr.push(_arg1);
if (_arg1.active){
if ((_arg1 is IUpdateableEarly)){
updateEarlyArr.push(IUpdateableEarly(_arg1).updateEarly);
};
if ((_arg1 is IUpdateable)){
updateArr.push(IUpdateable(_arg1).update);
};
if ((_arg1 is IUpdateableLate)){
updateLateArr.push(IUpdateableLate(_arg1).updateLate);
};
if ((_arg1 is IDrawable)){
drawArr.push(IDrawable(_arg1).draw);
};
};
_arg1.addEventListener(ComponentEvents.ACTIVATED, onComponentActivated);
_arg1.addEventListener(ComponentEvents.DEACTIVATED, onComponentDeactivated);
}
}
}//package framework._core
Section 224
//EventsFw (framework._event.EventsFw)
package framework._event {
public class EventsFw {
public static const SWF_LOADED:String = "swfLoaded";
public static const BTN_EVENT:String = "btnEvent";
public static const CONFIG_LOADED:String = "configLoaded";
public static const GOTO_PLAY:String = "gotoPlay";
public static const START_TRANSITION:String = "startTransition";
public static const FLOW_NEXT:String = "flowNext";
public static const ASSET_LOADED:String = "assetLoaded";
public static const STOP_FRAME:String = "stopFrame";
public static const FLOW_BACK:String = "flowBack";
public static const FLOW_GOTO:String = "flowGoTo";
public static const GOTO_STOP:String = "gotoStop";
}
}//package framework._event
Section 225
//EventValue (framework._event.EventValue)
package framework._event {
import flash.events.*;
public class EventValue extends Event {
public var value;
public function EventValue(_arg1:String, _arg2=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.value = _arg2;
}
override public function clone():Event{
var _local1:EventValue = new EventValue(this.type);
_local1.value = this.value;
return (_local1);
}
}
}//package framework._event
Section 226
//GlobalDispatcher (framework._event.GlobalDispatcher)
package framework._event {
import flash.display.*;
public var GlobalDispatcher:Sprite;
var _slot1 = new Sprite();
}//package framework._event
Section 227
//AlphaTransitionMethod (framework._flow._transitionMethod.AlphaTransitionMethod)
package framework._flow._transitionMethod {
import flash.display.*;
public class AlphaTransitionMethod extends TweenTransitionMethod {
public function AlphaTransitionMethod(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Function=null):void{
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
override protected function loadVars():void{
vars.alpha = _to;
}
override public function resetDisplayObjectTarget():void{
super.resetDisplayObjectTarget();
displayObjectTarget.alpha = from;
}
}
}//package framework._flow._transitionMethod
Section 228
//AnimationTransitionMethod (framework._flow._transitionMethod.AnimationTransitionMethod)
package framework._flow._transitionMethod {
import flash.display.*;
import flash.events.*;
import framework._utils._timer.*;
public class AnimationTransitionMethod extends TransitionMethod {
public var endFrame:Object;// = null
public var startFrame:Object;// = null
public function AnimationTransitionMethod(_arg1:DisplayObject, _arg2:Object, _arg3:Object=null, _arg4:Number=0):void{
super(_arg1, _arg4);
if (!(((_arg2 is String)) || ((_arg2 is Number)))){
throw (new Error(("AnimationTransitionMethod: " + "el valor asignado a startFrame debe ser de tipo Number o String")));
};
if (_arg3 != null){
if (!(((_arg3 is String)) || ((_arg3 is Number)))){
throw (new Error(("AnimationTransitionMethod: " + "el valor asignado a endFrame debe ser de tipo Number o String")));
};
};
this.startFrame = _arg2;
this.endFrame = _arg3;
}
override public function start():void{
super.start();
if (delay > 0){
TimerEx.start(1, delay, startAnim);
} else {
startAnim();
};
}
override public function resetDisplayObjectTarget():void{
super.resetDisplayObjectTarget();
MovieClip(displayObjectTarget).gotoAndStop(1);
}
private function startAnim():void{
MovieClip(displayObjectTarget).gotoAndPlay(startFrame);
displayObjectTarget.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event):void{
var _local2:MovieClip = MovieClip(displayObjectTarget);
if (endFrame){
if ((endFrame is String)){
if (_local2.currentLabel == endFrame){
_local2.stop();
displayObjectTarget.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
dispatchEvent(new Event(COMPLETE));
};
} else {
if (_local2.currentFrame == endFrame){
_local2.stop();
displayObjectTarget.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
dispatchEvent(new Event(COMPLETE));
};
};
} else {
if (_local2.currentFrame == _local2.totalFrames){
_local2.stop();
displayObjectTarget.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
dispatchEvent(new Event(COMPLETE));
} else {
if ((startFrame is String)){
if (_local2.currentLabel != startFrame){
_local2.gotoAndStop((_local2.currentFrame - 1));
displayObjectTarget.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
dispatchEvent(new Event(COMPLETE));
};
};
};
};
}
}
}//package framework._flow._transitionMethod
Section 229
//TransitionMethod (framework._flow._transitionMethod.TransitionMethod)
package framework._flow._transitionMethod {
import flash.display.*;
import flash.events.*;
public class TransitionMethod extends EventDispatcher {
public var delay:Number;// = 0
protected var displayObjectTarget:DisplayObject;
public static const COMPLETE:String = "complete";
public function TransitionMethod(_arg1:DisplayObject, _arg2:Number=0){
this.displayObjectTarget = _arg1;
this.delay = _arg2;
}
public function start():void{
}
public function resetDisplayObjectTarget():void{
}
}
}//package framework._flow._transitionMethod
Section 230
//TweenTransitionMethod (framework._flow._transitionMethod.TweenTransitionMethod)
package framework._flow._transitionMethod {
import flash.display.*;
import flash.events.*;
import gs.*;
import gs.easing.*;
public class TweenTransitionMethod extends TransitionMethod {
public var from:Number;// = 0
protected var tween:TweenMax;// = null
protected var vars:Object;// = null
public var easeFunc:Function;// = null
public var duration:Number;// = 0
public var _to:Number;// = 0
public static const COMPLETE:String = "complete";
public function TweenTransitionMethod(_arg1:DisplayObject, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Function=null):void{
super(_arg1, _arg5);
this.duration = _arg2;
this.from = _arg3;
this._to = _arg4;
this.easeFunc = ((_arg6 == null)) ? Linear.easeOut : _arg6;
}
override public function start():void{
super.start();
if (!vars){
vars = {onComplete:onTweenComplete, delay:this.delay};
if (easeFunc != null){
vars.ease = easeFunc;
};
loadVars();
};
tween = new TweenMax(displayObjectTarget, duration, vars);
}
protected function onTweenComplete():void{
dispatchEvent(new Event(COMPLETE));
}
protected function loadVars():void{
}
}
}//package framework._flow._transitionMethod
Section 231
//Flow (framework._flow.Flow)
package framework._flow {
import flash.events.*;
import framework._component.*;
import flash.utils.*;
public class Flow extends WorldObject {
private var nextScreen:Screen;
private var swapAllDict:Dictionary;
private var canChangeScreen:Boolean;// = true
private var prevScreen:Screen;
public function Flow(){
swapAllDict = new Dictionary();
super();
}
private function add(_arg1:Transition):void{
if (_arg1.targetProxyScreen){
if (((_arg1.targetProxyScreen.reInstantiate) || ((_arg1.targetScreen == null)))){
_arg1.targetProxyScreen.instantiateScreen();
};
_arg1.targetScreen = _arg1.targetProxyScreen.screenInstance;
};
if (_arg1.addScreenAt == -1){
addChild(_arg1.targetScreen);
} else {
addChildAt(_arg1.targetScreen, _arg1.addScreenAt);
};
_arg1.targetScreen.addEventListener(TransitionEvent.EXECUTE_TRANSITION, onExecuteTransition);
_arg1.targetScreen.enter(_arg1.owner);
_arg1.addEventListener(Transition.ENTER_COMPLETE, onEnterTransitionComplete);
_arg1.executeEnterMethods();
}
public function start(_arg1:Transition):void{
add(_arg1);
}
private function remove(_arg1:Transition):void{
if (_arg1.targetProxyScreen){
_arg1.targetScreen = _arg1.targetProxyScreen.screenInstance;
};
_arg1.targetScreen.removeEventListener(TransitionEvent.EXECUTE_TRANSITION, onExecuteTransition);
_arg1.targetScreen.exit(null);
_arg1.addEventListener(Transition.EXIT_COMPLETE, onExitTransitionComplete);
_arg1.executeExitMethods();
}
private function onEnterTransitionComplete(_arg1:Event):void{
var _local2:Transition = Transition(_arg1.target);
_local2.removeEventListener(Transition.ENTER_COMPLETE, onEnterTransitionComplete);
_local2.targetScreen.initialize(_local2.id);
}
private function swapAll(_arg1:Transition):void{
var _local2:Screen;
for each (_local2 in children) {
_local2.exit(_arg1.id);
};
swapAllDict[_arg1] = children.concat();
_arg1.addEventListener(Transition.EXIT_COMPLETE, onExitTransitionComplete);
_arg1.executeExitMethods();
if (!_arg1.enterOnPrevFinalized){
add(_arg1);
};
}
private function onExecuteTransition(_arg1:TransitionEvent):void{
var _local2:Transition = _arg1.transition;
_local2.resetDisplayObjectTargets();
if (_local2.type == TransitionType.ADD){
add(_local2);
} else {
if (_local2.type == TransitionType.REMOVE){
remove(_local2);
} else {
if (_local2.type == TransitionType.SWAP){
swap(_local2);
} else {
if (_local2.type == TransitionType.SWAP_ALL){
swapAll(_local2);
};
};
};
};
}
private function swap(_arg1:Transition):void{
_arg1.owner.removeEventListener(TransitionEvent.EXECUTE_TRANSITION, onExecuteTransition);
_arg1.owner.exit(_arg1.id);
_arg1.addEventListener(Transition.EXIT_COMPLETE, onExitTransitionComplete);
_arg1.executeExitMethods();
if (!_arg1.enterOnPrevFinalized){
add(_arg1);
};
}
private function onExitTransitionComplete(_arg1:Event):void{
var _local3:Screen;
var _local2:Transition = Transition(_arg1.target);
_local2.removeEventListener(Transition.EXIT_COMPLETE, onExitTransitionComplete);
if (_local2.type == TransitionType.SWAP_ALL){
for each (_local3 in swapAllDict[_local2]) {
_local3.finalize(_local2.id);
removeChild(_local3);
};
} else {
if (_local2.type == TransitionType.SWAP){
_local2.owner.finalize(_local2.id);
removeChild(_local2.owner);
} else {
if (_local2.type == TransitionType.REMOVE){
_local2.targetScreen.finalize(_local2.id);
removeChild(_local2.targetScreen);
};
};
};
if (((_local2.enterOnPrevFinalized) && (!((_local2.type == TransitionType.REMOVE))))){
add(_local2);
};
}
}
}//package framework._flow
Section 232
//ProxyScreen (framework._flow.ProxyScreen)
package framework._flow {
import flash.utils.*;
public class ProxyScreen extends Screen {
public var screenInstance:Screen;// = null
public var screenClassName:String;
public var reInstantiate:Boolean;
public function ProxyScreen(_arg1:String, _arg2:Boolean=false){
this.screenClassName = _arg1;
this.reInstantiate = _arg2;
}
public function instantiateScreen():void{
var _local2:Transition;
var _local1:Class = (getDefinitionByName(screenClassName) as Class);
screenInstance = new (_local1);
screenInstance.transitionDict = transitionDict;
for each (_local2 in screenInstance.transitionDict) {
_local2.owner = screenInstance;
};
}
}
}//package framework._flow
Section 233
//Screen (framework._flow.Screen)
package framework._flow {
import flash.display.*;
import flash.events.*;
import framework._component.*;
import flash.utils.*;
public class Screen extends WorldObject {
var transitionDict:Dictionary;
public var isExiting:Boolean;// = false
public var isEntering:Boolean;// = false
public function Screen(){
transitionDict = new Dictionary();
super();
canvas.mouseEnabled = false;
}
protected function onButtonRollOut(_arg1:MouseEvent):void{
}
protected function registerMovieClipAsButton(_arg1:MovieClip):void{
_arg1.buttonMode = true;
_arg1.mouseChildren = false;
_arg1.addEventListener(MouseEvent.MOUSE_OVER, onButtonRollOver);
_arg1.addEventListener(MouseEvent.MOUSE_OUT, onButtonRollOut);
_arg1.addEventListener(MouseEvent.CLICK, onButtonClick);
}
protected function onButtonRollOver(_arg1:MouseEvent):void{
}
protected function onFinalize(_arg1:String):void{
}
function finalize(_arg1:String):void{
isExiting = false;
onFinalize(_arg1);
}
public function executeTransition(_arg1:String):void{
if (transitionDict[_arg1] == undefined){
throw (new Error(((("La screen " + name) + " no posee la transicion ") + _arg1)));
};
dispatchEvent(new TransitionEvent(TransitionEvent.EXECUTE_TRANSITION, transitionDict[_arg1]));
}
protected function onInitialize(_arg1:String):void{
}
function initialize(_arg1:String):void{
canvas.mouseChildren = true;
isEntering = false;
onInitialize(_arg1);
}
public function createTransition(_arg1:String, _arg2:Screen, _arg3:String="swap"):Transition{
var _local4:Transition = new Transition();
if ((_arg2 is ProxyScreen)){
_local4.targetProxyScreen = ProxyScreen(_arg2);
} else {
_local4.targetScreen = _arg2;
};
_local4.id = _arg1;
_local4.owner = this;
_local4.type = _arg3;
transitionDict[_arg1] = _local4;
return (_local4);
}
protected function onButtonClick(_arg1:MouseEvent):void{
}
function enter(_arg1:Screen):void{
canvas.mouseChildren = false;
isEntering = true;
onEnter(_arg1);
}
protected function onEnter(_arg1:Screen):void{
}
protected function onExit(_arg1:String):void{
}
function exit(_arg1:String):void{
canvas.mouseChildren = false;
isExiting = true;
onExit(_arg1);
}
}
}//package framework._flow
Section 234
//Transition (framework._flow.Transition)
package framework._flow {
import flash.events.*;
import framework._flow._transitionMethod.*;
public class Transition extends EventDispatcher {
public var addScreenAt:int;// = -1
public var type:String;// = ""
var exitMethodArr:Array;
var enterMethodArr:Array;
private var enterTransitionsCounter:int;// = 0
public var id:String;// = ""
private var exitTransitionsCounter:int;// = 0
public var targetScreen:Screen;// = null
public var targetProxyScreen:ProxyScreen;// = null
public var owner:Screen;// = null
public var enterOnPrevFinalized:Boolean;// = true
static const ENTER_COMPLETE:String = "enterComplete";
static const EXIT_COMPLETE:String = "exitComplete";
public function Transition(){
enterMethodArr = new Array();
exitMethodArr = new Array();
super();
}
public function executeExitMethods():void{
var _local2:TransitionMethod;
if (exitMethodArr.length == 0){
dispatchEvent(new Event(EXIT_COMPLETE));
return;
};
var _local1:int;
while (_local1 < exitMethodArr.length) {
_local2 = exitMethodArr[_local1];
exitTransitionsCounter++;
_local2.addEventListener(TransitionMethod.COMPLETE, onExitMethodComplete);
_local2.start();
_local1++;
};
}
public function executeEnterMethods():void{
var _local2:TransitionMethod;
if (enterMethodArr.length == 0){
dispatchEvent(new Event(ENTER_COMPLETE));
return;
};
var _local1:int;
while (_local1 < enterMethodArr.length) {
_local2 = enterMethodArr[_local1];
enterTransitionsCounter++;
_local2.addEventListener(TransitionMethod.COMPLETE, onEnterMethodComplete);
_local2.start();
_local1++;
};
}
private function onEnterMethodComplete(_arg1:Event):void{
TransitionMethod(_arg1.target).removeEventListener(TransitionMethod.COMPLETE, onEnterMethodComplete);
enterTransitionsCounter--;
if (enterTransitionsCounter == 0){
dispatchEvent(new Event(ENTER_COMPLETE));
};
}
function resetDisplayObjectTargets():void{
var _local1:int;
while (_local1 < enterMethodArr.length) {
TransitionMethod(enterMethodArr[_local1]).resetDisplayObjectTarget();
_local1++;
};
_local1 = 0;
while (_local1 < exitMethodArr.length) {
TransitionMethod(exitMethodArr[_local1]).resetDisplayObjectTarget();
_local1++;
};
}
public function addExitMethod(_arg1:TransitionMethod):void{
exitMethodArr.push(_arg1);
}
private function onExitMethodComplete(_arg1:Event):void{
TransitionMethod(_arg1.target).removeEventListener(TransitionMethod.COMPLETE, onExitMethodComplete);
exitTransitionsCounter--;
if (exitTransitionsCounter == 0){
dispatchEvent(new Event(EXIT_COMPLETE));
};
}
public function addEnterMethod(_arg1:TransitionMethod):void{
enterMethodArr.push(_arg1);
}
}
}//package framework._flow
Section 235
//TransitionEvent (framework._flow.TransitionEvent)
package framework._flow {
import flash.events.*;
public class TransitionEvent extends Event {
public var transition:Transition;// = null
public static const EXECUTE_TRANSITION:String = "executeTransition";
public function TransitionEvent(_arg1:String, _arg2:Transition, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.transition = _arg2;
}
}
}//package framework._flow
Section 236
//TransitionType (framework._flow.TransitionType)
package framework._flow {
public class TransitionType {
public static const ADD:String = "add";
public static const SWAP:String = "swap";
public static const REMOVE:String = "remove";
public static const SWAP_ALL:String = "swapAll";
}
}//package framework._flow
Section 237
//keyDown (framework._input.keyDown)
package framework._input {
public function keyDown(_arg1:int):Boolean{
return (Keys.getInstance().keyDown(_arg1));
}
}//package framework._input
Section 238
//keyPressed (framework._input.keyPressed)
package framework._input {
public function keyPressed(_arg1:int):Boolean{
return (Keys.getInstance().keyPressed(_arg1));
}
}//package framework._input
Section 239
//Keys (framework._input.Keys)
package framework._input {
import flash.display.*;
import flash.events.*;
public class Keys {
private var listener:InteractiveObject;
private var keyLast:Array;
private var key:Array;
public static const BACKWARD_SLASH:int = 220;
public static const RIGHT:int = 39;
public static const LEFT:int = 37;
public static const SPACEBAR:int = 32;
public static const FOUR:int = 52;
public static const TWO:int = 50;
public static const CLEAR:int = 12;
public static const TILDE:int = 192;
public static const CONTROL:int = 17;
public static const NUMPAD_DECIMAL:int = 110;
public static const A:int = 65;
public static const B:int = 66;
public static const C:int = 67;
public static const D:int = 68;
public static const E:int = 69;
public static const F:int = 70;
public static const G:int = 71;
public static const H:int = 72;
public static const I:int = 73;
public static const J:int = 74;
public static const K:int = 75;
public static const L:int = 76;
public static const M:int = 77;
public static const N:int = 78;
public static const O:int = 79;
public static const P:int = 80;
public static const Q:int = 81;
public static const R:int = 82;
public static const S:int = 83;
public static const T:int = 84;
public static const U:int = 85;
public static const V:int = 86;
public static const W:int = 87;
public static const X:int = 88;
public static const Y:int = 89;
public static const Z:int = 90;
public static const ONE:int = 49;
public static const PAGE_UP:int = 33;
public static const NUMPAD_ENTER:int = 108;
public static const COLON:int = 186;
public static const BACKSPACE:int = 8;
public static const EIGHT:int = 56;
public static const SHIFT:int = 16;
public static const TAB:int = 9;
public static const THREE:int = 51;
public static const HELP:int = 47;
public static const QUOTES:int = 222;
public static const ALT:int = 18;
public static const NUMPAD_ADD:int = 107;
public static const ESC:int = 27;
public static const F3:int = 114;
public static const ZERO:int = 48;
public static const F4:int = 115;
public static const F5:int = 116;
public static const F6:int = 117;
public static const F7:int = 118;
public static const FIVE:int = 53;
public static const NUMPAD_DIVIDE:int = 111;
public static const F2:int = 113;
public static const CLOSED_BRACKET:int = 221;
public static const UP:int = 38;
public static const NUMPAD_0:int = 96;
public static const NUMPAD_1:int = 97;
public static const NUMPAD_2:int = 98;
public static const NUMPAD_3:int = 99;
public static const SIX:int = 54;
public static const NUMPAD_5:int = 101;
public static const NUMPAD_6:int = 102;
public static const NUMPAD_7:int = 103;
public static const NUMPAD_SUBTRACT:int = 109;
public static const NUMPAD_9:int = 105;
public static const INSERT:int = 45;
public static const NUMPAD_4:int = 100;
public static const NINE:int = 57;
public static const F9:int = 120;
public static const NUMPAD_8:int = 104;
public static const DOWN:int = 40;
public static const ENTER:int = 13;
public static const F8:int = 119;
public static const NUMPAD_MULTIPLY:int = 106;
public static const EQUALS:int = 187;
public static const F1:int = 112;
public static const OPEN_BRACKET:int = 219;
public static const UNDERSCORE:int = 189;
public static const HOME:int = 36;
public static const DELETE:int = 46;
public static const F10:int = 121;
public static const F11:int = 122;
public static const F12:int = 123;
public static const PAGE_DOWN:int = 34;
public static const QUESTION_MARK:int = 191;
public static const SEVEN:int = 55;
public static const END:int = 35;
public static const CAPS_LOCK:int = 20;
public static const NUM_LOCK:int = 144;
private static var instance:Keys;
public function Keys(){
key = new Array();
keyLast = new Array();
super();
}
public function keyDown(_arg1:int):Boolean{
if (((key[_arg1]) && (!(keyLast[_arg1])))){
return (true);
};
return (false);
}
public function onKeyDown(_arg1:KeyboardEvent):void{
key[_arg1.keyCode] = true;
}
public function keyPressed(_arg1:int):Boolean{
if (((key[_arg1]) && (keyLast[_arg1]))){
return (true);
};
return (false);
}
private function onUpdate(_arg1:Event):void{
update();
}
public function update():void{
var _local1:int;
while (_local1 < 0x0100) {
keyLast[_local1] = key[_local1];
_local1++;
};
}
public function start(_arg1:InteractiveObject):void{
removeFocusListener();
var _local2:int;
while (_local2 < 0x0100) {
key[_local2] = false;
keyLast[_local2] = false;
_local2++;
};
setFocusListener(_arg1);
}
public function keyUp(_arg1:int):Boolean{
if (((!(key[_arg1])) && (keyLast[_arg1]))){
return (true);
};
return (false);
}
private function onDeactivate(_arg1:Event):void{
var _local2:int;
while (_local2 < 0x0100) {
key[_local2] = false;
_local2++;
};
}
public function anyKeyPressed():Boolean{
var _local1:int;
while (_local1 < 0x0100) {
if (key[_local1]){
return (true);
};
_local1++;
};
return (false);
}
private function removeFocusListener():void{
if (listener){
listener.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
listener.removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
listener.removeEventListener(Event.DEACTIVATE, onDeactivate);
};
}
public function setFocusListener(_arg1:InteractiveObject):void{
removeFocusListener();
this.listener = _arg1;
this.listener.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
this.listener.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
this.listener.addEventListener(Event.DEACTIVATE, onDeactivate);
}
public function stop():void{
if (listener){
listener.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
listener.removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
listener.removeEventListener(Event.DEACTIVATE, onDeactivate);
};
}
public function onKeyUp(_arg1:KeyboardEvent):void{
key[_arg1.keyCode] = false;
}
public function getFocusListener():InteractiveObject{
return (listener);
}
public static function getInstance():Keys{
if (!instance){
instance = new (Keys);
};
return (instance);
}
}
}//package framework._input
Section 240
//MovieClipEx (framework._mcEx.MovieClipEx)
package framework._mcEx {
import flash.display.*;
import flash.events.*;
import framework._event.*;
public dynamic class MovieClipEx extends MovieClip {
private var mcRefArr:Array;
private var _paused:Boolean;// = false
private var gotoFrame:String;
private var _stopped:Boolean;
public function MovieClipEx(){
mcRefArr = new Array();
super();
addEventListener(EventsFw.GOTO_PLAY, onGotoPlay);
addEventListener(EventsFw.GOTO_STOP, onGotoStop);
addEventListener(EventsFw.STOP_FRAME, onStopFrame);
}
public function removeChildRef(_arg1:MovieClip):void{
var _local2:int;
while (_local2 < mcRefArr.length) {
if (_arg1 == mcRefArr[_local2].getMc()){
mcRefArr.splice(_local2, 1);
return;
};
_local2++;
};
}
override public function stop():void{
_stopped = true;
gotoFrame = null;
super.stop();
}
public function addMcRef(_arg1:MovieClip):void{
var _local2:MovieClipExCompo = new MovieClipExCompo(_arg1);
mcRefArr.push(_local2);
}
public function playAll():void{
play();
var _local1:int;
while (_local1 < mcRefArr.length) {
mcRefArr[_local1].play();
_local1++;
};
}
protected function onGotoStop(_arg1:EventValue):void{
if (_paused){
gotoFrame = String(_arg1.value);
_stopped = true;
return;
};
super.gotoAndStop(String(_arg1.value));
}
protected function onStopFrame(_arg1:Event):void{
super.stop();
_stopped = true;
}
public function resume():void{
if (!_paused){
return;
};
_paused = false;
if (gotoFrame != null){
if (!_stopped){
super.gotoAndPlay(gotoFrame);
gotoFrame = null;
} else {
super.gotoAndStop(gotoFrame);
gotoFrame = null;
};
} else {
if (!_stopped){
super.play();
};
};
var _local1:int;
while (_local1 < mcRefArr.length) {
MovieClipExCompo(mcRefArr[_local1]).resume();
_local1++;
};
}
public function get paused():Boolean{
return (_paused);
}
public function get stopped():Boolean{
return (_stopped);
}
public function pause():void{
if (_paused){
return;
};
_paused = true;
super.stop();
var _local1:int;
while (_local1 < mcRefArr.length) {
MovieClipExCompo(mcRefArr[_local1]).pause();
_local1++;
};
}
override public function gotoAndPlay(_arg1:Object, _arg2:String=null):void{
_stopped = false;
gotoFrame = null;
super.gotoAndPlay(_arg1);
}
protected function onGotoPlay(_arg1:EventValue):void{
if (_paused){
gotoFrame = String(_arg1.value);
_stopped = false;
return;
};
super.gotoAndPlay(String(_arg1.value));
}
override public function play():void{
_stopped = false;
gotoFrame = null;
super.play();
}
override public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
_stopped = true;
gotoFrame = null;
super.gotoAndStop(_arg1);
}
public function stopAll():void{
stop();
var _local1:int;
while (_local1 < mcRefArr.length) {
mcRefArr[_local1].stop();
_local1++;
};
}
}
}//package framework._mcEx
Section 241
//MovieClipExCompo (framework._mcEx.MovieClipExCompo)
package framework._mcEx {
import flash.display.*;
import flash.events.*;
import framework._event.*;
public class MovieClipExCompo {
private var _paused:Boolean;// = false
private var gotoFrame:String;
private var _mc:MovieClip;
private var _stopped:Boolean;
public function MovieClipExCompo(_arg1:MovieClip){
this._mc = _arg1;
_arg1.addEventListener(EventsFw.GOTO_PLAY, onGotoPlay);
_arg1.addEventListener(EventsFw.GOTO_STOP, onGotoStop);
_arg1.addEventListener(EventsFw.STOP_FRAME, onStopFrame);
}
public function stop():void{
_stopped = true;
gotoFrame = null;
_mc.stop();
}
protected function onGotoPlay(_arg1:EventValue):void{
if (_paused){
gotoFrame = String(_arg1.value);
_stopped = false;
return;
};
_mc.gotoAndPlay(String(_arg1.value));
}
protected function onGotoStop(_arg1:EventValue):void{
if (_paused){
gotoFrame = String(_arg1.value);
_stopped = true;
return;
};
_mc.gotoAndStop(String(_arg1.value));
}
public function resume():void{
if (!_paused){
return;
};
_paused = false;
if (gotoFrame != null){
if (!_stopped){
_mc.gotoAndPlay(gotoFrame);
gotoFrame = null;
} else {
_mc.gotoAndStop(gotoFrame);
gotoFrame = null;
};
} else {
if (!_stopped){
_mc.play();
};
};
}
public function gotoAndPlay(_arg1:Object, _arg2:String=null):void{
_stopped = false;
gotoFrame = null;
_mc.gotoAndPlay(_arg1, _arg2);
}
protected function onStopFrame(_arg1:Event):void{
_mc.stop();
_stopped = true;
}
public function get paused():Boolean{
return (_paused);
}
public function get stopped():Boolean{
return (_stopped);
}
public function pause():void{
if (_paused){
return;
};
_paused = true;
_mc.stop();
}
public function gotoAndStop(_arg1:Object, _arg2:String=null):void{
_stopped = true;
gotoFrame = null;
_mc.gotoAndStop(_arg1, _arg2);
}
public function get mc():MovieClip{
return (_mc);
}
public function play():void{
_stopped = false;
gotoFrame = null;
_mc.play();
}
}
}//package framework._mcEx
Section 242
//FadeEffect (framework._sound.FadeEffect)
package framework._sound {
import flash.events.*;
import gs.*;
import gs.easing.*;
public class FadeEffect extends EventDispatcher {
private var volume:Number;
private var volumeObj:Object;
private var tween:TweenMax;
private var sound:SoundEx;
public function start(_arg1:SoundEx, _arg2:Number=0.5, _arg3:Number=0, _arg4:Number=1):void{
this.sound = _arg1;
_arg1.setVolume(_arg3);
volumeObj = {volume:_arg3};
tween = new TweenMax(volumeObj, _arg2, {volume:_arg4, onUpdate:update, onComplete:complete, ease:Linear.easeNone});
}
private function update():void{
sound.setVolume(volumeObj.volume);
}
public function resume():void{
if (tween){
tween.resume();
};
}
public function pause():void{
if (tween){
tween.pause();
};
}
private function complete():void{
this.dispatchEvent(new Event("onEnd"));
}
public function end():void{
if (tween){
tween.complete();
};
dispatchEvent(new Event("onEnd"));
}
}
}//package framework._sound
Section 243
//SoundEx (framework._sound.SoundEx)
package framework._sound {
import flash.events.*;
import flash.media.*;
import framework._utils._global.*;
public class SoundEx extends EventDispatcher {
private var savedVolume:Number;
private var channel:SoundChannel;
private var pausedAt:Number;// = 0
private var endEffect:int;
private var loops:int;// = 0
private var effect:FadeEffect;// = null
public var sound:Sound;
public var id:int;
public var soundManager:SoundManager;
public var className:String;
private var maxVolume:Number;
private var proxyVolume:Number;// = 1
private var transform:SoundTransform;
private var paused:Boolean;// = false
public var soundGroup:SoundGroup;
public var soundName:String;
private var defaultVolume:Number;// = 1
public static const CURRENT_VOLUME:int = 2;
public static const SAVED_VOLUME:int = 3;
public static const FINISHED:String = "finished";
public static const EFFECT_END_STOP:int = 1;
public static const EFFECT_END_PAUSE:int = 0;
public function SoundEx(_arg1:SoundInfo):void{
transform = new SoundTransform();
super();
soundName = _arg1.soundName;
className = _arg1.className;
sound = getClassInstance(className);
maxVolume = _arg1.maxVolume;
}
override public function toString():String{
return ((("(SoundEx:" + soundName) + ")"));
}
private function onEndEffect(_arg1:Event):void{
effect.removeEventListener("onEnd", onEndEffect);
effect = null;
if (endEffect == EFFECT_END_STOP){
stop();
} else {
if (endEffect == EFFECT_END_PAUSE){
pause();
};
};
transform.volume = channel.soundTransform.volume;
}
public function pause():void{
if (paused){
return;
};
pausedAt = channel.position;
channel.removeEventListener(Event.SOUND_COMPLETE, onSoundComplete);
channel.stop();
paused = true;
if (effect){
effect.pause();
};
}
public function fade(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:int=-1):void{
if (_arg2 == CURRENT_VOLUME){
_arg2 = proxyVolume;
} else {
if (_arg2 == SAVED_VOLUME){
(_arg2 == savedVolume);
};
};
_arg2 = (_arg2 * (maxVolume * soundGroup.getVolume()));
if (_arg3 == CURRENT_VOLUME){
_arg3 = proxyVolume;
} else {
if (_arg3 == SAVED_VOLUME){
_arg3 = savedVolume;
};
};
_arg3 = (_arg3 * (maxVolume * soundGroup.getVolume()));
if (effect != null){
effect.end();
};
effect = new FadeEffect();
effect.addEventListener("onEnd", onEndEffect);
effect.start(this, _arg1, _arg2, _arg3);
this.endEffect = _arg4;
}
public function stop():void{
channel.removeEventListener(Event.SOUND_COMPLETE, onSoundComplete);
channel.stop();
complete();
}
public function play(_arg1:int, _arg2:Number):Boolean{
this.loops = _arg1;
channel = sound.play(0, _arg1);
if (!channel){
complete();
return (false);
};
setDefaultVolume(_arg2);
channel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
return (true);
}
public function setDefaultVolume(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 1){
_arg1 = 1;
};
defaultVolume = _arg1;
proxyVolume = _arg1;
if (((!(soundGroup.isMuted())) && (!(soundManager.isAllMuted())))){
transform.volume = ((_arg1 * soundGroup.getVolume()) * maxVolume);
} else {
transform.volume = 0;
};
channel.soundTransform = transform;
}
public function setMute(_arg1:Boolean):void{
if (_arg1){
transform.volume = 0;
} else {
transform.volume = ((proxyVolume * soundGroup.getVolume()) * maxVolume);
};
channel.soundTransform = transform;
}
private function onSoundComplete(_arg1:Event):void{
complete();
}
public function resume():void{
if (!paused){
return;
};
if (loops == 1){
channel = sound.play(pausedAt, loops);
} else {
channel = sound.play(0, loops);
};
setVolume(proxyVolume);
channel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
paused = false;
if (effect){
effect.resume();
};
}
public function updateVolumeFromGroup():void{
var _local1:Number = soundGroup.getVolume();
if (_local1 < 0){
_local1 = 0;
};
if (_local1 > 1){
_local1 = 1;
};
_local1 = (_local1 * defaultVolume);
proxyVolume = _local1;
if (((!(soundGroup.isMuted())) && (!(soundManager.isAllMuted())))){
transform.volume = (_local1 * maxVolume);
} else {
transform.volume = 0;
};
channel.soundTransform = transform;
}
public function saveVolume():void{
savedVolume = proxyVolume;
}
public function isPaused():Boolean{
return (paused);
}
private function complete():void{
if (effect != null){
effect.end();
};
dispatchEvent(new Event(FINISHED));
}
public function setVolume(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = (_arg1 * defaultVolume);
proxyVolume = _arg1;
if (((!(soundGroup.isMuted())) && (!(soundManager.isAllMuted())))){
transform.volume = (_arg1 * maxVolume);
} else {
transform.volume = 0;
};
channel.soundTransform = transform;
}
}
}//package framework._sound
Section 244
//SoundGroup (framework._sound.SoundGroup)
package framework._sound {
import flash.events.*;
import framework._utils._timer.*;
public class SoundGroup {
private var soundArr:Array;
private var volume:Number;// = 1
public var name:String;
private var paused:Boolean;// = false
private var fadeEndEffect:int;// = -1
private var muted:Boolean;// = false
private var fading:Boolean;// = false
public function SoundGroup(_arg1:String, _arg2:Boolean=false):void{
soundArr = [];
super();
this.name = _arg1;
this.muted = _arg2;
}
public function setDefaultVolume(_arg1:Number):void{
volume = _arg1;
var _local2:int = (soundArr.length - 1);
while (_local2 > -1) {
SoundEx(soundArr[_local2]).setDefaultVolume((_arg1 * volume));
_local2--;
};
}
private function onSoundFinished(_arg1:Event):void{
var _local2:SoundEx = SoundEx(_arg1.target);
_local2.removeEventListener(SoundEx.FINISHED, onSoundFinished);
removeSound(_local2);
}
public function isFading():Boolean{
return (fading);
}
public function stop():void{
var _local1:int = (soundArr.length - 1);
while (_local1 > -1) {
SoundEx(soundArr[_local1]).stop();
_local1--;
};
}
public function getSoundById(_arg1:int):SoundEx{
var _local2:int = (soundArr.length - 1);
while (_local2 > -1) {
if (soundArr[_local2].id == _arg1){
return (soundArr[_local2]);
};
_local2--;
};
return (null);
}
public function getVolume():Number{
return (volume);
}
private function onTimerFade():void{
if (fadeEndEffect == SoundEx.EFFECT_END_PAUSE){
paused = true;
};
fading = false;
fadeEndEffect = -1;
}
public function setMute(_arg1:Boolean):void{
if (_arg1 == muted){
return;
};
muted = _arg1;
var _local2:int = (soundArr.length - 1);
while (_local2 > -1) {
SoundEx(soundArr[_local2]).setMute(_arg1);
_local2--;
};
}
public function isMuted():Boolean{
return (muted);
}
public function removeSound(_arg1:SoundEx):void{
var _local2:int = soundArr.indexOf(_arg1);
if (_local2 != -1){
soundArr.splice(_local2, 1);
};
}
public function resume():void{
paused = false;
var _local1:int = (soundArr.length - 1);
while (_local1 > -1) {
SoundEx(soundArr[_local1]).resume();
_local1--;
};
}
public function addSound(_arg1:SoundEx):void{
soundArr.push(_arg1);
_arg1.addEventListener(SoundEx.FINISHED, onSoundFinished);
}
public function pause():void{
paused = true;
var _local1:int = (soundArr.length - 1);
while (_local1 > -1) {
SoundEx(soundArr[_local1]).pause();
_local1--;
};
}
public function saveVolume():void{
var _local1:int = (soundArr.length - 1);
while (_local1 > -1) {
SoundEx(soundArr[_local1]).saveVolume();
_local1--;
};
}
public function isPaused():Boolean{
return (paused);
}
public function getSoundByName(_arg1:String):SoundEx{
var _local2:int = (soundArr.length - 1);
while (_local2 > -1) {
if (soundArr[_local2].soundName == _arg1){
return (soundArr[_local2]);
};
_local2--;
};
return (null);
}
public function fade(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:int):void{
if (fading){
return;
};
if (_arg2 < 0){
_arg2 = 0;
};
if (_arg2 > 1){
_arg2 = 1;
};
if (_arg3 < 0){
_arg3 = 0;
};
if (_arg3 > 1){
_arg3 = 1;
};
var _local5:int = (soundArr.length - 1);
while (_local5 > -1) {
SoundEx(soundArr[_local5]).fade(_arg1, _arg2, _arg3, _arg4);
_local5--;
};
fading = true;
fadeEndEffect = _arg4;
var _local6:TimerEx = new TimerEx(1, _arg1, onTimerFade);
_local6.start();
}
public function setVolume(_arg1:Number):void{
volume = _arg1;
var _local2:int = (soundArr.length - 1);
while (_local2 > -1) {
SoundEx(soundArr[_local2]).updateVolumeFromGroup();
_local2--;
};
}
}
}//package framework._sound
Section 245
//SoundInfo (framework._sound.SoundInfo)
package framework._sound {
public class SoundInfo {
public var className:String;
public var soundName:String;
public var maxVolume:Number;
}
}//package framework._sound
Section 246
//SoundInfoList (framework._sound.SoundInfoList)
package framework._sound {
public class SoundInfoList {
private static var soundNameArr:Array = new Array();
private static var soundsArr:Array = new Array();
public static function registerSoundInfo(_arg1:String, _arg2:String, _arg3:Number):void{
var _local4:SoundInfo = new SoundInfo();
_local4.soundName = _arg1;
_local4.className = _arg2;
_local4.maxVolume = _arg3;
soundsArr[_local4.soundName] = _local4;
soundNameArr.push(_local4.soundName);
}
public static function getSoundInfo(_arg1:String):SoundInfo{
return (SoundInfo(soundsArr[_arg1]));
}
public static function checkValidSound(_arg1:String):Boolean{
var _local2:int = soundNameArr.length;
var _local3:int;
while (_local3 < _local2) {
if (_arg1 == String(soundNameArr[_local3])){
return (true);
};
_local3++;
};
return (false);
}
}
}//package framework._sound
Section 247
//SoundManager (framework._sound.SoundManager)
package framework._sound {
import flash.events.*;
import flash.utils.*;
public class SoundManager extends EventDispatcher {
private var soundGroupDict:Dictionary;
private var muted:Boolean;// = false
private static var instance:SoundManager;
private static var currentSound:int = 0;
public function SoundManager(){
soundGroupDict = new Dictionary();
super();
}
public function fadeAll(_arg1:Number=1, _arg2:Number=0, _arg3:Number=1, _arg4:int=-1):void{
var _local5:SoundGroup;
for each (_local5 in soundGroupDict) {
_local5.fade(_arg1, _arg2, _arg3, _arg4);
};
}
public function setSoundVolume(_arg1:int, _arg2:Number):void{
var _local3:SoundEx = getSoundById(_arg1);
if (!_local3){
throw (new Error("No existe un sonido con ese id."));
};
_local3.setVolume(_arg2);
}
public function getSoundIsPlaying(_arg1:int):Boolean{
var _local2:SoundEx = getSoundById(_arg1);
if (_local2){
return (!(_local2.isPaused()));
};
return (false);
}
public function getSoundIdByName(_arg1:String, _arg2:String=""):int{
var _local3:SoundEx;
var _local4:SoundGroup;
if (_arg2 == ""){
for each (_local4 in soundGroupDict) {
_local3 = _local4.getSoundByName(_arg1);
if (_local3){
return (_local3.id);
};
};
} else {
_local3 = SoundGroup(soundGroupDict[_arg2]).getSoundByName(_arg1);
if (_local3){
return (_local3.id);
};
};
return (-1);
}
public function resumeGroup(_arg1:String):void{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
SoundGroup(soundGroupDict[_arg1]).resume();
}
public function saveSoundVolume(_arg1:int):void{
var _local2:SoundEx = getSoundById(_arg1);
if (!_local2){
throw (new Error("No existe un sonido con ese id."));
};
_local2.saveVolume();
}
public function isAllMuted():Boolean{
return (muted);
}
public function setAllMute(_arg1:Boolean):void{
var _local2:SoundGroup;
if (_arg1 == muted){
return;
};
muted = _arg1;
for each (_local2 in soundGroupDict) {
_local2.setMute(_arg1);
};
}
public function setAllVolume(_arg1:Number):void{
var _local2:SoundGroup;
for each (_local2 in soundGroupDict) {
_local2.setVolume(_arg1);
};
}
public function pauseAll():void{
var _local1:SoundGroup;
for each (_local1 in soundGroupDict) {
_local1.pause();
};
}
public function setAllDefaultVolume(_arg1:Number):void{
var _local2:SoundGroup;
for each (_local2 in soundGroupDict) {
_local2.setDefaultVolume(_arg1);
};
}
public function stopGroup(_arg1:String):void{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
SoundGroup(soundGroupDict[_arg1]).stop();
}
public function saveAllVolume():void{
var _local1:SoundGroup;
for each (_local1 in soundGroupDict) {
_local1.saveVolume();
};
}
public function resumeSound(_arg1:int):void{
var _local2:SoundEx = getSoundById(_arg1);
if (!_local2){
throw (new Error("No existe un sonido con ese id."));
};
_local2.resume();
}
public function fadeGroup(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:Number=1, _arg5:int=-1):void{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
if (muted){
_arg3 = 0;
_arg4 = 0;
};
SoundGroup(soundGroupDict[_arg1]).fade(_arg2, _arg3, _arg4, _arg5);
}
public function pauseGroup(_arg1:String):void{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
SoundGroup(soundGroupDict[_arg1]).pause();
}
public function registerSound(_arg1:String, _arg2:String, _arg3:Number=1):void{
SoundInfoList.registerSoundInfo(_arg1, _arg2, _arg3);
}
public function stopSound(_arg1:int):void{
var _local2:SoundEx = getSoundById(_arg1);
if (!_local2){
throw (new Error("No existe un sonido con ese id."));
};
_local2.stop();
}
public function fadeSound(_arg1:int, _arg2:Number=1, _arg3:Number=0, _arg4:Number=1, _arg5:int=-1):void{
if (_arg1 == -1){
return;
};
var _local6:SoundEx = getSoundById(_arg1);
if (!_local6){
throw (new Error("No existe un sonido con ese id."));
};
if (_local6.soundGroup.isFading()){
return;
};
if (_arg3 < 0){
_arg3 = 0;
};
if (_arg3 > 1){
_arg3 = 1;
};
if (_arg4 < 0){
_arg4 = 0;
};
if (_arg4 > 1){
_arg4 = 1;
};
_local6.fade(_arg2, _arg3, _arg4, _arg5);
}
public function resumeAll():void{
var _local1:SoundGroup;
for each (_local1 in soundGroupDict) {
_local1.resume();
};
}
public function setGroupMute(_arg1:String, _arg2:Boolean):void{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
SoundGroup(soundGroupDict[_arg1]).setMute(_arg2);
}
public function setGroupVolume(_arg1:String, _arg2:Number):void{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
SoundGroup(soundGroupDict[_arg1]).setVolume(_arg2);
}
private function getSoundById(_arg1:int):SoundEx{
var _local2:SoundGroup;
var _local3:SoundEx;
for each (_local2 in soundGroupDict) {
_local3 = _local2.getSoundById(_arg1);
if (_local3){
return (_local3);
};
};
return (null);
}
public function pauseSound(_arg1:int):void{
var _local2:SoundEx = getSoundById(_arg1);
if (!_local2){
throw (new Error("No existe un sonido con ese id."));
};
_local2.pause();
}
public function playSound(_arg1:String, _arg2:String, _arg3:int=1, _arg4:Number=1):int{
if (!SoundInfoList.checkValidSound(_arg1)){
return (-1);
};
var _local5:SoundEx = new SoundEx(SoundInfoList.getSoundInfo(_arg1));
if (!soundGroupDict[_arg2]){
soundGroupDict[_arg2] = new SoundGroup(_arg2, muted);
};
var _local6:SoundGroup = soundGroupDict[_arg2];
_local6.addSound(_local5);
_local5.soundGroup = _local6;
_local5.soundManager = this;
_local5.id = currentSound;
currentSound++;
if (_arg3 < 1){
_arg3 = 1;
};
if (_local5.play(_arg3, _arg4)){
if (_local6.isPaused()){
_local5.pause();
};
};
return (_local5.id);
}
public function saveGroupVolume(_arg1:String):void{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
SoundGroup(soundGroupDict[_arg1]).saveVolume();
}
public function isGroupMuted(_arg1:String):Boolean{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
return (soundGroupDict[_arg1].muted);
}
public function setGroupDefaultVolume(_arg1:String, _arg2:Number):void{
if (!soundGroupDict[_arg1]){
soundGroupDict[_arg1] = new SoundGroup(_arg1);
};
SoundGroup(soundGroupDict[_arg1]).setDefaultVolume(_arg2);
}
public function stopAll():void{
var _local1:SoundGroup;
for each (_local1 in soundGroupDict) {
_local1.stop();
};
}
public static function getInstance():SoundManager{
if (instance == null){
instance = new (SoundManager);
return (instance);
};
return (instance);
}
}
}//package framework._sound
Section 248
//Command (framework._utils._console.Command)
package framework._utils._console {
public class Command {
public var func:Function;
public var name:String;
public var description:String;
public var showDescription:Boolean;
}
}//package framework._utils._console
Section 249
//Console (framework._utils._console.Console)
package framework._utils._console {
import flash.display.*;
import flash.events.*;
import framework._input.*;
import de.polygonal.ds.*;
import flash.text.*;
public class Console {
private var stringsList:SLinkedList;
private var inputTF:TextField;
private var prevInputArr:Array;
private var isOpen:Boolean;
private var commandArr:Array;
public var canvas:Sprite;
private var textArea:Sprite;
private var areaHeight:Number;// = 200
private var lastInputIndex:int;
private var textTF:TextField;
private var currentInput:int;// = 0
private var lastInputText:String;
private var initMarkerY:Number;
private var inputArea:Sprite;
private var marker:Sprite;
private var sideBar:Sprite;
private static const MAX_LINES:int = 250;
private static const MAX_LINES_OFFSET:int = 50;
private static var instance:Console;
public function Console(){
canvas = new Sprite();
textArea = new Sprite();
textTF = new TextField();
inputArea = new Sprite();
inputTF = new TextField();
marker = new Sprite();
sideBar = new Sprite();
stringsList = new SLinkedList();
commandArr = new Array();
prevInputArr = new Array();
super();
}
private function checkCommandRegistered(_arg1:String):Boolean{
var _local2:int;
while (_local2 < commandArr.length) {
if (commandArr[_local2].name == _arg1){
return (true);
};
_local2++;
};
return (false);
}
private function onTextScroll(_arg1:Event):void{
var _local2:Number = ((textTF.scrollV - 1) / (textTF.maxScrollV - 1));
marker.y = (initMarkerY + (_local2 * (areaHeight - marker.height)));
}
private function onKeyDown(_arg1:KeyboardEvent):void{
var _local2:String;
_arg1.preventDefault();
if (_arg1.keyCode == Keys.ENTER){
_local2 = inputTF.text;
if (_local2.length){
if (_local2.charAt(0) == "/"){
executeCommand(getCommandName(_local2), getCommandParams(_local2));
} else {
print(_local2);
};
if (prevInputArr[currentInput] != _local2){
prevInputArr.push(_local2);
};
currentInput = prevInputArr.length;
inputTF.text = "";
};
} else {
if (_arg1.keyCode == Keys.DOWN){
currentInput++;
if (currentInput > prevInputArr.length){
currentInput = prevInputArr.length;
};
if (currentInput == prevInputArr.length){
inputTF.text = "";
} else {
if (currentInput < prevInputArr.length){
inputTF.text = prevInputArr[currentInput];
};
};
} else {
if (_arg1.keyCode == Keys.UP){
if (prevInputArr.length){
currentInput--;
if (currentInput < 0){
currentInput = 0;
};
inputTF.text = prevInputArr[currentInput];
};
};
};
};
}
private function helpCommand():void{
print(("Para ingresar comandos en la consola, simplemente escribe ' \\ ' seguido del nombre " + "del comando que quiera ejecutar. \nPara ver una lista con todos los comandos usar el comando 'commands'\n"));
}
private function getCommandName(_arg1:String):String{
var _local2:int = _arg1.indexOf(" ");
return (((_local2 == -1)) ? _arg1.substr(1) : _arg1.substr(1, (_local2 - 1)));
}
public function initialize(_arg1:int, _arg2:int):void{
textArea.graphics.beginFill(0x444444, 0.9);
textArea.graphics.drawRect(0, 0, _arg1, areaHeight);
textArea.graphics.endFill();
textArea.x = 0;
textArea.y = 0;
inputArea.graphics.beginFill(0x333333, 0.95);
inputArea.graphics.drawRect(0, 0, _arg1, 20);
inputArea.graphics.endFill();
inputArea.x = 0;
inputArea.y = (textArea.y + textArea.height);
textTF.selectable = false;
textTF.wordWrap = true;
textTF.mouseWheelEnabled = false;
textTF.defaultTextFormat = new TextFormat("arial");
textTF.textColor = 0xFFFFFF;
textTF.text = "";
textTF.width = _arg1;
textTF.height = areaHeight;
textTF.addEventListener(Event.SCROLL, onTextScroll);
inputTF.type = TextFieldType.INPUT;
inputTF.defaultTextFormat = new TextFormat("arial");
inputTF.textColor = 0xFFFFFF;
inputTF.text = "";
inputTF.width = _arg1;
inputTF.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
inputTF.tabEnabled = false;
sideBar.graphics.beginFill(0x666666, 0.9);
sideBar.graphics.drawRect(0, 0, 8, areaHeight);
sideBar.graphics.endFill();
sideBar.x = (_arg1 - sideBar.width);
sideBar.addEventListener(MouseEvent.CLICK, onClickSideBar);
marker.graphics.beginFill(0x333333, 1);
marker.graphics.drawCircle(0, 0, 4);
marker.graphics.endFill();
marker.x = (marker.width / 2);
marker.y = (areaHeight - (marker.height / 2));
initMarkerY = (sideBar.y + (marker.height / 2));
canvas.addChild(textArea);
textArea.addChild(textTF);
canvas.addChild(inputArea);
inputArea.addChild(inputTF);
sideBar.addChild(marker);
canvas.addChild(sideBar);
canvas.visible = false;
isOpen = false;
canvas.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheel);
registerCommand("commands", printCommands);
registerCommand("help", helpCommand, "Ayuda sobre como usar la consola.", true);
}
private function getCommandParams(_arg1:String):Array{
var _local2:int = _arg1.indexOf(" ");
return (((_local2 == -1)) ? null : _arg1.substr(_local2).split(","));
}
public function registerCommand(_arg1:String, _arg2:Function, _arg3:String="", _arg4:Boolean=false):void{
if (checkCommandRegistered(_arg1)){
return;
};
var _local5:Command = new Command();
_local5.name = _arg1;
_local5.func = _arg2;
_local5.description = _arg3;
_local5.showDescription = _arg4;
commandArr.push(_local5);
}
public function open():void{
if (!canvas.stage){
return;
};
isOpen = true;
canvas.visible = true;
canvas.stage.focus = inputTF;
inputTF.text = "";
}
public function printCommands():void{
var _local3:Command;
var _local1 = "";
var _local2:int;
while (_local2 < commandArr.length) {
_local3 = Command(commandArr[_local2]);
if (_local3.showDescription){
_local1 = (_local1 + ((("\n/" + _local3.name) + ": ") + _local3.description));
};
_local2++;
};
_local1 = (_local1 + "\n");
print(_local1);
}
public function executeCommand(_arg1:String, _arg2:Array):void{
var _local5:Command;
var _local3:int = commandArr.length;
var _local4:int;
while (_local4 < commandArr.length) {
_local5 = Command(commandArr[_local4]);
if (_arg1 == _local5.name){
_local5.func.apply(this, _arg2);
return;
};
_local4++;
};
print((("El comando \"" + _arg1) + "\" no existe"));
}
private function onClickSideBar(_arg1:MouseEvent):void{
var _local2:Number = (_arg1.stageY / areaHeight);
textTF.scrollV = (_local2 * textTF.maxScrollV);
}
public function print(_arg1:String):void{
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:Iterator;
var _local2 = ((">> " + _arg1) + "\n");
stringsList.append(_local2);
textTF.appendText(_local2);
textTF.scrollV = textTF.numLines;
if (textTF.numLines >= (MAX_LINES + MAX_LINES_OFFSET)){
textTF.text = "";
_local3 = 0;
while (_local3 < MAX_LINES_OFFSET) {
stringsList.removeHead();
_local3++;
};
_local4 = "";
_local5 = stringsList.size;
_local6 = stringsList.getListIterator();
_local3 = 0;
while (_local3 < _local5) {
_local4 = (_local4 + String(_local6.next()));
_local3++;
};
textTF.text = _local4;
};
}
public function close():void{
if (!canvas.stage){
return;
};
isOpen = false;
canvas.visible = false;
canvas.stage.focus = canvas.stage;
}
private function onMouseWheel(_arg1:MouseEvent):void{
if (keyPressed(Keys.SHIFT)){
textTF.scrollV = (textTF.scrollV + ((_arg1.delta)<1) ? 5 : -5);
} else {
textTF.scrollV = (textTF.scrollV + ((_arg1.delta)<1) ? 1 : -1);
};
}
public function getIsOpen():Boolean{
return (isOpen);
}
public static function getInstance():Console{
if (!instance){
instance = new (Console);
};
return (instance);
}
}
}//package framework._utils._console
Section 250
//FPS (framework._utils._fps.FPS)
package framework._utils._fps {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public class FPS extends Sprite {
private var tf:TextField;
private var fps:Number;// = 0
public function FPS(_arg1:int, _arg2:int, _arg3:Boolean=true, _arg4:Boolean=true, _arg5:uint=0, _arg6:uint=0xFF0000, _arg7:Number=1){
tf = new TextField();
super();
graphics.beginFill(_arg6, _arg7);
graphics.drawRect(0, 0, 51, 19);
graphics.endFill();
tf.x = 2;
tf.y = 1;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.selectable = false;
tf.defaultTextFormat = new TextFormat("arial", 11, _arg5, true);
tf.text = "FPS: ....";
addChild(tf);
if (_arg3){
x = (_arg1 - width);
} else {
x = 0;
};
if (_arg4){
y = 0;
} else {
y = (_arg2 - height);
};
mouseEnabled = (mouseChildren = false);
setInterval(updateFPS, 1000);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function updateFPS():void{
tf.text = ("FPS: " + fps);
fps = 0;
}
private function onEnterFrame(_arg1:Event):void{
fps++;
}
}
}//package framework._utils._fps
Section 251
//TrailFx (framework._utils._fx.TrailFx)
package framework._utils._fx {
import flash.display.*;
import flash.geom.*;
import de.polygonal.ds.*;
import framework._utils._timer.*;
public class TrailFx extends Sprite {
private var particleList:SLinkedList;
public var speed:Point;
private var easingFunc:Function;
private var radius:Number;// = 0
private var amount:int;// = 0
private var timerGenerate:TimerEx;
private var color:int;// = 0
public var emitter:Point;
private var iAlpha:Number;// = 0
private var counter:Number;// = 0
public function TrailFx(){
emitter = new Point();
speed = new Point();
super();
}
public function stop():void{
visible = false;
if (!particleList){
return;
};
if (timerGenerate){
timerGenerate.stop();
};
timerGenerate = null;
var _local1:SListNode = particleList.head;
while (_local1) {
TrailParticle(_local1.data).stop();
_local1 = _local1.next;
};
particleList = null;
}
public function setEasingFunc(_arg1:Function):void{
this.easingFunc = _arg1;
}
public function createRadialDot(_arg1:Number, _arg2:uint):DisplayObject{
var _local3:Shape = new Shape();
var _local4:Matrix = new Matrix();
_local4.createGradientBox((_arg1 * 2), (_arg1 * 2), 0, -(_arg1), -(_arg1));
_local3.graphics.beginGradientFill(GradientType.RADIAL, [_arg2, _arg2], [1, 0], [0, 0xFF], _local4);
_local3.graphics.drawCircle(0, 0, _arg1);
_local3.graphics.endFill();
return (_local3);
}
public function start(_arg1:int, _arg2:int):void{
var _local4:TrailParticle;
visible = true;
if (particleList){
stop();
};
particleList = new SLinkedList();
this.amount = _arg2;
this.counter = _arg1;
this.iAlpha = iAlpha;
var _local3:int;
while (_local3 < _arg2) {
_local4 = new TrailParticle();
_local4.image = createRadialDot(radius, color);
addChild(_local4.image);
particleList.append(_local4);
_local4.image.visible = false;
_local3++;
};
updateParticles();
timerGenerate = new TimerEx(0, (1 / _arg1), createParticle);
timerGenerate.start();
}
public function setRadialDot(_arg1:Number, _arg2:uint=0xFFFFFF):void{
this.radius = _arg1;
this.color = _arg2;
}
private function createParticle():void{
var _local1:SListNode;
_local1 = particleList.head;
particleList.head = _local1.next;
_local1.next = null;
particleList.tail.next = _local1;
particleList.tail = _local1;
updateParticles();
TrailParticle(_local1.data).start(emitter.x, emitter.y);
}
private function updateParticles():void{
var _local1:int;
var _local2:SListNode = particleList.head;
while (_local2) {
TrailParticle(_local2.data).image.alpha = (iAlpha * ((_local1 + 1) / amount));
_local1++;
_local2 = _local2.next;
};
}
public function setInitAlpha(_arg1:Number):void{
this.iAlpha = _arg1;
}
public function resume():void{
var _local1:SListNode;
if (timerGenerate){
timerGenerate.resume();
};
if (particleList){
_local1 = particleList.head;
while (_local1) {
TrailParticle(_local1.data).resume();
_local1 = _local1.next;
};
};
}
public function pause():void{
var _local1:SListNode;
if (timerGenerate){
timerGenerate.pause();
};
if (particleList){
_local1 = particleList.head;
while (_local1) {
TrailParticle(_local1.data).pause();
_local1 = _local1.next;
};
};
}
}
}//package framework._utils._fx
Section 252
//TrailParticle (framework._utils._fx.TrailParticle)
package framework._utils._fx {
import flash.display.*;
import flash.events.*;
import framework._utils._timer.*;
import gs.*;
public class TrailParticle extends EventDispatcher {
private var timerKill:TimerEx;
private var tweenAlpha:TweenMax;
public var duration:Number;// = 0
public var image:DisplayObject;
public function start(_arg1:Number, _arg2:Number):void{
image.x = _arg1;
image.y = _arg2;
image.visible = true;
}
public function stop():void{
image.visible = false;
if (tweenAlpha){
tweenAlpha.pause();
};
tweenAlpha = null;
}
public function resume():void{
if (tweenAlpha){
tweenAlpha.resume();
};
if (timerKill){
timerKill.resume();
};
}
public function pause():void{
if (tweenAlpha){
tweenAlpha.pause();
};
if (timerKill){
timerKill.pause();
};
}
}
}//package framework._utils._fx
Section 253
//checkDeactivateEvent (framework._utils._global.checkDeactivateEvent)
package framework._utils._global {
import flash.system.*;
public function checkDeactivateEvent():Boolean{
var _local1:String = Capabilities.version;
var _local2:Array = _local1.split(",");
var _local3:Array = (String(_local2[0]).split(" ") as Array);
if (_local3[1] == 9){
return ((_local2[2] > 28));
};
if (_local3[1] == 10){
return (true);
};
return (false);
}
}//package framework._utils._global
Section 254
//getClassInstance (framework._utils._global.getClassInstance)
package framework._utils._global {
import flash.utils.*;
public function getClassInstance(_arg1:String){
var instance:Object;
var ClassDefinition:Class;
var className = _arg1;
try {
ClassDefinition = (getDefinitionByName(className) as Class);
instance = new (ClassDefinition);
} catch(error:Error) {
instance = null;
};
return (instance);
}
}//package framework._utils._global
Section 255
//LoaderEvent (framework._utils._loader.LoaderEvent)
package framework._utils._loader {
import flash.events.*;
public class LoaderEvent extends Event {
public var bytesLoaded:int;
public var bytesTotal:int;
public function LoaderEvent(_arg1:String, _arg2:Boolean, _arg3:Boolean){
super(_arg1, _arg2, _arg3);
}
}
}//package framework._utils._loader
Section 256
//LoaderEx (framework._utils._loader.LoaderEx)
package framework._utils._loader {
import flash.events.*;
import flash.system.*;
import br.com.stimuli.loading.*;
import br.com.stimuli.loading.loadingtypes.*;
public class LoaderEx extends EventDispatcher {
private var complete:Function;
public var loadedItems:Array;
private var id:String;// = ""
public static const PROGRESS:String = "progress";
private static var counter:int = 0;
public function LoaderEx(_arg1:String=""):void{
this.id = _arg1;
}
public function loadFiles(_arg1:Array, _arg2:Function=null, _arg3:LoaderContext=null):void{
this.complete = _arg2;
if (id == ""){
id = ("loader" + counter++);
};
var _local4:BulkLoader = new BulkLoader(id);
var _local5:int;
while (_local5 < _arg1.length) {
_local4.add(_arg1[_local5], {context:_arg3});
_local5++;
};
_local4.addEventListener(BulkProgressEvent.PROGRESS, onProgress);
_local4.addEventListener(BulkProgressEvent.COMPLETE, onComplete);
_local4.start();
}
private function onComplete(_arg1:BulkProgressEvent):void{
var _local4:LoadingItem;
var _local2:BulkLoader = BulkLoader(_arg1.target);
_local2.removeEventListener(BulkProgressEvent.PROGRESS, onProgress);
_local2.removeEventListener(BulkProgressEvent.COMPLETE, onComplete);
loadedItems = new Array();
var _local3:Array = BulkLoader(_arg1.target).items;
for each (_local4 in _local3) {
loadedItems.push(_local4.content);
};
if (complete != null){
complete();
};
dispatchEvent(_arg1);
}
private function onProgress(_arg1:BulkProgressEvent):void{
var _local2:LoaderEvent = new LoaderEvent(PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
}
}//package framework._utils._loader
Section 257
//Vector3 (framework._utils._math.Vector3)
package framework._utils._math {
public class Vector3 {
public var w:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public function Vector3(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=1){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.w = _arg4;
}
public function sub(_arg1:Vector3):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
z = (z - _arg1.z);
}
public function divide(_arg1:Number):void{
x = (x / _arg1);
y = (y / _arg1);
z = (z / _arg1);
}
public function normalize():void{
var _local1:Number = length();
x = (x / _local1);
y = (y / _local1);
z = (z / _local1);
}
public function crossProduct(_arg1:Vector3):Vector3{
return (new Vector3(((y * _arg1.z) - (z * _arg1.y)), -(((x * _arg1.z) - (z * _arg1.x))), ((x * _arg1.y) - (y * _arg1.x))));
}
public function angle(_arg1:Vector3):Number{
var _local2:Vector3 = new Vector3(x, y, z);
var _local3:Vector3 = new Vector3(_arg1.x, _arg1.y, _arg1.z);
_local2.normalize();
_local3.normalize();
return (Math.acos(Vector3.dotProduct(_local2, _local3)));
}
public function clone():Vector3{
return (new Vector3(x, y, z, w));
}
public function lengthSquared():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
public function getArray():Array{
var _local1:Array = new Array(4);
_local1[0] = x;
_local1[1] = y;
_local1[2] = z;
_local1[3] = w;
return (_local1);
}
public function length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function divideByW():void{
x = (x / w);
y = (y / w);
z = (z / w);
w = (w / w);
}
public function add(_arg1:Vector3):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
z = (z + _arg1.z);
}
public function setPosition(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number=1):void{
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.w = _arg4;
}
public function toString():String{
return ((((((("(" + this.x) + ",") + this.y) + ",") + this.z) + ")"));
}
public function dotProduct(_arg1:Vector3):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function abs():void{
x = Math.abs(x);
y = Math.abs(y);
z = Math.abs(z);
}
public function copy(_arg1:Vector3):void{
this.x = _arg1.x;
this.y = _arg1.y;
this.z = _arg1.z;
this.w = _arg1.w;
}
public function mult(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
z = (z * _arg1);
}
public static function sub(_arg1:Vector3, _arg2:Vector3):Vector3{
return (new Vector3((_arg1.x - _arg2.x), (_arg1.y - _arg2.y), (_arg1.z - _arg2.z)));
}
public static function add(_arg1:Vector3, _arg2:Vector3):Vector3{
return (new Vector3((_arg1.x + _arg2.x), (_arg1.y + _arg2.y), (_arg1.z + _arg2.z)));
}
public static function angleBetween(_arg1:Vector3, _arg2:Vector3):Number{
var _local3:Vector3 = _arg1.clone();
var _local4:Vector3 = _arg2.clone();
_local3.normalize();
_local4.normalize();
return (Math.acos(dotProduct(_local3, _local4)));
}
public static function dotProduct(_arg1:Vector3, _arg2:Vector3):Number{
return ((((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)) + (_arg1.z * _arg2.z)));
}
public static function mult(_arg1:Vector3, _arg2:Number):Vector3{
var _local3:Vector3 = new (Vector3);
_local3.copy(_arg1);
_local3.mult(_arg2);
return (_local3);
}
public static function projectionV1OntoV2(_arg1:Vector3, _arg2:Vector3):Vector3{
var _local3:Number = _arg1.angle(_arg2);
var _local4:Number = (Math.cos(_local3) * _arg1.length());
return (Vector3.mult(_arg2, (_local4 / _arg2.length())));
}
public static function crossProduct(_arg1:Vector3, _arg2:Vector3):Vector3{
return (new Vector3(((_arg1.y * _arg2.z) - (_arg1.z * _arg2.y)), -(((_arg1.x * _arg2.z) - (_arg1.z * _arg2.x))), ((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))));
}
}
}//package framework._utils._math
Section 258
//Cronometer (framework._utils._timer.Cronometer)
package framework._utils._timer {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Cronometer extends EventDispatcher {
private var prevTime:int;
private var timer:Number;
private var running:Boolean;// = false
private var paused:Boolean;// = false
private var savedTimes:Array;
private static var listener:Sprite = new Sprite();
public function Cronometer(){
savedTimes = new Array();
super();
}
public function start():void{
if (running){
return;
};
running = true;
paused = false;
timer = 0;
prevTime = getTimer();
listener.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function stop():void{
listener.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
running = false;
timer = 0;
}
public function getCurrentTime():Number{
return (timer);
}
public function saveTime():void{
if (!running){
return;
};
savedTimes.push(timer);
}
public function resume():void{
if (((running) && (paused))){
listener.addEventListener(Event.ENTER_FRAME, onEnterFrame);
prevTime = getTimer();
paused = false;
};
}
public function isRunning():Boolean{
return (running);
}
public function pause():void{
paused = true;
if (running){
listener.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
private function onEnterFrame(_arg1:Event):void{
var _local2:Number = getTimer();
var _local3:Number = (_local2 - prevTime);
prevTime = _local2;
timer = (timer + _local3);
}
public function resetSavedTimes():void{
savedTimes = [];
}
}
}//package framework._utils._timer
Section 259
//TimerEx (framework._utils._timer.TimerEx)
package framework._utils._timer {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class TimerEx extends EventDispatcher {
private var timer:Number;
private var timeAmount:Number;
public var callback:Function;
private var prevTime:int;
public var callbackParams:Array;// = null
private var paused:Boolean;// = false
private var currentIter:int;
public var iterations:int;
private var running:Boolean;// = false
public static const TIMER_COMPLETE:String = "timerComplete";
public static const TIMER:String = "timer";
private static var listener:Sprite = new Sprite();
public function TimerEx(_arg1:int, _arg2:Number, _arg3:Function=null, _arg4:Array=null){
this.iterations = _arg1;
this.timeAmount = (_arg2 * 1000);
this.callback = _arg3;
this.callbackParams = _arg4;
}
public function stop():void{
listener.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
running = false;
timer = 0;
currentIter = 0;
}
public function setTimeAmount(_arg1:Number):void{
timeAmount = (_arg1 * 1000);
}
public function start():void{
if (running){
return;
};
running = true;
paused = false;
timer = 0;
currentIter = 0;
prevTime = getTimer();
listener.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function resume():void{
if (((running) && (paused))){
listener.addEventListener(Event.ENTER_FRAME, onEnterFrame);
prevTime = getTimer();
paused = false;
};
}
public function getCurrentTime():Number{
return (timer);
}
private function onEnterFrame(_arg1:Event):void{
var _local2:Number = getTimer();
var _local3:Number = (_local2 - prevTime);
prevTime = _local2;
timer = (timer + _local3);
if (timer > timeAmount){
timer = 0;
currentIter++;
if (iterations != 0){
if (currentIter >= iterations){
stop();
dispatchEvent(new Event(TIMER_COMPLETE));
};
};
if (callback != null){
callback.apply(this, callbackParams);
};
dispatchEvent(new Event(TIMER));
};
}
public function isRunning():Boolean{
return (running);
}
public function getCurrentTimeInSeconds():Number{
return ((timer * 0.001));
}
public function getTimeAmount():Number{
return ((timeAmount * 0.001));
}
public function pause():void{
paused = true;
if (running){
listener.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public static function start(_arg1:int, _arg2:Number, _arg3:Function=null, _arg4:Array=null):void{
var _local5:TimerEx = new TimerEx(_arg1, _arg2, _arg3, _arg4);
_local5.start();
}
}
}//package framework._utils._timer
Section 260
//Circle_15 (Generic_fla.Circle_15)
package Generic_fla {
import flash.display.*;
public dynamic class Circle_15 extends MovieClip {
public function Circle_15(){
addFrameScript(0, frame1, 34, frame35);
}
function frame1(){
stop();
}
function frame35(){
gotoAndPlay("move_fast");
}
}
}//package Generic_fla
Section 261
//light1_17 (Generic_fla.light1_17)
package Generic_fla {
import flash.display.*;
public dynamic class light1_17 extends MovieClip {
public var collider:MovieClip;
public function light1_17(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 262
//light10_27 (Generic_fla.light10_27)
package Generic_fla {
import flash.display.*;
public dynamic class light10_27 extends MovieClip {
public var collider:MovieClip;
public function light10_27(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 263
//light11_28 (Generic_fla.light11_28)
package Generic_fla {
import flash.display.*;
public dynamic class light11_28 extends MovieClip {
public var collider:MovieClip;
public function light11_28(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 264
//light12_29 (Generic_fla.light12_29)
package Generic_fla {
import flash.display.*;
public dynamic class light12_29 extends MovieClip {
public var collider:MovieClip;
public function light12_29(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 265
//light13_30 (Generic_fla.light13_30)
package Generic_fla {
import flash.display.*;
public dynamic class light13_30 extends MovieClip {
public var collider:MovieClip;
public function light13_30(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 266
//light14_31 (Generic_fla.light14_31)
package Generic_fla {
import flash.display.*;
public dynamic class light14_31 extends MovieClip {
public var collider:MovieClip;
public function light14_31(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 267
//light15_32 (Generic_fla.light15_32)
package Generic_fla {
import flash.display.*;
public dynamic class light15_32 extends MovieClip {
public var collider:MovieClip;
public function light15_32(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 268
//light16_33 (Generic_fla.light16_33)
package Generic_fla {
import flash.display.*;
public dynamic class light16_33 extends MovieClip {
public var collider:MovieClip;
public function light16_33(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 269
//light17_34 (Generic_fla.light17_34)
package Generic_fla {
import flash.display.*;
public dynamic class light17_34 extends MovieClip {
public var collider:MovieClip;
public function light17_34(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 270
//light18_35 (Generic_fla.light18_35)
package Generic_fla {
import flash.display.*;
public dynamic class light18_35 extends MovieClip {
public var collider:MovieClip;
public function light18_35(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 271
//light19_36 (Generic_fla.light19_36)
package Generic_fla {
import flash.display.*;
public dynamic class light19_36 extends MovieClip {
public var collider:MovieClip;
public function light19_36(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 272
//light2_19 (Generic_fla.light2_19)
package Generic_fla {
import flash.display.*;
public dynamic class light2_19 extends MovieClip {
public var collider:MovieClip;
public function light2_19(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 273
//light20_37 (Generic_fla.light20_37)
package Generic_fla {
import flash.display.*;
public dynamic class light20_37 extends MovieClip {
public var collider:MovieClip;
public function light20_37(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 274
//light21_38 (Generic_fla.light21_38)
package Generic_fla {
import flash.display.*;
public dynamic class light21_38 extends MovieClip {
public var collider:MovieClip;
public function light21_38(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 275
//light22_39 (Generic_fla.light22_39)
package Generic_fla {
import flash.display.*;
public dynamic class light22_39 extends MovieClip {
public var collider:MovieClip;
public function light22_39(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 276
//light23_40 (Generic_fla.light23_40)
package Generic_fla {
import flash.display.*;
public dynamic class light23_40 extends MovieClip {
public var collider:MovieClip;
public function light23_40(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 277
//light24_41 (Generic_fla.light24_41)
package Generic_fla {
import flash.display.*;
public dynamic class light24_41 extends MovieClip {
public var collider:MovieClip;
public function light24_41(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 278
//light25_42 (Generic_fla.light25_42)
package Generic_fla {
import flash.display.*;
public dynamic class light25_42 extends MovieClip {
public var collider:MovieClip;
public function light25_42(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 279
//light26_43 (Generic_fla.light26_43)
package Generic_fla {
import flash.display.*;
public dynamic class light26_43 extends MovieClip {
public var collider:MovieClip;
public function light26_43(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 280
//light27_44 (Generic_fla.light27_44)
package Generic_fla {
import flash.display.*;
public dynamic class light27_44 extends MovieClip {
public var collider:MovieClip;
public function light27_44(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 281
//light28_45 (Generic_fla.light28_45)
package Generic_fla {
import flash.display.*;
public dynamic class light28_45 extends MovieClip {
public var collider:MovieClip;
public function light28_45(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 282
//light29_46 (Generic_fla.light29_46)
package Generic_fla {
import flash.display.*;
public dynamic class light29_46 extends MovieClip {
public var collider:MovieClip;
public function light29_46(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 283
//light3_20 (Generic_fla.light3_20)
package Generic_fla {
import flash.display.*;
public dynamic class light3_20 extends MovieClip {
public var collider:MovieClip;
public function light3_20(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 284
//light30_47 (Generic_fla.light30_47)
package Generic_fla {
import flash.display.*;
public dynamic class light30_47 extends MovieClip {
public var collider:MovieClip;
public function light30_47(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 285
//light31_48 (Generic_fla.light31_48)
package Generic_fla {
import flash.display.*;
public dynamic class light31_48 extends MovieClip {
public var collider:MovieClip;
public function light31_48(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 286
//light32_49 (Generic_fla.light32_49)
package Generic_fla {
import flash.display.*;
public dynamic class light32_49 extends MovieClip {
public var collider:MovieClip;
public function light32_49(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 287
//light33_50 (Generic_fla.light33_50)
package Generic_fla {
import flash.display.*;
public dynamic class light33_50 extends MovieClip {
public var collider:MovieClip;
public function light33_50(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 288
//light34_51 (Generic_fla.light34_51)
package Generic_fla {
import flash.display.*;
public dynamic class light34_51 extends MovieClip {
public var collider:MovieClip;
public function light34_51(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 289
//light35_52 (Generic_fla.light35_52)
package Generic_fla {
import flash.display.*;
public dynamic class light35_52 extends MovieClip {
public var collider:MovieClip;
public function light35_52(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 290
//light36_53 (Generic_fla.light36_53)
package Generic_fla {
import flash.display.*;
public dynamic class light36_53 extends MovieClip {
public var collider:MovieClip;
public function light36_53(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 291
//light37_54 (Generic_fla.light37_54)
package Generic_fla {
import flash.display.*;
public dynamic class light37_54 extends MovieClip {
public var collider:MovieClip;
public function light37_54(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 292
//light38_55 (Generic_fla.light38_55)
package Generic_fla {
import flash.display.*;
public dynamic class light38_55 extends MovieClip {
public var collider:MovieClip;
public function light38_55(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 293
//light39_56 (Generic_fla.light39_56)
package Generic_fla {
import flash.display.*;
public dynamic class light39_56 extends MovieClip {
public var collider:MovieClip;
public function light39_56(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 294
//light4_21 (Generic_fla.light4_21)
package Generic_fla {
import flash.display.*;
public dynamic class light4_21 extends MovieClip {
public var collider:MovieClip;
public function light4_21(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 295
//light40_57 (Generic_fla.light40_57)
package Generic_fla {
import flash.display.*;
public dynamic class light40_57 extends MovieClip {
public var collider:MovieClip;
public function light40_57(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 296
//light41_58 (Generic_fla.light41_58)
package Generic_fla {
import flash.display.*;
public dynamic class light41_58 extends MovieClip {
public var collider:MovieClip;
public function light41_58(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 297
//light42_59 (Generic_fla.light42_59)
package Generic_fla {
import flash.display.*;
public dynamic class light42_59 extends MovieClip {
public var collider:MovieClip;
public function light42_59(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 298
//light43_60 (Generic_fla.light43_60)
package Generic_fla {
import flash.display.*;
public dynamic class light43_60 extends MovieClip {
public var collider:MovieClip;
public function light43_60(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 299
//light44_61 (Generic_fla.light44_61)
package Generic_fla {
import flash.display.*;
public dynamic class light44_61 extends MovieClip {
public var collider:MovieClip;
public function light44_61(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 300
//light45_62 (Generic_fla.light45_62)
package Generic_fla {
import flash.display.*;
public dynamic class light45_62 extends MovieClip {
public var collider:MovieClip;
public function light45_62(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 301
//light46_63 (Generic_fla.light46_63)
package Generic_fla {
import flash.display.*;
public dynamic class light46_63 extends MovieClip {
public var collider:MovieClip;
public function light46_63(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 302
//light47_64 (Generic_fla.light47_64)
package Generic_fla {
import flash.display.*;
public dynamic class light47_64 extends MovieClip {
public var collider:MovieClip;
public function light47_64(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 303
//light48_65 (Generic_fla.light48_65)
package Generic_fla {
import flash.display.*;
public dynamic class light48_65 extends MovieClip {
public var collider:MovieClip;
public function light48_65(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 304
//light49_66 (Generic_fla.light49_66)
package Generic_fla {
import flash.display.*;
public dynamic class light49_66 extends MovieClip {
public var collider:MovieClip;
public function light49_66(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 305
//light5_22 (Generic_fla.light5_22)
package Generic_fla {
import flash.display.*;
public dynamic class light5_22 extends MovieClip {
public var collider:MovieClip;
public function light5_22(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 306
//light50_67 (Generic_fla.light50_67)
package Generic_fla {
import flash.display.*;
public dynamic class light50_67 extends MovieClip {
public var collider:MovieClip;
public function light50_67(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 307
//light51_68 (Generic_fla.light51_68)
package Generic_fla {
import flash.display.*;
public dynamic class light51_68 extends MovieClip {
public var collider:MovieClip;
public function light51_68(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 308
//light52_69 (Generic_fla.light52_69)
package Generic_fla {
import flash.display.*;
public dynamic class light52_69 extends MovieClip {
public var collider:MovieClip;
public function light52_69(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 309
//light53_70 (Generic_fla.light53_70)
package Generic_fla {
import flash.display.*;
public dynamic class light53_70 extends MovieClip {
public var collider:MovieClip;
public function light53_70(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 310
//light54_71 (Generic_fla.light54_71)
package Generic_fla {
import flash.display.*;
public dynamic class light54_71 extends MovieClip {
public var collider:MovieClip;
public function light54_71(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 311
//light55_72 (Generic_fla.light55_72)
package Generic_fla {
import flash.display.*;
public dynamic class light55_72 extends MovieClip {
public var collider:MovieClip;
public function light55_72(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 312
//light56_73 (Generic_fla.light56_73)
package Generic_fla {
import flash.display.*;
public dynamic class light56_73 extends MovieClip {
public var collider:MovieClip;
public function light56_73(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 313
//light57_74 (Generic_fla.light57_74)
package Generic_fla {
import flash.display.*;
public dynamic class light57_74 extends MovieClip {
public var collider:MovieClip;
public function light57_74(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 314
//light58_75 (Generic_fla.light58_75)
package Generic_fla {
import flash.display.*;
public dynamic class light58_75 extends MovieClip {
public var collider:MovieClip;
public function light58_75(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 315
//light59_76 (Generic_fla.light59_76)
package Generic_fla {
import flash.display.*;
public dynamic class light59_76 extends MovieClip {
public var collider:MovieClip;
public function light59_76(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 316
//light6_23 (Generic_fla.light6_23)
package Generic_fla {
import flash.display.*;
public dynamic class light6_23 extends MovieClip {
public var collider:MovieClip;
public function light6_23(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 317
//light60_77 (Generic_fla.light60_77)
package Generic_fla {
import flash.display.*;
public dynamic class light60_77 extends MovieClip {
public var collider:MovieClip;
public function light60_77(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 318
//light61_78 (Generic_fla.light61_78)
package Generic_fla {
import flash.display.*;
public dynamic class light61_78 extends MovieClip {
public var collider:MovieClip;
public function light61_78(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 319
//light62_79 (Generic_fla.light62_79)
package Generic_fla {
import flash.display.*;
public dynamic class light62_79 extends MovieClip {
public var collider:MovieClip;
public function light62_79(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 320
//light63_80 (Generic_fla.light63_80)
package Generic_fla {
import flash.display.*;
public dynamic class light63_80 extends MovieClip {
public var collider:MovieClip;
public function light63_80(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 321
//light64_81 (Generic_fla.light64_81)
package Generic_fla {
import flash.display.*;
public dynamic class light64_81 extends MovieClip {
public var collider:MovieClip;
public function light64_81(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 322
//light65_82 (Generic_fla.light65_82)
package Generic_fla {
import flash.display.*;
public dynamic class light65_82 extends MovieClip {
public var collider:MovieClip;
public function light65_82(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 323
//light66_83 (Generic_fla.light66_83)
package Generic_fla {
import flash.display.*;
public dynamic class light66_83 extends MovieClip {
public var collider:MovieClip;
public function light66_83(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 324
//light67_84 (Generic_fla.light67_84)
package Generic_fla {
import flash.display.*;
public dynamic class light67_84 extends MovieClip {
public var collider:MovieClip;
public function light67_84(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 325
//light7_24 (Generic_fla.light7_24)
package Generic_fla {
import flash.display.*;
public dynamic class light7_24 extends MovieClip {
public var collider:MovieClip;
public function light7_24(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 326
//light8_25 (Generic_fla.light8_25)
package Generic_fla {
import flash.display.*;
public dynamic class light8_25 extends MovieClip {
public var collider:MovieClip;
public function light8_25(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 327
//light9_26 (Generic_fla.light9_26)
package Generic_fla {
import flash.display.*;
public dynamic class light9_26 extends MovieClip {
public var collider:MovieClip;
public function light9_26(){
addFrameScript(0, frame1);
}
function frame1(){
collider.visible = false;
}
}
}//package Generic_fla
Section 328
//spiral_98 (Generic_fla.spiral_98)
package Generic_fla {
import flash.display.*;
public dynamic class spiral_98 extends MovieClip {
public function spiral_98(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Generic_fla
Section 329
//Cubic (gs.easing.Cubic)
package gs.easing {
public class Cubic {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_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) + _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) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package gs.easing
Section 330
//Linear (gs.easing.Linear)
package gs.easing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package gs.easing
Section 331
//Quad (gs.easing.Quad)
package gs.easing {
public class Quad {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _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) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package gs.easing
Section 332
//Sine (gs.easing.Sine)
package gs.easing {
public class Sine {
private static const _HALF_PI:Number = (Math.PI / 2);
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * _HALF_PI))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * _HALF_PI))) + _arg3) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
}
}//package gs.easing
Section 333
//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 334
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
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 = 0.96;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array, _arg4:Array, _arg5:Array):void{
var _local7:String;
var _local6:int = (_arg4.length - 1);
while (_local6 > -1) {
if (_arg1[_arg4[_local6].name] != undefined){
_arg4.splice(_local6, 1);
};
_local6--;
};
_local6 = (_arg3.length - 1);
while (_local6 > -1) {
if (_arg1[_arg3[_local6].name] != undefined){
_arg3.splice(_local6, 1);
};
_local6--;
};
_local6 = (_arg5.length - 1);
while (_local6 > -1) {
if (_arg1[_arg5[_local6].name] != undefined){
_arg5.splice(_local6, 1);
};
_local6--;
};
for (_local7 in _arg1) {
delete _arg2[_local7];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Dictionary):void{
var _local5:Object;
var _local8:int;
var _local9:Object;
var _local10:String;
var _local3:Object = _arg1.vars;
var _local4:int = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if (_local4 < 2){
return;
};
var _local6:Number = _arg1.startTime;
var _local7:Array = [];
for each (_local5 in _arg2) {
if (((!((_local5 == _arg1))) && ((_local5.startTime <= _local6)))){
_local7[_local7.length] = _local5;
};
};
if (_local7.length == 0){
return;
};
if (_local4 == AUTO){
if (_local3.isTV == true){
_local3 = _local3.exposedProps;
};
_local9 = {};
for (_local10 in _local3) {
if ((((((((((((((((((((((((((((((((((((((_local10 == "ease")) || ((_local10 == "delay")))) || ((_local10 == "overwrite")))) || ((_local10 == "onComplete")))) || ((_local10 == "onCompleteParams")))) || ((_local10 == "runBackwards")))) || ((_local10 == "persist")))) || ((_local10 == "onUpdate")))) || ((_local10 == "onUpdateParams")))) || ((_local10 == "timeScale")))) || ((_local10 == "onStart")))) || ((_local10 == "onStartParams")))) || ((_local10 == "renderOnStart")))) || ((_local10 == "proxiedEase")))) || ((_local10 == "easeParams")))) || ((_local10 == "onCompleteAll")))) || ((_local10 == "onCompleteAllParams")))) || ((_local10 == "yoyo")))) || ((_local10 == "loop")))){
} else {
_local9[_local10] = 1;
};
};
_local8 = (_local7.length - 1);
while (_local8 > -1) {
_local7[_local8].killVars(_local9);
_local8--;
};
} else {
_local8 = (_local7.length - 1);
while (_local8 > -1) {
_arg2[_local7[_local8]] = null;
delete _arg2[_local7[_local8]];
_local8--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 8.14){
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 335
//TweenFilterLite (gs.TweenFilterLite)
package gs {
import flash.filters.*;
public class TweenFilterLite extends TweenLite {
protected var _matrix:Array;
protected var _hf:Boolean;// = false
protected var _cmf:ColorMatrixFilter;
protected var _filters:Array;
protected var _endMatrix:Array;
protected var _originalEase:Function;
protected var _clrsa:Array;
public static var removeTween:Function = TweenLite.removeTween;
public static var defaultEase:Function = TweenLite.defaultEase;
private static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
private static var _lumB:Number = 0.072169;
public static var version:Number = 8.15;
public static var delayedCall:Function = TweenLite.delayedCall;
public static var killTweensOf:Function = TweenLite.killTweensOf;
private static var _lumG:Number = 0.71516;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _lumR:Number = 0.212671;
public function TweenFilterLite(_arg1:Object, _arg2:Number, _arg3:Object){
_filters = [];
super(_arg1, _arg2, _arg3);
_originalEase = this.vars.ease;
if (TweenLite.version < 8.14){
trace("TweenFilterLite error! Please update your TweenLite class or try deleting your ASO files. TweenFilterLite requires a more recent version. Download updates at http://www.TweenLite.com.");
};
if (_arg3.type != undefined){
trace((("TweenFilterLite error: " + _arg1) + " is using deprecated syntax. Please update to the new syntax. See http://www.TweenFilterLite.com for details."));
};
}
override public function killVars(_arg1:Object):void{
if (TweenLite.overwriteManager.enabled){
TweenLite.overwriteManager.killVars(_arg1, this.vars, this.tweens, _subTweens, _filters);
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:int;
var _local4:Object;
var _local5:Object;
var _local6:Object;
if (((((!(_arg1)) && (!((this.delay == 0))))) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, _all[this.target]);
};
_clrsa = [];
_filters = [];
_matrix = _idMatrix.slice();
_arg2 = (_arg2 + " blurFilter glowFilter colorMatrixFilter dropShadowFilter bevelFilter ");
if (_isDisplayObject){
if (this.vars.blurFilter != null){
_local4 = this.vars.blurFilter;
addFilter("blurFilter", _local4, BlurFilter, ["blurX", "blurY", "quality"], new BlurFilter(0, 0, ((_local4.quality) || (2))));
};
if (this.vars.glowFilter != null){
_local4 = this.vars.glowFilter;
addFilter("glowFilter", _local4, GlowFilter, ["alpha", "blurX", "blurY", "color", "quality", "strength", "inner", "knockout"], new GlowFilter(0xFFFFFF, 0, 0, 0, ((_local4.strength) || (1)), ((_local4.quality) || (2)), _local4.inner, _local4.knockout));
};
if (this.vars.colorMatrixFilter != null){
_local4 = this.vars.colorMatrixFilter;
_local5 = addFilter("colorMatrixFilter", _local4, ColorMatrixFilter, [], new ColorMatrixFilter(_matrix));
_cmf = _local5.filter;
_matrix = ColorMatrixFilter(_cmf).matrix;
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_endMatrix = _local4.matrix;
} else {
if (_local4.relative == true){
_endMatrix = _matrix.slice();
} else {
_endMatrix = _idMatrix.slice();
};
_endMatrix = setBrightness(_endMatrix, _local4.brightness);
_endMatrix = setContrast(_endMatrix, _local4.contrast);
_endMatrix = setHue(_endMatrix, _local4.hue);
_endMatrix = setSaturation(_endMatrix, _local4.saturation);
_endMatrix = setThreshold(_endMatrix, _local4.threshold);
if (!isNaN(_local4.colorize)){
_endMatrix = colorize(_endMatrix, _local4.colorize, _local4.amount);
} else {
if (!isNaN(_local4.color)){
_endMatrix = colorize(_endMatrix, _local4.color, _local4.amount);
};
};
};
_local3 = 0;
while (_local3 < _endMatrix.length) {
if (((!((_matrix[_local3] == _endMatrix[_local3]))) && (!((_matrix[_local3] == undefined))))){
this.tweens[this.tweens.length] = {o:_matrix, p:_local3.toString(), s:_matrix[_local3], c:(_endMatrix[_local3] - _matrix[_local3]), name:"colorMatrixFilter"};
};
_local3++;
};
};
if (this.vars.dropShadowFilter != null){
_local4 = this.vars.dropShadowFilter;
addFilter("dropShadowFilter", _local4, DropShadowFilter, ["alpha", "angle", "blurX", "blurY", "color", "distance", "quality", "strength", "inner", "knockout", "hideObject"], new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_local4.quality) || (2)), _local4.inner, _local4.knockout, _local4.hideObject));
};
if (this.vars.bevelFilter != null){
_local4 = this.vars.bevelFilter;
addFilter("bevelFilter", _local4, BevelFilter, ["angle", "blurX", "blurY", "distance", "highlightAlpha", "highlightColor", "quality", "shadowAlpha", "shadowColor", "strength"], new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_local4.quality) || (2))));
};
if (this.vars.runBackwards == true){
_local3 = (_clrsa.length - 1);
while (_local3 > -1) {
_local6 = _clrsa[_local3];
_clrsa[_local3].sr = (_local6.sr + _local6.cr);
_local6.cr = (_local6.cr * -1);
_local6.sg = (_local6.sg + _local6.cg);
_local6.cg = (_local6.cg * -1);
_local6.sb = (_local6.sb + _local6.cb);
_local6.cb = (_local6.cb * -1);
_local6.f[_local6.p] = (((_local6.sr << 16) | (_local6.sg << 8)) | _local6.sb);
_local3--;
};
};
super.initTweenVals(true, _arg2);
} else {
super.initTweenVals(_arg1, _arg2);
};
}
public function set timeScale(_arg1:Number):void{
var _local2:int;
if (((_initted) && ((_curTime > (this.initTime + (this.delay * 1000)))))){
_local2 = this.startTime;
this.startTime = (_curTime - (((_curTime - (this.initTime + (this.delay * 1000))) * _timeScale) * (1 / _arg1)));
this.initTime = (this.startTime - (this.delay * 1000));
if (_local2 == 99999999999){
this.startTime = _local2;
};
};
_timeScale = _arg1;
}
public function get timeScale():Number{
return (_timeScale);
}
override public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Array;
var _local2:Number = (((_arg1 - this.startTime) / 1000) * _timeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((_originalEase == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.o[_local4.p] = (_local4.s + (_local3 * _local4.c));
_local5--;
};
if (_hf){
_local5 = (_clrsa.length - 1);
while (_local5 > -1) {
_local4 = _clrsa[_local5];
_local6 = (_local4.sr + (_local3 * _local4.cr));
_local7 = (_local4.sg + (_local3 * _local4.cg));
_local8 = (_local4.sb + (_local3 * _local4.cb));
_local4.f[_local4.p] = (((_local6 << 16) | (_local7 << 8)) | _local8);
_local5--;
};
if (_cmf != null){
ColorMatrixFilter(_cmf).matrix = _matrix;
};
_local10 = this.target.filters;
_local5 = 0;
while (_local5 < _filters.length) {
_local9 = (_local10.length - 1);
while (_local9 > -1) {
if ((_local10[_local9] is _filters[_local5].type)){
_local10.splice(_local9, 1, _filters[_local5].filter);
break;
};
_local9--;
};
_local5++;
};
this.target.filters = _local10;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5]);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
private function addFilter(_arg1:String, _arg2:Object, _arg3:Class, _arg4:Array, _arg5:BitmapFilter):Object{
var _local8:int;
var _local9:String;
var _local10:Number;
var _local11:Object;
var _local12:Object;
var _local6:Object = {type:_arg3, name:_arg1};
var _local7:Array = this.target.filters;
_local8 = 0;
while (_local8 < _local7.length) {
if ((_local7[_local8] is _arg3)){
_local6.filter = _local7[_local8];
break;
};
_local8++;
};
if (_local6.filter == undefined){
_local6.filter = _arg5;
_local7[_local7.length] = _local6.filter;
this.target.filters = _local7;
};
_local8 = 0;
while (_local8 < _arg4.length) {
_local9 = _arg4[_local8];
if (_arg2[_local9] != undefined){
if ((((((_local9 == "color")) || ((_local9 == "highlightColor")))) || ((_local9 == "shadowColor")))){
_local11 = HEXtoRGB(_local6.filter[_local9]);
_local12 = HEXtoRGB(_arg2[_local9]);
_clrsa[_clrsa.length] = {f:_local6.filter, p:_local9, sr:_local11.rb, cr:(_local12.rb - _local11.rb), sg:_local11.gb, cg:(_local12.gb - _local11.gb), sb:_local11.bb, cb:(_local12.bb - _local11.bb)};
} else {
if ((((((((_local9 == "quality")) || ((_local9 == "inner")))) || ((_local9 == "knockout")))) || ((_local9 == "hideObject")))){
_local6.filter[_local9] = _arg2[_local9];
} else {
if (typeof(_arg2[_local9]) == "number"){
_local10 = (_arg2[_local9] - _local6.filter[_local9]);
} else {
_local10 = Number(_arg2[_local9]);
};
this.tweens[this.tweens.length] = {o:_local6.filter, p:_local9, s:_local6.filter[_local9], c:_local10, name:_arg1};
};
};
};
_local8++;
};
_filters[_filters.length] = _local6;
_hf = true;
return (_local6);
}
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));
}
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 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 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 from(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
_arg3.runBackwards = true;
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
public static function HEXtoRGB(_arg1:Number):Object{
return ({rb:(_arg1 >> 16), gb:((_arg1 >> 8) & 0xFF), bb:(_arg1 & 0xFF)});
}
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 to(_arg1:Object, _arg2:Number, _arg3:Object):TweenFilterLite{
return (new TweenFilterLite(_arg1, _arg2, _arg3));
}
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));
}
}
}//package gs
Section 336
//TweenLite (gs.TweenLite)
package gs {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _subTweens:Array;
protected var _initted:Boolean;
public var startTime:int;
public var target:Object;
public var duration:Number;
protected var _hst:Boolean;
protected var _isDisplayObject:Boolean;
protected var _active:Boolean;
public var tweens:Array;
public var vars:Object;
public var initTime:int;
protected var _timeScale:Number;
private static var _timer:Timer = new Timer(2000);
private static var _classInitted:Boolean;
public static var defaultEase:Function = TweenLite.easeOut;
public static var version:Number = 8.14;
protected static var _all:Dictionary = new Dictionary();
private static var _sprite:Sprite = new Sprite();
protected static var _curTime:uint;
public static var overwriteManager:Object;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _listening:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:*;
super();
if (_arg1 == null){
return;
};
if (!_classInitted){
_curTime = getTimer();
_sprite.addEventListener(Event.ENTER_FRAME, executeAll);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_classInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
_timeScale = ((_arg3.timeScale) || (1));
_active = (((_arg2 == 0)) && ((this.delay == 0)));
this.target = _arg1;
_isDisplayObject = (_arg1 is DisplayObject);
if (!(this.vars.ease is Function)){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
if (!isNaN(Number(this.vars.autoAlpha))){
this.vars.alpha = Number(this.vars.autoAlpha);
this.vars.visible = (this.vars.alpha > 0);
};
this.tweens = [];
_subTweens = [];
_hst = (_initted = false);
this.initTime = _curTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if ((((_all[_arg1] == undefined)) || (((!((_arg1 == null))) && ((_local4 == 1)))))){
delete _all[_arg1];
_all[_arg1] = new Dictionary(true);
} else {
if ((((_local4 > 1)) && ((this.delay == 0)))){
overwriteManager.manageOverwrites(this, _all[_arg1]);
};
};
_all[_arg1][this] = this;
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (_active))){
initTweenVals();
if (_active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
_local5 = this.vars.visible;
if (this.vars.isTV == true){
_local5 = this.vars.exposedProps.visible;
};
if (((((!((_local5 == null))) && ((this.vars.runBackwards == true)))) && (_isDisplayObject))){
this.target.visible = Boolean(_local5);
};
};
if (((!(_listening)) && (!(_active)))){
_timer.addEventListener("timer", killGarbage);
_timer.start();
_listening = true;
};
}
protected function addSubTween(_arg1:String, _arg2:Function, _arg3:Object, _arg4:Object, _arg5:Object=null):void{
var _local7:String;
var _local6:Object = {name:_arg1, proxy:_arg2, target:_arg3, info:_arg5};
_subTweens[_subTweens.length] = _local6;
for (_local7 in _arg4) {
if (typeof(_arg4[_local7]) == "number"){
this.tweens[this.tweens.length] = {o:_arg3, p:_local7, s:_arg3[_local7], c:(_arg4[_local7] - _arg3[_local7]), sub:_local6, name:_arg1};
} else {
this.tweens[this.tweens.length] = {o:_arg3, p:_local7, s:_arg3[_local7], c:Number(_arg4[_local7]), sub:_local6, name:_arg1};
};
};
_hst = true;
}
public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local6:Array;
var _local7:ColorTransform;
var _local8:ColorTransform;
var _local9:Object;
var _local5:Object = this.vars;
if (_local5.isTV == true){
_local5 = _local5.exposedProps;
};
if (((((!(_arg1)) && (!((this.delay == 0))))) && (overwriteManager.enabled))){
overwriteManager.manageOverwrites(this, _all[this.target]);
};
if ((this.target is Array)){
_local6 = ((this.vars.endArray) || ([]));
_local4 = 0;
while (_local4 < _local6.length) {
if (((!((this.target[_local4] == _local6[_local4]))) && (!((this.target[_local4] == undefined))))){
this.tweens[this.tweens.length] = {o:this.target, p:_local4.toString(), s:this.target[_local4], c:(_local6[_local4] - this.target[_local4]), name:_local4.toString()};
};
_local4++;
};
} else {
if (((((!((typeof(_local5.tint) == "undefined"))) || ((this.vars.removeTint == true)))) && (_isDisplayObject))){
_local7 = this.target.transform.colorTransform;
_local8 = new ColorTransform();
if (_local5.alpha != undefined){
_local8.alphaMultiplier = _local5.alpha;
delete _local5.alpha;
} else {
_local8.alphaMultiplier = this.target.alpha;
};
if (((!((this.vars.removeTint == true))) && (((((!((_local5.tint == null))) && (!((_local5.tint == ""))))) || ((_local5.tint == 0)))))){
_local8.color = _local5.tint;
};
addSubTween("tint", tintProxy, {progress:0}, {progress:1}, {target:this.target, color:_local7, endColor:_local8});
};
if (((!((_local5.frame == null))) && (_isDisplayObject))){
addSubTween("frame", frameProxy, {frame:this.target.currentFrame}, {frame:_local5.frame}, {target:this.target});
};
if (((!(isNaN(this.vars.volume))) && (this.target.hasOwnProperty("soundTransform")))){
addSubTween("volume", volumeProxy, this.target.soundTransform, {volume:this.vars.volume}, {target:this.target});
};
for (_local3 in _local5) {
if ((((((((((((((((((((((((((((((((((((((_local3 == "ease")) || ((_local3 == "delay")))) || ((_local3 == "overwrite")))) || ((_local3 == "onComplete")))) || ((_local3 == "onCompleteParams")))) || ((_local3 == "runBackwards")))) || ((_local3 == "visible")))) || ((_local3 == "autoOverwrite")))) || ((_local3 == "persist")))) || ((_local3 == "onUpdate")))) || ((_local3 == "onUpdateParams")))) || ((_local3 == "autoAlpha")))) || ((_local3 == "timeScale")))) || ((_local3 == "onStart")))) || ((_local3 == "onStartParams")))) || ((_local3 == "renderOnStart")))) || ((_local3 == "proxiedEase")))) || ((_local3 == "easeParams")))) || (((_arg1) && (!((_arg2.indexOf(((" " + _local3) + " ")) == -1))))))){
} else {
if (((!(((_isDisplayObject) && ((((((_local3 == "tint")) || ((_local3 == "removeTint")))) || ((_local3 == "frame"))))))) && (!((((_local3 == "volume")) && (this.target.hasOwnProperty("soundTransform"))))))){
if (typeof(_local5[_local3]) == "number"){
this.tweens[this.tweens.length] = {o:this.target, p:_local3, s:this.target[_local3], c:(_local5[_local3] - this.target[_local3]), name:_local3};
} else {
this.tweens[this.tweens.length] = {o:this.target, p:_local3, s:this.target[_local3], c:Number(_local5[_local3]), name:_local3};
};
};
};
};
};
if (this.vars.runBackwards == true){
_local4 = (this.tweens.length - 1);
while (_local4 > -1) {
_local9 = this.tweens[_local4];
this.tweens[_local4].s = (_local9.s + _local9.c);
_local9.c = (_local9.c * -1);
_local4--;
};
};
if ((((_local5.visible == true)) && (_isDisplayObject))){
this.target.visible = true;
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
_initted = true;
}
public function get active():Boolean{
if (_active){
return (true);
};
if (_curTime >= this.startTime){
_active = true;
if (!_initted){
initTweenVals();
} else {
if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) / 1000);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = 1;
} else {
_local3 = this.vars.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.o[_local4.p] = (_local4.s + (_local3 * _local4.c));
_local5--;
};
if (_hst){
_local5 = (_subTweens.length - 1);
while (_local5 > -1) {
_subTweens[_local5].proxy(_subTweens[_local5]);
_local5--;
};
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(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.vars, this.tweens, _subTweens, []);
};
}
public function complete(_arg1:Boolean=false):void{
if (!_arg1){
if (!_initted){
initTweenVals();
};
this.startTime = (_curTime - ((this.duration * 1000) / _timeScale));
render(_curTime);
return;
};
if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){
if (((!(isNaN(this.vars.autoAlpha))) && ((this.target.alpha == 0)))){
this.target.visible = false;
} else {
if (this.vars.runBackwards != true){
this.target.visible = this.vars.visible;
};
};
};
if (this.vars.persist != true){
removeTween(this);
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function frameProxy(_arg1:Object):void{
_arg1.info.target.gotoAndStop(Math.round(_arg1.target.frame));
}
public static function removeTween(_arg1:TweenLite=null):void{
if (((!((_arg1 == null))) && (!((_all[_arg1.target] == undefined))))){
_all[_arg1.target][_arg1] = null;
delete _all[_arg1.target][_arg1];
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Object;
var _local4:*;
if (((!((_arg1 == null))) && (!((_all[_arg1] == undefined))))){
if (_arg2){
_local3 = _all[_arg1];
for (_local4 in _local3) {
_local3[_local4].complete(false);
};
};
delete _all[_arg1];
};
}
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 from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function executeAll(_arg1:Event=null):void{
var _local3:Dictionary;
var _local4:Object;
var _local5:Object;
var _local2:uint = (_curTime = getTimer());
if (_listening){
_local3 = _all;
for each (_local4 in _local3) {
for (_local5 in _local4) {
if (((!((_local4[_local5] == undefined))) && (_local4[_local5].active))){
_local4[_local5].render(_local2);
};
};
};
};
}
public static function volumeProxy(_arg1:Object):void{
_arg1.info.target.soundTransform = _arg1.target;
}
public static function killGarbage(_arg1:TimerEvent):void{
var _local3:Boolean;
var _local4:Object;
var _local5:Object;
var _local6:Object;
var _local2:uint;
for (_local4 in _all) {
_local3 = false;
for (_local5 in _all[_local4]) {
_local3 = true;
break;
};
if (!_local3){
delete _all[_local4];
} else {
_local2++;
};
};
if (_local2 == 0){
_timer.removeEventListener("timer", killGarbage);
_timer.stop();
_listening = false;
};
}
public static function tintProxy(_arg1:Object):void{
var _local2:Number = _arg1.target.progress;
var _local3:Number = (1 - _local2);
var _local4:Object = _arg1.info.color;
var _local5:Object = _arg1.info.endColor;
_arg1.info.target.transform.colorTransform = new ColorTransform(((_local4.redMultiplier * _local3) + (_local5.redMultiplier * _local2)), ((_local4.greenMultiplier * _local3) + (_local5.greenMultiplier * _local2)), ((_local4.blueMultiplier * _local3) + (_local5.blueMultiplier * _local2)), ((_local4.alphaMultiplier * _local3) + (_local5.alphaMultiplier * _local2)), ((_local4.redOffset * _local3) + (_local5.redOffset * _local2)), ((_local4.greenOffset * _local3) + (_local5.greenOffset * _local2)), ((_local4.blueOffset * _local3) + (_local5.blueOffset * _local2)), ((_local4.alphaOffset * _local3) + (_local5.alphaOffset * _local2)));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 337
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import flash.utils.*;
import gs.events.*;
public class TweenMax extends TweenFilterLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
protected var _pauseTime:int;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
public static var defaultEase:Function = TweenLite.defaultEase;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var version:Number = 2.15;
public static var killDelayedCallsTo:Function = TweenLite.killDelayedCallsTo;
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
_pauseTime = -1;
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
if ((((this.vars.yoyo == true)) || ((this.vars.loop == true)))){
this.vars.persist = true;
};
if (TweenFilterLite.version < 8.15){
trace("TweenMax error! Please update your TweenFilterLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
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();
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
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:Object;
var _local6:int;
var _local7:Object;
var _local8:Array;
var _local9:Array;
var _local4:Number = this.progress;
if (((!((this.vars[_arg1] == undefined))) && (_initted))){
if (((!(_arg3)) && (!((_local4 == 0))))){
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
if (this.tweens[_local6].name == _arg1){
this.tweens[_local6].o[this.tweens[_local6].p] = this.tweens[_local6].s;
};
_local6--;
};
};
_local5 = {};
_local5[_arg1] = 1;
killVars(_local5);
};
this.vars[_arg1] = _arg2;
if (_initted){
_local7 = this.vars;
_local8 = this.tweens;
_local9 = _subTweens;
this.vars = {};
this.tweens = [];
_subTweens = [];
this.vars[_arg1] = _arg2;
initTweenVals();
if (((_arg3) && (!((_local4 == 0))))){
this.vars.ease = _local7.ease;
adjustStartValues();
};
this.vars = _local7;
this.tweens = _local8.concat(this.tweens);
_subTweens = _local9.concat(_subTweens);
};
}
override public function initTweenVals(_arg1:Boolean=false, _arg2:String=""):void{
var _local3:String;
var _local4:int;
var _local5:Object;
var _local6:Object;
var _local7:Array;
_arg2 = (_arg2 + " hexColors bezier bezierThrough orientToBezier quaternions onCompleteAll onCompleteAllParams yoyo loop onCompleteListener onUpdateListener onStartListener ");
if (((((!(_arg1)) && (!((this.delay == 0))))) && (TweenLite.overwriteManager.enabled))){
TweenLite.overwriteManager.manageOverwrites(this, _all[this.target]);
};
var _local8:Function = bezierProxy;
if (this.vars.orientToBezier == true){
this.vars.orientToBezier = [["x", "y", "rotation", 0]];
_local8 = bezierProxy2;
} else {
if ((this.vars.orientToBezier is Array)){
_local8 = bezierProxy2;
};
};
if (((!((this.vars.bezier == undefined))) && ((this.vars.bezier is Array)))){
_local6 = {};
_local7 = this.vars.bezier;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween("bezier", _local8, {t:0}, {t:1}, {props:parseBeziers(_local6, false), target:this.target, orientToBezier:this.vars.orientToBezier});
};
if (((!((this.vars.bezierThrough == undefined))) && ((this.vars.bezierThrough is Array)))){
_local6 = {};
_local7 = this.vars.bezierThrough;
_local4 = 0;
while (_local4 < _local7.length) {
for (_local3 in _local7[_local4]) {
if (_local6[_local3] == undefined){
_local6[_local3] = [this.target[_local3]];
};
if (typeof(_local7[_local4][_local3]) == "number"){
_local6[_local3].push(_local7[_local4][_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(_local7[_local4][_local3])));
};
};
_local4++;
};
for (_local3 in _local6) {
if (typeof(this.vars[_local3]) == "number"){
_local6[_local3].push(this.vars[_local3]);
} else {
_local6[_local3].push((this.target[_local3] + Number(this.vars[_local3])));
};
delete this.vars[_local3];
};
addSubTween("bezierThrough", _local8, {t:0}, {t:1}, {props:parseBeziers(_local6, true), target:this.target, orientToBezier:this.vars.orientToBezier});
};
if (((!((this.vars.hexColors == undefined))) && ((typeof(this.vars.hexColors) == "object")))){
for (_local3 in this.vars.hexColors) {
addSubTween("hexColors", hexColorsProxy, {r:(this.target[_local3] >> 16), g:((this.target[_local3] >> 8) & 0xFF), b:(this.target[_local3] & 0xFF)}, {r:(this.vars.hexColors[_local3] >> 16), g:((this.vars.hexColors[_local3] >> 8) & 0xFF), b:(this.vars.hexColors[_local3] & 0xFF)}, {prop:_local3, target:this.target});
};
};
super.initTweenVals(true, _arg2);
}
protected function adjustStartValues():void{
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:int;
var _local1:Number = this.progress;
if (_local1 != 0){
_local2 = (1 / (1 - this.vars.ease((_local1 * this.duration), 0, 1, this.duration)));
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local3 = (_local4.s + _local4.c);
_local4.c = ((_local3 - _local4.o[_local4.p]) * _local2);
_local4.s = (_local3 - _local4.c);
_local5--;
};
};
}
public function restart():void{
this.progress = 0;
resume();
}
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};
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
this.vars.onStart = onStartDispatcher;
this.vars.onUpdate = onUpdateDispatcher;
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);
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
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 progress(_arg1:Number):void{
var _local2:Number = (_curTime - ((this.duration * _arg1) * 1000));
this.initTime = (_local2 - (this.delay * 1000));
this.startTime = _local2;
var _local3:Boolean = this.active;
render(_curTime);
if (_pauseTime != -1){
this.startTime = 99999999999;
};
var _local4:* = this.vars.visible;
if (this.vars.isTV == true){
_local4 = this.vars.exposedProps.visible;
};
if (((((!((_local4 == null))) && (_isDisplayObject))) && ((_arg1 < 1)))){
this.target.visible = Boolean(_local4);
};
}
public function reverse(_arg1:Boolean=true):void{
this.vars.ease = ((this.vars.ease)==_originalEase) ? reverseEase : _originalEase;
if (((_arg1) && ((_curTime > (this.initTime + (this.delay * 1000)))))){
this.startTime = (_curTime - ((((1 - this.progress) * this.duration) * 1000) / _timeScale));
this.initTime = (this.startTime - (this.delay * 1000));
if (_pauseTime != -1){
this.startTime = 99999999999;
};
};
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
this.pause();
} else {
this.resume();
};
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
override public function get active():Boolean{
if (_active){
return (true);
};
if (_pauseTime != -1){
return (false);
};
if (_curTime >= this.startTime){
_active = true;
if (!_initted){
initTweenVals();
} else {
if (((!((this.vars.visible == undefined))) && (_isDisplayObject))){
this.target.visible = true;
};
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
return (true);
//unresolved jump
};
return (false);
}
public function resume():void{
var _local1:Number;
if (_pauseTime != -1){
_local1 = (_curTime - _pauseTime);
this.initTime = (this.initTime + _local1);
this.startTime = (this.initTime + (this.delay * 1000));
_pauseTime = -1;
if (_curTime >= this.startTime){
_active = true;
};
};
}
public function get paused():Boolean{
if (_pauseTime != -1){
return (true);
};
return (false);
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (_originalEase((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
public function killProperties(_arg1:Array):void{
var _local3:int;
var _local2:Object = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
if (this.vars[_arg1[_local3]] != null){
_local2[_arg1[_local3]] = 1;
};
_local3--;
};
killVars(_local2);
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (_pauseTime == -1){
_pauseTime = _curTime;
this.startTime = 99999999999;
_active = false;
};
}
override public function complete(_arg1:Boolean=false):void{
super.complete(_arg1);
if ((((this.vars.yoyo == true)) || ((this.vars.loop == true)))){
if (this.vars.yoyo == true){
reverse(false);
};
this.startTime = _curTime;
this.initTime = (this.startTime - (this.delay * 1000));
render(_curTime);
} else {
if (this.vars.persist == true){
pause();
};
};
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (_initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_subTweens = [];
initTweenVals();
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get progress():Number{
var _local1:Number = (((((((_curTime - this.initTime) / 1000) - this.delay) / this.duration) * _timeScale)) || (0));
if (_local1 > 1){
return (1);
};
return (_local1);
}
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 sequence(_arg1:Object, _arg2:Array):Array{
var _local3:uint;
while (_local3 < _arg2.length) {
_arg2[_local3].target = _arg1;
_local3++;
};
return (multiSequence(_arg2));
}
public static function hexColorsProxy(_arg1:Object):void{
_arg1.info.target[_arg1.info.prop] = uint((((_arg1.target.r << 16) | (_arg1.target.g << 8)) | _arg1.target.b));
}
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] = {s:_local4[0], cp:(_local4[1] - ((_local4[2] - _local4[0]) / 4)), e:_local4[1]};
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = {s:_local4[_local3], cp:(_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)].cp)), e:_local4[(_local3 + 1)]};
_local3++;
};
} else {
_local5[_local5.length] = {s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]};
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = {s:_local4[0], cp:_local4[1], e:((_local4[1] + _local4[2]) / 2)};
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5.push({s:_local5[(_local3 - 2)].e, cp:_local4[_local3], e:((_local4[_local3] + _local4[(_local3 + 1)]) / 2)});
_local3++;
};
_local5[_local5.length] = {s:_local5[(_local5.length - 1)].e, cp:_local4[(_local4.length - 2)], e:_local4[(_local4.length - 1)]};
} else {
if (_local4.length == 3){
_local5[_local5.length] = {s:_local4[0], cp:_local4[1], e:_local4[2]};
} else {
if (_local4.length == 2){
_local5[_local5.length] = {s:_local4[0], cp:((_local4[0] + _local4[1]) / 2), e:_local4[1]};
};
};
};
};
};
return (_local7);
}
public static function bezierProxy2(_arg1:Object):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:Number;
bezierProxy(_arg1);
var _local2:Object = {};
var _local3:Object = _arg1.info.target;
_arg1.info.target = _local2;
_arg1.target.t = (_arg1.target.t + 0.01);
bezierProxy(_arg1);
var _local4:Array = _arg1.info.orientToBezier;
var _local10:uint;
while (_local10 < _local4.length) {
_local8 = _local4[_local10];
_local9 = ((_local8[3]) || (0));
_local6 = (_local2[_local8[0]] - _local3[_local8[0]]);
_local7 = (_local2[_local8[1]] - _local3[_local8[1]]);
_local3[_local8[2]] = ((Math.atan2(_local7, _local6) * _RAD2DEG) + _local9);
_local10++;
};
_arg1.info.target = _local3;
_arg1.target.t = (_arg1.target.t - 0.01);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function getTweensOf(_arg1:Object):Array{
var _local4:Object;
var _local2:Dictionary = _all[_arg1];
var _local3:Array = [];
if (_local2 != null){
for (_local4 in _local2) {
if (_local2[_local4].tweens != undefined){
_local3[_local3.length] = _local2[_local4];
};
};
};
return (_local3);
}
public static function multiSequence(_arg1:Array):Array{
var _local6:Object;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:uint;
var _local11:Object;
var _local12:String;
var _local2:Dictionary = new Dictionary();
var _local3:Array = [];
var _local4:int = TweenLite.overwriteManager.mode;
var _local5:Number = 0;
_local10 = 0;
while (_local10 < _arg1.length) {
_local6 = _arg1[_local10];
_local9 = ((_local6.time) || (0));
_local11 = {};
for (_local12 in _local6) {
_local11[_local12] = _local6[_local12];
};
delete _local11.time;
_local8 = ((_local11.delay) || (0));
_local11.delay = (_local5 + _local8);
_local7 = _local11.target;
delete _local11.target;
if (_local4 == 1){
if (_local2[_local7] == undefined){
_local2[_local7] = _local11;
} else {
_local11.overwrite = 2;
};
};
_local3[_local3.length] = new TweenMax(_local7, _local9, _local11);
_local5 = (_local5 + (_local9 + _local8));
_local10++;
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, 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){
return (true);
};
_local3--;
};
return (false);
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local4:Array = getAllTweens();
var _local5:int = (_local4.length - 1);
while (_local5 > -1) {
if (((((_local4[_local5].target is Function) == _arg3)) || (!(((_local4[_local5].target is Function) == _arg2))))){
if (_arg1){
_local4[_local5].complete();
} else {
TweenLite.removeTween(_local4[_local5]);
};
};
_local5--;
};
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local4:Array = getAllTweens();
var _local5:int = (_local4.length - 1);
while (_local5 > -1) {
if ((((_local4[_local5] is TweenMax)) && (((((_local4[_local5].target is Function) == _arg3)) || (!(((_local4[_local5].target is Function) == _arg2))))))){
_local4[_local5].paused = _arg1;
};
_local5--;
};
}
public static function bezierProxy(_arg1:Object):void{
var _local5:int;
var _local6:String;
var _local7:Object;
var _local8:Number;
var _local9:uint;
var _local2:Number = _arg1.target.t;
var _local3:Object = _arg1.info.props;
var _local4:Object = _arg1.info.target;
if (_local2 == 1){
for (_local6 in _local3) {
_local5 = (_local3[_local6].length - 1);
_local4[_local6] = _local3[_local6][_local5].e;
};
} else {
for (_local6 in _local3) {
_local9 = _local3[_local6].length;
if (_local2 < 0){
_local5 = 0;
} else {
if (_local2 >= 1){
_local5 = (_local9 - 1);
} else {
_local5 = int((_local9 * _local2));
};
};
_local8 = ((_local2 - (_local5 * (1 / _local9))) * _local9);
_local7 = _local3[_local6][_local5];
_local4[_local6] = (_local7.s + (_local8 * (((2 * (1 - _local8)) * (_local7.cp - _local7.s)) + (_local8 * (_local7.e - _local7.s)))));
};
};
}
public static function callbackProxy(_arg1:Array, _arg2:Array=null):void{
var _local3:uint;
while (_local3 < _arg1.length) {
if (_arg1[_local3] != undefined){
_arg1[_local3].apply(null, _arg2[_local3]);
};
_local3++;
};
}
public static function allFrom(_arg1:Array, _arg2:Number, _arg3:Object):Array{
_arg3.runBackwards = true;
return (allTo(_arg1, _arg2, _arg3));
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function getAllTweens():Array{
var _local3:Object;
var _local4:Object;
var _local1:Dictionary = _all;
var _local2:Array = [];
for (_local3 in _local1) {
for (_local4 in _local1[_local3]) {
if (_local1[_local3][_local4] != undefined){
_local2[_local2.length] = _local1[_local3][_local4];
};
};
};
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));
}
public static function allTo(_arg1:Array, _arg2:Number, _arg3:Object):Array{
var _local4:int;
var _local5:Object;
var _local6:String;
var _local7:Number;
var _local8:Object;
if (_arg1.length == 0){
return ([]);
};
var _local9:Array = [];
var _local10:Number = ((_arg3.delayIncrement) || (0));
delete _arg3.delayIncrement;
if (_arg3.onCompleteAll == undefined){
_local8 = _arg3;
} else {
_local8 = {};
for (_local6 in _arg3) {
_local8[_local6] = _arg3[_local6];
};
_local8.onCompleteParams = [[_arg3.onComplete, _arg3.onCompleteAll], [_arg3.onCompleteParams, _arg3.onCompleteAllParams]];
_local8.onComplete = TweenMax.callbackProxy;
delete _arg3.onCompleteAll;
};
delete _arg3.onCompleteAllParams;
if (_local10 == 0){
_local4 = 0;
while (_local4 < (_arg1.length - 1)) {
_local5 = {};
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local9[_local9.length] = new TweenMax(_arg1[_local4], _arg2, _local5);
_local4++;
};
} else {
_local7 = ((_arg3.delay) || (0));
_local4 = 0;
while (_local4 < (_arg1.length - 1)) {
_local5 = {};
for (_local6 in _arg3) {
_local5[_local6] = _arg3[_local6];
};
_local5.delay = (_local7 + (_local4 * _local10));
_local9[_local9.length] = new TweenMax(_arg1[_local4], _arg2, _local5);
_local4++;
};
_local8.delay = (_local7 + ((_arg1.length - 1) * _local10));
};
_local9[_local9.length] = new TweenMax(_arg1[(_arg1.length - 1)], _arg2, _local8);
if ((_arg3.onCompleteAllListener is Function)){
_local9[(_local9.length - 1)].addEventListener(TweenEvent.COMPLETE, _arg3.onCompleteAllListener);
};
return (_local9);
}
}
}//package gs
Section 338
//avoid_container_12 (Gui_fla.avoid_container_12)
package Gui_fla {
import flash.display.*;
public dynamic class avoid_container_12 extends MovieClip {
public var container:MovieClip;
public function avoid_container_12(){
addFrameScript(0, frame1, 29, frame30, 83, frame84);
}
function frame1(){
stop();
}
function frame84(){
stop();
}
function frame30(){
stop();
}
}
}//package Gui_fla
Section 339
//countdown_42 (Gui_fla.countdown_42)
package Gui_fla {
import flash.display.*;
public dynamic class countdown_42 extends MovieClip {
public var counter_tf:MovieClip;
public function countdown_42(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Gui_fla
Section 340
//Danger_40 (Gui_fla.Danger_40)
package Gui_fla {
import flash.display.*;
import flash.events.*;
public dynamic class Danger_40 extends MovieClip {
public function Danger_40(){
addFrameScript(0, frame1, 12, frame13, 28, frame29);
}
function frame29(){
stop();
dispatchEvent(new Event("complete"));
}
function frame1(){
stop();
}
function frame13(){
dispatchEvent(new Event("playDangerSound"));
}
}
}//package Gui_fla
Section 341
//dialog_character_52 (Gui_fla.dialog_character_52)
package Gui_fla {
import flash.display.*;
public dynamic class dialog_character_52 extends MovieClip {
public function dialog_character_52(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Gui_fla
Section 342
//Symbol13_27 (Gui_fla.Symbol13_27)
package Gui_fla {
import flash.display.*;
public dynamic class Symbol13_27 extends MovieClip {
public var face_1:MovieClip;
public var face_2:MovieClip;
public var face_3:MovieClip;
public var face_4:MovieClip;
public var face_5:MovieClip;
public var plus:MovieClip;
public function Symbol13_27(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Gui_fla
Section 343
//Symbol16_30 (Gui_fla.Symbol16_30)
package Gui_fla {
import flash.display.*;
public dynamic class Symbol16_30 extends MovieClip {
public function Symbol16_30(){
addFrameScript(0, frame1, 1, frame2, 34, frame35, 53, frame54);
}
function frame54(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame35(){
stop();
}
}
}//package Gui_fla
Section 344
//Symbol23_33 (Gui_fla.Symbol23_33)
package Gui_fla {
import flash.display.*;
public dynamic class Symbol23_33 extends MovieClip {
public function Symbol23_33(){
addFrameScript(0, frame1, 1, frame2, 34, frame35, 46, frame47);
}
function frame47(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
function frame35(){
stop();
}
}
}//package Gui_fla
Section 345
//Symbol4_13 (Gui_fla.Symbol4_13)
package Gui_fla {
import flash.display.*;
public dynamic class Symbol4_13 extends MovieClip {
public function Symbol4_13(){
addFrameScript(0, frame1, 24, frame25, 48, frame49, 73, frame74, 98, frame99, 121, frame122);
}
function frame25(){
stop();
}
function frame49(){
stop();
}
function frame122(){
stop();
}
function frame74(){
stop();
}
function frame1(){
stop();
}
function frame99(){
stop();
}
}
}//package Gui_fla
Section 346
//Pausa_AlphaScreen_2 (InGameMenu_fla.Pausa_AlphaScreen_2)
package InGameMenu_fla {
import flash.display.*;
public dynamic class Pausa_AlphaScreen_2 extends MovieClip {
public function Pausa_AlphaScreen_2(){
addFrameScript(0, frame1);
}
function frame1(){
cacheAsBitmap = true;
}
}
}//package InGameMenu_fla
Section 347
//alarm (music.alarm)
package music {
import flash.media.*;
public dynamic class alarm extends Sound {
}
}//package music
Section 348
//congratulations (music.congratulations)
package music {
import flash.media.*;
public dynamic class congratulations extends Sound {
}
}//package music
Section 349
//gameMusic (music.gameMusic)
package music {
import flash.media.*;
public dynamic class gameMusic extends Sound {
}
}//package music
Section 350
//lastEvolution (music.lastEvolution)
package music {
import flash.media.*;
public dynamic class lastEvolution extends Sound {
}
}//package music
Section 351
//splashMusic (music.splashMusic)
package music {
import flash.media.*;
public dynamic class splashMusic extends Sound {
}
}//package music
Section 352
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.4.1.10084";
}
}//package mx.core
Section 353
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 354
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 355
//Action (org.flintparticles.common.actions.Action)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.behaviours.*;
public interface Action extends Behaviour {
function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void;
}
}//package org.flintparticles.common.actions
Section 356
//ActionBase (org.flintparticles.common.actions.ActionBase)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class ActionBase implements Action {
protected var _priority:int;// = 0
public function set priority(_arg1:int):void{
_priority = _arg1;
}
public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function get priority():int{
return (_priority);
}
}
}//package org.flintparticles.common.actions
Section 357
//Age (org.flintparticles.common.actions.Age)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.energyEasing.*;
public class Age extends ActionBase {
private var _easing:Function;
public function Age(_arg1:Function=null){
if (_arg1 == null){
_easing = Linear.easeNone;
} else {
_easing = _arg1;
};
}
public function set easing(_arg1:Function):void{
_easing = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
_arg2.age = (_arg2.age + _arg3);
if (_arg2.age >= _arg2.lifetime){
_arg2.energy = 0;
_arg2.isDead = true;
} else {
_arg2.energy = _easing(_arg2.age, _arg2.lifetime);
};
}
public function get easing():Function{
return (_easing);
}
}
}//package org.flintparticles.common.actions
Section 358
//Fade (org.flintparticles.common.actions.Fade)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class Fade extends ActionBase {
private var _endAlpha:Number;
private var _diffAlpha:Number;
public function Fade(_arg1:Number=1, _arg2:Number=0){
priority = -5;
_diffAlpha = (_arg1 - _arg2);
_endAlpha = _arg2;
}
public function get endAlpha():Number{
return (_endAlpha);
}
public function set endAlpha(_arg1:Number):void{
_diffAlpha = ((_endAlpha + _diffAlpha) - _arg1);
_endAlpha = _arg1;
}
public function set startAlpha(_arg1:Number):void{
_diffAlpha = (_arg1 - _endAlpha);
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Number = (_endAlpha + (_diffAlpha * _arg2.energy));
_arg2.color = ((_arg2.color & 0xFFFFFF) | (Math.round((_local4 * 0xFF)) << 24));
}
public function get startAlpha():Number{
return ((_endAlpha + _diffAlpha));
}
}
}//package org.flintparticles.common.actions
Section 359
//ScaleImage (org.flintparticles.common.actions.ScaleImage)
package org.flintparticles.common.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class ScaleImage extends ActionBase {
private var _diffScale:Number;
private var _endScale:Number;
public function ScaleImage(_arg1:Number=1, _arg2:Number=1){
_diffScale = (_arg1 - _arg2);
_endScale = _arg2;
}
public function set startScale(_arg1:Number):void{
_diffScale = (_arg1 - _endScale);
}
public function set endScale(_arg1:Number):void{
_diffScale = ((_endScale + _diffScale) - _arg1);
_endScale = _arg1;
}
public function get startScale():Number{
return ((_endScale + _diffScale));
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
_arg2.scale = (_endScale + (_diffScale * _arg2.energy));
}
public function get endScale():Number{
return (_endScale);
}
}
}//package org.flintparticles.common.actions
Section 360
//Activity (org.flintparticles.common.activities.Activity)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.behaviours.*;
public interface Activity extends Behaviour {
function initialize(_arg1:Emitter):void;
function update(_arg1:Emitter, _arg2:Number):void;
}
}//package org.flintparticles.common.activities
Section 361
//ActivityBase (org.flintparticles.common.activities.ActivityBase)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public class ActivityBase implements Activity {
protected var _priority:int;// = 0
public function set priority(_arg1:int):void{
_priority = _arg1;
}
public function update(_arg1:Emitter, _arg2:Number):void{
}
public function initialize(_arg1:Emitter):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function get priority():int{
return (_priority);
}
}
}//package org.flintparticles.common.activities
Section 362
//FrameUpdatable (org.flintparticles.common.activities.FrameUpdatable)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public interface FrameUpdatable {
function frameUpdate(_arg1:Emitter, _arg2:Number):void;
}
}//package org.flintparticles.common.activities
Section 363
//UpdateOnFrame (org.flintparticles.common.activities.UpdateOnFrame)
package org.flintparticles.common.activities {
import org.flintparticles.common.emitters.*;
public class UpdateOnFrame extends ActivityBase {
private var action:FrameUpdatable;
public function UpdateOnFrame(_arg1:FrameUpdatable){
action = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Number):void{
action.frameUpdate(_arg1, _arg2);
}
}
}//package org.flintparticles.common.activities
Section 364
//Behaviour (org.flintparticles.common.behaviours.Behaviour)
package org.flintparticles.common.behaviours {
import org.flintparticles.common.emitters.*;
public interface Behaviour {
function set priority(_arg1:int):void;
function addedToEmitter(_arg1:Emitter):void;
function get priority():int;
function removedFromEmitter(_arg1:Emitter):void;
}
}//package org.flintparticles.common.behaviours
Section 365
//BehaviourArrayUtils (org.flintparticles.common.behaviours.BehaviourArrayUtils)
package org.flintparticles.common.behaviours {
public class BehaviourArrayUtils {
public static function add(_arg1:Array, _arg2:Behaviour):uint{
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
if (_arg1[_local4].priority < _arg2.priority){
break;
};
_local4++;
};
_arg1.splice(_local4, 0, _arg2);
return ((_local3 + 1));
}
public static function remove(_arg1:Array, _arg2:Behaviour):Boolean{
var _local3:int = _arg1.indexOf(_arg2);
if (_local3 != -1){
_arg1.splice(_local3, 1);
return (true);
};
return (false);
}
public static function removeAt(_arg1:Array, _arg2:uint):Behaviour{
var _local3:Behaviour = (_arg1[_arg2] as Behaviour);
_arg1.splice(_arg2, 1);
return (_local3);
}
public static function containsType(_arg1:Array, _arg2:Class):Boolean{
var _local3:uint = _arg1.length;
var _local4:uint;
while (_local4 < _local3) {
if ((_arg1[_local4] is _arg2)){
return (true);
};
_local4++;
};
return (false);
}
public static function sortArray(_arg1:Array):void{
_arg1.sortOn("priority", Array.NUMERIC);
}
public static function clear(_arg1:Array):void{
_arg1.length = 0;
}
public static function contains(_arg1:Array, _arg2:Behaviour):Boolean{
return (!((_arg1.indexOf(_arg2) == -1)));
}
}
}//package org.flintparticles.common.behaviours
Section 366
//Resetable (org.flintparticles.common.behaviours.Resetable)
package org.flintparticles.common.behaviours {
public interface Resetable {
function reset():void;
}
}//package org.flintparticles.common.behaviours
Section 367
//Blast (org.flintparticles.common.counters.Blast)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class Blast implements Counter {
private var _done:Boolean;// = false
private var _startCount:uint;
public function Blast(_arg1:uint=0){
_startCount = _arg1;
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
return (0);
}
public function startEmitter(_arg1:Emitter):uint{
_arg1.dispatchCounterComplete();
return (_startCount);
}
public function resume():void{
}
public function stop():void{
}
public function get startCount():Number{
return (_startCount);
}
public function get complete():Boolean{
return (_done);
}
public function set startCount(_arg1:Number):void{
_startCount = _arg1;
}
}
}//package org.flintparticles.common.counters
Section 368
//Counter (org.flintparticles.common.counters.Counter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public interface Counter {
function stop():void;
function updateEmitter(_arg1:Emitter, _arg2:Number):uint;
function get complete():Boolean;
function startEmitter(_arg1:Emitter):uint;
function resume():void;
}
}//package org.flintparticles.common.counters
Section 369
//Steady (org.flintparticles.common.counters.Steady)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class Steady implements Counter {
private var _stop:Boolean;
private var _rateInv:Number;
private var _timeToNext:Number;
private var _rate:Number;
public function Steady(_arg1:Number=0){
_stop = false;
_rate = _arg1;
_rateInv = (1 / _rate);
}
public function get rate():Number{
return (_rate);
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
if (_stop){
return (0);
};
var _local3:uint;
_timeToNext = (_timeToNext - _arg2);
while (_timeToNext <= 0) {
_local3++;
_timeToNext = (_timeToNext + _rateInv);
};
return (_local3);
}
public function set rate(_arg1:Number):void{
_rate = _arg1;
_rateInv = (1 / _arg1);
}
public function stop():void{
_stop = true;
}
public function startEmitter(_arg1:Emitter):uint{
_timeToNext = _rateInv;
return (0);
}
public function resume():void{
_stop = false;
}
public function get complete():Boolean{
return (false);
}
}
}//package org.flintparticles.common.counters
Section 370
//ZeroCounter (org.flintparticles.common.counters.ZeroCounter)
package org.flintparticles.common.counters {
import org.flintparticles.common.emitters.*;
public class ZeroCounter implements Counter {
public function get complete():Boolean{
return (true);
}
public function stop():void{
}
public function updateEmitter(_arg1:Emitter, _arg2:Number):uint{
return (0);
}
public function startEmitter(_arg1:Emitter):uint{
return (0);
}
public function resume():void{
}
}
}//package org.flintparticles.common.counters
Section 371
//Emitter (org.flintparticles.common.emitters.Emitter)
package org.flintparticles.common.emitters {
import flash.events.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.activities.*;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.behaviours.*;
import org.flintparticles.common.utils.*;
public class Emitter extends EventDispatcher {
protected var _running:Boolean;// = false
protected var _activities:Array;
protected var _particles:Array;
protected var _initializers:Array;
protected var _dispatchCounterComplete:Boolean;// = false
protected var _counter:Counter;
protected var _started:Boolean;// = false
protected var _actions:Array;
protected var _useInternalTick:Boolean;// = true
protected var _particleFactory:ParticleFactory;
protected var _fixedFrameTime:Number;// = 0
protected var _maximumFrameTime:Number;// = 0.1
public function Emitter(){
_particles = new Array();
_actions = new Array();
_initializers = new Array();
_activities = new Array();
_counter = new ZeroCounter();
}
public function addInitializer(_arg1:Initializer):void{
BehaviourArrayUtils.add(_initializers, _arg1);
_arg1.addedToEmitter(this);
}
public function stop():void{
if (_useInternalTick){
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
_started = false;
killAllParticles();
}
public function pause():void{
_running = false;
}
public function killAllParticles():void{
var _local1:int = _particles.length;
var _local2:int;
while (_local2 < _local1) {
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _particles[_local2]));
_particleFactory.disposeParticle(_particles[_local2]);
_local2++;
};
_particles.length = 0;
}
public function runAhead(_arg1:Number, _arg2:Number=10):void{
var _local3:Number = _maximumFrameTime;
var _local4:Number = (1 / _arg2);
_maximumFrameTime = _local4;
while (_arg1 > 0) {
_arg1 = (_arg1 - _local4);
update(_local4);
};
_maximumFrameTime = _local3;
}
public function set fixedFrameTime(_arg1:Number):void{
_fixedFrameTime = _arg1;
}
public function get maximumFrameTime():Number{
return (_maximumFrameTime);
}
public function set particles(_arg1:Array):void{
killAllParticles();
addExistingParticles(_arg1, false);
}
public function get useInternalTick():Boolean{
return (_useInternalTick);
}
public function set initializers(_arg1:Array):void{
var _local2:Initializer;
for each (_local2 in _initializers) {
_local2.removedFromEmitter(this);
};
_initializers = _arg1.slice();
BehaviourArrayUtils.sortArray(_initializers);
for each (_local2 in _arg1) {
_local2.addedToEmitter(this);
};
}
public function get particleFactory():ParticleFactory{
return (_particleFactory);
}
private function updateEventListener(_arg1:UpdateEvent):void{
if (_fixedFrameTime){
update(_fixedFrameTime);
} else {
update(_arg1.time);
};
}
protected function createParticle():Particle{
var _local1:Particle = _particleFactory.createParticle();
var _local2:int = _initializers.length;
initParticle(_local1);
var _local3:int;
while (_local3 < _local2) {
_initializers[_local3].initialize(this, _local1);
_local3++;
};
_particles.push(_local1);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_CREATED, _local1));
return (_local1);
}
public function get particles():Array{
return (_particles);
}
protected function sortParticles():void{
}
public function removeActivity(_arg1:Activity):void{
if (BehaviourArrayUtils.remove(_activities, _arg1)){
_arg1.removedFromEmitter(this);
};
}
public function set maximumFrameTime(_arg1:Number):void{
_maximumFrameTime = _arg1;
}
protected function initParticle(_arg1:Particle):void{
}
public function addAction(_arg1:Action):void{
BehaviourArrayUtils.add(_actions, _arg1);
_arg1.addedToEmitter(this);
}
public function hasInitializerOfType(_arg1:Class):Boolean{
return (BehaviourArrayUtils.containsType(_initializers, _arg1));
}
public function removeInitializer(_arg1:Initializer):void{
if (BehaviourArrayUtils.remove(_initializers, _arg1)){
_arg1.removedFromEmitter(this);
};
}
public function get running():Boolean{
return (_running);
}
public function hasActionOfType(_arg1:Class):Boolean{
return (BehaviourArrayUtils.containsType(_actions, _arg1));
}
public function get fixedFrameTime():Number{
return (_fixedFrameTime);
}
public function set particleFactory(_arg1:ParticleFactory):void{
_particleFactory = _arg1;
}
public function set useInternalTick(_arg1:Boolean):void{
if (_useInternalTick != _arg1){
_useInternalTick = _arg1;
if (_started){
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
} else {
FrameUpdater.instance.removeEventListener(UpdateEvent.UPDATE, updateEventListener);
};
};
};
}
public function resume():void{
_running = true;
}
public function addActivity(_arg1:Activity):void{
BehaviourArrayUtils.add(_activities, _arg1);
_arg1.addedToEmitter(this);
}
public function get initializers():Array{
return (_initializers);
}
public function addExistingParticles(_arg1:Array, _arg2:Boolean=false):void{
var _local4:int;
var _local5:int;
var _local6:int;
var _local3:int = _arg1.length;
if (_arg2){
_local5 = _initializers.length;
_local6 = 0;
while (_local6 < _local5) {
_local4 = 0;
while (_local4 < _local3) {
_initializers[_local6].initialize(this, _arg1[_local4]);
_local4++;
};
_local6++;
};
};
_local4 = 0;
while (_local4 < _local3) {
_particles.push(_arg1[_local4]);
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_ADDED, _arg1[_local4]));
_local4++;
};
}
public function hasActivityOfType(_arg1:Class):Boolean{
return (BehaviourArrayUtils.containsType(_activities, _arg1));
}
public function set activities(_arg1:Array):void{
var _local2:Activity;
for each (_local2 in _activities) {
_local2.removedFromEmitter(this);
};
_activities = _arg1.slice();
BehaviourArrayUtils.sortArray(_activities);
for each (_local2 in _activities) {
_local2.addedToEmitter(this);
};
}
public function hasInitializer(_arg1:Initializer):Boolean{
return (BehaviourArrayUtils.contains(_initializers, _arg1));
}
public function removeAction(_arg1:Action):void{
if (BehaviourArrayUtils.remove(_actions, _arg1)){
_arg1.removedFromEmitter(this);
};
}
public function hasActivity(_arg1:Activity):Boolean{
return (BehaviourArrayUtils.contains(_activities, _arg1));
}
public function get activities():Array{
return (_activities);
}
public function hasAction(_arg1:Action):Boolean{
return (BehaviourArrayUtils.contains(_actions, _arg1));
}
public function start():void{
if (_useInternalTick){
FrameUpdater.instance.addEventListener(UpdateEvent.UPDATE, updateEventListener, false, 0, true);
};
_started = true;
_running = true;
var _local1:int = _activities.length;
var _local2:int;
while (_local2 < _local1) {
_activities[_local2].initialize(this);
_local2++;
};
_local1 = _counter.startEmitter(this);
_local2 = 0;
while (_local2 < _local1) {
createParticle();
_local2++;
};
}
public function update(_arg1:Number):void{
var _local2:int;
var _local3:Particle;
var _local5:Action;
var _local6:int;
var _local7:int;
if (!_running){
return;
};
if (_arg1 > _maximumFrameTime){
_arg1 = _maximumFrameTime;
};
var _local4:int = _counter.updateEmitter(this, _arg1);
_local2 = 0;
while (_local2 < _local4) {
createParticle();
_local2++;
};
sortParticles();
_local4 = _activities.length;
_local2 = 0;
while (_local2 < _local4) {
_activities[_local2].update(this, _arg1);
_local2++;
};
if (_particles.length > 0){
_local4 = _actions.length;
_local6 = _particles.length;
_local7 = 0;
while (_local7 < _local4) {
_local5 = _actions[_local7];
_local2 = 0;
while (_local2 < _local6) {
_local3 = _particles[_local2];
_local5.update(this, _local3, _arg1);
_local2++;
};
_local7++;
};
_local2 = _local6;
while (_local2--) {
_local3 = _particles[_local2];
if (_local3.isDead){
dispatchEvent(new ParticleEvent(ParticleEvent.PARTICLE_DEAD, _local3));
_particleFactory.disposeParticle(_local3);
_particles.splice(_local2, 1);
};
};
} else {
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_EMPTY));
};
dispatchEvent(new EmitterEvent(EmitterEvent.EMITTER_UPDATED));
if (_dispatchCounterComplete){
_dispatchCounterComplete = false;
dispatchEvent(new EmitterEvent(EmitterEvent.COUNTER_COMPLETE));
};
}
public function set counter(_arg1:Counter):void{
_counter = _arg1;
if (running){
_counter.startEmitter(this);
};
}
public function set actions(_arg1:Array):void{
var _local2:Action;
for each (_local2 in _actions) {
_local2.removedFromEmitter(this);
};
_actions = _arg1.slice();
BehaviourArrayUtils.sortArray(_actions);
for each (_local2 in _arg1) {
_local2.addedToEmitter(this);
};
}
public function dispatchCounterComplete():void{
_dispatchCounterComplete = true;
}
public function get counter():Counter{
return (_counter);
}
public function get actions():Array{
return (_actions);
}
}
}//package org.flintparticles.common.emitters
Section 372
//Linear (org.flintparticles.common.energyEasing.Linear)
package org.flintparticles.common.energyEasing {
public class Linear {
public static function easeOut(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeIn(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeInOut(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
public static function easeNone(_arg1:Number, _arg2:Number):Number{
return ((1 - (_arg1 / _arg2)));
}
}
}//package org.flintparticles.common.energyEasing
Section 373
//EmitterEvent (org.flintparticles.common.events.EmitterEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class EmitterEvent extends Event {
public static var COUNTER_COMPLETE:String = "counterComplete";
public static var EMITTER_UPDATED:String = "emitterUpdated";
public static var EMITTER_EMPTY:String = "emitterEmpty";
public function EmitterEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
}
}//package org.flintparticles.common.events
Section 374
//ParticleEvent (org.flintparticles.common.events.ParticleEvent)
package org.flintparticles.common.events {
import flash.events.*;
import org.flintparticles.common.particles.*;
public class ParticleEvent extends Event {
public var particle:Particle;
public var otherObject;
public static var PARTICLES_COLLISION:String = "particlesCollision";
public static var PARTICLE_ADDED:String = "particleAdded";
public static var PARTICLE_DEAD:String = "particleDead";
public static var PARTICLE_CREATED:String = "particleCreated";
public function ParticleEvent(_arg1:String, _arg2:Particle=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.particle = _arg2;
}
override public function clone():Event{
var _local1:ParticleEvent = new ParticleEvent(type, particle, bubbles, cancelable);
_local1.otherObject = otherObject;
return (_local1);
}
}
}//package org.flintparticles.common.events
Section 375
//UpdateEvent (org.flintparticles.common.events.UpdateEvent)
package org.flintparticles.common.events {
import flash.events.*;
public class UpdateEvent extends Event {
public var time:Number;
public static var UPDATE:String = "update";
public function UpdateEvent(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.time = _arg2;
}
override public function clone():Event{
return (new UpdateEvent(type, time, bubbles, cancelable));
}
}
}//package org.flintparticles.common.events
Section 376
//AlphaInit (org.flintparticles.common.initializers.AlphaInit)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class AlphaInit extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function AlphaInit(_arg1:Number=1, _arg2:Number=NaN){
priority = -10;
_min = _arg1;
if (isNaN(_arg2)){
_max = _min;
} else {
_max = _arg2;
};
}
public function get minAlpha():Number{
return (_min);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Number;
if (_max == _min){
_local3 = _min;
} else {
_local3 = (_min + (Math.random() * (_max - _min)));
};
_arg2.color = ((_arg2.color & 0xFFFFFF) | (Math.round((_local3 * 0xFF)) << 24));
}
public function set maxAlpha(_arg1:Number):void{
_max = _arg1;
}
public function set minAlpha(_arg1:Number):void{
_min = _arg1;
}
public function get maxAlpha():Number{
return (_max);
}
public function set alpha(_arg1:Number):void{
_max = (_min = _arg1);
}
public function get alpha():Number{
return (((_min == _max)) ? _min : ((_max + _min) / 2));
}
}
}//package org.flintparticles.common.initializers
Section 377
//ColorInit (org.flintparticles.common.initializers.ColorInit)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class ColorInit extends InitializerBase {
private var _max:uint;
private var _min:uint;
public function ColorInit(_arg1:uint=0xFFFFFF, _arg2:uint=0xFFFFFF){
_min = _arg1;
_max = _arg2;
}
public function set minColor(_arg1:uint):void{
_min = _arg1;
}
public function get color():uint{
return (((_min == _max)) ? _min : interpolateColors(_max, _min, 0.5));
}
public function set color(_arg1:uint):void{
_max = (_min = _arg1);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
if (_max == _min){
_arg2.color = _min;
} else {
_arg2.color = interpolateColors(_min, _max, Math.random());
};
}
public function get minColor():uint{
return (_min);
}
public function set maxColor(_arg1:uint):void{
_max = _arg1;
}
public function get maxColor():uint{
return (_max);
}
}
}//package org.flintparticles.common.initializers
Section 378
//ImageClasses (org.flintparticles.common.initializers.ImageClasses)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.utils.*;
public class ImageClasses extends InitializerBase {
private var _mxmlImages:Array;
private var _mxmlWeights:Array;
private var _images:WeightedArray;
public function ImageClasses(_arg1:Array=null, _arg2:Array=null){
_images = new WeightedArray();
if (_arg1 == null){
return;
};
init(_arg1, _arg2);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Pair = _images.getRandomValue();
_arg2.image = construct(_local3.image, _local3.parameters);
}
public function addImage(_arg1, _arg2:Number=1):void{
var _local3:Array;
var _local4:Class;
if ((_arg1 is Array)){
_local3 = (_arg1 as Array).concat();
_local4 = _local3.shift();
_images.add(new Pair(_local4, _local3), _arg2);
} else {
_images.add(new Pair(_arg1, []), _arg2);
};
}
private function init(_arg1:Array=null, _arg2:Array=null):void{
var _local4:int;
_images.clear();
var _local3:int = _arg1.length;
if (((!((_arg2 == null))) && ((_arg2.length == _local3)))){
_local4 = 0;
while (_local4 < _local3) {
addImage(_arg1[_local4], _arg2[_local4]);
_local4++;
};
} else {
_local4 = 0;
while (_local4 < _local3) {
addImage(_arg1[_local4], 1);
_local4++;
};
};
}
public function set weights(_arg1:Array):void{
if ((((_arg1.length == 1)) && ((_arg1[0] is String)))){
_mxmlWeights = _arg1[0].split(",");
} else {
_mxmlWeights = _arg1;
};
checkStartValues();
}
public function removeImage(_arg1):void{
_images.remove(_arg1);
}
override public function addedToEmitter(_arg1:Emitter):void{
if (_mxmlImages){
init(_mxmlImages, _mxmlWeights);
_mxmlImages = null;
_mxmlWeights = null;
};
}
private function checkStartValues():void{
if (((_mxmlImages) && (_mxmlWeights))){
init(_mxmlImages, _mxmlWeights);
_mxmlImages = null;
_mxmlWeights = null;
};
}
public function set images(_arg1:Array):void{
_mxmlImages = _arg1;
checkStartValues();
}
}
}//package org.flintparticles.common.initializers
class Pair {
private var parameters:Array;
private var image:Class;
private function Pair(_arg1:Class, _arg2:Array){
this.image = _arg1;
this.parameters = _arg2;
}
}
Section 379
//Initializer (org.flintparticles.common.initializers.Initializer)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.behaviours.*;
public interface Initializer extends Behaviour {
function initialize(_arg1:Emitter, _arg2:Particle):void;
}
}//package org.flintparticles.common.initializers
Section 380
//InitializerBase (org.flintparticles.common.initializers.InitializerBase)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class InitializerBase implements Initializer {
protected var _priority:int;// = 0
public function set priority(_arg1:int):void{
_priority = _arg1;
}
public function initialize(_arg1:Emitter, _arg2:Particle):void{
}
public function removedFromEmitter(_arg1:Emitter):void{
}
public function addedToEmitter(_arg1:Emitter):void{
}
public function get priority():int{
return (_priority);
}
}
}//package org.flintparticles.common.initializers
Section 381
//Lifetime (org.flintparticles.common.initializers.Lifetime)
package org.flintparticles.common.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class Lifetime extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function Lifetime(_arg1:Number=1.79769313486232E308, _arg2:Number=NaN){
_max = _arg2;
_min = _arg1;
}
public function get lifetime():Number{
return (((_min == _max)) ? _min : ((_max + _min) * 0.5));
}
public function get maxLifetime():Number{
return (_max);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
if (isNaN(_max)){
_arg2.lifetime = _min;
} else {
_arg2.lifetime = (_min + (Math.random() * (_max - _min)));
};
}
public function set lifetime(_arg1:Number):void{
_max = (_min = _arg1);
}
public function set minLifetime(_arg1:Number):void{
_min = _arg1;
}
public function set maxLifetime(_arg1:Number):void{
_max = _arg1;
}
public function get minLifetime():Number{
return (_min);
}
}
}//package org.flintparticles.common.initializers
Section 382
//SharedImage (org.flintparticles.common.initializers.SharedImage)
package org.flintparticles.common.initializers {
import flash.display.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class SharedImage extends InitializerBase {
private var _image:DisplayObject;
public function SharedImage(_arg1:DisplayObject=null){
_image = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
_arg2.image = _image;
}
public function set image(_arg1:DisplayObject):void{
_image = _arg1;
}
public function get image():DisplayObject{
return (_image);
}
}
}//package org.flintparticles.common.initializers
Section 383
//Particle (org.flintparticles.common.particles.Particle)
package org.flintparticles.common.particles {
import flash.geom.*;
import flash.utils.*;
public class Particle {
public var energy:Number;// = 1
public var lifetime:Number;// = 0
public var scale:Number;// = 1
public var image;// = null
public var color:uint;// = 4294967295
public var collisionRadius:Number;// = 1
private var _colorTransform:ColorTransform;// = null
private var _previousColor:uint;
public var isDead:Boolean;// = false
public var mass:Number;// = 1
private var _dictionary:Dictionary;// = null
public var age:Number;// = 0
public function get dictionary():Dictionary{
if (_dictionary == null){
_dictionary = new Dictionary(true);
};
return (_dictionary);
}
public function get colorTransform():ColorTransform{
if (((!(_colorTransform)) || (!((_previousColor == color))))){
_colorTransform = new ColorTransform((((color >>> 16) & 0xFF) / 0xFF), (((color >>> 8) & 0xFF) / 0xFF), ((color & 0xFF) / 0xFF), (((color >>> 24) & 0xFF) / 0xFF), 0, 0, 0, 0);
_previousColor = color;
};
return (_colorTransform);
}
protected function cloneInto(_arg1:Particle):Particle{
var _local2:Object;
_arg1.color = color;
_arg1.scale = scale;
_arg1.mass = mass;
_arg1.collisionRadius = collisionRadius;
_arg1.lifetime = lifetime;
_arg1.age = age;
_arg1.energy = energy;
_arg1.isDead = isDead;
_arg1.image = image;
if (_dictionary){
_arg1._dictionary = new Dictionary(true);
for (_local2 in _dictionary) {
_arg1._dictionary[_local2] = _dictionary[_local2];
};
};
return (_arg1);
}
public function get alpha():Number{
return ((((color & 4278190080) >>> 24) / 0xFF));
}
public function initialize():void{
color = 4294967295;
scale = 1;
mass = 1;
collisionRadius = 1;
lifetime = 0;
age = 0;
energy = 1;
isDead = false;
image = null;
_dictionary = null;
_colorTransform = null;
}
public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle;
if (_arg1){
_local2 = _arg1.createParticle();
} else {
_local2 = new Particle();
};
return (cloneInto(_local2));
}
}
}//package org.flintparticles.common.particles
Section 384
//ParticleFactory (org.flintparticles.common.particles.ParticleFactory)
package org.flintparticles.common.particles {
public interface ParticleFactory {
function clearAllParticles():void;
function createParticle():Particle;
function disposeParticle(_arg1:Particle):void;
}
}//package org.flintparticles.common.particles
Section 385
//Renderer (org.flintparticles.common.renderers.Renderer)
package org.flintparticles.common.renderers {
import org.flintparticles.common.emitters.*;
public interface Renderer {
function removeEmitter(_arg1:Emitter):void;
function addEmitter(_arg1:Emitter):void;
}
}//package org.flintparticles.common.renderers
Section 386
//SpriteRendererBase (org.flintparticles.common.renderers.SpriteRendererBase)
package org.flintparticles.common.renderers {
import flash.display.*;
import flash.events.*;
import org.flintparticles.common.events.*;
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
public class SpriteRendererBase extends Sprite implements Renderer {
protected var _emitters:Array;
public function SpriteRendererBase(){
_emitters = new Array();
mouseEnabled = false;
mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, true);
}
private function particleAdded(_arg1:ParticleEvent):void{
addParticle(_arg1.particle);
if (stage){
stage.invalidate();
};
}
public function set emitters(_arg1:Array):void{
var _local2:Emitter;
for each (_local2 in _emitters) {
removeEmitter(_local2);
};
for each (_local2 in _arg1) {
addEmitter(_local2);
};
}
private function addedToStage(_arg1:Event):void{
if (stage){
stage.invalidate();
};
}
public function get emitters():Array{
return (_emitters);
}
protected function addParticle(_arg1:Particle):void{
}
private function updateParticles(_arg1:Event):void{
var _local2:Array = new Array();
var _local3:int;
while (_local3 < _emitters.length) {
_local2 = _local2.concat(_emitters[_local3].particles);
_local3++;
};
renderParticles(_local2);
}
private function emitterUpdated(_arg1:EmitterEvent):void{
if (stage){
stage.invalidate();
};
}
public function removeEmitter(_arg1:Emitter):void{
var _local3:Particle;
var _local2:int;
while (_local2 < _emitters.length) {
if (_emitters[_local2] == _arg1){
_emitters.splice(_local2, 1);
_arg1.removeEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated);
_arg1.removeEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded);
_arg1.removeEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded);
_arg1.removeEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved);
for each (_local3 in _arg1.particles) {
removeParticle(_local3);
};
if (_emitters.length == 0){
removeEventListener(Event.RENDER, updateParticles);
renderParticles([]);
} else {
stage.invalidate();
};
return;
};
_local2++;
};
}
protected function renderParticles(_arg1:Array):void{
}
protected function removeParticle(_arg1:Particle):void{
}
private function particleRemoved(_arg1:ParticleEvent):void{
removeParticle(_arg1.particle);
if (stage){
stage.invalidate();
};
}
public function addEmitter(_arg1:Emitter):void{
var _local2:Particle;
_emitters.push(_arg1);
if (stage){
stage.invalidate();
};
_arg1.addEventListener(EmitterEvent.EMITTER_UPDATED, emitterUpdated, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_CREATED, particleAdded, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_ADDED, particleAdded, false, 0, true);
_arg1.addEventListener(ParticleEvent.PARTICLE_DEAD, particleRemoved, false, 0, true);
for each (_local2 in _arg1.particles) {
addParticle(_local2);
};
if (_emitters.length == 1){
addEventListener(Event.RENDER, updateParticles, false, 0, true);
};
}
}
}//package org.flintparticles.common.renderers
Section 387
//construct (org.flintparticles.common.utils.construct)
package org.flintparticles.common.utils {
public function construct(_arg1:Class, _arg2:Array){
switch (_arg2.length){
case 0:
return (new (_arg1));
case 1:
return (new _arg1(_arg2[0]));
case 2:
return (new _arg1(_arg2[0], _arg2[1]));
case 3:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2]));
case 4:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3]));
case 5:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4]));
case 6:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5]));
case 7:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6]));
case 8:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7]));
case 9:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8]));
case 10:
return (new _arg1(_arg2[0], _arg2[1], _arg2[2], _arg2[3], _arg2[4], _arg2[5], _arg2[6], _arg2[7], _arg2[8], _arg2[9]));
default:
return (null);
};
}
}//package org.flintparticles.common.utils
Section 388
//FrameUpdater (org.flintparticles.common.utils.FrameUpdater)
package org.flintparticles.common.utils {
import flash.display.*;
import flash.events.*;
import org.flintparticles.common.events.*;
import flash.utils.*;
public class FrameUpdater extends EventDispatcher {
private var _shape:Shape;
private var _running:Boolean;// = false
private var _time:Number;
private static var _instance:FrameUpdater;
public function FrameUpdater(){
_shape = new Shape();
}
private function startTimer():void{
_shape.addEventListener(Event.ENTER_FRAME, frameUpdate, false, 0, true);
_time = getTimer();
_running = true;
}
private function stopTimer():void{
_shape.removeEventListener(Event.ENTER_FRAME, frameUpdate);
_running = false;
}
override public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
super.removeEventListener(_arg1, _arg2, _arg3);
if (((_running) && (!(hasEventListener(UpdateEvent.UPDATE))))){
stopTimer();
};
}
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);
if (((!(_running)) && (hasEventListener(UpdateEvent.UPDATE)))){
startTimer();
};
}
private function frameUpdate(_arg1:Event):void{
var _local2:int = _time;
_time = getTimer();
var _local3:Number = ((_time - _local2) * 0.001);
dispatchEvent(new UpdateEvent(UpdateEvent.UPDATE, _local3));
}
public static function get instance():FrameUpdater{
if (_instance == null){
_instance = new (FrameUpdater);
};
return (_instance);
}
}
}//package org.flintparticles.common.utils
Section 389
//interpolateColors (org.flintparticles.common.utils.interpolateColors)
package org.flintparticles.common.utils {
public function interpolateColors(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number = (1 - _arg3);
var _local5:uint = Math.round(((((_arg1 >>> 16) & 0xFF) * _arg3) + (((_arg2 >>> 16) & 0xFF) * _local4)));
var _local6:uint = Math.round(((((_arg1 >>> 8) & 0xFF) * _arg3) + (((_arg2 >>> 8) & 0xFF) * _local4)));
var _local7:uint = Math.round((((_arg1 & 0xFF) * _arg3) + ((_arg2 & 0xFF) * _local4)));
var _local8:uint = Math.round(((((_arg1 >>> 24) & 0xFF) * _arg3) + (((_arg2 >>> 24) & 0xFF) * _local4)));
return (((((_local8 << 24) | (_local5 << 16)) | (_local6 << 8)) | _local7));
}
}//package org.flintparticles.common.utils
Section 390
//Maths (org.flintparticles.common.utils.Maths)
package org.flintparticles.common.utils {
public class Maths {
private static const DEGTORAD:Number = (Math.PI / 180);
private static const RADTODEG:Number = (180 / Math.PI);
public static function asRadians(_arg1:Number):Number{
return ((_arg1 * DEGTORAD));
}
public static function asDegrees(_arg1:Number):Number{
return ((_arg1 * RADTODEG));
}
}
}//package org.flintparticles.common.utils
Section 391
//WeightedArray (org.flintparticles.common.utils.WeightedArray)
package org.flintparticles.common.utils {
import flash.utils.*;
public class WeightedArray extends Proxy {
private var _values:Array;
private var _totalWeights:Number;
public function WeightedArray(){
_values = new Array();
_totalWeights = 0;
}
public function remove(_arg1):Boolean{
var _local2:uint = _values.length;
while (_local2--) {
if (_values[_local2].value == _arg1){
_totalWeights = (_totalWeights - _values[_local2].weight);
_values.splice(_local2, 1);
return (true);
};
};
return (false);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{
return ((_arg1 - 1).toString());
}
public function removeAt(_arg1:uint){
var _local2:* = _values[_arg1].value;
_totalWeights = (_totalWeights - _values[_arg1].weight);
_values.splice(_arg1, 1);
return (_local2);
}
public function add(_arg1, _arg2:Number):uint{
_totalWeights = (_totalWeights + _arg2);
_values.push(new Pair(_arg2, _arg1));
return (_values.length);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
var _local2:int = int(_arg1);
if ((((((_local2 == _arg1)) && ((_local2 < _values.length)))) && (_values[_local2]))){
return (_values[_local2].value);
};
return (undefined);
}
public function clear():void{
_values.length = 0;
_totalWeights = 0;
}
public function get totalWeights():Number{
return (_totalWeights);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{
if (_arg1 < _values.length){
return ((_arg1 + 1));
};
return (0);
}
public function get length():uint{
return (_values.length);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:uint = uint(_arg1);
if ((((_local3 == _arg1)) && ((_local3 < _values.length)))){
_values[_local3].value = _arg2;
};
}
public function getRandomValue(){
var _local1:Number = (Math.random() * _totalWeights);
var _local2:Number = 0;
var _local3:int = _values.length;
var _local4:int;
while (_local4 < _local3) {
_local2 = (_local2 + _values[_local4].weight);
if (_local2 >= _local1){
return (_values[_local4].value);
};
_local4++;
};
return (_values[(_local3 - 1)].value);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextValue(_arg1:int){
return (_values[(_arg1 - 1)].value);
}
public function contains(_arg1):Boolean{
var _local2:uint = _values.length;
while (_local2--) {
if (_values[_local2].value == _arg1){
return (true);
};
};
return (false);
}
}
}//package org.flintparticles.common.utils
class Pair {
private var weight:Number;
private var value;
private function Pair(_arg1:Number, _arg2){
this.weight = _arg1;
this.value = _arg2;
}
}
Section 392
//Accelerate (org.flintparticles.twoD.actions.Accelerate)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class Accelerate extends ActionBase {
private var _x:Number;
private var _y:Number;
public function Accelerate(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function get y():Number{
return (_y);
}
public function get x():Number{
return (_x);
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D = Particle2D(_arg2);
Particle2D(_arg2).velX = (_local4.velX + (_x * _arg3));
_local4.velY = (_local4.velY + (_y * _arg3));
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
}
}//package org.flintparticles.twoD.actions
Section 393
//Explosion (org.flintparticles.twoD.actions.Explosion)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.common.activities.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.common.behaviours.*;
public class Explosion extends ActionBase implements Resetable, FrameUpdatable {
private var _expansionRate:Number;// = 500
private var _radiusChange:Number;// = 0
private var _depth:Number;
private var _power:Number;
private var _radius:Number;// = 0
private var _updateActivity:UpdateOnFrame;
private var _oldRadius:Number;// = 0
private var _epsilonSq:Number;
private var _invDepth:Number;
private var _x:Number;
private var _y:Number;
private static const POWER_FACTOR:Number = 100000;
public function Explosion(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=300, _arg5:Number=10, _arg6:Number=1){
this.power = _arg1;
this.x = _arg2;
this.y = _arg3;
this.expansionRate = _arg4;
this.depth = _arg5;
this.epsilon = _arg6;
}
public function get depth():Number{
return ((_depth * 2));
}
public function get power():Number{
return ((_power / POWER_FACTOR));
}
public function set power(_arg1:Number):void{
_power = (_arg1 * POWER_FACTOR);
}
public function set depth(_arg1:Number):void{
_depth = (_arg1 * 0.5);
_invDepth = (1 / _depth);
}
public function reset():void{
_radius = 0;
_oldRadius = 0;
_radiusChange = 0;
}
public function get x():Number{
return (_x);
}
public function get y():Number{
return (_y);
}
override public function addedToEmitter(_arg1:Emitter):void{
_updateActivity = new UpdateOnFrame(this);
_arg1.addActivity(_updateActivity);
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local4:Particle2D = Particle2D(_arg2);
var _local5:Number = (_local4.x - _x);
var _local6:Number = (_local4.y - _y);
var _local7:Number = ((_local5 * _local5) + (_local6 * _local6));
if (_local7 == 0){
_local7 = 0.02;
_local5 = 0.1;
_local6 = 0.1;
};
var _local8:Number = Math.sqrt(_local7);
if (_local8 < (_oldRadius - _depth)){
return;
};
if (_local8 > (_radius + _depth)){
return;
};
var _local9:Number = ((_local8 < _radius)) ? ((_depth - _radius) + _local8) : ((_depth - _local8) + _radius);
var _local10:Number = ((_local8 < _oldRadius)) ? ((_depth - _oldRadius) + _local8) : ((_depth - _local8) + _oldRadius);
_local9 = (_local9 * _invDepth);
_local10 = (_local10 * _invDepth);
if (_local9 < 0){
_arg3 = ((_arg3 * (_radiusChange + _local9)) / _radiusChange);
_local9 = 0;
};
if (_local10 < 0){
_arg3 = ((_arg3 * (_radiusChange + _local10)) / _radiusChange);
_local10 = 0;
};
if ((((_local8 < _oldRadius)) || ((_local8 > _radius)))){
_local11 = (((_arg3 * _power) * (_local9 + _local10)) / (((_radius * 2) * _local8) * _local4.mass));
} else {
_local12 = ((1 - _local10) / _radiusChange);
_local13 = (((_local12 * _arg3) * _power) * (_local10 + 1));
_local14 = ((((1 - _local12) * _arg3) * _power) * (_local9 + 1));
_local11 = ((_local13 + _local14) / (((_radius * 2) * _local8) * _local4.mass));
};
_local4.velX = (_local4.velX + (_local5 * _local11));
_local4.velY = (_local4.velY + (_local6 * _local11));
}
public function set epsilon(_arg1:Number):void{
_epsilonSq = (_arg1 * _arg1);
}
public function frameUpdate(_arg1:Emitter, _arg2:Number):void{
_oldRadius = _radius;
_radiusChange = (_expansionRate * _arg2);
_radius = (_radius + _radiusChange);
}
override public function removedFromEmitter(_arg1:Emitter):void{
if (_updateActivity){
_arg1.removeActivity(_updateActivity);
};
}
public function get epsilon():Number{
return (Math.sqrt(_epsilonSq));
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function set expansionRate(_arg1:Number):void{
_expansionRate = _arg1;
}
public function get expansionRate():Number{
return (_expansionRate);
}
}
}//package org.flintparticles.twoD.actions
Section 394
//GravityWell (org.flintparticles.twoD.actions.GravityWell)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class GravityWell extends ActionBase {
private var lp:Particle2D;
private var _power:Number;
private var ly:Number;
private var lx:Number;
private var _gravityConst:Number;// = 10000
private var _epsilonSq:Number;
private var ldSq:Number;
private var ld:Number;
private var _x:Number;
private var _y:Number;
private var lfactor:Number;
public function GravityWell(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=100){
this.power = _arg1;
this.x = _arg2;
this.y = _arg3;
this.epsilon = _arg4;
}
public function get y():Number{
return (_y);
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public function get power():Number{
return ((_power / _gravityConst));
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
if (_arg2.mass == 0){
return;
};
lp = Particle2D(_arg2);
lx = (_x - lp.x);
ly = (_y - lp.y);
ldSq = ((lx * lx) + (ly * ly));
if (ldSq == 0){
return;
};
ld = Math.sqrt(ldSq);
if (ldSq < _epsilonSq){
ldSq = _epsilonSq;
};
lfactor = ((_power * _arg3) / (ldSq * ld));
lp.velX = (lp.velX + (lx * lfactor));
lp.velY = (lp.velY + (ly * lfactor));
}
public function set power(_arg1:Number):void{
_power = (_arg1 * _gravityConst);
}
public function set epsilon(_arg1:Number):void{
_epsilonSq = (_arg1 * _arg1);
}
public function get epsilon():Number{
return (Math.sqrt(_epsilonSq));
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function get x():Number{
return (_x);
}
}
}//package org.flintparticles.twoD.actions
Section 395
//LinearDrag (org.flintparticles.twoD.actions.LinearDrag)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class LinearDrag extends ActionBase {
private var _drag:Number;
public function LinearDrag(_arg1:Number=0){
this.drag = _arg1;
}
public function get drag():Number{
return (_drag);
}
public function set drag(_arg1:Number):void{
_drag = _arg1;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Particle2D;
_local4 = Particle2D(_arg2);
var _local5:Number = (1 - ((_drag * _arg3) / _local4.mass));
if (_local5 < 0){
_local4.velX = 0;
_local4.velY = 0;
} else {
_local4.velX = (_local4.velX * _local5);
_local4.velY = (_local4.velY * _local5);
};
}
}
}//package org.flintparticles.twoD.actions
Section 396
//Move (org.flintparticles.twoD.actions.Move)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
import org.flintparticles.twoD.particles.*;
public class Move extends ActionBase {
private var p:Particle2D;
public function Move(){
priority = -10;
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
p = Particle2D(_arg2);
p.x = (p.x + (p.velX * _arg3));
p.y = (p.y + (p.velY * _arg3));
}
}
}//package org.flintparticles.twoD.actions
Section 397
//ScaleAll (org.flintparticles.twoD.actions.ScaleAll)
package org.flintparticles.twoD.actions {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.actions.*;
public class ScaleAll extends ActionBase {
private var _diffScale:Number;// = 0
private var _endScale:Number;// = 1
public function ScaleAll(_arg1:Number=1, _arg2:Number=1){
this.startScale = _arg1;
this.endScale = _arg2;
}
public function set startScale(_arg1:Number):void{
_diffScale = (_arg1 - _endScale);
}
public function set endScale(_arg1:Number):void{
_diffScale = ((_endScale + _diffScale) - _arg1);
_endScale = _arg1;
}
public function get startScale():Number{
return ((_endScale + _diffScale));
}
override public function update(_arg1:Emitter, _arg2:Particle, _arg3:Number):void{
var _local4:Number = (_endScale + (_diffScale * _arg2.energy));
var _local5:Number = (_local4 / _arg2.scale);
_arg2.scale = _local4;
_arg2.mass = (_arg2.mass * (_local5 * _local5));
_arg2.collisionRadius = (_arg2.collisionRadius * _local5);
}
public function get endScale():Number{
return (_endScale);
}
}
}//package org.flintparticles.twoD.actions
Section 398
//Emitter2D (org.flintparticles.twoD.emitters.Emitter2D)
package org.flintparticles.twoD.emitters {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.common.utils.*;
public class Emitter2D extends Emitter {
protected var _y:Number;// = 0
public var spaceSort:Boolean;// = false
public var spaceSortedX:Array;
protected var _x:Number;// = 0
protected var _rotation:Number;// = 0
protected static var _creator:ParticleCreator2D = new ParticleCreator2D();
public function Emitter2D(){
_particleFactory = _creator;
}
public function get y():Number{
return (_y);
}
override protected function initParticle(_arg1:Particle):void{
var _local2:Particle2D;
_local2 = Particle2D(_arg1);
_local2.x = _x;
_local2.y = _y;
_local2.rotation = _rotation;
}
override protected function sortParticles():void{
var _local1:int;
var _local2:int;
if (spaceSort){
spaceSortedX = _particles.sortOn("x", (Array.NUMERIC | Array.RETURNINDEXEDARRAY));
_local1 = _particles.length;
_local2 = 0;
while (_local2 < _local1) {
_particles[spaceSortedX[_local2]].sortID = _local2;
_local2++;
};
};
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function set rotRadians(_arg1:Number):void{
_rotation = _arg1;
}
public function get x():Number{
return (_x);
}
public function get rotRadians():Number{
return (_rotation);
}
public function set rotation(_arg1:Number):void{
_rotation = Maths.asRadians(_arg1);
}
public function get rotation():Number{
return (Maths.asDegrees(_rotation));
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
public static function get defaultParticleFactory():ParticleFactory{
return (_creator);
}
}
}//package org.flintparticles.twoD.emitters
Section 399
//Position (org.flintparticles.twoD.initializers.Position)
package org.flintparticles.twoD.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import org.flintparticles.twoD.particles.*;
public class Position extends InitializerBase {
private var _zone:Zone2D;
public function Position(_arg1:Zone2D=null){
this.zone = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local5:Number;
var _local6:Number;
var _local3:Particle2D = Particle2D(_arg2);
var _local4:Point = _zone.getLocation();
if (_local3.rotation == 0){
_local3.x = (_local3.x + _local4.x);
_local3.y = (_local3.y + _local4.y);
} else {
_local5 = Math.sin(_local3.rotation);
_local6 = Math.cos(_local3.rotation);
_local3.x = (_local3.x + ((_local6 * _local4.x) - (_local5 * _local4.y)));
_local3.y = (_local3.y + ((_local6 * _local4.y) + (_local5 * _local4.x)));
};
}
public function set zone(_arg1:Zone2D):void{
_zone = _arg1;
}
public function get zone():Zone2D{
return (_zone);
}
}
}//package org.flintparticles.twoD.initializers
Section 400
//Rotation (org.flintparticles.twoD.initializers.Rotation)
package org.flintparticles.twoD.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.particles.*;
public class Rotation extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function Rotation(_arg1:Number=0, _arg2:Number=NaN){
this.minAngle = _arg1;
this.maxAngle = _arg2;
}
public function get minAngle():Number{
return (_min);
}
public function set minAngle(_arg1:Number):void{
_min = _arg1;
}
public function get angle():Number{
return (((_min == _max)) ? _min : ((_max + _min) / 2));
}
public function set angle(_arg1:Number):void{
_max = (_min = _arg1);
}
public function get maxAngle():Number{
return (_max);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Particle2D = Particle2D(_arg2);
if (isNaN(_max)){
_local3.rotation = (_local3.rotation + _min);
} else {
_local3.rotation = (_local3.rotation + (_min + (Math.random() * (_max - _min))));
};
}
public function set maxAngle(_arg1:Number):void{
_max = _arg1;
}
}
}//package org.flintparticles.twoD.initializers
Section 401
//ScaleAllInit (org.flintparticles.twoD.initializers.ScaleAllInit)
package org.flintparticles.twoD.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
public class ScaleAllInit extends InitializerBase {
private var _max:Number;
private var _min:Number;
public function ScaleAllInit(_arg1:Number=1, _arg2:Number=NaN){
priority = -10;
this.minScale = _arg1;
this.maxScale = (isNaN(_arg2)) ? _arg1 : _arg2;
}
public function get scale():Number{
return (((_min == _max)) ? _min : ((_max + _min) / 2));
}
public function set maxScale(_arg1:Number):void{
_max = _arg1;
}
public function get maxScale():Number{
return (_max);
}
public function set minScale(_arg1:Number):void{
_min = _arg1;
}
public function set scale(_arg1:Number):void{
_max = (_min = _arg1);
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Number;
if (_max == _min){
_local3 = _min;
} else {
_local3 = (_min + (Math.random() * (_max - _min)));
};
_arg2.scale = _local3;
_arg2.mass = (_arg2.mass * (_local3 * _local3));
_arg2.collisionRadius = (_arg2.collisionRadius * _local3);
}
public function get minScale():Number{
return (_min);
}
}
}//package org.flintparticles.twoD.initializers
Section 402
//Velocity (org.flintparticles.twoD.initializers.Velocity)
package org.flintparticles.twoD.initializers {
import org.flintparticles.common.emitters.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.zones.*;
import flash.geom.*;
import org.flintparticles.twoD.particles.*;
public class Velocity extends InitializerBase {
private var _zone:Zone2D;
public function Velocity(_arg1:Zone2D=null){
this.zone = _arg1;
}
override public function initialize(_arg1:Emitter, _arg2:Particle):void{
var _local3:Particle2D;
var _local5:Number;
var _local6:Number;
_local3 = Particle2D(_arg2);
var _local4:Point = _zone.getLocation();
if (_local3.rotation == 0){
_local3.velX = _local4.x;
_local3.velY = _local4.y;
} else {
_local5 = Math.sin(_local3.rotation);
_local6 = Math.cos(_local3.rotation);
_local3.velX = ((_local6 * _local4.x) - (_local5 * _local4.y));
_local3.velY = ((_local6 * _local4.y) + (_local5 * _local4.x));
};
}
public function set zone(_arg1:Zone2D):void{
_zone = _arg1;
}
public function get zone():Zone2D{
return (_zone);
}
}
}//package org.flintparticles.twoD.initializers
Section 403
//Particle2D (org.flintparticles.twoD.particles.Particle2D)
package org.flintparticles.twoD.particles {
import org.flintparticles.common.particles.*;
import flash.geom.*;
public class Particle2D extends Particle {
public var sortID:int;// = -1
private var _inertia:Number;
public var velY:Number;// = 0
private var _previousRadius:Number;
private var _previousMass:Number;
public var angVelocity:Number;// = 0
public var x:Number;// = 0
public var y:Number;// = 0
public var velX:Number;// = 0
public var rotation:Number;// = 0
override public function clone(_arg1:ParticleFactory=null):Particle{
var _local2:Particle2D;
if (_arg1){
_local2 = (_arg1.createParticle() as Particle2D);
} else {
_local2 = new Particle2D();
};
cloneInto(_local2);
_local2.x = x;
_local2.y = y;
_local2.velX = velX;
_local2.velY = velY;
_local2.rotation = rotation;
_local2.angVelocity = angVelocity;
return (_local2);
}
override public function initialize():void{
super.initialize();
x = 0;
y = 0;
velX = 0;
velY = 0;
rotation = 0;
angVelocity = 0;
sortID = -1;
}
public function get matrixTransform():Matrix{
var _local1:Number = (scale * Math.cos(rotation));
var _local2:Number = (scale * Math.sin(rotation));
return (new Matrix(_local1, _local2, -(_local2), _local1, x, y));
}
public function get inertia():Number{
if (((!((mass == _previousMass))) || (!((collisionRadius == _previousRadius))))){
_inertia = (((mass * collisionRadius) * collisionRadius) * 0.5);
_previousMass = mass;
_previousRadius = collisionRadius;
};
return (_inertia);
}
}
}//package org.flintparticles.twoD.particles
Section 404
//ParticleCreator2D (org.flintparticles.twoD.particles.ParticleCreator2D)
package org.flintparticles.twoD.particles {
import org.flintparticles.common.particles.*;
public class ParticleCreator2D implements ParticleFactory {
private var _particles:Array;
public function ParticleCreator2D(){
_particles = new Array();
}
public function clearAllParticles():void{
_particles = new Array();
}
public function disposeParticle(_arg1:Particle):void{
if ((_arg1 is Particle2D)){
_arg1.initialize();
_particles.push(_arg1);
};
}
public function createParticle():Particle{
if (_particles.length){
return (_particles.pop());
};
return (new Particle2D());
}
}
}//package org.flintparticles.twoD.particles
Section 405
//BitmapRenderer (org.flintparticles.twoD.renderers.BitmapRenderer)
package org.flintparticles.twoD.renderers {
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.common.renderers.*;
public class BitmapRenderer extends SpriteRendererBase {
protected var _bitmap:Bitmap;
protected var _bitmapData:BitmapData;
protected var _smoothing:Boolean;
protected var _canvas:Rectangle;
protected var _colorMap:Array;
protected var _postFilters:Array;
protected var _preFilters:Array;
protected static var ZERO_POINT:Point = new Point(0, 0);
public function BitmapRenderer(_arg1:Rectangle, _arg2:Boolean=false){
mouseEnabled = false;
mouseChildren = false;
_smoothing = _arg2;
_preFilters = new Array();
_postFilters = new Array();
_canvas = _arg1;
createBitmap();
}
public function get bitmapData():BitmapData{
return (_bitmapData);
}
override protected function renderParticles(_arg1:Array):void{
var _local2:int;
var _local3:int;
if (!_bitmap){
return;
};
_bitmapData.lock();
_local3 = _preFilters.length;
_local2 = 0;
while (_local2 < _local3) {
_bitmapData.applyFilter(_bitmapData, _bitmapData.rect, BitmapRenderer.ZERO_POINT, _preFilters[_local2]);
_local2++;
};
if ((((_local3 == 0)) && ((_postFilters.length == 0)))){
_bitmapData.fillRect(_bitmap.bitmapData.rect, 0);
};
_local3 = _arg1.length;
if (_local3){
_local2 = _local3;
while (_local2--) {
drawParticle(_arg1[_local2]);
};
};
_local3 = _postFilters.length;
_local2 = 0;
while (_local2 < _local3) {
_bitmapData.applyFilter(_bitmapData, _bitmapData.rect, BitmapRenderer.ZERO_POINT, _postFilters[_local2]);
_local2++;
};
if (_colorMap){
_bitmapData.paletteMap(_bitmapData, _bitmapData.rect, ZERO_POINT, _colorMap[1], _colorMap[2], _colorMap[3], _colorMap[0]);
};
_bitmapData.unlock();
}
protected function createBitmap():void{
if (!_canvas){
return;
};
if (((_bitmap) && (_bitmapData))){
_bitmapData.dispose();
_bitmapData = null;
};
if (_bitmap){
removeChild(_bitmap);
_bitmap = null;
};
_bitmap = new Bitmap(null, "auto", _smoothing);
_bitmapData = new BitmapData(Math.ceil(_canvas.width), Math.ceil(_canvas.height), true, 0);
_bitmap.bitmapData = _bitmapData;
addChild(_bitmap);
_bitmap.x = _canvas.x;
_bitmap.y = _canvas.y;
}
public function set canvas(_arg1:Rectangle):void{
_canvas = _arg1;
createBitmap();
}
public function clearPaletteMap():void{
_colorMap = null;
}
public function get canvas():Rectangle{
return (_canvas);
}
public function removeFilter(_arg1:BitmapFilter):void{
var _local2:int;
while (_local2 < _preFilters.length) {
if (_preFilters[_local2] == _arg1){
_preFilters.splice(_local2, 1);
return;
};
_local2++;
};
_local2 = 0;
while (_local2 < _postFilters.length) {
if (_postFilters[_local2] == _arg1){
_postFilters.splice(_local2, 1);
return;
};
_local2++;
};
}
public function get preFilters():Array{
return (_preFilters.slice());
}
public function set smoothing(_arg1:Boolean):void{
_smoothing = _arg1;
if (_bitmap){
_bitmap.smoothing = _arg1;
};
}
public function set preFilters(_arg1:Array):void{
var _local2:BitmapFilter;
for each (_local2 in _preFilters) {
removeFilter(_local2);
};
for each (_local2 in _arg1) {
addFilter(_local2, false);
};
}
protected function drawParticle(_arg1:Particle2D):void{
var _local2:Matrix;
_local2 = _arg1.matrixTransform;
_local2.translate(-(_canvas.x), -(_canvas.y));
_bitmapData.draw(_arg1.image, _local2, _arg1.colorTransform, DisplayObject(_arg1.image).blendMode, null, _smoothing);
}
public function setPaletteMap(_arg1:Array=null, _arg2:Array=null, _arg3:Array=null, _arg4:Array=null):void{
_colorMap = new Array(4);
_colorMap[0] = _arg4;
_colorMap[1] = _arg1;
_colorMap[2] = _arg2;
_colorMap[3] = _arg3;
}
public function get smoothing():Boolean{
return (_smoothing);
}
public function set postFilters(_arg1:Array):void{
var _local2:BitmapFilter;
for each (_local2 in _postFilters) {
removeFilter(_local2);
};
for each (_local2 in _arg1) {
addFilter(_local2, true);
};
}
public function addFilter(_arg1:BitmapFilter, _arg2:Boolean=false):void{
if (_arg2){
_postFilters.push(_arg1);
} else {
_preFilters.push(_arg1);
};
}
public function get postFilters():Array{
return (_postFilters.slice());
}
}
}//package org.flintparticles.twoD.renderers
Section 406
//DisplayObjectRenderer (org.flintparticles.twoD.renderers.DisplayObjectRenderer)
package org.flintparticles.twoD.renderers {
import flash.display.*;
import org.flintparticles.common.particles.*;
import org.flintparticles.twoD.particles.*;
import org.flintparticles.common.renderers.*;
public class DisplayObjectRenderer extends SpriteRendererBase {
override protected function removeParticle(_arg1:Particle):void{
removeChild(_arg1.image);
}
override protected function addParticle(_arg1:Particle):void{
addChildAt(_arg1.image, 0);
}
override protected function renderParticles(_arg1:Array):void{
var _local2:Particle2D;
var _local3:DisplayObject;
var _local4:int = _arg1.length;
var _local5:int;
while (_local5 < _local4) {
_local2 = _arg1[_local5];
_local3 = _local2.image;
_local3.transform.colorTransform = _local2.colorTransform;
_local3.transform.matrix = _local2.matrixTransform;
_local5++;
};
}
}
}//package org.flintparticles.twoD.renderers
Section 407
//PixelRenderer (org.flintparticles.twoD.renderers.PixelRenderer)
package org.flintparticles.twoD.renderers {
import flash.geom.*;
import org.flintparticles.twoD.particles.*;
public class PixelRenderer extends BitmapRenderer {
public function PixelRenderer(_arg1:Rectangle){
super(_arg1);
}
override protected function drawParticle(_arg1:Particle2D):void{
_bitmapData.setPixel32(Math.round((_arg1.x - _canvas.x)), Math.round((_arg1.y - _canvas.y)), _arg1.color);
}
}
}//package org.flintparticles.twoD.renderers
Section 408
//DiscZone (org.flintparticles.twoD.zones.DiscZone)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public class DiscZone implements Zone2D {
private var _innerRadius:Number;
private var _innerSq:Number;
private var _outerRadius:Number;
private var _center:Point;
private var _outerSq:Number;
private static const TWOPI:Number = 6.28318530717959;
public function DiscZone(_arg1:Point=null, _arg2:Number=0, _arg3:Number=0){
if (_arg2 < _arg3){
throw (new Error((((("The outerRadius (" + _arg2) + ") can't be smaller than the innerRadius (") + _arg3) + ") in your DiscZone. N.B. the outerRadius is the second argument in the constructor and the innerRadius is the third argument.")));
};
if (_arg1 == null){
_center = new Point(0, 0);
} else {
_center = _arg1;
};
_innerRadius = _arg3;
_outerRadius = _arg2;
_innerSq = (_innerRadius * _innerRadius);
_outerSq = (_outerRadius * _outerRadius);
}
public function getArea():Number{
return ((Math.PI * (_outerSq - _innerSq)));
}
public function set centerX(_arg1:Number):void{
_center.x = _arg1;
}
public function set centerY(_arg1:Number):void{
_center.y = _arg1;
}
public function get innerRadius():Number{
return (_innerRadius);
}
public function set innerRadius(_arg1:Number):void{
_innerRadius = _arg1;
_innerSq = (_innerRadius * _innerRadius);
}
public function get center():Point{
return (_center);
}
public function set outerRadius(_arg1:Number):void{
_outerRadius = _arg1;
_outerSq = (_outerRadius * _outerRadius);
}
public function get centerX():Number{
return (_center.x);
}
public function get centerY():Number{
return (_center.y);
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
_arg1 = (_arg1 - _center.x);
_arg2 = (_arg2 - _center.y);
var _local3:Number = ((_arg1 * _arg1) + (_arg2 * _arg2));
return ((((_local3 <= _outerSq)) && ((_local3 >= _innerSq))));
}
public function getLocation():Point{
var _local1:Number = Math.random();
var _local2:Point = Point.polar((_innerRadius + ((1 - (_local1 * _local1)) * (_outerRadius - _innerRadius))), (Math.random() * TWOPI));
_local2.x = (_local2.x + _center.x);
_local2.y = (_local2.y + _center.y);
return (_local2);
}
public function get outerRadius():Number{
return (_outerRadius);
}
public function set center(_arg1:Point):void{
_center = _arg1;
}
}
}//package org.flintparticles.twoD.zones
Section 409
//Zone2D (org.flintparticles.twoD.zones.Zone2D)
package org.flintparticles.twoD.zones {
import flash.geom.*;
public interface Zone2D {
function getArea():Number;
function getLocation():Point;
function contains(_arg1:Number, _arg2:Number):Boolean;
}
}//package org.flintparticles.twoD.zones
Section 410
//idle_1_3 (Player_fla.idle_1_3)
package Player_fla {
import flash.display.*;
public dynamic class idle_1_3 extends MovieClip {
public function idle_1_3(){
addFrameScript(0, frame1, 19, frame20, 37, frame38, 55, frame56, 73, frame74);
}
function frame38(){
stop();
gotoAndStop("idle");
}
function frame1(){
stop();
}
function frame74(){
stop();
gotoAndStop("idle");
}
function frame20(){
stop();
gotoAndStop("idle");
}
function frame56(){
stop();
gotoAndStop("idle");
}
}
}//package Player_fla
Section 411
//idle_2_8 (Player_fla.idle_2_8)
package Player_fla {
import flash.display.*;
public dynamic class idle_2_8 extends MovieClip {
public function idle_2_8(){
addFrameScript(0, frame1, 19, frame20, 37, frame38, 55, frame56, 73, frame74);
}
function frame38(){
stop();
gotoAndStop("idle");
}
function frame1(){
stop();
}
function frame74(){
stop();
gotoAndStop("idle");
}
function frame20(){
stop();
gotoAndStop("idle");
}
function frame56(){
stop();
gotoAndStop("idle");
}
}
}//package Player_fla
Section 412
//idle_3_11 (Player_fla.idle_3_11)
package Player_fla {
import flash.display.*;
public dynamic class idle_3_11 extends MovieClip {
public function idle_3_11(){
addFrameScript(0, frame1, 19, frame20, 37, frame38, 55, frame56, 73, frame74);
}
function frame38(){
stop();
gotoAndStop("idle");
}
function frame1(){
stop();
}
function frame74(){
stop();
gotoAndStop("idle");
}
function frame20(){
stop();
gotoAndStop("idle");
}
function frame56(){
stop();
gotoAndStop("idle");
}
}
}//package Player_fla
Section 413
//idle_4_13 (Player_fla.idle_4_13)
package Player_fla {
import flash.display.*;
public dynamic class idle_4_13 extends MovieClip {
public function idle_4_13(){
addFrameScript(0, frame1, 19, frame20, 37, frame38, 55, frame56, 73, frame74);
}
function frame38(){
stop();
gotoAndStop("idle");
}
function frame1(){
stop();
}
function frame74(){
stop();
gotoAndStop("idle");
}
function frame20(){
stop();
gotoAndStop("idle");
}
function frame56(){
stop();
gotoAndStop("idle");
}
}
}//package Player_fla
Section 414
//idle_5_15 (Player_fla.idle_5_15)
package Player_fla {
import flash.display.*;
public dynamic class idle_5_15 extends MovieClip {
public function idle_5_15(){
addFrameScript(0, frame1, 19, frame20, 37, frame38, 55, frame56, 73, frame74);
}
function frame38(){
stop();
gotoAndStop("idle");
}
function frame1(){
stop();
}
function frame74(){
stop();
gotoAndStop("idle");
}
function frame20(){
stop();
gotoAndStop("idle");
}
function frame56(){
stop();
gotoAndStop("idle");
}
}
}//package Player_fla
Section 415
//idle_6_17 (Player_fla.idle_6_17)
package Player_fla {
import flash.display.*;
public dynamic class idle_6_17 extends MovieClip {
public function idle_6_17(){
addFrameScript(0, frame1, 19, frame20, 37, frame38, 55, frame56, 73, frame74);
}
function frame38(){
stop();
gotoAndStop("idle");
}
function frame1(){
stop();
}
function frame74(){
stop();
gotoAndStop("idle");
}
function frame20(){
stop();
gotoAndStop("idle");
}
function frame56(){
stop();
gotoAndStop("idle");
}
}
}//package Player_fla
Section 416
//big_meteor_falling (sounds.big_meteor_falling)
package sounds {
import flash.media.*;
public dynamic class big_meteor_falling extends Sound {
}
}//package sounds
Section 417
//bigMeteorExplosion (sounds.bigMeteorExplosion)
package sounds {
import flash.media.*;
public dynamic class bigMeteorExplosion extends Sound {
}
}//package sounds
Section 418
//bomb_appears (sounds.bomb_appears)
package sounds {
import flash.media.*;
public dynamic class bomb_appears extends Sound {
}
}//package sounds
Section 419
//border_lights (sounds.border_lights)
package sounds {
import flash.media.*;
public dynamic class border_lights extends Sound {
}
}//package sounds
Section 420
//bump_wall (sounds.bump_wall)
package sounds {
import flash.media.*;
public dynamic class bump_wall extends Sound {
}
}//package sounds
Section 421
//burp (sounds.burp)
package sounds {
import flash.media.*;
public dynamic class burp extends Sound {
}
}//package sounds
Section 422
//click_button (sounds.click_button)
package sounds {
import flash.media.*;
public dynamic class click_button extends Sound {
}
}//package sounds
Section 423
//danger (sounds.danger)
package sounds {
import flash.media.*;
public dynamic class danger extends Sound {
}
}//package sounds
Section 424
//enemy_appear (sounds.enemy_appear)
package sounds {
import flash.media.*;
public dynamic class enemy_appear extends Sound {
}
}//package sounds
Section 425
//enemy_appear2 (sounds.enemy_appear2)
package sounds {
import flash.media.*;
public dynamic class enemy_appear2 extends Sound {
}
}//package sounds
Section 426
//enemy_appear3 (sounds.enemy_appear3)
package sounds {
import flash.media.*;
public dynamic class enemy_appear3 extends Sound {
}
}//package sounds
Section 427
//enemy_dies (sounds.enemy_dies)
package sounds {
import flash.media.*;
public dynamic class enemy_dies extends Sound {
}
}//package sounds
Section 428
//fireworks1 (sounds.fireworks1)
package sounds {
import flash.media.*;
public dynamic class fireworks1 extends Sound {
}
}//package sounds
Section 429
//fireworks2 (sounds.fireworks2)
package sounds {
import flash.media.*;
public dynamic class fireworks2 extends Sound {
}
}//package sounds
Section 430
//fireworks3 (sounds.fireworks3)
package sounds {
import flash.media.*;
public dynamic class fireworks3 extends Sound {
}
}//package sounds
Section 431
//fireworks4 (sounds.fireworks4)
package sounds {
import flash.media.*;
public dynamic class fireworks4 extends Sound {
}
}//package sounds
Section 432
//fireworksExplode1 (sounds.fireworksExplode1)
package sounds {
import flash.media.*;
public dynamic class fireworksExplode1 extends Sound {
}
}//package sounds
Section 433
//fireworksExplode2 (sounds.fireworksExplode2)
package sounds {
import flash.media.*;
public dynamic class fireworksExplode2 extends Sound {
}
}//package sounds
Section 434
//fireworksExplode3 (sounds.fireworksExplode3)
package sounds {
import flash.media.*;
public dynamic class fireworksExplode3 extends Sound {
}
}//package sounds
Section 435
//game_over (sounds.game_over)
package sounds {
import flash.media.*;
public dynamic class game_over extends Sound {
}
}//package sounds
Section 436
//glass (sounds.glass)
package sounds {
import flash.media.*;
public dynamic class glass extends Sound {
}
}//package sounds
Section 437
//habla_dialogo (sounds.habla_dialogo)
package sounds {
import flash.media.*;
public dynamic class habla_dialogo extends Sound {
}
}//package sounds
Section 438
//habla_dialogo_bobulous (sounds.habla_dialogo_bobulous)
package sounds {
import flash.media.*;
public dynamic class habla_dialogo_bobulous extends Sound {
}
}//package sounds
Section 439
//habla_dialogo_bobulous2 (sounds.habla_dialogo_bobulous2)
package sounds {
import flash.media.*;
public dynamic class habla_dialogo_bobulous2 extends Sound {
}
}//package sounds
Section 440
//habla_dialogo_bobulous3 (sounds.habla_dialogo_bobulous3)
package sounds {
import flash.media.*;
public dynamic class habla_dialogo_bobulous3 extends Sound {
}
}//package sounds
Section 441
//habla_dialogo_bobulous4 (sounds.habla_dialogo_bobulous4)
package sounds {
import flash.media.*;
public dynamic class habla_dialogo_bobulous4 extends Sound {
}
}//package sounds
Section 442
//habla_dialogo2 (sounds.habla_dialogo2)
package sounds {
import flash.media.*;
public dynamic class habla_dialogo2 extends Sound {
}
}//package sounds
Section 443
//habla_dialogo3 (sounds.habla_dialogo3)
package sounds {
import flash.media.*;
public dynamic class habla_dialogo3 extends Sound {
}
}//package sounds
Section 444
//habla_dialogo4 (sounds.habla_dialogo4)
package sounds {
import flash.media.*;
public dynamic class habla_dialogo4 extends Sound {
}
}//package sounds
Section 445
//hit_lights (sounds.hit_lights)
package sounds {
import flash.media.*;
public dynamic class hit_lights extends Sound {
}
}//package sounds
Section 446
//meteor_explode (sounds.meteor_explode)
package sounds {
import flash.media.*;
public dynamic class meteor_explode extends Sound {
}
}//package sounds
Section 447
//meteor_explode2 (sounds.meteor_explode2)
package sounds {
import flash.media.*;
public dynamic class meteor_explode2 extends Sound {
}
}//package sounds
Section 448
//meteor_explode3 (sounds.meteor_explode3)
package sounds {
import flash.media.*;
public dynamic class meteor_explode3 extends Sound {
}
}//package sounds
Section 449
//meteor_explode4 (sounds.meteor_explode4)
package sounds {
import flash.media.*;
public dynamic class meteor_explode4 extends Sound {
}
}//package sounds
Section 450
//meteor_explode5 (sounds.meteor_explode5)
package sounds {
import flash.media.*;
public dynamic class meteor_explode5 extends Sound {
}
}//package sounds
Section 451
//meteor_explode6 (sounds.meteor_explode6)
package sounds {
import flash.media.*;
public dynamic class meteor_explode6 extends Sound {
}
}//package sounds
Section 452
//meteor_fall (sounds.meteor_fall)
package sounds {
import flash.media.*;
public dynamic class meteor_fall extends Sound {
}
}//package sounds
Section 453
//meteor_fall2 (sounds.meteor_fall2)
package sounds {
import flash.media.*;
public dynamic class meteor_fall2 extends Sound {
}
}//package sounds
Section 454
//meteor_passing (sounds.meteor_passing)
package sounds {
import flash.media.*;
public dynamic class meteor_passing extends Sound {
}
}//package sounds
Section 455
//meteorsShield (sounds.meteorsShield)
package sounds {
import flash.media.*;
public dynamic class meteorsShield extends Sound {
}
}//package sounds
Section 456
//meteorsShield2 (sounds.meteorsShield2)
package sounds {
import flash.media.*;
public dynamic class meteorsShield2 extends Sound {
}
}//package sounds
Section 457
//player_dies (sounds.player_dies)
package sounds {
import flash.media.*;
public dynamic class player_dies extends Sound {
}
}//package sounds
Section 458
//player_eats_enemy (sounds.player_eats_enemy)
package sounds {
import flash.media.*;
public dynamic class player_eats_enemy extends Sound {
}
}//package sounds
Section 459
//player_enters_screen (sounds.player_enters_screen)
package sounds {
import flash.media.*;
public dynamic class player_enters_screen extends Sound {
}
}//package sounds
Section 460
//player_evolves (sounds.player_evolves)
package sounds {
import flash.media.*;
public dynamic class player_evolves extends Sound {
}
}//package sounds
Section 461
//player_picks_up_bomb (sounds.player_picks_up_bomb)
package sounds {
import flash.media.*;
public dynamic class player_picks_up_bomb extends Sound {
}
}//package sounds
Section 462
//player_uses_bomb (sounds.player_uses_bomb)
package sounds {
import flash.media.*;
public dynamic class player_uses_bomb extends Sound {
}
}//package sounds
Section 463
//player_wins_life (sounds.player_wins_life)
package sounds {
import flash.media.*;
public dynamic class player_wins_life extends Sound {
}
}//package sounds
Section 464
//rollover (sounds.rollover)
package sounds {
import flash.media.*;
public dynamic class rollover extends Sound {
}
}//package sounds
Section 465
//spaceship_takeoff (sounds.spaceship_takeoff)
package sounds {
import flash.media.*;
public dynamic class spaceship_takeoff extends Sound {
}
}//package sounds
Section 466
//spaceship_whoosh (sounds.spaceship_whoosh)
package sounds {
import flash.media.*;
public dynamic class spaceship_whoosh extends Sound {
}
}//package sounds
Section 467
//spikes_alert (sounds.spikes_alert)
package sounds {
import flash.media.*;
public dynamic class spikes_alert extends Sound {
}
}//package sounds
Section 468
//spikes_appear (sounds.spikes_appear)
package sounds {
import flash.media.*;
public dynamic class spikes_appear extends Sound {
}
}//package sounds
Section 469
//spikes_disappear (sounds.spikes_disappear)
package sounds {
import flash.media.*;
public dynamic class spikes_disappear extends Sound {
}
}//package sounds
Section 470
//start_turbines (sounds.start_turbines)
package sounds {
import flash.media.*;
public dynamic class start_turbines extends Sound {
}
}//package sounds
Section 471
//teleport_complete (sounds.teleport_complete)
package sounds {
import flash.media.*;
public dynamic class teleport_complete extends Sound {
}
}//package sounds
Section 472
//teletransporting (sounds.teletransporting)
package sounds {
import flash.media.*;
public dynamic class teletransporting extends Sound {
}
}//package sounds
Section 473
//vortex (sounds.vortex)
package sounds {
import flash.media.*;
public dynamic class vortex extends Sound {
}
}//package sounds
Section 474
//yellow_lights_complete (sounds.yellow_lights_complete)
package sounds {
import flash.media.*;
public dynamic class yellow_lights_complete extends Sound {
}
}//package sounds
Section 475
//alphaScreen_35 (Splash_fla.alphaScreen_35)
package Splash_fla {
import flash.display.*;
public dynamic class alphaScreen_35 extends MovieClip {
public function alphaScreen_35(){
addFrameScript(0, frame1);
}
function frame1(){
cacheAsBitmap = true;
}
}
}//package Splash_fla
Section 476
//back_btn_15 (Splash_fla.back_btn_15)
package Splash_fla {
import flash.display.*;
public dynamic class back_btn_15 extends MovieClip {
public function back_btn_15(){
addFrameScript(1, frame2, 7, frame8, 13, frame14);
}
function frame14(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package Splash_fla
Section 477
//credits_btn_5 (Splash_fla.credits_btn_5)
package Splash_fla {
import flash.display.*;
public dynamic class credits_btn_5 extends MovieClip {
public var hotspot:MovieClip;
public function credits_btn_5(){
addFrameScript(1, frame2, 7, frame8, 8, frame9, 13, frame14);
}
function frame14(){
stop();
mouseEnabled = true;
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame9(){
mouseEnabled = false;
}
}
}//package Splash_fla
Section 478
//howtoplay_btn_2 (Splash_fla.howtoplay_btn_2)
package Splash_fla {
import flash.display.*;
public dynamic class howtoplay_btn_2 extends MovieClip {
public var hotspot:MovieClip;
public function howtoplay_btn_2(){
addFrameScript(1, frame2, 7, frame8, 8, frame9, 13, frame14);
}
function frame14(){
stop();
mouseEnabled = true;
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame9(){
mouseEnabled = false;
}
}
}//package Splash_fla
Section 479
//howToPlayContainer_39 (Splash_fla.howToPlayContainer_39)
package Splash_fla {
import flash.display.*;
import flash.events.*;
public dynamic class howToPlayContainer_39 extends MovieClip {
public var next_btn:SimpleButton;
public var back_btn:SimpleButton;
public function howToPlayContainer_39(){
addFrameScript(0, frame1, 42, frame43, 43, frame44);
}
function frame1(){
stop();
}
function frame43(){
dispatchEvent(new Event("animEnd"));
}
function frame44(){
stop();
}
}
}//package Splash_fla
Section 480
//new_highscore_30 (Splash_fla.new_highscore_30)
package Splash_fla {
import flash.display.*;
public dynamic class new_highscore_30 extends MovieClip {
public function new_highscore_30(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Splash_fla
Section 481
//options_btn_7 (Splash_fla.options_btn_7)
package Splash_fla {
import flash.display.*;
public dynamic class options_btn_7 extends MovieClip {
public var hotspot:MovieClip;
public function options_btn_7(){
addFrameScript(1, frame2, 7, frame8, 8, frame9, 13, frame14);
}
function frame14(){
stop();
mouseEnabled = true;
}
function frame2(){
stop();
}
function frame8(){
stop();
}
function frame9(){
mouseEnabled = false;
}
}
}//package Splash_fla
Section 482
//play_btn_9 (Splash_fla.play_btn_9)
package Splash_fla {
import flash.display.*;
public dynamic class play_btn_9 extends MovieClip {
public function play_btn_9(){
addFrameScript(1, frame2, 7, frame8, 8, frame9, 13, frame14);
}
function frame14(){
stop();
mouseEnabled = true;
}
function frame8(){
stop();
}
function frame9(){
mouseEnabled = false;
}
function frame2(){
stop();
}
}
}//package Splash_fla
Section 483
//quit_22 (Splash_fla.quit_22)
package Splash_fla {
import flash.display.*;
public dynamic class quit_22 extends MovieClip {
public function quit_22(){
addFrameScript(1, frame2, 7, frame8, 13, frame14);
}
function frame14(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package Splash_fla
Section 484
//submitscore_btn_24 (Splash_fla.submitscore_btn_24)
package Splash_fla {
import flash.display.*;
public dynamic class submitscore_btn_24 extends MovieClip {
public function submitscore_btn_24(){
addFrameScript(1, frame2, 7, frame8, 13, frame14);
}
function frame14(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package Splash_fla
Section 485
//title_bright_anim_no_player_110 (Splash_fla.title_bright_anim_no_player_110)
package Splash_fla {
import flash.display.*;
public dynamic class title_bright_anim_no_player_110 extends MovieClip {
public var player:MovieClip;
public var hotspot:MovieClip;
public function title_bright_anim_no_player_110(){
addFrameScript(1, frame2, 10, frame11);
}
function frame2(){
stop();
}
function frame11(){
stop();
}
}
}//package Splash_fla
Section 486
//tryAgain_26 (Splash_fla.tryAgain_26)
package Splash_fla {
import flash.display.*;
public dynamic class tryAgain_26 extends MovieClip {
public function tryAgain_26(){
addFrameScript(1, frame2, 7, frame8, 13, frame14);
}
function frame14(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package Splash_fla
Section 487
//txt_0_42 (Splash_fla.txt_0_42)
package Splash_fla {
import flash.display.*;
public dynamic class txt_0_42 extends MovieClip {
public function txt_0_42(){
addFrameScript(273, frame274);
}
function frame274(){
gotoAndPlay("idle");
}
}
}//package Splash_fla
Section 488
//Assets (Assets)
package {
import flash.display.*;
import framework._sound.*;
import flash.text.*;
public class Assets extends Sprite {
private static var ARIAL:Class = Assets_ARIAL;
private static var SCIENCE_PROJECT:Class = Assets_SCIENCE_PROJECT;
public function Assets(){
Font.registerFont(SCIENCE_PROJECT);
Font.registerFont(ARIAL);
SoundManager.getInstance().registerSound("gameMusic", "music.gameMusic");
SoundManager.getInstance().registerSound("splashMusic", "music.splashMusic");
SoundManager.getInstance().registerSound("border_lights_appear", "sounds.border_lights");
SoundManager.getInstance().registerSound("bump_wall", "sounds.bump_wall");
SoundManager.getInstance().registerSound("burp", "sounds.burp");
SoundManager.getInstance().registerSound("click_button", "sounds.click_button");
SoundManager.getInstance().registerSound("item_appears", "sounds.item_appears");
SoundManager.getInstance().registerSound("game_over", "sounds.game_over");
SoundManager.getInstance().registerSound("hit_lights", "sounds.hit_lights");
SoundManager.getInstance().registerSound("player_dies", "sounds.player_dies");
SoundManager.getInstance().registerSound("player_eats_enemy", "sounds.player_eats_enemy");
SoundManager.getInstance().registerSound("player_enters_screen", "sounds.player_enters_screen");
SoundManager.getInstance().registerSound("player_evolves", "sounds.player_evolves");
SoundManager.getInstance().registerSound("player_picks_up_bomb", "sounds.player_picks_up_bomb");
SoundManager.getInstance().registerSound("player_uses_bomb", "sounds.player_uses_bomb");
SoundManager.getInstance().registerSound("player_wins_life", "sounds.player_wins_life");
SoundManager.getInstance().registerSound("rollover_button", "sounds.rollover");
SoundManager.getInstance().registerSound("spikes_alert", "sounds.spikes_alert");
SoundManager.getInstance().registerSound("spikes_appear", "sounds.spikes_appear");
SoundManager.getInstance().registerSound("spikes_disappear", "sounds.spikes_disappear");
SoundManager.getInstance().registerSound("yellow_lights_complete", "sounds.yellow_lights_complete");
SoundManager.getInstance().registerSound("alarm", "music.alarm");
SoundManager.getInstance().registerSound("lastEvolution", "music.lastEvolution");
SoundManager.getInstance().registerSound("congratulations", "music.congratulations");
SoundManager.getInstance().registerSound("danger", "sounds.danger");
SoundManager.getInstance().registerSound("bigMeteorExplosion", "sounds.bigMeteorExplosion");
SoundManager.getInstance().registerSound("enemyAppear", "sounds.enemy_appear");
SoundManager.getInstance().registerSound("enemyAppear2", "sounds.enemy_appear2");
SoundManager.getInstance().registerSound("enemyAppear3", "sounds.enemy_appear3");
SoundManager.getInstance().registerSound("bombAppears", "sounds.bomb_appears");
SoundManager.getInstance().registerSound("glass", "sounds.glass");
SoundManager.getInstance().registerSound("teletransporting", "sounds.teletransporting");
SoundManager.getInstance().registerSound("spaceship_whoosh", "sounds.spaceship_whoosh");
SoundManager.getInstance().registerSound("meteor_fall", "sounds.meteor_fall");
SoundManager.getInstance().registerSound("meteor_explode1", "sounds.meteor_explode");
SoundManager.getInstance().registerSound("meteor_explode2", "sounds.meteor_explode2");
SoundManager.getInstance().registerSound("meteor_explode3", "sounds.meteor_explode3");
SoundManager.getInstance().registerSound("meteor_explode4", "sounds.meteor_explode4");
SoundManager.getInstance().registerSound("meteor_explode5", "sounds.meteor_explode5");
SoundManager.getInstance().registerSound("meteor_explode6", "sounds.meteor_explode6");
SoundManager.getInstance().registerSound("meteor_passing", "sounds.meteor_passing");
SoundManager.getInstance().registerSound("teleport_complete", "sounds.teleport_complete");
SoundManager.getInstance().registerSound("spaceship_on", "sounds.nave_enciende");
SoundManager.getInstance().registerSound("spaceship_takeoff", "sounds.spaceship_takeoff");
SoundManager.getInstance().registerSound("start_turbines", "sounds.start_turbines");
SoundManager.getInstance().registerSound("giant_meteor_falling", "sounds.big_meteor_falling");
SoundManager.getInstance().registerSound("enemy_dies", "sounds.enemy_dies");
SoundManager.getInstance().registerSound("dialog_sound1", "sounds.habla_dialogo");
SoundManager.getInstance().registerSound("dialog_sound2", "sounds.habla_dialogo2");
SoundManager.getInstance().registerSound("dialog_sound3", "sounds.habla_dialogo3");
SoundManager.getInstance().registerSound("dialog_sound4", "sounds.habla_dialogo4");
SoundManager.getInstance().registerSound("dialog_bobulous_sound1", "sounds.habla_dialogo_bobulous");
SoundManager.getInstance().registerSound("dialog_bobulous_sound2", "sounds.habla_dialogo_bobulous2");
SoundManager.getInstance().registerSound("dialog_bobulous_sound3", "sounds.habla_dialogo_bobulous3");
SoundManager.getInstance().registerSound("dialog_bobulous_sound4", "sounds.habla_dialogo_bobulous4");
SoundManager.getInstance().registerSound("fireworks1", "sounds.fireworks1");
SoundManager.getInstance().registerSound("fireworks2", "sounds.fireworks2");
SoundManager.getInstance().registerSound("fireworks3", "sounds.fireworks3");
SoundManager.getInstance().registerSound("fireworks4", "sounds.fireworks4");
SoundManager.getInstance().registerSound("fireworksExplode1", "sounds.fireworksExplode1");
SoundManager.getInstance().registerSound("fireworksExplode2", "sounds.fireworksExplode2");
SoundManager.getInstance().registerSound("fireworksExplode3", "sounds.fireworksExplode3");
SoundManager.getInstance().registerSound("vortex", "sounds.vortex");
SoundManager.getInstance().registerSound("meteorsShield", "sounds.meteorsShield");
SoundManager.getInstance().registerSound("meteorsShield2", "sounds.meteorsShield2");
}
}
}//package
Section 489
//Assets_ARIAL (Assets_ARIAL)
package {
import mx.core.*;
public class Assets_ARIAL extends FontAsset {
}
}//package
Section 490
//Assets_SCIENCE_PROJECT (Assets_SCIENCE_PROJECT)
package {
import mx.core.*;
public class Assets_SCIENCE_PROJECT extends FontAsset {
}
}//package
Section 491
//Bobulous (Bobulous)
package {
import flash.display.*;
import flash.events.*;
import framework._event.*;
import framework._flow.*;
import framework._flow._transitionMethod.*;
import framework._sound.*;
import framework._core.*;
import _game._stats.*;
import flash.geom.*;
import flash.net.*;
import _screens.*;
import _backgrounds.*;
import _game._inGameMenu.*;
import _game._gui.*;
import _screens._final.*;
public class Bobulous extends Sprite {
private var fandango:Fandango;
private var assets:Assets;
public function Bobulous(_arg1:Loader, _arg2){
assets = new Assets();
super();
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
Stats.kongAPI = _arg2;
}
private function scaleCanvas(_arg1:EventValue):void{
if ((((_arg1.value > 1)) || ((_arg1.value < 0.3)))){
return;
};
Stats.canvasScale = _arg1.value;
fandango.canvas.scaleX = _arg1.value;
fandango.canvas.scaleY = _arg1.value;
fandango.canvas.scrollRect = new Rectangle(0, 0, 600, 600);
fandango.canvas.x = (300 - ((600 * fandango.canvas.scaleX) / 2));
fandango.canvas.y = (300 - ((600 * fandango.canvas.scaleY) / 2));
}
public function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
var _local2:SharedObject = SharedObject.getLocal("Bobulous");
if (_local2.data.normal != null){
Stats.gameModeStatsArr[GameModes.NORMAL].copy(_local2.data.normal);
};
if (_local2.data.hard != null){
Stats.gameModeStatsArr[GameModes.HARD].copy(_local2.data.hard);
};
if (_local2.data.veryhard != null){
Stats.gameModeStatsArr[GameModes.VERY_HARD].copy(_local2.data.veryhard);
};
if (_local2.data.credits != null){
Stats.gameModeStatsArr[GameModes.CREDITS].copy(_local2.data.credits);
};
fandango = new Fandango(stage);
var _local3:MainMenuScreen = new MainMenuScreen();
var _local4:GameOverScreen = new GameOverScreen();
var _local5:CreditsScreen = new CreditsScreen();
var _local6:OptionsScreen = new OptionsScreen();
var _local7:TitleScreen = new TitleScreen();
var _local8:HighscoresScreen = new HighscoresScreen();
var _local9:StartGameIntroScreen = new StartGameIntroScreen();
var _local10:HowToPlayScreen = new HowToPlayScreen();
var _local11:ProxyScreen = new ProxyScreen("_game.Game", true);
var _local12:Gui = new Gui();
var _local13:InGameMenu = new InGameMenu();
var _local14:BackgroundSpace = new BackgroundSpace();
var _local15:ProxyScreen = new ProxyScreen("_screens._final.FinalScreen", true);
var _local16:ProxyScreen = new ProxyScreen("_screens._final.FinalScreenHard", true);
var _local17:ProxyScreen = new ProxyScreen("_screens._final.FinalScreenVeryHard", true);
var _local18:ProxyScreen = new ProxyScreen("_screens._final.FinalScreenCredits", true);
var _local19:RedScreen = new RedScreen();
var _local20:Dialogs = new Dialogs();
var _local21:WhiteScreen = new WhiteScreen();
var _local22:SelectModeScreen = new SelectModeScreen();
var _local23:ProxyScreen = new ProxyScreen("_screens._final.BlueEnergyContainer", true);
var _local24:CreditsInGameScreen = new CreditsInGameScreen();
var _local25:Fireworks = new Fireworks();
var _local26:HiScoresScreen = new HiScoresScreen();
var _local27:HiScoresGameoverScreen = new HiScoresGameoverScreen();
var _local28:g5glogoScreen = new g5glogoScreen();
var _local29:Transition = _local7.createTransition("BackgroundSpace", _local14, TransitionType.ADD);
_local29.addEnterMethod(new AlphaTransitionMethod(_local14.mc, 1, 0, 1));
_local29.addScreenAt = 0;
_local29 = _local7.createTransition("MainMenu", _local3, TransitionType.ADD);
_local29.addEnterMethod(new AnimationTransitionMethod(_local3.mc, "enter_from_loader"));
_local29.addScreenAt = 1;
_local29 = _local7.createTransition("g5glogo", _local28, TransitionType.ADD);
_local29.addEnterMethod(new AnimationTransitionMethod(_local28.mc, "enter"));
_local29 = _local3.createTransition("Credits", _local5);
_local29.addExitMethod(new AnimationTransitionMethod(_local3.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local5.mc, "enter"));
_local29 = _local3.createTransition("HowToPlay", _local10);
_local29.addExitMethod(new AnimationTransitionMethod(_local3.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local10.mc, "enter"));
_local29 = _local3.createTransition("SelectMode", _local22);
_local29.addExitMethod(new AnimationTransitionMethod(_local3.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local22.mc, "enter"));
_local29 = _local22.createTransition("MainMenu", _local3);
_local29.addExitMethod(new AnimationTransitionMethod(_local22.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local3.mc, "enter"));
_local29 = _local22.createTransition("StartGameIntro", _local9);
_local29.addExitMethod(new AnimationTransitionMethod(_local22.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local9.mc, "enter"));
_local29 = _local22.createTransition("SelectModeWhiteScreen", _local21);
_local29.addExitMethod(new AnimationTransitionMethod(_local22.mc, "exit"));
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.5, 0, 1));
_local29 = _local7.createTransition("remove", _local7, TransitionType.REMOVE);
_local29.addExitMethod(new AlphaTransitionMethod(_local7.mc, 0.3, 1, 0, 0.2));
_local29 = _local3.createTransition("addTitle", _local7, TransitionType.ADD);
_local29.addEnterMethod(new AlphaTransitionMethod(_local7.mc, 0.3, 0, 1, 0.2));
_local29 = _local28.createTransition("remove", _local28, TransitionType.REMOVE);
_local29.addExitMethod(new AlphaTransitionMethod(_local28.mc, 0.3, 1, 0, 0.2));
_local29 = _local3.createTransition("addg5glogo", _local28, TransitionType.ADD);
_local29.addEnterMethod(new AlphaTransitionMethod(_local28.mc, 0.3, 0, 1, 0.2));
_local29 = _local3.createTransition("Options", _local6);
_local29.addExitMethod(new AnimationTransitionMethod(_local3.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local6.mc, "enter"));
_local29 = _local3.createTransition("Highscores", _local8, TransitionType.ADD);
_local29.addEnterMethod(new AnimationTransitionMethod(_local8.mc, "enter"));
_local29 = _local5.createTransition("MainMenu", _local3);
_local29.addExitMethod(new AnimationTransitionMethod(_local5.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local3.mc, "enter"));
_local29 = _local10.createTransition("MainMenu", _local3);
_local29.addExitMethod(new AnimationTransitionMethod(_local10.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local3.mc, "enter"));
_local29 = _local6.createTransition("MainMenu", _local3);
_local29.addExitMethod(new AnimationTransitionMethod(_local6.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local3.mc, "enter"));
_local29 = _local8.createTransition("exit", _local8, TransitionType.REMOVE);
_local29.addExitMethod(new AnimationTransitionMethod(_local8.mc, "exit"));
_local29 = _local9.createTransition("Game", _local11);
_local29.addScreenAt = 1;
_local29 = _local9.createTransition("Gui", _local12, TransitionType.ADD);
_local29.addEnterMethod(new AnimationTransitionMethod(_local12.mc, "enter", null, 0.2));
_local29 = _local11.createTransition("GameOver", _local4);
_local29.addEnterMethod(new AnimationTransitionMethod(_local4.mc, "enter"));
_local29 = _local11.createTransition("RemoveGui", _local12, TransitionType.REMOVE);
_local29.addExitMethod(new AnimationTransitionMethod(_local12.mc, "exit"));
_local29 = _local11.createTransition("InGameMenu", _local13, TransitionType.ADD);
_local29.addEnterMethod(new AnimationTransitionMethod(_local13.mc, "enter"));
_local29 = _local4.createTransition("Highscores", _local8, TransitionType.ADD);
_local29.addEnterMethod(new AnimationTransitionMethod(_local8.mc, "enter"));
_local29 = _local4.createTransition("StartGameIntro", _local9);
_local29.addExitMethod(new AnimationTransitionMethod(_local4.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local9.mc, "enter"));
_local29 = _local4.createTransition("SubmitScore", _local27);
_local29.addExitMethod(new AnimationTransitionMethod(_local4.mc, "exit_submit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local27.mc, "enter"));
_local29 = _local4.createTransition("MainMenu", _local3);
_local29.addExitMethod(new AnimationTransitionMethod(_local4.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local3.mc, "enter"));
_local29 = _local4.createTransition("WhiteScreenGameOver", _local21);
_local29.addExitMethod(new AnimationTransitionMethod(_local4.mc, "exit"));
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local27.createTransition("MainMenu", _local3);
_local29.addExitMethod(new AnimationTransitionMethod(_local27.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local3.mc, "enter"));
_local29 = _local27.createTransition("WhiteScreenGameOver", _local21);
_local29.addExitMethod(new AnimationTransitionMethod(_local27.mc, "exit"));
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local27.createTransition("StartGameIntro", _local9);
_local29.addExitMethod(new AnimationTransitionMethod(_local27.mc, "exit"));
_local29.addEnterMethod(new AnimationTransitionMethod(_local9.mc, "enter"));
_local29 = _local12.createTransition("InGameMenu", _local13, TransitionType.ADD);
_local29.addEnterMethod(new AnimationTransitionMethod(_local13.mc, "enter"));
_local29 = _local13.createTransition("Resume", _local13, TransitionType.REMOVE);
_local29.addExitMethod(new AnimationTransitionMethod(_local13.mc, "exit"));
_local29 = _local13.createTransition("Quit", _local13, TransitionType.REMOVE);
_local29.addExitMethod(new AnimationTransitionMethod(_local13.mc, "exit"));
_local29 = _local11.createTransition("Final", _local15, TransitionType.ADD);
_local29.addScreenAt = 2;
_local29 = _local11.createTransition("FinalHard", _local16, TransitionType.ADD);
_local29.addScreenAt = 2;
_local29 = _local11.createTransition("FinalVeryHard", _local17, TransitionType.ADD);
_local29.addScreenAt = 2;
_local29 = _local11.createTransition("FinalCredits", _local18, TransitionType.ADD);
_local29.addScreenAt = 2;
_local11.createTransition("remove", _local11, TransitionType.REMOVE);
_local29 = _local12.createTransition("remove", _local12, TransitionType.REMOVE);
_local29.addExitMethod(new AnimationTransitionMethod(_local12.mc, "exit"));
_local15.createTransition("remove", _local15, TransitionType.REMOVE);
_local16.createTransition("remove", _local16, TransitionType.REMOVE);
_local17.createTransition("remove", _local17, TransitionType.REMOVE);
_local18.createTransition("remove", _local18, TransitionType.REMOVE);
_local29 = _local15.createTransition("HiScores", _local26);
_local29.addEnterMethod(new AnimationTransitionMethod(_local26.mc, "enter"));
_local29 = _local16.createTransition("HiScores", _local26);
_local29.addEnterMethod(new AnimationTransitionMethod(_local26.mc, "enter"));
_local29 = _local17.createTransition("HiScores", _local26);
_local29.addEnterMethod(new AnimationTransitionMethod(_local26.mc, "enter"));
_local29 = _local18.createTransition("HiScores", _local26);
_local29.addEnterMethod(new AnimationTransitionMethod(_local26.mc, "enter"));
_local29 = _local26.createTransition("WhiteScreenMainMenu", _local21);
_local29.addExitMethod(new AnimationTransitionMethod(_local26.mc, "exit"));
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local15.createTransition("WhiteScreenMainMenu", _local21);
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local16.createTransition("WhiteScreenMainMenu", _local21);
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local17.createTransition("WhiteScreenMainMenu", _local21);
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local18.createTransition("WhiteScreenMainMenu", _local21);
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local21.createTransition("MainMenu", _local3);
_local29.addExitMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 1, 0));
_local29.addEnterMethod(new AnimationTransitionMethod(_local3.mc, "enter"));
_local29 = _local15.createTransition("RedScreen", _local19, TransitionType.ADD);
_local29 = _local16.createTransition("RedScreen", _local19, TransitionType.ADD);
_local29 = _local17.createTransition("RedScreen", _local19, TransitionType.ADD);
_local29 = _local19.createTransition("remove", _local19, TransitionType.REMOVE);
_local29 = _local12.createTransition("addDialogs", _local20, TransitionType.ADD);
_local29.addScreenAt = 2;
_local11.createTransition("removeDialogs", _local20, TransitionType.REMOVE);
_local29 = _local4.createTransition("WhiteScreenMainMenu", _local21);
_local29.addExitMethod(new AnimationTransitionMethod(_local4.mc, "exit"));
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local4.createTransition("WhiteScreenStartGameIntro", _local21);
_local29.addExitMethod(new AnimationTransitionMethod(_local4.mc, "exit"));
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local27.createTransition("WhiteScreenMainMenu", _local21);
_local29.addExitMethod(new AnimationTransitionMethod(_local27.mc, "exit"));
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local27.createTransition("WhiteScreenStartGameIntro", _local21);
_local29.addExitMethod(new AnimationTransitionMethod(_local27.mc, "exit"));
_local29.addEnterMethod(new AlphaTransitionMethod(_local21.canvas, 0.3, 0, 1));
_local29 = _local21.createTransition("StartGameIntro", _local9);
_local29.addExitMethod(new AlphaTransitionMethod(_local21.canvas, 1.4, 1, 0));
_local29.addEnterMethod(new AnimationTransitionMethod(_local9.mc, "enter"));
_local29.enterOnPrevFinalized = false;
_local29 = _local11.createTransition("addBlueEnergyContainer", _local23, TransitionType.ADD);
_local29.addScreenAt = 2;
_local29 = _local17.createTransition("removeBlueEnergyContainer", _local23, TransitionType.REMOVE);
_local29 = _local11.createTransition("addCredits", _local24, TransitionType.ADD);
_local29 = _local11.createTransition("removeCredits", _local24, TransitionType.REMOVE);
Stats.gameTracker.beginGame();
fandango.addEnterMethod(new AnimationTransitionMethod(_local7.mc, "enter"));
fandango.startAt(_local7);
addChild(fandango.canvas);
var _local30:Array = ["www.flashgamelicense.com", "swftest.net46.net", "www.jonee.com.ar"];
GlobalDispatcher.addEventListener("scaleCanvas", scaleCanvas);
MochiBot.track(this, "9ad1c9e3");
}
private function sitelock(_arg1:Array):void{
var _local2:Boolean;
var _local3:Array = loaderInfo.url.split("://");
var _local4:Array = _local3[1].split("/");
var _local5:int;
while (_local5 < _arg1.length) {
if (_arg1[_local5] == _local4[0]){
_local2 = false;
};
_local5++;
};
if (_local2){
visible = false;
alpha = 0;
SoundManager.getInstance().setAllMute(true);
};
}
}
}//package
Section 492
//loaderGradient (loaderGradient)
package {
import flash.display.*;
public dynamic class loaderGradient extends MovieClip {
}
}//package
Section 493
//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 494
//movLoader (movLoader)
package {
import flash.display.*;
import flash.text.*;
public dynamic class movLoader extends Sprite {
public var movLoadingBar:MovieClip;
public var txtPercent:TextField;
}
}//package
Section 495
//movSplash (movSplash)
package {
import flash.display.*;
public dynamic class movSplash extends MovieClip {
public var play_btn:SimpleButton;
public var hand:MovieClip;
public function movSplash(){
addFrameScript(98, frame99);
}
function frame99(){
stop();
}
}
}//package
Section 496
//Preloader (Preloader)
package {
import flash.events.*;
import gs.*;
import flash.utils.*;
import flash.net.*;
import flash.display.*;
import framework._utils._loader.*;
public class Preloader extends MovieClip {
private var kongAPI;
private var background:loaderGradient;
private var kongLoader:Loader;
private var initBarScaleX:Number;// = 0
private var logoSplash:movSplash;
private var loader:LoaderEx;
private var kongLoaderCompleted:Boolean;// = false
private var loaderAsset:movLoader;
public function Preloader(){
loader = new LoaderEx();
background = new loaderGradient();
kongLoader = new Loader();
super();
stop();
loaderAsset = new movLoader();
addChild(background);
addChild(loaderAsset);
loaderAsset.x = 82.5;
loaderAsset.y = 136.5;
initBarScaleX = loaderAsset.movLoadingBar.scaleX;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
var _local1:Object = LoaderInfo(root.loaderInfo).parameters;
var _local2:String = ((_local1.kongregate_api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
var _local3:URLRequest = new URLRequest(_local2);
kongLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, kongLoadComplete);
kongLoader.load(_local3);
}
private function kongLoadComplete(_arg1:Event):void{
kongLoaderCompleted = true;
this.addChild(kongLoader);
kongAPI = kongLoader.content;
}
private function onEnterFrame(_arg1:Event):void{
var _local2:Number;
if ((((framesLoaded == totalFrames)) && (kongLoaderCompleted))){
loaderAsset.txtPercent.text = "100% loaded";
loaderAsset.movLoadingBar.scaleX = initBarScaleX;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeChild(loaderAsset);
logoSplash = new movSplash();
addChild(logoSplash);
logoSplash.x = 82.5;
logoSplash.y = 136.5;
logoSplash.play_btn.addEventListener(MouseEvent.CLICK, onPlayBtnClick);
} else {
_local2 = (loaderInfo.bytesLoaded / loaderInfo.bytesTotal);
loaderAsset.txtPercent.text = (String(int((_local2 * 100))) + "% loaded");
loaderAsset.movLoadingBar.scaleX = (_local2 * initBarScaleX);
};
}
private function init():void{
var _local2:DisplayObject;
removeChild(logoSplash);
nextFrame();
var _local1:Class = Class(getDefinitionByName("Bobulous"));
if (_local1){
_local2 = new _local1(kongLoader, kongAPI);
addChild(_local2);
};
}
private function onPlayBtnClick(_arg1:MouseEvent):void{
logoSplash.play_btn.removeEventListener(MouseEvent.CLICK, onPlayBtnClick);
TweenMax.to(logoSplash, 1, {alpha:0, onComplete:init});
TweenMax.to(background, 1, {alpha:0});
}
}
}//package
Section 497
//sndSlap (sndSlap)
package {
import flash.media.*;
public dynamic class sndSlap extends Sound {
}
}//package
Section 498
//star1Asset (star1Asset)
package {
import flash.display.*;
public dynamic class star1Asset extends MovieClip {
public function star1Asset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 499
//star2Asset (star2Asset)
package {
import flash.display.*;
public dynamic class star2Asset extends MovieClip {
public function star2Asset(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 500
//ZattikkaHiScores (ZattikkaHiScores)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.hexagonstar.util.debug.*;
import flash.external.*;
public class ZattikkaHiScores extends MovieClip {
public var btnGFTP:SimpleButton;
private var gameKey:String;
private var score:Number;
private var g5User:Object;
private var lowIsBest:Boolean;
private var fbUser:Object;
private var cxn:LocalConnection;
private var gameId:Number;
private var infoScreen:MovieClip;// = null
private var levelId:Number;
private var fbSessionKey:String;
public var movEntryScreen:MovieClip;
private var msg1:String;
private var msg2:String;
private var testMode:int;// = 0
private var g5UserExists:Boolean;
private var fbUserExists:Boolean;
public var movInfoScreen:MovieClip;
private var entryScreen:MovieClip;// = null
private var gameCode:String;
private static const TEST_MODE_OFF:int = 0;
private static const EVENT_PUBLISH_HI_SCORE_FEED_EXTERNAL:String = "PublishHiScoreFeedExternal=";
private static const EVENT_VIEW_HI_SCORE:String = "ViewHiScore=";
private static const MSG_SERVER_ERROR:String = "Could not contact server, please try again in a few minutes.";
private static const MSG_SUBMITTING_DETAILS:String = "Submitting hi-score details to the server, please wait.";
private static const EVENT_POST_TWEET:String = "PostTweet=";
private static const FB_ACTION:String = "/Facebook.action?";
private static const HS_PLATFORM_WEB:int = 0;
private static const HS_PLATFORM_FACEBOOK:int = 1;
private static const VERSION_NUM:String = "1.0.10 (AS3)";
private static const HS_ACTION:String = "/HiScore.action?";
private static const TEST_MODE_FB:int = 2;
private static const EVENT_PUBLISH_HI_SCORE_FEED:String = "PublishHiScoreFeed=";
private static const EVENT_SUBMIT_HI_SCORE:String = "SubmitHiScore=";
private static const TW_ACTION:String = "/Twitter.action?";
private static const MSG_PLEASE_ENTER_NICKNAME:String = "Please enter your nickname.";
private static const TEST_MODE_G5:int = 1;
private static var SERVER_URL:String = "http://api.zattikka.com";
private static var GFTP_URL:String = "http://www.gamesfortheplanet.com";
public function ZattikkaHiScores(){
debug((("[ZattikkaHiScores VERSION " + VERSION_NUM) + "]"));
this.visible = false;
}
public function setDetails(_arg1:Number, _arg2:Number, _arg3:String, _arg4:String, _arg5:Boolean, _arg6:Number, _arg7:String, _arg8:String, _arg9:String=""):void{
var gameId = _arg1;
var levelId = _arg2;
var gameCode = _arg3;
var gameKey = _arg4;
var lowIsBest = _arg5;
var score = _arg6;
var msg1 = _arg7;
var msg2 = _arg8;
var svrUrl = _arg9;
debug(((((((((("[ZattikkaHiScores::setDetails] gameId = " + gameId) + ", levelId = ") + levelId) + ", gameCode = ") + gameCode) + ", lowIsBest = ") + lowIsBest) + ", score = ") + score));
var params:Object = LoaderInfo(this.root.loaderInfo).parameters;
var fvSvrUrl:Object = params["svrUrl"];
if (((!((fvSvrUrl == null))) && ((fvSvrUrl.length > 0)))){
SERVER_URL = String(fvSvrUrl);
} else {
if (((!((svrUrl == null))) && ((svrUrl.length > 0)))){
SERVER_URL = svrUrl;
};
};
debug(("[ZattikkaHiScores::setDetails] SERVER_URL = " + SERVER_URL));
entryScreen = this["movEntryScreen"];
infoScreen = this["movInfoScreen"];
entryScreen.visible = false;
infoScreen.visible = false;
this.gameId = gameId;
this.levelId = levelId;
this.gameCode = gameCode;
this.gameKey = gameKey;
this.lowIsBest = lowIsBest;
this.score = score;
this.msg1 = msg1;
this.msg2 = msg2;
try {
grabG5User();
if (!g5UserExists){
grabFacebookUser();
};
} catch(err:Error) {
};
this["btnGFTP"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnSubmit"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnTwitter"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
entryScreen["btnFacebook"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnView"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
infoScreen["btnBack"].addEventListener(MouseEvent.MOUSE_DOWN, onButtonPress);
if (fbUserExists){
btn_submitScore();
} else {
showEntryScreen();
};
this.visible = true;
}
private function facebookFeed():void{
var _local1:URLVariables = new URLVariables();
_local1.gameId = this.gameId;
_local1.levelId = this.levelId;
_local1.score = this.score;
_local1.sessionKey = this.fbSessionKey;
_local1.returnMessage = true;
hitServer(FB_ACTION, EVENT_PUBLISH_HI_SCORE_FEED, _local1);
}
private function grabG5User():void{
this.g5User = ExternalInterface.call("getG5User");
this.g5UserExists = ((g5User == null)) ? false : !(isNaN(this.g5User[0]));
if (testMode == TEST_MODE_G5){
this.g5User = new Array("9", "RocketRonz");
this.g5UserExists = ((g5User == null)) ? false : !(isNaN(this.g5User[0]));
};
debug(("[ZattikkaHiScores::grabG5User] " + (g5UserExists) ? ((("userId = " + this.g5User[0]) + ", userName = ") + this.g5User[1]) : "g5User is empty"));
}
public function setFBUser(_arg1:String, _arg2:String):void{
debug(((("[ZattikkaHiScores::setFBUser] fbUserId = " + _arg1) + ", fbSessionKey = ") + _arg2));
this.fbUser = new Array(_arg1, "");
this.fbUserExists = true;
this.fbSessionKey = _arg2;
cxn.close();
facebookFeed();
}
public function loadHandler(_arg1:String, _arg2:Boolean, _arg3:Event):void{
var response:URLLoader;
var xml:XML;
var resCode:int;
var stripesEvent = _arg1;
var success = _arg2;
var event = _arg3;
debug(((((("[ZattikkaHiScores::loadHandler] stripesEvent = " + stripesEvent) + ", success = ") + success) + ", event = ") + event.toString()));
if (!success){
showInfoMessage(MSG_SERVER_ERROR, true);
} else {
response = URLLoader(event.target);
xml = new XML(response.data);
resCode = xml.@code;
switch (stripesEvent){
case EVENT_SUBMIT_HI_SCORE:
showInfoMessage(xml.@msg, (resCode == -1));
if (((fbUserExists) && ((((resCode == 1)) || ((resCode == 2)))))){
try {
ExternalInterface.call("refreshFBHiScores", this.score, this.levelId);
ExternalInterface.call("streamPublish_FBConnect", this.msg1, this.levelId);
} catch(err:Error) {
};
};
break;
case EVENT_PUBLISH_HI_SCORE_FEED:
submitScore();
break;
};
};
}
private function grabFacebookUser():void{
this.fbUser = ExternalInterface.call("getFBUser");
this.fbUserExists = ((fbUser == null)) ? false : !(isNaN(this.fbUser[0]));
this.fbSessionKey = ExternalInterface.call("getFBSessionKey");
if (testMode == TEST_MODE_FB){
this.fbUser = new Array("1383775213", "Dolphin Gimme-Five");
this.fbUserExists = ((fbUser == null)) ? false : !(isNaN(this.fbUser[0]));
this.fbSessionKey = "ad4dff81c4d2467efc456072-1383775213";
};
debug(("[ZattikkaHiScores::grabFacebookUser] " + (fbUserExists) ? ((((("userId = " + this.fbUser[0]) + ", userName = ") + this.fbUser[1]) + ", sessionKey = ") + this.fbSessionKey) : "fbUser is empty"));
}
private function hitServer(_arg1:String, _arg2:String, _arg3:URLVariables):void{
var stripesAction = _arg1;
var stripesEvent = _arg2;
var vars = _arg3;
debug(((("[ZattikkaHiScores::hitServer] url = " + SERVER_URL) + stripesAction) + stripesEvent));
var request:URLRequest = new URLRequest(((SERVER_URL + stripesAction) + stripesEvent));
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
request.data = vars;
request.method = URLRequestMethod.POST;
request.requestHeaders = new Array(new URLRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"));
loader.addEventListener(Event.COMPLETE, function (_arg1:Event):void{
loadHandler(stripesEvent, true, _arg1);
});
loader.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:Event):void{
loadHandler(stripesEvent, false, _arg1);
});
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (_arg1:Event):void{
loadHandler(stripesEvent, false, _arg1);
});
loader.load(request);
}
public function showInfoMessage(_arg1:String, _arg2:Boolean):void{
infoScreen["txtInfo"].text = _arg1;
infoScreen["btnBack"].visible = _arg2;
infoScreen["btnView"].visible = ((!(_arg2)) && (!(fbUserExists)));
infoScreen.visible = true;
entryScreen.visible = false;
}
private function twitterTweet():void{
var _local1:String = ((SERVER_URL + TW_ACTION) + EVENT_POST_TWEET);
_local1 = (_local1 + ("&gameId=" + this.gameId));
_local1 = (_local1 + ("&levelId=" + this.levelId));
_local1 = (_local1 + ("&score=" + this.score));
navigateToURL(new URLRequest(_local1), "_blank");
submitScore();
}
private function getRandom(_arg1:Number, _arg2:Number):Number{
return ((Math.floor((Math.random() * ((_arg2 - _arg1) + 1))) + _arg1));
}
private function showEntryScreen():void{
entryScreen["txtMsg1"].text = msg1;
entryScreen["txtMsg2"].text = msg2;
entryScreen["movNameAuto"].visible = ((g5UserExists) || (fbUserExists));
entryScreen["movNameManual"].visible = ((!(g5UserExists)) && (!(fbUserExists)));
entryScreen["movNameAuto"]["txtName"].text = (g5UserExists) ? this.g5User[1] : (fbUserExists) ? this.fbUser[1] : "";
entryScreen["movNameManual"]["txtName"].text = "";
entryScreen.visible = true;
infoScreen.visible = false;
}
private function getRandomString(_arg1:int):String{
var _local2 = "";
var _local3:int;
while (_local3 < _arg1) {
_local2 = (_local2 + String.fromCharCode(getRandom(48, 122)));
_local3++;
};
return (_local2);
}
private function replaceAll(_arg1:String, _arg2:String, _arg3:String):String{
var _local4 = "";
var _local5:int;
while (_local5 < _arg1.length) {
if (_arg1.charAt(_local5) == _arg2){
_local4 = (_local4 + _arg3);
} else {
_local4 = (_local4 + _arg1.charAt(_local5));
};
_local5++;
};
return (_local4);
}
public function onButtonPress(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "btnGFTP":
navigateToURL(new URLRequest(GFTP_URL), "_blank");
break;
case "btnSubmit":
btn_submitScore();
break;
case "btnTwitter":
if (((((!(this.g5UserExists)) && (!(this.fbUserExists)))) && ((entryScreen["movNameManual"]["txtName"].text.length == 0)))){
showInfoMessage(MSG_PLEASE_ENTER_NICKNAME, true);
} else {
twitterTweet();
};
break;
case "btnFacebook":
if (this.fbUserExists){
facebookFeed();
} else {
facebookFeedExternal();
};
break;
case "btnView":
viewScore();
break;
case "btnBack":
setDetails(this.gameId, this.levelId, this.gameCode, this.gameKey, this.lowIsBest, this.score, this.msg1, this.msg2);
break;
};
}
private function debug(_arg1:String):void{
trace(_arg1);
Debug.trace(_arg1);
}
private function submitScore():void{
showInfoMessage(MSG_SUBMITTING_DETAILS, false);
infoScreen.visible = true;
entryScreen.visible = false;
var _local1:int = (fbUserExists) ? HS_PLATFORM_FACEBOOK : HS_PLATFORM_WEB;
var _local2 = "";
var _local3 = "";
if (fbUserExists){
_local3 = this.fbUser[0];
_local2 = this.fbUser[1];
} else {
if (g5UserExists){
_local3 = this.g5User[0];
_local2 = this.g5User[1];
} else {
_local2 = entryScreen["movNameManual"]["txtName"].text;
};
};
var _local4:String = String(new Date().getTime());
var _local5:String = _local4.split("").reverse().join("");
var _local6:String = xor(_local5, this.gameKey, false);
var _local7 = "";
_local7 = (_local7 + (this.gameId + ","));
_local7 = (_local7 + (this.levelId + ","));
_local7 = (_local7 + (_local1 + ","));
_local7 = (_local7 + (this.score + ","));
_local7 = (_local7 + (_local3 + ","));
_local7 = (_local7 + (replaceAll(_local2, ",", "") + ","));
_local7 = (_local7 + ",");
_local7 = (_local7 + lowIsBest);
var _local8:String = xor(_local7, _local6, false);
debug(((("key [" + _local6.length) + "] = ") + _local6));
debug(((("plain [" + _local7.length) + "] = ") + _local7));
debug(((("cipher [" + _local8.length) + "] = ") + _local8));
_local8 = ((getRandomString(5) + _local8) + getRandomString(5));
var _local9:URLVariables = new URLVariables();
_local9.gameId = this.gameId;
_local9.platformId = _local1;
_local9.time = _local4;
_local9.data = _local8;
_local9.returnMessage = true;
if (fbUserExists){
_local9.fbSessionKey = this.fbSessionKey;
};
hitServer(HS_ACTION, EVENT_SUBMIT_HI_SCORE, _local9);
}
private function xor(_arg1:String, _arg2:String, _arg3:Boolean):String{
var _local7:int;
var _local4 = "";
var _local5:int;
var _local6:int;
while (_local5 < _arg1.length) {
if (_local6 >= _arg2.length){
_local6 = 0;
};
_local7 = ((_arg1.charCodeAt(_local5) ^ _arg2.charCodeAt(_local6)) + 1);
if (_arg3){
debug(((("charCode = " + _local7) + " = ") + String.fromCharCode(_local7)));
};
_local4 = (_local4 + String.fromCharCode(_local7));
_local5++;
_local6++;
};
return (_local4);
}
public function viewScore():void{
var _local1:String = ((SERVER_URL + HS_ACTION) + EVENT_VIEW_HI_SCORE);
_local1 = (_local1 + ("&gameId=" + this.gameId));
_local1 = (_local1 + ("&levelId=" + this.levelId));
_local1 = (_local1 + ("&platformId=" + HS_PLATFORM_WEB));
_local1 = (_local1 + ("&gameCode=" + this.gameCode));
if (this.g5UserExists){
_local1 = (_local1 + ("&userId=" + this.g5User[0]));
} else {
_local1 = (_local1 + ("&name=" + entryScreen["movNameManual"]["txtName"].text));
};
navigateToURL(new URLRequest(_local1), "_blank");
}
private function facebookFeedExternal():void{
navigateToURL(new URLRequest(((SERVER_URL + FB_ACTION) + EVENT_PUBLISH_HI_SCORE_FEED_EXTERNAL)), "_blank");
try {
cxn = new LocalConnection();
cxn.allowDomain("*");
cxn.client = this;
cxn.connect("_cxnZattikkaHS");
} catch(err:Error) {
};
}
private function btn_submitScore():void{
if (((((!(this.g5UserExists)) && (!(this.fbUserExists)))) && ((entryScreen["movNameManual"]["txtName"].text.length == 0)))){
showInfoMessage(MSG_PLEASE_ENTER_NICKNAME, true);
} else {
submitScore();
};
}
}
}//package