Section 1
//Collider (InGame.Collision.Collider)
package InGame.Collision {
import flash.utils.*;
public final class Collider {
private static var lookup:Dictionary;
private static var initialised:Boolean = false;
private static function testPolygon_Polygon(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
var _local3:CollisionShapePolygon = (_arg1 as CollisionShapePolygon);
var _local4:CollisionShapePolygon = (_arg2 as CollisionShapePolygon);
return (testGeneric(_local3, _local4, _local3.separationAxes, _local4.separationAxes));
}
private static function testAABB_Circle(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
return (testReverse(testCircle_AABB, _arg1, _arg2));
}
private static function testCircle_Circle(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
var _local8:Vector;
var _local3:CollisionShapeCircle = (_arg1 as CollisionShapeCircle);
var _local4:CollisionShapeCircle = (_arg2 as CollisionShapeCircle);
var _local5:Number = (_local3.radius + _local4.radius);
var _local6:Vector = Geometry.VectorSubtract(_local3.position, _local4.position);
var _local7:Number = Math.abs(Geometry.VectorLength(_local6));
if (_local7 <= _local5){
_local6 = Geometry.VectorNorm(_local6);
_local8 = Geometry.VectorScale(_local6, (_local5 - _local7));
return (new CollisionResult(true, _local8, _local6));
};
return (new CollisionResult(false));
}
private static function testIntersect(_arg1:Array, _arg2:ICollisionShape, _arg3:ICollisionShape):CollisionResult{
var _local4:Vector;
var _local5:Vector;
var _local6:Vector;
var _local7:Array;
var _local8:Array;
var _local9:Number;
var _local10:Number;
var _local11:Vector;
for each (_local6 in _arg1) {
_local7 = _arg2.project(_local6);
_local8 = _arg3.project(_local6);
if ((((_local7[1] < _local8[0])) || ((_local7[0] > _local8[1])))){
return (new CollisionResult(false));
};
_local9 = -((_local7[1] - _local8[0]));
_local10 = (_local8[1] - _local7[0]);
_local11 = new Vector(_local6.x, _local6.y);
if (Math.abs(_local9) < Math.abs(_local10)){
_local11 = Geometry.VectorScale(_local11, _local9);
} else {
_local11 = Geometry.VectorScale(_local11, _local10);
};
if (!_local4){
_local4 = _local11;
_local5 = Geometry.VectorNorm(new Vector(_local6.x, _local6.y));
} else {
if (Math.abs(Geometry.VectorLength(_local4)) > Math.abs(Geometry.VectorLength(_local11))){
_local4 = _local11;
_local5 = Geometry.VectorNorm(new Vector(_local6.x, _local6.y));
};
};
};
return (new CollisionResult(true, _local4, _local5));
}
private static function testPolygon_Circle(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
return (testReverse(testCircle_Polygon, _arg1, _arg2));
}
private static function testGeneric(_arg1:ICollisionShape, _arg2:ICollisionShape, _arg3:Array, _arg4:Array):CollisionResult{
var _local5:CollisionResult;
var _local6:CollisionResult;
_local5 = testIntersect(_arg3, _arg1, _arg2);
if (!_local5.hit){
return (new CollisionResult(false));
};
_local6 = testIntersect(_arg4, _arg1, _arg2);
if (!_local6.hit){
return (new CollisionResult(false));
};
var _local7:Vector = _local5.shortest;
if (Math.abs(Geometry.VectorLength(_local7)) > Math.abs(Geometry.VectorLength(_local6.shortest))){
_local7 = _local6.shortest;
};
var _local8:Vector = Geometry.VectorNorm(_local7);
return (new CollisionResult(true, _local7, _local8));
}
private static function testCircle_Polygon(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
var _local7:Vector;
var _local3:CollisionShapeCircle = (_arg1 as CollisionShapeCircle);
var _local4:CollisionShapePolygon = (_arg2 as CollisionShapePolygon);
var _local5:Array = new Array();
var _local6:Array = _local4.translatedVertices;
for each (_local7 in _local6) {
_local5.push(Geometry.VectorNorm(Geometry.VectorSubtract(_local3.position, _local7)));
};
return (testGeneric(_local3, _local4, _local4.separationAxes, _local5));
}
private static function testAABB_AABB(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
var _local3:CollisionShapeAABB = (_arg1 as CollisionShapeAABB);
var _local4:CollisionShapeAABB = (_arg2 as CollisionShapeAABB);
return (testGeneric(_local3, _local4, _local3.separationAxes, _local4.separationAxes));
}
private static function testAABB_Polygon(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
return (testReverse(testPolygon_AABB, _arg1, _arg2));
}
private static function testReverse(_arg1:Function, _arg2:ICollisionShape, _arg3:ICollisionShape):CollisionResult{
var _local4:CollisionResult = _arg1(_arg3, _arg2);
if (_local4.hit){
_local4.shortest = Geometry.VectorScale(_local4.shortest, -1);
_local4.surface = Geometry.VectorScale(_local4.surface, -1);
};
return (_local4);
}
public static function Test(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
if (!initialised){
Initialise();
};
if (!(((_arg1.type == CollisionShapeTypes.AABB)) && ((_arg2.type == CollisionShapeTypes.AABB)))){
if (!_arg1.boundingAABB.quickTest(_arg2.boundingAABB)){
return (new CollisionResult(false));
};
};
var _local3:Function = lookup[_arg1.type][_arg2.type];
if (_local3 != null){
return (_local3(_arg1, _arg2));
};
throw (new Error(((("Unknown collision type " + String(_arg1)) + " vs ") + String(_arg2))));
}
public static function Initialise():void{
if (initialised){
return;
};
lookup = new Dictionary();
lookup[CollisionShapeTypes.POLYGON] = new Dictionary();
lookup[CollisionShapeTypes.POLYGON][CollisionShapeTypes.POLYGON] = testPolygon_Polygon;
lookup[CollisionShapeTypes.POLYGON][CollisionShapeTypes.CIRCLE] = testPolygon_Circle;
lookup[CollisionShapeTypes.POLYGON][CollisionShapeTypes.AABB] = testPolygon_AABB;
lookup[CollisionShapeTypes.CIRCLE] = new Dictionary();
lookup[CollisionShapeTypes.CIRCLE][CollisionShapeTypes.CIRCLE] = testCircle_Circle;
lookup[CollisionShapeTypes.CIRCLE][CollisionShapeTypes.POLYGON] = testCircle_Polygon;
lookup[CollisionShapeTypes.CIRCLE][CollisionShapeTypes.AABB] = testCircle_AABB;
lookup[CollisionShapeTypes.AABB] = new Dictionary();
lookup[CollisionShapeTypes.AABB][CollisionShapeTypes.CIRCLE] = testAABB_Circle;
lookup[CollisionShapeTypes.AABB][CollisionShapeTypes.POLYGON] = testAABB_Polygon;
lookup[CollisionShapeTypes.AABB][CollisionShapeTypes.AABB] = testAABB_AABB;
initialised = true;
}
private static function testCircle_AABB(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
var _local7:Vector;
var _local3:CollisionShapeCircle = (_arg1 as CollisionShapeCircle);
var _local4:CollisionShapeAABB = (_arg2 as CollisionShapeAABB);
var _local5:Array = new Array();
var _local6:Array = _local4.translatedVertices;
for each (_local7 in _local6) {
_local5.push(Geometry.VectorNorm(Geometry.VectorSubtract(_local3.position, _local7)));
};
return (testGeneric(_local3, _local4, _local4.separationAxes, _local5));
}
private static function testPolygon_AABB(_arg1:ICollisionShape, _arg2:ICollisionShape):CollisionResult{
var _local3:CollisionShapePolygon = (_arg1 as CollisionShapePolygon);
var _local4:CollisionShapeAABB = (_arg2 as CollisionShapeAABB);
return (testGeneric(_local3, _local4, _local3.separationAxes, _local4.separationAxes));
}
}
}//package InGame.Collision
Section 2
//CollisionResult (InGame.Collision.CollisionResult)
package InGame.Collision {
public final class CollisionResult {
public var shortest:Vector;
public var hit:Boolean;
public var surface:Vector;
public function CollisionResult(_arg1:Boolean, _arg2:Vector=null, _arg3:Vector=null){
this.hit = _arg1;
this.shortest = _arg2;
this.surface = _arg3;
}
}
}//package InGame.Collision
Section 3
//CollisionShapeAABB (InGame.Collision.CollisionShapeAABB)
package InGame.Collision {
public class CollisionShapeAABB implements ICollisionShape {
public var width:Number;
private var pos:Vector;
private var axes:Array;
public var height:Number;
private var verticesTranslated:Array;
public function CollisionShapeAABB(_arg1:Number, _arg2:Number, _arg3:Vector){
this.pos = new Vector(_arg3.x, _arg3.y);
this.width = _arg1;
this.height = _arg2;
this.translateVertices();
this.axes = new Array(new Vector(0, 1), new Vector(1, 0), new Vector(0, -1), new Vector(-1, 0));
}
public function get type():int{
return (CollisionShapeTypes.AABB);
}
public function get boundingAABB():CollisionShapeAABB{
return (this);
}
public function moveBy(_arg1:Vector):void{
this.verticesTranslated = null;
this.pos = Geometry.VectorAdd(this.pos, _arg1);
}
public function get separationAxes():Array{
return (this.axes);
}
public function quickTest(_arg1:CollisionShapeAABB):Boolean{
if (this.pos.x > (_arg1.pos.x + _arg1.width)){
return (false);
};
if ((this.pos.x + this.width) < _arg1.pos.x){
return (false);
};
if (this.pos.y > (_arg1.pos.y + _arg1.height)){
return (false);
};
if ((this.pos.y + this.height) < _arg1.pos.y){
return (false);
};
return (true);
}
public function project(_arg1:Vector):Array{
var _local3:Number;
var _local4:Number;
var _local6:Vector;
var _local7:Number;
var _local2:Boolean;
var _local5:Array = this.translatedVertices;
for each (_local6 in _local5) {
_local7 = Geometry.VectorDot(_arg1, _local6);
if (_local2){
_local2 = false;
_local4 = _local7;
_local3 = _local4;
} else {
_local3 = Math.min(_local3, _local7);
_local4 = Math.max(_local4, _local7);
};
};
return (new Array(_local3, _local4));
}
public function get position():Vector{
return (this.pos);
}
private function translateVertices():void{
this.verticesTranslated = new Array();
this.translatedVertices.push(new Vector(this.pos.x, this.pos.y));
this.translatedVertices.push(new Vector((this.pos.x + this.width), this.pos.y));
this.translatedVertices.push(new Vector((this.pos.x + this.width), (this.pos.y + this.height)));
this.translatedVertices.push(new Vector(this.pos.x, (this.pos.y + this.height)));
}
public function moveTo(_arg1:Vector):void{
this.verticesTranslated = null;
this.pos = new Vector(_arg1.x, _arg1.y);
}
public function get translatedVertices():Array{
if (!this.verticesTranslated){
this.translateVertices();
};
return (this.verticesTranslated);
}
}
}//package InGame.Collision
Section 4
//CollisionShapeCircle (InGame.Collision.CollisionShapeCircle)
package InGame.Collision {
public class CollisionShapeCircle implements ICollisionShape {
private var aabb:CollisionShapeAABB;
public var radius:Number;
private var pos:Vector;
public function CollisionShapeCircle(_arg1:Number, _arg2:Vector){
this.radius = _arg1;
this.pos = new Vector(_arg2.x, _arg2.y);
this.aabb = new CollisionShapeAABB((2 * this.radius), (2 * this.radius), new Vector((this.pos.x - this.radius), (this.pos.y - this.radius)));
}
public function get position():Vector{
return (this.pos);
}
public function get boundingAABB():CollisionShapeAABB{
this.aabb.moveTo(new Vector((this.pos.x - this.radius), (this.pos.y - this.radius)));
return (this.aabb);
}
public function moveTo(_arg1:Vector):void{
this.pos = new Vector(_arg1.x, _arg1.y);
}
public function moveBy(_arg1:Vector):void{
this.pos = Geometry.VectorAdd(this.pos, _arg1);
}
public function project(_arg1:Vector):Array{
var _local2:Number = Math.acos(_arg1.x);
var _local3:Number = Math.asin(_arg1.y);
var _local4:Vector = new Vector((this.radius * Math.cos(_local2)), (this.radius * Math.sin(_local3)));
var _local5:Vector = new Vector(-(_local4.x), -(_local4.y));
_local4 = Geometry.VectorAdd(this.pos, _local4);
_local5 = Geometry.VectorAdd(this.pos, _local5);
var _local6:Number = Geometry.VectorDot(_local4, _arg1);
var _local7:Number = Geometry.VectorDot(_local5, _arg1);
return (new Array(Math.min(_local6, _local7), Math.max(_local6, _local7)));
}
public function get type():int{
return (CollisionShapeTypes.CIRCLE);
}
}
}//package InGame.Collision
Section 5
//CollisionShapePolygon (InGame.Collision.CollisionShapePolygon)
package InGame.Collision {
public class CollisionShapePolygon implements ICollisionShape {
private var aabbOffset:Vector;
private var pos:Vector;
private var aabb:CollisionShapeAABB;
private var axes:Array;
private var verticesTranslated:Array;
private var vertices:Array;
public function CollisionShapePolygon(_arg1:Array, _arg2:Vector){
var _local8:Vector;
var _local9:Vector;
var _local10:Vector;
super();
this.pos = _arg2;
this.vertices = new Array();
var _local3:int;
while (_local3 < _arg1.length) {
this.vertices.push(new Vector(_arg1[_local3].x, _arg1[_local3].y));
_local3++;
};
var _local4:Number = this.vertices[0].x;
var _local5:Number = this.vertices[0].x;
var _local6:Number = this.vertices[0].y;
var _local7:Number = this.vertices[0].y;
for each (_local8 in this.vertices) {
if (_local8.x < _local4){
_local4 = _local8.x;
};
if (_local8.x > _local5){
_local5 = _local8.x;
};
if (_local8.y < _local6){
_local6 = _local8.y;
};
if (_local8.y > _local7){
_local7 = _local8.y;
};
};
this.aabbOffset = new Vector(_local4, _local6);
this.aabb = new CollisionShapeAABB((_local5 - _local4), (_local7 - _local6), Geometry.VectorAdd(this.aabbOffset, this.pos));
this.axes = new Array();
_local3 = 0;
while (_local3 < this.vertices.length) {
_local9 = this.vertices[_local3];
_local10 = this.vertices[((_local3 + 1) % this.vertices.length)];
this.axes.push(Geometry.VectorNorm(Geometry.VectorPerpendicular(Geometry.VectorSubtract(_local10, _local9))));
_local3++;
};
this.translateVertices();
}
public function get boundingAABB():CollisionShapeAABB{
return (this.aabb);
}
public function get separationAxes():Array{
return (this.axes);
}
public function moveBy(_arg1:Vector):void{
this.pos = Geometry.VectorAdd(this.pos, _arg1);
this.aabb.moveBy(_arg1);
this.verticesTranslated = null;
}
public function project(_arg1:Vector):Array{
var _local3:Number;
var _local4:Number;
var _local6:Vector;
var _local7:Number;
var _local2:Boolean;
var _local5:Array = this.translatedVertices;
for each (_local6 in _local5) {
_local7 = Geometry.VectorDot(_arg1, _local6);
if (_local2){
_local2 = false;
_local4 = _local7;
_local3 = _local4;
} else {
_local3 = Math.min(_local3, _local7);
_local4 = Math.max(_local4, _local7);
};
};
return (new Array(_local3, _local4));
}
private function translateVertices():void{
this.verticesTranslated = new Array();
var _local1:int;
while (_local1 < this.vertices.length) {
this.verticesTranslated.push(Geometry.VectorAdd(this.pos, this.vertices[_local1]));
_local1++;
};
}
public function get position():Vector{
return (this.pos);
}
public function moveTo(_arg1:Vector):void{
this.pos = _arg1;
this.aabb.moveTo(Geometry.VectorAdd(this.aabbOffset, this.pos));
this.verticesTranslated = null;
}
public function get translatedVertices():Array{
if (!this.verticesTranslated){
this.translateVertices();
};
return (this.verticesTranslated);
}
public function get type():int{
return (CollisionShapeTypes.POLYGON);
}
}
}//package InGame.Collision
Section 6
//CollisionShapeTypes (InGame.Collision.CollisionShapeTypes)
package InGame.Collision {
public final class CollisionShapeTypes {
public static const CIRCLE:int = 1;
public static const AABB:int = 2;
public static const POLYGON:int = 0;
}
}//package InGame.Collision
Section 7
//Geometry (InGame.Collision.Geometry)
package InGame.Collision {
public final class Geometry {
public static function VectorScale(_arg1:Vector, _arg2:Number):Vector{
return (new Vector((_arg1.x * _arg2), (_arg1.y * _arg2)));
}
public static function VectorPerpendicular(_arg1:Vector):Vector{
return (new Vector(-(_arg1.y), _arg1.x));
}
public static function VectorDot(_arg1:Vector, _arg2:Vector):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function VectorSubtract(_arg1:Vector, _arg2:Vector):Vector{
return (new Vector((_arg1.x - _arg2.x), (_arg1.y - _arg2.y)));
}
public static function VectorLength(_arg1:Vector):Number{
return (Math.sqrt(((_arg1.x * _arg1.x) + (_arg1.y * _arg1.y))));
}
public static function VectorAdd(_arg1:Vector, _arg2:Vector):Vector{
return (new Vector((_arg1.x + _arg2.x), (_arg1.y + _arg2.y)));
}
public static function VectorNorm(_arg1:Vector):Vector{
var _local2:Number = VectorLength(_arg1);
var _local3:Vector = new Vector(_arg1.x, _arg1.y);
if (0 != _local2){
_local3.x = (_local3.x / _local2);
_local3.y = (_local3.y / _local2);
} else {
_local3.x = (_local3.y = 0);
};
return (_local3);
}
}
}//package InGame.Collision
Section 8
//ICollisionShape (InGame.Collision.ICollisionShape)
package InGame.Collision {
public interface ICollisionShape {
function project(_arg1:Vector):Array;
function get boundingAABB():CollisionShapeAABB;
function moveBy(_arg1:Vector):void;
function get position():Vector;
function get type():int;
function moveTo(_arg1:Vector):void;
}
}//package InGame.Collision
Section 9
//Vector (InGame.Collision.Vector)
package InGame.Collision {
public class Vector {
public var x:Number;
public var y:Number;
public function Vector(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
}
}//package InGame.Collision
Section 10
//Boss1 (InGame.Enemies.Boss1)
package InGame.Enemies {
import flash.display.*;
import flash.geom.*;
import InGame.*;
import InGame.Collision.*;
public class Boss1 implements IEnemy {
private var nucleus:EnemyTough;
private var holder:Sprite;
private var orbits:Array;
private var game:Game;
private var phase:Number;
public static const ORBIT_SIZE:int = 50;
public static const NUM_ORBITS:int = 10;
public static const ORBIT_DISTANCE:Number = (NUCLEUS_SIZE + 15);
public static const NUCLEUS_STRENGTH:int = 15;
public static const FADE_TIME:int = 8000;
public static const NUCLEUS_SIZE:int = 100;
public static const ORBIT_STRENGTH:int = 5;
public static const ORBIT_FREE_SPEED:Number = 200;
public static const NUCLEUS_SPEED:int = 150;
public static const ORBIT_ROTATE_SPEED:Number = 2;
public function Boss1(_arg1:Game){
this.game = _arg1;
this.holder = new Sprite();
var _local2:Point = new Point(((Global.SCREEN_WIDTH + NUCLEUS_SIZE) / 2), ((Global.SCREEN_HEIGHT + NUCLEUS_SIZE) / 2));
this.nucleus = new EnemyTough(_arg1, NUCLEUS_STRENGTH, false, _local2, NUCLEUS_SIZE, false, -1, FADE_TIME, 6968488);
var _local3:Number = (Math.PI / 4);
var _local4:int = (1 + Math.floor((Math.random() * 3)));
_local3 = (_local3 + ((Math.PI / 2) * _local4));
var _local5:Point = new Point((NUCLEUS_SPEED * Math.cos(_local3)), (NUCLEUS_SPEED * Math.sin(_local3)));
this.nucleus.setVel(_local5);
this.holder.addChild(this.nucleus.getGraphic());
this.orbits = new Array(NUM_ORBITS);
var _local6:int;
while (_local6 < NUM_ORBITS) {
this.generateOrbit(_local6);
_local6++;
};
this.phase = 0;
}
public function testAgainstShot(_arg1:Shot):Boolean{
var _local3:int;
var _local4:EnemyTough;
var _local2:Boolean;
if (this.nucleus){
if (this.nucleus.testAgainstShot(_arg1)){
_local2 = true;
};
};
if (!_local2){
_local3 = 0;
while (_local3 < this.orbits.length) {
_local4 = this.orbits[_local3];
if (_local4){
if (!_local4.dead){
if (_local4.testAgainstShot(_arg1)){
_local2 = true;
break;
};
};
};
_local3++;
};
};
return (_local2);
}
public function testAgainstAvatar(_arg1:DisplayObject, _arg2:ICollisionShape):Boolean{
var _local4:int;
var _local5:EnemyTough;
var _local3:Boolean;
if (this.nucleus){
if (this.nucleus.testAgainstAvatar(_arg1, _arg2)){
_local3 = true;
};
};
if (!_local3){
_local4 = 0;
while (_local4 < this.orbits.length) {
_local5 = this.orbits[_local4];
if (_local5){
if (!_local5.dead){
if (_local5.testAgainstAvatar(_arg1, _arg2)){
_local3 = true;
break;
};
};
};
_local4++;
};
};
return (_local3);
}
public function update():void{
var _local3:EnemyTough;
var _local4:Number;
var _local5:Point;
var _local6:EnemyTough;
var _local7:Point;
var _local1:Number = (Global.UPDATE_LENGTH / 1000);
this.phase = (this.phase + (ORBIT_ROTATE_SPEED * _local1));
if (this.nucleus){
if (this.nucleus.dead){
this.holder.removeChild(this.nucleus.getGraphic());
this.nucleus = null;
for each (_local3 in this.orbits) {
if (((_local3) && (!(_local3.dead)))){
_local4 = ((Math.random() * 2) * Math.PI);
_local5 = new Point((ORBIT_FREE_SPEED * Math.cos(_local4)), (ORBIT_FREE_SPEED * Math.sin(_local4)));
_local3.setVel(_local5);
this.holder.removeChild(_local3.getGraphic());
this.game.enemyManager.add(_local3);
};
};
this.orbits = new Array();
} else {
this.nucleus.update();
};
};
var _local2:int;
while (_local2 < this.orbits.length) {
_local6 = this.orbits[_local2];
if (_local6){
if (_local6.dead){
this.game.score.add(_local6.points);
this.holder.removeChild(_local6.getGraphic());
this.orbits[_local2] = null;
} else {
_local6.update();
if (this.nucleus){
_local4 = (((_local2 * 2) * Math.PI) / NUM_ORBITS);
_local7 = new Point((ORBIT_DISTANCE * Math.cos((_local4 + this.phase))), (ORBIT_DISTANCE * Math.sin((_local4 + this.phase))));
new Point((ORBIT_DISTANCE * Math.cos((_local4 + this.phase))), (ORBIT_DISTANCE * Math.sin((_local4 + this.phase)))).x = (_local7.x + (this.nucleus.pos.x + ((NUCLEUS_SIZE - ORBIT_SIZE) / 2)));
_local7.y = (_local7.y + (this.nucleus.pos.y + ((NUCLEUS_SIZE - ORBIT_SIZE) / 2)));
_local6.setPos(_local7);
};
};
};
_local2++;
};
}
public function testAgainstShape(_arg1:Shape):Boolean{
return (false);
}
private function generateOrbit(_arg1:int):void{
var _local2:EnemyTough = new EnemyTough(game, ORBIT_STRENGTH, true, null, ORBIT_SIZE, false, -1, FADE_TIME, 10452991);
_local2.setVel(new Point(0, 0));
this.holder.addChild(_local2.getGraphic());
this.orbits[_arg1] = _local2;
}
public function get points():int{
return (Config.POINTS_BOSS_1);
}
public function visualUpdate(_arg1:int):void{
var _local5:EnemyTough;
var _local6:Number;
var _local7:Point;
var _local2:Number = (_arg1 / 1000);
if (this.nucleus){
this.nucleus.visualUpdate(_arg1);
};
var _local3:Number = (this.phase + (_local2 * ORBIT_ROTATE_SPEED));
var _local4:int;
while (_local4 < this.orbits.length) {
_local5 = this.orbits[_local4];
if (_local5){
if (!_local5.dead){
if (((!(this.nucleus)) || (this.nucleus.dead))){
_local5.visualUpdate(_arg1);
} else {
_local6 = (((_local4 * 2) * Math.PI) / NUM_ORBITS);
_local7 = new Point((ORBIT_DISTANCE * Math.cos((_local6 + _local3))), (ORBIT_DISTANCE * Math.sin((_local6 + _local3))));
new Point((ORBIT_DISTANCE * Math.cos((_local6 + _local3))), (ORBIT_DISTANCE * Math.sin((_local6 + _local3)))).x = (_local7.x + (this.nucleus.getGraphic().x + ((NUCLEUS_SIZE - ORBIT_SIZE) / 2)));
_local7.y = (_local7.y + (this.nucleus.getGraphic().y + ((NUCLEUS_SIZE - ORBIT_SIZE) / 2)));
_local5.setPos(_local7);
};
};
};
_local4++;
};
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function get dead():Boolean{
if (!this.nucleus){
return (true);
};
if (this.nucleus.dead){
return (true);
};
return (false);
}
}
}//package InGame.Enemies
Section 11
//Boss2 (InGame.Enemies.Boss2)
package InGame.Enemies {
import flash.display.*;
import flash.geom.*;
import InGame.*;
import InGame.Collision.*;
public class Boss2 implements IEnemy {
private var soundIndex:int;
private var sounds:Array;
private var headVel:Vector;
private var segments:Array;
private var head:EnemyTough;
private var soundDelayCounter:int;
private var holder:Sprite;
private var game:Game;
public static const ACCELERATION:Number = 1000;
public static const STRENGTH:int = 50;
public static const SIZE:int = 70;
public static const SOUND_DELAY:int = 300;
public static const SIZE_REDUCTION:Number = 0.95;
public static const STARTX:int = -1600;
public static const STARTY:int = -500;
public static const NUM_SEGMENTS:int = 32;
public static const MAX_VEL:Number = 200;
public static const DISTANCE:Number = 25;
public function Boss2(_arg1:Game){
var _local5:segment;
super();
this.game = _arg1;
var _local2:Point = new Point(STARTX, STARTY);
this.head = new EnemySnakeHead(_arg1, STRENGTH, false, _local2, SIZE, true, (Math.PI / 4), 0, 2509078);
this.head.setVel(new Point(0, 0));
this.head.setEnforcePos(false);
this.head.setPos(_local2);
this.headVel = new Vector(0, 0);
this.holder = new Sprite();
this.segments = new Array();
var _local3:Number = ((0.8 * SIZE) * SIZE_REDUCTION);
this.segments.push(new segment(_local3, this.head.getGraphic(), DISTANCE, 0x637C00, true));
var _local4 = 1;
while (_local4 < NUM_SEGMENTS) {
_local3 = (_local3 * SIZE_REDUCTION);
if ((NUM_SEGMENTS - 1) == _local4){
_local3 = (_local3 * 1.2);
};
_local5 = new segment(_local3, this.segments[(_local4 - 1)], DISTANCE, (((_local4 % 2))==0) ? 0x267F00 : 0x637C00);
this.segments.push(_local5);
this.holder.addChild(_local5);
_local4++;
};
this.holder.addChild(this.head.getGraphic());
this.sounds = [Sounds.snake1, Sounds.snake2, Sounds.snake3];
this.soundIndex = 0;
this.soundDelayCounter = 0;
}
public function testAgainstAvatar(_arg1:DisplayObject, _arg2:ICollisionShape):Boolean{
var _local3:segment;
var _local4:CollisionShapeCircle;
if (this.head.testAgainstAvatar(_arg1, _arg2)){
return (true);
};
for each (_local3 in this.segments) {
_local4 = new CollisionShapeCircle(_local3.size, _local3.pos);
if (Collider.Test(_arg2, _local4).hit){
return (true);
};
};
return (false);
}
public function update():void{
var _local2:int;
var _local3:Vector;
var _local4:Vector;
var _local5:Vector;
var _local6:Point;
var _local7:segment;
var _local8:Point;
var _local9:ExplodeSegment;
var _local10:PowerUpHealth;
var _local1:Number = (Global.UPDATE_LENGTH / 1000);
this.head.update();
if (this.soundDelayCounter >= 0){
this.soundDelayCounter = (this.soundDelayCounter - Global.UPDATE_LENGTH);
};
if (!this.head.dead){
if (Global.stage){
_local3 = new Vector((this.head.pos.x + (SIZE / 2)), (this.head.pos.y + (SIZE / 2)));
_local4 = new Vector(this.game.avatar.getGraphic().x, this.game.avatar.getGraphic().y);
_local5 = Geometry.VectorSubtract(_local3, _local4);
_local5 = Geometry.VectorNorm(_local5);
_local5 = Geometry.VectorScale(_local5, (-(ACCELERATION) * _local1));
this.headVel = Geometry.VectorAdd(_local5, headVel);
if (Geometry.VectorLength(this.headVel) > MAX_VEL){
this.headVel = Geometry.VectorScale(Geometry.VectorNorm(this.headVel), MAX_VEL);
};
_local6 = new Point((this.head.pos.x + (this.headVel.x * _local1)), (this.head.pos.y + (this.headVel.y * _local1)));
this.head.setPos(_local6);
};
_local2 = 0;
while (_local2 < this.segments.length) {
this.segments[_local2].update();
_local2++;
};
} else {
_local2 = 0;
while (_local2 < this.segments.length) {
_local7 = this.segments[_local2];
_local8 = new Point(_local7.pos.x, _local7.pos.y);
_local9 = new ExplodeSegment(_local8, _local7.size, _local7.color);
this.game.explodeManager.addNew(_local9);
if (0 == (_local2 % 20)){
_local10 = new PowerUpHealth();
_local10.pos = _local8.clone();
this.game.powerUpManager.add(_local10);
};
_local2++;
};
};
}
public function testAgainstShape(_arg1:Shape):Boolean{
return (false);
}
public function get points():int{
return (Config.POINTS_BOSS_2);
}
public function testAgainstShot(_arg1:Shot):Boolean{
if (this.head.testAgainstShot(_arg1)){
if (this.soundDelayCounter < 0){
Sounds.play(this.sounds[this.soundIndex]);
this.soundIndex = ((this.soundIndex + 1) % this.sounds.length);
this.soundDelayCounter = SOUND_DELAY;
};
return (true);
};
return (false);
}
public function get dead():Boolean{
return (this.head.dead);
}
public function visualUpdate(_arg1:int):void{
this.head.visualUpdate(_arg1);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
}
}//package InGame.Enemies
import flash.display.*;
import InGame.Collision.*;
class segment extends Sprite {
public var size:Number;
public var color:uint;
public var lastPos:Vector;
private var dist:Number;
private var adjust:Boolean;
private var follow:DisplayObject;
public var pos:Vector;
public static const DRAG:Number = 0.15;
private function segment(_arg1:int, _arg2:DisplayObject, _arg3:Number, _arg4:uint, _arg5:Boolean=false){
this.adjust = _arg5;
this.dist = _arg3;
this.follow = _arg2;
this.color = _arg4;
this.size = _arg1;
this.pos = new Vector(Boss2.STARTX, Boss2.STARTY);
this.lastPos = new Vector(Boss2.STARTX, Boss2.STARTY);
this.graphics.beginFill(_arg4);
this.graphics.drawCircle(0, 0, _arg1);
this.x = this.pos.x;
this.y = this.pos.y;
}
private function move():void{
var _local1:Vector = new Vector(verlet(pos.x, lastPos.x), verlet(pos.y, lastPos.y));
this.lastPos.x = this.pos.x;
this.lastPos.y = this.pos.y;
this.pos = _local1;
}
public function update():void{
this.move();
this.constrain();
this.x = this.pos.x;
this.y = this.pos.y;
}
private function constrain():void{
var _local1:int = (this.adjust) ? (Boss2.SIZE / 2) : 0;
var _local2:Vector = new Vector((this.follow.x + _local1), (this.follow.y + _local1));
var _local3:Vector = Geometry.VectorSubtract(_local2, this.pos);
if (Geometry.VectorLength(_local3) > this.dist){
_local3 = Geometry.VectorNorm(_local3);
_local3 = Geometry.VectorScale(_local3, -(this.dist));
this.pos = Geometry.VectorAdd(_local2, _local3);
};
}
private function verlet(_arg1:Number, _arg2:Number):Number{
return ((((2 - DRAG) * _arg1) - ((1 - DRAG) * _arg2)));
}
}
Section 12
//Boss3 (InGame.Enemies.Boss3)
package InGame.Enemies {
import flash.display.*;
import flash.geom.*;
import InGame.*;
import InGame.Collision.*;
public class Boss3 implements IEnemy {
private var colShape:Shape;
private var green:Shape;
private var lightCounter:int;
private var red:Shape;
private var showCount:int;
private var hurtRect:HurtRect;
private var shape:Sprite;
private var isDead:Boolean;// = false
private var showCounter:int;
private var colShape2:Shape;
private var pos:Point;
private var hideCounter:int;
private var spawnFunc:Function;
private var amber:Shape;
private var game:Game;
private var spawn:Array;
public static const GREEN_LENGTH:int = 5000;
public static const WIDTH:int = 40;
public static const HEIGHT:int = 110;
public static const AMBER_LENGTH:int = 2000;
public static const SHOW_TIME:int = 2000;
public static const RED_LENGTH:int = 3000;
private static const TIP_BLURB:Class = Boss3_TIP_BLURB;
public static const LIGHT_RADIUS:Number = 15;
public static const HIDDEN_POS:int = (Global.SCREEN_HEIGHT + HEIGHT);
public function Boss3(_arg1:Game, _arg2:Point){
this.shape = new Sprite();
this.colShape = new Shape();
this.colShape2 = new Shape();
this.red = new Shape();
this.amber = new Shape();
this.green = new Shape();
this.game = _arg1;
this.pos = _arg2.clone();
this.shape.addChild(this.colShape);
this.shape.addChild(this.colShape2);
this.shape.addChild(this.red);
this.shape.addChild(this.amber);
this.shape.addChild(this.green);
this.red.visible = true;
this.amber.visible = (this.green.visible = false);
this.lightCounter = RED_LENGTH;
this.spawn = null;
this.spawnFunc = this.spawnFunc1;
this.showCount = 0;
this.hurtRect = new HurtRect();
this.draw();
this.show();
this.shape.x = this.pos.x;
this.shape.y = this.pos.y;
this.game.score.stopScores();
}
public function testAgainstAvatar(_arg1:DisplayObject, _arg2:ICollisionShape):Boolean{
return (false);
}
public function testAgainstShape(_arg1:Shape):Boolean{
return (false);
}
public function visualUpdate(_arg1:int):void{
}
public function getGraphic():DisplayObject{
return (this.shape);
}
private function spawnFunc2():void{
var _local2:IEnemy;
this.spawnFunc = this.spawnFunc3;
var _local1:int;
while (_local1 < 10) {
_local2 = new EnemyTough(this.game, 4);
this.game.enemyManager.add(_local2);
this.spawn.push(_local2);
_local1++;
};
}
private function spawnFunc3():void{
var _local2:IEnemy;
this.spawnFunc = this.spawnFunc1;
var _local1:int;
while (_local1 < 10) {
_local2 = new MineLayer(this.game);
this.game.enemyManager.add(_local2);
this.spawn.push(_local2);
_local1++;
};
}
private function spawnFunc1():void{
var _local2:IEnemy;
this.spawnFunc = this.spawnFunc2;
var _local1:int;
while (_local1 < 20) {
_local2 = new EnemyStandard(this.game);
this.game.enemyManager.add(_local2);
this.spawn.push(_local2);
_local1++;
};
}
private function draw():void{
this.colShape.graphics.clear();
this.colShape.graphics.beginFill(0);
this.colShape.graphics.drawRect((-(WIDTH) / 2), (-(HEIGHT) / 2), WIDTH, HEIGHT);
this.colShape2.graphics.beginFill(0x444444);
this.colShape2.graphics.drawRect(-5, (HEIGHT / 2), 10, (Global.SCREEN_HEIGHT / 2));
this.colShape.graphics.beginFill(0x380000);
this.colShape.graphics.drawCircle(0, (((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS), LIGHT_RADIUS);
this.colShape.graphics.beginFill(0x632700);
this.colShape.graphics.drawCircle(0, ((((((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS) + 5) + LIGHT_RADIUS) + LIGHT_RADIUS), LIGHT_RADIUS);
this.colShape.graphics.beginFill(0x3800);
this.colShape.graphics.drawCircle(0, (((((((((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS) + 5) + LIGHT_RADIUS) + LIGHT_RADIUS) + 5) + LIGHT_RADIUS) + LIGHT_RADIUS), LIGHT_RADIUS);
this.red.graphics.beginFill(0xFF0000);
this.red.graphics.drawCircle(0, (((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS), LIGHT_RADIUS);
this.amber.graphics.beginFill(0xFF6A00);
this.amber.graphics.drawCircle(0, ((((((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS) + 5) + LIGHT_RADIUS) + LIGHT_RADIUS), LIGHT_RADIUS);
this.green.graphics.beginFill(0xFF00);
this.green.graphics.drawCircle(0, (((((((((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS) + 5) + LIGHT_RADIUS) + LIGHT_RADIUS) + 5) + LIGHT_RADIUS) + LIGHT_RADIUS), LIGHT_RADIUS);
this.shape.addChild(this.hurtRect);
}
private function get showing():Boolean{
return ((this.showCounter > 0));
}
private function updatePos():void{
var _local1:Number = 0;
if (this.showing){
this.showCounter = (this.showCounter - Global.UPDATE_LENGTH);
if (this.showCounter < 0){
this.showCounter = 0;
};
_local1 = (1 - Math.sin(((Math.PI / 2) * (1 - (this.showCounter / SHOW_TIME)))));
this.pos.y = ((Global.SCREEN_HEIGHT / 2) + ((HIDDEN_POS - (Global.SCREEN_HEIGHT / 2)) * _local1));
} else {
if (this.hiding){
this.hideCounter = (this.hideCounter - Global.UPDATE_LENGTH);
if (this.hideCounter < 0){
this.hideCounter = 0;
};
_local1 = Math.sin(((Math.PI / 2) * (1 - (this.hideCounter / SHOW_TIME))));
this.pos.y = ((Global.SCREEN_HEIGHT / 2) + ((HIDDEN_POS - (Global.SCREEN_HEIGHT / 2)) * _local1));
};
};
}
private function updateLights():void{
if (((this.showing) || (this.hiding))){
return;
};
this.lightCounter = (this.lightCounter - Global.UPDATE_LENGTH);
if (this.lightCounter <= 0){
if (this.pos.y <= Global.SCREEN_HEIGHT){
Sounds.play(Sounds.lightChange);
};
if (((this.red.visible) && (!(this.amber.visible)))){
this.amber.visible = true;
this.lightCounter = AMBER_LENGTH;
} else {
if (((this.red.visible) && (this.amber.visible))){
this.red.visible = (this.amber.visible = false);
this.green.visible = true;
this.lightCounter = GREEN_LENGTH;
} else {
if (this.green.visible){
this.green.visible = false;
this.amber.visible = true;
this.lightCounter = AMBER_LENGTH;
} else {
this.red.visible = true;
this.amber.visible = false;
this.green.visible = false;
this.lightCounter = RED_LENGTH;
};
};
};
};
}
public function update():void{
var _local1:Boolean;
var _local2:IEnemy;
if (this.spawn){
_local1 = false;
for each (_local2 in this.spawn) {
if (!_local2.dead){
_local1 = true;
break;
};
};
if (!_local1){
this.show();
};
};
this.updateLights();
this.updatePos();
this.shape.x = this.pos.x;
this.shape.y = this.pos.y;
this.hurtRect.update();
}
private function kill():void{
this.game.score.startScores();
Sounds.playExplosion();
this.isDead = true;
var _local1:Explode = new ExplodeRect(new Rectangle((this.pos.x - (WIDTH / 2)), (this.pos.y - (HEIGHT / 2)), WIDTH, HEIGHT), 0);
this.game.explodeManager.addNew(_local1);
_local1 = new ExplodeRect(new Rectangle((this.pos.x - 5), (this.pos.y + (HEIGHT / 2)), 10, (Global.SCREEN_HEIGHT / 2)), 0x444444);
this.game.explodeManager.addNew(_local1);
_local1 = new ExplodeSegment(new Point(this.pos.x, (this.pos.y + (((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS))), LIGHT_RADIUS, 0xFF0000);
this.game.explodeManager.addNew(_local1);
_local1 = new ExplodeSegment(new Point(this.pos.x, (this.pos.y + (((((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS) + 5) + (2 * LIGHT_RADIUS)))), LIGHT_RADIUS, 0xFF6A00);
this.game.explodeManager.addNew(_local1);
_local1 = new ExplodeSegment(new Point(this.pos.x, (this.pos.y + (((((((-(HEIGHT) / 2) + 5) + LIGHT_RADIUS) + 5) + (2 * LIGHT_RADIUS)) + 5) + (2 * LIGHT_RADIUS)))), LIGHT_RADIUS, 0xFF00);
this.game.explodeManager.addNew(_local1);
}
public function testAgainstShot(_arg1:Shot):Boolean{
if (_arg1.getGraphic().hitTestObject(this.colShape)){
if (((!(this.showing)) && (!(this.hiding)))){
if (!this.green.visible){
this.hide();
this.hurtRect.hurt();
Sounds.play(Sounds.error);
} else {
this.kill();
};
};
return (true);
};
if (_arg1.getGraphic().hitTestObject(this.colShape2)){
return (true);
};
return (false);
}
public function get points():int{
return (Config.POINTS_BOSS_3);
}
public function get dead():Boolean{
return (this.isDead);
}
private function hide():void{
this.showCounter = 0;
this.hideCounter = SHOW_TIME;
this.spawn = new Array();
this.spawnFunc();
}
private function show():void{
var _local1:Overlay;
this.red.visible = true;
this.amber.visible = (this.green.visible = false);
this.lightCounter = RED_LENGTH;
this.pos.y = HIDDEN_POS;
this.showCounter = SHOW_TIME;
this.hideCounter = 0;
this.spawn = null;
this.showCount++;
if (4 == this.showCount){
_local1 = new Overlay(TIP_BLURB, 0, 4000);
this.game.overlayManager.addNew(_local1);
};
}
private function get hiding():Boolean{
return ((this.hideCounter > 0));
}
}
}//package InGame.Enemies
import flash.display.*;
class HurtRect extends Shape {
private var flashCounter:int;
public static const FLASH_TIME:int = 750;
private function HurtRect(){
this.graphics.beginFill(0xFF0000);
this.graphics.drawRect((-(Boss3.WIDTH) / 2), (-(Boss3.HEIGHT) / 2), Boss3.WIDTH, Boss3.HEIGHT);
this.graphics.drawRect(-5, (Boss3.HEIGHT / 2), 10, (Global.SCREEN_HEIGHT / 2));
this.alpha = 0;
this.flashCounter = -1;
}
public function update():void{
var _local1:Number;
if (flashCounter > 0){
this.flashCounter = (this.flashCounter - Global.UPDATE_LENGTH);
_local1 = Math.max(0, (this.flashCounter / FLASH_TIME));
this.alpha = _local1;
} else {
this.alpha = 0;
};
}
public function hurt():void{
this.flashCounter = FLASH_TIME;
}
}
Section 13
//Boss3_TIP_BLURB (InGame.Enemies.Boss3_TIP_BLURB)
package InGame.Enemies {
import mx.core.*;
public class Boss3_TIP_BLURB extends BitmapAsset {
}
}//package InGame.Enemies
Section 14
//EnemyErr (InGame.Enemies.EnemyErr)
package InGame.Enemies {
import flash.display.*;
import InGame.*;
import InGame.Collision.*;
public class EnemyErr extends EnemyStandard {
private var colShape:Shape;
private var shapes:Array;
private static const gfx:Class = EnemyErr_gfx;
public static const COLOR:uint = 0xFF00FE;
public function EnemyErr(_arg1:Game){
this.shapes = new Array();
this.colShape = new Shape();
this.colShape.graphics.clear();
this.colShape.graphics.beginFill(color);
this.colShape.graphics.drawRect(4, 4, 13, 21);
this.colShape.graphics.drawRect(17, 0, 4, 25);
this.colShape.graphics.drawRect(21, 10, 4, 15);
this.shapes.push(new CollisionShapeAABB(13, 21, new Vector(4, 4)));
this.shapes.push(new CollisionShapeAABB(4, 25, new Vector(17, 0)));
this.shapes.push(new CollisionShapeAABB(4, 15, new Vector(21, 10)));
this.colShape.visible = false;
super(_arg1, null, 30);
}
override protected function get color():uint{
return (COLOR);
}
override public function testAgainstAvatar(_arg1:DisplayObject, _arg2:ICollisionShape):Boolean{
var _local4:CollisionShapeAABB;
var _local5:CollisionShapeAABB;
var _local3:Boolean;
if (this.dangerous){
if (_arg1.hitTestObject(this.colShape)){
for each (_local4 in this.shapes) {
_local5 = new CollisionShapeAABB(_local4.width, _local4.height, Geometry.VectorAdd(new Vector(this.pos.x, this.pos.y), _local4.position));
if (Collider.Test(_arg2, _local5).hit){
_local3 = true;
break;
};
};
};
};
return (_local3);
}
override public function testAgainstShot(_arg1:Shot):Boolean{
var _local2:Boolean;
if (this.dangerous){
_local2 = _arg1.getGraphic().hitTestObject(this.colShape);
if (_local2){
this.hit(_arg1.red);
};
};
return (_local2);
}
override public function get points():int{
return (Config.POINTS_MOONINITES);
}
override protected function draw(_arg1:uint):void{
this.shape.addChild(new gfx());
this.shape.addChild(this.colShape);
}
override protected function playDeathSound():void{
Sounds.play(Sounds.mooniniteDie);
}
}
}//package InGame.Enemies
Section 15
//EnemyErr_gfx (InGame.Enemies.EnemyErr_gfx)
package InGame.Enemies {
import mx.core.*;
public class EnemyErr_gfx extends BitmapAsset {
}
}//package InGame.Enemies
Section 16
//EnemyIgnignot (InGame.Enemies.EnemyIgnignot)
package InGame.Enemies {
import flash.display.*;
import InGame.*;
import InGame.Collision.*;
public class EnemyIgnignot extends EnemyStandard {
private var colShape:Shape;
private var shapes:Array;
private static const gfx:Class = EnemyIgnignot_gfx;
public static const COLOR:uint = 261382;
public function EnemyIgnignot(_arg1:Game){
this.shapes = new Array();
this.colShape = new Shape();
this.colShape.graphics.clear();
this.colShape.graphics.beginFill(color);
this.colShape.graphics.drawRect(11, 35, 51, 20);
this.colShape.graphics.drawRect(15, 31, 47, 4);
this.colShape.graphics.drawRect(15, 20, 43, 11);
this.colShape.graphics.drawRect(14, 10, 44, 10);
this.colShape.graphics.drawRect(21, 0, 9, 10);
this.colShape.graphics.drawRect(30, 2, 3, 8);
this.colShape.graphics.drawRect(47, 0, 11, 10);
this.colShape.graphics.drawRect(37, 7, 10, 3);
this.shapes.push(new CollisionShapeAABB(51, 20, new Vector(11, 35)));
this.shapes.push(new CollisionShapeAABB(47, 4, new Vector(15, 31)));
this.shapes.push(new CollisionShapeAABB(43, 11, new Vector(15, 20)));
this.shapes.push(new CollisionShapeAABB(44, 10, new Vector(14, 10)));
this.shapes.push(new CollisionShapeAABB(9, 10, new Vector(21, 0)));
this.shapes.push(new CollisionShapeAABB(3, 8, new Vector(30, 2)));
this.shapes.push(new CollisionShapeAABB(11, 10, new Vector(47, 0)));
this.shapes.push(new CollisionShapeAABB(10, 3, new Vector(37, 7)));
this.colShape.visible = false;
super(_arg1, null, 62);
}
override protected function get color():uint{
return (COLOR);
}
override public function testAgainstAvatar(_arg1:DisplayObject, _arg2:ICollisionShape):Boolean{
var _local4:CollisionShapeAABB;
var _local5:CollisionShapeAABB;
var _local3:Boolean;
if (this.dangerous){
if (_arg1.hitTestObject(this.colShape)){
for each (_local4 in this.shapes) {
_local5 = new CollisionShapeAABB(_local4.width, _local4.height, Geometry.VectorAdd(new Vector(this.pos.x, this.pos.y), _local4.position));
if (Collider.Test(_arg2, _local5).hit){
_local3 = true;
break;
};
};
};
};
return (_local3);
}
override public function testAgainstShot(_arg1:Shot):Boolean{
var _local2:Boolean;
if (this.dangerous){
_local2 = _arg1.getGraphic().hitTestObject(this.colShape);
if (_local2){
this.hit(_arg1.red);
};
};
return (_local2);
}
override public function get points():int{
return (Config.POINTS_MOONINITES);
}
override protected function draw(_arg1:uint):void{
this.shape.addChild(new gfx());
this.shape.addChild(this.colShape);
}
override protected function playDeathSound():void{
Sounds.play(Sounds.mooniniteDie);
}
}
}//package InGame.Enemies
Section 17
//EnemyIgnignot_gfx (InGame.Enemies.EnemyIgnignot_gfx)
package InGame.Enemies {
import mx.core.*;
public class EnemyIgnignot_gfx extends BitmapAsset {
}
}//package InGame.Enemies
Section 18
//EnemyMine (InGame.Enemies.EnemyMine)
package InGame.Enemies {
import flash.geom.*;
import InGame.*;
public class EnemyMine extends EnemyStandard {
private var pointsCount:int;
private var counter:int;
public static const COLOR:uint = 0xFF0000;
public static const LIFESPAN:int = 3000;
public function EnemyMine(_arg1:Game, _arg2:Point=null, _arg3:int=-1, _arg4:Boolean=false, _arg5:Number=-1, _arg6:int=-1){
this.counter = LIFESPAN;
this.pointsCount = 0;
super(_arg1, _arg2, _arg3, true, _arg5, _arg6);
}
override public function update():void{
super.update();
if ((((this.counter > 0)) && (!(this.dead)))){
this.counter = (this.counter - Global.UPDATE_LENGTH);
if (this.counter <= 0){
this.kill();
};
};
}
override protected function get color():uint{
return (COLOR);
}
override public function testAgainstShot(_arg1:Shot):Boolean{
var _local2:Boolean = super.testAgainstShot(_arg1);
if (_local2){
this.pointsCount = Config.POINTS_STANDARD;
};
return (_local2);
}
override public function get points():int{
return (this.pointsCount);
}
}
}//package InGame.Enemies
Section 19
//EnemySnakeHead (InGame.Enemies.EnemySnakeHead)
package InGame.Enemies {
import flash.geom.*;
import InGame.*;
public class EnemySnakeHead extends EnemyTough {
public function EnemySnakeHead(_arg1:Game, _arg2:int, _arg3:Boolean=true, _arg4:Point=null, _arg5:int=-1, _arg6:Boolean=false, _arg7:Number=-1, _arg8:int=-1, _arg9:uint=10331474){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9);
}
override protected function playHitSound():void{
}
}
}//package InGame.Enemies
Section 20
//EnemySplitter (InGame.Enemies.EnemySplitter)
package InGame.Enemies {
import flash.geom.*;
import InGame.*;
public class EnemySplitter extends EnemyStandard {
private var game:Game;
public static const COLOR:uint = 5592490;
public function EnemySplitter(_arg1:Game, _arg2:Point=null, _arg3:int=-1, _arg4:Boolean=false, _arg5:Number=-1, _arg6:int=-1){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
this.game = _arg1;
}
override public function get points():int{
return (Config.POINTS_SPLITTER1);
}
override protected function get color():uint{
return (COLOR);
}
override public function kill():void{
super.kill();
var _local1:EnemyStandard = new EnemyStandard(this.game, this.pos, this.size, true);
var _local2:EnemyStandard = new EnemyStandard(this.game, this.pos, this.size, true, (_local1.angle + Math.PI));
this.game.enemyManager.add(_local1);
this.game.enemyManager.add(_local2);
}
}
}//package InGame.Enemies
Section 21
//EnemySplitter2 (InGame.Enemies.EnemySplitter2)
package InGame.Enemies {
import InGame.*;
public class EnemySplitter2 extends EnemyStandard {
private var game:Game;
public static const COLOR:uint = 11162965;
public function EnemySplitter2(_arg1:Game){
super(_arg1);
this.game = _arg1;
}
override public function get points():int{
return (Config.POINTS_SPLITTER2);
}
override protected function get color():uint{
return (COLOR);
}
override public function kill():void{
super.kill();
var _local1:EnemyStandard = new EnemySplitter(this.game, this.pos, this.size, true);
var _local2:EnemyStandard = new EnemySplitter(this.game, this.pos, this.size, true, (_local1.angle + Math.PI));
this.game.enemyManager.add(_local1);
this.game.enemyManager.add(_local2);
}
}
}//package InGame.Enemies
Section 22
//EnemyStandard (InGame.Enemies.EnemyStandard)
package InGame.Enemies {
import flash.display.*;
import flash.geom.*;
import InGame.*;
import InGame.Collision.*;
public class EnemyStandard implements IEnemy {
protected var size:int;
private var fadeLength:int;
public var angle:Number;
public var pos:Point;
private var doEnforce:Boolean;
protected var vel:Point;
private var fadeCounter:int;
protected var shape:Sprite;
protected var isDead:Boolean;
private var game:Game;
public static const COLOR:uint = 0x555555;
public static const MAX_SPEED:Number = 200;
public static const MIN_SIZE:int = 40;
public static const DEFAULT_FADE_TIME:int = 1500;
public static const MIN_SPEED:Number = 50;
public static const MAX_SIZE:int = 65;
public function EnemyStandard(_arg1:Game, _arg2:Point=null, _arg3:int=-1, _arg4:Boolean=false, _arg5:Number=-1, _arg6:int=-1){
this.doEnforce = true;
this.game = _arg1;
this.shape = new Sprite();
if (-1 == _arg3){
this.size = (MIN_SIZE + Math.floor((Math.random() * (MAX_SIZE - MIN_SIZE))));
} else {
this.size = _arg3;
};
if (null == _arg2){
this.pos = new Point((Math.random() * Global.SCREEN_WIDTH), (Math.random() * Global.SCREEN_HEIGHT));
} else {
this.pos = _arg2.clone();
};
if (-1 == _arg5){
this.angle = ((Math.random() * 2) * Math.PI);
} else {
this.angle = _arg5;
};
var _local7:Number = (MIN_SPEED + (Math.random() * (MAX_SPEED - MIN_SPEED)));
this.vel = new Point((_local7 * Math.cos(this.angle)), (_local7 * Math.sin(this.angle)));
this.draw(this.color);
if (this.doEnforce){
this.enforcePos();
};
this.shape.x = this.pos.x;
this.shape.y = this.pos.y;
this.fadeLength = 0;
if (!_arg4){
this.fadeLength = ((-1)==_arg6) ? DEFAULT_FADE_TIME : _arg6;
};
this.fadeCounter = this.fadeLength;
this.isDead = false;
this.update();
if (!_arg4){
this.playFadeInSound();
};
}
public function testAgainstAvatar(_arg1:DisplayObject, _arg2:ICollisionShape):Boolean{
var _local4:ICollisionShape;
var _local3:Boolean;
if (this.dangerous){
_local4 = this.genColShape();
_local3 = Collider.Test(_arg2, _local4).hit;
};
return (_local3);
}
protected function draw(_arg1:uint):void{
this.shape.graphics.beginFill(_arg1);
this.shape.graphics.drawRect(0, 0, this.size, this.size);
this.shape.graphics.endFill();
}
public function update():void{
var _local1:Number;
if (this.fadeCounter > 0){
this.shape.alpha = fadeCurve(Math.min(1, (Number((this.fadeLength - this.fadeCounter)) / this.fadeLength)));
this.fadeCounter = (this.fadeCounter - Global.UPDATE_LENGTH);
} else {
this.shape.alpha = 1;
};
if (this.dangerous){
_local1 = (Global.UPDATE_LENGTH / 1000);
this.pos.x = (this.pos.x + (this.vel.x * _local1));
this.pos.y = (this.pos.y + (this.vel.y * _local1));
if (this.doEnforce){
this.enforcePos();
};
};
this.shape.x = this.pos.x;
this.shape.y = this.pos.y;
}
public function setPos(_arg1:Point):void{
this.pos = _arg1.clone();
this.shape.x = this.pos.x;
this.shape.y = this.pos.y;
}
public function get dangerous():Boolean{
return ((this.fadeCounter <= 0));
}
private function fadeCurve(_arg1:Number):Number{
return (Math.pow(0.01, (1 - _arg1)));
}
public function setEnforcePos(_arg1:Boolean):void{
this.doEnforce = _arg1;
}
public function kill():void{
this.isDead = true;
this.playDeathSound();
this.game.explodeManager.addNew(new ExplodeEnemy(this.pos, this.size, this.color));
}
public function setVel(_arg1:Point):void{
this.vel = _arg1.clone();
}
protected function get color():uint{
return (COLOR);
}
protected function playFadeInSound():void{
Sounds.play(Sounds.fadeIn);
}
public function visualUpdate(_arg1:int):void{
var _local2:Number;
if (this.dangerous){
_local2 = (_arg1 / 1000);
this.shape.x = (this.pos.x + (this.vel.x * _local2));
this.shape.y = (this.pos.y + (this.vel.y * _local2));
};
}
public function testAgainstShape(_arg1:Shape):Boolean{
return (false);
}
protected function hit(_arg1:Boolean):void{
this.kill();
}
protected function playDeathSound():void{
Sounds.playExplosion();
}
public function genColShape():ICollisionShape{
return (new CollisionShapeAABB(this.size, this.size, new Vector(this.pos.x, this.pos.y)));
}
public function testAgainstShot(_arg1:Shot):Boolean{
var _local2:Boolean;
if (this.dangerous){
_local2 = _arg1.getGraphic().hitTestObject(this.getGraphic());
if (_local2){
this.hit(_arg1.red);
};
};
return (_local2);
}
public function getGraphic():DisplayObject{
return (this.shape);
}
public function get points():int{
return (Config.POINTS_STANDARD);
}
public function get dead():Boolean{
return (this.isDead);
}
protected function enforcePos():void{
if (this.pos.x < 0){
this.pos.x = 0;
this.vel.x = -(this.vel.x);
} else {
if ((this.pos.x + this.size) > Global.SCREEN_WIDTH){
this.pos.x = (Global.SCREEN_WIDTH - this.size);
this.vel.x = -(this.vel.x);
};
};
if (this.pos.y < 0){
this.pos.y = 0;
this.vel.y = -(this.vel.y);
} else {
if ((this.pos.y + this.size) > Global.SCREEN_HEIGHT){
this.pos.y = (Global.SCREEN_HEIGHT - this.size);
this.vel.y = -(this.vel.y);
};
};
}
}
}//package InGame.Enemies
Section 23
//EnemyTough (InGame.Enemies.EnemyTough)
package InGame.Enemies {
import flash.geom.*;
import InGame.*;
public class EnemyTough extends EnemyStandard {
private var strength:int;
private var startStrength:int;
private var redKills:Boolean;
private var hurtSquare:HurtSquare;
private var strengthBar:Bar;
private var colorInt:uint;
public static const COLOR:uint = 10331474;
public function EnemyTough(_arg1:Game, _arg2:int, _arg3:Boolean=true, _arg4:Point=null, _arg5:int=-1, _arg6:Boolean=false, _arg7:Number=-1, _arg8:int=-1, _arg9:uint=10331474){
this.colorInt = _arg9;
super(_arg1, _arg4, _arg5, _arg6, _arg7, _arg8);
this.redKills = _arg3;
this.hurtSquare = new HurtSquare(this.size);
this.hurtSquare.x = (this.hurtSquare.x + (this.size / 2));
this.hurtSquare.y = (this.hurtSquare.y + (this.size / 2));
this.strength = (this.startStrength = _arg2);
this.strengthBar = new Bar((this.size - 10), 5, this.strength, 0xFF0000, 0x880000);
this.strengthBar.x = 5;
this.strengthBar.y = 5;
this.shape.addChild(this.strengthBar);
this.shape.addChild(this.hurtSquare);
this.update();
}
override public function update():void{
super.update();
if (this.hurtSquare){
this.hurtSquare.update();
};
}
override protected function get color():uint{
return (this.colorInt);
}
protected function playHitSound():void{
Sounds.play(Sounds.strongHit);
}
override protected function hit(_arg1:Boolean):void{
if (((_arg1) && (this.redKills))){
this.strength = 0;
this.kill();
} else {
this.strength--;
if (this.strength <= 0){
this.strength = 0;
this.kill();
} else {
this.playHitSound();
};
};
if (this.hurtSquare){
this.hurtSquare.hurt();
};
this.strengthBar.setValue(this.strength);
}
override public function get points():int{
return ((super.points * this.startStrength));
}
}
}//package InGame.Enemies
Section 24
//Generator (InGame.Enemies.Generator)
package InGame.Enemies {
import InGame.*;
public class Generator {
private var delay:int;
private var time:int;
private var factory:Function;
private var manager:EnemyManager;
private var counter:int;
public static const RANDOM_AMOUNT:int = 100;
public function Generator(_arg1:EnemyManager, _arg2:int, _arg3:Function, _arg4:int=0){
this.factory = _arg3;
this.time = _arg2;
this.delay = _arg4;
this.manager = _arg1;
this.counter = 0;
}
public function update():void{
var _local1:IEnemy;
if (this.delay <= 0){
this.counter = (this.counter - Global.UPDATE_LENGTH);
if (this.counter <= 0){
this.resetCounter();
_local1 = this.factory();
this.manager.add(_local1);
};
} else {
this.delay = (this.delay - Global.UPDATE_LENGTH);
};
}
private function resetCounter():void{
var _local1:int = (((Math.random() * 2) * RANDOM_AMOUNT) - RANDOM_AMOUNT);
this.counter = Math.max(0, (this.time + _local1));
}
}
}//package InGame.Enemies
Section 25
//GeneratorManager (InGame.Enemies.GeneratorManager)
package InGame.Enemies {
public class GeneratorManager {
private var generators:Array;
public function GeneratorManager(){
this.generators = new Array();
}
public function add(_arg1:Generator):void{
this.generators.push(_arg1);
}
public function clear():void{
this.generators = new Array();
}
public function update():void{
var _local1:Generator;
for each (_local1 in this.generators) {
_local1.update();
};
}
}
}//package InGame.Enemies
Section 26
//IEnemy (InGame.Enemies.IEnemy)
package InGame.Enemies {
import flash.display.*;
import InGame.*;
import InGame.Collision.*;
public interface IEnemy extends IHasGraphic {
function update():void;
function testAgainstShape(_arg1:Shape):Boolean;
function get points():int;
function get dead():Boolean;
function testAgainstShot(_arg1:Shot):Boolean;
function visualUpdate(_arg1:int):void;
function testAgainstAvatar(_arg1:DisplayObject, _arg2:ICollisionShape):Boolean;
}
}//package InGame.Enemies
Section 27
//MineLayer (InGame.Enemies.MineLayer)
package InGame.Enemies {
import flash.display.*;
import flash.geom.*;
import InGame.*;
import InGame.Collision.*;
public class MineLayer extends EnemyStandard {
private var mineCounter:int;
private var game:Game;
private var startCounter:int;
private var laying:Boolean;
public static const COLOR:uint = 6651357;
public static const SPEED:int = 200;
public static const LAY_DELAY:int = 200;
public static const MINE_SIZE:int = 25;
public static const RADIUS:int = 25;
public static const START_DELAY:int = 1000;
public function MineLayer(_arg1:Game){
super(_arg1, null, RADIUS);
this.game = _arg1;
var _local2:Vector = new Vector(this.vel.x, this.vel.y);
_local2 = Geometry.VectorNorm(_local2);
_local2 = Geometry.VectorScale(_local2, SPEED);
this.setVel(new Point(_local2.x, _local2.y));
this.mineCounter = LAY_DELAY;
this.startCounter = START_DELAY;
this.laying = true;
}
public function stopLaying():void{
this.laying = false;
}
override protected function enforcePos():void{
if ((this.pos.x - RADIUS) < 0){
this.pos.x = RADIUS;
this.vel.x = -(this.vel.x);
} else {
if ((this.pos.x + RADIUS) > Global.SCREEN_WIDTH){
this.pos.x = (Global.SCREEN_WIDTH - RADIUS);
this.vel.x = -(this.vel.x);
};
};
if ((this.pos.y - RADIUS) < 0){
this.pos.y = RADIUS;
this.vel.y = -(this.vel.y);
} else {
if ((this.pos.y + RADIUS) > Global.SCREEN_HEIGHT){
this.pos.y = (Global.SCREEN_HEIGHT - RADIUS);
this.vel.y = -(this.vel.y);
};
};
}
override protected function get color():uint{
return (COLOR);
}
override public function kill():void{
Sounds.playExplosion();
this.isDead = true;
this.game.explodeManager.addNew(new ExplodeSegment(this.pos.clone(), RADIUS, COLOR));
}
override public function testAgainstAvatar(_arg1:DisplayObject, _arg2:ICollisionShape):Boolean{
return (false);
}
override public function update():void{
var _local1:Point;
var _local2:Vector;
var _local3:EnemyMine;
super.update();
if (((this.dangerous) && (this.laying))){
if (this.startCounter <= 0){
this.mineCounter = (this.mineCounter - Global.UPDATE_LENGTH);
if (this.mineCounter <= 0){
this.mineCounter = (this.mineCounter + LAY_DELAY);
_local1 = new Point((this.pos.x - (MINE_SIZE / 2)), (this.pos.y - (MINE_SIZE / 2)));
_local2 = new Vector(this.vel.x, this.vel.y);
_local2 = Geometry.VectorNorm(_local2);
_local2 = Geometry.VectorScale(_local2, -(RADIUS));
_local1 = _local1.add(new Point(_local2.x, _local2.y));
_local3 = new EnemyMine(this.game, _local1, MINE_SIZE, true);
_local3.setVel(new Point(0, 0));
this.game.enemyManager.add(_local3);
};
} else {
this.startCounter = (this.startCounter - Global.UPDATE_LENGTH);
};
};
}
override public function get points():int{
return (Config.POINTS_MINE_LAYER);
}
override protected function draw(_arg1:uint):void{
this.shape.graphics.beginFill(_arg1);
this.shape.graphics.drawCircle(0, 0, RADIUS);
this.shape.graphics.endFill();
}
override public function testAgainstShot(_arg1:Shot):Boolean{
if (this.dangerous){
if (this.shape.hitTestObject(_arg1.getGraphic())){
this.hit(_arg1.red);
return (true);
};
};
return (false);
}
override public function visualUpdate(_arg1:int):void{
super.visualUpdate(_arg1);
}
}
}//package InGame.Enemies
Section 28
//ILevel (InGame.Levels.ILevel)
package InGame.Levels {
public interface ILevel {
function update():ILevel;
}
}//package InGame.Levels
Section 29
//Level01 (InGame.Levels.Level01)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level01 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level01(_arg1:Game, _arg2:Levels){
levelGfx = Level01_levelGfx;
blurbGfx = Level01_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.generators.add(new Generator(_arg1.enemyManager, 2000, _arg2.generateStandard, (Levels.DEFAULT_OVERLAY_LENGTH / 2)));
this.nextTimer = 25500;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level02(this.game, this.levels);
}
}
}//package InGame.Levels
Section 30
//Level01_blurbGfx (InGame.Levels.Level01_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level01_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 31
//Level01_levelGfx (InGame.Levels.Level01_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level01_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 32
//Level02 (InGame.Levels.Level02)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level02 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level02(_arg1:Game, _arg2:Levels){
levelGfx = Level02_levelGfx;
blurbGfx = Level02_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateSplitter, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateStandard, (Levels.DEFAULT_OVERLAY_LENGTH + 2000)));
this.nextTimer = 25500;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level03(this.game, this.levels);
}
}
}//package InGame.Levels
Section 33
//Level02_blurbGfx (InGame.Levels.Level02_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level02_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 34
//Level02_levelGfx (InGame.Levels.Level02_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level02_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 35
//Level03 (InGame.Levels.Level03)
package InGame.Levels {
import flash.geom.*;
import InGame.*;
import InGame.Enemies.*;
public class Level03 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level03(_arg1:Game, _arg2:Levels){
levelGfx = Level03_levelGfx;
blurbGfx = Level03_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.generators.add(new Generator(_arg1.enemyManager, 2000, _arg2.generateSplitter, (Levels.DEFAULT_OVERLAY_LENGTH + 500)));
this.generators.add(new Generator(_arg1.enemyManager, 7000, _arg2.generateStandard, Levels.DEFAULT_OVERLAY_LENGTH));
var _local3:PowerUpHealth = new PowerUpHealth();
_local3.stopMovingAt(new Point(206, 63));
_local3.setLife((Levels.DEFAULT_BLURB_DELAY + Levels.DEFAULT_OVERLAY_LENGTH));
this.game.powerUpManager.add(_local3);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.nextTimer = 25500;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level04(this.game, this.levels);
}
}
}//package InGame.Levels
Section 36
//Level03_blurbGfx (InGame.Levels.Level03_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level03_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 37
//Level03_levelGfx (InGame.Levels.Level03_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level03_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 38
//Level04 (InGame.Levels.Level04)
package InGame.Levels {
import flash.geom.*;
import InGame.*;
import InGame.Enemies.*;
public class Level04 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level04(_arg1:Game, _arg2:Levels){
levelGfx = Level04_levelGfx;
blurbGfx = Level04_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.generators.add(new Generator(_arg1.enemyManager, 2000, _arg2.generateSplitter, (Levels.DEFAULT_OVERLAY_LENGTH + 500)));
var _local3:PowerUpBase = new PowerUpRedShot();
_local3.stopMovingAt(new Point(194, 63));
_local3.setLife((Levels.DEFAULT_BLURB_DELAY + Levels.DEFAULT_OVERLAY_LENGTH));
this.game.powerUpManager.add(_local3);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.nextTimer = 25500;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level05(this.game, this.levels);
}
}
}//package InGame.Levels
Section 39
//Level04_blurbGfx (InGame.Levels.Level04_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level04_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 40
//Level04_levelGfx (InGame.Levels.Level04_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level04_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 41
//Level05 (InGame.Levels.Level05)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level05 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level05(_arg1:Game, _arg2:Levels){
levelGfx = Level05_levelGfx;
blurbGfx = Level05_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 2000, _arg2.generateTough3, Levels.DEFAULT_OVERLAY_LENGTH));
this.nextTimer = 25000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level06(this.game, this.levels);
}
}
}//package InGame.Levels
Section 42
//Level05_blurbGfx (InGame.Levels.Level05_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level05_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 43
//Level05_levelGfx (InGame.Levels.Level05_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level05_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 44
//Level06 (InGame.Levels.Level06)
package InGame.Levels {
import flash.geom.*;
import InGame.*;
import InGame.Enemies.*;
public class Level06 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level06(_arg1:Game, _arg2:Levels){
levelGfx = Level06_levelGfx;
blurbGfx = Level06_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
var _local3:PowerUpBase = new PowerUpFastShot();
_local3.stopMovingAt(new Point(190, 63));
_local3.setLife((Levels.DEFAULT_BLURB_DELAY + Levels.DEFAULT_OVERLAY_LENGTH));
this.game.powerUpManager.add(_local3);
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateTough3, (Levels.DEFAULT_OVERLAY_LENGTH + 500)));
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateSplitter, Levels.DEFAULT_OVERLAY_LENGTH));
this.nextTimer = 25000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level07(this.game, this.levels);
}
}
}//package InGame.Levels
Section 45
//Level06_blurbGfx (InGame.Levels.Level06_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level06_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 46
//Level06_levelGfx (InGame.Levels.Level06_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level06_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 47
//Level07 (InGame.Levels.Level07)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
import flash.utils.*;
public class Level07 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var timer:Timer;
private var boss:IEnemy;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
public function Level07(_arg1:Game, _arg2:Levels){
levelGfx = Level07_levelGfx;
blurbGfx = Level07_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT, false);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT, false);
this.boss = new Boss1(this.game);
this.game.enemyManager.add(this.boss);
}
public function update():ILevel{
this.generators.update();
if (this.boss.dead){
this.next = new Level08(this.game, this.levels);
};
return (this.next);
}
}
}//package InGame.Levels
Section 48
//Level07_blurbGfx (InGame.Levels.Level07_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level07_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 49
//Level07_levelGfx (InGame.Levels.Level07_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level07_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 50
//Level08 (InGame.Levels.Level08)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level08 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level08(_arg1:Game, _arg2:Levels){
levelGfx = Level08_levelGfx;
blurbGfx = Level08_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 2000, _arg2.generateSplitter, Levels.DEFAULT_OVERLAY_LENGTH));
this.nextTimer = 35000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level09(this.game, this.levels);
}
}
}//package InGame.Levels
Section 51
//Level08_blurbGfx (InGame.Levels.Level08_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level08_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 52
//Level08_levelGfx (InGame.Levels.Level08_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level08_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 53
//Level09 (InGame.Levels.Level09)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level09 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level09(_arg1:Game, _arg2:Levels){
levelGfx = Level09_levelGfx;
blurbGfx = Level09_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 4500, _arg2.generateSplitter2, Levels.DEFAULT_OVERLAY_LENGTH));
this.nextTimer = 40000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level10(this.game, this.levels);
}
}
}//package InGame.Levels
Section 54
//Level09_blurbGfx (InGame.Levels.Level09_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level09_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 55
//Level09_levelGfx (InGame.Levels.Level09_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level09_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 56
//Level10 (InGame.Levels.Level10)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level10 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var quadLaserCounter:int;
private var nextTimer:int;
public function Level10(_arg1:Game, _arg2:Levels){
levelGfx = Level10_levelGfx;
blurbGfx = Level10_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 1500, _arg2.generateIgnignot, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators.add(new Generator(_arg1.enemyManager, 1500, _arg2.generateErr, (Levels.DEFAULT_OVERLAY_LENGTH + 500)));
this.nextTimer = 35000;
this.quadLaserCounter = 20000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
this.quadLaserCounter = (this.quadLaserCounter - Global.UPDATE_LENGTH);
if (this.quadLaserCounter <= 0){
Sounds.play(Sounds.quadLaser);
this.quadLaserCounter = 100000;
};
return (this.next);
}
private function onTimer():void{
this.next = new Level11(this.game, this.levels);
}
}
}//package InGame.Levels
Section 57
//Level10_blurbGfx (InGame.Levels.Level10_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level10_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 58
//Level10_levelGfx (InGame.Levels.Level10_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level10_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 59
//Level11 (InGame.Levels.Level11)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level11 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level11(_arg1:Game, _arg2:Levels){
levelGfx = Level11_levelGfx;
blurbGfx = Level11_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateSplitter, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateSplitter2, (Levels.DEFAULT_OVERLAY_LENGTH + 1500)));
this.generators.add(new Generator(_arg1.enemyManager, 3500, _arg2.generateTough3, (Levels.DEFAULT_OVERLAY_LENGTH + 2500)));
this.nextTimer = 50000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
if (this.nextTimer < 5000){
this.generators.clear();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level12(this.game, this.levels);
}
}
}//package InGame.Levels
Section 60
//Level11_blurbGfx (InGame.Levels.Level11_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level11_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 61
//Level11_levelGfx (InGame.Levels.Level11_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level11_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 62
//Level12 (InGame.Levels.Level12)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
import flash.utils.*;
public class Level12 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var timer:Timer;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var snake:Boss2;
public function Level12(_arg1:Game, _arg2:Levels){
levelGfx = Level12_levelGfx;
blurbGfx = Level12_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT, false);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT, false);
this.snake = new Boss2(_arg1);
this.game.enemyManager.add(snake);
}
public function update():ILevel{
this.generators.update();
if (this.snake.dead){
this.next = new Level13(this.game, this.levels);
};
return (this.next);
}
}
}//package InGame.Levels
Section 63
//Level12_blurbGfx (InGame.Levels.Level12_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level12_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 64
//Level12_levelGfx (InGame.Levels.Level12_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level12_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 65
//Level13 (InGame.Levels.Level13)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level13 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level13(_arg1:Game, _arg2:Levels){
levelGfx = Level13_levelGfx;
blurbGfx = Level13_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateSplitter, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateSplitter2, (Levels.DEFAULT_OVERLAY_LENGTH + 1500)));
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateTough3, (Levels.DEFAULT_OVERLAY_LENGTH + 2500)));
this.nextTimer = 45000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
if (this.nextTimer < 5000){
this.generators.clear();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level14(this.game, this.levels);
}
}
}//package InGame.Levels
Section 66
//Level13_blurbGfx (InGame.Levels.Level13_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level13_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 67
//Level13_levelGfx (InGame.Levels.Level13_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level13_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 68
//Level14 (InGame.Levels.Level14)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level14 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level14(_arg1:Game, _arg2:Levels){
levelGfx = Level14_levelGfx;
blurbGfx = Level14_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateMineLayer, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators.add(new Generator(_arg1.enemyManager, 6000, _arg2.generateSplitter, (Levels.DEFAULT_OVERLAY_LENGTH + 1000)));
this.nextTimer = 35000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level15(this.game, this.levels);
}
}
}//package InGame.Levels
Section 69
//Level14_blurbGfx (InGame.Levels.Level14_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level14_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 70
//Level14_levelGfx (InGame.Levels.Level14_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level14_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 71
//Level15 (InGame.Levels.Level15)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class Level15 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function Level15(_arg1:Game, _arg2:Levels){
levelGfx = Level15_levelGfx;
blurbGfx = Level15_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateMineLayer, (Levels.DEFAULT_OVERLAY_LENGTH + 5000)));
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateSplitter, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators.add(new Generator(_arg1.enemyManager, 6000, _arg2.generateSplitter2, (Levels.DEFAULT_OVERLAY_LENGTH + 2000)));
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateTough3, (Levels.DEFAULT_OVERLAY_LENGTH + 2500)));
this.nextTimer = 55000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
if (this.nextTimer < 5000){
this.generators.clear();
};
return (this.next);
}
private function onTimer():void{
this.next = new Level16(this.game, this.levels);
}
}
}//package InGame.Levels
Section 72
//Level15_blurbGfx (InGame.Levels.Level15_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level15_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 73
//Level15_levelGfx (InGame.Levels.Level15_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level15_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 74
//Level16 (InGame.Levels.Level16)
package InGame.Levels {
import flash.geom.*;
import InGame.*;
import InGame.Enemies.*;
import flash.utils.*;
public class Level16 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var timer:Timer;
private var boss:IEnemy;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var addCounter:int;
public function Level16(_arg1:Game, _arg2:Levels){
levelGfx = Level16_levelGfx;
blurbGfx = Level16_blurbGfx;
super();
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.boss = new Boss3(_arg1, new Point((Global.SCREEN_WIDTH / 2), (Global.SCREEN_HEIGHT / 2)));
this.addCounter = Levels.DEFAULT_OVERLAY_LENGTH;
}
public function update():ILevel{
this.generators.update();
if (this.addCounter > 0){
this.addCounter = (this.addCounter - Global.UPDATE_LENGTH);
if (this.addCounter <= 0){
this.game.enemyManager.add(this.boss);
this.addCounter = -1000;
};
};
if (this.boss.dead){
this.next = new LevelFinal(this.game, this.levels);
};
return (this.next);
}
}
}//package InGame.Levels
Section 75
//Level16_blurbGfx (InGame.Levels.Level16_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class Level16_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 76
//Level16_levelGfx (InGame.Levels.Level16_levelGfx)
package InGame.Levels {
import mx.core.*;
public class Level16_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 77
//LevelFinal (InGame.Levels.LevelFinal)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class LevelFinal implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var levelGfx:Class;
private var nextTimer:int;
public function LevelFinal(_arg1:Game, _arg2:Levels){
levelGfx = LevelFinal_levelGfx;
blurbGfx = LevelFinal_blurbGfx;
super();
Config.endlessDiscovered = true;
trace(String(this));
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(levelGfx, 0, Levels.DEFAULT_OVERLAY_LENGTH));
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 8000, _arg2.generateSplitter2, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators.add(new Generator(_arg1.enemyManager, 8000, _arg2.generateMineLayer, (Levels.DEFAULT_OVERLAY_LENGTH + 5000)));
this.generators.add(new Generator(_arg1.enemyManager, 8000, _arg2.generateTough3, (Levels.DEFAULT_OVERLAY_LENGTH + 10000)));
this.nextTimer = 45000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new LevelFinal2(this.game, this.levels);
}
}
}//package InGame.Levels
Section 78
//LevelFinal_blurbGfx (InGame.Levels.LevelFinal_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class LevelFinal_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 79
//LevelFinal_levelGfx (InGame.Levels.LevelFinal_levelGfx)
package InGame.Levels {
import mx.core.*;
public class LevelFinal_levelGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 80
//LevelFinal2 (InGame.Levels.LevelFinal2)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class LevelFinal2 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var nextTimer:int;
public function LevelFinal2(_arg1:Game, _arg2:Levels){
blurbGfx = LevelFinal2_blurbGfx;
super();
trace(String(this));
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 6000, _arg2.generateSplitter2));
this.generators.add(new Generator(_arg1.enemyManager, 6000, _arg2.generateMineLayer, 1000));
this.generators.add(new Generator(_arg1.enemyManager, 6000, _arg2.generateTough3, 2000));
this.nextTimer = 60000;
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new LevelFinal3(this.game, this.levels);
}
}
}//package InGame.Levels
Section 81
//LevelFinal2_blurbGfx (InGame.Levels.LevelFinal2_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class LevelFinal2_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 82
//LevelFinal3 (InGame.Levels.LevelFinal3)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class LevelFinal3 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var nextTimer:int;
public function LevelFinal3(_arg1:Game, _arg2:Levels){
blurbGfx = LevelFinal3_blurbGfx;
super();
trace(String(this));
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateSplitter2));
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateMineLayer, 1000));
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateTough3, 2000));
this.nextTimer = (4 * 60000);
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new LevelFinal4(this.game, this.levels);
}
}
}//package InGame.Levels
Section 83
//LevelFinal3_blurbGfx (InGame.Levels.LevelFinal3_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class LevelFinal3_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 84
//LevelFinal4 (InGame.Levels.LevelFinal4)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class LevelFinal4 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
private var nextTimer:int;
public function LevelFinal4(_arg1:Game, _arg2:Levels){
blurbGfx = LevelFinal4_blurbGfx;
super();
trace(String(this));
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateSplitter2));
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateMineLayer, 1000));
this.generators.add(new Generator(_arg1.enemyManager, 4000, _arg2.generateTough3, 2000));
this.nextTimer = (5 * 60000);
}
public function update():ILevel{
this.generators.update();
this.nextTimer = (this.nextTimer - Global.UPDATE_LENGTH);
if (this.nextTimer <= 0){
this.onTimer();
};
return (this.next);
}
private function onTimer():void{
this.next = new LevelFinal5(this.game, this.levels);
}
}
}//package InGame.Levels
Section 85
//LevelFinal4_blurbGfx (InGame.Levels.LevelFinal4_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class LevelFinal4_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 86
//LevelFinal5 (InGame.Levels.LevelFinal5)
package InGame.Levels {
import InGame.*;
import InGame.Enemies.*;
public class LevelFinal5 implements ILevel {
private var generators:GeneratorManager;
private var blurbGfx:Class;
private var levels:Levels;
private var game:Game;
private var next:ILevel;
public function LevelFinal5(_arg1:Game, _arg2:Levels){
blurbGfx = LevelFinal5_blurbGfx;
super();
trace(String(this));
this.game = _arg1;
this.levels = _arg2;
this.next = this;
_arg1.overlayManager.addNew(new Overlay(blurbGfx, Levels.DEFAULT_BLURB_DELAY, Levels.DEFAULT_OVERLAY_LENGTH));
this.generators = new GeneratorManager();
this.game.powerUpManager.enablePowerUp(PowerUpTypes.HEART);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.RED_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_SHOT);
this.game.powerUpManager.enablePowerUp(PowerUpTypes.FAST_RED_SHOT);
this.generators.add(new Generator(_arg1.enemyManager, 3000, _arg2.generateSplitter2));
this.generators.add(new Generator(_arg1.enemyManager, 5000, _arg2.generateMineLayer, 1000));
this.generators.add(new Generator(_arg1.enemyManager, 3000, _arg2.generateTough3, 2000));
this.generators.add(new Generator(_arg1.enemyManager, 60000, _arg2.generateErr, (Levels.DEFAULT_OVERLAY_LENGTH + 60000)));
this.generators.add(new Generator(_arg1.enemyManager, 60000, _arg2.generateIgnignot, (Levels.DEFAULT_OVERLAY_LENGTH + 60000)));
}
public function update():ILevel{
this.generators.update();
return (this.next);
}
}
}//package InGame.Levels
Section 87
//LevelFinal5_blurbGfx (InGame.Levels.LevelFinal5_blurbGfx)
package InGame.Levels {
import mx.core.*;
public class LevelFinal5_blurbGfx extends BitmapAsset {
}
}//package InGame.Levels
Section 88
//Levels (InGame.Levels.Levels)
package InGame.Levels {
import flash.geom.*;
import InGame.*;
import InGame.Enemies.*;
public class Levels {
private var level:ILevel;
private var game:Game;
public static const DEFAULT_BLURB_DELAY:int = 500;
public static const DEFAULT_OVERLAY_LENGTH:int = 8000;
public function Levels(_arg1:Game, _arg2:Boolean){
this.game = _arg1;
if (_arg2){
Config.startAtEndless = true;
this.level = new LevelFinal(_arg1, this);
} else {
Config.startAtEndless = false;
this.level = new Level01(_arg1, this);
};
}
public function update():void{
this.level = this.level.update();
}
public function generateTough3():IEnemy{
return (new EnemyTough(this.game, 3));
}
public function generateErr():IEnemy{
return (new EnemyErr(this.game));
}
public function generateBoss3():IEnemy{
return (new Boss3(this.game, new Point((Global.SCREEN_WIDTH / 2), (Global.SCREEN_HEIGHT / 2))));
}
public function generateStandard():IEnemy{
return (new EnemyStandard(this.game));
}
public function generateSplitter2():IEnemy{
return (new EnemySplitter2(this.game));
}
public function generateMineLayer():IEnemy{
return (new MineLayer(this.game));
}
public function generateIgnignot():IEnemy{
return (new EnemyIgnignot(this.game));
}
public function generateSplitter():IEnemy{
return (new EnemySplitter(this.game));
}
}
}//package InGame.Levels
Section 89
//Avatar (InGame.Avatar)
package InGame {
import flash.display.*;
import flash.geom.*;
import InGame.Collision.*;
public class Avatar implements IHasGraphic {
public var rotation:Number;
private var life:Number;
private var hurtSquare:HurtSquare;
private var hurt:Boolean;
private var redShotCounter:int;
private var shotManager:ShotManager;
private var shape:Sprite;
private var shotCounter:int;
private var fastShotCounter:int;
private var safeCounter:int;
private var rotSpeed:Number;
private var lifeBar:Bar;
private var startLife:Number;
public static const DEFAULT_SHOT_SPEED:int = 120;
public static const SIZE:int = 38;
public static const DEFAULT_ROTATION_SPEED:Number = 0.2;
public static const HEALTH_POWER_UP_PERCENT:Number = 10;
public static const POWER_UP_TIME:int = 5000;
public static const FAST_SHOT_TIME:int = (DEFAULT_SHOT_TIME / 8);
public static const DEFAULT_SHOT_TIME:int = int(((1000 / DEFAULT_ROTATION_SPEED) / 4.5));
public static const HURT_PERCENT:Number = 20;
public static const DEFAULT_LIFE_AMOUNT:Number = 100;
public static const SAFE_TIME:int = 250;
public function Avatar(_arg1:ShotManager){
this.shotManager = _arg1;
this.rotSpeed = DEFAULT_ROTATION_SPEED;
this.rotation = 20;
this.shotCounter = DEFAULT_SHOT_TIME;
this.shape = new Sprite();
this.drawShape(0);
this.startLife = DEFAULT_LIFE_AMOUNT;
if (Config.easy){
this.startLife = (this.startLife * 2);
};
this.life = this.startLife;
this.lifeBar = new Bar((SIZE - 10), 5, this.startLife, 3407667, 0x7700);
this.lifeBar.x = ((-(SIZE) / 2) + 5);
this.lifeBar.y = ((-(SIZE) / 2) + 5);
this.shape.addChild(this.lifeBar);
this.hurtSquare = new HurtSquare(SIZE);
this.shape.addChild(this.hurtSquare);
this.hurt = false;
this.redShotCounter = (this.fastShotCounter = 0);
this.safeCounter = 0;
this.setPos();
}
private function rotateVec(_arg1:Vector, _arg2:Number):Vector{
var _local3:Number = Math.cos(_arg2);
var _local4:Number = Math.sin(_arg2);
var _local5:Vector = new Vector();
_local5.x = ((_local3 * _arg1.x) - (_local4 * _arg1.y));
_local5.y = ((_local4 * _arg1.x) + (_local3 * _arg1.y));
return (_local5);
}
public function setRedShot():void{
this.redShotCounter = POWER_UP_TIME;
}
public function update():void{
var _local2:int;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local1:Number = (Global.UPDATE_LENGTH / 1000);
this.setPos();
this.rotation = (this.rotation + ((_local1 * 360) * this.rotSpeed));
while (this.rotation > 360) {
this.rotation = (this.rotation - 360);
};
this.shape.rotation = this.rotation;
if (this.safeCounter >= 0){
this.safeCounter = (this.safeCounter - Global.UPDATE_LENGTH);
};
if (this.redShotCounter >= 0){
this.redShotCounter = (this.redShotCounter - Global.UPDATE_LENGTH);
};
if (this.fastShotCounter >= 0){
this.fastShotCounter = (this.fastShotCounter - Global.UPDATE_LENGTH);
};
this.shotCounter = (this.shotCounter - Global.UPDATE_LENGTH);
if (this.shotCounter <= 0){
this.shotCounter = (this.shotCounter + (this.fast) ? FAST_SHOT_TIME : DEFAULT_SHOT_TIME);
_local2 = 0;
while (_local2 < 4) {
_local3 = (this.rotation + (90 * _local2));
_local4 = ((Math.PI * _local3) / 180);
_local5 = ((SIZE / 2) * Math.cos(_local4));
_local6 = ((SIZE / 2) * Math.sin(_local4));
this.shotManager.addNew(new Point((this.shape.x + _local5), (this.shape.y + _local6)), _local3, DEFAULT_SHOT_SPEED, this.red);
_local2++;
};
if (this.red){
Sounds.play(Sounds.laser);
} else {
Sounds.play(Sounds.shoot);
};
};
if (this.life < 0){
this.life = 0;
};
this.lifeBar.setValue(this.life);
this.hurtSquare.update();
}
public function get red():Boolean{
return ((this.redShotCounter > 0));
}
private function setPos():void{
this.shape.x = Global.stage.mouseX;
this.shape.y = Global.stage.mouseY;
}
public function visualUpdate(_arg1:int):void{
var _local2:Number = (_arg1 / 1000);
this.shape.x = Global.stage.mouseX;
this.shape.y = Global.stage.mouseY;
this.shape.rotation = (this.rotation + ((_local2 * 360) * this.rotSpeed));
}
public function get fast():Boolean{
return ((this.fastShotCounter > 0));
}
public function addHealth():void{
this.life = (this.life + ((HEALTH_POWER_UP_PERCENT * this.startLife) / 100));
this.life = Math.min(this.life, this.startLife);
this.lifeBar.setValue(this.life);
}
public function get dead():Boolean{
return ((this.life <= 0));
}
public function genColShape():ICollisionShape{
var _local1:Number = ((Math.PI * this.rotation) / 180);
var _local2:Array = [rotateVec(new Vector((-(SIZE) / 2), (-(SIZE) / 2)), _local1), rotateVec(new Vector((SIZE / 2), (-(SIZE) / 2)), _local1), rotateVec(new Vector((SIZE / 2), (SIZE / 2)), _local1), rotateVec(new Vector((-(SIZE) / 2), (SIZE / 2)), _local1)];
var _local3:ICollisionShape = new CollisionShapePolygon(_local2, new Vector(this.shape.x, this.shape.y));
return (_local3);
}
public function getGraphic():DisplayObject{
return (this.shape);
}
public function damage():void{
if (this.safeCounter <= 0){
this.hurt = true;
this.safeCounter = SAFE_TIME;
this.hurtSquare.hurt();
this.life = (this.life - ((HURT_PERCENT * DEFAULT_LIFE_AMOUNT) / 100));
if (this.life > 0){
Sounds.playHurt();
};
};
}
private function drawShape(_arg1:uint):void{
this.shape.graphics.clear();
this.shape.graphics.beginFill(_arg1);
this.shape.graphics.drawRect((-(SIZE) / 2), (-(SIZE) / 2), SIZE, SIZE);
this.shape.graphics.endFill();
}
public function setFastShot():void{
this.fastShotCounter = (POWER_UP_TIME / 2);
this.shotCounter = FAST_SHOT_TIME;
}
}
}//package InGame
Section 90
//Bar (InGame.Bar)
package InGame {
import flash.display.*;
public class Bar extends Shape {
private var max:Number;
private var color1:uint;
private var color2:uint;
private var value:Number;
private var barWidth:Number;
private var barHeight:Number;
public function Bar(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:uint, _arg5:uint){
this.barWidth = _arg1;
this.barHeight = _arg2;
this.max = _arg3;
this.color1 = _arg4;
this.color2 = _arg5;
this.value = _arg3;
this.draw();
}
public function setValue(_arg1:Number):void{
this.value = Math.min(_arg1, this.max);
if (this.value < 0){
this.value = 0;
};
this.draw();
}
private function draw():void{
this.graphics.clear();
this.graphics.beginFill(color2);
this.graphics.drawRect(0, 0, this.barWidth, this.barHeight);
this.graphics.endFill();
this.graphics.beginFill(color1);
this.graphics.drawRect(0, 0, ((this.value / this.max) * this.barWidth), this.barHeight);
this.graphics.endFill();
}
}
}//package InGame
Section 91
//Blip (InGame.Blip)
package InGame {
import flash.display.*;
import flash.geom.*;
public class Blip implements IHasGraphic {
private var lifeCounter:int;
private var size:Number;
private var shape:Shape;
private var pos:Point;
public static const LIFE:int = 400;
public static const SIZE_INCREASE:int = 100;
public function Blip(_arg1:Number){
this.pos = new Point(0, 0);
this.size = _arg1;
this.shape = new Shape();
this.pos.x = (this.pos.x + (this.size / 2));
this.pos.y = (this.pos.y + (this.size / 2));
this.lifeCounter = 0;
this.draw(this.size);
}
private function draw(_arg1:Number):void{
this.shape.graphics.clear();
if (!this.dead){
this.shape.graphics.lineStyle(1, PowerUpBase.OUTLINE_COLOR);
this.shape.graphics.beginFill(PowerUpBase.CIRCLE_COLOR);
this.shape.graphics.drawCircle(0, 0, _arg1);
this.shape.graphics.endFill();
};
}
public function update():void{
var _local1:Number;
if (!this.dead){
_local1 = (Global.UPDATE_LENGTH / 1000);
this.size = (this.size + (SIZE_INCREASE * _local1));
this.draw(this.size);
lifeCounter = (lifeCounter + Global.UPDATE_LENGTH);
this.shape.alpha = ((LIFE - lifeCounter) / LIFE);
} else {
this.shape.alpha = 0;
};
}
public function get dead():Boolean{
return ((this.lifeCounter > LIFE));
}
public function visualUpdate(_arg1:int):void{
var _local2:Number;
var _local3:Number;
if (!this.dead){
_local2 = (_arg1 / 1000);
_local3 = (this.size + (_local2 * SIZE_INCREASE));
this.draw(_local3);
};
}
public function getGraphic():DisplayObject{
return (this.shape);
}
}
}//package InGame
Section 92
//DeadAvatar (InGame.DeadAvatar)
package InGame {
import flash.display.*;
import flash.geom.*;
public class DeadAvatar implements IHasGraphic {
private var size:Number;
private var shape:Shape;
private var pos:Point;
private var life:int;
private var rotation:Number;
public static const LIFE:int = 1000;
public static const SIZE_CHANGE:Number = 400;
public static const ROT_SPEED:Number = 0.4;
public function DeadAvatar(_arg1:Avatar){
this.shape = new Shape();
this.rotation = ((Math.PI * _arg1.rotation) / 180);
this.pos = new Point(_arg1.getGraphic().x, _arg1.getGraphic().y);
this.draw(Avatar.SIZE);
this.shape.x = this.pos.x;
this.shape.y = this.pos.y;
this.size = Avatar.SIZE;
this.life = LIFE;
}
private function draw(_arg1:Number):void{
this.shape.graphics.clear();
this.shape.graphics.lineStyle(1, 0x444444);
this.shape.graphics.drawRect((-(_arg1) / 2), (-(_arg1) / 2), _arg1, _arg1);
}
public function update():void{
var _local1:Number;
if (this.life > 0){
_local1 = (Global.UPDATE_LENGTH / 1000);
this.size = (this.size + (SIZE_CHANGE * _local1));
this.rotation = (this.rotation + (((_local1 * 2) * Math.PI) * ROT_SPEED));
while (this.rotation > (2 * Math.PI)) {
this.rotation = (this.rotation - (2 * Math.PI));
};
this.draw(size);
this.shape.rotation = ((180 * this.rotation) / Math.PI);
this.life = (this.life - Global.UPDATE_LENGTH);
this.shape.alpha = (this.life / LIFE);
} else {
this.shape.alpha = 0;
};
}
public function getGraphic():DisplayObject{
return (this.shape);
}
}
}//package InGame
Section 93
//DeathScreen (InGame.DeathScreen)
package InGame {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class DeathScreen implements IGameSection {
private var buttons:Array;
private var game:Game;
private var deadAvatar:DeadAvatar;
private var managers:Array;
private var holder:Sprite;
private var first:Boolean;
private var nextSection:IGameSection;
public static const BUTTON_GAP:int = 5;
public function DeathScreen(_arg1:Game){
this.nextSection = this;
this.first = true;
this.game = _arg1;
this.holder = new Sprite();
this.managers = new Array();
var _local2:TextFormat = new TextFormat();
_local2.font = Fonts.DEFAULT_FONT;
_local2.size = 30;
var _local3:TextField = new TextField();
_local3.selectable = false;
_local3.embedFonts = true;
_local3.textColor = 0;
_local3.defaultTextFormat = _local2;
_local3.antiAliasType = AntiAliasType.ADVANCED;
_local3.sharpness = -200;
_local3.autoSize = TextFieldAutoSize.LEFT;
_local3.text = String(_arg1.score.getScore());
this.centerHor(_local3);
_local3.y = 130;
this.holder.addChild(_arg1.explodeManager.getGraphic());
this.holder.addChild(_arg1.overlayManager.getGraphic());
this.holder.addChild(_arg1.powerUpManager.getGraphic());
this.holder.addChild(_arg1.shotManager.getGraphic());
this.holder.addChild(_arg1.enemyManager.getGraphic());
this.holder.addChild(_arg1.score.getGraphic());
this.holder.addChild(_local3);
this.managers.push(_arg1.explodeManager);
this.managers.push(_arg1.overlayManager);
this.managers.push(_arg1.powerUpManager);
this.managers.push(_arg1.shotManager);
this.managers.push(_arg1.enemyManager);
this.deadAvatar = new DeadAvatar(_arg1.avatar);
this.holder.addChild(this.deadAvatar.getGraphic());
_arg1.enemyManager.stopMineLayers();
var _local4:CustomButton = new CustomButton("Submit Score", 24);
var _local5:CustomButton = new CustomButton("Play Again", 24);
var _local6:CustomButton = new CustomButton("Main Menu", 24);
_local4.addEventListener(MouseEvent.CLICK, onSubmitScoreClicked);
_local5.addEventListener(MouseEvent.CLICK, onPlayAgainClicked);
_local6.addEventListener(MouseEvent.CLICK, onMainMenuClicked);
this.buttons = [_local4, _local5, _local6];
this.addAndCenterButtons();
}
public function draw():void{
}
public function update():IGameSection{
var _local1:*;
if (this.first){
this.first = false;
Sounds.play(Sounds.avatarDead);
};
for each (_local1 in this.managers) {
_local1.update();
};
this.deadAvatar.update();
return (this.nextSection);
}
private function addAndCenterButtons():void{
var _local5:SimpleButton;
var _local1:Sprite = new Sprite();
var _local2:int;
var _local3:int;
var _local4:int;
while (_local4 < this.buttons.length) {
_local5 = this.buttons[_local4];
_local5.y = _local2;
_local2 = (_local2 + (_local5.height + BUTTON_GAP));
_local1.addChild(_local5);
_local3 = Math.max(_local5.width, _local3);
_local4++;
};
_local4 = 0;
while (_local4 < this.buttons.length) {
_local5 = this.buttons[_local4];
_local5.x = ((_local3 - _local5.width) / 2);
_local4++;
};
_local1.x = ((Global.SCREEN_WIDTH - _local3) / 2);
_local1.y = ((Global.SCREEN_HEIGHT - (_local2 - BUTTON_GAP)) / 2);
this.holder.addChild(_local1);
}
public function keyUp(_arg1:uint):void{
}
public function mouseUp(_arg1:int, _arg2:int):void{
}
public function keyDown(_arg1:uint):void{
}
public function visualUpdate(_arg1:int):void{
}
public function mouseDown(_arg1:int, _arg2:int):void{
}
public function getGraphic():DisplayObject{
return (this.holder);
}
private function centerHor(_arg1:DisplayObject):void{
_arg1.x = ((Global.SCREEN_WIDTH - _arg1.width) / 2);
}
private function onMainMenuClicked(_arg1:Event):void{
this.nextSection = new MainMenu();
}
private function onPlayAgainClicked(_arg1:Event):void{
this.nextSection = new Game(Config.startAtEndless);
}
private function onSubmitScoreClicked(_arg1:Event):void{
this.nextSection = new LeaderBoard(this.game.score.getScore());
}
}
}//package InGame
Section 94
//EnemyManager (InGame.EnemyManager)
package InGame {
import flash.display.*;
import InGame.Enemies.*;
public class EnemyManager implements IHasGraphic {
public var enemies:Array;
private var holder:Sprite;
private var game:Game;
public function EnemyManager(_arg1:Game){
this.game = _arg1;
this.holder = new Sprite();
this.enemies = new Array();
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function add(_arg1:IEnemy):void{
this.enemies.push(_arg1);
this.holder.addChild(_arg1.getGraphic());
}
public function update():void{
var enemy:IEnemy;
var alive:Function;
alive = function (_arg1:IEnemy, _arg2:int, _arg3:Array):Boolean{
return (!(_arg1.dead));
};
for each (enemy in this.enemies) {
enemy.update();
if (enemy.dead){
this.holder.removeChild(enemy.getGraphic());
game.score.add(enemy.points);
};
};
this.enemies = this.enemies.filter(alive);
}
public function visualUpdate(_arg1:int):void{
var _local2:IEnemy;
for each (_local2 in this.enemies) {
_local2.visualUpdate(_arg1);
};
}
public function stopMineLayers():void{
var _local1:IEnemy;
var _local2:MineLayer;
for each (_local1 in this.enemies) {
if ((_local1 is MineLayer)){
_local2 = (_local1 as MineLayer);
_local2.stopLaying();
};
};
}
}
}//package InGame
Section 95
//Explode (InGame.Explode)
package InGame {
import flash.display.*;
import flash.geom.*;
public class Explode implements IHasGraphic {
protected var lifeCounter:int;
protected var size:Number;
protected var shape:Shape;
protected var pos:Point;
public static const DEFAULT_SIZE_INCREASE:int = 300;
public static const LIFE:int = 300;
public function Explode(_arg1:Point, _arg2:Number){
this.pos = _arg1;
this.size = _arg2;
this.shape = new Shape();
this.shape.x = this.pos.x;
this.shape.y = this.pos.y;
this.lifeCounter = 0;
this.draw(this.size);
}
protected function get sizeIncrease():Number{
return (DEFAULT_SIZE_INCREASE);
}
protected function draw(_arg1:Number):void{
}
public function get dead():Boolean{
return ((this.lifeCounter > LIFE));
}
public function update():void{
var _local1:Number;
if (!this.dead){
_local1 = (Global.UPDATE_LENGTH / 1000);
this.size = (this.size + (this.sizeIncrease * _local1));
this.draw(this.size);
lifeCounter = (lifeCounter + Global.UPDATE_LENGTH);
this.shape.alpha = ((LIFE - lifeCounter) / LIFE);
} else {
this.shape.alpha = 0;
};
}
public function getGraphic():DisplayObject{
return (this.shape);
}
public function visualUpdate(_arg1:int):void{
var _local2:Number;
var _local3:Number;
if (!this.dead){
_local2 = (_arg1 / 1000);
_local3 = (this.size + (_local2 * this.sizeIncrease));
this.draw(_local3);
};
}
}
}//package InGame
Section 96
//ExplodeEnemy (InGame.ExplodeEnemy)
package InGame {
import flash.geom.*;
public class ExplodeEnemy extends Explode {
private var color:uint;
public function ExplodeEnemy(_arg1:Point, _arg2:Number, _arg3:uint){
super(new Point((_arg1.x + (_arg2 / 2)), (_arg1.y + (_arg2 / 2))), _arg2);
this.color = _arg3;
}
override protected function draw(_arg1:Number):void{
this.shape.graphics.clear();
this.shape.graphics.beginFill(this.color);
this.shape.graphics.drawRect((-(_arg1) / 2), (-(_arg1) / 2), _arg1, _arg1);
this.shape.graphics.endFill();
}
}
}//package InGame
Section 97
//ExplodeManager (InGame.ExplodeManager)
package InGame {
import flash.display.*;
public class ExplodeManager implements IHasGraphic {
public var explodes:Array;
private var holder:Sprite;
public function ExplodeManager(){
this.holder = new Sprite();
this.explodes = new Array();
}
public function update():void{
var explode:Explode;
var isDead:Function;
isDead = function (_arg1:Explode, _arg2:int, _arg3:Array):Boolean{
return (!(_arg1.dead));
};
for each (explode in this.explodes) {
explode.update();
if (explode.dead){
this.holder.removeChild(explode.getGraphic());
};
};
this.explodes = this.explodes.filter(isDead);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function visualUpdate(_arg1:int):void{
var _local2:Explode;
for each (_local2 in this.explodes) {
_local2.visualUpdate(_arg1);
};
}
public function addNew(_arg1:Explode):void{
this.explodes.push(_arg1);
this.holder.addChild(_arg1.getGraphic());
}
}
}//package InGame
Section 98
//ExplodePop (InGame.ExplodePop)
package InGame {
import flash.geom.*;
public class ExplodePop extends Explode {
public function ExplodePop(_arg1:Point, _arg2:Number){
super(_arg1, _arg2);
}
override protected function get sizeIncrease():Number{
return ((50 * Math.sin(((Math.PI / 2) + (((Math.PI / 2) * lifeCounter) / LIFE)))));
}
override protected function draw(_arg1:Number):void{
this.shape.graphics.clear();
this.shape.graphics.lineStyle(1, PowerUpBase.OUTLINE_COLOR);
this.shape.graphics.drawCircle(0, 0, _arg1);
}
}
}//package InGame
Section 99
//ExplodeRect (InGame.ExplodeRect)
package InGame {
import flash.geom.*;
public class ExplodeRect extends Explode {
private var color:uint;
private var rect:Rectangle;
public function ExplodeRect(_arg1:Rectangle, _arg2:uint){
this.rect = _arg1.clone();
this.color = _arg2;
super(new Point(), 1);
}
override protected function draw(_arg1:Number):void{
this.shape.graphics.clear();
this.shape.graphics.beginFill(this.color);
this.shape.graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
this.shape.graphics.endFill();
}
}
}//package InGame
Section 100
//ExplodeSegment (InGame.ExplodeSegment)
package InGame {
import flash.geom.*;
public class ExplodeSegment extends Explode {
private var color:uint;
public function ExplodeSegment(_arg1:Point, _arg2:Number, _arg3:uint){
this.color = _arg3;
super(_arg1, _arg2);
}
override protected function draw(_arg1:Number):void{
this.shape.graphics.clear();
this.shape.graphics.beginFill(this.color);
this.shape.graphics.drawCircle(0, 0, _arg1);
}
override protected function get sizeIncrease():Number{
return ((50 * Math.sin(((Math.PI / 2) + (((Math.PI / 2) * lifeCounter) / LIFE)))));
}
}
}//package InGame
Section 101
//Game (InGame.Game)
package InGame {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import InGame.Enemies.*;
import InGame.Collision.*;
import InGame.Levels.*;
import flash.ui.*;
public class Game implements IGameSection {
private var nextSection:IGameSection;
public var enemyManager:EnemyManager;
public var explodeManager:ExplodeManager;
public var powerUpManager:PowerUpManager;
public var score:Scores;
public var shotManager:ShotManager;
public var avatar:Avatar;
private var debugCounter:int;// = 2000
private var levels:Levels;
private var holder:Sprite;
public var overlayManager:OverlayManager;
public static const HARD_MODE_CLASS:Class = Game_HARD_MODE_CLASS;
public static const BACKGROUND_COLOR:uint = 0xFFFFFF;
public static const OUTLINE_COLOR:uint = 0xDDDDDD;
private static const DEBUG_TIME:int = 2000;
public static const EASY_MODE_CLASS:Class = Game_EASY_MODE_CLASS;
public function Game(_arg1:Boolean=false){
var _local2:DisplayObject;
super();
Mouse.hide();
this.nextSection = this;
this.holder = new Sprite();
this.holder.graphics.beginFill(0xFFFFFF);
this.holder.graphics.drawRect(0, 0, Global.SCREEN_WIDTH, Global.SCREEN_HEIGHT);
this.shotManager = new ShotManager();
this.avatar = new Avatar(this.shotManager);
this.enemyManager = new EnemyManager(this);
this.explodeManager = new ExplodeManager();
this.powerUpManager = new PowerUpManager();
this.overlayManager = new OverlayManager();
this.score = new Scores();
if (Config.easy){
_local2 = new EASY_MODE_CLASS();
} else {
_local2 = new HARD_MODE_CLASS();
};
_local2.x = ((Global.SCREEN_WIDTH - _local2.width) / 2);
_local2.y = ((Global.SCREEN_HEIGHT - _local2.height) - 5);
this.holder.addChild(_local2);
this.holder.addChild(this.explodeManager.getGraphic());
this.holder.addChild(this.powerUpManager.getGraphic());
this.holder.addChild(this.avatar.getGraphic());
this.holder.addChild(this.shotManager.getGraphic());
this.holder.addChild(this.enemyManager.getGraphic());
this.holder.addChild(this.overlayManager.getGraphic());
this.holder.addChild(this.score.getGraphic());
this.addPauseButton();
this.levels = new Levels(this, _arg1);
}
public function mouseUp(_arg1:int, _arg2:int):void{
}
public function draw():void{
}
public function keyUp(_arg1:uint):void{
}
public function update():IGameSection{
this.doCollisions();
this.avatar.update();
this.shotManager.update();
this.enemyManager.update();
this.explodeManager.update();
this.powerUpManager.update();
this.overlayManager.update();
this.levels.update();
if (this.avatar.dead){
Mouse.show();
this.nextSection = new DeathScreen(this);
};
if (this.nextSection != this){
SoundMixer.stopAll();
};
this.debugCounter = (this.debugCounter - Global.UPDATE_LENGTH);
if (this.debugCounter <= 0){
this.debugCounter = (this.debugCounter + DEBUG_TIME);
trace(("Enemies: " + this.enemyManager.enemies.length), ("Shots: " + this.shotManager.shots.length), ("Explosions: " + this.explodeManager.explodes.length), ("Power ups: " + this.powerUpManager.powerUps.length), ("Overlays: " + this.overlayManager.overlays.length));
};
return (this.nextSection);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
private function addPauseButton():void{
var mouseOver:Function;
var mouseOut:Function;
mouseOver = function (_arg1:Event):void{
Mouse.show();
};
mouseOut = function (_arg1:Event):void{
Mouse.hide();
};
var pauseButton:CustomButton = new CustomButton("Menu (esc)", 16, false);
this.holder.addChild(pauseButton);
pauseButton.x = ((Global.SCREEN_WIDTH - 5) - pauseButton.width);
pauseButton.y = ((Global.SCREEN_HEIGHT - 5) - pauseButton.height);
pauseButton.addEventListener(MouseEvent.MOUSE_OVER, mouseOver);
pauseButton.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
pauseButton.addEventListener(MouseEvent.CLICK, this.pauseClick);
}
public function keyDown(_arg1:uint):void{
if (Keyboard.ESCAPE == _arg1){
this.showMenu();
};
}
private function doCollisions():void{
var _local3:Shot;
var _local4:DisplayObject;
var _local5:ICollisionShape;
var _local6:Array;
var _local7:PowerUpBase;
var _local8:IEnemy;
var _local1:Array = this.shotManager.shots;
var _local2:Array = this.enemyManager.enemies;
for each (_local3 in _local1) {
for each (_local8 in _local2) {
if (((!(_local8.dead)) && (!(_local3.dead)))){
if (_local8.testAgainstShot(_local3)){
if (!_local3.red){
_local3.kill();
};
};
};
};
};
_local4 = this.avatar.getGraphic();
_local5 = this.avatar.genColShape();
for each (_local8 in _local2) {
if (!_local8.dead){
if (_local8.testAgainstAvatar(_local4, _local5)){
this.avatar.damage();
break;
};
};
};
_local6 = this.powerUpManager.powerUps;
for each (_local7 in _local6) {
if (!_local7.dead){
if (Collider.Test(_local7.collisionShape, _local5).hit){
switch (_local7.type){
case PowerUpTypes.RED_SHOT:
this.avatar.setRedShot();
break;
case PowerUpTypes.FAST_SHOT:
this.avatar.setFastShot();
break;
case PowerUpTypes.FAST_RED_SHOT:
this.avatar.setFastShot();
this.avatar.setRedShot();
break;
case PowerUpTypes.HEART:
this.avatar.addHealth();
break;
default:
trace("Unknown power up type!");
break;
};
Sounds.play(Sounds.powerUpCollect);
this.explodeManager.addNew(new ExplodePop(_local7.pos, PowerUpBase.RADIUS));
_local7.kill();
};
};
};
}
public function mouseDown(_arg1:int, _arg2:int):void{
}
public function visualUpdate(_arg1:int):void{
this.avatar.visualUpdate(_arg1);
this.shotManager.visualUpdate(_arg1);
this.enemyManager.visualUpdate(_arg1);
this.explodeManager.visualUpdate(_arg1);
this.powerUpManager.visualUpdate(_arg1);
}
public function setNextSection(_arg1:IGameSection):void{
this.nextSection = _arg1;
}
private function pauseClick(_arg1:Event):void{
this.showMenu();
}
private function showMenu():void{
Mouse.show();
this.nextSection = new PauseMenu(this);
}
}
}//package InGame
Section 102
//Game_EASY_MODE_CLASS (InGame.Game_EASY_MODE_CLASS)
package InGame {
import mx.core.*;
public class Game_EASY_MODE_CLASS extends BitmapAsset {
}
}//package InGame
Section 103
//Game_HARD_MODE_CLASS (InGame.Game_HARD_MODE_CLASS)
package InGame {
import mx.core.*;
public class Game_HARD_MODE_CLASS extends BitmapAsset {
}
}//package InGame
Section 104
//HurtSquare (InGame.HurtSquare)
package InGame {
import flash.display.*;
public class HurtSquare extends Shape {
private var flashCounter:int;
public static const COLOR:uint = 0xFF0000;
public static const MAX_ALPHA:Number = 0.98;
public static const FLASH_TIME:int = 750;
public function HurtSquare(_arg1:int){
this.graphics.beginFill(COLOR);
this.graphics.drawRect((-(_arg1) / 2), (-(_arg1) / 2), _arg1, _arg1);
this.graphics.endFill();
this.alpha = 0;
this.flashCounter = 0;
}
public function update():void{
if (this.flashCounter > 0){
this.alpha = Math.sin(((((Math.PI / 4) * MAX_ALPHA) * this.flashCounter) / FLASH_TIME));
this.flashCounter = (this.flashCounter - Global.UPDATE_LENGTH);
} else {
this.alpha = 0;
};
}
public function hurt():void{
this.flashCounter = FLASH_TIME;
}
}
}//package InGame
Section 105
//Overlay (InGame.Overlay)
package InGame {
import flash.display.*;
public class Overlay implements IHasGraphic {
private var total:int;
private var delayCount:int;
private var gfx:DisplayObject;
private var totalCount:int;
public static const FADE_TIME:int = 500;
public static const TOP_BORDER:int = 15;
public function Overlay(_arg1:Class, _arg2:int, _arg3:int){
this.gfx = new (_arg1);
this.gfx.x = ((Global.SCREEN_WIDTH - this.gfx.width) / 2);
this.gfx.y = TOP_BORDER;
this.delayCount = _arg2;
this.totalCount = (this.total = _arg3);
this.gfx.alpha = 0;
}
public function getGraphic():DisplayObject{
return (this.gfx);
}
public function get dead():Boolean{
return ((this.totalCount <= 0));
}
public function update():void{
if (this.delayCount > 0){
this.delayCount = (this.delayCount - Global.UPDATE_LENGTH);
} else {
this.totalCount = (this.totalCount - Global.UPDATE_LENGTH);
if ((this.total - this.totalCount) < FADE_TIME){
this.gfx.alpha = ((this.total - this.totalCount) / FADE_TIME);
} else {
if (this.totalCount < FADE_TIME){
this.gfx.alpha = Math.max(0, (this.totalCount / FADE_TIME));
};
};
};
}
}
}//package InGame
Section 106
//OverlayManager (InGame.OverlayManager)
package InGame {
import flash.display.*;
public class OverlayManager implements IHasGraphic {
public var overlays:Array;
private var holder:Sprite;
public function OverlayManager(){
this.holder = new Sprite();
this.overlays = new Array();
}
public function update():void{
var overlay:Overlay;
var alive:Function;
alive = function (_arg1:Overlay, _arg2:int, _arg3:Array):Boolean{
return (!(_arg1.dead));
};
for each (overlay in this.overlays) {
overlay.update();
if (overlay.dead){
this.holder.removeChild(overlay.getGraphic());
};
};
this.overlays = this.overlays.filter(alive);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function addNew(_arg1:Overlay):void{
this.overlays.push(_arg1);
this.holder.addChild(_arg1.getGraphic());
}
}
}//package InGame
Section 107
//PauseMenu (InGame.PauseMenu)
package InGame {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
import flash.filters.*;
public class PauseMenu implements IGameSection {
private var buttons:Array;
private var nextSection:IGameSection;
private var game:Game;
private var soundOnButton:CustomButton;
private var holder:Sprite;
private var soundOffButton:CustomButton;
private var escapeCounter:int;// = 400
public static const BUTTON_GAP:int = 5;
public function PauseMenu(_arg1:Game){
this.nextSection = this;
this.game = _arg1;
this.holder = new Sprite();
var _local2:Bitmap = new Bitmap(new BitmapData(Global.SCREEN_WIDTH, Global.SCREEN_HEIGHT, false, 0));
_local2.bitmapData.draw(_arg1.getGraphic());
var _local3:BlurFilter = new BlurFilter();
_local2.filters = [_local3];
var _local4:Bitmap = new Bitmap(new BitmapData(Global.SCREEN_WIDTH, Global.SCREEN_HEIGHT, true, 2298478591));
this.holder.addChild(_local2);
this.holder.addChild(_local4);
var _local5:CustomButton = new CustomButton("Resume Game", 24);
var _local6:CustomButton = new CustomButton("Main Menu", 24);
soundOnButton = new CustomButton("Turn Sound On", 24);
soundOffButton = new CustomButton("Turn Sound Off", 24);
_local5.addEventListener(MouseEvent.CLICK, onResumeButtonClicked);
_local6.addEventListener(MouseEvent.CLICK, mainMenuButtonClicked);
soundOnButton.addEventListener(MouseEvent.CLICK, onSoundOnButtonClicked);
soundOffButton.addEventListener(MouseEvent.CLICK, onSoundOffButtonClicked);
this.buttons = [_local5, _local6, soundOnButton, soundOffButton];
this.addAndCenterButtons();
soundOffButton.x = soundOnButton.x;
soundOffButton.y = soundOnButton.y;
this.soundOffButton.visible = Config.soundOn;
this.soundOnButton.visible = !(Config.soundOn);
}
public function draw():void{
Mouse.show();
}
private function onResumeButtonClicked(_arg1:Event):void{
this.resumeGame();
}
private function onSoundOffButtonClicked(_arg1:Event):void{
this.soundOffButton.visible = false;
this.soundOnButton.visible = true;
Config.soundOn = false;
}
public function update():IGameSection{
if (this.escapeCounter >= 0){
this.escapeCounter = (this.escapeCounter - Global.UPDATE_LENGTH);
};
return (this.nextSection);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
private function addAndCenterButtons():void{
var _local5:SimpleButton;
var _local1:Sprite = new Sprite();
var _local2:int;
var _local3:int;
var _local4:int;
while (_local4 < this.buttons.length) {
_local5 = this.buttons[_local4];
_local5.y = _local2;
_local2 = (_local2 + (_local5.height + BUTTON_GAP));
_local1.addChild(_local5);
_local3 = Math.max(_local5.width, _local3);
_local4++;
};
_local4 = 0;
while (_local4 < this.buttons.length) {
_local5 = this.buttons[_local4];
_local5.x = ((_local3 - _local5.width) / 2);
_local4++;
};
_local1.x = ((Global.SCREEN_WIDTH - _local3) / 2);
_local1.y = ((Global.SCREEN_HEIGHT - (_local2 - BUTTON_GAP)) / 2);
this.holder.addChild(_local1);
}
public function keyUp(_arg1:uint):void{
}
private function onSoundOnButtonClicked(_arg1:Event):void{
this.soundOffButton.visible = true;
this.soundOnButton.visible = false;
Config.soundOn = true;
}
public function mouseUp(_arg1:int, _arg2:int):void{
}
public function keyDown(_arg1:uint):void{
if (Keyboard.ESCAPE == _arg1){
if (this.escapeCounter <= 0){
this.resumeGame();
};
};
}
public function visualUpdate(_arg1:int):void{
}
public function mouseDown(_arg1:int, _arg2:int):void{
}
private function centerHor(_arg1:DisplayObject):void{
_arg1.x = ((Global.SCREEN_WIDTH - _arg1.width) / 2);
}
private function mainMenuButtonClicked(_arg1:Event):void{
this.nextSection = new MainMenu();
}
private function resumeGame():void{
Mouse.hide();
this.nextSection = this.game;
this.game.setNextSection(this.game);
}
}
}//package InGame
Section 108
//PowerUpBase (InGame.PowerUpBase)
package InGame {
import flash.display.*;
import flash.geom.*;
import InGame.Collision.*;
public class PowerUpBase implements IHasGraphic {
protected var speed:Point;
protected var holder:Sprite;
public var collisionShape:ICollisionShape;
private var blip:Blip;
public var pos:Point;
private var life:int;
public static const OUTLINE_COLOR:uint = 0x888888;
public static const SPEED:Number = 50;
public static const RADIUS:Number = 8;
public static const CIRCLE_COLOR:uint = 0xF0F0F0;
public static const ICON_FILL_AMOUNT:Number = 0.5;
public static const FADE_OUT_AT:int = 500;
public static const LIFE:int = 5000;
public function PowerUpBase(){
this.holder = new Sprite();
this.blip = new Blip(RADIUS);
this.holder.graphics.lineStyle(1, OUTLINE_COLOR);
this.holder.graphics.beginFill(CIRCLE_COLOR);
this.holder.graphics.drawCircle(0, 0, RADIUS);
this.holder.graphics.endFill();
this.holder.addChild(this.blip.getGraphic());
this.pos = new Point((Math.random() * Global.SCREEN_WIDTH), (Math.random() * Global.SCREEN_HEIGHT));
var _local1:Number = ((Math.random() * 2) * Math.PI);
this.speed = new Point((SPEED * Math.cos(_local1)), (SPEED * Math.sin(_local1)));
this.holder.x = this.pos.x;
this.holder.y = this.pos.y;
this.life = LIFE;
this.collisionShape = new CollisionShapeCircle(RADIUS, new Vector(0, 0));
this.collisionShape.moveTo(new Vector(this.pos.x, this.pos.y));
Sounds.play(Sounds.powerUpAppear);
}
public function stopMovingAt(_arg1:Point):void{
this.speed = new Point(0, 0);
this.pos = _arg1.clone();
this.holder.x = this.pos.x;
this.holder.y = this.pos.y;
}
public function get dead():Boolean{
return ((this.life <= 0));
}
public function kill():void{
this.life = 0;
}
public function update():void{
var _local1:Number = (Global.UPDATE_LENGTH / 1000);
this.blip.update();
this.pos.x = (this.pos.x + (this.speed.x * _local1));
this.pos.y = (this.pos.y + (this.speed.y * _local1));
this.constrain();
this.collisionShape.moveTo(new Vector(this.pos.x, this.pos.y));
this.holder.x = this.pos.x;
this.holder.y = this.pos.y;
if (!this.dead){
this.life = (this.life - Global.UPDATE_LENGTH);
};
if (this.life <= FADE_OUT_AT){
this.holder.alpha = (this.life / FADE_OUT_AT);
};
}
public function setLife(_arg1:int):void{
this.life = _arg1;
}
public function visualUpdate(_arg1:int):void{
var _local2:Number = (_arg1 / 1000);
this.blip.visualUpdate(_arg1);
this.holder.x = (this.pos.x + (this.speed.x * _local2));
this.holder.y = (this.pos.y + (this.speed.y * _local2));
}
public function getGraphic():DisplayObject{
return (this.holder);
}
private function constrain():void{
if ((this.pos.x - RADIUS) < 0){
this.speed.x = -(this.speed.x);
this.pos.x = RADIUS;
};
if ((this.pos.x + RADIUS) > Global.SCREEN_WIDTH){
this.speed.x = -(this.speed.x);
this.pos.x = (Global.SCREEN_WIDTH - RADIUS);
};
if ((this.pos.y - RADIUS) < 0){
this.speed.y = -(this.speed.y);
this.pos.y = RADIUS;
};
if ((this.pos.y + RADIUS) > Global.SCREEN_HEIGHT){
this.speed.y = -(this.speed.y);
this.pos.y = (Global.SCREEN_HEIGHT - RADIUS);
};
}
public function get type():int{
return (PowerUpTypes.UNKNOWN);
}
}
}//package InGame
Section 109
//PowerUpFastRedShot (InGame.PowerUpFastRedShot)
package InGame {
import flash.display.*;
public class PowerUpFastRedShot extends PowerUpBase {
private var rot:Number;
private var icon:Shape;
public static const ROTATION_SPEED:Number = 1;
public function PowerUpFastRedShot(){
this.icon = new Shape();
this.icon.graphics.lineStyle(3, 0xFF0000);
this.icon.graphics.moveTo(0, (-(RADIUS) * ICON_FILL_AMOUNT));
this.icon.graphics.lineTo(0, (RADIUS * ICON_FILL_AMOUNT));
this.icon.graphics.moveTo((-(RADIUS) * ICON_FILL_AMOUNT), 0);
this.icon.graphics.lineTo((RADIUS * ICON_FILL_AMOUNT), 0);
this.holder.addChild(this.icon);
this.rot = 0;
}
override public function update():void{
super.update();
var _local1:Number = (Global.UPDATE_LENGTH / 1000);
this.rot = (this.rot + ((360 * ROTATION_SPEED) * _local1));
while (this.rot > 360) {
this.rot = (this.rot - 360);
};
this.icon.rotation = rot;
}
override public function get type():int{
return (PowerUpTypes.FAST_RED_SHOT);
}
}
}//package InGame
Section 110
//PowerUpFastShot (InGame.PowerUpFastShot)
package InGame {
import flash.display.*;
public class PowerUpFastShot extends PowerUpBase {
private var rot:Number;
private var icon:Shape;
public static const ROTATION_SPEED:Number = 1;
public function PowerUpFastShot(){
this.icon = new Shape();
this.icon.graphics.lineStyle(3, 0);
this.icon.graphics.moveTo(0, (-(RADIUS) * ICON_FILL_AMOUNT));
this.icon.graphics.lineTo(0, (RADIUS * ICON_FILL_AMOUNT));
this.icon.graphics.moveTo((-(RADIUS) * ICON_FILL_AMOUNT), 0);
this.icon.graphics.lineTo((RADIUS * ICON_FILL_AMOUNT), 0);
this.holder.addChild(this.icon);
this.rot = 0;
}
override public function update():void{
super.update();
var _local1:Number = (Global.UPDATE_LENGTH / 1000);
this.rot = (this.rot + ((360 * ROTATION_SPEED) * _local1));
while (this.rot > 360) {
this.rot = (this.rot - 360);
};
this.icon.rotation = rot;
}
override public function get type():int{
return (PowerUpTypes.FAST_SHOT);
}
}
}//package InGame
Section 111
//PowerUpHealth (InGame.PowerUpHealth)
package InGame {
import flash.display.*;
public class PowerUpHealth extends PowerUpBase {
public static const HEART_CLASS:Class = PowerUpHealth_HEART_CLASS;
public function PowerUpHealth(){
var _local1:DisplayObject = new HEART_CLASS();
_local1.width = ((PowerUpBase.RADIUS * 2) * 0.6);
_local1.height = ((PowerUpBase.RADIUS * 2) * 0.6);
_local1.x = (-(_local1.width) / 2);
_local1.y = -((_local1.height / 2));
this.holder.addChild(_local1);
}
override public function get type():int{
return (PowerUpTypes.HEART);
}
}
}//package InGame
Section 112
//PowerUpHealth_HEART_CLASS (InGame.PowerUpHealth_HEART_CLASS)
package InGame {
import mx.core.*;
public class PowerUpHealth_HEART_CLASS extends SpriteAsset {
}
}//package InGame
Section 113
//PowerUpManager (InGame.PowerUpManager)
package InGame {
import flash.display.*;
public class PowerUpManager implements IHasGraphic {
private var enabled:Array;
private var randomTable:Array;
private var holder:Sprite;
public var powerUps:Array;
private var freq:Array;
private var counter:int;
public static const MIN:int = 12000;
public static const MAX:int = 15000;
public function PowerUpManager(){
this.holder = new Sprite();
this.powerUps = new Array();
this.enabled = new Array();
this.enabled[PowerUpTypes.FAST_RED_SHOT] = false;
this.enabled[PowerUpTypes.FAST_SHOT] = false;
this.enabled[PowerUpTypes.HEART] = false;
this.enabled[PowerUpTypes.RED_SHOT] = false;
this.freq = [24, 4, 1, 6];
this.genRandomTable();
this.genCounter();
}
public function addRandom():void{
var _local1:int;
if (this.randomTable.length > 0){
_local1 = Math.floor((Math.random() * this.randomTable.length));
_local1 = Math.min(this.randomTable.length, _local1);
_local1 = Math.max(0, _local1);
_local1 = this.randomTable[_local1];
switch (_local1){
case PowerUpTypes.FAST_RED_SHOT:
this.add(new PowerUpFastRedShot());
break;
case PowerUpTypes.FAST_SHOT:
this.add(new PowerUpFastShot());
break;
case PowerUpTypes.HEART:
this.add(new PowerUpHealth());
break;
case PowerUpTypes.RED_SHOT:
this.add(new PowerUpRedShot());
break;
default:
trace(("Unknown power up type " + _local1));
break;
};
};
}
public function add(_arg1:PowerUpBase):void{
this.powerUps.push(_arg1);
this.holder.addChild(_arg1.getGraphic());
}
public function update():void{
var powerUp:PowerUpBase;
var alive:Function;
alive = function (_arg1:PowerUpBase, _arg2:int, _arg3:Array):Boolean{
return (!(_arg1.dead));
};
for each (powerUp in this.powerUps) {
powerUp.update();
if (powerUp.dead){
this.holder.removeChild(powerUp.getGraphic());
};
};
this.powerUps = this.powerUps.filter(alive);
this.counter = (this.counter - Global.UPDATE_LENGTH);
if (this.counter <= 0){
this.genCounter();
this.addRandom();
};
}
private function genRandomTable():void{
var _local2:int;
this.randomTable = new Array();
var _local1:int;
while (_local1 < this.enabled.length) {
if (this.enabled[_local1]){
_local2 = 0;
while (_local2 < this.freq[_local1]) {
this.randomTable.push(_local1);
_local2++;
};
};
_local1++;
};
}
public function visualUpdate(_arg1:int):void{
var _local2:PowerUpBase;
for each (_local2 in this.powerUps) {
_local2.visualUpdate(_arg1);
};
}
public function getGraphic():DisplayObject{
return (this.holder);
}
private function genCounter():void{
this.counter = (MIN + Math.floor((Math.random() * (MAX - MIN))));
}
public function enablePowerUp(_arg1:int, _arg2:Boolean=true):void{
this.enabled[_arg1] = _arg2;
this.genRandomTable();
}
}
}//package InGame
Section 114
//PowerUpRedShot (InGame.PowerUpRedShot)
package InGame {
import flash.display.*;
public class PowerUpRedShot extends PowerUpBase {
private var rot:Number;
private var icon:Shape;
public static const ROTATION_SPEED:Number = 0.2;
public function PowerUpRedShot(){
this.icon = new Shape();
this.icon.graphics.lineStyle(3, 0xFF0000);
this.icon.graphics.moveTo(0, (-(RADIUS) * ICON_FILL_AMOUNT));
this.icon.graphics.lineTo(0, (RADIUS * ICON_FILL_AMOUNT));
this.holder.addChild(this.icon);
this.rot = 0;
}
override public function update():void{
super.update();
var _local1:Number = (Global.UPDATE_LENGTH / 1000);
this.rot = (this.rot + ((360 * ROTATION_SPEED) * _local1));
while (this.rot > 360) {
this.rot = (this.rot - 360);
};
this.icon.rotation = rot;
}
override public function get type():int{
return (PowerUpTypes.RED_SHOT);
}
}
}//package InGame
Section 115
//PowerUpTypes (InGame.PowerUpTypes)
package InGame {
public final class PowerUpTypes {
public static const HEART:int = 3;
public static const RED_SHOT:int = 0;
public static const UNKNOWN:int = -1;
public static const FAST_RED_SHOT:int = 2;
public static const FAST_SHOT:int = 1;
}
}//package InGame
Section 116
//Scores (InGame.Scores)
package InGame {
import flash.display.*;
import flash.text.*;
public class Scores implements IHasGraphic {
private var holder:Sprite;
private var stopped:Boolean;
private var score:int;
private var text:TextField;
public function Scores(){
this.holder = new Sprite();
this.stopped = false;
this.score = 0;
this.createText();
this.updateText();
this.text.x = 5;
this.text.y = ((Global.SCREEN_HEIGHT - text.textHeight) - 5);
this.holder.addChild(this.text);
}
public function startScores():void{
this.stopped = false;
}
public function add(_arg1:int):void{
if (!this.stopped){
if (Config.easy){
this.score = (this.score + Math.round((_arg1 / 2)));
} else {
this.score = (this.score + _arg1);
};
this.updateText();
};
}
private function createText():void{
var _local1:TextFormat = new TextFormat();
_local1.font = Fonts.DEFAULT_FONT;
_local1.size = 16;
this.text = new TextField();
this.text.selectable = false;
this.text.embedFonts = true;
this.text.defaultTextFormat = _local1;
this.text.antiAliasType = AntiAliasType.ADVANCED;
this.text.sharpness = 200;
this.text.autoSize = TextFieldAutoSize.LEFT;
}
public function stopScores():void{
this.stopped = true;
}
private function updateText():void{
this.text.text = ("Score: " + this.score);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function getScore():int{
return (this.score);
}
}
}//package InGame
Section 117
//Shot (InGame.Shot)
package InGame {
import flash.display.*;
import flash.geom.*;
public class Shot implements IHasGraphic {
private var shape:Shape;
private var speed:Number;
public var red:Boolean;
private var angle:Number;
private var pos:Point;
public static const THICKNESS:Number = 3;
public static const LENGTH:Number = 5;
public function Shot(_arg1:Point, _arg2:Number, _arg3:Number, _arg4:Boolean=false){
this.shape = new Shape();
this.red = _arg4;
this.speed = _arg3;
this.angle = ((Math.PI * _arg2) / 180);
var _local5:Number = Global.UPDATE_LENGTH;
this.shape.graphics.lineStyle(THICKNESS, (_arg4) ? 0xFF0000 : 0);
this.shape.graphics.lineTo((LENGTH * Math.cos(this.angle)), (LENGTH * Math.sin(this.angle)));
this.pos = _arg1.clone();
}
public function get dead():Boolean{
var _local1:Boolean;
if (this.pos.x < 0){
_local1 = true;
};
if (this.pos.x > Global.SCREEN_WIDTH){
_local1 = true;
};
if (this.pos.y < 0){
_local1 = true;
};
if (this.pos.y > Global.SCREEN_HEIGHT){
_local1 = true;
};
return (_local1);
}
public function update():void{
var _local1:Number = (Global.UPDATE_LENGTH / 1000);
var _local2:Number = ((_local1 * this.speed) * Math.cos(this.angle));
var _local3:Number = ((_local1 * this.speed) * Math.sin(this.angle));
this.pos.x = (this.pos.x + _local2);
this.pos.y = (this.pos.y + _local3);
this.shape.x = this.pos.x;
this.shape.y = this.pos.y;
}
public function getGraphic():DisplayObject{
return (this.shape);
}
public function visualUpdate(_arg1:int):void{
var _local2:Number = (_arg1 / 1000);
var _local3:Number = ((_local2 * this.speed) * Math.cos(this.angle));
var _local4:Number = ((_local2 * this.speed) * Math.sin(this.angle));
this.shape.x = (this.pos.x + _local3);
this.shape.y = (this.pos.y + _local4);
}
public function kill():void{
this.pos.x = -100;
}
}
}//package InGame
Section 118
//ShotManager (InGame.ShotManager)
package InGame {
import flash.display.*;
import flash.geom.*;
public class ShotManager implements IHasGraphic {
public var shots:Array;
private var holder:Sprite;
public function ShotManager(){
this.holder = new Sprite();
this.shots = new Array();
}
public function update():void{
var shot:Shot;
var isAlive:Function;
isAlive = function (_arg1:Shot, _arg2:int, _arg3:Array):Boolean{
return (!(_arg1.dead));
};
for each (shot in this.shots) {
shot.update();
if (shot.dead){
this.holder.removeChild(shot.getGraphic());
};
};
this.shots = this.shots.filter(isAlive);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function visualUpdate(_arg1:int):void{
var _local2:Shot;
for each (_local2 in this.shots) {
_local2.visualUpdate(_arg1);
};
}
public function addNew(_arg1:Point, _arg2:Number, _arg3:Number, _arg4:Boolean=false):Shot{
var _local5:Shot = new Shot(_arg1, _arg2, _arg3, _arg4);
this.shots.push(_local5);
this.holder.addChild(_local5.getGraphic());
return (_local5);
}
}
}//package InGame
Section 119
//MochiScores (mochi.MochiScores)
package mochi {
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 options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
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;
};
};
};
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.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{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 120
//MochiServices (mochi.MochiServices)
package mochi {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.utils.*;
import flash.net.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
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++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
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);
};
};
};
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function getVersion():String{
return ("1.2");
}
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 {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
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 onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var pkg = _arg1;
var cb:String = pkg.callbackID;
var cblst:Object = this.client._callbacks[cb];
if (!cblst){
return;
};
var method:* = cblst.callbackMethod;
var obj:Object = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
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("Unable to invoke callback method.");
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace("Unable to invoke callback method on object.");
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
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 (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) {
};
};
};
};
}
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");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var id = _arg1;
var clip = _arg2;
var clipname:String = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
var f:Function = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var req:URLRequest = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (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 connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
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 _local5:MovieClip = new MovieClip();
if (_arg4){
if (((false) && (_arg3))){
_arg1.addChildAt(_local5, _arg3);
} else {
_arg1.addChild(_local5);
};
};
_arg1[_arg2] = _local5;
_local5["_name"] = _arg2;
return (_local5);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 121
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 122
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 123
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 124
//FlexLoader (mx.core.FlexLoader)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexLoader extends Loader {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexLoader(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 125
//FlexShape (mx.core.FlexShape)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexShape extends Shape {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexShape(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 126
//FlexSprite (mx.core.FlexSprite)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexSprite extends Sprite {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexSprite(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 127
//FlexVersion (mx.core.FlexVersion)
package mx.core {
import mx.resources.*;
public class FlexVersion {
public static const VERSION_2_0_1:uint = 33554433;
public static const CURRENT_VERSION:uint = 50331648;
public static const VERSION_3_0:uint = 50331648;
public static const VERSION_2_0:uint = 33554432;
public static const VERSION_ALREADY_READ:String = "versionAlreadyRead";
public static const VERSION_ALREADY_SET:String = "versionAlreadySet";
mx_internal static const VERSION:String = "3.0.0.0";
private static var compatibilityVersionChanged:Boolean = false;
private static var _compatibilityErrorFunction:Function;
private static var _compatibilityVersion:uint = 50331648;
private static var compatibilityVersionRead:Boolean = false;
mx_internal static function changeCompatibilityVersionString(_arg1:String):void{
var _local2:Array = _arg1.split(".");
var _local3:uint = parseInt(_local2[0]);
var _local4:uint = parseInt(_local2[1]);
var _local5:uint = parseInt(_local2[2]);
_compatibilityVersion = (((_local3 << 24) + (_local4 << 16)) + _local5);
}
public static function set compatibilityVersion(_arg1:uint):void{
var _local2:String;
if (_arg1 == _compatibilityVersion){
return;
};
if (compatibilityVersionChanged){
if (compatibilityErrorFunction == null){
_local2 = ResourceManager.getInstance().getString("core", VERSION_ALREADY_SET);
throw (new Error(_local2));
};
compatibilityErrorFunction(_arg1, VERSION_ALREADY_SET);
};
if (compatibilityVersionRead){
if (compatibilityErrorFunction == null){
_local2 = ResourceManager.getInstance().getString("core", VERSION_ALREADY_READ);
throw (new Error(_local2));
};
compatibilityErrorFunction(_arg1, VERSION_ALREADY_READ);
};
_compatibilityVersion = _arg1;
compatibilityVersionChanged = true;
}
public static function get compatibilityVersion():uint{
compatibilityVersionRead = true;
return (_compatibilityVersion);
}
public static function set compatibilityErrorFunction(_arg1:Function):void{
_compatibilityErrorFunction = _arg1;
}
public static function set compatibilityVersionString(_arg1:String):void{
var _local2:Array = _arg1.split(".");
var _local3:uint = parseInt(_local2[0]);
var _local4:uint = parseInt(_local2[1]);
var _local5:uint = parseInt(_local2[2]);
compatibilityVersion = (((_local3 << 24) + (_local4 << 16)) + _local5);
}
public static function get compatibilityErrorFunction():Function{
return (_compatibilityErrorFunction);
}
public static function get compatibilityVersionString():String{
var _local1:uint = ((compatibilityVersion >> 24) & 0xFF);
var _local2:uint = ((compatibilityVersion >> 16) & 0xFF);
var _local3:uint = (compatibilityVersion & 0xFFFF);
return (((((_local1.toString() + ".") + _local2.toString()) + ".") + _local3.toString()));
}
}
}//package mx.core
Section 128
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 129
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 130
//IButton (mx.core.IButton)
package mx.core {
public interface IButton extends IUIComponent {
function get emphasized():Boolean;
function set emphasized(_arg1:Boolean):void;
function callLater(_arg1:Function, _arg2:Array=null):void;
}
}//package mx.core
Section 131
//IChildList (mx.core.IChildList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public interface IChildList {
function get numChildren():int;
function removeChild(_arg1:DisplayObject):DisplayObject;
function getChildByName(_arg1:String):DisplayObject;
function removeChildAt(_arg1:int):DisplayObject;
function getChildIndex(_arg1:DisplayObject):int;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function getObjectsUnderPoint(_arg1:Point):Array;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function getChildAt(_arg1:int):DisplayObject;
function addChild(_arg1:DisplayObject):DisplayObject;
function contains(_arg1:DisplayObject):Boolean;
}
}//package mx.core
Section 132
//IContainer (mx.core.IContainer)
package mx.core {
import flash.media.*;
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import flash.text.*;
public interface IContainer extends IUIComponent {
function set hitArea(_arg1:Sprite):void;
function swapChildrenAt(_arg1:int, _arg2:int):void;
function getChildByName(_arg1:String):DisplayObject;
function get doubleClickEnabled():Boolean;
function get graphics():Graphics;
function get useHandCursor():Boolean;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function set mouseChildren(_arg1:Boolean):void;
function set creatingContentPane(_arg1:Boolean):void;
function get textSnapshot():TextSnapshot;
function getChildIndex(_arg1:DisplayObject):int;
function set doubleClickEnabled(_arg1:Boolean):void;
function getObjectsUnderPoint(_arg1:Point):Array;
function get creatingContentPane():Boolean;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function get soundTransform():SoundTransform;
function set useHandCursor(_arg1:Boolean):void;
function get numChildren():int;
function contains(_arg1:DisplayObject):Boolean;
function get verticalScrollPosition():Number;
function set defaultButton(_arg1:IFlexDisplayObject):void;
function swapChildren(_arg1:DisplayObject, _arg2:DisplayObject):void;
function set horizontalScrollPosition(_arg1:Number):void;
function get focusManager():IFocusManager;
function startDrag(_arg1:Boolean=false, _arg2:Rectangle=null):void;
function set mouseEnabled(_arg1:Boolean):void;
function getChildAt(_arg1:int):DisplayObject;
function set soundTransform(_arg1:SoundTransform):void;
function get tabChildren():Boolean;
function get tabIndex():int;
function set focusRect(_arg1:Object):void;
function get hitArea():Sprite;
function get mouseChildren():Boolean;
function removeChildAt(_arg1:int):DisplayObject;
function get defaultButton():IFlexDisplayObject;
function stopDrag():void;
function set tabEnabled(_arg1:Boolean):void;
function get horizontalScrollPosition():Number;
function get focusRect():Object;
function get viewMetrics():EdgeMetrics;
function set verticalScrollPosition(_arg1:Number):void;
function get dropTarget():DisplayObject;
function get mouseEnabled():Boolean;
function set tabChildren(_arg1:Boolean):void;
function set buttonMode(_arg1:Boolean):void;
function get tabEnabled():Boolean;
function get buttonMode():Boolean;
function removeChild(_arg1:DisplayObject):DisplayObject;
function set tabIndex(_arg1:int):void;
function addChild(_arg1:DisplayObject):DisplayObject;
function areInaccessibleObjectsUnderPoint(_arg1:Point):Boolean;
}
}//package mx.core
Section 133
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 134
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 135
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
public interface IFlexModuleFactory {
function create(... _args):Object;
function info():Object;
}
}//package mx.core
Section 136
//IInvalidating (mx.core.IInvalidating)
package mx.core {
public interface IInvalidating {
function validateNow():void;
function invalidateSize():void;
function invalidateDisplayList():void;
function invalidateProperties():void;
}
}//package mx.core
Section 137
//IProgrammaticSkin (mx.core.IProgrammaticSkin)
package mx.core {
public interface IProgrammaticSkin {
function validateNow():void;
function validateDisplayList():void;
}
}//package mx.core
Section 138
//IRawChildrenContainer (mx.core.IRawChildrenContainer)
package mx.core {
public interface IRawChildrenContainer {
function get rawChildren():IChildList;
}
}//package mx.core
Section 139
//IRectangularBorder (mx.core.IRectangularBorder)
package mx.core {
import flash.geom.*;
public interface IRectangularBorder extends IBorder {
function get backgroundImageBounds():Rectangle;
function get hasBackgroundImage():Boolean;
function set backgroundImageBounds(_arg1:Rectangle):void;
function layoutBackgroundImage():void;
}
}//package mx.core
Section 140
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 141
//IUIComponent (mx.core.IUIComponent)
package mx.core {
import flash.display.*;
import mx.managers.*;
public interface IUIComponent extends IFlexDisplayObject {
function set focusPane(_arg1:Sprite):void;
function get enabled():Boolean;
function set enabled(_arg1:Boolean):void;
function set isPopUp(_arg1:Boolean):void;
function get explicitMinHeight():Number;
function get percentWidth():Number;
function get isPopUp():Boolean;
function get owner():DisplayObjectContainer;
function get percentHeight():Number;
function get baselinePosition():Number;
function owns(_arg1:DisplayObject):Boolean;
function initialize():void;
function get maxWidth():Number;
function get minWidth():Number;
function getExplicitOrMeasuredWidth():Number;
function get explicitMaxWidth():Number;
function get explicitMaxHeight():Number;
function set percentHeight(_arg1:Number):void;
function get minHeight():Number;
function set percentWidth(_arg1:Number):void;
function get document():Object;
function get focusPane():Sprite;
function getExplicitOrMeasuredHeight():Number;
function set tweeningProperties(_arg1:Array):void;
function set explicitWidth(_arg1:Number):void;
function set measuredMinHeight(_arg1:Number):void;
function get explicitMinWidth():Number;
function get tweeningProperties():Array;
function get maxHeight():Number;
function set owner(_arg1:DisplayObjectContainer):void;
function set includeInLayout(_arg1:Boolean):void;
function setVisible(_arg1:Boolean, _arg2:Boolean=false):void;
function parentChanged(_arg1:DisplayObjectContainer):void;
function get explicitWidth():Number;
function get measuredMinHeight():Number;
function set measuredMinWidth(_arg1:Number):void;
function set explicitHeight(_arg1:Number):void;
function get includeInLayout():Boolean;
function get measuredMinWidth():Number;
function get explicitHeight():Number;
function set systemManager(_arg1:ISystemManager):void;
function set document(_arg1:Object):void;
function get systemManager():ISystemManager;
}
}//package mx.core
Section 142
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 143
//Singleton (mx.core.Singleton)
package mx.core {
public class Singleton {
mx_internal static const VERSION:String = "3.0.0.0";
private static var classMap:Object = {};
public static function registerClass(_arg1:String, _arg2:Class):void{
var _local3:Class = classMap[_arg1];
if (!_local3){
classMap[_arg1] = _arg2;
};
}
public static function getClass(_arg1:String):Class{
return (classMap[_arg1]);
}
public static function getInstance(_arg1:String):Object{
var _local2:Class = classMap[_arg1];
if (!_local2){
throw (new Error((("No class registered for interface '" + _arg1) + "'.")));
};
return (_local2["getInstance"]());
}
}
}//package mx.core
Section 144
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 145
//SpriteAsset (mx.core.SpriteAsset)
package mx.core {
public class SpriteAsset extends FlexSprite implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function SpriteAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 146
//UIComponentGlobals (mx.core.UIComponentGlobals)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
public class UIComponentGlobals {
mx_internal static var callLaterSuspendCount:int = 0;
mx_internal static var layoutManager:ILayoutManager;
mx_internal static var nextFocusObject:InteractiveObject;
mx_internal static var designTime:Boolean = false;
mx_internal static var tempMatrix:Matrix = new Matrix();
mx_internal static var callLaterDispatcherCount:int = 0;
private static var _catchCallLaterExceptions:Boolean = false;
public static function set catchCallLaterExceptions(_arg1:Boolean):void{
_catchCallLaterExceptions = _arg1;
}
public static function get designMode():Boolean{
return (designTime);
}
public static function set designMode(_arg1:Boolean):void{
designTime = _arg1;
}
public static function get catchCallLaterExceptions():Boolean{
return (_catchCallLaterExceptions);
}
}
}//package mx.core
Section 147
//ModuleEvent (mx.events.ModuleEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
import mx.modules.*;
public class ModuleEvent extends ProgressEvent {
public var errorText:String;
private var _module:IModuleInfo;
public static const READY:String = "ready";
public static const ERROR:String = "error";
public static const PROGRESS:String = "progress";
mx_internal static const VERSION:String = "3.0.0.0";
public static const SETUP:String = "setup";
public static const UNLOAD:String = "unload";
public function ModuleEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null, _arg7:IModuleInfo=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
this._module = _arg7;
}
public function get module():IModuleInfo{
if (_module){
return (_module);
};
return ((target as IModuleInfo));
}
override public function clone():Event{
return (new ModuleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText, module));
}
}
}//package mx.events
Section 148
//ResourceEvent (mx.events.ResourceEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class ResourceEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.0.0.0";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function ResourceEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
}
override public function clone():Event{
return (new ResourceEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 149
//StyleEvent (mx.events.StyleEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class StyleEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.0.0.0";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function StyleEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
}
override public function clone():Event{
return (new StyleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 150
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import mx.utils.*;
import flash.filters.*;
public class RectangularDropShadow {
private var leftShadow:BitmapData;
private var _tlRadius:Number;// = 0
private var _trRadius:Number;// = 0
private var _angle:Number;// = 45
private var topShadow:BitmapData;
private var _distance:Number;// = 4
private var rightShadow:BitmapData;
private var _alpha:Number;// = 0.4
private var shadow:BitmapData;
private var _brRadius:Number;// = 0
private var _blRadius:Number;// = 0
private var _color:int;// = 0
private var bottomShadow:BitmapData;
private var changed:Boolean;// = true
mx_internal static const VERSION:String = "3.0.0.0";
public function get blRadius():Number{
return (_blRadius);
}
public function set brRadius(_arg1:Number):void{
if (_brRadius != _arg1){
_brRadius = _arg1;
changed = true;
};
}
public function set color(_arg1:int):void{
if (_color != _arg1){
_color = _arg1;
changed = true;
};
}
public function drawShadow(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
if (changed){
createShadowBitmaps();
changed = false;
};
_arg4 = Math.ceil(_arg4);
_arg5 = Math.ceil(_arg5);
var _local6:int = (leftShadow) ? leftShadow.width : 0;
var _local7:int = (rightShadow) ? rightShadow.width : 0;
var _local8:int = (topShadow) ? topShadow.height : 0;
var _local9:int = (bottomShadow) ? bottomShadow.height : 0;
var _local10:int = (_local6 + _local7);
var _local11:int = (_local8 + _local9);
var _local12:Number = ((_arg5 + _local11) / 2);
var _local13:Number = ((_arg4 + _local10) / 2);
var _local14:Matrix = new Matrix();
if (((leftShadow) || (topShadow))){
_local15 = Math.min((tlRadius + _local10), _local13);
_local16 = Math.min((tlRadius + _local11), _local12);
_local14.tx = (_arg2 - _local6);
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((_arg2 - _local6), (_arg3 - _local8), _local15, _local16);
_arg1.endFill();
};
if (((rightShadow) || (topShadow))){
_local17 = Math.min((trRadius + _local10), _local13);
_local18 = Math.min((trRadius + _local11), _local12);
_local14.tx = (((_arg2 + _arg4) + _local7) - shadow.width);
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((((_arg2 + _arg4) + _local7) - _local17), (_arg3 - _local8), _local17, _local18);
_arg1.endFill();
};
if (((leftShadow) || (bottomShadow))){
_local19 = Math.min((blRadius + _local10), _local13);
_local20 = Math.min((blRadius + _local11), _local12);
_local14.tx = (_arg2 - _local6);
_local14.ty = (((_arg3 + _arg5) + _local9) - shadow.height);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((_arg2 - _local6), (((_arg3 + _arg5) + _local9) - _local20), _local19, _local20);
_arg1.endFill();
};
if (((rightShadow) || (bottomShadow))){
_local21 = Math.min((brRadius + _local10), _local13);
_local22 = Math.min((brRadius + _local11), _local12);
_local14.tx = (((_arg2 + _arg4) + _local7) - shadow.width);
_local14.ty = (((_arg3 + _arg5) + _local9) - shadow.height);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((((_arg2 + _arg4) + _local7) - _local21), (((_arg3 + _arg5) + _local9) - _local22), _local21, _local22);
_arg1.endFill();
};
if (leftShadow){
_local14.tx = (_arg2 - _local6);
_local14.ty = 0;
_arg1.beginBitmapFill(leftShadow, _local14);
_arg1.drawRect((_arg2 - _local6), ((_arg3 - _local8) + _local16), _local6, ((((_arg5 + _local8) + _local9) - _local16) - _local20));
_arg1.endFill();
};
if (rightShadow){
_local14.tx = (_arg2 + _arg4);
_local14.ty = 0;
_arg1.beginBitmapFill(rightShadow, _local14);
_arg1.drawRect((_arg2 + _arg4), ((_arg3 - _local8) + _local18), _local7, ((((_arg5 + _local8) + _local9) - _local18) - _local22));
_arg1.endFill();
};
if (topShadow){
_local14.tx = 0;
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(topShadow, _local14);
_arg1.drawRect(((_arg2 - _local6) + _local15), (_arg3 - _local8), ((((_arg4 + _local6) + _local7) - _local15) - _local17), _local8);
_arg1.endFill();
};
if (bottomShadow){
_local14.tx = 0;
_local14.ty = (_arg3 + _arg5);
_arg1.beginBitmapFill(bottomShadow, _local14);
_arg1.drawRect(((_arg2 - _local6) + _local19), (_arg3 + _arg5), ((((_arg4 + _local6) + _local7) - _local19) - _local21), _local9);
_arg1.endFill();
};
}
public function get brRadius():Number{
return (_brRadius);
}
public function get angle():Number{
return (_angle);
}
private function createShadowBitmaps():void{
var _local1:Number = ((Math.max(tlRadius, blRadius) + (2 * distance)) + Math.max(trRadius, brRadius));
var _local2:Number = ((Math.max(tlRadius, trRadius) + (2 * distance)) + Math.max(blRadius, brRadius));
if ((((_local1 < 0)) || ((_local2 < 0)))){
return;
};
var _local3:Shape = new FlexShape();
var _local4:Graphics = _local3.graphics;
_local4.beginFill(0xFFFFFF);
GraphicsUtil.drawRoundRectComplex(_local4, 0, 0, _local1, _local2, tlRadius, trRadius, blRadius, brRadius);
_local4.endFill();
var _local5:BitmapData = new BitmapData(_local1, _local2, true, 0);
_local5.draw(_local3, new Matrix());
var _local6:DropShadowFilter = new DropShadowFilter(distance, angle, color, alpha);
_local6.knockout = true;
var _local7:Rectangle = new Rectangle(0, 0, _local1, _local2);
var _local8:Rectangle = _local5.generateFilterRect(_local7, _local6);
var _local9:Number = (_local7.left - _local8.left);
var _local10:Number = (_local8.right - _local7.right);
var _local11:Number = (_local7.top - _local8.top);
var _local12:Number = (_local8.bottom - _local7.bottom);
shadow = new BitmapData(_local8.width, _local8.height);
shadow.applyFilter(_local5, _local7, new Point(_local9, _local11), _local6);
var _local13:Point = new Point(0, 0);
var _local14:Rectangle = new Rectangle();
if (_local9 > 0){
_local14.x = 0;
_local14.y = ((tlRadius + _local11) + _local12);
_local14.width = _local9;
_local14.height = 1;
leftShadow = new BitmapData(_local9, 1);
leftShadow.copyPixels(shadow, _local14, _local13);
} else {
leftShadow = null;
};
if (_local10 > 0){
_local14.x = (shadow.width - _local10);
_local14.y = ((trRadius + _local11) + _local12);
_local14.width = _local10;
_local14.height = 1;
rightShadow = new BitmapData(_local10, 1);
rightShadow.copyPixels(shadow, _local14, _local13);
} else {
rightShadow = null;
};
if (_local11 > 0){
_local14.x = ((tlRadius + _local9) + _local10);
_local14.y = 0;
_local14.width = 1;
_local14.height = _local11;
topShadow = new BitmapData(1, _local11);
topShadow.copyPixels(shadow, _local14, _local13);
} else {
topShadow = null;
};
if (_local12 > 0){
_local14.x = ((blRadius + _local9) + _local10);
_local14.y = (shadow.height - _local12);
_local14.width = 1;
_local14.height = _local12;
bottomShadow = new BitmapData(1, _local12);
bottomShadow.copyPixels(shadow, _local14, _local13);
} else {
bottomShadow = null;
};
}
public function get alpha():Number{
return (_alpha);
}
public function get color():int{
return (_color);
}
public function set angle(_arg1:Number):void{
if (_angle != _arg1){
_angle = _arg1;
changed = true;
};
}
public function set trRadius(_arg1:Number):void{
if (_trRadius != _arg1){
_trRadius = _arg1;
changed = true;
};
}
public function set tlRadius(_arg1:Number):void{
if (_tlRadius != _arg1){
_tlRadius = _arg1;
changed = true;
};
}
public function get trRadius():Number{
return (_trRadius);
}
public function set distance(_arg1:Number):void{
if (_distance != _arg1){
_distance = _arg1;
changed = true;
};
}
public function get distance():Number{
return (_distance);
}
public function get tlRadius():Number{
return (_tlRadius);
}
public function set alpha(_arg1:Number):void{
if (_alpha != _arg1){
_alpha = _arg1;
changed = true;
};
}
public function set blRadius(_arg1:Number):void{
if (_blRadius != _arg1){
_blRadius = _arg1;
changed = true;
};
}
}
}//package mx.graphics
Section 151
//IFocusManager (mx.managers.IFocusManager)
package mx.managers {
import mx.core.*;
import flash.display.*;
public interface IFocusManager {
function get focusPane():Sprite;
function getFocus():IFocusManagerComponent;
function deactivate():void;
function set defaultButton(_arg1:IButton):void;
function set focusPane(_arg1:Sprite):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(_arg1:InteractiveObject):IFocusManagerComponent;
function get nextTabIndex():int;
function get defaultButton():IButton;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:IFocusManagerComponent):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function getNextFocusManagerComponent(_arg1:Boolean=false):IFocusManagerComponent;
}
}//package mx.managers
Section 152
//IFocusManagerComponent (mx.managers.IFocusManagerComponent)
package mx.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 mx.managers
Section 153
//IFocusManagerContainer (mx.managers.IFocusManagerContainer)
package mx.managers {
import flash.events.*;
import flash.display.*;
public interface IFocusManagerContainer extends IEventDispatcher {
function set focusManager(_arg1:IFocusManager):void;
function get focusManager():IFocusManager;
function get systemManager():ISystemManager;
function contains(_arg1:DisplayObject):Boolean;
}
}//package mx.managers
Section 154
//ILayoutManager (mx.managers.ILayoutManager)
package mx.managers {
import flash.events.*;
public interface ILayoutManager extends IEventDispatcher {
function validateNow():void;
function validateClient(_arg1:ILayoutManagerClient, _arg2:Boolean=false):void;
function isInvalid():Boolean;
function invalidateDisplayList(_arg1:ILayoutManagerClient):void;
function set usePhasedInstantiation(_arg1:Boolean):void;
function invalidateSize(_arg1:ILayoutManagerClient):void;
function get usePhasedInstantiation():Boolean;
function invalidateProperties(_arg1:ILayoutManagerClient):void;
}
}//package mx.managers
Section 155
//ILayoutManagerClient (mx.managers.ILayoutManagerClient)
package mx.managers {
import flash.events.*;
public interface ILayoutManagerClient extends IEventDispatcher {
function get updateCompletePendingFlag():Boolean;
function set updateCompletePendingFlag(_arg1:Boolean):void;
function set initialized(_arg1:Boolean):void;
function validateProperties():void;
function validateDisplayList():void;
function get nestLevel():int;
function get initialized():Boolean;
function get processedDescriptors():Boolean;
function validateSize(_arg1:Boolean=false):void;
function set nestLevel(_arg1:int):void;
function set processedDescriptors(_arg1:Boolean):void;
}
}//package mx.managers
Section 156
//ISystemManager (mx.managers.ISystemManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory {
function get focusPane():Sprite;
function get loaderInfo():LoaderInfo;
function get toolTipChildren():IChildList;
function set focusPane(_arg1:Sprite):void;
function isTopLevel():Boolean;
function get popUpChildren():IChildList;
function get screen():Rectangle;
function isFontFaceEmbedded(_arg1:TextFormat):Boolean;
function get rawChildren():IChildList;
function get topLevelSystemManager():ISystemManager;
function getDefinitionByName(_arg1:String):Object;
function activate(_arg1:IFocusManagerContainer):void;
function deactivate(_arg1:IFocusManagerContainer):void;
function get cursorChildren():IChildList;
function set document(_arg1:Object):void;
function get embeddedFontList():Object;
function set numModalWindows(_arg1:int):void;
function removeFocusManager(_arg1:IFocusManagerContainer):void;
function get document():Object;
function get numModalWindows():int;
function addFocusManager(_arg1:IFocusManagerContainer):void;
function get stage():Stage;
}
}//package mx.managers
Section 157
//SystemManagerGlobals (mx.managers.SystemManagerGlobals)
package mx.managers {
public class SystemManagerGlobals {
public static var topLevelSystemManagers:Array = [];
public static var bootstrapLoaderInfoURL:String;
}
}//package mx.managers
Section 158
//IModuleInfo (mx.modules.IModuleInfo)
package mx.modules {
import flash.events.*;
import mx.core.*;
import flash.system.*;
public interface IModuleInfo extends IEventDispatcher {
function get ready():Boolean;
function get loaded():Boolean;
function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null):void;
function release():void;
function get error():Boolean;
function get data():Object;
function publish(_arg1:IFlexModuleFactory):void;
function get factory():IFlexModuleFactory;
function set data(_arg1:Object):void;
function get url():String;
function get setup():Boolean;
function unload():void;
}
}//package mx.modules
Section 159
//ModuleManager (mx.modules.ModuleManager)
package mx.modules {
import mx.core.*;
public class ModuleManager {
mx_internal static const VERSION:String = "3.0.0.0";
public static function getModule(_arg1:String):IModuleInfo{
return (getSingleton().getModule(_arg1));
}
private static function getSingleton():Object{
if (!ModuleManagerGlobals.managerSingleton){
ModuleManagerGlobals.managerSingleton = new ModuleManagerImpl();
};
return (ModuleManagerGlobals.managerSingleton);
}
public static function getAssociatedFactory(_arg1:Object):IFlexModuleFactory{
return (getSingleton().getAssociatedFactory(_arg1));
}
}
}//package mx.modules
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.system.*;
import mx.events.*;
import flash.utils.*;
import flash.net.*;
class ModuleInfoProxy extends EventDispatcher implements IModuleInfo {
private var _data:Object;
private var info:ModuleInfo;
private var referenced:Boolean;// = false
private function ModuleInfoProxy(_arg1:ModuleInfo){
this.info = _arg1;
_arg1.addEventListener(ModuleEvent.SETUP, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.ERROR, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.UNLOAD, moduleEventHandler, false, 0, true);
}
public function get loaded():Boolean{
return (info.loaded);
}
public function release():void{
if (referenced){
info.removeReference();
referenced = false;
};
}
public function get error():Boolean{
return (info.error);
}
public function get factory():IFlexModuleFactory{
return (info.factory);
}
public function publish(_arg1:IFlexModuleFactory):void{
info.publish(_arg1);
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get ready():Boolean{
return (info.ready);
}
public function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null):void{
var _local3:ModuleEvent;
info.resurrect();
if (!referenced){
info.addReference();
referenced = true;
};
if (info.error){
dispatchEvent(new ModuleEvent(ModuleEvent.ERROR));
} else {
if (info.loaded){
if (info.setup){
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
if (info.ready){
_local3 = new ModuleEvent(ModuleEvent.PROGRESS);
_local3.bytesLoaded = info.size;
_local3.bytesTotal = info.size;
dispatchEvent(_local3);
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
};
};
} else {
info.load(_arg1, _arg2);
};
};
}
private function moduleEventHandler(_arg1:ModuleEvent):void{
dispatchEvent(_arg1);
}
public function get url():String{
return (info.url);
}
public function get data():Object{
return (_data);
}
public function get setup():Boolean{
return (info.setup);
}
public function unload():void{
info.unload();
info.removeEventListener(ModuleEvent.SETUP, moduleEventHandler);
info.removeEventListener(ModuleEvent.PROGRESS, moduleEventHandler);
info.removeEventListener(ModuleEvent.READY, moduleEventHandler);
info.removeEventListener(ModuleEvent.ERROR, moduleEventHandler);
info.removeEventListener(ModuleEvent.UNLOAD, moduleEventHandler);
}
}
class ModuleManagerImpl extends EventDispatcher {
private var moduleList:Object;
private function ModuleManagerImpl(){
moduleList = {};
super();
}
public function getModule(_arg1:String):IModuleInfo{
var _local2:ModuleInfo = (moduleList[_arg1] as ModuleInfo);
if (!_local2){
_local2 = new ModuleInfo(_arg1);
moduleList[_arg1] = _local2;
};
return (new ModuleInfoProxy(_local2));
}
public function getAssociatedFactory(_arg1:Object):IFlexModuleFactory{
var m:Object;
var info:ModuleInfo;
var domain:ApplicationDomain;
var cls:Class;
var object = _arg1;
var className:String = getQualifiedClassName(object);
for each (m in moduleList) {
info = (m as ModuleInfo);
if (!info.ready){
} else {
domain = info.applicationDomain;
try {
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return (info.factory);
};
} catch(error:Error) {
};
};
};
return (null);
}
}
class ModuleInfo extends EventDispatcher {
private var _error:Boolean;// = false
private var loader:Loader;
private var factoryInfo:FactoryInfo;
private var limbo:Dictionary;
private var _loaded:Boolean;// = false
private var _ready:Boolean;// = false
private var numReferences:int;// = 0
private var _url:String;
private var _setup:Boolean;// = false
private function ModuleInfo(_arg1:String){
_url = _arg1;
}
private function clearLoader():void{
if (loader){
if (loader.contentLoaderInfo){
loader.contentLoaderInfo.removeEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
};
try {
if (loader.content){
loader.content.removeEventListener("ready", readyHandler);
};
} catch(error:Error) {
};
if (_loaded){
try {
loader.close();
} catch(error:Error) {
};
};
try {
loader.unload();
} catch(error:Error) {
};
loader = null;
};
}
public function get size():int{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.bytesTotal : 0);
}
public function get loaded():Boolean{
return ((limbo) ? false : _loaded);
}
public function release():void{
if (((_ready) && (!(limbo)))){
limbo = new Dictionary(true);
limbo[factoryInfo] = 1;
factoryInfo = null;
} else {
unload();
};
}
public function get error():Boolean{
return ((limbo) ? false : _error);
}
public function get factory():IFlexModuleFactory{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.factory : null);
}
public function completeHandler(_arg1:Event):void{
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
_local2.bytesTotal = loader.contentLoaderInfo.bytesTotal;
dispatchEvent(_local2);
}
public function publish(_arg1:IFlexModuleFactory):void{
if (factoryInfo){
return;
};
if (_url.indexOf("published://") != 0){
return;
};
factoryInfo = new FactoryInfo();
factoryInfo.factory = _arg1;
_loaded = true;
_setup = true;
_ready = true;
_error = false;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
dispatchEvent(new ModuleEvent(ModuleEvent.PROGRESS));
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function initHandler(_arg1:Event):void{
var moduleEvent:ModuleEvent;
var event = _arg1;
factoryInfo = new FactoryInfo();
try {
factoryInfo.factory = (loader.content as IFlexModuleFactory);
} catch(error:Error) {
};
if (!factoryInfo.factory){
moduleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = "SWF is not a loadable module";
dispatchEvent(moduleEvent);
return;
};
loader.content.addEventListener("ready", readyHandler);
try {
factoryInfo.applicationDomain = loader.contentLoaderInfo.applicationDomain;
} catch(error:Error) {
};
_setup = true;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
}
public function resurrect():void{
var _local1:Object;
if (((!(factoryInfo)) && (limbo))){
for (_local1 in limbo) {
factoryInfo = (_local1 as FactoryInfo);
break;
};
limbo = null;
};
if (!factoryInfo){
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
loader = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
};
}
public function errorHandler(_arg1:ErrorEvent):void{
_error = true;
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = 0;
_local2.bytesTotal = 0;
_local2.errorText = _arg1.text;
dispatchEvent(_local2);
}
public function get ready():Boolean{
return ((limbo) ? false : _ready);
}
public function removeReference():void{
numReferences--;
if (numReferences == 0){
release();
};
}
public function addReference():void{
numReferences++;
}
public function progressHandler(_arg1:ProgressEvent):void{
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
public function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null):void{
if (_loaded){
return;
};
_loaded = true;
limbo = null;
if (_url.indexOf("published://") == 0){
return;
};
var _local3:URLRequest = new URLRequest(_url);
var _local4:LoaderContext = new LoaderContext();
_local4.applicationDomain = (_arg1) ? _arg1 : new ApplicationDomain(ApplicationDomain.currentDomain);
_local4.securityDomain = _arg2;
if ((((_arg2 == null)) && ((Security.sandboxType == Security.REMOTE)))){
_local4.securityDomain = SecurityDomain.currentDomain;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.load(_local3, _local4);
}
public function get url():String{
return (_url);
}
public function get applicationDomain():ApplicationDomain{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.applicationDomain : null);
}
public function readyHandler(_arg1:Event):void{
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function get setup():Boolean{
return ((limbo) ? false : _setup);
}
public function unload():void{
clearLoader();
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
limbo = null;
factoryInfo = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
}
}
class FactoryInfo {
public var bytesTotal:int;// = 0
public var factory:IFlexModuleFactory;
public var applicationDomain:ApplicationDomain;
private function FactoryInfo(){
}
}
Section 160
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals)
package mx.modules {
public class ModuleManagerGlobals {
public static var managerSingleton:Object = null;
}
}//package mx.modules
Section 161
//IResourceBundle (mx.resources.IResourceBundle)
package mx.resources {
public interface IResourceBundle {
function get content():Object;
function get locale():String;
function get bundleName():String;
}
}//package mx.resources
Section 162
//IResourceManager (mx.resources.IResourceManager)
package mx.resources {
import flash.events.*;
import flash.system.*;
public interface IResourceManager extends IEventDispatcher {
function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean;
function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class;
function getLocales():Array;
function removeResourceBundlesForLocale(_arg1:String):void;
function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle;
function get localeChain():Array;
function getInt(_arg1:String, _arg2:String, _arg3:String=null):int;
function update():void;
function set localeChain(_arg1:Array):void;
function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint;
function addResourceBundle(_arg1:IResourceBundle):void;
function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array;
function getBundleNamesForLocale(_arg1:String):Array;
function removeResourceBundle(_arg1:String, _arg2:String):void;
function getObject(_arg1:String, _arg2:String, _arg3:String=null);
function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String;
function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void;
function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void;
function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle;
function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number;
}
}//package mx.resources
Section 163
//IResourceModule (mx.resources.IResourceModule)
package mx.resources {
public interface IResourceModule {
function get resourceBundles():Array;
}
}//package mx.resources
Section 164
//ResourceBundle (mx.resources.ResourceBundle)
package mx.resources {
import mx.core.*;
import flash.system.*;
import mx.utils.*;
public class ResourceBundle implements IResourceBundle {
mx_internal var _locale:String;
private var _content:Object;
mx_internal var _bundleName:String;
mx_internal static const VERSION:String = "3.0.0.0";
mx_internal static var locale:String;
public function ResourceBundle(_arg1:String=null, _arg2:String=null){
_content = {};
super();
mx_internal::_locale = _arg1;
mx_internal::_bundleName = _arg2;
_content = getContent();
}
protected function getContent():Object{
return ({});
}
public function getString(_arg1:String):String{
return (String(_getObject(_arg1)));
}
public function get content():Object{
return (_content);
}
public function getBoolean(_arg1:String, _arg2:Boolean=true):Boolean{
var _local3:String = _getObject(_arg1).toLowerCase();
if (_local3 == "false"){
return (false);
};
if (_local3 == "true"){
return (true);
};
return (_arg2);
}
public function getStringArray(_arg1:String):Array{
var _local2:Array = _getObject(_arg1).split(",");
var _local3:int = _local2.length;
var _local4:int;
while (_local4 < _local3) {
_local2[_local4] = StringUtil.trim(_local2[_local4]);
_local4++;
};
return (_local2);
}
public function getObject(_arg1:String):Object{
return (_getObject(_arg1));
}
private function _getObject(_arg1:String):Object{
var _local2:Object = content[_arg1];
if (!_local2){
throw (new Error(((("Key " + _arg1) + " was not found in resource bundle ") + bundleName)));
};
return (_local2);
}
public function get locale():String{
return (mx_internal::_locale);
}
public function get bundleName():String{
return (mx_internal::_bundleName);
}
public function getNumber(_arg1:String):Number{
return (Number(_getObject(_arg1)));
}
public static function getResourceBundle(_arg1:String, _arg2:ApplicationDomain=null):ResourceBundle{
var _local3:String;
var _local4:Class;
var _local5:Object;
var _local6:ResourceBundle;
if (!_arg2){
_arg2 = ApplicationDomain.currentDomain;
};
_local3 = (((mx_internal::locale + "$") + _arg1) + "_properties");
_local4 = getClassByName(_local3, _arg2);
if (!_local4){
_local3 = (_arg1 + "_properties");
_local4 = getClassByName(_local3, _arg2);
};
if (!_local4){
_local3 = _arg1;
_local4 = getClassByName(_local3, _arg2);
};
if (_local4){
_local5 = new (_local4);
if ((_local5 is ResourceBundle)){
_local6 = ResourceBundle(_local5);
return (_local6);
};
};
throw (new Error(("Could not find resource bundle " + _arg1)));
}
private static function getClassByName(_arg1:String, _arg2:ApplicationDomain):Class{
var _local3:Class;
if (_arg2.hasDefinition(_arg1)){
_local3 = (_arg2.getDefinition(_arg1) as Class);
};
return (_local3);
}
}
}//package mx.resources
Section 165
//ResourceManager (mx.resources.ResourceManager)
package mx.resources {
import flash.events.*;
import mx.core.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import flash.utils.*;
import mx.utils.*;
public class ResourceManager extends EventDispatcher implements IResourceManager {
private var resourceModules:Object;
private var initializedForNonFrameworkApp:Boolean;// = false
private var localeMap:Object;
private var _localeChain:Array;
mx_internal static const VERSION:String = "3.0.0.0";
private static var instance:IResourceManager;
public function ResourceManager(){
localeMap = {};
resourceModules = {};
super();
}
public function get localeChain():Array{
return (_localeChain);
}
public function set localeChain(_arg1:Array):void{
_localeChain = _arg1;
update();
}
public function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (null);
};
var _local5:* = _local4.content[_arg2];
var _local6:Array = String(_local5).split(",");
var _local7:int = _local6.length;
var _local8:int;
while (_local8 < _local7) {
_local6[_local8] = StringUtil.trim(_local6[_local8]);
_local8++;
};
return (_local6);
}
mx_internal function installCompiledResourceBundle(_arg1:ApplicationDomain, _arg2:String, _arg3:String):void{
var _local4:String;
var _local5:String = _arg3;
var _local6:int = _arg3.indexOf(":");
if (_local6 != -1){
_local4 = _arg3.substring(0, _local6);
_local5 = _arg3.substring((_local6 + 1));
};
if (getResourceBundle(_arg2, _arg3)){
return;
};
var _local7 = (((_arg2 + "$") + _local5) + "_properties");
if (_local4 != null){
_local7 = ((_local4 + ".") + _local7);
};
var _local8:Class;
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
if (!_local8){
_local7 = _arg3;
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
};
if (!_local8){
_local7 = (_arg3 + "_properties");
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
};
if (!_local8){
throw (new Error((((("Could not find compiled resource bundle '" + _arg3) + "' for locale '") + _arg2) + "'.")));
};
var _local9:ResourceBundle = ResourceBundle(new (_local8));
_local9.mx_internal::_locale = _arg2;
_local9.mx_internal::_bundleName = _arg3;
addResourceBundle(_local9);
}
public function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String{
var _local5:IResourceBundle = findBundle(_arg1, _arg2, _arg4);
if (!_local5){
return (null);
};
var _local6:String = String(_local5.content[_arg2]);
if (_arg3){
_local6 = StringUtil.substitute(_local6, _arg3);
};
return (_local6);
}
public function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher{
var moduleInfo:IModuleInfo;
var resourceEventDispatcher:ResourceEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = _arg1;
var updateFlag = _arg2;
var applicationDomain = _arg3;
var securityDomain = _arg4;
moduleInfo = ModuleManager.getModule(url);
resourceEventDispatcher = new ResourceEventDispatcher(moduleInfo);
var readyHandler:Function = function (_arg1:ModuleEvent):void{
var _local2:* = _arg1.module.factory.create();
resourceModules[_arg1.module.url].resourceModule = _local2;
if (updateFlag){
update();
};
};
moduleInfo.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
var errorHandler:Function = function (_arg1:ModuleEvent):void{
var _local3:ResourceEvent;
var _local2:String = ("Unable to load resource module from " + url);
if (resourceEventDispatcher.willTrigger(ResourceEvent.ERROR)){
_local3 = new ResourceEvent(ResourceEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local3.bytesLoaded = 0;
_local3.bytesTotal = 0;
_local3.errorText = _local2;
resourceEventDispatcher.dispatchEvent(_local3);
} else {
throw (new Error(_local2));
};
};
moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
resourceModules[url] = new ResourceModuleInfo(moduleInfo, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (_arg1:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
moduleInfo.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (resourceEventDispatcher);
}
public function getLocales():Array{
var _local2:String;
var _local1:Array = [];
for (_local2 in localeMap) {
_local1.push(_local2);
};
return (_local1);
}
public function removeResourceBundlesForLocale(_arg1:String):void{
delete localeMap[_arg1];
}
public function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle{
var _local3:Object = localeMap[_arg1];
if (!_local3){
return (null);
};
return (_local3[_arg2]);
}
private function dumpResourceModule(_arg1):void{
var _local2:ResourceBundle;
var _local3:String;
for each (_local2 in _arg1.resourceBundles) {
trace(_local2.locale, _local2.bundleName);
for (_local3 in _local2.content) {
};
};
}
public function getObject(_arg1:String, _arg2:String, _arg3:String=null){
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (undefined);
};
return (_local4.content[_arg2]);
}
public function addResourceBundle(_arg1:IResourceBundle):void{
var _local2:String = _arg1.locale;
var _local3:String = _arg1.bundleName;
if (!localeMap[_local2]){
localeMap[_local2] = {};
};
localeMap[_local2][_local3] = _arg1;
}
private function findBundle(_arg1:String, _arg2:String, _arg3:String):IResourceBundle{
supportNonFrameworkApps();
return (((_arg3)!=null) ? getResourceBundle(_arg3, _arg1) : findResourceBundleWithResource(_arg1, _arg2));
}
public function getInt(_arg1:String, _arg2:String, _arg3:String=null):int{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (0);
};
var _local5:* = _local4.content[_arg2];
return (int(_local5));
}
private function supportNonFrameworkApps():void{
if (initializedForNonFrameworkApp){
return;
};
initializedForNonFrameworkApp = true;
if (getLocales().length > 0){
return;
};
var _local1:ApplicationDomain = ApplicationDomain.currentDomain;
if (!_local1.hasDefinition("_CompiledResourceBundleInfo")){
return;
};
var _local2:Class = Class(_local1.getDefinition("_CompiledResourceBundleInfo"));
var _local3:Array = _local2.compiledLocales;
var _local4:Array = _local2.compiledResourceBundleNames;
installCompiledResourceBundles(_local1, _local3, _local4);
localeChain = _local3;
}
public function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (null);
};
var _local5:* = _local4.content[_arg2];
return ((_local5 as Class));
}
public function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (NaN);
};
var _local5:* = _local4.content[_arg2];
return (Number(_local5));
}
public function update():void{
dispatchEvent(new Event(Event.CHANGE));
}
public function getBundleNamesForLocale(_arg1:String):Array{
var _local3:String;
var _local2:Array = [];
for (_local3 in localeMap[_arg1]) {
_local2.push(_local3);
};
return (_local2);
}
public function removeResourceBundle(_arg1:String, _arg2:String):void{
delete localeMap[_arg1][_arg2];
if (getBundleNamesForLocale(_arg1).length == 0){
delete localeMap[_arg1];
};
}
public function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void{
var _local7:String;
var _local8:int;
var _local9:String;
var _local4:int = (_arg2) ? _arg2.length : 0;
var _local5:int = (_arg3) ? _arg3.length : 0;
var _local6:int;
while (_local6 < _local4) {
_local7 = _arg2[_local6];
_local8 = 0;
while (_local8 < _local5) {
_local9 = _arg3[_local8];
mx_internal::installCompiledResourceBundle(_arg1, _local7, _local9);
_local8++;
};
_local6++;
};
}
public function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle{
var _local5:String;
var _local6:Object;
var _local7:ResourceBundle;
if (!_localeChain){
return (null);
};
var _local3:int = _localeChain.length;
var _local4:int;
while (_local4 < _local3) {
_local5 = localeChain[_local4];
_local6 = localeMap[_local5];
if (!_local6){
} else {
_local7 = _local6[_arg1];
if (!_local7){
} else {
if ((_arg2 in _local7.content)){
return (_local7);
};
};
};
_local4++;
};
return (null);
}
public function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (0);
};
var _local5:* = _local4.content[_arg2];
return (uint(_local5));
}
public function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (false);
};
var _local5:* = _local4.content[_arg2];
return ((String(_local5).toLowerCase() == "true"));
}
public function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void{
throw (new Error("unloadResourceModule() is not yet implemented."));
}
public static function getInstance():IResourceManager{
var _local1:Class;
if (!instance){
_local1 = Singleton.getClass("mx.resources::IResourceManager");
if (!_local1){
_local1 = ResourceManager;
};
instance = new (_local1);
};
return (instance);
}
}
}//package mx.resources
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class ResourceModuleInfo {
public var resourceModule:IResourceModule;
public var errorHandler:Function;
public var readyHandler:Function;
public var moduleInfo:IModuleInfo;
private function ResourceModuleInfo(_arg1:IModuleInfo, _arg2:Function, _arg3:Function){
this.moduleInfo = _arg1;
this.readyHandler = _arg2;
this.errorHandler = _arg3;
}
}
class ResourceEventDispatcher extends EventDispatcher {
private function ResourceEventDispatcher(_arg1:IModuleInfo){
_arg1.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
private function moduleInfo_readyHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.COMPLETE);
dispatchEvent(_local2);
}
private function moduleInfo_errorHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
_local2.errorText = _arg1.errorText;
dispatchEvent(_local2);
}
}
Section 166
//HaloBorder (mx.skins.halo.HaloBorder)
package mx.skins.halo {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.graphics.*;
import mx.utils.*;
public class HaloBorder extends RectangularBorder {
mx_internal var radiusObj:Object;
mx_internal var backgroundHole:Object;
mx_internal var radius:Number;
mx_internal var bRoundedCorners:Boolean;
mx_internal var backgroundColor:Object;
private var dropShadow:RectangularDropShadow;
protected var _borderMetrics:EdgeMetrics;
mx_internal var backgroundAlphaName:String;
mx_internal static const VERSION:String = "3.0.0.0";
private static var BORDER_WIDTHS:Object = {none:0, solid:1, inset:2, outset:2, alert:3, dropdown:2, menuBorder:1, comboNonEdit:2};
public function HaloBorder(){
BORDER_WIDTHS["default"] = 3;
}
override public function styleChanged(_arg1:String):void{
if ((((((((((_arg1 == null)) || ((_arg1 == "styleName")))) || ((_arg1 == "borderStyle")))) || ((_arg1 == "borderThickness")))) || ((_arg1 == "borderSides")))){
_borderMetrics = null;
};
invalidateDisplayList();
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
if (((isNaN(_arg1)) || (isNaN(_arg2)))){
return;
};
super.updateDisplayList(_arg1, _arg2);
backgroundColor = getBackgroundColor();
bRoundedCorners = false;
backgroundAlphaName = "backgroundAlpha";
backgroundHole = null;
radius = 0;
radiusObj = null;
drawBorder(_arg1, _arg2);
drawBackground(_arg1, _arg2);
}
mx_internal function drawBorder(_arg1:Number, _arg2:Number):void{
var _local5:Number;
var _local6:uint;
var _local7:uint;
var _local8:String;
var _local9:Number;
var _local10:uint;
var _local11:Boolean;
var _local12:uint;
var _local13:Array;
var _local14:Array;
var _local15:uint;
var _local16:uint;
var _local17:uint;
var _local18:uint;
var _local19:Boolean;
var _local20:Object;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Object;
var _local27:Number;
var _local28:Number;
var _local29:IContainer;
var _local30:EdgeMetrics;
var _local31:Boolean;
var _local32:Number;
var _local33:Array;
var _local34:uint;
var _local35:Boolean;
var _local36:Number;
var _local3:String = getStyle("borderStyle");
var _local4:Array = getStyle("highlightAlphas");
var _local21:Boolean;
var _local26:Graphics = graphics;
_local26.clear();
if (_local3){
switch (_local3){
case "none":
break;
case "inset":
_local7 = getStyle("borderColor");
_local22 = ColorUtil.adjustBrightness2(_local7, -40);
_local23 = ColorUtil.adjustBrightness2(_local7, 25);
_local24 = ColorUtil.adjustBrightness2(_local7, 40);
_local25 = backgroundColor;
if ((((_local25 === null)) || ((_local25 === "")))){
_local25 = _local7;
};
draw3dBorder(_local23, _local22, _local24, Number(_local25), Number(_local25), Number(_local25));
break;
case "outset":
_local7 = getStyle("borderColor");
_local22 = ColorUtil.adjustBrightness2(_local7, -40);
_local23 = ColorUtil.adjustBrightness2(_local7, -25);
_local24 = ColorUtil.adjustBrightness2(_local7, 40);
_local25 = backgroundColor;
if ((((_local25 === null)) || ((_local25 === "")))){
_local25 = _local7;
};
draw3dBorder(_local23, _local24, _local22, Number(_local25), Number(_local25), Number(_local25));
break;
case "alert":
case "default":
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_local27 = getStyle("backgroundAlpha");
_local5 = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
_local28 = (bRoundedCorners) ? radius : 0;
drawDropShadow(0, 0, _arg1, _arg2, radius, radius, _local28, _local28);
if (!bRoundedCorners){
radiusObj = {};
};
_local29 = (parent as IContainer);
if (_local29){
_local30 = _local29.viewMetrics;
backgroundHole = {x:_local30.left, y:_local30.top, w:Math.max(0, ((_arg1 - _local30.left) - _local30.right)), h:Math.max(0, ((_arg2 - _local30.top) - _local30.bottom)), r:0};
if ((((backgroundHole.w > 0)) && ((backgroundHole.h > 0)))){
if (_local27 != _local5){
drawDropShadow(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h, 0, 0, 0, 0);
};
_local26.beginFill(Number(backgroundColor), _local27);
_local26.drawRect(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h);
_local26.endFill();
};
};
backgroundColor = getStyle("borderColor");
};
break;
case "dropdown":
_local12 = getStyle("dropdownBorderColor");
drawDropShadow(0, 0, _arg1, _arg2, 4, 0, 0, 4);
drawRoundRect(0, 0, _arg1, _arg2, {tl:4, tr:0, br:0, bl:4}, 5068126, 1);
drawRoundRect(0, 0, _arg1, _arg2, {tl:4, tr:0, br:0, bl:4}, [0xFFFFFF, 0xFFFFFF], [0.7, 0], verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(1, 1, (_arg1 - 1), (_arg2 - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (_arg1 - 1), (_arg2 - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (_arg1 - 1), (_arg2 - 3)));
if (!isNaN(_local12)){
drawRoundRect(0, 0, (_arg1 + 1), _arg2, {tl:4, tr:0, br:0, bl:4}, _local12, 0.5);
drawRoundRect(1, 1, (_arg1 - 1), (_arg2 - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (_arg1 - 1), (_arg2 - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (_arg1 - 1), (_arg2 - 3)));
};
backgroundColor = null;
break;
case "menuBorder":
_local7 = getStyle("borderColor");
drawRoundRect(0, 0, _arg1, _arg2, 0, _local7, 1);
drawDropShadow(1, 1, (_arg1 - 2), (_arg2 - 2), 0, 0, 0, 0);
break;
case "comboNonEdit":
break;
case "controlBar":
if ((((_arg1 == 0)) || ((_arg2 == 0)))){
backgroundColor = null;
break;
};
_local14 = getStyle("footerColors");
_local31 = !((_local14 == null));
_local32 = getStyle("borderAlpha");
if (_local31){
_local26.lineStyle(0, ((_local14.length > 0)) ? _local14[1] : _local14[0], _local32);
_local26.moveTo(0, 0);
_local26.lineTo(_arg1, 0);
_local26.lineStyle(0, 0, 0);
if (((((parent) && (parent.parent))) && ((parent.parent is IStyleClient)))){
radius = IStyleClient(parent.parent).getStyle("cornerRadius");
_local32 = IStyleClient(parent.parent).getStyle("borderAlpha");
};
if (isNaN(radius)){
radius = 0;
};
if (IStyleClient(parent.parent).getStyle("roundedBottomCorners").toString().toLowerCase() != "true"){
radius = 0;
};
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:0, tr:0, bl:radius, br:radius}, _local14, _local32, verticalGradientMatrix(0, 0, _arg1, _arg2));
if ((((_local14.length > 1)) && (!((_local14[0] == _local14[1]))))){
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:0, tr:0, bl:radius, br:radius}, [0xFFFFFF, 0xFFFFFF], _local4, verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(1, 2, (_arg1 - 2), (_arg2 - 3), {tl:0, tr:0, bl:(radius - 1), br:(radius - 1)}, _local14, _local32, verticalGradientMatrix(0, 0, _arg1, _arg2));
};
};
backgroundColor = null;
break;
case "applicationControlBar":
_local13 = getStyle("fillColors");
_local5 = getStyle("backgroundAlpha");
_local4 = getStyle("highlightAlphas");
_local33 = getStyle("fillAlphas");
_local11 = getStyle("docked");
_local34 = uint(backgroundColor);
radius = getStyle("cornerRadius");
if (!radius){
radius = 0;
};
drawDropShadow(0, 1, _arg1, (_arg2 - 1), radius, radius, radius, radius);
if (((!((backgroundColor === null))) && (StyleManager.isValidStyleValue(backgroundColor)))){
drawRoundRect(0, 1, _arg1, (_arg2 - 1), radius, _local34, _local5, verticalGradientMatrix(0, 0, _arg1, _arg2));
};
drawRoundRect(0, 1, _arg1, (_arg2 - 1), radius, _local13, _local33, verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(0, 1, _arg1, ((_arg2 / 2) - 1), {tl:radius, tr:radius, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], _local4, verticalGradientMatrix(0, 0, _arg1, ((_arg2 / 2) - 1)));
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, 0.3, null, GradientType.LINEAR, null, {x:0, y:2, w:_arg1, h:(_arg2 - 2), r:{tl:radius, tr:radius, bl:0, br:0}});
backgroundColor = null;
break;
default:
_local7 = getStyle("borderColor");
_local9 = getStyle("borderThickness");
_local8 = getStyle("borderSides");
_local35 = true;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
_local36 = Math.max((radius - _local9), 0);
_local20 = {x:_local9, y:_local9, w:(_arg1 - (_local9 * 2)), h:(_arg2 - (_local9 * 2)), r:_local36};
if (!bRoundedCorners){
radiusObj = {tl:radius, tr:radius, bl:0, br:0};
_local20.r = {tl:_local36, tr:_local36, bl:0, br:0};
};
if (_local8 != "left top right bottom"){
_local20.r = {tl:_local36, tr:_local36, bl:(bRoundedCorners) ? _local36 : 0, br:(bRoundedCorners) ? _local36 : 0};
radiusObj = {tl:radius, tr:radius, bl:(bRoundedCorners) ? radius : 0, br:(bRoundedCorners) ? radius : 0};
_local8 = _local8.toLowerCase();
if (_local8.indexOf("left") == -1){
_local20.x = 0;
_local20.w = (_local20.w + _local9);
_local20.r.tl = 0;
_local20.r.bl = 0;
radiusObj.tl = 0;
radiusObj.bl = 0;
_local35 = false;
};
if (_local8.indexOf("top") == -1){
_local20.y = 0;
_local20.h = (_local20.h + _local9);
_local20.r.tl = 0;
_local20.r.tr = 0;
radiusObj.tl = 0;
radiusObj.tr = 0;
_local35 = false;
};
if (_local8.indexOf("right") == -1){
_local20.w = (_local20.w + _local9);
_local20.r.tr = 0;
_local20.r.br = 0;
radiusObj.tr = 0;
radiusObj.br = 0;
_local35 = false;
};
if (_local8.indexOf("bottom") == -1){
_local20.h = (_local20.h + _local9);
_local20.r.bl = 0;
_local20.r.br = 0;
radiusObj.bl = 0;
radiusObj.br = 0;
_local35 = false;
};
};
if ((((radius == 0)) && (_local35))){
drawDropShadow(0, 0, _arg1, _arg2, 0, 0, 0, 0);
_local26.beginFill(_local7);
_local26.drawRect(0, 0, _arg1, _arg2);
_local26.drawRect(_local9, _local9, (_arg1 - (2 * _local9)), (_arg2 - (2 * _local9)));
_local26.endFill();
} else {
if (radiusObj){
drawDropShadow(0, 0, _arg1, _arg2, radiusObj.tl, radiusObj.tr, radiusObj.br, radiusObj.bl);
drawRoundRect(0, 0, _arg1, _arg2, radiusObj, _local7, 1, null, null, null, _local20);
radiusObj.tl = Math.max((radius - _local9), 0);
radiusObj.tr = Math.max((radius - _local9), 0);
radiusObj.bl = (bRoundedCorners) ? Math.max((radius - _local9), 0) : 0;
radiusObj.br = (bRoundedCorners) ? Math.max((radius - _local9), 0) : 0;
} else {
drawDropShadow(0, 0, _arg1, _arg2, radius, radius, radius, radius);
drawRoundRect(0, 0, _arg1, _arg2, radius, _local7, 1, null, null, null, _local20);
radius = Math.max((getStyle("cornerRadius") - _local9), 0);
};
};
};
};
}
mx_internal function drawBackground(_arg1:Number, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:EdgeMetrics;
var _local7:Graphics;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Number;
if (((((((!((backgroundColor === null))) && (!((backgroundColor === ""))))) || (getStyle("mouseShield")))) || (getStyle("mouseShieldChildren")))){
_local4 = Number(backgroundColor);
_local5 = 1;
_local6 = getBackgroundColorMetrics();
_local7 = graphics;
if (((((isNaN(_local4)) || ((backgroundColor === "")))) || ((backgroundColor === null)))){
_local5 = 0;
_local4 = 0xFFFFFF;
} else {
_local5 = getStyle(backgroundAlphaName);
};
if (((!((radius == 0))) || (backgroundHole))){
_local8 = _local6.bottom;
if (radiusObj){
_local9 = (bRoundedCorners) ? radius : 0;
radiusObj = {tl:radius, tr:radius, bl:_local9, br:_local9};
drawRoundRect(_local6.left, _local6.top, (width - (_local6.left + _local6.right)), (height - (_local6.top + _local8)), radiusObj, _local4, _local5, null, GradientType.LINEAR, null, backgroundHole);
} else {
drawRoundRect(_local6.left, _local6.top, (width - (_local6.left + _local6.right)), (height - (_local6.top + _local8)), radius, _local4, _local5, null, GradientType.LINEAR, null, backgroundHole);
};
} else {
_local7.beginFill(_local4, _local5);
_local7.drawRect(_local6.left, _local6.top, ((_arg1 - _local6.right) - _local6.left), ((_arg2 - _local6.bottom) - _local6.top));
_local7.endFill();
};
};
var _local3:String = getStyle("borderStyle");
if ((((((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) && ((((_local3 == "alert")) || ((_local3 == "default")))))) && ((getStyle("headerColors") == null)))){
_local10 = getStyle("highlightAlphas");
_local11 = (_local10) ? _local10[0] : 0.3;
drawRoundRect(0, 0, _arg1, _arg2, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, _local11, null, GradientType.LINEAR, null, {x:0, y:1, w:_arg1, h:(_arg2 - 1), r:{tl:radius, tr:radius, bl:0, br:0}});
};
}
mx_internal function drawDropShadow(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local11:Number;
var _local12:Boolean;
if ((((((((getStyle("dropShadowEnabled") == false)) || ((getStyle("dropShadowEnabled") == "false")))) || ((_arg3 == 0)))) || ((_arg4 == 0)))){
return;
};
var _local9:Number = getStyle("shadowDistance");
var _local10:String = getStyle("shadowDirection");
if (getStyle("borderStyle") == "applicationControlBar"){
_local12 = getStyle("docked");
_local11 = (_local12) ? 90 : getDropShadowAngle(_local9, _local10);
_local9 = Math.abs(_local9);
} else {
_local11 = getDropShadowAngle(_local9, _local10);
_local9 = (Math.abs(_local9) + 2);
};
if (!dropShadow){
dropShadow = new RectangularDropShadow();
};
dropShadow.distance = _local9;
dropShadow.angle = _local11;
dropShadow.color = getStyle("dropShadowColor");
dropShadow.alpha = 0.4;
dropShadow.tlRadius = _arg5;
dropShadow.trRadius = _arg6;
dropShadow.blRadius = _arg8;
dropShadow.brRadius = _arg7;
dropShadow.drawShadow(graphics, _arg1, _arg2, _arg3, _arg4);
}
mx_internal function getBackgroundColor():Object{
var _local2:Object;
var _local1:IUIComponent = (parent as IUIComponent);
if (((_local1) && (!(_local1.enabled)))){
_local2 = getStyle("backgroundDisabledColor");
if (((!((_local2 === null))) && (StyleManager.isValidStyleValue(_local2)))){
return (_local2);
};
};
return (getStyle("backgroundColor"));
}
mx_internal function draw3dBorder(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:Number = width;
var _local8:Number = height;
drawDropShadow(0, 0, width, height, 0, 0, 0, 0);
var _local9:Graphics = graphics;
_local9.beginFill(_arg1);
_local9.drawRect(0, 0, _local7, _local8);
_local9.drawRect(1, 0, (_local7 - 2), _local8);
_local9.endFill();
_local9.beginFill(_arg2);
_local9.drawRect(1, 0, (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg3);
_local9.drawRect(1, (_local8 - 1), (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg4);
_local9.drawRect(1, 1, (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg5);
_local9.drawRect(1, (_local8 - 2), (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg6);
_local9.drawRect(1, 2, (_local7 - 2), (_local8 - 4));
_local9.drawRect(2, 2, (_local7 - 4), (_local8 - 4));
_local9.endFill();
}
mx_internal function getBackgroundColorMetrics():EdgeMetrics{
return (borderMetrics);
}
mx_internal function getDropShadowAngle(_arg1:Number, _arg2:String):Number{
if (_arg2 == "left"){
return (((_arg1 >= 0)) ? 135 : 225);
//unresolved jump
};
if (_arg2 == "right"){
return (((_arg1 >= 0)) ? 45 : 315);
//unresolved jump
};
return (((_arg1 >= 0)) ? 90 : 270);
}
override public function get borderMetrics():EdgeMetrics{
var _local1:Number;
var _local3:String;
if (_borderMetrics){
return (_borderMetrics);
};
var _local2:String = getStyle("borderStyle");
if ((((_local2 == "default")) || ((_local2 == "alert")))){
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_borderMetrics = new EdgeMetrics(0, 0, 0, 0);
} else {
return (EdgeMetrics.EMPTY);
};
} else {
if ((((_local2 == "controlBar")) || ((_local2 == "applicationControlBar")))){
_borderMetrics = new EdgeMetrics(1, 1, 1, 1);
} else {
if (_local2 == "solid"){
_local1 = getStyle("borderThickness");
if (isNaN(_local1)){
_local1 = 0;
};
_borderMetrics = new EdgeMetrics(_local1, _local1, _local1, _local1);
_local3 = getStyle("borderSides");
if (_local3 != "left top right bottom"){
if (_local3.indexOf("left") == -1){
_borderMetrics.left = 0;
};
if (_local3.indexOf("top") == -1){
_borderMetrics.top = 0;
};
if (_local3.indexOf("right") == -1){
_borderMetrics.right = 0;
};
if (_local3.indexOf("bottom") == -1){
_borderMetrics.bottom = 0;
};
};
} else {
_local1 = BORDER_WIDTHS[_local2];
if (isNaN(_local1)){
_local1 = 0;
};
_borderMetrics = new EdgeMetrics(_local1, _local1, _local1, _local1);
};
};
};
return (_borderMetrics);
}
}
}//package mx.skins.halo
Section 167
//HaloFocusRect (mx.skins.halo.HaloFocusRect)
package mx.skins.halo {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import mx.skins.*;
import mx.utils.*;
public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient {
private var _focusColor:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function get inheritingStyles():Object{
return (styleName.inheritingStyles);
}
public function set inheritingStyles(_arg1:Object):void{
}
public function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void{
}
public function registerEffects(_arg1:Array):void{
}
public function regenerateStyleCache(_arg1:Boolean):void{
}
public function get styleDeclaration():CSSStyleDeclaration{
return (CSSStyleDeclaration(styleName));
}
public function getClassStyleDeclarations():Array{
return ([]);
}
public function get className():String{
return ("HaloFocusRect");
}
public function clearStyle(_arg1:String):void{
if (_arg1 == "focusColor"){
_focusColor = NaN;
};
}
public function setStyle(_arg1:String, _arg2):void{
if (_arg1 == "focusColor"){
_focusColor = _arg2;
};
}
public function set nonInheritingStyles(_arg1:Object):void{
}
public function get nonInheritingStyles():Object{
return (styleName.nonInheritingStyles);
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
super.updateDisplayList(_arg1, _arg2);
var _local3:String = getStyle("focusBlendMode");
var _local4:Number = getStyle("focusAlpha");
var _local5:Number = getStyle("focusColor");
var _local6:Number = getStyle("cornerRadius");
var _local7:Number = getStyle("focusThickness");
var _local8:String = getStyle("focusRoundedCorners");
var _local9:Number = getStyle("themeColor");
var _local10:Number = _local5;
if (isNaN(_local10)){
_local10 = _local9;
};
var _local11:Graphics = graphics;
_local11.clear();
blendMode = _local3;
if (((!((_local8 == "tl tr bl br"))) && ((_local6 > 0)))){
_local12 = 0;
_local13 = 0;
_local14 = 0;
_local15 = 0;
_local16 = (_local6 + _local7);
if (_local8.indexOf("tl") >= 0){
_local12 = _local16;
};
if (_local8.indexOf("tr") >= 0){
_local14 = _local16;
};
if (_local8.indexOf("bl") >= 0){
_local13 = _local16;
};
if (_local8.indexOf("br") >= 0){
_local15 = _local16;
};
_local11.beginFill(_local10, _local4);
GraphicsUtil.drawRoundRectComplex(_local11, 0, 0, _arg1, _arg2, _local12, _local14, _local13, _local15);
_local12 = (_local12) ? _local6 : 0;
_local14 = (_local14) ? _local6 : 0;
_local13 = (_local13) ? _local6 : 0;
_local15 = (_local15) ? _local6 : 0;
GraphicsUtil.drawRoundRectComplex(_local11, _local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local12, _local14, _local13, _local15);
_local11.endFill();
_local16 = (_local6 + (_local7 / 2));
_local12 = (_local12) ? _local16 : 0;
_local14 = (_local14) ? _local16 : 0;
_local13 = (_local13) ? _local16 : 0;
_local15 = (_local15) ? _local16 : 0;
_local11.beginFill(_local10, _local4);
GraphicsUtil.drawRoundRectComplex(_local11, (_local7 / 2), (_local7 / 2), (_arg1 - _local7), (_arg2 - _local7), _local12, _local14, _local13, _local15);
_local12 = (_local12) ? _local6 : 0;
_local14 = (_local14) ? _local6 : 0;
_local13 = (_local13) ? _local6 : 0;
_local15 = (_local15) ? _local6 : 0;
GraphicsUtil.drawRoundRectComplex(_local11, _local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local12, _local14, _local13, _local15);
_local11.endFill();
} else {
_local11.beginFill(_local10, _local4);
_local17 = (((_local6 > 0)) ? (_local6 + _local7) : 0 * 2);
_local11.drawRoundRect(0, 0, _arg1, _arg2, _local17, _local17);
_local17 = (_local6 * 2);
_local11.drawRoundRect(_local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local17, _local17);
_local11.endFill();
_local11.beginFill(_local10, _local4);
_local17 = (((_local6 > 0)) ? (_local6 + (_local7 / 2)) : 0 * 2);
_local11.drawRoundRect((_local7 / 2), (_local7 / 2), (_arg1 - _local7), (_arg2 - _local7), _local17, _local17);
_local17 = (_local6 * 2);
_local11.drawRoundRect(_local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local17, _local17);
_local11.endFill();
};
}
override public function getStyle(_arg1:String){
return (((_arg1 == "focusColor")) ? _focusColor : super.getStyle(_arg1));
}
public function set styleDeclaration(_arg1:CSSStyleDeclaration):void{
}
}
}//package mx.skins.halo
Section 168
//Border (mx.skins.Border)
package mx.skins {
import mx.core.*;
public class Border extends ProgrammaticSkin implements IBorder {
mx_internal static const VERSION:String = "3.0.0.0";
public function get borderMetrics():EdgeMetrics{
return (EdgeMetrics.EMPTY);
}
}
}//package mx.skins
Section 169
//ProgrammaticSkin (mx.skins.ProgrammaticSkin)
package mx.skins {
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import flash.geom.*;
import mx.managers.*;
import mx.utils.*;
public class ProgrammaticSkin extends FlexShape implements IFlexDisplayObject, IInvalidating, ILayoutManagerClient, ISimpleStyleClient, IProgrammaticSkin {
private var _initialized:Boolean;// = false
private var _height:Number;
private var invalidateDisplayListFlag:Boolean;// = false
private var _styleName:IStyleClient;
private var _nestLevel:int;// = 0
private var _processedDescriptors:Boolean;// = false
private var _updateCompletePendingFlag:Boolean;// = true
private var _width:Number;
mx_internal static const VERSION:String = "3.0.0.0";
private static var tempMatrix:Matrix = new Matrix();
public function ProgrammaticSkin(){
_width = measuredWidth;
_height = measuredHeight;
}
public function getStyle(_arg1:String){
return (_styleName.getStyle(_arg1));
}
protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
}
public function get nestLevel():int{
return (_nestLevel);
}
public function set nestLevel(_arg1:int):void{
_nestLevel = _arg1;
invalidateDisplayList();
}
override public function get height():Number{
return (_height);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function verticalGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix{
return (rotatedGradientMatrix(_arg1, _arg2, _arg3, _arg4, 90));
}
public function validateSize(_arg1:Boolean=false):void{
}
public function invalidateDisplayList():void{
if (((!(invalidateDisplayListFlag)) && ((nestLevel > 0)))){
invalidateDisplayListFlag = true;
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
}
public function set updateCompletePendingFlag(_arg1:Boolean):void{
_updateCompletePendingFlag = _arg1;
}
protected function horizontalGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix{
return (rotatedGradientMatrix(_arg1, _arg2, _arg3, _arg4, 0));
}
override public function set height(_arg1:Number):void{
_height = _arg1;
invalidateDisplayList();
}
public function set processedDescriptors(_arg1:Boolean):void{
_processedDescriptors = _arg1;
}
public function validateDisplayList():void{
invalidateDisplayListFlag = false;
updateDisplayList(width, height);
}
public function get measuredWidth():Number{
return (0);
}
override public function set width(_arg1:Number):void{
_width = _arg1;
invalidateDisplayList();
}
public function get measuredHeight():Number{
return (0);
}
public function set initialized(_arg1:Boolean):void{
_initialized = _arg1;
}
protected function drawRoundRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null, _arg6:Object=null, _arg7:Object=null, _arg8:Matrix=null, _arg9:String="linear", _arg10:Array=null, _arg11:Object=null):void{
var _local13:Number;
var _local14:Array;
var _local15:Object;
var _local12:Graphics = graphics;
if ((((_arg3 == 0)) || ((_arg4 == 0)))){
return;
};
if (_arg6 !== null){
if ((_arg6 is uint)){
_local12.beginFill(uint(_arg6), Number(_arg7));
} else {
if ((_arg6 is Array)){
_local14 = ((_arg7 is Array)) ? (_arg7 as Array) : [_arg7, _arg7];
if (!_arg10){
_arg10 = [0, 0xFF];
};
_local12.beginGradientFill(_arg9, (_arg6 as Array), _local14, _arg10, _arg8);
};
};
};
if (!_arg5){
_local12.drawRect(_arg1, _arg2, _arg3, _arg4);
} else {
if ((_arg5 is Number)){
_local13 = (Number(_arg5) * 2);
_local12.drawRoundRect(_arg1, _arg2, _arg3, _arg4, _local13, _local13);
} else {
GraphicsUtil.drawRoundRectComplex(_local12, _arg1, _arg2, _arg3, _arg4, _arg5.tl, _arg5.tr, _arg5.bl, _arg5.br);
};
};
if (_arg11){
_local15 = _arg11.r;
if ((_local15 is Number)){
_local13 = (Number(_local15) * 2);
_local12.drawRoundRect(_arg11.x, _arg11.y, _arg11.w, _arg11.h, _local13, _local13);
} else {
GraphicsUtil.drawRoundRectComplex(_local12, _arg11.x, _arg11.y, _arg11.w, _arg11.h, _local15.tl, _local15.tr, _local15.bl, _local15.br);
};
};
if (_arg6 !== null){
_local12.endFill();
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function set styleName(_arg1:Object):void{
if (_styleName != _arg1){
_styleName = (_arg1 as IStyleClient);
invalidateDisplayList();
};
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
var _local3:Boolean;
if (_width != _arg1){
_width = _arg1;
_local3 = true;
};
if (_height != _arg2){
_height = _arg2;
_local3 = true;
};
if (_local3){
invalidateDisplayList();
};
}
public function styleChanged(_arg1:String):void{
invalidateDisplayList();
}
override public function get width():Number{
return (_width);
}
public function invalidateProperties():void{
}
public function get initialized():Boolean{
return (_initialized);
}
protected function rotatedGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Matrix{
tempMatrix.createGradientBox(_arg3, _arg4, ((_arg5 * Math.PI) / 180), _arg1, _arg2);
return (tempMatrix);
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get styleName():Object{
return (_styleName);
}
public function validateNow():void{
if (invalidateDisplayListFlag){
validateDisplayList();
};
}
public function invalidateSize():void{
}
public function validateProperties():void{
}
}
}//package mx.skins
Section 170
//RectangularBorder (mx.skins.RectangularBorder)
package mx.skins {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import mx.styles.*;
import flash.system.*;
import flash.geom.*;
import mx.resources.*;
import flash.utils.*;
import flash.net.*;
public class RectangularBorder extends Border implements IRectangularBorder {
private var backgroundImage:DisplayObject;
private var backgroundImageHeight:Number;
private var _backgroundImageBounds:Rectangle;
private var backgroundImageStyle:Object;
private var backgroundImageWidth:Number;
private var resourceManager:IResourceManager;
mx_internal static const VERSION:String = "3.0.0.0";
public function RectangularBorder(){
resourceManager = ResourceManager.getInstance();
super();
addEventListener(Event.REMOVED, removedHandler);
}
public function layoutBackgroundImage():void{
var _local4:Number;
var _local5:Number;
var _local7:Number;
var _local8:Number;
var _local14:Number;
var _local15:Graphics;
var _local1:DisplayObject = parent;
var _local2:EdgeMetrics = ((_local1 is IContainer)) ? IContainer(_local1).viewMetrics : borderMetrics;
var _local3 = !((getStyle("backgroundAttachment") == "fixed"));
if (_backgroundImageBounds){
_local4 = _backgroundImageBounds.width;
_local5 = _backgroundImageBounds.height;
} else {
_local4 = ((width - _local2.left) - _local2.right);
_local5 = ((height - _local2.top) - _local2.bottom);
};
var _local6:Number = getBackgroundSize();
if (isNaN(_local6)){
_local7 = 1;
_local8 = 1;
} else {
_local14 = (_local6 * 0.01);
_local7 = ((_local14 * _local4) / backgroundImageWidth);
_local8 = ((_local14 * _local5) / backgroundImageHeight);
};
backgroundImage.scaleX = _local7;
backgroundImage.scaleY = _local8;
var _local9:Number = Math.round((0.5 * (_local4 - (backgroundImageWidth * _local7))));
var _local10:Number = Math.round((0.5 * (_local5 - (backgroundImageHeight * _local8))));
backgroundImage.x = _local2.left;
backgroundImage.y = _local2.top;
var _local11:Shape = Shape(backgroundImage.mask);
_local11.x = _local2.left;
_local11.y = _local2.top;
if (((_local3) && ((_local1 is IContainer)))){
_local9 = (_local9 - IContainer(_local1).horizontalScrollPosition);
_local10 = (_local10 - IContainer(_local1).verticalScrollPosition);
};
backgroundImage.alpha = getStyle("backgroundAlpha");
backgroundImage.x = (backgroundImage.x + _local9);
backgroundImage.y = (backgroundImage.y + _local10);
var _local12:Number = ((width - _local2.left) - _local2.right);
var _local13:Number = ((height - _local2.top) - _local2.bottom);
if (((!((_local11.width == _local12))) || (!((_local11.height == _local13))))){
_local15 = _local11.graphics;
_local15.clear();
_local15.beginFill(0xFFFFFF);
_local15.drawRect(0, 0, _local12, _local13);
_local15.endFill();
};
}
public function set backgroundImageBounds(_arg1:Rectangle):void{
_backgroundImageBounds = _arg1;
invalidateDisplayList();
}
private function getBackgroundSize():Number{
var _local3:int;
var _local1:Number = NaN;
var _local2:Object = getStyle("backgroundSize");
if (((_local2) && ((_local2 is String)))){
_local3 = _local2.indexOf("%");
if (_local3 != -1){
_local1 = Number(_local2.substr(0, _local3));
};
};
return (_local1);
}
private function removedHandler(_arg1:Event):void{
var _local2:IChildList;
if (backgroundImage){
_local2 = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
_local2.removeChild(backgroundImage.mask);
_local2.removeChild(backgroundImage);
backgroundImage = null;
};
}
private function initBackgroundImage(_arg1:DisplayObject):void{
backgroundImage = _arg1;
if ((_arg1 is Loader)){
backgroundImageWidth = Loader(_arg1).contentLoaderInfo.width;
backgroundImageHeight = Loader(_arg1).contentLoaderInfo.height;
} else {
backgroundImageWidth = backgroundImage.width;
backgroundImageHeight = backgroundImage.height;
if ((_arg1 is ISimpleStyleClient)){
ISimpleStyleClient(_arg1).styleName = styleName;
};
};
var _local2:IChildList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
var _local3:Shape = new FlexShape();
_local3.name = "backgroundMask";
_local3.x = 0;
_local3.y = 0;
_local2.addChild(_local3);
var _local4:int = _local2.getChildIndex(this);
_local2.addChildAt(backgroundImage, (_local4 + 1));
backgroundImage.mask = _local3;
}
public function get backgroundImageBounds():Rectangle{
return (_backgroundImageBounds);
}
public function get hasBackgroundImage():Boolean{
return (!((backgroundImage == null)));
}
private function completeEventHandler(_arg1:Event):void{
if (!parent){
return;
};
var _local2:DisplayObject = DisplayObject(LoaderInfo(_arg1.target).loader);
initBackgroundImage(_local2);
layoutBackgroundImage();
dispatchEvent(_arg1.clone());
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var message:String;
var unscaledWidth = _arg1;
var unscaledHeight = _arg2;
if (!parent){
return;
};
var newStyle:Object = getStyle("backgroundImage");
if (newStyle != backgroundImageStyle){
removedHandler(null);
backgroundImageStyle = newStyle;
if (((newStyle) && ((newStyle as Class)))){
cls = Class(newStyle);
initBackgroundImage(new (cls));
} else {
if (((newStyle) && ((newStyle is String)))){
try {
cls = Class(getDefinitionByName(String(newStyle)));
} catch(e:Error) {
};
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new FlexLoader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeEventHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorEventHandler);
loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, errorEventHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(newStyle)), loaderContext);
};
} else {
if (newStyle){
message = resourceManager.getString("skins", "notLoaded", [newStyle]);
throw (new Error(message));
};
};
};
};
if (backgroundImage){
layoutBackgroundImage();
};
}
private function errorEventHandler(_arg1:Event):void{
}
}
}//package mx.skins
Section 171
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import mx.managers.*;
import flash.utils.*;
public class CSSStyleDeclaration extends EventDispatcher {
mx_internal var effects:Array;
protected var overrides:Object;
public var defaultFactory:Function;
public var factory:Function;
mx_internal var selectorRefCount:int;// = 0
private var styleManager:IStyleManager2;
private var clones:Dictionary;
mx_internal static const VERSION:String = "3.0.0.0";
private static const NOT_A_COLOR:uint = 4294967295;
private static const FILTERMAP_PROP:String = "__reserved__filterMap";
public function CSSStyleDeclaration(_arg1:String=null){
clones = new Dictionary(true);
super();
if (_arg1){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
styleManager.setStyleDeclaration(_arg1, this, false);
};
}
mx_internal function addStyleToProtoChain(_arg1:Object, _arg2:DisplayObject, _arg3:Object=null):Object{
var p:String;
var emptyObjectFactory:Function;
var filteredChain:Object;
var filterObjectFactory:Function;
var i:String;
var chain = _arg1;
var target = _arg2;
var filterMap = _arg3;
var nodeAddedToChain:Boolean;
var originalChain:Object = chain;
if (filterMap){
chain = {};
};
if (defaultFactory != null){
defaultFactory.prototype = chain;
chain = new defaultFactory();
nodeAddedToChain = true;
};
if (factory != null){
factory.prototype = chain;
chain = new factory();
nodeAddedToChain = true;
};
if (overrides){
if ((((defaultFactory == null)) && ((factory == null)))){
emptyObjectFactory = function ():void{
};
emptyObjectFactory.prototype = chain;
chain = new (emptyObjectFactory);
nodeAddedToChain = true;
};
for (p in overrides) {
if (overrides[p] === undefined){
delete chain[p];
} else {
chain[p] = overrides[p];
};
};
};
if (filterMap){
if (nodeAddedToChain){
filteredChain = {};
filterObjectFactory = function ():void{
};
filterObjectFactory.prototype = originalChain;
filteredChain = new (filterObjectFactory);
for (i in chain) {
if (filterMap[i] != null){
filteredChain[filterMap[i]] = chain[i];
};
};
chain = filteredChain;
chain[FILTERMAP_PROP] = filterMap;
} else {
chain = originalChain;
};
};
if (nodeAddedToChain){
clones[chain] = 1;
};
return (chain);
}
public function getStyle(_arg1:String){
var _local2:*;
var _local3:*;
if (overrides){
if ((((_arg1 in overrides)) && ((overrides[_arg1] === undefined)))){
return (undefined);
};
_local3 = overrides[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
if (factory != null){
factory.prototype = {};
_local2 = new factory();
_local3 = _local2[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
if (defaultFactory != null){
defaultFactory.prototype = {};
_local2 = new defaultFactory();
_local3 = _local2[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
return (undefined);
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, undefined);
}
public function setStyle(_arg1:String, _arg2):void{
var _local7:int;
var _local8:Object;
var _local3:Object = getStyle(_arg1);
var _local4:Boolean;
if ((((((((((selectorRefCount > 0)) && ((factory == null)))) && ((defaultFactory == null)))) && (!(overrides)))) && (!((_local3 === _arg2))))){
_local4 = true;
};
if (_arg2 !== undefined){
setStyle(_arg1, _arg2);
} else {
if (_arg2 == _local3){
return;
};
setStyle(_arg1, _arg2);
};
var _local5:Array = SystemManagerGlobals.topLevelSystemManagers;
var _local6:int = _local5.length;
if (_local4){
_local7 = 0;
while (_local7 < _local6) {
_local8 = _local5[_local7];
_local8.regenerateStyleCache(true);
_local7++;
};
};
_local7 = 0;
while (_local7 < _local6) {
_local8 = _local5[_local7];
_local8.notifyStyleChangeInChildren(_arg1, true);
_local7++;
};
}
private function clearStyleAttr(_arg1:String):void{
var _local2:*;
if (!overrides){
overrides = {};
};
overrides[_arg1] = undefined;
for (_local2 in clones) {
delete _local2[_arg1];
};
}
mx_internal function createProtoChainRoot():Object{
var _local1:Object = {};
if (defaultFactory != null){
defaultFactory.prototype = _local1;
_local1 = new defaultFactory();
};
if (factory != null){
factory.prototype = _local1;
_local1 = new factory();
};
clones[_local1] = 1;
return (_local1);
}
mx_internal function clearOverride(_arg1:String):void{
if (((overrides) && (overrides[_arg1]))){
delete overrides[_arg1];
};
}
mx_internal function setStyle(_arg1:String, _arg2):void{
var _local3:Object;
var _local4:*;
var _local5:Number;
var _local6:Object;
if (_arg2 === undefined){
clearStyleAttr(_arg1);
return;
};
if ((_arg2 is String)){
if (!styleManager){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
};
_local5 = styleManager.getColorName(_arg2);
if (_local5 != NOT_A_COLOR){
_arg2 = _local5;
};
};
if (defaultFactory != null){
_local3 = new defaultFactory();
if (_local3[_arg1] !== _arg2){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
} else {
if (overrides){
delete overrides[_arg1];
};
};
};
if (factory != null){
_local3 = new factory();
if (_local3[_arg1] !== _arg2){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
} else {
if (overrides){
delete overrides[_arg1];
};
};
};
if ((((defaultFactory == null)) && ((factory == null)))){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
};
for (_local4 in clones) {
_local6 = _local4[FILTERMAP_PROP];
if (_local6){
if (_local6[_arg1] != null){
_local4[_local6[_arg1]] = _arg2;
};
} else {
_local4[_arg1] = _arg2;
};
};
}
}
}//package mx.styles
Section 172
//ISimpleStyleClient (mx.styles.ISimpleStyleClient)
package mx.styles {
public interface ISimpleStyleClient {
function set styleName(_arg1:Object):void;
function styleChanged(_arg1:String):void;
function get styleName():Object;
}
}//package mx.styles
Section 173
//IStyleClient (mx.styles.IStyleClient)
package mx.styles {
public interface IStyleClient extends ISimpleStyleClient {
function regenerateStyleCache(_arg1:Boolean):void;
function get className():String;
function clearStyle(_arg1:String):void;
function getClassStyleDeclarations():Array;
function get inheritingStyles():Object;
function set nonInheritingStyles(_arg1:Object):void;
function setStyle(_arg1:String, _arg2):void;
function get styleDeclaration():CSSStyleDeclaration;
function set styleDeclaration(_arg1:CSSStyleDeclaration):void;
function get nonInheritingStyles():Object;
function set inheritingStyles(_arg1:Object):void;
function getStyle(_arg1:String);
function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void;
function registerEffects(_arg1:Array):void;
}
}//package mx.styles
Section 174
//IStyleManager (mx.styles.IStyleManager)
package mx.styles {
import flash.events.*;
public interface IStyleManager {
function isColorName(_arg1:String):Boolean;
function registerParentDisplayListInvalidatingStyle(_arg1:String):void;
function registerInheritingStyle(_arg1:String):void;
function set stylesRoot(_arg1:Object):void;
function get typeSelectorCache():Object;
function styleDeclarationsChanged():void;
function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void;
function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean;
function isSizeInvalidatingStyle(_arg1:String):Boolean;
function get inheritingStyles():Object;
function isValidStyleValue(_arg1):Boolean;
function isParentSizeInvalidatingStyle(_arg1:String):Boolean;
function getColorName(_arg1:Object):uint;
function set typeSelectorCache(_arg1:Object):void;
function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void;
function getColorNames(_arg1:Array):void;
function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher;
function isInheritingStyle(_arg1:String):Boolean;
function set inheritingStyles(_arg1:Object):void;
function get stylesRoot():Object;
function initProtoChainRoots():void;
function registerColorName(_arg1:String, _arg2:uint):void;
function registerParentSizeInvalidatingStyle(_arg1:String):void;
function registerSizeInvalidatingStyle(_arg1:String):void;
function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void;
function isInheritingTextFormatStyle(_arg1:String):Boolean;
function getStyleDeclaration(_arg1:String):CSSStyleDeclaration;
}
}//package mx.styles
Section 175
//IStyleManager2 (mx.styles.IStyleManager2)
package mx.styles {
import flash.events.*;
import flash.system.*;
public interface IStyleManager2 extends IStyleManager {
function get selectors():Array;
function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
}
}//package mx.styles
Section 176
//IStyleModule (mx.styles.IStyleModule)
package mx.styles {
public interface IStyleModule {
function unload():void;
}
}//package mx.styles
Section 177
//StyleManager (mx.styles.StyleManager)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.system.*;
public class StyleManager {
mx_internal static const VERSION:String = "3.0.0.0";
public static const NOT_A_COLOR:uint = 4294967295;
private static var _impl:IStyleManager2;
private static var implClassDependency:StyleManagerImpl;
public static function isParentSizeInvalidatingStyle(_arg1:String):Boolean{
return (impl.isParentSizeInvalidatingStyle(_arg1));
}
public static function registerInheritingStyle(_arg1:String):void{
impl.registerInheritingStyle(_arg1);
}
mx_internal static function set stylesRoot(_arg1:Object):void{
impl.stylesRoot = _arg1;
}
mx_internal static function get inheritingStyles():Object{
return (impl.inheritingStyles);
}
mx_internal static function styleDeclarationsChanged():void{
impl.styleDeclarationsChanged();
}
public static function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void{
impl.setStyleDeclaration(_arg1, _arg2, _arg3);
}
public static function registerParentDisplayListInvalidatingStyle(_arg1:String):void{
impl.registerParentDisplayListInvalidatingStyle(_arg1);
}
mx_internal static function get typeSelectorCache():Object{
return (impl.typeSelectorCache);
}
mx_internal static function set inheritingStyles(_arg1:Object):void{
impl.inheritingStyles = _arg1;
}
public static function isColorName(_arg1:String):Boolean{
return (impl.isColorName(_arg1));
}
public static function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean{
return (impl.isParentDisplayListInvalidatingStyle(_arg1));
}
public static function isSizeInvalidatingStyle(_arg1:String):Boolean{
return (impl.isSizeInvalidatingStyle(_arg1));
}
public static function getColorName(_arg1:Object):uint{
return (impl.getColorName(_arg1));
}
mx_internal static function set typeSelectorCache(_arg1:Object):void{
impl.typeSelectorCache = _arg1;
}
public static function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void{
impl.unloadStyleDeclarations(_arg1, _arg2);
}
public static function getColorNames(_arg1:Array):void{
impl.getColorNames(_arg1);
}
public static function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false, _arg4:ApplicationDomain=null, _arg5:SecurityDomain=null):IEventDispatcher{
return (impl.loadStyleDeclarations2(_arg1, _arg2, _arg4, _arg5));
}
private static function get impl():IStyleManager2{
if (!_impl){
_impl = IStyleManager2(Singleton.getInstance("mx.styles::IStyleManager2"));
};
return (_impl);
}
public static function isValidStyleValue(_arg1):Boolean{
return (impl.isValidStyleValue(_arg1));
}
mx_internal static function get stylesRoot():Object{
return (impl.stylesRoot);
}
public static function isInheritingStyle(_arg1:String):Boolean{
return (impl.isInheritingStyle(_arg1));
}
mx_internal static function initProtoChainRoots():void{
impl.initProtoChainRoots();
}
public static function registerParentSizeInvalidatingStyle(_arg1:String):void{
impl.registerParentSizeInvalidatingStyle(_arg1);
}
public static function get selectors():Array{
return (impl.selectors);
}
public static function registerSizeInvalidatingStyle(_arg1:String):void{
impl.registerSizeInvalidatingStyle(_arg1);
}
public static function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void{
impl.clearStyleDeclaration(_arg1, _arg2);
}
public static function registerColorName(_arg1:String, _arg2:uint):void{
impl.registerColorName(_arg1, _arg2);
}
public static function isInheritingTextFormatStyle(_arg1:String):Boolean{
return (impl.isInheritingTextFormatStyle(_arg1));
}
public static function getStyleDeclaration(_arg1:String):CSSStyleDeclaration{
return (impl.getStyleDeclaration(_arg1));
}
}
}//package mx.styles
Section 178
//StyleManagerImpl (mx.styles.StyleManagerImpl)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.system.*;
import mx.modules.*;
import mx.events.*;
import mx.resources.*;
import mx.managers.*;
import flash.utils.*;
public class StyleManagerImpl implements IStyleManager2 {
private var _stylesRoot:Object;
private var _selectors:Object;
private var styleModules:Object;
private var _inheritingStyles:Object;
private var resourceManager:IResourceManager;
private var _typeSelectorCache:Object;
mx_internal static const VERSION:String = "3.0.0.0";
private static var parentSizeInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var colorNames:Object = {transparent:"transparent", black:0, blue:0xFF, green:0x8000, gray:0x808080, silver:0xC0C0C0, lime:0xFF00, olive:0x808000, white:0xFFFFFF, yellow:0xFFFF00, maroon:0x800000, navy:128, red:0xFF0000, purple:0x800080, teal:0x8080, fuchsia:0xFF00FF, aqua:0xFFFF, magenta:0xFF00FF, cyan:0xFFFF, halogreen:8453965, haloblue:40447, haloorange:0xFFB600, halosilver:11455193};
private static var inheritingTextFormatStyles:Object = {align:true, bold:true, color:true, font:true, indent:true, italic:true, size:true};
private static var instance:IStyleManager2;
private static var parentDisplayListInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var sizeInvalidatingStyles:Object = {borderStyle:true, borderThickness:true, fontAntiAliasType:true, fontFamily:true, fontGridFitType:true, fontSharpness:true, fontSize:true, fontStyle:true, fontThickness:true, fontWeight:true, headerHeight:true, horizontalAlign:true, horizontalGap:true, kerning:true, leading:true, letterSpacing:true, paddingBottom:true, paddingLeft:true, paddingRight:true, paddingTop:true, strokeWidth:true, tabHeight:true, tabWidth:true, verticalAlign:true, verticalGap:true};
public function StyleManagerImpl(){
_selectors = {};
styleModules = {};
resourceManager = ResourceManager.getInstance();
_inheritingStyles = {};
_typeSelectorCache = {};
super();
}
public function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void{
_arg2.selectorRefCount++;
_selectors[_arg1] = _arg2;
typeSelectorCache = {};
if (_arg3){
styleDeclarationsChanged();
};
}
public function registerParentDisplayListInvalidatingStyle(_arg1:String):void{
parentDisplayListInvalidatingStyles[_arg1] = true;
}
public function getStyleDeclaration(_arg1:String):CSSStyleDeclaration{
var _local2:int;
if (_arg1.charAt(0) != "."){
_local2 = _arg1.lastIndexOf(".");
if (_local2 != -1){
_arg1 = _arg1.substr((_local2 + 1));
};
};
return (_selectors[_arg1]);
}
public function set typeSelectorCache(_arg1:Object):void{
_typeSelectorCache = _arg1;
}
public function isColorName(_arg1:String):Boolean{
return (!((colorNames[_arg1.toLowerCase()] === undefined)));
}
public function set inheritingStyles(_arg1:Object):void{
_inheritingStyles = _arg1;
}
public function getColorNames(_arg1:Array):void{
var _local4:uint;
if (!_arg1){
return;
};
var _local2:int = _arg1.length;
var _local3:int;
while (_local3 < _local2) {
if (((!((_arg1[_local3] == null))) && (isNaN(_arg1[_local3])))){
_local4 = getColorName(_arg1[_local3]);
if (_local4 != StyleManager.NOT_A_COLOR){
_arg1[_local3] = _local4;
};
};
_local3++;
};
}
public function isInheritingTextFormatStyle(_arg1:String):Boolean{
return ((inheritingTextFormatStyles[_arg1] == true));
}
public function registerParentSizeInvalidatingStyle(_arg1:String):void{
parentSizeInvalidatingStyles[_arg1] = true;
}
public function registerColorName(_arg1:String, _arg2:uint):void{
colorNames[_arg1.toLowerCase()] = _arg2;
}
public function isParentSizeInvalidatingStyle(_arg1:String):Boolean{
return ((parentSizeInvalidatingStyles[_arg1] == true));
}
public function registerInheritingStyle(_arg1:String):void{
inheritingStyles[_arg1] = true;
}
public function set stylesRoot(_arg1:Object):void{
_stylesRoot = _arg1;
}
public function get typeSelectorCache():Object{
return (_typeSelectorCache);
}
public function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean{
return ((parentDisplayListInvalidatingStyles[_arg1] == true));
}
public function isSizeInvalidatingStyle(_arg1:String):Boolean{
return ((sizeInvalidatingStyles[_arg1] == true));
}
public function styleDeclarationsChanged():void{
var _local4:Object;
var _local1:Array = SystemManagerGlobals.topLevelSystemManagers;
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3];
_local4.regenerateStyleCache(true);
_local4.notifyStyleChangeInChildren(null, true);
_local3++;
};
}
public function isValidStyleValue(_arg1):Boolean{
return (!((_arg1 === undefined)));
}
public function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher{
return (loadStyleDeclarations2(_arg1, _arg2));
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void{
var _local4:IModuleInfo;
var _local3:StyleModuleInfo = styleModules[_arg1];
if (_local3){
_local3.styleModule.unload();
_local4 = _local3.module;
_local4.unload();
_local4.removeEventListener(ModuleEvent.READY, _local3.readyHandler);
_local4.removeEventListener(ModuleEvent.ERROR, _local3.errorHandler);
styleModules[_arg1] = null;
};
if (_arg2){
styleDeclarationsChanged();
};
}
public function getColorName(_arg1:Object):uint{
var _local2:Number;
var _local3:*;
if ((_arg1 is String)){
if (_arg1.charAt(0) == "#"){
_local2 = Number(("0x" + _arg1.slice(1)));
return ((isNaN(_local2)) ? StyleManager.NOT_A_COLOR : uint(_local2));
};
if ((((_arg1.charAt(1) == "x")) && ((_arg1.charAt(0) == "0")))){
_local2 = Number(_arg1);
return ((isNaN(_local2)) ? StyleManager.NOT_A_COLOR : uint(_local2));
};
_local3 = colorNames[_arg1.toLowerCase()];
if (_local3 === undefined){
return (StyleManager.NOT_A_COLOR);
};
return (uint(_local3));
};
return (uint(_arg1));
}
public function isInheritingStyle(_arg1:String):Boolean{
return ((inheritingStyles[_arg1] == true));
}
public function get stylesRoot():Object{
return (_stylesRoot);
}
public function initProtoChainRoots():void{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
delete _inheritingStyles["textDecoration"];
delete _inheritingStyles["leading"];
};
if (!stylesRoot){
stylesRoot = _selectors["global"].addStyleToProtoChain({}, null);
};
}
public function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher{
var module:IModuleInfo;
var styleEventDispatcher:StyleEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = _arg1;
var update = _arg2;
var applicationDomain = _arg3;
var securityDomain = _arg4;
module = ModuleManager.getModule(url);
var readyHandler:Function = function (_arg1:ModuleEvent):void{
var _local2:IStyleModule = IStyleModule(_arg1.module.factory.create());
styleModules[_arg1.module.url].styleModule = _local2;
if (update){
styleDeclarationsChanged();
};
};
module.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
styleEventDispatcher = new StyleEventDispatcher(module);
var errorHandler:Function = function (_arg1:ModuleEvent):void{
var _local3:StyleEvent;
var _local2:String = resourceManager.getString("styles", "unableToLoad", [_arg1.errorText, url]);
if (styleEventDispatcher.willTrigger(StyleEvent.ERROR)){
_local3 = new StyleEvent(StyleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local3.bytesLoaded = 0;
_local3.bytesTotal = 0;
_local3.errorText = _local2;
styleEventDispatcher.dispatchEvent(_local3);
} else {
throw (new Error(_local2));
};
};
module.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
styleModules[url] = new StyleModuleInfo(module, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (_arg1:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
module.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (styleEventDispatcher);
}
public function registerSizeInvalidatingStyle(_arg1:String):void{
sizeInvalidatingStyles[_arg1] = true;
}
public function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void{
var _local3:CSSStyleDeclaration = getStyleDeclaration(_arg1);
if (((_local3) && ((_local3.selectorRefCount > 0)))){
_local3.selectorRefCount--;
};
delete _selectors[_arg1];
if (_arg2){
styleDeclarationsChanged();
};
}
public function get selectors():Array{
var _local2:String;
var _local1:Array = [];
for (_local2 in _selectors) {
_local1.push(_local2);
};
return (_local1);
}
public static function getInstance():IStyleManager2{
if (!instance){
instance = new (StyleManagerImpl);
};
return (instance);
}
}
}//package mx.styles
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class StyleEventDispatcher extends EventDispatcher {
private function StyleEventDispatcher(_arg1:IModuleInfo){
_arg1.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
private function moduleInfo_readyHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.COMPLETE);
dispatchEvent(_local2);
}
private function moduleInfo_errorHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
_local2.errorText = _arg1.errorText;
dispatchEvent(_local2);
}
}
class StyleModuleInfo {
public var errorHandler:Function;
public var readyHandler:Function;
public var module:IModuleInfo;
public var styleModule:IStyleModule;
private function StyleModuleInfo(_arg1:IModuleInfo, _arg2:Function, _arg3:Function){
this.module = _arg1;
this.readyHandler = _arg2;
this.errorHandler = _arg3;
}
}
Section 179
//ColorUtil (mx.utils.ColorUtil)
package mx.utils {
import mx.core.*;
public class ColorUtil {
mx_internal static const VERSION:String = "3.0.0.0";
public static function adjustBrightness2(_arg1:uint, _arg2:Number):uint{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (_arg2 == 0){
return (_arg1);
};
if (_arg2 < 0){
_arg2 = ((100 + _arg2) / 100);
_local3 = (((_arg1 >> 16) & 0xFF) * _arg2);
_local4 = (((_arg1 >> 8) & 0xFF) * _arg2);
_local5 = ((_arg1 & 0xFF) * _arg2);
} else {
_arg2 = (_arg2 / 100);
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
_local3 = (_local3 + ((0xFF - _local3) * _arg2));
_local4 = (_local4 + ((0xFF - _local4) * _arg2));
_local5 = (_local5 + ((0xFF - _local5) * _arg2));
_local3 = Math.min(_local3, 0xFF);
_local4 = Math.min(_local4, 0xFF);
_local5 = Math.min(_local5, 0xFF);
};
return ((((_local3 << 16) | (_local4 << 8)) | _local5));
}
public static function rgbMultiply(_arg1:uint, _arg2:uint):uint{
var _local3:Number = ((_arg1 >> 16) & 0xFF);
var _local4:Number = ((_arg1 >> 8) & 0xFF);
var _local5:Number = (_arg1 & 0xFF);
var _local6:Number = ((_arg2 >> 16) & 0xFF);
var _local7:Number = ((_arg2 >> 8) & 0xFF);
var _local8:Number = (_arg2 & 0xFF);
return ((((((_local3 * _local6) / 0xFF) << 16) | (((_local4 * _local7) / 0xFF) << 8)) | ((_local5 * _local8) / 0xFF)));
}
public static function adjustBrightness(_arg1:uint, _arg2:Number):uint{
var _local3:Number = Math.max(Math.min((((_arg1 >> 16) & 0xFF) + _arg2), 0xFF), 0);
var _local4:Number = Math.max(Math.min((((_arg1 >> 8) & 0xFF) + _arg2), 0xFF), 0);
var _local5:Number = Math.max(Math.min(((_arg1 & 0xFF) + _arg2), 0xFF), 0);
return ((((_local3 << 16) | (_local4 << 8)) | _local5));
}
}
}//package mx.utils
Section 180
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.0.0.0";
public static function drawRoundRectComplex(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):void{
var _local10:Number = (_arg2 + _arg4);
var _local11:Number = (_arg3 + _arg5);
var _local12:Number = ((_arg4 < _arg5)) ? (_arg4 * 2) : (_arg5 * 2);
_arg6 = ((_arg6 < _local12)) ? _arg6 : _local12;
_arg7 = ((_arg7 < _local12)) ? _arg7 : _local12;
_arg8 = ((_arg8 < _local12)) ? _arg8 : _local12;
_arg9 = ((_arg9 < _local12)) ? _arg9 : _local12;
var _local13:Number = (_arg9 * 0.292893218813453);
var _local14:Number = (_arg9 * 0.585786437626905);
_arg1.moveTo(_local10, (_local11 - _arg9));
_arg1.curveTo(_local10, (_local11 - _local14), (_local10 - _local13), (_local11 - _local13));
_arg1.curveTo((_local10 - _local14), _local11, (_local10 - _arg9), _local11);
_local13 = (_arg8 * 0.292893218813453);
_local14 = (_arg8 * 0.585786437626905);
_arg1.lineTo((_arg2 + _arg8), _local11);
_arg1.curveTo((_arg2 + _local14), _local11, (_arg2 + _local13), (_local11 - _local13));
_arg1.curveTo(_arg2, (_local11 - _local14), _arg2, (_local11 - _arg8));
_local13 = (_arg6 * 0.292893218813453);
_local14 = (_arg6 * 0.585786437626905);
_arg1.lineTo(_arg2, (_arg3 + _arg6));
_arg1.curveTo(_arg2, (_arg3 + _local14), (_arg2 + _local13), (_arg3 + _local13));
_arg1.curveTo((_arg2 + _local14), _arg3, (_arg2 + _arg6), _arg3);
_local13 = (_arg7 * 0.292893218813453);
_local14 = (_arg7 * 0.585786437626905);
_arg1.lineTo((_local10 - _arg7), _arg3);
_arg1.curveTo((_local10 - _local14), _arg3, (_local10 - _local13), (_arg3 + _local13));
_arg1.curveTo(_local10, (_arg3 + _local14), _local10, (_arg3 + _arg7));
_arg1.lineTo(_local10, (_local11 - _arg9));
}
}
}//package mx.utils
Section 181
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 182
//StringUtil (mx.utils.StringUtil)
package mx.utils {
import mx.core.*;
public class StringUtil {
mx_internal static const VERSION:String = "3.0.0.0";
public static function trim(_arg1:String):String{
if (_arg1 == null){
return ("");
};
var _local2:int;
while (isWhitespace(_arg1.charAt(_local2))) {
_local2++;
};
var _local3:int = (_arg1.length - 1);
while (isWhitespace(_arg1.charAt(_local3))) {
_local3--;
};
if (_local3 >= _local2){
return (_arg1.slice(_local2, (_local3 + 1)));
};
return ("");
}
public static function isWhitespace(_arg1:String):Boolean{
switch (_arg1){
case " ":
case "\t":
case "\r":
case "\n":
case "\f":
return (true);
default:
return (false);
};
}
public static function substitute(_arg1:String, ... _args):String{
var _local4:Array;
if (_arg1 == null){
return ("");
};
var _local3:uint = _args.length;
if ((((_local3 == 1)) && ((_args[0] is Array)))){
_local4 = (_args[0] as Array);
_local3 = _local4.length;
} else {
_local4 = _args;
};
var _local5:int;
while (_local5 < _local3) {
_arg1 = _arg1.replace(new RegExp((("\\{" + _local5) + "\\}"), "g"), _local4[_local5]);
_local5++;
};
return (_arg1);
}
public static function trimArrayElements(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:int;
var _local5:int;
if (((!((_arg1 == ""))) && (!((_arg1 == null))))){
_local3 = _arg1.split(_arg2);
_local4 = _local3.length;
_local5 = 0;
while (_local5 < _local4) {
_local3[_local5] = StringUtil.trim(_local3[_local5]);
_local5++;
};
if (_local4 > 0){
_arg1 = _local3.join(_arg2);
};
};
return (_arg1);
}
}
}//package mx.utils
Section 183
//_activeButtonStyleStyle (_activeButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 184
//_activeTabStyleStyle (_activeTabStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeTabStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeTabStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeTabStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 185
//_alertButtonStyleStyle (_alertButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _alertButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".alertButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".alertButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 734012;
};
};
}
}
}//package
Section 186
//_comboDropdownStyle (_comboDropdownStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _comboDropdownStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".comboDropdown");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".comboDropdown", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.shadowDirection = "center";
this.fontWeight = "normal";
this.dropShadowEnabled = true;
this.leading = 0;
this.backgroundColor = 0xFFFFFF;
this.shadowDistance = 1;
this.cornerRadius = 0;
this.borderThickness = 0;
this.paddingLeft = 5;
this.paddingRight = 5;
};
};
}
}
}//package
Section 187
//_dataGridStylesStyle (_dataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dataGridStylesStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 188
//_dateFieldPopupStyle (_dateFieldPopupStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dateFieldPopupStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dateFieldPopup");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dateFieldPopup", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.dropShadowEnabled = true;
this.backgroundColor = 0xFFFFFF;
this.borderThickness = 0;
};
};
}
}
}//package
Section 189
//_errorTipStyle (_errorTipStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _errorTipStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".errorTip");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".errorTip", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.borderStyle = "errorTipRight";
this.paddingTop = 4;
this.borderColor = 13510953;
this.color = 0xFFFFFF;
this.fontSize = 9;
this.shadowColor = 0;
this.paddingLeft = 4;
this.paddingBottom = 4;
this.paddingRight = 4;
};
};
}
}
}//package
Section 190
//_globalStyle (_globalStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _globalStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("global");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("global", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fillColor = 0xFFFFFF;
this.kerning = false;
this.iconColor = 0x111111;
this.textRollOverColor = 2831164;
this.horizontalAlign = "left";
this.shadowCapColor = 14015965;
this.backgroundAlpha = 1;
this.filled = true;
this.textDecoration = "none";
this.roundedBottomCorners = true;
this.fontThickness = 0;
this.focusBlendMode = "normal";
this.fillColors = [0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE];
this.horizontalGap = 8;
this.borderCapColor = 9542041;
this.buttonColor = 7305079;
this.indentation = 17;
this.selectionDisabledColor = 0xDDDDDD;
this.closeDuration = 250;
this.embedFonts = false;
this.paddingTop = 0;
this.letterSpacing = 0;
this.focusAlpha = 0.4;
this.bevel = true;
this.fontSize = 10;
this.shadowColor = 0xEEEEEE;
this.borderAlpha = 1;
this.paddingLeft = 0;
this.fontWeight = "normal";
this.indicatorGap = 14;
this.focusSkin = HaloFocusRect;
this.dropShadowEnabled = false;
this.leading = 2;
this.borderSkin = HaloBorder;
this.fontSharpness = 0;
this.modalTransparencyDuration = 100;
this.borderThickness = 1;
this.backgroundSize = "auto";
this.borderStyle = "inset";
this.borderColor = 12040892;
this.fontAntiAliasType = "advanced";
this.errorColor = 0xFF0000;
this.shadowDistance = 2;
this.horizontalGridLineColor = 0xF7F7F7;
this.stroked = false;
this.modalTransparencyColor = 0xDDDDDD;
this.cornerRadius = 0;
this.verticalAlign = "top";
this.textIndent = 0;
this.fillAlphas = [0.6, 0.4, 0.75, 0.65];
this.verticalGridLineColor = 14015965;
this.themeColor = 40447;
this.version = "3.0.0";
this.shadowDirection = "center";
this.modalTransparency = 0.5;
this.repeatInterval = 35;
this.openDuration = 250;
this.textAlign = "left";
this.fontFamily = "Verdana";
this.textSelectedColor = 2831164;
this.paddingBottom = 0;
this.strokeWidth = 1;
this.fontGridFitType = "pixel";
this.horizontalGridLines = false;
this.useRollOver = true;
this.verticalGridLines = true;
this.repeatDelay = 500;
this.fontStyle = "normal";
this.dropShadowColor = 0;
this.focusThickness = 2;
this.verticalGap = 6;
this.disabledColor = 11187123;
this.paddingRight = 0;
this.focusRoundedCorners = "tl tr bl br";
this.borderSides = "left top right bottom";
this.disabledIconColor = 0x999999;
this.modalTransparencyBlur = 3;
this.color = 734012;
this.selectionDuration = 250;
this.highlightAlphas = [0.3, 0];
};
};
}
}
}//package
Section 191
//_headerDateTextStyle (_headerDateTextStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDateTextStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDateText");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDateText", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.textAlign = "center";
};
};
}
}
}//package
Section 192
//_headerDragProxyStyleStyle (_headerDragProxyStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDragProxyStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDragProxyStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDragProxyStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 193
//_linkButtonStyleStyle (_linkButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _linkButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".linkButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".linkButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.paddingLeft = 2;
this.paddingBottom = 2;
this.paddingRight = 2;
};
};
}
}
}//package
Section 194
//_opaquePanelStyle (_opaquePanelStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _opaquePanelStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".opaquePanel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".opaquePanel", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderColor = 0xFFFFFF;
this.backgroundColor = 0xFFFFFF;
this.headerColors = [0xE7E7E7, 0xD9D9D9];
this.footerColors = [0xE7E7E7, 0xC7C7C7];
this.borderAlpha = 1;
};
};
}
}
}//package
Section 195
//_plainStyle (_plainStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _plainStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".plain");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".plain", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 0;
this.backgroundColor = 0xFFFFFF;
this.backgroundImage = "";
this.horizontalAlign = "left";
this.paddingLeft = 0;
this.paddingBottom = 0;
this.paddingRight = 0;
};
};
}
}
}//package
Section 196
//_popUpMenuStyle (_popUpMenuStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _popUpMenuStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".popUpMenu");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".popUpMenu", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "normal";
this.textAlign = "left";
};
};
}
}
}//package
Section 197
//_richTextEditorTextAreaStyleStyle (_richTextEditorTextAreaStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _richTextEditorTextAreaStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".richTextEditorTextAreaStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".richTextEditorTextAreaStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 198
//_swatchPanelTextFieldStyle (_swatchPanelTextFieldStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _swatchPanelTextFieldStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".swatchPanelTextField");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".swatchPanelTextField", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderStyle = "inset";
this.borderColor = 14015965;
this.highlightColor = 12897484;
this.backgroundColor = 0xFFFFFF;
this.shadowCapColor = 14015965;
this.shadowColor = 14015965;
this.paddingLeft = 5;
this.buttonColor = 7305079;
this.borderCapColor = 9542041;
this.paddingRight = 5;
};
};
}
}
}//package
Section 199
//_textAreaHScrollBarStyleStyle (_textAreaHScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaHScrollBarStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaHScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaHScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 200
//_textAreaVScrollBarStyleStyle (_textAreaVScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaVScrollBarStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaVScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaVScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 201
//_todayStyleStyle (_todayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _todayStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".todayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".todayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0xFFFFFF;
this.textAlign = "center";
};
};
}
}
}//package
Section 202
//_weekDayStyleStyle (_weekDayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _weekDayStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".weekDayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".weekDayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.textAlign = "center";
};
};
}
}
}//package
Section 203
//_windowStatusStyle (_windowStatusStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStatusStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStatus");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStatus", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0x666666;
};
};
}
}
}//package
Section 204
//_windowStylesStyle (_windowStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStylesStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 205
//Bot (Bot)
package {
import flash.display.*;
import InGame.*;
public dynamic class Bot implements IGameSection {
private var first:Boolean;
private var adClip:MovieClip;
public function Bot(){
this.adClip = new MovieClip();
this.first = true;
}
public function update():IGameSection{
if (this.first){
this.first = false;
try {
MochiBot.track(this.adClip, "6c1834b8");
} catch(e:Error) {
trace(e.name, e.message);
};
};
return (new MainMenu());
}
public function draw():void{
}
public function keyUp(_arg1:uint):void{
}
public function keyDown(_arg1:uint):void{
}
public function visualUpdate(_arg1:int):void{
}
public function getGraphic():DisplayObject{
return (this.adClip);
}
public function mouseUp(_arg1:int, _arg2:int):void{
}
public function finished():void{
this.nextSection = new Game();
}
public function mouseDown(_arg1:int, _arg2:int):void{
}
}
}//package
Section 206
//ChooseDifficulty (ChooseDifficulty)
package {
import flash.events.*;
import flash.display.*;
import InGame.*;
public class ChooseDifficulty implements IGameSection {
private var holder:Sprite;
private var previousSection:IGameSection;
private var nextSection:IGameSection;
private var endless:Boolean;
private static const BG_CLASS:Class = ChooseDifficulty_BG_CLASS;
public function ChooseDifficulty(_arg1:IGameSection, _arg2:Boolean=false){
this.endless = _arg2;
this.previousSection = _arg1;
this.holder = new Sprite();
this.nextSection = this;
var _local3:CustomButton = new CustomButton("Play Hard Mode", 30);
_local3.x = ((Global.SCREEN_WIDTH - _local3.width) / 2);
_local3.y = 120;
this.holder.addChild(_local3);
var _local4:CustomButton = new CustomButton("Play Easy Mode", 24);
_local4.x = ((Global.SCREEN_WIDTH - _local4.width) / 2);
_local4.y = ((_local3.y + _local3.height) + 50);
this.holder.addChild(_local4);
var _local5:CustomButton = new CustomButton("Back", 24);
_local5.x = ((Global.SCREEN_WIDTH - _local5.width) / 2);
_local5.y = ((_local4.y + _local4.height) + 50);
this.holder.addChild(_local5);
var _local6:DisplayObject = new BG_CLASS();
_local6.x = ((Global.SCREEN_WIDTH - _local6.width) / 2);
this.holder.addChild(_local6);
_local3.addEventListener(MouseEvent.CLICK, onHardClick);
_local4.addEventListener(MouseEvent.CLICK, onEasyClick);
_local5.addEventListener(MouseEvent.CLICK, onBackClick);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
private function onBackClick(_arg1:Event):void{
this.nextSection = this.previousSection;
}
public function draw():void{
}
private function onEasyClick(_arg1:Event):void{
Config.easy = true;
this.nextSection = new Game(this.endless);
}
public function update():IGameSection{
return (this.nextSection);
}
public function mouseUp(_arg1:int, _arg2:int):void{
}
public function visualUpdate(_arg1:int):void{
}
public function mouseDown(_arg1:int, _arg2:int):void{
}
public function keyDown(_arg1:uint):void{
}
public function keyUp(_arg1:uint):void{
}
private function onHardClick(_arg1:Event):void{
Config.easy = false;
this.nextSection = new Game(this.endless);
}
}
}//package
Section 207
//ChooseDifficulty_BG_CLASS (ChooseDifficulty_BG_CLASS)
package {
import mx.core.*;
public class ChooseDifficulty_BG_CLASS extends BitmapAsset {
}
}//package
Section 208
//Config (Config)
package {
import flash.net.*;
public final class Config {
public static const POINTS_BOSS_3:int = 25000;
public static const POINTS_STANDARD:int = 100;
public static const POINTS_MOONINITES:int = 300;
public static const POINTS_MINE_LAYER:int = 300;
public static const POINTS_SPLITTER1:int = 150;
public static const POINTS_SPLITTER2:int = 200;
public static const SHARED_OBJECT_NAME:String = "ZORAK";
public static const POINTS_BOSS_1:int = 10000;
public static const POINTS_BOSS_2:int = 25000;
private static var soundOn_:Boolean = true;
private static var easy_:Boolean = false;
public static var startAtEndless:Boolean = false;
public static function set easy(_arg1:Boolean):void{
easy_ = _arg1;
}
public static function set endlessDiscovered(_arg1:Boolean):void{
var so:SharedObject;
var val = _arg1;
try {
so = SharedObject.getLocal(SHARED_OBJECT_NAME);
so.data.endlessDiscovered = val;
} catch(e:Error) {
trace(e.message);
};
}
public static function get easy():Boolean{
return (easy_);
}
public static function get soundOn():Boolean{
return (soundOn_);
}
public static function set soundOn(_arg1:Boolean):void{
var so:SharedObject;
var val = _arg1;
soundOn_ = val;
try {
so = SharedObject.getLocal(SHARED_OBJECT_NAME);
so.data.soundOn = soundOn_;
} catch(e:Error) {
trace(e.message);
};
}
public static function load():void{
var so:SharedObject;
try {
so = SharedObject.getLocal(SHARED_OBJECT_NAME);
if (so.data.hasOwnProperty("soundOn")){
trace("soundOn found in shared object");
soundOn_ = so.data.soundOn;
};
} catch(e:Error) {
trace(e.message);
};
}
public static function get endlessDiscovered():Boolean{
var so:SharedObject;
var discovered:Boolean;
try {
so = SharedObject.getLocal(SHARED_OBJECT_NAME);
if (so.data.hasOwnProperty("endlessDiscovered")){
trace("endlessDiscovered found in shared object");
discovered = so.data.endlessDiscovered;
};
} catch(e:Error) {
trace(e.message);
};
return (discovered);
}
}
}//package
Section 209
//CustomButton (CustomButton)
package {
import flash.events.*;
import flash.display.*;
public class CustomButton extends SimpleButton {
public function CustomButton(_arg1:String, _arg2:int, _arg3:Boolean=true){
var onMouseOver:Function;
var text = _arg1;
var size = _arg2;
var soundOn = _arg3;
super();
onMouseOver = function (_arg1:MouseEvent):void{
Sounds.play(Sounds.button);
};
this.upState = new TextButtonState(text, size, 0);
this.downState = new TextButtonState(text, size, 4991);
this.overState = new TextButtonState(text, size, 0x444444);
this.hitTestState = upState;
if (soundOn){
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
};
}
}
}//package
import flash.display.*;
import flash.text.*;
class TextButtonState extends Sprite {
private var tf:TextField;
private function TextButtonState(_arg1:String, _arg2:int, _arg3:uint=0){
var _local4:TextFormat = new TextFormat();
_local4.font = Fonts.DEFAULT_FONT;
_local4.size = _arg2;
this.tf = new TextField();
this.tf.selectable = false;
this.tf.embedFonts = true;
this.tf.textColor = _arg3;
this.tf.defaultTextFormat = _local4;
this.tf.antiAliasType = AntiAliasType.ADVANCED;
this.tf.sharpness = 200;
this.tf.autoSize = TextFieldAutoSize.LEFT;
this.tf.text = _arg1;
this.addChild(this.tf);
}
}
Section 210
//en_US$core_properties (en_US$core_properties)
package {
import mx.resources.*;
public class en_US$core_properties extends ResourceBundle {
public function en_US$core_properties(){
super("en_US", "core");
}
override protected function getContent():Object{
var _local1:Object = {multipleChildSets_ClassAndInstance:"Multiple sets of visual children have been specified for this component (component definition and component instance).", truncationIndicator:"...", notExecuting:"Repeater is not executing.", versionAlreadyRead:"Compatibility version has already been read.", multipleChildSets_ClassAndSubclass:"Multiple sets of visual children have been specified for this component (base component definition and derived component definition).", viewSource:"View Source", badFile:"File does not exist.", stateUndefined:"Undefined state '{0}'.", versionAlreadySet:"Compatibility version has already been set."};
return (_local1);
}
}
}//package
Section 211
//en_US$skins_properties (en_US$skins_properties)
package {
import mx.resources.*;
public class en_US$skins_properties extends ResourceBundle {
public function en_US$skins_properties(){
super("en_US", "skins");
}
override protected function getContent():Object{
var _local1:Object = {notLoaded:"Unable to load '{0}'."};
return (_local1);
}
}
}//package
Section 212
//en_US$styles_properties (en_US$styles_properties)
package {
import mx.resources.*;
public class en_US$styles_properties extends ResourceBundle {
public function en_US$styles_properties(){
super("en_US", "styles");
}
override protected function getContent():Object{
var _local1:Object = {unableToLoad:"Unable to load style({0}): {1}."};
return (_local1);
}
}
}//package
Section 213
//Fonts (Fonts)
package {
import flash.text.*;
public final class Fonts {
private static const defaultFontClass:Class = Fonts_defaultFontClass;
public static const DEFAULT_FONT:String = "_blockbit";
private static var fontsRegistered:Boolean = false;
public static function registerFonts():void{
if (!fontsRegistered){
fontsRegistered = true;
Font.registerFont(defaultFontClass);
};
}
}
}//package
Section 214
//Fonts_defaultFontClass (Fonts_defaultFontClass)
package {
import mx.core.*;
public class Fonts_defaultFontClass extends FontAsset {
}
}//package
Section 215
//FpsCounter (FpsCounter)
package {
import flash.display.*;
import flash.text.*;
public class FpsCounter extends Sprite {
private var tf:TextField;
private var average:Number;// = -1
private var frames:int;
private var time:int;
public function FpsCounter(){
this.frames = (this.time = 0);
this.tf = new TextField();
this.tf.autoSize = TextFieldAutoSize.LEFT;
this.tf.background = true;
this.tf.backgroundColor = 0;
this.tf.textColor = 0xFFFFFF;
this.tf.selectable = false;
this.tf.text = "-- FPS (-- avg)";
this.addChild(this.tf);
}
public function frameUpdate(_arg1:int):void{
var _local2:int;
this.time = (this.time + _arg1);
this.frames++;
if (this.time >= 1000){
_local2 = ((1000 * (1 + this.frames)) / this.time);
this.frames = (this.time = 0);
if (-1 != this.average){
this.average = (this.average + _local2);
this.average = (this.average / 2);
} else {
this.average = _local2;
};
this.tf.text = (((String(_local2) + " FPS (") + int(this.average)) + " avg)");
};
}
}
}//package
Section 216
//Global (Global)
package {
import flash.display.*;
public final class Global {
public static const MAX_FRAME_DELTA:int = 250;
public static const SCREEN_WIDTH:int = 640;
public static const VERSION_STRING:String = "V1.4";
public static const SCREEN_HEIGHT:int = 480;
public static const UPDATE_LENGTH:int = 20;
public static var stage:Stage = null;
}
}//package
Section 217
//IGameSection (IGameSection)
package {
public interface IGameSection extends IHasGraphic {
function update():IGameSection;
function keyDown(_arg1:uint):void;
function draw():void;
function mouseUp(_arg1:int, _arg2:int):void;
function visualUpdate(_arg1:int):void;
function keyUp(_arg1:uint):void;
function mouseDown(_arg1:int, _arg2:int):void;
}
}//package
Section 218
//IHasGraphic (IHasGraphic)
package {
import flash.display.*;
public interface IHasGraphic {
function getGraphic():DisplayObject;
}
}//package
Section 219
//LeaderBoard (LeaderBoard)
package {
import flash.display.*;
import mochi.*;
public class LeaderBoard implements IGameSection {
private var score:int;
private var holder:MovieClip;
private var nextSection:IGameSection;
private var first:Boolean;
public static const LEADERBOARD_ID:String = "fca86bf55084298d";
public function LeaderBoard(_arg1:int=-1){
this.score = _arg1;
this.holder = new MovieClip();
this.first = true;
this.nextSection = this;
}
public function update():IGameSection{
var _local1:String;
if (this.first){
this.first = false;
_local1 = ((Global.SCREEN_WIDTH + "x") + Global.SCREEN_HEIGHT);
if (-1 != this.score){
MochiScores.showLeaderboard({boardID:LEADERBOARD_ID, score:this.score, onClose:this.onClose, clip:this.holder, numScores:20, res:_local1, onError:this.onError});
} else {
MochiScores.showLeaderboard({boardID:LEADERBOARD_ID, onClose:this.onClose, clip:this.holder, numScores:20, res:_local1, onError:this.onError});
};
};
return (this.nextSection);
}
public function draw():void{
}
private function onClose():void{
this.nextSection = new MainMenu();
}
public function mouseUp(_arg1:int, _arg2:int):void{
}
public function keyDown(_arg1:uint):void{
}
private function onError(_arg1):void{
this.nextSection = new LeaderBoardError(this.score);
}
public function mouseDown(_arg1:int, _arg2:int):void{
}
public function visualUpdate(_arg1:int):void{
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function keyUp(_arg1:uint):void{
}
}
}//package
Section 220
//LeaderBoardError (LeaderBoardError)
package {
import flash.events.*;
import flash.display.*;
public class LeaderBoardError implements IGameSection {
private var holder:Sprite;
private var score:int;
private var nextSection:IGameSection;
public static const IMG_CLASS:Class = LeaderBoardError_IMG_CLASS;
public function LeaderBoardError(_arg1:int){
this.holder = new Sprite();
this.nextSection = this;
this.score = _arg1;
this.holder.addChild(new IMG_CLASS());
var _local2:CustomButton = new CustomButton("Retry", 24);
_local2.x = ((Global.SCREEN_WIDTH - _local2.width) / 2);
_local2.y = 140;
this.holder.addChild(_local2);
var _local3:CustomButton = new CustomButton("Main Menu", 24);
_local3.x = ((Global.SCREEN_WIDTH - _local3.width) / 2);
_local3.y = ((_local2.y + _local2.height) + 5);
this.holder.addChild(_local3);
_local2.addEventListener(MouseEvent.CLICK, retryClicked);
_local3.addEventListener(MouseEvent.CLICK, mainMenuClicked);
}
public function mouseUp(_arg1:int, _arg2:int):void{
}
public function visualUpdate(_arg1:int):void{
}
public function keyDown(_arg1:uint):void{
}
public function update():IGameSection{
return (this.nextSection);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function mouseDown(_arg1:int, _arg2:int):void{
}
private function mainMenuClicked(_arg1:Event):void{
this.nextSection = new MainMenu();
}
public function keyUp(_arg1:uint):void{
}
public function draw():void{
}
private function retryClicked(_arg1:Event):void{
this.nextSection = new LeaderBoard(this.score);
}
}
}//package
Section 221
//LeaderBoardError_IMG_CLASS (LeaderBoardError_IMG_CLASS)
package {
import mx.core.*;
public class LeaderBoardError_IMG_CLASS extends BitmapAsset {
}
}//package
Section 222
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.utils.*;
import mochi.*;
public dynamic class Main extends MovieClip {
private var lastTime:int;
private var section:IGameSection;
private var timeBank:int;
private var memTimer:Timer;
private var sectionHolder:Sprite;
private var fps:FpsCounter;
public static const MEMORY_REPORT_DELAY:int = 20000;
public static var GAME_OPTIONS:Object = {id:"ea9fd6981fb5d9b6", res:"640x480", no_bg:true, background:0xFFFFFF, outline:0, color:0};
public function Main(){
if (stage != null){
init(false);
};
}
private function onMouseUp(_arg1:MouseEvent):void{
this.section.mouseUp(_arg1.stageX, _arg1.stageY);
}
private function onKeyDown(_arg1:KeyboardEvent):void{
this.section.keyDown(_arg1.keyCode);
}
private function onMouseDown(_arg1:MouseEvent):void{
this.section.mouseDown(_arg1.stageX, _arg1.stageY);
}
private function memReport(_arg1:TimerEvent):void{
trace(((System.totalMemory / (0x0400 * 0x0400)) + "MB"));
}
private function onEnterFrame(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:IGameSection;
if (Global.stage){
if (Global.stage.focus){
if (Global.stage != Global.stage.focus){
if (!Global.stage.focus.root){
Global.stage.focus = Global.stage;
};
};
};
_local2 = getTimer();
_local3 = (_local2 - this.lastTime);
this.lastTime = _local2;
if (this.fps){
this.fps.frameUpdate(_local3);
};
if (_local3 > Global.MAX_FRAME_DELTA){
trace("Warning: Frame has exceeded maximum frame delta");
_local3 = Global.MAX_FRAME_DELTA;
};
this.timeBank = (this.timeBank + _local3);
if (this.timeBank > 0){
_local4 = false;
while (this.timeBank >= Global.UPDATE_LENGTH) {
this.timeBank = (this.timeBank - Global.UPDATE_LENGTH);
_local5 = this.section.update();
_local4 = true;
if (_local5 != this.section){
this.sectionHolder.removeChild(this.section.getGraphic());
this.sectionHolder.addChild(_local5.getGraphic());
this.section = _local5;
};
};
if (!_local4){
this.section.visualUpdate(this.timeBank);
};
};
this.section.draw();
} else {
if (this.stage){
trace("Added to stage");
this.onAddedToStage(null);
};
};
}
public function init(_arg1:Boolean):void{
var dummy:MovieClip;
var did_load = _arg1;
try {
dummy = new MovieClip();
MochiServices.connect("ea9fd6981fb5d9b6", dummy);
} catch(e:Error) {
trace(e.name, e.message);
};
Config.load();
Fonts.registerFonts();
Sounds.load();
this.sectionHolder = new Sprite();
this.addChild(this.sectionHolder);
var outline:Shape = new Shape();
outline.graphics.lineStyle(1, 0xDDDDDD);
outline.graphics.drawRect(0, 0, (640 - 1), (480 - 1));
this.addChild(outline);
this.timeBank = 0;
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(0, 0, Global.SCREEN_WIDTH, Global.SCREEN_HEIGHT);
this.memTimer = new Timer(MEMORY_REPORT_DELAY, 0);
this.memTimer.addEventListener(TimerEvent.TIMER, memReport);
this.memTimer.start();
}
private function onAddedToStage(_arg1:Event):void{
Global.stage = this.stage;
Global.stage.quality = StageQuality.HIGH;
this.lastTime = getTimer();
this.section = new Bot();
this.sectionHolder.addChild(this.section.getGraphic());
Global.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
Global.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
Global.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
Global.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
private function onKeyUp(_arg1:KeyboardEvent):void{
this.section.keyUp(_arg1.keyCode);
}
}
}//package
Section 223
//MainMenu (MainMenu)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import InGame.*;
import InGame.Enemies.*;
import flash.net.*;
import flash.ui.*;
import flash.filters.*;
public class MainMenu implements IGameSection {
private var soundOnButton:CustomButton;
private var enemies:Array;
private var holder:Sprite;
private var nextSection:IGameSection;
private var soundOffButton:CustomButton;
public static const TITLE_CLASS:Class = MainMenu_TITLE_CLASS;
public static const NUM_ENEMIES:int = 4;
public function MainMenu(){
var _local5:IEnemy;
super();
this.nextSection = this;
this.holder = new Sprite();
this.enemies = new Array();
var _local1:Game = new Game();
Mouse.show();
var _local2:BlurFilter = new BlurFilter();
var _local3:Sprite = new Sprite();
_local3.filters = [_local2];
var _local4:int;
while (_local4 < NUM_ENEMIES) {
_local5 = new EnemyStandard(_local1, null, -1, true);
this.enemies.push(_local5);
_local3.addChild(_local5.getGraphic());
_local4++;
};
_local3.addChild(new Bitmap(new BitmapData(Global.SCREEN_WIDTH, Global.SCREEN_HEIGHT, true, 2298478591)));
this.holder.addChild(_local3);
this.holder.addChild(new TITLE_CLASS());
this.addVersionText();
this.addButtons();
}
private function onStartGameButtonClicked(_arg1:Event):void{
this.nextSection = new ChooseDifficulty(this, false);
}
public function getGraphic():DisplayObject{
return (this.holder);
}
public function draw():void{
}
public function update():IGameSection{
var _local1:IEnemy;
var _local2:IGameSection;
for each (_local1 in this.enemies) {
_local1.update();
};
_local2 = this.nextSection;
this.nextSection = this;
return (_local2);
}
private function addVersionText():void{
var _local1:TextField = new TextField();
_local1.background = true;
_local1.backgroundColor = 0;
_local1.textColor = 0xFFFFFF;
_local1.autoSize = TextFieldAutoSize.LEFT;
_local1.text = Global.VERSION_STRING;
_local1.selectable = false;
_local1.x = 1;
_local1.y = ((Global.SCREEN_HEIGHT - _local1.textHeight) - 1);
this.holder.addChild(_local1);
}
public function keyUp(_arg1:uint):void{
}
private function onHighScoresButtonClicked(_arg1:Event):void{
this.nextSection = new LeaderBoard();
}
private function addButtons():void{
var homeButtonClick:Function;
homeButtonClick = function (_arg1:MouseEvent):void{
var e = _arg1;
try {
navigateToURL(new URLRequest("http://wayne-marsh.com/"));
} catch(e:Error) {
};
};
var maxButtonWidth:int;
var buttonsHolder:Sprite = new Sprite();
var startGameButton:CustomButton = new CustomButton("Start Game", 30);
startGameButton.addEventListener(MouseEvent.CLICK, this.onStartGameButtonClicked);
maxButtonWidth = Math.max(startGameButton.width, maxButtonWidth);
buttonsHolder.addChild(startGameButton);
var startEndlessButton:CustomButton = new CustomButton("Start Game on Endless Level", 20);
startEndlessButton.addEventListener(MouseEvent.CLICK, this.onStartEndlessButtonClicked);
if (Config.endlessDiscovered){
maxButtonWidth = Math.max(startEndlessButton.width, maxButtonWidth);
buttonsHolder.addChild(startEndlessButton);
};
var highScoresButton:CustomButton = new CustomButton("View High Scores", 20);
highScoresButton.addEventListener(MouseEvent.CLICK, this.onHighScoresButtonClicked);
maxButtonWidth = Math.max(highScoresButton.width, maxButtonWidth);
buttonsHolder.addChild(highScoresButton);
soundOnButton = new CustomButton("Turn Sound On", 20);
soundOnButton.addEventListener(MouseEvent.CLICK, this.onSoundOnButtonClicked);
maxButtonWidth = Math.max(soundOnButton.width, maxButtonWidth);
buttonsHolder.addChild(soundOnButton);
soundOffButton = new CustomButton("Turn Sound Off", 20);
soundOffButton.addEventListener(MouseEvent.CLICK, this.onSoundOffButtonClicked);
maxButtonWidth = Math.max(soundOffButton.width, maxButtonWidth);
buttonsHolder.addChild(soundOffButton);
startGameButton.x = ((maxButtonWidth - startGameButton.width) / 2);
startGameButton.y = 0;
startEndlessButton.x = ((maxButtonWidth - startEndlessButton.width) / 2);
startEndlessButton.y = ((startGameButton.y + startGameButton.height) + 5);
highScoresButton.x = ((maxButtonWidth - highScoresButton.width) / 2);
highScoresButton.y = ((startEndlessButton.y + startEndlessButton.height) + 5);
soundOnButton.x = ((maxButtonWidth - soundOnButton.width) / 2);
soundOnButton.y = ((highScoresButton.y + highScoresButton.height) + 5);
soundOffButton.x = ((maxButtonWidth - soundOffButton.width) / 2);
soundOffButton.y = ((highScoresButton.y + highScoresButton.height) + 5);
buttonsHolder.x = ((Global.SCREEN_WIDTH - maxButtonWidth) / 2);
buttonsHolder.y = 120;
this.holder.addChild(buttonsHolder);
this.soundOffButton.visible = Config.soundOn;
this.soundOnButton.visible = !(Config.soundOn);
var homeButton:CustomButton = new CustomButton("http://wayne-marsh.com/", 12);
homeButton.x = ((Global.SCREEN_WIDTH - homeButton.width) - 1);
homeButton.y = ((Global.SCREEN_HEIGHT - homeButton.height) - 1);
homeButton.addEventListener(MouseEvent.MOUSE_UP, homeButtonClick);
this.holder.addChild(homeButton);
}
public function keyDown(_arg1:uint):void{
}
public function visualUpdate(_arg1:int):void{
var _local2:IEnemy;
for each (_local2 in this.enemies) {
_local2.visualUpdate(_arg1);
};
}
private function onSoundOnButtonClicked(_arg1:Event):void{
this.soundOffButton.visible = true;
this.soundOnButton.visible = false;
Config.soundOn = true;
}
public function mouseDown(_arg1:int, _arg2:int):void{
}
public function mouseUp(_arg1:int, _arg2:int):void{
}
private function onSoundOffButtonClicked(_arg1:Event):void{
this.soundOffButton.visible = false;
this.soundOnButton.visible = true;
Config.soundOn = false;
}
private function onStartEndlessButtonClicked(_arg1:Event):void{
this.nextSection = new ChooseDifficulty(this, true);
}
}
}//package
Section 224
//MainMenu_TITLE_CLASS (MainMenu_TITLE_CLASS)
package {
import mx.core.*;
public class MainMenu_TITLE_CLASS extends BitmapAsset {
}
}//package
Section 225
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.1");
}
public static function showTimedAd(_arg1:Object):void{
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var mc:MovieClip;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
_arg1.removeChild(_arg1._mochiad);
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
_local3 = true;
};
};
};
if ((((_local2 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var mc:MovieClip;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
var DEFAULTS:Object = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
var clip:Object = options.clip;
var clipname:String = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
var server:String = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
var depth:Number = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
var lv:URLVariables = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
_arg1 = parseInt(_arg1.toString());
var _local3:Array = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
var _local4:Array = [];
var _local5:Number = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
var _local6:Object = _local3[1];
var _local7:Object = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local5:Array;
mc._endpoint = _arg1;
var _local2:Array = mc._queue;
delete mc._queue;
var _local3:Function = mc.doSend;
var _local4:Number = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
var _local5:Number = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
var _local6:LocalConnection = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
this.clip.stop();
}, ad_finished:function ():void{
this.clip.play();
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var f:Function = function (_arg1:Event):void{
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local11:Number;
if (!this.parent.parent){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
var _local7:Number = ((100 * _local6) / _local5);
var _local8:Number = ((100 * _local3) / chk.ad_msec);
var _local9:Object = this._mochiad_bar._inside;
var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
_local4 = true;
};
};
};
if ((((_local3 > chk.ad_msec)) || (this.parent._mochiad_ctr_failed))){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
mc.removeEventListener(Event.ENTER_FRAME, f);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 226
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var self:MochiBot;
var server:String;
var lv:URLVariables;
var url:String;
var req:URLRequest;
var loader:Loader;
var parent = _arg1;
var tag = _arg2;
try {
if (Security.sandboxType == "localWithFile"){
return (null);
};
self = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
server = "http://core.mochibot.com/my/core.swf";
lv = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
url = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
req = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
self.addChild(loader);
loader.load(req);
} catch(e:Error) {
trace(e.message);
};
return (self);
}
}
}//package
Section 227
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public dynamic class Preloader extends MovieClip {
private var did_load:Boolean;
public static var GAME_OPTIONS:Object = {id:"ea9fd6981fb5d9b6", res:"640x480", no_bg:true, background:0xFFFFFF, outline:0, color:0};
public static var MAIN_CLASS:String = "Main";
public function Preloader(){
var k:String;
super();
var bg:Shape = new Shape();
bg.graphics.beginFill(0xFFFFFF);
bg.graphics.drawRect(0, 0, 640, 480);
var outline:Shape = new Shape();
outline.graphics.lineStyle(1, 0xDDDDDD);
outline.graphics.drawRect(0, 0, (640 - 1), (480 - 1));
this.addChild(bg);
this.addChild(outline);
var f:Function = function (_arg1:IOErrorEvent):void{
};
loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
var opts:Object = {};
for (k in GAME_OPTIONS) {
opts[k] = GAME_OPTIONS[k];
};
opts.ad_started = function ():void{
did_load = true;
};
opts.ad_finished = function ():void{
var _local1:Class = Class(getDefinitionByName(MAIN_CLASS));
var _local2:Object = new (_local1);
parent.addChild((_local2 as DisplayObject));
if (_local2.init){
_local2.init(did_load);
};
};
opts.clip = this;
MochiAd.showPreGameAd(opts);
}
}
}//package
Section 228
//Sounds (Sounds)
package {
import flash.media.*;
import flash.utils.*;
public final class Sounds {
private static const BUTTON_CLASS:Class = Sounds_BUTTON_CLASS;
private static const EXPLODE_2_CLASS:Class = Sounds_EXPLODE_2_CLASS;
private static const MOONINITE_DIE_CLASS:Class = Sounds_MOONINITE_DIE_CLASS;
private static const SHOOT_CLASS:Class = Sounds_SHOOT_CLASS;
private static const FADE_IN_CLASS:Class = Sounds_FADE_IN_CLASS;
private static const HURT_1_CLASS:Class = Sounds_HURT_1_CLASS;
private static const SNAKE_1_CLASS:Class = Sounds_SNAKE_1_CLASS;
private static const SNAKE_3_CLASS:Class = Sounds_SNAKE_3_CLASS;
private static const LIGHT_CHANGE_CLASS:Class = Sounds_LIGHT_CHANGE_CLASS;
private static const ERROR_CLASS:Class = Sounds_ERROR_CLASS;
private static const LASER_CLASS:Class = Sounds_LASER_CLASS;
private static const HURT_3_CLASS:Class = Sounds_HURT_3_CLASS;
private static const EXPLODE_1_CLASS:Class = Sounds_EXPLODE_1_CLASS;
private static const EXPLODE_3_CLASS:Class = Sounds_EXPLODE_3_CLASS;
private static const QUAD_LASER_CLASS:Class = Sounds_QUAD_LASER_CLASS;
private static const POWER_UP_COLLECT_CLASS:Class = Sounds_POWER_UP_COLLECT_CLASS;
private static const HURT_2_CLASS:Class = Sounds_HURT_2_CLASS;
private static const AVATAR_DEAD_CLASS:Class = Sounds_AVATAR_DEAD_CLASS;
private static const STRONG_HIT_CLASS:Class = Sounds_STRONG_HIT_CLASS;
private static const SNAKE_2_CLASS:Class = Sounds_SNAKE_2_CLASS;
private static const MOONINITE_FADE_IN_CLASS:Class = Sounds_MOONINITE_FADE_IN_CLASS;
private static const POWER_UP_APPEAR_CLASS:Class = Sounds_POWER_UP_APPEAR_CLASS;
public static var snake1:Sound;
public static var hurt2:Sound;
public static var powerUpCollect:Sound;
public static var hurt1:Sound;
public static var hurt3:Sound;
public static var strongHit:Sound;
public static var shoot:Sound;
public static var error:Sound;
public static var powerUpAppear:Sound;
public static var button:Sound;
public static var laser:Sound;
public static var fadeIn:Sound;
public static var mooniniteFadeIn:Sound;
private static var lastTimes:Array;
public static var quadLaser:Sound;
public static var avatarDead:Sound;
public static var lightChange:Sound;
public static var explode2:Sound;
public static var explode3:Sound;
public static var explode1:Sound;
public static var snake2:Sound;
public static var snake3:Sound;
public static var mooniniteDie:Sound;
private static var hurts:Array;
private static var explosions:Array;
public static function playHurt():void{
var _local1:int = Math.floor((Math.random() * hurts.length));
play(hurts[_local1]);
}
public static function playExplosion():void{
var _local1:int = Math.floor((Math.random() * explosions.length));
play(explosions[_local1]);
}
public static function play(_arg1:Sound):void{
var _local2:int;
var _local3:int;
if (Config.soundOn){
if (lastTimes[_arg1]){
_local2 = lastTimes[_arg1];
_local3 = getTimer();
if ((_local3 - _local2) <= Global.UPDATE_LENGTH){
return;
};
};
lastTimes[_arg1] = getTimer();
_arg1.play();
};
}
public static function load():void{
lastTimes = new Array();
shoot = new SHOOT_CLASS();
laser = new LASER_CLASS();
fadeIn = new FADE_IN_CLASS();
avatarDead = new AVATAR_DEAD_CLASS();
lightChange = new LIGHT_CHANGE_CLASS();
explode1 = new EXPLODE_1_CLASS();
explode2 = new EXPLODE_2_CLASS();
explode3 = new EXPLODE_3_CLASS();
snake1 = new SNAKE_1_CLASS();
snake2 = new SNAKE_2_CLASS();
snake3 = new SNAKE_3_CLASS();
powerUpAppear = new POWER_UP_APPEAR_CLASS();
powerUpCollect = new POWER_UP_COLLECT_CLASS();
hurt1 = new HURT_1_CLASS();
hurt2 = new HURT_2_CLASS();
hurt3 = new HURT_3_CLASS();
strongHit = new STRONG_HIT_CLASS();
mooniniteDie = new MOONINITE_DIE_CLASS();
quadLaser = new QUAD_LASER_CLASS();
mooniniteFadeIn = new MOONINITE_FADE_IN_CLASS();
error = new ERROR_CLASS();
button = new BUTTON_CLASS();
explosions = [explode1, explode2, explode3];
hurts = [hurt1, hurt2, hurt3];
}
}
}//package
Section 229
//Sounds_AVATAR_DEAD_CLASS (Sounds_AVATAR_DEAD_CLASS)
package {
import mx.core.*;
public class Sounds_AVATAR_DEAD_CLASS extends SoundAsset {
}
}//package
Section 230
//Sounds_BUTTON_CLASS (Sounds_BUTTON_CLASS)
package {
import mx.core.*;
public class Sounds_BUTTON_CLASS extends SoundAsset {
}
}//package
Section 231
//Sounds_ERROR_CLASS (Sounds_ERROR_CLASS)
package {
import mx.core.*;
public class Sounds_ERROR_CLASS extends SoundAsset {
}
}//package
Section 232
//Sounds_EXPLODE_1_CLASS (Sounds_EXPLODE_1_CLASS)
package {
import mx.core.*;
public class Sounds_EXPLODE_1_CLASS extends SoundAsset {
}
}//package
Section 233
//Sounds_EXPLODE_2_CLASS (Sounds_EXPLODE_2_CLASS)
package {
import mx.core.*;
public class Sounds_EXPLODE_2_CLASS extends SoundAsset {
}
}//package
Section 234
//Sounds_EXPLODE_3_CLASS (Sounds_EXPLODE_3_CLASS)
package {
import mx.core.*;
public class Sounds_EXPLODE_3_CLASS extends SoundAsset {
}
}//package
Section 235
//Sounds_FADE_IN_CLASS (Sounds_FADE_IN_CLASS)
package {
import mx.core.*;
public class Sounds_FADE_IN_CLASS extends SoundAsset {
}
}//package
Section 236
//Sounds_HURT_1_CLASS (Sounds_HURT_1_CLASS)
package {
import mx.core.*;
public class Sounds_HURT_1_CLASS extends SoundAsset {
}
}//package
Section 237
//Sounds_HURT_2_CLASS (Sounds_HURT_2_CLASS)
package {
import mx.core.*;
public class Sounds_HURT_2_CLASS extends SoundAsset {
}
}//package
Section 238
//Sounds_HURT_3_CLASS (Sounds_HURT_3_CLASS)
package {
import mx.core.*;
public class Sounds_HURT_3_CLASS extends SoundAsset {
}
}//package
Section 239
//Sounds_LASER_CLASS (Sounds_LASER_CLASS)
package {
import mx.core.*;
public class Sounds_LASER_CLASS extends SoundAsset {
}
}//package
Section 240
//Sounds_LIGHT_CHANGE_CLASS (Sounds_LIGHT_CHANGE_CLASS)
package {
import mx.core.*;
public class Sounds_LIGHT_CHANGE_CLASS extends SoundAsset {
}
}//package
Section 241
//Sounds_MOONINITE_DIE_CLASS (Sounds_MOONINITE_DIE_CLASS)
package {
import mx.core.*;
public class Sounds_MOONINITE_DIE_CLASS extends SoundAsset {
}
}//package
Section 242
//Sounds_MOONINITE_FADE_IN_CLASS (Sounds_MOONINITE_FADE_IN_CLASS)
package {
import mx.core.*;
public class Sounds_MOONINITE_FADE_IN_CLASS extends SoundAsset {
}
}//package
Section 243
//Sounds_POWER_UP_APPEAR_CLASS (Sounds_POWER_UP_APPEAR_CLASS)
package {
import mx.core.*;
public class Sounds_POWER_UP_APPEAR_CLASS extends SoundAsset {
}
}//package
Section 244
//Sounds_POWER_UP_COLLECT_CLASS (Sounds_POWER_UP_COLLECT_CLASS)
package {
import mx.core.*;
public class Sounds_POWER_UP_COLLECT_CLASS extends SoundAsset {
}
}//package
Section 245
//Sounds_QUAD_LASER_CLASS (Sounds_QUAD_LASER_CLASS)
package {
import mx.core.*;
public class Sounds_QUAD_LASER_CLASS extends SoundAsset {
}
}//package
Section 246
//Sounds_SHOOT_CLASS (Sounds_SHOOT_CLASS)
package {
import mx.core.*;
public class Sounds_SHOOT_CLASS extends SoundAsset {
}
}//package
Section 247
//Sounds_SNAKE_1_CLASS (Sounds_SNAKE_1_CLASS)
package {
import mx.core.*;
public class Sounds_SNAKE_1_CLASS extends SoundAsset {
}
}//package
Section 248
//Sounds_SNAKE_2_CLASS (Sounds_SNAKE_2_CLASS)
package {
import mx.core.*;
public class Sounds_SNAKE_2_CLASS extends SoundAsset {
}
}//package
Section 249
//Sounds_SNAKE_3_CLASS (Sounds_SNAKE_3_CLASS)
package {
import mx.core.*;
public class Sounds_SNAKE_3_CLASS extends SoundAsset {
}
}//package
Section 250
//Sounds_STRONG_HIT_CLASS (Sounds_STRONG_HIT_CLASS)
package {
import mx.core.*;
public class Sounds_STRONG_HIT_CLASS extends SoundAsset {
}
}//package