Section 1
//mp3 (bonusLife.mp3)
package bonusLife {
import flash.media.*;
public dynamic class mp3 extends Sound {
}
}//package bonusLife
Section 2
//wav (BossLaser1.wav)
package BossLaser1 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package BossLaser1
Section 3
//wav (Coll1.wav)
package Coll1 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package Coll1
Section 4
//BitmapLayer (dgparticles.BitmapLayer)
package dgparticles {
import flash.display.*;
import flash.geom.*;
public class BitmapLayer extends Bitmap {
public var refreshY1;
public var refreshX1;
public var refreshX2;
public var refreshY2:Number;
public var bgColor:uint;
var refreshRect:Rectangle;
public function BitmapLayer(_arg1, _arg2:int, _arg3:uint=0, _arg4:String="auto", _arg5:Boolean=false){
refreshRect = new Rectangle();
super(new BitmapData(_arg1, _arg2, true, _arg3), _arg4, _arg5);
bgColor = _arg3;
}
public function get bounds():Rectangle{
return (bitmapData.rect);
}
public function clear():void{
if ((((refreshX2 == 0)) || ((refreshY2 == 0)))){
return;
};
refreshRect.x = refreshX1;
refreshRect.y = refreshY1;
refreshRect.width = (refreshX2 - refreshX1);
refreshRect.height = (refreshY2 - refreshY1);
bitmapData.fillRect(refreshRect, bgColor);
}
}
}//package dgparticles
Section 5
//Color4 (dgparticles.Color4)
package dgparticles {
public class Color4 {
public var a;
public var g;
public var r;
public var b:int;
public function Color4(_arg1, _arg2, _arg3, _arg4:int){
this.a = _arg1;
this.r = _arg2;
this.g = _arg3;
this.b = _arg4;
}
public function toHex():uint{
return (Color4.ARGBToHex(a, r, g, b));
}
public function toString():String{
return (((((((("a = " + a) + "; r = ") + r) + "; g = ") + g) + "; b = ") + b));
}
public function clone():Color4{
return (new Color4(a, r, g, b));
}
public static function HexToARGB(_arg1:uint):Color4{
var _local2:uint = ((_arg1 >> 24) & 0xFF);
var _local3:uint = ((_arg1 >> 16) & 0xFF);
var _local4:uint = ((_arg1 >> 8) & 0xFF);
var _local5:uint = (_arg1 & 0xFF);
return (new Color4(_local2, _local3, _local4, _local5));
}
public static function RGBToHex(_arg1, _arg2, _arg3:uint):uint{
return ((((_arg1 << 16) | (_arg2 << 8)) | _arg3));
}
public static function ARGBToHex(_arg1, _arg2, _arg3, _arg4:uint):uint{
return (((((_arg1 << 24) | (_arg2 << 16)) | (_arg3 << 8)) | _arg4));
}
public static function substructColors(_arg1, _arg2:Color4):Color4{
var _local3:int = (_arg1.a - _arg2.a);
var _local4:int = (_arg1.r - _arg2.r);
var _local5:int = (_arg1.g - _arg2.g);
var _local6:int = (_arg1.b - _arg2.b);
return (new Color4(_local3, _local4, _local5, _local6));
}
}
}//package dgparticles
Section 6
//Emitter (dgparticles.Emitter)
package dgparticles {
import flash.geom.*;
public class Emitter {
private var newParticlesCount:Number;// = 0
public var settings:EmitterSettings;
public var deltaMove:Point;
private var pos:Point;
private var particleSystem:ParticleSystem;
private var timeSinceStart:Number;// = 0
private var lastPos:Point;
public function Emitter(_arg1:ParticleSystem){
deltaMove = new Point();
super();
this.particleSystem = _arg1;
}
private function emitParticle():void{
var _local1:Particle = particleSystem.createParticle();
settings.initParticle(_local1);
_local1.initialize(position, this);
}
public function get position():Point{
return (pos);
}
public function set position(_arg1:Point):void{
pos = _arg1;
if (((settings.moveWithEmmiter) && ((lastPos == null)))){
lastPos = new Point(_arg1.x, _arg1.y);
};
}
public function update(_arg1:Number):Boolean{
var _local2:int;
var _local3:int;
if (((settings.moveWithEmmiter) && ((timeSinceStart > 0)))){
deltaMove.x = (lastPos.x - pos.x);
deltaMove.y = (lastPos.y - pos.y);
lastPos.x = pos.x;
lastPos.y = pos.y;
};
timeSinceStart = (timeSinceStart + _arg1);
if (timeSinceStart >= settings.lifeTime){
return (true);
};
newParticlesCount = (newParticlesCount + ((settings.emissionRate / 1000) * _arg1));
if (newParticlesCount >= 1){
_local2 = Math.floor(newParticlesCount);
newParticlesCount = (newParticlesCount - _local2);
_local3 = 0;
while (_local3 < _local2) {
if (particleSystem.parcticlesCount >= particleSystem.capacity){
break;
};
emitParticle();
_local3++;
};
};
return (false);
}
}
}//package dgparticles
Section 7
//EmitterSettings (dgparticles.EmitterSettings)
package dgparticles {
import flash.display.*;
import flash.utils.*;
public class EmitterSettings {
public var maxAcceleration:Number;
public var emissionRate:Number;
public var endScaleX:Number;
public var maxTangAcceleration:Number;
public var name:String;
public var endScaleY:Number;
public var minParticleLife;
private var particleBitmapData:BitmapData;
public var startColor;
public var blendMode:String;// = "add"
public var maxParticleLife:Number;
public var minSpin;
public var moveWithEmmiter:Boolean;// = false
public var midScaleX;
public var midScaleY;
public var capacity:Number;
public var minGravityY;
public var maxSpin:Number;
public var endColor:Color4;
public var minVelocity;
public var startScaleX;
public var startScaleY;
public var angle:Number;
public var maxGravityY:Number;
public var maxVelocity:Number;
public var lifeTime:Number;// = 100000000
public var minAcceleration;
private var imgName:String;
public var minTangAcceleration;
public var midColor;
public var direction:Number;
public function get imageName():String{
return (imgName);
}
public function loadFromObject(_arg1:Object):void{
var _local2:String;
for (_local2 in _arg1) {
if ((((((_local2 == "startColor")) || ((_local2 == "midColor")))) || ((_local2 == "endColor")))){
this[_local2] = Color4.HexToARGB(_arg1[_local2]);
} else {
this[_local2] = _arg1[_local2];
};
};
}
public function set imageName(_arg1:String):void{
imgName = _arg1;
var _local2:Class = (getDefinitionByName(_arg1) as Class);
particleBitmapData = new _local2(30, 30);
}
public function initParticle(_arg1:Particle):void{
_arg1.lifeTime = Utils.randomNumber(minParticleLife, maxParticleLife);
_arg1.spin = Utils.randomNumber(minSpin, maxSpin);
_arg1.gravityY = Utils.randomNumber(minGravityY, maxGravityY);
_arg1.acceleration = Utils.randomNumber(minAcceleration, maxAcceleration);
_arg1.tangAcceleration = Utils.randomNumber(minTangAcceleration, maxTangAcceleration);
_arg1.startColor = startColor;
_arg1.midColor = midColor;
_arg1.endColor = endColor;
_arg1.startScaleX = startScaleX;
_arg1.startScaleY = startScaleY;
_arg1.midScaleX = midScaleX;
_arg1.midScaleY = midScaleY;
_arg1.endScaleX = endScaleX;
_arg1.endScaleY = endScaleY;
_arg1.bitmapData = particleBitmapData;
var _local2:Number = (direction + Utils.randomNumber((-(angle) / 2), (angle / 2)));
_local2 = (_local2 * Utils.DegToRad);
var _local3:Number = Utils.randomNumber(minVelocity, maxVelocity);
_arg1.velocity.x = (Math.sin(_local2) * _local3);
_arg1.velocity.y = (Math.cos(_local2) * _local3);
}
public function clone():EmitterSettings{
var _local1:EmitterSettings = new EmitterSettings();
_local1.name = name;
_local1.capacity = capacity;
_local1.direction = direction;
_local1.angle = angle;
_local1.emissionRate = emissionRate;
_local1.blendMode = blendMode;
_local1.lifeTime = lifeTime;
_local1.imageName = imgName;
_local1.minAcceleration = minAcceleration;
_local1.maxAcceleration = maxAcceleration;
_local1.minGravityY = minGravityY;
_local1.maxGravityY = maxGravityY;
_local1.minParticleLife = minParticleLife;
_local1.maxParticleLife = maxParticleLife;
_local1.minVelocity = minVelocity;
_local1.maxVelocity = maxVelocity;
_local1.minTangAcceleration = minTangAcceleration;
_local1.maxTangAcceleration = maxTangAcceleration;
_local1.minSpin = minSpin;
_local1.maxSpin = maxSpin;
_local1.startColor = startColor.clone();
_local1.midColor = midColor.clone();
_local1.endColor = endColor.clone();
_local1.startScaleX = startScaleX;
_local1.startScaleY = startScaleY;
_local1.midScaleX = midScaleX;
_local1.midScaleY = midScaleY;
_local1.endScaleX = endScaleX;
_local1.endScaleY = endScaleY;
return (_local1);
}
public function toString():String{
var _local1 = "{ ";
_local1 = (_local1 + (("name: \"" + name) + "\""));
_local1 = (_local1 + (", emissionRate: " + emissionRate));
_local1 = (_local1 + (", capacity: " + capacity));
_local1 = (_local1 + (", lifeTime: " + lifeTime));
_local1 = (_local1 + (", angle: " + angle));
_local1 = (_local1 + (", direction: " + direction));
_local1 = (_local1 + ((", imageName: \"" + imgName) + "\""));
_local1 = (_local1 + ((", blendMode: \"" + blendMode) + "\""));
_local1 = (_local1 + (", minParticleLife: " + minParticleLife));
_local1 = (_local1 + (", maxParticleLife: " + maxParticleLife));
_local1 = (_local1 + (", minSpin: " + minSpin));
_local1 = (_local1 + (", maxSpin: " + maxSpin));
_local1 = (_local1 + (", minVelocity: " + minVelocity));
_local1 = (_local1 + (", maxVelocity: " + maxVelocity));
_local1 = (_local1 + (", minGravityY: " + minGravityY));
_local1 = (_local1 + (", maxGravityY: " + maxGravityY));
_local1 = (_local1 + (", minAcceleration: " + minAcceleration));
_local1 = (_local1 + (", maxAcceleration: " + maxAcceleration));
_local1 = (_local1 + (", minTangAcceleration: " + minTangAcceleration));
_local1 = (_local1 + (", maxTangAcceleration: " + maxTangAcceleration));
_local1 = (_local1 + (", startScaleX: " + startScaleX));
_local1 = (_local1 + (", startScaleY: " + startScaleY));
_local1 = (_local1 + (", midScaleX: " + midScaleX));
_local1 = (_local1 + (", midScaleY: " + midScaleY));
_local1 = (_local1 + (", endScaleX: " + endScaleX));
_local1 = (_local1 + (", endScaleY: " + endScaleY));
_local1 = (_local1 + (", startColor: " + startColor.toHex()));
_local1 = (_local1 + (", midColor: " + midColor.toHex()));
_local1 = (_local1 + (", endColor: " + endColor.toHex()));
_local1 = (_local1 + " }");
return (_local1);
}
}
}//package dgparticles
Section 8
//Particle (dgparticles.Particle)
package dgparticles {
import flash.display.*;
import flash.geom.*;
import fl.motion.*;
public class Particle {
public var acceleration:int;
public var tangAcceleration:int;
public var endScaleX:Number;
public var endScaleY:Number;
var accelVec:Point;
public var startColor;
public var position:Point;
public var bounds:Rectangle;
public var midScaleX;
public var midScaleY;
private var colorAlpha:Number;
private var halfLifeTime:Number;
public var destRect:Rectangle;
private var matrix:Matrix;
public var spin:int;
private var dColorB:Number;
public var endColor:Color4;
private var centerPoint:Point;
public var gravityY:int;
private var scaleX:Number;
private var dColorG;
public var startScaleX;
public var startScaleY;
private var dScaleY:Number;
private var scaleY:Number;
private var colorTransform:ColorTransform;
private var dColorA;
public var velocity:Point;
var accelVec2:Point;
private var dScaleX:Number;
private var dColorR;
public var lifeTime:Number;
public var emitter:Emitter;
public var bitmapData:BitmapData;
public var midColor;
public var timeSinceStart:uint;
private var afterMiddleTime:Boolean;
public function Particle(){
velocity = new Point();
bounds = new Rectangle();
matrix = new Matrix();
colorTransform = new ColorTransform(0, 0, 0, 1);
centerPoint = new Point();
destRect = new Rectangle();
accelVec = new Point();
accelVec2 = new Point();
super();
}
public function initialize(_arg1:Point, _arg2:Emitter):void{
position = _arg1.clone();
this.emitter = _arg2;
centerPoint.x = (bitmapData.width / 2);
centerPoint.y = (bitmapData.height / 2);
timeSinceStart = 0;
halfLifeTime = (lifeTime / 2);
afterMiddleTime = false;
calcDeltaParameters();
scaleX = startScaleX;
scaleY = startScaleY;
colorAlpha = startColor.a;
colorTransform.redOffset = startColor.r;
colorTransform.greenOffset = startColor.g;
colorTransform.blueOffset = startColor.b;
}
private function calcDeltaParameters():void{
dScaleX = (afterMiddleTime) ? (endScaleX - midScaleX) : (midScaleX - startScaleX);
dScaleY = (afterMiddleTime) ? (endScaleY - midScaleY) : (midScaleY - startScaleY);
dScaleX = (dScaleX / halfLifeTime);
dScaleY = (dScaleY / halfLifeTime);
var _local1:Color4 = (afterMiddleTime) ? Color4.substructColors(endColor, midColor) : Color4.substructColors(midColor, startColor);
dColorA = (_local1.a / halfLifeTime);
dColorR = (_local1.r / halfLifeTime);
dColorG = (_local1.g / halfLifeTime);
dColorB = (_local1.b / halfLifeTime);
}
public function draw(_arg1:BitmapData):void{
if (spin != 0){
_arg1.draw(bitmapData, matrix, colorTransform, emitter.settings.blendMode, null, true);
} else {
_arg1.draw(bitmapData, matrix, colorTransform, emitter.settings.blendMode, destRect, true);
};
}
public function update(_arg1:Number):Boolean{
timeSinceStart = (timeSinceStart + _arg1);
if (timeSinceStart > lifeTime){
return (true);
};
if (emitter.settings.moveWithEmmiter){
position.x = (position.x - emitter.deltaMove.x);
position.y = (position.y - emitter.deltaMove.y);
};
if (((!(afterMiddleTime)) && ((timeSinceStart >= halfLifeTime)))){
afterMiddleTime = true;
calcDeltaParameters();
};
var _local2:Number = (_arg1 / 1000);
accelVec.x = (position.x - emitter.position.x);
accelVec.y = (position.y - emitter.position.y);
accelVec.normalize(1);
accelVec2.x = -(accelVec.y);
accelVec2.y = accelVec.x;
accelVec.x = (accelVec.x * acceleration);
accelVec.y = (accelVec.y * acceleration);
accelVec2.x = (accelVec2.x * tangAcceleration);
accelVec2.y = (accelVec2.y * tangAcceleration);
velocity.x = (velocity.x + ((accelVec.x + accelVec2.x) * _local2));
velocity.y = (velocity.y + (((accelVec.y + accelVec2.y) + gravityY) * _local2));
position.x = (position.x + (velocity.x * _local2));
position.y = (position.y + (velocity.y * _local2));
scaleX = (scaleX + (dScaleX * _arg1));
scaleY = (scaleY + (dScaleY * _arg1));
matrix.identity();
matrix.scale(scaleX, scaleY);
matrix.translate((position.x - (centerPoint.x * scaleX)), (position.y - (centerPoint.y * scaleY)));
bounds.x = matrix.tx;
bounds.y = matrix.ty;
bounds.width = (bitmapData.width * scaleX);
bounds.height = (bitmapData.height * scaleY);
MatrixTransformer.rotateAroundInternalPoint(matrix, centerPoint.x, centerPoint.y, ((spin * timeSinceStart) / 1000));
colorAlpha = (colorAlpha + (dColorA * _arg1));
colorTransform.alphaMultiplier = (colorAlpha / 0xFF);
colorTransform.redOffset = (colorTransform.redOffset + (dColorR * _arg1));
colorTransform.greenOffset = (colorTransform.greenOffset + (dColorG * _arg1));
colorTransform.blueOffset = (colorTransform.blueOffset + (dColorB * _arg1));
destRect.x = (bounds.x + 1);
destRect.y = (bounds.y + 1);
destRect.width = (bounds.width - 2);
destRect.height = (bounds.height - 2);
return (false);
}
}
}//package dgparticles
Section 9
//ParticleSystem (dgparticles.ParticleSystem)
package dgparticles {
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
public class ParticleSystem {
private var lastTime:int;
private var emitters:Array;
private var activeParticles:Array;
public var enabled:Boolean;// = true
public var capacity:int;// = 1000
private var freeParticles:Array;
private var bitmapLayer:BitmapLayer;
private var emSettings:Array;
public function ParticleSystem(_arg1:BitmapLayer){
freeParticles = new Array();
activeParticles = new Array();
emitters = new Array();
emSettings = new Array();
lastTime = getTimer();
super();
this.bitmapLayer = _arg1;
_arg1.addEventListener(Event.ENTER_FRAME, updateAndDraw);
}
public function createEmmiter(_arg1:String, _arg2:Point):Emitter{
var _local3:Emitter = new Emitter(this);
_local3.settings = getSettingsByName(_arg1).clone();
_local3.position = _arg2;
emitters.push(_local3);
return (_local3);
}
private function draw():void{
bitmapLayer.clear();
var _local1:int;
while (_local1 < activeParticles.length) {
activeParticles[_local1].draw(bitmapLayer.bitmapData);
_local1++;
};
}
public function get parcticlesCount():int{
return (activeParticles.length);
}
public function killAllParticles():void{
var _local1:int;
while (_local1 < activeParticles.length) {
activeParticles[_local1].timeSinceStart = activeParticles[_local1].lifeTime;
_local1++;
};
}
private function update(_arg1:Number):void{
var _local3:Particle;
var _local2:int = (emitters.length - 1);
while (_local2 >= 0) {
if (emitters[_local2].update(_arg1)){
emitters.splice(_local2, 1);
};
_local2--;
};
bitmapLayer.refreshX1 = bitmapLayer.width;
bitmapLayer.refreshY1 = bitmapLayer.height;
bitmapLayer.refreshX2 = 0;
bitmapLayer.refreshY2 = 0;
_local2 = (activeParticles.length - 1);
while (_local2 >= 0) {
_local3 = (activeParticles[_local2] as Particle);
if (_local3.destRect.x < bitmapLayer.refreshX1){
bitmapLayer.refreshX1 = _local3.destRect.x;
};
if (_local3.destRect.y < bitmapLayer.refreshY1){
bitmapLayer.refreshY1 = _local3.destRect.y;
};
if (_local3.destRect.right > bitmapLayer.refreshX2){
bitmapLayer.refreshX2 = _local3.destRect.right;
};
if (_local3.destRect.bottom > bitmapLayer.refreshY2){
bitmapLayer.refreshY2 = _local3.destRect.bottom;
};
if (((_local3.update(_arg1)) || (!(bitmapLayer.bounds.intersects(_local3.bounds))))){
activeParticles.splice(_local2, 1);
freeParticles.push(_local3);
};
_local2--;
};
}
public function get emittersCount():int{
return (emitters.length);
}
public function killEmmiter(_arg1:Emitter):void{
var _local2:int;
while (_local2 < emitters.length) {
if (emitters[_local2] == _arg1){
emitters.splice(_local2, 1);
return;
};
_local2++;
};
}
public function addSettings(_arg1:EmitterSettings):void{
emSettings.push(_arg1);
}
public function createParticle():Particle{
var _local1:Particle;
if (freeParticles.length > 0){
_local1 = (freeParticles.pop() as Particle);
} else {
_local1 = new Particle();
};
activeParticles.push(_local1);
return (_local1);
}
private function updateAndDraw(_arg1:Event):void{
var _local2:int = getTimer();
var _local3:int = (_local2 - lastTime);
lastTime = _local2;
if (!enabled){
return;
};
update(_local3);
draw();
}
public function killAllEmmiters():void{
emitters.splice(0, emitters.length);
}
public function addSettingsByObject(_arg1:Object):void{
var _local2:EmitterSettings = new EmitterSettings();
_local2.loadFromObject(_arg1);
emSettings.push(_local2);
}
public function getSettingsByName(_arg1:String):EmitterSettings{
var _local2:int;
while (_local2 < emSettings.length) {
if ((emSettings[_local2] as EmitterSettings).name == _arg1){
return ((emSettings[_local2] as EmitterSettings));
};
_local2++;
};
return (null);
}
}
}//package dgparticles
Section 10
//Utils (dgparticles.Utils)
package dgparticles {
public class Utils {
public static const DegToRad = 0.0174532925199433;
public static function randomInt(_arg1, _arg2:int):int{
return ((_arg1 + Math.round((Math.random() * (_arg2 - _arg1)))));
}
public static function randomNumber(_arg1, _arg2:Number):Number{
return ((_arg1 + (Math.random() * (_arg2 - _arg1))));
}
}
}//package dgparticles
Section 11
//wav (Enemy_laser.wav)
package Enemy_laser {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package Enemy_laser
Section 12
//wav (Enemy_shoot.wav)
package Enemy_shoot {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package Enemy_shoot
Section 13
//wav (Enemy_shoot2.wav)
package Enemy_shoot2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package Enemy_shoot2
Section 14
//wav (ExpLarge.wav)
package ExpLarge {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package ExpLarge
Section 15
//wav (ExpSmall1.wav)
package ExpSmall1 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package ExpSmall1
Section 16
//wav (fire2.wav)
package fire2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package fire2
Section 17
//BaseButton (fl.controls.BaseButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import flash.utils.*;
import fl.events.*;
public class BaseButton extends UIComponent {
protected var pressTimer:Timer;
protected var _autoRepeat:Boolean;// = false
protected var _selected:Boolean;// = false
protected var background:DisplayObject;
private var unlockedMouseState:String;
protected var mouseState:String;
private var _mouseStateLocked:Boolean;// = false
private static var defaultStyles:Object = {upSkin:"Button_upSkin", downSkin:"Button_downSkin", overSkin:"Button_overSkin", disabledSkin:"Button_disabledSkin", selectedDisabledSkin:"Button_selectedDisabledSkin", selectedUpSkin:"Button_selectedUpSkin", selectedDownSkin:"Button_selectedDownSkin", selectedOverSkin:"Button_selectedOverSkin", focusRectSkin:null, focusRectPadding:null, repeatDelay:500, repeatInterval:35};
public function BaseButton(){
buttonMode = true;
mouseChildren = false;
useHandCursor = false;
setupMouseEvents();
setMouseState("up");
pressTimer = new Timer(1, 0);
pressTimer.addEventListener(TimerEvent.TIMER, buttonDown, false, 0, true);
}
override public function get enabled():Boolean{
return (super.enabled);
}
protected function startPress():void{
if (_autoRepeat){
pressTimer.delay = Number(getStyleValue("repeatDelay"));
pressTimer.start();
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
override protected function draw():void{
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
super.draw();
}
protected function drawLayout():void{
background.width = width;
background.height = height;
}
override public function set enabled(_arg1:Boolean):void{
super.enabled = _arg1;
mouseEnabled = _arg1;
}
public function set autoRepeat(_arg1:Boolean):void{
_autoRepeat = _arg1;
}
protected function mouseEventHandler(_arg1:MouseEvent):void{
if (_arg1.type == MouseEvent.MOUSE_DOWN){
setMouseState("down");
startPress();
} else {
if ((((_arg1.type == MouseEvent.ROLL_OVER)) || ((_arg1.type == MouseEvent.MOUSE_UP)))){
setMouseState("over");
endPress();
} else {
if (_arg1.type == MouseEvent.ROLL_OUT){
setMouseState("up");
endPress();
};
};
};
}
protected function drawBackground():void{
var _local1:String = (enabled) ? mouseState : "disabled";
if (selected){
_local1 = (("selected" + _local1.substr(0, 1).toUpperCase()) + _local1.substr(1));
};
_local1 = (_local1 + "Skin");
var _local2:DisplayObject = background;
background = getDisplayObjectInstance(getStyleValue(_local1));
addChildAt(background, 0);
if (((!((_local2 == null))) && (!((_local2 == background))))){
removeChild(_local2);
};
}
public function get selected():Boolean{
return (_selected);
}
protected function setupMouseEvents():void{
addEventListener(MouseEvent.ROLL_OVER, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.MOUSE_UP, mouseEventHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, mouseEventHandler, false, 0, true);
}
protected function endPress():void{
pressTimer.reset();
}
public function set mouseStateLocked(_arg1:Boolean):void{
_mouseStateLocked = _arg1;
if (_arg1 == false){
setMouseState(unlockedMouseState);
} else {
unlockedMouseState = mouseState;
};
}
public function get autoRepeat():Boolean{
return (_autoRepeat);
}
public function set selected(_arg1:Boolean):void{
if (_selected == _arg1){
return;
};
_selected = _arg1;
invalidate(InvalidationType.STATE);
}
protected function buttonDown(_arg1:TimerEvent):void{
if (!_autoRepeat){
endPress();
return;
};
if (pressTimer.currentCount == 1){
pressTimer.delay = Number(getStyleValue("repeatInterval"));
};
dispatchEvent(new ComponentEvent(ComponentEvent.BUTTON_DOWN, true));
}
public function setMouseState(_arg1:String):void{
if (_mouseStateLocked){
unlockedMouseState = _arg1;
return;
};
if (mouseState == _arg1){
return;
};
mouseState = _arg1;
invalidate(InvalidationType.STATE);
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 18
//Button (fl.controls.Button)
package fl.controls {
import flash.display.*;
import fl.core.*;
import fl.managers.*;
public class Button extends LabelButton implements IFocusManagerComponent {
protected var _emphasized:Boolean;// = false
protected var emphasizedBorder:DisplayObject;
private static var defaultStyles:Object = {emphasizedSkin:"Button_emphasizedSkin", emphasizedPadding:2};
public static var createAccessibilityImplementation:Function;
public function set emphasized(_arg1:Boolean):void{
_emphasized = _arg1;
invalidate(InvalidationType.STYLES);
}
override protected function initializeAccessibility():void{
if (Button.createAccessibilityImplementation != null){
Button.createAccessibilityImplementation(this);
};
}
protected function drawEmphasized():void{
var _local2:Number;
if (emphasizedBorder != null){
removeChild(emphasizedBorder);
};
emphasizedBorder = null;
if (!_emphasized){
return;
};
var _local1:Object = getStyleValue("emphasizedSkin");
if (_local1 != null){
emphasizedBorder = getDisplayObjectInstance(_local1);
};
if (emphasizedBorder != null){
addChildAt(emphasizedBorder, 0);
_local2 = Number(getStyleValue("emphasizedPadding"));
emphasizedBorder.x = (emphasizedBorder.y = -(_local2));
emphasizedBorder.width = (width + (_local2 * 2));
emphasizedBorder.height = (height + (_local2 * 2));
};
}
public function get emphasized():Boolean{
return (_emphasized);
}
override protected function draw():void{
if (((isInvalid(InvalidationType.STYLES)) || (isInvalid(InvalidationType.SIZE)))){
drawEmphasized();
};
super.draw();
if (emphasizedBorder != null){
setChildIndex(emphasizedBorder, (numChildren - 1));
};
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
var _local3:*;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("emphasizedPadding"));
if ((((_local2 < 0)) || (!(_emphasized)))){
_local2 = 0;
};
_local3 = getStyleValue("focusRectPadding");
_local3 = ((_local3)==null) ? 2 : _local3;
_local3 = (_local3 + _local2);
uiFocusRect.x = -(_local3);
uiFocusRect.y = -(_local3);
uiFocusRect.width = (width + (_local3 * 2));
uiFocusRect.height = (height + (_local3 * 2));
};
}
public static function getStyleDefinition():Object{
return (UIComponent.mergeStyles(LabelButton.getStyleDefinition(), defaultStyles));
}
}
}//package fl.controls
Section 19
//ButtonLabelPlacement (fl.controls.ButtonLabelPlacement)
package fl.controls {
public class ButtonLabelPlacement {
public static const TOP:String = "top";
public static const LEFT:String = "left";
public static const BOTTOM:String = "bottom";
public static const RIGHT:String = "right";
}
}//package fl.controls
Section 20
//CheckBox (fl.controls.CheckBox)
package fl.controls {
import flash.display.*;
public class CheckBox extends LabelButton {
private static var defaultStyles:Object = {icon:null, upIcon:"CheckBox_upIcon", downIcon:"CheckBox_downIcon", overIcon:"CheckBox_overIcon", disabledIcon:"CheckBox_disabledIcon", selectedDisabledIcon:"CheckBox_selectedDisabledIcon", focusRectSkin:null, focusRectPadding:null, selectedUpIcon:"CheckBox_selectedUpIcon", selectedDownIcon:"CheckBox_selectedDownIcon", selectedOverIcon:"CheckBox_selectedOverIcon", textFormat:null, disabledTextFormat:null, embedFonts:null, textPadding:5};
public static var createAccessibilityImplementation:Function;
override protected function drawBackground():void{
}
override public function get toggle():Boolean{
return (true);
}
override protected function initializeAccessibility():void{
if (CheckBox.createAccessibilityImplementation != null){
CheckBox.createAccessibilityImplementation(this);
};
}
override public function set toggle(_arg1:Boolean):void{
throw (new Error("Warning: You cannot change a CheckBox's toggle."));
}
override public function get autoRepeat():Boolean{
return (false);
}
override public function set autoRepeat(_arg1:Boolean):void{
}
override public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
super.drawFocus(_arg1);
if (_arg1){
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = (background.x - _local2);
uiFocusRect.y = (background.y - _local2);
uiFocusRect.width = (background.width + (_local2 << 1));
uiFocusRect.height = (background.height + (_local2 << 1));
};
}
override protected function configUI():void{
super.configUI();
super.toggle = true;
var _local1:Shape = new Shape();
var _local2:Graphics = _local1.graphics;
_local2.beginFill(0, 0);
_local2.drawRect(0, 0, 100, 100);
_local2.endFill();
background = (_local1 as DisplayObject);
addChildAt(background, 0);
}
override protected function drawLayout():void{
super.drawLayout();
var _local1:Number = Number(getStyleValue("textPadding"));
switch (_labelPlacement){
case ButtonLabelPlacement.RIGHT:
icon.x = _local1;
textField.x = (icon.x + (icon.width + _local1));
background.width = ((textField.x + textField.width) + _local1);
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.LEFT:
icon.x = ((width - icon.width) - _local1);
textField.x = (((width - icon.width) - (_local1 * 2)) - textField.width);
background.width = ((textField.width + icon.width) + (_local1 * 3));
background.height = (Math.max(textField.height, icon.height) + (_local1 * 2));
break;
case ButtonLabelPlacement.TOP:
case ButtonLabelPlacement.BOTTOM:
background.width = (Math.max(textField.width, icon.width) + (_local1 * 2));
background.height = ((textField.height + icon.height) + (_local1 * 3));
break;
};
background.x = Math.min((icon.x - _local1), (textField.x - _local1));
background.y = Math.min((icon.y - _local1), (textField.y - _local1));
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
}
}//package fl.controls
Section 21
//LabelButton (fl.controls.LabelButton)
package fl.controls {
import flash.display.*;
import flash.events.*;
import fl.core.*;
import fl.managers.*;
import fl.events.*;
import flash.text.*;
import flash.ui.*;
public class LabelButton extends BaseButton implements IFocusManagerComponent {
protected var _toggle:Boolean;// = false
public var textField:TextField;
protected var mode:String;// = "center"
protected var _labelPlacement:String;// = "right"
protected var oldMouseState:String;
protected var _label:String;// = "Label"
protected var icon:DisplayObject;
private static var defaultStyles:Object = {icon:null, upIcon:null, downIcon:null, overIcon:null, disabledIcon:null, selectedDisabledIcon:null, selectedUpIcon:null, selectedDownIcon:null, selectedOverIcon:null, textFormat:null, disabledTextFormat:null, textPadding:5, embedFonts:false};
public static var createAccessibilityImplementation:Function;
override protected function draw():void{
if (textField.text != _label){
label = _label;
};
if (isInvalid(InvalidationType.STYLES, InvalidationType.STATE)){
drawBackground();
drawIcon();
drawTextFormat();
invalidate(InvalidationType.SIZE, false);
};
if (isInvalid(InvalidationType.SIZE)){
drawLayout();
};
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
override protected function drawLayout():void{
var _local7:Number;
var _local8:Number;
var _local1:Number = Number(getStyleValue("textPadding"));
var _local2:String = ((((icon == null)) && ((mode == "center")))) ? ButtonLabelPlacement.TOP : _labelPlacement;
textField.height = (textField.textHeight + 4);
var _local3:Number = (textField.textWidth + 4);
var _local4:Number = (textField.textHeight + 4);
var _local5:Number = ((icon)==null) ? 0 : (icon.width + _local1);
var _local6:Number = ((icon)==null) ? 0 : (icon.height + _local1);
textField.visible = (label.length > 0);
if (icon != null){
icon.x = Math.round(((width - icon.width) / 2));
icon.y = Math.round(((height - icon.height) / 2));
};
if (textField.visible == false){
textField.width = 0;
textField.height = 0;
} else {
if ((((_local2 == ButtonLabelPlacement.BOTTOM)) || ((_local2 == ButtonLabelPlacement.TOP)))){
_local7 = Math.max(0, Math.min(_local3, (width - (2 * _local1))));
if ((height - 2) > _local4){
_local8 = _local4;
} else {
_local8 = (height - 2);
};
_local3 = _local7;
textField.width = _local3;
_local4 = _local8;
textField.height = _local4;
textField.x = Math.round(((width - _local3) / 2));
textField.y = Math.round(((((height - textField.height) - _local6) / 2) + ((_local2)==ButtonLabelPlacement.BOTTOM) ? _local6 : 0));
if (icon != null){
icon.y = Math.round(((_local2)==ButtonLabelPlacement.BOTTOM) ? (textField.y - _local6) : ((textField.y + textField.height) + _local1));
};
} else {
_local7 = Math.max(0, Math.min(_local3, ((width - _local5) - (2 * _local1))));
_local3 = _local7;
textField.width = _local3;
textField.x = Math.round(((((width - _local3) - _local5) / 2) + ((_local2)!=ButtonLabelPlacement.LEFT) ? _local5 : 0));
textField.y = Math.round(((height - textField.height) / 2));
if (icon != null){
icon.x = Math.round(((_local2)!=ButtonLabelPlacement.LEFT) ? (textField.x - _local5) : ((textField.x + _local3) + _local1));
};
};
};
super.drawLayout();
}
protected function toggleSelected(_arg1:MouseEvent):void{
selected = !(selected);
dispatchEvent(new Event(Event.CHANGE, true));
}
override protected function keyUpHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
setMouseState(oldMouseState);
oldMouseState = null;
endPress();
dispatchEvent(new MouseEvent(MouseEvent.CLICK));
};
}
public function get labelPlacement():String{
return (_labelPlacement);
}
public function get toggle():Boolean{
return (_toggle);
}
protected function setEmbedFont(){
var _local1:Object = getStyleValue("embedFonts");
if (_local1 != null){
textField.embedFonts = _local1;
};
}
override public function get selected():Boolean{
return ((_toggle) ? _selected : false);
}
override protected function configUI():void{
super.configUI();
textField = new TextField();
textField.type = TextFieldType.DYNAMIC;
textField.selectable = false;
addChild(textField);
}
override protected function initializeAccessibility():void{
if (LabelButton.createAccessibilityImplementation != null){
LabelButton.createAccessibilityImplementation(this);
};
}
public function set labelPlacement(_arg1:String):void{
_labelPlacement = _arg1;
invalidate(InvalidationType.SIZE);
}
protected function drawIcon():void{
var _local1:DisplayObject = icon;
var _local2:String = (enabled) ? mouseState : "disabled";
if (selected){
_local2 = (("selected" + _local2.substr(0, 1).toUpperCase()) + _local2.substr(1));
};
_local2 = (_local2 + "Icon");
var _local3:Object = getStyleValue(_local2);
if (_local3 == null){
_local3 = getStyleValue("icon");
};
if (_local3 != null){
icon = getDisplayObjectInstance(_local3);
};
if (icon != null){
addChildAt(icon, 1);
};
if (((!((_local1 == null))) && (!((_local1 == icon))))){
removeChild(_local1);
};
}
public function set label(_arg1:String):void{
_label = _arg1;
if (textField.text != _label){
textField.text = _label;
dispatchEvent(new ComponentEvent(ComponentEvent.LABEL_CHANGE));
};
invalidate(InvalidationType.SIZE);
invalidate(InvalidationType.STYLES);
}
override protected function keyDownHandler(_arg1:KeyboardEvent):void{
if (!enabled){
return;
};
if (_arg1.keyCode == Keyboard.SPACE){
if (oldMouseState == null){
oldMouseState = mouseState;
};
setMouseState("down");
startPress();
};
}
public function set toggle(_arg1:Boolean):void{
if (((!(_arg1)) && (super.selected))){
selected = false;
};
_toggle = _arg1;
if (_toggle){
addEventListener(MouseEvent.CLICK, toggleSelected, false, 0, true);
} else {
removeEventListener(MouseEvent.CLICK, toggleSelected);
};
invalidate(InvalidationType.STATE);
}
override public function set selected(_arg1:Boolean):void{
_selected = _arg1;
if (_toggle){
invalidate(InvalidationType.STATE);
};
}
protected function drawTextFormat():void{
var _local1:Object = UIComponent.getStyleDefinition();
var _local2:TextFormat = (enabled) ? (_local1.defaultTextFormat as TextFormat) : (_local1.defaultDisabledTextFormat as TextFormat);
textField.setTextFormat(_local2);
var _local3:TextFormat = (getStyleValue((enabled) ? "textFormat" : "disabledTextFormat") as TextFormat);
if (_local3 != null){
textField.setTextFormat(_local3);
} else {
_local3 = _local2;
};
textField.defaultTextFormat = _local3;
setEmbedFont();
}
public function get label():String{
return (_label);
}
public static function getStyleDefinition():Object{
return (mergeStyles(defaultStyles, BaseButton.getStyleDefinition()));
}
}
}//package fl.controls
Section 22
//ComponentShim (fl.core.ComponentShim)
package fl.core {
import flash.display.*;
public dynamic class ComponentShim extends MovieClip {
}
}//package fl.core
Section 23
//InvalidationType (fl.core.InvalidationType)
package fl.core {
public class InvalidationType {
public static const SIZE:String = "size";
public static const ALL:String = "all";
public static const DATA:String = "data";
public static const SCROLL:String = "scroll";
public static const STATE:String = "state";
public static const STYLES:String = "styles";
public static const SELECTED:String = "selected";
public static const RENDERER_STYLES:String = "rendererStyles";
}
}//package fl.core
Section 24
//UIComponent (fl.core.UIComponent)
package fl.core {
import flash.display.*;
import flash.events.*;
import fl.managers.*;
import flash.utils.*;
import fl.events.*;
import flash.text.*;
import flash.system.*;
public class UIComponent extends Sprite {
protected var _x:Number;
protected var _enabled:Boolean;// = true
protected var callLaterMethods:Dictionary;
private var _mouseFocusEnabled:Boolean;// = true
private var tempText:TextField;
private var _focusEnabled:Boolean;// = true
protected var startHeight:Number;
protected var _height:Number;
protected var invalidateFlag:Boolean;// = false
protected var _oldIMEMode:String;// = null
protected var _inspector:Boolean;// = false
protected var startWidth:Number;
public var focusTarget:IFocusManagerComponent;
protected var errorCaught:Boolean;// = false
protected var invalidHash:Object;
protected var sharedStyles:Object;
protected var uiFocusRect:DisplayObject;
protected var isLivePreview:Boolean;// = false
protected var _imeMode:String;// = null
protected var _width:Number;
protected var instanceStyles:Object;
public var version:String;// = "3.0.0.16"
protected var isFocused:Boolean;// = false
protected var _y:Number;
public static var inCallLaterPhase:Boolean = false;
private static var defaultStyles:Object = {focusRectSkin:"focusRectSkin", focusRectPadding:2, textFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), disabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultTextFormat:new TextFormat("_sans", 11, 0, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0), defaultDisabledTextFormat:new TextFormat("_sans", 11, 0x999999, false, false, false, "", "", TextFormatAlign.LEFT, 0, 0, 0, 0)};
public static var createAccessibilityImplementation:Function;
private static var focusManagers:Dictionary = new Dictionary(false);
public function UIComponent(){
instanceStyles = {};
sharedStyles = {};
invalidHash = {};
callLaterMethods = new Dictionary();
StyleManager.registerInstance(this);
configUI();
invalidate(InvalidationType.ALL);
tabEnabled = (this is IFocusManagerComponent);
focusRect = false;
if (tabEnabled){
addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
};
initializeFocusManager();
addEventListener(Event.ENTER_FRAME, hookAccessibility, false, 0, true);
}
public function getStyle(_arg1:String):Object{
return (instanceStyles[_arg1]);
}
protected function checkLivePreview():Boolean{
var className:String;
if (parent == null){
return (false);
};
try {
className = getQualifiedClassName(parent);
} catch(e:Error) {
};
return ((className == "fl.livepreview::LivePreviewParent"));
}
private function callLaterDispatcher(_arg1:Event):void{
var _local3:Object;
if (_arg1.type == Event.ADDED_TO_STAGE){
removeEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher);
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
return;
};
_arg1.target.removeEventListener(Event.RENDER, callLaterDispatcher);
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
return;
};
inCallLaterPhase = true;
var _local2:Dictionary = callLaterMethods;
for (_local3 in _local2) {
_local3();
delete _local2[_local3];
};
inCallLaterPhase = false;
}
protected function validate():void{
invalidHash = {};
}
protected function focusOutHandler(_arg1:FocusEvent):void{
if (isOurFocus((_arg1.target as DisplayObject))){
drawFocus(false);
isFocused = false;
};
}
public function set mouseFocusEnabled(_arg1:Boolean):void{
_mouseFocusEnabled = _arg1;
}
public function getFocus():InteractiveObject{
if (stage){
return (stage.focus);
};
return (null);
}
override public function get height():Number{
return (_height);
}
private function addedHandler(_arg1:Event):void{
removeEventListener("addedToStage", addedHandler);
initializeFocusManager();
}
protected function getStyleValue(_arg1:String):Object{
return (((instanceStyles[_arg1])==null) ? sharedStyles[_arg1] : instanceStyles[_arg1]);
}
public function invalidate(_arg1:String="all", _arg2:Boolean=true):void{
invalidHash[_arg1] = true;
if (_arg2){
this.callLater(draw);
};
}
protected function isOurFocus(_arg1:DisplayObject):Boolean{
return ((_arg1 == this));
}
public function get enabled():Boolean{
return (_enabled);
}
protected function getScaleX():Number{
return (super.scaleX);
}
protected function getScaleY():Number{
return (super.scaleY);
}
public function get focusEnabled():Boolean{
return (_focusEnabled);
}
protected function afterComponentParameters():void{
}
override public function get scaleY():Number{
return ((height / startHeight));
}
protected function setIMEMode(_arg1:Boolean){
var enabled = _arg1;
if (_imeMode != null){
if (enabled){
IME.enabled = true;
_oldIMEMode = IME.conversionMode;
try {
if (((!(errorCaught)) && (!((IME.conversionMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _imeMode;
};
errorCaught = false;
} catch(e:Error) {
errorCaught = true;
throw (new Error(("IME mode not supported: " + _imeMode)));
};
} else {
if (((!((IME.conversionMode == IMEConversionMode.UNKNOWN))) && (!((_oldIMEMode == IMEConversionMode.UNKNOWN))))){
IME.conversionMode = _oldIMEMode;
};
IME.enabled = false;
};
};
}
protected function draw():void{
if (isInvalid(InvalidationType.SIZE, InvalidationType.STYLES)){
if (((isFocused) && (focusManager.showFocusIndicator))){
drawFocus(true);
};
};
validate();
}
override public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
setSize(width, _arg1);
}
protected function configUI():void{
isLivePreview = checkLivePreview();
var _local1:Number = rotation;
rotation = 0;
var _local2:Number = super.width;
var _local3:Number = super.height;
var _local4 = 1;
super.scaleY = _local4;
super.scaleX = _local4;
setSize(_local2, _local3);
move(super.x, super.y);
rotation = _local1;
startWidth = _local2;
startHeight = _local3;
if (numChildren > 0){
removeChildAt(0);
};
}
protected function setScaleY(_arg1:Number):void{
super.scaleY = _arg1;
}
override public function get scaleX():Number{
return ((width / startWidth));
}
protected function setScaleX(_arg1:Number):void{
super.scaleX = _arg1;
}
private function initializeFocusManager():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedHandler, false, 0, true);
} else {
createFocusManager();
};
}
protected function keyDownHandler(_arg1:KeyboardEvent):void{
}
public function set focusManager(_arg1:IFocusManager):void{
UIComponent.focusManagers[this] = _arg1;
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
protected function isInvalid(_arg1:String, ... _args):Boolean{
if (((invalidHash[_arg1]) || (invalidHash[InvalidationType.ALL]))){
return (true);
};
while (_args.length > 0) {
if (invalidHash[_args.pop()]){
return (true);
};
};
return (false);
}
public function setStyle(_arg1:String, _arg2:Object):void{
if ((((instanceStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
instanceStyles[_arg1] = _arg2;
invalidate(InvalidationType.STYLES);
}
override public function get visible():Boolean{
return (super.visible);
}
protected function focusInHandler(_arg1:FocusEvent):void{
var _local2:IFocusManager;
if (isOurFocus((_arg1.target as DisplayObject))){
_local2 = focusManager;
if (((_local2) && (_local2.showFocusIndicator))){
drawFocus(true);
isFocused = true;
};
};
}
public function get componentInspectorSetting():Boolean{
return (_inspector);
}
override public function get x():Number{
return ((isNaN(_x)) ? super.x : _x);
}
override public function get y():Number{
return ((isNaN(_y)) ? super.y : _y);
}
public function set enabled(_arg1:Boolean):void{
if (_arg1 == _enabled){
return;
};
_enabled = _arg1;
invalidate(InvalidationType.STATE);
}
public function setSize(_arg1:Number, _arg2:Number):void{
_width = _arg1;
_height = _arg2;
invalidate(InvalidationType.SIZE);
dispatchEvent(new ComponentEvent(ComponentEvent.RESIZE, false));
}
protected function keyUpHandler(_arg1:KeyboardEvent):void{
}
public function setSharedStyle(_arg1:String, _arg2:Object):void{
if ((((sharedStyles[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
sharedStyles[_arg1] = _arg2;
if (instanceStyles[_arg1] == null){
invalidate(InvalidationType.STYLES);
};
}
public function set focusEnabled(_arg1:Boolean):void{
_focusEnabled = _arg1;
}
override public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
setSize(_arg1, height);
}
public function setFocus():void{
if (stage){
stage.focus = this;
};
}
override public function set scaleX(_arg1:Number):void{
setSize((startWidth * _arg1), height);
}
public function get mouseFocusEnabled():Boolean{
return (_mouseFocusEnabled);
}
override public function set scaleY(_arg1:Number):void{
setSize(width, (startHeight * _arg1));
}
protected function getDisplayObjectInstance(_arg1:Object):DisplayObject{
var skin = _arg1;
var classDef:Object;
if ((skin is Class)){
return ((new (skin) as DisplayObject));
};
if ((skin is DisplayObject)){
(skin as DisplayObject).x = 0;
(skin as DisplayObject).y = 0;
return ((skin as DisplayObject));
};
try {
classDef = getDefinitionByName(skin.toString());
} catch(e:Error) {
try {
classDef = (loaderInfo.applicationDomain.getDefinition(skin.toString()) as Object);
} catch(e:Error) {
};
};
if (classDef == null){
return (null);
};
return ((new (classDef) as DisplayObject));
}
protected function copyStylesToChild(_arg1:UIComponent, _arg2:Object):void{
var _local3:String;
for (_local3 in _arg2) {
_arg1.setStyle(_local3, getStyleValue(_arg2[_local3]));
};
}
protected function initializeAccessibility():void{
if (UIComponent.createAccessibilityImplementation != null){
UIComponent.createAccessibilityImplementation(this);
};
}
public function get focusManager():IFocusManager{
var _local1:DisplayObject = this;
while (_local1) {
if (UIComponent.focusManagers[_local1] != null){
return (IFocusManager(UIComponent.focusManagers[_local1]));
};
_local1 = _local1.parent;
};
return (null);
}
override public function get width():Number{
return (_width);
}
protected function beforeComponentParameters():void{
}
protected function callLater(_arg1:Function):void{
if (inCallLaterPhase){
return;
};
callLaterMethods[_arg1] = true;
if (stage != null){
stage.addEventListener(Event.RENDER, callLaterDispatcher, false, 0, true);
stage.invalidate();
} else {
addEventListener(Event.ADDED_TO_STAGE, callLaterDispatcher, false, 0, true);
};
}
public function move(_arg1:Number, _arg2:Number):void{
_x = _arg1;
_y = _arg2;
super.x = Math.round(_arg1);
super.y = Math.round(_arg2);
dispatchEvent(new ComponentEvent(ComponentEvent.MOVE));
}
public function validateNow():void{
invalidate(InvalidationType.ALL, false);
draw();
}
override public function set visible(_arg1:Boolean):void{
if (super.visible == _arg1){
return;
};
super.visible = _arg1;
var _local2:String = (_arg1) ? ComponentEvent.SHOW : ComponentEvent.HIDE;
dispatchEvent(new ComponentEvent(_local2, true));
}
protected function createFocusManager():void{
if (focusManagers[stage] == null){
focusManagers[stage] = new FocusManager(stage);
};
}
protected function hookAccessibility(_arg1:Event):void{
removeEventListener(Event.ENTER_FRAME, hookAccessibility);
initializeAccessibility();
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_inspector = _arg1;
if (_inspector){
beforeComponentParameters();
} else {
afterComponentParameters();
};
}
override public function set y(_arg1:Number):void{
move(_x, _arg1);
}
public function drawFocus(_arg1:Boolean):void{
var _local2:Number;
isFocused = _arg1;
if (((!((uiFocusRect == null))) && (contains(uiFocusRect)))){
removeChild(uiFocusRect);
uiFocusRect = null;
};
if (_arg1){
uiFocusRect = (getDisplayObjectInstance(getStyleValue("focusRectSkin")) as Sprite);
if (uiFocusRect == null){
return;
};
_local2 = Number(getStyleValue("focusRectPadding"));
uiFocusRect.x = -(_local2);
uiFocusRect.y = -(_local2);
uiFocusRect.width = (width + (_local2 * 2));
uiFocusRect.height = (height + (_local2 * 2));
addChildAt(uiFocusRect, 0);
};
}
override public function set x(_arg1:Number):void{
move(_arg1, _y);
}
public function drawNow():void{
draw();
}
public static function getStyleDefinition():Object{
return (defaultStyles);
}
public static function mergeStyles(... _args):Object{
var _local5:Object;
var _local6:String;
var _local2:Object = {};
var _local3:uint = _args.length;
var _local4:uint;
while (_local4 < _local3) {
_local5 = _args[_local4];
for (_local6 in _local5) {
if (_local2[_local6] != null){
} else {
_local2[_local6] = _args[_local4][_local6];
};
};
_local4++;
};
return (_local2);
}
}
}//package fl.core
Section 25
//ComponentEvent (fl.events.ComponentEvent)
package fl.events {
import flash.events.*;
public class ComponentEvent extends Event {
public static const HIDE:String = "hide";
public static const BUTTON_DOWN:String = "buttonDown";
public static const MOVE:String = "move";
public static const RESIZE:String = "resize";
public static const ENTER:String = "enter";
public static const LABEL_CHANGE:String = "labelChange";
public static const SHOW:String = "show";
public function ComponentEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("ComponentEvent", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ComponentEvent(type, bubbles, cancelable));
}
}
}//package fl.events
Section 26
//FocusManager (fl.managers.FocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import fl.core.*;
import flash.utils.*;
import flash.text.*;
import flash.ui.*;
public class FocusManager implements IFocusManager {
private var focusableObjects:Dictionary;
private var _showFocusIndicator:Boolean;// = true
private var defButton:Button;
private var focusableCandidates:Array;
private var _form:DisplayObjectContainer;
private var _defaultButtonEnabled:Boolean;// = true
private var activated:Boolean;// = false
private var _defaultButton:Button;
private var calculateCandidates:Boolean;// = true
private var lastFocus:InteractiveObject;
private var lastAction:String;
public function FocusManager(_arg1:DisplayObjectContainer){
focusableObjects = new Dictionary(true);
if (_arg1 != null){
_form = _arg1;
addFocusables(DisplayObject(_arg1));
_arg1.addEventListener(Event.ADDED, addedHandler);
_arg1.addEventListener(Event.REMOVED, removedHandler);
activate();
};
}
public function get showFocusIndicator():Boolean{
return (_showFocusIndicator);
}
private function getIndexOfNextObject(_arg1:int, _arg2:Boolean, _arg3:Boolean, _arg4:String):int{
var _local7:DisplayObject;
var _local8:IFocusManagerGroup;
var _local9:int;
var _local10:DisplayObject;
var _local11:IFocusManagerGroup;
var _local5:int = focusableCandidates.length;
var _local6:int = _arg1;
while (true) {
if (_arg2){
_arg1--;
} else {
_arg1++;
};
if (_arg3){
if (((_arg2) && ((_arg1 < 0)))){
break;
};
if (((!(_arg2)) && ((_arg1 == _local5)))){
break;
};
} else {
_arg1 = ((_arg1 + _local5) % _local5);
if (_local6 == _arg1){
break;
};
};
if (isValidFocusCandidate(focusableCandidates[_arg1], _arg4)){
_local7 = DisplayObject(findFocusManagerComponent(focusableCandidates[_arg1]));
if ((_local7 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local7);
_local9 = 0;
while (_local9 < focusableCandidates.length) {
_local10 = focusableCandidates[_local9];
if ((_local10 is IFocusManagerGroup)){
_local11 = IFocusManagerGroup(_local10);
if ((((_local11.groupName == _local8.groupName)) && (_local11.selected))){
_arg1 = _local9;
break;
};
};
_local9++;
};
};
return (_arg1);
};
};
return (_arg1);
}
private function mouseFocusChangeHandler(_arg1:FocusEvent):void{
if ((_arg1.relatedObject is TextField)){
return;
};
_arg1.preventDefault();
}
public function set form(_arg1:DisplayObjectContainer):void{
_form = _arg1;
}
private function addFocusables(_arg1:DisplayObject, _arg2:Boolean=false):void{
var focusable:IFocusManagerComponent;
var io:InteractiveObject;
var doc:DisplayObjectContainer;
var i:int;
var child:DisplayObject;
var o = _arg1;
var skipTopLevel = _arg2;
if (!skipTopLevel){
if ((o is IFocusManagerComponent)){
focusable = IFocusManagerComponent(o);
if (focusable.focusEnabled){
if (((focusable.tabEnabled) && (isTabVisible(o)))){
focusableObjects[o] = true;
calculateCandidates = true;
};
o.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
o.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
} else {
if ((o is InteractiveObject)){
io = (o as InteractiveObject);
if (((((io) && (io.tabEnabled))) && ((findFocusManagerComponent(io) == io)))){
focusableObjects[io] = true;
calculateCandidates = true;
};
io.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
io.addEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
};
};
};
if ((o is DisplayObjectContainer)){
doc = DisplayObjectContainer(o);
o.addEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
if ((((((doc is Stage)) || ((doc.parent is Stage)))) || (doc.tabChildren))){
i = 0;
while (i < doc.numChildren) {
try {
child = doc.getChildAt(i);
if (child != null){
addFocusables(doc.getChildAt(i));
};
} catch(error:SecurityError) {
};
i = (i + 1);
};
};
};
}
private function getChildIndex(_arg1:DisplayObjectContainer, _arg2:DisplayObject):int{
return (_arg1.getChildIndex(_arg2));
}
public function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject{
var _local2:InteractiveObject = _arg1;
while (_arg1) {
if ((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
};
return (_local2);
}
private function focusOutHandler(_arg1:FocusEvent):void{
var _local2:InteractiveObject = (_arg1.target as InteractiveObject);
}
private function isValidFocusCandidate(_arg1:DisplayObject, _arg2:String):Boolean{
var _local3:IFocusManagerGroup;
if (!isEnabledAndVisible(_arg1)){
return (false);
};
if ((_arg1 is IFocusManagerGroup)){
_local3 = IFocusManagerGroup(_arg1);
if (_arg2 == _local3.groupName){
return (false);
};
};
return (true);
}
private function setFocusToNextObject(_arg1:FocusEvent):void{
if (!hasFocusableObjects()){
return;
};
var _local2:InteractiveObject = getNextFocusManagerComponent(_arg1.shiftKey);
if (_local2){
setFocus(_local2);
};
}
private function sortFocusableObjectsTabIndex():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))){
focusableCandidates.push(_local2);
};
};
focusableCandidates.sort(sortByTabIndex);
}
private function removeFocusables(_arg1:DisplayObject):void{
var _local2:Object;
var _local3:DisplayObject;
if ((_arg1 is DisplayObjectContainer)){
_arg1.removeEventListener(Event.TAB_CHILDREN_CHANGE, tabChildrenChangeHandler);
_arg1.removeEventListener(Event.TAB_INDEX_CHANGE, tabIndexChangeHandler);
for (_local2 in focusableObjects) {
_local3 = DisplayObject(_local2);
if (DisplayObjectContainer(_arg1).contains(_local3)){
if (_local3 == lastFocus){
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local2];
calculateCandidates = true;
};
};
};
}
private function getTopLevelFocusTarget(_arg1:InteractiveObject):InteractiveObject{
while (_arg1 != InteractiveObject(form)) {
if ((((((((_arg1 is IFocusManagerComponent)) && (IFocusManagerComponent(_arg1).focusEnabled))) && (IFocusManagerComponent(_arg1).mouseFocusEnabled))) && (UIComponent(_arg1).enabled))){
return (_arg1);
};
_arg1 = _arg1.parent;
if (_arg1 == null){
break;
};
};
return (null);
}
public function sendDefaultButtonEvent():void{
defButton.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
private function addedHandler(_arg1:Event):void{
var _local2:DisplayObject = DisplayObject(_arg1.target);
if (_local2.stage){
addFocusables(DisplayObject(_arg1.target));
};
}
private function isEnabledAndVisible(_arg1:DisplayObject):Boolean{
var _local3:TextField;
var _local4:SimpleButton;
var _local2:DisplayObjectContainer = DisplayObject(form).parent;
while (_arg1 != _local2) {
if ((_arg1 is UIComponent)){
if (!UIComponent(_arg1).enabled){
return (false);
};
} else {
if ((_arg1 is TextField)){
_local3 = TextField(_arg1);
if ((((_local3.type == TextFieldType.DYNAMIC)) || (!(_local3.selectable)))){
return (false);
};
} else {
if ((_arg1 is SimpleButton)){
_local4 = SimpleButton(_arg1);
if (!_local4.enabled){
return (false);
};
};
};
};
if (!_arg1.visible){
return (false);
};
_arg1 = _arg1.parent;
};
return (true);
}
private function tabChildrenChangeHandler(_arg1:Event):void{
if (_arg1.target != _arg1.currentTarget){
return;
};
calculateCandidates = true;
var _local2:DisplayObjectContainer = DisplayObjectContainer(_arg1.target);
if (_local2.tabChildren){
addFocusables(_local2, true);
} else {
removeFocusables(_local2);
};
}
private function deactivateHandler(_arg1:Event):void{
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
}
public function setFocus(_arg1:InteractiveObject):void{
if ((_arg1 is IFocusManagerComponent)){
IFocusManagerComponent(_arg1).setFocus();
} else {
form.stage.focus = _arg1;
};
}
public function getFocus():InteractiveObject{
var _local1:InteractiveObject = form.stage.focus;
return (findFocusManagerComponent(_local1));
}
private function hasFocusableObjects():Boolean{
var _local1:Object;
for (_local1 in focusableObjects) {
return (true);
};
return (false);
}
private function tabIndexChangeHandler(_arg1:Event):void{
calculateCandidates = true;
}
public function set defaultButton(_arg1:Button):void{
var _local2:Button = (_arg1) ? Button(_arg1) : null;
if (_local2 != _defaultButton){
if (_defaultButton){
_defaultButton.emphasized = false;
};
if (defButton){
defButton.emphasized = false;
};
_defaultButton = _local2;
defButton = _local2;
if (_local2){
_local2.emphasized = true;
};
};
}
private function sortFocusableObjects():void{
var _local1:Object;
var _local2:InteractiveObject;
focusableCandidates = [];
for (_local1 in focusableObjects) {
_local2 = InteractiveObject(_local1);
if (((((_local2.tabIndex) && (!(isNaN(Number(_local2.tabIndex)))))) && ((_local2.tabIndex > 0)))){
sortFocusableObjectsTabIndex();
return;
};
focusableCandidates.push(_local2);
};
focusableCandidates.sort(sortByDepth);
}
private function keyFocusChangeHandler(_arg1:FocusEvent):void{
showFocusIndicator = true;
if ((((((_arg1.keyCode == Keyboard.TAB)) || ((_arg1.keyCode == 0)))) && (!(_arg1.isDefaultPrevented())))){
setFocusToNextObject(_arg1);
_arg1.preventDefault();
};
}
private function getIndexOfFocusedObject(_arg1:DisplayObject):int{
var _local2:int = focusableCandidates.length;
var _local3:int;
_local3 = 0;
while (_local3 < _local2) {
if (focusableCandidates[_local3] == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
public function hideFocus():void{
}
private function removedHandler(_arg1:Event):void{
var _local2:int;
var _local4:InteractiveObject;
var _local3:DisplayObject = DisplayObject(_arg1.target);
if ((((_local3 is IFocusManagerComponent)) && ((focusableObjects[_local3] == true)))){
if (_local3 == lastFocus){
IFocusManagerComponent(lastFocus).drawFocus(false);
lastFocus = null;
};
_local3.removeEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
delete focusableObjects[_local3];
calculateCandidates = true;
} else {
if ((((_local3 is InteractiveObject)) && ((focusableObjects[_local3] == true)))){
_local4 = (_local3 as InteractiveObject);
if (_local4){
if (_local4 == lastFocus){
lastFocus = null;
};
delete focusableObjects[_local4];
calculateCandidates = true;
};
_local3.addEventListener(Event.TAB_ENABLED_CHANGE, tabEnabledChangeHandler);
};
};
removeFocusables(_local3);
}
private function sortByDepth(_arg1:InteractiveObject, _arg2:InteractiveObject):Number{
var _local5:int;
var _local6:String;
var _local7:String;
var _local3 = "";
var _local4 = "";
var _local8 = "0000";
var _local9:DisplayObject = DisplayObject(_arg1);
var _local10:DisplayObject = DisplayObject(_arg2);
while (((!((_local9 == DisplayObject(form)))) && (_local9.parent))) {
_local5 = getChildIndex(_local9.parent, _local9);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local3 = (_local7 + _local3);
_local9 = _local9.parent;
};
while (((!((_local10 == DisplayObject(form)))) && (_local10.parent))) {
_local5 = getChildIndex(_local10.parent, _local10);
_local6 = _local5.toString(16);
if (_local6.length < 4){
_local7 = (_local8.substring(0, (4 - _local6.length)) + _local6);
};
_local4 = (_local7 + _local4);
_local10 = _local10.parent;
};
return (((_local3 > _local4)) ? 1 : ((_local3 < _local4)) ? -1 : 0);
}
public function get defaultButton():Button{
return (_defaultButton);
}
private function activateHandler(_arg1:Event):void{
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
if (lastFocus){
if ((lastFocus is IFocusManagerComponent)){
IFocusManagerComponent(lastFocus).setFocus();
} else {
form.stage.focus = lastFocus;
};
};
lastAction = "ACTIVATE";
}
public function showFocus():void{
}
public function set defaultButtonEnabled(_arg1:Boolean):void{
_defaultButtonEnabled = _arg1;
}
public function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject{
var _local8:IFocusManagerGroup;
if (!hasFocusableObjects()){
return (null);
};
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
var _local2:DisplayObject = form.stage.focus;
_local2 = DisplayObject(findFocusManagerComponent(InteractiveObject(_local2)));
var _local3 = "";
if ((_local2 is IFocusManagerGroup)){
_local8 = IFocusManagerGroup(_local2);
_local3 = _local8.groupName;
};
var _local4:int = getIndexOfFocusedObject(_local2);
var _local5:Boolean;
var _local6:int = _local4;
if (_local4 == -1){
if (_arg1){
_local4 = focusableCandidates.length;
};
_local5 = true;
};
var _local7:int = getIndexOfNextObject(_local4, _arg1, _local5, _local3);
return (findFocusManagerComponent(focusableCandidates[_local7]));
}
private function mouseDownHandler(_arg1:MouseEvent):void{
if (_arg1.isDefaultPrevented()){
return;
};
var _local2:InteractiveObject = getTopLevelFocusTarget(InteractiveObject(_arg1.target));
if (!_local2){
return;
};
showFocusIndicator = false;
if (((((!((_local2 == lastFocus))) || ((lastAction == "ACTIVATE")))) && (!((_local2 is TextField))))){
setFocus(_local2);
};
lastAction = "MOUSEDOWN";
}
private function isTabVisible(_arg1:DisplayObject):Boolean{
var _local2:DisplayObjectContainer = _arg1.parent;
while (((((_local2) && (!((_local2 is Stage))))) && (!(((_local2.parent) && ((_local2.parent is Stage))))))) {
if (!_local2.tabChildren){
return (false);
};
_local2 = _local2.parent;
};
return (true);
}
public function get nextTabIndex():int{
return (0);
}
private function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.TAB){
lastAction = "KEY";
if (calculateCandidates){
sortFocusableObjects();
calculateCandidates = false;
};
};
if (((((((defaultButtonEnabled) && ((_arg1.keyCode == Keyboard.ENTER)))) && (defaultButton))) && (defButton.enabled))){
sendDefaultButtonEvent();
};
}
private function focusInHandler(_arg1:FocusEvent):void{
var _local3:Button;
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
if (form.contains(_local2)){
lastFocus = findFocusManagerComponent(InteractiveObject(_local2));
if ((lastFocus is Button)){
_local3 = Button(lastFocus);
if (defButton){
defButton.emphasized = false;
defButton = _local3;
_local3.emphasized = true;
};
} else {
if (((defButton) && (!((defButton == _defaultButton))))){
defButton.emphasized = false;
defButton = _defaultButton;
_defaultButton.emphasized = true;
};
};
};
}
private function tabEnabledChangeHandler(_arg1:Event):void{
calculateCandidates = true;
var _local2:InteractiveObject = InteractiveObject(_arg1.target);
var _local3 = (focusableObjects[_local2] == true);
if (_local2.tabEnabled){
if (((!(_local3)) && (isTabVisible(_local2)))){
if (!(_local2 is IFocusManagerComponent)){
_local2.focusRect = false;
};
focusableObjects[_local2] = true;
};
} else {
if (_local3){
delete focusableObjects[_local2];
};
};
}
public function set showFocusIndicator(_arg1:Boolean):void{
_showFocusIndicator = _arg1;
}
public function get form():DisplayObjectContainer{
return (_form);
}
private function sortByTabIndex(_arg1:InteractiveObject, _arg2:InteractiveObject):int{
return (((_arg1.tabIndex > _arg2.tabIndex)) ? 1 : ((_arg1.tabIndex < _arg2.tabIndex)) ? -1 : sortByDepth(_arg1, _arg2));
}
public function get defaultButtonEnabled():Boolean{
return (_defaultButtonEnabled);
}
public function activate():void{
if (activated){
return;
};
form.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler, false, 0, true);
form.stage.addEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler, false, 0, true);
form.addEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.addEventListener(Event.ACTIVATE, activateHandler, false, 0, true);
form.stage.addEventListener(Event.DEACTIVATE, deactivateHandler, false, 0, true);
form.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = true;
if (lastFocus){
setFocus(lastFocus);
};
}
public function deactivate():void{
form.stage.removeEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, mouseFocusChangeHandler);
form.stage.removeEventListener(FocusEvent.KEY_FOCUS_CHANGE, keyFocusChangeHandler);
form.removeEventListener(FocusEvent.FOCUS_IN, focusInHandler, true);
form.removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler, true);
form.stage.removeEventListener(Event.ACTIVATE, activateHandler);
form.stage.removeEventListener(Event.DEACTIVATE, deactivateHandler);
form.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
form.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, true);
activated = false;
}
}
}//package fl.managers
Section 27
//IFocusManager (fl.managers.IFocusManager)
package fl.managers {
import fl.controls.*;
import flash.display.*;
public interface IFocusManager {
function getFocus():InteractiveObject;
function deactivate():void;
function set defaultButton(_arg1:Button):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(_arg1:InteractiveObject):InteractiveObject;
function get nextTabIndex():int;
function get defaultButton():Button;
function get showFocusIndicator():Boolean;
function hideFocus():void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function setFocus(_arg1:InteractiveObject):void;
function getNextFocusManagerComponent(_arg1:Boolean=false):InteractiveObject;
}
}//package fl.managers
Section 28
//IFocusManagerComponent (fl.managers.IFocusManagerComponent)
package fl.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package fl.managers
Section 29
//IFocusManagerGroup (fl.managers.IFocusManagerGroup)
package fl.managers {
public interface IFocusManagerGroup {
function get groupName():String;
function get selected():Boolean;
function set groupName(_arg1:String):void;
function set selected(_arg1:Boolean):void;
}
}//package fl.managers
Section 30
//StyleManager (fl.managers.StyleManager)
package fl.managers {
import fl.core.*;
import flash.utils.*;
import flash.text.*;
public class StyleManager {
private var classToInstancesDict:Dictionary;
private var globalStyles:Object;
private var styleToClassesHash:Object;
private var classToStylesDict:Dictionary;
private var classToDefaultStylesDict:Dictionary;
private static var _instance:StyleManager;
public function StyleManager(){
styleToClassesHash = {};
classToInstancesDict = new Dictionary(true);
classToStylesDict = new Dictionary(true);
classToDefaultStylesDict = new Dictionary(true);
globalStyles = UIComponent.getStyleDefinition();
}
public static function clearComponentStyle(_arg1:Object, _arg2:String):void{
var _local3:Class = getClassDef(_arg1);
var _local4:Object = getInstance().classToStylesDict[_local3];
if (((!((_local4 == null))) && (!((_local4[_arg2] == null))))){
delete _local4[_arg2];
invalidateComponentStyle(_local3, _arg2);
};
}
private static function getClassDef(_arg1:Object):Class{
var component = _arg1;
if ((component is Class)){
return ((component as Class));
};
try {
return ((getDefinitionByName(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
if ((component is UIComponent)){
try {
return ((component.loaderInfo.applicationDomain.getDefinition(getQualifiedClassName(component)) as Class));
} catch(e:Error) {
};
};
};
return (null);
}
public static function clearStyle(_arg1:String):void{
setStyle(_arg1, null);
}
public static function setComponentStyle(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Class = getClassDef(_arg1);
var _local5:Object = getInstance().classToStylesDict[_local4];
if (_local5 == null){
_local5 = (getInstance().classToStylesDict[_local4] = {});
};
if (_local5 == _arg3){
return;
};
_local5[_arg2] = _arg3;
invalidateComponentStyle(_local4, _arg2);
}
private static function setSharedStyles(_arg1:UIComponent):void{
var _local5:String;
var _local2:StyleManager = getInstance();
var _local3:Class = getClassDef(_arg1);
var _local4:Object = _local2.classToDefaultStylesDict[_local3];
for (_local5 in _local4) {
_arg1.setSharedStyle(_local5, getSharedStyle(_arg1, _local5));
};
}
public static function getComponentStyle(_arg1:Object, _arg2:String):Object{
var _local3:Class = getClassDef(_arg1);
var _local4:Object = getInstance().classToStylesDict[_local3];
return (((_local4)==null) ? null : _local4[_arg2]);
}
private static function getInstance(){
if (_instance == null){
_instance = new (StyleManager);
};
return (_instance);
}
private static function invalidateComponentStyle(_arg1:Class, _arg2:String):void{
var _local4:Object;
var _local5:UIComponent;
var _local3:Dictionary = getInstance().classToInstancesDict[_arg1];
if (_local3 == null){
return;
};
for (_local4 in _local3) {
_local5 = (_local4 as UIComponent);
if (_local5 == null){
} else {
_local5.setSharedStyle(_arg2, getSharedStyle(_local5, _arg2));
};
};
}
private static function invalidateStyle(_arg1:String):void{
var _local3:Object;
var _local2:Dictionary = getInstance().styleToClassesHash[_arg1];
if (_local2 == null){
return;
};
for (_local3 in _local2) {
invalidateComponentStyle(Class(_local3), _arg1);
};
}
public static function registerInstance(_arg1:UIComponent):void{
var target:Class;
var defaultStyles:Object;
var styleToClasses:Object;
var n:String;
var instance = _arg1;
var inst:StyleManager = getInstance();
var classDef:Class = getClassDef(instance);
if (classDef == null){
return;
};
if (inst.classToInstancesDict[classDef] == null){
inst.classToInstancesDict[classDef] = new Dictionary(true);
target = classDef;
while (defaultStyles == null) {
if (target["getStyleDefinition"] != null){
defaultStyles = target["getStyleDefinition"]();
break;
};
try {
target = (instance.loaderInfo.applicationDomain.getDefinition(getQualifiedSuperclassName(target)) as Class);
} catch(err:Error) {
try {
target = (getDefinitionByName(getQualifiedSuperclassName(target)) as Class);
} catch(e:Error) {
defaultStyles = UIComponent.getStyleDefinition();
break;
};
};
};
styleToClasses = inst.styleToClassesHash;
for (n in defaultStyles) {
if (styleToClasses[n] == null){
styleToClasses[n] = new Dictionary(true);
};
styleToClasses[n][classDef] = true;
};
inst.classToDefaultStylesDict[classDef] = defaultStyles;
if (inst.classToStylesDict[classDef] == null){
inst.classToStylesDict[classDef] = {};
};
};
inst.classToInstancesDict[classDef][instance] = true;
setSharedStyles(instance);
}
public static function getStyle(_arg1:String):Object{
return (getInstance().globalStyles[_arg1]);
}
private static function getSharedStyle(_arg1:UIComponent, _arg2:String):Object{
var _local3:Class = getClassDef(_arg1);
var _local4:StyleManager = getInstance();
var _local5:Object = _local4.classToStylesDict[_local3][_arg2];
if (_local5 != null){
return (_local5);
};
_local5 = _local4.globalStyles[_arg2];
if (_local5 != null){
return (_local5);
};
return (_local4.classToDefaultStylesDict[_local3][_arg2]);
}
public static function setStyle(_arg1:String, _arg2:Object):void{
var _local3:Object = getInstance().globalStyles;
if ((((_local3[_arg1] === _arg2)) && (!((_arg2 is TextFormat))))){
return;
};
_local3[_arg1] = _arg2;
invalidateStyle(_arg1);
}
}
}//package fl.managers
Section 31
//MatrixTransformer (fl.motion.MatrixTransformer)
package fl.motion {
import flash.geom.*;
public class MatrixTransformer {
public static function getSkewY(_arg1:Matrix):Number{
return ((Math.atan2(_arg1.b, _arg1.a) * (180 / Math.PI)));
}
public static function getScaleX(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.a * _arg1.a) + (_arg1.b * _arg1.b))));
}
public static function getScaleY(_arg1:Matrix):Number{
return (Math.sqrt(((_arg1.c * _arg1.c) + (_arg1.d * _arg1.d))));
}
public static function setSkewXRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getScaleY(_arg1);
_arg1.c = (-(_local3) * Math.sin(_arg2));
_arg1.d = (_local3 * Math.cos(_arg2));
}
public static function setRotation(_arg1:Matrix, _arg2:Number):void{
setRotationRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function rotateAroundInternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Point = new Point(_arg2, _arg3);
_local5 = _arg1.transformPoint(_local5);
_arg1.tx = (_arg1.tx - _local5.x);
_arg1.ty = (_arg1.ty - _local5.y);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _local5.x);
_arg1.ty = (_arg1.ty + _local5.y);
}
public static function setSkewX(_arg1:Matrix, _arg2:Number):void{
setSkewXRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function setSkewY(_arg1:Matrix, _arg2:Number):void{
setSkewYRadians(_arg1, (_arg2 * (Math.PI / 180)));
}
public static function setScaleX(_arg1:Matrix, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local3:Number = getScaleX(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.a = (_arg1.a * _local4);
_arg1.b = (_arg1.b * _local4);
} else {
_local5 = getSkewYRadians(_arg1);
_arg1.a = (Math.cos(_local5) * _arg2);
_arg1.b = (Math.sin(_local5) * _arg2);
};
}
public static function setScaleY(_arg1:Matrix, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local3:Number = getScaleY(_arg1);
if (_local3){
_local4 = (_arg2 / _local3);
_arg1.c = (_arg1.c * _local4);
_arg1.d = (_arg1.d * _local4);
} else {
_local5 = getSkewXRadians(_arg1);
_arg1.c = (-(Math.sin(_local5)) * _arg2);
_arg1.d = (Math.cos(_local5) * _arg2);
};
}
public static function setRotationRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getRotationRadians(_arg1);
var _local4:Number = getSkewXRadians(_arg1);
setSkewXRadians(_arg1, ((_local4 + _arg2) - _local3));
setSkewYRadians(_arg1, _arg2);
}
public static function setSkewYRadians(_arg1:Matrix, _arg2:Number):void{
var _local3:Number = getScaleX(_arg1);
_arg1.a = (_local3 * Math.cos(_arg2));
_arg1.b = (_local3 * Math.sin(_arg2));
}
public static function getSkewX(_arg1:Matrix):Number{
return ((Math.atan2(-(_arg1.c), _arg1.d) * (180 / Math.PI)));
}
public static function getSkewYRadians(_arg1:Matrix):Number{
return (Math.atan2(_arg1.b, _arg1.a));
}
public static function getSkewXRadians(_arg1:Matrix):Number{
return (Math.atan2(-(_arg1.c), _arg1.d));
}
public static function getRotation(_arg1:Matrix):Number{
return ((getRotationRadians(_arg1) * (180 / Math.PI)));
}
public static function rotateAroundExternalPoint(_arg1:Matrix, _arg2:Number, _arg3:Number, _arg4:Number):void{
_arg1.tx = (_arg1.tx - _arg2);
_arg1.ty = (_arg1.ty - _arg3);
_arg1.rotate((_arg4 * (Math.PI / 180)));
_arg1.tx = (_arg1.tx + _arg2);
_arg1.ty = (_arg1.ty + _arg3);
}
public static function getRotationRadians(_arg1:Matrix):Number{
return (getSkewYRadians(_arg1));
}
public static function matchInternalPointWithExternal(_arg1:Matrix, _arg2:Point, _arg3:Point):void{
var _local4:Point = _arg1.transformPoint(_arg2);
var _local5:Number = (_arg3.x - _local4.x);
var _local6:Number = (_arg3.y - _local4.y);
_arg1.tx = (_arg1.tx + _local5);
_arg1.ty = (_arg1.ty + _local6);
}
}
}//package fl.motion
Section 32
//wav (GunnerShoot.wav)
package GunnerShoot {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package GunnerShoot
Section 33
//wav (GunShoot1.wav)
package GunShoot1 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package GunShoot1
Section 34
//wav (GunShoot2.wav)
package GunShoot2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package GunShoot2
Section 35
//wav (GunShoot3.wav)
package GunShoot3 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package GunShoot3
Section 36
//wav (LaserShoot1.wav)
package LaserShoot1 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package LaserShoot1
Section 37
//wav (LaserShoot2.wav)
package LaserShoot2 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package LaserShoot2
Section 38
//wav (LaserShoot3.wav)
package LaserShoot3 {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package LaserShoot3
Section 39
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
}
}//package mochi.as3
Section 40
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function reencode():void{
var _local1:uint = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function toString():String{
var _local1:String = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function get value():Number{
return (Number(this.toString()));
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 41
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 42
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local4:Object;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 43
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
var _local2:Object = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 44
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var methodName:String;
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = _clip._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
methodName = "";
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local4:int;
var _local14:Loader;
var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
var _local6:Array = [0, 64, 0, 0, 0];
var _local7:MovieClip = new MovieClip();
var _local8:LocalConnection = new LocalConnection();
var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
var _local10:ByteArray = new ByteArray();
var _local11:ByteArray = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
var _local12:uint = ((_local3.length + _local11.length) + 4);
var _local13:uint = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var avm1Click:DisplayObject;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
var vars:Object = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
var s = "?";
var i:Number = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
var _local2:Rectangle = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
var _local3:Number = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.3 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String = _arg1.target;
var _local3:String = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
var _local2:Object = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var clip = _arg1;
loader = new Loader();
var mochiLCURL:String = (_servURL + _mochiLC);
var req:URLRequest = new URLRequest(mochiLCURL);
var complete:Function = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
var _local4:String = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
var _local5:URLRequest = new URLRequest(_local4);
var _local6:URLVariables = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
var mc:MovieClip = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 45
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
if (_syncContainer[_arg1] == _arg2){
return;
};
var _local3:String = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
}
}//package mochi.as3
Section 46
//wav (Newgun.wav)
package Newgun {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package Newgun
Section 47
//png (particle14.png)
package particle14 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle14
Section 48
//png (particle15.png)
package particle15 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle15
Section 49
//png (particle16.png)
package particle16 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle16
Section 50
//png (particle2.png)
package particle2 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle2
Section 51
//png (particle3.png)
package particle3 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle3
Section 52
//png (particle4.png)
package particle4 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle4
Section 53
//png (particle5.png)
package particle5 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle5
Section 54
//png (particle6.png)
package particle6 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle6
Section 55
//png (particle7.png)
package particle7 {
import flash.display.*;
public dynamic class png extends BitmapData {
public function png(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package particle7
Section 56
//brif_68 (StarFighter_fla.brif_68)
package StarFighter_fla {
import flash.display.*;
import flash.events.*;
public dynamic class brif_68 extends MovieClip {
public var bLounch:SimpleButton;
public var n:int;
public var bOK:SimpleButton;
public function brif_68(){
addFrameScript(19, frame20, 60, frame61, 77, frame78, 78, frame79, 94, frame95, 100, frame101);
}
function frame101(){
stop();
}
function frame61(){
stop();
}
function frame20(){
n = 2;
bOK.addEventListener(MouseEvent.CLICK, goNext);
}
function frame78(){
stop();
}
function frame79(){
bLounch.addEventListener(MouseEvent.CLICK, goPlay);
}
function frame95(){
stop();
}
public function goNext(_arg1:MouseEvent):void{
gotoAndPlay(("part" + n));
n++;
}
public function goPlay(_arg1:MouseEvent):void{
gotoAndPlay("lounch");
}
}
}//package StarFighter_fla
Section 57
//credits_64 (StarFighter_fla.credits_64)
package StarFighter_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class credits_64 extends MovieClip {
public var btnBored2:SimpleButton;
public var btnDG:SimpleButton;
public function credits_64(){
addFrameScript(0, frame1);
}
public function moreClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.bored.com");
navigateToURL(_local2, "_blank");
}
public function dgClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.dg-company.com");
navigateToURL(_local2, "_blank");
}
function frame1(){
btnBored2.addEventListener(MouseEvent.CLICK, moreClick);
btnDG.addEventListener(MouseEvent.CLICK, dgClick);
}
}
}//package StarFighter_fla
Section 58
//m002_71 (StarFighter_fla.m002_71)
package StarFighter_fla {
import flash.display.*;
public dynamic class m002_71 extends MovieClip {
public function m002_71(){
addFrameScript(119, frame120);
}
function frame120(){
stop();
}
}
}//package StarFighter_fla
Section 59
//wav (Take_power.wav)
package Take_power {
import flash.media.*;
public dynamic class wav extends Sound {
}
}//package Take_power
Section 60
//Avi (Avi)
package {
import dgparticles.*;
import flash.geom.*;
public class Avi extends BaseEnemy {
var head:Gun;
var stayTime:uint;
var portals:Array;
var changeWing:Boolean;
var previousPos:Point;
public function Avi(){
head = new Gun("aviHead");
portals = new Array();
previousPos = new Point();
super();
shootDelay = 20;
collideRadius = 65;
addChild(head);
head.y = -45;
bulletDamage = 10;
damage = 110;
healtY = -85;
healtX = -130;
healthLen = 210;
scores = 5000;
}
override public function update():void{
var _local1:AviBot;
var _local2:int;
super.update();
head.update();
portals[0].position = localToGlobal(new Point(60, -20));
portals[1].position = localToGlobal(new Point(80, -18));
portals[2].position = localToGlobal(new Point(100, -12));
portals[3].position = localToGlobal(new Point(120, -8));
portals[4].position = localToGlobal(new Point(135, 4));
portals[5].position = localToGlobal(new Point(-60, -20));
portals[6].position = localToGlobal(new Point(-80, -18));
portals[7].position = localToGlobal(new Point(-100, -12));
portals[8].position = localToGlobal(new Point(-120, -8));
portals[9].position = localToGlobal(new Point(-135, 4));
if (level.everyMs(1500)){
_local1 = new AviBot();
_local2 = (changeWing) ? -90 : 90;
_local1.position = localToGlobal(new Point(_local2, -15));
level.AddEnemy(_local1);
level.swapChildren(this, _local1);
changeWing = !(changeWing);
};
targetPoint.y = Utilites.Clamp(targetPoint.y, 90, 180);
if (((!(onPosition)) && (!((targetPoint.x == level.hero.x))))){
targetPoint.x = level.hero.x;
onPosition = false;
};
}
override public function initialize():void{
var _local1:int;
while (_local1 < 10) {
portals.push(level.particleSystem.createEmmiter("aviPortal", new Point()));
portals[_local1].settings.moveWithEmmiter = true;
_local1++;
};
}
override protected function makeShoot(_arg1:Point):void{
if (!Utilites.inRange(level.hero.x, (x - collideRadius), (x + collideRadius))){
return;
};
createBullet("none", (x + 30), (y + 60), _arg1, 10, "shootBlue", "recoshet", "flash");
createBullet("none", (x - 30), (y + 60), _arg1, 10, "shootBlue", "recoshet", "flash");
SoundManager.playOnce("Enemy_shoot.wav", 0.4);
}
override public function die():void{
var _local1:int;
while (_local1 < portals.length) {
level.particleSystem.killEmmiter((portals[_local1] as Emitter));
_local1++;
};
level.particleSystem.createEmmiter("explodeAvi", new Point(x, (y + collideRadius)));
level.addChild(new Effect(new wave(), x, (y + collideRadius), null));
level.particleSystem.createEmmiter("explodeAvi", new Point((x + collideRadius), (y + (collideRadius / 2))));
level.addChild(new Effect(new wave(), (x + collideRadius), (y + (collideRadius / 2)), null));
level.particleSystem.createEmmiter("explodeAvi", new Point((x - collideRadius), (y + (collideRadius / 2))));
level.addChild(new Effect(new wave(), (x - collideRadius), (y + (collideRadius / 2)), null));
SoundManager.playOnce("ExpLarge.wav", 0.5);
}
override protected function updateRotation():void{
}
}
}//package
Section 61
//AviBot (AviBot)
package {
import flash.geom.*;
public class AviBot extends BaseEnemy {
public function AviBot(){
moveSpeed = 4;
rotationSpeed = 5;
lookAtHero = true;
velocity = new Point(0, moveSpeed);
collideRadius = 15;
moveType = MoveTypes.ToMouse;
targetPoint = new Point();
onPosition = true;
health = 80;
healthLen = 30;
healtY = -22;
}
}
}//package
Section 62
//AviHead (AviHead)
package {
import flash.display.*;
public dynamic class AviHead extends MovieClip {
}
}//package
Section 63
//BaseEnemy (BaseEnemy)
package {
import flash.geom.*;
public class BaseEnemy extends SpaceObject {
protected var healtX:int;// = -20
protected var healtY:int;// = -20
public var attack:Boolean;// = true
protected var bulletDamage:Number;// = 5
protected var healthLen:Number;// = 40
public var bonus:Array;
protected var maxHealth:Number;
public var scores:int;// = 10
public var shootDelay:int;// = 100
private var collideCounter:int;
protected var canShoot:Boolean;// = false
protected var healthDrawTimer:int;
public var damage:int;// = 7
public var lookPoint:Point;
public var isBoss:Boolean;// = false
protected var _health:Number;// = -1
public function BaseEnemy(){
lookPoint = new Point();
super();
}
public function die():void{
SoundManager.playOnce("ExpSmall1.wav", 0.35);
var _local1 = "explodeYellow";
switch (level.hero.weaponLevel){
case 3:
_local1 = "explodeGreen";
break;
case 4:
_local1 = "explodeRed";
break;
case 5:
_local1 = "explodeBlue";
break;
};
level.particleSystem.createEmmiter(_local1, position);
}
protected function drawHealth():void{
level.emptyMC.graphics.beginFill(0);
level.emptyMC.graphics.drawRect((x + healtX), (y + healtY), healthLen, 2);
level.emptyMC.graphics.endFill();
level.emptyMC.graphics.beginFill(0xFF0000);
level.emptyMC.graphics.drawRect((x + healtX), (y + healtY), ((health * healthLen) / maxHealth), 2);
level.emptyMC.graphics.endFill();
}
override public function update():void{
super.update();
updateRotation();
updateShoot();
if (((((onPosition) && (!((moveType == MoveTypes.Kamikadze))))) && (!(Utilites.inRange(x, 0, 640))))){
targetPoint.x = Utilites.Clamp(x, 30, 610);
onPosition = false;
};
if (((onPosition) && ((y < 0)))){
targetPoint.y = 50;
onPosition = false;
};
if (healthDrawTimer > 0){
healthDrawTimer = (healthDrawTimer - level.elapsedMs);
drawHealth();
};
}
protected function createBullet(_arg1:String, _arg2, _arg3:int, _arg4:Point, _arg5:Number, _arg6, _arg7, _arg8:String):Bullet{
var _local9:Bullet = new Bullet(_arg1);
_local9.x = _arg2;
_local9.y = _arg3;
_local9.damage = bulletDamage;
_local9.velocity = Utilites.mulPoint(_arg4, _arg5);
level.AddEnemyBullet(_local9);
if (_arg6 != ""){
_local9.particleName = _arg6;
};
if (_arg7 != ""){
_local9.collideParticle = _arg7;
};
if (_arg8 != ""){
level.particleSystem.createEmmiter(_arg8, _local9.position);
};
if (_arg1 != "none"){
_local9.rotation = ((Math.atan2(_arg4.y, _arg4.x) * Utilites.RadToDeg) + 90);
};
return (_local9);
}
protected function updateShoot():void{
var _local1:Point;
if (((((((((!(attack)) || ((y < -(collideRadius))))) || ((y > 480)))) || ((x < -(collideRadius))))) || ((x > (640 + collideRadius))))){
return;
};
counter++;
if (counter >= shootDelay){
canShoot = true;
counter = 0;
};
if (canShoot){
canShoot = false;
_local1 = level.hero.position.subtract(position);
_local1.normalize(1);
makeShoot(_local1);
};
}
public function initialize():void{
}
public function get health():Number{
return (_health);
}
public function dispose():void{
}
protected function updateRotation():void{
var _local1:Number;
if (moveType == MoveTypes.Down){
return;
};
if (lookAtHero){
_local1 = ((90 + rotation) - Utilites.AngleBetweenPoints(level.hero.position, position));
} else {
_local1 = ((90 + rotation) - Utilites.AngleBetweenPoints(targetPoint, position));
};
if (_local1 > 180){
_local1 = (_local1 - 360);
} else {
if (_local1 < -180){
_local1 = (_local1 + 360);
};
};
if (Math.abs(_local1) < rotationSpeed){
this.rotation = (this.rotation - _local1);
} else {
this.rotation = (this.rotation + ((_local1)>0) ? -(rotationSpeed) : rotationSpeed);
};
}
override public function updateCollision(_arg1:CollisionObject):void{
super.updateCollision(_arg1);
if (((!((moveType == MoveTypes.Kamikadze))) && (!((moveType == MoveTypes.Down))))){
collideCounter++;
};
if (((!(onPosition)) && ((collideCounter > 5)))){
collideCounter = 0;
targetPoint.x = Utilites.Clamp((targetPoint.x + Utilites.RandomInt(-200, 200)), 50, 600);
targetPoint.y = Utilites.Clamp((targetPoint.y + Utilites.RandomInt(-200, 200)), 50, 200);
};
}
protected function makeShoot(_arg1:Point):void{
}
public function set health(_arg1:Number):void{
if (_health == -1){
maxHealth = _arg1;
};
_health = _arg1;
}
public function set showHealth(_arg1:Boolean):void{
healthDrawTimer = (_arg1) ? 2000 : 0;
}
}
}//package
Section 64
//BlackRectHide (BlackRectHide)
package {
import flash.display.*;
public dynamic class BlackRectHide extends MovieClip {
}
}//package
Section 65
//BlackRectHideShort (BlackRectHideShort)
package {
import flash.display.*;
public dynamic class BlackRectHideShort extends MovieClip {
}
}//package
Section 66
//BlackRectShow (BlackRectShow)
package {
import flash.display.*;
public dynamic class BlackRectShow extends MovieClip {
}
}//package
Section 67
//BlackRectShowShort (BlackRectShowShort)
package {
import flash.display.*;
public dynamic class BlackRectShowShort extends MovieClip {
}
}//package
Section 68
//BonusObject (BonusObject)
package {
import flash.display.*;
import flash.geom.*;
public class BonusObject extends SpaceObject {
public var bonusType:String;
public var count:Number;
public function BonusObject(_arg1, _arg2:int, _arg3:String){
var _local4:MovieClip;
super();
this.bonusType = _arg3;
this.x = _arg1;
this.y = _arg2;
collideRadius = 15;
velocity = new Point(0, 5);
targetPoint = new Point(_arg1, (Level.levelHeight + 100));
switch (_arg3){
case "health":
count = 25;
addChild(new Bubble("red"));
addChild(new Health());
_local4 = new TextHealth();
_local4.x = 10;
_local4.y = -27;
addChild(_local4);
break;
case "energy":
count = 25;
addChild(new Bubble("blue"));
addChild(new Energy());
_local4 = new TextEnergy();
_local4.x = 10;
_local4.y = -27;
addChild(_local4);
break;
case "cristal":
addChild(new Cristal());
_local4 = new TextCristal();
_local4.x = 10;
_local4.y = -25;
addChild(_local4);
break;
case "rage":
addChild(new Rage());
_local4 = new TextRage();
_local4.x = 10;
_local4.y = -27;
addChild(_local4);
break;
case "immortal":
addChild(new Immortal());
_local4 = new TextInvincible();
_local4.x = 10;
_local4.y = -27;
addChild(_local4);
break;
};
}
}
}//package
Section 69
//Boss (Boss)
package {
import flash.geom.*;
public class Boss extends BaseEnemy {
private var guns:Array;
var gunsType:String;
public function Boss(){
guns = new Array();
super();
collideRadius = 60;
rotationSpeed = 3;
shootDelay = 25;
damage = 200;
bulletDamage = 2;
healtY = -65;
healtX = -80;
healthLen = 110;
scores = 200;
}
override public function die():void{
level.particleSystem.createEmmiter("explodeBoss", position);
level.addChild(new Effect(new wave(), x, y, null));
SoundManager.playOnce("ExpLarge.wav", 0.5);
}
override protected function makeShoot(_arg1:Point):void{
var _local2:Point = localToGlobal(new Point(58, 0));
var _local3:String = ((gunsType)=="simple") ? "flash" : "";
createBullet("none", _local2.x, _local2.y, _arg1, 10, "shootGreen", "recoshet", "flash");
_local2 = localToGlobal(new Point(-58, 0));
createBullet("none", _local2.x, _local2.y, _arg1, 10, "shootGreen", "recoshet", "flash");
_local2 = localToGlobal(new Point(40, 25));
createBullet("none", _local2.x, _local2.y, _arg1, 10, "shootGreen", "recoshet", "flash");
_local2 = localToGlobal(new Point(-40, 25));
createBullet("none", _local2.x, _local2.y, _arg1, 10, "shootGreen", "recoshet", "flash");
SoundManager.playOnce("BossLaser1.wav", 0.5);
}
public function setGuns(_arg1:String):void{
if (guns.length > 0){
return;
};
gunsType = _arg1;
addGun(80, 10, _arg1);
addGun(-80, 10, _arg1);
}
override public function update():void{
var _local1:int;
super.update();
if (y > -50){
_local1 = 0;
while (_local1 < guns.length) {
guns[_local1].update();
_local1++;
};
};
}
private function addGun(_arg1, _arg2:int, _arg3:String):void{
var _local4:Gun = new Gun(_arg3);
_local4.shootDelay = shootDelay;
_local4.x = _arg1;
_local4.y = _arg2;
guns.push(_local4);
addChild(_local4);
}
}
}//package
Section 70
//bossMusic (bossMusic)
package {
import flash.media.*;
public dynamic class bossMusic extends Sound {
}
}//package
Section 71
//Bubble (Bubble)
package {
import flash.display.*;
import flash.geom.*;
public class Bubble extends MovieClip {
public function Bubble(_arg1:String){
var _local2:ColorTransform = this.transform.colorTransform;
switch (_arg1){
case "blue":
_local2.blueOffset = 500;
_local2.redOffset = -50;
_local2.greenOffset = -50;
break;
case "red":
_local2.redOffset = 500;
_local2.blueOffset = -50;
_local2.greenOffset = -50;
break;
};
this.transform.colorTransform = _local2;
}
}
}//package
Section 72
//Bug (Bug)
package {
import flash.geom.*;
public class Bug extends BaseEnemy {
public function Bug(){
collideRadius = 18;
bulletDamage = 5;
rotationSpeed = 8;
shootDelay = 60;
counter = Utilites.RandomInt(0, shootDelay);
healthLen = 30;
scores = 30;
}
override protected function makeShoot(_arg1:Point):void{
var _local2:Point = localToGlobal(new Point(0, 15));
createBullet("none", _local2.x, _local2.y, _arg1, 10, "shootBubble", "shootFlashBlue", "flashCs").isEnergy = true;
SoundManager.playOnce("Enemy_shoot.wav", 0.4);
}
}
}//package
Section 73
//Bullet (Bullet)
package {
import dgparticles.*;
import flash.geom.*;
public class Bullet extends CollisionObject {
public var collideParticle:String;
public var emitter:Emitter;
public var damage:Number;// = 10
public var isEnergy:Boolean;// = false
public function Bullet(_arg1:String){
collideRadius = ((_arg1)=="simple") ? 2 : 5;
gotoAndStop(_arg1);
}
public function set particleName(_arg1:String):void{
if (emitter != null){
emitter.settings = level.particleSystem.getSettingsByName(_arg1).clone();
return;
};
emitter = level.particleSystem.createEmmiter(_arg1, new Point(x, y));
}
public function doCollision():void{
if (collideParticle != null){
level.particleSystem.createEmmiter(collideParticle, new Point(x, y));
};
}
public function get position():Point{
return (new Point(x, y));
}
protected function get level():Level{
return ((parent as Level));
}
override public function update():void{
x = (x + velocity.x);
y = (y + velocity.y);
if (emitter != null){
emitter.position.x = x;
emitter.position.y = y;
};
}
}
}//package
Section 74
//CheckBox_disabledIcon (CheckBox_disabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_disabledIcon extends MovieClip {
}
}//package
Section 75
//CheckBox_downIcon (CheckBox_downIcon)
package {
import flash.display.*;
public dynamic class CheckBox_downIcon extends MovieClip {
}
}//package
Section 76
//CheckBox_overIcon (CheckBox_overIcon)
package {
import flash.display.*;
public dynamic class CheckBox_overIcon extends MovieClip {
}
}//package
Section 77
//CheckBox_selectedDisabledIcon (CheckBox_selectedDisabledIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDisabledIcon extends MovieClip {
}
}//package
Section 78
//CheckBox_selectedDownIcon (CheckBox_selectedDownIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedDownIcon extends MovieClip {
}
}//package
Section 79
//CheckBox_selectedOverIcon (CheckBox_selectedOverIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedOverIcon extends MovieClip {
}
}//package
Section 80
//CheckBox_selectedUpIcon (CheckBox_selectedUpIcon)
package {
import flash.display.*;
public dynamic class CheckBox_selectedUpIcon extends MovieClip {
}
}//package
Section 81
//CheckBox_upIcon (CheckBox_upIcon)
package {
import flash.display.*;
public dynamic class CheckBox_upIcon extends MovieClip {
}
}//package
Section 82
//CollisionObject (CollisionObject)
package {
import flash.display.*;
import flash.geom.*;
public class CollisionObject extends MovieClip {
public var collideRadius:Number;
public var velocity:Point;
private var delta:Number;// = 5
private var dir:Point;
public function CollisionObject(){
dir = new Point();
super();
}
public function update():void{
}
public function updateCollision(_arg1:CollisionObject):void{
dir.x = (x - _arg1.x);
dir.y = (y - _arg1.y);
var _local2:Number = dir.length;
var _local3:Number = (collideRadius + _arg1.collideRadius);
var _local4:Number = (_local3 - _local2);
dir.normalize((delta * _local4));
velocity.x = (velocity.x + (dir.x / collideRadius));
velocity.y = (velocity.y + (dir.y / collideRadius));
_arg1.velocity.x = (_arg1.velocity.x - (dir.x / _arg1.collideRadius));
_arg1.velocity.y = (_arg1.velocity.y - (dir.y / _arg1.collideRadius));
}
}
}//package
Section 83
//Cristal (Cristal)
package {
import flash.display.*;
public dynamic class Cristal extends MovieClip {
}
}//package
Section 84
//Cs (Cs)
package {
import flash.geom.*;
public class Cs extends BaseEnemy {
public function Cs(){
collideRadius = 23;
bulletDamage = 4;
rotationSpeed = 8;
shootDelay = 60;
counter = Utilites.RandomInt(0, shootDelay);
healthLen = 30;
healtY = -28;
scores = 20;
}
override protected function makeShoot(_arg1:Point):void{
var _local2:Point = localToGlobal(new Point(0, 20));
createBullet("none", _local2.x, _local2.y, _arg1, 10, "csShoot", "shootFlashBlue", "flashCs");
SoundManager.playOnce("Enemy_shoot.wav", 0.4);
}
}
}//package
Section 85
//DGSound (DGSound)
package {
import flash.media.*;
public class DGSound {
var channel:SoundChannel;
var position:Number;// = 0
var loops:int;
public var sound:Sound;
var volume:Number;// = 1
public function DGSound(_arg1:Sound){
this.sound = _arg1;
}
public function get played():Boolean{
return (((channel.position + 500) > sound.length));
}
public function get transform():SoundTransform{
return (channel.soundTransform);
}
public function resume():void{
channel = sound.play(position, loops, new SoundTransform(volume));
}
public function stop():void{
channel.stop();
position = 0;
}
public function set transform(_arg1:SoundTransform):void{
channel.soundTransform = _arg1;
}
public function play(_arg1:int, _arg2:Number):void{
position = 0;
this.volume = _arg2;
this.loops = _arg1;
channel = sound.play(0, _arg1, new SoundTransform(_arg2));
}
public function pause():void{
position = channel.position;
channel.stop();
}
}
}//package
Section 86
//Effect (Effect)
package {
import flash.display.*;
import flash.events.*;
public class Effect extends MovieClip {
var func:Function;
var mc:MovieClip;
public function Effect(_arg1:MovieClip, _arg2, _arg3:int, _arg4:Function){
this.mc = _arg1;
this.func = _arg4;
_arg1.x = _arg2;
_arg1.y = _arg3;
addChild(_arg1);
_arg1.addEventListener(Event.ENTER_FRAME, animate);
}
private function animate(_arg1:Event):void{
if (mc.currentFrame == mc.totalFrames){
mc.removeEventListener(Event.ENTER_FRAME, animate);
parent.removeChild(this);
if (func != null){
func();
};
};
}
}
}//package
Section 87
//Enemy_nlo (Enemy_nlo)
package {
import flash.display.*;
public dynamic class Enemy_nlo extends BitmapData {
public function Enemy_nlo(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 88
//Energy (Energy)
package {
import flash.display.*;
public dynamic class Energy extends MovieClip {
}
}//package
Section 89
//fipMusic (fipMusic)
package {
import flash.media.*;
public dynamic class fipMusic extends Sound {
}
}//package
Section 90
//fixator (fixator)
package {
import flash.media.*;
public dynamic class fixator extends Sound {
}
}//package
Section 91
//focusRectSkin (focusRectSkin)
package {
import flash.display.*;
public dynamic class focusRectSkin extends MovieClip {
}
}//package
Section 92
//FpsCounter (FpsCounter)
package {
import flash.display.*;
import flash.events.*;
public class FpsCounter {
private var fpsCounter:int;
private var stage:Stage;
private var lastTime:Number;
private var timeCounter:int;
public static var fps:int;
public function FpsCounter(_arg1:Stage){
this.stage = _arg1;
_arg1.addEventListener(Event.ENTER_FRAME, update);
}
public function dispose():void{
stage.removeEventListener(Event.ENTER_FRAME, update);
}
private function update(_arg1:Event):void{
var _local2:Number = new Date().time;
var _local3:Number = (_local2 - lastTime);
lastTime = _local2;
fpsCounter = (fpsCounter + 1);
timeCounter = (timeCounter + _local3);
if (timeCounter > 1000){
timeCounter = (timeCounter - 1000);
fps = fpsCounter;
fpsCounter = 0;
};
}
}
}//package
Section 93
//Gun (Gun)
package {
import flash.geom.*;
public class Gun extends BaseEnemy {
private var type:String;
public function Gun(_arg1:String){
this.type = _arg1;
rotationSpeed = 4;
collideRadius = 15;
lookAtHero = true;
onPosition = true;
velocity = new Point();
targetPoint = new Point();
if (_arg1 == "aviHead"){
addChild(new AviHead());
} else {
if (_arg1 == "simple"){
addChild(new Gun1());
bulletDamage = 2;
} else {
addChild(new Gun2());
bulletDamage = 3;
};
};
}
override public function get position():Point{
return (this.localToGlobal(new Point(0, 0)));
}
override protected function makeShoot(_arg1:Point):void{
var _local2:*;
var _local3:int;
_arg1 = Utilites.directionFromAngle(((parent.rotation + rotation) - 90));
if (type == "aviHead"){
_local2 = (position.x + (20 * Math.cos(((parent.rotation + rotation) * Utilites.DegToRad))));
_local3 = (position.y + (20 * Math.sin(((parent.rotation + rotation) * Utilites.DegToRad))));
createBullet("none", _local2, _local3, _arg1, 15, "shootAviHead", "collideAviHead", "shootFlash");
SoundManager.playOnce("BossLaser1.wav", 0.5);
} else {
if (type == "simple"){
_local2 = (position.x + (15 * Math.cos(((parent.rotation + rotation) * Utilites.DegToRad))));
_local3 = (position.y + (15 * Math.sin(((parent.rotation + rotation) * Utilites.DegToRad))));
createBullet("blue2", _local2, _local3, _arg1, 10, "", "shootFlashBlue", "shootFlashBlue");
} else {
_local2 = (position.x + (20 * Math.cos(((parent.rotation + rotation) * Utilites.DegToRad))));
_local3 = (position.y + (20 * Math.sin(((parent.rotation + rotation) * Utilites.DegToRad))));
createBullet("none", _local2, _local3, _arg1, 10, "shootBlueBoss", "shootFlashBlue", "");
};
};
}
override public function get level():Level{
return ((parent as BaseEnemy).level);
}
override protected function updateShoot():void{
var _local1:Point;
counter++;
if (counter == shootDelay){
canShoot = true;
counter = 0;
};
if (canShoot){
canShoot = false;
_local1 = level.hero.position.subtract(position);
_local1.normalize(1);
makeShoot(_local1);
};
}
override protected function updateRotation():void{
if (lookAtHero){
lookPoint.x = level.hero.x;
lookPoint.y = level.hero.y;
};
var _local1:Number = ((parent.rotation + rotation) - Utilites.AngleBetweenPoints(lookPoint, position));
if (_local1 > 180){
_local1 = (-360 + _local1);
} else {
if (_local1 < -180){
_local1 = (360 + _local1);
};
};
if (Math.abs(_local1) < rotationSpeed){
this.rotation = (this.rotation - _local1);
} else {
if (_local1 > 0){
this.rotation = (this.rotation - rotationSpeed);
} else {
this.rotation = (this.rotation + rotationSpeed);
};
};
}
override public function update():void{
updateRotation();
updateShoot();
}
}
}//package
Section 94
//Gun1 (Gun1)
package {
import flash.display.*;
public dynamic class Gun1 extends MovieClip {
}
}//package
Section 95
//Gun2 (Gun2)
package {
import flash.display.*;
public dynamic class Gun2 extends MovieClip {
}
}//package
Section 96
//Gunner (Gunner)
package {
import flash.geom.*;
import flash.events.*;
public class Gunner extends BaseEnemy {
protected var shootCount:int;
public function Gunner(){
addFrameScript(0, frame1);
collideRadius = 25;
rotationSpeed = 8;
shootDelay = 50;
bulletDamage = 2;
counter = Utilites.RandomInt(0, shootDelay);
addEventListener(Event.ENTER_FRAME, makeShoot2);
healtY = -30;
healtX = -35;
scores = 50;
damage = 20;
}
override protected function makeShoot(_arg1:Point):void{
play();
}
function frame1(){
stop();
}
override public function dispose():void{
removeEventListener(Event.ENTER_FRAME, makeShoot2);
}
protected function makeShoot2(_arg1:Event):void{
var _local2:Point;
var _local3:Point;
if (currentFrame == 2){
_local2 = Utilites.directionFromAngle(rotation);
_local3 = localToGlobal(new Point(18, 21));
createBullet("simple", _local3.x, _local3.y, _local2, 10, "", "shootFlash", "shootFlash").scaleY = 0.8;
_local3 = localToGlobal(new Point(-18, 21));
createBullet("simple", _local3.x, _local3.y, _local2, 10, "", "shootFlash", "shootFlash").scaleY = 0.8;
shootCount++;
if (shootCount == 3){
shootCount = 0;
};
SoundManager.playOnce("GunnerShoot.wav", 0.3);
};
}
override public function update():void{
super.update();
if (shootCount > 0){
play();
};
}
override public function die():void{
super.die();
dispose();
}
}
}//package
Section 97
//GunnerBig (GunnerBig)
package {
import flash.geom.*;
import flash.events.*;
public class GunnerBig extends Gunner {
public function GunnerBig(){
collideRadius = 30;
healtY = -40;
healtX = -50;
healthLen = 60;
scores = 100;
damage = 200;
bulletDamage = 3;
}
override protected function makeShoot2(_arg1:Event):void{
var _local2:Point;
var _local3:Point;
if (currentFrame == 2){
_local2 = Utilites.directionFromAngle(rotation);
_local3 = localToGlobal(new Point(20, 25));
createBullet("simple", _local3.x, _local3.y, _local2, 10, "", "shootFlash", "shootFlash").scaleY = 0.8;
_local3 = localToGlobal(new Point(-20, 25));
createBullet("simple", _local3.x, _local3.y, _local2, 10, "", "shootFlash", "shootFlash").scaleY = 0.8;
shootCount++;
if (shootCount == 5){
shootCount = 0;
};
SoundManager.playOnce("GunnerShoot.wav", 0.3);
};
}
}
}//package
Section 98
//Health (Health)
package {
import flash.display.*;
public dynamic class Health extends MovieClip {
}
}//package
Section 99
//HelpBot (HelpBot)
package {
public class HelpBot extends BaseEnemy {
var timeToAttack:int;// = 5000
private var moveToHero:Boolean;
public function HelpBot(){
addFrameScript(5, frame6);
super();
collideRadius = 10;
rotationSpeed = 10;
moveSpeed = 3;
damage = 5;
healthLen = 15;
healtY = -17;
healtX = -15;
}
function frame6(){
gotoAndPlay(1);
}
override public function update():void{
super.update();
timeToAttack = (timeToAttack - level.elapsedMs);
if (((moveToHero) && ((currentFrame == 4)))){
gotoAndPlay(7);
};
if (((((attack) && (!(moveToHero)))) && ((timeToAttack <= 0)))){
moveToHero = true;
onPosition = true;
waypoints = null;
moveType = MoveTypes.ToMouse;
};
}
override public function die():void{
super.die();
}
}
}//package
Section 100
//Hero (Hero)
package {
import flash.display.*;
import dgparticles.*;
import flash.geom.*;
import flash.events.*;
import flash.ui.*;
public class Hero extends CollisionObject {
public var lives:int;// = 3
public var energy:Number;// = 100
private var blinkDirection:Boolean;
private var weaponUpgrades:Array;
public var isRage:Boolean;
public var scoresToLife:int;
public var blinkCount:int;// = 0
private var cristalsCnt:uint;// = 0
private var shootDelay:int;// = 8
private var canShoot:Boolean;// = true
var bitmap:Bitmap;
private var counter2:int;// = 0
private var blinkProgress:int;// = 5
public var weaponLevel:uint;
private var livesIkons:Array;
public var emSoplo:Emitter;
private var isMouseDown:Boolean;
public var health:Number;// = 100
var rect:Rectangle;
private var animDirection:int;// = 0
private var ct:ColorTransform;
var bmd:BitmapData;
private var counter:int;// = 0
public var isImmortal:Boolean;
public function Hero(){
weaponUpgrades = [3, 9, 14, 20, 24];
livesIkons = new Array();
rect = new Rectangle(0, 0, 76, 62);
bmd = new Hero2(76, 62);
bitmap = new Bitmap(new BitmapData(76, 62));
ct = new ColorTransform();
super();
}
public function die():void{
level.particleSystem.createEmmiter("explodeHero", position);
SoundManager.playOnce("ExpLarge.wav", 0.6);
decLives();
if (lives > 0){
blinkCount = 9;
health = 100;
energy = 100;
} else {
visible = false;
};
}
public function get cristalsCount():int{
return (cristalsCnt);
}
private function updateShoot():void{
var _local1:Point;
if (isRage){
counter2++;
if (counter2 > (30 * 6)){
isRage = false;
counter2 = 0;
};
};
if (isImmortal){
counter2++;
if (counter2 > (30 * 3)){
ct.redOffset = (transform.colorTransform.redOffset - 2);
} else {
ct.redOffset = 150;
};
transform.colorTransform = ct;
if (counter2 > (30 * 6)){
isImmortal = false;
counter2 = 0;
transform.colorTransform = new ColorTransform();
};
if (level.everyMs(90)){
_local1 = new Point((x + Utilites.RandomInt(-20, 20)), (y + Utilites.RandomInt(-20, 20)));
level.particleSystem.createEmmiter("heroImmortal", _local1);
};
};
if (energy < 100){
energy = (energy + (level.isAnimLevelUp) ? 0.3 : 0.1);
};
if (energy < 0){
energy = 0;
};
if (!isMouseDown){
canShoot = true;
counter = 0;
return;
};
counter++;
if (counter >= shootDelay){
canShoot = true;
counter = 0;
};
if (((canShoot) && ((energy >= 2)))){
canShoot = false;
makeShoot();
Mouse.hide();
};
}
private function get level():Level{
return ((parent as Level));
}
public function set cristalsCount(_arg1:int):void{
cristalsCnt = _arg1;
if ((((weaponUpgrades[weaponLevel] == cristalsCount)) && ((weaponLevel < 5)))){
weaponLevel++;
level.addChild(new Effect(new TextWeaponUpgraded(), 320, 240, null));
};
}
private function makeBlink():void{
blinkProgress = (blinkProgress + (blinkDirection) ? 1 : -1);
if ((((blinkProgress > 15)) || ((blinkProgress < 5)))){
blinkDirection = !(blinkDirection);
blinkCount--;
};
if (blinkCount == 0){
transform.colorTransform = new ColorTransform();
} else {
transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, (-(blinkProgress) * 10));
};
}
private function mouseUp(_arg1:MouseEvent):void{
isMouseDown = false;
}
public function decLives():void{
lives--;
var _local1:int = (livesIkons.length - 1);
if (_local1 < 0){
return;
};
level.removeChild(livesIkons[_local1]);
livesIkons.splice(_local1, 1);
}
public function initialize():void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, move);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
collideRadius = 30;
emSoplo = level.particleSystem.createEmmiter("soplo", new Point(stage.mouseX, (stage.mouseY + 32)));
velocity = new Point();
bitmap.x = -46;
bitmap.y = -31;
addChild(bitmap);
}
public function get position():Point{
return (new Point(x, y));
}
private function createBullet(_arg1:String, _arg2, _arg3:int, _arg4, _arg5:Number):void{
var _local6:Bullet = new Bullet(_arg1);
_local6.x = _arg2;
_local6.y = _arg3;
_local6.rotation = _arg4;
var _local7:Number = (_arg4 * Utilites.DegToRad);
_local6.velocity = new Point((15 * Math.sin(_local7)), (-15 * Math.cos(_local7)));
_local6.damage = _arg5;
level.AddHeroBullet(_local6);
switch (_arg1){
case "simple":
_local6.collideParticle = "shootFlash";
break;
case "green":
_local6.collideParticle = "shootFlashGreen";
break;
case "red":
_local6.collideParticle = "shootFlashRed";
break;
case "blue":
_local6.collideParticle = "shootFlashBlue";
break;
case "yellow":
_local6.collideParticle = "shootFlashBrown";
break;
};
}
public function dispose():void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, move);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
level.particleSystem.killEmmiter(emSoplo);
isMouseDown = false;
}
public function incLives():void{
var _local1:* = new LiveIkon();
_local1.x = 624;
_local1.y = (85 + (livesIkons.length * 30));
livesIkons.push(_local1);
level.addChild(_local1);
}
override public function update():void{
velocity.x = ((stage.mouseX - x) * 0.6);
velocity.y = ((stage.mouseY - y) * 0.6);
x = (x + velocity.x);
y = (y + velocity.y);
emSoplo.position.x = (x + 1);
emSoplo.position.y = (y + 32);
if ((((animDirection == 1)) && ((rect.x < 2208)))){
rect.x = (rect.x + 92);
} else {
if ((((animDirection == -1)) && ((rect.x > 0)))){
rect.x = (rect.x - 92);
};
};
if (rect.x < 1196){
animDirection = 1;
} else {
if (rect.x > 1196){
animDirection = -1;
} else {
animDirection = 0;
};
};
if (Level.heroScores >= scoresToLife){
incLives();
level.addChild(new Effect(new TextBonusLife(), 320, 240, null));
level.addChild(new Effect(new TextBonusLife(), 320, 240, null));
SoundManager.playOnce("bonusLife.mp3", 0.5);
scoresToLife = (scoresToLife + 10000);
lives++;
trace(lives);
};
updateShoot();
bitmap.bitmapData.fillRect(bitmap.bitmapData.rect, 0);
bitmap.bitmapData.copyPixels(bmd, rect, Utilites.zeroPoint);
if (blinkCount > 0){
makeBlink();
};
var _local1:MovieClip = (level.parent["mcLowArmor"] as MovieClip);
if (health < 30){
if ((((_local1.x < 0)) && ((_local1.currentFrame == 15)))){
_local1.x = 147;
};
} else {
if (_local1.currentFrame == 15){
_local1.x = -50;
};
};
_local1 = (level.parent["mcLowEnergy"] as MovieClip);
if (energy < 30){
if ((((_local1.x < 0)) && ((_local1.currentFrame == 15)))){
_local1.x = 147;
};
} else {
if (_local1.currentFrame == 15){
_local1.x = -50;
};
};
}
public function move(_arg1:MouseEvent):void{
if (level.paused){
return;
};
if (this.x < _arg1.stageX){
animDirection = 1;
} else {
if (this.x > _arg1.stageX){
animDirection = -1;
};
};
}
private function makeShoot():void{
var _local1:String;
var _local2:int;
SoundManager.playHeroShoot(this);
if (isRage){
_local1 = ((weaponLevel < 3)) ? "yellowSmall" : "yellow";
_local2 = ((weaponLevel < 3)) ? 7 : 14;
createBullet(_local1, x, (y - 25), 0, _local2);
createBullet(_local1, (x - 5), (y - 25), -20, _local2);
createBullet(_local1, (x + 5), (y - 25), 20, _local2);
createBullet(_local1, (x - 10), (y - 25), -40, _local2);
createBullet(_local1, (x + 10), (y - 25), 40, _local2);
createBullet(_local1, (x - 15), (y - 25), -60, _local2);
createBullet(_local1, (x + 15), (y - 25), 60, _local2);
createBullet(_local1, (x - 20), (y - 25), -80, _local2);
createBullet(_local1, (x + 20), (y - 25), 80, _local2);
level.particleSystem.createEmmiter("shootFlashBrown2", new Point(x, (y - 22)));
return;
};
switch (weaponLevel){
case 0:
createBullet("simple", x, (y - 20), 0, 10);
level.particleSystem.createEmmiter("shootFlash", new Point(x, (y - 22)));
energy = (energy - 2);
break;
case 1:
createBullet("simple", x, (y - 20), 0, 10);
createBullet("simple", (x - 5), (y - 20), -10, 10);
createBullet("simple", (x + 5), (y - 20), 10, 10);
level.particleSystem.createEmmiter("shootFlash", new Point(x, (y - 22)));
energy = (energy - 2);
break;
case 2:
createBullet("simple", x, (y - 20), 0, 8);
createBullet("simple", (x - 5), (y - 20), -5, 8);
createBullet("simple", (x + 5), (y - 20), 5, 8);
createBullet("simple", (x - 10), (y - 20), -12, 8);
createBullet("simple", (x + 10), (y - 20), 12, 8);
level.particleSystem.createEmmiter("shootFlash", new Point(x, (y - 22)));
energy = (energy - 2);
break;
case 3:
createBullet("green", (x - 10), (y - 25), 0, 20);
createBullet("green", (x + 10), (y - 25), 0, 20);
level.particleSystem.createEmmiter("shootFlashGreen2", new Point(x, (y - 22)));
energy = (energy - 2);
break;
case 4:
createBullet("red", x, (y - 25), 0, 15);
createBullet("red", (x - 5), (y - 25), -7, 15);
createBullet("red", (x + 5), (y - 25), 7, 15);
level.particleSystem.createEmmiter("shootFlashRed2", new Point(x, (y - 22)));
energy = (energy - 2);
break;
case 5:
createBullet("blue", x, (y - 25), 0, 15);
createBullet("blue", (x - 5), (y - 25), -5, 15);
createBullet("blue", (x + 5), (y - 25), 5, 15);
createBullet("blue", (x - 10), (y - 25), -12, 15);
createBullet("blue", (x + 10), (y - 25), 12, 15);
level.particleSystem.createEmmiter("shootFlashBlue2", new Point(x, (y - 22)));
energy = (energy - 2);
break;
};
}
public function get cristalsProgress():int{
if (weaponLevel == 5){
return (100);
};
if (weaponLevel > 0){
return ((((cristalsCount - weaponUpgrades[(weaponLevel - 1)]) / (weaponUpgrades[weaponLevel] - weaponUpgrades[(weaponLevel - 1)])) * 100));
};
return (((cristalsCount / weaponUpgrades[weaponLevel]) * 100));
}
private function mouseDown(_arg1:MouseEvent):void{
isMouseDown = true;
}
}
}//package
Section 101
//Hero2 (Hero2)
package {
import flash.display.*;
public dynamic class Hero2 extends BitmapData {
public function Hero2(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 102
//Immortal (Immortal)
package {
import flash.display.*;
public dynamic class Immortal extends MovieClip {
}
}//package
Section 103
//Level (Level)
package {
import flash.display.*;
import dgparticles.*;
import flash.geom.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public class Level extends MovieClip {
private var lastTime:Number;
private var previousMousePos:Point;
private var enemyBullets:Array;
private var waveDelay:int;
public var elapsedTotalFrames:uint;// = 0
public var waypoints:Array;
private var mouseDelta:Point;
private var waves:Array;
private var txtCristals:TextField;
private var missingCristals:int;// = 0
public var emptyMC:MovieClip;
public var enemies:Array;
var isGameOver:Boolean;// = false
private var txtScores:TextField;
public var paused:Boolean;// = false
private var animationDuration:uint;// = 240
private var deltaStarSpeed:Number;// = 0.5
public var elapsedMs:Number;
private var currentPortals:Array;
public var totalTimeMs:Number;// = 0
private var animationProgress:uint;
public var particleSystem:ParticleSystem;
private var heroBullets:Array;
private var soundBeforPause:Boolean;
private var currentWaveIndex:int;
private var stars:Stars;
public var isAnimLevelUp:Boolean;
private var killedEnemies:uint;
private var bonusObjects:Array;
public var hero:Hero;
public static var levelWidth:int = 640;
public static var levelHeight:int = 480;
public static var heroScores:uint;
public function Level(){
mouseDelta = new Point();
enemies = new Array();
enemyBullets = new Array();
heroBullets = new Array();
bonusObjects = new Array();
lastTime = new Date().time;
super();
addFrameScript(1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
new Nlo();
Mouse.hide();
gotoAndStop("black");
stars = new Stars(levelWidth, levelHeight);
addChild(stars);
emptyMC = new MovieClip();
addChild(emptyMC);
var _local1:BitmapLayer = new BitmapLayer(640, 480);
addChild(_local1);
particleSystem = new ParticleSystem(_local1);
particleSystem.addSettingsByObject({name:"soplo", emissionRate:30, capacity:1000, lifeTime:10000000, angle:1, direction:0, imageName:"particle1", blendMode:"add", minParticleLife:500, maxParticleLife:600, minVelocity:50, maxVelocity:50, minGravityY:0, maxGravityY:0, minAcceleration:200, maxAcceleration:200, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1.6, startScaleY:1.6, midScaleX:0.9, midScaleY:0.9, endScaleX:-0.4, endScaleY:-0.4, startColor:16737945, midColor:4294927872, endColor:0});
particleSystem.addSettingsByObject({name:"shootBlueBoss", emissionRate:30, capacity:1000, lifeTime:10000000, angle:360, direction:0, imageName:"particle11", blendMode:"add", minParticleLife:200, maxParticleLife:200, minSpin:0, maxSpin:0, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1.2, startScaleY:1.2, midScaleX:0.7, midScaleY:0.7, endScaleX:0.5, endScaleY:0.5, startColor:4278242559, midColor:3774913023, endColor:0});
particleSystem.addSettingsByObject({name:"shootGreen", emissionRate:50, capacity:1000, lifeTime:10000000, angle:360, direction:0, imageName:"particle11", blendMode:"normal", minParticleLife:150, maxParticleLife:150, minSpin:0, maxSpin:0, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1, startScaleY:1, midScaleX:0.5, midScaleY:0.5, endScaleX:0.1, endScaleY:0.1, startColor:4284940185, midColor:3019964211, endColor:0});
particleSystem.addSettingsByObject({name:"shootBubble", emissionRate:50, capacity:1000, lifeTime:10000000, angle:360, direction:0, imageName:"particle12", blendMode:"add", minParticleLife:100, maxParticleLife:100, minSpin:0, maxSpin:0, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.6, startScaleY:0.6, midScaleX:0.4, midScaleY:0.4, endScaleX:0.2, endScaleY:0.2, startColor:4281584895, midColor:3442711039, endColor:2013331455});
particleSystem.addSettingsByObject({name:"shootBlue", emissionRate:45, capacity:1000, lifeTime:10000000, angle:360, direction:0, imageName:"particle11", blendMode:"add", minParticleLife:200, maxParticleLife:200, minSpin:0, maxSpin:0, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1, startScaleY:1, midScaleX:0.6, midScaleY:0.6, endScaleX:0.2, endScaleY:0.2, startColor:4281584895, midColor:2687736319, endColor:0});
particleSystem.addSettingsByObject({name:"shootAviHead", emissionRate:50, capacity:1000, lifeTime:10000000, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:500, maxParticleLife:500, minSpin:0, maxSpin:0, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2.4, startScaleY:2.4, midScaleX:1.6, midScaleY:1.6, endScaleX:0.5, endScaleY:0.5, startColor:2013318399, midColor:1345559039, endColor:204});
particleSystem.addSettingsByObject({name:"collideAviHead", emissionRate:50, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle10", blendMode:"add", minParticleLife:500, maxParticleLife:500, minSpin:0, maxSpin:0, minVelocity:50, maxVelocity:70, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2.4, startScaleY:2.4, midScaleX:1.6, midScaleY:1.6, endScaleX:0.5, endScaleY:0.5, startColor:1929432319, midColor:590584319, endColor:204});
particleSystem.addSettingsByObject({name:"explodeYellow", emissionRate:100, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:600, maxParticleLife:700, minSpin:0, maxSpin:0, minVelocity:60, maxVelocity:70, minGravityY:0, maxGravityY:0, minAcceleration:50, maxAcceleration:90, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2, startScaleY:2, midScaleX:1.3, midScaleY:1.3, endScaleX:0.7, endScaleY:0.7, startColor:2449460275, midColor:1526687232, endColor:0});
particleSystem.addSettingsByObject({name:"explodeBlue", emissionRate:100, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:600, maxParticleLife:700, minSpin:0, maxSpin:0, minVelocity:60, maxVelocity:70, minGravityY:0, maxGravityY:0, minAcceleration:50, maxAcceleration:90, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2, startScaleY:2, midScaleX:1.3, midScaleY:1.3, endScaleX:0.7, endScaleY:0.7, startColor:2439433471, midColor:1509975807, endColor:0});
particleSystem.addSettingsByObject({name:"explodeRed", emissionRate:100, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:600, maxParticleLife:700, minSpin:0, maxSpin:0, minVelocity:60, maxVelocity:70, minGravityY:0, maxGravityY:0, minAcceleration:50, maxAcceleration:90, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2, startScaleY:2, midScaleX:1.3, midScaleY:1.3, endScaleX:0.7, endScaleY:0.7, startColor:1774977024, midColor:1526687283, endColor:0});
particleSystem.addSettingsByObject({name:"explodeGreen", emissionRate:100, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:600, maxParticleLife:700, minSpin:0, maxSpin:0, minVelocity:60, maxVelocity:70, minGravityY:0, maxGravityY:0, minAcceleration:50, maxAcceleration:90, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2, startScaleY:2, midScaleX:1.3, midScaleY:1.3, endScaleX:0.7, endScaleY:0.7, startColor:1765002240, midColor:1509975552, endColor:0});
particleSystem.addSettingsByObject({name:"explodeBoss", emissionRate:180, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:1000, maxParticleLife:1200, minSpin:0, maxSpin:0, minVelocity:100, maxVelocity:200, minGravityY:0, maxGravityY:0, minAcceleration:60, maxAcceleration:80, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:4, startScaleY:4, midScaleX:3, midScaleY:3, endScaleX:2, endScaleY:2, startColor:687852544, midColor:1942775296, endColor:0x996600});
particleSystem.addSettingsByObject({name:"explodeAvi", emissionRate:200, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:1000, maxParticleLife:1200, minSpin:0, maxSpin:0, minVelocity:100, maxVelocity:200, minGravityY:0, maxGravityY:0, minAcceleration:60, maxAcceleration:80, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:5, startScaleY:5, midScaleX:3, midScaleY:3, endScaleX:1, endScaleY:1, startColor:687839488, midColor:1946117683, endColor:0x996600});
particleSystem.addSettingsByObject({name:"explodeHero", emissionRate:150, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:600, maxParticleLife:700, minSpin:0, maxSpin:0, minVelocity:100, maxVelocity:150, minGravityY:0, maxGravityY:0, minAcceleration:50, maxAcceleration:90, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:3.1, startScaleY:3.1, midScaleX:1.3, midScaleY:1.3, endScaleX:0.7, endScaleY:0.7, startColor:2449434112, midColor:3120522752, endColor:0});
particleSystem.addSettingsByObject({name:"recoshet", emissionRate:30, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle13", blendMode:"add", minParticleLife:200, maxParticleLife:300, minVelocity:100, maxVelocity:100, minGravityY:0, maxGravityY:0, minAcceleration:90, maxAcceleration:100, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1, startScaleY:1, midScaleX:0.7, midScaleY:0.7, endScaleX:0.1, endScaleY:0.1, startColor:2439446374, midColor:1510001664, endColor:419430400});
particleSystem.addSettingsByObject({name:"s2Shoot", emissionRate:50, capacity:1000, lifeTime:10000000, angle:360, direction:0, imageName:"particle11", blendMode:"add", minParticleLife:200, maxParticleLife:300, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:2, startScaleY:2, midScaleX:1.5, midScaleY:1.5, endScaleX:1, endScaleY:1, startColor:4278242559, midColor:2016647679, endColor:0});
particleSystem.addSettingsByObject({name:"csShoot", emissionRate:50, capacity:1000, lifeTime:10000000, angle:360, direction:0, imageName:"particle11", blendMode:"add", minParticleLife:200, maxParticleLife:200, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1, startScaleY:1, midScaleX:0.6, midScaleY:0.6, endScaleX:0.2, endScaleY:0.2, startColor:4288256511, midColor:2684393983, endColor:0});
particleSystem.addSettingsByObject({name:"flash", emissionRate:50, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle11", blendMode:"add", minParticleLife:100, maxParticleLife:100, minSpin:0, maxSpin:0, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:4, startScaleY:4, midScaleX:2, midScaleY:2, endScaleX:0.7, endScaleY:0.7, startColor:1426128640, midColor:671153920, endColor:0xFF00});
particleSystem.addSettingsByObject({name:"flashCs", emissionRate:50, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle11", blendMode:"add", minParticleLife:100, maxParticleLife:100, minSpin:0, maxSpin:0, minVelocity:0, maxVelocity:0, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:3, startScaleY:3, midScaleX:1.5, midScaleY:1.5, endScaleX:0.7, endScaleY:0.7, startColor:2526648831, midColor:1603888895, endColor:10066431});
particleSystem.addSettingsByObject({name:"shootFlash", emissionRate:50, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle10", blendMode:"add", minParticleLife:50, maxParticleLife:300, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:50, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.6, startScaleY:0.6, midScaleX:0.5, midScaleY:0.5, endScaleX:0.5, endScaleY:0.5, startColor:2113928960, midColor:1107282944, endColor:0xFFFFFF});
particleSystem.addSettingsByObject({name:"shootFlashGreen", emissionRate:70, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle10", blendMode:"add", minParticleLife:50, maxParticleLife:300, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:50, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.6, startScaleY:0.6, midScaleX:0.5, midScaleY:0.5, endScaleX:0.5, endScaleY:0.5, startColor:2097217280, midColor:1093900595, endColor:0xFFFFFF});
particleSystem.addSettingsByObject({name:"shootFlashGreen2", emissionRate:30, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle1", blendMode:"add", minParticleLife:200, maxParticleLife:200, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:10, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.6, startScaleY:0.3, midScaleX:1, midScaleY:0.5, endScaleX:0.8, endScaleY:0.4, startColor:3019964160, midColor:1010014515, endColor:3407718});
particleSystem.addSettingsByObject({name:"shootFlashBlue", emissionRate:70, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle10", blendMode:"add", minParticleLife:50, maxParticleLife:300, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:50, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.6, startScaleY:0.6, midScaleX:0.5, midScaleY:0.5, endScaleX:0.5, endScaleY:0.5, startColor:2100533759, midColor:1090584575, endColor:0xFFFFFF});
particleSystem.addSettingsByObject({name:"shootFlashBlue2", emissionRate:30, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle1", blendMode:"add", minParticleLife:200, maxParticleLife:200, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:10, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.9, startScaleY:0.5, midScaleX:1.7, midScaleY:0.5, endScaleX:0.8, endScaleY:0.4, startColor:3023254527, midColor:2774977791, endColor:174522367});
particleSystem.addSettingsByObject({name:"shootFlashRed", emissionRate:70, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle10", blendMode:"add", minParticleLife:50, maxParticleLife:300, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:50, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.6, startScaleY:0.6, midScaleX:0.5, midScaleY:0.5, endScaleX:0.5, endScaleY:0.5, startColor:2113863680, midColor:1107243776, endColor:0xFFFFFF});
particleSystem.addSettingsByObject({name:"shootFlashRed2", emissionRate:30, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle1", blendMode:"add", minParticleLife:200, maxParticleLife:200, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:10, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.9, startScaleY:0.5, midScaleX:1.7, midScaleY:0.5, endScaleX:0.8, endScaleY:0.4, startColor:3036649830, midColor:2197749760, endColor:16737996});
particleSystem.addSettingsByObject({name:"shootFlashBrown", emissionRate:70, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle10", blendMode:"add", minParticleLife:50, maxParticleLife:300, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:50, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.6, startScaleY:0.6, midScaleX:0.5, midScaleY:0.5, endScaleX:0.5, endScaleY:0.5, startColor:2107205120, midColor:1100585318, endColor:0xFFFFFF});
particleSystem.addSettingsByObject({name:"shootFlashBrown2", emissionRate:30, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle1", blendMode:"add", minParticleLife:200, maxParticleLife:200, minSpin:0, maxSpin:0, minVelocity:10, maxVelocity:10, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:0.9, startScaleY:0.5, midScaleX:1.7, midScaleY:0.5, endScaleX:0.8, endScaleY:0.4, startColor:3036636723, midColor:2785004646, endColor:184536268});
particleSystem.addSettingsByObject({name:"aviPortal", emissionRate:10, capacity:1000, lifeTime:10000000, angle:180, direction:0, imageName:"particle1", blendMode:"add", minParticleLife:400, maxParticleLife:500, minSpin:0, maxSpin:0, minVelocity:30, maxVelocity:60, minGravityY:0, maxGravityY:0, minAcceleration:30, maxAcceleration:30, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1.1, startScaleY:1.1, midScaleX:1.7, midScaleY:1.7, endScaleX:2, endScaleY:2, startColor:2684354713, midColor:2268305868, endColor:3368703});
particleSystem.addSettingsByObject({name:"heroImmortal", emissionRate:50, capacity:1000, lifeTime:100, angle:360, direction:0, imageName:"particle1", blendMode:"add", minParticleLife:600, maxParticleLife:700, minSpin:0, maxSpin:0, minVelocity:20, maxVelocity:50, minGravityY:0, maxGravityY:0, minAcceleration:0, maxAcceleration:0, minTangAcceleration:0, maxTangAcceleration:0, startScaleX:1, startScaleY:1, midScaleX:0.9, midScaleY:0.9, endScaleX:0.3, endScaleY:0.3, startColor:1107269990, midColor:1107269990, endColor:16751001});
stage.addEventListener(KeyboardEvent.KEY_UP, keyUP);
}
function frame5(){
stop();
}
public function AddEnemy(_arg1:BaseEnemy):void{
enemies.push(_arg1);
this.addChildAt(_arg1, 2);
}
private function UpdateBullets():void{
var _local2:Bullet;
var _local3:int;
var _local4:BaseEnemy;
var _local1:int = (enemyBullets.length - 1);
while (_local1 >= 0) {
_local2 = (enemyBullets[_local1] as Bullet);
_local2.update();
if (((!(Utilites.inRange(_local2.x, -50, (levelWidth + 50)))) || (!(Utilites.inRange(_local2.y, -50, (levelHeight + 50)))))){
RemoveEnemyBullet(_local2, false);
} else {
if (!isGameOver){
if (((Utilites.IsCollision(hero, _local2)) && ((hero.blinkCount <= 0)))){
if (!hero.isImmortal){
hero.health = (hero.health - _local2.damage);
if (((_local2.isEnergy) && ((hero.energy > 2)))){
hero.energy = (hero.energy - _local2.damage);
};
};
SoundManager.playOnce("Coll1.wav", 0.5);
RemoveEnemyBullet(_local2, true);
};
};
};
_local1--;
};
_local1 = (heroBullets.length - 1);
while (_local1 >= 0) {
_local2 = (heroBullets[_local1] as Bullet);
_local2.update();
if (((!(Utilites.inRange(_local2.x, -50, (levelWidth + 50)))) || (!(Utilites.inRange(_local2.y, -50, (levelHeight + 50)))))){
RemoveHeroBullet(_local2, false);
} else {
_local3 = (enemies.length - 1);
while (_local3 >= 0) {
_local4 = (enemies[_local3] as BaseEnemy);
if (Utilites.IsCollision(_local2, _local4)){
_local4.health = (_local4.health - _local2.damage);
_local4.showHealth = true;
if (_local4.health <= 0){
RemoveEnemy(_local4, true);
};
SoundManager.playOnce("Newgun.wav", 0.5);
RemoveHeroBullet(_local2, (_local4.health > 0));
break;
};
_local3--;
};
};
_local1--;
};
}
private function gameWin():void{
mainClass.gotoAndStop("Scores");
SharedObject.getLocal("SF_saves").clear();
dispose();
mainClass.isWin = true;
}
private function animateLevelUp():void{
var _local1:int;
var _local2:SharedObject;
if (isGameOver){
return;
};
animationProgress++;
SoundManager.changeMusicToNormal = true;
if (animationProgress == Math.round((animationDuration / 2))){
_local1 = (mainClass.currentLevelIndex + 1);
if (_local1 < mainClass.levels.length){
gotoAndStop(mainClass.levels[_local1].attribute("bgImage"));
};
};
if (animationProgress <= (4 * 24)){
stars.changeStarsSpeed(deltaStarSpeed);
if (Color4.HexToARGB(stars.bgColor).a < 253){
stars.bgColor = (stars.bgColor + 50331648);
};
hero.emSoplo.settings.emissionRate = (hero.emSoplo.settings.emissionRate + 2);
hero.emSoplo.settings.maxParticleLife = (hero.emSoplo.settings.maxParticleLife + 2);
hero.emSoplo.settings.minParticleLife = (hero.emSoplo.settings.minParticleLife + 2);
hero.emSoplo.settings.minVelocity = (hero.emSoplo.settings.minVelocity + 2);
hero.emSoplo.settings.maxVelocity = (hero.emSoplo.settings.maxVelocity + 2);
} else {
if (animationProgress > (8 * 24)){
if ((mainClass.currentLevelIndex + 1) >= mainClass.levels.length){
isGameOver = true;
stage.addChild(new Effect(new BlackRectShow(), 0, 0, gameWin));
SoundManager.makeLowVolume = true;
};
stars.changeStarsSpeed((-(deltaStarSpeed) * 2));
if ((((animationProgress > (9 * 24))) && ((Color4.HexToARGB(stars.bgColor).a > 14)))){
stars.bgColor = (stars.bgColor - 352321536);
};
hero.emSoplo.settings.emissionRate = (hero.emSoplo.settings.emissionRate - 4);
hero.emSoplo.settings.maxParticleLife = (hero.emSoplo.settings.maxParticleLife - 4);
hero.emSoplo.settings.minParticleLife = (hero.emSoplo.settings.minParticleLife - 4);
hero.emSoplo.settings.minVelocity = (hero.emSoplo.settings.minVelocity - 4);
hero.emSoplo.settings.maxVelocity = (hero.emSoplo.settings.maxVelocity - 4);
};
};
if (animationProgress >= animationDuration){
animationProgress = 0;
isAnimLevelUp = false;
mainClass.currentLevelIndex++;
trace("update animation complited");
if (mainClass.currentLevelIndex >= mainClass.levels.length){
return;
};
loadFromXML(mainClass.levels[mainClass.currentLevelIndex]);
currentWaveIndex = 0;
InitializePortals();
_local2 = SharedObject.getLocal("SF_saves");
_local2.data.level = mainClass.currentLevelIndex;
_local2.data.scores = heroScores;
_local2.data.weaponLevel = hero.weaponLevel;
_local2.data.cristals = hero.cristalsCount;
_local2.data.lives = hero.lives;
_local2.flush();
showLevelText();
addChild(new Effect(new ProgressSaved(), 495, 465, null));
};
}
private function dispose():void{
this.removeEventListener(Event.ENTER_FRAME, update);
SoundManager.stopAll();
hero.dispose();
var _local1:int;
while (_local1 < enemies.length) {
enemies[_local1].dispose();
_local1++;
};
}
public function StartBattle():void{
var _local2:Object;
SoundManager.stopAll();
SoundManager.startBgMusic();
currentWaveIndex = 0;
hero = new Hero();
addChildAt(hero, 2);
hero.initialize();
hero.x = stage.mouseX;
hero.y = stage.mouseY;
if (mainClass.loadSavedGame){
_local2 = SharedObject.getLocal("SF_saves").data;
mainClass.currentLevelIndex = _local2.level;
loadFromXML(mainClass.levels[_local2.level]);
heroScores = _local2.scores;
hero.weaponLevel = _local2.weaponLevel;
hero.cristalsCount = _local2.cristals;
hero.lives = _local2.lives;
InitializePortals();
} else {
heroScores = 0;
mainClass.currentLevelIndex = -1;
enemies = new Array();
currentPortals = new Array();
isAnimLevelUp = true;
stars.bgColor = 4278190080;
animationProgress = ((4 * 24) + 1);
hero.emSoplo.settings.emissionRate = 222;
hero.emSoplo.settings.maxParticleLife = 792;
hero.emSoplo.settings.minParticleLife = 692;
hero.emSoplo.settings.minVelocity = 242;
hero.emSoplo.settings.maxVelocity = 242;
stars.changeStarsSpeed(((deltaStarSpeed * 4) * 24));
};
hero.scoresToLife = (Level.heroScores + (10000 - (Level.heroScores % 10000)));
var _local1:int;
while (_local1 < hero.lives) {
hero.incLives();
_local1++;
};
previousMousePos = new Point(stage.mouseX, stage.mouseY);
this.addEventListener(Event.ENTER_FRAME, update);
txtScores = (parent["topPanel"].getChildByName("scores") as TextField);
txtCristals = (parent["topPanel"].getChildByName("crystals") as TextField);
if (mainClass.loadSavedGame){
showLevelText();
};
if (mainClass.currentLevelIndex == -1){
addChild(new Effect(new TextControls(), 280, 465, null));
};
}
public function makePause():void{
if (isGameOver){
return;
};
paused = !(paused);
parent["dialogWindow"].x = (paused) ? 320 : -200;
parent["dialogWindow"].y = 400;
parent["btnYes"].x = (paused) ? 210 : -200;
parent["btnYes"].y = 385;
parent["btnNo"].x = (paused) ? 323 : -200;
parent["btnNo"].y = 385;
parent["btnMG2"].x = (paused) ? 266 : -200;
parent["btnMG2"].y = 420;
parent["btnSound"].x = (paused) ? 568 : -200;
parent["btnSound"].y = 450;
parent["blackRectangle"].visible = paused;
particleSystem.enabled = !(paused);
if (paused){
Mouse.show();
SoundManager.pauseAll();
soundBeforPause = SoundManager.enableSound;
parent["btnSound"].selected = SoundManager.enableSound;
} else {
Mouse.hide();
SoundManager.enableSound = parent["btnSound"].selected;
if (SoundManager.enableSound){
if (soundBeforPause){
SoundManager.resumeAll();
} else {
SoundManager.startBgMusic();
};
} else {
SoundManager.stopAll();
};
};
}
private function bossExists():Boolean{
var _local1:int;
while (_local1 < enemies.length) {
if (enemies[_local1].isBoss){
return (true);
};
_local1++;
};
return (false);
}
private function endOfWave():Boolean{
var _local1:int;
while (_local1 < currentPortals.length) {
if (!currentPortals[_local1].endOfEnemy){
return (false);
};
_local1++;
};
return ((enemies.length == 0));
}
public function removeBonusObject(_arg1:BonusObject):void{
this.removeChild(_arg1);
bonusObjects.splice(bonusObjects.indexOf(_arg1), 1);
}
private function InitializePortals():void{
var _local1:XML;
currentPortals = new Array();
for each (_local1 in waves[currentWaveIndex].portal) {
currentPortals.push(new Portal(this, _local1));
};
}
public function everyMs(_arg1:int):Boolean{
return (!((int(((totalTimeMs - elapsedMs) / _arg1)) == int((totalTimeMs / _arg1)))));
}
public function get mainClass():StarFighter{
return ((parent as StarFighter));
}
private function keyUP(_arg1:KeyboardEvent):void{
if ((((((_arg1.keyCode == 27)) || ((_arg1.keyCode == 80)))) && (!(paused)))){
makePause();
} else {
if ((((_arg1.keyCode == 112)) && (!(paused)))){
paused = true;
parent["hlpScreen"].y = 0;
parent["btnBack"].x = 495;
Mouse.show();
particleSystem.enabled = false;
};
};
switch (_arg1.keyCode){
};
}
public function everyFrames(_arg1:int):Boolean{
return (!((int(((elapsedTotalFrames - 1) / _arg1)) == int((elapsedTotalFrames / _arg1)))));
}
public function RemoveEnemy(_arg1:BaseEnemy, _arg2:Boolean, _arg3:Boolean=true):void{
var _local4:int;
var _local5:Number;
var _local6:int;
var _local7:int;
if (_arg2){
killedEnemies++;
_arg1.die();
heroScores = (heroScores + _arg1.scores);
if (_arg1.bonus != null){
_local4 = ((int(_arg1.bonus[0]) + int(_arg1.bonus[1])) + int(_arg1.bonus[2]));
_local5 = ((_arg1.collideRadius * 2) / _local4);
_local6 = 0;
_local7 = 0;
while (_local7 < _arg1.bonus[0]) {
if (_local4 == 1){
addBonusObject(_arg1.x, _arg1.y, "health");
} else {
addBonusObject(((_arg1.x - _arg1.collideRadius) + (_local5 * _local6)), (_arg1.y + Utilites.RandomInt(-(_arg1.collideRadius), _arg1.collideRadius)), "health");
};
_local6++;
_local7++;
};
_local7 = 0;
while (_local7 < _arg1.bonus[1]) {
if (_local4 == 1){
addBonusObject(_arg1.x, _arg1.y, "energy");
} else {
addBonusObject(((_arg1.x - _arg1.collideRadius) + (_local5 * _local6)), (_arg1.y + Utilites.RandomInt(-(_arg1.collideRadius), _arg1.collideRadius)), "energy");
};
_local6++;
_local7++;
};
_local7 = 0;
while (_local7 < _arg1.bonus[2]) {
if (_local4 == 1){
addBonusObject(_arg1.x, _arg1.y, "cristal");
} else {
addBonusObject(((_arg1.x - _arg1.collideRadius) + (_local5 * _local6)), (_arg1.y + Utilites.RandomInt(-(_arg1.collideRadius), _arg1.collideRadius)), "cristal");
};
_local6++;
_local7++;
};
enemies.splice(enemies.indexOf(_arg1), 1);
this.removeChild(_arg1);
return;
} else {
if ((((((hero.weaponLevel == 5)) && (((killedEnemies % 21) == 0)))) || ((((((hero.weaponLevel < 5)) && (((killedEnemies % 11) == 0)))) && ((missingCristals > 0)))))){
addBonusObject(_arg1.x, _arg1.y, "cristal");
if (missingCristals > 0){
missingCristals--;
};
} else {
if ((killedEnemies % 51) == 0){
if (Math.random() < 0.8){
addBonusObject(_arg1.x, _arg1.y, "rage");
} else {
if (!bossExists()){
addBonusObject(_arg1.x, _arg1.y, "immortal");
};
};
} else {
if ((((bonusObjects.length < 2)) && (_arg3))){
if ((((((hero.health < 30)) && ((Math.random() < 0.3)))) && (!(bonusExists("health"))))){
addBonusObject(_arg1.x, _arg1.y, "health");
} else {
if ((((((hero.energy < 30)) && ((Math.random() < 0.3)))) && (!(bonusExists("energy"))))){
addBonusObject(_arg1.x, _arg1.y, "energy");
};
};
};
};
};
};
};
_arg1.health = -1;
enemies.splice(enemies.indexOf(_arg1), 1);
this.removeChild(_arg1);
}
public function loadFromXML(_arg1:XML):void{
var _local2:XML;
var _local3:XML;
var _local4:Array;
var _local5:Array;
var _local6:int;
waves = new Array();
waypoints = new Array();
gotoAndStop(_arg1.attribute("bgImage"));
for each (_local2 in _arg1.waypoint) {
_local4 = _local2.attribute("coords").toString().split(";");
_local5 = new Array();
_local6 = 0;
while (_local6 < _local4.length) {
_local5.push(Utilites.StringToPoint(_local4[_local6]));
_local6++;
};
waypoints.push(_local5);
};
for each (_local3 in _arg1.wave) {
waves.push(_local3);
};
}
private function update(_arg1:Event):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:BaseEnemy;
var _local7:int;
var _local8:BonusObject;
var _local2:Number = new Date().time;
elapsedMs = (_local2 - lastTime);
totalTimeMs = (totalTimeMs + elapsedMs);
lastTime = _local2;
elapsedTotalFrames++;
if (paused){
return;
};
emptyMC.graphics.clear();
if (!isAnimLevelUp){
_local3 = 0;
_local4 = 0;
_local5 = 0;
while (_local5 < currentPortals.length) {
currentPortals[_local5].update();
if (currentPortals[_local5].hasBoss){
_local3++;
if (currentPortals[_local5].bossDied){
_local4++;
};
};
_local5++;
};
if ((((_local3 > 0)) && (!(bossExists())))){
_local5 = 0;
while (_local5 < currentPortals.length) {
currentPortals[_local5].count = 0;
_local5++;
};
SoundManager.changeMusicToNormal = true;
};
};
SoundManager.update();
parent["txtParticles"].text = ((((((((("Particles: " + particleSystem.parcticlesCount) + "\rEmmiters: ") + particleSystem.emittersCount) + "\rEnemies: ") + enemies.length) + "\rEnemies killed: ") + killedEnemies) + "\rfps: ") + FpsCounter.fps);
mouseDelta.x = (stage.mouseX - previousMousePos.x);
mouseDelta.y = (stage.mouseY - previousMousePos.y);
previousMousePos.x = stage.mouseX;
previousMousePos.y = stage.mouseY;
if ((((waveDelay <= 0)) && (endOfWave()))){
waveDelay = 1800;
};
if (waveDelay > 0){
waveDelay = (waveDelay - elapsedMs);
};
if (((((!(isAnimLevelUp)) && ((waveDelay <= 0)))) && (endOfWave()))){
currentWaveIndex++;
if (currentWaveIndex >= waves.length){
isAnimLevelUp = true;
} else {
InitializePortals();
};
};
if (((!(isAnimLevelUp)) && (((!((mouseDelta.x == 0))) || (!((mouseDelta.y == 0))))))){
stars.move((mouseDelta.x * -0.1), (mouseDelta.y * -0.1));
};
stars.update();
hero.update();
if (isAnimLevelUp){
animateLevelUp();
};
UpdateBullets();
_local5 = (enemies.length - 1);
while (_local5 >= 0) {
_local6 = (enemies[_local5] as BaseEnemy);
_local6.update();
if ((((_local6.y > (levelHeight + 50))) || ((((_local6.moveType == MoveTypes.Kamikadze)) && (!(Utilites.inRange(_local6.x, -50, 690))))))){
RemoveEnemy(_local6, false);
};
_local5--;
};
_local5 = 0;
while (_local5 < (enemies.length - 1)) {
_local7 = (_local5 + 1);
while (_local7 < enemies.length) {
if (Utilites.IsCollision(enemies[_local5], enemies[_local7])){
enemies[_local5].updateCollision(enemies[_local7]);
};
_local7++;
};
_local5++;
};
if (hero.visible){
_local5 = (enemies.length - 1);
while (_local5 >= 0) {
_local6 = (enemies[_local5] as BaseEnemy);
if (((Utilites.IsCollision(_local6, hero)) && ((hero.blinkCount <= 0)))){
if (((((hero.isImmortal) && (!((_local6 is Avi))))) && (!((_local6 is Boss))))){
RemoveEnemy(_local6, true, false);
} else {
hero.health = (hero.health - _local6.damage);
if (((!((_local6 is Avi))) && (!((_local6 is Boss))))){
_local6.health = 0;
RemoveEnemy(_local6, true, false);
};
};
};
_local5--;
};
};
_local5 = (bonusObjects.length - 1);
while (_local5 >= 0) {
_local8 = (bonusObjects[_local5] as BonusObject);
_local8.update();
if (((Utilites.IsCollision(_local8, hero)) && (hero.visible))){
removeBonusObject(_local8);
SoundManager.playOnce("Take_power.wav", 0.6);
if (_local8.bonusType == "health"){
hero.health = (hero.health + _local8.count);
if (hero.health > 100){
hero.health = 100;
};
} else {
if (_local8.bonusType == "energy"){
hero.energy = (hero.energy + _local8.count);
if (hero.energy > 100){
hero.energy = 100;
};
} else {
if (_local8.bonusType == "cristal"){
hero.cristalsCount++;
heroScores = (heroScores + 50);
} else {
if (_local8.bonusType == "rage"){
hero.isRage = true;
addChild(new Effect(new TextRageGet(), 320, 240, null));
} else {
if (_local8.bonusType == "immortal"){
hero.isImmortal = true;
addChild(new Effect(new TextInvincibleGet(), 320, 240, null));
};
};
};
};
};
};
if (_local8.y > (levelHeight + 50)){
if (_local8.bonusType == "cristal"){
missingCristals++;
};
removeBonusObject(_local8);
};
_local5--;
};
parent["heroHealth"].gotoAndStop(Math.round(hero.health));
parent["heroEnergy"].gotoAndStop(Math.round(hero.energy));
parent["heroCristals"].gotoAndStop(hero.cristalsProgress);
txtScores.text = heroScores.toString();
txtCristals.text = hero.cristalsCount.toString();
if ((((hero.health < 0)) && (!(isGameOver)))){
hero.die();
if (hero.lives <= 0){
isGameOver = true;
hero.dispose();
stage.addChild(new Effect(new BlackRectShow(), 0, 0, gameOver));
SoundManager.makeLowVolume = true;
};
};
}
private function showLevelText():void{
var _local1:MovieClip = new TextLevel();
_local1["text"].gotoAndStop((mainClass.currentLevelIndex + 1));
addChild(new Effect(_local1, 320, 240, null));
}
private function bonusExists(_arg1:String):Boolean{
var _local2:int;
while (_local2 < bonusObjects.length) {
if (bonusObjects[_local2].bonusType == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function addBonusObject(_arg1, _arg2:int, _arg3:String):void{
var _local4:BonusObject = new BonusObject(_arg1, _arg2, _arg3);
this.addChildAt(_local4, 2);
bonusObjects.push(_local4);
}
function frame2(){
stop();
}
public function RemoveEnemyBullet(_arg1:Bullet, _arg2:Boolean):void{
if (_arg2){
_arg1.doCollision();
};
if (_arg1.emitter != null){
particleSystem.killEmmiter(_arg1.emitter);
};
enemyBullets.splice(enemyBullets.indexOf(_arg1), 1);
this.removeChild(_arg1);
}
public function RemoveHeroBullet(_arg1:Bullet, _arg2:Boolean):void{
if (_arg2){
_arg1.doCollision();
};
this.removeChild(_arg1);
heroBullets.splice(heroBullets.indexOf(_arg1), 1);
}
private function gameOver():void{
mainClass.gotoAndStop("GameOver");
dispose();
mainClass.isWin = false;
}
public function AddEnemyBullet(_arg1:Bullet):void{
enemyBullets.push(_arg1);
this.addChild(_arg1);
}
function frame4(){
stop();
}
function frame6(){
stop();
}
public function AddHeroBullet(_arg1:Bullet):void{
this.addChild(_arg1);
heroBullets.push(_arg1);
}
function frame3(){
stop();
}
}
}//package
Section 104
//LiveIkon (LiveIkon)
package {
import flash.display.*;
public dynamic class LiveIkon extends MovieClip {
public function LiveIkon(){
addFrameScript(74, frame75);
}
function frame75(){
stop();
}
}
}//package
Section 105
//menu (menu)
package {
import flash.media.*;
public dynamic class menu extends Sound {
}
}//package
Section 106
//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 107
//MoveTypes (MoveTypes)
package {
public final class MoveTypes {
public static const ChangePos:String = "ChangePos";
public static const Kamikadze:String = "Kamikadze";
public static const HoldPosition:String = "HoldPosition";
public static const ToMouse:String = "ToMouse";
public static const Evade:String = "Evade";
public static const Down:String = "Down";
}
}//package
Section 108
//Nlo (Nlo)
package {
import flash.display.*;
import flash.geom.*;
public class Nlo extends BaseEnemy {
var rect:Rectangle;
var bmd:BitmapData;
var bitmap:Bitmap;
public function Nlo(){
rect = new Rectangle(0, 0, 40, 40);
bmd = new Enemy_nlo(40, 40);
bitmap = new Bitmap(new BitmapData(40, 40));
super();
collideRadius = 20;
rotationSpeed = 8;
shootDelay = 60;
bulletDamage = 3;
counter = Utilites.RandomInt(0, shootDelay);
healthLen = 30;
healtY = -25;
bitmap.x = -20;
bitmap.y = -20;
addChild(bitmap);
}
override public function update():void{
bitmap.bitmapData.fillRect(bitmap.bitmapData.rect, 0);
bitmap.bitmapData.copyPixels(bmd, rect, Utilites.zeroPoint);
rect.x = (rect.x + 40);
if (rect.x == 1400){
rect.x = 0;
};
super.update();
}
override protected function makeShoot(_arg1:Point):void{
createBullet("none", x, y, _arg1, 10, "shootGreen", "recoshet", "flash");
SoundManager.playOnce("Enemy_shoot.wav", 0.4);
}
override protected function updateRotation():void{
}
}
}//package
Section 109
//particle1 (particle1)
package {
import flash.display.*;
public dynamic class particle1 extends BitmapData {
public function particle1(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 110
//particle10 (particle10)
package {
import flash.display.*;
public dynamic class particle10 extends BitmapData {
public function particle10(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 111
//particle11 (particle11)
package {
import flash.display.*;
public dynamic class particle11 extends BitmapData {
public function particle11(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 112
//particle12 (particle12)
package {
import flash.display.*;
public dynamic class particle12 extends BitmapData {
public function particle12(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 113
//particle13 (particle13)
package {
import flash.display.*;
public dynamic class particle13 extends BitmapData {
public function particle13(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 114
//particle8 (particle8)
package {
import flash.display.*;
public dynamic class particle8 extends BitmapData {
public function particle8(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 115
//particle9 (particle9)
package {
import flash.display.*;
public dynamic class particle9 extends BitmapData {
public function particle9(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 116
//Portal (Portal)
package {
import flash.utils.*;
public class Portal {
private var currentEnemyIndex:int;// = 0
private var level:Level;
private var interval:int;// = 0
private var afterDie:Boolean;// = false
private var boss:BaseEnemy;
public var count:int;// = 0
public var enemies:Array;
private var createdEnemies:Array;
private var rnd:String;// = null
public function Portal(_arg1:Level, _arg2:XML){
var _local3:XML;
enemies = new Array();
super();
this.level = _arg1;
count = _arg2.attribute("count");
interval = _arg2.attribute("interval");
interval = Utilites.Clamp((interval / 30), 1, 99999999);
if (_arg2.attribute("rnd") != undefined){
rnd = _arg2.attribute("rnd");
};
if (((!((_arg2.attribute("afterDie") == undefined))) && ((_arg2.attribute("afterDie") == "true")))){
createdEnemies = new Array();
afterDie = true;
};
for each (_local3 in _arg2.enemy) {
enemies.push(_local3);
};
}
public function get hasBoss():Boolean{
return (!((boss == null)));
}
public function update():void{
var _local1:int;
if (afterDie){
_local1 = (createdEnemies.length - 1);
while (_local1 >= 0) {
if (createdEnemies[_local1].health <= 0){
createdEnemies.splice(_local1, 1);
};
_local1--;
};
};
if (!endOfEnemy){
if (((((((!(afterDie)) && (level.everyFrames(interval)))) && ((count > 0)))) || (((afterDie) && ((createdEnemies.length == 0)))))){
if (rnd != null){
currentEnemyIndex = Utilites.rndStrToNumber2(rnd);
createEnemy();
} else {
_local1 = 0;
while (_local1 < enemies.length) {
currentEnemyIndex = _local1;
createEnemy();
_local1++;
};
};
count--;
};
};
}
public function get bossDied():Boolean{
return (((!((boss == null))) && ((boss.health <= 0))));
}
private function createEnemy():void{
var _local1:XML = enemies[currentEnemyIndex];
var _local2:String = _local1.attribute("name");
var _local3:Class = (getDefinitionByName(_local2) as Class);
var _local4:BaseEnemy = new (_local3);
if ((_local4 is Boss)){
(_local4 as Boss).setGuns(_local1.attribute("gunsType"));
};
_local4.health = _local1.attribute("health");
_local4.position = Utilites.StringToPoint(_local1.attribute("creationPoint"));
_local4.moveType = _local1.attribute("moveType").toString();
if (_local1.attribute("targetPoint") != undefined){
_local4.targetPoint = Utilites.StringToPoint(_local1.attribute("targetPoint"));
} else {
_local4.targetPoint = _local4.position;
};
if (_local1.attribute("lookAtHero") != undefined){
_local4.lookAtHero = (_local1.attribute("lookAtHero") == "true");
};
if (_local4.lookAtHero == false){
_local4.lookPoint = Utilites.StringToPoint(_local1.attribute("lookPoint"));
};
if (_local1.attribute("wptNumber") != undefined){
_local4.waypoints = level.waypoints[_local1.attribute("wptNumber")];
};
if (_local1.attribute("bonus") != undefined){
_local4.bonus = _local1.attribute("bonus").toString().split(",");
};
if (_local1.attribute("speed") != undefined){
_local4.moveSpeed = _local1.attribute("speed");
};
if (((!((_local1.attribute("boss") == undefined))) && ((_local1.attribute("boss") == "1")))){
boss = _local4;
_local4.isBoss = true;
SoundManager.changeMusicToBoss = true;
};
if (_local1.attribute("shootDelay") != undefined){
_local4.shootDelay = _local1.attribute("shootDelay");
};
if (_local1.attribute("attack") != undefined){
_local4.attack = (_local1.attribute("attack") == "true");
};
level.AddEnemy(_local4);
_local4.initialize();
currentEnemyIndex++;
if (currentEnemyIndex > (enemies.length - 1)){
currentEnemyIndex = 0;
};
if (afterDie){
createdEnemies.push(_local4);
};
}
public function get endOfEnemy():Boolean{
return ((count <= 0));
}
}
}//package
Section 117
//preloader (preloader)
package {
import flash.display.*;
import flash.events.*;
public dynamic class preloader extends MovieClip {
public var percent:Number;// = 0
public function preloader(){
addEventListener(Event.ENTER_FRAME, Update);
}
public function Update(_arg1:Event):void{
var _local2:Number = loaderInfo.bytesLoaded;
var _local3:Number = loaderInfo.bytesTotal;
if (_local3 > 0){
percent = Math.floor(((_local2 / _local3) * 100));
};
this.gotoAndStop((percent + 1));
if ((((_local2 == _local3)) || ((_local3 == 0)))){
removeEventListener(Event.ENTER_FRAME, Update);
if ((parent is MovieClip)){
trace(11111111111111);
(parent as MovieClip).gotoAndStop(5);
};
};
}
}
}//package
Section 118
//ProgressSaved (ProgressSaved)
package {
import flash.display.*;
public dynamic class ProgressSaved extends MovieClip {
}
}//package
Section 119
//Rage (Rage)
package {
import flash.display.*;
public dynamic class Rage extends MovieClip {
}
}//package
Section 120
//S2 (S2)
package {
import flash.geom.*;
import flash.events.*;
public class S2 extends BaseEnemy {
public function S2(){
addFrameScript(0, frame1);
super();
collideRadius = 35;
rotation = 90;
shootDelay = 50;
rotationSpeed = 8;
addEventListener(Event.ENTER_FRAME, makeShoot2);
damage = 25;
healtY = -30;
healtX = -30;
healthLen = 40;
scores = 100;
counter = Utilites.RandomInt(0, shootDelay);
}
private function makeShoot2(_arg1:Event):void{
var _local2:Point;
var _local3:Point;
if (currentFrame == 7){
_local2 = Utilites.directionFromAngle(rotation);
_local3 = localToGlobal(new Point(20, 30));
createBullet("none", _local3.x, _local3.y, _local2, 12, "s2Shoot", "shootFlashBlue", "").collideRadius = 10;
SoundManager.playOnce("BossLaser1.wav", 0.3);
};
}
override protected function makeShoot(_arg1:Point):void{
play();
}
function frame1(){
stop();
}
override public function die():void{
removeEventListener(Event.ENTER_FRAME, makeShoot2);
super.die();
}
}
}//package
Section 121
//SoundManager (SoundManager)
package {
import flash.media.*;
import flash.utils.*;
public class SoundManager {
private static var gameBackground:DGSound;
private static var sounds:Array = new Array();
public static var enableSound:Boolean = true;
private static var bossMusic:DGSound;
public static var makeLowVolume:Boolean;
private static var backgroundSoundName:String = "fixator";
public static var changeMusicToNormal:Boolean;
public static var changeMusicToBoss:Boolean;
public static function update():void{
var _local1:int;
if (makeLowVolume){
makeLowVolume = false;
_local1 = (sounds.length - 1);
while (_local1 >= 0) {
if (sounds[_local1].transform.volume > 0){
sounds[_local1].transform = new SoundTransform((sounds[_local1].transform.volume - 0.005));
makeLowVolume = true;
};
_local1--;
};
};
if (((changeMusicToBoss) && (!((gameBackground == null))))){
gameBackground.transform = new SoundTransform((gameBackground.transform.volume - 0.01));
if (gameBackground.transform.volume <= 0){
sounds.splice(sounds.indexOf(gameBackground), 1);
gameBackground.stop();
changeMusicToBoss = false;
changeMusicToNormal = false;
bossMusic = playLoop("bossMusic", 0.35);
};
};
if (((changeMusicToNormal) && (!((bossMusic == null))))){
sounds.splice(sounds.indexOf(bossMusic), 1);
bossMusic.stop();
bossMusic = null;
changeMusicToNormal = false;
backgroundSoundName = ((backgroundSoundName)=="fixator") ? "fipMusic" : "fixator";
gameBackground = playOnce(backgroundSoundName, 0.35);
};
_local1 = (sounds.length - 1);
while (_local1 >= 0) {
if (sounds[_local1].played){
sounds[_local1].loops--;
if (sounds[_local1].loops <= 0){
sounds.splice(sounds.indexOf(sounds[_local1]), 1);
};
};
_local1--;
};
if (((!((gameBackground == null))) && (gameBackground.played))){
backgroundSoundName = ((backgroundSoundName)=="fixator") ? "fipMusic" : "fixator";
gameBackground = playOnce(backgroundSoundName, gameBackground.transform.volume);
};
}
public static function pauseAll():void{
var _local1:int;
while (_local1 < sounds.length) {
sounds[_local1].pause();
_local1++;
};
}
public static function playOnce(_arg1:String, _arg2:Number):DGSound{
if (!enableSound){
_arg2 = 0;
};
var _local3:Class = (getDefinitionByName(_arg1) as Class);
var _local4:DGSound = new DGSound(new (_local3));
if (_local4.sound.toString() == "Enemy_shoot.wav"){
_arg2 = (_arg2 - (getCount(_local4) * 0.3));
} else {
_arg2 = (_arg2 - (getCount(_local4) * 0.1));
};
_arg2 = Utilites.Clamp(_arg2, 0, 1);
if (_arg2 == 0){
return (null);
};
_local4.play(0, _arg2);
sounds.push(_local4);
return (_local4);
}
private static function getCount(_arg1:DGSound):int{
var _local2:int;
var _local3:int;
while (_local3 < sounds.length) {
if (_arg1.sound.toString() == sounds[_local3].sound.toString()){
_local2++;
};
_local3++;
};
return (_local2);
}
public static function startBgMusic():void{
gameBackground = playOnce(backgroundSoundName, 0.35);
makeLowVolume = false;
}
public static function playHeroShoot(_arg1:Hero):void{
var _local2:int = Utilites.RandomInt(1, 3);
if (((_arg1.isRage) || ((_arg1.weaponLevel > 2)))){
playOnce((("LaserShoot" + _local2) + ".wav"), 0.45);
} else {
playOnce((("GunShoot" + _local2) + ".wav"), 0.5);
};
}
public static function resumeAll():void{
var _local1:int;
while (_local1 < sounds.length) {
sounds[_local1].resume();
_local1++;
};
}
public static function playLoop(_arg1:String, _arg2:Number):DGSound{
if (!enableSound){
_arg2 = 0;
};
var _local3:Class = (getDefinitionByName(_arg1) as Class);
var _local4:DGSound = new DGSound(new (_local3));
_local4.play(999999, _arg2);
sounds.push(_local4);
return (_local4);
}
public static function stopAll():void{
var _local1:int;
while (_local1 < sounds.length) {
sounds[_local1].stop();
_local1++;
};
sounds.splice(0, sounds.length);
}
}
}//package
Section 122
//SpaceObject (SpaceObject)
package {
import flash.geom.*;
public class SpaceObject extends CollisionObject {
protected var blinkProgress:int;// = 10
protected var counter:int;// = 0
public var turnSpeed:Number;// = 0.2
public var lookAtHero:Boolean;// = false
private var angSpeed:int;// = 7
protected var waypointsMover:WaypointsMover;
public var waypoints:Array;
private var angCount:int;
protected var blinkDirection:Boolean;
private var kamikadzeFail:Boolean;
protected var onPosition:Boolean;// = false
protected var rotationSpeed:Number;// = 2
public var moveType:String;
public var moveSpeed:Number;// = 4
protected var kamikadzeTimer:int;// = 3500
public var targetPoint:Point;
public function SpaceObject(){
waypoints = new Array();
super();
waypointsMover = new WaypointsMover(this);
velocity = new Point(moveSpeed, 0);
}
public function get level():Level{
return (Level(parent));
}
override public function update():void{
updateMove();
}
private function moveToPoint(_arg1:Point):void{
var _local2:Number = Math.atan2((_arg1.y - y), (_arg1.x - x));
velocity.x = (velocity.x + ((Math.cos(_local2) * 0.15) * moveSpeed));
velocity.y = (velocity.y + ((Math.sin(_local2) * 0.15) * moveSpeed));
var _local3:Point = _arg1.subtract(position);
if (velocity.length > _local3.length){
onPosition = true;
};
}
protected function makeBlink():void{
blinkProgress = (blinkProgress + (blinkDirection) ? 1 : -1);
if ((((blinkProgress > 30)) || ((blinkProgress < 10)))){
blinkDirection = !(blinkDirection);
};
transform.colorTransform = new ColorTransform(1, 1, 1, 1, (blinkProgress * 3.5), 0, 0, 0);
}
private function getRandomPoint():Point{
var _local1:Point = new Point(Utilites.RandomInt(70, 500), Utilites.RandomInt(80, 200));
if ((((_local1.x > 510)) && ((_local1.y < 90)))){
_local1.y = 90;
};
return (_local1);
}
public function set position(_arg1:Point):void{
x = _arg1.x;
y = _arg1.y;
}
public function get position():Point{
return (new Point(x, y));
}
public function updateMove():void{
var _local1:Number = 1;
var _local2:Number = 1;
if (waypointsMover.update()){
onPosition = true;
} else {
if (onPosition == false){
moveToPoint(targetPoint);
if (position.equals(targetPoint)){
onPosition = true;
};
} else {
switch (moveType){
case MoveTypes.Down:
velocity.x = 0;
velocity.y = moveSpeed;
targetPoint.x = x;
targetPoint.y = 700;
_local2 = 0;
_local1 = 0.5;
break;
case MoveTypes.ToMouse:
turnSpeed = 0.1;
targetPoint.x = stage.mouseX;
targetPoint.y = stage.mouseY;
waypointsMover.moveToPoint(targetPoint);
x = (x + velocity.x);
y = (y + velocity.y);
return;
case MoveTypes.Kamikadze:
if (kamikadzeTimer < 2000){
makeBlink();
counter = 0;
};
if (kamikadzeTimer > 0){
kamikadzeTimer = (kamikadzeTimer - level.elapsedMs);
if (kamikadzeTimer <= 0){
velocity.y = moveSpeed;
velocity.x = Utilites.Clamp((level.hero.x - x), -5, 5);
lookAtHero = false;
moveSpeed = 13;
turnSpeed = 0.5;
};
break;
};
if (kamikadzeFail){
waypointsMover.moveToPoint(targetPoint);
break;
};
if (((!(kamikadzeFail)) && ((y > level.hero.y)))){
kamikadzeFail = true;
lookAtHero = false;
turnSpeed = (turnSpeed / 2);
targetPoint.x = ((velocity.x > 0)) ? 710 : -80;
targetPoint.y = y;
rotationSpeed = 10;
break;
};
targetPoint.x = stage.mouseX;
targetPoint.y = stage.mouseY;
waypointsMover.moveToPoint(targetPoint);
break;
case MoveTypes.ChangePos:
onPosition = false;
targetPoint = (targetPoint = getRandomPoint());
break;
case MoveTypes.Evade:
if (Utilites.inRange(stage.mouseX, (x - collideRadius), (x + collideRadius))){
onPosition = false;
targetPoint = getRandomPoint();
};
break;
};
angCount = (angCount + angSpeed);
if (angCount >= 360){
angCount = 0;
};
x = (x + (Math.cos((angCount * Utilites.DegToRad)) * _local1));
y = (y + (Math.sin((angCount * Utilites.DegToRad)) * _local2));
};
};
x = (x + velocity.x);
y = (y + velocity.y);
velocity.x = (velocity.x * 0.85);
velocity.y = (velocity.y * 0.85);
}
}
}//package
Section 123
//StarFighter (StarFighter)
package {
import fl.controls.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import mochi.as3.*;
import flash.text.*;
import flash.net.*;
import flash.ui.*;
public dynamic class StarFighter extends MovieClip {
public var mcLowArmor:MovieClip;
public var btnMG2:SimpleButton;
public var mcLowEnergy:MovieClip;
public var currentLevelIndex:int;
public var btnBored3:SimpleButton;
public var helpScreen:MovieClip;
public var btnSound:CheckBox;
public var btnFB:SimpleButton;
public var txtParticles:TextField;
public var heroEnergy:MovieClip;
public var btnContinue:SimpleButton;
public var heroCristals:MovieClip;
public var btnBored:SimpleButton;
public var mcBrif:MovieClip;
public var showingInfo:Boolean;
private var level3:XML;
private var level5:XML;
public var blackRectangle:MovieClip;
private var level6:XML;
private var level0:XML;
public var btnNo:SimpleButton;
private var level7:XML;
private var level8:XML;
private var level1:XML;
private var level4:XML;
public var Level1:Level;
public var isWin:Boolean;// = false
private var level9:XML;
public var dialogWindow:MovieClip;
public var __setPropDict:Dictionary;
public var btnBack:SimpleButton;
public var savesData:Object;
public var o:Object;
public var s:SharedObject;
public var levels:Array;
public var hlpScreen:MovieClip;
public var btnStartGame:SimpleButton;
public var boardID:String;
private var level2:XML;
public var creditsPanel:MovieClip;
public var btnCredits:SimpleButton;
private var level10:XML;
public var copyRights:TextField;
public var topPanel:MovieClip;
public var btnHelp:SimpleButton;
public var loadSavedGame:Boolean;// = false
public var textMissionCompl:MovieClip;
public var btnYes:SimpleButton;
public var heroHealth:MovieClip;
public var backBtn:SimpleButton;
public var btnMG:SimpleButton;
public function StarFighter():void{
__setPropDict = new Dictionary(true);
level0 = <level bgImage="fon1">
<wave>
<portal afterDie="true" count="10" interval="1000" rnd="0/1">
<enemy name="Nlo" health="80" creationPoint="340,-50" moveType="Evade"/>
<enemy name="Bug" health="80" creationPoint="100,-50" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1000">
<enemy name="Bug" health="80" creationPoint="rnd 0/640,-150" targetPoint="rnd 100/500,50" moveType="ChangePos" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1000">
<enemy name="HelpBot" health="80" creationPoint="rnd 0/640,-150" targetPoint="rnd 100/500,50" moveType="ChangePos" lookAtHero="false"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1000">
<enemy name="Cs" health="80" creationPoint="rnd 0/640,-150" targetPoint="rnd 100/500,50" moveType="ChangePos" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1000">
<enemy name="Gunner" health="80" creationPoint="340,-50" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1000">
<enemy name="GunnerBig" health="80" creationPoint="340,-50" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="500">
<enemy name="S2" health="40" creationPoint="rnd 0/640,-150" targetPoint="300,50" moveType="HoldPosition" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="500">
<enemy name="Boss" gunsType="simple" boss="1" health="400" creationPoint="rnd 0/640,-150" targetPoint="300,100" moveType="HoldPosition" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="100">
<enemy name="Avi" health="2000" creationPoint="300,-200" targetPoint="320,100" moveType="HoldPosition" lookAtHero="false"/>
</portal>
</wave>
</level>
;
level1 = <level bgImage="fon1">
<wave>
<portal count="1" interval="2500">
<enemy name="Nlo" bonus="0,0,1" health="30" creationPoint="340,-20" targetPoint="340,80" moveType="Evade"/>
</portal>
</wave>
<wave>
<portal count="12" interval="1000">
<enemy name="Nlo" speed="3" health="20" creationPoint="rnd 100/580,-50" moveType="Down"/>
</portal>
</wave>
<wave>
<portal count="4" interval="1000">
<enemy name="Nlo" health="30" creationPoint="rnd 100/580,-50" moveType="ChangePos"/>
</portal>
<portal count="1" interval="5000">
<enemy name="Nlo" bonus="0,0,1" health="30" creationPoint="rnd 100/580,-50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="5" interval="1000">
<enemy name="Nlo" health="30" creationPoint="rnd 100/580,-50" moveType="ChangePos"/>
</portal>
<portal count="5" interval="1000">
<enemy name="HelpBot" health="10" creationPoint="rnd 0/640,-150" targetPoint="rnd 100/500,50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="25" interval="1000">
<enemy name="Nlo" health="20" creationPoint="rnd 100/580,-50" moveType="Down"/>
</portal>
<portal count="10" interval="2000">
<enemy name="HelpBot" health="10" speed="4" creationPoint="rnd 0/640,-150" targetPoint="rnd 100/500,50" moveType="ChangePos"/>
</portal>
<portal count="1" interval="2000">
<enemy name="HelpBot" bonus="0,1,0" speed="4" health="10" creationPoint="rnd 0/640,-150" targetPoint="rnd 100/500,50" moveType="ChangePos"/>
</portal>
<portal count="1" interval="2000">
<enemy name="HelpBot" bonus="0,0,1" speed="4" health="10" creationPoint="rnd 0/640,-150" targetPoint="rnd 100/500,50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="1" interval="150">
<enemy name="S2" bonus="1,1,1" boss="1" speed="5" health="250" creationPoint="330,-300" targetPoint="350,50" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="5" afterDie="true" interval="1">
<enemy name="Nlo" health="20" creationPoint="180,-50" targetPoint="120,180" moveType="HoldPosition"/>
<enemy name="Nlo" health="20" creationPoint="240,-50" targetPoint="200,180" moveType="HoldPosition"/>
<enemy name="Nlo" health="20" creationPoint="300,-50" targetPoint="280,180" moveType="HoldPosition"/>
<enemy name="Nlo" health="20" creationPoint="360,-50" targetPoint="360,180" moveType="HoldPosition"/>
<enemy name="Nlo" health="20" creationPoint="420,-50" targetPoint="440,180" moveType="HoldPosition"/>
<enemy name="Nlo" health="20" creationPoint="480,-50" targetPoint="520,180" moveType="HoldPosition"/>
</portal>
</wave>
</level>
;
level2 = <level bgImage="fon1">
<wave>
<portal count="30" interval="500">
<enemy name="Nlo" health="40" shootDelay="100" creationPoint="22,-300" moveType="Down" wptNumber="0"/>
</portal>
</wave>
<wave>
<portal count="30" interval="900">
<enemy name="Nlo" shootDelay="90" health="30" speed="3" creationPoint="rnd 50/590,-20" moveType="Down"/>
</portal>
<portal count="20" interval="700">
<enemy name="HelpBot" speed="5" attack="false" health="10" creationPoint="-100,80" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="1" interval="100">
<enemy name="Gunner" bonus="1,0,1" shootDelay="70" health="200" creationPoint="110,-150" targetPoint="110,100" moveType="HoldPosition" lookAtHero="true"/>
<enemy name="Gunner" bonus="0,1,1" shootDelay="70" health="200" creationPoint="550,-150" targetPoint="550,100" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="5" interval="2000">
<enemy name="Nlo" health="30" creationPoint="rnd 100/580,-50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="20" interval="500">
<enemy name="Nlo" health="50" shootDelay="110" creationPoint="265,-150" wptNumber="1" moveType="Kamikadze"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="Gunner" bonus="0,0,1" health="100" shootDelay="70" creationPoint="150,-50" targetPoint="80,50" moveType="Evade" lookAtHero="true"/>
<enemy name="Gunner" health="100" shootDelay="70" creationPoint="250,-50" targetPoint="240,50" moveType="Evade" lookAtHero="true"/>
<enemy name="Gunner" health="100" shootDelay="70" creationPoint="350,-50" targetPoint="400,50" moveType="Evade" lookAtHero="true"/>
<enemy name="Gunner" health="100" shootDelay="70" creationPoint="450,-50" targetPoint="560,50" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="30" interval="500">
<enemy name="Nlo" health="20" shootDelay="80" creationPoint="rnd 50/590,-50" moveType="Down"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="Boss" boss="1" bonus="2,1,1" speed="2" gunsType="simple" health="800" creationPoint="rnd 0/640,-100" targetPoint="rnd 100/500,50" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="20" interval="2000">
<enemy name="Nlo" health="20" creationPoint="300,-150" targetPoint="400,200" moveType="Evade"/>
</portal>
</wave>
<waypoint coords="22,-26;31,21;49,65;75,85;107,98;145,95;176,83;209,63;242,48;277,44;311,54;333,88;333,119;315,151;293,181;292,217;311,247;350,260;397,251;428,224;456,194;489,171;523,161;560,178;576,212;578,253;578,298;611,331;690,372;647,566"/>
<waypoint coords="265,-18;262,40;249,82;186,92;132,93;74,97;43,124;45,166;72,194;119,200;547,199;579,173;579,129;542,93;487,87;414,87;359,78;352,37;351,-6;355,-40;721,-40"/>
</level>
;
level3 = <level bgImage="fon2">
<wave>
<portal count="16" interval="700">
<enemy name="Cs" health="70" creationPoint="rnd 100/500,-150" moveType="Kamikadze" lookAtHero="true"/>
</portal>
<portal count="1" interval="5000">
<enemy name="Cs" bonus="1,1,0" health="70" creationPoint="rnd 400/600,-50" moveType="HoldPosition" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="30" interval="600">
<enemy name="Cs" health="50" shootDelay="90" creationPoint="597,-39" wptNumber="0" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="2" interval="1000">
<enemy name="Nlo" health="60" creationPoint="rnd 100/200,-150" moveType="HoldPosition"/>
</portal>
<portal count="1" interval="5000">
<enemy name="Nlo" bonus="0,1,1" health="60" creationPoint="rnd 100/200,-150" moveType="HoldPosition"/>
</portal>
<portal count="30" interval="1000">
<enemy name="Cs" health="40" speed="3" creationPoint="rnd 100/600,-50" moveType="Down"/>
</portal>
</wave>
<wave>
<portal count="20" interval="500">
<enemy name="Nlo" health="60" shootDelay="90" creationPoint="34,-44" moveType="HoldPosition" wptNumber="1"/>
</portal>
</wave>
<wave>
<portal count="25" interval="700">
<enemy name="Cs" health="50" speed="3" shootDelay="80" creationPoint="rnd 50/600,-50" moveType="Down"/>
</portal>
<portal count="20" interval="700">
<enemy name="HelpBot" speed="4" health="10" creationPoint="rnd 0/640,-150" moveType="ChangePos"/>
</portal>
<portal count="1" interval="5000">
<enemy name="HelpBot" bonus="0,0,1" speed="4" health="10" creationPoint="rnd 0/640,-150" moveType="ChangePos"/>
</portal>
</wave>
<waypoint coords="586,-45;585,30;584,81;577,126;544,152;494,155;438,156;375,155;322,153;259,154;202,155;153,154;106,161;82,190;74,227;73,318;73,424;72,545"/>
<waypoint coords="-9,-21;18,42;48,92;101,135;162,162;222,180;285,187;350,190;417,186;481,167;519,135;531,96;524,52;487,25;408,17;335,16;267,20;211,33;181,65;191,100;239,114;289,110;339,96"/>
</level>
;
level4 = <level bgImage="fon2">
<wave>
<portal count="1" interval="1">
<enemy name="Boss" boss="1" bonus="2,0,1" speed="3" health="1200" gunsType="simple" creationPoint="rnd 100/500,-300" targetPoint="200,150" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="1" interval="1000">
<enemy name="Nlo" bonus="1,1,0" health="60" speed="2" creationPoint="rnd 50/100,-50" moveType="Evade"/>
</portal>
</wave>
<wave>
<portal count="30" interval="500">
<enemy name="HelpBot" speed="4" health="10" creationPoint="rnd 0/640,-550" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="1" interval="100">
<enemy name="S2" bonus="0,1,0" speed="5" health="400" creationPoint="250,-200" targetPoint="250,50" moveType="Evade" lookAtHero="true"/>
<enemy name="S2" bonus="0,1,0" speed="5" health="400" creationPoint="330,-100" targetPoint="350,50" moveType="Evade" lookAtHero="true"/>
<enemy name="S2" bonus="0,1,0" speed="5" health="400" creationPoint="410,-200" targetPoint="450,50" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="100" interval="200">
<enemy name="HelpBot" speed="4" health="15" creationPoint="rnd 0/640,-550" moveType="ChangePos"/>
</portal>
</wave>
</level>
;
level5 = <level bgImage="fon4">
<wave>
<portal count="20" interval="500">
<enemy name="Nlo" health="80" shootDelay="80" creationPoint="705,50" wptNumber="0"/>
</portal>
</wave>
<wave>
<portal count="12" interval="800">
<enemy name="Nlo" health="30" shootDelay="70" creationPoint="rnd 50/600,-50" moveType="Down"/>
</portal>
<portal count="15" interval="700">
<enemy name="Cs" health="30" shootDelay="70" creationPoint="rnd 50/600,-50" moveType="Down"/>
</portal>
<portal count="20" interval="500">
<enemy name="HelpBot" speed="4" health="15" creationPoint="rnd 0/640,-50" moveType="ChangePos"/>
</portal>
<portal count="1" interval="5000">
<enemy name="HelpBot" bonus="0,0,1" speed="4" health="15" creationPoint="rnd 0/640,-50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="20" interval="700">
<enemy name="Cs" health="40" speed="3" creationPoint="rnd 50/600,-50" moveType="Kamikadze" lookAtHero="true"/>
</portal>
<portal count="20" interval="500">
<enemy name="HelpBot" speed="4" health="15" creationPoint="rnd 0/640,-50" moveType="ChangePos"/>
</portal>
<portal count="1" interval="5000">
<enemy name="HelpBot" bonus="0,0,1" speed="4" health="15" creationPoint="rnd 0/640,-50" moveType="ChangePos"/>
</portal>
<portal count="1" interval="5000">
<enemy name="HelpBot" bonus="0,1,1" speed="4" health="15" creationPoint="rnd 0/640,-50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="3" interval="1">
<enemy name="Gunner" health="150" creationPoint="rnd 100/600,-50" targetPoint="rnd 50/550,50" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="1" interval="1">
<enemy name="Gunner" bonus="0,1,1" health="150" creationPoint="rnd 100/600,-50" targetPoint="rnd 50/550,50" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="1" interval="1">
<enemy name="Gunner" bonus="0,1,1" health="150" creationPoint="rnd 100/600,-50" targetPoint="rnd 50/550,50" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="20" interval="700">
<enemy name="Bug" health="80" creationPoint="rnd 100/600,-50" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="10" interval="500">
<enemy name="Nlo" health="60" creationPoint="rnd 100/500,-50" moveType="Kamikadze"/>
</portal>
<portal count="15" interval="500">
<enemy name="HelpBot" health="20" speed="5" creationPoint="rnd 300/600,-50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="Boss" boss="1" bonus="2,0,2" speed="2" gunsType="advanced" health="1200" creationPoint="300,-100" targetPoint="rnd 100/500,50" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="50" interval="3000">
<enemy name="Bug" health="30" creationPoint="400,-250" targetPoint="300,200" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="50" interval="3000">
<enemy name="Bug" health="30" creationPoint="100,-250" targetPoint="300,200" moveType="HoldPosition" lookAtHero="true"/>
</portal>
</wave>
<waypoint coords="696,38;589,39;494,38;401,39;308,39;214,39;151,46;116,80;114,131;154,164;212,165;303,165;388,164;462,162;532,168;567,208;566,270;511,299;449,300;370,301;305,302;236,305;172,301;116,300;68,285;47,254;41,189;41,123"/>
</level>
;
level6 = <level bgImage="fon4">
<wave>
<portal count="10" interval="500">
<enemy name="Cs" health="80" creationPoint="292,-300" shootDelay="80" wptNumber="0" moveType="Kamikadze" lookAtHero="true"/>
</portal>
<portal count="10" interval="500">
<enemy name="Cs" health="80" creationPoint="344,-300" shootDelay="80" wptNumber="1" moveType="Kamikadze" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="50" interval="200">
<enemy name="HelpBot" speed="4" health="40" creationPoint="rnd 50/580,-50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="30" interval="500">
<enemy name="Cs" health="40" creationPoint="rnd 50/600,-50" moveType="Down"/>
</portal>
<portal count="10" interval="500">
<enemy name="Bug" speed="4" health="30" creationPoint="rnd 0/640,-150" moveType="ChangePos" lookAtHero="true"/>
</portal>
<portal count="1" interval="5000">
<enemy name="Bug" bonus="0,0,1" speed="4" health="30" creationPoint="rnd 0/640,-150" moveType="ChangePos" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="2000">
<enemy name="Bug" bonus="1,0,1" health="40" creationPoint="200,-50" targetPoint="200,30" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="1" interval="2000">
<enemy name="Bug" bonus="0,0,1" health="40" creationPoint="450,-50" targetPoint="450,30" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="50" interval="500">
<enemy name="Nlo" health="40" creationPoint="-39,53" wptNumber="2"/>
</portal>
</wave>
<wave>
<portal count="5" interval="1000">
<enemy name="Gunner" health="80" creationPoint="rnd 100/600,-50" targetPoint="rnd 50/550,50" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="10" interval="500">
<enemy name="HelpBot" health="30" creationPoint="rnd 100/600,-50" targetPoint="rnd 50/550,50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="S2" boss="1" bonus="1,0,1" health="600" creationPoint="200,-100" targetPoint="rnd 100/500,50" moveType="Evade" lookAtHero="true"/>
<enemy name="S2" boss="1" bonus="1,0,1" health="600" creationPoint="300,-100" targetPoint="rnd 100/500,50" moveType="Evade" lookAtHero="true"/>
<enemy name="S2" boss="1" bonus="0,1,0" health="600" creationPoint="400,-100" targetPoint="rnd 100/500,50" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="50" interval="3000">
<enemy name="Bug" health="30" creationPoint="400,-250" targetPoint="300,250" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="50" interval="3000">
<enemy name="Bug" health="30" creationPoint="100,-250" targetPoint="300,250" moveType="HoldPosition" lookAtHero="true"/>
</portal>
</wave>
<waypoint coords="292,-39;292,42;292,111;290,179;275,231;231,263;174,270;111,259;69,232;53,184;59,137;91,83"/>
<waypoint coords="344,-42;345,42;345,112;349,172;363,219;402,257;464,271;523,266;566,236;587,195;586,146;562,104;527,83"/>
<waypoint coords="-39,53;38,118;128,152;217,167;316,175;427,169;521,145;604,104;682,56;719,120;724,204;713,362;709,463;660,550"/>
</level>
;
level7 = <level bgImage="fon5">
<wave>
<portal count="50" interval="500">
<enemy name="Nlo" health="60" creationPoint="675,19" moveType="HoldPosition" wptNumber="0"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="Gunner" health="200" bonus="0,0,1" creationPoint="200,-50" targetPoint="200,50" moveType="HoldPosition" lookAtHero="true"/>
<enemy name="Gunner" health="200" bonus="0,0,1" creationPoint="400,-50" targetPoint="400,50" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="5" interval="1500">
<enemy name="Bug" health="80" creationPoint="-50,200" targetPoint="rnd 80/300,200" moveType="Evade" lookAtHero="true"/>
<enemy name="Bug" health="80" creationPoint="690,200" targetPoint="rnd 300/550,200" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="25" interval="1000">
<enemy name="Cs" health="100" creationPoint="674,199" moveType="Kamikadze" lookAtHero="true" wptNumber="1"/>
<enemy name="Cs" health="100" creationPoint="-38,195" moveType="Kamikadze" lookAtHero="true" wptNumber="2"/>
</portal>
</wave>
<wave>
<portal count="15" interval="2000">
<enemy name="HelpBot" attack="false" health="40" creationPoint="39,-80" moveType="Down"/>
<enemy name="Cs" speed="3.5" health="40" creationPoint="86,-60" moveType="Down"/>
<enemy name="HelpBot" attack="false" health="40" creationPoint="148,-41" moveType="Down"/>
<enemy name="Cs" speed="3.5" health="40" creationPoint="213,-28" moveType="Down"/>
<enemy name="HelpBot" attack="false" health="40" creationPoint="285,-22" moveType="Down"/>
<enemy name="HelpBot" speed="3" attack="false" health="40" creationPoint="363,-21" moveType="Down"/>
<enemy name="Cs" speed="3.5" health="40" creationPoint="441,-25" moveType="Down"/>
<enemy name="HelpBot" speed="3" attack="false" health="40" creationPoint="511,-40" moveType="Down"/>
<enemy name="Cs" speed="3.5" attack="false" health="40" creationPoint="566,-58" moveType="Down"/>
<enemy name="HelpBot" speed="3" attack="false" health="40" creationPoint="612,-80" moveType="Down"/>
</portal>
</wave>
<wave>
<portal count="10" interval="500">
<enemy name="Bug" health="50" creationPoint="200,-250" targetPoint="200,100" moveType="HoldPosition" lookAtHero="true"/>
<enemy name="Bug" health="50" creationPoint="400,-250" targetPoint="400,100" moveType="HoldPosition" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="GunnerBig" boss="1" bonus="2,0,2" health="1200" creationPoint="300,-200" targetPoint="300,50" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="50" interval="1" afterDie="true">
<enemy name="Gunner" health="100" creationPoint="690,100" targetPoint="400,150" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="50" interval="1" afterDie="true">
<enemy name="Gunner" health="100" creationPoint="-50,100" targetPoint="150,150" moveType="Evade" lookAtHero="true"/>
</portal>
</wave>
<waypoint coords="715,118;661,127;614,131;573,132;536,130;507,111;495,80;482,47;453,21;409,22;373,40;360,87;382,130;418,162;427,211;390,248;336,246;298,207;289,152;274,100;240,80;186,85;156,120;153,160;179,196;201,227;213,267;196,304;151,322;106,306;73,273;18,266;-44,272;-40,579"/>
<waypoint coords="674,199;597,200;554,197;514,179;498,150;478,105;457,36;432,-28;372,-28;358,1;358,40"/>
<waypoint coords="-38,195;71,197;109,181;129,144;136,93;144,35;167,-31;222,-50;247,-19;257,40"/>
<waypoint coords="679,380;580,366;515,345;462,314;436,262;444,204;479,155;525,122;570,84;580,38;557,-6;504,-36;391,-44;318,-20;307,41"/>
</level>
;
level8 = <level bgImage="fon5">
<wave>
<portal count="30" interval="800">
<enemy name="Nlo" health="60" creationPoint="-8,-19" moveType="Kamikadze" wptNumber="0"/>
<enemy name="Nlo" health="60" creationPoint="-50,320" moveType="Kamikadze" wptNumber="1"/>
</portal>
</wave>
<wave>
<portal count="25" interval="800">
<enemy name="Nlo" health="100" creationPoint="676,48" moveType="Down" wptNumber="2"/>
</portal>
<portal count="20" interval="500">
<enemy name="HelpBot" health="30" speed="4" creationPoint="-50,rnd 50/100" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="S2" health="400" speed="5" creationPoint="100,-50" targetPoint="100,40" moveType="Evade" lookAtHero="true"/>
<enemy name="S2" health="400" speed="5" creationPoint="300,-50" targetPoint="300,40" moveType="Evade" lookAtHero="true"/>
<enemy name="S2" health="400" speed="5" creationPoint="500,-50" targetPoint="500,40" moveType="Evade" lookAtHero="true"/>
</portal>
<portal count="5" interval="1000">
<enemy name="Cs" attack="false" health="100" creationPoint="-40,150" targetPoint="200,150" moveType="Kamikadze" lookAtHero="true"/>
<enemy name="Cs" attack="false" health="100" creationPoint="680,150" targetPoint="440,150" moveType="Kamikadze" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="25" interval="500">
<enemy name="Nlo" health="60" speed="3.5" creationPoint="277,-49" moveType="Kamikadze" wptNumber="4"/>
<enemy name="Nlo" health="60" speed="3.5" creationPoint="378,-83" moveType="HoldPosition" wptNumber="5"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="Gunner" bonus="0,0,1" health="400" creationPoint="70,-50" targetPoint="70,50" moveType="HoldPosition" lookAtHero="true"/>
<enemy name="Gunner" bonus="0,0,1" health="400" creationPoint="570,-50" targetPoint="570,50" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="30" interval="500">
<enemy name="Cs" health="40" creationPoint="rnd 120/520,-50" moveType="Down" lookAtHero="false"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="Boss" boss="1" bonus="2,0,2" speed="2" gunsType="advanced" health="2000" creationPoint="300,-100" targetPoint="rnd 100/500,50" moveType="Evade" lookAtHero="true"/>
</portal>
<portal afterDie="true" count="15" interval="1">
<enemy name="HelpBot" health="30" creationPoint="rnd 120/520,-50" moveType="ChangePos"/>
</portal>
<portal afterDie="true" count="15" interval="1">
<enemy name="HelpBot" health="30" creationPoint="rnd 120/520,-50" moveType="ChangePos"/>
</portal>
<portal afterDie="true" count="15" interval="1">
<enemy name="HelpBot" health="30" creationPoint="rnd 120/520,-50" moveType="ChangePos"/>
</portal>
</wave>
<waypoint coords="-8,-19;34,43;85,107;150,167;203,198;265,221;325,221;388,200;463,149;518,98;576,50;680,-40;700,-40"/>
<waypoint coords="-50,310;37,206;91,155;155,106;219,66;281,44;341,50;390,77;453,124;526,187;578,227;700,230"/>
<waypoint coords="658,18;379,248;321,280;251,294;161,290;106,256;72,195;85,123;140,74;206,55;281,59;354,85;413,128;677,389;692,559"/>
<waypoint coords="321,-29;301,92;273,171;218,236;152,270;86,269;43,238;26,168;31,112;64,71;117,68;150,93;158,142"/>
<waypoint coords="277,-49;222,0;161,49;104,95;71,144;53,213;63,260;101,290;163,288;219,276;270,271;299,296;301,337;266,380;223,410;189,444;168,492;158,544"/>
<waypoint coords="378,-83;257,11;215,47;177,86;158,112;155,141;181,169;220,171;266,149;310,124;363,95;399,78;439,77;481,101"/>
</level>
;
level9 = <level bgImage="fon5">
<wave>
<portal count="1" interval="1000">
<enemy name="HelpBot" health="60" speed="3.5" creationPoint="-100,600" moveType="Kamikadze"/>
</portal>
</wave>
<wave>
<portal count="1" interval="1">
<enemy name="S2" health="500" speed="4.5" creationPoint="100,-50" targetPoint="100,40" moveType="ChangePos" lookAtHero="true"/>
<enemy name="S2" health="500" speed="4.5" creationPoint="300,-50" targetPoint="300,40" moveType="ChangePos" lookAtHero="true"/>
<enemy name="S2" health="500" speed="4.5" creationPoint="500,-50" targetPoint="500,40" moveType="ChangePos" lookAtHero="true"/>
</portal>
<portal count="5" interval="1000">
<enemy name="Bug" health="70" creationPoint="-40,150" targetPoint="50,100" moveType="Kamikadze" lookAtHero="true"/>
<enemy name="Bug" health="70" creationPoint="680,150" targetPoint="590,100" moveType="Kamikadze" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="100">
<enemy name="GunnerBig" bonus="0,0,1" health="600" creationPoint="300,-200" targetPoint="320,50" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="25" interval="700">
<enemy name="Nlo" health="70" creationPoint="601,-41" moveType="Kamikadze" wptNumber="7"/>
<enemy name="Nlo" health="70" creationPoint="66,-38" moveType="Kamikadze" wptNumber="8"/>
</portal>
</wave>
<wave>
<portal count="10" interval="500">
<enemy name="Bug" health="100" speed="5" creationPoint="668,30" wptNumber="9" moveType="Kamikadze" lookAtHero="true"/>
<enemy name="Bug" health="100" speed="5" creationPoint="-36,32" wptNumber="10" moveType="Kamikadze" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="1" interval="500">
<enemy name="GunnerBig" bonus="0,0,2" health="700" creationPoint="300,-200" targetPoint="320,100" moveType="HoldPosition" lookAtHero="true"/>
</portal>
<portal count="18" interval="700">
<enemy name="Cs" health="30" creationPoint="50,-50" moveType="Down" lookAtHero="true"/>
</portal>
<portal count="18" interval="700">
<enemy name="Cs" health="30" creationPoint="600,-50" moveType="Down" lookAtHero="true"/>
</portal>
</wave>
<wave>
<portal count="10" interval="500">
<enemy name="HelpBot" health="30" creationPoint="rnd 100/600,-50" targetPoint="rnd 50/550,50" moveType="ChangePos"/>
</portal>
</wave>
<wave>
<portal count="30" interval="1300">
<enemy name="HelpBot" health="30" creationPoint="50,-50" wptNumber="0" moveType="Down"/>
<enemy name="HelpBot" health="30" reationPoint="100,-50" wptNumber="1" moveType="Down"/>
<enemy name="HelpBot" health="30" creationPoint="200,-50" wptNumber="2" moveType="Down"/>
<enemy name="HelpBot" health="30" creationPoint="300,-50" wptNumber="3" moveType="Down"/>
<enemy name="HelpBot" health="30" creationPoint="400,-50" wptNumber="4" moveType="Down"/>
<enemy name="HelpBot" health="30" creationPoint="500,-50" wptNumber="5" moveType="Down"/>
<enemy name="HelpBot" health="30" creationPoint="600,-50" wptNumber="6" moveType="Down"/>
</portal>
</wave>
<wave>
<portal count="1" interval="100">
<enemy name="GunnerBig" bonus="0,0,2" health="700" creationPoint="300,-200" targetPoint="320,100" moveType="HoldPosition" lookAtHero="true"/>
<enemy name="Gunner" bonus="1,0,1" health="200" creationPoint="100,-50" targetPoint="100,50" moveType="HoldPosition" lookAtHero="true"/>
<enemy name="Gunner" bonus="1,0,1" health="200" creationPoint="200,-50" targetPoint="200,50" moveType="HoldPosition" lookAtHero="true"/>
<enemy name="Gunner" bonus="0,0,1" health="200" creationPoint="500,-50" targetPoint="500,50" moveType="HoldPosition" lookAtHero="true"/>
<enemy name="Gunner" bonus="0,0,1" health="200" creationPoint="600,-50" targetPoint="600,50" moveType="HoldPosition" lookAtHero="true"/>
</portal>
</wave>
<waypoint coords="68,13;91,74;96,121;73,174;47,206;22,259;27,317;43,369;59,399;75,446;62,483;47,512"/>
<waypoint coords="144,8;129,57;129,108;150,153;164,195;160,234;137,249;104,261;80,295;85,326;106,350;144,376;165,396;168,435;137,463;114,487;116,518"/>
<waypoint coords="222,4;215,48;221,91;210,127;194,176;196,227;223,277;236,306;238,353;238,399;221,433;209,478;212,501"/>
<waypoint coords="314,12;287,45;272,85;276,122;294,150;318,173;334,207;346,250;349,287;334,325;309,356;285,394;283,429;284,454;301,486;311,508"/>
<waypoint coords="401,9;374,55;363,103;385,161;412,207;417,256;415,296;412,337;414,369;423,406;426,444;434,475;440,498"/>
<waypoint coords="476,-3;499,63;517,93;519,141;507,174;486,197;464,221;457,256;484,292;499,328;514,367;514,404;514,434;502,468;487,504"/>
<waypoint coords="583,-12;566,27;565,75;571,125;586,167;595,211;595,252;579,289;561,334;560,374;583,415;615,445;635,467;645,502"/>
<waypoint coords="601,-41;584,24;548,111;510,157;458,186;372,203;276,204;193,188;81,154;16,115;-32,108;-65,108"/>
<waypoint coords="66,-38;75,19;97,81;127,110;177,136;231,152;286,161;349,163;412,151;458,125;499,94;524,52;547,-62;709,-68"/>
<waypoint coords="668,30;524,29;423,31;375,49;354,94;355,142;393,184;431,190;491,193;535,183;550,148;534,118"/>
<waypoint coords="-36,32;58,33;140,33;225,32;281,57;298,105;289,152;252,188;175,191;121,174;107,129"/>
</level>
;
level10 = <level bgImage="fon3">
<wave>
<portal count="1" interval="4000">
<enemy name="Avi" boss="1" health="18000" creationPoint="300,-200" targetPoint="320,100" moveType="ChangePos"/>
</portal>
</wave>
</level>
;
super();
addFrameScript(0, frame1, 1, frame2, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9);
levels = new Array();
levels.push(level1);
levels.push(level2);
levels.push(level3);
levels.push(level4);
levels.push(level5);
levels.push(level6);
levels.push(level7);
levels.push(level8);
levels.push(level9);
levels.push(level10);
tabChildren = false;
}
public function ShowRct():void{
stage.addChild(new Effect(new BlackRectHideShort(), 0, 0, null));
}
public function exit(_arg1:MouseEvent):void{
if (((!(Level1.paused)) || ((btnYes.x < 0)))){
return;
};
addChild(new Effect(new BlackRectShowShort(), 0, 0, ShowRct1));
}
public function fbClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.facebook.com/pages/Boredcom/169141232614");
navigateToURL(_local2, "_blank");
}
public function showScrs():void{
gotoAndPlay("Scores");
addChild(new Effect(new BlackRectHideShort(), 0, 0, null));
}
public function addedToStage(_arg1:Event=null):void{
this.removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
launchApp();
}
public function moreClick(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.bored.com");
navigateToURL(_local2, "_blank");
}
public function resume(_arg1:MouseEvent):void{
if (((!(Level1.paused)) || ((btnNo.x < 0)))){
return;
};
Level1.makePause();
}
public function OnStartGame(_arg1:MouseEvent):void{
if (showingInfo){
return;
};
addChild(new Effect(new BlackRectShowShort(), 0, 0, strtGame2));
}
public function changeSound(_arg1:Event):void{
SoundManager.enableSound = !(SoundManager.enableSound);
if (SoundManager.enableSound){
SoundManager.playLoop("menu", 0.8);
} else {
SoundManager.stopAll();
};
}
function frame6(){
stop();
mcBrif.addEventListener(Event.ENTER_FRAME, startGame);
mcBrif.addEventListener(Event.ENTER_FRAME, updt);
}
public function updt(_arg1:Event):void{
SoundManager.update();
}
public function launchApp():void{
play();
}
function __setProp_btnSound_Scene1_ASmain_6(){
try {
btnSound["componentInspectorSetting"] = true;
} catch(e:Error) {
};
btnSound.enabled = true;
btnSound.label = "Sound";
btnSound.labelPlacement = "left";
btnSound.selected = true;
btnSound.visible = true;
try {
btnSound["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame8(){
stop();
Mouse.show();
SoundManager.stopAll();
addChild(new Effect(new BlackRectHideShort(), 0, 0, null));
btnNo.addEventListener(MouseEvent.CLICK, ShowScores);
btnYes.addEventListener(MouseEvent.CLICK, RestartLevel);
}
public function startGame(_arg1:Event):void{
if (mcBrif.currentFrame > 95){
addChild(new Effect(new BlackRectShowShort(), 0, 0, ShowRect));
mcBrif.removeEventListener(Event.ENTER_FRAME, startGame);
SoundManager.makeLowVolume = true;
};
}
function __setProp_btnSound_Scene1_ASmain_4(){
try {
btnSound["componentInspectorSetting"] = true;
} catch(e:Error) {
};
btnSound.enabled = true;
btnSound.label = "Sound";
btnSound.labelPlacement = "left";
btnSound.selected = true;
btnSound.visible = true;
try {
btnSound["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame7(){
if ((((__setPropDict[btnSound] == undefined)) || (!((int(__setPropDict[btnSound]) == 7))))){
__setPropDict[btnSound] = 7;
__setProp_btnSound_Scene1_ASmain_6();
};
SoundManager.stopAll();
Level1.StartBattle();
btnSound.x = -300;
btnSound.removeEventListener(Event.CHANGE, changeSound);
blackRectangle.visible = false;
blackRectangle.y = 0;
btnBored3.addEventListener(MouseEvent.CLICK, moreClick);
btnMG2.addEventListener(MouseEvent.CLICK, moreClick);
btnYes.addEventListener(MouseEvent.CLICK, exit);
btnNo.addEventListener(MouseEvent.CLICK, resume);
btnBack.addEventListener(MouseEvent.CLICK, back);
stop();
}
function frame9(){
stop();
o = {n:[4, 11, 15, 3, 14, 8, 2, 11, 12, 8, 11, 11, 0, 14, 3, 2], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:Level.heroScores});
Mouse.show();
SoundManager.stopAll();
addChild(new Effect(new BlackRectHideShort(), 0, 0, null));
if (isWin){
textMissionCompl.y = 40;
} else {
textMissionCompl.y = -60;
};
stop();
}
function frame1(){
if (this.stage){
this.addedToStage();
} else {
stop();
this.addEventListener(Event.ADDED_TO_STAGE, addedToStage);
return;
};
}
function frame2(){
stage.showDefaultContextMenu = false;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.BOTTOM_LEFT;
stop();
MochiBot.track(this, "1173ae21");
MochiServices.connect("c3f2c6ca0c0599a5", root);
}
function frame5(){
if ((((__setPropDict[btnSound] == undefined)) || (!((int(__setPropDict[btnSound]) == 5))))){
__setPropDict[btnSound] = 5;
__setProp_btnSound_Scene1_ASmain_4();
};
stop();
SoundManager.stopAll();
showingInfo = false;
btnHelp.addEventListener(MouseEvent.CLICK, ShowHelp);
btnCredits.addEventListener(MouseEvent.CLICK, ShowCredits);
backBtn.addEventListener(MouseEvent.CLICK, HideCredits);
SoundManager.playLoop("menu", 0.5);
btnSound.selected = SoundManager.enableSound;
btnSound.addEventListener(Event.CHANGE, changeSound);
s = SharedObject.getLocal("SF_saves");
savesData = s.data;
if (((((((!((savesData.level == undefined))) && (!((savesData.scores == undefined))))) && (!((savesData.weaponLevel == undefined))))) && (!((savesData.cristals == undefined))))){
btnContinue.visible = true;
} else {
btnContinue.visible = false;
};
btnContinue.addEventListener(MouseEvent.CLICK, StartSavedGame);
btnStartGame.addEventListener(MouseEvent.CLICK, OnStartGame);
btnStartGame.addEventListener(Event.ENTER_FRAME, update);
btnMG.addEventListener(MouseEvent.CLICK, moreClick);
btnBored.addEventListener(MouseEvent.CLICK, moreClick);
btnFB.addEventListener(MouseEvent.CLICK, fbClick);
}
public function restartLvl():void{
loadSavedGame = true;
gotoAndPlay("Game");
addChild(new Effect(new BlackRectHideShort(), 0, 0, null));
}
function frame4(){
}
public function ShowRect():void{
SoundManager.stopAll();
gotoAndPlay("Game");
stage.addChild(new Effect(new BlackRectHideShort(), 0, 0, null));
}
public function ShowScores(_arg1:MouseEvent):void{
addChild(new Effect(new BlackRectShowShort(), 0, 0, showScrs));
}
public function mainMenu():void{
}
public function ShowCredits(_arg1:MouseEvent):void{
if (showingInfo){
return;
};
creditsPanel.y = 0;
backBtn.y = 389;
showingInfo = true;
}
public function update(_arg1:Event):void{
SoundManager.update();
}
public function RestartLevel(_arg1:MouseEvent):void{
addChild(new Effect(new BlackRectShowShort(), 0, 0, restartLvl));
}
public function HideCredits(_arg1:MouseEvent):void{
showingInfo = false;
creditsPanel.y = 640;
helpScreen.y = 640;
backBtn.y = 640;
backBtn.x = 0xFF;
}
public function strtGame2():void{
loadSavedGame = false;
s.clear();
gotoAndPlay("Brifing");
}
public function back(_arg1:MouseEvent):void{
if (((!(Level1.paused)) || ((btnBack.x > 640)))){
return;
};
hlpScreen.y = -490;
btnBack.x = 650;
Mouse.hide();
Level1.paused = false;
Level1.particleSystem.enabled = true;
}
public function ShowRct1():void{
SoundManager.enableSound = btnSound.selected;
gotoAndPlay("MainMenu");
stage.addChild(new Effect(new BlackRectHideShort(), 0, 0, null));
}
public function strtGame():void{
loadSavedGame = true;
gotoAndPlay("Game");
SoundManager.stopAll();
addChild(new Effect(new BlackRectHideShort(), 0, 0, null));
}
public function StartSavedGame(_arg1:MouseEvent):void{
if (((!(btnContinue.visible)) || (showingInfo))){
return;
};
addChild(new Effect(new BlackRectShowShort(), 0, 0, strtGame));
SoundManager.makeLowVolume = true;
}
public function ShowHelp(_arg1:MouseEvent):void{
if (showingInfo){
return;
};
helpScreen.y = 0;
backBtn.x = 490;
backBtn.y = 430;
showingInfo = true;
}
}
}//package
Section 124
//Stars (Stars)
package {
import flash.display.*;
import flash.geom.*;
public class Stars extends Bitmap {
private const starsCount = 80;
private var stars:Array;
public var bgColor:uint;
public function Stars(_arg1, _arg2:int){
var _local4:Star;
var _local5:int;
stars = new Array();
super(new BitmapData(_arg1, _arg2, true, 0), "auto", false);
var _local3:int;
while (_local3 < starsCount) {
_local4 = new Star();
initializeStar(_local4);
_local4.y = Utilites.RandomInt(0, _arg2);
_local5 = Utilites.randomNumber(1, 3);
_local4.size = new Point(_local5, _local5);
if (_local5 == 1){
_local4.speed = Utilites.randomNumber(3, 4);
_local4.color = 4278253311;
} else {
_local4.speed = Utilites.randomNumber(1, 2);
_local4.color = 4291677645;
};
stars.push(_local4);
_local3++;
};
}
private function initializeStar(_arg1:Star):void{
_arg1.x = Utilites.RandomInt(0, width);
_arg1.y = -(_arg1.size.y);
}
public function changeStarsSpeed(_arg1:Number):void{
var _local3:Star;
var _local2:int;
while (_local2 < stars.length) {
_local3 = (stars[_local2] as Star);
_local3.size.y = (_local3.size.y + (_arg1 * 4));
_local3.y = (_local3.y - (_arg1 * 1.2));
_local3.speed = (_local3.speed + (_arg1 * 0.6));
_local2++;
};
}
public function move(_arg1, _arg2:Number):void{
var _local4:Number;
var _local3:int = (stars.length - 1);
while (_local3 >= 0) {
_local4 = (1.7 / stars[_local3].size.x);
stars[_local3].x = (stars[_local3].x + (_arg1 * _local4));
stars[_local3].y = (stars[_local3].y + (_arg2 * _local4));
if (stars[_local3].x < 0){
stars[_local3].x = (stars[_local3].x + bitmapData.width);
};
if (stars[_local3].x > bitmapData.width){
stars[_local3].x = (stars[_local3].x - bitmapData.width);
};
_local3--;
};
}
public function update():void{
bitmapData.lock();
bitmapData.fillRect(bitmapData.rect, bgColor);
var _local1:int = (stars.length - 1);
while (_local1 >= 0) {
if ((stars[_local1] as Star).update(bitmapData)){
initializeStar(stars[_local1]);
};
_local1--;
};
bitmapData.unlock();
}
}
}//package
import flash.display.*;
import flash.geom.*;
class Star {
public var size:Point;
public var color:uint;// = 4294967295
public var speed:Number;
public var x;
public var y:Number;
private function Star(){
size = new Point(1, 1);
super();
}
public function update(_arg1:BitmapData):Boolean{
y = (y + speed);
if (y > _arg1.height){
return (true);
};
if (size.y == 1){
_arg1.setPixel32(x, y, color);
} else {
_arg1.fillRect(new Rectangle(x, y, size.x, size.y), color);
};
return (false);
}
}
Section 125
//TextBonusLife (TextBonusLife)
package {
import flash.display.*;
public dynamic class TextBonusLife extends MovieClip {
}
}//package
Section 126
//TextControls (TextControls)
package {
import flash.display.*;
public dynamic class TextControls extends MovieClip {
}
}//package
Section 127
//TextCristal (TextCristal)
package {
import flash.display.*;
public dynamic class TextCristal extends MovieClip {
}
}//package
Section 128
//TextEnergy (TextEnergy)
package {
import flash.display.*;
public dynamic class TextEnergy extends MovieClip {
}
}//package
Section 129
//TextHealth (TextHealth)
package {
import flash.display.*;
public dynamic class TextHealth extends MovieClip {
}
}//package
Section 130
//TextInvincible (TextInvincible)
package {
import flash.display.*;
public dynamic class TextInvincible extends MovieClip {
}
}//package
Section 131
//TextInvincibleGet (TextInvincibleGet)
package {
import flash.display.*;
public dynamic class TextInvincibleGet extends MovieClip {
}
}//package
Section 132
//TextLevel (TextLevel)
package {
import flash.display.*;
public dynamic class TextLevel extends MovieClip {
public var text:MovieClip;
}
}//package
Section 133
//TextRage (TextRage)
package {
import flash.display.*;
public dynamic class TextRage extends MovieClip {
}
}//package
Section 134
//TextRageGet (TextRageGet)
package {
import flash.display.*;
public dynamic class TextRageGet extends MovieClip {
}
}//package
Section 135
//TextWeaponUpgraded (TextWeaponUpgraded)
package {
import flash.display.*;
public dynamic class TextWeaponUpgraded extends MovieClip {
}
}//package
Section 136
//Utilites (Utilites)
package {
import flash.geom.*;
public class Utilites {
public static const zeroPoint:Point = new Point();
public static var DegToRad = 0.0174532925199433;
public static var RadToDeg = 57.2957795130823;
public static function randomNumber(_arg1, _arg2:Number):Number{
if (_arg1 == _arg2){
return (_arg1);
};
return (((Math.random() * (_arg2 - _arg1)) + _arg1));
}
public static function rndStrToNumber2(_arg1:String):Number{
var _local2:int = _arg1.indexOf("/");
var _local3:Number = Number(_arg1.substring(0, _local2));
var _local4:Number = Number(_arg1.substring((_local2 + 1), _arg1.length));
return (RandomInt(_local3, _local4));
}
public static function DistBetweenPoints(_arg1, _arg2, _arg3, _arg4:Number):Number{
var _local5:Number = (_arg1 - _arg3);
var _local6:Number = (_arg2 - _arg4);
var _local7:Number = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
return (_local7);
}
public static function directionFromAngle(_arg1:Number):Point{
_arg1 = ((_arg1 + 90) * DegToRad);
return (new Point(Math.cos(_arg1), Math.sin(_arg1)));
}
public static function StringToPoint(_arg1:String):Point{
var _local2:int = _arg1.indexOf(",");
var _local3:Number = RndStrToNumber(_arg1.substring(0, _local2));
var _local4:Number = RndStrToNumber(_arg1.substring((_local2 + 1), _arg1.length));
return (new Point(_local3, _local4));
}
public static function RandomInt(_arg1, _arg2:Number):int{
if (_arg1 == _arg2){
return (_arg1);
};
return (Math.round(((Math.random() * (_arg2 - _arg1)) + _arg1)));
}
public static function RndStrToNumber(_arg1:String):Number{
if (_arg1.indexOf("rnd") == -1){
return (Number(_arg1));
};
var _local2:String = _arg1.substring(4, _arg1.length);
var _local3:int = _local2.indexOf("/");
var _local4:Number = Number(_local2.substring(0, _local3));
var _local5:Number = Number(_local2.substring((_local3 + 1), _local2.length));
return (RandomInt(_local4, _local5));
}
public static function mulPoint(_arg1:Point, _arg2:Number):Point{
return (new Point((_arg1.x * _arg2), (_arg1.y * _arg2)));
}
public static function IsCollision(_arg1, _arg2:CollisionObject):Boolean{
return ((DistBetweenPoints(_arg1.x, _arg1.y, _arg2.x, _arg2.y) < (_arg1.collideRadius + _arg2.collideRadius)));
}
public static function AngleBetweenPoints(_arg1, _arg2:Point):Number{
return (AngleBetweenPoints3(_arg1.x, _arg1.y, _arg2.x, _arg2.y));
}
public static function AngleBetweenPoints2(_arg1:Point, _arg2, _arg3:Number):Number{
return (AngleBetweenPoints3(_arg1.x, _arg1.y, _arg2, _arg3));
}
public static function AngleBetweenPoints3(_arg1, _arg2, _arg3, _arg4:Number):Number{
var _local5:Number = (_arg1 - _arg3);
var _local6:Number = (_arg2 - _arg4);
var _local7:Number = ((Math.atan2(_local6, _local5) / Math.PI) * 180);
return (_local7);
}
public static function Clamp(_arg1, _arg2, _arg3:Number):Number{
if (_arg1 < _arg2){
_arg1 = _arg2;
};
if (_arg1 > _arg3){
_arg1 = _arg3;
};
return (_arg1);
}
public static function inRange(_arg1, _arg2, _arg3:Number):Boolean{
return ((((_arg1 >= _arg2)) && ((_arg1 <= _arg3))));
}
}
}//package
Section 137
//wave (wave)
package {
import flash.display.*;
public dynamic class wave extends MovieClip {
}
}//package
Section 138
//WaypointsMover (WaypointsMover)
package {
import flash.geom.*;
public class WaypointsMover {
private var waypointIndex:int;// = 0
private var spaceObject:SpaceObject;
public function WaypointsMover(_arg1:SpaceObject){
this.spaceObject = _arg1;
}
public function update():Boolean{
var _local1:Array = spaceObject.waypoints;
if ((((((_local1 == null)) || ((_local1.length == 0)))) || ((waypointIndex == _local1.length)))){
return (false);
};
var _local2:Point = _local1[waypointIndex];
if (spaceObject.position.subtract(_local2).length < spaceObject.velocity.length){
waypointIndex++;
if (waypointIndex == _local1.length){
return (false);
};
_local2 = _local1[waypointIndex];
};
moveToPoint(_local2);
return (true);
}
public function moveToPoint(_arg1:Point):void{
spaceObject.velocity.normalize(1);
var _local2:Number = Math.atan2(spaceObject.velocity.y, spaceObject.velocity.x);
_local2 = TurnToFace(spaceObject.position, _arg1, _local2, spaceObject.turnSpeed);
spaceObject.velocity.x = (Math.cos(_local2) * spaceObject.moveSpeed);
spaceObject.velocity.y = (Math.sin(_local2) * spaceObject.moveSpeed);
}
private function WrapAngle(_arg1:Number):Number{
while (_arg1 < -(Math.PI)) {
_arg1 = (_arg1 + (Math.PI * 2));
};
while (_arg1 > Math.PI) {
_arg1 = (_arg1 - (Math.PI * 2));
};
return (_arg1);
}
public function get finished():Boolean{
return ((((spaceObject.waypoints == null)) || ((waypointIndex == spaceObject.waypoints.length))));
}
private function Clamp(_arg1, _arg2, _arg3:Number):Number{
if (_arg1 < _arg2){
_arg1 = _arg2;
};
if (_arg1 > _arg3){
_arg1 = _arg3;
};
return (_arg1);
}
private function TurnToFace(_arg1, _arg2:Point, _arg3, _arg4:Number):Number{
var _local5:Number = (_arg2.x - _arg1.x);
var _local6:Number = (_arg2.y - _arg1.y);
var _local7:Number = Math.atan2(_local6, _local5);
var _local8:Number = WrapAngle((_local7 - _arg3));
if ((((((_local8 < (Math.PI / 2))) && ((_local8 > (-(Math.PI) / 2))))) || (finished))){
_local8 = Clamp(_local8, -(_arg4), _arg4);
};
return (WrapAngle((_arg3 + _local8)));
}
}
}//package