Section 1
//Camera3D (away3d.cameras.Camera3D)
package away3d.cameras {
import flash.utils.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.core.utils.*;
public class Camera3D extends Object3D {
private var _view:Matrix3D;
public var maxblur:Number;// = 150
private var _flipY:Matrix3D;
public var zoom:Number;
private var _focus:Number;
public var doflevels:Number;// = 16
private var _aperture:Number;// = 22
private var _screenProjection:Projection;
private var _dof:Boolean;// = false
public function Camera3D(_arg1:Object=null){
_flipY = new Matrix3D();
_view = new Matrix3D();
_screenProjection = new Projection();
super(_arg1);
zoom = ini.getNumber("zoom", 10);
focus = ini.getNumber("focus", 100);
aperture = ini.getNumber("aperture", 22);
maxblur = ini.getNumber("maxblur", 150);
doflevels = ini.getNumber("doflevels", 16);
dof = ini.getBoolean("dof", false);
var _local2:Number3D = ini.getPosition("lookat");
_flipY.syy = -1;
if (_local2 != null){
lookAt(_local2);
};
}
public function disableDof():void{
DofCache.resetDof(false);
}
public function get aperture():Number{
return (_aperture);
}
public function get focus():Number{
return (_focus);
}
public function pan(_arg1:Number):void{
super.yaw(_arg1);
}
public function set aperture(_arg1:Number):void{
_aperture = _arg1;
DofCache.aperture = _aperture;
}
override public function clone(_arg1=null){
var _local2:Camera3D = ((_arg1) || (new Camera3D()));
super.clone(_local2);
_local2.zoom = zoom;
_local2.focus = focus;
return (_local2);
}
public function get view():Matrix3D{
viewTransform.multiply(sceneTransform, _flipY);
_view.inverse(viewTransform);
return (_view);
}
public function screen(_arg1:Object3D, _arg2:Vertex=null):ScreenVertex{
if (_arg2 == null){
_arg2 = new Vertex(0, 0, 0);
};
_arg1.viewTransform.multiply(view, _arg1.sceneTransform);
_screenProjection.view = _arg1.viewTransform;
_screenProjection.focus = focus;
_screenProjection.zoom = zoom;
_screenProjection.time = getTimer();
return (_arg2.project(_screenProjection));
}
public function set focus(_arg1:Number):void{
_focus = _arg1;
DofCache.focus = _focus;
}
public function set dof(_arg1:Boolean):void{
_dof = _arg1;
if (_dof){
enableDof();
} else {
disableDof();
};
}
public function get dof():Boolean{
return (_dof);
}
public function tilt(_arg1:Number):void{
super.pitch(_arg1);
}
public function enableDof():void{
DofCache.doflevels = doflevels;
DofCache.aperture = aperture;
DofCache.maxblur = maxblur;
DofCache.focus = focus;
DofCache.resetDof(true);
}
}
}//package away3d.cameras
Section 2
//ILODObject (away3d.containers.ILODObject)
package away3d.containers {
public interface ILODObject {
function matchLOD(_arg1:View3D):Boolean;
}
}//package away3d.containers
Section 3
//IPhysicsScene (away3d.containers.IPhysicsScene)
package away3d.containers {
public interface IPhysicsScene {
function updateTime(_arg1:int):void;
}
}//package away3d.containers
Section 4
//ObjectContainer3D (away3d.containers.ObjectContainer3D)
package away3d.containers {
import away3d.core.draw.*;
import away3d.events.*;
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.core.traverse.*;
public class ObjectContainer3D extends Object3D implements IPrimitiveProvider {
private var _maxXChild:Object3D;// = null
private var _minYChild:Object3D;// = null
private var _needNotifyDimensionsChange:Boolean;// = false
private var _needNotifyRadiusChange:Boolean;// = false
private var _radiusDirty:Boolean;// = false
private var _minX:Number;// = INF
private var _minZ:Number;// = INF
private var _maxYChild:Object3D;// = null
private var _minXDirty:Boolean;// = false
private var _radius:Number;// = 0
private var _minZChild:Object3D;// = null
private var _minY:Number;// = INF
private var _maxXDirty:Boolean;// = false
private var _maxZChild:Object3D;// = null
private var _minYDirty:Boolean;// = false
private var _maxX:Number;
private var _maxY:Number;
private var _maxZ:Number;
private var _children:Array;
private var _maxYDirty:Boolean;// = false
private var _radiusChild:Object3D;// = null
private var _minZDirty:Boolean;// = false
private var _minXChild:Object3D;// = null
private var _maxZDirty:Boolean;// = false
public function ObjectContainer3D(_arg1:Object=null, ... _args){
var _local3:Object3D;
_children = new Array();
_maxX = -(Infinity);
_maxY = -(Infinity);
_maxZ = -(Infinity);
if (((!((_arg1 == null))) && ((_arg1 is Object3D)))){
addChild((_arg1 as Object3D));
_arg1 = null;
};
super(_arg1);
for each (_local3 in _args) {
addChild(_local3);
};
}
private function launchNotifies():void{
if (_needNotifyRadiusChange){
_needNotifyRadiusChange = false;
notifyRadiusChange();
};
if (_needNotifyDimensionsChange){
_needNotifyDimensionsChange = false;
notifyDimensionsChange();
};
}
public function addChild(_arg1:Object3D):void{
if (_arg1 == null){
throw (new Error("ObjectContainer3D.addChild(null)"));
};
if (_arg1.parent == this){
return;
};
_arg1.parent = this;
}
public function removeChild(_arg1:Object3D):void{
if (_arg1 == null){
throw (new Error("ObjectContainer3D.removeChild(null)"));
};
if (_arg1.parent != this){
return;
};
_arg1.parent = null;
}
public function getChildByName(_arg1:String):Object3D{
var _local2:Object3D;
for each (_local2 in children) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
private function onChildChange(_arg1:Object3DEvent):void{
var _local2:Object3D = _arg1.object;
forgetChild(_local2);
rememberChild(_local2);
launchNotifies();
}
private function rememberChild(_arg1:Object3D):void{
var _local2:Number = _arg1.parentradius;
if (_local2 > _radius){
_radius = _local2;
_radiusChild = _arg1;
_radiusDirty = false;
_needNotifyRadiusChange = true;
};
var _local3:Number = _arg1.parentmaxX;
if (_local3 > _maxX){
_maxX = _local3;
_maxXChild = _arg1;
_maxXDirty = false;
_needNotifyDimensionsChange = true;
};
var _local4:Number = _arg1.parentminX;
if (_local4 < _minX){
_minX = _local4;
_minXChild = _arg1;
_minXDirty = false;
_needNotifyDimensionsChange = true;
};
var _local5:Number = _arg1.parentmaxY;
if (_local5 > _maxY){
_maxY = _local5;
_maxYChild = _arg1;
_maxYDirty = false;
_needNotifyDimensionsChange = true;
};
var _local6:Number = _arg1.parentminY;
if (_local6 < _minY){
_minY = _local6;
_minYChild = _arg1;
_minYDirty = false;
_needNotifyDimensionsChange = true;
};
var _local7:Number = _arg1.parentmaxZ;
if (_local7 > _maxZ){
_maxZ = _local7;
_maxZChild = _arg1;
_maxZDirty = false;
_needNotifyDimensionsChange = true;
};
var _local8:Number = _arg1.parentminZ;
if (_local8 < _minZ){
_minZ = _local8;
_minZChild = _arg1;
_minZDirty = false;
_needNotifyDimensionsChange = true;
};
}
public function removeChildByName(_arg1:String):void{
removeChild(getChildByName(_arg1));
}
override public function get minX():Number{
var _local1:Number;
var _local2:Object3D;
var _local3:Number;
if (_minXDirty){
_minXChild = null;
_local1 = Infinity;
for each (_local2 in _children) {
_local3 = _local2.parentminX;
if (_local3 < _local1){
_local1 = _local3;
_minXChild = _local2;
};
};
_minX = _local1;
_minXDirty = false;
};
return (_minX);
}
override public function get minZ():Number{
var _local1:Number;
var _local2:Object3D;
var _local3:Number;
if (_minZDirty){
_local1 = Infinity;
_minZChild = null;
for each (_local2 in _children) {
_local3 = _local2.parentminZ;
if (_local3 < _local1){
_local1 = _local3;
_minZChild = _local2;
};
};
_minZ = _local1;
_minZDirty = false;
};
return (_minZ);
}
public function addChildren(... _args):void{
var _local2:Object3D;
for each (_local2 in _args) {
addChild(_local2);
};
}
private function forgetChild(_arg1:Object3D):void{
if (_arg1 == _radiusChild){
_radiusChild = null;
_radiusDirty = true;
_needNotifyRadiusChange = true;
};
if (_arg1 == _maxXChild){
_maxXChild = null;
_maxXDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minXChild){
_minXChild = null;
_minXDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _maxYChild){
_maxYChild = null;
_maxYDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minYChild){
_minYChild = null;
_minYDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _maxZChild){
_maxZChild = null;
_maxZDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minZChild){
_minZChild = null;
_minZDirty = true;
_needNotifyDimensionsChange = true;
};
}
function internalAddChild(_arg1:Object3D):void{
_children.push(_arg1);
_arg1.addOnTransformChange(onChildChange);
_arg1.addOnRadiusChange(onChildChange);
rememberChild(_arg1);
launchNotifies();
}
override public function scale(_arg1:Number):void{
var _local2:Object3D;
for each (_local2 in children) {
_local2.x = (_local2.x * _arg1);
_local2.y = (_local2.y * _arg1);
_local2.z = (_local2.z * _arg1);
_local2.scale(_arg1);
};
}
override public function get minY():Number{
var _local1:Number;
var _local2:Object3D;
var _local3:Number;
if (_minYDirty){
_local1 = Infinity;
_minYChild = null;
for each (_local2 in _children) {
_local3 = _local2.parentminY;
if (_local3 < _local1){
_local1 = _local3;
_minYChild = _local2;
};
};
_minY = _local1;
_minYDirty = false;
};
return (_minY);
}
override public function clone(_arg1=null){
var _local3:Object3D;
var _local2:ObjectContainer3D = ((_arg1) || (new ObjectContainer3D()));
super.clone(_local2);
for each (_local3 in children) {
_local2.addChild(_local3.clone());
};
return (_local2);
}
public function movePivot(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Object3D;
var _local5:Number3D;
for each (_local4 in _children) {
_local4.x = (_local4.x - _arg1);
_local4.y = (_local4.y - _arg2);
_local4.z = (_local4.z - _arg3);
};
_local5 = new Number3D(_arg1, _arg2, _arg3);
new Number3D(_arg1, _arg2, _arg3).rotate(_local5.clone(), _transform);
_local5.add(_local5, position);
moveTo(_local5);
}
override public function get maxX():Number{
var _local1:Number;
var _local2:Object3D;
var _local3:Number;
if (_maxXDirty){
_maxXChild = null;
_local1 = -(Infinity);
for each (_local2 in _children) {
_local3 = _local2.parentmaxX;
if (_local3 > _local1){
_local1 = _local3;
_maxXChild = _local2;
};
};
_maxX = _local1;
_maxXDirty = false;
};
return (_maxX);
}
override public function get maxY():Number{
var _local1:Number;
var _local2:Object3D;
var _local3:Number;
if (_maxYDirty){
_local1 = -(Infinity);
_maxYChild = null;
for each (_local2 in _children) {
_local3 = _local2.parentmaxY;
if (_local3 > _local1){
_local1 = _local3;
_maxYChild = _local2;
};
};
_maxY = _local1;
_maxYDirty = false;
};
return (_maxY);
}
override public function get maxZ():Number{
var _local1:Number;
var _local2:Object3D;
var _local3:Number;
if (_maxZDirty){
_local1 = -(Infinity);
_maxZChild = null;
for each (_local2 in _children) {
_local3 = _local2.parentmaxZ;
if (_local3 > _local1){
_local1 = _local3;
_maxZChild = _local2;
};
};
_maxZ = _local1;
_maxZDirty = false;
};
return (_maxZ);
}
override public function get boundingRadius():Number{
var _local1:Number;
var _local2:Object3D;
var _local3:Number;
if (_radiusDirty){
_radiusChild = null;
_local1 = 0;
for each (_local2 in _children) {
_local3 = _local2.parentradius;
if (_local3 > _local1){
_local1 = _local3;
_radiusChild = _local2;
};
};
_radius = _local1;
_radiusDirty = false;
};
return (_radius);
}
override public function traverse(_arg1:Traverser):void{
var _local2:Object3D;
if (_arg1.match(this)){
_arg1.enter(this);
_arg1.apply(this);
for each (_local2 in children) {
_local2.traverse(_arg1);
};
_arg1.leave(this);
};
}
function internalRemoveChild(_arg1:Object3D):void{
var _local2:int = children.indexOf(_arg1);
if (_local2 == -1){
return;
};
forgetChild(_arg1);
_arg1.removeOnTransformChange(onChildChange);
_arg1.removeOnRadiusChange(onChildChange);
_children.splice(_local2, 1);
launchNotifies();
}
public function get children():Array{
return (_children);
}
}
}//package away3d.containers
Section 5
//Scene3D (away3d.containers.Scene3D)
package away3d.containers {
import flash.utils.*;
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.core.traverse.*;
import away3d.core.utils.*;
public class Scene3D extends ObjectContainer3D {
public var physics:IPhysicsScene;
public var tickTraverser:TickTraverser;
public function Scene3D(_arg1:Object=null, ... _args){
var _local4:Object3D;
tickTraverser = new TickTraverser();
super();
if (((!((_arg1 == null))) && ((_arg1 is Object3D)))){
addChild((_arg1 as Object3D));
_arg1 = null;
};
ini = Init.parse(_arg1);
var _local3:Object = ini.getObject("physics");
if ((_local3 is IPhysicsScene)){
physics = (_local3 as IPhysicsScene);
};
if ((_local3 is Boolean)){
if (_local3 == true){
physics = null;
};
};
if ((_local3 is Object)){
physics = null;
};
for each (_local4 in _args) {
addChild(_local4);
};
}
override public function get sceneTransform():Matrix3D{
if (_transformDirty){
_sceneTransformDirty = true;
};
if (_sceneTransformDirty){
_sceneTransformDirty = false;
notifySceneTransformChange();
};
return (transform);
}
override public function get parent():ObjectContainer3D{
return (super.parent);
}
override public function set parent(_arg1:ObjectContainer3D):void{
if (_arg1 != null){
throw (new Error("Scene can't be parented"));
};
}
public function updateTime(_arg1:int=-1):void{
if (_arg1 == -1){
_arg1 = getTimer();
};
tickTraverser.now = _arg1;
traverse(tickTraverser);
if (physics != null){
physics.updateTime(_arg1);
};
}
}
}//package away3d.containers
Section 6
//View3D (away3d.containers.View3D)
package away3d.containers {
import flash.events.*;
import flash.display.*;
import away3d.core.render.*;
import away3d.events.*;
import away3d.core.base.*;
import away3d.cameras.*;
import away3d.materials.*;
import away3d.core.utils.*;
import away3d.core.clip.*;
import away3d.core.stats.*;
public class View3D extends Sprite {
public var statsOpen:Boolean;
public var scene:Scene3D;
public var stats:Boolean;
private var _renderer:IRenderer;
public var camera:Camera3D;
private var _ini:Init;
public var statsPanel:Stats;
public var background:Sprite;
private var _oldclip:Clipping;
public var findhit:FindHit;
private var _mousedown:Boolean;
public var clip:Clipping;
private var _defaultclip:Clipping;
public var mouseObject:Object3D;
public var sourceURL:String;
private var _session:AbstractRenderSession;
public var mouseZeroMove:Boolean;
private var _lastmove_mouseX:Number;
private var _lastmove_mouseY:Number;
public var primitives:Array;
var _interactiveLayer:Sprite;
public var hud:Sprite;
public var mouseMaterial:IUVMaterial;
public function View3D(_arg1:Object=null){
_interactiveLayer = new Sprite();
_defaultclip = new Clipping();
background = new Sprite();
hud = new Sprite();
super();
_ini = (Init.parse(_arg1) as Init);
var _local2:Boolean = _ini.getBoolean("stats", true);
scene = (((_ini.getObjectOrInit("scene", Scene3D) as Scene3D)) || (new Scene3D()));
camera = (((_ini.getObjectOrInit("camera", Camera3D) as Camera3D)) || (new Camera3D({x:0, y:0, z:1000, lookat:"center"})));
_renderer = (((_ini.getObject("renderer") as IRenderer)) || (new BasicRenderer()));
session = (((_ini.getObject("session") as AbstractRenderSession)) || (new SpriteRenderSession()));
clip = (_ini.getObject("clip", Clipping) as Clipping);
x = _ini.getNumber("x", 0);
y = _ini.getNumber("y", 0);
_interactiveLayer.blendMode = BlendMode.ALPHA;
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
if (!clip){
clip = _defaultclip;
};
if (_local2){
addEventListener(Event.ADDED_TO_STAGE, createStatsMenu);
};
}
public function fireMouseMoveEvent(_arg1:Boolean=false):void{
if (!((mouseZeroMove) || (_arg1))){
if ((((mouseX == _lastmove_mouseX)) && ((mouseY == _lastmove_mouseY)))){
return;
};
};
fireMouseEvent(MouseEvent3D.MOUSE_MOVE, mouseX, mouseY);
_lastmove_mouseX = mouseX;
_lastmove_mouseY = mouseY;
}
private function createStatsMenu(_arg1:Event):void{
statsPanel = new Stats(this, stage.frameRate);
statsOpen = false;
}
public function flush():void{
_session.flush();
clip = _oldclip;
}
public function set renderer(_arg1:IRenderer):void{
_renderer = _arg1;
_renderer.session = _session;
}
function dispatchMouseEvent(_arg1:MouseEvent3D):void{
if (!hasEventListener(_arg1.type)){
return;
};
dispatchEvent(_arg1);
}
public function removeOnMouseOut(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_OUT, _arg1, false);
}
public function get session():AbstractRenderSession{
return (_session);
}
public function addOnMouseOver(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_OVER, _arg1, false, 0, false);
}
public function render():void{
clear();
primitives = _renderer.render(this);
flush();
Init.checkUnusedArguments();
fireMouseMoveEvent();
}
private function bubbleMouseEvent(_arg1:MouseEvent3D):void{
var _local2:Object3D = _arg1.object;
while (_local2 != null) {
if (_local2.dispatchMouseEvent(_arg1)){
break;
};
_local2 = _local2.parent;
};
}
public function addOnMouseUp(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_UP, _arg1, false, 0, false);
}
public function removeOnMouseDown(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_DOWN, _arg1, false);
}
public function set session(_arg1:AbstractRenderSession):void{
_session = _arg1;
_renderer.session = _session;
while (numChildren) {
removeChildAt(0);
};
addChild(background);
addChild(_session.getContainer(this));
addChild(_interactiveLayer);
addChild(hud);
}
public function removeOnMouseUp(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_UP, _arg1, false);
}
private function onMouseUp(_arg1:MouseEvent):void{
_mousedown = false;
fireMouseEvent(MouseEvent3D.MOUSE_UP, mouseX, mouseY, _arg1.ctrlKey, _arg1.shiftKey);
}
public function get renderer():IRenderer{
return (_renderer);
}
private function onMouseDown(_arg1:MouseEvent):void{
_mousedown = true;
fireMouseEvent(MouseEvent3D.MOUSE_DOWN, mouseX, mouseY, _arg1.ctrlKey, _arg1.shiftKey);
}
private function fireMouseEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false):void{
findhit = new FindHit(this, primitives, _arg2, _arg3);
var _local6:MouseEvent3D = findhit.getMouseEvent(_arg1);
var _local7:Object3D = _local6.object;
var _local8:IUVMaterial = _local6.material;
_local6.ctrlKey = _arg4;
_local6.shiftKey = _arg5;
if (((!((_arg1 == MouseEvent3D.MOUSE_OUT))) && (!((_arg1 == MouseEvent3D.MOUSE_OVER))))){
dispatchMouseEvent(_local6);
bubbleMouseEvent(_local6);
};
if (((!((mouseObject == _local7))) || (!((mouseMaterial == _local8))))){
if (mouseObject != null){
_local6 = findhit.getMouseEvent(MouseEvent3D.MOUSE_OUT);
_local6.object = mouseObject;
_local6.material = mouseMaterial;
dispatchMouseEvent(_local6);
bubbleMouseEvent(_local6);
mouseObject = null;
buttonMode = false;
};
if (((!((_local7 == null))) && ((mouseObject == null)))){
_local6 = findhit.getMouseEvent(MouseEvent3D.MOUSE_OVER);
_local6.object = _local7;
_local6.material = (mouseMaterial = _local8);
dispatchMouseEvent(_local6);
bubbleMouseEvent(_local6);
buttonMode = _local7.useHandCursor;
};
mouseObject = _local7;
};
}
public function clear():void{
_oldclip = clip;
if (clip == _defaultclip){
clip = _defaultclip.screen(this);
};
_session.view = this;
_session.clear();
}
public function addSourceURL(_arg1:String):void{
sourceURL = _arg1;
if (statsPanel){
statsPanel.addSourceURL(_arg1);
};
}
public function removeOnMouseOver(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_OVER, _arg1, false);
}
public function removeOnMouseMove(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_MOVE, _arg1, false);
}
private function onMouseOut(_arg1:MouseEvent):void{
if (_arg1.eventPhase != EventPhase.AT_TARGET){
return;
};
fireMouseEvent(MouseEvent3D.MOUSE_OUT, mouseX, mouseY, _arg1.ctrlKey, _arg1.shiftKey);
}
public function addOnMouseOut(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_OUT, _arg1, false, 0, false);
}
public function addOnMouseMove(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_MOVE, _arg1, false, 0, false);
}
public function getBitmapData():BitmapData{
if ((_session is BitmapRenderSession)){
return ((_session as BitmapRenderSession).getBitmapData(this));
};
throw (new Error("incorrect session object - require BitmapRenderSession"));
}
public function addOnMouseDown(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_DOWN, _arg1, false, 0, false);
}
public function getContainer():DisplayObject{
return (_session.getContainer(this));
}
private function onMouseOver(_arg1:MouseEvent):void{
if (_arg1.eventPhase != EventPhase.AT_TARGET){
return;
};
fireMouseEvent(MouseEvent3D.MOUSE_OVER, mouseX, mouseY, _arg1.ctrlKey, _arg1.shiftKey);
}
}
}//package away3d.containers
Section 7
//Animation (away3d.core.base.Animation)
package away3d.core.base {
import flash.events.*;
import flash.utils.*;
import away3d.events.*;
public class Animation extends EventDispatcher implements IAnimation {
public var sequence:Array;
public var delay:Number;// = 0
public var cycleEvent:Boolean;// = false
public var sequenceEvent:Boolean;// = false
public var loop:Boolean;// = false
private var _latest:uint;// = 0
private var _cycle:AnimationEvent;
private var _sequenceupdate:AnimationEvent;
public var frame:Number;// = 0
public var smooth:Boolean;// = false
public var fps:Number;// = 24
private var _time:uint;
private var _isRunning:Boolean;// = false
public var object:BaseMesh;
public function Animation(_arg1:BaseMesh){
sequence = [];
super();
object = _arg1;
_cycle = new AnimationEvent(AnimationEvent.CYCLE, this);
_sequenceupdate = new AnimationEvent(AnimationEvent.SQUENCE_UPDATE, this);
}
public function get latest():uint{
return (_latest);
}
public function update(_arg1:BaseMesh):void{
var _local4:Number;
var _local5:Number;
if (((!(_isRunning)) && (!(sequenceEvent)))){
return;
};
var _local2:uint = getTimer();
frame = (frame + (((_local2 - _time) * fps) / 1000));
_time = _local2;
if (sequence.length == 1){
if (cycleEvent){
dispatchEvent(_cycle);
};
if (sequenceEvent){
dispatchEvent(_sequenceupdate);
};
_isRunning = false;
_latest = 0;
frame = 0;
} else {
if (((loop) && (!(sequenceEvent)))){
while (frame > ((sequence.length - 1) + delay)) {
frame = (frame - ((sequence.length - 1) + delay));
};
} else {
if (frame > ((sequence.length - 1) + delay)){
frame = ((sequence.length - 1) + delay);
if (cycleEvent){
dispatchEvent(_cycle);
};
if (sequenceEvent){
dispatchEvent(_sequenceupdate);
};
_isRunning = false;
};
};
};
var _local3:Number = frame;
if (!smooth){
_local3 = Math.round(_local3);
};
if (_local3 < 0){
_local3 = 0;
};
if (_local3 > (sequence.length - 1)){
_local3 = (sequence.length - 1);
};
if (_local3 == Math.round(_local3)){
_arg1.frames[sequence[int(_local3)].frame].adjust(1);
} else {
_local4 = Math.floor(_local3);
_local5 = Math.ceil(_local3);
_arg1.frames[sequence[int(_local4)].frame].adjust(1);
_arg1.frames[sequence[int(_local5)].frame].adjust((_local3 - _local4));
if (((loop) || (sequenceEvent))){
if ((((((_latest == 0)) || (((_latest + 1) == sequence[int(_local4)].frame)))) || ((_latest == sequence[int(_local4)].frame)))){
_latest = sequence[int(_local4)].frame;
} else {
_latest = 0;
if (cycleEvent){
dispatchEvent(_cycle);
};
if (sequenceEvent){
dispatchEvent(_sequenceupdate);
};
};
} else {
if (((((cycleEvent) || (sequenceEvent))) || ((sequence.length == 2)))){
if (cycleEvent){
dispatchEvent(_cycle);
};
if (sequenceEvent){
dispatchEvent(_sequenceupdate);
};
};
};
};
}
public function stop():void{
_isRunning = false;
_latest = 0;
}
public function start():void{
_time = getTimer();
_isRunning = true;
_latest = 0;
frame = 0;
}
public function get isRunning():Boolean{
return (_isRunning);
}
}
}//package away3d.core.base
Section 8
//AnimationFrame (away3d.core.base.AnimationFrame)
package away3d.core.base {
public class AnimationFrame {
public var frame:Number;
public var time:uint;
public var sort:String;
public function AnimationFrame(_arg1:Number, _arg2:String=null){
this.frame = _arg1;
this.sort = _arg2;
}
}
}//package away3d.core.base
Section 9
//AnimationGroup (away3d.core.base.AnimationGroup)
package away3d.core.base {
public class AnimationGroup {
public var playlist:Array;
public var loop:Boolean;
public var fps:uint;
public var loopLast:Boolean;
public function AnimationGroup(_arg1:Array=null, _arg2:Boolean=false){
this.playlist = _arg1;
this.loopLast = _arg2;
}
}
}//package away3d.core.base
Section 10
//AnimationSequence (away3d.core.base.AnimationSequence)
package away3d.core.base {
public class AnimationSequence {
public var prefix:String;
public var loop:Boolean;
public var fps:Number;
public var smooth:Boolean;
public function AnimationSequence(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Number=24){
this.prefix = _arg1;
this.smooth = _arg2;
this.loop = _arg3;
this.fps = _arg4;
}
}
}//package away3d.core.base
Section 11
//BaseMesh (away3d.core.base.BaseMesh)
package away3d.core.base {
import flash.events.*;
import flash.utils.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.events.*;
import away3d.materials.*;
import away3d.core.utils.*;
import away3d.core.*;
public class BaseMesh extends Object3D {
public var pushback:Boolean;
private var _animation:Animation;
private var _maxYElement:IMeshElement;// = null
private var _minXElement:IMeshElement;// = null
private var _needNotifyDimensionsChange:Boolean;// = false
private var _needNotifyRadiusChange:Boolean;// = false
private var _minX:Number;// = INF
private var _minY:Number;// = INF
private var _minZ:Number;// = INF
private var _maxXElement:IMeshElement;// = null
public var type:String;
private var _maxXDirty:Boolean;// = false
private var _minYDirty:Boolean;// = false
public var pushfront:Boolean;
private var _maxX:Number;
private var _maxY:Number;
private var _maxZ:Number;
private var _vertices:Array;
private var _verticesDirty:Boolean;// = true
private var _boundingRadiusDirty:Boolean;// = false
private var _dsStore:Array;
private var _frame:int;
public var url:String;
private var _boundingRadius:Number;// = 0
private var _maxZDirty:Boolean;// = false
private var _seg:DrawSegment;
private var _animationgroup:AnimationGroup;
private var _sequencedone:Event;
private var _minXDirty:Boolean;// = false
public var frames:Dictionary;
private var _boundingRadiusElement:IMeshElement;// = null
private var _dsActive:Array;
private var _minZElement:IMeshElement;// = null
private var _maxYDirty:Boolean;// = false
private var _maxZElement:IMeshElement;// = null
private var _minZDirty:Boolean;// = false
public var framenames:Dictionary;
private var _minYElement:IMeshElement;// = null
private var _activeprefix:String;
private var _cycle:Event;
public function BaseMesh(_arg1:Object=null){
_maxX = -(Infinity);
_maxY = -(Infinity);
_maxZ = -(Infinity);
_dsStore = new Array();
_dsActive = new Array();
super(_arg1);
pushback = ini.getBoolean("pushback", false);
pushfront = ini.getBoolean("pushfront", false);
}
public function removeOnSequenceDone(_arg1:Function):void{
removeEventListener(AnimationEvent.SQUENCE_DONE, _arg1, false);
}
public function get activeprefix():String{
return (_activeprefix);
}
private function rememberElementRadius(_arg1:IMeshElement):void{
var _local2:Number = _arg1.radius2;
if (_local2 > (_boundingRadius * _boundingRadius)){
_boundingRadius = Math.sqrt(_local2);
_boundingRadiusElement = _arg1;
_boundingRadiusDirty = false;
_needNotifyRadiusChange = true;
};
var _local3:Number = _arg1.maxX;
if (_local3 > _maxX){
_maxX = _local3;
_maxXElement = _arg1;
_maxXDirty = false;
_needNotifyDimensionsChange = true;
};
var _local4:Number = _arg1.minX;
if (_local4 < _minX){
_minX = _local4;
_minXElement = _arg1;
_minXDirty = false;
_needNotifyDimensionsChange = true;
};
var _local5:Number = _arg1.maxY;
if (_local5 > _maxY){
_maxY = _local5;
_maxYElement = _arg1;
_maxYDirty = false;
_needNotifyDimensionsChange = true;
};
var _local6:Number = _arg1.minY;
if (_local6 < _minY){
_minY = _local6;
_minYElement = _arg1;
_minYDirty = false;
_needNotifyDimensionsChange = true;
};
var _local7:Number = _arg1.maxZ;
if (_local7 > _maxZ){
_maxZ = _local7;
_maxZElement = _arg1;
_maxZDirty = false;
_needNotifyDimensionsChange = true;
};
var _local8:Number = _arg1.minZ;
if (_local8 < _minZ){
_minZ = _local8;
_minZElement = _arg1;
_minZDirty = false;
_needNotifyDimensionsChange = true;
};
}
protected function addElement(_arg1:IMeshElement):void{
_verticesDirty = true;
_arg1.addOnVertexChange(onElementVertexChange);
_arg1.addOnVertexValueChange(onElementVertexValueChange);
rememberElementRadius(_arg1);
launchNotifies();
}
public function removeOnCycle(_arg1:Function):void{
_animation.cycleEvent = false;
_animation.removeEventListener(AnimationEvent.CYCLE, _arg1, false);
}
private function onElementVertexChange(_arg1:MeshElementEvent):void{
var _local2:IMeshElement = _arg1.element;
forgetElementRadius(_local2);
rememberElementRadius(_local2);
_verticesDirty = true;
launchNotifies();
}
public function get isRunning():Boolean{
return (_animation.isRunning);
}
public function play(_arg1:AnimationSequence):void{
var _local2:Boolean;
var _local3:String;
if (!_animation){
_animation = new Animation(this);
} else {
_animation.sequence = new Array();
};
_animation.fps = _arg1.fps;
_animation.smooth = _arg1.smooth;
_animation.loop = _arg1.loop;
if (_arg1.prefix != null){
for (_local3 in framenames) {
if (_local3.indexOf(_arg1.prefix) == 0){
_local2 = true;
_activeprefix = ((_activeprefix)!=_arg1.prefix) ? _arg1.prefix : _activeprefix;
_animation.sequence.push(new AnimationFrame(framenames[_local3], ("" + parseInt(_local3.substring(_arg1.prefix.length)))));
};
};
if (_local2){
_animation.sequence.sortOn("sort", Array.NUMERIC);
frames[_frame].adjust(1);
_animation.start();
} else {
trace((("--------- \n--> unable to play animation: unvalid prefix [" + _arg1.prefix) + "]\n--------- "));
};
};
}
override public function get minX():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_minXDirty){
_minXElement = null;
_local1 = Infinity;
for each (_local2 in elements) {
_local3 = _local2.minX;
if (_local3 < _local1){
_local1 = _local3;
_minXElement = _local2;
};
};
_minX = _local1;
_minXDirty = false;
};
return (_minX);
}
override public function get minY():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_minYDirty){
_local1 = Infinity;
_minYElement = null;
for each (_local2 in elements) {
_local3 = _local2.minY;
if (_local3 < _local1){
_local1 = _local3;
_minYElement = _local2;
};
};
_minY = _local1;
_minYDirty = false;
};
return (_minY);
}
override public function get minZ():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_minZDirty){
_local1 = Infinity;
_minZElement = null;
for each (_local2 in elements) {
_local3 = _local2.minZ;
if (_local3 < _local1){
_local1 = _local3;
_minZElement = _local2;
};
};
_minZ = _local1;
_minZDirty = false;
};
return (_minZ);
}
public function scaleZ(_arg1:Number):void{
if (_arg1 != 1){
scaleXYZ(1, 1, _arg1);
};
}
override public function scale(_arg1:Number):void{
scaleXYZ(_arg1, _arg1, _arg1);
}
override public function get boundingRadius():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_boundingRadiusDirty){
_boundingRadiusElement = null;
_local1 = 0;
for each (_local2 in elements) {
_local3 = _local2.radius2;
if (_local3 > _local1){
_local1 = _local3;
_boundingRadiusElement = _local2;
};
};
_boundingRadius = Math.sqrt(_local1);
_boundingRadiusDirty = false;
};
return (_boundingRadius);
}
public function set loop(_arg1:Boolean):void{
_animation.loop = _arg1;
}
public function set smooth(_arg1:Boolean):void{
_animation.smooth = _arg1;
}
public function scaleY(_arg1:Number):void{
if (_arg1 != 1){
scaleXYZ(1, _arg1, 1);
};
}
public function addOnSequenceDone(_arg1:Function):void{
addEventListener(AnimationEvent.SQUENCE_DONE, _arg1, false, 0, false);
}
public function scaleX(_arg1:Number):void{
if (_arg1 != 1){
scaleXYZ(_arg1, 1, 1);
};
}
public function scaleAnimation(_arg1:Number):void{
var _local5:String;
var _local6:Frame;
var _local2:Array = new Array();
var _local3:int;
var _local4:int;
for (_local5 in framenames) {
_local2.push(_local5);
};
_local3 = 0;
while (_local3 < _local2.length) {
_local6 = frames[framenames[_local2[_local3]]];
_local4 = 0;
while (_local4 < _local6.vertexpositions.length) {
_local6.vertexpositions[_local4].x = (_local6.vertexpositions[_local4].x * _arg1);
_local6.vertexpositions[_local4].y = (_local6.vertexpositions[_local4].y * _arg1);
_local6.vertexpositions[_local4].z = (_local6.vertexpositions[_local4].z * _arg1);
_local4++;
};
_local3++;
};
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void{
super.primitives(_arg1, _arg2);
_dsStore = _dsStore.concat(_dsActive);
_dsActive = new Array();
}
public function get frame():int{
return (_animation.frame);
}
override public function get maxX():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_maxXDirty){
_maxXElement = null;
_local1 = -(Infinity);
for each (_local2 in elements) {
_local3 = _local2.maxX;
if (_local3 > _local1){
_local1 = _local3;
_maxXElement = _local2;
};
};
_maxX = _local1;
_maxXDirty = false;
};
return (_maxX);
}
override public function get maxZ():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_maxZDirty){
_local1 = -(Infinity);
_maxZElement = null;
for each (_local2 in elements) {
_local3 = _local2.maxZ;
if (_local3 > _local1){
_local1 = _local3;
_maxZElement = _local2;
};
};
_maxZ = _local1;
_maxZDirty = false;
};
return (_maxZ);
}
private function launchNotifies():void{
if (_needNotifyRadiusChange){
_needNotifyRadiusChange = false;
notifyRadiusChange();
};
if (_needNotifyDimensionsChange){
_needNotifyDimensionsChange = false;
notifyDimensionsChange();
};
}
override public function get maxY():Number{
var _local1:Number;
var _local2:IMeshElement;
var _local3:Number;
if (_maxYDirty){
_local1 = -(Infinity);
_maxYElement = null;
for each (_local2 in elements) {
_local3 = _local2.maxY;
if (_local3 > _local1){
_local1 = _local3;
_maxYElement = _local2;
};
};
_maxY = _local1;
_maxYDirty = false;
};
return (_maxY);
}
private function updatePlaySequence(_arg1:Event):void{
if (_animationgroup.playlist.length == 0){
_animation.removeEventListener(AnimationEvent.SQUENCE_UPDATE, updatePlaySequence);
_animation.sequenceEvent = false;
if (hasSequenceEvent){
if (_sequencedone == null){
_sequencedone = new Event(AnimationEvent.SQUENCE_DONE);
};
dispatchEvent(_sequencedone);
};
} else {
if (_animationgroup.playlist.length == 1){
loop = _animationgroup.loopLast;
};
play(_animationgroup.playlist.shift());
};
}
public function addOnCycle(_arg1:Function):void{
_animation.cycleEvent = true;
_cycle = new Event(AnimationEvent.CYCLE);
_animation.addEventListener(AnimationEvent.CYCLE, _arg1, false, 0, false);
}
public function get hasCycleEvent():Boolean{
return (_animation.hasEventListener(AnimationEvent.CYCLE));
}
public function gotoAndStop(_arg1:int):void{
_frame = (_animation.frame = _arg1);
if (_animation.isRunning){
_animation.stop();
};
}
private function onElementVertexValueChange(_arg1:MeshElementEvent):void{
var _local2:IMeshElement = _arg1.element;
forgetElementRadius(_local2);
rememberElementRadius(_local2);
launchNotifies();
}
override public function tick(_arg1:int):void{
if (((!((_animation == null))) && (!((frames == null))))){
_animation.update(this);
};
}
function createDrawSegment(_arg1:ISegmentMaterial, _arg2:Projection, _arg3:ScreenVertex, _arg4:ScreenVertex):DrawSegment{
if (_dsStore.length){
_dsActive.push((_seg = _dsStore.pop()));
_seg.create = createDrawSegment;
} else {
_dsActive.push((_seg = new DrawSegment()));
_seg.source = this;
_seg.create = createDrawSegment;
};
_seg.material = _arg1;
_seg.projection = _arg2;
_seg.v0 = _arg3;
_seg.v1 = _arg4;
_seg.calc();
return (_seg);
}
private function forgetElementRadius(_arg1:IMeshElement):void{
if (_arg1 == _boundingRadiusElement){
_boundingRadiusElement = null;
_boundingRadiusDirty = true;
_needNotifyRadiusChange = true;
};
if (_arg1 == _maxXElement){
_maxXElement = null;
_maxXDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minXElement){
_minXElement = null;
_minXDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _maxYElement){
_maxYElement = null;
_maxYDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minYElement){
_minYElement = null;
_minYDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _maxZElement){
_maxZElement = null;
_maxZDirty = true;
_needNotifyDimensionsChange = true;
};
if (_arg1 == _minZElement){
_minZElement = null;
_minZDirty = true;
_needNotifyDimensionsChange = true;
};
}
public function setPlaySequences(_arg1:Array, _arg2:Boolean=false):void{
if (_arg1.length == 0){
return;
};
if (!_animation){
_animation = new Animation(this);
};
_animationgroup = new AnimationGroup();
_animationgroup.loopLast = _arg2;
_animationgroup.playlist = [];
var _local3:int;
while (_local3 < _arg1.length) {
_animationgroup.playlist[_local3] = new AnimationSequence(_arg1[_local3].prefix, _arg1[_local3].smooth, true, _arg1[_local3].fps);
_local3++;
};
if (!_animation.hasEventListener(AnimationEvent.SQUENCE_UPDATE)){
_animation.addEventListener(AnimationEvent.SQUENCE_UPDATE, updatePlaySequence);
};
_animation.sequenceEvent = true;
loop = true;
play(_animationgroup.playlist.shift());
}
public function gotoAndPlay(_arg1:int):void{
_frame = (_animation.frame = _arg1);
if (!_animation.isRunning){
_animation.start();
};
}
public function set fps(_arg1:int):void{
_animation.fps = ((_arg1)>=1) ? _arg1 : 1;
}
protected function removeElement(_arg1:IMeshElement):void{
forgetElementRadius(_arg1);
_arg1.removeOnVertexValueChange(onElementVertexValueChange);
_arg1.removeOnVertexChange(onElementVertexChange);
_verticesDirty = true;
launchNotifies();
}
public function set frame(_arg1:int):void{
if (_animation.frame == _arg1){
return;
};
_frame = _arg1;
_animation.frame = _arg1;
frames[_arg1].adjust(1);
}
public function get hasSequenceEvent():Boolean{
return (hasEventListener(AnimationEvent.SQUENCE_DONE));
}
protected function scaleXYZ(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Vertex;
for each (_local4 in vertices) {
_local4.x = (_local4.x * _arg1);
_local4.y = (_local4.y * _arg2);
_local4.z = (_local4.z * _arg3);
};
}
public function get elements():Array{
throw (new Error("Not implemented"));
}
public function get vertices():Array{
var _local1:Dictionary;
var _local2:IMeshElement;
var _local3:Vertex;
if (_verticesDirty){
_vertices = [];
_local1 = new Dictionary();
for each (_local2 in elements) {
for each (_local3 in _local2.vertices) {
if (!_local1[_local3]){
_vertices.push(_local3);
_local1[_local3] = true;
};
};
};
_verticesDirty = false;
};
return (_vertices);
}
}
}//package away3d.core.base
Section 12
//BaseMeshElement (away3d.core.base.BaseMeshElement)
package away3d.core.base {
import flash.events.*;
import away3d.events.*;
public class BaseMeshElement extends EventDispatcher implements IMeshElement {
private var _vertexchanged:MeshElementEvent;
private var _visiblechanged:MeshElementEvent;
private var _vertexvaluechanged:MeshElementEvent;
var _visible:Boolean;// = true
public function get visible():Boolean{
return (_visible);
}
public function get maxX():Number{
return (Math.sqrt(radius2));
}
public function addOnVertexValueChange(_arg1:Function):void{
addEventListener(MeshElementEvent.VERTEXVALUE_CHANGED, _arg1, false, 0, true);
}
public function get minX():Number{
return (-(Math.sqrt(radius2)));
}
public function get minY():Number{
return (-(Math.sqrt(radius2)));
}
public function get vertices():Array{
throw (new Error("Not implemented"));
}
public function removeOnVertexValueChange(_arg1:Function):void{
removeEventListener(MeshElementEvent.VERTEXVALUE_CHANGED, _arg1, false);
}
public function get minZ():Number{
return (-(Math.sqrt(radius2)));
}
public function addOnVertexChange(_arg1:Function):void{
addEventListener(MeshElementEvent.VERTEX_CHANGED, _arg1, false, 0, true);
}
public function addOnVisibleChange(_arg1:Function):void{
addEventListener(MeshElementEvent.VISIBLE_CHANGED, _arg1, false, 0, true);
}
function notifyVertexChange():void{
if (!hasEventListener(MeshElementEvent.VERTEX_CHANGED)){
return;
};
if (_vertexchanged == null){
_vertexchanged = new MeshElementEvent(MeshElementEvent.VERTEX_CHANGED, this);
};
dispatchEvent(_vertexchanged);
}
public function removeOnVertexChange(_arg1:Function):void{
removeEventListener(MeshElementEvent.VERTEX_CHANGED, _arg1, false);
}
public function get radius2():Number{
var _local2:Vertex;
var _local3:Number;
var _local1:Number = 0;
for each (_local2 in vertices) {
_local3 = (((_local2._x * _local2._x) + (_local2._y * _local2._y)) + (_local2._z * _local2._z));
if (_local3 > _local1){
_local1 = _local3;
};
};
return (_local1);
}
public function set visible(_arg1:Boolean):void{
if (_arg1 == _visible){
return;
};
_visible = _arg1;
notifyVisibleChange();
}
public function get maxZ():Number{
return (Math.sqrt(radius2));
}
function notifyVisibleChange():void{
if (!hasEventListener(MeshElementEvent.VISIBLE_CHANGED)){
return;
};
if (_visiblechanged == null){
_visiblechanged = new MeshElementEvent(MeshElementEvent.VISIBLE_CHANGED, this);
};
dispatchEvent(_visiblechanged);
}
function notifyVertexValueChange():void{
if (!hasEventListener(MeshElementEvent.VERTEXVALUE_CHANGED)){
return;
};
if (_vertexvaluechanged == null){
_vertexvaluechanged = new MeshElementEvent(MeshElementEvent.VERTEXVALUE_CHANGED, this);
};
dispatchEvent(_vertexvaluechanged);
}
public function get maxY():Number{
return (Math.sqrt(radius2));
}
public function removeOnVisibleChange(_arg1:Function):void{
removeEventListener(MeshElementEvent.VISIBLE_CHANGED, _arg1, false);
}
}
}//package away3d.core.base
Section 13
//Face (away3d.core.base.Face)
package away3d.core.base {
import flash.events.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.events.*;
import away3d.core.math.*;
import away3d.materials.*;
public class Face extends BaseMeshElement {
var _material:ITriangleMaterial;
private var _normal:Number3D;
var _uv2:UV;
public var extra:Object;
var _v0:Vertex;
var _v1:Vertex;
var _v2:Vertex;
public var parent:Mesh;
var _dt:DrawTriangle;
var bitmapRect:Rectangle;
private var _mappingchanged:FaceEvent;
var _back:ITriangleMaterial;
private var _b:Number;
private var _a:Number;
private var _c:Number;
private var _normalDirty:Boolean;// = true
private var _materialchanged:FaceEvent;
var _uv0:UV;
var _uv1:UV;
private var _s:Number;
public function Face(_arg1:Vertex, _arg2:Vertex, _arg3:Vertex, _arg4:ITriangleMaterial=null, _arg5:UV=null, _arg6:UV=null, _arg7:UV=null){
_dt = new DrawTriangle();
_normal = new Number3D();
super();
this.v0 = _arg1;
this.v1 = _arg2;
this.v2 = _arg3;
this.material = _arg4;
this.uv0 = _arg5;
this.uv1 = _arg6;
this.uv2 = _arg7;
_dt.face = this;
}
public function get v0():Vertex{
return (_v0);
}
public function get v1():Vertex{
return (_v1);
}
override public function get maxX():Number{
if (_v0._x > _v1._x){
if (_v0._x > _v2._x){
return (_v0._x);
};
return (_v2._x);
//unresolved jump
};
if (_v1._x > _v2._x){
return (_v1._x);
};
return (_v2._x);
}
public function set uv2(_arg1:UV):void{
if (_arg1 == _uv2){
return;
};
if (_uv2 != null){
if (((!((_uv2 == _uv1))) && (!((_uv2 == _uv0))))){
_uv2.removeOnChange(onUVChange);
};
};
_uv2 = _arg1;
if (_uv2 != null){
if (((!((_uv2 == _uv1))) && (!((_uv2 == _uv0))))){
_uv2.addOnChange(onUVChange);
};
};
notifyMappingChange();
}
public function get normal():Number3D{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
if (_normalDirty){
_normalDirty = false;
_local1 = (_v1.x - _v0.x);
_local2 = (_v1.y - _v0.y);
_local3 = (_v1.z - _v0.z);
_local4 = (_v2.x - _v0.x);
_local5 = (_v2.y - _v0.y);
_local6 = (_v2.z - _v0.z);
_local7 = ((_local2 * _local6) - (_local3 * _local5));
_local8 = ((_local3 * _local4) - (_local1 * _local6));
_local9 = ((_local1 * _local5) - (_local2 * _local4));
_local10 = Math.sqrt((((_local7 * _local7) + (_local8 * _local8)) + (_local9 * _local9)));
_normal.x = (_local7 / _local10);
_normal.y = (_local8 / _local10);
_normal.z = (_local9 / _local10);
};
return (_normal);
}
public function invert():void{
var _local1:Vertex = this._v1;
var _local2:Vertex = this._v2;
var _local3:UV = this._uv1;
var _local4:UV = this._uv2;
this._v1 = _local2;
this._v2 = _local1;
this._uv1 = _local4;
this._uv2 = _local3;
notifyVertexChange();
notifyMappingChange();
}
private function onUVChange(_arg1:Event):void{
notifyMappingChange();
}
public function get area():Number{
_a = v0.position.distance(v1.position);
_b = v1.position.distance(v2.position);
_c = v2.position.distance(v0.position);
_s = (((_a + _b) + _c) / 2);
return (Math.sqrt((((_s * (_s - _a)) * (_s - _b)) * (_s - _c))));
}
private function onVertexValueChange(_arg1:Event):void{
_normalDirty = true;
notifyVertexValueChange();
}
public function get maxV():Number{
if (_uv0._v > _uv1._v){
if (_uv0._v > _uv2._v){
return (_uv0._v);
};
return (_uv2._v);
//unresolved jump
};
if (_uv1._v > _uv2._v){
return (_uv1._v);
};
return (_uv2._v);
}
public function removeOnMaterialChange(_arg1:Function):void{
removeEventListener(FaceEvent.MATERIAL_CHANGED, _arg1, false);
}
public function addOnMappingChange(_arg1:Function):void{
addEventListener(FaceEvent.MAPPING_CHANGED, _arg1, false, 0, true);
}
override public function get radius2():Number{
var _local1:Number = (((_v0._x * _v0._x) + (_v0._y * _v0._y)) + (_v0._z * _v0._z));
var _local2:Number = (((_v1._x * _v1._x) + (_v1._y * _v1._y)) + (_v1._z * _v1._z));
var _local3:Number = (((_v2._x * _v2._x) + (_v2._y * _v2._y)) + (_v2._z * _v2._z));
if (_local1 > _local2){
if (_local1 > _local3){
return (_local1);
};
return (_local3);
//unresolved jump
};
if (_local2 > _local3){
return (_local2);
};
return (_local3);
}
public function get material():ITriangleMaterial{
return (_material);
}
function front(_arg1:Projection):Number{
var _local2:ScreenVertex = _v0.project(_arg1);
var _local3:ScreenVertex = _v1.project(_arg1);
var _local4:ScreenVertex = _v2.project(_arg1);
return ((((_local2.x * (_local4.y - _local3.y)) + (_local3.x * (_local2.y - _local4.y))) + (_local4.x * (_local3.y - _local2.y))));
}
public function get uv1():UV{
return (_uv1);
}
public function get uv2():UV{
return (_uv2);
}
public function get maxU():Number{
if (_uv0._u > _uv1._u){
if (_uv0.u > _uv2._u){
return (_uv0._u);
};
return (_uv2._u);
//unresolved jump
};
if (_uv1._u > _uv2._u){
return (_uv1._u);
};
return (_uv2._u);
}
public function get uv0():UV{
return (_uv0);
}
override public function get minY():Number{
if (_v0._y < _v1._y){
if (_v0._y < _v2._y){
return (_v0._y);
};
return (_v2._y);
//unresolved jump
};
if (_v1._y < _v2._y){
return (_v1._y);
};
return (_v2._y);
}
public function get minU():Number{
if (_uv0._u < _uv1._u){
if (_uv0._u < _uv2._u){
return (_uv0._u);
};
return (_uv2._u);
//unresolved jump
};
if (_uv1._u < _uv2._u){
return (_uv1._u);
};
return (_uv2._u);
}
public function get minV():Number{
if (_uv0._v < _uv1._v){
if (_uv0._v < _uv2._v){
return (_uv0._v);
};
return (_uv2._v);
//unresolved jump
};
if (_uv1._v < _uv2._v){
return (_uv1._v);
};
return (_uv2._v);
}
public function set material(_arg1:ITriangleMaterial):void{
if (_arg1 == _material){
return;
};
if (((!((_material == null))) && ((_material is IUVMaterial)))){
(_material as IUVMaterial).removeOnResize(onMaterialResize);
};
_material = _arg1;
if (((!((_material == null))) && ((_material is IUVMaterial)))){
(_material as IUVMaterial).addOnResize(onMaterialResize);
};
notifyMaterialChange();
}
override public function get minZ():Number{
if (_v0._z < _v1._z){
if (_v0._z < _v2._z){
return (_v0._z);
};
return (_v2._z);
//unresolved jump
};
if (_v1._z < _v2._z){
return (_v1._z);
};
return (_v2._z);
}
function notifyMappingChange():void{
_dt.texturemapping = null;
if (!hasEventListener(FaceEvent.MAPPING_CHANGED)){
return;
};
if (_mappingchanged == null){
_mappingchanged = new FaceEvent(FaceEvent.MAPPING_CHANGED, this);
};
dispatchEvent(_mappingchanged);
}
public function addOnMaterialChange(_arg1:Function):void{
addEventListener(FaceEvent.MATERIAL_CHANGED, _arg1, false, 0, true);
}
public function removeOnMappingChange(_arg1:Function):void{
removeEventListener(FaceEvent.MAPPING_CHANGED, _arg1, false);
}
public function set back(_arg1:ITriangleMaterial):void{
if (_arg1 == _back){
return;
};
_back = _arg1;
}
public function set uv0(_arg1:UV):void{
if (_arg1 == _uv0){
return;
};
if (_uv0 != null){
if (((!((_uv0 == _uv1))) && (!((_uv0 == _uv2))))){
_uv0.removeOnChange(onUVChange);
};
};
_uv0 = _arg1;
if (_uv0 != null){
if (((!((_uv0 == _uv1))) && (!((_uv0 == _uv2))))){
_uv0.addOnChange(onUVChange);
};
};
notifyMappingChange();
}
function notifyMaterialChange():void{
_dt.texturemapping = null;
if (!hasEventListener(FaceEvent.MATERIAL_CHANGED)){
return;
};
if (_materialchanged == null){
_materialchanged = new FaceEvent(FaceEvent.MATERIAL_CHANGED, this);
};
dispatchEvent(_materialchanged);
}
public function set uv1(_arg1:UV):void{
if (_arg1 == _uv1){
return;
};
if (_uv1 != null){
if (((!((_uv1 == _uv0))) && (!((_uv1 == _uv2))))){
_uv1.removeOnChange(onUVChange);
};
};
_uv1 = _arg1;
if (_uv1 != null){
if (((!((_uv1 == _uv0))) && (!((_uv1 == _uv2))))){
_uv1.addOnChange(onUVChange);
};
};
notifyMappingChange();
}
public function get uvs():Array{
return ([_uv0, _uv1, _uv2]);
}
override public function get minX():Number{
if (_v0._x < _v1._x){
if (_v0._x < _v2._x){
return (_v0._x);
};
return (_v2._x);
//unresolved jump
};
if (_v1._x < _v2._x){
return (_v1._x);
};
return (_v2._x);
}
public function set v0(_arg1:Vertex):void{
if (_arg1 == _v0){
return;
};
if (_v0 != null){
if (((!((_v0 == _v1))) && (!((_v0 == _v2))))){
_v0.removeOnChange(onVertexValueChange);
};
};
_v0 = _arg1;
if (_v0 != null){
if (((!((_v0 == _v1))) && (!((_v0 == _v2))))){
_v0.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
override public function get maxY():Number{
if (_v0._y > _v1._y){
if (_v0._y > _v2._y){
return (_v0._y);
};
return (_v2._y);
//unresolved jump
};
if (_v1._y > _v2._y){
return (_v1._y);
};
return (_v2._y);
}
public function set v1(_arg1:Vertex):void{
if (_arg1 == _v1){
return;
};
if (_v1 != null){
if (((!((_v1 == _v0))) && (!((_v1 == _v2))))){
_v1.removeOnChange(onVertexValueChange);
};
};
_v1 = _arg1;
if (_v1 != null){
if (((!((_v1 == _v0))) && (!((_v1 == _v2))))){
_v1.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
public function set v2(_arg1:Vertex):void{
if (_arg1 == _v2){
return;
};
if (_v2 != null){
if (((!((_v2 == _v1))) && (!((_v2 == _v0))))){
_v2.removeOnChange(onVertexValueChange);
};
};
_v2 = _arg1;
if (_v2 != null){
if (((!((_v2 == _v1))) && (!((_v2 == _v0))))){
_v2.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
override public function get vertices():Array{
return ([_v0, _v1, _v2]);
}
private function onMaterialResize(_arg1:MaterialEvent):void{
_dt.texturemapping = null;
}
public function get v2():Vertex{
return (_v2);
}
override public function get maxZ():Number{
if (_v0._z > _v1._z){
if (_v0._z > _v2._z){
return (_v0._z);
};
return (_v2._z);
//unresolved jump
};
if (_v1._z > _v2._z){
return (_v1._z);
};
return (_v2._z);
}
public function get back():ITriangleMaterial{
return (_back);
}
}
}//package away3d.core.base
Section 14
//Frame (away3d.core.base.Frame)
package away3d.core.base {
public class Frame implements IFrame {
public var vertexpositions:Array;
private var _vertexposition:VertexPosition;
public function Frame(){
vertexpositions = [];
super();
}
public function adjust(_arg1:Number=1):void{
for each (_vertexposition in vertexpositions) {
_vertexposition.adjust(_arg1);
};
}
}
}//package away3d.core.base
Section 15
//IAnimation (away3d.core.base.IAnimation)
package away3d.core.base {
public interface IAnimation {
function update(_arg1:BaseMesh):void;
}
}//package away3d.core.base
Section 16
//IFrame (away3d.core.base.IFrame)
package away3d.core.base {
public interface IFrame {
function adjust(_arg1:Number=1):void;
}
}//package away3d.core.base
Section 17
//IMeshElement (away3d.core.base.IMeshElement)
package away3d.core.base {
public interface IMeshElement {
function get radius2():Number;
function addOnVisibleChange(_arg1:Function):void;
function set visible(_arg1:Boolean):void;
function get minX():Number;
function get minY():Number;
function get minZ():Number;
function get visible():Boolean;
function addOnVertexChange(_arg1:Function):void;
function get maxY():Number;
function get maxZ():Number;
function removeOnVertexChange(_arg1:Function):void;
function get vertices():Array;
function removeOnVertexValueChange(_arg1:Function):void;
function get maxX():Number;
function addOnVertexValueChange(_arg1:Function):void;
function removeOnVisibleChange(_arg1:Function):void;
}
}//package away3d.core.base
Section 18
//Mesh (away3d.core.base.Mesh)
package away3d.core.base {
import flash.utils.*;
import away3d.primitives.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.events.*;
import away3d.core.math.*;
import away3d.materials.*;
import away3d.core.utils.*;
import away3d.core.*;
public class Mesh extends BaseMesh implements IPrimitiveProvider {
private var _scenevertnormalsDirty:Boolean;// = true
private var _material:ITriangleMaterial;
private var _dtActive:Array;
private var _neighbour01:Dictionary;
public var bothsides:Boolean;
private var _backface:Boolean;
private var _fVectors:Array;
private var _fAngle:Number;
private var _vertfaces:Dictionary;
private var _fNormal:Number3D;
private var _n01:Face;
private var _faces:Array;
public var indexes:Array;
private var _neighboursDirty:Boolean;// = true
public var outline:ISegmentMaterial;
private var _neighbour12:Dictionary;
private var _vertfacesDirty:Boolean;// = true
private var _n12:Face;
private var _debugboundingbox:WireCube;
private var _vertnormalsDirty:Boolean;// = true
private var _neighbour20:Dictionary;
private var _vt:ScreenVertex;
private var _backmat:ITriangleMaterial;
public var debugbb:Boolean;
private var _vertnormals:Dictionary;
private var _uvmaterial:Boolean;
private var _tri:DrawTriangle;
private var _n20:Face;
private var _dtStore:Array;
private var _scenevertnormals:Dictionary;
public var back:ITriangleMaterial;
public function Mesh(_arg1:Object=null){
_faces = [];
_dtStore = new Array();
_dtActive = new Array();
super(_arg1);
material = ini.getMaterial("material");
outline = ini.getSegmentMaterial("outline");
back = ini.getMaterial("back");
bothsides = ini.getBoolean("bothsides", false);
debugbb = ini.getBoolean("debugbb", false);
if ((((material == null)) && ((outline == null)))){
material = new WireColorMaterial();
};
}
private function forgetFaceNeighbours(_arg1:Face):void{
if (_neighboursDirty){
return;
};
_n01 = _neighbour01[_arg1];
if (_n01 != null){
delete _neighbour01[_arg1];
if (_neighbour01[_n01] == _arg1){
delete _neighbour01[_n01];
};
if (_neighbour12[_n01] == _arg1){
delete _neighbour12[_n01];
};
if (_neighbour20[_n01] == _arg1){
delete _neighbour20[_n01];
};
};
_n12 = _neighbour12[_arg1];
if (_n12 != null){
delete _neighbour12[_arg1];
if (_neighbour01[_n12] == _arg1){
delete _neighbour01[_n12];
};
if (_neighbour12[_n12] == _arg1){
delete _neighbour12[_n12];
};
if (_neighbour20[_n12] == _arg1){
delete _neighbour20[_n12];
};
};
_n20 = _neighbour20[_arg1];
if (_n20 != null){
delete _neighbour20[_arg1];
if (_neighbour01[_n20] == _arg1){
delete _neighbour01[_n20];
};
if (_neighbour12[_n20] == _arg1){
delete _neighbour12[_n20];
};
if (_neighbour20[_n20] == _arg1){
delete _neighbour20[_n20];
};
};
}
private function onMaterialResize(_arg1:MaterialEvent):void{
var _local2:Face;
for each (_local2 in _faces) {
if (_local2._material == null){
_local2._dt.texturemapping = null;
};
};
}
private function findVertNormals():void{
var _local1:Vertex;
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Face;
var _local7:Number3D;
var _local8:Vertex;
if (!_vertnormalsDirty){
return;
};
_vertnormals = new Dictionary();
for each (_local1 in vertices) {
_local2 = _vertfaces[_local1];
_local3 = 0;
_local4 = 0;
_local5 = 0;
for each (_local6 in _local2) {
_fNormal = _local6.normal;
_fVectors = new Array();
for each (_local8 in _local6.vertices) {
if (_local8 != _local1){
_fVectors.push(new Number3D((_local8.x - _local1.x), (_local8.y - _local1.y), (_local8.z - _local1.z), true));
};
};
_fAngle = Math.acos((_fVectors[0] as Number3D).dot((_fVectors[1] as Number3D)));
_local3 = (_local3 + (_fNormal.x * _fAngle));
_local4 = (_local4 + (_fNormal.y * _fAngle));
_local5 = (_local5 + (_fNormal.z * _fAngle));
};
_local7 = new Number3D(_local3, _local4, _local5);
_local7.normalize();
_vertnormals[_local1] = _local7;
};
_vertnormalsDirty = false;
}
public function invertFaces():void{
var _local1:Face;
for each (_local1 in _faces) {
_local1.invert();
};
}
function createDrawTriangle(_arg1:Face, _arg2:ITriangleMaterial, _arg3:Projection, _arg4:ScreenVertex, _arg5:ScreenVertex, _arg6:ScreenVertex, _arg7:UV, _arg8:UV, _arg9:UV):DrawTriangle{
if (_dtStore.length){
_dtActive.push((_tri = _dtStore.pop()));
_tri.texturemapping = null;
_tri.create = createDrawTriangle;
} else {
_dtActive.push((_tri = new DrawTriangle()));
_tri.source = this;
_tri.create = createDrawTriangle;
};
_tri.face = _arg1;
_tri.material = _arg2;
_tri.projection = _arg3;
_tri.v0 = _arg4;
_tri.v1 = _arg5;
_tri.v2 = _arg6;
_tri.uv0 = _arg7;
_tri.uv1 = _arg8;
_tri.uv2 = _arg9;
_tri.calc();
return (_tri);
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void{
var _local3:Face;
super.primitives(_arg1, _arg2);
_dtStore = _dtStore.concat(_dtActive);
_dtActive = new Array();
if (outline != null){
if (_neighboursDirty){
findNeighbours();
};
};
if (debugbb){
if (_debugboundingbox == null){
_debugboundingbox = new WireCube({material:"#white"});
};
_debugboundingbox.v000.x = minX;
_debugboundingbox.v001.x = minX;
_debugboundingbox.v010.x = minX;
_debugboundingbox.v011.x = minX;
_debugboundingbox.v100.x = maxX;
_debugboundingbox.v101.x = maxX;
_debugboundingbox.v110.x = maxX;
_debugboundingbox.v111.x = maxX;
_debugboundingbox.v000.y = minY;
_debugboundingbox.v001.y = minY;
_debugboundingbox.v010.y = maxY;
_debugboundingbox.v011.y = maxY;
_debugboundingbox.v100.y = minY;
_debugboundingbox.v101.y = minY;
_debugboundingbox.v110.y = maxY;
_debugboundingbox.v111.y = maxY;
_debugboundingbox.v000.z = minZ;
_debugboundingbox.v001.z = maxZ;
_debugboundingbox.v010.z = minZ;
_debugboundingbox.v011.z = maxZ;
_debugboundingbox.v100.z = minZ;
_debugboundingbox.v101.z = maxZ;
_debugboundingbox.v110.z = minZ;
_debugboundingbox.v111.z = maxZ;
if (_faces.length > 0){
_debugboundingbox.primitives(_arg1, _arg2);
};
};
_backmat = ((back) || (material));
for each (_local3 in _faces) {
if (!_local3._visible){
} else {
_tri = _local3._dt;
_tri.v0 = _local3._v0.project(projection);
_tri.v1 = _local3._v1.project(projection);
_tri.v2 = _local3._v2.project(projection);
if (!_tri.v0.visible){
} else {
if (!_tri.v1.visible){
} else {
if (!_tri.v2.visible){
} else {
_tri.calc();
if (_tri.maxZ < 0){
} else {
_backface = (_tri.area < 0);
if (_backface){
if (!bothsides){
continue;
};
_tri.material = _local3._back;
} else {
_tri.material = _local3._material;
};
if (_tri.material == null){
if (_backface){
_tri.material = _backmat;
} else {
_tri.material = _material;
};
};
if (_tri.material != null){
if (!_tri.material.visible){
_tri.material = null;
};
};
if (outline == null){
//unresolved if
} else {
if (pushback){
_tri.screenZ = _tri.maxZ;
};
if (pushfront){
_tri.screenZ = _tri.minZ;
};
_uvmaterial = (((_tri.material is IUVMaterial)) || ((_tri.material is ILayerMaterial)));
if (_backface){
_vt = _tri.v1;
_tri.v1 = _tri.v2;
_tri.v2 = _vt;
_tri.area = -(_tri.area);
if (_uvmaterial){
_tri.uv0 = _local3._uv0;
_tri.uv1 = _local3._uv2;
_tri.uv2 = _local3._uv1;
};
} else {
if (_uvmaterial){
_tri.uv0 = _local3._uv0;
_tri.uv1 = _local3._uv1;
_tri.uv2 = _local3._uv2;
};
};
if (_tri.backface != _backface){
_tri.backface = _backface;
_tri.texturemapping = null;
};
if (((!((outline == null))) && (!(_backface)))){
_n01 = _neighbour01[_local3];
if ((((_n01 == null)) || ((_n01.front(projection) <= 0)))){
_arg1.primitive(createDrawSegment(outline, projection, _tri.v0, _tri.v1));
};
_n12 = _neighbour12[_local3];
if ((((_n12 == null)) || ((_n12.front(projection) <= 0)))){
_arg1.primitive(createDrawSegment(outline, projection, _tri.v1, _tri.v2));
};
_n20 = _neighbour20[_local3];
if ((((_n20 == null)) || ((_n20.front(projection) <= 0)))){
_arg1.primitive(createDrawSegment(outline, projection, _tri.v2, _tri.v0));
};
//unresolved if
} else {
_tri.projection = projection;
_arg1.primitive(_tri);
};
};
};
};
};
};
};
};
}
public function removeFace(_arg1:Face):void{
var _local2:int = _faces.indexOf(_arg1);
if (_local2 == -1){
return;
};
removeElement(_arg1);
_vertfacesDirty = true;
forgetFaceNeighbours(_arg1);
_arg1.removeOnVertexChange(onFaceVertexChange);
_faces.splice(_local2, 1);
}
public function asXML():XML{
var refvertices:Dictionary;
var verticeslist:Array;
var refuvs:Dictionary;
var uvslist:Array;
var face:Face;
var vn:int;
var v:Vertex;
var uvn:int;
var uv:UV;
var f:Face;
var result:XML = <mesh></mesh>
;
refvertices = new Dictionary();
verticeslist = [];
var remembervertex:Function = function (_arg1:Vertex):void{
if (refvertices[_arg1] == null){
refvertices[_arg1] = verticeslist.length;
verticeslist.push(_arg1);
};
};
refuvs = new Dictionary();
uvslist = [];
var rememberuv:Function = function (_arg1:UV):void{
if (_arg1 == null){
return;
};
if (refuvs[_arg1] == null){
refuvs[_arg1] = uvslist.length;
uvslist.push(_arg1);
};
};
for each (face in _faces) {
remembervertex(face._v0);
remembervertex(face._v1);
remembervertex(face._v2);
rememberuv(face._uv0);
rememberuv(face._uv1);
rememberuv(face._uv2);
};
vn = 0;
for each (v in verticeslist) {
result.appendChild(new XML((((((((("<vertex id=\"" + ??esc_xattr
) + "\" x=\"") + ??esc_xattr
) + "\" y=\"") + ??esc_xattr
) + "\" z=\"") + ??esc_xattr
) + "\"/>")));
vn = (vn + 1);
};
uvn = 0;
for each (uv in uvslist) {
result.appendChild(new XML((((((("<uv id=\"" + ??esc_xattr
) + "\" u=\"") + ??esc_xattr
) + "\" v=\"") + ??esc_xattr
) + "\"/>")));
uvn = (uvn + 1);
};
for each (f in _faces) {
result.appendChild(new XML((((((((((((("<face v0=\"" + ??esc_xattr
) + "\" v1=\"") + ??esc_xattr
) + "\" v2=\"") + ??esc_xattr
) + "\" uv0=\"") + ??esc_xattr
) + "\" uv1=\"") + ??esc_xattr
) + "\" uv2=\"") + ??esc_xattr
) + "\"/>")));
};
return (result);
}
private function findNeighbours():void{
var _local1:Face;
var _local2:Boolean;
var _local3:Face;
if (!_neighboursDirty){
return;
};
_neighbour01 = new Dictionary();
_neighbour12 = new Dictionary();
_neighbour20 = new Dictionary();
for each (_local1 in _faces) {
_local2 = true;
for each (_local3 in _faces) {
if (_local2){
if (_local1 == _local3){
_local2 = false;
};
} else {
if ((((_local1._v0 == _local3._v2)) && ((_local1._v1 == _local3._v1)))){
_neighbour01[_local1] = _local3;
_neighbour12[_local3] = _local1;
};
if ((((_local1._v0 == _local3._v0)) && ((_local1._v1 == _local3._v2)))){
_neighbour01[_local1] = _local3;
_neighbour20[_local3] = _local1;
};
if ((((_local1._v0 == _local3._v1)) && ((_local1._v1 == _local3._v0)))){
_neighbour01[_local1] = _local3;
_neighbour01[_local3] = _local1;
};
if ((((_local1._v1 == _local3._v2)) && ((_local1._v2 == _local3._v1)))){
_neighbour12[_local1] = _local3;
_neighbour12[_local3] = _local1;
};
if ((((_local1._v1 == _local3._v0)) && ((_local1._v2 == _local3._v2)))){
_neighbour12[_local1] = _local3;
_neighbour20[_local3] = _local1;
};
if ((((_local1._v1 == _local3._v1)) && ((_local1._v2 == _local3._v0)))){
_neighbour12[_local1] = _local3;
_neighbour01[_local3] = _local1;
};
if ((((_local1._v2 == _local3._v2)) && ((_local1._v0 == _local3._v1)))){
_neighbour20[_local1] = _local3;
_neighbour12[_local3] = _local1;
};
if ((((_local1._v2 == _local3._v0)) && ((_local1._v0 == _local3._v2)))){
_neighbour20[_local1] = _local3;
_neighbour20[_local3] = _local1;
};
if ((((_local1._v2 == _local3._v1)) && ((_local1._v0 == _local3._v0)))){
_neighbour20[_local1] = _local3;
_neighbour01[_local3] = _local1;
};
};
};
};
_neighboursDirty = false;
}
function neighbour20(_arg1:Face):Face{
if (_neighboursDirty){
findNeighbours();
};
return (_neighbour20[_arg1]);
}
function recalcNeighbours():void{
if (!_neighboursDirty){
_neighboursDirty = true;
findNeighbours();
};
}
function getSceneVertexNormal(_arg1:Vertex):Number3D{
if (_vertfacesDirty){
findVertFaces();
};
if (_vertnormalsDirty){
findVertNormals();
};
if (_scenevertnormalsDirty){
findSceneVertNormals();
};
return (_scenevertnormals[_arg1]);
}
public function addFace(_arg1:Face):void{
addElement(_arg1);
_faces.push(_arg1);
_arg1._dt.source = (_arg1.parent = this);
_arg1._dt.create = createDrawTriangle;
_arg1.addOnVertexChange(onFaceVertexChange);
rememberFaceNeighbours(_arg1);
_vertfacesDirty = true;
}
private function rememberFaceNeighbours(_arg1:Face):void{
var _local2:Face;
if (_neighboursDirty){
return;
};
for each (_local2 in _faces) {
if (_arg1 == _local2){
} else {
if ((((_arg1._v0 == _local2._v2)) && ((_arg1._v1 == _local2._v1)))){
_neighbour01[_arg1] = _local2;
_neighbour12[_local2] = _arg1;
};
if ((((_arg1._v0 == _local2._v0)) && ((_arg1._v1 == _local2._v2)))){
_neighbour01[_arg1] = _local2;
_neighbour20[_local2] = _arg1;
};
if ((((_arg1._v0 == _local2._v1)) && ((_arg1._v1 == _local2._v0)))){
_neighbour01[_arg1] = _local2;
_neighbour01[_local2] = _arg1;
};
if ((((_arg1._v1 == _local2._v2)) && ((_arg1._v2 == _local2._v1)))){
_neighbour12[_arg1] = _local2;
_neighbour12[_local2] = _arg1;
};
if ((((_arg1._v1 == _local2._v0)) && ((_arg1._v2 == _local2._v2)))){
_neighbour12[_arg1] = _local2;
_neighbour20[_local2] = _arg1;
};
if ((((_arg1._v1 == _local2._v1)) && ((_arg1._v2 == _local2._v0)))){
_neighbour12[_arg1] = _local2;
_neighbour01[_local2] = _arg1;
};
if ((((_arg1._v2 == _local2._v2)) && ((_arg1._v0 == _local2._v1)))){
_neighbour20[_arg1] = _local2;
_neighbour12[_local2] = _arg1;
};
if ((((_arg1._v2 == _local2._v0)) && ((_arg1._v0 == _local2._v2)))){
_neighbour20[_arg1] = _local2;
_neighbour20[_local2] = _arg1;
};
if ((((_arg1._v2 == _local2._v1)) && ((_arg1._v0 == _local2._v0)))){
_neighbour20[_arg1] = _local2;
_neighbour01[_local2] = _arg1;
};
};
};
}
function getVertexNormal(_arg1:Vertex):Number3D{
if (_vertfacesDirty){
findVertFaces();
};
if (_vertnormalsDirty){
findVertNormals();
};
return (_vertnormals[_arg1]);
}
private function findSceneVertNormals():void{
if (!_scenevertnormalsDirty){
return;
};
_scenevertnormals = new Dictionary();
_scenevertnormalsDirty = false;
}
public function get faces():Array{
return (_faces);
}
public function get material():ITriangleMaterial{
return (_material);
}
function neighbour01(_arg1:Face):Face{
if (_neighboursDirty){
findNeighbours();
};
return (_neighbour01[_arg1]);
}
public function set material(_arg1:ITriangleMaterial):void{
var _local2:Face;
if (_material == _arg1){
return;
};
if (((!((_material == null))) && ((_material is IUVMaterial)))){
(_material as IUVMaterial).removeOnResize(onMaterialResize);
};
_material = _arg1;
if (((!((_material == null))) && ((_material is IUVMaterial)))){
(_material as IUVMaterial).addOnResize(onMaterialResize);
};
if ((((_material is IUVMaterial)) || ((_material is ILayerMaterial)))){
for each (_local2 in _faces) {
if (_local2._material == null){
_local2._dt.texturemapping = null;
};
};
};
}
public function asAS3Class(_arg1:String=null, _arg2:String="", _arg3:Boolean=false, _arg4:Boolean=false):String{
var refvertices:Dictionary;
var verticeslist:Array;
var refuvs:Dictionary;
var uvslist:Array;
var face:Face;
var uv:UV;
var v:Vertex;
var myPattern:RegExp;
var myPattern2:RegExp;
var f:Face;
var tmp:String;
var ind:Array;
var auv:Array;
var i:int;
var afn:Array;
var avp:Array;
var tmpnames:Array;
var y:int;
var framename:String;
var fr:Frame;
var classname = _arg1;
var packagename = _arg2;
var round = _arg3;
var animated = _arg4;
classname = ((((classname) || (name))) || ("Away3DObject"));
var importextra:String = (animated) ? "\timport flash.utils.Dictionary;\n" : "";
var source = (((((("package " + packagename) + "\n{\n\timport away3d.core.base.*;\n\timport away3d.core.utils.*;\n") + importextra) + "\n\tpublic class ") + classname) + " extends Mesh\n\t{\n");
source = (source + "\t\tprivate var varr:Array = [];\n\t\tprivate var uvarr:Array = [];\n\t\tprivate var scaling:Number;\n");
if (animated){
source = (source + "\t\tprivate var fnarr:Array = [];\n\n");
source = (source + "\n\t\tprivate function v():void\n\t\t{\n");
source = (source + "\t\t\tfor(var i:int = 0;i<vcount;i++){\n\t\t\t\tvarr.push(new Vertex(0,0,0));\n\t\t\t}\n\t\t}\n\n");
} else {
source = (source + "\n\t\tprivate function v(x:Number,y:Number,z:Number):void\n\t\t{\n");
source = (source + "\t\t\tvarr.push(new Vertex(x*scaling, y*scaling, z*scaling));\n\t\t}\n\n");
};
source = (source + "\t\tprivate function uv(u:Number,v:Number):void\n\t\t{\n");
source = (source + "\t\t\tuvarr.push(new UV(u,v));\n\t\t}\n\n");
source = (source + "\t\tprivate function f(vn0:int, vn1:int, vn2:int, uvn0:int, uvn1:int, uvn2:int):void\n\t\t{\n");
source = (source + "\t\t\taddFace(new Face(varr[vn0],varr[vn1],varr[vn2], null, uvarr[uvn0],uvarr[uvn1],uvarr[uvn2]));\n\t\t}\n\n");
source = (source + (("\t\tpublic function " + classname) + "(init:Object = null)\n\t\t{\n\t\t\tsuper(init);\n\t\t\tinit = Init.parse(init);\n\t\t\tscaling = init.getNumber(\"scaling\", 1);\n\t\t\tbuild();\n\t\t\ttype = \".as\";\n\t\t}\n\n"));
source = (source + "\t\tprivate function build():void\n\t\t{\n");
refvertices = new Dictionary();
verticeslist = [];
var remembervertex:Function = function (_arg1:Vertex):void{
if (refvertices[_arg1] == null){
refvertices[_arg1] = verticeslist.length;
verticeslist.push(_arg1);
};
};
refuvs = new Dictionary();
uvslist = [];
var rememberuv:Function = function (_arg1:UV):void{
if (_arg1 == null){
return;
};
if (refuvs[_arg1] == null){
refuvs[_arg1] = uvslist.length;
uvslist.push(_arg1);
};
};
for each (face in _faces) {
remembervertex(face._v0);
remembervertex(face._v1);
remembervertex(face._v2);
rememberuv(face._uv0);
rememberuv(face._uv1);
rememberuv(face._uv2);
};
if (animated){
myPattern = new RegExp("vcount", "g");
source = source.replace(myPattern, verticeslist.length);
source = (source + "\n\t\t\tv();\n\n");
} else {
for each (v in verticeslist) {
source = (source + (round) ? (((((("\t\t\tv(" + v._x.toFixed(4)) + ",") + v._y.toFixed(4)) + ",") + v._z.toFixed(4)) + ");\n") : (((((("\t\t\tv(" + v._x) + ",") + v._y) + ",") + v._z) + ");\n"));
};
};
for each (uv in uvslist) {
source = (source + (round) ? (((("\t\t\tuv(" + uv._u.toFixed(4)) + ",") + uv._v.toFixed(4)) + ");\n") : (((("\t\t\tuv(" + uv._u) + ",") + uv._v) + ");\n"));
};
if (round){
myPattern2 = new RegExp(".0000", "g");
};
if (animated){
auv = [];
for each (f in _faces) {
auv.push((round) ? ((((refuvs[f._uv0].toFixed(4) + ",") + refuvs[f._uv1].toFixed(4)) + ",") + refuvs[f._uv2].toFixed(4)) : ((((refuvs[f._uv0] + ",") + refuvs[f._uv1]) + ",") + refuvs[f._uv2]));
};
i = 0;
while (i < indexes.length) {
ind = indexes[i];
source = (source + (((((((("\t\t\tf(" + ind[0]) + ",") + ind[1]) + ",") + ind[2]) + ",") + auv[i]) + ");\n"));
i = (i + 1);
};
} else {
for each (f in _faces) {
source = (source + (((((((((((("\t\t\tf(" + refvertices[f._v0]) + ",") + refvertices[f._v1]) + ",") + refvertices[f._v2]) + ",") + refuvs[f._uv0]) + ",") + refuvs[f._uv1]) + ",") + refuvs[f._uv2]) + ");\n"));
};
};
if (round){
source = source.replace(myPattern2, "");
};
if (animated){
afn = new Array();
tmpnames = new Array();
i = 0;
y = 0;
source = (source + "\n\t\t\tframes = new Dictionary();\n");
source = (source + "\t\t\tframenames = new Dictionary();\n");
source = (source + "\t\t\tvar oFrames:Object = new Object();\n");
myPattern = new RegExp(" ", "g");
for (framename in framenames) {
tmpnames.push(framename);
};
tmpnames.sort();
i = 0;
while (i < tmpnames.length) {
avp = new Array();
fr = frames[framenames[tmpnames[i]]];
if (tmpnames[i].indexOf(" ") != -1){
tmpnames[i] = tmpnames[i].replace(myPattern, "");
};
afn.push((("\"" + tmpnames[i]) + "\""));
source = (source + (("\n\t\t\toFrames." + tmpnames[i]) + "=["));
y = 0;
while (y < verticeslist.length) {
if (round){
avp.push(fr.vertexpositions[y].x.toFixed(4));
avp.push(fr.vertexpositions[y].y.toFixed(4));
avp.push(fr.vertexpositions[y].z.toFixed(4));
} else {
avp.push(fr.vertexpositions[y].x);
avp.push(fr.vertexpositions[y].y);
avp.push(fr.vertexpositions[y].z);
};
y = (y + 1);
};
if (round){
tmp = avp.toString();
tmp = tmp.replace(myPattern2, "");
source = (source + (tmp + "];\n"));
} else {
source = (source + (avp.toString() + "];\n"));
};
i = (i + 1);
};
source = (source + (("\n\t\t\tfnarr = [" + afn.toString()) + "];\n"));
source = (source + "\n\t\t\tvar y:int;\n");
source = (source + "\t\t\tvar z:int;\n");
source = (source + "\t\t\tvar frame:Frame;\n");
source = (source + "\t\t\tfor(var i:int = 0;i<fnarr.length; i++){\n");
source = (source + "\t\t\t\ttrace(\"[ \"+fnarr[i]+\" ]\");\n");
source = (source + "\t\t\t\tframe = new Frame();\n");
source = (source + "\t\t\t\tframenames[fnarr[i]] = i;\n");
source = (source + "\t\t\t\tframes[i] = frame;\n");
source = (source + "\t\t\t\tz=0;\n");
source = (source + "\t\t\t\tfor (y = 0; y < oFrames[fnarr[i]].length; y+=3){\n");
source = (source + "\t\t\t\t\tvar vp:VertexPosition = new VertexPosition(varr[z]);\n");
source = (source + "\t\t\t\t\tz++;\n");
source = (source + "\t\t\t\t\tvp.x = oFrames[fnarr[i]][y]*scaling;\n");
source = (source + "\t\t\t\t\tvp.y = oFrames[fnarr[i]][y+1]*scaling;\n");
source = (source + "\t\t\t\t\tvp.z = oFrames[fnarr[i]][y+2]*scaling;\n");
source = (source + "\t\t\t\t\tframe.vertexpositions.push(vp);\n");
source = (source + "\t\t\t\t}\n");
source = (source + "\t\t\t\tif (i == 0)\n");
source = (source + "\t\t\t\t\tframe.adjust();\n");
source = (source + "\t\t\t}\n");
};
source = (source + "\n\t\t}\n\t}\n}");
return (source);
}
public function quarterFaces():void{
var _local2:Face;
var _local3:Vertex;
var _local4:Vertex;
var _local5:Vertex;
var _local6:Vertex;
var _local7:Vertex;
var _local8:Vertex;
var _local9:UV;
var _local10:UV;
var _local11:UV;
var _local12:UV;
var _local13:UV;
var _local14:UV;
var _local15:ITriangleMaterial;
var _local1:Dictionary = new Dictionary();
for each (_local2 in _faces.concat([])) {
_local3 = _local2.v0;
_local4 = _local2.v1;
_local5 = _local2.v2;
if (_local1[_local3] == null){
_local1[_local3] = new Dictionary();
};
if (_local1[_local4] == null){
_local1[_local4] = new Dictionary();
};
if (_local1[_local5] == null){
_local1[_local5] = new Dictionary();
};
_local6 = _local1[_local3][_local4];
if (_local6 == null){
_local6 = Vertex.median(_local3, _local4);
_local1[_local3][_local4] = _local6;
_local1[_local4][_local3] = _local6;
};
_local7 = _local1[_local4][_local5];
if (_local7 == null){
_local7 = Vertex.median(_local4, _local5);
_local1[_local4][_local5] = _local7;
_local1[_local5][_local4] = _local7;
};
_local8 = _local1[_local5][_local3];
if (_local8 == null){
_local8 = Vertex.median(_local5, _local3);
_local1[_local5][_local3] = _local8;
_local1[_local3][_local5] = _local8;
};
_local9 = _local2.uv0;
_local10 = _local2.uv1;
_local11 = _local2.uv2;
_local12 = UV.median(_local9, _local10);
_local13 = UV.median(_local10, _local11);
_local14 = UV.median(_local11, _local9);
_local15 = _local2.material;
removeFace(_local2);
addFace(new Face(_local3, _local6, _local8, _local15, _local9, _local12, _local14));
addFace(new Face(_local6, _local4, _local7, _local15, _local12, _local10, _local13));
addFace(new Face(_local8, _local7, _local5, _local15, _local14, _local13, _local11));
addFace(new Face(_local7, _local8, _local6, _local15, _local13, _local14, _local12));
};
}
private function onFaceVertexChange(_arg1:MeshElementEvent):void{
var _local2:Face;
if (!_neighboursDirty){
_local2 = (_arg1.element as Face);
forgetFaceNeighbours(_local2);
rememberFaceNeighbours(_local2);
};
_vertfacesDirty = true;
}
public function movePivot(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local5:Vertex;
var _local6:Number3D;
var _local4:Boolean = _neighboursDirty;
_neighboursDirty = true;
for each (_local5 in vertices) {
_local5.x = (_local5.x - _arg1);
_local5.y = (_local5.y - _arg2);
_local5.z = (_local5.z - _arg3);
};
_local6 = new Number3D(_arg1, _arg2, _arg3);
new Number3D(_arg1, _arg2, _arg3).rotate(_local6.clone(), _transform);
_local6.add(_local6, position);
moveTo(_local6);
_neighboursDirty = _local4;
}
override public function get elements():Array{
return (_faces);
}
private function findVertFaces():void{
var _local1:Face;
var _local2:Vertex;
var _local3:Vertex;
var _local4:Vertex;
if (!_vertfacesDirty){
return;
};
_vertfaces = new Dictionary();
for each (_local1 in faces) {
_local2 = _local1.v0;
if (_vertfaces[_local2] == null){
_vertfaces[_local2] = [_local1];
} else {
_vertfaces[_local2].push(_local1);
};
_local3 = _local1.v1;
if (_vertfaces[_local3] == null){
_vertfaces[_local3] = [_local1];
} else {
_vertfaces[_local3].push(_local1);
};
_local4 = _local1.v2;
if (_vertfaces[_local4] == null){
_vertfaces[_local4] = [_local1];
} else {
_vertfaces[_local4].push(_local1);
};
};
_vertfacesDirty = false;
}
function getFacesByVertex(_arg1:Vertex):Array{
if (_vertfacesDirty){
findVertFaces();
};
return (_vertfaces[_arg1]);
}
function neighbour12(_arg1:Face):Face{
if (_neighboursDirty){
findNeighbours();
};
return (_neighbour12[_arg1]);
}
override public function clone(_arg1=null){
var clonedvertices:Dictionary;
var cloneduvs:Dictionary;
var face:Face;
var object = _arg1;
var mesh:Mesh = ((object) || (new Mesh()));
super.clone(mesh);
mesh.material = material;
mesh.outline = outline;
mesh.back = back;
mesh.bothsides = bothsides;
mesh.debugbb = debugbb;
clonedvertices = new Dictionary();
var clonevertex:Function = function (_arg1:Vertex):Vertex{
var _local2:Vertex = clonedvertices[_arg1];
if (_local2 == null){
_local2 = new Vertex(_arg1._x, _arg1._y, _arg1._z);
_local2.extra = ((_arg1.extra is IClonable)) ? (_arg1.extra as IClonable).clone() : _arg1.extra;
clonedvertices[_arg1] = _local2;
};
return (_local2);
};
cloneduvs = new Dictionary();
var cloneuv:Function = function (_arg1:UV):UV{
if (_arg1 == null){
return (null);
};
var _local2:UV = cloneduvs[_arg1];
if (_local2 == null){
_local2 = new UV(_arg1._u, _arg1._v);
cloneduvs[_arg1] = _local2;
};
return (_local2);
};
for each (face in _faces) {
mesh.addFace(new Face(clonevertex(face._v0), clonevertex(face._v1), clonevertex(face._v2), face.material, cloneuv(face._uv0), cloneuv(face._uv1), cloneuv(face._uv2)));
};
return (mesh);
}
}
}//package away3d.core.base
Section 19
//Object3D (away3d.core.base.Object3D)
package away3d.core.base {
import flash.events.*;
import flash.display.*;
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.events.*;
import away3d.core.math.*;
import away3d.core.traverse.*;
import away3d.core.utils.*;
public class Object3D extends EventDispatcher implements IClonable {
public var extra:Object;
private var _rot:Number3D;
private var _rotationX:Number;
private var _rotationY:Number;
private var _rotationZ:Number;
private var _transformchanged:Object3DEvent;
private var _ddo:DrawDisplayObject;
private var _zAxis:Number3D;
public var ownSession:AbstractRenderSession;
private var _xAxis:Number3D;
public var viewTransform:Matrix3D;
public var projection:Projection;
private var _localTransformDirty:Boolean;
private var _scenetransformchanged:Object3DEvent;
public var alpha:Number;
var _sceneTransform:Matrix3D;
private var _vector:Number3D;
public var visible:Boolean;// = true
public var ownCanvas:Boolean;// = false
private var _scenechanged:Object3DEvent;
private var _position:Number3D;
public var name:String;
public var useHandCursor:Boolean;// = false
private var _scene:Scene3D;
public var blendMode:String;
public var session:AbstractRenderSession;
public var inverseSceneTransform:Matrix3D;
var _sceneTransformDirty:Boolean;
private var _yAxis:Number3D;
private var _quaternion:Quaternion;
private var _parent:ObjectContainer3D;
private var _dimensionschanged:Object3DEvent;
private var _scenePosition:Number3D;
public var sceneTransformed:Boolean;
private var _radiuschanged:Object3DEvent;
private var _c:DisplayObject;
var _transformDirty:Boolean;
protected var ini:Init;
var _transform:Matrix3D;
private var _sc:ScreenVertex;
public var mouseEnabled:Boolean;// = true
private var _rotationDirty:Boolean;
private var _v:View3D;
public var filters:Array;
private var _m:Matrix3D;
private static var toDEGREES:Number = 57.2957795130823;
private static var toRADIANS:Number = 0.0174532925199433;
public function Object3D(_arg1:Object=null):void{
_transform = new Matrix3D();
_sceneTransform = new Matrix3D();
_quaternion = new Quaternion();
_position = new Number3D();
_scenePosition = new Number3D();
_ddo = new DrawDisplayObject();
_sc = new ScreenVertex();
_vector = new Number3D();
_m = new Matrix3D();
_xAxis = new Number3D();
_yAxis = new Number3D();
_zAxis = new Number3D();
projection = new Projection();
inverseSceneTransform = new Matrix3D();
viewTransform = new Matrix3D();
super();
ini = Init.parse(_arg1);
name = ini.getString("name", name);
ownCanvas = ini.getBoolean("ownCanvas", ownCanvas);
ownSession = (ini.getObject("ownSession", AbstractRenderSession) as AbstractRenderSession);
visible = ini.getBoolean("visible", visible);
mouseEnabled = ini.getBoolean("mouseEnabled", mouseEnabled);
useHandCursor = ini.getBoolean("useHandCursor", useHandCursor);
filters = ini.getArray("filters");
alpha = ini.getNumber("alpha", 1);
x = ini.getNumber("x", 0);
y = ini.getNumber("y", 0);
z = ini.getNumber("z", 0);
rotationX = ini.getNumber("rotationX", 0);
rotationY = ini.getNumber("rotationY", 0);
rotationZ = ini.getNumber("rotationZ", 0);
extra = ini.getObject("extra");
parent = (ini.getObject3D("parent") as ObjectContainer3D);
if (ownSession){
ownCanvas = true;
};
if ((this is Scene3D)){
_scene = (this as Scene3D);
};
}
public function set y(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(y)"));
};
if (_arg1 == Infinity){
Debug.warning("y == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("y == -Infinity");
};
_transform.ty = _arg1;
_sceneTransformDirty = true;
_localTransformDirty = true;
}
public function set z(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(z)"));
};
if (_arg1 == Infinity){
Debug.warning("z == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("z == -Infinity");
};
_transform.tz = _arg1;
_sceneTransformDirty = true;
_localTransformDirty = true;
}
public function removeOnRadiusChange(_arg1:Function):void{
removeEventListener(Object3DEvent.RADIUS_CHANGED, _arg1, false);
}
public function addOnMouseMove(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_MOVE, _arg1, false, 0, false);
}
public function removeOnMouseOut(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_OUT, _arg1, false);
}
function dispatchMouseEvent(_arg1:MouseEvent3D):Boolean{
if (!hasEventListener(_arg1.type)){
return (false);
};
dispatchEvent(_arg1);
return (true);
}
public function moveDown(_arg1:Number):void{
translate(Number3D.DOWN, _arg1);
}
function get parentmaxX():Number{
return ((boundingRadius + _transform.tx));
}
function get parentmaxY():Number{
return ((boundingRadius + _transform.ty));
}
public function removeOnMouseUp(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_UP, _arg1, false);
}
function get parentmaxZ():Number{
return ((boundingRadius + _transform.tz));
}
public function get position():Number3D{
if (_transformDirty){
updateTransform();
};
_position.x = _transform.tx;
_position.y = _transform.ty;
_position.z = _transform.tz;
return (_position);
}
public function lookAt(_arg1:Number3D, _arg2:Number3D=null):void{
_zAxis.sub(_arg1, position);
_zAxis.normalize();
if ((((_zAxis.modulo > 0.1)) && (((((!((_zAxis.x == _transform.sxz))) || (!((_zAxis.y == _transform.syz))))) || (!((_zAxis.z == _transform.szz))))))){
_xAxis.cross(_zAxis, ((_arg2) || (Number3D.UP)));
_xAxis.normalize();
_yAxis.cross(_zAxis, _xAxis);
_yAxis.normalize();
_transform.sxx = _xAxis.x;
_transform.syx = _xAxis.y;
_transform.szx = _xAxis.z;
_transform.sxy = -(_yAxis.x);
_transform.syy = -(_yAxis.y);
_transform.szy = -(_yAxis.z);
_transform.sxz = _zAxis.x;
_transform.syz = _zAxis.y;
_transform.szz = _zAxis.z;
_transformDirty = false;
_rotationDirty = true;
_sceneTransformDirty = true;
_localTransformDirty = true;
};
}
private function onParentSceneChange(_arg1:Object3DEvent):void{
if (_scene == _parent.scene){
return;
};
_scene = _parent.scene;
notifySceneChange();
}
public function set rotationX(_arg1:Number):void{
_rotationX = (-(_arg1) * toRADIANS);
_transformDirty = true;
}
public function removeOnTransformChange(_arg1:Function):void{
removeEventListener(Object3DEvent.TRANSFORM_CHANGED, _arg1, false);
}
public function moveTo(_arg1:Number3D):void{
_transform.tx = _arg1.x;
_transform.ty = _arg1.y;
_transform.tz = _arg1.z;
_localTransformDirty = true;
}
public function set rotationY(_arg1:Number):void{
_rotationY = (-(_arg1) * toRADIANS);
_transformDirty = true;
}
public function get sceneTransform():Matrix3D{
sceneTransformed = false;
if (_scene == null){
if (_transformDirty){
_sceneTransformDirty = true;
};
if (_sceneTransformDirty){
_sceneTransformDirty = false;
notifySceneTransformChange();
};
return (transform);
};
if (_transformDirty){
updateTransform();
};
if (_sceneTransformDirty){
updateSceneTransform();
};
if (_localTransformDirty){
notifyTransformChange();
};
return (_sceneTransform);
}
function notifyDimensionsChange():void{
if (!hasEventListener(Object3DEvent.DIMENSIONS_CHANGED)){
return;
};
if (!_dimensionschanged){
_dimensionschanged = new Object3DEvent(Object3DEvent.DIMENSIONS_CHANGED, this);
};
dispatchEvent(_dimensionschanged);
}
public function get minZ():Number{
return (-(boundingRadius));
}
public function scale(_arg1:Number):void{
}
public function removeOnSceneTransformChange(_arg1:Function):void{
removeEventListener(Object3DEvent.SCENETRANSFORM_CHANGED, _arg1, false);
}
public function moveUp(_arg1:Number):void{
translate(Number3D.UP, _arg1);
}
public function get minX():Number{
return (-(boundingRadius));
}
public function set rotationZ(_arg1:Number):void{
_rotationZ = (-(_arg1) * toRADIANS);
_transformDirty = true;
}
function notifySceneChange():void{
if (!hasEventListener(Object3DEvent.SCENE_CHANGED)){
return;
};
if (!_scenechanged){
_scenechanged = new Object3DEvent(Object3DEvent.SCENE_CHANGED, this);
};
dispatchEvent(_scenechanged);
}
public function set parent(_arg1:ObjectContainer3D):void{
if (_arg1 == _parent){
return;
};
var _local2:Scene3D = scene;
if (_parent != null){
_parent.removeOnSceneChange(onParentSceneChange);
_parent.internalRemoveChild(this);
};
_parent = _arg1;
if (_parent != null){
_parent.internalAddChild(this);
_parent.addOnSceneChange(onParentSceneChange);
_parent.addOnSceneTransformChange(onParentTransformChange);
};
_scene = (_parent) ? _parent.scene : null;
if (_scene != _local2){
notifySceneChange();
};
_sceneTransformDirty = true;
_localTransformDirty = true;
}
public function get boundingRadius():Number{
return (0);
}
public function distanceTo(_arg1:Object3D):Number{
var _local2:Matrix3D = ((scene == null)) ? transform : sceneTransform;
var _local3:Matrix3D = ((_arg1.scene == null)) ? _arg1.transform : _arg1.sceneTransform;
var _local4:Number = (_local2.tx - _local3.tx);
var _local5:Number = (_local2.ty - _local3.ty);
var _local6:Number = (_local2.tz - _local3.tz);
return (Math.sqrt((((_local4 * _local4) + (_local5 * _local5)) + (_local6 * _local6))));
}
public function pitch(_arg1:Number):void{
rotate(Number3D.RIGHT, _arg1);
}
public function set position(_arg1:Number3D):void{
_transform.tx = _arg1.x;
_transform.ty = _arg1.y;
_transform.tz = _arg1.z;
_sceneTransformDirty = true;
_localTransformDirty = true;
}
public function rotate(_arg1:Number3D, _arg2:Number):void{
_vector.rotate(_arg1, transform);
_m.rotationMatrix(_vector.x, _vector.y, _vector.z, (_arg2 * toRADIANS));
_m.tx = _transform.tx;
_m.ty = _transform.ty;
_m.tz = _transform.tz;
_transform.multiply3x3(_m, transform);
_rotationDirty = true;
_sceneTransformDirty = true;
_localTransformDirty = true;
}
public function translate(_arg1:Number3D, _arg2:Number):void{
_vector.rotate(_arg1, transform);
x = (x + (_arg2 * _vector.x));
y = (y + (_arg2 * _vector.y));
z = (z + (_arg2 * _vector.z));
}
public function clone(_arg1=null){
var _local2:Object3D = ((_arg1) || (new Object3D()));
_local2.transform = transform;
_local2.name = name;
_local2.visible = visible;
_local2.mouseEnabled = mouseEnabled;
_local2.useHandCursor = useHandCursor;
_local2.extra = ((extra is IClonable)) ? (extra as IClonable).clone() : extra;
return (_local2);
}
private function updateRotation():void{
_rot = _transform.matrix2euler();
_rotationX = (_rot.x * toRADIANS);
_rotationY = (_rot.y * toRADIANS);
_rotationZ = (_rot.z * toRADIANS);
_rotationDirty = false;
}
private function updateSceneTransform():void{
if (!_sceneTransformDirty){
return;
};
_sceneTransform.multiply(_parent.sceneTransform, transform);
inverseSceneTransform.inverse(_sceneTransform);
_sceneTransformDirty = false;
notifySceneTransformChange();
}
public function get transform():Matrix3D{
if (_transformDirty){
updateTransform();
};
return (_transform);
}
public function addOnMouseDown(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_DOWN, _arg1, false, 0, false);
}
public function addOnRadiusChange(_arg1:Function):void{
addEventListener(Object3DEvent.RADIUS_CHANGED, _arg1, false, 0, true);
}
public function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void{
_v = _arg2.view;
if (ownCanvas){
if (!ownSession){
ownSession = new SpriteRenderSession();
};
_arg2.registerChildSession(ownSession);
ownSession.view = _v;
_c = ownSession.getContainer(_v);
_c.filters = filters;
_c.alpha = alpha;
if (blendMode != null){
_c.blendMode = blendMode;
} else {
_c.blendMode = BlendMode.NORMAL;
};
ownSession.lightarray = _arg2.lightarray;
this.session = ownSession;
_sc.x = _c.x;
_sc.y = _c.y;
_sc.z = Math.sqrt(((((viewTransform.tz * viewTransform.tz) + viewTransform.tx) + viewTransform.tx) + (viewTransform.ty * viewTransform.ty)));
_ddo.source = this;
_ddo.screenvertex = _sc;
_ddo.displayobject = _c;
_ddo.session = _arg2;
_ddo.calc();
_arg1.primitive(_ddo);
} else {
this.session = _arg2;
};
}
public function get maxY():Number{
return (boundingRadius);
}
public function get y():Number{
return (_transform.ty);
}
public function get maxX():Number{
return (boundingRadius);
}
public function get maxZ():Number{
return (boundingRadius);
}
public function get x():Number{
return (_transform.tx);
}
public function get minY():Number{
return (-(boundingRadius));
}
public function get z():Number{
return (_transform.tz);
}
public function roll(_arg1:Number):void{
rotate(Number3D.FORWARD, _arg1);
}
public function traverse(_arg1:Traverser):void{
if (_arg1.match(this)){
_arg1.enter(this);
_arg1.apply(this);
_arg1.leave(this);
};
}
public function removeOnDimensionsChange(_arg1:Function):void{
removeEventListener(Object3DEvent.DIMENSIONS_CHANGED, _arg1, false);
}
public function yaw(_arg1:Number):void{
rotate(Number3D.UP, _arg1);
}
private function onParentTransformChange(_arg1:Object3DEvent):void{
_sceneTransformDirty = true;
}
override public function toString():String{
return ((((((((name) ? name : "$" + ": x:") + Math.round(x)) + " y:") + Math.round(y)) + " z:") + Math.round(z)));
}
public function get rotationX():Number{
if (_rotationDirty){
updateRotation();
};
return ((-(_rotationX) * toDEGREES));
}
public function get rotationY():Number{
if (_rotationDirty){
updateRotation();
};
return ((-(_rotationY) * toDEGREES));
}
public function get rotationZ():Number{
if (_rotationDirty){
updateRotation();
};
return ((-(_rotationZ) * toDEGREES));
}
public function tick(_arg1:int):void{
}
public function addOnSceneTransformChange(_arg1:Function):void{
addEventListener(Object3DEvent.SCENETRANSFORM_CHANGED, _arg1, false, 0, true);
}
public function addOnMouseUp(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_UP, _arg1, false, 0, false);
}
private function updateTransform():void{
if (!_transformDirty){
return;
};
_quaternion.euler2quaternion(-(_rotationY), -(_rotationZ), _rotationX);
_transform.quaternion2matrix(_quaternion);
_transformDirty = false;
_sceneTransformDirty = true;
_localTransformDirty = true;
}
public function moveLeft(_arg1:Number):void{
translate(Number3D.LEFT, _arg1);
}
public function addOnMouseOver(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_OVER, _arg1, false, 0, false);
}
public function removeOnMouseDown(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_DOWN, _arg1, false);
}
public function get scene():Scene3D{
return (_scene);
}
public function get parent():ObjectContainer3D{
return (_parent);
}
function notifyTransformChange():void{
_localTransformDirty = false;
if (!hasEventListener(Object3DEvent.TRANSFORM_CHANGED)){
return;
};
if (!_transformchanged){
_transformchanged = new Object3DEvent(Object3DEvent.TRANSFORM_CHANGED, this);
};
dispatchEvent(_transformchanged);
}
public function moveForward(_arg1:Number):void{
translate(Number3D.FORWARD, _arg1);
}
function get parentradius():Number{
var _local1:Number = _transform.tx;
var _local2:Number = _transform.ty;
var _local3:Number = _transform.tz;
return ((Math.sqrt((((_local1 * _local1) + (_local2 * _local2)) + (_local3 * _local3))) + boundingRadius));
}
function notifyRadiusChange():void{
if (!hasEventListener(Object3DEvent.RADIUS_CHANGED)){
return;
};
if (!_radiuschanged){
_radiuschanged = new Object3DEvent(Object3DEvent.RADIUS_CHANGED, this);
};
dispatchEvent(_radiuschanged);
}
public function addOnDimensionsChange(_arg1:Function):void{
addEventListener(Object3DEvent.DIMENSIONS_CHANGED, _arg1, false, 0, true);
}
public function moveRight(_arg1:Number):void{
translate(Number3D.RIGHT, _arg1);
}
public function removeOnMouseMove(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_MOVE, _arg1, false);
}
public function moveBackward(_arg1:Number):void{
translate(Number3D.BACKWARD, _arg1);
}
public function get scenePosition():Number3D{
_scenePosition.x = sceneTransform.tx;
_scenePosition.y = sceneTransform.ty;
_scenePosition.z = sceneTransform.tz;
return (_scenePosition);
}
public function set transform(_arg1:Matrix3D):void{
if (_arg1 == _transform){
return;
};
_transform.clone(_arg1);
_transformDirty = false;
_rotationDirty = true;
_sceneTransformDirty = true;
_localTransformDirty = true;
}
public function removeOnSceneChange(_arg1:Function):void{
removeEventListener(Object3DEvent.SCENE_CHANGED, _arg1, false);
}
public function removeOnMouseOver(_arg1:Function):void{
removeEventListener(MouseEvent3D.MOUSE_OVER, _arg1, false);
}
public function addOnTransformChange(_arg1:Function):void{
addEventListener(Object3DEvent.TRANSFORM_CHANGED, _arg1, false, 0, true);
}
function get parentminX():Number{
return ((-(boundingRadius) + _transform.tx));
}
function get parentminY():Number{
return ((-(boundingRadius) + _transform.ty));
}
function get parentminZ():Number{
return ((-(boundingRadius) + _transform.tz));
}
public function addOnMouseOut(_arg1:Function):void{
addEventListener(MouseEvent3D.MOUSE_OUT, _arg1, false, 0, false);
}
function notifySceneTransformChange():void{
_sceneTransformDirty = false;
sceneTransformed = true;
if (!hasEventListener(Object3DEvent.SCENETRANSFORM_CHANGED)){
return;
};
if (!_scenetransformchanged){
_scenetransformchanged = new Object3DEvent(Object3DEvent.SCENETRANSFORM_CHANGED, this);
};
dispatchEvent(_scenetransformchanged);
}
public function addOnSceneChange(_arg1:Function):void{
addEventListener(Object3DEvent.SCENE_CHANGED, _arg1, false, 0, true);
}
public function set x(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(x)"));
};
if (_arg1 == Infinity){
Debug.warning("x == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("x == -Infinity");
};
_transform.tx = _arg1;
_sceneTransformDirty = true;
_localTransformDirty = true;
}
}
}//package away3d.core.base
Section 20
//Segment (away3d.core.base.Segment)
package away3d.core.base {
import flash.events.*;
import away3d.core.draw.*;
import away3d.events.*;
import away3d.materials.*;
public class Segment extends BaseMeshElement {
var _material:ISegmentMaterial;
public var extra:Object;
var _v0:Vertex;
var _v1:Vertex;
public var parent:BaseMesh;
private var _materialchanged:SegmentEvent;
var _ds:DrawSegment;
public function Segment(_arg1:Vertex, _arg2:Vertex, _arg3:ISegmentMaterial=null){
_ds = new DrawSegment();
super();
this.v0 = _arg1;
this.v1 = _arg2;
this.material = _arg3;
}
public function set v0(_arg1:Vertex):void{
if (_arg1 == _v0){
return;
};
if (_v0 != null){
if (_v0 != _v1){
_v0.removeOnChange(onVertexValueChange);
};
};
_v0 = _arg1;
if (_v0 != null){
if (_v0 != _v1){
_v0.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
override public function get minY():Number{
if (_v0._y < _v1._y){
return (_v0._y);
};
return (_v1._y);
}
override public function get minZ():Number{
if (_v0._z < _v1._z){
return (_v0._z);
};
return (_v1._z);
}
override public function get minX():Number{
if (_v0._x < _v1._x){
return (_v0._x);
};
return (_v1._x);
}
public function set material(_arg1:ISegmentMaterial):void{
if (_arg1 == _material){
return;
};
_material = _arg1;
notifyMaterialChange();
}
override public function get maxX():Number{
if (_v0._x > _v1._x){
return (_v0._x);
};
return (_v1._x);
}
private function onVertexValueChange(_arg1:Event):void{
notifyVertexValueChange();
}
function notifyMaterialChange():void{
if (!hasEventListener(SegmentEvent.MATERIAL_CHANGED)){
return;
};
if (_materialchanged == null){
_materialchanged = new SegmentEvent(SegmentEvent.MATERIAL_CHANGED, this);
};
dispatchEvent(_materialchanged);
}
public function removeOnMaterialChange(_arg1:Function):void{
removeEventListener(SegmentEvent.MATERIAL_CHANGED, _arg1, false);
}
override public function get radius2():Number{
var _local1:Number = (((_v0._x * _v0._x) + (_v0._y * _v0._y)) + (_v0._z * _v0._z));
var _local2:Number = (((_v1._x * _v1._x) + (_v1._y * _v1._y)) + (_v1._z * _v1._z));
if (_local1 > _local2){
return (_local1);
};
return (_local2);
}
public function set v1(_arg1:Vertex):void{
if (_arg1 == _v1){
return;
};
if (_v1 != null){
if (_v1 != _v0){
_v1.removeOnChange(onVertexValueChange);
};
};
_v1 = _arg1;
if (_v1 != null){
if (_v1 != _v0){
_v1.addOnChange(onVertexValueChange);
};
};
notifyVertexChange();
}
public function addOnMaterialChange(_arg1:Function):void{
addEventListener(SegmentEvent.MATERIAL_CHANGED, _arg1, false, 0, true);
}
override public function get vertices():Array{
return ([_v0, _v1]);
}
public function get v0():Vertex{
return (_v0);
}
public function get v1():Vertex{
return (_v1);
}
override public function get maxY():Number{
if (_v0._y > _v1._y){
return (_v0._y);
};
return (_v1._y);
}
override public function get maxZ():Number{
if (_v0._z > _v1._z){
return (_v0._z);
};
return (_v1._z);
}
public function get material():ISegmentMaterial{
return (_material);
}
}
}//package away3d.core.base
Section 21
//UV (away3d.core.base.UV)
package away3d.core.base {
import away3d.core.utils.*;
public class UV extends ValueObject {
public var extra:Object;
var _u:Number;
var _v:Number;
public function UV(_arg1:Number=0, _arg2:Number=0){
_u = _arg1;
_v = _arg2;
}
override public function toString():String{
return ((((("new UV(" + _u) + ", ") + _v) + ")"));
}
public function get v():Number{
return (_v);
}
public function set u(_arg1:Number):void{
if (_arg1 == _u){
return;
};
_u = _arg1;
notifyChange();
}
public function set v(_arg1:Number):void{
if (_arg1 == _v){
return;
};
_v = _arg1;
notifyChange();
}
public function get u():Number{
return (_u);
}
public function clone():UV{
return (new UV(_u, _v));
}
static function median(_arg1:UV, _arg2:UV):UV{
if (_arg1 == null){
return (null);
};
if (_arg2 == null){
return (null);
};
return (new UV(((_arg1._u + _arg2._u) / 2), ((_arg1._v + _arg2._v) / 2)));
}
static function weighted(_arg1:UV, _arg2:UV, _arg3:Number, _arg4:Number):UV{
if (_arg1 == null){
return (null);
};
if (_arg2 == null){
return (null);
};
var _local5:Number = (_arg3 + _arg4);
var _local6:Number = (_arg3 / _local5);
var _local7:Number = (_arg4 / _local5);
return (new UV(((_arg1._u * _local6) + (_arg2._u * _local7)), ((_arg1._v * _local6) + (_arg2._v * _local7))));
}
}
}//package away3d.core.base
Section 22
//Vertex (away3d.core.base.Vertex)
package away3d.core.base {
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.math.*;
import away3d.core.utils.*;
public class Vertex extends ValueObject {
var _x:Number;
var _z:Number;
private var _position:Number3D;
var _y:Number;
public var extra:Object;
private var view:Matrix3D;
private var sz:Number;
private var persp:Number;
private var projectionTime:int;
private var projected:ScreenVertex;
public function Vertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
projected = new ScreenVertex();
_position = new Number3D();
super();
_x = (_position.x = _arg1);
_y = (_position.y = _arg2);
_z = (_position.z = _arg3);
}
function perspective(_arg1:Number):ScreenVertex{
persp = (1 / (1 + (_z / _arg1)));
return (new ScreenVertex((_x * persp), (_y * persp), z));
}
override public function toString():String{
return ((((((("new Vertex(" + _x) + ", ") + _y) + ", ") + z) + ")"));
}
public function set z(_arg1:Number):void{
if (_arg1 == _z){
return;
};
if (isNaN(_arg1)){
throw (new Error("isNaN(z)"));
};
if (_arg1 == Infinity){
Debug.warning("z == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("z == -Infinity");
};
_z = _arg1;
notifyChange();
}
public function get z():Number{
return (_z);
}
public function set position(_arg1:Number3D):void{
_x = (_position.x = _arg1.x);
_y = (_position.y = _arg1.y);
_z = (_position.z = _arg1.z);
notifyChange();
}
public function clone():Vertex{
return (new Vertex(_x, _y, _z));
}
public function project(_arg1:Projection):ScreenVertex{
if (projectionTime == _arg1.time){
return (projected);
};
projectionTime = _arg1.time;
view = _arg1.view;
sz = ((((_x * view.szx) + (_y * view.szy)) + (_z * view.szz)) + view.tz);
if (isNaN(sz)){
throw (new Error("isNaN(sz)"));
};
if ((sz * 2) <= -(_arg1.focus)){
projected.visible = false;
return (projected);
};
projected.visible = true;
persp = (_arg1.zoom / (1 + (sz / _arg1.focus)));
projected.x = (((((_x * view.sxx) + (_y * view.sxy)) + (_z * view.sxz)) + view.tx) * persp);
projected.y = (((((_x * view.syx) + (_y * view.syy)) + (_z * view.syz)) + view.ty) * persp);
projected.z = sz;
return (projected);
}
public function get position():Number3D{
_position.x = _x;
_position.y = _y;
_position.z = _z;
return (_position);
}
function transform(_arg1:Matrix3D):void{
setValue(((((_x * _arg1.sxx) + (_y * _arg1.sxy)) + (_z * _arg1.sxz)) + _arg1.tx), ((((_x * _arg1.syx) + (_y * _arg1.syy)) + (_z * _arg1.syz)) + _arg1.ty), ((((_x * _arg1.szx) + (_y * _arg1.szy)) + (_z * _arg1.szz)) + _arg1.tz));
}
function setValue(_arg1:Number, _arg2:Number, _arg3:Number):void{
_x = (_position.x = _arg1);
_y = (_position.y = _arg2);
_z = (_position.z = _arg3);
notifyChange();
}
public function set y(_arg1:Number):void{
if (_arg1 == _y){
return;
};
if (isNaN(_arg1)){
Debug.warning("isNaN(y)");
};
if (_arg1 == Infinity){
Debug.warning("y == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("y == -Infinity");
};
_y = _arg1;
notifyChange();
}
public function set x(_arg1:Number):void{
if (_arg1 == _x){
return;
};
if (isNaN(_arg1)){
Debug.warning("isNaN(x)");
};
if (_arg1 == Infinity){
Debug.warning("x == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("x == -Infinity");
};
_x = _arg1;
notifyChange();
}
public function get x():Number{
return (_x);
}
public function get y():Number{
return (_y);
}
static function median(_arg1:Vertex, _arg2:Vertex):Vertex{
return (new Vertex(((_arg1._x + _arg2._x) / 2), ((_arg1._y + _arg2._y) / 2), ((_arg1._z + _arg2._z) / 2)));
}
static function weighted(_arg1:Vertex, _arg2:Vertex, _arg3:Number, _arg4:Number):Vertex{
var _local5:Number = (_arg3 + _arg4);
var _local6:Number = (_arg3 / _local5);
var _local7:Number = (_arg4 / _local5);
return (new Vertex(((_arg1._x * _local6) + (_arg2._x * _local7)), ((_arg1._y * _local6) + (_arg2._y * _local7)), ((_arg1._z * _local6) + (_arg2._z * _local7))));
}
static function distanceSqr(_arg1:Vertex, _arg2:Vertex):Number{
return (((((_arg1._x + _arg2._x) * (_arg1._x + _arg2._x)) + ((_arg1._y + _arg2._y) * (_arg1._y + _arg2._y))) + ((_arg1._z + _arg2._z) * (_arg1._z + _arg2._z))));
}
}
}//package away3d.core.base
Section 23
//VertexPosition (away3d.core.base.VertexPosition)
package away3d.core.base {
public class VertexPosition {
public var x:Number;
public var y:Number;
public var z:Number;
public var vertex:Vertex;
public function VertexPosition(_arg1:Vertex){
this.vertex = _arg1;
this.x = 0;
this.y = 0;
this.z = 0;
}
public function adjust(_arg1:Number=1):void{
vertex._x = ((vertex._x * (1 - _arg1)) + (x * _arg1));
vertex._y = ((vertex._y * (1 - _arg1)) + (y * _arg1));
vertex._z = ((vertex._z * (1 - _arg1)) + (z * _arg1));
}
}
}//package away3d.core.base
Section 24
//WireMesh (away3d.core.base.WireMesh)
package away3d.core.base {
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.materials.*;
public class WireMesh extends BaseMesh implements IPrimitiveProvider {
public var material:ISegmentMaterial;
private var _segments:Array;
public function WireMesh(_arg1:Object=null){
_segments = [];
super(_arg1);
material = ini.getSegmentMaterial("material");
if (material == null){
material = new WireframeMaterial();
};
}
public function get segments():Array{
return (_segments);
}
public function addSegment(_arg1:Segment):void{
addElement(_arg1);
_segments.push(_arg1);
_arg1._ds.source = (_arg1.parent = this);
_arg1._ds.create = createDrawSegment;
}
public function removeSegment(_arg1:Segment):void{
var _local2:int = _segments.indexOf(_arg1);
if (_local2 == -1){
return;
};
removeElement(_arg1);
_segments.splice(_local2, 1);
}
override public function get elements():Array{
return (_segments);
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void{
var _local3:DrawSegment;
var _local4:Segment;
super.primitives(_arg1, _arg2);
for each (_local4 in _segments) {
_local3 = _local4._ds;
_local3.v0 = _local4._v0.project(projection);
_local3.v1 = _local4._v1.project(projection);
if (!_local3.v0.visible){
} else {
if (!_local3.v1.visible){
} else {
_local3.calc();
if (_local3.maxZ < 0){
} else {
_local3.material = ((_local4.material) || (material));
if (_local3.material == null){
} else {
if (!_local3.material.visible){
} else {
_local3.projection = projection;
_arg1.primitive(_local3);
};
};
};
};
};
};
}
}
}//package away3d.core.base
Section 25
//Blocker (away3d.core.block.Blocker)
package away3d.core.block {
import away3d.core.draw.*;
public class Blocker extends DrawPrimitive {
public function block(_arg1:DrawPrimitive):Boolean{
return (false);
}
}
}//package away3d.core.block
Section 26
//BlockerArray (away3d.core.block.BlockerArray)
package away3d.core.block {
import away3d.core.clip.*;
public class BlockerArray implements IBlockerConsumer {
private var _clip:Clipping;
private var _blockers:Array;
private var blockers:Array;
public function set clip(_arg1:Clipping):void{
_clip = _arg1;
_blockers = [];
}
public function blocker(_arg1:Blocker):void{
if (_clip.check(_arg1)){
_blockers.push(_arg1);
};
}
public function get clip():Clipping{
return (_clip);
}
public function list():Array{
_blockers.sortOn("screenZ", Array.NUMERIC);
return (_blockers);
}
}
}//package away3d.core.block
Section 27
//IBlockerConsumer (away3d.core.block.IBlockerConsumer)
package away3d.core.block {
public interface IBlockerConsumer {
function blocker(_arg1:Blocker):void;
}
}//package away3d.core.block
Section 28
//IBlockerProvider (away3d.core.block.IBlockerProvider)
package away3d.core.block {
public interface IBlockerProvider {
function blockers(_arg1:IBlockerConsumer):void;
}
}//package away3d.core.block
Section 29
//Clipping (away3d.core.clip.Clipping)
package away3d.core.clip {
import flash.display.*;
import flash.geom.*;
import away3d.core.draw.*;
public class Clipping {
public var minX:Number;// = -1000000
public var minY:Number;// = -1000000
private var zeroPoint:Point;
private var globalPoint:Point;
private var rectangleClipping:RectangleClipping;
public var maxX:Number;// = 1000000
public var maxY:Number;// = 1000000
public function Clipping(){
zeroPoint = new Point(0, 0);
super();
}
public function rect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Boolean{
return (true);
}
public function screen(_arg1:Sprite):Clipping{
if (!rectangleClipping){
rectangleClipping = new RectangleClipping();
};
switch (_arg1.stage.align){
case StageAlign.TOP_LEFT:
zeroPoint.x = 0;
zeroPoint.y = 0;
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.maxX = ((rectangleClipping.minX = globalPoint.x) + _arg1.stage.stageWidth);
rectangleClipping.maxY = ((rectangleClipping.minY = globalPoint.y) + _arg1.stage.stageHeight);
break;
case StageAlign.TOP_RIGHT:
zeroPoint.x = _arg1.stage.stageWidth;
zeroPoint.y = 0;
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.minX = ((rectangleClipping.maxX = globalPoint.x) - _arg1.stage.stageWidth);
rectangleClipping.maxY = ((rectangleClipping.minY = globalPoint.y) + _arg1.stage.stageHeight);
break;
case StageAlign.BOTTOM_LEFT:
zeroPoint.x = 0;
zeroPoint.y = _arg1.stage.stageHeight;
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.maxX = ((rectangleClipping.minX = globalPoint.x) + _arg1.stage.stageWidth);
rectangleClipping.minY = ((rectangleClipping.maxY = globalPoint.y) - _arg1.stage.stageHeight);
break;
case StageAlign.BOTTOM_RIGHT:
zeroPoint.x = _arg1.stage.stageWidth;
zeroPoint.y = _arg1.stage.stageHeight;
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.minX = ((rectangleClipping.maxX = globalPoint.x) - _arg1.stage.stageWidth);
rectangleClipping.minY = ((rectangleClipping.maxY = globalPoint.y) - _arg1.stage.stageHeight);
break;
case StageAlign.TOP:
zeroPoint.x = (_arg1.stage.stageWidth / 2);
zeroPoint.y = 0;
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.minX = (globalPoint.x - (_arg1.stage.stageWidth / 2));
rectangleClipping.maxX = (globalPoint.x + (_arg1.stage.stageWidth / 2));
rectangleClipping.maxY = ((rectangleClipping.minY = globalPoint.y) + _arg1.stage.stageHeight);
break;
case StageAlign.BOTTOM:
zeroPoint.x = (_arg1.stage.stageWidth / 2);
zeroPoint.y = _arg1.stage.stageHeight;
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.minX = (globalPoint.x - (_arg1.stage.stageWidth / 2));
rectangleClipping.maxX = (globalPoint.x + (_arg1.stage.stageWidth / 2));
rectangleClipping.minY = ((rectangleClipping.maxY = globalPoint.y) - _arg1.stage.stageHeight);
break;
case StageAlign.LEFT:
zeroPoint.x = 0;
zeroPoint.y = (_arg1.stage.stageHeight / 2);
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.maxX = ((rectangleClipping.minX = globalPoint.x) + _arg1.stage.stageWidth);
rectangleClipping.minY = (globalPoint.y - (_arg1.stage.stageHeight / 2));
rectangleClipping.maxY = (globalPoint.y + (_arg1.stage.stageHeight / 2));
break;
case StageAlign.RIGHT:
zeroPoint.x = _arg1.stage.stageWidth;
zeroPoint.y = (_arg1.stage.stageHeight / 2);
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.minX = ((rectangleClipping.maxX = globalPoint.x) - _arg1.stage.stageWidth);
rectangleClipping.minY = (globalPoint.y - (_arg1.stage.stageHeight / 2));
rectangleClipping.maxY = (globalPoint.y + (_arg1.stage.stageHeight / 2));
break;
default:
zeroPoint.x = (_arg1.stage.stageWidth / 2);
zeroPoint.y = (_arg1.stage.stageHeight / 2);
globalPoint = _arg1.globalToLocal(zeroPoint);
rectangleClipping.minX = (globalPoint.x - (_arg1.stage.stageWidth / 2));
rectangleClipping.maxX = (globalPoint.x + (_arg1.stage.stageWidth / 2));
rectangleClipping.minY = (globalPoint.y - (_arg1.stage.stageHeight / 2));
rectangleClipping.maxY = (globalPoint.y + (_arg1.stage.stageHeight / 2));
};
return (rectangleClipping);
}
public function check(_arg1:DrawPrimitive):Boolean{
return (true);
}
public function asRectangleClipping():RectangleClipping{
if (!rectangleClipping){
rectangleClipping = new RectangleClipping();
};
rectangleClipping.minX = -1000000;
rectangleClipping.minY = -1000000;
rectangleClipping.maxX = 1000000;
rectangleClipping.maxY = 1000000;
return (rectangleClipping);
}
}
}//package away3d.core.clip
Section 30
//RectangleClipping (away3d.core.clip.RectangleClipping)
package away3d.core.clip {
import away3d.core.draw.*;
public class RectangleClipping extends Clipping {
public function RectangleClipping(_arg1:Number=-1000000, _arg2:Number=-1000000, _arg3:Number=1000000, _arg4:Number=1000000){
this.minX = _arg1;
this.maxX = _arg3;
this.minY = _arg2;
this.maxY = _arg4;
}
override public function check(_arg1:DrawPrimitive):Boolean{
if (_arg1.maxX < minX){
return (false);
};
if (_arg1.minX > maxX){
return (false);
};
if (_arg1.maxY < minY){
return (false);
};
if (_arg1.minY > maxY){
return (false);
};
return (true);
}
override public function rect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Boolean{
if (this.maxX < _arg1){
return (false);
};
if (this.minX > _arg3){
return (false);
};
if (this.maxY < _arg2){
return (false);
};
if (this.minY > _arg4){
return (false);
};
return (true);
}
public function toString():String{
return ((((((((("{minX:" + minX) + " maxX:") + maxX) + " minY:") + minY) + " maxY:") + maxY) + "}"));
}
override public function asRectangleClipping():RectangleClipping{
return (this);
}
}
}//package away3d.core.clip
Section 31
//DrawDisplayObject (away3d.core.draw.DrawDisplayObject)
package away3d.core.draw {
import flash.display.*;
import away3d.core.render.*;
public class DrawDisplayObject extends DrawPrimitive {
public var screenvertex:ScreenVertex;
public var displayobject:DisplayObject;
public var session:AbstractRenderSession;
override public function calc():void{
screenZ = screenvertex.z;
minZ = screenZ;
maxZ = screenZ;
minX = (screenvertex.x - (displayobject.width / 2));
minY = (screenvertex.y - (displayobject.height / 2));
maxX = (screenvertex.x + (displayobject.width / 2));
maxY = (screenvertex.y + (displayobject.height / 2));
}
override public function clear():void{
displayobject = null;
}
override public function render():void{
displayobject.x = screenvertex.x;
displayobject.y = screenvertex.y;
session.addDisplayObject(displayobject);
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
return (true);
}
}
}//package away3d.core.draw
Section 32
//DrawFog (away3d.core.draw.DrawFog)
package away3d.core.draw {
import away3d.materials.*;
public class DrawFog extends DrawPrimitive {
public var material:IFogMaterial;
override public function render():void{
material.renderFog(this);
}
}
}//package away3d.core.draw
Section 33
//DrawPrimitive (away3d.core.draw.DrawPrimitive)
package away3d.core.draw {
import away3d.core.render.*;
import away3d.core.base.*;
public class DrawPrimitive {
public var quadrant:PrimitiveQuadrantTreeNode;
public var minX:Number;
public var minY:Number;
public var minZ:Number;
public var projection:Projection;
public var source:Object3D;
public var screenZ:Number;
public var maxX:Number;
public var maxY:Number;
public var create:Function;
public var maxZ:Number;
public function getZ(_arg1:Number, _arg2:Number):Number{
return (screenZ);
}
public function clear():void{
throw (new Error("Not implemented"));
}
public function calc():void{
throw (new Error("Not implemented"));
}
public function render():void{
throw (new Error("Not implemented"));
}
public function contains(_arg1:Number, _arg2:Number):Boolean{
throw (new Error("Not implemented"));
}
public function quarter(_arg1:Number):Array{
throw (new Error("Not implemented"));
}
public function toString():String{
return ((((((("P{ screenZ = " + screenZ) + ", minZ = ") + minZ) + ", maxZ = ") + maxZ) + " }"));
}
}
}//package away3d.core.draw
Section 34
//DrawScaledBitmap (away3d.core.draw.DrawScaledBitmap)
package away3d.core.draw {
import flash.display.*;
import flash.geom.*;
public class DrawScaledBitmap extends DrawPrimitive {
private var cosh:Number;
public var rotation:Number;
private var width:Number;
var left:ScreenVertex;
public var scale:Number;
private var cosw:Number;
var bottomright:ScreenVertex;
private var cos:Number;
private var sinh:Number;
private var sin:Number;
var top:ScreenVertex;
private var sinw:Number;
var topleft:ScreenVertex;
private var mapping:Matrix;
public var screenvertex:ScreenVertex;
var topright:ScreenVertex;
public var bitmap:BitmapData;
var bottomleft:ScreenVertex;
private var bounds:ScreenVertex;
private var height:Number;
public var smooth:Boolean;
public function DrawScaledBitmap(){
topleft = new ScreenVertex();
topright = new ScreenVertex();
bottomleft = new ScreenVertex();
bottomright = new ScreenVertex();
left = new ScreenVertex();
top = new ScreenVertex();
mapping = new Matrix();
super();
}
override public function render():void{
source.session.renderScaledBitmap(this, bitmap, mapping, smooth);
}
override public function clear():void{
bitmap = null;
}
override public function calc():void{
var _local1:Array;
screenZ = screenvertex.z;
minZ = screenZ;
maxZ = screenZ;
width = (bitmap.width * scale);
height = (bitmap.height * scale);
if (rotation != 0){
cos = Math.cos(((rotation * Math.PI) / 180));
sin = Math.sin(((rotation * Math.PI) / 180));
cosw = ((cos * width) / 2);
cosh = ((cos * height) / 2);
sinw = ((sin * width) / 2);
sinh = ((sin * height) / 2);
topleft.x = ((screenvertex.x - cosw) - sinh);
topleft.y = ((screenvertex.y + sinw) - cosh);
topright.x = ((screenvertex.x + cosw) - sinh);
topright.y = ((screenvertex.y - sinw) - cosh);
bottomleft.x = ((screenvertex.x - cosw) + sinh);
bottomleft.y = ((screenvertex.y + sinw) + cosh);
bottomright.x = ((screenvertex.x + cosw) + sinh);
bottomright.y = ((screenvertex.y - sinw) + cosh);
_local1 = new Array();
_local1.push(topleft);
_local1.push(topright);
_local1.push(bottomleft);
_local1.push(bottomright);
minX = 100000;
minY = 100000;
maxX = -100000;
maxY = -100000;
for each (bounds in _local1) {
if (minX > bounds.x){
minX = bounds.x;
};
if (maxX < bounds.x){
maxX = bounds.x;
};
if (minY > bounds.y){
minY = bounds.y;
};
if (maxY < bounds.y){
maxY = bounds.y;
};
};
mapping.a = (scale * cos);
mapping.b = (-(scale) * sin);
mapping.c = (scale * sin);
mapping.d = (scale * cos);
mapping.tx = topleft.x;
mapping.ty = topleft.y;
} else {
topleft.x = (screenvertex.x - (width / 2));
topleft.y = (screenvertex.y - (height / 2));
topright.x = (topleft.x + width);
topright.y = topleft.y;
bottomleft.x = topleft.x;
bottomleft.y = (topleft.y + height);
bottomright.x = topright.x;
bottomright.y = bottomleft.y;
minX = topleft.x;
minY = topleft.y;
maxX = bottomright.x;
maxY = bottomright.y;
mapping.a = (mapping.d = scale);
mapping.c = (mapping.b = 0);
mapping.tx = topleft.x;
mapping.ty = topleft.y;
};
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
if (rotation != 0){
if ((((topleft.x * (_arg2 - topright.y)) + (topright.x * (topleft.y - _arg2))) + (_arg1 * (topright.y - topleft.y))) > 0.001){
return (false);
};
if ((((topright.x * (_arg2 - bottomright.y)) + (bottomright.x * (topright.y - _arg2))) + (_arg1 * (bottomright.y - topright.y))) > 0.001){
return (false);
};
if ((((bottomright.x * (_arg2 - bottomleft.y)) + (bottomleft.x * (bottomright.y - _arg2))) + (_arg1 * (bottomleft.y - bottomright.y))) > 0.001){
return (false);
};
if ((((bottomleft.x * (_arg2 - topleft.y)) + (topleft.x * (bottomleft.y - _arg2))) + (_arg1 * (topleft.y - bottomleft.y))) > 0.001){
return (false);
};
};
if (!bitmap.transparent){
return (true);
};
mapping = new Matrix((scale * cos), (-(scale) * sin), (scale * sin), (scale * cos), topleft.x, topleft.y);
mapping.invert();
var _local3:Point = mapping.transformPoint(new Point(_arg1, _arg2));
if (_local3.x < 0){
_local3.x = 0;
};
if (_local3.y < 0){
_local3.y = 0;
};
if (_local3.x >= bitmap.width){
_local3.x = (bitmap.width - 1);
};
if (_local3.y >= bitmap.height){
_local3.y = (bitmap.height - 1);
};
var _local4:uint = bitmap.getPixel32(int(_local3.x), int(_local3.y));
return ((uint((_local4 >> 24)) > 128));
}
}
}//package away3d.core.draw
Section 35
//DrawSegment (away3d.core.draw.DrawSegment)
package away3d.core.draw {
import away3d.materials.*;
public class DrawSegment extends DrawPrimitive {
public var v0:ScreenVertex;
private var bzf:Number;
private var axf:Number;
private var det:Number;
private var dx:Number;
private var dy:Number;
private var faz:Number;
public var material:ISegmentMaterial;
private var ayf:Number;
private var ax:Number;
private var ay:Number;
private var az:Number;
private var fbz:Number;
private var azf:Number;
private var bxf:Number;
private var bx:Number;
private var by:Number;
private var bz:Number;
private var focus:Number;
private var xfocus:Number;
public var length:Number;
private var byf:Number;
public var v1:ScreenVertex;
private var da:Number;
private var db:Number;
private var yfocus:Number;
override public function render():void{
material.renderSegment(this);
}
function onepointcut(_arg1:ScreenVertex):Array{
return ([create(material, projection, v0, _arg1), create(material, projection, _arg1, v1)]);
}
override public function quarter(_arg1:Number):Array{
if (length < 5){
return (null);
};
var _local2:ScreenVertex = ScreenVertex.median(v0, v1, _arg1);
return ([create(material, projection, v0, _local2), create(material, projection, _local2, v1)]);
}
override public function contains(_arg1:Number, _arg2:Number):Boolean{
if (Math.abs((((v0.x * (_arg2 - v1.y)) + (v1.x * (v0.y - _arg2))) + (_arg1 * (v1.y - v0.y)))) > ((0.001 * 1000) * 1000)){
return (false);
};
if ((distanceToCenter(_arg1, _arg2) * 2) > length){
return (false);
};
return (true);
}
override public function getZ(_arg1:Number, _arg2:Number):Number{
if (projection == null){
return (screenZ);
};
focus = projection.focus;
ax = v0.x;
ay = v0.y;
az = v0.z;
bx = v1.x;
by = v1.y;
bz = v1.z;
if ((((ax == _arg1)) && ((ay == _arg2)))){
return (az);
};
if ((((bx == _arg1)) && ((by == _arg2)))){
return (bz);
};
dx = (bx - ax);
dy = (by - ay);
azf = (az / focus);
bzf = (bz / focus);
faz = (1 + azf);
fbz = (1 + bzf);
xfocus = _arg1;
yfocus = _arg2;
axf = ((ax * faz) - (_arg1 * azf));
bxf = ((bx * fbz) - (_arg1 * bzf));
ayf = ((ay * faz) - (_arg2 * azf));
byf = ((by * fbz) - (_arg2 * bzf));
det = ((dx * (axf - bxf)) + (dy * (ayf - byf)));
db = ((dx * (axf - _arg1)) + (dy * (ayf - _arg2)));
da = ((dx * (_arg1 - bxf)) + (dy * (_arg2 - byf)));
return ((((da * az) + (db * bz)) / det));
}
private function distanceToCenter(_arg1:Number, _arg2:Number):Number{
var _local3:Number = ((v0.x + v1.x) / 2);
var _local4:Number = ((v0.y + v1.y) / 2);
return (Math.sqrt((((_local3 - _arg1) * (_local3 - _arg1)) + ((_local4 - _arg2) * (_local4 - _arg2)))));
}
override public function clear():void{
v0 = null;
v1 = null;
}
override public function calc():void{
if (v0.z < v1.z){
minZ = v0.z;
maxZ = (v1.z + 1);
} else {
minZ = v1.z;
maxZ = (v0.z + 1);
};
screenZ = ((v0.z + v1.z) / 2);
if (v0.x < v1.x){
minX = v0.x;
maxX = (v1.x + 1);
} else {
minX = v1.x;
maxX = (v0.x + 1);
};
if (v0.y < v1.y){
minY = v0.y;
maxY = (v1.y + 1);
} else {
minY = v1.y;
maxY = (v0.y + 1);
};
length = Math.sqrt((((maxX - minX) * (maxX - minX)) + ((maxY - minY) * (maxY - minY))));
}
override public function toString():String{
return ((((((("S{ screenZ = " + screenZ) + ", minZ = ") + minZ) + ", maxZ = ") + maxZ) + " }"));
}
}
}//package away3d.core.draw
Section 36
//DrawTriangle (away3d.core.draw.DrawTriangle)
package away3d.core.draw {
import flash.geom.*;
import away3d.core.base.*;
import away3d.materials.*;
public class DrawTriangle extends DrawPrimitive {
private var _u0:Number;
private var _u2:Number;
private var bzf:Number;
private var axf:Number;
private var det:Number;
private var v12:ScreenVertex;
private var _v0:Number;
private var _v1:Number;
private var _v2:Number;
private var faz:Number;
public var material:ITriangleMaterial;
private var materialHeight:Number;
private var av:Number;
private var ax:Number;
private var ay:Number;
private var az:Number;
private var ayf:Number;
private var au:Number;
private var fbz:Number;
private var v20:ScreenVertex;
private var azf:Number;
private var bu:Number;
private var bv:Number;
private var bx:Number;
private var by:Number;
private var bz:Number;
public var texturemapping:Matrix;
private var fcz:Number;
private var uv01:UV;
private var d01:Number;
public var face:Face;
private var cv:Number;
private var cx:Number;
private var cy:Number;
private var cz:Number;
private var cu:Number;
public var v0:ScreenVertex;
public var v1:ScreenVertex;
private var da:Number;
private var db:Number;
private var dc:Number;
private var dd01:Number;
private var uv12:UV;
public var invtexturemapping:Matrix;
private var d12:Number;
public var area:Number;
private var cxf:Number;
public var v2:ScreenVertex;
private var uv20:UV;
private var dd12:Number;
private var d20:Number;
public var uv0:UV;
public var uv2:UV;
private var dd20:Number;
private var cyf:Number;
public var backface:Boolean;// = false
private var czf:Number;
private var bxf:Number;
public var uv1:UV;
private var focus:Number;
private var materialWidth:Number;
private var byf:Number;
private var v01:ScreenVertex;
private var _u1:Number;
final public function transformUV(_arg1:IUVMaterial):Matrix{
materialWidth = _arg1.width;
materialHeight = _arg1.height;
if ((((((uv0 == null)) || ((uv1 == null)))) || ((uv2 == null)))){
return (null);
};
_u0 = (materialWidth * uv0._u);
_u1 = (materialWidth * uv1._u);
_u2 = (materialWidth * uv2._u);
_v0 = (materialHeight * (1 - uv0._v));
_v1 = (materialHeight * (1 - uv1._v));
_v2 = (materialHeight * (1 - uv2._v));
if ((((((_u0 == _u1)) && ((_v0 == _v1)))) || ((((_u0 == _u2)) && ((_v0 == _v2)))))){
if (_u0 > 0.05){
_u0 = (_u0 - 0.05);
} else {
_u0 = (_u0 + 0.05);
};
if (_v0 > 0.07){
_v0 = (_v0 - 0.07);
} else {
_v0 = (_v0 + 0.07);
};
};
if ((((_u2 == _u1)) && ((_v2 == _v1)))){
if (_u2 > 0.04){
_u2 = (_u2 - 0.04);
} else {
_u2 = (_u2 + 0.04);
};
if (_v2 > 0.06){
_v2 = (_v2 - 0.06);
} else {
_v2 = (_v2 + 0.06);
};
};
if ((_arg1 is BitmapMaterialContainer)){
invtexturemapping = new Matrix((_u1 - _u0), (_v1 - _v0), (_u2 - _u0), (_v2 - _v0), (_u0 - face.bitmapRect.x), (_v0 - face.bitmapRect.y));
texturemapping = invtexturemapping.clone();
texturemapping.invert();
return (texturemapping);
};
texturemapping = new Matrix((_u1 - _u0), (_v1 - _v0), (_u2 - _u0), (_v2 - _v0), _u0, _v0);
texturemapping.invert();
return (texturemapping);
}
final function bisect(_arg1:Number):Array{
d01 = v0.distanceSqr(v1);
d12 = v1.distanceSqr(v2);
d20 = v2.distanceSqr(v0);
if ((((d12 >= d01)) && ((d12 >= d20)))){
return (bisect12(_arg1));
};
if (d01 >= d20){
return (bisect01(_arg1));
};
return (bisect20(_arg1));
}
final function minEdgeSqr():Number{
return (Math.min(Math.min(v0.distanceSqr(v1), v1.distanceSqr(v2)), v2.distanceSqr(v0)));
}
final function minDistortSqr(_arg1:Number):Number{
return (Math.min(Math.min(v0.distortSqr(v1, _arg1), v1.distortSqr(v2, _arg1)), v2.distortSqr(v0, _arg1)));
}
final override public function contains(_arg1:Number, _arg2:Number):Boolean{
if ((((v0.x * (_arg2 - v1.y)) + (v1.x * (v0.y - _arg2))) + (_arg1 * (v1.y - v0.y))) < -0.001){
return (false);
};
if ((((v0.x * (v2.y - _arg2)) + (_arg1 * (v0.y - v2.y))) + (v2.x * (_arg2 - v0.y))) < -0.001){
return (false);
};
if ((((_arg1 * (v2.y - v1.y)) + (v1.x * (_arg2 - v2.y))) + (v2.x * (v1.y - _arg2))) < -0.001){
return (false);
};
return (true);
}
final function distortbisect(_arg1:Number):Array{
d01 = v0.distortSqr(v1, _arg1);
d12 = v1.distortSqr(v2, _arg1);
d20 = v2.distortSqr(v0, _arg1);
if ((((d12 >= d01)) && ((d12 >= d20)))){
return (bisect12(_arg1));
};
if (d01 >= d20){
return (bisect01(_arg1));
};
return (bisect20(_arg1));
}
function fivepointcut(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:ScreenVertex, _arg4:ScreenVertex, _arg5:ScreenVertex, _arg6:UV, _arg7:UV, _arg8:UV, _arg9:UV, _arg10:UV):Array{
if (_arg1.distanceSqr(_arg4) < _arg2.distanceSqr(_arg5)){
return ([create(face, material, projection, _arg1, _arg2, _arg4, _arg6, _arg7, _arg9), create(face, material, projection, _arg2, _arg3, _arg4, _arg7, _arg8, _arg9), create(face, material, projection, _arg1, _arg4, _arg5, _arg6, _arg9, _arg10)]);
};
return ([create(face, material, projection, _arg1, _arg2, _arg5, _arg6, _arg7, _arg10), create(face, material, projection, _arg2, _arg3, _arg4, _arg7, _arg8, _arg9), create(face, material, projection, _arg2, _arg4, _arg5, _arg7, _arg9, _arg10)]);
}
final function acuteAngled():Boolean{
d01 = v0.distanceSqr(v1);
d12 = v1.distanceSqr(v2);
d20 = v2.distanceSqr(v0);
dd01 = (d01 * d01);
dd12 = (d12 * d12);
dd20 = (d20 * d20);
return ((((((dd01 <= (dd12 + dd20))) && ((dd12 <= (dd20 + dd01))))) && ((dd20 <= (dd01 + dd12)))));
}
private function num(_arg1:Number):Number{
return ((int((_arg1 * 1000)) / 1000));
}
final private function bisect01(_arg1:Number):Array{
var _local2:ScreenVertex = ScreenVertex.median(v0, v1, _arg1);
var _local3:UV = UV.median(uv0, uv1);
return ([create(face, material, projection, v2, v0, _local2, uv2, uv0, _local3), create(face, material, projection, _local2, v1, v2, _local3, uv1, uv2)]);
}
override public function calc():void{
if (v0.x > v1.x){
if (v0.x > v2.x){
maxX = v0.x;
} else {
maxX = v2.x;
};
} else {
if (v1.x > v2.x){
maxX = v1.x;
} else {
maxX = v2.x;
};
};
if (v0.x < v1.x){
if (v0.x < v2.x){
minX = v0.x;
} else {
minX = v2.x;
};
} else {
if (v1.x < v2.x){
minX = v1.x;
} else {
minX = v2.x;
};
};
if (v0.y > v1.y){
if (v0.y > v2.y){
maxY = v0.y;
} else {
maxY = v2.y;
};
} else {
if (v1.y > v2.y){
maxY = v1.y;
} else {
maxY = v2.y;
};
};
if (v0.y < v1.y){
if (v0.y < v2.y){
minY = v0.y;
} else {
minY = v2.y;
};
} else {
if (v1.y < v2.y){
minY = v1.y;
} else {
minY = v2.y;
};
};
if (v0.z > v1.z){
if (v0.z > v2.z){
maxZ = v0.z;
} else {
maxZ = v2.z;
};
} else {
if (v1.z > v2.z){
maxZ = v1.z;
} else {
maxZ = v2.z;
};
};
if (v0.z < v1.z){
if (v0.z < v2.z){
minZ = v0.z;
} else {
minZ = v2.z;
};
} else {
if (v1.z < v2.z){
minZ = v1.z;
} else {
minZ = v2.z;
};
};
screenZ = (((v0.z + v1.z) + v2.z) / 3);
area = (0.5 * (((v0.x * (v2.y - v1.y)) + (v1.x * (v0.y - v2.y))) + (v2.x * (v1.y - v0.y))));
}
public function getUV(_arg1:Number, _arg2:Number):UV{
if (uv0 == null){
return (null);
};
if (uv1 == null){
return (null);
};
if (uv2 == null){
return (null);
};
au = uv0._u;
av = uv0._v;
bu = uv1._u;
bv = uv1._v;
cu = uv2._u;
cv = uv2._v;
focus = projection.focus;
ax = v0.x;
ay = v0.y;
az = v0.z;
bx = v1.x;
by = v1.y;
bz = v1.z;
cx = v2.x;
cy = v2.y;
cz = v2.z;
if ((((ax == _arg1)) && ((ay == _arg2)))){
return (uv0);
};
if ((((bx == _arg1)) && ((by == _arg2)))){
return (uv1);
};
if ((((cx == _arg1)) && ((cy == _arg2)))){
return (uv2);
};
azf = (az / focus);
bzf = (bz / focus);
czf = (cz / focus);
faz = (1 + azf);
fbz = (1 + bzf);
fcz = (1 + czf);
axf = ((ax * faz) - (_arg1 * azf));
bxf = ((bx * fbz) - (_arg1 * bzf));
cxf = ((cx * fcz) - (_arg1 * czf));
ayf = ((ay * faz) - (_arg2 * azf));
byf = ((by * fbz) - (_arg2 * bzf));
cyf = ((cy * fcz) - (_arg2 * czf));
det = (((axf * (byf - cyf)) + (bxf * (cyf - ayf))) + (cxf * (ayf - byf)));
da = (((_arg1 * (byf - cyf)) + (bxf * (cyf - _arg2))) + (cxf * (_arg2 - byf)));
db = (((axf * (_arg2 - cyf)) + (_arg1 * (cyf - ayf))) + (cxf * (ayf - _arg2)));
dc = (((axf * (byf - _arg2)) + (bxf * (_arg2 - ayf))) + (_arg1 * (ayf - byf)));
return (new UV(((((da * au) + (db * bu)) + (dc * cu)) / det), ((((da * av) + (db * bv)) + (dc * cv)) / det)));
}
override public function clear():void{
v0 = null;
v1 = null;
v2 = null;
uv0 = null;
uv1 = null;
uv2 = null;
texturemapping = null;
}
override public function render():void{
material.renderTriangle(this);
}
override public function toString():String{
var _local1 = "";
if ((material is WireColorMaterial)){
switch ((material as WireColorMaterial).color){
case 0xFF00:
_local1 = "green";
break;
case 0xFFFF00:
_local1 = "yellow";
break;
case 0xFF0000:
_local1 = "red";
break;
case 0xFF:
_local1 = "blue";
break;
};
};
return (((((((((("T{" + _local1) + int(area)) + " screenZ = ") + num(screenZ)) + ", minZ = ") + num(minZ)) + ", maxZ = ") + num(maxZ)) + " }"));
}
final private function bisect12(_arg1:Number):Array{
var _local2:ScreenVertex = ScreenVertex.median(v1, v2, _arg1);
var _local3:UV = UV.median(uv1, uv2);
return ([create(face, material, projection, v0, v1, _local2, uv0, uv1, _local3), create(face, material, projection, _local2, v2, v0, _local3, uv2, uv0)]);
}
final override public function quarter(_arg1:Number):Array{
if (area < 20){
return (null);
};
v01 = ScreenVertex.median(v0, v1, _arg1);
v12 = ScreenVertex.median(v1, v2, _arg1);
v20 = ScreenVertex.median(v2, v0, _arg1);
uv01 = UV.median(uv0, uv1);
uv12 = UV.median(uv1, uv2);
uv20 = UV.median(uv2, uv0);
return ([create(face, material, projection, v0, v01, v20, uv0, uv01, uv20), create(face, material, projection, v1, v12, v01, uv1, uv12, uv01), create(face, material, projection, v2, v20, v12, uv2, uv20, uv12), create(face, material, projection, v01, v12, v20, uv01, uv12, uv20)]);
}
final private function bisect20(_arg1:Number):Array{
var _local2:ScreenVertex = ScreenVertex.median(v2, v0, _arg1);
var _local3:UV = UV.median(uv2, uv0);
return ([create(face, material, projection, v1, v2, _local2, uv1, uv2, _local3), create(face, material, projection, _local2, v0, v1, _local3, uv0, uv1)]);
}
final public function distanceToCenter(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (((v0.x + v1.x) + v2.x) / 3);
var _local4:Number = (((v0.y + v1.y) + v2.y) / 3);
return (Math.sqrt((((_local3 - _arg1) * (_local3 - _arg1)) + ((_local4 - _arg2) * (_local4 - _arg2)))));
}
final function maxDistortSqr(_arg1:Number):Number{
return (Math.max(Math.max(v0.distortSqr(v1, _arg1), v1.distortSqr(v2, _arg1)), v2.distortSqr(v0, _arg1)));
}
final function maxEdgeSqr():Number{
return (Math.max(Math.max(v0.distanceSqr(v1), v1.distanceSqr(v2)), v2.distanceSqr(v0)));
}
final override public function getZ(_arg1:Number, _arg2:Number):Number{
if (projection == null){
return (screenZ);
};
focus = projection.focus;
ax = v0.x;
ay = v0.y;
az = v0.z;
bx = v1.x;
by = v1.y;
bz = v1.z;
cx = v2.x;
cy = v2.y;
cz = v2.z;
if ((((ax == _arg1)) && ((ay == _arg2)))){
return (az);
};
if ((((bx == _arg1)) && ((by == _arg2)))){
return (bz);
};
if ((((cx == _arg1)) && ((cy == _arg2)))){
return (cz);
};
azf = (az / focus);
bzf = (bz / focus);
czf = (cz / focus);
faz = (1 + azf);
fbz = (1 + bzf);
fcz = (1 + czf);
axf = ((ax * faz) - (_arg1 * azf));
bxf = ((bx * fbz) - (_arg1 * bzf));
cxf = ((cx * fcz) - (_arg1 * czf));
ayf = ((ay * faz) - (_arg2 * azf));
byf = ((by * fbz) - (_arg2 * bzf));
cyf = ((cy * fcz) - (_arg2 * czf));
det = (((axf * (byf - cyf)) + (bxf * (cyf - ayf))) + (cxf * (ayf - byf)));
da = (((_arg1 * (byf - cyf)) + (bxf * (cyf - _arg2))) + (cxf * (_arg2 - byf)));
db = (((axf * (_arg2 - cyf)) + (_arg1 * (cyf - ayf))) + (cxf * (ayf - _arg2)));
dc = (((axf * (byf - _arg2)) + (bxf * (_arg2 - ayf))) + (_arg1 * (ayf - byf)));
return (((((da * az) + (db * bz)) + (dc * cz)) / det));
}
}
}//package away3d.core.draw
Section 37
//IPrimitiveConsumer (away3d.core.draw.IPrimitiveConsumer)
package away3d.core.draw {
public interface IPrimitiveConsumer {
function primitive(_arg1:DrawPrimitive):void;
}
}//package away3d.core.draw
Section 38
//IPrimitiveProvider (away3d.core.draw.IPrimitiveProvider)
package away3d.core.draw {
import away3d.core.render.*;
public interface IPrimitiveProvider {
function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void;
}
}//package away3d.core.draw
Section 39
//PrimitiveArray (away3d.core.draw.PrimitiveArray)
package away3d.core.draw {
import away3d.core.clip.*;
import away3d.core.block.*;
public class PrimitiveArray implements IPrimitiveConsumer {
private var _primitives:Array;
private var _clip:Clipping;
private var _blockers:Array;
public function set clip(_arg1:Clipping):void{
_clip = _arg1;
_primitives = [];
}
public function primitive(_arg1:DrawPrimitive):void{
var _local2:int;
var _local3:int;
var _local4:Blocker;
if (_clip.check(_arg1)){
_local2 = _blockers.length;
_local3 = 0;
while (_local3 < _local2) {
_local4 = _blockers[_local3];
if (_local4.screenZ > _arg1.minZ){
break;
};
if (_local4.block(_arg1)){
return;
};
_local3++;
};
_primitives.push(_arg1);
};
}
public function set blockers(_arg1:Array):void{
_blockers = _arg1;
}
public function list():Array{
return (_primitives);
}
}
}//package away3d.core.draw
Section 40
//PrimitiveQuadrantTreeNode (away3d.core.draw.PrimitiveQuadrantTreeNode)
package away3d.core.draw {
import away3d.core.base.*;
public final class PrimitiveQuadrantTreeNode {
public var parent:PrimitiveQuadrantTreeNode;
public var create:Function;
private var level:int;
public var righttopFlag:Boolean;
public var rightbottom:PrimitiveQuadrantTreeNode;
public var righttop:PrimitiveQuadrantTreeNode;
public var rightbottomFlag:Boolean;
public var onlysource:Object3D;
public var xdiv:Number;
private var halfheight:Number;
public var center:Array;
private var maxlevel:int;// = 4
private var render_center_length:int;// = -1
public var onlysourceFlag:Boolean;// = true
private var render_center_index:int;// = -1
private var halfwidth:Number;
public var lefttop:PrimitiveQuadrantTreeNode;
public var ydiv:Number;
public var leftbottom:PrimitiveQuadrantTreeNode;
public var lefttopFlag:Boolean;
public var leftbottomFlag:Boolean;
public function PrimitiveQuadrantTreeNode(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:PrimitiveQuadrantTreeNode=null){
this.level = _arg5;
this.xdiv = _arg1;
this.ydiv = _arg2;
halfwidth = (_arg3 / 2);
halfheight = (_arg4 / 2);
this.parent = _arg6;
}
public function reset(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
this.xdiv = _arg1;
this.ydiv = _arg2;
halfwidth = (_arg3 / 2);
halfheight = (_arg4 / 2);
lefttopFlag = false;
leftbottomFlag = false;
righttopFlag = false;
rightbottomFlag = false;
onlysourceFlag = true;
onlysource = null;
render_center_length = -1;
render_center_index = -1;
}
public function push(_arg1:DrawPrimitive):void{
if (onlysourceFlag){
if (((!((onlysource == null))) && (!((onlysource == _arg1.source))))){
onlysourceFlag = false;
};
onlysource = _arg1.source;
};
if (level < maxlevel){
if (_arg1.maxX <= xdiv){
if (_arg1.maxY <= ydiv){
if (lefttop == null){
lefttopFlag = true;
lefttop = new PrimitiveQuadrantTreeNode((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight, (level + 1), this);
} else {
if (!lefttopFlag){
lefttopFlag = true;
lefttop.reset((xdiv - (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight);
};
};
lefttop.push(_arg1);
return;
} else {
if (_arg1.minY >= ydiv){
if (leftbottom == null){
leftbottomFlag = true;
leftbottom = new PrimitiveQuadrantTreeNode((xdiv - (halfwidth / 2)), (ydiv + (halfheight / 2)), halfwidth, halfheight, (level + 1), this);
} else {
if (!leftbottomFlag){
leftbottomFlag = true;
leftbottom.reset((xdiv - (halfwidth / 2)), (ydiv + (halfheight / 2)), halfwidth, halfheight);
};
};
leftbottom.push(_arg1);
return;
};
};
} else {
if (_arg1.minX >= xdiv){
if (_arg1.maxY <= ydiv){
if (righttop == null){
righttopFlag = true;
righttop = new PrimitiveQuadrantTreeNode((xdiv + (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight, (level + 1), this);
} else {
if (!righttopFlag){
righttopFlag = true;
righttop.reset((xdiv + (halfwidth / 2)), (ydiv - (halfheight / 2)), halfwidth, halfheight);
};
};
righttop.push(_arg1);
return;
} else {
if (_arg1.minY >= ydiv){
if (rightbottom == null){
rightbottomFlag = true;
rightbottom = new PrimitiveQuadrantTreeNode((xdiv + (halfwidth / 2)), (ydiv + (halfheight / 2)), halfwidth, halfheight, (level + 1), this);
} else {
if (!rightbottomFlag){
rightbottomFlag = true;
rightbottom.reset((xdiv + (halfwidth / 2)), (ydiv + (halfheight / 2)), halfwidth, halfheight);
};
};
rightbottom.push(_arg1);
return;
};
};
};
};
};
if (center == null){
center = new Array();
};
center.push(_arg1);
_arg1.quadrant = this;
}
public function render(_arg1:Number):void{
var _local2:DrawPrimitive;
if (render_center_length == -1){
if (center != null){
render_center_length = center.length;
if (render_center_length > 1){
center.sortOn("screenZ", (Array.DESCENDING | Array.NUMERIC));
};
} else {
render_center_length = 0;
};
render_center_index = 0;
};
while (render_center_index < render_center_length) {
_local2 = center[render_center_index];
if (_local2.screenZ < _arg1){
break;
};
render_other(_local2.screenZ);
_local2.render();
render_center_index++;
};
if (render_center_index == render_center_length){
center = null;
};
render_other(_arg1);
}
private function render_other(_arg1:Number):void{
if (lefttopFlag){
lefttop.render(_arg1);
};
if (leftbottomFlag){
leftbottom.render(_arg1);
};
if (righttopFlag){
righttop.render(_arg1);
};
if (rightbottomFlag){
rightbottom.render(_arg1);
};
}
}
}//package away3d.core.draw
Section 41
//ScreenVertex (away3d.core.draw.ScreenVertex)
package away3d.core.draw {
import away3d.core.base.*;
public final class ScreenVertex {
public var y:Number;
private var persp:Number;
private var my2:Number;
public var num:Number;
private var dx:Number;
private var dy:Number;
private var faz:Number;
private var mx2:Number;
private var ifmz2:Number;
public var visible:Boolean;
public var x:Number;
public var z:Number;
private var fbz:Number;
public function ScreenVertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
this.visible = false;
}
public function distortSqr(_arg1:ScreenVertex, _arg2:Number):Number{
faz = (_arg2 + z);
fbz = (_arg2 + z);
ifmz2 = (2 / (faz + fbz));
mx2 = (((x * faz) + (_arg1.x * fbz)) * ifmz2);
my2 = (((y * faz) + (_arg1.y * fbz)) * ifmz2);
dx = ((x + _arg1.x) - mx2);
dy = ((y + _arg1.y) - my2);
return ((50 * (((dx * dx) + dy) + dy)));
}
public function deperspective(_arg1:Number):Vertex{
persp = (1 + (z / _arg1));
return (new Vertex((x * persp), (y * persp), z));
}
public function distanceSqr(_arg1:ScreenVertex):Number{
return ((((x - _arg1.x) * (x - _arg1.x)) + ((y - _arg1.y) * (y - _arg1.y))));
}
public function toString():String{
return ((((((("new ScreenVertex(" + x) + ", ") + y) + ", ") + z) + ")"));
}
public function distance(_arg1:ScreenVertex):Number{
return (Math.sqrt((((x - _arg1.x) * (x - _arg1.x)) + ((y - _arg1.y) * (y - _arg1.y)))));
}
public static function median(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:Number):ScreenVertex{
var _local4:Number = ((_arg1.z + _arg2.z) / 2);
var _local5:Number = (_arg3 + _arg1.z);
var _local6:Number = (_arg3 + _arg2.z);
var _local7:Number = ((1 / (_arg3 + _local4)) / 2);
return (new ScreenVertex((((_arg1.x * _local5) + (_arg2.x * _local6)) * _local7), (((_arg1.y * _local5) + (_arg2.y * _local6)) * _local7), _local4));
}
public static function weighted(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:Number, _arg4:Number, _arg5:Number):ScreenVertex{
if ((((_arg4 == 0)) && ((_arg3 == 0)))){
throw (new Error("Zero weights"));
};
if (_arg4 == 0){
return (new ScreenVertex(_arg1.x, _arg1.y, _arg1.z));
};
if (_arg3 == 0){
return (new ScreenVertex(_arg2.x, _arg2.y, _arg2.z));
};
var _local6:Number = (_arg3 + _arg4);
var _local7:Number = (_arg3 / _local6);
var _local8:Number = (_arg4 / _local6);
var _local9:Number = ((_arg1.x * _local7) + (_arg2.x * _local8));
var _local10:Number = ((_arg1.y * _local7) + (_arg2.y * _local8));
var _local11:Number = (_arg1.z / _arg5);
var _local12:Number = (_arg2.z / _arg5);
var _local13:Number = (1 + _local11);
var _local14:Number = (1 + _local12);
var _local15:Number = ((_arg1.x * _local13) - (_local9 * _local11));
var _local16:Number = ((_arg2.x * _local14) - (_local9 * _local12));
var _local17:Number = ((_arg1.y * _local13) - (_local10 * _local11));
var _local18:Number = ((_arg2.y * _local14) - (_local10 * _local12));
var _local19:Number = ((_local15 * _local18) - (_local16 * _local17));
var _local20:Number = ((_local9 * _local18) - (_local16 * _local10));
var _local21:Number = ((_local15 * _local10) - (_local9 * _local17));
return (new ScreenVertex(_local9, _local10, (((_local20 * _arg1.z) + (_local21 * _arg2.z)) / _local19)));
}
}
}//package away3d.core.draw
Section 42
//IPrimitiveFilter (away3d.core.filter.IPrimitiveFilter)
package away3d.core.filter {
import away3d.containers.*;
import away3d.cameras.*;
import away3d.core.clip.*;
public interface IPrimitiveFilter {
function filter(_arg1:Array, _arg2:Scene3D, _arg3:Camera3D, _arg4:Clipping):Array;
}
}//package away3d.core.filter
Section 43
//ZSortFilter (away3d.core.filter.ZSortFilter)
package away3d.core.filter {
import away3d.containers.*;
import away3d.cameras.*;
import away3d.core.clip.*;
public class ZSortFilter implements IPrimitiveFilter {
public function filter(_arg1:Array, _arg2:Scene3D, _arg3:Camera3D, _arg4:Clipping):Array{
_arg1.sortOn("screenZ", (Array.DESCENDING | Array.NUMERIC));
return (_arg1);
}
public function toString():String{
return ("ZSort");
}
}
}//package away3d.core.filter
Section 44
//AmbientLight (away3d.core.light.AmbientLight)
package away3d.core.light {
import flash.display.*;
import away3d.lights.*;
public class AmbientLight extends LightPrimitive {
public var light:AmbientLight3D;
public function updateAmbientBitmap(_arg1:Number):void{
this.ambient = _arg1;
ambientBitmap = new BitmapData(0x0100, 0x0100, false, ((int(((_arg1 * red) << 16)) | int(((_arg1 * green) << 8))) | int((_arg1 * blue))));
ambientBitmap.lock();
}
}
}//package away3d.core.light
Section 45
//DirectionalLight (away3d.core.light.DirectionalLight)
package away3d.core.light {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import away3d.containers.*;
import away3d.events.*;
import away3d.core.math.*;
import away3d.core.base.*;
import flash.filters.*;
import away3d.lights.*;
import away3d.core.*;
public class DirectionalLight extends LightPrimitive {
private var halfTransform:Matrix3D;
private var mod:Number;
private var _green:Number;
public var ambientDiffuseColorTransform:ColorTransform;
private var quaternion:Quaternion;
private var _shape:Shape;
public var light:DirectionalLight3D;
public var diffuseTransform:Dictionary;
private var halfQuaternion:Quaternion;
private var _szx:Number;
private var _szy:Number;
private var _szz:Number;
private var _blue:Number;
private var _colorMatrix:ColorMatrixFilter;
private var cameraTransform:Matrix3D;
public var colorMatrixTransform:Dictionary;
private var nx:Number;
private var ny:Number;
private var _red:Number;
public var normalMatrixTransform:Dictionary;
private var halfVector:Number3D;
private var cameraDirection:Number3D;
private var _matrix:Matrix;
public var diffuseColorTransform:ColorTransform;
private var _normalMatrix:ColorMatrixFilter;
public var specularTransform:Dictionary;
private var transform:Matrix3D;
private var invTransform:Matrix3D;
private var direction:Number3D;
public function DirectionalLight(){
_colorMatrix = new ColorMatrixFilter();
_normalMatrix = new ColorMatrixFilter();
_matrix = new Matrix();
_shape = new Shape();
quaternion = new Quaternion();
invTransform = new Matrix3D();
transform = new Matrix3D();
cameraDirection = new Number3D();
halfVector = new Number3D();
halfQuaternion = new Quaternion();
halfTransform = new Matrix3D();
direction = new Number3D();
colorMatrixTransform = new Dictionary(true);
normalMatrixTransform = new Dictionary(true);
super();
}
public function setNormalMatrixTransform(_arg1:Object3D):void{
_szx = diffuseTransform[_arg1].szx;
_szy = diffuseTransform[_arg1].szy;
_szz = diffuseTransform[_arg1].szz;
_normalMatrix.matrix = [_szx, 0, 0, 0, (127 - (_szx * 127)), 0, -(_szy), 0, 0, (127 + (_szy * 127)), 0, 0, _szz, 0, (127 - (_szz * 127)), 0, 0, 0, 1, 0];
normalMatrixTransform[_arg1] = _normalMatrix.clone();
}
public function clearTransform():void{
diffuseTransform = new Dictionary(true);
specularTransform = new Dictionary(true);
colorMatrixTransform = new Dictionary(true);
normalMatrixTransform = new Dictionary(true);
}
public function setSpecularTransform(_arg1:Object3D, _arg2:View3D):void{
cameraTransform = _arg2.camera.transform;
cameraDirection.x = -(cameraTransform.sxz);
cameraDirection.y = -(cameraTransform.syz);
cameraDirection.z = -(cameraTransform.szz);
halfVector.add(cameraDirection, direction);
halfVector.normalize();
nx = halfVector.x;
ny = halfVector.y;
mod = Math.sqrt(((nx * nx) + (ny * ny)));
halfTransform.rotationMatrix((-(ny) / mod), (nx / mod), 0, Math.acos(-(halfVector.z)));
if (!specularTransform[_arg1][_arg2]){
specularTransform[_arg1][_arg2] = new Matrix3D();
};
specularTransform[_arg1][_arg2].multiply3x3(halfTransform, _arg1._sceneTransform);
}
public function updateSpecularBitmap(_arg1:Number):void{
this.specular = _arg1;
specularBitmap = new BitmapData(0x0200, 0x0200, false, 0);
specularBitmap.lock();
_matrix.createGradientBox(0x0200, 0x0200, 0, 0, 0);
var _local2:Array = new Array();
var _local3:Array = new Array();
var _local4:Array = new Array();
var _local5 = 15;
while (_local5--) {
_local2.push(((((((_local5 * _arg1) * red) / 14) << 16) + ((((_local5 * _arg1) * green) / 14) << 8)) + (((_local5 * _arg1) * blue) / 14)));
_local3.push(1);
_local4.push(int((30 + (((225 * 2) * Math.acos(Math.pow((_local5 / 14), (1 / 20)))) / Math.PI))));
};
_shape.graphics.clear();
_shape.graphics.beginGradientFill(GradientType.RADIAL, _local2, _local3, _local4, _matrix);
_shape.graphics.drawCircle(0xFF, 0xFF, 0xFF);
specularBitmap.draw(_shape);
}
public function updateAmbientBitmap(_arg1:Number):void{
this.ambient = _arg1;
ambientBitmap = new BitmapData(0x0100, 0x0100, false, ((int(((_arg1 * red) << 16)) | int(((_arg1 * green) << 8))) | int((_arg1 * blue))));
ambientBitmap.lock();
}
public function setDiffuseTransform(_arg1:Object3D):void{
if (!diffuseTransform[_arg1]){
diffuseTransform[_arg1] = new Matrix3D();
};
diffuseTransform[_arg1].multiply3x3(transform, _arg1._sceneTransform);
}
public function updateDirection(_arg1:Object3DEvent):void{
direction.x = light.x;
direction.y = light.y;
direction.z = light.z;
direction.normalize();
nx = direction.x;
ny = direction.y;
mod = Math.sqrt(((nx * nx) + (ny * ny)));
transform.rotationMatrix((ny / mod), (-(nx) / mod), 0, -(Math.acos(-(direction.z))));
clearTransform();
}
public function setColorMatrixTransform(_arg1:Object3D):void{
_red = (red / 127);
_green = (green / 127);
_blue = (blue / 127);
_colorMatrix.matrix = [_red, _red, _red, 0, (-381 * _red), _green, _green, _green, 0, (-381 * _green), _blue, _blue, _blue, 0, (-381 * _blue), 0, 0, 0, 1, 0];
colorMatrixTransform[_arg1] = _colorMatrix.clone();
}
public function updateDiffuseBitmap(_arg1:Number):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
this.diffuse = _arg1;
diffuseBitmap = new BitmapData(0x0100, 0x0100, false, 0);
diffuseBitmap.lock();
_matrix.createGradientBox(0x0100, 0x0100, 0, 0, 0);
var _local2:Array = new Array();
var _local3:Array = new Array();
var _local4:Array = new Array();
var _local5 = 15;
while (_local5--) {
_local6 = ((_local5 * _arg1) / 14);
if (_local6 > 1){
_local6 = 1;
};
_local7 = ((_local5 * _arg1) / 14);
if (_local7 > 1){
_local7 = 1;
};
_local8 = ((_local5 * _arg1) / 14);
if (_local8 > 1){
_local8 = 1;
};
_local2.push(((((_local6 * red) << 16) | ((_local7 * green) << 8)) | (_local8 * blue)));
_local3.push(1);
_local4.push(int((30 + (((225 * 2) * Math.acos((_local5 / 14))) / Math.PI))));
};
_shape.graphics.clear();
_shape.graphics.beginGradientFill(GradientType.LINEAR, _local2, _local3, _local4, _matrix);
_shape.graphics.drawRect(0, 0, 0x0100, 0x0100);
diffuseBitmap.draw(_shape);
diffuseColorTransform = new ColorTransform(((_arg1 * red) / 0xFF), ((_arg1 * green) / 0xFF), ((_arg1 * blue) / 0xFF), 1, 0, 0, 0, 0);
}
public function updateAmbientDiffuseBitmap(_arg1:Number, _arg2:Number):void{
var _local7:Number;
var _local8:Number;
var _local9:Number;
this.diffuse = _arg2;
ambientDiffuseBitmap = new BitmapData(0x0100, 0x0100, false, 0);
ambientDiffuseBitmap.lock();
_matrix.createGradientBox(0x0100, 0x0100, 0, 0, 0);
var _local3:Array = new Array();
var _local4:Array = new Array();
var _local5:Array = new Array();
var _local6 = 15;
while (_local6--) {
_local7 = (((_local6 * _arg2) / 14) + _arg1);
if (_local7 > 1){
_local7 = 1;
};
_local8 = (((_local6 * _arg2) / 14) + _arg1);
if (_local8 > 1){
_local8 = 1;
};
_local9 = (((_local6 * _arg2) / 14) + _arg1);
if (_local9 > 1){
_local9 = 1;
};
_local3.push(((((_local7 * red) << 16) | ((_local8 * green) << 8)) | (_local9 * blue)));
_local4.push(1);
_local5.push(int((30 + (((225 * 2) * Math.acos((_local6 / 14))) / Math.PI))));
};
_shape.graphics.clear();
_shape.graphics.beginGradientFill(GradientType.LINEAR, _local3, _local4, _local5, _matrix);
_shape.graphics.drawRect(0, 0, 0x0100, 0x0100);
ambientDiffuseBitmap.draw(_shape);
ambientDiffuseColorTransform = new ColorTransform(((_arg2 * red) / 0xFF), ((_arg2 * green) / 0xFF), ((_arg2 * blue) / 0xFF), 1, (_arg1 * red), (_arg1 * green), (_arg1 * blue), 0);
}
}
}//package away3d.core.light
Section 46
//ILightConsumer (away3d.core.light.ILightConsumer)
package away3d.core.light {
public interface ILightConsumer {
function directionalLight(_arg1:DirectionalLight):void;
function pointLight(_arg1:PointLight):void;
function ambientLight(_arg1:AmbientLight):void;
}
}//package away3d.core.light
Section 47
//ILightProvider (away3d.core.light.ILightProvider)
package away3d.core.light {
public interface ILightProvider {
function light(_arg1:ILightConsumer):void;
}
}//package away3d.core.light
Section 48
//LightArray (away3d.core.light.LightArray)
package away3d.core.light {
public class LightArray implements ILightConsumer {
public var points:Array;
public var directionals:Array;
public var numLights:int;
public var ambients:Array;
public function ambientLight(_arg1:AmbientLight):void{
ambients.push(_arg1);
numLights++;
}
public function directionalLight(_arg1:DirectionalLight):void{
directionals.push(_arg1);
numLights++;
}
public function clear():void{
ambients = [];
directionals = [];
points = [];
numLights = 0;
}
public function pointLight(_arg1:PointLight):void{
points.push(_arg1);
numLights++;
}
}
}//package away3d.core.light
Section 49
//LightPrimitive (away3d.core.light.LightPrimitive)
package away3d.core.light {
import flash.display.*;
public class LightPrimitive {
public var diffuseBitmap:BitmapData;
public var specularBitmap:BitmapData;
public var green:Number;
public var ambientBitmap:BitmapData;
public var diffuse:Number;
public var specular:Number;
public var red:Number;
public var ambient:Number;
public var ambientDiffuseBitmap:BitmapData;
public var blue:Number;
}
}//package away3d.core.light
Section 50
//PointLight (away3d.core.light.PointLight)
package away3d.core.light {
import away3d.lights.*;
public class PointLight extends LightPrimitive {
public var light:PointLight3D;
public var x:Number;
public var y:Number;
public var z:Number;
}
}//package away3d.core.light
Section 51
//Matrix3D (away3d.core.math.Matrix3D)
package away3d.core.math {
public final class Matrix3D {
private const toDEGREES:Number = 57.2957795130823;
private var xx:Number;
private var xy:Number;
private var xz:Number;
private var yw:Number;
private var yy:Number;
private var yz:Number;
private var scos:Number;
private var nCos:Number;
private var zw:Number;
private var m211:Number;
private var m213:Number;
private var m214:Number;
private var m212:Number;
private var suv:Number;
private var suw:Number;
private var su:Number;
private var sv:Number;
private var m221:Number;
private var m222:Number;
private var m223:Number;
private var m224:Number;
private var sw:Number;
private var zz:Number;
private var d:Number;
private var svw:Number;
private var w:Number;
private var x:Number;
private var y:Number;
private var z:Number;
private var m231:Number;
private var m111:Number;
private var m112:Number;
private var m114:Number;
private var _position:Number3D;
private var m113:Number;
private var m232:Number;
private var m233:Number;
private var m234:Number;
private var nSin:Number;
public var tx:Number;
public var ty:Number;
public var tz:Number;
private var m121:Number;
private var m122:Number;
private var m123:Number;
private var m124:Number;
public var sxx:Number;
public var sxy:Number;
public var sxz:Number;
private var m131:Number;
private var m132:Number;
private var m133:Number;
private var m134:Number;
public var syx:Number;
public var syy:Number;
public var syz:Number;
public var szx:Number;
public var szz:Number;
public var szy:Number;
private var xw:Number;
public function Matrix3D(){
_position = new Number3D();
super();
sxx = (syy = (szz = 1));
sxy = (sxz = (tx = (syx = (syz = (ty = (szx = (szy = (tz = 0))))))));
}
public function get det():Number{
return ((((((sxx * syy) - (syx * sxy)) * szz) - (((sxx * szy) - (szx * sxy)) * syz)) + (((syx * szy) - (szx * syy)) * sxz)));
}
public function multiply(_arg1:Matrix3D, _arg2:Matrix3D):void{
m111 = _arg1.sxx;
m211 = _arg2.sxx;
m121 = _arg1.syx;
m221 = _arg2.syx;
m131 = _arg1.szx;
m231 = _arg2.szx;
m112 = _arg1.sxy;
m212 = _arg2.sxy;
m122 = _arg1.syy;
m222 = _arg2.syy;
m132 = _arg1.szy;
m232 = _arg2.szy;
m113 = _arg1.sxz;
m213 = _arg2.sxz;
m123 = _arg1.syz;
m223 = _arg2.syz;
m133 = _arg1.szz;
m233 = _arg2.szz;
m114 = _arg1.tx;
m214 = _arg2.tx;
m124 = _arg1.ty;
m224 = _arg2.ty;
m134 = _arg1.tz;
m234 = _arg2.tz;
sxx = (((m111 * m211) + (m112 * m221)) + (m113 * m231));
sxy = (((m111 * m212) + (m112 * m222)) + (m113 * m232));
sxz = (((m111 * m213) + (m112 * m223)) + (m113 * m233));
tx = ((((m111 * m214) + (m112 * m224)) + (m113 * m234)) + m114);
syx = (((m121 * m211) + (m122 * m221)) + (m123 * m231));
syy = (((m121 * m212) + (m122 * m222)) + (m123 * m232));
syz = (((m121 * m213) + (m122 * m223)) + (m123 * m233));
ty = ((((m121 * m214) + (m122 * m224)) + (m123 * m234)) + m124);
szx = (((m131 * m211) + (m132 * m221)) + (m133 * m231));
szy = (((m131 * m212) + (m132 * m222)) + (m133 * m232));
szz = (((m131 * m213) + (m132 * m223)) + (m133 * m233));
tz = ((((m131 * m214) + (m132 * m224)) + (m133 * m234)) + m134);
}
public function get position():Number3D{
_position.x = tx;
_position.y = ty;
_position.z = tz;
return (_position);
}
public function inverse(_arg1:Matrix3D):void{
d = _arg1.det;
if (Math.abs(d) < 0.001){
return;
};
d = (1 / d);
m111 = _arg1.sxx;
m121 = _arg1.syx;
m131 = _arg1.szx;
m112 = _arg1.sxy;
m122 = _arg1.syy;
m132 = _arg1.szy;
m113 = _arg1.sxz;
m123 = _arg1.syz;
m133 = _arg1.szz;
m114 = _arg1.tx;
m124 = _arg1.ty;
m134 = _arg1.tz;
sxx = (d * ((m122 * m133) - (m132 * m123)));
sxy = (-(d) * ((m112 * m133) - (m132 * m113)));
sxz = (d * ((m112 * m123) - (m122 * m113)));
tx = (-(d) * (((m112 * ((m123 * m134) - (m133 * m124))) - (m122 * ((m113 * m134) - (m133 * m114)))) + (m132 * ((m113 * m124) - (m123 * m114)))));
syx = (-(d) * ((m121 * m133) - (m131 * m123)));
syy = (d * ((m111 * m133) - (m131 * m113)));
syz = (-(d) * ((m111 * m123) - (m121 * m113)));
ty = (d * (((m111 * ((m123 * m134) - (m133 * m124))) - (m121 * ((m113 * m134) - (m133 * m114)))) + (m131 * ((m113 * m124) - (m123 * m114)))));
szx = (d * ((m121 * m132) - (m131 * m122)));
szy = (-(d) * ((m111 * m132) - (m131 * m112)));
szz = (d * ((m111 * m122) - (m121 * m112)));
tz = (-(d) * (((m111 * ((m122 * m134) - (m132 * m124))) - (m121 * ((m112 * m134) - (m132 * m114)))) + (m131 * ((m112 * m124) - (m122 * m114)))));
}
public function scale(_arg1:Number, _arg2:Number, _arg3:Number):void{
sxx = (sxx * _arg1);
syx = (syx * _arg1);
szx = (szx * _arg1);
sxy = (sxy * _arg2);
syy = (syy * _arg2);
szy = (szy * _arg2);
sxz = (sxz * _arg3);
syz = (syz * _arg3);
szz = (szz * _arg3);
}
public function clone(_arg1:Matrix3D):Matrix3D{
sxx = _arg1.sxx;
sxy = _arg1.sxy;
sxz = _arg1.sxz;
tx = _arg1.tx;
syx = _arg1.syx;
syy = _arg1.syy;
syz = _arg1.syz;
ty = _arg1.ty;
szx = _arg1.szx;
szy = _arg1.szy;
szz = _arg1.szz;
tz = _arg1.tz;
return (_arg1);
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + ((((((((int((sxx * 1000)) / 1000) + "\t\t") + (int((sxy * 1000)) / 1000)) + "\t\t") + (int((sxz * 1000)) / 1000)) + "\t\t") + (int((tx * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((syx * 1000)) / 1000) + "\t\t") + (int((syy * 1000)) / 1000)) + "\t\t") + (int((syz * 1000)) / 1000)) + "\t\t") + (int((ty * 1000)) / 1000)) + "\n"));
_local1 = (_local1 + ((((((((int((szx * 1000)) / 1000) + "\t\t") + (int((szy * 1000)) / 1000)) + "\t\t") + (int((szz * 1000)) / 1000)) + "\t\t") + (int((tz * 1000)) / 1000)) + "\n"));
return (_local1);
}
public function matrix2euler():Number3D{
var _local4:Number;
var _local5:Number;
var _local1:Number3D = new Number3D();
var _local2:Number = -(Math.asin(Math.max(-1, Math.min(1, sxz))));
var _local3:Number = Math.cos(_local2);
_local1.y = (_local2 * toDEGREES);
if (Math.abs(_local3) > 0.005){
_local4 = (szz / _local3);
_local5 = (-(syz) / _local3);
_local1.x = (Math.atan2(_local5, _local4) * toDEGREES);
_local4 = (sxx / _local3);
_local5 = (-(sxy) / _local3);
_local1.z = (Math.atan2(_local5, _local4) * toDEGREES);
} else {
_local1.x = 0;
_local4 = syy;
_local5 = syx;
_local1.z = (Math.atan2(_local5, _local4) * toDEGREES);
};
return (_local1);
}
public function copy3x3(_arg1:Matrix3D):Matrix3D{
sxx = _arg1.sxx;
sxy = _arg1.sxy;
sxz = _arg1.sxz;
syx = _arg1.syx;
syy = _arg1.syy;
syz = _arg1.syz;
szx = _arg1.szx;
szy = _arg1.szy;
szz = _arg1.szz;
return (this);
}
public function multiply3x3(_arg1:Matrix3D, _arg2:Matrix3D):void{
m111 = _arg1.sxx;
m211 = _arg2.sxx;
m121 = _arg1.syx;
m221 = _arg2.syx;
m131 = _arg1.szx;
m231 = _arg2.szx;
m112 = _arg1.sxy;
m212 = _arg2.sxy;
m122 = _arg1.syy;
m222 = _arg2.syy;
m132 = _arg1.szy;
m232 = _arg2.szy;
m113 = _arg1.sxz;
m213 = _arg2.sxz;
m123 = _arg1.syz;
m223 = _arg2.syz;
m133 = _arg1.szz;
m233 = _arg2.szz;
sxx = (((m111 * m211) + (m112 * m221)) + (m113 * m231));
sxy = (((m111 * m212) + (m112 * m222)) + (m113 * m232));
sxz = (((m111 * m213) + (m112 * m223)) + (m113 * m233));
syx = (((m121 * m211) + (m122 * m221)) + (m123 * m231));
syy = (((m121 * m212) + (m122 * m222)) + (m123 * m232));
syz = (((m121 * m213) + (m122 * m223)) + (m123 * m233));
szx = (((m131 * m211) + (m132 * m221)) + (m133 * m231));
szy = (((m131 * m212) + (m132 * m222)) + (m133 * m232));
szz = (((m131 * m213) + (m132 * m223)) + (m133 * m233));
tx = _arg1.tx;
ty = _arg1.ty;
tz = _arg1.tz;
}
public function scaleMatrix(_arg1:Number, _arg2:Number, _arg3:Number):void{
tx = (sxy = (sxz = 0));
syz = (ty = (syz = 0));
szx = (szy = (tz = 0));
sxx = _arg1;
syy = _arg2;
szz = _arg3;
}
public function quaternion2matrix(_arg1:Quaternion):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
w = _arg1.w;
xx = (x * x);
xy = (x * y);
xz = (x * z);
xw = (x * w);
yy = (y * y);
yz = (y * z);
yw = (y * w);
zz = (z * z);
zw = (z * w);
sxx = (1 - (2 * (yy + zz)));
sxy = (2 * (xy - zw));
sxz = (2 * (xz + yw));
syx = (2 * (xy + zw));
syy = (1 - (2 * (xx + zz)));
syz = (2 * (yz - xw));
szx = (2 * (xz - yw));
szy = (2 * (yz + xw));
szz = (1 - (2 * (xx + yy)));
}
public function translationMatrix(_arg1:Number, _arg2:Number, _arg3:Number):void{
sxx = (syy = (szz = 1));
sxy = (sxz = (syz = (syz = (szx = (szy = 0)))));
tx = _arg1;
ty = _arg2;
tz = _arg3;
}
public function rotationMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
nCos = Math.cos(_arg4);
nSin = Math.sin(_arg4);
scos = (1 - nCos);
suv = ((_arg1 * _arg2) * scos);
svw = ((_arg2 * _arg3) * scos);
suw = ((_arg1 * _arg3) * scos);
sw = (nSin * _arg3);
sv = (nSin * _arg2);
su = (nSin * _arg1);
sxx = (nCos + ((_arg1 * _arg1) * scos));
sxy = (-(sw) + suv);
sxz = (sv + suw);
syx = (sw + suv);
syy = (nCos + ((_arg2 * _arg2) * scos));
syz = (-(su) + svw);
szx = (-(sv) + suw);
szy = (su + svw);
szz = (nCos + ((_arg3 * _arg3) * scos));
}
public function array2matrix(_arg1:Array):void{
if (_arg1.length >= 12){
sxx = _arg1[0];
sxy = _arg1[1];
sxz = _arg1[2];
tx = _arg1[3];
syx = _arg1[4];
syy = _arg1[5];
syz = _arg1[6];
ty = _arg1[7];
szx = _arg1[8];
szy = _arg1[9];
szz = _arg1[10];
tz = _arg1[11];
};
}
}
}//package away3d.core.math
Section 52
//Number3D (away3d.core.math.Number3D)
package away3d.core.math {
public final class Number3D {
private var mod:Number;
private var num:Number3D;
private var dist:Number;
public var x:Number;
public var y:Number;
public var z:Number;
public static var BACKWARD:Number3D = new Number3D(0, 0, -1);
;
public static var FORWARD:Number3D = new Number3D(0, 0, 1);
;
public static var LEFT:Number3D = new Number3D(-1, 0, 0);
;
public static var DOWN:Number3D = new Number3D(0, -1, 0);
;
public static var UP:Number3D = new Number3D(0, 1, 0);
;
public static var RIGHT:Number3D = new Number3D(1, 0, 0);
;
public function Number3D(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Boolean=false){
this.x = _arg1;
this.y = _arg2;
this.z = _arg3;
if (_arg4){
normalize();
};
}
public function sub(_arg1:Number3D, _arg2:Number3D):void{
x = (_arg1.x - _arg2.x);
y = (_arg1.y - _arg2.y);
z = (_arg1.z - _arg2.z);
}
public function cross(_arg1:Number3D, _arg2:Number3D):void{
if ((((this == _arg1)) || ((this == _arg2)))){
throw (new Error("resultant cross product cannot be the same instance as an input"));
};
x = ((_arg2.y * _arg1.z) - (_arg2.z * _arg1.y));
y = ((_arg2.z * _arg1.x) - (_arg2.x * _arg1.z));
z = ((_arg2.x * _arg1.y) - (_arg2.y * _arg1.x));
}
public function dot(_arg1:Number3D):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function scale(_arg1:Number3D, _arg2:Number):void{
x = (_arg1.x * _arg2);
y = (_arg1.y * _arg2);
z = (_arg1.z * _arg2);
}
public function normalize(_arg1:Number=1):void{
mod = (modulo / _arg1);
if (((!((mod == 0))) && (!((mod == 1))))){
x = (x / mod);
y = (y / mod);
z = (z / mod);
};
}
public function closestPointOnPlane(_arg1:Number3D, _arg2:Number3D, _arg3:Number3D):Number3D{
if (!num){
num = new Number3D();
};
num.sub(_arg1, _arg2);
dist = _arg3.dot(num);
num.scale(_arg3, dist);
num.sub(_arg1, num);
return (num);
}
public function rotate(_arg1:Number3D, _arg2:Matrix3D):void{
x = (((_arg1.x * _arg2.sxx) + (_arg1.y * _arg2.sxy)) + (_arg1.z * _arg2.sxz));
y = (((_arg1.x * _arg2.syx) + (_arg1.y * _arg2.syy)) + (_arg1.z * _arg2.syz));
z = (((_arg1.x * _arg2.szx) + (_arg1.y * _arg2.szy)) + (_arg1.z * _arg2.szz));
}
public function clone():Number3D{
return (new Number3D(x, y, z));
}
public function add(_arg1:Number3D, _arg2:Number3D):void{
x = (_arg1.x + _arg2.x);
y = (_arg1.y + _arg2.y);
z = (_arg1.z + _arg2.z);
}
public function getAngle(_arg1:Number3D=null):Number{
if (_arg1 == null){
_arg1 = new Number3D();
};
return (Math.acos((dot(_arg1) / (modulo * _arg1.modulo))));
}
public function transform(_arg1:Number3D, _arg2:Matrix3D):void{
x = ((((_arg1.x * _arg2.sxx) + (_arg1.y * _arg2.sxy)) + (_arg1.z * _arg2.sxz)) + _arg2.tx);
y = ((((_arg1.x * _arg2.syx) + (_arg1.y * _arg2.syy)) + (_arg1.z * _arg2.syz)) + _arg2.ty);
z = ((((_arg1.x * _arg2.szx) + (_arg1.y * _arg2.szy)) + (_arg1.z * _arg2.szz)) + _arg2.tz);
}
public function distance(_arg1:Number3D):Number{
return (Math.sqrt(((((x - _arg1.x) * (x - _arg1.x)) + ((y - _arg1.y) * (y - _arg1.y))) + ((z - _arg1.z) * (z - _arg1.z)))));
}
public function get modulo():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function toString():String{
return (((((("x:" + x) + " y:") + y) + " z:") + z));
}
public function get modulo2():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
}
}//package away3d.core.math
Section 53
//Quaternion (away3d.core.math.Quaternion)
package away3d.core.math {
public final class Quaternion {
private var fSinYaw:Number;
private var fCosYaw:Number;
private var z2:Number;
public var z:Number;
private var fCosPitch:Number;
private var w1:Number;
private var w2:Number;
private var cos_a:Number;
private var fSinRoll:Number;
private var x1:Number;
private var x2:Number;
private var sin_a:Number;
private var fCosPitchCosYaw:Number;
private var fSinPitch:Number;
private var y1:Number;
private var y2:Number;
private var fCosRoll:Number;
public var w:Number;
public var x:Number;
public var y:Number;
private var fSinPitchSinYaw:Number;
private var z1:Number;
public function normalize(_arg1:Number=1):void{
var _local2:Number = (magnitude * _arg1);
x = (x / _local2);
y = (y / _local2);
z = (z / _local2);
w = (w / _local2);
}
public function axis2quaternion(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
sin_a = Math.sin((_arg4 / 2));
cos_a = Math.cos((_arg4 / 2));
this.x = (_arg1 * sin_a);
this.y = (_arg2 * sin_a);
this.z = (_arg3 * sin_a);
w = cos_a;
normalize();
}
public function get magnitude():Number{
return (Math.sqrt(((((w * w) + (x * x)) + (y * y)) + (z * z))));
}
public function multiply(_arg1:Quaternion, _arg2:Quaternion):void{
w1 = _arg1.w;
x1 = _arg1.x;
y1 = _arg1.y;
z1 = _arg1.z;
w2 = _arg2.w;
x2 = _arg2.x;
y2 = _arg2.y;
z2 = _arg2.z;
w = ((((w1 * w2) - (x1 * x2)) - (y1 * y2)) - (z1 * z2));
x = ((((w1 * x2) + (x1 * w2)) + (y1 * z2)) - (z1 * y2));
y = ((((w1 * y2) + (y1 * w2)) + (z1 * x2)) - (x1 * z2));
z = ((((w1 * z2) + (z1 * w2)) + (x1 * y2)) - (y1 * x2));
}
public function euler2quaternion(_arg1:Number, _arg2:Number, _arg3:Number):void{
fSinPitch = Math.sin((_arg1 * 0.5));
fCosPitch = Math.cos((_arg1 * 0.5));
fSinYaw = Math.sin((_arg2 * 0.5));
fCosYaw = Math.cos((_arg2 * 0.5));
fSinRoll = Math.sin((_arg3 * 0.5));
fCosRoll = Math.cos((_arg3 * 0.5));
fCosPitchCosYaw = (fCosPitch * fCosYaw);
fSinPitchSinYaw = (fSinPitch * fSinYaw);
x = ((fSinRoll * fCosPitchCosYaw) - (fCosRoll * fSinPitchSinYaw));
y = (((fCosRoll * fSinPitch) * fCosYaw) + ((fSinRoll * fCosPitch) * fSinYaw));
z = (((fCosRoll * fCosPitch) * fSinYaw) - ((fSinRoll * fSinPitch) * fCosYaw));
w = ((fCosRoll * fCosPitchCosYaw) + (fSinRoll * fSinPitchSinYaw));
}
public function toString():String{
return ((((((((("{x:" + x) + " y:") + y) + " z:") + z) + " w:") + w) + "}"));
}
}
}//package away3d.core.math
Section 54
//AbstractRenderSession (away3d.core.render.AbstractRenderSession)
package away3d.core.render {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.base.*;
import away3d.core.light.*;
public class AbstractRenderSession {
private var a2:Number;
var _view:View3D;
private var ty:Number;
var doActive:Array;
private var tx:Number;
private var b2:Number;
public var newLayer:Sprite;
public var graphics:Graphics;
var doStore:Array;
private var b:Number;
private var session:AbstractRenderSession;
private var ds:DisplayObject;
var _layerDirty:Boolean;
var _lightarray:LightArray;
public var sessions:Dictionary;
var _shape:Shape;
private var c2:Number;
var _renderSource:Object3D;
var _containers:Dictionary;
private var cont:Shape;
private var v0x:Number;
private var v0y:Number;
private var time:int;
private var d2:Number;
private var v1x:Number;
private var v1y:Number;
private var a:Number;
private var c:Number;
private var d:Number;
public var spriteLayers:Array;
private var m:Matrix;
protected var i:int;
private var v2x:Number;
private var v2y:Number;
public var children:Dictionary;
public function AbstractRenderSession(){
_containers = new Dictionary(true);
doStore = new Array();
doActive = new Array();
m = new Matrix();
sessions = new Dictionary(true);
spriteLayers = new Array();
children = new Dictionary(true);
super();
}
public function set lightarray(_arg1:LightArray):void{
_lightarray = _arg1;
}
public function addDisplayObject(_arg1:DisplayObject):void{
throw (new Error("Not implemented"));
}
public function flush():void{
for each (session in sessions) {
session.flush();
};
}
public function renderTriangleBitmap(_arg1:BitmapData, _arg2:Matrix, _arg3:ScreenVertex, _arg4:ScreenVertex, _arg5:ScreenVertex, _arg6:Boolean, _arg7:Boolean, _arg8:Graphics=null):void{
if (_layerDirty){
createLayer();
};
a2 = ((v1x = _arg4.x) - (v0x = _arg3.x));
b2 = ((v1y = _arg4.y) - (v0y = _arg3.y));
c2 = ((v2x = _arg5.x) - v0x);
d2 = ((v2y = _arg5.y) - v0y);
m.a = (((a = _arg2.a) * a2) + ((b = _arg2.b) * c2));
m.b = ((a * b2) + (b * d2));
m.c = (((c = _arg2.c) * a2) + ((d = _arg2.d) * c2));
m.d = ((c * b2) + (d * d2));
m.tx = ((((tx = _arg2.tx) * a2) + ((ty = _arg2.ty) * c2)) + v0x);
m.ty = (((tx * b2) + (ty * d2)) + v0y);
if (_arg8){
_arg8.lineStyle();
_arg8.moveTo(v0x, v0y);
_arg8.beginBitmapFill(_arg1, m, _arg7, ((_arg6) && (((((v0x * (d2 - b2)) - (v1x * d2)) + (v2x * b2)) > 400))));
_arg8.lineTo(v1x, v1y);
_arg8.lineTo(v2x, v2y);
_arg8.endFill();
} else {
graphics.lineStyle();
graphics.moveTo(v0x, v0y);
graphics.beginBitmapFill(_arg1, m, _arg7, ((_arg6) && (((((v0x * (d2 - b2)) - (v1x * d2)) + (v2x * b2)) > 400))));
graphics.lineTo(v1x, v1y);
graphics.lineTo(v2x, v2y);
graphics.endFill();
};
}
public function getContainer(_arg1:View3D):DisplayObject{
throw (new Error("Not implemented"));
}
public function clone():AbstractRenderSession{
throw (new Error("Not implemented"));
}
public function renderLine(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:Number, _arg4:uint, _arg5:Number):void{
if (_layerDirty){
createLayer();
};
var _local6:Number = (_arg1.x - _arg2.x);
var _local7:Number = (_arg1.y - _arg2.y);
if ((((((((-1 < _local6)) && ((_local6 < 1)))) && ((-1 < _local7)))) && ((_local7 < 1)))){
graphics.lineStyle(_arg3, _arg4, _arg5);
graphics.moveTo(_arg1.x, _arg1.y);
graphics.lineTo((_arg2.x + 1), (_arg2.y + 1));
} else {
graphics.lineStyle(_arg3, _arg4, _arg5);
graphics.moveTo(_arg1.x, _arg1.y);
graphics.lineTo(_arg2.x, _arg2.y);
};
}
public function get view():View3D{
return (_view);
}
public function registerChildSession(_arg1:AbstractRenderSession):void{
if (!sessions[_arg1]){
sessions[_arg1] = _arg1;
};
}
public function renderTriangleColor(_arg1:int, _arg2:Number, _arg3:ScreenVertex, _arg4:ScreenVertex, _arg5:ScreenVertex):void{
if (_layerDirty){
createLayer();
};
graphics.lineStyle();
graphics.moveTo(_arg3.x, _arg3.y);
graphics.beginFill(_arg1, _arg2);
graphics.lineTo(_arg4.x, _arg4.y);
graphics.lineTo(_arg5.x, _arg5.y);
graphics.endFill();
}
public function get lightarray():LightArray{
return (_lightarray);
}
public function set view(_arg1:View3D):void{
_view = _arg1;
time = getTimer();
}
public function clear():void{
var _local1:Sprite;
var _local2:int;
for each (_local1 in spriteLayers) {
_local1.graphics.clear();
if (_local1.numChildren){
_local2 = _local1.numChildren;
while (_local2--) {
ds = _local1.getChildAt(_local2);
if ((ds is Shape)){
(ds as Shape).graphics.clear();
};
};
};
};
_local2 = doActive.length;
while (_local2--) {
cont = doActive.pop();
cont.graphics.clear();
doStore.push(cont);
};
for each (session in sessions) {
session.clear();
};
}
protected function createLayer():void{
throw (new Error("Not implemented"));
}
public function renderTriangleLine(_arg1:Number, _arg2:int, _arg3:Number, _arg4:ScreenVertex, _arg5:ScreenVertex, _arg6:ScreenVertex):void{
if (_layerDirty){
createLayer();
};
graphics.lineStyle(_arg1, _arg2, _arg3);
graphics.moveTo((v0x = _arg4.x), (v0y = _arg4.y));
graphics.lineTo(_arg5.x, _arg5.y);
graphics.lineTo(_arg6.x, _arg6.y);
graphics.lineTo(v0x, v0y);
}
public function renderScaledBitmap(_arg1:DrawScaledBitmap, _arg2:BitmapData, _arg3:Matrix, _arg4:Boolean=false):void{
if (_layerDirty){
createLayer();
};
if (_arg1.rotation != 0){
graphics.beginBitmapFill(_arg2, _arg3, false, _arg4);
graphics.moveTo(_arg1.topleft.x, _arg1.topleft.y);
graphics.lineTo(_arg1.topright.x, _arg1.topright.y);
graphics.lineTo(_arg1.bottomright.x, _arg1.bottomright.y);
graphics.lineTo(_arg1.bottomleft.x, _arg1.bottomleft.y);
graphics.lineTo(_arg1.topleft.x, _arg1.topleft.y);
graphics.endFill();
} else {
graphics.beginBitmapFill(_arg2, _arg3, false, _arg4);
graphics.drawRect(_arg1.minX, _arg1.minY, (_arg1.maxX - _arg1.minX), (_arg1.maxY - _arg1.minY));
graphics.endFill();
};
}
public function renderBitmap(_arg1:BitmapData, _arg2:ScreenVertex, _arg3:Boolean=false):void{
if (_layerDirty){
createLayer();
};
m.identity();
m.tx = (_arg2.x - (_arg1.width / 2));
m.ty = (_arg2.y - (_arg1.height / 2));
graphics.lineStyle();
graphics.beginBitmapFill(_arg1, m, false, _arg3);
graphics.drawRect((_arg2.x - (_arg1.width / 2)), (_arg2.y - (_arg1.height / 2)), _arg1.width, _arg1.height);
graphics.endFill();
}
public function addLayerObject(_arg1:Sprite):void{
throw (new Error("Not implemented"));
}
public function renderTriangleLineFill(_arg1:Number, _arg2:int, _arg3:Number, _arg4:int, _arg5:Number, _arg6:ScreenVertex, _arg7:ScreenVertex, _arg8:ScreenVertex):void{
if (_layerDirty){
createLayer();
};
if (_arg5 > 0){
graphics.lineStyle(_arg1, _arg4, _arg5);
} else {
graphics.lineStyle();
};
graphics.moveTo(_arg6.x, _arg6.y);
if (_arg3 > 0){
graphics.beginFill(_arg2, _arg3);
};
graphics.lineTo(_arg7.x, _arg7.y);
graphics.lineTo(_arg8.x, _arg8.y);
if (_arg5 > 0){
graphics.lineTo(_arg6.x, _arg6.y);
};
if (_arg3 > 0){
graphics.endFill();
};
}
public function renderFogColor(_arg1:int, _arg2:Number):void{
if (_layerDirty){
createLayer();
};
graphics.lineStyle();
graphics.beginFill(_arg1, _arg2);
graphics.drawRect(_view.clip.minX, _view.clip.minY, (_view.clip.maxX - _view.clip.minX), (_view.clip.maxY - _view.clip.minY));
graphics.endFill();
}
}
}//package away3d.core.render
Section 55
//BasicRenderer (away3d.core.render.BasicRenderer)
package away3d.core.render {
import flash.utils.*;
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.traverse.*;
import away3d.cameras.*;
import away3d.materials.*;
import away3d.core.light.*;
import away3d.core.clip.*;
import away3d.core.block.*;
import away3d.core.stats.*;
import away3d.core.filter.*;
public class BasicRenderer implements IRenderer {
private var blockers:Array;
private var projtraverser:ProjectionTraverser;
private var triangle:DrawTriangle;
private var scene:Scene3D;
private var priarray:PrimitiveArray;
private var blocktraverser:BlockerTraverser;
private var object:Object;
private var lightarray:LightArray;
private var _session:AbstractRenderSession;
private var camera:Camera3D;
private var clip:Clipping;
private var primitives:Array;
private var blockerarray:BlockerArray;
private var materials:Dictionary;
private var filter:IPrimitiveFilter;
private var pritraverser:PrimitiveTraverser;
private var filters:Array;
private var primitive:DrawPrimitive;
public function BasicRenderer(... _args){
projtraverser = new ProjectionTraverser();
blockerarray = new BlockerArray();
blocktraverser = new BlockerTraverser();
priarray = new PrimitiveArray();
lightarray = new LightArray();
pritraverser = new PrimitiveTraverser();
super();
this.filters = _args;
this.filters.push(new ZSortFilter());
}
public function toString():String{
return ((("Basic [" + filters.join("+")) + "]"));
}
public function set session(_arg1:AbstractRenderSession):void{
_session = _arg1;
}
public function render(_arg1:View3D):Array{
scene = _arg1.scene;
camera = _arg1.camera;
clip = _arg1.clip;
projtraverser.view = _arg1;
scene.traverse(projtraverser);
blockerarray.clip = clip;
blocktraverser.consumer = blockerarray;
blocktraverser.view = _arg1;
scene.traverse(blocktraverser);
blockers = blockerarray.list();
lightarray.clear();
_session.lightarray = lightarray;
priarray.clip = clip;
priarray.blockers = blockers;
pritraverser.consumer = priarray;
pritraverser.session = _session;
scene.traverse(pritraverser);
primitives = priarray.list();
for each (filter in filters) {
primitives = filter.filter(primitives, scene, camera, clip);
};
materials = new Dictionary(true);
for each (primitive in primitives) {
if ((primitive is DrawTriangle)){
triangle = (primitive as DrawTriangle);
if (!materials[triangle.source]){
materials[triangle.source] = new Dictionary(true);
};
if ((((triangle.material is IUpdatingMaterial)) && (!(materials[triangle.source][triangle.material])))){
(materials[triangle.source][triangle.material] = (triangle.material as IUpdatingMaterial)).updateMaterial(triangle.source, _arg1);
};
};
};
for each (primitive in primitives) {
primitive.render();
};
if (_arg1.statsOpen){
_arg1.statsPanel.updateStats(primitives.length, camera);
};
return (primitives);
}
public function get session():AbstractRenderSession{
return (_session);
}
}
}//package away3d.core.render
Section 56
//BitmapRenderSession (away3d.core.render.BitmapRenderSession)
package away3d.core.render {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import away3d.containers.*;
public class BitmapRenderSession extends AbstractRenderSession {
private var _container:Bitmap;
private var _height:int;
private var _width:int;
private var _cm:Matrix;
private var _scale:Number;
private var layers:Array;
private var mActive:Array;
private var _cx:Number;
private var _cy:Number;
private var layer:DisplayObject;
private var mStore:Array;
private var _bitmapheight:int;
private var _base:BitmapData;
private var _bitmapwidth:int;
public function BitmapRenderSession(_arg1:Number=2){
mStore = new Array();
mActive = new Array();
layers = [];
super();
if (_scale <= 0){
throw (new Error("scale cannot be negative or zero"));
};
_scale = _arg1;
}
override public function addDisplayObject(_arg1:DisplayObject):void{
layers.push(_arg1);
_arg1.visible = true;
children[_arg1] = _arg1;
_layerDirty = true;
}
override public function set view(_arg1:View3D):void{
super.view = _arg1;
_container = (getContainer(_view) as Bitmap);
_base = getBitmapData(_view);
_cx = (_container.x = (-(_width) / 2));
_cy = (_container.y = (-(_height) / 2));
_container.scaleX = _scale;
_container.scaleY = _scale;
_cm = new Matrix();
_cm.scale((1 / _scale), (1 / _scale));
_cm.translate((_bitmapwidth / 2), (_bitmapheight / 2));
}
override public function clear():void{
super.clear();
_base.lock();
_base.fillRect(_base.rect, 0);
children = new Dictionary(true);
newLayer = null;
layers = [];
_layerDirty = true;
}
override public function addLayerObject(_arg1:Sprite):void{
layers.push(_arg1);
_arg1.visible = true;
children[_arg1] = _arg1;
newLayer = _arg1;
}
override public function getContainer(_arg1:View3D):DisplayObject{
if (!_containers[_arg1]){
return ((_containers[_arg1] = new Bitmap()));
};
return (_containers[_arg1]);
}
override public function clone():AbstractRenderSession{
return (new BitmapRenderSession(_scale));
}
override public function get view():View3D{
return (_view);
}
public function getBitmapData(_arg1:View3D):BitmapData{
_container = (getContainer(_arg1) as Bitmap);
if (!_container.bitmapData){
_bitmapwidth = int(((_width = (_arg1.clip.maxX - _arg1.clip.minX)) / _scale));
_bitmapheight = int(((_height = (_arg1.clip.maxY - _arg1.clip.minY)) / _scale));
return ((_container.bitmapData = new BitmapData(_bitmapwidth, _bitmapheight, true, 0)));
};
return (_container.bitmapData);
}
override protected function createLayer():void{
if (doStore.length){
_shape = doStore.pop();
} else {
_shape = new Shape();
};
graphics = _shape.graphics;
doActive.push(_shape);
layers.push(_shape);
_layerDirty = false;
}
override public function flush():void{
super.flush();
i = 0;
for each (layer in layers) {
_base.draw(layer, _cm, layer.transform.colorTransform, layer.blendMode, _base.rect);
};
_base.unlock();
}
}
}//package away3d.core.render
Section 57
//FindHit (away3d.core.render.FindHit)
package away3d.core.render {
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.events.*;
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.materials.*;
public class FindHit {
private var sceneX:Number;
private var sceneY:Number;
private var sceneZ:Number;
private var uv:UV;
private var drawpri:DrawPrimitive;
private var view:View3D;
private var material:IUVMaterial;
private var screenX:Number;
private var screenY:Number;
private var screenZ:Number;// = INF
private var inv:Matrix3D;
private var primitive:DrawPrimitive;
private var persp:Number;
private var element:Object;
private var object:Object3D;
public function FindHit(_arg1:View3D, _arg2:Array, _arg3:Number, _arg4:Number){
inv = new Matrix3D();
super();
this.view = _arg1;
screenX = _arg3;
screenY = _arg4;
for each (primitive in _arg2) {
checkPrimitive(primitive);
};
}
private function checkPrimitive(_arg1:DrawPrimitive):void{
var _local2:Number;
var _local3:DrawTriangle;
var _local4:UV;
var _local5:IUVMaterial;
if (!_arg1.source.mouseEnabled){
return;
};
if (_arg1.minX > screenX){
return;
};
if (_arg1.maxX < screenX){
return;
};
if (_arg1.minY > screenY){
return;
};
if (_arg1.maxY < screenY){
return;
};
if (_arg1.contains(screenX, screenY)){
_local2 = _arg1.getZ(screenX, screenY);
if (_local2 < screenZ){
if ((_arg1 is DrawTriangle)){
_local3 = (_arg1 as DrawTriangle);
_local4 = _local3.getUV(screenX, screenY);
if ((_local3.material is IUVMaterial)){
_local5 = (_local3.material as IUVMaterial);
if (((!((_local3.material is BitmapMaterialContainer))) && (!((_local5.getPixel32(_local4.u, _local4.v) >> 24))))){
return;
};
uv = _local4;
};
material = _local5;
} else {
uv = null;
};
screenZ = _local2;
persp = (view.camera.zoom / (1 + (screenZ / view.camera.focus)));
inv = view.camera.viewTransform;
sceneX = (((((screenX / persp) * inv.sxx) + ((screenY / persp) * inv.sxy)) + (screenZ * inv.sxz)) + inv.tx);
sceneY = (((((screenX / persp) * inv.syx) + ((screenY / persp) * inv.syy)) + (screenZ * inv.syz)) + inv.ty);
sceneZ = (((((screenX / persp) * inv.szx) + ((screenY / persp) * inv.szy)) + (screenZ * inv.szz)) + inv.tz);
drawpri = _arg1;
object = _arg1.source;
element = null;
};
};
}
public function getMouseEvent(_arg1:String):MouseEvent3D{
var _local2:MouseEvent3D = new MouseEvent3D(_arg1);
_local2.screenX = screenX;
_local2.screenY = screenY;
_local2.screenZ = screenZ;
_local2.sceneX = sceneX;
_local2.sceneY = sceneY;
_local2.sceneZ = sceneZ;
_local2.view = view;
_local2.drawpri = drawpri;
_local2.material = material;
_local2.element = element;
_local2.object = object;
_local2.uv = uv;
return (_local2);
}
}
}//package away3d.core.render
Section 58
//IRenderer (away3d.core.render.IRenderer)
package away3d.core.render {
import away3d.containers.*;
public interface IRenderer {
function toString():String;
function set session(_arg1:AbstractRenderSession):void;
function render(_arg1:View3D):Array;
function get session():AbstractRenderSession;
}
}//package away3d.core.render
Section 59
//Projection (away3d.core.render.Projection)
package away3d.core.render {
import away3d.core.math.*;
public class Projection {
public var zoom:Number;
public var view:Matrix3D;
public var focus:Number;
public var time:int;
}
}//package away3d.core.render
Section 60
//SpriteRenderSession (away3d.core.render.SpriteRenderSession)
package away3d.core.render {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import away3d.containers.*;
import away3d.core.clip.*;
public class SpriteRenderSession extends AbstractRenderSession {
private var _container:Sprite;
private var _clip:Clipping;
public function SpriteRenderSession():void{
}
override public function addDisplayObject(_arg1:DisplayObject):void{
_container.addChild(_arg1);
_arg1.visible = true;
children[_arg1] = _arg1;
_layerDirty = true;
}
override public function get view():View3D{
return (_view);
}
override public function set view(_arg1:View3D):void{
super.view = _arg1;
_container = (getContainer(_view) as Sprite);
graphics = _container.graphics;
if (this == view.session){
_clip = _view.clip;
_container.scrollRect = new Rectangle((_clip.minX - 1), (_clip.minY - 1), ((_clip.maxX - _clip.minX) + 2), ((_clip.maxY - _clip.minY) + 2));
_container.x = (_clip.minX - 1);
_container.y = (_clip.minY - 1);
};
}
override public function getContainer(_arg1:View3D):DisplayObject{
if (!_containers[_arg1]){
return ((_containers[_arg1] = new Sprite()));
};
return (_containers[_arg1]);
}
override public function clear():void{
super.clear();
_container.graphics.clear();
i = _container.numChildren;
while (i--) {
_container.removeChild(_container.getChildAt(i));
};
children = new Dictionary(true);
newLayer = null;
graphics = _container.graphics;
}
override public function addLayerObject(_arg1:Sprite):void{
_container.addChild(_arg1);
_arg1.visible = true;
children[_arg1] = _arg1;
newLayer = _arg1;
}
override protected function createLayer():void{
if (doStore.length){
_shape = doStore.pop();
} else {
_shape = new Shape();
};
graphics = _shape.graphics;
doActive.push(_shape);
_container.addChild(_shape);
_layerDirty = false;
}
override public function flush():void{
super.flush();
}
override public function clone():AbstractRenderSession{
return (new SpriteRenderSession());
}
}
}//package away3d.core.render
Section 61
//Stats (away3d.core.stats.Stats)
package away3d.core.stats {
import flash.events.*;
import flash.system.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.text.*;
import away3d.containers.*;
import away3d.core.base.*;
import away3d.cameras.*;
import flash.net.*;
import flash.ui.*;
public class Stats extends Sprite {
private const APPLICATION_NAME:String = "Away3D.com";
private const VERSION:String = "2";
private const REVISION:String = "1.0";
private var meshLabel:TextField;
private var bar:Sprite;
private var barscale:int;// = 0
private var swfframerateLabel:TextField;
private var cambtn:Sprite;
private var geomDetailsLabel:TextField;
public var displayMenu:Sprite;// = null
private var geomLastAdded:String;
var type:String;
private var defautTF:TextFormat;
public var sourceURL:String;
private var peakLabel:TextField;
private var meshes:int;// = 0
private var faceRenderLabel:TextField;
private var closebtn:Sprite;
private var camLabel:TextField;
private var rectcam:Rectangle;
var url:String;
private var ramLabel:TextField;
private var bestfps:int;// = 0
private var titleField:TextField;
private var fpsLabel:TextField;
private var stageframerate:Number;
private var perfLabel:TextField;
private var barwidth:int;// = 0
private var rectclose:Rectangle;
private var faceLabel:TextField;
public var stats:String;// = ""
private var geombtn:Sprite;
private var lastrender:int;
private var menu0:ContextMenuItem;
private var menu1:ContextMenuItem;
private var menu2:ContextMenuItem;
public var geomMenu:Sprite;// = null
private var avfpsLabel:TextField;
private var refreshes:int;// = 0
private var camMenu:Sprite;
private var totalFaces:int;// = 0
public var scopeMenu:View3D;// = null
private var camProp:Array;
private var rectclear:Rectangle;
var facecount:int;
private var rectdetails:Rectangle;
private var clearbtn:Sprite;
private var lowestfps:int;// = 999
private var fpstotal:int;// = 0
private var displayState:int;
public function Stats(_arg1:View3D, _arg2:Number=0){
rectclose = new Rectangle(228, 4, 18, 17);
rectcam = new Rectangle(207, 4, 18, 17);
rectclear = new Rectangle(186, 4, 18, 17);
rectdetails = new Rectangle(165, 4, 18, 17);
defautTF = new TextFormat("Verdana", 10, 0);
super();
scopeMenu = _arg1;
stageframerate = (_arg2) ? _arg2 : 30;
displayState = 0;
sourceURL = _arg1.sourceURL;
menu0 = new ContextMenuItem("Away3D Project stats", true, true, true);
menu1 = new ContextMenuItem("View Source", true, true, true);
menu2 = new ContextMenuItem(((((APPLICATION_NAME + "\tv") + VERSION) + ".") + REVISION), true, true, true);
scopeMenu.contextMenu = new ContextMenu();
scopeMenu.contextMenu.customItems = (sourceURL) ? [menu0, menu1, menu2] : [menu0, menu2];
menu0.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, displayStats);
menu1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, viewSource);
menu2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, visitWebsite);
scopeMenu.contextMenu.hideBuiltInItems();
}
private function mouseReleased(_arg1:MouseEvent):void{
displayMenu.stopDrag();
scopeMenu.removeEventListener(MouseEvent.MOUSE_UP, mouseReleased);
}
private function createGeometryMenu():void{
geomMenu = new Sprite();
var _local1:Matrix = new Matrix();
_local1.rotate(((90 * Math.PI) / 180));
geomMenu.graphics.beginGradientFill("linear", [3355494, 0xCCCCCC], [1, 1], [0, 0xFF], _local1, "pad", "rgb", 0);
geomMenu.graphics.drawRect(0, 0, 250, 200);
displayMenu.addChild(geomMenu);
geomMenu.y = 26;
geomDetailsLabel = new TextField();
geomDetailsLabel.x = 3;
geomDetailsLabel.y = 3;
geomDetailsLabel.defaultTextFormat = defautTF;
geomDetailsLabel.text = stats;
geomDetailsLabel.height = 200;
geomDetailsLabel.width = 235;
geomDetailsLabel.multiline = true;
geomDetailsLabel.selectable = true;
geomDetailsLabel.wordWrap = true;
geomMenu.addChild(geomDetailsLabel);
}
public function clearObjects():void{
stats = "";
totalFaces = 0;
meshes = 0;
geomLastAdded = "";
}
public function viewSource(_arg1:ContextMenuEvent):void{
var e = _arg1;
var request:URLRequest = new URLRequest(sourceURL);
try {
navigateToURL(request, "_blank");
} catch(error:Error) {
};
}
private function showGeomInfo():void{
if (geomMenu == null){
createGeometryMenu();
} else {
displayMenu.addChild(geomMenu);
geomMenu.y = 26;
};
}
private function createCamMenu():void{
camMenu = new Sprite();
var _local1:Matrix = new Matrix();
_local1.rotate(((90 * Math.PI) / 180));
camMenu.graphics.beginGradientFill("linear", [3355494, 0xCCCCCC], [1, 1], [0, 0xFF], _local1, "pad", "rgb", 0);
camMenu.graphics.drawRect(0, 0, 250, 220);
displayMenu.addChild(camMenu);
camMenu.y = 26;
camLabel = new TextField();
camLabel.height = 210;
camLabel.width = 170;
camLabel.x = 100;
camLabel.multiline = true;
var _local2:TextFormat = defautTF;
_local2.leading = 1.5;
camLabel.defaultTextFormat = _local2;
camLabel.wordWrap = true;
camMenu.addChild(camLabel);
camLabel.x = 100;
camLabel.y = 3;
camProp = ["x", "y", "z", "zoom", "focus", "distance", "panangle", "tiltangle", "targetpanangle", "targettiltangle", "mintiltangle", "maxtiltangle", "steps", "target"];
var _local3:TextField = new TextField();
_local2 = new TextFormat("Verdana", 10, 0, true);
_local2.leading = 1.5;
_local2.align = "right";
_local3.defaultTextFormat = _local2;
_local3.x = (_local3.y = 3);
_local3.multiline = true;
_local3.selectable = false;
_local3.autoSize = "left";
_local3.height = 210;
var _local4:int;
while (_local4 < camProp.length) {
_local3.appendText((camProp[_local4] + ":\n"));
_local4++;
};
camMenu.addChild(_local3);
}
public function addObject(_arg1:BaseMesh):void{
type = _arg1.type;
if ((_arg1 is Mesh)){
facecount = (_arg1 as Mesh).faces.length;
} else {
facecount = 0;
};
url = _arg1.url;
if (((!((type == null))) && (!((facecount == 0))))){
stats = (stats + ((((((" - " + type) + " , faces: ") + facecount) + ", url: ") + url) + "\n"));
geomLastAdded = ((((((" - " + type) + " , faces: ") + facecount) + ", url: ") + url) + "\n");
totalFaces = (totalFaces + facecount);
meshes = (meshes + 1);
} else {
stats = (stats + ((((" - " + type) + " , url: ") + url) + "\n"));
geomLastAdded = ((((" - " + type) + " , url: ") + url) + "\n");
};
}
public function updateStats(_arg1:int, _arg2:Camera3D):void{
var fps:int;
var average:int;
var w:int;
var caminfo:String;
var i:int;
var info:String;
var renderedfaces = _arg1;
var camera = _arg2;
var now:int = getTimer();
var perf:int = (now - lastrender);
lastrender = now;
if (perf < 1000){
fps = int((1000 / (perf + 0.001)));
fpstotal = (fpstotal + fps);
refreshes++;
average = (fpstotal / refreshes);
bestfps = ((fps)>bestfps) ? fps : bestfps;
lowestfps = ((fps)<lowestfps) ? fps : lowestfps;
w = (barscale * fps);
bar.width = ((w)<=barwidth) ? w : barwidth;
};
var procent:int = ((bar.width / barwidth) * 100);
var colorTransform:ColorTransform = bar.transform.colorTransform;
colorTransform.color = ((((0xFF - (2.55 * procent)) << 16) | ((2.55 * procent) << 8)) | 40);
bar.transform.colorTransform = colorTransform;
if (displayState == 0){
avfpsLabel.text = ("" + average);
ramLabel.text = (("" + (int(((System.totalMemory / 0x0400) / 102.4)) / 10)) + "MB");
peakLabel.text = ((lowestfps + "/") + bestfps);
fpsLabel.text = ("" + fps);
perfLabel.text = ("" + perf);
faceLabel.text = ("" + totalFaces);
faceRenderLabel.text = ("" + renderedfaces);
meshLabel.text = ("" + meshes);
swfframerateLabel.text = ("" + stageframerate);
} else {
if (displayState == 1){
caminfo = "";
i = 0;
while (i < camProp.length) {
try {
if (i > 12){
caminfo = (caminfo + (String(camera[camProp[i]]) + "\n"));
} else {
info = String(camera[camProp[i]]);
caminfo = (caminfo + (info.substring(0, 19) + "\n"));
};
} catch(e:Error) {
caminfo = (caminfo + "\n");
};
i = (i + 1);
};
camLabel.text = caminfo;
} else {
if (displayState == 2){
geomDetailsLabel.text = stats;
geomDetailsLabel.scrollV = geomDetailsLabel.maxScrollV;
};
};
};
}
private function clearStats():void{
fpstotal = 0;
refreshes = 0;
bestfps = 0;
lowestfps = 999;
}
private function showCamInfo():void{
if (camMenu == null){
createCamMenu();
} else {
displayMenu.addChild(camMenu);
camMenu.y = 26;
};
}
private function get image():Array{
return ([[7, 1, 262151], [8, 1, 3215136], [9, 1, 2033436], [10, 1, 1], [7, 2, 2098723], [8, 2, 5908501], [9, 2, 4922400], [10, 2, 720913], [6, 3, 327691], [7, 3, 6957102], [8, 3, 5975556], [9, 3, 6368779], [10, 3, 4789809], [11, 3, 2], [6, 4, 2361127], [7, 4, 10833686], [8, 4, 4926728], [9, 4, 6239495], [10, 4, 9190690], [11, 4, 1114647], [5, 5, 786453], [6, 5, 7088423], [7, 5, 14055707], [8, 5, 2103310], [9, 5, 3877139], [10, 5, 13134098], [11, 5, 5577773], [12, 5, 131077], [4, 6, 1], [5, 6, 3608110], [6, 6, 11227664], [7, 6, 12748351], [8, 6, 65793], [9, 6, 986379], [10, 6, 14980667], [11, 6, 10044437], [12, 6, 2230306], [4, 7, 0x12001C], [5, 7, 8007967], [6, 7, 14911011], [7, 7, 6509633], [10, 7, 9138771], [11, 7, 13989655], [12, 7, 7350824], [13, 7, 327689], [3, 8, 262153], [4, 8, 4592689], [5, 8, 12016138], [6, 8, 15774570], [7, 8, 855309], [10, 8, 2434083], [11, 8, 16233056], [12, 8, 11489803], [13, 8, 3345958], [3, 9, 1966887], [4, 9, 8665113], [5, 9, 15636021], [6, 9, 6773581], [11, 9, 9140836], [12, 9, 15240489], [13, 9, 8467743], [14, 9, 852240], [2, 10, 458767], [3, 10, 5774639], [4, 10, 13265683], [5, 10, 10845518], [6, 10, 0x0101], [11, 10, 657931], [12, 10, 14396016], [13, 10, 12739344], [14, 10, 5184297], [15, 10, 2], [2, 11, 2557230], [3, 11, 10307863], [4, 11, 12548133], [5, 11, 723464], [12, 11, 1512721], [13, 11, 14651446], [14, 11, 10307352], [15, 11, 1508630], [1, 12, 983068], [2, 12, 7154221], [3, 12, 9522185], [4, 12, 1314568], [6, 12, 131586], [7, 12, 921102], [8, 12, 0x1A1A1A], [9, 12, 0x171717], [10, 12, 657930], [13, 12, 2892051], [14, 12, 12610067], [15, 12, 7220009], [16, 12, 196614], [1, 13, 3936052], [2, 13, 5908749], [3, 13, 1773570], [4, 13, 4402968], [5, 13, 10714191], [6, 13, 12884326], [7, 13, 14396274], [8, 13, 15053429], [9, 13, 14790257], [10, 13, 13935206], [11, 13, 12159571], [12, 13, 9265971], [13, 13, 2759432], [14, 13, 2561537], [15, 13, 8601360], [16, 13, 3346464], [1, 14, 3938326], [2, 14, 5712395], [3, 14, 10900499], [4, 14, 11951126], [5, 14, 11490833], [6, 14, 11358991], [7, 14, 11227662], [8, 14, 11161870], [9, 14, 11030286], [10, 14, 10964497], [11, 14, 10898963], [12, 14, 10833429], [13, 14, 11096344], [14, 14, 8797973], [15, 14, 4595726], [16, 14, 4594459], [17, 14, 327941], [1, 15, 2296596], [2, 15, 3280925], [3, 15, 2821148], [4, 15, 2624284], [5, 15, 2558749], [6, 15, 2624031], [7, 15, 2558496], [8, 15, 2558498], [9, 15, 2492705], [10, 15, 2361630], [11, 15, 2361374], [12, 15, 2295839], [13, 15, 2295840], [14, 15, 2427171], [15, 15, 2624036], [16, 15, 1377300]]);
}
private function hideGeomInfo():void{
if (geomMenu != null){
displayMenu.removeChild(geomMenu);
};
}
private function hideCamInfo():void{
if (camMenu != null){
displayMenu.removeChild(camMenu);
};
}
private function closeOtherScreen(_arg1:int):void{
switch (_arg1){
case 1:
hideCamInfo();
break;
case 2:
hideGeomInfo();
};
}
private function closeStats():void{
scopeMenu.statsOpen = false;
displayState = 0;
scopeMenu.removeEventListener(MouseEvent.MOUSE_DOWN, onCheckMouse);
scopeMenu.removeEventListener(MouseEvent.MOUSE_MOVE, updateTips);
scopeMenu.removeChild(displayMenu);
displayMenu = null;
}
private function updateTips(_arg1:MouseEvent):void{
var x:Number;
var y:Number;
var pt:Point;
var me = _arg1;
if (scopeMenu != null){
x = displayMenu.mouseX;
y = displayMenu.mouseY;
pt = new Point(x, y);
try {
if (rectcam.containsPoint(pt)){
titleField.text = "CAMERA INFO";
} else {
if (rectclose.containsPoint(pt)){
titleField.text = "CLOSE STATS";
} else {
if (rectclear.containsPoint(pt)){
titleField.text = "CLEAR AVERAGES";
} else {
if (rectdetails.containsPoint(pt)){
titleField.text = "MESH INFO";
} else {
titleField.text = "AWAY3D PROJECT";
};
};
};
};
} catch(e:Error) {
};
};
}
private function generateSprite():void{
displayMenu = new Sprite();
var _local1:Matrix = new Matrix();
_local1.rotate(((90 * Math.PI) / 180));
displayMenu.graphics.beginGradientFill("linear", [3355494, 0xCCCCCC], [1, 1], [0, 0xFF], _local1, "pad", "rgb", 0);
displayMenu.graphics.drawRect(0, 0, 250, 86);
displayMenu.graphics.beginFill(3355494);
displayMenu.graphics.drawRect(3, 3, 244, 20);
scopeMenu.addChild(displayMenu);
displayMenu.x = (displayMenu.x - (displayMenu.width * 0.5));
displayMenu.y = (displayMenu.y - (displayMenu.height * 0.5));
closebtn = new Sprite();
closebtn.graphics.beginFill(0x666666);
closebtn.graphics.drawRect(0, 0, 18, 17);
var _local2:Sprite = new Sprite();
_local2.graphics.beginFill(13029592);
_local2.graphics.drawRect(2, 7, 14, 4);
_local2.graphics.endFill();
_local2.graphics.beginFill(13029592);
_local2.graphics.drawRect(7, 2, 4, 14);
_local2.graphics.endFill();
_local2.rotation = 45;
_local2.x = (_local2.x + 9);
_local2.y = (_local2.y - 4);
closebtn.addChild(_local2);
displayMenu.addChild(closebtn);
closebtn.x = 228;
closebtn.y = 4;
cambtn = new Sprite();
var _local3:Graphics = cambtn.graphics;
_local3.beginFill(0x666666);
_local3.drawRect(0, 0, 18, 17);
_local3.endFill();
_local3.beginFill(13029592);
_local3.moveTo(10, 8);
_local3.lineTo(16, 4);
_local3.lineTo(16, 14);
_local3.lineTo(10, 10);
_local3.lineTo(10, 8);
_local3.drawRect(2, 6, 8, 6);
_local3.endFill();
displayMenu.addChild(cambtn);
cambtn.x = 207;
cambtn.y = 4;
clearbtn = new Sprite();
var _local4:Graphics = clearbtn.graphics;
_local4.beginFill(0x666666);
_local4.drawRect(0, 0, 18, 17);
_local4.endFill();
_local4.beginFill(13029592);
_local4.drawRect(6, 6, 6, 6);
_local4.endFill();
displayMenu.addChild(clearbtn);
clearbtn.x = 186;
clearbtn.y = 4;
geombtn = new Sprite();
var _local5:Graphics = geombtn.graphics;
_local5.beginFill(0x666666);
_local5.drawRect(0, 0, 18, 17);
_local5.endFill();
_local5.beginFill(13029592, 0.7);
_local5.moveTo(3, 4);
_local5.lineTo(11, 2);
_local5.lineTo(16, 5);
_local5.lineTo(7, 7);
_local5.lineTo(3, 4);
_local5.beginFill(8225929, 0.8);
_local5.moveTo(3, 4);
_local5.lineTo(7, 7);
_local5.lineTo(7, 16);
_local5.lineTo(3, 12);
_local5.lineTo(3, 4);
_local5.beginFill(13029592, 1);
_local5.moveTo(7, 7);
_local5.lineTo(16, 5);
_local5.lineTo(15, 13);
_local5.lineTo(7, 16);
_local5.lineTo(7, 7);
_local5.endFill();
_local5.endFill();
displayMenu.addChild(geombtn);
geombtn.x = 165;
geombtn.y = 4;
displayMenu.graphics.beginGradientFill("linear", [0, 0xFFFFFF], [1, 1], [0, 0xFF], new Matrix(), "pad", "rgb", 0);
displayMenu.graphics.drawRect(3, 22, 244, 4);
displayMenu.graphics.endFill();
bar = new Sprite();
bar.graphics.beginFill(0xFFFFFF);
bar.graphics.drawRect(0, 0, 244, 4);
displayMenu.addChild(bar);
bar.x = 3;
bar.y = 22;
barwidth = 244;
barscale = int((barwidth / stageframerate));
displayPicto();
titleField = new TextField();
titleField.defaultTextFormat = new TextFormat("Verdana", 10, 0xFFFFFF, true, null, null, null, null, "left");
titleField.text = "AWAY3D PROJECT";
titleField.selectable = false;
titleField.height = 20;
titleField.width = 140;
titleField.x = 22;
titleField.y = 4;
displayMenu.addChild(titleField);
var _local6:TextField = new TextField();
_local6.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local6.text = "FPS:";
fpsLabel = new TextField();
fpsLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local6);
displayMenu.addChild(fpsLabel);
_local6.x = 3;
_local6.y = (fpsLabel.y = 30);
_local6.autoSize = "left";
fpsLabel.x = ((_local6.x + _local6.width) - 2);
var _local7:TextField = new TextField();
_local7.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local7.text = "AFPS:";
avfpsLabel = new TextField();
avfpsLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local7);
displayMenu.addChild(avfpsLabel);
_local7.x = 52;
_local7.y = (avfpsLabel.y = fpsLabel.y);
_local7.autoSize = "left";
avfpsLabel.x = ((_local7.x + _local7.width) - 2);
var _local8:TextField = new TextField();
_local8.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local8.text = "Max:";
peakLabel = new TextField();
peakLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local8);
displayMenu.addChild(peakLabel);
_local8.x = 107;
_local8.y = (peakLabel.y = avfpsLabel.y);
_local8.autoSize = "left";
peakLabel.x = ((_local8.x + _local8.width) - 2);
var _local9:TextField = new TextField();
_local9.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local9.text = "MS:";
perfLabel = new TextField();
perfLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local9);
displayMenu.addChild(perfLabel);
_local9.x = 177;
_local9.y = (perfLabel.y = fpsLabel.y);
_local9.autoSize = "left";
perfLabel.x = ((_local9.x + _local9.width) - 2);
var _local10:TextField = new TextField();
_local10.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local10.text = "RAM:";
ramLabel = new TextField();
ramLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local10);
displayMenu.addChild(ramLabel);
_local10.x = 3;
_local10.y = (ramLabel.y = 46);
_local10.autoSize = "left";
ramLabel.x = ((_local10.x + _local10.width) - 2);
var _local11:TextField = new TextField();
_local11.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local11.text = "MESHES:";
meshLabel = new TextField();
meshLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local11);
displayMenu.addChild(meshLabel);
_local11.x = 90;
_local11.y = (meshLabel.y = ramLabel.y);
_local11.autoSize = "left";
meshLabel.x = ((_local11.x + _local11.width) - 2);
var _local12:TextField = new TextField();
_local12.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local12.text = "SWF FR:";
swfframerateLabel = new TextField();
swfframerateLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local12);
displayMenu.addChild(swfframerateLabel);
_local12.x = 170;
_local12.y = (swfframerateLabel.y = ramLabel.y);
_local12.autoSize = "left";
swfframerateLabel.x = ((_local12.x + _local12.width) - 2);
var _local13:TextField = new TextField();
_local13.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local13.text = "T FACES:";
faceLabel = new TextField();
faceLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local13);
displayMenu.addChild(faceLabel);
_local13.x = 3;
_local13.y = (faceLabel.y = 62);
_local13.autoSize = "left";
faceLabel.x = ((_local13.x + _local13.width) - 2);
var _local14:TextField = new TextField();
_local14.defaultTextFormat = new TextFormat("Verdana", 10, 0, true);
_local14.text = "R FACES:";
faceRenderLabel = new TextField();
faceRenderLabel.defaultTextFormat = defautTF;
displayMenu.addChild(_local14);
displayMenu.addChild(faceRenderLabel);
_local14.x = 105;
_local14.y = (faceRenderLabel.y = faceLabel.y);
_local14.autoSize = "left";
faceRenderLabel.x = ((_local14.x + _local14.width) - 2);
}
public function addSourceURL(_arg1:String):void{
sourceURL = _arg1;
scopeMenu.contextMenu.customItems = (sourceURL) ? [menu0, menu1, menu2] : [menu0, menu2];
}
private function onCheckMouse(_arg1:MouseEvent):void{
var _local2:Number = displayMenu.mouseX;
var _local3:Number = displayMenu.mouseY;
var _local4:Point = new Point(_local2, _local3);
if (rectcam.containsPoint(_local4)){
if (displayState != 1){
closeOtherScreen(displayState);
displayState = 1;
showCamInfo();
} else {
displayState = 0;
hideCamInfo();
};
} else {
if (rectdetails.containsPoint(_local4)){
if (displayState != 2){
closeOtherScreen(displayState);
displayState = 2;
showGeomInfo();
} else {
displayState = 0;
hideGeomInfo();
};
} else {
if (rectclose.containsPoint(_local4)){
closeStats();
} else {
if (rectclear.containsPoint(_local4)){
clearStats();
} else {
displayMenu.startDrag();
scopeMenu.addEventListener(MouseEvent.MOUSE_UP, mouseReleased);
};
};
};
};
}
private function addEventMouse():void{
scopeMenu.addEventListener(MouseEvent.MOUSE_DOWN, onCheckMouse);
scopeMenu.addEventListener(MouseEvent.MOUSE_MOVE, updateTips);
}
public function visitWebsite(_arg1:ContextMenuEvent):void{
var e = _arg1;
var url = "http://www.away3d.com";
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request);
} catch(error:Error) {
};
}
private function displayPicto():void{
var _local1:Sprite = new Sprite();
var _local2:Graphics = _local1.graphics;
_local2.beginFill(0);
_local2.drawRect(0, 0, 18, 17);
var _local3:Array = image;
var _local4:int;
while (_local4 < _local3.length) {
_local2.beginFill(Number(_local3[_local4][2]));
_local2.drawRect(_local3[_local4][0], _local3[_local4][1], 1, 1);
_local4++;
};
_local2.endFill();
displayMenu.addChild(_local1);
_local1.x = (_local1.y = 4);
}
public function displayStats(_arg1:ContextMenuEvent):void{
if (!displayMenu){
scopeMenu.statsOpen = true;
generateSprite();
addEventMouse();
};
}
}
}//package away3d.core.stats
Section 62
//BlockerTraverser (away3d.core.traverse.BlockerTraverser)
package away3d.core.traverse {
import away3d.containers.*;
import away3d.core.base.*;
import away3d.core.block.*;
public class BlockerTraverser extends Traverser {
public var view:View3D;
public var consumer:IBlockerConsumer;
override public function match(_arg1:Object3D):Boolean{
if (!_arg1.visible){
return (false);
};
if ((_arg1 is ILODObject)){
return ((_arg1 as ILODObject).matchLOD(view));
};
return (true);
}
override public function apply(_arg1:Object3D):void{
if ((_arg1 is IBlockerProvider)){
(_arg1 as IBlockerProvider).blockers(consumer);
};
}
}
}//package away3d.core.traverse
Section 63
//PrimitiveTraverser (away3d.core.traverse.PrimitiveTraverser)
package away3d.core.traverse {
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.base.*;
import away3d.core.light.*;
public class PrimitiveTraverser extends Traverser {
private var _focus:Number;
private var _sessions:Array;
private var _view:View3D;
private var _zoom:Number;
public var consumer:IPrimitiveConsumer;
private var _session:AbstractRenderSession;
private var _lights:ILightConsumer;
override public function match(_arg1:Object3D):Boolean{
if (!_arg1.visible){
return (false);
};
if ((_arg1 is ILODObject)){
return ((_arg1 as ILODObject).matchLOD(_view));
};
return (true);
}
override public function enter(_arg1:Object3D):void{
_sessions.push(_session);
}
public function set session(_arg1:AbstractRenderSession):void{
_session = _arg1;
_sessions = [];
_lights = _session.lightarray;
_view = _session.view;
_focus = _view.camera.focus;
_zoom = _view.camera.zoom;
}
override public function apply(_arg1:Object3D):void{
if ((_arg1 is IPrimitiveProvider)){
(_arg1 as IPrimitiveProvider).primitives(consumer, _session);
_session = _arg1.session;
};
if ((_arg1 is ILightProvider)){
(_arg1 as ILightProvider).light(_lights);
};
}
public function get session():AbstractRenderSession{
return (_session);
}
override public function leave(_arg1:Object3D):void{
_session = _sessions.pop();
}
}
}//package away3d.core.traverse
Section 64
//ProjectionTraverser (away3d.core.traverse.ProjectionTraverser)
package away3d.core.traverse {
import flash.utils.*;
import away3d.containers.*;
import away3d.core.render.*;
import away3d.core.math.*;
import away3d.core.base.*;
public class ProjectionTraverser extends Traverser {
private var _view:View3D;
private var _cameraview:Matrix3D;
private var _projection:Projection;
public function get view():View3D{
return (_view);
}
public function set view(_arg1:View3D):void{
_view = _arg1;
_cameraview = _view.camera.view;
if (_view.statsOpen){
_view.statsPanel.clearObjects();
};
}
override public function match(_arg1:Object3D):Boolean{
if (!_arg1.visible){
return (false);
};
_arg1.viewTransform.multiply(_cameraview, _arg1.sceneTransform);
_projection = _arg1.projection;
_projection.view = _arg1.viewTransform;
_projection.focus = _view.camera.focus;
_projection.zoom = _view.camera.zoom;
_projection.time = getTimer();
if ((_arg1 is ILODObject)){
return ((_arg1 as ILODObject).matchLOD(_view));
};
return (true);
}
override public function enter(_arg1:Object3D):void{
if (((_view.statsOpen) && ((_arg1 is BaseMesh)))){
_view.statsPanel.addObject((_arg1 as BaseMesh));
};
}
}
}//package away3d.core.traverse
Section 65
//TickTraverser (away3d.core.traverse.TickTraverser)
package away3d.core.traverse {
import away3d.core.base.*;
public class TickTraverser extends Traverser {
public var now:int;
override public function enter(_arg1:Object3D):void{
_arg1.tick(now);
}
}
}//package away3d.core.traverse
Section 66
//Traverser (away3d.core.traverse.Traverser)
package away3d.core.traverse {
import away3d.core.base.*;
public class Traverser {
public function enter(_arg1:Object3D):void{
}
public function match(_arg1:Object3D):Boolean{
return (true);
}
public function apply(_arg1:Object3D):void{
}
public function leave(_arg1:Object3D):void{
}
}
}//package away3d.core.traverse
Section 67
//CacheStore (away3d.core.utils.CacheStore)
package away3d.core.utils {
import flash.utils.*;
public class CacheStore {
public static var whiteShadingCache:Dictionary = new Dictionary(true);
}
}//package away3d.core.utils
Section 68
//Cast (away3d.core.utils.Cast)
package away3d.core.utils {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import away3d.materials.*;
public class Cast {
private static var colornames:Dictionary;
private static var hexchars:String = "0123456789abcdefABCDEF";
private static var classes:Dictionary = new Dictionary();
private static var notclasses:Dictionary = new Dictionary();
public static function color(_arg1):uint{
var _local2:uint = trycolor(_arg1);
if (_local2 == 4294967295){
throw (new CastError(("Can't cast to color: " + _arg1)));
};
return (_local2);
}
public static function material(_arg1):ITriangleMaterial{
var hash:Array;
var line:Array;
var bmd:BitmapData;
var ini:Init;
var bitmap:BitmapData;
var color:uint;
var alpha:Number;
var lighting:Boolean;
var wire:WireframeMaterial;
var smooth:Boolean;
var precision:Number;
var data = _arg1;
if (data == null){
return (null);
};
if ((data is String)){
data = tryclass(data);
};
if ((data is Class)){
try {
data = new (data);
} catch(materialerror:ArgumentError) {
data = new data(0, 0);
};
};
if ((data is IMaterial)){
return (data);
};
if ((data is int)){
return (new ColorMaterial(data));
};
if ((data is MovieClip)){
return (new MovieMaterial(data));
};
if ((data is String)){
if (data == ""){
return (null);
};
if ((data as String).indexOf("#") != -1){
hash = (data as String).split("#");
if (hash[1] == ""){
return (new WireColorMaterial(color(hash[0])));
};
if (hash[1].indexOf("|") == -1){
if (hash[0] == ""){
return (new WireframeMaterial(color(hash[1])));
};
return (new WireColorMaterial(color(hash[0]), {wirecolor:color(hash[1])}));
} else {
line = hash[1].split("|");
if (hash[0] == ""){
return (new WireframeMaterial(color(line[0]), {width:parseFloat(line[1])}));
};
return (new WireColorMaterial(color(hash[0]), {wirecolor:color(line[0]), width:parseFloat(line[1])}));
};
} else {
if ((data as String).indexOf("@") != -1){
hash = (data as String).split("@");
if (hash[1] == ""){
return (new ShadingColorMaterial({color:color(hash[0])}));
};
} else {
return (new ColorMaterial(color(data)));
};
};
};
try {
bmd = Cast.bitmap(data);
return (new BitmapMaterial(bmd));
} catch(error:CastError) {
};
if ((data is Object)){
ini = Init.parse(data);
bitmap = ini.getBitmap("bitmap");
color = ini.getColor("color", 4294967295);
alpha = ini.getNumber("alpha", 1, {min:0, max:1});
lighting = ini.getBoolean("lighting", false);
wire = (wirematerial(ini.getObject("wire")) as WireframeMaterial);
if (((!((bitmap == null))) && (!((color == 4294967295))))){
throw (new CastError(("Can't create material with color and bitmap: " + data)));
};
if (bitmap != null){
if (wire != null){
Debug.warning("Bitmap materials do not support wire");
};
smooth = ini.getBoolean("smooth", false);
precision = ini.getNumber("precision", 0);
if (precision){
if (lighting){
return (new WhiteShadingBitmapMaterial(bitmap, {smooth:smooth, precision:precision}));
};
if (alpha < 1){
Debug.warning("Can't create precise bitmap material with alpha (yet)");
};
return (new BitmapMaterial(bitmap, {smooth:smooth, precision:precision}));
};
if (lighting){
if (alpha < 1){
Debug.warning("Can't create bitmap material with lighting and alpha (yet)");
};
return (new WhiteShadingBitmapMaterial(bitmap, {smooth:smooth, alpha:alpha}));
};
return (new BitmapMaterial(bitmap, {smooth:smooth}));
};
if (color != 4294967295){
if (lighting){
if (wire != null){
Debug.warning("Can't create shading material with wire");
};
return (new ShadingColorMaterial({color:color, alpha:alpha}));
};
if (wire == null){
return (new ColorMaterial(color, {alpha:alpha}));
};
return (new WireColorMaterial(color, {alpha:alpha, wirecolor:wire.color, wirealpha:wire.alpha, width:wire.width}));
};
if (wire != null){
return (wire);
};
};
throw (new CastError(("Can't cast to material: " + data)));
}
public static function trycolor(_arg1):uint{
if ((_arg1 is uint)){
return ((_arg1 as uint));
};
if ((_arg1 is int)){
return ((_arg1 as uint));
};
if ((_arg1 is String)){
if (_arg1 == "random"){
return (uint((Math.random() * 16777216)));
};
if (colornames == null){
colornames = new Dictionary();
colornames["steelblue"] = 4620980;
colornames["royalblue"] = 267920;
colornames["cornflowerblue"] = 6591981;
colornames["lightsteelblue"] = 11584734;
colornames["mediumslateblue"] = 8087790;
colornames["slateblue"] = 6970061;
colornames["darkslateblue"] = 4734347;
colornames["midnightblue"] = 1644912;
colornames["navy"] = 128;
colornames["darkblue"] = 139;
colornames["mediumblue"] = 205;
colornames["blue"] = 0xFF;
colornames["dodgerblue"] = 2003199;
colornames["deepskyblue"] = 49151;
colornames["lightskyblue"] = 8900346;
colornames["skyblue"] = 8900331;
colornames["lightblue"] = 11393254;
colornames["powderblue"] = 11591910;
colornames["azure"] = 15794175;
colornames["lightcyan"] = 14745599;
colornames["paleturquoise"] = 11529966;
colornames["mediumturquoise"] = 4772300;
colornames["lightseagreen"] = 2142890;
colornames["darkcyan"] = 0x8B8B;
colornames["teal"] = 0x8080;
colornames["cadetblue"] = 6266528;
colornames["darkturquoise"] = 52945;
colornames["aqua"] = 0xFFFF;
colornames["cyan"] = 0xFFFF;
colornames["turquoise"] = 4251856;
colornames["aquamarine"] = 8388564;
colornames["mediumaquamarine"] = 6737322;
colornames["darkseagreen"] = 9419919;
colornames["mediumseagreen"] = 3978097;
colornames["seagreen"] = 3050327;
colornames["darkgreen"] = 0x6400;
colornames["green"] = 0x8000;
colornames["forestgreen"] = 2263842;
colornames["limegreen"] = 3329330;
colornames["lime"] = 0xFF00;
colornames["chartreuse"] = 0x7FFF00;
colornames["lawngreen"] = 0x7CFC00;
colornames["greenyellow"] = 11403055;
colornames["yellowgreen"] = 10145074;
colornames["palegreen"] = 10025880;
colornames["lightgreen"] = 9498256;
colornames["springgreen"] = 65407;
colornames["mediumspringgreen"] = 64154;
colornames["darkolivegreen"] = 5597999;
colornames["olivedrab"] = 7048739;
colornames["olive"] = 0x808000;
colornames["darkkhaki"] = 12433259;
colornames["darkgoldenrod"] = 12092939;
colornames["goldenrod"] = 14329120;
colornames["gold"] = 0xFFD700;
colornames["yellow"] = 0xFFFF00;
colornames["khaki"] = 15787660;
colornames["palegoldenrod"] = 15657130;
colornames["blanchedalmond"] = 16772045;
colornames["moccasin"] = 16770229;
colornames["wheat"] = 16113331;
colornames["navajowhite"] = 16768685;
colornames["burlywood"] = 14596231;
colornames["tan"] = 13808780;
colornames["rosybrown"] = 12357519;
colornames["sienna"] = 10506797;
colornames["saddlebrown"] = 9127187;
colornames["chocolate"] = 13789470;
colornames["peru"] = 13468991;
colornames["sandybrown"] = 16032864;
colornames["darkred"] = 0x8B0000;
colornames["maroon"] = 0x800000;
colornames["brown"] = 10824234;
colornames["firebrick"] = 11674146;
colornames["indianred"] = 13458524;
colornames["lightcoral"] = 15761536;
colornames["salmon"] = 16416882;
colornames["darksalmon"] = 15308410;
colornames["lightsalmon"] = 16752762;
colornames["coral"] = 16744272;
colornames["tomato"] = 16737095;
colornames["darkorange"] = 0xFF8C00;
colornames["orange"] = 0xFFA500;
colornames["orangered"] = 0xFF4500;
colornames["crimson"] = 14423100;
colornames["red"] = 0xFF0000;
colornames["deeppink"] = 16716947;
colornames["fuchsia"] = 0xFF00FF;
colornames["magenta"] = 0xFF00FF;
colornames["hotpink"] = 16738740;
colornames["lightpink"] = 16758465;
colornames["pink"] = 16761035;
colornames["palevioletred"] = 14381203;
colornames["mediumvioletred"] = 13047173;
colornames["purple"] = 0x800080;
colornames["darkmagenta"] = 0x8B008B;
colornames["mediumpurple"] = 9662683;
colornames["blueviolet"] = 9055202;
colornames["indigo"] = 0x4B0082;
colornames["darkviolet"] = 0x9400D3;
colornames["darkorchid"] = 10040012;
colornames["mediumorchid"] = 12211667;
colornames["orchid"] = 14315734;
colornames["violet"] = 15631086;
colornames["plum"] = 14524637;
colornames["thistle"] = 14204888;
colornames["lavender"] = 15132410;
colornames["ghostwhite"] = 16316671;
colornames["aliceblue"] = 15792383;
colornames["mintcream"] = 16121850;
colornames["honeydew"] = 15794160;
colornames["lightgoldenrodyellow"] = 16448210;
colornames["lemonchiffon"] = 16775885;
colornames["cornsilk"] = 16775388;
colornames["lightyellow"] = 16777184;
colornames["ivory"] = 16777200;
colornames["floralwhite"] = 16775920;
colornames["linen"] = 16445670;
colornames["oldlace"] = 16643558;
colornames["antiquewhite"] = 16444375;
colornames["bisque"] = 16770244;
colornames["peachpuff"] = 16767673;
colornames["papayawhip"] = 16773077;
colornames["beige"] = 16119260;
colornames["seashell"] = 16774638;
colornames["lavenderblush"] = 16773365;
colornames["mistyrose"] = 16770273;
colornames["snow"] = 16775930;
colornames["white"] = 0xFFFFFF;
colornames["whitesmoke"] = 0xF5F5F5;
colornames["gainsboro"] = 0xDCDCDC;
colornames["lightgrey"] = 0xD3D3D3;
colornames["silver"] = 0xC0C0C0;
colornames["darkgrey"] = 0xA9A9A9;
colornames["grey"] = 0x808080;
colornames["lightslategrey"] = 7833753;
colornames["slategrey"] = 7372944;
colornames["dimgrey"] = 0x696969;
colornames["darkslategrey"] = 3100495;
colornames["black"] = 0;
colornames["transparent"] = 4278190080;
};
if (colornames[_arg1] != null){
return (colornames[_arg1]);
};
if (((((_arg1 as String).length == 6)) && (hexstring(_arg1)))){
return (parseInt(("0x" + _arg1)));
};
};
return (4294967295);
}
private static function hexstring(_arg1:String):Boolean{
var _local2:int;
while (_local2 < _arg1.length) {
if (hexchars.indexOf(_arg1.charAt(_local2)) == -1){
return (false);
};
_local2++;
};
return (true);
}
public static function wirematerial(_arg1):ISegmentMaterial{
var _local2:Array;
var _local3:Init;
var _local4:uint;
var _local5:Number;
var _local6:Number;
if (_arg1 == null){
return (null);
};
if ((_arg1 is ISegmentMaterial)){
return (_arg1);
};
if ((_arg1 is int)){
return (new WireframeMaterial(_arg1));
};
if ((_arg1 is String)){
if (_arg1 == ""){
return (null);
};
if ((_arg1 as String).indexOf("#") == 0){
_arg1 = (_arg1 as String).substring(1);
};
if ((_arg1 as String).indexOf("|") == -1){
return (new WireframeMaterial(color(_arg1)));
};
_local2 = (_arg1 as String).split("|");
return (new WireframeMaterial(color(_local2[0]), {width:parseFloat(_local2[1])}));
};
if ((_arg1 is Object)){
_local3 = Init.parse(_arg1);
_local4 = _local3.getColor("color", 0);
_local5 = _local3.getNumber("alpha", 1, {min:0, max:1});
_local6 = _local3.getNumber("width", 1, {min:0});
return (new WireframeMaterial(_local4, {alpha:_local5, width:_local6}));
};
throw (new CastError(("Can't cast to wirematerial: " + _arg1)));
}
public static function bitmap(_arg1):BitmapData{
var ds:DisplayObject;
var bmd:BitmapData;
var mat:Matrix;
var data = _arg1;
if (data == null){
return (null);
};
if ((data is String)){
data = tryclass(data);
};
if ((data is Class)){
try {
data = new (data);
} catch(bitmaperror:ArgumentError) {
data = new data(0, 0);
};
};
if ((data is BitmapData)){
return (data);
};
if ((data is Bitmap)){
if ((data as Bitmap).hasOwnProperty("bitmapData")){
return ((data as Bitmap).bitmapData);
};
};
if ((data is DisplayObject)){
ds = (data as DisplayObject);
bmd = new BitmapData(ds.width, ds.height, true, 0xFFFFFF);
mat = ds.transform.matrix.clone();
mat.tx = 0;
mat.ty = 0;
bmd.draw(ds, mat, ds.transform.colorTransform, ds.blendMode, bmd.rect, true);
return (bmd);
};
throw (new CastError(("Can't cast to bitmap: " + data)));
}
public static function bytearray(_arg1):ByteArray{
if ((_arg1 is Class)){
_arg1 = new (_arg1);
};
if ((_arg1 is ByteArray)){
return (_arg1);
};
return (ByteArray(_arg1));
}
public static function xml(_arg1):XML{
if ((_arg1 is Class)){
_arg1 = new (_arg1);
};
if ((_arg1 is XML)){
return (_arg1);
};
return (XML(_arg1));
}
public static function string(_arg1):String{
if ((_arg1 is Class)){
_arg1 = new (_arg1);
};
if ((_arg1 is String)){
return (_arg1);
};
return (String(_arg1));
}
public static function tryclass(_arg1:String):Object{
var name = _arg1;
if (notclasses[name]){
return (name);
};
var result:Class = classes[name];
if (result != null){
return (result);
};
try {
result = (getDefinitionByName(name) as Class);
classes[name] = result;
return (result);
} catch(error:ReferenceError) {
};
notclasses[name] = true;
return (name);
}
}
}//package away3d.core.utils
Section 69
//CastError (away3d.core.utils.CastError)
package away3d.core.utils {
public class CastError extends Error {
public function CastError(_arg1:String){
super(_arg1);
}
}
}//package away3d.core.utils
Section 70
//Debug (away3d.core.utils.Debug)
package away3d.core.utils {
public class Debug {
public static var warningsAsErrors:Boolean = false;
public static var active:Boolean = false;
public static function warning(_arg1:Object):void{
if (warningsAsErrors){
error(_arg1);
return;
};
trace(("WARNING: " + _arg1));
}
public static function trace(_arg1:Object):void{
dotrace(_arg1);
}
public static function delimiter():void{
}
public static function clear():void{
}
public static function error(_arg1:Object):void{
trace(("ERROR: " + _arg1));
throw (new Error(_arg1));
}
}
}//package away3d.core.utils
private const dotrace:Function = function (_arg1:Object):void{
trace(_arg1);
};
Section 71
//DofCache (away3d.core.utils.DofCache)
package away3d.core.utils {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.filters.*;
public class DofCache {
private var minBitmap:BitmapData;
private var maxBitmap:BitmapData;
private var bitmaps:Array;
private var levels:Number;
public static var doflevels:Number = 16;
public static var maxblur:Number = 150;
public static var aperture:Number = 22;
private static var caches:Dictionary = new Dictionary();
public static var usedof:Boolean = false;
public static var focus:Number;
public function DofCache(_arg1:Number, _arg2:BitmapData){
var _local6:BlurFilter;
var _local7:int;
var _local8:BitmapData;
super();
this.levels = _arg1;
var _local3:Matrix = new Matrix();
var _local4:Point = new Point(0, 0);
bitmaps = new Array(_arg1);
var _local5:Number = 0;
while (_local5 < _arg1) {
_local6 = new BlurFilter((2 + ((maxblur * _local5) / _arg1)), (2 + ((maxblur * _local5) / _arg1)), 4);
_local3.identity();
_local7 = (_arg2.width * (1 + (_local5 / (_arg1 / 2))));
_local3.translate((-(_arg2.width) / 2), (-(_arg2.height) / 2));
_local3.translate((_local7 / 2), (_local7 / 2));
_local8 = new BitmapData(_local7, _local7, true, 0);
_local8.draw(_arg2, _local3);
_local8.applyFilter(_local8, _local8.rect, _local4, _local6);
bitmaps[_local5] = _local8;
_local5++;
};
minBitmap = bitmaps[0];
maxBitmap = bitmaps[(bitmaps.length - 1)];
}
public function getBitmap(_arg1:Number):BitmapData{
var _local2:Number = (focus - _arg1);
if ((focus - _arg1) < 0){
_local2 = -(_local2);
};
_local2 = (_local2 / aperture);
_local2 = Math.floor(_local2);
if (_local2 > (levels - 1)){
return (maxBitmap);
};
if (_local2 < 0){
return (minBitmap);
};
return (bitmaps[_local2]);
}
public static function resetDof(_arg1:Boolean):void{
var _local2:DofCache;
usedof = _arg1;
for each (_local2 in caches) {
if (!_arg1){
_local2 = new DofCache(1, _local2.bitmaps[0]);
} else {
_local2 = new DofCache(doflevels, _local2.bitmaps[0]);
};
};
}
public static function getDofCache(_arg1:BitmapData):DofCache{
if (caches[_arg1] == null){
if (!usedof){
caches[_arg1] = new DofCache(1, _arg1);
} else {
caches[_arg1] = new DofCache(doflevels, _arg1);
};
};
return (caches[_arg1]);
}
}
}//package away3d.core.utils
Section 72
//FaceVO (away3d.core.utils.FaceVO)
package away3d.core.utils {
import flash.display.*;
import flash.geom.*;
import away3d.containers.*;
import away3d.core.base.*;
public class FaceVO {
public var backface:Boolean;// = false
public var invalidated:Boolean;// = true
public var width:int;
public var mapping:Matrix;
public var source:Object3D;
public var color:uint;
public var view:View3D;
public var height:int;
public var cleared:Boolean;// = true
public var bitmap:BitmapData;
public var resized:Boolean;
public var updated:Boolean;// = false
public function FaceVO(_arg1:Object3D=null, _arg2:View3D=null){
this.source = _arg1;
this.view = _arg2;
}
public function clear():void{
cleared = true;
updated = true;
}
public function resize(_arg1:Number, _arg2:Number, _arg3:Boolean=true):void{
if ((((this.width == _arg1)) && ((this.height == _arg2)))){
return;
};
resized = true;
updated = true;
this.width = _arg1;
this.height = _arg2;
this.color = color;
if (bitmap){
bitmap.dispose();
};
bitmap = new BitmapData(_arg1, _arg2, _arg3, 0);
bitmap.lock();
}
}
}//package away3d.core.utils
Section 73
//IClonable (away3d.core.utils.IClonable)
package away3d.core.utils {
public interface IClonable {
function clone(_arg1=null);
}
}//package away3d.core.utils
Section 74
//Init (away3d.core.utils.Init)
package away3d.core.utils {
import flash.display.*;
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.materials.*;
import away3d.primitives.data.*;
public class Init {
private var init:Object;
private static var inits:Array = [];
public function Init(_arg1:Object){
this.init = _arg1;
}
public function getCubeMaterials(_arg1:String):CubeMaterialsData{
var _local2:CubeMaterialsData;
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
if ((init[_arg1] is CubeMaterialsData)){
_local2 = (init[_arg1] as CubeMaterialsData);
} else {
if ((init[_arg1] is Object)){
_local2 = new CubeMaterialsData(init[_arg1]);
};
};
delete init[_arg1];
return (_local2);
}
public function getArray(_arg1:String):Array{
if (init == null){
return ([]);
};
if (!init.hasOwnProperty(_arg1)){
return ([]);
};
var _local2:Array = init[_arg1];
delete init[_arg1];
return (_local2);
}
public function getSegmentMaterial(_arg1:String):ISegmentMaterial{
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
var _local2:ISegmentMaterial = Cast.wirematerial(init[_arg1]);
delete init[_arg1];
return (_local2);
}
public function getBitmap(_arg1:String):BitmapData{
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
var _local2:BitmapData = Cast.bitmap(init[_arg1]);
delete init[_arg1];
return (_local2);
}
public function getObject3D(_arg1:String):Object3D{
return ((getObject(_arg1, Object3D) as Object3D));
}
public function getString(_arg1:String, _arg2:String):String{
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
var _local3:String = init[_arg1];
delete init[_arg1];
return (_local3);
}
public function getObjectOrInit(_arg1:String, _arg2:Class=null):Object{
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
var _local3:Object = init[_arg1];
delete init[_arg1];
if (_local3 == null){
return (null);
};
if (_arg2 != null){
if (!(_local3 is _arg2)){
return (new _arg2(_local3));
};
};
return (_local3);
}
public function getInit(_arg1:String):Init{
if (init == null){
return (new Init(null));
};
if (!init.hasOwnProperty(_arg1)){
return (new Init(null));
};
var _local2:Init = Init.parse(init[_arg1]);
delete init[_arg1];
return (_local2);
}
public function getNumber(_arg1:String, _arg2:Number, _arg3:Object=null):Number{
var _local5:Number;
var _local6:Number;
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
var _local4:Number = init[_arg1];
if (_arg3 != null){
if (_arg3.hasOwnProperty("min")){
_local5 = _arg3["min"];
if (_local4 < _local5){
_local4 = _local5;
};
};
if (_arg3.hasOwnProperty("max")){
_local6 = _arg3["max"];
if (_local4 > _local6){
_local4 = _local6;
};
};
};
delete init[_arg1];
return (_local4);
}
function addForCheck():void{
if (init == null){
return;
};
init["dontCheckUnused"] = false;
inits.push(init);
}
public function getBoolean(_arg1:String, _arg2:Boolean):Boolean{
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
var _local3:Boolean = init[_arg1];
delete init[_arg1];
return (_local3);
}
public function getColor(_arg1:String, _arg2:uint):uint{
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
var _local3:uint = Cast.color(init[_arg1]);
delete init[_arg1];
return (_local3);
}
public function getObject(_arg1:String, _arg2:Class=null):Object{
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
var _local3:Object = init[_arg1];
delete init[_arg1];
if (_local3 == null){
return (null);
};
if (_arg2 != null){
if (!(_local3 is _arg2)){
throw (new CastError(((((("Parameter \"" + _arg1) + "\" is not of class ") + _arg2) + ": ") + _local3)));
};
};
return (_local3);
}
public function getNumber3D(_arg1:String):Number3D{
return ((getObject(_arg1, Number3D) as Number3D));
}
public function getInt(_arg1:String, _arg2:int, _arg3:Object=null):int{
var _local5:int;
var _local6:int;
if (init == null){
return (_arg2);
};
if (!init.hasOwnProperty(_arg1)){
return (_arg2);
};
var _local4:int = init[_arg1];
if (_arg3 != null){
if (_arg3.hasOwnProperty("min")){
_local5 = _arg3["min"];
if (_local4 < _local5){
_local4 = _local5;
};
};
if (_arg3.hasOwnProperty("max")){
_local6 = _arg3["max"];
if (_local4 > _local6){
_local4 = _local6;
};
};
};
delete init[_arg1];
return (_local4);
}
function removeFromCheck():void{
if (init == null){
return;
};
init["dontCheckUnused"] = true;
}
public function getMaterial(_arg1:String):ITriangleMaterial{
if (init == null){
return (null);
};
if (!init.hasOwnProperty(_arg1)){
return (null);
};
var _local2:ITriangleMaterial = Cast.material(init[_arg1]);
delete init[_arg1];
return (_local2);
}
public function getPosition(_arg1:String):Number3D{
var _local3:Object3D;
var _local2:Object = getObject(_arg1);
if (_local2 == null){
return (null);
};
if ((_local2 is Number3D)){
return ((_local2 as Number3D));
};
if ((_local2 is Object3D)){
_local3 = (_local2 as Object3D);
return ((_local3.scene) ? _local3.scenePosition : _local3.position);
};
if ((_local2 is String)){
if (_local2 == "center"){
return (new Number3D());
};
};
throw (new CastError(("Cast get position of " + _local2)));
}
static function checkUnusedArguments():void{
var _local2:Object;
var _local3:String;
var _local4:String;
if (inits.length == 0){
return;
};
var _local1:Array = inits;
inits = [];
for each (_local2 in _local1) {
if (_local2.hasOwnProperty("dontCheckUnused")){
//unresolved if
} else {
_local3 = null;
for (_local4 in _local2) {
if (_local4 == "dontCheckUnused"){
} else {
if (_local3 == null){
_local3 = "";
} else {
_local3 = (_local3 + ", ");
};
_local3 = (_local3 + ((_local4 + ":") + _local2[_local4]));
};
};
if (_local3 != null){
Debug.warning((("Unused arguments: {" + _local3) + "}"));
};
};
};
}
public static function parse(_arg1:Object):Init{
if (_arg1 == null){
return (new Init(null));
};
if ((_arg1 is Init)){
return ((_arg1 as Init));
};
inits.push(_arg1);
return (new Init(_arg1));
}
}
}//package away3d.core.utils
Section 75
//ValueObject (away3d.core.utils.ValueObject)
package away3d.core.utils {
import flash.events.*;
public class ValueObject extends EventDispatcher {
private static var changed:Event;
public function addOnChange(_arg1:Function):void{
addEventListener("changed", _arg1, false, 0, true);
}
protected function notifyChange():void{
if (!hasEventListener("changed")){
return;
};
if (changed == null){
changed = new Event("changed");
};
dispatchEvent(changed);
}
public function removeOnChange(_arg1:Function):void{
removeEventListener("changed", _arg1, false);
}
}
}//package away3d.core.utils
Section 76
//arcane (away3d.core.arcane)
package away3d.core {
public namespace arcane;
}//package away3d.core
Section 77
//AnimationEvent (away3d.events.AnimationEvent)
package away3d.events {
import flash.events.*;
import away3d.core.base.*;
public class AnimationEvent extends Event {
public var animation:Animation;
public static const SQUENCE_UPDATE:String = "squenceupdate";
public static const CYCLE:String = "cycle";
public static const SQUENCE_DONE:String = "squencedone";
public function AnimationEvent(_arg1:String, _arg2:Animation){
super(_arg1);
this.animation = _arg2;
}
override public function clone():Event{
return (new AnimationEvent(type, animation));
}
}
}//package away3d.events
Section 78
//FaceEvent (away3d.events.FaceEvent)
package away3d.events {
import flash.events.*;
import away3d.core.base.*;
public class FaceEvent extends Event {
public var face:Face;
public static const MAPPING_CHANGED:String = "mappingchanged";
public static const MATERIAL_CHANGED:String = "materialchanged";
public function FaceEvent(_arg1:String, _arg2:Face){
super(_arg1);
this.face = _arg2;
}
override public function clone():Event{
return (new FaceEvent(type, face));
}
}
}//package away3d.events
Section 79
//MaterialEvent (away3d.events.MaterialEvent)
package away3d.events {
import flash.events.*;
import away3d.materials.*;
public class MaterialEvent extends Event {
public var extra:Object;
public var material:IMaterial;
public static const RESIZED:String = "materialresize";
public static const CHANGED:String = "materialchanged";
public function MaterialEvent(_arg1:String, _arg2:IMaterial){
super(_arg1);
this.material = _arg2;
}
override public function clone():Event{
return (new MaterialEvent(type, material));
}
}
}//package away3d.events
Section 80
//MeshElementEvent (away3d.events.MeshElementEvent)
package away3d.events {
import flash.events.*;
import away3d.core.base.*;
public class MeshElementEvent extends Event {
public var element:IMeshElement;
public static const VISIBLE_CHANGED:String = "visiblechanged";
public static const VERTEX_CHANGED:String = "vertexchanged";
public static const VERTEXVALUE_CHANGED:String = "vertexvaluechanged";
public function MeshElementEvent(_arg1:String, _arg2:IMeshElement){
super(_arg1);
this.element = _arg2;
}
override public function clone():Event{
return (new MeshElementEvent(type, element));
}
}
}//package away3d.events
Section 81
//MouseEvent3D (away3d.events.MouseEvent3D)
package away3d.events {
import flash.events.*;
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.base.*;
import away3d.materials.*;
public class MouseEvent3D extends Event {
public var sceneX:Number;
public var sceneY:Number;
public var sceneZ:Number;
public var uv:UV;
public var drawpri:DrawPrimitive;
public var view:View3D;
public var material:IUVMaterial;
public var screenX:Number;
public var screenY:Number;
public var screenZ:Number;
public var ctrlKey:Boolean;
public var element:Object;
public var shiftKey:Boolean;
public var object:Object3D;
public static const MOUSE_DOWN:String = "mouseDown3D";
public static const MOUSE_OUT:String = "mouseOut3D";
public static const MOUSE_UP:String = "mouseUp3D";
public static const MOUSE_MOVE:String = "mouseMove3D";
public static const MOUSE_OVER:String = "mouseOver3D";
public function MouseEvent3D(_arg1:String){
super(_arg1);
}
override public function clone():Event{
var _local1:MouseEvent3D = new MouseEvent3D(type);
_local1.screenX = screenX;
_local1.screenY = screenY;
_local1.screenZ = screenZ;
_local1.sceneX = sceneX;
_local1.sceneY = sceneY;
_local1.sceneZ = sceneZ;
_local1.view = view;
_local1.object = object;
_local1.element = element;
_local1.drawpri = drawpri;
_local1.material = material;
_local1.uv = uv;
_local1.ctrlKey = ctrlKey;
_local1.shiftKey = shiftKey;
return (_local1);
}
}
}//package away3d.events
Section 82
//Object3DEvent (away3d.events.Object3DEvent)
package away3d.events {
import flash.events.*;
import away3d.core.base.*;
public class Object3DEvent extends Event {
public var object:Object3D;
public static const SCENE_CHANGED:String = "scenechanged";
public static const SCENETRANSFORM_CHANGED:String = "scenetransformchanged";
public static const RADIUS_CHANGED:String = "radiuschanged";
public static const TRANSFORM_CHANGED:String = "transformchanged";
public static const DIMENSIONS_CHANGED:String = "dimensionschanged";
public function Object3DEvent(_arg1:String, _arg2:Object3D){
super(_arg1);
this.object = _arg2;
}
override public function clone():Event{
return (new Object3DEvent(type, object));
}
}
}//package away3d.events
Section 83
//SegmentEvent (away3d.events.SegmentEvent)
package away3d.events {
import flash.events.*;
import away3d.core.base.*;
public class SegmentEvent extends Event {
public var segment:Segment;
public static const MATERIAL_CHANGED:String = "materialchanged";
public function SegmentEvent(_arg1:String, _arg2:Segment){
super(_arg1);
this.segment = _arg2;
}
override public function clone():Event{
return (new SegmentEvent(type, segment));
}
}
}//package away3d.events
Section 84
//AmbientLight3D (away3d.lights.AmbientLight3D)
package away3d.lights {
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.base.*;
import away3d.core.light.*;
import away3d.core.utils.*;
public class AmbientLight3D extends Object3D implements ILightProvider, IPrimitiveProvider, IClonable {
private var _ambientDirty:Boolean;
private var _green:int;
private var _colorDirty:Boolean;
private var _red:int;
public var debug:Boolean;
private var _ambient:Number;
private var _ls:AmbientLight;
private var _color:int;
private var _blue:int;
public function AmbientLight3D(_arg1:Object=null){
_ls = new AmbientLight();
super(_arg1);
color = ini.getColor("color", 0xFFFFFF);
ambient = ini.getNumber("ambient", 0.5, {min:0, max:1});
debug = ini.getBoolean("debug", false);
_ls.light = this;
}
public function set color(_arg1:int):void{
_color = _arg1;
_red = ((_color & 0xFF0000) >> 16);
_green = ((_color & 0xFF00) >> 8);
_blue = (_color & 0xFF);
_colorDirty = true;
}
public function light(_arg1:ILightConsumer):void{
if (_colorDirty){
_ls.red = _red;
_ls.green = _green;
_ls.blue = _blue;
_colorDirty = false;
};
if (_ambientDirty){
_ambientDirty = false;
_ls.updateAmbientBitmap(_ambient);
};
_arg1.ambientLight(_ls);
}
public function get ambient():Number{
return (_ambient);
}
public function get color():int{
return (_color);
}
public function set ambient(_arg1:Number):void{
_ambient = _arg1;
_ambientDirty = true;
}
override public function clone(_arg1=null){
var _local2:AmbientLight3D = ((_arg1) || (new AmbientLight3D()));
super.clone(_local2);
_local2.color = color;
_local2.ambient = ambient;
_local2.debug = debug;
return (_local2);
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void{
super.primitives(_arg1, _arg2);
}
}
}//package away3d.lights
Section 85
//DirectionalLight3D (away3d.lights.DirectionalLight3D)
package away3d.lights {
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.base.*;
import away3d.core.light.*;
import away3d.core.utils.*;
public class DirectionalLight3D extends Object3D implements ILightProvider, IPrimitiveProvider, IClonable {
private var _ambientDirty:Boolean;
private var _brightnessDirty:Boolean;
private var _green:int;
private var _colorDirty:Boolean;
private var _specularDirty:Boolean;
private var _red:int;
private var _ambient:Number;
public var debug:Boolean;
private var _specular:Number;
private var _diffuse:Number;
private var _ls:DirectionalLight;
private var _color:int;
private var _diffuseDirty:Boolean;
private var _brightness:Number;
private var _blue:int;
public function DirectionalLight3D(_arg1:Object=null){
_ls = new DirectionalLight();
super(_arg1);
color = ini.getColor("color", 0xFFFFFF);
ambient = ini.getNumber("ambient", 0.5, {min:0, max:1});
diffuse = ini.getNumber("diffuse", 0.5, {min:0, max:10});
specular = ini.getNumber("specular", 1, {min:0, max:1});
brightness = ini.getNumber("brightness", 1);
debug = ini.getBoolean("debug", false);
_ls.light = this;
addOnTransformChange(_ls.updateDirection);
}
public function get specular():Number{
return (_specular);
}
public function set color(_arg1:int):void{
_color = _arg1;
_red = ((_color & 0xFF0000) >> 16);
_green = ((_color & 0xFF00) >> 8);
_blue = (_color & 0xFF);
_colorDirty = true;
_ambientDirty = true;
_diffuseDirty = true;
_specularDirty = true;
}
public function get brightness():Number{
return (_brightness);
}
public function set specular(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
_specular = _arg1;
_specularDirty = true;
}
public function light(_arg1:ILightConsumer):void{
if (_colorDirty){
_ls.red = _red;
_ls.green = _green;
_ls.blue = _blue;
};
if (((((_ambientDirty) || (_diffuseDirty))) || (_brightnessDirty))){
_ls.updateAmbientDiffuseBitmap(ambient, diffuse);
};
if (((_ambientDirty) || (_brightnessDirty))){
_ambientDirty = false;
_ls.updateAmbientBitmap(ambient);
};
if (((_diffuseDirty) || (_brightnessDirty))){
_diffuseDirty = false;
_ls.updateDiffuseBitmap(diffuse);
};
if (((_specularDirty) || (_brightnessDirty))){
_specularDirty = false;
_ls.updateSpecularBitmap(specular);
};
_arg1.directionalLight(_ls);
_colorDirty = false;
_brightnessDirty = false;
}
public function get ambient():Number{
return (_ambient);
}
public function get diffuse():Number{
return (_diffuse);
}
public function get color():int{
return (_color);
}
public function set diffuse(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
_diffuse = _arg1;
_diffuseDirty = true;
}
override public function clone(_arg1=null){
var _local2:DirectionalLight3D = ((_arg1) || (new DirectionalLight3D()));
super.clone(_local2);
_local2.color = color;
_local2.brightness = brightness;
_local2.ambient = ambient;
_local2.diffuse = diffuse;
_local2.specular = specular;
_local2.debug = debug;
return (_local2);
}
public function set ambient(_arg1:Number):void{
if (_arg1 < 0){
_arg1 = 0;
};
_ambient = _arg1;
_ambientDirty = true;
}
public function set brightness(_arg1:Number):void{
_brightness = _arg1;
_brightnessDirty = true;
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void{
super.primitives(_arg1, _arg2);
}
}
}//package away3d.lights
Section 86
//PointLight3D (away3d.lights.PointLight3D)
package away3d.lights {
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.base.*;
import away3d.materials.*;
import away3d.core.light.*;
import away3d.core.utils.*;
public class PointLight3D extends Object3D implements ILightProvider, IPrimitiveProvider, IClonable {
public var diffuse:Number;
public var color:int;
public var specular:Number;
public var brightness:Number;
public var debug:Boolean;
private var _ls:PointLight;
public var ambient:Number;
public function PointLight3D(_arg1:Object=null){
_ls = new PointLight();
super(_arg1);
color = ini.getColor("color", 0xFFFFFF);
ambient = ini.getNumber("ambient", 1);
diffuse = ini.getNumber("diffuse", 1);
specular = ini.getNumber("specular", 1);
brightness = ini.getNumber("brightness", 1);
debug = ini.getBoolean("debug", false);
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void{
var _local5:DrawTriangle;
super.primitives(_arg1, _arg2);
if (!debug){
return;
};
var _local3:Vertex = new Vertex(0, 0, 0);
var _local4:ScreenVertex = _local3.project(projection);
if (!_local4.visible){
return;
};
_local5 = new DrawTriangle();
_local5.v0 = new ScreenVertex((_local4.x + 3), (_local4.y + 2), _local4.z);
_local5.v1 = new ScreenVertex((_local4.x - 3), (_local4.y + 2), _local4.z);
_local5.v2 = new ScreenVertex(_local4.x, (_local4.y - 3), _local4.z);
_local5.calc();
_local5.source = this;
_local5.projection = projection;
_local5.material = new ColorMaterial(color);
_arg1.primitive(_local5);
}
public function light(_arg1:ILightConsumer):void{
_ls.x = viewTransform.tx;
_ls.y = viewTransform.ty;
_ls.z = viewTransform.tz;
_ls.light = this;
_ls.red = ((color & 0xFF0000) >> 16);
_ls.green = ((color & 0xFF00) >> 8);
_ls.blue = (color & 0xFF);
_ls.ambient = (ambient * brightness);
_ls.diffuse = (diffuse * brightness);
_ls.specular = (specular * brightness);
_arg1.pointLight(_ls);
}
override public function clone(_arg1=null){
var _local2:PointLight3D = ((_arg1) || (new PointLight3D()));
super.clone(_local2);
_local2.color = color;
_local2.ambient = ambient;
_local2.diffuse = diffuse;
_local2.specular = specular;
_local2.debug = debug;
return (_local2);
}
}
}//package away3d.lights
Section 87
//BitmapMaterial (away3d.materials.BitmapMaterial)
package away3d.materials {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.events.*;
import away3d.core.base.*;
import away3d.core.utils.*;
public class BitmapMaterial extends EventDispatcher implements ITriangleMaterial, IUVMaterial, ILayerMaterial, IUpdatingMaterial {
var _green:Number;// = 1
private var triangle:DrawTriangle;
var _blendMode:String;
private var dsbc:Number;
private var faz:Number;
private var dsca:Number;
private var ax:Number;
private var ay:Number;
var _blue:Number;// = 1
private var az:Number;
var _renderBitmap:BitmapData;
private var fbz:Number;
var _zeroPoint:Point;
var _colorTransformDirty:Boolean;
private var mcax:Number;
var _bitmap:BitmapData;
private var mcaz:Number;
var _bitmapRect:Rectangle;
public var debug:Boolean;// = false
private var mcay:Number;
private var bx:Number;
var _session:AbstractRenderSession;
private var bz:Number;
private var map:Matrix;
private var fcz:Number;
private var by:Number;
var _alpha:Number;// = 1
var _color:uint;// = 0xFFFFFF
var _colorTransform:ColorTransform;
private var dbcx:Number;
private var dbcy:Number;
private var cx:Number;
private var cy:Number;
private var cz:Number;
var _sourceVO:FaceVO;
private var dmax:Number;
var _mapping:Matrix;
private var dabx:Number;
private var _shape:Shape;
public var repeat:Boolean;// = false
private var daby:Number;
private var svArray:Array;
var _blendModeDirty:Boolean;
public var smooth:Boolean;// = false
private var mbcx:Number;
private var mbcy:Number;
private var mbcz:Number;
var _red:Number;// = 1
private var _shapeDictionary:Dictionary;
private var focus:Number;
private var mabx:Number;
private var maby:Number;
private var dsab:Number;
var _graphics:Graphics;
var _faceDictionary:Dictionary;
private var mabz:Number;
var _s:Shape;
var _faceVO:FaceVO;
private var dcax:Number;
private var dcay:Number;
protected var ini:Init;
private var _precision:Number;
public function BitmapMaterial(_arg1:BitmapData, _arg2:Object=null){
_faceDictionary = new Dictionary(true);
_zeroPoint = new Point(0, 0);
_s = new Shape();
_shapeDictionary = new Dictionary(true);
map = new Matrix();
triangle = new DrawTriangle();
svArray = new Array();
super();
_bitmap = _arg1;
ini = Init.parse(_arg2);
smooth = ini.getBoolean("smooth", smooth);
debug = ini.getBoolean("debug", debug);
repeat = ini.getBoolean("repeat", repeat);
precision = ini.getNumber("precision", 0);
_blendMode = ini.getString("blendMode", BlendMode.NORMAL);
alpha = ini.getNumber("alpha", _alpha, {min:0, max:1});
color = ini.getColor("color", _color);
_colorTransformDirty = true;
createVertexArray();
}
public function set precision(_arg1:Number):void{
_precision = ((_arg1 * _arg1) * 1.4);
}
function clearShapeDictionary():void{
for each (_shape in _shapeDictionary) {
_shape.graphics.clear();
};
}
public function renderTriangle(_arg1:DrawTriangle):void{
_mapping = getMapping(_arg1);
_session = _arg1.source.session;
if (((((!(_graphics)) && (!((_session == _session.view.session))))) && (_session.newLayer))){
_graphics = _session.newLayer.graphics;
};
if (precision){
focus = _arg1.projection.focus;
map.a = _mapping.a;
map.b = _mapping.b;
map.c = _mapping.c;
map.d = _mapping.d;
map.tx = _mapping.tx;
map.ty = _mapping.ty;
renderRec(_arg1.v0, _arg1.v1, _arg1.v2, 0);
} else {
_session.renderTriangleBitmap(_renderBitmap, _mapping, _arg1.v0, _arg1.v1, _arg1.v2, smooth, repeat, _graphics);
};
if (debug){
_session.renderTriangleLine(0, 0xFF, 1, _arg1.v0, _arg1.v1, _arg1.v2);
};
}
public function renderFace(_arg1:Face, _arg2:Rectangle, _arg3:FaceVO):FaceVO{
renderSource(_arg1.parent, _arg2, new Matrix());
_faceVO = _faceDictionary[_arg1];
if (!_faceVO){
_faceVO = (_faceDictionary[_arg1] = new FaceVO());
};
if (_arg3.resized){
_arg3.resized = false;
_faceVO.resized = true;
};
if (((_arg3.updated) || (_faceVO.invalidated))){
_arg3.updated = false;
_faceVO.invalidated = false;
_faceVO.cleared = false;
_faceVO.updated = true;
_faceVO.bitmap = _arg3.bitmap.clone();
_faceVO.bitmap.copyPixels(_sourceVO.bitmap, _arg1.bitmapRect, _zeroPoint, null, null, true);
};
return (_faceVO);
}
private function renderRec(_arg1:ScreenVertex, _arg2:ScreenVertex, _arg3:ScreenVertex, _arg4:Number):void{
var _local11:ScreenVertex;
var _local12:ScreenVertex;
ax = _arg1.x;
ay = _arg1.y;
az = _arg1.z;
bx = _arg2.x;
by = _arg2.y;
bz = _arg2.z;
cx = _arg3.x;
cy = _arg3.y;
cz = _arg3.z;
if (!_session.view.clip.rect(Math.min(ax, Math.min(bx, cx)), Math.min(ay, Math.min(by, cy)), Math.max(ax, Math.max(bx, cx)), Math.max(ay, Math.max(by, cy)))){
return;
};
if ((((((az <= 0)) && ((bz <= 0)))) && ((cz <= 0)))){
return;
};
if ((((((((_arg4 >= 100)) || ((focus == Infinity)))) || (((Math.max(Math.max(ax, bx), cx) - Math.min(Math.min(ax, bx), cx)) < 10)))) || (((Math.max(Math.max(ay, by), cy) - Math.min(Math.min(ay, by), cy)) < 10)))){
_session.renderTriangleBitmap(_renderBitmap, map, _arg1, _arg2, _arg3, smooth, repeat, _graphics);
if (debug){
_session.renderTriangleLine(1, 0xFF00, 1, _arg1, _arg2, _arg3);
};
return;
};
faz = (focus + az);
fbz = (focus + bz);
fcz = (focus + cz);
mabz = (2 / (faz + fbz));
mbcz = (2 / (fbz + fcz));
mcaz = (2 / (fcz + faz));
dabx = ((ax + bx) - (mabx = (((ax * faz) + (bx * fbz)) * mabz)));
daby = ((ay + by) - (maby = (((ay * faz) + (by * fbz)) * mabz)));
dbcx = ((bx + cx) - (mbcx = (((bx * fbz) + (cx * fcz)) * mbcz)));
dbcy = ((by + cy) - (mbcy = (((by * fbz) + (cy * fcz)) * mbcz)));
dcax = ((cx + ax) - (mcax = (((cx * fcz) + (ax * faz)) * mcaz)));
dcay = ((cy + ay) - (mcay = (((cy * fcz) + (ay * faz)) * mcaz)));
dsab = ((dabx * dabx) + (daby * daby));
dsbc = ((dbcx * dbcx) + (dbcy * dbcy));
dsca = ((dcax * dcax) + (dcay * dcay));
if ((((((dsab <= precision)) && ((dsca <= precision)))) && ((dsbc <= precision)))){
_session.renderTriangleBitmap(_renderBitmap, map, _arg1, _arg2, _arg3, smooth, repeat, _graphics);
if (debug){
_session.renderTriangleLine(1, 0xFF00, 1, _arg1, _arg2, _arg3);
};
return;
};
var _local5:Number = map.a;
var _local6:Number = map.b;
var _local7:Number = map.c;
var _local8:Number = map.d;
var _local9:Number = map.tx;
var _local10:Number = map.ty;
var _temp1 = _arg4;
_arg4 = (_arg4 + 1);
var _local13:ScreenVertex = svArray[_temp1];
_local13.x = (mbcx / 2);
_local13.y = (mbcy / 2);
_local13.z = ((bz + cz) / 2);
if ((((((dsab > precision)) && ((dsca > precision)))) && ((dsbc > precision)))){
var _temp2 = _arg4;
_arg4 = (_arg4 + 1);
_local11 = svArray[_temp2];
_local11.x = (mabx / 2);
_local11.y = (maby / 2);
_local11.z = ((az + bz) / 2);
var _temp3 = _arg4;
_arg4 = (_arg4 + 1);
_local12 = svArray[_temp3];
_local12.x = (mcax / 2);
_local12.y = (mcay / 2);
_local12.z = ((cz + az) / 2);
_local5 = (_local5 * 2);
map.a = _local5;
_local6 = (_local6 * 2);
map.b = _local6;
_local7 = (_local7 * 2);
map.c = _local7;
_local8 = (_local8 * 2);
map.d = _local8;
_local9 = (_local9 * 2);
map.tx = _local9;
_local10 = (_local10 * 2);
map.ty = _local10;
renderRec(_arg1, _local11, _local12, _arg4);
map.a = _local5;
map.b = _local6;
map.c = _local7;
map.d = _local8;
map.tx = (_local9 - 1);
map.ty = _local10;
renderRec(_local11, _arg2, _local13, _arg4);
map.a = _local5;
map.b = _local6;
map.c = _local7;
map.d = _local8;
map.tx = _local9;
map.ty = (_local10 - 1);
renderRec(_local12, _local13, _arg3, _arg4);
map.a = -(_local5);
map.b = -(_local6);
map.c = -(_local7);
map.d = -(_local8);
map.tx = (1 - _local9);
map.ty = (1 - _local10);
renderRec(_local13, _local12, _local11, _arg4);
return;
};
dmax = Math.max(dsab, Math.max(dsca, dsbc));
if (dsab == dmax){
var _temp4 = _arg4;
_arg4 = (_arg4 + 1);
_local11 = svArray[_temp4];
_local11.x = (mabx / 2);
_local11.y = (maby / 2);
_local11.z = ((az + bz) / 2);
_local5 = (_local5 * 2);
map.a = _local5;
_local7 = (_local7 * 2);
map.c = _local7;
_local9 = (_local9 * 2);
map.tx = _local9;
renderRec(_arg1, _local11, _arg3, _arg4);
map.a = (_local5 + _local6);
map.b = _local6;
map.c = (_local7 + _local8);
map.d = _local8;
map.tx = ((_local9 + _local10) - 1);
map.ty = _local10;
renderRec(_local11, _arg2, _arg3, _arg4);
return;
};
if (dsca == dmax){
var _temp5 = _arg4;
_arg4 = (_arg4 + 1);
_local12 = svArray[_temp5];
_local12.x = (mcax / 2);
_local12.y = (mcay / 2);
_local12.z = ((cz + az) / 2);
_local6 = (_local6 * 2);
map.b = _local6;
_local8 = (_local8 * 2);
map.d = _local8;
_local10 = (_local10 * 2);
map.ty = _local10;
renderRec(_arg1, _arg2, _local12, _arg4);
map.a = _local5;
map.b = (_local6 + _local5);
map.c = _local7;
map.d = (_local8 + _local7);
map.tx = _local9;
map.ty = ((_local10 + _local9) - 1);
renderRec(_local12, _arg2, _arg3, _arg4);
return;
};
map.a = (_local5 - _local6);
map.b = (_local6 * 2);
map.c = (_local7 - _local8);
map.d = (_local8 * 2);
map.tx = (_local9 - _local10);
map.ty = (_local10 * 2);
renderRec(_arg1, _arg2, _local13, _arg4);
map.a = (_local5 * 2);
map.b = (_local6 - _local5);
map.c = (_local7 * 2);
map.d = (_local8 - _local7);
map.tx = (_local9 * 2);
map.ty = (_local10 - _local9);
renderRec(_arg1, _local13, _arg3, _arg4);
}
public function get height():Number{
return (_bitmap.height);
}
public function get bitmap():BitmapData{
return (_bitmap);
}
public function updateMaterial(_arg1:Object3D, _arg2:View3D):void{
_graphics = null;
clearShapeDictionary();
if (((_colorTransformDirty) || (_blendModeDirty))){
clearFaceDictionary();
};
if (_colorTransformDirty){
setColorTransform();
};
_blendModeDirty = false;
}
public function addOnResize(_arg1:Function):void{
addEventListener(MaterialEvent.RESIZED, _arg1, false, 0, true);
}
public function removeOnResize(_arg1:Function):void{
removeEventListener(MaterialEvent.RESIZED, _arg1, false);
}
function renderSource(_arg1:Object3D, _arg2:Rectangle, _arg3:Matrix):void{
_sourceVO = _faceDictionary[_arg1];
if (!_sourceVO){
_sourceVO = (_faceDictionary[_arg1] = new FaceVO());
};
_sourceVO.resize(_arg2.width, _arg2.height);
if (_sourceVO.invalidated){
_arg3.scale((_arg2.width / width), (_arg2.height / height));
_sourceVO.invalidated = false;
_sourceVO.cleared = false;
_sourceVO.updated = true;
if ((((((((((((_arg3.a == 1)) && ((_arg3.d == 1)))) && ((_arg3.b == 0)))) && ((_arg3.c == 0)))) && ((_arg3.tx == 0)))) && ((_arg3.ty == 0)))){
_sourceVO.bitmap.copyPixels(_bitmap, _arg2, _zeroPoint);
} else {
_graphics = _s.graphics;
_graphics.clear();
_graphics.beginBitmapFill(_bitmap, _arg3, repeat, smooth);
_graphics.drawRect(0, 0, _arg2.width, _arg2.height);
_graphics.endFill();
_sourceVO.bitmap.draw(_s, null, _colorTransform, _blendMode, _sourceVO.bitmap.rect);
};
};
}
public function renderLayer(_arg1:DrawTriangle, _arg2:Sprite, _arg3:int):void{
if (blendMode == BlendMode.NORMAL){
_graphics = _arg2.graphics;
} else {
_session = _arg1.source.session;
if (_session != _session.view.session){
if (!(_shape = _shapeDictionary[_session])){
_arg2.addChild((_shape = (_shapeDictionary[_session] = new Shape())));
};
} else {
if (!(_shape = _shapeDictionary[_arg1.face])){
_arg2.addChild((_shape = (_shapeDictionary[_arg1.face] = new Shape())));
};
};
_shape.blendMode = _blendMode;
_graphics = _shape.graphics;
};
renderTriangle(_arg1);
}
public function set blendMode(_arg1:String):void{
if (_blendMode == _arg1){
return;
};
_blendMode = _arg1;
_blendModeDirty = true;
}
protected function setColorTransform():void{
_colorTransformDirty = false;
if ((((_alpha == 1)) && ((_color == 0xFFFFFF)))){
_renderBitmap = _bitmap;
_colorTransform = null;
return;
};
if (!_colorTransform){
_colorTransform = new ColorTransform();
};
_colorTransform.redMultiplier = _red;
_colorTransform.greenMultiplier = _green;
_colorTransform.blueMultiplier = _blue;
_colorTransform.alphaMultiplier = _alpha;
if (_alpha == 0){
_renderBitmap = null;
return;
};
updateRenderBitmap();
}
public function get alpha():Number{
return (_alpha);
}
public function get color():uint{
return (_color);
}
public function get precision():Number{
return (_precision);
}
function clearFaceDictionary():void{
for each (_faceVO in _faceDictionary) {
if (!_faceVO.cleared){
_faceVO.clear();
};
_faceVO.invalidated = true;
};
}
public function getPixel32(_arg1:Number, _arg2:Number):uint{
return (_bitmap.getPixel32((_arg1 * _bitmap.width), ((1 - _arg2) * _bitmap.height)));
}
public function get visible():Boolean{
return ((_alpha > 0));
}
private function createVertexArray():void{
var _local1:Number = 100;
while (_local1--) {
svArray.push(new ScreenVertex());
};
}
protected function getMapping(_arg1:DrawTriangle):Matrix{
return (((_arg1.texturemapping) || (_arg1.transformUV(this))));
}
public function set alpha(_arg1:Number):void{
if (_arg1 > 1){
_arg1 = 1;
};
if (_arg1 < 0){
_arg1 = 0;
};
if (_alpha == _arg1){
return;
};
_alpha = _arg1;
_colorTransformDirty = true;
}
public function get blendMode():String{
return (_blendMode);
}
public function get width():Number{
return (_bitmap.width);
}
protected function updateRenderBitmap():void{
if (_colorTransform){
if (((!(_bitmap.transparent)) && (!((_alpha == 1))))){
_renderBitmap = new BitmapData(_bitmap.width, _bitmap.height, true);
_renderBitmap.draw(_bitmap);
} else {
_renderBitmap = _bitmap.clone();
};
_renderBitmap.colorTransform(_renderBitmap.rect, _colorTransform);
} else {
_renderBitmap = _bitmap;
};
}
public function set color(_arg1:uint):void{
if (_color == _arg1){
return;
};
_color = _arg1;
_red = (((_color & 0xFF0000) >> 16) / 0xFF);
_green = (((_color & 0xFF00) >> 8) / 0xFF);
_blue = ((_color & 0xFF) / 0xFF);
_colorTransformDirty = true;
}
}
}//package away3d.materials
Section 88
//BitmapMaterialContainer (away3d.materials.BitmapMaterialContainer)
package away3d.materials {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.base.*;
import away3d.core.utils.*;
import away3d.core.*;
public class BitmapMaterialContainer extends BitmapMaterial implements ITriangleMaterial, IUpdatingMaterial, ILayerMaterial {
private var _cache:Boolean;
private var _height:Number;
private var _width:Number;
private var _faceHeight:int;
private var _material:ILayerMaterial;
public var transparent:Boolean;
private var _forceRender:Boolean;
private var _faceWidth:int;
public var materials:Array;
private var _dt:DrawTriangle;
private var _containerDictionary:Dictionary;
private var _cacheDictionary:Dictionary;
private var _containerVO:FaceVO;
private var _face:Face;
public function BitmapMaterialContainer(_arg1:int, _arg2:int, _arg3:Object=null){
_containerDictionary = new Dictionary(true);
super(new BitmapData(_arg1, _arg2, true, 0xFFFFFF), _arg3);
_width = _arg1;
_height = _arg2;
_bitmapRect = new Rectangle(0, 0, _width, _height);
if (!materials){
materials = ini.getArray("materials");
};
transparent = ini.getBoolean("transparent", true);
cache = ini.getBoolean("cache", true);
}
public function get cache():Boolean{
return (_cache);
}
public function update():void{
if (_cache){
_cacheDictionary = new Dictionary(true);
};
}
public function set cache(_arg1:Boolean):void{
_cache = _arg1;
if (_arg1){
_cacheDictionary = new Dictionary(true);
} else {
_cacheDictionary = null;
};
}
override public function updateMaterial(_arg1:Object3D, _arg2:View3D):void{
if (_colorTransformDirty){
setColorTransform();
};
_blendModeDirty = false;
for each (_material in materials) {
if ((_material is IUpdatingMaterial)){
(_material as IUpdatingMaterial).updateMaterial(_arg1, _arg2);
};
};
}
override protected function getMapping(_arg1:DrawTriangle):Matrix{
_face = _arg1.face;
_dt = _face._dt;
if (((!(_cacheDictionary)) || (!(_cacheDictionary[_face])))){
_faceVO = _faceDictionary[_face];
if (!_faceVO){
_faceVO = (_faceDictionary[_face] = new FaceVO());
};
if (!_dt.texturemapping){
_face.bitmapRect = new Rectangle(int((_width * _face.minU)), int((_height * (1 - _face.maxV))), int(((_width * (_face.maxU - _face.minU)) + 2)), int(((_height * (_face.maxV - _face.minV)) + 2)));
_faceWidth = _face.bitmapRect.width;
_faceHeight = _face.bitmapRect.height;
_dt.transformUV(this);
_faceVO.resize(_faceWidth, _faceHeight, transparent);
};
for each (_material in materials) {
_faceVO = _material.renderFace(_face, _bitmapRect, _faceVO);
};
_faceVO.updated = false;
if (_cacheDictionary){
_cacheDictionary[_face] = _faceVO;
};
};
if (!_arg1.texturemapping){
_arg1.transformUV(this);
};
if (_cacheDictionary){
_renderBitmap = _cacheDictionary[_face].bitmap;
} else {
_renderBitmap = _faceVO.bitmap;
};
return (_arg1.texturemapping);
}
override public function renderFace(_arg1:Face, _arg2:Rectangle, _arg3:FaceVO):FaceVO{
_faceVO = _faceDictionary[_arg1];
if (!_faceVO){
_faceVO = (_faceDictionary[_arg1] = new FaceVO());
};
_faceWidth = _arg1.bitmapRect.width;
_faceHeight = _arg1.bitmapRect.height;
_containerVO = _containerDictionary[_arg1];
if (!_containerVO){
_containerVO = (_containerDictionary[_arg1] = new FaceVO());
};
if (_arg3.resized){
_arg3.resized = false;
_containerVO.resize(_faceWidth, _faceHeight, transparent);
};
for each (_material in materials) {
_containerVO = _material.renderFace(_face, _arg2, _containerVO);
};
if (((_arg3.updated) || (_containerVO.updated))){
_arg3.updated = false;
_containerVO.updated = false;
_faceVO.invalidated = false;
_faceVO.cleared = false;
_faceVO.updated = true;
_faceVO.bitmap = _arg3.bitmap.clone();
_faceVO.bitmap.lock();
_sourceVO = _faceVO;
if ((((_blendMode == BlendMode.NORMAL)) && (!(_colorTransform)))){
_faceVO.bitmap.copyPixels(_containerVO.bitmap, _containerVO.bitmap.rect, _zeroPoint, null, null, true);
} else {
_faceVO.bitmap.draw(_containerVO.bitmap, null, _colorTransform, _blendMode);
};
};
_containerVO.updated = false;
return (_faceVO);
}
override public function renderLayer(_arg1:DrawTriangle, _arg2:Sprite, _arg3:int):void{
throw (new Error("Not implemented"));
}
override protected function updateRenderBitmap():void{
update();
}
}
}//package away3d.materials
Section 89
//CenterLightingMaterial (away3d.materials.CenterLightingMaterial)
package away3d.materials {
import flash.events.*;
import flash.display.*;
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.core.light.*;
import away3d.core.utils.*;
public class CenterLightingMaterial extends EventDispatcher implements ITriangleMaterial, IUpdatingMaterial {
private var fy:Number;
private var pb:Number;
private var green:Number;
private var nz:Number;
private var ksr:Number;
private var draw_fall_k:Number;// = 1
private var diff:Number;
private var kdb:Number;
protected var ini:Init;
private var kdg:Number;
public var ak:Number;// = 20
private var draw_reflect_k:Number;// = 1
private var v0p:Number;
private var dfy:Number;
private var dfz:Number;
private var kdr:Number;
private var _source:Mesh;
private var dfx:Number;
private var v0x:Number;
private var v0y:Number;
private var v0z:Number;
private var draw_normal:Boolean;// = false
private var ry:Number;
private var rz:Number;
private var sum:Number;
private var rx:Number;
public var diffuse_brightness:Number;// = 1
private var projection:Projection;
private var v1p:Number;
public var ambient_brightness:Number;// = 1
private var blue:Number;
private var v1x:Number;
private var v1y:Number;
private var v1z:Number;
private var ncx:Number;
private var ncy:Number;
private var ncz:Number;
private var v2p:Number;
private var cx:Number;
var v0:ScreenVertex;
var v1:ScreenVertex;
private var v2x:Number;
private var v2y:Number;
private var v2z:Number;
private var df:Number;
var v2:ScreenVertex;
private var cz:Number;
private var _diffuseTransform:Matrix3D;
private var cy:Number;
private var point:PointLight;
private var red:Number;
private var graphics:Graphics;
var session:AbstractRenderSession;
private var global:AmbientLight;
private var fade:Number;
private var amb:Number;
private var ffy:Number;
private var spec:Number;
private var nf:Number;
private var ffz:Number;
private var draw_reflect:Boolean;// = false
private var draw_fall:Boolean;// = false
private var rfx:Number;
private var rfy:Number;
private var rfz:Number;
private var ffx:Number;
private var nx:Number;
private var d1x:Number;
private var d1y:Number;
private var d1z:Number;
private var kag:Number;
private var ny:Number;
private var zoom:Number;
private var kar:Number;
private var focus:Number;
private var fx:Number;
private var fz:Number;
public var specular_brightness:Number;// = 1
private var directional:DirectionalLight;
private var c0x:Number;
private var c0y:Number;
private var c0z:Number;
private var kab:Number;
private var pdd:Number;
private var pa:Number;
private var d2y:Number;
private var pc:Number;
private var d2x:Number;
private var ksb:Number;
private var d2z:Number;
private var ksg:Number;
public function CenterLightingMaterial(_arg1:Object=null){
ini = Init.parse(_arg1);
ak = ini.getNumber("ak", 20);
}
public function updateMaterial(_arg1:Object3D, _arg2:View3D):void{
for each (directional in _arg1.session.lightarray.directionals) {
if (((!(directional.diffuseTransform[_arg1])) || (_arg1.sceneTransformed))){
directional.setDiffuseTransform(_arg1);
};
};
}
protected function renderTri(_arg1:DrawTriangle, _arg2:AbstractRenderSession, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number):void{
throw (new Error("Not implemented"));
}
public function get visible():Boolean{
throw (new Error("Not implemented"));
}
public function renderTriangle(_arg1:DrawTriangle):void{
session = _arg1.source.session;
v0 = _arg1.v0;
v1 = _arg1.v1;
v2 = _arg1.v2;
projection = _arg1.projection;
focus = projection.focus;
zoom = projection.zoom;
v0z = v0.z;
v0p = ((1 + (v0z / focus)) / zoom);
v0x = (v0.x * v0p);
v0y = (v0.y * v0p);
v1z = v1.z;
v1p = ((1 + (v1z / focus)) / zoom);
v1x = (v1.x * v1p);
v1y = (v1.y * v1p);
v2z = v2.z;
v2p = ((1 + (v2z / focus)) / zoom);
v2x = (v2.x * v2p);
v2y = (v2.y * v2p);
d1x = (v1x - v0x);
d1y = (v1y - v0y);
d1z = (v1z - v0z);
d2x = (v2x - v0x);
d2y = (v2y - v0y);
d2z = (v2z - v0z);
pa = ((d1y * d2z) - (d1z * d2y));
pb = ((d1z * d2x) - (d1x * d2z));
pc = ((d1x * d2y) - (d1y * d2x));
pdd = Math.sqrt((((pa * pa) + (pb * pb)) + (pc * pc)));
pa = (pa / pdd);
pb = (pb / pdd);
pc = (pc / pdd);
c0x = (((v0x + v1x) + v2x) / 3);
c0y = (((v0y + v1y) + v2y) / 3);
c0z = (((v0z + v1z) + v2z) / 3);
kar = (kag = (kab = (kdr = (kdg = (kdb = (ksr = (ksg = (ksb = 0))))))));
_source = (_arg1.source as Mesh);
for each (directional in session.lightarray.directionals) {
_diffuseTransform = directional.diffuseTransform[_source];
red = directional.red;
green = directional.green;
blue = directional.blue;
dfx = _diffuseTransform.szx;
dfy = _diffuseTransform.szy;
dfz = _diffuseTransform.szz;
nx = _arg1.face.normal.x;
ny = _arg1.face.normal.y;
nz = _arg1.face.normal.z;
amb = (directional.ambient * ambient_brightness);
kar = (kar + (red * amb));
kag = (kag + (green * amb));
kab = (kab + (blue * amb));
nf = (((dfx * nx) + (dfy * ny)) + (dfz * nz));
if (nf < 0){
} else {
diff = ((directional.diffuse * nf) * diffuse_brightness);
kdr = (kdr + (red * diff));
kdg = (kdg + (green * diff));
kdb = (kdb + (blue * diff));
rfz = (dfz - ((2 * nf) * nz));
if (rfz < 0){
} else {
rfx = (dfx - ((2 * nf) * nx));
rfy = (dfy - ((2 * nf) * ny));
spec = ((directional.specular * Math.pow(rfz, ak)) * specular_brightness);
ksr = (ksr + (red * spec));
ksg = (ksg + (green * spec));
ksb = (ksb + (blue * spec));
};
};
};
for each (point in session.lightarray.points) {
red = point.red;
green = point.green;
blue = point.blue;
dfx = (point.x - c0x);
dfy = (point.y - c0y);
dfz = (point.z - c0z);
df = Math.sqrt((((dfx * dfx) + (dfy * dfy)) + (dfz * dfz)));
dfx = (dfx / df);
dfy = (dfy / df);
dfz = (dfz / df);
fade = ((1 / df) / df);
amb = ((point.ambient * fade) * ambient_brightness);
kar = (kar + (red * amb));
kag = (kag + (green * amb));
kab = (kab + (blue * amb));
nf = (((dfx * pa) + (dfy * pb)) + (dfz * pc));
if (nf < 0){
} else {
diff = (((point.diffuse * fade) * nf) * diffuse_brightness);
kdr = (kdr + (red * diff));
kdg = (kdg + (green * diff));
kdb = (kdb + (blue * diff));
rfz = (dfz - ((2 * nf) * pc));
if (rfz < 0){
} else {
rfx = (dfx - ((2 * nf) * pa));
rfy = (dfy - ((2 * nf) * pb));
spec = (((point.specular * fade) * Math.pow(rfz, ak)) * specular_brightness);
ksr = (ksr + (red * spec));
ksg = (ksg + (green * spec));
ksb = (ksb + (blue * spec));
};
};
};
renderTri(_arg1, session, kar, kag, kab, kdr, kdg, kdb, ksr, ksg, ksb);
if (((((draw_fall) || (draw_reflect))) || (draw_normal))){
graphics = session.graphics;
cz = c0z;
cx = ((c0x * zoom) / (1 + (cz / focus)));
cy = ((c0y * zoom) / (1 + (cz / focus)));
if (draw_normal){
ncz = (c0z + (30 * pc));
ncx = ((((c0x + (30 * pa)) * zoom) * focus) / (focus + ncz));
ncy = ((((c0y + (30 * pb)) * zoom) * focus) / (focus + ncz));
graphics.lineStyle(1, 0, 1);
graphics.moveTo(cx, cy);
graphics.lineTo(ncx, ncy);
graphics.moveTo(cx, cy);
graphics.drawCircle(cx, cy, 2);
};
if (((draw_fall) || (draw_reflect))){
for each (point in session.lightarray.points) {
red = point.red;
green = point.green;
blue = point.blue;
sum = (((red + green) + blue) / 0xFF);
red = (red / sum);
green = (green / sum);
blue = (blue / sum);
dfx = (point.x - c0x);
dfy = (point.y - c0y);
dfz = (point.z - c0z);
df = Math.sqrt((((dfx * dfx) + (dfy * dfy)) + (dfz * dfz)));
dfx = (dfx / df);
dfy = (dfy / df);
dfz = (dfz / df);
nf = (((dfx * pa) + (dfy * pb)) + (dfz * pc));
if (nf < 0){
} else {
if (draw_fall){
ffz = (c0z + ((30 * dfz) * (1 - draw_fall_k)));
ffx = ((((c0x + ((30 * dfx) * (1 - draw_fall_k))) * zoom) * focus) / (focus + ffz));
ffy = ((((c0y + ((30 * dfy) * (1 - draw_fall_k))) * zoom) * focus) / (focus + ffz));
fz = (c0z + (30 * dfz));
fx = ((((c0x + (30 * dfx)) * zoom) * focus) / (focus + fz));
fy = ((((c0y + (30 * dfy)) * zoom) * focus) / (focus + fz));
graphics.lineStyle(1, (((int(red) * 65536) + (int(green) * 0x0100)) + int(blue)), 1);
graphics.moveTo(ffx, ffy);
graphics.lineTo(fx, fy);
graphics.moveTo(ffx, ffy);
};
if (draw_reflect){
rfx = (dfx - ((2 * nf) * pa));
rfy = (dfy - ((2 * nf) * pb));
rfz = (dfz - ((2 * nf) * pc));
rz = (c0z - ((30 * rfz) * draw_reflect_k));
rx = ((((c0x - ((30 * rfx) * draw_reflect_k)) * zoom) * focus) / (focus + rz));
ry = ((((c0y - ((30 * rfy) * draw_reflect_k)) * zoom) * focus) / (focus + rz));
graphics.lineStyle(1, (((int((red * 0.5)) * 65536) + (int((green * 0.5)) * 0x0100)) + int((blue * 0.5))), 1);
graphics.moveTo(cx, cy);
graphics.lineTo(rx, ry);
graphics.moveTo(cx, cy);
};
};
};
};
};
}
}
}//package away3d.materials
Section 90
//ColorMaterial (away3d.materials.ColorMaterial)
package away3d.materials {
import away3d.core.draw.*;
import away3d.core.utils.*;
public class ColorMaterial implements ITriangleMaterial, IFogMaterial {
public var color:uint;
protected var ini:Init;
private var _alpha:Number;
public function ColorMaterial(_arg1=null, _arg2:Object=null){
if (_arg1 == null){
_arg1 = "random";
};
this.color = Cast.trycolor(_arg1);
ini = Init.parse(_arg2);
_alpha = ini.getNumber("alpha", 1, {min:0, max:1});
}
public function set alpha(_arg1:Number):void{
_alpha = _arg1;
}
public function renderFog(_arg1:DrawFog):void{
_arg1.source.session.renderFogColor(color, _alpha);
}
public function get visible():Boolean{
return ((alpha > 0));
}
public function renderTriangle(_arg1:DrawTriangle):void{
_arg1.source.session.renderTriangleColor(color, _alpha, _arg1.v0, _arg1.v1, _arg1.v2);
}
public function clone():IFogMaterial{
return (new ColorMaterial(color, {alpha:alpha}));
}
public function get alpha():Number{
return (_alpha);
}
}
}//package away3d.materials
Section 91
//IFogMaterial (away3d.materials.IFogMaterial)
package away3d.materials {
import away3d.core.draw.*;
public interface IFogMaterial extends ITriangleMaterial {
function renderFog(_arg1:DrawFog):void;
function set alpha(_arg1:Number):void;
function clone():IFogMaterial;
function get alpha():Number;
}
}//package away3d.materials
Section 92
//ILayerMaterial (away3d.materials.ILayerMaterial)
package away3d.materials {
import flash.display.*;
import flash.geom.*;
import away3d.core.draw.*;
import away3d.core.base.*;
import away3d.core.utils.*;
public interface ILayerMaterial extends IMaterial {
function renderLayer(_arg1:DrawTriangle, _arg2:Sprite, _arg3:int):void;
function renderFace(_arg1:Face, _arg2:Rectangle, _arg3:FaceVO):FaceVO;
}
}//package away3d.materials
Section 93
//IMaterial (away3d.materials.IMaterial)
package away3d.materials {
public interface IMaterial {
function get visible():Boolean;
}
}//package away3d.materials
Section 94
//ISegmentMaterial (away3d.materials.ISegmentMaterial)
package away3d.materials {
import away3d.core.draw.*;
public interface ISegmentMaterial extends IMaterial {
function renderSegment(_arg1:DrawSegment):void;
}
}//package away3d.materials
Section 95
//ITriangleMaterial (away3d.materials.ITriangleMaterial)
package away3d.materials {
import away3d.core.draw.*;
public interface ITriangleMaterial extends IMaterial {
function renderTriangle(_arg1:DrawTriangle):void;
}
}//package away3d.materials
Section 96
//IUpdatingMaterial (away3d.materials.IUpdatingMaterial)
package away3d.materials {
import away3d.containers.*;
import away3d.core.base.*;
public interface IUpdatingMaterial {
function updateMaterial(_arg1:Object3D, _arg2:View3D):void;
}
}//package away3d.materials
Section 97
//IUVMaterial (away3d.materials.IUVMaterial)
package away3d.materials {
import flash.display.*;
public interface IUVMaterial extends IMaterial {
function addOnResize(_arg1:Function):void;
function getPixel32(_arg1:Number, _arg2:Number):uint;
function removeOnResize(_arg1:Function):void;
function get width():Number;
function get height():Number;
function get bitmap():BitmapData;
}
}//package away3d.materials
Section 98
//MovieMaterial (away3d.materials.MovieMaterial)
package away3d.materials {
import flash.display.*;
import flash.geom.*;
import away3d.containers.*;
import away3d.events.*;
import away3d.core.base.*;
import away3d.core.utils.*;
public class MovieMaterial extends TransformBitmapMaterial implements ITriangleMaterial, IUVMaterial {
private var _lastsession:int;
public var movie:Sprite;
public var transparent:Boolean;
public var autoUpdate:Boolean;
public var interactive:Boolean;
private var _bMode:String;
private var _colTransform:ColorTransform;
private var t:Matrix;
private var x:Number;
private var y:Number;
public function MovieMaterial(_arg1:Sprite, _arg2:Object=null){
this.movie = _arg1;
ini = Init.parse(_arg2);
transparent = ini.getBoolean("transparent", true);
autoUpdate = ini.getBoolean("autoUpdate", true);
interactive = ini.getBoolean("interactive", false);
_bitmap = new BitmapData(_arg1.width, _arg1.height, transparent, 0);
super(_bitmap, ini);
}
override public function get width():Number{
return (_renderBitmap.width);
}
public function update():void{
if (transparent){
_renderBitmap.fillRect(_renderBitmap.rect, 0);
};
if (((!((_alpha == 1))) || (!((_color == 0xFFFFFF))))){
_colTransform = _colorTransform;
} else {
_colTransform = movie.transform.colorTransform;
};
if (_blendMode != BlendMode.NORMAL){
_bMode = _blendMode;
} else {
_bMode = movie.blendMode;
};
_renderBitmap.draw(movie, new Matrix(movie.scaleX, 0, 0, movie.scaleY), _colTransform, _bMode, _renderBitmap.rect);
}
override protected function updateRenderBitmap():void{
}
override public function updateMaterial(_arg1:Object3D, _arg2:View3D):void{
super.updateMaterial(_arg1, _arg2);
if (autoUpdate){
update();
};
_session = _arg1.session;
if (interactive){
if (!_session.view._interactiveLayer.contains(movie)){
_session.view._interactiveLayer.addChild(movie);
resetInteractiveLayer();
_arg1.addOnMouseOver(onMouseOver);
_arg1.addOnMouseOut(onMouseOut);
};
} else {
if (_session.view._interactiveLayer.contains(movie)){
_session.view._interactiveLayer.removeChild(movie);
_arg1.removeOnMouseOver(onMouseOver);
_arg1.removeOnMouseOut(onMouseOut);
};
};
}
override public function get height():Number{
return (_renderBitmap.height);
}
private function onMouseOut(_arg1:MouseEvent3D):void{
if (_arg1.material == this){
_arg1.object.removeOnMouseMove(onMouseMove);
resetInteractiveLayer();
};
}
private function onMouseMove(_arg1:MouseEvent3D):void{
x = (_arg1.uv.u * _renderBitmap.width);
y = ((1 - _arg1.uv.v) * _renderBitmap.height);
if (_transform){
t = _transform.clone();
t.invert();
movie.x = (((_arg1.screenX - (x * t.a)) - (y * t.c)) - t.tx);
movie.y = (((_arg1.screenY - (x * t.b)) - (y * t.d)) - t.ty);
} else {
movie.x = (_arg1.screenX - x);
movie.y = (_arg1.screenY - y);
};
}
private function onMouseOver(_arg1:MouseEvent3D):void{
if (_arg1.material == this){
_arg1.object.addOnMouseMove(onMouseMove);
onMouseMove(_arg1);
};
}
private function resetInteractiveLayer():void{
movie.x = -10000;
movie.y = -10000;
}
}
}//package away3d.materials
Section 99
//ShadingColorMaterial (away3d.materials.ShadingColorMaterial)
package away3d.materials {
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.utils.*;
public class ShadingColorMaterial extends CenterLightingMaterial {
private var fg:int;
public var specular:int;
public var cache:Boolean;
private var fr:int;
private var fb:int;
public var ambient:int;
public var alpha:Number;
public var diffuse:int;
private var sfb:int;
private var sfg:int;
private var sfr:int;
public function ShadingColorMaterial(_arg1=null, _arg2:Object=null){
if (_arg1 == null){
_arg1 = "random";
};
_arg1 = Cast.trycolor(_arg1);
super(_arg2);
ambient = ini.getColor("ambient", _arg1);
diffuse = ini.getColor("diffuse", _arg1);
specular = ini.getColor("specular", _arg1);
alpha = ini.getNumber("alpha", 1);
cache = ini.getBoolean("cache", false);
}
override public function get visible():Boolean{
return (true);
}
override protected function renderTri(_arg1:DrawTriangle, _arg2:AbstractRenderSession, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number):void{
fr = int((((((ambient & 0xFF0000) * _arg3) + ((diffuse & 0xFF0000) * _arg6)) + ((specular & 0xFF0000) * _arg9)) >> 16));
fg = int((((((ambient & 0xFF00) * _arg4) + ((diffuse & 0xFF00) * _arg7)) + ((specular & 0xFF00) * _arg10)) >> 8));
fb = int(((((ambient & 0xFF) * _arg5) + ((diffuse & 0xFF) * _arg8)) + ((specular & 0xFF) * _arg11)));
if (fr > 0xFF){
fr = 0xFF;
};
if (fg > 0xFF){
fg = 0xFF;
};
if (fb > 0xFF){
fb = 0xFF;
};
_arg2.renderTriangleColor((((fr << 16) | (fg << 8)) | fb), alpha, _arg1.v0, _arg1.v1, _arg1.v2);
if (cache){
if (_arg1.face != null){
sfr = int(((((ambient & 0xFF0000) * _arg3) + ((diffuse & 0xFF0000) * _arg6)) >> 16));
sfg = int(((((ambient & 0xFF00) * _arg4) + ((diffuse & 0xFF00) * _arg7)) >> 8));
sfb = int((((ambient & 0xFF) * _arg5) + ((diffuse & 0xFF) * _arg8)));
if (sfr > 0xFF){
sfr = 0xFF;
};
if (sfg > 0xFF){
sfg = 0xFF;
};
if (sfb > 0xFF){
sfb = 0xFF;
};
_arg1.face.material = new ColorMaterial((((sfr << 16) | (sfg << 8)) | sfb));
};
};
}
}
}//package away3d.materials
Section 100
//TransformBitmapMaterial (away3d.materials.TransformBitmapMaterial)
package away3d.materials {
import flash.display.*;
import flash.geom.*;
import away3d.containers.*;
import away3d.core.draw.*;
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.core.utils.*;
public class TransformBitmapMaterial extends BitmapMaterial implements ITriangleMaterial, IUVMaterial {
private var _u0:Number;
private var _u1:Number;
private var _invtexturemapping:Matrix;
private var _u2:Number;
private var line:Point;
private var _v0:Number;
private var _v1:Number;
private var _v2:Number;
private var v0x:Number;
private var v0y:Number;
private var v0z:Number;
private var overlap:Boolean;
private var dot:Number;
private var normalR:Number3D;
private var face:Face;
private var v1y:Number;
private var v1z:Number;
private var v1x:Number;
private var h:Number;
private var i:String;
private var flag:Boolean;
private var _scaleX:Number;// = 1
private var _scaleY:Number;// = 1
private var mPoint2:Point;
private var mPoint3:Point;
private var mPoint4:Point;
private var t:Matrix;
private var _throughProjection:Boolean;
private var w:Number;
private var x:Number;
private var y:Number;
private var v0:Number3D;
private var v1:Number3D;
private var v2y:Number;
private var v2z:Number;
private var v2x:Number;
private var _projectionDirty:Boolean;
private var mapa:Number;
private var mapb:Number;
private var mapc:Number;
private var mapd:Number;
private var v2:Number3D;
private var mPoint1:Point;
private var point:Point;
private var point1:Point;
private var point3:Point;
private var fPoint1:Point;
private var fPoint2:Point;
private var DOWN:Number3D;
private var fPoint4:Point;
private var zero:Number;
private var fPoint3:Point;
private var _globalProjection:Boolean;
private var sign:Number;
private var point2:Point;
private var _N:Number3D;
private var _projectionVector:Number3D;
private var _M:Number3D;
private var _rotation:Number;// = 0
private var maptx:Number;
private var mapty:Number;
private var _transformDirty:Boolean;
private var _offsetX:Number;// = 0
private var _offsetY:Number;// = 0
var _transform:Matrix;
private var RIGHT:Number3D;
public function TransformBitmapMaterial(_arg1:BitmapData, _arg2:Object=null){
_transform = new Matrix();
_N = new Number3D();
_M = new Number3D();
DOWN = new Number3D(0, -1, 0);
RIGHT = new Number3D(1, 0, 0);
normalR = new Number3D();
v0 = new Number3D();
v1 = new Number3D();
v2 = new Number3D();
fPoint1 = new Point();
fPoint2 = new Point();
fPoint3 = new Point();
fPoint4 = new Point();
mPoint1 = new Point();
mPoint2 = new Point();
mPoint3 = new Point();
mPoint4 = new Point();
line = new Point();
super(_arg1, _arg2);
transform = (ini.getObject("transform", Matrix) as Matrix);
scaleX = ini.getNumber("scaleX", _scaleX);
scaleY = ini.getNumber("scaleY", _scaleY);
offsetX = ini.getNumber("offsetX", _offsetX);
offsetY = ini.getNumber("offsetY", _offsetY);
rotation = ini.getNumber("rotation", _rotation);
projectionVector = (ini.getObject("projectionVector", Number3D) as Number3D);
throughProjection = ini.getBoolean("throughProjection", true);
globalProjection = ini.getBoolean("globalProjection", false);
}
public function set throughProjection(_arg1:Boolean):void{
_throughProjection = _arg1;
_projectionDirty = true;
}
private function findSeparatingAxis(_arg1:Array, _arg2:Array):Boolean{
if (checkEdge(_arg1, _arg2)){
return (true);
};
if (checkEdge(_arg2, _arg1)){
return (true);
};
return (false);
}
override public function renderFace(_arg1:Face, _arg2:Rectangle, _arg3:FaceVO):FaceVO{
if (_transform){
_mapping = _transform.clone();
} else {
_mapping = new Matrix();
};
if (!_projectionVector){
renderSource(_arg1.parent, _arg2, _mapping);
};
_faceVO = _faceDictionary[_arg1];
if (!_faceVO){
_faceVO = (_faceDictionary[_arg1] = new FaceVO());
};
if (_arg3.resized){
_arg3.resized = false;
_faceVO.resized = true;
};
if (((_arg3.updated) || (_faceVO.invalidated))){
_arg3.updated = false;
_bitmapRect = _arg1.bitmapRect;
if (_faceVO.invalidated){
_faceVO.invalidated = false;
} else {
_faceVO.updated = true;
};
_faceVO.bitmap = _arg3.bitmap;
if (_projectionVector){
_invtexturemapping = _arg1._dt.invtexturemapping;
_mapping.concat(projectUV(_arg1._dt));
_mapping.concat(_invtexturemapping);
if (((((throughProjection) || ((_arg1.normal.dot(_projectionVector) >= 0)))) && (((repeat) || (!(findSeparatingAxis(getFacePoints(_invtexturemapping), getMappingPoints(_mapping)))))))){
if (_faceVO.cleared){
_faceVO.bitmap = _arg3.bitmap.clone();
};
_faceVO.cleared = false;
_faceVO.updated = true;
_graphics = _s.graphics;
_graphics.clear();
_graphics.beginBitmapFill(_bitmap, _mapping, repeat, smooth);
_graphics.drawRect(0, 0, _bitmapRect.width, _bitmapRect.height);
_graphics.endFill();
_faceVO.bitmap.draw(_s, null, _colorTransform, _blendMode, _faceVO.bitmap.rect);
};
} else {
if (((repeat) && (!(findSeparatingAxis(getContainerPoints(_arg2), getMappingPoints(_mapping)))))){
_faceVO.cleared = false;
_faceVO.updated = true;
_faceVO.bitmap.copyPixels(_sourceVO.bitmap, _bitmapRect, _zeroPoint, null, null, true);
};
};
};
return (_faceVO);
}
public function set rotation(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(rotation)"));
};
if (_arg1 == Infinity){
Debug.warning("rotation == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("rotation == -Infinity");
};
_rotation = _arg1;
_transformDirty = true;
}
override public function updateMaterial(_arg1:Object3D, _arg2:View3D):void{
_graphics = null;
clearShapeDictionary();
if (((((((_transformDirty) || (_projectionDirty))) || (_colorTransformDirty))) || (_blendModeDirty))){
clearFaceDictionary();
};
if (_colorTransformDirty){
setColorTransform();
};
if (_transformDirty){
updateTransform();
};
_projectionDirty = false;
_blendModeDirty = false;
}
public function get throughProjection():Boolean{
return (_throughProjection);
}
public function get offsetY():Number{
return (_offsetY);
}
public function get offsetX():Number{
return (_offsetX);
}
override public function getPixel32(_arg1:Number, _arg2:Number):uint{
x = (_arg1 * _bitmap.width);
y = ((1 - _arg2) * _bitmap.height);
if (_transform){
t = _transform.clone();
t.invert();
return (_bitmap.getPixel32((((x * t.a) + (y * t.c)) + t.tx), (((x * t.b) + (y * t.d)) + t.ty)));
};
return (_bitmap.getPixel32(x, y));
}
public function set offsetX(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(offsetX)"));
};
if (_arg1 == Infinity){
Debug.warning("offsetX == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("offsetX == -Infinity");
};
_offsetX = _arg1;
_transformDirty = true;
}
public function set offsetY(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(offsetY)"));
};
if (_arg1 == Infinity){
Debug.warning("offsetY == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("offsetY == -Infinity");
};
_offsetY = _arg1;
_transformDirty = true;
}
public function get scaleY():Number{
return (_scaleY);
}
public function get scaleX():Number{
return (_scaleX);
}
public function get globalProjection():Boolean{
return (_globalProjection);
}
public function get projectionVector():Number3D{
return (_projectionVector);
}
public function get transform():Matrix{
return (_transform);
}
private function projectUV(_arg1:DrawTriangle):Matrix{
face = _arg1.face;
if (globalProjection){
if (_arg1.backface){
v0.transform(face.v0.position, _arg1.source.sceneTransform);
v2.transform(face.v1.position, _arg1.source.sceneTransform);
v1.transform(face.v2.position, _arg1.source.sceneTransform);
} else {
v0.transform(face.v0.position, _arg1.source.sceneTransform);
v1.transform(face.v1.position, _arg1.source.sceneTransform);
v2.transform(face.v2.position, _arg1.source.sceneTransform);
};
} else {
if (_arg1.backface){
v0 = face.v0.position;
v2 = face.v1.position;
v1 = face.v2.position;
} else {
v0 = face.v0.position;
v1 = face.v1.position;
v2 = face.v2.position;
};
};
v0x = v0.x;
v0y = v0.y;
v0z = v0.z;
v1x = v1.x;
v1y = v1.y;
v1z = v1.z;
v2x = v2.x;
v2y = v2.y;
v2z = v2.z;
_u0 = (((v0x * _N.x) + (v0y * _N.y)) + (v0z * _N.z));
_u1 = (((v1x * _N.x) + (v1y * _N.y)) + (v1z * _N.z));
_u2 = (((v2x * _N.x) + (v2y * _N.y)) + (v2z * _N.z));
_v0 = (((v0x * _M.x) + (v0y * _M.y)) + (v0z * _M.z));
_v1 = (((v1x * _M.x) + (v1y * _M.y)) + (v1z * _M.z));
_v2 = (((v2x * _M.x) + (v2y * _M.y)) + (v2z * _M.z));
if ((((((_u0 == _u1)) && ((_v0 == _v1)))) || ((((_u0 == _u2)) && ((_v0 == _v2)))))){
if (_u0 > 0.05){
_u0 = (_u0 - 0.05);
} else {
_u0 = (_u0 + 0.05);
};
if (_v0 > 0.07){
_v0 = (_v0 - 0.07);
} else {
_v0 = (_v0 + 0.07);
};
};
if ((((_u2 == _u1)) && ((_v2 == _v1)))){
if (_u2 > 0.04){
_u2 = (_u2 - 0.04);
} else {
_u2 = (_u2 + 0.04);
};
if (_v2 > 0.06){
_v2 = (_v2 - 0.06);
} else {
_v2 = (_v2 + 0.06);
};
};
t = new Matrix((_u1 - _u0), (_v1 - _v0), (_u2 - _u0), (_v2 - _v0), _u0, _v0);
t.invert();
return (t);
}
private function getContainerPoints(_arg1:Rectangle):Array{
return ([_arg1.topLeft, new Point(_arg1.top, _arg1.right), _arg1.bottomRight, new Point(_arg1.bottom, _arg1.left)]);
}
override protected function getMapping(_arg1:DrawTriangle):Matrix{
_faceVO = _faceDictionary[(face = _arg1.face)];
if (!_faceVO){
_faceVO = (_faceDictionary[face] = new FaceVO());
};
if (((((_faceVO.invalidated) || (!(_arg1.texturemapping)))) || (!((_faceVO.backface == _arg1.backface))))){
_faceVO.invalidated = false;
_faceVO.backface = _arg1.backface;
if (projectionVector){
_faceVO.mapping = projectUV(_arg1);
} else {
if (!_arg1.texturemapping){
_faceVO.mapping = _arg1.transformUV(this);
} else {
_faceVO.mapping = _arg1.texturemapping;
};
};
if (_transform){
_mapping = _transform.clone();
_mapping.concat(_faceVO.mapping);
return ((_faceVO.mapping = _mapping));
};
};
return (_faceVO.mapping);
}
private function getMappingPoints(_arg1:Matrix):Array{
mapa = (_arg1.a * width);
mapb = (_arg1.b * height);
mapc = (_arg1.c * width);
mapd = (_arg1.d * height);
maptx = _arg1.tx;
mapty = _arg1.ty;
mPoint1.x = maptx;
mPoint1.y = mapty;
mPoint2.x = (maptx + mapc);
mPoint2.y = (mapty + mapd);
mPoint3.x = ((maptx + mapa) + mapc);
mPoint3.y = ((mapty + mapb) + mapd);
mPoint4.x = (maptx + mapa);
mPoint4.y = (mapty + mapb);
return ([mPoint1, mPoint2, mPoint3, mPoint4]);
}
private function getFacePoints(_arg1:Matrix):Array{
fPoint1.x = (_u0 = _arg1.tx);
fPoint2.x = (_arg1.a + _u0);
fPoint3.x = (_arg1.c + _u0);
fPoint1.y = (_v0 = _arg1.ty);
fPoint2.y = (_arg1.b + _v0);
fPoint3.y = (_arg1.d + _v0);
return ([fPoint1, fPoint2, fPoint3]);
}
public function get rotation():Number{
return (_rotation);
}
public function set globalProjection(_arg1:Boolean):void{
_globalProjection = _arg1;
_projectionDirty = true;
}
public function set scaleY(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(scaleY)"));
};
if (_arg1 == Infinity){
Debug.warning("scaleY == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("scaleY == -Infinity");
};
if (_arg1 == 0){
Debug.warning("scaleY == 0");
};
_scaleY = _arg1;
_transformDirty = true;
}
public function set scaleX(_arg1:Number):void{
if (isNaN(_arg1)){
throw (new Error("isNaN(scaleX)"));
};
if (_arg1 == Infinity){
Debug.warning("scaleX == Infinity");
};
if (_arg1 == -(Infinity)){
Debug.warning("scaleX == -Infinity");
};
if (_arg1 == 0){
Debug.warning("scaleX == 0");
};
_scaleX = _arg1;
_transformDirty = true;
}
private function updateTransform():void{
if ((((((((((_scaleX == 1)) && ((_scaleY == 1)))) && ((_offsetX == 0)))) && ((_offsetY == 0)))) && ((_rotation == 0)))){
_transform = null;
} else {
_transform = new Matrix();
_transform.scale(_scaleX, _scaleY);
_transform.rotate(_rotation);
_transform.translate(_offsetX, _offsetY);
};
_transformDirty = false;
}
override public function renderTriangle(_arg1:DrawTriangle):void{
if (((_projectionVector) && (!(throughProjection)))){
if (globalProjection){
normalR.rotate(_arg1.face.normal, _arg1.source.sceneTransform);
if (normalR.dot(_projectionVector) < 0){
return;
};
} else {
if (_arg1.face.normal.dot(_projectionVector) < 0){
return;
};
};
};
super.renderTriangle(_arg1);
}
public function set transform(_arg1:Matrix):void{
_transform = _arg1;
if (_transform){
_rotation = Math.atan2(_transform.b, _transform.a);
_scaleX = (_transform.a / Math.cos(_rotation));
_scaleY = (_transform.d / Math.cos(_rotation));
_offsetX = _transform.tx;
_offsetY = _transform.ty;
} else {
_scaleX = (_scaleY = 1);
_offsetX = (_offsetY = (_rotation = 0));
};
clearFaceDictionary();
}
public function set projectionVector(_arg1:Number3D):void{
_projectionVector = _arg1;
if (_projectionVector){
_N.cross(_projectionVector, DOWN);
if (!_N.modulo){
_N = RIGHT;
};
_M.cross(_N, _projectionVector);
_N.cross(_M, _projectionVector);
_N.normalize();
_M.normalize();
};
_projectionDirty = true;
}
private function checkEdge(_arg1:Array, _arg2:Array):Boolean{
for (i in _arg1) {
point2 = _arg1[i];
if (int(i) == 0){
point1 = _arg1[(_arg1.length - 1)];
point3 = _arg1[(_arg1.length - 2)];
} else {
point1 = _arg1[(int(i) - 1)];
if (int(i) == 1){
point3 = _arg1[(_arg1.length - 1)];
} else {
point3 = _arg1[(int(i) - 2)];
};
};
line.x = (point2.y - point1.y);
line.y = (point1.x - point2.x);
zero = ((point1.x * line.x) + (point1.y * line.y));
sign = ((zero - (point3.x * line.x)) - (point3.y * line.y));
flag = true;
for each (point in _arg2) {
dot = ((point.x * line.x) + (point.y * line.y));
if ((zero * sign) > (dot * sign)){
flag = false;
break;
};
};
if (flag){
return (true);
};
};
return (false);
}
}
}//package away3d.materials
Section 101
//WhiteShadingBitmapMaterial (away3d.materials.WhiteShadingBitmapMaterial)
package away3d.materials {
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.events.*;
import away3d.core.utils.*;
import flash.filters.*;
public class WhiteShadingBitmapMaterial extends CenterLightingMaterial implements IUVMaterial {
private var colorTransform:ColorMatrixFilter;
private var step:int;// = 1
private var _bitmap:BitmapData;
private var br:Number;
private var cache:Dictionary;
private var blackrender:Boolean;
public var repeat:Boolean;
private var mapping:Matrix;
private var bitmapPoint:Point;
private var whitek:Number;// = 0.2
public var smooth:Boolean;
private var whiterender:Boolean;
public function WhiteShadingBitmapMaterial(_arg1:BitmapData, _arg2:Object=null){
bitmapPoint = new Point(0, 0);
colorTransform = new ColorMatrixFilter();
_bitmap = _arg1;
super(_arg2);
smooth = ini.getBoolean("smooth", false);
repeat = ini.getBoolean("repeat", false);
if (!CacheStore.whiteShadingCache[_bitmap]){
CacheStore.whiteShadingCache[_bitmap] = new Dictionary(true);
};
cache = CacheStore.whiteShadingCache[_bitmap];
}
public function get width():Number{
return (_bitmap.width);
}
public function removeOnResize(_arg1:Function):void{
removeEventListener(MaterialEvent.RESIZED, _arg1, false);
}
public function doubleStepTo(_arg1:int):void{
if (step < _arg1){
step = (step * 2);
};
}
public function get height():Number{
return (_bitmap.height);
}
public function getPixel32(_arg1:Number, _arg2:Number):uint{
return (_bitmap.getPixel32((_arg1 * _bitmap.width), ((1 - _arg2) * _bitmap.height)));
}
private function ladder(_arg1:Number):Number{
if (_arg1 < (1 / 0xFF)){
return (0);
};
if (_arg1 > 0xFF){
_arg1 = 0xFF;
};
return (Math.exp((Math.round((Math.log(_arg1) * step)) / step)));
}
public function get bitmap():BitmapData{
return (_bitmap);
}
override public function get visible():Boolean{
return (true);
}
public function addOnResize(_arg1:Function):void{
addEventListener(MaterialEvent.RESIZED, _arg1, false, 0, true);
}
override protected function renderTri(_arg1:DrawTriangle, _arg2:AbstractRenderSession, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number):void{
var _local12:Number;
var _local13:BitmapData;
br = (((((((((_arg3 + _arg4) + _arg5) + _arg6) + _arg7) + _arg8) + _arg9) + _arg10) + _arg11) / (0xFF * 3));
if (!(mapping = _arg1.texturemapping)){
mapping = _arg1.transformUV(this);
};
v0 = _arg1.v0;
v1 = _arg1.v1;
v2 = _arg1.v2;
if ((((br < 1)) && (((blackrender) || ((((step < 16)) && (!(_bitmap.transparent)))))))){
_arg2.renderTriangleBitmap(_bitmap, mapping, v0, v1, v2, smooth, repeat);
_arg2.renderTriangleColor(0, (1 - br), v0, v1, v2);
} else {
if ((((br > 1)) && (whiterender))){
_arg2.renderTriangleBitmap(_bitmap, mapping, v0, v1, v2, smooth, repeat);
_arg2.renderTriangleColor(0xFFFFFF, ((br - 1) * whitek), v0, v1, v2);
} else {
if (step < 64){
if (Math.random() < 0.01){
doubleStepTo(64);
};
};
_local12 = ladder(br);
_local13 = cache[_local12];
if (_local13 == null){
_local13 = new BitmapData(_bitmap.width, _bitmap.height, true, 0);
colorTransform.matrix = [_local12, 0, 0, 0, 0, 0, _local12, 0, 0, 0, 0, 0, _local12, 0, 0, 0, 0, 0, 1, 0];
_local13.applyFilter(_bitmap, _local13.rect, bitmapPoint, colorTransform);
cache[_local12] = _local13;
};
_arg2.renderTriangleBitmap(_local13, mapping, v0, v1, v2, smooth, repeat);
};
};
}
}
}//package away3d.materials
Section 102
//WireColorMaterial (away3d.materials.WireColorMaterial)
package away3d.materials {
import away3d.core.draw.*;
import away3d.core.utils.*;
public class WireColorMaterial implements ITriangleMaterial {
public var color:int;
protected var ini:Init;
public var alpha:Number;
public var width:Number;
public var wirealpha:Number;
public var wirecolor:int;
public function WireColorMaterial(_arg1=null, _arg2:Object=null){
if (_arg1 == null){
_arg1 = "random";
};
this.color = Cast.trycolor(_arg1);
ini = Init.parse(_arg2);
alpha = ini.getNumber("alpha", 1, {min:0, max:1});
wirecolor = ini.getColor("wirecolor", 0);
width = ini.getNumber("width", 1, {min:0});
wirealpha = ini.getNumber("wirealpha", 1, {min:0, max:1});
}
public function get visible():Boolean{
return ((((alpha > 0)) || ((wirealpha > 0))));
}
public function renderTriangle(_arg1:DrawTriangle):void{
_arg1.source.session.renderTriangleLineFill(width, color, alpha, wirecolor, wirealpha, _arg1.v0, _arg1.v1, _arg1.v2);
}
}
}//package away3d.materials
Section 103
//WireframeMaterial (away3d.materials.WireframeMaterial)
package away3d.materials {
import away3d.core.draw.*;
import away3d.core.utils.*;
public class WireframeMaterial implements ITriangleMaterial, ISegmentMaterial {
public var color:int;
protected var ini:Init;
public var alpha:Number;
public var width:Number;
public function WireframeMaterial(_arg1=null, _arg2:Object=null){
if (_arg1 == null){
_arg1 = "random";
};
this.color = Cast.trycolor(_arg1);
ini = Init.parse(_arg2);
alpha = ini.getNumber("alpha", 1, {min:0, max:1});
width = ini.getNumber("width", 1, {min:0});
}
public function get visible():Boolean{
return ((alpha > 0));
}
public function renderSegment(_arg1:DrawSegment):void{
if (alpha <= 0){
return;
};
_arg1.source.session.renderLine(_arg1.v0, _arg1.v1, width, color, alpha);
}
public function renderTriangle(_arg1:DrawTriangle):void{
if (alpha <= 0){
return;
};
_arg1.source.session.renderTriangleLine(width, color, alpha, _arg1.v0, _arg1.v1, _arg1.v2);
}
}
}//package away3d.materials
Section 104
//CubeMaterialsData (away3d.primitives.data.CubeMaterialsData)
package away3d.primitives.data {
import flash.events.*;
import away3d.events.*;
import away3d.materials.*;
import away3d.core.utils.*;
public class CubeMaterialsData extends EventDispatcher {
private var _back:ITriangleMaterial;
private var _bottom:ITriangleMaterial;
private var _top:ITriangleMaterial;
protected var ini:Init;
private var _left:ITriangleMaterial;
private var _front:ITriangleMaterial;
private var _materialchanged:MaterialEvent;
private var _right:ITriangleMaterial;
public function CubeMaterialsData(_arg1:Object=null){
ini = Init.parse(_arg1);
_left = ini.getMaterial("left");
_right = ini.getMaterial("right");
_bottom = ini.getMaterial("bottom");
_top = ini.getMaterial("top");
_front = ini.getMaterial("front");
_back = ini.getMaterial("back");
}
public function get left():ITriangleMaterial{
return (_left);
}
public function set left(_arg1:ITriangleMaterial):void{
if (_left == _arg1){
return;
};
_left = _arg1;
notifyMaterialChange(_left, "left");
}
public function set front(_arg1:ITriangleMaterial):void{
if (_front == _arg1){
return;
};
_front = _arg1;
notifyMaterialChange(_front, "front");
}
public function get top():ITriangleMaterial{
return (_top);
}
public function set bottom(_arg1:ITriangleMaterial):void{
if (_bottom == _arg1){
return;
};
_bottom = _arg1;
notifyMaterialChange(_bottom, "bottom");
}
public function removeOnMaterialChange(_arg1:Function):void{
removeEventListener(MaterialEvent.CHANGED, _arg1, false);
}
public function get right():ITriangleMaterial{
return (_right);
}
private function notifyMaterialChange(_arg1:ITriangleMaterial, _arg2:String):void{
if (!hasEventListener(MaterialEvent.CHANGED)){
return;
};
if (!_materialchanged){
_materialchanged = new MaterialEvent(MaterialEvent.CHANGED, _arg1);
} else {
_materialchanged.material = _arg1;
};
_materialchanged.extra = _arg2;
dispatchEvent(_materialchanged);
}
public function get back():ITriangleMaterial{
return (_back);
}
public function get front():ITriangleMaterial{
return (_front);
}
public function get bottom():ITriangleMaterial{
return (_bottom);
}
public function set back(_arg1:ITriangleMaterial):void{
if (_back == _arg1){
return;
};
_back = _arg1;
notifyMaterialChange(_back, "back");
}
public function set top(_arg1:ITriangleMaterial):void{
if (_top == _arg1){
return;
};
_top = _arg1;
notifyMaterialChange(_top, "top");
}
public function addOnMaterialChange(_arg1:Function):void{
addEventListener(MaterialEvent.CHANGED, _arg1, false, 0, false);
}
public function set right(_arg1:ITriangleMaterial):void{
if (_right == _arg1){
return;
};
_right = _arg1;
notifyMaterialChange(_right, "right");
}
}
}//package away3d.primitives.data
Section 105
//AbstractPrimitive (away3d.primitives.AbstractPrimitive)
package away3d.primitives {
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.materials.*;
public class AbstractPrimitive extends Mesh {
var _uv:UV;
var _uvStore:Array;
var _faceStore:Array;
var _primitiveDirty:Boolean;
var _faceActive:Array;
var _vActive:Array;
var _uvActive:Array;
var _vStore:Array;
var _v:Vertex;
var _face:Face;
public function AbstractPrimitive(_arg1:Object=null){
_vStore = new Array();
_vActive = new Array();
_uvStore = new Array();
_uvActive = new Array();
_faceStore = new Array();
_faceActive = new Array();
super(_arg1);
}
override public function get sceneTransform():Matrix3D{
if (_primitiveDirty){
buildPrimitive();
};
return (super.sceneTransform);
}
function createVertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):Vertex{
if (_vStore.length){
_vActive.push((_v = _vStore.pop()));
_v.x = _arg1;
_v.y = _arg2;
_v.z = _arg3;
} else {
_vActive.push((_v = new Vertex(_arg1, _arg2, _arg3)));
};
return (_v);
}
public function buildPrimitive():void{
_primitiveDirty = false;
for each (_face in faces) {
removeFace(_face);
};
_vStore = _vStore.concat(_vActive);
_vActive = new Array();
_uvStore = _uvStore.concat(_uvActive);
_uvActive = new Array();
_faceStore = _faceStore.concat(_faceActive);
_faceActive = new Array();
}
function createUV(_arg1:Number=0, _arg2:Number=0):UV{
if (_uvStore.length){
_uvActive.push((_uv = _uvStore.pop()));
_uv.u = _arg1;
_uv.v = _arg2;
} else {
_uvActive.push((_uv = new UV(_arg1, _arg2)));
};
return (_uv);
}
function createFace(_arg1:Vertex, _arg2:Vertex, _arg3:Vertex, _arg4:ITriangleMaterial=null, _arg5:UV=null, _arg6:UV=null, _arg7:UV=null):Face{
if (_faceStore.length){
_faceActive.push((_face = _faceStore.pop()));
_face.v0 = _arg1;
_face.v1 = _arg2;
_face.v2 = _arg3;
_face.material = _arg4;
_face.uv0 = _arg5;
_face.uv1 = _arg6;
_face.uv2 = _arg7;
} else {
_faceActive.push((_face = new Face(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7)));
};
return (_face);
}
}
}//package away3d.primitives
Section 106
//AbstractWirePrimitive (away3d.primitives.AbstractWirePrimitive)
package away3d.primitives {
import away3d.core.math.*;
import away3d.core.base.*;
import away3d.materials.*;
public class AbstractWirePrimitive extends WireMesh {
var _segment:Segment;
var _vStore:Array;
var _segmentStore:Array;
var _primitiveDirty:Boolean;
var _v:Vertex;
var _segmentActive:Array;
var _vActive:Array;
public function AbstractWirePrimitive(_arg1:Object=null){
_vStore = new Array();
_vActive = new Array();
_segmentStore = new Array();
_segmentActive = new Array();
super(_arg1);
}
function createVertex(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0):Vertex{
if (_vStore.length){
_vActive.push((_v = _vStore.pop()));
_v.x = _arg1;
_v.y = _arg2;
_v.z = _arg3;
} else {
_vActive.push((_v = new Vertex(_arg1, _arg2, _arg3)));
};
return (_v);
}
override public function get sceneTransform():Matrix3D{
if (_primitiveDirty){
buildPrimitive();
};
return (super.sceneTransform);
}
public function buildPrimitive():void{
_primitiveDirty = false;
for each (_segment in segments) {
removeSegment(_segment);
};
_vStore = _vStore.concat(_vActive);
_vActive = new Array();
_segmentStore = _segmentStore.concat(_segmentActive);
_segmentActive = new Array();
}
function createSegment(_arg1:Vertex, _arg2:Vertex, _arg3:ISegmentMaterial=null):Segment{
if (_segmentStore.length){
_segmentActive.push((_segment = _segmentStore.pop()));
_segment.v0 = _arg1;
_segment.v1 = _arg2;
_segment.material = _arg3;
} else {
_segmentActive.push((_segment = new Segment(_arg1, _arg2, _arg3)));
};
return (_segment);
}
}
}//package away3d.primitives
Section 107
//LineSegment (away3d.primitives.LineSegment)
package away3d.primitives {
import away3d.core.base.*;
public class LineSegment extends WireMesh {
private var _segment:Segment;
public function LineSegment(_arg1:Object=null){
super(_arg1);
var _local2:Number = (ini.getNumber("edge", 100, {min:0}) / 2);
_segment = new Segment(new Vertex(-(_local2), 0, 0), new Vertex(_local2, 0, 0));
addSegment(_segment);
type = "LineSegment";
url = "primitive";
}
public function get start():Vertex{
return (_segment.v0);
}
public function set start(_arg1:Vertex):void{
_segment.v0 = _arg1;
}
public function set end(_arg1:Vertex):void{
_segment.v1 = _arg1;
}
public function get end():Vertex{
return (_segment.v1);
}
}
}//package away3d.primitives
Section 108
//Plane (away3d.primitives.Plane)
package away3d.primitives {
import away3d.core.base.*;
import away3d.materials.*;
public class Plane extends AbstractPrimitive {
private var _height:Number;
private var _width:Number;
private var grid:Array;
private var _segmentsH:int;
private var _yUp:Boolean;
private var _segmentsW:int;
public function Plane(_arg1:Object=null){
var _local3:IUVMaterial;
super(_arg1);
_width = ini.getNumber("width", 0, {min:0});
_height = ini.getNumber("height", 0, {min:0});
var _local2:int = ini.getInt("segments", 1, {min:1});
_segmentsW = ini.getInt("segmentsW", _local2, {min:1});
_segmentsH = ini.getInt("segmentsH", _local2, {min:1});
_yUp = ini.getBoolean("yUp", true);
if ((width * height) == 0){
if ((material is IUVMaterial)){
_local3 = (material as IUVMaterial);
if (width == 0){
width = _local3.width;
};
if (height == 0){
height = _local3.height;
};
} else {
width = 100;
height = 100;
};
};
buildPlane(_width, _height, _segmentsW, _segmentsH, _yUp);
type = "Plane";
url = "primitive";
}
public function set segmentsH(_arg1:Number):void{
if (_segmentsH == _arg1){
return;
};
_segmentsH = _arg1;
_primitiveDirty = true;
}
public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
_height = _arg1;
_primitiveDirty = true;
}
override public function buildPrimitive():void{
super.buildPrimitive();
buildPlane(_width, _height, _segmentsW, _segmentsH, _yUp);
}
public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
_width = _arg1;
_primitiveDirty = true;
}
private function buildPlane(_arg1:Number, _arg2:Number, _arg3:int, _arg4:int, _arg5:Boolean):void{
var _local6:int;
var _local7:int;
var _local8:Vertex;
var _local9:Vertex;
var _local10:Vertex;
var _local11:Vertex;
var _local12:UV;
var _local13:UV;
var _local14:UV;
var _local15:UV;
grid = new Array((_arg3 + 1));
_local6 = 0;
while (_local6 <= _arg3) {
grid[_local6] = new Array((_arg4 + 1));
_local7 = 0;
while (_local7 <= _arg4) {
if (_arg5){
grid[_local6][_local7] = createVertex((((_local6 / _arg3) - 0.5) * _arg1), 0, (((_local7 / _arg4) - 0.5) * _arg2));
} else {
grid[_local6][_local7] = createVertex((((_local6 / _arg3) - 0.5) * _arg1), (((_local7 / _arg4) - 0.5) * _arg2), 0);
};
_local7++;
};
_local6++;
};
_local6 = 0;
while (_local6 < _arg3) {
_local7 = 0;
while (_local7 < _arg4) {
_local8 = grid[_local6][_local7];
_local9 = grid[(_local6 + 1)][_local7];
_local10 = grid[_local6][(_local7 + 1)];
_local11 = grid[(_local6 + 1)][(_local7 + 1)];
_local12 = createUV((_local6 / _arg3), (_local7 / _arg4));
_local13 = createUV(((_local6 + 1) / _arg3), (_local7 / _arg4));
_local14 = createUV((_local6 / _arg3), ((_local7 + 1) / _arg4));
_local15 = createUV(((_local6 + 1) / _arg3), ((_local7 + 1) / _arg4));
addFace(createFace(_local8, _local9, _local10, null, _local12, _local13, _local14));
addFace(createFace(_local11, _local10, _local9, null, _local15, _local14, _local13));
_local7++;
};
_local6++;
};
}
public function get width():Number{
return (_width);
}
public function vertex(_arg1:int, _arg2:int):Vertex{
return (grid[_arg2][_arg1]);
}
public function get height():Number{
return (_height);
}
public function get segmentsH():Number{
return (_segmentsH);
}
public function set segmentsW(_arg1:Number):void{
if (_segmentsW == _arg1){
return;
};
_segmentsW = _arg1;
_primitiveDirty = true;
}
public function set yUp(_arg1:Boolean):void{
if (_yUp == _arg1){
return;
};
_yUp = _arg1;
_primitiveDirty = true;
}
public function get yUp():Boolean{
return (_yUp);
}
public function get segmentsW():Number{
return (_segmentsW);
}
}
}//package away3d.primitives
Section 109
//Skybox6 (away3d.primitives.Skybox6)
package away3d.primitives {
import away3d.core.base.*;
import away3d.materials.*;
public class Skybox6 extends Mesh {
public function Skybox6(_arg1:ITriangleMaterial){
var _local39:IUVMaterial;
super({material:_arg1});
var _local2:Number = (1 / 600);
var _local3:Number = (1 / 400);
if ((_arg1 is IUVMaterial)){
_local39 = (_arg1 as IUVMaterial);
_local2 = (1 / _local39.width);
_local3 = (1 / _local39.height);
};
var _local4:Number = 800000;
var _local5:Number = 800000;
var _local6:Number = 800000;
var _local7:Vertex = new Vertex((-(_local4) / 2), (-(_local5) / 2), (-(_local6) / 2));
var _local8:Vertex = new Vertex((-(_local4) / 2), (-(_local5) / 2), (_local6 / 2));
var _local9:Vertex = new Vertex((-(_local4) / 2), (_local5 / 2), (-(_local6) / 2));
var _local10:Vertex = new Vertex((-(_local4) / 2), (_local5 / 2), (_local6 / 2));
var _local11:Vertex = new Vertex((_local4 / 2), (-(_local5) / 2), (-(_local6) / 2));
var _local12:Vertex = new Vertex((_local4 / 2), (-(_local5) / 2), (_local6 / 2));
var _local13:Vertex = new Vertex((_local4 / 2), (_local5 / 2), (-(_local6) / 2));
var _local14:Vertex = new Vertex((_local4 / 2), (_local5 / 2), (_local6 / 2));
var _local15:UV = new UV((0 / 3), ((1 / 2) + _local3));
var _local16:UV = new UV((1 / 3), ((1 / 2) + _local3));
var _local17:UV = new UV((1 / 3), (2 / 2));
var _local18:UV = new UV((0 / 3), (2 / 2));
var _local19:UV = new UV((1 / 3), ((1 / 2) + _local3));
var _local20:UV = new UV((2 / 3), ((1 / 2) + _local3));
var _local21:UV = new UV((2 / 3), (2 / 2));
var _local22:UV = new UV((1 / 3), (2 / 2));
var _local23:UV = new UV((2 / 3), ((1 / 2) + _local3));
var _local24:UV = new UV((3 / 3), ((1 / 2) + _local3));
var _local25:UV = new UV((3 / 3), (2 / 2));
var _local26:UV = new UV((2 / 3), (2 / 2));
var _local27:UV = new UV((0 / 3), (0 / 2));
var _local28:UV = new UV(((1 / 3) - _local2), (0 / 2));
var _local29:UV = new UV(((1 / 3) - _local2), ((1 / 2) - _local3));
var _local30:UV = new UV((0 / 3), ((1 / 2) - 0.001));
var _local31:UV = new UV(((1 / 3) + _local2), (0 / 2));
var _local32:UV = new UV(((2 / 3) - _local2), (0 / 2));
var _local33:UV = new UV(((2 / 3) - _local2), ((1 / 2) - _local3));
var _local34:UV = new UV(((1 / 3) + _local2), ((1 / 2) - _local3));
var _local35:UV = new UV(((2 / 3) + _local2), (0 / 2));
var _local36:UV = new UV((3 / 3), (0 / 2));
var _local37:UV = new UV((3 / 3), ((1 / 2) - _local3));
var _local38:UV = new UV(((2 / 3) + _local2), ((1 / 2) - _local3));
addFace(new Face(_local10, _local8, _local12, null, _local18, _local15, _local16));
addFace(new Face(_local10, _local12, _local14, null, _local18, _local16, _local17));
addFace(new Face(_local11, _local13, _local12, null, _local20, _local21, _local19));
addFace(new Face(_local13, _local14, _local12, null, _local21, _local22, _local19));
addFace(new Face(_local7, _local9, _local11, null, _local24, _local25, _local23));
addFace(new Face(_local11, _local9, _local13, null, _local23, _local25, _local26));
addFace(new Face(_local7, _local8, _local9, null, _local27, _local28, _local30));
addFace(new Face(_local9, _local8, _local10, null, _local30, _local28, _local29));
addFace(new Face(_local9, _local10, _local13, null, _local32, _local33, _local31));
addFace(new Face(_local10, _local14, _local13, null, _local33, _local34, _local31));
addFace(new Face(_local7, _local11, _local8, null, _local35, _local36, _local38));
addFace(new Face(_local8, _local11, _local12, null, _local38, _local36, _local37));
quarterFaces();
quarterFaces();
mouseEnabled = false;
type = "Skybox6";
url = "primitive";
}
}
}//package away3d.primitives
Section 110
//Sphere (away3d.primitives.Sphere)
package away3d.primitives {
import away3d.core.base.*;
public class Sphere extends AbstractPrimitive {
private var grid:Array;
private var _segmentsH:int;
private var _radius:Number;
private var _yUp:Boolean;
private var _segmentsW:int;
public function Sphere(_arg1:Object=null){
super(_arg1);
_radius = ini.getNumber("radius", 100, {min:0});
_segmentsW = ini.getInt("segmentsW", 8, {min:3});
_segmentsH = ini.getInt("segmentsH", 6, {min:2});
_yUp = ini.getBoolean("yUp", true);
buildSphere(_radius, _segmentsW, _segmentsH, _yUp);
type = "Sphere";
url = "primitive";
}
override public function buildPrimitive():void{
super.buildPrimitive();
buildSphere(_radius, _segmentsW, _segmentsH, _yUp);
}
public function set radius(_arg1:Number):void{
if (_radius == _arg1){
return;
};
_radius = _arg1;
_primitiveDirty = true;
}
public function get segmentsH():Number{
return (_segmentsH);
}
public function vertex(_arg1:int, _arg2:int):Vertex{
return (grid[_arg2][_arg1]);
}
public function set segmentsW(_arg1:Number):void{
if (_segmentsW == _arg1){
return;
};
_segmentsW = _arg1;
_primitiveDirty = true;
}
public function set yUp(_arg1:Boolean):void{
if (_yUp == _arg1){
return;
};
_yUp = _arg1;
_primitiveDirty = true;
}
public function get radius():Number{
return (_radius);
}
public function get yUp():Boolean{
return (_yUp);
}
public function get segmentsW():Number{
return (_segmentsW);
}
private function buildSphere(_arg1:Number, _arg2:int, _arg3:int, _arg4:Boolean):void{
var _local5:int;
var _local6:int;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Vertex;
var _local16:Vertex;
var _local17:Vertex;
var _local18:Vertex;
var _local19:int;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:UV;
var _local25:UV;
var _local26:UV;
var _local27:UV;
grid = new Array((_arg3 + 1));
var _local7:Vertex = (_arg4) ? createVertex(0, -(_arg1), 0) : createVertex(0, 0, -(_arg1));
grid[0] = new Array(_arg2);
_local5 = 0;
while (_local5 < _arg2) {
grid[0][_local5] = _local7;
_local5++;
};
_local6 = 1;
while (_local6 < _arg3) {
_local9 = ((_local6 / _arg3) * Math.PI);
_local10 = (-(_arg1) * Math.cos(_local9));
_local11 = (_arg1 * Math.sin(_local9));
grid[_local6] = new Array(_arg2);
_local5 = 0;
while (_local5 < _arg2) {
_local12 = (((2 * _local5) / _arg2) * Math.PI);
_local13 = (_local11 * Math.sin(_local12));
_local14 = (_local11 * Math.cos(_local12));
if (_arg4){
grid[_local6][_local5] = createVertex(_local14, _local10, _local13);
} else {
grid[_local6][_local5] = createVertex(_local14, -(_local13), _local10);
};
_local5++;
};
_local6++;
};
var _local8:Vertex = (_arg4) ? createVertex(0, _arg1, 0) : createVertex(0, 0, _arg1);
grid[_arg3] = new Array(_arg2);
_local5 = 0;
while (_local5 < _arg2) {
grid[_arg3][_local5] = _local8;
_local5++;
};
_local6 = 1;
while (_local6 <= _arg3) {
_local5 = 0;
while (_local5 < _arg2) {
_local15 = grid[_local6][_local5];
_local16 = grid[_local6][(((_local5 - 1) + _arg2) % _arg2)];
_local17 = grid[(_local6 - 1)][(((_local5 - 1) + _arg2) % _arg2)];
_local18 = grid[(_local6 - 1)][_local5];
_local19 = _local5;
if (_local5 == 0){
_local19 = _arg2;
};
_local20 = (_local6 / _arg3);
_local21 = ((_local6 - 1) / _arg3);
_local22 = (_local19 / _arg2);
_local23 = ((_local19 - 1) / _arg2);
_local24 = createUV(_local22, _local20);
_local25 = createUV(_local23, _local20);
_local26 = createUV(_local23, _local21);
_local27 = createUV(_local22, _local21);
if (_local6 < _arg3){
addFace(createFace(_local15, _local16, _local17, null, _local24, _local25, _local26));
};
if (_local6 > 1){
addFace(createFace(_local15, _local17, _local18, null, _local24, _local26, _local27));
};
_local5++;
};
_local6++;
};
}
public function set segmentsH(_arg1:Number):void{
if (_segmentsH == _arg1){
return;
};
_segmentsH = _arg1;
_primitiveDirty = true;
}
}
}//package away3d.primitives
Section 111
//Triangle (away3d.primitives.Triangle)
package away3d.primitives {
import away3d.core.base.*;
public class Triangle extends Mesh {
private var _face:Face;
public function Triangle(_arg1:Object=null){
super(_arg1);
var _local2:Number = (ini.getNumber("edge", 100, {min:0}) / 2);
var _local3:Boolean = ini.getBoolean("yUp", true);
buildTriangle(_local2, _local3);
}
public function get a():Vertex{
return (_face.v0);
}
public function set a(_arg1:Vertex):void{
_face.v0 = _arg1;
}
public function get c():Vertex{
return (_face.v2);
}
public function set b(_arg1:Vertex):void{
_face.v1 = _arg1;
}
private function buildTriangle(_arg1:Number, _arg2:Boolean):void{
var _local3:Number = (1 / Math.sqrt(3));
if (_arg2){
_face = new Face(new Vertex(0, 0, ((2 * _local3) * _arg1)), new Vertex(_arg1, 0, (-(_local3) * _arg1)), new Vertex(-(_arg1), 0, (-(_local3) * _arg1)), null, new UV(0, 0), new UV(1, 0), new UV(0, 1));
} else {
_face = new Face(new Vertex(0, ((2 * _local3) * _arg1), 0), new Vertex(_arg1, (-(_local3) * _arg1), 0), new Vertex(-(_arg1), (-(_local3) * _arg1), 0), null, new UV(0, 0), new UV(1, 0), new UV(0, 1));
};
addFace(_face);
type = "Triangle";
url = "primitive";
}
public function get b():Vertex{
return (_face.v1);
}
public function set c(_arg1:Vertex):void{
_face.v2 = _arg1;
}
}
}//package away3d.primitives
Section 112
//WireCube (away3d.primitives.WireCube)
package away3d.primitives {
import away3d.core.base.*;
public class WireCube extends AbstractWirePrimitive {
public var v001:Vertex;
private var _depth:Number;
private var _height:Number;
private var _width:Number;
public var v010:Vertex;
public var v011:Vertex;
public var v111:Vertex;
public var v110:Vertex;
public var v000:Vertex;
public var v100:Vertex;
public var v101:Vertex;
public function WireCube(_arg1:Object=null){
super(_arg1);
_width = ini.getNumber("width", 100, {min:0});
_height = ini.getNumber("height", 100, {min:0});
_depth = ini.getNumber("depth", 100, {min:0});
buildWireCube(_width, _height, _depth);
type = "WireCube";
url = "primitive";
}
public function get depth():Number{
return (_depth);
}
public function get width():Number{
return (_width);
}
public function set width(_arg1:Number):void{
if (_width == _arg1){
return;
};
_width = _arg1;
_primitiveDirty = true;
}
public function set height(_arg1:Number):void{
if (_height == _arg1){
return;
};
_height = _arg1;
_primitiveDirty = true;
}
public function set depth(_arg1:Number):void{
if (_depth == _arg1){
return;
};
_depth = _arg1;
_primitiveDirty = true;
}
override public function buildPrimitive():void{
super.buildPrimitive();
buildWireCube(_width, _height, _depth);
}
public function get height():Number{
return (_height);
}
private function buildWireCube(_arg1:Number, _arg2:Number, _arg3:Number):void{
v000 = createVertex((-(_arg1) / 2), (-(_arg2) / 2), (-(_arg3) / 2));
v001 = createVertex((-(_arg1) / 2), (-(_arg2) / 2), (_arg3 / 2));
v010 = createVertex((-(_arg1) / 2), (_arg2 / 2), (-(_arg3) / 2));
v011 = createVertex((-(_arg1) / 2), (_arg2 / 2), (_arg3 / 2));
v100 = createVertex((_arg1 / 2), (-(_arg2) / 2), (-(_arg3) / 2));
v101 = createVertex((_arg1 / 2), (-(_arg2) / 2), (_arg3 / 2));
v110 = createVertex((_arg1 / 2), (_arg2 / 2), (-(_arg3) / 2));
v111 = createVertex((_arg1 / 2), (_arg2 / 2), (_arg3 / 2));
addSegment(createSegment(v000, v001));
addSegment(createSegment(v011, v001));
addSegment(createSegment(v011, v010));
addSegment(createSegment(v000, v010));
addSegment(createSegment(v100, v000));
addSegment(createSegment(v101, v001));
addSegment(createSegment(v111, v011));
addSegment(createSegment(v110, v010));
addSegment(createSegment(v100, v101));
addSegment(createSegment(v111, v101));
addSegment(createSegment(v111, v110));
addSegment(createSegment(v100, v110));
}
}
}//package away3d.primitives
Section 113
//MovieClipSprite (away3d.sprites.MovieClipSprite)
package away3d.sprites {
import flash.display.*;
import away3d.core.draw.*;
import away3d.core.render.*;
import away3d.core.base.*;
public class MovieClipSprite extends Object3D implements IPrimitiveProvider {
public var movieclip:DisplayObject;
public var deltaZ:Number;
public var scaling:Number;
private var _ddo:DrawDisplayObject;
private var _sc:ScreenVertex;
private var _center:Vertex;
public var rescale:Boolean;
private var _persp:Number;
public function MovieClipSprite(_arg1:DisplayObject, _arg2:Object=null){
_center = new Vertex();
_ddo = new DrawDisplayObject();
super(_arg2);
this.movieclip = _arg1;
scaling = ini.getNumber("scaling", 1);
deltaZ = ini.getNumber("deltaZ", 0);
rescale = ini.getBoolean("rescale", false);
}
override public function primitives(_arg1:IPrimitiveConsumer, _arg2:AbstractRenderSession):void{
super.primitives(_arg1, _arg2);
_sc = _center.project(projection);
_persp = (projection.zoom / (1 + (_sc.z / projection.focus)));
_sc.z = (_sc.z + deltaZ);
_sc.x = (_sc.x - (movieclip.width / 2));
_sc.y = (_sc.y - (movieclip.height / 2));
if (rescale){
movieclip.scaleX = (movieclip.scaleY = (_persp * scaling));
};
_ddo.source = this;
_ddo.screenvertex = _sc;
_ddo.displayobject = movieclip;
_ddo.session = _arg2;
_ddo.calc();
if (_sc.z != 0){
_arg1.primitive(_ddo);
};
}
}
}//package away3d.sprites
Section 114
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function concatObjects(... _args):Object{
var _local3:Object;
var _local5:String;
var _local2:Object = {};
var _local4:int;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint = _arg2.length;
var _local4:uint;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local3:String;
var _local2:uint;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package caurina.transitions
Section 115
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
var _local6:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
var _local8:Number = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 116
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var valueComplete:Number;
public var modifierFunction:Function;
public var extra:Object;
public var valueStart:Number;
public var hasModifier:Boolean;
public var arrayIndex:Number;
public var originalValueComplete:Object;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 117
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var getValue:Function;
public var preProcess:Function;
public var setValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 118
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 119
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 120
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
if (!_inited){
init();
};
var _local4:SpecialPropertyModifier = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
if (!_inited){
init();
};
var _local6:SpecialProperty = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
var _local5:Object = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local6:Number = (isNaN(_local5.time)) ? 0 : _local5.time;
var _local7:Number = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local5:uint;
var _local6:String;
var _local7:Boolean;
var _local3:TweenListObj = _tweenList[_arg1];
var _local4:TweenListObj = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
var _local3:Number = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.71");
}
public static function onEnterFrame(_arg1:Event):void{
updateTime();
updateFrame();
var _local2:Boolean;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
var isOver:Boolean;
var cTime:Number = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
var _local1:Boolean;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
var _local7:Object = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
var _local8:Number = (isNaN(_local7.time)) ? 0 : _local7.time;
var _local9:Number = (isNaN(_local7.delay)) ? 0 : _local7.delay;
var _local10:Array = new Array();
var _local11:Object = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
var _local12:Object = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local4:Boolean;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
if (!Boolean(_tweenList)){
return ([]);
};
var _local4:Array = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
if (!Boolean(_tweenList)){
return (0);
};
var _local3:Number = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removedLocally:Boolean;
var i:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
var removed:Boolean;
var tl:uint = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
if (!_inited){
init();
};
var _local4:SpecialPropertySplitter = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local4:uint;
var _local3:Array = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 121
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var hasStarted:Boolean;
public var onUpdate:Function;
public var useFrames:Boolean;
public var count:Number;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var isCaller:Boolean;
public var timePaused:Number;
public var transition:Function;
public var onCompleteParams:Array;
public var onError:Function;
public var timesCalled:Number;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local3:String;
var _local2:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local3:String;
var _local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
var _local2:Boolean;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local2:Object = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 122
//SubWeaponBullet (fbattle7.actors.SubWeaponBullet)
package fbattle7.actors {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.hittest.*;
import fbattle7.views.*;
import away3d.containers.*;
import away3d.primitives.*;
import away3d.core.math.*;
import away3d.materials.*;
import fbattle7.events.*;
public class SubWeaponBullet extends Task implements IHitableBullet {
private var _hitArea:HitArea;
private var _delay:Boolean;
private var _speed:Number3D;
private var _hitTime:int;
private var _life:int;
private var _scene3d:Scene3D;
private var _model:LineSegment;
private var _hitable:Boolean;
private var _taskEffects:Task;
private static const HIT_TIME:int = 2;
private static const RANDOM:Number = 1;
private static const BULLET_LENGTH:Number = 100;
private static const EXPLOSION_RADIUS:Number = 150;
private static const OFFSET_Y:Number = -5;
private static const DAMAGE:Number = 100;
private static const MOVE_SPEED:Number = 220;
private static const EXPLOSION_POWER:Number = 100;
private static const LIFE:int = 50;
private static const BULLET_COLOR:uint = 16363682;
private static var _vec:Vector3 = new Vector3();
private static var _mat:Matrix4 = new Matrix4();
public function SubWeaponBullet(){
super(onUpdate);
var _local1:WireColorMaterial = new WireColorMaterial(BULLET_COLOR, {alpha:0.5, width:5});
_model = new LineSegment({material:_local1});
_life = 0;
_speed = new Number3D();
_delay = false;
_hitArea = new HitArea();
_hitTime = HIT_TIME;
}
public function onUpdate(_arg1):void{
_hitTime--;
if (!_delay){
_delay = true;
return;
};
_model.x = (_model.x + _speed.x);
_model.y = (_model.y + _speed.y);
_model.z = (_model.z + _speed.z);
_hitArea.setNewPosition(_model.x, _model.y, _model.z);
if (--_life <= 0){
_scene3d.removeChild(_model);
kill();
};
}
public function getHitArea():HitArea{
return (_hitArea);
}
public function initialize(_arg1:Task, _arg2:Scene3D, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number):void{
_scene3d = _arg2;
_taskEffects = _arg1;
_model.x = _arg3;
_model.y = (_arg4 + OFFSET_Y);
_model.z = _arg5;
_mat.fromYawPitchRoll((_arg10 + (RANDOM * (Math.random() - 0.5))), (_arg9 + (RANDOM * (Math.random() - 0.5))), 0);
_vec.rotate(Vector3.Z_AXIS, _mat);
_vec.scaleSelf(MOVE_SPEED);
_speed.x = _vec.x;
_speed.y = _vec.y;
_speed.z = _vec.z;
_vec.scaleSelf((BULLET_LENGTH / MOVE_SPEED));
_model.start.x = (_model.start.y = (_model.start.z = 0));
_model.end.x = _vec.x;
_model.end.y = _vec.y;
_model.end.z = _vec.z;
_hitArea.initialize(_arg3, (_arg4 + OFFSET_Y), _arg5, EXPLOSION_RADIUS);
_hitable = true;
_scene3d.addChild(_model);
_life = LIFE;
}
public function onHitActor(_arg1:IHitableActor, _arg2:HitSphere, _arg3:HitSphere):void{
_hitable = false;
_life = 0;
_taskEffects.addTask(new SubWeaponBulletExplosion(_scene3d, _arg2.center.x, _arg2.center.y, _arg2.center.z));
EventBroadCaster.broadCastEvent(PlayerEvent.BULLET_HIT);
}
public function get hitable():Boolean{
return (((_hitable) && ((_hitTime < 0))));
}
public function get damage():Number{
return (DAMAGE);
}
public function get hitPower():Number{
return (EXPLOSION_POWER);
}
}
}//package fbattle7.actors
Section 123
//EnemyEvent (fbattle7.events.EnemyEvent)
package fbattle7.events {
public class EnemyEvent {
public static const ODS_START:String = "EnemyODSStart";
public static const SHOOT_BULLET_A:String = "EnemyShootBulletA";
public static const SHOOT_BULLET_B:String = "EnemyShootBulletB";
public static const SHOOT_MISSILE:String = "EnemyShootMissile";
public static const ODS_CHARGE:String = "EnemyODSCharge";
public static const DESTROY:String = "EnemyDestroy";
}
}//package fbattle7.events
Section 124
//PlayerEvent (fbattle7.events.PlayerEvent)
package fbattle7.events {
public class PlayerEvent {
public static const ODS_START:String = "ODSStart";
public static const DAMAGE:String = "Damage";
public static const ODS_HIT:String = "ODSHit";
public static const HIT_ON_ENEMY:String = "HitEnemy";
public static const HIT_ON_BULLET:String = "HitBullet";
public static const ODS_END:String = "PlayerODSEnd";
public static const SHOOT_WEAPON:String = "ShootWeapon";
public static const BULLET_HIT:String = "BulletHit";
public static const SHIELD_ZERO:String = "ShieldZero";
}
}//package fbattle7.events
Section 125
//HitArea (fbattle7.hittest.HitArea)
package fbattle7.hittest {
public class HitArea {
public var radius:Number;
public var ex:Number;
public var ey:Number;
public var ez:Number;
public var bx:Number;
public var by:Number;
public var bz:Number;
public var dx:Number;
public var dy:Number;
public var dz:Number;
public function hitTest(_arg1:HitArea, _arg2:HitResult):void{
var _local17:Number;
var _local3:Number = (dx - _arg1.dx);
var _local4:Number = (dy - _arg1.dy);
var _local5:Number = (dz - _arg1.dz);
var _local6:Number = (bx - _arg1.bx);
var _local7:Number = (by - _arg1.by);
var _local8:Number = (bz - _arg1.bz);
var _local9:Number = (radius + _arg1.radius);
var _local10:Number = (((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5));
var _local11:Number = (2 * (((_local3 * _local6) + (_local4 * _local7)) + (_local5 * _local8)));
var _local12:Number = ((((_local6 * _local6) + (_local7 * _local7)) + (_local8 * _local8)) - (_local9 * _local9));
var _local13:Number = ((_local11 * _local11) - ((4 * _local10) * _local12));
if (_local10 == 0){
if (_local11 == 0){
if (_local12 <= 0){
_arg2.isHit = true;
_arg2.k = 0;
return;
};
_arg2.isHit = false;
return;
} else {
_local17 = (-(_local12) / _local11);
if (_local11 > 0){
if (_local17 > 0){
_arg2.isHit = true;
_arg2.k = 0;
return;
};
_arg2.isHit = false;
return;
} else {
if (_local17 <= 1){
_arg2.isHit = true;
_arg2.k = ((0)>_local17) ? 0 : _local17;
return;
} else {
_arg2.isHit = false;
return;
};
};
};
};
if (_local13 < 0){
_arg2.isHit = false;
return;
};
var _local14:Number = Math.sqrt(_local13);
var _local15:Number = ((-(_local11) - _local14) / (2 * _local10));
var _local16:Number = ((-(_local11) + _local14) / (2 * _local10));
if ((((_local16 < 0)) || ((1 < _local15)))){
_arg2.isHit = false;
return;
};
_arg2.isHit = true;
_arg2.k = ((0)>_local15) ? 0 : _local15;
}
public function setNewPosition(_arg1:Number, _arg2:Number, _arg3:Number):void{
bx = ex;
by = ey;
bz = ez;
ex = _arg1;
ey = _arg2;
ez = _arg3;
dx = (ex - bx);
dy = (ey - by);
dz = (ez - bz);
}
public function initialize(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
bx = (ex = _arg1);
by = (ey = _arg2);
bz = (ez = _arg3);
dx = (dy = (dz = 0));
radius = _arg4;
}
}
}//package fbattle7.hittest
Section 126
//HitResult (fbattle7.hittest.HitResult)
package fbattle7.hittest {
public class HitResult {
public var isHit:Boolean;
public var k:Number;
}
}//package fbattle7.hittest
Section 127
//HitSphere (fbattle7.hittest.HitSphere)
package fbattle7.hittest {
import fbattle7.views.*;
public class HitSphere {
public var radius:Number;
public var center:Vector3;
public function HitSphere(){
center = new Vector3();
}
}
}//package fbattle7.hittest
Section 128
//IHitableActor (fbattle7.hittest.IHitableActor)
package fbattle7.hittest {
import fbattle7.views.*;
public interface IHitableActor {
function onHitActor(_arg1:IHitableActor, _arg2:Number, _arg3:HitSphere, _arg4:HitSphere):void;
function get mass():Number;
function onHitBullet(_arg1:IHitableBullet, _arg2:HitSphere, _arg3:HitSphere):void;
function getHitArea():HitArea;
function get velocity():Vector3;
function get hitable():Boolean;
function get damage():Number;
}
}//package fbattle7.hittest
Section 129
//IHitableBullet (fbattle7.hittest.IHitableBullet)
package fbattle7.hittest {
public interface IHitableBullet {
function onHitActor(_arg1:IHitableActor, _arg2:HitSphere, _arg3:HitSphere):void;
function get hitPower():Number;
function getHitArea():HitArea;
function get hitable():Boolean;
function get damage():Number;
}
}//package fbattle7.hittest
Section 130
//BulletHeli (fbattle7.models.enemies.BulletHeli)
package fbattle7.models.enemies {
import fbattle7.models.*;
import fbattle7.views.*;
public class BulletHeli extends Heli {
private var _weapon:IEnemyWeapon;
private var _burstLeft:int;
private var _waitCount:int;
private static const WAIT_TIME_SPAN:int = 30;
private static const WAIT_TIME:int = 60;
private static const _dir:Vector3 = new Vector3();
public function BulletHeli(_arg1:IEnemyWeapon, _arg2:Player, _arg3:EnemyLeader, _arg4:Number, _arg5:Number, _arg6:Number){
super(_arg2, _arg3, _arg4, _arg5, _arg6);
_weapon = _arg1;
_burstLeft = 0;
_waitCount = (WAIT_TIME + (WAIT_TIME_SPAN * Math.random()));
addTask(_weapon);
}
override protected function think():void{
if (_burstLeft != 0){
if (_weapon.reloadTime <= 0){
_dir.x = (_player.x - _p.x);
_dir.y = (_player.y - _p.y);
_dir.z = (_player.z - _p.z);
_weapon.shoot(_p, _dir);
if (--_burstLeft == 0){
_waitCount = (WAIT_TIME + (WAIT_TIME_SPAN * Math.random()));
};
};
} else {
if (--_waitCount == 0){
_burstLeft = 3;
};
};
}
}
}//package fbattle7.models.enemies
Section 131
//DeclinationShootingHeli (fbattle7.models.enemies.DeclinationShootingHeli)
package fbattle7.models.enemies {
import fbattle7.models.*;
import fbattle7.views.*;
public class DeclinationShootingHeli extends Heli {
private var _weapon:IEnemyWeapon;
private var _time:int;
private static const TIME:int = 30;
private static var _absPos:Vector3 = new Vector3();
private static var _result:Vector3 = new Vector3();
public function DeclinationShootingHeli(_arg1:IEnemyWeapon, _arg2:Player, _arg3:EnemyLeader, _arg4:Number, _arg5:Number, _arg6:Number){
super(_arg2, _arg3, _arg4, _arg5, _arg6);
_weapon = _arg1;
_time = (TIME * Math.random());
addTask(_weapon);
}
override protected function think():void{
if (_weapon.reloadTime < 0){
if (--_time < 0){
_time = (Math.random() * TIME);
_absPos.setValue(_player.x, _player.y, _player.z);
calcDeclination(_weapon.bulletSpeed, _absPos, _player.velocity, _result);
_weapon.shoot(_p, _result);
};
};
}
override protected function onDamage(_arg1:Number):void{
super.onDamage(_arg1);
}
}
}//package fbattle7.models.enemies
Section 132
//EnemyAHV (fbattle7.models.enemies.EnemyAHV)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import fbattle7.events.*;
public class EnemyAHV extends EnemyBase {
private var _player:Player;
private var _dest:Vector3;
private var _timer:int;
private var _isOverDrive:Boolean;
private var _weapon1:IEnemyWeapon;
private var _weapon2:IEnemyWeapon;
private var _moveTime:Number;
private var _prevDistanceSq:Number;
private var _cooldownInvisibleTime:int;
private var _shockWave:ShockWave;
private static const DEST_PITCH:Number = 20;
private static const ACCEL:Number = 1.1;
private static const DEST_DISTANCE_SQ:Number = 40000;
private static const OVERDRIVE_SHIELD_RATE:Number = 0.1;
private static const MOVE_TIME_SPAN:int = 30;
private static const COOLDOWN_INVISIBLE_TIME:int = 15;
private static const OVERDRIVE_ACCEL:Number = 10;
private static const DISTANCE_SCALE:Number = 1000;
private static const _mat:Matrix4 = new Matrix4();
private static const AIR_DRAG:Number = 0.05;
private static const INACCULACY:Number = 50;
private static const DEST_DISTANCE:Number = 3000;
private static const MASS:Number = 10;
private static const DEST_DISTANCE_SPAN:Number = 3000;
private static const MOVE_TIME:int = 100;
private static var _pp:Vector3 = new Vector3();
private static var _destAbs:Vector3 = new Vector3();
private static var _ar:Vector3 = new Vector3();
private static var _tmp:Vector3 = new Vector3();
private static var _n:Vector3 = new Vector3();
private static var _a:Vector3 = new Vector3();
private static var _result:Vector3 = new Vector3();
private static var _md:Vector3 = new Vector3();
public function EnemyAHV(_arg1:IEnemyWeapon, _arg2:IEnemyWeapon, _arg3:Task, _arg4:Player, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
super(_arg5, _arg6, _arg7, _arg8, _arg9);
changeTask(enterCoolDown);
_player = _arg4;
_dest = new Vector3();
_moveTime = 0;
_timer = 0;
_weapon1 = _arg1;
_weapon2 = _arg2;
_shockWave = new ShockWave(this);
_isOverDrive = false;
_cooldownInvisibleTime = -1;
addTask(_arg1);
addTask(_arg2);
_arg3.addTask(_shockWave);
updateDestination();
}
private function enterCoolDown(_arg1):void{
_timer = 90;
_cooldownInvisibleTime = COOLDOWN_INVISIBLE_TIME;
changeTask(coolDown);
}
private function execOverDrive(_arg1):void{
if (--_timer < 0){
_dest.setValue(_player.x, _player.y, _player.z);
_shockWave.hittable = true;
_timer = 10;
changeTask(overDriving);
_tmp.sub(_p, _player.position);
_prevDistanceSq = _tmp.lengthSq();
_isOverDrive = true;
EventBroadCaster.broadCastEvent(EnemyEvent.ODS_START, this);
};
updateEnemy();
}
private function coolDown(_arg1):void{
_cooldownInvisibleTime--;
if (--_timer < 0){
changeTask(enterShootWp1);
};
updateVelocity();
}
private function enterShootWp1(_arg1):void{
_timer = (300 + (150 * Math.random()));
changeTask(shootWp1);
}
private function enterShootWp2(_arg1):void{
_timer = (300 + (150 * Math.random()));
changeTask(shootWp2);
}
private function overDriving(_arg1):void{
_a.sub(_player.position, _p);
_a.normalizeSelf();
_a.scaleSelf(OVERDRIVE_ACCEL);
_v.addSelf(_a);
_ar.scale(_v, -(AIR_DRAG));
_v.addSelf(_ar);
setRotationFromVector(_v);
_tmp.sub(_p, _player.position);
var _local2:Number = _tmp.lengthSq();
if ((((_local2 > _prevDistanceSq)) && ((--_timer < 0)))){
updateDestination();
_shockWave.hittable = false;
changeTask(enterCoolDown);
_isOverDrive = false;
};
_prevDistanceSq = _local2;
updateEnemy();
}
private function enterExecOverDrive(_arg1):void{
_timer = 60;
EventBroadCaster.broadCastEvent(EnemyEvent.ODS_CHARGE, this);
changeTask(execOverDrive);
}
private function updateVelocity():void{
_destAbs.add(_dest, _pp);
_tmp.sub(_destAbs, _p);
if ((((DEST_DISTANCE_SQ > _tmp.lengthSq())) || ((--_moveTime < 0)))){
_moveTime = (MOVE_TIME + (Math.random() * MOVE_TIME_SPAN));
updateDestination();
};
_pp.setValue(_player.x, _player.y, _player.z);
_n.x = (_player.x - _p.x);
_n.y = (_player.y - _p.y);
_n.z = (_player.z - _p.z);
_n.normalizeSelf();
var _local1:Number = -(_p.dot(_n));
var _local2:Number = (_n.dot(_destAbs) + _local1);
if (_local2 > 0){
_tmp.scale(_n, -(_local2));
} else {
_tmp.scale(_n, _local2);
};
_md.add(_destAbs, _tmp);
_a.sub(_md, _p);
if (_a.isZero()){
_a.setVector3(_v);
};
var _local3:Number = (_destAbs.y - _p.y);
_a.y = _local3;
_a.normalizeSelf();
_a.scaleSelf(ACCEL);
_tmp.sub(_pp, _p);
var _local4:Number = _tmp.length();
var _local5:Number = _dest.length();
_tmp.scale(_n, (((_local4 - _local5) / DISTANCE_SCALE) * ACCEL));
_a.addSelf(_tmp);
_a.limitLength(_a, ACCEL);
_v.addSelf(_a);
_ar.scale(_v, -(AIR_DRAG));
_v.addSelf(_ar);
_tmp.sub(_player.position, _p);
setRotationFromVector(_tmp);
updateEnemy();
}
private function shootWp1(_arg1):void{
_pp.setValue(_player.x, _player.y, _player.z);
calcDeclination(_weapon1.bulletSpeed, _pp, _player.velocity, _result);
_result.x = (_result.x + ((Math.random() - 0.5) * INACCULACY));
_result.y = (_result.y + ((Math.random() - 0.5) * INACCULACY));
_result.y = (_result.y + ((Math.random() - 0.5) * INACCULACY));
_weapon1.shoot(_p, _result);
updateVelocity();
if (--_timer < 0){
changeTask(enterShootWp2);
};
}
override public function kill():void{
super.kill();
_shockWave.kill();
}
public function set odsDamage(_arg1:Number):void{
_shockWave.damage = _arg1;
}
private function updateDestination():void{
_mat.fromYawPitchRoll((Math.random() * 360), ((2 * (Math.random() - 0.5)) * DEST_PITCH), 0);
_tmp.setValue(0, 0, (DEST_DISTANCE + (Math.random() * DEST_DISTANCE_SPAN)));
_dest.rotate(_tmp, _mat);
}
private function shootWp2(_arg1):void{
_pp.setValue(_player.x, _player.y, _player.z);
calcDeclination(_weapon2.bulletSpeed, _pp, _player.velocity, _result);
_weapon2.shoot(_p, _result);
updateVelocity();
if (--_timer < 0){
changeTask(enterExecOverDrive);
};
}
override public function get mass():Number{
return (MASS);
}
override protected function onDamage(_arg1:Number):void{
super.onDamage((((_isOverDrive) || ((_cooldownInvisibleTime > 0)))) ? (_arg1 * OVERDRIVE_SHIELD_RATE) : _arg1);
}
}
}//package fbattle7.models.enemies
import net.cladv.task.*;
import fbattle7.hittest.*;
class ShockWave extends Task implements IHitableBullet {
private var _hitArea:HitArea;
private var _damage:Number;
private var _model:EnemyAHV;
private var _hitable:Boolean;
private static const RADIUS:Number = 200;
private static const HIT_POWER:Number = 150;
private static const DAMAGE:Number = 200;
private function ShockWave(_arg1:EnemyAHV){
super(onUpdate);
_model = _arg1;
_hitArea = new HitArea();
_hitable = false;
_damage = DAMAGE;
_hitArea.initialize(_model.x, _model.y, _model.z, RADIUS);
}
private function onUpdate(_arg1):void{
_hitArea.setNewPosition(_model.x, _model.y, _model.z);
}
public function getHitArea():HitArea{
return (_hitArea);
}
public function get hitable():Boolean{
return (_hitable);
}
public function get damage():Number{
return (_damage);
}
public function onHitActor(_arg1:IHitableActor, _arg2:HitSphere, _arg3:HitSphere):void{
_hitable = false;
}
public function get hitPower():Number{
return (HIT_POWER);
}
public function set hittable(_arg1:Boolean):void{
_hitable = _arg1;
}
public function set damage(_arg1:Number):void{
_damage = _arg1;
}
}
Section 133
//EnemyStraightBullet (fbattle7.models.enemies.EnemyStraightBullet)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.hittest.*;
import fbattle7.views.*;
public class EnemyStraightBullet extends Task implements IHitableBullet {
private var _hitArea:HitArea;
private var _damage:Number;
private var _hitPower:Number;
private var _dir:Vector3;
private var _life:Number;
private var _p:Vector3;
public function EnemyStraightBullet(_arg1:Vector3, _arg2:Vector3, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number){
super(onUpdate);
_p = new Vector3();
_dir = new Vector3();
_hitArea = new HitArea();
_p.setVector3(_arg1);
_dir.setVector3(_arg2);
_damage = _arg4;
_hitPower = _arg3;
_life = _arg7;
_dir.scaleSelf(_arg6);
_hitArea.initialize(_p.x, _p.y, _p.z, _arg5);
}
private function onUpdate(_arg1):void{
if (--_life < 0){
kill();
return;
};
_p.addSelf(_dir);
_hitArea.setNewPosition(_p.x, _p.y, _p.z);
}
public function getHitArea():HitArea{
return (_hitArea);
}
public function onHitActor(_arg1:IHitableActor, _arg2:HitSphere, _arg3:HitSphere):void{
kill();
}
public function get position():Vector3{
return (_p);
}
public function get damage():Number{
return (_damage);
}
public function get hitPower():Number{
return (_hitPower);
}
public function get hitable():Boolean{
return (true);
}
}
}//package fbattle7.models.enemies
Section 134
//ExplosionWeapon (fbattle7.models.enemies.ExplosionWeapon)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
import fbattle7.events.*;
import fbattle7.views.enemies.*;
public class ExplosionWeapon extends Task implements IEnemyWeapon {
private var _reloadTime:int;
private var _scene:Scene3D;
private var _damage:Number;
private var _taskEnemyBullets:Task;
private static const COLOR:uint = 0x990000;
private static const BULLET_SPEED:Number = 90;
private static const BULLET_DAMAGE:Number = 100;
private static const BULLET_RADIUS:Number = 50;
private static const RELOAD_TIME:int = 100;
private static const BULLET_LIFE:Number = 120;
private static const BULLET_HIT_POWER:Number = 60;
private static var _vec:Vector3 = new Vector3();
public function ExplosionWeapon(_arg1:Task, _arg2:Scene3D){
super(onUpdate);
_taskEnemyBullets = _arg1;
_scene = _arg2;
_damage = BULLET_DAMAGE;
}
private function onUpdate(_arg1):void{
_reloadTime--;
}
public function get reloadTime():int{
return (_reloadTime);
}
public function get BulletsLeft():int{
return (1);
}
public function get bulletSpeed():Number{
return (BULLET_SPEED);
}
public function set damage(_arg1:Number):void{
_damage = _arg1;
}
public function shoot(_arg1:Vector3, _arg2:Vector3):void{
if (_reloadTime > 0){
return;
};
_vec.normalize(_arg2);
var _local3:EnemyStraightBullet = new EnemyStraightBullet(_arg1, _vec, BULLET_HIT_POWER, _damage, BULLET_RADIUS, BULLET_SPEED, BULLET_LIFE);
_taskEnemyBullets.addTask(_local3);
new EnemyStraightBulletView(_local3, _scene, COLOR, _vec);
_reloadTime = RELOAD_TIME;
EventBroadCaster.broadCastEvent(EnemyEvent.SHOOT_BULLET_B);
}
}
}//package fbattle7.models.enemies
Section 135
//GigantBullet (fbattle7.models.enemies.GigantBullet)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.hittest.*;
import fbattle7.views.*;
public class GigantBullet extends Task implements IHitableBullet {
private var _position:Vector3;
private var _hitArea:HitArea;
private var _speed:Vector3;
private var _hitable:Boolean;
private var _life:int;
private static var RADIUS:Number = 200;
private static var SPEED:Number = 500;
private static var HIT_POWER:Number = 100;
private static var LIFE:Number = 100;
private static var DAMAGE:Number = 100;
public function GigantBullet(_arg1:Vector3, _arg2:Vector3){
super(onUpdate);
_hitable = false;
_life = LIFE;
_hitArea = new HitArea();
_speed = new Vector3();
_position = new Vector3();
_hitArea.initialize(_arg1.x, _arg1.y, _arg1.z, RADIUS);
_speed.setVector3(_arg2);
_speed.normalizeSelf();
_speed.scaleSelf(SPEED);
_position.setVector3(_arg1);
}
public function get position():Vector3{
return (_position);
}
public function getHitArea():HitArea{
return (_hitArea);
}
public function get hitable():Boolean{
return (true);
}
private function onUpdate(_arg1):void{
_position.addSelf(_speed);
_hitArea.setNewPosition(_position.x, _position.y, _position.z);
if (--_life < 0){
kill();
};
}
public function get hitPower():Number{
return (HIT_POWER);
}
public function onHitActor(_arg1:IHitableActor, _arg2:HitSphere, _arg3:HitSphere):void{
kill();
}
public function get damage():Number{
return (DAMAGE);
}
}
}//package fbattle7.models.enemies
Section 136
//GigantWeapon (fbattle7.models.enemies.GigantWeapon)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
import fbattle7.views.enemies.*;
public class GigantWeapon {
private var _player:Player;
private var _scene:Scene3D;
private var _position:Vector3;
private var _taskEnemyBullets:Task;
private static var _absP:Vector3 = new Vector3();
private static var _vec:Vector3 = new Vector3();
public function GigantWeapon(_arg1:Player, _arg2:Scene3D, _arg3:Task, _arg4:Number, _arg5:Number, _arg6:Number){
_player = _arg1;
_scene = _arg2;
_taskEnemyBullets = _arg3;
_position = new Vector3(_arg4, _arg5, _arg6);
}
public function shoot():void{
_absP.add(_player.position, _position);
_vec.sub(_player.position, _absP);
var _local1:GigantBullet = new GigantBullet(_absP, _vec);
_taskEnemyBullets.addTask(_local1);
new GigantBulletView(_local1, _scene);
}
}
}//package fbattle7.models.enemies
Section 137
//Heli (fbattle7.models.enemies.Heli)
package fbattle7.models.enemies {
import fbattle7.models.*;
import fbattle7.views.*;
public class Heli extends EnemyBase {
protected var _player:Player;
private var _leader:EnemyLeader;
private var _rp:Vector3;
private static const VIEW_SIZE_SQ:Number = 100000000;
private static const ACCEL:Number = 0.8;
private static const SEPARATION_ACCEL:Number = 0.5;
private static const SEPARATION_SIZE:Number = 300;
private static const RADIUS:Number = 20;
private static const AIR_DRAG:Number = 0.05;
private static const DAMAGE:Number = 1;
private static const IGNORE_POSITION:Number = 10;
private static const MASS:Number = 10;
private static var _vec:Vector3 = new Vector3();
private static var _vAve:Vector3 = new Vector3();
private static var _pAve:Vector3 = new Vector3();
private static var _a:Vector3 = new Vector3();
private static var _pRel:Vector3 = new Vector3();
private static var _vRel:Vector3 = new Vector3();
public function Heli(_arg1:Player, _arg2:EnemyLeader, _arg3:Number, _arg4:Number, _arg5:Number){
super((_arg3 + _arg2.x), (_arg4 + _arg2.y), (_arg5 + _arg2.z), _arg2.rotationX, _arg2.rotationY);
_rp = new Vector3();
_rp.x = _arg3;
_rp.y = _arg4;
_rp.z = _arg5;
_leader = _arg2;
_player = _arg1;
changeTask(onUpdate);
}
private function updateVelocity():void{
var _local2:EnemyBase;
var _local3:Number;
var _local4:Number;
_vAve.setValue(0, 0, 0);
_pAve.setValue(0, 0, 0);
_a.setValue(0, 0, 0);
var _local1:Number = 0;
for each (_local2 in _leader.members) {
_vec.sub(_local2.position, _p);
if (_local2 != this){
_pAve.addSelf(_local2.position);
_vAve.addSelf(_local2.velocity);
_local1++;
_pRel.sub(_p, _local2.position);
_local3 = _pRel.length();
if (_local3 < SEPARATION_SIZE){
_pRel.scaleSelf((((SEPARATION_SIZE - _local3) / SEPARATION_SIZE) * SEPARATION_ACCEL));
_a.addSelf(_pRel);
};
};
};
if (_local1 != 0){
_pAve.scaleSelf((1 / _local1));
_vAve.scaleSelf((1 / _local1));
_pRel.sub(_pAve, _p);
_local4 = _pRel.length();
if (_local4 > IGNORE_POSITION){
if ((_local4 - IGNORE_POSITION) < ACCEL){
_pRel.scaleSelf(((_local4 - IGNORE_POSITION) / _local4));
} else {
_pRel.scaleSelf((ACCEL / _local4));
};
_a.addSelf(_pRel);
};
_vRel.sub(_vAve, _v);
_vRel.limitLength(_vRel, ACCEL);
_a.addSelf(_vRel);
} else {
_pRel.sub(_leader.position, _p);
_pRel.normalizeSelf();
_a.scale(_pRel, ACCEL);
};
_a.limitLength(_a, ACCEL);
_v.addSelf(_a);
_v.x = (_v.x - (_v.x * AIR_DRAG));
_v.y = (_v.y - (_v.y * AIR_DRAG));
_v.z = (_v.z - (_v.z * AIR_DRAG));
}
private function onUpdate(_arg1):void{
updateVelocity();
think();
}
protected function think():void{
}
override public function get mass():Number{
return (MASS);
}
override public function get damage():Number{
return (DAMAGE);
}
override public function get radius():Number{
return (RADIUS);
}
}
}//package fbattle7.models.enemies
Section 138
//HeliLeader (fbattle7.models.enemies.HeliLeader)
package fbattle7.models.enemies {
import fbattle7.models.*;
import fbattle7.views.*;
public class HeliLeader extends EnemyLeader {
private var _player:Player;
private var _dest:Vector3;
private var _counter:int;
private static const ACCEL:Number = 0.5;
private static const AIR_DRAG:Number = 0.05;
private static const DEST_RADIUS:Number = 100;
private static const RADIUS_FROM_PLAYER:Number = 5000;
private static const MOVE_TIME:int = 300;
private static var _mat:Matrix4 = new Matrix4();
private static var _a:Vector3 = new Vector3();
public function HeliLeader(_arg1:Player, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
super(_arg2, _arg3, _arg4, _arg5, _arg6);
_player = _arg1;
_dest = new Vector3();
_counter = MOVE_TIME;
changeTask(onUpdate);
setNewDest();
}
private function onUpdate(_arg1):void{
_a.sub(_dest, _p);
var _local2:Number = _a.length();
if (_local2 != 0){
_a.scaleSelf((ACCEL / _local2));
};
_v.addSelf(_a);
if ((((_local2 < DEST_RADIUS)) || ((--_counter < 0)))){
_counter = MOVE_TIME;
setNewDest();
};
_v.x = (_v.x - (_v.x * AIR_DRAG));
_v.y = (_v.y - (_v.y * AIR_DRAG));
_v.z = (_v.z - (_v.z * AIR_DRAG));
updateLeader();
}
private function setNewDest():void{
_mat.fromYawPitchRoll((Math.random() * 360), ((Math.random() - 0.5) * 80), 0);
_dest.rotate(Vector3.Z_AXIS, _mat);
_dest.scaleSelf(RADIUS_FROM_PLAYER);
_dest.x = (_dest.x + _player.x);
_dest.y = (_dest.y + _player.y);
_dest.z = (_dest.z + _player.z);
}
}
}//package fbattle7.models.enemies
Section 139
//IEnemyWeapon (fbattle7.models.enemies.IEnemyWeapon)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.views.*;
public interface IEnemyWeapon extends ITask {
function get BulletsLeft():int;
function get bulletSpeed():Number;
function get reloadTime():int;
function shoot(_arg1:Vector3, _arg2:Vector3):void;
}
}//package fbattle7.models.enemies
Section 140
//PointBurstWeapon (fbattle7.models.enemies.PointBurstWeapon)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
import fbattle7.events.*;
import fbattle7.views.enemies.*;
public class PointBurstWeapon extends Task implements IEnemyWeapon {
private var _reloadTime:int;
private var _scene:Scene3D;
private var _damage:Number;
private var _taskEnemyBullets:Task;
private static const COLOR:uint = 1464835;
private static const BULLET_SPEED:Number = 150;
private static const BULLET_DAMAGE:Number = 50;
private static const BULLET_RADIUS:Number = 20;
private static const RELOAD_TIME:int = 10;
private static const BULLET_LIFE:Number = 100;
private static const BULLET_HIT_POWER:Number = 30;
private static var _vec:Vector3 = new Vector3();
public function PointBurstWeapon(_arg1:Task, _arg2:Scene3D){
super(onUpdate);
_taskEnemyBullets = _arg1;
_scene = _arg2;
_damage = BULLET_DAMAGE;
}
private function onUpdate(_arg1):void{
_reloadTime--;
}
public function get reloadTime():int{
return (_reloadTime);
}
public function get BulletsLeft():int{
return (1);
}
public function get bulletSpeed():Number{
return (BULLET_SPEED);
}
public function set damage(_arg1:Number):void{
_damage = _arg1;
}
public function shoot(_arg1:Vector3, _arg2:Vector3):void{
if (_reloadTime > 0){
return;
};
_vec.normalize(_arg2);
var _local3:EnemyStraightBullet = new EnemyStraightBullet(_arg1, _vec, BULLET_HIT_POWER, _damage, BULLET_RADIUS, BULLET_SPEED, BULLET_LIFE);
_taskEnemyBullets.addTask(_local3);
new EnemyStraightBulletView(_local3, _scene, COLOR, _vec);
_reloadTime = RELOAD_TIME;
EventBroadCaster.broadCastEvent(EnemyEvent.SHOOT_BULLET_A);
}
}
}//package fbattle7.models.enemies
Section 141
//ShieldAnchor (fbattle7.models.enemies.ShieldAnchor)
package fbattle7.models.enemies {
import fbattle7.models.*;
import fbattle7.events.*;
public class ShieldAnchor extends EnemyBase {
public function ShieldAnchor(_arg1:Number, _arg2:Number, _arg3:Number){
super(_arg1, _arg2, _arg3, 0, 0);
changeTask(onUpdate);
}
override public function get radius():Number{
return (100);
}
override public function get mass():Number{
return (10000);
}
public function onUpdate(_arg1):void{
updateEnemy();
}
override public function kill():void{
super.kill();
EventBroadCaster.broadCastEvent(EnemyEvent.DESTROY, this);
}
}
}//package fbattle7.models.enemies
Section 142
//WarPlane (fbattle7.models.enemies.WarPlane)
package fbattle7.models.enemies {
import fbattle7.models.*;
import fbattle7.views.*;
public class WarPlane extends EnemyBase {
private var _player:Player;
private var _prevRotX:Number;
private var _leader:EnemyLeader;
private var _weapon:IEnemyWeapon;
private static const MIN_ACCEL:Number = 1;
private static const MASS:Number = 10;
private static const ACCEL:Number = 2.5;
private static const MAX_ROTATION_ANGLE:Number = 20;
private static const SEPARATION_ACCEL:Number = 0.5;
private static const RADIUS:Number = 20;
private static const SEPARATION_SIZE:Number = 500;
private static const AIR_DRAG:Number = 0.05;
private static const MIN_SHOOTING_RANGE:Number = 3000;
private static const DAMAGE:Number = 1;
private static const toRAD:Number = 0.0174532925199433;
private static const MISSILE_SHOOT_ANGLE:Number = 20;
private static const IGNORE_POSITION:Number = 10;
private static var _cross:Vector3 = new Vector3();
private static var _pRelScaled:Vector3 = new Vector3();
private static var _vec:Vector3 = new Vector3();
private static var _vRel:Vector3 = new Vector3();
private static var _pAve:Vector3 = new Vector3();
private static var _vAve:Vector3 = new Vector3();
private static var _mat:Matrix4 = new Matrix4();
private static var _a:Vector3 = new Vector3();
private static var _pRel:Vector3 = new Vector3();
public function WarPlane(_arg1:IEnemyWeapon, _arg2:Player, _arg3:EnemyLeader, _arg4:Number, _arg5:Number, _arg6:Number){
super((_arg4 + _arg3.x), (_arg5 + _arg3.y), (_arg6 + _arg3.z), _arg3.rotationX, _arg3.rotationY);
_leader = _arg3;
_weapon = _arg1;
_player = _arg2;
_prevRotX = 0;
addTask(_arg1);
changeTask(onUpdate);
}
private function think():void{
var _local1:Number;
var _local2:Number;
if (_weapon.reloadTime > 0){
return;
};
_pRel.x = (_player.x - _p.x);
_pRel.y = (_player.y - _p.y);
_pRel.z = (_player.z - _p.z);
if (((!(_v.isZero())) && (!(_pRel.isZero())))){
_local1 = _pRel.length();
if (_local1 < MIN_SHOOTING_RANGE){
return;
};
_local2 = (_v.dot(_pRel) / (_v.length() * _local1));
if (_local2 > Math.cos((MISSILE_SHOOT_ANGLE * toRAD))){
_weapon.shoot(_p, _pRel);
};
};
}
private function onUpdate(_arg1):void{
updateVelocity();
think();
}
private function updateVelocity():void{
var _local2:EnemyBase;
var _local6:Number;
var _local7:Number;
_vAve.setValue(0, 0, 0);
_pAve.setValue(0, 0, 0);
_a.setValue(0, 0, 0);
var _local1:Number = 0;
for each (_local2 in _leader.members) {
_vec.sub(_local2.position, _p);
if (_local2 != this){
_pAve.addSelf(_local2.position);
_vAve.addSelf(_local2.velocity);
_local1++;
_pRel.sub(_p, _local2.position);
_local6 = _pRel.length();
if (_local6 < SEPARATION_SIZE){
_pRelScaled.scale(_pRel, ((SEPARATION_SIZE - _local6) / SEPARATION_SIZE));
_a.addSelf(_pRelScaled);
};
};
};
if (_local1 != 0){
_pAve.scaleSelf((1 / _local1));
_vAve.scaleSelf((1 / _local1));
_pRel.sub(_pAve, _p);
_local7 = _pRel.length();
if (_local7 > IGNORE_POSITION){
_a.addSelf(_pRel);
};
_vRel.sub(_vAve, _v);
_a.addSelf(_vRel);
} else {
_pRel.sub(_leader.position, _p);
_pRel.normalizeSelf();
_a.scale(_pRel, ACCEL);
};
var _local3:Number = _a.length();
var _local4:Number = _v.length();
if (_local4 == 0){
_v.setValue(0, 0, -1);
_local4 = 1;
};
if (_local3 == 0){
_a.setVector3(_v);
_local3 = _a.length();
};
var _local5:Number = (_a.dot(_v) / (_local3 * _v.length()));
if (_local5 < Math.cos(((MAX_ROTATION_ANGLE * Math.PI) / 180))){
_cross.cross(_a, _v);
_cross.normalizeSelf();
_mat.fromAxisAndRotation(_cross, MAX_ROTATION_ANGLE);
_a.rotate(_v, _mat);
_a.normalizeSelf();
if (_local5 < 0){
_a.scaleSelf(MIN_ACCEL);
} else {
_a.scaleSelf(_local3);
};
_local3 = _a.length();
};
if (_local3 > ACCEL){
_a.scaleSelf((ACCEL / _local3));
};
if (_local3 < MIN_ACCEL){
_a.scaleSelf((MIN_ACCEL / _local3));
};
_v.addSelf(_a);
_v.x = (_v.x - (_v.x * AIR_DRAG));
_v.y = (_v.y - (_v.y * AIR_DRAG));
_v.z = (_v.z - (_v.z * AIR_DRAG));
setRotationFromVector(_v);
if ((_rotationX - _prevRotX) < -2){
_rotationX = (_prevRotX - 2);
_prevRotX = _rotationX;
} else {
if ((_rotationX - _prevRotX) > 2){
_rotationX = (_prevRotX + 2);
_prevRotX = _rotationX;
} else {
_prevRotX = _rotationX;
};
};
}
}
}//package fbattle7.models.enemies
Section 143
//WarPlaneLeader (fbattle7.models.enemies.WarPlaneLeader)
package fbattle7.models.enemies {
import fbattle7.models.*;
import fbattle7.views.*;
public class WarPlaneLeader extends EnemyLeader {
private var _spinX:Number;
private var _spinY:Number;
private var _player:Player;
private static const ACCEL:Number = 2;
private static const toDEG:Number = 57.2957795130823;
private static const MAX_DISTANCE:Number = 7000;
private static const TRACK_SPEED:Number = 10;
private static const MIN_DISTANCE:Number = 2000;
private static const AIR_DRAG:Number = 0.05;
private static const SPIN_SPEED:Number = 3;
private static const MAX_SPIN_X:Number = 10;
private static var _a:Vector3 = new Vector3();
private static var _vl:Vector3 = new Vector3();
private static var _pl:Vector3 = new Vector3();
private static var _pn:Vector3 = new Vector3();
private static var _vn:Vector3 = new Vector3();
private static var _ar:Vector3 = new Vector3();
private static var _mat:Matrix4 = new Matrix4();
public function WarPlaneLeader(_arg1:Player, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
super(_arg2, _arg3, _arg4, _arg5, _arg6);
_spinX = 0;
_spinY = SPIN_SPEED;
_player = _arg1;
changeTask(approachToPlayer);
}
private function backFromPlayer(_arg1):void{
_vn.normalize(_v);
_pn.x = (_player.x - _p.x);
_pn.y = (_player.y - _p.y);
_pn.z = (_player.z - _p.z);
var _local2:Number = _pn.length();
if (_local2 != 0){
_pn.scaleSelf((1 / _local2));
};
var _local3:Number = _vn.dot(_pn);
if (_local3 > 0){
_rotationX = stepTo(_rotationX, _spinX, SPIN_SPEED);
_rotationY = (_rotationY + _spinY);
} else {
_mat.fromYawPitchRoll(-((_rotationY + 180)), 0, 0);
_pl.rotate(_pn, _mat);
if (((!((_pl.z == 0))) || (!((_pl.x == 0))))){
_rotationY = (_rotationY - (((Math.atan2(_pl.z, _pl.x) - (Math.PI / 2)) / (Math.PI / 2)) * SPIN_SPEED));
};
_rotationX = stepTo(_rotationX, 0, SPIN_SPEED);
};
if (_local2 > MAX_DISTANCE){
_spinY = ((Math.random())>0.5) ? SPIN_SPEED : -(SPIN_SPEED);
_spinX = ((2 * (Math.random() - 0.5)) * MAX_SPIN_X);
changeTask(approachToPlayer);
};
_mat.fromYawPitchRoll(_rotationY, _rotationX, 0);
_a.rotate(Vector3.Z_AXIS, _mat);
_a.scaleSelf(ACCEL);
_v.addSelf(_a);
_ar.scale(_v, -(AIR_DRAG));
_v.addSelf(_ar);
updateLeader();
}
private function approachToPlayer(_arg1):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_vn.normalize(_v);
_pn.x = (_player.x - _p.x);
_pn.y = (_player.y - _p.y);
_pn.z = (_player.z - _p.z);
var _local2:Number = _pn.length();
if (_local2 != 0){
_pn.scaleSelf((1 / _local2));
};
var _local3:Number = _vn.dot(_pn);
if (_local3 < 0){
_rotationX = stepTo(_rotationX, _spinX, SPIN_SPEED);
_rotationY = (_rotationY + _spinY);
} else {
_mat.fromYawPitchRoll(-(_rotationY), 0, 0);
_pl.rotate(_pn, _mat);
_vl.rotate(_vn, _mat);
_local4 = (Math.atan2(_pl.z, _pl.x) - (Math.PI / 2));
_local5 = (Math.atan2(_vl.z, _vl.x) - (Math.PI / 2));
_rotationY = (_rotationY - ((((2 * _local4) - _local5) / (Math.PI / 2)) * SPIN_SPEED));
_local6 = Math.atan2(_pl.y, _pl.z);
_local7 = Math.atan2(_vl.y, _vl.z);
_rotationX = (_rotationX + ((((2 * _local6) - _local7) / (Math.PI / 2)) * SPIN_SPEED));
if (_rotationX > 80){
_rotationX = 80;
};
if (_rotationX < -80){
_rotationX = -80;
};
};
if (_local2 < MIN_DISTANCE){
_spinY = ((Math.random())>0.5) ? SPIN_SPEED : -(SPIN_SPEED);
_spinX = ((2 * (Math.random() - 0.5)) * MAX_SPIN_X);
changeTask(backFromPlayer);
};
_mat.fromYawPitchRoll(_rotationY, _rotationX, 0);
_a.rotate(Vector3.Z_AXIS, _mat);
_a.scaleSelf(ACCEL);
_v.addSelf(_a);
_ar.scale(_v, -(AIR_DRAG));
_v.addSelf(_ar);
updateLeader();
}
private function stepTo(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg1 < _arg2){
if ((_arg1 + _arg3) > _arg2){
return (_arg2);
};
return ((_arg1 + _arg3));
//unresolved jump
};
if ((_arg1 - _arg3) < _arg2){
return (_arg2);
};
return ((_arg1 - _arg3));
}
}
}//package fbattle7.models.enemies
Section 144
//VSAHVMissile (fbattle7.models.enemies.VSAHVMissile)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
public class VSAHVMissile extends EnemyBase {
private var _player:Player;
private var _explosionRange:Task;
private var _accel:Number;
private var _taskBullets:Task;
private var _damage:Number;
private static const _st:Vector3 = new Vector3();
public static const AIR_DRAG:Number = 0.05;
private static const _a:Vector3 = new Vector3();
private static const _ad:Vector3 = new Vector3();
private static const _vr:Vector3 = new Vector3();
private static const _sr:Vector3 = new Vector3();
private static const _pp:Vector3 = new Vector3();
public function VSAHVMissile(_arg1:Player, _arg2:Task, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number){
super(_arg6, _arg7, _arg8, _arg9, _arg10);
_player = _arg1;
_taskBullets = _arg2;
_damage = _arg3;
this.shield = _arg4;
_accel = _arg5;
_explosionRange = new ExplosionRange(this, _arg1, _arg3);
_arg2.addTask(_explosionRange);
changeTask(onUpdate);
}
private function onUpdate(_arg1):void{
_pp.x = _player.x;
_pp.y = _player.y;
_pp.z = _player.z;
_vr.sub(_player.velocity, _v);
_sr.sub(_pp, _p);
var _local2:Number = 0;
if (((!((_vr.lengthSq() == 0))) && ((_vr.dot(_sr) < 0)))){
_local2 = (_sr.length() / _vr.length());
_st.scale(_player.velocity, _local2);
_st.addSelf(_pp);
} else {
_st.setVector3(_pp);
};
_a.sub(_st, _p);
_a.normalizeSelf();
_a.scaleSelf(_accel);
_v.addSelf(_a);
_ad.scale(_v, -(AIR_DRAG));
_v.addSelf(_ad);
setRotationFromVector(_v);
updateEnemy();
}
public function onHit():void{
kill();
}
override public function get damage():Number{
return (1);
}
override public function get radius():Number{
return (10);
}
override public function get mass():Number{
return (10);
}
override protected function onDamage(_arg1:Number):void{
_shield = (_shield - _arg1);
if (_shield <= 0){
_explosionRange.kill();
kill();
};
}
}
}//package fbattle7.models.enemies
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.hittest.*;
class ExplosionRange extends Task implements IHitableBullet {
private var _player:Player;
private var _hitArea:HitArea;
private var _damage:Number;
private var _model:VSAHVMissile;
private static const HIT_POWER:Number = 100;
private static const EXPLOSION_SIZE:Number = 100;
private function ExplosionRange(_arg1:VSAHVMissile, _arg2:Player, _arg3:Number){
super(onUpdate);
_model = _arg1;
_player = _arg2;
_damage = _arg3;
_hitArea = new HitArea();
_hitArea.initialize(_arg1.x, _arg1.y, _arg1.z, EXPLOSION_SIZE);
}
private function onUpdate(_arg1):void{
_hitArea.setNewPosition(_model.x, _model.y, _model.z);
}
public function getHitArea():HitArea{
return (_hitArea);
}
public function get hitable():Boolean{
return (true);
}
public function get damage():Number{
return (_damage);
}
public function onHitActor(_arg1:IHitableActor, _arg2:HitSphere, _arg3:HitSphere):void{
_model.onHit();
kill();
}
public function get hitPower():Number{
return (HIT_POWER);
}
}
Section 145
//VSAHVMissileWeapon (fbattle7.models.enemies.VSAHVMissileWeapon)
package fbattle7.models.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
import fbattle7.events.*;
import fbattle7.views.enemies.*;
public class VSAHVMissileWeapon extends Task implements IEnemyWeapon {
private var _player:Player;
private var _taskEnemies:Task;
private var _reloadTime:Number;
private var _scene:Scene3D;
private var _damage:Number;
private var _taskBullets:Task;
private static const RELOAD_TIME:int = 300;
private static const ACCEL:Number = 1.5;
private static const SHIELD:Number = 100;
private static const toDEG:Number = 57.2957795130823;
private static const DAMAGE:Number = 100;
public function VSAHVMissileWeapon(_arg1:Task, _arg2:Task, _arg3:Scene3D, _arg4:Player){
_taskEnemies = _arg1;
_taskBullets = _arg2;
_reloadTime = RELOAD_TIME;
_scene = _arg3;
_player = _arg4;
_damage = DAMAGE;
super(onUpdate);
}
private function onUpdate(_arg1):void{
_reloadTime--;
}
public function get reloadTime():int{
return (_reloadTime);
}
public function get BulletsLeft():int{
return (1);
}
public function get bulletSpeed():Number{
return ((ACCEL / VSAHVMissile.AIR_DRAG));
}
public function set damage(_arg1:Number):void{
_damage = _arg1;
}
public function shoot(_arg1:Vector3, _arg2:Vector3):void{
if (_reloadTime > 0){
return;
};
var _local3:Number = (-(Math.atan2(_arg2.y, Math.abs(_arg2.z))) * toDEG);
var _local4:Number = -(((Math.atan2(_arg2.z, _arg2.x) * toDEG) - 90));
var _local5:VSAHVMissile = new VSAHVMissile(_player, _taskBullets, _damage, SHIELD, ACCEL, _arg1.x, _arg1.y, _arg1.z, _local3, _local4);
new VSAHVMissileView(_local5, _scene);
_taskEnemies.addTask(_local5);
_reloadTime = RELOAD_TIME;
EventBroadCaster.broadCastEvent(EnemyEvent.SHOOT_MISSILE);
}
}
}//package fbattle7.models.enemies
Section 146
//EnemyBase (fbattle7.models.EnemyBase)
package fbattle7.models {
import fbattle7.hittest.*;
import fbattle7.views.*;
import fbattle7.views.hud.*;
import net.cladv.tasks.*;
import fbattle7.events.*;
public class EnemyBase extends EventDispatcherTask implements IHitableActor, IRadarTracable {
protected var _p:Vector3;
protected var _hitArea:HitArea;
protected var _shield:Number;
protected var _hitCount:int;
protected var _rotationY:Number;
protected var _vNow:Vector3;
protected var _rotationX:Number;
protected var _v:Vector3;
protected static const toDEG:Number = 57.2957795130823;
protected static const INVISIBLE_COUNT:int = 6;
private static var _vec:Vector3 = new Vector3();
public function EnemyBase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
_p = new Vector3();
_v = new Vector3();
_vNow = new Vector3();
_hitArea = new HitArea();
_hitCount = 0;
_p.x = _arg1;
_p.y = _arg2;
_p.z = _arg3;
_rotationX = _arg4;
_rotationY = _arg5;
_shield = 0;
_hitArea.initialize(_p.x, _p.y, _p.z, radius);
}
protected function onDamage(_arg1:Number):void{
_shield = (_shield - _arg1);
if (_shield < 0){
EventBroadCaster.broadCastEvent(EnemyEvent.DESTROY, this);
kill();
};
}
public function getHitArea():HitArea{
return (_hitArea);
}
public function get radius():Number{
return (20);
}
public function set shield(_arg1:Number):void{
_shield = _arg1;
}
public function get rotationY():Number{
return (_rotationY);
}
public function onHitBullet(_arg1:IHitableBullet, _arg2:HitSphere, _arg3:HitSphere):void{
_vec.sub(_arg2.center, _arg3.center);
_vec.normalizeSelf();
_vec.scaleSelf((_arg1.hitPower / mass));
_v.addSelf(_vec);
_hitCount = INVISIBLE_COUNT;
onDamage(_arg1.damage);
}
public function get rotationX():Number{
return (_rotationX);
}
public function get velocity():Vector3{
return (_vNow);
}
public function onHitActor(_arg1:IHitableActor, _arg2:Number, _arg3:HitSphere, _arg4:HitSphere):void{
var _local5:Number = (mass / (mass + _arg1.mass));
_vec.sub(_arg3.center, _arg4.center);
_vec.scaleSelf(_local5);
_p.addSelf(_vec);
if (!_vec.normalizeSelf()){
_vec.setVector3(Vector3.Z_AXIS);
};
_vec.scaleSelf(((2 * _arg2) * (1 - _local5)));
_v.addSelf(_vec);
_hitCount = INVISIBLE_COUNT;
onDamage((_arg2 * _arg1.damage));
}
public function get shield():Number{
return (_shield);
}
protected function setRotationFromVector(_arg1:Vector3):void{
_rotationX = (Math.atan2(_arg1.y, Math.abs(_arg1.z)) * toDEG);
_rotationY = -(((Math.atan2(_arg1.z, _arg1.x) * toDEG) - 90));
}
public function get damage():Number{
return (1);
}
public function get position():Vector3{
return (_p);
}
protected function calcDeclination(_arg1:Number, _arg2:Vector3, _arg3:Vector3, _arg4:Vector3):void{
var _local5:Vector3 = _vec;
_local5.sub(_arg2, _p);
var _local6:Number = ((((_arg3.x * _arg3.x) + (_arg3.y * _arg3.y)) + (_arg3.z * _arg3.z)) - (_arg1 * _arg1));
var _local7:Number = (2 * (((_arg3.x * _local5.x) + (_arg3.y * _local5.y)) + (_arg3.z * _local5.z)));
var _local8:Number = (((_local5.x * _local5.x) + (_local5.y * _local5.y)) + (_local5.z * _local5.z));
var _local9:Number = ((_local7 * _local7) - ((4 * _local6) * _local8));
if ((((_local9 < 0)) || ((_local6 == 0)))){
_arg4.setVector3(_local5);
return;
};
var _local10:Number = Math.sqrt(_local9);
var _local11:Number = ((-(_local7) - _local10) / (2 * _local6));
var _local12:Number = ((-(_local7) + _local10) / (2 * _local6));
var _local13:Number = 0;
if (_local11 < 0){
_local13 = _local12;
} else {
_local13 = _local11;
};
_arg4.x = (_local5.x + (_local13 * _arg3.x));
_arg4.y = (_local5.y + (_local13 * _arg3.y));
_arg4.z = (_local5.z + (_local13 * _arg3.z));
}
public function get hitable():Boolean{
return ((_hitCount < 0));
}
public function get x():Number{
return (_p.x);
}
public function get y():Number{
return (_p.y);
}
public function get z():Number{
return (_p.z);
}
public function get mass():Number{
return (10);
}
public function updateEnemy():void{
_hitCount--;
_vNow.setVector3(_v);
_p.addSelf(_vNow);
_hitArea.setNewPosition(_p.x, _p.y, _p.z);
if (_rotationX > 360){
_rotationX = (_rotationX - 360);
};
if (_rotationX < -360){
_rotationX = (_rotationX + 360);
};
if (_rotationY > 360){
_rotationY = (_rotationY - 360);
};
if (_rotationY < -360){
_rotationY = (_rotationY + 360);
};
}
}
}//package fbattle7.models
Section 147
//EnemyLeader (fbattle7.models.EnemyLeader)
package fbattle7.models {
public class EnemyLeader extends EnemyBase {
protected var _members:Array;
public function EnemyLeader(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
_members = new Array();
_members.push(this);
}
override public function get radius():Number{
return (1);
}
public function addMember(_arg1:EnemyBase):void{
_members.push(_arg1);
}
override public function get mass():Number{
return (1);
}
override protected function onDamage(_arg1:Number):void{
}
public function updateLeader():void{
var _local4:EnemyBase;
var _local1:int;
var _local2:int = _members.length;
var _local3:int;
while (_local3 < _local2) {
_members[_local3].updateEnemy();
if (!_members[_local3].exist){
_local4 = _members[_local3];
_members[_local3] = _members[_local1];
_members[_local1] = _local4;
_local1++;
};
_local3++;
};
_members.splice(0, _local1);
if (_members.length == 1){
kill();
};
}
override public function get damage():Number{
return (1);
}
public function get members():Array{
return (_members);
}
override public function get hitable():Boolean{
return (false);
}
}
}//package fbattle7.models
Section 148
//EventBroadCaster (fbattle7.models.EventBroadCaster)
package fbattle7.models {
import net.cladv.tasks.*;
public class EventBroadCaster {
private static var _dispatcher:EventDispatcherTask = new EventDispatcherTask();
public static function clearEventListener():void{
_dispatcher = new EventDispatcherTask();
}
public static function broadCastEvent(_arg1:String, _arg2=null):void{
_dispatcher.dispatchEvent(_arg1, _arg2);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
}
}//package fbattle7.models
Section 149
//GameInfo (fbattle7.models.GameInfo)
package fbattle7.models {
import net.cladv.task.*;
import fbattle7.scenes.*;
import flash.display.*;
import net.cladv.tasks.*;
public class GameInfo {
public var sceneManager:SceneManager;
public var stabilizer:RateStabilizer;
public var switcher:SceneSwitcher;
public var root:Sprite;
}
}//package fbattle7.models
Section 150
//HitTest (fbattle7.models.HitTest)
package fbattle7.models {
import net.cladv.task.*;
import fbattle7.hittest.*;
import fbattle7.views.*;
public class HitTest extends Task {
private var _player:Player;
private var _enemies:Task;
private var _enemyBullets:Task;
private var _playerBullets:Task;
private var _sphereA:HitSphere;
private var _sphereB:HitSphere;
private var _result:HitResult;
private static var _vec:Vector3 = new Vector3();
public function HitTest(_arg1:Player, _arg2:Task, _arg3:Task, _arg4:Task){
super(onUpdate);
_player = _arg1;
_playerBullets = _arg2;
_enemies = _arg3;
_enemyBullets = _arg4;
_sphereA = new HitSphere();
_sphereB = new HitSphere();
_result = new HitResult();
}
private function hitTestPlayerVSEnemies():void{
var _local2:IHitableActor;
var _local3:HitArea;
var _local4:Number;
if (_enemies.children == null){
return;
};
var _local1:HitArea = _player.getHitArea();
if (!_player.hitable){
return;
};
for each (_local2 in _enemies.children) {
_local3 = _local2.getHitArea();
if (!_local2.hitable){
} else {
_local1.hitTest(_local3, _result);
if (_result.isHit){
calcHitSphere(_local1, _sphereA);
calcHitSphere(_local3, _sphereB);
_local4 = calcPower(_player.velocity, _local2.velocity);
_player.onHitActor(_local2, _local4, _sphereA, _sphereB);
_local2.onHitActor(_player, _local4, _sphereB, _sphereA);
};
};
};
}
private function calcHitSphere(_arg1:HitArea, _arg2:HitSphere):void{
var _local3:Number;
_local3 = _result.k;
_arg2.center.x = (_arg1.bx + (_local3 * _arg1.dx));
_arg2.center.y = (_arg1.by + (_local3 * _arg1.dy));
_arg2.center.z = (_arg1.bz + (_local3 * _arg1.dz));
_arg2.radius = _arg1.radius;
}
private function calcPower(_arg1:Vector3, _arg2:Vector3):Number{
_vec.sub(_arg1, _arg2);
return (_vec.length());
}
public function onUpdate(_arg1):void{
hitTestPlayerVSEnemies();
hitTestPlayerVSEnemyBullets();
hitTestEnemyVSPlayerBullets();
}
private function hitTestPlayerVSEnemyBullets():void{
var _local2:IHitableBullet;
var _local3:HitArea;
if (_enemyBullets.children == null){
return;
};
var _local1:HitArea = _player.getHitArea();
if (!_player.hitable){
return;
};
for each (_local2 in _enemyBullets.children) {
if (!_local2.hitable){
} else {
_local3 = _local2.getHitArea();
_local1.hitTest(_local3, _result);
if (_result.isHit){
calcHitSphere(_local1, _sphereA);
calcHitSphere(_local3, _sphereB);
_local2.onHitActor(_player, _sphereB, _sphereA);
_player.onHitBullet(_local2, _sphereA, _sphereB);
};
};
};
}
private function hitTestEnemyVSPlayerBullets():void{
var _local1:IHitableActor;
var _local2:HitArea;
var _local3:IHitableBullet;
var _local4:HitArea;
if (_enemies.children == null){
return;
};
if (_playerBullets.children == null){
return;
};
for each (_local1 in _enemies.children) {
_local2 = _local1.getHitArea();
if (!_local1.hitable){
} else {
for each (_local3 in _playerBullets.children) {
_local4 = _local3.getHitArea();
if (!_local3.hitable){
} else {
_local2.hitTest(_local4, _result);
if (_result.isHit){
calcHitSphere(_local4, _sphereA);
calcHitSphere(_local2, _sphereB);
_local3.onHitActor(_local1, _sphereA, _sphereB);
_local1.onHitBullet(_local3, _sphereB, _sphereA);
};
};
};
};
};
}
}
}//package fbattle7.models
Section 151
//Player (fbattle7.models.Player)
package fbattle7.models {
import flash.events.*;
import net.cladv.task.*;
import fbattle7.hittest.*;
import fbattle7.views.*;
import net.cladv.tasks.*;
import fbattle7.events.*;
public class Player extends EventDispatcherTask implements IHitableActor {
private var _stageHeight:Number;
private var _stageWidth:Number;
private var _y:Number;
private var _z:Number;
private var _space:Boolean;
private var _rotationX:Number;
private var _rotationY:Number;
private var _rotationZ:Number;
private var _inputMode:Boolean;
private var _shockWave:PlayerShockWave;
private var _velocity:Vector3;
private var _isOverDrive:Boolean;
private var _shieldZero:Boolean;
private var _vx:Number;
private var _vy:Number;
private var _vz:Number;
private var _mouseX:Number;
private var _mouseY:Number;
private var _hitArea:HitArea;
private var _shield:Number;
private var _position:Vector3;
private var _mouseButton:Boolean;
private var _energy:Number;
private var _D:Boolean;
private var _A:Boolean;
private var _S:Boolean;
private var _W:Boolean;
private var _x:Number;
private var _subWeapon:SubWeapon;
private static const HEIGHT_LIMIT:Number = -2000;
public static const toDEG:Number = 57.2957795130823;
private static const OVERDRIVE_INITIAL_COST:Number = 100;
private static const CONTROL_CIRCLE:Number = 220;
private static const PLAYER_MASS:Number = 10;
private static const PLAYER_SIZE:Number = 10;
private static const ENERGY_REGEN:Number = 1;
private static const OVERDRIVER_SHIELD_RATE:Number = 0.1;
private static const ROTATION_SPEED:Number = 5;
private static const ROTATIONX_LIMIT:Number = 10;
private static const HIT_DAMAGE:Number = 10;
private static const MOUSE_PLAY:Number = 10;
private static const KEY_A:uint = 65;
private static const ROTATION_ACCEL:Number = 0.5;
private static const ROTATION_AIR_DRAG:Number = 0.1;
public static const MAX_SHIELD:Number = 1000;
private static const KEY_S:uint = 83;
private static const OVERDRIVE_COST:Number = 4;
private static const MOVE_AIR_DRAG:Number = 0.025;
private static const MOVE_ACCEL:Number = 0.5;
private static const KEY_D:uint = 68;
private static const KEY_W:uint = 87;
private static const OVERDRIVE_ACCEL:Number = 4;
private static const OVERDRIVE_MASS_RATE:Number = 10;
public static const MAX_ENERGY:Number = 1000;
private static const KEY_SPACE:uint = 32;
private static var _mat:Matrix4 = new Matrix4();
public static var _shieldCoeff:Number = 1;
private static var _vec:Vector3 = new Vector3();
private static var _vec2:Vector3 = new Vector3();
public function Player(_arg1:IEventDispatcher, _arg2:SubWeapon, _arg3:Task, _arg4:Number, _arg5:Number){
_velocity = new Vector3();
_position = new Vector3();
super(initialUpdate);
_x = 0;
_y = 0;
_z = 0;
_vx = 0;
_vy = 0;
_vz = 0;
_rotationX = 0;
_rotationY = 0;
_rotationZ = 0;
_mouseX = (_arg4 / 2);
_mouseY = (_arg5 / 2);
_stageWidth = _arg4;
_stageHeight = _arg5;
_subWeapon = _arg2;
_energy = MAX_ENERGY;
_shield = MAX_SHIELD;
_hitArea = new HitArea();
_shockWave = new PlayerShockWave(this);
_inputMode = false;
_shieldZero = false;
_hitArea.initialize(0, 0, 0, (PLAYER_SIZE / 2));
addTask(_arg2);
_arg3.addTask(_shockWave, true);
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
_arg1.addEventListener(KeyboardEvent.KEY_UP, onKeyUp, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
_arg1.addEventListener(MouseEvent.MOUSE_UP, onMouseUp, false, 0, true);
}
public function set z(_arg1:Number):void{
_z = _arg1;
}
private function getRotationXByKey():Number{
if (_W){
return (_rotationX);
};
if (_S){
return (-(_rotationX));
};
return (rotationX);
}
public function set inputMode(_arg1:Boolean):void{
_inputMode = _arg1;
}
private function limitRotationX(_arg1:Number):void{
if (((((_arg1 - ROTATIONX_LIMIT) < _rotationX)) && ((_rotationX <= _arg1)))){
_rotationX = (_arg1 - ROTATIONX_LIMIT);
} else {
if ((((_arg1 < _rotationX)) && ((_rotationX < (_arg1 + ROTATIONX_LIMIT))))){
_rotationX = (_arg1 + ROTATIONX_LIMIT);
};
};
}
public function onHitActor(_arg1:IHitableActor, _arg2:Number, _arg3:HitSphere, _arg4:HitSphere):void{
var _local5:Number = (mass / (mass + _arg1.mass));
_vec.sub(_arg3.center, _arg4.center);
_vec.scaleSelf((_local5 * 1.01));
_x = (_x + _vec.x);
_y = (_y + _vec.y);
_z = (_z + _vec.z);
if (!_vec.normalizeSelf()){
_vec.setVector3(Vector3.Z_AXIS);
};
_vec.scaleSelf(((2 * _arg2) * (1 - _local5)));
_vx = (_vx + _vec.x);
_vy = (_vy + _vec.y);
_vz = (_vz + _vec.z);
_mat.fromRotationX(-(_rotationX));
_vec2.rotate(_vec, _mat);
if (!_isOverDrive){
EventBroadCaster.broadCastEvent(PlayerEvent.HIT_ON_ENEMY, this);
onDamage((_arg1.damage * _arg2), ((Math.atan2(_vec2.z, _vec2.x) * toDEG) + _rotationY));
};
}
public function get position():Vector3{
_position.setValue(_x, _y, _z);
return (_position);
}
public function get isOverdrive():Boolean{
return (_isOverDrive);
}
private function initialUpdate(_arg1):void{
checkInputMode();
overdrive();
calcRotation();
calcPosition();
if (((_mouseButton) && (!(_isOverDrive)))){
_subWeapon.shoot(_x, _y, _z, _vx, _vy, _vz, _rotationX, _rotationY);
};
}
public function onDamage(_arg1:Number, _arg2:Number):void{
_shield = (_shield - (_arg1 * _shieldCoeff));
if (shield <= 0){
_shield = 0;
if (!_shieldZero){
_shieldZero = true;
EventBroadCaster.broadCastEvent(PlayerEvent.SHIELD_ZERO, this);
};
};
dispatchEvent(PlayerEvent.DAMAGE, _arg2);
}
public function set rotationX(_arg1:Number):void{
_rotationX = _arg1;
}
private function overdrive():void{
_energy = (_energy + ENERGY_REGEN);
if (_energy > MAX_ENERGY){
_energy = MAX_ENERGY;
};
if (((_space) && (!(_isOverDrive)))){
if (_energy > OVERDRIVE_INITIAL_COST){
_energy = (_energy - OVERDRIVE_INITIAL_COST);
_isOverDrive = true;
_shockWave.hittable = true;
EventBroadCaster.broadCastEvent(PlayerEvent.ODS_START, this);
} else {
_space = false;
};
};
if (_isOverDrive){
if (_space){
_energy = (_energy - OVERDRIVE_COST);
if (_energy < 0){
_energy = 0;
_isOverDrive = false;
_shockWave.hittable = false;
EventBroadCaster.broadCastEvent(PlayerEvent.ODS_END, this);
};
} else {
_isOverDrive = false;
_shockWave.hittable = false;
EventBroadCaster.broadCastEvent(PlayerEvent.ODS_END, this);
};
};
}
private function onMouseUp(_arg1:MouseEvent):void{
if (!_arg1.buttonDown){
_mouseButton = false;
};
}
public function set rotationY(_arg1:Number):void{
_rotationY = _arg1;
}
public function onHitBullet(_arg1:IHitableBullet, _arg2:HitSphere, _arg3:HitSphere):void{
_vec.sub(_arg2.center, _arg3.center);
_vec.normalizeSelf();
_vec.scaleSelf((_arg1.hitPower / PLAYER_MASS));
_vx = (_vx + _vec.x);
_vy = (_vy + _vec.y);
_vz = (_vz + _vec.z);
_mat.fromRotationX(-(_rotationX));
_vec2.rotate(_vec, _mat);
var _local4:Number = (_isOverDrive) ? (_arg1.damage * OVERDRIVER_SHIELD_RATE) : _arg1.damage;
EventBroadCaster.broadCastEvent(PlayerEvent.HIT_ON_BULLET, this);
onDamage(_local4, ((Math.atan2(_vec2.z, _vec2.x) * toDEG) + _rotationY));
}
private function checkInputMode():void{
if (!_inputMode){
_W = (_A = (_S = (_D = (_space = (_mouseButton = false)))));
_mouseX = (_stageWidth / 2);
_mouseY = (_stageHeight / 2);
};
}
public function get shield():Number{
return (_shield);
}
public function get hitable():Boolean{
return (true);
}
public function get damage():Number{
return (HIT_DAMAGE);
}
public function get y():Number{
return (_y);
}
public function get z():Number{
return (_z);
}
public function get x():Number{
return (_x);
}
public function getHitArea():HitArea{
return (_hitArea);
}
public function get energy():Number{
return (_energy);
}
public function get rotationY():Number{
return (_rotationY);
}
public function get rotationZ():Number{
return (_rotationZ);
}
private function calcPosition():void{
if (_isOverDrive){
_mat.fromYawPitchRoll(_rotationY, _rotationX, _rotationZ);
_vec.rotate(Vector3.Z_AXIS, _mat);
if (_y < HEIGHT_LIMIT){
_vec.y = 0;
};
_vec.scaleSelf(OVERDRIVE_ACCEL);
_vx = (_vx + _vec.x);
_vy = (_vy + _vec.y);
_vz = (_vz + _vec.z);
} else {
if (((((((_W) || (_S))) || (_A))) || (_D))){
_mat.fromRotationX_RotY_Y(_rotationX, (getRotationYByKey() - _rotationY), _rotationY);
_vec.rotate(Vector3.Z_AXIS, _mat);
if (_y < HEIGHT_LIMIT){
_vec.y = 0;
};
_vec.scaleSelf(MOVE_ACCEL);
_vx = (_vx + _vec.x);
_vy = (_vy + _vec.y);
_vz = (_vz + _vec.z);
};
};
_vx = (_vx - (_vx * MOVE_AIR_DRAG));
_vy = (_vy - (_vy * MOVE_AIR_DRAG));
_vz = (_vz - (_vz * MOVE_AIR_DRAG));
_x = (_x + _vx);
_y = (_y + _vy);
_z = (_z + _vz);
if (_y < HEIGHT_LIMIT){
_y = HEIGHT_LIMIT;
};
_hitArea.setNewPosition(_x, _y, _z);
}
public function get rotationX():Number{
return (_rotationX);
}
private function getRotationYByKey():Number{
if (((_A) && (_W))){
return ((_rotationY - 45));
};
if (((_D) && (_W))){
return ((_rotationY + 45));
};
if (((_A) && (_S))){
return (((_rotationY + 45) + 180));
};
if (((_D) && (_S))){
return (((_rotationY - 45) + 180));
};
if (_W){
return (_rotationY);
};
if (_S){
return ((_rotationY + 180));
};
if (_A){
return ((_rotationY - 90));
};
if (_D){
return ((_rotationY + 90));
};
return (_rotationY);
}
private function normalizeRotation(_arg1:Number):Number{
if (_arg1 > 360){
_arg1 = (_arg1 - 360);
};
if (_arg1 < 0){
_arg1 = (_arg1 + 360);
};
return (_arg1);
}
private function onKeyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case KEY_W:
_W = false;
break;
case KEY_A:
_A = false;
break;
case KEY_S:
_S = false;
break;
case KEY_D:
_D = false;
break;
case KEY_SPACE:
_space = false;
};
}
private function onMouseDown(_arg1:MouseEvent):void{
if (_arg1.buttonDown){
_mouseButton = true;
};
}
private function onKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case KEY_W:
_W = true;
break;
case KEY_A:
_A = true;
break;
case KEY_S:
_S = true;
break;
case KEY_D:
_D = true;
break;
case KEY_SPACE:
_space = true;
};
}
public function get velocity():Vector3{
_velocity.setValue(_vx, _vy, _vz);
return (_velocity);
}
public function set x(_arg1:Number):void{
_x = _arg1;
}
public function set y(_arg1:Number):void{
_y = _arg1;
}
private function calcRotation():void{
var _local1:Number = (_mouseX - (_stageWidth / 2));
var _local2:Number = (_mouseY - (_stageHeight / 2));
var _local3:Number = Math.sqrt(((_local1 * _local1) + (_local2 * _local2)));
if (_local3 != 0){
_local1 = (_local1 / _local3);
_local2 = (_local2 / _local3);
};
if (_local3 < MOUSE_PLAY){
_local1 = 0;
_local2 = 0;
};
if (_local3 < CONTROL_CIRCLE){
_local1 = (_local1 * ((_local3 - MOUSE_PLAY) / (CONTROL_CIRCLE - MOUSE_PLAY)));
_local2 = (_local2 * ((_local3 - MOUSE_PLAY) / (CONTROL_CIRCLE - MOUSE_PLAY)));
};
_rotationX = (_rotationX + (ROTATION_SPEED * ((0)<_local2) ? (-(_local2) * _local2) : (_local2 * _local2)));
_rotationY = (_rotationY + (ROTATION_SPEED * ((0)<_local1) ? (_local1 * _local1) : (-(_local1) * _local1)));
limitRotationX(90);
limitRotationX(270);
_rotationX = normalizeRotation(_rotationX);
_rotationY = normalizeRotation(_rotationY);
}
public function get mass():Number{
return ((isOverdrive) ? (PLAYER_MASS * OVERDRIVE_MASS_RATE) : PLAYER_MASS);
}
private function onMouseMove(_arg1:MouseEvent):void{
_mouseX = _arg1.stageX;
_mouseY = _arg1.stageY;
}
}
}//package fbattle7.models
Section 152
//PlayerShockWave (fbattle7.models.PlayerShockWave)
package fbattle7.models {
import net.cladv.task.*;
import fbattle7.hittest.*;
import fbattle7.events.*;
public class PlayerShockWave extends Task implements IHitableBullet {
private var _hitArea:HitArea;
private var _hitable:Boolean;
private var _model:Player;
private static const RADIUS:Number = 200;
private static const HIT_POWER:Number = 250;
private static const DAMAGE:Number = 1000;
public function PlayerShockWave(_arg1:Player){
super(onUpdate);
_model = _arg1;
_hitArea = new HitArea();
_hitable = false;
_hitArea.initialize(_arg1.x, _arg1.y, _arg1.z, RADIUS);
}
public function onHitActor(_arg1:IHitableActor, _arg2:HitSphere, _arg3:HitSphere):void{
EventBroadCaster.broadCastEvent(PlayerEvent.ODS_HIT);
}
public function get hitable():Boolean{
return (_hitable);
}
private function onUpdate(_arg1):void{
_hitArea.setNewPosition(_model.x, _model.y, _model.z);
}
public function getHitArea():HitArea{
return (_hitArea);
}
public function get hitPower():Number{
return (HIT_POWER);
}
public function get damage():Number{
return (DAMAGE);
}
public function set hittable(_arg1:Boolean):void{
_hitable = _arg1;
}
}
}//package fbattle7.models
Section 153
//SubWeapon (fbattle7.models.SubWeapon)
package fbattle7.models {
import net.cladv.task.*;
import away3d.containers.*;
import fbattle7.events.*;
import fbattle7.actors.*;
public class SubWeapon extends Task {
private var _scene3d:Scene3D;
private var _taskSubWeaponBullet:Task;
private var _reloadTime:int;
private var _taskEffects:Task;
private static const RELOAD_TIME:int = 10;
public function SubWeapon(_arg1:Task, _arg2:Task, _arg3:Scene3D){
super(onUpdate);
_taskSubWeaponBullet = _arg1;
_taskEffects = _arg2;
_scene3d = _arg3;
_reloadTime = 0;
}
private function onUpdate(_arg1):void{
_reloadTime--;
}
public function shoot(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local9:SubWeaponBullet;
if (_reloadTime <= 0){
_reloadTime = RELOAD_TIME;
_local9 = new SubWeaponBullet();
_local9.initialize(_taskEffects, _scene3d, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
_taskSubWeaponBullet.addTask(_local9);
EventBroadCaster.broadCastEvent(PlayerEvent.SHOOT_WEAPON);
};
}
}
}//package fbattle7.models
Section 154
//ITransitionScene (fbattle7.scenes.ITransitionScene)
package fbattle7.scenes {
public interface ITransitionScene {
function onBeginFadeOut():void;
function onBeginFadeIn():void;
function onEndFadeIn():void;
function onEndFadeOut():void;
}
}//package fbattle7.scenes
Section 155
//SceneEpilogue (fbattle7.scenes.SceneEpilogue)
package fbattle7.scenes {
import flash.events.*;
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import fbattle7.views.*;
import fbattle7.views.hud.*;
import flash.ui.*;
public class SceneEpilogue extends Task implements ITransitionScene {
private var _commSystem:CommunicationSystem;
private var _click:Boolean;
private var _ctrl:Boolean;
private var _state:String;
private var _gameInfo:GameInfo;
private var _hudContainer:Sprite;
private var _messages:Array;
private var _backGroundBitmap:Bitmap;
public function SceneEpilogue(_arg1:GameInfo){
_messages = [["105.mp3", "リヒト、どうした、応答してくれ!"], ["106.mp3", "ふぅ、個人通信機は生きてたか。お前のAHVの反応が消えたときは肝を冷やしたぞ。"], ["107.mp3", "AHVは……そうか、自爆したか……"], ["108.mp3", "ライティの判断は正解だな。"], ["109.mp3", "実はな、この戦いが終わった後、制御システムの分析を行う予定があったんだ。"], ["110.mp3", "お前たちの異常なほど高い戦果の理由を分析したかったようだな。"], ["111.mp3", "そこから第二のプロジェクトBが始まる可能性も否定できない。"], ["112.mp3", "……リヒト、お前は新政府樹立後、軍部の高い地位が用意されてるらしい。"], ["113.mp3", "軍の開発部をコントールできるくらいには、高い地位だろうな。"], ["114.mp3", "……ライティの遺志、無駄にするなよ。"], ["115.mp3", "さて……任務成功おめでとう。やってくれると信じていたよ。"], ["116.mp3", "お、たった今情報が入った、政府は降伏するらしい。"], ["117.mp3", "ギガントという最大にして最後の切り札を失ったんだ、当然だろうな。"], ["118.mp3", "さぁ、新たな夜明けの始まりだ。これから忙しくなるぞ……!"]];
super(onUpdate);
_gameInfo = _arg1;
_backGroundBitmap = new Bitmap(ResourceLoader.load("land.jpg"));
_hudContainer = new Sprite();
_commSystem = new CommunicationSystem(_hudContainer);
_click = true;
_ctrl = false;
_state = "wait";
var _local2:Stage = _gameInfo.root.stage;
_hudContainer.x = (_local2.stageWidth / 2);
_hudContainer.y = (_local2.stageHeight / 2);
_local2.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_local2.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
_local2.addEventListener(KeyboardEvent.KEY_UP, onKeyUp, false, 0, true);
addTask(_commSystem);
suspend = true;
}
private function onKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.CONTROL){
_ctrl = true;
};
}
private function onUpdate(_arg1):void{
var _local2:Array;
switch (_state){
case "show":
if (((((_click) || (_ctrl))) && (!(_commSystem.complete)))){
_commSystem.showAll();
_click = false;
};
if (_commSystem.complete){
_state = "wait";
return;
};
break;
case "wait":
if (((_click) || (_ctrl))){
_click = false;
if (_messages.length == 0){
_state = "end";
_gameInfo.switcher.startTransition(this, new SceneGameClear(_gameInfo));
return;
};
_local2 = _messages.shift();
_commSystem.sendMessage(ResourceLoader.load("nei.png"), ResourceLoader.load(_local2[0]), "ネイ", _local2[1]);
_state = "show";
return;
};
break;
};
}
public function onBeginFadeOut():void{
}
public function onEndFadeIn():void{
ResourceLoader.load("ending.mp3").play(0, 1000);
suspend = false;
}
public function onEndFadeOut():void{
var _local1:Sprite = _gameInfo.root;
_local1.removeChild(_backGroundBitmap);
_local1.removeChild(_hudContainer);
}
private function onClick(_arg1:MouseEvent):void{
_click = true;
}
public function onBeginFadeIn():void{
var _local1:Sprite = _gameInfo.root;
_local1.addChildAt(_hudContainer, 0);
_local1.addChildAt(_backGroundBitmap, 0);
}
private function onKeyUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.CONTROL){
_ctrl = true;
};
}
}
}//package fbattle7.scenes
Section 156
//SceneGameClear (fbattle7.scenes.SceneGameClear)
package fbattle7.scenes {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import fbattle7.views.*;
public class SceneGameClear extends Task implements ITransitionScene {
private var _endBitmap:Bitmap;
private var _gameInfo:GameInfo;
public function SceneGameClear(_arg1:GameInfo){
_gameInfo = _arg1;
_endBitmap = new Bitmap(ResourceLoader.load("end.png"));
}
public function onEndFadeIn():void{
}
public function onBeginFadeOut():void{
}
public function onEndFadeOut():void{
}
public function onBeginFadeIn():void{
_gameInfo.root.addChildAt(_endBitmap, 0);
}
}
}//package fbattle7.scenes
Section 157
//SceneGameOver (fbattle7.scenes.SceneGameOver)
package fbattle7.scenes {
import flash.events.*;
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import flash.geom.*;
import fbattle7.views.*;
public class SceneGameOver extends Task implements ITransitionScene {
private var _continueScene:Class;
private var _gameoverBitmap:Bitmap;
private var _gameInfo:GameInfo;
private static const NO_RECT:Rectangle = new Rectangle(270, 350, 100, 34);
private static const YES_RECT:Rectangle = new Rectangle(265, 300, 110, 34);
public function SceneGameOver(_arg1:GameInfo, _arg2:Class){
_gameInfo = _arg1;
_continueScene = _arg2;
}
public function onEndFadeIn():void{
_gameInfo.root.stage.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
public function onBeginFadeOut():void{
}
private function onClick(_arg1:MouseEvent):void{
if (YES_RECT.contains(_arg1.stageX, _arg1.stageY)){
_gameInfo.switcher.startTransition(this, new _continueScene(_gameInfo));
} else {
if (NO_RECT.contains(_arg1.stageX, _arg1.stageY)){
_gameInfo.switcher.startTransition(this, new SceneTitle(_gameInfo));
} else {
return;
};
};
_gameInfo.root.stage.removeEventListener(MouseEvent.CLICK, onClick);
}
public function onBeginFadeIn():void{
_gameoverBitmap = new Bitmap(ResourceLoader.load("gameover.png"));
_gameInfo.root.addChild(_gameoverBitmap);
}
public function onEndFadeOut():void{
_gameInfo.root.removeChild(_gameoverBitmap);
}
}
}//package fbattle7.scenes
Section 158
//SceneStage1 (fbattle7.scenes.SceneStage1)
package fbattle7.scenes {
import fbattle7.models.*;
import fbattle7.views.*;
public class SceneStage1 extends StageBase {
public function SceneStage1(_arg1:GameInfo){
super(_arg1);
}
private function phaseEnd():void{
talk("031.mp3", "nei.png", "……どういうことだ?そちらの敵機の反応が0になったが……");
talk("032.mp3", "laity.png", "当然です、全部撃墜しましたから。");
talk("033.mp3", "nei.png", "なんだと?あの部隊とたった一機で!?どんな魔法を使ったんだ!?");
talk("034.mp3", "laity.png", "私がついているのですから、当然の成果です。");
talk("035.mp3", "nei.png", "ふむ、にわかに信じられないが、現に敵機はいない……やってくれたな、リヒト!");
talk("036.mp3", "laity.png", "私からも賛辞を。すばらしい操縦でした。とても初めての実戦とは思えない戦いぶりです。");
cond = function ():void{
jumpScene(new SceneStage2(_gameInfo));
};
}
private function phasePreEnd():void{
setTimer(3);
cond = function ():void{
if (timer){
phaseEnd();
};
};
}
override protected function setUp():void{
super.setUp();
addTask(new SkyboxView(ResourceLoader.load("skybox.jpg"), _camera, _scene));
addTask(new CloudView(_camera, _scene));
_player.inputMode = true;
cond = function ():void{
opening();
};
}
private function phasePre():void{
setTimer(3);
cond = function ():void{
if (timer){
phase1();
};
};
}
private function phase1():void{
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", -200, -200, 0).member("Heli", 200, -200, 0);
info("025.mp3", "laity.png", "敵機確認、HV1AとHV4Vです。");
info("026.mp3", "laity.png", "赤色のエネルギーレイには注意してください!");
cond = function ():void{
if (numEnemies == 0){
phase3();
};
};
}
private function phase2():void{
boids("Heli", -6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0);
boids("Heli", 6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0);
cond = function ():void{
if (numEnemies == 0){
phase3();
};
};
}
private function phase3():void{
boids("Heli", -6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0);
boids("Heli", 6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0);
boids("Heli", 0, 500, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0);
cond = function ():void{
if (numEnemies == 0){
phase4();
};
};
}
private function phase4():void{
boids("WarPlane", 0, 0, 9000).member("WarPlane", 0, 300, 0).member("WarPlane", -200, -200, 0).member("WarPlane", 200, -200, 0);
info("027.mp3", "laity.png", "敵機確認、F-78です。");
info("028.mp3", "laity.png", "高機動ミサイルを搭載しています。撃墜するか、ODSで防御してください!");
cond = function ():void{
if (numEnemies == 0){
phase6();
};
};
}
private function phase5():void{
boids("WarPlane", -6000, 500, 6000).member("WarPlane", 0, 0, 0).member("WarPlane", 0, 300, 0);
boids("WarPlane", 6000, 500, 6000).member("WarPlane", 0, 0, 0).member("WarPlane", 0, 300, 0);
cond = function ():void{
if (numEnemies == 0){
phase6();
};
};
}
private function phase6():void{
boids("WarPlane", -6000, 500, 6000).member("WarPlane", 0, 0, 0).member("WarPlane", 0, 300, 0);
boids("WarPlane", 6000, 500, 6000).member("WarPlane", 0, 0, 0).member("WarPlane", 0, 300, 0);
boids("Heli", 0, 500, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0);
cond = function ():void{
if (numEnemies == 0){
phase7();
};
};
}
private function phase7():void{
boids("Heli", -9000, 0, 0).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", -200, -200, 0);
boids("Heli", 9000, 0, 0).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", -200, -200, 0);
cond = function ():void{
if (numEnemies == 0){
phase8();
};
};
}
private function phase8():void{
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", -200, -200, 0);
boids("WarPlane", -9000, 0, 0).member("WarPlane", 0, 0, 0);
boids("WarPlane", 9000, 0, 0).member("WarPlane", 0, 0, 0);
cond = function ():void{
if (numEnemies == 0){
phase9();
};
};
}
private function phase9():void{
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", -200, -200, 0).member("Heli", 200, -200, 0);
boids("WarPlane", -6000, 0, 6000).member("WarPlane", 0, 0, 0).member("WarPlane", 0, 400, 0);
boids("WarPlane", 6000, 0, 6000).member("WarPlane", 0, 0, 0).member("WarPlane", 0, 400, 0);
info("029.mp3", "敵部隊長", "ばかな、我が部隊が壊滅だと…!?なんなんだ、そのAHVは!?");
info("030.mp3", "laity.png", "最後の一団になります。もう一息です!");
cond = function ():void{
if ((((numEnemies == 0)) && ((numEnemyBullets == 0)))){
phasePreEnd();
};
};
}
private function opening():void{
bgm("stage1.mp3");
talk("001.mp3", "nei.png", "聞こえてるか、リヒト?こちらオペレーターのネイだ。");
talk("002.mp3", "nei.png", "……よし、通信状態は良好だな。何分急造の機体で、ろくなテストも行ってない。");
talk("003.mp3", "nei.png", "特にAHV制御システム、政府軍からの横流し品でな、怪しいことこの上ないのだが……");
talk("004.mp3", "laity.png", "失敬な!誰が怪しいんですか!");
talk("005.mp3", "nei.png", "うわ?なんだ?通信障害か!?");
talk("006.mp3", "laity.png", "違います!制御システムのインターフェイスです!");
talk("007.mp3", "nei.png", "AI型のインターフェイスか、政府軍も無駄なことをする。");
talk("008.mp3", "laity.png", "従来の制御システムとパラダイムが違うんです。おいおいわかると思います。");
talk("009.mp3", "laity.png", "……さて、リヒト、でしたっけ?AHV制御システムのライティです。よろしくお願いします。");
talk("010.mp3", "nei.png", "もういいか?作戦をもう一度説明するぞ。");
talk("011.mp3", "nei.png", "現在、我がレジスタンスの本拠地は政府軍の激しい攻撃下にある。");
talk("012.mp3", "nei.png", "現在のところレジスタンスが優勢だが、ここにきて政府軍の援軍の情報が入った。");
talk("013.mp3", "nei.png", "この援軍が予定通りに到達したら、力関係が変わる。はっきりいえば、我らは負ける。");
talk("014.mp3", "nei.png", "そこでだ、リヒト、お前には敵援軍のかく乱を行ってほしい。");
talk("015.mp3", "nei.png", "敵援軍の到達を遅らせるだけでいい。だが、可能ならば敵の数も減らしてくれ。");
talk("016.mp3", "nei.png", "シミュレーション訓練を終えてすぐの配備だ、お前も戸惑っているだろう。");
talk("017.mp3", "nei.png", "だが、お前の成績を見る限り、決して不可能ではない。");
talk("018.mp3", "nei.png", "お前はもう貴重なAHVパイロットの一人だ、期待してるぞ。");
talk("019.mp3", "nei.png", "以上だ、健闘を祈る。");
talk("020.mp3", "laity.png", "……通信、終わりました?");
talk("021.mp3", "laity.png", "敵部隊のかく乱、可能ならば数を減らせ、ですか。部隊の数は?……そうですか。");
talk("022.mp3", "laity.png", "……ずいぶんと私は過小評価されてますね。");
talk("023.mp3", "laity.png", "性能の違い、見せてあげましょう。もちろん、リヒト、あなたの腕にもかかってます。");
talk("024.mp3", "laity.png", "期待してますよ。いきましょう!");
cond = function ():void{
phasePre();
};
}
}
}//package fbattle7.scenes
Section 159
//SceneStage2 (fbattle7.scenes.SceneStage2)
package fbattle7.scenes {
import fbattle7.models.*;
import flash.display.*;
import fbattle7.views.*;
public class SceneStage2 extends StageBase {
public function SceneStage2(_arg1:GameInfo){
super(_arg1);
}
private function phase3():void{
boids("Heli", -6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("ExpHeli", 0, 300, 0);
boids("Heli", 6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("ExpHeli", 0, 300, 0);
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", 0, -300, 0).member("Heli", 0, 600, 0);
cond = function ():void{
if (numEnemies == 0){
phase4();
};
};
}
private function phaseEnd():void{
talk("045.mp3", "nei.png", "辛勝だな、リヒト。あのAHVは一体……");
talk("046.mp3", "laity.png", "……プロジェクトBの成果です。");
talk("047.mp3", "nei.png", "プロジェクトB?");
talk("048.mp3", "laity.png", "高性能AHVを開発するための政府軍が行っていたプロジェクトです。");
talk("049.mp3", "laity.png", "機体は完成したのですが、制御システムがネックになって、性能を発揮しきれませんでした。");
talk("050.mp3", "laity.png", "そこでプロジェクトが目につけたのは、生物の脳を使ったバイオコンピュータです。");
talk("051.mp3", "laity.png", "はじめは小動物の脳を使っていたのですが、最後には、人間の脳を……");
talk("052.mp3", "nei.png", "そんな研究が……");
talk("053.mp3", "laity.png", "ごめんなさい……私は、そのプロジェクトBの研究員でした。");
talk("054.mp3", "laity.png", "そんな研究に耐えられなくなって、密告しようとしたんです。");
talk("055.mp3", "laity.png", "ですが、見つかって、実験体にされてしまいました。前から、優秀な脳を欲しがってましたから。");
talk("056.mp3", "laity.png", "それが今の私です……");
talk("057.mp3", "nei.png", "……そう、なのか……");
talk("058.mp3", "laity.png", "お願いです、プロジェクトBを止めてください!");
talk("059.mp3", "nei.png", "しかし、作戦行動は、私やリヒトの一存で決められるものでは……");
talk("060.mp3", "laity.png", "いえ、目的は同じはずです。プロジェクトBが行われているのは、巨大移動要塞、ギガントです。");
talk("061.mp3", "nei.png", "なるほどな。あの要塞は政府を打倒するための最後の壁だ。いずれは戦うことになるだろう。");
talk("062.mp3", "nei.png", "それに、すでにリヒトは我がレジスタンス最大の戦力だ、ギガント攻略の際は投入されるだろうな。");
talk("063.mp3", "nei.png", "一応、こちらからも進言しておこう。だがあまり期待するなよ?");
talk("064.mp3", "laity.png", "ありがとうございます……");
cond = function ():void{
jumpScene(new SceneStage3(_gameInfo));
};
}
private function phase1():void{
boids("Heli", -6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", 0, -300, 0);
boids("Heli", 6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", 0, -300, 0);
cond = function ():void{
if (numEnemies == 0){
phase2();
};
};
}
private function phase2():void{
boids("Heli", -6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", 0, -300, 0);
boids("Heli", 6000, 500, 6000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", 0, -300, 0);
boids("WarPlane", 0, 0, 9000).member("WarPlane", 0, 500, 0).member("WarPlane", 0, -500, 0);
cond = function ():void{
if (numEnemies == 0){
phase3();
};
};
}
private function opening():void{
bgm("stage2.mp3");
talk("037.mp3", "nei.png", "めざましい成果を上げてるな、リヒト。各方面で噂になってるぞ。さて、今回の任務だが……");
talk("038.mp3", "nei.png", "敵部隊の迎撃任務だ。数はブリーフィングで伝えた通りだ。今のお前にとって困難な任務ではないだろう。");
talk("039.mp3", "nei.png", "以上だ、健闘を祈る。");
talk("040.mp3", "laity.png", "……確かに、難しい任務ではないでしょう。");
talk("041.mp3", "laity.png", "ですが、なんだか、私は胸騒ぎがします……気にしすぎでしょうか……");
cond = function ():void{
phasePre();
};
}
private function phase4():void{
boids("WarPlane", -6000, 500, 6000).member("WarPlane", 0, 0, 0).member("WarPlane", 0, 500, 0);
boids("WarPlane", 6000, 500, 6000).member("WarPlane", 0, 0, 0).member("WarPlane", 0, 500, 0);
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 300, 0).member("Heli", 0, -300, 0).member("Heli", 0, 600, 0);
cond = function ():void{
if (numEnemies == 0){
phase5();
};
};
}
private function phase5():void{
enemy("BossAHV", 0, 0, 9000);
info("041a.mp3", "敵AHV", "待ってたぜ、噂のAHVよ。");
info("042.mp3", "laity.png", "……あれは!!プロジェクトBの……!完成したの……");
info("043.mp3", "敵AHV", "お前か、ライティ。破棄されたと聞いたが、レジスタンスに流れていたか。");
info("044a.mp3", "敵AHV", "今まで散々荒らしまわってたようだが……俺はボンクラ共とはわけが違う。覚悟しろ!");
info("044.mp3", "laity.png", "……敵AHV、X-11です。ODSをまともに受けないよう注意してください!");
cond = function ():void{
if ((((numEnemies == 0)) && ((numEnemyBullets == 0)))){
phaseEnd();
};
};
}
override protected function setUp():void{
super.setUp();
var b:BitmapData = ResourceLoader.load("skybox.jpg");
b.getPixel(1, 1);
b = ResourceLoader.load("cloud.png");
b.getPixel(1, 1);
addTask(new SkyboxView(ResourceLoader.load("skybox.jpg"), _camera, _scene));
addTask(new CloudView(_camera, _scene));
_player.inputMode = true;
cond = function ():void{
opening();
};
}
private function phasePre():void{
setTimer(3);
cond = function ():void{
phase1();
};
}
}
}//package fbattle7.scenes
Section 160
//SceneStage3 (fbattle7.scenes.SceneStage3)
package fbattle7.scenes {
import fbattle7.models.*;
import fbattle7.views.*;
import fbattle7.models.enemies.*;
import fbattle7.views.enemies.*;
public class SceneStage3 extends StageBase {
private var _gigantWeapon:GigantWeapon;
private var _missileCount:int;// = 0
private var _gigantShootCount:int;// = 0
private static const MAX_ENEMY:int = 7;
public function SceneStage3(_arg1:GameInfo){
super(_arg1);
}
private function phaseGigantShoot():void{
_gigantShootCount++;
_gigantWeapon.shoot();
setTimer(5);
cond = function ():void{
if (timer){
if (_gigantShootCount <= 5){
phaseGigantShoot();
} else {
phase3_1();
};
};
};
}
private function phase1_1():void{
info("071.mp3", "laity.png", "敵機は次々現れます。撃墜するのに時間をかけすぎると、あっという間に囲まれますよ!");
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 200, 0).member("Heli", 0, -200, 0).member("Heli", 200, 0, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase1_2();
};
};
}
private function phase2_1():void{
boids("Heli", 0, 0, 9000).member("Heli", 0, 0, 0).member("Heli", 0, -200, 0).member("ExpHeli", 200, 200, 0).member("ExpHeli", -200, 200, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase2_2();
};
};
}
private function phase1_3():void{
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("ExpHeli", 0, 200, 0);
setTimer(30);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase2_1();
};
};
}
private function phase4_1():void{
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 200, 0).member("Heli", 0, -200, 0).member("Heli", 200, 0, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase4_2();
};
};
}
private function phase3_3():void{
boids("Heli", 0, 0, 9000).member("Heli", 0, 0, 0).member("ExpHeli", -200, 200, 0);
setTimer(30);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase4_1();
};
};
}
private function phase4_3():void{
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("ExpHeli", 0, 200, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phaseMissileWarning();
};
};
}
private function phase5_3():void{
boids("WarPlane", 0, 0, 9000).member("WarPlane", 0, 0, 0);
setTimer(10);
cond = function ():void{
if (((((timer) && ((numEnemies == 0)))) && ((numEnemyBullets == 0)))){
phasePreEnd();
};
};
}
private function phase1_2():void{
boids("WarPlane", 0, 0, 9000).member("WarPlane", 0, 0, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase1_3();
};
};
}
private function phase2_2():void{
boids("WarPlane", 0, 0, 9000).member("WarPlane", 0, 0, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase2_3();
};
};
}
private function phase2_3():void{
boids("WarPlane", 0, 0, 9000).member("WarPlane", 0, 0, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phaseGigantShootWarning();
};
};
}
private function phase4_2():void{
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("ExpHeli", 0, 200, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase4_3();
};
};
}
private function phase5_2():void{
boids("WarPlane", 0, 0, 9000).member("WarPlane", 0, 0, 0);
setTimer(10);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase5_3();
};
};
}
private function opening():void{
bgm("stage3.mp3");
talk("065.mp3", "nei.png", "今までよくがんばってきてくれた、リヒト、そしてライティ。");
talk("066.mp3", "nei.png", "ついに、ギガント破壊の任務だ。この任務は、最後にして最大の任務になるだろう。");
talk("067.mp3", "nei.png", "陽動により敵主力部隊をひきつけた。その隙にお前達にはギガントに接近してもらいたい。");
talk("068.mp3", "nei.png", "数は少なくなっているとはいえ、敵部隊はまだ残っている。厳しい戦いになるだろう。");
talk("069.mp3", "nei.png", "だが、お前達ならやってくれると信じている。");
talk("070.mp3", "nei.png", "以上だ。健闘を祈る。");
cond = function ():void{
phasePre();
};
}
private function phase3_1():void{
boids("WarPlane", 0, 0, 9000).member("WarPlane", 0, 0, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase3_2();
};
};
}
private function phase3_2():void{
boids("Heli", 0, 0, 9000).member("Heli", 0, 0, 0).member("Heli", 0, -200, 0).member("ExpHeli", 200, 200, 0).member("ExpHeli", -200, 200, 0);
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase3_3();
};
};
}
private function phase5_1():void{
boids("Heli", 0, 0, 9000).member("ExpHeli", 0, 0, 0).member("Heli", 0, 200, 0).member("Heli", 0, -200, 0).member("Heli", 200, 0, 0);
setTimer(10);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phase5_2();
};
};
}
override protected function setUp():void{
_gigantWeapon = new GigantWeapon(_player, _scene, _taskEnemyBullets, 0, 0, 20000);
addTask(new SkyboxView(ResourceLoader.load("skybox.jpg"), _camera, _scene));
addTask(new CloudView(_camera, _scene));
addTask(new GigantView(_player, _scene, 0, 0, 20000));
_player.inputMode = true;
cond = function ():void{
opening();
};
}
private function phaseEnd():void{
talk("074.mp3", "nei.png", "よし、今がチャンスだ、ポイントAよりギガントへ接近してくれ。");
talk("075.mp3", "laity.png", "いよいよですね……");
cond = function ():void{
jumpScene(new SceneStage4(_gameInfo));
};
}
private function phasePre():void{
setTimer(5);
cond = function ():void{
if (timer){
phase1_1();
};
};
}
private function phaseMissile():void{
_missileCount++;
enemy("Missile", 0, 0, 9000);
enemy("Missile", 6000, 0, 6000);
enemy("Missile", -6000, 0, 6000);
setTimer(8);
cond = function ():void{
if (timer){
if (_missileCount <= 5){
phaseMissile();
} else {
phase5_1();
};
};
};
}
private function phasePreEnd():void{
setTimer(5);
cond = function ():void{
if (timer){
phaseEnd();
};
};
}
private function phaseMissileWarning():void{
info("073.mp3", "laity.png", "ギガントからミサイルが一斉に発射されました!全力で防御を!");
setTimer(5);
cond = function ():void{
if (timer){
phaseMissile();
};
};
}
private function phaseGigantShootWarning():void{
info("072.mp3", "laity.png", "ギガントからの砲撃がきます!避けてください!!");
setTimer(5);
cond = function ():void{
if (((timer) && ((numEnemies < MAX_ENEMY)))){
phaseGigantShoot();
};
};
}
}
}//package fbattle7.scenes
Section 161
//SceneStage4 (fbattle7.scenes.SceneStage4)
package fbattle7.scenes {
import net.cladv.task.*;
import fbattle7.models.*;
import caurina.transitions.*;
import fbattle7.views.*;
import fbattle7.models.enemies.*;
import fbattle7.views.enemies.*;
public class SceneStage4 extends StageBase {
private var missile1:MetaseqMesh;
private var missile2:MetaseqMesh;
private var missile3:MetaseqMesh;
private var _gigantView:GigantView;
private var _anchors:Array;
private var _voice:Boolean;// = false
private static const PLAYER_AUTOMOVE_SPEED:Number = 1000;
private static const SAFE_RANGE:Number = 14000;
private static const ANCHOR_HEIGHT:Number = 3000;
private static const ANCHOR_SHIELD:Number = 7000;
private static const MISSILE_TIME:Number = 5;
private static const ENEMY_DISTANCE:Number = 7000;
private static const HV_PROB:Number = 0.8;
private static var _v:Vector3 = new Vector3();
public function SceneStage4(_arg1:GameInfo){
missile1 = new MetaseqMesh();
missile2 = new MetaseqMesh();
missile3 = new MetaseqMesh();
_anchors = new Array();
super(_arg1);
}
private function phaseWhiteOut():void{
whiteOut(3);
ResourceLoader.load("enemy_explosion.mp3").play();
cond = function ():void{
if (timer){
_scene.removeChild(missile1);
_scene.removeChild(missile2);
_scene.removeChild(missile3);
_gigantView.kill();
_gigantView = null;
phaseWhiteIn();
};
};
}
private function phaseWhiteIn():void{
whiteIn(3);
cond = function ():void{
if (timer){
phaseEndTalk();
};
};
}
override protected function onUpdate(_arg1):void{
super.onUpdate(_arg1);
var _local2:Number = ((_player.x * _player.x) + (_player.z * _player.z));
if ((((_player.y > ANCHOR_HEIGHT)) || ((_local2 > (SAFE_RANGE * SAFE_RANGE))))){
_player.onDamage(100000000, 0);
};
}
private function get numShieldAnchors():int{
var _local2:Task;
var _local1:int;
for each (_local2 in _anchors) {
if (_local2.exist){
_local1++;
};
};
return (_local1);
}
private function phaseAnchor1_2():void{
setTimer(40);
popEnemy();
cond = function ():void{
if (timer){
phaseAnchor1_2();
} else {
if (numShieldAnchors == 1){
if (!_voice){
_voice = true;
info("096.mp3", "laity.png", "シールドアンカー、残り一基です!");
};
} else {
if (numShieldAnchors == 0){
phaseClearEnemy();
};
};
};
};
}
private function phaseClearEnemy():void{
info("097.mp3", "laity.png", "やりましたね!敵機を掃討後、離脱しましょう!");
cond = function ():void{
if ((((numEnemies == 0)) && ((numEnemyBullets == 0)))){
phaseMove();
};
};
}
private function opening():void{
bgm("stage4.mp3");
talk("076.mp3", "nei.png", "ブリーフィングでも説明したが、もう一度説明するぞ。");
talk("077.mp3", "nei.png", "まず、位置取りだ。その位置、ギガントの真下は、死角になっている。");
talk("078.mp3", "nei.png", "レーダーに円が表示されてると思うが、そこから絶対に出るなよ。");
talk("079.mp3", "nei.png", "AHVの防御力をもってしても、ギガントの至近距離の砲撃には耐えられない。");
talk("080.mp3", "nei.png", "また、頭上に見える球状の物体、シールドアンカーより上方へ行くのも禁止だ。");
talk("081.mp3", "nei.png", "ギガントのシールドに触れたら、一瞬で蒸発するぞ。");
talk("082.mp3", "nei.png", "ODSでシールドアンカーを攻撃するのも控えたほうがいいだろう。");
talk("083.mp3", "nei.png", "勢いあまってギガントのシールドに突っ込む恐れがあるからな。");
talk("084.mp3", "nei.png", "さて、任務の内容だ。知っての通り、ギガントは強力な選択型外部シールドによって守られている。");
talk("085.mp3", "nei.png", "このシールドがあるうちはギガントを破壊するのは不可能だ。");
talk("086.mp3", "nei.png", "そこでお前達には、シールドの停止を行ってもらう。");
talk("087.mp3", "nei.png", "球状のシールドアンカーが頭上に見えるだろう?");
talk("088.mp3", "nei.png", "そのアンカーを3基とも破壊すれば、シールドは一時的にとまる。");
talk("089.mp3", "nei.png", "その隙に、ミサイルを叩き込む。");
talk("090.mp3", "nei.png", "言葉にすると簡単だが……敵も黙って見るわけは無い。激しい攻撃が予想される。");
talk("091.mp3", "nei.png", "だがこの任務、失敗は許されない。絶対に成功させてくれ。");
talk("092.mp3", "nei.png", "以上だ、健闘を祈る。");
cond = function ():void{
phasePre();
};
}
private function phaseAnchor0():void{
setTimer(30);
popEnemy();
cond = function ():void{
if (timer){
phaseAnchor0();
} else {
if (numShieldAnchors <= 2){
phasePopAHV();
};
};
};
}
private function phaseExplosion():void{
ResourceLoader.load("enemy_explosion.mp3").play();
jumpScene(new SceneEpilogue(_gameInfo));
}
override protected function setUp():void{
addTask(new SkyboxView(ResourceLoader.load("skybox.jpg"), _camera, _scene));
addTask(new CloudView(_camera, _scene));
_player.inputMode = true;
setUpAnchor();
_gigantView = new GigantView(_player, _scene, 0, (ANCHOR_HEIGHT + 2000), 0, true);
var mqo:MetaseqMesh = new MetaseqMesh();
var matLoader:IMetaseqMaterialLoader = new MetaseqMaterialLoader();
_hud.showRangeInRadar(SAFE_RANGE);
cond = function ():void{
opening();
};
}
private function phasePre():void{
setTimer(3);
info("093.mp3", "laity.png", "シールドアンカーの破壊に集中するのもいいですが、敵の数を減らすことも忘れないで下さい。");
cond = function ():void{
if (timer){
phaseAnchor0();
};
};
}
private function phaseMove():void{
info("098.mp3", "laity.png", "ミサイルがまもなく到着します、離脱してください!");
_player.inputMode = false;
_v.setValue(0, 0, -((SAFE_RANGE - 1000)));
_v.sub(_v, _player.position);
Tweener.addTween(_player, {time:(_v.length() / PLAYER_AUTOMOVE_SPEED), x:0, y:0, z:-((SAFE_RANGE - 1000)), rotationX:30, rotationY:0, transition:"easeInOutCubic", onComplete:function ():void{
phaseFriendMissile();
}});
cond = function ():void{
};
}
private function setUpAnchor():void{
var _local1:ShieldAnchor = new ShieldAnchor(0, ANCHOR_HEIGHT, 6000);
var _local2:ShieldAnchor = new ShieldAnchor(-6000, ANCHOR_HEIGHT, -6000);
var _local3:ShieldAnchor = new ShieldAnchor(6000, ANCHOR_HEIGHT, -6000);
_local1.shield = ANCHOR_SHIELD;
_local2.shield = ANCHOR_SHIELD;
_local3.shield = ANCHOR_SHIELD;
new ShieldAnchorView(_local1, _scene);
new ShieldAnchorView(_local2, _scene);
new ShieldAnchorView(_local3, _scene);
_taskEnemies.addTask(_local1);
_taskEnemies.addTask(_local2);
_taskEnemies.addTask(_local3);
_anchors.push(_local1, _local2, _local3);
}
private function phaseFriendMissile():void{
var matLoader:IMetaseqMaterialLoader = new MetaseqMaterialLoader();
missile1.loadFromByteArray(ResourceLoader.load("missile.mqo"), matLoader);
missile2.loadFromByteArray(ResourceLoader.load("missile.mqo"), matLoader);
missile3.loadFromByteArray(ResourceLoader.load("missile.mqo"), matLoader);
missile1.x = 0;
missile1.y = (ANCHOR_HEIGHT + 2000);
missile1.z = -(SAFE_RANGE);
missile2.x = 200;
missile2.y = (ANCHOR_HEIGHT + 2000);
missile2.z = -(SAFE_RANGE);
missile3.x = -200;
missile3.y = (ANCHOR_HEIGHT + 2000);
missile3.z = -(SAFE_RANGE);
_scene.addChild(missile1);
_scene.addChild(missile2);
_scene.addChild(missile3);
Tweener.addTween(missile1, {time:MISSILE_TIME, z:-1000, transition:"linear"});
Tweener.addTween(missile2, {time:MISSILE_TIME, z:-1000, transition:"linear"});
Tweener.addTween(missile3, {time:MISSILE_TIME, z:-1000, transition:"linear"});
setTimer(MISSILE_TIME);
cond = function ():void{
if (timer){
phaseWhiteOut();
};
};
}
private function popEnemy():void{
var _local1:Number = ((Math.random() * 2) * Math.PI);
var _local2:Number = (Math.cos(_local1) * ENEMY_DISTANCE);
var _local3:Number = (Math.sin(_local1) * ENEMY_DISTANCE);
if (Math.random() < HV_PROB){
boids("Heli", _local2, 0, _local3).member("ExpHeli", 0, 0, 0).member("Heli", 0, 200, 0).member("Heli", 0, -200, 0);
} else {
boids("WarPlane", _local2, 0, _local3).member("WarPlane", 0, 0, 0);
};
}
private function phasePopAHV():void{
setTimer(40);
enemy("AHV", 0, 0, ENEMY_DISTANCE);
enemy("AHV", 0, 0, -(ENEMY_DISTANCE));
info("094.mp3", "laity.png", "そんな……!!敵AHVを二機確認。X11-Eです!");
info("095.mp3", "laity.png", "X11より性能は落ちますが、相手は二機です。十分に注意してください!");
cond = function ():void{
if (timer){
phaseAnchor1_2();
} else {
if (numShieldAnchors == 1){
if (!_voice){
_voice = true;
info("096.mp3", "laity.png", "シールドアンカー、残り一基です!");
};
} else {
if (numShieldAnchors == 0){
phaseClearEnemy();
};
};
};
};
}
private function phaseEndTalk():void{
Tweener.addTween(_player, {time:2, rotationX:0});
talk("099.mp3", "laity.png", "終わりましたね……");
talk("hoge", "laity.png", "ですが、私には最後の仕事が残っています。");
talk("100.mp3", "laity.png", "……この機を自爆させます。");
talk("101.mp3", "laity.png", "プロジェクトBの研究結果、すべて破壊しないといけません。");
talk("102.mp3", "laity.png", "もちろん、私も含めて、です……");
talk("103.mp3", "laity.png", "私はプロジェクトBの一員だった……それは罪、そしてこれはその罰……");
talk("104.mp3", "laity.png", "リヒト、今までありがとうございました。そして、さようなら……");
talk("hoge", "システム", "-緊急脱出装置、起動します-");
cond = function ():void{
phaseExplosion();
};
}
}
}//package fbattle7.scenes
Section 162
//SceneSwitcher (fbattle7.scenes.SceneSwitcher)
package fbattle7.scenes {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import caurina.transitions.*;
public class SceneSwitcher {
private var _blackCurtain:Sprite;
private var _gameInfo:GameInfo;
private static const TRANSITION_TIME:Number = 2;
public function SceneSwitcher(_arg1:GameInfo){
_gameInfo = _arg1;
_blackCurtain = new Sprite();
var _local2:Graphics = _blackCurtain.graphics;
_local2.beginFill(0);
_local2.drawRect(0, 0, 640, 480);
}
public function startTransition(_arg1:ITransitionScene, _arg2:ITransitionScene):void{
var begin = _arg1;
var end = _arg2;
_gameInfo.root.addChild(_blackCurtain);
_blackCurtain.alpha = 0;
begin.onBeginFadeOut();
Tweener.addTween(_blackCurtain, {time:2, alpha:1, transition:"linear", onComplete:function ():void{
begin.onEndFadeOut();
_gameInfo.sceneManager.jumpScene((end as Task));
end.onBeginFadeIn();
Tweener.addTween(_blackCurtain, {time:2, alpha:0, transition:"linear", onComplete:function ():void{
end.onEndFadeIn();
_gameInfo.root.removeChild(_blackCurtain);
}});
}});
}
}
}//package fbattle7.scenes
Section 163
//SceneTitle (fbattle7.scenes.SceneTitle)
package fbattle7.scenes {
import flash.events.*;
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import flash.geom.*;
import fbattle7.views.*;
import flash.media.*;
import flash.text.*;
public class SceneTitle extends Task implements ITransitionScene {
private var _text:TextField;
private var _soundChannel:SoundChannel;
private var _title:Bitmap;
private var _gameInfo:GameInfo;
private static const VERY_EASY_TEXT:String = "本編を開始します。自機のシールド量がかなり多く設定されてます。";
private static const NORMAL_RECT:Rectangle = new Rectangle(350, 350, 250, 34);
private static const TUTORIAL_RECT:Rectangle = new Rectangle(350, 200, 250, 34);
private static const EASY_RECT:Rectangle = new Rectangle(350, 300, 250, 34);
private static const EASY_TEXT:String = "本編を開始します。自機のシールド量が多めに設定されています。";
private static const NORMAL_TEXT:String = "本編を開始します。作者が想定した難易度です。";
private static const TUTORIAL_TEXT:String = "チュートリアルを開始します。";
private static const TEXT_RECT:Rectangle = new Rectangle(350, 400, 250, 50);
private static const VERY_EASY_RECT:Rectangle = new Rectangle(350, 250, 250, 34);
public function SceneTitle(_arg1:GameInfo, _arg2:Boolean=false){
_gameInfo = _arg1;
_text = new TextField();
_title = new Bitmap(ResourceLoader.load("title.png"));
_soundChannel = ResourceLoader.load("title.mp3").play(0, 3000);
var _local3:TextFormat = new TextFormat();
_local3.color = 0xFFFFFF;
_text.selectable = false;
_text.defaultTextFormat = _local3;
_text.wordWrap = true;
_text.x = TEXT_RECT.x;
_text.y = TEXT_RECT.y;
_text.width = TEXT_RECT.width;
_text.height = TEXT_RECT.height;
if (_arg2){
onBeginFadeIn();
onEndFadeIn();
};
}
public function onBeginFadeOut():void{
_soundChannel.stop();
}
private function onClick(_arg1:MouseEvent):void{
if (TUTORIAL_RECT.contains(_arg1.stageX, _arg1.stageY)){
return;
};
if (VERY_EASY_RECT.contains(_arg1.stageX, _arg1.stageY)){
Player._shieldCoeff = (1 / 1.7);
_gameInfo.switcher.startTransition(this, new SceneStage1(_gameInfo));
} else {
if (EASY_RECT.contains(_arg1.stageX, _arg1.stageY)){
Player._shieldCoeff = (1 / 1.3);
_gameInfo.switcher.startTransition(this, new SceneStage1(_gameInfo));
} else {
if (NORMAL_RECT.contains(_arg1.stageX, _arg1.stageY)){
_gameInfo.switcher.startTransition(this, new SceneStage1(_gameInfo));
} else {
return;
};
};
};
_gameInfo.root.stage.removeEventListener(MouseEvent.CLICK, onClick);
}
public function onBeginFadeIn():void{
var _local1:Sprite = _gameInfo.root;
_local1.addChild(_title);
_local1.addChild(_text);
}
public function onEndFadeOut():void{
_gameInfo.root.removeChild(_text);
_gameInfo.root.removeChild(_title);
}
private function onMouseMove(_arg1:MouseEvent):void{
if (TUTORIAL_RECT.contains(_arg1.stageX, _arg1.stageY)){
_text.text = TUTORIAL_TEXT;
} else {
if (VERY_EASY_RECT.contains(_arg1.stageX, _arg1.stageY)){
_text.text = VERY_EASY_TEXT;
} else {
if (EASY_RECT.contains(_arg1.stageX, _arg1.stageY)){
_text.text = EASY_TEXT;
} else {
if (NORMAL_RECT.contains(_arg1.stageX, _arg1.stageY)){
_text.text = NORMAL_TEXT;
} else {
_text.text = "";
};
};
};
};
}
public function onEndFadeIn():void{
var _local1:Stage = _gameInfo.root.stage;
_local1.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove, false, 0, true);
_local1.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
}
}
}//package fbattle7.scenes
Section 164
//StageBase (fbattle7.scenes.StageBase)
package fbattle7.scenes {
import flash.events.*;
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import caurina.transitions.*;
import fbattle7.views.*;
import flash.utils.*;
import flash.media.*;
import away3d.containers.*;
import away3d.cameras.*;
import fbattle7.views.hud.*;
import fbattle7.events.*;
import flash.ui.*;
public class StageBase extends Task implements ITransitionScene {
protected var _player:Player;
private var _cond:Function;
private var _mouseClick:Boolean;
protected var _view:View3D;
private var _whiteCurtain:Sprite;
protected var _scene:Scene3D;
private var _infoState:String;
protected var _taskEnemyBullets:Task;
private var _isTalk:Boolean;
private var _bgmSound:Sound;
private var _enemyFactories:Dictionary;
protected var _taskEnemies:Task;
protected var _gameInfo:GameInfo;
private var _messages:Array;
private var _infoCounter:Number;
private var _gameoverFlag:Boolean;
protected var _hud:HUDView;
private var _soundTransform:SoundTransform;
private var _root:Sprite;
private var _timeCount:Number;
protected var _camera:Camera3D;
private var _factoryArgs:FactoryArgs;
private var _ctrl:Boolean;
private var _soundChannel:SoundChannel;
private var _explosionEffector:ExplosionEffector;
private var _se:SoundEffectView;
private var _expSoundChannel:SoundChannel;
private var _commSystem:CommunicationSystem;
protected var _taskEffects:Task;
private static const VOLUME_IN_TALK:Number = 0.4;
private static const INFO_WAIT_COUNT:Number = 150;
private static const VOLUME_NORMAL:Number = 0.7;
public function StageBase(_arg1:GameInfo){
var gameInfo = _arg1;
super(onUpdate, onDraw);
_enemyFactories = new Dictionary();
_factoryArgs = new FactoryArgs();
_messages = new Array();
_isTalk = false;
_root = gameInfo.root;
_gameInfo = gameInfo;
_cond = function ():void{
};
_se = new SoundEffectView();
_soundTransform = new SoundTransform();
_infoCounter = 0;
_infoState = "wait";
_gameoverFlag = false;
_whiteCurtain = new Sprite();
var g:Graphics = _whiteCurtain.graphics;
g.beginFill(0xFFFFFF);
g.drawRect(0, 0, 640, 480);
g.endFill();
setUpEnemies();
gameInfo.stabilizer.frameSkip = false;
setup3D();
setupScene();
setUpEnemies();
setUp();
_view.render();
gameInfo.stabilizer.frameSkip = true;
_root.stage.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
_root.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
_root.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUp, false, 0, true);
_view.visible = false;
}
private function processTalkMode():void{
if (((_ctrl) || (_mouseClick))){
_mouseClick = false;
if (!_commSystem.complete){
_commSystem.showAll();
} else {
if (!showNextMessage()){
_commSystem.closeChannel();
leaveTalkMode();
};
};
};
}
protected function setTimer(_arg1:Number):void{
_timeCount = ((_arg1 * 1000) / 30);
}
public function onEndFadeOut():void{
cleanUp();
}
protected function setUp():void{
}
private function lookupName(_arg1:String):String{
switch (_arg1){
case "laity.png":
return ("ライティ");
case "nei.png":
return ("ネイ");
};
return (_arg1);
}
private function setupScene():void{
var _local1:Stage = _gameInfo.root.stage;
var _local2:Task = new Task();
var _local3:Task = new Task();
var _local4:Task = new Task();
var _local5:Task = new Task();
var _local6:Task = new Task();
var _local7:SubWeapon = new SubWeapon(_local2, _local5, _scene);
_player = new Player(_local1, _local7, _local2, _local1.stageWidth, _local1.stageHeight);
var _local8:PlayerView = new PlayerView(_player, _camera);
var _local9:HitTest = new HitTest(_player, _local2, _local3, _local4);
var _local10:HUDView = new HUDView(_player, _local3, _view.hud);
var _local11:OverDriveView = new OverDriveView(_player, _view.hud);
addTask(_player);
addTask(_local2);
addTask(_local3);
addTask(_local6);
addTask(_local4);
addTask(_local9);
addTask(_local10);
addTask(_local5);
_local5.addTask(_local11);
_commSystem = _local10.communicationSystem;
_taskEnemyBullets = _local4;
_taskEnemies = _local3;
_taskEffects = _local5;
_hud = _local10;
_factoryArgs.player = _player;
_factoryArgs.taskEnemies = _local3;
_factoryArgs.taskEnemyBullets = _local4;
_factoryArgs.taskEffects = _local5;
_factoryArgs.taskLeaders = _local6;
_factoryArgs.scene = _scene;
}
protected function registerEnemy(_arg1:String, _arg2):void{
_enemyFactories[_arg1] = _arg2;
}
private function setup3D():void{
_scene = new Scene3D();
_camera = new Camera3D({zoom:10, focus:70, x:0, y:0, z:0});
_view = new View3D({scene:_scene, camera:_camera, stats:false});
_view.x = (_gameInfo.root.stage.stageWidth / 2);
_view.y = (_gameInfo.root.stage.stageHeight / 2);
_gameInfo.root.addChild(_view);
}
protected function onUpdate(_arg1):void{
if (_isTalk){
processTalkMode();
return;
};
switch (_infoState){
case "show":
if (_commSystem.complete){
_infoCounter = INFO_WAIT_COUNT;
_infoState = "waitTime";
};
break;
case "waitTime":
if (--_infoCounter < 0){
if (showNextMessage()){
_infoState = "show";
} else {
_commSystem.closeChannel();
_soundTransform.volume = VOLUME_NORMAL;
_soundChannel.soundTransform = _soundTransform;
_infoState = "wait";
};
};
break;
case "wait":
if (showNextMessage()){
_soundTransform.volume = VOLUME_IN_TALK;
_soundChannel.soundTransform = _soundTransform;
_infoState = "show";
};
break;
};
if (--_timeCount > 0){
};
_cond.call(this);
}
protected function get numEnemyBullets():int{
if (_factoryArgs.taskEnemyBullets.children != null){
return (_factoryArgs.taskEnemyBullets.children.length);
};
return (0);
}
protected function onPlayerShieldZero(_arg1):void{
addTask(new ShakeView(_view));
_expSoundChannel = ResourceLoader.load("player_bomb.mp3").play(0, 3000);
_gameoverFlag = true;
_gameInfo.switcher.startTransition(this, new SceneGameOver(_gameInfo, (this as Object).constructor));
}
private function onKeyUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.CONTROL){
_ctrl = false;
};
}
private function onClick(_arg1:MouseEvent):void{
_mouseClick = true;
}
protected function get numEnemies():int{
if (_factoryArgs.taskEnemies.children != null){
return (_factoryArgs.taskEnemies.children.length);
};
return (0);
}
private function onKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.CONTROL){
_ctrl = true;
};
if (_arg1.keyCode == Keyboard.ESCAPE){
suspend = !(suspend);
};
}
private function leaveTalkMode():void{
_isTalk = false;
_soundTransform.volume = VOLUME_NORMAL;
_soundChannel.soundTransform = _soundTransform;
_factoryArgs.player.inputMode = true;
}
private function setUpEnemies():void{
_enemyFactories["Heli"] = new HeliFactory(600, 30, _factoryArgs);
_enemyFactories["ExpHeli"] = new DeclinationHeliFactory(600, 70, _factoryArgs);
_enemyFactories["WarPlane"] = new WarPlaneFactory(300, 150, _factoryArgs);
_enemyFactories["BossAHV"] = new EnemyAHVFactory(5000, 15, 75, 300, _factoryArgs);
_enemyFactories["AHV"] = new EnemyAHVFactory(2000, 10, 50, 150, _factoryArgs);
_enemyFactories["Missile"] = new MissileFactory(100, 150, 1.8, _factoryArgs);
}
protected function get timer():Boolean{
return ((_timeCount < 0));
}
protected function enemy(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number):void{
_enemyFactories[_arg1].create(null, _arg2, _arg3, _arg4);
}
public function onBeginFadeOut():void{
if (_gameoverFlag){
_player.inputMode = false;
} else {
suspend = true;
};
}
protected function whiteIn(_arg1:Number):void{
var time = _arg1;
setTimer(time);
Tweener.addTween(_whiteCurtain, {time:time, alpha:0, onComplete:function ():void{
_root.removeChild(_whiteCurtain);
}});
}
private function onDraw(_arg1):void{
_view.render();
}
protected function talk(_arg1:String, _arg2:String, _arg3:String):void{
_messages.push({voice:_arg1, paperDoll:_arg2, message:_arg3});
enterTalkMode();
}
protected function boids(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number){
switch (_arg1){
case "Heli":
return (new HeliBoidsGenerator(_enemyFactories, _factoryArgs, _arg2, _arg3, _arg4));
case "WarPlane":
return (new WarPlaneBoidsGenerator(_enemyFactories, _factoryArgs, _arg2, _arg3, _arg4));
};
return (null);
}
protected function info(_arg1:String, _arg2:String, _arg3:String):void{
_messages.push({voice:_arg1, paperDoll:_arg2, message:_arg3});
}
private function cleanUp():void{
_root.stage.removeEventListener(MouseEvent.CLICK, onClick);
_root.stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
_root.stage.removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
_gameInfo.root.removeChild(_view);
if (_soundChannel != null){
_soundChannel.stop();
};
if (_expSoundChannel != null){
_expSoundChannel.stop();
};
EventBroadCaster.clearEventListener();
}
public function onEndFadeIn():void{
suspend = false;
_se.connect();
_explosionEffector = new ExplosionEffector(_scene);
EventBroadCaster.addEventListener(PlayerEvent.SHIELD_ZERO, onPlayerShieldZero);
}
protected function bgm(_arg1:String):void{
if (_soundChannel != null){
_soundChannel.stop();
};
_soundChannel = ResourceLoader.load(_arg1).play(0, 1000);
_soundTransform.volume = VOLUME_NORMAL;
_soundChannel.soundTransform = _soundTransform;
}
protected function jumpScene(_arg1:Task):void{
_gameInfo.switcher.startTransition(this, (_arg1 as ITransitionScene));
}
protected function whiteOut(_arg1:Number):void{
setTimer(_arg1);
_root.addChild(_whiteCurtain);
_whiteCurtain.alpha = 0;
Tweener.addTween(_whiteCurtain, {time:_arg1, alpha:1});
}
private function showNextMessage():Boolean{
var _local1:Object;
if (_messages.length != 0){
_local1 = _messages.shift();
_commSystem.sendMessage(ResourceLoader.load(_local1.paperDoll), ResourceLoader.load(_local1.voice), lookupName(_local1.paperDoll), _local1.message);
return (true);
};
return (false);
}
private function enterTalkMode():void{
if (_isTalk == false){
_isTalk = true;
_factoryArgs.player.inputMode = false;
_soundTransform.volume = VOLUME_IN_TALK;
_soundChannel.soundTransform = _soundTransform;
_mouseClick = false;
_ctrl = false;
showNextMessage();
};
}
public function onBeginFadeIn():void{
_view.visible = true;
suspend = true;
}
protected function set cond(_arg1:Function):void{
_cond = _arg1;
}
}
}//package fbattle7.scenes
import net.cladv.task.*;
import fbattle7.models.*;
import flash.utils.*;
import away3d.containers.*;
import fbattle7.models.enemies.*;
import fbattle7.views.enemies.*;
class MissileFactory {
private var _args:FactoryArgs;
private var _shield:Number;
private var _accel:Number;
private var _damage:Number;
private function MissileFactory(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:FactoryArgs){
_shield = _arg1;
_damage = _arg2;
_accel = _arg3;
_args = _arg4;
}
public function create(_arg1:EnemyLeader, _arg2:Number, _arg3:Number, _arg4:Number):EnemyBase{
var _local5:VSAHVMissile = new VSAHVMissile(_args.player, _args.taskEnemyBullets, _damage, _shield, _accel, (_arg2 + _args.player.x), (_arg3 + _args.player.y), (_arg4 + _args.player.z), 0, 0);
new VSAHVMissileView(_local5, _args.scene);
_args.taskEnemies.addTask(_local5);
return (_local5);
}
}
class HeliFactory {
private var _shield:Number;
private var _wp1:Number;
private var _args:FactoryArgs;
private function HeliFactory(_arg1:Number, _arg2:Number, _arg3:FactoryArgs){
_shield = _arg1;
_wp1 = _arg2;
_args = _arg3;
}
public function create(_arg1:EnemyLeader, _arg2:Number, _arg3:Number, _arg4:Number):EnemyBase{
var _local5:PointBurstWeapon = new PointBurstWeapon(_args.taskEnemyBullets, _args.scene);
var _local6:BulletHeli = new BulletHeli(_local5, _args.player, _arg1, _arg2, _arg3, _arg4);
new BulletHeliView(_local6, _args.scene);
_local5.damage = _wp1;
_local6.shield = _shield;
return (_local6);
}
}
class WarPlaneBoidsGenerator {
private var _leader:EnemyLeader;
private var _factories:Dictionary;
private var _args:FactoryArgs;
private function WarPlaneBoidsGenerator(_arg1:Dictionary, _arg2:FactoryArgs, _arg3:Number, _arg4:Number, _arg5:Number){
_factories = _arg1;
_args = _arg2;
var _local6:Player = _arg2.player;
_leader = new WarPlaneLeader(_local6, (_local6.x + _arg3), (_local6.y + _arg4), (_local6.z + _arg5), 0, 0);
_args.taskLeaders.addTask(_leader);
}
public function member(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number):WarPlaneBoidsGenerator{
var _local5:EnemyBase = _factories[_arg1].create(_leader, _arg2, _arg3, _arg4);
_leader.addMember(_local5);
_args.taskEnemies.addTask(_local5);
return (this);
}
}
class EnemyAHVFactory {
private var _shield:Number;
private var _wp1:Number;
private var _wp2:Number;
private var _args:FactoryArgs;
private var _ods:Number;
private function EnemyAHVFactory(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:FactoryArgs){
_shield = _arg1;
_wp1 = _arg2;
_wp2 = _arg3;
_ods = _arg4;
_args = _arg5;
}
public function create(_arg1:EnemyLeader, _arg2:Number, _arg3:Number, _arg4:Number):EnemyBase{
var _local5:PointBurstWeapon = new PointBurstWeapon(_args.taskEnemyBullets, _args.scene);
var _local6:ExplosionWeapon = new ExplosionWeapon(_args.taskEnemyBullets, _args.scene);
var _local7:EnemyAHV = new EnemyAHV(_local5, _local6, _args.taskEnemyBullets, _args.player, (_args.player.x + _arg2), (_args.player.y + _arg3), (_args.player.z + _arg4), 0, 0);
new AHVView(_local7, _args.scene);
_local5.damage = _wp1;
_local6.damage = _wp2;
_local7.odsDamage = _ods;
_local7.shield = _shield;
_args.taskEnemies.addTask(_local7);
return (_local7);
}
}
class DeclinationHeliFactory {
private var _shield:Number;
private var _wp1:Number;
private var _args:FactoryArgs;
private function DeclinationHeliFactory(_arg1:Number, _arg2:Number, _arg3:FactoryArgs){
_shield = _arg1;
_wp1 = _arg2;
_args = _arg3;
}
public function create(_arg1:EnemyLeader, _arg2:Number, _arg3:Number, _arg4:Number):EnemyBase{
var _local5:ExplosionWeapon = new ExplosionWeapon(_args.taskEnemyBullets, _args.scene);
var _local6:DeclinationShootingHeli = new DeclinationShootingHeli(_local5, _args.player, _arg1, _arg2, _arg3, _arg4);
new BulletHeliView(_local6, _args.scene);
_local5.damage = _wp1;
_local6.shield = _shield;
return (_local6);
}
}
class HeliBoidsGenerator {
private var _leader:EnemyLeader;
private var _factories:Dictionary;
private var _args:FactoryArgs;
private function HeliBoidsGenerator(_arg1:Dictionary, _arg2:FactoryArgs, _arg3:Number, _arg4:Number, _arg5:Number){
_factories = _arg1;
_args = _arg2;
var _local6:Player = _arg2.player;
_leader = new HeliLeader(_local6, (_local6.x + _arg3), (_local6.y + _arg4), (_local6.z + _arg5), 0, 0);
_args.taskLeaders.addTask(_leader);
}
public function member(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number):HeliBoidsGenerator{
var _local5:EnemyBase = _factories[_arg1].create(_leader, _arg2, _arg3, _arg4);
_leader.addMember(_local5);
_args.taskEnemies.addTask(_local5);
return (this);
}
}
class FactoryArgs {
public var taskEnemies:Task;
public var taskLeaders:Task;
public var player:Player;
public var scene:Scene3D;
public var taskEnemyBullets:Task;
public var taskEffects:Task;
private function FactoryArgs(){
}
}
class WarPlaneFactory {
private var _shield:Number;
private var _wp1:Number;
private var _args:FactoryArgs;
private function WarPlaneFactory(_arg1:Number, _arg2:Number, _arg3:FactoryArgs){
_shield = _arg1;
_wp1 = _arg2;
_args = _arg3;
}
public function create(_arg1:EnemyLeader, _arg2:Number, _arg3:Number, _arg4:Number):EnemyBase{
var _local5:VSAHVMissileWeapon = new VSAHVMissileWeapon(_args.taskEnemies, _args.taskEnemyBullets, _args.scene, _args.player);
var _local6:WarPlane = new WarPlane(_local5, _args.player, _arg1, _arg2, _arg3, _arg4);
new WarPlaneView(_local6, _args.scene);
_local5.damage = _wp1;
_local6.shield = _shield;
return (_local6);
}
}
Section 165
//AHVView (fbattle7.views.enemies.AHVView)
package fbattle7.views.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
public class AHVView extends Task {
private var _model:EnemyBase;
private var _matLoader:MetaseqMaterialLoader;
private var _viewModel:MetaseqMesh;
private var _scene:Scene3D;
public function AHVView(_arg1:EnemyBase, _arg2:Scene3D){
super(null, onDraw);
_model = _arg1;
_scene = _arg2;
_matLoader = new MetaseqMaterialLoader();
_viewModel = new MetaseqMesh();
_viewModel.loadFromByteArray(ResourceLoader.load("AHV.mqo"), _matLoader, 0.55);
_scene.addChild(_viewModel);
_model.addTask(this);
onDraw(null);
}
public function onDraw(_arg1):void{
_viewModel.x = _model.x;
_viewModel.y = _model.y;
_viewModel.z = _model.z;
_viewModel.rotationX = _model.rotationX;
_viewModel.rotationY = _model.rotationY;
}
override public function kill():void{
super.kill();
_scene.removeChild(_viewModel);
}
}
}//package fbattle7.views.enemies
Section 166
//BulletHeliView (fbattle7.views.enemies.BulletHeliView)
package fbattle7.views.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
import away3d.materials.*;
public class BulletHeliView extends Task {
private var _mat:ColorMaterial;
private var _viewModel:MetaseqMesh;
private var _time:int;
private var _scene:Scene3D;
private var _model:EnemyBase;
public function BulletHeliView(_arg1:EnemyBase, _arg2:Scene3D){
super(null, onDraw);
_model = _arg1;
_scene = _arg2;
_model.addTask(this);
_mat = new ColorMaterial(0xCC00);
_viewModel = new MetaseqMesh();
_viewModel.loadFromByteArray(ResourceLoader.load("HV.mqo"), new MetaseqMaterialLoader(), 0.5);
_scene.addChild(_viewModel);
_time = 0;
onDraw(null);
_model.addEventListener("Damage", onDamage);
}
private function onDraw(_arg1):void{
if (--_time > 0){
_mat.color = 204;
} else {
_mat.color = 0xCC00;
};
if (_model.exist == false){
_scene.removeChild(_viewModel);
kill();
return;
};
_viewModel.x = _model.x;
_viewModel.y = _model.y;
_viewModel.z = _model.z;
}
private function onDamage(_arg1):void{
_time = 10;
}
override public function kill():void{
super.kill();
_scene.removeChild(_viewModel);
}
}
}//package fbattle7.views.enemies
Section 167
//EnemyStraightBulletView (fbattle7.views.enemies.EnemyStraightBulletView)
package fbattle7.views.enemies {
import net.cladv.task.*;
import fbattle7.views.*;
import away3d.containers.*;
import away3d.primitives.*;
import fbattle7.models.enemies.*;
import away3d.materials.*;
public class EnemyStraightBulletView extends Task {
private var _model:EnemyStraightBullet;
private var _viewModel:LineSegment;
private var _scene:Scene3D;
private static const LINE_LENGTH:Number = 100;
public function EnemyStraightBulletView(_arg1:EnemyStraightBullet, _arg2:Scene3D, _arg3:uint, _arg4:Vector3){
super(null, onDraw);
_model = _arg1;
_scene = _arg2;
var _local5:Vector3 = _arg1.position;
var _local6:WireColorMaterial = new WireColorMaterial(_arg3, {width:5, alpha:0.5});
_viewModel = new LineSegment({material:_local6, x:_local5.x, y:_local5.y, z:_local5.z});
_viewModel.start.x = (_viewModel.start.y = (_viewModel.start.z = 0));
_viewModel.end.x = (_arg4.x * LINE_LENGTH);
_viewModel.end.y = (_arg4.y * LINE_LENGTH);
_viewModel.end.z = (_arg4.z * LINE_LENGTH);
_scene.addChild(_viewModel);
_model.addTask(this, true);
}
private function onDraw(_arg1):void{
_viewModel.x = _model.position.x;
_viewModel.y = _model.position.y;
_viewModel.z = _model.position.z;
}
override public function kill():void{
super.kill();
_scene.removeChild(_viewModel);
}
}
}//package fbattle7.views.enemies
Section 168
//GigantBulletView (fbattle7.views.enemies.GigantBulletView)
package fbattle7.views.enemies {
import net.cladv.task.*;
import flash.display.*;
import away3d.containers.*;
import fbattle7.models.enemies.*;
import away3d.sprites.*;
public class GigantBulletView extends Task {
private var _model:GigantBullet;
private var _mcSprite:MovieClipSprite;
private var _scene:Scene3D;
private static const RADIUS:Number = 300;
private static const COLOR:uint = 10267659;
private static const ALPHA:Number = 0.3;
private static var _cache:Array = new Array();
public function GigantBulletView(_arg1:GigantBullet, _arg2:Scene3D){
super(null, onDraw);
_model = _arg1;
_scene = _arg2;
_mcSprite = getMovieClipSprite();
_arg2.addChild(_mcSprite);
_arg1.addTask(this, true);
onDraw(null);
var _local3:Sprite = (_mcSprite.movieclip as Sprite);
}
private function onDraw(_arg1):void{
_mcSprite.x = _model.position.x;
_mcSprite.y = _model.position.y;
_mcSprite.z = _model.position.z;
var _local2:Sprite = (_mcSprite.movieclip as Sprite);
}
override public function kill():void{
super.kill();
_cache.push(_mcSprite.movieclip);
_scene.removeChild(_mcSprite);
}
private function getMovieClipSprite():MovieClipSprite{
var _local1:Sprite;
if (_cache.length != 0){
_local1 = _cache.pop();
_local1.scaleX = (_local1.scaleY = 1);
_local1.x = (_local1.y = 0);
_local1.graphics.clear();
} else {
_local1 = new Sprite();
};
var _local2:Graphics = _local1.graphics;
_local2.lineStyle(0, COLOR, ALPHA);
_local2.beginFill(COLOR, ALPHA);
_local2.drawCircle((RADIUS / 2), (RADIUS / 2), RADIUS);
_local2.endFill();
return (new MovieClipSprite(_local1, {rescale:true, x:_model.position.x, y:_model.position.y, z:_model.position.z}));
}
}
}//package fbattle7.views.enemies
Section 169
//GigantView (fbattle7.views.enemies.GigantView)
package fbattle7.views.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
import away3d.primitives.*;
import away3d.materials.*;
public class GigantView extends Task {
private var _player:Player;
private var _model:Sphere;
private var _scene:Scene3D;
private var _abs:Boolean;
private var _rp:Vector3;
public function GigantView(_arg1:Player, _arg2:Scene3D, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean=false){
super(null, onDraw);
_player = _arg1;
_scene = _arg2;
_rp = new Vector3(_arg3, _arg4, _arg5);
_model = new Sphere({material:new ColorMaterial(0x111111), radius:1000});
_arg2.addChild(_model);
onDraw(null);
}
private function onDraw(_arg1):void{
if (_abs){
_model.x = _rp.x;
_model.y = _rp.y;
_model.z = _rp.z;
} else {
_model.x = (_player.x + _rp.x);
_model.y = (_player.y + _rp.y);
_model.z = (_player.z + _rp.z);
};
}
override public function kill():void{
super.kill();
_scene.removeChild(_model);
}
}
}//package fbattle7.views.enemies
Section 170
//ShieldAnchorView (fbattle7.views.enemies.ShieldAnchorView)
package fbattle7.views.enemies {
import net.cladv.task.*;
import away3d.containers.*;
import away3d.primitives.*;
import fbattle7.models.enemies.*;
public class ShieldAnchorView extends Task {
private var _model:ShieldAnchor;
private var _viewModel:Sphere;
private var _scene:Scene3D;
public function ShieldAnchorView(_arg1:ShieldAnchor, _arg2:Scene3D){
super(null, onDraw);
_model = _arg1;
_scene = _arg2;
_viewModel = new Sphere({x:_model.x, y:_model.y, z:_model.z, radius:100, segmentsW:4, segmentsH:4});
_model.addTask(this, true);
_scene.addChild(_viewModel);
}
private function onDraw(_arg1):void{
_viewModel.x = _model.x;
_viewModel.y = _model.y;
_viewModel.z = _model.z;
}
override public function kill():void{
super.kill();
_scene.removeChild(_viewModel);
}
}
}//package fbattle7.views.enemies
Section 171
//WarPlaneView (fbattle7.views.enemies.WarPlaneView)
package fbattle7.views.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
public class WarPlaneView extends Task {
private var _model:EnemyBase;
private var _matLoader:MetaseqMaterialLoader;
private var _viewModel:MetaseqMesh;
private var _scene:Scene3D;
public function WarPlaneView(_arg1:EnemyBase, _arg2:Scene3D){
super(null, onDraw);
_model = _arg1;
_scene = _arg2;
_matLoader = new MetaseqMaterialLoader();
_viewModel = new MetaseqMesh();
_viewModel.loadFromByteArray(ResourceLoader.load("F-78.mqo"), _matLoader, 0.5);
_scene.addChild(_viewModel);
_model.addTask(this);
onDraw(null);
}
public function onDraw(_arg1):void{
_viewModel.x = _model.x;
_viewModel.y = _model.y;
_viewModel.z = _model.z;
_viewModel.rotationX = _model.rotationX;
_viewModel.rotationY = _model.rotationY;
}
override public function kill():void{
super.kill();
_scene.removeChild(_viewModel);
}
}
}//package fbattle7.views.enemies
Section 172
//VSAHVMissileView (fbattle7.views.enemies.VSAHVMissileView)
package fbattle7.views.enemies {
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.views.*;
import away3d.containers.*;
public class VSAHVMissileView extends Task {
private var _viewModel:MetaseqMesh;
private var _model:EnemyBase;
private var _scene:Scene3D;
public function VSAHVMissileView(_arg1:EnemyBase, _arg2:Scene3D){
super(null, onDraw);
_model = _arg1;
_scene = _arg2;
_model.addTask(this);
_viewModel = new MetaseqMesh();
_viewModel.loadFromByteArray(ResourceLoader.load("missile.mqo"), new MetaseqMaterialLoader(), 0.5);
_scene.addChild(_viewModel);
onDraw(null);
}
private function onDraw(_arg1):void{
_viewModel.x = _model.x;
_viewModel.y = _model.y;
_viewModel.z = _model.z;
_viewModel.rotationX = _model.rotationX;
_viewModel.rotationY = _model.rotationY;
}
override public function kill():void{
super.kill();
_scene.removeChild(_viewModel);
}
}
}//package fbattle7.views.enemies
Section 173
//CommunicationSystem (fbattle7.views.hud.CommunicationSystem)
package fbattle7.views.hud {
import net.cladv.task.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.text.*;
public class CommunicationSystem extends Task {
private var _container:Sprite;
private var _back:Sprite;
private var _text:TextField;
private var _soundChannel:SoundChannel;
private var _textPosition:Number;
private var _soundLength:Number;
private var _complete:Boolean;
private var _namePlateText:TextField;
private var _namePlateBack:Sprite;
private var _textMask:Sprite;
private var _textBitmap:Bitmap;
private var _paperDoll:Bitmap;
private static const NAMEPLATE_WIDTH:Number = 100;
private static const TEXT_Y_SPAN:Number = 10;
private static const NAMEPLATE_X_SPAN:Number = 10;
private static const PAPERDOLL_X:Number = 0;
private static const PAPERDOLL_Y:Number = 0;
private static const FONT_COLOR:Number = 4294967295;
private static const TEXT_WIDTH:Number = 400;
private static const NAMEPLATE_HEIGHT:Number = 20;
private static const SHOW_SPEED:Number = 5;
private static const BACK_COLOR:uint = 0;
private static const TEXT_X_OFFSET:Number = 0;
private static const BACK_ALPHA:Number = 0.2;
private static const PAPERDOLL_MIN_ALPHA:Number = 0.45;
private static const FONT_SIZE:Number = 15;
private static const TEXT_HEIGHT:Number = 40;
private static const PAPERDOLL_MAX_ALPHA:Number = 0.5;
public function CommunicationSystem(_arg1:Sprite){
super(doNothing);
_text = new TextField();
_textBitmap = new Bitmap(new BitmapData(TEXT_WIDTH, TEXT_HEIGHT));
_back = new Sprite();
_textMask = new Sprite();
_container = new Sprite();
_paperDoll = new Bitmap();
_namePlateText = new TextField();
_namePlateBack = new Sprite();
_textPosition = 0;
_complete = false;
_container.addChild(_paperDoll);
_container.addChild(_back);
_container.addChild(_textBitmap);
_container.addChild(_namePlateBack);
_container.addChild(_namePlateText);
_container.addChild(_textMask);
_arg1.addChild(_container);
_textBitmap.mask = _textMask;
_textBitmap.bitmapData.fillRect(new Rectangle(0, 0, TEXT_WIDTH, TEXT_HEIGHT), 0);
_container.visible = false;
_back.x = (_textBitmap.x = (_textMask.x = ((-(TEXT_WIDTH) / 2) - TEXT_X_OFFSET)));
_back.y = (_textBitmap.y = (_textMask.y = (240 - (TEXT_HEIGHT + TEXT_Y_SPAN))));
_namePlateBack.x = (_namePlateText.x = -(((((TEXT_WIDTH / 2) + TEXT_X_OFFSET) + NAMEPLATE_X_SPAN) + NAMEPLATE_WIDTH)));
_namePlateBack.y = (_namePlateText.y = (240 - (NAMEPLATE_HEIGHT + TEXT_Y_SPAN)));
_text.width = TEXT_WIDTH;
_text.height = TEXT_HEIGHT;
_namePlateText.width = NAMEPLATE_WIDTH;
_namePlateText.height = NAMEPLATE_HEIGHT;
var _local2:TextFormat = new TextFormat();
_local2.size = FONT_SIZE;
_local2.bold = true;
_local2.color = FONT_COLOR;
_text.selectable = (_namePlateText.selectable = false);
_text.antiAliasType = (_namePlateText.antiAliasType = AntiAliasType.ADVANCED);
_text.multiline = true;
_text.wordWrap = true;
_text.defaultTextFormat = _local2;
_namePlateText.defaultTextFormat = _local2;
var _local3:Graphics = _back.graphics;
_local3.beginFill(BACK_COLOR, BACK_ALPHA);
_local3.drawRect(0, 0, TEXT_WIDTH, TEXT_HEIGHT);
_local3.endFill();
_local3 = _namePlateBack.graphics;
_local3.beginFill(BACK_COLOR, BACK_ALPHA);
_local3.drawRect(0, 0, NAMEPLATE_WIDTH, NAMEPLATE_HEIGHT);
_local3.endFill();
}
private function doNothing(_arg1):void{
}
private function showMessage(_arg1):void{
var _local5:TextLineMetrics;
var _local2:TextLineMetrics = _text.getLineMetrics(0);
var _local3:Number = 2;
var _local4:Graphics = _textMask.graphics;
_textPosition = (_textPosition + SHOW_SPEED);
if (_local2.width > _textPosition){
_local4.clear();
_local4.beginFill(0);
_local4.drawRect(_local3, _local3, _textPosition, _local2.height);
_local4.endFill();
} else {
if (_text.numLines >= 2){
_local5 = _text.getLineMetrics(1);
} else {
_local5 = new TextLineMetrics(0, 0, 0, 0, 0, 0);
};
if ((_local2.width + _local5.width) > _textPosition){
_local4.clear();
_local4.beginFill(0);
_local4.drawRect(_local3, _local3, _local2.width, _local2.height);
_local4.drawRect(_local3, (_local3 + _local2.height), (_textPosition - _local2.width), _local5.height);
} else {
_local4.clear();
_textBitmap.mask = null;
if (_soundChannel == null){
changeTask(endShowing);
} else {
if (_soundChannel.position >= (_soundLength - 3000)){
changeTask(endShowing);
};
};
};
};
blinkPaperDoll();
}
public function showAll():void{
_textMask.graphics.clear();
_textBitmap.mask = null;
changeTask(endShowing);
}
public function closeChannel():void{
_container.visible = false;
if (_soundChannel != null){
_soundChannel.stop();
};
changeTask(doNothing);
}
public function sendMessage(_arg1:BitmapData, _arg2:Sound, _arg3:String, _arg4:String):void{
_container.visible = true;
_paperDoll.bitmapData = _arg1;
_namePlateText.text = _arg3;
_text.text = _arg4;
_textPosition = 0;
_textBitmap.bitmapData.fillRect(new Rectangle(0, 0, TEXT_WIDTH, TEXT_HEIGHT), 0);
_textBitmap.bitmapData.draw(_text);
_textMask.graphics.clear();
_textBitmap.mask = _textMask;
_complete = false;
_paperDoll.x = (-320 + PAPERDOLL_X);
_paperDoll.y = ((240 - PAPERDOLL_Y) - _paperDoll.height);
blinkPaperDoll();
if (_soundChannel != null){
_soundChannel.stop();
_soundChannel = null;
};
if (_arg2 != null){
_soundChannel = _arg2.play();
_soundLength = _arg2.length;
};
changeTask(showMessage);
}
private function endShowing(_arg1):void{
blinkPaperDoll();
_complete = true;
}
public function get complete():Boolean{
return (_complete);
}
private function blinkPaperDoll():void{
_paperDoll.alpha = ((Math.random() * (PAPERDOLL_MAX_ALPHA - PAPERDOLL_MIN_ALPHA)) + PAPERDOLL_MIN_ALPHA);
}
}
}//package fbattle7.views.hud
Section 174
//DamageBar (fbattle7.views.hud.DamageBar)
package fbattle7.views.hud {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import caurina.transitions.*;
import fbattle7.views.*;
import fbattle7.events.*;
public class DamageBar extends Task {
private var _player:Player;
private var _mat:Matrix4;
private var _sprite:Sprite;
private var _angle:Number;
private var _vec:Vector3;
public var alpha:Number;
private static const COLOR:uint = 0xDD0000;
private static const WIDTH:Number = 20;
private static const V1:Vector3 = new Vector3(200, 0, -100);
private static const V2:Vector3 = new Vector3(220, 0, 0);
private static const V3:Vector3 = new Vector3(200, 0, 100);
public function DamageBar(_arg1:Sprite, _arg2:Player){
super(null, onDraw);
_sprite = new Sprite();
_angle = 0;
_player = _arg2;
_mat = new Matrix4();
_vec = new Vector3();
alpha = 0;
_arg1.addChild(_sprite);
_arg2.addEventListener(PlayerEvent.DAMAGE, onDamage);
}
private function onDraw(_arg1):void{
var _local2:Graphics = _sprite.graphics;
_local2.clear();
if (alpha != 0){
_local2.lineStyle(WIDTH, COLOR, alpha, false, LineScaleMode.NORMAL, CapsStyle.ROUND, JointStyle.ROUND);
_mat.fromRotationY((_angle + 180));
_vec.rotate(V1, _mat);
_local2.moveTo(_vec.x, _vec.z);
_vec.rotate(V2, _mat);
_local2.lineTo(_vec.x, _vec.z);
_vec.rotate(V3, _mat);
_local2.lineTo(_vec.x, _vec.z);
};
}
private function onDamage(_arg1:Number):void{
_angle = _arg1;
alpha = HUDConst.LINE_ALPHA;
Tweener.addTween(this, {time:1.7, alpha:0, transition:"easeInQuart"});
}
}
}//package fbattle7.views.hud
Section 175
//EnergyBar (fbattle7.views.hud.EnergyBar)
package fbattle7.views.hud {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
public class EnergyBar extends Task {
private var _player:Player;
private var _bar:Sprite;
private static const BAR_HEIGHT:Number = 100;
private static const BAR_COLOR:uint = 204;
private static const BAR_WIDTH:Number = 20;
private static const BAR_X:Number = 240;
private static const BAR_Y:Number = 50;
public function EnergyBar(_arg1:Sprite, _arg2:Player){
super(null, onDraw);
_player = _arg2;
_bar = new Sprite();
_bar.x = BAR_X;
_bar.y = (BAR_Y + BAR_HEIGHT);
_arg1.addChild(_bar);
}
private function onDraw(_arg1):void{
var _local2:Graphics = _bar.graphics;
_local2.clear();
_local2.lineStyle(0, BAR_COLOR, HUDConst.LINE_ALPHA);
_local2.beginFill(BAR_COLOR, HUDConst.LINE_ALPHA);
var _local3:Number = (_player.energy / Player.MAX_SHIELD);
_local2.drawRect(0, (-(_local3) * BAR_HEIGHT), BAR_WIDTH, (_local3 * BAR_HEIGHT));
_local2.endFill();
}
}
}//package fbattle7.views.hud
Section 176
//HUDConst (fbattle7.views.hud.HUDConst)
package fbattle7.views.hud {
public class HUDConst {
public static const LINE_COLOR:uint = 15313215;
public static const LINE_ALPHA:Number = 0.5;
}
}//package fbattle7.views.hud
Section 177
//IRadarTracable (fbattle7.views.hud.IRadarTracable)
package fbattle7.views.hud {
public interface IRadarTracable {
function get x():Number;
function get y():Number;
function get z():Number;
}
}//package fbattle7.views.hud
Section 178
//Radar (fbattle7.views.hud.Radar)
package fbattle7.views.hud {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import fbattle7.views.*;
public class Radar extends Task {
private var _player:Player;
private var _mat:Matrix4;
private var _points:Sprite;
private var _rangeCircle:Sprite;
private var _enemies:Task;
private var _showRange:Boolean;
private var _vec:Vector3;
private var _radar:Sprite;
private var _rangeCircleMask:Sprite;
private var _result:Vector3;
private var _range:Number;
private static const MAX_Y:Number = 2000;
private static const ENEMY_COLOR:uint = 0xFF0000;
private static const RADAR_DISTANCE:Number = 10000;
private static const CENTER_Y:Number = -150;
private static const MAX_ENEMY_SIZE:uint = 6;
private static const CENTER_X:Number = 230;
private static const RADAR_SIZE:Number = 150;
private static const MIN_Y:Number = -2000;
public function Radar(_arg1:Sprite, _arg2:Player, _arg3:Task){
super(null, onDraw);
_radar = new Sprite();
_points = new Sprite();
_radar.x = CENTER_X;
_radar.y = CENTER_Y;
_player = _arg2;
_enemies = _arg3;
_mat = new Matrix4();
_vec = new Vector3();
_result = new Vector3();
_rangeCircle = new Sprite();
_rangeCircleMask = new Sprite();
_showRange = false;
_range = 0;
var _local4:Graphics = _radar.graphics;
_local4.lineStyle(2, HUDConst.LINE_COLOR, HUDConst.LINE_ALPHA);
_local4.drawCircle(0, 0, (RADAR_SIZE / 2));
_local4.lineStyle(1, HUDConst.LINE_COLOR, HUDConst.LINE_ALPHA);
_local4.moveTo((-(RADAR_SIZE) / 2), 0);
_local4.lineTo((RADAR_SIZE / 2), 0);
_local4.moveTo(0, (-(RADAR_SIZE) / 2));
_local4.lineTo(0, (RADAR_SIZE / 2));
_local4.drawCircle(0, 0, (MAX_ENEMY_SIZE / 2));
_local4.drawCircle(0, 0, (RADAR_SIZE / 4));
_rangeCircleMask.x = (_rangeCircle.x = CENTER_X);
_rangeCircleMask.y = (_rangeCircle.y = CENTER_Y);
_local4 = _rangeCircleMask.graphics;
_local4.beginFill(0);
_local4.drawCircle(0, 0, (RADAR_SIZE / 2));
_arg1.addChild(_radar);
_arg1.addChild(_rangeCircle);
_arg1.addChild(_rangeCircleMask);
_radar.addChild(_points);
_rangeCircle.mask = _rangeCircleMask;
}
public function showRange(_arg1:Number):void{
_range = _arg1;
_showRange = true;
}
private function onDraw(_arg1):void{
var _local3:IRadarTracable;
var _local4:Number;
var _local5:Number;
var _local2:Graphics = _points.graphics;
_mat.fromRotationY(-(_player.rotationY));
_local2.clear();
if (_enemies.children == null){
return;
};
for each (_local3 in _enemies.children) {
_vec.setValue((_local3.x - _player.x), 0, (_local3.z - _player.z));
_local4 = _vec.length();
if (_local4 > RADAR_DISTANCE){
} else {
_vec.scaleSelf((((1 / RADAR_DISTANCE) * RADAR_SIZE) / 2));
_result.rotate(_vec, _mat);
_local5 = ((((_local3.y - _player.y) - MIN_Y) / (MAX_Y - MIN_Y)) * MAX_ENEMY_SIZE);
if (_local5 > MAX_ENEMY_SIZE){
_local5 = MAX_ENEMY_SIZE;
};
if (_local5 < 1){
_local5 = 1;
};
_local2.lineStyle(0, ENEMY_COLOR);
_local2.beginFill(ENEMY_COLOR, HUDConst.LINE_ALPHA);
_local2.drawCircle(_result.x, -(_result.z), _local5);
};
};
_local2.endFill();
if (_showRange){
_local2 = _rangeCircle.graphics;
_local2.clear();
_local2.lineStyle(0, HUDConst.LINE_COLOR);
_vec.x = (((-(_player.x) / RADAR_DISTANCE) * RADAR_SIZE) / 2);
_vec.z = (((-(_player.z) / RADAR_DISTANCE) * RADAR_SIZE) / 2);
_result.rotate(_vec, _mat);
_local2.drawCircle(_result.x, -(_result.z), (((_range / RADAR_DISTANCE) * RADAR_SIZE) / 2));
};
}
}
}//package fbattle7.views.hud
Section 179
//ShieldBar (fbattle7.views.hud.ShieldBar)
package fbattle7.views.hud {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import caurina.transitions.*;
import fbattle7.events.*;
public class ShieldBar extends Task {
private var _player:Player;
private var _bar:Sprite;
public var shield:Number;
private static const BAR_HEIGHT:Number = 100;
private static const BAR_COLOR:uint = 0xCC0000;
private static const BAR_WIDTH:Number = 20;
private static const BAR_X:Number = 280;
private static const BAR_Y:Number = 50;
public function ShieldBar(_arg1:Sprite, _arg2:Player){
super(null, onDraw);
_player = _arg2;
_bar = new Sprite();
shield = _arg2.shield;
_bar.x = BAR_X;
_bar.y = (BAR_Y + BAR_HEIGHT);
_arg1.addChild(_bar);
_player.addEventListener(PlayerEvent.DAMAGE, onDamage);
onDraw(null);
}
private function onDraw(_arg1):void{
var _local2:Graphics = _bar.graphics;
_local2.clear();
_local2.lineStyle(0, BAR_COLOR, HUDConst.LINE_ALPHA);
_local2.beginFill(BAR_COLOR, HUDConst.LINE_ALPHA);
var _local3:Number = (shield / Player.MAX_SHIELD);
_local2.drawRect(0, (-(_local3) * BAR_HEIGHT), BAR_WIDTH, (_local3 * BAR_HEIGHT));
_local2.endFill();
}
private function onDamage(_arg1):void{
Tweener.addTween(this, {time:1, shield:_player.shield, transition:"easeOutCubic"});
}
}
}//package fbattle7.views.hud
Section 180
//TargetCursor (fbattle7.views.hud.TargetCursor)
package fbattle7.views.hud {
import flash.display.*;
public class TargetCursor {
private static const WIDTH:Number = 64;
private static const HEIGHT:Number = 48;
public function TargetCursor(_arg1:Sprite){
var _local2:Sprite = new Sprite();
var _local3:Graphics = _local2.graphics;
_local3.lineStyle(1, HUDConst.LINE_COLOR, HUDConst.LINE_ALPHA);
_local3.moveTo((-(WIDTH) / 2), 0);
_local3.lineTo((WIDTH / 2), 0);
_local3.moveTo(0, (-(HEIGHT) / 2));
_local3.lineTo(0, (HEIGHT / 2));
_arg1.addChild(_local2);
}
}
}//package fbattle7.views.hud
Section 181
//YawMeter (fbattle7.views.hud.YawMeter)
package fbattle7.views.hud {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import flash.text.*;
public class YawMeter extends Task {
private var _player:Player;
private var _textN:TextField;
private var _meter:Sprite;
private var _textW:TextField;
private var _textE:TextField;
private var _textS:TextField;
private static const E:Number = 90;
private static const METER_RANGE:Number = 120;
private static const NW:Number = 315;
private static const N:Number = 0;
private static const METER_WIDTH:Number = 300;
private static const SCALE_WIDTH:Number = 10;
private static const SE:Number = 135;
private static const S:Number = 180;
private static const W:Number = 270;
private static const SW:Number = 225;
private static const CENTER_Y:Number = 150;
private static const CENTER_X:Number = 0;
private static const NE:Number = 45;
public function YawMeter(_arg1:Player, _arg2:Sprite){
super(null, onDraw);
_player = _arg1;
_meter = new Sprite();
_textN = new TextField();
_textW = new TextField();
_textS = new TextField();
_textE = new TextField();
var _local3:Array = [_textN, _textW, _textS, _textE];
var _local4:Array = ["N", "W", "S", "E"];
var _local5:int;
while (_local5 < 4) {
_local3[_local5].selectable = false;
_local3[_local5].visible = false;
_local3[_local5].textColor = HUDConst.LINE_COLOR;
_local3[_local5].text = _local4[_local5];
_local3[_local5].alpha = HUDConst.LINE_ALPHA;
_meter.addChild(_local3[_local5]);
_local5++;
};
_meter.x = (CENTER_X - (METER_WIDTH / 2));
_meter.y = CENTER_Y;
_arg2.addChild(_meter);
}
private function onDraw(_arg1):void{
var _local2:Number = _player.rotationY;
_textN.visible = false;
_textW.visible = false;
_textS.visible = false;
_textE.visible = false;
var _local3:Graphics = _meter.graphics;
_local3.clear();
_local3.lineStyle(2, HUDConst.LINE_COLOR, HUDConst.LINE_ALPHA);
_local3.moveTo(0, 0);
_local3.lineTo(METER_WIDTH, 0);
if ((_local2 - (METER_RANGE / 2)) < 0){
drawScales(0, ((_local2 - (METER_RANGE / 2)) + 360), 360);
drawScales(((-((_local2 - (METER_RANGE / 2))) / METER_RANGE) * METER_WIDTH), 0, (_local2 + (METER_RANGE / 2)));
} else {
if ((_local2 + (METER_RANGE / 2)) > 360){
drawScales(0, (_local2 - (METER_RANGE / 2)), 360);
drawScales((((360 - (_local2 - (METER_RANGE / 2))) / METER_RANGE) * METER_WIDTH), 0, ((_local2 + (METER_RANGE / 2)) - 360));
} else {
drawScales(0, (_local2 - (METER_RANGE / 2)), (_local2 + (METER_RANGE / 2)));
};
};
}
private function drawScale(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:TextField):void{
var _local7:Number;
var _local6:Graphics = _meter.graphics;
if ((((_arg2 <= _arg4)) && ((_arg4 <= _arg3)))){
_local7 = (_arg1 + (((_arg4 - _arg2) / METER_RANGE) * METER_WIDTH));
if (_arg5 != null){
_arg5.x = (_local7 - (_arg5.getLineMetrics(0).width / 2));
_arg5.y = (-(SCALE_WIDTH) - _arg5.getLineMetrics(0).height);
_arg5.visible = true;
};
_local6.moveTo(_local7, -(SCALE_WIDTH));
_local6.lineTo(_local7, SCALE_WIDTH);
};
}
private function drawScales(_arg1:Number, _arg2:Number, _arg3:Number):void{
drawScale(_arg1, _arg2, _arg3, N, _textN);
drawScale(_arg1, _arg2, _arg3, W, _textW);
drawScale(_arg1, _arg2, _arg3, S, _textS);
drawScale(_arg1, _arg2, _arg3, E, _textE);
drawScale(_arg1, _arg2, _arg3, SE, null);
drawScale(_arg1, _arg2, _arg3, SW, null);
drawScale(_arg1, _arg2, _arg3, NE, null);
drawScale(_arg1, _arg2, _arg3, NW, null);
}
}
}//package fbattle7.views.hud
Section 182
//CloudView (fbattle7.views.CloudView)
package fbattle7.views {
import net.cladv.task.*;
import caurina.transitions.*;
import away3d.containers.*;
import away3d.primitives.*;
import away3d.cameras.*;
import away3d.materials.*;
public class CloudView extends Task {
private var _camera:Camera3D;
private var _clouds:Array;
private var _scene:Scene3D;
private var CLOUD_HEIGHT:Number;// = -5000
private var NUM_CLOUDS:int;// = 120
private var SIGHT_LIMIT:Number;// = 50000
private var CLOUD_SPREAD:Number;// = 100000
public function CloudView(_arg1:Camera3D, _arg2:Scene3D){
super(null, onDraw);
_camera = _arg1;
_scene = _arg2;
_clouds = new Array();
generateClouds();
}
private function onDraw(_arg1):void{
var _local2:Plane;
var _local3:BitmapMaterial;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
for each (_local2 in _clouds) {
_local4 = (_camera.x - _local2.x);
_local5 = (_camera.y - _local2.y);
_local6 = (_camera.z - _local2.z);
_local7 = (((_local4 * _local4) + (_local5 * _local5)) + (_local6 * _local6));
if (_local7 > (SIGHT_LIMIT * SIGHT_LIMIT)){
if (_local2.visible == true){
_local2.visible = false;
_local3 = (_local2.material as BitmapMaterial);
_local3.alpha = 1;
Tweener.addTween(_local3, {time:4, alpha:0, transition:"linear"});
};
} else {
if (_local2.visible == false){
_local2.visible = true;
_local3 = (_local2.material as BitmapMaterial);
_local3.alpha = 0;
Tweener.addTween(_local3, {time:4, alpha:1, transition:"linear"});
};
};
};
}
private function generateClouds():void{
var _local1:Plane;
var _local3:Number;
var _local4:Number;
var _local2:int;
while (_local2 < NUM_CLOUDS) {
_local3 = ((Math.random() * 10000) + 1000);
_local4 = ((Math.random() * 10000) + 1000);
_local1 = new Plane({segmentsW:(_local3 / 3000), segmentsH:(_local4 / 3000), width:_local3, height:_local4, material:new BitmapMaterial(ResourceLoader.load("cloud.png")), x:((2 * (Math.random() - 0.5)) * CLOUD_SPREAD), y:(_camera.y + CLOUD_HEIGHT), z:((2 * (Math.random() - 0.5)) * CLOUD_SPREAD)});
_clouds.push(_local1);
_scene.addChild(_local1);
_local2++;
};
}
}
}//package fbattle7.views
Section 183
//ExplosionEffector (fbattle7.views.ExplosionEffector)
package fbattle7.views {
import fbattle7.models.*;
import caurina.transitions.*;
import away3d.containers.*;
import away3d.primitives.*;
import away3d.materials.*;
import fbattle7.events.*;
public class ExplosionEffector {
private var _scene:Scene3D;
private static const MAX_PARTICLE:int = 15;
private static const COLOR:int = 16091448;
private static const INITIAL_ALPHA:Number = 0.7;
private static const TIME:Number = 1.5;
private static const LENGTH:Number = 200;
private static const MAX_ROTATION:Number = 1200;
private static var _mat:Matrix4 = new Matrix4();
private static var _v:Vector3 = new Vector3();
private static var _cache:Array = new Array();
public function ExplosionEffector(_arg1:Scene3D){
_scene = _arg1;
EventBroadCaster.addEventListener(EnemyEvent.DESTROY, onDestroy);
}
public function onDestroy(_arg1:EnemyBase):void{
var t:Triangle;
var e = _arg1;
var n:int;
while (n < MAX_PARTICLE) {
t = createTriangle();
_mat.fromYawPitchRoll((Math.random() * 360), (Math.random() * 360), 0);
_v.rotate(Vector3.Z_AXIS, _mat);
_v.scaleSelf(LENGTH);
t.x = e.x;
t.y = e.y;
t.z = e.z;
t.rotationX = (Math.random() * 360);
t.rotationY = (Math.random() * 360);
t.rotationZ = (Math.random() * 360);
_scene.addChild(t);
Tweener.addTween(t, {time:TIME, x:(_v.x + e.x), y:(_v.y + e.y), z:(_v.z + e.z), rotationX:(Math.random() * MAX_ROTATION), rotationY:(Math.random() * MAX_ROTATION), rotationZ:(Math.random() * MAX_ROTATION), transition:"linear", onComplete:function ():void{
_scene.removeChild(t);
}});
Tweener.addTween(t.material, {time:TIME, alpha:0, transition:"linear"});
n = (n + 1);
};
}
private function createTriangle():Triangle{
return (new Triangle({material:new ColorMaterial(COLOR, {alpha:INITIAL_ALPHA})}));
}
}
}//package fbattle7.views
Section 184
//HUDView (fbattle7.views.HUDView)
package fbattle7.views {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import fbattle7.views.hud.*;
public class HUDView extends Task {
private var _radar:Radar;
private var _commSystem:CommunicationSystem;
public function HUDView(_arg1:Player, _arg2:Task, _arg3:Sprite){
addTask(new YawMeter(_arg1, _arg3));
addTask((_radar = new Radar(_arg3, _arg1, _arg2)));
addTask(new ShieldBar(_arg3, _arg1));
addTask(new EnergyBar(_arg3, _arg1));
addTask(new DamageBar(_arg3, _arg1));
addTask((_commSystem = new CommunicationSystem(_arg3)));
new TargetCursor(_arg3);
}
public function showRangeInRadar(_arg1:Number):void{
_radar.showRange(_arg1);
}
public function get communicationSystem():CommunicationSystem{
return (_commSystem);
}
}
}//package fbattle7.views
Section 185
//IMetaseqMaterialLoader (fbattle7.views.IMetaseqMaterialLoader)
package fbattle7.views {
import flash.display.*;
public interface IMetaseqMaterialLoader {
function load(_arg1:String):BitmapData;
}
}//package fbattle7.views
Section 186
//Matrix4 (fbattle7.views.Matrix4)
package fbattle7.views {
import away3d.core.math.*;
public class Matrix4 {
var _impl:Matrix3D;
static const toRAD:Number = 0.0174532925199433;
private static var tmpMat1:Matrix3D = new Matrix3D();
private static var tmpMat2:Matrix3D = new Matrix3D();
private static var tmpMat3:Matrix3D = new Matrix3D();
private static var tmpVec1:Number3D = new Number3D();
public static var _quat:Quaternion = new Quaternion();
public function Matrix4(){
_impl = new Matrix3D();
}
public function fromRotationX(_arg1:Number):void{
_impl.rotationMatrix(1, 0, 0, (_arg1 * toRAD));
}
public function fromRotationY(_arg1:Number):void{
_impl.rotationMatrix(0, 1, 0, (_arg1 * toRAD));
}
public function fromYawPitchRoll(_arg1:Number, _arg2:Number, _arg3:Number):void{
_quat.euler2quaternion((_arg1 * toRAD), (_arg3 * toRAD), (-(_arg2) * toRAD));
_impl.quaternion2matrix(_quat);
}
public function fromAxisAndRotation(_arg1:Vector3, _arg2:Number):void{
_impl.rotationMatrix(_arg1.x, _arg1.y, _arg1.z, (_arg2 * toRAD));
}
public function fromRotationX_RotY_Y(_arg1:Number, _arg2:Number, _arg3:Number):void{
tmpMat1.rotationMatrix(1, 0, 0, (-(_arg1) * toRAD));
tmpVec1.rotate(Number3D.UP, tmpMat1);
tmpMat2.rotationMatrix(tmpVec1.x, tmpVec1.y, tmpVec1.z, (_arg2 * toRAD));
tmpMat3.rotationMatrix(0, 1, 0, (_arg3 * toRAD));
_impl.multiply3x3(tmpMat3, tmpMat2);
_impl.multiply3x3(_impl, tmpMat1);
}
}
}//package fbattle7.views
Section 187
//MetaseqMaterialLoader (fbattle7.views.MetaseqMaterialLoader)
package fbattle7.views {
import flash.display.*;
public class MetaseqMaterialLoader implements IMetaseqMaterialLoader {
public function load(_arg1:String):BitmapData{
return (ResourceLoader.load(_arg1));
}
}
}//package fbattle7.views
Section 188
//MetaseqMesh (fbattle7.views.MetaseqMesh)
package fbattle7.views {
import flash.events.*;
import flash.utils.*;
import away3d.containers.*;
import away3d.core.base.*;
import away3d.materials.*;
import flash.net.*;
public class MetaseqMesh extends ObjectContainer3D {
public var charset:String;// = "shift_jis"
private var _materialsToLoad:int;// = 0
private var _prevDepth:int;
private var _scale:Number;// = 1
private var _matLoader:IMetaseqMaterialLoader;
public var doubleSided:Boolean;// = false
private var _prevMesh:ObjectContainer3D;
public var interactive:Boolean;// = false
private var _filename:String;
private var _materialNames:Array;
private var _materials:Dictionary;
private var _loader:URLLoader;
public function MetaseqMesh(){
_materials = new Dictionary();
}
private function parseMaterialChunk(_arg1:Array, _arg2:int):int{
var _local7:ITriangleMaterial;
var _local8:int;
var _local9:int;
var _local10:String;
var _local11:String;
var _local12:String;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:Number;
var _local3:int = getMaterialChunkLine(_arg1, _arg2);
if (_local3 == -1){
return (-1);
};
var _local4:String = _arg1[_local3];
var _local5:Number = parseInt(_local4.substr(9));
if (isNaN(_local5)){
return (-1);
};
_local3++;
_materialNames = new Array();
var _local6:int = (_local3 + int(_local5));
while (_local3 < _local6) {
_local4 = _arg1[_local3];
_local8 = _local4.indexOf("\"");
_local9 = _local4.indexOf("\"", (_local8 + 1));
_local10 = _local4.substring((_local8 + 1), _local9);
_materialNames.push(_local10);
_local11 = getParam(_local4, "tex");
if (_local11){
_local11 = _local11.substr(1, (_local11.length - 2));
_local7 = new BitmapMaterial(_matLoader.load(_local11));
} else {
_local12 = getParam(_local4, "col");
if (_local12 != null){
_local13 = _local12.match(/\d+\.\d+/g);
_local14 = (parseFloat(_local13[0]) * 0xFF);
_local15 = (parseFloat(_local13[1]) * 0xFF);
_local16 = (parseFloat(_local13[2]) * 0xFF);
_local17 = (parseFloat(_local13[3]) * 100);
_local7 = new ColorMaterial((((_local14 << 16) | (_local15 << 8)) | _local16));
} else {
_local7 = new ColorMaterial();
};
};
_materials[_local10] = _local7;
_local3++;
};
return (_local6);
}
private function loadBMPMaterial(_arg1:String):BitmapMaterial{
return (null);
}
private function loadMetasequoia():void{
_loader = new URLLoader();
_loader.dataFormat = URLLoaderDataFormat.BINARY;
_loader.addEventListener(Event.COMPLETE, completeHandler);
_loader.addEventListener(IOErrorEvent.IO_ERROR, defaultHandler);
_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, defaultHandler);
_loader.addEventListener(ProgressEvent.PROGRESS, defaultHandler);
_loader.load(new URLRequest(_filename));
}
private function defaultHandler(_arg1:Event):void{
dispatchEvent(_arg1.clone());
}
private function loadTGAMaterial(_arg1:String):BitmapMaterial{
return (null);
}
private function getObjectChunkLine(_arg1:Array, _arg2:int=0):int{
var _local3:uint = _arg2;
while (_local3 < _arg1.length) {
if (_arg1[_local3].indexOf("Object") == 0){
return (int(_local3));
};
_local3++;
};
return (-1);
}
private function buildMetasequoia(_arg1:String):void{
var _local2:Array = _arg1.split("\r\n");
var _local3:int;
_local3 = parseMaterialChunk(_local2, 0);
_prevDepth = 0;
_prevMesh = this;
while (_local3 != -1) {
_local3 = parseObjectChunk(_local2, _local3);
};
}
private function completeHandler(_arg1:Event):void{
var _local2:ByteArray = ByteArray(_loader.data);
buildMetasequoia(_local2.readMultiByte(_local2.length, charset));
dispatchEvent(_arg1.clone());
}
public function loadFromByteArray(_arg1:ByteArray, _arg2:IMetaseqMaterialLoader, _arg3:Number=1):void{
_scale = _arg3;
buildMetasequoia(_arg1.readMultiByte(_arg1.length, charset));
}
private function getMaterialChunkLine(_arg1:Array, _arg2:int=0):int{
var _local3:uint = _arg2;
while (_local3 < _arg1.length) {
if (_arg1[_local3].indexOf("Material") == 0){
return (int(_local3));
};
_local3++;
};
return (-1);
}
private function parseFace(_arg1:Array, _arg2:String, _arg3:Array, _arg4:int, _arg5:Dictionary):void{
var _local11:Vertex;
var _local12:Vertex;
var _local13:Vertex;
var _local14:Vertex;
var _local15:ITriangleMaterial;
var _local16:UV;
var _local17:UV;
var _local18:UV;
var _local19:UV;
var _local20:Face;
var _local21:int;
var _local6:String = getParam(_arg2, "V");
var _local7:String = getParam(_arg2, "M");
var _local8:String = getParam(_arg2, "UV");
var _local9:Array = ((_local6)!=null) ? _local6.match(/\d+/g) : [];
var _local10:Array = ((_local8)!=null) ? _local8.match(/-?\d+\.\d+/g) : [];
if (_local9.length == 3){
_local13 = _arg3[(parseInt(_local9[0]) + _arg4)];
_local12 = _arg3[(parseInt(_local9[1]) + _arg4)];
_local11 = _arg3[(parseInt(_local9[2]) + _arg4)];
if (_local7 != null){
_local15 = _materials[_materialNames[parseInt(_local7)]];
};
if (_local10.length != 0){
_local18 = new UV(parseFloat(_local10[0]), (1 - parseFloat(_local10[1])));
_local17 = new UV(parseFloat(_local10[2]), (1 - parseFloat(_local10[3])));
_local16 = new UV(parseFloat(_local10[4]), (1 - parseFloat(_local10[5])));
_local20 = new Face(_local11, _local12, _local13, _local15, _local16, _local17, _local18);
} else {
_local20 = new Face(_local11, _local12, _local13, _local15, new UV(0, 0), new UV(1, 0), new UV(0, 1));
};
_arg1.push(_local20);
if (_arg5["mirror"] == "1"){
_local21 = parseInt(_arg5["mirror_axis"]);
_local11 = mirrorVertex(_local11, _local21);
_local12 = mirrorVertex(_local12, _local21);
_local13 = mirrorVertex(_local13, _local21);
_arg3.push(_local11);
_arg3.push(_local12);
_arg3.push(_local13);
_local20 = new Face(_local13, _local12, _local11, _local15, _local20.uv2, _local20.uv1, _local20.uv0);
_arg1.push(_local20);
};
} else {
if (_local9.length == 4){
_local14 = _arg3[(parseInt(_local9[0]) + _arg4)];
_local13 = _arg3[(parseInt(_local9[1]) + _arg4)];
_local12 = _arg3[(parseInt(_local9[2]) + _arg4)];
_local11 = _arg3[(parseInt(_local9[3]) + _arg4)];
if (_local7 != null){
_local15 = _materials[_materialNames[parseInt(_local7)]];
};
if (_local10.length != 0){
_local19 = new UV(parseFloat(_local10[0]), (1 - parseFloat(_local10[1])));
_local18 = new UV(parseFloat(_local10[2]), (1 - parseFloat(_local10[3])));
_local17 = new UV(parseFloat(_local10[4]), (1 - parseFloat(_local10[5])));
_local16 = new UV(parseFloat(_local10[6]), (1 - parseFloat(_local10[7])));
} else {
_local19 = new UV(0, 0);
_local18 = new UV(1, 0);
_local17 = new UV(0, 1);
_local16 = new UV(1, 1);
};
_local20 = new Face(_local11, _local12, _local13, _local15, _local16, _local17, _local18);
_arg1.push(_local20);
_local20 = new Face(_local13, _local14, _local11, _local15, _local18, _local19, _local16);
_arg1.push(_local20);
if (_arg5["mirror"] == "1"){
_local21 = parseInt(_arg5["mirror_axis"]);
_local11 = mirrorVertex(_local11, _local21);
_local12 = mirrorVertex(_local12, _local21);
_local13 = mirrorVertex(_local13, _local21);
_local14 = mirrorVertex(_local14, _local21);
_arg3.push(_local11);
_arg3.push(_local12);
_arg3.push(_local13);
_arg3.push(_local14);
_local20 = new Face(_local13, _local12, _local11, _local15, _local18, _local17, _local16);
_arg1.push(_local20);
_local20 = new Face(_local11, _local14, _local13, _local15, _local16, _local19, _local18);
_arg1.push(_local20);
};
};
};
}
public function load(_arg1:String, _arg2:Number=1):void{
_filename = _arg1;
_scale = _arg2;
loadMetasequoia();
}
private function parseObjectChunk(_arg1:Array, _arg2:int):int{
var face:Face;
var depth:int;
var props:Array;
var coords:Array;
var x:Number;
var y:Number;
var z:Number;
var lines = _arg1;
var startLine = _arg2;
var l:int = getObjectChunkLine(lines, startLine);
if (l == -1){
return (-1);
};
var line:String = lines[l];
var objectName:String = line.substring(8, line.indexOf("\"", 8));
l = (l + 1);
var mesh:Mesh = new Mesh();
var vertices:Array = new Array();
var faces:Array = new Array();
var vline:int = getChunkLine(lines, "vertex", l);
if (vline == -1){
return (-1);
};
var properties:Dictionary = new Dictionary();
while (l < vline) {
line = lines[l];
props = RegExp(/^\s*([\w]+)\s+(.*)$/).exec(line);
properties[props[1]] = props[2];
l = (l + 1);
};
line = lines[l];
l = (vline + 1);
var numVertices:int = parseInt(line.substring((line.indexOf("vertex") + 7)));
var vertexEndLine:int = (l + numVertices);
var firstVertexIndex:int = vertices.length;
while (l < vertexEndLine) {
line = lines[l];
coords = line.match(/(-?\d+\.\d+)/g);
x = (parseFloat(coords[0]) * _scale);
y = (parseFloat(coords[1]) * _scale);
z = (-(parseFloat(coords[2])) * _scale);
vertices.push(new Vertex(x, y, z));
l = (l + 1);
};
l = getChunkLine(lines, "face", l);
if (l == -1){
return (-1);
};
l = (l + 1);
line = lines[l];
var numFaces:int = parseInt(line.substring((line.indexOf("face") + 5)));
var faceEndLine:int = (l + numFaces);
while (l < faceEndLine) {
if (properties["visible"] == "15"){
parseFace(faces, lines[l], vertices, firstVertexIndex, properties);
};
l = (l + 1);
};
for each (face in faces) {
mesh.addFace(face);
};
try {
depth = parseInt(properties["depth"]);
} catch(e:Error) {
depth = 0;
};
var parentMesh:ObjectContainer3D = _prevMesh;
if (depth <= 0){
parentMesh = this;
depth = 0;
} else {
while (depth <= _prevDepth) {
parentMesh = parentMesh.parent;
_prevDepth--;
};
};
var meshContainer:ObjectContainer3D = new ObjectContainer3D();
meshContainer.addChild(mesh);
parentMesh.addChild(meshContainer);
_prevMesh = meshContainer;
_prevDepth = depth;
return (l);
}
private static function mirrorVertex(_arg1:Vertex, _arg2:int):Vertex{
return (new Vertex((((_arg2 & 1))!=0) ? -(_arg1.x) : _arg1.x, (((_arg2 & 2))!=0) ? -(_arg1.y) : _arg1.y, (((_arg2 & 4))!=0) ? -(_arg1.z) : _arg1.z));
}
private static function getChunkLine(_arg1:Array, _arg2:String, _arg3:int=0):int{
var _local4:uint = _arg3;
while (_local4 < _arg1.length) {
if (_arg1[_local4].indexOf(_arg2) != -1){
return (int(_local4));
};
_local4++;
};
return (-1);
}
private static function getParam(_arg1:String, _arg2:String):String{
var _local3 = (_arg2 + "(");
var _local4:int = _local3.length;
var _local5:int = _arg1.indexOf(_local3, 0);
if (_local5 == -1){
return (null);
};
var _local6:int = _arg1.indexOf(")", (_local5 + _local4));
if (_local6 == -1){
return (null);
};
return (_arg1.substring((_local5 + _local4), _local6));
}
}
}//package fbattle7.views
Section 189
//OverDriveView (fbattle7.views.OverDriveView)
package fbattle7.views {
import net.cladv.task.*;
import fbattle7.models.*;
import flash.display.*;
import caurina.transitions.*;
import flash.utils.*;
import fbattle7.events.*;
public class OverDriveView extends Task {
private var _player:Player;
private var _lines:Dictionary;
private var _view:Sprite;
private var _parent:Sprite;
private var _generate:Boolean;
private var _counter:int;
private static const LINE_THICKNESS:Number = 20;
private static const COLOR:uint = 65408;
private static const LENGTH_LONGER:Number = 2000;
private static const INITIAL_ALPHA:Number = 0.3;
private static const LENGTH_SHORTER:Number = 600;
private static const TIME_SPAN:int = 1;
private static const LINE_TIME:Number = 1;
public function OverDriveView(_arg1:Player, _arg2:Sprite){
super(onUpdate, onDraw);
_player = _arg1;
_parent = _arg2;
_view = new Sprite();
_lines = new Dictionary();
_generate = false;
(_counter == 0);
EventBroadCaster.addEventListener(PlayerEvent.ODS_START, onODSStart);
EventBroadCaster.addEventListener(PlayerEvent.ODS_END, onODSEnd);
_parent.addChild(_view);
}
private function onODSStart(_arg1):void{
_generate = true;
}
private function onDraw(_arg1):void{
var l:Object;
var line:Object;
var angle:Number;
var y:Number;
var x:Number;
var p = _arg1;
if (((_generate) && ((_counter > TIME_SPAN)))){
_counter = 0;
line = {begin:{x:0, y:0}, end:{x:0, y:0}, alpha:INITIAL_ALPHA};
_lines[line] = line;
angle = ((Math.random() * Math.PI) * 2);
y = Math.sin(angle);
x = Math.cos(angle);
Tweener.addTween(line.begin, {time:LINE_TIME, x:(LENGTH_SHORTER * x), y:(LENGTH_SHORTER * y), transition:"linear"});
Tweener.addTween(line.end, {time:LINE_TIME, x:(LENGTH_LONGER * x), y:(LENGTH_LONGER * y), transition:"linear"});
Tweener.addTween(line, {time:LINE_TIME, alpha:0, onComplete:function ():void{
delete _lines[line];
}});
};
var g:Graphics = _view.graphics;
g.clear();
for each (l in _lines) {
g.lineStyle(LINE_THICKNESS, COLOR, l.alpha);
g.moveTo(l.begin.x, l.begin.y);
g.lineTo(l.end.x, l.end.y);
};
}
private function onUpdate(_arg1):void{
_counter++;
}
private function onODSEnd(_arg1):void{
_generate = false;
}
}
}//package fbattle7.views
Section 190
//PlayerView (fbattle7.views.PlayerView)
package fbattle7.views {
import net.cladv.task.*;
import fbattle7.models.*;
import away3d.cameras.*;
public class PlayerView extends Task {
private var _player:Player;
private var _camera3d:Camera3D;
public function PlayerView(_arg1:Player, _arg2:Camera3D){
super(null, initialDraw);
_camera3d = _arg2;
_player = _arg1;
_player.addTask(this);
}
private function initialDraw(_arg1):void{
_camera3d.x = _player.x;
_camera3d.y = _player.y;
_camera3d.z = _player.z;
_camera3d.rotationX = _player.rotationX;
_camera3d.rotationY = _player.rotationY;
_camera3d.rotationZ = _player.rotationZ;
}
}
}//package fbattle7.views
Section 191
//ResourceLoader (fbattle7.views.ResourceLoader)
package fbattle7.views {
import flash.display.*;
import flash.utils.*;
public class ResourceLoader {
private static var _032_mp3:Class = ResourceLoader__032_mp3;
private static var laity_png:Class = ResourceLoader_laity_png;
private static var _036_mp3:Class = ResourceLoader__036_mp3;
private static var _077_mp3:Class = ResourceLoader__077_mp3;
private static var _112_mp3:Class = ResourceLoader__112_mp3;
private static var _116_mp3:Class = ResourceLoader__116_mp3;
private static var _080_mp3:Class = ResourceLoader__080_mp3;
private static var AHV_mqo:Class = ResourceLoader_AHV_mqo;
private static var enemy_ods_charge_mp3:Class = ResourceLoader_enemy_ods_charge_mp3;
private static var _084_mp3:Class = ResourceLoader__084_mp3;
private static var enemy_missile_mp3:Class = ResourceLoader_enemy_missile_mp3;
private static var _043_mp3:Class = ResourceLoader__043_mp3;
private static var _088_mp3:Class = ResourceLoader__088_mp3;
private static var _002_mp3:Class = ResourceLoader__002_mp3;
private static var _047_mp3:Class = ResourceLoader__047_mp3;
private static var stage4_mp3:Class = ResourceLoader_stage4_mp3;
private static var _006_mp3:Class = ResourceLoader__006_mp3;
private static var gameover_png:Class = ResourceLoader_gameover_png;
private static var _050_mp3:Class = ResourceLoader__050_mp3;
private static var player_damage_mp3:Class = ResourceLoader_player_damage_mp3;
private static var _054_mp3:Class = ResourceLoader__054_mp3;
private static var _013_mp3:Class = ResourceLoader__013_mp3;
private static var _091_mp3:Class = ResourceLoader__091_mp3;
private static var enemy_explosion_mp3:Class = ResourceLoader_enemy_explosion_mp3;
private static var _095_mp3:Class = ResourceLoader__095_mp3;
private static var _017_mp3:Class = ResourceLoader__017_mp3;
private static var _099_mp3:Class = ResourceLoader__099_mp3;
private static var _058_mp3:Class = ResourceLoader__058_mp3;
private static var _065_mp3:Class = ResourceLoader__065_mp3;
private static var _100_mp3:Class = ResourceLoader__100_mp3;
private static var _024_mp3:Class = ResourceLoader__024_mp3;
private static var _069_mp3:Class = ResourceLoader__069_mp3;
private static var _020_mp3:Class = ResourceLoader__020_mp3;
private static var _028_mp3:Class = ResourceLoader__028_mp3;
private static var _108_mp3:Class = ResourceLoader__108_mp3;
private static var _061_mp3:Class = ResourceLoader__061_mp3;
private static var _104_mp3:Class = ResourceLoader__104_mp3;
private static var _resourceTable:Object = {F-78.mqo:F_78_mqo, HV.mqo:HV_mqo, AHV.mqo:AHV_mqo, missile.mqo:missile_mqo, skybox.jpg:skybox_jpg, cloud.png:cloud_png, land.jpg:land_jpg, gameover.png:gameover_png, title.png:title_png, laity.png:laity_png, nei.png:nei_png, player_bullet_shoot.mp3:player_bullet_shoot_mp3, player_bullet_hit.mp3:player_bullet_hit_mp3, player_ods_start.mp3:player_ods_start_mp3, player_ods_hit.mp3:player_ods_hit_mp3, player_damage.mp3:player_damage_mp3, player_bomb.mp3:player_bomb_mp3, enemy_ods_start.mp3:enemy_ods_start_mp3, enemy_ods_charge.mp3:enemy_ods_charge_mp3, enemy_bullet_a.mp3:enemy_bullet_a_mp3, enemy_bullet_b.mp3:enemy_bullet_b_mp3, enemy_explosion.mp3:enemy_explosion_mp3, enemy_missile.mp3:enemy_missile_mp3, 001.mp3:_001_mp3, 002.mp3:_002_mp3, 003.mp3:_003_mp3, 004.mp3:_004_mp3, 005.mp3:_005_mp3, 006.mp3:_006_mp3, 007.mp3:_007_mp3, 008.mp3:_008_mp3, 009.mp3:_009_mp3, 010.mp3:_010_mp3, 011.mp3:_011_mp3, 012.mp3:_012_mp3, 013.mp3:_013_mp3, 014.mp3:_014_mp3, 015.mp3:_015_mp3, 016.mp3:_016_mp3, 017.mp3:_017_mp3, 018.mp3:_018_mp3, 019.mp3:_019_mp3, 020.mp3:_020_mp3, 021.mp3:_021_mp3, 022.mp3:_022_mp3, 023.mp3:_023_mp3, 024.mp3:_024_mp3, 025.mp3:_025_mp3, 026.mp3:_026_mp3, 027.mp3:_027_mp3, 028.mp3:_028_mp3, 029.mp3:_029_mp3, 030.mp3:_030_mp3, 031.mp3:_031_mp3, 032.mp3:_032_mp3, 033.mp3:_033_mp3, 034.mp3:_034_mp3, 035.mp3:_035_mp3, 036.mp3:_036_mp3, 037.mp3:_037_mp3, 038.mp3:_038_mp3, 039.mp3:_039_mp3, 040.mp3:_040_mp3, 041.mp3:_041_mp3, 042.mp3:_042_mp3, 043.mp3:_043_mp3, 045.mp3:_045_mp3, 046.mp3:_046_mp3, 047.mp3:_047_mp3, 048.mp3:_048_mp3, 049.mp3:_049_mp3, 050.mp3:_050_mp3, 051.mp3:_051_mp3, 052.mp3:_052_mp3, 053.mp3:_053_mp3, 054.mp3:_054_mp3, 055.mp3:_055_mp3, 056.mp3:_056_mp3, 057.mp3:_057_mp3, 058.mp3:_058_mp3, 059.mp3:_059_mp3, 060.mp3:_060_mp3, 061.mp3:_061_mp3, 062.mp3:_062_mp3, 063.mp3:_063_mp3, 064.mp3:_064_mp3, 065.mp3:_065_mp3, 066.mp3:_066_mp3, 067.mp3:_067_mp3, 068.mp3:_068_mp3, 069.mp3:_069_mp3, 070.mp3:_070_mp3, 071.mp3:_071_mp3, 072.mp3:_072_mp3, 074.mp3:_074_mp3, 075.mp3:_075_mp3, 076.mp3:_076_mp3, 077.mp3:_077_mp3, 078.mp3:_078_mp3, 079.mp3:_079_mp3, 080.mp3:_080_mp3, 081.mp3:_081_mp3, 082.mp3:_082_mp3, 083.mp3:_083_mp3, 084.mp3:_084_mp3, 085.mp3:_085_mp3, 086.mp3:_086_mp3, 087.mp3:_087_mp3, 088.mp3:_088_mp3, 089.mp3:_089_mp3, 090.mp3:_090_mp3, 091.mp3:_091_mp3, 092.mp3:_092_mp3, 093.mp3:_093_mp3, 094.mp3:_094_mp3, 095.mp3:_095_mp3, 096.mp3:_096_mp3, 097.mp3:_097_mp3, 098.mp3:_098_mp3, 099.mp3:_099_mp3, 100.mp3:_100_mp3, 101.mp3:_101_mp3, 102.mp3:_102_mp3, 103.mp3:_103_mp3, 104.mp3:_104_mp3, 105.mp3:_105_mp3, 106.mp3:_106_mp3, 107.mp3:_107_mp3, 108.mp3:_108_mp3, 109.mp3:_109_mp3, 110.mp3:_110_mp3, 111.mp3:_111_mp3, 112.mp3:_112_mp3, 113.mp3:_113_mp3, 114.mp3:_114_mp3, 115.mp3:_115_mp3, 116.mp3:_116_mp3, 117.mp3:_117_mp3, 118.mp3:_118_mp3, 041a.mp3:_041a_mp3, 044a.mp3:_044a_mp3, end.png:end_png, title.mp3:title_mp3, stage1.mp3:stage1_mp3, stage2.mp3:stage2_mp3, stage3.mp3:stage3_mp3, stage4.mp3:stage4_mp3, ending.mp3:ending_mp3};
private static var _072_mp3:Class = ResourceLoader__072_mp3;
private static var _031_mp3:Class = ResourceLoader__031_mp3;
private static var _076_mp3:Class = ResourceLoader__076_mp3;
private static var title_mp3:Class = ResourceLoader_title_mp3;
private static var _035_mp3:Class = ResourceLoader__035_mp3;
private static var _115_mp3:Class = ResourceLoader__115_mp3;
private static var _039_mp3:Class = ResourceLoader__039_mp3;
private static var _111_mp3:Class = ResourceLoader__111_mp3;
private static var HV_mqo:Class = ResourceLoader_HV_mqo;
private static var _cache:Dictionary = new Dictionary();
private static var _083_mp3:Class = ResourceLoader__083_mp3;
private static var _042_mp3:Class = ResourceLoader__042_mp3;
private static var _087_mp3:Class = ResourceLoader__087_mp3;
private static var _001_mp3:Class = ResourceLoader__001_mp3;
private static var _046_mp3:Class = ResourceLoader__046_mp3;
private static var stage3_mp3:Class = ResourceLoader_stage3_mp3;
private static var _005_mp3:Class = ResourceLoader__005_mp3;
private static var _009_mp3:Class = ResourceLoader__009_mp3;
private static var missile_mqo:Class = ResourceLoader_missile_mqo;
private static var _090_mp3:Class = ResourceLoader__090_mp3;
private static var _094_mp3:Class = ResourceLoader__094_mp3;
private static var _044a_mp3:Class = ResourceLoader__044a_mp3;
private static var _012_mp3:Class = ResourceLoader__012_mp3;
private static var end_png:Class = ResourceLoader_end_png;
private static var _016_mp3:Class = ResourceLoader__016_mp3;
private static var _057_mp3:Class = ResourceLoader__057_mp3;
private static var _053_mp3:Class = ResourceLoader__053_mp3;
private static var _098_mp3:Class = ResourceLoader__098_mp3;
private static var _060_mp3:Class = ResourceLoader__060_mp3;
private static var _064_mp3:Class = ResourceLoader__064_mp3;
private static var _023_mp3:Class = ResourceLoader__023_mp3;
private static var _041a_mp3:Class = ResourceLoader__041a_mp3;
private static var _103_mp3:Class = ResourceLoader__103_mp3;
private static var _027_mp3:Class = ResourceLoader__027_mp3;
private static var _107_mp3:Class = ResourceLoader__107_mp3;
private static var _068_mp3:Class = ResourceLoader__068_mp3;
private static var player_ods_start_mp3:Class = ResourceLoader_player_ods_start_mp3;
private static var _071_mp3:Class = ResourceLoader__071_mp3;
private static var _030_mp3:Class = ResourceLoader__030_mp3;
private static var _034_mp3:Class = ResourceLoader__034_mp3;
private static var F_78_mqo:Class = ResourceLoader_F_78_mqo;
private static var _038_mp3:Class = ResourceLoader__038_mp3;
private static var _110_mp3:Class = ResourceLoader__110_mp3;
private static var _079_mp3:Class = ResourceLoader__079_mp3;
private static var _075_mp3:Class = ResourceLoader__075_mp3;
private static var _118_mp3:Class = ResourceLoader__118_mp3;
private static var _082_mp3:Class = ResourceLoader__082_mp3;
private static var _114_mp3:Class = ResourceLoader__114_mp3;
private static var cloud_png:Class = ResourceLoader_cloud_png;
private static var _086_mp3:Class = ResourceLoader__086_mp3;
private static var _045_mp3:Class = ResourceLoader__045_mp3;
private static var player_bullet_hit_mp3:Class = ResourceLoader_player_bullet_hit_mp3;
private static var _004_mp3:Class = ResourceLoader__004_mp3;
private static var _049_mp3:Class = ResourceLoader__049_mp3;
private static var _008_mp3:Class = ResourceLoader__008_mp3;
private static var skybox_jpg:Class = ResourceLoader_skybox_jpg;
private static var _041_mp3:Class = ResourceLoader__041_mp3;
private static var stage2_mp3:Class = ResourceLoader_stage2_mp3;
private static var _052_mp3:Class = ResourceLoader__052_mp3;
private static var _011_mp3:Class = ResourceLoader__011_mp3;
private static var _056_mp3:Class = ResourceLoader__056_mp3;
private static var _097_mp3:Class = ResourceLoader__097_mp3;
private static var _019_mp3:Class = ResourceLoader__019_mp3;
private static var _093_mp3:Class = ResourceLoader__093_mp3;
private static var _015_mp3:Class = ResourceLoader__015_mp3;
private static var enemy_ods_start_mp3:Class = ResourceLoader_enemy_ods_start_mp3;
private static var _063_mp3:Class = ResourceLoader__063_mp3;
private static var _022_mp3:Class = ResourceLoader__022_mp3;
private static var _067_mp3:Class = ResourceLoader__067_mp3;
private static var _102_mp3:Class = ResourceLoader__102_mp3;
private static var _026_mp3:Class = ResourceLoader__026_mp3;
private static var _106_mp3:Class = ResourceLoader__106_mp3;
private static var enemy_bullet_b_mp3:Class = ResourceLoader_enemy_bullet_b_mp3;
private static var player_bomb_mp3:Class = ResourceLoader_player_bomb_mp3;
private static var player_bullet_shoot_mp3:Class = ResourceLoader_player_bullet_shoot_mp3;
private static var _070_mp3:Class = ResourceLoader__070_mp3;
private static var _074_mp3:Class = ResourceLoader__074_mp3;
private static var _078_mp3:Class = ResourceLoader__078_mp3;
private static var _113_mp3:Class = ResourceLoader__113_mp3;
private static var _033_mp3:Class = ResourceLoader__033_mp3;
private static var land_jpg:Class = ResourceLoader_land_jpg;
private static var _117_mp3:Class = ResourceLoader__117_mp3;
private static var _037_mp3:Class = ResourceLoader__037_mp3;
private static var _081_mp3:Class = ResourceLoader__081_mp3;
private static var _040_mp3:Class = ResourceLoader__040_mp3;
private static var _085_mp3:Class = ResourceLoader__085_mp3;
private static var _089_mp3:Class = ResourceLoader__089_mp3;
private static var stage1_mp3:Class = ResourceLoader_stage1_mp3;
private static var _003_mp3:Class = ResourceLoader__003_mp3;
private static var _048_mp3:Class = ResourceLoader__048_mp3;
private static var _007_mp3:Class = ResourceLoader__007_mp3;
private static var _092_mp3:Class = ResourceLoader__092_mp3;
private static var _051_mp3:Class = ResourceLoader__051_mp3;
private static var _096_mp3:Class = ResourceLoader__096_mp3;
private static var _010_mp3:Class = ResourceLoader__010_mp3;
private static var title_png:Class = ResourceLoader_title_png;
private static var _014_mp3:Class = ResourceLoader__014_mp3;
private static var _018_mp3:Class = ResourceLoader__018_mp3;
private static var _059_mp3:Class = ResourceLoader__059_mp3;
private static var _055_mp3:Class = ResourceLoader__055_mp3;
private static var _062_mp3:Class = ResourceLoader__062_mp3;
private static var ending_mp3:Class = ResourceLoader_ending_mp3;
private static var _021_mp3:Class = ResourceLoader__021_mp3;
private static var _066_mp3:Class = ResourceLoader__066_mp3;
private static var _101_mp3:Class = ResourceLoader__101_mp3;
private static var player_ods_hit_mp3:Class = ResourceLoader_player_ods_hit_mp3;
private static var _029_mp3:Class = ResourceLoader__029_mp3;
private static var enemy_bullet_a_mp3:Class = ResourceLoader_enemy_bullet_a_mp3;
private static var _105_mp3:Class = ResourceLoader__105_mp3;
private static var _109_mp3:Class = ResourceLoader__109_mp3;
private static var _025_mp3:Class = ResourceLoader__025_mp3;
private static var nei_png:Class = ResourceLoader_nei_png;
public static function load(_arg1:String, _arg2:Boolean=false){
var _local3:*;
if ((((_arg1 in _cache)) && (!(_arg2)))){
if ((_cache[_arg1] is ByteArray)){
_cache[_arg1].position = 0;
};
return (_cache[_arg1]);
};
if ((_arg1 in _resourceTable)){
_local3 = new (_resourceTable[_arg1]);
if ((_local3 is Bitmap)){
_cache[_arg1] = _local3.bitmapData;
} else {
_cache[_arg1] = _local3;
};
} else {
return (null);
};
return (_cache[_arg1]);
}
public static function clearCache():void{
var _local1:*;
for (_local1 in _cache) {
if ((_cache[_local1] is BitmapData)){
_cache[_local1].dispose();
};
delete _cache[_local1];
};
}
}
}//package fbattle7.views
Section 192
//ResourceLoader__001_mp3 (fbattle7.views.ResourceLoader__001_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__001_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 193
//ResourceLoader__002_mp3 (fbattle7.views.ResourceLoader__002_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__002_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 194
//ResourceLoader__003_mp3 (fbattle7.views.ResourceLoader__003_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__003_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 195
//ResourceLoader__004_mp3 (fbattle7.views.ResourceLoader__004_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__004_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 196
//ResourceLoader__005_mp3 (fbattle7.views.ResourceLoader__005_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__005_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 197
//ResourceLoader__006_mp3 (fbattle7.views.ResourceLoader__006_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__006_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 198
//ResourceLoader__007_mp3 (fbattle7.views.ResourceLoader__007_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__007_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 199
//ResourceLoader__008_mp3 (fbattle7.views.ResourceLoader__008_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__008_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 200
//ResourceLoader__009_mp3 (fbattle7.views.ResourceLoader__009_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__009_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 201
//ResourceLoader__010_mp3 (fbattle7.views.ResourceLoader__010_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__010_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 202
//ResourceLoader__011_mp3 (fbattle7.views.ResourceLoader__011_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__011_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 203
//ResourceLoader__012_mp3 (fbattle7.views.ResourceLoader__012_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__012_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 204
//ResourceLoader__013_mp3 (fbattle7.views.ResourceLoader__013_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__013_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 205
//ResourceLoader__014_mp3 (fbattle7.views.ResourceLoader__014_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__014_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 206
//ResourceLoader__015_mp3 (fbattle7.views.ResourceLoader__015_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__015_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 207
//ResourceLoader__016_mp3 (fbattle7.views.ResourceLoader__016_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__016_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 208
//ResourceLoader__017_mp3 (fbattle7.views.ResourceLoader__017_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__017_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 209
//ResourceLoader__018_mp3 (fbattle7.views.ResourceLoader__018_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__018_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 210
//ResourceLoader__019_mp3 (fbattle7.views.ResourceLoader__019_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__019_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 211
//ResourceLoader__020_mp3 (fbattle7.views.ResourceLoader__020_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__020_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 212
//ResourceLoader__021_mp3 (fbattle7.views.ResourceLoader__021_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__021_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 213
//ResourceLoader__022_mp3 (fbattle7.views.ResourceLoader__022_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__022_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 214
//ResourceLoader__023_mp3 (fbattle7.views.ResourceLoader__023_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__023_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 215
//ResourceLoader__024_mp3 (fbattle7.views.ResourceLoader__024_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__024_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 216
//ResourceLoader__025_mp3 (fbattle7.views.ResourceLoader__025_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__025_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 217
//ResourceLoader__026_mp3 (fbattle7.views.ResourceLoader__026_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__026_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 218
//ResourceLoader__027_mp3 (fbattle7.views.ResourceLoader__027_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__027_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 219
//ResourceLoader__028_mp3 (fbattle7.views.ResourceLoader__028_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__028_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 220
//ResourceLoader__029_mp3 (fbattle7.views.ResourceLoader__029_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__029_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 221
//ResourceLoader__030_mp3 (fbattle7.views.ResourceLoader__030_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__030_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 222
//ResourceLoader__031_mp3 (fbattle7.views.ResourceLoader__031_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__031_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 223
//ResourceLoader__032_mp3 (fbattle7.views.ResourceLoader__032_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__032_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 224
//ResourceLoader__033_mp3 (fbattle7.views.ResourceLoader__033_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__033_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 225
//ResourceLoader__034_mp3 (fbattle7.views.ResourceLoader__034_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__034_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 226
//ResourceLoader__035_mp3 (fbattle7.views.ResourceLoader__035_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__035_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 227
//ResourceLoader__036_mp3 (fbattle7.views.ResourceLoader__036_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__036_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 228
//ResourceLoader__037_mp3 (fbattle7.views.ResourceLoader__037_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__037_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 229
//ResourceLoader__038_mp3 (fbattle7.views.ResourceLoader__038_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__038_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 230
//ResourceLoader__039_mp3 (fbattle7.views.ResourceLoader__039_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__039_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 231
//ResourceLoader__040_mp3 (fbattle7.views.ResourceLoader__040_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__040_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 232
//ResourceLoader__041_mp3 (fbattle7.views.ResourceLoader__041_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__041_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 233
//ResourceLoader__041a_mp3 (fbattle7.views.ResourceLoader__041a_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__041a_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 234
//ResourceLoader__042_mp3 (fbattle7.views.ResourceLoader__042_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__042_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 235
//ResourceLoader__043_mp3 (fbattle7.views.ResourceLoader__043_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__043_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 236
//ResourceLoader__044a_mp3 (fbattle7.views.ResourceLoader__044a_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__044a_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 237
//ResourceLoader__045_mp3 (fbattle7.views.ResourceLoader__045_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__045_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 238
//ResourceLoader__046_mp3 (fbattle7.views.ResourceLoader__046_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__046_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 239
//ResourceLoader__047_mp3 (fbattle7.views.ResourceLoader__047_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__047_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 240
//ResourceLoader__048_mp3 (fbattle7.views.ResourceLoader__048_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__048_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 241
//ResourceLoader__049_mp3 (fbattle7.views.ResourceLoader__049_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__049_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 242
//ResourceLoader__050_mp3 (fbattle7.views.ResourceLoader__050_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__050_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 243
//ResourceLoader__051_mp3 (fbattle7.views.ResourceLoader__051_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__051_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 244
//ResourceLoader__052_mp3 (fbattle7.views.ResourceLoader__052_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__052_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 245
//ResourceLoader__053_mp3 (fbattle7.views.ResourceLoader__053_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__053_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 246
//ResourceLoader__054_mp3 (fbattle7.views.ResourceLoader__054_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__054_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 247
//ResourceLoader__055_mp3 (fbattle7.views.ResourceLoader__055_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__055_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 248
//ResourceLoader__056_mp3 (fbattle7.views.ResourceLoader__056_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__056_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 249
//ResourceLoader__057_mp3 (fbattle7.views.ResourceLoader__057_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__057_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 250
//ResourceLoader__058_mp3 (fbattle7.views.ResourceLoader__058_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__058_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 251
//ResourceLoader__059_mp3 (fbattle7.views.ResourceLoader__059_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__059_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 252
//ResourceLoader__060_mp3 (fbattle7.views.ResourceLoader__060_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__060_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 253
//ResourceLoader__061_mp3 (fbattle7.views.ResourceLoader__061_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__061_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 254
//ResourceLoader__062_mp3 (fbattle7.views.ResourceLoader__062_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__062_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 255
//ResourceLoader__063_mp3 (fbattle7.views.ResourceLoader__063_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__063_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 256
//ResourceLoader__064_mp3 (fbattle7.views.ResourceLoader__064_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__064_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 257
//ResourceLoader__065_mp3 (fbattle7.views.ResourceLoader__065_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__065_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 258
//ResourceLoader__066_mp3 (fbattle7.views.ResourceLoader__066_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__066_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 259
//ResourceLoader__067_mp3 (fbattle7.views.ResourceLoader__067_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__067_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 260
//ResourceLoader__068_mp3 (fbattle7.views.ResourceLoader__068_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__068_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 261
//ResourceLoader__069_mp3 (fbattle7.views.ResourceLoader__069_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__069_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 262
//ResourceLoader__070_mp3 (fbattle7.views.ResourceLoader__070_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__070_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 263
//ResourceLoader__071_mp3 (fbattle7.views.ResourceLoader__071_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__071_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 264
//ResourceLoader__072_mp3 (fbattle7.views.ResourceLoader__072_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__072_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 265
//ResourceLoader__074_mp3 (fbattle7.views.ResourceLoader__074_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__074_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 266
//ResourceLoader__075_mp3 (fbattle7.views.ResourceLoader__075_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__075_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 267
//ResourceLoader__076_mp3 (fbattle7.views.ResourceLoader__076_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__076_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 268
//ResourceLoader__077_mp3 (fbattle7.views.ResourceLoader__077_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__077_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 269
//ResourceLoader__078_mp3 (fbattle7.views.ResourceLoader__078_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__078_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 270
//ResourceLoader__079_mp3 (fbattle7.views.ResourceLoader__079_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__079_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 271
//ResourceLoader__080_mp3 (fbattle7.views.ResourceLoader__080_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__080_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 272
//ResourceLoader__081_mp3 (fbattle7.views.ResourceLoader__081_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__081_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 273
//ResourceLoader__082_mp3 (fbattle7.views.ResourceLoader__082_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__082_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 274
//ResourceLoader__083_mp3 (fbattle7.views.ResourceLoader__083_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__083_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 275
//ResourceLoader__084_mp3 (fbattle7.views.ResourceLoader__084_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__084_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 276
//ResourceLoader__085_mp3 (fbattle7.views.ResourceLoader__085_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__085_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 277
//ResourceLoader__086_mp3 (fbattle7.views.ResourceLoader__086_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__086_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 278
//ResourceLoader__087_mp3 (fbattle7.views.ResourceLoader__087_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__087_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 279
//ResourceLoader__088_mp3 (fbattle7.views.ResourceLoader__088_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__088_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 280
//ResourceLoader__089_mp3 (fbattle7.views.ResourceLoader__089_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__089_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 281
//ResourceLoader__090_mp3 (fbattle7.views.ResourceLoader__090_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__090_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 282
//ResourceLoader__091_mp3 (fbattle7.views.ResourceLoader__091_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__091_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 283
//ResourceLoader__092_mp3 (fbattle7.views.ResourceLoader__092_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__092_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 284
//ResourceLoader__093_mp3 (fbattle7.views.ResourceLoader__093_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__093_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 285
//ResourceLoader__094_mp3 (fbattle7.views.ResourceLoader__094_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__094_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 286
//ResourceLoader__095_mp3 (fbattle7.views.ResourceLoader__095_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__095_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 287
//ResourceLoader__096_mp3 (fbattle7.views.ResourceLoader__096_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__096_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 288
//ResourceLoader__097_mp3 (fbattle7.views.ResourceLoader__097_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__097_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 289
//ResourceLoader__098_mp3 (fbattle7.views.ResourceLoader__098_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__098_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 290
//ResourceLoader__099_mp3 (fbattle7.views.ResourceLoader__099_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__099_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 291
//ResourceLoader__100_mp3 (fbattle7.views.ResourceLoader__100_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__100_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 292
//ResourceLoader__101_mp3 (fbattle7.views.ResourceLoader__101_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__101_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 293
//ResourceLoader__102_mp3 (fbattle7.views.ResourceLoader__102_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__102_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 294
//ResourceLoader__103_mp3 (fbattle7.views.ResourceLoader__103_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__103_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 295
//ResourceLoader__104_mp3 (fbattle7.views.ResourceLoader__104_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__104_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 296
//ResourceLoader__105_mp3 (fbattle7.views.ResourceLoader__105_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__105_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 297
//ResourceLoader__106_mp3 (fbattle7.views.ResourceLoader__106_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__106_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 298
//ResourceLoader__107_mp3 (fbattle7.views.ResourceLoader__107_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__107_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 299
//ResourceLoader__108_mp3 (fbattle7.views.ResourceLoader__108_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__108_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 300
//ResourceLoader__109_mp3 (fbattle7.views.ResourceLoader__109_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__109_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 301
//ResourceLoader__110_mp3 (fbattle7.views.ResourceLoader__110_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__110_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 302
//ResourceLoader__111_mp3 (fbattle7.views.ResourceLoader__111_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__111_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 303
//ResourceLoader__112_mp3 (fbattle7.views.ResourceLoader__112_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__112_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 304
//ResourceLoader__113_mp3 (fbattle7.views.ResourceLoader__113_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__113_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 305
//ResourceLoader__114_mp3 (fbattle7.views.ResourceLoader__114_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__114_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 306
//ResourceLoader__115_mp3 (fbattle7.views.ResourceLoader__115_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__115_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 307
//ResourceLoader__116_mp3 (fbattle7.views.ResourceLoader__116_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__116_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 308
//ResourceLoader__117_mp3 (fbattle7.views.ResourceLoader__117_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__117_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 309
//ResourceLoader__118_mp3 (fbattle7.views.ResourceLoader__118_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader__118_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 310
//ResourceLoader_AHV_mqo (fbattle7.views.ResourceLoader_AHV_mqo)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_AHV_mqo extends ByteArrayAsset {
}
}//package fbattle7.views
Section 311
//ResourceLoader_cloud_png (fbattle7.views.ResourceLoader_cloud_png)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_cloud_png extends BitmapAsset {
}
}//package fbattle7.views
Section 312
//ResourceLoader_end_png (fbattle7.views.ResourceLoader_end_png)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_end_png extends BitmapAsset {
}
}//package fbattle7.views
Section 313
//ResourceLoader_ending_mp3 (fbattle7.views.ResourceLoader_ending_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_ending_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 314
//ResourceLoader_enemy_bullet_a_mp3 (fbattle7.views.ResourceLoader_enemy_bullet_a_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_enemy_bullet_a_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 315
//ResourceLoader_enemy_bullet_b_mp3 (fbattle7.views.ResourceLoader_enemy_bullet_b_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_enemy_bullet_b_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 316
//ResourceLoader_enemy_explosion_mp3 (fbattle7.views.ResourceLoader_enemy_explosion_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_enemy_explosion_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 317
//ResourceLoader_enemy_missile_mp3 (fbattle7.views.ResourceLoader_enemy_missile_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_enemy_missile_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 318
//ResourceLoader_enemy_ods_charge_mp3 (fbattle7.views.ResourceLoader_enemy_ods_charge_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_enemy_ods_charge_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 319
//ResourceLoader_enemy_ods_start_mp3 (fbattle7.views.ResourceLoader_enemy_ods_start_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_enemy_ods_start_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 320
//ResourceLoader_F_78_mqo (fbattle7.views.ResourceLoader_F_78_mqo)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_F_78_mqo extends ByteArrayAsset {
}
}//package fbattle7.views
Section 321
//ResourceLoader_gameover_png (fbattle7.views.ResourceLoader_gameover_png)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_gameover_png extends BitmapAsset {
}
}//package fbattle7.views
Section 322
//ResourceLoader_HV_mqo (fbattle7.views.ResourceLoader_HV_mqo)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_HV_mqo extends ByteArrayAsset {
}
}//package fbattle7.views
Section 323
//ResourceLoader_laity_png (fbattle7.views.ResourceLoader_laity_png)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_laity_png extends BitmapAsset {
}
}//package fbattle7.views
Section 324
//ResourceLoader_land_jpg (fbattle7.views.ResourceLoader_land_jpg)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_land_jpg extends BitmapAsset {
}
}//package fbattle7.views
Section 325
//ResourceLoader_missile_mqo (fbattle7.views.ResourceLoader_missile_mqo)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_missile_mqo extends ByteArrayAsset {
}
}//package fbattle7.views
Section 326
//ResourceLoader_nei_png (fbattle7.views.ResourceLoader_nei_png)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_nei_png extends BitmapAsset {
}
}//package fbattle7.views
Section 327
//ResourceLoader_player_bomb_mp3 (fbattle7.views.ResourceLoader_player_bomb_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_player_bomb_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 328
//ResourceLoader_player_bullet_hit_mp3 (fbattle7.views.ResourceLoader_player_bullet_hit_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_player_bullet_hit_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 329
//ResourceLoader_player_bullet_shoot_mp3 (fbattle7.views.ResourceLoader_player_bullet_shoot_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_player_bullet_shoot_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 330
//ResourceLoader_player_damage_mp3 (fbattle7.views.ResourceLoader_player_damage_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_player_damage_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 331
//ResourceLoader_player_ods_hit_mp3 (fbattle7.views.ResourceLoader_player_ods_hit_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_player_ods_hit_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 332
//ResourceLoader_player_ods_start_mp3 (fbattle7.views.ResourceLoader_player_ods_start_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_player_ods_start_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 333
//ResourceLoader_skybox_jpg (fbattle7.views.ResourceLoader_skybox_jpg)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_skybox_jpg extends BitmapAsset {
}
}//package fbattle7.views
Section 334
//ResourceLoader_stage1_mp3 (fbattle7.views.ResourceLoader_stage1_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_stage1_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 335
//ResourceLoader_stage2_mp3 (fbattle7.views.ResourceLoader_stage2_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_stage2_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 336
//ResourceLoader_stage3_mp3 (fbattle7.views.ResourceLoader_stage3_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_stage3_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 337
//ResourceLoader_stage4_mp3 (fbattle7.views.ResourceLoader_stage4_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_stage4_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 338
//ResourceLoader_title_mp3 (fbattle7.views.ResourceLoader_title_mp3)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_title_mp3 extends SoundAsset {
}
}//package fbattle7.views
Section 339
//ResourceLoader_title_png (fbattle7.views.ResourceLoader_title_png)
package fbattle7.views {
import mx.core.*;
public class ResourceLoader_title_png extends BitmapAsset {
}
}//package fbattle7.views
Section 340
//ShakeView (fbattle7.views.ShakeView)
package fbattle7.views {
import net.cladv.task.*;
import flash.display.*;
public class ShakeView extends Task {
private var _baseX:Number;
private var _baseY:Number;
private var _screen:Sprite;
private var _counter:int;
private static const SHAKE_WIDTH:Number = 20;
private static const SHAKE_TIME:int = 3;
public function ShakeView(_arg1:Sprite){
super(onUpdate, onDraw);
_counter = 0;
_screen = _arg1;
_baseX = _arg1.x;
_baseY = _arg1.y;
}
private function onDraw(_arg1):void{
if (_counter >= SHAKE_TIME){
_counter = 0;
_screen.x = (((2 * (Math.random() - 0.5)) * SHAKE_WIDTH) + _baseX);
_screen.y = (((2 * (Math.random() - 0.5)) * SHAKE_WIDTH) + _baseY);
};
}
private function onUpdate(_arg1):void{
_counter++;
}
}
}//package fbattle7.views
Section 341
//SkyboxView (fbattle7.views.SkyboxView)
package fbattle7.views {
import net.cladv.task.*;
import flash.display.*;
import away3d.containers.*;
import away3d.primitives.*;
import away3d.cameras.*;
import away3d.materials.*;
public class SkyboxView extends Task {
private var _model:Skybox6;
private var _camera:Camera3D;
private var _scene:Scene3D;
public function SkyboxView(_arg1:BitmapData, _arg2:Camera3D, _arg3:Scene3D){
super(null, onDraw);
_camera = _arg2;
_scene = _arg3;
_model = new Skybox6(new BitmapMaterial(_arg1, {precision:4, smooth:true}));
_scene.addChild(_model);
}
public function onDraw(_arg1):void{
_model.x = _camera.x;
_model.y = _camera.y;
_model.z = _camera.z;
}
}
}//package fbattle7.views
Section 342
//SoundEffectView (fbattle7.views.SoundEffectView)
package fbattle7.views {
import fbattle7.models.*;
import flash.utils.*;
import fbattle7.events.*;
public class SoundEffectView {
private var _soundTransforms:Dictionary;
public function SoundEffectView(){
_soundTransforms = new Dictionary();
}
private function onShootBulletB(_arg1):void{
ResourceLoader.load("enemy_bullet_b.mp3").play();
}
private function onPlayerShootWeapon(_arg1):void{
ResourceLoader.load("player_bullet_shoot.mp3").play();
}
private function onODSStart(_arg1):void{
ResourceLoader.load("enemy_ods_start.mp3").play();
}
private function onPlayerODSStart(_arg1):void{
ResourceLoader.load("player_ods_start.mp3").play();
}
private function onShootMissile(_arg1):void{
ResourceLoader.load("enemy_missile.mp3").play();
}
private function stopAndPlay(_arg1:String):void{
if ((_arg1 in _soundTransforms)){
_soundTransforms[_arg1].stop;
};
_soundTransforms[_arg1] = ResourceLoader.load(_arg1).play();
}
public function connect():void{
var _local2 = EventBroadCaster;
with (_local2) {
addEventListener(PlayerEvent.HIT_ON_BULLET, onPlayerHitOn);
addEventListener(PlayerEvent.HIT_ON_ENEMY, onPlayerHitOn);
addEventListener(PlayerEvent.ODS_START, onPlayerODSStart);
addEventListener(PlayerEvent.ODS_HIT, onPlayerODSHit);
addEventListener(PlayerEvent.SHOOT_WEAPON, onPlayerShootWeapon);
addEventListener(PlayerEvent.BULLET_HIT, onPlayerBulletHit);
addEventListener(EnemyEvent.SHOOT_BULLET_A, onShootBulletA);
addEventListener(EnemyEvent.SHOOT_BULLET_B, onShootBulletB);
addEventListener(EnemyEvent.SHOOT_MISSILE, onShootMissile);
addEventListener(EnemyEvent.ODS_CHARGE, onODSCharge);
addEventListener(EnemyEvent.ODS_START, onODSStart);
addEventListener(EnemyEvent.DESTROY, onDestroy);
};
}
private function onPlayerBulletHit(_arg1):void{
ResourceLoader.load("player_bullet_hit.mp3").play();
}
private function onPlayerHitOn(_arg1):void{
ResourceLoader.load("player_damage.mp3").play();
}
private function onPlayerODSHit(_arg1):void{
ResourceLoader.load("player_ods_hit.mp3").play();
}
private function onODSCharge(_arg1):void{
ResourceLoader.load("enemy_ods_charge.mp3").play();
}
private function onDestroy(_arg1):void{
ResourceLoader.load("enemy_explosion.mp3").play();
}
private function onShootBulletA(_arg1):void{
ResourceLoader.load("enemy_bullet_a.mp3").play();
}
}
}//package fbattle7.views
Section 343
//SubWeaponBulletExplosion (fbattle7.views.SubWeaponBulletExplosion)
package fbattle7.views {
import net.cladv.task.*;
import flash.display.*;
import caurina.transitions.*;
import away3d.containers.*;
import away3d.sprites.*;
public class SubWeaponBulletExplosion extends Task {
public var radius:Number;
private var _mcSprite:MovieClipSprite;
private var _scene:Scene3D;
public var alpha:Number;
public static const COLOR:uint = 16363682;
public function SubWeaponBulletExplosion(_arg1:Scene3D, _arg2:Number, _arg3:Number, _arg4:Number){
super(null, onDraw);
alpha = 0.5;
radius = 0;
_scene = _arg1;
_mcSprite = new MovieClipSprite(new Sprite(), {x:_arg2, y:_arg3, z:_arg4, rescale:true});
_arg1.addChild(_mcSprite);
Tweener.addTween(this, {time:0.7, alpha:0, radius:100, transition:"easeInQuart", onComplete:onComplete});
}
private function onDraw(_arg1):void{
var _local2:Sprite = (_mcSprite.movieclip as Sprite);
var _local3:Graphics = _local2.graphics;
_local3.clear();
_local3.lineStyle(0, COLOR, alpha);
_local3.beginFill(COLOR, alpha);
_local3.drawCircle(radius, radius, radius);
_local3.endFill();
}
private function onComplete():void{
_scene.removeChild(_mcSprite);
kill();
}
}
}//package fbattle7.views
Section 344
//Vector3 (fbattle7.views.Vector3)
package fbattle7.views {
import away3d.core.math.*;
public class Vector3 {
public var y:Number;
public var x:Number;
public var z:Number;
public static const Z_AXIS:Vector3 = new Vector3(0, 0, 1);
;
private static var num3d0:Number3D = new Number3D();
private static var num3d1:Number3D = new Number3D();
public function Vector3(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0){
x = _arg1;
y = _arg2;
z = _arg3;
}
public function sub(_arg1:Vector3, _arg2:Vector3):void{
x = (_arg1.x - _arg2.x);
y = (_arg1.y - _arg2.y);
z = (_arg1.z - _arg2.z);
}
public function add(_arg1:Vector3, _arg2:Vector3):void{
x = (_arg1.x + _arg2.x);
y = (_arg1.y + _arg2.y);
z = (_arg1.z + _arg2.z);
}
public function limitLength(_arg1:Vector3, _arg2:Number):void{
var _local3:Number = _arg1.length();
if (_local3 > _arg2){
scale(_arg1, (_arg2 / _local3));
} else {
setVector3(_arg1);
};
}
public function lengthSq():Number{
return ((((x * x) + (y * y)) + (z * z)));
}
public function length():Number{
return (Math.sqrt((((x * x) + (y * y)) + (z * z))));
}
public function cross(_arg1:Vector3, _arg2:Vector3):void{
x = ((_arg2.y * _arg1.z) - (_arg2.z * _arg1.y));
y = ((_arg2.z * _arg1.x) - (_arg2.x * _arg1.z));
z = ((_arg2.x * _arg1.y) - (_arg2.y * _arg1.x));
}
public function dot(_arg1:Vector3):Number{
return ((((x * _arg1.x) + (y * _arg1.y)) + (z * _arg1.z)));
}
public function scale(_arg1:Vector3, _arg2:Number):void{
x = (_arg1.x * _arg2);
y = (_arg1.y * _arg2);
z = (_arg1.z * _arg2);
}
public function toString():String{
return (((((String((int((x * 1000)) / 1000)) + " ") + String((int((y * 1000)) / 1000))) + " ") + String((int((z * 1000)) / 1000))));
}
public function normalize(_arg1:Vector3):Boolean{
var _local2:Number = _arg1.length();
if (_local2 == 0){
return (false);
};
x = (_arg1.x / _local2);
y = (_arg1.y / _local2);
z = (_arg1.z / _local2);
return (true);
}
public function setVector3(_arg1:Vector3):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):void{
x = _arg1;
y = _arg2;
z = _arg3;
}
public function normalizeSelf():Boolean{
return (normalize(this));
}
public function isZero():Boolean{
return ((((((x == 0)) && ((y == 0)))) && ((z == 0))));
}
public function scaleSelf(_arg1:Number):void{
scale(this, _arg1);
}
public function rotate(_arg1:Vector3, _arg2:Matrix4):void{
num3d0.x = _arg1.x;
num3d0.y = _arg1.y;
num3d0.z = _arg1.z;
num3d1.rotate(num3d0, _arg2._impl);
x = num3d1.x;
y = num3d1.y;
z = num3d1.z;
}
public function addSelf(_arg1:Vector3):void{
add(this, _arg1);
}
}
}//package fbattle7.views
Section 345
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 346
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 347
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 348
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 349
//FlexLoader (mx.core.FlexLoader)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexLoader extends Loader {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexLoader(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 350
//FlexShape (mx.core.FlexShape)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexShape extends Shape {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexShape(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 351
//FlexVersion (mx.core.FlexVersion)
package mx.core {
import mx.resources.*;
public class FlexVersion {
public static const VERSION_2_0_1:uint = 33554433;
public static const CURRENT_VERSION:uint = 50331648;
public static const VERSION_3_0:uint = 50331648;
public static const VERSION_2_0:uint = 33554432;
public static const VERSION_ALREADY_READ:String = "versionAlreadyRead";
public static const VERSION_ALREADY_SET:String = "versionAlreadySet";
mx_internal static const VERSION:String = "3.0.0.0";
private static var compatibilityVersionChanged:Boolean = false;
private static var _compatibilityErrorFunction:Function;
private static var _compatibilityVersion:uint = 50331648;
private static var compatibilityVersionRead:Boolean = false;
mx_internal static function changeCompatibilityVersionString(_arg1:String):void{
var _local2:Array = _arg1.split(".");
var _local3:uint = parseInt(_local2[0]);
var _local4:uint = parseInt(_local2[1]);
var _local5:uint = parseInt(_local2[2]);
_compatibilityVersion = (((_local3 << 24) + (_local4 << 16)) + _local5);
}
public static function set compatibilityVersion(_arg1:uint):void{
var _local2:String;
if (_arg1 == _compatibilityVersion){
return;
};
if (compatibilityVersionChanged){
if (compatibilityErrorFunction == null){
_local2 = ResourceManager.getInstance().getString("core", VERSION_ALREADY_SET);
throw (new Error(_local2));
};
compatibilityErrorFunction(_arg1, VERSION_ALREADY_SET);
};
if (compatibilityVersionRead){
if (compatibilityErrorFunction == null){
_local2 = ResourceManager.getInstance().getString("core", VERSION_ALREADY_READ);
throw (new Error(_local2));
};
compatibilityErrorFunction(_arg1, VERSION_ALREADY_READ);
};
_compatibilityVersion = _arg1;
compatibilityVersionChanged = true;
}
public static function get compatibilityVersion():uint{
compatibilityVersionRead = true;
return (_compatibilityVersion);
}
public static function set compatibilityErrorFunction(_arg1:Function):void{
_compatibilityErrorFunction = _arg1;
}
public static function set compatibilityVersionString(_arg1:String):void{
var _local2:Array = _arg1.split(".");
var _local3:uint = parseInt(_local2[0]);
var _local4:uint = parseInt(_local2[1]);
var _local5:uint = parseInt(_local2[2]);
compatibilityVersion = (((_local3 << 24) + (_local4 << 16)) + _local5);
}
public static function get compatibilityErrorFunction():Function{
return (_compatibilityErrorFunction);
}
public static function get compatibilityVersionString():String{
var _local1:uint = ((compatibilityVersion >> 24) & 0xFF);
var _local2:uint = ((compatibilityVersion >> 16) & 0xFF);
var _local3:uint = (compatibilityVersion & 0xFFFF);
return (((((_local1.toString() + ".") + _local2.toString()) + ".") + _local3.toString()));
}
}
}//package mx.core
Section 352
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 353
//IButton (mx.core.IButton)
package mx.core {
public interface IButton extends IUIComponent {
function get emphasized():Boolean;
function set emphasized(_arg1:Boolean):void;
function callLater(_arg1:Function, _arg2:Array=null):void;
}
}//package mx.core
Section 354
//IChildList (mx.core.IChildList)
package mx.core {
import flash.display.*;
import flash.geom.*;
public interface IChildList {
function get numChildren():int;
function removeChild(_arg1:DisplayObject):DisplayObject;
function getChildByName(_arg1:String):DisplayObject;
function removeChildAt(_arg1:int):DisplayObject;
function getChildIndex(_arg1:DisplayObject):int;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function getObjectsUnderPoint(_arg1:Point):Array;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function getChildAt(_arg1:int):DisplayObject;
function addChild(_arg1:DisplayObject):DisplayObject;
function contains(_arg1:DisplayObject):Boolean;
}
}//package mx.core
Section 355
//IContainer (mx.core.IContainer)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import flash.media.*;
import flash.text.*;
public interface IContainer extends IUIComponent {
function set hitArea(_arg1:Sprite):void;
function swapChildrenAt(_arg1:int, _arg2:int):void;
function getChildByName(_arg1:String):DisplayObject;
function get doubleClickEnabled():Boolean;
function get graphics():Graphics;
function get useHandCursor():Boolean;
function addChildAt(_arg1:DisplayObject, _arg2:int):DisplayObject;
function set mouseChildren(_arg1:Boolean):void;
function set creatingContentPane(_arg1:Boolean):void;
function get textSnapshot():TextSnapshot;
function getChildIndex(_arg1:DisplayObject):int;
function set doubleClickEnabled(_arg1:Boolean):void;
function getObjectsUnderPoint(_arg1:Point):Array;
function get creatingContentPane():Boolean;
function setChildIndex(_arg1:DisplayObject, _arg2:int):void;
function get soundTransform():SoundTransform;
function set useHandCursor(_arg1:Boolean):void;
function get numChildren():int;
function contains(_arg1:DisplayObject):Boolean;
function get verticalScrollPosition():Number;
function set defaultButton(_arg1:IFlexDisplayObject):void;
function swapChildren(_arg1:DisplayObject, _arg2:DisplayObject):void;
function set horizontalScrollPosition(_arg1:Number):void;
function get focusManager():IFocusManager;
function startDrag(_arg1:Boolean=false, _arg2:Rectangle=null):void;
function set mouseEnabled(_arg1:Boolean):void;
function getChildAt(_arg1:int):DisplayObject;
function set soundTransform(_arg1:SoundTransform):void;
function get tabChildren():Boolean;
function get tabIndex():int;
function set focusRect(_arg1:Object):void;
function get hitArea():Sprite;
function get mouseChildren():Boolean;
function removeChildAt(_arg1:int):DisplayObject;
function get defaultButton():IFlexDisplayObject;
function stopDrag():void;
function set tabEnabled(_arg1:Boolean):void;
function get horizontalScrollPosition():Number;
function get focusRect():Object;
function get viewMetrics():EdgeMetrics;
function set verticalScrollPosition(_arg1:Number):void;
function get dropTarget():DisplayObject;
function get mouseEnabled():Boolean;
function set tabChildren(_arg1:Boolean):void;
function set buttonMode(_arg1:Boolean):void;
function get tabEnabled():Boolean;
function get buttonMode():Boolean;
function removeChild(_arg1:DisplayObject):DisplayObject;
function set tabIndex(_arg1:int):void;
function addChild(_arg1:DisplayObject):DisplayObject;
function areInaccessibleObjectsUnderPoint(_arg1:Point):Boolean;
}
}//package mx.core
Section 356
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 357
//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 358
//IFlexModuleFactory (mx.core.IFlexModuleFactory)
package mx.core {
public interface IFlexModuleFactory {
function create(... _args):Object;
function info():Object;
}
}//package mx.core
Section 359
//IInvalidating (mx.core.IInvalidating)
package mx.core {
public interface IInvalidating {
function validateNow():void;
function invalidateSize():void;
function invalidateDisplayList():void;
function invalidateProperties():void;
}
}//package mx.core
Section 360
//IProgrammaticSkin (mx.core.IProgrammaticSkin)
package mx.core {
public interface IProgrammaticSkin {
function validateNow():void;
function validateDisplayList():void;
}
}//package mx.core
Section 361
//IRawChildrenContainer (mx.core.IRawChildrenContainer)
package mx.core {
public interface IRawChildrenContainer {
function get rawChildren():IChildList;
}
}//package mx.core
Section 362
//IRectangularBorder (mx.core.IRectangularBorder)
package mx.core {
import flash.geom.*;
public interface IRectangularBorder extends IBorder {
function get backgroundImageBounds():Rectangle;
function get hasBackgroundImage():Boolean;
function set backgroundImageBounds(_arg1:Rectangle):void;
function layoutBackgroundImage():void;
}
}//package mx.core
Section 363
//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 364
//IUIComponent (mx.core.IUIComponent)
package mx.core {
import flash.display.*;
import mx.managers.*;
public interface IUIComponent extends IFlexDisplayObject {
function set focusPane(_arg1:Sprite):void;
function get enabled():Boolean;
function set enabled(_arg1:Boolean):void;
function set isPopUp(_arg1:Boolean):void;
function get explicitMinHeight():Number;
function get percentWidth():Number;
function get isPopUp():Boolean;
function get owner():DisplayObjectContainer;
function get percentHeight():Number;
function get baselinePosition():Number;
function owns(_arg1:DisplayObject):Boolean;
function initialize():void;
function get maxWidth():Number;
function get minWidth():Number;
function getExplicitOrMeasuredWidth():Number;
function get explicitMaxWidth():Number;
function get explicitMaxHeight():Number;
function set percentHeight(_arg1:Number):void;
function get minHeight():Number;
function set percentWidth(_arg1:Number):void;
function get document():Object;
function get focusPane():Sprite;
function getExplicitOrMeasuredHeight():Number;
function set tweeningProperties(_arg1:Array):void;
function set explicitWidth(_arg1:Number):void;
function set measuredMinHeight(_arg1:Number):void;
function get explicitMinWidth():Number;
function get tweeningProperties():Array;
function get maxHeight():Number;
function set owner(_arg1:DisplayObjectContainer):void;
function set includeInLayout(_arg1:Boolean):void;
function setVisible(_arg1:Boolean, _arg2:Boolean=false):void;
function parentChanged(_arg1:DisplayObjectContainer):void;
function get explicitWidth():Number;
function get measuredMinHeight():Number;
function set measuredMinWidth(_arg1:Number):void;
function set explicitHeight(_arg1:Number):void;
function get includeInLayout():Boolean;
function get measuredMinWidth():Number;
function get explicitHeight():Number;
function set systemManager(_arg1:ISystemManager):void;
function set document(_arg1:Object):void;
function get systemManager():ISystemManager;
}
}//package mx.core
Section 365
//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 366
//Singleton (mx.core.Singleton)
package mx.core {
public class Singleton {
mx_internal static const VERSION:String = "3.0.0.0";
private static var classMap:Object = {};
public static function registerClass(_arg1:String, _arg2:Class):void{
var _local3:Class = classMap[_arg1];
if (!_local3){
classMap[_arg1] = _arg2;
};
}
public static function getClass(_arg1:String):Class{
return (classMap[_arg1]);
}
public static function getInstance(_arg1:String):Object{
var _local2:Class = classMap[_arg1];
if (!_local2){
throw (new Error((("No class registered for interface '" + _arg1) + "'.")));
};
return (_local2["getInstance"]());
}
}
}//package mx.core
Section 367
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 368
//UIComponentGlobals (mx.core.UIComponentGlobals)
package mx.core {
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
public class UIComponentGlobals {
mx_internal static var callLaterSuspendCount:int = 0;
mx_internal static var layoutManager:ILayoutManager;
mx_internal static var nextFocusObject:InteractiveObject;
mx_internal static var designTime:Boolean = false;
mx_internal static var tempMatrix:Matrix = new Matrix();
mx_internal static var callLaterDispatcherCount:int = 0;
private static var _catchCallLaterExceptions:Boolean = false;
public static function set catchCallLaterExceptions(_arg1:Boolean):void{
_catchCallLaterExceptions = _arg1;
}
public static function get designMode():Boolean{
return (designTime);
}
public static function set designMode(_arg1:Boolean):void{
designTime = _arg1;
}
public static function get catchCallLaterExceptions():Boolean{
return (_catchCallLaterExceptions);
}
}
}//package mx.core
Section 369
//ModuleEvent (mx.events.ModuleEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
import mx.modules.*;
public class ModuleEvent extends ProgressEvent {
public var errorText:String;
private var _module:IModuleInfo;
public static const READY:String = "ready";
public static const ERROR:String = "error";
public static const PROGRESS:String = "progress";
mx_internal static const VERSION:String = "3.0.0.0";
public static const SETUP:String = "setup";
public static const UNLOAD:String = "unload";
public function ModuleEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null, _arg7:IModuleInfo=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
this._module = _arg7;
}
public function get module():IModuleInfo{
if (_module){
return (_module);
};
return ((target as IModuleInfo));
}
override public function clone():Event{
return (new ModuleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText, module));
}
}
}//package mx.events
Section 370
//ResourceEvent (mx.events.ResourceEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class ResourceEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.0.0.0";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function ResourceEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
}
override public function clone():Event{
return (new ResourceEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 371
//StyleEvent (mx.events.StyleEvent)
package mx.events {
import flash.events.*;
import mx.core.*;
public class StyleEvent extends ProgressEvent {
public var errorText:String;
mx_internal static const VERSION:String = "3.0.0.0";
public static const COMPLETE:String = "complete";
public static const PROGRESS:String = "progress";
public static const ERROR:String = "error";
public function StyleEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:String=null){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
this.errorText = _arg6;
}
override public function clone():Event{
return (new StyleEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, errorText));
}
}
}//package mx.events
Section 372
//RectangularDropShadow (mx.graphics.RectangularDropShadow)
package mx.graphics {
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import mx.utils.*;
import flash.filters.*;
public class RectangularDropShadow {
private var leftShadow:BitmapData;
private var _tlRadius:Number;// = 0
private var _trRadius:Number;// = 0
private var _angle:Number;// = 45
private var topShadow:BitmapData;
private var _distance:Number;// = 4
private var rightShadow:BitmapData;
private var _alpha:Number;// = 0.4
private var shadow:BitmapData;
private var _brRadius:Number;// = 0
private var _blRadius:Number;// = 0
private var _color:int;// = 0
private var bottomShadow:BitmapData;
private var changed:Boolean;// = true
mx_internal static const VERSION:String = "3.0.0.0";
public function get blRadius():Number{
return (_blRadius);
}
public function set brRadius(_arg1:Number):void{
if (_brRadius != _arg1){
_brRadius = _arg1;
changed = true;
};
}
public function set color(_arg1:int):void{
if (_color != _arg1){
_color = _arg1;
changed = true;
};
}
public function drawShadow(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):void{
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
if (changed){
createShadowBitmaps();
changed = false;
};
_arg4 = Math.ceil(_arg4);
_arg5 = Math.ceil(_arg5);
var _local6:int = (leftShadow) ? leftShadow.width : 0;
var _local7:int = (rightShadow) ? rightShadow.width : 0;
var _local8:int = (topShadow) ? topShadow.height : 0;
var _local9:int = (bottomShadow) ? bottomShadow.height : 0;
var _local10:int = (_local6 + _local7);
var _local11:int = (_local8 + _local9);
var _local12:Number = ((_arg5 + _local11) / 2);
var _local13:Number = ((_arg4 + _local10) / 2);
var _local14:Matrix = new Matrix();
if (((leftShadow) || (topShadow))){
_local15 = Math.min((tlRadius + _local10), _local13);
_local16 = Math.min((tlRadius + _local11), _local12);
_local14.tx = (_arg2 - _local6);
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((_arg2 - _local6), (_arg3 - _local8), _local15, _local16);
_arg1.endFill();
};
if (((rightShadow) || (topShadow))){
_local17 = Math.min((trRadius + _local10), _local13);
_local18 = Math.min((trRadius + _local11), _local12);
_local14.tx = (((_arg2 + _arg4) + _local7) - shadow.width);
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((((_arg2 + _arg4) + _local7) - _local17), (_arg3 - _local8), _local17, _local18);
_arg1.endFill();
};
if (((leftShadow) || (bottomShadow))){
_local19 = Math.min((blRadius + _local10), _local13);
_local20 = Math.min((blRadius + _local11), _local12);
_local14.tx = (_arg2 - _local6);
_local14.ty = (((_arg3 + _arg5) + _local9) - shadow.height);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((_arg2 - _local6), (((_arg3 + _arg5) + _local9) - _local20), _local19, _local20);
_arg1.endFill();
};
if (((rightShadow) || (bottomShadow))){
_local21 = Math.min((brRadius + _local10), _local13);
_local22 = Math.min((brRadius + _local11), _local12);
_local14.tx = (((_arg2 + _arg4) + _local7) - shadow.width);
_local14.ty = (((_arg3 + _arg5) + _local9) - shadow.height);
_arg1.beginBitmapFill(shadow, _local14);
_arg1.drawRect((((_arg2 + _arg4) + _local7) - _local21), (((_arg3 + _arg5) + _local9) - _local22), _local21, _local22);
_arg1.endFill();
};
if (leftShadow){
_local14.tx = (_arg2 - _local6);
_local14.ty = 0;
_arg1.beginBitmapFill(leftShadow, _local14);
_arg1.drawRect((_arg2 - _local6), ((_arg3 - _local8) + _local16), _local6, ((((_arg5 + _local8) + _local9) - _local16) - _local20));
_arg1.endFill();
};
if (rightShadow){
_local14.tx = (_arg2 + _arg4);
_local14.ty = 0;
_arg1.beginBitmapFill(rightShadow, _local14);
_arg1.drawRect((_arg2 + _arg4), ((_arg3 - _local8) + _local18), _local7, ((((_arg5 + _local8) + _local9) - _local18) - _local22));
_arg1.endFill();
};
if (topShadow){
_local14.tx = 0;
_local14.ty = (_arg3 - _local8);
_arg1.beginBitmapFill(topShadow, _local14);
_arg1.drawRect(((_arg2 - _local6) + _local15), (_arg3 - _local8), ((((_arg4 + _local6) + _local7) - _local15) - _local17), _local8);
_arg1.endFill();
};
if (bottomShadow){
_local14.tx = 0;
_local14.ty = (_arg3 + _arg5);
_arg1.beginBitmapFill(bottomShadow, _local14);
_arg1.drawRect(((_arg2 - _local6) + _local19), (_arg3 + _arg5), ((((_arg4 + _local6) + _local7) - _local19) - _local21), _local9);
_arg1.endFill();
};
}
public function get brRadius():Number{
return (_brRadius);
}
public function get angle():Number{
return (_angle);
}
private function createShadowBitmaps():void{
var _local1:Number = ((Math.max(tlRadius, blRadius) + (2 * distance)) + Math.max(trRadius, brRadius));
var _local2:Number = ((Math.max(tlRadius, trRadius) + (2 * distance)) + Math.max(blRadius, brRadius));
if ((((_local1 < 0)) || ((_local2 < 0)))){
return;
};
var _local3:Shape = new FlexShape();
var _local4:Graphics = _local3.graphics;
_local4.beginFill(0xFFFFFF);
GraphicsUtil.drawRoundRectComplex(_local4, 0, 0, _local1, _local2, tlRadius, trRadius, blRadius, brRadius);
_local4.endFill();
var _local5:BitmapData = new BitmapData(_local1, _local2, true, 0);
_local5.draw(_local3, new Matrix());
var _local6:DropShadowFilter = new DropShadowFilter(distance, angle, color, alpha);
_local6.knockout = true;
var _local7:Rectangle = new Rectangle(0, 0, _local1, _local2);
var _local8:Rectangle = _local5.generateFilterRect(_local7, _local6);
var _local9:Number = (_local7.left - _local8.left);
var _local10:Number = (_local8.right - _local7.right);
var _local11:Number = (_local7.top - _local8.top);
var _local12:Number = (_local8.bottom - _local7.bottom);
shadow = new BitmapData(_local8.width, _local8.height);
shadow.applyFilter(_local5, _local7, new Point(_local9, _local11), _local6);
var _local13:Point = new Point(0, 0);
var _local14:Rectangle = new Rectangle();
if (_local9 > 0){
_local14.x = 0;
_local14.y = ((tlRadius + _local11) + _local12);
_local14.width = _local9;
_local14.height = 1;
leftShadow = new BitmapData(_local9, 1);
leftShadow.copyPixels(shadow, _local14, _local13);
} else {
leftShadow = null;
};
if (_local10 > 0){
_local14.x = (shadow.width - _local10);
_local14.y = ((trRadius + _local11) + _local12);
_local14.width = _local10;
_local14.height = 1;
rightShadow = new BitmapData(_local10, 1);
rightShadow.copyPixels(shadow, _local14, _local13);
} else {
rightShadow = null;
};
if (_local11 > 0){
_local14.x = ((tlRadius + _local9) + _local10);
_local14.y = 0;
_local14.width = 1;
_local14.height = _local11;
topShadow = new BitmapData(1, _local11);
topShadow.copyPixels(shadow, _local14, _local13);
} else {
topShadow = null;
};
if (_local12 > 0){
_local14.x = ((blRadius + _local9) + _local10);
_local14.y = (shadow.height - _local12);
_local14.width = 1;
_local14.height = _local12;
bottomShadow = new BitmapData(1, _local12);
bottomShadow.copyPixels(shadow, _local14, _local13);
} else {
bottomShadow = null;
};
}
public function get alpha():Number{
return (_alpha);
}
public function get color():int{
return (_color);
}
public function set angle(_arg1:Number):void{
if (_angle != _arg1){
_angle = _arg1;
changed = true;
};
}
public function set trRadius(_arg1:Number):void{
if (_trRadius != _arg1){
_trRadius = _arg1;
changed = true;
};
}
public function set tlRadius(_arg1:Number):void{
if (_tlRadius != _arg1){
_tlRadius = _arg1;
changed = true;
};
}
public function get trRadius():Number{
return (_trRadius);
}
public function set distance(_arg1:Number):void{
if (_distance != _arg1){
_distance = _arg1;
changed = true;
};
}
public function get distance():Number{
return (_distance);
}
public function get tlRadius():Number{
return (_tlRadius);
}
public function set alpha(_arg1:Number):void{
if (_alpha != _arg1){
_alpha = _arg1;
changed = true;
};
}
public function set blRadius(_arg1:Number):void{
if (_blRadius != _arg1){
_blRadius = _arg1;
changed = true;
};
}
}
}//package mx.graphics
Section 373
//IFocusManager (mx.managers.IFocusManager)
package mx.managers {
import mx.core.*;
import flash.display.*;
public interface IFocusManager {
function get focusPane():Sprite;
function getFocus():IFocusManagerComponent;
function deactivate():void;
function set defaultButton(_arg1:IButton):void;
function set focusPane(_arg1:Sprite):void;
function set showFocusIndicator(_arg1:Boolean):void;
function get defaultButtonEnabled():Boolean;
function findFocusManagerComponent(_arg1:InteractiveObject):IFocusManagerComponent;
function get nextTabIndex():int;
function get defaultButton():IButton;
function get showFocusIndicator():Boolean;
function setFocus(_arg1:IFocusManagerComponent):void;
function activate():void;
function showFocus():void;
function set defaultButtonEnabled(_arg1:Boolean):void;
function hideFocus():void;
function getNextFocusManagerComponent(_arg1:Boolean=false):IFocusManagerComponent;
}
}//package mx.managers
Section 374
//IFocusManagerComponent (mx.managers.IFocusManagerComponent)
package mx.managers {
public interface IFocusManagerComponent {
function set focusEnabled(_arg1:Boolean):void;
function drawFocus(_arg1:Boolean):void;
function setFocus():void;
function get focusEnabled():Boolean;
function get tabEnabled():Boolean;
function get tabIndex():int;
function get mouseFocusEnabled():Boolean;
}
}//package mx.managers
Section 375
//IFocusManagerContainer (mx.managers.IFocusManagerContainer)
package mx.managers {
import flash.events.*;
import flash.display.*;
public interface IFocusManagerContainer extends IEventDispatcher {
function set focusManager(_arg1:IFocusManager):void;
function get focusManager():IFocusManager;
function get systemManager():ISystemManager;
function contains(_arg1:DisplayObject):Boolean;
}
}//package mx.managers
Section 376
//ILayoutManager (mx.managers.ILayoutManager)
package mx.managers {
import flash.events.*;
public interface ILayoutManager extends IEventDispatcher {
function validateNow():void;
function validateClient(_arg1:ILayoutManagerClient, _arg2:Boolean=false):void;
function isInvalid():Boolean;
function invalidateDisplayList(_arg1:ILayoutManagerClient):void;
function set usePhasedInstantiation(_arg1:Boolean):void;
function invalidateSize(_arg1:ILayoutManagerClient):void;
function get usePhasedInstantiation():Boolean;
function invalidateProperties(_arg1:ILayoutManagerClient):void;
}
}//package mx.managers
Section 377
//ILayoutManagerClient (mx.managers.ILayoutManagerClient)
package mx.managers {
import flash.events.*;
public interface ILayoutManagerClient extends IEventDispatcher {
function get updateCompletePendingFlag():Boolean;
function set updateCompletePendingFlag(_arg1:Boolean):void;
function set initialized(_arg1:Boolean):void;
function validateProperties():void;
function validateDisplayList():void;
function get nestLevel():int;
function get initialized():Boolean;
function get processedDescriptors():Boolean;
function validateSize(_arg1:Boolean=false):void;
function set nestLevel(_arg1:int):void;
function set processedDescriptors(_arg1:Boolean):void;
}
}//package mx.managers
Section 378
//ISystemManager (mx.managers.ISystemManager)
package mx.managers {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public interface ISystemManager extends IEventDispatcher, IChildList, IFlexModuleFactory {
function get focusPane():Sprite;
function get loaderInfo():LoaderInfo;
function get toolTipChildren():IChildList;
function set focusPane(_arg1:Sprite):void;
function isTopLevel():Boolean;
function get popUpChildren():IChildList;
function get screen():Rectangle;
function isFontFaceEmbedded(_arg1:TextFormat):Boolean;
function get rawChildren():IChildList;
function get topLevelSystemManager():ISystemManager;
function getDefinitionByName(_arg1:String):Object;
function activate(_arg1:IFocusManagerContainer):void;
function deactivate(_arg1:IFocusManagerContainer):void;
function get cursorChildren():IChildList;
function set document(_arg1:Object):void;
function get embeddedFontList():Object;
function set numModalWindows(_arg1:int):void;
function removeFocusManager(_arg1:IFocusManagerContainer):void;
function get document():Object;
function get numModalWindows():int;
function addFocusManager(_arg1:IFocusManagerContainer):void;
function get stage():Stage;
}
}//package mx.managers
Section 379
//SystemManagerGlobals (mx.managers.SystemManagerGlobals)
package mx.managers {
public class SystemManagerGlobals {
public static var topLevelSystemManagers:Array = [];
public static var bootstrapLoaderInfoURL:String;
}
}//package mx.managers
Section 380
//IModuleInfo (mx.modules.IModuleInfo)
package mx.modules {
import flash.events.*;
import mx.core.*;
import flash.system.*;
public interface IModuleInfo extends IEventDispatcher {
function get ready():Boolean;
function get loaded():Boolean;
function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null):void;
function release():void;
function get error():Boolean;
function get data():Object;
function publish(_arg1:IFlexModuleFactory):void;
function get factory():IFlexModuleFactory;
function set data(_arg1:Object):void;
function get url():String;
function get setup():Boolean;
function unload():void;
}
}//package mx.modules
Section 381
//ModuleManager (mx.modules.ModuleManager)
package mx.modules {
import mx.core.*;
public class ModuleManager {
mx_internal static const VERSION:String = "3.0.0.0";
public static function getModule(_arg1:String):IModuleInfo{
return (getSingleton().getModule(_arg1));
}
private static function getSingleton():Object{
if (!ModuleManagerGlobals.managerSingleton){
ModuleManagerGlobals.managerSingleton = new ModuleManagerImpl();
};
return (ModuleManagerGlobals.managerSingleton);
}
public static function getAssociatedFactory(_arg1:Object):IFlexModuleFactory{
return (getSingleton().getAssociatedFactory(_arg1));
}
}
}//package mx.modules
import flash.events.*;
import mx.core.*;
import flash.system.*;
import flash.display.*;
import flash.utils.*;
import mx.events.*;
import flash.net.*;
class ModuleInfoProxy extends EventDispatcher implements IModuleInfo {
private var _data:Object;
private var info:ModuleInfo;
private var referenced:Boolean;// = false
private function ModuleInfoProxy(_arg1:ModuleInfo){
this.info = _arg1;
_arg1.addEventListener(ModuleEvent.SETUP, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.ERROR, moduleEventHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.UNLOAD, moduleEventHandler, false, 0, true);
}
public function get loaded():Boolean{
return (info.loaded);
}
public function release():void{
if (referenced){
info.removeReference();
referenced = false;
};
}
public function get error():Boolean{
return (info.error);
}
public function get factory():IFlexModuleFactory{
return (info.factory);
}
public function publish(_arg1:IFlexModuleFactory):void{
info.publish(_arg1);
}
public function set data(_arg1:Object):void{
_data = _arg1;
}
public function get ready():Boolean{
return (info.ready);
}
public function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null):void{
var _local3:ModuleEvent;
info.resurrect();
if (!referenced){
info.addReference();
referenced = true;
};
if (info.error){
dispatchEvent(new ModuleEvent(ModuleEvent.ERROR));
} else {
if (info.loaded){
if (info.setup){
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
if (info.ready){
_local3 = new ModuleEvent(ModuleEvent.PROGRESS);
_local3.bytesLoaded = info.size;
_local3.bytesTotal = info.size;
dispatchEvent(_local3);
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
};
};
} else {
info.load(_arg1, _arg2);
};
};
}
private function moduleEventHandler(_arg1:ModuleEvent):void{
dispatchEvent(_arg1);
}
public function get url():String{
return (info.url);
}
public function get data():Object{
return (_data);
}
public function get setup():Boolean{
return (info.setup);
}
public function unload():void{
info.unload();
info.removeEventListener(ModuleEvent.SETUP, moduleEventHandler);
info.removeEventListener(ModuleEvent.PROGRESS, moduleEventHandler);
info.removeEventListener(ModuleEvent.READY, moduleEventHandler);
info.removeEventListener(ModuleEvent.ERROR, moduleEventHandler);
info.removeEventListener(ModuleEvent.UNLOAD, moduleEventHandler);
}
}
class ModuleManagerImpl extends EventDispatcher {
private var moduleList:Object;
private function ModuleManagerImpl(){
moduleList = {};
super();
}
public function getModule(_arg1:String):IModuleInfo{
var _local2:ModuleInfo = (moduleList[_arg1] as ModuleInfo);
if (!_local2){
_local2 = new ModuleInfo(_arg1);
moduleList[_arg1] = _local2;
};
return (new ModuleInfoProxy(_local2));
}
public function getAssociatedFactory(_arg1:Object):IFlexModuleFactory{
var m:Object;
var info:ModuleInfo;
var domain:ApplicationDomain;
var cls:Class;
var object = _arg1;
var className:String = getQualifiedClassName(object);
for each (m in moduleList) {
info = (m as ModuleInfo);
if (!info.ready){
} else {
domain = info.applicationDomain;
try {
cls = Class(domain.getDefinition(className));
if ((object is cls)){
return (info.factory);
};
} catch(error:Error) {
};
};
};
return (null);
}
}
class ModuleInfo extends EventDispatcher {
private var _error:Boolean;// = false
private var loader:Loader;
private var factoryInfo:FactoryInfo;
private var limbo:Dictionary;
private var _loaded:Boolean;// = false
private var _ready:Boolean;// = false
private var numReferences:int;// = 0
private var _url:String;
private var _setup:Boolean;// = false
private function ModuleInfo(_arg1:String){
_url = _arg1;
}
private function clearLoader():void{
if (loader){
if (loader.contentLoaderInfo){
loader.contentLoaderInfo.removeEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
};
try {
if (loader.content){
loader.content.removeEventListener("ready", readyHandler);
};
} catch(error:Error) {
};
if (_loaded){
try {
loader.close();
} catch(error:Error) {
};
};
try {
loader.unload();
} catch(error:Error) {
};
loader = null;
};
}
public function get size():int{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.bytesTotal : 0);
}
public function get loaded():Boolean{
return ((limbo) ? false : _loaded);
}
public function release():void{
if (((_ready) && (!(limbo)))){
limbo = new Dictionary(true);
limbo[factoryInfo] = 1;
factoryInfo = null;
} else {
unload();
};
}
public function get error():Boolean{
return ((limbo) ? false : _error);
}
public function get factory():IFlexModuleFactory{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.factory : null);
}
public function completeHandler(_arg1:Event):void{
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = loader.contentLoaderInfo.bytesLoaded;
_local2.bytesTotal = loader.contentLoaderInfo.bytesTotal;
dispatchEvent(_local2);
}
public function publish(_arg1:IFlexModuleFactory):void{
if (factoryInfo){
return;
};
if (_url.indexOf("published://") != 0){
return;
};
factoryInfo = new FactoryInfo();
factoryInfo.factory = _arg1;
_loaded = true;
_setup = true;
_ready = true;
_error = false;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
dispatchEvent(new ModuleEvent(ModuleEvent.PROGRESS));
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function initHandler(_arg1:Event):void{
var moduleEvent:ModuleEvent;
var event = _arg1;
factoryInfo = new FactoryInfo();
try {
factoryInfo.factory = (loader.content as IFlexModuleFactory);
} catch(error:Error) {
};
if (!factoryInfo.factory){
moduleEvent = new ModuleEvent(ModuleEvent.ERROR, event.bubbles, event.cancelable);
moduleEvent.bytesLoaded = 0;
moduleEvent.bytesTotal = 0;
moduleEvent.errorText = "SWF is not a loadable module";
dispatchEvent(moduleEvent);
return;
};
loader.content.addEventListener("ready", readyHandler);
try {
factoryInfo.applicationDomain = loader.contentLoaderInfo.applicationDomain;
} catch(error:Error) {
};
_setup = true;
dispatchEvent(new ModuleEvent(ModuleEvent.SETUP));
}
public function resurrect():void{
var _local1:Object;
if (((!(factoryInfo)) && (limbo))){
for (_local1 in limbo) {
factoryInfo = (_local1 as FactoryInfo);
break;
};
limbo = null;
};
if (!factoryInfo){
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
loader = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
};
}
public function errorHandler(_arg1:ErrorEvent):void{
_error = true;
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = 0;
_local2.bytesTotal = 0;
_local2.errorText = _arg1.text;
dispatchEvent(_local2);
}
public function get ready():Boolean{
return ((limbo) ? false : _ready);
}
public function removeReference():void{
numReferences--;
if (numReferences == 0){
release();
};
}
public function addReference():void{
numReferences++;
}
public function progressHandler(_arg1:ProgressEvent):void{
var _local2:ModuleEvent = new ModuleEvent(ModuleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
public function load(_arg1:ApplicationDomain=null, _arg2:SecurityDomain=null):void{
if (_loaded){
return;
};
_loaded = true;
limbo = null;
if (_url.indexOf("published://") == 0){
return;
};
var _local3:URLRequest = new URLRequest(_url);
var _local4:LoaderContext = new LoaderContext();
_local4.applicationDomain = (_arg1) ? _arg1 : new ApplicationDomain(ApplicationDomain.currentDomain);
_local4.securityDomain = _arg2;
if ((((_arg2 == null)) && ((Security.sandboxType == Security.REMOTE)))){
_local4.securityDomain = SecurityDomain.currentDomain;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
loader.load(_local3, _local4);
}
public function get url():String{
return (_url);
}
public function get applicationDomain():ApplicationDomain{
return ((((!(limbo)) && (factoryInfo))) ? factoryInfo.applicationDomain : null);
}
public function readyHandler(_arg1:Event):void{
_ready = true;
factoryInfo.bytesTotal = loader.contentLoaderInfo.bytesTotal;
clearLoader();
dispatchEvent(new ModuleEvent(ModuleEvent.READY));
}
public function get setup():Boolean{
return ((limbo) ? false : _setup);
}
public function unload():void{
clearLoader();
if (_loaded){
dispatchEvent(new ModuleEvent(ModuleEvent.UNLOAD));
};
limbo = null;
factoryInfo = null;
_loaded = false;
_setup = false;
_ready = false;
_error = false;
}
}
class FactoryInfo {
public var bytesTotal:int;// = 0
public var factory:IFlexModuleFactory;
public var applicationDomain:ApplicationDomain;
private function FactoryInfo(){
}
}
Section 382
//ModuleManagerGlobals (mx.modules.ModuleManagerGlobals)
package mx.modules {
public class ModuleManagerGlobals {
public static var managerSingleton:Object = null;
}
}//package mx.modules
Section 383
//IResourceBundle (mx.resources.IResourceBundle)
package mx.resources {
public interface IResourceBundle {
function get content():Object;
function get locale():String;
function get bundleName():String;
}
}//package mx.resources
Section 384
//IResourceManager (mx.resources.IResourceManager)
package mx.resources {
import flash.events.*;
import flash.system.*;
public interface IResourceManager extends IEventDispatcher {
function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean;
function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class;
function getLocales():Array;
function removeResourceBundlesForLocale(_arg1:String):void;
function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle;
function get localeChain():Array;
function getInt(_arg1:String, _arg2:String, _arg3:String=null):int;
function update():void;
function set localeChain(_arg1:Array):void;
function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint;
function addResourceBundle(_arg1:IResourceBundle):void;
function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array;
function getBundleNamesForLocale(_arg1:String):Array;
function removeResourceBundle(_arg1:String, _arg2:String):void;
function getObject(_arg1:String, _arg2:String, _arg3:String=null);
function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String;
function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void;
function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void;
function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle;
function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number;
}
}//package mx.resources
Section 385
//IResourceModule (mx.resources.IResourceModule)
package mx.resources {
public interface IResourceModule {
function get resourceBundles():Array;
}
}//package mx.resources
Section 386
//ResourceBundle (mx.resources.ResourceBundle)
package mx.resources {
import mx.core.*;
import flash.system.*;
import mx.utils.*;
public class ResourceBundle implements IResourceBundle {
mx_internal var _locale:String;
private var _content:Object;
mx_internal var _bundleName:String;
mx_internal static const VERSION:String = "3.0.0.0";
mx_internal static var backupApplicationDomain:ApplicationDomain;
mx_internal static var locale:String;
public function ResourceBundle(_arg1:String=null, _arg2:String=null){
_content = {};
super();
mx_internal::_locale = _arg1;
mx_internal::_bundleName = _arg2;
_content = getContent();
}
protected function getContent():Object{
return ({});
}
public function getString(_arg1:String):String{
return (String(_getObject(_arg1)));
}
public function get content():Object{
return (_content);
}
public function getBoolean(_arg1:String, _arg2:Boolean=true):Boolean{
var _local3:String = _getObject(_arg1).toLowerCase();
if (_local3 == "false"){
return (false);
};
if (_local3 == "true"){
return (true);
};
return (_arg2);
}
public function getStringArray(_arg1:String):Array{
var _local2:Array = _getObject(_arg1).split(",");
var _local3:int = _local2.length;
var _local4:int;
while (_local4 < _local3) {
_local2[_local4] = StringUtil.trim(_local2[_local4]);
_local4++;
};
return (_local2);
}
public function getObject(_arg1:String):Object{
return (_getObject(_arg1));
}
private function _getObject(_arg1:String):Object{
var _local2:Object = content[_arg1];
if (!_local2){
throw (new Error(((("Key " + _arg1) + " was not found in resource bundle ") + bundleName)));
};
return (_local2);
}
public function get locale():String{
return (mx_internal::_locale);
}
public function get bundleName():String{
return (mx_internal::_bundleName);
}
public function getNumber(_arg1:String):Number{
return (Number(_getObject(_arg1)));
}
private static function getClassByName(_arg1:String, _arg2:ApplicationDomain):Class{
var _local3:Class;
if (_arg2.hasDefinition(_arg1)){
_local3 = (_arg2.getDefinition(_arg1) as Class);
};
return (_local3);
}
public static function getResourceBundle(_arg1:String, _arg2:ApplicationDomain=null):ResourceBundle{
var _local3:String;
var _local4:Class;
var _local5:Object;
var _local6:ResourceBundle;
if (!_arg2){
_arg2 = ApplicationDomain.currentDomain;
};
_local3 = (((mx_internal::locale + "$") + _arg1) + "_properties");
_local4 = getClassByName(_local3, _arg2);
if (!_local4){
_local3 = (_arg1 + "_properties");
_local4 = getClassByName(_local3, _arg2);
};
if (!_local4){
_local3 = _arg1;
_local4 = getClassByName(_local3, _arg2);
};
if (((!(_local4)) && (mx_internal::backupApplicationDomain))){
_local3 = (_arg1 + "_properties");
_local4 = getClassByName(_local3, mx_internal::backupApplicationDomain);
if (!_local4){
_local3 = _arg1;
_local4 = getClassByName(_local3, mx_internal::backupApplicationDomain);
};
};
if (_local4){
_local5 = new (_local4);
if ((_local5 is ResourceBundle)){
_local6 = ResourceBundle(_local5);
return (_local6);
};
};
throw (new Error(("Could not find resource bundle " + _arg1)));
}
}
}//package mx.resources
Section 387
//ResourceManager (mx.resources.ResourceManager)
package mx.resources {
import mx.core.*;
public class ResourceManager {
mx_internal static const VERSION:String = "3.0.0.0";
private static var implClassDependency:ResourceManagerImpl;
private static var instance:IResourceManager;
public static function getInstance():IResourceManager{
if (!instance){
try {
instance = IResourceManager(Singleton.getInstance("mx.resources::IResourceManager"));
} catch(e:Error) {
instance = new ResourceManagerImpl();
};
};
return (instance);
}
}
}//package mx.resources
Section 388
//ResourceManagerImpl (mx.resources.ResourceManagerImpl)
package mx.resources {
import flash.events.*;
import mx.core.*;
import flash.system.*;
import flash.utils.*;
import mx.modules.*;
import mx.events.*;
import mx.utils.*;
public class ResourceManagerImpl extends EventDispatcher implements IResourceManager {
private var resourceModules:Object;
private var initializedForNonFrameworkApp:Boolean;// = false
private var localeMap:Object;
private var _localeChain:Array;
mx_internal static const VERSION:String = "3.0.0.0";
private static var instance:IResourceManager;
public function ResourceManagerImpl(){
localeMap = {};
resourceModules = {};
super();
}
public function get localeChain():Array{
return (_localeChain);
}
public function set localeChain(_arg1:Array):void{
_localeChain = _arg1;
update();
}
public function getStringArray(_arg1:String, _arg2:String, _arg3:String=null):Array{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (null);
};
var _local5:* = _local4.content[_arg2];
var _local6:Array = String(_local5).split(",");
var _local7:int = _local6.length;
var _local8:int;
while (_local8 < _local7) {
_local6[_local8] = StringUtil.trim(_local6[_local8]);
_local8++;
};
return (_local6);
}
mx_internal function installCompiledResourceBundle(_arg1:ApplicationDomain, _arg2:String, _arg3:String):void{
var _local4:String;
var _local5:String = _arg3;
var _local6:int = _arg3.indexOf(":");
if (_local6 != -1){
_local4 = _arg3.substring(0, _local6);
_local5 = _arg3.substring((_local6 + 1));
};
if (getResourceBundle(_arg2, _arg3)){
return;
};
var _local7 = (((_arg2 + "$") + _local5) + "_properties");
if (_local4 != null){
_local7 = ((_local4 + ".") + _local7);
};
var _local8:Class;
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
if (!_local8){
_local7 = _arg3;
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
};
if (!_local8){
_local7 = (_arg3 + "_properties");
if (_arg1.hasDefinition(_local7)){
_local8 = Class(_arg1.getDefinition(_local7));
};
};
if (!_local8){
throw (new Error((((("Could not find compiled resource bundle '" + _arg3) + "' for locale '") + _arg2) + "'.")));
};
var _local9:ResourceBundle = ResourceBundle(new (_local8));
_local9.mx_internal::_locale = _arg2;
_local9.mx_internal::_bundleName = _arg3;
addResourceBundle(_local9);
}
public function getString(_arg1:String, _arg2:String, _arg3:Array=null, _arg4:String=null):String{
var _local5:IResourceBundle = findBundle(_arg1, _arg2, _arg4);
if (!_local5){
return (null);
};
var _local6:String = String(_local5.content[_arg2]);
if (_arg3){
_local6 = StringUtil.substitute(_local6, _arg3);
};
return (_local6);
}
public function loadResourceModule(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher{
var moduleInfo:IModuleInfo;
var resourceEventDispatcher:ResourceEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = _arg1;
var updateFlag = _arg2;
var applicationDomain = _arg3;
var securityDomain = _arg4;
moduleInfo = ModuleManager.getModule(url);
resourceEventDispatcher = new ResourceEventDispatcher(moduleInfo);
var readyHandler:Function = function (_arg1:ModuleEvent):void{
var _local2:* = _arg1.module.factory.create();
resourceModules[_arg1.module.url].resourceModule = _local2;
if (updateFlag){
update();
};
};
moduleInfo.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
var errorHandler:Function = function (_arg1:ModuleEvent):void{
var _local3:ResourceEvent;
var _local2:String = ("Unable to load resource module from " + url);
if (resourceEventDispatcher.willTrigger(ResourceEvent.ERROR)){
_local3 = new ResourceEvent(ResourceEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local3.bytesLoaded = 0;
_local3.bytesTotal = 0;
_local3.errorText = _local2;
resourceEventDispatcher.dispatchEvent(_local3);
} else {
throw (new Error(_local2));
};
};
moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
resourceModules[url] = new ResourceModuleInfo(moduleInfo, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (_arg1:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
moduleInfo.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (resourceEventDispatcher);
}
public function getLocales():Array{
var _local2:String;
var _local1:Array = [];
for (_local2 in localeMap) {
_local1.push(_local2);
};
return (_local1);
}
public function removeResourceBundlesForLocale(_arg1:String):void{
delete localeMap[_arg1];
}
public function getResourceBundle(_arg1:String, _arg2:String):IResourceBundle{
var _local3:Object = localeMap[_arg1];
if (!_local3){
return (null);
};
return (_local3[_arg2]);
}
private function dumpResourceModule(_arg1):void{
var _local2:ResourceBundle;
var _local3:String;
for each (_local2 in _arg1.resourceBundles) {
trace(_local2.locale, _local2.bundleName);
for (_local3 in _local2.content) {
};
};
}
public function getObject(_arg1:String, _arg2:String, _arg3:String=null){
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (undefined);
};
return (_local4.content[_arg2]);
}
public function addResourceBundle(_arg1:IResourceBundle):void{
var _local2:String = _arg1.locale;
var _local3:String = _arg1.bundleName;
if (!localeMap[_local2]){
localeMap[_local2] = {};
};
localeMap[_local2][_local3] = _arg1;
}
private function findBundle(_arg1:String, _arg2:String, _arg3:String):IResourceBundle{
supportNonFrameworkApps();
return (((_arg3)!=null) ? getResourceBundle(_arg3, _arg1) : findResourceBundleWithResource(_arg1, _arg2));
}
public function getInt(_arg1:String, _arg2:String, _arg3:String=null):int{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (0);
};
var _local5:* = _local4.content[_arg2];
return (int(_local5));
}
private function supportNonFrameworkApps():void{
if (initializedForNonFrameworkApp){
return;
};
initializedForNonFrameworkApp = true;
if (getLocales().length > 0){
return;
};
var _local1:ApplicationDomain = ApplicationDomain.currentDomain;
if (!_local1.hasDefinition("_CompiledResourceBundleInfo")){
return;
};
var _local2:Class = Class(_local1.getDefinition("_CompiledResourceBundleInfo"));
var _local3:Array = _local2.compiledLocales;
var _local4:Array = _local2.compiledResourceBundleNames;
installCompiledResourceBundles(_local1, _local3, _local4);
localeChain = _local3;
}
public function getClass(_arg1:String, _arg2:String, _arg3:String=null):Class{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (null);
};
var _local5:* = _local4.content[_arg2];
return ((_local5 as Class));
}
public function getNumber(_arg1:String, _arg2:String, _arg3:String=null):Number{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (NaN);
};
var _local5:* = _local4.content[_arg2];
return (Number(_local5));
}
public function update():void{
dispatchEvent(new Event(Event.CHANGE));
}
public function getBundleNamesForLocale(_arg1:String):Array{
var _local3:String;
var _local2:Array = [];
for (_local3 in localeMap[_arg1]) {
_local2.push(_local3);
};
return (_local2);
}
public function removeResourceBundle(_arg1:String, _arg2:String):void{
delete localeMap[_arg1][_arg2];
if (getBundleNamesForLocale(_arg1).length == 0){
delete localeMap[_arg1];
};
}
public function installCompiledResourceBundles(_arg1:ApplicationDomain, _arg2:Array, _arg3:Array):void{
var _local7:String;
var _local8:int;
var _local9:String;
var _local4:int = (_arg2) ? _arg2.length : 0;
var _local5:int = (_arg3) ? _arg3.length : 0;
var _local6:int;
while (_local6 < _local4) {
_local7 = _arg2[_local6];
_local8 = 0;
while (_local8 < _local5) {
_local9 = _arg3[_local8];
mx_internal::installCompiledResourceBundle(_arg1, _local7, _local9);
_local8++;
};
_local6++;
};
}
public function findResourceBundleWithResource(_arg1:String, _arg2:String):IResourceBundle{
var _local5:String;
var _local6:Object;
var _local7:ResourceBundle;
if (!_localeChain){
return (null);
};
var _local3:int = _localeChain.length;
var _local4:int;
while (_local4 < _local3) {
_local5 = localeChain[_local4];
_local6 = localeMap[_local5];
if (!_local6){
} else {
_local7 = _local6[_arg1];
if (!_local7){
} else {
if ((_arg2 in _local7.content)){
return (_local7);
};
};
};
_local4++;
};
return (null);
}
public function getUint(_arg1:String, _arg2:String, _arg3:String=null):uint{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (0);
};
var _local5:* = _local4.content[_arg2];
return (uint(_local5));
}
public function getBoolean(_arg1:String, _arg2:String, _arg3:String=null):Boolean{
var _local4:IResourceBundle = findBundle(_arg1, _arg2, _arg3);
if (!_local4){
return (false);
};
var _local5:* = _local4.content[_arg2];
return ((String(_local5).toLowerCase() == "true"));
}
public function unloadResourceModule(_arg1:String, _arg2:Boolean=true):void{
throw (new Error("unloadResourceModule() is not yet implemented."));
}
public static function getInstance():IResourceManager{
if (!instance){
instance = new (ResourceManagerImpl);
};
return (instance);
}
}
}//package mx.resources
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class ResourceModuleInfo {
public var resourceModule:IResourceModule;
public var errorHandler:Function;
public var readyHandler:Function;
public var moduleInfo:IModuleInfo;
private function ResourceModuleInfo(_arg1:IModuleInfo, _arg2:Function, _arg3:Function){
this.moduleInfo = _arg1;
this.readyHandler = _arg2;
this.errorHandler = _arg3;
}
}
class ResourceEventDispatcher extends EventDispatcher {
private function ResourceEventDispatcher(_arg1:IModuleInfo){
_arg1.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
private function moduleInfo_readyHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.COMPLETE);
dispatchEvent(_local2);
}
private function moduleInfo_errorHandler(_arg1:ModuleEvent):void{
var _local2:ResourceEvent = new ResourceEvent(ResourceEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
_local2.errorText = _arg1.errorText;
dispatchEvent(_local2);
}
}
Section 389
//HaloBorder (mx.skins.halo.HaloBorder)
package mx.skins.halo {
import mx.core.*;
import mx.styles.*;
import flash.display.*;
import mx.skins.*;
import mx.graphics.*;
import mx.utils.*;
public class HaloBorder extends RectangularBorder {
mx_internal var radiusObj:Object;
mx_internal var backgroundHole:Object;
mx_internal var radius:Number;
mx_internal var bRoundedCorners:Boolean;
mx_internal var backgroundColor:Object;
private var dropShadow:RectangularDropShadow;
protected var _borderMetrics:EdgeMetrics;
mx_internal var backgroundAlphaName:String;
mx_internal static const VERSION:String = "3.0.0.0";
private static var BORDER_WIDTHS:Object = {none:0, solid:1, inset:2, outset:2, alert:3, dropdown:2, menuBorder:1, comboNonEdit:2};
public function HaloBorder(){
BORDER_WIDTHS["default"] = 3;
}
override public function styleChanged(_arg1:String):void{
if ((((((((((_arg1 == null)) || ((_arg1 == "styleName")))) || ((_arg1 == "borderStyle")))) || ((_arg1 == "borderThickness")))) || ((_arg1 == "borderSides")))){
_borderMetrics = null;
};
invalidateDisplayList();
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
if (((isNaN(_arg1)) || (isNaN(_arg2)))){
return;
};
super.updateDisplayList(_arg1, _arg2);
backgroundColor = getBackgroundColor();
bRoundedCorners = false;
backgroundAlphaName = "backgroundAlpha";
backgroundHole = null;
radius = 0;
radiusObj = null;
drawBorder(_arg1, _arg2);
drawBackground(_arg1, _arg2);
}
mx_internal function drawBorder(_arg1:Number, _arg2:Number):void{
var _local5:Number;
var _local6:uint;
var _local7:uint;
var _local8:String;
var _local9:Number;
var _local10:uint;
var _local11:Boolean;
var _local12:uint;
var _local13:Array;
var _local14:Array;
var _local15:uint;
var _local16:uint;
var _local17:uint;
var _local18:uint;
var _local19:Boolean;
var _local20:Object;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Object;
var _local27:Number;
var _local28:Number;
var _local29:IContainer;
var _local30:EdgeMetrics;
var _local31:Boolean;
var _local32:Number;
var _local33:Array;
var _local34:uint;
var _local35:Boolean;
var _local36:Number;
var _local3:String = getStyle("borderStyle");
var _local4:Array = getStyle("highlightAlphas");
var _local21:Boolean;
var _local26:Graphics = graphics;
_local26.clear();
if (_local3){
switch (_local3){
case "none":
break;
case "inset":
_local7 = getStyle("borderColor");
_local22 = ColorUtil.adjustBrightness2(_local7, -40);
_local23 = ColorUtil.adjustBrightness2(_local7, 25);
_local24 = ColorUtil.adjustBrightness2(_local7, 40);
_local25 = backgroundColor;
if ((((_local25 === null)) || ((_local25 === "")))){
_local25 = _local7;
};
draw3dBorder(_local23, _local22, _local24, Number(_local25), Number(_local25), Number(_local25));
break;
case "outset":
_local7 = getStyle("borderColor");
_local22 = ColorUtil.adjustBrightness2(_local7, -40);
_local23 = ColorUtil.adjustBrightness2(_local7, -25);
_local24 = ColorUtil.adjustBrightness2(_local7, 40);
_local25 = backgroundColor;
if ((((_local25 === null)) || ((_local25 === "")))){
_local25 = _local7;
};
draw3dBorder(_local23, _local24, _local22, Number(_local25), Number(_local25), Number(_local25));
break;
case "alert":
case "default":
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_local27 = getStyle("backgroundAlpha");
_local5 = getStyle("borderAlpha");
backgroundAlphaName = "borderAlpha";
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
_local28 = (bRoundedCorners) ? radius : 0;
drawDropShadow(0, 0, _arg1, _arg2, radius, radius, _local28, _local28);
if (!bRoundedCorners){
radiusObj = {};
};
_local29 = (parent as IContainer);
if (_local29){
_local30 = _local29.viewMetrics;
backgroundHole = {x:_local30.left, y:_local30.top, w:Math.max(0, ((_arg1 - _local30.left) - _local30.right)), h:Math.max(0, ((_arg2 - _local30.top) - _local30.bottom)), r:0};
if ((((backgroundHole.w > 0)) && ((backgroundHole.h > 0)))){
if (_local27 != _local5){
drawDropShadow(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h, 0, 0, 0, 0);
};
_local26.beginFill(Number(backgroundColor), _local27);
_local26.drawRect(backgroundHole.x, backgroundHole.y, backgroundHole.w, backgroundHole.h);
_local26.endFill();
};
};
backgroundColor = getStyle("borderColor");
};
break;
case "dropdown":
_local12 = getStyle("dropdownBorderColor");
drawDropShadow(0, 0, _arg1, _arg2, 4, 0, 0, 4);
drawRoundRect(0, 0, _arg1, _arg2, {tl:4, tr:0, br:0, bl:4}, 5068126, 1);
drawRoundRect(0, 0, _arg1, _arg2, {tl:4, tr:0, br:0, bl:4}, [0xFFFFFF, 0xFFFFFF], [0.7, 0], verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(1, 1, (_arg1 - 1), (_arg2 - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (_arg1 - 1), (_arg2 - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (_arg1 - 1), (_arg2 - 3)));
if (!isNaN(_local12)){
drawRoundRect(0, 0, (_arg1 + 1), _arg2, {tl:4, tr:0, br:0, bl:4}, _local12, 0.5);
drawRoundRect(1, 1, (_arg1 - 1), (_arg2 - 2), {tl:3, tr:0, br:0, bl:3}, 0xFFFFFF, 1);
drawRoundRect(1, 2, (_arg1 - 1), (_arg2 - 3), {tl:3, tr:0, br:0, bl:3}, [0xEEEEEE, 0xFFFFFF], 1, verticalGradientMatrix(0, 0, (_arg1 - 1), (_arg2 - 3)));
};
backgroundColor = null;
break;
case "menuBorder":
_local7 = getStyle("borderColor");
drawRoundRect(0, 0, _arg1, _arg2, 0, _local7, 1);
drawDropShadow(1, 1, (_arg1 - 2), (_arg2 - 2), 0, 0, 0, 0);
break;
case "comboNonEdit":
break;
case "controlBar":
if ((((_arg1 == 0)) || ((_arg2 == 0)))){
backgroundColor = null;
break;
};
_local14 = getStyle("footerColors");
_local31 = !((_local14 == null));
_local32 = getStyle("borderAlpha");
if (_local31){
_local26.lineStyle(0, ((_local14.length > 0)) ? _local14[1] : _local14[0], _local32);
_local26.moveTo(0, 0);
_local26.lineTo(_arg1, 0);
_local26.lineStyle(0, 0, 0);
if (((((parent) && (parent.parent))) && ((parent.parent is IStyleClient)))){
radius = IStyleClient(parent.parent).getStyle("cornerRadius");
_local32 = IStyleClient(parent.parent).getStyle("borderAlpha");
};
if (isNaN(radius)){
radius = 0;
};
if (IStyleClient(parent.parent).getStyle("roundedBottomCorners").toString().toLowerCase() != "true"){
radius = 0;
};
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:0, tr:0, bl:radius, br:radius}, _local14, _local32, verticalGradientMatrix(0, 0, _arg1, _arg2));
if ((((_local14.length > 1)) && (!((_local14[0] == _local14[1]))))){
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:0, tr:0, bl:radius, br:radius}, [0xFFFFFF, 0xFFFFFF], _local4, verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(1, 2, (_arg1 - 2), (_arg2 - 3), {tl:0, tr:0, bl:(radius - 1), br:(radius - 1)}, _local14, _local32, verticalGradientMatrix(0, 0, _arg1, _arg2));
};
};
backgroundColor = null;
break;
case "applicationControlBar":
_local13 = getStyle("fillColors");
_local5 = getStyle("backgroundAlpha");
_local4 = getStyle("highlightAlphas");
_local33 = getStyle("fillAlphas");
_local11 = getStyle("docked");
_local34 = uint(backgroundColor);
radius = getStyle("cornerRadius");
if (!radius){
radius = 0;
};
drawDropShadow(0, 1, _arg1, (_arg2 - 1), radius, radius, radius, radius);
if (((!((backgroundColor === null))) && (StyleManager.isValidStyleValue(backgroundColor)))){
drawRoundRect(0, 1, _arg1, (_arg2 - 1), radius, _local34, _local5, verticalGradientMatrix(0, 0, _arg1, _arg2));
};
drawRoundRect(0, 1, _arg1, (_arg2 - 1), radius, _local13, _local33, verticalGradientMatrix(0, 0, _arg1, _arg2));
drawRoundRect(0, 1, _arg1, ((_arg2 / 2) - 1), {tl:radius, tr:radius, bl:0, br:0}, [0xFFFFFF, 0xFFFFFF], _local4, verticalGradientMatrix(0, 0, _arg1, ((_arg2 / 2) - 1)));
drawRoundRect(0, 1, _arg1, (_arg2 - 1), {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, 0.3, null, GradientType.LINEAR, null, {x:0, y:2, w:_arg1, h:(_arg2 - 2), r:{tl:radius, tr:radius, bl:0, br:0}});
backgroundColor = null;
break;
default:
_local7 = getStyle("borderColor");
_local9 = getStyle("borderThickness");
_local8 = getStyle("borderSides");
_local35 = true;
radius = getStyle("cornerRadius");
bRoundedCorners = (getStyle("roundedBottomCorners").toString().toLowerCase() == "true");
_local36 = Math.max((radius - _local9), 0);
_local20 = {x:_local9, y:_local9, w:(_arg1 - (_local9 * 2)), h:(_arg2 - (_local9 * 2)), r:_local36};
if (!bRoundedCorners){
radiusObj = {tl:radius, tr:radius, bl:0, br:0};
_local20.r = {tl:_local36, tr:_local36, bl:0, br:0};
};
if (_local8 != "left top right bottom"){
_local20.r = {tl:_local36, tr:_local36, bl:(bRoundedCorners) ? _local36 : 0, br:(bRoundedCorners) ? _local36 : 0};
radiusObj = {tl:radius, tr:radius, bl:(bRoundedCorners) ? radius : 0, br:(bRoundedCorners) ? radius : 0};
_local8 = _local8.toLowerCase();
if (_local8.indexOf("left") == -1){
_local20.x = 0;
_local20.w = (_local20.w + _local9);
_local20.r.tl = 0;
_local20.r.bl = 0;
radiusObj.tl = 0;
radiusObj.bl = 0;
_local35 = false;
};
if (_local8.indexOf("top") == -1){
_local20.y = 0;
_local20.h = (_local20.h + _local9);
_local20.r.tl = 0;
_local20.r.tr = 0;
radiusObj.tl = 0;
radiusObj.tr = 0;
_local35 = false;
};
if (_local8.indexOf("right") == -1){
_local20.w = (_local20.w + _local9);
_local20.r.tr = 0;
_local20.r.br = 0;
radiusObj.tr = 0;
radiusObj.br = 0;
_local35 = false;
};
if (_local8.indexOf("bottom") == -1){
_local20.h = (_local20.h + _local9);
_local20.r.bl = 0;
_local20.r.br = 0;
radiusObj.bl = 0;
radiusObj.br = 0;
_local35 = false;
};
};
if ((((radius == 0)) && (_local35))){
drawDropShadow(0, 0, _arg1, _arg2, 0, 0, 0, 0);
_local26.beginFill(_local7);
_local26.drawRect(0, 0, _arg1, _arg2);
_local26.drawRect(_local9, _local9, (_arg1 - (2 * _local9)), (_arg2 - (2 * _local9)));
_local26.endFill();
} else {
if (radiusObj){
drawDropShadow(0, 0, _arg1, _arg2, radiusObj.tl, radiusObj.tr, radiusObj.br, radiusObj.bl);
drawRoundRect(0, 0, _arg1, _arg2, radiusObj, _local7, 1, null, null, null, _local20);
radiusObj.tl = Math.max((radius - _local9), 0);
radiusObj.tr = Math.max((radius - _local9), 0);
radiusObj.bl = (bRoundedCorners) ? Math.max((radius - _local9), 0) : 0;
radiusObj.br = (bRoundedCorners) ? Math.max((radius - _local9), 0) : 0;
} else {
drawDropShadow(0, 0, _arg1, _arg2, radius, radius, radius, radius);
drawRoundRect(0, 0, _arg1, _arg2, radius, _local7, 1, null, null, null, _local20);
radius = Math.max((getStyle("cornerRadius") - _local9), 0);
};
};
};
};
}
mx_internal function drawBackground(_arg1:Number, _arg2:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:EdgeMetrics;
var _local7:Graphics;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Number;
if (((((((!((backgroundColor === null))) && (!((backgroundColor === ""))))) || (getStyle("mouseShield")))) || (getStyle("mouseShieldChildren")))){
_local4 = Number(backgroundColor);
_local5 = 1;
_local6 = getBackgroundColorMetrics();
_local7 = graphics;
if (((((isNaN(_local4)) || ((backgroundColor === "")))) || ((backgroundColor === null)))){
_local5 = 0;
_local4 = 0xFFFFFF;
} else {
_local5 = getStyle(backgroundAlphaName);
};
if (((!((radius == 0))) || (backgroundHole))){
_local8 = _local6.bottom;
if (radiusObj){
_local9 = (bRoundedCorners) ? radius : 0;
radiusObj = {tl:radius, tr:radius, bl:_local9, br:_local9};
drawRoundRect(_local6.left, _local6.top, (width - (_local6.left + _local6.right)), (height - (_local6.top + _local8)), radiusObj, _local4, _local5, null, GradientType.LINEAR, null, backgroundHole);
} else {
drawRoundRect(_local6.left, _local6.top, (width - (_local6.left + _local6.right)), (height - (_local6.top + _local8)), radius, _local4, _local5, null, GradientType.LINEAR, null, backgroundHole);
};
} else {
_local7.beginFill(_local4, _local5);
_local7.drawRect(_local6.left, _local6.top, ((_arg1 - _local6.right) - _local6.left), ((_arg2 - _local6.bottom) - _local6.top));
_local7.endFill();
};
};
var _local3:String = getStyle("borderStyle");
if ((((((FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0)) && ((((_local3 == "alert")) || ((_local3 == "default")))))) && ((getStyle("headerColors") == null)))){
_local10 = getStyle("highlightAlphas");
_local11 = (_local10) ? _local10[0] : 0.3;
drawRoundRect(0, 0, _arg1, _arg2, {tl:radius, tr:radius, bl:0, br:0}, 0xFFFFFF, _local11, null, GradientType.LINEAR, null, {x:0, y:1, w:_arg1, h:(_arg2 - 1), r:{tl:radius, tr:radius, bl:0, br:0}});
};
}
mx_internal function drawDropShadow(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):void{
var _local11:Number;
var _local12:Boolean;
if ((((((((getStyle("dropShadowEnabled") == false)) || ((getStyle("dropShadowEnabled") == "false")))) || ((_arg3 == 0)))) || ((_arg4 == 0)))){
return;
};
var _local9:Number = getStyle("shadowDistance");
var _local10:String = getStyle("shadowDirection");
if (getStyle("borderStyle") == "applicationControlBar"){
_local12 = getStyle("docked");
_local11 = (_local12) ? 90 : getDropShadowAngle(_local9, _local10);
_local9 = Math.abs(_local9);
} else {
_local11 = getDropShadowAngle(_local9, _local10);
_local9 = (Math.abs(_local9) + 2);
};
if (!dropShadow){
dropShadow = new RectangularDropShadow();
};
dropShadow.distance = _local9;
dropShadow.angle = _local11;
dropShadow.color = getStyle("dropShadowColor");
dropShadow.alpha = 0.4;
dropShadow.tlRadius = _arg5;
dropShadow.trRadius = _arg6;
dropShadow.blRadius = _arg8;
dropShadow.brRadius = _arg7;
dropShadow.drawShadow(graphics, _arg1, _arg2, _arg3, _arg4);
}
mx_internal function getBackgroundColor():Object{
var _local2:Object;
var _local1:IUIComponent = (parent as IUIComponent);
if (((_local1) && (!(_local1.enabled)))){
_local2 = getStyle("backgroundDisabledColor");
if (((!((_local2 === null))) && (StyleManager.isValidStyleValue(_local2)))){
return (_local2);
};
};
return (getStyle("backgroundColor"));
}
mx_internal function draw3dBorder(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):void{
var _local7:Number = width;
var _local8:Number = height;
drawDropShadow(0, 0, width, height, 0, 0, 0, 0);
var _local9:Graphics = graphics;
_local9.beginFill(_arg1);
_local9.drawRect(0, 0, _local7, _local8);
_local9.drawRect(1, 0, (_local7 - 2), _local8);
_local9.endFill();
_local9.beginFill(_arg2);
_local9.drawRect(1, 0, (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg3);
_local9.drawRect(1, (_local8 - 1), (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg4);
_local9.drawRect(1, 1, (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg5);
_local9.drawRect(1, (_local8 - 2), (_local7 - 2), 1);
_local9.endFill();
_local9.beginFill(_arg6);
_local9.drawRect(1, 2, (_local7 - 2), (_local8 - 4));
_local9.drawRect(2, 2, (_local7 - 4), (_local8 - 4));
_local9.endFill();
}
mx_internal function getBackgroundColorMetrics():EdgeMetrics{
return (borderMetrics);
}
mx_internal function getDropShadowAngle(_arg1:Number, _arg2:String):Number{
if (_arg2 == "left"){
return (((_arg1 >= 0)) ? 135 : 225);
//unresolved jump
};
if (_arg2 == "right"){
return (((_arg1 >= 0)) ? 45 : 315);
//unresolved jump
};
return (((_arg1 >= 0)) ? 90 : 270);
}
override public function get borderMetrics():EdgeMetrics{
var _local1:Number;
var _local3:String;
if (_borderMetrics){
return (_borderMetrics);
};
var _local2:String = getStyle("borderStyle");
if ((((_local2 == "default")) || ((_local2 == "alert")))){
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
_borderMetrics = new EdgeMetrics(0, 0, 0, 0);
} else {
return (EdgeMetrics.EMPTY);
};
} else {
if ((((_local2 == "controlBar")) || ((_local2 == "applicationControlBar")))){
_borderMetrics = new EdgeMetrics(1, 1, 1, 1);
} else {
if (_local2 == "solid"){
_local1 = getStyle("borderThickness");
if (isNaN(_local1)){
_local1 = 0;
};
_borderMetrics = new EdgeMetrics(_local1, _local1, _local1, _local1);
_local3 = getStyle("borderSides");
if (_local3 != "left top right bottom"){
if (_local3.indexOf("left") == -1){
_borderMetrics.left = 0;
};
if (_local3.indexOf("top") == -1){
_borderMetrics.top = 0;
};
if (_local3.indexOf("right") == -1){
_borderMetrics.right = 0;
};
if (_local3.indexOf("bottom") == -1){
_borderMetrics.bottom = 0;
};
};
} else {
_local1 = BORDER_WIDTHS[_local2];
if (isNaN(_local1)){
_local1 = 0;
};
_borderMetrics = new EdgeMetrics(_local1, _local1, _local1, _local1);
};
};
};
return (_borderMetrics);
}
}
}//package mx.skins.halo
Section 390
//HaloFocusRect (mx.skins.halo.HaloFocusRect)
package mx.skins.halo {
import mx.core.*;
import mx.styles.*;
import flash.display.*;
import mx.skins.*;
import mx.utils.*;
public class HaloFocusRect extends ProgrammaticSkin implements IStyleClient {
private var _focusColor:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function get inheritingStyles():Object{
return (styleName.inheritingStyles);
}
public function set inheritingStyles(_arg1:Object):void{
}
public function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void{
}
public function registerEffects(_arg1:Array):void{
}
public function regenerateStyleCache(_arg1:Boolean):void{
}
public function get styleDeclaration():CSSStyleDeclaration{
return (CSSStyleDeclaration(styleName));
}
public function getClassStyleDeclarations():Array{
return ([]);
}
public function get className():String{
return ("HaloFocusRect");
}
public function clearStyle(_arg1:String):void{
if (_arg1 == "focusColor"){
_focusColor = NaN;
};
}
public function setStyle(_arg1:String, _arg2):void{
if (_arg1 == "focusColor"){
_focusColor = _arg2;
};
}
public function set nonInheritingStyles(_arg1:Object):void{
}
public function get nonInheritingStyles():Object{
return (styleName.nonInheritingStyles);
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
super.updateDisplayList(_arg1, _arg2);
var _local3:String = getStyle("focusBlendMode");
var _local4:Number = getStyle("focusAlpha");
var _local5:Number = getStyle("focusColor");
var _local6:Number = getStyle("cornerRadius");
var _local7:Number = getStyle("focusThickness");
var _local8:String = getStyle("focusRoundedCorners");
var _local9:Number = getStyle("themeColor");
var _local10:Number = _local5;
if (isNaN(_local10)){
_local10 = _local9;
};
var _local11:Graphics = graphics;
_local11.clear();
blendMode = _local3;
if (((!((_local8 == "tl tr bl br"))) && ((_local6 > 0)))){
_local12 = 0;
_local13 = 0;
_local14 = 0;
_local15 = 0;
_local16 = (_local6 + _local7);
if (_local8.indexOf("tl") >= 0){
_local12 = _local16;
};
if (_local8.indexOf("tr") >= 0){
_local14 = _local16;
};
if (_local8.indexOf("bl") >= 0){
_local13 = _local16;
};
if (_local8.indexOf("br") >= 0){
_local15 = _local16;
};
_local11.beginFill(_local10, _local4);
GraphicsUtil.drawRoundRectComplex(_local11, 0, 0, _arg1, _arg2, _local12, _local14, _local13, _local15);
_local12 = (_local12) ? _local6 : 0;
_local14 = (_local14) ? _local6 : 0;
_local13 = (_local13) ? _local6 : 0;
_local15 = (_local15) ? _local6 : 0;
GraphicsUtil.drawRoundRectComplex(_local11, _local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local12, _local14, _local13, _local15);
_local11.endFill();
_local16 = (_local6 + (_local7 / 2));
_local12 = (_local12) ? _local16 : 0;
_local14 = (_local14) ? _local16 : 0;
_local13 = (_local13) ? _local16 : 0;
_local15 = (_local15) ? _local16 : 0;
_local11.beginFill(_local10, _local4);
GraphicsUtil.drawRoundRectComplex(_local11, (_local7 / 2), (_local7 / 2), (_arg1 - _local7), (_arg2 - _local7), _local12, _local14, _local13, _local15);
_local12 = (_local12) ? _local6 : 0;
_local14 = (_local14) ? _local6 : 0;
_local13 = (_local13) ? _local6 : 0;
_local15 = (_local15) ? _local6 : 0;
GraphicsUtil.drawRoundRectComplex(_local11, _local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local12, _local14, _local13, _local15);
_local11.endFill();
} else {
_local11.beginFill(_local10, _local4);
_local17 = (((_local6 > 0)) ? (_local6 + _local7) : 0 * 2);
_local11.drawRoundRect(0, 0, _arg1, _arg2, _local17, _local17);
_local17 = (_local6 * 2);
_local11.drawRoundRect(_local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local17, _local17);
_local11.endFill();
_local11.beginFill(_local10, _local4);
_local17 = (((_local6 > 0)) ? (_local6 + (_local7 / 2)) : 0 * 2);
_local11.drawRoundRect((_local7 / 2), (_local7 / 2), (_arg1 - _local7), (_arg2 - _local7), _local17, _local17);
_local17 = (_local6 * 2);
_local11.drawRoundRect(_local7, _local7, (_arg1 - (2 * _local7)), (_arg2 - (2 * _local7)), _local17, _local17);
_local11.endFill();
};
}
override public function getStyle(_arg1:String){
return (((_arg1 == "focusColor")) ? _focusColor : super.getStyle(_arg1));
}
public function set styleDeclaration(_arg1:CSSStyleDeclaration):void{
}
}
}//package mx.skins.halo
Section 391
//Border (mx.skins.Border)
package mx.skins {
import mx.core.*;
public class Border extends ProgrammaticSkin implements IBorder {
mx_internal static const VERSION:String = "3.0.0.0";
public function get borderMetrics():EdgeMetrics{
return (EdgeMetrics.EMPTY);
}
}
}//package mx.skins
Section 392
//ProgrammaticSkin (mx.skins.ProgrammaticSkin)
package mx.skins {
import mx.core.*;
import mx.styles.*;
import flash.display.*;
import flash.geom.*;
import mx.managers.*;
import mx.utils.*;
public class ProgrammaticSkin extends FlexShape implements IFlexDisplayObject, IInvalidating, ILayoutManagerClient, ISimpleStyleClient, IProgrammaticSkin {
private var _initialized:Boolean;// = false
private var _height:Number;
private var invalidateDisplayListFlag:Boolean;// = false
private var _styleName:IStyleClient;
private var _nestLevel:int;// = 0
private var _processedDescriptors:Boolean;// = false
private var _updateCompletePendingFlag:Boolean;// = true
private var _width:Number;
mx_internal static const VERSION:String = "3.0.0.0";
private static var tempMatrix:Matrix = new Matrix();
public function ProgrammaticSkin(){
_width = measuredWidth;
_height = measuredHeight;
}
public function getStyle(_arg1:String){
return (_styleName.getStyle(_arg1));
}
protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
}
public function get nestLevel():int{
return (_nestLevel);
}
public function set nestLevel(_arg1:int):void{
_nestLevel = _arg1;
invalidateDisplayList();
}
override public function get height():Number{
return (_height);
}
public function get updateCompletePendingFlag():Boolean{
return (_updateCompletePendingFlag);
}
protected function verticalGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix{
return (rotatedGradientMatrix(_arg1, _arg2, _arg3, _arg4, 90));
}
public function validateSize(_arg1:Boolean=false):void{
}
public function invalidateDisplayList():void{
if (((!(invalidateDisplayListFlag)) && ((nestLevel > 0)))){
invalidateDisplayListFlag = true;
UIComponentGlobals.layoutManager.invalidateDisplayList(this);
};
}
public function set updateCompletePendingFlag(_arg1:Boolean):void{
_updateCompletePendingFlag = _arg1;
}
protected function horizontalGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Matrix{
return (rotatedGradientMatrix(_arg1, _arg2, _arg3, _arg4, 0));
}
override public function set height(_arg1:Number):void{
_height = _arg1;
invalidateDisplayList();
}
public function set processedDescriptors(_arg1:Boolean):void{
_processedDescriptors = _arg1;
}
public function validateDisplayList():void{
invalidateDisplayListFlag = false;
updateDisplayList(width, height);
}
public function get measuredWidth():Number{
return (0);
}
override public function set width(_arg1:Number):void{
_width = _arg1;
invalidateDisplayList();
}
public function get measuredHeight():Number{
return (0);
}
public function set initialized(_arg1:Boolean):void{
_initialized = _arg1;
}
protected function drawRoundRect(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null, _arg6:Object=null, _arg7:Object=null, _arg8:Matrix=null, _arg9:String="linear", _arg10:Array=null, _arg11:Object=null):void{
var _local13:Number;
var _local14:Array;
var _local15:Object;
var _local12:Graphics = graphics;
if ((((_arg3 == 0)) || ((_arg4 == 0)))){
return;
};
if (_arg6 !== null){
if ((_arg6 is uint)){
_local12.beginFill(uint(_arg6), Number(_arg7));
} else {
if ((_arg6 is Array)){
_local14 = ((_arg7 is Array)) ? (_arg7 as Array) : [_arg7, _arg7];
if (!_arg10){
_arg10 = [0, 0xFF];
};
_local12.beginGradientFill(_arg9, (_arg6 as Array), _local14, _arg10, _arg8);
};
};
};
if (!_arg5){
_local12.drawRect(_arg1, _arg2, _arg3, _arg4);
} else {
if ((_arg5 is Number)){
_local13 = (Number(_arg5) * 2);
_local12.drawRoundRect(_arg1, _arg2, _arg3, _arg4, _local13, _local13);
} else {
GraphicsUtil.drawRoundRectComplex(_local12, _arg1, _arg2, _arg3, _arg4, _arg5.tl, _arg5.tr, _arg5.bl, _arg5.br);
};
};
if (_arg11){
_local15 = _arg11.r;
if ((_local15 is Number)){
_local13 = (Number(_local15) * 2);
_local12.drawRoundRect(_arg11.x, _arg11.y, _arg11.w, _arg11.h, _local13, _local13);
} else {
GraphicsUtil.drawRoundRectComplex(_local12, _arg11.x, _arg11.y, _arg11.w, _arg11.h, _local15.tl, _local15.tr, _local15.bl, _local15.br);
};
};
if (_arg6 !== null){
_local12.endFill();
};
}
public function get processedDescriptors():Boolean{
return (_processedDescriptors);
}
public function set styleName(_arg1:Object):void{
if (_styleName != _arg1){
_styleName = (_arg1 as IStyleClient);
invalidateDisplayList();
};
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
var _local3:Boolean;
if (_width != _arg1){
_width = _arg1;
_local3 = true;
};
if (_height != _arg2){
_height = _arg2;
_local3 = true;
};
if (_local3){
invalidateDisplayList();
};
}
public function styleChanged(_arg1:String):void{
invalidateDisplayList();
}
override public function get width():Number{
return (_width);
}
public function invalidateProperties():void{
}
public function get initialized():Boolean{
return (_initialized);
}
protected function rotatedGradientMatrix(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Matrix{
tempMatrix.createGradientBox(_arg3, _arg4, ((_arg5 * Math.PI) / 180), _arg1, _arg2);
return (tempMatrix);
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get styleName():Object{
return (_styleName);
}
public function validateNow():void{
if (invalidateDisplayListFlag){
validateDisplayList();
};
}
public function invalidateSize():void{
}
public function validateProperties():void{
}
}
}//package mx.skins
Section 393
//RectangularBorder (mx.skins.RectangularBorder)
package mx.skins {
import flash.events.*;
import mx.core.*;
import mx.styles.*;
import flash.system.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import mx.resources.*;
import flash.net.*;
public class RectangularBorder extends Border implements IRectangularBorder {
private var backgroundImage:DisplayObject;
private var backgroundImageHeight:Number;
private var _backgroundImageBounds:Rectangle;
private var backgroundImageStyle:Object;
private var backgroundImageWidth:Number;
private var resourceManager:IResourceManager;
mx_internal static const VERSION:String = "3.0.0.0";
public function RectangularBorder(){
resourceManager = ResourceManager.getInstance();
super();
addEventListener(Event.REMOVED, removedHandler);
}
public function layoutBackgroundImage():void{
var _local4:Number;
var _local5:Number;
var _local7:Number;
var _local8:Number;
var _local14:Number;
var _local15:Graphics;
var _local1:DisplayObject = parent;
var _local2:EdgeMetrics = ((_local1 is IContainer)) ? IContainer(_local1).viewMetrics : borderMetrics;
var _local3 = !((getStyle("backgroundAttachment") == "fixed"));
if (_backgroundImageBounds){
_local4 = _backgroundImageBounds.width;
_local5 = _backgroundImageBounds.height;
} else {
_local4 = ((width - _local2.left) - _local2.right);
_local5 = ((height - _local2.top) - _local2.bottom);
};
var _local6:Number = getBackgroundSize();
if (isNaN(_local6)){
_local7 = 1;
_local8 = 1;
} else {
_local14 = (_local6 * 0.01);
_local7 = ((_local14 * _local4) / backgroundImageWidth);
_local8 = ((_local14 * _local5) / backgroundImageHeight);
};
backgroundImage.scaleX = _local7;
backgroundImage.scaleY = _local8;
var _local9:Number = Math.round((0.5 * (_local4 - (backgroundImageWidth * _local7))));
var _local10:Number = Math.round((0.5 * (_local5 - (backgroundImageHeight * _local8))));
backgroundImage.x = _local2.left;
backgroundImage.y = _local2.top;
var _local11:Shape = Shape(backgroundImage.mask);
_local11.x = _local2.left;
_local11.y = _local2.top;
if (((_local3) && ((_local1 is IContainer)))){
_local9 = (_local9 - IContainer(_local1).horizontalScrollPosition);
_local10 = (_local10 - IContainer(_local1).verticalScrollPosition);
};
backgroundImage.alpha = getStyle("backgroundAlpha");
backgroundImage.x = (backgroundImage.x + _local9);
backgroundImage.y = (backgroundImage.y + _local10);
var _local12:Number = ((width - _local2.left) - _local2.right);
var _local13:Number = ((height - _local2.top) - _local2.bottom);
if (((!((_local11.width == _local12))) || (!((_local11.height == _local13))))){
_local15 = _local11.graphics;
_local15.clear();
_local15.beginFill(0xFFFFFF);
_local15.drawRect(0, 0, _local12, _local13);
_local15.endFill();
};
}
public function set backgroundImageBounds(_arg1:Rectangle):void{
_backgroundImageBounds = _arg1;
invalidateDisplayList();
}
private function getBackgroundSize():Number{
var _local3:int;
var _local1:Number = NaN;
var _local2:Object = getStyle("backgroundSize");
if (((_local2) && ((_local2 is String)))){
_local3 = _local2.indexOf("%");
if (_local3 != -1){
_local1 = Number(_local2.substr(0, _local3));
};
};
return (_local1);
}
private function removedHandler(_arg1:Event):void{
var _local2:IChildList;
if (backgroundImage){
_local2 = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
_local2.removeChild(backgroundImage.mask);
_local2.removeChild(backgroundImage);
backgroundImage = null;
};
}
private function initBackgroundImage(_arg1:DisplayObject):void{
backgroundImage = _arg1;
if ((_arg1 is Loader)){
backgroundImageWidth = Loader(_arg1).contentLoaderInfo.width;
backgroundImageHeight = Loader(_arg1).contentLoaderInfo.height;
} else {
backgroundImageWidth = backgroundImage.width;
backgroundImageHeight = backgroundImage.height;
if ((_arg1 is ISimpleStyleClient)){
ISimpleStyleClient(_arg1).styleName = styleName;
};
};
var _local2:IChildList = ((parent is IRawChildrenContainer)) ? IRawChildrenContainer(parent).rawChildren : IChildList(parent);
var _local3:Shape = new FlexShape();
_local3.name = "backgroundMask";
_local3.x = 0;
_local3.y = 0;
_local2.addChild(_local3);
var _local4:int = _local2.getChildIndex(this);
_local2.addChildAt(backgroundImage, (_local4 + 1));
backgroundImage.mask = _local3;
}
public function get backgroundImageBounds():Rectangle{
return (_backgroundImageBounds);
}
public function get hasBackgroundImage():Boolean{
return (!((backgroundImage == null)));
}
private function completeEventHandler(_arg1:Event):void{
if (!parent){
return;
};
var _local2:DisplayObject = DisplayObject(LoaderInfo(_arg1.target).loader);
initBackgroundImage(_local2);
layoutBackgroundImage();
dispatchEvent(_arg1.clone());
}
override protected function updateDisplayList(_arg1:Number, _arg2:Number):void{
var cls:Class;
var newStyleObj:DisplayObject;
var loader:Loader;
var loaderContext:LoaderContext;
var message:String;
var unscaledWidth = _arg1;
var unscaledHeight = _arg2;
if (!parent){
return;
};
var newStyle:Object = getStyle("backgroundImage");
if (newStyle != backgroundImageStyle){
removedHandler(null);
backgroundImageStyle = newStyle;
if (((newStyle) && ((newStyle as Class)))){
cls = Class(newStyle);
initBackgroundImage(new (cls));
} else {
if (((newStyle) && ((newStyle is String)))){
try {
cls = Class(getDefinitionByName(String(newStyle)));
} catch(e:Error) {
};
if (cls){
newStyleObj = new (cls);
initBackgroundImage(newStyleObj);
} else {
loader = new FlexLoader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeEventHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorEventHandler);
loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, errorEventHandler);
loaderContext = new LoaderContext();
loaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
loader.load(new URLRequest(String(newStyle)), loaderContext);
};
} else {
if (newStyle){
message = resourceManager.getString("skins", "notLoaded", [newStyle]);
throw (new Error(message));
};
};
};
};
if (backgroundImage){
layoutBackgroundImage();
};
}
private function errorEventHandler(_arg1:Event):void{
}
}
}//package mx.skins
Section 394
//CSSStyleDeclaration (mx.styles.CSSStyleDeclaration)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.display.*;
import flash.utils.*;
import mx.managers.*;
public class CSSStyleDeclaration extends EventDispatcher {
mx_internal var effects:Array;
protected var overrides:Object;
public var defaultFactory:Function;
public var factory:Function;
mx_internal var selectorRefCount:int;// = 0
private var styleManager:IStyleManager2;
private var clones:Dictionary;
mx_internal static const VERSION:String = "3.0.0.0";
private static const NOT_A_COLOR:uint = 4294967295;
private static const FILTERMAP_PROP:String = "__reserved__filterMap";
public function CSSStyleDeclaration(_arg1:String=null){
clones = new Dictionary(true);
super();
if (_arg1){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
styleManager.setStyleDeclaration(_arg1, this, false);
};
}
mx_internal function addStyleToProtoChain(_arg1:Object, _arg2:DisplayObject, _arg3:Object=null):Object{
var p:String;
var emptyObjectFactory:Function;
var filteredChain:Object;
var filterObjectFactory:Function;
var i:String;
var chain = _arg1;
var target = _arg2;
var filterMap = _arg3;
var nodeAddedToChain:Boolean;
var originalChain:Object = chain;
if (filterMap){
chain = {};
};
if (defaultFactory != null){
defaultFactory.prototype = chain;
chain = new defaultFactory();
nodeAddedToChain = true;
};
if (factory != null){
factory.prototype = chain;
chain = new factory();
nodeAddedToChain = true;
};
if (overrides){
if ((((defaultFactory == null)) && ((factory == null)))){
emptyObjectFactory = function ():void{
};
emptyObjectFactory.prototype = chain;
chain = new (emptyObjectFactory);
nodeAddedToChain = true;
};
for (p in overrides) {
if (overrides[p] === undefined){
delete chain[p];
} else {
chain[p] = overrides[p];
};
};
};
if (filterMap){
if (nodeAddedToChain){
filteredChain = {};
filterObjectFactory = function ():void{
};
filterObjectFactory.prototype = originalChain;
filteredChain = new (filterObjectFactory);
for (i in chain) {
if (filterMap[i] != null){
filteredChain[filterMap[i]] = chain[i];
};
};
chain = filteredChain;
chain[FILTERMAP_PROP] = filterMap;
} else {
chain = originalChain;
};
};
if (nodeAddedToChain){
clones[chain] = 1;
};
return (chain);
}
public function getStyle(_arg1:String){
var _local2:*;
var _local3:*;
if (overrides){
if ((((_arg1 in overrides)) && ((overrides[_arg1] === undefined)))){
return (undefined);
};
_local3 = overrides[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
if (factory != null){
factory.prototype = {};
_local2 = new factory();
_local3 = _local2[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
if (defaultFactory != null){
defaultFactory.prototype = {};
_local2 = new defaultFactory();
_local3 = _local2[_arg1];
if (_local3 !== undefined){
return (_local3);
};
};
return (undefined);
}
public function clearStyle(_arg1:String):void{
setStyle(_arg1, undefined);
}
public function setStyle(_arg1:String, _arg2):void{
var _local7:int;
var _local8:Object;
var _local3:Object = getStyle(_arg1);
var _local4:Boolean;
if ((((((((((selectorRefCount > 0)) && ((factory == null)))) && ((defaultFactory == null)))) && (!(overrides)))) && (!((_local3 === _arg2))))){
_local4 = true;
};
if (_arg2 !== undefined){
setStyle(_arg1, _arg2);
} else {
if (_arg2 == _local3){
return;
};
setStyle(_arg1, _arg2);
};
var _local5:Array = SystemManagerGlobals.topLevelSystemManagers;
var _local6:int = _local5.length;
if (_local4){
_local7 = 0;
while (_local7 < _local6) {
_local8 = _local5[_local7];
_local8.regenerateStyleCache(true);
_local7++;
};
};
_local7 = 0;
while (_local7 < _local6) {
_local8 = _local5[_local7];
_local8.notifyStyleChangeInChildren(_arg1, true);
_local7++;
};
}
private function clearStyleAttr(_arg1:String):void{
var _local2:*;
if (!overrides){
overrides = {};
};
overrides[_arg1] = undefined;
for (_local2 in clones) {
delete _local2[_arg1];
};
}
mx_internal function createProtoChainRoot():Object{
var _local1:Object = {};
if (defaultFactory != null){
defaultFactory.prototype = _local1;
_local1 = new defaultFactory();
};
if (factory != null){
factory.prototype = _local1;
_local1 = new factory();
};
clones[_local1] = 1;
return (_local1);
}
mx_internal function clearOverride(_arg1:String):void{
if (((overrides) && (overrides[_arg1]))){
delete overrides[_arg1];
};
}
mx_internal function setStyle(_arg1:String, _arg2):void{
var _local3:Object;
var _local4:*;
var _local5:Number;
var _local6:Object;
if (_arg2 === undefined){
clearStyleAttr(_arg1);
return;
};
if ((_arg2 is String)){
if (!styleManager){
styleManager = (Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2);
};
_local5 = styleManager.getColorName(_arg2);
if (_local5 != NOT_A_COLOR){
_arg2 = _local5;
};
};
if (defaultFactory != null){
_local3 = new defaultFactory();
if (_local3[_arg1] !== _arg2){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
} else {
if (overrides){
delete overrides[_arg1];
};
};
};
if (factory != null){
_local3 = new factory();
if (_local3[_arg1] !== _arg2){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
} else {
if (overrides){
delete overrides[_arg1];
};
};
};
if ((((defaultFactory == null)) && ((factory == null)))){
if (!overrides){
overrides = {};
};
overrides[_arg1] = _arg2;
};
for (_local4 in clones) {
_local6 = _local4[FILTERMAP_PROP];
if (_local6){
if (_local6[_arg1] != null){
_local4[_local6[_arg1]] = _arg2;
};
} else {
_local4[_arg1] = _arg2;
};
};
}
}
}//package mx.styles
Section 395
//ISimpleStyleClient (mx.styles.ISimpleStyleClient)
package mx.styles {
public interface ISimpleStyleClient {
function set styleName(_arg1:Object):void;
function styleChanged(_arg1:String):void;
function get styleName():Object;
}
}//package mx.styles
Section 396
//IStyleClient (mx.styles.IStyleClient)
package mx.styles {
public interface IStyleClient extends ISimpleStyleClient {
function regenerateStyleCache(_arg1:Boolean):void;
function get className():String;
function clearStyle(_arg1:String):void;
function getClassStyleDeclarations():Array;
function get inheritingStyles():Object;
function set nonInheritingStyles(_arg1:Object):void;
function setStyle(_arg1:String, _arg2):void;
function get styleDeclaration():CSSStyleDeclaration;
function set styleDeclaration(_arg1:CSSStyleDeclaration):void;
function get nonInheritingStyles():Object;
function set inheritingStyles(_arg1:Object):void;
function getStyle(_arg1:String);
function notifyStyleChangeInChildren(_arg1:String, _arg2:Boolean):void;
function registerEffects(_arg1:Array):void;
}
}//package mx.styles
Section 397
//IStyleManager (mx.styles.IStyleManager)
package mx.styles {
import flash.events.*;
public interface IStyleManager {
function isColorName(_arg1:String):Boolean;
function registerParentDisplayListInvalidatingStyle(_arg1:String):void;
function registerInheritingStyle(_arg1:String):void;
function set stylesRoot(_arg1:Object):void;
function get typeSelectorCache():Object;
function styleDeclarationsChanged():void;
function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void;
function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean;
function isSizeInvalidatingStyle(_arg1:String):Boolean;
function get inheritingStyles():Object;
function isValidStyleValue(_arg1):Boolean;
function isParentSizeInvalidatingStyle(_arg1:String):Boolean;
function getColorName(_arg1:Object):uint;
function set typeSelectorCache(_arg1:Object):void;
function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void;
function getColorNames(_arg1:Array):void;
function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher;
function isInheritingStyle(_arg1:String):Boolean;
function set inheritingStyles(_arg1:Object):void;
function get stylesRoot():Object;
function initProtoChainRoots():void;
function registerColorName(_arg1:String, _arg2:uint):void;
function registerParentSizeInvalidatingStyle(_arg1:String):void;
function registerSizeInvalidatingStyle(_arg1:String):void;
function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void;
function isInheritingTextFormatStyle(_arg1:String):Boolean;
function getStyleDeclaration(_arg1:String):CSSStyleDeclaration;
}
}//package mx.styles
Section 398
//IStyleManager2 (mx.styles.IStyleManager2)
package mx.styles {
import flash.events.*;
import flash.system.*;
public interface IStyleManager2 extends IStyleManager {
function get selectors():Array;
function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher;
}
}//package mx.styles
Section 399
//IStyleModule (mx.styles.IStyleModule)
package mx.styles {
public interface IStyleModule {
function unload():void;
}
}//package mx.styles
Section 400
//StyleManager (mx.styles.StyleManager)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.system.*;
public class StyleManager {
mx_internal static const VERSION:String = "3.0.0.0";
public static const NOT_A_COLOR:uint = 4294967295;
private static var _impl:IStyleManager2;
private static var implClassDependency:StyleManagerImpl;
public static function isParentSizeInvalidatingStyle(_arg1:String):Boolean{
return (impl.isParentSizeInvalidatingStyle(_arg1));
}
public static function registerInheritingStyle(_arg1:String):void{
impl.registerInheritingStyle(_arg1);
}
mx_internal static function set stylesRoot(_arg1:Object):void{
impl.stylesRoot = _arg1;
}
mx_internal static function get inheritingStyles():Object{
return (impl.inheritingStyles);
}
mx_internal static function styleDeclarationsChanged():void{
impl.styleDeclarationsChanged();
}
public static function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void{
impl.setStyleDeclaration(_arg1, _arg2, _arg3);
}
public static function registerParentDisplayListInvalidatingStyle(_arg1:String):void{
impl.registerParentDisplayListInvalidatingStyle(_arg1);
}
mx_internal static function get typeSelectorCache():Object{
return (impl.typeSelectorCache);
}
mx_internal static function set inheritingStyles(_arg1:Object):void{
impl.inheritingStyles = _arg1;
}
public static function isColorName(_arg1:String):Boolean{
return (impl.isColorName(_arg1));
}
public static function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean{
return (impl.isParentDisplayListInvalidatingStyle(_arg1));
}
public static function isSizeInvalidatingStyle(_arg1:String):Boolean{
return (impl.isSizeInvalidatingStyle(_arg1));
}
public static function getColorName(_arg1:Object):uint{
return (impl.getColorName(_arg1));
}
mx_internal static function set typeSelectorCache(_arg1:Object):void{
impl.typeSelectorCache = _arg1;
}
public static function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void{
impl.unloadStyleDeclarations(_arg1, _arg2);
}
public static function getColorNames(_arg1:Array):void{
impl.getColorNames(_arg1);
}
public static function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false, _arg4:ApplicationDomain=null, _arg5:SecurityDomain=null):IEventDispatcher{
return (impl.loadStyleDeclarations2(_arg1, _arg2, _arg4, _arg5));
}
private static function get impl():IStyleManager2{
if (!_impl){
_impl = IStyleManager2(Singleton.getInstance("mx.styles::IStyleManager2"));
};
return (_impl);
}
public static function isValidStyleValue(_arg1):Boolean{
return (impl.isValidStyleValue(_arg1));
}
mx_internal static function get stylesRoot():Object{
return (impl.stylesRoot);
}
public static function isInheritingStyle(_arg1:String):Boolean{
return (impl.isInheritingStyle(_arg1));
}
mx_internal static function initProtoChainRoots():void{
impl.initProtoChainRoots();
}
public static function registerParentSizeInvalidatingStyle(_arg1:String):void{
impl.registerParentSizeInvalidatingStyle(_arg1);
}
public static function get selectors():Array{
return (impl.selectors);
}
public static function registerSizeInvalidatingStyle(_arg1:String):void{
impl.registerSizeInvalidatingStyle(_arg1);
}
public static function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void{
impl.clearStyleDeclaration(_arg1, _arg2);
}
public static function registerColorName(_arg1:String, _arg2:uint):void{
impl.registerColorName(_arg1, _arg2);
}
public static function isInheritingTextFormatStyle(_arg1:String):Boolean{
return (impl.isInheritingTextFormatStyle(_arg1));
}
public static function getStyleDeclaration(_arg1:String):CSSStyleDeclaration{
return (impl.getStyleDeclaration(_arg1));
}
}
}//package mx.styles
Section 401
//StyleManagerImpl (mx.styles.StyleManagerImpl)
package mx.styles {
import flash.events.*;
import mx.core.*;
import flash.system.*;
import flash.utils.*;
import mx.modules.*;
import mx.events.*;
import mx.resources.*;
import mx.managers.*;
public class StyleManagerImpl implements IStyleManager2 {
private var _stylesRoot:Object;
private var _selectors:Object;
private var styleModules:Object;
private var _inheritingStyles:Object;
private var resourceManager:IResourceManager;
private var _typeSelectorCache:Object;
mx_internal static const VERSION:String = "3.0.0.0";
private static var parentSizeInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var colorNames:Object = {transparent:"transparent", black:0, blue:0xFF, green:0x8000, gray:0x808080, silver:0xC0C0C0, lime:0xFF00, olive:0x808000, white:0xFFFFFF, yellow:0xFFFF00, maroon:0x800000, navy:128, red:0xFF0000, purple:0x800080, teal:0x8080, fuchsia:0xFF00FF, aqua:0xFFFF, magenta:0xFF00FF, cyan:0xFFFF, halogreen:8453965, haloblue:40447, haloorange:0xFFB600, halosilver:11455193};
private static var inheritingTextFormatStyles:Object = {align:true, bold:true, color:true, font:true, indent:true, italic:true, size:true};
private static var instance:IStyleManager2;
private static var parentDisplayListInvalidatingStyles:Object = {bottom:true, horizontalCenter:true, left:true, right:true, top:true, verticalCenter:true, baseline:true};
private static var sizeInvalidatingStyles:Object = {borderStyle:true, borderThickness:true, fontAntiAliasType:true, fontFamily:true, fontGridFitType:true, fontSharpness:true, fontSize:true, fontStyle:true, fontThickness:true, fontWeight:true, headerHeight:true, horizontalAlign:true, horizontalGap:true, kerning:true, leading:true, letterSpacing:true, paddingBottom:true, paddingLeft:true, paddingRight:true, paddingTop:true, strokeWidth:true, tabHeight:true, tabWidth:true, verticalAlign:true, verticalGap:true};
public function StyleManagerImpl(){
_selectors = {};
styleModules = {};
resourceManager = ResourceManager.getInstance();
_inheritingStyles = {};
_typeSelectorCache = {};
super();
}
public function setStyleDeclaration(_arg1:String, _arg2:CSSStyleDeclaration, _arg3:Boolean):void{
_arg2.selectorRefCount++;
_selectors[_arg1] = _arg2;
typeSelectorCache = {};
if (_arg3){
styleDeclarationsChanged();
};
}
public function registerParentDisplayListInvalidatingStyle(_arg1:String):void{
parentDisplayListInvalidatingStyles[_arg1] = true;
}
public function getStyleDeclaration(_arg1:String):CSSStyleDeclaration{
var _local2:int;
if (_arg1.charAt(0) != "."){
_local2 = _arg1.lastIndexOf(".");
if (_local2 != -1){
_arg1 = _arg1.substr((_local2 + 1));
};
};
return (_selectors[_arg1]);
}
public function set typeSelectorCache(_arg1:Object):void{
_typeSelectorCache = _arg1;
}
public function isColorName(_arg1:String):Boolean{
return (!((colorNames[_arg1.toLowerCase()] === undefined)));
}
public function set inheritingStyles(_arg1:Object):void{
_inheritingStyles = _arg1;
}
public function getColorNames(_arg1:Array):void{
var _local4:uint;
if (!_arg1){
return;
};
var _local2:int = _arg1.length;
var _local3:int;
while (_local3 < _local2) {
if (((!((_arg1[_local3] == null))) && (isNaN(_arg1[_local3])))){
_local4 = getColorName(_arg1[_local3]);
if (_local4 != StyleManager.NOT_A_COLOR){
_arg1[_local3] = _local4;
};
};
_local3++;
};
}
public function isInheritingTextFormatStyle(_arg1:String):Boolean{
return ((inheritingTextFormatStyles[_arg1] == true));
}
public function registerParentSizeInvalidatingStyle(_arg1:String):void{
parentSizeInvalidatingStyles[_arg1] = true;
}
public function registerColorName(_arg1:String, _arg2:uint):void{
colorNames[_arg1.toLowerCase()] = _arg2;
}
public function isParentSizeInvalidatingStyle(_arg1:String):Boolean{
return ((parentSizeInvalidatingStyles[_arg1] == true));
}
public function registerInheritingStyle(_arg1:String):void{
inheritingStyles[_arg1] = true;
}
public function set stylesRoot(_arg1:Object):void{
_stylesRoot = _arg1;
}
public function get typeSelectorCache():Object{
return (_typeSelectorCache);
}
public function isParentDisplayListInvalidatingStyle(_arg1:String):Boolean{
return ((parentDisplayListInvalidatingStyles[_arg1] == true));
}
public function isSizeInvalidatingStyle(_arg1:String):Boolean{
return ((sizeInvalidatingStyles[_arg1] == true));
}
public function styleDeclarationsChanged():void{
var _local4:Object;
var _local1:Array = SystemManagerGlobals.topLevelSystemManagers;
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3];
_local4.regenerateStyleCache(true);
_local4.notifyStyleChangeInChildren(null, true);
_local3++;
};
}
public function isValidStyleValue(_arg1):Boolean{
return (!((_arg1 === undefined)));
}
public function loadStyleDeclarations(_arg1:String, _arg2:Boolean=true, _arg3:Boolean=false):IEventDispatcher{
return (loadStyleDeclarations2(_arg1, _arg2));
}
public function get inheritingStyles():Object{
return (_inheritingStyles);
}
public function unloadStyleDeclarations(_arg1:String, _arg2:Boolean=true):void{
var _local4:IModuleInfo;
var _local3:StyleModuleInfo = styleModules[_arg1];
if (_local3){
_local3.styleModule.unload();
_local4 = _local3.module;
_local4.unload();
_local4.removeEventListener(ModuleEvent.READY, _local3.readyHandler);
_local4.removeEventListener(ModuleEvent.ERROR, _local3.errorHandler);
styleModules[_arg1] = null;
};
if (_arg2){
styleDeclarationsChanged();
};
}
public function getColorName(_arg1:Object):uint{
var _local2:Number;
var _local3:*;
if ((_arg1 is String)){
if (_arg1.charAt(0) == "#"){
_local2 = Number(("0x" + _arg1.slice(1)));
return ((isNaN(_local2)) ? StyleManager.NOT_A_COLOR : uint(_local2));
};
if ((((_arg1.charAt(1) == "x")) && ((_arg1.charAt(0) == "0")))){
_local2 = Number(_arg1);
return ((isNaN(_local2)) ? StyleManager.NOT_A_COLOR : uint(_local2));
};
_local3 = colorNames[_arg1.toLowerCase()];
if (_local3 === undefined){
return (StyleManager.NOT_A_COLOR);
};
return (uint(_local3));
};
return (uint(_arg1));
}
public function isInheritingStyle(_arg1:String):Boolean{
return ((inheritingStyles[_arg1] == true));
}
public function get stylesRoot():Object{
return (_stylesRoot);
}
public function initProtoChainRoots():void{
if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_3_0){
delete _inheritingStyles["textDecoration"];
delete _inheritingStyles["leading"];
};
if (!stylesRoot){
stylesRoot = _selectors["global"].addStyleToProtoChain({}, null);
};
}
public function loadStyleDeclarations2(_arg1:String, _arg2:Boolean=true, _arg3:ApplicationDomain=null, _arg4:SecurityDomain=null):IEventDispatcher{
var module:IModuleInfo;
var styleEventDispatcher:StyleEventDispatcher;
var timer:Timer;
var timerHandler:Function;
var url = _arg1;
var update = _arg2;
var applicationDomain = _arg3;
var securityDomain = _arg4;
module = ModuleManager.getModule(url);
var readyHandler:Function = function (_arg1:ModuleEvent):void{
var _local2:IStyleModule = IStyleModule(_arg1.module.factory.create());
styleModules[_arg1.module.url].styleModule = _local2;
if (update){
styleDeclarationsChanged();
};
};
module.addEventListener(ModuleEvent.READY, readyHandler, false, 0, true);
styleEventDispatcher = new StyleEventDispatcher(module);
var errorHandler:Function = function (_arg1:ModuleEvent):void{
var _local3:StyleEvent;
var _local2:String = resourceManager.getString("styles", "unableToLoad", [_arg1.errorText, url]);
if (styleEventDispatcher.willTrigger(StyleEvent.ERROR)){
_local3 = new StyleEvent(StyleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local3.bytesLoaded = 0;
_local3.bytesTotal = 0;
_local3.errorText = _local2;
styleEventDispatcher.dispatchEvent(_local3);
} else {
throw (new Error(_local2));
};
};
module.addEventListener(ModuleEvent.ERROR, errorHandler, false, 0, true);
styleModules[url] = new StyleModuleInfo(module, readyHandler, errorHandler);
timer = new Timer(0);
timerHandler = function (_arg1:TimerEvent):void{
timer.removeEventListener(TimerEvent.TIMER, timerHandler);
timer.stop();
module.load(applicationDomain, securityDomain);
};
timer.addEventListener(TimerEvent.TIMER, timerHandler, false, 0, true);
timer.start();
return (styleEventDispatcher);
}
public function registerSizeInvalidatingStyle(_arg1:String):void{
sizeInvalidatingStyles[_arg1] = true;
}
public function clearStyleDeclaration(_arg1:String, _arg2:Boolean):void{
var _local3:CSSStyleDeclaration = getStyleDeclaration(_arg1);
if (((_local3) && ((_local3.selectorRefCount > 0)))){
_local3.selectorRefCount--;
};
delete _selectors[_arg1];
if (_arg2){
styleDeclarationsChanged();
};
}
public function get selectors():Array{
var _local2:String;
var _local1:Array = [];
for (_local2 in _selectors) {
_local1.push(_local2);
};
return (_local1);
}
public static function getInstance():IStyleManager2{
if (!instance){
instance = new (StyleManagerImpl);
};
return (instance);
}
}
}//package mx.styles
import flash.events.*;
import mx.modules.*;
import mx.events.*;
class StyleEventDispatcher extends EventDispatcher {
private function StyleEventDispatcher(_arg1:IModuleInfo){
_arg1.addEventListener(ModuleEvent.ERROR, moduleInfo_errorHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.PROGRESS, moduleInfo_progressHandler, false, 0, true);
_arg1.addEventListener(ModuleEvent.READY, moduleInfo_readyHandler, false, 0, true);
}
private function moduleInfo_progressHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.PROGRESS, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
dispatchEvent(_local2);
}
private function moduleInfo_readyHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.COMPLETE);
dispatchEvent(_local2);
}
private function moduleInfo_errorHandler(_arg1:ModuleEvent):void{
var _local2:StyleEvent = new StyleEvent(StyleEvent.ERROR, _arg1.bubbles, _arg1.cancelable);
_local2.bytesLoaded = _arg1.bytesLoaded;
_local2.bytesTotal = _arg1.bytesTotal;
_local2.errorText = _arg1.errorText;
dispatchEvent(_local2);
}
}
class StyleModuleInfo {
public var errorHandler:Function;
public var readyHandler:Function;
public var module:IModuleInfo;
public var styleModule:IStyleModule;
private function StyleModuleInfo(_arg1:IModuleInfo, _arg2:Function, _arg3:Function){
this.module = _arg1;
this.readyHandler = _arg2;
this.errorHandler = _arg3;
}
}
Section 402
//ColorUtil (mx.utils.ColorUtil)
package mx.utils {
import mx.core.*;
public class ColorUtil {
mx_internal static const VERSION:String = "3.0.0.0";
public static function adjustBrightness2(_arg1:uint, _arg2:Number):uint{
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (_arg2 == 0){
return (_arg1);
};
if (_arg2 < 0){
_arg2 = ((100 + _arg2) / 100);
_local3 = (((_arg1 >> 16) & 0xFF) * _arg2);
_local4 = (((_arg1 >> 8) & 0xFF) * _arg2);
_local5 = ((_arg1 & 0xFF) * _arg2);
} else {
_arg2 = (_arg2 / 100);
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
_local3 = (_local3 + ((0xFF - _local3) * _arg2));
_local4 = (_local4 + ((0xFF - _local4) * _arg2));
_local5 = (_local5 + ((0xFF - _local5) * _arg2));
_local3 = Math.min(_local3, 0xFF);
_local4 = Math.min(_local4, 0xFF);
_local5 = Math.min(_local5, 0xFF);
};
return ((((_local3 << 16) | (_local4 << 8)) | _local5));
}
public static function rgbMultiply(_arg1:uint, _arg2:uint):uint{
var _local3:Number = ((_arg1 >> 16) & 0xFF);
var _local4:Number = ((_arg1 >> 8) & 0xFF);
var _local5:Number = (_arg1 & 0xFF);
var _local6:Number = ((_arg2 >> 16) & 0xFF);
var _local7:Number = ((_arg2 >> 8) & 0xFF);
var _local8:Number = (_arg2 & 0xFF);
return ((((((_local3 * _local6) / 0xFF) << 16) | (((_local4 * _local7) / 0xFF) << 8)) | ((_local5 * _local8) / 0xFF)));
}
public static function adjustBrightness(_arg1:uint, _arg2:Number):uint{
var _local3:Number = Math.max(Math.min((((_arg1 >> 16) & 0xFF) + _arg2), 0xFF), 0);
var _local4:Number = Math.max(Math.min((((_arg1 >> 8) & 0xFF) + _arg2), 0xFF), 0);
var _local5:Number = Math.max(Math.min(((_arg1 & 0xFF) + _arg2), 0xFF), 0);
return ((((_local3 << 16) | (_local4 << 8)) | _local5));
}
}
}//package mx.utils
Section 403
//GraphicsUtil (mx.utils.GraphicsUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
public class GraphicsUtil {
mx_internal static const VERSION:String = "3.0.0.0";
public static function drawRoundRectComplex(_arg1:Graphics, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number):void{
var _local10:Number = (_arg2 + _arg4);
var _local11:Number = (_arg3 + _arg5);
var _local12:Number = ((_arg4 < _arg5)) ? (_arg4 * 2) : (_arg5 * 2);
_arg6 = ((_arg6 < _local12)) ? _arg6 : _local12;
_arg7 = ((_arg7 < _local12)) ? _arg7 : _local12;
_arg8 = ((_arg8 < _local12)) ? _arg8 : _local12;
_arg9 = ((_arg9 < _local12)) ? _arg9 : _local12;
var _local13:Number = (_arg9 * 0.292893218813453);
var _local14:Number = (_arg9 * 0.585786437626905);
_arg1.moveTo(_local10, (_local11 - _arg9));
_arg1.curveTo(_local10, (_local11 - _local14), (_local10 - _local13), (_local11 - _local13));
_arg1.curveTo((_local10 - _local14), _local11, (_local10 - _arg9), _local11);
_local13 = (_arg8 * 0.292893218813453);
_local14 = (_arg8 * 0.585786437626905);
_arg1.lineTo((_arg2 + _arg8), _local11);
_arg1.curveTo((_arg2 + _local14), _local11, (_arg2 + _local13), (_local11 - _local13));
_arg1.curveTo(_arg2, (_local11 - _local14), _arg2, (_local11 - _arg8));
_local13 = (_arg6 * 0.292893218813453);
_local14 = (_arg6 * 0.585786437626905);
_arg1.lineTo(_arg2, (_arg3 + _arg6));
_arg1.curveTo(_arg2, (_arg3 + _local14), (_arg2 + _local13), (_arg3 + _local13));
_arg1.curveTo((_arg2 + _local14), _arg3, (_arg2 + _arg6), _arg3);
_local13 = (_arg7 * 0.292893218813453);
_local14 = (_arg7 * 0.585786437626905);
_arg1.lineTo((_local10 - _arg7), _arg3);
_arg1.curveTo((_local10 - _local14), _arg3, (_local10 - _local13), (_arg3 + _local13));
_arg1.curveTo(_local10, (_arg3 + _local14), _local10, (_arg3 + _arg7));
_arg1.lineTo(_local10, (_local11 - _arg9));
}
}
}//package mx.utils
Section 404
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 405
//StringUtil (mx.utils.StringUtil)
package mx.utils {
import mx.core.*;
public class StringUtil {
mx_internal static const VERSION:String = "3.0.0.0";
public static function trim(_arg1:String):String{
if (_arg1 == null){
return ("");
};
var _local2:int;
while (isWhitespace(_arg1.charAt(_local2))) {
_local2++;
};
var _local3:int = (_arg1.length - 1);
while (isWhitespace(_arg1.charAt(_local3))) {
_local3--;
};
if (_local3 >= _local2){
return (_arg1.slice(_local2, (_local3 + 1)));
};
return ("");
}
public static function isWhitespace(_arg1:String):Boolean{
switch (_arg1){
case " ":
case "\t":
case "\r":
case "\n":
case "\f":
return (true);
default:
return (false);
};
}
public static function substitute(_arg1:String, ... _args):String{
var _local4:Array;
if (_arg1 == null){
return ("");
};
var _local3:uint = _args.length;
if ((((_local3 == 1)) && ((_args[0] is Array)))){
_local4 = (_args[0] as Array);
_local3 = _local4.length;
} else {
_local4 = _args;
};
var _local5:int;
while (_local5 < _local3) {
_arg1 = _arg1.replace(new RegExp((("\\{" + _local5) + "\\}"), "g"), _local4[_local5]);
_local5++;
};
return (_arg1);
}
public static function trimArrayElements(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:int;
var _local5:int;
if (((!((_arg1 == ""))) && (!((_arg1 == null))))){
_local3 = _arg1.split(_arg2);
_local4 = _local3.length;
_local5 = 0;
while (_local5 < _local4) {
_local3[_local5] = StringUtil.trim(_local3[_local5]);
_local5++;
};
if (_local4 > 0){
_arg1 = _local3.join(_arg2);
};
};
return (_arg1);
}
}
}//package mx.utils
Section 406
//Blocker (net.cladv.task.Blocker)
package net.cladv.task {
public class Blocker implements IBlocker {
private var _waitors:Array;
private var _blockable:Boolean;
public function Blocker(){
_waitors = new Array();
_blockable = false;
}
public function set blockable(_arg1:Boolean):void{
_blockable = _arg1;
}
public function notifyAll():void{
var _local1:Task;
for each (_local1 in _waitors) {
_local1.notify();
};
_waitors.splice(0);
}
public function addWaitor(_arg1:ITask):Boolean{
if ((((((_waitors.indexOf(_arg1) == -1)) && (_arg1.exist))) && (_blockable))){
_waitors.push(_arg1);
return (true);
};
return (false);
}
public function get blockable():Boolean{
return (_blockable);
}
}
}//package net.cladv.task
Section 407
//IBlocker (net.cladv.task.IBlocker)
package net.cladv.task {
public interface IBlocker {
function addWaitor(_arg1:ITask):Boolean;
}
}//package net.cladv.task
Section 408
//ITask (net.cladv.task.ITask)
package net.cladv.task {
public interface ITask {
function draw(_arg1):void;
function kill():void;
function addTask(_arg1:ITask, _arg2:Boolean=false):void;
function notifyAll():void;
function update(_arg1):void;
function get skip():Boolean;
function notify():void;
function waitFor(... _args):void;
function changeTask(_arg1:Function, _arg2:Function=null):void;
function get blockable():Boolean;
function get exist():Boolean;
function set suspend(_arg1:Boolean):void;
function addWaitor(_arg1:ITask):Boolean;
function set blockable(_arg1:Boolean):void;
function get suspend():Boolean;
function nextIs(_arg1:Function, _arg2:Function=null):void;
function set skip(_arg1:Boolean):void;
function skipUntil(... _args):void;
}
}//package net.cladv.task
Section 409
//RateStabilizer (net.cladv.task.RateStabilizer)
package net.cladv.task {
import flash.utils.*;
public class RateStabilizer {
private var _maxSkip:int;
private var _masterTask:Task;
private var _accumeratedDelay:int;
private var _frameSkip:Boolean;
private var _frameRate:int;
private var _startTime:int;
private var _frameSpan:int;
public function RateStabilizer(_arg1:Task, _arg2:int, _arg3:int=10){
_masterTask = _arg1;
frameRate = _arg2;
maxSkip = _arg3;
_frameSkip = true;
}
public function set frameRate(_arg1:int):void{
_frameRate = _arg1;
_frameSpan = (1000 / _frameRate);
}
public function get maxSkip():int{
return (_maxSkip);
}
public function get frameRate():int{
return (_frameRate);
}
public function process(_arg1, _arg2):void{
var _local4:int;
_startTime = getTimer();
_masterTask.update(_arg1);
_masterTask.draw(_arg2);
var _local3:int = ((getTimer() - _startTime) - _frameSpan);
if ((((_local3 > 0)) && (_frameSkip))){
_accumeratedDelay = (_accumeratedDelay + _local3);
_local4 = 0;
while ((((_accumeratedDelay >= _frameSpan)) && ((_local4 < maxSkip)))) {
_startTime = getTimer();
while (_accumeratedDelay >= _frameSpan) {
_masterTask.update(_arg1);
_local4++;
_accumeratedDelay = (_accumeratedDelay - _frameSpan);
};
_accumeratedDelay = (_accumeratedDelay + (getTimer() - _startTime));
};
if (_local4 >= maxSkip){
_accumeratedDelay = 0;
};
};
}
public function set maxSkip(_arg1:int):void{
_maxSkip = _arg1;
}
public function get frameSkip():Boolean{
return (_frameSkip);
}
public function set frameSkip(_arg1:Boolean):void{
if (((!(_frameSkip)) && (_arg1))){
_startTime = getTimer();
_accumeratedDelay = 0;
};
_frameSkip = _arg1;
}
}
}//package net.cladv.task
Section 410
//Task (net.cladv.task.Task)
package net.cladv.task {
public class Task implements IBlocker, ITask {
private var _suspendFlag:Boolean;
private var _waitCount:int;
private var _drawFunction:Function;
private var _nextDrawFunction:Function;
private var _blocker:Blocker;
private var _nextUpdateFunction:Function;
private var _killFlag:Boolean;
private var _tasksToAdd:Array;
private var _isWaitMethodSuspend:Boolean;
private var _children:Array;
private var _updateFunction:Function;
private var _skipFlag:Boolean;
public function Task(_arg1:Function=null, _arg2:Function=null){
_updateFunction = _arg1;
_drawFunction = _arg2;
_children = new Array();
_tasksToAdd = new Array();
_killFlag = false;
_suspendFlag = false;
_waitCount = 0;
}
public function set skip(_arg1:Boolean):void{
_skipFlag = _arg1;
}
public function set suspend(_arg1:Boolean):void{
_suspendFlag = _arg1;
}
public function get children():Array{
return (_children);
}
public function get exist():Boolean{
return (!(_killFlag));
}
public function waitFor(... _args):void{
var _local2:IBlocker;
_isWaitMethodSuspend = true;
for each (_local2 in _args) {
if (_local2.addWaitor(this)){
_waitCount++;
};
};
if (_waitCount != 0){
suspend = true;
};
}
public function notifyAll():void{
if (_blocker == null){
_blocker = new Blocker();
};
return (_blocker.notifyAll());
}
public function addWaitor(_arg1:ITask):Boolean{
if (_blocker == null){
_blocker = new Blocker();
};
return (_blocker.addWaitor(_arg1));
}
public function skipUntil(... _args):void{
var _local2:IBlocker;
_isWaitMethodSuspend = false;
for each (_local2 in _args) {
if (_local2.addWaitor(this)){
_waitCount++;
};
};
if (_waitCount != 0){
skip = true;
};
}
public function get suspend():Boolean{
return (_suspendFlag);
}
public function draw(_arg1):void{
var _local2:ITask;
if (((_suspendFlag) || (_killFlag))){
return;
};
if (((!((_drawFunction == null))) && (!(_skipFlag)))){
_drawFunction(_arg1);
};
for each (_local2 in _children) {
_local2.draw(_arg1);
};
}
public function addTask(_arg1:ITask, _arg2:Boolean=false):void{
if (_arg2){
_children.push(_arg1);
} else {
_tasksToAdd.push(_arg1);
};
}
public function set blockable(_arg1:Boolean):void{
if (_blocker == null){
_blocker = new Blocker();
};
_blocker.blockable = _arg1;
}
public function update(_arg1):void{
var _local5:Task;
var _local6:ITask;
var _local7:ITask;
if (_suspendFlag){
return;
};
if (((!((_updateFunction == null))) && (!(_skipFlag)))){
_updateFunction(_arg1);
};
var _local2:int = _children.length;
var _local3:int;
var _local4:int;
while (_local4 < _local2) {
_local5 = _children[_local4];
if (!_local5._killFlag){
_local5.update(_arg1);
} else {
_local6 = _children[_local3];
_children[_local3] = _local5;
_children[_local4] = _local6;
_local3++;
};
_local4++;
};
while (_local3 > 0) {
_children.shift();
_local3--;
};
if (_tasksToAdd.length != 0){
for each (_local7 in _tasksToAdd) {
_children.push(_local7);
};
_tasksToAdd.splice(0);
};
}
public function changeTask(_arg1:Function, _arg2:Function=null):void{
if (_arg1 != null){
_updateFunction = _arg1;
};
if (_arg2 != null){
_drawFunction = _arg2;
};
}
public function notify():void{
if (--_waitCount == 0){
if (_isWaitMethodSuspend){
suspend = false;
changeTask(_nextUpdateFunction, _nextDrawFunction);
} else {
skip = false;
changeTask(_nextUpdateFunction, _nextDrawFunction);
};
};
}
public function kill():void{
var _local1:ITask;
if (_blocker){
_blocker.notifyAll();
};
_killFlag = true;
for each (_local1 in _children) {
_local1.kill();
};
}
public function get blockable():Boolean{
if (_blocker == null){
_blocker = new Blocker();
};
return (_blocker.blockable);
}
public function nextIs(_arg1:Function, _arg2:Function=null):void{
_nextUpdateFunction = _arg1;
_nextDrawFunction = _arg2;
}
public function get skip():Boolean{
return (_skipFlag);
}
}
}//package net.cladv.task
Section 411
//EventDispatcherTask (net.cladv.tasks.EventDispatcherTask)
package net.cladv.tasks {
import net.cladv.task.*;
import flash.utils.*;
public class EventDispatcherTask extends Task implements IEventDispatcherTask {
private var _handlers:Dictionary;
private var _id:int;
private var _oneTimeFunctionReference:Dictionary;
public function EventDispatcherTask(_arg1:Function=null, _arg2:Function=null){
super(_arg1, _arg2);
_handlers = new Dictionary();
_oneTimeFunctionReference = new Dictionary();
_id = 0;
}
public function dispatchEvent(_arg1:String, _arg2=null):void{
var _local3:Function;
if (!(_arg1 in _handlers)){
return;
};
for each (_local3 in _handlers[_arg1]) {
_local3(_arg2);
};
}
public function addOneTimeEventListener(_arg1:String, _arg2:Function):int{
var anonFunc:Function;
var id:int;
var eventName = _arg1;
var handler = _arg2;
var _local4 = function (_arg1):void{
handler(_arg1);
removeEventListenerFromID(eventName, id);
delete _oneTimeFunctionReference[id];
};
anonFunc = _local4;
id = addEventListener(eventName, _local4);
_oneTimeFunctionReference[id] = anonFunc;
return (id);
}
public function addEventListener(_arg1:String, _arg2:Function):int{
var _local3:Dictionary;
if ((_arg1 in _handlers)){
_local3 = _handlers[_arg1];
} else {
_local3 = new Dictionary(true);
_handlers[_arg1] = _local3;
};
_id++;
_local3[_id] = _arg2;
return (_id);
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local4:String;
if (!(_arg1 in _handlers)){
return;
};
var _local3:Dictionary = _handlers[_arg1];
for (_local4 in _local3) {
if (_local3[_local4] === _arg2){
delete _local3[_local4];
return;
};
};
}
public function removeEventListenerFromID(_arg1:String, _arg2:int):void{
delete _handlers[_arg1][_arg2];
}
}
}//package net.cladv.tasks
Section 412
//IEventDispatcherTask (net.cladv.tasks.IEventDispatcherTask)
package net.cladv.tasks {
import net.cladv.task.*;
public interface IEventDispatcherTask extends ITask, IBlocker {
function dispatchEvent(_arg1:String, _arg2=null):void;
function removeEventListener(_arg1:String, _arg2:Function):void;
function addOneTimeEventListener(_arg1:String, _arg2:Function):int;
function addEventListener(_arg1:String, _arg2:Function):int;
function removeEventListenerFromID(_arg1:String, _arg2:int):void;
}
}//package net.cladv.tasks
Section 413
//SceneManager (net.cladv.tasks.SceneManager)
package net.cladv.tasks {
import net.cladv.task.*;
public class SceneManager extends Task {
private var _scenes:Array;
public function SceneManager(){
_scenes = new Array();
_scenes.push(new Task());
}
public function get currentScene():Task{
return (_scenes[(_scenes.length - 1)]);
}
public function jumpScene(_arg1:Task):void{
currentScene.kill();
_scenes[(_scenes.length - 1)] = _arg1;
addTask(_arg1);
}
public function returnScene():void{
(_scenes.pop() as Task).kill();
this.currentScene.suspend = false;
}
public function callScene(_arg1:Task):void{
currentScene.suspend = true;
_scenes.push(_arg1);
addTask(_arg1);
}
}
}//package net.cladv.tasks
Section 414
//_activeButtonStyleStyle (_activeButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 415
//_activeTabStyleStyle (_activeTabStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _activeTabStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".activeTabStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".activeTabStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 416
//_alertButtonStyleStyle (_alertButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _alertButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".alertButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".alertButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 734012;
};
};
}
}
}//package
Section 417
//_comboDropdownStyle (_comboDropdownStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _comboDropdownStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".comboDropdown");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".comboDropdown", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.shadowDirection = "center";
this.fontWeight = "normal";
this.dropShadowEnabled = true;
this.leading = 0;
this.backgroundColor = 0xFFFFFF;
this.shadowDistance = 1;
this.cornerRadius = 0;
this.borderThickness = 0;
this.paddingLeft = 5;
this.paddingRight = 5;
};
};
}
}
}//package
Section 418
//_dataGridStylesStyle (_dataGridStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dataGridStylesStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dataGridStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dataGridStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 419
//_dateFieldPopupStyle (_dateFieldPopupStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _dateFieldPopupStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".dateFieldPopup");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".dateFieldPopup", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.dropShadowEnabled = true;
this.backgroundColor = 0xFFFFFF;
this.borderThickness = 0;
};
};
}
}
}//package
Section 420
//_errorTipStyle (_errorTipStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _errorTipStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".errorTip");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".errorTip", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.borderStyle = "errorTipRight";
this.paddingTop = 4;
this.borderColor = 13510953;
this.color = 0xFFFFFF;
this.fontSize = 9;
this.shadowColor = 0;
this.paddingLeft = 4;
this.paddingBottom = 4;
this.paddingRight = 4;
};
};
}
}
}//package
Section 421
//_globalStyle (_globalStyle)
package {
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
public class _globalStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration("global");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("global", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fillColor = 0xFFFFFF;
this.kerning = false;
this.iconColor = 0x111111;
this.textRollOverColor = 2831164;
this.horizontalAlign = "left";
this.shadowCapColor = 14015965;
this.backgroundAlpha = 1;
this.filled = true;
this.textDecoration = "none";
this.roundedBottomCorners = true;
this.fontThickness = 0;
this.focusBlendMode = "normal";
this.fillColors = [0xFFFFFF, 0xCCCCCC, 0xFFFFFF, 0xEEEEEE];
this.horizontalGap = 8;
this.borderCapColor = 9542041;
this.buttonColor = 7305079;
this.indentation = 17;
this.selectionDisabledColor = 0xDDDDDD;
this.closeDuration = 250;
this.embedFonts = false;
this.paddingTop = 0;
this.letterSpacing = 0;
this.focusAlpha = 0.4;
this.bevel = true;
this.fontSize = 10;
this.shadowColor = 0xEEEEEE;
this.borderAlpha = 1;
this.paddingLeft = 0;
this.fontWeight = "normal";
this.indicatorGap = 14;
this.focusSkin = HaloFocusRect;
this.dropShadowEnabled = false;
this.leading = 2;
this.borderSkin = HaloBorder;
this.fontSharpness = 0;
this.modalTransparencyDuration = 100;
this.borderThickness = 1;
this.backgroundSize = "auto";
this.borderStyle = "inset";
this.borderColor = 12040892;
this.fontAntiAliasType = "advanced";
this.errorColor = 0xFF0000;
this.shadowDistance = 2;
this.horizontalGridLineColor = 0xF7F7F7;
this.stroked = false;
this.modalTransparencyColor = 0xDDDDDD;
this.cornerRadius = 0;
this.verticalAlign = "top";
this.textIndent = 0;
this.fillAlphas = [0.6, 0.4, 0.75, 0.65];
this.verticalGridLineColor = 14015965;
this.themeColor = 40447;
this.version = "3.0.0";
this.shadowDirection = "center";
this.modalTransparency = 0.5;
this.repeatInterval = 35;
this.openDuration = 250;
this.textAlign = "left";
this.fontFamily = "Verdana";
this.textSelectedColor = 2831164;
this.paddingBottom = 0;
this.strokeWidth = 1;
this.fontGridFitType = "pixel";
this.horizontalGridLines = false;
this.useRollOver = true;
this.verticalGridLines = true;
this.repeatDelay = 500;
this.fontStyle = "normal";
this.dropShadowColor = 0;
this.focusThickness = 2;
this.verticalGap = 6;
this.disabledColor = 11187123;
this.paddingRight = 0;
this.focusRoundedCorners = "tl tr bl br";
this.borderSides = "left top right bottom";
this.disabledIconColor = 0x999999;
this.modalTransparencyBlur = 3;
this.color = 734012;
this.selectionDuration = 250;
this.highlightAlphas = [0.3, 0];
};
};
}
}
}//package
Section 422
//_headerDateTextStyle (_headerDateTextStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDateTextStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDateText");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDateText", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.textAlign = "center";
};
};
}
}
}//package
Section 423
//_headerDragProxyStyleStyle (_headerDragProxyStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _headerDragProxyStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".headerDragProxyStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".headerDragProxyStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 424
//_linkButtonStyleStyle (_linkButtonStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _linkButtonStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".linkButtonStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".linkButtonStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 2;
this.paddingLeft = 2;
this.paddingBottom = 2;
this.paddingRight = 2;
};
};
}
}
}//package
Section 425
//_opaquePanelStyle (_opaquePanelStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _opaquePanelStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".opaquePanel");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".opaquePanel", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderColor = 0xFFFFFF;
this.backgroundColor = 0xFFFFFF;
this.headerColors = [0xE7E7E7, 0xD9D9D9];
this.footerColors = [0xE7E7E7, 0xC7C7C7];
this.borderAlpha = 1;
};
};
}
}
}//package
Section 426
//_plainStyle (_plainStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _plainStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".plain");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".plain", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.paddingTop = 0;
this.backgroundColor = 0xFFFFFF;
this.backgroundImage = "";
this.horizontalAlign = "left";
this.paddingLeft = 0;
this.paddingBottom = 0;
this.paddingRight = 0;
};
};
}
}
}//package
Section 427
//_popUpMenuStyle (_popUpMenuStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _popUpMenuStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".popUpMenu");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".popUpMenu", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "normal";
this.textAlign = "left";
};
};
}
}
}//package
Section 428
//_richTextEditorTextAreaStyleStyle (_richTextEditorTextAreaStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _richTextEditorTextAreaStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".richTextEditorTextAreaStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".richTextEditorTextAreaStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 429
//_swatchPanelTextFieldStyle (_swatchPanelTextFieldStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _swatchPanelTextFieldStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".swatchPanelTextField");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".swatchPanelTextField", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.borderStyle = "inset";
this.borderColor = 14015965;
this.highlightColor = 12897484;
this.backgroundColor = 0xFFFFFF;
this.shadowCapColor = 14015965;
this.shadowColor = 14015965;
this.paddingLeft = 5;
this.buttonColor = 7305079;
this.borderCapColor = 9542041;
this.paddingRight = 5;
};
};
}
}
}//package
Section 430
//_textAreaHScrollBarStyleStyle (_textAreaHScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaHScrollBarStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaHScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaHScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 431
//_textAreaVScrollBarStyleStyle (_textAreaVScrollBarStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _textAreaVScrollBarStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".textAreaVScrollBarStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".textAreaVScrollBarStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
};
};
}
}
}//package
Section 432
//_todayStyleStyle (_todayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _todayStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".todayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".todayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0xFFFFFF;
this.textAlign = "center";
};
};
}
}
}//package
Section 433
//_weekDayStyleStyle (_weekDayStyleStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _weekDayStyleStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".weekDayStyle");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".weekDayStyle", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
this.textAlign = "center";
};
};
}
}
}//package
Section 434
//_windowStatusStyle (_windowStatusStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStatusStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStatus");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStatus", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.color = 0x666666;
};
};
}
}
}//package
Section 435
//_windowStylesStyle (_windowStylesStyle)
package {
import mx.core.*;
import mx.styles.*;
public class _windowStylesStyle {
public static function init(_arg1:IFlexModuleFactory):void{
var fbs = _arg1;
var style:CSSStyleDeclaration = StyleManager.getStyleDeclaration(".windowStyles");
if (!style){
style = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(".windowStyles", style, false);
};
if (style.defaultFactory == null){
style.defaultFactory = function ():void{
this.fontWeight = "bold";
};
};
}
}
}//package
Section 436
//en_US$core_properties (en_US$core_properties)
package {
import mx.resources.*;
public class en_US$core_properties extends ResourceBundle {
public function en_US$core_properties(){
super("en_US", "core");
}
override protected function getContent():Object{
var _local1:Object = {multipleChildSets_ClassAndInstance:"Multiple sets of visual children have been specified for this component (component definition and component instance).", truncationIndicator:"...", notExecuting:"Repeater is not executing.", versionAlreadyRead:"Compatibility version has already been read.", multipleChildSets_ClassAndSubclass:"Multiple sets of visual children have been specified for this component (base component definition and derived component definition).", viewSource:"View Source", badFile:"File does not exist.", stateUndefined:"Undefined state '{0}'.", versionAlreadySet:"Compatibility version has already been set."};
return (_local1);
}
}
}//package
Section 437
//en_US$skins_properties (en_US$skins_properties)
package {
import mx.resources.*;
public class en_US$skins_properties extends ResourceBundle {
public function en_US$skins_properties(){
super("en_US", "skins");
}
override protected function getContent():Object{
var _local1:Object = {notLoaded:"Unable to load '{0}'."};
return (_local1);
}
}
}//package
Section 438
//en_US$styles_properties (en_US$styles_properties)
package {
import mx.resources.*;
public class en_US$styles_properties extends ResourceBundle {
public function en_US$styles_properties(){
super("en_US", "styles");
}
override protected function getContent():Object{
var _local1:Object = {unableToLoad:"Unable to load style({0}): {1}."};
return (_local1);
}
}
}//package
Section 439
//Main (Main)
package {
import flash.events.*;
import net.cladv.task.*;
import fbattle7.models.*;
import fbattle7.scenes.*;
import flash.display.*;
import net.cladv.tasks.*;
public class Main extends Sprite {
private var _masterTask:Task;
private var _gameInfo:GameInfo;
public function Main():void{
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
private function onAddedToStage(_arg1:Event):void{
_masterTask = new Task();
_gameInfo = new GameInfo();
_gameInfo.sceneManager = new SceneManager();
_gameInfo.stabilizer = new RateStabilizer(_masterTask, stage.frameRate);
_gameInfo.root = this;
_gameInfo.switcher = new SceneSwitcher(_gameInfo);
_masterTask.addTask(_gameInfo.sceneManager);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
_gameInfo.sceneManager.jumpScene(new SceneTitle(_gameInfo, true));
}
public function onEnterFrame(_arg1:Event):void{
_gameInfo.stabilizer.process(_gameInfo, _gameInfo);
}
}
}//package
Section 440
//PreLoader (PreLoader)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class PreLoader extends MovieClip {
private var _percentText:TextField;
private var _blinkText:TextField;
private var _blinkCounter:int;
private static const BLINK_TIME:Number = 30;
private static const BAR_COLOR:int = 16719904;
public function PreLoader(){
stop();
_blinkCounter = 0;
_blinkText = new TextField();
_percentText = new TextField();
var _local1:TextFormat = new TextFormat();
_local1.color = 0xFFFFFF;
_blinkText.defaultTextFormat = (_percentText.defaultTextFormat = _local1);
_blinkText.text = "click to start\nクリックでスタート";
_blinkText.x = 500;
_blinkText.y = 420;
_blinkText.selectable = false;
_blinkText.visible = false;
addChild(_blinkText);
_percentText.text = "0%";
_percentText.x = 300;
_percentText.y = 400;
_percentText.selectable = false;
addChild(_percentText);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
stage.addEventListener(MouseEvent.CLICK, onClick);
}
private function init():void{
var _local2:Object;
nextFrame();
var _local1:Class = Class(getDefinitionByName("Main"));
if (_local1){
_local2 = new (_local1);
addChild((_local2 as DisplayObject));
};
}
private function onClick(_arg1:MouseEvent):void{
if (framesLoaded == totalFrames){
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onClick);
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
removeChild(_percentText);
removeChild(_blinkText);
init();
stage.removeEventListener(MouseEvent.CLICK, onClick);
graphics.clear();
};
}
private function onEnterFrame(_arg1:Event):void{
graphics.clear();
var _local2:Number = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
if (_local2 == 1){
graphics.beginFill(BAR_COLOR);
graphics.drawRect(300, 400, 300, 20);
_percentText.text = "100%";
if (++_blinkCounter > BLINK_TIME){
_blinkCounter = 0;
_blinkText.visible = !(_blinkText.visible);
};
} else {
graphics.beginFill(BAR_COLOR);
graphics.drawRect(300, 400, (300 * _local2), 20);
_percentText.text = (String(int((_local2 * 100))) + "%");
};
}
}
}//package