Section 1
//BitmapTransformer (com.flashandmath.bitmaps.BitmapTransformer)
package com.flashandmath.bitmaps {
import flash.display.*;
import flash.geom.*;
public class BitmapTransformer {
private var curVertNew0:Point;
private var curVertNew2:Point;
private var hDiv:int;
private var linMat:Matrix;
private var curVertNew1:Point;
private var finMat:Matrix;
private var newVertsArray:Array;
private var curVertOld0:Point;
private var curVertOld1:Point;
private var curVertOld2:Point;
private var vertsArray:Array;
private var i:int;
private var j:int;
public var smoothOn:Boolean;
private var dataHeight:Number;
private var vDiv:int;
private var dataWidth:Number;
public function BitmapTransformer(_arg1:Number, _arg2:Number, _arg3:int=5, _arg4:int=5){
curVertOld0 = new Point();
curVertNew0 = new Point();
curVertOld1 = new Point();
curVertNew1 = new Point();
curVertOld2 = new Point();
curVertNew2 = new Point();
finMat = new Matrix();
linMat = new Matrix();
super();
this.dataWidth = _arg1;
this.dataHeight = _arg2;
this.hDiv = _arg3;
this.vDiv = _arg4;
this.vertsArray = [];
this.newVertsArray = [];
this.smoothOn = false;
setVertices();
}
private function setVertices():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:Number = (dataWidth / hDiv);
var _local5:Number = (dataHeight / vDiv);
_local1 = 0;
while (_local1 <= vDiv) {
vertsArray[_local1] = [];
_local2 = 0;
while (_local2 <= hDiv) {
vertsArray[_local1][_local2] = new Point((_local2 * _local4), (_local1 * _local5));
_local2++;
};
_local1++;
};
}
public function mapBitmapData(_arg1:BitmapData, _arg2:Point, _arg3:Point, _arg4:Point, _arg5:Point, _arg6:Shape, _arg7:int=-1):void{
if ((((_arg2.x > _arg3.x)) || ((_arg2.y > _arg5.y)))){
return;
};
var _local8:Boolean;
if (_arg7 == -1){
_local8 = true;
};
calcNewVerts(_arg2, _arg3, _arg4, _arg5);
j = 0;
while (j < vDiv) {
i = 0;
while (i < hDiv) {
curVertOld0.x = vertsArray[j][i].x;
curVertOld0.y = vertsArray[j][i].y;
curVertOld1.x = vertsArray[(j + 1)][i].x;
curVertOld1.y = vertsArray[(j + 1)][i].y;
curVertOld2.x = vertsArray[j][(i + 1)].x;
curVertOld2.y = vertsArray[j][(i + 1)].y;
curVertNew0.x = newVertsArray[j][i].x;
curVertNew0.y = newVertsArray[j][i].y;
curVertNew1.x = newVertsArray[(j + 1)][i].x;
curVertNew1.y = newVertsArray[(j + 1)][i].y;
curVertNew2.x = newVertsArray[j][(i + 1)].x;
curVertNew2.y = newVertsArray[j][(i + 1)].y;
finMat.tx = curVertOld0.x;
finMat.ty = curVertOld0.y;
finMat.a = 0;
finMat.b = ((curVertOld1.y - curVertOld0.y) / dataWidth);
finMat.c = ((curVertOld2.x - curVertOld0.x) / dataHeight);
finMat.d = 0;
linMat.a = ((curVertNew1.x - curVertNew0.x) / dataWidth);
linMat.b = ((curVertNew1.y - curVertNew0.y) / dataWidth);
linMat.c = ((curVertNew2.x - curVertNew0.x) / dataHeight);
linMat.d = ((curVertNew2.y - curVertNew0.y) / dataHeight);
linMat.tx = curVertNew0.x;
linMat.ty = curVertNew0.y;
finMat.invert();
finMat.concat(linMat);
if (_local8){
_arg6.graphics.beginBitmapFill(_arg1, finMat, false, smoothOn);
} else {
_arg6.graphics.beginFill(_arg7, 1);
};
_arg6.graphics.moveTo(curVertNew0.x, curVertNew0.y);
_arg6.graphics.lineTo(curVertNew1.x, curVertNew1.y);
_arg6.graphics.lineTo(curVertNew2.x, curVertNew2.y);
_arg6.graphics.lineTo(curVertNew0.x, curVertNew0.y);
_arg6.graphics.endFill();
curVertOld0.x = vertsArray[(j + 1)][(i + 1)].x;
curVertOld0.y = vertsArray[(j + 1)][(i + 1)].y;
curVertOld1.x = vertsArray[j][(i + 1)].x;
curVertOld1.y = vertsArray[j][(i + 1)].y;
curVertOld2.x = vertsArray[(j + 1)][i].x;
curVertOld2.y = vertsArray[(j + 1)][i].y;
curVertNew0.x = newVertsArray[(j + 1)][(i + 1)].x;
curVertNew0.y = newVertsArray[(j + 1)][(i + 1)].y;
curVertNew1.x = newVertsArray[j][(i + 1)].x;
curVertNew1.y = newVertsArray[j][(i + 1)].y;
curVertNew2.x = newVertsArray[(j + 1)][i].x;
curVertNew2.y = newVertsArray[(j + 1)][i].y;
finMat.tx = curVertOld0.x;
finMat.ty = curVertOld0.y;
finMat.a = 0;
finMat.b = ((curVertOld1.y - curVertOld0.y) / dataWidth);
finMat.c = ((curVertOld2.x - curVertOld0.x) / dataHeight);
finMat.d = 0;
linMat.a = ((curVertNew1.x - curVertNew0.x) / dataWidth);
linMat.b = ((curVertNew1.y - curVertNew0.y) / dataWidth);
linMat.c = ((curVertNew2.x - curVertNew0.x) / dataHeight);
linMat.d = ((curVertNew2.y - curVertNew0.y) / dataHeight);
linMat.tx = curVertNew0.x;
linMat.ty = curVertNew0.y;
finMat.invert();
finMat.concat(linMat);
if (_local8){
_arg6.graphics.beginBitmapFill(_arg1, finMat, false, smoothOn);
} else {
_arg6.graphics.beginFill(_arg7, 1);
};
_arg6.graphics.moveTo(curVertNew0.x, curVertNew0.y);
_arg6.graphics.lineTo(curVertNew1.x, curVertNew1.y);
_arg6.graphics.lineTo(curVertNew2.x, curVertNew2.y);
_arg6.graphics.lineTo(curVertNew0.x, curVertNew0.y);
_arg6.graphics.endFill();
i++;
};
j++;
};
}
public function simpleMapBitmapData(_arg1:BitmapData, _arg2:Point, _arg3:Point, _arg4:Point, _arg5:Point, _arg6:Shape, _arg7:int=-1):void{
var _local8:Matrix = new Matrix(((_arg3.x - _arg2.x) / dataWidth), 0, 0, ((_arg4.y - _arg3.y) / dataHeight), _arg2.x, _arg2.y);
var _local9:Boolean;
if (_arg7 == -1){
_local9 = true;
};
if (_local9){
_arg6.graphics.beginBitmapFill(_arg1, _local8, false, smoothOn);
} else {
_arg6.graphics.beginFill(_arg7, 1);
};
_arg6.graphics.moveTo(_arg2.x, _arg2.y);
_arg6.graphics.lineTo(_arg3.x, _arg3.y);
_arg6.graphics.lineTo(_arg4.x, _arg4.y);
_arg6.graphics.lineTo(_arg5.x, _arg5.y);
_arg6.graphics.endFill();
}
private function calcNewVerts(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Point):void{
var _local5:int;
var _local6:int;
var _local9:Point;
var _local10:Number;
var _local11:Number;
var _local7:Array = [(_arg4.x - _arg1.x), (_arg4.y - _arg1.y)];
var _local8:Array = [(_arg3.x - _arg2.x), (_arg3.y - _arg2.y)];
var _local12:Point = new Point();
var _local13:Point = new Point();
var _local14:Point = new Point();
_local6 = 0;
while (_local6 <= vDiv) {
newVertsArray[_local6] = [];
_local5 = 0;
while (_local5 <= hDiv) {
newVertsArray[_local6][_local5] = new Point();
_local9 = vertsArray[_local6][_local5];
_local10 = (_local9.y / dataHeight);
_local11 = (_local9.x / dataWidth);
_local12.x = (_arg1.x + (_local10 * _local7[0]));
_local12.y = (_arg1.y + (_local10 * _local7[1]));
_local13.x = (_arg2.x + (_local10 * _local8[0]));
_local13.y = (_arg2.y + (_local10 * _local8[1]));
_local14.x = (_local12.x + ((_local13.x - _local12.x) * _local11));
_local14.y = (_local12.y + ((_local13.y - _local12.y) * _local11));
newVertsArray[_local6][_local5].x = _local14.x;
newVertsArray[_local6][_local5].y = _local14.y;
_local5++;
};
_local6++;
};
}
}
}//package com.flashandmath.bitmaps
Section 2
//SWFBridgeAS3 (com.gskinner.utils.SWFBridgeAS3)
package com.gskinner.utils {
import flash.events.*;
import flash.net.*;
public class SWFBridgeAS3 extends EventDispatcher {
private var myID:String;
private var host:Boolean;// = true
private var _connected:Boolean;// = false
private var baseID:String;
private var clientObj:Object;
private var lc:LocalConnection;
private var extID:String;
public function SWFBridgeAS3(_arg1:String, _arg2:Object){
var p_id = _arg1;
var p_clientObj = _arg2;
super();
baseID = p_id.split(":").join("");
lc = new LocalConnection();
lc.client = this;
clientObj = p_clientObj;
try {
lc.connect((baseID + "_host"));
} catch(e:ArgumentError) {
host = false;
};
myID = (baseID + (host) ? "_host" : "_guest");
extID = (baseID + (host) ? "_guest" : "_host");
if (!host){
lc.connect(myID);
lc.send(extID, "com_gskinner_utils_SWFBridge_init");
};
}
public function com_gskinner_utils_SWFBridge_init():void{
trace(("SWFBridge (AS3) connected: " + (host) ? "host" : "client"));
if (host){
lc.send(extID, "com_gskinner_utils_SWFBridge_init");
};
_connected = true;
dispatchEvent(new Event(Event.CONNECT));
}
public function close():void{
try {
lc.close();
} catch(e) {
};
lc = null;
clientObj = null;
if (!_connected){
throw (new ArgumentError("Close failed because the object is not connected."));
};
_connected = false;
}
public function get connected():Boolean{
return (_connected);
}
public function send(_arg1:String, ... _args):void{
if (!_connected){
throw (new ArgumentError("Send failed because the object is not connected."));
};
_args.unshift(_arg1);
_args.unshift("com_gskinner_utils_SWFBridge_receive");
_args.unshift(extID);
lc.send.apply(lc, _args);
}
public function get id():String{
return (baseID);
}
public function com_gskinner_utils_SWFBridge_receive(_arg1:String, ... _args):void{
var p_method = _arg1;
var p_args = _args;
try {
clientObj[p_method].apply(clientObj, p_args);
} catch(e) {
trace(("SWFBridge ERROR: " + e));
};
}
}
}//package com.gskinner.utils
Section 3
//Animation (com.HazmiWeb.BitmapAnimation.Animation)
package com.HazmiWeb.BitmapAnimation {
import flash.display.*;
public class Animation {
public var centerX:Number;// = 0
public var centerY:Number;// = 0
public var height:int;
public var name:String;
public var width:int;
public var state:Array;
public var bitmapData:BitmapData;
public function Animation(_arg1:BitmapData, _arg2:String, _arg3:int, _arg4:int, _arg5:Number=0, _arg6:Number=0){
state = new Array();
super();
bitmapData = _arg1;
name = _arg2;
width = _arg3;
height = _arg4;
centerX = _arg5;
centerY = _arg6;
}
public function addState(_arg1:String, _arg2:String="none", _arg3:int=1):AnimationState{
state[_arg1] = new AnimationState(_arg1, _arg2, _arg3);
return (state[_arg1]);
}
public function getState(_arg1:String):AnimationState{
return (state[_arg1]);
}
}
}//package com.HazmiWeb.BitmapAnimation
Section 4
//AnimationController (com.HazmiWeb.BitmapAnimation.AnimationController)
package com.HazmiWeb.BitmapAnimation {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.HazmiWeb.Collision.CircleCollision.*;
public class AnimationController extends Bitmap {
public var collisions:Array;
private var _animation:Animation;
private var _oldRotation:Number;// = 800
private var _doublePi:Number;// = 6.28318530717959
private var _state:AnimationState;
private var _zeroAngle:Number;// = 0
private var _yOffset:Number;// = 0
public var collisionType:String;// = ""
private var _radius:Number;// = 0
public var location:Point;
private var _rotationDegreeFactor:Number;// = 0.01745329
public var rotation_in_radians:Number;// = 0
public var trackCollisions:Boolean;// = false
private var _timer:int;
public var defaultState:String;// = ""
public var collisionTargetTypes:Array;
private var _nextState:String;// = ""
private var _xOffset:Number;// = 0
public var _frame:AnimationFrame;
private var _scrollRect:Rectangle;
public var isCollisionTracker:Boolean;// = false
public function AnimationController(){
_scrollRect = new Rectangle();
location = new Point();
collisionTargetTypes = new Array();
collisions = new Array();
super();
}
override public function set x(_arg1:Number):void{
location.x = _arg1;
super.x = (location.x + _xOffset);
}
private function getRadius(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public function get state():String{
return (_state.name);
}
override public function set y(_arg1:Number):void{
location.y = _arg1;
super.y = (location.y + _yOffset);
}
private function getAngleRadians(_arg1:Number, _arg2:Number):Number{
return (Math.atan2(_arg2, _arg1));
}
override public function set scaleX(_arg1:Number):void{
super.scaleX = _arg1;
calculateOffset();
}
override public function set scaleY(_arg1:Number):void{
super.scaleY = _arg1;
calculateOffset();
}
public function set state(_arg1:String):void{
_state = _animation.getState(_arg1);
_frame = (_state.getFrame(1) as AnimationFrame);
_timer = 0;
drawLocation();
}
public function getParentPos(_arg1:Point):Point{
var _local3:Number;
var _local4:Number;
var _local2:Point = _arg1.clone();
if (rotation_in_radians == 0){
_local2.x = (_local2.x + super.x);
_local2.y = (_local2.y + super.y);
} else {
_local3 = getRadius(_local2.x, _local2.y);
_local4 = getAngleRadians(_local2.x, _local2.y);
_local4 = (_local4 + rotation_in_radians);
_local2.x = (super.x + (Math.cos(_local4) * (_local3 * scaleX)));
_local2.y = (super.y + (Math.sin(_local4) * (_local3 * scaleY)));
};
return (_local2);
}
override public function get height():Number{
return (_scrollRect.height);
}
private function calculateOffset():void{
_xOffset = (-(Math.sin((rotation_in_radians + _zeroAngle))) * (_radius * scaleX));
_yOffset = (Math.cos((rotation_in_radians + _zeroAngle)) * (_radius * scaleY));
super.x = (location.x + _xOffset);
super.y = (location.y + _yOffset);
}
public function resetCollisions():void{
collisions.splice(0);
_frame.collisionCircles.resetLocations();
}
public function set scale(_arg1:Number):void{
super.scaleX = _arg1;
super.scaleY = _arg1;
calculateOffset();
}
public function updateAnimation(_arg1:int):void{
_timer = (_timer + _arg1);
while (_timer >= _frame.durationMs) {
_timer = (_timer - _frame.durationMs);
_frame = _state.getNextFrame(_frame.index);
if (_frame == null){
if (defaultState == ""){
dispatchEvent(new Event("ANIMATIONEND", false, false));
} else {
state = defaultState;
};
return;
};
drawLocation();
};
}
public function get scale():Number{
return (super.scaleX);
}
override public function get width():Number{
return (_scrollRect.width);
}
private function drawLocation():void{
_scrollRect.x = _frame.location.x;
_scrollRect.y = _frame.location.y;
this.scrollRect = _scrollRect;
}
public function initAnimation(_arg1:Animation, _arg2:String, _arg3:String=""):void{
_animation = _arg1;
defaultState = _arg3;
this.bitmapData = _animation.bitmapData;
_scrollRect.width = _arg1.width;
_scrollRect.height = _arg1.height;
setBaseOffset(_animation.centerX, _animation.centerY);
state = _arg2;
}
public function setBaseOffset(_arg1:Number, _arg2:Number):void{
_radius = getRadius(_arg1, _arg2);
_zeroAngle = getAngleRadians(-(_arg2), _arg1);
calculateOffset();
}
public function isColliding(_arg1:AnimationController):Boolean{
return (CircleCollider.areCirclesColliding(this, _arg1));
}
override public function get x():Number{
return (location.x);
}
override public function get y():Number{
return (location.y);
}
override public function set rotation(_arg1:Number):void{
if (_oldRotation != _arg1){
_oldRotation = _arg1;
super.rotation = _arg1;
rotation_in_radians = (_rotationDegreeFactor * rotation);
calculateOffset();
};
}
override public function get rotation():Number{
return (super.rotation);
}
}
}//package com.HazmiWeb.BitmapAnimation
Section 5
//AnimationData (com.HazmiWeb.BitmapAnimation.AnimationData)
package com.HazmiWeb.BitmapAnimation {
import flash.display.*;
import flash.geom.*;
import com.HazmiWeb.Collision.CircleCollision.*;
public class AnimationData {
private var _bitmapDatas:Array;
private var _animations:Array;
public function AnimationData(){
_animations = new Array();
_bitmapDatas = new Array();
super();
}
public function setBitmapToFrame(_arg1:Bitmap, _arg2:String, _arg3:String, _arg4:int=1):void{
var _local5:Animation = getAnimation(_arg2);
var _local6:Point = _local5.getState(_arg3).getFrame(_arg4).location;
var _local7:Rectangle = new Rectangle(_local6.x, _local6.y, _local5.width, _local5.height);
_arg1.bitmapData = _local5.bitmapData;
_arg1.scrollRect = _local7;
}
public function addAnimation(_arg1:XML):void{
var _local2:XML;
var _local3:BitmapData;
var _local4:XML;
var _local5:Animation;
var _local6:Point;
var _local7:Point;
var _local8:XMLList;
var _local9:XML;
var _local10:AnimationState;
var _local11:Point;
var _local12:int;
var _local13:XML;
var _local14:CollisionCircles;
var _local15:XML;
for each (_local2 in _arg1.asset) {
_local3 = addBitmapData(_local2.@bitmap);
for each (_local4 in _local2.animation) {
_local5 = new Animation(_local3, _local4.@name, _local4.@width, _local4.@height, _local4.@centerx, _local4.@centery);
_local6 = new Point(_local5.width, _local5.height);
_local7 = new Point(_local5.centerX, _local5.centerY);
_local8 = new XMLList();
_animations[_local4.@name] = _local5;
for each (_local9 in _local4.state) {
_local10 = _local5.addState(_local9.@name, _local9.@loop, _local9.@loopframe);
_local11 = new Point();
_local12 = 80;
for each (_local13 in _local9.frame) {
_local11.x = filterEmpty(_local13.@x, _local11.x);
_local11.y = filterEmpty(_local13.@y, _local11.y);
_local12 = filterEmpty(_local13.@delay, _local12);
if (_local13.collisionCircles.length() > 0){
_local8 = _local13.collisionCircles;
};
_local14 = new CollisionCircles(_local7);
for each (_local15 in _local8.circle) {
_local14.addCircle(new Circle(new Point(_local15.@x, _local15.@y), _local15.@radius, _local15.@name));
};
_local10.addFrame(_local11, _local12, _local14);
};
};
};
};
}
private function filterEmpty(_arg1:String, _arg2:int):int{
if (_arg1 == ""){
return (_arg2);
};
return (int(_arg1));
}
public function getAnimation(_arg1:String):Animation{
return ((_animations[_arg1] as Animation));
}
private function addBitmapData(_arg1:String):BitmapData{
if (_bitmapDatas[_arg1] == null){
_bitmapDatas[_arg1] = (Assets.getBitmapDataAsset(_arg1) as BitmapData);
} else {
trace(("bitmap already exists: " + _arg1));
};
return (_bitmapDatas[_arg1]);
}
public function dispose():void{
_animations = null;
_bitmapDatas = null;
delete ??getglobalscope
[this];
}
}
}//package com.HazmiWeb.BitmapAnimation
Section 6
//AnimationFrame (com.HazmiWeb.BitmapAnimation.AnimationFrame)
package com.HazmiWeb.BitmapAnimation {
import flash.geom.*;
import com.HazmiWeb.Collision.CircleCollision.*;
public class AnimationFrame {
public var index:int;
public var location:Point;
public var collisionCircles:CollisionCircles;
public var durationMs:int;// = 0
public function AnimationFrame(_arg1:Point, _arg2:int, _arg3:int, _arg4:CollisionCircles=null){
location = new Point();
super();
location = _arg1;
durationMs = _arg2;
index = _arg3;
collisionCircles = _arg4;
}
}
}//package com.HazmiWeb.BitmapAnimation
Section 7
//AnimationState (com.HazmiWeb.BitmapAnimation.AnimationState)
package com.HazmiWeb.BitmapAnimation {
import flash.geom.*;
import com.HazmiWeb.Collision.CircleCollision.*;
public class AnimationState {
public var frames:Array;
public var loopFrame:int;// = 1
public var name:String;// = ""
public var frameCounter:int;// = 0
public var loopType:String;// = ""
public function AnimationState(_arg1:String, _arg2:String, _arg3:int){
frames = new Array();
super();
name = _arg1;
loopType = _arg2;
loopFrame = _arg3;
}
public function getNextFrame(_arg1:int):AnimationFrame{
if (loopType == "static"){
return (frames[_arg1]);
};
if (_arg1 < frameCounter){
return (frames[(_arg1 + 1)]);
};
if (loopType == "none"){
return (frames[_arg1]);
};
if (loopType == "normal"){
return (frames[loopFrame]);
};
return (null);
}
public function getLocationForFrame(_arg1:int):Point{
return (frames[_arg1].location);
}
public function addFrame(_arg1:Point, _arg2:int, _arg3:CollisionCircles=null):void{
frameCounter = (frameCounter + 1);
var _local4:AnimationFrame = new AnimationFrame(_arg1.clone(), _arg2, frameCounter, _arg3);
frames[frameCounter] = _local4;
}
public function getTimeForFrame(_arg1:int):int{
return (frames[_arg1].durationMs);
}
public function getFrame(_arg1:int):AnimationFrame{
return (frames[_arg1]);
}
}
}//package com.HazmiWeb.BitmapAnimation
Section 8
//Circle (com.HazmiWeb.Collision.CircleCollision.Circle)
package com.HazmiWeb.Collision.CircleCollision {
import flash.geom.*;
public class Circle {
public var name:String;// = ""
public var radius:Number;// = 0
public var locationBuffered:Boolean;// = false
public var locationBuffer:Point;
public var id:String;// = ""
public var location:Point;
public function Circle(_arg1:Point=null, _arg2:Number=0, _arg3:String=""){
location = new Point();
locationBuffer = new Point();
super();
if (_arg1 != null){
location = _arg1;
};
radius = _arg2;
name = _arg3;
id = CircleId.calculateNextID();
}
public function clone():Circle{
var _local1:Circle = new Circle(location.clone(), radius, name);
return (_local1);
}
}
}//package com.HazmiWeb.Collision.CircleCollision
Section 9
//CircleCollider (com.HazmiWeb.Collision.CircleCollision.CircleCollider)
package com.HazmiWeb.Collision.CircleCollision {
import flash.geom.*;
import com.HazmiWeb.BitmapAnimation.*;
public class CircleCollider {
public static function testCollision(_arg1:AnimationController, _arg2:AnimationController):void{
var _local5:Circle;
var _local6:Circle;
var _local3:Number = (_arg1._frame.collisionCircles.enclosingCircleRotationPoint.radius + _arg2._frame.collisionCircles.enclosingCircleRotationPoint.radius);
var _local4:Number = Point.distance(_arg1.location, _arg2.location);
if (_local4 <= _local3){
for each (_local5 in _arg1._frame.collisionCircles.circles) {
for each (_local6 in _arg2._frame.collisionCircles.circles) {
_local4 = Point.distance(_arg1.getParentPos(_local5.location), _arg2.getParentPos(_local6.location));
if (_local4 < (_local5.radius + _local6.radius)){
_arg1.collisions.push(new Collision(_arg2, _local6.name, _local5.name));
_arg2.collisions.push(new Collision(_arg1, _local5.name, _local6.name));
return;
};
};
};
};
}
public static function areCirclesColliding(_arg1:AnimationController, _arg2:AnimationController):Boolean{
var _local5:Circle;
var _local6:Circle;
var _local3:Number = (_arg1._frame.collisionCircles.enclosingCircleRotationPoint.radius + _arg2._frame.collisionCircles.enclosingCircleRotationPoint.radius);
var _local4:Number = Point.distance(_arg1.location, _arg2.location);
if (_local4 > _local3){
return (false);
};
for each (_local5 in _arg1._frame.collisionCircles.circles) {
for each (_local6 in _arg2._frame.collisionCircles.circles) {
_local4 = Point.distance(_arg1.getParentPos(_local5.location), _arg2.getParentPos(_local6.location));
if (_local4 < (_local5.radius + _local6.radius)){
trace(("hit: " + _local6.name));
return (true);
};
};
};
return (false);
}
}
}//package com.HazmiWeb.Collision.CircleCollision
Section 10
//CircleId (com.HazmiWeb.Collision.CircleCollision.CircleId)
package com.HazmiWeb.Collision.CircleCollision {
public class CircleId {
private static var m_id:int = 1;
public static function calculateNextID():String{
return (String(m_id++));
}
}
}//package com.HazmiWeb.Collision.CircleCollision
Section 11
//Collision (com.HazmiWeb.Collision.CircleCollision.Collision)
package com.HazmiWeb.Collision.CircleCollision {
import com.HazmiWeb.BitmapAnimation.*;
public class Collision {
public var myCircle:String;
public var collideWithCircle:String;
public var collidedWith:AnimationController;
public function Collision(_arg1:AnimationController, _arg2:String, _arg3:String){
collidedWith = _arg1;
collideWithCircle = _arg2;
myCircle = _arg3;
}
}
}//package com.HazmiWeb.Collision.CircleCollision
Section 12
//CollisionCircles (com.HazmiWeb.Collision.CircleCollision.CollisionCircles)
package com.HazmiWeb.Collision.CircleCollision {
import flash.geom.*;
public class CollisionCircles {
public var enclosingCircleRotationPoint:Circle;
public var circles:Array;
public function CollisionCircles(_arg1:Point):void{
circles = new Array();
enclosingCircleRotationPoint = new Circle();
super();
enclosingCircleRotationPoint.location = _arg1;
}
public function addCircle(_arg1:Circle):void{
var _local2:Circle = _arg1.clone();
circles.push(_local2);
calculateEnclosingCircleRotationPoint();
}
private function calculateEnclosingCircleRotationPoint():void{
var _local2:Circle;
var _local3:Number;
var _local1:Number = 0;
for each (_local2 in circles) {
_local3 = Point.distance(enclosingCircleRotationPoint.location, _local2.location);
_local3 = (_local3 + _local2.radius);
if (_local3 > _local1){
_local1 = _local3;
};
};
enclosingCircleRotationPoint.radius = _local1;
}
public function resetLocations():void{
var _local1:Circle;
for each (_local1 in circles) {
_local1.locationBuffered = false;
};
}
}
}//package com.HazmiWeb.Collision.CircleCollision
Section 13
//ParameterEvent (com.HazmiWeb.events.ParameterEvent)
package com.HazmiWeb.events {
import flash.events.*;
public class ParameterEvent extends Event {
public var params:Object;
public static const CUSTOM:String = "CUSTOM";
public static const READY:String = "READY";
public static const BEER:String = "BEER";
public static const CLICK:String = "CLICK";
public function ParameterEvent(_arg1:String, _arg2:Object, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.params = _arg2;
}
override public function toString():String{
return (formatToString("CustomEvent", "params", "type", "bubbles", "cancelable"));
}
override public function clone():Event{
return (new ParameterEvent(type, this.params, bubbles, cancelable));
}
}
}//package com.HazmiWeb.events
Section 14
//FloatingChar (com.HazmiWeb.floatingchars.FloatingChar)
package com.HazmiWeb.floatingchars {
import flash.events.*;
import flash.text.*;
public class FloatingChar extends TextField {
private var _hideForever:Boolean;// = false
private var _maxFallSpeed:Number;// = 20
private var _targetX:Number;
private var _targetY:Number;
private var _visibleAlpha:Number;// = 1
private var _fallSpeed:Number;// = 0
private var _ttw:Number;
private var _fallAccell:Number;// = 0.5
public function FloatingChar(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number){
_ttw = _arg2;
_targetX = _arg3;
_targetY = _arg4;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
GameFont.setTextFieldStyle1(this, 36, TextFormatAlign.CENTER);
text = _arg1;
if (_arg1.length > 1){
scaleX = 0.5;
};
alpha = 0;
cacheAsBitmap = true;
}
private function onMouseOver(_arg1:Event):void{
if (y == _targetY){
_fallSpeed = -3;
};
}
private function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
}
public function tick(_arg1:Number):void{
if (_hideForever){
return;
};
if (_ttw > 0){
_ttw = (_ttw - _arg1);
if (_ttw <= 0){
alpha = _visibleAlpha;
} else {
return;
};
};
x = (x + ((_targetX - x) / 12));
_fallSpeed = (_fallSpeed + _fallAccell);
if (_fallSpeed > _maxFallSpeed){
_fallSpeed = _maxFallSpeed;
};
y = (y + _fallSpeed);
if (y > _targetY){
y = _targetY;
};
}
public function exit():void{
_targetX = (Math.random() * 640);
_targetY = 580;
_ttw = 0;
}
public function disable():void{
removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
_visibleAlpha = 0.4;
if (alpha != 0){
alpha = _visibleAlpha;
};
}
public function hide(_arg1:int):void{
if (_arg1 <= 0){
_hideForever = true;
} else {
_ttw = _arg1;
};
alpha = 0;
}
public function show():void{
_hideForever = false;
alpha = _visibleAlpha;
}
}
}//package com.HazmiWeb.floatingchars
Section 15
//FloatingChars (com.HazmiWeb.floatingchars.FloatingChars)
package com.HazmiWeb.floatingchars {
import flash.events.*;
import com.HazmiWeb.events.*;
import flash.display.*;
import flash.utils.*;
public class FloatingChars extends Sprite {
private var _chars:Array;
private var _height:Number;
private var _width:Number;
private var _timer:Timer;
private var _activateFirst:int;
public function FloatingChars(_arg1:Number, _arg2:Number, _arg3:int=0){
_width = _arg1;
_height = _arg2;
_activateFirst = _arg3;
}
private function onCharClick(_arg1:MouseEvent):void{
var _local2:FloatingChar = (_arg1.currentTarget as FloatingChar);
if (_local2.alpha == 0){
return;
};
_local2.hide(1000);
dispatchEvent(new ParameterEvent(ParameterEvent.CLICK, _local2, false, true));
}
private function calculateSpaceBetweenChars():Number{
return (60);
trace("a:", arguments, (_width / arguments));
trace("b:", _local2, (_height / _local2));
return ((_width / arguments));
}
public function tick(_arg1:Number):void{
}
public function initChars():void{
var _local5:int;
var _local6:String;
var _local7:FloatingChar;
var _local1:Number = calculateSpaceBetweenChars();
var _local2:Number = 10;
var _local3:Number = 0;
var _local4:Number = 0;
_local5 = 0;
for each (_local6 in _chars) {
_local7 = new FloatingChar(_local6, _local2, _local3, _local4);
_local5++;
_local7.x = (_width - _local3);
_local7.y = -120;
addChild(_local7);
if ((((_activateFirst == 0)) || ((_activateFirst >= _local5)))){
_local7.addEventListener(MouseEvent.CLICK, onCharClick, false, 0, true);
} else {
_local7.disable();
};
_local3 = (_local3 + _local1);
if (_local3 >= _width){
_local4 = (_local4 + _local1);
_local3 = 0;
};
_local2 = (_local2 + 25);
};
}
private function onTimer(_arg1:TimerEvent):void{
var _local3:FloatingChar;
var _local2:int;
while (_local2 < numChildren) {
_local3 = (getChildAt(_local2) as FloatingChar);
if (_local3){
_local3.tick(_timer.delay);
};
_local2++;
};
}
public function set chars(_arg1:Array):void{
_chars = _arg1;
initChars();
_timer = new Timer(30);
_timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
_timer.start();
}
public function get chars():Array{
return (_chars);
}
public function hideAll():void{
var _local2:FloatingChar;
var _local1:int;
while (_local1 < numChildren) {
_local2 = (getChildAt(_local1) as FloatingChar);
if (_local2){
_local2.exit();
};
_local1++;
};
}
}
}//package com.HazmiWeb.floatingchars
Section 16
//DisplayObjectPath (com.HazmiWeb.Paths.DisplayObjectPath)
package com.HazmiWeb.Paths {
import flash.display.*;
public class DisplayObjectPath {
public var target:DisplayObject;
private var _addPos:int;
public var posList:Array;
public function DisplayObjectPath(){
posList = new Array();
_addPos = 0;
}
public function setPos(_arg1:DisplayObject=null, _arg2:int=0, _arg3:Boolean=false):Boolean{
var _local4:DisplayObjectPathPosition;
if (_arg1 == null){
_arg1 = target;
};
if (_arg3){
_arg2 = (_arg2 % _addPos);
};
_local4 = posList[_arg2];
if (_local4 != null){
_arg1.x = _local4.x;
_arg1.y = _local4.y;
_arg1.alpha = _local4.alpha;
_arg1.rotation = _local4.rotation;
};
return ((_arg2 >= _addPos));
}
public function get positionsCount():int{
return (_addPos);
}
public function setRelativePos(_arg1:Number, _arg2:Number, _arg3:DisplayObject=null, _arg4:int=0, _arg5:Boolean=false):void{
if (_arg3 == null){
_arg3 = target;
};
if (_arg5){
_arg4 = (_arg4 % _addPos);
};
var _local6:DisplayObjectPathPosition = posList[_arg4];
if (_local6 != null){
_arg3.x = (_local6.x + _arg1);
_arg3.y = (_local6.y + _arg2);
_arg3.alpha = _local6.alpha;
_arg3.rotation = _local6.rotation;
};
}
public function addWait(_arg1:int=1):void{
_addPos = (_addPos + _arg1);
}
public function addPos(_arg1:DisplayObjectPathPosition):void{
posList[_addPos] = new DisplayObjectPathPosition(_arg1.x, _arg1.y, _arg1.alpha, _arg1.rotation);
_addPos++;
}
}
}//package com.HazmiWeb.Paths
Section 17
//DisplayObjectPathGenerator (com.HazmiWeb.Paths.DisplayObjectPathGenerator)
package com.HazmiWeb.Paths {
import com.HazmiWeb.*;
import flash.display.*;
public class DisplayObjectPathGenerator extends Ease {
public var startRotation:Number;// = 0
public var rotationFacingUp:Number;// = 0
public var endAlpha:Number;// = 1
public var startX:Number;// = 0
private var _modelObject:DisplayObject;
public var easeDirectionRotation:int;// = 1
public var startAlpha:Number;// = 1
public var endX:Number;// = 0
public var endY:Number;// = 0
public var easeDirectionPos:int;// = 1
public var easeTypeRotation:int;// = 1
public var easeDirectionAlpha:int;// = 1
public var easeTypePos:int;// = 1
public var ticks:int;
public var startY:Number;// = 0
public var endRotation:Number;// = 0
public var easeTypeAlpha:int;// = 1
public function generatePathTo(_arg1:DisplayObjectPath):void{
var _local3:DisplayObjectPathPosition;
var _local2:int;
while (_local2 <= ticks) {
_local3 = new DisplayObjectPathPosition();
_local3.x = ease(_local2, startX, endX, ticks, easeTypePos, easeDirectionPos);
_local3.y = ease(_local2, startY, endY, ticks, easeTypePos, easeDirectionPos);
_local3.alpha = ease(_local2, startAlpha, endAlpha, ticks, easeTypeAlpha, easeDirectionAlpha);
_local3.rotation = ease(_local2, startRotation, endRotation, ticks, easeTypeRotation, easeDirectionRotation);
_arg1.addPos(_local3);
_local2++;
};
}
public function getPath():DisplayObjectPath{
var _local1:DisplayObjectPath = new DisplayObjectPath();
generatePathTo(_local1);
return (_local1);
}
}
}//package com.HazmiWeb.Paths
Section 18
//DisplayObjectPathPosition (com.HazmiWeb.Paths.DisplayObjectPathPosition)
package com.HazmiWeb.Paths {
public class DisplayObjectPathPosition {
public var rotation:Number;
public var x:Number;
public var y:Number;
public var alpha:Number;
public function DisplayObjectPathPosition(_arg1:Number=0, _arg2:Number=0, _arg3:Number=1, _arg4:Number=0){
x = _arg1;
y = _arg2;
alpha = _arg3;
rotation = _arg4;
}
}
}//package com.HazmiWeb.Paths
Section 19
//TopScoresArmorBot (com.HazmiWeb.TopScores.TopScoresArmorBot)
package com.HazmiWeb.TopScores {
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class TopScoresArmorBot extends EventDispatcher {
public var lastestTop:XML;
private var _SU0249:String;// = "MzQ1NWolZSVhJW4lcw=="
private var _loader:URLLoader;
private var _flashkey:String;// = "eWVxclhIQ1E="
private function onIOError(_arg1:IOErrorEvent):void{
dispatchEvent(new Event("ERROR"));
}
private function onSendTop(_arg1:Event):void{
dispatchEvent(new Event("TOPSENT"));
}
public function addScore(_arg1:String, _arg2:int):void{
var _local3:URLRequest = new URLRequest("http://rankz.armorbot.com/submit/as3_v0.php");
_local3.method = URLRequestMethod.POST;
var _local4:URLVariables = new URLVariables();
_local4.flashkey = _flashkey;
_local4.SU0249 = _SU0249;
_local4.bmFtZTE = _arg1;
var _local5:Number = _arg2;
var _local6 = (_local5 + "Z");
_local4.c2NvcmUx = _local6.split("0").join("U");
_local4.c2NvcmUx = _local4.c2NvcmUx.split("").join("A");
_local4.c2NvcmUx = _local4.c2NvcmUx.split("AU").join("Y");
_local4.c2NvcmUx = _local4.c2NvcmUx.split("A1").join("B");
_local4.c2NvcmUx = _local4.c2NvcmUx.split(".").join("N");
_local3.data = _local4;
_loader = new URLLoader();
_loader.dataFormat = URLLoaderDataFormat.TEXT;
_loader.addEventListener(Event.COMPLETE, onSendTop, false, 0, true);
_loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
_loader.load(_local3);
}
private function onGetTop(_arg1:Event):void{
var _local4:int;
var _local5:Array;
var _local2:String = (_loader.data as String);
_local2 = _local2.replace("&success=true", "");
var _local3:Array = _local2.substring(6, _local2.length).split("<u/*/u>");
lastestTop = new XML(<ROOT/>
);
if (_local2 != "top10=<u/*/u>"){
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = _local3[_local4].split("</*/>");
lastestTop.appendChild(new XML((((("<top puntos=\"" + ??esc_xattr
) + "\" nick=\"") + ??esc_xattr
) + "\"/>")));
_local4++;
};
};
dispatchEvent(new Event("TOPLOADED"));
}
public function getTop():void{
var _local1:URLRequest = new URLRequest("http://rankz.armorbot.com/get/top10.php");
_local1.method = URLRequestMethod.POST;
var _local2:URLVariables = new URLVariables();
_local2.flashkey = _flashkey;
_local2.SU0249 = _SU0249;
_local1.data = _local2;
_loader = new URLLoader();
_loader.dataFormat = URLLoaderDataFormat.TEXT;
_loader.addEventListener(Event.COMPLETE, onGetTop, false, 0, true);
_loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
_loader.load(_local1);
}
}
}//package com.HazmiWeb.TopScores
Section 20
//MaxMemory (com.HazmiWeb.Utils.MaxMemory)
package com.HazmiWeb.Utils {
import flash.events.*;
import flash.utils.*;
import flash.text.*;
import flash.system.*;
public class MaxMemory extends TextField {
protected var timer:Timer;
private var _maxMemory:int;// = 0
public function MaxMemory(){
defaultTextFormat = new TextFormat("Verdana", 9, 0);
timer = new Timer(1000);
this.autoSize = TextFieldAutoSize.LEFT;
this.text = "MaxMemory";
this.backgroundColor = 0xFFFFFF;
this.background = true;
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
}
private function timerHandler(_arg1:TimerEvent):void{
if (System.totalMemory > _maxMemory){
_maxMemory = System.totalMemory;
text = (String((_maxMemory / 0x0400)) + " KB");
};
}
public function reset():void{
text = "MaxMemory";
}
}
}//package com.HazmiWeb.Utils
Section 21
//Ease (com.HazmiWeb.Ease)
package com.HazmiWeb {
public class Ease {
public static const EaseCircular:int = 8;
public static const EaseIn:int = 1;
public static const EaseBack:int = 10;
public static const EaseExponential:int = 7;
public static const EaseCubic:int = 3;
public static const EaseOut:int = 3;
public static const EaseElastic:int = 9;
public static const EaseQuadratic:int = 2;
public static const EaseQuartic:int = 4;
public static const EaseSinusoidal:int = 6;
public static const EaseLinear:int = 1;
public static const EaseBounce:int = 11;
public static const EaseQuintic:int = 5;
public static const EaseInOut:int = 2;
public static function ease(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int=1, _arg6:int=1, _arg7:Number=0, _arg8:Number=0, _arg9:Number=1.70158):Number{
var _local10:Number;
switch (_arg5){
case EaseLinear:
return (((((_arg3 - _arg2) * _arg1) / _arg4) + _arg2));
case EaseQuadratic:
switch (_arg6){
case EaseIn:
_arg1 = (_arg1 / _arg4);
return (((((_arg3 - _arg2) * _arg1) * _arg1) + _arg2));
case EaseOut:
_arg1 = (_arg1 / _arg4);
return ((((-((_arg3 - _arg2)) * _arg1) * (_arg1 - 2)) + _arg2));
case EaseInOut:
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 - _arg2) / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-((_arg3 - _arg2)) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
};
break;
case EaseCubic:
switch (_arg6){
case EaseIn:
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 - _arg2) * _arg1) * _arg1) * _arg1) + _arg2));
case EaseOut:
_arg1 = ((_arg1 / _arg4) - 1);
return ((((_arg3 - _arg2) * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
case EaseInOut:
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 - _arg2) / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return (((((_arg3 - _arg2) / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
};
break;
case EaseQuartic:
switch (_arg6){
case EaseIn:
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 - _arg2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
case EaseOut:
_arg1 = ((_arg1 / _arg4) - 1);
return (((-((_arg3 - _arg2)) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
case EaseInOut:
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 - _arg2) / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-((_arg3 - _arg2)) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
};
break;
case EaseQuintic:
switch (_arg6){
case EaseIn:
_arg1 = (_arg1 / _arg4);
return ((((((((_arg3 - _arg2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
case EaseOut:
_arg1 = ((_arg1 / _arg4) - 1);
return ((((_arg3 - _arg2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
case EaseInOut:
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((((_arg3 - _arg2) / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return (((((_arg3 - _arg2) / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
};
break;
case EaseSinusoidal:
switch (_arg6){
case EaseIn:
return ((((-((_arg3 - _arg2)) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + (_arg3 - _arg2)) + _arg2));
case EaseOut:
return ((((_arg3 - _arg2) * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
case EaseInOut:
return ((((-((_arg3 - _arg2)) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
};
break;
case EaseExponential:
switch (_arg6){
case EaseIn:
if (_arg1 == 0){
return (_arg2);
};
return ((((_arg3 - _arg2) * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2));
case EaseOut:
if (_arg1 == _arg4){
return (_arg3);
};
return ((((_arg3 - _arg2) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
case EaseInOut:
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return (_arg3);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 - _arg2) / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2));
};
--_arg1;
return (((((_arg3 - _arg2) / 2) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
};
break;
case EaseCircular:
switch (_arg6){
case EaseIn:
_arg1 = (_arg1 / _arg4);
return (((-((_arg3 - _arg2)) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
case EaseOut:
_arg1 = ((_arg1 / _arg4) - 1);
return ((((_arg3 - _arg2) * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
case EaseInOut:
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-((_arg3 - _arg2)) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return (((((_arg3 - _arg2) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
};
break;
case EaseElastic:
switch (_arg6){
case EaseIn:
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + (_arg3 - _arg2)));
};
if (!_arg8){
_arg8 = (_arg4 * 0.3);
};
if (((!(_arg7)) || ((_arg7 < Math.abs((_arg3 - _arg2)))))){
_arg7 = (_arg3 - _arg2);
_local10 = (_arg8 / 4);
} else {
_local10 = ((_arg8 / (2 * Math.PI)) * Math.asin(((_arg3 - _arg2) / _arg7)));
};
--_arg1;
return ((-(((_arg7 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local10) * (2 * Math.PI)) / _arg8)))) + _arg2));
case EaseOut:
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + (_arg3 - _arg2)));
};
if (!_arg8){
_arg8 = (_arg4 * 0.3);
};
if (((!(_arg7)) || ((_arg7 < Math.abs((_arg3 - _arg2)))))){
_arg7 = (_arg3 - _arg2);
_local10 = (_arg8 / 4);
} else {
_local10 = ((_arg8 / (2 * Math.PI)) * Math.asin(((_arg3 - _arg2) / _arg7)));
};
return (((((_arg7 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local10) * (2 * Math.PI)) / _arg8))) + (_arg3 - _arg2)) + _arg2));
case EaseInOut:
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + (_arg3 - _arg2)));
};
if (!_arg8){
_arg8 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg7)) || ((_arg7 < Math.abs((_arg3 - _arg2)))))){
_arg7 = (_arg3 - _arg2);
_local10 = (_arg8 / 4);
} else {
_local10 = ((_arg8 / (2 * Math.PI)) * Math.asin(((_arg3 - _arg2) / _arg7)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg7 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local10) * (2 * Math.PI)) / _arg8)))) + _arg2));
};
--_arg1;
return ((((((_arg7 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local10) * (2 * Math.PI)) / _arg8))) * 0.5) + (_arg3 - _arg2)) + _arg2));
};
break;
case EaseBack:
switch (_arg6){
case EaseIn:
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 - _arg2) * _arg1) * _arg1) * (((_arg9 + 1) * _arg1) - _arg9)) + _arg2));
case EaseOut:
_arg1 = ((_arg1 / _arg4) - 1);
return ((((_arg3 - _arg2) * (((_arg1 * _arg1) * (((_arg9 + 1) * _arg1) + _arg9)) + 1)) + _arg2));
case EaseInOut:
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg9 = (_arg9 * 1.525);
return (((((_arg3 - _arg2) / 2) * ((_arg1 * _arg1) * (((_arg9 + 1) * _arg1) - _arg9))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg9 = (_arg9 * 1.525);
return (((((_arg3 - _arg2) / 2) * (((_arg1 * _arg1) * (((_arg9 + 1) * _arg1) + _arg9)) + 2)) + _arg2));
};
break;
case EaseBounce:
switch (_arg6){
case EaseIn:
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return ((((_arg3 - _arg2) * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return ((((_arg3 - _arg2) * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return ((((_arg3 - _arg2) * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return ((((_arg3 - _arg2) * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
case EaseOut:
return ((((_arg3 - _arg2) - ease((_arg4 - _arg1), 0, (_arg3 - _arg2), _arg4, EaseOut, EaseBounce)) + _arg2));
case EaseInOut:
if (_arg1 < (_arg4 / 2)){
return (((ease((_arg1 * 2), 0, (_arg3 - _arg2), _arg4, EaseIn, EaseBounce) * 0.5) + _arg2));
};
return ((((ease(((_arg1 * 2) - _arg4), 0, (_arg3 - _arg2), _arg4, EaseOut, EaseBounce) * 0.5) + ((_arg3 - _arg2) * 0.5)) + _arg2));
};
break;
};
return (0);
}
}
}//package com.HazmiWeb
Section 22
//FlipScreen (com.HazmiWeb.FlipScreen)
package com.HazmiWeb {
import flash.display.*;
import flash.geom.*;
import com.flashandmath.bitmaps.*;
public class FlipScreen extends Sprite {
private var _a:Number;
private var _screen1bmt:BitmapTransformer;
private var _screen1:BitmapData;
private var _screen2:BitmapData;
private var _radiusY:Number;
private var _turnSpeed:Number;// = 0.15
private var _Shape1:Shape;
private var _screenHeight:Number;// = 480
private var _screenWidth:Number;// = 640
private var _radiusX:Number;
public function FlipScreen(){
_a = (Math.PI - _turnSpeed);
super();
}
public function setScreen1(_arg1:IBitmapDrawable):void{
_screen1 = new BitmapData(_screenWidth, _screenHeight, false, 0);
_screen2 = new BitmapData(_screenWidth, _screenHeight, false, 0);
_screen1.draw(_arg1);
_screen1bmt = new BitmapTransformer(_screenWidth, _screenHeight, 4, 4);
_Shape1 = (addChild(new Shape()) as Shape);
_radiusX = (_screen1.width / 2);
_radiusY = (_screen1.height / 10);
tick(0);
}
public function tick(_arg1:Number):Boolean{
var _local2:Boolean;
_a = (_a + _turnSpeed);
if (_a >= (2 * Math.PI)){
_a = (2 * Math.PI);
_local2 = false;
};
_Shape1.graphics.clear();
var _local3:Point = new Point(((Math.cos(_a) * _radiusX) + (_screenWidth / 2)), (Math.sin(_a) * _radiusY));
var _local4:Point = new Point(((Math.cos((_a + Math.PI)) * _radiusX) + (_screenWidth / 2)), (Math.sin((_a + Math.PI)) * _radiusY));
var _local5:Point = new Point(((Math.cos((Math.PI - _a)) * _radiusX) + (_screenWidth / 2)), ((Math.sin((Math.PI - _a)) * _radiusY) + _screenHeight));
var _local6:Point = new Point(((Math.cos(((Math.PI * 2) - _a)) * _radiusX) + (_screenWidth / 2)), ((Math.sin(((Math.PI * 2) - _a)) * _radiusY) + _screenHeight));
_screen1bmt.mapBitmapData(_screen1, _local3, _local4, _local5, _local6, _Shape1);
_screen1bmt.mapBitmapData(_screen2, _local4, _local3, _local6, _local5, _Shape1);
return (_local2);
}
public function setScreen2(_arg1:IBitmapDrawable):void{
_screen2.draw(_arg1);
}
}
}//package com.HazmiWeb
Section 23
//SoundManager (com.reintroducing.sound.SoundManager)
package com.reintroducing.sound {
import flash.media.*;
import flash.utils.*;
import flash.net.*;
public class SoundManager {
private var _sounds:Array;
private var _soundsDict:Dictionary;
private static var _instance:SoundManager;
private static var _allowInstance:Boolean;
public function SoundManager(){
this._soundsDict = new Dictionary(true);
this._sounds = new Array();
if (!SoundManager._allowInstance){
throw (new Error("Error: Use SoundManager.getInstance() instead of the new keyword."));
};
}
public function pauseSound(_arg1:String):void{
var _local2:Object = this._soundsDict[_arg1];
_local2.paused = true;
_local2.position = _local2.channel.position;
_local2.channel.stop();
}
public function get sounds():Array{
return (this._sounds);
}
public function setSoundVolume(_arg1:String, _arg2:Number):void{
var _local3:Object = this._soundsDict[_arg1];
var _local4:SoundTransform = _local3.channel.soundTransform;
_local4.volume = _arg2;
_local3.channel.soundTransform = _local4;
}
public function getSoundDuration(_arg1:String):Number{
return (this._soundsDict[_arg1].sound.length);
}
public function toString():String{
return (getQualifiedClassName(this));
}
public function getSoundVolume(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.soundTransform.volume);
}
public function addLibrarySound(_arg1, _arg2:String):Boolean{
var _local3:int;
while (_local3 < this._sounds.length) {
if (this._sounds[_local3].name == _arg2){
return (false);
};
_local3++;
};
var _local4:Object = new Object();
var _local5:Sound = new (_arg1);
_local4.name = _arg2;
_local4.sound = _local5;
_local4.channel = new SoundChannel();
_local4.position = 0;
_local4.paused = true;
_local4.volume = 1;
_local4.startTime = 0;
_local4.loops = 0;
_local4.pausedByAll = false;
this._soundsDict[_arg2] = _local4;
this._sounds.push(_local4);
return (true);
}
public function isSoundPaused(_arg1:String):Boolean{
return (this._soundsDict[_arg1].paused);
}
public function removeAllSounds():void{
var _local1:int;
while (_local1 < this._sounds.length) {
this._sounds[_local1] = null;
_local1++;
};
this._sounds = new Array();
this._soundsDict = new Dictionary(true);
}
public function getSoundPosition(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.position);
}
public function stopAllSounds(_arg1:Boolean=true):void{
var _local3:String;
var _local2:int;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.stopSound(_local3);
};
} else {
this.stopSound(_local3);
};
_local2++;
};
}
public function removeSound(_arg1:String):void{
var _local2:int;
while (_local2 < this._sounds.length) {
if (this._sounds[_local2].name == _arg1){
this._sounds[_local2] = null;
this._sounds.splice(_local2, 1);
};
_local2++;
};
delete this._soundsDict[_arg1];
}
public function muteAllSounds():void{
var _local2:String;
var _local1:int;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
this.setSoundVolume(_local2, 0);
_local1++;
};
}
public function stopSound(_arg1:String):void{
var _local2:Object = this._soundsDict[_arg1];
_local2.paused = true;
_local2.channel.stop();
_local2.position = _local2.channel.position;
}
public function pauseAllSounds(_arg1:Boolean=true):void{
var _local3:String;
var _local2:int;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.pauseSound(_local3);
};
} else {
this.pauseSound(_local3);
};
_local2++;
};
}
public function playAllSounds(_arg1:Boolean=false):void{
var _local3:String;
var _local2:int;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (this._soundsDict[_local3].pausedByAll){
this._soundsDict[_local3].pausedByAll = false;
this.playSound(_local3);
};
} else {
this.playSound(_local3);
};
_local2++;
};
}
public function addExternalSound(_arg1:String, _arg2:String, _arg3:Number=1000, _arg4:Boolean=false):Boolean{
var _local5:int;
while (_local5 < this._sounds.length) {
if (this._sounds[_local5].name == _arg2){
return (false);
};
_local5++;
};
var _local6:Object = new Object();
var _local7:Sound = new Sound(new URLRequest(_arg1), new SoundLoaderContext(_arg3, _arg4));
_local6.name = _arg2;
_local6.sound = _local7;
_local6.channel = new SoundChannel();
_local6.position = 0;
_local6.paused = true;
_local6.volume = 1;
_local6.startTime = 0;
_local6.loops = 0;
_local6.pausedByAll = false;
this._soundsDict[_arg2] = _local6;
this._sounds.push(_local6);
return (true);
}
public function isSoundPausedByAll(_arg1:String):Boolean{
return (this._soundsDict[_arg1].pausedByAll);
}
public function getSoundObject(_arg1:String):Sound{
return (this._soundsDict[_arg1].sound);
}
public function unmuteAllSounds():void{
var _local2:String;
var _local3:Object;
var _local4:SoundTransform;
var _local1:int;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
_local3 = this._soundsDict[_local2];
_local4 = _local3.channel.soundTransform;
_local4.volume = _local3.volume;
_local3.channel.soundTransform = _local4;
_local1++;
};
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:int=0):void{
var _local5:Object = this._soundsDict[_arg1];
_local5.volume = _arg2;
_local5.startTime = _arg3;
_local5.loops = _arg4;
if (_local5.paused){
_local5.channel = _local5.sound.play(_local5.position, _local5.loops, new SoundTransform(_local5.volume));
} else {
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
};
_local5.paused = false;
}
public static function getInstance():SoundManager{
if (SoundManager._instance == null){
SoundManager._allowInstance = true;
SoundManager._instance = new (SoundManager);
SoundManager._allowInstance = false;
};
return (SoundManager._instance);
}
}
}//package com.reintroducing.sound
Section 24
//Ticker (com.urbansquall.metronome.Ticker)
package com.urbansquall.metronome {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Ticker extends EventDispatcher {
private var m_accruedTime:Number;
private var m_running:Boolean;
private var m_shape:Shape;
private var m_delay:Number;
private var m_timeOfLastUpdate:Number;
public var ticks:int;// = 0
public function Ticker(_arg1:Number=33){
m_running = false;
m_delay = _arg1;
m_shape = new Shape();
}
public function get delay():int{
return (m_delay);
}
public function stop():void{
m_shape.removeEventListener(Event.ENTER_FRAME, tick);
m_running = false;
}
private function calculateDeltaTime():Number{
var _local1:Number = getTimer();
var _local2:Number = (_local1 - m_timeOfLastUpdate);
m_timeOfLastUpdate = _local1;
return (_local2);
}
public function start():void{
m_running = true;
m_timeOfLastUpdate = getTimer();
m_accruedTime = 0;
m_shape.addEventListener(Event.ENTER_FRAME, tick, false, 0, true);
}
private function tick(_arg1:Event):void{
var _local2:Number = calculateDeltaTime();
if (!m_running){
return;
};
m_accruedTime = (m_accruedTime + _local2);
while (m_accruedTime >= m_delay) {
ticks++;
m_accruedTime = (m_accruedTime - m_delay);
dispatchEvent(new TickerEvent(m_delay));
};
}
public function get running():Boolean{
return (m_running);
}
}
}//package com.urbansquall.metronome
Section 25
//TickerEvent (com.urbansquall.metronome.TickerEvent)
package com.urbansquall.metronome {
import flash.events.*;
public class TickerEvent extends Event {
private var m_interval:Number;
public static const TICK:String = "tick";
public function TickerEvent(_arg1:Number){
super(TICK, false, false);
m_interval = _arg1;
}
public function get interval():Number{
return (m_interval);
}
}
}//package com.urbansquall.metronome
Section 26
//Preloader (com.urbansquall.preloader.Preloader)
package com.urbansquall.preloader {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Preloader extends MovieClip {
private var m_firstFrame:Boolean;// = true
public function Preloader(){
addEventListener(Event.ENTER_FRAME, checkFrame);
}
protected function endLoading():void{
}
protected function updateLoading(_arg1:Number):void{
}
private function checkFrame(_arg1:Event):void{
if (currentFrame == totalFrames){
removeEventListener(Event.ENTER_FRAME, checkFrame);
startup();
return;
};
if (m_firstFrame){
beginLoading();
m_firstFrame = false;
return;
};
var _local2:Number = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
updateLoading(_local2);
}
protected function get mainClassName():String{
return ("Main");
}
protected function beginLoading():void{
}
private function startup():void{
stop();
if (!m_firstFrame){
endLoading();
};
var _local1:Class = (getDefinitionByName(mainClassName) as Class);
if (_local1 == null){
throw (new Error((("Preloader:startup. There was no class matching [" + mainClassName) + "]. You may need to override Preloader::mainClassName")));
};
var _local2:DisplayObject = (new (_local1) as DisplayObject);
if (_local2 == null){
throw (new Error((("Preloader::startup. [" + mainClassName) + "] needs to inherit from Sprite or MovieClip.")));
};
addChildAt(_local2, 0);
}
}
}//package com.urbansquall.preloader
Section 27
//EntityContainer (com.urbansquall.serenity.EntityContainer)
package com.urbansquall.serenity {
import flash.utils.*;
public class EntityContainer {
private var m_entitiesToBeAdded:Array;
private var m_entitiesToBeRemoved:Array;
private var m_entities:Array;
private var m_idMap:Dictionary;
public function EntityContainer(){
m_entities = new Array();
m_idMap = new Dictionary();
m_entitiesToBeAdded = new Array();
m_entitiesToBeRemoved = new Array();
}
private function addNewEntities():void{
var _local3:IEntity;
var _local1:int = m_entitiesToBeAdded.length;
var _local2:int = (_local1 - 1);
while (_local2 >= 0) {
_local3 = m_entitiesToBeAdded[_local2];
m_idMap[_local3.id] = _local3;
m_entities.push(_local3);
_local2--;
};
m_entitiesToBeAdded.splice(0);
}
public function addEntity(_arg1:IEntity):void{
var _local4:IEntity;
if (m_entitiesToBeAdded.indexOf(_arg1) != -1){
throw (new Error("EntityContainer:addEntity. This entity is already queued for addition."));
};
if (m_idMap[_arg1.id] != null){
throw (new Error("EntityContainer:addEntity. There is an entity with this id already. Ensure ids are unique."));
};
var _local2:int = m_entitiesToBeAdded.length;
var _local3:int = (_local2 - 1);
while (_local3 >= 0) {
_local4 = m_entitiesToBeAdded[_local3];
if (_local4.id == _arg1.id){
throw (new Error("EntityContainer:addEntity. There is an entity with this id already. Ensure ids are unique."));
};
_local3--;
};
m_entitiesToBeAdded.push(_arg1);
}
public function removeEntity(_arg1:IEntity):void{
if (m_entitiesToBeRemoved.indexOf(_arg1) != -1){
throw (new Error("EntityContainer:removeEntity. This entity is already queued for removal."));
};
if (m_idMap[_arg1.id] == null){
throw (new Error("EntityContainer:removeEntity. There was no entity with a matching id."));
};
m_entitiesToBeRemoved.push(_arg1);
}
private function processAddAndRemoves():void{
addNewEntities();
removeOldEntities();
}
private function removeOldEntities():void{
var _local3:IEntity;
var _local4:int;
var _local1:int = m_entitiesToBeRemoved.length;
var _local2:int = (_local1 - 1);
while (_local2 >= 0) {
_local3 = m_entitiesToBeRemoved[_local2];
_local4 = m_entities.indexOf(_local3);
if (_local4 >= 0){
m_entities.splice(_local4, 1);
delete m_idMap[_local3.id];
};
_local2--;
};
m_entitiesToBeRemoved.splice(0);
}
public function getEntityAt(_arg1:int):IEntity{
return (m_entities[_arg1]);
}
public function get numEntities():int{
return (m_entities.length);
}
public function tick(_arg1:Number):void{
var _local4:IEntity;
var _local2:int = m_entities.length;
var _local3:int = (_local2 - 1);
while (_local3 >= 0) {
_local4 = m_entities[_local3];
_local4.tick(_arg1);
_local3--;
};
processAddAndRemoves();
}
public function lookupEntity(_arg1:String):IEntity{
return (m_idMap[_arg1]);
}
public function dispose():void{
var _local3:IEntity;
if (m_entities == null){
return;
};
processAddAndRemoves();
var _local1:int = m_entities.length;
var _local2:int = (_local1 - 1);
while (_local2 >= 0) {
_local3 = m_entities[_local2];
delete m_idMap[_local3.id];
_local3.dispose();
_local2--;
};
m_entities.splice(0);
m_entities = null;
m_entitiesToBeAdded = null;
m_entitiesToBeRemoved = null;
m_idMap = null;
}
}
}//package com.urbansquall.serenity
Section 28
//IEntity (com.urbansquall.serenity.IEntity)
package com.urbansquall.serenity {
public interface IEntity {
function get altitude():Number;
function get depth():Number;
function set realY(_arg1:Number):void;
function get type():String;
function get id():String;
function tick(_arg1:Number):void;
function dispose():void;
}
}//package com.urbansquall.serenity
Section 29
//SimpleIDCounter (com.urbansquall.serenity.SimpleIDCounter)
package com.urbansquall.serenity {
public class SimpleIDCounter {
private static var m_id:int = 1;
public static function calculateNextID():String{
return (String(m_id++));
}
}
}//package com.urbansquall.serenity
Section 30
//FPS (com.urbansquall.utils.FPS)
package com.urbansquall.utils {
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public class FPS extends TextField {
protected var timeOfLastUpdate:Number;
protected var timer:Timer;
protected var frames:int;
public function FPS(){
defaultTextFormat = new TextFormat("Verdana", 9, 0);
timer = new Timer(1000);
this.autoSize = TextFieldAutoSize.CENTER;
this.text = "FPS";
this.backgroundColor = 0xFFFFFF;
this.background = true;
timer.addEventListener(TimerEvent.TIMER, timerHandler);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
timer.start();
timeOfLastUpdate = getTimer();
}
private function timerHandler(_arg1:TimerEvent):void{
var _local2:Number = calculateDeltaTime();
text = String(Math.round((frames / (_local2 / 1000))));
frames = 0;
}
private function enterFrameHandler(_arg1:Event):void{
frames++;
}
private function calculateDeltaTime():Number{
var _local1:Number = getTimer();
var _local2:Number = (_local1 - timeOfLastUpdate);
timeOfLastUpdate = _local1;
return (_local2);
}
public function reset():void{
frames = 0;
text = "FPS";
timeOfLastUpdate = getTimer();
}
}
}//package com.urbansquall.utils
Section 31
//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.2.0.3958";
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 32
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 33
//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.2.0.3958";
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 34
//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.2.0.3958";
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 35
//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.2.0.3958";
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 36
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 37
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 38
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 39
//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 40
//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 41
//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.2.0.3958";
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 42
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
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.2.0.3958";
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 43
//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 44
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.2.0.3958";
}
}//package mx.core
Section 45
//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.2.0.3958";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = _arg1;
try {
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
} catch(e:SecurityError) {
};
return (result);
}
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 46
//Web (net.stevensacks.utils.Web)
package net.stevensacks.utils {
import flash.net.*;
public class Web {
public static function getURL(_arg1:String, _arg2:String=null):void{
var url = _arg1;
var window = _arg2;
var req:URLRequest = new URLRequest(url);
trace("getURL", url);
try {
navigateToURL(req, window);
} catch(e:Error) {
trace("Navigate to URL failed", e.message);
};
}
}
}//package net.stevensacks.utils
Section 47
//Assets (Assets)
package {
import flash.display.*;
import com.reintroducing.sound.*;
import flash.utils.*;
public class Assets {
protected static const sprites_XML:Class = Assets_sprites_XML;
public static const GAME_FONT:String = "Assets_GAME_FONT";
public static var formations:String = "";
public static var piano_Bitmap:Class = Assets_piano_Bitmap;
public static var sound7_Sound:Class = Assets_sound7_Sound;
public static var propellor_Bitmap:Class = Assets_propellor_Bitmap;
public static var sky3cloudC_Bitmap:Class = Assets_sky3cloudC_Bitmap;
public static var chair_Bitmap:Class = Assets_chair_Bitmap;
public static var sky1cloudA_Bitmap:Class = Assets_sky1cloudA_Bitmap;
public static var sky3ground_Bitmap:Class = Assets_sky3ground_Bitmap;
public static var peew_Sound:Class = Assets_peew_Sound;
public static var car_Bitmap:Class = Assets_car_Bitmap;
public static var sky2_Bitmap:Class = Assets_sky2_Bitmap;
public static var para0_Bitmap:Class = Assets_para0_Bitmap;
public static var woosh_Sound:Class = Assets_woosh_Sound;
public static var wc_Bitmap:Class = Assets_wc_Bitmap;
public static var chute_Bitmap:Class = Assets_chute_Bitmap;
public static var hatch_Bitmap:Class = Assets_hatch_Bitmap;
public static var sky3cloudB_Bitmap:Class = Assets_sky3cloudB_Bitmap;
public static var points_Bitmap:Class = Assets_points_Bitmap;
public static var gameover_Sound:Class = Assets_gameover_Sound;
public static var vespa_Bitmap:Class = Assets_vespa_Bitmap;
public static var formations_String:Class = Assets_formations_String;
public static var sky1_Bitmap:Class = Assets_sky1_Bitmap;
public static var endMedal_Bitmap:Class = Assets_endMedal_Bitmap;
public static var tank_Bitmap:Class = Assets_tank_Bitmap;
public static var beer_Bitmap:Class = Assets_beer_Bitmap;
public static var balloon1_Bitmap:Class = Assets_balloon1_Bitmap;
public static var sound4_Sound:Class = Assets_sound4_Sound;
public static var sky2cloudD_Bitmap:Class = Assets_sky2cloudD_Bitmap;
public static var sky3cloudA_Bitmap:Class = Assets_sky3cloudA_Bitmap;
public static var sound8_Sound:Class = Assets_sound8_Sound;
public static var plane_Sound:Class = Assets_plane_Sound;
public static var satelite_Bitmap:Class = Assets_satelite_Bitmap;
public static var height_Bitmap:Class = Assets_height_Bitmap;
public static var intro_swf:Class = Assets_intro_swf;
public static var sky2cloudC_Bitmap:Class = Assets_sky2cloudC_Bitmap;
public static var map_String:Class = Assets_map_String;
public static var sky2ground_Bitmap:Class = Assets_sky2ground_Bitmap;
public static var sofa_Bitmap:Class = Assets_sofa_Bitmap;
public static var santa_Sound:Class = Assets_santa_Sound;
public static var map:String = "";
public static var santa_Bitmap:Class = Assets_santa_Bitmap;
public static var sound5_Sound:Class = Assets_sound5_Sound;
public static var bomb_Bitmap:Class = Assets_bomb_Bitmap;
public static var sky2cloudB_Bitmap:Class = Assets_sky2cloudB_Bitmap;
public static var plane_Bitmap:Class = Assets_plane_Bitmap;
public static var buttonmoregames_Bitmap:Class = Assets_buttonmoregames_Bitmap;
public static var medal_Bitmap:Class = Assets_medal_Bitmap;
public static var staron_Bitmap:Class = Assets_staron_Bitmap;
public static var music1_Sound:Class = Assets_music1_Sound;
public static var guitar_Bitmap:Class = Assets_guitar_Bitmap;
public static var sound1_Sound:Class = Assets_sound1_Sound;
public static var sky1cloudD_Bitmap:Class = Assets_sky1cloudD_Bitmap;
public static var sky2cloudA_Bitmap:Class = Assets_sky2cloudA_Bitmap;
public static var sound2_Sound:Class = Assets_sound2_Sound;
public static var hole_Bitmap:Class = Assets_hole_Bitmap;
public static var sound6_Sound:Class = Assets_sound6_Sound;
public static var clock_Bitmap:Class = Assets_clock_Bitmap;
public static var explosion_Bitmap:Class = Assets_explosion_Bitmap;
public static var buttonmenu_Bitmap:Class = Assets_buttonmenu_Bitmap;
public static var open_Sound:Class = Assets_open_Sound;
public static var meter_Bitmap:Class = Assets_meter_Bitmap;
public static var bonus_Sound:Class = Assets_bonus_Sound;
public static var sky1cloudC_Bitmap:Class = Assets_sky1cloudC_Bitmap;
public static var sky1ground_Bitmap:Class = Assets_sky1ground_Bitmap;
public static var star_Bitmap:Class = Assets_star_Bitmap;
public static var hole1_Bitmap:Class = Assets_hole1_Bitmap;
public static var sky3cloudD_Bitmap:Class = Assets_sky3cloudD_Bitmap;
public static var bof_Sound:Class = Assets_bof_Sound;
public static var staroff_Bitmap:Class = Assets_staroff_Bitmap;
public static var sound3_Sound:Class = Assets_sound3_Sound;
public static var music2_Sound:Class = Assets_music2_Sound;
public static var sky1cloudB_Bitmap:Class = Assets_sky1cloudB_Bitmap;
public static var sky3_Bitmap:Class = Assets_sky3_Bitmap;
public static var coffin_Bitmap:Class = Assets_coffin_Bitmap;
public static function getSoundAsset(_arg1:String):Class{
var _local2:Class = Class(getDefinitionByName((("Assets_" + _arg1) + "_Sound")));
return (_local2);
}
public static function getStringAsset(_arg1:String):String{
var string:String;
var name = _arg1;
if ((((name == "map")) && (!((map == ""))))){
return (map);
};
if ((((name == "formations")) && (!((formations == ""))))){
return (formations);
};
var assetClass:Class = Class(getDefinitionByName((("Assets_" + name) + "_String")));
var ba:ByteArray = ByteArray(new (assetClass));
var s:String = ba.readUTFBytes(ba.length);
try {
string = new String(s);
} catch(e:Error) {
trace(("Error: " + e.message));
return (new String());
};
return (string);
}
public static function getXMLAsset(_arg1:String, _arg2:Boolean=true):XML{
var xml:XML;
var name = _arg1;
var ignoreWhiteSpace = _arg2;
var assetClass:Class = Class(getDefinitionByName((("Assets_" + name) + "_XML")));
var ba:ByteArray = ByteArray(new (assetClass));
var s:String = ba.readUTFBytes(ba.length);
try {
xml = new XML(s.slice(s.indexOf("<")));
} catch(e:Error) {
trace(("Error: " + e.message));
return (new XML());
};
xml.ignoreWhitespace = true;
return (xml);
}
public static function initSounds():void{
var _local3:int;
var _local4:String;
var _local5:String;
var _local1:SoundManager = SoundManager.getInstance();
var _local2:XMLList = describeType(Assets)..variable;
while (_local3 < _local2.length()) {
_local4 = _local2[_local3].@name;
if (_local4.substr(-6) == "_Sound"){
_local5 = _local4.replace("_Sound", "");
_local1.addLibrarySound(Assets.getSoundAsset(_local5), _local5);
};
_local3++;
};
}
public static function setStringAsset(_arg1:String, _arg2:String):void{
if (_arg1 == "map"){
map = _arg2;
};
if (_arg1 == "formations"){
formations = _arg2;
};
}
public static function getBitmapDataAsset(_arg1:String):BitmapData{
var _local2:Class = Class(getDefinitionByName((("Assets_" + _arg1) + "_Bitmap")));
return (Bitmap(new (_local2)).bitmapData);
}
}
}//package
Section 48
//Assets_balloon1_Bitmap (Assets_balloon1_Bitmap)
package {
import mx.core.*;
public class Assets_balloon1_Bitmap extends BitmapAsset {
}
}//package
Section 49
//Assets_beer_Bitmap (Assets_beer_Bitmap)
package {
import mx.core.*;
public class Assets_beer_Bitmap extends BitmapAsset {
}
}//package
Section 50
//Assets_bof_Sound (Assets_bof_Sound)
package {
import mx.core.*;
public class Assets_bof_Sound extends SoundAsset {
}
}//package
Section 51
//Assets_bomb_Bitmap (Assets_bomb_Bitmap)
package {
import mx.core.*;
public class Assets_bomb_Bitmap extends BitmapAsset {
}
}//package
Section 52
//Assets_bonus_Sound (Assets_bonus_Sound)
package {
import mx.core.*;
public class Assets_bonus_Sound extends SoundAsset {
}
}//package
Section 53
//Assets_buttonmenu_Bitmap (Assets_buttonmenu_Bitmap)
package {
import mx.core.*;
public class Assets_buttonmenu_Bitmap extends BitmapAsset {
}
}//package
Section 54
//Assets_buttonmoregames_Bitmap (Assets_buttonmoregames_Bitmap)
package {
import mx.core.*;
public class Assets_buttonmoregames_Bitmap extends BitmapAsset {
}
}//package
Section 55
//Assets_car_Bitmap (Assets_car_Bitmap)
package {
import mx.core.*;
public class Assets_car_Bitmap extends BitmapAsset {
}
}//package
Section 56
//Assets_chair_Bitmap (Assets_chair_Bitmap)
package {
import mx.core.*;
public class Assets_chair_Bitmap extends BitmapAsset {
}
}//package
Section 57
//Assets_chute_Bitmap (Assets_chute_Bitmap)
package {
import mx.core.*;
public class Assets_chute_Bitmap extends BitmapAsset {
}
}//package
Section 58
//Assets_clock_Bitmap (Assets_clock_Bitmap)
package {
import mx.core.*;
public class Assets_clock_Bitmap extends BitmapAsset {
}
}//package
Section 59
//Assets_coffin_Bitmap (Assets_coffin_Bitmap)
package {
import mx.core.*;
public class Assets_coffin_Bitmap extends BitmapAsset {
}
}//package
Section 60
//Assets_endMedal_Bitmap (Assets_endMedal_Bitmap)
package {
import mx.core.*;
public class Assets_endMedal_Bitmap extends BitmapAsset {
}
}//package
Section 61
//Assets_explosion_Bitmap (Assets_explosion_Bitmap)
package {
import mx.core.*;
public class Assets_explosion_Bitmap extends BitmapAsset {
}
}//package
Section 62
//Assets_formations_String (Assets_formations_String)
package {
import mx.core.*;
public class Assets_formations_String extends ByteArrayAsset {
}
}//package
Section 63
//Assets_GAME_FONT (Assets_GAME_FONT)
package {
import mx.core.*;
public class Assets_GAME_FONT extends FontAsset {
}
}//package
Section 64
//Assets_gameover_Sound (Assets_gameover_Sound)
package {
import mx.core.*;
public class Assets_gameover_Sound extends SoundAsset {
}
}//package
Section 65
//Assets_guitar_Bitmap (Assets_guitar_Bitmap)
package {
import mx.core.*;
public class Assets_guitar_Bitmap extends BitmapAsset {
}
}//package
Section 66
//Assets_hatch_Bitmap (Assets_hatch_Bitmap)
package {
import mx.core.*;
public class Assets_hatch_Bitmap extends BitmapAsset {
}
}//package
Section 67
//Assets_height_Bitmap (Assets_height_Bitmap)
package {
import mx.core.*;
public class Assets_height_Bitmap extends BitmapAsset {
}
}//package
Section 68
//Assets_hole_Bitmap (Assets_hole_Bitmap)
package {
import mx.core.*;
public class Assets_hole_Bitmap extends BitmapAsset {
}
}//package
Section 69
//Assets_hole1_Bitmap (Assets_hole1_Bitmap)
package {
import mx.core.*;
public class Assets_hole1_Bitmap extends BitmapAsset {
}
}//package
Section 70
//Assets_intro_swf (Assets_intro_swf)
package {
import mx.core.*;
import flash.utils.*;
public class Assets_intro_swf extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function Assets_intro_swf(){
dataClass = Assets_intro_swf_dataClass;
super();
initialWidth = (0x3200 / 20);
initialHeight = (9600 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 71
//Assets_intro_swf_dataClass (Assets_intro_swf_dataClass)
package {
import mx.core.*;
public class Assets_intro_swf_dataClass extends ByteArrayAsset {
}
}//package
Section 72
//Assets_map_String (Assets_map_String)
package {
import mx.core.*;
public class Assets_map_String extends ByteArrayAsset {
}
}//package
Section 73
//Assets_medal_Bitmap (Assets_medal_Bitmap)
package {
import mx.core.*;
public class Assets_medal_Bitmap extends BitmapAsset {
}
}//package
Section 74
//Assets_meter_Bitmap (Assets_meter_Bitmap)
package {
import mx.core.*;
public class Assets_meter_Bitmap extends BitmapAsset {
}
}//package
Section 75
//Assets_music1_Sound (Assets_music1_Sound)
package {
import mx.core.*;
public class Assets_music1_Sound extends SoundAsset {
}
}//package
Section 76
//Assets_music2_Sound (Assets_music2_Sound)
package {
import mx.core.*;
public class Assets_music2_Sound extends SoundAsset {
}
}//package
Section 77
//Assets_open_Sound (Assets_open_Sound)
package {
import mx.core.*;
public class Assets_open_Sound extends SoundAsset {
}
}//package
Section 78
//Assets_para0_Bitmap (Assets_para0_Bitmap)
package {
import mx.core.*;
public class Assets_para0_Bitmap extends BitmapAsset {
}
}//package
Section 79
//Assets_peew_Sound (Assets_peew_Sound)
package {
import mx.core.*;
public class Assets_peew_Sound extends SoundAsset {
}
}//package
Section 80
//Assets_piano_Bitmap (Assets_piano_Bitmap)
package {
import mx.core.*;
public class Assets_piano_Bitmap extends BitmapAsset {
}
}//package
Section 81
//Assets_plane_Bitmap (Assets_plane_Bitmap)
package {
import mx.core.*;
public class Assets_plane_Bitmap extends BitmapAsset {
}
}//package
Section 82
//Assets_plane_Sound (Assets_plane_Sound)
package {
import mx.core.*;
public class Assets_plane_Sound extends SoundAsset {
}
}//package
Section 83
//Assets_points_Bitmap (Assets_points_Bitmap)
package {
import mx.core.*;
public class Assets_points_Bitmap extends BitmapAsset {
}
}//package
Section 84
//Assets_propellor_Bitmap (Assets_propellor_Bitmap)
package {
import mx.core.*;
public class Assets_propellor_Bitmap extends BitmapAsset {
}
}//package
Section 85
//Assets_santa_Bitmap (Assets_santa_Bitmap)
package {
import mx.core.*;
public class Assets_santa_Bitmap extends BitmapAsset {
}
}//package
Section 86
//Assets_santa_Sound (Assets_santa_Sound)
package {
import mx.core.*;
public class Assets_santa_Sound extends SoundAsset {
}
}//package
Section 87
//Assets_satelite_Bitmap (Assets_satelite_Bitmap)
package {
import mx.core.*;
public class Assets_satelite_Bitmap extends BitmapAsset {
}
}//package
Section 88
//Assets_sky1_Bitmap (Assets_sky1_Bitmap)
package {
import mx.core.*;
public class Assets_sky1_Bitmap extends BitmapAsset {
}
}//package
Section 89
//Assets_sky1cloudA_Bitmap (Assets_sky1cloudA_Bitmap)
package {
import mx.core.*;
public class Assets_sky1cloudA_Bitmap extends BitmapAsset {
}
}//package
Section 90
//Assets_sky1cloudB_Bitmap (Assets_sky1cloudB_Bitmap)
package {
import mx.core.*;
public class Assets_sky1cloudB_Bitmap extends BitmapAsset {
}
}//package
Section 91
//Assets_sky1cloudC_Bitmap (Assets_sky1cloudC_Bitmap)
package {
import mx.core.*;
public class Assets_sky1cloudC_Bitmap extends BitmapAsset {
}
}//package
Section 92
//Assets_sky1cloudD_Bitmap (Assets_sky1cloudD_Bitmap)
package {
import mx.core.*;
public class Assets_sky1cloudD_Bitmap extends BitmapAsset {
}
}//package
Section 93
//Assets_sky1ground_Bitmap (Assets_sky1ground_Bitmap)
package {
import mx.core.*;
public class Assets_sky1ground_Bitmap extends BitmapAsset {
}
}//package
Section 94
//Assets_sky2_Bitmap (Assets_sky2_Bitmap)
package {
import mx.core.*;
public class Assets_sky2_Bitmap extends BitmapAsset {
}
}//package
Section 95
//Assets_sky2cloudA_Bitmap (Assets_sky2cloudA_Bitmap)
package {
import mx.core.*;
public class Assets_sky2cloudA_Bitmap extends BitmapAsset {
}
}//package
Section 96
//Assets_sky2cloudB_Bitmap (Assets_sky2cloudB_Bitmap)
package {
import mx.core.*;
public class Assets_sky2cloudB_Bitmap extends BitmapAsset {
}
}//package
Section 97
//Assets_sky2cloudC_Bitmap (Assets_sky2cloudC_Bitmap)
package {
import mx.core.*;
public class Assets_sky2cloudC_Bitmap extends BitmapAsset {
}
}//package
Section 98
//Assets_sky2cloudD_Bitmap (Assets_sky2cloudD_Bitmap)
package {
import mx.core.*;
public class Assets_sky2cloudD_Bitmap extends BitmapAsset {
}
}//package
Section 99
//Assets_sky2ground_Bitmap (Assets_sky2ground_Bitmap)
package {
import mx.core.*;
public class Assets_sky2ground_Bitmap extends BitmapAsset {
}
}//package
Section 100
//Assets_sky3_Bitmap (Assets_sky3_Bitmap)
package {
import mx.core.*;
public class Assets_sky3_Bitmap extends BitmapAsset {
}
}//package
Section 101
//Assets_sky3cloudA_Bitmap (Assets_sky3cloudA_Bitmap)
package {
import mx.core.*;
public class Assets_sky3cloudA_Bitmap extends BitmapAsset {
}
}//package
Section 102
//Assets_sky3cloudB_Bitmap (Assets_sky3cloudB_Bitmap)
package {
import mx.core.*;
public class Assets_sky3cloudB_Bitmap extends BitmapAsset {
}
}//package
Section 103
//Assets_sky3cloudC_Bitmap (Assets_sky3cloudC_Bitmap)
package {
import mx.core.*;
public class Assets_sky3cloudC_Bitmap extends BitmapAsset {
}
}//package
Section 104
//Assets_sky3cloudD_Bitmap (Assets_sky3cloudD_Bitmap)
package {
import mx.core.*;
public class Assets_sky3cloudD_Bitmap extends BitmapAsset {
}
}//package
Section 105
//Assets_sky3ground_Bitmap (Assets_sky3ground_Bitmap)
package {
import mx.core.*;
public class Assets_sky3ground_Bitmap extends BitmapAsset {
}
}//package
Section 106
//Assets_sofa_Bitmap (Assets_sofa_Bitmap)
package {
import mx.core.*;
public class Assets_sofa_Bitmap extends BitmapAsset {
}
}//package
Section 107
//Assets_sound1_Sound (Assets_sound1_Sound)
package {
import mx.core.*;
public class Assets_sound1_Sound extends SoundAsset {
}
}//package
Section 108
//Assets_sound2_Sound (Assets_sound2_Sound)
package {
import mx.core.*;
public class Assets_sound2_Sound extends SoundAsset {
}
}//package
Section 109
//Assets_sound3_Sound (Assets_sound3_Sound)
package {
import mx.core.*;
public class Assets_sound3_Sound extends SoundAsset {
}
}//package
Section 110
//Assets_sound4_Sound (Assets_sound4_Sound)
package {
import mx.core.*;
public class Assets_sound4_Sound extends SoundAsset {
}
}//package
Section 111
//Assets_sound5_Sound (Assets_sound5_Sound)
package {
import mx.core.*;
public class Assets_sound5_Sound extends SoundAsset {
}
}//package
Section 112
//Assets_sound6_Sound (Assets_sound6_Sound)
package {
import mx.core.*;
public class Assets_sound6_Sound extends SoundAsset {
}
}//package
Section 113
//Assets_sound7_Sound (Assets_sound7_Sound)
package {
import mx.core.*;
public class Assets_sound7_Sound extends SoundAsset {
}
}//package
Section 114
//Assets_sound8_Sound (Assets_sound8_Sound)
package {
import mx.core.*;
public class Assets_sound8_Sound extends SoundAsset {
}
}//package
Section 115
//Assets_sprites_XML (Assets_sprites_XML)
package {
import mx.core.*;
public class Assets_sprites_XML extends ByteArrayAsset {
}
}//package
Section 116
//Assets_star_Bitmap (Assets_star_Bitmap)
package {
import mx.core.*;
public class Assets_star_Bitmap extends BitmapAsset {
}
}//package
Section 117
//Assets_staroff_Bitmap (Assets_staroff_Bitmap)
package {
import mx.core.*;
public class Assets_staroff_Bitmap extends BitmapAsset {
}
}//package
Section 118
//Assets_staron_Bitmap (Assets_staron_Bitmap)
package {
import mx.core.*;
public class Assets_staron_Bitmap extends BitmapAsset {
}
}//package
Section 119
//Assets_tank_Bitmap (Assets_tank_Bitmap)
package {
import mx.core.*;
public class Assets_tank_Bitmap extends BitmapAsset {
}
}//package
Section 120
//Assets_wc_Bitmap (Assets_wc_Bitmap)
package {
import mx.core.*;
public class Assets_wc_Bitmap extends BitmapAsset {
}
}//package
Section 121
//Assets_vespa_Bitmap (Assets_vespa_Bitmap)
package {
import mx.core.*;
public class Assets_vespa_Bitmap extends BitmapAsset {
}
}//package
Section 122
//Assets_woosh_Sound (Assets_woosh_Sound)
package {
import mx.core.*;
public class Assets_woosh_Sound extends SoundAsset {
}
}//package
Section 123
//Background (Background)
package {
import flash.display.*;
import com.urbansquall.serenity.*;
import com.HazmiWeb.BitmapAnimation.*;
public class Background extends Bitmap implements IEntity {
private var _body:AnimationController;
private var _depth:Number;// = 1
private var _propellor:AnimationController;
private var _hatch:AnimationController;
private var _altitude:Number;
private var _game:Game;
private var _type:String;
private var _skyId:int;
private var m_id:String;
public var speedX:Number;// = 6
public var speedY:Number;// = 0
public function Background(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:int){
_body = new AnimationController();
_propellor = new AnimationController();
_hatch = new AnimationController();
super();
m_id = SimpleIDCounter.calculateNextID();
_game = _arg1;
_altitude = _arg2;
_depth = _arg3;
_type = "background";
_skyId = _arg4;
this.bitmapData = Assets.getBitmapDataAsset(("sky" + String(_skyId)));
}
public function get depth():Number{
return (_depth);
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function get type():String{
return (_type);
}
public function get id():String{
return (m_id);
}
public function dispose():void{
}
public function get altitude():Number{
return (_altitude);
}
public function tick(_arg1:Number):void{
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
}
}//package
Section 124
//Balloon (Balloon)
package {
import flash.display.*;
import com.urbansquall.serenity.*;
import flash.text.*;
public class Balloon extends Sprite implements IEntity {
private var _body:Bitmap;
private var _wiggleOffset:Number;
private var _altitude:Number;
private var _text:TextField;
private var _type:String;
private var _textTimer:int;// = 0
private var _textIndex:int;// = 0
private var _targetX:Number;// = 0
private var _ttj:Number;
private var m_id:String;
private var _textArray:Array;
private var _depth:Number;// = 1
private var _wiggle:Number;
private var _game:Game;
private var _distance:Number;
private var _maxFallSpeed:Number;
public var speedX:Number;// = 0
public var speedY:Number;// = -6
public function Balloon(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number){
_wiggle = (Math.random() * 10);
_wiggleOffset = (Math.random() * 1000);
_textArray = new Array();
super();
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_altitude = _arg2;
_targetX = _arg4;
_ttj = _arg3;
this.visible = false;
_body = new Bitmap(Assets.getBitmapDataAsset("balloon1"), "auto", true);
_body.x = (-(_body.width) / 2);
_body.y = (-(_body.height) / 2);
_body.smoothing = true;
this.addChild(_body);
_type = "balloon";
_maxFallSpeed = -20;
_text = new TextField();
GameFont.setTextFieldStyle3(_text, 15, TextFormatAlign.CENTER, TextFieldAutoSize.NONE);
addChild(_text);
_text.x = _body.x;
_text.y = (_body.y + 10);
_text.width = _body.width;
_textArray.push("\nWelcome to\nChute Academy");
_textArray.push("\nIt is your\ntask to save\nall pupils...");
_textArray.push("\n...from\ncrashing\ninto the ground.");
_textArray.push("To the left\nyou can see the\nremaining\nheight");
_textArray.push("\nOn right,\nyour score.");
_textArray.push("\nThe faster you play\nthe more points\nyou score...");
_textArray.push("\nso if you read\nthis, you already\nlost a lot of points!");
_textArray.push("Levels run from\n0 to 5 stars\nEach one more\ndifficult.");
_textArray.push("To pause the\ngame, simply move\nthe mouse away\nfrom the game");
_textArray.push("\nClick me\nto open my\nparachute!");
_textArray.push("Please try\nto be\na bit\nfaster!");
alpha = 0;
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function get id():String{
return (m_id);
}
public function tick(_arg1:Number):void{
if (_game.isGameOver){
_text.text = _textArray[(_textArray.length - 1)];
_altitude = (_altitude - 0.6);
if (alpha > 0){
alpha = (alpha - 0.02);
};
return;
};
_textTimer = (_textTimer - _arg1);
if (_textTimer < 0){
_text.text = _textArray[_textIndex];
_textTimer = 3500;
_textIndex++;
if (_textIndex >= (_textArray.length - 1)){
_textIndex = (_textArray.length - 2);
};
};
if (_ttj >= 0){
if (_ttj > 0){
_ttj = (_ttj - (_arg1 / 33));
return;
};
this.visible = true;
};
if (speedY > _maxFallSpeed){
speedY = (speedY - (0.2 * (_arg1 / 33)));
};
_altitude = (_altitude + (speedY * (_arg1 / 33)));
x = (x - ((((x - _targetX) + (Math.cos((_altitude / 100)) * 30)) / 40) * (_arg1 / 33)));
if (_game.isLevelEnd){
if (alpha > 0){
alpha = (alpha - 0.3);
};
} else {
if (alpha < 1){
alpha = (alpha + 0.05);
};
};
}
public function dispose():void{
}
public function get altitude():Number{
return (_altitude);
}
public function get type():String{
return (_type);
}
public function get depth():Number{
return (_depth);
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function set distance(_arg1:Number):void{
_distance = _arg1;
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
public function get distance():Number{
return (_distance);
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
}
}//package
Section 125
//Bonus (Bonus)
package {
import com.urbansquall.serenity.*;
import flash.text.*;
public class Bonus extends TextField implements IEntity {
private var _altitude:Number;
private var _depth:Number;// = 1
private var _game:Game;
private var _type:String;
private var m_id:String;
private var _ttl:int;// = 20
public var speedX:Number;// = 0
public var speedY:Number;
public function Bonus(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String){
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_altitude = _arg2;
speedY = _arg4;
GameFont.setTextFieldStyle1(this);
_type = "chuteOpen";
text = _arg5;
this.x = (_arg3 - (this.width / 2));
cacheAsBitmap = true;
}
public function get depth():Number{
return (_depth);
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function get id():String{
return (m_id);
}
public function tick(_arg1:Number):void{
_ttl--;
speedY = (speedY - 1);
_altitude = (_altitude + speedY);
if (_ttl <= 0){
_game.entityContainer.removeEntity(this);
this.parent.removeChild(this);
delete ??getglobalscope
[this];
};
}
public function dispose():void{
}
public function get altitude():Number{
return (_altitude);
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
}
}//package
Section 126
//ChooseLevel (ChooseLevel)
package {
import flash.events.*;
import com.HazmiWeb.events.*;
import com.HazmiWeb.*;
import flash.display.*;
import com.urbansquall.metronome.*;
import com.reintroducing.sound.*;
import flash.text.*;
import flash.net.*;
import com.HazmiWeb.floatingchars.*;
public class ChooseLevel extends Sprite {
private var _ticker:Ticker;
private var _clicks:int;// = 0
private var _nameField:TextField;
private var _floatingChars:FloatingChars;
private var _flipScreen:FlipScreen;
public function ChooseLevel(_arg1:FlipScreen){
_ticker = new Ticker(33);
super();
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
_flipScreen = _arg1;
}
private function onClick(_arg1:MouseEvent):void{
_clicks++;
if (_clicks == 20){
showLevels(40);
};
}
private function onAddedToStage(_arg1:Event):void{
var _local2:int;
var _local3:Bitmap = (addChild(new Bitmap(Assets.getBitmapDataAsset("sky1"))) as Bitmap);
this.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
var _local4:SharedObject = SharedObject.getLocal("chuteacademy");
_local2 = Math.min(int(_local4.data.level), 40);
if (_local2 == 0){
_local2 = 1;
};
showLevels(_local2);
_nameField = (addChild(new TextField()) as TextField);
GameFont.setTextFieldStyle2(_nameField, 32, TextFormatAlign.CENTER, TextFieldAutoSize.CENTER);
_nameField.width = 640;
_nameField.x = 320;
_nameField.y = 30;
_nameField.text = "Choose starting round";
_ticker.addEventListener(TickerEvent.TICK, Tick, false, 0, true);
_ticker.start();
}
public function dispose():void{
while (numChildren > 0) {
removeChildAt(0);
};
parent.removeChild(this);
}
private function showLevels(_arg1:int):void{
if (_floatingChars != null){
removeChild(_floatingChars);
_floatingChars.removeEventListener(ParameterEvent.CLICK, onCharClick);
_floatingChars = null;
};
var _local2:Array = new Array();
var _local3 = 1;
while (_local3 < 41) {
_local2.push(String(_local3));
_local3++;
};
_floatingChars = (addChild(new FloatingChars(460, 300, _arg1)) as FloatingChars);
_floatingChars.x = 90;
_floatingChars.y = 100;
_floatingChars.chars = _local2;
_floatingChars.addEventListener(ParameterEvent.CLICK, onCharClick, false, 0, true);
}
private function onCharClick(_arg1:ParameterEvent):void{
var _local2:FloatingChar = (_arg1.params as FloatingChar);
var _local3:int = int(_local2.text);
SoundManager.getInstance().playSound("peew");
dispatchEvent(new ParameterEvent(ParameterEvent.CLICK, _local3, false, true));
}
private function Tick(_arg1:TickerEvent):void{
if (_flipScreen){
this.visible = false;
_flipScreen.setScreen2(this);
if (_flipScreen.tick(_arg1.interval) == false){
_flipScreen.parent.removeChild(_flipScreen);
_flipScreen = null;
this.visible = true;
_ticker.stop();
_ticker = null;
};
};
}
}
}//package
Section 127
//Chute (Chute)
package {
import flash.events.*;
import flash.display.*;
import com.urbansquall.serenity.*;
import com.HazmiWeb.BitmapAnimation.*;
public class Chute extends Sprite implements IEntity {
private var _body:AnimationController;
private var _altitude:Number;
private var _chuteOpen:Boolean;// = false
private var _crashAtHeight:Number;// = 50
private var _type:String;
private var _chute:AnimationController;
private var _previousFrameChute:int;// = 0
private var _hasCrashed:Boolean;// = false
private var m_id:String;
private var _targetX:Number;// = 0
private var _ttj:Number;
private var _objectBitmap:Bitmap;
public var object:String;
private var _wiggle:Number;
private var _depth:Number;// = 1
private var _previousChuteY:int;// = 500
private var _game:Game;
private var _distance:Number;
public var formationCenterChute:FormationCenterChute;
private var _maxFallSpeed:Number;// = -20
private var _isObject:Boolean;// = false
private var _landed:Boolean;// = false
public var speedX:Number;// = 0
public var speedY:Number;// = -6
private var _wiggleOffset:Number;
public function Chute(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:String=""){
_body = new AnimationController();
_chute = new AnimationController();
_wiggle = (Math.random() * 10);
_wiggleOffset = (Math.random() * 5000);
super();
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_altitude = _arg2;
_targetX = _arg4;
_ttj = _arg3;
object = getObject(_arg5);
this.visible = false;
addEventListener(MouseEvent.MOUSE_DOWN, onClick, false, 0, true);
_chute.initAnimation(_game.animationData.getAnimation("chute"), "open");
_chute.smoothing = true;
this.addChild(_chute);
_chute.x = 0;
_chute.y = 0;
_chute.visible = false;
_body.initAnimation(_game.animationData.getAnimation("para0"), "start");
_body.smoothing = true;
this.addChild(_body);
if (object != ""){
_objectBitmap = new Bitmap(Assets.getBitmapDataAsset(object), "auto", true);
_objectBitmap.x = (-(_objectBitmap.width) / 2);
this.addChild(_objectBitmap);
_type = "object";
_isObject = true;
_body.visible = false;
_crashAtHeight = (13 + _objectBitmap.height);
} else {
_body.visible = true;
_type = "chute";
};
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function tick(_arg1:Number):void{
if (_ttj >= 0){
if (_ttj > 0){
_ttj = (_ttj - (_arg1 / 33));
return;
};
this.visible = true;
};
if (!_landed){
x = (x - ((((x - _targetX) + (Math.cos((_altitude / 100)) * 30)) / 40) * (_arg1 / 33)));
if (((_chuteOpen) && (!(_landed)))){
rotation = (Math.cos(((_altitude + _wiggleOffset) / 10)) * _wiggle);
} else {
rotation = (Math.cos(((_altitude + _wiggleOffset) / 100)) * _wiggle);
};
};
if (((((!(_landed)) && (!(_chuteOpen)))) && ((speedY > _maxFallSpeed)))){
speedY = (speedY - (0.2 * (_arg1 / 33)));
};
if (((!(_landed)) && ((_altitude < _crashAtHeight)))){
_altitude = _crashAtHeight;
_landed = true;
_body.state = "stopped";
_chute.state = "close";
rotation = 0;
if (speedY < -1){
_body.initAnimation(_game.animationData.getAnimation("explosion"), "open");
_body.visible = true;
_hasCrashed = true;
if (_isObject){
_objectBitmap.visible = false;
};
if (!_isObject){
_game.soundmanager.playSound("bof", 1, 0, 0);
_game.gameOver();
};
_game.ground.addHole(x);
};
speedY = 0;
};
_altitude = (_altitude + (speedY * (_arg1 / 33)));
if (!_isObject){
_body.updateAnimation(_arg1);
};
if (_hasCrashed){
_body.updateAnimation(_arg1);
};
if (((((!(_landed)) && (_chuteOpen))) && ((_chute._frame.index < 4)))){
_chute.updateAnimation(_arg1);
_chute.y = (_chute.y - (5 * (_arg1 / 33)));
};
if (((_landed) && (_chuteOpen))){
_chute.updateAnimation(_arg1);
if ((_chute.y + 20) < _body.height){
_chute.y = (_chute.y + (_arg1 / 33));
_chute.x = (_chute.x - (0.3 * (_arg1 / 33)));
} else {
_chute.visible = false;
};
};
if (((!((_previousFrameChute == _chute._frame.index))) || (!((_previousChuteY == _chute.y))))){
_previousChuteY = _chute.y;
_previousFrameChute = _chute._frame.index;
drawCables();
};
}
public function dispose():void{
}
public function get altitude():Number{
return (_altitude);
}
private function getObject(_arg1:String):String{
switch (_arg1){
case "":
return ("");
case "a":
return ("piano");
case "b":
return ("beer");
case "c":
return ("bomb");
case "d":
return ("tank");
case "e":
return ("wc");
case "f":
return ("car");
case "g":
return ("coffin");
case "h":
return ("guitar");
case "i":
return ("sofa");
case "j":
return ("chair");
case "k":
return ("vespa");
case "l":
return ("satelite");
};
return ("");
}
public function get id():String{
return (m_id);
}
public function get type():String{
return (_type);
}
public function get depth():Number{
return (_depth);
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
private function drawCables():void{
this.graphics.clear();
this.graphics.lineStyle(1, 0, 0.1);
var _local1:int = _chute._frame.index;
if (_landed){
_local1 = (5 - _local1);
};
if (_local1 == 4){
this.graphics.moveTo(0, 25);
this.graphics.lineTo((-45 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((45 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((-20 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((20 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((0 + _chute.x), (_chute.y - 15));
};
if (_local1 == 3){
this.graphics.moveTo(0, 25);
this.graphics.lineTo((-20 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((20 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((-10 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((10 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((0 + _chute.x), (_chute.y - 15));
};
if (_local1 == 2){
this.graphics.moveTo(0, 25);
this.graphics.lineTo((-10 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((10 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((-5 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((5 + _chute.x), (_chute.y - 15));
this.graphics.moveTo(0, 25);
this.graphics.lineTo((0 + _chute.x), (_chute.y - 15));
};
}
public function set distance(_arg1:Number):void{
_distance = _arg1;
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
private function onClick(_arg1:MouseEvent):void{
if (!_landed){
openChute(true);
};
}
public function get distance():Number{
return (_distance);
}
public function set realY(_arg1:Number):void{
y = _arg1;
if (((((((_isObject) && ((_maxFallSpeed == -20)))) && ((_ttj < 1)))) && ((y > 0)))){
_maxFallSpeed = -25;
};
}
public function openChute(_arg1:Boolean=false):void{
removeEventListener(MouseEvent.MOUSE_DOWN, onClick);
_body.state = "open";
_chuteOpen = true;
_chute.visible = true;
_game.chuteOpened(this, _arg1);
speedY = -1;
_type = "chuteOpen";
_game.soundmanager.playSound("open", 1, 0, 0);
this.parent.setChildIndex(this, 0);
_wiggle = 5;
}
}
}//package
Section 128
//Clock (Clock)
package {
import flash.events.*;
import flash.display.*;
import com.urbansquall.serenity.*;
import com.HazmiWeb.BitmapAnimation.*;
public class Clock extends Sprite implements IEntity {
private var _body:AnimationController;
private var _depth:Number;// = 1
private var _altitude:Number;
private var _wiggle:Number;
private var _game:Game;
private var _distance:Number;
private var _type:String;
private var _maxFallSpeed:Number;
private var _targetX:Number;// = 0
private var _ttj:Number;
private var m_id:String;
public var speedX:Number;// = 0
public var speedY:Number;// = -6
private var _wiggleOffset:Number;
public function Clock(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number){
_body = new AnimationController();
_wiggle = (Math.random() * 10);
_wiggleOffset = (Math.random() * 1000);
super();
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_altitude = _arg2;
_targetX = _arg4;
_ttj = _arg3;
this.visible = false;
addEventListener(MouseEvent.MOUSE_DOWN, onClick, false, 0, true);
_body.initAnimation(_game.animationData.getAnimation("clock"), "open");
_body.smoothing = true;
this.addChild(_body);
_type = "clock";
_maxFallSpeed = -25;
}
public function get depth():Number{
return (_depth);
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function set distance(_arg1:Number):void{
_distance = _arg1;
}
public function get type():String{
return (_type);
}
public function get altitude():Number{
return (_altitude);
}
public function tick(_arg1:Number):void{
if (_ttj >= 0){
if (_ttj > 0){
_ttj = (_ttj - (_arg1 / 33));
return;
};
this.visible = true;
};
x = (x - ((((x - _targetX) + (Math.cos((_altitude / 100)) * 250)) / 20) * (_arg1 / 33)));
if (speedY > _maxFallSpeed){
speedY = (speedY - (0.2 * (_arg1 / 33)));
};
_altitude = (_altitude + (speedY * (_arg1 / 33)));
_body.updateAnimation(_arg1);
}
public function dispose():void{
}
public function get id():String{
return (m_id);
}
private function onClick(_arg1:MouseEvent):void{
removeEventListener(MouseEvent.MOUSE_DOWN, onClick);
_game.makeParticles(altitude, x);
_game.soundmanager.playSound("bonus", 1, 0, 0);
_game.slowmoBonus();
parent.removeChild(this);
_game.entityContainer.removeEntity(this);
delete ??getglobalscope
[this];
}
public function get distance():Number{
return (_distance);
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
}
}//package
Section 129
//Cloud (Cloud)
package {
import flash.display.*;
import com.urbansquall.serenity.*;
import com.HazmiWeb.BitmapAnimation.*;
public class Cloud extends Bitmap implements IEntity {
private var _body:AnimationController;
private var _depth:Number;// = 1
private var _propellor:AnimationController;
private var _hatch:AnimationController;
private var _altitude:Number;
private var _game:Game;
private var _type:String;
private var _sky:int;
private var m_id:String;
public var speedX:Number;// = 0
public var speedY:Number;// = 0
public function Cloud(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:int){
_body = new AnimationController();
_propellor = new AnimationController();
_hatch = new AnimationController();
super();
m_id = SimpleIDCounter.calculateNextID();
_game = _arg1;
_altitude = _arg2;
_depth = _arg3;
_type = "cloud";
_sky = _arg4;
if (_depth <= 1){
if (Math.random() > 0.5){
this.bitmapData = Assets.getBitmapDataAsset((("sky" + String(_sky)) + "cloudA"));
} else {
this.bitmapData = Assets.getBitmapDataAsset((("sky" + String(_sky)) + "cloudB"));
};
} else {
if (Math.random() > 0.5){
this.bitmapData = Assets.getBitmapDataAsset((("sky" + String(_sky)) + "cloudC"));
} else {
this.bitmapData = Assets.getBitmapDataAsset((("sky" + String(_sky)) + "cloudD"));
};
};
this.width = (this.width * _depth);
this.height = (this.height * _depth);
}
public function get depth():Number{
return (_depth);
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function get type():String{
return (_type);
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function get id():String{
return (m_id);
}
public function tick(_arg1:Number):void{
x = (x + (speedX * (_arg1 / 33)));
if (x < -(this.width)){
x = 640;
};
}
public function dispose():void{
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
public function get altitude():Number{
return (_altitude);
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
}
}//package
Section 130
//FormationCenterChute (FormationCenterChute)
package {
import flash.display.*;
import com.urbansquall.serenity.*;
public class FormationCenterChute extends Bitmap implements IEntity {
private var _altitude:Number;
private var _depth:Number;// = 1
private var _game:Game;
private var _distance:Number;
private var _type:String;
private var _ttj:Number;
private var m_id:String;
public var speedY:Number;// = -6
public function FormationCenterChute(_arg1:Game, _arg2:Number, _arg3:Number){
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_altitude = _arg2;
_type = "formationCenter";
_ttj = _arg3;
}
public function get depth():Number{
return (_depth);
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function set distance(_arg1:Number):void{
_distance = _arg1;
}
public function get id():String{
return (m_id);
}
public function tick(_arg1:Number):void{
if (_ttj >= 0){
_ttj = (_ttj - (_arg1 / 33));
return;
};
if (speedY > -20){
speedY = (speedY - (0.2 * (_arg1 / 33)));
};
_altitude = (_altitude + (speedY * (_arg1 / 33)));
}
public function dispose():void{
}
public function get altitude():Number{
return (_altitude);
}
public function get distance():Number{
return (_distance);
}
public function set realY(_arg1:Number):void{
this.y = _arg1;
}
public function get type():String{
return (_type);
}
}
}//package
Section 131
//Game (Game)
package {
import flash.events.*;
import com.HazmiWeb.*;
import flash.display.*;
import com.urbansquall.metronome.*;
import com.reintroducing.sound.*;
import flash.geom.*;
import com.urbansquall.serenity.*;
import com.HazmiWeb.BitmapAnimation.*;
import com.HazmiWeb.Utils.*;
import com.urbansquall.utils.*;
public class Game extends Sprite {
private var _altitude:Number;
private var _level:Level;
public var ground:Ground;
private var _bonusMultiplier:int;// = 1
public var isLevelEnd:Boolean;// = false
private var _gameOverScreen:GameOverScreen;
private var _timeBonusLeft:int;// = 0
private var _mem:MaxMemory;
private var _main:Main;
public var score:Score;
private var _skyId:int;// = 1
private var _bonusTimeout:int;// = 0
public var camera:GameCamera;
private var _topScoreScreen:TopScoreScreen;
private var _levelStartScreen:LevelStartScreen;
private var _fps:FPS;
private var _ticker:Ticker;
private var _gameCompleteScreen:GameCompleteScreen;
private var _chutesLeft:int;// = 0
public var soundmanager:SoundManager;
public var isGameOver:Boolean;// = false
private var _playfield:Sprite;
public var finalChute:Chute;
private var _background:Sprite;
public var animationData:AnimationData;
private var _mouseOutOfGame:Boolean;
public var isGameOverScreenReady:Boolean;// = false
private var _flipScreen:FlipScreen;
private var _plane:Plane;
public var entityContainer:EntityContainer;
private var _foreground:Sprite;
private var _heightMeter:HeightMeter;
private var _levelCompleteScreen:LevelCompleteScreen;
public var mainLoop:Function;// = null
public function Game(_arg1:Main, _arg2:Level, _arg3:FlipScreen, _arg4:int){
animationData = new AnimationData();
soundmanager = SoundManager.getInstance();
camera = new GameCamera(0, 0, 480);
super();
_main = _arg1;
_level = _arg2;
_skyId = _level.sky;
_altitude = _level.height;
_chutesLeft = _level.jumpers;
_flipScreen = _arg3;
score = new Score(_arg4);
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}
private function mainLoop_gameOver(_arg1:Number):void{
entityContainer.tick(_arg1);
camera.setTargetHeight(0);
camera.tick(_arg1);
camera.processEntities(entityContainer);
if (_gameOverScreen.isReady){
setMainLoop(mainLoop_TopScores);
};
}
public function slowmoBonus():void{
if (isGameOver){
return;
};
_timeBonusLeft = 600;
}
private function lowestChute():Chute{
var _local2:IEntity;
var _local4:Chute;
var _local1:int = (entityContainer.numEntities - 1);
var _local3:Number = _altitude;
while (_local1 >= 0) {
_local2 = entityContainer.getEntityAt(_local1);
if ((((_local2.type == "chute")) && ((_local2.altitude < _local3)))){
_local3 = _local2.altitude;
_local4 = (_local2 as Chute);
};
_local1--;
};
return (_local4);
}
public function dispose():void{
disposeAssets();
}
private function initScenery():void{
var _local4:Background;
var _local5:Cloud;
var _local6:Cloud;
var _local1:Number = (_altitude + 20);
while (_local1 >= -500) {
_local4 = new Background(this, _local1, 0.5, _skyId);
_background.addChild(_local4);
entityContainer.addEntity(_local4);
_local1 = (_local1 - (480 / _local4.depth));
};
var _local2:Number = 0.5;
while (_local2 < 1) {
_local5 = new Cloud(this, (Math.random() * _altitude), _local2, _skyId);
_background.addChild(_local5);
_local5.x = (((Math.random() * 640) + (_local5.width / 2)) - (_local5.width / 2));
entityContainer.addEntity(_local5);
_local5.speedX = (-((_local5.altitude / _altitude)) * _local2);
_local2 = (_local2 + 0.01);
};
ground = new Ground(this, _skyId);
entityContainer.addEntity(ground);
_background.addChild(ground);
var _local3:Number = 1.01;
while (_local2 < 1.2) {
_local6 = new Cloud(this, ((Math.random() * (_altitude - 480)) + 480), _local3, _skyId);
_playfield.addChild(_local6);
_local6.x = (((Math.random() * 640) + _local6.width) - _local6.width);
entityContainer.addEntity(_local6);
_local6.speedX = (-((_local6.altitude / (_altitude / 5))) * _local3);
_local2 = (_local2 + 0.05);
};
}
private function initInterface():void{
_heightMeter = new HeightMeter(_level.height);
_foreground.addChild(_heightMeter);
_heightMeter.x = 10;
_heightMeter.y = ((480 / 2) - (_heightMeter.height / 2));
_foreground.addChild(score);
score.x = ((640 - 10) - score.width);
score.y = ((480 / 2) - (score.height / 2));
}
private function disposeGameLogic():void{
_ticker.stop();
_ticker = null;
entityContainer.dispose();
animationData.dispose();
}
private function tick(_arg1:TickerEvent):void{
mainLoop(_arg1.interval);
}
private function initFPS():void{
}
private function disposeAssets():void{
soundmanager.stopAllSounds();
_ticker.stop();
_ticker = null;
entityContainer.dispose();
disposeLayers();
}
private function mainLoop_levelEnd(_arg1:Number):void{
entityContainer.tick(_arg1);
camera.setTargetHeight(finalChute.altitude);
camera.tick(_arg1);
camera.processEntities(entityContainer);
_levelCompleteScreen.tick(_arg1);
}
private function removeChildDisplayObjects(_arg1:DisplayObjectContainer):void{
var _local2:DisplayObjectContainer;
while (_arg1.numChildren > 0) {
if ((_arg1.getChildAt(0) as DisplayObjectContainer) == null){
_arg1.removeChildAt(0);
} else {
_local2 = (_arg1.getChildAt(0) as DisplayObjectContainer);
removeChildDisplayObjects(_local2);
if (_local2 != this.stage){
_arg1.removeChild(_local2);
};
};
};
}
private function mainLoop_levelStartScreen(_arg1:Number):void{
entityContainer.tick(_arg1);
_levelStartScreen.tick(_arg1);
camera.tick(_arg1);
camera.processEntities(entityContainer);
if (_flipScreen){
this.visible = false;
_flipScreen.setScreen2(this);
if (_flipScreen.tick(_arg1) == false){
_flipScreen.parent.removeChild(_flipScreen);
_flipScreen = null;
this.visible = true;
};
};
}
private function initJumpers():void{
var _local1:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local8:FormationCenterChute;
var _local9:int;
var _local10:String;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:Chute;
var _local15:Clock;
var _local16:Medal;
var _local17:Santa;
var _local18:Balloon;
var _local19:Chute;
_local1 = 5;
var _local2 = 3;
var _local3 = 10;
_local6 = (_plane.altitude - 80);
var _local7:int;
while (_local7 < _level.formation.length) {
_local8 = new FormationCenterChute(this, _local6, (_local1 + (((_level.formation[_local7].length - 1) * _local2) / 2)));
entityContainer.addEntity(_local8);
_foreground.addChild(_local8);
_local9 = 0;
while (_local9 < _level.formation[_local7].length) {
_local10 = _level.formation[_local7][_local9];
_local11 = (640 / (_local10.length + 1));
_local12 = _local11;
_local13 = 0;
while (_local13 < _local10.length) {
switch (_local10.charAt(_local13)){
case "1":
_local14 = new Chute(this, _local6, _local1, _local12);
_local14.x = (_plane.x + 350);
_local14.formationCenterChute = _local8;
_playfield.addChild(_local14);
entityContainer.addEntity(_local14);
break;
case "0":
break;
case "2":
_local15 = new Clock(this, _local6, _local1, _local12);
_local15.x = (_plane.x + 350);
_playfield.addChild(_local15);
entityContainer.addEntity(_local15);
break;
case "3":
_local16 = new Medal(this, _local6, _local1, _local12);
_local16.x = (_plane.x + 350);
_playfield.addChild(_local16);
entityContainer.addEntity(_local16);
break;
case "4":
_local17 = new Santa(this, _local6, _local1, _local12);
_local17.x = (_plane.x + 350);
_playfield.addChild(_local17);
entityContainer.addEntity(_local17);
break;
case "8":
_local18 = new Balloon(this, _local6, _local1, _local12);
_local18.x = (_plane.x + 350);
_playfield.addChild(_local18);
entityContainer.addEntity(_local18);
break;
default:
_local19 = new Chute(this, _local6, _local1, _local12, _local10.charAt(_local13));
_local19.x = (_plane.x + 350);
_playfield.addChild(_local19);
entityContainer.addEntity(_local19);
break;
};
_local12 = (_local12 + _local11);
_local13++;
};
_local1 = (_local1 + _local2);
if (_level.formation[_local7].length > 8){
_local1 = (_local1 - (_level.formation[_local7].length - 8));
};
_local9++;
};
_local1 = (_local1 + _local3);
_local7++;
};
}
private function initAssets():void{
animationData.addAnimation(Assets.getXMLAsset("sprites", true));
}
private function mainLoop_gamePlay(_arg1:Number):void{
if (_mouseOutOfGame){
return;
};
if (_timeBonusLeft > 0){
_timeBonusLeft--;
_arg1 = (_arg1 * (1 - (_timeBonusLeft * 0.001)));
};
_bonusTimeout = (_bonusTimeout - (_arg1 / 33));
entityContainer.tick(_arg1);
var _local2:Chute = lowestChute();
camera.setTargetHeight((_local2.formationCenterChute.altitude - 200));
camera.tick(_arg1);
camera.processEntities(entityContainer);
if (_local2.formationCenterChute.altitude < (_plane.altitude - 1500)){
soundmanager.setSoundVolume("plane", 0);
} else {
soundmanager.setSoundVolume("plane", ((1 / 1500) * (1500 - (_plane.altitude - _local2.formationCenterChute.altitude))));
};
_heightMeter.setHeight(_local2.altitude);
}
private function initGameLogic():void{
entityContainer = new EntityContainer();
_ticker = new Ticker(33);
_ticker.addEventListener(TickerEvent.TICK, tick, false, 0, true);
_ticker.start();
setMainLoop(mainLoop_levelStartScreen);
}
public function makeParticles(_arg1:Number, _arg2:Number):void{
var _local4:Particle;
var _local3:int;
while (_local3 < 20) {
_local4 = new Particle(this, new Point(_arg2, _arg1), 30, ((Math.random() * 20) - 10), (Math.random() * 20), 1.1, 1.1, 1.1, 0, -0.05, true);
_background.addChild(_local4);
entityContainer.addEntity(_local4);
_local3++;
};
}
private function mainLoop_gameComplete(_arg1:Number):void{
entityContainer.tick(_arg1);
camera.setTargetHeight(finalChute.altitude);
camera.tick(_arg1);
camera.processEntities(entityContainer);
if (_gameCompleteScreen.isReady){
setMainLoop(mainLoop_gameOver);
};
}
public function gameOver():void{
if (!isGameOver){
isGameOver = true;
setMainLoop(mainLoop_gameOver);
soundmanager.stopAllSounds();
soundmanager.playSound("gameover", 2);
};
}
private function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
stage.addEventListener(Event.MOUSE_LEAVE, onMouseLeave);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
initAssets();
initLayers();
initFPS();
initGameLogic();
_plane = new Plane(this, (_altitude + 50));
entityContainer.addEntity(_plane);
_plane.x = -350;
_foreground.addChild(_plane);
camera.maxHeight = _altitude;
camera.height = _altitude;
initScenery();
initInterface();
if ((_level.level % 2) == 0){
soundmanager.playSound("music1", 1.5, 0, 99999);
} else {
soundmanager.playSound("music2", 1.5, 0, 99999);
};
}
private function onMouseLeave(_arg1:Event):void{
_mouseOutOfGame = true;
}
private function disposeLayers():void{
removeChildDisplayObjects(this);
}
public function openAllBonus():void{
var _local4:IEntity;
if (isGameOver){
return;
};
var _local1:Chute = lowestChute();
if (_local1 == null){
return;
};
var _local2:FormationCenterChute = _local1.formationCenterChute;
var _local3:int = (entityContainer.numEntities - 1);
while (_local3 >= 0) {
_local4 = entityContainer.getEntityAt(_local3);
if (_local4.type == "chute"){
_local1 = (_local4 as Chute);
if (_local1.formationCenterChute == _local2){
_local1.openChute();
};
};
_local3--;
};
}
public function chuteOpened(_arg1:Chute, _arg2:Boolean):void{
var _local3:Bonus;
var _local4:int;
var _local5:Bonus;
if (_arg2){
if (_bonusTimeout > 0){
soundmanager.playSound(("sound" + String(Math.min(_bonusMultiplier, 8))));
_bonusMultiplier++;
if (_bonusMultiplier > 1){
_local3 = new Bonus(this, (_arg1.altitude + 20), _arg1.x, _arg1.speedY, "2 X");
_playfield.addChildAt(_local3, 0);
entityContainer.addEntity(_local3);
};
} else {
_bonusMultiplier = 1;
};
};
_bonusTimeout = 10;
if (_arg1.type == "chute"){
_chutesLeft--;
if (_chutesLeft <= 0){
isLevelEnd = true;
finalChute = _arg1;
_ticker.ticks = 0;
setMainLoop(mainLoop_levelEnd);
};
score.score = (score.score + 10);
if (_bonusMultiplier > 1){
score.score = (score.score + 10);
};
} else {
_local4 = 100;
if (_bonusMultiplier > 1){
_local4 = (_local4 + 100);
};
score.score = (score.score + _local4);
soundmanager.playSound("peew");
_local5 = new Bonus(this, (_arg1.altitude + 20), _arg1.x, _arg1.speedY, String(_local4));
_playfield.addChildAt(_local5, 0);
entityContainer.addEntity(_local5);
};
}
private function initLayers():void{
_background = (addChild(new Sprite()) as Sprite);
_playfield = (addChild(new Sprite()) as Sprite);
_foreground = (addChild(new Sprite()) as Sprite);
_background.y = 0;
_playfield.y = 0;
_foreground.y = 0;
}
private function onMouseMove(_arg1:MouseEvent):void{
_mouseOutOfGame = false;
}
public function makeParticles2(_arg1:Number, _arg2:Number):void{
var _local4:Particle;
var _local3:int;
while (_local3 < 30) {
_local4 = new Particle(this, new Point(_arg2, _arg1), 50, ((Math.random() * 20) - 10), ((Math.random() * 20) - 10), 1, 1, 1, 0, -0.01, true);
_background.addChild(_local4);
entityContainer.addEntity(_local4);
_local3++;
};
}
private function mainLoop_TopScores(_arg1:Number):void{
entityContainer.tick(_arg1);
camera.tick(_arg1);
camera.processEntities(entityContainer);
if (_topScoreScreen.isReady){
_main.applicationState = "menu";
};
}
public function setMainLoop(_arg1:Function):void{
switch (_arg1){
case mainLoop_levelStartScreen:
_levelStartScreen = new LevelStartScreen(this, _level, mainLoop_gamePlay);
this.addChild(_levelStartScreen);
camera.setTargetHeight(_altitude);
soundmanager.playSound("woosh");
break;
case mainLoop_gamePlay:
this.removeChild(_levelStartScreen);
initJumpers();
break;
case mainLoop_levelEnd:
if (_level.level == 40){
setMainLoop(mainLoop_gameComplete);
return;
};
_levelCompleteScreen = new LevelCompleteScreen(_main, _level, this);
this.addChild(_levelCompleteScreen);
_level.height = (_level.height - int(finalChute.altitude));
break;
case mainLoop_gameComplete:
_gameCompleteScreen = new GameCompleteScreen();
this.addChild(_gameCompleteScreen);
break;
case mainLoop_gameOver:
_gameOverScreen = new GameOverScreen(_level, score.score);
this.addChild(_gameOverScreen);
_topScoreScreen = new TopScoreScreen(score.score);
break;
case mainLoop_TopScores:
addChild(_topScoreScreen);
removeChild(_gameOverScreen);
_topScoreScreen.start();
break;
};
mainLoop = _arg1;
}
}
}//package
Section 132
//GameCamera (GameCamera)
package {
import flash.display.*;
import com.urbansquall.serenity.*;
public class GameCamera {
private var _height:Number;
public var maxHeight:Number;
public var screenHeight:Number;// = 480
public var minHeight:Number;// = 0
private var _targetHeigth:Number;
public function GameCamera(_arg1:Number=0, _arg2:Number=0, _arg3:Number=480){
maxHeight = _arg1;
minHeight = _arg2;
screenHeight = _arg3;
}
public function setTargetHeight(_arg1:Number):void{
_targetHeigth = _arg1;
}
public function get height():Number{
return ((_height - (screenHeight / 2)));
}
public function set height(_arg1:Number):void{
_height = (_arg1 + (screenHeight / 2));
if (_height < (screenHeight + minHeight)){
_height = (screenHeight + minHeight);
};
if (_height > maxHeight){
_height = maxHeight;
};
}
public function processEntities(_arg1:EntityContainer):void{
var _local3:IEntity;
var _local4:DisplayObject;
var _local2:int = (_arg1.numEntities - 1);
while (_local2 >= 0) {
_local3 = _arg1.getEntityAt(_local2);
_local4 = (_arg1.getEntityAt(_local2) as DisplayObject);
_local3.realY = ((_height - (_local3.altitude * _local3.depth)) + (_height * (_local3.depth - 1)));
_local4.visible = (((_local4.y > -480)) && ((_local4.y < 880)));
_local2--;
};
}
public function tick(_arg1:Number):void{
height = (height - (((height - _targetHeigth) / 10) * (_arg1 / 33)));
}
}
}//package
Section 133
//GameCompleteScreen (GameCompleteScreen)
package {
import flash.events.*;
import com.HazmiWeb.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import com.HazmiWeb.Paths.*;
public class GameCompleteScreen extends Sprite {
private var _creditText:TextField;
private var _timer:Timer;
private var _score:int;
private var _ticks:int;// = 0
private var _medal:Sprite;
public var isReady:Boolean;// = false
private var _levelDetailPath:DisplayObjectPath;
private var _medalPath:DisplayObjectPath;
public function GameCompleteScreen(){
_timer = new Timer(30);
super();
initMedal();
initCredits();
_timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
_timer.start();
}
private function initMedal():void{
var _local1:Bitmap;
_medal = new Sprite();
_local1 = new Bitmap(Assets.getBitmapDataAsset("endMedal"), "auto", true);
_medal.addChild(_local1);
_local1.x = (-(_local1.width) / 2);
_local1.y = -50;
_medal.x = 2000;
this.addChild(_medal);
_medalPath = new DisplayObjectPath();
var _local2:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_medalPath.addWait(10);
_local2.easeTypePos = Ease.EaseExponential;
_local2.easeDirectionPos = Ease.EaseOut;
_local2.startX = -(_medal.width);
_local2.startY = 110;
_local2.endX = 180;
_local2.endY = _local2.startY;
_local2.easeTypeRotation = Ease.EaseElastic;
_local2.easeDirectionRotation = Ease.EaseOut;
_local2.startRotation = 45;
_local2.endRotation = 0;
_local2.ticks = 150;
_local2.generatePathTo(_medalPath);
_medalPath.addWait(1300);
_local2.easeTypePos = Ease.EaseQuintic;
_local2.easeDirectionPos = Ease.EaseIn;
_local2.startX = _local2.endX;
_local2.startY = _local2.startY;
_local2.endX = -(_medal.width);
_local2.endY = _local2.startY;
_local2.startRotation = 0;
_local2.endRotation = 0;
_local2.ticks = 40;
_local2.generatePathTo(_medalPath);
}
private function initCredits():void{
var _local1:Shape = (addChild(new Shape()) as Shape);
_local1.graphics.beginFill(0xFF0000, 1);
_local1.graphics.drawRect(0, 0, 400, 300);
_local1.x = 240;
_local1.y = 100;
_creditText = new TextField();
_creditText.x = 2000;
GameFont.setTextFieldStyle2(_creditText, 20, TextFormatAlign.CENTER);
_creditText.multiline = true;
_creditText.mask = _local1;
_creditText.text = "Congratulations!\n\nYou completed all tests\nand graduated in\nParachute Academy.\n\n\n- Credits -\n\nDavid Ferriz - Graphics\nFran Ferriz - Music\nBas Lambinon - Code\nArmorGames - Sponsor\n\n\n- Testers - \n\nLaura Suarez\nFran Ferriz\nEnrique David\nJoaquin Palazon\nAntonio Pastor\nMartin * Pilar * Irene * Antonio\n\n\n\n\n- The End -\n\nThanks for playing.\n\nDevilishgames 2009\n\n\n";
this.addChild(_creditText);
_levelDetailPath = new DisplayObjectPath();
var _local2:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_local2.easeTypePos = Ease.EaseLinear;
_local2.easeDirectionPos = Ease.EaseOut;
_local2.startX = 250;
_local2.startY = (_local1.y + _local1.height);
_local2.endX = _local2.startX;
_local2.endY = (_local1.y - _creditText.height);
_local2.ticks = 1500;
_local2.generatePathTo(_levelDetailPath);
}
private function onTimer(_arg1:TimerEvent):void{
_levelDetailPath.setPos(_creditText, _ticks);
if (_medalPath.setPos(_medal, _ticks)){
_timer.stop();
_timer = null;
isReady = true;
} else {
_ticks++;
};
}
}
}//package
Section 134
//GameFont (GameFont)
package {
import flash.display.*;
import flash.text.*;
import flash.filters.*;
public class GameFont {
public static function setTextFieldStyle1(_arg1:TextField, _arg2:int=24, _arg3:String="left", _arg4:String="center"):void{
var _local5:TextFormat = new TextFormat("gameFont", _arg2, 0xD00300, false);
_local5.align = _arg3;
_local5.kerning = true;
_arg1.embedFonts = true;
_arg1.defaultTextFormat = _local5;
_arg1.autoSize = _arg4;
_arg1.selectable = false;
_arg1.antiAliasType = AntiAliasType.NORMAL;
var _local6:BevelFilter = new BevelFilter(15, 90, 16777062, 1, 0x330066, 1, 20, 5, 0.55, 1, "inner", false);
var _local7:DropShadowFilter = new DropShadowFilter(1, 45, 0, 1, 5, 5, 9, 1, false, false, false);
_arg1.filters = [_local6, _local7];
}
public static function setTextFieldStyle2(_arg1:TextField, _arg2:int=24, _arg3:String="left", _arg4:String="center"):void{
var _local5:TextFormat = new TextFormat("gameFont", _arg2, 0x999999, false);
_local5.align = _arg3;
_local5.kerning = true;
_arg1.embedFonts = true;
_arg1.defaultTextFormat = _local5;
_arg1.autoSize = _arg4;
_arg1.selectable = false;
_arg1.antiAliasType = AntiAliasType.NORMAL;
var _local6:GlowFilter = new GlowFilter(0xFFFFFF, 1, 5, 5, 1, 1, true, false);
var _local7:BevelFilter = new BevelFilter(15, 90, 16777062, 1, 0x330066, 1, 20, 5, 0.55, 1, "inner", false);
var _local8:DropShadowFilter = new DropShadowFilter(1, 45, 0, 1, 5, 5, 9, 1, false, false, false);
_arg1.filters = [_local6, _local7, _local8];
}
public static function setTextFieldStyle3(_arg1:TextField, _arg2:int=24, _arg3:String="left", _arg4:String="center"):void{
var _local5:TextFormat = new TextFormat("gameFont", _arg2, 0, false);
_local5.align = _arg3;
_local5.kerning = true;
_local5.leftMargin = 10;
_local5.rightMargin = 10;
_arg1.embedFonts = true;
_arg1.defaultTextFormat = _local5;
_arg1.autoSize = _arg4;
_arg1.selectable = false;
_arg1.multiline = true;
_arg1.antiAliasType = AntiAliasType.NORMAL;
}
public static function TextFieldToBitmap(_arg1:String, _arg2:TextField):Bitmap{
_arg2.text = _arg1;
var _local3:BitmapData = new BitmapData(_arg2.width, (_arg2.height + 10), true, 0);
_local3.draw(_arg2, null, null, null, null, true);
var _local4:Bitmap = new Bitmap(_local3, "auto", true);
return (_local4);
}
}
}//package
Section 135
//GameOverScreen (GameOverScreen)
package {
import flash.events.*;
import com.HazmiWeb.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import com.HazmiWeb.Paths.*;
public class GameOverScreen extends Sprite {
private var _levelDetailText:TextField;
private var _score:int;
private var _levelNamePath:DisplayObjectPath;
private var _ticks:int;// = 0
public var isReady:Boolean;// = false
private var _levelDetailPath:DisplayObjectPath;
private var _levelNameText:TextField;
private var _timer:Timer;
public function GameOverScreen(_arg1:Level, _arg2:int){
_timer = new Timer(30);
super();
_score = _arg2;
initlevelName(_arg1.level);
initlevelDetail(_arg1.jumpers, _arg1.height);
_timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
_timer.start();
}
private function initlevelDetail(_arg1:int, _arg2:Number):void{
_levelDetailText = new TextField();
_levelDetailText.x = 2000;
GameFont.setTextFieldStyle2(_levelDetailText, 24, TextFormatAlign.CENTER);
_levelDetailText.text = ("Final Score: " + String(_score));
this.addChild(_levelDetailText);
_levelDetailPath = new DisplayObjectPath();
var _local3:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_levelDetailPath.addWait(10);
_local3.easeTypePos = Ease.EaseQuintic;
_local3.easeDirectionPos = Ease.EaseOut;
_local3.startX = (640 + _levelDetailText.width);
_local3.startY = 270;
_local3.endX = (320 - (_levelDetailText.width / 2));
_local3.endY = _local3.startY;
_local3.ticks = 25;
_local3.generatePathTo(_levelDetailPath);
_levelDetailPath.addWait(40);
_local3.easeTypePos = Ease.EaseQuintic;
_local3.easeDirectionPos = Ease.EaseIn;
_local3.startX = _local3.endX;
_local3.startY = _local3.startY;
_local3.endX = -(_levelDetailText.width);
_local3.endY = _local3.startY;
_local3.ticks = 30;
_local3.generatePathTo(_levelDetailPath);
_levelNamePath.addWait(40);
}
private function onTimer(_arg1:TimerEvent):void{
if (((_levelDetailPath.setPos(_levelDetailText, _ticks)) || (_levelNamePath.setPos(_levelNameText, _ticks)))){
_timer.stop();
_timer = null;
isReady = true;
} else {
_ticks++;
};
}
private function initlevelName(_arg1:int):void{
_levelNameText = new TextField();
_levelNameText.x = 2000;
GameFont.setTextFieldStyle1(_levelNameText, 58, TextFormatAlign.CENTER);
_levelNameText.text = "Game Over";
this.addChild(_levelNameText);
_levelNamePath = new DisplayObjectPath();
var _local2:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_levelNamePath.addWait(10);
_local2.easeTypePos = Ease.EaseQuintic;
_local2.easeDirectionPos = Ease.EaseOut;
_local2.startX = -(_levelNameText.width);
_local2.startY = 180;
_local2.endX = (320 - (_levelNameText.width / 2));
_local2.endY = _local2.startY;
_local2.ticks = 25;
_local2.generatePathTo(_levelNamePath);
_levelNamePath.addWait(40);
_local2.easeTypePos = Ease.EaseQuintic;
_local2.easeDirectionPos = Ease.EaseIn;
_local2.startX = _local2.endX;
_local2.startY = _local2.startY;
_local2.endX = (640 + _levelNameText.width);
_local2.endY = _local2.startY;
_local2.ticks = 30;
_local2.generatePathTo(_levelNamePath);
_levelNamePath.addWait(40);
}
}
}//package
Section 136
//GamePreloader (GamePreloader)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.urbansquall.preloader.*;
import flash.text.*;
import net.stevensacks.utils.*;
public class GamePreloader extends Preloader {
private var cloudCount:int;// = 100
private var _progress:int;// = 0
private var cloud_Bitmap:Class;
private var m_textfield:TextField;
private var clouds:Array;
public static const LOADER_FONT:String = "GamePreloader_LOADER_FONT";
public static var loading_Bitmap:Class = GamePreloader_loading_Bitmap;
public static var armor_Bitmap:Class = GamePreloader_armor_Bitmap;
public function GamePreloader(){
cloud_Bitmap = GamePreloader_cloud_Bitmap;
clouds = new Array();
super();
var _local1:Shape = new Shape();
_local1.visible = false;
_local1.graphics.beginFill(0, 1);
_local1.graphics.drawRect(0, 0, 640, 480);
_local1.graphics.endFill();
addChild(_local1);
this.mask = _local1;
}
override protected function updateLoading(_arg1:Number):void{
_progress = int((_arg1 * cloudCount));
m_textfield.text = (("LOADING... " + String(int((_arg1 * 100)))) + "%");
}
private function onEnterFrame(_arg1:Event):void{
var _local3:Bitmap;
var _local2:int;
while (_local2 < cloudCount) {
_local3 = clouds[_local2];
_local3.y = (_local3.y - (6 * ((_local2 / (cloudCount * 2)) + 0.5)));
if (_local3.y < -80){
_local3.y = 560;
};
if (_progress > _local2){
_local3.alpha = (_local3.alpha - 0.05);
};
_local2++;
};
}
private function onArmorClick(_arg1:MouseEvent):void{
Web.getURL("http://armorgames.com", "_blank");
}
private function initClouds():void{
var _local4:Bitmap;
var _local1:Class = Class(cloud_Bitmap);
var _local2:BitmapData = Bitmap(new (_local1)).bitmapData;
var _local3:int;
while (_local3 < cloudCount) {
_local4 = new Bitmap(_local2);
new Bitmap(_local2).scaleX = (_local4.scaleY = ((_local3 / (cloudCount * 2)) + 0.25));
_local4.x = ((Math.random() * 640) - (_local4.width / 2));
_local4.y = (((Math.random() * 640) - (_local4.height / 2)) - 80);
addChild(_local4);
clouds.push(_local4);
_local3++;
};
}
private function initSunshine():void{
var _local1:Shape = new Shape();
var _local2:String = GradientType.LINEAR;
var _local3:Array = [0xFF8000, 16698113];
var _local4:Array = [0, 0.5];
var _local5:Array = [0, 0xFF];
var _local6:Matrix = new Matrix();
_local6.createGradientBox(640, 480, 1, 0, 0);
var _local7:String = SpreadMethod.PAD;
_local1.graphics.beginGradientFill(_local2, _local3, _local4, _local5, _local6, _local7);
_local1.graphics.drawRect(0, 0, 640, 480);
_local1.graphics.endFill();
addChild(_local1);
}
override protected function endLoading():void{
stage.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
while (numChildren > 1) {
removeChildAt(1);
};
this.graphics.clear();
}
override protected function beginLoading():void{
initClouds();
var _local1:String = GradientType.LINEAR;
var _local2:Array = [0xFF8000, 16698113];
var _local3:Array = [1, 1];
var _local4:Array = [0, 0xFF];
var _local5:Matrix = new Matrix();
_local5.createGradientBox(640, 480, 1, 0, 0);
var _local6:String = SpreadMethod.PAD;
this.graphics.beginGradientFill(_local1, _local2, _local3, _local4, _local5, _local6);
this.graphics.drawRect(0, 0, 640, 480);
this.graphics.endFill();
var _local7:Class = Class(loading_Bitmap);
var _local8:Bitmap = (new (_local7) as Bitmap);
addChildAt(_local8, (cloudCount / 1.1));
_local8.x = (320 - (_local8.width / 2));
_local8.y = (180 - (_local8.height / 2));
var _local9:TextFormat = new TextFormat("ArialBlack", 16, 0, false);
_local9.align = TextFormatAlign.CENTER;
_local9.kerning = true;
_local9.leftMargin = 10;
_local9.rightMargin = 10;
m_textfield = new TextField();
addChildAt(m_textfield, (cloudCount / 1.1));
m_textfield.embedFonts = true;
m_textfield.defaultTextFormat = _local9;
m_textfield.multiline = false;
m_textfield.width = 640;
m_textfield.text = "LOADING... ";
m_textfield.antiAliasType = AntiAliasType.NORMAL;
m_textfield.textColor = 0x402500;
m_textfield.cacheAsBitmap = true;
m_textfield.selectable = false;
m_textfield.x = 0;
m_textfield.y = 300;
stage.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
_local7 = Class(armor_Bitmap);
var _local10:Sprite = new Sprite();
var _local11:Bitmap = (new (_local7) as Bitmap);
_local10.addChild(_local11);
_local10.x = (320 - (_local10.width / 2));
_local10.y = 420;
addChild(_local10);
_local10.alpha = 0.9;
_local10.addEventListener(MouseEvent.CLICK, onArmorClick, false, 0, true);
initSunshine();
}
}
}//package
Section 137
//GamePreloader_armor_Bitmap (GamePreloader_armor_Bitmap)
package {
import mx.core.*;
public class GamePreloader_armor_Bitmap extends BitmapAsset {
}
}//package
Section 138
//GamePreloader_cloud_Bitmap (GamePreloader_cloud_Bitmap)
package {
import mx.core.*;
public class GamePreloader_cloud_Bitmap extends BitmapAsset {
}
}//package
Section 139
//GamePreloader_LOADER_FONT (GamePreloader_LOADER_FONT)
package {
import mx.core.*;
public class GamePreloader_LOADER_FONT extends FontAsset {
}
}//package
Section 140
//GamePreloader_loading_Bitmap (GamePreloader_loading_Bitmap)
package {
import mx.core.*;
public class GamePreloader_loading_Bitmap extends BitmapAsset {
}
}//package
Section 141
//Ground (Ground)
package {
import flash.display.*;
import flash.geom.*;
import com.urbansquall.serenity.*;
import com.HazmiWeb.BitmapAnimation.*;
public class Ground extends Sprite implements IEntity {
private var _hatch:AnimationController;
private var _depth:Number;// = 1
private var _propellor:AnimationController;
private var _body:AnimationController;
private var _game:Game;
private var _altitude:Number;
private var _type:String;
private var _ground:Bitmap;
private var m_id:String;
private var _hole:BitmapData;
private var _holes:Bitmap;
public function Ground(_arg1:Game, _arg2:int){
_body = new AnimationController();
_propellor = new AnimationController();
_hatch = new AnimationController();
super();
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_type = "ground";
_ground = (addChild(new Bitmap(Assets.getBitmapDataAsset((("sky" + _arg2) + "ground")))) as Bitmap);
_altitude = (_ground.height - 10);
_holes = (addChild(new Bitmap(new BitmapData(_ground.width, 80, true, 0))) as Bitmap);
_holes.y = (_ground.height - _holes.height);
_hole = Assets.getBitmapDataAsset("hole");
}
public function get depth():Number{
return (_depth);
}
public function addHole(_arg1:Number):void{
_holes.bitmapData.copyPixels(_hole, new Rectangle(_hole.width, _hole.height), new Point((_arg1 - (_hole.width / 2)), 0), null, null, true);
var _local2:Matrix = new Matrix(1, 0, 0, 1, (_arg1 - (_hole.width / 2)), 20);
_holes.bitmapData.draw(_hole, _local2);
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function get id():String{
return (m_id);
}
public function tick(_arg1:Number):void{
}
public function dispose():void{
}
public function get altitude():Number{
return (_altitude);
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
public function get type():String{
return (_type);
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
}
}//package
Section 142
//HeightMeter (HeightMeter)
package {
import flash.display.*;
public class HeightMeter extends Sprite {
private var _icon:Bitmap;
private var _meterMax:Number;// = 8
private var _scale:Number;
private var _maxHeight:Number;// = 15000
private var _meterMin:Number;// = 170
public function HeightMeter(_arg1:Number){
_scale = ((_meterMax - _meterMin) / _maxHeight);
this.addChild(new Bitmap(Assets.getBitmapDataAsset("meter")));
_icon = new Bitmap(Assets.getBitmapDataAsset("height"));
this.addChild(_icon);
_icon.x = -1;
setHeight(_arg1);
}
public function setHeight(_arg1:Number):void{
if (_arg1 > _maxHeight){
_arg1 = _maxHeight;
};
_icon.y = (_meterMin + (_scale * _arg1));
}
}
}//package
Section 143
//Level (Level)
package {
public class Level {
public var sky:int;
public var level:int;
public var object:String;// = ""
public var height:Number;
public var formationId:String;// = ""
public var formation:Array;
public var won:Boolean;// = false
public var jumpers:int;// = 0
public var stars:int;
public function Level(){
formation = new Array();
super();
}
}
}//package
Section 144
//LevelCompleteScreen (LevelCompleteScreen)
package {
import com.HazmiWeb.*;
import flash.display.*;
import flash.text.*;
import com.HazmiWeb.Paths.*;
public class LevelCompleteScreen extends Sprite {
private var _game:Game;
private var _levelDetailText:TextField;
private var _level:Level;
private var _levelNamePath:DisplayObjectPath;
private var _ticks:int;// = 0
private var _main:Main;
private var _levelDetailPath:DisplayObjectPath;
private var _levelNameText:TextField;
public function LevelCompleteScreen(_arg1:Main, _arg2:Level, _arg3:Game){
_main = _arg1;
_level = _arg2;
_game = _arg3;
initlevelName(_arg2.level);
initlevelDetail(_arg2.jumpers, _arg2.height);
}
public function tick(_arg1:Number):void{
if (((_levelDetailPath.setPos(_levelDetailText, _ticks)) || (_levelNamePath.setPos(_levelNameText, _ticks)))){
_main.nextLevel(_game.score.score);
} else {
_ticks++;
};
}
private function initlevelDetail(_arg1:int, _arg2:Number):void{
_levelDetailText = new TextField();
_levelDetailText.x = 2000;
GameFont.setTextFieldStyle2(_levelDetailText, 24, TextFormatAlign.CENTER);
var _local3:int = (_game.finalChute.altitude / 5);
_levelDetailText.text = (("Height Bonus: " + String(_local3)) + " Points");
_game.score.addScore(_local3);
this.addChild(_levelDetailText);
_levelDetailPath = new DisplayObjectPath();
var _local4:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_levelDetailPath.addWait(10);
_local4.easeTypePos = Ease.EaseQuintic;
_local4.easeDirectionPos = Ease.EaseOut;
_local4.startX = (640 + _levelDetailText.width);
_local4.startY = 320;
_local4.endX = (320 - (_levelDetailText.width / 2));
_local4.endY = _local4.startY;
_local4.ticks = 25;
_local4.generatePathTo(_levelDetailPath);
_levelDetailPath.addWait(40);
_local4.easeTypePos = Ease.EaseQuintic;
_local4.easeDirectionPos = Ease.EaseIn;
_local4.startX = _local4.endX;
_local4.startY = _local4.startY;
_local4.endX = -(_levelDetailText.width);
_local4.endY = _local4.startY;
_local4.ticks = 30;
_local4.generatePathTo(_levelDetailPath);
_levelNamePath.addWait(40);
}
private function initlevelName(_arg1:int):void{
_levelNameText = new TextField();
_levelNameText.x = 2000;
GameFont.setTextFieldStyle1(_levelNameText, 54, TextFormatAlign.CENTER);
_levelNameText.text = "Round Complete";
this.addChild(_levelNameText);
_levelNamePath = new DisplayObjectPath();
var _local2:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_levelNamePath.addWait(10);
_local2.easeTypePos = Ease.EaseQuintic;
_local2.easeDirectionPos = Ease.EaseOut;
_local2.startX = -(_levelNameText.width);
_local2.startY = 180;
_local2.endX = (320 - (_levelNameText.width / 2));
_local2.endY = _local2.startY;
_local2.ticks = 25;
_local2.generatePathTo(_levelNamePath);
_levelNamePath.addWait(40);
_local2.easeTypePos = Ease.EaseQuintic;
_local2.easeDirectionPos = Ease.EaseIn;
_local2.startX = _local2.endX;
_local2.startY = _local2.startY;
_local2.endX = (640 + _levelNameText.width);
_local2.endY = _local2.startY;
_local2.ticks = 30;
_local2.generatePathTo(_levelNamePath);
_levelNamePath.addWait(40);
}
}
}//package
Section 145
//Levels (Levels)
package {
public class Levels {
public var formations:Array;
public var levels:Array;
public function Levels():void{
levels = new Array();
formations = new Array();
super();
createLevels();
}
private function createLevels():void{
var _local3:Level;
var _local4:String;
var _local5:String;
var _local6:String;
var _local7:Array;
var _local8:int;
var _local9:String;
var _local10:Number;
var _local11:Number;
var _local12:Array;
var _local13:Array;
var _local14:int;
var _local15:String;
var _local16:int;
createFormations();
var _local1:Array = Assets.getStringAsset("map").split("\r\n");
var _local2:int;
while (_local2 < (_local1.length - 1)) {
_local4 = _local1[_local2];
_local5 = "";
_local6 = "";
if (_local4.split(":").length > 1){
_local5 = String(_local4.split(":")[0]).toLowerCase();
_local6 = _local4.split(":")[1];
};
if (_local4.length > 0){
switch (_local5){
case "level":
_local3 = new Level();
_local3.level = int(_local6);
break;
case "sky":
_local3.sky = int(_local6);
break;
case "height":
_local3.height = Number(_local6);
break;
case "formations":
_local3.formationId = _local6;
break;
};
} else {
_local7 = _local3.formationId.split(",");
_local8 = 0;
for each (_local9 in _local7) {
_local12 = (formations[_local9] as Array);
_local13 = new Array();
_local14 = (_local12.length - 1);
while (_local14 >= 0) {
_local15 = _local12[_local14];
_local13.push(_local15);
_local16 = 0;
while (_local16 < _local15.length) {
switch (_local15.charAt(_local16)){
case "1":
_local3.jumpers++;
break;
case "2":
case "3":
case "4":
_local8++;
break;
};
_local16++;
};
_local14--;
};
_local3.formation.push(_local13);
};
_local10 = ((45 - _local3.level) * 10);
_local11 = 7000;
_local3.height = (_local3.height + ((_local11 - (_local3.level * (_local11 / 40))) + 1000));
_local3.stars = ((_local3.level / 40) * 6);
levels[_local3.level] = _local3;
};
_local2++;
};
}
private function createFormations():void{
var _local4:String;
var _local5:Array;
var _local1:Array = Assets.getStringAsset("formations").split("\r\n");
var _local2 = 1;
var _local3 = "";
while (_local2 < _local1.length) {
_local4 = _local1[_local2];
if (_local4.length > 0){
if (_local3 == ""){
_local3 = _local4;
_local5 = new Array();
} else {
_local5.push(_local4);
};
} else {
formations[_local3] = _local5;
_local3 = "";
};
_local2++;
};
}
}
}//package
Section 146
//LevelStartScreen (LevelStartScreen)
package {
import com.HazmiWeb.*;
import flash.display.*;
import flash.text.*;
import com.HazmiWeb.Paths.*;
public class LevelStartScreen extends Sprite {
private var _levelDetailText:TextField;
private var _level:Level;
private var _starsPath:DisplayObjectPath;
private var _onFinish:Function;
private var _levelNamePath:DisplayObjectPath;
private var _ticks:int;// = 0
private var _game:Game;
private var _levelDetailPath:DisplayObjectPath;
private var _levelNameText:TextField;
public function LevelStartScreen(_arg1:Game, _arg2:Level, _arg3:Function){
_game = _arg1;
_level = _arg2;
_onFinish = _arg3;
initlevelName(_arg2.level);
initlevelDetail(_arg2.jumpers, _arg2.height);
initStars();
}
private function initStars():void{
var _local1:Sprite;
var _local5:Bitmap;
_local1 = new Sprite();
var _local2:int = _level.stars;
var _local3:int;
while (_local3 < 5) {
if (_local2 > 0){
_local5 = new Bitmap(Assets.getBitmapDataAsset("staron"), "auto", true);
_local2--;
} else {
_local5 = new Bitmap(Assets.getBitmapDataAsset("staroff"), "auto", true);
};
_local1.addChild(_local5);
_local5.x = (_local3 * 35);
_local3++;
};
this.addChild(_local1);
_local1.y = -200;
_starsPath = new DisplayObjectPath();
var _local4:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_starsPath.addWait(20);
_local4.easeTypePos = Ease.EaseQuintic;
_local4.easeDirectionPos = Ease.EaseOut;
_local4.startX = (320 - (_local1.width / 2));
_local4.startY = 500;
_local4.endX = _local4.startX;
_local4.endY = 340;
_local4.ticks = 20;
_local4.generatePathTo(_starsPath);
_starsPath.addWait(40);
_local4.easeTypePos = Ease.EaseQuintic;
_local4.easeDirectionPos = Ease.EaseIn;
_local4.startX = _local4.endX;
_local4.startY = _local4.endY;
_local4.endX = _local4.startX;
_local4.endY = 500;
_local4.ticks = 20;
_local4.generatePathTo(_starsPath);
_starsPath.addWait(40);
_starsPath.target = _local1;
}
public function tick(_arg1:Number):void{
_starsPath.setPos(null, _ticks);
if (((_levelDetailPath.setPos(_levelDetailText, _ticks)) || (_levelNamePath.setPos(_levelNameText, _ticks)))){
_game.setMainLoop(_onFinish);
} else {
_ticks++;
};
}
private function initlevelDetail(_arg1:int, _arg2:Number):void{
_levelDetailText = new TextField();
_levelDetailText.x = 2000;
GameFont.setTextFieldStyle2(_levelDetailText, 24, TextFormatAlign.CENTER);
_levelDetailText.text = (((("Chutes: " + _arg1) + " Height: ") + _arg2) + " ft");
this.addChild(_levelDetailText);
_levelDetailPath = new DisplayObjectPath();
var _local3:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_levelDetailPath.addWait(20);
_local3.easeTypePos = Ease.EaseQuintic;
_local3.easeDirectionPos = Ease.EaseOut;
_local3.startX = (640 + _levelDetailText.width);
_local3.startY = 300;
_local3.endX = (320 - (_levelDetailText.width / 2));
_local3.endY = _local3.startY;
_local3.ticks = 40;
_local3.generatePathTo(_levelDetailPath);
_levelDetailPath.addWait(40);
_local3.easeTypePos = Ease.EaseQuintic;
_local3.easeDirectionPos = Ease.EaseIn;
_local3.startX = _local3.endX;
_local3.startY = _local3.startY;
_local3.endX = -(_levelDetailText.width);
_local3.endY = _local3.startY;
_local3.ticks = 30;
_local3.generatePathTo(_levelDetailPath);
_levelNamePath.addWait(40);
}
private function initlevelName(_arg1:int):void{
_levelNameText = new TextField();
_levelNameText.x = 2000;
GameFont.setTextFieldStyle1(_levelNameText, 54, TextFormatAlign.CENTER);
_levelNameText.text = ("Round " + _arg1);
this.addChild(_levelNameText);
_levelNamePath = new DisplayObjectPath();
var _local2:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_levelNamePath.addWait(20);
_local2.easeTypePos = Ease.EaseQuintic;
_local2.easeDirectionPos = Ease.EaseOut;
_local2.startX = -(_levelNameText.width);
_local2.startY = 220;
_local2.endX = (320 - (_levelNameText.width / 2));
_local2.endY = _local2.startY;
_local2.ticks = 40;
_local2.generatePathTo(_levelNamePath);
_levelNamePath.addWait(40);
_local2.easeTypePos = Ease.EaseQuintic;
_local2.easeDirectionPos = Ease.EaseIn;
_local2.startX = _local2.endX;
_local2.startY = _local2.startY;
_local2.endX = (640 + _levelNameText.width);
_local2.endY = _local2.startY;
_local2.ticks = 30;
_local2.generatePathTo(_levelNamePath);
_levelNamePath.addWait(40);
}
}
}//package
Section 147
//Main (Main)
package {
import flash.events.*;
import com.HazmiWeb.events.*;
import com.HazmiWeb.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import com.gskinner.utils.*;
public class Main extends Sprite {
private var _applicationState:String;// = ""
private var _formations:URLLoader;
public var firstPlay:Boolean;// = true
private var _level:int;// = 0
private var oldMovie:MovieClip;
private var _menuJump:String;// = ""
private var _levels:Levels;
private var _game:Game;
private var _inited:Boolean;// = false
private var asBridge:SWFBridgeAS3;
private var _sponsorShown:Boolean;// = false
private var _chooseLevel:ChooseLevel;
private var _maps:URLLoader;
private var _currentScore:int;
public function Main(){
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
Assets.initSounds();
}
private function onFormationsLoaded(_arg1:Event):void{
trace("formations loaded");
Assets.setStringAsset("formations", _formations.data);
init();
}
private function sendHeight(_arg1:Level):void{
var _local2:URLVariables = new URLVariables();
_local2.level = _arg1.level;
_local2.height = _arg1.height;
var _local3:URLRequest = new URLRequest("http://www.hazmiweb.com/ChuteAcademy/test.php");
var _local4:URLLoader = new URLLoader();
_local4.dataFormat = URLLoaderDataFormat.TEXT;
_local3.data = _local2;
_local3.method = URLRequestMethod.GET;
_local4.load(_local3);
}
private function onLevelSelect(_arg1:ParameterEvent):void{
trace("onLevelSelect");
_level = int(_arg1.params);
trace(_level);
applicationState = "game";
}
private function init():void{
_inited = true;
_levels = new Levels();
stage.showDefaultContextMenu = false;
stage.stageFocusRect = false;
oldMovie = (this.addChild(new MovieClip()) as MovieClip);
(oldMovie.addChild(new Assets.intro_swf()) as MovieClip);
var _local1:Bitmap = (oldMovie.addChild(new Bitmap(new BitmapData(640, 480, true, 0))) as Bitmap);
trace("renew asBridge");
asBridge = new SWFBridgeAS3("menuChute", this);
asBridge.addEventListener(Event.CONNECT, onConnected, false, 0, true);
}
public function set applicationState(_arg1:String):void{
var _local3:Level;
var _local2:FlipScreen = getFlip();
switch (_applicationState){
case "menu":
_level = 0;
_currentScore = 0;
asBridge.send("jumpToMenu", "hide");
break;
case "game":
_game.dispose();
_game = null;
break;
case "levelSelect":
_chooseLevel.dispose();
_chooseLevel = null;
break;
};
_applicationState = _arg1;
switch (_applicationState){
case "menu":
oldMovie.visible = true;
this.setChildIndex(oldMovie, (this.numChildren - 1));
stage.focus = oldMovie;
if (!_sponsorShown){
_sponsorShown = true;
asBridge.send("jumpToMenu", "intro");
} else {
asBridge.send("jumpToMenu", "menu");
};
break;
case "game":
_local3 = _levels.levels[_level];
_game = new Game(this, _local3, _local2, _currentScore);
this.addChild(_local2);
(this.addChildAt(_game, (numChildren - 1)) as Game);
stage.focus = _game;
break;
case "levelSelect":
_chooseLevel = new ChooseLevel(_local2);
_chooseLevel.addEventListener(ParameterEvent.CLICK, onLevelSelect, false, 0, true);
this.addChild(_local2);
(this.addChildAt(_chooseLevel, (numChildren - 1)) as ChooseLevel);
stage.focus = _chooseLevel;
break;
};
}
public function onSwfBridgeGame():void{
applicationState = "levelSelect";
}
public function nextLevel(_arg1:int):void{
_level++;
var _local2:SharedObject = SharedObject.getLocal("chuteacademy");
if (int(_local2.data.level) < _level){
_local2.data.level = _level;
_local2.flush();
};
_local2.close();
_currentScore = _arg1;
applicationState = "game";
}
public function get applicationState():String{
return (_applicationState);
}
private function onAddedToStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
init();
}
private function onConnected(_arg1:Event):void{
trace("onConnected");
applicationState = "menu";
}
private function onMapLoaded(_arg1:Event):void{
trace("map loaded");
Assets.setStringAsset("map", _maps.data);
init();
}
private function getFlip():FlipScreen{
var _local1:FlipScreen = new FlipScreen();
_local1.setScreen1(this.stage);
return (_local1);
}
}
}//package
Section 148
//Medal (Medal)
package {
import flash.events.*;
import flash.display.*;
import com.urbansquall.serenity.*;
public class Medal extends Sprite implements IEntity {
private var _body:Bitmap;
private var _depth:Number;// = 1
private var _altitude:Number;
private var _wiggle:Number;
private var _game:Game;
private var _distance:Number;
private var _type:String;
private var _maxFallSpeed:Number;
private var _targetX:Number;// = 0
private var _ttj:Number;
private var m_id:String;
public var speedX:Number;// = 0
public var speedY:Number;// = -6
private var _wiggleOffset:Number;
public function Medal(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number){
_wiggle = (Math.random() * 10);
_wiggleOffset = (Math.random() * 1000);
super();
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_altitude = _arg2;
_targetX = _arg4;
_ttj = _arg3;
this.visible = false;
addEventListener(MouseEvent.MOUSE_DOWN, onClick, false, 0, true);
_body = new Bitmap(Assets.getBitmapDataAsset("medal"), "auto", true);
_body.x = (-(_body.width) / 2);
_body.y = (-(_body.height) / 2);
_body.smoothing = true;
this.addChild(_body);
_type = "medal";
_maxFallSpeed = -25;
}
public function get depth():Number{
return (_depth);
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function set distance(_arg1:Number):void{
_distance = _arg1;
}
public function get type():String{
return (_type);
}
public function get altitude():Number{
return (_altitude);
}
public function tick(_arg1:Number):void{
if (_ttj >= 0){
if (_ttj > 0){
_ttj = (_ttj - (_arg1 / 33));
return;
};
this.visible = true;
};
x = (x - ((((x - _targetX) + (Math.cos((_altitude / 100)) * 250)) / 20) * (_arg1 / 33)));
if (speedY > _maxFallSpeed){
speedY = (speedY - (0.2 * (_arg1 / 33)));
};
_altitude = (_altitude + (speedY * (_arg1 / 33)));
}
public function dispose():void{
}
public function get id():String{
return (m_id);
}
private function onClick(_arg1:MouseEvent):void{
removeEventListener(MouseEvent.MOUSE_DOWN, onClick);
_game.makeParticles(altitude, x);
_game.soundmanager.playSound("bonus", 1, 0, 0);
_game.openAllBonus();
parent.removeChild(this);
_game.entityContainer.removeEntity(this);
delete ??getglobalscope
[this];
}
public function get distance():Number{
return (_distance);
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
}
}//package
Section 149
//Particle (Particle)
package {
import flash.display.*;
import flash.geom.*;
import com.urbansquall.serenity.*;
public class Particle extends Bitmap implements IEntity {
private var _speedYFactor:Number;
private var _altitude:Number;
private var _depth:Number;// = 1
private var _rotationFactor:Number;
private var _alphaFactor:Number;
private var _speedX:Number;// = 0
private var _game:Game;
private var _type:String;
private var _scalefactor:Number;
private var _ttl:int;
private var _speedY:Number;// = 0
private var m_id:String;
private var _speedXFactor:Number;
public function Particle(_arg1:Game, _arg2:Point, _arg3:int, _arg4:Number, _arg5:Number, _arg6:Number=1, _arg7:Number=1, _arg8:Number=1, _arg9:Number=0, _arg10:Number=0, _arg11:Boolean=false){
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_speedX = _arg4;
_speedY = _arg5;
_scalefactor = _arg6;
_speedXFactor = _arg7;
_speedYFactor = _arg8;
_rotationFactor = _arg9;
_alphaFactor = _arg10;
_ttl = _arg3;
this.bitmapData = Assets.getBitmapDataAsset("star");
smoothing = _arg11;
this.x = (_arg2.x - (this.width / 2));
_altitude = (_arg2.y - (this.height / 2));
}
public function get depth():Number{
return (_depth);
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function get type():String{
return (_type);
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function get id():String{
return (m_id);
}
public function tick(_arg1:Number):void{
this.x = (this.x + _speedX);
_altitude = (_altitude + _speedY);
rotation = (rotation + _rotationFactor);
alpha = (alpha + _alphaFactor);
_speedX = (_speedX * _speedXFactor);
_speedY = (_speedY * _speedYFactor);
scaleX = (scaleY = (scaleY * _scalefactor));
_ttl--;
if (_ttl <= 0){
_game.entityContainer.removeEntity(this);
this.parent.removeChild(this);
delete ??getglobalscope
[this];
};
}
public function dispose():void{
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
public function get altitude():Number{
return (_altitude);
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
}
}//package
Section 150
//Plane (Plane)
package {
import flash.display.*;
import com.urbansquall.serenity.*;
import com.HazmiWeb.BitmapAnimation.*;
public class Plane extends Sprite implements IEntity {
private var _body:AnimationController;
private var _depth:Number;// = 1
private var _propellor:AnimationController;
private var _hatch:AnimationController;
private var _altitude:Number;
private var _game:Game;
private var _type:String;
private var m_id:String;
private var _totalTicks:int;// = 0
public var speedX:Number;// = 6
public var speedY:Number;// = 0
public function Plane(_arg1:Game, _arg2:Number){
_body = new AnimationController();
_propellor = new AnimationController();
_hatch = new AnimationController();
super();
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_altitude = _arg2;
_type = "plane";
_body.initAnimation(_game.animationData.getAnimation("plane"), "flying");
this.addChild(_body);
_propellor.initAnimation(_game.animationData.getAnimation("propellor"), "on");
this.addChild(_propellor);
_propellor.x = 277;
_propellor.y = 28;
_hatch.initAnimation(_game.animationData.getAnimation("hatch"), "closed");
this.addChild(_hatch);
_hatch.x = 163;
_hatch.y = 164;
_game.soundmanager.playSound("plane", 1, 0, 5000);
}
public function get depth():Number{
return (_depth);
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function get type():String{
return (_type);
}
public function openHatch():void{
_hatch.state = "open";
}
public function get id():String{
return (m_id);
}
public function tick(_arg1:Number):void{
_totalTicks++;
if (speedX > 0){
speedX = (speedX - 0.045);
_altitude = (_altitude - 0.5);
} else {
speedX = 0;
};
x = (x + speedX);
_propellor.updateAnimation(_arg1);
_hatch.updateAnimation(_arg1);
if (_totalTicks == 70){
openHatch();
};
}
public function dispose():void{
}
public function get altitude():Number{
return (_altitude);
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
}
}//package
Section 151
//Santa (Santa)
package {
import flash.events.*;
import flash.display.*;
import com.urbansquall.serenity.*;
public class Santa extends Sprite implements IEntity {
private var _body:Bitmap;
private var _depth:Number;// = 1
private var _altitude:Number;
private var _wiggle:Number;
private var _game:Game;
private var _distance:Number;
private var _type:String;
private var _maxFallSpeed:Number;
private var _targetX:Number;// = 0
private var _ttj:Number;
private var m_id:String;
public var speedX:Number;// = 0
private var _musicPlaying:Boolean;// = false
public var speedY:Number;// = -6
private var _wiggleOffset:Number;
public function Santa(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number){
_wiggle = (Math.random() * 10);
_wiggleOffset = (Math.random() * 1000);
super();
_game = _arg1;
m_id = SimpleIDCounter.calculateNextID();
_altitude = _arg2;
_targetX = _arg4;
_ttj = _arg3;
this.visible = false;
addEventListener(MouseEvent.MOUSE_DOWN, onClick, false, 0, true);
_body = new Bitmap(Assets.getBitmapDataAsset("santa"), "auto", true);
_body.x = (-(_body.width) / 2);
_body.y = (-(_body.height) / 2);
_body.smoothing = true;
this.addChild(_body);
_type = "medal";
_maxFallSpeed = -25;
_game.soundmanager.playSound("santa", 1, 0, 999999);
_game.soundmanager.pauseSound("santa");
_musicPlaying = false;
}
public function get depth():Number{
return (_depth);
}
public function set depth(_arg1:Number):void{
_depth = _arg1;
}
public function set altitude(_arg1:Number):void{
_altitude = _arg1;
}
public function set distance(_arg1:Number):void{
_distance = _arg1;
}
public function get type():String{
return (_type);
}
public function get altitude():Number{
return (_altitude);
}
public function tick(_arg1:Number):void{
if (_ttj >= 0){
if (_ttj > 0){
_ttj = (_ttj - (_arg1 / 33));
return;
};
this.visible = true;
};
if ((((y > 20)) && ((y < 460)))){
if (!_musicPlaying){
_musicPlaying = true;
_game.soundmanager.playSound("santa");
};
} else {
if (_musicPlaying){
_musicPlaying = false;
_game.soundmanager.pauseSound("santa");
};
};
x = (x - ((((x - _targetX) + (Math.cos((_altitude / 100)) * 30)) / 40) * (_arg1 / 33)));
if (speedY > _maxFallSpeed){
speedY = (speedY - (0.2 * (_arg1 / 33)));
};
_altitude = (_altitude + (speedY * (_arg1 / 33)));
}
public function dispose():void{
}
public function get id():String{
return (m_id);
}
private function onClick(_arg1:MouseEvent):void{
removeEventListener(MouseEvent.MOUSE_DOWN, onClick);
_game.makeParticles(altitude, x);
_game.soundmanager.stopSound("santa");
_game.soundmanager.playSound("bonus", 1, 0, 0);
_game.openAllBonus();
parent.removeChild(this);
_game.entityContainer.removeEntity(this);
delete ??getglobalscope
[this];
}
public function get distance():Number{
return (_distance);
}
public function set realY(_arg1:Number):void{
y = _arg1;
}
override public function toString():String{
return ((("<Entity:" + id) + ">"));
}
}
}//package
Section 152
//Score (Score)
package {
import flash.display.*;
import flash.text.*;
public class Score extends Sprite {
private var scoreLabel:Bitmap;
private var _score2:int;// = 0
private var _score1:Number;// = 0
private var scoreValue:TextField;
public function Score(_arg1:int=0){
scoreLabel = (this.addChild(new Bitmap(Assets.getBitmapDataAsset("points"), "auto", true)) as Bitmap);
scoreValue = (this.addChild(new TextField()) as TextField);
GameFont.setTextFieldStyle2(scoreValue, 20, TextFormatAlign.CENTER, TextFieldAutoSize.NONE);
scoreValue.x = 5;
scoreValue.y = 10;
scoreValue.multiline = true;
scoreValue.wordWrap = true;
scoreValue.width = 16;
scoreValue.height = (scoreLabel.height - scoreValue.y);
scoreValue.text = "29985412";
this.mouseEnabled = false;
scoreValue.mouseEnabled = false;
this.mouseChildren = false;
addScore(_arg1);
}
public function dispose():void{
parent.removeChild(this);
delete ??getglobalscope
[this];
}
public function set score(_arg1:int):void{
_score1 = int((Math.random() * _arg1));
_score2 = (_arg1 - _score1);
scoreValue.text = String(_arg1);
}
public function addScore(_arg1:int):void{
if (Math.random() > 0.5){
_score1 = (_score1 + _arg1);
} else {
_score2 = (_score2 + _arg1);
};
scoreValue.text = String(score);
}
public function get score():int{
return ((_score1 + _score2));
}
}
}//package
Section 153
//StarExplosion (StarExplosion)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.geom.*;
public class StarExplosion extends Sprite {
private var _count:int;// = 0
private var _stars:Array;
private var _timer:Timer;
public function StarExplosion(_arg1:int, _arg2:Number, _arg3:Number){
var _local5:Array;
_stars = new Array();
_timer = new Timer(20, 150);
super();
_count = _arg1;
x = _arg2;
y = _arg3;
var _local4:int;
while (_local4 < _count) {
_local5 = new Array();
_local5["bm"] = (addChild(new Bitmap(Assets.getBitmapDataAsset("star"))) as Bitmap);
_local5["pos"] = new Point(0, 0);
_local5["dir"] = new Point(((Math.random() * 20) - 10), ((Math.random() * 20) - 10));
_stars.push(_local5);
_local4++;
};
_timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete, false, 0, true);
_timer.start();
}
private function onTimer(_arg1:TimerEvent):void{
var _local2:Bitmap;
var _local3:Point;
var _local4:Point;
var _local5:int;
while (_local5 < _count) {
_local2 = _stars[_local5]["bm"];
_local3 = _stars[_local5]["pos"];
_local4 = _stars[_local5]["dir"];
_local3.x = (_local3.x + _local4.x);
_local3.y = (_local3.y + _local4.y);
_local2.x = _local3.x;
_local2.y = _local3.y;
_local4.y = (_local4.y + 0.1);
_local4.x = (_local4.x * 0.99);
_local5++;
};
}
private function onTimerComplete(_arg1:TimerEvent):void{
while (numChildren > 0) {
removeChildAt(0);
};
_timer = null;
_stars.splice(0, _stars.length);
parent.removeChild(this);
}
}
}//package
Section 154
//TopScoreList (TopScoreList)
package {
import flash.events.*;
import com.HazmiWeb.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import com.HazmiWeb.Paths.*;
public class TopScoreList extends Sprite {
private var _timer:Timer;
private var _paths:Array;
private var _scoreList:Array;
private var a_scoreList:Array;
private var _wait:int;// = 0
private var _ticks:int;// = 0
private var _yPos:Number;// = 10
public function TopScoreList(_arg1:Array){
_timer = new Timer(30);
super();
_scoreList = _arg1;
_paths = new Array();
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}
private function onAddedToStage(_arg1:Event):void{
addLine("Top Scores");
var _local2:int;
while (_local2 < 10) {
if (_scoreList[_local2] != null){
if (_scoreList[_local2]["name"] == ""){
_scoreList[_local2]["name"] = "-";
};
addLine(_scoreList[_local2]["score"], _scoreList[_local2]["name"]);
};
_local2++;
};
_timer.addEventListener(TimerEvent.TIMER, onTimer, false, 0, true);
_timer.start();
}
private function onTimer(_arg1:TimerEvent):void{
var _local3:DisplayObjectPath;
var _local2:Boolean;
for each (_local3 in _paths) {
if (!_local3.setPos(null, _ticks)){
_local2 = false;
};
};
if (_local2){
_timer.stop();
_timer = null;
dispatchEvent(new Event("READY", false, true));
};
_ticks++;
}
private function addLine(_arg1:String, _arg2:String=""):void{
var _local3:TextField;
var _local4:TextField;
var _local5:DisplayObjectPathGenerator;
var _local7:DisplayObjectPath;
_local3 = new TextField();
_local4 = new TextField();
_local5 = new DisplayObjectPathGenerator();
var _local6:DisplayObjectPathGenerator = new DisplayObjectPathGenerator();
_local7 = new DisplayObjectPath();
var _local8:DisplayObjectPath = new DisplayObjectPath();
_local3.y = 500;
_local4.y = 500;
if (_arg2 == ""){
GameFont.setTextFieldStyle1(_local3, 48, TextFormatAlign.CENTER, TextFieldAutoSize.CENTER);
_local3.x = 320;
} else {
GameFont.setTextFieldStyle2(_local3, 24, TextFormatAlign.RIGHT, TextFieldAutoSize.RIGHT);
_local3.x = 280;
GameFont.setTextFieldStyle1(_local4, 24, TextFormatAlign.LEFT, TextFieldAutoSize.LEFT);
_local4.x = 300;
_local4.text = _arg2;
this.addChild(_local4);
_local8.addWait(_wait);
_local6.easeTypePos = Ease.EaseExponential;
_local6.easeDirectionPos = Ease.EaseOut;
_local6.startX = _local4.x;
_local6.startY = _local4.y;
_local6.endX = _local4.x;
_local6.endY = _yPos;
_local6.ticks = 30;
_local6.generatePathTo(_local8);
_local8.target = _local4;
};
_local3.text = _arg1;
this.addChild(_local3);
_local7.addWait(_wait);
_local5.easeTypePos = Ease.EaseExponential;
_local5.easeDirectionPos = Ease.EaseOut;
_local5.startX = _local3.x;
_local5.startY = _local3.y;
_local5.endX = _local3.x;
_local5.endY = _yPos;
_local5.ticks = 30;
_local5.generatePathTo(_local7);
_local7.target = _local3;
_paths.push(_local7);
if (_arg2 != ""){
_paths.push(_local8);
};
if (_arg2 == ""){
_yPos = (_yPos + 70);
} else {
_yPos = (_yPos + 32);
};
_wait = (_wait + 2);
}
}
}//package
Section 155
//TopScoreLoader (TopScoreLoader)
package {
import flash.events.*;
import flash.utils.*;
import com.HazmiWeb.TopScores.*;
public class TopScoreLoader extends EventDispatcher {
public var topScoreArray:Array;
private var _timer:Timer;
private var _topScores:TopScoresArmorBot;
public var isError:Boolean;// = false
public var hasLoaded:Boolean;// = false
public function TopScoreLoader(){
_topScores = new TopScoresArmorBot();
_topScores.addEventListener("TOPLOADED", onTopLoaded, false, 0, true);
_topScores.addEventListener("TOPSENT", onTopSent, false, 0, true);
_topScores.addEventListener("ERROR", onNetworkError, false, 0, true);
_topScores.getTop();
}
public function getPosition(_arg1:int):int{
var _local4:XML;
var _local2:XML = _topScores.lastestTop;
var _local3:int;
for each (_local4 in _local2..top) {
_local3++;
if (_arg1 > int(_local4.@puntos)){
return (_local3);
};
};
if (_local2..top.length() < 10){
return (_local2..top.length());
};
return (-1);
}
public function saveScore(_arg1:String, _arg2:int):void{
var _local3:int;
if (_arg1 != ""){
_topScores.addScore(_arg1, _arg2);
_local3 = 0;
while (_local3 < 10) {
if ((((topScoreArray[_local3] == null)) || ((int(topScoreArray[_local3]["score"]) < _arg2)))){
topScoreArray.splice(_local3, 0, scoreArrayItem(_arg1, _arg2));
return;
};
_local3++;
};
};
}
private function onNetworkError(_arg1:Event):void{
isError = true;
dispatchEvent(new Event("ERROR", false, true));
}
private function scoreArrayItem(_arg1:String, _arg2:int):Array{
var _local3:Array = new Array();
_local3["name"] = _arg1;
_local3["score"] = _arg2;
return (_local3);
}
private function onTopLoaded(_arg1:Event):void{
var _local3:XML;
topScoreArray = new Array();
var _local2:XML = _topScores.lastestTop;
for each (_local3 in _local2..top) {
topScoreArray.push(scoreArrayItem(_local3.@nick, _local3.@puntos));
};
hasLoaded = true;
dispatchEvent(new Event("LOADED", false, true));
}
private function onTopSent(_arg1:Event):void{
dispatchEvent(new Event("SAVED", false, true));
}
}
}//package
Section 156
//TopScoreScreen (TopScoreScreen)
package {
import flash.events.*;
import com.HazmiWeb.events.*;
import flash.display.*;
import net.stevensacks.utils.*;
public class TopScoreScreen extends Sprite {
private var _isTopScoreError:Boolean;// = false
private var _topScoreName:String;// = ""
private var _isTopScoreLoaded:Boolean;// = false
private var _topScoreLoader:TopScoreLoader;
private var _menuButton:MovieClip;
private var _score:int;
public var isReady:Boolean;// = false
private var _topScoreList:TopScoreList;
private var _isTopScore:Boolean;// = false
private var _writeHighScoreName:WriteHighScoreName;
private var _moreGamesButton:MovieClip;
public function TopScoreScreen(_arg1:int){
_score = _arg1;
_topScoreLoader = new TopScoreLoader();
}
private function enterName():void{
_writeHighScoreName = (addChild(new WriteHighScoreName()) as WriteHighScoreName);
_writeHighScoreName.addEventListener(ParameterEvent.READY, onNameEntered, false, 0, true);
}
private function onNameEntered(_arg1:ParameterEvent):void{
var _local2:String = (_arg1.params as String);
if (_local2 == ""){
showTop();
} else {
_topScoreLoader.addEventListener("SAVED", showTop, false, 0, true);
_topScoreLoader.saveScore(_local2, _score);
};
}
private function showTop(_arg1:Event=null):void{
_topScoreList = (addChild(new TopScoreList(_topScoreLoader.topScoreArray)) as TopScoreList);
_menuButton = (addChild(new MovieClip()) as MovieClip);
(_menuButton.addChild(new Bitmap(Assets.getBitmapDataAsset("buttonmenu"), "auto", true)) as Bitmap);
_menuButton.x = ((640 - 20) - _menuButton.width);
_menuButton.y = ((480 - _menuButton.height) - 10);
_menuButton.addEventListener(MouseEvent.CLICK, onButtonMenuClick, false, 0, true);
_menuButton.buttonMode = true;
_moreGamesButton = (addChild(new MovieClip()) as MovieClip);
(_moreGamesButton.addChild(new Bitmap(Assets.getBitmapDataAsset("buttonmoregames"), "auto", true)) as Bitmap);
_moreGamesButton.x = 20;
_moreGamesButton.y = ((480 - _moreGamesButton.height) - 10);
_moreGamesButton.addEventListener(MouseEvent.CLICK, on_MoreGamesButtonClick, false, 0, true);
_moreGamesButton.buttonMode = true;
}
private function onTopLoaded(_arg1:Event=null):void{
if ((((_score > 0)) && (!((_topScoreLoader.getPosition(_score) == -1))))){
enterName();
} else {
showTop();
};
}
public function start():void{
if (_topScoreLoader.isError){
onNetworkError();
} else {
_topScoreLoader.addEventListener("ERROR", onNetworkError, false, 0, true);
};
if (_topScoreLoader.hasLoaded){
onTopLoaded();
} else {
_topScoreLoader.addEventListener("LOADED", onTopLoaded, false, 0, true);
};
}
private function on_MoreGamesButtonClick(_arg1:MouseEvent):void{
Web.getURL("http://armorgames.com", "_blank");
}
private function onButtonMenuClick(_arg1:MouseEvent):void{
isReady = true;
}
private function onNetworkError(_arg1:Event=null):void{
}
}
}//package
Section 157
//WriteHighScoreName (WriteHighScoreName)
package {
import flash.events.*;
import com.HazmiWeb.events.*;
import flash.display.*;
import com.reintroducing.sound.*;
import flash.text.*;
import com.HazmiWeb.floatingchars.*;
public class WriteHighScoreName extends Sprite {
private var _nameField:TextField;
private var _floatingChars:FloatingChars;
public function WriteHighScoreName(){
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}
private function onAddedToStage(_arg1:Event):void{
_floatingChars = (addChild(new FloatingChars(460, 300)) as FloatingChars);
_floatingChars.x = 90;
_floatingChars.y = 50;
_floatingChars.chars = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "_", "-", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "DEL", "END");
_floatingChars.addEventListener(ParameterEvent.CLICK, onCharClick, false, 0, true);
_nameField = (addChild(new TextField()) as TextField);
GameFont.setTextFieldStyle1(_nameField, 46, TextFormatAlign.CENTER, TextFieldAutoSize.NONE);
_nameField.width = 640;
_nameField.x = 320;
_nameField.y = 360;
_nameField.text = "";
}
public function get topScoreName():String{
return (_nameField.text);
}
private function onCharClick(_arg1:ParameterEvent):void{
var _local2:FloatingChar = (_arg1.params as FloatingChar);
var _local3:String = _local2.text;
SoundManager.getInstance().playSound("peew");
switch (_local3){
case "END":
removeChild(_nameField);
_floatingChars.hideAll();
dispatchEvent(new ParameterEvent(ParameterEvent.READY, _nameField.text, false, true));
return;
case "DEL":
if (topScoreName.length == 0){
return;
};
topScoreName = topScoreName.substr(0, (topScoreName.length - 1));
_local3 = "";
break;
case "_":
_local3 = " ";
break;
};
addChild(new StarExplosion(25, (_local2.x + _floatingChars.x), (_local2.y + _floatingChars.y)));
if (topScoreName.length < 14){
topScoreName = (topScoreName + _local3);
};
}
public function set topScoreName(_arg1:String):void{
_nameField.text = _arg1;
_nameField.x = (320 - (_nameField.width / 2));
}
}
}//package