Section 1
//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 2
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 3
//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 4
//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 5
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 6
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 7
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 8
//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 9
//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 10
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipAsset(){
_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 11
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipLoaderAsset(){
var _local1:LoaderContext = new LoaderContext();
_local1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in _local1)){
_local1["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, _local1);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(_arg1:Number):void{
if (!initialized){
requestedWidth = _arg1;
} else {
loader.width = _arg1;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(_arg1:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(_arg1);
}
override public function set height(_arg1:Number):void{
if (!initialized){
requestedHeight = _arg1;
} else {
loader.height = _arg1;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 12
//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 13
//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 14
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
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 15
//ArmorButton (ArmorButton)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class ArmorButton extends Sprite {
private var logoClass:Class;
private var logoDisplayObject:DisplayObject;
public function ArmorButton(_arg1:Number=0){
logoClass = ArmorButton_logoClass;
logoDisplayObject = new logoClass();
super();
if (_arg1 > 0){
graphics.lineStyle(0, _arg1);
};
graphics.beginFill(0xFFFFFF);
graphics.drawRect(0, 0, (logoDisplayObject.width + (2 * _arg1)), (logoDisplayObject.height + (2 * _arg1)));
graphics.endFill();
addChild(logoDisplayObject);
logoDisplayObject.x = _arg1;
logoDisplayObject.y = _arg1;
buttonMode = true;
addEventListener(MouseEvent.CLICK, onGetMoreGames);
}
private function onGetMoreGames(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://ArmorGames.com/"), "_blank");
}
}
}//package
Section 16
//ArmorButton_logoClass (ArmorButton_logoClass)
package {
import mx.core.*;
public class ArmorButton_logoClass extends BitmapAsset {
}
}//package
Section 17
//Background (Background)
package {
import flash.geom.*;
import flash.display.*;
public class Background extends Sprite {
public function Background(){
graphics.beginFill(0);
graphics.drawRect(0, 0, (C.FRAME_WIDTH + 10), (C.FRAME_HEIGHT + 10));
graphics.endFill();
x = -5;
y = -5;
transform.colorTransform = new ColorTransform();
}
public function update():void{
transform.colorTransform = U.easeTransform(transform.colorTransform, H.C[0], 0.07, 2);
}
}
}//package
Section 18
//BackgroundBlock (BackgroundBlock)
package {
import flash.geom.*;
public class BackgroundBlock extends CameraSprite {
public function BackgroundBlock(_arg1:Point){
this.worldPoint = _arg1;
cameraRect = new Rectangle((-(C.BACKGROUND_RECTANGLE_SIZE) / 2), (-(C.BACKGROUND_RECTANGLE_SIZE) / 2), C.BACKGROUND_RECTANGLE_SIZE, C.BACKGROUND_RECTANGLE_SIZE);
graphics.beginFill(0xFFFFFF);
graphics.drawCircle(0, 0, (C.BACKGROUND_RECTANGLE_SIZE / 2));
graphics.endFill();
transform.colorTransform = H.C[1];
}
public function update(_arg1:Point):void{
var _local2:Number;
if (onCamera){
_local2 = (Math.abs((_arg1.x - worldPoint.x)) + Math.abs((_arg1.y - worldPoint.y)));
if (_local2 < C.BACKGROUND_MIN_DISTANCE){
scaleX = U.ease(scaleX, (C.BACKGROUND_MIN_SCALE + (((1 - C.BACKGROUND_MIN_SCALE) * (C.BACKGROUND_MIN_DISTANCE - _local2)) / C.BACKGROUND_MIN_DISTANCE)), C.BACKGROUND_SCALE_EASE, C.BACKGROUND_SCALE_TOLERANCE);
} else {
scaleX = U.ease(scaleX, C.BACKGROUND_MIN_SCALE, C.BACKGROUND_SCALE_EASE, C.BACKGROUND_SCALE_TOLERANCE);
};
scaleY = scaleX;
};
transform.colorTransform = U.easeTransform(transform.colorTransform, H.C[1], 0.05, 2);
}
}
}//package
Section 19
//BackgroundGroup (BackgroundGroup)
package {
import flash.geom.*;
public class BackgroundGroup {
public var backgroundBlocks:Array;
private var camera:Camera;
public function BackgroundGroup(_arg1:Camera){
var _local2:int;
var _local3:int;
var _local4:BackgroundBlock;
super();
this.camera = _arg1;
backgroundBlocks = new Array();
_local2 = 0;
while (_local2 < C.BACKGROUND_NUM_SIDE) {
_local3 = 0;
while (_local3 < C.BACKGROUND_NUM_SIDE) {
_local4 = new BackgroundBlock(new Point((C.BACKGROUND_CORNER.x + (_local2 * C.BACKGROUND_GAP)), (C.BACKGROUND_CORNER.y + (_local3 * C.BACKGROUND_GAP))));
backgroundBlocks.push(_local4);
_arg1.addSprite(_local4);
_local3++;
};
_local2++;
};
}
public function update(_arg1:Point):void{
var _local2:int;
while (_local2 < backgroundBlocks.length) {
backgroundBlocks[_local2].update(_arg1);
_local2++;
};
}
}
}//package
Section 20
//Bars (Bars)
package {
import flash.display.*;
public class Bars extends Sprite {
public function Bars(){
x = 0;
y = 0;
var _local1:Number = Math.ceil(((C.FRAME_HEIGHT - C.HEIGHT) / 2));
graphics.beginFill(0);
graphics.drawRect(-10, -5, (C.WIDTH + 20), (_local1 + 6));
graphics.drawRect(-10, ((C.FRAME_HEIGHT - _local1) - 1), (C.WIDTH + 20), (_local1 + 6));
graphics.endFill();
}
}
}//package
Section 21
//BorderBlock (BorderBlock)
package {
import flash.geom.*;
public class BorderBlock extends CameraSprite {
private var borderGroup:BorderGroup;
private var transformEase:Number;
public function BorderBlock(_arg1:Point, _arg2:BorderGroup){
this.borderGroup = _arg2;
this.worldPoint = _arg1;
transformEase = U.randRange(C.BORDER_COLOR_EASE_MIN, C.BORDER_COLOR_EASE_MAX);
cameraRect = new Rectangle((-(C.BORDER_SIDE) / 2), (-(C.BORDER_SIDE) / 2), C.BORDER_SIDE, C.BORDER_SIDE);
graphics.beginFill(0xFFFFFF);
graphics.drawRect((-(C.BORDER_SIDE) / 2), (-(C.BORDER_SIDE) / 2), C.BORDER_SIDE, C.BORDER_SIDE);
graphics.endFill();
transform.colorTransform = H.C[3];
}
public function update(_arg1:Point, _arg2:Boolean):void{
var _local3:Number;
if (onCamera){
_local3 = (Math.abs((_arg1.x - worldPoint.x)) + Math.abs((_arg1.y - worldPoint.y)));
if (((_arg2) && ((_local3 < C.BORDER_DISTANCE)))){
scaleX = U.ease(scaleX, (C.BORDER_MIN_SCALE + (((1 - C.BORDER_MIN_SCALE) * (C.BORDER_DISTANCE - _local3)) / C.BORDER_DISTANCE)), C.BORDER_SCALE_EASE, C.BORDER_SCALE_TOLERANCE);
} else {
scaleX = U.ease(scaleX, C.BORDER_MIN_SCALE, C.BORDER_SCALE_EASE, C.BORDER_SCALE_TOLERANCE);
};
} else {
scaleX = 1;
};
scaleY = scaleX;
transform.colorTransform = U.easeTransform(transform.colorTransform, H.C[3], transformEase, 2);
}
}
}//package
Section 22
//BorderGroup (BorderGroup)
package {
import flash.geom.*;
public class BorderGroup {
public var borderBlocks:Array;
public function BorderGroup(_arg1:Camera){
var _local2:int;
var _local3:BorderBlock;
var _local4:BorderBlock;
var _local5:BorderBlock;
var _local6:BorderBlock;
super();
borderBlocks = new Array();
_local2 = 0;
while (_local2 < C.BORDER_NUM_SIDE) {
_local3 = new BorderBlock(new Point(((C.BORDER_SIDE / 2) + (_local2 * C.BORDER_SIDE)), (C.BORDER_SIDE / 2)), this);
_local4 = new BorderBlock(new Point(((C.BORDER_SIDE / 2) + (_local2 * C.BORDER_SIDE)), (C.WORLD_SIDE - (C.BORDER_SIDE / 2))), this);
_arg1.addSprite(_local3);
_arg1.addSprite(_local4);
borderBlocks.push(_local3);
borderBlocks.push(_local4);
_local2++;
};
_local2 = 0;
while (_local2 < (C.BORDER_NUM_SIDE - 2)) {
_local5 = new BorderBlock(new Point((C.BORDER_SIDE / 2), (((3 * C.BORDER_SIDE) / 2) + (_local2 * C.BORDER_SIDE))), this);
_local6 = new BorderBlock(new Point((C.WORLD_SIDE - (C.BORDER_SIDE / 2)), (((3 * C.BORDER_SIDE) / 2) + (_local2 * C.BORDER_SIDE))), this);
_arg1.addSprite(_local5);
_arg1.addSprite(_local6);
borderBlocks.push(_local5);
borderBlocks.push(_local6);
_local2++;
};
}
public function update(_arg1:Point, _arg2:Boolean):void{
var _local3:int;
while (_local3 < borderBlocks.length) {
borderBlocks[_local3].update(_arg1, _arg2);
_local3++;
};
}
public function highlight():void{
var _local1:int;
while (_local1 < borderBlocks.length) {
borderBlocks[_local1].transform.colorTransform = H.C[4];
_local1++;
};
}
}
}//package
Section 23
//C (C)
package {
import flash.geom.*;
public class C {
public static const BACKGROUND_MAX_DISTANCE:Number = 1600;
public static const WORLD_SIDE:Number = 1000;
public static const BORDER_SCALE_TOLERANCE:Number = 0.01;
public static const KEY_CODES:Array = [K_LEFT, K_UP, K_RIGHT, K_DOWN, K_SPACE, K_A, K_W, K_D, K_S];
public static const BACKGROUND_SCALE_TOLERANCE:Number = 0.01;
public static const CAMERA_BOUNDS:Rectangle = new Rectangle(HALF_WIDTH, HALF_HEIGHT, (WORLD_SIDE - WIDTH), (WORLD_SIDE - HEIGHT));
public static const K_UP:int = 38;
public static const K_RIGHT:int = 39;
public static const PLAYER_STROKE_COLOR:uint = 0xFFFFFF;
public static const K_DOWN:int = 40;
public static const PLAYER_RIGHT:Point = new Point(PLAYER_V, 0);
public static const HEIGHT:Number = 442;
public static const BACKGROUND_RECTANGLE_SIZE:Number = 100;
public static const BACKGROUND_MIN_SCALE:Number = 0;
public static const FRAME_WIDTH:Number = 590;
public static const BACKGROUND_GAP:Number = 100;
public static const PLAYER_DOWN:Point = new Point(0, PLAYER_V);
public static const K_A:int = 65;
public static const BORDER_NUM_SIDE:int = 30;
public static const CAMERA_TOLERANCE:Number = 0.01;
public static const K_D:int = 68;
public static const FRAME_HEIGHT:Number = 590;
public static const BORDER_COLOR_EASE_MIN:Number = 0.02;
public static const BORDER_COLOR_EASE_MAX:Number = 0.1;
public static const K_W:int = 87;
public static const K_S:int = 83;
public static const PLAYER_V:Number = 5;
public static const K_LEFT:int = 37;
public static const PLAYER_STROKE_WIDTH:Number = 1;
public static const BACKGROUND_NUM_SIDE:int = 8;
public static const BACKGROUND_FACTOR:Number = 0;
public static const BORDER_MIN_SCALE:Number = 0.2;
public static const BACKGROUND_CORNER:Point = new Point((BACKGROUND_GAP / 2), (BACKGROUND_GAP / 2));
public static const BORDER_SIDE:Number = 33;
public static const FRAME_RATE:int = 40;
public static const BACKGROUND_SCALE_EASE:Number = 0.1;
public static const HALF_WIDTH:Number = 295;
public static const PLAYER_FILL_COLOR:uint = 0;
public static const WIDTH:Number = 590;
public static const BORDER_DISTANCE:Number = 100;
public static const PLAYER_LEFT:Point = new Point(-(PLAYER_V), 0);
public static const PLAYER_RADIUS:Number = 16;
public static const HALF_HEIGHT:Number = 221;
public static const PLAYER_STROKE_MARGIN:Number = 4;
public static const PLAYER_UP:Point = new Point(0, -(PLAYER_V));
public static const CAMERA_EASE:Number = 0.1;
public static const BACKGROUND_SIDE:Number = 800;
public static const PLAYER_BOUNDS:Rectangle = new Rectangle((BORDER_SIDE + (PLAYER_SIDE / 2)), (BORDER_SIDE + (PLAYER_SIDE / 2)), (WORLD_SIDE - ((2 * BORDER_SIDE) + PLAYER_SIDE)), (WORLD_SIDE - ((2 * BORDER_SIDE) + PLAYER_SIDE)));
public static const BORDER_SCALE_EASE:Number = 0.1;
public static const BACKGROUND_MARGIN_MIN:Number = 0;
public static const BACKGROUND_MIN_DISTANCE:Number = 300;
public static const BORDER_COLOR_TOLERANCE:Number = 1;
public static const BACKGROUND_BOUNDS:Rectangle = new Rectangle(HALF_WIDTH, HALF_HEIGHT, (BACKGROUND_SIDE - WIDTH), (BACKGROUND_SIDE - HEIGHT));
public static const CAMERA_ADJUST:Point = new Point(HALF_WIDTH, HALF_HEIGHT);
public static const K_SPACE:int = 32;
public static const BACKGROUND_MARGIN_MAX:Number = 33;
public static const PLAYER_SIDE:Number = 32;
public static const BACKGROUND_COLOR:uint = 0xFFFFFF;
}
}//package
Section 24
//Camera (Camera)
package {
import flash.geom.*;
import flash.display.*;
public class Camera extends Sprite {
public var cameraBounds:Rectangle;
public var wantPoint:Point;
private var cameraSprites:Array;
public var cameraRect:Rectangle;
private var cameraEase:Number;
public function Camera(_arg1:Rectangle, _arg2:Number=0.1){
this.cameraEase = _arg2;
x = 0;
y = ((C.FRAME_HEIGHT - C.HEIGHT) / 2);
cameraSprites = new Array();
cameraRect = new Rectangle(0, 0, C.WIDTH, C.HEIGHT);
wantPoint = new Point();
this.cameraBounds = _arg1;
}
public function imitateCamera(_arg1:Rectangle, _arg2:Rectangle):void{
var _local3:Point = new Point(_arg1.x, _arg1.y);
_local3.add(C.CAMERA_ADJUST);
_local3.subtract(new Point(_arg2.left, _arg2.top));
_local3 = U.scalePoint(_local3, (cameraBounds.width / _arg2.width));
_local3.add(new Point(cameraBounds.left, cameraBounds.top));
_local3.subtract(C.CAMERA_ADJUST);
wantPoint = _local3;
cameraRect.x = _local3.x;
cameraRect.y = _local3.y;
}
private function cameraRemoveChild(_arg1:int):void{
if (cameraSprites[_arg1].onCamera){
removeChild(cameraSprites[_arg1]);
cameraSprites[_arg1].onCamera = false;
};
}
public function addSprite(_arg1:CameraSprite):void{
_arg1.forRemoval = false;
cameraSprites.push(_arg1);
}
private function cameraAddChild(_arg1:int):void{
if (!cameraSprites[_arg1].onCamera){
addChild(cameraSprites[_arg1]);
cameraSprites[_arg1].onCamera = true;
};
}
public function setTarget(_arg1:Point):void{
if (!cameraBounds.containsPoint(_arg1)){
_arg1 = U.constrainPointInRect(_arg1, cameraBounds);
};
wantPoint = _arg1.subtract(C.CAMERA_ADJUST);
}
public function update():void{
var _local2:Rectangle;
cameraRect.x = U.ease(cameraRect.x, wantPoint.x, cameraEase, C.CAMERA_TOLERANCE);
cameraRect.y = U.ease(cameraRect.y, wantPoint.y, cameraEase, C.CAMERA_TOLERANCE);
var _local1:int;
while (_local1 < cameraSprites.length) {
if (cameraSprites[_local1].forRemoval){
cameraRemoveChild(_local1);
cameraSprites.splice(_local1, 1);
} else {
_local2 = cameraSprites[_local1].cameraRect.clone();
_local2.offsetPoint(cameraSprites[_local1].worldPoint);
if (cameraRect.intersects(_local2)){
cameraAddChild(_local1);
cameraSprites[_local1].x = (cameraSprites[_local1].worldPoint.x - cameraRect.x);
cameraSprites[_local1].y = (cameraSprites[_local1].worldPoint.y - cameraRect.y);
} else {
cameraRemoveChild(_local1);
};
_local1++;
};
};
}
}
}//package
Section 25
//CameraSprite (CameraSprite)
package {
import flash.geom.*;
import flash.display.*;
public class CameraSprite extends Sprite {
public var forRemoval:Boolean;
public var onCamera:Boolean;
public var cameraRect:Rectangle;
public var worldPoint:Point;
public function CameraSprite(){
cameraRect = new Rectangle();
worldPoint = new Point();
}
}
}//package
Section 26
//Cathode (Cathode)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class Cathode extends MovieClip {
private var bars:Bars;
private var progressFormat:TextFormat;
private var bg:Sprite;
private var playButton:Sprite;
private var armorButton:ArmorButton;
private var progressText:TextField;
public function Cathode(){
stage.showDefaultContextMenu = false;
stop();
addBG();
addProgress();
addArmor();
bars = new Bars();
bars.x = 0;
bars.y = 0;
addChild(bars);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onPlay(_arg1:MouseEvent):void{
var _local3:Object;
playButton.removeEventListener(MouseEvent.CLICK, onPlay);
removeSprites();
nextFrame();
var _local2:Class = Class(getDefinitionByName("FlexGame"));
if (_local2){
_local3 = new (_local2);
addChild((_local3 as DisplayObject));
};
}
private function addBG():void{
bg = new Sprite();
bg.graphics.beginFill(0xFFFFFF);
bg.graphics.drawRect(0, 0, 600, 600);
bg.graphics.endFill();
bg.x = -5;
bg.y = -5;
addChild(bg);
}
private function addProgress():void{
progressText = new TextField();
progressFormat = new TextFormat();
progressFormat.color = 0;
progressFormat.font = "Arial";
progressFormat.size = 12;
progressFormat.align = TextFormatAlign.CENTER;
addChild(progressText);
}
private function setText(_arg1:String):void{
progressText.text = _arg1;
progressText.autoSize = TextFieldAutoSize.LEFT;
progressText.selectable = false;
progressText.setTextFormat(progressFormat);
progressText.x = ((590 - progressText.width) / 2);
progressText.y = ((590 / 3) - (progressText.height / 2));
}
private function addPlay():void{
var _local1:Number = 5;
progressFormat.size = 18;
setText("play cathode!");
playButton = new Sprite();
playButton.graphics.lineStyle(2, 0);
playButton.graphics.beginFill(0, 0);
playButton.graphics.drawRect(0, 0, (progressText.width + (2 * _local1)), (progressText.height + (2 * _local1)));
playButton.graphics.endFill();
playButton.buttonMode = true;
playButton.x = (progressText.x - _local1);
playButton.y = (progressText.y - _local1);
playButton.addEventListener(MouseEvent.CLICK, onPlay);
addChild(playButton);
}
private function removeSprites():void{
removeChild(playButton);
removeChild(progressText);
removeChild(bars);
removeChild(bg);
}
private function onEnterFrame(_arg1:Event):void{
if (framesLoaded == totalFrames){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
addPlay();
} else {
setText((("cathode is loading...\n" + Math.ceil(((100 * loaderInfo.bytesLoaded) / loaderInfo.bytesTotal))) + "% done, please wait. :)"));
};
}
private function addArmor():void{
armorButton = new ArmorButton();
armorButton.x = ((590 - armorButton.width) / 2);
armorButton.y = (((2 * 590) / 3) - (armorButton.height / 2));
addChild(armorButton);
}
}
}//package
Section 27
//ComboField (ComboField)
package {
import flash.text.*;
public class ComboField extends TextField {
private var formatter:TextFormat;
public function ComboField(){
formatter = new TextFormat();
super();
formatter.color = 0xFFFFFF;
formatter.font = "Arial";
formatter.size = 14;
formatter.align = TextFormatAlign.LEFT;
update(0);
}
public function update(_arg1:int):void{
text = ("Flicker Onscreen: " + _arg1);
setTextFormat(formatter);
autoSize = TextFieldAutoSize.LEFT;
selectable = false;
textColor = 0xFFFFFF;
x = ((590 - width) / 2);
}
}
}//package
Section 28
//Exploder (Exploder)
package {
import flash.geom.*;
public class Exploder extends CameraSprite {
private var dSign:int;
private var dRotation:Number;
private var dx:Number;
private var dy:Number;
private var life:int;
public static const STOP:int = 10;
public static const G:Number = 1;
public static const RADIUS_INNER:Number = 6;
public static const ALPHA_EASE:Number = 0.9;
public static const V_MIN:Number = 15;
public static const V_MAX:Number = 30;
public static const RECT:Rectangle = new Rectangle(-(RADIUS_OUTER), -(RADIUS_OUTER), (2 * RADIUS_OUTER), (2 * RADIUS_OUTER));
public static const RADIUS_OUTER:Number = 12;
public static const STAR_POINTS:Number = 5;
public static const BOUNDS:Rectangle = new Rectangle(-(RADIUS_OUTER), -(RADIUS_OUTER), (C.WORLD_SIDE + (2 * RADIUS_OUTER)), (C.WORLD_SIDE + (2 * RADIUS_OUTER)));
public static const V_EASE:Number = 0.9;
public static const A_ROTATION:Number = 1;
public static const MARGIN:Number = 3;
public function Exploder(){
graphics.beginFill(0);
drawStar(RADIUS_OUTER, RADIUS_INNER);
graphics.endFill();
graphics.lineStyle(1, 0xFFFFFF);
drawStar((RADIUS_OUTER - MARGIN), (RADIUS_INNER - MARGIN));
cameraRect = RECT;
}
public function reset(_arg1:Point):void{
var _local2:Number = U.randRange(0, (2 * Math.PI));
var _local3:Number = U.randRange(V_MIN, V_MAX);
dx = (_local3 * Math.cos(_local2));
dy = (_local3 * Math.sin(_local2));
life = 0;
dRotation = 0;
dSign = U.randSign();
alpha = 1;
rotation = U.randRange(0, 360);
this.worldPoint = _arg1.clone();
}
public function update():void{
worldPoint.offset(dx, dy);
dRotation = (dRotation + (dSign * A_ROTATION));
rotation = (rotation + dRotation);
if (life > STOP){
dy = (dy + G);
alpha = (alpha * ALPHA_EASE);
if (!BOUNDS.containsPoint(worldPoint)){
forRemoval = true;
};
} else {
dx = (dx * V_EASE);
dy = (dy * V_EASE);
life++;
};
}
private function drawStar(_arg1:Number, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
graphics.moveTo((_arg2 * Math.cos((-(Math.PI) / STAR_POINTS))), (_arg2 * Math.sin((-(Math.PI) / STAR_POINTS))));
var _local3:int;
while (_local3 < (2 * STAR_POINTS)) {
_local4 = (((_local3 % 2) == 0)) ? _arg1 : _arg2;
_local5 = ((_local3 * Math.PI) / STAR_POINTS);
graphics.lineTo((_local4 * Math.cos(_local5)), (_local4 * Math.sin(_local5)));
_local3++;
};
}
}
}//package
Section 29
//ExplosionGroup (ExplosionGroup)
package {
import flash.geom.*;
public class ExplosionGroup {
private var camera:Camera;
private var inactive:Array;
private var active:Array;
public static const NUM:int = 10;
public function ExplosionGroup(_arg1:Camera){
this.camera = _arg1;
active = new Array();
inactive = new Array();
}
public function makeExplosion(_arg1:Point):void{
var _local3:Exploder;
var _local2:int;
while (_local2 < NUM) {
if (inactive.length > 0){
_local3 = inactive.pop();
} else {
_local3 = new Exploder();
};
_local3.reset(_arg1);
active.push(_local3);
camera.addSprite(_local3);
_local2++;
};
}
public function update():void{
var _local2:Exploder;
var _local1:int;
while (_local1 < active.length) {
_local2 = active[_local1];
if (_local2.forRemoval){
inactive.push(_local2);
active.splice(_local1, 1);
} else {
_local2.update();
_local1++;
};
};
}
}
}//package
Section 30
//Fireball (Fireball)
package {
import flash.geom.*;
import flash.display.*;
public class Fireball extends CameraSprite {
public var dRotation:Number;
public var fillSprite:Sprite;
public var vPoint:Point;
private var strokeSprite:Sprite;
public static const STROKE_MARGIN:Number = 4;
public static const STROKE_COLOR:uint = 0xFFFFFF;
public static const STROKE_WIDTH:Number = 1;
public function Fireball(){
var _local1:int;
super();
fillSprite = new Sprite();
addChild(fillSprite);
fillSprite.x = 0;
fillSprite.y = 0;
fillSprite.graphics.beginFill(0xFFFFFF);
fillSprite.graphics.moveTo((FireballGroup.RADIUS * Math.cos(((-2 * Math.PI) / FireballGroup.SIDES))), (FireballGroup.RADIUS * Math.sin(((-2 * Math.PI) / FireballGroup.SIDES))));
_local1 = 0;
while (_local1 < FireballGroup.SIDES) {
fillSprite.graphics.lineTo((FireballGroup.RADIUS * Math.cos((((_local1 * 2) * Math.PI) / FireballGroup.SIDES))), (FireballGroup.RADIUS * Math.sin((((_local1 * 2) * Math.PI) / FireballGroup.SIDES))));
_local1++;
};
fillSprite.graphics.endFill();
fillSprite.transform.colorTransform = H.C[2];
strokeSprite = new Sprite();
strokeSprite.x = 0;
strokeSprite.y = 0;
addChild(strokeSprite);
var _local2:Number = (FireballGroup.RADIUS - STROKE_MARGIN);
strokeSprite.graphics.lineStyle(STROKE_WIDTH, STROKE_COLOR);
strokeSprite.graphics.moveTo((_local2 * Math.cos(((-2 * Math.PI) / FireballGroup.SIDES))), (_local2 * Math.sin(((-2 * Math.PI) / FireballGroup.SIDES))));
_local1 = 0;
while (_local1 < FireballGroup.SIDES) {
strokeSprite.graphics.lineTo((_local2 * Math.cos((((_local1 * 2) * Math.PI) / FireballGroup.SIDES))), (_local2 * Math.sin((((_local1 * 2) * Math.PI) / FireballGroup.SIDES))));
_local1++;
};
cameraRect = new Rectangle(-(FireballGroup.RADIUS), -(FireballGroup.RADIUS), (2 * FireballGroup.RADIUS), (2 * FireballGroup.RADIUS));
}
public function update():void{
rotation = (rotation + dRotation);
if (rotation < 0){
rotation = (rotation + 360);
} else {
if (rotation >= 360){
rotation = (rotation - 360);
};
};
worldPoint.offset(vPoint.x, vPoint.y);
fillSprite.transform.colorTransform = U.easeTransform(fillSprite.transform.colorTransform, H.C[2], 0.1, 2);
}
}
}//package
Section 31
//FireballGroup (FireballGroup)
package {
import flash.geom.*;
public class FireballGroup {
public var maxEnemies:Number;
private var camera:Camera;
public var levelCounter:int;
private var flexGame:FlexGame;
public var alive:Boolean;
private var inactiveFireballs:Array;
public var gap:int;
public var activeFireballs:Array;
public var counter:int;
public static const DROTATION:Number = 5;
public static const OUT_OF_BOUNDS:Number = 32;
public static const RADIUS:Number = 16;
public static const FIREBALL_V:Number = 3;
public static const INNER_RADIUS:Number = (RADIUS * Math.cos((Math.PI / SIDES)));
public static const SIDES:int = 3;
public static const LEVEL_UP:int = 1200;
public function FireballGroup(_arg1:Camera, _arg2:FlexGame){
this.flexGame = _arg2;
this.camera = _arg1;
activeFireballs = new Array();
inactiveFireballs = new Array();
alive = false;
reset();
}
public function getEnemies():int{
if (maxEnemies < activeFireballs.length){
maxEnemies = activeFireballs.length;
};
return (maxEnemies);
}
public function update(_arg1:Player):void{
var _local2:int;
var _local3:Fireball;
_local2 = 0;
while (_local2 < activeFireballs.length) {
_local3 = activeFireballs[_local2];
if (farAway(_local3)){
_local3.forRemoval = true;
inactiveFireballs.push(_local3);
activeFireballs.splice(_local2, 1);
} else {
_local3.update();
if (_arg1.visible){
if (Point.distance(_arg1.worldPoint, _local3.worldPoint) < INNER_RADIUS){
flexGame.endGame();
};
};
_local2++;
};
};
if (alive){
if ((((gap > 0)) && ((levelCounter == 0)))){
gap--;
levelCounter = LEVEL_UP;
} else {
levelCounter--;
};
};
if (counter == 0){
addFireball();
counter = gap;
} else {
counter--;
};
}
private function addFireball():void{
var _local1:Fireball;
if (inactiveFireballs.length > 0){
_local1 = inactiveFireballs.pop();
} else {
_local1 = new Fireball();
};
switch (Math.floor(U.randRange(0, 4))){
case 0:
_local1.worldPoint = new Point(-(RADIUS), U.randRange(C.PLAYER_BOUNDS.top, C.PLAYER_BOUNDS.bottom));
_local1.vPoint = new Point(FIREBALL_V, 0);
break;
case 1:
_local1.worldPoint = new Point(U.randRange(C.PLAYER_BOUNDS.left, C.PLAYER_BOUNDS.right), -(RADIUS));
_local1.vPoint = new Point(0, FIREBALL_V);
break;
case 2:
_local1.worldPoint = new Point((C.WORLD_SIDE + RADIUS), U.randRange(C.PLAYER_BOUNDS.top, C.PLAYER_BOUNDS.bottom));
_local1.vPoint = new Point(-(FIREBALL_V), 0);
break;
case 3:
_local1.worldPoint = new Point(U.randRange(C.PLAYER_BOUNDS.left, C.PLAYER_BOUNDS.right), (C.WORLD_SIDE + RADIUS));
_local1.vPoint = new Point(0, -(FIREBALL_V));
break;
};
_local1.dRotation = (U.randSign() * DROTATION);
camera.addSprite(_local1);
activeFireballs.push(_local1);
}
public function reset():void{
var _local1:Fireball;
maxEnemies = 0;
gap = 10;
counter = 0;
levelCounter = LEVEL_UP;
while (activeFireballs.length > 0) {
_local1 = activeFireballs.pop();
_local1.forRemoval = true;
inactiveFireballs.push(_local1);
};
}
private function farAway(_arg1:Fireball):Boolean{
return ((((((((_arg1.worldPoint.x < -(OUT_OF_BOUNDS))) || ((_arg1.worldPoint.y < -(OUT_OF_BOUNDS))))) || ((_arg1.worldPoint.x > (C.WORLD_SIDE + OUT_OF_BOUNDS))))) || ((_arg1.worldPoint.y > (C.WORLD_SIDE + OUT_OF_BOUNDS)))));
}
}
}//package
Section 32
//FlexGame (FlexGame)
package {
import flash.events.*;
import mx.core.*;
import flash.utils.*;
import flash.display.*;
public class FlexGame extends Sprite {
private var lastTime:int;
private var thisTime:int;
private var scoreGroup:ScoreGroup;
private var score:int;
private var introMovieClip:MovieClipLoaderAsset;
public var soundButton:S;
private var camera:Camera;
private var background:Background;
public var musicButton:M;
private var borderGroup:BorderGroup;
private var starGroup:StarGroup;
private var bgCamera:Camera;
private var fireballGroup:FireballGroup;
private var scoreLayer:ScoreLayer;
private var player:Player;
private var elapsedTime:int;
private var explosionGroup:ExplosionGroup;
private var keyHandler:KeyHandler;
private var introClass:Class;
private var addScoreVal:int;
private var backgroundGroup:BackgroundGroup;
private var menu:Menu;
public function FlexGame(){
introClass = FlexGame_introClass;
introMovieClip = MovieClipLoaderAsset(new introClass());
super();
background = new Background();
addChild(background);
showLogo();
}
private function prepareGame():void{
score = 0;
addScoreVal = 0;
bgCamera = new Camera(C.BACKGROUND_BOUNDS, 1);
addChild(bgCamera);
backgroundGroup = new BackgroundGroup(bgCamera);
camera = new Camera(C.CAMERA_BOUNDS);
addChild(camera);
addChild(new Bars());
scoreLayer = new ScoreLayer();
addChild(scoreLayer);
menu = new Menu(this);
addChild(menu);
borderGroup = new BorderGroup(camera);
fireballGroup = new FireballGroup(camera, this);
explosionGroup = new ExplosionGroup(camera);
scoreGroup = new ScoreGroup(camera);
player = new Player(borderGroup, this);
camera.addSprite(player);
player.visible = false;
starGroup = new StarGroup(camera, player, this);
keyHandler = new KeyHandler();
thisTime = getTimer();
lastTime = thisTime;
elapsedTime = 0;
addAudio();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function praise():void{
scoreGroup.addText("Well Done!", player.worldPoint, -1, 3);
}
private function onEnterFrame(_arg1:Event):void{
var _local2:int;
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
thisTime = getTimer();
elapsedTime = (elapsedTime + (thisTime - lastTime));
lastTime = thisTime;
while (elapsedTime >= 25) {
if (keyHandler.greedy){
stage.focus = keyHandler;
};
_local2 = 0;
while (_local2 < C.KEY_CODES.length) {
if (keyHandler.keys[C.KEY_CODES[_local2]].changed){
keyHandler.keys[C.KEY_CODES[_local2]].changed = false;
if (keyHandler.keys[C.KEY_CODES[_local2]].isDown){
if (KeyHandler.isArrow(C.KEY_CODES[_local2])){
player.direct(C.KEY_CODES[_local2]);
} else {
if (C.KEY_CODES[_local2] == C.K_SPACE){
player.multiplier = Player.SPEED_UP;
};
};
} else {
if (C.KEY_CODES[_local2] == C.K_SPACE){
player.multiplier = 1;
};
};
};
_local2++;
};
background.update();
scoreGroup.update();
player.update();
camera.setTarget(player.worldPoint);
borderGroup.update(player.worldPoint, player.visible);
fireballGroup.update(player);
starGroup.update();
bgCamera.imitateCamera(camera.cameraRect, camera.cameraBounds);
backgroundGroup.update(U.scalePoint(player.worldPoint, C.BACKGROUND_FACTOR));
camera.update();
bgCamera.update();
scoreLayer.update(score);
explosionGroup.update();
if (player.visible){
scoreLayer.setCombo(fireballGroup.getEnemies());
};
elapsedTime = (elapsedTime - 25);
};
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function addAudio():void{
soundButton = new S();
musicButton = new M(player);
var _local1:Number = ((C.FRAME_HEIGHT - C.HEIGHT) / 2);
var _local2:Number = (_local1 + C.HEIGHT);
var _local3:Number = ((soundButton.height + musicButton.height) + 5);
soundButton.x = ((C.WIDTH - soundButton.width) - 10);
musicButton.x = ((C.WIDTH - musicButton.width) - 10);
soundButton.y = (_local2 + ((_local1 - _local3) / 2));
musicButton.y = ((soundButton.y + soundButton.height) + 5);
addChild(soundButton);
addChild(musicButton);
}
public function help():void{
scoreGroup.addText("Hold SPACE to speed up.\nArrow keys or WASD to move.", player.worldPoint, 1, 5);
}
private function timerHandler(_arg1:TimerEvent):void{
removeChild(introMovieClip);
prepareGame();
}
private function showLogo():void{
introMovieClip.x = ((590 - 550) / 2);
introMovieClip.y = ((590 - 400) / 2);
addChild(introMovieClip);
introMovieClip.play();
var _local1:Timer = new Timer(7300, 1);
_local1.addEventListener("timer", timerHandler);
_local1.start();
}
public function endGame():void{
fireballGroup.alive = false;
player.visible = false;
menu.visible = true;
H.returnColors();
explosionGroup.makeExplosion(player.worldPoint);
musicButton.end();
soundButton.play(S.LOSE);
}
public function startGame():void{
score = 0;
addScoreVal = 0;
starGroup.reset();
fireballGroup.reset();
fireballGroup.alive = true;
player.reset();
menu.visible = false;
musicButton.start();
}
public function addScore():void{
addScoreVal++;
score = (score + addScoreVal);
scoreGroup.addText(("+" + addScoreVal), player.worldPoint);
}
public function announceNext(_arg1:String):void{
scoreGroup.addText(("Next: " + _arg1), player.worldPoint, -1, 3);
}
}
}//package
Section 33
//FlexGame_introClass (FlexGame_introClass)
package {
import mx.core.*;
import flash.utils.*;
public class FlexGame_introClass extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function FlexGame_introClass(){
dataClass = FlexGame_introClass_dataClass;
super();
initialWidth = (11000 / 20);
initialHeight = (8000 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 34
//FlexGame_introClass_dataClass (FlexGame_introClass_dataClass)
package {
import mx.core.*;
public class FlexGame_introClass_dataClass extends ByteArrayAsset {
}
}//package
Section 35
//H (H)
package {
import flash.geom.*;
public class H {
public static var A:Array = [[c(0xFF, 0xFF, 0xFF), c(204, 204, 204), c(51, 51, 51), c(111, 111, 111), c(0xFF, 100, 0)], [c(0xFF, 107, 107), c(196, 77, 88), c(78, 205, 196), c(85, 98, 112), c(199, 244, 100)], [c(213, 222, 217), c(217, 206, 178), c(122, 106, 83), c(148, 140, 117), c(153, 178, 183)], [c(105, 210, 231), c(167, 219, 216), c(243, 134, 48), c(224, 228, 204), c(250, 105, 0)], [c(191, 179, 90), c(136, 166, 94), c(94, 140, 106), c(140, 35, 24), c(242, 196, 90)]];
public static var C:Array = A[0];
public static var currentIndex:int = 0;
public static function returnColors():void{
C = A[0];
currentIndex = 0;
}
public static function c(_arg1:int, _arg2:int, _arg3:int):ColorTransform{
return (new ColorTransform(0, 0, 0, 0, _arg1, _arg2, _arg3, 0xFF));
}
public static function mixColors():void{
var _local1:int = Math.floor(U.randRange(1, (A.length - 1)));
if (_local1 >= currentIndex){
_local1++;
};
currentIndex = _local1;
C = A[currentIndex];
}
}
}//package
Section 36
//KeyHandler (KeyHandler)
package {
import flash.events.*;
import flash.display.*;
public class KeyHandler extends Sprite {
public var greedy:Boolean;
public var keys:Array;
public function KeyHandler(){
greedy = true;
initKeys();
addEventListener(KeyboardEvent.KEY_UP, onKeyUp);
addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
}
private function onKeyUp(_arg1:KeyboardEvent):void{
var _local2:int;
while (_local2 < C.KEY_CODES.length) {
if ((((C.KEY_CODES[_local2] == _arg1.keyCode)) && (keys[_arg1.keyCode].isDown))){
keys[_arg1.keyCode].isDown = false;
keys[_arg1.keyCode].changed = true;
};
_local2++;
};
}
private function onKeyDown(_arg1:KeyboardEvent):void{
var _local2:int;
while (_local2 < C.KEY_CODES.length) {
if ((((C.KEY_CODES[_local2] == _arg1.keyCode)) && (!(keys[_arg1.keyCode].isDown)))){
keys[_arg1.keyCode].isDown = true;
keys[_arg1.keyCode].changed = true;
};
_local2++;
};
}
private function initKeys():void{
keys = new Array();
var _local1:int;
while (_local1 < C.KEY_CODES.length) {
keys[C.KEY_CODES[_local1]] = new KeyInfo();
_local1++;
};
}
public static function isArrow(_arg1:int):Boolean{
return ((((((((((((C.K_LEFT <= _arg1)) && ((_arg1 <= C.K_DOWN)))) || ((_arg1 == C.K_A)))) || ((_arg1 == C.K_W)))) || ((_arg1 == C.K_D)))) || ((_arg1 == C.K_S))));
}
}
}//package
Section 37
//KeyInfo (KeyInfo)
package {
public class KeyInfo {
public var changed:Boolean;
public var isDown:Boolean;
public function KeyInfo(){
isDown = false;
changed = false;
}
}
}//package
Section 38
//M (M)
package {
import flash.events.*;
import mx.core.*;
import flash.media.*;
public class M extends TextButton {
private var player:Player;
private var channel:SoundChannel;
private var music:SoundAsset;
private var bgTransform:SoundTransform;
private var playing:Boolean;// = false
private var musicClass:Class;
private var fader:Number;// = 0
public function M(_arg1:Player){
musicClass = M_musicClass;
music = SoundAsset(new musicClass());
bgTransform = new SoundTransform();
super();
construct("music");
this.player = _arg1;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
override public function whenPressed():void{
bgTransform.volume = (isOn) ? 1 : 0;
if (playing){
channel.soundTransform = bgTransform;
};
}
public function start():void{
if (isOn){
bgTransform.volume = 1;
};
if (fader > 0){
channel.stop();
playing = false;
};
channel = music.play(25, int.MAX_VALUE);
playing = true;
channel.soundTransform = bgTransform;
}
private function onEnterFrame(_arg1:Event):void{
if (!player.visible){
if (fader > 0){
fader = (fader - 0.025);
if (isOn){
bgTransform.volume = ((fader)>0) ? fader : 0;
channel.soundTransform = bgTransform;
};
if (fader <= 0){
channel.stop();
playing = false;
};
};
};
}
public function end():void{
fader = 1;
}
}
}//package
Section 39
//M_musicClass (M_musicClass)
package {
import mx.core.*;
public class M_musicClass extends SoundAsset {
}
}//package
Section 40
//Menu (Menu)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class Menu extends Sprite {
private var titleField:TextField;
private var flexGame:FlexGame;
private var titleFormat:TextFormat;
private var logoSprite:ArmorButton;
private var titleBox:Sprite;
private var playGameButton:Sprite;
private static const MARGIN_LEFT:Number = 30;
public function Menu(_arg1:FlexGame){
x = 0;
y = 0;
makeButtons();
makeTitle();
this.flexGame = _arg1;
}
private function onClick(_arg1:MouseEvent):void{
flexGame.startGame();
}
private function makeTitle():void{
titleField = new TextField();
titleFormat = new TextFormat();
titleFormat.font = "Arial";
titleFormat.size = 36;
titleFormat.color = 0;
titleField.text = "cathode";
titleField.autoSize = TextFieldAutoSize.LEFT;
titleField.setTextFormat(titleFormat);
titleBox = new Sprite();
titleBox.graphics.lineStyle(2, 0);
titleBox.graphics.beginFill(0xFFFFFF, 0.6);
titleBox.graphics.drawRect(0, 0, (titleField.width + 20), (titleField.height + 10));
titleBox.graphics.endFill();
titleBox.x = MARGIN_LEFT;
titleBox.y = ((((C.FRAME_HEIGHT - C.HEIGHT) / 2) + ((playGameButton.y - ((C.FRAME_HEIGHT - C.HEIGHT) / 2)) / 2)) - (titleBox.height / 2));
addChild(titleBox);
titleField.x = (titleBox.x + 10);
titleField.y = (titleBox.y + 5);
addChild(titleField);
}
private function makeButtons():void{
var _local1:int;
var _local14:TextField;
var _local15:Sprite;
var _local16:Sprite;
var _local2:Array = ["Play Game", "Get More Games", "Game Updates"];
var _local3:TextFormat = new TextFormat();
_local3.color = 0;
_local3.font = "Arial";
_local3.size = 12;
_local3.align = TextFormatAlign.LEFT;
var _local4:Array = [];
var _local5:Array = [];
var _local6:Number = 0;
var _local7:Number = 0;
_local1 = 0;
while (_local1 < _local2.length) {
_local14 = new TextField();
_local14.text = _local2[_local1];
_local14.setTextFormat(_local3);
_local14.autoSize = TextFieldAutoSize.LEFT;
_local14.selectable = false;
_local14.textColor = 0;
_local4.push(_local14);
if (_local14.width > _local6){
_local6 = _local14.width;
};
if (_local14.height > _local7){
_local7 = _local14.height;
};
_local1++;
};
_local6 = (_local6 + 10);
_local7 = (_local7 + 10);
_local1 = 0;
while (_local1 < _local4.length) {
_local15 = new Sprite();
_local15.graphics.lineStyle(1, 0);
_local15.graphics.beginFill(0xFFFFFF, 0.6);
_local15.graphics.drawRect(0, 0, _local6, _local7);
_local15.graphics.endFill();
_local15.addChild(_local4[_local1]);
_local4[_local1].x = 5;
_local4[_local1].y = 5;
_local16 = new Sprite();
_local16.graphics.beginFill(0, 0);
_local16.graphics.drawRect(0, 0, _local6, _local7);
_local16.graphics.endFill();
_local16.buttonMode = true;
_local15.addChild(_local16);
_local16.x = 0;
_local16.y = 0;
_local15.x = MARGIN_LEFT;
_local5.push(_local15);
_local1++;
};
playGameButton = _local5[0];
var _local8:Sprite = _local5[1];
var _local9:Sprite = _local5[2];
playGameButton.y = ((C.FRAME_HEIGHT / 2) - (_local5.length * _local7));
_local8.y = ((playGameButton.y + playGameButton.height) + 10);
_local9.y = ((_local8.y + _local8.height) + 10);
playGameButton.addEventListener(MouseEvent.CLICK, onClick);
_local8.addEventListener(MouseEvent.CLICK, onGetMoreGames);
_local9.addEventListener(MouseEvent.CLICK, onGameUpdates);
addChild(playGameButton);
addChild(_local8);
addChild(_local9);
logoSprite = new ArmorButton(1);
var _local10:TextField = new TextField();
var _local11:TextFormat = new TextFormat();
var _local12:Sprite = new Sprite();
_local10.text = "© scriptedfun.com. All rights reserved.";
_local11.color = 0;
_local11.font = "Arial";
_local11.size = 10;
_local11.align = TextFormatAlign.LEFT;
_local10.autoSize = TextFieldAutoSize.LEFT;
_local10.selectable = false;
_local10.setTextFormat(_local11);
var _local13:Number = 0;
_local12.addChild(_local10);
_local10.x = _local13;
_local10.y = _local13;
logoSprite.x = MARGIN_LEFT;
logoSprite.y = (((_local9.y + _local9.height) + (((C.FRAME_HEIGHT - ((C.FRAME_HEIGHT - C.HEIGHT) / 2)) - (_local9.y + _local9.height)) / 2)) - (((logoSprite.height + _local12.height) + 5) / 2));
_local12.x = MARGIN_LEFT;
_local12.y = ((logoSprite.y + logoSprite.height) + 5);
addChild(_local12);
addChild(logoSprite);
}
private function onGameUpdates(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://ArmorBlog.com/"), "_blank");
}
private function onGetMoreGames(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://ArmorGames.com/"), "_blank");
}
}
}//package
Section 41
//Player (Player)
package {
import flash.geom.*;
public class Player extends CameraSprite {
public var multiplier:Number;
public var vPoint:Point;
private var flexGame:FlexGame;
public var borderGroup:BorderGroup;
public var multiplierPrevious:Number;
public static const SPEED_UP:Number = 2;
public function Player(_arg1:BorderGroup, _arg2:FlexGame){
this.flexGame = _arg2;
multiplier = 1;
multiplierPrevious = multiplier;
cameraRect = new Rectangle((-(C.PLAYER_SIDE) / 2), (-(C.PLAYER_SIDE) / 2), C.PLAYER_SIDE, C.PLAYER_SIDE);
worldPoint = new Point((C.WIDTH / 2), (C.HEIGHT / 2));
this.borderGroup = _arg1;
graphics.beginFill(C.PLAYER_FILL_COLOR);
graphics.moveTo((C.PLAYER_SIDE / 2), 0);
graphics.lineTo((-(C.PLAYER_SIDE) / 2), (C.PLAYER_SIDE / 2));
graphics.lineTo((-(C.PLAYER_SIDE) / 4), 0);
graphics.lineTo((-(C.PLAYER_SIDE) / 2), (-(C.PLAYER_SIDE) / 2));
graphics.endFill();
graphics.lineStyle(C.PLAYER_STROKE_WIDTH, C.PLAYER_STROKE_COLOR);
graphics.moveTo(((C.PLAYER_SIDE / 2) - C.PLAYER_STROKE_MARGIN), 0);
graphics.lineTo(((-(C.PLAYER_SIDE) / 2) + C.PLAYER_STROKE_MARGIN), ((C.PLAYER_SIDE / 2) - C.PLAYER_STROKE_MARGIN));
graphics.lineTo(((-(C.PLAYER_SIDE) / 4) + C.PLAYER_STROKE_MARGIN), 0);
graphics.lineTo(((-(C.PLAYER_SIDE) / 2) + C.PLAYER_STROKE_MARGIN), ((-(C.PLAYER_SIDE) / 2) + C.PLAYER_STROKE_MARGIN));
graphics.lineTo(((C.PLAYER_SIDE / 2) - C.PLAYER_STROKE_MARGIN), 0);
vPoint = new Point();
direct(C.K_RIGHT, false);
}
public function update():void{
if (visible){
if (!C.PLAYER_BOUNDS.containsPoint(worldPoint)){
borderGroup.highlight();
flexGame.soundButton.play(S.BOUNCE);
if ((((worldPoint.x < C.PLAYER_BOUNDS.left)) && ((vPoint == C.PLAYER_LEFT)))){
direct(C.K_RIGHT);
} else {
if ((((worldPoint.x >= C.PLAYER_BOUNDS.right)) && ((vPoint == C.PLAYER_RIGHT)))){
direct(C.K_LEFT);
};
};
if ((((worldPoint.y < C.PLAYER_BOUNDS.top)) && ((vPoint == C.PLAYER_UP)))){
direct(C.K_DOWN);
} else {
if ((((worldPoint.y >= C.PLAYER_BOUNDS.bottom)) && ((vPoint == C.PLAYER_DOWN)))){
direct(C.K_UP);
};
};
worldPoint = U.constrainPointInRect(worldPoint, C.PLAYER_BOUNDS);
};
worldPoint.offset((multiplier * vPoint.x), (multiplier * vPoint.y));
if (multiplier != multiplierPrevious){
flexGame.soundButton.play(((multiplier > multiplierPrevious)) ? S.UP : S.DOWN);
multiplierPrevious = multiplier;
};
};
}
public function direct(_arg1:int, _arg2:Boolean=true):void{
var _local3:Point = vPoint.clone();
switch (_arg1){
case C.K_A:
case C.K_LEFT:
vPoint = C.PLAYER_LEFT;
rotation = 180;
break;
case C.K_W:
case C.K_UP:
vPoint = C.PLAYER_UP;
rotation = -90;
break;
case C.K_D:
case C.K_RIGHT:
vPoint = C.PLAYER_RIGHT;
rotation = 0;
break;
case C.K_S:
case C.K_DOWN:
vPoint = C.PLAYER_DOWN;
rotation = 90;
break;
};
if (((((visible) && (_arg2))) && (!(_local3.equals(vPoint))))){
flexGame.soundButton.play(S.MOVE);
};
}
public function reset():void{
visible = true;
multiplier = 1;
multiplierPrevious = 1;
}
}
}//package
Section 42
//PlusField (PlusField)
package {
import flash.geom.*;
import flash.display.*;
import flash.text.*;
public class PlusField extends CameraSprite {
private var box:Sprite;
private var textField:TextField;
private var formatter:TextFormat;
private var lifeStay:int;
private var lifeUp:int;
private var direction:int;
private static const LIFE_STAY:int = 30;
private static const LIFE_UP:int = 10;
public function PlusField(){
textField = new TextField();
formatter = new TextFormat();
formatter.color = 0xFFFFFF;
formatter.font = "Arial";
formatter.size = 16;
formatter.align = TextFormatAlign.LEFT;
box = new Sprite();
box.graphics.beginFill(0, 0.6);
box.graphics.drawRect(0, 0, 1, 1);
box.graphics.endFill();
addChild(box);
addChild(textField);
}
public function update():void{
if (lifeUp > 0){
worldPoint.offset(0, (-(lifeUp) * direction));
lifeUp--;
} else {
if (lifeStay > 0){
lifeStay--;
} else {
forRemoval = true;
};
};
}
public function setText(_arg1:String, _arg2:Point, _arg3:int, _arg4:int):void{
lifeUp = LIFE_UP;
lifeStay = (LIFE_STAY * _arg4);
this.worldPoint = _arg2;
_arg2.offset(Math.floor(U.randRange(-32, 32)), Math.floor(U.randRange(-32, 32)));
textField.text = _arg1;
textField.setTextFormat(formatter);
textField.autoSize = TextFieldAutoSize.LEFT;
textField.selectable = false;
textField.textColor = 0xFFFFFF;
textField.x = 5;
textField.y = 5;
box.width = (textField.width + 10);
box.height = (textField.height + 10);
box.x = 0;
box.y = 0;
box.x = 0;
box.y = 0;
cameraRect = new Rectangle(0, 0, box.width, box.height);
this.direction = _arg3;
}
}
}//package
Section 43
//S (S)
package {
import mx.core.*;
public class S extends TextButton {
private var loseClass:Class;
private var catchClass:Class;
private var moveClass:Class;
public var sounds:Array;
private var bounceClass:Class;
private var downClass:Class;
private var winClass:Class;
private var upClass:Class;
public static const BOUNCE:int = 3;
public static const MOVE:int = 4;
public static const CATCH:int = 0;
public static const LOSE:int = 2;
public static const DOWN:int = 6;
public static const UP:int = 5;
public static const WIN:int = 1;
public function S(){
catchClass = S_catchClass;
winClass = S_winClass;
loseClass = S_loseClass;
bounceClass = S_bounceClass;
moveClass = S_moveClass;
upClass = S_upClass;
downClass = S_downClass;
sounds = [SoundAsset(new catchClass()), SoundAsset(new winClass()), SoundAsset(new loseClass()), SoundAsset(new bounceClass()), SoundAsset(new moveClass()), SoundAsset(new upClass()), SoundAsset(new downClass())];
super();
construct("sound");
}
public function play(_arg1:int):void{
if (isOn){
sounds[_arg1].play(25);
};
}
}
}//package
Section 44
//S_bounceClass (S_bounceClass)
package {
import mx.core.*;
public class S_bounceClass extends SoundAsset {
}
}//package
Section 45
//S_catchClass (S_catchClass)
package {
import mx.core.*;
public class S_catchClass extends SoundAsset {
}
}//package
Section 46
//S_downClass (S_downClass)
package {
import mx.core.*;
public class S_downClass extends SoundAsset {
}
}//package
Section 47
//S_loseClass (S_loseClass)
package {
import mx.core.*;
public class S_loseClass extends SoundAsset {
}
}//package
Section 48
//S_moveClass (S_moveClass)
package {
import mx.core.*;
public class S_moveClass extends SoundAsset {
}
}//package
Section 49
//S_upClass (S_upClass)
package {
import mx.core.*;
public class S_upClass extends SoundAsset {
}
}//package
Section 50
//S_winClass (S_winClass)
package {
import mx.core.*;
public class S_winClass extends SoundAsset {
}
}//package
Section 51
//ScoreField (ScoreField)
package {
import flash.text.*;
public class ScoreField extends TextField {
public var wantNum:Number;// = 0
private var formatter:TextFormat;
private var currentNum:Number;// = 0
public function ScoreField(){
formatter = new TextFormat();
super();
formatter.color = 0xFFFFFF;
formatter.font = "Arial";
formatter.size = 20;
formatter.align = TextFormatAlign.LEFT;
update();
}
public function update():void{
if (Math.abs((wantNum - currentNum)) < 1){
currentNum = wantNum;
} else {
currentNum = (currentNum + (0.1 * (wantNum - currentNum)));
};
var _local1:int = Math.floor(currentNum);
text = ("Score: " + _local1);
setTextFormat(formatter);
autoSize = TextFieldAutoSize.LEFT;
selectable = false;
textColor = 0xFFFFFF;
x = ((590 - width) / 2);
}
}
}//package
Section 52
//ScoreGroup (ScoreGroup)
package {
import flash.geom.*;
public class ScoreGroup {
private var inactiveTextFields:Array;
private var camera:Camera;
private var activeTextFields:Array;
public function ScoreGroup(_arg1:Camera){
activeTextFields = new Array();
inactiveTextFields = new Array();
this.camera = _arg1;
}
public function update():void{
var _local1:int;
var _local2:PlusField;
_local1 = 0;
while (_local1 < activeTextFields.length) {
_local2 = activeTextFields[_local1];
_local2.update();
if (_local2.forRemoval){
inactiveTextFields.push(activeTextFields.splice(_local1, 1)[0]);
} else {
_local1++;
};
};
}
public function addText(_arg1:String, _arg2:Point, _arg3:int=1, _arg4:int=1):void{
var _local5:PlusField;
if (inactiveTextFields.length > 0){
_local5 = inactiveTextFields.pop();
} else {
_local5 = new PlusField();
};
_local5.setText(_arg1, _arg2.clone(), _arg3, _arg4);
camera.addSprite(_local5);
activeTextFields.push(_local5);
}
}
}//package
Section 53
//ScoreLayer (ScoreLayer)
package {
import flash.display.*;
public class ScoreLayer extends Sprite {
private var scoreField:ScoreField;
private var comboField:ComboField;
public function ScoreLayer(){
scoreField = new ScoreField();
comboField = new ComboField();
var _local1:Number = ((C.FRAME_WIDTH - C.WIDTH) / 2);
scoreField.y = 5;
comboField.y = (scoreField.y + scoreField.height);
addChild(scoreField);
addChild(comboField);
}
public function update(_arg1:int):void{
scoreField.wantNum = _arg1;
scoreField.update();
}
public function setCombo(_arg1:int):void{
comboField.update(_arg1);
}
}
}//package
Section 54
//Star (Star)
package {
import flash.geom.*;
import flash.display.*;
public class Star extends CameraSprite {
private var wantPoint:Point;
private var dRotation:Number;
private var fillSprite:Sprite;
private var wantAlpha:Number;
public var state:int;
private var highlighted:Boolean;// = false
private var delayCounter:int;
private var strokeSprite:Sprite;
public static const OUTRO_COORD:Number = ((C.WORLD_SIDE - ((NUM_SIDE * 2) * INNER_RADIUS)) / 2);
public static const ROTATE_TOLERANCE:Number = 1;
public static const NUM_SIDE:int = 8;
public static const ROTATE_FIX:Number = 45;
public static const RADIUS:Number = 30;
public static const STATE_ACTIVE:int = 1004;
public static const DELAY_MULTIPLIER:int = 2;
public static const STATE_OUTRO:int = 1003;
public static const MARGIN:Number = 4;
public static const ALPHA_TOLERANCE:Number = 0.1;
public static const GAP:Number = (SIDE / (NUM_SIDE - 1));
public static const INNER_RADIUS:Number = (RADIUS * Math.cos((Math.PI / SIDES)));
public static const DROTATION:Number = 3;
public static const ALPHA_EASE:Number = 0.1;
public static const ROTATE_EASE:Number = 0.1;
public static const SIDE:Number = (0.9 * C.PLAYER_BOUNDS.width);
public static const POINT_EASE:Number = 0.1;
public static const POINT_TOLERANCE:Number = 1;
public static const STROKE_WIDTH:Number = 1;
public static const SIDES:int = 4;
public static const RECT:Rectangle = new Rectangle(-(RADIUS), -(RADIUS), (2 * RADIUS), (2 * RADIUS));
public static const CORNER_COORD:Number = ((C.WORLD_SIDE - SIDE) / 2);
public static const DELAY_OFFSET:int = 40;
public static const STATE_CAPTURED:int = 1001;
public static const STROKE_COLOR:uint = 0xFFFFFF;
public static const STATE_INTRO:int = 1002;
public function Star(){
var _local1:int;
super();
cameraRect = RECT;
fillSprite = new Sprite();
fillSprite.graphics.beginFill(0xFFFFFF);
fillSprite.graphics.moveTo((RADIUS * Math.cos(((-2 * Math.PI) / SIDES))), (RADIUS * Math.sin(((-2 * Math.PI) / SIDES))));
_local1 = 0;
while (_local1 < SIDES) {
fillSprite.graphics.lineTo((RADIUS * Math.cos((((_local1 * 2) * Math.PI) / SIDES))), (RADIUS * Math.sin((((_local1 * 2) * Math.PI) / SIDES))));
_local1++;
};
fillSprite.graphics.endFill();
fillSprite.x = 0;
fillSprite.y = 0;
addChild(fillSprite);
strokeSprite = new Sprite();
strokeSprite.graphics.lineStyle(STROKE_WIDTH, STROKE_COLOR);
var _local2:Number = (RADIUS - MARGIN);
strokeSprite.graphics.moveTo((_local2 * Math.cos(((-2 * Math.PI) / SIDES))), (_local2 * Math.sin(((-2 * Math.PI) / SIDES))));
_local1 = 0;
while (_local1 < SIDES) {
strokeSprite.graphics.lineTo((_local2 * Math.cos((((_local1 * 2) * Math.PI) / SIDES))), (_local2 * Math.sin((((_local1 * 2) * Math.PI) / SIDES))));
_local1++;
};
strokeSprite.x = 0;
strokeSprite.y = 0;
addChild(strokeSprite);
dRotation = (U.randSign() * DROTATION);
}
public function setDelay(_arg1:int, _arg2:int=1):void{
delayCounter = ((_arg2 * DELAY_OFFSET) + (DELAY_MULTIPLIER * _arg1));
}
public function setPosition(_arg1:int, _arg2:int):void{
worldPoint = new Point((CORNER_COORD + (_arg1 * GAP)), (CORNER_COORD + (_arg2 * GAP)));
wantPoint = new Point((OUTRO_COORD + ((_arg1 * 2) * INNER_RADIUS)), (OUTRO_COORD + ((_arg2 * 2) * INNER_RADIUS)));
}
public function setState(_arg1:int):void{
this.state = _arg1;
switch (_arg1){
case STATE_CAPTURED:
highlighted = true;
break;
case STATE_INTRO:
fillSprite.transform.colorTransform = H.C[3];
highlighted = false;
alpha = 0;
wantAlpha = 0;
break;
case STATE_OUTRO:
break;
case STATE_ACTIVE:
wantAlpha = 1;
break;
};
}
public function update():void{
switch (state){
case STATE_CAPTURED:
rotate();
break;
case STATE_INTRO:
if (delayCounter == 0){
setState(STATE_ACTIVE);
} else {
delayCounter--;
};
break;
case STATE_OUTRO:
rotation = U.ease(rotation, ROTATE_FIX, ROTATE_EASE, ROTATE_TOLERANCE);
worldPoint = U.easePoint(worldPoint, wantPoint, POINT_EASE, POINT_TOLERANCE);
if (delayCounter == 0){
wantAlpha = 0;
if (alpha == 0){
forRemoval = true;
};
} else {
delayCounter--;
};
break;
case STATE_ACTIVE:
rotate();
break;
};
fillSprite.transform.colorTransform = U.easeTransform(fillSprite.transform.colorTransform, (highlighted) ? H.C[4] : H.C[3], 0.1, 2);
alpha = U.ease(alpha, wantAlpha, ALPHA_EASE, ALPHA_TOLERANCE);
}
private function rotate():void{
rotation = (rotation + dRotation);
if (rotation < 0){
rotation = (rotation + 360);
};
if (rotation >= 360){
rotation = (rotation - 360);
};
}
}
}//package
Section 55
//StarGroup (StarGroup)
package {
import flash.geom.*;
public class StarGroup {
private var starsLeft:int;
private var flexGame:FlexGame;
private var currentLevel:int;
private var starsAdded:int;
private var helped:Boolean;
private var player:Player;
private var animatingStars:Array;
private var camera:Camera;
private var activeStars:Array;
private var inactiveStars:Array;
public static const LEVELS:Array = [["!", [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 6]], ["\"", [3, 0], [3, 1], [5, 0], [5, 1]], ["#", [1, 2], [1, 4], [2, 2], [2, 4], [3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [3, 6], [4, 2], [4, 4], [5, 0], [5, 1], [5, 2], [5, 3], [5, 4], [5, 5], [5, 6], [6, 2], [6, 4], [7, 2], [7, 4]], ["$", [2, 2], [2, 5], [3, 1], [3, 3], [3, 5], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 1], [5, 3], [5, 5], [6, 1], [6, 4]], ["%", [2, 1], [2, 2], [2, 5], [3, 1], [3, 2], [3, 4], [4, 3], [5, 2], [5, 4], [5, 5], [6, 1], [6, 4], [6, 5]], ["&", [1, 4], [1, 5], [2, 1], [2, 3], [2, 6], [3, 0], [3, 2], [3, 6], [4, 0], [4, 1], [4, 3], [4, 6], [5, 4], [5, 5], [6, 4], [6, 6]], ["'", [4, 0], [4, 1]], ["(", [3, 2], [3, 3], [3, 4], [4, 1], [4, 5], [5, 0], [5, 6]], [")", [3, 0], [3, 6], [4, 1], [4, 5], [5, 2], [5, 3], [5, 4]], ["*", [1, 1], [1, 5], [2, 2], [2, 4], [3, 3], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 3], [6, 2], [6, 4], [7, 1], [7, 5]], ["+", [1, 3], [2, 3], [3, 3], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 3], [6, 3], [7, 3]], [",", [4, 4], [4, 5], [4, 7], [5, 4], [5, 5], [5, 6]], ["-", [1, 3], [2, 3], [3, 3], [4, 3], [5, 3], [6, 3], [7, 3]], [".", [4, 5], [4, 6], [5, 5], [5, 6]], ["/", [1, 6], [2, 5], [3, 4], [4, 3], [5, 2], [6, 1], [7, 0]], ["0", [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [3, 0], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 6], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5]], ["1", [3, 1], [3, 6], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 6]], ["2", [2, 1], [2, 6], [3, 0], [3, 5], [3, 6], [4, 0], [4, 4], [4, 6], [5, 0], [5, 3], [5, 6], [6, 1], [6, 2], [6, 6]], ["3", [2, 1], [2, 5], [3, 0], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 1], [6, 2], [6, 4], [6, 5]], ["4", [2, 2], [2, 3], [3, 1], [3, 3], [4, 0], [4, 3], [4, 6], [5, 0], [5, 1], [5, 2], [5, 3], [5, 4], [5, 5], [5, 6], [6, 3], [6, 6]], ["5", [2, 0], [2, 1], [2, 2], [2, 3], [2, 5], [3, 0], [3, 3], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 0], [6, 4], [6, 5]], ["6", [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [3, 0], [3, 3], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 1], [6, 4], [6, 5]], ["7", [2, 0], [3, 0], [3, 4], [3, 5], [3, 6], [4, 0], [4, 3], [5, 0], [5, 2], [6, 0], [6, 1]], ["8", [2, 1], [2, 2], [2, 4], [2, 5], [3, 0], [3, 3], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 1], [6, 2], [6, 4], [6, 5]], ["9", [2, 1], [2, 2], [2, 5], [3, 0], [3, 3], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5]], [":", [4, 1], [4, 2], [4, 4], [4, 5], [5, 1], [5, 2], [5, 4], [5, 5]], [";", [4, 1], [4, 2], [4, 4], [4, 5], [4, 7], [5, 1], [5, 2], [5, 4], [5, 5], [5, 6]], ["<", [2, 3], [3, 2], [3, 4], [4, 1], [4, 5], [5, 0], [5, 6]], ["=", [1, 2], [1, 4], [2, 2], [2, 4], [3, 2], [3, 4], [4, 2], [4, 4], [5, 2], [5, 4], [6, 2], [6, 4], [7, 2], [7, 4]], [">", [2, 0], [2, 6], [3, 1], [3, 5], [4, 2], [4, 4], [5, 3]], ["?", [2, 1], [3, 0], [4, 0], [4, 4], [4, 6], [5, 0], [5, 3], [6, 1], [6, 2]], ["@", [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [3, 0], [3, 6], [4, 0], [4, 2], [4, 3], [4, 4], [4, 6], [5, 0], [5, 2], [5, 4], [5, 6], [6, 1], [6, 2], [6, 3], [6, 4]], ["A", [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 0], [3, 3], [4, 0], [4, 3], [5, 0], [5, 3], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5], [6, 6]], ["B", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 0], [3, 3], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 1], [6, 2], [6, 4], [6, 5]], ["C", [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [3, 0], [3, 6], [4, 0], [4, 6], [5, 0], [5, 6], [6, 1], [6, 5]], ["D", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 0], [3, 6], [4, 0], [4, 6], [5, 0], [5, 6], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5]], ["E", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 0], [3, 3], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 0], [6, 6]], ["F", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 0], [3, 3], [4, 0], [4, 3], [5, 0], [5, 3], [6, 0], [6, 3]], ["G", [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [3, 0], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 1], [6, 3], [6, 4], [6, 5]], ["H", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 3], [4, 3], [5, 3], [6, 0], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5], [6, 6]], ["I", [3, 0], [3, 6], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 0], [5, 6]], ["J", [2, 4], [2, 5], [3, 6], [4, 0], [4, 6], [5, 0], [5, 1], [5, 2], [5, 3], [5, 4], [5, 5], [6, 0]], ["K", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 3], [4, 3], [5, 2], [5, 4], [6, 0], [6, 1], [6, 5], [6, 6]], ["L", [3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [3, 6], [4, 6], [5, 6], [6, 6]], ["M", [1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [1, 6], [2, 1], [3, 2], [4, 3], [5, 2], [6, 1], [7, 0], [7, 1], [7, 2], [7, 3], [7, 4], [7, 5], [7, 6]], ["N", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 1], [4, 2], [4, 3], [5, 4], [6, 0], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5], [6, 6]], ["O", [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [3, 0], [3, 6], [4, 0], [4, 6], [5, 0], [5, 6], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5]], ["P", [3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [3, 6], [4, 0], [4, 3], [5, 0], [5, 3], [6, 1], [6, 2]], ["Q", [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [3, 0], [3, 6], [4, 0], [4, 6], [5, 0], [5, 6], [5, 7], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5], [6, 7]], ["R", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 0], [3, 3], [4, 0], [4, 3], [4, 4], [5, 0], [5, 3], [5, 5], [6, 1], [6, 2], [6, 6]], ["S", [2, 1], [2, 2], [2, 5], [3, 0], [3, 3], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 3], [5, 6], [6, 1], [6, 4], [6, 5]], ["T", [2, 0], [3, 0], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 0], [6, 0]], ["U", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [3, 6], [4, 6], [5, 6], [6, 0], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5]], ["V", [2, 0], [2, 1], [2, 2], [3, 3], [3, 4], [4, 5], [4, 6], [5, 3], [5, 4], [6, 0], [6, 1], [6, 2]], ["W", [1, 0], [1, 1], [1, 2], [2, 3], [2, 4], [3, 5], [3, 6], [4, 3], [4, 4], [5, 5], [5, 6], [6, 3], [6, 4], [7, 0], [7, 1], [7, 2]], ["X", [2, 0], [2, 1], [2, 5], [2, 6], [3, 2], [3, 4], [4, 3], [5, 2], [5, 4], [6, 0], [6, 1], [6, 5], [6, 6]], ["Y", [2, 0], [2, 1], [3, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 2], [6, 0], [6, 1]], ["Z", [2, 0], [2, 5], [2, 6], [3, 0], [3, 4], [3, 6], [4, 0], [4, 3], [4, 6], [5, 0], [5, 2], [5, 6], [6, 0], [6, 1], [6, 6]], ["[", [3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [3, 6], [4, 0], [4, 6], [5, 0], [5, 6]], ["\\", [1, 0], [2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6]], ["]", [3, 0], [3, 6], [4, 0], [4, 6], [5, 0], [5, 1], [5, 2], [5, 3], [5, 4], [5, 5], [5, 6]], ["^", [2, 2], [3, 1], [4, 0], [5, 1], [6, 2]], ["_", [1, 7], [2, 7], [3, 7], [4, 7], [5, 7], [6, 7], [7, 7]], ["`", [3, 0], [4, 1]], ["a", [2, 4], [2, 5], [3, 1], [3, 3], [3, 6], [4, 1], [4, 3], [4, 6], [5, 1], [5, 3], [5, 6], [6, 2], [6, 3], [6, 4], [6, 5], [7, 6]], ["b", [2, 6], [3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [4, 2], [4, 6], [5, 2], [5, 6], [6, 3], [6, 4], [6, 5]], ["c", [2, 3], [2, 4], [2, 5], [3, 2], [3, 6], [4, 2], [4, 6], [5, 2], [5, 6]], ["d", [3, 3], [3, 4], [3, 5], [4, 2], [4, 6], [5, 2], [5, 6], [6, 0], [6, 1], [6, 2], [6, 3], [6, 4], [6, 5], [7, 6]], ["e", [2, 3], [2, 4], [2, 5], [3, 2], [3, 4], [3, 6], [4, 2], [4, 4], [4, 6], [5, 2], [5, 4], [5, 6], [6, 3], [6, 4]], ["f", [2, 3], [3, 1], [3, 2], [3, 3], [3, 4], [3, 5], [3, 6], [4, 0], [4, 3], [5, 0], [6, 1]], ["g", [2, 3], [2, 4], [3, 2], [3, 5], [3, 7], [4, 2], [4, 5], [4, 7], [5, 2], [5, 5], [5, 7], [6, 3], [6, 4], [6, 5], [6, 6], [7, 2]], ["h", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 3], [4, 2], [5, 2], [6, 3], [6, 4], [6, 5], [6, 6]], ["i", [4, 1], [4, 3], [4, 4], [4, 5], [4, 6]], ["j", [2, 7], [3, 7], [4, 1], [4, 3], [4, 4], [4, 5], [4, 6]], ["k", [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 4], [4, 3], [4, 5], [5, 2], [5, 6]], ["l", [3, 0], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6]], ["m", [0, 2], [1, 3], [1, 4], [1, 5], [1, 6], [2, 2], [3, 2], [4, 3], [4, 4], [5, 2], [6, 2], [7, 3], [7, 4], [7, 5], [7, 6]], ["n", [2, 2], [3, 3], [3, 4], [3, 5], [3, 6], [4, 2], [5, 2], [6, 3], [6, 4], [6, 5], [6, 6]], ["o", [2, 3], [2, 4], [2, 5], [3, 2], [3, 6], [4, 2], [4, 6], [5, 2], [5, 6], [6, 3], [6, 4], [6, 5]], ["p", [2, 2], [3, 3], [3, 4], [3, 5], [3, 6], [3, 7], [4, 2], [4, 5], [5, 2], [5, 5], [6, 3], [6, 4]], ["q", [2, 3], [2, 4], [3, 2], [3, 5], [4, 2], [4, 5], [5, 3], [5, 4], [5, 5], [5, 6], [5, 7], [6, 2]], ["r", [2, 2], [2, 3], [2, 4], [2, 5], [2, 6], [3, 3], [4, 2], [5, 2]], ["s", [2, 3], [2, 6], [3, 2], [3, 4], [3, 6], [4, 2], [4, 4], [4, 6], [5, 2], [5, 5]], ["t", [3, 2], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6], [5, 2]], ["u", [2, 2], [2, 3], [2, 4], [2, 5], [3, 6], [4, 6], [5, 2], [5, 3], [5, 4], [5, 5], [6, 6]], ["v", [2, 2], [2, 3], [2, 4], [3, 5], [4, 6], [5, 5], [6, 2], [6, 3], [6, 4]], ["w", [1, 2], [1, 3], [1, 4], [1, 5], [2, 6], [3, 5], [4, 4], [5, 5], [6, 6], [7, 2], [7, 3], [7, 4], [7, 5]], ["x", [2, 2], [2, 6], [3, 3], [3, 5], [4, 4], [5, 3], [5, 5], [6, 2], [6, 6]], ["y", [3, 2], [3, 3], [3, 4], [3, 7], [4, 5], [4, 7], [5, 5], [5, 7], [6, 2], [6, 3], [6, 4], [6, 5], [6, 6]], ["z", [2, 2], [2, 6], [3, 2], [3, 5], [3, 6], [4, 2], [4, 4], [4, 6], [5, 2], [5, 3], [5, 6]], ["{", [2, 3], [3, 1], [3, 2], [3, 4], [3, 5], [4, 0], [4, 6], [5, 0], [5, 6]], ["|", [4, 0], [4, 1], [4, 2], [4, 3], [4, 4], [4, 5], [4, 6]], ["}", [2, 0], [2, 6], [3, 0], [3, 6], [4, 1], [4, 2], [4, 4], [4, 5], [5, 3]], ["~", [1, 3], [2, 2], [3, 2], [4, 3], [5, 4], [6, 4], [7, 3]]];
public function StarGroup(_arg1:Camera, _arg2:Player, _arg3:FlexGame){
currentLevel = LEVELS.length;
this.camera = _arg1;
this.player = _arg2;
this.flexGame = _arg3;
activeStars = new Array();
animatingStars = new Array();
inactiveStars = new Array();
reset();
}
private function addStars():void{
var _local5:Star;
starsLeft = 0;
var _local1:int = Math.floor(U.randRange(0, (LEVELS.length - 1)));
if (_local1 >= currentLevel){
_local1++;
};
currentLevel = _local1;
var _local2:Array = LEVELS[_local1].slice(1);
var _local3:Array = U.randomArray(_local2.length);
var _local4:int;
while (_local4 < _local3.length) {
_local5 = getStar();
_local5.setDelay(_local4);
_local5.setPosition(_local2[_local3[_local4]][0], _local2[_local3[_local4]][1]);
_local5.setState(Star.STATE_INTRO);
animatingStars.push(_local5);
starsLeft++;
_local4++;
};
starsAdded = Math.max(1, Math.floor((starsLeft / 2)));
flexGame.announceNext(LEVELS[_local1][0]);
if (!helped){
flexGame.help();
helped = true;
};
}
public function update():void{
var _local1:int;
var _local2:Star;
if (((player.visible) && (((activeStars.length + animatingStars.length) == 0)))){
addStars();
} else {
_local1 = 0;
while (_local1 < animatingStars.length) {
_local2 = animatingStars[_local1];
_local2.update();
if (_local2.forRemoval){
inactiveStars.push(_local2);
animatingStars.splice(_local1, 1);
} else {
if (_local2.state == Star.STATE_ACTIVE){
starsAdded--;
if (((player.visible) && ((starsAdded == 0)))){
H.mixColors();
};
activeStars.push(_local2);
animatingStars.splice(_local1, 1);
} else {
_local1++;
};
};
};
_local1 = 0;
while (_local1 < activeStars.length) {
_local2 = activeStars[_local1];
_local2.update();
if (((player.visible) && (captured(_local2)))){
_local2.setState(Star.STATE_CAPTURED);
animatingStars.push(_local2);
activeStars.splice(_local1, 1);
flexGame.addScore();
starsLeft--;
if (starsLeft == 0){
endStars();
flexGame.praise();
flexGame.soundButton.play(S.WIN);
} else {
flexGame.soundButton.play(S.CATCH);
};
} else {
_local1++;
};
};
};
}
private function endStars():void{
var _local3:Star;
var _local1:Array = U.randomArray(animatingStars.length);
var _local2:int;
while (_local2 < _local1.length) {
_local3 = animatingStars[_local1[_local2]];
_local3.setDelay(_local2, 3);
_local3.setState(Star.STATE_OUTRO);
_local2++;
};
}
public function reset():void{
var _local1:Star;
while (animatingStars.length > 0) {
_local1 = animatingStars.pop();
_local1.forRemoval = true;
inactiveStars.push(_local1);
};
while (activeStars.length > 0) {
_local1 = activeStars.pop();
_local1.forRemoval = true;
inactiveStars.push(_local1);
};
helped = false;
}
private function getStar():Star{
var _local1:Star;
if (inactiveStars.length > 0){
_local1 = inactiveStars.pop();
} else {
_local1 = new Star();
};
camera.addSprite(_local1);
return (_local1);
}
private function captured(_arg1:Star):Boolean{
return ((Point.distance(player.worldPoint, _arg1.worldPoint) < (Star.RADIUS + C.PLAYER_RADIUS)));
}
}
}//package
Section 56
//TextButton (TextButton)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class TextButton extends Sprite {
private var textFormat:TextFormat;
private var sprite:Sprite;
private var textField:TextField;
public var isOn:Boolean;// = true
public function TextButton(){
textFormat = new TextFormat();
textField = new TextField();
sprite = new Sprite();
super();
}
public function onClick(_arg1:MouseEvent):void{
isOn = !(isOn);
textField.backgroundColor = (isOn) ? 0x8000 : 0x800000;
whenPressed();
}
public function whenPressed():void{
}
public function construct(_arg1:String):void{
textFormat.align = TextFormatAlign.LEFT;
textFormat.font = "Arial";
textFormat.bold = true;
textFormat.size = 10;
textFormat.color = 0xFFFFFF;
textField.border = true;
textField.borderColor = 0xFFFFFF;
textField.background = true;
textField.backgroundColor = 0x8000;
textField.text = _arg1;
textField.autoSize = TextFieldAutoSize.LEFT;
textField.setTextFormat(textFormat);
textField.x = 0;
textField.y = 0;
addChild(textField);
sprite.graphics.beginFill(0, 0);
sprite.graphics.drawRect(0, 0, textField.width, textField.height);
sprite.graphics.endFill();
sprite.x = 0;
sprite.y = 0;
sprite.buttonMode = true;
addChild(sprite);
sprite.addEventListener(MouseEvent.CLICK, onClick);
}
}
}//package
Section 57
//U (U)
package {
import flash.geom.*;
public class U {
public static function constrainPointInRect(_arg1:Point, _arg2:Rectangle):Point{
return (new Point(constrain(_arg1.x, _arg2.left, (_arg2.right - 1)), constrain(_arg1.y, _arg2.top, (_arg2.bottom - 1))));
}
public static function easePoint(_arg1:Point, _arg2:Point, _arg3:Number, _arg4:Number):Point{
if (Point.distance(_arg1, _arg2) < _arg4){
return (_arg2);
};
return (Point.interpolate(_arg2, _arg1, _arg3));
}
public static function ease(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (Math.abs((_arg2 - _arg1)) < _arg4){
return (_arg2);
};
return ((_arg1 + (_arg3 * (_arg2 - _arg1))));
}
public static function scalePoint(_arg1:Point, _arg2:Number):Point{
return (new Point((_arg2 * _arg1.x), (_arg2 * _arg1.y)));
}
public static function constrain(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (((_arg1 < _arg2)) ? _arg2 : ((_arg1 > _arg3)) ? _arg3 : _arg1);
}
public static function randRange(_arg1:Number, _arg2:Number):Number{
return ((_arg1 + (Math.random() * (_arg2 - _arg1))));
}
public static function randSign():int{
return (((Math.random() < 0.5)) ? 1 : -1);
}
public static function randomArray(_arg1:int):Array{
var _local5:int;
var _local6:Array;
var _local2:Array = new Array();
var _local3:int;
while (_local3 < _arg1) {
_local2.push(_local3);
_local3++;
};
var _local4:Array = new Array();
while (_local2.length > 0) {
_local5 = Math.floor(U.randRange(0, _local2.length));
_local6 = _local2.splice(_local5, 1);
_local4.push(_local6[0]);
};
return (_local4);
}
public static function easeTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number, _arg4:Number):ColorTransform{
return (new ColorTransform(0, 0, 0, 0, ease(_arg1.redOffset, _arg2.redOffset, _arg3, _arg4), ease(_arg1.greenOffset, _arg2.greenOffset, _arg3, _arg4), ease(_arg1.blueOffset, _arg2.blueOffset, _arg3, _arg4), 0xFF));
}
}
}//package